Commit Graph

76 Commits

Author SHA1 Message Date
Trevor Gross
85cd4c0660 Fix some warnings from shellcheck 2024-09-28 21:24:44 -04:00
Trevor Gross
6cd17ff4d2 Add benchmarks for floating point math
This adds comparisons among the compiler-builtins function, system
functions if available, and optionally handwritten assembly.

These also help us identify inconsistencies between this crate and
system functions, which may otherwise go unnoticed if intrinsics get
lowered to inline operations rather than library calls.
2024-05-24 02:49:41 -04:00
Henry Wang
7d60c93165 Only run --features c for verbatim test 2024-05-21 01:09:47 +02:00
theKidOfArcrania
416be726df verbatim tests only need to build 2024-05-21 01:09:47 +02:00
theKidOfArcrania
fd290b1339 Properly escape /C and fix naming 2024-05-21 01:09:47 +02:00
theKidOfArcrania
e3d86a8350 Instead have cmd.exe dump out path 2024-05-21 01:09:47 +02:00
theKidOfArcrania
0000f98d73 Fix backslash 2024-05-21 01:09:47 +02:00
theKidOfArcrania
e246ba5a46 Use cmd.exe 2024-05-21 01:09:47 +02:00
theKidOfArcrania
24cb0c2bcc Fix CI 2024-05-21 01:09:47 +02:00
theKidOfArcrania
3fdef93258 Add tests for UNC paths on windows builds 2024-05-21 01:09:47 +02:00
Trevor Gross
4509315d2f Enable no-fail-fast for more usable test output 2024-05-15 07:19:17 -05:00
beetrees
229babb1d0 Add builtins for f16/f128 float conversions 2024-05-02 13:49:24 +02:00
Trevor Gross
1b679e5cee Apply some more fixes suggested by Shellcheck 2024-04-19 11:49:23 -04:00
Trevor Gross
a55604fd8c Add a way to run tests on non-linux machines
Allow using the `rust-lang/rust:nightly` docker image to run tests in
cases where the host rust and cargo cannot be used, such as non-linux
hosts.
2024-04-19 11:49:23 -04:00
trevyn
dc1321a5ca Remove duplicate symbol workaround 2024-03-28 14:19:13 +00:00
Amanieu d'Antras
68b5a7a0ad Clean up and rework CI script 2024-03-28 10:17:42 +00:00
trevyn
0808cdeb67 build: Allow building C compiler-rt fallbacks for wasm 2024-01-09 02:11:00 +04:00
Joseph Richey
5c294cedc0
Move from an "asm" flag to a "no-asm" feature flag (#386)
* Use a no-asm feature instead of an asm feature

This works better as core/alloc/std have trouble supporting default
featues in this crate.

Signed-off-by: Joe Richey <joerichey@google.com>

* Have no-asm disable arm assembly intrinsics

Signed-off-by: Joe Richey <joerichey@google.com>
2020-11-09 09:24:25 -06:00
Joseph Richey
34e35d74b6
Use REP MOVSQ/STOSQ on x86_64 (#365)
* mem: Move mem* functions to separate directory

Signed-off-by: Joe Richey <joerichey@google.com>

* memcpy: Create separate memcpy.rs file

Signed-off-by: Joe Richey <joerichey@google.com>

* benches: Add benchmarks for mem* functions

This allows comparing the "normal" implementations to the
implementations provided by this crate.

Signed-off-by: Joe Richey <joerichey@google.com>

* mem: Add REP MOVSB/STOSB implementations

The assembly generated seems correct:
    https://rust.godbolt.org/z/GGnec8

Signed-off-by: Joe Richey <joerichey@google.com>

* mem: Add documentations for REP string insturctions

Signed-off-by: Joe Richey <joerichey@google.com>

* Use quad-word rep string instructions

Signed-off-by: Joe Richey <joerichey@google.com>

* Prevent panic when compiled in debug mode

Signed-off-by: Joe Richey <joerichey@google.com>

* Add tests for mem* functions

Signed-off-by: Joe Richey <joerichey@google.com>

* Add build/test with the "asm" feature

Signed-off-by: Joe Richey <joerichey@google.com>

* Add byte length to Bencher

Signed-off-by: Joe Richey <joerichey@google.com>
2020-10-24 10:58:04 -05:00
Alex Crichton
63982a3b9e
Expand wasm32 testing on CI (#360)
* Expand wasm32 testing on CI

Run the full `run.sh` test script to get full assertions, including that
nothing in the wasm compiler-builtins is panicking. Unfortunately it's
currently panicking, so this is good to weed out!

* Update libm
2020-05-29 14:38:29 -05:00
Alex Crichton
0e69cc8817
Switch to using llvm_asm! instead of asm! (#351)
* Switch to using `llvm_asm!` instead of `asm!`

* Run rustfmt

* Fix how LTO is specified on nightly
2020-04-29 15:30:10 -05:00
Alex Crichton
b84b7143e8 Remove compiler-rt submodule from this repository
This commit removes the `compiler-rt` submodule from this repository.
The goal here is to align the `compiler-rt` used for compiling C
intrinsics with the upstream rust-lang/rust's usage of `llvm-project`.
Currently we have both an `llvm-project` repository as well as
`compiler-rt`, but they can naturally get out of sync and it's just one
more submodule to manage.

The thinking here is that the feature `c` for this crate, when
activated, will require the user to configure where the source code for
`compiler-rt` is present. This places the onus on the builder of
`compiler-builtins` to check-out and arrange for the appropriate
`compiler-rt` source code to be placed somewhere. For rust-lang/rust
this is already done with the `llvm-project` submodule, and we can
arrange for it to happen on this crate's CI anyway.

For users of this crate this is a bit of a bummer, but `c` is disabled
by default anyway and it seems unlikely that `c` is explicitly opted in
to all that much. (given the purpose of this crate)

This should allow us to archive the `compiler-rt` repository and simply
use `llvm-project` in the rust-lang/rust repository.
2019-05-16 07:50:20 -07:00
Alex Crichton
f567dbb36b 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
6ddcff1475 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
0899a164ed 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
742b0330c5 Try to handle thumb targets and xargo 2019-04-02 11:54:20 -07:00
Alex Crichton
1af471e00b Use nm on OSX
Looks like it may be fixed now?
2018-11-21 10:48:58 -08:00
Paolo Teti
d7799358e4 Remove no_std features
Everything default unconditionally to #![no_std].
2018-02-25 09:19:34 +01:00
Paolo Teti
81356ccde4 Keep mangled-names as a default feature 2018-02-25 01:11:49 +01:00
Paolo Teti
64ea229988 Fix CI for thumb* targets
Main fix is inside 'utest' all the rest are minor fixes due to the
new 'testcrate'.

Still allow failures on TravisCI for a while.
2018-02-18 18:15:57 +01:00
Alex Crichton
41290fe728 Simplify how testing is done
All tests are moved to a separate crate in this repository to enable features by
default. Additionally the test generation is moved to a seprate build script and
simplified to reduce the amount of boilerplate needed per test.

Overall this should still be testing everything, just in a different location!
2018-01-31 11:32:20 -08:00
Alex Crichton
dbaa47027e Work around japaric/xargo#186 temporarily 2017-12-26 12:20:17 -08:00
Alex Crichton
4481a6c4ab Disable incremental + LTO
This causes errors in more recent versions of rustc
2017-12-26 10:14:11 -08:00
Alex Crichton
a46f33ce48 Work around OSX on Travis 2017-11-02 11:14:05 -07:00
Alex Crichton
2fa53c4b67 Don't mangle probes all the time 2017-07-07 20:35:14 -07:00
Jorge Aparicio
326c0bb597 enable tests now that #150 has been fixed 2017-06-27 22:48:57 -05:00
Alex Crichton
6792390e3e Enable the intrinsics program on thumb 2017-06-25 10:09:50 -07:00
Alex Crichton
f9db3c5b32 Don't test mangled names on thumb
We are both the "real compiler-rt" and the "to be tested one".
2017-06-24 12:54:35 -07:00
Alex Crichton
e7008c8609 Don't check for references to panics with debug assertions 2017-06-24 11:44:50 -07:00
Alex Crichton
90dab55cb0 Don't try to work with cargo test 2017-06-24 10:22:49 -07:00
Alex Crichton
cf1419e538 Add a FIXME for Windows 2017-06-24 10:12:17 -07:00
Alex Crichton
cec593c2aa Tweak testing and such:
* Don't run `intrinsics` tests on thumb
* Disable `compiler_builtins` attribute on `feature = "gen-tests"`
* Disable mangling on `feature = "gen-tests"` instead of `cfg(test)`
2017-06-24 10:10:04 -07:00
Alex Crichton
1614443a68 Try to fix run.sh on AppVeyor 2017-06-23 21:36:36 -07:00
Alex Crichton
80112d198d Use the same CI script on AppVeyor 2017-06-23 21:23:52 -07:00
Alex Crichton
6db18f6536 Handle aeabi aliasing
Objects in compiler-rt may have two symbols, so this makes sure that we don't
bring in those objects by accident by defining the aliases ourselves.
2017-06-23 15:55:11 -07:00
Alex Crichton
4dbe3aaf2d Use nm to weed out panics 2017-06-23 11:52:22 -07:00
Alex Crichton
e8d550ee51 Less verbose output on symbol check 2017-06-23 10:44:29 -07:00
Alex Crichton
e798d1bf81 Enable mem for intrinsics on linux 2017-06-23 09:59:49 -07:00
Alex Crichton
b6a4de6be5 Fix features needed for the intrinsics example 2017-06-23 08:35:24 -07:00
Alex Crichton
43bb211be8 Fix travis intrinsics builds 2017-06-23 08:19:11 -07:00