[llvm] [RISCV][MC] Support Base P non-GPR pair instructions (PR #137927)

Craig Topper via llvm-commits llvm-commits at lists.llvm.org
Wed Apr 30 11:23:45 PDT 2025


================
@@ -0,0 +1,145 @@
+//===-- RISCVInstrInfoP.td - RISC-V 'P' instructions -------*- tablegen -*-===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+//
+// This file describes the RISC-V instructions from the standard 'Base P'
+// Packed SIMD instruction set extension.
+//
+//  This version is still experimental as the 'P' extension hasn't been
+//  ratified yet.
+//
+//===----------------------------------------------------------------------===//
+
+//===----------------------------------------------------------------------===//
+// Operand and SDNode transformation definitions.
+//===----------------------------------------------------------------------===//
+
+def simm10 : RISCVSImmLeafOp<10>;
+
+//===----------------------------------------------------------------------===//
+// Instruction class templates
+//===----------------------------------------------------------------------===//
+
+let hasSideEffects = 0, mayLoad = 0, mayStore = 0 in
+class RVPUnaryImm9<bits<7> funct7, string opcodestr>
+    : RVInstIBase<0b010, OPC_OP_IMM_32, (outs GPR:$rd), (ins simm10:$simm10),
----------------
topperc wrote:

I sent a message to the mailing list https://lists.riscv.org/g/tech-p-ext/message/568. It's not clear to me if plui.w/h should diverge from base ISA lui which uses unsigned immediate.

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


More information about the llvm-commits mailing list