Bug 1341292 - MIPS: Remove redundant asserts. r=lth
authorMiran.Karic <Miran.Karic@imgtec.com>
Tue, 05 Sep 2017 05:42:00 -0400
changeset 379409 c5412efabadb8810f8e527cae0d410b6baabec39
parent 379408 0da4bb3c477c4f27ea7f3dc7a389fa6b83147fe9
child 379410 13af2a4eee010f9c8861ebb9292bd80febfd33f3
push id50642
push userarchaeopteryx@coole-files.de
push dateThu, 07 Sep 2017 10:41:07 +0000
treeherderautoland@bd0ce93776fe [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerslth
bugs1341292
milestone57.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 1341292 - MIPS: Remove redundant asserts. r=lth Asserts in MoveEmitterMIPS[32|64]::emitDoubleMove cause failures in some tests, but they are redundant. The asserts check if the source or destination register is scratch register, however scratch register is actually used only for memory to memory move.
js/src/jit/mips32/MoveEmitter-mips32.cpp
js/src/jit/mips64/MoveEmitter-mips64.cpp
--- a/js/src/jit/mips32/MoveEmitter-mips32.cpp
+++ b/js/src/jit/mips32/MoveEmitter-mips32.cpp
@@ -113,20 +113,16 @@ MoveEmitterMIPS::completeCycle(const Mov
       default:
         MOZ_CRASH("Unexpected move type");
     }
 }
 
 void
 MoveEmitterMIPS::emitDoubleMove(const MoveOperand& from, const MoveOperand& to)
 {
-    // Ensure that we can use ScratchDoubleReg in memory move.
-    MOZ_ASSERT_IF(from.isFloatReg(), from.floatReg() != ScratchDoubleReg);
-    MOZ_ASSERT_IF(to.isFloatReg(), to.floatReg() != ScratchDoubleReg);
-
     if (from.isFloatReg()) {
         if (to.isFloatReg()) {
             masm.moveDouble(from.floatReg(), to.floatReg());
         } else if (to.isGeneralRegPair()) {
             // Used for passing double parameter in a2,a3 register pair.
             // Two moves are added for one double parameter by
             // MacroAssembler::passABIArg
             MOZ_ASSERT(to.evenReg() == a2 && to.oddReg() == a3,
--- a/js/src/jit/mips64/MoveEmitter-mips64.cpp
+++ b/js/src/jit/mips64/MoveEmitter-mips64.cpp
@@ -123,20 +123,16 @@ MoveEmitterMIPS64::completeCycle(const M
       default:
         MOZ_CRASH("Unexpected move type");
     }
 }
 
 void
 MoveEmitterMIPS64::emitDoubleMove(const MoveOperand& from, const MoveOperand& to)
 {
-    // Ensure that we can use SecondScratchDoubleReg in memory move.
-    MOZ_ASSERT_IF(from.isFloatReg(), from.floatReg() != SecondScratchDoubleReg);
-    MOZ_ASSERT_IF(to.isFloatReg(), to.floatReg() != SecondScratchDoubleReg);
-
     if (from.isFloatReg()) {
         if (to.isFloatReg()) {
             masm.moveDouble(from.floatReg(), to.floatReg());
         } else if (to.isGeneralReg()) {
             masm.moveFromDouble(from.floatReg(), to.reg());
         } else {
             MOZ_ASSERT(to.isMemory());
             masm.storeDouble(from.floatReg(), getAdjustedAddress(to));
@@ -144,12 +140,12 @@ MoveEmitterMIPS64::emitDoubleMove(const 
     } else if (to.isFloatReg()) {
         if (from.isMemory())
           masm.loadDouble(getAdjustedAddress(from), to.floatReg());
         else
           masm.moveToDouble(from.reg(), to.floatReg());
     } else {
         MOZ_ASSERT(from.isMemory());
         MOZ_ASSERT(to.isMemory());
-        masm.loadDouble(getAdjustedAddress(from), SecondScratchDoubleReg);
-        masm.storeDouble(SecondScratchDoubleReg, getAdjustedAddress(to));
+        masm.loadDouble(getAdjustedAddress(from), ScratchDoubleReg);
+        masm.storeDouble(ScratchDoubleReg, getAdjustedAddress(to));
     }
 }