When implmenting i128 support for aarch64 I found that iconst is not correctly storing i128 values on x86_64.
It looks like the issue is that we store constants as u64's in machineinst/lower.rs, which then gets wrongly lowered to i128's.
.clif Test Case
test run
target x86_64
function %i128_const_neg_1() -> i64, i64 {
block0:
v1 = iconst.i128 -1
v2, v3 = isplit v1
return v2, v3
}
; run: %i128_const_neg_1() == [0xffffffff_ffffffff, 0xffffffff_ffffffff]
Steps to Reproduce
clif-util test ./the_above.clif
Expected Results
Returns [-1, -1]
Actual Results
Returns [-1, 0]
Versions and Environment
Cranelift version or commit: e676589 (main as of writing this)
Operating system: Windows 10 19042.928
Architecture: x86_64
When implmenting i128 support for aarch64 I found that
iconstis not correctly storing i128 values on x86_64.It looks like the issue is that we store constants as u64's in
machineinst/lower.rs, which then gets wrongly lowered to i128's..clifTest CaseSteps to Reproduce
clif-util test ./the_above.clifExpected Results
Returns
[-1, -1]Actual Results
Returns
[-1, 0]Versions and Environment
Cranelift version or commit: e676589 (main as of writing this)
Operating system: Windows 10 19042.928
Architecture: x86_64