Skip to content

Commit 70b6127

Browse files
momo5502kyle-elliott-tob
authored andcommitted
Only quietize SNaNs in FLD
Non-SNaN values should not be quietized, if the IE bit was previously set.
1 parent 91f04f5 commit 70b6127

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

lib/Arch/X86/Semantics/X87.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -119,12 +119,13 @@ template <typename T>
119119
DEF_FPU_SEM(FLD, RF80W, T src1) {
120120
SetFPUIpOp();
121121
auto val = Read(src1);
122-
state.sw.ie |= IsSignalingNaN(val);
122+
auto isSNaN = IsSignalingNaN(val);
123+
state.sw.ie |= isSNaN;
123124
state.sw.de |= IsDenormal(val);
124125
auto res = Float80(val);
125126

126127
// Quietize if signaling NaN.
127-
if (state.sw.ie) {
128+
if (isSNaN) {
128129

129130
#if defined(__x86_64__) || defined(__i386__) || defined(_M_X86)
130131
// On non-x86 architectures, native_float80_t is defined as a double (float64_t)

0 commit comments

Comments
 (0)