diff --git a/proposals/simd/BinarySIMD.md b/proposals/simd/BinarySIMD.md index afc842eea..d78f5a56b 100644 --- a/proposals/simd/BinarySIMD.md +++ b/proposals/simd/BinarySIMD.md @@ -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`| - | diff --git a/proposals/simd/ImplementationStatus.md b/proposals/simd/ImplementationStatus.md index 12edefe67..443fee80c 100644 --- a/proposals/simd/ImplementationStatus.md +++ b/proposals/simd/ImplementationStatus.md @@ -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 diff --git a/proposals/simd/SIMD.md b/proposals/simd/SIMD.md index 907b1795b..b8451a9b3 100644 --- a/proposals/simd/SIMD.md +++ b/proposals/simd/SIMD.md @@ -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