Stream: git-wasmtime

Topic: wasmtime / Issue #1095 iconst + icmp -> icmp_imm incorrec...


view this post on Zulip Wasmtime GitHub notifications bot (May 12 2020 at 20:46):

fitzgen commented on Issue #1095:

I'll work on this.

view this post on Zulip Wasmtime GitHub notifications bot (May 12 2020 at 20:47):

fitzgen assigned Issue #1095:

Eg

ebb0(v0: i8):
    v1 = iconst.i8 255 ; -1i8 as u8
    v2 = icmp sge v0, v1; true for v0 s> -1

gets converted to

ebb0(v0: i8):
    v2 = icmp_imm sge v0, 255 ; never true, as an i8 is never bigger than 127

The optimization should be prevented for out of bound integers, or it should convert the 255 to -1.

cc https://github.com/bjorn3/rustc_codegen_cranelift/commit/b0ecbf14a23a301183ff194ca97a62e23e2cc6f7

view this post on Zulip Wasmtime GitHub notifications bot (May 14 2020 at 17:09):

fitzgen closed Issue #1095 (assigned to fitzgen):

Eg

ebb0(v0: i8):
    v1 = iconst.i8 255 ; -1i8 as u8
    v2 = icmp sge v0, v1; true for v0 s> -1

gets converted to

ebb0(v0: i8):
    v2 = icmp_imm sge v0, 255 ; never true, as an i8 is never bigger than 127

The optimization should be prevented for out of bound integers, or it should convert the 255 to -1.

cc https://github.com/bjorn3/rustc_codegen_cranelift/commit/b0ecbf14a23a301183ff194ca97a62e23e2cc6f7


Last updated: Dec 23 2024 at 12:05 UTC