wasmtime icon indicating copy to clipboard operation
wasmtime copied to clipboard

egraph opts: fix uextend-of-i32.

Open cfallin opened this issue 3 years ago • 2 comments
trafficstars

This is a simple error in the const-prop rules: uextend was not masking iconst's u64 immediate when extending from i32 to i64. Arguably an iconst.i32 should not have nonzero bits in the upper 32 of its immediate, but that's a separate design question. For now, if our invariant is that the upper bits are ignored, then it is required to mask the bits when const-evaling a uextend.

Fixes #5047.

cfallin avatar Oct 17 '22 06:10 cfallin

cc @afonso360

cfallin avatar Oct 17 '22 06:10 cfallin

Arguably an iconst.i32 should not have nonzero bits in the upper 32 of its immediate

Iconst uses the signed Imm64 type, so it is not weird to see a sign extended iconst.

bjorn3 avatar Oct 17 '22 07:10 bjorn3