Skip to content

Commit

Permalink
i8x16.popcnt instruction (WebAssembly#379)
Browse files Browse the repository at this point in the history
  • Loading branch information
Maratyszcza authored Feb 4, 2021
1 parent ef06db0 commit 25f9d41
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 0 deletions.
1 change: 1 addition & 0 deletions proposals/simd/BinarySIMD.md
Original file line number Diff line number Diff line change
Expand Up @@ -258,3 +258,4 @@ For example, `ImmLaneIdx16` is a byte with values in the range 0-15 (inclusive).
| `i32x4.trunc_sat_f64x2_u_zero` | `TBD`| - |
| `f32x4.demote_f64x2_zero` | `TBD`| - |
| `f64x2.promote_low_f32x4` | `TBD`| - |
| `i8x16.popcnt` | `TBD`| - |
1 change: 1 addition & 0 deletions proposals/simd/ImplementationStatus.md
Original file line number Diff line number Diff line change
Expand Up @@ -226,6 +226,7 @@
| `i32x4.trunc_sat_f64x2_u_zero` | | | | | |
| `f32x4.demote_f64x2_zero` | | | | | |
| `f64x2.promote_low_f32x4` | | | | | |
| `i8x16.popcnt` | | | | | |

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

Expand Down
9 changes: 9 additions & 0 deletions proposals/simd/SIMD.md
Original file line number Diff line number Diff line change
Expand Up @@ -662,6 +662,15 @@ Note that the normal WebAssembly `select` instruction also works with vector
types. It selects between two whole vectors controlled by a single scalar value,
rather than selecting bits controlled by a control mask vector.

### Lane-wise Population Count
* `i8x16.popcnt(v: v128) -> v128`

Count the number of bits set to one within each lane.

```python
def S.popcnt(v):
return S.lanewise_unary(popcnt, v)
```

## Boolean horizontal reductions

Expand Down

0 comments on commit 25f9d41

Please sign in to comment.