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

Integer absolute value instructions #128

Merged
merged 1 commit into from
Feb 11, 2020
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
3 changes: 3 additions & 0 deletions proposals/simd/BinarySIMD.md
Original file line number Diff line number Diff line change
Expand Up @@ -199,3 +199,6 @@ The `v8x16.shuffle` instruction has 16 bytes after `simdop`.
| `v128.andnot` | `0xd8`| - |
| `i8x16.avgr_u` | `0xd9`| |
| `i16x8.avgr_u` | `0xda`| |
| `i8x16.abs` | `0xe1`| - |
| `i16x8.abs` | `0xe2`| - |
| `i32x4.abs` | `0xe3`| - |
3 changes: 3 additions & 0 deletions proposals/simd/ImplementationStatus.md
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@
| `i8x16.max_s` | `-msimd128` | :heavy_check_mark: | :heavy_check_mark: | |
| `i8x16.max_u` | `-msimd128` | :heavy_check_mark: | :heavy_check_mark: | |
| `i8x16.avgr_u` | `-msimd128` | :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: |
Expand All @@ -110,6 +111,7 @@
| `i16x8.max_s` | `-msimd128` | :heavy_check_mark: | :heavy_check_mark: | |
| `i16x8.max_u` | `-msimd128` | :heavy_check_mark: | :heavy_check_mark: | |
| `i16x8.avgr_u` | `-msimd128` | :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: |
Expand All @@ -123,6 +125,7 @@
| `i32x4.min_u` | `-msimd128` | :heavy_check_mark: | :heavy_check_mark: | |
| `i32x4.max_s` | `-msimd128` | :heavy_check_mark: | :heavy_check_mark: | |
| `i32x4.max_u` | `-msimd128` | :heavy_check_mark: | :heavy_check_mark: | |
| `i32x4.abs` | | | | |
| `i64x2.neg` | `-msimd128` | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: |
| `i64x2.shl` | `-msimd128` | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: |
| `i64x2.shr_s` | `-msimd128` | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: |
Expand Down
14 changes: 13 additions & 1 deletion proposals/simd/SIMD.md
Original file line number Diff line number Diff line change
Expand Up @@ -503,6 +503,18 @@ def S.avgr_u(a, b):
return S.lanewise_binary(S.RoundingAverage, S.AsUnsigned(a), S.AsUnsigned(b))
```

### Lane-wise 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
Expand Down Expand Up @@ -791,7 +803,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`

Expand Down