Skip to content

Commit 4e69ad1

Browse files
committed
Auto merge of #138344 - tgross35:x86-f16-math, r=<try>
Enable `reliable_f16_math` on x86 This has been disabled due to an LLVM misoptimization with `powi.f16` [1]. This was fixed upstream and the fix is included in LLVM20, so tests no longer need to be disabled. `f16` still remains disabled on MinGW due to the ABI issue. [1]: llvm/llvm-project#98665 try-job: x86_64-gnu try-job: x86_64-gnu-llvm-19-1 try-job: x86_64-gnu-llvm-20-1
2 parents 1b8ab72 + 19e82b4 commit 4e69ad1

File tree

1 file changed

+3
-7
lines changed

1 file changed

+3
-7
lines changed

compiler/rustc_codegen_llvm/src/llvm_util.rs

+3-7
Original file line numberDiff line numberDiff line change
@@ -466,13 +466,9 @@ fn update_target_reliable_float_cfg(sess: &Session, cfg: &mut TargetConfig) {
466466
_ => true,
467467
};
468468

469-
cfg.has_reliable_f16_math = match (target_arch, target_os) {
470-
// x86 has a crash for `powi`: <https://github.com/llvm/llvm-project/issues/105747>
471-
("x86" | "x86_64", _) => false,
472-
// Assume that working `f16` means working `f16` math for most platforms, since
473-
// operations just go through `f32`.
474-
_ => true,
475-
} && cfg.has_reliable_f16;
469+
// Assume that working `f16` means working `f16` math for most platforms, since
470+
// operations just go through `f32`.
471+
cfg.has_reliable_f16_math = cfg.has_reliable_f16;
476472

477473
cfg.has_reliable_f128_math = match (target_arch, target_os) {
478474
// LLVM lowers `fp128` math to `long double` symbols even on platforms where

0 commit comments

Comments
 (0)