Changeset 181570 in webkit
- Timestamp:
- Mar 16, 2015, 11:44:46 AM (11 years ago)
- Location:
- trunk/Source
- Files:
-
- 8 edited
-
JavaScriptCore/ChangeLog (modified) (1 diff)
-
JavaScriptCore/assembler/ARMAssembler.h (modified) (2 diffs)
-
JavaScriptCore/assembler/ARMv7Assembler.h (modified) (3 diffs)
-
JavaScriptCore/assembler/AbstractMacroAssembler.h (modified) (2 diffs)
-
JavaScriptCore/dfg/DFGFixupPhase.cpp (modified) (1 diff)
-
JavaScriptCore/dfg/DFGSpeculativeJIT.cpp (modified) (3 diffs)
-
WTF/ChangeLog (modified) (1 diff)
-
WTF/wtf/Platform.h (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/JavaScriptCore/ChangeLog
r181563 r181570 1 2015-03-16 Csaba Osztrogonác <ossy@webkit.org> 2 3 [ARM] Enable generating idiv instructions if it is supported 4 https://bugs.webkit.org/show_bug.cgi?id=142725 5 6 Reviewed by Michael Saboff. 7 8 * assembler/ARMAssembler.h: Added sdiv and udiv implementation for ARM Traditional instruction set. 9 (JSC::ARMAssembler::sdiv): 10 (JSC::ARMAssembler::udiv): 11 * assembler/ARMv7Assembler.h: Use HAVE(ARM_IDIV_INSTRUCTIONS) instead of CPU(APPLE_ARMV7S). 12 * assembler/AbstractMacroAssembler.h: 13 (JSC::isARMv7IDIVSupported): 14 (JSC::optimizeForARMv7IDIVSupported): 15 (JSC::isARMv7s): Renamed to isARMv7IDIVSupported(). 16 (JSC::optimizeForARMv7s): Renamed to optimizeForARMv7IDIVSupported(). 17 * dfg/DFGFixupPhase.cpp: 18 (JSC::DFG::FixupPhase::fixupNode): 19 * dfg/DFGSpeculativeJIT.cpp: 20 (JSC::DFG::SpeculativeJIT::compileArithDiv): 21 (JSC::DFG::SpeculativeJIT::compileArithMod): 22 1 23 2015-03-15 Filip Pizlo <fpizlo@apple.com> 2 24 -
trunk/Source/JavaScriptCore/assembler/ARMAssembler.h
r176072 r181570 217 217 NOP = 0xe1a00000, 218 218 DMB_SY = 0xf57ff05f, 219 #if HAVE(ARM_IDIV_INSTRUCTIONS) 220 SDIV = 0x0710f010, 221 UDIV = 0x0730f010, 222 #endif 219 223 }; 220 224 … … 478 482 } 479 483 484 #if HAVE(ARM_IDIV_INSTRUCTIONS) 485 template<int datasize> 486 void sdiv(int rd, int rn, int rm, Condition cc = AL) 487 { 488 static_assert(datasize == 32, "sdiv datasize must be 32 for armv7s"); 489 ASSERT(rd != ARMRegisters::pc); 490 ASSERT(rn != ARMRegisters::pc); 491 ASSERT(rm != ARMRegisters::pc); 492 m_buffer.putInt(toARMWord(cc) | SDIV | RN(rd) | RM(rn) | RS(rm)); 493 } 494 495 void udiv(int rd, int rn, int rm, Condition cc = AL) 496 { 497 ASSERT(rd != ARMRegisters::pc); 498 ASSERT(rn != ARMRegisters::pc); 499 ASSERT(rm != ARMRegisters::pc); 500 m_buffer.putInt(toARMWord(cc) | UDIV | RN(rd) | RM(rn) | RS(rm)); 501 } 502 #endif 503 480 504 void vmov_f64(int dd, int dm, Condition cc = AL) 481 505 { -
trunk/Source/JavaScriptCore/assembler/ARMv7Assembler.h
r179187 r181570 709 709 OP_CLZ = 0xFAB0, 710 710 OP_SMULL_T1 = 0xFB80, 711 #if CPU(APPLE_ARMV7S)711 #if HAVE(ARM_IDIV_INSTRUCTIONS) 712 712 OP_SDIV_T1 = 0xFB90, 713 713 OP_UDIV_T1 = 0xFBB0, … … 1500 1500 } 1501 1501 1502 #if CPU(APPLE_ARMV7S)1502 #if HAVE(ARM_IDIV_INSTRUCTIONS) 1503 1503 template<int datasize> 1504 1504 ALWAYS_INLINE void sdiv(RegisterID rd, RegisterID rn, RegisterID rm) … … 1848 1848 } 1849 1849 1850 #if CPU(APPLE_ARMV7S)1850 #if HAVE(ARM_IDIV_INSTRUCTIONS) 1851 1851 ALWAYS_INLINE void udiv(RegisterID rd, RegisterID rn, RegisterID rm) 1852 1852 { -
trunk/Source/JavaScriptCore/assembler/AbstractMacroAssembler.h
r176233 r181570 40 40 namespace JSC { 41 41 42 inline bool isARMv7 s()42 inline bool isARMv7IDIVSupported() 43 43 { 44 #if CPU(APPLE_ARMV7S)44 #if HAVE(ARM_IDIV_INSTRUCTIONS) 45 45 return true; 46 46 #else … … 67 67 } 68 68 69 inline bool optimizeForARMv7 s()69 inline bool optimizeForARMv7IDIVSupported() 70 70 { 71 return isARMv7 s() && Options::enableArchitectureSpecificOptimizations();71 return isARMv7IDIVSupported() && Options::enableArchitectureSpecificOptimizations(); 72 72 } 73 73 -
trunk/Source/JavaScriptCore/dfg/DFGFixupPhase.cpp
r181466 r181570 274 274 if (Node::shouldSpeculateInt32OrBooleanForArithmetic(node->child1().node(), node->child2().node()) 275 275 && node->canSpeculateInt32(FixupPass)) { 276 if (optimizeForX86() || optimizeForARM64() || optimizeForARMv7 s()) {276 if (optimizeForX86() || optimizeForARM64() || optimizeForARMv7IDIVSupported()) { 277 277 fixIntOrBooleanEdge(node->child1()); 278 278 fixIntOrBooleanEdge(node->child2()); -
trunk/Source/JavaScriptCore/dfg/DFGSpeculativeJIT.cpp
r181035 r181570 3199 3199 done.link(&m_jit); 3200 3200 int32Result(eax.gpr(), node); 3201 #elif CPU(APPLE_ARMV7S) || CPU(ARM64)3201 #elif HAVE(ARM_IDIV_INSTRUCTIONS) || CPU(ARM64) 3202 3202 SpeculateInt32Operand op1(this, node->child1()); 3203 3203 SpeculateInt32Operand op2(this, node->child2()); … … 3452 3452 int32Result(edx.gpr(), node); 3453 3453 3454 #elif CPU(ARM64) || CPU(APPLE_ARMV7S)3454 #elif HAVE(ARM_IDIV_INSTRUCTIONS) || CPU(ARM64) 3455 3455 GPRTemporary temp(this); 3456 3456 GPRTemporary quotientThenRemainder(this); … … 3477 3477 // https://bugs.webkit.org/show_bug.cgi?id=126444 3478 3478 speculationCheck(Overflow, JSValueRegs(), 0, m_jit.branchMul32(JITCompiler::Overflow, quotientThenRemainderGPR, divisorGPR, multiplyAnswerGPR)); 3479 #if CPU(APPLE_ARMV7S)3479 #if HAVE(ARM_IDIV_INSTRUCTIONS) 3480 3480 m_jit.assembler().sub(quotientThenRemainderGPR, dividendGPR, multiplyAnswerGPR); 3481 3481 #else -
trunk/Source/WTF/ChangeLog
r181558 r181570 1 2015-03-16 Csaba Osztrogonác <ossy@webkit.org> 2 3 [ARM] Enable generating idiv instructions if it is supported 4 https://bugs.webkit.org/show_bug.cgi?id=142725 5 6 Reviewed by Michael Saboff. 7 8 * wtf/Platform.h: Set HAVE_ARM_IDIV_INSTRUCTIONS based on GCC macro too. 9 1 10 2015-03-16 Benjamin Poulain <benjamin@webkit.org> 2 11 -
trunk/Source/WTF/wtf/Platform.h
r181501 r181570 335 335 #endif 336 336 337 #if defined(__ARM_ARCH_EXT_IDIV__) || CPU(APPLE_ARMV7S) 338 #define HAVE_ARM_IDIV_INSTRUCTIONS 1 339 #endif 340 337 341 #endif /* ARM */ 338 342
Note:
See TracChangeset
for help on using the changeset viewer.