Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cranelift: SIMD icmp unsigned comparisions for i64x2 are not implemented on x86_64 #5529

Closed
afonso360 opened this issue Jan 5, 2023 · 1 comment
Labels
bug Incorrect behavior in the current implementation that needs fixing cranelift:area:x64 Issues related to x64 codegen cranelift Issues related to the Cranelift code generator

Comments

@afonso360
Copy link
Contributor

afonso360 commented Jan 5, 2023

馃憢 Hey,

It looks like we have a hole in our lowerings where all unsigned operator are unimplemented only for i64x2 types. (they work for i32x4/i16x8/i8x16).

.clif Test Case

test run
target x86_64

function %simd_icmp_uge_i64(i64x2, i64x2) -> i64x2 {
block0(v0: i64x2, v1: i64x2):
    v2 = icmp uge v0, v1
    return v2
}
; run: %simd_icmp_uge_i64([0 1], [0 0]) == [-1 -1]
; run: %simd_icmp_uge_i64([-1 0], [-1 1]) == [-1 0]
; run: %simd_icmp_uge_i64([-5 1], [-1 -1]) == [0 0]
; run: %simd_icmp_uge_i64([0 0], [0 0]) == [-1 -1]


function %simd_icmp_ugt_i64(i64x2, i64x2) -> i64x2 {
block0(v0: i64x2, v1: i64x2):
    v2 = icmp ugt v0, v1
    return v2
}
; run: %simd_icmp_ugt_i64([0 1], [0 0]) == [0 -1]
; run: %simd_icmp_ugt_i64([-1 0], [-1 1]) == [0 0]
; run: %simd_icmp_ugt_i64([-5 1], [-1 -1]) == [0 0]
; run: %simd_icmp_ugt_i64([0 0], [0 0]) == [0 0]

function %simd_icmp_ule_i64(i64x2, i64x2) -> i64x2 {
block0(v0: i64x2, v1: i64x2):
    v2 = icmp ule v0, v1
    return v2
}
; run: %simd_icmp_ule_i64([0 1], [0 0]) == [-1 0]
; run: %simd_icmp_ule_i64([-1 0], [-1 1]) == [-1 -1]
; run: %simd_icmp_ule_i64([-5 1], [-1 -1]) == [-1 -1]
; run: %simd_icmp_ule_i64([0 0], [0 0]) == [-1 -1]

function %simd_icmp_ult_i64(i64x2, i64x2) -> i64x2 {
block0(v0: i64x2, v1: i64x2):
    v2 = icmp ult v0, v1
    return v2
}
; run: %simd_icmp_ult_i64([0 1], [0 0]) == [0 0]
; run: %simd_icmp_ult_i64([-1 0], [-1 1]) == [0 -1]
; run: %simd_icmp_ult_i64([-5 1], [-1 -1]) == [-1 -1]
; run: %simd_icmp_ult_i64([0 0], [0 0]) == [0 0]

Steps to Reproduce

  • clif-util test ./the-above.clif

Expected Results

The tests to pass

Actual Results

thread 'worker #1' panicked at 'internal error: entered unreachable code: no rule matched for term x64_pmaxu at src/isa/x64/inst.isle line 2495; should it be partial?', /home/afonso/git/wasmtime/target/debug/build/cranelift-codegen-cafe59ca8460988e/out/isle_x64.rs:4755:12
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: no rule matched for term x64_pmaxu at src/isa/x64/inst.isle line 2495; should it be partial?
FAIL ./lmao.clif: panicked in worker #1: internal error: entered unreachable code: no rule matched for term x64_pmaxu at src/isa/x64/inst.isle line 2495; should it be partial?
1 tests
Error: 1 failure

Versions and Environment

Cranelift version or commit: Main
Operating system: Linux
Architecture: x86_64

Extra Info

These tests already exist in our test suite.

@afonso360 afonso360 added bug Incorrect behavior in the current implementation that needs fixing cranelift Issues related to the Cranelift code generator labels Jan 5, 2023
@afonso360 afonso360 changed the title Cranelift: SIMD icmp unsigned comparisions are not implemented on x86_64 Cranelift: SIMD icmp unsigned comparisions for i64x2 are not implemented on x86_64 Jan 5, 2023
@alexcrichton alexcrichton added the cranelift:area:x64 Issues related to x64 codegen label Jan 17, 2023
@alexcrichton
Copy link
Member

These were implemented in #6291 and I enabled some tests there for this, so I'm going to close this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Incorrect behavior in the current implementation that needs fixing cranelift:area:x64 Issues related to x64 codegen cranelift Issues related to the Cranelift code generator
Projects
None yet
Development

No branches or pull requests

2 participants