-
Notifications
You must be signed in to change notification settings - Fork 311
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
Added the rest of 1:1 PseudoInstructions #278
Added the rest of 1:1 PseudoInstructions #278
Conversation
11daad8
to
569f1bd
Compare
…to be made Co-authored-by: Alfredo Rodrigues <[email protected]> Signed-off-by: Afonso Oliveira <[email protected]>
569f1bd
to
13be4ee
Compare
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 was worried that pseduo-ops with the same name as real instructions might cause problems somewhere, but so far, everything seems OK. We can always roll back the addition of jal
and jalr
pseudoinstructions in the future if need be.
After your comment, I looked deeper on what's really happening with those specific cases, and, even though they are not breaking anything, your instinct is in fact correct.
This results in:
I can actually fix this, but the way I found to be more straight-forward is to actually add a "Pseudo" keyword before this intructions. This can be done either on the processing code (for all the pseudo-instructions) or in the definition (like this: $pseudo_op rv_i::jalr pseudo_jalr rs1 31..20=0 14..12=0 11..7=0x01 6..2=0x19 1..0=3) The second, seems to be smoother since it would only affect the targeted instructions, but I'm not sure if this problem may appear again in the future and therefore I would like to hear your opinion on this. |
I think it would be much cleaner to have the script detect this case automatically (by observing the name collision) and do whatever is necessary. We don't want the extra boilerplate |
Ok, then, I will do that and reference this PR then. Thank you. |
Thank you for your help, @AFOliveira! |
Complementing #277, there were a few 1:1 pseudo instructions that were missing.
Below is the list with the link to the asm manual:
I
j
jal
jr
jalr
Zicsr
csrr
csrw
csrs
csrc
csrwi
csrsi
csrci