Stream: git-wasmtime

Topic: wasmtime / issue #4897 Cranelift: `fcvt_to_{u,s}int` not ...


view this post on Zulip Wasmtime GitHub notifications bot (Sep 12 2022 at 10:05):

afonso360 edited issue #4897:

:wave: Hey,

This came up when trying to fuzz #4884

.clif Test Case

test interpret
test run
target x86_64

function %a(f32) -> i8 {
block0(v0: f32):
    v1 = fcvt_to_uint.i8 v0
    return v1
}
; run: %a(0.0) == 0

function %b(f32) -> i16 {
block0(v0: f32):
    v1 = fcvt_to_uint.i16 v0
    return v1
}
; run: %b(0.0) == 0

function %c(f64) -> i8 {
block0(v0: f64):
    v1 = fcvt_to_uint.i8 v0
    return v1
}
; run: %c(0.0) == 0

function %d(f64) -> i16 {
block0(v0: f64):
    v1 = fcvt_to_uint.i16 v0
    return v1
}
; run: %d(0.0) == 0

Steps to Reproduce

Expected Results

The above tests to pass

Actual Results

thread 'worker #0' panicked at 'assertion failed: dst_size.is_one_of(&[OperandSize::Size32, OperandSize::Size64])', cranelift\codegen\src\isa\x64\inst\mod.rs:331:9
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
 ERROR cranelift_filetests::concurrent > FAIL: panicked in worker #0: assertion failed: dst_size.is_one_of(&[OperandSize::Size32, OperandSize::Size64])
FAIL .\lmao.clif: panicked in worker #0: assertion failed: dst_size.is_one_of(&[OperandSize::Size32, OperandSize::Size64])
1 tests
Error: 1 failure

Versions and Environment

Cranelift version or commit: main
Operating system: Windows
Architecture: x64

view this post on Zulip Wasmtime GitHub notifications bot (Sep 12 2022 at 10:06):

afonso360 edited issue #4897:

:wave: Hey,

This came up when trying to fuzz #4884

.clif Test Case

test interpret
test run
target x86_64

function %a(f32) -> i8 {
block0(v0: f32):
    v1 = fcvt_to_uint.i8 v0
    return v1
}
; run: %a(0.0) == 0

function %b(f32) -> i16 {
block0(v0: f32):
    v1 = fcvt_to_uint.i16 v0
    return v1
}
; run: %b(0.0) == 0

function %c(f64) -> i8 {
block0(v0: f64):
    v1 = fcvt_to_uint.i8 v0
    return v1
}
; run: %c(0.0) == 0

function %d(f64) -> i16 {
block0(v0: f64):
    v1 = fcvt_to_uint.i16 v0
    return v1
}
; run: %d(0.0) == 0


test interpret
test run
target x86_64

function %signed_a(f32) -> i8 {
block0(v0: f32):
    v1 = fcvt_to_sint.i8 v0
    return v1
}
; run: %signed_a(0.0) == 0

function %signed_b(f32) -> i16 {
block0(v0: f32):
    v1 = fcvt_to_sint.i16 v0
    return v1
}
; run: %signed_b(0.0) == 0

function %signed_c(f64) -> i8 {
block0(v0: f64):
    v1 = fcvt_to_sint.i8 v0
    return v1
}
; run: %signed_c(0.0) == 0

function %signed_d(f64) -> i16 {
block0(v0: f64):
    v1 = fcvt_to_sint.i16 v0
    return v1
}
; run: %signed_d(0.0) == 0

Steps to Reproduce

Expected Results

The above tests to pass

Actual Results

thread 'worker #0' panicked at 'assertion failed: dst_size.is_one_of(&[OperandSize::Size32, OperandSize::Size64])', cranelift\codegen\src\isa\x64\inst\mod.rs:331:9
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
 ERROR cranelift_filetests::concurrent > FAIL: panicked in worker #0: assertion failed: dst_size.is_one_of(&[OperandSize::Size32, OperandSize::Size64])
FAIL .\lmao.clif: panicked in worker #0: assertion failed: dst_size.is_one_of(&[OperandSize::Size32, OperandSize::Size64])
1 tests
Error: 1 failure

Versions and Environment

Cranelift version or commit: main
Operating system: Windows
Architecture: x64

view this post on Zulip Wasmtime GitHub notifications bot (Sep 12 2022 at 10:06):

afonso360 edited issue #4897:

:wave: Hey,

This came up when trying to fuzz #4884

.clif Test Case

test interpret
test run
target x86_64

function %a(f32) -> i8 {
block0(v0: f32):
    v1 = fcvt_to_uint.i8 v0
    return v1
}
; run: %a(0.0) == 0

function %b(f32) -> i16 {
block0(v0: f32):
    v1 = fcvt_to_uint.i16 v0
    return v1
}
; run: %b(0.0) == 0

function %c(f64) -> i8 {
block0(v0: f64):
    v1 = fcvt_to_uint.i8 v0
    return v1
}
; run: %c(0.0) == 0

function %d(f64) -> i16 {
block0(v0: f64):
    v1 = fcvt_to_uint.i16 v0
    return v1
}
; run: %d(0.0) == 0

function %signed_a(f32) -> i8 {
block0(v0: f32):
    v1 = fcvt_to_sint.i8 v0
    return v1
}
; run: %signed_a(0.0) == 0

function %signed_b(f32) -> i16 {
block0(v0: f32):
    v1 = fcvt_to_sint.i16 v0
    return v1
}
; run: %signed_b(0.0) == 0

function %signed_c(f64) -> i8 {
block0(v0: f64):
    v1 = fcvt_to_sint.i8 v0
    return v1
}
; run: %signed_c(0.0) == 0

function %signed_d(f64) -> i16 {
block0(v0: f64):
    v1 = fcvt_to_sint.i16 v0
    return v1
}
; run: %signed_d(0.0) == 0

Steps to Reproduce

Expected Results

The above tests to pass

Actual Results

thread 'worker #0' panicked at 'assertion failed: dst_size.is_one_of(&[OperandSize::Size32, OperandSize::Size64])', cranelift\codegen\src\isa\x64\inst\mod.rs:331:9
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
 ERROR cranelift_filetests::concurrent > FAIL: panicked in worker #0: assertion failed: dst_size.is_one_of(&[OperandSize::Size32, OperandSize::Size64])
FAIL .\lmao.clif: panicked in worker #0: assertion failed: dst_size.is_one_of(&[OperandSize::Size32, OperandSize::Size64])
1 tests
Error: 1 failure

Versions and Environment

Cranelift version or commit: main
Operating system: Windows
Architecture: x64

view this post on Zulip Wasmtime GitHub notifications bot (Sep 12 2022 at 10:07):

afonso360 edited issue #4897:

:wave: Hey,

This came up when trying to fuzz #4884

.clif Test Case

test interpret
test run
target x86_64

function %a(f32) -> i8 {
block0(v0: f32):
    v1 = fcvt_to_uint.i8 v0
    return v1
}
; run: %a(0.0) == 0

function %b(f32) -> i16 {
block0(v0: f32):
    v1 = fcvt_to_uint.i16 v0
    return v1
}
; run: %b(0.0) == 0

function %c(f64) -> i8 {
block0(v0: f64):
    v1 = fcvt_to_uint.i8 v0
    return v1
}
; run: %c(0.0) == 0

function %d(f64) -> i16 {
block0(v0: f64):
    v1 = fcvt_to_uint.i16 v0
    return v1
}
; run: %d(0.0) == 0

function %signed_a(f32) -> i8 {
block0(v0: f32):
    v1 = fcvt_to_sint.i8 v0
    return v1
}
; run: %signed_a(0.0) == 0

function %signed_b(f32) -> i16 {
block0(v0: f32):
    v1 = fcvt_to_sint.i16 v0
    return v1
}
; run: %signed_b(0.0) == 0

function %signed_c(f64) -> i8 {
block0(v0: f64):
    v1 = fcvt_to_sint.i8 v0
    return v1
}
; run: %signed_c(0.0) == 0

function %signed_d(f64) -> i16 {
block0(v0: f64):
    v1 = fcvt_to_sint.i16 v0
    return v1
}
; run: %signed_d(0.0) == 0

Steps to Reproduce

Expected Results

The above tests to pass.

Actual Results

thread 'worker #0' panicked at 'assertion failed: dst_size.is_one_of(&[OperandSize::Size32, OperandSize::Size64])', cranelift\codegen\src\isa\x64\inst\mod.rs:331:9
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
 ERROR cranelift_filetests::concurrent > FAIL: panicked in worker #0: assertion failed: dst_size.is_one_of(&[OperandSize::Size32, OperandSize::Size64])
FAIL .\lmao.clif: panicked in worker #0: assertion failed: dst_size.is_one_of(&[OperandSize::Size32, OperandSize::Size64])
1 tests
Error: 1 failure

This fails in %a but all of the functions in that test case crash with a similar error.

Versions and Environment

Cranelift version or commit: main
Operating system: Windows
Architecture: x64

view this post on Zulip Wasmtime GitHub notifications bot (Sep 12 2022 at 10:16):

bjorn3 commented on issue #4897:

Workaround in cg_clif: https://github.com/bjorn3/rustc_codegen_cranelift/blob/fa7660440b2581c4c57d896d50e76da1515de6df/src/cast.rs#L115-L140


Last updated: Nov 22 2024 at 16:03 UTC