[llvm] [RISCV] Add QingKe "XW" compressed opcode extension (PR #97925)
Craig Topper via llvm-commits
llvm-commits at lists.llvm.org
Sun Jul 7 20:09:05 PDT 2024
================
@@ -0,0 +1,188 @@
+//===-- RISCVInstrInfoXwch.td ------------------------------*- 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 vendor extension(s) defined by WCH.
+//
+//===----------------------------------------------------------------------===//
+
+class QK_Stack<bits<2> funct2, dag outs, dag ins, string opcodestr, string argstr>
+ : RVInst16<outs, ins, opcodestr, argstr, [], InstFormatOther> {
+ bits<3> rd_rs2;
+
+ let Inst{15-11} = 0b10000;
+ let Inst{6-5} = funct2;
+ let Inst{4-2} = rd_rs2;
+ let Inst{1-0} = 0b00;
+}
+
+//===----------------------------------------------------------------------===//
+// Operand definitions.
+//===----------------------------------------------------------------------===//
+
+def uimm4_with_predicate : RISCVUImmLeafOp<4> {
----------------
topperc wrote:
You can use `RISCVOp`, you don't need the ImmLeaf part.
https://github.com/llvm/llvm-project/pull/97925
More information about the llvm-commits
mailing list