xref: /freebsd/contrib/llvm-project/llvm/lib/Target/RISCV/RISCVScheduleZb.td (revision 66fd12cf4896eb08ad8e7a2627537f84ead84dd3)
1//===-- RISCVScheduleB.td - RISCV Scheduling Definitions B -*- tablegen -*-===//
2//
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
6//
7//===----------------------------------------------------------------------===//
8
9/// Define scheduler resources associated with def operands.
10
11// Zba extension
12def WriteSHXADD      : SchedWrite; // sh1add/sh2add/sh3add
13def WriteSHXADD32    : SchedWrite; // sh1add.uw/sh2add.uw/sh3add.uw
14
15// Zbb extension
16def WriteRotateImm   : SchedWrite;
17def WriteRotateImm32 : SchedWrite;
18def WriteRotateReg   : SchedWrite;
19def WriteRotateReg32 : SchedWrite;
20def WriteCLZ         : SchedWrite;
21def WriteCLZ32       : SchedWrite;
22def WriteCTZ         : SchedWrite;
23def WriteCTZ32       : SchedWrite;
24def WriteCPOP        : SchedWrite;
25def WriteCPOP32      : SchedWrite;
26def WriteREV8        : SchedWrite;
27def WriteORCB        : SchedWrite;
28
29// Zbc extension
30def WriteCLMUL       : SchedWrite; // CLMUL/CLMULR/CLMULH
31
32// Zbs extension
33def WriteSingleBit   : SchedWrite; // BCLR/BSET/BINV/BEXT
34def WriteSingleBitImm: SchedWrite; // BCLRI/BSETI/BINVI/BEXTI
35
36// Zbkb extension
37def WriteBREV8       : SchedWrite; // brev8
38def WritePACK        : SchedWrite; // pack/packh
39def WritePACK32      : SchedWrite; // packw
40def WriteZIP         : SchedWrite; // zip/unzip
41
42// Zbkx extension
43def WriteXPERM       : SchedWrite; // xperm4/xperm8
44
45/// Define scheduler resources associated with use operands.
46
47// Zba extension
48def ReadSHXADD      : SchedRead; // sh1add/sh2add/sh3add
49def ReadSHXADD32    : SchedRead; // sh1add.uw/sh2add.uw/sh3add.uw
50
51// Zbb extension
52def ReadRotateImm   : SchedRead;
53def ReadRotateImm32 : SchedRead;
54def ReadRotateReg   : SchedRead;
55def ReadRotateReg32 : SchedRead;
56def ReadCLZ         : SchedRead;
57def ReadCLZ32       : SchedRead;
58def ReadCTZ         : SchedRead;
59def ReadCTZ32       : SchedRead;
60def ReadCPOP        : SchedRead;
61def ReadCPOP32      : SchedRead;
62def ReadREV8        : SchedRead;
63def ReadORCB        : SchedRead;
64
65// Zbc extension
66def ReadCLMUL       : SchedRead; // CLMUL/CLMULR/CLMULH
67
68// Zbs extension
69def ReadSingleBit   : SchedRead; // BCLR/BSET/BINV/BEXT
70def ReadSingleBitImm: SchedRead; // BCLRI/BSETI/BINVI/BEXTI
71
72// Zbkb extension
73def ReadBREV8       : SchedRead; // brev8
74def ReadPACK        : SchedRead; // pack/packh
75def ReadPACK32      : SchedRead; // packw
76def ReadZIP         : SchedRead; // zip/unzip
77
78// Zbkx extension
79def ReadXPERM       : SchedRead; // xperm4/xperm8
80
81/// Define default scheduler resources for B.
82
83multiclass UnsupportedSchedZba {
84let Unsupported = true in {
85def : WriteRes<WriteSHXADD, []>;
86def : WriteRes<WriteSHXADD32, []>;
87
88def : ReadAdvance<ReadSHXADD, 0>;
89def : ReadAdvance<ReadSHXADD32, 0>;
90}
91}
92
93multiclass UnsupportedSchedZbb {
94let Unsupported = true in {
95def : WriteRes<WriteRotateImm, []>;
96def : WriteRes<WriteRotateImm32, []>;
97def : WriteRes<WriteRotateReg, []>;
98def : WriteRes<WriteRotateReg32, []>;
99def : WriteRes<WriteCLZ, []>;
100def : WriteRes<WriteCLZ32, []>;
101def : WriteRes<WriteCTZ, []>;
102def : WriteRes<WriteCTZ32, []>;
103def : WriteRes<WriteCPOP, []>;
104def : WriteRes<WriteCPOP32, []>;
105def : WriteRes<WriteREV8, []>;
106def : WriteRes<WriteORCB, []>;
107
108def : ReadAdvance<ReadRotateImm, 0>;
109def : ReadAdvance<ReadRotateImm32, 0>;
110def : ReadAdvance<ReadRotateReg, 0>;
111def : ReadAdvance<ReadRotateReg32, 0>;
112def : ReadAdvance<ReadCLZ, 0>;
113def : ReadAdvance<ReadCLZ32, 0>;
114def : ReadAdvance<ReadCTZ, 0>;
115def : ReadAdvance<ReadCTZ32, 0>;
116def : ReadAdvance<ReadCPOP, 0>;
117def : ReadAdvance<ReadCPOP32, 0>;
118def : ReadAdvance<ReadREV8, 0>;
119def : ReadAdvance<ReadORCB, 0>;
120}
121}
122
123multiclass UnsupportedSchedZbc {
124let Unsupported = true in {
125def : WriteRes<WriteCLMUL, []>;
126
127def : ReadAdvance<ReadCLMUL, 0>;
128}
129}
130
131multiclass UnsupportedSchedZbs {
132let Unsupported = true in {
133def : WriteRes<WriteSingleBit, []>;
134def : WriteRes<WriteSingleBitImm, []>;
135
136def : ReadAdvance<ReadSingleBit, 0>;
137def : ReadAdvance<ReadSingleBitImm, 0>;
138}
139}
140
141multiclass UnsupportedSchedZbkb {
142let Unsupported = true in {
143def : WriteRes<WriteBREV8, []>;
144def : WriteRes<WritePACK, []>;
145def : WriteRes<WritePACK32, []>;
146def : WriteRes<WriteZIP, []>;
147
148def : ReadAdvance<ReadBREV8, 0>;
149def : ReadAdvance<ReadPACK, 0>;
150def : ReadAdvance<ReadPACK32, 0>;
151def : ReadAdvance<ReadZIP, 0>;
152}
153}
154
155multiclass UnsupportedSchedZbkx {
156let Unsupported = true in {
157def : WriteRes<WriteXPERM, []>;
158
159def : ReadAdvance<ReadXPERM, 0>;
160}
161}
162