1 //-- SystemZScheduleZ16.td - SystemZ Scheduling Definitions ----*- tblgen -*-=//
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
7 //===----------------------------------------------------------------------===//
9 // This file defines the machine model for Z16 to support instruction
10 // scheduling and other instruction cost heuristics.
12 // Pseudos expanded right after isel do not need to be modelled here.
14 //===----------------------------------------------------------------------===//
16 def Z16Model : SchedMachineModel {
18 let UnsupportedFeatures = Arch14UnsupportedFeatures.List;
20 let IssueWidth = 6; // Number of instructions decoded per cycle.
21 let MicroOpBufferSize = 60; // Issue queues
22 let LoadLatency = 1; // Optimistic load latency.
24 let PostRAScheduler = 1;
26 // Extra cycles for a mispredicted branch.
27 let MispredictPenalty = 20;
30 let SchedModel = Z16Model in {
31 // These definitions need the SchedModel value. They could be put in a
32 // subtarget common include file, but it seems the include system in Tablegen
33 // currently (2016) rejects multiple includes of same file.
35 // Decoder grouping rules
36 let NumMicroOps = 1 in {
37 def : WriteRes<NormalGr, []>;
38 def : WriteRes<BeginGroup, []> { let BeginGroup = 1; }
39 def : WriteRes<EndGroup, []> { let EndGroup = 1; }
41 def : WriteRes<Cracked, []> {
45 def : WriteRes<GroupAlone, []> {
50 def : WriteRes<GroupAlone2, []> {
55 def : WriteRes<GroupAlone3, []> {
61 // Incoming latency removed from the register operand which is used together
62 // with a memory operand by the instruction.
63 def : ReadAdvance<RegReadAdv, 4>;
65 // LoadLatency (above) is not used for instructions in this file. This is
66 // instead the role of LSULatency, which is the latency value added to the
67 // result of loads and instructions with folded memory operands.
68 def : WriteRes<LSULatency, []> { let Latency = 4; let NumMicroOps = 0; }
70 let NumMicroOps = 0 in {
72 def : WriteRes<!cast<SchedWrite>("WLat"#L), []> { let Latency = L; }
76 def Z16_FXaUnit : ProcResource<2>;
77 def Z16_FXbUnit : ProcResource<2>;
78 def Z16_LSUnit : ProcResource<2>;
79 def Z16_VecUnit : ProcResource<2>;
80 def Z16_VecFPdUnit : ProcResource<2> { let BufferSize = 1; /* blocking */ }
81 def Z16_VBUnit : ProcResource<2>;
82 def Z16_MCD : ProcResource<1>;
84 // Subtarget specific definitions of scheduling resources.
85 let NumMicroOps = 0 in {
86 def : WriteRes<FXa, [Z16_FXaUnit]>;
87 def : WriteRes<FXb, [Z16_FXbUnit]>;
88 def : WriteRes<LSU, [Z16_LSUnit]>;
89 def : WriteRes<VecBF, [Z16_VecUnit]>;
90 def : WriteRes<VecDF, [Z16_VecUnit]>;
91 def : WriteRes<VecDFX, [Z16_VecUnit]>;
92 def : WriteRes<VecMul, [Z16_VecUnit]>;
93 def : WriteRes<VecStr, [Z16_VecUnit]>;
94 def : WriteRes<VecXsPm, [Z16_VecUnit]>;
95 foreach Num = 2-5 in { let ReleaseAtCycles = [Num] in {
96 def : WriteRes<!cast<SchedWrite>("FXa"#Num), [Z16_FXaUnit]>;
97 def : WriteRes<!cast<SchedWrite>("FXb"#Num), [Z16_FXbUnit]>;
98 def : WriteRes<!cast<SchedWrite>("LSU"#Num), [Z16_LSUnit]>;
99 def : WriteRes<!cast<SchedWrite>("VecBF"#Num), [Z16_VecUnit]>;
100 def : WriteRes<!cast<SchedWrite>("VecDF"#Num), [Z16_VecUnit]>;
101 def : WriteRes<!cast<SchedWrite>("VecDFX"#Num), [Z16_VecUnit]>;
102 def : WriteRes<!cast<SchedWrite>("VecMul"#Num), [Z16_VecUnit]>;
103 def : WriteRes<!cast<SchedWrite>("VecStr"#Num), [Z16_VecUnit]>;
104 def : WriteRes<!cast<SchedWrite>("VecXsPm"#Num), [Z16_VecUnit]>;
107 def : WriteRes<VecFPd, [Z16_VecFPdUnit]> { let ReleaseAtCycles = [30]; }
108 def : WriteRes<VecFPd20, [Z16_VecFPdUnit]> { let ReleaseAtCycles = [20]; }
110 def : WriteRes<VBU, [Z16_VBUnit]>; // Virtual Branching Unit
113 def : WriteRes<MCD, [Z16_MCD]> { let NumMicroOps = 3;
117 // -------------------------- INSTRUCTIONS ---------------------------------- //
119 // InstRW constructs have been used in order to preserve the
120 // readability of the InstrInfo files.
122 // For each instruction, as matched by a regexp, provide a list of
123 // resources that it needs. These will be combined into a SchedClass.
125 //===----------------------------------------------------------------------===//
127 //===----------------------------------------------------------------------===//
129 // Pseudo -> LA / LAY
130 def : InstRW<[WLat1, FXa, NormalGr], (instregex "ADJDYNALLOC$")>;
132 //===----------------------------------------------------------------------===//
133 // Branch instructions
134 //===----------------------------------------------------------------------===//
137 def : InstRW<[WLat1, VBU, NormalGr], (instregex "(Call)?BRC(L)?(Asm.*)?$")>;
138 def : InstRW<[WLat1, VBU, NormalGr], (instregex "(Call)?J(G)?(Asm.*)?$")>;
139 def : InstRW<[WLat1, FXb, NormalGr], (instregex "(Call)?BC(R)?(Asm.*)?$")>;
140 def : InstRW<[WLat1, FXb, NormalGr], (instregex "(Call)?B(R)?(Asm.*)?$")>;
141 def : InstRW<[WLat1, FXb, LSU, NormalGr], (instregex "BI(C)?(Asm.*)?$")>;
142 def : InstRW<[WLat1, FXa, EndGroup], (instregex "BRCT(G)?$")>;
143 def : InstRW<[WLat1, FXa, FXb, GroupAlone], (instregex "BRCTH$")>;
144 def : InstRW<[WLat1, FXa, FXb, GroupAlone], (instregex "BCT(G)?(R)?$")>;
145 def : InstRW<[WLat1, FXa2, FXb, GroupAlone], (instregex "B(R)?X(H|L).*$")>;
147 // Compare and branch
148 def : InstRW<[WLat1, FXb, NormalGr], (instregex "C(L)?(G)?(I|R)J(Asm.*)?$")>;
149 def : InstRW<[WLat1, FXb2, GroupAlone],
150 (instregex "C(L)?(G)?(I|R)B(Call|Return|Asm.*)?$")>;
152 //===----------------------------------------------------------------------===//
154 //===----------------------------------------------------------------------===//
157 def : InstRW<[WLat1, VBU, NormalGr], (instregex "(Cond)?Trap$")>;
160 def : InstRW<[WLat1, FXb, NormalGr], (instregex "C(G)?(I|R)T(Asm.*)?$")>;
161 def : InstRW<[WLat1, FXb, NormalGr], (instregex "CL(G)?RT(Asm.*)?$")>;
162 def : InstRW<[WLat1, FXb, NormalGr], (instregex "CL(F|G)IT(Asm.*)?$")>;
163 def : InstRW<[WLat1, FXb, LSU, NormalGr], (instregex "CL(G)?T(Asm.*)?$")>;
165 //===----------------------------------------------------------------------===//
166 // Call and return instructions
167 //===----------------------------------------------------------------------===//
170 def : InstRW<[WLat1, VBU, FXa2, GroupAlone], (instregex "(Call)?BRAS$")>;
171 def : InstRW<[WLat1, FXa2, FXb, GroupAlone], (instregex "(Call)?BRASL(_XPLINK64)?$")>;
172 def : InstRW<[WLat1, FXa2, FXb, GroupAlone], (instregex "(Call)?BAS(R)?(_XPLINK64|_STACKEXT)?$")>;
173 def : InstRW<[WLat1, FXa2, FXb, GroupAlone], (instregex "TLS_(G|L)DCALL$")>;
176 def : InstRW<[WLat1, FXb, EndGroup], (instregex "Return(_XPLINK)?$")>;
177 def : InstRW<[WLat1, FXb, NormalGr], (instregex "CondReturn(_XPLINK)?$")>;
179 //===----------------------------------------------------------------------===//
181 //===----------------------------------------------------------------------===//
184 def : InstRW<[WLat1, FXb, LSU, NormalGr], (instregex "MV(G|H)?HI$")>;
185 def : InstRW<[WLat1, FXb, LSU, NormalGr], (instregex "MVI(Y)?$")>;
188 def : InstRW<[WLat1, FXb, LSU3, GroupAlone], (instregex "MVC$")>;
189 def : InstRW<[WLat30, WLat30, WLat30, MCD], (instregex "MVCL(E|U)?$")>;
190 def : InstRW<[WLat1, LSU2, GroupAlone], (instregex "MVCRL$")>;
192 // Pseudo -> reg move
193 def : InstRW<[WLat1, FXa, NormalGr], (instregex "COPY(_TO_REGCLASS)?$")>;
194 def : InstRW<[WLat1, FXa, NormalGr], (instregex "EXTRACT_SUBREG$")>;
195 def : InstRW<[WLat1, FXa, NormalGr], (instregex "INSERT_SUBREG$")>;
196 def : InstRW<[WLat1, FXa, NormalGr], (instregex "REG_SEQUENCE$")>;
199 def : InstRW<[LSULatency, LSU, NormalGr], (instregex "L(Y|FH|RL|Mux)?$")>;
200 def : InstRW<[LSULatency, LSULatency, LSU, NormalGr], (instregex "LCBB$")>;
201 def : InstRW<[LSULatency, LSU, NormalGr], (instregex "LG(RL)?$")>;
202 def : InstRW<[LSULatency, LSU, NormalGr], (instregex "L128$")>;
204 def : InstRW<[WLat1, FXa, NormalGr], (instregex "LLIH(F|H|L)$")>;
205 def : InstRW<[WLat1, FXa, NormalGr], (instregex "LLIL(F|H|L)$")>;
207 def : InstRW<[WLat1, FXa, NormalGr], (instregex "LG(F|H)I$")>;
208 def : InstRW<[WLat1, FXa, NormalGr], (instregex "LHI(Mux)?$")>;
209 def : InstRW<[WLat1, FXa, NormalGr], (instregex "LR$")>;
211 // Load and zero rightmost byte
212 def : InstRW<[LSULatency, LSU, NormalGr], (instregex "LZR(F|G)$")>;
215 def : InstRW<[WLat1LSU, FXb, LSU, NormalGr], (instregex "L(FH|G)?AT$")>;
218 def : InstRW<[WLat1LSU, WLat1LSU, LSU, FXa, NormalGr], (instregex "LT(G)?$")>;
219 def : InstRW<[WLat1, FXa, NormalGr], (instregex "LT(G)?R$")>;
222 def : InstRW<[WLat1, FXb, LSU, NormalGr], (instregex "STG(RL)?$")>;
223 def : InstRW<[WLat1, FXb, LSU, NormalGr], (instregex "ST128$")>;
224 def : InstRW<[WLat1, FXb, LSU, NormalGr], (instregex "ST(Y|FH|RL|Mux)?$")>;
227 def : InstRW<[WLat30, WLat30, WLat30, MCD], (instregex "MVST$")>;
229 //===----------------------------------------------------------------------===//
230 // Conditional move instructions
231 //===----------------------------------------------------------------------===//
233 def : InstRW<[WLat2, FXa, NormalGr], (instregex "LOCRMux$")>;
234 def : InstRW<[WLat2, FXa, NormalGr], (instregex "LOC(G|FH)?R(Asm.*)?$")>;
235 def : InstRW<[WLat2, FXa, NormalGr], (instregex "LOC(G|H)?HI(Mux|(Asm.*))?$")>;
236 def : InstRW<[WLat2LSU, RegReadAdv, FXa, LSU, NormalGr],
237 (instregex "LOC(G|FH|Mux)?(Asm.*)?$")>;
238 def : InstRW<[WLat1, FXb, LSU, NormalGr],
239 (instregex "STOC(G|FH|Mux)?(Asm.*)?$")>;
241 def : InstRW<[WLat2, FXa, NormalGr], (instregex "SELRMux$")>;
242 def : InstRW<[WLat2, FXa, NormalGr], (instregex "SEL(G|FH)?R(Asm.*)?$")>;
244 //===----------------------------------------------------------------------===//
246 //===----------------------------------------------------------------------===//
248 def : InstRW<[WLat1, FXa, NormalGr], (instregex "L(B|H|G)R$")>;
249 def : InstRW<[WLat1, FXa, NormalGr], (instregex "LG(B|H|F)R$")>;
251 def : InstRW<[WLat1LSU, WLat1LSU, FXa, LSU, NormalGr], (instregex "LTGF$")>;
252 def : InstRW<[WLat1, FXa, NormalGr], (instregex "LTGFR$")>;
254 def : InstRW<[WLat1LSU, FXa, LSU, NormalGr], (instregex "LB(H|Mux)?$")>;
255 def : InstRW<[WLat1LSU, FXa, LSU, NormalGr], (instregex "LH(Y)?$")>;
256 def : InstRW<[WLat1LSU, FXa, LSU, NormalGr], (instregex "LH(H|Mux|RL)$")>;
257 def : InstRW<[WLat1LSU, FXa, LSU, NormalGr], (instregex "LG(B|H|F)$")>;
258 def : InstRW<[WLat1LSU, FXa, LSU, NormalGr], (instregex "LG(H|F)RL$")>;
260 //===----------------------------------------------------------------------===//
262 //===----------------------------------------------------------------------===//
264 def : InstRW<[WLat1, FXa, NormalGr], (instregex "LLCR(Mux)?$")>;
265 def : InstRW<[WLat1, FXa, NormalGr], (instregex "LLHR(Mux)?$")>;
266 def : InstRW<[WLat1, FXa, NormalGr], (instregex "LLG(C|H|F|T)R$")>;
267 def : InstRW<[LSULatency, LSU, NormalGr], (instregex "LLC(Mux)?$")>;
268 def : InstRW<[LSULatency, LSU, NormalGr], (instregex "LLH(Mux)?$")>;
269 def : InstRW<[WLat1LSU, FXa, LSU, NormalGr], (instregex "LL(C|H)H$")>;
270 def : InstRW<[LSULatency, LSU, NormalGr], (instregex "LLHRL$")>;
271 def : InstRW<[LSULatency, LSU, NormalGr], (instregex "LLG(C|H|F|T|HRL|FRL)$")>;
273 // Load and zero rightmost byte
274 def : InstRW<[LSULatency, LSU, NormalGr], (instregex "LLZRGF$")>;
277 def : InstRW<[WLat1LSU, FXb, LSU, NormalGr], (instregex "LLG(F|T)?AT$")>;
279 //===----------------------------------------------------------------------===//
281 //===----------------------------------------------------------------------===//
283 def : InstRW<[WLat1, FXb, LSU, NormalGr], (instregex "STC(H|Y|Mux)?$")>;
284 def : InstRW<[WLat1, FXb, LSU, NormalGr], (instregex "STH(H|Y|RL|Mux)?$")>;
285 def : InstRW<[WLat1, FXb, LSU, NormalGr], (instregex "STCM(H|Y)?$")>;
287 //===----------------------------------------------------------------------===//
288 // Multi-register moves
289 //===----------------------------------------------------------------------===//
291 // Load multiple (estimated average of 5 ops)
292 def : InstRW<[WLat10, WLat10, LSU5, GroupAlone], (instregex "LM(H|Y|G)?$")>;
294 // Load multiple disjoint
295 def : InstRW<[WLat30, WLat30, MCD], (instregex "LMD$")>;
298 def : InstRW<[WLat1, LSU2, FXb3, GroupAlone], (instregex "STM(G|H|Y)?$")>;
300 //===----------------------------------------------------------------------===//
302 //===----------------------------------------------------------------------===//
304 def : InstRW<[WLat1, FXa, NormalGr], (instregex "LRV(G)?R$")>;
305 def : InstRW<[WLat1LSU, FXa, LSU, NormalGr], (instregex "LRV(G|H)?$")>;
306 def : InstRW<[WLat1, FXb, LSU, NormalGr], (instregex "STRV(G|H)?$")>;
307 def : InstRW<[WLat30, MCD], (instregex "MVCIN$")>;
309 //===----------------------------------------------------------------------===//
310 // Load address instructions
311 //===----------------------------------------------------------------------===//
313 def : InstRW<[WLat1, FXa, NormalGr], (instregex "LA(Y|RL)?$")>;
315 // Load the Global Offset Table address ( -> larl )
316 def : InstRW<[WLat1, FXa, NormalGr], (instregex "GOT$")>;
318 //===----------------------------------------------------------------------===//
319 // Absolute and Negation
320 //===----------------------------------------------------------------------===//
322 def : InstRW<[WLat1, WLat1, FXa, NormalGr], (instregex "LP(G)?R$")>;
323 def : InstRW<[WLat2, WLat2, FXa2, Cracked], (instregex "L(N|P)GFR$")>;
324 def : InstRW<[WLat1, WLat1, FXa, NormalGr], (instregex "LN(R|GR)$")>;
325 def : InstRW<[WLat1, FXa, NormalGr], (instregex "LC(R|GR)$")>;
326 def : InstRW<[WLat2, WLat2, FXa2, Cracked], (instregex "LCGFR$")>;
328 //===----------------------------------------------------------------------===//
330 //===----------------------------------------------------------------------===//
332 def : InstRW<[WLat1LSU, RegReadAdv, FXa, LSU, NormalGr], (instregex "IC(Y)?$")>;
333 def : InstRW<[WLat1LSU, RegReadAdv, FXa, LSU, NormalGr],
334 (instregex "IC32(Y)?$")>;
335 def : InstRW<[WLat1LSU, RegReadAdv, WLat1LSU, FXa, LSU, NormalGr],
336 (instregex "ICM(H|Y)?$")>;
337 def : InstRW<[WLat1, FXa, NormalGr], (instregex "II(F|H|L)Mux$")>;
338 def : InstRW<[WLat1, FXa, NormalGr], (instregex "IIHF(64)?$")>;
339 def : InstRW<[WLat1, FXa, NormalGr], (instregex "IIHH(64)?$")>;
340 def : InstRW<[WLat1, FXa, NormalGr], (instregex "IIHL(64)?$")>;
341 def : InstRW<[WLat1, FXa, NormalGr], (instregex "IILF(64)?$")>;
342 def : InstRW<[WLat1, FXa, NormalGr], (instregex "IILH(64)?$")>;
343 def : InstRW<[WLat1, FXa, NormalGr], (instregex "IILL(64)?$")>;
345 //===----------------------------------------------------------------------===//
347 //===----------------------------------------------------------------------===//
349 def : InstRW<[WLat1LSU, WLat1LSU, RegReadAdv, FXa, LSU, NormalGr],
350 (instregex "A(Y)?$")>;
351 def : InstRW<[WLat2LSU, WLat2LSU, RegReadAdv, FXa, LSU, NormalGr],
352 (instregex "AH(Y)?$")>;
353 def : InstRW<[WLat1, FXa, NormalGr], (instregex "AIH$")>;
354 def : InstRW<[WLat1, FXa, NormalGr], (instregex "AFI(Mux)?$")>;
355 def : InstRW<[WLat1LSU, WLat1LSU, RegReadAdv, FXa, LSU, NormalGr],
357 def : InstRW<[WLat1, FXa, NormalGr], (instregex "AGFI$")>;
358 def : InstRW<[WLat1, FXa, NormalGr], (instregex "AGHI(K)?$")>;
359 def : InstRW<[WLat1, FXa, NormalGr], (instregex "AGR(K)?$")>;
360 def : InstRW<[WLat1, FXa, NormalGr], (instregex "AHI(K)?$")>;
361 def : InstRW<[WLat1, FXa, NormalGr], (instregex "AHIMux(K)?$")>;
362 def : InstRW<[WLat1LSU, WLat1LSU, RegReadAdv, FXa, LSU, NormalGr],
363 (instregex "AL(Y)?$")>;
364 def : InstRW<[WLat1, FXa, NormalGr], (instregex "AL(FI|HSIK)$")>;
365 def : InstRW<[WLat1LSU, WLat1LSU, RegReadAdv, FXa, LSU, NormalGr],
366 (instregex "ALG(F)?$")>;
367 def : InstRW<[WLat1, FXa, NormalGr], (instregex "ALGHSIK$")>;
368 def : InstRW<[WLat1, FXa, NormalGr], (instregex "ALGF(I|R)$")>;
369 def : InstRW<[WLat1, FXa, NormalGr], (instregex "ALGR(K)?$")>;
370 def : InstRW<[WLat1, FXa, NormalGr], (instregex "ALR(K)?$")>;
371 def : InstRW<[WLat1, FXa, NormalGr], (instregex "AR(K)?$")>;
372 def : InstRW<[WLat1, FXa, NormalGr], (instregex "A(L)?HHHR$")>;
373 def : InstRW<[WLat2, WLat2, FXa, NormalGr], (instregex "A(L)?HHLR$")>;
374 def : InstRW<[WLat1, FXa, NormalGr], (instregex "ALSIH(N)?$")>;
375 def : InstRW<[WLat2LSU, FXb, LSU, NormalGr], (instregex "A(L)?(G)?SI$")>;
377 // Logical addition with carry
378 def : InstRW<[WLat2LSU, WLat2LSU, RegReadAdv, FXa, LSU, GroupAlone],
379 (instregex "ALC(G)?$")>;
380 def : InstRW<[WLat2, WLat2, FXa, GroupAlone], (instregex "ALC(G)?R$")>;
382 // Add with sign extension (16/32 -> 64)
383 def : InstRW<[WLat2LSU, WLat2LSU, RegReadAdv, FXa, LSU, NormalGr],
384 (instregex "AG(F|H)$")>;
385 def : InstRW<[WLat2, WLat2, FXa, NormalGr], (instregex "AGFR$")>;
387 //===----------------------------------------------------------------------===//
389 //===----------------------------------------------------------------------===//
391 def : InstRW<[WLat1LSU, WLat1LSU, RegReadAdv, FXa, LSU, NormalGr],
392 (instregex "S(G|Y)?$")>;
393 def : InstRW<[WLat2LSU, WLat2LSU, RegReadAdv, FXa, LSU, NormalGr],
394 (instregex "SH(Y)?$")>;
395 def : InstRW<[WLat1, FXa, NormalGr], (instregex "SGR(K)?$")>;
396 def : InstRW<[WLat1, FXa, NormalGr], (instregex "SLFI$")>;
397 def : InstRW<[WLat1LSU, WLat1LSU, RegReadAdv, FXa, LSU, NormalGr],
398 (instregex "SL(G|GF|Y)?$")>;
399 def : InstRW<[WLat1, FXa, NormalGr], (instregex "SLGF(I|R)$")>;
400 def : InstRW<[WLat1, FXa, NormalGr], (instregex "SLGR(K)?$")>;
401 def : InstRW<[WLat1, FXa, NormalGr], (instregex "SLR(K)?$")>;
402 def : InstRW<[WLat1, FXa, NormalGr], (instregex "SR(K)?$")>;
403 def : InstRW<[WLat1, FXa, NormalGr], (instregex "S(L)?HHHR$")>;
404 def : InstRW<[WLat2, WLat2, FXa, NormalGr], (instregex "S(L)?HHLR$")>;
406 // Subtraction with borrow
407 def : InstRW<[WLat2LSU, WLat2LSU, RegReadAdv, FXa, LSU, GroupAlone],
408 (instregex "SLB(G)?$")>;
409 def : InstRW<[WLat2, WLat2, FXa, GroupAlone], (instregex "SLB(G)?R$")>;
411 // Subtraction with sign extension (16/32 -> 64)
412 def : InstRW<[WLat2LSU, WLat2LSU, RegReadAdv, FXa, LSU, NormalGr],
413 (instregex "SG(F|H)$")>;
414 def : InstRW<[WLat2, WLat2, FXa, NormalGr], (instregex "SGFR$")>;
416 //===----------------------------------------------------------------------===//
418 //===----------------------------------------------------------------------===//
420 def : InstRW<[WLat1LSU, WLat1LSU, RegReadAdv, FXa, LSU, NormalGr],
421 (instregex "N(G|Y)?$")>;
422 def : InstRW<[WLat1, FXa, NormalGr], (instregex "NGR(K)?$")>;
423 def : InstRW<[WLat1, FXa, NormalGr], (instregex "NI(FMux|HMux|LMux)$")>;
424 def : InstRW<[WLat2LSU, FXb, LSU, NormalGr], (instregex "NI(Y)?$")>;
425 def : InstRW<[WLat1, FXa, NormalGr], (instregex "NIHF(64)?$")>;
426 def : InstRW<[WLat1, FXa, NormalGr], (instregex "NIHH(64)?$")>;
427 def : InstRW<[WLat1, FXa, NormalGr], (instregex "NIHL(64)?$")>;
428 def : InstRW<[WLat1, FXa, NormalGr], (instregex "NILF(64)?$")>;
429 def : InstRW<[WLat1, FXa, NormalGr], (instregex "NILH(64)?$")>;
430 def : InstRW<[WLat1, FXa, NormalGr], (instregex "NILL(64)?$")>;
431 def : InstRW<[WLat1, FXa, NormalGr], (instregex "NR(K)?$")>;
432 def : InstRW<[WLat3LSU, LSU2, FXb, Cracked], (instregex "NC$")>;
434 //===----------------------------------------------------------------------===//
436 //===----------------------------------------------------------------------===//
438 def : InstRW<[WLat1LSU, WLat1LSU, RegReadAdv, FXa, LSU, NormalGr],
439 (instregex "O(G|Y)?$")>;
440 def : InstRW<[WLat1, FXa, NormalGr], (instregex "OGR(K)?$")>;
441 def : InstRW<[WLat2LSU, FXb, LSU, NormalGr], (instregex "OI(Y)?$")>;
442 def : InstRW<[WLat1, FXa, NormalGr], (instregex "OI(FMux|HMux|LMux)$")>;
443 def : InstRW<[WLat1, FXa, NormalGr], (instregex "OIHF(64)?$")>;
444 def : InstRW<[WLat1, FXa, NormalGr], (instregex "OIHH(64)?$")>;
445 def : InstRW<[WLat1, FXa, NormalGr], (instregex "OIHL(64)?$")>;
446 def : InstRW<[WLat1, FXa, NormalGr], (instregex "OILF(64)?$")>;
447 def : InstRW<[WLat1, FXa, NormalGr], (instregex "OILH(64)?$")>;
448 def : InstRW<[WLat1, FXa, NormalGr], (instregex "OILL(64)?$")>;
449 def : InstRW<[WLat1, FXa, NormalGr], (instregex "OR(K)?$")>;
450 def : InstRW<[WLat3LSU, LSU2, FXb, Cracked], (instregex "OC$")>;
452 //===----------------------------------------------------------------------===//
454 //===----------------------------------------------------------------------===//
456 def : InstRW<[WLat1LSU, WLat1LSU, RegReadAdv, FXa, LSU, NormalGr],
457 (instregex "X(G|Y)?$")>;
458 def : InstRW<[WLat2LSU, FXb, LSU, NormalGr], (instregex "XI(Y)?$")>;
459 def : InstRW<[WLat1, FXa, NormalGr], (instregex "XIFMux$")>;
460 def : InstRW<[WLat1, FXa, NormalGr], (instregex "XGR(K)?$")>;
461 def : InstRW<[WLat1, FXa, NormalGr], (instregex "XIHF(64)?$")>;
462 def : InstRW<[WLat1, FXa, NormalGr], (instregex "XILF(64)?$")>;
463 def : InstRW<[WLat1, FXa, NormalGr], (instregex "XR(K)?$")>;
464 def : InstRW<[WLat3LSU, LSU2, FXb, Cracked], (instregex "XC$")>;
466 //===----------------------------------------------------------------------===//
467 // Combined logical operations
468 //===----------------------------------------------------------------------===//
470 def : InstRW<[WLat1, FXa, NormalGr], (instregex "NC(G)?RK$")>;
471 def : InstRW<[WLat1, FXa, NormalGr], (instregex "OC(G)?RK$")>;
472 def : InstRW<[WLat1, FXa, NormalGr], (instregex "NN(G)?RK$")>;
473 def : InstRW<[WLat1, FXa, NormalGr], (instregex "NO(G)?RK$")>;
474 def : InstRW<[WLat1, FXa, NormalGr], (instregex "NX(G)?RK$")>;
476 //===----------------------------------------------------------------------===//
478 //===----------------------------------------------------------------------===//
480 def : InstRW<[WLat5LSU, RegReadAdv, FXa, LSU, NormalGr],
481 (instregex "MS(GF|Y)?$")>;
482 def : InstRW<[WLat5, FXa, NormalGr], (instregex "MS(R|FI)$")>;
483 def : InstRW<[WLat7LSU, RegReadAdv, FXa, LSU, NormalGr], (instregex "MSG$")>;
484 def : InstRW<[WLat7, FXa, NormalGr], (instregex "MSGR$")>;
485 def : InstRW<[WLat5, FXa, NormalGr], (instregex "MSGF(I|R)$")>;
486 def : InstRW<[WLat8LSU, RegReadAdv, FXa2, LSU, GroupAlone], (instregex "MLG$")>;
487 def : InstRW<[WLat8, FXa2, GroupAlone], (instregex "MLGR$")>;
488 def : InstRW<[WLat4, FXa, NormalGr], (instregex "MGHI$")>;
489 def : InstRW<[WLat4, FXa, NormalGr], (instregex "MHI$")>;
490 def : InstRW<[WLat4LSU, RegReadAdv, FXa, LSU, NormalGr], (instregex "MH(Y)?$")>;
491 def : InstRW<[WLat6, FXa2, GroupAlone], (instregex "M(L)?R$")>;
492 def : InstRW<[WLat6LSU, RegReadAdv, FXa2, LSU, GroupAlone],
493 (instregex "M(FY|L)?$")>;
494 def : InstRW<[WLat8, RegReadAdv, FXa, LSU, NormalGr], (instregex "MGH$")>;
495 def : InstRW<[WLat12, RegReadAdv, FXa2, LSU, GroupAlone], (instregex "MG$")>;
496 def : InstRW<[WLat8, FXa2, GroupAlone], (instregex "MGRK$")>;
497 def : InstRW<[WLat6LSU, WLat6LSU, RegReadAdv, FXa, LSU, NormalGr],
499 def : InstRW<[WLat8LSU, WLat8LSU, RegReadAdv, FXa, LSU, NormalGr],
500 (instregex "MSGC$")>;
501 def : InstRW<[WLat6, WLat6, FXa, NormalGr], (instregex "MSRKC$")>;
502 def : InstRW<[WLat8, WLat8, FXa, NormalGr], (instregex "MSGRKC$")>;
504 //===----------------------------------------------------------------------===//
505 // Division and remainder
506 //===----------------------------------------------------------------------===//
508 def : InstRW<[WLat20, FXa4, GroupAlone], (instregex "DR$")>;
509 def : InstRW<[WLat30, RegReadAdv, FXa4, LSU, GroupAlone2], (instregex "D$")>;
510 def : InstRW<[WLat30, FXa2, GroupAlone], (instregex "DSG(F)?R$")>;
511 def : InstRW<[WLat30, RegReadAdv, FXa2, LSU, GroupAlone2],
512 (instregex "DSG(F)?$")>;
513 def : InstRW<[WLat20, FXa4, GroupAlone], (instregex "DLR$")>;
514 def : InstRW<[WLat30, FXa4, GroupAlone], (instregex "DLGR$")>;
515 def : InstRW<[WLat30, RegReadAdv, FXa4, LSU, GroupAlone2],
516 (instregex "DL(G)?$")>;
518 //===----------------------------------------------------------------------===//
520 //===----------------------------------------------------------------------===//
522 def : InstRW<[WLat1, FXa, NormalGr], (instregex "SLL(G|K)?$")>;
523 def : InstRW<[WLat1, FXa, NormalGr], (instregex "SRL(G|K)?$")>;
524 def : InstRW<[WLat1, FXa, NormalGr], (instregex "SRA(G|K)?$")>;
525 def : InstRW<[WLat1, FXa, NormalGr], (instregex "SLA(G|K)?$")>;
526 def : InstRW<[WLat5LSU, WLat5LSU, FXa4, LSU, GroupAlone2],
527 (instregex "S(L|R)D(A|L)$")>;
530 def : InstRW<[WLat2LSU, FXa, LSU, NormalGr], (instregex "RLL(G)?$")>;
533 def : InstRW<[WLat1, FXa, NormalGr], (instregex "RISBG(N|32)?$")>;
534 def : InstRW<[WLat1, FXa, NormalGr], (instregex "RISBH(G|H|L)$")>;
535 def : InstRW<[WLat1, FXa, NormalGr], (instregex "RISBL(G|H|L)$")>;
536 def : InstRW<[WLat1, FXa, NormalGr], (instregex "RISBMux$")>;
539 def : InstRW<[WLat2, WLat2, FXa2, Cracked], (instregex "R(N|O|X)SBG$")>;
541 //===----------------------------------------------------------------------===//
543 //===----------------------------------------------------------------------===//
545 def : InstRW<[WLat1LSU, RegReadAdv, FXb, LSU, NormalGr],
546 (instregex "C(G|Y|Mux)?$")>;
547 def : InstRW<[WLat1LSU, FXb, LSU, NormalGr], (instregex "CRL$")>;
548 def : InstRW<[WLat1, FXb, NormalGr], (instregex "C(F|H)I(Mux)?$")>;
549 def : InstRW<[WLat1, FXb, NormalGr], (instregex "CG(F|H)I$")>;
550 def : InstRW<[WLat1LSU, FXb, LSU, NormalGr], (instregex "CG(HSI|RL)$")>;
551 def : InstRW<[WLat1, FXb, NormalGr], (instregex "C(G)?R$")>;
552 def : InstRW<[WLat1, FXb, NormalGr], (instregex "CIH$")>;
553 def : InstRW<[WLat1LSU, RegReadAdv, FXb, LSU, NormalGr], (instregex "CHF$")>;
554 def : InstRW<[WLat1LSU, FXb, LSU, NormalGr], (instregex "CHSI$")>;
555 def : InstRW<[WLat1LSU, RegReadAdv, FXb, LSU, NormalGr],
556 (instregex "CL(Y|Mux)?$")>;
557 def : InstRW<[WLat1LSU, FXb, LSU, NormalGr], (instregex "CLFHSI$")>;
558 def : InstRW<[WLat1, FXb, NormalGr], (instregex "CLFI(Mux)?$")>;
559 def : InstRW<[WLat1LSU, RegReadAdv, FXb, LSU, NormalGr], (instregex "CLG$")>;
560 def : InstRW<[WLat1LSU, FXb, LSU, NormalGr], (instregex "CLG(HRL|HSI)$")>;
561 def : InstRW<[WLat1LSU, RegReadAdv, FXb, LSU, NormalGr], (instregex "CLGF$")>;
562 def : InstRW<[WLat1LSU, FXb, LSU, NormalGr], (instregex "CLGFRL$")>;
563 def : InstRW<[WLat1, FXb, NormalGr], (instregex "CLGF(I|R)$")>;
564 def : InstRW<[WLat1, FXb, NormalGr], (instregex "CLGR$")>;
565 def : InstRW<[WLat1LSU, FXb, LSU, NormalGr], (instregex "CLGRL$")>;
566 def : InstRW<[WLat1LSU, RegReadAdv, FXb, LSU, NormalGr], (instregex "CLHF$")>;
567 def : InstRW<[WLat1LSU, FXb, LSU, NormalGr], (instregex "CLH(RL|HSI)$")>;
568 def : InstRW<[WLat1, FXb, NormalGr], (instregex "CLIH$")>;
569 def : InstRW<[WLat1LSU, FXb, LSU, NormalGr], (instregex "CLI(Y)?$")>;
570 def : InstRW<[WLat1, FXb, NormalGr], (instregex "CLR$")>;
571 def : InstRW<[WLat1LSU, FXb, LSU, NormalGr], (instregex "CLRL$")>;
572 def : InstRW<[WLat1, FXb, NormalGr], (instregex "C(L)?HHR$")>;
573 def : InstRW<[WLat2, FXb, NormalGr], (instregex "C(L)?HLR$")>;
576 def : InstRW<[WLat2LSU, RegReadAdv, FXb, LSU, NormalGr], (instregex "CH(Y)?$")>;
577 def : InstRW<[WLat2LSU, FXb, LSU, NormalGr], (instregex "CHRL$")>;
578 def : InstRW<[WLat2LSU, RegReadAdv, FXb, LSU, NormalGr], (instregex "CGH$")>;
579 def : InstRW<[WLat2LSU, FXb, LSU, NormalGr], (instregex "CGHRL$")>;
580 def : InstRW<[WLat2LSU, FXa, FXb, LSU, Cracked], (instregex "CHHSI$")>;
582 // Compare with sign extension (32 -> 64)
583 def : InstRW<[WLat2LSU, RegReadAdv, FXb, LSU, NormalGr], (instregex "CGF$")>;
584 def : InstRW<[WLat2LSU, FXb, LSU, NormalGr], (instregex "CGFRL$")>;
585 def : InstRW<[WLat2, FXb, NormalGr], (instregex "CGFR$")>;
587 // Compare logical character
588 def : InstRW<[WLat6, FXb, LSU2, Cracked], (instregex "CLC$")>;
589 def : InstRW<[WLat30, WLat30, WLat30, MCD], (instregex "CLCL(E|U)?$")>;
590 def : InstRW<[WLat30, WLat30, WLat30, MCD], (instregex "CLST$")>;
593 def : InstRW<[WLat1LSU, FXb, LSU, NormalGr], (instregex "TM(Y)?$")>;
594 def : InstRW<[WLat1, FXb, NormalGr], (instregex "TM(H|L)Mux$")>;
595 def : InstRW<[WLat1, FXb, NormalGr], (instregex "TMHH(64)?$")>;
596 def : InstRW<[WLat1, FXb, NormalGr], (instregex "TMHL(64)?$")>;
597 def : InstRW<[WLat1, FXb, NormalGr], (instregex "TMLH(64)?$")>;
598 def : InstRW<[WLat1, FXb, NormalGr], (instregex "TMLL(64)?$")>;
600 // Compare logical characters under mask
601 def : InstRW<[WLat2LSU, RegReadAdv, FXb, LSU, NormalGr],
602 (instregex "CLM(H|Y)?$")>;
604 //===----------------------------------------------------------------------===//
605 // Prefetch and execution hint
606 //===----------------------------------------------------------------------===//
608 def : InstRW<[WLat1, LSU, NormalGr], (instregex "PFD(RL)?$")>;
609 def : InstRW<[WLat1, FXb, NormalGr], (instregex "BPP$")>;
610 def : InstRW<[FXb, EndGroup], (instregex "BPRP$")>;
611 def : InstRW<[WLat1, FXb, NormalGr], (instregex "NIAI$")>;
613 //===----------------------------------------------------------------------===//
615 //===----------------------------------------------------------------------===//
617 def : InstRW<[WLat1, FXb, EndGroup], (instregex "Serialize$")>;
619 def : InstRW<[WLat2LSU, WLat2LSU, FXb, LSU, NormalGr], (instregex "LAA(G)?$")>;
620 def : InstRW<[WLat2LSU, WLat2LSU, FXb, LSU, NormalGr], (instregex "LAAL(G)?$")>;
621 def : InstRW<[WLat2LSU, WLat2LSU, FXb, LSU, NormalGr], (instregex "LAN(G)?$")>;
622 def : InstRW<[WLat2LSU, WLat2LSU, FXb, LSU, NormalGr], (instregex "LAO(G)?$")>;
623 def : InstRW<[WLat2LSU, WLat2LSU, FXb, LSU, NormalGr], (instregex "LAX(G)?$")>;
626 def : InstRW<[WLat2LSU, FXb, LSU, EndGroup], (instregex "TS$")>;
629 def : InstRW<[WLat3LSU, WLat3LSU, FXa, FXb, LSU, GroupAlone],
630 (instregex "CS(G|Y)?$")>;
632 // Compare double and swap
633 def : InstRW<[WLat6LSU, WLat6LSU, FXa3, FXb2, LSU, GroupAlone2],
634 (instregex "CDS(Y)?$")>;
635 def : InstRW<[WLat15, WLat15, FXa2, FXb4, LSU3,
636 GroupAlone3], (instregex "CDSG$")>;
638 // Compare and swap and store
639 def : InstRW<[WLat30, MCD], (instregex "CSST$")>;
641 // Perform locked operation
642 def : InstRW<[WLat30, MCD], (instregex "PLO$")>;
644 // Load/store pair from/to quadword
645 def : InstRW<[WLat4LSU, LSU2, GroupAlone], (instregex "LPQ$")>;
646 def : InstRW<[WLat1, FXb2, LSU, GroupAlone], (instregex "STPQ$")>;
648 // Load pair disjoint
649 def : InstRW<[WLat1LSU, WLat1LSU, LSU2, GroupAlone], (instregex "LPD(G)?$")>;
651 //===----------------------------------------------------------------------===//
652 // Translate and convert
653 //===----------------------------------------------------------------------===//
655 def : InstRW<[WLat1, LSU5, GroupAlone], (instregex "TR$")>;
656 def : InstRW<[WLat30, WLat30, WLat30, FXa3, LSU2, GroupAlone2],
658 def : InstRW<[WLat30, WLat30, WLat30, MCD], (instregex "TRTR$")>;
659 def : InstRW<[WLat30, WLat30, MCD], (instregex "TRE$")>;
660 def : InstRW<[WLat30, WLat30, WLat30, MCD], (instregex "TRT(R)?E(Opt)?$")>;
661 def : InstRW<[WLat30, WLat30, WLat30, MCD], (instregex "TR(T|O)(T|O)(Opt)?$")>;
662 def : InstRW<[WLat30, WLat30, WLat30, MCD],
663 (instregex "CU(12|14|21|24|41|42)(Opt)?$")>;
664 def : InstRW<[WLat30, WLat30, WLat30, MCD], (instregex "(CUUTF|CUTFU)(Opt)?$")>;
666 //===----------------------------------------------------------------------===//
667 // Message-security assist
668 //===----------------------------------------------------------------------===//
670 def : InstRW<[WLat30, WLat30, WLat30, WLat30, MCD],
671 (instregex "KM(C|F|O|CTR|A)?$")>;
672 def : InstRW<[WLat30, WLat30, WLat30, MCD],
673 (instregex "(KIMD|KLMD|KMAC|KDSA)$")>;
674 def : InstRW<[WLat30, WLat30, WLat30, MCD],
675 (instregex "(PCC|PPNO|PRNO)$")>;
677 //===----------------------------------------------------------------------===//
679 //===----------------------------------------------------------------------===//
681 def : InstRW<[LSULatency, LSU, NormalGr], (instregex "LGG$")>;
682 def : InstRW<[LSULatency, LSU, NormalGr], (instregex "LLGFSG$")>;
683 def : InstRW<[WLat30, MCD], (instregex "(L|ST)GSC$")>;
685 //===----------------------------------------------------------------------===//
686 // Decimal arithmetic
687 //===----------------------------------------------------------------------===//
689 def : InstRW<[WLat20, RegReadAdv, FXb, VecDF2, LSU2, GroupAlone2],
690 (instregex "CVBG$")>;
691 def : InstRW<[WLat20, RegReadAdv, FXb, VecDF, LSU, GroupAlone2],
692 (instregex "CVB(Y)?$")>;
693 def : InstRW<[WLat1, FXb3, VecDF4, LSU, GroupAlone3], (instregex "CVDG$")>;
694 def : InstRW<[WLat1, FXb2, VecDF, LSU, GroupAlone2], (instregex "CVD(Y)?$")>;
695 def : InstRW<[WLat1, LSU5, GroupAlone], (instregex "MV(N|O|Z)$")>;
696 def : InstRW<[WLat1, LSU5, GroupAlone], (instregex "(PACK|PKA|PKU)$")>;
697 def : InstRW<[WLat12, LSU5, GroupAlone], (instregex "UNPK(A|U)$")>;
698 def : InstRW<[WLat1, FXb, LSU2, Cracked], (instregex "UNPK$")>;
700 def : InstRW<[WLat5LSU, FXb, VecDFX, LSU3, GroupAlone2],
701 (instregex "(A|S|ZA)P$")>;
702 def : InstRW<[WLat1, FXb, VecDFX2, LSU3, GroupAlone2], (instregex "MP$")>;
703 def : InstRW<[WLat1, FXb, VecDFX4, LSU3, GroupAlone2], (instregex "DP$")>;
704 def : InstRW<[WLat15, FXb, VecDFX2, LSU2, GroupAlone3], (instregex "SRP$")>;
705 def : InstRW<[WLat8, VecDFX, LSU, LSU, GroupAlone], (instregex "CP$")>;
706 def : InstRW<[WLat3LSU, VecDFX, LSU, Cracked], (instregex "TP$")>;
707 def : InstRW<[WLat30, MCD], (instregex "ED(MK)?$")>;
709 //===----------------------------------------------------------------------===//
711 //===----------------------------------------------------------------------===//
713 // Extract/set/copy access register
714 def : InstRW<[WLat3, LSU, NormalGr], (instregex "(EAR|SAR|CPYA)$")>;
716 // Load address extended
717 def : InstRW<[WLat5, LSU, FXa, Cracked], (instregex "LAE(Y)?$")>;
719 // Load/store access multiple (not modeled precisely)
720 def : InstRW<[WLat20, WLat20, LSU5, GroupAlone], (instregex "LAM(Y)?$")>;
721 def : InstRW<[WLat1, LSU5, FXb, GroupAlone2], (instregex "STAM(Y)?$")>;
723 //===----------------------------------------------------------------------===//
724 // Program mask and addressing mode
725 //===----------------------------------------------------------------------===//
727 // Insert Program Mask
728 def : InstRW<[WLat3, FXa, EndGroup], (instregex "IPM$")>;
731 def : InstRW<[WLat3, LSU, EndGroup], (instregex "SPM$")>;
734 def : InstRW<[WLat1, FXa2, FXb, GroupAlone], (instregex "BAL(R)?$")>;
736 // Test addressing mode
737 def : InstRW<[WLat1, FXb, NormalGr], (instregex "TAM$")>;
739 // Set addressing mode
740 def : InstRW<[WLat1, FXb, EndGroup], (instregex "SAM(24|31|64)$")>;
742 // Branch (and save) and set mode.
743 def : InstRW<[WLat1, FXa, FXb, GroupAlone], (instregex "BSM$")>;
744 def : InstRW<[WLat1, FXa2, FXb, GroupAlone], (instregex "BASSM$")>;
746 //===----------------------------------------------------------------------===//
747 // Transactional execution
748 //===----------------------------------------------------------------------===//
751 def : InstRW<[WLat9, LSU2, FXb5, GroupAlone2], (instregex "TBEGIN(C)?$")>;
754 def : InstRW<[WLat1, FXb, GroupAlone], (instregex "TEND$")>;
757 def : InstRW<[WLat30, MCD], (instregex "TABORT$")>;
759 // Extract Transaction Nesting Depth
760 def : InstRW<[WLat1, FXa, NormalGr], (instregex "ETND$")>;
762 // Nontransactional store
763 def : InstRW<[WLat1, FXb, LSU, NormalGr], (instregex "NTSTG$")>;
765 //===----------------------------------------------------------------------===//
767 //===----------------------------------------------------------------------===//
769 def : InstRW<[WLat1, FXb, GroupAlone], (instregex "PPA$")>;
771 //===----------------------------------------------------------------------===//
772 // Miscellaneous Instructions.
773 //===----------------------------------------------------------------------===//
776 def : InstRW<[WLat5, WLat5, FXa2, GroupAlone], (instregex "FLOGR$")>;
779 def : InstRW<[WLat3, WLat3, FXa, NormalGr], (instregex "POPCNT(Opt)?$")>;
781 // String instructions
782 def : InstRW<[WLat30, WLat30, WLat30, MCD], (instregex "SRST(U)?$")>;
783 def : InstRW<[WLat30, WLat30, WLat30, MCD], (instregex "CUSE$")>;
785 // Various complex instructions
786 def : InstRW<[WLat30, WLat30, WLat30, WLat30, MCD], (instregex "CFC$")>;
787 def : InstRW<[WLat30, WLat30, WLat30, WLat30, WLat30, WLat30, MCD],
789 def : InstRW<[WLat30, WLat30, WLat30, MCD], (instregex "CKSM$")>;
790 def : InstRW<[WLat30, WLat30, WLat30, WLat30, MCD], (instregex "CMPSC$")>;
791 def : InstRW<[WLat30, WLat30, WLat30, WLat30, MCD], (instregex "SORTL$")>;
792 def : InstRW<[WLat30, WLat30, WLat30, WLat30, MCD], (instregex "DFLTCC$")>;
793 def : InstRW<[WLat30, WLat30, MCD], (instregex "NNPA$")>;
796 def : InstRW<[WLat1, FXb, GroupAlone], (instregex "EX(RL)?$")>;
798 //===----------------------------------------------------------------------===//
799 // .insn directive instructions
800 //===----------------------------------------------------------------------===//
802 // An "empty" sched-class will be assigned instead of the "invalid sched-class".
803 // getNumDecoderSlots() will then return 1 instead of 0.
804 def : InstRW<[], (instregex "Insn.*")>;
807 // ----------------------------- Floating point ----------------------------- //
809 //===----------------------------------------------------------------------===//
810 // FP: Move instructions
811 //===----------------------------------------------------------------------===//
814 def : InstRW<[WLat1, FXb, NormalGr], (instregex "LZ(DR|ER)$")>;
815 def : InstRW<[WLat2, FXb2, Cracked], (instregex "LZXR$")>;
818 def : InstRW<[WLat2, VecXsPm, NormalGr], (instregex "LER$")>;
819 def : InstRW<[WLat1, FXb, NormalGr], (instregex "LD(R|R32|GR)$")>;
820 def : InstRW<[WLat3, FXb, NormalGr], (instregex "LGDR$")>;
821 def : InstRW<[WLat2, FXb2, GroupAlone], (instregex "LXR$")>;
824 def : InstRW<[WLat3, WLat3, VecXsPm, NormalGr], (instregex "LT(E|D)BR$")>;
825 def : InstRW<[WLat10, WLat10, VecDF4, GroupAlone], (instregex "LTXBR$")>;
828 def : InstRW<[WLat2, VecXsPm, NormalGr], (instregex "CPSDR(d|s)(d|s)$")>;
830 //===----------------------------------------------------------------------===//
831 // FP: Load instructions
832 //===----------------------------------------------------------------------===//
834 def : InstRW<[WLat2LSU, VecXsPm, LSU, NormalGr], (instregex "LE(Y)?$")>;
835 def : InstRW<[LSULatency, LSU, NormalGr], (instregex "LD(Y|E32)?$")>;
836 def : InstRW<[LSULatency, LSU, NormalGr], (instregex "LX$")>;
838 //===----------------------------------------------------------------------===//
839 // FP: Store instructions
840 //===----------------------------------------------------------------------===//
842 def : InstRW<[WLat1, FXb, LSU, NormalGr], (instregex "ST(E|D)(Y)?$")>;
843 def : InstRW<[WLat1, FXb, LSU, NormalGr], (instregex "STX$")>;
845 //===----------------------------------------------------------------------===//
846 // FP: Conversion instructions
847 //===----------------------------------------------------------------------===//
850 def : InstRW<[WLat6, VecBF, NormalGr], (instregex "LEDBR(A)?$")>;
851 def : InstRW<[WLat9, VecDF2, NormalGr], (instregex "L(E|D)XBR(A)?$")>;
854 def : InstRW<[WLat6LSU, VecBF, LSU, NormalGr], (instregex "LDEB$")>;
855 def : InstRW<[WLat6, VecBF, NormalGr], (instregex "LDEBR$")>;
856 def : InstRW<[WLat7LSU, VecBF4, LSU, GroupAlone], (instregex "LX(E|D)B$")>;
857 def : InstRW<[WLat7, VecBF4, GroupAlone], (instregex "LX(E|D)BR$")>;
859 // Convert from fixed / logical
860 def : InstRW<[WLat7, FXb, VecBF, Cracked], (instregex "C(E|D)(F|G)BR(A)?$")>;
861 def : InstRW<[WLat11, FXb, VecDF4, GroupAlone2], (instregex "CX(F|G)BR(A)?$")>;
862 def : InstRW<[WLat7, FXb, VecBF, Cracked], (instregex "C(E|D)L(F|G)BR$")>;
863 def : InstRW<[WLat11, FXb, VecDF4, GroupAlone2], (instregex "CXL(F|G)BR$")>;
865 // Convert to fixed / logical
866 def : InstRW<[WLat9, WLat9, FXb, VecBF, Cracked],
867 (instregex "C(F|G)(E|D)BR(A)?$")>;
868 def : InstRW<[WLat12, WLat12, FXb, VecDF2, Cracked],
869 (instregex "C(F|G)XBR(A)?$")>;
870 def : InstRW<[WLat9, WLat9, FXb, VecBF, GroupAlone], (instregex "CLFEBR$")>;
871 def : InstRW<[WLat9, WLat9, FXb, VecBF, Cracked], (instregex "CLFDBR$")>;
872 def : InstRW<[WLat9, WLat9, FXb, VecBF, Cracked], (instregex "CLG(E|D)BR$")>;
873 def : InstRW<[WLat12, WLat12, FXb, VecDF2, Cracked], (instregex "CL(F|G)XBR$")>;
875 //===----------------------------------------------------------------------===//
876 // FP: Unary arithmetic
877 //===----------------------------------------------------------------------===//
879 // Load Complement / Negative / Positive
880 def : InstRW<[WLat3, WLat3, VecXsPm, NormalGr], (instregex "L(C|N|P)(E|D)BR$")>;
881 def : InstRW<[WLat1, FXb, NormalGr], (instregex "L(C|N|P)DFR(_32)?$")>;
882 def : InstRW<[WLat10, WLat10, VecDF4, GroupAlone], (instregex "L(C|N|P)XBR$")>;
885 def : InstRW<[WLat30, VecFPd, LSU, NormalGr], (instregex "SQ(E|D)B$")>;
886 def : InstRW<[WLat20, VecFPd20, NormalGr], (instregex "SQEBR$")>;
887 def : InstRW<[WLat30, VecFPd, NormalGr], (instregex "SQDBR$")>;
888 def : InstRW<[WLat30, VecFPd, GroupAlone], (instregex "SQXBR$")>;
891 def : InstRW<[WLat6, VecBF, NormalGr], (instregex "FI(E|D)BR(A)?$")>;
892 def : InstRW<[WLat10, VecDF4, GroupAlone], (instregex "FIXBR(A)?$")>;
894 //===----------------------------------------------------------------------===//
895 // FP: Binary arithmetic
896 //===----------------------------------------------------------------------===//
899 def : InstRW<[WLat6LSU, WLat6LSU, RegReadAdv, VecBF, LSU, NormalGr],
900 (instregex "A(E|D)B$")>;
901 def : InstRW<[WLat6, WLat6, VecBF, NormalGr], (instregex "A(E|D)BR$")>;
902 def : InstRW<[WLat10, WLat10, VecDF4, GroupAlone], (instregex "AXBR$")>;
905 def : InstRW<[WLat6LSU, WLat6LSU, RegReadAdv, VecBF, LSU, NormalGr],
906 (instregex "S(E|D)B$")>;
907 def : InstRW<[WLat6, WLat6, VecBF, NormalGr], (instregex "S(E|D)BR$")>;
908 def : InstRW<[WLat10, WLat10, VecDF4, GroupAlone], (instregex "SXBR$")>;
911 def : InstRW<[WLat6LSU, RegReadAdv, VecBF, LSU, NormalGr],
912 (instregex "M(D|DE|EE)B$")>;
913 def : InstRW<[WLat6, VecBF, NormalGr], (instregex "M(D|DE|EE)BR$")>;
914 def : InstRW<[WLat7LSU, RegReadAdv, VecBF4, LSU, GroupAlone],
915 (instregex "MXDB$")>;
916 def : InstRW<[WLat7, VecBF4, GroupAlone], (instregex "MXDBR$")>;
917 def : InstRW<[WLat20, VecDF4, GroupAlone], (instregex "MXBR$")>;
919 // Multiply and add / subtract
920 def : InstRW<[WLat6LSU, RegReadAdv, RegReadAdv, VecBF2, LSU, GroupAlone],
921 (instregex "M(A|S)EB$")>;
922 def : InstRW<[WLat6, VecBF, GroupAlone], (instregex "M(A|S)EBR$")>;
923 def : InstRW<[WLat6LSU, RegReadAdv, RegReadAdv, VecBF2, LSU, GroupAlone],
924 (instregex "M(A|S)DB$")>;
925 def : InstRW<[WLat6, VecBF, NormalGr], (instregex "M(A|S)DBR$")>;
928 def : InstRW<[WLat20, RegReadAdv, VecFPd20, LSU, NormalGr], (instregex "DEB$")>;
929 def : InstRW<[WLat30, RegReadAdv, VecFPd, LSU, NormalGr], (instregex "DDB$")>;
930 def : InstRW<[WLat20, VecFPd20, NormalGr], (instregex "DEBR$")>;
931 def : InstRW<[WLat30, VecFPd, NormalGr], (instregex "DDBR$")>;
932 def : InstRW<[WLat30, VecFPd, GroupAlone], (instregex "DXBR$")>;
935 def : InstRW<[WLat30, WLat30, WLat30, MCD], (instregex "DI(E|D)BR$")>;
937 //===----------------------------------------------------------------------===//
939 //===----------------------------------------------------------------------===//
942 def : InstRW<[WLat3LSU, RegReadAdv, VecXsPm, LSU, NormalGr],
943 (instregex "(K|C)(E|D)B$")>;
944 def : InstRW<[WLat3, VecXsPm, NormalGr], (instregex "(K|C)(E|D)BR$")>;
945 def : InstRW<[WLat9, VecDF2, GroupAlone], (instregex "(K|C)XBR$")>;
948 def : InstRW<[WLat5, LSU, VecXsPm, NormalGr], (instregex "TC(E|D)B$")>;
949 def : InstRW<[WLat10, LSU, VecDF4, GroupAlone], (instregex "TCXB$")>;
951 //===----------------------------------------------------------------------===//
952 // FP: Floating-point control register instructions
953 //===----------------------------------------------------------------------===//
955 def : InstRW<[WLat4, FXa, LSU, GroupAlone], (instregex "EFPC$")>;
956 def : InstRW<[WLat1, FXb, LSU, GroupAlone], (instregex "STFPC$")>;
957 def : InstRW<[WLat3, LSU, GroupAlone], (instregex "SFPC$")>;
958 def : InstRW<[WLat3LSU, LSU2, GroupAlone], (instregex "LFPC$")>;
959 def : InstRW<[WLat30, MCD], (instregex "SFASR$")>;
960 def : InstRW<[WLat30, MCD], (instregex "LFAS$")>;
961 def : InstRW<[WLat3, FXb, GroupAlone], (instregex "SRNM(B|T)?$")>;
964 // --------------------- Hexadecimal floating point ------------------------- //
966 //===----------------------------------------------------------------------===//
967 // HFP: Move instructions
968 //===----------------------------------------------------------------------===//
971 def : InstRW<[WLat3, WLat3, VecXsPm, NormalGr], (instregex "LT(E|D)R$")>;
972 def : InstRW<[WLat10, WLat10, VecDF4, GroupAlone], (instregex "LTXR$")>;
974 //===----------------------------------------------------------------------===//
975 // HFP: Conversion instructions
976 //===----------------------------------------------------------------------===//
979 def : InstRW<[WLat6, VecBF, NormalGr], (instregex "(LEDR|LRER)$")>;
980 def : InstRW<[WLat6, VecBF, NormalGr], (instregex "LEXR$")>;
981 def : InstRW<[WLat9, VecDF2, NormalGr], (instregex "(LDXR|LRDR)$")>;
984 def : InstRW<[LSULatency, LSU, NormalGr], (instregex "LDE$")>;
985 def : InstRW<[WLat1, FXb, NormalGr], (instregex "LDER$")>;
986 def : InstRW<[WLat7LSU, VecBF4, LSU, GroupAlone], (instregex "LX(E|D)$")>;
987 def : InstRW<[WLat7, VecBF4, GroupAlone], (instregex "LX(E|D)R$")>;
989 // Convert from fixed
990 def : InstRW<[WLat7, FXb, VecBF, Cracked], (instregex "C(E|D)(F|G)R$")>;
991 def : InstRW<[WLat11, FXb, VecDF4, GroupAlone2], (instregex "CX(F|G)R$")>;
994 def : InstRW<[WLat9, WLat9, FXb, VecBF, Cracked], (instregex "C(F|G)(E|D)R$")>;
995 def : InstRW<[WLat12, WLat12, FXb, VecDF2, Cracked], (instregex "C(F|G)XR$")>;
997 // Convert BFP to HFP / HFP to BFP.
998 def : InstRW<[WLat6, WLat6, VecBF, NormalGr], (instregex "THD(E)?R$")>;
999 def : InstRW<[WLat6, WLat6, VecBF, NormalGr], (instregex "TB(E)?DR$")>;
1001 //===----------------------------------------------------------------------===//
1002 // HFP: Unary arithmetic
1003 //===----------------------------------------------------------------------===//
1005 // Load Complement / Negative / Positive
1006 def : InstRW<[WLat3, WLat3, VecXsPm, NormalGr], (instregex "L(C|N|P)(E|D)R$")>;
1007 def : InstRW<[WLat10, WLat10, VecDF4, GroupAlone], (instregex "L(C|N|P)XR$")>;
1010 def : InstRW<[WLat6, VecBF, NormalGr], (instregex "H(E|D)R$")>;
1013 def : InstRW<[WLat30, VecFPd, LSU, NormalGr], (instregex "SQ(E|D)$")>;
1014 def : InstRW<[WLat20, VecFPd20, NormalGr], (instregex "SQER$")>;
1015 def : InstRW<[WLat30, VecFPd, NormalGr], (instregex "SQDR$")>;
1016 def : InstRW<[WLat30, VecFPd, GroupAlone], (instregex "SQXR$")>;
1019 def : InstRW<[WLat6, VecBF, NormalGr], (instregex "FI(E|D)R$")>;
1020 def : InstRW<[WLat10, VecDF4, GroupAlone], (instregex "FIXR$")>;
1022 //===----------------------------------------------------------------------===//
1023 // HFP: Binary arithmetic
1024 //===----------------------------------------------------------------------===//
1027 def : InstRW<[WLat6LSU, WLat6LSU, RegReadAdv, VecBF, LSU, NormalGr],
1028 (instregex "A(E|D|U|W)$")>;
1029 def : InstRW<[WLat6, WLat6, VecBF, NormalGr], (instregex "A(E|D|U|W)R$")>;
1030 def : InstRW<[WLat10, WLat10, VecDF4, GroupAlone], (instregex "AXR$")>;
1033 def : InstRW<[WLat6LSU, WLat6LSU, RegReadAdv, VecBF, LSU, NormalGr],
1034 (instregex "S(E|D|U|W)$")>;
1035 def : InstRW<[WLat6, WLat6, VecBF, NormalGr], (instregex "S(E|D|U|W)R$")>;
1036 def : InstRW<[WLat10, WLat10, VecDF4, GroupAlone], (instregex "SXR$")>;
1039 def : InstRW<[WLat6LSU, RegReadAdv, VecBF, LSU, NormalGr],
1040 (instregex "M(D|DE|E|EE)$")>;
1041 def : InstRW<[WLat6, VecBF, NormalGr], (instregex "M(D|DE|E|EE)R$")>;
1042 def : InstRW<[WLat7LSU, RegReadAdv, VecBF4, LSU, GroupAlone],
1043 (instregex "MXD$")>;
1044 def : InstRW<[WLat7, VecBF4, GroupAlone], (instregex "MXDR$")>;
1045 def : InstRW<[WLat20, VecDF4, GroupAlone], (instregex "MXR$")>;
1046 def : InstRW<[WLat7LSU, RegReadAdv, VecBF4, LSU, GroupAlone], (instregex "MY$")>;
1047 def : InstRW<[WLat6LSU, RegReadAdv, VecBF2, LSU, GroupAlone],
1048 (instregex "MY(H|L)$")>;
1049 def : InstRW<[WLat7, VecBF4, GroupAlone], (instregex "MYR$")>;
1050 def : InstRW<[WLat6, VecBF, GroupAlone], (instregex "MY(H|L)R$")>;
1052 // Multiply and add / subtract
1053 def : InstRW<[WLat6LSU, RegReadAdv, RegReadAdv, VecBF2, LSU, GroupAlone],
1054 (instregex "M(A|S)(E|D)$")>;
1055 def : InstRW<[WLat6, VecBF, GroupAlone], (instregex "M(A|S)(E|D)R$")>;
1056 def : InstRW<[WLat7LSU, RegReadAdv, RegReadAdv, VecBF4, LSU, GroupAlone],
1057 (instregex "MAY$")>;
1058 def : InstRW<[WLat6LSU, RegReadAdv, RegReadAdv, VecBF2, LSU, GroupAlone],
1059 (instregex "MAY(H|L)$")>;
1060 def : InstRW<[WLat7, VecBF4, GroupAlone], (instregex "MAYR$")>;
1061 def : InstRW<[WLat6, VecBF, GroupAlone], (instregex "MAY(H|L)R$")>;
1064 def : InstRW<[WLat20, RegReadAdv, VecFPd20, LSU, NormalGr], (instregex "DE$")>;
1065 def : InstRW<[WLat30, RegReadAdv, VecFPd, LSU, NormalGr], (instregex "DD$")>;
1066 def : InstRW<[WLat20, VecFPd20, NormalGr], (instregex "DER$")>;
1067 def : InstRW<[WLat30, VecFPd, NormalGr], (instregex "DDR$")>;
1068 def : InstRW<[WLat30, VecFPd, GroupAlone], (instregex "DXR$")>;
1070 //===----------------------------------------------------------------------===//
1072 //===----------------------------------------------------------------------===//
1075 def : InstRW<[WLat6LSU, RegReadAdv, VecBF, LSU, NormalGr],
1076 (instregex "C(E|D)$")>;
1077 def : InstRW<[WLat6, VecBF, NormalGr], (instregex "C(E|D)R$")>;
1078 def : InstRW<[WLat10, VecDF2, GroupAlone], (instregex "CXR$")>;
1081 // ------------------------ Decimal floating point -------------------------- //
1083 //===----------------------------------------------------------------------===//
1084 // DFP: Move instructions
1085 //===----------------------------------------------------------------------===//
1088 def : InstRW<[WLat8, WLat8, VecDF, NormalGr], (instregex "LTDTR$")>;
1089 def : InstRW<[WLat10, WLat10, VecDF4, GroupAlone], (instregex "LTXTR$")>;
1091 //===----------------------------------------------------------------------===//
1092 // DFP: Conversion instructions
1093 //===----------------------------------------------------------------------===//
1096 def : InstRW<[WLat15, VecDF, NormalGr], (instregex "LEDTR$")>;
1097 def : InstRW<[WLat15, VecDF2, NormalGr], (instregex "LDXTR$")>;
1100 def : InstRW<[WLat8, VecDF, NormalGr], (instregex "LDETR$")>;
1101 def : InstRW<[WLat10, VecDF4, GroupAlone], (instregex "LXDTR$")>;
1103 // Convert from fixed / logical
1104 def : InstRW<[WLat15, FXb, VecDF, Cracked], (instregex "CDFTR(A)?$")>;
1105 def : InstRW<[WLat20, FXb, VecDF, Cracked], (instregex "CDGTR(A)?$")>;
1106 def : InstRW<[WLat15, FXb, VecDF4, GroupAlone2], (instregex "CXFTR(A)?$")>;
1107 def : InstRW<[WLat20, FXb, VecDF4, GroupAlone2], (instregex "CXGTR(A)?$")>;
1108 def : InstRW<[WLat15, FXb, VecDF, Cracked], (instregex "CDLFTR$")>;
1109 def : InstRW<[WLat20, FXb, VecDF, Cracked], (instregex "CDLGTR$")>;
1110 def : InstRW<[WLat15, FXb, VecDF4, GroupAlone2], (instregex "CXLFTR$")>;
1111 def : InstRW<[WLat20, FXb, VecDF4, GroupAlone2], (instregex "CXLGTR$")>;
1113 // Convert to fixed / logical
1114 def : InstRW<[WLat20, WLat20, FXb, VecDF, Cracked],
1115 (instregex "C(F|G)DTR(A)?$")>;
1116 def : InstRW<[WLat20, WLat20, FXb, VecDF2, Cracked],
1117 (instregex "C(F|G)XTR(A)?$")>;
1118 def : InstRW<[WLat20, WLat20, FXb, VecDF, Cracked], (instregex "CL(F|G)DTR$")>;
1119 def : InstRW<[WLat20, WLat20, FXb, VecDF2, Cracked], (instregex "CL(F|G)XTR$")>;
1121 // Convert from / to signed / unsigned packed
1122 def : InstRW<[WLat9, FXb, VecDF, Cracked], (instregex "CD(S|U)TR$")>;
1123 def : InstRW<[WLat12, FXb2, VecDF4, GroupAlone2], (instregex "CX(S|U)TR$")>;
1124 def : InstRW<[WLat11, FXb, VecDF, Cracked], (instregex "C(S|U)DTR$")>;
1125 def : InstRW<[WLat15, FXb2, VecDF4, GroupAlone2], (instregex "C(S|U)XTR$")>;
1127 // Convert from / to zoned
1128 def : InstRW<[WLat8LSU, LSU, VecDF, Cracked], (instregex "CDZT$")>;
1129 def : InstRW<[WLat16LSU, LSU2, VecDF4, GroupAlone3], (instregex "CXZT$")>;
1130 def : InstRW<[WLat1, FXb, LSU, VecDF, Cracked], (instregex "CZDT$")>;
1131 def : InstRW<[WLat1, FXb, LSU, VecDF2, GroupAlone], (instregex "CZXT$")>;
1133 // Convert from / to packed
1134 def : InstRW<[WLat8LSU, LSU, VecDF, Cracked], (instregex "CDPT$")>;
1135 def : InstRW<[WLat16LSU, LSU2, VecDF4, GroupAlone3], (instregex "CXPT$")>;
1136 def : InstRW<[WLat1, FXb, LSU, VecDF, Cracked], (instregex "CPDT$")>;
1137 def : InstRW<[WLat1, FXb, LSU, VecDF2, GroupAlone], (instregex "CPXT$")>;
1139 // Perform floating-point operation
1140 def : InstRW<[WLat30, WLat30, WLat30, MCD], (instregex "PFPO$")>;
1142 //===----------------------------------------------------------------------===//
1143 // DFP: Unary arithmetic
1144 //===----------------------------------------------------------------------===//
1147 def : InstRW<[WLat8, VecDF, NormalGr], (instregex "FIDTR$")>;
1148 def : InstRW<[WLat10, VecDF4, GroupAlone], (instregex "FIXTR$")>;
1150 // Extract biased exponent
1151 def : InstRW<[WLat11, FXb, VecDF, Cracked], (instregex "EEDTR$")>;
1152 def : InstRW<[WLat11, FXb, VecDF, Cracked], (instregex "EEXTR$")>;
1154 // Extract significance
1155 def : InstRW<[WLat11, FXb, VecDF, Cracked], (instregex "ESDTR$")>;
1156 def : InstRW<[WLat12, FXb, VecDF2, Cracked], (instregex "ESXTR$")>;
1158 //===----------------------------------------------------------------------===//
1159 // DFP: Binary arithmetic
1160 //===----------------------------------------------------------------------===//
1163 def : InstRW<[WLat8, WLat8, VecDF, NormalGr], (instregex "ADTR(A)?$")>;
1164 def : InstRW<[WLat10, WLat10, VecDF4, GroupAlone], (instregex "AXTR(A)?$")>;
1167 def : InstRW<[WLat8, WLat8, VecDF, NormalGr], (instregex "SDTR(A)?$")>;
1168 def : InstRW<[WLat10, WLat10, VecDF4, GroupAlone], (instregex "SXTR(A)?$")>;
1171 def : InstRW<[WLat20, VecDF, NormalGr], (instregex "MDTR(A)?$")>;
1172 def : InstRW<[WLat30, VecDF4, GroupAlone], (instregex "MXTR(A)?$")>;
1175 def : InstRW<[WLat30, VecDF, NormalGr], (instregex "DDTR(A)?$")>;
1176 def : InstRW<[WLat30, VecDF4, GroupAlone], (instregex "DXTR(A)?$")>;
1179 def : InstRW<[WLat8, WLat8, VecDF, NormalGr], (instregex "QADTR$")>;
1180 def : InstRW<[WLat10, WLat10, VecDF4, GroupAlone], (instregex "QAXTR$")>;
1183 def : InstRW<[WLat9, WLat9, FXb, VecDF, Cracked], (instregex "RRDTR$")>;
1184 def : InstRW<[WLat11, WLat11, FXb, VecDF4, GroupAlone2], (instregex "RRXTR$")>;
1186 // Shift significand left/right
1187 def : InstRW<[WLat11LSU, LSU, VecDF, GroupAlone], (instregex "S(L|R)DT$")>;
1188 def : InstRW<[WLat11LSU, LSU, VecDF4, GroupAlone], (instregex "S(L|R)XT$")>;
1190 // Insert biased exponent
1191 def : InstRW<[WLat9, FXb, VecDF, Cracked], (instregex "IEDTR$")>;
1192 def : InstRW<[WLat11, FXb, VecDF4, GroupAlone2], (instregex "IEXTR$")>;
1194 //===----------------------------------------------------------------------===//
1196 //===----------------------------------------------------------------------===//
1199 def : InstRW<[WLat8, VecDF, NormalGr], (instregex "(K|C)DTR$")>;
1200 def : InstRW<[WLat9, VecDF2, GroupAlone], (instregex "(K|C)XTR$")>;
1202 // Compare biased exponent
1203 def : InstRW<[WLat8, VecDF, NormalGr], (instregex "CEDTR$")>;
1204 def : InstRW<[WLat8, VecDF, NormalGr], (instregex "CEXTR$")>;
1206 // Test Data Class/Group
1207 def : InstRW<[WLat15, LSU, VecDF, NormalGr], (instregex "TD(C|G)(E|D)T$")>;
1208 def : InstRW<[WLat15, LSU, VecDF2, GroupAlone], (instregex "TD(C|G)XT$")>;
1211 // --------------------------------- Vector --------------------------------- //
1213 //===----------------------------------------------------------------------===//
1214 // Vector: Move instructions
1215 //===----------------------------------------------------------------------===//
1217 def : InstRW<[WLat1, FXb, NormalGr], (instregex "VLR(32|64)?$")>;
1218 def : InstRW<[WLat3, FXb, NormalGr], (instregex "VLGV(B|F|G|H)?$")>;
1219 def : InstRW<[WLat1, FXb, NormalGr], (instregex "VLVG(B|F|G|H)?$")>;
1220 def : InstRW<[WLat3, FXb, NormalGr], (instregex "VLVGP(32)?$")>;
1222 //===----------------------------------------------------------------------===//
1223 // Vector: Immediate instructions
1224 //===----------------------------------------------------------------------===//
1226 def : InstRW<[WLat2, VecXsPm, NormalGr], (instregex "VZERO$")>;
1227 def : InstRW<[WLat2, VecXsPm, NormalGr], (instregex "VONE$")>;
1228 def : InstRW<[WLat2, VecXsPm, NormalGr], (instregex "VGBM$")>;
1229 def : InstRW<[WLat2, VecXsPm, NormalGr], (instregex "VGM(B|F|G|H)?$")>;
1230 def : InstRW<[WLat2, VecXsPm, NormalGr], (instregex "VREPI(B|F|G|H)?$")>;
1231 def : InstRW<[WLat2, VecXsPm, NormalGr], (instregex "VLEI(B|F|G|H)$")>;
1233 //===----------------------------------------------------------------------===//
1235 //===----------------------------------------------------------------------===//
1237 def : InstRW<[LSULatency, LSU, NormalGr], (instregex "VL(Align)?$")>;
1238 def : InstRW<[LSULatency, LSU, NormalGr], (instregex "VL(L|BB)$")>;
1239 def : InstRW<[LSULatency, LSU, NormalGr], (instregex "VL(32|64)$")>;
1240 def : InstRW<[LSULatency, LSU, NormalGr], (instregex "VLLEZ(B|F|G|H|LF)?$")>;
1241 def : InstRW<[LSULatency, LSU, NormalGr], (instregex "VLREP(B|F|G|H)?$")>;
1242 def : InstRW<[WLat2LSU, RegReadAdv, VecXsPm, LSU, NormalGr],
1243 (instregex "VLE(B|F|G|H)$")>;
1244 def : InstRW<[WLat5LSU, RegReadAdv, FXb, LSU, VecXsPm, Cracked],
1245 (instregex "VGE(F|G)$")>;
1246 def : InstRW<[WLat4LSU, WLat4LSU, LSU5, GroupAlone],
1247 (instregex "VLM(Align)?$")>;
1248 def : InstRW<[LSULatency, LSU, NormalGr], (instregex "VLRL(R)?$")>;
1250 //===----------------------------------------------------------------------===//
1252 //===----------------------------------------------------------------------===//
1254 def : InstRW<[WLat1, FXb, LSU, NormalGr], (instregex "VST(Align|L|32|64)?$")>;
1255 def : InstRW<[WLat1, FXb, LSU, NormalGr], (instregex "VSTE(F|G)$")>;
1256 def : InstRW<[WLat1, FXb, LSU, VecXsPm, Cracked], (instregex "VSTE(B|H)$")>;
1257 def : InstRW<[WLat1, LSU2, FXb3, GroupAlone2], (instregex "VSTM(Align)?$")>;
1258 def : InstRW<[WLat1, FXb2, LSU, Cracked], (instregex "VSCE(F|G)$")>;
1259 def : InstRW<[WLat1, FXb, LSU, NormalGr], (instregex "VSTRL(R)?$")>;
1261 //===----------------------------------------------------------------------===//
1262 // Vector: Byte swaps
1263 //===----------------------------------------------------------------------===//
1265 def : InstRW<[LSULatency, LSU, NormalGr], (instregex "VLBR(H|F|G|Q)?$")>;
1266 def : InstRW<[LSULatency, LSU, NormalGr], (instregex "VLER(H|F|G)?$")>;
1267 def : InstRW<[WLat2LSU, RegReadAdv, VecXsPm, LSU, NormalGr],
1268 (instregex "VLEBR(H|F|G)$")>;
1269 def : InstRW<[LSULatency, LSU, NormalGr], (instregex "VLLEBRZ(H|F|G|E)?$")>;
1270 def : InstRW<[LSULatency, LSU, NormalGr], (instregex "VLBRREP(H|F|G)?$")>;
1271 def : InstRW<[WLat1, FXb, LSU, NormalGr], (instregex "VSTBR(H|F|G|Q)?$")>;
1272 def : InstRW<[WLat1, FXb, LSU, NormalGr], (instregex "VSTER(H|F|G)?$")>;
1273 def : InstRW<[WLat1, FXb, LSU, VecXsPm, Cracked], (instregex "VSTEBRH$")>;
1274 def : InstRW<[WLat1, FXb, LSU, NormalGr], (instregex "VSTEBR(F|G)$")>;
1276 //===----------------------------------------------------------------------===//
1277 // Vector: Selects and permutes
1278 //===----------------------------------------------------------------------===//
1280 def : InstRW<[WLat2, VecXsPm, NormalGr], (instregex "VMRH(B|F|G|H)?$")>;
1281 def : InstRW<[WLat2, VecXsPm, NormalGr], (instregex "VMRL(B|F|G|H)?$")>;
1282 def : InstRW<[WLat2, VecXsPm, NormalGr], (instregex "VPERM$")>;
1283 def : InstRW<[WLat2, VecXsPm, NormalGr], (instregex "VPDI$")>;
1284 def : InstRW<[WLat2, VecXsPm, NormalGr], (instregex "VBPERM$")>;
1285 def : InstRW<[WLat2, VecXsPm, NormalGr], (instregex "VREP(B|F|G|H)?$")>;
1286 def : InstRW<[WLat2, VecXsPm, NormalGr], (instregex "VSEL$")>;
1288 //===----------------------------------------------------------------------===//
1289 // Vector: Widening and narrowing
1290 //===----------------------------------------------------------------------===//
1292 def : InstRW<[WLat2, VecXsPm, NormalGr], (instregex "VPK(F|G|H)?$")>;
1293 def : InstRW<[WLat2, VecXsPm, NormalGr], (instregex "VPKS(F|G|H)?$")>;
1294 def : InstRW<[WLat3, WLat3, VecXsPm, NormalGr], (instregex "VPKS(F|G|H)S$")>;
1295 def : InstRW<[WLat2, VecXsPm, NormalGr], (instregex "VPKLS(F|G|H)?$")>;
1296 def : InstRW<[WLat3, WLat3, VecXsPm, NormalGr], (instregex "VPKLS(F|G|H)S$")>;
1297 def : InstRW<[WLat2, VecXsPm, NormalGr], (instregex "VSEG(B|F|H)?$")>;
1298 def : InstRW<[WLat2, VecXsPm, NormalGr], (instregex "VUPH(B|F|H)?$")>;
1299 def : InstRW<[WLat2, VecXsPm, NormalGr], (instregex "VUPL(B|F)?$")>;
1300 def : InstRW<[WLat2, VecXsPm, NormalGr], (instregex "VUPLH(B|F|H|W)?$")>;
1301 def : InstRW<[WLat2, VecXsPm, NormalGr], (instregex "VUPLL(B|F|H)?$")>;
1303 //===----------------------------------------------------------------------===//
1304 // Vector: Integer arithmetic
1305 //===----------------------------------------------------------------------===//
1307 def : InstRW<[WLat2, VecXsPm, NormalGr], (instregex "VA(B|F|G|H|Q|C|CQ)?$")>;
1308 def : InstRW<[WLat2, VecXsPm, NormalGr], (instregex "VACC(B|F|G|H|Q|C|CQ)?$")>;
1309 def : InstRW<[WLat2, VecXsPm, NormalGr], (instregex "VAVG(B|F|G|H)?$")>;
1310 def : InstRW<[WLat2, VecXsPm, NormalGr], (instregex "VAVGL(B|F|G|H)?$")>;
1311 def : InstRW<[WLat2, VecXsPm, NormalGr], (instregex "VN(C|O|N|X)?$")>;
1312 def : InstRW<[WLat2, VecXsPm, NormalGr], (instregex "VO(C)?$")>;
1313 def : InstRW<[WLat4, VecMul, NormalGr], (instregex "VCKSM$")>;
1314 def : InstRW<[WLat2, VecXsPm, NormalGr], (instregex "VCLZ(B|F|G|H)?$")>;
1315 def : InstRW<[WLat2, VecXsPm, NormalGr], (instregex "VCTZ(B|F|G|H)?$")>;
1316 def : InstRW<[WLat2, VecXsPm, NormalGr], (instregex "VX$")>;
1317 def : InstRW<[WLat4, VecMul, NormalGr], (instregex "VGFM?$")>;
1318 def : InstRW<[WLat4, VecMul, NormalGr], (instregex "VGFMA(B|F|G|H)?$")>;
1319 def : InstRW<[WLat4, VecMul, NormalGr], (instregex "VGFM(B|F|G|H)$")>;
1320 def : InstRW<[WLat2, VecXsPm, NormalGr], (instregex "VLC(B|F|G|H)?$")>;
1321 def : InstRW<[WLat2, VecXsPm, NormalGr], (instregex "VLP(B|F|G|H)?$")>;
1322 def : InstRW<[WLat2, VecXsPm, NormalGr], (instregex "VMX(B|F|G|H)?$")>;
1323 def : InstRW<[WLat2, VecXsPm, NormalGr], (instregex "VMXL(B|F|G|H)?$")>;
1324 def : InstRW<[WLat2, VecXsPm, NormalGr], (instregex "VMN(B|F|G|H)?$")>;
1325 def : InstRW<[WLat2, VecXsPm, NormalGr], (instregex "VMNL(B|F|G|H)?$")>;
1326 def : InstRW<[WLat4, VecMul, NormalGr], (instregex "VMAL(B|F)?$")>;
1327 def : InstRW<[WLat4, VecMul, NormalGr], (instregex "VMALE(B|F|H)?$")>;
1328 def : InstRW<[WLat4, VecMul, NormalGr], (instregex "VMALH(B|F|H|W)?$")>;
1329 def : InstRW<[WLat4, VecMul, NormalGr], (instregex "VMALO(B|F|H)?$")>;
1330 def : InstRW<[WLat4, VecMul, NormalGr], (instregex "VMAO(B|F|H)?$")>;
1331 def : InstRW<[WLat4, VecMul, NormalGr], (instregex "VMAE(B|F|H)?$")>;
1332 def : InstRW<[WLat4, VecMul, NormalGr], (instregex "VMAH(B|F|H)?$")>;
1333 def : InstRW<[WLat4, VecMul, NormalGr], (instregex "VME(B|F|H)?$")>;
1334 def : InstRW<[WLat4, VecMul, NormalGr], (instregex "VMH(B|F|H)?$")>;
1335 def : InstRW<[WLat4, VecMul, NormalGr], (instregex "VML(B|F)?$")>;
1336 def : InstRW<[WLat4, VecMul, NormalGr], (instregex "VMLE(B|F|H)?$")>;
1337 def : InstRW<[WLat4, VecMul, NormalGr], (instregex "VMLH(B|F|H|W)?$")>;
1338 def : InstRW<[WLat4, VecMul, NormalGr], (instregex "VMLO(B|F|H)?$")>;
1339 def : InstRW<[WLat4, VecMul, NormalGr], (instregex "VMO(B|F|H)?$")>;
1340 def : InstRW<[WLat6, VecBF, NormalGr], (instregex "VMSL(G)?$")>;
1342 def : InstRW<[WLat2, VecXsPm, NormalGr], (instregex "VPOPCT(B|F|G|H)?$")>;
1344 def : InstRW<[WLat2, VecXsPm, NormalGr], (instregex "VERLL(B|F|G|H)?$")>;
1345 def : InstRW<[WLat2, VecXsPm, NormalGr], (instregex "VERLLV(B|F|G|H)?$")>;
1346 def : InstRW<[WLat2, VecXsPm, NormalGr], (instregex "VERIM(B|F|G|H)?$")>;
1347 def : InstRW<[WLat2, VecXsPm, NormalGr], (instregex "VESL(B|F|G|H)?$")>;
1348 def : InstRW<[WLat2, VecXsPm, NormalGr], (instregex "VESLV(B|F|G|H)?$")>;
1349 def : InstRW<[WLat2, VecXsPm, NormalGr], (instregex "VESRA(B|F|G|H)?$")>;
1350 def : InstRW<[WLat2, VecXsPm, NormalGr], (instregex "VESRAV(B|F|G|H)?$")>;
1351 def : InstRW<[WLat2, VecXsPm, NormalGr], (instregex "VESRL(B|F|G|H)?$")>;
1352 def : InstRW<[WLat2, VecXsPm, NormalGr], (instregex "VESRLV(B|F|G|H)?$")>;
1354 def : InstRW<[WLat2, VecXsPm, NormalGr], (instregex "VSL(DB)?$")>;
1355 def : InstRW<[WLat2, VecXsPm, NormalGr], (instregex "VSLB$")>;
1356 def : InstRW<[WLat2, VecXsPm, NormalGr], (instregex "VSR(A|L)$")>;
1357 def : InstRW<[WLat2, VecXsPm, NormalGr], (instregex "VSR(A|L)B$")>;
1358 def : InstRW<[WLat2, VecXsPm, NormalGr], (instregex "VSLD$")>;
1359 def : InstRW<[WLat2, VecXsPm, NormalGr], (instregex "VSRD$")>;
1361 def : InstRW<[WLat2, VecXsPm, NormalGr], (instregex "VSB(I|IQ|CBI|CBIQ)?$")>;
1362 def : InstRW<[WLat2, VecXsPm, NormalGr], (instregex "VSCBI(B|F|G|H|Q)?$")>;
1363 def : InstRW<[WLat2, VecXsPm, NormalGr], (instregex "VS(F|G|H|Q)?$")>;
1365 def : InstRW<[WLat4, VecMul, NormalGr], (instregex "VSUM(B|H)?$")>;
1366 def : InstRW<[WLat4, VecMul, NormalGr], (instregex "VSUMG(F|H)?$")>;
1367 def : InstRW<[WLat4, VecMul, NormalGr], (instregex "VSUMQ(F|G)?$")>;
1369 //===----------------------------------------------------------------------===//
1370 // Vector: Integer comparison
1371 //===----------------------------------------------------------------------===//
1373 def : InstRW<[WLat3, VecXsPm, NormalGr], (instregex "VEC(B|F|G|H)?$")>;
1374 def : InstRW<[WLat3, VecXsPm, NormalGr], (instregex "VECL(B|F|G|H)?$")>;
1375 def : InstRW<[WLat2, VecXsPm, NormalGr], (instregex "VCEQ(B|F|G|H)?$")>;
1376 def : InstRW<[WLat3, WLat3, VecXsPm, NormalGr], (instregex "VCEQ(B|F|G|H)S$")>;
1377 def : InstRW<[WLat2, VecXsPm, NormalGr], (instregex "VCH(B|F|G|H)?$")>;
1378 def : InstRW<[WLat3, WLat3, VecXsPm, NormalGr], (instregex "VCH(B|F|G|H)S$")>;
1379 def : InstRW<[WLat2, VecXsPm, NormalGr], (instregex "VCHL(B|F|G|H)?$")>;
1380 def : InstRW<[WLat3, WLat3, VecXsPm, NormalGr], (instregex "VCHL(B|F|G|H)S$")>;
1381 def : InstRW<[WLat4, VecStr, NormalGr], (instregex "VTM$")>;
1383 //===----------------------------------------------------------------------===//
1384 // Vector: Floating-point arithmetic
1385 //===----------------------------------------------------------------------===//
1387 // Conversion and rounding
1388 def : InstRW<[WLat6, VecBF, NormalGr], (instregex "VCFP(S|L)$")>;
1389 def : InstRW<[WLat6, VecBF, NormalGr], (instregex "VCD(L)?G$")>;
1390 def : InstRW<[WLat6, VecBF, NormalGr], (instregex "VCD(L)?GB$")>;
1391 def : InstRW<[WLat6, VecBF, NormalGr], (instregex "WCD(L)?GB$")>;
1392 def : InstRW<[WLat6, VecBF, NormalGr], (instregex "VCE(L)?FB$")>;
1393 def : InstRW<[WLat6, VecBF, NormalGr], (instregex "WCE(L)?FB$")>;
1394 def : InstRW<[WLat6, VecBF, NormalGr], (instregex "VC(S|L)FP$")>;
1395 def : InstRW<[WLat6, VecBF, NormalGr], (instregex "VC(L)?GD$")>;
1396 def : InstRW<[WLat6, VecBF, NormalGr], (instregex "VC(L)?GDB$")>;
1397 def : InstRW<[WLat6, VecBF, NormalGr], (instregex "WC(L)?GDB$")>;
1398 def : InstRW<[WLat6, VecBF, NormalGr], (instregex "VC(L)?FEB$")>;
1399 def : InstRW<[WLat6, VecBF, NormalGr], (instregex "WC(L)?FEB$")>;
1400 def : InstRW<[WLat6, VecBF, NormalGr], (instregex "VL(DE|ED)$")>;
1401 def : InstRW<[WLat6, VecBF, NormalGr], (instregex "VL(DE|ED)B$")>;
1402 def : InstRW<[WLat6, VecBF, NormalGr], (instregex "WL(DE|ED)B$")>;
1403 def : InstRW<[WLat6, VecBF, NormalGr], (instregex "VFL(L|R)$")>;
1404 def : InstRW<[WLat6, VecBF, NormalGr], (instregex "VFL(LS|RD)$")>;
1405 def : InstRW<[WLat6, VecBF, NormalGr], (instregex "WFL(LS|RD)$")>;
1406 def : InstRW<[WLat6, VecBF, NormalGr], (instregex "WFLLD$")>;
1407 def : InstRW<[WLat10, VecDF2, NormalGr], (instregex "WFLRX$")>;
1408 def : InstRW<[WLat6, VecBF, NormalGr], (instregex "VFI(DB)?$")>;
1409 def : InstRW<[WLat6, VecBF, NormalGr], (instregex "WFIDB$")>;
1410 def : InstRW<[WLat6, VecBF, NormalGr], (instregex "VFISB$")>;
1411 def : InstRW<[WLat6, VecBF, NormalGr], (instregex "WFISB$")>;
1412 def : InstRW<[WLat10, VecDF2, NormalGr], (instregex "WFIXB$")>;
1415 def : InstRW<[WLat2, VecXsPm, NormalGr], (instregex "VFPSO$")>;
1416 def : InstRW<[WLat2, VecXsPm, NormalGr], (instregex "(V|W)FPSODB$")>;
1417 def : InstRW<[WLat2, VecXsPm, NormalGr], (instregex "(V|W)FPSOSB$")>;
1418 def : InstRW<[WLat2, VecXsPm, NormalGr], (instregex "WFPSOXB$")>;
1419 def : InstRW<[WLat2, VecXsPm, NormalGr], (instregex "(V|W)FL(C|N|P)DB$")>;
1420 def : InstRW<[WLat2, VecXsPm, NormalGr], (instregex "(V|W)FL(C|N|P)SB$")>;
1421 def : InstRW<[WLat2, VecXsPm, NormalGr], (instregex "WFL(C|N|P)XB$")>;
1423 // Minimum / maximum
1424 def : InstRW<[WLat2, VecXsPm, NormalGr], (instregex "VF(MAX|MIN)$")>;
1425 def : InstRW<[WLat2, VecXsPm, NormalGr], (instregex "VF(MAX|MIN)DB$")>;
1426 def : InstRW<[WLat2, VecXsPm, NormalGr], (instregex "WF(MAX|MIN)DB$")>;
1427 def : InstRW<[WLat2, VecXsPm, NormalGr], (instregex "VF(MAX|MIN)SB$")>;
1428 def : InstRW<[WLat2, VecXsPm, NormalGr], (instregex "WF(MAX|MIN)SB$")>;
1429 def : InstRW<[WLat2, VecDFX, NormalGr], (instregex "WF(MAX|MIN)XB$")>;
1432 def : InstRW<[WLat3, WLat3, VecXsPm, NormalGr], (instregex "VFTCI$")>;
1433 def : InstRW<[WLat3, WLat3, VecXsPm, NormalGr], (instregex "(V|W)FTCIDB$")>;
1434 def : InstRW<[WLat3, WLat3, VecXsPm, NormalGr], (instregex "(V|W)FTCISB$")>;
1435 def : InstRW<[WLat3, WLat3, VecDFX, NormalGr], (instregex "WFTCIXB$")>;
1438 def : InstRW<[WLat6, VecBF, NormalGr], (instregex "VF(A|S)$")>;
1439 def : InstRW<[WLat6, VecBF, NormalGr], (instregex "VF(A|S)DB$")>;
1440 def : InstRW<[WLat6, VecBF, NormalGr], (instregex "WF(A|S)DB$")>;
1441 def : InstRW<[WLat6, VecBF, NormalGr], (instregex "VF(A|S)SB$")>;
1442 def : InstRW<[WLat6, VecBF, NormalGr], (instregex "WF(A|S)SB$")>;
1443 def : InstRW<[WLat10, VecDF2, NormalGr], (instregex "WF(A|S)XB$")>;
1445 // Multiply / multiply-and-add/subtract
1446 def : InstRW<[WLat6, VecBF, NormalGr], (instregex "VFM(DB)?$")>;
1447 def : InstRW<[WLat6, VecBF, NormalGr], (instregex "WFM(D|S)B$")>;
1448 def : InstRW<[WLat6, VecBF, NormalGr], (instregex "VFMSB$")>;
1449 def : InstRW<[WLat20, VecDF2, NormalGr], (instregex "WFMXB$")>;
1450 def : InstRW<[WLat6, VecBF, NormalGr], (instregex "VF(N)?M(A|S)$")>;
1451 def : InstRW<[WLat6, VecBF, NormalGr], (instregex "VF(N)?M(A|S)DB$")>;
1452 def : InstRW<[WLat6, VecBF, NormalGr], (instregex "WF(N)?M(A|S)DB$")>;
1453 def : InstRW<[WLat6, VecBF, NormalGr], (instregex "VF(N)?M(A|S)SB$")>;
1454 def : InstRW<[WLat6, VecBF, NormalGr], (instregex "WF(N)?M(A|S)SB$")>;
1455 def : InstRW<[WLat20, VecDF2, NormalGr], (instregex "WF(N)?M(A|S)XB$")>;
1457 // Divide / square root
1458 def : InstRW<[WLat30, VecFPd, NormalGr], (instregex "VFD$")>;
1459 def : InstRW<[WLat30, VecFPd, NormalGr], (instregex "(V|W)FDDB$")>;
1460 def : InstRW<[WLat20, VecFPd20, NormalGr], (instregex "WFDSB$")>;
1461 def : InstRW<[WLat30, VecFPd, NormalGr], (instregex "VFDSB$")>;
1462 def : InstRW<[WLat30, VecFPd, NormalGr], (instregex "WFDXB$")>;
1463 def : InstRW<[WLat30, VecFPd, NormalGr], (instregex "VFSQ$")>;
1464 def : InstRW<[WLat30, VecFPd, NormalGr], (instregex "(V|W)FSQDB$")>;
1465 def : InstRW<[WLat20, VecFPd20, NormalGr], (instregex "WFSQSB$")>;
1466 def : InstRW<[WLat30, VecFPd, NormalGr], (instregex "VFSQSB$")>;
1467 def : InstRW<[WLat30, VecFPd, NormalGr], (instregex "WFSQXB$")>;
1469 //===----------------------------------------------------------------------===//
1470 // Vector: Floating-point comparison
1471 //===----------------------------------------------------------------------===//
1473 def : InstRW<[WLat2, VecXsPm, NormalGr], (instregex "VF(C|K)(E|H|HE)$")>;
1474 def : InstRW<[WLat2, VecXsPm, NormalGr], (instregex "VF(C|K)(E|H|HE)DB$")>;
1475 def : InstRW<[WLat2, VecXsPm, NormalGr], (instregex "WFC(E|H|HE)DB$")>;
1476 def : InstRW<[WLat2, VecXsPm, NormalGr], (instregex "WFK(E|H|HE)DB$")>;
1477 def : InstRW<[WLat2, VecXsPm, NormalGr], (instregex "VF(C|K)(E|H|HE)SB$")>;
1478 def : InstRW<[WLat2, VecXsPm, NormalGr], (instregex "WFC(E|H|HE)SB$")>;
1479 def : InstRW<[WLat2, VecXsPm, NormalGr], (instregex "WFK(E|H|HE)SB$")>;
1480 def : InstRW<[WLat2, VecDFX, NormalGr], (instregex "WFC(E|H|HE)XB$")>;
1481 def : InstRW<[WLat2, VecDFX, NormalGr], (instregex "WFK(E|H|HE)XB$")>;
1482 def : InstRW<[WLat3, WLat3, VecXsPm, NormalGr], (instregex "VFC(E|H|HE)DBS$")>;
1483 def : InstRW<[WLat3, WLat3, VecXsPm, NormalGr], (instregex "VFK(E|H|HE)DBS$")>;
1484 def : InstRW<[WLat3, WLat3, VecXsPm, NormalGr],
1485 (instregex "WF(C|K)(E|H|HE)DBS$")>;
1486 def : InstRW<[WLat3, WLat3, VecXsPm, NormalGr],
1487 (instregex "VF(C|K)(E|H|HE)SBS$")>;
1488 def : InstRW<[WLat3, WLat3, VecXsPm, NormalGr], (instregex "WFC(E|H|HE)SBS$")>;
1489 def : InstRW<[WLat3, WLat3, VecXsPm, NormalGr], (instregex "WFK(E|H|HE)SBS$")>;
1490 def : InstRW<[WLat3, WLat3, VecDFX, NormalGr], (instregex "WFC(E|H|HE)XBS$")>;
1491 def : InstRW<[WLat3, WLat3, VecDFX, NormalGr], (instregex "WFK(E|H|HE)XBS$")>;
1492 def : InstRW<[WLat3, VecXsPm, NormalGr], (instregex "WF(C|K)$")>;
1493 def : InstRW<[WLat3, VecXsPm, NormalGr], (instregex "WF(C|K)DB$")>;
1494 def : InstRW<[WLat3, VecXsPm, NormalGr], (instregex "WF(C|K)SB$")>;
1495 def : InstRW<[WLat3, VecDFX, NormalGr], (instregex "WF(C|K)XB$")>;
1497 //===----------------------------------------------------------------------===//
1498 // Vector: Floating-point insertion and extraction
1499 //===----------------------------------------------------------------------===//
1501 def : InstRW<[WLat1, FXb, NormalGr], (instregex "LEFR$")>;
1502 def : InstRW<[WLat3, FXb, NormalGr], (instregex "LFER$")>;
1504 //===----------------------------------------------------------------------===//
1505 // Vector: String instructions
1506 //===----------------------------------------------------------------------===//
1508 def : InstRW<[WLat3, VecStr, NormalGr], (instregex "VFAE(B)?$")>;
1509 def : InstRW<[WLat3, VecStr, NormalGr], (instregex "VFAE(F|H)$")>;
1510 def : InstRW<[WLat4, WLat4, VecStr, NormalGr], (instregex "VFAE(B|F|H)S$")>;
1511 def : InstRW<[WLat3, VecStr, NormalGr], (instregex "VFAEZ(B|F|H)$")>;
1512 def : InstRW<[WLat4, WLat4, VecStr, NormalGr], (instregex "VFAEZ(B|F|H)S$")>;
1513 def : InstRW<[WLat3, VecStr, NormalGr], (instregex "VFEE(B|F|H|ZB|ZF|ZH)?$")>;
1514 def : InstRW<[WLat4, WLat4, VecStr, NormalGr],
1515 (instregex "VFEE(B|F|H|ZB|ZF|ZH)S$")>;
1516 def : InstRW<[WLat3, VecStr, NormalGr], (instregex "VFENE(B|F|H|ZB|ZF|ZH)?$")>;
1517 def : InstRW<[WLat4, WLat4, VecStr, NormalGr],
1518 (instregex "VFENE(B|F|H|ZB|ZF|ZH)S$")>;
1519 def : InstRW<[WLat3, VecStr, NormalGr], (instregex "VISTR(B|F|H)?$")>;
1520 def : InstRW<[WLat4, WLat4, VecStr, NormalGr], (instregex "VISTR(B|F|H)S$")>;
1521 def : InstRW<[WLat3, VecStr, NormalGr], (instregex "VSTRC(B|F|H)?$")>;
1522 def : InstRW<[WLat4, WLat4, VecStr, NormalGr], (instregex "VSTRC(B|F|H)S$")>;
1523 def : InstRW<[WLat3, VecStr, NormalGr], (instregex "VSTRCZ(B|F|H)$")>;
1524 def : InstRW<[WLat4, WLat4, VecStr, NormalGr], (instregex "VSTRCZ(B|F|H)S$")>;
1525 def : InstRW<[WLat4, WLat4, VecStr, NormalGr], (instregex "VSTRS(B|F|H)?$")>;
1526 def : InstRW<[WLat4, WLat4, VecStr, NormalGr], (instregex "VSTRSZ(B|F|H)$")>;
1528 //===----------------------------------------------------------------------===//
1529 // NNP assist instructions
1530 //===----------------------------------------------------------------------===//
1532 def : InstRW<[WLat2, VecXsPm, NormalGr], (instregex "VCFN$")>;
1533 def : InstRW<[WLat2, VecXsPm, NormalGr], (instregex "VCLFN(L|H)$")>;
1534 def : InstRW<[WLat2, VecXsPm, NormalGr], (instregex "VC(R)?NF$")>;
1536 //===----------------------------------------------------------------------===//
1537 // Vector: Packed-decimal instructions
1538 //===----------------------------------------------------------------------===//
1540 def : InstRW<[WLat2, VecDFX, NormalGr], (instregex "VLIP$")>;
1541 def : InstRW<[WLat6, VecDFX, LSU, GroupAlone2], (instregex "VPKZ$")>;
1542 def : InstRW<[WLat1, VecDFX, FXb, LSU2, GroupAlone2], (instregex "VUPKZ$")>;
1543 def : InstRW<[WLat20, WLat20, VecDF2, FXb, GroupAlone],
1544 (instregex "VCVB(G)?(Opt)?$")>;
1545 def : InstRW<[WLat15, WLat15, VecDF2, FXb, GroupAlone],
1546 (instregex "VCVD(G)?$")>;
1547 def : InstRW<[WLat4, WLat4, VecDFX, NormalGr], (instregex "V(A|S)P$")>;
1548 def : InstRW<[WLat30, WLat30, VecDF2, GroupAlone], (instregex "VM(S)?P$")>;
1549 def : InstRW<[WLat30, WLat30, VecDF2, GroupAlone], (instregex "V(D|R)P$")>;
1550 def : InstRW<[WLat30, WLat30, VecDF2, GroupAlone], (instregex "VSDP$")>;
1551 def : InstRW<[WLat10, WLat10, VecDF2, NormalGr], (instregex "VSRP$")>;
1552 def : InstRW<[WLat4, WLat4, VecDFX, NormalGr], (instregex "VPSOP$")>;
1553 def : InstRW<[WLat2, VecDFX, NormalGr], (instregex "V(T|C)P$")>;
1555 def : InstRW<[WLat30, VecDF2, NormalGr], (instregex "VSCH(S|D|X)?P$")>;
1556 def : InstRW<[WLat30, VecDF2, NormalGr], (instregex "VSCSHP$")>;
1557 def : InstRW<[WLat30, VecDF2, NormalGr], (instregex "VCSPH")>;
1558 def : InstRW<[WLat2, WLat2, VecXsPm, NormalGr], (instregex "VCLZDP")>;
1559 def : InstRW<[WLat10, WLat10, VecDF2, NormalGr], (instregex "VSRPR")>;
1560 def : InstRW<[WLat2, WLat2, VecDFX, NormalGr], (instregex "VPKZR")>;
1561 def : InstRW<[WLat2, WLat2, VecDFX, NormalGr], (instregex "VUPKZH")>;
1562 def : InstRW<[WLat2, WLat2, VecDFX, NormalGr], (instregex "VUPKZL")>;
1564 // -------------------------------- System ---------------------------------- //
1566 //===----------------------------------------------------------------------===//
1567 // System: Program-Status Word Instructions
1568 //===----------------------------------------------------------------------===//
1570 def : InstRW<[WLat30, WLat30, MCD], (instregex "EPSW$")>;
1571 def : InstRW<[WLat20, GroupAlone3], (instregex "LPSW(E)?(Y)?$")>;
1572 def : InstRW<[WLat3, FXa, GroupAlone], (instregex "IPK$")>;
1573 def : InstRW<[WLat1, LSU, EndGroup], (instregex "SPKA$")>;
1574 def : InstRW<[WLat1, LSU, EndGroup], (instregex "SSM$")>;
1575 def : InstRW<[WLat1, FXb, LSU, GroupAlone], (instregex "ST(N|O)SM$")>;
1576 def : InstRW<[WLat3, FXa, NormalGr], (instregex "IAC$")>;
1577 def : InstRW<[WLat1, LSU, EndGroup], (instregex "SAC(F)?$")>;
1579 //===----------------------------------------------------------------------===//
1580 // System: Control Register Instructions
1581 //===----------------------------------------------------------------------===//
1583 def : InstRW<[WLat4LSU, WLat4LSU, LSU2, GroupAlone], (instregex "LCTL(G)?$")>;
1584 def : InstRW<[WLat1, LSU5, FXb, GroupAlone2], (instregex "STCT(L|G)$")>;
1585 def : InstRW<[LSULatency, LSU, NormalGr], (instregex "E(P|S)A(I)?R$")>;
1586 def : InstRW<[WLat30, MCD], (instregex "SSA(I)?R$")>;
1587 def : InstRW<[WLat30, MCD], (instregex "ESEA$")>;
1589 //===----------------------------------------------------------------------===//
1590 // System: Prefix-Register Instructions
1591 //===----------------------------------------------------------------------===//
1593 def : InstRW<[WLat30, MCD], (instregex "S(T)?PX$")>;
1595 //===----------------------------------------------------------------------===//
1596 // System: Breaking-Event-Address-Register Instructions
1597 //===----------------------------------------------------------------------===//
1599 def : InstRW<[WLat3LSU, LSU2, GroupAlone], (instregex "LBEAR")>;
1600 def : InstRW<[WLat1, LSU2, FXb, GroupAlone], (instregex "STBEAR")>;
1602 //===----------------------------------------------------------------------===//
1603 // System: Storage-Key and Real Memory Instructions
1604 //===----------------------------------------------------------------------===//
1606 def : InstRW<[WLat30, MCD], (instregex "ISKE$")>;
1607 def : InstRW<[WLat30, MCD], (instregex "IVSK$")>;
1608 def : InstRW<[WLat30, MCD], (instregex "SSKE(Opt)?$")>;
1609 def : InstRW<[WLat30, MCD], (instregex "RRB(E|M)$")>;
1610 def : InstRW<[WLat30, MCD], (instregex "IRBM$")>;
1611 def : InstRW<[WLat30, MCD], (instregex "PFMF$")>;
1612 def : InstRW<[WLat30, WLat30, MCD], (instregex "TB$")>;
1613 def : InstRW<[WLat30, MCD], (instregex "PGIN$")>;
1614 def : InstRW<[WLat30, MCD], (instregex "PGOUT$")>;
1616 //===----------------------------------------------------------------------===//
1617 // System: Dynamic-Address-Translation Instructions
1618 //===----------------------------------------------------------------------===//
1620 def : InstRW<[WLat30, MCD], (instregex "IPTE(Opt)?(Opt)?$")>;
1621 def : InstRW<[WLat30, MCD], (instregex "IDTE(Opt)?$")>;
1622 def : InstRW<[WLat30, MCD], (instregex "RDP(Opt)?$")>;
1623 def : InstRW<[WLat30, MCD], (instregex "CRDTE(Opt)?$")>;
1624 def : InstRW<[WLat30, MCD], (instregex "PTLB$")>;
1625 def : InstRW<[WLat30, WLat30, MCD], (instregex "CSP(G)?$")>;
1626 def : InstRW<[WLat30, WLat30, WLat30, MCD], (instregex "LPTEA$")>;
1627 def : InstRW<[WLat30, WLat30, MCD], (instregex "LRA(Y|G)?$")>;
1628 def : InstRW<[WLat30, MCD], (instregex "STRAG$")>;
1629 def : InstRW<[WLat30, MCD], (instregex "LURA(G)?$")>;
1630 def : InstRW<[WLat30, MCD], (instregex "STUR(A|G)$")>;
1631 def : InstRW<[WLat30, MCD], (instregex "TPROT$")>;
1633 //===----------------------------------------------------------------------===//
1634 // System: Memory-move Instructions
1635 //===----------------------------------------------------------------------===//
1637 def : InstRW<[WLat4LSU, FXa2, FXb, LSU5, GroupAlone2], (instregex "MVC(K|P|S)$")>;
1638 def : InstRW<[WLat1, FXa, LSU5, GroupAlone2], (instregex "MVC(S|D)K$")>;
1639 def : InstRW<[WLat30, MCD], (instregex "MVCOS$")>;
1640 def : InstRW<[WLat30, MCD], (instregex "MVPG$")>;
1642 //===----------------------------------------------------------------------===//
1643 // System: Address-Space Instructions
1644 //===----------------------------------------------------------------------===//
1646 def : InstRW<[WLat30, MCD], (instregex "LASP$")>;
1647 def : InstRW<[WLat1, LSU, GroupAlone], (instregex "PALB$")>;
1648 def : InstRW<[WLat30, MCD], (instregex "PC$")>;
1649 def : InstRW<[WLat30, MCD], (instregex "PR$")>;
1650 def : InstRW<[WLat30, MCD], (instregex "PT(I)?$")>;
1651 def : InstRW<[WLat30, MCD], (instregex "RP$")>;
1652 def : InstRW<[WLat30, MCD], (instregex "BS(G|A)$")>;
1653 def : InstRW<[WLat30, MCD], (instregex "TAR$")>;
1655 //===----------------------------------------------------------------------===//
1656 // System: Linkage-Stack Instructions
1657 //===----------------------------------------------------------------------===//
1659 def : InstRW<[WLat30, MCD], (instregex "BAKR$")>;
1660 def : InstRW<[WLat30, MCD], (instregex "EREG(G)?$")>;
1661 def : InstRW<[WLat30, WLat30, MCD], (instregex "(E|M)STA$")>;
1663 //===----------------------------------------------------------------------===//
1664 // System: Time-Related Instructions
1665 //===----------------------------------------------------------------------===//
1667 def : InstRW<[WLat30, MCD], (instregex "PTFF$")>;
1668 def : InstRW<[WLat30, MCD], (instregex "SCK(PF|C)?$")>;
1669 def : InstRW<[WLat1, LSU2, GroupAlone], (instregex "SPT$")>;
1670 def : InstRW<[WLat15, LSU3, FXa2, FXb, GroupAlone2], (instregex "STCK(F)?$")>;
1671 def : InstRW<[WLat20, LSU4, FXa2, FXb2, GroupAlone3], (instregex "STCKE$")>;
1672 def : InstRW<[WLat30, MCD], (instregex "STCKC$")>;
1673 def : InstRW<[WLat1, LSU2, FXb, Cracked], (instregex "STPT$")>;
1675 //===----------------------------------------------------------------------===//
1676 // System: CPU-Related Instructions
1677 //===----------------------------------------------------------------------===//
1679 def : InstRW<[WLat30, MCD], (instregex "STAP$")>;
1680 def : InstRW<[WLat30, MCD], (instregex "STIDP$")>;
1681 def : InstRW<[WLat30, WLat30, MCD], (instregex "STSI$")>;
1682 def : InstRW<[WLat30, WLat30, MCD], (instregex "STFL(E)?$")>;
1683 def : InstRW<[WLat30, MCD], (instregex "ECAG$")>;
1684 def : InstRW<[WLat30, WLat30, MCD], (instregex "ECTG$")>;
1685 def : InstRW<[WLat30, MCD], (instregex "PTF$")>;
1686 def : InstRW<[WLat30, MCD], (instregex "PCKMO$")>;
1687 def : InstRW<[WLat30, WLat30, MCD], (instregex "QPACI$")>;
1689 //===----------------------------------------------------------------------===//
1690 // System: Miscellaneous Instructions
1691 //===----------------------------------------------------------------------===//
1693 def : InstRW<[WLat30, MCD], (instregex "SVC$")>;
1694 def : InstRW<[WLat1, FXb, GroupAlone], (instregex "MC$")>;
1695 def : InstRW<[WLat30, MCD], (instregex "DIAG$")>;
1696 def : InstRW<[WLat1, FXb, NormalGr], (instregex "TRAC(E|G)$")>;
1697 def : InstRW<[WLat30, MCD], (instregex "TRAP(2|4)$")>;
1698 def : InstRW<[WLat30, MCD], (instregex "SIG(P|A)$")>;
1699 def : InstRW<[WLat30, MCD], (instregex "SIE$")>;
1701 //===----------------------------------------------------------------------===//
1702 // System: CPU-Measurement Facility Instructions
1703 //===----------------------------------------------------------------------===//
1705 def : InstRW<[WLat1, FXb, NormalGr], (instregex "LPP$")>;
1706 def : InstRW<[WLat30, WLat30, MCD], (instregex "ECPGA$")>;
1707 def : InstRW<[WLat30, WLat30, MCD], (instregex "E(C|P)CTR$")>;
1708 def : InstRW<[WLat30, MCD], (instregex "LCCTL$")>;
1709 def : InstRW<[WLat30, MCD], (instregex "L(P|S)CTL$")>;
1710 def : InstRW<[WLat30, MCD], (instregex "Q(S|CTR)I$")>;
1711 def : InstRW<[WLat30, MCD], (instregex "S(C|P)CTR$")>;
1713 //===----------------------------------------------------------------------===//
1714 // System: I/O Instructions
1715 //===----------------------------------------------------------------------===//
1717 def : InstRW<[WLat30, MCD], (instregex "(C|H|R|X)SCH$")>;
1718 def : InstRW<[WLat30, MCD], (instregex "(M|S|ST|T)SCH$")>;
1719 def : InstRW<[WLat30, MCD], (instregex "RCHP$")>;
1720 def : InstRW<[WLat30, MCD], (instregex "SCHM$")>;
1721 def : InstRW<[WLat30, MCD], (instregex "STC(PS|RW)$")>;
1722 def : InstRW<[WLat30, MCD], (instregex "TPI$")>;
1723 def : InstRW<[WLat30, MCD], (instregex "SAL$")>;