blob: 286382a96dddbcfabb8e5027a31118460e32d75f [file] [log] [blame]
Ehsan Amiri6c17bb02016-12-19 13:35:45 +00001//===- P9InstrResources.td - P9 Instruction Resource Defs -*- tablegen -*-===//
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 resources required by some of P9 instruction. This is part
11// P9 processor model used for instruction scheduling. Not every instruction
12// is listed here. Instructions in this file belong to itinerary classes that
13// have instructions with different resource requirements.
14//
Stefan Pintilie590eb272017-09-22 20:17:25 +000015// The makeup of the P9 CPU is modeled as follows:
16// - Each CPU is made up of two superslices.
17// - Each superslice is made up of two slices. Therefore, there are 4 slices
18// for each CPU.
19// - Up to 6 instructions can be dispatched to each CPU. Three per superslice.
20// - Each CPU has:
21// - One CY (Crypto) unit P9_CY_*
22// - One DFU (Decimal Floating Point and Quad Precision) unit P9_DFU_*
23// - Two PM (Permute) units. One on each superslice. P9_PM_*
24// - Two DIV (Fixed Point Divide) units. One on each superslize. P9_DIV_*
25// - Four ALU (Fixed Point Arithmetic) units. One on each slice. P9_ALU_*
26// - Four DP (Floating Point) units. One on each slice. P9_DP_*
27// This also includes fixed point multiply add.
28// - Four AGEN (Address Generation) units. One for each slice. P9_AGEN_*
29// - Four Load/Store Queues. P9_LS_*
30// - Each set of instructions will require a number of these resources.
Ehsan Amiri6c17bb02016-12-19 13:35:45 +000031//===----------------------------------------------------------------------===//
32
Stefan Pintilie590eb272017-09-22 20:17:25 +000033// Two cycle ALU vector operation that uses an entire superslice.
34// Uses both ALU units (the even ALUE and odd ALUO units), two pipelines
35// (EXECE, EXECO) and all three dispatches (DISP) to the given superslice.
Ehsan Amiri6c17bb02016-12-19 13:35:45 +000036def : InstRW<[P9_ALUE_2C, P9_ALUO_2C, IP_EXECE_1C, IP_EXECO_1C,
Stefan Pintilie590eb272017-09-22 20:17:25 +000037 DISP_1C, DISP_1C, DISP_1C],
Ehsan Amiri6c17bb02016-12-19 13:35:45 +000038 (instrs
Stefan Pintilie626b6512018-02-23 20:37:10 +000039 (instregex "VADDU(B|H|W|D)M$"),
Stefan Pintiliee894e0f2018-03-01 16:16:08 +000040 (instregex "VAND(C)?$"),
Stefan Pintilieb5a94402018-03-02 14:41:38 +000041 (instregex "VEXTS(B|H|W)2(D|W)(s)?$"),
Stefan Pintilie235fb922018-03-08 16:24:33 +000042 (instregex "V_SET0(B|H)?$"),
43 MTVSRDD,
Ehsan Amiri6c17bb02016-12-19 13:35:45 +000044 VEQV,
Stefan Pintilie590eb272017-09-22 20:17:25 +000045 VRLB,
46 VRLD,
47 VRLDMI,
48 VRLDNM,
49 VRLH,
50 VRLW,
51 VRLWMI,
52 VRLWNM,
53 VSRAB,
54 VSRAD,
55 VSRAH,
56 VSRAW,
57 VSRB,
58 VSRD,
59 VSRH,
60 VSRW,
61 VSLB,
62 VSLD,
63 VSLH,
64 VSLW,
Ehsan Amiri6c17bb02016-12-19 13:35:45 +000065 VMRGEW,
66 VMRGOW,
67 VNAND,
68 VNEGD,
69 VNEGW,
70 VNOR,
71 VOR,
72 VORC,
73 VPOPCNTB,
74 VPOPCNTH,
Ehsan Amiri6c17bb02016-12-19 13:35:45 +000075 VSEL,
Ehsan Amiri6c17bb02016-12-19 13:35:45 +000076 VSUBUBM,
77 VSUBUDM,
78 VSUBUHM,
79 VSUBUWM,
80 VXOR,
Ehsan Amiri6c17bb02016-12-19 13:35:45 +000081 XVABSDP,
82 XVABSSP,
83 XVCPSGNDP,
84 XVCPSGNSP,
85 XVIEXPDP,
86 XVNABSDP,
87 XVNABSSP,
88 XVNEGDP,
89 XVNEGSP,
90 XVXEXPDP,
Stefan Pintilie590eb272017-09-22 20:17:25 +000091 XVIEXPSP,
92 XVXEXPSP,
Ehsan Amiri6c17bb02016-12-19 13:35:45 +000093 XXLAND,
94 XXLANDC,
95 XXLEQV,
96 XXLNAND,
97 XXLNOR,
98 XXLOR,
99 XXLORf,
100 XXLORC,
101 XXLXOR,
Stefan Pintilie235fb922018-03-08 16:24:33 +0000102 XXLXORdpz,
103 XXLXORspz,
104 XXLXORz,
Stefan Pintilie590eb272017-09-22 20:17:25 +0000105 XXSEL,
Ehsan Amiri6c17bb02016-12-19 13:35:45 +0000106 XSABSQP,
107 XSCPSGNQP,
108 XSIEXPQP,
109 XSNABSQP,
110 XSNEGQP,
Stefan Pintilie590eb272017-09-22 20:17:25 +0000111 XSXEXPQP
Ehsan Amiri6c17bb02016-12-19 13:35:45 +0000112)>;
113
Stefan Pintilie590eb272017-09-22 20:17:25 +0000114// Restricted Dispatch ALU operation for 3 cycles. The operation runs on a
115// slingle slice. However, since it is Restricted it requires all 3 dispatches
116// (DISP) for that superslice.
117def : InstRW<[P9_ALU_3C, IP_EXEC_1C, DISP_1C, DISP_1C, DISP_1C],
Ehsan Amiri6c17bb02016-12-19 13:35:45 +0000118 (instrs
Stefan Pintilie590eb272017-09-22 20:17:25 +0000119 FCMPUS,
120 FCMPUD,
121 XSTSTDCDP,
Stefan Pintilie626b6512018-02-23 20:37:10 +0000122 XSTSTDCSP,
123 FTDIV,
124 FTSQRT,
Stefan Pintilied45db612018-03-05 14:34:59 +0000125 CMPEQB,
Stefan Pintilie235fb922018-03-08 16:24:33 +0000126 (instregex "TABORT(D|W)C(I)?$"),
127 (instregex "MTFSB(0|1)$"),
128 (instregex "MFFSC(D)?RN(I)?$"),
Stefan Pintilie626b6512018-02-23 20:37:10 +0000129 (instregex "CMPRB(8)?$"),
130 (instregex "TD(I)?$"),
131 (instregex "TW(I)?$")
Stefan Pintilie590eb272017-09-22 20:17:25 +0000132)>;
Ehsan Amiri6c17bb02016-12-19 13:35:45 +0000133
Stefan Pintilie590eb272017-09-22 20:17:25 +0000134// Standard Dispatch ALU operation for 3 cycles. Only one slice used.
135def : InstRW<[P9_ALU_3C, IP_EXEC_1C, DISP_1C, DISP_1C],
136 (instrs
Stefan Pintilie626b6512018-02-23 20:37:10 +0000137 (instregex "XSMAX(C|J)?DP$"),
138 (instregex "XSMIN(C|J)?DP$"),
139 (instregex "XSCMP(EQ|EXP|GE|GT|O|U)DP$"),
Ehsan Amiri6c17bb02016-12-19 13:35:45 +0000140 XSTDIVDP,
141 XSTSQRTDP,
Ehsan Amiri6c17bb02016-12-19 13:35:45 +0000142 XSXSIGDP,
Stefan Pintilie626b6512018-02-23 20:37:10 +0000143 XSCVSPDPN,
144 SETB,
145 BPERMD,
Stefan Pintilied45db612018-03-05 14:34:59 +0000146 (instregex "CNT(L|T)Z(D|W)(8)?(o)?$"),
Stefan Pintilie626b6512018-02-23 20:37:10 +0000147 (instregex "POPCNT(D|W)$"),
148 (instregex "CMPB(8)?$")
Stefan Pintilie590eb272017-09-22 20:17:25 +0000149)>;
150
151// Standard Dispatch ALU operation for 2 cycles. Only one slice used.
152def : InstRW<[P9_ALU_2C, IP_EXEC_1C, DISP_1C, DISP_1C],
153 (instrs
154 ADDIStocHA,
155 ADDItocL,
156 MCRF,
157 MCRXRX,
Stefan Pintilie590eb272017-09-22 20:17:25 +0000158 XSNABSDP,
159 XSXEXPDP,
160 XSABSDP,
161 XSNEGDP,
Stefan Pintilie626b6512018-02-23 20:37:10 +0000162 XSCPSGNDP,
163 (instregex "S(L|R)D$"),
164 (instregex "SRAD(I)?$"),
165 (instregex "EXTSWSLI$"),
Stefan Pintilie235fb922018-03-08 16:24:33 +0000166 (instregex "MFV(S)?RD$"),
167 (instregex "MTVSRD$"),
168 (instregex "MTVSRW(A|Z)$"),
169 MFVSRWZ,
Stefan Pintilie626b6512018-02-23 20:37:10 +0000170 SRADI_32,
171 RLDIC,
Stefan Pintiliee894e0f2018-03-01 16:16:08 +0000172 RFEBB,
Stefan Pintilie626b6512018-02-23 20:37:10 +0000173 LA,
Stefan Pintilie235fb922018-03-08 16:24:33 +0000174 TBEGIN,
175 TRECHKPT,
Stefan Pintilie626b6512018-02-23 20:37:10 +0000176 (instregex "CMP(WI|LWI|W|LW)(8)?$"),
Stefan Pintilied45db612018-03-05 14:34:59 +0000177 (instregex "CMP(L)?D(I)?$"),
Stefan Pintilie626b6512018-02-23 20:37:10 +0000178 (instregex "SUBF(I)?C(8)?$"),
179 (instregex "ANDI(S)?o(8)?$"),
Stefan Pintiliee894e0f2018-03-01 16:16:08 +0000180 (instregex "ADDC(8)?$"),
181 (instregex "ADDIC(8)?(o)?$"),
182 (instregex "ADD(8|4)(o)?$"),
183 (instregex "ADD(E|ME|ZE)(8)?(o)?$"),
Stefan Pintilie235fb922018-03-08 16:24:33 +0000184 (instregex "SUBF(E|ME|ZE)?(8)?(o)?$"),
185 (instregex "NEG(8)?(o)?$"),
Stefan Pintilie626b6512018-02-23 20:37:10 +0000186 (instregex "POPCNTB$"),
187 (instregex "ADD(I|IS)?(8)?$"),
188 (instregex "LI(S)?(8)?$"),
Stefan Pintilie235fb922018-03-08 16:24:33 +0000189 (instregex "(X)?OR(I|IS)?(8)?(o)?$"),
Stefan Pintilie626b6512018-02-23 20:37:10 +0000190 NOP,
Stefan Pintilie235fb922018-03-08 16:24:33 +0000191 (instregex "NAND(8)?(o)?$"),
Stefan Pintiliee894e0f2018-03-01 16:16:08 +0000192 (instregex "AND(C)?(8)?(o)?$"),
Stefan Pintilie235fb922018-03-08 16:24:33 +0000193 (instregex "NOR(8)?(o)?$"),
194 (instregex "OR(C)?(8)?(o)?$"),
Stefan Pintilied45db612018-03-05 14:34:59 +0000195 (instregex "EQV(8)?(o)?$"),
Stefan Pintilieb5a94402018-03-02 14:41:38 +0000196 (instregex "EXTS(B|H|W)(8)?(_32)?(_64)?(o)?$"),
Stefan Pintilie626b6512018-02-23 20:37:10 +0000197 (instregex "ADD(4|8)(TLS)?(_)?$"),
198 (instregex "NEG(8)?$")
Stefan Pintilie590eb272017-09-22 20:17:25 +0000199)>;
200
201// Restricted Dispatch ALU operation for 2 cycles. The operation runs on a
202// slingle slice. However, since it is Restricted it requires all 3 dispatches
203// (DISP) for that superslice.
204def : InstRW<[P9_ALU_2C, IP_EXEC_1C, DISP_1C, DISP_1C, DISP_1C],
205 (instrs
206 RLDCL,
207 RLDCR,
208 RLDIMI,
209 RLDICL,
210 RLDICR,
211 RLDICL_32_64,
Stefan Pintilie626b6512018-02-23 20:37:10 +0000212 RLDICL_32,
213 RLDICR_32,
214 (instregex "RLWIMI(8)?$"),
Stefan Pintilie590eb272017-09-22 20:17:25 +0000215 XSIEXPDP,
216 FMR,
Stefan Pintilied45db612018-03-05 14:34:59 +0000217 CREQV,
218 CRXOR,
Stefan Pintilie235fb922018-03-08 16:24:33 +0000219 TRECLAIM,
220 TSR,
221 TABORT,
222 (instregex "MFOCRF(8)?$"),
Stefan Pintilied45db612018-03-05 14:34:59 +0000223 (instregex "CR(6)?(UN)?SET$"),
224 (instregex "CR(N)?(OR|AND)(C)?$"),
Stefan Pintilie626b6512018-02-23 20:37:10 +0000225 (instregex "S(L|R)W(8)?$"),
226 (instregex "RLW(INM|NM)(8)?$"),
227 (instregex "F(N)?ABS(D|S)$"),
228 (instregex "FNEG(D|S)$"),
229 (instregex "FCPSGN(D|S)$"),
230 (instregex "SRAW(I)?$"),
231 (instregex "ISEL(8)?$")
Stefan Pintilie590eb272017-09-22 20:17:25 +0000232)>;
233
234// Three cycle ALU vector operation that uses an entire superslice.
235// Uses both ALU units (the even ALUE and odd ALUO units), two pipelines
236// (EXECE, EXECO) and all three dispatches (DISP) to the given superslice.
237def : InstRW<[P9_ALUE_3C, P9_ALUO_3C, IP_EXECE_1C, IP_EXECO_1C,
238 DISP_1C, DISP_1C, DISP_1C],
239 (instrs
Stefan Pintilie235fb922018-03-08 16:24:33 +0000240 (instregex "M(T|F)VSCR$"),
Stefan Pintiliee894e0f2018-03-01 16:16:08 +0000241 (instregex "VCMPNEZ(B|H|W)$"),
242 VCMPEQUB,
243 VCMPEQUD,
244 VCMPEQUH,
245 VCMPEQUW,
246 VCMPNEB,
247 VCMPNEH,
248 VCMPNEW,
Stefan Pintilie590eb272017-09-22 20:17:25 +0000249 VBPERMD,
250 VABSDUB,
251 VABSDUH,
252 VABSDUW,
Stefan Pintiliee894e0f2018-03-01 16:16:08 +0000253 VADDCUW,
Stefan Pintilie590eb272017-09-22 20:17:25 +0000254 VADDUBS,
255 VADDUHS,
256 VADDUWS,
257 VAVGSB,
258 VAVGSH,
259 VAVGSW,
260 VAVGUB,
261 VAVGUH,
262 VAVGUW,
263 VCMPEQFP,
264 VCMPEQFPo,
265 VCMPGEFP,
266 VCMPGEFPo,
267 VCMPBFP,
268 VCMPBFPo,
269 VCMPGTFP,
270 VCMPGTFPo,
271 VCLZB,
272 VCLZD,
273 VCLZH,
274 VCLZW,
275 VCTZB,
276 VCTZD,
277 VCTZH,
278 VCTZW,
279 VADDSBS,
280 VADDSHS,
281 VADDSWS,
282 VMINFP,
283 VMINSB,
284 VMINSD,
285 VMINSH,
286 VMINSW,
287 VMINUB,
288 VMINUD,
289 VMINUH,
290 VMINUW,
291 VMAXFP,
292 VMAXSB,
293 VMAXSD,
294 VMAXSH,
295 VMAXSW,
296 VMAXUB,
297 VMAXUD,
298 VMAXUH,
299 VMAXUW,
300 VPOPCNTW,
301 VPOPCNTD,
302 VPRTYBD,
303 VPRTYBW,
304 VSHASIGMAD,
305 VSHASIGMAW,
306 VSUBSBS,
307 VSUBSHS,
308 VSUBSWS,
309 VSUBUBS,
310 VSUBUHS,
311 VSUBUWS,
312 VSUBCUW,
313 VCMPGTSB,
314 VCMPGTSBo,
315 VCMPGTSD,
316 VCMPGTSDo,
317 VCMPGTSH,
318 VCMPGTSHo,
319 VCMPGTSW,
320 VCMPGTSWo,
321 VCMPGTUB,
322 VCMPGTUBo,
323 VCMPGTUD,
324 VCMPGTUDo,
325 VCMPGTUH,
326 VCMPGTUHo,
327 VCMPGTUW,
328 VCMPGTUWo,
329 VCMPNEBo,
330 VCMPNEHo,
331 VCMPNEWo,
332 VCMPNEZBo,
333 VCMPNEZHo,
334 VCMPNEZWo,
335 VCMPEQUBo,
336 VCMPEQUDo,
337 VCMPEQUHo,
338 VCMPEQUWo,
Ehsan Amiri6c17bb02016-12-19 13:35:45 +0000339 XVCMPEQDP,
340 XVCMPEQDPo,
341 XVCMPEQSP,
342 XVCMPEQSPo,
343 XVCMPGEDP,
344 XVCMPGEDPo,
345 XVCMPGESP,
346 XVCMPGESPo,
347 XVCMPGTDP,
348 XVCMPGTDPo,
349 XVCMPGTSP,
350 XVCMPGTSPo,
Ehsan Amiri6c17bb02016-12-19 13:35:45 +0000351 XVMAXDP,
352 XVMAXSP,
353 XVMINDP,
354 XVMINSP,
355 XVTDIVDP,
356 XVTDIVSP,
357 XVTSQRTDP,
358 XVTSQRTSP,
359 XVTSTDCDP,
360 XVTSTDCSP,
Ehsan Amiri6c17bb02016-12-19 13:35:45 +0000361 XVXSIGDP,
362 XVXSIGSP
363)>;
364
Stefan Pintilie590eb272017-09-22 20:17:25 +0000365// 7 cycle DP vector operation that uses an entire superslice.
366// Uses both DP units (the even DPE and odd DPO units), two pipelines
367// (EXECE, EXECO) and all three dispatches (DISP) to the given superslice.
368def : InstRW<[P9_DPE_7C, P9_DPO_7C, IP_EXECE_1C, IP_EXECO_1C,
369 DISP_1C, DISP_1C, DISP_1C],
Ehsan Amiri6c17bb02016-12-19 13:35:45 +0000370 (instrs
371 VADDFP,
372 VCTSXS,
373 VCTSXS_0,
374 VCTUXS,
375 VCTUXS_0,
376 VEXPTEFP,
377 VLOGEFP,
378 VMADDFP,
379 VMHADDSHS,
380 VNMSUBFP,
381 VREFP,
382 VRFIM,
383 VRFIN,
384 VRFIP,
385 VRFIZ,
386 VRSQRTEFP,
387 VSUBFP,
388 XVADDDP,
389 XVADDSP,
390 XVCVDPSP,
391 XVCVDPSXDS,
392 XVCVDPSXWS,
393 XVCVDPUXDS,
394 XVCVDPUXWS,
395 XVCVHPSP,
396 XVCVSPDP,
397 XVCVSPHP,
398 XVCVSPSXDS,
399 XVCVSPSXWS,
400 XVCVSPUXDS,
401 XVCVSPUXWS,
402 XVCVSXDDP,
403 XVCVSXDSP,
404 XVCVSXWDP,
405 XVCVSXWSP,
406 XVCVUXDDP,
407 XVCVUXDSP,
408 XVCVUXWDP,
409 XVCVUXWSP,
410 XVMADDADP,
411 XVMADDASP,
412 XVMADDMDP,
413 XVMADDMSP,
414 XVMSUBADP,
415 XVMSUBASP,
416 XVMSUBMDP,
417 XVMSUBMSP,
418 XVMULDP,
419 XVMULSP,
420 XVNMADDADP,
421 XVNMADDASP,
422 XVNMADDMDP,
423 XVNMADDMSP,
424 XVNMSUBADP,
425 XVNMSUBASP,
426 XVNMSUBMDP,
427 XVNMSUBMSP,
428 XVRDPI,
429 XVRDPIC,
430 XVRDPIM,
431 XVRDPIP,
432 XVRDPIZ,
433 XVREDP,
434 XVRESP,
435 XVRSPI,
436 XVRSPIC,
437 XVRSPIM,
438 XVRSPIP,
439 XVRSPIZ,
440 XVRSQRTEDP,
441 XVRSQRTESP,
442 XVSUBDP,
443 XVSUBSP,
444 VCFSX,
445 VCFSX_0,
446 VCFUX,
447 VCFUX_0,
448 VMHRADDSHS,
449 VMLADDUHM,
450 VMSUMMBM,
451 VMSUMSHM,
452 VMSUMSHS,
453 VMSUMUBM,
454 VMSUMUHM,
455 VMSUMUHS,
456 VMULESB,
457 VMULESH,
458 VMULESW,
459 VMULEUB,
460 VMULEUH,
461 VMULEUW,
462 VMULOSB,
463 VMULOSH,
464 VMULOSW,
465 VMULOUB,
466 VMULOUH,
467 VMULOUW,
468 VMULUWM,
469 VSUM2SWS,
470 VSUM4SBS,
471 VSUM4SHS,
472 VSUM4UBS,
473 VSUMSWS
474)>;
475
Stefan Pintilie235fb922018-03-08 16:24:33 +0000476
477// 5 cycle Restricted DP operation. One DP unit, one EXEC pipeline and all three
478// dispatch units for the superslice.
479def : InstRW<[P9_DP_5C, IP_EXEC_1C, DISP_1C, DISP_1C, DISP_1C],
480 (instrs
481 (instregex "MADD(HD|HDU|LD)$"),
482 (instregex "MUL(HD|HW|LD|LI|LI8|LW)(U)?$")
483)>;
484
Stefan Pintilie590eb272017-09-22 20:17:25 +0000485// 7 cycle Restricted DP operation. One DP unit, one EXEC pipeline and all three
486// dispatch units for the superslice.
Ehsan Amiri6c17bb02016-12-19 13:35:45 +0000487def : InstRW<[P9_DP_7C, IP_EXEC_1C, DISP_1C, DISP_1C, DISP_1C],
488 (instrs
Stefan Pintilie590eb272017-09-22 20:17:25 +0000489 FRSP,
Stefan Pintilied45db612018-03-05 14:34:59 +0000490 (instregex "FRI(N|P|Z|M)(D|S)$"),
491 (instregex "FRE(S)?$"),
492 (instregex "FADD(S)?$"),
493 (instregex "FMSUB(S)?$"),
494 (instregex "FMADD(S)?$"),
Stefan Pintilie590eb272017-09-22 20:17:25 +0000495 FRSQRTE,
496 FRSQRTES,
Stefan Pintilie590eb272017-09-22 20:17:25 +0000497 FNMADDS,
498 FNMADD,
499 FNMSUBS,
500 FNMSUB,
501 FSELD,
502 FSELS,
Stefan Pintilie590eb272017-09-22 20:17:25 +0000503 FMULS,
504 FMUL,
Stefan Pintilied45db612018-03-05 14:34:59 +0000505 (instregex "FSUB(S)?$"),
506 (instregex "FCFID(U)?(S)?$"),
507 (instregex "FCTID(U)?(Z)?$"),
508 (instregex "FCTIW(U)?(Z)?$"),
Ehsan Amiri6c17bb02016-12-19 13:35:45 +0000509 XSMADDADP,
510 XSMADDASP,
511 XSMADDMDP,
512 XSMADDMSP,
513 XSMSUBADP,
514 XSMSUBASP,
515 XSMSUBMDP,
516 XSMSUBMSP,
517 XSMULDP,
518 XSMULSP,
519 XSNMADDADP,
520 XSNMADDASP,
521 XSNMADDMDP,
522 XSNMADDMSP,
523 XSNMSUBADP,
524 XSNMSUBASP,
525 XSNMSUBMDP,
526 XSNMSUBMSP
527)>;
528
Stefan Pintiliee894e0f2018-03-01 16:16:08 +0000529// 7 cycle Restricted DP operation and one 3 cycle ALU operation.
Stefan Pintilied45db612018-03-05 14:34:59 +0000530// These operations can be done in parallel.
531// The DP is restricted so we need a full 5 dispatches.
532def : InstRW<[P9_DP_7C, P9_ALU_3C, IP_EXEC_1C, IP_EXEC_1C,
533 DISP_1C, DISP_1C, DISP_1C, DISP_1C, DISP_1C],
534 (instrs
535 (instregex "FSEL(D|S)o$")
536)>;
537
Stefan Pintilie235fb922018-03-08 16:24:33 +0000538// 5 Cycle Restricted DP operation and one 2 cycle ALU operation.
539def : InstRW<[P9_DPOpAndALUOp_7C, IP_EXEC_1C, IP_EXEC_1C,
540 DISP_1C, DISP_1C, DISP_1C, DISP_1C, DISP_1C],
541 (instrs
542 (instregex "MUL(H|L)(D|W)(U)?o$")
543)>;
544
Stefan Pintilied45db612018-03-05 14:34:59 +0000545// 7 cycle Restricted DP operation and one 3 cycle ALU operation.
546// These operations must be done sequentially.
Stefan Pintiliecc330da2017-10-10 13:45:35 +0000547// The DP is restricted so we need a full 5 dispatches.
Stefan Pintiliee894e0f2018-03-01 16:16:08 +0000548def : InstRW<[P9_DPOpAndALU2Op_10C, IP_EXEC_1C, IP_EXEC_1C,
Stefan Pintiliecc330da2017-10-10 13:45:35 +0000549 DISP_1C, DISP_1C, DISP_1C, DISP_1C, DISP_1C],
550 (instrs
Stefan Pintilied45db612018-03-05 14:34:59 +0000551 (instregex "FRI(N|P|Z|M)(D|S)o$"),
552 (instregex "FRE(S)?o$"),
553 (instregex "FADD(S)?o$"),
554 (instregex "FSUB(S)?o$"),
555 (instregex "F(N)?MSUB(S)?o$"),
556 (instregex "F(N)?MADD(S)?o$"),
557 (instregex "FCFID(U)?(S)?o$"),
558 (instregex "FCTID(U)?(Z)?o$"),
559 (instregex "FCTIW(U)?(Z)?o$"),
560 (instregex "FMUL(S)?o$"),
561 (instregex "FRSQRTE(S)?o$"),
562 FRSPo
Stefan Pintiliecc330da2017-10-10 13:45:35 +0000563)>;
564
Stefan Pintilie590eb272017-09-22 20:17:25 +0000565// 7 cycle DP operation. One DP unit, one EXEC pipeline and two dispatch units.
Ehsan Amiri6c17bb02016-12-19 13:35:45 +0000566def : InstRW<[P9_DP_7C, IP_EXEC_1C, DISP_1C, DISP_1C],
567 (instrs
568 XSADDDP,
569 XSADDSP,
570 XSCVDPHP,
571 XSCVDPSP,
572 XSCVDPSXDS,
Stefan Pintilie590eb272017-09-22 20:17:25 +0000573 XSCVDPSXDSs,
Ehsan Amiri6c17bb02016-12-19 13:35:45 +0000574 XSCVDPSXWS,
575 XSCVDPUXDS,
Stefan Pintilie590eb272017-09-22 20:17:25 +0000576 XSCVDPUXDSs,
Ehsan Amiri6c17bb02016-12-19 13:35:45 +0000577 XSCVDPUXWS,
Stefan Pintilie235fb922018-03-08 16:24:33 +0000578 XSCVDPSXWSs,
579 XSCVDPUXWSs,
Ehsan Amiri6c17bb02016-12-19 13:35:45 +0000580 XSCVHPDP,
581 XSCVSPDP,
582 XSCVSXDDP,
583 XSCVSXDSP,
584 XSCVUXDDP,
585 XSCVUXDSP,
586 XSRDPI,
587 XSRDPIC,
588 XSRDPIM,
589 XSRDPIP,
590 XSRDPIZ,
591 XSREDP,
592 XSRESP,
Ehsan Amiri6c17bb02016-12-19 13:35:45 +0000593 XSRSQRTEDP,
594 XSRSQRTESP,
595 XSSUBDP,
596 XSSUBSP,
597 XSCVDPSPN
598)>;
599
Stefan Pintilie590eb272017-09-22 20:17:25 +0000600// Three Cycle PM operation. Only one PM unit per superslice so we use the whole
601// superslice. That includes both exec pipelines (EXECO, EXECE) and all three
602// dispatches.
603def : InstRW<[P9_PM_3C, IP_EXECO_1C, IP_EXECE_1C, DISP_1C, DISP_1C, DISP_1C],
Ehsan Amiri6c17bb02016-12-19 13:35:45 +0000604 (instrs
Stefan Pintilie235fb922018-03-08 16:24:33 +0000605 (instregex "LVS(L|R)$"),
606 (instregex "VSPLTIS(W|H|B)$"),
607 (instregex "VSPLT(W|H|B)(s)?$"),
608 (instregex "V_SETALLONES(B|H)?$"),
609 (instregex "VEXTRACTU(B|H|W)$"),
610 MFVSRLD,
611 MTVSRWS,
Ehsan Amiri6c17bb02016-12-19 13:35:45 +0000612 VBPERMQ,
613 VCLZLSBB,
614 VCTZLSBB,
615 VEXTRACTD,
Ehsan Amiri6c17bb02016-12-19 13:35:45 +0000616 VEXTUBLX,
617 VEXTUBRX,
618 VEXTUHLX,
619 VEXTUHRX,
620 VEXTUWLX,
621 VEXTUWRX,
622 VGBBD,
623 VINSERTB,
624 VINSERTD,
625 VINSERTH,
626 VINSERTW,
627 VMRGHB,
628 VMRGHH,
629 VMRGHW,
630 VMRGLB,
631 VMRGLH,
632 VMRGLW,
633 VPERM,
634 VPERMR,
635 VPERMXOR,
636 VPKPX,
637 VPKSDSS,
638 VPKSDUS,
639 VPKSHSS,
640 VPKSHUS,
641 VPKSWSS,
642 VPKSWUS,
643 VPKUDUM,
644 VPKUDUS,
645 VPKUHUM,
646 VPKUHUS,
647 VPKUWUM,
648 VPKUWUS,
649 VPRTYBQ,
650 VSL,
651 VSLDOI,
652 VSLO,
653 VSLV,
Ehsan Amiri6c17bb02016-12-19 13:35:45 +0000654 VSR,
655 VSRO,
656 VSRV,
657 VUPKHPX,
658 VUPKHSB,
659 VUPKHSH,
660 VUPKHSW,
661 VUPKLPX,
662 VUPKLSB,
663 VUPKLSH,
664 VUPKLSW,
665 XXBRD,
666 XXBRH,
667 XXBRQ,
668 XXBRW,
669 XXEXTRACTUW,
670 XXINSERTW,
671 XXMRGHW,
672 XXMRGLW,
673 XXPERM,
674 XXPERMR,
675 XXSLDWI,
676 XXSPLTIB,
677 XXSPLTW,
Stefan Pintilie590eb272017-09-22 20:17:25 +0000678 XXSPLTWs,
679 XXPERMDI,
680 XXPERMDIs,
Ehsan Amiri6c17bb02016-12-19 13:35:45 +0000681 VADDCUQ,
682 VADDECUQ,
683 VADDEUQM,
684 VADDUQM,
685 VMUL10CUQ,
686 VMUL10ECUQ,
687 VMUL10EUQ,
688 VMUL10UQ,
689 VSUBCUQ,
690 VSUBECUQ,
691 VSUBEUQM,
692 VSUBUQM,
693 XSCMPEXPQP,
694 XSCMPOQP,
695 XSCMPUQP,
696 XSTSTDCQP,
Stefan Pintiliee894e0f2018-03-01 16:16:08 +0000697 XSXSIGQP,
698 BCDCFNo,
699 BCDCFZo,
700 BCDCPSGNo,
701 BCDCTNo,
702 BCDCTZo,
703 BCDSETSGNo,
704 BCDSo,
705 BCDTRUNCo,
706 BCDUSo,
707 BCDUTRUNCo
Ehsan Amiri6c17bb02016-12-19 13:35:45 +0000708)>;
709
Stefan Pintilie590eb272017-09-22 20:17:25 +0000710// 12 Cycle DFU operation. Only one DFU unit per CPU so we use a whole
711// superslice. That includes both exec pipelines (EXECO, EXECE) and all three
712// dispatches.
713def : InstRW<[P9_DFU_12C, IP_EXECE_1C, IP_EXECO_1C, DISP_1C, DISP_1C, DISP_1C],
Ehsan Amiri6c17bb02016-12-19 13:35:45 +0000714 (instrs
Stefan Pintiliee894e0f2018-03-01 16:16:08 +0000715 BCDSRo,
Ehsan Amiri6c17bb02016-12-19 13:35:45 +0000716 XSADDQP,
717 XSADDQPO,
718 XSCVDPQP,
719 XSCVQPDP,
720 XSCVQPDPO,
721 XSCVQPSDZ,
722 XSCVQPSWZ,
723 XSCVQPUDZ,
724 XSCVQPUWZ,
725 XSCVSDQP,
726 XSCVUDQP,
727 XSRQPI,
Stefan Pintilie235fb922018-03-08 16:24:33 +0000728 XSRQPIX,
Ehsan Amiri6c17bb02016-12-19 13:35:45 +0000729 XSRQPXP,
730 XSSUBQP,
731 XSSUBQPO
732)>;
733
Stefan Pintiliee894e0f2018-03-01 16:16:08 +0000734// 23 Cycle DFU operation. Only one DFU unit per CPU so we use a whole
735// superslice. That includes both exec pipelines (EXECO, EXECE) and all three
736// dispatches.
737def : InstRW<[P9_DFU_23C, IP_EXECE_1C, IP_EXECO_1C, DISP_1C, DISP_1C, DISP_1C],
738 (instrs
739 BCDCTSQo
740)>;
741
Stefan Pintilie590eb272017-09-22 20:17:25 +0000742// 24 Cycle DFU operation. Only one DFU unit per CPU so we use a whole
743// superslice. That includes both exec pipelines (EXECO, EXECE) and all three
744// dispatches.
745def : InstRW<[P9_DFU_24C, IP_EXECE_1C, IP_EXECO_1C, DISP_1C, DISP_1C, DISP_1C],
Ehsan Amiri6c17bb02016-12-19 13:35:45 +0000746 (instrs
747 XSMADDQP,
748 XSMADDQPO,
749 XSMSUBQP,
750 XSMSUBQPO,
751 XSMULQP,
752 XSMULQPO,
753 XSNMADDQP,
754 XSNMADDQPO,
755 XSNMSUBQP,
756 XSNMSUBQPO
757)>;
758
Stefan Pintiliee894e0f2018-03-01 16:16:08 +0000759// 37 Cycle DFU operation. Only one DFU unit per CPU so we use a whole
760// superslice. That includes both exec pipelines (EXECO, EXECE) and all three
761// dispatches.
762def : InstRW<[P9_DFU_37C, IP_EXECE_1C, IP_EXECO_1C, DISP_1C, DISP_1C, DISP_1C],
763 (instrs
764 BCDCFSQo
765)>;
766
Stefan Pintilie590eb272017-09-22 20:17:25 +0000767// 58 Cycle DFU operation. Only one DFU unit per CPU so we use a whole
768// superslice. That includes both exec pipelines (EXECO, EXECE) and all three
769// dispatches.
770def : InstRW<[P9_DFU_58C, IP_EXECE_1C, IP_EXECO_1C, DISP_1C, DISP_1C, DISP_1C],
Ehsan Amiri6c17bb02016-12-19 13:35:45 +0000771 (instrs
772 XSDIVQP,
773 XSDIVQPO
774)>;
775
Stefan Pintilie590eb272017-09-22 20:17:25 +0000776// 76 Cycle DFU operation. Only one DFU unit per CPU so we use a whole
777// superslice. That includes both exec pipelines (EXECO, EXECE) and all three
778// dispatches.
779def : InstRW<[P9_DFU_76C, IP_EXECE_1C, IP_EXECO_1C, DISP_1C, DISP_1C, DISP_1C],
Ehsan Amiri6c17bb02016-12-19 13:35:45 +0000780 (instrs
781 XSSQRTQP,
782 XSSQRTQPO
783)>;
784
Stefan Pintilie235fb922018-03-08 16:24:33 +0000785// 6 Cycle load uses a single slice.
786def : InstRW<[P9_LS_6C, IP_AGEN_1C, DISP_1C, DISP_1C],
787 (instrs
788 (instregex "LXVL(L)?")
789)>;
790
Stefan Pintilie590eb272017-09-22 20:17:25 +0000791// 5 Cycle load uses a single slice.
Ehsan Amiri6c17bb02016-12-19 13:35:45 +0000792def : InstRW<[P9_LS_5C, IP_AGEN_1C, DISP_1C, DISP_1C],
793 (instrs
Stefan Pintilie235fb922018-03-08 16:24:33 +0000794 (instregex "LVE(B|H|W)X$"),
795 (instregex "LVX(L)?"),
796 (instregex "LXSI(B|H)ZX$"),
Ehsan Amiri6c17bb02016-12-19 13:35:45 +0000797 LXSDX,
Stefan Pintilie235fb922018-03-08 16:24:33 +0000798 LXVB16X,
Ehsan Amiri6c17bb02016-12-19 13:35:45 +0000799 LXVD2X,
Stefan Pintiliee894e0f2018-03-01 16:16:08 +0000800 LXVWSX,
Ehsan Amiri6c17bb02016-12-19 13:35:45 +0000801 LXSIWZX,
802 LXV,
Stefan Pintilie590eb272017-09-22 20:17:25 +0000803 LXVX,
804 LXSD,
Tony Jiang438bf4a2017-11-20 14:38:30 +0000805 DFLOADf64,
Stefan Pintilie626b6512018-02-23 20:37:10 +0000806 XFLOADf64,
807 LIWZX
Ehsan Amiri6c17bb02016-12-19 13:35:45 +0000808)>;
809
Stefan Pintilie590eb272017-09-22 20:17:25 +0000810// 4 Cycle load uses a single slice.
811def : InstRW<[P9_LS_4C, IP_AGEN_1C, DISP_1C, DISP_1C],
812 (instrs
Stefan Pintilied45db612018-03-05 14:34:59 +0000813 COPY,
814 CP_ABORT,
815 DARN,
816 EnforceIEIO,
817 ISYNC,
Stefan Pintilie235fb922018-03-08 16:24:33 +0000818 MSGSYNC,
819 TLBSYNC,
820 SYNC,
Stefan Pintilied45db612018-03-05 14:34:59 +0000821 (instregex "DCB(F|T|ST)(EP)?$"),
822 (instregex "DCBZ(L)?(EP)?$"),
823 (instregex "DCBTST(EP)?$"),
824 (instregex "CP_COPY(8)?$"),
825 (instregex "CP_PASTE(8)?$"),
826 (instregex "ICBI(EP)?$"),
827 (instregex "ICBT(LS)?$"),
828 (instregex "LBARX(L)?$"),
829 (instregex "LBZ(CIX|8|X|X8)?$"),
Stefan Pintilie235fb922018-03-08 16:24:33 +0000830 (instregex "LD(ARX|ARXL|BRX|CIX|X)?$"),
831 (instregex "LH(A|B)RX(L)?(8)?$"),
832 (instregex "LWARX(L)?$"),
833 (instregex "LWBRX(8)?$"),
834 (instregex "LWZ(8|CIX|X|X8)?$"),
835 LHZ,
836 LHZ8,
837 LHZCIX,
838 LHZX,
839 LHZX8,
840 LMW,
841 LSWI
Stefan Pintilie590eb272017-09-22 20:17:25 +0000842)>;
843
844// 4 Cycle Restricted load uses a single slice but the dispatch for the whole
845// superslice.
846def : InstRW<[P9_LS_4C, IP_AGEN_1C, DISP_1C, DISP_1C, DISP_1C],
Ehsan Amiri6c17bb02016-12-19 13:35:45 +0000847 (instrs
848 LFIWZX,
849 LFDX,
850 LFD
851)>;
852
Stefan Pintilie235fb922018-03-08 16:24:33 +0000853// Cracked load instructions.
854// Load instruction that can be done in parallel.
855def : InstRW<[P9_LS_4C, P9_LS_4C, IP_AGEN_1C, IP_AGEN_1C,
856 DISP_1C, DISP_1C, DISP_1C, DISP_1C],
857 (instrs
858 SLBIA,
859 SLBIE,
860 SLBMFEE,
861 SLBMFEV,
862 SLBMTE,
863 TLBIEL
864)>;
865
866// Cracked Load instruction.
867// Requires Load and ALU pieces totaling 6 cycles. The Load and ALU
868// operations can be run in parallel.
869def : InstRW<[P9_LS_4C, P9_ALU_2C, IP_EXEC_1C, IP_AGEN_1C,
870 DISP_1C, DISP_1C, DISP_1C, DISP_1C],
871 (instrs
872 (instregex "L(W|H)ZU(X)?(8)?$"),
873 TEND
874)>;
875
876def : InstRW<[P9_StoreAndALUOp_3C, IP_EXEC_1C, IP_EXEC_1C, IP_AGEN_1C,
877 DISP_1C, DISP_1C, DISP_1C, DISP_1C, DISP_1C],
878 (instrs
879 (instregex "ST(B|H|W|D)CX$")
880)>;
881
Stefan Pintilied45db612018-03-05 14:34:59 +0000882// Cracked Load instruction.
883// Requires consecutive Load and ALU pieces totaling 6 cycles. The Load and ALU
884// operations cannot be done at the same time and so their latencies are added.
885def : InstRW<[P9_LoadAndALUOp_6C, IP_EXEC_1C, IP_AGEN_1C,
886 DISP_1C, DISP_1C, DISP_1C, DISP_1C],
887 (instrs
Stefan Pintilie235fb922018-03-08 16:24:33 +0000888 (instregex "LHA(X)?(8)?$"),
889 (instregex "CP_PASTE(8)?o$"),
890 (instregex "LWA(X)?(_32)?$"),
891 TCHECK
Stefan Pintilied45db612018-03-05 14:34:59 +0000892)>;
893
Stefan Pintilie590eb272017-09-22 20:17:25 +0000894// Cracked Restricted Load instruction.
895// Requires consecutive Load and ALU pieces totaling 6 cycles. The Load and ALU
896// operations cannot be done at the same time and so their latencies are added.
897// Full 6 dispatches are required as this is both cracked and restricted.
898def : InstRW<[P9_LoadAndALUOp_6C, IP_EXEC_1C, IP_AGEN_1C,
Ehsan Amiri6c17bb02016-12-19 13:35:45 +0000899 DISP_1C, DISP_1C, DISP_1C, DISP_1C, DISP_1C, DISP_1C],
900 (instrs
Stefan Pintiliee894e0f2018-03-01 16:16:08 +0000901 LFIWAX
Ehsan Amiri6c17bb02016-12-19 13:35:45 +0000902)>;
903
Stefan Pintilie590eb272017-09-22 20:17:25 +0000904// Cracked Load instruction.
905// Requires consecutive Load and ALU pieces totaling 7 cycles. The Load and ALU
906// operations cannot be done at the same time and so their latencies are added.
907// Full 4 dispatches are required as this is a cracked instruction.
908def : InstRW<[P9_LoadAndALUOp_7C, IP_AGEN_1C, IP_EXEC_1C,
909 DISP_1C, DISP_1C, DISP_1C, DISP_1C],
910 (instrs
Stefan Pintilie590eb272017-09-22 20:17:25 +0000911 LXSIWAX,
Stefan Pintilie626b6512018-02-23 20:37:10 +0000912 LIWAX
Stefan Pintilie590eb272017-09-22 20:17:25 +0000913)>;
914
Stefan Pintiliee894e0f2018-03-01 16:16:08 +0000915// Cracked Load instruction.
916// Requires consecutive Load (4 cycles) and ALU (3 cycles) pieces totaling 7
917// cycles. The Load and ALU operations cannot be done at the same time and so
918// their latencies are added.
919// Full 6 dispatches are required as this is a restricted instruction.
920def : InstRW<[P9_LoadAndALU2Op_7C, IP_AGEN_1C, IP_EXEC_1C,
921 DISP_1C, DISP_1C, DISP_1C, DISP_1C, DISP_1C, DISP_1C],
922 (instrs
923 LFSX,
924 LFS
925)>;
926
927// Cracked Load instruction.
928// Requires consecutive Load and ALU pieces totaling 8 cycles. The Load and ALU
929// operations cannot be done at the same time and so their latencies are added.
930// Full 4 dispatches are required as this is a cracked instruction.
931def : InstRW<[P9_LoadAndALU2Op_8C, IP_AGEN_1C, IP_EXEC_1C,
932 DISP_1C, DISP_1C, DISP_1C, DISP_1C],
933 (instrs
934 LXSSP,
935 LXSSPX,
936 XFLOADf32,
937 DFLOADf32
938)>;
939
Stefan Pintilie235fb922018-03-08 16:24:33 +0000940// Cracked 3-Way Load Instruction
941// Load with two ALU operations that depend on each other
942def : InstRW<[P9_LoadAndALUOp_6C, P9_ALU_2C, IP_AGEN_1C, IP_EXEC_1C, IP_EXEC_1C,
943 DISP_1C, DISP_1C, DISP_1C, DISP_1C, DISP_1C, DISP_1C],
944 (instrs
945 (instregex "LHAU(X)?(8)?$"),
946 LWAUX
947)>;
948
Stefan Pintilie590eb272017-09-22 20:17:25 +0000949// Cracked Load that requires the PM resource.
950// Since the Load and the PM cannot be done at the same time the latencies are
951// added. Requires 8 cycles.
952// Since the PM requires the full superslice we need both EXECE, EXECO pipelines
953// as well as 3 dispatches for the PM. The Load requires the remaining 2
954// dispatches.
955def : InstRW<[P9_LoadAndPMOp_8C, IP_AGEN_1C, IP_EXECE_1C, IP_EXECO_1C,
956 DISP_1C, DISP_1C, DISP_1C, DISP_1C, DISP_1C],
Ehsan Amiri6c17bb02016-12-19 13:35:45 +0000957 (instrs
Stefan Pintilie235fb922018-03-08 16:24:33 +0000958 LXVH8X,
Ehsan Amiri6c17bb02016-12-19 13:35:45 +0000959 LXVDSX,
960 LXVW4X
961)>;
962
Stefan Pintilie590eb272017-09-22 20:17:25 +0000963// Single slice Restricted store operation. The restricted operation requires
964// all three dispatches for the superslice.
Ehsan Amiri6c17bb02016-12-19 13:35:45 +0000965def : InstRW<[P9_LS_1C, IP_EXEC_1C, IP_AGEN_1C, DISP_1C, DISP_1C, DISP_1C],
966 (instrs
Stefan Pintilie626b6512018-02-23 20:37:10 +0000967 (instregex "STF(S|D|IWX|SX|DX)$"),
Stefan Pintilie235fb922018-03-08 16:24:33 +0000968 (instregex "STXS(D|DX|SPX|IWX|IBX|IHX|SP)(v)?$"),
969 (instregex "STW(8)?$"),
Stefan Pintilie590eb272017-09-22 20:17:25 +0000970 DFSTOREf32,
Tony Jiang438bf4a2017-11-20 14:38:30 +0000971 DFSTOREf64,
972 XFSTOREf32,
973 XFSTOREf64,
Stefan Pintilie235fb922018-03-08 16:24:33 +0000974 STIWX,
975 SLBIEG,
976 STMW,
977 STSWI,
978 TLBIE,
979 (instregex "ST(W|H|D)BRX$"),
980 (instregex "ST(B|H|D)(8)?$"),
981 (instregex "ST(B|W|H|D)(CI)?X(8)?$")
Ehsan Amiri6c17bb02016-12-19 13:35:45 +0000982)>;
983
Stefan Pintilie590eb272017-09-22 20:17:25 +0000984// Store operation that requires the whole superslice.
985def : InstRW<[P9_LS_1C, IP_EXECE_1C, IP_EXECO_1C, IP_AGEN_1C,
986 DISP_1C, DISP_1C, DISP_1C],
Ehsan Amiri6c17bb02016-12-19 13:35:45 +0000987 (instrs
Stefan Pintilie235fb922018-03-08 16:24:33 +0000988 (instregex "STVE(B|H|W)X$"),
989 (instregex "STVX(L)?$"),
990 (instregex "STXV(B16X|H8X|W4X|D2X|L|LL|X)?$")
Ehsan Amiri6c17bb02016-12-19 13:35:45 +0000991)>;
992
Stefan Pintilie626b6512018-02-23 20:37:10 +0000993// Cracked instruction made up up two restriced stores.
Stefan Pintilie235fb922018-03-08 16:24:33 +0000994//def : InstRW<[P9_LS_1C, P9_LS_1C, IP_EXEC_1C, IP_EXEC_1C, IP_AGEN_1C,
995// IP_AGEN_1C, DISP_1C, DISP_1C, DISP_1C, DISP_1C, DISP_1C, DISP_1C],
996// (instrs
997// STFDEPX
998//)>;
999
1000// 5 Cycle DIV operation. Only one DIV unit per superslice so we use the whole
1001// superslice. That includes both exec pipelines (EXECO, EXECE) and all three
1002// dispatches.
1003def : InstRW<[P9_DIV_5C, IP_EXECE_1C, IP_EXECO_1C, DISP_1C, DISP_1C, DISP_1C],
Stefan Pintilie626b6512018-02-23 20:37:10 +00001004 (instrs
Stefan Pintilie235fb922018-03-08 16:24:33 +00001005 (instregex "MTCTR(8)?(loop)?$"),
1006 (instregex "MTLR(8)?$")
Stefan Pintilie626b6512018-02-23 20:37:10 +00001007)>;
1008
1009// 12 Cycle DIV operation. Only one DIV unit per superslice so we use the whole
1010// superslice. That includes both exec pipelines (EXECO, EXECE) and all three
1011// dispatches.
1012def : InstRW<[P9_DIV_12C, IP_EXECE_1C, IP_EXECO_1C, DISP_1C, DISP_1C, DISP_1C],
1013 (instrs
Stefan Pintiliee894e0f2018-03-01 16:16:08 +00001014 (instregex "M(T|F)VRSAVE(v)?$"),
Stefan Pintilie235fb922018-03-08 16:24:33 +00001015 (instregex "M(T|F)PMR$"),
1016 (instregex "M(T|F)TB(8)?$"),
Stefan Pintiliee894e0f2018-03-01 16:16:08 +00001017 (instregex "MF(SPR|CTR|LR)(8)?$"),
Stefan Pintilie235fb922018-03-08 16:24:33 +00001018 (instregex "M(T|F)MSR(D)?$"),
1019 (instregex "MTSPR(8)?$")
Stefan Pintilie626b6512018-02-23 20:37:10 +00001020)>;
Ehsan Amiri6c17bb02016-12-19 13:35:45 +00001021
Stefan Pintilie590eb272017-09-22 20:17:25 +00001022// 16 Cycle DIV operation. Only one DIV unit per superslice so we use the whole
1023// superslice. That includes both exec pipelines (EXECO, EXECE) and all three
1024// dispatches.
1025def : InstRW<[P9_DIV_16C_8, IP_EXECO_1C, IP_EXECE_1C,
1026 DISP_1C, DISP_1C, DISP_1C],
Ehsan Amiri6c17bb02016-12-19 13:35:45 +00001027 (instrs
1028 DIVW,
Stefan Pintilie590eb272017-09-22 20:17:25 +00001029 DIVWU,
1030 MODSW
Ehsan Amiri6c17bb02016-12-19 13:35:45 +00001031)>;
1032
Stefan Pintilie590eb272017-09-22 20:17:25 +00001033// 24 Cycle DIV operation. Only one DIV unit per superslice so we use the whole
1034// superslice. That includes both exec pipelines (EXECO, EXECE) and all three
1035// dispatches.
1036def : InstRW<[P9_DIV_24C_8, IP_EXECO_1C, IP_EXECE_1C,
1037 DISP_1C, DISP_1C, DISP_1C],
Ehsan Amiri6c17bb02016-12-19 13:35:45 +00001038 (instrs
1039 DIVWE,
1040 DIVD,
1041 DIVWEU,
Stefan Pintilie590eb272017-09-22 20:17:25 +00001042 DIVDU,
1043 MODSD,
1044 MODUD,
1045 MODUW
Ehsan Amiri6c17bb02016-12-19 13:35:45 +00001046)>;
1047
Stefan Pintilie590eb272017-09-22 20:17:25 +00001048// 40 Cycle DIV operation. Only one DIV unit per superslice so we use the whole
1049// superslice. That includes both exec pipelines (EXECO, EXECE) and all three
1050// dispatches.
1051def : InstRW<[P9_DIV_40C_8, IP_EXECO_1C, IP_EXECE_1C,
1052 DISP_1C, DISP_1C, DISP_1C],
Ehsan Amiri6c17bb02016-12-19 13:35:45 +00001053 (instrs
1054 DIVDE,
1055 DIVDEU
1056)>;
1057
Stefan Pintilie590eb272017-09-22 20:17:25 +00001058// Cracked DIV and ALU operation. Requires one full slice for the ALU operation
1059// and one full superslice for the DIV operation since there is only one DIV
1060// per superslice. Latency of DIV plus ALU is 26.
Stefan Pintilied45db612018-03-05 14:34:59 +00001061def : InstRW<[P9_IntDivAndALUOp_18C_8, IP_EXECE_1C, IP_EXECO_1C, IP_EXEC_1C,
1062 DISP_1C, DISP_1C, DISP_1C, DISP_1C, DISP_1C],
1063 (instrs
1064 (instregex "DIVW(U)?(O)?o$")
1065)>;
1066
1067// Cracked DIV and ALU operation. Requires one full slice for the ALU operation
1068// and one full superslice for the DIV operation since there is only one DIV
1069// per superslice. Latency of DIV plus ALU is 26.
Stefan Pintilie590eb272017-09-22 20:17:25 +00001070def : InstRW<[P9_IntDivAndALUOp_26C_8, IP_EXECE_1C, IP_EXECO_1C, IP_EXEC_1C,
1071 DISP_1C, DISP_1C, DISP_1C, DISP_1C, DISP_1C],
Ehsan Amiri6c17bb02016-12-19 13:35:45 +00001072 (instrs
Stefan Pintiliecc330da2017-10-10 13:45:35 +00001073 DIVDo,
1074 DIVDUo,
Ehsan Amiri6c17bb02016-12-19 13:35:45 +00001075 DIVWEo,
1076 DIVWEUo
1077)>;
1078
Stefan Pintilie590eb272017-09-22 20:17:25 +00001079// Cracked DIV and ALU operation. Requires one full slice for the ALU operation
1080// and one full superslice for the DIV operation since there is only one DIV
1081// per superslice. Latency of DIV plus ALU is 42.
1082def : InstRW<[P9_IntDivAndALUOp_42C_8, IP_EXECE_1C, IP_EXECO_1C, IP_EXEC_1C,
1083 DISP_1C, DISP_1C, DISP_1C, DISP_1C, DISP_1C],
Ehsan Amiri6c17bb02016-12-19 13:35:45 +00001084 (instrs
1085 DIVDEo,
1086 DIVDEUo
1087)>;
1088
Ehsan Amiri6c17bb02016-12-19 13:35:45 +00001089// CR access instructions in _BrMCR, IIC_BrMCRX.
1090
Stefan Pintilie590eb272017-09-22 20:17:25 +00001091// Cracked, restricted, ALU operations.
1092// Here the two ALU ops can actually be done in parallel and therefore the
1093// latencies are not added together. Otherwise this is like having two
1094// instructions running together on two pipelines and 6 dispatches.
1095// ALU ops are 2 cycles each.
Ehsan Amiri6c17bb02016-12-19 13:35:45 +00001096def : InstRW<[P9_ALU_2C, P9_ALU_2C, IP_EXEC_1C, IP_EXEC_1C,
1097 DISP_1C, DISP_1C, DISP_1C, DISP_1C, DISP_1C, DISP_1C],
1098 (instrs
1099 MTOCRF,
1100 MTOCRF8,
1101 MTCRF,
1102 MTCRF8
1103)>;
1104
Stefan Pintiliee894e0f2018-03-01 16:16:08 +00001105// Cracked ALU operations.
1106// Here the two ALU ops can actually be done in parallel and therefore the
1107// latencies are not added together. Otherwise this is like having two
1108// instructions running together on two pipelines and 4 dispatches.
1109// ALU ops are 2 cycles each.
1110def : InstRW<[P9_ALU_2C, P9_ALU_2C, IP_EXEC_1C, IP_EXEC_1C,
1111 DISP_1C, DISP_1C, DISP_1C, DISP_1C],
1112 (instrs
Stefan Pintilie235fb922018-03-08 16:24:33 +00001113 (instregex "ADDC(8)?o$"),
1114 (instregex "SUBFC(8)?o$")
Stefan Pintiliee894e0f2018-03-01 16:16:08 +00001115)>;
1116
Stefan Pintilied45db612018-03-05 14:34:59 +00001117// Cracked ALU operations.
1118// Two ALU ops can be done in parallel.
1119// One is three cycle ALU the ohter is a two cycle ALU.
1120// One of the ALU ops is restricted the other is not so we have a total of
1121// 5 dispatches.
1122def : InstRW<[P9_ALU_2C, P9_ALU_3C, IP_EXEC_1C, IP_EXEC_1C,
1123 DISP_1C, DISP_1C, DISP_1C, DISP_1C, DISP_1C],
1124 (instrs
1125 (instregex "F(N)?ABS(D|S)o$"),
1126 (instregex "FCPSGN(D|S)o$"),
1127 (instregex "FNEG(D|S)o$"),
1128 FMRo
1129)>;
1130
1131// Cracked ALU operations.
Stefan Pintilie590eb272017-09-22 20:17:25 +00001132// Here the two ALU ops can actually be done in parallel and therefore the
1133// latencies are not added together. Otherwise this is like having two
Stefan Pintilied45db612018-03-05 14:34:59 +00001134// instructions running together on two pipelines and 4 dispatches.
Stefan Pintilie590eb272017-09-22 20:17:25 +00001135// ALU ops are 3 cycles each.
1136def : InstRW<[P9_ALU_3C, P9_ALU_3C, IP_EXEC_1C, IP_EXEC_1C,
Ehsan Amiri6c17bb02016-12-19 13:35:45 +00001137 DISP_1C, DISP_1C, DISP_1C, DISP_1C],
1138 (instrs
1139 MCRFS
1140)>;
1141
Stefan Pintilie235fb922018-03-08 16:24:33 +00001142// Cracked Restricted ALU operations.
1143// Here the two ALU ops can actually be done in parallel and therefore the
1144// latencies are not added together. Otherwise this is like having two
1145// instructions running together on two pipelines and 6 dispatches.
1146// ALU ops are 3 cycles each.
1147def : InstRW<[P9_ALU_3C, P9_ALU_3C, IP_EXEC_1C, IP_EXEC_1C,
1148 DISP_1C, DISP_1C, DISP_1C, DISP_1C, DISP_1C, DISP_1C],
1149 (instrs
1150 (instregex "MTFSF(b|o)?$"),
1151 (instregex "MTFSFI(o)?$")
1152)>;
1153
Stefan Pintilieb5a94402018-03-02 14:41:38 +00001154// Cracked instruction made of two ALU ops.
1155// The two ops cannot be done in parallel.
Stefan Pintilie235fb922018-03-08 16:24:33 +00001156// One of the ALU ops is restricted and takes 3 dispatches.
Stefan Pintilie626b6512018-02-23 20:37:10 +00001157def : InstRW<[P9_ALUOpAndALUOp_4C, IP_EXEC_1C, IP_EXEC_1C,
1158 DISP_1C, DISP_1C, DISP_1C, DISP_1C, DISP_1C],
1159 (instrs
Stefan Pintilie235fb922018-03-08 16:24:33 +00001160 (instregex "RLD(I)?C(R|L)o$"),
1161 (instregex "RLW(IMI|INM|NM)(8)?o$"),
1162 (instregex "SLW(8)?o$"),
1163 (instregex "SRAW(I)?o$"),
1164 (instregex "SRW(8)?o$"),
1165 RLDICL_32o,
1166 RLDIMIo
1167)>;
1168
1169// Cracked instruction made of two ALU ops.
1170// The two ops cannot be done in parallel.
1171// Both of the ALU ops are restricted and take 3 dispatches.
1172def : InstRW<[P9_ALU2OpAndALU2Op_6C, IP_EXEC_1C, IP_EXEC_1C,
1173 DISP_1C, DISP_1C, DISP_1C, DISP_1C, DISP_1C, DISP_1C],
1174 (instrs
1175 (instregex "MFFS(L|CE|o)?$")
1176)>;
1177
1178def : InstRW<[P9_ALUOpAndALUOpAndALUOp_6C, IP_EXEC_1C, IP_EXEC_1C, IP_EXEC_1C,
1179 DISP_1C, DISP_1C, DISP_1C, DISP_1C, DISP_1C, DISP_1C, DISP_1C,
1180 DISP_1C, DISP_1C],
1181 (instrs
1182 (instregex "MFCR(8)?$")
Stefan Pintilie626b6512018-02-23 20:37:10 +00001183)>;
1184
Stefan Pintilieb5a94402018-03-02 14:41:38 +00001185// Cracked instruction made of two ALU ops.
1186// The two ops cannot be done in parallel.
1187def : InstRW<[P9_ALUOpAndALUOp_4C, IP_EXEC_1C, IP_EXEC_1C,
1188 DISP_1C, DISP_1C, DISP_1C, DISP_1C],
1189 (instrs
Stefan Pintilie235fb922018-03-08 16:24:33 +00001190 (instregex "EXTSWSLIo$"),
1191 (instregex "SRAD(I)?o$"),
1192 SLDo,
1193 SRDo,
1194 RLDICo
Stefan Pintilieb5a94402018-03-02 14:41:38 +00001195)>;
1196
Ehsan Amiri6c17bb02016-12-19 13:35:45 +00001197// FP Div instructions in IIC_FPDivD and IIC_FPDivS.
1198
Stefan Pintilie590eb272017-09-22 20:17:25 +00001199// 33 Cycle DP Instruction Restricted. Takes one slice and 3 dispatches.
Ehsan Amiri6c17bb02016-12-19 13:35:45 +00001200def : InstRW<[P9_DP_33C_8, IP_EXEC_1C, DISP_1C, DISP_1C, DISP_1C],
1201 (instrs
Stefan Pintilie590eb272017-09-22 20:17:25 +00001202 FDIV
1203)>;
1204
Stefan Pintilied45db612018-03-05 14:34:59 +00001205// 33 Cycle DP Instruction Restricted and Cracked with 3 Cycle ALU.
Stefan Pintiliee894e0f2018-03-01 16:16:08 +00001206def : InstRW<[P9_DPOpAndALU2Op_36C_8, IP_EXEC_1C, IP_EXEC_1C,
Stefan Pintiliecc330da2017-10-10 13:45:35 +00001207 DISP_1C, DISP_1C, DISP_1C, DISP_1C, DISP_1C],
1208 (instrs
1209 FDIVo
1210)>;
1211
Stefan Pintilie235fb922018-03-08 16:24:33 +00001212// 36 Cycle DP Instruction.
1213def : InstRW<[P9_DP_36C_10, IP_EXEC_1C, DISP_1C, DISP_1C],
1214 (instrs
1215 XSSQRTDP
1216)>;
1217
Stefan Pintilied45db612018-03-05 14:34:59 +00001218// 36 Cycle DP Instruction Restricted. Takes one slice and 3 dispatches.
1219def : InstRW<[P9_DP_36C_10, IP_EXEC_1C, DISP_1C, DISP_1C, DISP_1C],
1220 (instrs
1221 FSQRT
1222)>;
1223
Stefan Pintilie235fb922018-03-08 16:24:33 +00001224// 36 Cycle DP Vector Instruction.
1225def : InstRW<[P9_DPE_36C_10, P9_DPO_36C_10, IP_EXECE_1C, IP_EXECO_1C,
1226 DISP_1C, DISP_1C, DISP_1C],
1227 (instrs
1228 XVSQRTDP
1229)>;
1230
1231// 27 Cycle DP Vector Instruction.
1232def : InstRW<[P9_DPE_27C_10, P9_DPO_27C_10, IP_EXECE_1C, IP_EXECO_1C,
1233 DISP_1C, DISP_1C, DISP_1C],
1234 (instrs
1235 XVSQRTSP
1236)>;
1237
Stefan Pintilied45db612018-03-05 14:34:59 +00001238// 36 Cycle DP Instruction Restricted and Cracked with 3 Cycle ALU.
1239def : InstRW<[P9_DPOpAndALU2Op_39C_10, IP_EXEC_1C, IP_EXEC_1C,
1240 DISP_1C, DISP_1C, DISP_1C, DISP_1C, DISP_1C],
1241 (instrs
1242 FSQRTo
1243)>;
1244
Stefan Pintilie235fb922018-03-08 16:24:33 +00001245// 26 Cycle DP Instruction.
1246def : InstRW<[P9_DP_26C_5, IP_EXEC_1C, DISP_1C, DISP_1C],
1247 (instrs
1248 XSSQRTSP
1249)>;
1250
Stefan Pintilied45db612018-03-05 14:34:59 +00001251// 26 Cycle DP Instruction Restricted. Takes one slice and 3 dispatches.
1252def : InstRW<[P9_DP_26C_5, IP_EXEC_1C, DISP_1C, DISP_1C, DISP_1C],
1253 (instrs
1254 FSQRTS
1255)>;
1256
1257// 26 Cycle DP Instruction Restricted and Cracked with 3 Cycle ALU.
1258def : InstRW<[P9_DPOpAndALU2Op_29C_5, IP_EXEC_1C, IP_EXEC_1C,
1259 DISP_1C, DISP_1C, DISP_1C, DISP_1C, DISP_1C],
1260 (instrs
1261 FSQRTSo
1262)>;
1263
Stefan Pintilie590eb272017-09-22 20:17:25 +00001264// 33 Cycle DP Instruction. Takes one slice and 2 dispatches.
1265def : InstRW<[P9_DP_33C_8, IP_EXEC_1C, DISP_1C, DISP_1C],
1266 (instrs
Ehsan Amiri6c17bb02016-12-19 13:35:45 +00001267 XSDIVDP
1268)>;
1269
Stefan Pintilie590eb272017-09-22 20:17:25 +00001270// 22 Cycle DP Instruction Restricted. Takes one slice and 3 dispatches.
Ehsan Amiri6c17bb02016-12-19 13:35:45 +00001271def : InstRW<[P9_DP_22C_5, IP_EXEC_1C, DISP_1C, DISP_1C, DISP_1C],
1272 (instrs
Stefan Pintilie590eb272017-09-22 20:17:25 +00001273 FDIVS
1274)>;
1275
Stefan Pintiliecc330da2017-10-10 13:45:35 +00001276// 22 Cycle DP Instruction Restricted and Cracked with 2 Cycle ALU.
Stefan Pintiliee894e0f2018-03-01 16:16:08 +00001277def : InstRW<[P9_DPOpAndALU2Op_25C_5, IP_EXEC_1C, IP_EXEC_1C,
Stefan Pintiliecc330da2017-10-10 13:45:35 +00001278 DISP_1C, DISP_1C, DISP_1C, DISP_1C, DISP_1C],
1279 (instrs
1280 FDIVSo
1281)>;
1282
Stefan Pintilie590eb272017-09-22 20:17:25 +00001283// 22 Cycle DP Instruction. Takes one slice and 2 dispatches.
1284def : InstRW<[P9_DP_22C_5, IP_EXEC_1C, DISP_1C, DISP_1C],
1285 (instrs
Ehsan Amiri6c17bb02016-12-19 13:35:45 +00001286 XSDIVSP
1287)>;
1288
Stefan Pintilie590eb272017-09-22 20:17:25 +00001289// 24 Cycle DP Vector Instruction. Takes one full superslice.
1290// Includes both EXECE, EXECO pipelines and all 3 dispatches for the given
1291// superslice.
1292def : InstRW<[P9_DPE_24C_8, P9_DPO_24C_8, IP_EXECE_1C, IP_EXECO_1C,
1293 DISP_1C, DISP_1C, DISP_1C],
Ehsan Amiri6c17bb02016-12-19 13:35:45 +00001294 (instrs
1295 XVDIVSP
1296)>;
1297
Stefan Pintilie590eb272017-09-22 20:17:25 +00001298// 33 Cycle DP Vector Instruction. Takes one full superslice.
1299// Includes both EXECE, EXECO pipelines and all 3 dispatches for the given
1300// superslice.
1301def : InstRW<[P9_DPE_33C_8, P9_DPO_33C_8, IP_EXECE_1C, IP_EXECO_1C,
1302 DISP_1C, DISP_1C, DISP_1C],
Ehsan Amiri6c17bb02016-12-19 13:35:45 +00001303 (instrs
1304 XVDIVDP
1305)>;
1306
Ehsan Amiri6c17bb02016-12-19 13:35:45 +00001307// Load instructions in IIC_LdStLFDU and IIC_LdStLFDUX.
1308
Stefan Pintilie590eb272017-09-22 20:17:25 +00001309// Instruction cracked into three pieces. One Load and two ALU operations.
1310// The Load and one of the ALU ops cannot be run at the same time and so the
1311// latencies are added together for 6 cycles. The remainaing ALU is 2 cycles.
1312// Both the load and the ALU that depends on it are restricted and so they take
1313// a total of 6 dispatches. The final 2 dispatches come from the second ALU op.
1314// The two EXEC pipelines are for the 2 ALUs while the AGEN is for the load.
Stefan Pintiliee894e0f2018-03-01 16:16:08 +00001315def : InstRW<[P9_LoadAndALU2Op_7C, P9_ALU_2C,
Ehsan Amiri6c17bb02016-12-19 13:35:45 +00001316 IP_AGEN_1C, IP_EXEC_1C, IP_EXEC_1C,
1317 DISP_1C, DISP_1C, DISP_1C, DISP_1C,
1318 DISP_1C, DISP_1C, DISP_1C, DISP_1C],
1319 (instrs
Stefan Pintilie626b6512018-02-23 20:37:10 +00001320 (instregex "LF(SU|SUX)$")
1321)>;
1322
1323// Cracked instruction made up of a Store and an ALU. The ALU does not depend on
1324// the store and so it can be run at the same time as the store. The store is
1325// also restricted.
1326def : InstRW<[P9_LS_1C, P9_ALU_2C, IP_AGEN_1C, IP_EXEC_1C, IP_EXEC_1C,
1327 DISP_1C, DISP_1C, DISP_1C, DISP_1C, DISP_1C],
1328 (instrs
Stefan Pintilie235fb922018-03-08 16:24:33 +00001329 (instregex "STF(S|D)U(X)?$"),
1330 (instregex "ST(B|H|W|D)U(X)?(8)?$")
Ehsan Amiri6c17bb02016-12-19 13:35:45 +00001331)>;
1332
Stefan Pintilie590eb272017-09-22 20:17:25 +00001333// Cracked instruction made up of a Load and an ALU. The ALU does not depend on
Stefan Pintilied45db612018-03-05 14:34:59 +00001334// the load and so it can be run at the same time as the load.
1335def : InstRW<[P9_LS_4C, P9_ALU_2C, IP_AGEN_1C, IP_EXEC_1C,
1336 DISP_1C, DISP_1C, DISP_1C, DISP_1C],
1337 (instrs
1338 (instregex "LBZU(X)?(8)?$"),
1339 (instregex "LDU(X)?$")
1340)>;
1341
1342
1343// Cracked instruction made up of a Load and an ALU. The ALU does not depend on
Stefan Pintilie590eb272017-09-22 20:17:25 +00001344// the load and so it can be run at the same time as the load. The load is also
1345// restricted. 3 dispatches are from the restricted load while the other two
1346// are from the ALU. The AGEN pipeline is from the load and the EXEC pipeline
1347// is required for the ALU.
1348def : InstRW<[P9_LS_4C, P9_ALU_2C, IP_AGEN_1C, IP_EXEC_1C,
Ehsan Amiri6c17bb02016-12-19 13:35:45 +00001349 DISP_1C, DISP_1C, DISP_1C, DISP_1C, DISP_1C],
1350 (instrs
Stefan Pintilie626b6512018-02-23 20:37:10 +00001351 (instregex "LF(DU|DUX)$")
Ehsan Amiri6c17bb02016-12-19 13:35:45 +00001352)>;
1353
Stefan Pintilie590eb272017-09-22 20:17:25 +00001354// Crypto Instructions
1355
1356// 6 Cycle CY operation. Only one CY unit per CPU so we use a whole
1357// superslice. That includes both exec pipelines (EXECO, EXECE) and all three
1358// dispatches.
1359def : InstRW<[P9_CY_6C, IP_EXECO_1C, IP_EXECE_1C, DISP_1C, DISP_1C, DISP_1C],
1360 (instrs
Stefan Pintiliee894e0f2018-03-01 16:16:08 +00001361 (instregex "VPMSUM(B|H|W|D)$"),
1362 (instregex "V(N)?CIPHER(LAST)?$"),
1363 VSBOX
Stefan Pintilie590eb272017-09-22 20:17:25 +00001364)>;
Stefan Pintilie626b6512018-02-23 20:37:10 +00001365
Stefan Pintiliee894e0f2018-03-01 16:16:08 +00001366// Branch Instructions
1367
1368// Two Cycle Branch
1369def : InstRW<[P9_BR_2C, DISP_1C, DISP_1C],
1370 (instrs
1371 (instregex "BCCCTR(L)?(8)?$"),
1372 (instregex "BCCL(A|R|RL)?$"),
1373 (instregex "BCCTR(L)?(8)?(n)?$"),
1374 (instregex "BD(N)?Z(8|A|Am|Ap|m|p)?$"),
1375 (instregex "BD(N)?ZL(A|Am|Ap|R|R8|RL|RLm|RLp|Rm|Rp|m|p)?$"),
1376 (instregex "BL(_TLS)?$"),
1377 (instregex "BL8(_TLS|_NOP|_NOP_TLS|_TLS_)?$"),
1378 (instregex "BLA(8|8_NOP)?$"),
1379 (instregex "BLR(8|L)?$"),
1380 (instregex "TAILB(A)?(8)?$"),
1381 (instregex "TAILBCTR(8)?$"),
1382 (instregex "gBC(A|Aat|CTR|CTRL|L|LA|LAat|LR|LRL|Lat|at)?$"),
1383 (instregex "BCLR(L)?(n)?$"),
1384 (instregex "BCTR(L)?(8)?$"),
1385 B,
1386 BA,
1387 BC,
1388 BCC,
1389 BCCA,
1390 BCL,
1391 BCLalways,
1392 BCLn,
1393 BCTRL8_LDinto_toc,
1394 BCn,
1395 CTRL_DEP
1396)>;
1397
1398// Five Cycle Branch with a 2 Cycle ALU Op
1399// Operations must be done consecutively and not in parallel.
1400def : InstRW<[P9_BROpAndALUOp_7C, IP_EXEC_1C,
1401 DISP_1C, DISP_1C, DISP_1C, DISP_1C],
1402 (instrs
1403 ADDPCIS
1404)>;
1405
Stefan Pintilied45db612018-03-05 14:34:59 +00001406// Special Extracted Instructions
1407
1408// Atomic Load
1409def : InstRW<[P9_LS_1C, P9_LS_1C, P9_LS_4C, P9_LS_4C, P9_LS_4C,
1410 IP_EXEC_1C, IP_EXEC_1C, IP_AGEN_1C, IP_AGEN_1C, IP_AGEN_1C,
1411 IP_AGEN_1C, IP_AGEN_1C, DISP_1C, DISP_1C, DISP_1C, DISP_1C,
1412 DISP_1C, DISP_1C, DISP_1C, DISP_1C, DISP_1C, DISP_1C, DISP_1C,
1413 DISP_1C],
1414 (instrs
Stefan Pintilie235fb922018-03-08 16:24:33 +00001415 (instregex "L(D|W)AT$")
1416)>;
1417
1418// Atomic Store
1419def : InstRW<[P9_LS_1C, P9_LS_4C, P9_LS_4C, IP_EXEC_1C, IP_AGEN_1C, IP_AGEN_1C,
1420 IP_AGEN_1C, DISP_1C, DISP_1C, DISP_1C, DISP_1C, DISP_1C, DISP_1C,
1421 DISP_1C],
1422 (instrs
1423 (instregex "ST(D|W)AT$")
Stefan Pintilied45db612018-03-05 14:34:59 +00001424)>;
1425
Stefan Pintilieb5a94402018-03-02 14:41:38 +00001426// Signal Processing Engine (SPE) Instructions
1427// These instructions are not supported on Power 9
1428def : InstRW<[],
1429 (instrs
1430 BRINC,
1431 EVABS,
1432 EVEQV,
1433 EVMRA,
1434 EVNAND,
1435 EVNEG,
1436 (instregex "EVADD(I)?W$"),
1437 (instregex "EVADD(SM|SS|UM|US)IAAW$"),
1438 (instregex "EVAND(C)?$"),
1439 (instregex "EVCMP(EQ|GTS|GTU|LTS|LTU)$"),
1440 (instregex "EVCNTL(S|Z)W$"),
1441 (instregex "EVDIVW(S|U)$"),
1442 (instregex "EVEXTS(B|H)$"),
1443 (instregex "EVLD(H|W|D)(X)?$"),
1444 (instregex "EVLHH(E|OS|OU)SPLAT(X)?$"),
1445 (instregex "EVLWHE(X)?$"),
1446 (instregex "EVLWHO(S|U)(X)?$"),
1447 (instregex "EVLW(H|W)SPLAT(X)?$"),
1448 (instregex "EVMERGE(HI|LO|HILO|LOHI)$"),
1449 (instregex "EVMHEG(S|U)M(F|I)A(A|N)$"),
1450 (instregex "EVMHES(M|S)(F|I)(A|AA|AAW|ANW)?$"),
1451 (instregex "EVMHEU(M|S)I(A|AA|AAW|ANW)?$"),
1452 (instregex "EVMHOG(U|S)M(F|I)A(A|N)$"),
1453 (instregex "EVMHOS(M|S)(F|I)(A|AA|AAW|ANW)?$"),
1454 (instregex "EVMHOU(M|S)I(A|AA|ANW|AAW)?$"),
1455 (instregex "EVMWHS(M|S)(F|FA|I|IA)$"),
1456 (instregex "EVMWHUMI(A)?$"),
1457 (instregex "EVMWLS(M|S)IA(A|N)W$"),
1458 (instregex "EVMWLU(M|S)I(A|AA|AAW|ANW)?$"),
1459 (instregex "EVMWSM(F|I)(A|AA|AN)?$"),
1460 (instregex "EVMWSSF(A|AA|AN)?$"),
1461 (instregex "EVMWUMI(A|AA|AN)?$"),
1462 (instregex "EV(N|X)?OR(C)?$"),
1463 (instregex "EVR(LW|LWI|NDW)$"),
1464 (instregex "EVSLW(I)?$"),
1465 (instregex "EVSPLAT(F)?I$"),
1466 (instregex "EVSRW(I)?(S|U)$"),
1467 (instregex "EVST(DD|DH|DW|WHE|WHO|WWE|WWO)(X)?$"),
1468 (instregex "EVSUBF(S|U)(M|S)IAAW$"),
1469 (instregex "EVSUB(I)?FW$")
1470)> { let Unsupported = 1; }
Stefan Pintiliee894e0f2018-03-01 16:16:08 +00001471
Stefan Pintilieb5a94402018-03-02 14:41:38 +00001472// General Instructions without scheduling support.
Stefan Pintilie626b6512018-02-23 20:37:10 +00001473def : InstRW<[],
1474 (instrs
Stefan Pintiliee894e0f2018-03-01 16:16:08 +00001475 (instregex "(H)?RFI(D)?$"),
Stefan Pintilied45db612018-03-05 14:34:59 +00001476 (instregex "DSS(ALL)?$"),
1477 (instregex "DST(ST)?(T)?(64)?$"),
1478 (instregex "ICBL(C|Q)$"),
Stefan Pintilie235fb922018-03-08 16:24:33 +00001479 (instregex "L(W|H|B)EPX$"),
1480 (instregex "ST(W|H|B)EPX$"),
1481 (instregex "(L|ST)FDEPX$"),
1482 (instregex "M(T|F)SR(IN)?$"),
1483 (instregex "M(T|F)DCR$"),
1484 (instregex "NOP_GT_PWR(6|7)$"),
1485 (instregex "TLB(IA|IVAX|SX|SX2|SX2D|LD|LI|RE|RE2|WE|WE2)$"),
1486 (instregex "WRTEE(I)?$"),
Stefan Pintiliee894e0f2018-03-01 16:16:08 +00001487 ATTN,
Stefan Pintiliee894e0f2018-03-01 16:16:08 +00001488 CLRBHRB,
1489 MFBHRBE,
Stefan Pintilie235fb922018-03-08 16:24:33 +00001490 MBAR,
1491 MSYNC,
1492 SLBSYNC,
Stefan Pintiliee894e0f2018-03-01 16:16:08 +00001493 NAP,
Stefan Pintilie235fb922018-03-08 16:24:33 +00001494 STOP,
1495 TRAP,
1496 LDMX,
Stefan Pintiliee894e0f2018-03-01 16:16:08 +00001497 RFCI,
1498 RFDI,
1499 RFMCI,
1500 SC,
Stefan Pintilied45db612018-03-05 14:34:59 +00001501 WAIT,
1502 DCBA,
1503 DCBI,
1504 DCCCI,
Stefan Pintilie235fb922018-03-08 16:24:33 +00001505 ICCCI
Stefan Pintilie626b6512018-02-23 20:37:10 +00001506)> { let Unsupported = 1; }