Skip to content

Commit a8763b5

Browse files
committed
Auto merge of #52895 - draganmladjenovic:minmax_qnan, r=alexcrichton
run-pass/simd-intrinsic-float-minmax: Force use of qNaN on Mips Workaround for #52746. r? @gnzlbg
2 parents 3e05f80 + 78a1c45 commit a8763b5

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/test/run-pass/simd-intrinsic-float-minmax.rs

+7
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,14 @@ extern "platform-intrinsic" {
2929
fn main() {
3030
let x = f32x4(1.0, 2.0, 3.0, 4.0);
3131
let y = f32x4(2.0, 1.0, 4.0, 3.0);
32+
33+
#[cfg(not(any(target_arch = "mips", target_arch = "mips64")))]
3234
let nan = ::std::f32::NAN;
35+
// MIPS hardware treats f32::NAN as SNAN. Clear the signaling bit.
36+
// See https://github.com/rust-lang/rust/issues/52746.
37+
#[cfg(any(target_arch = "mips", target_arch = "mips64"))]
38+
let nan = f32::from_bits(::std::f32::NAN.to_bits() - 1);
39+
3340
let n = f32x4(nan, nan, nan, nan);
3441

3542
unsafe {

0 commit comments

Comments
 (0)