Amanieu d'Antras
8a9e33297a
Bump to 0.1.78
2022-07-30 01:45:31 +01:00
Amanieu d'Antras
b71753da80
Merge pull request #484 from Alexhuszagh/armv5te
2022-07-30 02:42:08 +02:00
Amanieu d'Antras
a81a868a59
Merge pull request #482 from ankane/gamma
2022-07-30 02:41:21 +02:00
Andrew Kane
d9cd50d32f
Update libm
2022-07-29 17:34:06 -07:00
Alex Huszagh
599dcc2c46
Add compiler-rt fallbacks for sync builtins on armv5te-musl.
2022-07-29 16:58:05 -05:00
Alex Huszagh
de09c87e0b
Add compiler-rt fallback for __trunctfsf2 on mips64-musl.
2022-07-29 15:52:23 -05:00
Andrew Kane
89df6f6bc0
Added tgamma and tgammaf
2022-07-28 16:21:37 -07:00
Amanieu d'Antras
1913181e24
Bump to 0.1.77
2022-07-28 20:58:02 +01:00
David Hoppenbrouwers
66f22e0931
Remove branches around rep movsb/stosb
...
While it is measurably faster for older CPUs, removing them keeps the code
smaller and is likely more beneficial for newer CPUs.
2022-07-28 18:45:28 +02:00
David Hoppenbrouwers
04c223f0df
Skip rep movsb in copy_backward if possible
...
There is currently no measureable performance difference in benchmarks
but it likely will make a difference in real workloads.
2022-07-28 18:32:57 +02:00
David Hoppenbrouwers
30e0c1f4c2
Use att_syntax for now
2022-07-28 18:32:56 +02:00
David Hoppenbrouwers
897a133869
Remove rep_param_rev
2022-07-28 18:32:56 +02:00
David Hoppenbrouwers
45e2996c96
Fix suboptimal codegen in memset
2022-07-28 18:32:56 +02:00
David Hoppenbrouwers
a977b01090
Align destination in mem* instructions.
...
While misaligned reads are generally fast, misaligned writes aren't and
can have severe penalties.
2022-07-28 18:32:51 +02:00
Amanieu d'Antras
0cc9a7e4a6
Merge pull request #478 from Lokathor/weak-linkage-for-division
2022-07-28 18:14:59 +02:00
Nicholas Bishop
586e2b38ef
Enable win64_128bit_abi_hack for x86_64-unknown-uefi
...
The `x86_64-unknown-uefi` target is Windows-like [1], and requires the
same altered ABI for some 128-bit integer intrinsics.
See also https://github.com/rust-lang/rust/issues/86494 .
[1]: https://github.com/rust-lang/rust/blob/master/compiler/rustc_target/src/spec/x86_64_unknown_uefi.rs
2022-07-28 11:55:59 -04:00
Lokathor
8568a33255
restrict linkage to platforms using ELF binaries
...
on windows and apple (which don't use ELF) we can't apply weak linkage
2022-07-28 09:42:18 -06:00
Lokathor
1070134a56
Merge pull request #1 from rust-lang/master
...
updates from main
2022-07-28 09:36:02 -06:00
Ayush Singh
f2ac36348c
Use all of src/math for UEFI
...
This is needed for libtest
2022-07-28 20:51:44 +05:30
Amanieu d'Antras
6b6db5cc84
Disable some PPC64 tests which are failing due to an LLVM(?) bug
...
See https://github.com/rust-lang/rust/issues/99853
2022-07-28 16:02:04 +01:00
Lokathor
011f92c877
add weak linkage to the ARM AEABI division functions
2022-07-22 17:14:18 -06:00
Amanieu d'Antras
5e48419836
Bump to 0.1.76
2022-06-29 01:08:54 +01:00
Amanieu d'Antras
db6016bee5
Merge pull request #473 from Ayush1325/uefi-std
...
Enable mem for UEFI
2022-06-29 02:08:09 +02:00
Ayush Singh
f6ab9ca9a7
Enable mem for UEFI
...
Signed-off-by: Ayush Singh <ayushsingh1325@gmail.com>
2022-06-28 20:16:07 +05:30
Amanieu d'Antras
4d44679eb5
Bump to 0.1.75
2022-06-12 01:19:53 +01:00
Amanieu d'Antras
d14c5a43b7
Merge pull request #471 from Demindiro/x86_64-fix-recursive-memcmp
2022-06-12 02:19:30 +02:00
David Hoppenbrouwers
08f4f4007d
Fix infinite recursion in x86_64 memcmp if SSE2 is not present
...
Fixes #470
2022-06-11 09:20:01 +02:00
Sean Cross
7cdad114a5
math: compile math functions for Xous
...
This adds support for Xous, enabling users to call math functions on
primitives such as `cos()`.
Signed-off-by: Sean Cross <sean@xobs.io>
2022-06-09 09:12:44 +08:00
Sean Cross
bb0b7d660f
build: compile C code for "xous" operating system
...
The "xous" operating system is enturely Rust-based, meaning it has no
libc. Therefore, it relies on `compiler-builtins` for all intrinsics.
Unfortunately, there are not yet Rust equivalents for all C functions.
For example, triganometric functions are still missing. In the meantime,
enable C replacements for these functions so that Rust programs compiled
for Xous can call these functions.
Signed-off-by: Sean Cross <sean@xobs.io>
2022-06-09 08:40:15 +08:00
Amanieu d'Antras
cfc0422a7e
Bump to 0.1.74
2022-05-31 17:19:27 +01:00
David Hoppenbrouwers
cb63d7d500
Use unchecked_div/rem
2022-05-31 08:20:30 +02:00
David Hoppenbrouwers
b94e93ead8
Slightly optimize main (32b) memcmp loop
...
It only seems to save a single instruction at first sight yet the
effects are significant.
2022-05-28 22:46:16 +02:00
David Hoppenbrouwers
95d2cd5502
Fix rustfmt sillyness
2022-05-28 08:16:46 +02:00
David Hoppenbrouwers
217748f91b
Fix panic not being optimized out.
...
I don't know why it isn't being optimized out though, which worries
me.
2022-05-28 01:24:17 +02:00
David Hoppenbrouwers
2071d05a19
Always inline compare_bytes::cmp
2022-05-28 00:50:05 +02:00
David Hoppenbrouwers
e7a8932e3b
Fix CI, better memcmp tests
2022-05-28 00:10:55 +02:00
David Hoppenbrouwers
d6650678de
Fix formatting
2022-05-27 22:37:54 +02:00
David Hoppenbrouwers
4dbd8387f9
Implement faster memcmp for x86_64
...
x86_64 can load unaligned words in a single cache line as fast as
aligned words. Even when crossing cache or page boundaries it is just as
fast to do an unaligned word read instead of multiple byte reads.
Also add a couple more tests & benchmarks.
2022-05-27 21:58:39 +02:00
Amanieu d'Antras
735ad07501
Bump to 0.1.73
2022-05-26 19:54:32 +01:00
Amanieu d'Antras
18623bffad
Merge pull request #464 from m-ou-se/floatconv2
2022-05-26 20:53:14 +02:00
Mara Bos
ca517a25e7
Explicitly use parentheses for associativity of shift operators.
2022-05-26 17:21:21 +02:00
Amanieu d'Antras
c585b7fd4e
Merge pull request #466 from Patryk27/avr
2022-05-24 19:58:50 +02:00
Amanieu d'Antras
ad71d3c6d5
Merge pull request #460 from keith/ks/remove-apple_versioning.c-inclusion
2022-05-24 19:50:27 +02:00
Patryk Wychowaniec
ac47841ce2
Add avr_skip for __udivti3 & __umodti3
2022-05-24 19:49:08 +02:00
Amanieu d'Antras
092bbb67d4
Merge pull request #465 from thomcc/cast-before-transmute
2022-05-24 19:24:15 +02:00
Amanieu d'Antras
f1fe94e882
Merge pull request #462 from Patryk27/avr
2022-05-24 16:41:59 +02:00
Thom Chiovoloni
dcdd9bbc56
Avoid int to ptr transmute by casting first
2022-05-23 23:34:10 -07:00
Mara Bos
425c78ee7a
Faster int<->float conversions.
2022-05-20 16:25:18 +02:00
Mara Bos
7ed26a7e7a
De-duplicate 128 bit float conv intrinsics using cfg_attr.
2022-05-20 15:04:36 +02:00
Mara Bos
2063e07b35
Support cfg_attr attributes in intrinsics!() macro.
2022-05-20 15:01:50 +02:00
Patryk Wychowaniec
a695a800d5
Fix division on AVRs
...
For division and modulo, AVR uses a custom calling convention that does
not match compiler_builtins' expectations, leading to non-working code¹.
Ideally we'd just use hand-written naked functions (as, afair, ARM
does), but that's a lot of code to port², so hopefully we'll be able to
do it gradually later.
For the time being, I'd suggest not compiling problematic functions for
AVR target - this causes avr-gcc (which is a mandatory part of Rust+AVR
toolchain anyway) to link hand-written assembly from libgcc, which is
confirmed to work.
I've tested the code locally on simavr and the patch seems to be working
correctly :-)
¹ https://github.com/rust-lang/rust/issues/82242 ,
https://github.com/rust-lang/rust/issues/83281
² 31048012db/libgcc/config/avr/lib1funcs.S
Closes https://github.com/rust-lang/rust/issues/82242
Closes https://github.com/rust-lang/rust/issues/83281
2022-05-17 23:21:45 +02:00
Johannes Stoelp
65ec71d386
rv32 rv64: adapt conditional compilation
...
Adapt conditional compilation as:
rv32i : riscv:__mulsi3, riscv:__muldi3
rv32im: riscv:__mulsi3, int/mul:__muldi3
rv64i : riscv:__mulsi3, riscv:__muldi3
rv64im: riscv:__mulsi3, int/mul:__muldi3
2022-05-12 00:34:49 +02:00
Keith Smiley
7d79662fd1
Remove apple_versioning.c inclusion
...
According to the README this file isn't used by rust, but it's currently
included which leads to these linker warnings in some cases:
```
ld: warning: linker symbol '$ld$hide$os10.5$___udivti3' hides a non-existent symbol '___udivti3'
ld: warning: linker symbol '$ld$hide$os10.4$___umoddi3' hides a non-existent symbol '___umoddi3'
ld: warning: linker symbol '$ld$hide$os10.5$___umoddi3' hides a non-existent symbol '___umoddi3'
ld: warning: linker symbol '$ld$hide$os10.4$___umodti3' hides a non-existent symbol '___umodti3'
ld: warning: linker symbol '$ld$hide$os10.5$___umodti3' hides a non-existent symbol '___umodti3'
```
This file exclusively contains macros which hides old symbols on Apple
OS versions where they don't exist.
fc10370ef7/compiler-rt/lib/builtins/apple_versioning.c
2022-05-02 16:06:42 -07:00
Johannes Stoelp
10971912e8
rv64 implement muldi3 intrinsic
...
Implement the __muldi3 intrinsic to prevent infinite recursion during
multiplication on rv64 without the 'm' extension.
2022-05-02 23:00:12 +02:00
Amanieu d'Antras
c307915e78
Bump to 0.1.72
2022-03-30 19:39:47 +01:00
Peter Collingbourne
c491ca7ec5
Build emutls.c on Android.
...
Android uses emulated TLS so we need a runtime support function
from this source file.
2022-03-24 11:25:47 -07:00
Amanieu d'Antras
8abefcd926
Bump to 0.1.71
2022-03-18 20:12:07 +00:00
Vadim Petrochenkov
7f535824f5
Provide an implementation of strlen
to be used as a fallback
2022-03-18 21:42:11 +03:00
Vladimir Michael Eatwell
50c5587f82
[watch_os] Fix formatting
2022-03-08 10:19:34 +00:00
Vladimir Michael Eatwell
002fc52f00
[watch_os] add watchOS
2022-03-08 10:05:44 +00:00
Amanieu d'Antras
96339ec86d
Bump to 0.1.70
2022-02-16 01:18:05 +00:00
Nikita Popov
0575846f80
Handle Win64 builtins ABI change in LLVM 14
...
As of https://reviews.llvm.org/D110413 , these no longer use the
unadjusted ABI (and use normal C ABI instead, passing i128
indirectly and returning it as <2 x i64>).
To support both LLVM 14 and older versions, rustc will expose a
"llvm14-builtins-abi" target feature, based on which
compiler-builtins can chose the appropriate ABI.
This is needed for rust-lang/rust#93577 .
2022-02-15 16:29:29 +01:00
Amanieu d'Antras
e771805ee5
Bump to 0.1.69
2022-02-09 21:02:02 +00:00
Amanieu d'Antras
5bdeade2c4
Fix typo in __aeabi_uldivmod
...
Accidentally introduced in #452
2022-02-09 21:01:07 +00:00
Amanieu d'Antras
2f988a88ff
Bump to 0.1.68
2022-02-06 09:59:11 +00:00
Amanieu d'Antras
f34d42cf49
Update libm submodule to 0.2.2
2022-02-06 09:53:16 +00:00
Amanieu d'Antras
e346c7c408
Merge pull request #452 from Amanieu/intrinsic_mod
2022-02-06 09:49:01 +00:00
Amanieu d'Antras
f03c7fd6af
Wrap all intrinsics in the intrinsics! macro
...
This ensures that each intrinsic ends up in a separate module, which in
turn (because rustc treats compiler_builtins specially) will result in
each intrinsic ending up in its own object file. This allows the linker
to only pick up object files for intrinsics that are missing and avoids
duplicate symbol definition errors.
2022-02-06 09:20:43 +00:00
Amanieu d'Antras
c51299d63a
Fix run-docker.sh so it can be run locally
2022-02-06 09:20:19 +00:00
Amanieu d'Antras
f5fa287bc2
Bump to 0.1.67
2022-01-28 12:47:27 +00:00
Daniel Sommermann
554fa533ab
Stop emitting duplicate symbols for armv7-linux-androideabi
...
The change in 186517b3266a7bb2b2310927f7342ea7f41790c3 was intended to
affect only `arm-linux-androideabi` but also affected
`armv7-linux-androideabi` which is not a pre-ARMv6 architecture.
Fixes #449
2022-01-27 12:02:40 -08:00
Amanieu d'Antras
df4d9cd6cc
Bump to 0.1.66
2021-12-13 02:25:49 +00:00
Ayrton
9124cdc7ec
Remove truncdfsf2.c from sources in build.rs and add test for __truncdfsf2vfp
...
Also fixed the calling convention for truncdfsf2 on ARM
2021-12-12 21:12:42 -05:00
Ayrton
03b4f62337
Add __truncdfsf2vfp
for ARM
2021-12-12 15:36:09 -05:00
Ayrton
39cd6082e4
Add attribute for ARM alias
2021-12-12 15:19:05 -05:00
Ayrton
9e65060184
Add __truncdfsf2
intrinsic
...
This adds the truncdfsf2 intrinsic and a corresponding fuzz test case. The
implementation of trunc is generic to make it easy to add truncdfhs2 and
truncsfhf2 if rust ever gets `f16` support.
2021-12-12 15:01:34 -05:00
Amanieu d'Antras
c7dc3215a1
Bump to 0.1.56
2021-12-10 00:11:25 +00:00
Amanieu d'Antras
0928b32141
Fix clippy lints
2021-12-10 00:04:25 +00:00
Amanieu d'Antras
4abfecabef
Import the asm! macro from core::arch
...
It is going to be removed from the prelude due to the decision in
https://github.com/rust-lang/rust/issues/87228
2021-12-09 23:57:26 +00:00
Amanieu d'Antras
c17d0c2780
Bump to 0.1.55
2021-11-28 15:30:04 +00:00
Amanieu d'Antras
c750277268
Ensure AArch64 LSE object files have distinct names in an archive
...
This is needed by libtool which rejects archives that contain object
files with the same name multiple times.
Fixes #443
2021-11-28 13:02:09 +00:00
Amanieu d'Antras
a01a61bd36
Bump to 0.1.54
2021-11-28 11:19:54 +00:00
William D. Jones
f275e26e3d
Use fully-qualified syntax for abs_diff to avoid warning, which can trigger a compiler error.
2021-11-27 19:38:43 -05:00
William D. Jones
e6d7983889
Do not use atomic reads on platforms without atomic support in LLVM.
2021-11-27 17:47:46 -05:00
Amanieu d'Antras
54e028e964
Bump to 0.1.53
2021-11-25 00:01:25 +00:00
Alessandro Decina
d96a0a0877
Turn on the mem-unaligned feature for bpf targets
...
Fixes the following LLVM segfault:
Error: e: 05:02:06 [ERROR] fatal error: "Cannot select: 0x55e970a357d0: i64,ch = AtomicLoad<(load unordered (s64) from %ir.45)> 0x55e970410be8, 0x55e970a358a0\n 0x55e970a358a0: i64,ch = CopyFromReg 0x55e970410be8, Register:i64 %19\n 0x55e970a35490: i64 = Register %19\nIn function: memcpy"
PLEASE submit a bug report to https://bugs.llvm.org/ and include the crash backtrace.
Stack dump:
0. Running pass 'Function Pass Manager' on module 'unroll-loop'.
1. Running pass 'BPF DAG->DAG Pattern Instruction Selection' on function '@memcpy'
2021-11-21 07:07:14 +00:00
Amanieu d'Antras
8e7401a151
Bump to 0.1.52
2021-11-01 23:02:56 +00:00
Alex Crichton
9a01750b1b
Use more concise directives
2021-10-28 16:32:30 -07:00
Alex Crichton
b7fb6c594a
Adjust some build directives for wasm64
...
This is still an experimental target but this should get the wasm64
target to behave more like wasm32.
2021-10-28 10:29:37 -07:00
Amanieu d'Antras
2d12d7150a
Bump to 0.1.51
2021-10-17 01:41:40 +02:00
Scott Mabin
3b4d10f6bc
Add xtensa to list of soft math targets.
2021-10-16 15:27:40 +01:00
Georgy Shepelev
29dd109959
expose some math to UEFI envs
2021-10-15 23:18:56 +04:00
Amanieu d'Antras
a71b0e4493
Disable broken powerpc64 test due to https://github.com/rust-lang/rust/issues/88520
2021-10-15 02:11:12 +02:00
Amanieu d'Antras
abf75cc713
Bump to 0.1.50
2021-09-01 00:22:59 +02:00
Gary Guo
1f0cbb2945
Use atomic_load_unordered for first word load in misaligned case
2021-08-31 00:22:43 +01:00
Gary Guo
709bd6e11c
Add different misaligned path for archs with unaligned support
2021-08-21 03:48:56 +01:00
Gary Guo
8535675a17
Add misaligned benchmarks
2021-08-21 03:03:06 +01:00
Gary Guo
45715eb7f7
Implement word-sized copy
2021-08-21 03:03:06 +01:00
Gary Guo
d282412f70
Add test cases for memcpy, memmove and memset for different alignment
2021-08-21 03:01:39 +01:00
Amanieu d'Antras
4ffaedd2e3
Bump to 0.1.49
2021-07-30 18:49:46 +02:00
Amanieu d'Antras
502370f277
Don't panic if the shift intrinsics receive out-of-range shifts
...
LLVM sometimes emits calls with out-of-range shifts but then discards
the results. We should avoid panics in these cases.
2021-07-30 00:25:36 +02:00
Amanieu d'Antras
2e7151205e
Bump to 0.1.48
2021-07-28 22:30:59 +02:00
Wesley Wiser
ba100707db
Don't try to build out-of-line aarch64 atomics with the msvc toolchain
...
The msvc toolchain does not support building `.s` files, clang only
supports generating out-of-line atomics on Linux and gcc does not
support aarch64 for Windows at all. Therefore, we don't need to compile
`lse.s` on `aarch64-pc-windows-msvc`.
2021-07-28 13:57:03 -04:00
Amanieu d'Antras
b1440f2b0a
Bump to 0.1.47
2021-07-14 21:40:46 +02:00
Rich Kadel
6ff8257858
Support long double
intrinsics in any aarch64 linux
...
Expands the support added in #377 from just musl to any linux.
Also checks for and avoids adding duplicate sources.
Fixes #428
2021-07-14 11:17:27 -07:00
Jethro Beekman
0534e104f3
Update libm
2021-06-25 11:52:14 +02:00
Amanieu d'Antras
bca8bedb93
Bump to 0.1.45
2021-06-04 00:20:57 +01:00
Amanieu d'Antras
77d9a28bbb
Fix build on targets with fewer than 3 components in their name
2021-06-03 22:59:34 +01:00
Amanieu d'Antras
da6b017a73
Merge pull request #424 from AaronKutch/issue422
...
Add public-test-deps feature for better visibility control
2021-06-03 08:03:04 +01:00
Aaron Kutch
fdcc30c3a3
Add public-test-deps feature for better visibility control
2021-06-02 14:13:54 -05:00
Amanieu d'Antras
bc956a7695
Bump to 0.1.44
2021-06-01 19:08:32 +01:00
Tilmann Meyer
31e3ae708c
Include Linux atomic emulation on androideabi
...
The old androideabi uses armv5 and thus also needs the atomic emulation
and because Android is basically Linux it can use the same
implementation.
2021-05-31 16:32:46 +02:00
Yuki Okushi
c041104afd
Suppress some warnings
2021-05-31 20:53:15 +09:00
Amanieu d'Antras
924d718511
Bump to 0.1.43
2021-05-13 21:41:46 +01:00
Amanieu d'Antras
1630c86e07
Don't embed lse_*.a inside another static library
2021-05-13 21:35:34 +01:00
Amanieu d'Antras
fcf675bf4a
Bump to 0.1.42
2021-05-02 22:12:49 +01:00
Amanieu d'Antras
fdbeb187ec
Add missing .att_syntax from #414
2021-05-02 21:29:00 +01:00
Amanieu d'Antras
a77e15f562
Bump to 0.1.41
2021-04-30 21:03:06 +01:00
Josh Triplett
fee637a7b6
Update the version of compiler-rt in CI
2021-04-30 12:24:12 -07:00
Josh Triplett
79c1e33364
Make the name of the intermediate library more closely match the intrinsic
2021-04-30 12:15:32 -07:00
Josh Triplett
df8e6f179a
Require lse.S (now available in current LLVM)
2021-04-30 12:15:32 -07:00
Josh Triplett
b9da06f662
Fix typo in instruction name: s/cwp/swp/
2021-04-30 12:15:32 -07:00
George Burgess IV
5edaec6c97
add support for building outlined aarch64 intrinsics
...
llvm/llvm-project@a4ac434c47 saw the
addition of out-of-line aarch64 atomic intrinsics. LLVM will sometimes
emit these, so we need to ensure they're included in Rust's compiler-rt.
2021-04-30 12:15:32 -07:00
Amanieu d'Antras
61b2242af9
Fix CI on latest nightly
2021-04-30 19:15:53 +01:00
Amanieu d'Antras
189b987a25
Revert "Disable AArch64 FP-to-int tests"
...
This reverts commit 9e76b9115fa9571501d378b6329ce557266908b7.
2021-04-23 18:54:12 +01:00
Amanieu d'Antras
79916f0ac8
Bump to 0.1.40
2021-04-11 20:56:38 +01:00
Amanieu d'Antras
22a1874e5d
Merge pull request #414 from Amanieu/global_asm
...
Mark global_asm! code with .att_syntax
2021-04-11 14:51:56 +01:00
Amanieu d'Antras
68df0eb817
Mark global_asm! code with .att_syntax
...
global_asm! will soon change to use Intel syntax by default.
2021-04-10 19:19:21 +01:00
bjorn3
5dd043525a
Fix typo
2021-04-10 16:03:19 +02:00
Scott Mabin
8c4127d044
Add #[linkage = "weak"]
attribute to all mem
instrinics.
2021-04-04 19:15:33 +01:00
messense
6cd2f3ae40
Add compiler-rt fallbacks on mips64-musl
2021-04-03 11:20:09 +08:00
Amanieu d'Antras
c31c2e0556
Merge pull request #397 from AaronKutch/float_refactor
2021-04-02 23:36:28 +01:00
Aaron Kutch
500c8e0b2c
add clippy to CI
2021-04-02 16:53:09 -05:00
Amanieu d'Antras
2608f8392c
Replace llvm_asm! with asm!
2021-04-02 20:43:11 +01:00
Aaron Kutch
5221cef1fc
Remove rand
dependency, update rand_xoshiro
2021-04-02 09:35:01 -05:00
Aaron Kutch
9ae3728e5e
fix CTFE cycle
2021-04-02 09:24:00 -05:00
Aaron Kutch
1cf47804df
Fix all clippy warnings
2021-04-02 08:58:50 -05:00
Aaron Kutch
1d9d761e9f
Fix panic-handler documentation
...
rust-lang/rust#51647 is fixed but panic-handler is still needed
2021-04-02 08:58:50 -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
3871282eee
fix powi
2021-04-02 08:58:50 -05:00
Aaron Kutch
96a6110d69
add remaining floating point tests
2021-04-02 08:58:50 -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
Amanieu d'Antras
bffd24076b
Merge pull request #406 from bjorn3/less_rust_intrinsics
...
Remove unused __rust_* shift intrinsics
2021-04-02 12:59:26 +01:00
Amanieu d'Antras
ef3f53dbb5
Merge pull request #404 from est31/master
...
Use the newly stabilized BITS constant on the integer types
2021-04-02 12:56:39 +01:00
Amanieu d'Antras
880ec8bb83
Disable AArch64 FP-to-int tests
...
This is a temporary workaround for https://github.com/rust-lang/rust/issues/83467
2021-04-02 12:36:57 +01:00
bjorn3
c75621f12c
Remove unused __rust_* shift intrinsics
...
They are rust specific and used by neither cg_llvm nor cg_clif
2021-02-21 11:36:47 +01:00
est31
57205c0b86
Use the newly stabilized BITS constant on the integer types
2021-02-05 23:40:17 +01:00
Amanieu d'Antras
80fb6752fa
Bump to 0.1.39
2021-01-06 23:39:48 +00:00
Aaron Kutch
e5b667554e
Remove count_ones
( #399 )
2021-01-04 09:17:44 -06:00
Amanieu d'Antras
f0a9f9e3e1
Bump to 0.1.38
2020-12-12 12:11:21 +00:00
Yuki Okushi
7645c0b869
Use the AT&T syntax to support old LLVM on rust-lang/rust
2020-12-11 22:23:00 +09:00
Amanieu d'Antras
176ae46ff8
Bump to 0.1.37
2020-12-09 12:17:29 +00: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
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
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
d5b7e2b6d3
Overhaul overflowing multiplication impls
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
Aaron Kutch
ea7feb2e0f
Remove aapcs_on_arm
mistake
2020-11-27 23:38:30 -06:00
Aaron Kutch
a7548bea0d
fix division on SPARC ( #393 )
2020-11-23 09:05:02 -06:00
Alex Crichton
82bee10b5b
Update CI to fix on GitHub Actions ( #394 )
...
Should hopefully fix the master branch...
2020-11-20 10:29:35 -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
Robert Jördens
a97fe5f1d3
math: add {fmin,fmax}{f,} for thumb*-none-eabi* ( #389 )
...
These are exposed in core::f32
close #354
c.f. rust-lang/rust#62729
Patch from @whitequark (https://paste.debian.net/1168430/ )
2020-10-26 11:37:02 -05: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
pca006132
f9bf5fee78
Use weak linkage for aeabi memory functions ( #385 )
2020-10-14 11:10:38 -05:00
Aaron Kutch
d2a2525035
Hide macros and functions
...
These macros and functions are only in the public interface for testing purposes or because of `#[macro_export]` pollution
2020-10-02 23:26:12 -05:00
Aaron Kutch
756a9dea00
Construct signed division functions differently
2020-10-02 22:55:31 -05:00
Aaron Kutch
1dfa14595e
Remove unneeded code from asymmetric.rs
...
Rebenchmarking this showed that perf changed for the worse only on really low end CPUs
2020-10-02 16:35:55 -05:00
Amanieu d'Antras
53b15eaba2
Bump to 0.1.36
2020-09-13 20:47:25 +01:00
Amanieu d'Antras
9c3ea6ad97
Merge pull request #332 from AaronKutch/issue-265
2020-09-03 20:52:23 +01:00
Amanieu d'Antras
2df3b161f6
Merge pull request #372 from xiaoyuxlu/uefi_x86_target_probestack
...
Add uefi arch x86 probestack support
2020-09-03 20:27:14 +01:00
Amanieu d'Antras
cf75c5dc21
Merge pull request #371 from maxaudron/master
...
add 32 bit shift instructions
2020-09-03 20:25:09 +01:00
Aaron Kutch
92f0680743
Add __divmodti4
2020-08-29 18:02:57 -05:00
Amanieu d'Antras
c9c145c6d7
Bump to 0.1.35
...
This time using the proper procedure for including libm.
2020-08-28 01:35:29 +01:00
Amanieu d'Antras
29cfa6fba9
Bump to 0.1.34
...
0.1.33 was published without the libm submodule
2020-08-27 17:50:24 +01:00
Amanieu d'Antras
9daf318bef
Bump to 0.1.33
2020-08-24 12:45:58 +01:00
Thomas Vigouroux
29791313f5
add compiler-rt fallbacks on aarch64-musl
2020-08-24 13:28:32 +02:00
Amanieu d'Antras
51e969665e
Fix CI url for compiler-rt source
2020-08-23 23:31:51 +01:00
Amanieu d'Antras
b6ee34a330
Merge pull request #341 from vfreex/add-mips-compiler-rt-fallback
...
add mips/mips64 compiler-rt fallbacks so that libgcc is not required
2020-08-23 23:27:05 +01:00
Aaron Kutch
ffb386369b
Use unreachable_unchecked
2020-08-14 15:31:56 -05:00
Aaron Kutch
11ae780481
Change inlining to favor three underlying division functions
2020-08-14 15:31:56 -05:00
Aaron Kutch
d1c8673332
Use specialized-div-rem
1.0.0 for division algorithms
2020-08-14 15:31:36 -05:00
Xiaoyu Lu
0a957ae73a
Add uefi arch x86 probestack support
...
1. In UEFI x86 arch, probestack need triple underscore.
2. In UEFI, probestack function do things like _chkstk(in MSVC).
MSVC x32's _chkstk and cygwin/mingw's _alloca adjust %esp themselves
MSVC x64's __chkstk and cygwin/mingw's ___chkstk_ms do not adjust
%rsp themselves.
But current probestack doesn't adjust esp. And LLVM doesn't generate
sub %eax, %esp after probestack. So we adjust esp in probestack like
MSVC x32's _chkstk.
2020-08-14 16:26:37 +08: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
adbc0b24c5
Remove erroneous aapcs_on_arm
and add maybe_use_optimized_c_shim
2020-07-28 13:46:51 -05:00
Aaron Kutch
3fda53a90d
replace old soft division code with new functions
2020-07-28 13:46:50 -05:00
Aaron Kutch
981e803acd
regularize the location and documentation of division functions
2020-07-28 13:46:50 -05:00
Aaron Kutch
7652f288d3
Improve __clzsi2
performance ( #366 )
2020-07-28 13:09:18 -05:00
Joseph Richey
d59b2875b5
lint: Allow improper_ctypes_definitions ( #364 )
...
https://github.com/rust-lang/rust/pull/72700 caused the existing
`allow(improper_ctypes)` guard to stop working, we now need
`allow(improper_ctypes_definitions)` instead.
We keep the old one to avoid any issues with older nightlies.
Signed-off-by: Joe Richey <joerichey@google.com>
2020-07-08 09:07:19 -05:00
Alex Crichton
4e71b65530
Bump to 0.1.32
2020-06-01 08:56:11 -07:00
jethrogb
96e3a08719
Manually patch ret instruction for LVI ( #359 )
...
Co-authored-by: Jethro Beekman <jethro@fortanix.com>
2020-06-01 10:55:42 -05:00
Alex Crichton
d1e1f04686
Bump to 0.1.31
2020-05-29 13:43:57 -07:00
Alex Crichton
e4293adbe1
Add back in unsafe for bootstrapping
...
And add an `#[allow]` for now to appease stage0
2020-05-29 13:43:21 -07:00
Alex Crichton
843c2261a9
Bump to 0.1.30
2020-05-29 13:41:09 -07: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
a0f9847f1d
Bump to 0.1.29
2020-05-26 13:12:24 -07: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
Eric Huss
a2840567da
Add more targets to automatically select mem
feature. ( #357 )
2020-05-22 16:12:06 -05:00
Alex Crichton
5c41a11e62
Bump to 0.1.28
2020-05-11 22:29:49 -07: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
67ec7e4ccf
Bump to 0.1.27
2020-04-13 07:17:28 -07:00
Tomasz Miąsko
ef99c37aae
Place intrinsics in individual object files ( #349 )
...
Co-authored-by: Tomasz Miąsko <tomasz.miasko@gmail.com>
2020-04-10 17:00:50 -05:00
Alex Crichton
fd781d567f
Bump to 0.1.26
2020-02-28 11:01:42 -08:00
Andre Richter
569b87d602
aarch64: Exclude FP intrinsics on +nofp or +nosimd ( #344 )
...
`AArch64` GCCs exit with an error condition when they encounter any kind of
floating point code if the `nofp` and/or `nosimd` compiler flags have been set.
Therefore, evaluate if those flags are present and set a boolean that causes any
compiler-rt intrinsics that contain floating point source to be excluded for
this target.
This patch prepares https://github.com/rust-lang/rust/pull/68334
2020-02-28 13:01:22 -06:00
Wolfgang Silbermayr
c82ad6a294
Use lower-case file extension for LICENSE.txt
...
The `LICENSE.txt` file should be distributed to crates.io, but it wasn't
due to the `Cargo.toml` entry in the `includes` field being
`LICENSE.txt` with lower-case file extension while the file itself had
an upper-case extension.
2020-02-21 11:03:51 +01:00
Yuxiang Zhu
d370d2728b
add mips/mips64 compiler-rt fallbacks so that libgcc is not required
...
This adds compiler-rt fallbacks for mips and mips64 arches.
Solves linking issues like https://github.com/rust-lang/rust/issues/57820 .
Signed-off-by: Yuxiang Zhu <vfreex@gmail.com>
2020-02-13 03:33:56 +08:00
Alex Crichton
8e87d8a3b5
Bump to 0.1.25
2020-02-11 22:21:38 -08:00
Tyler Mandry
6677b55fcb
Set probestack visibility to hidden on ELF targets ( #340 )
2020-02-11 22:21:12 -08:00
Alex Crichton
b2227dc559
Update CI installation of Rust on macos
2020-01-28 00:39:52 -08:00
Daniel Frampton
8647190d6c
Don't modify the intrinsic abi for aarch64 windows ( #337 )
2020-01-14 15:28:10 -06:00
Adam Schwalm
328332003d
Add separate rust_probestack definition for uefi ( #335 )
...
This is necessary because the Mach-O definition must have the
triple underscore, but the UEFI one must not.
2020-01-06 10:22:30 -06:00
Alex Crichton
643306f308
Bump to 0.1.23
2019-12-10 09:02:40 -08: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
c056e295e2
Bump to 1.0.22
2019-12-06 06:54:50 -08:00
Tyler Mandry
d511d48b97
Add control flow information to __rust_probestack ( #328 )
2019-12-06 08:51:42 -06:00
Alex Crichton
ca69fcbf12
Update checkout action reference
2019-12-03 09:11:29 -08:00
Alex Crichton
62c025e9a8
Update publishing instructions
2019-11-11 10:40:09 -08:00
Alex Crichton
4729d8bf39
Bump to 0.1.21
2019-11-11 10:39:08 -08:00
Alex Crichton
eb58e12abf
Gate atomic intrinsics on presence of instructions ( #324 )
...
Don't emit the intrinsics for platforms which don't actually have the
instructions to do atomic loads/stores.
Closes #322
2019-11-11 12:38:50 -06: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
5067dce074
Bump to 0.1.20
2019-11-07 11:04:36 -08:00
Oliver Scherer
bff186bef3
Emit _fltused
on uefi
targets as a short-term workaround ( #317 )
...
* Emit `_fltused` on `uefi` targets as a short-term workaround
* Remove stray docker container
2019-11-07 13:04:11 -06:00
Alex Crichton
12283c7aca
Fix Github Actions for recent system changes
2019-10-28 07:39:04 -07:00
Ian Kronquist
af3d2e0a3c
Implement bcmp ( #315 )
...
As of LLVM 9.0, certain calls to memcmp may be converted to bcmp, which I guess
could save a single subtraction on some architectures. [1]
bcmp is just like memcmp except instead of returning the difference between the
two differing bytes, it returns non-zero instead. As such, memcmp is a valid
implementation of bcmp.
If we care about size, bcmp should just call memcmp.
If we care about speed, we can change bcmp to look like this instead:
```rust
pub unsafe extern "C" fn bcmp(s1: *const u8, s2: *const u8, n: usize) -> i32 {
let mut i = 0;
while i < n {
let a = *s1.offset(i as isize);
let b = *s2.offset(i as isize);
if a != b {
return 1;
}
i += 1;
}
0
}
```
In this PR I do not address any changes which may or may not be needed for arm
aebi as I lack proper test hardware.
[1]: https://releases.llvm.org/9.0.0/docs/ReleaseNotes.html#noteworthy-optimizations
2019-09-30 11:02:47 -05:00
Alex Crichton
30bf61039f
Remove -nursery
from urls
2019-09-25 11:20:14 -07:00
Alex Crichton
d7adb275eb
Update the gitmodule url for libm
2019-09-25 11:19:35 -07:00
Alex Crichton
0198311a4b
Migrate to github actions from Azure Pipelines
...
Less need to manage users, more concurrency, and interface is all in
one!
2019-09-10 21:57:13 -05:00
Lokathor
b86b2d59bc
update the libm submodule, again
2019-09-09 19:43:37 -06:00
Lokathor
e796054f9e
Update build.rs
2019-09-06 18:02:11 -06:00
Lokathor
e079f2d70d
Update build.rs
2019-09-06 15:20:05 -06:00
Lokathor
3ab350613b
Update the libm submodule
2019-09-06 13:48:15 -06:00
Lokathor
e9a2b2ca11
i was told to change this path to my repo and reset things
2019-09-06 11:37:00 -06:00
Benjamin Saunders
01a0524d8c
Tidy up unordered elementwise atomic memory intrinsics
2019-08-23 10:20:09 -07:00
Alex Crichton
85d36cbe37
Merge pull request #311 from Ralith/elementwise-unordered-atomics
...
Implement LLVM's elementwise unordered atomic memory intrinsics
2019-08-22 16:01:41 -07:00
Benjamin Saunders
1cc3d32874
Implement LLVM's elementwise unordered atomic memory intrinsics
...
Allows uses of intrinsics of the form
llvm.(memcpy|memmove|memset).element.unordered.atomic.* to be linked.
2019-08-21 18:21:58 -07:00
Alex Crichton
1dec01c8e4
Merge pull request #310 from alexcrichton/modernize
...
Modernize the `testcrate` slighty
2019-08-19 17:21:50 -05:00
Joel Galenson
a80233948f
Update comment to mention where the __FILE__ macro is used.
2019-08-19 15:12:07 -07: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
Joel Galenson
cefd832d89
Support deterministic builds by remapping the __FILE__ prefix if the compiler supports it.
2019-08-19 09:30:45 -07:00
Alex Crichton
8b76d44636
Bump to 0.1.19
2019-07-24 07:05:29 -07:00
Alex Crichton
0f6042793a
Merge pull request #306 from da-x/probestack-frame-pointer
...
probestack: add frame pointers for easier traceback
2019-07-24 09:04:02 -05:00
Dan Aloni
84e8cc74c5
probestack: add frame pointers for easier traceback
...
This turns the following backtrace,
```
>> bt
#0 0x0000555555576f73 in __rust_probestack () at /cargo/registry/src/github.com-1ecc6299db9ec823/compiler_builtins-0.1.14/src/probestack.rs:55
Backtrace stopped: Cannot access memory at address 0x7fffff7fedf0
```
To this:
```
>>> bt
#0 0x0000555555574e47 in __rust_probestack ()
#1 0x00005555555595ba in test::main ()
#2 0x00005555555594f3 in std::rt::lang_start::{{closure}} ()
#3 0x0000555555561ae3 in std::panicking::try::do_call ()
#4 0x000055555556595a in __rust_maybe_catch_panic ()
#5 0x000055555555af9b in std::rt::lang_start_internal ()
#6 0x00005555555594d5 in std::rt::lang_start ()
#7 0x000055555555977b in main ()
```
2019-07-24 10:18:30 +03:00
Alex Crichton
fb35190998
Bump to 0.1.18
2019-07-19 07:44:17 -07:00
Alex Crichton
3c36beb31b
Merge pull request #302 from bjorn3/no_128bit_lang_items
...
Replace {u,i}128_* lang items with __rust_{u,i}128_* unmangled functions
2019-07-19 09:44:00 -05:00
Alex Crichton
e80c858e20
Merge pull request #301 from RalfJung/dyn
...
avoid bare trait objects
2019-07-15 10:04:18 -05:00
Alex Crichton
7773dafe01
Bump to 0.1.17
2019-07-15 07:26:49 -07:00