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

Saturating Rounding Q-format Multiplication #365

Merged
merged 1 commit into from
Jan 11, 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
3 changes: 2 additions & 1 deletion proposals/simd/BinarySIMD.md
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ For example, `ImmLaneIdx16` is a byte with values in the range 0-15 (inclusive).
| `i16x8.min_u` | `0x97`| - |
| `i16x8.max_s` | `0x98`| - |
| `i16x8.max_u` | `0x99`| - |
| `i16x8.avgr_u` | `0x9b`| |
| `i16x8.avgr_u` | `0x9b`| - |
| `i32x4.abs` | `0xa0`| - |
| `i32x4.neg` | `0xa1`| - |
| `i32x4.any_true` | `0xa2`| - |
Expand Down Expand Up @@ -237,3 +237,4 @@ For example, `ImmLaneIdx16` is a byte with values in the range 0-15 (inclusive).
| `i64x2.extmul_high_i32x4_s` | `0x119`| - |
| `i64x2.extmul_low_i32x4_u` | `0x11a`| - |
| `i64x2.extmul_high_i32x4_u` | `0x11b`| - |
| `i16x8.q15mulr_sat_s` | `TBD`| - |
1 change: 1 addition & 0 deletions proposals/simd/ImplementationStatus.md
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,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.q15mulr_sat_s` | | | | | |
| `i32x4.abs` | `-msimd128` | :heavy_check_mark: | | | :heavy_check_mark: |
| `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: |
Expand Down
13 changes: 13 additions & 0 deletions proposals/simd/SIMD.md
Original file line number Diff line number Diff line change
Expand Up @@ -509,6 +509,19 @@ def S.sub_sat_u(a, b):
return S.lanewise_binary(subsat, S.AsUnsigned(a), S.AsUnsigned(b))
```

### Saturating integer Q-format rounding multiplication

* `i16x8.q15mulr_sat_s(a: v128, b: v128) -> v128`

Lane-wise saturating rounding multiplication in Q15 format:

```python
def S.q15mulr_sat_s(a, b):
def subq15mulr(x, y):
return S.SignedSaturate((x * y + 0x4000) >> 15)
return S.lanewise_binary(subsat, S.AsSigned(a), S.AsSigned(b))
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi, is this subsat should be subq15mulr?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Right

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oops, didn't catch that during review - fixed in #424.

```

### Lane-wise integer minimum
* `i8x16.min_s(a: v128, b: v128) -> v128`
* `i8x16.min_u(a: v128, b: v128) -> v128`
Expand Down