Add support for MSR/MRS (banked register) for 32-bit ARM architectures #8013
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 adds support for the MRS/MSR (banked register) 32-bit ARM instructions. Documentation for these instructions can be found here:
https://developer.arm.com/documentation/ddi0597/2024-12/Base-Instructions/MRS--Banked-register---Move-Banked-or-Special-register-to-general-purpose-register-
https://developer.arm.com/documentation/ddi0597/2024-12/Base-Instructions/MSR--Banked-register---Move-general-purpose-register-to-Banked-or-Special-register-
I wanted to be able to map SYSm values directly to registers, and then be able to map instruction fields to SYSm values; however, SYSm isn't a contiguous bitfield (or even in the same 16-bit chunk for thumb instructions), which seems to limit my options. Please let me know if there's a cleaner approach than the one I ended up using for this. I also wasn't sure how many
.pspec
files to add the new volatile register section to, so I just did the two that seemed to be used for the architectures that these instructions are present in (v7 and v8).I'm attaching some files that can help with testing, package.zip, which include:
arm.bin
,thumb.bin
)generate.py
)arm.objdump
,thumb.objdump
); the commands used to generate these are commentsin thegenerate.py
script.I didn't automatically analyze the binaries, I just opened them as raw images and manually disassembled from the start with their corresponding architecture (thumb for thumb.bin, arm for arm.bin).