-
-
Notifications
You must be signed in to change notification settings - Fork 363
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
[RzIL] IL lifting of SuperH ISA #2518
Merged
Merged
Conversation
This file contains 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
DMaroo
changed the title
[RzIL] IL uplifting of SuperH ISA
[RzIL] IL lifting of SuperH ISA
Apr 7, 2022
wargio
reviewed
Apr 10, 2022
DMaroo
commented
Apr 13, 2022
XVilka
reviewed
Apr 24, 2022
DMaroo
force-pushed
the
sh-uplifting
branch
2 times, most recently
from
May 28, 2022 15:18
1d39732
to
fc77c29
Compare
DMaroo
force-pushed
the
sh-uplifting
branch
2 times, most recently
from
June 14, 2022 17:28
130e4ea
to
9019861
Compare
XVilka
requested changes
Jun 18, 2022
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The code is in a good shape.
* Link both `sh/assembler.c` and `sh/disassembler.c` with `sh/lookup.c`
* Store the IL context in an `SHILContext` struct and pass it around to store information to be used outside the lifter
* Remove incorrect comments * Remove unnecessary helper `sh_return_val_if_invalid_gpr`
* Also fix bugs in the corresponding liftings, if any
* Also fix IL liftings for incorrectly implemented shift instructions * Fix disassmbler/assembler lookup table for incorrectly decoded shift instructions
* Fix IL lifter for incorrectly implemented branch instructions
* Format according to clang-format
* Now the assembler and dissasembler find the correct instruction from the lookup table in case of `LDC` (and `STC` as well) * Banked register instructions are also assembled and disassembled properly * Add banked registers in `sh_registers` * Add tests for `LDC` * Fix `sh_il_set_status_reg` to use `LSB` leading to concise IL dumps
* Add a member in `SHILContext`, `use_banked` to decide whether to use banked registers or not in case privileged mode. Very helpful in case of `LDC`, `LDC.L`, `STC`, `STC.L`
* Fix `sh_il_get_status_reg` to use remove double casting and use appropriate bits for `SH_SR_I` * Fix incorrectly implemented system control IL lifters
wargio
approved these changes
Aug 1, 2022
wingdeans
pushed a commit
to wingdeans/rizin
that referenced
this pull request
Aug 3, 2022
* Add an assembler for the SuperH ISA * Rewrite GPL GNU disassembler code
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
Lifting SuperH ISA to RzIL.
Architecture reference: https://www.st.com/resource/en/user_manual/cd00147165-sh-4-32-bit-cpu-core-architecture-stmicroelectronics.pdf
I have also implemented a disassembler and assembler for SuperH.
Test plan
I have added one IL test for every instruction which was implemented. It is yet to be tested against
rz-tracetest
, but the asm tests are passing.Closing issues
Tracking issue: #2080
Unimplemented instructions
LDTLB
OCBI
OCBP
OCBWB
PREF
TRAPA
ForLDC
andSTC
, the instruction involving banked registers as the operands is unimplemented (more like incorrectly implemented) in the IL