blob: 34df8452fe16618cfcac962cb6d2616d1be32314 [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,
Lei Huang6270ab62018-07-04 21:59:16 +0000518 XSCVDPSPN,
519 XSRSP
Ehsan Amiri6c17bb02016-12-19 13:35:45 +0000520)>;
521
Stefan Pintilie590eb272017-09-22 20:17:25 +0000522// Three Cycle PM operation. Only one PM unit per superslice so we use the whole
523// superslice. That includes both exec pipelines (EXECO, EXECE) and all three
524// dispatches.
525def : InstRW<[P9_PM_3C, IP_EXECO_1C, IP_EXECE_1C, DISP_1C, DISP_1C, DISP_1C],
Ehsan Amiri6c17bb02016-12-19 13:35:45 +0000526 (instrs
Stefan Pintilie235fb922018-03-08 16:24:33 +0000527 (instregex "LVS(L|R)$"),
528 (instregex "VSPLTIS(W|H|B)$"),
529 (instregex "VSPLT(W|H|B)(s)?$"),
530 (instregex "V_SETALLONES(B|H)?$"),
531 (instregex "VEXTRACTU(B|H|W)$"),
Stefan Pintilie735817a2018-03-09 21:08:35 +0000532 (instregex "VINSERT(B|H|W|D)$"),
Stefan Pintilie235fb922018-03-08 16:24:33 +0000533 MFVSRLD,
534 MTVSRWS,
Ehsan Amiri6c17bb02016-12-19 13:35:45 +0000535 VBPERMQ,
536 VCLZLSBB,
537 VCTZLSBB,
538 VEXTRACTD,
Ehsan Amiri6c17bb02016-12-19 13:35:45 +0000539 VEXTUBLX,
540 VEXTUBRX,
541 VEXTUHLX,
542 VEXTUHRX,
543 VEXTUWLX,
544 VEXTUWRX,
545 VGBBD,
Ehsan Amiri6c17bb02016-12-19 13:35:45 +0000546 VMRGHB,
547 VMRGHH,
548 VMRGHW,
549 VMRGLB,
550 VMRGLH,
551 VMRGLW,
552 VPERM,
553 VPERMR,
554 VPERMXOR,
555 VPKPX,
556 VPKSDSS,
557 VPKSDUS,
558 VPKSHSS,
559 VPKSHUS,
560 VPKSWSS,
561 VPKSWUS,
562 VPKUDUM,
563 VPKUDUS,
564 VPKUHUM,
565 VPKUHUS,
566 VPKUWUM,
567 VPKUWUS,
568 VPRTYBQ,
569 VSL,
570 VSLDOI,
571 VSLO,
572 VSLV,
Ehsan Amiri6c17bb02016-12-19 13:35:45 +0000573 VSR,
574 VSRO,
575 VSRV,
576 VUPKHPX,
577 VUPKHSB,
578 VUPKHSH,
579 VUPKHSW,
580 VUPKLPX,
581 VUPKLSB,
582 VUPKLSH,
583 VUPKLSW,
584 XXBRD,
585 XXBRH,
586 XXBRQ,
587 XXBRW,
588 XXEXTRACTUW,
589 XXINSERTW,
590 XXMRGHW,
591 XXMRGLW,
592 XXPERM,
593 XXPERMR,
594 XXSLDWI,
595 XXSPLTIB,
596 XXSPLTW,
Stefan Pintilie590eb272017-09-22 20:17:25 +0000597 XXSPLTWs,
598 XXPERMDI,
599 XXPERMDIs,
Ehsan Amiri6c17bb02016-12-19 13:35:45 +0000600 VADDCUQ,
601 VADDECUQ,
602 VADDEUQM,
603 VADDUQM,
604 VMUL10CUQ,
605 VMUL10ECUQ,
606 VMUL10EUQ,
607 VMUL10UQ,
608 VSUBCUQ,
609 VSUBECUQ,
610 VSUBEUQM,
611 VSUBUQM,
612 XSCMPEXPQP,
613 XSCMPOQP,
614 XSCMPUQP,
615 XSTSTDCQP,
Stefan Pintiliee894e0f2018-03-01 16:16:08 +0000616 XSXSIGQP,
617 BCDCFNo,
618 BCDCFZo,
619 BCDCPSGNo,
620 BCDCTNo,
621 BCDCTZo,
622 BCDSETSGNo,
623 BCDSo,
624 BCDTRUNCo,
625 BCDUSo,
626 BCDUTRUNCo
Ehsan Amiri6c17bb02016-12-19 13:35:45 +0000627)>;
628
Stefan Pintilie590eb272017-09-22 20:17:25 +0000629// 12 Cycle DFU operation. Only one DFU unit per CPU so we use a whole
630// superslice. That includes both exec pipelines (EXECO, EXECE) and all three
631// dispatches.
632def : InstRW<[P9_DFU_12C, IP_EXECE_1C, IP_EXECO_1C, DISP_1C, DISP_1C, DISP_1C],
Ehsan Amiri6c17bb02016-12-19 13:35:45 +0000633 (instrs
Stefan Pintiliee894e0f2018-03-01 16:16:08 +0000634 BCDSRo,
Ehsan Amiri6c17bb02016-12-19 13:35:45 +0000635 XSADDQP,
636 XSADDQPO,
637 XSCVDPQP,
638 XSCVQPDP,
639 XSCVQPDPO,
640 XSCVQPSDZ,
641 XSCVQPSWZ,
642 XSCVQPUDZ,
643 XSCVQPUWZ,
644 XSCVSDQP,
645 XSCVUDQP,
646 XSRQPI,
Stefan Pintilie235fb922018-03-08 16:24:33 +0000647 XSRQPIX,
Ehsan Amiri6c17bb02016-12-19 13:35:45 +0000648 XSRQPXP,
649 XSSUBQP,
650 XSSUBQPO
651)>;
652
Stefan Pintiliee894e0f2018-03-01 16:16:08 +0000653// 23 Cycle DFU operation. Only one DFU unit per CPU so we use a whole
654// superslice. That includes both exec pipelines (EXECO, EXECE) and all three
655// dispatches.
656def : InstRW<[P9_DFU_23C, IP_EXECE_1C, IP_EXECO_1C, DISP_1C, DISP_1C, DISP_1C],
657 (instrs
658 BCDCTSQo
659)>;
660
Stefan Pintilie590eb272017-09-22 20:17:25 +0000661// 24 Cycle DFU operation. Only one DFU unit per CPU so we use a whole
662// superslice. That includes both exec pipelines (EXECO, EXECE) and all three
663// dispatches.
664def : InstRW<[P9_DFU_24C, IP_EXECE_1C, IP_EXECO_1C, DISP_1C, DISP_1C, DISP_1C],
Ehsan Amiri6c17bb02016-12-19 13:35:45 +0000665 (instrs
666 XSMADDQP,
667 XSMADDQPO,
668 XSMSUBQP,
669 XSMSUBQPO,
670 XSMULQP,
671 XSMULQPO,
672 XSNMADDQP,
673 XSNMADDQPO,
674 XSNMSUBQP,
675 XSNMSUBQPO
676)>;
677
Stefan Pintiliee894e0f2018-03-01 16:16:08 +0000678// 37 Cycle DFU operation. Only one DFU unit per CPU so we use a whole
679// superslice. That includes both exec pipelines (EXECO, EXECE) and all three
680// dispatches.
681def : InstRW<[P9_DFU_37C, IP_EXECE_1C, IP_EXECO_1C, DISP_1C, DISP_1C, DISP_1C],
682 (instrs
683 BCDCFSQo
684)>;
685
Stefan Pintilie590eb272017-09-22 20:17:25 +0000686// 58 Cycle DFU operation. Only one DFU unit per CPU so we use a whole
687// superslice. That includes both exec pipelines (EXECO, EXECE) and all three
688// dispatches.
689def : InstRW<[P9_DFU_58C, IP_EXECE_1C, IP_EXECO_1C, DISP_1C, DISP_1C, DISP_1C],
Ehsan Amiri6c17bb02016-12-19 13:35:45 +0000690 (instrs
691 XSDIVQP,
692 XSDIVQPO
693)>;
694
Stefan Pintilie590eb272017-09-22 20:17:25 +0000695// 76 Cycle DFU operation. Only one DFU unit per CPU so we use a whole
696// superslice. That includes both exec pipelines (EXECO, EXECE) and all three
697// dispatches.
698def : InstRW<[P9_DFU_76C, IP_EXECE_1C, IP_EXECO_1C, DISP_1C, DISP_1C, DISP_1C],
Ehsan Amiri6c17bb02016-12-19 13:35:45 +0000699 (instrs
700 XSSQRTQP,
701 XSSQRTQPO
702)>;
703
Stefan Pintilie735817a2018-03-09 21:08:35 +0000704// 6 Cycle Load uses a single slice.
Stefan Pintilie235fb922018-03-08 16:24:33 +0000705def : InstRW<[P9_LS_6C, IP_AGEN_1C, DISP_1C, DISP_1C],
706 (instrs
707 (instregex "LXVL(L)?")
708)>;
709
Stefan Pintilie735817a2018-03-09 21:08:35 +0000710// 5 Cycle Load uses a single slice.
Ehsan Amiri6c17bb02016-12-19 13:35:45 +0000711def : InstRW<[P9_LS_5C, IP_AGEN_1C, DISP_1C, DISP_1C],
712 (instrs
Stefan Pintilie235fb922018-03-08 16:24:33 +0000713 (instregex "LVE(B|H|W)X$"),
714 (instregex "LVX(L)?"),
715 (instregex "LXSI(B|H)ZX$"),
Ehsan Amiri6c17bb02016-12-19 13:35:45 +0000716 LXSDX,
Stefan Pintilie235fb922018-03-08 16:24:33 +0000717 LXVB16X,
Ehsan Amiri6c17bb02016-12-19 13:35:45 +0000718 LXVD2X,
Stefan Pintiliee894e0f2018-03-01 16:16:08 +0000719 LXVWSX,
Ehsan Amiri6c17bb02016-12-19 13:35:45 +0000720 LXSIWZX,
721 LXV,
Stefan Pintilie590eb272017-09-22 20:17:25 +0000722 LXVX,
723 LXSD,
Tony Jiang438bf4a2017-11-20 14:38:30 +0000724 DFLOADf64,
Stefan Pintilie626b6512018-02-23 20:37:10 +0000725 XFLOADf64,
726 LIWZX
Ehsan Amiri6c17bb02016-12-19 13:35:45 +0000727)>;
728
Stefan Pintilie735817a2018-03-09 21:08:35 +0000729// 4 Cycle Load uses a single slice.
Stefan Pintilie590eb272017-09-22 20:17:25 +0000730def : InstRW<[P9_LS_4C, IP_AGEN_1C, DISP_1C, DISP_1C],
731 (instrs
Stefan Pintilied45db612018-03-05 14:34:59 +0000732 (instregex "DCB(F|T|ST)(EP)?$"),
733 (instregex "DCBZ(L)?(EP)?$"),
734 (instregex "DCBTST(EP)?$"),
735 (instregex "CP_COPY(8)?$"),
736 (instregex "CP_PASTE(8)?$"),
737 (instregex "ICBI(EP)?$"),
738 (instregex "ICBT(LS)?$"),
739 (instregex "LBARX(L)?$"),
Zaara Syeda6f3df022018-05-28 15:27:58 +0000740 (instregex "LBZ(CIX|8|X|X8|XTLS|XTLS_32)?(_)?$"),
741 (instregex "LD(ARX|ARXL|BRX|CIX|X|XTLS)?(_)?$"),
Stefan Pintilie235fb922018-03-08 16:24:33 +0000742 (instregex "LH(A|B)RX(L)?(8)?$"),
Zaara Syeda6f3df022018-05-28 15:27:58 +0000743 (instregex "LHZ(8|CIX|X|X8|XTLS|XTLS_32)?(_)?$"),
Stefan Pintilie235fb922018-03-08 16:24:33 +0000744 (instregex "LWARX(L)?$"),
745 (instregex "LWBRX(8)?$"),
Zaara Syeda6f3df022018-05-28 15:27:58 +0000746 (instregex "LWZ(8|CIX|X|X8|XTLS|XTLS_32)?(_)?$"),
Stefan Pintilie735817a2018-03-09 21:08:35 +0000747 CP_ABORT,
748 DARN,
749 EnforceIEIO,
750 ISYNC,
751 MSGSYNC,
752 TLBSYNC,
753 SYNC,
Stefan Pintilie235fb922018-03-08 16:24:33 +0000754 LMW,
755 LSWI
Stefan Pintilie590eb272017-09-22 20:17:25 +0000756)>;
757
758// 4 Cycle Restricted load uses a single slice but the dispatch for the whole
759// superslice.
760def : InstRW<[P9_LS_4C, IP_AGEN_1C, DISP_1C, DISP_1C, DISP_1C],
Ehsan Amiri6c17bb02016-12-19 13:35:45 +0000761 (instrs
762 LFIWZX,
763 LFDX,
764 LFD
765)>;
766
Stefan Pintilie735817a2018-03-09 21:08:35 +0000767// Cracked Load Instructions.
768// Load instructions that can be done in parallel.
Stefan Pintilie235fb922018-03-08 16:24:33 +0000769def : InstRW<[P9_LS_4C, P9_LS_4C, IP_AGEN_1C, IP_AGEN_1C,
770 DISP_1C, DISP_1C, DISP_1C, DISP_1C],
771 (instrs
772 SLBIA,
773 SLBIE,
774 SLBMFEE,
775 SLBMFEV,
776 SLBMTE,
777 TLBIEL
778)>;
779
Stefan Pintilie735817a2018-03-09 21:08:35 +0000780// Cracked Load Instruction.
Stefan Pintilie235fb922018-03-08 16:24:33 +0000781// Requires Load and ALU pieces totaling 6 cycles. The Load and ALU
782// operations can be run in parallel.
783def : InstRW<[P9_LS_4C, P9_ALU_2C, IP_EXEC_1C, IP_AGEN_1C,
784 DISP_1C, DISP_1C, DISP_1C, DISP_1C],
785 (instrs
786 (instregex "L(W|H)ZU(X)?(8)?$"),
787 TEND
788)>;
789
Stefan Pintilie735817a2018-03-09 21:08:35 +0000790// Cracked Store Instruction
791// Consecutive Store and ALU instructions. The store is restricted and requires
792// three dispatches.
Stefan Pintilie235fb922018-03-08 16:24:33 +0000793def : InstRW<[P9_StoreAndALUOp_3C, IP_EXEC_1C, IP_EXEC_1C, IP_AGEN_1C,
794 DISP_1C, DISP_1C, DISP_1C, DISP_1C, DISP_1C],
795 (instrs
796 (instregex "ST(B|H|W|D)CX$")
797)>;
798
Stefan Pintilie735817a2018-03-09 21:08:35 +0000799// Cracked Load Instruction.
800// Two consecutive load operations for a total of 8 cycles.
801def : InstRW<[P9_LoadAndLoadOp_8C, IP_AGEN_1C, IP_AGEN_1C,
802 DISP_1C, DISP_1C, DISP_1C, DISP_1C],
803 (instrs
804 LDMX
805)>;
806
Stefan Pintilied45db612018-03-05 14:34:59 +0000807// Cracked Load instruction.
808// Requires consecutive Load and ALU pieces totaling 6 cycles. The Load and ALU
809// operations cannot be done at the same time and so their latencies are added.
810def : InstRW<[P9_LoadAndALUOp_6C, IP_EXEC_1C, IP_AGEN_1C,
811 DISP_1C, DISP_1C, DISP_1C, DISP_1C],
812 (instrs
Stefan Pintilie235fb922018-03-08 16:24:33 +0000813 (instregex "LHA(X)?(8)?$"),
814 (instregex "CP_PASTE(8)?o$"),
815 (instregex "LWA(X)?(_32)?$"),
816 TCHECK
Stefan Pintilied45db612018-03-05 14:34:59 +0000817)>;
818
Stefan Pintilie590eb272017-09-22 20:17:25 +0000819// Cracked Restricted Load instruction.
820// Requires consecutive Load and ALU pieces totaling 6 cycles. The Load and ALU
821// operations cannot be done at the same time and so their latencies are added.
822// Full 6 dispatches are required as this is both cracked and restricted.
823def : InstRW<[P9_LoadAndALUOp_6C, IP_EXEC_1C, IP_AGEN_1C,
Ehsan Amiri6c17bb02016-12-19 13:35:45 +0000824 DISP_1C, DISP_1C, DISP_1C, DISP_1C, DISP_1C, DISP_1C],
825 (instrs
Stefan Pintiliee894e0f2018-03-01 16:16:08 +0000826 LFIWAX
Ehsan Amiri6c17bb02016-12-19 13:35:45 +0000827)>;
828
Stefan Pintilie590eb272017-09-22 20:17:25 +0000829// Cracked Load instruction.
830// Requires consecutive Load and ALU pieces totaling 7 cycles. The Load and ALU
831// operations cannot be done at the same time and so their latencies are added.
832// Full 4 dispatches are required as this is a cracked instruction.
833def : InstRW<[P9_LoadAndALUOp_7C, IP_AGEN_1C, IP_EXEC_1C,
834 DISP_1C, DISP_1C, DISP_1C, DISP_1C],
835 (instrs
Stefan Pintilie590eb272017-09-22 20:17:25 +0000836 LXSIWAX,
Stefan Pintilie626b6512018-02-23 20:37:10 +0000837 LIWAX
Stefan Pintilie590eb272017-09-22 20:17:25 +0000838)>;
839
Stefan Pintiliee894e0f2018-03-01 16:16:08 +0000840// Cracked Load instruction.
841// Requires consecutive Load (4 cycles) and ALU (3 cycles) pieces totaling 7
842// cycles. The Load and ALU operations cannot be done at the same time and so
843// their latencies are added.
844// Full 6 dispatches are required as this is a restricted instruction.
845def : InstRW<[P9_LoadAndALU2Op_7C, IP_AGEN_1C, IP_EXEC_1C,
846 DISP_1C, DISP_1C, DISP_1C, DISP_1C, DISP_1C, DISP_1C],
847 (instrs
848 LFSX,
849 LFS
850)>;
851
852// Cracked Load instruction.
853// Requires consecutive Load and ALU pieces totaling 8 cycles. The Load and ALU
854// operations cannot be done at the same time and so their latencies are added.
855// Full 4 dispatches are required as this is a cracked instruction.
856def : InstRW<[P9_LoadAndALU2Op_8C, IP_AGEN_1C, IP_EXEC_1C,
857 DISP_1C, DISP_1C, DISP_1C, DISP_1C],
858 (instrs
859 LXSSP,
860 LXSSPX,
861 XFLOADf32,
862 DFLOADf32
863)>;
864
Stefan Pintilie235fb922018-03-08 16:24:33 +0000865// Cracked 3-Way Load Instruction
866// Load with two ALU operations that depend on each other
867def : InstRW<[P9_LoadAndALUOp_6C, P9_ALU_2C, IP_AGEN_1C, IP_EXEC_1C, IP_EXEC_1C,
868 DISP_1C, DISP_1C, DISP_1C, DISP_1C, DISP_1C, DISP_1C],
869 (instrs
870 (instregex "LHAU(X)?(8)?$"),
871 LWAUX
872)>;
873
Stefan Pintilie590eb272017-09-22 20:17:25 +0000874// Cracked Load that requires the PM resource.
875// Since the Load and the PM cannot be done at the same time the latencies are
876// added. Requires 8 cycles.
877// Since the PM requires the full superslice we need both EXECE, EXECO pipelines
878// as well as 3 dispatches for the PM. The Load requires the remaining 2
879// dispatches.
880def : InstRW<[P9_LoadAndPMOp_8C, IP_AGEN_1C, IP_EXECE_1C, IP_EXECO_1C,
881 DISP_1C, DISP_1C, DISP_1C, DISP_1C, DISP_1C],
Ehsan Amiri6c17bb02016-12-19 13:35:45 +0000882 (instrs
Stefan Pintilie235fb922018-03-08 16:24:33 +0000883 LXVH8X,
Ehsan Amiri6c17bb02016-12-19 13:35:45 +0000884 LXVDSX,
885 LXVW4X
886)>;
887
Stefan Pintilie590eb272017-09-22 20:17:25 +0000888// Single slice Restricted store operation. The restricted operation requires
889// all three dispatches for the superslice.
Ehsan Amiri6c17bb02016-12-19 13:35:45 +0000890def : InstRW<[P9_LS_1C, IP_EXEC_1C, IP_AGEN_1C, DISP_1C, DISP_1C, DISP_1C],
891 (instrs
Stefan Pintilie626b6512018-02-23 20:37:10 +0000892 (instregex "STF(S|D|IWX|SX|DX)$"),
Stefan Pintilie235fb922018-03-08 16:24:33 +0000893 (instregex "STXS(D|DX|SPX|IWX|IBX|IHX|SP)(v)?$"),
894 (instregex "STW(8)?$"),
Stefan Pintilie735817a2018-03-09 21:08:35 +0000895 (instregex "(D|X)FSTORE(f32|f64)$"),
896 (instregex "ST(W|H|D)BRX$"),
897 (instregex "ST(B|H|D)(8)?$"),
Zaara Syeda6f3df022018-05-28 15:27:58 +0000898 (instregex "ST(B|W|H|D)(CI)?X(TLS|TLS_32)?(8)?(_)?$"),
Stefan Pintilie235fb922018-03-08 16:24:33 +0000899 STIWX,
900 SLBIEG,
901 STMW,
902 STSWI,
Stefan Pintilie735817a2018-03-09 21:08:35 +0000903 TLBIE
Ehsan Amiri6c17bb02016-12-19 13:35:45 +0000904)>;
905
Stefan Pintilie735817a2018-03-09 21:08:35 +0000906// Vector Store Instruction
907// Requires the whole superslice and therefore requires all three dispatches
908// as well as both the Even and Odd exec pipelines.
Stefan Pintilie590eb272017-09-22 20:17:25 +0000909def : InstRW<[P9_LS_1C, IP_EXECE_1C, IP_EXECO_1C, IP_AGEN_1C,
910 DISP_1C, DISP_1C, DISP_1C],
Ehsan Amiri6c17bb02016-12-19 13:35:45 +0000911 (instrs
Stefan Pintilie235fb922018-03-08 16:24:33 +0000912 (instregex "STVE(B|H|W)X$"),
913 (instregex "STVX(L)?$"),
914 (instregex "STXV(B16X|H8X|W4X|D2X|L|LL|X)?$")
Ehsan Amiri6c17bb02016-12-19 13:35:45 +0000915)>;
916
Stefan Pintilie235fb922018-03-08 16:24:33 +0000917// 5 Cycle DIV operation. Only one DIV unit per superslice so we use the whole
918// superslice. That includes both exec pipelines (EXECO, EXECE) and all three
919// dispatches.
920def : InstRW<[P9_DIV_5C, IP_EXECE_1C, IP_EXECO_1C, DISP_1C, DISP_1C, DISP_1C],
Stefan Pintilie626b6512018-02-23 20:37:10 +0000921 (instrs
Stefan Pintilie235fb922018-03-08 16:24:33 +0000922 (instregex "MTCTR(8)?(loop)?$"),
923 (instregex "MTLR(8)?$")
Stefan Pintilie626b6512018-02-23 20:37:10 +0000924)>;
925
926// 12 Cycle DIV operation. Only one DIV unit per superslice so we use the whole
927// superslice. That includes both exec pipelines (EXECO, EXECE) and all three
928// dispatches.
929def : InstRW<[P9_DIV_12C, IP_EXECE_1C, IP_EXECO_1C, DISP_1C, DISP_1C, DISP_1C],
930 (instrs
Stefan Pintiliee894e0f2018-03-01 16:16:08 +0000931 (instregex "M(T|F)VRSAVE(v)?$"),
Stefan Pintilie235fb922018-03-08 16:24:33 +0000932 (instregex "M(T|F)PMR$"),
933 (instregex "M(T|F)TB(8)?$"),
Stefan Pintiliee894e0f2018-03-01 16:16:08 +0000934 (instregex "MF(SPR|CTR|LR)(8)?$"),
Stefan Pintilie235fb922018-03-08 16:24:33 +0000935 (instregex "M(T|F)MSR(D)?$"),
936 (instregex "MTSPR(8)?$")
Stefan Pintilie626b6512018-02-23 20:37:10 +0000937)>;
Ehsan Amiri6c17bb02016-12-19 13:35:45 +0000938
Stefan Pintilie590eb272017-09-22 20:17:25 +0000939// 16 Cycle DIV operation. Only one DIV unit per superslice so we use the whole
940// superslice. That includes both exec pipelines (EXECO, EXECE) and all three
941// dispatches.
942def : InstRW<[P9_DIV_16C_8, IP_EXECO_1C, IP_EXECE_1C,
943 DISP_1C, DISP_1C, DISP_1C],
Ehsan Amiri6c17bb02016-12-19 13:35:45 +0000944 (instrs
945 DIVW,
Stefan Pintilie590eb272017-09-22 20:17:25 +0000946 DIVWU,
947 MODSW
Ehsan Amiri6c17bb02016-12-19 13:35:45 +0000948)>;
949
Stefan Pintilie590eb272017-09-22 20:17:25 +0000950// 24 Cycle DIV operation. Only one DIV unit per superslice so we use the whole
951// superslice. That includes both exec pipelines (EXECO, EXECE) and all three
952// dispatches.
953def : InstRW<[P9_DIV_24C_8, IP_EXECO_1C, IP_EXECE_1C,
954 DISP_1C, DISP_1C, DISP_1C],
Ehsan Amiri6c17bb02016-12-19 13:35:45 +0000955 (instrs
956 DIVWE,
957 DIVD,
958 DIVWEU,
Stefan Pintilie590eb272017-09-22 20:17:25 +0000959 DIVDU,
960 MODSD,
961 MODUD,
962 MODUW
Ehsan Amiri6c17bb02016-12-19 13:35:45 +0000963)>;
964
Stefan Pintilie590eb272017-09-22 20:17:25 +0000965// 40 Cycle DIV operation. Only one DIV unit per superslice so we use the whole
966// superslice. That includes both exec pipelines (EXECO, EXECE) and all three
967// dispatches.
968def : InstRW<[P9_DIV_40C_8, IP_EXECO_1C, IP_EXECE_1C,
969 DISP_1C, DISP_1C, DISP_1C],
Ehsan Amiri6c17bb02016-12-19 13:35:45 +0000970 (instrs
971 DIVDE,
972 DIVDEU
973)>;
974
Stefan Pintilie590eb272017-09-22 20:17:25 +0000975// Cracked DIV and ALU operation. Requires one full slice for the ALU operation
976// and one full superslice for the DIV operation since there is only one DIV
977// per superslice. Latency of DIV plus ALU is 26.
Stefan Pintilied45db612018-03-05 14:34:59 +0000978def : InstRW<[P9_IntDivAndALUOp_18C_8, IP_EXECE_1C, IP_EXECO_1C, IP_EXEC_1C,
979 DISP_1C, DISP_1C, DISP_1C, DISP_1C, DISP_1C],
980 (instrs
981 (instregex "DIVW(U)?(O)?o$")
982)>;
983
984// Cracked DIV and ALU operation. Requires one full slice for the ALU operation
985// and one full superslice for the DIV operation since there is only one DIV
986// per superslice. Latency of DIV plus ALU is 26.
Stefan Pintilie590eb272017-09-22 20:17:25 +0000987def : InstRW<[P9_IntDivAndALUOp_26C_8, IP_EXECE_1C, IP_EXECO_1C, IP_EXEC_1C,
988 DISP_1C, DISP_1C, DISP_1C, DISP_1C, DISP_1C],
Ehsan Amiri6c17bb02016-12-19 13:35:45 +0000989 (instrs
Stefan Pintiliecc330da2017-10-10 13:45:35 +0000990 DIVDo,
991 DIVDUo,
Ehsan Amiri6c17bb02016-12-19 13:35:45 +0000992 DIVWEo,
993 DIVWEUo
994)>;
995
Stefan Pintilie590eb272017-09-22 20:17:25 +0000996// Cracked DIV and ALU operation. Requires one full slice for the ALU operation
997// and one full superslice for the DIV operation since there is only one DIV
998// per superslice. Latency of DIV plus ALU is 42.
999def : InstRW<[P9_IntDivAndALUOp_42C_8, IP_EXECE_1C, IP_EXECO_1C, IP_EXEC_1C,
1000 DISP_1C, DISP_1C, DISP_1C, DISP_1C, DISP_1C],
Ehsan Amiri6c17bb02016-12-19 13:35:45 +00001001 (instrs
1002 DIVDEo,
1003 DIVDEUo
1004)>;
1005
Ehsan Amiri6c17bb02016-12-19 13:35:45 +00001006// CR access instructions in _BrMCR, IIC_BrMCRX.
1007
Stefan Pintilie590eb272017-09-22 20:17:25 +00001008// Cracked, restricted, ALU operations.
1009// Here the two ALU ops can actually be done in parallel and therefore the
1010// latencies are not added together. Otherwise this is like having two
1011// instructions running together on two pipelines and 6 dispatches.
1012// ALU ops are 2 cycles each.
Ehsan Amiri6c17bb02016-12-19 13:35:45 +00001013def : InstRW<[P9_ALU_2C, P9_ALU_2C, IP_EXEC_1C, IP_EXEC_1C,
1014 DISP_1C, DISP_1C, DISP_1C, DISP_1C, DISP_1C, DISP_1C],
1015 (instrs
Ehsan Amiri6c17bb02016-12-19 13:35:45 +00001016 MTCRF,
1017 MTCRF8
1018)>;
1019
Stefan Pintiliee894e0f2018-03-01 16:16:08 +00001020// Cracked ALU operations.
1021// Here the two ALU ops can actually be done in parallel and therefore the
1022// latencies are not added together. Otherwise this is like having two
1023// instructions running together on two pipelines and 4 dispatches.
1024// ALU ops are 2 cycles each.
1025def : InstRW<[P9_ALU_2C, P9_ALU_2C, IP_EXEC_1C, IP_EXEC_1C,
1026 DISP_1C, DISP_1C, DISP_1C, DISP_1C],
1027 (instrs
Stefan Pintilie235fb922018-03-08 16:24:33 +00001028 (instregex "ADDC(8)?o$"),
1029 (instregex "SUBFC(8)?o$")
Stefan Pintiliee894e0f2018-03-01 16:16:08 +00001030)>;
1031
Stefan Pintilied45db612018-03-05 14:34:59 +00001032// Cracked ALU operations.
1033// Two ALU ops can be done in parallel.
1034// One is three cycle ALU the ohter is a two cycle ALU.
1035// One of the ALU ops is restricted the other is not so we have a total of
1036// 5 dispatches.
1037def : InstRW<[P9_ALU_2C, P9_ALU_3C, IP_EXEC_1C, IP_EXEC_1C,
1038 DISP_1C, DISP_1C, DISP_1C, DISP_1C, DISP_1C],
1039 (instrs
1040 (instregex "F(N)?ABS(D|S)o$"),
1041 (instregex "FCPSGN(D|S)o$"),
1042 (instregex "FNEG(D|S)o$"),
1043 FMRo
1044)>;
1045
1046// Cracked ALU operations.
Stefan Pintilie590eb272017-09-22 20:17:25 +00001047// Here the two ALU ops can actually be done in parallel and therefore the
1048// latencies are not added together. Otherwise this is like having two
Stefan Pintilied45db612018-03-05 14:34:59 +00001049// instructions running together on two pipelines and 4 dispatches.
Stefan Pintilie590eb272017-09-22 20:17:25 +00001050// ALU ops are 3 cycles each.
1051def : InstRW<[P9_ALU_3C, P9_ALU_3C, IP_EXEC_1C, IP_EXEC_1C,
Ehsan Amiri6c17bb02016-12-19 13:35:45 +00001052 DISP_1C, DISP_1C, DISP_1C, DISP_1C],
1053 (instrs
1054 MCRFS
1055)>;
1056
Stefan Pintilie235fb922018-03-08 16:24:33 +00001057// Cracked Restricted ALU operations.
1058// Here the two ALU ops can actually be done in parallel and therefore the
1059// latencies are not added together. Otherwise this is like having two
1060// instructions running together on two pipelines and 6 dispatches.
1061// ALU ops are 3 cycles each.
1062def : InstRW<[P9_ALU_3C, P9_ALU_3C, IP_EXEC_1C, IP_EXEC_1C,
1063 DISP_1C, DISP_1C, DISP_1C, DISP_1C, DISP_1C, DISP_1C],
1064 (instrs
1065 (instregex "MTFSF(b|o)?$"),
1066 (instregex "MTFSFI(o)?$")
1067)>;
1068
Stefan Pintilieb5a94402018-03-02 14:41:38 +00001069// Cracked instruction made of two ALU ops.
1070// The two ops cannot be done in parallel.
Stefan Pintilie235fb922018-03-08 16:24:33 +00001071// One of the ALU ops is restricted and takes 3 dispatches.
Stefan Pintilie626b6512018-02-23 20:37:10 +00001072def : InstRW<[P9_ALUOpAndALUOp_4C, IP_EXEC_1C, IP_EXEC_1C,
1073 DISP_1C, DISP_1C, DISP_1C, DISP_1C, DISP_1C],
1074 (instrs
Stefan Pintilie235fb922018-03-08 16:24:33 +00001075 (instregex "RLD(I)?C(R|L)o$"),
1076 (instregex "RLW(IMI|INM|NM)(8)?o$"),
1077 (instregex "SLW(8)?o$"),
1078 (instregex "SRAW(I)?o$"),
1079 (instregex "SRW(8)?o$"),
1080 RLDICL_32o,
1081 RLDIMIo
1082)>;
1083
1084// Cracked instruction made of two ALU ops.
1085// The two ops cannot be done in parallel.
1086// Both of the ALU ops are restricted and take 3 dispatches.
1087def : InstRW<[P9_ALU2OpAndALU2Op_6C, IP_EXEC_1C, IP_EXEC_1C,
1088 DISP_1C, DISP_1C, DISP_1C, DISP_1C, DISP_1C, DISP_1C],
1089 (instrs
1090 (instregex "MFFS(L|CE|o)?$")
1091)>;
1092
Stefan Pintilie735817a2018-03-09 21:08:35 +00001093// Cracked ALU instruction composed of three consecutive 2 cycle loads for a
1094// total of 6 cycles. All of the ALU operations are also restricted so each
1095// takes 3 dispatches for a total of 9.
Stefan Pintilie235fb922018-03-08 16:24:33 +00001096def : InstRW<[P9_ALUOpAndALUOpAndALUOp_6C, IP_EXEC_1C, IP_EXEC_1C, IP_EXEC_1C,
1097 DISP_1C, DISP_1C, DISP_1C, DISP_1C, DISP_1C, DISP_1C, DISP_1C,
1098 DISP_1C, DISP_1C],
1099 (instrs
1100 (instregex "MFCR(8)?$")
Stefan Pintilie626b6512018-02-23 20:37:10 +00001101)>;
1102
Stefan Pintilieb5a94402018-03-02 14:41:38 +00001103// Cracked instruction made of two ALU ops.
1104// The two ops cannot be done in parallel.
1105def : InstRW<[P9_ALUOpAndALUOp_4C, IP_EXEC_1C, IP_EXEC_1C,
1106 DISP_1C, DISP_1C, DISP_1C, DISP_1C],
1107 (instrs
Stefan Pintilie235fb922018-03-08 16:24:33 +00001108 (instregex "EXTSWSLIo$"),
1109 (instregex "SRAD(I)?o$"),
1110 SLDo,
1111 SRDo,
1112 RLDICo
Stefan Pintilieb5a94402018-03-02 14:41:38 +00001113)>;
1114
Stefan Pintilie590eb272017-09-22 20:17:25 +00001115// 33 Cycle DP Instruction Restricted. Takes one slice and 3 dispatches.
Ehsan Amiri6c17bb02016-12-19 13:35:45 +00001116def : InstRW<[P9_DP_33C_8, IP_EXEC_1C, DISP_1C, DISP_1C, DISP_1C],
1117 (instrs
Stefan Pintilie590eb272017-09-22 20:17:25 +00001118 FDIV
1119)>;
1120
Stefan Pintilied45db612018-03-05 14:34:59 +00001121// 33 Cycle DP Instruction Restricted and Cracked with 3 Cycle ALU.
Stefan Pintiliee894e0f2018-03-01 16:16:08 +00001122def : InstRW<[P9_DPOpAndALU2Op_36C_8, IP_EXEC_1C, IP_EXEC_1C,
Stefan Pintiliecc330da2017-10-10 13:45:35 +00001123 DISP_1C, DISP_1C, DISP_1C, DISP_1C, DISP_1C],
1124 (instrs
1125 FDIVo
1126)>;
1127
Stefan Pintilie235fb922018-03-08 16:24:33 +00001128// 36 Cycle DP Instruction.
Stefan Pintilie735817a2018-03-09 21:08:35 +00001129// Instruction can be done on a single slice.
Stefan Pintilie235fb922018-03-08 16:24:33 +00001130def : InstRW<[P9_DP_36C_10, IP_EXEC_1C, DISP_1C, DISP_1C],
1131 (instrs
1132 XSSQRTDP
1133)>;
1134
Stefan Pintilied45db612018-03-05 14:34:59 +00001135// 36 Cycle DP Instruction Restricted. Takes one slice and 3 dispatches.
1136def : InstRW<[P9_DP_36C_10, IP_EXEC_1C, DISP_1C, DISP_1C, DISP_1C],
1137 (instrs
1138 FSQRT
1139)>;
1140
Stefan Pintilie235fb922018-03-08 16:24:33 +00001141// 36 Cycle DP Vector Instruction.
1142def : InstRW<[P9_DPE_36C_10, P9_DPO_36C_10, IP_EXECE_1C, IP_EXECO_1C,
1143 DISP_1C, DISP_1C, DISP_1C],
1144 (instrs
1145 XVSQRTDP
1146)>;
1147
1148// 27 Cycle DP Vector Instruction.
1149def : InstRW<[P9_DPE_27C_10, P9_DPO_27C_10, IP_EXECE_1C, IP_EXECO_1C,
1150 DISP_1C, DISP_1C, DISP_1C],
1151 (instrs
1152 XVSQRTSP
1153)>;
1154
Stefan Pintilied45db612018-03-05 14:34:59 +00001155// 36 Cycle DP Instruction Restricted and Cracked with 3 Cycle ALU.
1156def : InstRW<[P9_DPOpAndALU2Op_39C_10, IP_EXEC_1C, IP_EXEC_1C,
1157 DISP_1C, DISP_1C, DISP_1C, DISP_1C, DISP_1C],
1158 (instrs
1159 FSQRTo
1160)>;
1161
Stefan Pintilie235fb922018-03-08 16:24:33 +00001162// 26 Cycle DP Instruction.
1163def : InstRW<[P9_DP_26C_5, IP_EXEC_1C, DISP_1C, DISP_1C],
1164 (instrs
1165 XSSQRTSP
1166)>;
1167
Stefan Pintilied45db612018-03-05 14:34:59 +00001168// 26 Cycle DP Instruction Restricted. Takes one slice and 3 dispatches.
1169def : InstRW<[P9_DP_26C_5, IP_EXEC_1C, DISP_1C, DISP_1C, DISP_1C],
1170 (instrs
1171 FSQRTS
1172)>;
1173
1174// 26 Cycle DP Instruction Restricted and Cracked with 3 Cycle ALU.
1175def : InstRW<[P9_DPOpAndALU2Op_29C_5, IP_EXEC_1C, IP_EXEC_1C,
1176 DISP_1C, DISP_1C, DISP_1C, DISP_1C, DISP_1C],
1177 (instrs
1178 FSQRTSo
1179)>;
1180
Stefan Pintilie590eb272017-09-22 20:17:25 +00001181// 33 Cycle DP Instruction. Takes one slice and 2 dispatches.
1182def : InstRW<[P9_DP_33C_8, IP_EXEC_1C, DISP_1C, DISP_1C],
1183 (instrs
Ehsan Amiri6c17bb02016-12-19 13:35:45 +00001184 XSDIVDP
1185)>;
1186
Stefan Pintilie590eb272017-09-22 20:17:25 +00001187// 22 Cycle DP Instruction Restricted. Takes one slice and 3 dispatches.
Ehsan Amiri6c17bb02016-12-19 13:35:45 +00001188def : InstRW<[P9_DP_22C_5, IP_EXEC_1C, DISP_1C, DISP_1C, DISP_1C],
1189 (instrs
Stefan Pintilie590eb272017-09-22 20:17:25 +00001190 FDIVS
1191)>;
1192
Stefan Pintiliecc330da2017-10-10 13:45:35 +00001193// 22 Cycle DP Instruction Restricted and Cracked with 2 Cycle ALU.
Stefan Pintiliee894e0f2018-03-01 16:16:08 +00001194def : InstRW<[P9_DPOpAndALU2Op_25C_5, IP_EXEC_1C, IP_EXEC_1C,
Stefan Pintiliecc330da2017-10-10 13:45:35 +00001195 DISP_1C, DISP_1C, DISP_1C, DISP_1C, DISP_1C],
1196 (instrs
1197 FDIVSo
1198)>;
1199
Stefan Pintilie590eb272017-09-22 20:17:25 +00001200// 22 Cycle DP Instruction. Takes one slice and 2 dispatches.
1201def : InstRW<[P9_DP_22C_5, IP_EXEC_1C, DISP_1C, DISP_1C],
1202 (instrs
Ehsan Amiri6c17bb02016-12-19 13:35:45 +00001203 XSDIVSP
1204)>;
1205
Stefan Pintilie590eb272017-09-22 20:17:25 +00001206// 24 Cycle DP Vector Instruction. Takes one full superslice.
1207// Includes both EXECE, EXECO pipelines and all 3 dispatches for the given
1208// superslice.
1209def : InstRW<[P9_DPE_24C_8, P9_DPO_24C_8, IP_EXECE_1C, IP_EXECO_1C,
1210 DISP_1C, DISP_1C, DISP_1C],
Ehsan Amiri6c17bb02016-12-19 13:35:45 +00001211 (instrs
1212 XVDIVSP
1213)>;
1214
Stefan Pintilie590eb272017-09-22 20:17:25 +00001215// 33 Cycle DP Vector Instruction. Takes one full superslice.
1216// Includes both EXECE, EXECO pipelines and all 3 dispatches for the given
1217// superslice.
1218def : InstRW<[P9_DPE_33C_8, P9_DPO_33C_8, IP_EXECE_1C, IP_EXECO_1C,
1219 DISP_1C, DISP_1C, DISP_1C],
Ehsan Amiri6c17bb02016-12-19 13:35:45 +00001220 (instrs
1221 XVDIVDP
1222)>;
1223
Stefan Pintilie590eb272017-09-22 20:17:25 +00001224// Instruction cracked into three pieces. One Load and two ALU operations.
1225// The Load and one of the ALU ops cannot be run at the same time and so the
1226// latencies are added together for 6 cycles. The remainaing ALU is 2 cycles.
1227// Both the load and the ALU that depends on it are restricted and so they take
1228// a total of 6 dispatches. The final 2 dispatches come from the second ALU op.
1229// The two EXEC pipelines are for the 2 ALUs while the AGEN is for the load.
Stefan Pintiliee894e0f2018-03-01 16:16:08 +00001230def : InstRW<[P9_LoadAndALU2Op_7C, P9_ALU_2C,
Ehsan Amiri6c17bb02016-12-19 13:35:45 +00001231 IP_AGEN_1C, IP_EXEC_1C, IP_EXEC_1C,
1232 DISP_1C, DISP_1C, DISP_1C, DISP_1C,
1233 DISP_1C, DISP_1C, DISP_1C, DISP_1C],
1234 (instrs
Stefan Pintilie626b6512018-02-23 20:37:10 +00001235 (instregex "LF(SU|SUX)$")
1236)>;
1237
1238// Cracked instruction made up of a Store and an ALU. The ALU does not depend on
1239// the store and so it can be run at the same time as the store. The store is
1240// also restricted.
1241def : InstRW<[P9_LS_1C, P9_ALU_2C, IP_AGEN_1C, IP_EXEC_1C, IP_EXEC_1C,
1242 DISP_1C, DISP_1C, DISP_1C, DISP_1C, DISP_1C],
1243 (instrs
Stefan Pintilie235fb922018-03-08 16:24:33 +00001244 (instregex "STF(S|D)U(X)?$"),
1245 (instregex "ST(B|H|W|D)U(X)?(8)?$")
Ehsan Amiri6c17bb02016-12-19 13:35:45 +00001246)>;
1247
Stefan Pintilie590eb272017-09-22 20:17:25 +00001248// Cracked instruction made up of a Load and an ALU. The ALU does not depend on
Stefan Pintilied45db612018-03-05 14:34:59 +00001249// the load and so it can be run at the same time as the load.
1250def : InstRW<[P9_LS_4C, P9_ALU_2C, IP_AGEN_1C, IP_EXEC_1C,
1251 DISP_1C, DISP_1C, DISP_1C, DISP_1C],
1252 (instrs
1253 (instregex "LBZU(X)?(8)?$"),
1254 (instregex "LDU(X)?$")
1255)>;
1256
1257
1258// Cracked instruction made up of a Load and an ALU. The ALU does not depend on
Stefan Pintilie590eb272017-09-22 20:17:25 +00001259// the load and so it can be run at the same time as the load. The load is also
1260// restricted. 3 dispatches are from the restricted load while the other two
1261// are from the ALU. The AGEN pipeline is from the load and the EXEC pipeline
1262// is required for the ALU.
1263def : InstRW<[P9_LS_4C, P9_ALU_2C, IP_AGEN_1C, IP_EXEC_1C,
Ehsan Amiri6c17bb02016-12-19 13:35:45 +00001264 DISP_1C, DISP_1C, DISP_1C, DISP_1C, DISP_1C],
1265 (instrs
Stefan Pintilie626b6512018-02-23 20:37:10 +00001266 (instregex "LF(DU|DUX)$")
Ehsan Amiri6c17bb02016-12-19 13:35:45 +00001267)>;
1268
Stefan Pintilie590eb272017-09-22 20:17:25 +00001269// Crypto Instructions
1270
1271// 6 Cycle CY operation. Only one CY unit per CPU so we use a whole
1272// superslice. That includes both exec pipelines (EXECO, EXECE) and all three
1273// dispatches.
1274def : InstRW<[P9_CY_6C, IP_EXECO_1C, IP_EXECE_1C, DISP_1C, DISP_1C, DISP_1C],
1275 (instrs
Stefan Pintiliee894e0f2018-03-01 16:16:08 +00001276 (instregex "VPMSUM(B|H|W|D)$"),
1277 (instregex "V(N)?CIPHER(LAST)?$"),
1278 VSBOX
Stefan Pintilie590eb272017-09-22 20:17:25 +00001279)>;
Stefan Pintilie626b6512018-02-23 20:37:10 +00001280
Stefan Pintiliee894e0f2018-03-01 16:16:08 +00001281// Branch Instructions
1282
1283// Two Cycle Branch
1284def : InstRW<[P9_BR_2C, DISP_1C, DISP_1C],
1285 (instrs
1286 (instregex "BCCCTR(L)?(8)?$"),
1287 (instregex "BCCL(A|R|RL)?$"),
1288 (instregex "BCCTR(L)?(8)?(n)?$"),
1289 (instregex "BD(N)?Z(8|A|Am|Ap|m|p)?$"),
1290 (instregex "BD(N)?ZL(A|Am|Ap|R|R8|RL|RLm|RLp|Rm|Rp|m|p)?$"),
1291 (instregex "BL(_TLS)?$"),
1292 (instregex "BL8(_TLS|_NOP|_NOP_TLS|_TLS_)?$"),
1293 (instregex "BLA(8|8_NOP)?$"),
1294 (instregex "BLR(8|L)?$"),
1295 (instregex "TAILB(A)?(8)?$"),
1296 (instregex "TAILBCTR(8)?$"),
1297 (instregex "gBC(A|Aat|CTR|CTRL|L|LA|LAat|LR|LRL|Lat|at)?$"),
1298 (instregex "BCLR(L)?(n)?$"),
1299 (instregex "BCTR(L)?(8)?$"),
1300 B,
1301 BA,
1302 BC,
1303 BCC,
1304 BCCA,
1305 BCL,
1306 BCLalways,
1307 BCLn,
1308 BCTRL8_LDinto_toc,
1309 BCn,
1310 CTRL_DEP
1311)>;
1312
1313// Five Cycle Branch with a 2 Cycle ALU Op
1314// Operations must be done consecutively and not in parallel.
1315def : InstRW<[P9_BROpAndALUOp_7C, IP_EXEC_1C,
1316 DISP_1C, DISP_1C, DISP_1C, DISP_1C],
1317 (instrs
1318 ADDPCIS
1319)>;
1320
Stefan Pintilie735817a2018-03-09 21:08:35 +00001321// Special Extracted Instructions For Atomics
Stefan Pintilied45db612018-03-05 14:34:59 +00001322
1323// Atomic Load
1324def : InstRW<[P9_LS_1C, P9_LS_1C, P9_LS_4C, P9_LS_4C, P9_LS_4C,
1325 IP_EXEC_1C, IP_EXEC_1C, IP_AGEN_1C, IP_AGEN_1C, IP_AGEN_1C,
1326 IP_AGEN_1C, IP_AGEN_1C, DISP_1C, DISP_1C, DISP_1C, DISP_1C,
1327 DISP_1C, DISP_1C, DISP_1C, DISP_1C, DISP_1C, DISP_1C, DISP_1C,
1328 DISP_1C],
1329 (instrs
Stefan Pintilie235fb922018-03-08 16:24:33 +00001330 (instregex "L(D|W)AT$")
1331)>;
1332
1333// Atomic Store
1334def : InstRW<[P9_LS_1C, P9_LS_4C, P9_LS_4C, IP_EXEC_1C, IP_AGEN_1C, IP_AGEN_1C,
1335 IP_AGEN_1C, DISP_1C, DISP_1C, DISP_1C, DISP_1C, DISP_1C, DISP_1C,
1336 DISP_1C],
1337 (instrs
1338 (instregex "ST(D|W)AT$")
Stefan Pintilied45db612018-03-05 14:34:59 +00001339)>;
1340
Stefan Pintilieb5a94402018-03-02 14:41:38 +00001341// Signal Processing Engine (SPE) Instructions
1342// These instructions are not supported on Power 9
1343def : InstRW<[],
1344 (instrs
1345 BRINC,
1346 EVABS,
1347 EVEQV,
1348 EVMRA,
1349 EVNAND,
1350 EVNEG,
1351 (instregex "EVADD(I)?W$"),
1352 (instregex "EVADD(SM|SS|UM|US)IAAW$"),
1353 (instregex "EVAND(C)?$"),
1354 (instregex "EVCMP(EQ|GTS|GTU|LTS|LTU)$"),
1355 (instregex "EVCNTL(S|Z)W$"),
1356 (instregex "EVDIVW(S|U)$"),
1357 (instregex "EVEXTS(B|H)$"),
1358 (instregex "EVLD(H|W|D)(X)?$"),
1359 (instregex "EVLHH(E|OS|OU)SPLAT(X)?$"),
1360 (instregex "EVLWHE(X)?$"),
1361 (instregex "EVLWHO(S|U)(X)?$"),
1362 (instregex "EVLW(H|W)SPLAT(X)?$"),
1363 (instregex "EVMERGE(HI|LO|HILO|LOHI)$"),
1364 (instregex "EVMHEG(S|U)M(F|I)A(A|N)$"),
1365 (instregex "EVMHES(M|S)(F|I)(A|AA|AAW|ANW)?$"),
1366 (instregex "EVMHEU(M|S)I(A|AA|AAW|ANW)?$"),
1367 (instregex "EVMHOG(U|S)M(F|I)A(A|N)$"),
1368 (instregex "EVMHOS(M|S)(F|I)(A|AA|AAW|ANW)?$"),
1369 (instregex "EVMHOU(M|S)I(A|AA|ANW|AAW)?$"),
1370 (instregex "EVMWHS(M|S)(F|FA|I|IA)$"),
1371 (instregex "EVMWHUMI(A)?$"),
1372 (instregex "EVMWLS(M|S)IA(A|N)W$"),
1373 (instregex "EVMWLU(M|S)I(A|AA|AAW|ANW)?$"),
1374 (instregex "EVMWSM(F|I)(A|AA|AN)?$"),
1375 (instregex "EVMWSSF(A|AA|AN)?$"),
1376 (instregex "EVMWUMI(A|AA|AN)?$"),
1377 (instregex "EV(N|X)?OR(C)?$"),
1378 (instregex "EVR(LW|LWI|NDW)$"),
1379 (instregex "EVSLW(I)?$"),
1380 (instregex "EVSPLAT(F)?I$"),
1381 (instregex "EVSRW(I)?(S|U)$"),
1382 (instregex "EVST(DD|DH|DW|WHE|WHO|WWE|WWO)(X)?$"),
1383 (instregex "EVSUBF(S|U)(M|S)IAAW$"),
1384 (instregex "EVSUB(I)?FW$")
1385)> { let Unsupported = 1; }
Stefan Pintiliee894e0f2018-03-01 16:16:08 +00001386
Stefan Pintilieb5a94402018-03-02 14:41:38 +00001387// General Instructions without scheduling support.
Stefan Pintilie626b6512018-02-23 20:37:10 +00001388def : InstRW<[],
1389 (instrs
Stefan Pintiliee894e0f2018-03-01 16:16:08 +00001390 (instregex "(H)?RFI(D)?$"),
Stefan Pintilied45db612018-03-05 14:34:59 +00001391 (instregex "DSS(ALL)?$"),
1392 (instregex "DST(ST)?(T)?(64)?$"),
1393 (instregex "ICBL(C|Q)$"),
Stefan Pintilie235fb922018-03-08 16:24:33 +00001394 (instregex "L(W|H|B)EPX$"),
1395 (instregex "ST(W|H|B)EPX$"),
1396 (instregex "(L|ST)FDEPX$"),
1397 (instregex "M(T|F)SR(IN)?$"),
1398 (instregex "M(T|F)DCR$"),
1399 (instregex "NOP_GT_PWR(6|7)$"),
1400 (instregex "TLB(IA|IVAX|SX|SX2|SX2D|LD|LI|RE|RE2|WE|WE2)$"),
1401 (instregex "WRTEE(I)?$"),
Stefan Pintiliee894e0f2018-03-01 16:16:08 +00001402 ATTN,
Stefan Pintiliee894e0f2018-03-01 16:16:08 +00001403 CLRBHRB,
1404 MFBHRBE,
Stefan Pintilie235fb922018-03-08 16:24:33 +00001405 MBAR,
1406 MSYNC,
1407 SLBSYNC,
Stefan Pintiliee894e0f2018-03-01 16:16:08 +00001408 NAP,
Stefan Pintilie235fb922018-03-08 16:24:33 +00001409 STOP,
1410 TRAP,
Stefan Pintiliee894e0f2018-03-01 16:16:08 +00001411 RFCI,
1412 RFDI,
1413 RFMCI,
1414 SC,
Stefan Pintilied45db612018-03-05 14:34:59 +00001415 DCBA,
1416 DCBI,
1417 DCCCI,
Stefan Pintilie235fb922018-03-08 16:24:33 +00001418 ICCCI
Stefan Pintilie626b6512018-02-23 20:37:10 +00001419)> { let Unsupported = 1; }