mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-01 06:35:42 +00:00
Bug 506177 - TM/nanojit: remove dead 'isfar' argument from asm_branch(). r=rreitmai.
This commit is contained in:
parent
30d76462d3
commit
35b35b2533
@ -1390,7 +1390,7 @@ namespace nanojit
|
||||
if (label && label->addr) {
|
||||
// forward jump to known label. need to merge with label's register state.
|
||||
unionRegisterState(label->regs);
|
||||
asm_branch(op == LIR_jf, cond, label->addr, false);
|
||||
asm_branch(op == LIR_jf, cond, label->addr);
|
||||
}
|
||||
else {
|
||||
// back edge.
|
||||
@ -1405,7 +1405,7 @@ namespace nanojit
|
||||
// evict all registers, most conservative approach.
|
||||
intersectRegisterState(label->regs);
|
||||
}
|
||||
NIns *branch = asm_branch(op == LIR_jf, cond, 0, false);
|
||||
NIns *branch = asm_branch(op == LIR_jf, cond, 0);
|
||||
patches.put(branch,to);
|
||||
}
|
||||
break;
|
||||
@ -1450,7 +1450,7 @@ namespace nanojit
|
||||
// we only support cmp with guard right now, also assume it is 'close' and only emit the branch
|
||||
NIns* exit = asm_exit(ins); // does intersectRegisterState()
|
||||
LIns* cond = ins->oprnd1();
|
||||
asm_branch(op == LIR_xf, cond, exit, false);
|
||||
asm_branch(op == LIR_xf, cond, exit);
|
||||
break;
|
||||
}
|
||||
case LIR_x:
|
||||
|
@ -299,7 +299,7 @@ namespace nanojit
|
||||
void asm_call(LInsp);
|
||||
void asm_arg(ArgSize, LInsp, Register);
|
||||
Register asm_binop_rhs_reg(LInsp ins);
|
||||
NIns* asm_branch(bool branchOnFalse, LInsp cond, NIns* targ, bool isfar);
|
||||
NIns* asm_branch(bool branchOnFalse, LInsp cond, NIns* targ);
|
||||
void asm_switch(LIns* ins, NIns* target);
|
||||
void emitJumpTable(SwitchInfo* si, NIns* target);
|
||||
void assignSavedRegs();
|
||||
|
@ -1833,12 +1833,8 @@ Assembler::asm_prep_fcall(Reservation*, LInsp)
|
||||
}
|
||||
|
||||
NIns*
|
||||
Assembler::asm_branch(bool branchOnFalse, LInsp cond, NIns* targ, bool isfar)
|
||||
Assembler::asm_branch(bool branchOnFalse, LInsp cond, NIns* targ)
|
||||
{
|
||||
// ignore isfar -- we figure this out on our own.
|
||||
// XXX noone actually uses the far param in nj anyway... (always false)
|
||||
(void)isfar;
|
||||
|
||||
LOpcode condop = cond->opcode();
|
||||
NanoAssert(cond->isCond());
|
||||
|
||||
|
@ -467,9 +467,8 @@ namespace nanojit
|
||||
LDSW32(rs, ds, t);
|
||||
}
|
||||
|
||||
NIns* Assembler::asm_branch(bool branchOnFalse, LInsp cond, NIns* targ, bool isfar)
|
||||
NIns* Assembler::asm_branch(bool branchOnFalse, LInsp cond, NIns* targ)
|
||||
{
|
||||
// XXX ignoring isfar
|
||||
NIns* at = 0;
|
||||
LOpcode condop = cond->opcode();
|
||||
NanoAssert(cond->isCond());
|
||||
|
@ -641,7 +641,7 @@ namespace nanojit
|
||||
}
|
||||
}
|
||||
|
||||
NIns* Assembler::asm_branch(bool branchOnFalse, LInsp cond, NIns* targ, bool isfar)
|
||||
NIns* Assembler::asm_branch(bool branchOnFalse, LInsp cond, NIns* targ)
|
||||
{
|
||||
NIns* at = 0;
|
||||
LOpcode condop = cond->opcode();
|
||||
@ -654,48 +654,48 @@ namespace nanojit
|
||||
if (branchOnFalse)
|
||||
{
|
||||
if (condop == LIR_eq)
|
||||
JNE(targ, isfar);
|
||||
JNE(targ);
|
||||
else if (condop == LIR_ov)
|
||||
JNO(targ, isfar);
|
||||
JNO(targ);
|
||||
else if (condop == LIR_lt)
|
||||
JNL(targ, isfar);
|
||||
JNL(targ);
|
||||
else if (condop == LIR_le)
|
||||
JNLE(targ, isfar);
|
||||
JNLE(targ);
|
||||
else if (condop == LIR_gt)
|
||||
JNG(targ, isfar);
|
||||
JNG(targ);
|
||||
else if (condop == LIR_ge)
|
||||
JNGE(targ, isfar);
|
||||
JNGE(targ);
|
||||
else if (condop == LIR_ult)
|
||||
JNB(targ, isfar);
|
||||
JNB(targ);
|
||||
else if (condop == LIR_ule)
|
||||
JNBE(targ, isfar);
|
||||
JNBE(targ);
|
||||
else if (condop == LIR_ugt)
|
||||
JNA(targ, isfar);
|
||||
JNA(targ);
|
||||
else //if (condop == LIR_uge)
|
||||
JNAE(targ, isfar);
|
||||
JNAE(targ);
|
||||
}
|
||||
else // op == LIR_xt
|
||||
{
|
||||
if (condop == LIR_eq)
|
||||
JE(targ, isfar);
|
||||
JE(targ);
|
||||
else if (condop == LIR_ov)
|
||||
JO(targ, isfar);
|
||||
JO(targ);
|
||||
else if (condop == LIR_lt)
|
||||
JL(targ, isfar);
|
||||
JL(targ);
|
||||
else if (condop == LIR_le)
|
||||
JLE(targ, isfar);
|
||||
JLE(targ);
|
||||
else if (condop == LIR_gt)
|
||||
JG(targ, isfar);
|
||||
JG(targ);
|
||||
else if (condop == LIR_ge)
|
||||
JGE(targ, isfar);
|
||||
JGE(targ);
|
||||
else if (condop == LIR_ult)
|
||||
JB(targ, isfar);
|
||||
JB(targ);
|
||||
else if (condop == LIR_ule)
|
||||
JBE(targ, isfar);
|
||||
JBE(targ);
|
||||
else if (condop == LIR_ugt)
|
||||
JA(targ, isfar);
|
||||
JA(targ);
|
||||
else //if (condop == LIR_uge)
|
||||
JAE(targ, isfar);
|
||||
JAE(targ);
|
||||
}
|
||||
at = _nIns;
|
||||
asm_cmp(cond);
|
||||
@ -1565,10 +1565,10 @@ namespace nanojit
|
||||
}
|
||||
|
||||
if (c == LIR_fgt) {
|
||||
if (branchOnFalse) { JNA(targ, false); } else { JA(targ, false); }
|
||||
if (branchOnFalse) { JNA(targ); } else { JA(targ); }
|
||||
}
|
||||
else { // if (c == LIR_fge)
|
||||
if (branchOnFalse) { JNAE(targ, false); } else { JAE(targ, false); }
|
||||
if (branchOnFalse) { JNAE(targ); } else { JAE(targ); }
|
||||
}
|
||||
NIns *at = _nIns;
|
||||
Reservation *rA, *rB;
|
||||
@ -1578,9 +1578,9 @@ namespace nanojit
|
||||
}
|
||||
|
||||
if (branchOnFalse)
|
||||
JP(targ, false);
|
||||
JP(targ);
|
||||
else
|
||||
JNP(targ, false);
|
||||
JNP(targ);
|
||||
NIns *at = _nIns;
|
||||
asm_fcmp(cond);
|
||||
return at;
|
||||
|
@ -530,11 +530,11 @@ namespace nanojit
|
||||
#define JMP8 0xeb
|
||||
#define JMP32 0xe9
|
||||
|
||||
#define JCC(o,t,isfar,n) do { \
|
||||
#define JCC(o,t,n) do { \
|
||||
count_jcc();\
|
||||
underrunProtect(6); \
|
||||
intptr_t tt = (intptr_t)t - (intptr_t)_nIns; \
|
||||
if (isS8(tt) && !isfar) { \
|
||||
if (isS8(tt)) { \
|
||||
verbose_only( NIns* next = _nIns; (void)next; ) \
|
||||
_nIns -= 2; \
|
||||
_nIns[0] = (uint8_t) ( 0x70 | (o) ); \
|
||||
@ -584,33 +584,33 @@ namespace nanojit
|
||||
*(--_nIns) = 0xff; \
|
||||
asm_output("jmp *(%s)", gpn(r)); } while (0)
|
||||
|
||||
#define JE(t, isfar) JCC(0x04, t, isfar, "je")
|
||||
#define JNE(t, isfar) JCC(0x05, t, isfar, "jne")
|
||||
#define JP(t, isfar) JCC(0x0A, t, isfar, "jp")
|
||||
#define JNP(t, isfar) JCC(0x0B, t, isfar, "jnp")
|
||||
#define JE(t) JCC(0x04, t, "je")
|
||||
#define JNE(t) JCC(0x05, t, "jne")
|
||||
#define JP(t) JCC(0x0A, t, "jp")
|
||||
#define JNP(t) JCC(0x0B, t, "jnp")
|
||||
|
||||
#define JB(t, isfar) JCC(0x02, t, isfar, "jb")
|
||||
#define JNB(t, isfar) JCC(0x03, t, isfar, "jnb")
|
||||
#define JBE(t, isfar) JCC(0x06, t, isfar, "jbe")
|
||||
#define JNBE(t, isfar) JCC(0x07, t, isfar, "jnbe")
|
||||
#define JB(t) JCC(0x02, t, "jb")
|
||||
#define JNB(t) JCC(0x03, t, "jnb")
|
||||
#define JBE(t) JCC(0x06, t, "jbe")
|
||||
#define JNBE(t) JCC(0x07, t, "jnbe")
|
||||
|
||||
#define JA(t, isfar) JCC(0x07, t, isfar, "ja")
|
||||
#define JNA(t, isfar) JCC(0x06, t, isfar, "jna")
|
||||
#define JAE(t, isfar) JCC(0x03, t, isfar, "jae")
|
||||
#define JNAE(t, isfar) JCC(0x02, t, isfar, "jnae")
|
||||
#define JA(t) JCC(0x07, t, "ja")
|
||||
#define JNA(t) JCC(0x06, t, "jna")
|
||||
#define JAE(t) JCC(0x03, t, "jae")
|
||||
#define JNAE(t) JCC(0x02, t, "jnae")
|
||||
|
||||
#define JL(t, isfar) JCC(0x0C, t, isfar, "jl")
|
||||
#define JNL(t, isfar) JCC(0x0D, t, isfar, "jnl")
|
||||
#define JLE(t, isfar) JCC(0x0E, t, isfar, "jle")
|
||||
#define JNLE(t, isfar) JCC(0x0F, t, isfar, "jnle")
|
||||
#define JL(t) JCC(0x0C, t, "jl")
|
||||
#define JNL(t) JCC(0x0D, t, "jnl")
|
||||
#define JLE(t) JCC(0x0E, t, "jle")
|
||||
#define JNLE(t) JCC(0x0F, t, "jnle")
|
||||
|
||||
#define JG(t, isfar) JCC(0x0F, t, isfar, "jg")
|
||||
#define JNG(t, isfar) JCC(0x0E, t, isfar, "jng")
|
||||
#define JGE(t, isfar) JCC(0x0D, t, isfar, "jge")
|
||||
#define JNGE(t, isfar) JCC(0x0C, t, isfar, "jnge")
|
||||
#define JG(t) JCC(0x0F, t, "jg")
|
||||
#define JNG(t) JCC(0x0E, t, "jng")
|
||||
#define JGE(t) JCC(0x0D, t, "jge")
|
||||
#define JNGE(t) JCC(0x0C, t, "jnge")
|
||||
|
||||
#define JO(t, isfar) JCC(0x00, t, isfar, "jo")
|
||||
#define JNO(t, isfar) JCC(0x01, t, isfar, "jno")
|
||||
#define JO(t) JCC(0x00, t, "jo")
|
||||
#define JNO(t) JCC(0x01, t, "jno")
|
||||
|
||||
// sse instructions
|
||||
#define SSE(c,d,s) \
|
||||
|
Loading…
Reference in New Issue
Block a user