[PATCH] D89288: [RISCV] Enable the use of the old sptbr name
ShihPo Hung via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Mon Oct 12 20:15:05 PDT 2020
arcbbb created this revision.
arcbbb added reviewers: asb, pzheng.
Herald added subscribers: llvm-commits, evandro, luismarques, apazos, sameer.abuasal, s.egerton, lenary, Jim, benna, psnobl, jocewei, PkmX, the_o, brucehoult, MartinMosbeck, rogfer01, edward-jones, zzheng, jrtc27, shiva0217, kito-cheng, niosHD, sabuasal, simoncook, johnrusso, rbar, hiraditya.
Herald added a project: LLVM.
arcbbb requested review of this revision.
Herald added a subscriber: MaskRay.
RISCV-V Privileged Specification 1.10 Preface defines satp, which has the same numeric CSR value as sptbr from 1.09.1.
This patch enables the use of the old sptbr name.
Repository:
rG LLVM Github Monorepo
https://reviews.llvm.org/D89288
Files:
llvm/lib/Target/RISCV/RISCVSystemOperands.td
llvm/test/MC/RISCV/supervisor-csr-names.s
Index: llvm/test/MC/RISCV/supervisor-csr-names.s
===================================================================
--- llvm/test/MC/RISCV/supervisor-csr-names.s
+++ llvm/test/MC/RISCV/supervisor-csr-names.s
@@ -191,3 +191,17 @@
csrrs t1, satp, zero
# uimm12
csrrs t2, 0x180, zero
+
+# sptbr
+# name
+# CHECK-INST: csrrs t1, satp, zero
+# CHECK-ENC: encoding: [0x73,0x23,0x00,0x18]
+# CHECK-INST-ALIAS: csrr t1, satp
+# uimm12
+# CHECK-INST: csrrs t2, satp, zero
+# CHECK-ENC: encoding: [0xf3,0x23,0x00,0x18]
+# CHECK-INST-ALIAS: csrr t2, satp
+# name
+csrrs t1, sptbr, zero
+# uimm12
+csrrs t2, 0x180, zero
Index: llvm/lib/Target/RISCV/RISCVSystemOperands.td
===================================================================
--- llvm/lib/Target/RISCV/RISCVSystemOperands.td
+++ llvm/lib/Target/RISCV/RISCVSystemOperands.td
@@ -175,6 +175,7 @@
//===-------------------------------------
// Supervisor Protection and Translation
//===-------------------------------------
+let AltName = "sptbr" in // described in Privileged spec v1.10 Preface
def : SysReg<"satp", 0x180>;
//===-----------------------------
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D89288.297748.patch
Type: text/x-patch
Size: 1120 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20201013/45d68e00/attachment.bin>
More information about the llvm-commits
mailing list