-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Closed
Closed
Copy link
Labels
bugIncorrect behavior in the current implementation that needs fixingIncorrect behavior in the current implementation that needs fixingcraneliftIssues related to the Cranelift code generatorIssues related to the Cranelift code generator
Description
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-codegen
Expected 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
islec produces 0xffffffffffffffffffffffffffffffff_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
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugIncorrect behavior in the current implementation that needs fixingIncorrect behavior in the current implementation that needs fixingcraneliftIssues related to the Cranelift code generatorIssues related to the Cranelift code generator