1 //===- RISCVScheduleB.td - RISC-V Scheduling Definitions B -*- tablegen -*-===//
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
7 //===----------------------------------------------------------------------===//
9 /// Define scheduler resources associated with def operands.
12 def WriteSHXADD : SchedWrite; // sh1add/sh2add/sh3add
13 def WriteSHXADD32 : SchedWrite; // sh1add.uw/sh2add.uw/sh3add.uw
16 def WriteRotateImm : SchedWrite;
17 def WriteRotateImm32 : SchedWrite;
18 def WriteRotateReg : SchedWrite;
19 def WriteRotateReg32 : SchedWrite;
20 def WriteCLZ : SchedWrite;
21 def WriteCLZ32 : SchedWrite;
22 def WriteCTZ : SchedWrite;
23 def WriteCTZ32 : SchedWrite;
24 def WriteCPOP : SchedWrite;
25 def WriteCPOP32 : SchedWrite;
26 def WriteREV8 : SchedWrite;
27 def WriteORCB : SchedWrite;
28 def WriteIMinMax : SchedWrite;
31 def WriteCLMUL : SchedWrite; // CLMUL/CLMULR/CLMULH
34 def WriteSingleBit : SchedWrite; // BCLR/BSET/BINV
35 def WriteSingleBitImm: SchedWrite; // BCLRI/BSETI/BINVI
36 def WriteBEXT : SchedWrite; // BEXT
37 def WriteBEXTI : SchedWrite; // BEXTI
40 def WriteBREV8 : SchedWrite; // brev8
41 def WritePACK : SchedWrite; // pack/packh
42 def WritePACK32 : SchedWrite; // packw
43 def WriteZIP : SchedWrite; // zip/unzip
46 def WriteXPERM : SchedWrite; // xperm4/xperm8
48 /// Define scheduler resources associated with use operands.
51 def ReadSHXADD : SchedRead; // sh1add/sh2add/sh3add
52 def ReadSHXADD32 : SchedRead; // sh1add.uw/sh2add.uw/sh3add.uw
55 def ReadRotateImm : SchedRead;
56 def ReadRotateImm32 : SchedRead;
57 def ReadRotateReg : SchedRead;
58 def ReadRotateReg32 : SchedRead;
59 def ReadCLZ : SchedRead;
60 def ReadCLZ32 : SchedRead;
61 def ReadCTZ : SchedRead;
62 def ReadCTZ32 : SchedRead;
63 def ReadCPOP : SchedRead;
64 def ReadCPOP32 : SchedRead;
65 def ReadREV8 : SchedRead;
66 def ReadORCB : SchedRead;
67 def ReadIMinMax : SchedRead;
70 def ReadCLMUL : SchedRead; // CLMUL/CLMULR/CLMULH
73 def ReadSingleBit : SchedRead; // BCLR/BSET/BINV/BEXT
74 def ReadSingleBitImm: SchedRead; // BCLRI/BSETI/BINVI/BEXTI
77 def ReadBREV8 : SchedRead; // brev8
78 def ReadPACK : SchedRead; // pack/packh
79 def ReadPACK32 : SchedRead; // packw
80 def ReadZIP : SchedRead; // zip/unzip
83 def ReadXPERM : SchedRead; // xperm4/xperm8
85 /// Define default scheduler resources for B.
87 multiclass UnsupportedSchedZba {
88 let Unsupported = true in {
89 def : WriteRes<WriteSHXADD, []>;
90 def : WriteRes<WriteSHXADD32, []>;
92 def : ReadAdvance<ReadSHXADD, 0>;
93 def : ReadAdvance<ReadSHXADD32, 0>;
97 multiclass UnsupportedSchedZbb {
98 let Unsupported = true in {
99 def : WriteRes<WriteRotateImm, []>;
100 def : WriteRes<WriteRotateImm32, []>;
101 def : WriteRes<WriteRotateReg, []>;
102 def : WriteRes<WriteRotateReg32, []>;
103 def : WriteRes<WriteCLZ, []>;
104 def : WriteRes<WriteCLZ32, []>;
105 def : WriteRes<WriteCTZ, []>;
106 def : WriteRes<WriteCTZ32, []>;
107 def : WriteRes<WriteCPOP, []>;
108 def : WriteRes<WriteCPOP32, []>;
109 def : WriteRes<WriteREV8, []>;
110 def : WriteRes<WriteORCB, []>;
111 def : WriteRes<WriteIMinMax, []>;
113 def : ReadAdvance<ReadRotateImm, 0>;
114 def : ReadAdvance<ReadRotateImm32, 0>;
115 def : ReadAdvance<ReadRotateReg, 0>;
116 def : ReadAdvance<ReadRotateReg32, 0>;
117 def : ReadAdvance<ReadCLZ, 0>;
118 def : ReadAdvance<ReadCLZ32, 0>;
119 def : ReadAdvance<ReadCTZ, 0>;
120 def : ReadAdvance<ReadCTZ32, 0>;
121 def : ReadAdvance<ReadCPOP, 0>;
122 def : ReadAdvance<ReadCPOP32, 0>;
123 def : ReadAdvance<ReadREV8, 0>;
124 def : ReadAdvance<ReadORCB, 0>;
125 def : ReadAdvance<ReadIMinMax, 0>;
129 multiclass UnsupportedSchedZbc {
130 let Unsupported = true in {
131 def : WriteRes<WriteCLMUL, []>;
133 def : ReadAdvance<ReadCLMUL, 0>;
137 multiclass UnsupportedSchedZbs {
138 let Unsupported = true in {
139 def : WriteRes<WriteSingleBit, []>;
140 def : WriteRes<WriteSingleBitImm, []>;
141 def : WriteRes<WriteBEXT, []>;
142 def : WriteRes<WriteBEXTI, []>;
144 def : ReadAdvance<ReadSingleBit, 0>;
145 def : ReadAdvance<ReadSingleBitImm, 0>;
149 multiclass UnsupportedSchedZbkb {
150 let Unsupported = true in {
151 def : WriteRes<WriteBREV8, []>;
152 def : WriteRes<WritePACK, []>;
153 def : WriteRes<WritePACK32, []>;
154 def : WriteRes<WriteZIP, []>;
156 def : ReadAdvance<ReadBREV8, 0>;
157 def : ReadAdvance<ReadPACK, 0>;
158 def : ReadAdvance<ReadPACK32, 0>;
159 def : ReadAdvance<ReadZIP, 0>;
163 multiclass UnsupportedSchedZbkx {
164 let Unsupported = true in {
165 def : WriteRes<WriteXPERM, []>;
167 def : ReadAdvance<ReadXPERM, 0>;