-
Notifications
You must be signed in to change notification settings - Fork 396
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
Implement binary encoding for POWER10 PC-relative loads and stores #5371
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
aviansie-ben
requested review from
0xdaryl,
charliegracie and
mstoodle
as code owners
July 6, 2020 17:38
gita-omr
reviewed
Jul 15, 2020
gita-omr
reviewed
Jul 15, 2020
gita-omr
approved these changes
Jul 15, 2020
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.
Approving considering this as a foundation work for future PRs.
zl-wang
suggested changes
Jul 15, 2020
In POWER10, a number of new prefixed load and store instructions have been added. These allow for 34-bit offsets, but crucially they also have a bit that causes the load/store to occur relative to the address of the current instruction. This can be used in a number of interesting ways and will allow us to completely remove the pTOC on POWER10 systems, since we can replace pTOC loads with PC-relative loads. Support for using these PC-relative loads and stores to load at an offset from a TR::LabelSymbol has now been added to the Power codegen. Signed-off-by: Ben Thomas <ben@benthomas.ca>
Previously, PC-relative loads and stores could only be encoded by giving their offset relative to a label. Now, support has been added to specify the offset directly. While this may seem less than useful since it's not normally possible to know exact offsets to surrounding instructions due to e.g. boundary avoidance for prefixed instructions, there is one particular use case: when the displacement is meant to be patched, it is necessary to force a displacement of 0 to be used, which cannot be done using labels. Signed-off-by: Ben Thomas <ben@benthomas.ca>
aviansie-ben
force-pushed
the
p10-pc-relative
branch
from
July 16, 2020 15:20
8a05896
to
33d699a
Compare
zl-wang
approved these changes
Jul 16, 2020
fjeremic
approved these changes
Jul 22, 2020
@genie-omr build plinux,aix |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR adds binary encoder support for encoding PC-relative offsets on the new POWER10 prefixed loads and stores. There are currently two different ways of specifying the displacement:
TR::LabelSymbol
The first method is meant to be the standard way of doing this, with the second method existing only to allow the displacement field to be forced to be 0 when a PC-relative load/store's displacement will be patched.