Repository navigation
[v5] Sparc: decode integer LDD and STD - #3142
Merged
Merged
Conversation
Rot127
approved these changes
Nov 2, 2026
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, the Sparc integer
lddandstdfail to decode, as shown below:These should be
std %o4, [%g1+0x3d8]andldd [%g1+%g2], %o4.nextdecodes them. Believe the v5 decoder table was generated from an LLVM version that had no integer LDD/STD (so no table entries to fix).Resolved by:
Sparc_getInstructionnow triesdecodeIntPairMem. It only accepts op=3 with op3 0x03 (LDD) or 0x07 (STD), so a word the table already decodes cannot change.SP_{LDD,STD}{ri,rr}), appended after the existing ones, with mapping entries to the existingSPARC_INS_LDDandSPARC_INS_STD. Instructions printed viaprintSparcAliasInstrand I didn't change the public API.nextdo).Note that I chose this over editing the generated decoder table as inserting entries there would move about 400 offsets.
Test plan
Eight lines in
suite/MC/Sparc/sparc-mem-instructions.s.cs, using the same operands as the existing ld/st lines plus the odd register case. Can confirm all eight fail before this change.Closing issues
None filed.