Skip to content

Commit

Permalink
run-pass/simd-intrinsic-float-minmax: Force use of qNaN on Mips
Browse files Browse the repository at this point in the history
Workaround for #52746.
  • Loading branch information
dragan.mladjenovic committed Jul 31, 2018
1 parent 4fbd4a5 commit 78a1c45
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/test/run-pass/simd-intrinsic-float-minmax.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,14 @@ extern "platform-intrinsic" {
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 {
Expand Down

0 comments on commit 78a1c45

Please sign in to comment.