Skip to content
Snippets Groups Projects
Commit 8cf9bff5 authored by Heiher's avatar Heiher
Browse files

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(-)
parent 05eb71c3
No related branches found
No related tags found
No related merge requests found
...@@ -274,21 +274,22 @@ Assembler::bind(InstImm* inst, uintptr_t branch, uintptr_t target) ...@@ -274,21 +274,22 @@ Assembler::bind(InstImm* inst, uintptr_t branch, uintptr_t target)
} }
if (BOffImm16::IsInRange(offset)) { if (BOffImm16::IsInRange(offset)) {
inst[0].setBOffImm16(BOffImm16(offset)); #ifdef _MIPS_ARCH_LOONGSON3A
inst[1].makeNop();
// Don't skip trailing nops can imporve performance // Don't skip trailing nops can imporve performance
// on Loongson3 platform. // on Loongson3 platform.
#ifndef _MIPS_ARCH_LOONGSON3A bool skipNops = false;
bool conditional = (inst[0].encode() != inst_bgezal.encode() && #else
inst[0].encode() != inst_beq.encode()); bool skipNops = (inst[0].encode() != inst_bgezal.encode() &&
inst[0].encode() != inst_beq.encode());
#endif
// Skip the trailing nops in conditional branches. inst[0].setBOffImm16(BOffImm16(offset));
if (conditional) { inst[1].makeNop();
if (skipNops) {
inst[2] = InstImm(op_regimm, zero, rt_bgez, BOffImm16(5 * sizeof(uint32_t))).encode(); inst[2] = InstImm(op_regimm, zero, rt_bgez, BOffImm16(5 * sizeof(uint32_t))).encode();
// There are 4 nops after this // There are 4 nops after this
} }
#endif
return; return;
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment