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