Bug 1289262 - IonMonkey: MIPS64: Don't clobbers the scratch registers in ma_addTestOverflow/ma_subTestOverflow. r=arai
authorHeiher <r@hev.cc>
Wed, 27 Jul 2016 13:23:17 +0800
changeset 348925 5070b24e986b66f3a2576111b545972e052b841f
parent 348924 289855f3cc47637f29562e0a04b6e07319fc930a
child 348926 9d2af7a57d03faa06901c27fdd281e99222a3636
push id1230
push userjlund@mozilla.com
push dateMon, 31 Oct 2016 18:13:35 +0000
treeherdermozilla-release@5e06e3766db2 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersarai
bugs1289262
milestone50.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 1289262 - IonMonkey: MIPS64: Don't clobbers the scratch registers in ma_addTestOverflow/ma_subTestOverflow. r=arai --- js/src/jit/mips64/MacroAssembler-mips64.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-)
js/src/jit/mips64/MacroAssembler-mips64.cpp
--- a/js/src/jit/mips64/MacroAssembler-mips64.cpp
+++ b/js/src/jit/mips64/MacroAssembler-mips64.cpp
@@ -390,29 +390,29 @@ void
 MacroAssemblerMIPS64::ma_daddu(Register rd, Imm32 imm)
 {
     ma_daddu(rd, rd, imm);
 }
 
 void
 MacroAssemblerMIPS64::ma_addTestOverflow(Register rd, Register rs, Register rt, Label* overflow)
 {
+    as_daddu(SecondScratchReg, rs, rt);
     as_addu(rd, rs, rt);
-    as_daddu(ScratchRegister, rs, rt);
-    ma_b(rd, ScratchRegister, overflow, Assembler::NotEqual);
+    ma_b(rd, SecondScratchReg, overflow, Assembler::NotEqual);
 }
 
 void
 MacroAssemblerMIPS64::ma_addTestOverflow(Register rd, Register rs, Imm32 imm, Label* overflow)
 {
     // Check for signed range because of as_daddiu
     if (Imm16::IsInSignedRange(imm.value) && Imm16::IsInUnsignedRange(imm.value)) {
+        as_daddiu(SecondScratchReg, rs, imm.value);
         as_addiu(rd, rs, imm.value);
-        as_daddiu(ScratchRegister, rs, imm.value);
-        ma_b(rd, ScratchRegister, overflow, Assembler::NotEqual);
+        ma_b(rd, SecondScratchReg, overflow, Assembler::NotEqual);
     } else {
         ma_li(ScratchRegister, imm);
         ma_addTestOverflow(rd, rs, ScratchRegister, overflow);
     }
 }
 
 // Subtract.
 void
@@ -430,19 +430,19 @@ void
 MacroAssemblerMIPS64::ma_dsubu(Register rd, Imm32 imm)
 {
     ma_dsubu(rd, rd, imm);
 }
 
 void
 MacroAssemblerMIPS64::ma_subTestOverflow(Register rd, Register rs, Register rt, Label* overflow)
 {
+    as_dsubu(SecondScratchReg, rs, rt);
     as_subu(rd, rs, rt);
-    as_dsubu(ScratchRegister, rs, rt);
-    ma_b(rd, ScratchRegister, overflow, Assembler::NotEqual);
+    ma_b(rd, SecondScratchReg, overflow, Assembler::NotEqual);
 }
 
 void
 MacroAssemblerMIPS64::ma_dmult(Register rs, Imm32 imm)
 {
     ma_li(ScratchRegister, imm);
     as_dmult(rs, ScratchRegister);
 }