You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This only happens for a zero shift amount. Any other amount is fine.
The text was updated successfully, but these errors were encountered:
bjorn3
added
bug
Incorrect behavior in the current implementation that needs fixing
cranelift
Issues related to the Cranelift code generator
labels
Feb 23, 2021
This fixesbytecodealliance#2672 and bytecodealliance#2679, and also fixes an incorrect instruction
emission (`test` with small immediate) that we had missed earlier.
The shift-related fixes have to do with (i) shifts by 0 bits, as a
special case that must be handled; and (ii) shifts by a 128-bit amount,
which we can handle by just dropping the upper half (we only use 3--7
bits of shift amount).
This adjusts the lowerings appropriately, and also adds run-tests to
ensure that the lowerings actually execute correctly (previously we only
had compile-tests with golden lowerings; I'd like to correct this for
more ops eventually, adding run-tests beyond what the Wasm spec and
frontend covers).
Steps to Reproduce
1u128 << 0
usingishl.i128
Expected Results
The resulting value is 1.
Actual Results
The resulting value is 0x10000000000000001.
Versions and Environment
Cranelift version or commit: 98d3e68
Operating system: N/A
Architecture: x86_64
Extra Info
This only happens for a zero shift amount. Any other amount is fine.
The text was updated successfully, but these errors were encountered: