⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 181635 in webkit


Ignore:
Timestamp:
Mar 17, 2015, 4:44:32 AM (11 years ago)
Author:
Carlos Garcia Campos
Message:

Merge r181570 - [ARM] Enable generating idiv instructions if it is supported
https://bugs.webkit.org/show_bug.cgi?id=142725

Reviewed by Michael Saboff.

Source/JavaScriptCore:

  • assembler/ARMAssembler.h: Added sdiv and udiv implementation for ARM Traditional instruction set.

(JSC::ARMAssembler::sdiv):
(JSC::ARMAssembler::udiv):

  • assembler/ARMv7Assembler.h: Use HAVE(ARM_IDIV_INSTRUCTIONS) instead of CPU(APPLE_ARMV7S).
  • assembler/AbstractMacroAssembler.h:

(JSC::isARMv7IDIVSupported):
(JSC::optimizeForARMv7IDIVSupported):
(JSC::isARMv7s): Renamed to isARMv7IDIVSupported().
(JSC::optimizeForARMv7s): Renamed to optimizeForARMv7IDIVSupported().

  • dfg/DFGFixupPhase.cpp:

(JSC::DFG::FixupPhase::fixupNode):

  • dfg/DFGSpeculativeJIT.cpp:

(JSC::DFG::SpeculativeJIT::compileArithDiv):
(JSC::DFG::SpeculativeJIT::compileArithMod):

Source/WTF:

  • wtf/Platform.h: Set HAVE_ARM_IDIV_INSTRUCTIONS based on GCC macro too.
Location:
releases/WebKitGTK/webkit-2.8/Source
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • releases/WebKitGTK/webkit-2.8/Source/JavaScriptCore/ChangeLog

    r181550 r181635  
     12015-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
    1232015-03-13  Filip Pizlo  <fpizlo@apple.com>
    224
  • releases/WebKitGTK/webkit-2.8/Source/JavaScriptCore/assembler/ARMAssembler.h

    r176072 r181635  
    217217            NOP = 0xe1a00000,
    218218            DMB_SY = 0xf57ff05f,
     219#if HAVE(ARM_IDIV_INSTRUCTIONS)
     220            SDIV = 0x0710f010,
     221            UDIV = 0x0730f010,
     222#endif
    219223        };
    220224
     
    478482        }
    479483
     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
    480504        void vmov_f64(int dd, int dm, Condition cc = AL)
    481505        {
  • releases/WebKitGTK/webkit-2.8/Source/JavaScriptCore/assembler/ARMv7Assembler.h

    r179187 r181635  
    709709        OP_CLZ          = 0xFAB0,
    710710        OP_SMULL_T1     = 0xFB80,
    711 #if CPU(APPLE_ARMV7S)
     711#if HAVE(ARM_IDIV_INSTRUCTIONS)
    712712        OP_SDIV_T1      = 0xFB90,
    713713        OP_UDIV_T1      = 0xFBB0,
     
    15001500    }
    15011501
    1502 #if CPU(APPLE_ARMV7S)
     1502#if HAVE(ARM_IDIV_INSTRUCTIONS)
    15031503    template<int datasize>
    15041504    ALWAYS_INLINE void sdiv(RegisterID rd, RegisterID rn, RegisterID rm)
     
    18481848    }
    18491849
    1850 #if CPU(APPLE_ARMV7S)
     1850#if HAVE(ARM_IDIV_INSTRUCTIONS)
    18511851    ALWAYS_INLINE void udiv(RegisterID rd, RegisterID rn, RegisterID rm)
    18521852    {
  • releases/WebKitGTK/webkit-2.8/Source/JavaScriptCore/assembler/AbstractMacroAssembler.h

    r176233 r181635  
    4040namespace JSC {
    4141
    42 inline bool isARMv7s()
     42inline bool isARMv7IDIVSupported()
    4343{
    44 #if CPU(APPLE_ARMV7S)
     44#if HAVE(ARM_IDIV_INSTRUCTIONS)
    4545    return true;
    4646#else
     
    6767}
    6868
    69 inline bool optimizeForARMv7s()
     69inline bool optimizeForARMv7IDIVSupported()
    7070{
    71     return isARMv7s() && Options::enableArchitectureSpecificOptimizations();
     71    return isARMv7IDIVSupported() && Options::enableArchitectureSpecificOptimizations();
    7272}
    7373
  • releases/WebKitGTK/webkit-2.8/Source/JavaScriptCore/dfg/DFGFixupPhase.cpp

    r180160 r181635  
    272272            if (Node::shouldSpeculateInt32OrBooleanForArithmetic(node->child1().node(), node->child2().node())
    273273                && node->canSpeculateInt32(FixupPass)) {
    274                 if (optimizeForX86() || optimizeForARM64() || optimizeForARMv7s()) {
     274                if (optimizeForX86() || optimizeForARM64() || optimizeForARMv7IDIVSupported()) {
    275275                    fixIntOrBooleanEdge(node->child1());
    276276                    fixIntOrBooleanEdge(node->child2());
  • releases/WebKitGTK/webkit-2.8/Source/JavaScriptCore/dfg/DFGSpeculativeJIT.cpp

    r180098 r181635  
    32193219        done.link(&m_jit);
    32203220        int32Result(eax.gpr(), node);
    3221 #elif CPU(APPLE_ARMV7S) || CPU(ARM64)
     3221#elif HAVE(ARM_IDIV_INSTRUCTIONS) || CPU(ARM64)
    32223222        SpeculateInt32Operand op1(this, node->child1());
    32233223        SpeculateInt32Operand op2(this, node->child2());
     
    34723472        int32Result(edx.gpr(), node);
    34733473
    3474 #elif CPU(ARM64) || CPU(APPLE_ARMV7S)
     3474#elif HAVE(ARM_IDIV_INSTRUCTIONS) || CPU(ARM64)
    34753475        GPRTemporary temp(this);
    34763476        GPRTemporary quotientThenRemainder(this);
     
    34973497        // https://bugs.webkit.org/show_bug.cgi?id=126444
    34983498        speculationCheck(Overflow, JSValueRegs(), 0, m_jit.branchMul32(JITCompiler::Overflow, quotientThenRemainderGPR, divisorGPR, multiplyAnswerGPR));
    3499 #if CPU(APPLE_ARMV7S)
     3499#if HAVE(ARM_IDIV_INSTRUCTIONS)
    35003500        m_jit.assembler().sub(quotientThenRemainderGPR, dividendGPR, multiplyAnswerGPR);
    35013501#else
  • releases/WebKitGTK/webkit-2.8/Source/WTF/ChangeLog

    r181632 r181635  
     12015-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
    1102015-03-16  Max Stepin  <maxstepin@gmail.com>
    211
  • releases/WebKitGTK/webkit-2.8/Source/WTF/wtf/Platform.h

    r181544 r181635  
    335335#endif
    336336
     337#if defined(__ARM_ARCH_EXT_IDIV__) || CPU(APPLE_ARMV7S)
     338#define HAVE_ARM_IDIV_INSTRUCTIONS 1
     339#endif
     340
    337341#endif /* ARM */
    338342
Note: See TracChangeset for help on using the changeset viewer.