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

Commit d85e2f5

Browse files
committed
Integer absolute value instructions
1 parent e789960 commit d85e2f5

File tree

3 files changed

+19
-1
lines changed

3 files changed

+19
-1
lines changed

proposals/simd/BinarySIMD.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -201,3 +201,6 @@ The `v8x16.shuffle` instruction has 16 bytes after `simdop`.
201201
| `i64x2.load32x2_s` | `0xd6`| m:memarg |
202202
| `i64x2.load32x2_u` | `0xd7`| m:memarg |
203203
| `v128.andnot` | `0xd8`| - |
204+
| `i8x16.abs` | `0xd9`| - |
205+
| `i16x8.abs` | `0xda`| - |
206+
| `i32x4.abs` | `0xdb`| - |

proposals/simd/ImplementationStatus.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,7 @@
9191
| `i8x16.min_u` | `-munimplemented-simd128` | :heavy_check_mark: | | |
9292
| `i8x16.max_s` | `-munimplemented-simd128` | :heavy_check_mark: | | |
9393
| `i8x16.max_u` | `-munimplemented-simd128` | :heavy_check_mark: | | |
94+
| `i8x16.abs` | | | | |
9495
| `i16x8.neg` | `-msimd128` | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: |
9596
| `i16x8.any_true` | `-msimd128` | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: |
9697
| `i16x8.all_true` | `-msimd128` | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: |
@@ -108,6 +109,7 @@
108109
| `i16x8.min_u` | `-munimplemented-simd128` | :heavy_check_mark: | | |
109110
| `i16x8.max_s` | `-munimplemented-simd128` | :heavy_check_mark: | | |
110111
| `i16x8.max_u` | `-munimplemented-simd128` | :heavy_check_mark: | | |
112+
| `i16x8.abs` | | | | |
111113
| `i32x4.neg` | `-msimd128` | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: |
112114
| `i32x4.any_true` | `-msimd128` | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: |
113115
| `i32x4.all_true` | `-msimd128` | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: |
@@ -121,6 +123,7 @@
121123
| `i32x4.min_u` | `-munimplemented-simd128` | :heavy_check_mark: | | |
122124
| `i32x4.max_s` | `-munimplemented-simd128` | :heavy_check_mark: | | |
123125
| `i32x4.max_u` | `-munimplemented-simd128` | :heavy_check_mark: | | |
126+
| `i32x4.abs` | | | | |
124127
| `i64x2.neg` | `-munimplemented-simd128` | | :heavy_check_mark: | :heavy_check_mark: |
125128
| `i64x2.shl` | `-munimplemented-simd128` | | :heavy_check_mark: | :heavy_check_mark: |
126129
| `i64x2.shr_s` | `-munimplemented-simd128` | | :heavy_check_mark: | :heavy_check_mark: |

proposals/simd/SIMD.md

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -488,6 +488,18 @@ each pair.
488488
def S.max(a, b):
489489
return S.lanewise_binary(max, a, b)
490490
```
491+
### Lane-wise integer absolute value
492+
* `i8x16.abs(a: v128) -> v128`
493+
* `i16x8.abs(a: v128) -> v128`
494+
* `i32x4.abs(a: v128) -> v128`
495+
496+
Lane-wise wrapping absolute value.
497+
498+
```python
499+
def S.abs(a):
500+
return S.lanewise_unary(abs, S.AsSigned(a))
501+
```
502+
491503
## Bit shifts
492504

493505
### Left shift by scalar
@@ -776,7 +788,7 @@ def S.neg(a):
776788
return S.lanewise_unary(ieee.negate, a)
777789
```
778790

779-
### Absolute value
791+
### Floating-point absolute value
780792
* `f32x4.abs(a: v128) -> v128`
781793
* `f64x2.abs(a: v128) -> v128`
782794

0 commit comments

Comments
 (0)