Repository navigation
[v5] AArch64: print orr with a movz/movn immediate as orr, not mov - #3178
Merged
Merged
Conversation
Rot127
approved these changes
Nov 21, 2026
Rot127
left a comment
Collaborator
There was a problem hiding this comment.
Please rebase to fix the CI.
0verflowme
force-pushed
the
v5-a64-orr-mov-alias
branch
from
November 21, 2026 18:43
89948fb to
fcf7e95
Compare
This file contains hidden or 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
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.
Your checklist for this pull request
Detailed description
On v5,
orr wd, wzr, #immandorr xd, xzr, #immalways print asmov, even when the immediate also fits a movz/movn. Themovalias ofORR (immediate)is preferred only when no move-wide instruction can encode the value, so these read as amovzthat is not the encoded instruction.llvm-mc prints
orr w0, wzr, #0x1,orr x0, xzr, #0x100000000andmov w0, #1431655765for these encodings.nextalready applies this check withAArch64_AM_isAnyMOVWMovAlias(arch/AArch64/AArch64InstPrinter.c:568); this backports it to the v5 printer.Tests: three entries added to
suite/MC/AArch64/basic-a64-instructions.s.cs. Across all 4403 AArch64 MC lines, only the two neworrlines change output.