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

Commit 78a77e5

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

File tree

2 files changed

+17
-0
lines changed

2 files changed

+17
-0
lines changed

proposals/simd/BinarySIMD.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ instr ::= ...
2525
Some SIMD instructions have additional immediate operands following `simdop`.
2626
The `v8x16.shuffle` instruction has 16 bytes after `simdop`.
2727

28+
<<<<<<< HEAD
2829
| Instruction | `simdop` | Immediate operands |
2930
| ---------------------------|---------:|--------------------|
3031
| `v128.load` | `0x00`| m:memarg |
@@ -141,6 +142,8 @@ The `v8x16.shuffle` instruction has 16 bytes after `simdop`.
141142
| `f32x4.abs` | `0x95`| - |
142143
| `f32x4.neg` | `0x96`| - |
143144
| `f32x4.sqrt` | `0x97`| - |
145+
| `f32x4.qfma` | `0x98`| - |
146+
| `f32x4.qfms` | `0x99`| - |
144147
| `f32x4.add` | `0x9a`| - |
145148
| `f32x4.sub` | `0x9b`| - |
146149
| `f32x4.mul` | `0x9c`| - |
@@ -150,6 +153,8 @@ The `v8x16.shuffle` instruction has 16 bytes after `simdop`.
150153
| `f64x2.abs` | `0xa0`| - |
151154
| `f64x2.neg` | `0xa1`| - |
152155
| `f64x2.sqrt` | `0xa2`| - |
156+
| `f64x2.qfma` | `0xa3`| - |
157+
| `f64x2.qfms` | `0xa4`| - |
153158
| `f64x2.add` | `0xa5`| - |
154159
| `f64x2.sub` | `0xa6`| - |
155160
| `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)