Commit Graph

26 Commits (d0ea0765aa76b7e9ea146e86db1d24e9b17443ba)

Author SHA1 Message Date
Tomasz Miąsko d0ea0765aa
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 cde22bc180
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 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 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
Lokathor 9a68e74ebd Attempt to use `intrinsics!` 2019-01-04 19:17:02 -07:00
Lokathor 4e3fc640df Move clzi2 into the int module 2018-12-21 18:02:12 -07:00
Scott McMurray ba750103a3 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 5e71218390 Implement all the 128-bit operator lang items from rust PR 46093 2017-11-25 04:21:05 -08:00
Oliver Geller 897048543f Implement mulsf3 and muldf3 2017-11-08 17:36:34 -05:00
est31 0cd476220b Remove duplication by adding a macro 2017-09-14 17:39:25 +02:00
est31 3efae7f7d9 Convert add! to a function 2017-09-14 17:33:44 +02:00
est31 482d98318f Convert int_to_float! to a function 2017-09-14 16:32:50 +02:00
est31 ff63f7b80f Convert float_to_int! into a function 2017-09-14 14:59:32 +02:00
est31 c9a261895e Refactor int builtins to use associated consts 2017-09-13 22:09:31 +02:00
Alex Crichton 2147753559 Remove usage of unwrap_or_else 2017-06-23 21:31:54 -07:00
Alex Crichton 7886ae275b Port sdiv to traits + `intrinsics!`
Enhance `intrinsics!` along the way!
2017-06-22 23:09:28 -07:00
Alex Crichton 275d1032b5 Port mul intrinsics to traits
Also add a few features to the `intrinsics!` macro
2017-06-22 22:36:37 -07:00
Alex Crichton eeb44abacf Remove executable bit from mod.rs 2017-06-22 22:04:40 -07:00
Alex Crichton 2f2bb32e40 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 673a6f9948 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 c6e06f4157 refactor 'impl Int' 2017-03-06 12:17:10 -05:00
Wilfried Chauveau 293fef5ebe impl (unsigned/signed) int to single/double precision float conversion based on llvm algorithms. 2017-03-06 11:55:57 -05:00
est31 8fe50d813c Macro-ify udivmod 2017-02-02 22:03:42 +01:00
est31 b356429374 int module: macro-ify trait impls and add {u,i}128 support 2017-02-02 21:36:02 +01:00
Matt Ickstadt 6f0d50ebea Move integer functions to separate module 2016-08-20 15:55:06 -05:00