bytecodealliance / bytecodealliance/wasmtime

Cranelift: Saturating arithmetic with SIMD vectors with lane-widths >16 bits not implemented in x86_64 backend

Open
#3,201 0 comments 0 reactions 0 assignees View on GitHub
cranelift cranelift:area:x64
Dominant language
Rust
Stars
18.6k
Forks
1.8k
Avg merge
1d 18h
Merged PRs (30d)
126

Description

Opening an issue based on discussion in https://github.com/bytecodealliance/wasmtime/pull/3188#discussion_r690657131.

`uadd_sat` and `usub_sat` are not implemented in the `x86_64` Cranelift backend (but are implemented for `AArch64`) for `i32x4` or `i64x2` SIMD vectors.

CLIF bugpoint (`uadd_sat`):
```
Crash message: Unsupported type for packed uadd_sat instruction: i32x4

function %uaddsat_i32x4() -> i32x4 system_v {
const0 = 0x00000000000000000000000000000000

block0:
v0 = vconst.i32x4 const0
v1 = vconst.i32x4 const0
v2 = uadd_sat v0, v1
return v2
}

Crash message: Unsupported type for packed uadd_sat instruction: i64x2

function %uaddsat_i64x2() -> i64x2 system_v {
const0 = 0x00000000000000000000000000000000

block0:
v0 = vconst.i64x2 const0
v1 = vconst.i64x2 const0
v2 = uadd_sat v0, v1
return v2
}
```

CLIF bugpoint (`usub_sat`):
```
Crash message: Unsupported type for packed usub_sat instruction: i32x4

function %usubsat_i32x4() -> i32x4 system_v {
const0 = 0x00000000000000000000000000000000

block0:
v0 = vconst.i32x4 const0
v1 = vconst.i32x4 const0
v2 = usub_sat v0, v1
return v2
}

Crash message: Unsupported type for packed usub_sat instruction: i64x2

function %usubsat_i64x2() -> i64x2 system_v {
const0 = 0x00000000000000000000000000000000

block0:
v0 = vconst.i64x2 const0
v1 = vconst.i64x2 const0
v2 = usub_sat v0, v1
return v2
}
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.