-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
Clean up in LowerFusedMultiplyAdd #110113
base: main
Are you sure you want to change the base?
Conversation
Tagging subscribers to this area: @JulieLeeMSFT, @jakobbotsch |
PTAL @tannergooding @dotnet/jit-contrib Just a clean up + the previous implementation just gave up if one of the arguments is e.g. GT_CNS_DBL, hence, this PR fixes #110109 |
for (size_t i = 1; i <= 3; i++) | ||
{ | ||
GenTree* arg = node->Op(i); | ||
|
||
if (!arg->OperIsHWIntrinsic() || (arg->AsHWIntrinsic()->GetHWIntrinsicId() != NI_Vector128_CreateScalarUnsafe)) | ||
if (arg->OperIsHWIntrinsic() && (arg->AsHWIntrinsic()->GetHWIntrinsicId() == NI_Vector128_CreateScalarUnsafe)) |
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.
nit, we can make this a bit simpler/more readable:
if (arg->OperIsHWIntrinsic() && (arg->AsHWIntrinsic()->GetHWIntrinsicId() == NI_Vector128_CreateScalarUnsafe)) | |
if (arg->OperIsHWIntrinsic(NI_Vector128_CreateScalarUnsafe)) |
@@ -1330,49 +1330,29 @@ void Lowering::LowerHWIntrinsicCC(GenTreeHWIntrinsic* node, NamedIntrinsic newIn | |||
void Lowering::LowerFusedMultiplyAdd(GenTreeHWIntrinsic* node) | |||
{ | |||
assert(node->GetHWIntrinsicId() == NI_FMA_MultiplyAddScalar); |
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.
Not really for this PR; but the changes you've made here are notably a bit more supportive/general-purpose.
It would be nice to expand this helper to support the non-scalar FusedMultiplyAdd
APIs as well and to support cases like -Vector128.CreateScalarUnsafe(x)
(which more generally is just the -x
handling needed for vector variants) not just Vector128.CreateScalarUnsafe(-x)
Also, closes #110109