Commit Graph

240 Commits (18f2d2d4ce84e24fd4d63c7cf6178fd9f360a0c8)

Author SHA1 Message Date
Ralf Jung 25edd204fa remove unused imports 2019-07-13 11:00:15 +02:00
Ralf Jung ebeace71ce avoid ptr::write which might panic in debug mode 2019-07-13 10:55:54 +02:00
varkor bf3a9e9d0b Update libm for fmin/fmax/fminf/fmaxf 2019-06-05 23:41:18 +01:00
Alex Crichton cf98161da7 Remove the need for #[cfg] in #[use_c_shim_if]
This commit tweaks the implementation of the synthetic
`#[use_c_shim_if]` attribute, renaming it to
`#[maybe_use_optimized_c_shim]` in the process. This no longer requires
specifying a `#[cfg]` clause indicating when the optimized intrinsic
should be used, but rather this is inferred and printed from the build
script.

The build script will now print out appropriate `#[cfg]` directives for
rustc to indicate what intrinsics it's compiling. This should remove the
need for us to keep the build script and the source in sync, but rather
the build script can simply take care of everything.
2019-05-15 12:59:31 -07:00
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