-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
[RISC-V] Add quirks for riscv to R2RDump #101683
Merged
Merged
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
33afb41
[RISC-V] Add quirks for riscv
SzpejnaDawid 68cfb45
[RISC-V] correct code
SzpejnaDawid cbee233
[RISC-V] correct a type in the comment
SzpejnaDawid 9227818
correct typo in comment
SzpejnaDawid 7c96325
[RISC-V] minimize code
SzpejnaDawid File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
Oops, something went wrong.
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.
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.
Nit: Have you seen a pattern which needs addition for
addi
instruction? IMO, it doesn't generate twoaddi
s for an address calculation. And it doesn't need both immediate values inld
andaddi
becauseld
andaddi
has the same bit size (signed 12 bits) for immediate value.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.
There are patterns which use
addi
. You can find them here, link. As you can see, last three examples show patterns which useaddi
. Only the first one usesld
to add an immediate value instead ofaddi
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.
I mean you don't need
target += imm
.target = imm
is enough because address is calculated with imm in auipc and one imm in ld or addi in patterns. If I am wrong, please let me knowThere 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.
I agree with you that
target = imm
is enough. My explanation fortarget += imm
is that i wanted to cover even those patterns which could exist and i didn't meet them. If you think that we shouldn't worry so much for the future I can change it totarget = imm
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.
IMO, we don't need to worry such cases. If there are such cases, it is a bug we need to fix or optimization candidates. :)
If target already has a value when we check
addi
, it means a value is set from otheraddi
orld
before.addi
for an address calculation.ld
andaddi
have the same offset bits. Soaddi
is redundant code in case of that target is set byld
before.However, if you want, you can leave it. That is what I set it a
Nit
.Thank you.