blob: 7b04875e3e3e5e3a238a4940fc822168f35cadcd [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)?$"),
Zaara Syeda6f3df022018-05-28 15:27:58 +0000739 (instregex "LBZ(CIX|8|X|X8|XTLS|XTLS_32)?(_)?$"),
740 (instregex "LD(ARX|ARXL|BRX|CIX|X|XTLS)?(_)?$"),
Stefan Pintilie235fb922018-03-08 16:24:33 +0000741 (instregex "LH(A|B)RX(L)?(8)?$"),
Zaara Syeda6f3df022018-05-28 15:27:58 +0000742 (instregex "LHZ(8|CIX|X|X8|XTLS|XTLS_32)?(_)?$"),
Stefan Pintilie235fb922018-03-08 16:24:33 +0000743 (instregex "LWARX(L)?$"),
744 (instregex "LWBRX(8)?$"),
Zaara Syeda6f3df022018-05-28 15:27:58 +0000745 (instregex "LWZ(8|CIX|X|X8|XTLS|XTLS_32)?(_)?$"),
Stefan Pintilie735817a2018-03-09 21:08:35 +0000746 CP_ABORT,
747 DARN,
748 EnforceIEIO,
749 ISYNC,
750 MSGSYNC,
751 TLBSYNC,
752 SYNC,
Stefan Pintilie235fb922018-03-08 16:24:33 +0000753 LMW,
754 LSWI
Stefan Pintilie590eb272017-09-22 20:17:25 +0000755)>;
756
757// 4 Cycle Restricted load uses a single slice but the dispatch for the whole
758// superslice.
759def : InstRW<[P9_LS_4C, IP_AGEN_1C, DISP_1C, DISP_1C, DISP_1C],
Ehsan Amiri6c17bb02016-12-19 13:35:45 +0000760 (instrs
761 LFIWZX,
762 LFDX,
763 LFD
764)>;
765
Stefan Pintilie735817a2018-03-09 21:08:35 +0000766// Cracked Load Instructions.
767// Load instructions that can be done in parallel.
Stefan Pintilie235fb922018-03-08 16:24:33 +0000768def : InstRW<[P9_LS_4C, P9_LS_4C, IP_AGEN_1C, IP_AGEN_1C,
769 DISP_1C, DISP_1C, DISP_1C, DISP_1C],
770 (instrs
771 SLBIA,
772 SLBIE,
773 SLBMFEE,
774 SLBMFEV,
775 SLBMTE,
776 TLBIEL
777)>;
778
Stefan Pintilie735817a2018-03-09 21:08:35 +0000779// Cracked Load Instruction.
Stefan Pintilie235fb922018-03-08 16:24:33 +0000780// Requires Load and ALU pieces totaling 6 cycles. The Load and ALU
781// operations can be run in parallel.
782def : InstRW<[P9_LS_4C, P9_ALU_2C, IP_EXEC_1C, IP_AGEN_1C,
783 DISP_1C, DISP_1C, DISP_1C, DISP_1C],
784 (instrs
785 (instregex "L(W|H)ZU(X)?(8)?$"),
786 TEND
787)>;
788
Stefan Pintilie735817a2018-03-09 21:08:35 +0000789// Cracked Store Instruction
790// Consecutive Store and ALU instructions. The store is restricted and requires
791// three dispatches.
Stefan Pintilie235fb922018-03-08 16:24:33 +0000792def : InstRW<[P9_StoreAndALUOp_3C, IP_EXEC_1C, IP_EXEC_1C, IP_AGEN_1C,
793 DISP_1C, DISP_1C, DISP_1C, DISP_1C, DISP_1C],
794 (instrs
795 (instregex "ST(B|H|W|D)CX$")
796)>;
797
Stefan Pintilie735817a2018-03-09 21:08:35 +0000798// Cracked Load Instruction.
799// Two consecutive load operations for a total of 8 cycles.
800def : InstRW<[P9_LoadAndLoadOp_8C, IP_AGEN_1C, IP_AGEN_1C,
801 DISP_1C, DISP_1C, DISP_1C, DISP_1C],
802 (instrs
803 LDMX
804)>;
805
Stefan Pintilied45db612018-03-05 14:34:59 +0000806// Cracked Load instruction.
807// Requires consecutive Load and ALU pieces totaling 6 cycles. The Load and ALU
808// operations cannot be done at the same time and so their latencies are added.
809def : InstRW<[P9_LoadAndALUOp_6C, IP_EXEC_1C, IP_AGEN_1C,
810 DISP_1C, DISP_1C, DISP_1C, DISP_1C],
811 (instrs
Stefan Pintilie235fb922018-03-08 16:24:33 +0000812 (instregex "LHA(X)?(8)?$"),
813 (instregex "CP_PASTE(8)?o$"),
814 (instregex "LWA(X)?(_32)?$"),
815 TCHECK
Stefan Pintilied45db612018-03-05 14:34:59 +0000816)>;
817
Stefan Pintilie590eb272017-09-22 20:17:25 +0000818// Cracked Restricted Load instruction.
819// Requires consecutive Load and ALU pieces totaling 6 cycles. The Load and ALU
820// operations cannot be done at the same time and so their latencies are added.
821// Full 6 dispatches are required as this is both cracked and restricted.
822def : InstRW<[P9_LoadAndALUOp_6C, IP_EXEC_1C, IP_AGEN_1C,
Ehsan Amiri6c17bb02016-12-19 13:35:45 +0000823 DISP_1C, DISP_1C, DISP_1C, DISP_1C, DISP_1C, DISP_1C],
824 (instrs
Stefan Pintiliee894e0f2018-03-01 16:16:08 +0000825 LFIWAX
Ehsan Amiri6c17bb02016-12-19 13:35:45 +0000826)>;
827
Stefan Pintilie590eb272017-09-22 20:17:25 +0000828// Cracked Load instruction.
829// Requires consecutive Load and ALU pieces totaling 7 cycles. The Load and ALU
830// operations cannot be done at the same time and so their latencies are added.
831// Full 4 dispatches are required as this is a cracked instruction.
832def : InstRW<[P9_LoadAndALUOp_7C, IP_AGEN_1C, IP_EXEC_1C,
833 DISP_1C, DISP_1C, DISP_1C, DISP_1C],
834 (instrs
Stefan Pintilie590eb272017-09-22 20:17:25 +0000835 LXSIWAX,
Stefan Pintilie626b6512018-02-23 20:37:10 +0000836 LIWAX
Stefan Pintilie590eb272017-09-22 20:17:25 +0000837)>;
838
Stefan Pintiliee894e0f2018-03-01 16:16:08 +0000839// Cracked Load instruction.
840// Requires consecutive Load (4 cycles) and ALU (3 cycles) pieces totaling 7
841// cycles. The Load and ALU operations cannot be done at the same time and so
842// their latencies are added.
843// Full 6 dispatches are required as this is a restricted instruction.
844def : InstRW<[P9_LoadAndALU2Op_7C, IP_AGEN_1C, IP_EXEC_1C,
845 DISP_1C, DISP_1C, DISP_1C, DISP_1C, DISP_1C, DISP_1C],
846 (instrs
847 LFSX,
848 LFS
849)>;
850
851// Cracked Load instruction.
852// Requires consecutive Load and ALU pieces totaling 8 cycles. The Load and ALU
853// operations cannot be done at the same time and so their latencies are added.
854// Full 4 dispatches are required as this is a cracked instruction.
855def : InstRW<[P9_LoadAndALU2Op_8C, IP_AGEN_1C, IP_EXEC_1C,
856 DISP_1C, DISP_1C, DISP_1C, DISP_1C],
857 (instrs
858 LXSSP,
859 LXSSPX,
860 XFLOADf32,
861 DFLOADf32
862)>;
863
Stefan Pintilie235fb922018-03-08 16:24:33 +0000864// Cracked 3-Way Load Instruction
865// Load with two ALU operations that depend on each other
866def : InstRW<[P9_LoadAndALUOp_6C, P9_ALU_2C, IP_AGEN_1C, IP_EXEC_1C, IP_EXEC_1C,
867 DISP_1C, DISP_1C, DISP_1C, DISP_1C, DISP_1C, DISP_1C],
868 (instrs
869 (instregex "LHAU(X)?(8)?$"),
870 LWAUX
871)>;
872
Stefan Pintilie590eb272017-09-22 20:17:25 +0000873// Cracked Load that requires the PM resource.
874// Since the Load and the PM cannot be done at the same time the latencies are
875// added. Requires 8 cycles.
876// Since the PM requires the full superslice we need both EXECE, EXECO pipelines
877// as well as 3 dispatches for the PM. The Load requires the remaining 2
878// dispatches.
879def : InstRW<[P9_LoadAndPMOp_8C, IP_AGEN_1C, IP_EXECE_1C, IP_EXECO_1C,
880 DISP_1C, DISP_1C, DISP_1C, DISP_1C, DISP_1C],
Ehsan Amiri6c17bb02016-12-19 13:35:45 +0000881 (instrs
Stefan Pintilie235fb922018-03-08 16:24:33 +0000882 LXVH8X,
Ehsan Amiri6c17bb02016-12-19 13:35:45 +0000883 LXVDSX,
884 LXVW4X
885)>;
886
Stefan Pintilie590eb272017-09-22 20:17:25 +0000887// Single slice Restricted store operation. The restricted operation requires
888// all three dispatches for the superslice.
Ehsan Amiri6c17bb02016-12-19 13:35:45 +0000889def : InstRW<[P9_LS_1C, IP_EXEC_1C, IP_AGEN_1C, DISP_1C, DISP_1C, DISP_1C],
890 (instrs
Stefan Pintilie626b6512018-02-23 20:37:10 +0000891 (instregex "STF(S|D|IWX|SX|DX)$"),
Stefan Pintilie235fb922018-03-08 16:24:33 +0000892 (instregex "STXS(D|DX|SPX|IWX|IBX|IHX|SP)(v)?$"),
893 (instregex "STW(8)?$"),
Stefan Pintilie735817a2018-03-09 21:08:35 +0000894 (instregex "(D|X)FSTORE(f32|f64)$"),
895 (instregex "ST(W|H|D)BRX$"),
896 (instregex "ST(B|H|D)(8)?$"),
Zaara Syeda6f3df022018-05-28 15:27:58 +0000897 (instregex "ST(B|W|H|D)(CI)?X(TLS|TLS_32)?(8)?(_)?$"),
Stefan Pintilie235fb922018-03-08 16:24:33 +0000898 STIWX,
899 SLBIEG,
900 STMW,
901 STSWI,
Stefan Pintilie735817a2018-03-09 21:08:35 +0000902 TLBIE
Ehsan Amiri6c17bb02016-12-19 13:35:45 +0000903)>;
904
Stefan Pintilie735817a2018-03-09 21:08:35 +0000905// Vector Store Instruction
906// Requires the whole superslice and therefore requires all three dispatches
907// as well as both the Even and Odd exec pipelines.
Stefan Pintilie590eb272017-09-22 20:17:25 +0000908def : InstRW<[P9_LS_1C, IP_EXECE_1C, IP_EXECO_1C, IP_AGEN_1C,
909 DISP_1C, DISP_1C, DISP_1C],
Ehsan Amiri6c17bb02016-12-19 13:35:45 +0000910 (instrs
Stefan Pintilie235fb922018-03-08 16:24:33 +0000911 (instregex "STVE(B|H|W)X$"),
912 (instregex "STVX(L)?$"),
913 (instregex "STXV(B16X|H8X|W4X|D2X|L|LL|X)?$")
Ehsan Amiri6c17bb02016-12-19 13:35:45 +0000914)>;
915
Stefan Pintilie235fb922018-03-08 16:24:33 +0000916// 5 Cycle DIV operation. Only one DIV unit per superslice so we use the whole
917// superslice. That includes both exec pipelines (EXECO, EXECE) and all three
918// dispatches.
919def : InstRW<[P9_DIV_5C, IP_EXECE_1C, IP_EXECO_1C, DISP_1C, DISP_1C, DISP_1C],
Stefan Pintilie626b6512018-02-23 20:37:10 +0000920 (instrs
Stefan Pintilie235fb922018-03-08 16:24:33 +0000921 (instregex "MTCTR(8)?(loop)?$"),
922 (instregex "MTLR(8)?$")
Stefan Pintilie626b6512018-02-23 20:37:10 +0000923)>;
924
925// 12 Cycle DIV operation. Only one DIV unit per superslice so we use the whole
926// superslice. That includes both exec pipelines (EXECO, EXECE) and all three
927// dispatches.
928def : InstRW<[P9_DIV_12C, IP_EXECE_1C, IP_EXECO_1C, DISP_1C, DISP_1C, DISP_1C],
929 (instrs
Stefan Pintiliee894e0f2018-03-01 16:16:08 +0000930 (instregex "M(T|F)VRSAVE(v)?$"),
Stefan Pintilie235fb922018-03-08 16:24:33 +0000931 (instregex "M(T|F)PMR$"),
932 (instregex "M(T|F)TB(8)?$"),
Stefan Pintiliee894e0f2018-03-01 16:16:08 +0000933 (instregex "MF(SPR|CTR|LR)(8)?$"),
Stefan Pintilie235fb922018-03-08 16:24:33 +0000934 (instregex "M(T|F)MSR(D)?$"),
935 (instregex "MTSPR(8)?$")
Stefan Pintilie626b6512018-02-23 20:37:10 +0000936)>;
Ehsan Amiri6c17bb02016-12-19 13:35:45 +0000937
Stefan Pintilie590eb272017-09-22 20:17:25 +0000938// 16 Cycle DIV operation. Only one DIV unit per superslice so we use the whole
939// superslice. That includes both exec pipelines (EXECO, EXECE) and all three
940// dispatches.
941def : InstRW<[P9_DIV_16C_8, IP_EXECO_1C, IP_EXECE_1C,
942 DISP_1C, DISP_1C, DISP_1C],
Ehsan Amiri6c17bb02016-12-19 13:35:45 +0000943 (instrs
944 DIVW,
Stefan Pintilie590eb272017-09-22 20:17:25 +0000945 DIVWU,
946 MODSW
Ehsan Amiri6c17bb02016-12-19 13:35:45 +0000947)>;
948
Stefan Pintilie590eb272017-09-22 20:17:25 +0000949// 24 Cycle DIV operation. Only one DIV unit per superslice so we use the whole
950// superslice. That includes both exec pipelines (EXECO, EXECE) and all three
951// dispatches.
952def : InstRW<[P9_DIV_24C_8, IP_EXECO_1C, IP_EXECE_1C,
953 DISP_1C, DISP_1C, DISP_1C],
Ehsan Amiri6c17bb02016-12-19 13:35:45 +0000954 (instrs
955 DIVWE,
956 DIVD,
957 DIVWEU,
Stefan Pintilie590eb272017-09-22 20:17:25 +0000958 DIVDU,
959 MODSD,
960 MODUD,
961 MODUW
Ehsan Amiri6c17bb02016-12-19 13:35:45 +0000962)>;
963
Stefan Pintilie590eb272017-09-22 20:17:25 +0000964// 40 Cycle DIV operation. Only one DIV unit per superslice so we use the whole
965// superslice. That includes both exec pipelines (EXECO, EXECE) and all three
966// dispatches.
967def : InstRW<[P9_DIV_40C_8, IP_EXECO_1C, IP_EXECE_1C,
968 DISP_1C, DISP_1C, DISP_1C],
Ehsan Amiri6c17bb02016-12-19 13:35:45 +0000969 (instrs
970 DIVDE,
971 DIVDEU
972)>;
973
Stefan Pintilie590eb272017-09-22 20:17:25 +0000974// Cracked DIV and ALU operation. Requires one full slice for the ALU operation
975// and one full superslice for the DIV operation since there is only one DIV
976// per superslice. Latency of DIV plus ALU is 26.
Stefan Pintilied45db612018-03-05 14:34:59 +0000977def : InstRW<[P9_IntDivAndALUOp_18C_8, IP_EXECE_1C, IP_EXECO_1C, IP_EXEC_1C,
978 DISP_1C, DISP_1C, DISP_1C, DISP_1C, DISP_1C],
979 (instrs
980 (instregex "DIVW(U)?(O)?o$")
981)>;
982
983// Cracked DIV and ALU operation. Requires one full slice for the ALU operation
984// and one full superslice for the DIV operation since there is only one DIV
985// per superslice. Latency of DIV plus ALU is 26.
Stefan Pintilie590eb272017-09-22 20:17:25 +0000986def : InstRW<[P9_IntDivAndALUOp_26C_8, IP_EXECE_1C, IP_EXECO_1C, IP_EXEC_1C,
987 DISP_1C, DISP_1C, DISP_1C, DISP_1C, DISP_1C],
Ehsan Amiri6c17bb02016-12-19 13:35:45 +0000988 (instrs
Stefan Pintiliecc330da2017-10-10 13:45:35 +0000989 DIVDo,
990 DIVDUo,
Ehsan Amiri6c17bb02016-12-19 13:35:45 +0000991 DIVWEo,
992 DIVWEUo
993)>;
994
Stefan Pintilie590eb272017-09-22 20:17:25 +0000995// Cracked DIV and ALU operation. Requires one full slice for the ALU operation
996// and one full superslice for the DIV operation since there is only one DIV
997// per superslice. Latency of DIV plus ALU is 42.
998def : InstRW<[P9_IntDivAndALUOp_42C_8, IP_EXECE_1C, IP_EXECO_1C, IP_EXEC_1C,
999 DISP_1C, DISP_1C, DISP_1C, DISP_1C, DISP_1C],
Ehsan Amiri6c17bb02016-12-19 13:35:45 +00001000 (instrs
1001 DIVDEo,
1002 DIVDEUo
1003)>;
1004
Ehsan Amiri6c17bb02016-12-19 13:35:45 +00001005// CR access instructions in _BrMCR, IIC_BrMCRX.
1006
Stefan Pintilie590eb272017-09-22 20:17:25 +00001007// Cracked, restricted, ALU operations.
1008// Here the two ALU ops can actually be done in parallel and therefore the
1009// latencies are not added together. Otherwise this is like having two
1010// instructions running together on two pipelines and 6 dispatches.
1011// ALU ops are 2 cycles each.
Ehsan Amiri6c17bb02016-12-19 13:35:45 +00001012def : InstRW<[P9_ALU_2C, P9_ALU_2C, IP_EXEC_1C, IP_EXEC_1C,
1013 DISP_1C, DISP_1C, DISP_1C, DISP_1C, DISP_1C, DISP_1C],
1014 (instrs
Ehsan Amiri6c17bb02016-12-19 13:35:45 +00001015 MTCRF,
1016 MTCRF8
1017)>;
1018
Stefan Pintiliee894e0f2018-03-01 16:16:08 +00001019// Cracked ALU operations.
1020// Here the two ALU ops can actually be done in parallel and therefore the
1021// latencies are not added together. Otherwise this is like having two
1022// instructions running together on two pipelines and 4 dispatches.
1023// ALU ops are 2 cycles each.
1024def : InstRW<[P9_ALU_2C, P9_ALU_2C, IP_EXEC_1C, IP_EXEC_1C,
1025 DISP_1C, DISP_1C, DISP_1C, DISP_1C],
1026 (instrs
Stefan Pintilie235fb922018-03-08 16:24:33 +00001027 (instregex "ADDC(8)?o$"),
1028 (instregex "SUBFC(8)?o$")
Stefan Pintiliee894e0f2018-03-01 16:16:08 +00001029)>;
1030
Stefan Pintilied45db612018-03-05 14:34:59 +00001031// Cracked ALU operations.
1032// Two ALU ops can be done in parallel.
1033// One is three cycle ALU the ohter is a two cycle ALU.
1034// One of the ALU ops is restricted the other is not so we have a total of
1035// 5 dispatches.
1036def : InstRW<[P9_ALU_2C, P9_ALU_3C, IP_EXEC_1C, IP_EXEC_1C,
1037 DISP_1C, DISP_1C, DISP_1C, DISP_1C, DISP_1C],
1038 (instrs
1039 (instregex "F(N)?ABS(D|S)o$"),
1040 (instregex "FCPSGN(D|S)o$"),
1041 (instregex "FNEG(D|S)o$"),
1042 FMRo
1043)>;
1044
1045// Cracked ALU operations.
Stefan Pintilie590eb272017-09-22 20:17:25 +00001046// Here the two ALU ops can actually be done in parallel and therefore the
1047// latencies are not added together. Otherwise this is like having two
Stefan Pintilied45db612018-03-05 14:34:59 +00001048// instructions running together on two pipelines and 4 dispatches.
Stefan Pintilie590eb272017-09-22 20:17:25 +00001049// ALU ops are 3 cycles each.
1050def : InstRW<[P9_ALU_3C, P9_ALU_3C, IP_EXEC_1C, IP_EXEC_1C,
Ehsan Amiri6c17bb02016-12-19 13:35:45 +00001051 DISP_1C, DISP_1C, DISP_1C, DISP_1C],
1052 (instrs
1053 MCRFS
1054)>;
1055
Stefan Pintilie235fb922018-03-08 16:24:33 +00001056// Cracked Restricted ALU operations.
1057// Here the two ALU ops can actually be done in parallel and therefore the
1058// latencies are not added together. Otherwise this is like having two
1059// instructions running together on two pipelines and 6 dispatches.
1060// ALU ops are 3 cycles each.
1061def : InstRW<[P9_ALU_3C, P9_ALU_3C, IP_EXEC_1C, IP_EXEC_1C,
1062 DISP_1C, DISP_1C, DISP_1C, DISP_1C, DISP_1C, DISP_1C],
1063 (instrs
1064 (instregex "MTFSF(b|o)?$"),
1065 (instregex "MTFSFI(o)?$")
1066)>;
1067
Stefan Pintilieb5a94402018-03-02 14:41:38 +00001068// Cracked instruction made of two ALU ops.
1069// The two ops cannot be done in parallel.
Stefan Pintilie235fb922018-03-08 16:24:33 +00001070// One of the ALU ops is restricted and takes 3 dispatches.
Stefan Pintilie626b6512018-02-23 20:37:10 +00001071def : InstRW<[P9_ALUOpAndALUOp_4C, IP_EXEC_1C, IP_EXEC_1C,
1072 DISP_1C, DISP_1C, DISP_1C, DISP_1C, DISP_1C],
1073 (instrs
Stefan Pintilie235fb922018-03-08 16:24:33 +00001074 (instregex "RLD(I)?C(R|L)o$"),
1075 (instregex "RLW(IMI|INM|NM)(8)?o$"),
1076 (instregex "SLW(8)?o$"),
1077 (instregex "SRAW(I)?o$"),
1078 (instregex "SRW(8)?o$"),
1079 RLDICL_32o,
1080 RLDIMIo
1081)>;
1082
1083// Cracked instruction made of two ALU ops.
1084// The two ops cannot be done in parallel.
1085// Both of the ALU ops are restricted and take 3 dispatches.
1086def : InstRW<[P9_ALU2OpAndALU2Op_6C, IP_EXEC_1C, IP_EXEC_1C,
1087 DISP_1C, DISP_1C, DISP_1C, DISP_1C, DISP_1C, DISP_1C],
1088 (instrs
1089 (instregex "MFFS(L|CE|o)?$")
1090)>;
1091
Stefan Pintilie735817a2018-03-09 21:08:35 +00001092// Cracked ALU instruction composed of three consecutive 2 cycle loads for a
1093// total of 6 cycles. All of the ALU operations are also restricted so each
1094// takes 3 dispatches for a total of 9.
Stefan Pintilie235fb922018-03-08 16:24:33 +00001095def : InstRW<[P9_ALUOpAndALUOpAndALUOp_6C, IP_EXEC_1C, IP_EXEC_1C, IP_EXEC_1C,
1096 DISP_1C, DISP_1C, DISP_1C, DISP_1C, DISP_1C, DISP_1C, DISP_1C,
1097 DISP_1C, DISP_1C],
1098 (instrs
1099 (instregex "MFCR(8)?$")
Stefan Pintilie626b6512018-02-23 20:37:10 +00001100)>;
1101
Stefan Pintilieb5a94402018-03-02 14:41:38 +00001102// Cracked instruction made of two ALU ops.
1103// The two ops cannot be done in parallel.
1104def : InstRW<[P9_ALUOpAndALUOp_4C, IP_EXEC_1C, IP_EXEC_1C,
1105 DISP_1C, DISP_1C, DISP_1C, DISP_1C],
1106 (instrs
Stefan Pintilie235fb922018-03-08 16:24:33 +00001107 (instregex "EXTSWSLIo$"),
1108 (instregex "SRAD(I)?o$"),
1109 SLDo,
1110 SRDo,
1111 RLDICo
Stefan Pintilieb5a94402018-03-02 14:41:38 +00001112)>;
1113
Stefan Pintilie590eb272017-09-22 20:17:25 +00001114// 33 Cycle DP Instruction Restricted. Takes one slice and 3 dispatches.
Ehsan Amiri6c17bb02016-12-19 13:35:45 +00001115def : InstRW<[P9_DP_33C_8, IP_EXEC_1C, DISP_1C, DISP_1C, DISP_1C],
1116 (instrs
Stefan Pintilie590eb272017-09-22 20:17:25 +00001117 FDIV
1118)>;
1119
Stefan Pintilied45db612018-03-05 14:34:59 +00001120// 33 Cycle DP Instruction Restricted and Cracked with 3 Cycle ALU.
Stefan Pintiliee894e0f2018-03-01 16:16:08 +00001121def : InstRW<[P9_DPOpAndALU2Op_36C_8, IP_EXEC_1C, IP_EXEC_1C,
Stefan Pintiliecc330da2017-10-10 13:45:35 +00001122 DISP_1C, DISP_1C, DISP_1C, DISP_1C, DISP_1C],
1123 (instrs
1124 FDIVo
1125)>;
1126
Stefan Pintilie235fb922018-03-08 16:24:33 +00001127// 36 Cycle DP Instruction.
Stefan Pintilie735817a2018-03-09 21:08:35 +00001128// Instruction can be done on a single slice.
Stefan Pintilie235fb922018-03-08 16:24:33 +00001129def : InstRW<[P9_DP_36C_10, IP_EXEC_1C, DISP_1C, DISP_1C],
1130 (instrs
1131 XSSQRTDP
1132)>;
1133
Stefan Pintilied45db612018-03-05 14:34:59 +00001134// 36 Cycle DP Instruction Restricted. Takes one slice and 3 dispatches.
1135def : InstRW<[P9_DP_36C_10, IP_EXEC_1C, DISP_1C, DISP_1C, DISP_1C],
1136 (instrs
1137 FSQRT
1138)>;
1139
Stefan Pintilie235fb922018-03-08 16:24:33 +00001140// 36 Cycle DP Vector Instruction.
1141def : InstRW<[P9_DPE_36C_10, P9_DPO_36C_10, IP_EXECE_1C, IP_EXECO_1C,
1142 DISP_1C, DISP_1C, DISP_1C],
1143 (instrs
1144 XVSQRTDP
1145)>;
1146
1147// 27 Cycle DP Vector Instruction.
1148def : InstRW<[P9_DPE_27C_10, P9_DPO_27C_10, IP_EXECE_1C, IP_EXECO_1C,
1149 DISP_1C, DISP_1C, DISP_1C],
1150 (instrs
1151 XVSQRTSP
1152)>;
1153
Stefan Pintilied45db612018-03-05 14:34:59 +00001154// 36 Cycle DP Instruction Restricted and Cracked with 3 Cycle ALU.
1155def : InstRW<[P9_DPOpAndALU2Op_39C_10, IP_EXEC_1C, IP_EXEC_1C,
1156 DISP_1C, DISP_1C, DISP_1C, DISP_1C, DISP_1C],
1157 (instrs
1158 FSQRTo
1159)>;
1160
Stefan Pintilie235fb922018-03-08 16:24:33 +00001161// 26 Cycle DP Instruction.
1162def : InstRW<[P9_DP_26C_5, IP_EXEC_1C, DISP_1C, DISP_1C],
1163 (instrs
1164 XSSQRTSP
1165)>;
1166
Stefan Pintilied45db612018-03-05 14:34:59 +00001167// 26 Cycle DP Instruction Restricted. Takes one slice and 3 dispatches.
1168def : InstRW<[P9_DP_26C_5, IP_EXEC_1C, DISP_1C, DISP_1C, DISP_1C],
1169 (instrs
1170 FSQRTS
1171)>;
1172
1173// 26 Cycle DP Instruction Restricted and Cracked with 3 Cycle ALU.
1174def : InstRW<[P9_DPOpAndALU2Op_29C_5, IP_EXEC_1C, IP_EXEC_1C,
1175 DISP_1C, DISP_1C, DISP_1C, DISP_1C, DISP_1C],
1176 (instrs
1177 FSQRTSo
1178)>;
1179
Stefan Pintilie590eb272017-09-22 20:17:25 +00001180// 33 Cycle DP Instruction. Takes one slice and 2 dispatches.
1181def : InstRW<[P9_DP_33C_8, IP_EXEC_1C, DISP_1C, DISP_1C],
1182 (instrs
Ehsan Amiri6c17bb02016-12-19 13:35:45 +00001183 XSDIVDP
1184)>;
1185
Stefan Pintilie590eb272017-09-22 20:17:25 +00001186// 22 Cycle DP Instruction Restricted. Takes one slice and 3 dispatches.
Ehsan Amiri6c17bb02016-12-19 13:35:45 +00001187def : InstRW<[P9_DP_22C_5, IP_EXEC_1C, DISP_1C, DISP_1C, DISP_1C],
1188 (instrs
Stefan Pintilie590eb272017-09-22 20:17:25 +00001189 FDIVS
1190)>;
1191
Stefan Pintiliecc330da2017-10-10 13:45:35 +00001192// 22 Cycle DP Instruction Restricted and Cracked with 2 Cycle ALU.
Stefan Pintiliee894e0f2018-03-01 16:16:08 +00001193def : InstRW<[P9_DPOpAndALU2Op_25C_5, IP_EXEC_1C, IP_EXEC_1C,
Stefan Pintiliecc330da2017-10-10 13:45:35 +00001194 DISP_1C, DISP_1C, DISP_1C, DISP_1C, DISP_1C],
1195 (instrs
1196 FDIVSo
1197)>;
1198
Stefan Pintilie590eb272017-09-22 20:17:25 +00001199// 22 Cycle DP Instruction. Takes one slice and 2 dispatches.
1200def : InstRW<[P9_DP_22C_5, IP_EXEC_1C, DISP_1C, DISP_1C],
1201 (instrs
Ehsan Amiri6c17bb02016-12-19 13:35:45 +00001202 XSDIVSP
1203)>;
1204
Stefan Pintilie590eb272017-09-22 20:17:25 +00001205// 24 Cycle DP Vector Instruction. Takes one full superslice.
1206// Includes both EXECE, EXECO pipelines and all 3 dispatches for the given
1207// superslice.
1208def : InstRW<[P9_DPE_24C_8, P9_DPO_24C_8, IP_EXECE_1C, IP_EXECO_1C,
1209 DISP_1C, DISP_1C, DISP_1C],
Ehsan Amiri6c17bb02016-12-19 13:35:45 +00001210 (instrs
1211 XVDIVSP
1212)>;
1213
Stefan Pintilie590eb272017-09-22 20:17:25 +00001214// 33 Cycle DP Vector Instruction. Takes one full superslice.
1215// Includes both EXECE, EXECO pipelines and all 3 dispatches for the given
1216// superslice.
1217def : InstRW<[P9_DPE_33C_8, P9_DPO_33C_8, IP_EXECE_1C, IP_EXECO_1C,
1218 DISP_1C, DISP_1C, DISP_1C],
Ehsan Amiri6c17bb02016-12-19 13:35:45 +00001219 (instrs
1220 XVDIVDP
1221)>;
1222
Stefan Pintilie590eb272017-09-22 20:17:25 +00001223// Instruction cracked into three pieces. One Load and two ALU operations.
1224// The Load and one of the ALU ops cannot be run at the same time and so the
1225// latencies are added together for 6 cycles. The remainaing ALU is 2 cycles.
1226// Both the load and the ALU that depends on it are restricted and so they take
1227// a total of 6 dispatches. The final 2 dispatches come from the second ALU op.
1228// The two EXEC pipelines are for the 2 ALUs while the AGEN is for the load.
Stefan Pintiliee894e0f2018-03-01 16:16:08 +00001229def : InstRW<[P9_LoadAndALU2Op_7C, P9_ALU_2C,
Ehsan Amiri6c17bb02016-12-19 13:35:45 +00001230 IP_AGEN_1C, IP_EXEC_1C, IP_EXEC_1C,
1231 DISP_1C, DISP_1C, DISP_1C, DISP_1C,
1232 DISP_1C, DISP_1C, DISP_1C, DISP_1C],
1233 (instrs
Stefan Pintilie626b6512018-02-23 20:37:10 +00001234 (instregex "LF(SU|SUX)$")
1235)>;
1236
1237// Cracked instruction made up of a Store and an ALU. The ALU does not depend on
1238// the store and so it can be run at the same time as the store. The store is
1239// also restricted.
1240def : InstRW<[P9_LS_1C, P9_ALU_2C, IP_AGEN_1C, IP_EXEC_1C, IP_EXEC_1C,
1241 DISP_1C, DISP_1C, DISP_1C, DISP_1C, DISP_1C],
1242 (instrs
Stefan Pintilie235fb922018-03-08 16:24:33 +00001243 (instregex "STF(S|D)U(X)?$"),
1244 (instregex "ST(B|H|W|D)U(X)?(8)?$")
Ehsan Amiri6c17bb02016-12-19 13:35:45 +00001245)>;
1246
Stefan Pintilie590eb272017-09-22 20:17:25 +00001247// Cracked instruction made up of a Load and an ALU. The ALU does not depend on
Stefan Pintilied45db612018-03-05 14:34:59 +00001248// the load and so it can be run at the same time as the load.
1249def : InstRW<[P9_LS_4C, P9_ALU_2C, IP_AGEN_1C, IP_EXEC_1C,
1250 DISP_1C, DISP_1C, DISP_1C, DISP_1C],
1251 (instrs
1252 (instregex "LBZU(X)?(8)?$"),
1253 (instregex "LDU(X)?$")
1254)>;
1255
1256
1257// Cracked instruction made up of a Load and an ALU. The ALU does not depend on
Stefan Pintilie590eb272017-09-22 20:17:25 +00001258// the load and so it can be run at the same time as the load. The load is also
1259// restricted. 3 dispatches are from the restricted load while the other two
1260// are from the ALU. The AGEN pipeline is from the load and the EXEC pipeline
1261// is required for the ALU.
1262def : InstRW<[P9_LS_4C, P9_ALU_2C, IP_AGEN_1C, IP_EXEC_1C,
Ehsan Amiri6c17bb02016-12-19 13:35:45 +00001263 DISP_1C, DISP_1C, DISP_1C, DISP_1C, DISP_1C],
1264 (instrs
Stefan Pintilie626b6512018-02-23 20:37:10 +00001265 (instregex "LF(DU|DUX)$")
Ehsan Amiri6c17bb02016-12-19 13:35:45 +00001266)>;
1267
Stefan Pintilie590eb272017-09-22 20:17:25 +00001268// Crypto Instructions
1269
1270// 6 Cycle CY operation. Only one CY unit per CPU so we use a whole
1271// superslice. That includes both exec pipelines (EXECO, EXECE) and all three
1272// dispatches.
1273def : InstRW<[P9_CY_6C, IP_EXECO_1C, IP_EXECE_1C, DISP_1C, DISP_1C, DISP_1C],
1274 (instrs
Stefan Pintiliee894e0f2018-03-01 16:16:08 +00001275 (instregex "VPMSUM(B|H|W|D)$"),
1276 (instregex "V(N)?CIPHER(LAST)?$"),
1277 VSBOX
Stefan Pintilie590eb272017-09-22 20:17:25 +00001278)>;
Stefan Pintilie626b6512018-02-23 20:37:10 +00001279
Stefan Pintiliee894e0f2018-03-01 16:16:08 +00001280// Branch Instructions
1281
1282// Two Cycle Branch
1283def : InstRW<[P9_BR_2C, DISP_1C, DISP_1C],
1284 (instrs
1285 (instregex "BCCCTR(L)?(8)?$"),
1286 (instregex "BCCL(A|R|RL)?$"),
1287 (instregex "BCCTR(L)?(8)?(n)?$"),
1288 (instregex "BD(N)?Z(8|A|Am|Ap|m|p)?$"),
1289 (instregex "BD(N)?ZL(A|Am|Ap|R|R8|RL|RLm|RLp|Rm|Rp|m|p)?$"),
1290 (instregex "BL(_TLS)?$"),
1291 (instregex "BL8(_TLS|_NOP|_NOP_TLS|_TLS_)?$"),
1292 (instregex "BLA(8|8_NOP)?$"),
1293 (instregex "BLR(8|L)?$"),
1294 (instregex "TAILB(A)?(8)?$"),
1295 (instregex "TAILBCTR(8)?$"),
1296 (instregex "gBC(A|Aat|CTR|CTRL|L|LA|LAat|LR|LRL|Lat|at)?$"),
1297 (instregex "BCLR(L)?(n)?$"),
1298 (instregex "BCTR(L)?(8)?$"),
1299 B,
1300 BA,
1301 BC,
1302 BCC,
1303 BCCA,
1304 BCL,
1305 BCLalways,
1306 BCLn,
1307 BCTRL8_LDinto_toc,
1308 BCn,
1309 CTRL_DEP
1310)>;
1311
1312// Five Cycle Branch with a 2 Cycle ALU Op
1313// Operations must be done consecutively and not in parallel.
1314def : InstRW<[P9_BROpAndALUOp_7C, IP_EXEC_1C,
1315 DISP_1C, DISP_1C, DISP_1C, DISP_1C],
1316 (instrs
1317 ADDPCIS
1318)>;
1319
Stefan Pintilie735817a2018-03-09 21:08:35 +00001320// Special Extracted Instructions For Atomics
Stefan Pintilied45db612018-03-05 14:34:59 +00001321
1322// Atomic Load
1323def : InstRW<[P9_LS_1C, P9_LS_1C, P9_LS_4C, P9_LS_4C, P9_LS_4C,
1324 IP_EXEC_1C, IP_EXEC_1C, IP_AGEN_1C, IP_AGEN_1C, IP_AGEN_1C,
1325 IP_AGEN_1C, IP_AGEN_1C, DISP_1C, DISP_1C, DISP_1C, DISP_1C,
1326 DISP_1C, DISP_1C, DISP_1C, DISP_1C, DISP_1C, DISP_1C, DISP_1C,
1327 DISP_1C],
1328 (instrs
Stefan Pintilie235fb922018-03-08 16:24:33 +00001329 (instregex "L(D|W)AT$")
1330)>;
1331
1332// Atomic Store
1333def : InstRW<[P9_LS_1C, P9_LS_4C, P9_LS_4C, IP_EXEC_1C, IP_AGEN_1C, IP_AGEN_1C,
1334 IP_AGEN_1C, DISP_1C, DISP_1C, DISP_1C, DISP_1C, DISP_1C, DISP_1C,
1335 DISP_1C],
1336 (instrs
1337 (instregex "ST(D|W)AT$")
Stefan Pintilied45db612018-03-05 14:34:59 +00001338)>;
1339
Stefan Pintilieb5a94402018-03-02 14:41:38 +00001340// Signal Processing Engine (SPE) Instructions
1341// These instructions are not supported on Power 9
1342def : InstRW<[],
1343 (instrs
1344 BRINC,
1345 EVABS,
1346 EVEQV,
1347 EVMRA,
1348 EVNAND,
1349 EVNEG,
1350 (instregex "EVADD(I)?W$"),
1351 (instregex "EVADD(SM|SS|UM|US)IAAW$"),
1352 (instregex "EVAND(C)?$"),
1353 (instregex "EVCMP(EQ|GTS|GTU|LTS|LTU)$"),
1354 (instregex "EVCNTL(S|Z)W$"),
1355 (instregex "EVDIVW(S|U)$"),
1356 (instregex "EVEXTS(B|H)$"),
1357 (instregex "EVLD(H|W|D)(X)?$"),
1358 (instregex "EVLHH(E|OS|OU)SPLAT(X)?$"),
1359 (instregex "EVLWHE(X)?$"),
1360 (instregex "EVLWHO(S|U)(X)?$"),
1361 (instregex "EVLW(H|W)SPLAT(X)?$"),
1362 (instregex "EVMERGE(HI|LO|HILO|LOHI)$"),
1363 (instregex "EVMHEG(S|U)M(F|I)A(A|N)$"),
1364 (instregex "EVMHES(M|S)(F|I)(A|AA|AAW|ANW)?$"),
1365 (instregex "EVMHEU(M|S)I(A|AA|AAW|ANW)?$"),
1366 (instregex "EVMHOG(U|S)M(F|I)A(A|N)$"),
1367 (instregex "EVMHOS(M|S)(F|I)(A|AA|AAW|ANW)?$"),
1368 (instregex "EVMHOU(M|S)I(A|AA|ANW|AAW)?$"),
1369 (instregex "EVMWHS(M|S)(F|FA|I|IA)$"),
1370 (instregex "EVMWHUMI(A)?$"),
1371 (instregex "EVMWLS(M|S)IA(A|N)W$"),
1372 (instregex "EVMWLU(M|S)I(A|AA|AAW|ANW)?$"),
1373 (instregex "EVMWSM(F|I)(A|AA|AN)?$"),
1374 (instregex "EVMWSSF(A|AA|AN)?$"),
1375 (instregex "EVMWUMI(A|AA|AN)?$"),
1376 (instregex "EV(N|X)?OR(C)?$"),
1377 (instregex "EVR(LW|LWI|NDW)$"),
1378 (instregex "EVSLW(I)?$"),
1379 (instregex "EVSPLAT(F)?I$"),
1380 (instregex "EVSRW(I)?(S|U)$"),
1381 (instregex "EVST(DD|DH|DW|WHE|WHO|WWE|WWO)(X)?$"),
1382 (instregex "EVSUBF(S|U)(M|S)IAAW$"),
1383 (instregex "EVSUB(I)?FW$")
1384)> { let Unsupported = 1; }
Stefan Pintiliee894e0f2018-03-01 16:16:08 +00001385
Stefan Pintilieb5a94402018-03-02 14:41:38 +00001386// General Instructions without scheduling support.
Stefan Pintilie626b6512018-02-23 20:37:10 +00001387def : InstRW<[],
1388 (instrs
Stefan Pintiliee894e0f2018-03-01 16:16:08 +00001389 (instregex "(H)?RFI(D)?$"),
Stefan Pintilied45db612018-03-05 14:34:59 +00001390 (instregex "DSS(ALL)?$"),
1391 (instregex "DST(ST)?(T)?(64)?$"),
1392 (instregex "ICBL(C|Q)$"),
Stefan Pintilie235fb922018-03-08 16:24:33 +00001393 (instregex "L(W|H|B)EPX$"),
1394 (instregex "ST(W|H|B)EPX$"),
1395 (instregex "(L|ST)FDEPX$"),
1396 (instregex "M(T|F)SR(IN)?$"),
1397 (instregex "M(T|F)DCR$"),
1398 (instregex "NOP_GT_PWR(6|7)$"),
1399 (instregex "TLB(IA|IVAX|SX|SX2|SX2D|LD|LI|RE|RE2|WE|WE2)$"),
1400 (instregex "WRTEE(I)?$"),
Stefan Pintiliee894e0f2018-03-01 16:16:08 +00001401 ATTN,
Stefan Pintiliee894e0f2018-03-01 16:16:08 +00001402 CLRBHRB,
1403 MFBHRBE,
Stefan Pintilie235fb922018-03-08 16:24:33 +00001404 MBAR,
1405 MSYNC,
1406 SLBSYNC,
Stefan Pintiliee894e0f2018-03-01 16:16:08 +00001407 NAP,
Stefan Pintilie235fb922018-03-08 16:24:33 +00001408 STOP,
1409 TRAP,
Stefan Pintiliee894e0f2018-03-01 16:16:08 +00001410 RFCI,
1411 RFDI,
1412 RFMCI,
1413 SC,
Stefan Pintilied45db612018-03-05 14:34:59 +00001414 DCBA,
1415 DCBI,
1416 DCCCI,
Stefan Pintilie235fb922018-03-08 16:24:33 +00001417 ICCCI
Stefan Pintilie626b6512018-02-23 20:37:10 +00001418)> { let Unsupported = 1; }