Skip to content

Commit 9698769

Browse files
authored
Add fma and fms (#28)
See #27.
1 parent 4fced21 commit 9698769

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

proposals/relaxed-simd/Overview.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -163,6 +163,25 @@ def relaxed_i32x4_trunc_f64x2_zero(a : f64x2, signed : bool) -> i32x4:
163163
result[i] = UNDEFINED
164164
```
165165

166+
### Relaxed fused multiply-add and fused multiply-subtract
167+
168+
- `relaxed f32x4.fma`
169+
- `relaxed f32x4.fms`
170+
- `relaxed f64x2.fma`
171+
- `relaxed f64x2.fms`
172+
173+
All the instructions take 3 operands, `a`, `b`, `c`, perform `a + (b * c)` or `a - (b * c)`:
174+
175+
- `relaxed f32x4.fma(a, b, c) = a + (b * c)`
176+
- `relaxed f32x4.fms(a, b, c) = a - (b * c)`
177+
- `relaxed f64x2.fma(a, b, c) = a + (b * c)`
178+
- `relaxed f64x2.fms(a, b, c) = a - (b * c)`
179+
180+
where:
181+
182+
- the intermediate `b * c` is be rounded first, and the final result rounded again (for a total of 2 roundings), or
183+
- the the entire expression evaluated with higher precision and then only rounded once (if supported by hardware).
184+
166185
## Binary format
167186

168187
> This is a placeholder for binary format of instructions and new constructs.

0 commit comments

Comments
 (0)