[ARMv6][DFG] ARM MacroAssembler is always emitting cmn when immediate is 0
[WebKit-https.git] / Source / JavaScriptCore / assembler / MacroAssemblerARM.h
index 991913b..bc15e49 100644 (file)
@@ -1600,7 +1600,7 @@ private:
 
     void internalCompare32(RegisterID left, TrustedImm32 right)
     {
-        ARMWord tmp = (static_cast<unsigned>(right.m_value) == 0x80000000) ? ARMAssembler::InvalidImmediate : m_assembler.getOp2(-right.m_value);
+        ARMWord tmp = (!right.value || static_cast<unsigned>(right.m_value) == 0x80000000) ? ARMAssembler::InvalidImmediate : m_assembler.getOp2(-right.m_value);
         if (tmp != ARMAssembler::InvalidImmediate)
             m_assembler.cmn(left, tmp);
         else
@@ -1609,7 +1609,7 @@ private:
 
     void internalCompare32(Address left, TrustedImm32 right)
     {
-        ARMWord tmp = (static_cast<unsigned>(right.m_value) == 0x80000000) ? ARMAssembler::InvalidImmediate : m_assembler.getOp2(-right.m_value);
+        ARMWord tmp = (!right.value || static_cast<unsigned>(right.m_value) == 0x80000000) ? ARMAssembler::InvalidImmediate : m_assembler.getOp2(-right.m_value);
         load32(left, ARMRegisters::S1);
         if (tmp != ARMAssembler::InvalidImmediate)
             m_assembler.cmn(ARMRegisters::S1, tmp);