From aff5ae08eab2e84ae8df249059bd2afa0f2c60bc Mon Sep 17 00:00:00 2001 From: Ng Zhi An Date: Thu, 4 Aug 2022 23:24:29 +0000 Subject: [PATCH] Fix ordering for FMA and change FMS to FNMA (fused negative multiply add) For #27. --- proposals/relaxed-simd/Overview.md | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/proposals/relaxed-simd/Overview.md b/proposals/relaxed-simd/Overview.md index f7eb7103..f9888e09 100644 --- a/proposals/relaxed-simd/Overview.md +++ b/proposals/relaxed-simd/Overview.md @@ -163,19 +163,19 @@ def relaxed_i32x4_trunc_f64x2_zero_u(a : f64x2) -> i32x4: result[i] = r ``` -### Relaxed fused multiply-add and fused multiply-subtract +### Relaxed fused multiply-add and fused negative multiply-add - `relaxed f32x4.fma` -- `relaxed f32x4.fms` +- `relaxed f32x4.fnma` - `relaxed f64x2.fma` -- `relaxed f64x2.fms` +- `relaxed f64x2.fnma` -All the instructions take 3 operands, `a`, `b`, `c`, perform `a + (b * c)` or `a - (b * c)`: +All the instructions take 3 operands, `a`, `b`, `c`, perform `a * b + c` or `-(a * b) + c`: -- `relaxed f32x4.fma(a, b, c) = a + (b * c)` -- `relaxed f32x4.fms(a, b, c) = a - (b * c)` -- `relaxed f64x2.fma(a, b, c) = a + (b * c)` -- `relaxed f64x2.fms(a, b, c) = a - (b * c)` +- `relaxed f32x4.fma(a, b, c) = a * b + c` +- `relaxed f32x4.fnma(a, b, c) = -(a * b) + c` +- `relaxed f64x2.fma(a, b, c) = a * b + c` +- `relaxed f64x2.fnma(a, b, c) = -(a * b) + c` where: