-
Notifications
You must be signed in to change notification settings - Fork 787
QFMA/QFMS instructions #2328
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
QFMA/QFMS instructions #2328
Conversation
Renames the SIMDBitselect class to SIMDTernary and adds the new {f32x4,f64x2}.qfm{a,s} ternary instructions. Because the SIMDBitselect class is no more, this is a backwards-incompatible change to the C interface. The new instructions are not yet used in the fuzzer because they are not yet implemented in V8.
CHANGELOG.md
Outdated
input. Use the exported names for things instead. | ||
- Added `mutable` parameter to BinaryenAddGlobalImport. | ||
- Replace BinarySIMDBitselect* with BinarnSIMDTernary* in the C API and add |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- Replace BinarySIMDBitselect* with BinarnSIMDTernary* in the C API and add | |
- Replace BinarySIMDBitselect* with BinarySIMDTernary* in the C API and add |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wow this is all kinds of wrong. Thanks for the catch!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh Binaryen*
makes much more sense :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
WDYT switch to more general name makeTernary
? According to FutureFeatures.md WebAssembly probably introduce fused multiply add instructions for scalar as well or only SIMD planning?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree that renaming to Ternary
would make sense if we ever get ternary scalar operations. We could even rename Select
to Ternary
and getting rid of the separate SIMDTernary
altogether, which would be consistent with how we treat SIMD unary and binary ops. I don't know of any concrete plans to add new scalar ternary operations, though, and I think keeping the separate SIMD instruction type is useful for now because it simplifies the common case in which SIMD is not considered.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great!
Expression* cond = make(v128); | ||
return builder.makeSIMDBitselect(left, right, cond); | ||
Expression* makeSIMDTernary() { | ||
// SIMDTernaryOp op = pick(Bitselect, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please add TODO
here
In #2328 the SIMDBitselect API has been replaced with SIMDTernary that now has Bitselect as one of multiple operations, which is currently not exposed, unlike the new QFMA/QFMS operations which are exposed. This PR adds it.
Renames the SIMDBitselect class to SIMDTernary and adds the new
{f32x4,f64x2}.qfm{a,s} ternary instructions. Because the SIMDBitselect
class is no more, this is a backwards-incompatible change to the C
interface. The new instructions are not yet used in the fuzzer because
they are not yet implemented in V8.
The corresponding LLVM commit is https://reviews.llvm.org/rL370556.