Changeset 258063 in webkit
- Timestamp:
- Mar 6, 2020, 10:28:57 PM (5 years ago)
- Location:
- trunk/Source/JavaScriptCore
- Files:
-
- 19 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/JavaScriptCore/ChangeLog
r258062 r258063 1 2020-03-06 Mark Lam <mark.lam@apple.com> 2 3 Add "AndOrdered" to the names of ordered DoubleConditions. 4 https://bugs.webkit.org/show_bug.cgi?id=208736 5 6 Reviewed by Keith Miller. 7 8 Renamed the following: 9 DoubleEqual ==> DoubleEqualAndOrdered 10 DoubleNotEqual ==> DoubleNotEqualAndOrdered 11 DoubleGreaterThan ==> DoubleGreaterThanAndOrdered 12 DoubleGreaterThanOrEqual ==> DoubleGreaterThanOrEqualAndOrdered 13 DoubleLessThan ==> DoubleLessThanAndOrdered 14 DoubleLessThanOrEqual ==> DoubleLessThanOrEqualAndOrdered 15 16 The comment for these enums in MacroAssemblerARM64.h says: 17 // These conditions will only evaluate to true if the comparison is ordered - i.e. neither operand is NaN. 18 19 Adding "AndOrdered" to their names makes this property explicit. 20 21 From reading the original names, one might intuitively think that these conditions 22 map directly to the C++ double comparisons. This intuition is incorrect. 23 Consider the DoubleNotEqual case: let's compare 2 doubles, a and b: 24 25 result = (a != b); 26 27 For C++, if either a or b are NaNs, then a != b will actually return true. 28 This is contrary to the behavior documented in the MacroAssemblerARM64.h comment 29 above about how DoubleNotEqual should behave. In our code, DoubleNotEqual actually 30 means DoubleNotEqualAndOrdered. The C++ != behavior actually matches our 31 DoubleNotEqualOrUnordered condition instead. 32 33 The tendency to want to associate DoubleNotEqual with the behavior of the C++ 34 != operator is precisely why we should give these conditions better names. 35 Adding the "AndOperand" name make the expected behavior explicit in the name, and 36 leave no room for confusion with C++ double comparison semantics. 37 38 * assembler/MacroAssembler.cpp: 39 (WTF::printInternal): 40 * assembler/MacroAssembler.h: 41 (JSC::MacroAssembler::invert): 42 * assembler/MacroAssemblerARM64.h: 43 (JSC::MacroAssemblerARM64::moveConditionallyAfterFloatingPointCompare): 44 (JSC::MacroAssemblerARM64::moveDoubleConditionallyAfterFloatingPointCompare): 45 (JSC::MacroAssemblerARM64::jumpAfterFloatingPointCompare): 46 (JSC::MacroAssemblerARM64::floatingPointCompare): 47 * assembler/MacroAssemblerARMv7.h: 48 (JSC::MacroAssemblerARMv7::branchDouble): 49 * assembler/MacroAssemblerMIPS.h: 50 (JSC::MacroAssemblerMIPS::branchDouble): 51 (JSC::MacroAssemblerMIPS::branchDoubleNonZero): 52 * assembler/MacroAssemblerX86Common.h: 53 (JSC::MacroAssemblerX86Common::branchDoubleNonZero): 54 (JSC::MacroAssemblerX86Common::moveConditionallyDouble): 55 (JSC::MacroAssemblerX86Common::invert): 56 (JSC::MacroAssemblerX86Common::floatingPointCompare): 57 (JSC::MacroAssemblerX86Common::jumpAfterFloatingPointCompare): 58 (JSC::MacroAssemblerX86Common::moveConditionallyAfterFloatingPointCompare): 59 * assembler/MacroAssemblerX86_64.h: 60 (JSC::MacroAssemblerX86_64::truncateDoubleToUint64): 61 (JSC::MacroAssemblerX86_64::truncateFloatToUint64): 62 * assembler/testmasm.cpp: 63 (JSC::testCompareDouble): 64 (JSC::testCompareDoubleSameArg): 65 (JSC::testMoveConditionallyFloatingPoint): 66 (JSC::testMoveDoubleConditionallyDouble): 67 (JSC::testMoveDoubleConditionallyDoubleDestSameAsThenCase): 68 (JSC::testMoveDoubleConditionallyDoubleDestSameAsElseCase): 69 (JSC::testMoveDoubleConditionallyFloat): 70 (JSC::testMoveDoubleConditionallyFloatDestSameAsThenCase): 71 (JSC::testMoveDoubleConditionallyFloatDestSameAsElseCase): 72 (JSC::testMoveConditionallyFloatingPointSameArg): 73 (JSC::run): 74 * b3/B3LowerToAir.cpp: 75 * dfg/DFGSpeculativeJIT.cpp: 76 (JSC::DFG::compileClampDoubleToByte): 77 (JSC::DFG::SpeculativeJIT::compileArithRounding): 78 (JSC::DFG::SpeculativeJIT::compileArithMinMax): 79 (JSC::DFG::SpeculativeJIT::compileArithPow): 80 (JSC::DFG::SpeculativeJIT::compileStrictEq): 81 (JSC::DFG::SpeculativeJIT::compileArrayIndexOf): 82 (JSC::DFG::SpeculativeJIT::compileNormalizeMapKey): 83 * dfg/DFGSpeculativeJIT32_64.cpp: 84 (JSC::DFG::SpeculativeJIT::compile): 85 * dfg/DFGSpeculativeJIT64.cpp: 86 (JSC::DFG::SpeculativeJIT::compile): 87 * ftl/FTLLowerDFGToB3.cpp: 88 (JSC::FTL::DFG::LowerDFGToB3::compileNumberIsInteger): 89 * jit/AssemblyHelpers.h: 90 (JSC::AssemblyHelpers::branchIfNotNaN): 91 * jit/JITArithmetic.cpp: 92 (JSC::JIT::emitSlow_op_jless): 93 (JSC::JIT::emitSlow_op_jlesseq): 94 (JSC::JIT::emitSlow_op_jgreater): 95 (JSC::JIT::emitSlow_op_jgreatereq): 96 * jit/JITArithmetic32_64.cpp: 97 (JSC::JIT::emitBinaryDoubleOp): 98 * jit/ThunkGenerators.cpp: 99 (JSC::floorThunkGenerator): 100 (JSC::roundThunkGenerator): 101 * wasm/WasmAirIRGenerator.cpp: 102 (JSC::Wasm::AirIRGenerator::addOp<OpType::F64Le>): 103 (JSC::Wasm::AirIRGenerator::addOp<OpType::F64Lt>): 104 (JSC::Wasm::AirIRGenerator::addFloatingPointMinOrMax): 105 (JSC::Wasm::AirIRGenerator::addOp<OpType::F64Gt>): 106 (JSC::Wasm::AirIRGenerator::addOp<OpType::F64Ge>): 107 (JSC::Wasm::AirIRGenerator::addOp<OpType::F32Lt>): 108 (JSC::Wasm::AirIRGenerator::addOp<OpType::F64Eq>): 109 (JSC::Wasm::AirIRGenerator::addOp<OpType::F32Le>): 110 (JSC::Wasm::AirIRGenerator::addOp<OpType::F32Ge>): 111 (JSC::Wasm::AirIRGenerator::addOp<OpType::F32Eq>): 112 (JSC::Wasm::AirIRGenerator::addOp<OpType::F32Gt>): 113 1 114 2020-03-06 David Kilzer <ddkilzer@apple.com> 2 115 -
trunk/Source/JavaScriptCore/assembler/MacroAssembler.cpp
r243254 r258063 128 128 { 129 129 switch (cond) { 130 case MacroAssembler::DoubleEqual :131 out.print("DoubleEqual ");130 case MacroAssembler::DoubleEqualAndOrdered: 131 out.print("DoubleEqualAndOrdered"); 132 132 return; 133 case MacroAssembler::DoubleNotEqual :134 out.print("DoubleNotEqual ");133 case MacroAssembler::DoubleNotEqualAndOrdered: 134 out.print("DoubleNotEqualAndOrdered"); 135 135 return; 136 case MacroAssembler::DoubleGreaterThan :137 out.print("DoubleGreaterThan ");136 case MacroAssembler::DoubleGreaterThanAndOrdered: 137 out.print("DoubleGreaterThanAndOrdered"); 138 138 return; 139 case MacroAssembler::DoubleGreaterThanOrEqual :140 out.print("DoubleGreaterThanOrEqual ");139 case MacroAssembler::DoubleGreaterThanOrEqualAndOrdered: 140 out.print("DoubleGreaterThanOrEqualAndOrdered"); 141 141 return; 142 case MacroAssembler::DoubleLessThan :143 out.print("DoubleLessThan ");142 case MacroAssembler::DoubleLessThanAndOrdered: 143 out.print("DoubleLessThanAndOrdered"); 144 144 return; 145 case MacroAssembler::DoubleLessThanOrEqual :146 out.print("DoubleLessThanOrEqual ");145 case MacroAssembler::DoubleLessThanOrEqualAndOrdered: 146 out.print("DoubleLessThanOrEqualAndOrdered"); 147 147 return; 148 148 case MacroAssembler::DoubleEqualOrUnordered: -
trunk/Source/JavaScriptCore/assembler/MacroAssembler.h
r250005 r258063 165 165 { 166 166 switch (cond) { 167 case DoubleEqual :167 case DoubleEqualAndOrdered: 168 168 return DoubleNotEqualOrUnordered; 169 case DoubleNotEqual :169 case DoubleNotEqualAndOrdered: 170 170 return DoubleEqualOrUnordered; 171 case DoubleGreaterThan :171 case DoubleGreaterThanAndOrdered: 172 172 return DoubleLessThanOrEqualOrUnordered; 173 case DoubleGreaterThanOrEqual :173 case DoubleGreaterThanOrEqualAndOrdered: 174 174 return DoubleLessThanOrUnordered; 175 case DoubleLessThan :175 case DoubleLessThanAndOrdered: 176 176 return DoubleGreaterThanOrEqualOrUnordered; 177 case DoubleLessThanOrEqual :177 case DoubleLessThanOrEqualAndOrdered: 178 178 return DoubleGreaterThanOrUnordered; 179 179 case DoubleEqualOrUnordered: 180 return DoubleNotEqual ;180 return DoubleNotEqualAndOrdered; 181 181 case DoubleNotEqualOrUnordered: 182 return DoubleEqual ;182 return DoubleEqualAndOrdered; 183 183 case DoubleGreaterThanOrUnordered: 184 return DoubleLessThanOrEqual ;184 return DoubleLessThanOrEqualAndOrdered; 185 185 case DoubleGreaterThanOrEqualOrUnordered: 186 return DoubleLessThan ;186 return DoubleLessThanAndOrdered; 187 187 case DoubleLessThanOrUnordered: 188 return DoubleGreaterThanOrEqual ;188 return DoubleGreaterThanOrEqualAndOrdered; 189 189 case DoubleLessThanOrEqualOrUnordered: 190 return DoubleGreaterThan ;190 return DoubleGreaterThanAndOrdered; 191 191 } 192 192 RELEASE_ASSERT_NOT_REACHED(); 193 return DoubleEqual ; // make compiler happy193 return DoubleEqualAndOrdered; // make compiler happy 194 194 } 195 195 -
trunk/Source/JavaScriptCore/assembler/MacroAssemblerARM64.h
r258038 r258063 124 124 enum DoubleCondition { 125 125 // These conditions will only evaluate to true if the comparison is ordered - i.e. neither operand is NaN. 126 DoubleEqual = Assembler::ConditionEQ,127 DoubleNotEqual = Assembler::ConditionVC, // Not the right flag! check for this & handle differently.128 DoubleGreaterThan = Assembler::ConditionGT,129 DoubleGreaterThanOrEqual = Assembler::ConditionGE,130 DoubleLessThan = Assembler::ConditionLO,131 DoubleLessThanOrEqual = Assembler::ConditionLS,126 DoubleEqualAndOrdered = Assembler::ConditionEQ, 127 DoubleNotEqualAndOrdered = Assembler::ConditionVC, // Not the right flag! check for this & handle differently. 128 DoubleGreaterThanAndOrdered = Assembler::ConditionGT, 129 DoubleGreaterThanOrEqualAndOrdered = Assembler::ConditionGE, 130 DoubleLessThanAndOrdered = Assembler::ConditionLO, 131 DoubleLessThanOrEqualAndOrdered = Assembler::ConditionLS, 132 132 // If either operand is NaN, these conditions always evaluate to true. 133 133 DoubleEqualOrUnordered = Assembler::ConditionVS, // Not the right flag! check for this & handle differently. … … 2007 2007 void moveConditionallyAfterFloatingPointCompare(DoubleCondition cond, RegisterID src, RegisterID dest) 2008 2008 { 2009 if (cond == DoubleNotEqual ) {2009 if (cond == DoubleNotEqualAndOrdered) { 2010 2010 Jump unordered = makeBranch(Assembler::ConditionVS); 2011 2011 m_assembler.csel<datasize>(dest, src, dest, Assembler::ConditionNE); … … 2028 2028 void moveConditionallyAfterFloatingPointCompare(DoubleCondition cond, RegisterID thenCase, RegisterID elseCase, RegisterID dest) 2029 2029 { 2030 if (cond == DoubleNotEqual ) {2030 if (cond == DoubleNotEqualAndOrdered) { 2031 2031 if (dest == thenCase) { 2032 2032 // If the compare is unordered, elseCase is copied to thenCase and the … … 2066 2066 void moveDoubleConditionallyAfterFloatingPointCompare(DoubleCondition cond, FPRegisterID thenCase, FPRegisterID elseCase, FPRegisterID dest) 2067 2067 { 2068 if (cond == DoubleNotEqual ) {2068 if (cond == DoubleNotEqualAndOrdered) { 2069 2069 if (dest == thenCase) { 2070 2070 // If the compare is unordered, elseCase is copied to thenCase and the … … 4618 4618 Jump jumpAfterFloatingPointCompare(DoubleCondition cond) 4619 4619 { 4620 if (cond == DoubleNotEqual ) {4620 if (cond == DoubleNotEqualAndOrdered) { 4621 4621 // ConditionNE jumps if NotEqual *or* unordered - force the unordered cases not to jump. 4622 4622 Jump unordered = makeBranch(Assembler::ConditionVS); … … 4640 4640 void floatingPointCompare(DoubleCondition cond, FPRegisterID left, FPRegisterID right, RegisterID dest, Function compare) 4641 4641 { 4642 if (cond == DoubleNotEqual ) {4642 if (cond == DoubleNotEqualAndOrdered) { 4643 4643 // ConditionNE sets 1 if NotEqual *or* unordered - force the unordered cases not to set 1. 4644 4644 move(TrustedImm32(0), dest); -
trunk/Source/JavaScriptCore/assembler/MacroAssemblerARMv7.h
r252463 r258063 129 129 enum DoubleCondition { 130 130 // These conditions will only evaluate to true if the comparison is ordered - i.e. neither operand is NaN. 131 DoubleEqual = ARMv7Assembler::ConditionEQ,132 DoubleNotEqual = ARMv7Assembler::ConditionVC, // Not the right flag! check for this & handle differently.133 DoubleGreaterThan = ARMv7Assembler::ConditionGT,134 DoubleGreaterThanOrEqual = ARMv7Assembler::ConditionGE,135 DoubleLessThan = ARMv7Assembler::ConditionLO,136 DoubleLessThanOrEqual = ARMv7Assembler::ConditionLS,131 DoubleEqualAndOrdered = ARMv7Assembler::ConditionEQ, 132 DoubleNotEqualAndOrdered = ARMv7Assembler::ConditionVC, // Not the right flag! check for this & handle differently. 133 DoubleGreaterThanAndOrdered = ARMv7Assembler::ConditionGT, 134 DoubleGreaterThanOrEqualAndOrdered = ARMv7Assembler::ConditionGE, 135 DoubleLessThanAndOrdered = ARMv7Assembler::ConditionLO, 136 DoubleLessThanOrEqualAndOrdered = ARMv7Assembler::ConditionLS, 137 137 // If either operand is NaN, these conditions always evaluate to true. 138 138 DoubleEqualOrUnordered = ARMv7Assembler::ConditionVS, // Not the right flag! check for this & handle differently. … … 1219 1219 m_assembler.vmrs(); 1220 1220 1221 if (cond == DoubleNotEqual ) {1221 if (cond == DoubleNotEqualAndOrdered) { 1222 1222 // ConditionNE jumps if NotEqual *or* unordered - force the unordered cases not to jump. 1223 1223 Jump unordered = makeBranch(ARMv7Assembler::ConditionVS); -
trunk/Source/JavaScriptCore/assembler/MacroAssemblerMIPS.h
r252463 r258063 100 100 101 101 enum DoubleCondition { 102 DoubleEqual ,103 DoubleNotEqual ,104 DoubleGreaterThan ,105 DoubleGreaterThanOrEqual ,106 DoubleLessThan ,107 DoubleLessThanOrEqual ,102 DoubleEqualAndOrdered, 103 DoubleNotEqualAndOrdered, 104 DoubleGreaterThanAndOrdered, 105 DoubleGreaterThanOrEqualAndOrdered, 106 DoubleLessThanAndOrdered, 107 DoubleLessThanOrEqualAndOrdered, 108 108 DoubleEqualOrUnordered, 109 109 DoubleNotEqualOrUnordered, … … 3205 3205 Jump branchDouble(DoubleCondition cond, FPRegisterID left, FPRegisterID right) 3206 3206 { 3207 if (cond == DoubleEqual ) {3207 if (cond == DoubleEqualAndOrdered) { 3208 3208 m_assembler.ceqd(left, right); 3209 3209 return branchTrue(); 3210 3210 } 3211 if (cond == DoubleNotEqual ) {3211 if (cond == DoubleNotEqualAndOrdered) { 3212 3212 m_assembler.cueqd(left, right); 3213 3213 return branchFalse(); // false 3214 3214 } 3215 if (cond == DoubleGreaterThan ) {3215 if (cond == DoubleGreaterThanAndOrdered) { 3216 3216 m_assembler.cngtd(left, right); 3217 3217 return branchFalse(); // false 3218 3218 } 3219 if (cond == DoubleGreaterThanOrEqual ) {3219 if (cond == DoubleGreaterThanOrEqualAndOrdered) { 3220 3220 m_assembler.cnged(left, right); 3221 3221 return branchFalse(); // false 3222 3222 } 3223 if (cond == DoubleLessThan ) {3223 if (cond == DoubleLessThanAndOrdered) { 3224 3224 m_assembler.cltd(left, right); 3225 3225 return branchTrue(); 3226 3226 } 3227 if (cond == DoubleLessThanOrEqual ) {3227 if (cond == DoubleLessThanOrEqualAndOrdered) { 3228 3228 m_assembler.cled(left, right); 3229 3229 return branchTrue(); … … 3306 3306 { 3307 3307 m_assembler.vmov(scratch, MIPSRegisters::zero, MIPSRegisters::zero); 3308 return branchDouble(DoubleNotEqual , reg, scratch);3308 return branchDouble(DoubleNotEqualAndOrdered, reg, scratch); 3309 3309 } 3310 3310 -
trunk/Source/JavaScriptCore/assembler/MacroAssemblerX86Common.h
r250005 r258063 89 89 enum DoubleCondition { 90 90 // These conditions will only evaluate to true if the comparison is ordered - i.e. neither operand is NaN. 91 DoubleEqual = X86Assembler::ConditionE | DoubleConditionBitSpecial,92 DoubleNotEqual = X86Assembler::ConditionNE,93 DoubleGreaterThan = X86Assembler::ConditionA,94 DoubleGreaterThanOrEqual = X86Assembler::ConditionAE,95 DoubleLessThan = X86Assembler::ConditionA | DoubleConditionBitInvert,96 DoubleLessThanOrEqual = X86Assembler::ConditionAE | DoubleConditionBitInvert,91 DoubleEqualAndOrdered = X86Assembler::ConditionE | DoubleConditionBitSpecial, 92 DoubleNotEqualAndOrdered = X86Assembler::ConditionNE, 93 DoubleGreaterThanAndOrdered = X86Assembler::ConditionA, 94 DoubleGreaterThanOrEqualAndOrdered = X86Assembler::ConditionAE, 95 DoubleLessThanAndOrdered = X86Assembler::ConditionA | DoubleConditionBitInvert, 96 DoubleLessThanOrEqualAndOrdered = X86Assembler::ConditionAE | DoubleConditionBitInvert, 97 97 // If either operand is NaN, these conditions always evaluate to true. 98 98 DoubleEqualOrUnordered = X86Assembler::ConditionE, … … 2081 2081 { 2082 2082 m_assembler.xorpd_rr(scratch, scratch); 2083 return branchDouble(DoubleNotEqual , reg, scratch);2083 return branchDouble(DoubleNotEqualAndOrdered, reg, scratch); 2084 2084 } 2085 2085 … … 2325 2325 m_assembler.ucomisd_rr(right, left); 2326 2326 2327 if (cond == DoubleEqual ) {2327 if (cond == DoubleEqualAndOrdered) { 2328 2328 if (left == right) { 2329 2329 m_assembler.cmovnpl_rr(src, dest); … … 3038 3038 { 3039 3039 switch (cond) { 3040 case DoubleEqual :3040 case DoubleEqualAndOrdered: 3041 3041 return DoubleNotEqualOrUnordered; 3042 case DoubleNotEqual :3042 case DoubleNotEqualAndOrdered: 3043 3043 return DoubleEqualOrUnordered; 3044 case DoubleGreaterThan :3044 case DoubleGreaterThanAndOrdered: 3045 3045 return DoubleLessThanOrEqualOrUnordered; 3046 case DoubleGreaterThanOrEqual :3046 case DoubleGreaterThanOrEqualAndOrdered: 3047 3047 return DoubleLessThanOrUnordered; 3048 case DoubleLessThan :3048 case DoubleLessThanAndOrdered: 3049 3049 return DoubleGreaterThanOrEqualOrUnordered; 3050 case DoubleLessThanOrEqual :3050 case DoubleLessThanOrEqualAndOrdered: 3051 3051 return DoubleGreaterThanOrUnordered; 3052 3052 case DoubleEqualOrUnordered: 3053 return DoubleNotEqual ;3053 return DoubleNotEqualAndOrdered; 3054 3054 case DoubleNotEqualOrUnordered: 3055 return DoubleEqual ;3055 return DoubleEqualAndOrdered; 3056 3056 case DoubleGreaterThanOrUnordered: 3057 return DoubleLessThanOrEqual ;3057 return DoubleLessThanOrEqualAndOrdered; 3058 3058 case DoubleGreaterThanOrEqualOrUnordered: 3059 return DoubleLessThan ;3059 return DoubleLessThanAndOrdered; 3060 3060 case DoubleLessThanOrUnordered: 3061 return DoubleGreaterThanOrEqual ;3061 return DoubleGreaterThanOrEqualAndOrdered; 3062 3062 case DoubleLessThanOrEqualOrUnordered: 3063 return DoubleGreaterThan ;3063 return DoubleGreaterThanAndOrdered; 3064 3064 } 3065 3065 RELEASE_ASSERT_NOT_REACHED(); 3066 return DoubleEqual ; // make compiler happy3066 return DoubleEqualAndOrdered; // make compiler happy 3067 3067 } 3068 3068 … … 4123 4123 if (cond & DoubleConditionBitSpecial) { 4124 4124 ASSERT(!(cond & DoubleConditionBitInvert)); 4125 if (cond == DoubleEqual ) {4125 if (cond == DoubleEqualAndOrdered) { 4126 4126 if (left == right) { 4127 4127 compare(right, left); … … 4165 4165 Jump jumpAfterFloatingPointCompare(DoubleCondition cond, FPRegisterID left, FPRegisterID right) 4166 4166 { 4167 if (cond == DoubleEqual ) {4167 if (cond == DoubleEqualAndOrdered) { 4168 4168 if (left == right) 4169 4169 return Jump(m_assembler.jnp()); … … 4200 4200 void moveConditionallyAfterFloatingPointCompare(DoubleCondition cond, FPRegisterID left, FPRegisterID right, RegisterID src, RegisterID dest) 4201 4201 { 4202 if (cond == DoubleEqual ) {4202 if (cond == DoubleEqualAndOrdered) { 4203 4203 if (left == right) { 4204 4204 m_assembler.cmovnpq_rr(src, dest); -
trunk/Source/JavaScriptCore/assembler/MacroAssemblerX86_64.h
r252422 r258063 1784 1784 // uint64_t; then add back int64_t::min() in the destination gpr. 1785 1785 1786 Jump large = branchDouble(DoubleGreaterThanOrEqual , src, int64Min);1786 Jump large = branchDouble(DoubleGreaterThanOrEqualAndOrdered, src, int64Min); 1787 1787 m_assembler.cvttsd2siq_rr(src, dest); 1788 1788 Jump done = jump(); … … 1817 1817 // uint64_t; then add back int64_t::min() in the destination gpr. 1818 1818 1819 Jump large = branchFloat(DoubleGreaterThanOrEqual , src, int64Min);1819 Jump large = branchFloat(DoubleGreaterThanOrEqualAndOrdered, src, int64Min); 1820 1820 m_assembler.cvttss2siq_rr(src, dest); 1821 1821 Jump done = jump(); -
trunk/Source/JavaScriptCore/assembler/testmasm.cpp
r258062 r258063 505 505 }; 506 506 switch (condition) { 507 case MacroAssembler::DoubleEqual :507 case MacroAssembler::DoubleEqualAndOrdered: 508 508 return !isUnordered(a) && !isUnordered(b) && (a == b); 509 case MacroAssembler::DoubleNotEqual :509 case MacroAssembler::DoubleNotEqualAndOrdered: 510 510 return !isUnordered(a) && !isUnordered(b) && (a != b); 511 case MacroAssembler::DoubleGreaterThan :511 case MacroAssembler::DoubleGreaterThanAndOrdered: 512 512 return !isUnordered(a) && !isUnordered(b) && (a > b); 513 case MacroAssembler::DoubleGreaterThanOrEqual :513 case MacroAssembler::DoubleGreaterThanOrEqualAndOrdered: 514 514 return !isUnordered(a) && !isUnordered(b) && (a >= b); 515 case MacroAssembler::DoubleLessThan :515 case MacroAssembler::DoubleLessThanAndOrdered: 516 516 return !isUnordered(a) && !isUnordered(b) && (a < b); 517 case MacroAssembler::DoubleLessThanOrEqual :517 case MacroAssembler::DoubleLessThanOrEqualAndOrdered: 518 518 return !isUnordered(a) && !isUnordered(b) && (a <= b); 519 519 case MacroAssembler::DoubleEqualOrUnordered: … … 577 577 }; 578 578 switch (condition) { 579 case MacroAssembler::DoubleEqual :579 case MacroAssembler::DoubleEqualAndOrdered: 580 580 return !isUnordered(a) && (a == a); 581 case MacroAssembler::DoubleNotEqual :581 case MacroAssembler::DoubleNotEqualAndOrdered: 582 582 return !isUnordered(a) && (a != a); 583 case MacroAssembler::DoubleGreaterThan :583 case MacroAssembler::DoubleGreaterThanAndOrdered: 584 584 return !isUnordered(a) && (a > a); 585 case MacroAssembler::DoubleGreaterThanOrEqual :585 case MacroAssembler::DoubleGreaterThanOrEqualAndOrdered: 586 586 return !isUnordered(a) && (a >= a); 587 case MacroAssembler::DoubleLessThan :587 case MacroAssembler::DoubleLessThanAndOrdered: 588 588 return !isUnordered(a) && (a < a); 589 case MacroAssembler::DoubleLessThanOrEqual :589 case MacroAssembler::DoubleLessThanOrEqualAndOrdered: 590 590 return !isUnordered(a) && (a <= a); 591 591 case MacroAssembler::DoubleEqualOrUnordered: … … 702 702 }; 703 703 switch (condition) { 704 case MacroAssembler::DoubleEqual :704 case MacroAssembler::DoubleEqualAndOrdered: 705 705 return !isUnordered(a) && !isUnordered(b) && (a == b) ? selectionA : selectionB; 706 case MacroAssembler::DoubleNotEqual :706 case MacroAssembler::DoubleNotEqualAndOrdered: 707 707 return !isUnordered(a) && !isUnordered(b) && (a != b) ? selectionA : selectionB; 708 case MacroAssembler::DoubleGreaterThan :708 case MacroAssembler::DoubleGreaterThanAndOrdered: 709 709 return !isUnordered(a) && !isUnordered(b) && (a > b) ? selectionA : selectionB; 710 case MacroAssembler::DoubleGreaterThanOrEqual :710 case MacroAssembler::DoubleGreaterThanOrEqualAndOrdered: 711 711 return !isUnordered(a) && !isUnordered(b) && (a >= b) ? selectionA : selectionB; 712 case MacroAssembler::DoubleLessThan :712 case MacroAssembler::DoubleLessThanAndOrdered: 713 713 return !isUnordered(a) && !isUnordered(b) && (a < b) ? selectionA : selectionB; 714 case MacroAssembler::DoubleLessThanOrEqual :714 case MacroAssembler::DoubleLessThanOrEqualAndOrdered: 715 715 return !isUnordered(a) && !isUnordered(b) && (a <= b) ? selectionA : selectionB; 716 716 case MacroAssembler::DoubleEqualOrUnordered: … … 1040 1040 FPRReg tempFPR = FPRInfo::fpRegT5; 1041 1041 jit.loadDouble(CCallHelpers::TrustedImmPtr(&selectionA), tempFPR); 1042 auto aIsUnchanged = jit.branchDouble(CCallHelpers::DoubleEqual , selectionAFPR, tempFPR);1042 auto aIsUnchanged = jit.branchDouble(CCallHelpers::DoubleEqualAndOrdered, selectionAFPR, tempFPR); 1043 1043 jit.loadDouble(CCallHelpers::TrustedImmPtr(&corruptedSelectionA), destFPR); 1044 1044 aIsUnchanged.link(&jit); 1045 1045 1046 1046 jit.loadDouble(CCallHelpers::TrustedImmPtr(&selectionB), tempFPR); 1047 auto bIsUnchanged = jit.branchDouble(CCallHelpers::DoubleEqual , selectionBFPR, tempFPR);1047 auto bIsUnchanged = jit.branchDouble(CCallHelpers::DoubleEqualAndOrdered, selectionBFPR, tempFPR); 1048 1048 jit.loadDouble(CCallHelpers::TrustedImmPtr(&corruptedSelectionB), destFPR); 1049 1049 bIsUnchanged.link(&jit); … … 1086 1086 FPRReg tempFPR = FPRInfo::fpRegT5; 1087 1087 jit.loadDouble(CCallHelpers::TrustedImmPtr(&selectionB), tempFPR); 1088 auto bIsUnchanged = jit.branchDouble(CCallHelpers::DoubleEqual , selectionBFPR, tempFPR);1088 auto bIsUnchanged = jit.branchDouble(CCallHelpers::DoubleEqualAndOrdered, selectionBFPR, tempFPR); 1089 1089 jit.loadDouble(CCallHelpers::TrustedImmPtr(&corruptedSelectionB), destFPR); 1090 1090 bIsUnchanged.link(&jit); … … 1127 1127 FPRReg tempFPR = FPRInfo::fpRegT5; 1128 1128 jit.loadDouble(CCallHelpers::TrustedImmPtr(&selectionA), tempFPR); 1129 auto aIsUnchanged = jit.branchDouble(CCallHelpers::DoubleEqual , selectionAFPR, tempFPR);1129 auto aIsUnchanged = jit.branchDouble(CCallHelpers::DoubleEqualAndOrdered, selectionAFPR, tempFPR); 1130 1130 jit.loadDouble(CCallHelpers::TrustedImmPtr(&corruptedSelectionA), destFPR); 1131 1131 aIsUnchanged.link(&jit); … … 1169 1169 FPRReg tempFPR = FPRInfo::fpRegT5; 1170 1170 jit.loadDouble(CCallHelpers::TrustedImmPtr(&selectionA), tempFPR); 1171 auto aIsUnchanged = jit.branchDouble(CCallHelpers::DoubleEqual , selectionAFPR, tempFPR);1171 auto aIsUnchanged = jit.branchDouble(CCallHelpers::DoubleEqualAndOrdered, selectionAFPR, tempFPR); 1172 1172 jit.loadDouble(CCallHelpers::TrustedImmPtr(&corruptedSelectionA), destFPR); 1173 1173 aIsUnchanged.link(&jit); 1174 1174 1175 1175 jit.loadDouble(CCallHelpers::TrustedImmPtr(&selectionB), tempFPR); 1176 auto bIsUnchanged = jit.branchDouble(CCallHelpers::DoubleEqual , selectionBFPR, tempFPR);1176 auto bIsUnchanged = jit.branchDouble(CCallHelpers::DoubleEqualAndOrdered, selectionBFPR, tempFPR); 1177 1177 jit.loadDouble(CCallHelpers::TrustedImmPtr(&corruptedSelectionB), destFPR); 1178 1178 bIsUnchanged.link(&jit); … … 1215 1215 FPRReg tempFPR = FPRInfo::fpRegT5; 1216 1216 jit.loadDouble(CCallHelpers::TrustedImmPtr(&selectionB), tempFPR); 1217 auto bIsUnchanged = jit.branchDouble(CCallHelpers::DoubleEqual , selectionBFPR, tempFPR);1217 auto bIsUnchanged = jit.branchDouble(CCallHelpers::DoubleEqualAndOrdered, selectionBFPR, tempFPR); 1218 1218 jit.loadDouble(CCallHelpers::TrustedImmPtr(&corruptedSelectionB), destFPR); 1219 1219 bIsUnchanged.link(&jit); … … 1256 1256 FPRReg tempFPR = FPRInfo::fpRegT5; 1257 1257 jit.loadDouble(CCallHelpers::TrustedImmPtr(&selectionA), tempFPR); 1258 auto aIsUnchanged = jit.branchDouble(CCallHelpers::DoubleEqual , selectionAFPR, tempFPR);1258 auto aIsUnchanged = jit.branchDouble(CCallHelpers::DoubleEqualAndOrdered, selectionAFPR, tempFPR); 1259 1259 jit.loadDouble(CCallHelpers::TrustedImmPtr(&corruptedSelectionA), destFPR); 1260 1260 aIsUnchanged.link(&jit); … … 1275 1275 }; 1276 1276 switch (condition) { 1277 case MacroAssembler::DoubleEqual :1277 case MacroAssembler::DoubleEqualAndOrdered: 1278 1278 return !isUnordered(a) && (a == a) ? selectionA : selectionB; 1279 case MacroAssembler::DoubleNotEqual :1279 case MacroAssembler::DoubleNotEqualAndOrdered: 1280 1280 return !isUnordered(a) && (a != a) ? selectionA : selectionB; 1281 case MacroAssembler::DoubleGreaterThan :1281 case MacroAssembler::DoubleGreaterThanAndOrdered: 1282 1282 return !isUnordered(a) && (a > a) ? selectionA : selectionB; 1283 case MacroAssembler::DoubleGreaterThanOrEqual :1283 case MacroAssembler::DoubleGreaterThanOrEqualAndOrdered: 1284 1284 return !isUnordered(a) && (a >= a) ? selectionA : selectionB; 1285 case MacroAssembler::DoubleLessThan :1285 case MacroAssembler::DoubleLessThanAndOrdered: 1286 1286 return !isUnordered(a) && (a < a) ? selectionA : selectionB; 1287 case MacroAssembler::DoubleLessThanOrEqual :1287 case MacroAssembler::DoubleLessThanOrEqualAndOrdered: 1288 1288 return !isUnordered(a) && (a <= a) ? selectionA : selectionB; 1289 1289 case MacroAssembler::DoubleEqualOrUnordered: … … 2206 2206 #define FOR_EACH_DOUBLE_CONDITION_RUN(__test) \ 2207 2207 do { \ 2208 RUN(__test(MacroAssembler::DoubleEqual )); \2209 RUN(__test(MacroAssembler::DoubleNotEqual )); \2210 RUN(__test(MacroAssembler::DoubleGreaterThan )); \2211 RUN(__test(MacroAssembler::DoubleGreaterThanOrEqual )); \2212 RUN(__test(MacroAssembler::DoubleLessThan )); \2213 RUN(__test(MacroAssembler::DoubleLessThanOrEqual )); \2208 RUN(__test(MacroAssembler::DoubleEqualAndOrdered)); \ 2209 RUN(__test(MacroAssembler::DoubleNotEqualAndOrdered)); \ 2210 RUN(__test(MacroAssembler::DoubleGreaterThanAndOrdered)); \ 2211 RUN(__test(MacroAssembler::DoubleGreaterThanOrEqualAndOrdered)); \ 2212 RUN(__test(MacroAssembler::DoubleLessThanAndOrdered)); \ 2213 RUN(__test(MacroAssembler::DoubleLessThanOrEqualAndOrdered)); \ 2214 2214 RUN(__test(MacroAssembler::DoubleEqualOrUnordered)); \ 2215 2215 RUN(__test(MacroAssembler::DoubleNotEqualOrUnordered)); \ -
trunk/Source/JavaScriptCore/b3/B3LowerToAir.cpp
r254500 r258063 1593 1593 return createRelCond(MacroAssembler::NotEqual, MacroAssembler::DoubleNotEqualOrUnordered); 1594 1594 case Equal: 1595 return createRelCond(MacroAssembler::Equal, MacroAssembler::DoubleEqual );1595 return createRelCond(MacroAssembler::Equal, MacroAssembler::DoubleEqualAndOrdered); 1596 1596 case LessThan: 1597 return createRelCond(MacroAssembler::LessThan, MacroAssembler::DoubleLessThan );1597 return createRelCond(MacroAssembler::LessThan, MacroAssembler::DoubleLessThanAndOrdered); 1598 1598 case GreaterThan: 1599 return createRelCond(MacroAssembler::GreaterThan, MacroAssembler::DoubleGreaterThan );1599 return createRelCond(MacroAssembler::GreaterThan, MacroAssembler::DoubleGreaterThanAndOrdered); 1600 1600 case LessEqual: 1601 return createRelCond(MacroAssembler::LessThanOrEqual, MacroAssembler::DoubleLessThanOrEqual );1601 return createRelCond(MacroAssembler::LessThanOrEqual, MacroAssembler::DoubleLessThanOrEqualAndOrdered); 1602 1602 case GreaterEqual: 1603 return createRelCond(MacroAssembler::GreaterThanOrEqual, MacroAssembler::DoubleGreaterThanOrEqual );1603 return createRelCond(MacroAssembler::GreaterThanOrEqual, MacroAssembler::DoubleGreaterThanOrEqualAndOrdered); 1604 1604 case EqualOrUnordered: 1605 1605 // The integer condition is never used in this case. … … 1608 1608 // We use a bogus double condition because these integer comparisons won't got down that 1609 1609 // path anyway. 1610 return createRelCond(MacroAssembler::Above, MacroAssembler::DoubleEqual );1610 return createRelCond(MacroAssembler::Above, MacroAssembler::DoubleEqualAndOrdered); 1611 1611 case Below: 1612 return createRelCond(MacroAssembler::Below, MacroAssembler::DoubleEqual );1612 return createRelCond(MacroAssembler::Below, MacroAssembler::DoubleEqualAndOrdered); 1613 1613 case AboveEqual: 1614 return createRelCond(MacroAssembler::AboveOrEqual, MacroAssembler::DoubleEqual );1614 return createRelCond(MacroAssembler::AboveOrEqual, MacroAssembler::DoubleEqualAndOrdered); 1615 1615 case BelowEqual: 1616 return createRelCond(MacroAssembler::BelowOrEqual, MacroAssembler::DoubleEqual );1616 return createRelCond(MacroAssembler::BelowOrEqual, MacroAssembler::DoubleEqualAndOrdered); 1617 1617 case BitAnd: { 1618 1618 Value* left = value->child(0); -
trunk/Source/JavaScriptCore/dfg/DFGSpeculativeJIT.cpp
r257399 r258063 2807 2807 MacroAssembler::Jump tooSmall = jit.branchDouble(MacroAssembler::DoubleLessThanOrEqualOrUnordered, source, scratch); 2808 2808 jit.loadDouble(JITCompiler::TrustedImmPtr(&byteMax), scratch); 2809 MacroAssembler::Jump tooBig = jit.branchDouble(MacroAssembler::DoubleGreaterThan , source, scratch);2809 MacroAssembler::Jump tooBig = jit.branchDouble(MacroAssembler::DoubleGreaterThanAndOrdered, source, scratch); 2810 2810 2811 2811 jit.loadDouble(JITCompiler::TrustedImmPtr(&half), scratch); … … 5647 5647 m_jit.addDouble(resultFPR, scratchFPR); 5648 5648 5649 JITCompiler::Jump shouldUseCeiled = m_jit.branchDouble(JITCompiler::DoubleLessThanOrEqual , scratchFPR, valueFPR);5649 JITCompiler::Jump shouldUseCeiled = m_jit.branchDouble(JITCompiler::DoubleLessThanOrEqualAndOrdered, scratchFPR, valueFPR); 5650 5650 static constexpr double oneConstant = -1.0; 5651 5651 m_jit.loadDouble(TrustedImmPtr(&oneConstant), scratchFPR); … … 5798 5798 MacroAssembler::JumpList done; 5799 5799 5800 MacroAssembler::Jump op1Less = m_jit.branchDouble(node->op() == ArithMin ? MacroAssembler::DoubleLessThan : MacroAssembler::DoubleGreaterThan, op1FPR, op2FPR);5800 MacroAssembler::Jump op1Less = m_jit.branchDouble(node->op() == ArithMin ? MacroAssembler::DoubleLessThanAndOrdered : MacroAssembler::DoubleGreaterThanAndOrdered, op1FPR, op2FPR); 5801 5801 5802 5802 // op2 is eather the lesser one or one of then is NaN 5803 MacroAssembler::Jump op2Less = m_jit.branchDouble(node->op() == ArithMin ? MacroAssembler::DoubleGreaterThanOrEqual : MacroAssembler::DoubleLessThanOrEqual, op1FPR, op2FPR);5803 MacroAssembler::Jump op2Less = m_jit.branchDouble(node->op() == ArithMin ? MacroAssembler::DoubleGreaterThanOrEqualAndOrdered : MacroAssembler::DoubleLessThanOrEqualAndOrdered, op1FPR, op2FPR); 5804 5804 5805 5805 // Unordered case. We don't know which of op1, op2 is NaN. Manufacture NaN by adding … … 5938 5938 5939 5939 m_jit.moveZeroToDouble(resultFpr); 5940 MacroAssembler::Jump xIsZeroOrNegativeZero = m_jit.branchDouble(MacroAssembler::DoubleEqual , xOperandFpr, resultFpr);5940 MacroAssembler::Jump xIsZeroOrNegativeZero = m_jit.branchDouble(MacroAssembler::DoubleEqualAndOrdered, xOperandFpr, resultFpr); 5941 5941 5942 5942 m_jit.loadDouble(TrustedImmPtr(&minusInfinityConstant), resultFpr); 5943 MacroAssembler::Jump xIsMinusInfinity = m_jit.branchDouble(MacroAssembler::DoubleEqual , xOperandFpr, resultFpr);5943 MacroAssembler::Jump xIsMinusInfinity = m_jit.branchDouble(MacroAssembler::DoubleEqualAndOrdered, xOperandFpr, resultFpr); 5944 5944 m_jit.sqrtDouble(xOperandFpr, resultFpr); 5945 5945 MacroAssembler::Jump doneWithSqrt = m_jit.jump(); … … 5965 5965 5966 5966 m_jit.moveZeroToDouble(resultFpr); 5967 MacroAssembler::Jump xIsZeroOrNegativeZero = m_jit.branchDouble(MacroAssembler::DoubleEqual , xOperandFpr, resultFpr);5967 MacroAssembler::Jump xIsZeroOrNegativeZero = m_jit.branchDouble(MacroAssembler::DoubleEqualAndOrdered, xOperandFpr, resultFpr); 5968 5968 5969 5969 m_jit.loadDouble(TrustedImmPtr(&minusInfinityConstant), resultFpr); 5970 MacroAssembler::Jump xIsMinusInfinity = m_jit.branchDouble(MacroAssembler::DoubleEqual , xOperandFpr, resultFpr);5970 MacroAssembler::Jump xIsMinusInfinity = m_jit.branchDouble(MacroAssembler::DoubleEqualAndOrdered, xOperandFpr, resultFpr); 5971 5971 5972 5972 static constexpr double oneConstant = 1.; … … 6158 6158 if (branchIndexInBlock != UINT_MAX) { 6159 6159 Node* branchNode = m_block->at(branchIndexInBlock); 6160 compilePeepHoleDoubleBranch(node, branchNode, MacroAssembler::DoubleEqual );6160 compilePeepHoleDoubleBranch(node, branchNode, MacroAssembler::DoubleEqualAndOrdered); 6161 6161 use(node->child1()); 6162 6162 use(node->child2()); … … 6165 6165 return true; 6166 6166 } 6167 compileDoubleCompare(node, MacroAssembler::DoubleEqual );6167 compileDoubleCompare(node, MacroAssembler::DoubleEqualAndOrdered); 6168 6168 return false; 6169 6169 } … … 8711 8711 auto notFound = m_jit.branch32(CCallHelpers::Equal, indexGPR, lengthGPR); 8712 8712 m_jit.loadDouble(MacroAssembler::BaseIndex(storageGPR, indexGPR, MacroAssembler::TimesEight), tempFPR); 8713 auto found = m_jit.branchDouble(CCallHelpers::DoubleEqual , tempFPR, searchElementFPR);8713 auto found = m_jit.branchDouble(CCallHelpers::DoubleEqualAndOrdered, tempFPR, searchElementFPR); 8714 8714 m_jit.add32(TrustedImm32(1), indexGPR); 8715 8715 m_jit.jump().linkTo(loop, &m_jit); … … 12024 12024 m_jit.truncateDoubleToInt32(doubleValueFPR, scratchGPR); 12025 12025 m_jit.convertInt32ToDouble(scratchGPR, tempFPR); 12026 passThroughCases.append(m_jit.branchDouble(JITCompiler::DoubleNotEqual , doubleValueFPR, tempFPR));12026 passThroughCases.append(m_jit.branchDouble(JITCompiler::DoubleNotEqualAndOrdered, doubleValueFPR, tempFPR)); 12027 12027 12028 12028 m_jit.boxInt32(scratchGPR, resultRegs); -
trunk/Source/JavaScriptCore/dfg/DFGSpeculativeJIT32_64.cpp
r257399 r258063 2158 2158 2159 2159 case CompareLess: 2160 if (compare(node, JITCompiler::LessThan, JITCompiler::DoubleLessThan , operationCompareLess))2160 if (compare(node, JITCompiler::LessThan, JITCompiler::DoubleLessThanAndOrdered, operationCompareLess)) 2161 2161 return; 2162 2162 break; 2163 2163 2164 2164 case CompareLessEq: 2165 if (compare(node, JITCompiler::LessThanOrEqual, JITCompiler::DoubleLessThanOrEqual , operationCompareLessEq))2165 if (compare(node, JITCompiler::LessThanOrEqual, JITCompiler::DoubleLessThanOrEqualAndOrdered, operationCompareLessEq)) 2166 2166 return; 2167 2167 break; 2168 2168 2169 2169 case CompareGreater: 2170 if (compare(node, JITCompiler::GreaterThan, JITCompiler::DoubleGreaterThan , operationCompareGreater))2170 if (compare(node, JITCompiler::GreaterThan, JITCompiler::DoubleGreaterThanAndOrdered, operationCompareGreater)) 2171 2171 return; 2172 2172 break; 2173 2173 2174 2174 case CompareGreaterEq: 2175 if (compare(node, JITCompiler::GreaterThanOrEqual, JITCompiler::DoubleGreaterThanOrEqual , operationCompareGreaterEq))2175 if (compare(node, JITCompiler::GreaterThanOrEqual, JITCompiler::DoubleGreaterThanOrEqualAndOrdered, operationCompareGreaterEq)) 2176 2176 return; 2177 2177 break; … … 2186 2186 2187 2187 case CompareEq: 2188 if (compare(node, JITCompiler::Equal, JITCompiler::DoubleEqual , operationCompareEq))2188 if (compare(node, JITCompiler::Equal, JITCompiler::DoubleEqualAndOrdered, operationCompareEq)) 2189 2189 return; 2190 2190 break; -
trunk/Source/JavaScriptCore/dfg/DFGSpeculativeJIT64.cpp
r257399 r258063 2306 2306 2307 2307 case CompareLess: 2308 if (compare(node, JITCompiler::LessThan, JITCompiler::DoubleLessThan , operationCompareLess))2308 if (compare(node, JITCompiler::LessThan, JITCompiler::DoubleLessThanAndOrdered, operationCompareLess)) 2309 2309 return; 2310 2310 break; 2311 2311 2312 2312 case CompareLessEq: 2313 if (compare(node, JITCompiler::LessThanOrEqual, JITCompiler::DoubleLessThanOrEqual , operationCompareLessEq))2313 if (compare(node, JITCompiler::LessThanOrEqual, JITCompiler::DoubleLessThanOrEqualAndOrdered, operationCompareLessEq)) 2314 2314 return; 2315 2315 break; 2316 2316 2317 2317 case CompareGreater: 2318 if (compare(node, JITCompiler::GreaterThan, JITCompiler::DoubleGreaterThan , operationCompareGreater))2318 if (compare(node, JITCompiler::GreaterThan, JITCompiler::DoubleGreaterThanAndOrdered, operationCompareGreater)) 2319 2319 return; 2320 2320 break; 2321 2321 2322 2322 case CompareGreaterEq: 2323 if (compare(node, JITCompiler::GreaterThanOrEqual, JITCompiler::DoubleGreaterThanOrEqual , operationCompareGreaterEq))2323 if (compare(node, JITCompiler::GreaterThanOrEqual, JITCompiler::DoubleGreaterThanOrEqualAndOrdered, operationCompareGreaterEq)) 2324 2324 return; 2325 2325 break; … … 2334 2334 2335 2335 case CompareEq: 2336 if (compare(node, JITCompiler::Equal, JITCompiler::DoubleEqual , operationCompareEq))2336 if (compare(node, JITCompiler::Equal, JITCompiler::DoubleEqualAndOrdered, operationCompareEq)) 2337 2337 return; 2338 2338 break; … … 4115 4115 notNanNorInfinity.link(&m_jit); 4116 4116 m_jit.roundTowardZeroDouble(tempFPR1, tempFPR2); 4117 m_jit.compareDouble(JITCompiler::DoubleEqual , tempFPR1, tempFPR2, resultGPR);4117 m_jit.compareDouble(JITCompiler::DoubleEqualAndOrdered, tempFPR1, tempFPR2, resultGPR); 4118 4118 m_jit.or32(TrustedImm32(JSValue::ValueFalse), resultGPR); 4119 4119 done.append(m_jit.jump()); -
trunk/Source/JavaScriptCore/ftl/FTLLowerDFGToB3.cpp
r257399 r258063 10497 10497 FPRReg temp = params.fpScratch(0); 10498 10498 jit.roundTowardZeroDouble(input, temp); 10499 jit.compareDouble(MacroAssembler::DoubleEqual , input, temp, result);10499 jit.compareDouble(MacroAssembler::DoubleEqualAndOrdered, input, temp, result); 10500 10500 }); 10501 10501 ValueFromBlock patchpointResult = m_out.anchor(patchpoint); -
trunk/Source/JavaScriptCore/jit/AssemblyHelpers.h
r257201 r258063 1094 1094 Jump branchIfNotNaN(FPRReg fpr) 1095 1095 { 1096 return branchDouble(DoubleEqual , fpr, fpr);1096 return branchDouble(DoubleEqualAndOrdered, fpr, fpr); 1097 1097 } 1098 1098 -
trunk/Source/JavaScriptCore/jit/JITArithmetic.cpp
r254735 r258063 96 96 void JIT::emitSlow_op_jless(const Instruction* currentInstruction, Vector<SlowCaseEntry>::iterator& iter) 97 97 { 98 emit_compareAndJumpSlow<OpJless>(currentInstruction, DoubleLessThan , operationCompareLess, false, iter);98 emit_compareAndJumpSlow<OpJless>(currentInstruction, DoubleLessThanAndOrdered, operationCompareLess, false, iter); 99 99 } 100 100 101 101 void JIT::emitSlow_op_jlesseq(const Instruction* currentInstruction, Vector<SlowCaseEntry>::iterator& iter) 102 102 { 103 emit_compareAndJumpSlow<OpJlesseq>(currentInstruction, DoubleLessThanOrEqual , operationCompareLessEq, false, iter);103 emit_compareAndJumpSlow<OpJlesseq>(currentInstruction, DoubleLessThanOrEqualAndOrdered, operationCompareLessEq, false, iter); 104 104 } 105 105 106 106 void JIT::emitSlow_op_jgreater(const Instruction* currentInstruction, Vector<SlowCaseEntry>::iterator& iter) 107 107 { 108 emit_compareAndJumpSlow<OpJgreater>(currentInstruction, DoubleGreaterThan , operationCompareGreater, false, iter);108 emit_compareAndJumpSlow<OpJgreater>(currentInstruction, DoubleGreaterThanAndOrdered, operationCompareGreater, false, iter); 109 109 } 110 110 111 111 void JIT::emitSlow_op_jgreatereq(const Instruction* currentInstruction, Vector<SlowCaseEntry>::iterator& iter) 112 112 { 113 emit_compareAndJumpSlow<OpJgreatereq>(currentInstruction, DoubleGreaterThanOrEqual , operationCompareGreaterEq, false, iter);113 emit_compareAndJumpSlow<OpJgreatereq>(currentInstruction, DoubleGreaterThanOrEqualAndOrdered, operationCompareGreaterEq, false, iter); 114 114 } 115 115 -
trunk/Source/JavaScriptCore/jit/JITArithmetic32_64.cpp
r254947 r258063 234 234 case op_jless: 235 235 emitLoadDouble(op1, fpRegT2); 236 addJump(branchDouble(DoubleLessThan , fpRegT2, fpRegT0), target);236 addJump(branchDouble(DoubleLessThanAndOrdered, fpRegT2, fpRegT0), target); 237 237 break; 238 238 case op_jlesseq: 239 239 emitLoadDouble(op1, fpRegT2); 240 addJump(branchDouble(DoubleLessThanOrEqual , fpRegT2, fpRegT0), target);240 addJump(branchDouble(DoubleLessThanOrEqualAndOrdered, fpRegT2, fpRegT0), target); 241 241 break; 242 242 case op_jgreater: 243 243 emitLoadDouble(op1, fpRegT2); 244 addJump(branchDouble(DoubleGreaterThan , fpRegT2, fpRegT0), target);244 addJump(branchDouble(DoubleGreaterThanAndOrdered, fpRegT2, fpRegT0), target); 245 245 break; 246 246 case op_jgreatereq: 247 247 emitLoadDouble(op1, fpRegT2); 248 addJump(branchDouble(DoubleGreaterThanOrEqual , fpRegT2, fpRegT0), target);248 addJump(branchDouble(DoubleGreaterThanOrEqualAndOrdered, fpRegT2, fpRegT0), target); 249 249 break; 250 250 case op_jnless: … … 291 291 case op_jless: 292 292 emitLoadDouble(op2, fpRegT1); 293 addJump(branchDouble(DoubleLessThan , fpRegT0, fpRegT1), target);293 addJump(branchDouble(DoubleLessThanAndOrdered, fpRegT0, fpRegT1), target); 294 294 break; 295 295 case op_jlesseq: 296 296 emitLoadDouble(op2, fpRegT1); 297 addJump(branchDouble(DoubleLessThanOrEqual , fpRegT0, fpRegT1), target);297 addJump(branchDouble(DoubleLessThanOrEqualAndOrdered, fpRegT0, fpRegT1), target); 298 298 break; 299 299 case op_jgreater: 300 300 emitLoadDouble(op2, fpRegT1); 301 addJump(branchDouble(DoubleGreaterThan , fpRegT0, fpRegT1), target);301 addJump(branchDouble(DoubleGreaterThanAndOrdered, fpRegT0, fpRegT1), target); 302 302 break; 303 303 case op_jgreatereq: 304 304 emitLoadDouble(op2, fpRegT1); 305 addJump(branchDouble(DoubleGreaterThanOrEqual , fpRegT0, fpRegT1), target);305 addJump(branchDouble(DoubleGreaterThanOrEqualAndOrdered, fpRegT0, fpRegT1), target); 306 306 break; 307 307 case op_jnless: -
trunk/Source/JavaScriptCore/jit/ThunkGenerators.cpp
r254843 r258063 901 901 if (jit.supportsFloatingPointTruncate()) { 902 902 jit.moveZeroToDouble(SpecializedThunkJIT::fpRegT1); 903 doubleResult.append(jit.branchDouble(MacroAssembler::DoubleEqual , SpecializedThunkJIT::fpRegT0, SpecializedThunkJIT::fpRegT1));903 doubleResult.append(jit.branchDouble(MacroAssembler::DoubleEqualAndOrdered, SpecializedThunkJIT::fpRegT0, SpecializedThunkJIT::fpRegT1)); 904 904 SpecializedThunkJIT::JumpList slowPath; 905 905 // Handle the negative doubles in the slow path for now. … … 978 978 if (jit.supportsFloatingPointRounding()) { 979 979 jit.moveZeroToDouble(SpecializedThunkJIT::fpRegT1); 980 doubleResult.append(jit.branchDouble(MacroAssembler::DoubleEqual , SpecializedThunkJIT::fpRegT0, SpecializedThunkJIT::fpRegT1));980 doubleResult.append(jit.branchDouble(MacroAssembler::DoubleEqualAndOrdered, SpecializedThunkJIT::fpRegT0, SpecializedThunkJIT::fpRegT1)); 981 981 982 982 jit.ceilDouble(SpecializedThunkJIT::fpRegT0, SpecializedThunkJIT::fpRegT1); … … 984 984 jit.loadDouble(MacroAssembler::TrustedImmPtr(&halfConstant), SpecializedThunkJIT::fpRegT2); 985 985 jit.addDouble(SpecializedThunkJIT::fpRegT1, SpecializedThunkJIT::fpRegT2); 986 MacroAssembler::Jump shouldRoundDown = jit.branchDouble(MacroAssembler::DoubleGreaterThan , SpecializedThunkJIT::fpRegT2, SpecializedThunkJIT::fpRegT0);986 MacroAssembler::Jump shouldRoundDown = jit.branchDouble(MacroAssembler::DoubleGreaterThanAndOrdered, SpecializedThunkJIT::fpRegT2, SpecializedThunkJIT::fpRegT0); 987 987 988 988 jit.moveDouble(SpecializedThunkJIT::fpRegT1, SpecializedThunkJIT::fpRegT0); -
trunk/Source/JavaScriptCore/wasm/WasmAirIRGenerator.cpp
r257609 r258063 3190 3190 { 3191 3191 result = g32(); 3192 append(CompareDouble, Arg::doubleCond(MacroAssembler::DoubleLessThanOrEqual ), arg0, arg1, result);3192 append(CompareDouble, Arg::doubleCond(MacroAssembler::DoubleLessThanOrEqualAndOrdered), arg0, arg1, result); 3193 3193 return { }; 3194 3194 } … … 3216 3216 { 3217 3217 result = g32(); 3218 append(CompareDouble, Arg::doubleCond(MacroAssembler::DoubleLessThan ), arg0, arg1, result);3218 append(CompareDouble, Arg::doubleCond(MacroAssembler::DoubleLessThanAndOrdered), arg0, arg1, result); 3219 3219 return { }; 3220 3220 } … … 3234 3234 3235 3235 auto branchOp = floatType == F32 ? BranchFloat : BranchDouble; 3236 append(m_currentBlock, branchOp, Arg::doubleCond(MacroAssembler::DoubleEqual ), arg0, arg1);3236 append(m_currentBlock, branchOp, Arg::doubleCond(MacroAssembler::DoubleEqualAndOrdered), arg0, arg1); 3237 3237 m_currentBlock->setSuccessors(isEqual, notEqual); 3238 3238 3239 append(notEqual, branchOp, Arg::doubleCond(MacroAssembler::DoubleLessThan ), arg0, arg1);3239 append(notEqual, branchOp, Arg::doubleCond(MacroAssembler::DoubleLessThanAndOrdered), arg0, arg1); 3240 3240 notEqual->setSuccessors(isLessThan, notLessThan); 3241 3241 3242 append(notLessThan, branchOp, Arg::doubleCond(MacroAssembler::DoubleGreaterThan ), arg0, arg1);3242 append(notLessThan, branchOp, Arg::doubleCond(MacroAssembler::DoubleGreaterThanAndOrdered), arg0, arg1); 3243 3243 notLessThan->setSuccessors(isGreaterThan, isNaN); 3244 3244 … … 3349 3349 { 3350 3350 result = g32(); 3351 append(CompareDouble, Arg::doubleCond(MacroAssembler::DoubleGreaterThan ), arg0, arg1, result);3351 append(CompareDouble, Arg::doubleCond(MacroAssembler::DoubleGreaterThanAndOrdered), arg0, arg1, result); 3352 3352 return { }; 3353 3353 } … … 3363 3363 { 3364 3364 result = g32(); 3365 append(CompareDouble, Arg::doubleCond(MacroAssembler::DoubleGreaterThanOrEqual ), arg0, arg1, result);3365 append(CompareDouble, Arg::doubleCond(MacroAssembler::DoubleGreaterThanOrEqualAndOrdered), arg0, arg1, result); 3366 3366 return { }; 3367 3367 } … … 3533 3533 { 3534 3534 result = g32(); 3535 append(CompareFloat, Arg::doubleCond(MacroAssembler::DoubleLessThan ), arg0, arg1, result);3535 append(CompareFloat, Arg::doubleCond(MacroAssembler::DoubleLessThanAndOrdered), arg0, arg1, result); 3536 3536 return { }; 3537 3537 } … … 3547 3547 { 3548 3548 result = g32(); 3549 append(CompareDouble, Arg::doubleCond(MacroAssembler::DoubleEqual ), arg0, arg1, result);3549 append(CompareDouble, Arg::doubleCond(MacroAssembler::DoubleEqualAndOrdered), arg0, arg1, result); 3550 3550 return { }; 3551 3551 } … … 3554 3554 { 3555 3555 result = g32(); 3556 append(CompareFloat, Arg::doubleCond(MacroAssembler::DoubleLessThanOrEqual ), arg0, arg1, result);3556 append(CompareFloat, Arg::doubleCond(MacroAssembler::DoubleLessThanOrEqualAndOrdered), arg0, arg1, result); 3557 3557 return { }; 3558 3558 } … … 3561 3561 { 3562 3562 result = g32(); 3563 append(CompareFloat, Arg::doubleCond(MacroAssembler::DoubleGreaterThanOrEqual ), arg0, arg1, result);3563 append(CompareFloat, Arg::doubleCond(MacroAssembler::DoubleGreaterThanOrEqualAndOrdered), arg0, arg1, result); 3564 3564 return { }; 3565 3565 } … … 3773 3773 { 3774 3774 result = g32(); 3775 append(CompareFloat, Arg::doubleCond(MacroAssembler::DoubleEqual ), arg0, arg1, result);3775 append(CompareFloat, Arg::doubleCond(MacroAssembler::DoubleEqualAndOrdered), arg0, arg1, result); 3776 3776 return { }; 3777 3777 } … … 3837 3837 { 3838 3838 result = g32(); 3839 append(CompareFloat, Arg::doubleCond(MacroAssembler::DoubleGreaterThan ), arg0, arg1, result);3839 append(CompareFloat, Arg::doubleCond(MacroAssembler::DoubleGreaterThanAndOrdered), arg0, arg1, result); 3840 3840 return { }; 3841 3841 }
Note:
See TracChangeset
for help on using the changeset viewer.