-
Notifications
You must be signed in to change notification settings - Fork 630
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
Do we have a standard format or document for assembly expression? #573
Comments
It was decided a while ago that assembly syntax was out of scope for the ISA manual (even though the ISA manual uses assembly examples in several places), see https:/riscv/riscv-asm-manual for the (very incomplete) documentation for the mips-derived syntax used by binutils and llvm. See also #540. |
My understanding is that this is the goal of https:/riscv/riscv-asm-manual , although it appears there's a lot of work to be done on that project. Your contributions would be appreciated! |
Closing as the other project exists. |
For example, instruction ADD
in the manual: "ADD performs the addition of rs1 and rs2."
is it
ADD rd, rs1, rs2
or
ADD rd, rs2, rs1
or
ADD rs1, rs2, rd
Another case, for floating point instruction with rounding mode,
FADD.S rd, rs1, rs2 ## DYN
FADD.S rd, rs1, rs2, rne ## nearest-even
this expression is from binutils, not in the manual.
Lots of assembly code in manual seems like there IS a format, if you know MIPS first.
In the vector extension, all instructions are introduced with assembly example.
Also, I have the book "The RISC-V Reader".
The appendix A is very helpful, provide very specific information.
ADD rd, rs1, rs2
x[rd] = x[rs1] + x[rs2]
AMOADD.W rd, rs2, (rs1)
x[rd] = AMO32(M[x[rs1]] + x[rs2])
BLE rs1, rs2. offset
if (rs1 <=s rs2) pc += sext(offset) ## correct one should be x[rs1] <=s x[rs2]
The text was updated successfully, but these errors were encountered: