summaryrefslogtreecommitdiff
path: root/src/wasm-interpreter.h
diff options
context:
space:
mode:
authorBrendan Dahl <brendan.dahl@gmail.com>2024-09-03 12:08:50 -0700
committerGitHub <noreply@github.com>2024-09-03 12:08:50 -0700
commitdb9ee9434bd74ac8f1637ec109dc52e4b09794a7 (patch)
tree3a6067d3467a74730ee92914444169f6ae48e29c /src/wasm-interpreter.h
parentb7cdb8c2110dff5a9b096d766dac04cd8ec04cc9 (diff)
downloadbinaryen-db9ee9434bd74ac8f1637ec109dc52e4b09794a7.tar.gz
binaryen-db9ee9434bd74ac8f1637ec109dc52e4b09794a7.tar.bz2
binaryen-db9ee9434bd74ac8f1637ec109dc52e4b09794a7.zip
[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.
Diffstat (limited to 'src/wasm-interpreter.h')
-rw-r--r--src/wasm-interpreter.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/wasm-interpreter.h b/src/wasm-interpreter.h
index 578b0a569..86ba3b3a2 100644
--- a/src/wasm-interpreter.h
+++ b/src/wasm-interpreter.h
@@ -1201,6 +1201,10 @@ public:
case LaneselectI64x2:
return c.bitselectV128(a, b);
+ case RelaxedMaddVecF16x8:
+ return a.relaxedMaddF16x8(b, c);
+ case RelaxedNmaddVecF16x8:
+ return a.relaxedNmaddF16x8(b, c);
case RelaxedMaddVecF32x4:
return a.relaxedMaddF32x4(b, c);
case RelaxedNmaddVecF32x4: