cfallin commented on issue #1106:
@bjorn3 I suspect this may be fixed now with the new backend, can you verify?
bjorn3 commented on issue #1106:
function %foo() -> b1 { block0: v0 = iconst.i8 -128 v1 = iconst.i8 -128 v2 = icmp ne v0, v1 return v2 } ; run: %foo() == false
now works on x86_64. It compiles to
0: 55 push rbp 1: 48 89 e5 mov rbp, rsp 4: bf 80 ff ff ff mov edi, 0xffffff80 9: 40 80 ff 80 cmp dil, 0x80 d: 40 0f 95 c0 setne al 11: 48 89 ec mov rsp, rbp 14: 5d pop rbp 15: c3 ret
And so does
function %foo() -> b1 { block0: v0 = iconst.i8 128 v1 = iconst.i8 -128 v2 = icmp ne v0, v1 return v2 } ; run: %foo() == false
which compiles to
0: 55 push rbp 1: 48 89 e5 mov rbp, rsp 4: bf 80 00 00 00 mov edi, 0x80 9: 40 80 ff 80 cmp dil, 0x80 d: 40 0f 95 c0 setne al 11: 48 89 ec mov rsp, rbp 14: 5d pop rbp 15: c3 ret
Both are expected.
bjorn3 closed issue #1106:
For example
v0 = iconst.i8 -128 v1 = iconst.i8 -128 v2 = icmp ne v0, v1
gets turned into:
v7 = iconst.i32 -128 v0 = ireduce.i8 v7 v9 = uextend.i32 v0 v2 = icmp_imm ne v9, -128
Which is equal to:
v9 = iconst.i32 128 v2 = icmp_imm ne v9, -128
That is obviously false.
Last updated: Dec 23 2024 at 13:07 UTC