Aaron Kutch
500c8e0b2c
add clippy to CI
2021-04-02 16:53:09 -05:00
Aaron Kutch
9ae3728e5e
fix CTFE cycle
2021-04-02 09:24:00 -05:00
Aaron Kutch
ec4fc5dab5
refactor float conversion
2021-04-02 08:58:50 -05:00
Aaron Kutch
0ce47b3c1f
fix abs_diff bug
2021-04-02 08:57:25 -05:00
est31
57205c0b86
Use the newly stabilized BITS constant on the integer types
2021-02-05 23:40:17 +01:00
Aaron Kutch
e5b667554e
Remove count_ones ( #399 )
2021-01-04 09:17:44 -06:00
Aaron Kutch
69a3c571f7
Completely overhaul fuzz testing
...
adds testing for almost every numerical intrinsic
2020-12-08 11:42:28 -06:00
Aaron Kutch
cb4e9755b8
Remove WideInt
2020-12-07 23:26:13 -06:00
Aaron Kutch
fac884b0c4
Completely replace LargeInt
2020-12-07 23:20:39 -06:00
Aaron Kutch
e049a30964
Introduce the DInt and HInt traits
...
and add various methods that will be used for improved fuzzing
2020-11-27 23:38:30 -06:00
Amanieu d'Antras
9c3ea6ad97
Merge pull request #332 from AaronKutch/issue-265
2020-09-03 20:52:23 +01: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
5386117b97
Remove unused code
2020-07-28 13:46:51 -05:00
Aaron Kutch
7652f288d3
Improve __clzsi2 performance ( #366 )
2020-07-28 13:09:18 -05:00
Tomasz Miąsko
ca827eb234
Use crate visibility for traits ( #358 )
...
Co-authored-by: Tomasz Miąsko <tomasz.miasko@gmail.com >
2020-05-26 15:12:10 -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
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
b2cfc3a4f1
Run rustfmt over everything
2019-05-14 14:40:38 -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
Lokathor
8b002dcd52
Attempt to use intrinsics!
2019-01-04 19:17:02 -07:00
Lokathor
86de741356
Move clzi2 into the int module
2018-12-21 18:02:12 -07:00
Scott McMurray
f468c28f74
Another attempt at making MIPS happy
...
(I really don't understand how arithmetic makes it segfault...)
2017-11-25 07:00:26 -08:00
Scott McMurray
ff97668431
Implement all the 128-bit operator lang items from rust PR 46093
2017-11-25 04:21:05 -08:00
Oliver Geller
5923e278c3
Implement mulsf3 and muldf3
2017-11-08 17:36:34 -05:00
est31
5ce08df93e
Remove duplication by adding a macro
2017-09-14 17:39:25 +02:00
est31
f2794913f3
Convert add! to a function
2017-09-14 17:33:44 +02:00
est31
13477e488f
Convert int_to_float! to a function
2017-09-14 16:32:50 +02:00
est31
f1bab6229d
Convert float_to_int! into a function
2017-09-14 14:59:32 +02:00
est31
985e578acd
Refactor int builtins to use associated consts
2017-09-13 22:09:31 +02:00
Alex Crichton
c785055bd9
Remove usage of unwrap_or_else
2017-06-23 21:31:54 -07:00
Alex Crichton
e80da4a48a
Port sdiv to traits + intrinsics!
...
Enhance `intrinsics!` along the way!
2017-06-22 23:09:28 -07:00
Alex Crichton
285a69b29c
Port mul intrinsics to traits
...
Also add a few features to the `intrinsics!` macro
2017-06-22 22:36:37 -07:00
Alex Crichton
13d1c5ce18
Remove executable bit from mod.rs
2017-06-22 22:04:40 -07:00
Alex Crichton
bd4a416457
Use traits instead of macros for shift intrinsics
...
This is an attempt to tidy up the definition of intrinsics by making them more
rust-like at the definition site and using traits instead of macros for the
definition. Additionally the helper macro, `intrinsics!`, now fills in a
definition for #[cfg]'d off intrinsics when compiling with C code
2017-06-22 22:03:07 -07:00
est31
915c2fd0d3
Fix overflow bug when creating the absolute value
...
Previously, the tests failed on some platforms due to it.
2017-05-08 04:30:48 +02:00
Jorge Aparicio
1f26fea5d4
refactor 'impl Int'
2017-03-06 12:17:10 -05:00
Wilfried Chauveau
b3e33508a0
impl (unsigned/signed) int to single/double precision float conversion based on llvm algorithms.
2017-03-06 11:55:57 -05:00
est31
9fd610d859
Macro-ify udivmod
2017-02-02 22:03:42 +01:00
est31
8bb1010d51
int module: macro-ify trait impls and add {u,i}128 support
2017-02-02 21:36:02 +01:00
Matt Ickstadt
35d68d8ab2
Move integer functions to separate module
2016-08-20 15:55:06 -05:00