Commit Graph

2119 Commits

Author SHA1 Message Date
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
76f02fa2db Bump to 0.2.2 2022-02-06 09:52:15 +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