-
Notifications
You must be signed in to change notification settings - Fork 6
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
Improve RISC-V pseudo-instructions #12
Comments
There is a field for adding pseudo instructions to an instruction definition. For example, in riscv-unified-db/arch/inst/B/add.uw.yaml Lines 25 to 27 in 1ad462f
It's not super thought-out, though, and could probably use some tweaking. Getting some more examples of pseudo instructions we want to define would help. |
Maybe we can get a full list from someone with experience with the RISC-V toolchains (like Ana)? |
Here's an interesting case: RDCYCLE is a pseudo instruction defined by Zicntr, but it's an alias of A few possibilities:
I'm inclined to prefer 1. since it matches what we're doing for CSRs/CSR fields, but that's not a strong preference. |
Either solution looks good to me. |
Please correct me if I misunderstood all of this, but doesn't this mean that the riscv-opcodes is so far wrong in defining this pseudo-instruction(and many more from what I have checked)? Since the instruction is defined as
inside the rv_zicsr file. It seems even a bit more tricky than this since there isn't even a rv_zicntr file, while the spec definitely has them as two different extensions: |
Yes, I believe riscv-opcodes is incorrect in this case. In general, I've found that there is quite a bit related to Zicsr/Zicntr/Zihpm that is not correct in the spec/riscv-opcodes, etc. Presumably, this is because those extensions were bolted on as an afterthought; originally, everything was defined in the base architecture. |
Can we add defined pseudo-instructions to riscv-unified-db?
Here's a port of a post by Ved (link):
"ARC discussed a question about the location of pseudo- instructions with respect to the ISA manual and concluded that a list of pseudo-instructions should be included in the ISA manual. A PR is planned."
The text was updated successfully, but these errors were encountered: