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

Commit 3b13f43

Browse files
committed
Add Quasi-Fused Multiply-Add/Subtract instructions
1 parent 77e7fda commit 3b13f43

File tree

2 files changed

+16
-0
lines changed

2 files changed

+16
-0
lines changed

proposals/simd/BinarySIMD.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -153,6 +153,8 @@ The `v8x16.shuffle` instruction has 16 bytes after `simdop`.
153153
| `f32x4.abs` | `0x95`| - |
154154
| `f32x4.neg` | `0x96`| - |
155155
| `f32x4.sqrt` | `0x97`| - |
156+
| `f32x4.qfma` | `0x98`| - |
157+
| `f32x4.qfms` | `0x99`| - |
156158
| `f32x4.add` | `0x9a`| - |
157159
| `f32x4.sub` | `0x9b`| - |
158160
| `f32x4.mul` | `0x9c`| - |
@@ -162,6 +164,8 @@ The `v8x16.shuffle` instruction has 16 bytes after `simdop`.
162164
| `f64x2.abs` | `0xa0`| - |
163165
| `f64x2.neg` | `0xa1`| - |
164166
| `f64x2.sqrt` | `0xa2`| - |
167+
| `f64x2.qfma` | `0xa3`| - |
168+
| `f64x2.qfms` | `0xa4`| - |
165169
| `f64x2.add` | `0xa5`| - |
166170
| `f64x2.sub` | `0xa6`| - |
167171
| `f64x2.mul` | `0xa7`| - |

proposals/simd/SIMD.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -867,6 +867,18 @@ Lane-wise IEEE `multiplication`.
867867

868868
Lane-wise IEEE `squareRoot`.
869869

870+
### Quasi-Fused Multiply-Add
871+
* `f32x4.qfma(a: v128, b: v128, c: v128) -> v128`
872+
* `f64x2.qfma(a: v128, b: v128, c: v128) -> v128`
873+
874+
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.
875+
876+
### Quasi-Fused Multiply-Subtract
877+
* `f32x4.qfms(a: v128, b: v128, c: v128) -> v128`
878+
* `f64x2.qfms(a: v128, b: v128, c: v128) -> v128`
879+
880+
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.
881+
870882
## Conversions
871883
### Integer to floating point
872884
* `f32x4.convert_i32x4_s(a: v128) -> v128`

0 commit comments

Comments
 (0)