Commit Graph

39 Commits

Author SHA1 Message Date
Aaron Kutch
f61c411e2b fix some clippy warnings 2020-12-07 23:26:26 -06:00
Aaron Kutch
26681724f3 replace some transmutes 2020-12-07 23:26:25 -06: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
53daa3c593
Use REP MOVSB/STOSB when the ERMSB feature is present (#392)
* Reorganize mem functions

This reduces the amount of platform-specific code

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

* Use ERMSB implementations if the feature is set

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

* Add non-aligned benchmarks

Signed-off-by: Joe Richey <joerichey@google.com>
2020-11-03 08:57:08 -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
Amanieu d'Antras
9c3ea6ad97
Merge pull request #332 from AaronKutch/issue-265 2020-09-03 20:52:23 +01:00
Aaron Kutch
92f0680743 Add __divmodti4 2020-08-29 18:02:57 -05:00
Aaron Kutch
d1c8673332 Use specialized-div-rem 1.0.0 for division algorithms 2020-08-14 15:31:36 -05:00
Max Audron
66f5688d60 add 32 bit shift instructions
* add 32 bit shift instructions to src/int/shift.rs
  __ashlsi3
  __ashrsi3
  __lshrsi3

* add int_impl! for 16 bit numbers and large_int! for i32 and u32

* add tests in testcrate/build.rs
2020-08-13 12:46:28 +02:00
Aaron Kutch
7652f288d3
Improve __clzsi2 performance (#366) 2020-07-28 13:09:18 -05:00
Runji Wang
304028b2ed Fix compile error on x86_64-unknown-uefi target (#331)
* fix compile error on x86_64-unknown-uefi target

* Fix tests on nightly
2019-12-10 09:02:14 -08:00
Alex Crichton
3f473cd3f3
Allow FFI-unsafe warnings for u128/i128 (#323)
* Allow FFI-unsafe warnings for u128/i128

Handle new warnings on nightly, and we shouldn't need to worry about
these with compiler-builtins since this is tied to a particular compiler.

* Clean up crate attributes

* No need for stability marker
* Rustdoc docs not used for this crate
* Remove old build-system related cruft from rustc itself.

* Run `cargo fmt`
2019-11-11 12:19:10 -06:00
Alex Crichton
a292bd9cb5 Modernize the testcrate slighty
* Update `rand` dependency
* Drop `cast` in favor of explicit casting or crate-defined
* Move build script to 2018 edition
2019-08-19 14:02:08 -07:00
bjorn3
4ca09454a8 Fix tests 2019-07-13 12:27:58 +02:00
Alex Crichton
b2cfc3a4f1 Run rustfmt over everything 2019-05-14 14:40:38 -07:00
Alex Crichton
21513cdcc2 Enable historically segfaulting tests on MIPS
They seem to be passing locally so let's see what CI has to say.

Closes #137
2019-05-02 13:44:20 -07:00
Lokathor
a68950646f Move the test to be a standard test. 2019-01-02 18:50:11 -07:00
Lokathor
d422c9a587 Okay we'll process outputs as all u32 2018-12-21 18:55:01 -07:00
Lokathor
fe9b17acec Rust and LLVM don't spec the same output types 2018-12-21 18:47:03 -07:00
Lokathor
e5123b4625 forgot the little .0 part 2018-12-21 18:36:26 -07:00
Lokathor
e495054f89 64, not 128! 2018-12-21 18:21:47 -07:00
Lokathor
734b5c261a We can't accept usize directly, i guess accept MyU64? 2018-12-21 18:20:59 -07:00
Lokathor
a57c899eb1 trying a test case for clzsi2 2018-12-21 18:10:45 -07:00
Alex Crichton
dbdcd66e35 Revert "Conversion from a wider to a narrower IEEE-754 floating-point type"
This reverts commit baab4fd89cdd945e46fed31166e5dcad7224ed87.
2018-10-30 10:51:11 -07:00
Paolo Teti
45a42b5b89 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
99d7dde58d Attempt to fix tests on latest nightly 2018-05-11 16:45:30 -07:00
Paolo Teti
6fedebb166 Add missing test cases for __unordsf2/__unorddf2 2018-02-25 18:35:36 +01:00
Paolo Teti
20de84d127 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
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
ef48c1984b testcrate/lib.rs: use #![no_std] unconditionally 2018-02-25 00:22:39 +01:00
Paolo Teti
e319f042fd Use upstream for utest
Fix has been merged into upstream.
2018-02-24 22:48:27 +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
Paolo Teti
b2aea631fe 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
178b78b924 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
Paolo Teti
0af69177f9 Add generic conversion from a narrower to a wider FP type
Add `extend` module to implement conversion from a narrower to a wider
floating-point type.

This implementation is only intended to support *widening* operations.
Module to convert a *narrower* floating-point will be added in the future.
2018-02-08 18:20:45 +01:00
Paolo Teti
97e6b3712a Add support for sub*f3vfp and add*f3vfp
As done before for mul and div let's use extern "C" to generate `"aapcs"`
or `"aapcs-vfp"` depending on target configuration.
2018-02-04 18:34:31 +01:00
Paolo Teti
07c82d2200 Fix __aeabi_fcmple and add test cases
`le` in __aeabi_fcmple means `less or equal`
2018-02-04 10:56:02 +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