65d5c16511c230d7da2514ed63c58ffab394f84e
[oota-llvm.git] / lib / Target / PowerPC / PPCSchedule.td
1 //===-- PPCSchedule.td - PowerPC Scheduling Definitions ----*- tablegen -*-===//
2 //
3 //                     The LLVM Compiler Infrastructure
4 //
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
7 //
8 //===----------------------------------------------------------------------===//
9
10 //===----------------------------------------------------------------------===//
11 // Functional units across PowerPC chips sets
12 //
13 def BPU    : FuncUnit; // Branch unit
14 def SLU    : FuncUnit; // Store/load unit
15 def SRU    : FuncUnit; // special register unit
16 def IU1    : FuncUnit; // integer unit 1 (simple)
17 def IU2    : FuncUnit; // integer unit 2 (complex)
18 def FPU1   : FuncUnit; // floating point unit 1
19 def FPU2   : FuncUnit; // floating point unit 2
20 def VPU    : FuncUnit; // vector permutation unit
21 def VIU1   : FuncUnit; // vector integer unit 1 (simple)
22 def VIU2   : FuncUnit; // vector integer unit 2 (complex)
23 def VFPU   : FuncUnit; // vector floating point unit
24
25 //===----------------------------------------------------------------------===//
26 // Instruction Itinerary classes used for PowerPC
27 //
28 def IntSimple    : InstrItinClass;
29 def IntGeneral   : InstrItinClass;
30 def IntCompare   : InstrItinClass;
31 def IntDivD      : InstrItinClass;
32 def IntDivW      : InstrItinClass;
33 def IntMFFS      : InstrItinClass;
34 def IntMFVSCR    : InstrItinClass;
35 def IntMTFSB0    : InstrItinClass;
36 def IntMTSRD     : InstrItinClass;
37 def IntMulHD     : InstrItinClass;
38 def IntMulHW     : InstrItinClass;
39 def IntMulHWU    : InstrItinClass;
40 def IntMulLI     : InstrItinClass;
41 def IntRFID      : InstrItinClass;
42 def IntRotateD   : InstrItinClass;
43 def IntRotateDI  : InstrItinClass;
44 def IntRotate    : InstrItinClass;
45 def IntShift     : InstrItinClass;
46 def IntTrapD     : InstrItinClass;
47 def IntTrapW     : InstrItinClass;
48 def BrB          : InstrItinClass;
49 def BrCR         : InstrItinClass;
50 def BrMCR        : InstrItinClass;
51 def BrMCRX       : InstrItinClass;
52 def LdStDCBA     : InstrItinClass;
53 def LdStDCBF     : InstrItinClass;
54 def LdStDCBI     : InstrItinClass;
55 def LdStLoad     : InstrItinClass;
56 def LdStLoadUpd  : InstrItinClass;
57 def LdStStore    : InstrItinClass;
58 def LdStStoreUpd : InstrItinClass;
59 def LdStDSS      : InstrItinClass;
60 def LdStICBI     : InstrItinClass;
61 def LdStLD       : InstrItinClass;
62 def LdStLDU      : InstrItinClass;
63 def LdStLDARX    : InstrItinClass;
64 def LdStLFD      : InstrItinClass;
65 def LdStLFDU     : InstrItinClass;
66 def LdStLHA      : InstrItinClass;
67 def LdStLHAU     : InstrItinClass;
68 def LdStLMW      : InstrItinClass;
69 def LdStLVecX    : InstrItinClass;
70 def LdStLWA      : InstrItinClass;
71 def LdStLWARX    : InstrItinClass;
72 def LdStSLBIA    : InstrItinClass;
73 def LdStSLBIE    : InstrItinClass;
74 def LdStSTD      : InstrItinClass;
75 def LdStSTDCX    : InstrItinClass;
76 def LdStSTDU     : InstrItinClass;
77 def LdStSTFD     : InstrItinClass;
78 def LdStSTFDU    : InstrItinClass;
79 def LdStSTVEBX   : InstrItinClass;
80 def LdStSTWCX    : InstrItinClass;
81 def LdStSync     : InstrItinClass;
82 def SprISYNC     : InstrItinClass;
83 def SprMFSR      : InstrItinClass;
84 def SprMTMSR     : InstrItinClass;
85 def SprMTSR      : InstrItinClass;
86 def SprTLBSYNC   : InstrItinClass;
87 def SprMFCR      : InstrItinClass;
88 def SprMFMSR     : InstrItinClass;
89 def SprMFSPR     : InstrItinClass;
90 def SprMFTB      : InstrItinClass;
91 def SprMTSPR     : InstrItinClass;
92 def SprMTSRIN    : InstrItinClass;
93 def SprRFI       : InstrItinClass;
94 def SprSC        : InstrItinClass;
95 def FPGeneral    : InstrItinClass;
96 def FPAddSub     : InstrItinClass;
97 def FPCompare    : InstrItinClass;
98 def FPDivD       : InstrItinClass;
99 def FPDivS       : InstrItinClass;
100 def FPFused      : InstrItinClass;
101 def FPRes        : InstrItinClass;
102 def FPSqrt       : InstrItinClass;
103 def VecGeneral   : InstrItinClass;
104 def VecFP        : InstrItinClass;
105 def VecFPCompare : InstrItinClass;
106 def VecComplex   : InstrItinClass;
107 def VecPerm      : InstrItinClass;
108 def VecFPRound   : InstrItinClass;
109 def VecVSL       : InstrItinClass;
110 def VecVSR       : InstrItinClass;
111
112 //===----------------------------------------------------------------------===//
113 // Processor instruction itineraries.
114
115 include "PPCScheduleG3.td"
116 include "PPCSchedule440.td"
117 include "PPCScheduleG4.td"
118 include "PPCScheduleG4Plus.td"
119 include "PPCScheduleG5.td"
120 include "PPCScheduleA2.td"
121
122 //===----------------------------------------------------------------------===//
123 // Instruction to itinerary class map - When add new opcodes to the supported
124 // set, refer to the following table to determine which itinerary class the
125 // opcode belongs.
126 //
127 //    opcode     itinerary class
128 //    ======     ===============
129 //    add        IntSimple
130 //    addc       IntGeneral
131 //    adde       IntGeneral
132 //    addi       IntSimple
133 //    addic      IntGeneral
134 //    addic.     IntGeneral
135 //    addis      IntSimple
136 //    addme      IntGeneral
137 //    addze      IntGeneral
138 //    and        IntSimple
139 //    andc       IntSimple
140 //    andi.      IntGeneral
141 //    andis.     IntGeneral
142 //    b          BrB
143 //    bc         BrB
144 //    bcctr      BrB
145 //    bclr       BrB
146 //    cmp        IntCompare
147 //    cmpi       IntCompare
148 //    cmpl       IntCompare
149 //    cmpli      IntCompare
150 //    cntlzd     IntRotateD
151 //    cntlzw     IntGeneral
152 //    crand      BrCR
153 //    crandc     BrCR
154 //    creqv      BrCR
155 //    crnand     BrCR
156 //    crnor      BrCR
157 //    cror       BrCR
158 //    crorc      BrCR
159 //    crxor      BrCR
160 //    dcba       LdStDCBA
161 //    dcbf       LdStDCBF
162 //    dcbi       LdStDCBI
163 //    dcbst      LdStDCBF
164 //    dcbt       LdStLoad
165 //    dcbtst     LdStLoad
166 //    dcbz       LdStDCBF
167 //    divd       IntDivD
168 //    divdu      IntDivD
169 //    divw       IntDivW
170 //    divwu      IntDivW
171 //    dss        LdStDSS
172 //    dst        LdStDSS
173 //    dstst      LdStDSS
174 //    eciwx      LdStLoad
175 //    ecowx      LdStLoad
176 //    eieio      LdStLoad
177 //    eqv        IntSimple
178 //    extsb      IntSimple
179 //    extsh      IntSimple
180 //    extsw      IntSimple
181 //    fabs       FPGeneral
182 //    fadd       FPAddSub
183 //    fadds      FPGeneral
184 //    fcfid      FPGeneral
185 //    fcmpo      FPCompare
186 //    fcmpu      FPCompare
187 //    fctid      FPGeneral
188 //    fctidz     FPGeneral
189 //    fctiw      FPGeneral
190 //    fctiwz     FPGeneral
191 //    fdiv       FPDivD
192 //    fdivs      FPDivS
193 //    fmadd      FPFused
194 //    fmadds     FPGeneral
195 //    fmr        FPGeneral
196 //    fmsub      FPFused
197 //    fmsubs     FPGeneral
198 //    fmul       FPFused
199 //    fmuls      FPGeneral
200 //    fnabs      FPGeneral
201 //    fneg       FPGeneral
202 //    fnmadd     FPFused
203 //    fnmadds    FPGeneral
204 //    fnmsub     FPFused
205 //    fnmsubs    FPGeneral
206 //    fres       FPRes
207 //    frsp       FPGeneral
208 //    frsqrte    FPGeneral
209 //    fsel       FPGeneral
210 //    fsqrt      FPSqrt
211 //    fsqrts     FPSqrt
212 //    fsub       FPAddSub
213 //    fsubs      FPGeneral
214 //    icbi       LdStICBI
215 //    isync      SprISYNC
216 //    lbz        LdStLoad
217 //    lbzu       LdStLoadUpd
218 //    lbzux      LdStLoadUpd
219 //    lbzx       LdStLoad
220 //    ld         LdStLD
221 //    ldarx      LdStLDARX
222 //    ldu        LdStLDU
223 //    ldux       LdStLDU
224 //    ldx        LdStLD
225 //    lfd        LdStLFD
226 //    lfdu       LdStLFDU
227 //    lfdux      LdStLFDU
228 //    lfdx       LdStLFD
229 //    lfs        LdStLFD
230 //    lfsu       LdStLFDU
231 //    lfsux      LdStLFDU
232 //    lfsx       LdStLFD
233 //    lha        LdStLHA
234 //    lhau       LdStLHAU
235 //    lhaux      LdStLHAU
236 //    lhax       LdStLHA
237 //    lhbrx      LdStLoad
238 //    lhz        LdStLoad
239 //    lhzu       LdStLoadUpd
240 //    lhzux      LdStLoadUpd
241 //    lhzx       LdStLoad
242 //    lmw        LdStLMW
243 //    lswi       LdStLMW
244 //    lswx       LdStLMW
245 //    lvebx      LdStLVecX
246 //    lvehx      LdStLVecX
247 //    lvewx      LdStLVecX
248 //    lvsl       LdStLVecX
249 //    lvsr       LdStLVecX
250 //    lvx        LdStLVecX
251 //    lvxl       LdStLVecX
252 //    lwa        LdStLWA
253 //    lwarx      LdStLWARX
254 //    lwaux      LdStLHAU
255 //    lwax       LdStLHA
256 //    lwbrx      LdStLoad
257 //    lwz        LdStLoad
258 //    lwzu       LdStLoadUpd
259 //    lwzux      LdStLoadUpd
260 //    lwzx       LdStLoad
261 //    mcrf       BrMCR
262 //    mcrfs      FPGeneral
263 //    mcrxr      BrMCRX
264 //    mfcr       SprMFCR
265 //    mffs       IntMFFS
266 //    mfmsr      SprMFMSR
267 //    mfspr      SprMFSPR
268 //    mfsr       SprMFSR
269 //    mfsrin     SprMFSR
270 //    mftb       SprMFTB
271 //    mfvscr     IntMFVSCR
272 //    mtcrf      BrMCRX
273 //    mtfsb0     IntMTFSB0
274 //    mtfsb1     IntMTFSB0
275 //    mtfsf      IntMTFSB0
276 //    mtfsfi     IntMTFSB0
277 //    mtmsr      SprMTMSR
278 //    mtmsrd     LdStLD
279 //    mtspr      SprMTSPR
280 //    mtsr       SprMTSR
281 //    mtsrd      IntMTSRD
282 //    mtsrdin    IntMTSRD
283 //    mtsrin     SprMTSRIN
284 //    mtvscr     IntMFVSCR
285 //    mulhd      IntMulHD
286 //    mulhdu     IntMulHD
287 //    mulhw      IntMulHW
288 //    mulhwu     IntMulHWU
289 //    mulld      IntMulHD
290 //    mulli      IntMulLI
291 //    mullw      IntMulHW
292 //    nand       IntSimple
293 //    neg        IntSimple
294 //    nor        IntSimple
295 //    or         IntSimple
296 //    orc        IntSimple
297 //    ori        IntSimple
298 //    oris       IntSimple
299 //    rfi        SprRFI
300 //    rfid       IntRFID
301 //    rldcl      IntRotateD
302 //    rldcr      IntRotateD
303 //    rldic      IntRotateDI
304 //    rldicl     IntRotateDI
305 //    rldicr     IntRotateDI
306 //    rldimi     IntRotateDI
307 //    rlwimi     IntRotate
308 //    rlwinm     IntGeneral
309 //    rlwnm      IntGeneral
310 //    sc         SprSC
311 //    slbia      LdStSLBIA
312 //    slbie      LdStSLBIE
313 //    sld        IntRotateD
314 //    slw        IntGeneral
315 //    srad       IntRotateD
316 //    sradi      IntRotateDI
317 //    sraw       IntShift
318 //    srawi      IntShift
319 //    srd        IntRotateD
320 //    srw        IntGeneral
321 //    stb        LdStStore
322 //    stbu       LdStStoreUpd
323 //    stbux      LdStStoreUpd
324 //    stbx       LdStStore
325 //    std        LdStSTD
326 //    stdcx.     LdStSTDCX
327 //    stdu       LdStSTDU
328 //    stdux      LdStSTDU
329 //    stdx       LdStSTD
330 //    stfd       LdStSTFD
331 //    stfdu      LdStSTFDU
332 //    stfdux     LdStSTFDU
333 //    stfdx      LdStSTFD
334 //    stfiwx     LdStSTFD
335 //    stfs       LdStSTFD
336 //    stfsu      LdStSTFDU
337 //    stfsux     LdStSTFDU
338 //    stfsx      LdStSTFD
339 //    sth        LdStStore
340 //    sthbrx     LdStStore
341 //    sthu       LdStStoreUpd
342 //    sthux      LdStStoreUpd
343 //    sthx       LdStStore
344 //    stmw       LdStLMW
345 //    stswi      LdStLMW
346 //    stswx      LdStLMW
347 //    stvebx     LdStSTVEBX
348 //    stvehx     LdStSTVEBX
349 //    stvewx     LdStSTVEBX
350 //    stvx       LdStSTVEBX
351 //    stvxl      LdStSTVEBX
352 //    stw        LdStStore
353 //    stwbrx     LdStStore
354 //    stwcx.     LdStSTWCX
355 //    stwu       LdStStoreUpd
356 //    stwux      LdStStoreUpd
357 //    stwx       LdStStore
358 //    subf       IntGeneral
359 //    subfc      IntGeneral
360 //    subfe      IntGeneral
361 //    subfic     IntGeneral
362 //    subfme     IntGeneral
363 //    subfze     IntGeneral
364 //    sync       LdStSync
365 //    td         IntTrapD
366 //    tdi        IntTrapD
367 //    tlbia      LdStSLBIA
368 //    tlbie      LdStDCBF
369 //    tlbsync    SprTLBSYNC
370 //    tw         IntTrapW
371 //    twi        IntTrapW
372 //    vaddcuw    VecGeneral
373 //    vaddfp     VecFP
374 //    vaddsbs    VecGeneral
375 //    vaddshs    VecGeneral
376 //    vaddsws    VecGeneral
377 //    vaddubm    VecGeneral
378 //    vaddubs    VecGeneral
379 //    vadduhm    VecGeneral
380 //    vadduhs    VecGeneral
381 //    vadduwm    VecGeneral
382 //    vadduws    VecGeneral
383 //    vand       VecGeneral
384 //    vandc      VecGeneral
385 //    vavgsb     VecGeneral
386 //    vavgsh     VecGeneral
387 //    vavgsw     VecGeneral
388 //    vavgub     VecGeneral
389 //    vavguh     VecGeneral
390 //    vavguw     VecGeneral
391 //    vcfsx      VecFP
392 //    vcfux      VecFP
393 //    vcmpbfp    VecFPCompare
394 //    vcmpeqfp   VecFPCompare
395 //    vcmpequb   VecGeneral
396 //    vcmpequh   VecGeneral
397 //    vcmpequw   VecGeneral
398 //    vcmpgefp   VecFPCompare
399 //    vcmpgtfp   VecFPCompare
400 //    vcmpgtsb   VecGeneral
401 //    vcmpgtsh   VecGeneral
402 //    vcmpgtsw   VecGeneral
403 //    vcmpgtub   VecGeneral
404 //    vcmpgtuh   VecGeneral
405 //    vcmpgtuw   VecGeneral
406 //    vctsxs     VecFP
407 //    vctuxs     VecFP
408 //    vexptefp   VecFP
409 //    vlogefp    VecFP
410 //    vmaddfp    VecFP
411 //    vmaxfp     VecFPCompare
412 //    vmaxsb     VecGeneral
413 //    vmaxsh     VecGeneral
414 //    vmaxsw     VecGeneral
415 //    vmaxub     VecGeneral
416 //    vmaxuh     VecGeneral
417 //    vmaxuw     VecGeneral
418 //    vmhaddshs  VecComplex
419 //    vmhraddshs VecComplex
420 //    vminfp     VecFPCompare
421 //    vminsb     VecGeneral
422 //    vminsh     VecGeneral
423 //    vminsw     VecGeneral
424 //    vminub     VecGeneral
425 //    vminuh     VecGeneral
426 //    vminuw     VecGeneral
427 //    vmladduhm  VecComplex
428 //    vmrghb     VecPerm
429 //    vmrghh     VecPerm
430 //    vmrghw     VecPerm
431 //    vmrglb     VecPerm
432 //    vmrglh     VecPerm
433 //    vmrglw     VecPerm
434 //    vmsubfp    VecFP
435 //    vmsummbm   VecComplex
436 //    vmsumshm   VecComplex
437 //    vmsumshs   VecComplex
438 //    vmsumubm   VecComplex
439 //    vmsumuhm   VecComplex
440 //    vmsumuhs   VecComplex
441 //    vmulesb    VecComplex
442 //    vmulesh    VecComplex
443 //    vmuleub    VecComplex
444 //    vmuleuh    VecComplex
445 //    vmulosb    VecComplex
446 //    vmulosh    VecComplex
447 //    vmuloub    VecComplex
448 //    vmulouh    VecComplex
449 //    vnor       VecGeneral
450 //    vor        VecGeneral
451 //    vperm      VecPerm
452 //    vpkpx      VecPerm
453 //    vpkshss    VecPerm
454 //    vpkshus    VecPerm
455 //    vpkswss    VecPerm
456 //    vpkswus    VecPerm
457 //    vpkuhum    VecPerm
458 //    vpkuhus    VecPerm
459 //    vpkuwum    VecPerm
460 //    vpkuwus    VecPerm
461 //    vrefp      VecFPRound
462 //    vrfim      VecFPRound
463 //    vrfin      VecFPRound
464 //    vrfip      VecFPRound
465 //    vrfiz      VecFPRound
466 //    vrlb       VecGeneral
467 //    vrlh       VecGeneral
468 //    vrlw       VecGeneral
469 //    vrsqrtefp  VecFP
470 //    vsel       VecGeneral
471 //    vsl        VecVSL
472 //    vslb       VecGeneral
473 //    vsldoi     VecPerm
474 //    vslh       VecGeneral
475 //    vslo       VecPerm
476 //    vslw       VecGeneral
477 //    vspltb     VecPerm
478 //    vsplth     VecPerm
479 //    vspltisb   VecPerm
480 //    vspltish   VecPerm
481 //    vspltisw   VecPerm
482 //    vspltw     VecPerm
483 //    vsr        VecVSR
484 //    vsrab      VecGeneral
485 //    vsrah      VecGeneral
486 //    vsraw      VecGeneral
487 //    vsrb       VecGeneral
488 //    vsrh       VecGeneral
489 //    vsro       VecPerm
490 //    vsrw       VecGeneral
491 //    vsubcuw    VecGeneral
492 //    vsubfp     VecFP
493 //    vsubsbs    VecGeneral
494 //    vsubshs    VecGeneral
495 //    vsubsws    VecGeneral
496 //    vsububm    VecGeneral
497 //    vsububs    VecGeneral
498 //    vsubuhm    VecGeneral
499 //    vsubuhs    VecGeneral
500 //    vsubuwm    VecGeneral
501 //    vsubuws    VecGeneral
502 //    vsum2sws   VecComplex
503 //    vsum4sbs   VecComplex
504 //    vsum4shs   VecComplex
505 //    vsum4ubs   VecComplex
506 //    vsumsws    VecComplex
507 //    vupkhpx    VecPerm
508 //    vupkhsb    VecPerm
509 //    vupkhsh    VecPerm
510 //    vupklpx    VecPerm
511 //    vupklsb    VecPerm
512 //    vupklsh    VecPerm
513 //    vxor       VecGeneral
514 //    xor        IntSimple
515 //    xori       IntSimple
516 //    xoris      IntSimple
517 //