mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 813671 - ModI should not clobber input register, r=jandem.
This commit is contained in:
parent
358b0f0abc
commit
6b138b7b7d
@ -798,10 +798,16 @@ CodeGeneratorX86Shared::visitModI(LModI *ins)
|
||||
Register remainder = ToRegister(ins->remainder());
|
||||
Register lhs = ToRegister(ins->lhs());
|
||||
Register rhs = ToRegister(ins->rhs());
|
||||
Register temp = ToRegister(ins->getTemp(0));
|
||||
|
||||
// Required to use idiv.
|
||||
JS_ASSERT(remainder == edx);
|
||||
JS_ASSERT(lhs == eax);
|
||||
JS_ASSERT(temp == eax);
|
||||
|
||||
if (lhs != temp) {
|
||||
masm.mov(lhs, temp);
|
||||
lhs = temp;
|
||||
}
|
||||
|
||||
// If rhs == 0, bailout, since result must be a double (NaN).
|
||||
masm.testl(rhs, rhs);
|
||||
|
@ -35,9 +35,10 @@ class LModI : public LBinaryMath<1>
|
||||
public:
|
||||
LIR_HEADER(ModI)
|
||||
|
||||
LModI(const LAllocation &lhs, const LAllocation &rhs) {
|
||||
LModI(const LAllocation &lhs, const LAllocation &rhs, const LDefinition &temp) {
|
||||
setOperand(0, lhs);
|
||||
setOperand(1, rhs);
|
||||
setTemp(0, temp);
|
||||
}
|
||||
|
||||
const LDefinition *remainder() {
|
||||
|
@ -88,7 +88,7 @@ LIRGeneratorX86Shared::lowerModI(MMod *mod)
|
||||
return assignSnapshot(lir) && defineReuseInput(lir, mod, 0);
|
||||
}
|
||||
}
|
||||
LModI *lir = new LModI(useFixed(mod->lhs(), eax), useRegister(mod->rhs()));
|
||||
LModI *lir = new LModI(useRegister(mod->lhs()), useRegister(mod->rhs()), tempFixed(eax));
|
||||
return assignSnapshot(lir) && defineFixed(lir, mod, LAllocation(AnyRegister(edx)));
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user