diff options
Diffstat (limited to 'Source/JavaScriptCore/assembler/MacroAssemblerX86Common.h')
| -rw-r--r-- | Source/JavaScriptCore/assembler/MacroAssemblerX86Common.h | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/Source/JavaScriptCore/assembler/MacroAssemblerX86Common.h b/Source/JavaScriptCore/assembler/MacroAssemblerX86Common.h index 53cb80c21..f171dc408 100644 --- a/Source/JavaScriptCore/assembler/MacroAssemblerX86Common.h +++ b/Source/JavaScriptCore/assembler/MacroAssemblerX86Common.h @@ -68,6 +68,7 @@ public: enum ResultCondition { Overflow = X86Assembler::ConditionO, Signed = X86Assembler::ConditionS, + PositiveOrZero = X86Assembler::ConditionNS, Zero = X86Assembler::ConditionE, NonZero = X86Assembler::ConditionNE }; @@ -884,13 +885,14 @@ public: // If the result is not representable as a 32 bit value, branch. // May also branch for some values that are representable in 32 bits // (specifically, in this case, 0). - void branchConvertDoubleToInt32(FPRegisterID src, RegisterID dest, JumpList& failureCases, FPRegisterID fpTemp) + void branchConvertDoubleToInt32(FPRegisterID src, RegisterID dest, JumpList& failureCases, FPRegisterID fpTemp, bool negZeroCheck = true) { ASSERT(isSSE2Present()); m_assembler.cvttsd2si_rr(src, dest); // If the result is zero, it might have been -0.0, and the double comparison won't catch this! - failureCases.append(branchTest32(Zero, dest)); + if (negZeroCheck) + failureCases.append(branchTest32(Zero, dest)); // Convert the integer result back to float & compare to the original value - if not equal or unordered (NaN) then jump. convertInt32ToDouble(dest, fpTemp); |
