[llvm] [RISCV] Add srmcfg CSR from Ssqosid extension. (PR #79914)
Craig Topper via llvm-commits
llvm-commits at lists.llvm.org
Mon Jan 29 15:48:27 PST 2024
https://github.com/topperc created https://github.com/llvm/llvm-project/pull/79914
Based on the spec here https://github.com/riscv/riscv-ssqosid/releases/tag/v1.0-rc1
Ssqosid extension name will be added in a separate patch.
>From df0d518d4554945ad49b8267191e61c6ff96fa7a Mon Sep 17 00:00:00 2001
From: Craig Topper <craig.topper at sifive.com>
Date: Mon, 29 Jan 2024 15:44:56 -0800
Subject: [PATCH] [RISCV] Add srmcfg CSR from Ssqosid extension.
Based on the spec here https://github.com/riscv/riscv-ssqosid/releases/tag/v1.0-rc1
Ssqosid extension name will be added in a separate patch.
---
llvm/lib/Target/RISCV/RISCVSystemOperands.td | 5 +++++
llvm/test/MC/RISCV/supervisor-csr-names.s | 18 ++++++++++++++++++
2 files changed, 23 insertions(+)
diff --git a/llvm/lib/Target/RISCV/RISCVSystemOperands.td b/llvm/lib/Target/RISCV/RISCVSystemOperands.td
index 43475e825b46f..f046312b1d428 100644
--- a/llvm/lib/Target/RISCV/RISCVSystemOperands.td
+++ b/llvm/lib/Target/RISCV/RISCVSystemOperands.td
@@ -132,6 +132,11 @@ def : SysReg<"sip", 0x144>;
let DeprecatedName = "sptbr" in
def : SysReg<"satp", 0x180>;
+//===----------------------------------------------------------------------===//
+// Quality-of-Service(QoS) Identifiers (Ssqosid)
+//===----------------------------------------------------------------------===//
+def : SysReg<"srmcfg", 0x181>;
+
//===----------------------------------------------------------------------===//
// Debug/Trace Registers
//===----------------------------------------------------------------------===//
diff --git a/llvm/test/MC/RISCV/supervisor-csr-names.s b/llvm/test/MC/RISCV/supervisor-csr-names.s
index 84f9edd595d09..127812de4bdc9 100644
--- a/llvm/test/MC/RISCV/supervisor-csr-names.s
+++ b/llvm/test/MC/RISCV/supervisor-csr-names.s
@@ -196,6 +196,24 @@ csrrs t1, satp, zero
# uimm12
csrrs t2, 0x180, zero
+#########################################
+# Quality-of-Service(QoS) Identifiers
+#########################################
+
+# srmcfg
+# name
+# CHECK-INST: csrrs t1, srmcfg, zero
+# CHECK-ENC: encoding: [0x73,0x23,0x10,0x18]
+# CHECK-INST-ALIAS: csrr t1, srmcfg
+# uimm12
+# CHECK-INST: csrrs t2, srmcfg, zero
+# CHECK-ENC: encoding: [0xf3,0x23,0x10,0x18]
+# CHECK-INST-ALIAS: csrr t2, srmcfg
+# name
+csrrs t1, srmcfg, zero
+# uimm12
+csrrs t2, 0x181, zero
+
#########################################
# Debug/Trace Registers
#########################################
More information about the llvm-commits
mailing list