Bug 1203964 - Part 3: Move MacroAssembler::rshift64 into generic macro assembler. r=hev
authorTooru Fujisawa <arai_a@mac.com>
Sat, 12 Sep 2015 11:16:25 +0900
changeset 296098 ce2d4944e071e2a05c572d97e86c7542b8952aec
parent 296097 87d424cf36cab9daabb68552f54cd2782eb2167a
child 296099 067bf504578c8e21aa0a991beca20c2e9256d542
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)
reviewershev
bugs1203964
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 1203964 - Part 3: Move MacroAssembler::rshift64 into generic macro assembler. r=hev
js/src/jit/MacroAssembler.h
js/src/jit/arm/MacroAssembler-arm-inl.h
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.h
js/src/jit/x64/MacroAssembler-x64-inl.h
js/src/jit/x64/MacroAssembler-x64.h
js/src/jit/x86/MacroAssembler-x86-inl.h
js/src/jit/x86/MacroAssembler-x86.h
--- a/js/src/jit/MacroAssembler.h
+++ b/js/src/jit/MacroAssembler.h
@@ -700,16 +700,18 @@ class MacroAssembler : public MacroAssem
     // ===============================================================
     // Shift functions
 
     inline void rshiftPtr(Imm32 imm, Register dest) PER_ARCH;
     inline void rshiftPtr(Imm32 imm, Register src, Register dest) DEFINED_ON(arm64);
 
     inline void rshiftPtrArithmetic(Imm32 imm, Register dest) PER_ARCH;
 
+    inline void rshift64(Imm32 imm, Register64 dest) PER_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
@@ -138,15 +138,23 @@ MacroAssembler::rshiftPtr(Imm32 imm, Reg
 }
 
 void
 MacroAssembler::rshiftPtrArithmetic(Imm32 imm, Register dest)
 {
     ma_asr(imm, dest, dest);
 }
 
+void
+MacroAssembler::rshift64(Imm32 imm, Register64 dest)
+{
+    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
 // ===============================================================
 
 } // namespace jit
 } // namespace js
 
 #endif /* jit_arm_MacroAssembler_arm_inl_h */
--- a/js/src/jit/arm/MacroAssembler-arm.h
+++ b/js/src/jit/arm/MacroAssembler-arm.h
@@ -1711,21 +1711,16 @@ class MacroAssemblerARMCompat : public M
                       Label* label);
 
     void compareFloat(FloatRegister lhs, FloatRegister rhs);
     void branchFloat(DoubleCondition cond, FloatRegister lhs, FloatRegister rhs,
                      Label* label);
 
     void checkStackAlignment();
 
-    void rshift64(Imm32 imm, Register64 dest) {
-        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));
-    }
     void lshiftPtr(Imm32 imm, Register dest) {
         ma_lsl(imm, dest, dest);
     }
     void lshift64(Imm32 imm, Register64 dest) {
         as_mov(dest.high, lsl(dest.high, imm.value));
         as_orr(dest.high, dest.high, lsr(dest.low, 32 - imm.value));
         as_mov(dest.low, lsl(dest.low, imm.value));
     }
--- a/js/src/jit/arm64/MacroAssembler-arm64-inl.h
+++ b/js/src/jit/arm64/MacroAssembler-arm64-inl.h
@@ -157,25 +157,25 @@ MacroAssembler::rshiftPtr(Imm32 imm, Reg
 }
 
 void
 MacroAssembler::rshiftPtrArithmetic(Imm32 imm, Register dest)
 {
     Asr(ARMRegister(dest, 64), ARMRegister(dest, 64), imm.value);
 }
 
+void
+MacroAssembler::rshift64(Imm32 imm, Register64 dest)
+{
+    rshiftPtr(imm, dest.reg);
+}
+
 //}}} check_macroassembler_style
 // ===============================================================
 
-void
-MacroAssemblerCompat::rshift64(Imm32 imm, Register64 dest)
-{
-    asMasm().rshiftPtr(imm, dest.reg);
-}
-
 template <typename T>
 void
 MacroAssemblerCompat::andToStackPtr(T t)
 {
     asMasm().andPtr(t, getStackPointer());
     syncStackPtr();
 }
 
--- a/js/src/jit/arm64/MacroAssembler-arm64.h
+++ b/js/src/jit/arm64/MacroAssembler-arm64.h
@@ -1064,18 +1064,16 @@ class MacroAssemblerCompat : public vixl
     void branchStackPtr(Condition cond, T rhs, Label* label) {
         branchPtr(cond, getStackPointer(), rhs, label);
     }
     template <typename T>
     void branchStackPtrRhs(Condition cond, T lhs, Label* label) {
         branchPtr(cond, lhs, getStackPointer(), label);
     }
 
-    inline void rshift64(Imm32 imm, Register64 dest);
-
     void lshiftPtr(Imm32 imm, Register dest) {
         Lsl(ARMRegister(dest, 64), ARMRegister(dest, 64), imm.value);
     }
     void lshift64(Imm32 imm, Register64 dest) {
         lshiftPtr(imm, dest.reg);
     }
 
     void testPtr(Register lhs, Register rhs) {
--- a/js/src/jit/mips32/MacroAssembler-mips32-inl.h
+++ b/js/src/jit/mips32/MacroAssembler-mips32-inl.h
@@ -135,15 +135,25 @@ MacroAssembler::rshiftPtr(Imm32 imm, Reg
 }
 
 void
 MacroAssembler::rshiftPtrArithmetic(Imm32 imm, Register dest)
 {
     ma_sra(dest, dest, imm);
 }
 
+void
+MacroAssembler::rshift64(Imm32 imm, Register64 dest)
+{
+    ScratchRegisterScope scratch(*this);
+    as_srl(dest.low, dest.low, imm.value);
+    as_sll(scratch, dest.high, 32 - imm.value);
+    as_or(dest.low, dest.low, scratch);
+    as_srl(dest.high, dest.high, imm.value);
+}
+
 //}}} check_macroassembler_style
 // ===============================================================
 
 } // namespace jit
 } // namespace js
 
 #endif /* jit_mips32_MacroAssembler_mips32_inl_h */
--- a/js/src/jit/mips32/MacroAssembler-mips32.h
+++ b/js/src/jit/mips32/MacroAssembler-mips32.h
@@ -1344,22 +1344,16 @@ class MacroAssemblerMIPSCompat : public 
                      Label* label);
 
     void checkStackAlignment();
 
     void alignStackPointer();
     void restoreStackPointer();
     static void calculateAlignedStackPointer(void** stackPointer);
 
-    void rshift64(Imm32 imm, Register64 dest) {
-        as_srl(dest.low, dest.low, imm.value);
-        as_sll(ScratchRegister, dest.high, 32 - imm.value);
-        as_or(dest.low, dest.low, ScratchRegister);
-        as_srl(dest.high, dest.high, imm.value);
-    }
     void lshiftPtr(Imm32 imm, Register dest) {
         ma_sll(dest, dest, imm);
     }
     void lshift64(Imm32 imm, Register64 dest) {
         as_sll(dest.high, dest.high, imm.value);
         as_srl(ScratchRegister, dest.low, 32 - imm.value);
         as_or(dest.high, dest.high, ScratchRegister);
         as_sll(dest.low, dest.low, imm.value);
--- a/js/src/jit/x64/MacroAssembler-x64-inl.h
+++ b/js/src/jit/x64/MacroAssembler-x64-inl.h
@@ -76,15 +76,21 @@ MacroAssembler::rshiftPtr(Imm32 imm, Reg
 }
 
 void
 MacroAssembler::rshiftPtrArithmetic(Imm32 imm, Register dest)
 {
     sarq(imm, dest);
 }
 
+void
+MacroAssembler::rshift64(Imm32 imm, Register64 dest)
+{
+    shrq(imm, dest.reg);
+}
+
 //}}} check_macroassembler_style
 // ===============================================================
 
 } // namespace jit
 } // namespace js
 
 #endif /* jit_x64_MacroAssembler_x64_inl_h */
--- a/js/src/jit/x64/MacroAssembler-x64.h
+++ b/js/src/jit/x64/MacroAssembler-x64.h
@@ -845,19 +845,16 @@ class MacroAssemblerX64 : public MacroAs
             ScratchRegisterScope scratch(asMasm());
             mov(ImmPtr(address.addr), scratch);
             store32(src, Address(scratch, 0x0));
         }
     }
     void store64(Register64 src, Address address) {
         movq(src.reg, Operand(address));
     }
-    void rshift64(Imm32 imm, Register64 dest) {
-        shrq(imm, dest.reg);
-    }
     void lshiftPtr(Imm32 imm, Register dest) {
         shlq(imm, dest);
     }
     void lshift64(Imm32 imm, Register64 dest) {
         shlq(imm, dest.reg);
     }
 
     void splitTag(Register src, Register dest) {
--- a/js/src/jit/x86/MacroAssembler-x86-inl.h
+++ b/js/src/jit/x86/MacroAssembler-x86-inl.h
@@ -77,15 +77,22 @@ MacroAssembler::rshiftPtr(Imm32 imm, Reg
 }
 
 void
 MacroAssembler::rshiftPtrArithmetic(Imm32 imm, Register dest)
 {
     sarl(imm, dest);
 }
 
+void
+MacroAssembler::rshift64(Imm32 imm, Register64 dest)
+{
+    shrdl(imm, dest.high, dest.low);
+    shrl(imm, dest.high);
+}
+
 //}}} check_macroassembler_style
 // ===============================================================
 
 } // namespace jit
 } // namespace js
 
 #endif /* jit_x86_MacroAssembler_x86_inl_h */
--- a/js/src/jit/x86/MacroAssembler-x86.h
+++ b/js/src/jit/x86/MacroAssembler-x86.h
@@ -1117,20 +1117,16 @@ class MacroAssemblerX86 : public MacroAs
             return;
           case 1:
             store8(value.payloadReg(), address);
             return;
           default: MOZ_CRASH("Bad payload width");
         }
     }
 
-    void rshift64(Imm32 imm, Register64 dest) {
-        shrdl(imm, dest.high, dest.low);
-        shrl(imm, dest.high);
-    }
     void lshiftPtr(Imm32 imm, Register dest) {
         shll(imm, dest);
     }
     void lshift64(Imm32 imm, Register64 dest) {
         shldl(imm, dest.low, dest.high);
         shll(imm, dest.low);
     }