Commit Graph

26 Commits

Author SHA1 Message Date
Trevor Gross
55b3f8b13d Enable f128 -> f16 tests on Linux
Since updating the docker images in
<https://github.com/rust-lang/compiler-builtins/pull/625>, it looks like
`__extendhftf2` and `__trunctfhf2` are available on all 64-bit Linux
platforms.
2024-06-25 23:57:08 +02:00
Trevor Gross
21690f7320 Skip f128 tests on powerpc64le
__addkf3 and __mulkf3 seem to hit a nondescript SIGILL. This is probably
likely to just be another Qemu limitation.
2024-06-22 06:05:25 -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
Trevor Gross
ccd179b231 Add f128 float to integer conversion functions
Add the following:

- `__fixtfsi`
- `__fixtfdi`
- `__fixtfti`
- `__fixunstfsi`
- `__fixunstfdi`
- `__fixunstfti`
2024-05-20 20:01:33 -04:00
Trevor Gross
2755f457f8 Implement f128 addition and subtraction 2024-05-15 07:19:17 -05:00
Aaron Kutch
94af8a8268 Delete redundant tests
The old tests were hacky and did not cover nearly as many cases as the new tests do.
2021-04-02 08:58:50 -05:00
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
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
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
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
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
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