winch(aarch64): Simplify constant handling, part 1/N #10888
Merged
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 commit is the first step toward simplifying constant handling,
particularly for the aarch64 backend.
The main highlights in this patch are:
ConstantPool
implemenetation on top of Cranliftprimitives. The implemettaion is identical to the existing for x64,
however, it's abstracted so that it can be easily consumed from any
existing backend.
loading of constants, particularly floating point constants.
The main motivation behind this change is to eventually detach the
implicit usage of the scatch register from constant loading as much as
possible, reducing the possibility of subtle bugs (like the one
described in #10829).
Note that I have a work-in-progress branch from where all these
changes are cherry picked from, to make everything easier to review.
A side effect of this change, is the improvement to the code
generation involving floating point constants. Prior to this change,
multiple moves were involved, with this patch, at most 1 move is
required and at worst one load is required.