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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cranelift: sqmul_round_sat.{i16,i32} does not exist for scalars #5923

Closed
afonso360 opened this issue Mar 3, 2023 · 1 comment · Fixed by #5941
Closed

Cranelift: sqmul_round_sat.{i16,i32} does not exist for scalars #5923

afonso360 opened this issue Mar 3, 2023 · 1 comment · Fixed by #5941
Labels
bug Incorrect behavior in the current implementation that needs fixing cranelift Issues related to the Cranelift code generator

Comments

@afonso360
Copy link
Contributor

👋 Hey,

This is probably a docs issue.

The docs for this instruction state that it is "Polymorphic over all integer types (scalar and vector) with 16- or 32-bit numbers.".

But it isn't, and trying to compile it with either i32 / i16 causes a verifier error.

Do we want to enable this instruction for scalars? Or should we update the docs so that they are SIMD only?

.clif Test Case

test run
target x86_64
target aarch64
target s390x

function %a() -> i32 system_v {
block0:
    v0 = iconst.i32 0
    v1 = sqmul_round_sat v0, v0
    return v1
}

; run: %a() == 0

Steps to Reproduce

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

Expected Results

The test to pass.

Actual Results

 ERROR cranelift_filetests::concurrent > FAIL: failed to parse ./lmao.clif
FAIL ./lmao.clif: failed to parse ./lmao.clif

Caused by:
    11: i32 is not a valid typevar for sqmul_round_sat
1 tests
Error: 1 failure

Versions and Environment

Cranelift version or commit: main

Operating system: Linux

Architecture: x86_64

@afonso360 afonso360 added bug Incorrect behavior in the current implementation that needs fixing cranelift Issues related to the Cranelift code generator labels Mar 3, 2023
afonso360 added a commit to afonso360/wasmtime that referenced this issue Mar 3, 2023
@abrown
Copy link
Contributor

abrown commented Mar 6, 2023

I think the conservative thing to do is to restrict this to SIMD types since this is a lowering for i16x8.q15mulr_sat_s (originally added in #3035).

afonso360 added a commit to afonso360/wasmtime that referenced this issue Mar 9, 2023
afonso360 added a commit that referenced this issue Mar 11, 2023
* fuzzgen: Add some SIMD instructions

* fuzzgen: Remove `scalar_to_vector`

Broken in the interpreter #5911

* fuzzgen: Remove SIMD bitcasts

Broken in the interpreter #5915

* fuzzgen: Fix insert lane

* fuzzgen: Remove debug code

* fuzzgen: Remove vall_true

This is broken in the interpreter #5916

* fuzzgen: Disable a few more ops

* fuzzgen: Remove `iadd_pairwise.i64x2`

Turns out it doesen't exist

* fuzzgen: Remove scalar `sqmul_round_sat`

#5923

* fuzzgen: Disable aligned loads to SIMD values

* fuzzgen: Address Review Feedback

Co-Authored-By: Jamey Sharp <jsharp@fastly.com>

* fuzzgen: Rework `cmp` exclusion rules

Co-Authored-By: Jamey Sharp <jsharp@fastly.com>

---------

Co-authored-by: Jamey Sharp <jsharp@fastly.com>
afonso360 added a commit to afonso360/wasmtime that referenced this issue Mar 13, 2023
…alliance#5971)

* fuzzgen: Add some SIMD instructions

* fuzzgen: Remove `scalar_to_vector`

Broken in the interpreter bytecodealliance#5911

* fuzzgen: Remove SIMD bitcasts

Broken in the interpreter bytecodealliance#5915

* fuzzgen: Fix insert lane

* fuzzgen: Remove debug code

* fuzzgen: Remove vall_true

This is broken in the interpreter bytecodealliance#5916

* fuzzgen: Disable a few more ops

* fuzzgen: Remove `iadd_pairwise.i64x2`

Turns out it doesen't exist

* fuzzgen: Remove scalar `sqmul_round_sat`

bytecodealliance#5923

* fuzzgen: Disable aligned loads to SIMD values

* fuzzgen: Address Review Feedback

Co-Authored-By: Jamey Sharp <jsharp@fastly.com>

* fuzzgen: Rework `cmp` exclusion rules

Co-Authored-By: Jamey Sharp <jsharp@fastly.com>

---------

Co-authored-by: Jamey Sharp <jsharp@fastly.com>
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 Issues related to the Cranelift code generator
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants