mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 518061 - NJ merge: add ExprFilter::insLoad(). r=graydon.
This commit is contained in:
parent
2a166fa683
commit
401cfd7471
@ -827,6 +827,19 @@ namespace nanojit
|
||||
return out->insBranch(v, c, t);
|
||||
}
|
||||
|
||||
LIns* ExprFilter::insLoad(LOpcode op, LIns* base, int32_t off) {
|
||||
if (base->isconstp() && !isS8(off)) {
|
||||
// if the effective address is constant, then transform:
|
||||
// ld const[bigconst] => ld (const+bigconst)[0]
|
||||
// note: we don't do this optimization for <8bit field offsets,
|
||||
// under the assumption that we're more likely to CSE-match the
|
||||
// constant base address if we dont const-fold small offsets.
|
||||
uintptr_t p = (uintptr_t)base->constvalp() + off;
|
||||
return out->insLoad(op, insImmPtr((void*)p), 0);
|
||||
}
|
||||
return out->insLoad(op, base, off);
|
||||
}
|
||||
|
||||
LIns* LirWriter::ins_eq0(LIns* oprnd1)
|
||||
{
|
||||
return ins2i(LIR_eq, oprnd1, 0);
|
||||
|
@ -1273,6 +1273,7 @@ namespace nanojit
|
||||
LIns* ins3(LOpcode v, LIns* a, LIns* b, LIns* c);
|
||||
LIns* insGuard(LOpcode, LIns *cond, LIns *);
|
||||
LIns* insBranch(LOpcode, LIns *cond, LIns *target);
|
||||
LIns* insLoad(LOpcode op, LInsp base, int32_t off);
|
||||
};
|
||||
|
||||
// @todo, this could be replaced by a generic HashMap or HashSet, if we had one
|
||||
@ -1441,9 +1442,6 @@ namespace nanojit
|
||||
LInsp pos() {
|
||||
return _i;
|
||||
}
|
||||
void setpos(LIns *i) {
|
||||
_i = i;
|
||||
}
|
||||
};
|
||||
|
||||
class Assembler;
|
||||
|
@ -56,6 +56,11 @@ namespace nanojit
|
||||
continue;
|
||||
NanoAssertMsg(!isFree(r), "Coding error; register is both free and active! " );
|
||||
|
||||
if (ins->isop(LIR_param) && ins->paramKind()==1 && r == Assembler::savedRegs[ins->paramArg()]) {
|
||||
// dont print callee-saved regs that arent used
|
||||
continue;
|
||||
}
|
||||
|
||||
s += VMPI_strlen(s);
|
||||
const char* rname = ins->isQuad() ? fpn(r) : gpn(r);
|
||||
VMPI_sprintf(s, " %s(%s)", rname, names->formatRef(ins));
|
||||
|
Loading…
Reference in New Issue
Block a user