The RISC-V debug register was named dscratch in a previous draft of the RISC-V
debug mode spec. The number of registers has been increased to 2 in the latest
ratified version of the debug mode spec and the registers were named dscratch0
and dscratch1. We still support using the old register name "dscratch", but it
would be disassembled as "dscratch0" with this change.
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
llvm/lib/Target/RISCV/RISCVSystemOperands.td | ||
---|---|---|
358 | I think def : SysReg<"dscratch0", 0x7B2> { let AltName = "dscratch"; } is nicer, but otherwise please drop the braces, ie: let AltName = "dscratch" in def : SysReg<"dscratch0", 0x7B2> |
llvm/lib/Target/RISCV/RISCVSystemOperands.td | ||
---|---|---|
23 | I think this limitation is fine. |
Sorry to ask you to move things back, but I think the debug CSR tests would make most sense in machine-csr-names.s on the basis that the privileged spec does list those CSRs in the "machine-level CSR names" table.
llvm/lib/Target/RISCV/RISCVSystemOperands.td | ||
---|---|---|
23 | I agree the limitation isn't a problem for the RISC-V backend right now. It's conceivable it could become one. My only concern with leaving it as a FIXME is it might prompt someone to invest effort in this when there's not much reason to do so. Maybe better as // Note: changes to SearchableTableEmitter may be needed if multiple aliases are needed in the future. But I'm not sure what is most consistent with the use of FIXME elsewhere in the codebase. Plus a note like that risks becoming stale. With that in mind, I'd err towards a factual // A maximum of one alias is supported right now. But ultimately, I don't have a particularly strong view about how to best comment this. |
LGTM, thanks. Left one tiny nit inline.
llvm/lib/Target/RISCV/Utils/RISCVBaseInfo.h | ||
---|---|---|
160 | I'd drop this FIXME - it's not an immediate problem and the limitation is documented in RISCVSystemOperands.td |
I think this limitation is fine.
I have not seen a case with CSRs where we need a list of strings to support multiple aliases.
Let's see what Alex or others say