blob: 177288e531de6cfeeca64af30101789df517a355 [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)?$"),
Ehsan Amiri6c17bb02016-12-19 13:35:45 +000042 VEQV,
Stefan Pintilie590eb272017-09-22 20:17:25 +000043 VRLB,
44 VRLD,
45 VRLDMI,
46 VRLDNM,
47 VRLH,
48 VRLW,
49 VRLWMI,
50 VRLWNM,
51 VSRAB,
52 VSRAD,
53 VSRAH,
54 VSRAW,
55 VSRB,
56 VSRD,
57 VSRH,
58 VSRW,
59 VSLB,
60 VSLD,
61 VSLH,
62 VSLW,
Ehsan Amiri6c17bb02016-12-19 13:35:45 +000063 VMRGEW,
64 VMRGOW,
65 VNAND,
66 VNEGD,
67 VNEGW,
68 VNOR,
69 VOR,
70 VORC,
71 VPOPCNTB,
72 VPOPCNTH,
Ehsan Amiri6c17bb02016-12-19 13:35:45 +000073 VSEL,
Ehsan Amiri6c17bb02016-12-19 13:35:45 +000074 VSUBUBM,
75 VSUBUDM,
76 VSUBUHM,
77 VSUBUWM,
78 VXOR,
79 V_SET0B,
80 V_SET0H,
81 V_SET0,
82 XVABSDP,
83 XVABSSP,
84 XVCPSGNDP,
85 XVCPSGNSP,
86 XVIEXPDP,
87 XVNABSDP,
88 XVNABSSP,
89 XVNEGDP,
90 XVNEGSP,
91 XVXEXPDP,
Stefan Pintilie590eb272017-09-22 20:17:25 +000092 XVIEXPSP,
93 XVXEXPSP,
Ehsan Amiri6c17bb02016-12-19 13:35:45 +000094 XXLAND,
95 XXLANDC,
96 XXLEQV,
97 XXLNAND,
98 XXLNOR,
99 XXLOR,
100 XXLORf,
101 XXLORC,
102 XXLXOR,
Stefan Pintilie590eb272017-09-22 20:17:25 +0000103 XXSEL,
Ehsan Amiri6c17bb02016-12-19 13:35:45 +0000104 XSABSQP,
105 XSCPSGNQP,
106 XSIEXPQP,
107 XSNABSQP,
108 XSNEGQP,
Stefan Pintilie590eb272017-09-22 20:17:25 +0000109 XSXEXPQP
Ehsan Amiri6c17bb02016-12-19 13:35:45 +0000110)>;
111
Stefan Pintilie590eb272017-09-22 20:17:25 +0000112// Restricted Dispatch ALU operation for 3 cycles. The operation runs on a
113// slingle slice. However, since it is Restricted it requires all 3 dispatches
114// (DISP) for that superslice.
115def : InstRW<[P9_ALU_3C, IP_EXEC_1C, DISP_1C, DISP_1C, DISP_1C],
Ehsan Amiri6c17bb02016-12-19 13:35:45 +0000116 (instrs
Stefan Pintilie590eb272017-09-22 20:17:25 +0000117 FCMPUS,
118 FCMPUD,
119 XSTSTDCDP,
Stefan Pintilie626b6512018-02-23 20:37:10 +0000120 XSTSTDCSP,
121 FTDIV,
122 FTSQRT,
123 (instregex "CMPRB(8)?$"),
124 (instregex "TD(I)?$"),
125 (instregex "TW(I)?$")
Stefan Pintilie590eb272017-09-22 20:17:25 +0000126)>;
Ehsan Amiri6c17bb02016-12-19 13:35:45 +0000127
Stefan Pintilie590eb272017-09-22 20:17:25 +0000128// Standard Dispatch ALU operation for 3 cycles. Only one slice used.
129def : InstRW<[P9_ALU_3C, IP_EXEC_1C, DISP_1C, DISP_1C],
130 (instrs
Stefan Pintilie626b6512018-02-23 20:37:10 +0000131 (instregex "XSMAX(C|J)?DP$"),
132 (instregex "XSMIN(C|J)?DP$"),
133 (instregex "XSCMP(EQ|EXP|GE|GT|O|U)DP$"),
Ehsan Amiri6c17bb02016-12-19 13:35:45 +0000134 XSTDIVDP,
135 XSTSQRTDP,
Ehsan Amiri6c17bb02016-12-19 13:35:45 +0000136 XSXSIGDP,
Stefan Pintilie626b6512018-02-23 20:37:10 +0000137 XSCVSPDPN,
138 SETB,
139 BPERMD,
140 (instregex "CNT(L|T)Z(D|W)(8)?$"),
141 (instregex "POPCNT(D|W)$"),
142 (instregex "CMPB(8)?$")
Stefan Pintilie590eb272017-09-22 20:17:25 +0000143)>;
144
145// Standard Dispatch ALU operation for 2 cycles. Only one slice used.
146def : InstRW<[P9_ALU_2C, IP_EXEC_1C, DISP_1C, DISP_1C],
147 (instrs
148 ADDIStocHA,
149 ADDItocL,
150 MCRF,
151 MCRXRX,
Stefan Pintilie590eb272017-09-22 20:17:25 +0000152 XSNABSDP,
153 XSXEXPDP,
154 XSABSDP,
155 XSNEGDP,
Stefan Pintilie626b6512018-02-23 20:37:10 +0000156 XSCPSGNDP,
157 (instregex "S(L|R)D$"),
158 (instregex "SRAD(I)?$"),
159 (instregex "EXTSWSLI$"),
160 SRADI_32,
161 RLDIC,
Stefan Pintiliee894e0f2018-03-01 16:16:08 +0000162 RFEBB,
Stefan Pintilie626b6512018-02-23 20:37:10 +0000163 LA,
164 (instregex "CMP(WI|LWI|W|LW)(8)?$"),
165 (instregex "SUBF(I)?C(8)?$"),
166 (instregex "ANDI(S)?o(8)?$"),
Stefan Pintiliee894e0f2018-03-01 16:16:08 +0000167 (instregex "ADDC(8)?$"),
168 (instregex "ADDIC(8)?(o)?$"),
169 (instregex "ADD(8|4)(o)?$"),
170 (instregex "ADD(E|ME|ZE)(8)?(o)?$"),
Stefan Pintilie626b6512018-02-23 20:37:10 +0000171 (instregex "SUBF(E|ME|ZE)?(8)?$"),
172 (instregex "NEG(8)?$"),
173 (instregex "POPCNTB$"),
174 (instregex "ADD(I|IS)?(8)?$"),
175 (instregex "LI(S)?(8)?$"),
176 (instregex "(X)?OR(I|IS)?(8)?$"),
177 NOP,
178 (instregex "NAND(8)?$"),
Stefan Pintiliee894e0f2018-03-01 16:16:08 +0000179 (instregex "AND(C)?(8)?(o)?$"),
Stefan Pintilie626b6512018-02-23 20:37:10 +0000180 (instregex "NOR(8)?$"),
181 (instregex "OR(C)?(8)?$"),
182 (instregex "EQV(8)?$"),
Stefan Pintilieb5a94402018-03-02 14:41:38 +0000183 (instregex "EXTS(B|H|W)(8)?(_32)?(_64)?(o)?$"),
Stefan Pintilie626b6512018-02-23 20:37:10 +0000184 (instregex "ADD(4|8)(TLS)?(_)?$"),
185 (instregex "NEG(8)?$")
Stefan Pintilie590eb272017-09-22 20:17:25 +0000186)>;
187
188// Restricted Dispatch ALU operation for 2 cycles. The operation runs on a
189// slingle slice. However, since it is Restricted it requires all 3 dispatches
190// (DISP) for that superslice.
191def : InstRW<[P9_ALU_2C, IP_EXEC_1C, DISP_1C, DISP_1C, DISP_1C],
192 (instrs
193 RLDCL,
194 RLDCR,
195 RLDIMI,
196 RLDICL,
197 RLDICR,
198 RLDICL_32_64,
Stefan Pintilie626b6512018-02-23 20:37:10 +0000199 RLDICL_32,
200 RLDICR_32,
201 (instregex "RLWIMI(8)?$"),
Stefan Pintilie590eb272017-09-22 20:17:25 +0000202 XSIEXPDP,
203 FMR,
Stefan Pintilie626b6512018-02-23 20:37:10 +0000204 (instregex "S(L|R)W(8)?$"),
205 (instregex "RLW(INM|NM)(8)?$"),
206 (instregex "F(N)?ABS(D|S)$"),
207 (instregex "FNEG(D|S)$"),
208 (instregex "FCPSGN(D|S)$"),
209 (instregex "SRAW(I)?$"),
210 (instregex "ISEL(8)?$")
Stefan Pintilie590eb272017-09-22 20:17:25 +0000211)>;
212
213// Three cycle ALU vector operation that uses an entire superslice.
214// Uses both ALU units (the even ALUE and odd ALUO units), two pipelines
215// (EXECE, EXECO) and all three dispatches (DISP) to the given superslice.
216def : InstRW<[P9_ALUE_3C, P9_ALUO_3C, IP_EXECE_1C, IP_EXECO_1C,
217 DISP_1C, DISP_1C, DISP_1C],
218 (instrs
Stefan Pintiliee894e0f2018-03-01 16:16:08 +0000219 (instregex "VCMPNEZ(B|H|W)$"),
220 VCMPEQUB,
221 VCMPEQUD,
222 VCMPEQUH,
223 VCMPEQUW,
224 VCMPNEB,
225 VCMPNEH,
226 VCMPNEW,
Stefan Pintilie590eb272017-09-22 20:17:25 +0000227 VBPERMD,
228 VABSDUB,
229 VABSDUH,
230 VABSDUW,
Stefan Pintiliee894e0f2018-03-01 16:16:08 +0000231 VADDCUW,
Stefan Pintilie590eb272017-09-22 20:17:25 +0000232 VADDUBS,
233 VADDUHS,
234 VADDUWS,
235 VAVGSB,
236 VAVGSH,
237 VAVGSW,
238 VAVGUB,
239 VAVGUH,
240 VAVGUW,
241 VCMPEQFP,
242 VCMPEQFPo,
243 VCMPGEFP,
244 VCMPGEFPo,
245 VCMPBFP,
246 VCMPBFPo,
247 VCMPGTFP,
248 VCMPGTFPo,
249 VCLZB,
250 VCLZD,
251 VCLZH,
252 VCLZW,
253 VCTZB,
254 VCTZD,
255 VCTZH,
256 VCTZW,
257 VADDSBS,
258 VADDSHS,
259 VADDSWS,
260 VMINFP,
261 VMINSB,
262 VMINSD,
263 VMINSH,
264 VMINSW,
265 VMINUB,
266 VMINUD,
267 VMINUH,
268 VMINUW,
269 VMAXFP,
270 VMAXSB,
271 VMAXSD,
272 VMAXSH,
273 VMAXSW,
274 VMAXUB,
275 VMAXUD,
276 VMAXUH,
277 VMAXUW,
278 VPOPCNTW,
279 VPOPCNTD,
280 VPRTYBD,
281 VPRTYBW,
282 VSHASIGMAD,
283 VSHASIGMAW,
284 VSUBSBS,
285 VSUBSHS,
286 VSUBSWS,
287 VSUBUBS,
288 VSUBUHS,
289 VSUBUWS,
290 VSUBCUW,
291 VCMPGTSB,
292 VCMPGTSBo,
293 VCMPGTSD,
294 VCMPGTSDo,
295 VCMPGTSH,
296 VCMPGTSHo,
297 VCMPGTSW,
298 VCMPGTSWo,
299 VCMPGTUB,
300 VCMPGTUBo,
301 VCMPGTUD,
302 VCMPGTUDo,
303 VCMPGTUH,
304 VCMPGTUHo,
305 VCMPGTUW,
306 VCMPGTUWo,
307 VCMPNEBo,
308 VCMPNEHo,
309 VCMPNEWo,
310 VCMPNEZBo,
311 VCMPNEZHo,
312 VCMPNEZWo,
313 VCMPEQUBo,
314 VCMPEQUDo,
315 VCMPEQUHo,
316 VCMPEQUWo,
Ehsan Amiri6c17bb02016-12-19 13:35:45 +0000317 XVCMPEQDP,
318 XVCMPEQDPo,
319 XVCMPEQSP,
320 XVCMPEQSPo,
321 XVCMPGEDP,
322 XVCMPGEDPo,
323 XVCMPGESP,
324 XVCMPGESPo,
325 XVCMPGTDP,
326 XVCMPGTDPo,
327 XVCMPGTSP,
328 XVCMPGTSPo,
Ehsan Amiri6c17bb02016-12-19 13:35:45 +0000329 XVMAXDP,
330 XVMAXSP,
331 XVMINDP,
332 XVMINSP,
333 XVTDIVDP,
334 XVTDIVSP,
335 XVTSQRTDP,
336 XVTSQRTSP,
337 XVTSTDCDP,
338 XVTSTDCSP,
Ehsan Amiri6c17bb02016-12-19 13:35:45 +0000339 XVXSIGDP,
340 XVXSIGSP
341)>;
342
Stefan Pintilie590eb272017-09-22 20:17:25 +0000343// 7 cycle DP vector operation that uses an entire superslice.
344// Uses both DP units (the even DPE and odd DPO units), two pipelines
345// (EXECE, EXECO) and all three dispatches (DISP) to the given superslice.
346def : InstRW<[P9_DPE_7C, P9_DPO_7C, IP_EXECE_1C, IP_EXECO_1C,
347 DISP_1C, DISP_1C, DISP_1C],
Ehsan Amiri6c17bb02016-12-19 13:35:45 +0000348 (instrs
349 VADDFP,
350 VCTSXS,
351 VCTSXS_0,
352 VCTUXS,
353 VCTUXS_0,
354 VEXPTEFP,
355 VLOGEFP,
356 VMADDFP,
357 VMHADDSHS,
358 VNMSUBFP,
359 VREFP,
360 VRFIM,
361 VRFIN,
362 VRFIP,
363 VRFIZ,
364 VRSQRTEFP,
365 VSUBFP,
366 XVADDDP,
367 XVADDSP,
368 XVCVDPSP,
369 XVCVDPSXDS,
370 XVCVDPSXWS,
371 XVCVDPUXDS,
372 XVCVDPUXWS,
373 XVCVHPSP,
374 XVCVSPDP,
375 XVCVSPHP,
376 XVCVSPSXDS,
377 XVCVSPSXWS,
378 XVCVSPUXDS,
379 XVCVSPUXWS,
380 XVCVSXDDP,
381 XVCVSXDSP,
382 XVCVSXWDP,
383 XVCVSXWSP,
384 XVCVUXDDP,
385 XVCVUXDSP,
386 XVCVUXWDP,
387 XVCVUXWSP,
388 XVMADDADP,
389 XVMADDASP,
390 XVMADDMDP,
391 XVMADDMSP,
392 XVMSUBADP,
393 XVMSUBASP,
394 XVMSUBMDP,
395 XVMSUBMSP,
396 XVMULDP,
397 XVMULSP,
398 XVNMADDADP,
399 XVNMADDASP,
400 XVNMADDMDP,
401 XVNMADDMSP,
402 XVNMSUBADP,
403 XVNMSUBASP,
404 XVNMSUBMDP,
405 XVNMSUBMSP,
406 XVRDPI,
407 XVRDPIC,
408 XVRDPIM,
409 XVRDPIP,
410 XVRDPIZ,
411 XVREDP,
412 XVRESP,
413 XVRSPI,
414 XVRSPIC,
415 XVRSPIM,
416 XVRSPIP,
417 XVRSPIZ,
418 XVRSQRTEDP,
419 XVRSQRTESP,
420 XVSUBDP,
421 XVSUBSP,
422 VCFSX,
423 VCFSX_0,
424 VCFUX,
425 VCFUX_0,
426 VMHRADDSHS,
427 VMLADDUHM,
428 VMSUMMBM,
429 VMSUMSHM,
430 VMSUMSHS,
431 VMSUMUBM,
432 VMSUMUHM,
433 VMSUMUHS,
434 VMULESB,
435 VMULESH,
436 VMULESW,
437 VMULEUB,
438 VMULEUH,
439 VMULEUW,
440 VMULOSB,
441 VMULOSH,
442 VMULOSW,
443 VMULOUB,
444 VMULOUH,
445 VMULOUW,
446 VMULUWM,
447 VSUM2SWS,
448 VSUM4SBS,
449 VSUM4SHS,
450 VSUM4UBS,
451 VSUMSWS
452)>;
453
Stefan Pintilie590eb272017-09-22 20:17:25 +0000454// 7 cycle Restricted DP operation. One DP unit, one EXEC pipeline and all three
455// dispatch units for the superslice.
Ehsan Amiri6c17bb02016-12-19 13:35:45 +0000456def : InstRW<[P9_DP_7C, IP_EXEC_1C, DISP_1C, DISP_1C, DISP_1C],
457 (instrs
Stefan Pintilie590eb272017-09-22 20:17:25 +0000458 FRSP,
459 FRIND,
460 FRINS,
461 FRIPD,
462 FRIPS,
463 FRIZD,
464 FRIZS,
465 FRIMD,
466 FRIMS,
467 FRE,
468 FRES,
469 FRSQRTE,
470 FRSQRTES,
471 FMADDS,
472 FMADD,
473 FMSUBS,
474 FMSUB,
475 FNMADDS,
476 FNMADD,
477 FNMSUBS,
478 FNMSUB,
479 FSELD,
480 FSELS,
481 FADDS,
482 FMULS,
483 FMUL,
484 FSUBS,
485 FCFID,
486 FCTID,
487 FCTIDZ,
488 FCFIDU,
489 FCFIDS,
490 FCFIDUS,
491 FCTIDUZ,
492 FCTIWUZ,
493 FCTIW,
494 FCTIWZ,
Ehsan Amiri6c17bb02016-12-19 13:35:45 +0000495 XSMADDADP,
496 XSMADDASP,
497 XSMADDMDP,
498 XSMADDMSP,
499 XSMSUBADP,
500 XSMSUBASP,
501 XSMSUBMDP,
502 XSMSUBMSP,
503 XSMULDP,
504 XSMULSP,
505 XSNMADDADP,
506 XSNMADDASP,
507 XSNMADDMDP,
508 XSNMADDMSP,
509 XSNMSUBADP,
510 XSNMSUBASP,
511 XSNMSUBMDP,
512 XSNMSUBMSP
513)>;
514
Stefan Pintiliee894e0f2018-03-01 16:16:08 +0000515// 7 cycle Restricted DP operation and one 3 cycle ALU operation.
Stefan Pintiliecc330da2017-10-10 13:45:35 +0000516// The DP is restricted so we need a full 5 dispatches.
Stefan Pintiliee894e0f2018-03-01 16:16:08 +0000517def : InstRW<[P9_DPOpAndALU2Op_10C, IP_EXEC_1C, IP_EXEC_1C,
Stefan Pintiliecc330da2017-10-10 13:45:35 +0000518 DISP_1C, DISP_1C, DISP_1C, DISP_1C, DISP_1C],
519 (instrs
520 FMULo,
521 FMADDo,
522 FMSUBo,
523 FNMADDo,
524 FNMSUBo
525)>;
526
Stefan Pintilie590eb272017-09-22 20:17:25 +0000527// 7 cycle DP operation. One DP unit, one EXEC pipeline and two dispatch units.
Ehsan Amiri6c17bb02016-12-19 13:35:45 +0000528def : InstRW<[P9_DP_7C, IP_EXEC_1C, DISP_1C, DISP_1C],
529 (instrs
530 XSADDDP,
531 XSADDSP,
532 XSCVDPHP,
533 XSCVDPSP,
534 XSCVDPSXDS,
Stefan Pintilie590eb272017-09-22 20:17:25 +0000535 XSCVDPSXDSs,
Ehsan Amiri6c17bb02016-12-19 13:35:45 +0000536 XSCVDPSXWS,
537 XSCVDPUXDS,
Stefan Pintilie590eb272017-09-22 20:17:25 +0000538 XSCVDPUXDSs,
Ehsan Amiri6c17bb02016-12-19 13:35:45 +0000539 XSCVDPUXWS,
540 XSCVHPDP,
541 XSCVSPDP,
542 XSCVSXDDP,
543 XSCVSXDSP,
544 XSCVUXDDP,
545 XSCVUXDSP,
546 XSRDPI,
547 XSRDPIC,
548 XSRDPIM,
549 XSRDPIP,
550 XSRDPIZ,
551 XSREDP,
552 XSRESP,
553 //XSRSP,
554 XSRSQRTEDP,
555 XSRSQRTESP,
556 XSSUBDP,
557 XSSUBSP,
558 XSCVDPSPN
559)>;
560
Stefan Pintilie590eb272017-09-22 20:17:25 +0000561// Three Cycle PM operation. Only one PM unit per superslice so we use the whole
562// superslice. That includes both exec pipelines (EXECO, EXECE) and all three
563// dispatches.
564def : InstRW<[P9_PM_3C, IP_EXECO_1C, IP_EXECE_1C, DISP_1C, DISP_1C, DISP_1C],
Ehsan Amiri6c17bb02016-12-19 13:35:45 +0000565 (instrs
566 VBPERMQ,
567 VCLZLSBB,
568 VCTZLSBB,
569 VEXTRACTD,
570 VEXTRACTUB,
571 VEXTRACTUH,
572 VEXTRACTUW,
573 VEXTUBLX,
574 VEXTUBRX,
575 VEXTUHLX,
576 VEXTUHRX,
577 VEXTUWLX,
578 VEXTUWRX,
579 VGBBD,
580 VINSERTB,
581 VINSERTD,
582 VINSERTH,
583 VINSERTW,
584 VMRGHB,
585 VMRGHH,
586 VMRGHW,
587 VMRGLB,
588 VMRGLH,
589 VMRGLW,
590 VPERM,
591 VPERMR,
592 VPERMXOR,
593 VPKPX,
594 VPKSDSS,
595 VPKSDUS,
596 VPKSHSS,
597 VPKSHUS,
598 VPKSWSS,
599 VPKSWUS,
600 VPKUDUM,
601 VPKUDUS,
602 VPKUHUM,
603 VPKUHUS,
604 VPKUWUM,
605 VPKUWUS,
606 VPRTYBQ,
607 VSL,
608 VSLDOI,
609 VSLO,
610 VSLV,
611 VSPLTB,
Stefan Pintilie590eb272017-09-22 20:17:25 +0000612 VSPLTBs,
Ehsan Amiri6c17bb02016-12-19 13:35:45 +0000613 VSPLTH,
Stefan Pintilie590eb272017-09-22 20:17:25 +0000614 VSPLTHs,
Ehsan Amiri6c17bb02016-12-19 13:35:45 +0000615 VSPLTISB,
616 VSPLTISH,
617 VSPLTISW,
618 VSPLTW,
619 VSR,
620 VSRO,
621 VSRV,
622 VUPKHPX,
623 VUPKHSB,
624 VUPKHSH,
625 VUPKHSW,
626 VUPKLPX,
627 VUPKLSB,
628 VUPKLSH,
629 VUPKLSW,
630 XXBRD,
631 XXBRH,
632 XXBRQ,
633 XXBRW,
634 XXEXTRACTUW,
635 XXINSERTW,
636 XXMRGHW,
637 XXMRGLW,
638 XXPERM,
639 XXPERMR,
640 XXSLDWI,
641 XXSPLTIB,
642 XXSPLTW,
Stefan Pintilie590eb272017-09-22 20:17:25 +0000643 XXSPLTWs,
644 XXPERMDI,
645 XXPERMDIs,
Ehsan Amiri6c17bb02016-12-19 13:35:45 +0000646 VADDCUQ,
647 VADDECUQ,
648 VADDEUQM,
649 VADDUQM,
650 VMUL10CUQ,
651 VMUL10ECUQ,
652 VMUL10EUQ,
653 VMUL10UQ,
654 VSUBCUQ,
655 VSUBECUQ,
656 VSUBEUQM,
657 VSUBUQM,
658 XSCMPEXPQP,
659 XSCMPOQP,
660 XSCMPUQP,
661 XSTSTDCQP,
Stefan Pintiliee894e0f2018-03-01 16:16:08 +0000662 XSXSIGQP,
663 BCDCFNo,
664 BCDCFZo,
665 BCDCPSGNo,
666 BCDCTNo,
667 BCDCTZo,
668 BCDSETSGNo,
669 BCDSo,
670 BCDTRUNCo,
671 BCDUSo,
672 BCDUTRUNCo
Ehsan Amiri6c17bb02016-12-19 13:35:45 +0000673)>;
674
Stefan Pintilie590eb272017-09-22 20:17:25 +0000675// 12 Cycle DFU operation. Only one DFU unit per CPU so we use a whole
676// superslice. That includes both exec pipelines (EXECO, EXECE) and all three
677// dispatches.
678def : InstRW<[P9_DFU_12C, IP_EXECE_1C, IP_EXECO_1C, DISP_1C, DISP_1C, DISP_1C],
Ehsan Amiri6c17bb02016-12-19 13:35:45 +0000679 (instrs
Stefan Pintiliee894e0f2018-03-01 16:16:08 +0000680 BCDSRo,
Ehsan Amiri6c17bb02016-12-19 13:35:45 +0000681 XSADDQP,
682 XSADDQPO,
683 XSCVDPQP,
684 XSCVQPDP,
685 XSCVQPDPO,
686 XSCVQPSDZ,
687 XSCVQPSWZ,
688 XSCVQPUDZ,
689 XSCVQPUWZ,
690 XSCVSDQP,
691 XSCVUDQP,
692 XSRQPI,
693 XSRQPXP,
694 XSSUBQP,
695 XSSUBQPO
696)>;
697
Stefan Pintiliee894e0f2018-03-01 16:16:08 +0000698// 23 Cycle DFU operation. Only one DFU unit per CPU so we use a whole
699// superslice. That includes both exec pipelines (EXECO, EXECE) and all three
700// dispatches.
701def : InstRW<[P9_DFU_23C, IP_EXECE_1C, IP_EXECO_1C, DISP_1C, DISP_1C, DISP_1C],
702 (instrs
703 BCDCTSQo
704)>;
705
Stefan Pintilie590eb272017-09-22 20:17:25 +0000706// 24 Cycle DFU operation. Only one DFU unit per CPU so we use a whole
707// superslice. That includes both exec pipelines (EXECO, EXECE) and all three
708// dispatches.
709def : InstRW<[P9_DFU_24C, IP_EXECE_1C, IP_EXECO_1C, DISP_1C, DISP_1C, DISP_1C],
Ehsan Amiri6c17bb02016-12-19 13:35:45 +0000710 (instrs
711 XSMADDQP,
712 XSMADDQPO,
713 XSMSUBQP,
714 XSMSUBQPO,
715 XSMULQP,
716 XSMULQPO,
717 XSNMADDQP,
718 XSNMADDQPO,
719 XSNMSUBQP,
720 XSNMSUBQPO
721)>;
722
Stefan Pintiliee894e0f2018-03-01 16:16:08 +0000723// 37 Cycle DFU operation. Only one DFU unit per CPU so we use a whole
724// superslice. That includes both exec pipelines (EXECO, EXECE) and all three
725// dispatches.
726def : InstRW<[P9_DFU_37C, IP_EXECE_1C, IP_EXECO_1C, DISP_1C, DISP_1C, DISP_1C],
727 (instrs
728 BCDCFSQo
729)>;
730
Stefan Pintilie590eb272017-09-22 20:17:25 +0000731// 58 Cycle DFU operation. Only one DFU unit per CPU so we use a whole
732// superslice. That includes both exec pipelines (EXECO, EXECE) and all three
733// dispatches.
734def : InstRW<[P9_DFU_58C, IP_EXECE_1C, IP_EXECO_1C, DISP_1C, DISP_1C, DISP_1C],
Ehsan Amiri6c17bb02016-12-19 13:35:45 +0000735 (instrs
736 XSDIVQP,
737 XSDIVQPO
738)>;
739
Stefan Pintilie590eb272017-09-22 20:17:25 +0000740// 76 Cycle DFU operation. Only one DFU unit per CPU so we use a whole
741// superslice. That includes both exec pipelines (EXECO, EXECE) and all three
742// dispatches.
743def : InstRW<[P9_DFU_76C, IP_EXECE_1C, IP_EXECO_1C, DISP_1C, DISP_1C, DISP_1C],
Ehsan Amiri6c17bb02016-12-19 13:35:45 +0000744 (instrs
745 XSSQRTQP,
746 XSSQRTQPO
747)>;
748
Stefan Pintilie590eb272017-09-22 20:17:25 +0000749// 5 Cycle load uses a single slice.
Ehsan Amiri6c17bb02016-12-19 13:35:45 +0000750def : InstRW<[P9_LS_5C, IP_AGEN_1C, DISP_1C, DISP_1C],
751 (instrs
752 LXSDX,
753 LXVD2X,
Stefan Pintiliee894e0f2018-03-01 16:16:08 +0000754 LXVWSX,
Ehsan Amiri6c17bb02016-12-19 13:35:45 +0000755 LXSIWZX,
756 LXV,
Stefan Pintilie590eb272017-09-22 20:17:25 +0000757 LXVX,
758 LXSD,
Tony Jiang438bf4a2017-11-20 14:38:30 +0000759 DFLOADf64,
Stefan Pintilie626b6512018-02-23 20:37:10 +0000760 XFLOADf64,
761 LIWZX
Ehsan Amiri6c17bb02016-12-19 13:35:45 +0000762)>;
763
Stefan Pintilie590eb272017-09-22 20:17:25 +0000764// 4 Cycle load uses a single slice.
765def : InstRW<[P9_LS_4C, IP_AGEN_1C, DISP_1C, DISP_1C],
766 (instrs
767 COPY
768)>;
769
770// 4 Cycle Restricted load uses a single slice but the dispatch for the whole
771// superslice.
772def : InstRW<[P9_LS_4C, IP_AGEN_1C, DISP_1C, DISP_1C, DISP_1C],
Ehsan Amiri6c17bb02016-12-19 13:35:45 +0000773 (instrs
774 LFIWZX,
775 LFDX,
776 LFD
777)>;
778
Stefan Pintilie590eb272017-09-22 20:17:25 +0000779// Cracked Restricted Load instruction.
780// Requires consecutive Load and ALU pieces totaling 6 cycles. The Load and ALU
781// operations cannot be done at the same time and so their latencies are added.
782// Full 6 dispatches are required as this is both cracked and restricted.
783def : InstRW<[P9_LoadAndALUOp_6C, IP_EXEC_1C, IP_AGEN_1C,
Ehsan Amiri6c17bb02016-12-19 13:35:45 +0000784 DISP_1C, DISP_1C, DISP_1C, DISP_1C, DISP_1C, DISP_1C],
785 (instrs
Stefan Pintiliee894e0f2018-03-01 16:16:08 +0000786 LFIWAX
Ehsan Amiri6c17bb02016-12-19 13:35:45 +0000787)>;
788
Stefan Pintilie590eb272017-09-22 20:17:25 +0000789// Cracked Load instruction.
790// Requires consecutive Load and ALU pieces totaling 7 cycles. The Load and ALU
791// operations cannot be done at the same time and so their latencies are added.
792// Full 4 dispatches are required as this is a cracked instruction.
793def : InstRW<[P9_LoadAndALUOp_7C, IP_AGEN_1C, IP_EXEC_1C,
794 DISP_1C, DISP_1C, DISP_1C, DISP_1C],
795 (instrs
Stefan Pintilie590eb272017-09-22 20:17:25 +0000796 LXSIWAX,
Stefan Pintilie626b6512018-02-23 20:37:10 +0000797 LIWAX
Stefan Pintilie590eb272017-09-22 20:17:25 +0000798)>;
799
Stefan Pintiliee894e0f2018-03-01 16:16:08 +0000800// Cracked Load instruction.
801// Requires consecutive Load (4 cycles) and ALU (3 cycles) pieces totaling 7
802// cycles. The Load and ALU operations cannot be done at the same time and so
803// their latencies are added.
804// Full 6 dispatches are required as this is a restricted instruction.
805def : InstRW<[P9_LoadAndALU2Op_7C, IP_AGEN_1C, IP_EXEC_1C,
806 DISP_1C, DISP_1C, DISP_1C, DISP_1C, DISP_1C, DISP_1C],
807 (instrs
808 LFSX,
809 LFS
810)>;
811
812// Cracked Load instruction.
813// Requires consecutive Load and ALU pieces totaling 8 cycles. The Load and ALU
814// operations cannot be done at the same time and so their latencies are added.
815// Full 4 dispatches are required as this is a cracked instruction.
816def : InstRW<[P9_LoadAndALU2Op_8C, IP_AGEN_1C, IP_EXEC_1C,
817 DISP_1C, DISP_1C, DISP_1C, DISP_1C],
818 (instrs
819 LXSSP,
820 LXSSPX,
821 XFLOADf32,
822 DFLOADf32
823)>;
824
Stefan Pintilie590eb272017-09-22 20:17:25 +0000825// Cracked Load that requires the PM resource.
826// Since the Load and the PM cannot be done at the same time the latencies are
827// added. Requires 8 cycles.
828// Since the PM requires the full superslice we need both EXECE, EXECO pipelines
829// as well as 3 dispatches for the PM. The Load requires the remaining 2
830// dispatches.
831def : InstRW<[P9_LoadAndPMOp_8C, IP_AGEN_1C, IP_EXECE_1C, IP_EXECO_1C,
832 DISP_1C, DISP_1C, DISP_1C, DISP_1C, DISP_1C],
Ehsan Amiri6c17bb02016-12-19 13:35:45 +0000833 (instrs
834 LXVDSX,
835 LXVW4X
836)>;
837
Stefan Pintilie590eb272017-09-22 20:17:25 +0000838// Single slice Restricted store operation. The restricted operation requires
839// all three dispatches for the superslice.
Ehsan Amiri6c17bb02016-12-19 13:35:45 +0000840def : InstRW<[P9_LS_1C, IP_EXEC_1C, IP_AGEN_1C, DISP_1C, DISP_1C, DISP_1C],
841 (instrs
Stefan Pintilie626b6512018-02-23 20:37:10 +0000842 (instregex "STF(S|D|IWX|SX|DX)$"),
843 (instregex "STXS(DX|SPX|IWX)$"),
Stefan Pintilie590eb272017-09-22 20:17:25 +0000844 DFSTOREf32,
Tony Jiang438bf4a2017-11-20 14:38:30 +0000845 DFSTOREf64,
846 XFSTOREf32,
847 XFSTOREf64,
848 STIWX
Ehsan Amiri6c17bb02016-12-19 13:35:45 +0000849)>;
850
Stefan Pintilie590eb272017-09-22 20:17:25 +0000851// Store operation that requires the whole superslice.
852def : InstRW<[P9_LS_1C, IP_EXECE_1C, IP_EXECO_1C, IP_AGEN_1C,
853 DISP_1C, DISP_1C, DISP_1C],
Ehsan Amiri6c17bb02016-12-19 13:35:45 +0000854 (instrs
855 STXVD2X,
856 STXVW4X
857)>;
858
Stefan Pintilie626b6512018-02-23 20:37:10 +0000859// Cracked instruction made up up two restriced stores.
860def : InstRW<[P9_LS_1C, P9_LS_1C, IP_EXEC_1C, IP_EXEC_1C, IP_AGEN_1C,
861 IP_AGEN_1C, DISP_1C, DISP_1C, DISP_1C, DISP_1C, DISP_1C, DISP_1C],
862 (instrs
863 STFDEPX
864)>;
865
866// 12 Cycle DIV operation. Only one DIV unit per superslice so we use the whole
867// superslice. That includes both exec pipelines (EXECO, EXECE) and all three
868// dispatches.
869def : InstRW<[P9_DIV_12C, IP_EXECE_1C, IP_EXECO_1C, DISP_1C, DISP_1C, DISP_1C],
870 (instrs
Stefan Pintiliee894e0f2018-03-01 16:16:08 +0000871 (instregex "M(T|F)VRSAVE(v)?$"),
872 (instregex "MF(SPR|CTR|LR)(8)?$"),
873 MFDCR
Stefan Pintilie626b6512018-02-23 20:37:10 +0000874)>;
Ehsan Amiri6c17bb02016-12-19 13:35:45 +0000875
Stefan Pintilie590eb272017-09-22 20:17:25 +0000876// 16 Cycle DIV operation. Only one DIV unit per superslice so we use the whole
877// superslice. That includes both exec pipelines (EXECO, EXECE) and all three
878// dispatches.
879def : InstRW<[P9_DIV_16C_8, IP_EXECO_1C, IP_EXECE_1C,
880 DISP_1C, DISP_1C, DISP_1C],
Ehsan Amiri6c17bb02016-12-19 13:35:45 +0000881 (instrs
882 DIVW,
Stefan Pintilie590eb272017-09-22 20:17:25 +0000883 DIVWU,
884 MODSW
Ehsan Amiri6c17bb02016-12-19 13:35:45 +0000885)>;
886
Stefan Pintilie590eb272017-09-22 20:17:25 +0000887// 24 Cycle DIV operation. Only one DIV unit per superslice so we use the whole
888// superslice. That includes both exec pipelines (EXECO, EXECE) and all three
889// dispatches.
890def : InstRW<[P9_DIV_24C_8, IP_EXECO_1C, IP_EXECE_1C,
891 DISP_1C, DISP_1C, DISP_1C],
Ehsan Amiri6c17bb02016-12-19 13:35:45 +0000892 (instrs
893 DIVWE,
894 DIVD,
895 DIVWEU,
Stefan Pintilie590eb272017-09-22 20:17:25 +0000896 DIVDU,
897 MODSD,
898 MODUD,
899 MODUW
Ehsan Amiri6c17bb02016-12-19 13:35:45 +0000900)>;
901
Stefan Pintilie590eb272017-09-22 20:17:25 +0000902// 40 Cycle DIV operation. Only one DIV unit per superslice so we use the whole
903// superslice. That includes both exec pipelines (EXECO, EXECE) and all three
904// dispatches.
905def : InstRW<[P9_DIV_40C_8, IP_EXECO_1C, IP_EXECE_1C,
906 DISP_1C, DISP_1C, DISP_1C],
Ehsan Amiri6c17bb02016-12-19 13:35:45 +0000907 (instrs
908 DIVDE,
909 DIVDEU
910)>;
911
Stefan Pintilie590eb272017-09-22 20:17:25 +0000912// Cracked DIV and ALU operation. Requires one full slice for the ALU operation
913// and one full superslice for the DIV operation since there is only one DIV
914// per superslice. Latency of DIV plus ALU is 26.
915def : InstRW<[P9_IntDivAndALUOp_26C_8, IP_EXECE_1C, IP_EXECO_1C, IP_EXEC_1C,
916 DISP_1C, DISP_1C, DISP_1C, DISP_1C, DISP_1C],
Ehsan Amiri6c17bb02016-12-19 13:35:45 +0000917 (instrs
Stefan Pintiliecc330da2017-10-10 13:45:35 +0000918 DIVDo,
919 DIVDUo,
Ehsan Amiri6c17bb02016-12-19 13:35:45 +0000920 DIVWEo,
921 DIVWEUo
922)>;
923
Stefan Pintilie590eb272017-09-22 20:17:25 +0000924// Cracked DIV and ALU operation. Requires one full slice for the ALU operation
925// and one full superslice for the DIV operation since there is only one DIV
926// per superslice. Latency of DIV plus ALU is 42.
927def : InstRW<[P9_IntDivAndALUOp_42C_8, IP_EXECE_1C, IP_EXECO_1C, IP_EXEC_1C,
928 DISP_1C, DISP_1C, DISP_1C, DISP_1C, DISP_1C],
Ehsan Amiri6c17bb02016-12-19 13:35:45 +0000929 (instrs
930 DIVDEo,
931 DIVDEUo
932)>;
933
Ehsan Amiri6c17bb02016-12-19 13:35:45 +0000934// CR access instructions in _BrMCR, IIC_BrMCRX.
935
Stefan Pintilie590eb272017-09-22 20:17:25 +0000936// Cracked, restricted, ALU operations.
937// Here the two ALU ops can actually be done in parallel and therefore the
938// latencies are not added together. Otherwise this is like having two
939// instructions running together on two pipelines and 6 dispatches.
940// ALU ops are 2 cycles each.
Ehsan Amiri6c17bb02016-12-19 13:35:45 +0000941def : InstRW<[P9_ALU_2C, P9_ALU_2C, IP_EXEC_1C, IP_EXEC_1C,
942 DISP_1C, DISP_1C, DISP_1C, DISP_1C, DISP_1C, DISP_1C],
943 (instrs
944 MTOCRF,
945 MTOCRF8,
946 MTCRF,
947 MTCRF8
948)>;
949
Stefan Pintiliee894e0f2018-03-01 16:16:08 +0000950// Cracked ALU operations.
951// Here the two ALU ops can actually be done in parallel and therefore the
952// latencies are not added together. Otherwise this is like having two
953// instructions running together on two pipelines and 4 dispatches.
954// ALU ops are 2 cycles each.
955def : InstRW<[P9_ALU_2C, P9_ALU_2C, IP_EXEC_1C, IP_EXEC_1C,
956 DISP_1C, DISP_1C, DISP_1C, DISP_1C],
957 (instrs
958 (instregex "ADDC(8)?o$")
959)>;
960
Stefan Pintilie590eb272017-09-22 20:17:25 +0000961// Cracked, restricted, ALU operations.
962// Here the two ALU ops can actually be done in parallel and therefore the
963// latencies are not added together. Otherwise this is like having two
964// instructions running together on two pipelines and 6 dispatches.
965// ALU ops are 3 cycles each.
966def : InstRW<[P9_ALU_3C, P9_ALU_3C, IP_EXEC_1C, IP_EXEC_1C,
Ehsan Amiri6c17bb02016-12-19 13:35:45 +0000967 DISP_1C, DISP_1C, DISP_1C, DISP_1C],
968 (instrs
969 MCRFS
970)>;
971
Stefan Pintilieb5a94402018-03-02 14:41:38 +0000972// Cracked instruction made of two ALU ops.
973// The two ops cannot be done in parallel.
974// One of the the ALU ops is restricted and takes 3 dispatches.
Stefan Pintilie626b6512018-02-23 20:37:10 +0000975def : InstRW<[P9_ALUOpAndALUOp_4C, IP_EXEC_1C, IP_EXEC_1C,
976 DISP_1C, DISP_1C, DISP_1C, DISP_1C, DISP_1C],
977 (instrs
978 RLWINMo
979)>;
980
Stefan Pintilieb5a94402018-03-02 14:41:38 +0000981// Cracked instruction made of two ALU ops.
982// The two ops cannot be done in parallel.
983def : InstRW<[P9_ALUOpAndALUOp_4C, IP_EXEC_1C, IP_EXEC_1C,
984 DISP_1C, DISP_1C, DISP_1C, DISP_1C],
985 (instrs
986 (instregex "EXTSWSLIo$")
987)>;
988
Ehsan Amiri6c17bb02016-12-19 13:35:45 +0000989// FP Div instructions in IIC_FPDivD and IIC_FPDivS.
990
Stefan Pintilie590eb272017-09-22 20:17:25 +0000991// 33 Cycle DP Instruction Restricted. Takes one slice and 3 dispatches.
Ehsan Amiri6c17bb02016-12-19 13:35:45 +0000992def : InstRW<[P9_DP_33C_8, IP_EXEC_1C, DISP_1C, DISP_1C, DISP_1C],
993 (instrs
Stefan Pintilie590eb272017-09-22 20:17:25 +0000994 FDIV
995)>;
996
Stefan Pintiliecc330da2017-10-10 13:45:35 +0000997// 33 Cycle DP Instruction Restricted and Cracked with 2 Cycle ALU.
Stefan Pintiliee894e0f2018-03-01 16:16:08 +0000998def : InstRW<[P9_DPOpAndALU2Op_36C_8, IP_EXEC_1C, IP_EXEC_1C,
Stefan Pintiliecc330da2017-10-10 13:45:35 +0000999 DISP_1C, DISP_1C, DISP_1C, DISP_1C, DISP_1C],
1000 (instrs
1001 FDIVo
1002)>;
1003
Stefan Pintilie590eb272017-09-22 20:17:25 +00001004// 33 Cycle DP Instruction. Takes one slice and 2 dispatches.
1005def : InstRW<[P9_DP_33C_8, IP_EXEC_1C, DISP_1C, DISP_1C],
1006 (instrs
Ehsan Amiri6c17bb02016-12-19 13:35:45 +00001007 XSDIVDP
1008)>;
1009
Stefan Pintilie590eb272017-09-22 20:17:25 +00001010// 22 Cycle DP Instruction Restricted. Takes one slice and 3 dispatches.
Ehsan Amiri6c17bb02016-12-19 13:35:45 +00001011def : InstRW<[P9_DP_22C_5, IP_EXEC_1C, DISP_1C, DISP_1C, DISP_1C],
1012 (instrs
Stefan Pintilie590eb272017-09-22 20:17:25 +00001013 FDIVS
1014)>;
1015
Stefan Pintiliecc330da2017-10-10 13:45:35 +00001016// 22 Cycle DP Instruction Restricted and Cracked with 2 Cycle ALU.
Stefan Pintiliee894e0f2018-03-01 16:16:08 +00001017def : InstRW<[P9_DPOpAndALU2Op_25C_5, IP_EXEC_1C, IP_EXEC_1C,
Stefan Pintiliecc330da2017-10-10 13:45:35 +00001018 DISP_1C, DISP_1C, DISP_1C, DISP_1C, DISP_1C],
1019 (instrs
1020 FDIVSo
1021)>;
1022
Stefan Pintilie590eb272017-09-22 20:17:25 +00001023// 22 Cycle DP Instruction. Takes one slice and 2 dispatches.
1024def : InstRW<[P9_DP_22C_5, IP_EXEC_1C, DISP_1C, DISP_1C],
1025 (instrs
Ehsan Amiri6c17bb02016-12-19 13:35:45 +00001026 XSDIVSP
1027)>;
1028
Stefan Pintilie590eb272017-09-22 20:17:25 +00001029// 24 Cycle DP Vector Instruction. Takes one full superslice.
1030// Includes both EXECE, EXECO pipelines and all 3 dispatches for the given
1031// superslice.
1032def : InstRW<[P9_DPE_24C_8, P9_DPO_24C_8, IP_EXECE_1C, IP_EXECO_1C,
1033 DISP_1C, DISP_1C, DISP_1C],
Ehsan Amiri6c17bb02016-12-19 13:35:45 +00001034 (instrs
1035 XVDIVSP
1036)>;
1037
Stefan Pintilie590eb272017-09-22 20:17:25 +00001038// 33 Cycle DP Vector Instruction. Takes one full superslice.
1039// Includes both EXECE, EXECO pipelines and all 3 dispatches for the given
1040// superslice.
1041def : InstRW<[P9_DPE_33C_8, P9_DPO_33C_8, IP_EXECE_1C, IP_EXECO_1C,
1042 DISP_1C, DISP_1C, DISP_1C],
Ehsan Amiri6c17bb02016-12-19 13:35:45 +00001043 (instrs
1044 XVDIVDP
1045)>;
1046
Ehsan Amiri6c17bb02016-12-19 13:35:45 +00001047// Load instructions in IIC_LdStLFDU and IIC_LdStLFDUX.
1048
Stefan Pintilie590eb272017-09-22 20:17:25 +00001049// Instruction cracked into three pieces. One Load and two ALU operations.
1050// The Load and one of the ALU ops cannot be run at the same time and so the
1051// latencies are added together for 6 cycles. The remainaing ALU is 2 cycles.
1052// Both the load and the ALU that depends on it are restricted and so they take
1053// a total of 6 dispatches. The final 2 dispatches come from the second ALU op.
1054// The two EXEC pipelines are for the 2 ALUs while the AGEN is for the load.
Stefan Pintiliee894e0f2018-03-01 16:16:08 +00001055def : InstRW<[P9_LoadAndALU2Op_7C, P9_ALU_2C,
Ehsan Amiri6c17bb02016-12-19 13:35:45 +00001056 IP_AGEN_1C, IP_EXEC_1C, IP_EXEC_1C,
1057 DISP_1C, DISP_1C, DISP_1C, DISP_1C,
1058 DISP_1C, DISP_1C, DISP_1C, DISP_1C],
1059 (instrs
Stefan Pintilie626b6512018-02-23 20:37:10 +00001060 (instregex "LF(SU|SUX)$")
1061)>;
1062
1063// Cracked instruction made up of a Store and an ALU. The ALU does not depend on
1064// the store and so it can be run at the same time as the store. The store is
1065// also restricted.
1066def : InstRW<[P9_LS_1C, P9_ALU_2C, IP_AGEN_1C, IP_EXEC_1C, IP_EXEC_1C,
1067 DISP_1C, DISP_1C, DISP_1C, DISP_1C, DISP_1C],
1068 (instrs
1069 (instregex "STF(SU|SUX|DU|DUX)$")
Ehsan Amiri6c17bb02016-12-19 13:35:45 +00001070)>;
1071
Stefan Pintilie590eb272017-09-22 20:17:25 +00001072// Cracked instruction made up of a Load and an ALU. The ALU does not depend on
1073// the load and so it can be run at the same time as the load. The load is also
1074// restricted. 3 dispatches are from the restricted load while the other two
1075// are from the ALU. The AGEN pipeline is from the load and the EXEC pipeline
1076// is required for the ALU.
1077def : InstRW<[P9_LS_4C, P9_ALU_2C, IP_AGEN_1C, IP_EXEC_1C,
Ehsan Amiri6c17bb02016-12-19 13:35:45 +00001078 DISP_1C, DISP_1C, DISP_1C, DISP_1C, DISP_1C],
1079 (instrs
Stefan Pintilie626b6512018-02-23 20:37:10 +00001080 (instregex "LF(DU|DUX)$")
Ehsan Amiri6c17bb02016-12-19 13:35:45 +00001081)>;
1082
Stefan Pintilie590eb272017-09-22 20:17:25 +00001083// Crypto Instructions
1084
1085// 6 Cycle CY operation. Only one CY unit per CPU so we use a whole
1086// superslice. That includes both exec pipelines (EXECO, EXECE) and all three
1087// dispatches.
1088def : InstRW<[P9_CY_6C, IP_EXECO_1C, IP_EXECE_1C, DISP_1C, DISP_1C, DISP_1C],
1089 (instrs
Stefan Pintiliee894e0f2018-03-01 16:16:08 +00001090 (instregex "VPMSUM(B|H|W|D)$"),
1091 (instregex "V(N)?CIPHER(LAST)?$"),
1092 VSBOX
Stefan Pintilie590eb272017-09-22 20:17:25 +00001093)>;
Stefan Pintilie626b6512018-02-23 20:37:10 +00001094
Stefan Pintiliee894e0f2018-03-01 16:16:08 +00001095// Branch Instructions
1096
1097// Two Cycle Branch
1098def : InstRW<[P9_BR_2C, DISP_1C, DISP_1C],
1099 (instrs
1100 (instregex "BCCCTR(L)?(8)?$"),
1101 (instregex "BCCL(A|R|RL)?$"),
1102 (instregex "BCCTR(L)?(8)?(n)?$"),
1103 (instregex "BD(N)?Z(8|A|Am|Ap|m|p)?$"),
1104 (instregex "BD(N)?ZL(A|Am|Ap|R|R8|RL|RLm|RLp|Rm|Rp|m|p)?$"),
1105 (instregex "BL(_TLS)?$"),
1106 (instregex "BL8(_TLS|_NOP|_NOP_TLS|_TLS_)?$"),
1107 (instregex "BLA(8|8_NOP)?$"),
1108 (instregex "BLR(8|L)?$"),
1109 (instregex "TAILB(A)?(8)?$"),
1110 (instregex "TAILBCTR(8)?$"),
1111 (instregex "gBC(A|Aat|CTR|CTRL|L|LA|LAat|LR|LRL|Lat|at)?$"),
1112 (instregex "BCLR(L)?(n)?$"),
1113 (instregex "BCTR(L)?(8)?$"),
1114 B,
1115 BA,
1116 BC,
1117 BCC,
1118 BCCA,
1119 BCL,
1120 BCLalways,
1121 BCLn,
1122 BCTRL8_LDinto_toc,
1123 BCn,
1124 CTRL_DEP
1125)>;
1126
1127// Five Cycle Branch with a 2 Cycle ALU Op
1128// Operations must be done consecutively and not in parallel.
1129def : InstRW<[P9_BROpAndALUOp_7C, IP_EXEC_1C,
1130 DISP_1C, DISP_1C, DISP_1C, DISP_1C],
1131 (instrs
1132 ADDPCIS
1133)>;
1134
Stefan Pintilieb5a94402018-03-02 14:41:38 +00001135// Signal Processing Engine (SPE) Instructions
1136// These instructions are not supported on Power 9
1137def : InstRW<[],
1138 (instrs
1139 BRINC,
1140 EVABS,
1141 EVEQV,
1142 EVMRA,
1143 EVNAND,
1144 EVNEG,
1145 (instregex "EVADD(I)?W$"),
1146 (instregex "EVADD(SM|SS|UM|US)IAAW$"),
1147 (instregex "EVAND(C)?$"),
1148 (instregex "EVCMP(EQ|GTS|GTU|LTS|LTU)$"),
1149 (instregex "EVCNTL(S|Z)W$"),
1150 (instregex "EVDIVW(S|U)$"),
1151 (instregex "EVEXTS(B|H)$"),
1152 (instregex "EVLD(H|W|D)(X)?$"),
1153 (instregex "EVLHH(E|OS|OU)SPLAT(X)?$"),
1154 (instregex "EVLWHE(X)?$"),
1155 (instregex "EVLWHO(S|U)(X)?$"),
1156 (instregex "EVLW(H|W)SPLAT(X)?$"),
1157 (instregex "EVMERGE(HI|LO|HILO|LOHI)$"),
1158 (instregex "EVMHEG(S|U)M(F|I)A(A|N)$"),
1159 (instregex "EVMHES(M|S)(F|I)(A|AA|AAW|ANW)?$"),
1160 (instregex "EVMHEU(M|S)I(A|AA|AAW|ANW)?$"),
1161 (instregex "EVMHOG(U|S)M(F|I)A(A|N)$"),
1162 (instregex "EVMHOS(M|S)(F|I)(A|AA|AAW|ANW)?$"),
1163 (instregex "EVMHOU(M|S)I(A|AA|ANW|AAW)?$"),
1164 (instregex "EVMWHS(M|S)(F|FA|I|IA)$"),
1165 (instregex "EVMWHUMI(A)?$"),
1166 (instregex "EVMWLS(M|S)IA(A|N)W$"),
1167 (instregex "EVMWLU(M|S)I(A|AA|AAW|ANW)?$"),
1168 (instregex "EVMWSM(F|I)(A|AA|AN)?$"),
1169 (instregex "EVMWSSF(A|AA|AN)?$"),
1170 (instregex "EVMWUMI(A|AA|AN)?$"),
1171 (instregex "EV(N|X)?OR(C)?$"),
1172 (instregex "EVR(LW|LWI|NDW)$"),
1173 (instregex "EVSLW(I)?$"),
1174 (instregex "EVSPLAT(F)?I$"),
1175 (instregex "EVSRW(I)?(S|U)$"),
1176 (instregex "EVST(DD|DH|DW|WHE|WHO|WWE|WWO)(X)?$"),
1177 (instregex "EVSUBF(S|U)(M|S)IAAW$"),
1178 (instregex "EVSUB(I)?FW$")
1179)> { let Unsupported = 1; }
Stefan Pintiliee894e0f2018-03-01 16:16:08 +00001180
Stefan Pintilieb5a94402018-03-02 14:41:38 +00001181// General Instructions without scheduling support.
Stefan Pintilie626b6512018-02-23 20:37:10 +00001182def : InstRW<[],
1183 (instrs
Stefan Pintiliee894e0f2018-03-01 16:16:08 +00001184 (instregex "(H)?RFI(D)?$"),
1185 ATTN,
Stefan Pintiliee894e0f2018-03-01 16:16:08 +00001186 CLRBHRB,
1187 MFBHRBE,
1188 NAP,
1189 RFCI,
1190 RFDI,
1191 RFMCI,
1192 SC,
1193 WAIT
Stefan Pintilie626b6512018-02-23 20:37:10 +00001194)> { let Unsupported = 1; }