Stream: git-wasmtime

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


view this post on Zulip Wasmtime GitHub notifications bot (Sep 20 2022 at 18:55):

afonso360 opened issue #4934:

:wave: Hey,

This came up when trying to fuzz #4884 on AArch64

.clif Test Case

So this is a bunch of separate cases, I can split it into multiple issues if you'd like:

<details>
<summary>fcvt_to_uint</summary>

test run
set enable_llvm_abi_extensions
target x86_64

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

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

</details>

<details>
<summary>fcvt_to_sint</summary>

test run
set enable_llvm_abi_extensions
target x86_64

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

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

</details>

<details>
<summary>fcvt_to_uint_sat</summary>

test run
set enable_llvm_abi_extensions
target x86_64

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

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

</details>

<details>
<summary>fcvt_to_sint_sat</summary>

test run
set enable_llvm_abi_extensions
target x86_64

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

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

</details>

Steps to Reproduce

Expected Results

The above tests to pass.

Actual Results

     Running `/home/ubuntu/git/wasmtime/target/debug/clif-util test ./lmao.clif`
thread 'worker #1' panicked at 'internal error: entered unreachable code: implemented in ISLE: inst = `v1 = fcvt_to_sint_sat.i128 v0`, type = `Some(types::I128)`', cranelift/codegen/src/isa/aarch64/lower_inst.rs:40:9
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
 ERROR cranelift_filetests::concurrent > FAIL: panicked in worker #1: internal error: entered unreachable code: implemented in ISLE: inst = `v1 = fcvt_to_sint_sat.i128 v0`, type = `Some(types::I128)`
FAIL ./lmao.clif: panicked in worker #1: internal error: entered unreachable code: implemented in ISLE: inst = `v1 = fcvt_to_sint_sat.i128 v0`, type = `Some(types::I128)`
1 tests
Error: 1 failure

This fails in the first function but all the functions in all test cases crash with a similar error.

Versions and Environment

Cranelift version or commit: main
Operating system: Linux
Architecture: AArch64

Extra Info

cg_clif works around this by directly emitting a libcall: https://github.com/bjorn3/rustc_codegen_cranelift/blob/fa7660440b2581c4c57d896d50e76da1515de6df/src/cast.rs#L87-L113

view this post on Zulip Wasmtime GitHub notifications bot (Sep 20 2022 at 18:55):

afonso360 labeled issue #4934:

:wave: Hey,

This came up when trying to fuzz #4884 on AArch64

.clif Test Case

So this is a bunch of separate cases, I can split it into multiple issues if you'd like:

<details>
<summary>fcvt_to_uint</summary>

test run
set enable_llvm_abi_extensions
target x86_64

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

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

</details>

<details>
<summary>fcvt_to_sint</summary>

test run
set enable_llvm_abi_extensions
target x86_64

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

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

</details>

<details>
<summary>fcvt_to_uint_sat</summary>

test run
set enable_llvm_abi_extensions
target x86_64

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

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

</details>

<details>
<summary>fcvt_to_sint_sat</summary>

test run
set enable_llvm_abi_extensions
target x86_64

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

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

</details>

Steps to Reproduce

Expected Results

The above tests to pass.

Actual Results

     Running `/home/ubuntu/git/wasmtime/target/debug/clif-util test ./lmao.clif`
thread 'worker #1' panicked at 'internal error: entered unreachable code: implemented in ISLE: inst = `v1 = fcvt_to_sint_sat.i128 v0`, type = `Some(types::I128)`', cranelift/codegen/src/isa/aarch64/lower_inst.rs:40:9
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
 ERROR cranelift_filetests::concurrent > FAIL: panicked in worker #1: internal error: entered unreachable code: implemented in ISLE: inst = `v1 = fcvt_to_sint_sat.i128 v0`, type = `Some(types::I128)`
FAIL ./lmao.clif: panicked in worker #1: internal error: entered unreachable code: implemented in ISLE: inst = `v1 = fcvt_to_sint_sat.i128 v0`, type = `Some(types::I128)`
1 tests
Error: 1 failure

This fails in the first function but all the functions in all test cases crash with a similar error.

Versions and Environment

Cranelift version or commit: main
Operating system: Linux
Architecture: AArch64

Extra Info

cg_clif works around this by directly emitting a libcall: https://github.com/bjorn3/rustc_codegen_cranelift/blob/fa7660440b2581c4c57d896d50e76da1515de6df/src/cast.rs#L87-L113

view this post on Zulip Wasmtime GitHub notifications bot (Sep 20 2022 at 18:55):

afonso360 labeled issue #4934:

:wave: Hey,

This came up when trying to fuzz #4884 on AArch64

.clif Test Case

So this is a bunch of separate cases, I can split it into multiple issues if you'd like:

<details>
<summary>fcvt_to_uint</summary>

test run
set enable_llvm_abi_extensions
target x86_64

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

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

</details>

<details>
<summary>fcvt_to_sint</summary>

test run
set enable_llvm_abi_extensions
target x86_64

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

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

</details>

<details>
<summary>fcvt_to_uint_sat</summary>

test run
set enable_llvm_abi_extensions
target x86_64

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

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

</details>

<details>
<summary>fcvt_to_sint_sat</summary>

test run
set enable_llvm_abi_extensions
target x86_64

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

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

</details>

Steps to Reproduce

Expected Results

The above tests to pass.

Actual Results

     Running `/home/ubuntu/git/wasmtime/target/debug/clif-util test ./lmao.clif`
thread 'worker #1' panicked at 'internal error: entered unreachable code: implemented in ISLE: inst = `v1 = fcvt_to_sint_sat.i128 v0`, type = `Some(types::I128)`', cranelift/codegen/src/isa/aarch64/lower_inst.rs:40:9
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
 ERROR cranelift_filetests::concurrent > FAIL: panicked in worker #1: internal error: entered unreachable code: implemented in ISLE: inst = `v1 = fcvt_to_sint_sat.i128 v0`, type = `Some(types::I128)`
FAIL ./lmao.clif: panicked in worker #1: internal error: entered unreachable code: implemented in ISLE: inst = `v1 = fcvt_to_sint_sat.i128 v0`, type = `Some(types::I128)`
1 tests
Error: 1 failure

This fails in the first function but all the functions in all test cases crash with a similar error.

Versions and Environment

Cranelift version or commit: main
Operating system: Linux
Architecture: AArch64

Extra Info

cg_clif works around this by directly emitting a libcall: https://github.com/bjorn3/rustc_codegen_cranelift/blob/fa7660440b2581c4c57d896d50e76da1515de6df/src/cast.rs#L87-L113

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

akirilov-arm labeled issue #4934:

:wave: Hey,

This came up when trying to fuzz #4884 on AArch64

.clif Test Case

So this is a bunch of separate cases, I can split it into multiple issues if you'd like:

<details>
<summary>fcvt_to_uint</summary>

test run
set enable_llvm_abi_extensions
target x86_64

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

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

</details>

<details>
<summary>fcvt_to_sint</summary>

test run
set enable_llvm_abi_extensions
target x86_64

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

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

</details>

<details>
<summary>fcvt_to_uint_sat</summary>

test run
set enable_llvm_abi_extensions
target x86_64

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

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

</details>

<details>
<summary>fcvt_to_sint_sat</summary>

test run
set enable_llvm_abi_extensions
target x86_64

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

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

</details>

Steps to Reproduce

Expected Results

The above tests to pass.

Actual Results

     Running `/home/ubuntu/git/wasmtime/target/debug/clif-util test ./lmao.clif`
thread 'worker #1' panicked at 'internal error: entered unreachable code: implemented in ISLE: inst = `v1 = fcvt_to_sint_sat.i128 v0`, type = `Some(types::I128)`', cranelift/codegen/src/isa/aarch64/lower_inst.rs:40:9
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
 ERROR cranelift_filetests::concurrent > FAIL: panicked in worker #1: internal error: entered unreachable code: implemented in ISLE: inst = `v1 = fcvt_to_sint_sat.i128 v0`, type = `Some(types::I128)`
FAIL ./lmao.clif: panicked in worker #1: internal error: entered unreachable code: implemented in ISLE: inst = `v1 = fcvt_to_sint_sat.i128 v0`, type = `Some(types::I128)`
1 tests
Error: 1 failure

This fails in the first function but all the functions in all test cases crash with a similar error.

Versions and Environment

Cranelift version or commit: main
Operating system: Linux
Architecture: AArch64

Extra Info

cg_clif works around this by directly emitting a libcall: https://github.com/bjorn3/rustc_codegen_cranelift/blob/fa7660440b2581c4c57d896d50e76da1515de6df/src/cast.rs#L87-L113


Last updated: Nov 22 2024 at 16:03 UTC