mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 1159899: IonMonkey: Fix folding of ~~x, r=nbp
This commit is contained in:
parent
a0f90d3e9b
commit
43f3ebc19e
5
js/src/jit-test/tests/ion/bug1159899.js
Normal file
5
js/src/jit-test/tests/ion/bug1159899.js
Normal file
@ -0,0 +1,5 @@
|
||||
function f(x) {
|
||||
return ~~(x >>> 0) / (x >>> 0) | 0
|
||||
}
|
||||
f(1)
|
||||
assertEq(f(-1), 0);
|
@ -2977,7 +2977,7 @@ MBitNot::foldsTo(TempAllocator& alloc)
|
||||
|
||||
if (input->isBitNot() && input->toBitNot()->specialization_ == MIRType_Int32) {
|
||||
MOZ_ASSERT(input->toBitNot()->getOperand(0)->type() == MIRType_Int32);
|
||||
return input->toBitNot()->getOperand(0); // ~~x => x
|
||||
return MTruncateToInt32::New(alloc, input->toBitNot()->input()); // ~~x => x | 0
|
||||
}
|
||||
|
||||
return this;
|
||||
|
Loading…
Reference in New Issue
Block a user