rust/compiler/rustc_codegen_gcc/src
Trevor Gross 6ceeb0849e 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)
2025-04-27 19:58:44 +00:00
..
back Prepend temp files with a string per invocation of rustc 2025-04-07 20:48:40 +00:00
intrinsic Rollup merge of #137953 - RalfJung:simd-intrinsic-masks, r=WaffleLapkin 2025-04-20 13:02:48 +00:00
abi.rs Fix import 2025-04-19 00:08:03 +02:00
allocator.rs Remove implicit #[no_mangle] for #[rustc_std_internal_symbol] 2025-03-17 14:08:09 +00:00
asm.rs Merge commit '4f83a4258d' into subtree-update_cg_gcc_2025-04-25 2025-04-25 10:44:19 -04:00
attributes.rs mir_transform: implement forced inlining 2025-01-10 18:37:54 +00:00
base.rs Add new_regular and new_allocator to ModuleCodegen 2025-02-23 21:23:38 +08:00
builder.rs Merge commit 'db1a31c243' into subtree-update_cg_gcc_2025-04-18 2025-04-18 21:20:11 +02:00
callee.rs Merge commit '59a81c2ca1' into subtree-update_cg_gcc_2025_01_12 2025-01-13 10:53:58 -05:00
common.rs Merge commit '4f83a4258d' into subtree-update_cg_gcc_2025-04-25 2025-04-25 10:44:19 -04:00
consts.rs Merge commit '4f83a4258d' into subtree-update_cg_gcc_2025-04-25 2025-04-25 10:44:19 -04:00
context.rs Merge commit 'db1a31c243' into subtree-update_cg_gcc_2025-04-18 2025-04-18 21:20:11 +02:00
coverageinfo.rs Unbox and unwrap the contents of StatementKind::Coverage 2024-03-23 22:05:11 +11:00
debuginfo.rs Merge commit '4f83a4258d' into subtree-update_cg_gcc_2025-04-25 2025-04-25 10:44:19 -04:00
declare.rs Merge commit 'db1a31c243' into subtree-update_cg_gcc_2025-04-18 2025-04-18 21:20:11 +02:00
errors.rs Merge commit '59a81c2ca1' into subtree-update_cg_gcc_2025_01_12 2025-01-13 10:53:58 -05:00
gcc_util.rs Implement the internal feature cfg_target_has_reliable_f16_f128 2025-04-27 19:58:44 +00:00
int.rs Fix compilation error in GCC backend 2025-04-18 22:46:43 +02:00
lib.rs Implement the internal feature cfg_target_has_reliable_f16_f128 2025-04-27 19:58:44 +00:00
mono_item.rs Remove Linkage::Private 2025-02-07 16:02:19 +00:00
type_.rs Generalize BaseTypeCodegenMethods 2025-02-24 15:11:29 +00:00
type_of.rs Merge commit '4f83a4258d' into subtree-update_cg_gcc_2025-04-25 2025-04-25 10:44:19 -04:00