afonso360 labeled issue #2906:
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 get wrongly lowered to i128's.
.clif
Test Casetest 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: e676589b0c6e8228c421e18249d4635eb6c4bbe4 (main as of writing this)
Operating system: Windows 10 19042.928
Architecture: x86_64
afonso360 opened issue #2906:
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 get wrongly lowered to i128's.
.clif
Test Casetest 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: e676589b0c6e8228c421e18249d4635eb6c4bbe4 (main as of writing this)
Operating system: Windows 10 19042.928
Architecture: x86_64
afonso360 labeled issue #2906:
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 get wrongly lowered to i128's.
.clif
Test Casetest 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: e676589b0c6e8228c421e18249d4635eb6c4bbe4 (main as of writing this)
Operating system: Windows 10 19042.928
Architecture: x86_64
afonso360 edited issue #2906:
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 get wrongly lowered to i128's.
.clif
Test Casetest 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: e676589b0c6e8228c421e18249d4635eb6c4bbe4 (main as of writing this)
Operating system: Windows 10 19042.928
Architecture: x86_64
afonso360 edited issue #2906:
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 Casetest 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: e676589b0c6e8228c421e18249d4635eb6c4bbe4 (main as of writing this)
Operating system: Windows 10 19042.928
Architecture: x86_64
bjorn3 commented on issue #2906:
I am suprised that the new backend supports
iconst.i128
at all. I useiconst.i64
+iconcat
for constructing i128 values in cg_clif.
abrown commented on issue #2906:
I was trying to refactor the handling of immediates over in #2468, mainly from the vector perspective, but I think this could be fixed there as well. Unfortunately, I let that PR languish for a few months so I will have to revive it to fix this, unless someone here wants to pick it up.
afonso360 commented on issue #2906:
Let me try to pick that up. Lets see how it goes
afonso360 commented on issue #2906:
Fixed in #5075
afonso360 closed issue #2906:
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 Casetest 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: e676589b0c6e8228c421e18249d4635eb6c4bbe4 (main as of writing this)
Operating system: Windows 10 19042.928
Architecture: x86_64
Last updated: Nov 22 2024 at 16:03 UTC