Canonicalize NANs produced by f.trunc and f.nearby.

This commit is contained in:
Nick Lewycky
2020-03-16 11:36:17 -07:00
parent ae9b321365
commit 29b5223b3e
2 changed files with 5 additions and 11 deletions

View File

@ -3701,7 +3701,7 @@ impl<'ctx> FunctionCodeGenerator<CodegenError> for LLVMFunctionCodeGenerator<'ct
.try_as_basic_value()
.left()
.unwrap();
state.push1_extra(res, i);
state.push1_extra(res, i | ExtraInfo::pending_f32_nan());
}
Operator::F64Trunc => {
let (v, i) = state.pop1_extra()?;
@ -3714,7 +3714,7 @@ impl<'ctx> FunctionCodeGenerator<CodegenError> for LLVMFunctionCodeGenerator<'ct
.try_as_basic_value()
.left()
.unwrap();
state.push1_extra(res, i);
state.push1_extra(res, i | ExtraInfo::pending_f64_nan());
}
Operator::F32Nearest => {
let (v, i) = state.pop1_extra()?;
@ -3727,7 +3727,7 @@ impl<'ctx> FunctionCodeGenerator<CodegenError> for LLVMFunctionCodeGenerator<'ct
.try_as_basic_value()
.left()
.unwrap();
state.push1_extra(res, i);
state.push1_extra(res, i | ExtraInfo::pending_f32_nan());
}
Operator::F64Nearest => {
let (v, i) = state.pop1_extra()?;
@ -3740,7 +3740,7 @@ impl<'ctx> FunctionCodeGenerator<CodegenError> for LLVMFunctionCodeGenerator<'ct
.try_as_basic_value()
.left()
.unwrap();
state.push1_extra(res, i);
state.push1_extra(res, i | ExtraInfo::pending_f64_nan());
}
Operator::F32Abs => {
let (v, i) = state.pop1_extra()?;