-
Notifications
You must be signed in to change notification settings - Fork 3.1k
AArch64: Fold shqri/testl/jcc into cmp/jcc #9660
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
base: master
Are you sure you want to change the base?
Conversation
We often see patterns like this: shrqi 32, %v0, %v1 testl 0x80000000, %v1 jcc CC_E, ... but really this is the same as asking if %v0 is >= 0. Rewriting this in the form cmp 0, %v0 jcc CC_GE, ... saves two instructions, i.e. a lsr and a mov.
|
@facebook-github-bot has imported this pull request. If you are a Meta employee, you can view this in D86516135. (Because this pull request was imported automatically, there will not be any future comments.) |
|
This fails to compile with |
OK thanks I'll take a look! It seemed to pass for me downstream, so presumably I'm using a different build setup. |
|
Yeah the |
|
@david-arm has updated the pull request. You must reimport the pull request before landing. |
|
Thanks it builds and passes tests now |
We often see patterns like this:
shrqi 32, %v0, %v1
testl 0x80000000, %v1
jcc CC_E, ...
but really this is the same as asking if %v0 is >= 0. Rewriting this in the form
cmp 0, %v0
jcc CC_GE, ...
saves two instructions, i.e. a lsr and a mov.