Stream: git-wasmtime

Topic: wasmtime / issue #3334 Cranelift: SIMD `icmp` fails to co...


view this post on Zulip Wasmtime GitHub notifications bot (Sep 11 2021 at 16:57):

afonso360 opened issue #3334:

Hey,

It looks like SIMD icmp is failing to compile on x64. I don't really know how this is happening since we must use this on wasm for simd icmps, right? The test below is only for icmp eq, but this fails for any condition code.

.clif Test Case

test run
target x86_64 machinst

function %simd_icmp_eq_i8(i8x16, i8x16) -> b8x16 {
block0(v0: i8x16, v1: i8x16):
    v2 = icmp eq v0, v1
    return v2
}
; run: %simd_icmp_eq_i8([1 0 -1 1 1 1 1 1 1 1 1 1 1 1 1 1], [1 0 -1 0 0 0 0 0 0 0 0 0 0 0 0 0]) == [true true true false false false false false false false false false false false false false]

function %simd_icmp_eq_i16(i16x8, i16x8) -> b16x8 {
block0(v0: i16x8, v1: i16x8):
    v2 = icmp eq v0, v1
    return v2
}
; run: %simd_icmp_eq_i16([1 0 -1 1 1 1 1 1], [1 0 -1 0 0 0 0 0]) == [true true true false false false false false]

function %simd_icmp_eq_i32(i32x4, i32x4) -> b32x4 {
block0(v0: i32x4, v1: i32x4):
    v2 = icmp eq v0, v1
    return v2
}
; run: %simd_icmp_eq_i32([1 0 -1 1], [1 0 -1 0]) == [true true true false]

function %simd_icmp_eq_i64(i64x2, i64x2) -> b64x2 {
block0(v0: i64x2, v1: i64x2):
    v2 = icmp eq v0, v1
    return v2
}
; run: %simd_icmp_eq_i64([10 0], [1 0]) == [false true]
; run: %simd_icmp_eq_i64([-1 1], [-1 0]) == [true false]

Steps to Reproduce

clif-util test ./the-above.clif

Expected Results

The test to pass

Actual Results

     Running `C:\Users\Afonso\CLionProjects\wasmtime\target\debug\clif-util.exe test .\filetests\filetests\runtests\simd-icmp-eq.clif`
skipped .\filetests\filetests\runtests\simd-icmp-eq.clif: host can't run Aarch64(Aarch64) programs
thread 'worker #0' panicked at 'assertion failed: rc_dst == rc_src', cranelift\codegen\src\isa\x64\inst\mod.rs:2676:9
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
FAIL .\filetests\filetests\runtests\simd-icmp-eq.clif: panicked in worker #0: assertion failed: rc_dst == rc_src
1 tests
Error: 1 failure

Versions and Environment

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

Extra Info

A icmp SIMD test suite was added in #3332

view this post on Zulip Wasmtime GitHub notifications bot (Sep 11 2021 at 16:57):

afonso360 labeled issue #3334:

Hey,

It looks like SIMD icmp is failing to compile on x64. I don't really know how this is happening since we must use this on wasm for simd icmps, right? The test below is only for icmp eq, but this fails for any condition code.

.clif Test Case

test run
target x86_64 machinst

function %simd_icmp_eq_i8(i8x16, i8x16) -> b8x16 {
block0(v0: i8x16, v1: i8x16):
    v2 = icmp eq v0, v1
    return v2
}
; run: %simd_icmp_eq_i8([1 0 -1 1 1 1 1 1 1 1 1 1 1 1 1 1], [1 0 -1 0 0 0 0 0 0 0 0 0 0 0 0 0]) == [true true true false false false false false false false false false false false false false]

function %simd_icmp_eq_i16(i16x8, i16x8) -> b16x8 {
block0(v0: i16x8, v1: i16x8):
    v2 = icmp eq v0, v1
    return v2
}
; run: %simd_icmp_eq_i16([1 0 -1 1 1 1 1 1], [1 0 -1 0 0 0 0 0]) == [true true true false false false false false]

function %simd_icmp_eq_i32(i32x4, i32x4) -> b32x4 {
block0(v0: i32x4, v1: i32x4):
    v2 = icmp eq v0, v1
    return v2
}
; run: %simd_icmp_eq_i32([1 0 -1 1], [1 0 -1 0]) == [true true true false]

function %simd_icmp_eq_i64(i64x2, i64x2) -> b64x2 {
block0(v0: i64x2, v1: i64x2):
    v2 = icmp eq v0, v1
    return v2
}
; run: %simd_icmp_eq_i64([10 0], [1 0]) == [false true]
; run: %simd_icmp_eq_i64([-1 1], [-1 0]) == [true false]

Steps to Reproduce

clif-util test ./the-above.clif

Expected Results

The test to pass

Actual Results

     Running `C:\Users\Afonso\CLionProjects\wasmtime\target\debug\clif-util.exe test .\filetests\filetests\runtests\simd-icmp-eq.clif`
skipped .\filetests\filetests\runtests\simd-icmp-eq.clif: host can't run Aarch64(Aarch64) programs
thread 'worker #0' panicked at 'assertion failed: rc_dst == rc_src', cranelift\codegen\src\isa\x64\inst\mod.rs:2676:9
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
FAIL .\filetests\filetests\runtests\simd-icmp-eq.clif: panicked in worker #0: assertion failed: rc_dst == rc_src
1 tests
Error: 1 failure

Versions and Environment

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

Extra Info

A icmp SIMD test suite was added in #3332

view this post on Zulip Wasmtime GitHub notifications bot (Sep 11 2021 at 16:57):

afonso360 labeled issue #3334:

Hey,

It looks like SIMD icmp is failing to compile on x64. I don't really know how this is happening since we must use this on wasm for simd icmps, right? The test below is only for icmp eq, but this fails for any condition code.

.clif Test Case

test run
target x86_64 machinst

function %simd_icmp_eq_i8(i8x16, i8x16) -> b8x16 {
block0(v0: i8x16, v1: i8x16):
    v2 = icmp eq v0, v1
    return v2
}
; run: %simd_icmp_eq_i8([1 0 -1 1 1 1 1 1 1 1 1 1 1 1 1 1], [1 0 -1 0 0 0 0 0 0 0 0 0 0 0 0 0]) == [true true true false false false false false false false false false false false false false]

function %simd_icmp_eq_i16(i16x8, i16x8) -> b16x8 {
block0(v0: i16x8, v1: i16x8):
    v2 = icmp eq v0, v1
    return v2
}
; run: %simd_icmp_eq_i16([1 0 -1 1 1 1 1 1], [1 0 -1 0 0 0 0 0]) == [true true true false false false false false]

function %simd_icmp_eq_i32(i32x4, i32x4) -> b32x4 {
block0(v0: i32x4, v1: i32x4):
    v2 = icmp eq v0, v1
    return v2
}
; run: %simd_icmp_eq_i32([1 0 -1 1], [1 0 -1 0]) == [true true true false]

function %simd_icmp_eq_i64(i64x2, i64x2) -> b64x2 {
block0(v0: i64x2, v1: i64x2):
    v2 = icmp eq v0, v1
    return v2
}
; run: %simd_icmp_eq_i64([10 0], [1 0]) == [false true]
; run: %simd_icmp_eq_i64([-1 1], [-1 0]) == [true false]

Steps to Reproduce

clif-util test ./the-above.clif

Expected Results

The test to pass

Actual Results

     Running `C:\Users\Afonso\CLionProjects\wasmtime\target\debug\clif-util.exe test .\filetests\filetests\runtests\simd-icmp-eq.clif`
skipped .\filetests\filetests\runtests\simd-icmp-eq.clif: host can't run Aarch64(Aarch64) programs
thread 'worker #0' panicked at 'assertion failed: rc_dst == rc_src', cranelift\codegen\src\isa\x64\inst\mod.rs:2676:9
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
FAIL .\filetests\filetests\runtests\simd-icmp-eq.clif: panicked in worker #0: assertion failed: rc_dst == rc_src
1 tests
Error: 1 failure

Versions and Environment

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

Extra Info

A icmp SIMD test suite was added in #3332

view this post on Zulip Wasmtime GitHub notifications bot (Nov 12 2021 at 04:04):

jlb6740 commented on issue #3334:

Hi @afonso360 The error indicates an attempt to run an Aarch64 program?

Running `C:\Users\Afonso\CLionProjects\wasmtime\target\debug\clif-util.exe test .\filetests\filetests\runtests\simd-icmp-eq.clif`
skipped .\filetests\filetests\runtests\simd-icmp-eq.clif: host can't run Aarch64(Aarch64) programs

Do you know why Aarch64 is being referenced in the error message if this is an x64 file test?

view this post on Zulip Wasmtime GitHub notifications bot (Nov 12 2021 at 10:23):

afonso360 commented on issue #3334:

Yeah, when I introduced that test file I also had a target aarch64, which also failed. That's why the log references aarch64 as a skipped test.

view this post on Zulip Wasmtime GitHub notifications bot (Jan 05 2023 at 17:19):

elliottt closed issue #3334:

Hey,

It looks like SIMD icmp is failing to compile on x64. I don't really know how this is happening since we must use this on wasm for simd icmps, right? The test below is only for icmp eq, but this fails for any condition code.

.clif Test Case

test run
target x86_64 machinst

function %simd_icmp_eq_i8(i8x16, i8x16) -> b8x16 {
block0(v0: i8x16, v1: i8x16):
    v2 = icmp eq v0, v1
    return v2
}
; run: %simd_icmp_eq_i8([1 0 -1 1 1 1 1 1 1 1 1 1 1 1 1 1], [1 0 -1 0 0 0 0 0 0 0 0 0 0 0 0 0]) == [true true true false false false false false false false false false false false false false]

function %simd_icmp_eq_i16(i16x8, i16x8) -> b16x8 {
block0(v0: i16x8, v1: i16x8):
    v2 = icmp eq v0, v1
    return v2
}
; run: %simd_icmp_eq_i16([1 0 -1 1 1 1 1 1], [1 0 -1 0 0 0 0 0]) == [true true true false false false false false]

function %simd_icmp_eq_i32(i32x4, i32x4) -> b32x4 {
block0(v0: i32x4, v1: i32x4):
    v2 = icmp eq v0, v1
    return v2
}
; run: %simd_icmp_eq_i32([1 0 -1 1], [1 0 -1 0]) == [true true true false]

function %simd_icmp_eq_i64(i64x2, i64x2) -> b64x2 {
block0(v0: i64x2, v1: i64x2):
    v2 = icmp eq v0, v1
    return v2
}
; run: %simd_icmp_eq_i64([10 0], [1 0]) == [false true]
; run: %simd_icmp_eq_i64([-1 1], [-1 0]) == [true false]

Steps to Reproduce

clif-util test ./the-above.clif

Expected Results

The test to pass

Actual Results

     Running `C:\Users\Afonso\CLionProjects\wasmtime\target\debug\clif-util.exe test .\filetests\filetests\runtests\simd-icmp-eq.clif`
skipped .\filetests\filetests\runtests\simd-icmp-eq.clif: host can't run Aarch64(Aarch64) programs
thread 'worker #0' panicked at 'assertion failed: rc_dst == rc_src', cranelift\codegen\src\isa\x64\inst\mod.rs:2676:9
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
FAIL .\filetests\filetests\runtests\simd-icmp-eq.clif: panicked in worker #0: assertion failed: rc_dst == rc_src
1 tests
Error: 1 failure

Versions and Environment

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

Extra Info

A icmp SIMD test suite was added in #3332


Last updated: Dec 23 2024 at 12:05 UTC