From db9ee9434bd74ac8f1637ec109dc52e4b09794a7 Mon Sep 17 00:00:00 2001 From: Brendan Dahl Date: Tue, 3 Sep 2024 12:08:50 -0700 Subject: [FP16] Implement madd and nmadd. (#6878) Specified at https://github.com/WebAssembly/half-precision/blob/main/proposals/half-precision/Overview.md A few notes: - The F32x4 and F64x2 versions of madd and nmadd are missing spect tests. - For madd, the implementation was incorrectly doing `(b*c)+a` where it should be `(a*b)+c`. - For nmadd, the implementation was incorrectly doing `(-b*c)+a` where it should be `-(a*b)+c`. - There doesn't appear to be a great way to actually implement a fused nmadd, but the spec allows the double rounded version I added. --- src/wasm.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/wasm.h') diff --git a/src/wasm.h b/src/wasm.h index 86ee12972..a7ad6ec6c 100644 --- a/src/wasm.h +++ b/src/wasm.h @@ -574,6 +574,8 @@ enum SIMDTernaryOp { Bitselect, // Relaxed SIMD + RelaxedMaddVecF16x8, + RelaxedNmaddVecF16x8, RelaxedMaddVecF32x4, RelaxedNmaddVecF32x4, RelaxedMaddVecF64x2, -- cgit v1.2.3