-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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
arm64: Add tests for add(s), and(s), sub(s), cmp, cmn, eor, neg & orr #111796
arm64: Add tests for add(s), and(s), sub(s), cmp, cmn, eor, neg & orr #111796
Conversation
@a74nh @kunalspathak @dotnet/arm64-contrib |
Tagging subscribers to this area: @JulieLeeMSFT, @jakobbotsch |
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.
Thanks for adding the test coverage. Added some follow up questions.
static bool CmnLSR(uint a, uint b) | ||
{ | ||
//ARM64-FULL-LINE: lsr {{w[0-9]+}}, {{w[0-9]+}}, #2 | ||
//ARM64-FULL-LINE: cmn {{w[0-9]+}}, {{w[0-9]+}} |
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.
can we open an issue for this? According to #68028, "shifted register" should already be in place.
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.
Do we know why it doesn't kick in?
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.
{ | ||
//ARM64-FULL-LINE: lsl {{x[0-9]+}}, {{x[0-9]+}}, #55 | ||
//ARM64-FULL-LINE: cmp {{x[0-9]+}}, {{x[0-9]+}} | ||
if (a == (b<<119)) |
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.
are we having two instructions here because the constant doesn't fit in imm6
of cmp
?
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.
static int EorLSL(int a, int b) | ||
{ | ||
//ARM64-FULL-LINE: eor {{w[0-9]+}}, {{w[0-9]+}}, {{w[0-9]+}}, LSL #4 | ||
return a ^ (b<<4); |
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.
can you add some test for (b << 4) ^ a
?
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.
similar for other commutative operations?
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.
Added tests with operands in opposite order.
{ | ||
//ARM64-FULL-LINE: lsr {{w[0-9]+}}, {{w[0-9]+}}, #20 | ||
//ARM64-FULL-LINE: neg {{w[0-9]+}}, {{w[0-9]+}} | ||
return (uint)-(a>>20); |
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.
do we know why we generate 2 instructios here?
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.
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
No description provided.