diff --git a/proposals/simd/BinarySIMD.md b/proposals/simd/BinarySIMD.md index 8617d725d..d76f7d9dd 100644 --- a/proposals/simd/BinarySIMD.md +++ b/proposals/simd/BinarySIMD.md @@ -109,6 +109,7 @@ The `v8x16.shuffle` instruction has 16 bytes after `simdop`. | `i8x16.sub` | `0x5a`| - | | `i8x16.sub_saturate_s` | `0x5b`| - | | `i8x16.sub_saturate_u` | `0x5c`| - | +| `i8x16.abs` | `0x5d`| - | | `i16x8.neg` | `0x62`| - | | `i16x8.any_true` | `0x63`| - | | `i16x8.all_true` | `0x64`| - | @@ -122,6 +123,7 @@ The `v8x16.shuffle` instruction has 16 bytes after `simdop`. | `i16x8.sub_saturate_s` | `0x6c`| - | | `i16x8.sub_saturate_u` | `0x6d`| - | | `i16x8.mul` | `0x6e`| - | +| `i16x8.abs` | `0x6f`| - | | `i32x4.neg` | `0x73`| - | | `i32x4.any_true` | `0x74`| - | | `i32x4.all_true` | `0x75`| - | @@ -131,6 +133,7 @@ The `v8x16.shuffle` instruction has 16 bytes after `simdop`. | `i32x4.add` | `0x79`| - | | `i32x4.sub` | `0x7c`| - | | `i32x4.mul` | `0x7f`| - | +| `i32x4.abs` | `0x80`| - | | `i64x2.neg` | `0x84`| - | | `i64x2.shl` | `0x87`| - | | `i64x2.shr_s` | `0x88`| - | diff --git a/proposals/simd/ImplementationStatus.md b/proposals/simd/ImplementationStatus.md index 4778d4fa0..f2959f11b 100644 --- a/proposals/simd/ImplementationStatus.md +++ b/proposals/simd/ImplementationStatus.md @@ -87,6 +87,7 @@ | `i8x16.sub` | `-msimd128` | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | | `i8x16.sub_saturate_s` | `-msimd128` | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | | `i8x16.sub_saturate_u` | `-msimd128` | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | +| `i8x16.abs` | | | | | | `i16x8.neg` | `-msimd128` | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | | `i16x8.any_true` | `-msimd128` | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | | `i16x8.all_true` | `-msimd128` | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | @@ -100,6 +101,7 @@ | `i16x8.sub_saturate_s` | `-msimd128` | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | | `i16x8.sub_saturate_u` | `-msimd128` | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | | `i16x8.mul` | `-msimd128` | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | +| `i16x8.abs` | | | | | | `i32x4.neg` | `-msimd128` | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | | `i32x4.any_true` | `-msimd128` | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | | `i32x4.all_true` | `-msimd128` | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | @@ -109,6 +111,7 @@ | `i32x4.add` | `-msimd128` | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | | `i32x4.sub` | `-msimd128` | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | | `i32x4.mul` | `-msimd128` | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | +| `i32x4.abs` | | | | | | `i64x2.neg` | `-munimplemented-simd128` | | :heavy_check_mark: | :heavy_check_mark: | | `i64x2.shl` | `-munimplemented-simd128` | | :heavy_check_mark: | :heavy_check_mark: | | `i64x2.shr_s` | `-munimplemented-simd128` | | :heavy_check_mark: | :heavy_check_mark: | diff --git a/proposals/simd/SIMD.md b/proposals/simd/SIMD.md index 0f1379207..35ce2d4f9 100644 --- a/proposals/simd/SIMD.md +++ b/proposals/simd/SIMD.md @@ -457,6 +457,18 @@ def S.sub_saturate_u(a, b): return S.lanewise_binary(subsat, S.AsUnsigned(a), S.AsUnsigned(b)) ``` +### Integer absolute value +* `i8x16.abs(a: v128) -> v128` +* `i16x8.abs(a: v128) -> v128` +* `i32x4.abs(a: v128) -> v128` + +Lane-wise wrapping absolute value. + +```python +def S.abs(a): + return S.lanewise_unary(abs, S.AsSigned(a)) +``` + ## Bit shifts ### Left shift by scalar @@ -714,7 +726,7 @@ def S.neg(a): return S.lanewise_unary(ieee.negate, a) ``` -### Absolute value +### Floating-point absolute value * `f32x4.abs(a: v128) -> v128` * `f64x2.abs(a: v128) -> v128`