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

Population count instruction #379

Merged
merged 1 commit into from
Feb 4, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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