]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - contrib/llvm/lib/Target/SystemZ/SystemZScheduleZ196.td
Merge llvm, clang, lld, lldb, compiler-rt and libc++ r304222, and update
[FreeBSD/FreeBSD.git] / contrib / llvm / lib / Target / SystemZ / SystemZScheduleZ196.td
1 //=- SystemZScheduleZ196.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 Z196 to support instruction
11 // scheduling and other instruction cost heuristics.
12 //
13 //===----------------------------------------------------------------------===//
14
15 def Z196Model : SchedMachineModel {
16
17     let UnsupportedFeatures = Arch9UnsupportedFeatures.List;
18     
19     let IssueWidth = 5;
20     let MicroOpBufferSize = 40;     // 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 = 16;
27 }
28
29 let SchedModel = Z196Model 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<EndGroup, []> {
40   let NumMicroOps = 0;
41   let EndGroup    = 1;
42 }
43 def : WriteRes<Lat2, []> { let Latency = 2; let NumMicroOps = 0;}
44 def : WriteRes<Lat3, []> { let Latency = 3; let NumMicroOps = 0;}
45 def : WriteRes<Lat4, []> { let Latency = 4; let NumMicroOps = 0;}
46 def : WriteRes<Lat5, []> { let Latency = 5; let NumMicroOps = 0;}
47 def : WriteRes<Lat6, []> { let Latency = 6; let NumMicroOps = 0;}
48 def : WriteRes<Lat7, []> { let Latency = 7; let NumMicroOps = 0;}
49 def : WriteRes<Lat8, []> { let Latency = 8; let NumMicroOps = 0;}
50 def : WriteRes<Lat9, []> { let Latency = 9; let NumMicroOps = 0;}
51 def : WriteRes<Lat10, []> { let Latency = 10; let NumMicroOps = 0;}
52 def : WriteRes<Lat11, []> { let Latency = 11; let NumMicroOps = 0;}
53 def : WriteRes<Lat12, []> { let Latency = 12; let NumMicroOps = 0;}
54 def : WriteRes<Lat15, []> { let Latency = 15; let NumMicroOps = 0;}
55 def : WriteRes<Lat20, []> { let Latency = 20; let NumMicroOps = 0;}
56 def : WriteRes<Lat30, []> { let Latency = 30; let NumMicroOps = 0;}
57
58 // Execution units.
59 def Z196_FXUnit : ProcResource<2>;
60 def Z196_LSUnit : ProcResource<2>;
61 def Z196_FPUnit : ProcResource<1>;
62 def Z196_DFUnit : ProcResource<1>;
63
64 // Subtarget specific definitions of scheduling resources.
65 def : WriteRes<FXU,       [Z196_FXUnit]> { let Latency = 1; }
66 def : WriteRes<LSU,       [Z196_LSUnit]> { let Latency = 4; }
67 def : WriteRes<LSU_lat1,  [Z196_LSUnit]> { let Latency = 1; }
68 def : WriteRes<FPU,       [Z196_FPUnit]> { let Latency = 8; }
69 def : WriteRes<FPU2,      [Z196_FPUnit, Z196_FPUnit]> { let Latency = 9; }
70 def : WriteRes<DFU,       [Z196_DFUnit]> { let Latency = 2; }
71 def : WriteRes<DFU2,      [Z196_DFUnit, Z196_DFUnit]> { let Latency = 3; }
72
73 // -------------------------- INSTRUCTIONS ---------------------------------- //
74
75 // InstRW constructs have been used in order to preserve the
76 // readability of the InstrInfo files.
77
78 // For each instruction, as matched by a regexp, provide a list of
79 // resources that it needs. These will be combined into a SchedClass.
80
81 //===----------------------------------------------------------------------===//
82 // Stack allocation
83 //===----------------------------------------------------------------------===//
84
85 def : InstRW<[FXU], (instregex "ADJDYNALLOC$")>; // Pseudo -> LA / LAY
86
87 //===----------------------------------------------------------------------===//
88 // Branch instructions
89 //===----------------------------------------------------------------------===//
90
91 // Branch
92 def : InstRW<[LSU, EndGroup], (instregex "(Call)?BRC(L)?(Asm.*)?$")>;
93 def : InstRW<[LSU, EndGroup], (instregex "(Call)?J(G)?(Asm.*)?$")>;
94 def : InstRW<[LSU, EndGroup], (instregex "(Call)?BC(R)?(Asm.*)?$")>;
95 def : InstRW<[LSU, EndGroup], (instregex "(Call)?B(R)?(Asm.*)?$")>;
96 def : InstRW<[FXU, LSU, Lat5, GroupAlone], (instregex "BRCT(G|H)?$")>;
97 def : InstRW<[FXU, LSU, Lat5, GroupAlone], (instregex "BCT(G)?(R)?$")>;
98 def : InstRW<[FXU, FXU, FXU, LSU, Lat7, GroupAlone],
99              (instregex "B(R)?X(H|L).*$")>;
100
101 // Compare and branch
102 def : InstRW<[FXU, LSU, Lat5, GroupAlone],
103              (instregex "C(L)?(G)?(I|R)J(Asm.*)?$")>;
104 def : InstRW<[FXU, LSU, Lat5, GroupAlone],
105              (instregex "C(L)?(G)?(I|R)B(Call|Return|Asm.*)?$")>;
106
107 //===----------------------------------------------------------------------===//
108 // Trap instructions
109 //===----------------------------------------------------------------------===//
110
111 // Trap
112 def : InstRW<[LSU, EndGroup], (instregex "(Cond)?Trap$")>;
113
114 // Compare and trap
115 def : InstRW<[FXU], (instregex "C(G)?(I|R)T(Asm.*)?$")>;
116 def : InstRW<[FXU], (instregex "CL(G)?RT(Asm.*)?$")>;
117 def : InstRW<[FXU], (instregex "CL(F|G)IT(Asm.*)?$")>;
118
119 //===----------------------------------------------------------------------===//
120 // Call and return instructions
121 //===----------------------------------------------------------------------===//
122
123 // Call
124 def : InstRW<[LSU, FXU, FXU, Lat6, GroupAlone], (instregex "(Call)?BRAS$")>;
125 def : InstRW<[LSU, FXU, FXU, Lat6, GroupAlone], (instregex "(Call)?BRASL$")>;
126 def : InstRW<[FXU, FXU, LSU, Lat6, GroupAlone], (instregex "(Call)?BAS(R)?$")>;
127 def : InstRW<[LSU, FXU, FXU, Lat6, GroupAlone], (instregex "TLS_(G|L)DCALL$")>;
128
129 // Return
130 def : InstRW<[LSU_lat1, EndGroup], (instregex "Return$")>;
131 def : InstRW<[LSU_lat1, EndGroup], (instregex "CondReturn$")>;
132
133 //===----------------------------------------------------------------------===//
134 // Select instructions
135 //===----------------------------------------------------------------------===//
136
137 // Select pseudo 
138 def : InstRW<[FXU], (instregex "Select(32|64|32Mux)$")>;
139
140 // CondStore pseudos
141 def : InstRW<[FXU], (instregex "CondStore16(Inv)?$")>;
142 def : InstRW<[FXU], (instregex "CondStore16Mux(Inv)?$")>;
143 def : InstRW<[FXU], (instregex "CondStore32(Inv)?$")>;
144 def : InstRW<[FXU], (instregex "CondStore64(Inv)?$")>;
145 def : InstRW<[FXU], (instregex "CondStore8(Inv)?$")>;
146 def : InstRW<[FXU], (instregex "CondStore8Mux(Inv)?$")>;
147
148 //===----------------------------------------------------------------------===//
149 // Move instructions
150 //===----------------------------------------------------------------------===//
151
152 // Moves
153 def : InstRW<[FXU, LSU, Lat5], (instregex "MV(G|H)?HI$")>;
154 def : InstRW<[FXU, LSU, Lat5], (instregex "MVI(Y)?$")>;
155
156 // Move character
157 def : InstRW<[LSU, LSU, LSU, FXU, Lat8, GroupAlone], (instregex "MVC$")>;
158 def : InstRW<[LSU, Lat30, GroupAlone], (instregex "MVCL(E|U)?$")>;
159
160 // Pseudo -> reg move
161 def : InstRW<[FXU], (instregex "COPY(_TO_REGCLASS)?$")>;
162 def : InstRW<[FXU], (instregex "EXTRACT_SUBREG$")>;
163 def : InstRW<[FXU], (instregex "INSERT_SUBREG$")>;
164 def : InstRW<[FXU], (instregex "REG_SEQUENCE$")>;
165 def : InstRW<[FXU], (instregex "SUBREG_TO_REG$")>;
166
167 // Loads
168 def : InstRW<[LSU], (instregex "L(Y|FH|RL|Mux)?$")>;
169 def : InstRW<[LSU], (instregex "LG(RL)?$")>;
170 def : InstRW<[LSU], (instregex "L128$")>;
171
172 def : InstRW<[FXU], (instregex "LLIH(F|H|L)$")>;
173 def : InstRW<[FXU], (instregex "LLIL(F|H|L)$")>;
174
175 def : InstRW<[FXU], (instregex "LG(F|H)I$")>;
176 def : InstRW<[FXU], (instregex "LHI(Mux)?$")>;
177 def : InstRW<[FXU], (instregex "LR(Mux)?$")>;
178
179 // Load and test
180 def : InstRW<[FXU, LSU, Lat5], (instregex "LT(G)?$")>;
181 def : InstRW<[FXU], (instregex "LT(G)?R$")>;
182
183 // Stores
184 def : InstRW<[FXU, LSU, Lat5], (instregex "STG(RL)?$")>;
185 def : InstRW<[FXU, LSU, Lat5], (instregex "ST128$")>;
186 def : InstRW<[FXU, LSU, Lat5], (instregex "ST(Y|FH|RL|Mux)?$")>;
187
188 // String moves.
189 def : InstRW<[LSU, Lat30, GroupAlone], (instregex "MVST$")>;
190
191 //===----------------------------------------------------------------------===//
192 // Conditional move instructions
193 //===----------------------------------------------------------------------===//
194
195 def : InstRW<[FXU, Lat2, EndGroup], (instregex "LOC(G)?R(Asm.*)?$")>;
196 def : InstRW<[FXU, LSU, Lat6, EndGroup], (instregex "LOC(G)?(Asm.*)?$")>;
197 def : InstRW<[FXU, LSU, Lat5, EndGroup], (instregex "STOC(G)?(Asm.*)?$")>;
198
199 //===----------------------------------------------------------------------===//
200 // Sign extensions
201 //===----------------------------------------------------------------------===//
202 def : InstRW<[FXU], (instregex "L(B|H|G)R$")>;
203 def : InstRW<[FXU], (instregex "LG(B|H|F)R$")>;
204
205 def : InstRW<[FXU, LSU, Lat5], (instregex "LTGF$")>;
206 def : InstRW<[FXU], (instregex "LTGFR$")>;
207
208 def : InstRW<[FXU, LSU, Lat5], (instregex "LB(H|Mux)?$")>;
209 def : InstRW<[FXU, LSU, Lat5], (instregex "LH(Y)?$")>;
210 def : InstRW<[FXU, LSU, Lat5], (instregex "LH(H|Mux|RL)$")>;
211 def : InstRW<[FXU, LSU, Lat5], (instregex "LG(B|H|F)$")>;
212 def : InstRW<[FXU, LSU, Lat5], (instregex "LG(H|F)RL$")>;
213
214 //===----------------------------------------------------------------------===//
215 // Zero extensions
216 //===----------------------------------------------------------------------===//
217
218 def : InstRW<[FXU], (instregex "LLCR(Mux)?$")>;
219 def : InstRW<[FXU], (instregex "LLHR(Mux)?$")>;
220 def : InstRW<[FXU], (instregex "LLG(C|F|H|T)R$")>;
221 def : InstRW<[LSU], (instregex "LLC(Mux)?$")>;
222 def : InstRW<[LSU], (instregex "LLH(Mux)?$")>;
223 def : InstRW<[FXU, LSU, Lat5], (instregex "LL(C|H)H$")>;
224 def : InstRW<[LSU], (instregex "LLHRL$")>;
225 def : InstRW<[LSU], (instregex "LLG(C|F|H|T|FRL|HRL)$")>;
226
227 //===----------------------------------------------------------------------===//
228 // Truncations
229 //===----------------------------------------------------------------------===//
230
231 def : InstRW<[FXU, LSU, Lat5], (instregex "STC(H|Y|Mux)?$")>;
232 def : InstRW<[FXU, LSU, Lat5], (instregex "STH(H|Y|RL|Mux)?$")>;
233 def : InstRW<[FXU, LSU, Lat5], (instregex "STCM(H|Y)?$")>;
234
235 //===----------------------------------------------------------------------===//
236 // Multi-register moves
237 //===----------------------------------------------------------------------===//
238
239 // Load multiple (estimated average of 5 ops)
240 def : InstRW<[LSU, LSU, LSU, LSU, LSU, Lat10, GroupAlone],
241              (instregex "LM(H|Y|G)?$")>;
242
243 // Load multiple disjoint
244 def : InstRW<[LSU, Lat30, GroupAlone], (instregex "LMD$")>;
245
246 // Store multiple (estimated average of 3 ops)
247 def : InstRW<[LSU, LSU, FXU, FXU, FXU, Lat10, GroupAlone],
248              (instregex "STM(H|Y|G)?$")>;
249
250 //===----------------------------------------------------------------------===//
251 // Byte swaps
252 //===----------------------------------------------------------------------===//
253
254 def : InstRW<[FXU], (instregex "LRV(G)?R$")>;
255 def : InstRW<[FXU, LSU, Lat5], (instregex "LRV(G|H)?$")>;
256 def : InstRW<[FXU, LSU, Lat5], (instregex "STRV(G|H)?$")>;
257 def : InstRW<[LSU, Lat30, GroupAlone], (instregex "MVCIN$")>;
258
259 //===----------------------------------------------------------------------===//
260 // Load address instructions
261 //===----------------------------------------------------------------------===//
262
263 def : InstRW<[FXU], (instregex "LA(Y|RL)?$")>;
264
265 // Load the Global Offset Table address
266 def : InstRW<[FXU], (instregex "GOT$")>;
267
268 //===----------------------------------------------------------------------===//
269 // Absolute and Negation
270 //===----------------------------------------------------------------------===//
271
272 def : InstRW<[FXU, Lat2], (instregex "LP(G)?R$")>;
273 def : InstRW<[FXU, FXU, Lat3, GroupAlone], (instregex "L(N|P)GFR$")>;
274 def : InstRW<[FXU, Lat2], (instregex "LN(R|GR)$")>;
275 def : InstRW<[FXU], (instregex "LC(R|GR)$")>;
276 def : InstRW<[FXU, FXU, Lat2, GroupAlone], (instregex "LCGFR$")>;
277
278 //===----------------------------------------------------------------------===//
279 // Insertion
280 //===----------------------------------------------------------------------===//
281
282 def : InstRW<[FXU, LSU, Lat5], (instregex "IC(Y)?$")>;
283 def : InstRW<[FXU, LSU, Lat5], (instregex "IC32(Y)?$")>;
284 def : InstRW<[FXU, LSU, Lat5], (instregex "ICM(H|Y)?$")>;
285 def : InstRW<[FXU], (instregex "II(F|H|L)Mux$")>;
286 def : InstRW<[FXU], (instregex "IIHF(64)?$")>;
287 def : InstRW<[FXU], (instregex "IIHH(64)?$")>;
288 def : InstRW<[FXU], (instregex "IIHL(64)?$")>;
289 def : InstRW<[FXU], (instregex "IILF(64)?$")>;
290 def : InstRW<[FXU], (instregex "IILH(64)?$")>;
291 def : InstRW<[FXU], (instregex "IILL(64)?$")>;
292
293 //===----------------------------------------------------------------------===//
294 // Addition
295 //===----------------------------------------------------------------------===//
296
297 def : InstRW<[FXU, LSU, Lat5], (instregex "A(L)?(Y|SI)?$")>;
298 def : InstRW<[FXU, FXU, LSU, Lat6, GroupAlone], (instregex "AH(Y)?$")>;
299 def : InstRW<[FXU], (instregex "AIH$")>;
300 def : InstRW<[FXU], (instregex "AFI(Mux)?$")>;
301 def : InstRW<[FXU], (instregex "AGFI$")>;
302 def : InstRW<[FXU], (instregex "AGHI(K)?$")>;
303 def : InstRW<[FXU], (instregex "AGR(K)?$")>;
304 def : InstRW<[FXU], (instregex "AHI(K)?$")>;
305 def : InstRW<[FXU], (instregex "AHIMux(K)?$")>;
306 def : InstRW<[FXU], (instregex "AL(FI|HSIK)$")>;
307 def : InstRW<[FXU, LSU, Lat5], (instregex "ALGF$")>;
308 def : InstRW<[FXU], (instregex "ALGHSIK$")>;
309 def : InstRW<[FXU], (instregex "ALGF(I|R)$")>;
310 def : InstRW<[FXU], (instregex "ALGR(K)?$")>;
311 def : InstRW<[FXU], (instregex "ALR(K)?$")>;
312 def : InstRW<[FXU], (instregex "AR(K)?$")>;
313 def : InstRW<[FXU, LSU, Lat5], (instregex "A(L)?G(SI)?$")>;
314
315 // Logical addition with carry
316 def : InstRW<[FXU, LSU, Lat7, GroupAlone], (instregex "ALC(G)?$")>;
317 def : InstRW<[FXU, Lat3, GroupAlone], (instregex "ALC(G)?R$")>;
318
319 // Add with sign extension (32 -> 64)
320 def : InstRW<[FXU, FXU, LSU, Lat6, GroupAlone], (instregex "AGF$")>;
321 def : InstRW<[FXU, FXU, Lat2, GroupAlone], (instregex "AGFR$")>;
322
323 //===----------------------------------------------------------------------===//
324 // Subtraction
325 //===----------------------------------------------------------------------===//
326
327 def : InstRW<[FXU, LSU, Lat5], (instregex "S(G|Y)?$")>;
328 def : InstRW<[FXU, FXU, LSU, Lat6, GroupAlone], (instregex "SH(Y)?$")>;
329 def : InstRW<[FXU], (instregex "SGR(K)?$")>;
330 def : InstRW<[FXU], (instregex "SLFI$")>;
331 def : InstRW<[FXU, LSU, Lat5], (instregex "SL(G|GF|Y)?$")>;
332 def : InstRW<[FXU], (instregex "SLGF(I|R)$")>;
333 def : InstRW<[FXU], (instregex "SLGR(K)?$")>;
334 def : InstRW<[FXU], (instregex "SLR(K)?$")>;
335 def : InstRW<[FXU], (instregex "SR(K)?$")>;
336
337 // Subtraction with borrow
338 def : InstRW<[FXU, LSU, Lat7, GroupAlone], (instregex "SLB(G)?$")>;
339 def : InstRW<[FXU, Lat3, GroupAlone], (instregex "SLB(G)?R$")>;
340
341 // Subtraction with sign extension (32 -> 64)
342 def : InstRW<[FXU, FXU, LSU, Lat6, GroupAlone], (instregex "SGF$")>;
343 def : InstRW<[FXU, FXU, Lat2, GroupAlone], (instregex "SGFR$")>;
344
345 //===----------------------------------------------------------------------===//
346 // AND
347 //===----------------------------------------------------------------------===//
348
349 def : InstRW<[FXU, LSU, Lat5], (instregex "N(G|Y)?$")>;
350 def : InstRW<[FXU], (instregex "NGR(K)?$")>;
351 def : InstRW<[FXU], (instregex "NI(FMux|HMux|LMux)$")>;
352 def : InstRW<[FXU, LSU, Lat5], (instregex "NI(Y)?$")>;
353 def : InstRW<[FXU], (instregex "NIHF(64)?$")>;
354 def : InstRW<[FXU], (instregex "NIHH(64)?$")>;
355 def : InstRW<[FXU], (instregex "NIHL(64)?$")>;
356 def : InstRW<[FXU], (instregex "NILF(64)?$")>;
357 def : InstRW<[FXU], (instregex "NILH(64)?$")>;
358 def : InstRW<[FXU], (instregex "NILL(64)?$")>;
359 def : InstRW<[FXU], (instregex "NR(K)?$")>;
360 def : InstRW<[LSU, LSU, FXU, Lat9, GroupAlone], (instregex "NC$")>;
361
362 //===----------------------------------------------------------------------===//
363 // OR
364 //===----------------------------------------------------------------------===//
365
366 def : InstRW<[FXU, LSU, Lat5], (instregex "O(G|Y)?$")>;
367 def : InstRW<[FXU], (instregex "OGR(K)?$")>;
368 def : InstRW<[FXU, LSU, Lat5], (instregex "OI(Y)?$")>;
369 def : InstRW<[FXU], (instregex "OI(FMux|HMux|LMux)$")>;
370 def : InstRW<[FXU], (instregex "OIHF(64)?$")>;
371 def : InstRW<[FXU], (instregex "OIHH(64)?$")>;
372 def : InstRW<[FXU], (instregex "OIHL(64)?$")>;
373 def : InstRW<[FXU], (instregex "OILF(64)?$")>;
374 def : InstRW<[FXU], (instregex "OILH(64)?$")>;
375 def : InstRW<[FXU], (instregex "OILL(64)?$")>;
376 def : InstRW<[FXU], (instregex "OR(K)?$")>;
377 def : InstRW<[LSU, LSU, FXU, Lat9, GroupAlone], (instregex "OC$")>;
378
379 //===----------------------------------------------------------------------===//
380 // XOR
381 //===----------------------------------------------------------------------===//
382
383 def : InstRW<[FXU, LSU, Lat5], (instregex "X(G|Y)?$")>;
384 def : InstRW<[FXU, LSU, Lat5], (instregex "XI(Y)?$")>;
385 def : InstRW<[FXU], (instregex "XIFMux$")>;
386 def : InstRW<[FXU], (instregex "XGR(K)?$")>;
387 def : InstRW<[FXU], (instregex "XIHF(64)?$")>;
388 def : InstRW<[FXU], (instregex "XILF(64)?$")>;
389 def : InstRW<[FXU], (instregex "XR(K)?$")>;
390 def : InstRW<[LSU, LSU, FXU, Lat9, GroupAlone], (instregex "XC$")>;
391
392 //===----------------------------------------------------------------------===//
393 // Multiplication
394 //===----------------------------------------------------------------------===//
395
396 def : InstRW<[FXU, LSU, Lat10], (instregex "MS(GF|Y)?$")>;
397 def : InstRW<[FXU, Lat6], (instregex "MS(R|FI)$")>;
398 def : InstRW<[FXU, LSU, Lat12], (instregex "MSG$")>;
399 def : InstRW<[FXU, Lat8], (instregex "MSGR$")>;
400 def : InstRW<[FXU, Lat6], (instregex "MSGF(I|R)$")>;
401 def : InstRW<[FXU, LSU, Lat15, GroupAlone], (instregex "MLG$")>;
402 def : InstRW<[FXU, Lat9, GroupAlone], (instregex "MLGR$")>;
403 def : InstRW<[FXU, Lat5], (instregex "MGHI$")>;
404 def : InstRW<[FXU, Lat5], (instregex "MHI$")>;
405 def : InstRW<[FXU, LSU, Lat9], (instregex "MH(Y)?$")>;
406 def : InstRW<[FXU, Lat7, GroupAlone], (instregex "M(L)?R$")>;
407 def : InstRW<[FXU, LSU, Lat7, GroupAlone], (instregex "M(FY|L)?$")>;
408
409 //===----------------------------------------------------------------------===//
410 // Division and remainder
411 //===----------------------------------------------------------------------===//
412
413 def : InstRW<[FPU2, FPU2, FXU, FXU, FXU, FXU, FXU, Lat30, GroupAlone],
414               (instregex "DR$")>;
415 def : InstRW<[FPU2, FPU2, LSU, FXU, FXU, FXU, FXU, Lat30, GroupAlone],
416               (instregex "D$")>;
417 def : InstRW<[FPU2, FPU2, FXU, FXU, FXU, FXU, Lat30, GroupAlone],
418               (instregex "DSG(F)?R$")>;
419 def : InstRW<[FPU2, FPU2, LSU, FXU, FXU, FXU, Lat30, GroupAlone],
420               (instregex "DSG(F)?$")>;
421 def : InstRW<[FPU2, FPU2, FXU, FXU, FXU, FXU, FXU, Lat30, GroupAlone],
422               (instregex "DL(G)?R$")>;
423 def : InstRW<[FPU2, FPU2, LSU, FXU, FXU, FXU, FXU, Lat30, GroupAlone],
424               (instregex "DL(G)?$")>;
425
426 //===----------------------------------------------------------------------===//
427 // Shifts
428 //===----------------------------------------------------------------------===//
429
430 def : InstRW<[FXU], (instregex "SLL(G|K)?$")>;
431 def : InstRW<[FXU], (instregex "SRL(G|K)?$")>;
432 def : InstRW<[FXU], (instregex "SRA(G|K)?$")>;
433 def : InstRW<[FXU, Lat2], (instregex "SLA(G|K)?$")>;
434 def : InstRW<[FXU, FXU, FXU, FXU, Lat8], (instregex "S(L|R)D(A|L)$")>;
435
436 // Rotate
437 def : InstRW<[FXU, LSU, Lat6], (instregex "RLL(G)?$")>;
438
439 // Rotate and insert
440 def : InstRW<[FXU], (instregex "RISBG(32)?$")>;
441 def : InstRW<[FXU], (instregex "RISBH(G|H|L)$")>;
442 def : InstRW<[FXU], (instregex "RISBL(G|H|L)$")>;
443 def : InstRW<[FXU], (instregex "RISBMux$")>;
444
445 // Rotate and Select
446 def : InstRW<[FXU, FXU, Lat3, GroupAlone], (instregex "R(N|O|X)SBG$")>;
447
448 //===----------------------------------------------------------------------===//
449 // Comparison
450 //===----------------------------------------------------------------------===//
451
452 def : InstRW<[FXU, LSU, Lat5], (instregex "C(G|Y|Mux|RL)?$")>;
453 def : InstRW<[FXU], (instregex "C(F|H)I(Mux)?$")>;
454 def : InstRW<[FXU], (instregex "CG(F|H)I$")>;
455 def : InstRW<[FXU, LSU, Lat5], (instregex "CG(HSI|RL)$")>;
456 def : InstRW<[FXU], (instregex "C(G)?R$")>;
457 def : InstRW<[FXU], (instregex "CIH$")>;
458 def : InstRW<[FXU, LSU, Lat5], (instregex "CH(F|SI)$")>;
459 def : InstRW<[FXU, LSU, Lat5], (instregex "CL(Y|Mux|FHSI)?$")>;
460 def : InstRW<[FXU], (instregex "CLFI(Mux)?$")>;
461 def : InstRW<[FXU, LSU, Lat5], (instregex "CLG(HRL|HSI)?$")>;
462 def : InstRW<[FXU, LSU, Lat5], (instregex "CLGF(RL)?$")>;
463 def : InstRW<[FXU], (instregex "CLGF(I|R)$")>;
464 def : InstRW<[FXU], (instregex "CLGR$")>;
465 def : InstRW<[FXU, LSU, Lat5], (instregex "CLGRL$")>;
466 def : InstRW<[FXU, LSU, Lat5], (instregex "CLH(F|RL|HSI)$")>;
467 def : InstRW<[FXU], (instregex "CLIH$")>;
468 def : InstRW<[FXU, LSU, Lat5], (instregex "CLI(Y)?$")>;
469 def : InstRW<[FXU], (instregex "CLR$")>;
470 def : InstRW<[FXU, LSU, Lat5], (instregex "CLRL$")>;
471
472 // Compare halfword
473 def : InstRW<[FXU, LSU, FXU, Lat6, GroupAlone], (instregex "CH(Y|RL)?$")>;
474 def : InstRW<[FXU, LSU, FXU, Lat6, GroupAlone], (instregex "CGH(RL)?$")>;
475 def : InstRW<[FXU, LSU, FXU, Lat6, GroupAlone], (instregex "CHHSI$")>;
476
477 // Compare with sign extension (32 -> 64)
478 def : InstRW<[FXU, FXU, LSU, Lat6, Lat2, GroupAlone], (instregex "CGF(RL)?$")>;
479 def : InstRW<[FXU, FXU, Lat2, GroupAlone], (instregex "CGFR$")>;
480
481 // Compare logical character
482 def : InstRW<[LSU, LSU, FXU, Lat9, GroupAlone], (instregex "CLC$")>;
483 def : InstRW<[LSU, Lat30, GroupAlone], (instregex "CLCL(E|U)?$")>;
484 def : InstRW<[LSU, Lat30, GroupAlone], (instregex "CLST$")>;
485
486 // Test under mask
487 def : InstRW<[FXU, LSU, Lat5], (instregex "TM(Y)?$")>;
488 def : InstRW<[FXU], (instregex "TM(H|L)Mux$")>;
489 def : InstRW<[FXU], (instregex "TMHH(64)?$")>;
490 def : InstRW<[FXU], (instregex "TMHL(64)?$")>;
491 def : InstRW<[FXU], (instregex "TMLH(64)?$")>;
492 def : InstRW<[FXU], (instregex "TMLL(64)?$")>;
493
494 // Compare logical characters under mask
495 def : InstRW<[FXU, LSU, Lat5], (instregex "CLM(H|Y)?$")>;
496
497 //===----------------------------------------------------------------------===//
498 // Prefetch
499 //===----------------------------------------------------------------------===//
500
501 def : InstRW<[LSU, GroupAlone], (instregex "PFD(RL)?$")>;
502
503 //===----------------------------------------------------------------------===//
504 // Atomic operations
505 //===----------------------------------------------------------------------===//
506
507 def : InstRW<[LSU, EndGroup], (instregex "Serialize$")>;
508
509 def : InstRW<[FXU, LSU, Lat5], (instregex "LAA(G)?$")>;
510 def : InstRW<[FXU, LSU, Lat5], (instregex "LAAL(G)?$")>;
511 def : InstRW<[FXU, LSU, Lat5], (instregex "LAN(G)?$")>;
512 def : InstRW<[FXU, LSU, Lat5], (instregex "LAO(G)?$")>;
513 def : InstRW<[FXU, LSU, Lat5], (instregex "LAX(G)?$")>;
514
515 // Test and set
516 def : InstRW<[FXU, LSU, Lat5, EndGroup], (instregex "TS$")>;
517
518 // Compare and swap
519 def : InstRW<[FXU, LSU, FXU, Lat6, GroupAlone], (instregex "CS(G|Y)?$")>;
520
521 // Compare double and swap
522 def : InstRW<[FXU, FXU, FXU, FXU, FXU, LSU, Lat10, GroupAlone],
523              (instregex "CDS(Y)?$")>;
524 def : InstRW<[FXU, FXU, FXU, FXU, FXU, FXU, LSU, LSU, Lat12, GroupAlone],
525              (instregex "CDSG$")>;
526
527 // Compare and swap and store
528 def : InstRW<[FXU, Lat30, GroupAlone], (instregex "CSST$")>;
529
530 // Perform locked operation
531 def : InstRW<[LSU, Lat30, GroupAlone], (instregex "PLO$")>;
532
533 // Load/store pair from/to quadword
534 def : InstRW<[LSU, LSU, Lat5, GroupAlone], (instregex "LPQ$")>;
535 def : InstRW<[FXU, FXU, LSU, LSU, Lat6, GroupAlone], (instregex "STPQ$")>;
536
537 // Load pair disjoint
538 def : InstRW<[LSU, LSU, Lat5, GroupAlone], (instregex "LPD(G)?$")>;
539
540 //===----------------------------------------------------------------------===//
541 // Translate and convert
542 //===----------------------------------------------------------------------===//
543
544 def : InstRW<[FXU, Lat30, GroupAlone], (instregex "TR(T|TR)?(E|EOpt)?$")>;
545 def : InstRW<[FXU, Lat30, GroupAlone], (instregex "TR(T|O)(T|O)(Opt)?$")>;
546 def : InstRW<[FXU, Lat30, GroupAlone], (instregex "CU(12|14|21|24|41|42)(Opt)?$")>;
547 def : InstRW<[FXU, Lat30, GroupAlone], (instregex "(CUUTF|CUTFU)(Opt)?$")>;
548
549 //===----------------------------------------------------------------------===//
550 // Message-security assist
551 //===----------------------------------------------------------------------===//
552
553 def : InstRW<[FXU, Lat30, GroupAlone], (instregex "KM(C|F|O|CTR)?$")>;
554 def : InstRW<[FXU, Lat30, GroupAlone], (instregex "(KIMD|KLMD|KMAC|PCC)$")>;
555
556 //===----------------------------------------------------------------------===//
557 // Decimal arithmetic
558 //===----------------------------------------------------------------------===//
559
560 def : InstRW<[FXU, DFU, LSU, Lat30, GroupAlone], (instregex "CVB(Y|G)?$")>;
561 def : InstRW<[FXU, DFU, FXU, Lat30, GroupAlone], (instregex "CVD(Y|G)?$")>;
562 def : InstRW<[LSU, Lat30, GroupAlone], (instregex "MV(N|Z|O)$")>;
563 def : InstRW<[LSU, Lat30, GroupAlone], (instregex "(PACK|PKA|PKU)$")>;
564 def : InstRW<[LSU, Lat30, GroupAlone], (instregex "UNPK(A|U)?$")>;
565
566 def : InstRW<[FXU, FXU, DFU2, LSU, LSU, LSU, LSU, Lat15, GroupAlone],
567              (instregex "(A|S|ZA)P$")>;
568 def : InstRW<[FXU, FXU, DFU2, LSU, LSU, LSU, LSU, Lat30, GroupAlone],
569              (instregex "(M|D)P$")>;
570 def : InstRW<[FXU, FXU, DFU2, LSU, LSU, Lat15, GroupAlone],
571              (instregex "SRP$")>;
572 def : InstRW<[DFU2, LSU, LSU, LSU, LSU, Lat11, GroupAlone], (instregex "CP$")>;
573 def : InstRW<[DFU2, LSU, LSU, Lat3, GroupAlone], (instregex "TP$")>;
574 def : InstRW<[LSU, Lat30, GroupAlone], (instregex "ED(MK)?$")>;
575
576 //===----------------------------------------------------------------------===//
577 // Access registers
578 //===----------------------------------------------------------------------===//
579
580 // Extract/set/copy access register
581 def : InstRW<[LSU], (instregex "(EAR|SAR|CPYA)$")>;
582
583 // Load address extended
584 def : InstRW<[LSU, FXU, Lat5, GroupAlone], (instregex "LAE(Y)?$")>;
585
586 // Load/store access multiple (not modeled precisely)
587 def : InstRW<[LSU, Lat30, GroupAlone], (instregex "(L|ST)AM(Y)?$")>;
588
589 //===----------------------------------------------------------------------===//
590 // Program mask and addressing mode
591 //===----------------------------------------------------------------------===//
592
593 // Insert Program Mask
594 def : InstRW<[FXU, Lat3, EndGroup], (instregex "IPM$")>;
595
596 // Set Program Mask
597 def : InstRW<[LSU, EndGroup], (instregex "SPM$")>;
598
599 // Branch and link
600 def : InstRW<[FXU, FXU, LSU, Lat8, GroupAlone], (instregex "BAL(R)?$")>;
601
602 // Test addressing mode
603 def : InstRW<[FXU], (instregex "TAM$")>;
604
605 // Set addressing mode
606 def : InstRW<[LSU, EndGroup], (instregex "SAM(24|31|64)$")>;
607
608 // Branch (and save) and set mode.
609 def : InstRW<[FXU, LSU, Lat5, GroupAlone], (instregex "BSM$")>;
610 def : InstRW<[FXU, FXU, LSU, Lat6, GroupAlone], (instregex "BASSM$")>;
611
612 //===----------------------------------------------------------------------===//
613 // Miscellaneous Instructions.
614 //===----------------------------------------------------------------------===//
615
616 // Find leftmost one
617 def : InstRW<[FXU, Lat7, GroupAlone], (instregex "FLOGR$")>;
618
619 // Population count
620 def : InstRW<[FXU, Lat3], (instregex "POPCNT$")>;
621
622 // Extend
623 def : InstRW<[FXU], (instregex "AEXT128_64$")>;
624 def : InstRW<[FXU], (instregex "ZEXT128_(32|64)$")>;
625
626 // String instructions
627 def : InstRW<[FXU, LSU, Lat30], (instregex "SRST$")>;
628 def : InstRW<[LSU, Lat30], (instregex "SRSTU$")>;
629 def : InstRW<[LSU, Lat30, GroupAlone], (instregex "CUSE$")>;
630
631 // Various complex instructions
632 def : InstRW<[LSU, Lat30, GroupAlone], (instregex "CFC$")>;
633 def : InstRW<[LSU, Lat30, GroupAlone], (instregex "UPT$")>;
634 def : InstRW<[LSU, Lat30, GroupAlone], (instregex "CKSM$")>;
635 def : InstRW<[LSU, Lat30, GroupAlone], (instregex "CMPSC$")>;
636
637 // Move with key
638 def : InstRW<[LSU, Lat8, GroupAlone], (instregex "MVCK$")>;
639
640 // Monitor call
641 def : InstRW<[FXU], (instregex "MC$")>;
642
643 // Extract CPU attribute
644 def : InstRW<[FXU, Lat30], (instregex "ECAG$")>;
645
646 // Extract CPU Time
647 def : InstRW<[FXU, Lat5, LSU], (instregex "ECTG$")>;
648
649 // Extract PSW
650 def : InstRW<[FXU, Lat30], (instregex "EPSW$")>;
651
652 // Execute
653 def : InstRW<[LSU, GroupAlone], (instregex "EX(RL)?$")>;
654
655 // Program return
656 def : InstRW<[FXU, Lat30], (instregex "PR$")>;
657
658 // Inline assembly
659 def : InstRW<[FXU, LSU, Lat15], (instregex "STCK$")>;
660 def : InstRW<[FXU, LSU, Lat12], (instregex "STCKF$")>;
661 def : InstRW<[LSU, FXU, Lat5], (instregex "STCKE$")>;
662 def : InstRW<[FXU, LSU, Lat5], (instregex "STFLE$")>;
663 def : InstRW<[FXU, Lat30], (instregex "SVC$")>;
664
665 // Store real address
666 def : InstRW<[FXU, LSU, Lat5], (instregex "STRAG$")>;
667
668 //===----------------------------------------------------------------------===//
669 // .insn directive instructions
670 //===----------------------------------------------------------------------===//
671
672 // An "empty" sched-class will be assigned instead of the "invalid sched-class".
673 // getNumDecoderSlots() will then return 1 instead of 0.
674 def : InstRW<[], (instregex "Insn.*")>;
675
676
677 // ----------------------------- Floating point ----------------------------- //
678
679 //===----------------------------------------------------------------------===//
680 // FP: Select instructions
681 //===----------------------------------------------------------------------===//
682
683 def : InstRW<[FXU], (instregex "SelectF(32|64|128)$")>;
684 def : InstRW<[FXU], (instregex "CondStoreF32(Inv)?$")>;
685 def : InstRW<[FXU], (instregex "CondStoreF64(Inv)?$")>;
686
687 //===----------------------------------------------------------------------===//
688 // FP: Move instructions
689 //===----------------------------------------------------------------------===//
690
691 // Load zero
692 def : InstRW<[FXU], (instregex "LZ(DR|ER)$")>;
693 def : InstRW<[FXU, FXU, Lat2, GroupAlone], (instregex "LZXR$")>;
694
695 // Load
696 def : InstRW<[FXU], (instregex "LER$")>;
697 def : InstRW<[FXU], (instregex "LD(R|R32|GR)$")>;
698 def : InstRW<[FXU, Lat3], (instregex "LGDR$")>;
699 def : InstRW<[FXU, FXU, Lat2, GroupAlone], (instregex "LXR$")>;
700
701 // Load and Test
702 def : InstRW<[FPU], (instregex "LT(D|E)BR$")>;
703 def : InstRW<[FPU], (instregex "LTEBRCompare(_VecPseudo)?$")>;
704 def : InstRW<[FPU], (instregex "LTDBRCompare(_VecPseudo)?$")>;
705 def : InstRW<[FPU2, FPU2, Lat9, GroupAlone], (instregex "LTXBR$")>;
706 def : InstRW<[FPU2, FPU2, Lat9, GroupAlone],
707              (instregex "LTXBRCompare(_VecPseudo)?$")>;
708
709 // Copy sign
710 def : InstRW<[FXU, FXU, Lat5, GroupAlone], (instregex "CPSDRd(d|s)$")>;
711 def : InstRW<[FXU, FXU, Lat5, GroupAlone], (instregex "CPSDRs(d|s)$")>;
712
713 //===----------------------------------------------------------------------===//
714 // FP: Load instructions
715 //===----------------------------------------------------------------------===//
716
717 def : InstRW<[LSU], (instregex "LE(Y)?$")>;
718 def : InstRW<[LSU], (instregex "LD(Y|E32)?$")>;
719 def : InstRW<[LSU], (instregex "LX$")>;
720
721 //===----------------------------------------------------------------------===//
722 // FP: Store instructions
723 //===----------------------------------------------------------------------===//
724
725 def : InstRW<[FXU, LSU, Lat7], (instregex "STD(Y)?$")>;
726 def : InstRW<[FXU, LSU, Lat7], (instregex "STE(Y)?$")>;
727 def : InstRW<[FXU, LSU, Lat5], (instregex "STX$")>;
728
729 //===----------------------------------------------------------------------===//
730 // FP: Conversion instructions
731 //===----------------------------------------------------------------------===//
732
733 // Load rounded
734 def : InstRW<[FPU], (instregex "LEDBR(A)?$")>;
735 def : InstRW<[FPU, FPU, Lat20], (instregex "LEXBR(A)?$")>;
736 def : InstRW<[FPU, FPU, Lat20], (instregex "LDXBR(A)?$")>;
737
738 // Load lengthened
739 def : InstRW<[FPU, LSU, Lat12], (instregex "LDEB$")>;
740 def : InstRW<[FPU], (instregex "LDEBR$")>;
741 def : InstRW<[FPU2, FPU2, LSU, Lat15, GroupAlone], (instregex "LX(D|E)B$")>;
742 def : InstRW<[FPU2, FPU2, Lat10, GroupAlone], (instregex "LX(D|E)BR$")>;
743
744 // Convert from fixed / logical
745 def : InstRW<[FXU, FPU, Lat9, GroupAlone], (instregex "CE(F|G)BR(A)?$")>;
746 def : InstRW<[FXU, FPU, Lat9, GroupAlone], (instregex "CD(F|G)BR(A)?$")>;
747 def : InstRW<[FXU, FPU2, FPU2, Lat11, GroupAlone], (instregex "CX(F|G)BR(A)?$")>;
748 def : InstRW<[FXU, FPU, Lat9, GroupAlone], (instregex "CEL(F|G)BR$")>;
749 def : InstRW<[FXU, FPU, Lat9, GroupAlone], (instregex "CDL(F|G)BR$")>;
750 def : InstRW<[FXU, FPU2, FPU2, Lat11, GroupAlone], (instregex "CXL(F|G)BR$")>;
751
752 // Convert to fixed / logical
753 def : InstRW<[FXU, FPU, Lat12, GroupAlone], (instregex "CF(E|D)BR(A)?$")>;
754 def : InstRW<[FXU, FPU, Lat12, GroupAlone], (instregex "CG(E|D)BR(A)?$")>;
755 def : InstRW<[FXU, FPU, FPU, Lat20, GroupAlone], (instregex "C(F|G)XBR(A)?$")>;
756 def : InstRW<[FXU, FPU, Lat11, GroupAlone], (instregex "CLF(E|D)BR$")>;
757 def : InstRW<[FXU, FPU, Lat11, GroupAlone], (instregex "CLG(E|D)BR$")>;
758 def : InstRW<[FXU, FPU, FPU, Lat20, GroupAlone], (instregex "CL(F|G)XBR$")>;
759
760 //===----------------------------------------------------------------------===//
761 // FP: Unary arithmetic
762 //===----------------------------------------------------------------------===//
763
764 // Load Complement / Negative / Positive
765 def : InstRW<[FPU], (instregex "L(C|N|P)DBR$")>;
766 def : InstRW<[FPU], (instregex "L(C|N|P)EBR$")>;
767 def : InstRW<[FXU], (instregex "LCDFR(_32)?$")>;
768 def : InstRW<[FXU], (instregex "LNDFR(_32)?$")>;
769 def : InstRW<[FXU], (instregex "LPDFR(_32)?$")>;
770 def : InstRW<[FPU2, FPU2, Lat9, GroupAlone], (instregex "L(C|N|P)XBR$")>;
771
772 // Square root
773 def : InstRW<[FPU, LSU, Lat30], (instregex "SQ(E|D)B$")>;
774 def : InstRW<[FPU, Lat30], (instregex "SQ(E|D)BR$")>;
775 def : InstRW<[FPU2, FPU2, Lat30, GroupAlone], (instregex "SQXBR$")>;
776
777 // Load FP integer
778 def : InstRW<[FPU], (instregex "FIEBR(A)?$")>;
779 def : InstRW<[FPU], (instregex "FIDBR(A)?$")>;
780 def : InstRW<[FPU2, FPU2, Lat15, GroupAlone], (instregex "FIXBR(A)?$")>;
781
782 //===----------------------------------------------------------------------===//
783 // FP: Binary arithmetic
784 //===----------------------------------------------------------------------===//
785
786 // Addition
787 def : InstRW<[FPU, LSU, Lat12], (instregex "A(E|D)B$")>;
788 def : InstRW<[FPU], (instregex "A(E|D)BR$")>;
789 def : InstRW<[FPU2, FPU2, Lat20, GroupAlone], (instregex "AXBR$")>;
790
791 // Subtraction
792 def : InstRW<[FPU, LSU, Lat12], (instregex "S(E|D)B$")>;
793 def : InstRW<[FPU], (instregex "S(E|D)BR$")>;
794 def : InstRW<[FPU2, FPU2, Lat20, GroupAlone], (instregex "SXBR$")>;
795
796 // Multiply
797 def : InstRW<[FPU, LSU, Lat12], (instregex "M(D|DE|EE)B$")>;
798 def : InstRW<[FPU], (instregex "M(D|DE|EE)BR$")>;
799 def : InstRW<[FPU2, FPU2, LSU, Lat15, GroupAlone], (instregex "MXDB$")>;
800 def : InstRW<[FPU2, FPU2, Lat10, GroupAlone], (instregex "MXDBR$")>;
801 def : InstRW<[FPU2, FPU2, Lat30, GroupAlone], (instregex "MXBR$")>;
802
803 // Multiply and add / subtract
804 def : InstRW<[FPU, LSU, Lat12, GroupAlone], (instregex "M(A|S)EB$")>;
805 def : InstRW<[FPU, GroupAlone], (instregex "M(A|S)EBR$")>;
806 def : InstRW<[FPU, LSU, Lat12, GroupAlone], (instregex "M(A|S)DB$")>;
807 def : InstRW<[FPU, GroupAlone], (instregex "M(A|S)DBR$")>;
808
809 // Division
810 def : InstRW<[FPU, LSU, Lat30], (instregex "D(E|D)B$")>;
811 def : InstRW<[FPU, Lat30], (instregex "D(E|D)BR$")>;
812 def : InstRW<[FPU2, FPU2, Lat30, GroupAlone], (instregex "DXBR$")>;
813
814 // Divide to integer
815 def : InstRW<[FPU, Lat30, GroupAlone], (instregex "DI(E|D)BR$")>;
816
817 //===----------------------------------------------------------------------===//
818 // FP: Comparisons
819 //===----------------------------------------------------------------------===//
820
821 // Compare
822 def : InstRW<[FPU, LSU, Lat12], (instregex "(K|C)(E|D)B$")>;
823 def : InstRW<[FPU], (instregex "(K|C)(E|D)BR$")>;
824 def : InstRW<[FPU, FPU, Lat30], (instregex "(K|C)XBR$")>;
825
826 // Test Data Class
827 def : InstRW<[FPU, LSU, Lat15], (instregex "TC(E|D)B$")>;
828 def : InstRW<[FPU2, FPU2, LSU, Lat15, GroupAlone], (instregex "TCXB$")>;
829
830 //===----------------------------------------------------------------------===//
831 // FP: Floating-point control register instructions
832 //===----------------------------------------------------------------------===//
833
834 def : InstRW<[FXU, LSU, Lat4, GroupAlone], (instregex "EFPC$")>;
835 def : InstRW<[LSU, Lat3, GroupAlone], (instregex "SFPC$")>;
836 def : InstRW<[LSU, LSU, Lat6, GroupAlone], (instregex "LFPC$")>;
837 def : InstRW<[LSU, Lat3, GroupAlone], (instregex "STFPC$")>;
838 def : InstRW<[FXU, Lat30, GroupAlone], (instregex "SFASR$")>;
839 def : InstRW<[FXU, LSU, Lat30, GroupAlone], (instregex "LFAS$")>;
840 def : InstRW<[FXU, Lat2, GroupAlone], (instregex "SRNM(B|T)?$")>;
841
842
843 // --------------------- Hexadecimal floating point ------------------------- //
844
845 //===----------------------------------------------------------------------===//
846 // HFP: Move instructions
847 //===----------------------------------------------------------------------===//
848
849 // Load and Test
850 def : InstRW<[FPU], (instregex "LT(D|E)R$")>;
851 def : InstRW<[FPU2, FPU2, Lat9, GroupAlone], (instregex "LTXR$")>;
852
853 //===----------------------------------------------------------------------===//
854 // HFP: Conversion instructions
855 //===----------------------------------------------------------------------===//
856
857 // Load rounded
858 def : InstRW<[FPU], (instregex "(LEDR|LRER)$")>;
859 def : InstRW<[FPU], (instregex "LEXR$")>;
860 def : InstRW<[FPU], (instregex "(LDXR|LRDR)$")>;
861
862 // Load lengthened
863 def : InstRW<[LSU], (instregex "LDE$")>;
864 def : InstRW<[FXU], (instregex "LDER$")>;
865 def : InstRW<[FPU2, FPU2, LSU, Lat15, GroupAlone], (instregex "LX(D|E)$")>;
866 def : InstRW<[FPU2, FPU2, Lat10, GroupAlone], (instregex "LX(D|E)R$")>;
867
868 // Convert from fixed
869 def : InstRW<[FXU, FPU, Lat9, GroupAlone], (instregex "CE(F|G)R$")>;
870 def : InstRW<[FXU, FPU, Lat9, GroupAlone], (instregex "CD(F|G)R$")>;
871 def : InstRW<[FXU, FPU2, FPU2, Lat11, GroupAlone], (instregex "CX(F|G)R$")>;
872
873 // Convert to fixed
874 def : InstRW<[FXU, FPU, Lat12, GroupAlone], (instregex "CF(E|D)R$")>;
875 def : InstRW<[FXU, FPU, Lat12, GroupAlone], (instregex "CG(E|D)R$")>;
876 def : InstRW<[FXU, FPU, FPU, Lat20, GroupAlone], (instregex "C(F|G)XR$")>;
877
878 // Convert BFP to HFP / HFP to BFP.
879 def : InstRW<[FPU], (instregex "THD(E)?R$")>;
880 def : InstRW<[FPU], (instregex "TB(E)?DR$")>;
881
882 //===----------------------------------------------------------------------===//
883 // HFP: Unary arithmetic
884 //===----------------------------------------------------------------------===//
885
886 // Load Complement / Negative / Positive
887 def : InstRW<[FPU], (instregex "L(C|N|P)DR$")>;
888 def : InstRW<[FPU], (instregex "L(C|N|P)ER$")>;
889 def : InstRW<[FPU2, FPU2, Lat9, GroupAlone], (instregex "L(C|N|P)XR$")>;
890
891 // Halve
892 def : InstRW<[FPU], (instregex "H(E|D)R$")>;
893
894 // Square root
895 def : InstRW<[FPU, LSU, Lat30], (instregex "SQ(E|D)$")>;
896 def : InstRW<[FPU, Lat30], (instregex "SQ(E|D)R$")>;
897 def : InstRW<[FPU2, FPU2, Lat30, GroupAlone], (instregex "SQXR$")>;
898
899 // Load FP integer
900 def : InstRW<[FPU], (instregex "FIER$")>;
901 def : InstRW<[FPU], (instregex "FIDR$")>;
902 def : InstRW<[FPU2, FPU2, Lat15, GroupAlone], (instregex "FIXR$")>;
903
904 //===----------------------------------------------------------------------===//
905 // HFP: Binary arithmetic
906 //===----------------------------------------------------------------------===//
907
908 // Addition
909 def : InstRW<[FPU, LSU, Lat12], (instregex "A(E|D|U|W)$")>;
910 def : InstRW<[FPU], (instregex "A(E|D|U|W)R$")>;
911 def : InstRW<[FPU2, FPU2, Lat20, GroupAlone], (instregex "AXR$")>;
912
913 // Subtraction
914 def : InstRW<[FPU, LSU, Lat12], (instregex "S(E|D|U|W)$")>;
915 def : InstRW<[FPU], (instregex "S(E|D|U|W)R$")>;
916 def : InstRW<[FPU2, FPU2, Lat20, GroupAlone], (instregex "SXR$")>;
917
918 // Multiply
919 def : InstRW<[FPU, LSU, Lat12], (instregex "M(D|DE|E|EE)$")>;
920 def : InstRW<[FPU], (instregex "M(D|DE|E|EE)R$")>;
921 def : InstRW<[FPU2, FPU2, LSU, Lat15, GroupAlone], (instregex "MXD$")>;
922 def : InstRW<[FPU2, FPU2, Lat10, GroupAlone], (instregex "MXDR$")>;
923 def : InstRW<[FPU2, FPU2, Lat30, GroupAlone], (instregex "MXR$")>;
924 def : InstRW<[FPU2, FPU2, LSU, Lat15, GroupAlone], (instregex "MY(H|L)?$")>;
925 def : InstRW<[FPU2, FPU2, Lat10, GroupAlone], (instregex "MY(H|L)?R$")>;
926
927 // Multiply and add / subtract
928 def : InstRW<[FPU, LSU, Lat12, GroupAlone], (instregex "M(A|S)E$")>;
929 def : InstRW<[FPU, GroupAlone], (instregex "M(A|S)ER$")>;
930 def : InstRW<[FPU, LSU, Lat12, GroupAlone], (instregex "M(A|S)D$")>;
931 def : InstRW<[FPU, GroupAlone], (instregex "M(A|S)DR$")>;
932 def : InstRW<[FPU2, FPU2, LSU, Lat12, GroupAlone], (instregex "MAY(H|L)?$")>;
933 def : InstRW<[FPU2, FPU2, GroupAlone], (instregex "MAY(H|L)?R$")>;
934
935 // Division
936 def : InstRW<[FPU, LSU, Lat30], (instregex "D(E|D)$")>;
937 def : InstRW<[FPU, Lat30], (instregex "D(E|D)R$")>;
938 def : InstRW<[FPU2, FPU2, Lat30, GroupAlone], (instregex "DXR$")>;
939
940 //===----------------------------------------------------------------------===//
941 // HFP: Comparisons
942 //===----------------------------------------------------------------------===//
943
944 // Compare
945 def : InstRW<[FPU, LSU, Lat12], (instregex "C(E|D)$")>;
946 def : InstRW<[FPU], (instregex "C(E|D)R$")>;
947 def : InstRW<[FPU, FPU, Lat15], (instregex "CXR$")>;
948
949
950 // ------------------------ Decimal floating point -------------------------- //
951
952 //===----------------------------------------------------------------------===//
953 // DFP: Move instructions
954 //===----------------------------------------------------------------------===//
955
956 // Load and Test
957 def : InstRW<[DFU, Lat20], (instregex "LTDTR$")>;
958 def : InstRW<[DFU2, DFU2, Lat20, GroupAlone], (instregex "LTXTR$")>;
959
960 //===----------------------------------------------------------------------===//
961 // DFP: Conversion instructions
962 //===----------------------------------------------------------------------===//
963
964 // Load rounded
965 def : InstRW<[DFU, Lat30], (instregex "LEDTR$")>;
966 def : InstRW<[DFU, DFU, Lat30], (instregex "LDXTR$")>;
967
968 // Load lengthened
969 def : InstRW<[DFU, Lat20], (instregex "LDETR$")>;
970 def : InstRW<[DFU2, DFU2, Lat20, GroupAlone], (instregex "LXDTR$")>;
971
972 // Convert from fixed / logical
973 def : InstRW<[FXU, DFU, Lat30, GroupAlone], (instregex "CD(F|G)TR(A)?$")>;
974 def : InstRW<[FXU, DFU2, DFU2, Lat30, GroupAlone], (instregex "CX(F|G)TR(A)?$")>;
975 def : InstRW<[FXU, DFU, Lat11, GroupAlone], (instregex "CDL(F|G)TR$")>;
976 def : InstRW<[FXU, DFU2, DFU2, Lat11, GroupAlone], (instregex "CXL(F|G)TR$")>;
977
978 // Convert to fixed / logical
979 def : InstRW<[FXU, DFU, Lat30, GroupAlone], (instregex "C(F|G)DTR(A)?$")>;
980 def : InstRW<[FXU, DFU, DFU, Lat30, GroupAlone], (instregex "C(F|G)XTR(A)?$")>;
981 def : InstRW<[FXU, DFU, Lat30, GroupAlone], (instregex "CL(F|G)DTR$")>;
982 def : InstRW<[FXU, DFU, DFU, Lat30, GroupAlone], (instregex "CL(F|G)XTR$")>;
983
984 // Convert from / to signed / unsigned packed
985 def : InstRW<[FXU, DFU, Lat12, GroupAlone], (instregex "CD(S|U)TR$")>;
986 def : InstRW<[FXU, FXU, DFU2, DFU2, Lat20, GroupAlone], (instregex "CX(S|U)TR$")>;
987 def : InstRW<[FXU, DFU, Lat12, GroupAlone], (instregex "C(S|U)DTR$")>;
988 def : InstRW<[FXU, FXU, DFU2, DFU2, Lat20, GroupAlone], (instregex "C(S|U)XTR$")>;
989
990 // Perform floating-point operation
991 def : InstRW<[LSU, Lat30, GroupAlone], (instregex "PFPO$")>;
992
993 //===----------------------------------------------------------------------===//
994 // DFP: Unary arithmetic
995 //===----------------------------------------------------------------------===//
996
997 // Load FP integer
998 def : InstRW<[DFU, Lat20], (instregex "FIDTR$")>;
999 def : InstRW<[DFU2, DFU2, Lat20, GroupAlone], (instregex "FIXTR$")>;
1000
1001 // Extract biased exponent
1002 def : InstRW<[FXU, DFU, Lat15, GroupAlone], (instregex "EEDTR$")>;
1003 def : InstRW<[FXU, DFU, Lat15, GroupAlone], (instregex "EEXTR$")>;
1004
1005 // Extract significance
1006 def : InstRW<[FXU, DFU, Lat15, GroupAlone], (instregex "ESDTR$")>;
1007 def : InstRW<[FXU, DFU, DFU, Lat20, GroupAlone], (instregex "ESXTR$")>;
1008
1009 //===----------------------------------------------------------------------===//
1010 // DFP: Binary arithmetic
1011 //===----------------------------------------------------------------------===//
1012
1013 // Addition
1014 def : InstRW<[DFU, Lat30], (instregex "ADTR(A)?$")>;
1015 def : InstRW<[DFU2, DFU2, Lat30, GroupAlone], (instregex "AXTR(A)?$")>;
1016
1017 // Subtraction
1018 def : InstRW<[DFU, Lat30], (instregex "SDTR(A)?$")>;
1019 def : InstRW<[DFU2, DFU2, Lat30, GroupAlone], (instregex "SXTR(A)?$")>;
1020
1021 // Multiply
1022 def : InstRW<[DFU, Lat30], (instregex "MDTR(A)?$")>;
1023 def : InstRW<[DFU2, DFU2, Lat30, GroupAlone], (instregex "MXTR(A)?$")>;
1024
1025 // Division
1026 def : InstRW<[DFU, Lat30], (instregex "DDTR(A)?$")>;
1027 def : InstRW<[DFU2, DFU2, Lat30, GroupAlone], (instregex "DXTR(A)?$")>;
1028
1029 // Quantize
1030 def : InstRW<[DFU, Lat30], (instregex "QADTR$")>;
1031 def : InstRW<[DFU2, DFU2, Lat30, GroupAlone], (instregex "QAXTR$")>;
1032
1033 // Reround
1034 def : InstRW<[FXU, DFU, Lat30], (instregex "RRDTR$")>;
1035 def : InstRW<[FXU, DFU2, DFU2, Lat30, GroupAlone], (instregex "RRXTR$")>;
1036
1037 // Shift significand left/right
1038 def : InstRW<[LSU, DFU, Lat11], (instregex "S(L|R)DT$")>;
1039 def : InstRW<[LSU, DFU2, DFU2, Lat15, GroupAlone], (instregex "S(L|R)XT$")>;
1040
1041 // Insert biased exponent
1042 def : InstRW<[FXU, DFU, Lat11], (instregex "IEDTR$")>;
1043 def : InstRW<[FXU, DFU2, DFU2, Lat15, GroupAlone], (instregex "IEXTR$")>;
1044
1045 //===----------------------------------------------------------------------===//
1046 // DFP: Comparisons
1047 //===----------------------------------------------------------------------===//
1048
1049 // Compare
1050 def : InstRW<[DFU, Lat11], (instregex "(K|C)DTR$")>;
1051 def : InstRW<[DFU, DFU, Lat15, GroupAlone], (instregex "(K|C)XTR$")>;
1052
1053 // Compare biased exponent
1054 def : InstRW<[DFU, Lat8], (instregex "CEDTR$")>;
1055 def : InstRW<[DFU, Lat9], (instregex "CEXTR$")>;
1056
1057 // Test Data Class/Group
1058 def : InstRW<[LSU, DFU, Lat15], (instregex "TD(C|G)(E|D)T$")>;
1059 def : InstRW<[LSU, DFU2, DFU2, Lat15, GroupAlone], (instregex "TD(C|G)XT$")>;
1060
1061 }
1062