Skip to content

Commit 7f0ae5e

Browse files
committed
Use the fallback body for {minimum,maximum}f128 on LLVM as well.
1 parent dc69020 commit 7f0ae5e

File tree

2 files changed

+14
-6
lines changed

2 files changed

+14
-6
lines changed

compiler/rustc_codegen_llvm/src/context.rs

+8-2
Original file line numberDiff line numberDiff line change
@@ -1012,7 +1012,10 @@ impl<'ll> CodegenCx<'ll, '_> {
10121012
ifn!("llvm.minimum.f16", fn(t_f16, t_f16) -> t_f16);
10131013
ifn!("llvm.minimum.f32", fn(t_f32, t_f32) -> t_f32);
10141014
ifn!("llvm.minimum.f64", fn(t_f64, t_f64) -> t_f64);
1015-
ifn!("llvm.minimum.f128", fn(t_f128, t_f128) -> t_f128);
1015+
// There are issues on x86_64 and aarch64 with the f128 variant.
1016+
// - https://github.com/llvm/llvm-project/issues/139380
1017+
// - https://github.com/llvm/llvm-project/issues/139381
1018+
// ifn!("llvm.minimum.f128", fn(t_f128, t_f128) -> t_f128);
10161019

10171020
ifn!("llvm.maxnum.f16", fn(t_f16, t_f16) -> t_f16);
10181021
ifn!("llvm.maxnum.f32", fn(t_f32, t_f32) -> t_f32);
@@ -1022,7 +1025,10 @@ impl<'ll> CodegenCx<'ll, '_> {
10221025
ifn!("llvm.maximum.f16", fn(t_f16, t_f16) -> t_f16);
10231026
ifn!("llvm.maximum.f32", fn(t_f32, t_f32) -> t_f32);
10241027
ifn!("llvm.maximum.f64", fn(t_f64, t_f64) -> t_f64);
1025-
ifn!("llvm.maximum.f128", fn(t_f128, t_f128) -> t_f128);
1028+
// There are issues on x86_64 and aarch64 with the f128 variant.
1029+
// - https://github.com/llvm/llvm-project/issues/139380
1030+
// - https://github.com/llvm/llvm-project/issues/139381
1031+
// ifn!("llvm.maximum.f128", fn(t_f128, t_f128) -> t_f128);
10261032

10271033
ifn!("llvm.floor.f16", fn(t_f16) -> t_f16);
10281034
ifn!("llvm.floor.f32", fn(t_f32) -> t_f32);

compiler/rustc_codegen_llvm/src/intrinsic.rs

+6-4
Original file line numberDiff line numberDiff line change
@@ -106,8 +106,9 @@ fn get_simple_intrinsic<'ll>(
106106
sym::minimumf16 => "llvm.minimum.f16",
107107
sym::minimumf32 => "llvm.minimum.f32",
108108
sym::minimumf64 => "llvm.minimum.f64",
109-
sym::minimumf128 => "llvm.minimum.f128",
110-
109+
// There are issues on x86_64 and aarch64 with the f128 variant,
110+
// let's instead use the instrinsic fallback body.
111+
// sym::minimumf128 => "llvm.minimum.f128",
111112
sym::maxnumf16 => "llvm.maxnum.f16",
112113
sym::maxnumf32 => "llvm.maxnum.f32",
113114
sym::maxnumf64 => "llvm.maxnum.f64",
@@ -116,8 +117,9 @@ fn get_simple_intrinsic<'ll>(
116117
sym::maximumf16 => "llvm.maximum.f16",
117118
sym::maximumf32 => "llvm.maximum.f32",
118119
sym::maximumf64 => "llvm.maximum.f64",
119-
sym::maximumf128 => "llvm.maximum.f128",
120-
120+
// There are issues on x86_64 and aarch64 with the f128 variant,
121+
// let's instead use the instrinsic fallback body.
122+
// sym::maximumf128 => "llvm.maximum.f128",
121123
sym::copysignf16 => "llvm.copysign.f16",
122124
sym::copysignf32 => "llvm.copysign.f32",
123125
sym::copysignf64 => "llvm.copysign.f64",

0 commit comments

Comments
 (0)