Bug 1229057 - Part 2: Move MacroAssembler::add32 into generic macro assembler. r=nbp
authorTooru Fujisawa <arai_a@mac.com>
Tue, 01 Dec 2015 17:02:17 +0900
changeset 316143 b75139cf07398def69987534dae7d26af89770c2
parent 316142 27f2890d8b27268e1126dba1536e995bd85baad9
child 316144 275f7590bbe659457b349104a1b984de762dea09
push id8516
push userjlund@mozilla.com
push dateFri, 18 Dec 2015 00:52:34 +0000
reviewersnbp
bugs1229057
milestone46.0a1
Bug 1229057 - Part 2: Move MacroAssembler::add32 into generic macro assembler. r=nbp
js/src/jit/MacroAssembler-inl.h
js/src/jit/MacroAssembler.h
js/src/jit/arm/MacroAssembler-arm-inl.h
js/src/jit/arm/MacroAssembler-arm.cpp
js/src/jit/arm/MacroAssembler-arm.h
js/src/jit/arm64/MacroAssembler-arm64-inl.h
js/src/jit/arm64/MacroAssembler-arm64.h
js/src/jit/mips-shared/MacroAssembler-mips-shared-inl.h
js/src/jit/mips32/MacroAssembler-mips32-inl.h
js/src/jit/mips32/MacroAssembler-mips32.cpp
js/src/jit/mips32/MacroAssembler-mips32.h
js/src/jit/mips64/MacroAssembler-mips64-inl.h
js/src/jit/mips64/MacroAssembler-mips64.cpp
js/src/jit/mips64/MacroAssembler-mips64.h
js/src/jit/none/MacroAssembler-none.h
js/src/jit/x86-shared/MacroAssembler-x86-shared-inl.h
js/src/jit/x86-shared/MacroAssembler-x86-shared.h
--- a/js/src/jit/MacroAssembler-inl.h
+++ b/js/src/jit/MacroAssembler-inl.h
@@ -352,12 +352,21 @@ MacroAssembler::addToStackPtr(T t)
 template <typename T> void
 MacroAssembler::addStackPtrTo(T t)
 {
     addPtr(getStackPointer(), t);
 }
 
 #endif // !JS_CODEGEN_ARM64
 
+void
+MacroAssembler::bumpKey(Int32Key* key, int diff)
+{
+    if (key->isRegister())
+        add32(Imm32(diff), key->reg());
+    else
+        key->bumpConstant(diff);
+}
+
 } // namespace jit
 } // namespace js
 
 #endif /* jit_MacroAssembler_inl_h */
--- a/js/src/jit/MacroAssembler.h
+++ b/js/src/jit/MacroAssembler.h
@@ -726,16 +726,21 @@ class MacroAssembler : public MacroAssem
     inline void xor32(Imm32 imm, Register dest) PER_SHARED_ARCH;
 
     inline void xorPtr(Register src, Register dest) PER_ARCH;
     inline void xorPtr(Imm32 imm, Register dest) PER_ARCH;
 
     // ===============================================================
     // Arithmetic functions
 
+    inline void add32(Register src, Register dest) PER_SHARED_ARCH;
+    inline void add32(Imm32 imm, Register dest) PER_SHARED_ARCH;
+    inline void add32(Imm32 imm, const Address& dest) PER_SHARED_ARCH;
+    inline void add32(Imm32 imm, const AbsoluteAddress& dest) DEFINED_ON(x86_shared);
+
     inline void addPtr(Register src, Register dest) PER_ARCH;
     inline void addPtr(Register src1, Register src2, Register dest) DEFINED_ON(arm64);
     inline void addPtr(Imm32 imm, Register dest) PER_ARCH;
     inline void addPtr(Imm32 imm, Register src, Register dest) DEFINED_ON(arm64);
     inline void addPtr(ImmWord imm, Register dest) PER_ARCH;
     inline void addPtr(ImmPtr imm, Register dest);
     inline void addPtr(Imm32 imm, const Address& dest) DEFINED_ON(mips_shared, arm, arm64, x86, x64);
     inline void addPtr(Imm32 imm, const AbsoluteAddress& dest) DEFINED_ON(x86, x64);
@@ -1007,22 +1012,17 @@ class MacroAssembler : public MacroAssem
         MOZ_ASSERT(JSFunction::offsetOfFlags() == JSFunction::offsetOfNargs() + 2);
         Address address(fun, JSFunction::offsetOfNargs());
         int32_t bit = IMM32_16ADJ(JSFunction::INTERPRETED);
         branchTest32(Assembler::NonZero, address, Imm32(bit), label);
     }
 
     void branchIfNotInterpretedConstructor(Register fun, Register scratch, Label* label);
 
-    void bumpKey(Int32Key* key, int diff) {
-        if (key->isRegister())
-            add32(Imm32(diff), key->reg());
-        else
-            key->bumpConstant(diff);
-    }
+    inline void bumpKey(Int32Key* key, int diff);
 
     void storeKey(const Int32Key& key, const Address& dest) {
         if (key.isRegister())
             store32(key.reg(), dest);
         else
             store32(Imm32(key.constant()), dest);
     }
 
--- a/js/src/jit/arm/MacroAssembler-arm-inl.h
+++ b/js/src/jit/arm/MacroAssembler-arm-inl.h
@@ -134,16 +134,37 @@ MacroAssembler::xorPtr(Imm32 imm, Regist
 {
     ma_eor(imm, dest);
 }
 
 // ===============================================================
 // Arithmetic functions
 
 void
+MacroAssembler::add32(Register src, Register dest)
+{
+    ma_add(src, dest, SetCC);
+}
+
+void
+MacroAssembler::add32(Imm32 imm, Register dest)
+{
+    ma_add(imm, dest, SetCC);
+}
+
+void
+MacroAssembler::add32(Imm32 imm, const Address& dest)
+{
+    ScratchRegisterScope scratch(*this);
+    load32(dest, scratch);
+    ma_add(imm, scratch, SetCC);
+    store32(scratch, dest);
+}
+
+void
 MacroAssembler::addPtr(Register src, Register dest)
 {
     ma_add(src, dest);
 }
 
 void
 MacroAssembler::addPtr(Imm32 imm, Register dest)
 {
@@ -235,12 +256,26 @@ MacroAssembler::rshift64(Imm32 imm, Regi
     as_mov(dest.low, lsr(dest.low, imm.value));
     as_orr(dest.low, dest.low, lsl(dest.high, 32 - imm.value));
     as_mov(dest.high, lsr(dest.high, imm.value));
 }
 
 //}}} check_macroassembler_style
 // ===============================================================
 
+template <typename T>
+void
+MacroAssemblerARMCompat::branchAdd32(Condition cond, T src, Register dest, Label* label)
+{
+    asMasm().add32(src, dest);
+    j(cond, label);
+}
+
+void
+MacroAssemblerARMCompat::incrementInt32Value(const Address& addr)
+{
+    asMasm().add32(Imm32(1), ToPayload(addr));
+}
+
 } // namespace jit
 } // namespace js
 
 #endif /* jit_arm_MacroAssembler_arm_inl_h */
--- a/js/src/jit/arm/MacroAssembler-arm.cpp
+++ b/js/src/jit/arm/MacroAssembler-arm.cpp
@@ -1943,37 +1943,16 @@ MacroAssembler::alignFrameForICArguments
 
 void
 MacroAssembler::restoreFrameAlignmentForICArguments(AfterICSaveLive& aic)
 {
     // Exists for MIPS compatibility.
 }
 
 void
-MacroAssemblerARMCompat::add32(Register src, Register dest)
-{
-    ma_add(src, dest, SetCC);
-}
-
-void
-MacroAssemblerARMCompat::add32(Imm32 imm, Register dest)
-{
-    ma_add(imm, dest, SetCC);
-}
-
-void
-MacroAssemblerARMCompat::add32(Imm32 imm, const Address& dest)
-{
-    ScratchRegisterScope scratch(asMasm());
-    load32(dest, scratch);
-    ma_add(imm, scratch, SetCC);
-    store32(scratch, dest);
-}
-
-void
 MacroAssemblerARMCompat::move32(Imm32 imm, Register dest)
 {
     ma_mov(imm, dest);
 }
 
 void
 MacroAssemblerARMCompat::move32(Register src, Register dest)
 {
--- a/js/src/jit/arm/MacroAssembler-arm.h
+++ b/js/src/jit/arm/MacroAssembler-arm.h
@@ -1180,24 +1180,17 @@ class MacroAssemblerARMCompat : public M
     void storeTypeTag(ImmTag tag, const BaseIndex& dest);
 
     void handleFailureWithHandlerTail(void* handler);
 
     /////////////////////////////////////////////////////////////////
     // Common interface.
     /////////////////////////////////////////////////////////////////
   public:
-    void add32(Register src, Register dest);
-    void add32(Imm32 imm, Register dest);
-    void add32(Imm32 imm, const Address& dest);
-    template <typename T>
-    void branchAdd32(Condition cond, T src, Register dest, Label* label) {
-        add32(src, dest);
-        j(cond, label);
-    }
+    template <typename T> inline void branchAdd32(Condition cond, T src, Register dest, Label* label);
     template <typename T>
     void branchSub32(Condition cond, T src, Register dest, Label* label) {
         ma_sub(src, dest, SetCC);
         j(cond, label);
     }
 
     void add64(Imm32 imm, Register64 dest) {
         ma_add(imm, dest.low, SetCC);
@@ -1624,19 +1617,17 @@ class MacroAssemblerARMCompat : public M
         // Look at (reg >> 8) if it is 0, then reg shouldn't be clamped if it is
         // <0, then we want to clamp to 0, otherwise, we wish to clamp to 255
         ScratchRegisterScope scratch(asMasm());
         as_mov(scratch, asr(reg, 8), SetCC);
         ma_mov(Imm32(0xff), reg, LeaveCC, NotEqual);
         ma_mov(Imm32(0), reg, LeaveCC, Signed);
     }
 
-    void incrementInt32Value(const Address& addr) {
-        add32(Imm32(1), ToPayload(addr));
-    }
+    inline void incrementInt32Value(const Address& addr);
 
     void cmp32(Register lhs, Imm32 rhs);
     void cmp32(Register lhs, Register rhs);
     void cmp32(const Operand& lhs, Imm32 rhs);
     void cmp32(const Operand& lhs, Register rhs);
 
     void cmpPtr(Register lhs, Register rhs);
     void cmpPtr(Register lhs, ImmWord rhs);
--- a/js/src/jit/arm64/MacroAssembler-arm64-inl.h
+++ b/js/src/jit/arm64/MacroAssembler-arm64-inl.h
@@ -146,16 +146,40 @@ MacroAssembler::xorPtr(Imm32 imm, Regist
 {
     Eor(ARMRegister(dest, 64), ARMRegister(dest, 64), Operand(imm.value));
 }
 
 // ===============================================================
 // Arithmetic functions
 
 void
+MacroAssembler::add32(Register src, Register dest)
+{
+    Add(ARMRegister(dest, 32), ARMRegister(dest, 32), Operand(ARMRegister(src, 32)));
+}
+
+void
+MacroAssembler::add32(Imm32 imm, Register dest)
+{
+    Add(ARMRegister(dest, 32), ARMRegister(dest, 32), Operand(imm.value));
+}
+
+void
+MacroAssembler::add32(Imm32 imm, const Address& dest)
+{
+    vixl::UseScratchRegisterScope temps(this);
+    const ARMRegister scratch32 = temps.AcquireW();
+    MOZ_ASSERT(scratch32.asUnsized() != dest.base);
+
+    Ldr(scratch32, MemOperand(ARMRegister(dest.base, 64), dest.offset));
+    Add(scratch32, scratch32, Operand(imm.value));
+    Str(scratch32, MemOperand(ARMRegister(dest.base, 64), dest.offset));
+}
+
+void
 MacroAssembler::addPtr(Register src, Register dest)
 {
     addPtr(src, dest, dest);
 }
 
 void
 MacroAssembler::addPtr(Register src1, Register src2, Register dest)
 {
--- a/js/src/jit/arm64/MacroAssembler-arm64.h
+++ b/js/src/jit/arm64/MacroAssembler-arm64.h
@@ -1321,32 +1321,16 @@ class MacroAssemblerCompat : public vixl
 
     void load16ZeroExtend(const Address& address, Register dest) {
         Ldrh(ARMRegister(dest, 32), MemOperand(ARMRegister(address.base, 64), address.offset));
     }
     void load16ZeroExtend(const BaseIndex& src, Register dest) {
         doBaseIndex(ARMRegister(dest, 32), src, vixl::LDRH_w);
     }
 
-    void add32(Register src, Register dest) {
-        Add(ARMRegister(dest, 32), ARMRegister(dest, 32), Operand(ARMRegister(src, 32)));
-    }
-    void add32(Imm32 imm, Register dest) {
-        Add(ARMRegister(dest, 32), ARMRegister(dest, 32), Operand(imm.value));
-    }
-    void add32(Imm32 imm, const Address& dest) {
-        vixl::UseScratchRegisterScope temps(this);
-        const ARMRegister scratch32 = temps.AcquireW();
-        MOZ_ASSERT(scratch32.asUnsized() != dest.base);
-
-        Ldr(scratch32, MemOperand(ARMRegister(dest.base, 64), dest.offset));
-        Add(scratch32, scratch32, Operand(imm.value));
-        Str(scratch32, MemOperand(ARMRegister(dest.base, 64), dest.offset));
-    }
-
     void adds32(Register src, Register dest) {
         Adds(ARMRegister(dest, 32), ARMRegister(dest, 32), Operand(ARMRegister(src, 32)));
     }
     void adds32(Imm32 imm, Register dest) {
         Adds(ARMRegister(dest, 32), ARMRegister(dest, 32), Operand(imm.value));
     }
     void adds32(Imm32 imm, const Address& dest) {
         vixl::UseScratchRegisterScope temps(this);
--- a/js/src/jit/mips-shared/MacroAssembler-mips-shared-inl.h
+++ b/js/src/jit/mips-shared/MacroAssembler-mips-shared-inl.h
@@ -74,16 +74,36 @@ MacroAssembler::xor32(Imm32 imm, Registe
 {
     ma_xor(dest, imm);
 }
 
 // ===============================================================
 // Arithmetic instructions
 
 void
+MacroAssembler::add32(Register src, Register dest)
+{
+    as_addu(dest, dest, src);
+}
+
+void
+MacroAssembler::add32(Imm32 imm, Register dest)
+{
+    ma_addu(dest, dest, imm);
+}
+
+void
+MacroAssembler::add32(Imm32 imm, const Address& dest)
+{
+    load32(dest, SecondScratchReg);
+    ma_addu(SecondScratchReg, imm);
+    store32(SecondScratchReg, dest);
+}
+
+void
 MacroAssembler::addPtr(Imm32 imm, const Address& dest)
 {
     loadPtr(dest, ScratchRegister);
     addPtr(imm, ScratchRegister);
     storePtr(ScratchRegister, dest);
 }
 
 void
--- a/js/src/jit/mips32/MacroAssembler-mips32-inl.h
+++ b/js/src/jit/mips32/MacroAssembler-mips32-inl.h
@@ -145,16 +145,22 @@ MacroAssembler::rshift64(Imm32 imm, Regi
     as_or(dest.low, dest.low, scratch);
     as_srl(dest.high, dest.high, imm.value);
 }
 
 //}}} check_macroassembler_style
 // ===============================================================
 
 void
+MacroAssemblerMIPSCompat::incrementInt32Value(const Address& addr)
+{
+    asMasm().add32(Imm32(1), ToPayload(addr));
+}
+
+void
 MacroAssemblerMIPSCompat::computeEffectiveAddress(const BaseIndex& address, Register dest)
 {
     computeScaledAddress(address, dest);
     if (address.offset)
         asMasm().addPtr(Imm32(address.offset), dest);
 }
 
 void
--- a/js/src/jit/mips32/MacroAssembler-mips32.cpp
+++ b/js/src/jit/mips32/MacroAssembler-mips32.cpp
@@ -808,37 +808,16 @@ MacroAssemblerMIPSCompat::buildOOLFakeEx
 
     asMasm().Push(Imm32(descriptor)); // descriptor_
     asMasm().Push(ImmPtr(fakeReturnAddr));
 
     return true;
 }
 
 void
-MacroAssemblerMIPSCompat::add32(Register src, Register dest)
-{
-    as_addu(dest, dest, src);
-}
-
-void
-MacroAssemblerMIPSCompat::add32(Imm32 imm, Register dest)
-{
-    ma_addu(dest, dest, imm);
-}
-
-void
-
-MacroAssemblerMIPSCompat::add32(Imm32 imm, const Address& dest)
-{
-    load32(dest, SecondScratchReg);
-    ma_addu(SecondScratchReg, imm);
-    store32(SecondScratchReg, dest);
-}
-
-void
 MacroAssemblerMIPSCompat::subPtr(Register src, Register dest)
 {
     as_subu(dest, dest, src);
 }
 
 void
 MacroAssemblerMIPSCompat::move32(Imm32 imm, Register dest)
 {
--- a/js/src/jit/mips32/MacroAssembler-mips32.h
+++ b/js/src/jit/mips32/MacroAssembler-mips32.h
@@ -1056,28 +1056,23 @@ class MacroAssemblerMIPSCompat : public 
                                         Register temp, Register valueTemp, Register offsetTemp, Register maskTemp,
                                         AnyRegister output);
 
     template<typename T>
     void atomicExchangeToTypedIntArray(Scalar::Type arrayType, const T& mem, Register value,
                                        Register temp, Register valueTemp, Register offsetTemp, Register maskTemp,
                                        AnyRegister output);
 
-    void add32(Register src, Register dest);
-    void add32(Imm32 imm, Register dest);
-    void add32(Imm32 imm, const Address& dest);
     void add64(Imm32 imm, Register64 dest) {
         as_addiu(dest.low, dest.low, imm.value);
         as_sltiu(ScratchRegister, dest.low, imm.value);
         as_addu(dest.high, dest.high, ScratchRegister);
     }
 
-    void incrementInt32Value(const Address& addr) {
-        add32(Imm32(1), ToPayload(addr));
-    }
+    inline void incrementInt32Value(const Address& addr);
 
     template <typename T>
     void branchAdd32(Condition cond, T src, Register dest, Label* overflow) {
         switch (cond) {
           case Overflow:
             ma_addTestOverflow(dest, dest, src, overflow);
             break;
           default:
--- a/js/src/jit/mips64/MacroAssembler-mips64-inl.h
+++ b/js/src/jit/mips64/MacroAssembler-mips64-inl.h
@@ -133,16 +133,22 @@ MacroAssembler::rshift64(Imm32 imm, Regi
 {
     ma_dsrl(dest.reg, dest.reg, imm);
 }
 
 //}}} check_macroassembler_style
 // ===============================================================
 
 void
+MacroAssemblerMIPS64Compat::incrementInt32Value(const Address& addr)
+{
+    asMasm().add32(Imm32(1), addr);
+}
+
+void
 MacroAssemblerMIPS64Compat::computeEffectiveAddress(const BaseIndex& address, Register dest)
 {
     computeScaledAddress(address, dest);
     if (address.offset)
         asMasm().addPtr(Imm32(address.offset), dest);
 }
 
 void
--- a/js/src/jit/mips64/MacroAssembler-mips64.cpp
+++ b/js/src/jit/mips64/MacroAssembler-mips64.cpp
@@ -893,37 +893,16 @@ MacroAssemblerMIPS64Compat::buildOOLFake
 
     asMasm().Push(Imm32(descriptor)); // descriptor_
     asMasm().Push(ImmPtr(fakeReturnAddr));
 
     return true;
 }
 
 void
-MacroAssemblerMIPS64Compat::add32(Register src, Register dest)
-{
-    as_addu(dest, dest, src);
-}
-
-void
-MacroAssemblerMIPS64Compat::add32(Imm32 imm, Register dest)
-{
-    ma_addu(dest, dest, imm);
-}
-
-void
-
-MacroAssemblerMIPS64Compat::add32(Imm32 imm, const Address& dest)
-{
-    load32(dest, SecondScratchReg);
-    ma_addu(SecondScratchReg, imm);
-    store32(SecondScratchReg, dest);
-}
-
-void
 MacroAssemblerMIPS64Compat::subPtr(Register src, Register dest)
 {
     as_dsubu(dest, dest, src);
 }
 
 void
 MacroAssemblerMIPS64Compat::move32(Imm32 imm, Register dest)
 {
--- a/js/src/jit/mips64/MacroAssembler-mips64.h
+++ b/js/src/jit/mips64/MacroAssembler-mips64.h
@@ -1073,26 +1073,21 @@ class MacroAssemblerMIPS64Compat : publi
                                         Register temp, Register valueTemp, Register offsetTemp, Register maskTemp,
                                         AnyRegister output);
 
     template<typename T>
     void atomicExchangeToTypedIntArray(Scalar::Type arrayType, const T& mem, Register value,
                                        Register temp, Register valueTemp, Register offsetTemp, Register maskTemp,
                                        AnyRegister output);
 
-    void add32(Register src, Register dest);
-    void add32(Imm32 imm, Register dest);
-    void add32(Imm32 imm, const Address& dest);
     void add64(Imm32 imm, Register64 dest) {
         ma_daddu(dest.reg, imm);
     }
 
-    void incrementInt32Value(const Address& addr) {
-        add32(Imm32(1), addr);
-    }
+    inline void incrementInt32Value(const Address& addr);
 
     template <typename T>
     void branchAdd32(Condition cond, T src, Register dest, Label* overflow) {
         switch (cond) {
           case Overflow:
             ma_addTestOverflow(dest, dest, src, overflow);
             break;
           default:
--- a/js/src/jit/none/MacroAssembler-none.h
+++ b/js/src/jit/none/MacroAssembler-none.h
@@ -229,17 +229,16 @@ class MacroAssemblerNone : public Assemb
     template <typename T, typename S> void branchTestValue(Condition, T, S, Label*) { MOZ_CRASH(); }
     void testNullSet(Condition, ValueOperand, Register) { MOZ_CRASH(); }
     void testObjectSet(Condition, ValueOperand, Register) { MOZ_CRASH(); }
     void testUndefinedSet(Condition, ValueOperand, Register) { MOZ_CRASH(); }
 
     template <typename T, typename S> void cmpPtrSet(Condition, T, S, Register) { MOZ_CRASH(); }
     template <typename T, typename S> void cmp32Set(Condition, T, S, Register) { MOZ_CRASH(); }
 
-    template <typename T, typename S> void add32(T, S) { MOZ_CRASH(); }
     template <typename T, typename S> void add64(T, S) { MOZ_CRASH(); }
     template <typename T, typename S> void subPtr(T, S) { MOZ_CRASH(); }
     void neg32(Register) { MOZ_CRASH(); }
     void mulBy3(Register, Register) { MOZ_CRASH(); }
     void mul64(Imm64, const Register64&) { MOZ_CRASH(); }
 
     void negateDouble(FloatRegister) { MOZ_CRASH(); }
     void addDouble(FloatRegister, FloatRegister) { MOZ_CRASH(); }
--- a/js/src/jit/x86-shared/MacroAssembler-x86-shared-inl.h
+++ b/js/src/jit/x86-shared/MacroAssembler-x86-shared-inl.h
@@ -75,16 +75,40 @@ MacroAssembler::xor32(Imm32 imm, Registe
 {
     xorl(imm, dest);
 }
 
 // ===============================================================
 // Arithmetic instructions
 
 void
+MacroAssembler::add32(Register src, Register dest)
+{
+    addl(src, dest);
+}
+
+void
+MacroAssembler::add32(Imm32 imm, Register dest)
+{
+    addl(imm, dest);
+}
+
+void
+MacroAssembler::add32(Imm32 imm, const Address& dest)
+{
+    addl(imm, Operand(dest));
+}
+
+void
+MacroAssembler::add32(Imm32 imm, const AbsoluteAddress& dest)
+{
+    addl(imm, Operand(dest));
+}
+
+void
 MacroAssembler::sub32(Register src, Register dest)
 {
     subl(src, dest);
 }
 
 void
 MacroAssembler::sub32(Imm32 imm, Register dest)
 {
--- a/js/src/jit/x86-shared/MacroAssembler-x86-shared.h
+++ b/js/src/jit/x86-shared/MacroAssembler-x86-shared.h
@@ -203,31 +203,19 @@ class MacroAssemblerX86Shared : public A
         cmpl(rhs, lhs);
     }
     void cmp32(Register lhs, const Operand& rhs) {
         cmpl(rhs, lhs);
     }
     CodeOffset cmp32WithPatch(Register lhs, Imm32 rhs) {
         return cmplWithPatch(rhs, lhs);
     }
-    void add32(Register src, Register dest) {
-        addl(src, dest);
-    }
-    void add32(Imm32 imm, Register dest) {
-        addl(imm, dest);
-    }
-    void add32(Imm32 imm, const Operand& dest) {
-        addl(imm, dest);
-    }
-    void add32(Imm32 imm, const Address& dest) {
-        addl(imm, Operand(dest));
-    }
     template <typename T>
     void branchAdd32(Condition cond, T src, Register dest, Label* label) {
-        add32(src, dest);
+        addl(src, dest);
         j(cond, label);
     }
     template <typename T>
     void branchSub32(Condition cond, T src, Register dest, Label* label) {
         subl(src, dest);
         j(cond, label);
     }
     void atomic_inc32(const Operand& addr) {