Bug 1199719 part 6 - Move MacroAssembler::xor32 into the generic macro assembler. r=jandem
authorNicolas B. Pierron <nicolas.b.pierron@mozilla.com>
Fri, 11 Sep 2015 13:47:54 +0200
changeset 294599 56908a0c9749cce0b9de9aca4169b524f89843a4
parent 294598 a392154abcd983fc178d05bb29b161688ebae669
child 294600 1c76222e6348687151b94361efd7c3688f35b68f
push id5245
push userraliiev@mozilla.com
push dateThu, 29 Oct 2015 11:30:51 +0000
treeherdermozilla-beta@dac831dc1bd0 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjandem
bugs1199719
milestone43.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1199719 part 6 - Move MacroAssembler::xor32 into the generic macro assembler. r=jandem
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/mips32/MacroAssembler-mips32-inl.h
js/src/jit/mips32/MacroAssembler-mips32.cpp
js/src/jit/mips32/MacroAssembler-mips32.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.h
+++ b/js/src/jit/MacroAssembler.h
@@ -680,16 +680,19 @@ class MacroAssembler : public MacroAssem
 
     inline void or32(Register src, Register dest) PER_SHARED_ARCH;
     inline void or32(Imm32 imm, Register dest) PER_SHARED_ARCH;
     inline void or32(Imm32 imm, const Address& dest) PER_SHARED_ARCH;
 
     inline void orPtr(Register src, Register dest) PER_ARCH;
     inline void orPtr(Imm32 imm, Register dest) PER_ARCH;
 
+    inline void xor32(Register src, Register dest) DEFINED_ON(x86_shared);
+    inline void xor32(Imm32 imm, Register dest) PER_SHARED_ARCH;
+
     //}}} check_macroassembler_style
   public:
 
     // Emits a test of a value against all types in a TypeSet. A scratch
     // register is required.
     template <typename Source>
     void guardTypeSet(const Source& address, const TypeSet* types, BarrierKind kind, Register scratch, Label* miss);
 
--- a/js/src/jit/arm/MacroAssembler-arm-inl.h
+++ b/js/src/jit/arm/MacroAssembler-arm-inl.h
@@ -85,15 +85,21 @@ MacroAssembler::orPtr(Register src, Regi
 }
 
 void
 MacroAssembler::orPtr(Imm32 imm, Register dest)
 {
     ma_orr(imm, dest);
 }
 
+void
+MacroAssembler::xor32(Imm32 imm, Register dest)
+{
+    ma_eor(imm, dest, SetCC);
+}
+
 //}}} check_macroassembler_style
 // ===============================================================
 
 } // 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
@@ -1908,22 +1908,16 @@ MacroAssemblerARMCompat::add32(Register 
 
 void
 MacroAssemblerARMCompat::add32(Imm32 imm, Register dest)
 {
     ma_add(imm, dest, SetCC);
 }
 
 void
-MacroAssemblerARMCompat::xor32(Imm32 imm, Register dest)
-{
-    ma_eor(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);
 }
 
--- a/js/src/jit/arm/MacroAssembler-arm.h
+++ b/js/src/jit/arm/MacroAssembler-arm.h
@@ -1195,17 +1195,16 @@ class MacroAssemblerARMCompat : public M
         add32(src, dest);
         j(cond, label);
     }
     template <typename T>
     void branchSub32(Condition cond, T src, Register dest, Label* label) {
         sub32(src, dest);
         j(cond, label);
     }
-    void xor32(Imm32 imm, Register dest);
 
     void xorPtr(Imm32 imm, Register dest);
     void xorPtr(Register src, Register dest);
     void addPtr(Register src, Register dest);
     void addPtr(const Address& src, Register dest);
     void not32(Register reg);
 
     void move32(Imm32 imm, Register dest);
--- a/js/src/jit/arm64/MacroAssembler-arm64-inl.h
+++ b/js/src/jit/arm64/MacroAssembler-arm64-inl.h
@@ -97,16 +97,22 @@ MacroAssembler::orPtr(Register src, Regi
 }
 
 void
 MacroAssembler::orPtr(Imm32 imm, Register dest)
 {
     Orr(ARMRegister(dest, 64), ARMRegister(dest, 64), Operand(imm.value));
 }
 
+void
+MacroAssembler::xor32(Imm32 imm, Register dest)
+{
+    Eor(ARMRegister(dest, 32), ARMRegister(dest, 32), Operand(imm.value));
+}
+
 //}}} check_macroassembler_style
 // ===============================================================
 
 template <typename T>
 void
 MacroAssemblerCompat::andToStackPtr(T t)
 {
     asMasm().andPtr(t, getStackPointer());
--- a/js/src/jit/arm64/MacroAssembler-arm64.h
+++ b/js/src/jit/arm64/MacroAssembler-arm64.h
@@ -1076,19 +1076,16 @@ class MacroAssemblerCompat : public vixl
         Asr(ARMRegister(dest, 64), ARMRegister(dest, 64), imm.value);
     }
     void lshiftPtr(Imm32 imm, Register dest) {
         Lsl(ARMRegister(dest, 64), ARMRegister(dest, 64), imm.value);
     }
     void xorPtr(Imm32 imm, Register dest) {
         Eor(ARMRegister(dest, 64), ARMRegister(dest, 64), Operand(imm.value));
     }
-    void xor32(Imm32 imm, Register dest) {
-        Eor(ARMRegister(dest, 32), ARMRegister(dest, 32), Operand(imm.value));
-    }
 
     void xorPtr(Register src, Register dest) {
         Eor(ARMRegister(dest, 64), ARMRegister(dest, 64), Operand(ARMRegister(src, 64)));
     }
 
     void testPtr(Register lhs, Register rhs) {
         Tst(ARMRegister(lhs, 64), Operand(ARMRegister(rhs, 64)));
     }
--- a/js/src/jit/mips32/MacroAssembler-mips32-inl.h
+++ b/js/src/jit/mips32/MacroAssembler-mips32-inl.h
@@ -82,15 +82,21 @@ MacroAssembler::orPtr(Register src, Regi
 }
 
 void
 MacroAssembler::orPtr(Imm32 imm, Register dest)
 {
     ma_or(dest, imm);
 }
 
+void
+MacroAssembler::xor32(Imm32 imm, Register dest)
+{
+    ma_xor(dest, imm);
+}
+
 //}}} check_macroassembler_style
 // ===============================================================
 
 } // namespace jit
 } // namespace js
 
 #endif /* jit_mips32_MacroAssembler_mips32_inl_h */
--- a/js/src/jit/mips32/MacroAssembler-mips32.cpp
+++ b/js/src/jit/mips32/MacroAssembler-mips32.cpp
@@ -1569,22 +1569,16 @@ MacroAssemblerMIPSCompat::subPtr(Registe
 void
 MacroAssemblerMIPSCompat::not32(Register reg)
 {
     ma_not(reg, reg);
 }
 
 // Logical operations
 void
-MacroAssemblerMIPSCompat::xor32(Imm32 imm, Register dest)
-{
-    ma_xor(dest, imm);
-}
-
-void
 MacroAssemblerMIPSCompat::xorPtr(Imm32 imm, Register dest)
 {
     ma_xor(dest, imm);
 }
 
 void
 MacroAssemblerMIPSCompat::xorPtr(Register src, Register dest)
 {
--- a/js/src/jit/mips32/MacroAssembler-mips32.h
+++ b/js/src/jit/mips32/MacroAssembler-mips32.h
@@ -1126,17 +1126,16 @@ class MacroAssemblerMIPSCompat : public 
             sub32(src, dest);
             ma_b(dest, dest, overflow, cond);
             break;
           default:
             MOZ_CRASH("NYI");
         }
     }
 
-    void xor32(Imm32 imm, Register dest);
     void xorPtr(Imm32 imm, Register dest);
     void xorPtr(Register src, Register dest);
     void addPtr(Register src, Register dest);
     void subPtr(Register src, Register dest);
     void addPtr(const Address& src, Register dest);
     void not32(Register reg);
 
     void move32(Imm32 imm, Register dest);
--- a/js/src/jit/none/MacroAssembler-none.h
+++ b/js/src/jit/none/MacroAssembler-none.h
@@ -421,17 +421,16 @@ class MacroAssemblerNone : public Assemb
     template <typename T> void loadUnboxedValue(T, MIRType, AnyRegister) { MOZ_CRASH(); }
     template <typename T> void storeUnboxedValue(ConstantOrRegister, MIRType, T, MIRType) { MOZ_CRASH(); }
     template <typename T> void storeUnboxedPayload(ValueOperand value, T, size_t) { MOZ_CRASH(); }
 
     void rshiftPtr(Imm32, Register) { MOZ_CRASH(); }
     void rshiftPtrArithmetic(Imm32, Register) { MOZ_CRASH(); }
     void lshiftPtr(Imm32, Register) { MOZ_CRASH(); }
     template <typename T, typename S> void xorPtr(T, S) { MOZ_CRASH(); }
-    template <typename T, typename S> void xor32(T, S) { MOZ_CRASH(); }
     template <typename T> void not32(T) { MOZ_CRASH(); }
     void convertUInt32ToDouble(Register, FloatRegister) { MOZ_CRASH(); }
     void convertUInt32ToFloat32(Register, FloatRegister) { MOZ_CRASH(); }
     void inc64(AbsoluteAddress) { MOZ_CRASH(); }
     void incrementInt32Value(Address) { MOZ_CRASH(); }
     void ensureDouble(ValueOperand, FloatRegister, Label*) { MOZ_CRASH(); }
     void handleFailureWithHandlerTail(void*) { MOZ_CRASH(); }
 
--- a/js/src/jit/x86-shared/MacroAssembler-x86-shared-inl.h
+++ b/js/src/jit/x86-shared/MacroAssembler-x86-shared-inl.h
@@ -53,15 +53,27 @@ MacroAssembler::or32(Imm32 imm, Register
 }
 
 void
 MacroAssembler::or32(Imm32 imm, const Address& dest)
 {
     orl(imm, Operand(dest));
 }
 
+void
+MacroAssembler::xor32(Register src, Register dest)
+{
+    xorl(src, dest);
+}
+
+void
+MacroAssembler::xor32(Imm32 imm, Register dest)
+{
+    xorl(imm, dest);
+}
+
 //}}} check_macroassembler_style
 // ===============================================================
 
 } // namespace jit
 } // namespace js
 
 #endif /* jit_x86_shared_MacroAssembler_x86_shared_inl_h */
--- a/js/src/jit/x86-shared/MacroAssembler-x86-shared.h
+++ b/js/src/jit/x86-shared/MacroAssembler-x86-shared.h
@@ -185,22 +185,16 @@ class MacroAssemblerX86Shared : public A
         add32(src, dest);
         j(cond, label);
     }
     template <typename T>
     void branchSub32(Condition cond, T src, Register dest, Label* label) {
         sub32(src, dest);
         j(cond, label);
     }
-    void xor32(Imm32 imm, Register dest) {
-        xorl(imm, dest);
-    }
-    void xor32(Register src, Register dest) {
-        xorl(src, dest);
-    }
     void not32(Register reg) {
         notl(reg);
     }
     void atomic_inc32(const Operand& addr) {
         lock_incl(addr);
     }
     void atomic_dec32(const Operand& addr) {
         lock_decl(addr);