Commit Graph

1088 Commits

Author SHA1 Message Date
danakj
fb77604e79 Add the weak-intrinsics feature
When enabled, the weak-intrinsics feature will cause all intrinsics
functions to be marked with weak linkage (i.e. `#[linkage = "weak"])
so that they can be replaced at link time by a stronger symbol.

This can be set to use C++ intrinsics from the compiler-rt library,
as it will avoid Rust's implementation replacing the compiler-rt
implementation as long as the compiler-rt symbols are linked as
strong symbols. Typically this requires the compiler-rt library to
be explicitly specified in the link command.

Addresses https://github.com/rust-lang/compiler-builtins/issues/525.

Without weak-intrinsics, from nm:
```
00000000 W __aeabi_memclr8  // Is explicitly weak
00000000 T __udivsi3  // Is not.
```

With weak-intrinsics, from nm:
```
00000000 W __aeabi_memclr8  // Is explicitly weak
00000000 W __udivsi3  // Is weak due to weak-intrinsics
```
2023-05-19 17:35:00 -04:00
Amanieu d'Antras
7749ed6580 Bump to 0.1.91 2023-03-29 23:55:20 +01:00
William D. Jones
5246405d61 Ensure shift instrinsic arguments match width of compiler-rt's (int vs si_int). 2023-03-29 17:55:46 -04:00
Amanieu d'Antras
7db8c0581d Disable another test on powerpc 2023-03-29 21:49:08 +01:00
Amanieu d'Antras
26e2432c25 Bump to 0.1.90 2023-03-25 21:55:23 +00:00
Taiki Endo
2f43b93603 Fix panic due to overflow in riscv.rs and int/shift.rs 2023-03-23 22:00:22 +09:00
Amanieu d'Antras
da5001e4c6
Merge pull request #516 from TDecki/master 2023-03-12 22:17:23 +01:00
Amanieu d'Antras
20fb963ab6 Add emutls.c for OpenHarmony 2023-03-10 19:59:23 +00:00
Tobias Decking
59766673e7
more fixing 2023-03-06 19:28:49 +01:00
Tobias Decking
73fa0deaa6
formatting 2023-03-06 19:24:02 +01:00
Tobias Decking
215f63ad19
Final version. 2023-03-06 19:20:30 +01:00
Andrew Kane
59fb34e63a Added lgamma_r and lgammaf_r 2023-03-05 12:17:21 -08:00
Amanieu d'Antras
3e59619de7 Bump to 0.1.88 2023-02-23 18:19:41 +00:00
Tobias Decking
04fe482160
Formatting 2023-02-22 22:19:10 +01:00
Tobias Decking
c7404df069
Provide a non-sse version for x86_64. 2023-02-22 22:16:29 +01:00
Scott Mabin
67ebc4ae14 Extend the intrinsics exported for Xtensa no_std 2023-02-22 20:56:31 +00:00
Tobias Decking
97402fc580
Change implementation to SSE 2023-02-22 21:54:33 +01:00
Tobias Decking
e9e34801a6
Remove superfluous comment. 2023-02-22 00:10:46 +01:00
Tobias Decking
b53c1ae17a
Improve assembly quality + AT&T syntax. 2023-02-22 00:07:41 +01:00
Tobias Decking
44d34e87fa
Update path for argument. 2023-02-21 23:36:47 +01:00
Tobias Decking
990596fa28
Correct path. 2023-02-21 23:32:39 +01:00
Tobias Decking
a11bd1cfdb
Specialize strlen for x86_64. 2023-02-21 23:13:02 +01:00
Amanieu d'Antras
2ca64c2798 Bump to 0.1.87 2023-02-03 19:21:40 +01:00
Josh Stone
8d4e906206 Drop the llvm14-builtins-abi hack 2023-02-01 14:52:18 -08:00
Amanieu d'Antras
7f39126ff9 Bump to 0.1.86 2022-12-29 20:36:57 +01:00
Patryk Wychowaniec
d20eea4d47
fix: Add #[avr_skip] for bit shifts
This commit follows the same logic as:

- https://github.com/rust-lang/compiler-builtins/pull/462
- https://github.com/rust-lang/compiler-builtins/pull/466

I've tested the changes by preparing a simple program:

```rust
fn calc() -> ... {
    let x = hint::black_box(4u...); // 4u8, 4u16, 4u32, 4u64, 4u128 + signed
    let y = hint::black_box(1u32);

    // x >> y
    // x << y
}

fn main() -> ! {
    let dp = arduino_hal::Peripherals::take().unwrap();
    let pins = arduino_hal::pins!(dp);
    let mut serial = arduino_hal::default_serial!(dp, pins, 57600);

    for b in calc().to_le_bytes() {
        _ = ufmt::uwrite!(&mut serial, "{} ", b);
    }

    _ = ufmt::uwriteln!(&mut serial, "");

    loop {
        //
    }
}
```

... switching types & operators in `calc()`, and observing the results;
what I ended up with was:

```
 u32 << u32 - ok
 u64 << u32 - ok
u128 << u32 - error (undefined reference to `__ashlti3')
 i32 >> u32 - ok
 i64 >> u32 - ok
i128 >> u32 - error (undefined reference to `__ashrti3')
 u32 >> u32 - ok
 u64 >> u32 - ok
u128 >> u32 - error (undefined reference to `__lshrti3')

(where "ok" = compiles and returns correct results)
```

As with multiplication and division, so do in here 128-bit operations
not work, because avr-gcc's standard library doesn't provide them (at
the same time, requiring that specific calling convention, making it
pretty difficult for compiler-builtins to jump in).

I think 128-bit operations non-working on an 8-bit controller is an
acceptable trade-off - 😇 - and so the entire fix in here is
just about skipping those functions.
2022-12-25 11:46:30 +01:00
Amanieu d'Antras
62cd3780ae Bump to 0.1.85 2022-12-08 13:31:59 +00:00
Martin Kröning
620f50589e Expose minimal floating point symbols for x86_64-unknown-none 2022-12-07 16:08:01 +01:00
Jérome Eertmans
80828bfb0b
fix(docs): typo in docstrings
Hello, I think you misspelled `width` to `with`.
2022-11-28 10:53:42 +01:00
Amanieu d'Antras
ad4ab99a2e Bump to 0.1.84 2022-11-18 02:58:11 +00:00
Nicholas Bishop
ebaca42a41 Use a stub stdlib.h when compiling for UEFI targets
int_util.c includes stdlib.h if `_WIN32` is defined. When compiling
the UEFI targets with clang they are treated as Windows targets (e.g. if
the Rust target is x86_64-unknown-uefi, the clang target is
x86_64-unknown-windows-gnu). So stdlib.h gets included, even though we
are compilling with `-ffreestanding` and don't want stdlib.h to be
used. That file may not be present, or an incompatible version might be
installed leading to typedef redefinition errors.

The contents of stdlib.h aren't actually needed for these targets anyway
(due to `__STDC_HOSTED__` being 0), so create a minimal stdlib.h in
`build.rs` when `target_os == uefi` and add it to the include path.
2022-11-17 21:16:01 -05:00
Amanieu d'Antras
371a6856ee
Merge pull request #504 from nicholasbishop/bishop-no-uefi-asm 2022-11-16 19:05:16 +00:00
Nicholas Bishop
98b3454d3d Skip assembly implementations on the UEFI targets
The UEFI targets link with `/SAFESEH`. That requires that objects have a
symbol called [`@feat.00`]. Clang adds that symbol for COFF targets if
the input is a C file, but not if the input is an ASM file. That doesn't
prevent compiler_builtins or rustc from building, but using the
resulting rustc to compile something that references one of the objects
lacking `@feat.00` will result in a linker error.

Fix by removing all the `.S` implementations when `target_os == uefi`.

[`@feat.00`]: https://learn.microsoft.com/en-us/windows/win32/debug/pe-format#the-sxdata-section
2022-11-16 13:16:42 -05:00
Nicholas Bishop
524ca7ceb6 Remove unused no-lang-items feature 2022-11-12 12:09:06 -05:00
Amanieu d'Antras
a996f56f5a Bump to 0.1.83 2022-11-09 04:12:51 +00:00
Jules Bertholet
af5664be84
Update libm, add rint and rintf 2022-11-08 21:04:02 -05:00
Felix S. Klock II
2faf57c08d might as well add the link to the LLVM assembly code as well. 2022-10-25 12:32:41 -04:00
Felix S. Klock II
8266a1343b Document origins of the multiplication method being used here. 2022-10-25 11:25:14 -04:00
Amanieu d'Antras
6f53a4f074 Bump to 0.1.82 2022-10-10 19:04:06 +01:00
Ralf Jung
6267545315 invoke the unreachable intrinsic, not the stable wrapper 2022-10-10 19:34:48 +02:00
Amanieu d'Antras
2e0590c997 Fix clippy lints 2022-10-10 17:40:16 +01:00
Amanieu d'Antras
1bffeb803e
Merge pull request #343 from silwol/master 2022-10-10 17:35:41 +01:00
Amanieu d'Antras
8bc227d1fe Bump to 0.1.81 2022-09-29 03:16:50 +01:00
Lokathor
f6cd5cf806
Update macros.rs 2022-09-27 13:22:45 -06:00
Amanieu d'Antras
4c8bb40c8d Bump to 0.1.80 2022-09-20 16:20:52 +08:00
D1plo1d
1d5b952100 math: Enabled floating point intrinsics for RISCV32 microcontrollers 2022-09-17 11:47:21 -04:00
Amanieu d'Antras
83c4ff5f96 Bump to 0.1.79 2022-08-10 15:28:39 +01:00
Amanieu d'Antras
1eb4cc1977 Update libm submodule 2022-08-10 15:24:16 +01:00
David Hoppenbrouwers
a695cf95cf
Remove c32() from x86_64 memcmp
Fixes https://github.com/rust-lang/compiler-builtins/issues/487
2022-08-10 11:29:38 +02:00
Nicholas Bishop
abb6893a85 Enable unadjusted_on_win64 for UEFI in some cases
The conversion functions from i128/u128 to f32/f64 have the
`unadjusted_on_win64` attribute, but it is disabled starting with
LLVM14. This seems to be the correct thing to do for Win64, but for some
reason x86_64-unknown-uefi is different, despite generally using the
same ABI as Win64.
2022-08-03 19:16:03 -04:00
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