Commit Graph

236 Commits

Author SHA1 Message Date
Alex Crichton c88c9502b7 Run rustfmt over everything 2019-05-14 14:40:38 -07:00
Alex Crichton 8521530f49 Fix __divsi3 and __udivsi3 on thumbv6m targets
This commit fixes a bug accidentally introduced in #285 where some
lingering references remained to `#[cfg(thumbv6m)]` but this, since the
historical revert, was renamed to `#[cfg(thumb_1)]`. This caused on the
thumbv6m platform for the intrinsics to be accidentally omitted because
the build script didn't actually compile them but the Rust code thought
the C code was in use.

After correcting the `#[cfg]` statements the CI configuration for the
`thumb*` family of targets was all updated. The support for xargo
testing was removed from `run.sh` since it had long since bitrotted, and
the script was updated to simply build the intrinsics example to attempt
to link for each of these targets. This in turn exposed the bug locally
and allowed to confirm a fix once the `#[cfg]` statements were
corrected.

cc rust-lang/rust#60782
2019-05-14 12:26:09 -07:00
Alex Crichton 4addb9bab9
Merge pull request #286 from alexcrichton/fix-dupe
Fix duplicate symbol __clzsi2
2019-05-02 17:17:52 -05:00
Alex Crichton 80a998df92 Fix duplicate floatdisf symbol on Windows MSVC 2019-05-02 14:22:19 -07:00
Alex Crichton 2668e5754d
Merge pull request #284 from alexcrichton/ldexp
Include `ldexp*` intrinsics on the wasm target
2019-05-02 16:17:33 -05:00
Alex Crichton 752e35a11f Fix duplicate symbol __clzsi2
Looks like our tests weren't quite testing compiler-builtins when it was
compiled with unmangled symbols, so update the tests to catch this and
then fix the compilation of the `__clzsi2` intrinsic to use the C
version if it's compiled.
2019-05-02 13:35:50 -07:00
Alex Crichton 4bbc838ac7 Revert "Use the Rust implementation of udivsi3 on ARM"
This reverts commit 681aaa914d.
2019-05-02 12:49:19 -07:00
Alex Crichton 4012b9c4f5 Include `ldexp*` intrinsics on the wasm target
Looks like LLVM optimizes programs like:

    fn foo(a: u8) -> f32 {
        2.0f32.powf(a as f32)
    }

to actually invoking `ldexpf`, so let's be sure to include bindings so
there's not undefined symbols.
2019-05-02 12:40:39 -07:00
Goirad aec945a708
Added missing fdim signature 2019-04-29 14:42:14 -07:00
Alex Crichton e95ef7a5ef Don't compile math symbols on wasm32-unknown-wasi
These are already provided by the C sysroot, so no need for us to
duplicate them!
2019-04-02 07:46:06 -07:00
Hugues de Valon c924aed0b9 Fix Armv8-M Baseline compilation
Armv8-M Baseline, ie thumbv8m.base-none-eabi, is a superset of the
Armv6-M architecture profile. As it shares almost the same instruction
set, this commit copies the configuration for thumbv6m-none-eabi to
enable it.
2019-03-14 12:58:23 +00:00
Jordan Rhee 803d16ee84 Fix undefined symbol errors on windows/arm
Fix undefined symbol linker errors when building rust for windows/arm
by excluding unneeded symbols. The errors are:

  = note: lib.def : error LNK2001: unresolved external symbol __aeabi_memclr4
  lib.def : error LNK2001: unresolved external symbol __aeabi_memclr8
  lib.def : error LNK2001: unresolved external symbol __aeabi_memmove4
  lib.def : error LNK2001: unresolved external symbol __aeabi_memmove8
2019-02-27 11:39:49 -08:00
Cyryl Płotnicki b570ccfd2d Fix compilation on new nightly.
Compilation on rustc 1.33.0-nightly (c76f3c374 2019-01-18) failed with
```
error: the feature `cfg_target_vendor` has been stable since 1.33.0 and no longer requires an attribute to enable
  --> src/lib.rs:19:12
   |
19 | #![feature(cfg_target_vendor)]
   |            ^^^^^^^^^^^^^^^^^
   |
```

Removed the attribute to make it compile.
2019-01-20 09:33:55 +00:00
Alex Crichton 9710af9a33
Merge pull request #267 from Lokathor/master
Adding __clzsi2
2019-01-07 09:36:45 -06:00
Lokathor 9a68e74ebd Attempt to use `intrinsics!` 2019-01-04 19:17:02 -07:00
Yu Ding a9a108548c Fix SGX target_env collision
Signed-off-by: Yu Ding <dingelish@gmail.com>
2019-01-03 12:53:08 -08:00
akashfortanix 09a2d437f5 expose ceil, floor and trunc on sgx-target 2018-12-27 19:13:50 +05:30
Lokathor 4e3fc640df Move clzi2 into the int module 2018-12-21 18:02:12 -07:00
Lokathor a74490a75b modify to fit into standard rustfmt output 2018-12-20 17:53:10 -07:00
Lokathor 3080360beb start of __clzsi2 2018-12-20 17:47:57 -07:00
Jethro Beekman e43c838450 Add SGX target 2018-11-21 14:07:57 +05:30
Jethro Beekman 14685d238b Add f32 versions of WebAssembly math functions 2018-11-21 14:07:03 +05:30
Alex Crichton 939cbca6e9 Revert "Conversion from a wider to a narrower IEEE-754 floating-point type"
This reverts commit baab4fd89c.
2018-10-30 10:51:11 -07:00
Paolo Teti baab4fd89c Conversion from a wider to a narrower IEEE-754 floating-point type
Adds generic conversion from a wider to a narrower IEEE-754
floating-point type.

Implement `__truncdfsf2` and `__truncdfsf2vfp` and associated test-cases.
2018-09-17 19:53:04 +02:00
Alex Crichton 4bbfb7e266
Merge pull request #256 from jordanrh1/windows-arm
Support windows/arm target
2018-09-07 10:08:01 -07:00
Jordan Rhee 78f544f57d Support windows/arm target 2018-09-06 09:27:24 -07:00
Alex Crichton 0703bfa725 Fix some `use_c_shim_if` directives
This was an accidental regression introduced in #252 by removing compilation of
C files without adjusting the `#[use_c_shim_if]` directives. This restores the
compilation of the assembly files and updates the `#[use_c_shim_if]` directives.
2018-09-04 10:21:06 -07:00
Alex Crichton 605b439ad3 Fix compile on riscv again 2018-08-31 16:00:12 -07:00
Alex Crichton cdbad7225f Fix compilation on riscv32 2018-08-30 14:13:15 -07:00
Adrian Bunk 8a0033ebfc Fix __sync_fetch_and_nand_* for pre-v6 ARM
gcc changed semantics for __sync_fetch_and_nand_* in gcc 4.4,
and this was implementing the old semantics:
https://gcc.gnu.org/onlinedocs/gcc-8.2.0/gcc/_005f_005fsync-Builtins.html
2018-08-18 12:29:01 +03:00
David Craven 6dcbd85f11
Implement __mulsi3. 2018-07-27 23:03:24 +02:00
Jorge Aparicio 1083ac1439 fix warnings 2018-07-24 16:57:22 -05:00
Jorge Aparicio 3d005629b8 expose fmod{,f} symbols on thumb
these symbols are required for the built-in operation `f32 % f32`
2018-07-24 13:26:50 -05:00
Alex Crichton d73ccba988 Use `intrinsics!` macro for math intrinsics
Make sure they respect the `mangled-names` feature as well as have the `"C"`
ABI.
2018-07-18 10:04:33 -07:00
Jorge Aparicio cc78ff665d fix path 2018-07-18 11:36:24 -05:00
Jorge Aparicio 36f93dbd79 expose math symbol on wasm32-unknown-unknown 2018-07-18 11:34:20 -05:00
ljedrz 411a12fc02 Remove #![feature(i128_type)] as i128 is stable 2018-07-12 14:40:56 +02:00
Masaki Hara 1d15be6a86 Explain why we need extra check in probestack. 2018-05-28 13:29:35 +09:00
Masaki Hara 56293ad7c7 Fix segfault on probestack with dynamic alloca. 2018-05-27 23:28:17 +09:00
Alex Crichton cb04a0718b
Merge pull request #234 from ketsuban/master
Add __floatdisf and __floatundisf intrinsics
2018-04-05 10:06:16 -05:00
Tim Neumann 5be54652e9 Fix incorrect names used / generated on ARM 2018-03-27 14:32:01 +02:00
Mark Mansi 09974df5a7 stable_features allowed temporarily 2018-03-20 19:16:13 -05:00
Mark Mansi 29816fc5d7 Put back feature 2018-03-18 14:07:01 -05:00
Mark Mansi 0ca2a57f1b i128 is being stabilized 2018-03-17 21:37:35 -05:00
Thomas Winwood 92b259c3ad Add __floatdisf and __floatundisf intrinsics 2018-03-14 14:56:01 +00:00
Paolo Teti 28c57e7212 Add __ledf2vfp and __lesf2vfp
Now that `73884ae` is in some nightly release We can add ledf2vfp/leds2vfp
and so these two functions be aliased to aeabi_fcmple/aeabi_dcmple on soft-float targets.
2018-02-25 17:50:56 +01:00
Paolo Teti 280012b1df Fix thumbv6m build (feature=c)
1. Avoid undefined references as:
   undefined reference to `__modsi3'
   undefined reference to `__umodsi3'

2. We can't remove assembly implementations that are not in the list
2018-02-16 17:34:01 +01:00
Paolo Teti e7bf03019c Collection of VFP intrinsics
Nothing really exciting here. LLVM on hard-float target use native instructions
for all listed VFP intrinsics and so resulting implementation is really trivial.

Implemented intrinsics:

 __gesf2vfp
 __gedf2vfp
 __gtsf2vfp
 __gtdf2vfp
 __ltsf2vfp
 __ltdf2vfp
 __nesf2vfp
 __nedf2vfp
 __eqsf2vfp
 __eqdf2vfp
 __extendsfdf2vfp
2018-02-11 23:46:56 +01:00
Paolo Teti 2cb290afa3 Fix __subsf3 and __subdf3 on x86
Be sure to do not mix hard-float and soft-float calls.
Disassembled code show exactly this.
So replace add with an explicit call to __addsf3/__adddf3

This seems the root cause of some sporadic failures.
2018-02-09 20:35:55 +01:00
Paolo Teti 306764b091 Fix issue extending f32::MIN/MAX to f64 and improve testcrate.
I was able to trigger an issue extending f32::MAX or f32::MIN to a f64.
Issue was not triggered by `testcrate` mainly because f32::MAX/MIN are
not in the list of special values to generate.

This PR fix the issue and improve `testcrate` adding MAX/MIN/MIN_POSITIVE
in the list of special values.
2018-02-09 17:23:16 +01:00