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

Commit 25f9d41

Browse files
authored
i8x16.popcnt instruction (#379)
1 parent ef06db0 commit 25f9d41

File tree

3 files changed

+11
-0
lines changed

3 files changed

+11
-0
lines changed

proposals/simd/BinarySIMD.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -258,3 +258,4 @@ For example, `ImmLaneIdx16` is a byte with values in the range 0-15 (inclusive).
258258
| `i32x4.trunc_sat_f64x2_u_zero` | `TBD`| - |
259259
| `f32x4.demote_f64x2_zero` | `TBD`| - |
260260
| `f64x2.promote_low_f32x4` | `TBD`| - |
261+
| `i8x16.popcnt` | `TBD`| - |

proposals/simd/ImplementationStatus.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -226,6 +226,7 @@
226226
| `i32x4.trunc_sat_f64x2_u_zero` | | | | | |
227227
| `f32x4.demote_f64x2_zero` | | | | | |
228228
| `f64x2.promote_low_f32x4` | | | | | |
229+
| `i8x16.popcnt` | | | | | |
229230

230231
[1] Tip of tree LLVM as of May 20, 2020
231232

proposals/simd/SIMD.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -662,6 +662,15 @@ 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+
### Lane-wise Population Count
666+
* `i8x16.popcnt(v: v128) -> v128`
667+
668+
Count the number of bits set to one within each lane.
669+
670+
```python
671+
def S.popcnt(v):
672+
return S.lanewise_unary(popcnt, v)
673+
```
665674

666675
## Boolean horizontal reductions
667676

0 commit comments

Comments
 (0)