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

Commit aa2f1fb

Browse files
committed
Add Quasi-Fused Multiply-Add/Subtract instructions
1 parent 4e0a8e6 commit aa2f1fb

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
@@ -141,6 +141,8 @@ The `v8x16.shuffle` instruction has 16 bytes after `simdop`.
141141
| `f32x4.abs` | `0x95`| - |
142142
| `f32x4.neg` | `0x96`| - |
143143
| `f32x4.sqrt` | `0x97`| - |
144+
| `f32x4.qfma` | `0x98`| - |
145+
| `f32x4.qfms` | `0x99`| - |
144146
| `f32x4.add` | `0x9a`| - |
145147
| `f32x4.sub` | `0x9b`| - |
146148
| `f32x4.mul` | `0x9c`| - |
@@ -150,6 +152,8 @@ The `v8x16.shuffle` instruction has 16 bytes after `simdop`.
150152
| `f64x2.abs` | `0xa0`| - |
151153
| `f64x2.neg` | `0xa1`| - |
152154
| `f64x2.sqrt` | `0xa2`| - |
155+
| `f64x2.qfma` | `0xa3`| - |
156+
| `f64x2.qfms` | `0xa4`| - |
153157
| `f64x2.add` | `0xa5`| - |
154158
| `f64x2.sub` | `0xa6`| - |
155159
| `f64x2.mul` | `0xa7`| - |

proposals/simd/SIMD.md

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

779779
Lane-wise IEEE `squareRoot`.
780780

781+
### Quasi-Fused Multiply-Add
782+
* `f32x4.qfma(a: v128, b: v128, c: v128) -> v128`
783+
* `f64x2.qfma(a: v128, b: v128, c: v128) -> v128`
784+
785+
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.
786+
787+
### Quasi-Fused Multiply-Subtract
788+
* `f32x4.qfms(a: v128, b: v128, c: v128) -> v128`
789+
* `f64x2.qfms(a: v128, b: v128, c: v128) -> v128`
790+
791+
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.
792+
781793
## Conversions
782794
### Integer to floating point
783795
* `f32x4.convert_i32x4_s(a: v128) -> v128`

0 commit comments

Comments
 (0)