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