Skip to content
This repository was archived by the owner on Dec 22, 2021. It is now read-only.

Commit fc8606f

Browse files
committed
Sign Select instructions
1 parent 723c967 commit fc8606f

File tree

3 files changed

+19
-0
lines changed

3 files changed

+19
-0
lines changed

proposals/simd/BinarySIMD.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -249,3 +249,7 @@ For example, `ImmLaneIdx16` is a byte with values in the range 0-15 (inclusive).
249249
| `v128.store16_lane` | `TBD`| m:memarg, i:ImmLaneIdx8 |
250250
| `v128.store32_lane` | `TBD`| m:memarg, i:ImmLaneIdx4 |
251251
| `v128.store64_lane` | `TBD`| m:memarg, i:ImmLaneIdx2 |
252+
| `v8x16.signselect` | `TBD`| - |
253+
| `v16x8.signselect` | `TBD`| - |
254+
| `v32x4.signselect` | `TBD`| - |
255+
| `v64x2.signselect` | `TBD`| - |

proposals/simd/ImplementationStatus.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -217,6 +217,10 @@
217217
| `v128.store16_lane` | | | | | |
218218
| `v128.store32_lane` | | | | | |
219219
| `v128.store64_lane` | | | | | |
220+
| `v8x16.signselect` | | | | | |
221+
| `v16x8.signselect` | | | | | |
222+
| `v32x4.signselect` | | | | | |
223+
| `v64x2.signselect` | | | | | |
220224

221225
[1] Tip of tree LLVM as of May 20, 2020
222226

proposals/simd/SIMD.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -662,6 +662,17 @@ Note that the normal WebAssembly `select` instruction also works with vector
662662
types. It selects between two whole vectors controlled by a single scalar value,
663663
rather than selecting bits controlled by a control mask vector.
664664

665+
### Sign select
666+
* `v8x16.signselect(v1: v128, v2: v128, c: v128) -> v128`
667+
* `v16x8.signselect(v1: v128, v2: v128, c: v128) -> v128`
668+
* `v32x4.signselect(v1: v128, v2: v128, c: v128) -> v128`
669+
* `v64x2.signselect(v1: v128, v2: v128, c: v128) -> v128`
670+
671+
Use the sign bits in the control mask `c` to select the corresponding element
672+
from `v1` when 1 (negative sign) and `v2` when 0 (positive sign).
673+
674+
Note that these instructions work for both signed integer and floating-point
675+
control masks.
665676

666677
## Boolean horizontal reductions
667678

0 commit comments

Comments
 (0)