-
Notifications
You must be signed in to change notification settings - Fork 1.6k
s390x: Emit 20bit immedate variants of indexed loads #12218
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
Conversation
3a04e06 to
72377e6
Compare
Subscribe to Label ActionDetailsThis issue or pull request has been labeled: "cranelift", "isle"Thus the following users have been cc'd because of the following labels:
To subscribe or unsubscribe from this label, edit the |
|
cc @uweigand -- would you mind taking a look? |
|
Hi @theotherjimmy this makes sense in principle, but I have a couple of comments:
|
|
Thanks for the review @uweigand I think I'll rework this to write a new extractor with your suggested name, and migrate to that new extractor where we know the instructions support the extended offset. That should resolve your concerns. |
e1832b6 to
96ad60a
Compare
|
@uweigand Is this more in line with what you expected? |
uweigand
left a comment
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 looks generally good to me. As a small enhancement it might be interesting to also extend the lower_address_bias version with a memarg_reg_plus_reg_plus_off clause (which would add the bias to the offset); this probably doesn't have much effect on performance but would preserve the symmetry.
A much bigger (future) enhancement could be to be more specific in generating proper addressing modes for the target instruction in the first place:
- Avoid using the generic
RegOffsetmode but rather generate explicit code to begin with (e.g. along the lines of the AArch64amoderules). - Use more specific flavors of
lower_address(e.g.lower_address_bdaddr12,lower_address_bdaddr20,lower_address_bdxaddr12,lower_address_bdxaddr20to follow LLWM nomenclature) and update the various rules to use the specific flavors instead of the generic, as appropriate for the target instruction of each rule.
96ad60a to
2e21896
Compare
Previously, cranelift did not emit memory operations using 20 bit immedates for reg + reg memory modes. This patch enables that in a type safe manner by exporting a few extractors for 20 bit immediates and changing the argument to the MemArg constructor for reg + reg addressing mode to accept that 20 bit offset instead of the u8 offset. Note that the '_bias' suffixed rule is not modified, as it's primarily used by vector instructions that don't have BXD20 addressing, only BXD12.
2e21896 to
6d8114e
Compare
uweigand
left a comment
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 LGTM now, thanks!
cfallin
left a comment
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 Ulrich for the review on this!
Previously, cranelift did not emit memory operations using 20 bit immedates for reg + reg memory modes on s390x. This patch enables that in a type safe manner by exporting a few extractors for 20 bit immediates and changing the argument to the MemArg constructor for reg + reg addressing mode to accept that 20 bit offset instead of the u8 offset.