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