rust/compiler/rustc_codegen_llvm/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
..
back remove noinline attribute and add alwaysinline after AD pass 2025-04-28 21:10:32 +05:30
builder add custom enzyme markers to target methods 2025-04-25 11:09:52 +05:30
coverageinfo coverage: Build the CGU's global file table as late as possible 2025-04-07 17:11:49 +10:00
debuginfo AsyncDrop implementation using shim codegen of async_drop_in_place::{closure}, scoped async drop added. 2025-04-28 16:23:13 +07:00
llvm remove noinline attribute and add alwaysinline after AD pass 2025-04-28 21:10:32 +05:30
abi.rs Update the minimum external LLVM to 19 2025-04-05 11:44:38 -07:00
allocator.rs Remove implicit #[no_mangle] for #[rustc_std_internal_symbol] 2025-03-17 14:08:09 +00:00
asm.rs Rollup merge of #137549 - oli-obk:llvm-ffi, r=davidtwco 2025-03-07 19:15:34 +01:00
attributes.rs remove noinline attribute and add alwaysinline after AD pass 2025-04-28 21:10:32 +05:30
base.rs Add new_regular and new_allocator to ModuleCodegen 2025-02-23 21:23:38 +08:00
builder.rs Rollup merge of #139261 - RalfJung:msvc-align-mitigation, r=oli-obk 2025-04-24 11:40:35 +02:00
callee.rs Merge two operations that were always performed together 2025-02-20 11:24:00 +00:00
common.rs Reuse address-space computation from global alloc 2025-04-11 09:28:47 +00:00
consts.rs Rollup merge of #137880 - EnzymeAD:autodiff-batching, r=oli-obk 2025-04-05 13:18:13 +11:00
context.rs remove noinline attribute and add alwaysinline after AD pass 2025-04-28 21:10:32 +05:30
declare.rs Make allocator shim creation mostly use safe code 2025-02-24 15:11:29 +00:00
errors.rs KCFI: Add KCFI arity indicator support 2025-04-05 04:05:04 +00:00
intrinsic.rs Rollup merge of #137953 - RalfJung:simd-intrinsic-masks, r=WaffleLapkin 2025-04-20 13:02:48 +00:00
lib.rs Implement the internal feature cfg_target_has_reliable_f16_f128 2025-04-27 19:58:44 +00:00
llvm_util.rs Implement the internal feature cfg_target_has_reliable_f16_f128 2025-04-27 19:58:44 +00:00
mono_item.rs Rename is_like_osx to is_like_darwin 2025-03-25 21:53:52 +01:00
type_.rs remove noinline attribute and add alwaysinline after AD pass 2025-04-28 21:10:32 +05:30
type_of.rs rename BackendRepr::Vector → SimdVector 2025-02-28 17:17:45 +01:00
va_arg.rs Rename is_like_osx to is_like_darwin 2025-03-25 21:53:52 +01:00
value.rs Add warn(unreachable_pub) to rustc_codegen_llvm. 2024-08-16 08:46:57 +10:00