diff options
author | Brendan Dahl <brendan.dahl@gmail.com> | 2024-09-03 12:08:50 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-09-03 12:08:50 -0700 |
commit | db9ee9434bd74ac8f1637ec109dc52e4b09794a7 (patch) | |
tree | 3a6067d3467a74730ee92914444169f6ae48e29c /src/passes/Print.cpp | |
parent | b7cdb8c2110dff5a9b096d766dac04cd8ec04cc9 (diff) | |
download | binaryen-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/passes/Print.cpp')
-rw-r--r-- | src/passes/Print.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/passes/Print.cpp b/src/passes/Print.cpp index 024b6af5c..46d519e9e 100644 --- a/src/passes/Print.cpp +++ b/src/passes/Print.cpp @@ -770,6 +770,12 @@ struct PrintExpressionContents case LaneselectI64x2: o << "i64x2.laneselect"; break; + case RelaxedMaddVecF16x8: + o << "f16x8.relaxed_madd"; + break; + case RelaxedNmaddVecF16x8: + o << "f16x8.relaxed_nmadd"; + break; case RelaxedMaddVecF32x4: o << "f32x4.relaxed_madd"; break; |