2010-10-27 Gabor Loki <loki@webkit.org>
authorloki@webkit.org <loki@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 27 Oct 2010 13:48:11 +0000 (13:48 +0000)
committerloki@webkit.org <loki@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 27 Oct 2010 13:48:11 +0000 (13:48 +0000)
        Reviewed by Csaba Osztrogon√°c.

        Add cmn to branch32(reg, imm) on ARM
        https://bugs.webkit.org/show_bug.cgi?id=48062

        The conditional comparison can be done with cmn if the imm value is
        negative and can fit into the cmn instruction.

        * assembler/MacroAssemblerARM.h:
        (JSC::MacroAssemblerARM::branch32):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@70642 268f45cc-cd09-0410-ab3c-d52691b4dbfc

JavaScriptCore/ChangeLog
JavaScriptCore/assembler/MacroAssemblerARM.h

index 595c0d3..6fa5aec 100644 (file)
@@ -1,3 +1,16 @@
+2010-10-27  Gabor Loki  <loki@webkit.org>
+
+        Reviewed by Csaba Osztrogon√°c.
+
+        Add cmn to branch32(reg, imm) on ARM
+        https://bugs.webkit.org/show_bug.cgi?id=48062
+
+        The conditional comparison can be done with cmn if the imm value is
+        negative and can fit into the cmn instruction.
+
+        * assembler/MacroAssemblerARM.h:
+        (JSC::MacroAssemblerARM::branch32):
+
 2010-10-26  Oliver Hunt  <oliver@apple.com>
 
         Interpreter build fix.
index 5de8b34..49c87c0 100644 (file)
@@ -400,8 +400,13 @@ public:
         if (right.m_isPointer) {
             m_assembler.ldr_un_imm(ARMRegisters::S0, right.m_value);
             m_assembler.cmp_r(left, ARMRegisters::S0);
-        } else
-            m_assembler.cmp_r(left, m_assembler.getImm(right.m_value, ARMRegisters::S0));
+        } else {
+            ARMWord tmp = m_assembler.getOp2(-right.m_value);
+            if (tmp != ARMAssembler::INVALID_IMM)
+                m_assembler.cmn_r(left, tmp);
+            else
+                m_assembler.cmp_r(left, m_assembler.getImm(right.m_value, ARMRegisters::S0));
+        }
         return Jump(m_assembler.jmp(ARMCondition(cond), useConstantPool));
     }