[PATCH] D156092: [RISCV] Add a common class for cm.push, cm.popret, cm.popretz and cm.pop.
Jim Lin via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Mon Jul 24 19:12:42 PDT 2023
This revision was automatically updated to reflect the committed changes.
Closed by commit rG2398e260806f: [RISCV] Add a common class for cm.push, cm.popret, cm.popretz and cm.pop. (authored by Jim).
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D156092/new/
https://reviews.llvm.org/D156092
Files:
llvm/lib/Target/RISCV/RISCVInstrInfoZc.td
Index: llvm/lib/Target/RISCV/RISCVInstrInfoZc.td
===================================================================
--- llvm/lib/Target/RISCV/RISCVInstrInfoZc.td
+++ llvm/lib/Target/RISCV/RISCVInstrInfoZc.td
@@ -129,10 +129,16 @@
let Constraints = "$rd = $rd_wb";
}
-class RVInstZcCPPP<dag outs, dag ins, string opcodestr, string argstr>
- : RVInst16<outs, ins, opcodestr, argstr, [], InstFormatOther> {
+class RVInstZcCPPP<bits<5> funct5, string opcodestr>
+ : RVInst16<(outs), (ins rlist:$rlist, spimm:$spimm),
+ opcodestr, "{$rlist}, $spimm", [], InstFormatOther> {
+ bits<4> rlist;
+ bits<16> spimm;
let Inst{1-0} = 0b10;
+ let Inst{3-2} = spimm{5-4};
+ let Inst{7-4} = rlist;
+ let Inst{12-8} = funct5;
let Inst{15-13} = 0b101;
}
@@ -189,49 +195,17 @@
} // DecoderNamespace = "RVZcmp", Predicates = [HasStdExtZcmp]...
let DecoderNamespace = "RVZcmp", Predicates = [HasStdExtZcmp] in {
-let hasSideEffects = 0, mayLoad = 0, mayStore = 1 in
-def CM_PUSH : RVInstZcCPPP<(outs), (ins rlist:$rlist, spimm:$spimm),
- "cm.push", "{$rlist}, $spimm"> {
- bits<4> rlist;
- bits<16> spimm;
-
- let Inst{12-8} = 0b11000;
- let Inst{7-4} = rlist;
- let Inst{3-2} = spimm{5-4};
-}
-
-let hasSideEffects = 0, mayLoad = 1, mayStore = 0 in
-def CM_POPRET : RVInstZcCPPP<(outs), (ins rlist:$rlist, spimm:$spimm),
- "cm.popret", "{$rlist}, $spimm"> {
- bits<4> rlist;
- bits<16> spimm;
-
- let Inst{12-8} = 0b11110;
- let Inst{7-4} = rlist;
- let Inst{3-2} = spimm{5-4};
-}
-
-let hasSideEffects = 0, mayLoad = 1, mayStore = 0 in
-def CM_POPRETZ : RVInstZcCPPP<(outs), (ins rlist:$rlist, spimm:$spimm),
- "cm.popretz", "{$rlist}, $spimm"> {
- bits<4> rlist;
- bits<16> spimm;
+let hasSideEffects = 0, mayLoad = 0, mayStore = 1 in
+def CM_PUSH : RVInstZcCPPP<0b11000, "cm.push">;
- let Inst{12-8} = 0b11100;
- let Inst{7-4} = rlist;
- let Inst{3-2} = spimm{5-4};
-}
+let hasSideEffects = 0, mayLoad = 1, mayStore = 0 in
+def CM_POPRET : RVInstZcCPPP<0b11110, "cm.popret">;
-let hasSideEffects = 0, mayLoad = 1, mayStore = 0 in
-def CM_POP : RVInstZcCPPP<(outs), (ins rlist:$rlist, spimm:$spimm),
- "cm.pop", "{$rlist}, $spimm"> {
- bits<4> rlist;
- bits<16> spimm;
+let hasSideEffects = 0, mayLoad = 1, mayStore = 0 in
+def CM_POPRETZ : RVInstZcCPPP<0b11100, "cm.popretz">;
- let Inst{12-8} = 0b11010;
- let Inst{7-4} = rlist;
- let Inst{3-2} = spimm{5-4};
-}
+let hasSideEffects = 0, mayLoad = 1, mayStore = 0 in
+def CM_POP : RVInstZcCPPP<0b11010, "cm.pop">;
} // DecoderNamespace = "RVZcmp", Predicates = [HasStdExtZcmp]...
let DecoderNamespace = "RVZcmt", Predicates = [HasStdExtZcmt],
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D156092.543785.patch
Type: text/x-patch
Size: 2672 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20230725/46b60a8b/attachment.bin>
More information about the llvm-commits
mailing list