[llvm] [RISCV][ISel] Add ISel support for experimental Zimop extension (PR #77089)

Wang Pengcheng via llvm-commits llvm-commits at lists.llvm.org
Thu Jan 18 19:36:15 PST 2024


================
@@ -57,3 +65,17 @@ foreach i = 0...7 in {
   def MOPRR#i : RVMoprr<0b1001, i, 0b100, OPC_SYSTEM, "mop.rr."#i>,
                 Sched<[]>;
 }
+
+let Predicates = [HasStdExtZimop] in {
+// Zimop instructions
+foreach i = 0...31 in {
+  def : Pat<(XLenVT (riscv_mopr GPR:$rs1, (XLenVT i))),
+            (!cast<Instruction>("MOPR"#i) GPR:$rs1)>;
+}
+
+foreach i = 0...7 in {
+  def : Pat<(XLenVT (riscv_moprr GPR:$rs1, GPR:$rs2, (XLenVT i))),
+            (!cast<Instruction>("MOPRR"#i) GPR:$rs1, GPR:$rs2)>;
+}
+
+} // Predicates = [HasStdExtZimop]
----------------
wangpc-pp wrote:

We need a empty line at the end of file.

https://github.com/llvm/llvm-project/pull/77089


More information about the llvm-commits mailing list