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

Commit 5f5e20c

Browse files
committed
Add Quasi-Fused Multiply-Add/Subtract instructions
1 parent f6e2cb4 commit 5f5e20c

File tree

2 files changed

+16
-0
lines changed

2 files changed

+16
-0
lines changed

proposals/simd/BinarySIMD.md

+4
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,8 @@ The `v8x16.shuffle2_imm` instruction has 16 bytes after `simdop`.
143143
| `f32x4.abs` | `0x95`| - |
144144
| `f32x4.neg` | `0x96`| - |
145145
| `f32x4.sqrt` | `0x97`| - |
146+
| `f32x4.qfma` | `0x98`| - |
147+
| `f32x4.qfms` | `0x99`| - |
146148
| `f32x4.add` | `0x9a`| - |
147149
| `f32x4.sub` | `0x9b`| - |
148150
| `f32x4.mul` | `0x9c`| - |
@@ -152,6 +154,8 @@ The `v8x16.shuffle2_imm` instruction has 16 bytes after `simdop`.
152154
| `f64x2.abs` | `0xa0`| - |
153155
| `f64x2.neg` | `0xa1`| - |
154156
| `f64x2.sqrt` | `0xa2`| - |
157+
| `f64x2.qfma` | `0xa3`| - |
158+
| `f64x2.qfms` | `0xa4`| - |
155159
| `f64x2.add` | `0xa5`| - |
156160
| `f64x2.sub` | `0xa6`| - |
157161
| `f64x2.mul` | `0xa7`| - |

proposals/simd/SIMD.md

+12
Original file line numberDiff line numberDiff line change
@@ -754,6 +754,18 @@ Lane-wise IEEE `multiplication`.
754754

755755
Lane-wise IEEE `squareRoot`.
756756

757+
### Quasi-Fused Multiply-Add
758+
* `f32x4.qfma(a: v128, b: v128, c: v128) -> v128`
759+
* `f64x2.qfma(a: v128, b: v128, c: v128) -> v128`
760+
761+
Lane-wise multiplication and addition (`a + b * c`), either with, or without intermediate rounding. WebAssembly implementation may execute this instruction as either IEEE Fused-Multiply-Add (FMA) or a combination of IEEE `multiplication` and IEEE `addition` operations, depending on availability and performance of FMA instruction on the target native platform. `qfma` instructions in a WebAssembly module must execute as either all fused, or all unfused operations.
762+
763+
### Quasi-Fused Multiply-Subtract
764+
* `f32x4.qfms(a: v128, b: v128, c: v128) -> v128`
765+
* `f64x2.qfms(a: v128, b: v128, c: v128) -> v128`
766+
767+
Lane-wise multiplication and subtraction (`a - b * c`), either with, or without intermediate rounding. WebAssembly implementation may execute this instruction as either IEEE Fused-Multiply-Subtract (FMS) or a combination of IEEE `multiplication` and IEEE `subtraction` operations, depending on availability and performance of FMS instruction on the target native platform. `qfms` instructions in a WebAssembly module must execute as either all fused, or all unfused operations.
768+
757769
## Conversions
758770
### Integer to floating point
759771
* `f32x4.convert_s/i32x4(a: v128) -> v128`

0 commit comments

Comments
 (0)