Bug 1448809 - [MIPS] Fix build failures after final changes in Bug 1428453; r=bbouvier
authorDragan Mladjenovic <dragan.mladjenovic>
Mon, 26 Mar 2018 03:05:00 +0300
changeset 463559 f125e92de64b75b3d259d451635f611ae205e8d8
parent 463558 dd2d726b75ab4d34b678dbfadb7b1386c46f2c52
child 463560 f7a802eb8fdf0dae8cfead8e87cc953a67e9c5cf
push id9165
push userasasaki@mozilla.com
push dateThu, 26 Apr 2018 21:04:54 +0000
treeherdermozilla-beta@064c3804de2e [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbbouvier
bugs1448809, 1428453
milestone61.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 1448809 - [MIPS] Fix build failures after final changes in Bug 1428453; r=bbouvier
js/src/jit/mips-shared/CodeGenerator-mips-shared.cpp
js/src/jit/mips-shared/MacroAssembler-mips-shared-inl.h
js/src/jit/mips-shared/MacroAssembler-mips-shared.cpp
js/src/jit/mips-shared/MacroAssembler-mips-shared.h
js/src/jit/mips32/MacroAssembler-mips32.cpp
js/src/jit/mips64/MacroAssembler-mips64.cpp
--- a/js/src/jit/mips-shared/CodeGenerator-mips-shared.cpp
+++ b/js/src/jit/mips-shared/CodeGenerator-mips-shared.cpp
@@ -2384,17 +2384,17 @@ CodeGenerator::visitNegF(LNegF* ins)
 void
 CodeGenerator::visitWasmAddOffset(LWasmAddOffset* lir)
 {
     MWasmAddOffset* mir = lir->mir();
     Register base = ToRegister(lir->base());
     Register out = ToRegister(lir->output());
 
     Label ok;
-    masm.ma_addTestCarryClear(out, base, Imm32(mir->offset()), &ok);
+    masm.ma_addTestCarry(Assembler::CarryClear, out, base, Imm32(mir->offset()), &ok);
     masm.wasmTrap(wasm::Trap::OutOfBounds, mir->bytecodeOffset());
     masm.bind(&ok);
 }
 
 
 void
 CodeGenerator::visitAtomicTypedArrayElementBinop(LAtomicTypedArrayElementBinop* lir)
 {
--- a/js/src/jit/mips-shared/MacroAssembler-mips-shared-inl.h
+++ b/js/src/jit/mips-shared/MacroAssembler-mips-shared-inl.h
@@ -632,18 +632,19 @@ MacroAssembler::branchTruncateDoubleToIn
 template <typename T>
 void
 MacroAssembler::branchAdd32(Condition cond, T src, Register dest, Label* overflow)
 {
     switch (cond) {
       case Overflow:
         ma_addTestOverflow(dest, dest, src, overflow);
         break;
+      case CarryClear:
       case CarrySet:
-        ma_addTestCarry(dest, dest, src, overflow);
+        ma_addTestCarry(cond, dest, dest, src, overflow);
         break;
       default:
         MOZ_CRASH("NYI");
     }
 }
 
 template <typename T>
 void
--- a/js/src/jit/mips-shared/MacroAssembler-mips-shared.cpp
+++ b/js/src/jit/mips-shared/MacroAssembler-mips-shared.cpp
@@ -322,29 +322,33 @@ MacroAssemblerMIPSShared::ma_addu(Regist
 
 void
 MacroAssemblerMIPSShared::ma_addu(Register rd, Imm32 imm)
 {
     ma_addu(rd, rd, imm);
 }
 
 void
-MacroAssemblerMIPSShared::ma_addTestCarry(Register rd, Register rs, Register rt, Label* overflow)
+MacroAssemblerMIPSShared::ma_addTestCarry(Condition cond, Register rd, Register rs, Register rt,
+                                          Label* overflow)
 {
+    MOZ_ASSERT(cond == Assembler::CarrySet || cond == Assembler::CarryClear);
     MOZ_ASSERT_IF(rd == rs, rt != rd);
     as_addu(rd, rs, rt);
-    as_sltu(SecondScratchReg, rd, rd == rs? rt : rs);
-    ma_b(SecondScratchReg, SecondScratchReg, overflow, Assembler::NonZero);
+    as_sltu(SecondScratchReg, rd, rd == rs ? rt : rs);
+    ma_b(SecondScratchReg, SecondScratchReg, overflow,
+         cond == Assembler::CarrySet ? Assembler::NonZero : Assembler:: Zero);
 }
 
 void
-MacroAssemblerMIPSShared::ma_addTestCarry(Register rd, Register rs, Imm32 imm, Label* overflow)
+MacroAssemblerMIPSShared::ma_addTestCarry(Condition cond, Register rd, Register rs, Imm32 imm,
+                                          Label* overflow)
 {
     ma_li(ScratchRegister, imm);
-    ma_addTestCarry(rd, rs, ScratchRegister, overflow);
+    ma_addTestCarry(cond, rd, rs, ScratchRegister, overflow);
 }
 
 // Subtract.
 void
 MacroAssemblerMIPSShared::ma_subu(Register rd, Register rs, Imm32 imm)
 {
     if (Imm16::IsInSignedRange(-imm.value)) {
         as_addiu(rd, rs, -imm.value);
--- a/js/src/jit/mips-shared/MacroAssembler-mips-shared.h
+++ b/js/src/jit/mips-shared/MacroAssembler-mips-shared.h
@@ -125,18 +125,18 @@ class MacroAssemblerMIPSShared : public 
     void ma_store_unaligned(const wasm::MemoryAccessDesc& access, Register data, const BaseIndex& dest, Register temp,
                             LoadStoreSize size, LoadStoreExtension extension);
 
     // arithmetic based ops
     // add
     void ma_addu(Register rd, Register rs, Imm32 imm);
     void ma_addu(Register rd, Register rs);
     void ma_addu(Register rd, Imm32 imm);
-    void ma_addTestCarry(Register rd, Register rs, Register rt, Label* overflow);
-    void ma_addTestCarry(Register rd, Register rs, Imm32 imm, Label* overflow);
+    void ma_addTestCarry(Condition cond, Register rd, Register rs, Register rt, Label* overflow);
+    void ma_addTestCarry(Condition cond, Register rd, Register rs, Imm32 imm, Label* overflow);
 
     // subtract
     void ma_subu(Register rd, Register rs, Imm32 imm);
     void ma_subu(Register rd, Register rs);
     void ma_subu(Register rd, Imm32 imm);
     void ma_subTestOverflow(Register rd, Register rs, Imm32 imm, Label* overflow);
 
     // multiplies.  For now, there are only few that we care about.
--- a/js/src/jit/mips32/MacroAssembler-mips32.cpp
+++ b/js/src/jit/mips32/MacroAssembler-mips32.cpp
@@ -2468,26 +2468,28 @@ template void
 MacroAssembler::storeUnboxedValue(const ConstantOrRegister& value, MIRType valueType,
                                   const Address& dest, MIRType slotType);
 template void
 MacroAssembler::storeUnboxedValue(const ConstantOrRegister& value, MIRType valueType,
                                   const BaseIndex& dest, MIRType slotType);
 
 
 void
-MacroAssembler::wasmBoundsCheck(Condition cond, Register index, Register boundsCheckLimit, Label* label)
+MacroAssembler::wasmBoundsCheck(Condition cond, Register index, Register boundsCheckLimit,
+                                Label* label)
 {
      ma_b(index, boundsCheckLimit, label, cond);
 }
 
 void
-MacroAssembler::wasmBoundsCheck(Condition cond, Register index, Address boundsCheckLimit, Label* label)
+MacroAssembler::wasmBoundsCheck(Condition cond, Register index, Address boundsCheckLimit,
+                                Label* label)
 {
     SecondScratchRegisterScope scratch2(*this);
-    load32(boundsCheckLimit,SecondScratchReg);
+    load32(boundsCheckLimit, SecondScratchReg);
     ma_b(index, SecondScratchReg, label, cond);
 }
 
 void
 MacroAssembler::wasmTruncateDoubleToUInt32(FloatRegister input, Register output, bool isSaturating,
                                            Label* oolEntry)
 {
     Label done;
--- a/js/src/jit/mips64/MacroAssembler-mips64.cpp
+++ b/js/src/jit/mips64/MacroAssembler-mips64.cpp
@@ -2305,23 +2305,25 @@ template void
 MacroAssembler::storeUnboxedValue(const ConstantOrRegister& value, MIRType valueType,
                                   const Address& dest, MIRType slotType);
 template void
 MacroAssembler::storeUnboxedValue(const ConstantOrRegister& value, MIRType valueType,
                                   const BaseIndex& dest, MIRType slotType);
 
 
 void
-MacroAssembler::wasmBoundsCheck(Condition cond, Register index, Register boundsCheckLimit, Label* label)
+MacroAssembler::wasmBoundsCheck(Condition cond, Register index, Register boundsCheckLimit,
+                                Label* label)
 {
     ma_b(index, boundsCheckLimit, label, cond);
 }
 
 void
-MacroAssembler::wasmBoundsCheck(Condition cond, Register index, Address boundsCheckLimit, Label* label)
+MacroAssembler::wasmBoundsCheck(Condition cond, Register index, Address boundsCheckLimit,
+                                Label* label)
 {
     SecondScratchRegisterScope scratch2(*this);
     load32(boundsCheckLimit, SecondScratchReg);
     ma_b(index, SecondScratchReg, label, cond);
 }
 
 void
 MacroAssembler::wasmTruncateDoubleToUInt32(FloatRegister input, Register output, bool isSaturating,