blob: 809ee8839ae8db2542271a36b6f4f8af98cc737b [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//
Stefan Pintilie735817a2018-03-09 21:08:35 +000010// This file defines the resources required by P9 instructions. This is part
11// P9 processor model used for instruction scheduling. This file should contain
12// all of the instructions that may be used on Power 9. This is not just
13// instructions that are new on Power 9 but also instructions that were
14// available on earlier architectures and are still used in Power 9.
Ehsan Amiri6c17bb02016-12-19 13:35:45 +000015//
Stefan Pintilie590eb272017-09-22 20:17:25 +000016// The makeup of the P9 CPU is modeled as follows:
17// - Each CPU is made up of two superslices.
18// - Each superslice is made up of two slices. Therefore, there are 4 slices
19// for each CPU.
20// - Up to 6 instructions can be dispatched to each CPU. Three per superslice.
21// - Each CPU has:
22// - One CY (Crypto) unit P9_CY_*
23// - One DFU (Decimal Floating Point and Quad Precision) unit P9_DFU_*
24// - Two PM (Permute) units. One on each superslice. P9_PM_*
25// - Two DIV (Fixed Point Divide) units. One on each superslize. P9_DIV_*
26// - Four ALU (Fixed Point Arithmetic) units. One on each slice. P9_ALU_*
27// - Four DP (Floating Point) units. One on each slice. P9_DP_*
28// This also includes fixed point multiply add.
29// - Four AGEN (Address Generation) units. One for each slice. P9_AGEN_*
30// - Four Load/Store Queues. P9_LS_*
31// - Each set of instructions will require a number of these resources.
Ehsan Amiri6c17bb02016-12-19 13:35:45 +000032//===----------------------------------------------------------------------===//
33
Stefan Pintilie590eb272017-09-22 20:17:25 +000034// Two cycle ALU vector operation that uses an entire superslice.
Stefan Pintilie735817a2018-03-09 21:08:35 +000035// Uses both ALU units (the even ALUE and odd ALUO units), two pipelines
36// (EXECE, EXECO) and all three dispatches (DISP) to the given superslice.
Ehsan Amiri6c17bb02016-12-19 13:35:45 +000037def : InstRW<[P9_ALUE_2C, P9_ALUO_2C, IP_EXECE_1C, IP_EXECO_1C,
Stefan Pintilie590eb272017-09-22 20:17:25 +000038 DISP_1C, DISP_1C, DISP_1C],
Ehsan Amiri6c17bb02016-12-19 13:35:45 +000039 (instrs
Stefan Pintilie626b6512018-02-23 20:37:10 +000040 (instregex "VADDU(B|H|W|D)M$"),
Stefan Pintiliee894e0f2018-03-01 16:16:08 +000041 (instregex "VAND(C)?$"),
Stefan Pintilieb5a94402018-03-02 14:41:38 +000042 (instregex "VEXTS(B|H|W)2(D|W)(s)?$"),
Stefan Pintilie235fb922018-03-08 16:24:33 +000043 (instregex "V_SET0(B|H)?$"),
Stefan Pintilie735817a2018-03-09 21:08:35 +000044 (instregex "VS(R|L)(B|H|W|D)$"),
45 (instregex "VSUBU(B|H|W|D)M$"),
46 (instregex "VPOPCNT(B|H)$"),
47 (instregex "VRL(B|H|W|D)$"),
48 (instregex "VSRA(B|H|W|D)$"),
49 (instregex "XV(N)?ABS(D|S)P$"),
50 (instregex "XVCPSGN(D|S)P$"),
51 (instregex "XV(I|X)EXP(D|S)P$"),
52 (instregex "VRL(D|W)(MI|NM)$"),
53 (instregex "VMRG(E|O)W$"),
Stefan Pintilie235fb922018-03-08 16:24:33 +000054 MTVSRDD,
Ehsan Amiri6c17bb02016-12-19 13:35:45 +000055 VEQV,
Ehsan Amiri6c17bb02016-12-19 13:35:45 +000056 VNAND,
57 VNEGD,
58 VNEGW,
59 VNOR,
60 VOR,
61 VORC,
Ehsan Amiri6c17bb02016-12-19 13:35:45 +000062 VSEL,
Ehsan Amiri6c17bb02016-12-19 13:35:45 +000063 VXOR,
Ehsan Amiri6c17bb02016-12-19 13:35:45 +000064 XVNEGDP,
65 XVNEGSP,
Ehsan Amiri6c17bb02016-12-19 13:35:45 +000066 XXLAND,
67 XXLANDC,
68 XXLEQV,
69 XXLNAND,
70 XXLNOR,
71 XXLOR,
72 XXLORf,
73 XXLORC,
74 XXLXOR,
Stefan Pintilie235fb922018-03-08 16:24:33 +000075 XXLXORdpz,
76 XXLXORspz,
77 XXLXORz,
Stefan Pintilie590eb272017-09-22 20:17:25 +000078 XXSEL,
Ehsan Amiri6c17bb02016-12-19 13:35:45 +000079 XSABSQP,
80 XSCPSGNQP,
81 XSIEXPQP,
82 XSNABSQP,
83 XSNEGQP,
Stefan Pintilie590eb272017-09-22 20:17:25 +000084 XSXEXPQP
Ehsan Amiri6c17bb02016-12-19 13:35:45 +000085)>;
86
Stefan Pintilie590eb272017-09-22 20:17:25 +000087// Restricted Dispatch ALU operation for 3 cycles. The operation runs on a
Stefan Pintilie735817a2018-03-09 21:08:35 +000088// slingle slice. However, since it is Restricted it requires all 3 dispatches
89// (DISP) for that superslice.
Stefan Pintilie590eb272017-09-22 20:17:25 +000090def : InstRW<[P9_ALU_3C, IP_EXEC_1C, DISP_1C, DISP_1C, DISP_1C],
Ehsan Amiri6c17bb02016-12-19 13:35:45 +000091 (instrs
Stefan Pintilie235fb922018-03-08 16:24:33 +000092 (instregex "TABORT(D|W)C(I)?$"),
93 (instregex "MTFSB(0|1)$"),
94 (instregex "MFFSC(D)?RN(I)?$"),
Stefan Pintilie626b6512018-02-23 20:37:10 +000095 (instregex "CMPRB(8)?$"),
96 (instregex "TD(I)?$"),
Stefan Pintilie735817a2018-03-09 21:08:35 +000097 (instregex "TW(I)?$"),
98 (instregex "FCMPU(S|D)$"),
99 (instregex "XSTSTDC(S|D)P$"),
100 FTDIV,
101 FTSQRT,
102 CMPEQB
Stefan Pintilie590eb272017-09-22 20:17:25 +0000103)>;
Ehsan Amiri6c17bb02016-12-19 13:35:45 +0000104
Stefan Pintilie590eb272017-09-22 20:17:25 +0000105// Standard Dispatch ALU operation for 3 cycles. Only one slice used.
106def : InstRW<[P9_ALU_3C, IP_EXEC_1C, DISP_1C, DISP_1C],
107 (instrs
Stefan Pintilie626b6512018-02-23 20:37:10 +0000108 (instregex "XSMAX(C|J)?DP$"),
109 (instregex "XSMIN(C|J)?DP$"),
110 (instregex "XSCMP(EQ|EXP|GE|GT|O|U)DP$"),
Stefan Pintilie735817a2018-03-09 21:08:35 +0000111 (instregex "CNT(L|T)Z(D|W)(8)?(o)?$"),
112 (instregex "POPCNT(D|W)$"),
113 (instregex "CMPB(8)?$"),
Ehsan Amiri6c17bb02016-12-19 13:35:45 +0000114 XSTDIVDP,
115 XSTSQRTDP,
Ehsan Amiri6c17bb02016-12-19 13:35:45 +0000116 XSXSIGDP,
Stefan Pintilie626b6512018-02-23 20:37:10 +0000117 XSCVSPDPN,
118 SETB,
Stefan Pintilie735817a2018-03-09 21:08:35 +0000119 BPERMD
Stefan Pintilie590eb272017-09-22 20:17:25 +0000120)>;
121
122// Standard Dispatch ALU operation for 2 cycles. Only one slice used.
123def : InstRW<[P9_ALU_2C, IP_EXEC_1C, DISP_1C, DISP_1C],
124 (instrs
Stefan Pintilie626b6512018-02-23 20:37:10 +0000125 (instregex "S(L|R)D$"),
126 (instregex "SRAD(I)?$"),
127 (instregex "EXTSWSLI$"),
Stefan Pintilie235fb922018-03-08 16:24:33 +0000128 (instregex "MFV(S)?RD$"),
129 (instregex "MTVSRD$"),
130 (instregex "MTVSRW(A|Z)$"),
Stefan Pintilie626b6512018-02-23 20:37:10 +0000131 (instregex "CMP(WI|LWI|W|LW)(8)?$"),
Stefan Pintilied45db612018-03-05 14:34:59 +0000132 (instregex "CMP(L)?D(I)?$"),
Stefan Pintilie626b6512018-02-23 20:37:10 +0000133 (instregex "SUBF(I)?C(8)?$"),
134 (instregex "ANDI(S)?o(8)?$"),
Stefan Pintiliee894e0f2018-03-01 16:16:08 +0000135 (instregex "ADDC(8)?$"),
136 (instregex "ADDIC(8)?(o)?$"),
137 (instregex "ADD(8|4)(o)?$"),
138 (instregex "ADD(E|ME|ZE)(8)?(o)?$"),
Stefan Pintilie235fb922018-03-08 16:24:33 +0000139 (instregex "SUBF(E|ME|ZE)?(8)?(o)?$"),
140 (instregex "NEG(8)?(o)?$"),
Stefan Pintilie626b6512018-02-23 20:37:10 +0000141 (instregex "POPCNTB$"),
142 (instregex "ADD(I|IS)?(8)?$"),
143 (instregex "LI(S)?(8)?$"),
Stefan Pintilie235fb922018-03-08 16:24:33 +0000144 (instregex "(X)?OR(I|IS)?(8)?(o)?$"),
Stefan Pintilie235fb922018-03-08 16:24:33 +0000145 (instregex "NAND(8)?(o)?$"),
Stefan Pintiliee894e0f2018-03-01 16:16:08 +0000146 (instregex "AND(C)?(8)?(o)?$"),
Stefan Pintilie235fb922018-03-08 16:24:33 +0000147 (instregex "NOR(8)?(o)?$"),
148 (instregex "OR(C)?(8)?(o)?$"),
Stefan Pintilied45db612018-03-05 14:34:59 +0000149 (instregex "EQV(8)?(o)?$"),
Stefan Pintilieb5a94402018-03-02 14:41:38 +0000150 (instregex "EXTS(B|H|W)(8)?(_32)?(_64)?(o)?$"),
Stefan Pintilie626b6512018-02-23 20:37:10 +0000151 (instregex "ADD(4|8)(TLS)?(_)?$"),
Stefan Pintilie735817a2018-03-09 21:08:35 +0000152 (instregex "NEG(8)?$"),
153 (instregex "ADDI(S)?toc(HA|L)$"),
154 MCRF,
155 MCRXRX,
156 XSNABSDP,
157 XSXEXPDP,
158 XSABSDP,
159 XSNEGDP,
160 XSCPSGNDP,
161 MFVSRWZ,
162 SRADI_32,
163 RLDIC,
164 RFEBB,
165 LA,
166 TBEGIN,
167 TRECHKPT,
168 NOP,
169 WAIT
Stefan Pintilie590eb272017-09-22 20:17:25 +0000170)>;
171
172// Restricted Dispatch ALU operation for 2 cycles. The operation runs on a
173// slingle slice. However, since it is Restricted it requires all 3 dispatches
174// (DISP) for that superslice.
175def : InstRW<[P9_ALU_2C, IP_EXEC_1C, DISP_1C, DISP_1C, DISP_1C],
176 (instrs
Stefan Pintilie735817a2018-03-09 21:08:35 +0000177 (instregex "RLDC(L|R)$"),
Stefan Pintilie626b6512018-02-23 20:37:10 +0000178 (instregex "RLWIMI(8)?$"),
Stefan Pintilie735817a2018-03-09 21:08:35 +0000179 (instregex "RLDIC(L|R)(_32)?(_64)?$"),
180 (instregex "M(F|T)OCRF(8)?$"),
Stefan Pintilied45db612018-03-05 14:34:59 +0000181 (instregex "CR(6)?(UN)?SET$"),
182 (instregex "CR(N)?(OR|AND)(C)?$"),
Stefan Pintilie626b6512018-02-23 20:37:10 +0000183 (instregex "S(L|R)W(8)?$"),
184 (instregex "RLW(INM|NM)(8)?$"),
185 (instregex "F(N)?ABS(D|S)$"),
186 (instregex "FNEG(D|S)$"),
187 (instregex "FCPSGN(D|S)$"),
188 (instregex "SRAW(I)?$"),
Stefan Pintilie735817a2018-03-09 21:08:35 +0000189 (instregex "ISEL(8)?$"),
190 RLDIMI,
191 XSIEXPDP,
192 FMR,
193 CREQV,
194 CRXOR,
195 TRECLAIM,
196 TSR,
197 TABORT
Stefan Pintilie590eb272017-09-22 20:17:25 +0000198)>;
199
200// Three cycle ALU vector operation that uses an entire superslice.
Stefan Pintilie735817a2018-03-09 21:08:35 +0000201// Uses both ALU units (the even ALUE and odd ALUO units), two pipelines
202// (EXECE, EXECO) and all three dispatches (DISP) to the given superslice.
Stefan Pintilie590eb272017-09-22 20:17:25 +0000203def : InstRW<[P9_ALUE_3C, P9_ALUO_3C, IP_EXECE_1C, IP_EXECO_1C,
204 DISP_1C, DISP_1C, DISP_1C],
205 (instrs
Stefan Pintilie235fb922018-03-08 16:24:33 +0000206 (instregex "M(T|F)VSCR$"),
Stefan Pintiliee894e0f2018-03-01 16:16:08 +0000207 (instregex "VCMPNEZ(B|H|W)$"),
Stefan Pintilie735817a2018-03-09 21:08:35 +0000208 (instregex "VCMPEQU(B|H|W|D)$"),
209 (instregex "VCMPNE(B|H|W)$"),
210 (instregex "VABSDU(B|H|W)$"),
211 (instregex "VADDU(B|H|W)S$"),
212 (instregex "VAVG(S|U)(B|H|W)$"),
213 (instregex "VCMP(EQ|GE|GT)FP(o)?$"),
214 (instregex "VCMPBFP(o)?$"),
215 (instregex "VC(L|T)Z(B|H|W|D)$"),
216 (instregex "VADDS(B|H|W)S$"),
217 (instregex "V(MIN|MAX)FP$"),
218 (instregex "V(MIN|MAX)(S|U)(B|H|W|D)$"),
Stefan Pintilie590eb272017-09-22 20:17:25 +0000219 VBPERMD,
Stefan Pintiliee894e0f2018-03-01 16:16:08 +0000220 VADDCUW,
Stefan Pintilie590eb272017-09-22 20:17:25 +0000221 VPOPCNTW,
222 VPOPCNTD,
223 VPRTYBD,
224 VPRTYBW,
225 VSHASIGMAD,
226 VSHASIGMAW,
227 VSUBSBS,
228 VSUBSHS,
229 VSUBSWS,
230 VSUBUBS,
231 VSUBUHS,
232 VSUBUWS,
233 VSUBCUW,
234 VCMPGTSB,
235 VCMPGTSBo,
236 VCMPGTSD,
237 VCMPGTSDo,
238 VCMPGTSH,
239 VCMPGTSHo,
240 VCMPGTSW,
241 VCMPGTSWo,
242 VCMPGTUB,
243 VCMPGTUBo,
244 VCMPGTUD,
245 VCMPGTUDo,
246 VCMPGTUH,
247 VCMPGTUHo,
248 VCMPGTUW,
249 VCMPGTUWo,
250 VCMPNEBo,
251 VCMPNEHo,
252 VCMPNEWo,
253 VCMPNEZBo,
254 VCMPNEZHo,
255 VCMPNEZWo,
256 VCMPEQUBo,
257 VCMPEQUDo,
258 VCMPEQUHo,
259 VCMPEQUWo,
Ehsan Amiri6c17bb02016-12-19 13:35:45 +0000260 XVCMPEQDP,
261 XVCMPEQDPo,
262 XVCMPEQSP,
263 XVCMPEQSPo,
264 XVCMPGEDP,
265 XVCMPGEDPo,
266 XVCMPGESP,
267 XVCMPGESPo,
268 XVCMPGTDP,
269 XVCMPGTDPo,
270 XVCMPGTSP,
271 XVCMPGTSPo,
Ehsan Amiri6c17bb02016-12-19 13:35:45 +0000272 XVMAXDP,
273 XVMAXSP,
274 XVMINDP,
275 XVMINSP,
276 XVTDIVDP,
277 XVTDIVSP,
278 XVTSQRTDP,
279 XVTSQRTSP,
280 XVTSTDCDP,
281 XVTSTDCSP,
Ehsan Amiri6c17bb02016-12-19 13:35:45 +0000282 XVXSIGDP,
283 XVXSIGSP
284)>;
285
Stefan Pintilie590eb272017-09-22 20:17:25 +0000286// 7 cycle DP vector operation that uses an entire superslice.
287// Uses both DP units (the even DPE and odd DPO units), two pipelines
288// (EXECE, EXECO) and all three dispatches (DISP) to the given superslice.
289def : InstRW<[P9_DPE_7C, P9_DPO_7C, IP_EXECE_1C, IP_EXECO_1C,
290 DISP_1C, DISP_1C, DISP_1C],
Ehsan Amiri6c17bb02016-12-19 13:35:45 +0000291 (instrs
292 VADDFP,
293 VCTSXS,
294 VCTSXS_0,
295 VCTUXS,
296 VCTUXS_0,
297 VEXPTEFP,
298 VLOGEFP,
299 VMADDFP,
300 VMHADDSHS,
301 VNMSUBFP,
302 VREFP,
303 VRFIM,
304 VRFIN,
305 VRFIP,
306 VRFIZ,
307 VRSQRTEFP,
308 VSUBFP,
309 XVADDDP,
310 XVADDSP,
311 XVCVDPSP,
312 XVCVDPSXDS,
313 XVCVDPSXWS,
314 XVCVDPUXDS,
315 XVCVDPUXWS,
316 XVCVHPSP,
317 XVCVSPDP,
318 XVCVSPHP,
319 XVCVSPSXDS,
320 XVCVSPSXWS,
321 XVCVSPUXDS,
322 XVCVSPUXWS,
323 XVCVSXDDP,
324 XVCVSXDSP,
325 XVCVSXWDP,
326 XVCVSXWSP,
327 XVCVUXDDP,
328 XVCVUXDSP,
329 XVCVUXWDP,
330 XVCVUXWSP,
331 XVMADDADP,
332 XVMADDASP,
333 XVMADDMDP,
334 XVMADDMSP,
335 XVMSUBADP,
336 XVMSUBASP,
337 XVMSUBMDP,
338 XVMSUBMSP,
339 XVMULDP,
340 XVMULSP,
341 XVNMADDADP,
342 XVNMADDASP,
343 XVNMADDMDP,
344 XVNMADDMSP,
345 XVNMSUBADP,
346 XVNMSUBASP,
347 XVNMSUBMDP,
348 XVNMSUBMSP,
349 XVRDPI,
350 XVRDPIC,
351 XVRDPIM,
352 XVRDPIP,
353 XVRDPIZ,
354 XVREDP,
355 XVRESP,
356 XVRSPI,
357 XVRSPIC,
358 XVRSPIM,
359 XVRSPIP,
360 XVRSPIZ,
361 XVRSQRTEDP,
362 XVRSQRTESP,
363 XVSUBDP,
364 XVSUBSP,
365 VCFSX,
366 VCFSX_0,
367 VCFUX,
368 VCFUX_0,
369 VMHRADDSHS,
370 VMLADDUHM,
371 VMSUMMBM,
372 VMSUMSHM,
373 VMSUMSHS,
374 VMSUMUBM,
375 VMSUMUHM,
376 VMSUMUHS,
377 VMULESB,
378 VMULESH,
379 VMULESW,
380 VMULEUB,
381 VMULEUH,
382 VMULEUW,
383 VMULOSB,
384 VMULOSH,
385 VMULOSW,
386 VMULOUB,
387 VMULOUH,
388 VMULOUW,
389 VMULUWM,
390 VSUM2SWS,
391 VSUM4SBS,
392 VSUM4SHS,
393 VSUM4UBS,
394 VSUMSWS
395)>;
396
Stefan Pintilie235fb922018-03-08 16:24:33 +0000397
398// 5 cycle Restricted DP operation. One DP unit, one EXEC pipeline and all three
399// dispatch units for the superslice.
400def : InstRW<[P9_DP_5C, IP_EXEC_1C, DISP_1C, DISP_1C, DISP_1C],
401 (instrs
402 (instregex "MADD(HD|HDU|LD)$"),
403 (instregex "MUL(HD|HW|LD|LI|LI8|LW)(U)?$")
404)>;
405
Stefan Pintilie590eb272017-09-22 20:17:25 +0000406// 7 cycle Restricted DP operation. One DP unit, one EXEC pipeline and all three
407// dispatch units for the superslice.
Ehsan Amiri6c17bb02016-12-19 13:35:45 +0000408def : InstRW<[P9_DP_7C, IP_EXEC_1C, DISP_1C, DISP_1C, DISP_1C],
409 (instrs
Stefan Pintilie590eb272017-09-22 20:17:25 +0000410 FRSP,
Stefan Pintilied45db612018-03-05 14:34:59 +0000411 (instregex "FRI(N|P|Z|M)(D|S)$"),
412 (instregex "FRE(S)?$"),
413 (instregex "FADD(S)?$"),
414 (instregex "FMSUB(S)?$"),
415 (instregex "FMADD(S)?$"),
Stefan Pintilie735817a2018-03-09 21:08:35 +0000416 (instregex "FSUB(S)?$"),
417 (instregex "FCFID(U)?(S)?$"),
418 (instregex "FCTID(U)?(Z)?$"),
419 (instregex "FCTIW(U)?(Z)?$"),
420 (instregex "FRSQRTE(S)?$"),
Stefan Pintilie590eb272017-09-22 20:17:25 +0000421 FNMADDS,
422 FNMADD,
423 FNMSUBS,
424 FNMSUB,
425 FSELD,
426 FSELS,
Stefan Pintilie590eb272017-09-22 20:17:25 +0000427 FMULS,
428 FMUL,
Ehsan Amiri6c17bb02016-12-19 13:35:45 +0000429 XSMADDADP,
430 XSMADDASP,
431 XSMADDMDP,
432 XSMADDMSP,
433 XSMSUBADP,
434 XSMSUBASP,
435 XSMSUBMDP,
436 XSMSUBMSP,
437 XSMULDP,
438 XSMULSP,
439 XSNMADDADP,
440 XSNMADDASP,
441 XSNMADDMDP,
442 XSNMADDMSP,
443 XSNMSUBADP,
444 XSNMSUBASP,
445 XSNMSUBMDP,
446 XSNMSUBMSP
447)>;
448
Stefan Pintiliee894e0f2018-03-01 16:16:08 +0000449// 7 cycle Restricted DP operation and one 3 cycle ALU operation.
Stefan Pintilied45db612018-03-05 14:34:59 +0000450// These operations can be done in parallel.
451// The DP is restricted so we need a full 5 dispatches.
452def : InstRW<[P9_DP_7C, P9_ALU_3C, IP_EXEC_1C, IP_EXEC_1C,
453 DISP_1C, DISP_1C, DISP_1C, DISP_1C, DISP_1C],
454 (instrs
455 (instregex "FSEL(D|S)o$")
456)>;
457
Stefan Pintilie235fb922018-03-08 16:24:33 +0000458// 5 Cycle Restricted DP operation and one 2 cycle ALU operation.
459def : InstRW<[P9_DPOpAndALUOp_7C, IP_EXEC_1C, IP_EXEC_1C,
460 DISP_1C, DISP_1C, DISP_1C, DISP_1C, DISP_1C],
461 (instrs
462 (instregex "MUL(H|L)(D|W)(U)?o$")
463)>;
464
Stefan Pintilied45db612018-03-05 14:34:59 +0000465// 7 cycle Restricted DP operation and one 3 cycle ALU operation.
466// These operations must be done sequentially.
Stefan Pintiliecc330da2017-10-10 13:45:35 +0000467// The DP is restricted so we need a full 5 dispatches.
Stefan Pintiliee894e0f2018-03-01 16:16:08 +0000468def : InstRW<[P9_DPOpAndALU2Op_10C, IP_EXEC_1C, IP_EXEC_1C,
Stefan Pintiliecc330da2017-10-10 13:45:35 +0000469 DISP_1C, DISP_1C, DISP_1C, DISP_1C, DISP_1C],
470 (instrs
Stefan Pintilied45db612018-03-05 14:34:59 +0000471 (instregex "FRI(N|P|Z|M)(D|S)o$"),
472 (instregex "FRE(S)?o$"),
473 (instregex "FADD(S)?o$"),
474 (instregex "FSUB(S)?o$"),
475 (instregex "F(N)?MSUB(S)?o$"),
476 (instregex "F(N)?MADD(S)?o$"),
477 (instregex "FCFID(U)?(S)?o$"),
478 (instregex "FCTID(U)?(Z)?o$"),
479 (instregex "FCTIW(U)?(Z)?o$"),
480 (instregex "FMUL(S)?o$"),
481 (instregex "FRSQRTE(S)?o$"),
482 FRSPo
Stefan Pintiliecc330da2017-10-10 13:45:35 +0000483)>;
484
Stefan Pintilie590eb272017-09-22 20:17:25 +0000485// 7 cycle DP operation. One DP unit, one EXEC pipeline and two dispatch units.
Ehsan Amiri6c17bb02016-12-19 13:35:45 +0000486def : InstRW<[P9_DP_7C, IP_EXEC_1C, DISP_1C, DISP_1C],
487 (instrs
488 XSADDDP,
489 XSADDSP,
490 XSCVDPHP,
491 XSCVDPSP,
492 XSCVDPSXDS,
Stefan Pintilie590eb272017-09-22 20:17:25 +0000493 XSCVDPSXDSs,
Ehsan Amiri6c17bb02016-12-19 13:35:45 +0000494 XSCVDPSXWS,
495 XSCVDPUXDS,
Stefan Pintilie590eb272017-09-22 20:17:25 +0000496 XSCVDPUXDSs,
Ehsan Amiri6c17bb02016-12-19 13:35:45 +0000497 XSCVDPUXWS,
Stefan Pintilie235fb922018-03-08 16:24:33 +0000498 XSCVDPSXWSs,
499 XSCVDPUXWSs,
Ehsan Amiri6c17bb02016-12-19 13:35:45 +0000500 XSCVHPDP,
501 XSCVSPDP,
502 XSCVSXDDP,
503 XSCVSXDSP,
504 XSCVUXDDP,
505 XSCVUXDSP,
506 XSRDPI,
507 XSRDPIC,
508 XSRDPIM,
509 XSRDPIP,
510 XSRDPIZ,
511 XSREDP,
512 XSRESP,
Ehsan Amiri6c17bb02016-12-19 13:35:45 +0000513 XSRSQRTEDP,
514 XSRSQRTESP,
515 XSSUBDP,
516 XSSUBSP,
517 XSCVDPSPN
518)>;
519
Stefan Pintilie590eb272017-09-22 20:17:25 +0000520// Three Cycle PM operation. Only one PM unit per superslice so we use the whole
521// superslice. That includes both exec pipelines (EXECO, EXECE) and all three
522// dispatches.
523def : InstRW<[P9_PM_3C, IP_EXECO_1C, IP_EXECE_1C, DISP_1C, DISP_1C, DISP_1C],
Ehsan Amiri6c17bb02016-12-19 13:35:45 +0000524 (instrs
Stefan Pintilie235fb922018-03-08 16:24:33 +0000525 (instregex "LVS(L|R)$"),
526 (instregex "VSPLTIS(W|H|B)$"),
527 (instregex "VSPLT(W|H|B)(s)?$"),
528 (instregex "V_SETALLONES(B|H)?$"),
529 (instregex "VEXTRACTU(B|H|W)$"),
Stefan Pintilie735817a2018-03-09 21:08:35 +0000530 (instregex "VINSERT(B|H|W|D)$"),
Stefan Pintilie235fb922018-03-08 16:24:33 +0000531 MFVSRLD,
532 MTVSRWS,
Ehsan Amiri6c17bb02016-12-19 13:35:45 +0000533 VBPERMQ,
534 VCLZLSBB,
535 VCTZLSBB,
536 VEXTRACTD,
Ehsan Amiri6c17bb02016-12-19 13:35:45 +0000537 VEXTUBLX,
538 VEXTUBRX,
539 VEXTUHLX,
540 VEXTUHRX,
541 VEXTUWLX,
542 VEXTUWRX,
543 VGBBD,
Ehsan Amiri6c17bb02016-12-19 13:35:45 +0000544 VMRGHB,
545 VMRGHH,
546 VMRGHW,
547 VMRGLB,
548 VMRGLH,
549 VMRGLW,
550 VPERM,
551 VPERMR,
552 VPERMXOR,
553 VPKPX,
554 VPKSDSS,
555 VPKSDUS,
556 VPKSHSS,
557 VPKSHUS,
558 VPKSWSS,
559 VPKSWUS,
560 VPKUDUM,
561 VPKUDUS,
562 VPKUHUM,
563 VPKUHUS,
564 VPKUWUM,
565 VPKUWUS,
566 VPRTYBQ,
567 VSL,
568 VSLDOI,
569 VSLO,
570 VSLV,
Ehsan Amiri6c17bb02016-12-19 13:35:45 +0000571 VSR,
572 VSRO,
573 VSRV,
574 VUPKHPX,
575 VUPKHSB,
576 VUPKHSH,
577 VUPKHSW,
578 VUPKLPX,
579 VUPKLSB,
580 VUPKLSH,
581 VUPKLSW,
582 XXBRD,
583 XXBRH,
584 XXBRQ,
585 XXBRW,
586 XXEXTRACTUW,
587 XXINSERTW,
588 XXMRGHW,
589 XXMRGLW,
590 XXPERM,
591 XXPERMR,
592 XXSLDWI,
593 XXSPLTIB,
594 XXSPLTW,
Stefan Pintilie590eb272017-09-22 20:17:25 +0000595 XXSPLTWs,
596 XXPERMDI,
597 XXPERMDIs,
Ehsan Amiri6c17bb02016-12-19 13:35:45 +0000598 VADDCUQ,
599 VADDECUQ,
600 VADDEUQM,
601 VADDUQM,
602 VMUL10CUQ,
603 VMUL10ECUQ,
604 VMUL10EUQ,
605 VMUL10UQ,
606 VSUBCUQ,
607 VSUBECUQ,
608 VSUBEUQM,
609 VSUBUQM,
610 XSCMPEXPQP,
611 XSCMPOQP,
612 XSCMPUQP,
613 XSTSTDCQP,
Stefan Pintiliee894e0f2018-03-01 16:16:08 +0000614 XSXSIGQP,
615 BCDCFNo,
616 BCDCFZo,
617 BCDCPSGNo,
618 BCDCTNo,
619 BCDCTZo,
620 BCDSETSGNo,
621 BCDSo,
622 BCDTRUNCo,
623 BCDUSo,
624 BCDUTRUNCo
Ehsan Amiri6c17bb02016-12-19 13:35:45 +0000625)>;
626
Stefan Pintilie590eb272017-09-22 20:17:25 +0000627// 12 Cycle DFU operation. Only one DFU unit per CPU so we use a whole
628// superslice. That includes both exec pipelines (EXECO, EXECE) and all three
629// dispatches.
630def : InstRW<[P9_DFU_12C, IP_EXECE_1C, IP_EXECO_1C, DISP_1C, DISP_1C, DISP_1C],
Ehsan Amiri6c17bb02016-12-19 13:35:45 +0000631 (instrs
Stefan Pintiliee894e0f2018-03-01 16:16:08 +0000632 BCDSRo,
Ehsan Amiri6c17bb02016-12-19 13:35:45 +0000633 XSADDQP,
634 XSADDQPO,
635 XSCVDPQP,
636 XSCVQPDP,
637 XSCVQPDPO,
638 XSCVQPSDZ,
639 XSCVQPSWZ,
640 XSCVQPUDZ,
641 XSCVQPUWZ,
642 XSCVSDQP,
643 XSCVUDQP,
644 XSRQPI,
Stefan Pintilie235fb922018-03-08 16:24:33 +0000645 XSRQPIX,
Ehsan Amiri6c17bb02016-12-19 13:35:45 +0000646 XSRQPXP,
647 XSSUBQP,
648 XSSUBQPO
649)>;
650
Stefan Pintiliee894e0f2018-03-01 16:16:08 +0000651// 23 Cycle DFU operation. Only one DFU unit per CPU so we use a whole
652// superslice. That includes both exec pipelines (EXECO, EXECE) and all three
653// dispatches.
654def : InstRW<[P9_DFU_23C, IP_EXECE_1C, IP_EXECO_1C, DISP_1C, DISP_1C, DISP_1C],
655 (instrs
656 BCDCTSQo
657)>;
658
Stefan Pintilie590eb272017-09-22 20:17:25 +0000659// 24 Cycle DFU operation. Only one DFU unit per CPU so we use a whole
660// superslice. That includes both exec pipelines (EXECO, EXECE) and all three
661// dispatches.
662def : InstRW<[P9_DFU_24C, IP_EXECE_1C, IP_EXECO_1C, DISP_1C, DISP_1C, DISP_1C],
Ehsan Amiri6c17bb02016-12-19 13:35:45 +0000663 (instrs
664 XSMADDQP,
665 XSMADDQPO,
666 XSMSUBQP,
667 XSMSUBQPO,
668 XSMULQP,
669 XSMULQPO,
670 XSNMADDQP,
671 XSNMADDQPO,
672 XSNMSUBQP,
673 XSNMSUBQPO
674)>;
675
Stefan Pintiliee894e0f2018-03-01 16:16:08 +0000676// 37 Cycle DFU operation. Only one DFU unit per CPU so we use a whole
677// superslice. That includes both exec pipelines (EXECO, EXECE) and all three
678// dispatches.
679def : InstRW<[P9_DFU_37C, IP_EXECE_1C, IP_EXECO_1C, DISP_1C, DISP_1C, DISP_1C],
680 (instrs
681 BCDCFSQo
682)>;
683
Stefan Pintilie590eb272017-09-22 20:17:25 +0000684// 58 Cycle DFU operation. Only one DFU unit per CPU so we use a whole
685// superslice. That includes both exec pipelines (EXECO, EXECE) and all three
686// dispatches.
687def : InstRW<[P9_DFU_58C, IP_EXECE_1C, IP_EXECO_1C, DISP_1C, DISP_1C, DISP_1C],
Ehsan Amiri6c17bb02016-12-19 13:35:45 +0000688 (instrs
689 XSDIVQP,
690 XSDIVQPO
691)>;
692
Stefan Pintilie590eb272017-09-22 20:17:25 +0000693// 76 Cycle DFU operation. Only one DFU unit per CPU so we use a whole
694// superslice. That includes both exec pipelines (EXECO, EXECE) and all three
695// dispatches.
696def : InstRW<[P9_DFU_76C, IP_EXECE_1C, IP_EXECO_1C, DISP_1C, DISP_1C, DISP_1C],
Ehsan Amiri6c17bb02016-12-19 13:35:45 +0000697 (instrs
698 XSSQRTQP,
699 XSSQRTQPO
700)>;
701
Stefan Pintilie735817a2018-03-09 21:08:35 +0000702// 6 Cycle Load uses a single slice.
Stefan Pintilie235fb922018-03-08 16:24:33 +0000703def : InstRW<[P9_LS_6C, IP_AGEN_1C, DISP_1C, DISP_1C],
704 (instrs
705 (instregex "LXVL(L)?")
706)>;
707
Stefan Pintilie735817a2018-03-09 21:08:35 +0000708// 5 Cycle Load uses a single slice.
Ehsan Amiri6c17bb02016-12-19 13:35:45 +0000709def : InstRW<[P9_LS_5C, IP_AGEN_1C, DISP_1C, DISP_1C],
710 (instrs
Stefan Pintilie235fb922018-03-08 16:24:33 +0000711 (instregex "LVE(B|H|W)X$"),
712 (instregex "LVX(L)?"),
713 (instregex "LXSI(B|H)ZX$"),
Ehsan Amiri6c17bb02016-12-19 13:35:45 +0000714 LXSDX,
Stefan Pintilie235fb922018-03-08 16:24:33 +0000715 LXVB16X,
Ehsan Amiri6c17bb02016-12-19 13:35:45 +0000716 LXVD2X,
Stefan Pintiliee894e0f2018-03-01 16:16:08 +0000717 LXVWSX,
Ehsan Amiri6c17bb02016-12-19 13:35:45 +0000718 LXSIWZX,
719 LXV,
Stefan Pintilie590eb272017-09-22 20:17:25 +0000720 LXVX,
721 LXSD,
Tony Jiang438bf4a2017-11-20 14:38:30 +0000722 DFLOADf64,
Stefan Pintilie626b6512018-02-23 20:37:10 +0000723 XFLOADf64,
724 LIWZX
Ehsan Amiri6c17bb02016-12-19 13:35:45 +0000725)>;
726
Stefan Pintilie735817a2018-03-09 21:08:35 +0000727// 4 Cycle Load uses a single slice.
Stefan Pintilie590eb272017-09-22 20:17:25 +0000728def : InstRW<[P9_LS_4C, IP_AGEN_1C, DISP_1C, DISP_1C],
729 (instrs
Stefan Pintilied45db612018-03-05 14:34:59 +0000730 (instregex "DCB(F|T|ST)(EP)?$"),
731 (instregex "DCBZ(L)?(EP)?$"),
732 (instregex "DCBTST(EP)?$"),
733 (instregex "CP_COPY(8)?$"),
734 (instregex "CP_PASTE(8)?$"),
735 (instregex "ICBI(EP)?$"),
736 (instregex "ICBT(LS)?$"),
737 (instregex "LBARX(L)?$"),
738 (instregex "LBZ(CIX|8|X|X8)?$"),
Stefan Pintilie235fb922018-03-08 16:24:33 +0000739 (instregex "LD(ARX|ARXL|BRX|CIX|X)?$"),
740 (instregex "LH(A|B)RX(L)?(8)?$"),
741 (instregex "LWARX(L)?$"),
742 (instregex "LWBRX(8)?$"),
743 (instregex "LWZ(8|CIX|X|X8)?$"),
Stefan Pintilie735817a2018-03-09 21:08:35 +0000744 COPY,
745 CP_ABORT,
746 DARN,
747 EnforceIEIO,
748 ISYNC,
749 MSGSYNC,
750 TLBSYNC,
751 SYNC,
Stefan Pintilie235fb922018-03-08 16:24:33 +0000752 LHZ,
753 LHZ8,
754 LHZCIX,
755 LHZX,
756 LHZX8,
757 LMW,
758 LSWI
Stefan Pintilie590eb272017-09-22 20:17:25 +0000759)>;
760
761// 4 Cycle Restricted load uses a single slice but the dispatch for the whole
762// superslice.
763def : InstRW<[P9_LS_4C, IP_AGEN_1C, DISP_1C, DISP_1C, DISP_1C],
Ehsan Amiri6c17bb02016-12-19 13:35:45 +0000764 (instrs
765 LFIWZX,
766 LFDX,
767 LFD
768)>;
769
Stefan Pintilie735817a2018-03-09 21:08:35 +0000770// Cracked Load Instructions.
771// Load instructions that can be done in parallel.
Stefan Pintilie235fb922018-03-08 16:24:33 +0000772def : InstRW<[P9_LS_4C, P9_LS_4C, IP_AGEN_1C, IP_AGEN_1C,
773 DISP_1C, DISP_1C, DISP_1C, DISP_1C],
774 (instrs
775 SLBIA,
776 SLBIE,
777 SLBMFEE,
778 SLBMFEV,
779 SLBMTE,
780 TLBIEL
781)>;
782
Stefan Pintilie735817a2018-03-09 21:08:35 +0000783// Cracked Load Instruction.
Stefan Pintilie235fb922018-03-08 16:24:33 +0000784// Requires Load and ALU pieces totaling 6 cycles. The Load and ALU
785// operations can be run in parallel.
786def : InstRW<[P9_LS_4C, P9_ALU_2C, IP_EXEC_1C, IP_AGEN_1C,
787 DISP_1C, DISP_1C, DISP_1C, DISP_1C],
788 (instrs
789 (instregex "L(W|H)ZU(X)?(8)?$"),
790 TEND
791)>;
792
Stefan Pintilie735817a2018-03-09 21:08:35 +0000793// Cracked Store Instruction
794// Consecutive Store and ALU instructions. The store is restricted and requires
795// three dispatches.
Stefan Pintilie235fb922018-03-08 16:24:33 +0000796def : InstRW<[P9_StoreAndALUOp_3C, IP_EXEC_1C, IP_EXEC_1C, IP_AGEN_1C,
797 DISP_1C, DISP_1C, DISP_1C, DISP_1C, DISP_1C],
798 (instrs
799 (instregex "ST(B|H|W|D)CX$")
800)>;
801
Stefan Pintilie735817a2018-03-09 21:08:35 +0000802// Cracked Load Instruction.
803// Two consecutive load operations for a total of 8 cycles.
804def : InstRW<[P9_LoadAndLoadOp_8C, IP_AGEN_1C, IP_AGEN_1C,
805 DISP_1C, DISP_1C, DISP_1C, DISP_1C],
806 (instrs
807 LDMX
808)>;
809
Stefan Pintilied45db612018-03-05 14:34:59 +0000810// Cracked Load instruction.
811// Requires consecutive Load and ALU pieces totaling 6 cycles. The Load and ALU
812// operations cannot be done at the same time and so their latencies are added.
813def : InstRW<[P9_LoadAndALUOp_6C, IP_EXEC_1C, IP_AGEN_1C,
814 DISP_1C, DISP_1C, DISP_1C, DISP_1C],
815 (instrs
Stefan Pintilie235fb922018-03-08 16:24:33 +0000816 (instregex "LHA(X)?(8)?$"),
817 (instregex "CP_PASTE(8)?o$"),
818 (instregex "LWA(X)?(_32)?$"),
819 TCHECK
Stefan Pintilied45db612018-03-05 14:34:59 +0000820)>;
821
Stefan Pintilie590eb272017-09-22 20:17:25 +0000822// Cracked Restricted Load instruction.
823// Requires consecutive Load and ALU pieces totaling 6 cycles. The Load and ALU
824// operations cannot be done at the same time and so their latencies are added.
825// Full 6 dispatches are required as this is both cracked and restricted.
826def : InstRW<[P9_LoadAndALUOp_6C, IP_EXEC_1C, IP_AGEN_1C,
Ehsan Amiri6c17bb02016-12-19 13:35:45 +0000827 DISP_1C, DISP_1C, DISP_1C, DISP_1C, DISP_1C, DISP_1C],
828 (instrs
Stefan Pintiliee894e0f2018-03-01 16:16:08 +0000829 LFIWAX
Ehsan Amiri6c17bb02016-12-19 13:35:45 +0000830)>;
831
Stefan Pintilie590eb272017-09-22 20:17:25 +0000832// Cracked Load instruction.
833// Requires consecutive Load and ALU pieces totaling 7 cycles. The Load and ALU
834// operations cannot be done at the same time and so their latencies are added.
835// Full 4 dispatches are required as this is a cracked instruction.
836def : InstRW<[P9_LoadAndALUOp_7C, IP_AGEN_1C, IP_EXEC_1C,
837 DISP_1C, DISP_1C, DISP_1C, DISP_1C],
838 (instrs
Stefan Pintilie590eb272017-09-22 20:17:25 +0000839 LXSIWAX,
Stefan Pintilie626b6512018-02-23 20:37:10 +0000840 LIWAX
Stefan Pintilie590eb272017-09-22 20:17:25 +0000841)>;
842
Stefan Pintiliee894e0f2018-03-01 16:16:08 +0000843// Cracked Load instruction.
844// Requires consecutive Load (4 cycles) and ALU (3 cycles) pieces totaling 7
845// cycles. The Load and ALU operations cannot be done at the same time and so
846// their latencies are added.
847// Full 6 dispatches are required as this is a restricted instruction.
848def : InstRW<[P9_LoadAndALU2Op_7C, IP_AGEN_1C, IP_EXEC_1C,
849 DISP_1C, DISP_1C, DISP_1C, DISP_1C, DISP_1C, DISP_1C],
850 (instrs
851 LFSX,
852 LFS
853)>;
854
855// Cracked Load instruction.
856// Requires consecutive Load and ALU pieces totaling 8 cycles. The Load and ALU
857// operations cannot be done at the same time and so their latencies are added.
858// Full 4 dispatches are required as this is a cracked instruction.
859def : InstRW<[P9_LoadAndALU2Op_8C, IP_AGEN_1C, IP_EXEC_1C,
860 DISP_1C, DISP_1C, DISP_1C, DISP_1C],
861 (instrs
862 LXSSP,
863 LXSSPX,
864 XFLOADf32,
865 DFLOADf32
866)>;
867
Stefan Pintilie235fb922018-03-08 16:24:33 +0000868// Cracked 3-Way Load Instruction
869// Load with two ALU operations that depend on each other
870def : InstRW<[P9_LoadAndALUOp_6C, P9_ALU_2C, IP_AGEN_1C, IP_EXEC_1C, IP_EXEC_1C,
871 DISP_1C, DISP_1C, DISP_1C, DISP_1C, DISP_1C, DISP_1C],
872 (instrs
873 (instregex "LHAU(X)?(8)?$"),
874 LWAUX
875)>;
876
Stefan Pintilie590eb272017-09-22 20:17:25 +0000877// Cracked Load that requires the PM resource.
878// Since the Load and the PM cannot be done at the same time the latencies are
879// added. Requires 8 cycles.
880// Since the PM requires the full superslice we need both EXECE, EXECO pipelines
881// as well as 3 dispatches for the PM. The Load requires the remaining 2
882// dispatches.
883def : InstRW<[P9_LoadAndPMOp_8C, IP_AGEN_1C, IP_EXECE_1C, IP_EXECO_1C,
884 DISP_1C, DISP_1C, DISP_1C, DISP_1C, DISP_1C],
Ehsan Amiri6c17bb02016-12-19 13:35:45 +0000885 (instrs
Stefan Pintilie235fb922018-03-08 16:24:33 +0000886 LXVH8X,
Ehsan Amiri6c17bb02016-12-19 13:35:45 +0000887 LXVDSX,
888 LXVW4X
889)>;
890
Stefan Pintilie590eb272017-09-22 20:17:25 +0000891// Single slice Restricted store operation. The restricted operation requires
892// all three dispatches for the superslice.
Ehsan Amiri6c17bb02016-12-19 13:35:45 +0000893def : InstRW<[P9_LS_1C, IP_EXEC_1C, IP_AGEN_1C, DISP_1C, DISP_1C, DISP_1C],
894 (instrs
Stefan Pintilie626b6512018-02-23 20:37:10 +0000895 (instregex "STF(S|D|IWX|SX|DX)$"),
Stefan Pintilie235fb922018-03-08 16:24:33 +0000896 (instregex "STXS(D|DX|SPX|IWX|IBX|IHX|SP)(v)?$"),
897 (instregex "STW(8)?$"),
Stefan Pintilie735817a2018-03-09 21:08:35 +0000898 (instregex "(D|X)FSTORE(f32|f64)$"),
899 (instregex "ST(W|H|D)BRX$"),
900 (instregex "ST(B|H|D)(8)?$"),
901 (instregex "ST(B|W|H|D)(CI)?X(8)?$"),
Stefan Pintilie235fb922018-03-08 16:24:33 +0000902 STIWX,
903 SLBIEG,
904 STMW,
905 STSWI,
Stefan Pintilie735817a2018-03-09 21:08:35 +0000906 TLBIE
Ehsan Amiri6c17bb02016-12-19 13:35:45 +0000907)>;
908
Stefan Pintilie735817a2018-03-09 21:08:35 +0000909// Vector Store Instruction
910// Requires the whole superslice and therefore requires all three dispatches
911// as well as both the Even and Odd exec pipelines.
Stefan Pintilie590eb272017-09-22 20:17:25 +0000912def : InstRW<[P9_LS_1C, IP_EXECE_1C, IP_EXECO_1C, IP_AGEN_1C,
913 DISP_1C, DISP_1C, DISP_1C],
Ehsan Amiri6c17bb02016-12-19 13:35:45 +0000914 (instrs
Stefan Pintilie235fb922018-03-08 16:24:33 +0000915 (instregex "STVE(B|H|W)X$"),
916 (instregex "STVX(L)?$"),
917 (instregex "STXV(B16X|H8X|W4X|D2X|L|LL|X)?$")
Ehsan Amiri6c17bb02016-12-19 13:35:45 +0000918)>;
919
Stefan Pintilie235fb922018-03-08 16:24:33 +0000920// 5 Cycle DIV operation. Only one DIV unit per superslice so we use the whole
921// superslice. That includes both exec pipelines (EXECO, EXECE) and all three
922// dispatches.
923def : InstRW<[P9_DIV_5C, IP_EXECE_1C, IP_EXECO_1C, DISP_1C, DISP_1C, DISP_1C],
Stefan Pintilie626b6512018-02-23 20:37:10 +0000924 (instrs
Stefan Pintilie235fb922018-03-08 16:24:33 +0000925 (instregex "MTCTR(8)?(loop)?$"),
926 (instregex "MTLR(8)?$")
Stefan Pintilie626b6512018-02-23 20:37:10 +0000927)>;
928
929// 12 Cycle DIV operation. Only one DIV unit per superslice so we use the whole
930// superslice. That includes both exec pipelines (EXECO, EXECE) and all three
931// dispatches.
932def : InstRW<[P9_DIV_12C, IP_EXECE_1C, IP_EXECO_1C, DISP_1C, DISP_1C, DISP_1C],
933 (instrs
Stefan Pintiliee894e0f2018-03-01 16:16:08 +0000934 (instregex "M(T|F)VRSAVE(v)?$"),
Stefan Pintilie235fb922018-03-08 16:24:33 +0000935 (instregex "M(T|F)PMR$"),
936 (instregex "M(T|F)TB(8)?$"),
Stefan Pintiliee894e0f2018-03-01 16:16:08 +0000937 (instregex "MF(SPR|CTR|LR)(8)?$"),
Stefan Pintilie235fb922018-03-08 16:24:33 +0000938 (instregex "M(T|F)MSR(D)?$"),
939 (instregex "MTSPR(8)?$")
Stefan Pintilie626b6512018-02-23 20:37:10 +0000940)>;
Ehsan Amiri6c17bb02016-12-19 13:35:45 +0000941
Stefan Pintilie590eb272017-09-22 20:17:25 +0000942// 16 Cycle DIV operation. Only one DIV unit per superslice so we use the whole
943// superslice. That includes both exec pipelines (EXECO, EXECE) and all three
944// dispatches.
945def : InstRW<[P9_DIV_16C_8, IP_EXECO_1C, IP_EXECE_1C,
946 DISP_1C, DISP_1C, DISP_1C],
Ehsan Amiri6c17bb02016-12-19 13:35:45 +0000947 (instrs
948 DIVW,
Stefan Pintilie590eb272017-09-22 20:17:25 +0000949 DIVWU,
950 MODSW
Ehsan Amiri6c17bb02016-12-19 13:35:45 +0000951)>;
952
Stefan Pintilie590eb272017-09-22 20:17:25 +0000953// 24 Cycle DIV operation. Only one DIV unit per superslice so we use the whole
954// superslice. That includes both exec pipelines (EXECO, EXECE) and all three
955// dispatches.
956def : InstRW<[P9_DIV_24C_8, IP_EXECO_1C, IP_EXECE_1C,
957 DISP_1C, DISP_1C, DISP_1C],
Ehsan Amiri6c17bb02016-12-19 13:35:45 +0000958 (instrs
959 DIVWE,
960 DIVD,
961 DIVWEU,
Stefan Pintilie590eb272017-09-22 20:17:25 +0000962 DIVDU,
963 MODSD,
964 MODUD,
965 MODUW
Ehsan Amiri6c17bb02016-12-19 13:35:45 +0000966)>;
967
Stefan Pintilie590eb272017-09-22 20:17:25 +0000968// 40 Cycle DIV operation. Only one DIV unit per superslice so we use the whole
969// superslice. That includes both exec pipelines (EXECO, EXECE) and all three
970// dispatches.
971def : InstRW<[P9_DIV_40C_8, IP_EXECO_1C, IP_EXECE_1C,
972 DISP_1C, DISP_1C, DISP_1C],
Ehsan Amiri6c17bb02016-12-19 13:35:45 +0000973 (instrs
974 DIVDE,
975 DIVDEU
976)>;
977
Stefan Pintilie590eb272017-09-22 20:17:25 +0000978// Cracked DIV and ALU operation. Requires one full slice for the ALU operation
979// and one full superslice for the DIV operation since there is only one DIV
980// per superslice. Latency of DIV plus ALU is 26.
Stefan Pintilied45db612018-03-05 14:34:59 +0000981def : InstRW<[P9_IntDivAndALUOp_18C_8, IP_EXECE_1C, IP_EXECO_1C, IP_EXEC_1C,
982 DISP_1C, DISP_1C, DISP_1C, DISP_1C, DISP_1C],
983 (instrs
984 (instregex "DIVW(U)?(O)?o$")
985)>;
986
987// Cracked DIV and ALU operation. Requires one full slice for the ALU operation
988// and one full superslice for the DIV operation since there is only one DIV
989// per superslice. Latency of DIV plus ALU is 26.
Stefan Pintilie590eb272017-09-22 20:17:25 +0000990def : InstRW<[P9_IntDivAndALUOp_26C_8, IP_EXECE_1C, IP_EXECO_1C, IP_EXEC_1C,
991 DISP_1C, DISP_1C, DISP_1C, DISP_1C, DISP_1C],
Ehsan Amiri6c17bb02016-12-19 13:35:45 +0000992 (instrs
Stefan Pintiliecc330da2017-10-10 13:45:35 +0000993 DIVDo,
994 DIVDUo,
Ehsan Amiri6c17bb02016-12-19 13:35:45 +0000995 DIVWEo,
996 DIVWEUo
997)>;
998
Stefan Pintilie590eb272017-09-22 20:17:25 +0000999// Cracked DIV and ALU operation. Requires one full slice for the ALU operation
1000// and one full superslice for the DIV operation since there is only one DIV
1001// per superslice. Latency of DIV plus ALU is 42.
1002def : InstRW<[P9_IntDivAndALUOp_42C_8, IP_EXECE_1C, IP_EXECO_1C, IP_EXEC_1C,
1003 DISP_1C, DISP_1C, DISP_1C, DISP_1C, DISP_1C],
Ehsan Amiri6c17bb02016-12-19 13:35:45 +00001004 (instrs
1005 DIVDEo,
1006 DIVDEUo
1007)>;
1008
Ehsan Amiri6c17bb02016-12-19 13:35:45 +00001009// CR access instructions in _BrMCR, IIC_BrMCRX.
1010
Stefan Pintilie590eb272017-09-22 20:17:25 +00001011// Cracked, restricted, ALU operations.
1012// Here the two ALU ops can actually be done in parallel and therefore the
1013// latencies are not added together. Otherwise this is like having two
1014// instructions running together on two pipelines and 6 dispatches.
1015// ALU ops are 2 cycles each.
Ehsan Amiri6c17bb02016-12-19 13:35:45 +00001016def : InstRW<[P9_ALU_2C, P9_ALU_2C, IP_EXEC_1C, IP_EXEC_1C,
1017 DISP_1C, DISP_1C, DISP_1C, DISP_1C, DISP_1C, DISP_1C],
1018 (instrs
Ehsan Amiri6c17bb02016-12-19 13:35:45 +00001019 MTCRF,
1020 MTCRF8
1021)>;
1022
Stefan Pintiliee894e0f2018-03-01 16:16:08 +00001023// Cracked ALU operations.
1024// Here the two ALU ops can actually be done in parallel and therefore the
1025// latencies are not added together. Otherwise this is like having two
1026// instructions running together on two pipelines and 4 dispatches.
1027// ALU ops are 2 cycles each.
1028def : InstRW<[P9_ALU_2C, P9_ALU_2C, IP_EXEC_1C, IP_EXEC_1C,
1029 DISP_1C, DISP_1C, DISP_1C, DISP_1C],
1030 (instrs
Stefan Pintilie235fb922018-03-08 16:24:33 +00001031 (instregex "ADDC(8)?o$"),
1032 (instregex "SUBFC(8)?o$")
Stefan Pintiliee894e0f2018-03-01 16:16:08 +00001033)>;
1034
Stefan Pintilied45db612018-03-05 14:34:59 +00001035// Cracked ALU operations.
1036// Two ALU ops can be done in parallel.
1037// One is three cycle ALU the ohter is a two cycle ALU.
1038// One of the ALU ops is restricted the other is not so we have a total of
1039// 5 dispatches.
1040def : InstRW<[P9_ALU_2C, P9_ALU_3C, IP_EXEC_1C, IP_EXEC_1C,
1041 DISP_1C, DISP_1C, DISP_1C, DISP_1C, DISP_1C],
1042 (instrs
1043 (instregex "F(N)?ABS(D|S)o$"),
1044 (instregex "FCPSGN(D|S)o$"),
1045 (instregex "FNEG(D|S)o$"),
1046 FMRo
1047)>;
1048
1049// Cracked ALU operations.
Stefan Pintilie590eb272017-09-22 20:17:25 +00001050// Here the two ALU ops can actually be done in parallel and therefore the
1051// latencies are not added together. Otherwise this is like having two
Stefan Pintilied45db612018-03-05 14:34:59 +00001052// instructions running together on two pipelines and 4 dispatches.
Stefan Pintilie590eb272017-09-22 20:17:25 +00001053// ALU ops are 3 cycles each.
1054def : InstRW<[P9_ALU_3C, P9_ALU_3C, IP_EXEC_1C, IP_EXEC_1C,
Ehsan Amiri6c17bb02016-12-19 13:35:45 +00001055 DISP_1C, DISP_1C, DISP_1C, DISP_1C],
1056 (instrs
1057 MCRFS
1058)>;
1059
Stefan Pintilie235fb922018-03-08 16:24:33 +00001060// Cracked Restricted ALU operations.
1061// Here the two ALU ops can actually be done in parallel and therefore the
1062// latencies are not added together. Otherwise this is like having two
1063// instructions running together on two pipelines and 6 dispatches.
1064// ALU ops are 3 cycles each.
1065def : InstRW<[P9_ALU_3C, P9_ALU_3C, IP_EXEC_1C, IP_EXEC_1C,
1066 DISP_1C, DISP_1C, DISP_1C, DISP_1C, DISP_1C, DISP_1C],
1067 (instrs
1068 (instregex "MTFSF(b|o)?$"),
1069 (instregex "MTFSFI(o)?$")
1070)>;
1071
Stefan Pintilieb5a94402018-03-02 14:41:38 +00001072// Cracked instruction made of two ALU ops.
1073// The two ops cannot be done in parallel.
Stefan Pintilie235fb922018-03-08 16:24:33 +00001074// One of the ALU ops is restricted and takes 3 dispatches.
Stefan Pintilie626b6512018-02-23 20:37:10 +00001075def : InstRW<[P9_ALUOpAndALUOp_4C, IP_EXEC_1C, IP_EXEC_1C,
1076 DISP_1C, DISP_1C, DISP_1C, DISP_1C, DISP_1C],
1077 (instrs
Stefan Pintilie235fb922018-03-08 16:24:33 +00001078 (instregex "RLD(I)?C(R|L)o$"),
1079 (instregex "RLW(IMI|INM|NM)(8)?o$"),
1080 (instregex "SLW(8)?o$"),
1081 (instregex "SRAW(I)?o$"),
1082 (instregex "SRW(8)?o$"),
1083 RLDICL_32o,
1084 RLDIMIo
1085)>;
1086
1087// Cracked instruction made of two ALU ops.
1088// The two ops cannot be done in parallel.
1089// Both of the ALU ops are restricted and take 3 dispatches.
1090def : InstRW<[P9_ALU2OpAndALU2Op_6C, IP_EXEC_1C, IP_EXEC_1C,
1091 DISP_1C, DISP_1C, DISP_1C, DISP_1C, DISP_1C, DISP_1C],
1092 (instrs
1093 (instregex "MFFS(L|CE|o)?$")
1094)>;
1095
Stefan Pintilie735817a2018-03-09 21:08:35 +00001096// Cracked ALU instruction composed of three consecutive 2 cycle loads for a
1097// total of 6 cycles. All of the ALU operations are also restricted so each
1098// takes 3 dispatches for a total of 9.
Stefan Pintilie235fb922018-03-08 16:24:33 +00001099def : InstRW<[P9_ALUOpAndALUOpAndALUOp_6C, IP_EXEC_1C, IP_EXEC_1C, IP_EXEC_1C,
1100 DISP_1C, DISP_1C, DISP_1C, DISP_1C, DISP_1C, DISP_1C, DISP_1C,
1101 DISP_1C, DISP_1C],
1102 (instrs
1103 (instregex "MFCR(8)?$")
Stefan Pintilie626b6512018-02-23 20:37:10 +00001104)>;
1105
Stefan Pintilieb5a94402018-03-02 14:41:38 +00001106// Cracked instruction made of two ALU ops.
1107// The two ops cannot be done in parallel.
1108def : InstRW<[P9_ALUOpAndALUOp_4C, IP_EXEC_1C, IP_EXEC_1C,
1109 DISP_1C, DISP_1C, DISP_1C, DISP_1C],
1110 (instrs
Stefan Pintilie235fb922018-03-08 16:24:33 +00001111 (instregex "EXTSWSLIo$"),
1112 (instregex "SRAD(I)?o$"),
1113 SLDo,
1114 SRDo,
1115 RLDICo
Stefan Pintilieb5a94402018-03-02 14:41:38 +00001116)>;
1117
Stefan Pintilie590eb272017-09-22 20:17:25 +00001118// 33 Cycle DP Instruction Restricted. Takes one slice and 3 dispatches.
Ehsan Amiri6c17bb02016-12-19 13:35:45 +00001119def : InstRW<[P9_DP_33C_8, IP_EXEC_1C, DISP_1C, DISP_1C, DISP_1C],
1120 (instrs
Stefan Pintilie590eb272017-09-22 20:17:25 +00001121 FDIV
1122)>;
1123
Stefan Pintilied45db612018-03-05 14:34:59 +00001124// 33 Cycle DP Instruction Restricted and Cracked with 3 Cycle ALU.
Stefan Pintiliee894e0f2018-03-01 16:16:08 +00001125def : InstRW<[P9_DPOpAndALU2Op_36C_8, IP_EXEC_1C, IP_EXEC_1C,
Stefan Pintiliecc330da2017-10-10 13:45:35 +00001126 DISP_1C, DISP_1C, DISP_1C, DISP_1C, DISP_1C],
1127 (instrs
1128 FDIVo
1129)>;
1130
Stefan Pintilie235fb922018-03-08 16:24:33 +00001131// 36 Cycle DP Instruction.
Stefan Pintilie735817a2018-03-09 21:08:35 +00001132// Instruction can be done on a single slice.
Stefan Pintilie235fb922018-03-08 16:24:33 +00001133def : InstRW<[P9_DP_36C_10, IP_EXEC_1C, DISP_1C, DISP_1C],
1134 (instrs
1135 XSSQRTDP
1136)>;
1137
Stefan Pintilied45db612018-03-05 14:34:59 +00001138// 36 Cycle DP Instruction Restricted. Takes one slice and 3 dispatches.
1139def : InstRW<[P9_DP_36C_10, IP_EXEC_1C, DISP_1C, DISP_1C, DISP_1C],
1140 (instrs
1141 FSQRT
1142)>;
1143
Stefan Pintilie235fb922018-03-08 16:24:33 +00001144// 36 Cycle DP Vector Instruction.
1145def : InstRW<[P9_DPE_36C_10, P9_DPO_36C_10, IP_EXECE_1C, IP_EXECO_1C,
1146 DISP_1C, DISP_1C, DISP_1C],
1147 (instrs
1148 XVSQRTDP
1149)>;
1150
1151// 27 Cycle DP Vector Instruction.
1152def : InstRW<[P9_DPE_27C_10, P9_DPO_27C_10, IP_EXECE_1C, IP_EXECO_1C,
1153 DISP_1C, DISP_1C, DISP_1C],
1154 (instrs
1155 XVSQRTSP
1156)>;
1157
Stefan Pintilied45db612018-03-05 14:34:59 +00001158// 36 Cycle DP Instruction Restricted and Cracked with 3 Cycle ALU.
1159def : InstRW<[P9_DPOpAndALU2Op_39C_10, IP_EXEC_1C, IP_EXEC_1C,
1160 DISP_1C, DISP_1C, DISP_1C, DISP_1C, DISP_1C],
1161 (instrs
1162 FSQRTo
1163)>;
1164
Stefan Pintilie235fb922018-03-08 16:24:33 +00001165// 26 Cycle DP Instruction.
1166def : InstRW<[P9_DP_26C_5, IP_EXEC_1C, DISP_1C, DISP_1C],
1167 (instrs
1168 XSSQRTSP
1169)>;
1170
Stefan Pintilied45db612018-03-05 14:34:59 +00001171// 26 Cycle DP Instruction Restricted. Takes one slice and 3 dispatches.
1172def : InstRW<[P9_DP_26C_5, IP_EXEC_1C, DISP_1C, DISP_1C, DISP_1C],
1173 (instrs
1174 FSQRTS
1175)>;
1176
1177// 26 Cycle DP Instruction Restricted and Cracked with 3 Cycle ALU.
1178def : InstRW<[P9_DPOpAndALU2Op_29C_5, IP_EXEC_1C, IP_EXEC_1C,
1179 DISP_1C, DISP_1C, DISP_1C, DISP_1C, DISP_1C],
1180 (instrs
1181 FSQRTSo
1182)>;
1183
Stefan Pintilie590eb272017-09-22 20:17:25 +00001184// 33 Cycle DP Instruction. Takes one slice and 2 dispatches.
1185def : InstRW<[P9_DP_33C_8, IP_EXEC_1C, DISP_1C, DISP_1C],
1186 (instrs
Ehsan Amiri6c17bb02016-12-19 13:35:45 +00001187 XSDIVDP
1188)>;
1189
Stefan Pintilie590eb272017-09-22 20:17:25 +00001190// 22 Cycle DP Instruction Restricted. Takes one slice and 3 dispatches.
Ehsan Amiri6c17bb02016-12-19 13:35:45 +00001191def : InstRW<[P9_DP_22C_5, IP_EXEC_1C, DISP_1C, DISP_1C, DISP_1C],
1192 (instrs
Stefan Pintilie590eb272017-09-22 20:17:25 +00001193 FDIVS
1194)>;
1195
Stefan Pintiliecc330da2017-10-10 13:45:35 +00001196// 22 Cycle DP Instruction Restricted and Cracked with 2 Cycle ALU.
Stefan Pintiliee894e0f2018-03-01 16:16:08 +00001197def : InstRW<[P9_DPOpAndALU2Op_25C_5, IP_EXEC_1C, IP_EXEC_1C,
Stefan Pintiliecc330da2017-10-10 13:45:35 +00001198 DISP_1C, DISP_1C, DISP_1C, DISP_1C, DISP_1C],
1199 (instrs
1200 FDIVSo
1201)>;
1202
Stefan Pintilie590eb272017-09-22 20:17:25 +00001203// 22 Cycle DP Instruction. Takes one slice and 2 dispatches.
1204def : InstRW<[P9_DP_22C_5, IP_EXEC_1C, DISP_1C, DISP_1C],
1205 (instrs
Ehsan Amiri6c17bb02016-12-19 13:35:45 +00001206 XSDIVSP
1207)>;
1208
Stefan Pintilie590eb272017-09-22 20:17:25 +00001209// 24 Cycle DP Vector Instruction. Takes one full superslice.
1210// Includes both EXECE, EXECO pipelines and all 3 dispatches for the given
1211// superslice.
1212def : InstRW<[P9_DPE_24C_8, P9_DPO_24C_8, IP_EXECE_1C, IP_EXECO_1C,
1213 DISP_1C, DISP_1C, DISP_1C],
Ehsan Amiri6c17bb02016-12-19 13:35:45 +00001214 (instrs
1215 XVDIVSP
1216)>;
1217
Stefan Pintilie590eb272017-09-22 20:17:25 +00001218// 33 Cycle DP Vector Instruction. Takes one full superslice.
1219// Includes both EXECE, EXECO pipelines and all 3 dispatches for the given
1220// superslice.
1221def : InstRW<[P9_DPE_33C_8, P9_DPO_33C_8, IP_EXECE_1C, IP_EXECO_1C,
1222 DISP_1C, DISP_1C, DISP_1C],
Ehsan Amiri6c17bb02016-12-19 13:35:45 +00001223 (instrs
1224 XVDIVDP
1225)>;
1226
Stefan Pintilie590eb272017-09-22 20:17:25 +00001227// Instruction cracked into three pieces. One Load and two ALU operations.
1228// The Load and one of the ALU ops cannot be run at the same time and so the
1229// latencies are added together for 6 cycles. The remainaing ALU is 2 cycles.
1230// Both the load and the ALU that depends on it are restricted and so they take
1231// a total of 6 dispatches. The final 2 dispatches come from the second ALU op.
1232// The two EXEC pipelines are for the 2 ALUs while the AGEN is for the load.
Stefan Pintiliee894e0f2018-03-01 16:16:08 +00001233def : InstRW<[P9_LoadAndALU2Op_7C, P9_ALU_2C,
Ehsan Amiri6c17bb02016-12-19 13:35:45 +00001234 IP_AGEN_1C, IP_EXEC_1C, IP_EXEC_1C,
1235 DISP_1C, DISP_1C, DISP_1C, DISP_1C,
1236 DISP_1C, DISP_1C, DISP_1C, DISP_1C],
1237 (instrs
Stefan Pintilie626b6512018-02-23 20:37:10 +00001238 (instregex "LF(SU|SUX)$")
1239)>;
1240
1241// Cracked instruction made up of a Store and an ALU. The ALU does not depend on
1242// the store and so it can be run at the same time as the store. The store is
1243// also restricted.
1244def : InstRW<[P9_LS_1C, P9_ALU_2C, IP_AGEN_1C, IP_EXEC_1C, IP_EXEC_1C,
1245 DISP_1C, DISP_1C, DISP_1C, DISP_1C, DISP_1C],
1246 (instrs
Stefan Pintilie235fb922018-03-08 16:24:33 +00001247 (instregex "STF(S|D)U(X)?$"),
1248 (instregex "ST(B|H|W|D)U(X)?(8)?$")
Ehsan Amiri6c17bb02016-12-19 13:35:45 +00001249)>;
1250
Stefan Pintilie590eb272017-09-22 20:17:25 +00001251// Cracked instruction made up of a Load and an ALU. The ALU does not depend on
Stefan Pintilied45db612018-03-05 14:34:59 +00001252// the load and so it can be run at the same time as the load.
1253def : InstRW<[P9_LS_4C, P9_ALU_2C, IP_AGEN_1C, IP_EXEC_1C,
1254 DISP_1C, DISP_1C, DISP_1C, DISP_1C],
1255 (instrs
1256 (instregex "LBZU(X)?(8)?$"),
1257 (instregex "LDU(X)?$")
1258)>;
1259
1260
1261// Cracked instruction made up of a Load and an ALU. The ALU does not depend on
Stefan Pintilie590eb272017-09-22 20:17:25 +00001262// the load and so it can be run at the same time as the load. The load is also
1263// restricted. 3 dispatches are from the restricted load while the other two
1264// are from the ALU. The AGEN pipeline is from the load and the EXEC pipeline
1265// is required for the ALU.
1266def : InstRW<[P9_LS_4C, P9_ALU_2C, IP_AGEN_1C, IP_EXEC_1C,
Ehsan Amiri6c17bb02016-12-19 13:35:45 +00001267 DISP_1C, DISP_1C, DISP_1C, DISP_1C, DISP_1C],
1268 (instrs
Stefan Pintilie626b6512018-02-23 20:37:10 +00001269 (instregex "LF(DU|DUX)$")
Ehsan Amiri6c17bb02016-12-19 13:35:45 +00001270)>;
1271
Stefan Pintilie590eb272017-09-22 20:17:25 +00001272// Crypto Instructions
1273
1274// 6 Cycle CY operation. Only one CY unit per CPU so we use a whole
1275// superslice. That includes both exec pipelines (EXECO, EXECE) and all three
1276// dispatches.
1277def : InstRW<[P9_CY_6C, IP_EXECO_1C, IP_EXECE_1C, DISP_1C, DISP_1C, DISP_1C],
1278 (instrs
Stefan Pintiliee894e0f2018-03-01 16:16:08 +00001279 (instregex "VPMSUM(B|H|W|D)$"),
1280 (instregex "V(N)?CIPHER(LAST)?$"),
1281 VSBOX
Stefan Pintilie590eb272017-09-22 20:17:25 +00001282)>;
Stefan Pintilie626b6512018-02-23 20:37:10 +00001283
Stefan Pintiliee894e0f2018-03-01 16:16:08 +00001284// Branch Instructions
1285
1286// Two Cycle Branch
1287def : InstRW<[P9_BR_2C, DISP_1C, DISP_1C],
1288 (instrs
1289 (instregex "BCCCTR(L)?(8)?$"),
1290 (instregex "BCCL(A|R|RL)?$"),
1291 (instregex "BCCTR(L)?(8)?(n)?$"),
1292 (instregex "BD(N)?Z(8|A|Am|Ap|m|p)?$"),
1293 (instregex "BD(N)?ZL(A|Am|Ap|R|R8|RL|RLm|RLp|Rm|Rp|m|p)?$"),
1294 (instregex "BL(_TLS)?$"),
1295 (instregex "BL8(_TLS|_NOP|_NOP_TLS|_TLS_)?$"),
1296 (instregex "BLA(8|8_NOP)?$"),
1297 (instregex "BLR(8|L)?$"),
1298 (instregex "TAILB(A)?(8)?$"),
1299 (instregex "TAILBCTR(8)?$"),
1300 (instregex "gBC(A|Aat|CTR|CTRL|L|LA|LAat|LR|LRL|Lat|at)?$"),
1301 (instregex "BCLR(L)?(n)?$"),
1302 (instregex "BCTR(L)?(8)?$"),
1303 B,
1304 BA,
1305 BC,
1306 BCC,
1307 BCCA,
1308 BCL,
1309 BCLalways,
1310 BCLn,
1311 BCTRL8_LDinto_toc,
1312 BCn,
1313 CTRL_DEP
1314)>;
1315
1316// Five Cycle Branch with a 2 Cycle ALU Op
1317// Operations must be done consecutively and not in parallel.
1318def : InstRW<[P9_BROpAndALUOp_7C, IP_EXEC_1C,
1319 DISP_1C, DISP_1C, DISP_1C, DISP_1C],
1320 (instrs
1321 ADDPCIS
1322)>;
1323
Stefan Pintilie735817a2018-03-09 21:08:35 +00001324// Special Extracted Instructions For Atomics
Stefan Pintilied45db612018-03-05 14:34:59 +00001325
1326// Atomic Load
1327def : InstRW<[P9_LS_1C, P9_LS_1C, P9_LS_4C, P9_LS_4C, P9_LS_4C,
1328 IP_EXEC_1C, IP_EXEC_1C, IP_AGEN_1C, IP_AGEN_1C, IP_AGEN_1C,
1329 IP_AGEN_1C, IP_AGEN_1C, DISP_1C, DISP_1C, DISP_1C, DISP_1C,
1330 DISP_1C, DISP_1C, DISP_1C, DISP_1C, DISP_1C, DISP_1C, DISP_1C,
1331 DISP_1C],
1332 (instrs
Stefan Pintilie235fb922018-03-08 16:24:33 +00001333 (instregex "L(D|W)AT$")
1334)>;
1335
1336// Atomic Store
1337def : InstRW<[P9_LS_1C, P9_LS_4C, P9_LS_4C, IP_EXEC_1C, IP_AGEN_1C, IP_AGEN_1C,
1338 IP_AGEN_1C, DISP_1C, DISP_1C, DISP_1C, DISP_1C, DISP_1C, DISP_1C,
1339 DISP_1C],
1340 (instrs
1341 (instregex "ST(D|W)AT$")
Stefan Pintilied45db612018-03-05 14:34:59 +00001342)>;
1343
Stefan Pintilieb5a94402018-03-02 14:41:38 +00001344// Signal Processing Engine (SPE) Instructions
1345// These instructions are not supported on Power 9
1346def : InstRW<[],
1347 (instrs
1348 BRINC,
1349 EVABS,
1350 EVEQV,
1351 EVMRA,
1352 EVNAND,
1353 EVNEG,
1354 (instregex "EVADD(I)?W$"),
1355 (instregex "EVADD(SM|SS|UM|US)IAAW$"),
1356 (instregex "EVAND(C)?$"),
1357 (instregex "EVCMP(EQ|GTS|GTU|LTS|LTU)$"),
1358 (instregex "EVCNTL(S|Z)W$"),
1359 (instregex "EVDIVW(S|U)$"),
1360 (instregex "EVEXTS(B|H)$"),
1361 (instregex "EVLD(H|W|D)(X)?$"),
1362 (instregex "EVLHH(E|OS|OU)SPLAT(X)?$"),
1363 (instregex "EVLWHE(X)?$"),
1364 (instregex "EVLWHO(S|U)(X)?$"),
1365 (instregex "EVLW(H|W)SPLAT(X)?$"),
1366 (instregex "EVMERGE(HI|LO|HILO|LOHI)$"),
1367 (instregex "EVMHEG(S|U)M(F|I)A(A|N)$"),
1368 (instregex "EVMHES(M|S)(F|I)(A|AA|AAW|ANW)?$"),
1369 (instregex "EVMHEU(M|S)I(A|AA|AAW|ANW)?$"),
1370 (instregex "EVMHOG(U|S)M(F|I)A(A|N)$"),
1371 (instregex "EVMHOS(M|S)(F|I)(A|AA|AAW|ANW)?$"),
1372 (instregex "EVMHOU(M|S)I(A|AA|ANW|AAW)?$"),
1373 (instregex "EVMWHS(M|S)(F|FA|I|IA)$"),
1374 (instregex "EVMWHUMI(A)?$"),
1375 (instregex "EVMWLS(M|S)IA(A|N)W$"),
1376 (instregex "EVMWLU(M|S)I(A|AA|AAW|ANW)?$"),
1377 (instregex "EVMWSM(F|I)(A|AA|AN)?$"),
1378 (instregex "EVMWSSF(A|AA|AN)?$"),
1379 (instregex "EVMWUMI(A|AA|AN)?$"),
1380 (instregex "EV(N|X)?OR(C)?$"),
1381 (instregex "EVR(LW|LWI|NDW)$"),
1382 (instregex "EVSLW(I)?$"),
1383 (instregex "EVSPLAT(F)?I$"),
1384 (instregex "EVSRW(I)?(S|U)$"),
1385 (instregex "EVST(DD|DH|DW|WHE|WHO|WWE|WWO)(X)?$"),
1386 (instregex "EVSUBF(S|U)(M|S)IAAW$"),
1387 (instregex "EVSUB(I)?FW$")
1388)> { let Unsupported = 1; }
Stefan Pintiliee894e0f2018-03-01 16:16:08 +00001389
Stefan Pintilieb5a94402018-03-02 14:41:38 +00001390// General Instructions without scheduling support.
Stefan Pintilie626b6512018-02-23 20:37:10 +00001391def : InstRW<[],
1392 (instrs
Stefan Pintiliee894e0f2018-03-01 16:16:08 +00001393 (instregex "(H)?RFI(D)?$"),
Stefan Pintilied45db612018-03-05 14:34:59 +00001394 (instregex "DSS(ALL)?$"),
1395 (instregex "DST(ST)?(T)?(64)?$"),
1396 (instregex "ICBL(C|Q)$"),
Stefan Pintilie235fb922018-03-08 16:24:33 +00001397 (instregex "L(W|H|B)EPX$"),
1398 (instregex "ST(W|H|B)EPX$"),
1399 (instregex "(L|ST)FDEPX$"),
1400 (instregex "M(T|F)SR(IN)?$"),
1401 (instregex "M(T|F)DCR$"),
1402 (instregex "NOP_GT_PWR(6|7)$"),
1403 (instregex "TLB(IA|IVAX|SX|SX2|SX2D|LD|LI|RE|RE2|WE|WE2)$"),
1404 (instregex "WRTEE(I)?$"),
Stefan Pintiliee894e0f2018-03-01 16:16:08 +00001405 ATTN,
Stefan Pintiliee894e0f2018-03-01 16:16:08 +00001406 CLRBHRB,
1407 MFBHRBE,
Stefan Pintilie235fb922018-03-08 16:24:33 +00001408 MBAR,
1409 MSYNC,
1410 SLBSYNC,
Stefan Pintiliee894e0f2018-03-01 16:16:08 +00001411 NAP,
Stefan Pintilie235fb922018-03-08 16:24:33 +00001412 STOP,
1413 TRAP,
Stefan Pintiliee894e0f2018-03-01 16:16:08 +00001414 RFCI,
1415 RFDI,
1416 RFMCI,
1417 SC,
Stefan Pintilied45db612018-03-05 14:34:59 +00001418 DCBA,
1419 DCBI,
1420 DCCCI,
Stefan Pintilie235fb922018-03-08 16:24:33 +00001421 ICCCI
Stefan Pintilie626b6512018-02-23 20:37:10 +00001422)> { let Unsupported = 1; }