binaryen
binaryen copied to clipboard
[FP16] Implement madd and nmadd.
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)+awhere it should be(a*b)+c. - For nmadd, the implementation was incorrectly doing
(-b*c)+awhere 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.
Hmm, troubling that our interpreter was just wrong for these instructions. I guess we don't fuzz them against V8?
Yeah, that would be https://github.com/WebAssembly/binaryen/blob/e2ceaa58c10e9ee3e9eece42466243f5a8aff125/src/tools/fuzzing/fuzzing.cpp#L3700