Stream: git-wasmtime

Topic: wasmtime / issue #12757 Cranelift: ISLE compiler should r...


view this post on Zulip Wasmtime GitHub notifications bot (Mar 11 2026 at 09:01):

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

Expected Results

  1. The ISLE compiler MUST NOT produce invalid Rust code.
  2. As -1 is in place of u64 (iconst_u <Type> <u64>), islec must either

    • Reject the rule and raise ISLE compilation error, or
    • Translate -1 as a u64 constant (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

view this post on Zulip Wasmtime GitHub notifications bot (Mar 11 2026 at 09:01):

bongjunj added the bug label to Issue #12757.

view this post on Zulip Wasmtime GitHub notifications bot (Mar 11 2026 at 09:01):

bongjunj added the cranelift label to Issue #12757.

view this post on Zulip Wasmtime GitHub notifications bot (Mar 11 2026 at 09:18):

bongjunj commented on issue #12757:

https://github.com/bytecodealliance/wasmtime/blob/511638f539f1914c5194fc6db286c099f3450ec3/cranelift/codegen/src/isa/x64/lower.isle#L4557

-1 in place of u128 seems like an allowed behavior.

However, -1 in place of u64 is causing compilation failure (due to invalid Rust code generated).

view this post on Zulip Wasmtime GitHub notifications bot (Mar 11 2026 at 14:32):

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

Expected Results

  1. The ISLE compiler MUST NOT produce invalid Rust code.
  2. As -1 is in place of u64 (iconst_u <Type> <u64>), islec must either

    • Reject the rule and raise ISLE compilation error, or
    • Translate -1 as a u64 constant (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


Last updated: Mar 23 2026 at 16:19 UTC