Fix floating point comparision involving NaNs.

This commit is contained in:
losfair
2019-11-18 01:39:44 +08:00
parent cbaa94a7fa
commit 5d2ee4fcc8
2 changed files with 30 additions and 45 deletions

View File

@ -1336,7 +1336,10 @@ impl X64FunctionCode {
value_stack.push(ret);
Self::emit_relaxed_avx(a, m, f, loc_a, loc_b, ret);
a.emit_and(Size::S32, Location::Imm32(1), ret); // FIXME: Why?
// Workaround for behavior inconsistency among different backing implementations.
// (all bits or only the least significant bit are set to one?)
a.emit_and(Size::S32, Location::Imm32(1), ret);
}
/// Floating point (AVX) binary operation with both operands popped from the virtual stack.