Bug 1229292 - IonMonkey: MIPS64: Fix skip nops in conditional branches. r=huangwenjun06
authorHeiher <r@hev.cc>
Thu, 03 Dec 2015 19:22:34 +0800
changeset 309590 26118d46571543946031d04e5264d58b4b6729a9
parent 309589 29408f18b82e6319b8db1649e81c6add291dbe04
child 309591 857b2d9012c0a21b9ab8737b0de96cf1ee78a748
push id5513
push userraliiev@mozilla.com
push dateMon, 25 Jan 2016 13:55:34 +0000
treeherdermozilla-beta@5ee97dd05b5c [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewershuangwenjun06
bugs1229292
milestone45.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 1229292 - IonMonkey: MIPS64: Fix skip nops in conditional branches. r=huangwenjun06 --- js/src/jit/mips64/Assembler-mips64.cpp | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-)
js/src/jit/mips64/Assembler-mips64.cpp
--- a/js/src/jit/mips64/Assembler-mips64.cpp
+++ b/js/src/jit/mips64/Assembler-mips64.cpp
@@ -269,31 +269,32 @@ Assembler::bind(InstImm* inst, uintptr_t
         addLongJump(BufferOffset(branch));
         Assembler::WriteLoad64Instructions(inst, ScratchRegister, target);
         inst[4] = InstReg(op_special, ScratchRegister, zero, ra, ff_jalr).encode();
         // There is 1 nop after this.
         return;
     }
 
     if (BOffImm16::IsInRange(offset)) {
+#ifdef _MIPS_ARCH_LOONGSON3A
+        // Don't skip trailing nops can imporve performance
+        // on Loongson3 platform.
+        bool skipNops = false;
+#else
+        bool skipNops = (inst[0].encode() != inst_bgezal.encode() &&
+                         inst[0].encode() != inst_beq.encode());
+#endif
+
         inst[0].setBOffImm16(BOffImm16(offset));
         inst[1].makeNop();
 
-        // Don't skip trailing nops can imporve performance
-        // on Loongson3 platform.
-#ifndef _MIPS_ARCH_LOONGSON3A
-        bool conditional = (inst[0].encode() != inst_bgezal.encode() &&
-                            inst[0].encode() != inst_beq.encode());
-
-        // Skip the trailing nops in conditional branches.
-        if (conditional) {
+        if (skipNops) {
             inst[2] = InstImm(op_regimm, zero, rt_bgez, BOffImm16(5 * sizeof(uint32_t))).encode();
             // There are 4 nops after this
         }
-#endif
         return;
     }
 
     if (inst[0].encode() == inst_beq.encode()) {
         // Handle long unconditional jump.
         addLongJump(BufferOffset(branch));
         Assembler::WriteLoad64Instructions(inst, ScratchRegister, target);
         inst[4] = InstReg(op_special, ScratchRegister, zero, zero, ff_jr).encode();