Skip to content

Commit e4e26d2

Browse files
authored
Rollup merge of #143395 - Urgau:llvm-fallback-minimum-maximum, r=tgross35
Always use the pure Rust fallback instead of `llvm.{maximum,minimum}` While llvm/llvm-project#142170 was merged, it was reverted and next attempt (llvm/llvm-project#140193) at fixing the LLVM implementation seems to have stall, so let's reverted back to pure Rust with the LLVM codegen. cc [#t-compiler/llvm > `llvm.minimum`/`llvm.maximum` issues @ 💬](https://rust-lang.zulipchat.com/#narrow/channel/187780-t-compiler.2Fllvm/topic/.60llvm.2Eminimum.60.2F.60llvm.2Emaximum.60.20issues/near/527044712) Fixes #141087 r? `@tgross35`
2 parents 9852ace + 51857ad commit e4e26d2

File tree

2 files changed

+16
-14
lines changed

2 files changed

+16
-14
lines changed

compiler/rustc_codegen_llvm/src/intrinsic.rs

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -103,23 +103,25 @@ fn call_simple_intrinsic<'ll, 'tcx>(
103103
sym::minnumf64 => ("llvm.minnum", &[bx.type_f64()]),
104104
sym::minnumf128 => ("llvm.minnum", &[bx.type_f128()]),
105105

106-
sym::minimumf16 => ("llvm.minimum", &[bx.type_f16()]),
107-
sym::minimumf32 => ("llvm.minimum", &[bx.type_f32()]),
108-
sym::minimumf64 => ("llvm.minimum", &[bx.type_f64()]),
109-
// There are issues on x86_64 and aarch64 with the f128 variant,
110-
// let's instead use the intrinsic fallback body.
111-
// sym::minimumf128 => ("llvm.minimum", &[cx.type_f128()]),
106+
// FIXME: LLVM currently mis-compile those intrinsics, re-enable them
107+
// when llvm/llvm-project#{139380,139381,140445} are fixed.
108+
//sym::minimumf16 => ("llvm.minimum", &[bx.type_f16()]),
109+
//sym::minimumf32 => ("llvm.minimum", &[bx.type_f32()]),
110+
//sym::minimumf64 => ("llvm.minimum", &[bx.type_f64()]),
111+
//sym::minimumf128 => ("llvm.minimum", &[cx.type_f128()]),
112+
//
112113
sym::maxnumf16 => ("llvm.maxnum", &[bx.type_f16()]),
113114
sym::maxnumf32 => ("llvm.maxnum", &[bx.type_f32()]),
114115
sym::maxnumf64 => ("llvm.maxnum", &[bx.type_f64()]),
115116
sym::maxnumf128 => ("llvm.maxnum", &[bx.type_f128()]),
116117

117-
sym::maximumf16 => ("llvm.maximum", &[bx.type_f16()]),
118-
sym::maximumf32 => ("llvm.maximum", &[bx.type_f32()]),
119-
sym::maximumf64 => ("llvm.maximum", &[bx.type_f64()]),
120-
// There are issues on x86_64 and aarch64 with the f128 variant,
121-
// let's instead use the intrinsic fallback body.
122-
// sym::maximumf128 => ("llvm.maximum", &[cx.type_f128()]),
118+
// FIXME: LLVM currently mis-compile those intrinsics, re-enable them
119+
// when llvm/llvm-project#{139380,139381,140445} are fixed.
120+
//sym::maximumf16 => ("llvm.maximum", &[bx.type_f16()]),
121+
//sym::maximumf32 => ("llvm.maximum", &[bx.type_f32()]),
122+
//sym::maximumf64 => ("llvm.maximum", &[bx.type_f64()]),
123+
//sym::maximumf128 => ("llvm.maximum", &[cx.type_f128()]),
124+
//
123125
sym::copysignf16 => ("llvm.copysign", &[bx.type_f16()]),
124126
sym::copysignf32 => ("llvm.copysign", &[bx.type_f32()]),
125127
sym::copysignf64 => ("llvm.copysign", &[bx.type_f64()]),

library/core/src/num/f64.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -943,7 +943,7 @@ impl f64 {
943943
/// This returns NaN when *either* argument is NaN, as opposed to
944944
/// [`f64::max`] which only returns NaN when *both* arguments are NaN.
945945
///
946-
/// ```ignore-arm-unknown-linux-gnueabihf,ignore-i586 (see https://github.com/rust-lang/rust/issues/141087)
946+
/// ```
947947
/// #![feature(float_minimum_maximum)]
948948
/// let x = 1.0_f64;
949949
/// let y = 2.0_f64;
@@ -970,7 +970,7 @@ impl f64 {
970970
/// This returns NaN when *either* argument is NaN, as opposed to
971971
/// [`f64::min`] which only returns NaN when *both* arguments are NaN.
972972
///
973-
/// ```ignore-arm-unknown-linux-gnueabihf,ignore-i586 (see https://github.com/rust-lang/rust/issues/141087)
973+
/// ```
974974
/// #![feature(float_minimum_maximum)]
975975
/// let x = 1.0_f64;
976976
/// let y = 2.0_f64;

0 commit comments

Comments
 (0)