You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
NOTE: Following the usual convention for CSR instructions, if the CSR
The "usual CSR conventions" are defined in the ISA Volume 1 Spec which says that write-side effects occur whenever rs1 is not x0 even if the register contents is zero:
"Note that if rs1 specifies a register other than x0, and that register holds a zero value, the instruction will not action any
attendant per-field side effects, but will action any side effects caused by writing to the entire CSR."
In particular, when following the usual CSR conventions the occurrence of a write-side effect can be determined purely by decoding the opcode and no read of the source operands is needed to detect this.
However this seems to be contradicted by the pseudo code that includes a check for rs1[4:0] being non-zero:
The spec says it follows the usual CSR conventions for write side-effects when accessing xnxti:
riscv-fast-interrupt/src/clic.adoc
Line 979 in 12f72cf
The "usual CSR conventions" are defined in the ISA Volume 1 Spec which says that write-side effects occur whenever rs1 is not x0 even if the register contents is zero:
"Note that if rs1 specifies a register other than x0, and that register holds a zero value, the instruction will not action any
attendant per-field side effects, but will action any side effects caused by writing to the entire CSR."
In particular, when following the usual CSR conventions the occurrence of a write-side effect can be determined purely by decoding the opcode and no read of the source operands is needed to detect this.
However this seems to be contradicted by the pseudo code that includes a check for rs1[4:0] being non-zero:
riscv-fast-interrupt/src/clic.adoc
Line 1029 in 12f72cf
I'd suggest reducing this line just to "if (rs1 != x0)"
The text was updated successfully, but these errors were encountered: