Make the definitions of hpmcounter3-hpmcounter31,
hpmcounter3h-hpmcounter31h, mhpmcounter3-mhpmcounter31,
mhpmcounter3h-mhpmcounter31h, pmpaddr0-pmpaddr63, mhpmevent3-31, and
pmpcfg0-15 substantially less repetitive using a foreach loop.
Details
Details
Diff Detail
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
llvm/lib/Target/RISCV/RISCVSystemOperands.td | ||
---|---|---|
268–269 | I think pmpcfg can also be compressed. |
llvm/lib/Target/RISCV/RISCVSystemOperands.td | ||
---|---|---|
268–269 | It could, but I wasn't convinced it would be an improvement given the interleaving of the RV32-only odd registers along with the RV32/RV64 even registers. |
llvm/lib/Target/RISCV/RISCVSystemOperands.td | ||
---|---|---|
268–269 | // pmpcfg0-pmpcfg15 at 0x3A0-0x3AF. let isRV32Only = !and(i, 1) in def : SysReg<"pmpcfg"#i, !add(0x3A0, i)>; |
llvm/lib/Target/RISCV/RISCVSystemOperands.td | ||
---|---|---|
268–269 |
How about this way? |
llvm/lib/Target/RISCV/RISCVSystemOperands.td | ||
---|---|---|
268–269 | Thanks, I've adopted that. |
I think pmpcfg can also be compressed.