Commit Graph

992 Commits

Author SHA1 Message Date
Alistair Francis
e898296fd9 build: Allow building C compiler-rt fallbacks for RISC-V
Now that https://github.com/rust-lang/rust/pull/117654 has been merged
the rust-lang/rust distribution containers contain RISC-V C compilers.

This means that we can now enable the "c" feature fallback.

Resolves: https://github.com/rust-lang/compiler-builtins/issues/350
Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
2023-12-20 09:47:37 +10:00
Amanieu d'Antras
72dbe301ff Bump to 0.1.105 2023-12-14 20:23:55 +00:00
Brian Cain
c4a7058a11 Add hexagon support
Signed-off-by: Brian Cain <bcain@quicinc.com>
2023-12-11 12:35:21 -08:00
Amanieu d'Antras
d46758a18f Bump to 0.1.104 2023-11-28 08:02:43 +00:00
Patryk Wychowaniec
c2c4c8e146
fix: Add (even more) #[avr_skip] for floats
Tale as old as the world - there's an ABI mismatch:
https://github.com/rust-lang/compiler-builtins/pull/527

Fortunately, newest GCCs (from v11, it seems) actually provide most of
those intrinsics (even for f64!), so that's pretty cool.

(the only intrinsics not provided by GCC are `__powisf2` & `__powidf2`,
but our codegen for AVR doesn't emit those anyway.)

Fixes https://github.com/rust-lang/rust/issues/118079.
2023-11-26 16:17:00 +01:00
Amanieu d'Antras
52959b5800 Bump to 0.1.103
There was a mistake in publishing the 0.1.102 release.
2023-11-04 00:29:46 +00:00
Amanieu d'Antras
44d0e30db9 Bump to 0.1.102 2023-11-04 00:28:36 +00:00
Amanieu d'Antras
2a9210b900
Merge pull request #554 from mchodzikiewicz/fix-math-for-riscv32 2023-10-31 22:43:37 +01:00
Michał Chodzikiewicz
8ec53915fe Enable math module for all "none" os targets
This was initially a bugfix that fixed gating math module for riscv32,
but conclusiion is it makes no sense to gate on target architecture.
2023-10-31 20:32:53 +01:00
Amanieu d'Antras
ed04e1e2b0
Merge pull request #552 from elbe0046/fix-aeabi-multi-def 2023-10-31 20:15:42 +01:00
Nicholas Bishop
e8509dd054 Enable src/math for all UEFI targets
This fixes various math operations on aarch64-unknown-uefi and
i686-unknown-uefi.
2023-10-27 20:21:08 +00:00
Grant Elbert
de2da94c49 intrinsics macro: fix non-weak aeabi generation
Signed-off-by: Grant Elbert <grant.elbert@smartthings.com>
2023-10-23 15:54:05 -05:00
Sebastian Imlay
25fa91e1b2 Add tvOS to build script 2023-10-06 17:35:20 -04:00
James Farrell
6595f36317 Generate outlined_atomics.rs in a deterministic order.
Also add a missing newline.
2023-08-28 22:14:18 +00:00
Amanieu d'Antras
5642f6ba4c Bump to 0.1.101 2023-08-12 10:28:45 +02:00
Sean Cross
10df3f61ad build: compile memory intrinsics on xous
Like SGX, Xous does not have any libc to link against. As a result,
memory intrinsics need to be available as part of `compiler_builtins`

Signed-off-by: Sean Cross <sean@xobs.io>
2023-08-12 07:50:26 +03:00
Amanieu d'Antras
14f4e11a86 Bump to 0.1.100 2023-08-07 23:37:59 +01:00
Amanieu d'Antras
6d180d8377
Merge pull request #546 from ankane/lgamma-r-mingw 2023-08-07 23:37:06 +01:00
klensy
a15a3a5df0 impl_binary_long allow to pass attribute 2023-08-07 21:23:23 +03:00
klensy
10f6ee84e3 allow internal_features, added in https://github.com/rust-lang/rust/pull/108955 2023-08-07 21:04:25 +03:00
klensy
dd34581ec9 edition 2018 2023-08-07 21:04:25 +03:00
Andrew Kane
2a197cb5c9 Add lgamma_r and lgammaf_r to MinGW 2023-07-31 15:08:37 -07:00
Amanieu d'Antras
0db7a3a020 Bump to 0.1.99 2023-07-30 23:56:13 +01:00
Andrew Kane
d4477f8218 Add lgamma_r and lgammaf_r to MSVC 2023-07-30 10:45:26 -07:00
Nicholas Bishop
da05233935 Add __chkstk for aarch64-unknown-uefi
This is based on compiler-rt/lib/builtins/aarch64/chkstk.S:
f8e19b3799
2023-07-22 15:05:30 -04:00
Amanieu d'Antras
05ca9048ad Bump to 0.1.98 2023-07-21 17:46:23 +01:00
Amanieu d'Antras
2b29ddcca7 Upgrade to libm 0.2.7 2023-07-21 17:45:47 +01:00
Amanieu d'Antras
2a14bca476 Bump to 0.1.97 2023-07-21 14:29:00 +01:00
Nicholas Bishop
7eca0c2ba3 Enable chkstk/alloca intrinsics on x86_64-unknown-uefi 2023-07-18 22:58:59 -04:00
Amanieu d'Antras
5cc74482b4 Bump to 0.1.96 2023-07-17 13:51:40 +01:00
Amanieu d'Antras
4cb7858aac
Merge pull request #538 from ankane/lgamma-r-msvc 2023-07-17 13:51:00 +01:00
Taiki Endo
716d2064f0 Fix build error on aarch64_be linux 2023-07-08 14:18:27 +09:00
Andrew Kane
e2f0b9cd3a Add lgamma_r and lgammaf_r to MSVC 2023-07-07 10:49:54 -04:00
Aaron Kutch
025076f763 Use the target_feature "zbb" instead of "b" for RISC-V 2023-07-06 17:20:32 -05:00
Amanieu d'Antras
28f2437614 Disable MIPS in CI
See https://github.com/rust-lang/compiler-team/issues/648
2023-07-06 20:20:19 +02:00
Amanieu d'Antras
8a3c3942a5 Bump to 0.1.95 2023-07-03 10:45:20 +02:00
jyn
c4e9f479ad Only compile outlined-atomics intrinsics on linux 2023-07-02 21:55:02 -05:00
Amanieu d'Antras
9234bedeea Bump to 0.1.94 2023-06-28 23:44:06 +01:00
Amanieu d'Antras
050754d4e3
Merge pull request #534 from kiffie/mips-core-float 2023-06-28 23:43:34 +01:00
Amanieu d'Antras
bb0d107feb
Merge pull request #532 from jyn514/lse.rs 2023-06-28 23:41:39 +01:00
Amanieu d'Antras
d5543c4cfb
Merge pull request #531 from knickish/float_div_subnormal_rounding 2023-06-28 23:41:07 +01:00
Stephan
c6fa74aacb enable simple f32/f64 support needed by core library 2023-06-28 21:35:33 +02:00
Joshua Nelson
1a41e48d11 fix tests to work with --feature c 2023-06-27 02:31:42 +00:00
kirk
379445f9a5 port updated version of llvm float div 2023-06-27 01:17:31 +00:00
Joshua Nelson
e7c4a45348 require naked functions to be unsafe again
they dereference raw pointers, so the caller needs to make sure the
pointer is valid.

note that this requires changing `maybe_use_optimized_c_shim` to support
unsafe functions.
2023-06-26 16:27:16 +00:00
Joshua Nelson
6242fd629e address review comments and fix CI
- implement CAS 16
- remove useless commented out symbol name
- support `feature("no-asm")`
- fix warnings when `feature("c")` is enabled
- rustfmt
2023-06-26 15:09:37 +00:00
Joshua Nelson
21c821c6c9 Port outline-atomics to rust
This has a very long history, summarized in
https://github.com/rust-lang/rust/issues/109064. This port is a very
minimal subset of `aarch64/lse.S` from LLVM's compiler-rt. In
particular, it is missing the following:

1. Any form of runtime dispatch between LL/SC and LSE.

Determining which version of the intrinsics to use
requires one of the following:

  i) `getauxval` from glibc. It's unclear whether `compiler_builtins` is
allowed to depend on libc at all, and musl doesn't even support
getauxval. Don't enshrine the requirement "de-facto" by making it
required for outline-atomics.

  ii) kernel support. Linux and FreeBSD have limited support, but it
requires an extremely recent kernel version and doesn't work at all under QEMU (https://github.com/rust-lang/rust/issues/109064#issuecomment-1494939904).

Instead, we hard-code LL/SC intrinsics. Users who want LSE support
should use the LLVM compiler-rt (if you're building from source in
rust-lang/rust, make sure you have `src/llvm-project` checked out
locally. the goal is to soon add a new `optimized-compiler-builtins`
option so this is easier to discover).

2. The global `___aarch64_have_lse_atomics` CTOR, required to do runtime
   dispatch. Thom Chiviolani has this to say about global CTORs:

> static ctors are problems because we are pretty eager about dead code elim
> in general if you have a module that isnt directly reference we will probably not have its static ctors
> also, while llvm has a super robust way to have a static ctor (theres s special "appending global" to use for c++), we dont use that and just have people make a #[used] static in a special section
> 1. the robust way kinda requires rust knowing that the argument is a static ctor (maybe a #[rustc_static_ctor] attribute). it also would be... finnicky, since on windows we actually care beyond being a static ctor, that we run as part in a specific group of ctors, which means a very specific section (one for TLS and the other for, uh, i dont remember)
> 2. we still actually have to codegen the cgu that isn't referenced. but maybe we could remember that it has that attribute and use that

So while this is possible in theory, it's decidedly non-trivial, and
needs invasive changes to rust itself. In any case, it doesn't matter
until we decide the story around libc.

3. The 16-byte (i128) version of compare_and_swap. This wouldn't be
   *too* hard to add, but it would be hard to test. The way I tested the
existing code was not just with unit tests but also by loading it as a
path dependency and running `x test core` - the latter caught several
bugs the unit tests didn't catch (because I originally wrote the tests
wrong). So I am slightly nervous about adding a 16-byte version that is
much more poorly tested than the other intrinsics.
2023-06-26 05:56:08 +00:00
Amanieu d'Antras
4a84991713
Merge pull request #529 from knickish/compile_warning_cleanup 2023-06-18 00:47:22 +02:00
kirk
fad0b3a431 change links in README to match reference code version used in CI 2023-06-17 14:35:00 +00:00
kirk
d3951c082e allow stable features lint, fix link formatting warning, add ignore block to intrinsics macro documentation 2023-06-17 14:11:31 +00:00