From 78a1c45d83bf93025ceed25e933f6e51f8efdc37 Mon Sep 17 00:00:00 2001 From: "dragan.mladjenovic" Date: Tue, 31 Jul 2018 08:41:56 +0200 Subject: [PATCH] run-pass/simd-intrinsic-float-minmax: Force use of qNaN on Mips Workaround for #52746. --- src/test/run-pass/simd-intrinsic-float-minmax.rs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/test/run-pass/simd-intrinsic-float-minmax.rs b/src/test/run-pass/simd-intrinsic-float-minmax.rs index 71c0139bb03..d35123e2235 100644 --- a/src/test/run-pass/simd-intrinsic-float-minmax.rs +++ b/src/test/run-pass/simd-intrinsic-float-minmax.rs @@ -29,7 +29,14 @@ fn main() { let x = f32x4(1.0, 2.0, 3.0, 4.0); let y = f32x4(2.0, 1.0, 4.0, 3.0); + + #[cfg(not(any(target_arch = "mips", target_arch = "mips64")))] let nan = ::std::f32::NAN; + // MIPS hardware treats f32::NAN as SNAN. Clear the signaling bit. + // See https://github.com/rust-lang/rust/issues/52746. + #[cfg(any(target_arch = "mips", target_arch = "mips64"))] + let nan = f32::from_bits(::std::f32::NAN.to_bits() - 1); + let n = f32x4(nan, nan, nan, nan); unsafe {