mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-20 00:35:44 +00:00
Bug 1555153 - ARM64 division by constant: compare remainder against zero. r=sstangl
Differential Revision: https://phabricator.services.mozilla.com/D33015 --HG-- extra : moz-landing-system : lando
This commit is contained in:
parent
b37b2bcb8f
commit
dcb38ecb71
5
js/src/jit-test/tests/ion/div-by-constant-bug1555153.js
Normal file
5
js/src/jit-test/tests/ion/div-by-constant-bug1555153.js
Normal file
@ -0,0 +1,5 @@
|
||||
x = [99999999999999999999999999, -(2 ** 53 - 2)];
|
||||
res = [0, 2 / 3];
|
||||
for (let i = 0; i < 2; ++i) {
|
||||
assertEq((x[i] | 0) / 3, res[i]);
|
||||
}
|
@ -598,7 +598,7 @@ void CodeGenerator::visitDivConstantI(LDivConstantI* ins) {
|
||||
masm.Mov(const32, d);
|
||||
masm.Msub(const32, output32, const32, lhs32);
|
||||
// bailout if (lhs - output * d != 0)
|
||||
masm.Cmp(const32, const32);
|
||||
masm.Cmp(const32, wzr);
|
||||
auto bailoutCond = Assembler::NonZero;
|
||||
|
||||
// If lhs is zero and the divisor is negative, the answer should have
|
||||
@ -608,7 +608,7 @@ void CodeGenerator::visitDivConstantI(LDivConstantI* ins) {
|
||||
// ^ ^
|
||||
// | '-- masm.Ccmp(lhs32, lhs32, .., ..)
|
||||
// '-- masm.Ccmp(.., .., vixl::ZFlag, ! bailoutCond)
|
||||
masm.Ccmp(lhs32, lhs32, vixl::ZFlag, Assembler::Zero);
|
||||
masm.Ccmp(lhs32, wzr, vixl::ZFlag, Assembler::Zero);
|
||||
bailoutCond = Assembler::Zero;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user