blob: 832e0e30ada212eaef7d3cb5416b276517c498e2 [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)$"),
Stefan Pintilie659f0402018-03-27 17:51:53 +0000154 COPY,
Stefan Pintilie735817a2018-03-09 21:08:35 +0000155 MCRF,
156 MCRXRX,
157 XSNABSDP,
158 XSXEXPDP,
159 XSABSDP,
160 XSNEGDP,
161 XSCPSGNDP,
162 MFVSRWZ,
163 SRADI_32,
164 RLDIC,
165 RFEBB,
166 LA,
167 TBEGIN,
168 TRECHKPT,
169 NOP,
170 WAIT
Stefan Pintilie590eb272017-09-22 20:17:25 +0000171)>;
172
173// Restricted Dispatch ALU operation for 2 cycles. The operation runs on a
174// slingle slice. However, since it is Restricted it requires all 3 dispatches
175// (DISP) for that superslice.
176def : InstRW<[P9_ALU_2C, IP_EXEC_1C, DISP_1C, DISP_1C, DISP_1C],
177 (instrs
Stefan Pintilie735817a2018-03-09 21:08:35 +0000178 (instregex "RLDC(L|R)$"),
Stefan Pintilie626b6512018-02-23 20:37:10 +0000179 (instregex "RLWIMI(8)?$"),
Stefan Pintilie735817a2018-03-09 21:08:35 +0000180 (instregex "RLDIC(L|R)(_32)?(_64)?$"),
181 (instregex "M(F|T)OCRF(8)?$"),
Stefan Pintilied45db612018-03-05 14:34:59 +0000182 (instregex "CR(6)?(UN)?SET$"),
183 (instregex "CR(N)?(OR|AND)(C)?$"),
Stefan Pintilie626b6512018-02-23 20:37:10 +0000184 (instregex "S(L|R)W(8)?$"),
185 (instregex "RLW(INM|NM)(8)?$"),
186 (instregex "F(N)?ABS(D|S)$"),
187 (instregex "FNEG(D|S)$"),
188 (instregex "FCPSGN(D|S)$"),
189 (instregex "SRAW(I)?$"),
Stefan Pintilie735817a2018-03-09 21:08:35 +0000190 (instregex "ISEL(8)?$"),
191 RLDIMI,
192 XSIEXPDP,
193 FMR,
194 CREQV,
195 CRXOR,
196 TRECLAIM,
197 TSR,
198 TABORT
Stefan Pintilie590eb272017-09-22 20:17:25 +0000199)>;
200
201// Three cycle ALU vector operation that uses an entire superslice.
Stefan Pintilie735817a2018-03-09 21:08:35 +0000202// Uses both ALU units (the even ALUE and odd ALUO units), two pipelines
203// (EXECE, EXECO) and all three dispatches (DISP) to the given superslice.
Stefan Pintilie590eb272017-09-22 20:17:25 +0000204def : InstRW<[P9_ALUE_3C, P9_ALUO_3C, IP_EXECE_1C, IP_EXECO_1C,
205 DISP_1C, DISP_1C, DISP_1C],
206 (instrs
Stefan Pintilie235fb922018-03-08 16:24:33 +0000207 (instregex "M(T|F)VSCR$"),
Stefan Pintiliee894e0f2018-03-01 16:16:08 +0000208 (instregex "VCMPNEZ(B|H|W)$"),
Stefan Pintilie735817a2018-03-09 21:08:35 +0000209 (instregex "VCMPEQU(B|H|W|D)$"),
210 (instregex "VCMPNE(B|H|W)$"),
211 (instregex "VABSDU(B|H|W)$"),
212 (instregex "VADDU(B|H|W)S$"),
213 (instregex "VAVG(S|U)(B|H|W)$"),
214 (instregex "VCMP(EQ|GE|GT)FP(o)?$"),
215 (instregex "VCMPBFP(o)?$"),
216 (instregex "VC(L|T)Z(B|H|W|D)$"),
217 (instregex "VADDS(B|H|W)S$"),
218 (instregex "V(MIN|MAX)FP$"),
219 (instregex "V(MIN|MAX)(S|U)(B|H|W|D)$"),
Stefan Pintilie590eb272017-09-22 20:17:25 +0000220 VBPERMD,
Stefan Pintiliee894e0f2018-03-01 16:16:08 +0000221 VADDCUW,
Stefan Pintilie590eb272017-09-22 20:17:25 +0000222 VPOPCNTW,
223 VPOPCNTD,
224 VPRTYBD,
225 VPRTYBW,
226 VSHASIGMAD,
227 VSHASIGMAW,
228 VSUBSBS,
229 VSUBSHS,
230 VSUBSWS,
231 VSUBUBS,
232 VSUBUHS,
233 VSUBUWS,
234 VSUBCUW,
235 VCMPGTSB,
236 VCMPGTSBo,
237 VCMPGTSD,
238 VCMPGTSDo,
239 VCMPGTSH,
240 VCMPGTSHo,
241 VCMPGTSW,
242 VCMPGTSWo,
243 VCMPGTUB,
244 VCMPGTUBo,
245 VCMPGTUD,
246 VCMPGTUDo,
247 VCMPGTUH,
248 VCMPGTUHo,
249 VCMPGTUW,
250 VCMPGTUWo,
251 VCMPNEBo,
252 VCMPNEHo,
253 VCMPNEWo,
254 VCMPNEZBo,
255 VCMPNEZHo,
256 VCMPNEZWo,
257 VCMPEQUBo,
258 VCMPEQUDo,
259 VCMPEQUHo,
260 VCMPEQUWo,
Ehsan Amiri6c17bb02016-12-19 13:35:45 +0000261 XVCMPEQDP,
262 XVCMPEQDPo,
263 XVCMPEQSP,
264 XVCMPEQSPo,
265 XVCMPGEDP,
266 XVCMPGEDPo,
267 XVCMPGESP,
268 XVCMPGESPo,
269 XVCMPGTDP,
270 XVCMPGTDPo,
271 XVCMPGTSP,
272 XVCMPGTSPo,
Ehsan Amiri6c17bb02016-12-19 13:35:45 +0000273 XVMAXDP,
274 XVMAXSP,
275 XVMINDP,
276 XVMINSP,
277 XVTDIVDP,
278 XVTDIVSP,
279 XVTSQRTDP,
280 XVTSQRTSP,
281 XVTSTDCDP,
282 XVTSTDCSP,
Ehsan Amiri6c17bb02016-12-19 13:35:45 +0000283 XVXSIGDP,
284 XVXSIGSP
285)>;
286
Stefan Pintilie590eb272017-09-22 20:17:25 +0000287// 7 cycle DP vector operation that uses an entire superslice.
288// Uses both DP units (the even DPE and odd DPO units), two pipelines
289// (EXECE, EXECO) and all three dispatches (DISP) to the given superslice.
290def : InstRW<[P9_DPE_7C, P9_DPO_7C, IP_EXECE_1C, IP_EXECO_1C,
291 DISP_1C, DISP_1C, DISP_1C],
Ehsan Amiri6c17bb02016-12-19 13:35:45 +0000292 (instrs
293 VADDFP,
294 VCTSXS,
295 VCTSXS_0,
296 VCTUXS,
297 VCTUXS_0,
298 VEXPTEFP,
299 VLOGEFP,
300 VMADDFP,
301 VMHADDSHS,
302 VNMSUBFP,
303 VREFP,
304 VRFIM,
305 VRFIN,
306 VRFIP,
307 VRFIZ,
308 VRSQRTEFP,
309 VSUBFP,
310 XVADDDP,
311 XVADDSP,
312 XVCVDPSP,
313 XVCVDPSXDS,
314 XVCVDPSXWS,
315 XVCVDPUXDS,
316 XVCVDPUXWS,
317 XVCVHPSP,
318 XVCVSPDP,
319 XVCVSPHP,
320 XVCVSPSXDS,
321 XVCVSPSXWS,
322 XVCVSPUXDS,
323 XVCVSPUXWS,
324 XVCVSXDDP,
325 XVCVSXDSP,
326 XVCVSXWDP,
327 XVCVSXWSP,
328 XVCVUXDDP,
329 XVCVUXDSP,
330 XVCVUXWDP,
331 XVCVUXWSP,
332 XVMADDADP,
333 XVMADDASP,
334 XVMADDMDP,
335 XVMADDMSP,
336 XVMSUBADP,
337 XVMSUBASP,
338 XVMSUBMDP,
339 XVMSUBMSP,
340 XVMULDP,
341 XVMULSP,
342 XVNMADDADP,
343 XVNMADDASP,
344 XVNMADDMDP,
345 XVNMADDMSP,
346 XVNMSUBADP,
347 XVNMSUBASP,
348 XVNMSUBMDP,
349 XVNMSUBMSP,
350 XVRDPI,
351 XVRDPIC,
352 XVRDPIM,
353 XVRDPIP,
354 XVRDPIZ,
355 XVREDP,
356 XVRESP,
357 XVRSPI,
358 XVRSPIC,
359 XVRSPIM,
360 XVRSPIP,
361 XVRSPIZ,
362 XVRSQRTEDP,
363 XVRSQRTESP,
364 XVSUBDP,
365 XVSUBSP,
366 VCFSX,
367 VCFSX_0,
368 VCFUX,
369 VCFUX_0,
370 VMHRADDSHS,
371 VMLADDUHM,
372 VMSUMMBM,
373 VMSUMSHM,
374 VMSUMSHS,
375 VMSUMUBM,
376 VMSUMUHM,
377 VMSUMUHS,
378 VMULESB,
379 VMULESH,
380 VMULESW,
381 VMULEUB,
382 VMULEUH,
383 VMULEUW,
384 VMULOSB,
385 VMULOSH,
386 VMULOSW,
387 VMULOUB,
388 VMULOUH,
389 VMULOUW,
390 VMULUWM,
391 VSUM2SWS,
392 VSUM4SBS,
393 VSUM4SHS,
394 VSUM4UBS,
395 VSUMSWS
396)>;
397
Stefan Pintilie235fb922018-03-08 16:24:33 +0000398
399// 5 cycle Restricted DP operation. One DP unit, one EXEC pipeline and all three
400// dispatch units for the superslice.
401def : InstRW<[P9_DP_5C, IP_EXEC_1C, DISP_1C, DISP_1C, DISP_1C],
402 (instrs
403 (instregex "MADD(HD|HDU|LD)$"),
404 (instregex "MUL(HD|HW|LD|LI|LI8|LW)(U)?$")
405)>;
406
Stefan Pintilie590eb272017-09-22 20:17:25 +0000407// 7 cycle Restricted DP operation. One DP unit, one EXEC pipeline and all three
408// dispatch units for the superslice.
Ehsan Amiri6c17bb02016-12-19 13:35:45 +0000409def : InstRW<[P9_DP_7C, IP_EXEC_1C, DISP_1C, DISP_1C, DISP_1C],
410 (instrs
Stefan Pintilie590eb272017-09-22 20:17:25 +0000411 FRSP,
Stefan Pintilied45db612018-03-05 14:34:59 +0000412 (instregex "FRI(N|P|Z|M)(D|S)$"),
413 (instregex "FRE(S)?$"),
414 (instregex "FADD(S)?$"),
415 (instregex "FMSUB(S)?$"),
416 (instregex "FMADD(S)?$"),
Stefan Pintilie735817a2018-03-09 21:08:35 +0000417 (instregex "FSUB(S)?$"),
418 (instregex "FCFID(U)?(S)?$"),
419 (instregex "FCTID(U)?(Z)?$"),
420 (instregex "FCTIW(U)?(Z)?$"),
421 (instregex "FRSQRTE(S)?$"),
Stefan Pintilie590eb272017-09-22 20:17:25 +0000422 FNMADDS,
423 FNMADD,
424 FNMSUBS,
425 FNMSUB,
426 FSELD,
427 FSELS,
Stefan Pintilie590eb272017-09-22 20:17:25 +0000428 FMULS,
429 FMUL,
Ehsan Amiri6c17bb02016-12-19 13:35:45 +0000430 XSMADDADP,
431 XSMADDASP,
432 XSMADDMDP,
433 XSMADDMSP,
434 XSMSUBADP,
435 XSMSUBASP,
436 XSMSUBMDP,
437 XSMSUBMSP,
438 XSMULDP,
439 XSMULSP,
440 XSNMADDADP,
441 XSNMADDASP,
442 XSNMADDMDP,
443 XSNMADDMSP,
444 XSNMSUBADP,
445 XSNMSUBASP,
446 XSNMSUBMDP,
447 XSNMSUBMSP
448)>;
449
Stefan Pintiliee894e0f2018-03-01 16:16:08 +0000450// 7 cycle Restricted DP operation and one 3 cycle ALU operation.
Stefan Pintilied45db612018-03-05 14:34:59 +0000451// These operations can be done in parallel.
452// The DP is restricted so we need a full 5 dispatches.
453def : InstRW<[P9_DP_7C, P9_ALU_3C, IP_EXEC_1C, IP_EXEC_1C,
454 DISP_1C, DISP_1C, DISP_1C, DISP_1C, DISP_1C],
455 (instrs
456 (instregex "FSEL(D|S)o$")
457)>;
458
Stefan Pintilie235fb922018-03-08 16:24:33 +0000459// 5 Cycle Restricted DP operation and one 2 cycle ALU operation.
460def : InstRW<[P9_DPOpAndALUOp_7C, IP_EXEC_1C, IP_EXEC_1C,
461 DISP_1C, DISP_1C, DISP_1C, DISP_1C, DISP_1C],
462 (instrs
463 (instregex "MUL(H|L)(D|W)(U)?o$")
464)>;
465
Stefan Pintilied45db612018-03-05 14:34:59 +0000466// 7 cycle Restricted DP operation and one 3 cycle ALU operation.
467// These operations must be done sequentially.
Stefan Pintiliecc330da2017-10-10 13:45:35 +0000468// The DP is restricted so we need a full 5 dispatches.
Stefan Pintiliee894e0f2018-03-01 16:16:08 +0000469def : InstRW<[P9_DPOpAndALU2Op_10C, IP_EXEC_1C, IP_EXEC_1C,
Stefan Pintiliecc330da2017-10-10 13:45:35 +0000470 DISP_1C, DISP_1C, DISP_1C, DISP_1C, DISP_1C],
471 (instrs
Stefan Pintilied45db612018-03-05 14:34:59 +0000472 (instregex "FRI(N|P|Z|M)(D|S)o$"),
473 (instregex "FRE(S)?o$"),
474 (instregex "FADD(S)?o$"),
475 (instregex "FSUB(S)?o$"),
476 (instregex "F(N)?MSUB(S)?o$"),
477 (instregex "F(N)?MADD(S)?o$"),
478 (instregex "FCFID(U)?(S)?o$"),
479 (instregex "FCTID(U)?(Z)?o$"),
480 (instregex "FCTIW(U)?(Z)?o$"),
481 (instregex "FMUL(S)?o$"),
482 (instregex "FRSQRTE(S)?o$"),
483 FRSPo
Stefan Pintiliecc330da2017-10-10 13:45:35 +0000484)>;
485
Stefan Pintilie590eb272017-09-22 20:17:25 +0000486// 7 cycle DP operation. One DP unit, one EXEC pipeline and two dispatch units.
Ehsan Amiri6c17bb02016-12-19 13:35:45 +0000487def : InstRW<[P9_DP_7C, IP_EXEC_1C, DISP_1C, DISP_1C],
488 (instrs
489 XSADDDP,
490 XSADDSP,
491 XSCVDPHP,
492 XSCVDPSP,
493 XSCVDPSXDS,
Stefan Pintilie590eb272017-09-22 20:17:25 +0000494 XSCVDPSXDSs,
Ehsan Amiri6c17bb02016-12-19 13:35:45 +0000495 XSCVDPSXWS,
496 XSCVDPUXDS,
Stefan Pintilie590eb272017-09-22 20:17:25 +0000497 XSCVDPUXDSs,
Ehsan Amiri6c17bb02016-12-19 13:35:45 +0000498 XSCVDPUXWS,
Stefan Pintilie235fb922018-03-08 16:24:33 +0000499 XSCVDPSXWSs,
500 XSCVDPUXWSs,
Ehsan Amiri6c17bb02016-12-19 13:35:45 +0000501 XSCVHPDP,
502 XSCVSPDP,
503 XSCVSXDDP,
504 XSCVSXDSP,
505 XSCVUXDDP,
506 XSCVUXDSP,
507 XSRDPI,
508 XSRDPIC,
509 XSRDPIM,
510 XSRDPIP,
511 XSRDPIZ,
512 XSREDP,
513 XSRESP,
Ehsan Amiri6c17bb02016-12-19 13:35:45 +0000514 XSRSQRTEDP,
515 XSRSQRTESP,
516 XSSUBDP,
517 XSSUBSP,
518 XSCVDPSPN
519)>;
520
Stefan Pintilie590eb272017-09-22 20:17:25 +0000521// Three Cycle PM operation. Only one PM unit per superslice so we use the whole
522// superslice. That includes both exec pipelines (EXECO, EXECE) and all three
523// dispatches.
524def : InstRW<[P9_PM_3C, IP_EXECO_1C, IP_EXECE_1C, DISP_1C, DISP_1C, DISP_1C],
Ehsan Amiri6c17bb02016-12-19 13:35:45 +0000525 (instrs
Stefan Pintilie235fb922018-03-08 16:24:33 +0000526 (instregex "LVS(L|R)$"),
527 (instregex "VSPLTIS(W|H|B)$"),
528 (instregex "VSPLT(W|H|B)(s)?$"),
529 (instregex "V_SETALLONES(B|H)?$"),
530 (instregex "VEXTRACTU(B|H|W)$"),
Stefan Pintilie735817a2018-03-09 21:08:35 +0000531 (instregex "VINSERT(B|H|W|D)$"),
Stefan Pintilie235fb922018-03-08 16:24:33 +0000532 MFVSRLD,
533 MTVSRWS,
Ehsan Amiri6c17bb02016-12-19 13:35:45 +0000534 VBPERMQ,
535 VCLZLSBB,
536 VCTZLSBB,
537 VEXTRACTD,
Ehsan Amiri6c17bb02016-12-19 13:35:45 +0000538 VEXTUBLX,
539 VEXTUBRX,
540 VEXTUHLX,
541 VEXTUHRX,
542 VEXTUWLX,
543 VEXTUWRX,
544 VGBBD,
Ehsan Amiri6c17bb02016-12-19 13:35:45 +0000545 VMRGHB,
546 VMRGHH,
547 VMRGHW,
548 VMRGLB,
549 VMRGLH,
550 VMRGLW,
551 VPERM,
552 VPERMR,
553 VPERMXOR,
554 VPKPX,
555 VPKSDSS,
556 VPKSDUS,
557 VPKSHSS,
558 VPKSHUS,
559 VPKSWSS,
560 VPKSWUS,
561 VPKUDUM,
562 VPKUDUS,
563 VPKUHUM,
564 VPKUHUS,
565 VPKUWUM,
566 VPKUWUS,
567 VPRTYBQ,
568 VSL,
569 VSLDOI,
570 VSLO,
571 VSLV,
Ehsan Amiri6c17bb02016-12-19 13:35:45 +0000572 VSR,
573 VSRO,
574 VSRV,
575 VUPKHPX,
576 VUPKHSB,
577 VUPKHSH,
578 VUPKHSW,
579 VUPKLPX,
580 VUPKLSB,
581 VUPKLSH,
582 VUPKLSW,
583 XXBRD,
584 XXBRH,
585 XXBRQ,
586 XXBRW,
587 XXEXTRACTUW,
588 XXINSERTW,
589 XXMRGHW,
590 XXMRGLW,
591 XXPERM,
592 XXPERMR,
593 XXSLDWI,
594 XXSPLTIB,
595 XXSPLTW,
Stefan Pintilie590eb272017-09-22 20:17:25 +0000596 XXSPLTWs,
597 XXPERMDI,
598 XXPERMDIs,
Ehsan Amiri6c17bb02016-12-19 13:35:45 +0000599 VADDCUQ,
600 VADDECUQ,
601 VADDEUQM,
602 VADDUQM,
603 VMUL10CUQ,
604 VMUL10ECUQ,
605 VMUL10EUQ,
606 VMUL10UQ,
607 VSUBCUQ,
608 VSUBECUQ,
609 VSUBEUQM,
610 VSUBUQM,
611 XSCMPEXPQP,
612 XSCMPOQP,
613 XSCMPUQP,
614 XSTSTDCQP,
Stefan Pintiliee894e0f2018-03-01 16:16:08 +0000615 XSXSIGQP,
616 BCDCFNo,
617 BCDCFZo,
618 BCDCPSGNo,
619 BCDCTNo,
620 BCDCTZo,
621 BCDSETSGNo,
622 BCDSo,
623 BCDTRUNCo,
624 BCDUSo,
625 BCDUTRUNCo
Ehsan Amiri6c17bb02016-12-19 13:35:45 +0000626)>;
627
Stefan Pintilie590eb272017-09-22 20:17:25 +0000628// 12 Cycle DFU operation. Only one DFU unit per CPU so we use a whole
629// superslice. That includes both exec pipelines (EXECO, EXECE) and all three
630// dispatches.
631def : InstRW<[P9_DFU_12C, IP_EXECE_1C, IP_EXECO_1C, DISP_1C, DISP_1C, DISP_1C],
Ehsan Amiri6c17bb02016-12-19 13:35:45 +0000632 (instrs
Stefan Pintiliee894e0f2018-03-01 16:16:08 +0000633 BCDSRo,
Ehsan Amiri6c17bb02016-12-19 13:35:45 +0000634 XSADDQP,
635 XSADDQPO,
636 XSCVDPQP,
637 XSCVQPDP,
638 XSCVQPDPO,
639 XSCVQPSDZ,
640 XSCVQPSWZ,
641 XSCVQPUDZ,
642 XSCVQPUWZ,
643 XSCVSDQP,
644 XSCVUDQP,
645 XSRQPI,
Stefan Pintilie235fb922018-03-08 16:24:33 +0000646 XSRQPIX,
Ehsan Amiri6c17bb02016-12-19 13:35:45 +0000647 XSRQPXP,
648 XSSUBQP,
649 XSSUBQPO
650)>;
651
Stefan Pintiliee894e0f2018-03-01 16:16:08 +0000652// 23 Cycle DFU operation. Only one DFU unit per CPU so we use a whole
653// superslice. That includes both exec pipelines (EXECO, EXECE) and all three
654// dispatches.
655def : InstRW<[P9_DFU_23C, IP_EXECE_1C, IP_EXECO_1C, DISP_1C, DISP_1C, DISP_1C],
656 (instrs
657 BCDCTSQo
658)>;
659
Stefan Pintilie590eb272017-09-22 20:17:25 +0000660// 24 Cycle DFU operation. Only one DFU unit per CPU so we use a whole
661// superslice. That includes both exec pipelines (EXECO, EXECE) and all three
662// dispatches.
663def : InstRW<[P9_DFU_24C, IP_EXECE_1C, IP_EXECO_1C, DISP_1C, DISP_1C, DISP_1C],
Ehsan Amiri6c17bb02016-12-19 13:35:45 +0000664 (instrs
665 XSMADDQP,
666 XSMADDQPO,
667 XSMSUBQP,
668 XSMSUBQPO,
669 XSMULQP,
670 XSMULQPO,
671 XSNMADDQP,
672 XSNMADDQPO,
673 XSNMSUBQP,
674 XSNMSUBQPO
675)>;
676
Stefan Pintiliee894e0f2018-03-01 16:16:08 +0000677// 37 Cycle DFU operation. Only one DFU unit per CPU so we use a whole
678// superslice. That includes both exec pipelines (EXECO, EXECE) and all three
679// dispatches.
680def : InstRW<[P9_DFU_37C, IP_EXECE_1C, IP_EXECO_1C, DISP_1C, DISP_1C, DISP_1C],
681 (instrs
682 BCDCFSQo
683)>;
684
Stefan Pintilie590eb272017-09-22 20:17:25 +0000685// 58 Cycle DFU operation. Only one DFU unit per CPU so we use a whole
686// superslice. That includes both exec pipelines (EXECO, EXECE) and all three
687// dispatches.
688def : InstRW<[P9_DFU_58C, IP_EXECE_1C, IP_EXECO_1C, DISP_1C, DISP_1C, DISP_1C],
Ehsan Amiri6c17bb02016-12-19 13:35:45 +0000689 (instrs
690 XSDIVQP,
691 XSDIVQPO
692)>;
693
Stefan Pintilie590eb272017-09-22 20:17:25 +0000694// 76 Cycle DFU operation. Only one DFU unit per CPU so we use a whole
695// superslice. That includes both exec pipelines (EXECO, EXECE) and all three
696// dispatches.
697def : InstRW<[P9_DFU_76C, IP_EXECE_1C, IP_EXECO_1C, DISP_1C, DISP_1C, DISP_1C],
Ehsan Amiri6c17bb02016-12-19 13:35:45 +0000698 (instrs
699 XSSQRTQP,
700 XSSQRTQPO
701)>;
702
Stefan Pintilie735817a2018-03-09 21:08:35 +0000703// 6 Cycle Load uses a single slice.
Stefan Pintilie235fb922018-03-08 16:24:33 +0000704def : InstRW<[P9_LS_6C, IP_AGEN_1C, DISP_1C, DISP_1C],
705 (instrs
706 (instregex "LXVL(L)?")
707)>;
708
Stefan Pintilie735817a2018-03-09 21:08:35 +0000709// 5 Cycle Load uses a single slice.
Ehsan Amiri6c17bb02016-12-19 13:35:45 +0000710def : InstRW<[P9_LS_5C, IP_AGEN_1C, DISP_1C, DISP_1C],
711 (instrs
Stefan Pintilie235fb922018-03-08 16:24:33 +0000712 (instregex "LVE(B|H|W)X$"),
713 (instregex "LVX(L)?"),
714 (instregex "LXSI(B|H)ZX$"),
Ehsan Amiri6c17bb02016-12-19 13:35:45 +0000715 LXSDX,
Stefan Pintilie235fb922018-03-08 16:24:33 +0000716 LXVB16X,
Ehsan Amiri6c17bb02016-12-19 13:35:45 +0000717 LXVD2X,
Stefan Pintiliee894e0f2018-03-01 16:16:08 +0000718 LXVWSX,
Ehsan Amiri6c17bb02016-12-19 13:35:45 +0000719 LXSIWZX,
720 LXV,
Stefan Pintilie590eb272017-09-22 20:17:25 +0000721 LXVX,
722 LXSD,
Tony Jiang438bf4a2017-11-20 14:38:30 +0000723 DFLOADf64,
Stefan Pintilie626b6512018-02-23 20:37:10 +0000724 XFLOADf64,
725 LIWZX
Ehsan Amiri6c17bb02016-12-19 13:35:45 +0000726)>;
727
Stefan Pintilie735817a2018-03-09 21:08:35 +0000728// 4 Cycle Load uses a single slice.
Stefan Pintilie590eb272017-09-22 20:17:25 +0000729def : InstRW<[P9_LS_4C, IP_AGEN_1C, DISP_1C, DISP_1C],
730 (instrs
Stefan Pintilied45db612018-03-05 14:34:59 +0000731 (instregex "DCB(F|T|ST)(EP)?$"),
732 (instregex "DCBZ(L)?(EP)?$"),
733 (instregex "DCBTST(EP)?$"),
734 (instregex "CP_COPY(8)?$"),
735 (instregex "CP_PASTE(8)?$"),
736 (instregex "ICBI(EP)?$"),
737 (instregex "ICBT(LS)?$"),
738 (instregex "LBARX(L)?$"),
739 (instregex "LBZ(CIX|8|X|X8)?$"),
Stefan Pintilie235fb922018-03-08 16:24:33 +0000740 (instregex "LD(ARX|ARXL|BRX|CIX|X)?$"),
741 (instregex "LH(A|B)RX(L)?(8)?$"),
742 (instregex "LWARX(L)?$"),
743 (instregex "LWBRX(8)?$"),
744 (instregex "LWZ(8|CIX|X|X8)?$"),
Stefan Pintilie735817a2018-03-09 21:08:35 +0000745 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; }