bongjunj opened issue #12757:
ISLE test case
(rule (simplify (bor ty (bxor ty (bxor ty (iconst_u ty -1) y) x) y)) (bor ty y (bxor ty x (iconst_u ty -1))))Steps to Reproduce
- Add the file in any mid-end opt file. For example,
cranelift/codegen/src/opts/arithmetic.isle- Build the code generator with
cargo build -p cranelift-codegenExpected Results
- The ISLE compiler MUST NOT produce invalid Rust code.
As
-1is in place ofu64(iconst_u <Type> <u64>),islecmust either
- Reject the rule and raise ISLE compilation error, or
- Translate
-1as au64constant (e.g.,0xffffffffffffffff_u64)Actual Results
islecproduces0xffffffffffffffffffffffffffffffff_u64, and this is an invalid Rust constant literal. As the literal requires 128-bit, and thus it cannot fit into 64-bit datatype.Versions and Environment
Cranelift version or commit: 0.131.0
bongjunj added the bug label to Issue #12757.
bongjunj added the cranelift label to Issue #12757.
bongjunj commented on issue #12757:
-1in place ofu128seems like an allowed behavior.However,
-1in place ofu64is causing compilation failure (due to invalid Rust code generated).
cfallin closed issue #12757:
ISLE test case
(rule (simplify (bor ty (bxor ty (bxor ty (iconst_u ty -1) y) x) y)) (bor ty y (bxor ty x (iconst_u ty -1))))Steps to Reproduce
- Add the file in any mid-end opt file. For example,
cranelift/codegen/src/opts/arithmetic.isle- Build the code generator with
cargo build -p cranelift-codegenExpected Results
- The ISLE compiler MUST NOT produce invalid Rust code.
As
-1is in place ofu64(iconst_u <Type> <u64>),islecmust either
- Reject the rule and raise ISLE compilation error, or
- Translate
-1as au64constant (e.g.,0xffffffffffffffff_u64)Actual Results
islecproduces0xffffffffffffffffffffffffffffffff_u64, and this is an invalid Rust constant literal. As the literal requires 128-bit, and thus it cannot fit into 64-bit datatype.Versions and Environment
Cranelift version or commit: 0.131.0
Last updated: Mar 23 2026 at 16:19 UTC