]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - contrib/llvm/lib/Target/SystemZ/SystemZScheduleZ13.td
Merge ^/head r312894 through r312967.
[FreeBSD/FreeBSD.git] / contrib / llvm / lib / Target / SystemZ / SystemZScheduleZ13.td
1 //-- SystemZScheduleZ13.td - SystemZ Scheduling Definitions ----*- tblgen -*-=//
2 //
3 //                     The LLVM Compiler Infrastructure
4 //
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
7 //
8 //===----------------------------------------------------------------------===//
9 //
10 // This file defines the machine model for Z13 to support instruction
11 // scheduling and other instruction cost heuristics.
12 //
13 //===----------------------------------------------------------------------===//
14
15 def Z13Model : SchedMachineModel {
16
17     let UnsupportedFeatures = Arch11UnsupportedFeatures.List;
18     
19     let IssueWidth = 8;
20     let MicroOpBufferSize = 60;     // Issue queues
21     let LoadLatency = 1;            // Optimistic load latency.
22
23     let PostRAScheduler = 1;
24
25     // Extra cycles for a mispredicted branch.
26     let MispredictPenalty = 20;
27 }
28
29 let SchedModel = Z13Model in  {
30
31 // These definitions could be put in a subtarget common include file,
32 // but it seems the include system in Tablegen currently rejects
33 // multiple includes of same file.
34 def : WriteRes<GroupAlone, []> {
35   let NumMicroOps = 0;
36   let BeginGroup  = 1;
37   let EndGroup    = 1;
38 }
39 def : WriteRes<BeginGroup, []> {
40   let NumMicroOps = 0;
41   let BeginGroup  = 1;
42 }
43 def : WriteRes<EndGroup, []> {
44   let NumMicroOps = 0;
45   let EndGroup    = 1;
46 }
47 def : WriteRes<Lat2, []> { let Latency = 2; let NumMicroOps = 0;}
48 def : WriteRes<Lat3, []> { let Latency = 3; let NumMicroOps = 0;}
49 def : WriteRes<Lat4, []> { let Latency = 4; let NumMicroOps = 0;}
50 def : WriteRes<Lat5, []> { let Latency = 5; let NumMicroOps = 0;}
51 def : WriteRes<Lat6, []> { let Latency = 6; let NumMicroOps = 0;}
52 def : WriteRes<Lat7, []> { let Latency = 7; let NumMicroOps = 0;}
53 def : WriteRes<Lat8, []> { let Latency = 8; let NumMicroOps = 0;}
54 def : WriteRes<Lat9, []> { let Latency = 9; let NumMicroOps = 0;}
55 def : WriteRes<Lat10, []> { let Latency = 10; let NumMicroOps = 0;}
56 def : WriteRes<Lat11, []> { let Latency = 11; let NumMicroOps = 0;}
57 def : WriteRes<Lat12, []> { let Latency = 12; let NumMicroOps = 0;}
58 def : WriteRes<Lat15, []> { let Latency = 15; let NumMicroOps = 0;}
59 def : WriteRes<Lat20, []> { let Latency = 20; let NumMicroOps = 0;}
60 def : WriteRes<Lat30, []> { let Latency = 30; let NumMicroOps = 0;}
61
62 // Execution units.
63 def Z13_FXaUnit     : ProcResource<2>;
64 def Z13_FXbUnit     : ProcResource<2>;
65 def Z13_LSUnit      : ProcResource<2>;
66 def Z13_VecUnit     : ProcResource<2>;
67 def Z13_VecFPdUnit  : ProcResource<2> { let BufferSize = 1; /* blocking */ }
68 def Z13_VBUnit      : ProcResource<2>;
69
70 // Subtarget specific definitions of scheduling resources.
71 def : WriteRes<FXa,     [Z13_FXaUnit]> { let Latency = 1; }
72 def : WriteRes<FXa2,    [Z13_FXaUnit, Z13_FXaUnit]> { let Latency = 2; }
73 def : WriteRes<FXb,     [Z13_FXbUnit]> { let Latency = 1; }
74 def : WriteRes<LSU,     [Z13_LSUnit]>  { let Latency = 4; }
75 def : WriteRes<VecBF,   [Z13_VecUnit]> { let Latency = 8; }
76 def : WriteRes<VecBF2,  [Z13_VecUnit, Z13_VecUnit]> { let Latency = 9; }
77 def : WriteRes<VecDF,   [Z13_VecUnit]> { let Latency = 8; }
78 def : WriteRes<VecDF2,  [Z13_VecUnit, Z13_VecUnit]> { let Latency = 9; }
79 def : WriteRes<VecFPd,  [Z13_VecFPdUnit, Z13_VecFPdUnit, Z13_VecFPdUnit,
80                          Z13_VecFPdUnit, Z13_VecFPdUnit, Z13_VecFPdUnit,
81                          Z13_VecFPdUnit, Z13_VecFPdUnit, Z13_VecFPdUnit,
82                          Z13_VecFPdUnit, Z13_VecFPdUnit, Z13_VecFPdUnit,
83                          Z13_VecFPdUnit, Z13_VecFPdUnit, Z13_VecFPdUnit,
84                          Z13_VecFPdUnit, Z13_VecFPdUnit, Z13_VecFPdUnit,
85                          Z13_VecFPdUnit, Z13_VecFPdUnit, Z13_VecFPdUnit,
86                          Z13_VecFPdUnit, Z13_VecFPdUnit, Z13_VecFPdUnit,
87                          Z13_VecFPdUnit, Z13_VecFPdUnit, Z13_VecFPdUnit,
88                          Z13_VecFPdUnit, Z13_VecFPdUnit, Z13_VecFPdUnit]>
89                          { let Latency = 30; }
90 def : WriteRes<VecMul,  [Z13_VecUnit]> { let Latency = 5; }
91 def : WriteRes<VecStr,  [Z13_VecUnit]> { let Latency = 4; }
92 def : WriteRes<VecXsPm, [Z13_VecUnit]> { let Latency = 3; }
93 def : WriteRes<VBU,     [Z13_VBUnit]>; // Virtual Branching Unit
94
95 // -------------------------- INSTRUCTIONS ---------------------------------- //
96
97 // InstRW constructs have been used in order to preserve the
98 // readability of the InstrInfo files.
99
100 // For each instruction, as matched by a regexp, provide a list of
101 // resources that it needs. These will be combined into a SchedClass.
102
103 //===----------------------------------------------------------------------===//
104 // Stack allocation
105 //===----------------------------------------------------------------------===//
106
107 def : InstRW<[FXa], (instregex "ADJDYNALLOC$")>; // Pseudo -> LA / LAY
108
109 //===----------------------------------------------------------------------===//
110 // Branch instructions
111 //===----------------------------------------------------------------------===//
112
113 // Branch
114 def : InstRW<[VBU], (instregex "(Call)?BRC(L)?(Asm.*)?$")>;
115 def : InstRW<[VBU], (instregex "(Call)?J(G)?(Asm.*)?$")>;
116 def : InstRW<[FXb], (instregex "(Call)?BC(R)?(Asm.*)?$")>;
117 def : InstRW<[FXb], (instregex "(Call)?B(R)?(Asm.*)?$")>;
118 def : InstRW<[FXa, EndGroup], (instregex "BRCT(G)?$")>;
119 def : InstRW<[FXb, FXa, Lat2, GroupAlone], (instregex "BRCTH$")>;
120 def : InstRW<[FXb, FXa, Lat2, GroupAlone], (instregex "BCT(G)?(R)?$")>;
121 def : InstRW<[FXa, FXa, FXb, FXb, Lat4, GroupAlone],
122              (instregex "B(R)?X(H|L).*$")>;
123
124 // Compare and branch
125 def : InstRW<[FXb], (instregex "C(L)?(G)?(I|R)J(Asm.*)?$")>;
126 def : InstRW<[FXb, FXb, Lat2, GroupAlone],
127              (instregex "C(L)?(G)?(I|R)B(Call|Return|Asm.*)?$")>;
128
129 //===----------------------------------------------------------------------===//
130 // Trap instructions
131 //===----------------------------------------------------------------------===//
132
133 // Trap
134 def : InstRW<[VBU], (instregex "(Cond)?Trap$")>;
135
136 // Compare and trap
137 def : InstRW<[FXb], (instregex "C(G)?(I|R)T(Asm.*)?$")>;
138 def : InstRW<[FXb], (instregex "CL(G)?RT(Asm.*)?$")>;
139 def : InstRW<[FXb], (instregex "CL(F|G)IT(Asm.*)?$")>;
140 def : InstRW<[FXb, LSU, Lat5], (instregex "CL(G)?T(Asm.*)?$")>;
141
142 //===----------------------------------------------------------------------===//
143 // Call and return instructions
144 //===----------------------------------------------------------------------===//
145
146 // Call
147 def : InstRW<[VBU, FXa, FXa, Lat3, GroupAlone], (instregex "(Call)?BRAS$")>;
148 def : InstRW<[FXa, FXa, FXb, Lat3, GroupAlone], (instregex "(Call)?BRASL$")>;
149 def : InstRW<[FXa, FXa, FXb, Lat3, GroupAlone], (instregex "(Call)?BAS(R)?$")>;
150 def : InstRW<[FXa, FXa, FXb, Lat3, GroupAlone], (instregex "TLS_(G|L)DCALL$")>;
151
152 // Return
153 def : InstRW<[FXb, EndGroup], (instregex "Return$")>;
154 def : InstRW<[FXb], (instregex "CondReturn$")>;
155
156 //===----------------------------------------------------------------------===//
157 // Select instructions
158 //===----------------------------------------------------------------------===//
159
160 // Select pseudo 
161 def : InstRW<[FXa], (instregex "Select(32|64|32Mux)$")>;
162
163 // CondStore pseudos
164 def : InstRW<[FXa], (instregex "CondStore16(Inv)?$")>;
165 def : InstRW<[FXa], (instregex "CondStore16Mux(Inv)?$")>;
166 def : InstRW<[FXa], (instregex "CondStore32(Inv)?$")>;
167 def : InstRW<[FXa], (instregex "CondStore32Mux(Inv)?$")>;
168 def : InstRW<[FXa], (instregex "CondStore64(Inv)?$")>;
169 def : InstRW<[FXa], (instregex "CondStore8(Inv)?$")>;
170 def : InstRW<[FXa], (instregex "CondStore8Mux(Inv)?$")>;
171
172 //===----------------------------------------------------------------------===//
173 // Move instructions
174 //===----------------------------------------------------------------------===//
175
176 // Moves
177 def : InstRW<[FXb, LSU, Lat5], (instregex "MV(G|H)?HI$")>;
178 def : InstRW<[FXb, LSU, Lat5], (instregex "MVI(Y)?$")>;
179
180 // Move character
181 def : InstRW<[FXb, LSU, LSU, LSU, Lat8, GroupAlone], (instregex "MVC$")>;
182
183 // Pseudo -> reg move
184 def : InstRW<[FXa], (instregex "COPY(_TO_REGCLASS)?$")>;
185 def : InstRW<[FXa], (instregex "EXTRACT_SUBREG$")>;
186 def : InstRW<[FXa], (instregex "INSERT_SUBREG$")>;
187 def : InstRW<[FXa], (instregex "REG_SEQUENCE$")>;
188 def : InstRW<[FXa], (instregex "SUBREG_TO_REG$")>;
189
190 // Loads
191 def : InstRW<[LSU], (instregex "L(Y|FH|RL|Mux|CBB)?$")>;
192 def : InstRW<[LSU], (instregex "LG(RL)?$")>;
193 def : InstRW<[LSU], (instregex "L128$")>;
194
195 def : InstRW<[FXa], (instregex "LLIH(F|H|L)$")>;
196 def : InstRW<[FXa], (instregex "LLIL(F|H|L)$")>;
197
198 def : InstRW<[FXa], (instregex "LG(F|H)I$")>;
199 def : InstRW<[FXa], (instregex "LHI(Mux)?$")>;
200 def : InstRW<[FXa], (instregex "LR(Mux)?$")>;
201
202 // Load and zero rightmost byte
203 def : InstRW<[LSU], (instregex "LZR(F|G)$")>;
204
205 // Load and trap
206 def : InstRW<[FXb, LSU, Lat5], (instregex "L(FH|G)?AT$")>;
207
208 // Load and test
209 def : InstRW<[FXa, LSU, Lat5], (instregex "LT(G)?$")>;
210 def : InstRW<[FXa], (instregex "LT(G)?R$")>;
211
212 // Stores
213 def : InstRW<[FXb, LSU, Lat5], (instregex "STG(RL)?$")>;
214 def : InstRW<[FXb, LSU, Lat5], (instregex "ST128$")>;
215 def : InstRW<[FXb, LSU, Lat5], (instregex "ST(Y|FH|RL|Mux)?$")>;
216
217 // String moves.
218 def : InstRW<[LSU, Lat30, GroupAlone], (instregex "MVST$")>;
219
220 //===----------------------------------------------------------------------===//
221 // Conditional move instructions
222 //===----------------------------------------------------------------------===//
223
224 def : InstRW<[FXa, Lat2], (instregex "LOCRMux$")>;
225 def : InstRW<[FXa, Lat2], (instregex "LOC(G|FH)?R(Asm.*)?$")>;
226 def : InstRW<[FXa, Lat2], (instregex "LOC(G|H)?HI(Asm.*)?$")>;
227 def : InstRW<[FXa, LSU, Lat6], (instregex "LOC(G|FH|Mux)?(Asm.*)?$")>;
228 def : InstRW<[FXb, LSU, Lat5], (instregex "STOC(G|FH|Mux)?(Asm.*)?$")>;
229
230 //===----------------------------------------------------------------------===//
231 // Sign extensions
232 //===----------------------------------------------------------------------===//
233
234 def : InstRW<[FXa], (instregex "L(B|H|G)R$")>;
235 def : InstRW<[FXa], (instregex "LG(B|H|F)R$")>;
236
237 def : InstRW<[FXa, LSU, Lat5], (instregex "LTGF$")>;
238 def : InstRW<[FXa], (instregex "LTGFR$")>;
239
240 def : InstRW<[FXa, LSU, Lat5], (instregex "LB(H|Mux)?$")>;
241 def : InstRW<[FXa, LSU, Lat5], (instregex "LH(Y)?$")>;
242 def : InstRW<[FXa, LSU, Lat5], (instregex "LH(H|Mux|RL)$")>;
243 def : InstRW<[FXa, LSU, Lat5], (instregex "LG(B|H|F)$")>;
244 def : InstRW<[FXa, LSU, Lat5], (instregex "LG(H|F)RL$")>;
245
246 //===----------------------------------------------------------------------===//
247 // Zero extensions
248 //===----------------------------------------------------------------------===//
249
250 def : InstRW<[FXa], (instregex "LLCR(Mux)?$")>;
251 def : InstRW<[FXa], (instregex "LLHR(Mux)?$")>;
252 def : InstRW<[FXa], (instregex "LLG(C|H|F|T)R$")>;
253 def : InstRW<[LSU], (instregex "LLC(Mux)?$")>;
254 def : InstRW<[LSU], (instregex "LLH(Mux)?$")>;
255 def : InstRW<[FXa, LSU, Lat5], (instregex "LL(C|H)H$")>;
256 def : InstRW<[LSU], (instregex "LLHRL$")>;
257 def : InstRW<[LSU], (instregex "LLG(C|H|F|T|HRL|FRL)$")>;
258
259 // Load and zero rightmost byte
260 def : InstRW<[LSU], (instregex "LLZRGF$")>;
261
262 // Load and trap
263 def : InstRW<[FXb, LSU, Lat5], (instregex "LLG(F|T)?AT$")>;
264
265 //===----------------------------------------------------------------------===//
266 // Truncations
267 //===----------------------------------------------------------------------===//
268
269 def : InstRW<[FXb, LSU, Lat5], (instregex "STC(H|Y|Mux)?$")>;
270 def : InstRW<[FXb, LSU, Lat5], (instregex "STH(H|Y|RL|Mux)?$")>;
271
272 //===----------------------------------------------------------------------===//
273 // Multi-register moves
274 //===----------------------------------------------------------------------===//
275
276 // Load multiple (estimated average of 5 ops)
277 def : InstRW<[LSU, LSU, LSU, LSU, LSU, Lat10, GroupAlone],
278              (instregex "LM(H|Y|G)?$")>;
279
280 // Store multiple (estimated average of ceil(5/2) FXb ops)
281 def : InstRW<[LSU, LSU, FXb, FXb, FXb, Lat10,
282               GroupAlone], (instregex "STM(G|H|Y)?$")>;
283
284 //===----------------------------------------------------------------------===//
285 // Byte swaps
286 //===----------------------------------------------------------------------===//
287
288 def : InstRW<[FXa], (instregex "LRV(G)?R$")>;
289 def : InstRW<[FXa, LSU, Lat5], (instregex "LRV(G|H)?$")>;
290 def : InstRW<[FXb, LSU, Lat5], (instregex "STRV(G|H)?$")>;
291
292 //===----------------------------------------------------------------------===//
293 // Load address instructions
294 //===----------------------------------------------------------------------===//
295
296 def : InstRW<[FXa], (instregex "LA(Y|RL)?$")>;
297
298 // Load the Global Offset Table address ( -> larl )
299 def : InstRW<[FXa], (instregex "GOT$")>;
300
301 //===----------------------------------------------------------------------===//
302 // Absolute and Negation
303 //===----------------------------------------------------------------------===//
304
305 def : InstRW<[FXa, Lat2], (instregex "LP(G)?R$")>;
306 def : InstRW<[FXa, FXa, Lat3, BeginGroup], (instregex "L(N|P)GFR$")>;
307 def : InstRW<[FXa, Lat2], (instregex "LN(R|GR)$")>;
308 def : InstRW<[FXa], (instregex "LC(R|GR)$")>;
309 def : InstRW<[FXa, FXa, Lat2, BeginGroup], (instregex "LCGFR$")>;
310
311 //===----------------------------------------------------------------------===//
312 // Insertion
313 //===----------------------------------------------------------------------===//
314
315 def : InstRW<[FXa, LSU, Lat5], (instregex "IC(Y)?$")>;
316 def : InstRW<[FXa, LSU, Lat5], (instregex "IC32(Y)?$")>;
317 def : InstRW<[FXa, LSU, Lat5], (instregex "ICM(H|Y)?$")>;
318 def : InstRW<[FXa], (instregex "II(F|H|L)Mux$")>;
319 def : InstRW<[FXa], (instregex "IIHF(64)?$")>;
320 def : InstRW<[FXa], (instregex "IIHH(64)?$")>;
321 def : InstRW<[FXa], (instregex "IIHL(64)?$")>;
322 def : InstRW<[FXa], (instregex "IILF(64)?$")>;
323 def : InstRW<[FXa], (instregex "IILH(64)?$")>;
324 def : InstRW<[FXa], (instregex "IILL(64)?$")>;
325
326 //===----------------------------------------------------------------------===//
327 // Addition
328 //===----------------------------------------------------------------------===//
329
330 def : InstRW<[FXa, LSU, Lat5], (instregex "A(Y)?$")>;
331 def : InstRW<[FXa, LSU, Lat6], (instregex "AH(Y)?$")>;
332 def : InstRW<[FXa], (instregex "AIH$")>;
333 def : InstRW<[FXa], (instregex "AFI(Mux)?$")>;
334 def : InstRW<[FXa, LSU, Lat5], (instregex "AG$")>;
335 def : InstRW<[FXa], (instregex "AGFI$")>;
336 def : InstRW<[FXa], (instregex "AGHI(K)?$")>;
337 def : InstRW<[FXa], (instregex "AGR(K)?$")>;
338 def : InstRW<[FXa], (instregex "AHI(K)?$")>;
339 def : InstRW<[FXa], (instregex "AHIMux(K)?$")>;
340 def : InstRW<[FXa, LSU, Lat5], (instregex "AL(Y)?$")>;
341 def : InstRW<[FXa], (instregex "AL(FI|HSIK)$")>;
342 def : InstRW<[FXa, LSU, Lat5], (instregex "ALG(F)?$")>;
343 def : InstRW<[FXa], (instregex "ALGHSIK$")>;
344 def : InstRW<[FXa], (instregex "ALGF(I|R)$")>;
345 def : InstRW<[FXa], (instregex "ALGR(K)?$")>;
346 def : InstRW<[FXa], (instregex "ALR(K)?$")>;
347 def : InstRW<[FXa], (instregex "AR(K)?$")>;
348 def : InstRW<[FXb, LSU, Lat5], (instregex "A(G)?SI$")>;
349
350 // Logical addition with carry
351 def : InstRW<[FXa, LSU, Lat6, GroupAlone], (instregex "ALC(G)?$")>;
352 def : InstRW<[FXa, Lat2, GroupAlone], (instregex "ALC(G)?R$")>;
353
354 // Add with sign extension (32 -> 64)
355 def : InstRW<[FXa, LSU, Lat6], (instregex "AGF$")>;
356 def : InstRW<[FXa, Lat2], (instregex "AGFR$")>;
357
358 //===----------------------------------------------------------------------===//
359 // Subtraction
360 //===----------------------------------------------------------------------===//
361
362 def : InstRW<[FXa, LSU, Lat5], (instregex "S(G|Y)?$")>;
363 def : InstRW<[FXa, LSU, Lat6], (instregex "SH(Y)?$")>;
364 def : InstRW<[FXa], (instregex "SGR(K)?$")>;
365 def : InstRW<[FXa], (instregex "SLFI$")>;
366 def : InstRW<[FXa, LSU, Lat5], (instregex "SL(G|GF|Y)?$")>;
367 def : InstRW<[FXa], (instregex "SLGF(I|R)$")>;
368 def : InstRW<[FXa], (instregex "SLGR(K)?$")>;
369 def : InstRW<[FXa], (instregex "SLR(K)?$")>;
370 def : InstRW<[FXa], (instregex "SR(K)?$")>;
371
372 // Subtraction with borrow
373 def : InstRW<[FXa, LSU, Lat6, GroupAlone], (instregex "SLB(G)?$")>;
374 def : InstRW<[FXa, Lat2, GroupAlone], (instregex "SLB(G)?R$")>;
375
376 // Subtraction with sign extension (32 -> 64)
377 def : InstRW<[FXa, LSU, Lat6], (instregex "SGF$")>;
378 def : InstRW<[FXa, Lat2], (instregex "SGFR$")>;
379
380 //===----------------------------------------------------------------------===//
381 // AND
382 //===----------------------------------------------------------------------===//
383
384 def : InstRW<[FXa, LSU, Lat5], (instregex "N(G|Y)?$")>;
385 def : InstRW<[FXa], (instregex "NGR(K)?$")>;
386 def : InstRW<[FXa], (instregex "NI(FMux|HMux|LMux)$")>;
387 def : InstRW<[FXb, LSU, Lat5], (instregex "NI(Y)?$")>;
388 def : InstRW<[FXa], (instregex "NIHF(64)?$")>;
389 def : InstRW<[FXa], (instregex "NIHH(64)?$")>;
390 def : InstRW<[FXa], (instregex "NIHL(64)?$")>;
391 def : InstRW<[FXa], (instregex "NILF(64)?$")>;
392 def : InstRW<[FXa], (instregex "NILH(64)?$")>;
393 def : InstRW<[FXa], (instregex "NILL(64)?$")>;
394 def : InstRW<[FXa], (instregex "NR(K)?$")>;
395 def : InstRW<[LSU, LSU, FXb, Lat9, BeginGroup], (instregex "NC$")>;
396
397 //===----------------------------------------------------------------------===//
398 // OR
399 //===----------------------------------------------------------------------===//
400
401 def : InstRW<[FXa, LSU, Lat5], (instregex "O(G|Y)?$")>;
402 def : InstRW<[FXa], (instregex "OGR(K)?$")>;
403 def : InstRW<[FXb, LSU, Lat5], (instregex "OI(Y)?$")>;
404 def : InstRW<[FXa], (instregex "OI(FMux|HMux|LMux)$")>;
405 def : InstRW<[FXa], (instregex "OIHF(64)?$")>;
406 def : InstRW<[FXa], (instregex "OIHH(64)?$")>;
407 def : InstRW<[FXa], (instregex "OIHL(64)?$")>;
408 def : InstRW<[FXa], (instregex "OILF(64)?$")>;
409 def : InstRW<[FXa], (instregex "OILH(64)?$")>;
410 def : InstRW<[FXa], (instregex "OILL(64)?$")>;
411 def : InstRW<[FXa], (instregex "OR(K)?$")>;
412 def : InstRW<[LSU, LSU, FXb, Lat9, BeginGroup], (instregex "OC$")>;
413
414 //===----------------------------------------------------------------------===//
415 // XOR
416 //===----------------------------------------------------------------------===//
417
418 def : InstRW<[FXa, LSU, Lat5], (instregex "X(G|Y)?$")>;
419 def : InstRW<[FXb, LSU, Lat5], (instregex "XI(Y)?$")>;
420 def : InstRW<[FXa], (instregex "XIFMux$")>;
421 def : InstRW<[FXa], (instregex "XGR(K)?$")>;
422 def : InstRW<[FXa], (instregex "XIHF(64)?$")>;
423 def : InstRW<[FXa], (instregex "XILF(64)?$")>;
424 def : InstRW<[FXa], (instregex "XR(K)?$")>;
425 def : InstRW<[LSU, LSU, FXb, Lat9, BeginGroup], (instregex "XC$")>;
426
427 //===----------------------------------------------------------------------===//
428 // Multiplication
429 //===----------------------------------------------------------------------===//
430
431 def : InstRW<[FXa, LSU, Lat10], (instregex "MS(GF|Y)?$")>;
432 def : InstRW<[FXa, Lat6], (instregex "MS(R|FI)$")>;
433 def : InstRW<[FXa, LSU, Lat12], (instregex "MSG$")>;
434 def : InstRW<[FXa, Lat8], (instregex "MSGR$")>;
435 def : InstRW<[FXa, Lat6], (instregex "MSGF(I|R)$")>;
436 def : InstRW<[FXa, LSU, Lat15, GroupAlone], (instregex "MLG$")>;
437 def : InstRW<[FXa, Lat9, GroupAlone], (instregex "MLGR$")>;
438 def : InstRW<[FXa, Lat5], (instregex "MGHI$")>;
439 def : InstRW<[FXa, Lat5], (instregex "MHI$")>;
440 def : InstRW<[FXa, LSU, Lat9], (instregex "MH(Y)?$")>;
441
442 //===----------------------------------------------------------------------===//
443 // Division and remainder
444 //===----------------------------------------------------------------------===//
445
446 def : InstRW<[FXa, Lat30, GroupAlone], (instregex "DSG(F)?R$")>;
447 def : InstRW<[LSU, FXa, Lat30, GroupAlone], (instregex "DSG(F)?$")>;
448 def : InstRW<[FXa2, FXa2, Lat20, GroupAlone], (instregex "DLR$")>;
449 def : InstRW<[FXa2, FXa2, Lat30, GroupAlone], (instregex "DLGR$")>;
450 def : InstRW<[FXa2, FXa2, LSU, Lat30, GroupAlone], (instregex "DL(G)?$")>;
451
452 //===----------------------------------------------------------------------===//
453 // Shifts
454 //===----------------------------------------------------------------------===//
455
456 def : InstRW<[FXa], (instregex "SLL(G|K)?$")>;
457 def : InstRW<[FXa], (instregex "SRL(G|K)?$")>;
458 def : InstRW<[FXa], (instregex "SRA(G|K)?$")>;
459 def : InstRW<[FXa], (instregex "SLA(K)?$")>;
460
461 // Rotate
462 def : InstRW<[FXa, LSU, Lat6], (instregex "RLL(G)?$")>;
463
464 // Rotate and insert
465 def : InstRW<[FXa], (instregex "RISBG(N|32)?$")>;
466 def : InstRW<[FXa], (instregex "RISBH(G|H|L)$")>;
467 def : InstRW<[FXa], (instregex "RISBL(G|H|L)$")>;
468 def : InstRW<[FXa], (instregex "RISBMux$")>;
469
470 // Rotate and Select
471 def : InstRW<[FXa, FXa, Lat3, BeginGroup], (instregex "R(N|O|X)SBG$")>;
472
473 //===----------------------------------------------------------------------===//
474 // Comparison
475 //===----------------------------------------------------------------------===//
476
477 def : InstRW<[FXb, LSU, Lat5], (instregex "C(G|Y|Mux|RL)?$")>;
478 def : InstRW<[FXb], (instregex "C(F|H)I(Mux)?$")>;
479 def : InstRW<[FXb], (instregex "CG(F|H)I$")>;
480 def : InstRW<[FXb, LSU, Lat5], (instregex "CG(HSI|RL)$")>;
481 def : InstRW<[FXb], (instregex "C(G)?R$")>;
482 def : InstRW<[FXb], (instregex "CIH$")>;
483 def : InstRW<[FXb, LSU, Lat5], (instregex "CH(F|SI)$")>;
484 def : InstRW<[FXb, LSU, Lat5], (instregex "CL(Y|Mux|FHSI)?$")>;
485 def : InstRW<[FXb], (instregex "CLFI(Mux)?$")>;
486 def : InstRW<[FXb, LSU, Lat5], (instregex "CLG(HRL|HSI)?$")>;
487 def : InstRW<[FXb, LSU, Lat5], (instregex "CLGF(RL)?$")>;
488 def : InstRW<[FXb], (instregex "CLGF(I|R)$")>;
489 def : InstRW<[FXb], (instregex "CLGR$")>;
490 def : InstRW<[FXb, LSU, Lat5], (instregex "CLGRL$")>;
491 def : InstRW<[FXb, LSU, Lat5], (instregex "CLH(F|RL|HSI)$")>;
492 def : InstRW<[FXb], (instregex "CLIH$")>;
493 def : InstRW<[FXb, LSU, Lat5], (instregex "CLI(Y)?$")>;
494 def : InstRW<[FXb], (instregex "CLR$")>;
495 def : InstRW<[FXb, LSU, Lat5], (instregex "CLRL$")>;
496
497 // Compare halfword
498 def : InstRW<[FXb, LSU, Lat6], (instregex "CH(Y|RL)?$")>;
499 def : InstRW<[FXb, LSU, Lat6], (instregex "CGH(RL)?$")>;
500 def : InstRW<[FXa, FXb, LSU, Lat6, BeginGroup], (instregex "CHHSI$")>;
501
502 // Compare with sign extension (32 -> 64)
503 def : InstRW<[FXb, LSU, Lat6], (instregex "CGF(RL)?$")>;
504 def : InstRW<[FXb, Lat2], (instregex "CGFR$")>;
505
506 // Compare logical character
507 def : InstRW<[FXb, LSU, LSU, Lat9, BeginGroup], (instregex "CLC$")>;
508
509 def : InstRW<[LSU, Lat30, GroupAlone], (instregex "CLST$")>;
510
511 // Test under mask
512 def : InstRW<[FXb, LSU, Lat5], (instregex "TM(Y)?$")>;
513 def : InstRW<[FXb], (instregex "TM(H|L)Mux$")>;
514 def : InstRW<[FXb], (instregex "TMHH(64)?$")>;
515 def : InstRW<[FXb], (instregex "TMHL(64)?$")>;
516 def : InstRW<[FXb], (instregex "TMLH(64)?$")>;
517 def : InstRW<[FXb], (instregex "TMLL(64)?$")>;
518
519 //===----------------------------------------------------------------------===//
520 // Prefetch and execution hint
521 //===----------------------------------------------------------------------===//
522
523 def : InstRW<[LSU], (instregex "PFD(RL)?$")>;
524 def : InstRW<[FXb, Lat2], (instregex "BPP$")>;
525 def : InstRW<[FXb, EndGroup], (instregex "BPRP$")>;
526 def : InstRW<[FXb], (instregex "NIAI$")>;
527
528 //===----------------------------------------------------------------------===//
529 // Atomic operations
530 //===----------------------------------------------------------------------===//
531
532 def : InstRW<[FXb, EndGroup], (instregex "Serialize$")>;
533
534 def : InstRW<[FXb, LSU, Lat5], (instregex "LAA(G)?$")>;
535 def : InstRW<[FXb, LSU, Lat5], (instregex "LAAL(G)?$")>;
536 def : InstRW<[FXb, LSU, Lat5], (instregex "LAN(G)?$")>;
537 def : InstRW<[FXb, LSU, Lat5], (instregex "LAO(G)?$")>;
538 def : InstRW<[FXb, LSU, Lat5], (instregex "LAX(G)?$")>;
539
540 // Test and set
541 def : InstRW<[FXb, LSU, Lat5, EndGroup], (instregex "TS$")>;
542
543 // Compare and swap
544 def : InstRW<[FXa, FXb, LSU, Lat6, GroupAlone], (instregex "CS(G|Y)?$")>;
545
546 // Compare double and swap
547 def : InstRW<[FXa, FXa, FXb, FXb, FXa, LSU, Lat10, GroupAlone],
548              (instregex "CDS(Y)?$")>;
549 def : InstRW<[FXa, FXa, FXb, FXb, LSU, FXb, FXb, LSU, LSU, Lat20, GroupAlone],
550              (instregex "CDSG$")>;
551
552 // Compare and swap and store
553 def : InstRW<[FXa, Lat30, GroupAlone], (instregex "CSST$")>;
554
555 // Perform locked operation
556 def : InstRW<[LSU, Lat30, GroupAlone], (instregex "PLO$")>;
557
558 // Load/store pair from/to quadword
559 def : InstRW<[LSU, LSU, Lat5, GroupAlone], (instregex "LPQ$")>;
560 def : InstRW<[FXb, FXb, LSU, Lat6, GroupAlone], (instregex "STPQ$")>;
561
562 // Load pair disjoint
563 def : InstRW<[LSU, LSU, Lat5, GroupAlone], (instregex "LPD(G)?$")>;
564
565 //===----------------------------------------------------------------------===//
566 // Access registers
567 //===----------------------------------------------------------------------===//
568
569 // Extract/set/copy access register
570 def : InstRW<[LSU], (instregex "(EAR|SAR|CPYA)$")>;
571
572 // Load address extended
573 def : InstRW<[LSU, FXa, Lat5, BeginGroup], (instregex "LAE(Y)?$")>;
574
575 // Load/store access multiple (not modeled precisely)
576 def : InstRW<[LSU, Lat30, GroupAlone], (instregex "(L|ST)AM(Y)?$")>;
577
578 //===----------------------------------------------------------------------===//
579 // Program mask and addressing mode
580 //===----------------------------------------------------------------------===//
581
582 // Insert Program Mask
583 def : InstRW<[FXa, Lat3, EndGroup], (instregex "IPM$")>;
584
585 // Set Program Mask
586 def : InstRW<[LSU, EndGroup], (instregex "SPM$")>;
587
588 // Branch and link
589 def : InstRW<[FXa, FXa, FXb, Lat5, GroupAlone], (instregex "BAL(R)?$")>;
590
591 // Test addressing mode
592 def : InstRW<[FXb], (instregex "TAM$")>;
593
594 // Set addressing mode
595 def : InstRW<[FXb, Lat2, EndGroup], (instregex "SAM(24|31|64)$")>;
596
597 // Branch (and save) and set mode.
598 def : InstRW<[FXa, FXb, Lat2, GroupAlone], (instregex "BSM$")>;
599 def : InstRW<[FXa, FXa, FXb, Lat3, GroupAlone], (instregex "BASSM$")>;
600
601 //===----------------------------------------------------------------------===//
602 // Transactional execution
603 //===----------------------------------------------------------------------===//
604
605 // Transaction begin
606 def : InstRW<[LSU, LSU, FXb, FXb, FXb, FXb, FXb, Lat15, GroupAlone],
607               (instregex "TBEGIN(C|_nofloat)?$")>;
608
609 // Transaction end
610 def : InstRW<[FXb, GroupAlone], (instregex "TEND$")>;
611
612 // Transaction abort
613 def : InstRW<[LSU, GroupAlone], (instregex "TABORT$")>;
614
615 // Extract Transaction Nesting Depth
616 def : InstRW<[FXa], (instregex "ETND$")>;
617
618 // Nontransactional store
619 def : InstRW<[FXb, LSU, Lat5], (instregex "NTSTG$")>;
620
621 //===----------------------------------------------------------------------===//
622 // Processor assist
623 //===----------------------------------------------------------------------===//
624
625 def : InstRW<[FXb], (instregex "PPA$")>;
626
627 //===----------------------------------------------------------------------===//
628 // Miscellaneous Instructions.
629 //===----------------------------------------------------------------------===//
630
631 // Find leftmost one
632 def : InstRW<[FXa, Lat6, GroupAlone], (instregex "FLOGR$")>;
633
634 // Population count
635 def : InstRW<[FXa, Lat3], (instregex "POPCNT$")>;
636
637 // Extend
638 def : InstRW<[FXa], (instregex "AEXT128_64$")>;
639 def : InstRW<[FXa], (instregex "ZEXT128_(32|64)$")>;
640
641 // String instructions
642 def : InstRW<[FXa, LSU, Lat30], (instregex "SRST$")>;
643
644 // Move with key
645 def : InstRW<[FXa, FXa, FXb, LSU, Lat8, GroupAlone], (instregex "MVCK$")>;
646
647 // Extract CPU Time
648 def : InstRW<[FXa, Lat5, LSU], (instregex "ECTG$")>;
649
650 // Execute
651 def : InstRW<[FXb, GroupAlone], (instregex "EX(RL)?$")>;
652
653 // Program return
654 def : InstRW<[FXb, Lat30], (instregex "PR$")>;
655
656 // Inline assembly
657 def : InstRW<[LSU, LSU, LSU, FXa, FXa, FXb, Lat9, GroupAlone],
658              (instregex "STCK(F)?$")>;
659 def : InstRW<[LSU, LSU, LSU, LSU, FXa, FXa, FXb, FXb, Lat11, GroupAlone],
660              (instregex "STCKE$")>;
661 def : InstRW<[FXa, LSU, Lat5], (instregex "STFLE$")>;
662 def : InstRW<[FXb, Lat30], (instregex "SVC$")>;
663
664 // Store real address
665 def : InstRW<[FXb, LSU, Lat5], (instregex "STRAG$")>;
666
667 //===----------------------------------------------------------------------===//
668 // .insn directive instructions
669 //===----------------------------------------------------------------------===//
670
671 // An "empty" sched-class will be assigned instead of the "invalid sched-class".
672 // getNumDecoderSlots() will then return 1 instead of 0.
673 def : InstRW<[], (instregex "Insn.*")>;
674
675
676 // ----------------------------- Floating point ----------------------------- //
677
678 //===----------------------------------------------------------------------===//
679 // FP: Select instructions
680 //===----------------------------------------------------------------------===//
681
682 def : InstRW<[FXa], (instregex "SelectF(32|64|128)$")>;
683 def : InstRW<[FXa], (instregex "CondStoreF32(Inv)?$")>;
684 def : InstRW<[FXa], (instregex "CondStoreF64(Inv)?$")>;
685
686 //===----------------------------------------------------------------------===//
687 // FP: Move instructions
688 //===----------------------------------------------------------------------===//
689
690 // Load zero
691 def : InstRW<[FXb], (instregex "LZ(DR|ER)$")>;
692 def : InstRW<[FXb, FXb, Lat2, BeginGroup], (instregex "LZXR$")>;
693
694 // Load
695 def : InstRW<[VecXsPm], (instregex "LER$")>;
696 def : InstRW<[FXb], (instregex "LD(R|R32|GR)$")>;
697 def : InstRW<[FXb, Lat3], (instregex "LGDR$")>;
698 def : InstRW<[FXb, FXb, Lat2, GroupAlone], (instregex "LXR$")>;
699
700 // Load and Test
701 def : InstRW<[VecXsPm, Lat4], (instregex "LT(D|E)BR$")>;
702 def : InstRW<[VecXsPm, Lat4], (instregex "LTEBRCompare(_VecPseudo)?$")>;
703 def : InstRW<[VecXsPm, Lat4], (instregex "LTDBRCompare(_VecPseudo)?$")>;
704 def : InstRW<[VecDF2, VecDF2, Lat11, GroupAlone], (instregex "LTXBR$")>;
705 def : InstRW<[VecDF2, VecDF2, Lat11, GroupAlone],
706              (instregex "LTXBRCompare(_VecPseudo)?$")>;
707
708 // Copy sign
709 def : InstRW<[VecXsPm], (instregex "CPSDRd(d|s)$")>;
710 def : InstRW<[VecXsPm], (instregex "CPSDRs(d|s)$")>;
711
712 //===----------------------------------------------------------------------===//
713 // FP: Load instructions
714 //===----------------------------------------------------------------------===//
715
716 def : InstRW<[VecXsPm, LSU, Lat7], (instregex "LE(Y)?$")>;
717 def : InstRW<[LSU], (instregex "LD(Y|E32)?$")>;
718 def : InstRW<[LSU], (instregex "LX$")>;
719
720 //===----------------------------------------------------------------------===//
721 // FP: Store instructions
722 //===----------------------------------------------------------------------===//
723
724 def : InstRW<[FXb, LSU, Lat7], (instregex "STD(Y)?$")>;
725 def : InstRW<[FXb, LSU, Lat7], (instregex "STE(Y)?$")>;
726 def : InstRW<[FXb, LSU, Lat5], (instregex "STX$")>;
727
728 //===----------------------------------------------------------------------===//
729 // FP: Conversion instructions
730 //===----------------------------------------------------------------------===//
731
732 // Load rounded
733 def : InstRW<[VecBF], (instregex "LEDBR(A)?$")>;
734 def : InstRW<[VecDF, VecDF, Lat20], (instregex "LEXBR(A)?$")>;
735 def : InstRW<[VecDF, VecDF, Lat20], (instregex "LDXBR(A)?$")>;
736
737 // Load lengthened
738 def : InstRW<[VecBF, LSU, Lat12], (instregex "LDEB$")>;
739 def : InstRW<[VecBF], (instregex "LDEBR$")>;
740 def : InstRW<[VecBF2, VecBF2, LSU, Lat12 , GroupAlone], (instregex "LX(D|E)B$")>;
741 def : InstRW<[VecBF2, VecBF2, GroupAlone], (instregex "LX(D|E)BR$")>;
742
743 // Convert from fixed / logical
744 def : InstRW<[FXb, VecBF, Lat9, BeginGroup], (instregex "CE(F|G)BR(A)?$")>;
745 def : InstRW<[FXb, VecBF, Lat9, BeginGroup], (instregex "CD(F|G)BR(A)?$")>;
746 def : InstRW<[FXb, VecDF2, VecDF2, Lat12, GroupAlone], (instregex "CX(F|G)BR(A)?$")>;
747 def : InstRW<[FXb, VecBF, Lat9, BeginGroup], (instregex "CEL(F|G)BR$")>;
748 def : InstRW<[FXb, VecBF, Lat9, BeginGroup], (instregex "CDL(F|G)BR$")>;
749 def : InstRW<[FXb, VecDF2, VecDF2, Lat12, GroupAlone], (instregex "CXL(F|G)BR$")>;
750
751 // Convert to fixed / logical
752 def : InstRW<[FXb, VecBF, Lat11, BeginGroup], (instregex "CF(E|D)BR(A)?$")>;
753 def : InstRW<[FXb, VecBF, Lat11, BeginGroup], (instregex "CG(E|D)BR(A)?$")>;
754 def : InstRW<[FXb, VecDF, VecDF, Lat20, BeginGroup], (instregex "C(F|G)XBR(A)?$")>;
755 def : InstRW<[FXb, VecBF, Lat11, GroupAlone], (instregex "CLFEBR$")>;
756 def : InstRW<[FXb, VecBF, Lat11, BeginGroup], (instregex "CLFDBR$")>;
757 def : InstRW<[FXb, VecBF, Lat11, BeginGroup], (instregex "CLG(E|D)BR$")>;
758 def : InstRW<[FXb, VecDF, VecDF, Lat20, BeginGroup], (instregex "CL(F|G)XBR$")>;
759
760 //===----------------------------------------------------------------------===//
761 // FP: Unary arithmetic
762 //===----------------------------------------------------------------------===//
763
764 // Load Complement / Negative / Positive
765 def : InstRW<[VecXsPm, Lat4], (instregex "L(C|N|P)DBR$")>;
766 def : InstRW<[VecXsPm, Lat4], (instregex "L(C|N|P)EBR$")>;
767 def : InstRW<[FXb], (instregex "LCDFR(_32)?$")>;
768 def : InstRW<[FXb], (instregex "LNDFR(_32)?$")>;
769 def : InstRW<[FXb], (instregex "LPDFR(_32)?$")>;
770 def : InstRW<[VecDF2, VecDF2, Lat11, GroupAlone], (instregex "L(C|N|P)XBR$")>;
771
772 // Square root
773 def : InstRW<[VecFPd, LSU], (instregex "SQ(E|D)B$")>;
774 def : InstRW<[VecFPd], (instregex "SQ(E|D)BR$")>;
775 def : InstRW<[VecFPd, VecFPd, GroupAlone], (instregex "SQXBR$")>;
776
777 // Load FP integer
778 def : InstRW<[VecBF], (instregex "FIEBR(A)?$")>;
779 def : InstRW<[VecBF], (instregex "FIDBR(A)?$")>;
780 def : InstRW<[VecDF2, VecDF2, Lat11, GroupAlone], (instregex "FIXBR(A)?$")>;
781
782 //===----------------------------------------------------------------------===//
783 // FP: Binary arithmetic
784 //===----------------------------------------------------------------------===//
785
786 // Addition
787 def : InstRW<[VecBF, LSU, Lat12], (instregex "A(E|D)B$")>;
788 def : InstRW<[VecBF], (instregex "A(E|D)BR$")>;
789 def : InstRW<[VecDF2, VecDF2, Lat11, GroupAlone], (instregex "AXBR$")>;
790
791 // Subtraction
792 def : InstRW<[VecBF, LSU, Lat12], (instregex "S(E|D)B$")>;
793 def : InstRW<[VecBF], (instregex "S(E|D)BR$")>;
794 def : InstRW<[VecDF2, VecDF2, Lat11, GroupAlone], (instregex "SXBR$")>;
795
796 // Multiply
797 def : InstRW<[VecBF, LSU, Lat12], (instregex "M(D|DE|EE)B$")>;
798 def : InstRW<[VecBF], (instregex "M(D|DE|EE)BR$")>;
799 def : InstRW<[VecBF2, VecBF2, LSU, Lat12, GroupAlone], (instregex "MXDB$")>;
800 def : InstRW<[VecBF2, VecBF2, GroupAlone], (instregex "MXDBR$")>;
801 def : InstRW<[VecDF2, VecDF2, Lat20, GroupAlone], (instregex "MXBR$")>;
802
803 // Multiply and add / subtract
804 def : InstRW<[VecBF, LSU, Lat12, GroupAlone], (instregex "M(A|S)EB$")>;
805 def : InstRW<[VecBF, GroupAlone], (instregex "M(A|S)EBR$")>;
806 def : InstRW<[VecBF, LSU, Lat12, GroupAlone], (instregex "M(A|S)DB$")>;
807 def : InstRW<[VecBF], (instregex "M(A|S)DBR$")>;
808
809 // Division
810 def : InstRW<[VecFPd, LSU], (instregex "D(E|D)B$")>;
811 def : InstRW<[VecFPd], (instregex "D(E|D)BR$")>;
812 def : InstRW<[VecFPd, VecFPd, GroupAlone], (instregex "DXBR$")>;
813
814 //===----------------------------------------------------------------------===//
815 // FP: Comparisons
816 //===----------------------------------------------------------------------===//
817
818 // Compare
819 def : InstRW<[VecXsPm, LSU, Lat8], (instregex "C(E|D)B$")>;
820 def : InstRW<[VecXsPm, Lat4], (instregex "C(E|D)BR?$")>;
821 def : InstRW<[VecDF, VecDF, Lat20, GroupAlone], (instregex "CXBR$")>;
822
823 // Test Data Class
824 def : InstRW<[LSU, VecXsPm, Lat9], (instregex "TC(E|D)B$")>;
825 def : InstRW<[LSU, VecDF2, VecDF2, Lat15, GroupAlone], (instregex "TCXB$")>;
826
827 //===----------------------------------------------------------------------===//
828 // FP: Floating-point control register instructions
829 //===----------------------------------------------------------------------===//
830
831 def : InstRW<[FXa, LSU, Lat4, GroupAlone], (instregex "EFPC$")>;
832 def : InstRW<[FXb, LSU, Lat5, GroupAlone], (instregex "STFPC$")>;
833 def : InstRW<[LSU, Lat3, GroupAlone], (instregex "SFPC$")>;
834 def : InstRW<[LSU, LSU, Lat6, GroupAlone], (instregex "LFPC$")>;
835 def : InstRW<[FXa, Lat30, GroupAlone], (instregex "SFASR$")>;
836 def : InstRW<[FXa, LSU, Lat30, GroupAlone], (instregex "LFAS$")>;
837 def : InstRW<[FXb, Lat3, GroupAlone], (instregex "SRNM(B|T)?$")>;
838
839 // --------------------------------- Vector --------------------------------- //
840
841 //===----------------------------------------------------------------------===//
842 // Vector: Move instructions
843 //===----------------------------------------------------------------------===//
844
845 def : InstRW<[FXb], (instregex "VLR(32|64)?$")>;
846 def : InstRW<[FXb, Lat4], (instregex "VLGV(B|F|G|H)?$")>;
847 def : InstRW<[FXb], (instregex "VLVG(B|F|G|H)?$")>;
848 def : InstRW<[FXb, Lat2], (instregex "VLVGP(32)?$")>;
849
850 //===----------------------------------------------------------------------===//
851 // Vector: Immediate instructions
852 //===----------------------------------------------------------------------===//
853
854 def : InstRW<[VecXsPm], (instregex "VZERO$")>;
855 def : InstRW<[VecXsPm], (instregex "VONE$")>;
856 def : InstRW<[VecXsPm], (instregex "VGBM$")>;
857 def : InstRW<[VecXsPm], (instregex "VGM(B|F|G|H)?$")>;
858 def : InstRW<[VecXsPm], (instregex "VLEI(B|F|G|H)$")>;
859 def : InstRW<[VecXsPm], (instregex "VREPI(B|F|G|H)?$")>;
860
861 //===----------------------------------------------------------------------===//
862 // Vector: Loads
863 //===----------------------------------------------------------------------===//
864
865 def : InstRW<[LSU], (instregex "VL(L|BB)?$")>;
866 def : InstRW<[LSU], (instregex "VL(32|64)$")>;
867 def : InstRW<[LSU], (instregex "VLLEZ(B|F|G|H)?$")>;
868 def : InstRW<[LSU], (instregex "VLREP(B|F|G|H)?$")>;
869 def : InstRW<[VecXsPm, LSU, Lat7], (instregex "VLE(B|F|G|H)$")>;
870 def : InstRW<[FXb, LSU, VecXsPm, Lat11, BeginGroup], (instregex "VGE(F|G)$")>;
871 def : InstRW<[LSU, LSU, LSU, LSU, LSU, Lat10, GroupAlone],
872               (instregex "VLM$")>;
873
874 //===----------------------------------------------------------------------===//
875 // Vector: Stores
876 //===----------------------------------------------------------------------===//
877
878 def : InstRW<[FXb, LSU, Lat8], (instregex "VST(L|32|64)?$")>;
879 def : InstRW<[FXb, LSU, Lat8], (instregex "VSTE(F|G)$")>;
880 def : InstRW<[FXb, LSU, VecXsPm, Lat11, BeginGroup], (instregex "VSTE(B|H)$")>;
881 def : InstRW<[LSU, LSU, FXb, FXb, FXb, FXb, FXb, Lat20, GroupAlone],
882               (instregex "VSTM$")>;
883 def : InstRW<[FXb, FXb, LSU, Lat12, BeginGroup], (instregex "VSCE(F|G)$")>;
884
885 //===----------------------------------------------------------------------===//
886 // Vector: Selects and permutes
887 //===----------------------------------------------------------------------===//
888
889 def : InstRW<[VecXsPm], (instregex "VMRH(B|F|G|H)?$")>;
890 def : InstRW<[VecXsPm], (instregex "VMRL(B|F|G|H)?$")>;
891 def : InstRW<[VecXsPm], (instregex "VPERM$")>;
892 def : InstRW<[VecXsPm], (instregex "VPDI$")>;
893 def : InstRW<[VecXsPm], (instregex "VREP(B|F|G|H)?$")>;
894 def : InstRW<[VecXsPm], (instregex "VSEL$")>;
895
896 //===----------------------------------------------------------------------===//
897 // Vector: Widening and narrowing
898 //===----------------------------------------------------------------------===//
899
900 def : InstRW<[VecXsPm], (instregex "VPK(F|G|H)?$")>;
901 def : InstRW<[VecXsPm], (instregex "VPKS(F|G|H)?$")>;
902 def : InstRW<[VecXsPm, Lat4], (instregex "VPKS(F|G|H)S$")>;
903 def : InstRW<[VecXsPm], (instregex "VPKLS(F|G|H)?$")>;
904 def : InstRW<[VecXsPm, Lat4], (instregex "VPKLS(F|G|H)S$")>;
905 def : InstRW<[VecXsPm], (instregex "VSEG(B|F|H)?$")>;
906 def : InstRW<[VecXsPm], (instregex "VUPH(B|F|H)?$")>;
907 def : InstRW<[VecXsPm], (instregex "VUPL(B|F)?$")>;
908 def : InstRW<[VecXsPm], (instregex "VUPLH(B|F|H|W)?$")>;
909 def : InstRW<[VecXsPm], (instregex "VUPLL(B|F|H)?$")>;
910
911 //===----------------------------------------------------------------------===//
912 // Vector: Integer arithmetic
913 //===----------------------------------------------------------------------===//
914
915 def : InstRW<[VecXsPm], (instregex "VA(B|F|G|H|Q|C|CQ)?$")>;
916 def : InstRW<[VecXsPm], (instregex "VACC(B|F|G|H|Q|C|CQ)?$")>;
917 def : InstRW<[VecXsPm], (instregex "VAVG(B|F|G|H)?$")>;
918 def : InstRW<[VecXsPm], (instregex "VAVGL(B|F|G|H)?$")>;
919 def : InstRW<[VecXsPm], (instregex "VN(C|O)?$")>;
920 def : InstRW<[VecXsPm], (instregex "VO$")>;
921 def : InstRW<[VecMul], (instregex "VCKSM$")>;
922 def : InstRW<[VecXsPm], (instregex "VCLZ(B|F|G|H)?$")>;
923 def : InstRW<[VecXsPm], (instregex "VCTZ(B|F|G|H)?$")>;
924 def : InstRW<[VecXsPm], (instregex "VX$")>;
925 def : InstRW<[VecMul], (instregex "VGFM?$")>;
926 def : InstRW<[VecMul], (instregex "VGFMA(B|F|G|H)?$")>;
927 def : InstRW<[VecMul], (instregex "VGFM(B|F|G|H)$")>;
928 def : InstRW<[VecXsPm], (instregex "VLC(B|F|G|H)?$")>;
929 def : InstRW<[VecXsPm], (instregex "VLP(B|F|G|H)?$")>;
930 def : InstRW<[VecXsPm], (instregex "VMX(B|F|G|H)?$")>;
931 def : InstRW<[VecXsPm], (instregex "VMXL(B|F|G|H)?$")>;
932 def : InstRW<[VecXsPm], (instregex "VMN(B|F|G|H)?$")>;
933 def : InstRW<[VecXsPm], (instregex "VMNL(B|F|G|H)?$")>;
934 def : InstRW<[VecMul], (instregex "VMAL(B|F)?$")>;
935 def : InstRW<[VecMul], (instregex "VMALE(B|F|H)?$")>;
936 def : InstRW<[VecMul], (instregex "VMALH(B|F|H|W)?$")>;
937 def : InstRW<[VecMul], (instregex "VMALO(B|F|H)?$")>;
938 def : InstRW<[VecMul], (instregex "VMAO(B|F|H)?$")>;
939 def : InstRW<[VecMul], (instregex "VMAE(B|F|H)?$")>;
940 def : InstRW<[VecMul], (instregex "VMAH(B|F|H)?$")>;
941 def : InstRW<[VecMul], (instregex "VME(B|F|H)?$")>;
942 def : InstRW<[VecMul], (instregex "VMH(B|F|H)?$")>;
943 def : InstRW<[VecMul], (instregex "VML(B|F)?$")>;
944 def : InstRW<[VecMul], (instregex "VMLE(B|F|H)?$")>;
945 def : InstRW<[VecMul], (instregex "VMLH(B|F|H|W)?$")>;
946 def : InstRW<[VecMul], (instregex "VMLO(B|F|H)?$")>;
947 def : InstRW<[VecMul], (instregex "VMO(B|F|H)?$")>;
948
949 def : InstRW<[VecXsPm], (instregex "VPOPCT$")>;
950
951 def : InstRW<[VecXsPm], (instregex "VERLL(B|F|G|H)?$")>;
952 def : InstRW<[VecXsPm], (instregex "VERLLV(B|F|G|H)?$")>;
953 def : InstRW<[VecXsPm], (instregex "VERIM(B|F|G|H)?$")>;
954 def : InstRW<[VecXsPm], (instregex "VESL(B|F|G|H)?$")>;
955 def : InstRW<[VecXsPm], (instregex "VESLV(B|F|G|H)?$")>;
956 def : InstRW<[VecXsPm], (instregex "VESRA(B|F|G|H)?$")>;
957 def : InstRW<[VecXsPm], (instregex "VESRAV(B|F|G|H)?$")>;
958 def : InstRW<[VecXsPm], (instregex "VESRL(B|F|G|H)?$")>;
959 def : InstRW<[VecXsPm], (instregex "VESRLV(B|F|G|H)?$")>;
960
961 def : InstRW<[VecXsPm], (instregex "VSL(DB)?$")>;
962 def : InstRW<[VecXsPm, VecXsPm, Lat8], (instregex "VSLB$")>;
963 def : InstRW<[VecXsPm], (instregex "VSR(A|L)$")>;
964 def : InstRW<[VecXsPm, VecXsPm, Lat8], (instregex "VSR(A|L)B$")>;
965
966 def : InstRW<[VecXsPm], (instregex "VSB(I|IQ|CBI|CBIQ)?$")>;
967 def : InstRW<[VecXsPm], (instregex "VSCBI(B|F|G|H|Q)?$")>;
968 def : InstRW<[VecXsPm], (instregex "VS(F|G|H|Q)?$")>;
969
970 def : InstRW<[VecMul], (instregex "VSUM(B|H)?$")>;
971 def : InstRW<[VecMul], (instregex "VSUMG(F|H)?$")>;
972 def : InstRW<[VecMul], (instregex "VSUMQ(F|G)?$")>;
973
974 //===----------------------------------------------------------------------===//
975 // Vector: Integer comparison
976 //===----------------------------------------------------------------------===//
977
978 def : InstRW<[VecXsPm, Lat4], (instregex "VEC(B|F|G|H)?$")>;
979 def : InstRW<[VecXsPm, Lat4], (instregex "VECL(B|F|G|H)?$")>;
980 def : InstRW<[VecXsPm], (instregex "VCEQ(B|F|G|H)?$")>;
981 def : InstRW<[VecXsPm, Lat4], (instregex "VCEQ(B|F|G|H)S$")>;
982 def : InstRW<[VecXsPm], (instregex "VCH(B|F|G|H)?$")>;
983 def : InstRW<[VecXsPm, Lat4], (instregex "VCH(B|F|G|H)S$")>;
984 def : InstRW<[VecXsPm], (instregex "VCHL(B|F|G|H)?$")>;
985 def : InstRW<[VecXsPm, Lat4], (instregex "VCHL(B|F|G|H)S$")>;
986 def : InstRW<[VecStr, Lat5], (instregex "VTM$")>;
987
988 //===----------------------------------------------------------------------===//
989 // Vector: Floating-point arithmetic
990 //===----------------------------------------------------------------------===//
991
992 def : InstRW<[VecBF2], (instregex "VCD(G|GB|LG|LGB)$")>;
993 def : InstRW<[VecBF], (instregex "WCD(GB|LGB)$")>;
994 def : InstRW<[VecBF2], (instregex "VC(L)?GD$")>;
995 def : InstRW<[VecBF2], (instregex "VFADB$")>;
996 def : InstRW<[VecBF], (instregex "WFADB$")>;
997 def : InstRW<[VecBF2], (instregex "VCGDB$")>;
998 def : InstRW<[VecBF], (instregex "WCGDB$")>;
999 def : InstRW<[VecBF2], (instregex "VF(I|M|A|S)$")>;
1000 def : InstRW<[VecBF2], (instregex "VF(I|M|S)DB$")>;
1001 def : InstRW<[VecBF], (instregex "WF(I|M|S)DB$")>;
1002 def : InstRW<[VecBF2], (instregex "VCLGDB$")>;
1003 def : InstRW<[VecBF], (instregex "WCLGDB$")>;
1004 def : InstRW<[VecXsPm], (instregex "VFL(C|N|P)DB$")>;
1005 def : InstRW<[VecXsPm], (instregex "WFL(C|N|P)DB$")>;
1006 def : InstRW<[VecBF2], (instregex "VFM(A|S)$")>;
1007 def : InstRW<[VecBF2], (instregex "VFM(A|S)DB$")>;
1008 def : InstRW<[VecBF], (instregex "WFM(A|S)DB$")>;
1009 def : InstRW<[VecXsPm], (instregex "VFPSO$")>;
1010 def : InstRW<[VecXsPm], (instregex "(V|W)FPSODB$")>;
1011 def : InstRW<[VecXsPm, Lat4], (instregex "VFTCI(DB)?$")>;
1012 def : InstRW<[VecXsPm, Lat4], (instregex "WFTCIDB$")>;
1013 def : InstRW<[VecBF2], (instregex "VL(DE|ED)$")>;
1014 def : InstRW<[VecBF2], (instregex "VL(DE|ED)B$")>;
1015 def : InstRW<[VecBF], (instregex "WL(DE|ED)B$")>;
1016
1017 // divide / square root
1018 def : InstRW<[VecFPd], (instregex "VFD$")>;
1019 def : InstRW<[VecFPd], (instregex "(V|W)FDDB$")>;
1020 def : InstRW<[VecFPd], (instregex "VFSQ$")>;
1021 def : InstRW<[VecFPd], (instregex "(V|W)FSQDB$")>;
1022
1023 //===----------------------------------------------------------------------===//
1024 // Vector: Floating-point comparison
1025 //===----------------------------------------------------------------------===//
1026
1027 def : InstRW<[VecXsPm], (instregex "VFC(E|H|HE)$")>;
1028 def : InstRW<[VecXsPm], (instregex "VFC(E|H|HE)DB$")>;
1029 def : InstRW<[VecXsPm, Lat4], (instregex "WF(C|K)$")>;
1030 def : InstRW<[VecXsPm], (instregex "WFC(E|H|HE)DB$")>;
1031 def : InstRW<[VecXsPm, Lat4], (instregex "VFC(E|H|HE)DBS$")>;
1032 def : InstRW<[VecXsPm, Lat4], (instregex "WFC(E|H|HE)DBS$")>;
1033 def : InstRW<[VecXsPm, Lat4], (instregex "WF(C|K)DB$")>;
1034
1035 //===----------------------------------------------------------------------===//
1036 // Vector: Floating-point insertion and extraction
1037 //===----------------------------------------------------------------------===//
1038
1039 def : InstRW<[FXb], (instregex "LEFR$")>;
1040 def : InstRW<[FXb, Lat4], (instregex "LFER$")>;
1041
1042 //===----------------------------------------------------------------------===//
1043 // Vector: String instructions
1044 //===----------------------------------------------------------------------===//
1045
1046 def : InstRW<[VecStr], (instregex "VFAE(B)?$")>;
1047 def : InstRW<[VecStr, Lat5], (instregex "VFAEBS$")>;
1048 def : InstRW<[VecStr], (instregex "VFAE(F|H)$")>;
1049 def : InstRW<[VecStr, Lat5], (instregex "VFAE(F|H)S$")>;
1050 def : InstRW<[VecStr], (instregex "VFAEZ(B|F|H)$")>;
1051 def : InstRW<[VecStr, Lat5], (instregex "VFAEZ(B|F|H)S$")>;
1052 def : InstRW<[VecStr], (instregex "VFEE(B|F|H|ZB|ZF|ZH)?$")>;
1053 def : InstRW<[VecStr, Lat5], (instregex "VFEE(B|F|H|ZB|ZF|ZH)S$")>;
1054 def : InstRW<[VecStr], (instregex "VFENE(B|F|H|ZB|ZF|ZH)?$")>;
1055 def : InstRW<[VecStr, Lat5], (instregex "VFENE(B|F|H|ZB|ZF|ZH)S$")>;
1056 def : InstRW<[VecStr], (instregex "VISTR(B|F|H)?$")>;
1057 def : InstRW<[VecStr, Lat5], (instregex "VISTR(B|F|H)S$")>;
1058 def : InstRW<[VecStr], (instregex "VSTRC(B|F|H)?$")>;
1059 def : InstRW<[VecStr, Lat5], (instregex "VSTRC(B|F|H)S$")>;
1060 def : InstRW<[VecStr], (instregex "VSTRCZ(B|F|H)$")>;
1061 def : InstRW<[VecStr, Lat5], (instregex "VSTRCZ(B|F|H)S$")>;
1062
1063 }
1064