10 Commits

Author SHA1 Message Date
Trevor Gross
16cb37c957 Remove no-asm gating when there is no alternative implementation
Assembly-related configuration was added in 1621c6dbf9eb ("Use
`specialized-div-rem` 1.0.0 for division algorithms") to account for
Cranelift not yet supporting assembly. This hasn't been relevant for a
while, so we no longer need to gate `asm!` behind this configuration.
Thus, remove `cfg(not(feature = "no-asm"))` in places where there is no
generic fallback.

There are other cases, however, where setting the `no-asm` configuration
enables testing of generic version of builtins when there are platform-
specific implementations available; these cases are left unchanged. This
could be improved in the future by exposing both versions for testing
rather than using a configuration and running the entire testsuite
twice.

This is the compiler-builtins portion of
https://github.com/rust-lang/rust/pull/144471.
2025-07-27 16:39:31 -05:00
Trevor Gross
9dad77f337 Use x86_no_sse configuration in more places
Emit `x86_no_sse` in the compiler-builtins (and builtins-test) build
script, and use it to simplify `all(target_arch = "x86",
not(target_fefature = "sse))` configuration.
2025-07-24 19:37:45 +00:00
Trevor Gross
43c3e1bb97 Enable tests that were skipped on PowerPC
Most of these were skipped because of a bug with the platform
implementation, or some kind of crash unwinding. Since the upgrade to
Ubuntu 25.04, these all seem to be resolved with the exception of a bug
in the host `__floatundisf` [1].

[1] https://github.com/rust-lang/compiler-builtins/pull/384#issuecomment-740413334
2025-07-24 07:18:08 -05:00
Trevor Gross
be35d37d8b
Use the compiler to determine whether or not to enable f16 and f128
Currently we whether or not to build and test `f16` and `f128` support
mostly based on the target triple. This isn't always accurate, however,
since support also varies by backend and the backend version.

Since recently, `rustc` is aware of this with the unstable config option
`target_has_reliable_{f16,f128}`, which better represents when the types
are actually expected to be available and usable. Switch our
compiler-builtins and libm configuration to use this by probing `rustc`
for the target's settings.

A few small `cfg` fixes are needed with this.
2025-07-02 01:18:54 -05:00
qinghon
013e06c5ff
Eliminate build.rs-generated Aarch64 atomic macros (#951)
Replace `build.rs` Rust generation with macros, using the unstable
`${concat(...)}`.

Fixes: https://github.com/rust-lang/compiler-builtins/issues/947
2025-06-13 01:27:47 -04:00
Trevor Gross
151b1cb047 Change compiler-builtins to edition 2024
Do the same for `builtins-test-intrinsics`. Mostly this means updating
`extern` to `unsafe extern`, and fixing a few new Clippy lints.
2025-05-29 16:12:33 +00:00
beetrees
11c1522955 Enable __powitf2 on MSVC 2025-05-21 19:24:24 +02:00
Trevor Gross
8d789ea8f1 Resolve unnecessary_transmutes lints
These appeared in a later nightly. In compiler-builtins we can apply the
suggestion, but in `libm` we need to ignore them since `fx::from_bits`
is not `const` at the MSRV.

`clippy::uninlined_format_args` also seems to have gotten stricter, so
fix those here.
2025-04-29 18:15:02 -04:00
Trevor Gross
8d70be87e6 Run cargo fmt on all projects
Apply the same formatting rules to both `libm` and `compiler-builtins`.
2025-04-19 19:05:49 -04:00
Trevor Gross
92b1e8454d Rename testcrate to builtins-test
The repo will soon have `libm` as a top-level crate, so make it clear
that this is only the test crate for `compiler-builtins`.
2025-04-18 21:14:41 -04:00