Stream: git-cranelift

Topic: cranelift / Issue #1117 Tracking issue for booleans


view this post on Zulip GitHub (Jan 03 2020 at 08:07):

EliSnow commented on Issue #1117:

bxor_not seems to also not work with a boolean value

view this post on Zulip GitHub (Feb 28 2020 at 23:27):

alexcrichton transferred Issue #1117:

See vaguely #922, #466, and https://github.com/jyn514/rcc/issues/92. An easy way to do this might be to convert from bool -> int -> bool and back as suggested in https://github.com/CraneStation/cranelift/issues/922#issuecomment-523931097.

function u0:0() -> i32 system_v {
ebb0:
    v0 = iconst.i32 1
    v1 = icmp_imm ne v0, 0
    v2 = bnot v1
    v3 = bint.i32 v2
    return v3
}

codegen error: Compilation error: Verifier errors:

- inst2: v2 is a real GPR value defined by a ghost instruction
function u0:0() system_v {
ebb0:
    v0 = iconst.i8 0
    v1 = iconst.i8 0
    v2 = icmp ne v0, v1
    brz v2, ebb1
    return

ebb1:
    return
}

codegen error: Compilation error: Verifier errors:

- inst3: Branch must have an encoding
function u0:0() -> i32 system_v {
    ss0 = explicit_slot 1

ebb0:
    v0 = bconst.b1 true
    v1 = stack_addr.i64 ss0
    store v0, v1
    v2 = iconst.i32 0
    return v2
}

fatal: - inst2: has an invalid controlling type b1
function u0:0() -> i32 system_v {
    ss0 = explicit_slot 1

ebb0:
    v0 = stack_addr.i64 ss0
    v1 = bconst.b1 true
    v2 = load.b1 v0
    v3 = bor v2, v1
    store v3, v0
    v4 = iconst.i32 0
    return v4
}

fatal: - inst2: has an invalid controlling type b1

- inst4: has an invalid controlling type b1

Last updated: Dec 23 2024 at 14:03 UTC