-
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
Add Arm64 encodings for SVE_DD_2A & SVE_DG_2A #97446
Conversation
Tagging subscribers to this area: @JulieLeeMSFT, @jakobbotsch Issue DetailsThese groups emit predicated version of This clr output matches the one from capstone.
Contribute towards #94549.
|
@a74nh @kunalspathak @dotnet/arm64-contrib |
case IF_SVE_DF_2A: | ||
case IF_SVE_GS_3A: | ||
case IF_SVE_HJ_3A: | ||
case IF_SVE_IY_4A: | ||
return PREDICATE_NONE; | ||
|
||
case IF_SVE_DD_2A: |
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.
This should be always PREDICATE_NONE
for DD_2A
, right? https://docsmirror.github.io/A64/2023-06/pfirst_p_p_p.html
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.
It needs PREDICATE_NONE
for the second reg only else we will miss the element type on remaining predicate registers. It would cause the following diff with capstone.
- pfirst p0.b, p15, p0.b
+ pfirst p0, p15, p0
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.
@kunalspathak , this was one of the reasons why insGetPredicateType
was originally called something like insGetReg2PredicateType
.
Because pfirst
has two predicate registers, insGetPredicateType
is ambiguous of what it should return.
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 just now noticed the regPos
was added. That seems to clear up any ambiguity.
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.
right...having regPos
is better.
src/coreclr/jit/emitarm64.cpp
Outdated
case IF_SVE_CX_4A: | ||
case IF_SVE_CX_4A_A: | ||
case IF_SVE_CY_3A: | ||
case IF_SVE_CY_3B: | ||
case IF_SVE_DG_2A: |
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.
From https://docsmirror.github.io/A64/2023-06/rdffr_p_p_f.html, this should be:
case IF_SVE_DG_2A:
return ((regpos == 2) ? PREDICATE_ZERO: PREDICATE_NONE);
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.
Sure, it would avoid asserts and make IF_SVE_DG_2A
a separate case for groups that have only two registers and those are predicate registers. The other groups also have only two predicate registers but they have non-predicated registers as well.
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, and we need PREDICATE_SIZED
for reg1 otherwise we won't get the element type in <Pd>.B
.
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.
LGTM. Thanks!
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.
LGTM, pretty straightforward.
These groups emit predicated version of
pfirst
,rdffr
&rdffrs
instructions.This clr output matches the one from capstone.
Contribute towards #94549.