]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - contrib/llvm/lib/Target/SystemZ/SystemZScheduleZ13.td
Upgrade Unbound to 1.6.3. More to follow.
[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<VecDFX,  [Z13_VecUnit]> { let Latency = 1; }
80 def : WriteRes<VecDFX2, [Z13_VecUnit, Z13_VecUnit]> { let Latency = 2; }
81 def : WriteRes<VecFPd,  [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                          Z13_VecFPdUnit, Z13_VecFPdUnit, Z13_VecFPdUnit,
90                          Z13_VecFPdUnit, Z13_VecFPdUnit, Z13_VecFPdUnit]>
91                          { let Latency = 30; }
92 def : WriteRes<VecMul,  [Z13_VecUnit]> { let Latency = 5; }
93 def : WriteRes<VecStr,  [Z13_VecUnit]> { let Latency = 4; }
94 def : WriteRes<VecXsPm, [Z13_VecUnit]> { let Latency = 3; }
95 def : WriteRes<VBU,     [Z13_VBUnit]>; // Virtual Branching Unit
96
97 // -------------------------- INSTRUCTIONS ---------------------------------- //
98
99 // InstRW constructs have been used in order to preserve the
100 // readability of the InstrInfo files.
101
102 // For each instruction, as matched by a regexp, provide a list of
103 // resources that it needs. These will be combined into a SchedClass.
104
105 //===----------------------------------------------------------------------===//
106 // Stack allocation
107 //===----------------------------------------------------------------------===//
108
109 def : InstRW<[FXa], (instregex "ADJDYNALLOC$")>; // Pseudo -> LA / LAY
110
111 //===----------------------------------------------------------------------===//
112 // Branch instructions
113 //===----------------------------------------------------------------------===//
114
115 // Branch
116 def : InstRW<[VBU], (instregex "(Call)?BRC(L)?(Asm.*)?$")>;
117 def : InstRW<[VBU], (instregex "(Call)?J(G)?(Asm.*)?$")>;
118 def : InstRW<[FXb], (instregex "(Call)?BC(R)?(Asm.*)?$")>;
119 def : InstRW<[FXb], (instregex "(Call)?B(R)?(Asm.*)?$")>;
120 def : InstRW<[FXa, EndGroup], (instregex "BRCT(G)?$")>;
121 def : InstRW<[FXb, FXa, Lat2, GroupAlone], (instregex "BRCTH$")>;
122 def : InstRW<[FXb, FXa, Lat2, GroupAlone], (instregex "BCT(G)?(R)?$")>;
123 def : InstRW<[FXa, FXa, FXb, FXb, Lat4, GroupAlone],
124              (instregex "B(R)?X(H|L).*$")>;
125
126 // Compare and branch
127 def : InstRW<[FXb], (instregex "C(L)?(G)?(I|R)J(Asm.*)?$")>;
128 def : InstRW<[FXb, FXb, Lat2, GroupAlone],
129              (instregex "C(L)?(G)?(I|R)B(Call|Return|Asm.*)?$")>;
130
131 //===----------------------------------------------------------------------===//
132 // Trap instructions
133 //===----------------------------------------------------------------------===//
134
135 // Trap
136 def : InstRW<[VBU], (instregex "(Cond)?Trap$")>;
137
138 // Compare and trap
139 def : InstRW<[FXb], (instregex "C(G)?(I|R)T(Asm.*)?$")>;
140 def : InstRW<[FXb], (instregex "CL(G)?RT(Asm.*)?$")>;
141 def : InstRW<[FXb], (instregex "CL(F|G)IT(Asm.*)?$")>;
142 def : InstRW<[FXb, LSU, Lat5], (instregex "CL(G)?T(Asm.*)?$")>;
143
144 //===----------------------------------------------------------------------===//
145 // Call and return instructions
146 //===----------------------------------------------------------------------===//
147
148 // Call
149 def : InstRW<[VBU, FXa, FXa, Lat3, GroupAlone], (instregex "(Call)?BRAS$")>;
150 def : InstRW<[FXa, FXa, FXb, Lat3, GroupAlone], (instregex "(Call)?BRASL$")>;
151 def : InstRW<[FXa, FXa, FXb, Lat3, GroupAlone], (instregex "(Call)?BAS(R)?$")>;
152 def : InstRW<[FXa, FXa, FXb, Lat3, GroupAlone], (instregex "TLS_(G|L)DCALL$")>;
153
154 // Return
155 def : InstRW<[FXb, EndGroup], (instregex "Return$")>;
156 def : InstRW<[FXb], (instregex "CondReturn$")>;
157
158 //===----------------------------------------------------------------------===//
159 // Select instructions
160 //===----------------------------------------------------------------------===//
161
162 // Select pseudo
163 def : InstRW<[FXa], (instregex "Select(32|64|32Mux)$")>;
164
165 // CondStore pseudos
166 def : InstRW<[FXa], (instregex "CondStore16(Inv)?$")>;
167 def : InstRW<[FXa], (instregex "CondStore16Mux(Inv)?$")>;
168 def : InstRW<[FXa], (instregex "CondStore32(Inv)?$")>;
169 def : InstRW<[FXa], (instregex "CondStore32Mux(Inv)?$")>;
170 def : InstRW<[FXa], (instregex "CondStore64(Inv)?$")>;
171 def : InstRW<[FXa], (instregex "CondStore8(Inv)?$")>;
172 def : InstRW<[FXa], (instregex "CondStore8Mux(Inv)?$")>;
173
174 //===----------------------------------------------------------------------===//
175 // Move instructions
176 //===----------------------------------------------------------------------===//
177
178 // Moves
179 def : InstRW<[FXb, LSU, Lat5], (instregex "MV(G|H)?HI$")>;
180 def : InstRW<[FXb, LSU, Lat5], (instregex "MVI(Y)?$")>;
181
182 // Move character
183 def : InstRW<[FXb, LSU, LSU, LSU, Lat8, GroupAlone], (instregex "MVC$")>;
184 def : InstRW<[LSU, Lat30, GroupAlone], (instregex "MVCL(E|U)?$")>;
185
186 // Pseudo -> reg move
187 def : InstRW<[FXa], (instregex "COPY(_TO_REGCLASS)?$")>;
188 def : InstRW<[FXa], (instregex "EXTRACT_SUBREG$")>;
189 def : InstRW<[FXa], (instregex "INSERT_SUBREG$")>;
190 def : InstRW<[FXa], (instregex "REG_SEQUENCE$")>;
191 def : InstRW<[FXa], (instregex "SUBREG_TO_REG$")>;
192
193 // Loads
194 def : InstRW<[LSU], (instregex "L(Y|FH|RL|Mux|CBB)?$")>;
195 def : InstRW<[LSU], (instregex "LG(RL)?$")>;
196 def : InstRW<[LSU], (instregex "L128$")>;
197
198 def : InstRW<[FXa], (instregex "LLIH(F|H|L)$")>;
199 def : InstRW<[FXa], (instregex "LLIL(F|H|L)$")>;
200
201 def : InstRW<[FXa], (instregex "LG(F|H)I$")>;
202 def : InstRW<[FXa], (instregex "LHI(Mux)?$")>;
203 def : InstRW<[FXa], (instregex "LR(Mux)?$")>;
204
205 // Load and zero rightmost byte
206 def : InstRW<[LSU], (instregex "LZR(F|G)$")>;
207
208 // Load and trap
209 def : InstRW<[FXb, LSU, Lat5], (instregex "L(FH|G)?AT$")>;
210
211 // Load and test
212 def : InstRW<[FXa, LSU, Lat5], (instregex "LT(G)?$")>;
213 def : InstRW<[FXa], (instregex "LT(G)?R$")>;
214
215 // Stores
216 def : InstRW<[FXb, LSU, Lat5], (instregex "STG(RL)?$")>;
217 def : InstRW<[FXb, LSU, Lat5], (instregex "ST128$")>;
218 def : InstRW<[FXb, LSU, Lat5], (instregex "ST(Y|FH|RL|Mux)?$")>;
219
220 // String moves.
221 def : InstRW<[LSU, Lat30, GroupAlone], (instregex "MVST$")>;
222
223 //===----------------------------------------------------------------------===//
224 // Conditional move instructions
225 //===----------------------------------------------------------------------===//
226
227 def : InstRW<[FXa, Lat2], (instregex "LOCRMux$")>;
228 def : InstRW<[FXa, Lat2], (instregex "LOC(G|FH)?R(Asm.*)?$")>;
229 def : InstRW<[FXa, Lat2], (instregex "LOC(G|H)?HI(Mux|(Asm.*))?$")>;
230 def : InstRW<[FXa, LSU, Lat6], (instregex "LOC(G|FH|Mux)?(Asm.*)?$")>;
231 def : InstRW<[FXb, LSU, Lat5], (instregex "STOC(G|FH|Mux)?(Asm.*)?$")>;
232
233 //===----------------------------------------------------------------------===//
234 // Sign extensions
235 //===----------------------------------------------------------------------===//
236
237 def : InstRW<[FXa], (instregex "L(B|H|G)R$")>;
238 def : InstRW<[FXa], (instregex "LG(B|H|F)R$")>;
239
240 def : InstRW<[FXa, LSU, Lat5], (instregex "LTGF$")>;
241 def : InstRW<[FXa], (instregex "LTGFR$")>;
242
243 def : InstRW<[FXa, LSU, Lat5], (instregex "LB(H|Mux)?$")>;
244 def : InstRW<[FXa, LSU, Lat5], (instregex "LH(Y)?$")>;
245 def : InstRW<[FXa, LSU, Lat5], (instregex "LH(H|Mux|RL)$")>;
246 def : InstRW<[FXa, LSU, Lat5], (instregex "LG(B|H|F)$")>;
247 def : InstRW<[FXa, LSU, Lat5], (instregex "LG(H|F)RL$")>;
248
249 //===----------------------------------------------------------------------===//
250 // Zero extensions
251 //===----------------------------------------------------------------------===//
252
253 def : InstRW<[FXa], (instregex "LLCR(Mux)?$")>;
254 def : InstRW<[FXa], (instregex "LLHR(Mux)?$")>;
255 def : InstRW<[FXa], (instregex "LLG(C|H|F|T)R$")>;
256 def : InstRW<[LSU], (instregex "LLC(Mux)?$")>;
257 def : InstRW<[LSU], (instregex "LLH(Mux)?$")>;
258 def : InstRW<[FXa, LSU, Lat5], (instregex "LL(C|H)H$")>;
259 def : InstRW<[LSU], (instregex "LLHRL$")>;
260 def : InstRW<[LSU], (instregex "LLG(C|H|F|T|HRL|FRL)$")>;
261
262 // Load and zero rightmost byte
263 def : InstRW<[LSU], (instregex "LLZRGF$")>;
264
265 // Load and trap
266 def : InstRW<[FXb, LSU, Lat5], (instregex "LLG(F|T)?AT$")>;
267
268 //===----------------------------------------------------------------------===//
269 // Truncations
270 //===----------------------------------------------------------------------===//
271
272 def : InstRW<[FXb, LSU, Lat5], (instregex "STC(H|Y|Mux)?$")>;
273 def : InstRW<[FXb, LSU, Lat5], (instregex "STH(H|Y|RL|Mux)?$")>;
274 def : InstRW<[FXb, LSU, Lat5], (instregex "STCM(H|Y)?$")>;
275
276 //===----------------------------------------------------------------------===//
277 // Multi-register moves
278 //===----------------------------------------------------------------------===//
279
280 // Load multiple (estimated average of 5 ops)
281 def : InstRW<[LSU, LSU, LSU, LSU, LSU, Lat10, GroupAlone],
282              (instregex "LM(H|Y|G)?$")>;
283
284 // Load multiple disjoint
285 def : InstRW<[LSU, Lat30, GroupAlone], (instregex "LMD$")>;
286
287 // Store multiple (estimated average of ceil(5/2) FXb ops)
288 def : InstRW<[LSU, LSU, FXb, FXb, FXb, Lat10,
289               GroupAlone], (instregex "STM(G|H|Y)?$")>;
290
291 //===----------------------------------------------------------------------===//
292 // Byte swaps
293 //===----------------------------------------------------------------------===//
294
295 def : InstRW<[FXa], (instregex "LRV(G)?R$")>;
296 def : InstRW<[FXa, LSU, Lat5], (instregex "LRV(G|H)?$")>;
297 def : InstRW<[FXb, LSU, Lat5], (instregex "STRV(G|H)?$")>;
298 def : InstRW<[LSU, Lat30, GroupAlone], (instregex "MVCIN$")>;
299
300 //===----------------------------------------------------------------------===//
301 // Load address instructions
302 //===----------------------------------------------------------------------===//
303
304 def : InstRW<[FXa], (instregex "LA(Y|RL)?$")>;
305
306 // Load the Global Offset Table address ( -> larl )
307 def : InstRW<[FXa], (instregex "GOT$")>;
308
309 //===----------------------------------------------------------------------===//
310 // Absolute and Negation
311 //===----------------------------------------------------------------------===//
312
313 def : InstRW<[FXa, Lat2], (instregex "LP(G)?R$")>;
314 def : InstRW<[FXa, FXa, Lat3, BeginGroup], (instregex "L(N|P)GFR$")>;
315 def : InstRW<[FXa, Lat2], (instregex "LN(R|GR)$")>;
316 def : InstRW<[FXa], (instregex "LC(R|GR)$")>;
317 def : InstRW<[FXa, FXa, Lat2, BeginGroup], (instregex "LCGFR$")>;
318
319 //===----------------------------------------------------------------------===//
320 // Insertion
321 //===----------------------------------------------------------------------===//
322
323 def : InstRW<[FXa, LSU, Lat5], (instregex "IC(Y)?$")>;
324 def : InstRW<[FXa, LSU, Lat5], (instregex "IC32(Y)?$")>;
325 def : InstRW<[FXa, LSU, Lat5], (instregex "ICM(H|Y)?$")>;
326 def : InstRW<[FXa], (instregex "II(F|H|L)Mux$")>;
327 def : InstRW<[FXa], (instregex "IIHF(64)?$")>;
328 def : InstRW<[FXa], (instregex "IIHH(64)?$")>;
329 def : InstRW<[FXa], (instregex "IIHL(64)?$")>;
330 def : InstRW<[FXa], (instregex "IILF(64)?$")>;
331 def : InstRW<[FXa], (instregex "IILH(64)?$")>;
332 def : InstRW<[FXa], (instregex "IILL(64)?$")>;
333
334 //===----------------------------------------------------------------------===//
335 // Addition
336 //===----------------------------------------------------------------------===//
337
338 def : InstRW<[FXa, LSU, Lat5], (instregex "A(Y)?$")>;
339 def : InstRW<[FXa, LSU, Lat6], (instregex "AH(Y)?$")>;
340 def : InstRW<[FXa], (instregex "AIH$")>;
341 def : InstRW<[FXa], (instregex "AFI(Mux)?$")>;
342 def : InstRW<[FXa, LSU, Lat5], (instregex "AG$")>;
343 def : InstRW<[FXa], (instregex "AGFI$")>;
344 def : InstRW<[FXa], (instregex "AGHI(K)?$")>;
345 def : InstRW<[FXa], (instregex "AGR(K)?$")>;
346 def : InstRW<[FXa], (instregex "AHI(K)?$")>;
347 def : InstRW<[FXa], (instregex "AHIMux(K)?$")>;
348 def : InstRW<[FXa, LSU, Lat5], (instregex "AL(Y)?$")>;
349 def : InstRW<[FXa], (instregex "AL(FI|HSIK)$")>;
350 def : InstRW<[FXa, LSU, Lat5], (instregex "ALG(F)?$")>;
351 def : InstRW<[FXa], (instregex "ALGHSIK$")>;
352 def : InstRW<[FXa], (instregex "ALGF(I|R)$")>;
353 def : InstRW<[FXa], (instregex "ALGR(K)?$")>;
354 def : InstRW<[FXa], (instregex "ALR(K)?$")>;
355 def : InstRW<[FXa], (instregex "AR(K)?$")>;
356 def : InstRW<[FXa], (instregex "A(L)?HHHR$")>;
357 def : InstRW<[FXa, Lat2], (instregex "A(L)?HHLR$")>;
358 def : InstRW<[FXa], (instregex "ALSIH(N)?$")>;
359 def : InstRW<[FXb, LSU, Lat5], (instregex "A(L)?(G)?SI$")>;
360
361 // Logical addition with carry
362 def : InstRW<[FXa, LSU, Lat6, GroupAlone], (instregex "ALC(G)?$")>;
363 def : InstRW<[FXa, Lat2, GroupAlone], (instregex "ALC(G)?R$")>;
364
365 // Add with sign extension (32 -> 64)
366 def : InstRW<[FXa, LSU, Lat6], (instregex "AGF$")>;
367 def : InstRW<[FXa, Lat2], (instregex "AGFR$")>;
368
369 //===----------------------------------------------------------------------===//
370 // Subtraction
371 //===----------------------------------------------------------------------===//
372
373 def : InstRW<[FXa, LSU, Lat5], (instregex "S(G|Y)?$")>;
374 def : InstRW<[FXa, LSU, Lat6], (instregex "SH(Y)?$")>;
375 def : InstRW<[FXa], (instregex "SGR(K)?$")>;
376 def : InstRW<[FXa], (instregex "SLFI$")>;
377 def : InstRW<[FXa, LSU, Lat5], (instregex "SL(G|GF|Y)?$")>;
378 def : InstRW<[FXa], (instregex "SLGF(I|R)$")>;
379 def : InstRW<[FXa], (instregex "SLGR(K)?$")>;
380 def : InstRW<[FXa], (instregex "SLR(K)?$")>;
381 def : InstRW<[FXa], (instregex "SR(K)?$")>;
382 def : InstRW<[FXa], (instregex "S(L)?HHHR$")>;
383 def : InstRW<[FXa, Lat2], (instregex "S(L)?HHLR$")>;
384
385 // Subtraction with borrow
386 def : InstRW<[FXa, LSU, Lat6, GroupAlone], (instregex "SLB(G)?$")>;
387 def : InstRW<[FXa, Lat2, GroupAlone], (instregex "SLB(G)?R$")>;
388
389 // Subtraction with sign extension (32 -> 64)
390 def : InstRW<[FXa, LSU, Lat6], (instregex "SGF$")>;
391 def : InstRW<[FXa, Lat2], (instregex "SGFR$")>;
392
393 //===----------------------------------------------------------------------===//
394 // AND
395 //===----------------------------------------------------------------------===//
396
397 def : InstRW<[FXa, LSU, Lat5], (instregex "N(G|Y)?$")>;
398 def : InstRW<[FXa], (instregex "NGR(K)?$")>;
399 def : InstRW<[FXa], (instregex "NI(FMux|HMux|LMux)$")>;
400 def : InstRW<[FXb, LSU, Lat5], (instregex "NI(Y)?$")>;
401 def : InstRW<[FXa], (instregex "NIHF(64)?$")>;
402 def : InstRW<[FXa], (instregex "NIHH(64)?$")>;
403 def : InstRW<[FXa], (instregex "NIHL(64)?$")>;
404 def : InstRW<[FXa], (instregex "NILF(64)?$")>;
405 def : InstRW<[FXa], (instregex "NILH(64)?$")>;
406 def : InstRW<[FXa], (instregex "NILL(64)?$")>;
407 def : InstRW<[FXa], (instregex "NR(K)?$")>;
408 def : InstRW<[LSU, LSU, FXb, Lat9, BeginGroup], (instregex "NC$")>;
409
410 //===----------------------------------------------------------------------===//
411 // OR
412 //===----------------------------------------------------------------------===//
413
414 def : InstRW<[FXa, LSU, Lat5], (instregex "O(G|Y)?$")>;
415 def : InstRW<[FXa], (instregex "OGR(K)?$")>;
416 def : InstRW<[FXb, LSU, Lat5], (instregex "OI(Y)?$")>;
417 def : InstRW<[FXa], (instregex "OI(FMux|HMux|LMux)$")>;
418 def : InstRW<[FXa], (instregex "OIHF(64)?$")>;
419 def : InstRW<[FXa], (instregex "OIHH(64)?$")>;
420 def : InstRW<[FXa], (instregex "OIHL(64)?$")>;
421 def : InstRW<[FXa], (instregex "OILF(64)?$")>;
422 def : InstRW<[FXa], (instregex "OILH(64)?$")>;
423 def : InstRW<[FXa], (instregex "OILL(64)?$")>;
424 def : InstRW<[FXa], (instregex "OR(K)?$")>;
425 def : InstRW<[LSU, LSU, FXb, Lat9, BeginGroup], (instregex "OC$")>;
426
427 //===----------------------------------------------------------------------===//
428 // XOR
429 //===----------------------------------------------------------------------===//
430
431 def : InstRW<[FXa, LSU, Lat5], (instregex "X(G|Y)?$")>;
432 def : InstRW<[FXb, LSU, Lat5], (instregex "XI(Y)?$")>;
433 def : InstRW<[FXa], (instregex "XIFMux$")>;
434 def : InstRW<[FXa], (instregex "XGR(K)?$")>;
435 def : InstRW<[FXa], (instregex "XIHF(64)?$")>;
436 def : InstRW<[FXa], (instregex "XILF(64)?$")>;
437 def : InstRW<[FXa], (instregex "XR(K)?$")>;
438 def : InstRW<[LSU, LSU, FXb, Lat9, BeginGroup], (instregex "XC$")>;
439
440 //===----------------------------------------------------------------------===//
441 // Multiplication
442 //===----------------------------------------------------------------------===//
443
444 def : InstRW<[FXa, LSU, Lat10], (instregex "MS(GF|Y)?$")>;
445 def : InstRW<[FXa, Lat6], (instregex "MS(R|FI)$")>;
446 def : InstRW<[FXa, LSU, Lat12], (instregex "MSG$")>;
447 def : InstRW<[FXa, Lat8], (instregex "MSGR$")>;
448 def : InstRW<[FXa, Lat6], (instregex "MSGF(I|R)$")>;
449 def : InstRW<[FXa2, LSU, Lat15, GroupAlone], (instregex "MLG$")>;
450 def : InstRW<[FXa2, Lat9, GroupAlone], (instregex "MLGR$")>;
451 def : InstRW<[FXa, Lat5], (instregex "MGHI$")>;
452 def : InstRW<[FXa, Lat5], (instregex "MHI$")>;
453 def : InstRW<[FXa, LSU, Lat9], (instregex "MH(Y)?$")>;
454 def : InstRW<[FXa2, Lat7, GroupAlone], (instregex "M(L)?R$")>;
455 def : InstRW<[FXa2, LSU, Lat7, GroupAlone], (instregex "M(FY|L)?$")>;
456
457 //===----------------------------------------------------------------------===//
458 // Division and remainder
459 //===----------------------------------------------------------------------===//
460
461 def : InstRW<[FXa2, FXa2, Lat20, GroupAlone], (instregex "DR$")>;
462 def : InstRW<[FXa2, FXa2, LSU, Lat30, GroupAlone], (instregex "D$")>;
463 def : InstRW<[FXa2, Lat30, GroupAlone], (instregex "DSG(F)?R$")>;
464 def : InstRW<[LSU, FXa2, Lat30, GroupAlone], (instregex "DSG(F)?$")>;
465 def : InstRW<[FXa2, FXa2, Lat20, GroupAlone], (instregex "DLR$")>;
466 def : InstRW<[FXa2, FXa2, Lat30, GroupAlone], (instregex "DLGR$")>;
467 def : InstRW<[FXa2, FXa2, LSU, Lat30, GroupAlone], (instregex "DL(G)?$")>;
468
469 //===----------------------------------------------------------------------===//
470 // Shifts
471 //===----------------------------------------------------------------------===//
472
473 def : InstRW<[FXa], (instregex "SLL(G|K)?$")>;
474 def : InstRW<[FXa], (instregex "SRL(G|K)?$")>;
475 def : InstRW<[FXa], (instregex "SRA(G|K)?$")>;
476 def : InstRW<[FXa], (instregex "SLA(G|K)?$")>;
477 def : InstRW<[FXa, FXa, FXa, FXa, LSU, Lat8, GroupAlone],
478              (instregex "S(L|R)D(A|L)$")>;
479
480 // Rotate
481 def : InstRW<[FXa, LSU, Lat6], (instregex "RLL(G)?$")>;
482
483 // Rotate and insert
484 def : InstRW<[FXa], (instregex "RISBG(N|32)?$")>;
485 def : InstRW<[FXa], (instregex "RISBH(G|H|L)$")>;
486 def : InstRW<[FXa], (instregex "RISBL(G|H|L)$")>;
487 def : InstRW<[FXa], (instregex "RISBMux$")>;
488
489 // Rotate and Select
490 def : InstRW<[FXa, FXa, Lat3, BeginGroup], (instregex "R(N|O|X)SBG$")>;
491
492 //===----------------------------------------------------------------------===//
493 // Comparison
494 //===----------------------------------------------------------------------===//
495
496 def : InstRW<[FXb, LSU, Lat5], (instregex "C(G|Y|Mux|RL)?$")>;
497 def : InstRW<[FXb], (instregex "C(F|H)I(Mux)?$")>;
498 def : InstRW<[FXb], (instregex "CG(F|H)I$")>;
499 def : InstRW<[FXb, LSU, Lat5], (instregex "CG(HSI|RL)$")>;
500 def : InstRW<[FXb], (instregex "C(G)?R$")>;
501 def : InstRW<[FXb], (instregex "CIH$")>;
502 def : InstRW<[FXb, LSU, Lat5], (instregex "CH(F|SI)$")>;
503 def : InstRW<[FXb, LSU, Lat5], (instregex "CL(Y|Mux|FHSI)?$")>;
504 def : InstRW<[FXb], (instregex "CLFI(Mux)?$")>;
505 def : InstRW<[FXb, LSU, Lat5], (instregex "CLG(HRL|HSI)?$")>;
506 def : InstRW<[FXb, LSU, Lat5], (instregex "CLGF(RL)?$")>;
507 def : InstRW<[FXb], (instregex "CLGF(I|R)$")>;
508 def : InstRW<[FXb], (instregex "CLGR$")>;
509 def : InstRW<[FXb, LSU, Lat5], (instregex "CLGRL$")>;
510 def : InstRW<[FXb, LSU, Lat5], (instregex "CLH(F|RL|HSI)$")>;
511 def : InstRW<[FXb], (instregex "CLIH$")>;
512 def : InstRW<[FXb, LSU, Lat5], (instregex "CLI(Y)?$")>;
513 def : InstRW<[FXb], (instregex "CLR$")>;
514 def : InstRW<[FXb, LSU, Lat5], (instregex "CLRL$")>;
515 def : InstRW<[FXb], (instregex "C(L)?HHR$")>;
516 def : InstRW<[FXb, Lat2], (instregex "C(L)?HLR$")>;
517
518 // Compare halfword
519 def : InstRW<[FXb, LSU, Lat6], (instregex "CH(Y|RL)?$")>;
520 def : InstRW<[FXb, LSU, Lat6], (instregex "CGH(RL)?$")>;
521 def : InstRW<[FXa, FXb, LSU, Lat6, BeginGroup], (instregex "CHHSI$")>;
522
523 // Compare with sign extension (32 -> 64)
524 def : InstRW<[FXb, LSU, Lat6], (instregex "CGF(RL)?$")>;
525 def : InstRW<[FXb, Lat2], (instregex "CGFR$")>;
526
527 // Compare logical character
528 def : InstRW<[FXb, LSU, LSU, Lat9, BeginGroup], (instregex "CLC$")>;
529 def : InstRW<[LSU, Lat30, GroupAlone], (instregex "CLCL(E|U)?$")>;
530 def : InstRW<[LSU, Lat30, GroupAlone], (instregex "CLST$")>;
531
532 // Test under mask
533 def : InstRW<[FXb, LSU, Lat5], (instregex "TM(Y)?$")>;
534 def : InstRW<[FXb], (instregex "TM(H|L)Mux$")>;
535 def : InstRW<[FXb], (instregex "TMHH(64)?$")>;
536 def : InstRW<[FXb], (instregex "TMHL(64)?$")>;
537 def : InstRW<[FXb], (instregex "TMLH(64)?$")>;
538 def : InstRW<[FXb], (instregex "TMLL(64)?$")>;
539
540 // Compare logical characters under mask
541 def : InstRW<[FXb, LSU, Lat6], (instregex "CLM(H|Y)?$")>;
542
543 //===----------------------------------------------------------------------===//
544 // Prefetch and execution hint
545 //===----------------------------------------------------------------------===//
546
547 def : InstRW<[LSU], (instregex "PFD(RL)?$")>;
548 def : InstRW<[FXb, Lat2], (instregex "BPP$")>;
549 def : InstRW<[FXb, EndGroup], (instregex "BPRP$")>;
550 def : InstRW<[FXb], (instregex "NIAI$")>;
551
552 //===----------------------------------------------------------------------===//
553 // Atomic operations
554 //===----------------------------------------------------------------------===//
555
556 def : InstRW<[FXb, EndGroup], (instregex "Serialize$")>;
557
558 def : InstRW<[FXb, LSU, Lat5], (instregex "LAA(G)?$")>;
559 def : InstRW<[FXb, LSU, Lat5], (instregex "LAAL(G)?$")>;
560 def : InstRW<[FXb, LSU, Lat5], (instregex "LAN(G)?$")>;
561 def : InstRW<[FXb, LSU, Lat5], (instregex "LAO(G)?$")>;
562 def : InstRW<[FXb, LSU, Lat5], (instregex "LAX(G)?$")>;
563
564 // Test and set
565 def : InstRW<[FXb, LSU, Lat5, EndGroup], (instregex "TS$")>;
566
567 // Compare and swap
568 def : InstRW<[FXa, FXb, LSU, Lat6, GroupAlone], (instregex "CS(G|Y)?$")>;
569
570 // Compare double and swap
571 def : InstRW<[FXa, FXa, FXb, FXb, FXa, LSU, Lat10, GroupAlone],
572              (instregex "CDS(Y)?$")>;
573 def : InstRW<[FXa, FXa, FXb, FXb, LSU, FXb, FXb, LSU, LSU, Lat20, GroupAlone],
574              (instregex "CDSG$")>;
575
576 // Compare and swap and store
577 def : InstRW<[FXa, LSU, Lat30], (instregex "CSST$")>;
578
579 // Perform locked operation
580 def : InstRW<[LSU, Lat30, GroupAlone], (instregex "PLO$")>;
581
582 // Load/store pair from/to quadword
583 def : InstRW<[LSU, LSU, Lat5, GroupAlone], (instregex "LPQ$")>;
584 def : InstRW<[FXb, FXb, LSU, Lat6, GroupAlone], (instregex "STPQ$")>;
585
586 // Load pair disjoint
587 def : InstRW<[LSU, LSU, Lat5, GroupAlone], (instregex "LPD(G)?$")>;
588
589 //===----------------------------------------------------------------------===//
590 // Translate and convert
591 //===----------------------------------------------------------------------===//
592
593 def : InstRW<[LSU, Lat30, GroupAlone], (instregex "TR$")>;
594 def : InstRW<[FXa, FXa, FXa, LSU, LSU, Lat30, GroupAlone], (instregex "TRT$")>;
595 def : InstRW<[FXa, LSU, Lat30], (instregex "TRTR$")>;
596 def : InstRW<[FXa, Lat30], (instregex "TR(TR)?(T)?(E|EOpt)?$")>;
597 def : InstRW<[LSU, Lat30], (instregex "TR(T|O)(T|O)(Opt)?$")>;
598 def : InstRW<[FXa, Lat30], (instregex "CU(12|14|21|24|41|42)(Opt)?$")>;
599 def : InstRW<[FXa, Lat30], (instregex "(CUUTF|CUTFU)(Opt)?$")>;
600
601 //===----------------------------------------------------------------------===//
602 // Message-security assist
603 //===----------------------------------------------------------------------===//
604
605 def : InstRW<[FXa, Lat30], (instregex "KM(C|F|O|CTR)?$")>;
606 def : InstRW<[FXa, Lat30], (instregex "(KIMD|KLMD|KMAC|PCC|PPNO)$")>;
607
608 //===----------------------------------------------------------------------===//
609 // Decimal arithmetic
610 //===----------------------------------------------------------------------===//
611
612 def : InstRW<[FXb, VecDF, VecDF, LSU, LSU, Lat30, GroupAlone],
613              (instregex "CVBG$")>;
614 def : InstRW<[FXb, VecDF, LSU, Lat30, GroupAlone], (instregex "CVB(Y)?$")>;
615 def : InstRW<[FXb, FXb, FXb, VecDF2, VecDF2, LSU, Lat30, GroupAlone],
616              (instregex "CVDG$")>;
617 def : InstRW<[FXb, VecDF, FXb, LSU, Lat30, GroupAlone], (instregex "CVD(Y)?$")>;
618 def : InstRW<[LSU, Lat10, GroupAlone], (instregex "MVO$")>;
619 def : InstRW<[LSU, Lat30, GroupAlone], (instregex "MV(N|Z)$")>;
620 def : InstRW<[LSU, Lat30, GroupAlone], (instregex "(PACK|PKA|PKU)$")>;
621 def : InstRW<[LSU, Lat12, GroupAlone], (instregex "UNPK(A|U)$")>;
622 def : InstRW<[FXb, LSU, LSU, Lat9, BeginGroup], (instregex "UNPK$")>;
623
624 def : InstRW<[FXb, VecDFX, LSU, LSU, LSU, Lat9, GroupAlone],
625              (instregex "(A|S|ZA)P$")>;
626 def : InstRW<[FXb, VecDFX2, VecDFX2, LSU, LSU, LSU, Lat30, GroupAlone],
627              (instregex "(M|D)P$")>;
628 def : InstRW<[FXb, VecDFX, VecDFX, LSU, LSU, Lat15, GroupAlone],
629              (instregex "SRP$")>;
630 def : InstRW<[VecDFX, LSU, LSU, Lat5, GroupAlone], (instregex "CP$")>;
631 def : InstRW<[VecDFX, LSU, Lat4, BeginGroup], (instregex "TP$")>;
632 def : InstRW<[LSU, Lat30, GroupAlone], (instregex "ED(MK)?$")>;
633
634 //===----------------------------------------------------------------------===//
635 // Access registers
636 //===----------------------------------------------------------------------===//
637
638 // Extract/set/copy access register
639 def : InstRW<[LSU], (instregex "(EAR|SAR|CPYA)$")>;
640
641 // Load address extended
642 def : InstRW<[LSU, FXa, Lat5, BeginGroup], (instregex "LAE(Y)?$")>;
643
644 // Load/store access multiple (not modeled precisely)
645 def : InstRW<[LSU, Lat30, GroupAlone], (instregex "(L|ST)AM(Y)?$")>;
646
647 //===----------------------------------------------------------------------===//
648 // Program mask and addressing mode
649 //===----------------------------------------------------------------------===//
650
651 // Insert Program Mask
652 def : InstRW<[FXa, Lat3, EndGroup], (instregex "IPM$")>;
653
654 // Set Program Mask
655 def : InstRW<[LSU, EndGroup], (instregex "SPM$")>;
656
657 // Branch and link
658 def : InstRW<[FXa, FXa, FXb, Lat5, GroupAlone], (instregex "BAL(R)?$")>;
659
660 // Test addressing mode
661 def : InstRW<[FXb], (instregex "TAM$")>;
662
663 // Set addressing mode
664 def : InstRW<[FXb, Lat2, EndGroup], (instregex "SAM(24|31|64)$")>;
665
666 // Branch (and save) and set mode.
667 def : InstRW<[FXa, FXb, Lat2, GroupAlone], (instregex "BSM$")>;
668 def : InstRW<[FXa, FXa, FXb, Lat3, GroupAlone], (instregex "BASSM$")>;
669
670 //===----------------------------------------------------------------------===//
671 // Transactional execution
672 //===----------------------------------------------------------------------===//
673
674 // Transaction begin
675 def : InstRW<[LSU, LSU, FXb, FXb, FXb, FXb, FXb, Lat15, GroupAlone],
676               (instregex "TBEGIN(C|_nofloat)?$")>;
677
678 // Transaction end
679 def : InstRW<[FXb, GroupAlone], (instregex "TEND$")>;
680
681 // Transaction abort
682 def : InstRW<[LSU, GroupAlone], (instregex "TABORT$")>;
683
684 // Extract Transaction Nesting Depth
685 def : InstRW<[FXa], (instregex "ETND$")>;
686
687 // Nontransactional store
688 def : InstRW<[FXb, LSU, Lat5], (instregex "NTSTG$")>;
689
690 //===----------------------------------------------------------------------===//
691 // Processor assist
692 //===----------------------------------------------------------------------===//
693
694 def : InstRW<[FXb], (instregex "PPA$")>;
695
696 //===----------------------------------------------------------------------===//
697 // Miscellaneous Instructions.
698 //===----------------------------------------------------------------------===//
699
700 // Find leftmost one
701 def : InstRW<[FXa, FXa, Lat6, GroupAlone], (instregex "FLOGR$")>;
702
703 // Population count
704 def : InstRW<[FXa, Lat3], (instregex "POPCNT$")>;
705
706 // Extend
707 def : InstRW<[FXa], (instregex "AEXT128$")>;
708 def : InstRW<[FXa], (instregex "ZEXT128$")>;
709
710 // String instructions
711 def : InstRW<[FXa, LSU, Lat30], (instregex "SRST$")>;
712 def : InstRW<[FXa, Lat30], (instregex "SRSTU$")>;
713 def : InstRW<[LSU, Lat30, GroupAlone], (instregex "CUSE$")>;
714
715 // Various complex instructions
716 def : InstRW<[LSU, Lat30], (instregex "CFC$")>;
717 def : InstRW<[FXb, LSU, Lat30], (instregex "UPT$")>;
718 def : InstRW<[LSU, Lat30], (instregex "CKSM$")>;
719 def : InstRW<[FXa, Lat30], (instregex "CMPSC$")>;
720
721 // Execute
722 def : InstRW<[FXb, GroupAlone], (instregex "EX(RL)?$")>;
723
724 //===----------------------------------------------------------------------===//
725 // .insn directive instructions
726 //===----------------------------------------------------------------------===//
727
728 // An "empty" sched-class will be assigned instead of the "invalid sched-class".
729 // getNumDecoderSlots() will then return 1 instead of 0.
730 def : InstRW<[], (instregex "Insn.*")>;
731
732
733 // ----------------------------- Floating point ----------------------------- //
734
735 //===----------------------------------------------------------------------===//
736 // FP: Select instructions
737 //===----------------------------------------------------------------------===//
738
739 def : InstRW<[FXa], (instregex "SelectF(32|64|128)$")>;
740 def : InstRW<[FXa], (instregex "CondStoreF32(Inv)?$")>;
741 def : InstRW<[FXa], (instregex "CondStoreF64(Inv)?$")>;
742
743 //===----------------------------------------------------------------------===//
744 // FP: Move instructions
745 //===----------------------------------------------------------------------===//
746
747 // Load zero
748 def : InstRW<[FXb], (instregex "LZ(DR|ER)$")>;
749 def : InstRW<[FXb, FXb, Lat2, BeginGroup], (instregex "LZXR$")>;
750
751 // Load
752 def : InstRW<[VecXsPm], (instregex "LER$")>;
753 def : InstRW<[FXb], (instregex "LD(R|R32|GR)$")>;
754 def : InstRW<[FXb, Lat3], (instregex "LGDR$")>;
755 def : InstRW<[FXb, FXb, Lat2, GroupAlone], (instregex "LXR$")>;
756
757 // Load and Test
758 def : InstRW<[VecXsPm, Lat4], (instregex "LT(D|E)BR$")>;
759 def : InstRW<[VecXsPm, Lat4], (instregex "LTEBRCompare(_VecPseudo)?$")>;
760 def : InstRW<[VecXsPm, Lat4], (instregex "LTDBRCompare(_VecPseudo)?$")>;
761 def : InstRW<[VecDF2, VecDF2, Lat11, GroupAlone], (instregex "LTXBR$")>;
762 def : InstRW<[VecDF2, VecDF2, Lat11, GroupAlone],
763              (instregex "LTXBRCompare(_VecPseudo)?$")>;
764
765 // Copy sign
766 def : InstRW<[VecXsPm], (instregex "CPSDRd(d|s)$")>;
767 def : InstRW<[VecXsPm], (instregex "CPSDRs(d|s)$")>;
768
769 //===----------------------------------------------------------------------===//
770 // FP: Load instructions
771 //===----------------------------------------------------------------------===//
772
773 def : InstRW<[VecXsPm, LSU, Lat7], (instregex "LE(Y)?$")>;
774 def : InstRW<[LSU], (instregex "LD(Y|E32)?$")>;
775 def : InstRW<[LSU], (instregex "LX$")>;
776
777 //===----------------------------------------------------------------------===//
778 // FP: Store instructions
779 //===----------------------------------------------------------------------===//
780
781 def : InstRW<[FXb, LSU, Lat7], (instregex "STD(Y)?$")>;
782 def : InstRW<[FXb, LSU, Lat7], (instregex "STE(Y)?$")>;
783 def : InstRW<[FXb, LSU, Lat5], (instregex "STX$")>;
784
785 //===----------------------------------------------------------------------===//
786 // FP: Conversion instructions
787 //===----------------------------------------------------------------------===//
788
789 // Load rounded
790 def : InstRW<[VecBF], (instregex "LEDBR(A)?$")>;
791 def : InstRW<[VecDF, VecDF, Lat20], (instregex "LEXBR(A)?$")>;
792 def : InstRW<[VecDF, VecDF, Lat20], (instregex "LDXBR(A)?$")>;
793
794 // Load lengthened
795 def : InstRW<[VecBF, LSU, Lat12], (instregex "LDEB$")>;
796 def : InstRW<[VecBF], (instregex "LDEBR$")>;
797 def : InstRW<[VecBF2, VecBF2, LSU, Lat12 , GroupAlone], (instregex "LX(D|E)B$")>;
798 def : InstRW<[VecBF2, VecBF2, GroupAlone], (instregex "LX(D|E)BR$")>;
799
800 // Convert from fixed / logical
801 def : InstRW<[FXb, VecBF, Lat9, BeginGroup], (instregex "CE(F|G)BR(A)?$")>;
802 def : InstRW<[FXb, VecBF, Lat9, BeginGroup], (instregex "CD(F|G)BR(A)?$")>;
803 def : InstRW<[FXb, VecDF2, VecDF2, Lat12, GroupAlone], (instregex "CX(F|G)BR(A)?$")>;
804 def : InstRW<[FXb, VecBF, Lat9, BeginGroup], (instregex "CEL(F|G)BR$")>;
805 def : InstRW<[FXb, VecBF, Lat9, BeginGroup], (instregex "CDL(F|G)BR$")>;
806 def : InstRW<[FXb, VecDF2, VecDF2, Lat12, GroupAlone], (instregex "CXL(F|G)BR$")>;
807
808 // Convert to fixed / logical
809 def : InstRW<[FXb, VecBF, Lat11, BeginGroup], (instregex "CF(E|D)BR(A)?$")>;
810 def : InstRW<[FXb, VecBF, Lat11, BeginGroup], (instregex "CG(E|D)BR(A)?$")>;
811 def : InstRW<[FXb, VecDF, VecDF, Lat20, BeginGroup], (instregex "C(F|G)XBR(A)?$")>;
812 def : InstRW<[FXb, VecBF, Lat11, GroupAlone], (instregex "CLFEBR$")>;
813 def : InstRW<[FXb, VecBF, Lat11, BeginGroup], (instregex "CLFDBR$")>;
814 def : InstRW<[FXb, VecBF, Lat11, BeginGroup], (instregex "CLG(E|D)BR$")>;
815 def : InstRW<[FXb, VecDF, VecDF, Lat20, BeginGroup], (instregex "CL(F|G)XBR$")>;
816
817 //===----------------------------------------------------------------------===//
818 // FP: Unary arithmetic
819 //===----------------------------------------------------------------------===//
820
821 // Load Complement / Negative / Positive
822 def : InstRW<[VecXsPm, Lat4], (instregex "L(C|N|P)DBR$")>;
823 def : InstRW<[VecXsPm, Lat4], (instregex "L(C|N|P)EBR$")>;
824 def : InstRW<[FXb], (instregex "LCDFR(_32)?$")>;
825 def : InstRW<[FXb], (instregex "LNDFR(_32)?$")>;
826 def : InstRW<[FXb], (instregex "LPDFR(_32)?$")>;
827 def : InstRW<[VecDF2, VecDF2, Lat11, GroupAlone], (instregex "L(C|N|P)XBR$")>;
828
829 // Square root
830 def : InstRW<[VecFPd, LSU], (instregex "SQ(E|D)B$")>;
831 def : InstRW<[VecFPd], (instregex "SQ(E|D)BR$")>;
832 def : InstRW<[VecFPd, VecFPd, GroupAlone], (instregex "SQXBR$")>;
833
834 // Load FP integer
835 def : InstRW<[VecBF], (instregex "FIEBR(A)?$")>;
836 def : InstRW<[VecBF], (instregex "FIDBR(A)?$")>;
837 def : InstRW<[VecDF2, VecDF2, Lat11, GroupAlone], (instregex "FIXBR(A)?$")>;
838
839 //===----------------------------------------------------------------------===//
840 // FP: Binary arithmetic
841 //===----------------------------------------------------------------------===//
842
843 // Addition
844 def : InstRW<[VecBF, LSU, Lat12], (instregex "A(E|D)B$")>;
845 def : InstRW<[VecBF], (instregex "A(E|D)BR$")>;
846 def : InstRW<[VecDF2, VecDF2, Lat10, GroupAlone], (instregex "AXBR$")>;
847
848 // Subtraction
849 def : InstRW<[VecBF, LSU, Lat12], (instregex "S(E|D)B$")>;
850 def : InstRW<[VecBF], (instregex "S(E|D)BR$")>;
851 def : InstRW<[VecDF2, VecDF2, Lat11, GroupAlone], (instregex "SXBR$")>;
852
853 // Multiply
854 def : InstRW<[VecBF, LSU, Lat12], (instregex "M(D|DE|EE)B$")>;
855 def : InstRW<[VecBF], (instregex "M(D|DE|EE)BR$")>;
856 def : InstRW<[VecBF2, VecBF2, LSU, Lat12, GroupAlone], (instregex "MXDB$")>;
857 def : InstRW<[VecBF2, VecBF2, GroupAlone], (instregex "MXDBR$")>;
858 def : InstRW<[VecDF2, VecDF2, Lat20, GroupAlone], (instregex "MXBR$")>;
859
860 // Multiply and add / subtract
861 def : InstRW<[VecBF2, LSU, Lat12, GroupAlone], (instregex "M(A|S)EB$")>;
862 def : InstRW<[VecBF, GroupAlone], (instregex "M(A|S)EBR$")>;
863 def : InstRW<[VecBF2, LSU, Lat12, GroupAlone], (instregex "M(A|S)DB$")>;
864 def : InstRW<[VecBF], (instregex "M(A|S)DBR$")>;
865
866 // Division
867 def : InstRW<[VecFPd, LSU], (instregex "D(E|D)B$")>;
868 def : InstRW<[VecFPd], (instregex "D(E|D)BR$")>;
869 def : InstRW<[VecFPd, VecFPd, GroupAlone], (instregex "DXBR$")>;
870
871 // Divide to integer
872 def : InstRW<[VecFPd, Lat30], (instregex "DI(E|D)BR$")>;
873
874 //===----------------------------------------------------------------------===//
875 // FP: Comparisons
876 //===----------------------------------------------------------------------===//
877
878 // Compare
879 def : InstRW<[VecXsPm, LSU, Lat8], (instregex "(K|C)(E|D)B$")>;
880 def : InstRW<[VecXsPm, Lat4], (instregex "(K|C)(E|D)BR?$")>;
881 def : InstRW<[VecDF, VecDF, Lat20, GroupAlone], (instregex "(K|C)XBR$")>;
882
883 // Test Data Class
884 def : InstRW<[LSU, VecXsPm, Lat9], (instregex "TC(E|D)B$")>;
885 def : InstRW<[LSU, VecDF2, VecDF2, Lat15, GroupAlone], (instregex "TCXB$")>;
886
887 //===----------------------------------------------------------------------===//
888 // FP: Floating-point control register instructions
889 //===----------------------------------------------------------------------===//
890
891 def : InstRW<[FXa, LSU, Lat4, GroupAlone], (instregex "EFPC$")>;
892 def : InstRW<[FXb, LSU, Lat5, GroupAlone], (instregex "STFPC$")>;
893 def : InstRW<[LSU, Lat3, GroupAlone], (instregex "SFPC$")>;
894 def : InstRW<[LSU, LSU, Lat6, GroupAlone], (instregex "LFPC$")>;
895 def : InstRW<[FXa, Lat30], (instregex "SFASR$")>;
896 def : InstRW<[FXa, LSU, Lat30], (instregex "LFAS$")>;
897 def : InstRW<[FXb, Lat3, GroupAlone], (instregex "SRNM(B|T)?$")>;
898
899
900 // --------------------- Hexadecimal floating point ------------------------- //
901
902 //===----------------------------------------------------------------------===//
903 // HFP: Move instructions
904 //===----------------------------------------------------------------------===//
905
906 // Load and Test
907 def : InstRW<[VecXsPm, Lat4], (instregex "LT(D|E)R$")>;
908 def : InstRW<[VecDF2, VecDF2, Lat11, GroupAlone], (instregex "LTXR$")>;
909
910 //===----------------------------------------------------------------------===//
911 // HFP: Conversion instructions
912 //===----------------------------------------------------------------------===//
913
914 // Load rounded
915 def : InstRW<[VecBF], (instregex "(LEDR|LRER)$")>;
916 def : InstRW<[VecBF], (instregex "LEXR$")>;
917 def : InstRW<[VecDF2], (instregex "(LDXR|LRDR)$")>;
918
919 // Load lengthened
920 def : InstRW<[LSU], (instregex "LDE$")>;
921 def : InstRW<[FXb], (instregex "LDER$")>;
922 def : InstRW<[VecBF2, VecBF2, LSU, Lat12, GroupAlone], (instregex "LX(D|E)$")>;
923 def : InstRW<[VecBF2, VecBF2, GroupAlone], (instregex "LX(D|E)R$")>;
924
925 // Convert from fixed
926 def : InstRW<[FXb, VecBF, Lat9, BeginGroup], (instregex "CE(F|G)R$")>;
927 def : InstRW<[FXb, VecBF, Lat9, BeginGroup], (instregex "CD(F|G)R$")>;
928 def : InstRW<[FXb, VecDF2, VecDF2, Lat12, GroupAlone], (instregex "CX(F|G)R$")>;
929
930 // Convert to fixed
931 def : InstRW<[FXb, VecBF, Lat11, BeginGroup], (instregex "CF(E|D)R$")>;
932 def : InstRW<[FXb, VecBF, Lat11, BeginGroup], (instregex "CG(E|D)R$")>;
933 def : InstRW<[FXb, VecDF, VecDF, Lat20, BeginGroup], (instregex "C(F|G)XR$")>;
934
935 // Convert BFP to HFP / HFP to BFP.
936 def : InstRW<[VecBF], (instregex "THD(E)?R$")>;
937 def : InstRW<[VecBF], (instregex "TB(E)?DR$")>;
938
939 //===----------------------------------------------------------------------===//
940 // HFP: Unary arithmetic
941 //===----------------------------------------------------------------------===//
942
943 // Load Complement / Negative / Positive
944 def : InstRW<[VecXsPm, Lat4], (instregex "L(C|N|P)DR$")>;
945 def : InstRW<[VecXsPm, Lat4], (instregex "L(C|N|P)ER$")>;
946 def : InstRW<[VecDF2, VecDF2, Lat11, GroupAlone], (instregex "L(C|N|P)XR$")>;
947
948 // Halve
949 def : InstRW<[VecBF], (instregex "H(E|D)R$")>;
950
951 // Square root
952 def : InstRW<[VecFPd, LSU], (instregex "SQ(E|D)$")>;
953 def : InstRW<[VecFPd], (instregex "SQ(E|D)R$")>;
954 def : InstRW<[VecFPd, VecFPd, GroupAlone], (instregex "SQXR$")>;
955
956 // Load FP integer
957 def : InstRW<[VecBF], (instregex "FIER$")>;
958 def : InstRW<[VecBF], (instregex "FIDR$")>;
959 def : InstRW<[VecDF2, VecDF2, Lat11, GroupAlone], (instregex "FIXR$")>;
960
961 //===----------------------------------------------------------------------===//
962 // HFP: Binary arithmetic
963 //===----------------------------------------------------------------------===//
964
965 // Addition
966 def : InstRW<[VecBF, LSU, Lat12], (instregex "A(E|D|U|W)$")>;
967 def : InstRW<[VecBF], (instregex "A(E|D|U|W)R$")>;
968 def : InstRW<[VecDF2, VecDF2, Lat10, GroupAlone], (instregex "AXR$")>;
969
970 // Subtraction
971 def : InstRW<[VecBF, LSU, Lat12], (instregex "S(E|D|U|W)$")>;
972 def : InstRW<[VecBF], (instregex "S(E|D|U|W)R$")>;
973 def : InstRW<[VecDF2, VecDF2, Lat11, GroupAlone], (instregex "SXR$")>;
974
975 // Multiply
976 def : InstRW<[VecBF, LSU, Lat12], (instregex "M(D|DE|E|EE)$")>;
977 def : InstRW<[VecBF], (instregex "M(D|DE|E|EE)R$")>;
978 def : InstRW<[VecBF2, VecBF2, LSU, Lat12, GroupAlone], (instregex "MXD$")>;
979 def : InstRW<[VecBF2, VecBF2, GroupAlone], (instregex "MXDR$")>;
980 def : InstRW<[VecDF2, VecDF2, Lat20, GroupAlone], (instregex "MXR$")>;
981 def : InstRW<[VecBF2, VecBF2, LSU, Lat12, GroupAlone], (instregex "MY$")>;
982 def : InstRW<[VecBF2, LSU, Lat12, GroupAlone], (instregex "MY(H|L)$")>;
983 def : InstRW<[VecBF2, VecBF2, GroupAlone], (instregex "MYR$")>;
984 def : InstRW<[VecBF, GroupAlone], (instregex "MY(H|L)R$")>;
985
986 // Multiply and add / subtract
987 def : InstRW<[VecBF2, LSU, Lat12, GroupAlone], (instregex "M(A|S)E$")>;
988 def : InstRW<[VecBF, GroupAlone], (instregex "M(A|S)ER$")>;
989 def : InstRW<[VecBF2, LSU, Lat12, GroupAlone], (instregex "M(A|S)D$")>;
990 def : InstRW<[VecBF, GroupAlone], (instregex "M(A|S)DR$")>;
991 def : InstRW<[VecBF2, LSU, Lat12, GroupAlone], (instregex "MAY(H|L)$")>;
992 def : InstRW<[VecBF2, VecBF2, LSU, Lat12, GroupAlone], (instregex "MAY$")>;
993 def : InstRW<[VecBF, GroupAlone], (instregex "MAY(H|L)R$")>;
994 def : InstRW<[VecBF2, VecBF2, GroupAlone], (instregex "MAYR$")>;
995
996 // Division
997 def : InstRW<[VecFPd, LSU], (instregex "D(E|D)$")>;
998 def : InstRW<[VecFPd], (instregex "D(E|D)R$")>;
999 def : InstRW<[VecFPd, VecFPd, GroupAlone], (instregex "DXR$")>;
1000
1001 //===----------------------------------------------------------------------===//
1002 // HFP: Comparisons
1003 //===----------------------------------------------------------------------===//
1004
1005 // Compare
1006 def : InstRW<[VecBF, LSU, Lat12], (instregex "C(E|D)$")>;
1007 def : InstRW<[VecBF], (instregex "C(E|D)R$")>;
1008 def : InstRW<[VecDF, VecDF, Lat20, GroupAlone], (instregex "CXR$")>;
1009
1010
1011 // ------------------------ Decimal floating point -------------------------- //
1012
1013 //===----------------------------------------------------------------------===//
1014 // DFP: Move instructions
1015 //===----------------------------------------------------------------------===//
1016
1017 // Load and Test
1018 def : InstRW<[VecDF], (instregex "LTDTR$")>;
1019 def : InstRW<[VecDF2, VecDF2, Lat11, GroupAlone], (instregex "LTXTR$")>;
1020
1021 //===----------------------------------------------------------------------===//
1022 // DFP: Conversion instructions
1023 //===----------------------------------------------------------------------===//
1024
1025 // Load rounded
1026 def : InstRW<[VecDF, Lat15], (instregex "LEDTR$")>;
1027 def : InstRW<[VecDF, VecDF, Lat20], (instregex "LDXTR$")>;
1028
1029 // Load lengthened
1030 def : InstRW<[VecDF], (instregex "LDETR$")>;
1031 def : InstRW<[VecDF2, VecDF2, Lat11, GroupAlone], (instregex "LXDTR$")>;
1032
1033 // Convert from fixed / logical
1034 def : InstRW<[FXb, VecDF, Lat30, BeginGroup], (instregex "CD(F|G)TR(A)?$")>;
1035 def : InstRW<[FXb, VecDF2, VecDF2, Lat30, GroupAlone], (instregex "CX(F|G)TR(A)?$")>;
1036 def : InstRW<[FXb, VecDF, Lat30, BeginGroup], (instregex "CDL(F|G)TR$")>;
1037 def : InstRW<[FXb, VecDF2, VecDF2, Lat30, GroupAlone], (instregex "CXL(F|G)TR$")>;
1038
1039 // Convert to fixed / logical
1040 def : InstRW<[FXb, VecDF, Lat30, BeginGroup], (instregex "C(F|G)DTR(A)?$")>;
1041 def : InstRW<[FXb, VecDF, VecDF, Lat30, BeginGroup], (instregex "C(F|G)XTR(A)?$")>;
1042 def : InstRW<[FXb, VecDF, Lat30, BeginGroup], (instregex "CL(F|G)DTR$")>;
1043 def : InstRW<[FXb, VecDF, VecDF, Lat30, BeginGroup], (instregex "CL(F|G)XTR$")>;
1044
1045 // Convert from / to signed / unsigned packed
1046 def : InstRW<[FXb, VecDF, Lat9, BeginGroup], (instregex "CD(S|U)TR$")>;
1047 def : InstRW<[FXb, FXb, VecDF2, VecDF2, Lat15, GroupAlone], (instregex "CX(S|U)TR$")>;
1048 def : InstRW<[FXb, VecDF, Lat12, BeginGroup], (instregex "C(S|U)DTR$")>;
1049 def : InstRW<[FXb, FXb, VecDF2, VecDF2, Lat15, GroupAlone], (instregex "C(S|U)XTR$")>;
1050
1051 // Convert from / to zoned
1052 def : InstRW<[LSU, VecDF, Lat11, BeginGroup], (instregex "CDZT$")>;
1053 def : InstRW<[LSU, LSU, VecDF2, VecDF2, Lat15, GroupAlone], (instregex "CXZT$")>;
1054 def : InstRW<[FXb, LSU, VecDF, Lat11, BeginGroup], (instregex "CZDT$")>;
1055 def : InstRW<[FXb, LSU, VecDF, VecDF, Lat15, GroupAlone], (instregex "CZXT$")>;
1056
1057 // Convert from / to packed
1058 def : InstRW<[LSU, VecDF, Lat11, BeginGroup], (instregex "CDPT$")>;
1059 def : InstRW<[LSU, LSU, VecDF2, VecDF2, Lat15, GroupAlone], (instregex "CXPT$")>;
1060 def : InstRW<[FXb, LSU, VecDF, Lat11, BeginGroup], (instregex "CPDT$")>;
1061 def : InstRW<[FXb, LSU, VecDF, VecDF, Lat15, GroupAlone], (instregex "CPXT$")>;
1062
1063 // Perform floating-point operation
1064 def : InstRW<[FXb, Lat30], (instregex "PFPO$")>;
1065
1066 //===----------------------------------------------------------------------===//
1067 // DFP: Unary arithmetic
1068 //===----------------------------------------------------------------------===//
1069
1070 // Load FP integer
1071 def : InstRW<[VecDF], (instregex "FIDTR$")>;
1072 def : InstRW<[VecDF2, VecDF2, Lat11, GroupAlone], (instregex "FIXTR$")>;
1073
1074 // Extract biased exponent
1075 def : InstRW<[FXb, VecDF, Lat12, BeginGroup], (instregex "EEDTR$")>;
1076 def : InstRW<[FXb, VecDF, Lat12, BeginGroup], (instregex "EEXTR$")>;
1077
1078 // Extract significance
1079 def : InstRW<[FXb, VecDF, Lat12, BeginGroup], (instregex "ESDTR$")>;
1080 def : InstRW<[FXb, VecDF, VecDF, Lat15, BeginGroup], (instregex "ESXTR$")>;
1081
1082 //===----------------------------------------------------------------------===//
1083 // DFP: Binary arithmetic
1084 //===----------------------------------------------------------------------===//
1085
1086 // Addition
1087 def : InstRW<[VecDF], (instregex "ADTR(A)?$")>;
1088 def : InstRW<[VecDF2, VecDF2, Lat10, GroupAlone], (instregex "AXTR(A)?$")>;
1089
1090 // Subtraction
1091 def : InstRW<[VecDF], (instregex "SDTR(A)?$")>;
1092 def : InstRW<[VecDF2, VecDF2, Lat11, GroupAlone], (instregex "SXTR(A)?$")>;
1093
1094 // Multiply
1095 def : InstRW<[VecDF, Lat30], (instregex "MDTR(A)?$")>;
1096 def : InstRW<[VecDF2, VecDF2, Lat30, GroupAlone], (instregex "MXTR(A)?$")>;
1097
1098 // Division
1099 def : InstRW<[VecDF, Lat30], (instregex "DDTR(A)?$")>;
1100 def : InstRW<[VecDF2, VecDF2, Lat30, GroupAlone], (instregex "DXTR(A)?$")>;
1101
1102 // Quantize
1103 def : InstRW<[VecDF], (instregex "QADTR$")>;
1104 def : InstRW<[VecDF2, VecDF2, Lat11, GroupAlone], (instregex "QAXTR$")>;
1105
1106 // Reround
1107 def : InstRW<[FXb, VecDF, Lat11, BeginGroup], (instregex "RRDTR$")>;
1108 def : InstRW<[FXb, VecDF2, VecDF2, Lat15, GroupAlone], (instregex "RRXTR$")>;
1109
1110 // Shift significand left/right
1111 def : InstRW<[LSU, VecDF, Lat11, GroupAlone], (instregex "S(L|R)DT$")>;
1112 def : InstRW<[LSU, VecDF2, VecDF2, Lat15, GroupAlone], (instregex "S(L|R)XT$")>;
1113
1114 // Insert biased exponent
1115 def : InstRW<[FXb, VecDF, Lat11, BeginGroup], (instregex "IEDTR$")>;
1116 def : InstRW<[FXb, VecDF2, VecDF2, Lat15, GroupAlone], (instregex "IEXTR$")>;
1117
1118 //===----------------------------------------------------------------------===//
1119 // DFP: Comparisons
1120 //===----------------------------------------------------------------------===//
1121
1122 // Compare
1123 def : InstRW<[VecDF], (instregex "(K|C)DTR$")>;
1124 def : InstRW<[VecDF, VecDF, Lat11, GroupAlone], (instregex "(K|C)XTR$")>;
1125
1126 // Compare biased exponent
1127 def : InstRW<[VecDF], (instregex "CEDTR$")>;
1128 def : InstRW<[VecDF], (instregex "CEXTR$")>;
1129
1130 // Test Data Class/Group
1131 def : InstRW<[LSU, VecDF, Lat11], (instregex "TD(C|G)(E|D)T$")>;
1132 def : InstRW<[LSU, VecDF, VecDF, Lat15, GroupAlone], (instregex "TD(C|G)XT$")>;
1133
1134
1135 // --------------------------------- Vector --------------------------------- //
1136
1137 //===----------------------------------------------------------------------===//
1138 // Vector: Move instructions
1139 //===----------------------------------------------------------------------===//
1140
1141 def : InstRW<[FXb], (instregex "VLR(32|64)?$")>;
1142 def : InstRW<[FXb, Lat4], (instregex "VLGV(B|F|G|H)?$")>;
1143 def : InstRW<[FXb], (instregex "VLVG(B|F|G|H)?$")>;
1144 def : InstRW<[FXb, Lat2], (instregex "VLVGP(32)?$")>;
1145
1146 //===----------------------------------------------------------------------===//
1147 // Vector: Immediate instructions
1148 //===----------------------------------------------------------------------===//
1149
1150 def : InstRW<[VecXsPm], (instregex "VZERO$")>;
1151 def : InstRW<[VecXsPm], (instregex "VONE$")>;
1152 def : InstRW<[VecXsPm], (instregex "VGBM$")>;
1153 def : InstRW<[VecXsPm], (instregex "VGM(B|F|G|H)?$")>;
1154 def : InstRW<[VecXsPm], (instregex "VREPI(B|F|G|H)?$")>;
1155 def : InstRW<[VecXsPm], (instregex "VLEI(B|F|G|H)$")>;
1156
1157 //===----------------------------------------------------------------------===//
1158 // Vector: Loads
1159 //===----------------------------------------------------------------------===//
1160
1161 def : InstRW<[LSU], (instregex "VL(L|BB)?$")>;
1162 def : InstRW<[LSU], (instregex "VL(32|64)$")>;
1163 def : InstRW<[LSU], (instregex "VLLEZ(B|F|G|H)?$")>;
1164 def : InstRW<[LSU], (instregex "VLREP(B|F|G|H)?$")>;
1165 def : InstRW<[VecXsPm, LSU, Lat7], (instregex "VLE(B|F|G|H)$")>;
1166 def : InstRW<[FXb, LSU, VecXsPm, Lat11, BeginGroup], (instregex "VGE(F|G)$")>;
1167 def : InstRW<[LSU, LSU, LSU, LSU, LSU, Lat10, GroupAlone],
1168               (instregex "VLM$")>;
1169
1170 //===----------------------------------------------------------------------===//
1171 // Vector: Stores
1172 //===----------------------------------------------------------------------===//
1173
1174 def : InstRW<[FXb, LSU, Lat8], (instregex "VST(L|32|64)?$")>;
1175 def : InstRW<[FXb, LSU, Lat8], (instregex "VSTE(F|G)$")>;
1176 def : InstRW<[FXb, LSU, VecXsPm, Lat11, BeginGroup], (instregex "VSTE(B|H)$")>;
1177 def : InstRW<[LSU, LSU, FXb, FXb, FXb, FXb, FXb, Lat20, GroupAlone],
1178               (instregex "VSTM$")>;
1179 def : InstRW<[FXb, FXb, LSU, Lat12, BeginGroup], (instregex "VSCE(F|G)$")>;
1180
1181 //===----------------------------------------------------------------------===//
1182 // Vector: Selects and permutes
1183 //===----------------------------------------------------------------------===//
1184
1185 def : InstRW<[VecXsPm], (instregex "VMRH(B|F|G|H)?$")>;
1186 def : InstRW<[VecXsPm], (instregex "VMRL(B|F|G|H)?$")>;
1187 def : InstRW<[VecXsPm], (instregex "VPERM$")>;
1188 def : InstRW<[VecXsPm], (instregex "VPDI$")>;
1189 def : InstRW<[VecXsPm], (instregex "VREP(B|F|G|H)?$")>;
1190 def : InstRW<[VecXsPm], (instregex "VSEL$")>;
1191
1192 //===----------------------------------------------------------------------===//
1193 // Vector: Widening and narrowing
1194 //===----------------------------------------------------------------------===//
1195
1196 def : InstRW<[VecXsPm], (instregex "VPK(F|G|H)?$")>;
1197 def : InstRW<[VecXsPm], (instregex "VPKS(F|G|H)?$")>;
1198 def : InstRW<[VecXsPm, Lat4], (instregex "VPKS(F|G|H)S$")>;
1199 def : InstRW<[VecXsPm], (instregex "VPKLS(F|G|H)?$")>;
1200 def : InstRW<[VecXsPm, Lat4], (instregex "VPKLS(F|G|H)S$")>;
1201 def : InstRW<[VecXsPm], (instregex "VSEG(B|F|H)?$")>;
1202 def : InstRW<[VecXsPm], (instregex "VUPH(B|F|H)?$")>;
1203 def : InstRW<[VecXsPm], (instregex "VUPL(B|F)?$")>;
1204 def : InstRW<[VecXsPm], (instregex "VUPLH(B|F|H|W)?$")>;
1205 def : InstRW<[VecXsPm], (instregex "VUPLL(B|F|H)?$")>;
1206
1207 //===----------------------------------------------------------------------===//
1208 // Vector: Integer arithmetic
1209 //===----------------------------------------------------------------------===//
1210
1211 def : InstRW<[VecXsPm], (instregex "VA(B|F|G|H|Q|C|CQ)?$")>;
1212 def : InstRW<[VecXsPm], (instregex "VACC(B|F|G|H|Q|C|CQ)?$")>;
1213 def : InstRW<[VecXsPm], (instregex "VAVG(B|F|G|H)?$")>;
1214 def : InstRW<[VecXsPm], (instregex "VAVGL(B|F|G|H)?$")>;
1215 def : InstRW<[VecXsPm], (instregex "VN(C|O)?$")>;
1216 def : InstRW<[VecXsPm], (instregex "VO$")>;
1217 def : InstRW<[VecMul], (instregex "VCKSM$")>;
1218 def : InstRW<[VecXsPm], (instregex "VCLZ(B|F|G|H)?$")>;
1219 def : InstRW<[VecXsPm], (instregex "VCTZ(B|F|G|H)?$")>;
1220 def : InstRW<[VecXsPm], (instregex "VX$")>;
1221 def : InstRW<[VecMul], (instregex "VGFM?$")>;
1222 def : InstRW<[VecMul], (instregex "VGFMA(B|F|G|H)?$")>;
1223 def : InstRW<[VecMul], (instregex "VGFM(B|F|G|H)$")>;
1224 def : InstRW<[VecXsPm], (instregex "VLC(B|F|G|H)?$")>;
1225 def : InstRW<[VecXsPm], (instregex "VLP(B|F|G|H)?$")>;
1226 def : InstRW<[VecXsPm], (instregex "VMX(B|F|G|H)?$")>;
1227 def : InstRW<[VecXsPm], (instregex "VMXL(B|F|G|H)?$")>;
1228 def : InstRW<[VecXsPm], (instregex "VMN(B|F|G|H)?$")>;
1229 def : InstRW<[VecXsPm], (instregex "VMNL(B|F|G|H)?$")>;
1230 def : InstRW<[VecMul], (instregex "VMAL(B|F)?$")>;
1231 def : InstRW<[VecMul], (instregex "VMALE(B|F|H)?$")>;
1232 def : InstRW<[VecMul], (instregex "VMALH(B|F|H|W)?$")>;
1233 def : InstRW<[VecMul], (instregex "VMALO(B|F|H)?$")>;
1234 def : InstRW<[VecMul], (instregex "VMAO(B|F|H)?$")>;
1235 def : InstRW<[VecMul], (instregex "VMAE(B|F|H)?$")>;
1236 def : InstRW<[VecMul], (instregex "VMAH(B|F|H)?$")>;
1237 def : InstRW<[VecMul], (instregex "VME(B|F|H)?$")>;
1238 def : InstRW<[VecMul], (instregex "VMH(B|F|H)?$")>;
1239 def : InstRW<[VecMul], (instregex "VML(B|F)?$")>;
1240 def : InstRW<[VecMul], (instregex "VMLE(B|F|H)?$")>;
1241 def : InstRW<[VecMul], (instregex "VMLH(B|F|H|W)?$")>;
1242 def : InstRW<[VecMul], (instregex "VMLO(B|F|H)?$")>;
1243 def : InstRW<[VecMul], (instregex "VMO(B|F|H)?$")>;
1244
1245 def : InstRW<[VecXsPm], (instregex "VPOPCT$")>;
1246
1247 def : InstRW<[VecXsPm], (instregex "VERLL(B|F|G|H)?$")>;
1248 def : InstRW<[VecXsPm], (instregex "VERLLV(B|F|G|H)?$")>;
1249 def : InstRW<[VecXsPm], (instregex "VERIM(B|F|G|H)?$")>;
1250 def : InstRW<[VecXsPm], (instregex "VESL(B|F|G|H)?$")>;
1251 def : InstRW<[VecXsPm], (instregex "VESLV(B|F|G|H)?$")>;
1252 def : InstRW<[VecXsPm], (instregex "VESRA(B|F|G|H)?$")>;
1253 def : InstRW<[VecXsPm], (instregex "VESRAV(B|F|G|H)?$")>;
1254 def : InstRW<[VecXsPm], (instregex "VESRL(B|F|G|H)?$")>;
1255 def : InstRW<[VecXsPm], (instregex "VESRLV(B|F|G|H)?$")>;
1256
1257 def : InstRW<[VecXsPm], (instregex "VSL(DB)?$")>;
1258 def : InstRW<[VecXsPm, VecXsPm, Lat8], (instregex "VSLB$")>;
1259 def : InstRW<[VecXsPm], (instregex "VSR(A|L)$")>;
1260 def : InstRW<[VecXsPm, VecXsPm, Lat8], (instregex "VSR(A|L)B$")>;
1261
1262 def : InstRW<[VecXsPm], (instregex "VSB(I|IQ|CBI|CBIQ)?$")>;
1263 def : InstRW<[VecXsPm], (instregex "VSCBI(B|F|G|H|Q)?$")>;
1264 def : InstRW<[VecXsPm], (instregex "VS(F|G|H|Q)?$")>;
1265
1266 def : InstRW<[VecMul], (instregex "VSUM(B|H)?$")>;
1267 def : InstRW<[VecMul], (instregex "VSUMG(F|H)?$")>;
1268 def : InstRW<[VecMul], (instregex "VSUMQ(F|G)?$")>;
1269
1270 //===----------------------------------------------------------------------===//
1271 // Vector: Integer comparison
1272 //===----------------------------------------------------------------------===//
1273
1274 def : InstRW<[VecXsPm, Lat4], (instregex "VEC(B|F|G|H)?$")>;
1275 def : InstRW<[VecXsPm, Lat4], (instregex "VECL(B|F|G|H)?$")>;
1276 def : InstRW<[VecXsPm], (instregex "VCEQ(B|F|G|H)?$")>;
1277 def : InstRW<[VecXsPm, Lat4], (instregex "VCEQ(B|F|G|H)S$")>;
1278 def : InstRW<[VecXsPm], (instregex "VCH(B|F|G|H)?$")>;
1279 def : InstRW<[VecXsPm, Lat4], (instregex "VCH(B|F|G|H)S$")>;
1280 def : InstRW<[VecXsPm], (instregex "VCHL(B|F|G|H)?$")>;
1281 def : InstRW<[VecXsPm, Lat4], (instregex "VCHL(B|F|G|H)S$")>;
1282 def : InstRW<[VecStr, Lat5], (instregex "VTM$")>;
1283
1284 //===----------------------------------------------------------------------===//
1285 // Vector: Floating-point arithmetic
1286 //===----------------------------------------------------------------------===//
1287
1288 // Conversion and rounding
1289 def : InstRW<[VecBF2], (instregex "VCD(L)?G$")>;
1290 def : InstRW<[VecBF2], (instregex "VCD(L)?GB$")>;
1291 def : InstRW<[VecBF], (instregex "WCD(L)?GB$")>;
1292 def : InstRW<[VecBF2], (instregex "VC(L)?GD$")>;
1293 def : InstRW<[VecBF2], (instregex "VC(L)?GDB$")>;
1294 def : InstRW<[VecBF], (instregex "WC(L)?GDB$")>;
1295 def : InstRW<[VecBF2], (instregex "VL(DE|ED)$")>;
1296 def : InstRW<[VecBF2], (instregex "VL(DE|ED)B$")>;
1297 def : InstRW<[VecBF], (instregex "WL(DE|ED)B$")>;
1298 def : InstRW<[VecBF2], (instregex "VFI$")>;
1299 def : InstRW<[VecBF2], (instregex "VFIDB$")>;
1300 def : InstRW<[VecBF], (instregex "WFIDB$")>;
1301
1302 // Sign operations
1303 def : InstRW<[VecXsPm], (instregex "VFPSO$")>;
1304 def : InstRW<[VecXsPm], (instregex "(V|W)FPSODB$")>;
1305 def : InstRW<[VecXsPm], (instregex "(V|W)FL(C|N|P)DB$")>;
1306
1307 // Test data class
1308 def : InstRW<[VecXsPm, Lat4], (instregex "VFTCI$")>;
1309 def : InstRW<[VecXsPm, Lat4], (instregex "(V|W)FTCIDB$")>;
1310
1311 // Add / subtract
1312 def : InstRW<[VecBF2], (instregex "VF(A|S)$")>;
1313 def : InstRW<[VecBF2], (instregex "VF(A|S)DB$")>;
1314 def : InstRW<[VecBF], (instregex "WF(A|S)DB$")>;
1315
1316 // Multiply / multiply-and-add/subtract
1317 def : InstRW<[VecBF2], (instregex "VFM$")>;
1318 def : InstRW<[VecBF2], (instregex "VFMDB$")>;
1319 def : InstRW<[VecBF], (instregex "WFMDB$")>;
1320 def : InstRW<[VecBF2], (instregex "VFM(A|S)$")>;
1321 def : InstRW<[VecBF2], (instregex "VFM(A|S)DB$")>;
1322 def : InstRW<[VecBF], (instregex "WFM(A|S)DB$")>;
1323
1324 // Divide / square root
1325 def : InstRW<[VecFPd], (instregex "VFD$")>;
1326 def : InstRW<[VecFPd], (instregex "(V|W)FDDB$")>;
1327 def : InstRW<[VecFPd], (instregex "VFSQ$")>;
1328 def : InstRW<[VecFPd], (instregex "(V|W)FSQDB$")>;
1329
1330 //===----------------------------------------------------------------------===//
1331 // Vector: Floating-point comparison
1332 //===----------------------------------------------------------------------===//
1333
1334 def : InstRW<[VecXsPm], (instregex "VFC(E|H|HE)$")>;
1335 def : InstRW<[VecXsPm], (instregex "VFC(E|H|HE)DB$")>;
1336 def : InstRW<[VecXsPm], (instregex "WFC(E|H|HE)DB$")>;
1337 def : InstRW<[VecXsPm, Lat4], (instregex "VFC(E|H|HE)DBS$")>;
1338 def : InstRW<[VecXsPm, Lat4], (instregex "WFC(E|H|HE)DBS$")>;
1339 def : InstRW<[VecXsPm, Lat4], (instregex "WF(C|K)$")>;
1340 def : InstRW<[VecXsPm, Lat4], (instregex "WF(C|K)DB$")>;
1341
1342 //===----------------------------------------------------------------------===//
1343 // Vector: Floating-point insertion and extraction
1344 //===----------------------------------------------------------------------===//
1345
1346 def : InstRW<[FXb], (instregex "LEFR$")>;
1347 def : InstRW<[FXb, Lat4], (instregex "LFER$")>;
1348
1349 //===----------------------------------------------------------------------===//
1350 // Vector: String instructions
1351 //===----------------------------------------------------------------------===//
1352
1353 def : InstRW<[VecStr], (instregex "VFAE(B)?$")>;
1354 def : InstRW<[VecStr, Lat5], (instregex "VFAEBS$")>;
1355 def : InstRW<[VecStr], (instregex "VFAE(F|H)$")>;
1356 def : InstRW<[VecStr, Lat5], (instregex "VFAE(F|H)S$")>;
1357 def : InstRW<[VecStr], (instregex "VFAEZ(B|F|H)$")>;
1358 def : InstRW<[VecStr, Lat5], (instregex "VFAEZ(B|F|H)S$")>;
1359 def : InstRW<[VecStr], (instregex "VFEE(B|F|H|ZB|ZF|ZH)?$")>;
1360 def : InstRW<[VecStr, Lat5], (instregex "VFEE(B|F|H|ZB|ZF|ZH)S$")>;
1361 def : InstRW<[VecStr], (instregex "VFENE(B|F|H|ZB|ZF|ZH)?$")>;
1362 def : InstRW<[VecStr, Lat5], (instregex "VFENE(B|F|H|ZB|ZF|ZH)S$")>;
1363 def : InstRW<[VecStr], (instregex "VISTR(B|F|H)?$")>;
1364 def : InstRW<[VecStr, Lat5], (instregex "VISTR(B|F|H)S$")>;
1365 def : InstRW<[VecStr], (instregex "VSTRC(B|F|H)?$")>;
1366 def : InstRW<[VecStr, Lat5], (instregex "VSTRC(B|F|H)S$")>;
1367 def : InstRW<[VecStr], (instregex "VSTRCZ(B|F|H)$")>;
1368 def : InstRW<[VecStr, Lat5], (instregex "VSTRCZ(B|F|H)S$")>;
1369
1370
1371 // -------------------------------- System ---------------------------------- //
1372
1373 //===----------------------------------------------------------------------===//
1374 // System: Program-Status Word Instructions
1375 //===----------------------------------------------------------------------===//
1376
1377 def : InstRW<[FXb, Lat30], (instregex "EPSW$")>;
1378 def : InstRW<[FXb, LSU, Lat30], (instregex "LPSW(E)?$")>;
1379 def : InstRW<[FXa, Lat3, GroupAlone], (instregex "IPK$")>;
1380 def : InstRW<[LSU, EndGroup], (instregex "SPKA$")>;
1381 def : InstRW<[LSU, EndGroup], (instregex "SSM$")>;
1382 def : InstRW<[FXb, LSU, GroupAlone], (instregex "ST(N|O)SM$")>;
1383 def : InstRW<[FXa, Lat3], (instregex "IAC$")>;
1384 def : InstRW<[LSU, EndGroup], (instregex "SAC(F)?$")>;
1385
1386 //===----------------------------------------------------------------------===//
1387 // System: Control Register Instructions
1388 //===----------------------------------------------------------------------===//
1389
1390 def : InstRW<[FXb, LSU, Lat30], (instregex "LCTL(G)?$")>;
1391 def : InstRW<[LSU, Lat30], (instregex "STCT(L|G)$")>;
1392 def : InstRW<[LSU], (instregex "E(P|S)A(I)?R$")>;
1393 def : InstRW<[FXb, Lat30], (instregex "SSA(I)?R$")>;
1394 def : InstRW<[FXb, Lat30], (instregex "ESEA$")>;
1395
1396 //===----------------------------------------------------------------------===//
1397 // System: Prefix-Register Instructions
1398 //===----------------------------------------------------------------------===//
1399
1400 def : InstRW<[FXb, LSU, Lat30], (instregex "SPX$")>;
1401 def : InstRW<[FXb, LSU, Lat30], (instregex "STPX$")>;
1402
1403 //===----------------------------------------------------------------------===//
1404 // System: Storage-Key and Real Memory Instructions
1405 //===----------------------------------------------------------------------===//
1406
1407 def : InstRW<[FXb, Lat30], (instregex "ISKE$")>;
1408 def : InstRW<[FXb, Lat30], (instregex "IVSK$")>;
1409 def : InstRW<[FXb, Lat30], (instregex "SSKE(Opt)?$")>;
1410 def : InstRW<[FXb, Lat30], (instregex "RRB(E|M)$")>;
1411 def : InstRW<[FXb, Lat30], (instregex "PFMF$")>;
1412 def : InstRW<[FXb, Lat30], (instregex "TB$")>;
1413 def : InstRW<[FXb, LSU, Lat30], (instregex "PGIN$")>;
1414 def : InstRW<[FXb, LSU, Lat30], (instregex "PGOUT$")>;
1415
1416 //===----------------------------------------------------------------------===//
1417 // System: Dynamic-Address-Translation Instructions
1418 //===----------------------------------------------------------------------===//
1419
1420 def : InstRW<[FXb, LSU, Lat30], (instregex "IPTE(Opt)?(Opt)?$")>;
1421 def : InstRW<[FXb, Lat30], (instregex "IDTE(Opt)?$")>;
1422 def : InstRW<[FXb, Lat30], (instregex "CRDTE(Opt)?$")>;
1423 def : InstRW<[FXb, Lat30], (instregex "PTLB$")>;
1424 def : InstRW<[FXb, LSU, Lat30], (instregex "CSP(G)?$")>;
1425 def : InstRW<[FXb, LSU, Lat30], (instregex "LPTEA$")>;
1426 def : InstRW<[FXb, LSU, Lat30], (instregex "LRA(Y|G)?$")>;
1427 def : InstRW<[FXb, LSU, Lat30], (instregex "STRAG$")>;
1428 def : InstRW<[FXb, LSU, Lat30], (instregex "LURA(G)?$")>;
1429 def : InstRW<[FXb, LSU, Lat30], (instregex "STUR(A|G)$")>;
1430 def : InstRW<[FXb, LSU, Lat30], (instregex "TPROT$")>;
1431
1432 //===----------------------------------------------------------------------===//
1433 // System: Memory-move Instructions
1434 //===----------------------------------------------------------------------===//
1435
1436 def : InstRW<[FXa, FXa, FXb, LSU, Lat8, GroupAlone], (instregex "MVC(K|P|S)$")>;
1437 def : InstRW<[FXa, LSU, Lat6, GroupAlone], (instregex "MVC(S|D)K$")>;
1438 def : InstRW<[FXb, LSU, Lat30], (instregex "MVCOS$")>;
1439 def : InstRW<[LSU, Lat30, GroupAlone], (instregex "MVPG$")>;
1440
1441 //===----------------------------------------------------------------------===//
1442 // System: Address-Space Instructions
1443 //===----------------------------------------------------------------------===//
1444
1445 def : InstRW<[FXb, LSU, Lat30], (instregex "LASP$")>;
1446 def : InstRW<[LSU, GroupAlone], (instregex "PALB$")>;
1447 def : InstRW<[FXb, LSU, Lat30], (instregex "PC$")>;
1448 def : InstRW<[FXb, Lat30], (instregex "PR$")>;
1449 def : InstRW<[FXb, Lat30], (instregex "PT(I)?$")>;
1450 def : InstRW<[FXb, LSU, Lat30], (instregex "RP$")>;
1451 def : InstRW<[FXb, Lat30], (instregex "BS(G|A)$")>;
1452 def : InstRW<[FXb, Lat20], (instregex "TAR$")>;
1453
1454 //===----------------------------------------------------------------------===//
1455 // System: Linkage-Stack Instructions
1456 //===----------------------------------------------------------------------===//
1457
1458 def : InstRW<[FXb, Lat30, EndGroup], (instregex "BAKR$")>;
1459 def : InstRW<[FXb, Lat30], (instregex "EREG(G)?$")>;
1460 def : InstRW<[FXb, Lat30], (instregex "(E|M)STA$")>;
1461
1462 //===----------------------------------------------------------------------===//
1463 // System: Time-Related Instructions
1464 //===----------------------------------------------------------------------===//
1465
1466 def : InstRW<[FXb, Lat30], (instregex "PTFF$")>;
1467 def : InstRW<[FXb, LSU, Lat20], (instregex "SCK$")>;
1468 def : InstRW<[FXb, Lat30], (instregex "SCKPF$")>;
1469 def : InstRW<[FXb, LSU, Lat20], (instregex "SCKC$")>;
1470 def : InstRW<[LSU, LSU, GroupAlone], (instregex "SPT$")>;
1471 def : InstRW<[LSU, LSU, LSU, FXa, FXa, FXb, Lat9, GroupAlone],
1472              (instregex "STCK(F)?$")>;
1473 def : InstRW<[LSU, LSU, LSU, LSU, FXa, FXa, FXb, FXb, Lat11, GroupAlone],
1474              (instregex "STCKE$")>;
1475 def : InstRW<[FXb, LSU, Lat9], (instregex "STCKC$")>;
1476 def : InstRW<[LSU, LSU, FXb, Lat5, BeginGroup], (instregex "STPT$")>;
1477
1478 //===----------------------------------------------------------------------===//
1479 // System: CPU-Related Instructions
1480 //===----------------------------------------------------------------------===//
1481
1482 def : InstRW<[FXb, LSU, Lat30], (instregex "STAP$")>;
1483 def : InstRW<[FXb, LSU, Lat30], (instregex "STIDP$")>;
1484 def : InstRW<[FXb, LSU, Lat30], (instregex "STSI$")>;
1485 def : InstRW<[FXb, LSU, Lat30], (instregex "STFL(E)?$")>;
1486 def : InstRW<[FXb, LSU, Lat30], (instregex "ECAG$")>;
1487 def : InstRW<[FXa, LSU, Lat30], (instregex "ECTG$")>;
1488 def : InstRW<[FXb, Lat30], (instregex "PTF$")>;
1489 def : InstRW<[FXb, Lat30], (instregex "PCKMO$")>;
1490
1491 //===----------------------------------------------------------------------===//
1492 // System: Miscellaneous Instructions
1493 //===----------------------------------------------------------------------===//
1494
1495 def : InstRW<[FXb, Lat30], (instregex "SVC$")>;
1496 def : InstRW<[FXb, GroupAlone], (instregex "MC$")>;
1497 def : InstRW<[FXb, Lat30], (instregex "DIAG$")>;
1498 def : InstRW<[FXb], (instregex "TRAC(E|G)$")>;
1499 def : InstRW<[FXb, Lat30], (instregex "TRAP(2|4)$")>;
1500 def : InstRW<[FXb, Lat30], (instregex "SIGP$")>;
1501 def : InstRW<[FXb, LSU, Lat30], (instregex "SIGA$")>;
1502 def : InstRW<[FXb, LSU, Lat30], (instregex "SIE$")>;
1503
1504 //===----------------------------------------------------------------------===//
1505 // System: CPU-Measurement Facility Instructions
1506 //===----------------------------------------------------------------------===//
1507
1508 def : InstRW<[FXb], (instregex "LPP$")>;
1509 def : InstRW<[FXb, Lat30], (instregex "ECPGA$")>;
1510 def : InstRW<[FXb, Lat30], (instregex "E(C|P)CTR$")>;
1511 def : InstRW<[FXb, Lat30], (instregex "LCCTL$")>;
1512 def : InstRW<[FXb, LSU, Lat30], (instregex "L(P|S)CTL$")>;
1513 def : InstRW<[FXb, LSU, Lat30], (instregex "Q(S|CTR)I$")>;
1514 def : InstRW<[FXb, Lat30], (instregex "S(C|P)CTR$")>;
1515
1516 //===----------------------------------------------------------------------===//
1517 // System: I/O Instructions
1518 //===----------------------------------------------------------------------===//
1519
1520 def : InstRW<[FXb, Lat30], (instregex "(C|H|R|X)SCH$")>;
1521 def : InstRW<[FXb, LSU, Lat30], (instregex "(M|S|ST|T)SCH$")>;
1522 def : InstRW<[FXb, Lat30], (instregex "RCHP$")>;
1523 def : InstRW<[FXb, Lat30], (instregex "SCHM$")>;
1524 def : InstRW<[FXb, LSU, Lat30], (instregex "STC(PS|RW)$")>;
1525 def : InstRW<[FXb, LSU, Lat30], (instregex "TPI$")>;
1526 def : InstRW<[FXb, Lat30], (instregex "SAL$")>;
1527
1528 }
1529