Skip to content
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
merged 2 commits into from
Jul 22, 2020

Conversation

aviansie-ben
Copy link
Contributor

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:

  1. Using an offset relative to a TR::LabelSymbol
  2. Using a constant displacement

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.

Copy link
Contributor

@gita-omr gita-omr left a 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.

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>
@fjeremic
Copy link
Contributor

@genie-omr build plinux,aix

@fjeremic fjeremic merged commit 8c05fb5 into eclipse-omr:master Jul 22, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants