rust/compiler/rustc_codegen_cranelift/src
Chris Denton e082bf341f
Rollup merge of #140323 - tgross35:cfg-unstable-float, r=Urgau
Implement the internal feature `cfg_target_has_reliable_f16_f128`

Support for `f16` and `f128` is varied across targets, backends, and backend versions. Eventually we would like to reach a point where all backends support these approximately equally, but until then we have to work around some of these nuances of support being observable.

Introduce the `cfg_target_has_reliable_f16_f128` internal feature, which provides the following new configuration gates:

* `cfg(target_has_reliable_f16)`
* `cfg(target_has_reliable_f16_math)`
* `cfg(target_has_reliable_f128)`
* `cfg(target_has_reliable_f128_math)`

`reliable_f16` and `reliable_f128` indicate that basic arithmetic for the type works correctly. The `_math` versions indicate that anything relying on `libm` works correctly, since sometimes this hits a separate class of codegen bugs.

These options match configuration set by the build script at [1]. The logic for LLVM support is duplicated as-is from the same script. There are a few possible updates that will come as a follow up.

The config introduced here is not planned to ever become stable, it is only intended to replace the build scripts for `std` tests and `compiler-builtins` that don't have any way to configure based on the codegen backend.

MCP: https://github.com/rust-lang/compiler-team/issues/866
Closes: https://github.com/rust-lang/compiler-team/issues/866

[1]: 555e1d0386/library/std/build.rs (L84-L186)

---

The second commit makes use of this config to replace `cfg_{f16,f128}{,_math}` in `library/`. I omitted providing a `cfg(bootstrap)` configuration to keep things simpler since the next beta branch is in two weeks.

try-job: aarch64-gnu
try-job: i686-msvc-1
try-job: test-various
try-job: x86_64-gnu
try-job: x86_64-msvc-ext2
2025-04-28 23:29:17 +00:00
..
abi AsyncDrop implementation using shim codegen of async_drop_in_place::{closure}, scoped async drop added. 2025-04-28 16:23:13 +07:00
debuginfo Rollup merge of #138949 - madsmtm:rename-to-darwin, r=WaffleLapkin 2025-04-04 08:02:05 +02:00
driver Auto merge of #139453 - compiler-errors:incr, r=jieyouxu 2025-04-11 13:59:33 +00:00
intrinsics update docs 2025-04-06 21:41:47 +02:00
optimize Reformat use declarations. 2024-07-29 08:26:52 +10:00
allocator.rs Remove implicit #[no_mangle] for #[rustc_std_internal_symbol] 2025-03-17 14:08:09 +00:00
analyze.rs rename AddressOf -> RawBorrow inside the compiler 2024-08-18 19:46:53 +02:00
base.rs AsyncDrop implementation using shim codegen of async_drop_in_place::{closure}, scoped async drop added. 2025-04-28 16:23:13 +07:00
cast.rs Rustfmt 2025-02-08 22:12:13 +00:00
codegen_i128.rs Windows x86: Change i128 to return via the vector ABI 2025-01-27 12:12:59 +00:00
common.rs Merge commit 'ba315abda7' into sync_cg_clif-2025-03-30 2025-03-30 15:43:48 +00:00
compiler_builtins.rs Merge commit '8332329f83' into sync_cg_clif-2025-02-07 2025-02-07 20:58:27 +00:00
concurrency_limiter.rs Remove jobserver from Session 2024-12-13 10:21:22 +00:00
config.rs Merge commit 'ba315abda7' into sync_cg_clif-2025-03-30 2025-03-30 15:43:48 +00:00
constant.rs Rename is_like_osx to is_like_darwin 2025-03-25 21:53:52 +01:00
discriminant.rs make no-variant types a dedicated Variants variant 2024-12-18 11:01:54 +01:00
global_asm.rs Prepend temp files with a string per invocation of rustc 2025-04-07 20:48:40 +00:00
inline_asm.rs Merge commit 'ba315abda7' into sync_cg_clif-2025-03-30 2025-03-30 15:43:48 +00:00
lib.rs Implement the internal feature cfg_target_has_reliable_f16_f128 2025-04-27 19:58:44 +00:00
linkage.rs Sync rustc_codegen_cranelift 'ddd4ce2553' 2021-04-30 14:49:58 +02:00
main_shim.rs Move has_self field to hir::AssocKind::Fn. 2025-04-14 16:13:04 +10:00
num.rs Merge commit 'ba315abda7' into sync_cg_clif-2025-03-30 2025-03-30 15:43:48 +00:00
pointer.rs Merge commit '1fa693ca44' into sync_cg_clif-2024-11-09 2024-11-09 13:48:06 +00:00
pretty_clif.rs Merge commit '1fa693ca44' into sync_cg_clif-2024-11-09 2024-11-09 13:48:06 +00:00
toolchain.rs Merge commit 'e9d1a0a7b0' into sync_cg_clif-2022-08-24 2022-08-24 18:40:58 +02:00
trap.rs Rustfmt 2025-02-08 22:12:13 +00:00
unsize.rs Use ExistentialTraitRef throughout codegen 2025-01-30 15:34:00 +00:00
unwind_module.rs Merge commit '49cd5dd454' into sync_cg_clif-2024-06-30 2024-06-30 11:28:14 +00:00
value_and_place.rs Merge commit 'ba315abda7' into sync_cg_clif-2025-03-30 2025-03-30 15:43:48 +00:00
vtable.rs Extend the renaming to coerce_unsafe_ptr 2025-02-10 13:01:55 +00:00