rs6000.h (processor_type): Add PPC440.
[platform/upstream/gcc.git] / gcc / config / rs6000 / 7xx.md
1 (define_automaton "ppc7xx,ppc7xxfp,ppc7xxother,ppc7xxvec")
2 (define_cpu_unit "iu1_7xx,iu2_7xx" "ppc7xx")
3 (define_cpu_unit "fpu_7xx" "ppc7xxfp")
4 (define_cpu_unit "lsu_7xx,bpu_7xx,sru_7xx" "ppc7xxother")
5 (define_cpu_unit "du1_7xx,du2_7xx" "ppc7xx")
6 (define_cpu_unit "veccmplx_7xx,vecperm_7xx,vdu_7xx" "ppc7xxvec")
7
8 ;; PPC740/PPC750/PPC7400  32-bit 2xIU, LSU, SRU, FPU, BPU
9 ;; IU1 can perform all integer operations
10 ;; IU2 can perform all integer operations except imul and idiv
11 ;; LSU 2 stage pipelined
12 ;; FPU 3 stage pipelined
13 ;; Max issue 3 insns/clock cycle (includes 1 branch)
14 ;; In-order execution
15
16
17 ;; The PPC750 user's manual recommends that to reduce branch mispredictions,
18 ;; the insn that sets CR bits should be separated from the branch insn
19 ;; that evaluates them.  There is no advantage have more than 10 cycles
20 ;; of separation.
21 ;; This could be artificially achieved by exagerating the latency of
22 ;; compare insns but at the expense of a poorer schedule.
23
24 ;; Branches go straight to the BPU.  All other insns are handled
25 ;; by a dispatch unit which can issue a max of 2 insns per cycle.
26 (define_reservation "ppc750_du" "du1_7xx|du2_7xx")
27 (define_reservation "ppc7400_vec_du" "vdu_7xx")
28
29 (define_insn_reservation "ppc750-load" 2
30   (and (eq_attr "type" "load,load_ext,load_ext_u,load_ext_ux,\
31                         load_ux,load_u,fpload,fpload_ux,fpload_u,vecload")
32        (eq_attr "cpu" "ppc750,ppc7400"))
33   "ppc750_du,lsu_7xx")
34
35 (define_insn_reservation "ppc750-store" 1
36   (and (eq_attr "type" "store,store_ux,store_u,\
37                         fpstore,fpstore_ux,fpstore_u,vecstore")
38        (eq_attr "cpu" "ppc750,ppc7400"))
39   "ppc750_du,lsu_7xx")
40
41 (define_insn_reservation "ppc750-integer" 1
42   (and (eq_attr "type" "integer")
43        (eq_attr "cpu" "ppc750,ppc7400"))
44   "ppc750_du,(iu1_7xx|iu2_7xx)")
45
46 (define_insn_reservation "ppc750-imul" 4
47   (and (eq_attr "type" "imul")
48        (eq_attr "cpu" "ppc750,ppc7400"))
49   "ppc750_du,iu1_7xx*4")
50
51 (define_insn_reservation "ppc750-imul2" 3
52   (and (eq_attr "type" "imul2")
53        (eq_attr "cpu" "ppc750,ppc7400"))
54   "ppc750_du,iu1_7xx*2")
55
56 (define_insn_reservation "ppc750-imul3" 2
57   (and (eq_attr "type" "imul3")
58        (eq_attr "cpu" "ppc750,ppc7400"))
59   "ppc750_du,iu1_7xx")
60
61 (define_insn_reservation "ppc750-idiv" 19
62   (and (eq_attr "type" "idiv")
63        (eq_attr "cpu" "ppc750,ppc7400"))
64   "ppc750_du,iu1_7xx*19")
65
66 (define_insn_reservation "ppc750-compare" 2
67   (and (eq_attr "type" "cmp,compare,delayed_compare")
68        (eq_attr "cpu" "ppc750,ppc7400"))
69   "ppc750_du,(iu1_7xx|iu2_7xx)")
70
71 (define_insn_reservation "ppc750-fpcompare" 2
72   (and (eq_attr "type" "fpcompare")
73        (eq_attr "cpu" "ppc750,ppc7400"))
74   "ppc750_du,fpu_7xx")
75
76 (define_insn_reservation "ppc750-fp" 3
77   (and (eq_attr "type" "fp")
78        (eq_attr "cpu" "ppc750,ppc7400"))
79   "ppc750_du,fpu_7xx")
80
81 (define_insn_reservation "ppc750-dmul" 4
82   (and (eq_attr "type" "dmul")
83        (eq_attr "cpu" "ppc750"))
84   "ppc750_du,fpu_7xx*2")
85
86 (define_insn_reservation "ppc7400-dmul" 3
87   (and (eq_attr "type" "dmul")
88        (eq_attr "cpu" "ppc7400"))
89   "ppc750_du,fpu_7xx")
90
91 ; Divides are not pipelined
92 (define_insn_reservation "ppc750-sdiv" 17
93   (and (eq_attr "type" "sdiv")
94        (eq_attr "cpu" "ppc750,ppc7400"))
95   "ppc750_du,fpu_7xx*17")
96
97 (define_insn_reservation "ppc750-ddiv" 31
98   (and (eq_attr "type" "ddiv")
99        (eq_attr "cpu" "ppc750,ppc7400"))
100   "ppc750_du,fpu_7xx*31")
101
102 (define_insn_reservation "ppc750-mfcr" 2
103   (and (eq_attr "type" "mfcr,mtcr")
104        (eq_attr "cpu" "ppc750,ppc7400"))
105   "ppc750_du,iu1_7xx")
106
107 (define_insn_reservation "ppc750-crlogical" 3
108   (and (eq_attr "type" "cr_logical,delayed_cr")
109        (eq_attr "cpu" "ppc750,ppc7400"))
110   "ppc750_du,sru_7xx*2")
111
112 (define_insn_reservation "ppc750-mtjmpr" 2
113   (and (eq_attr "type" "mtjmpr")
114        (eq_attr "cpu" "ppc750,ppc7400"))
115   "nothing,sru_7xx*2")
116
117 (define_insn_reservation "ppc750-jmpreg" 1
118   (and (eq_attr "type" "jmpreg,branch")
119        (eq_attr "cpu" "ppc750,ppc7400"))
120   "nothing,bpu_7xx")
121
122 ;; Altivec
123 (define_insn_reservation "ppc7400-vecsimple" 1
124   (and (eq_attr "type" "vecsimple,veccmp")
125        (eq_attr "cpu" "ppc7400"))
126   "ppc750_du,ppc7400_vec_du,veccmplx_7xx")
127
128 (define_insn_reservation "ppc7400-veccomplex" 4
129   (and (eq_attr "type" "veccomplex")
130        (eq_attr "cpu" "ppc7400"))
131   "ppc750_du,ppc7400_vec_du,veccmplx_7xx")
132
133 (define_insn_reservation "ppc7400-vecfloat" 4
134   (and (eq_attr "type" "vecfloat")
135        (eq_attr "cpu" "ppc7400"))
136   "ppc750_du,ppc7400_vec_du,veccmplx_7xx")
137
138 (define_insn_reservation "ppc7400-vecperm" 2
139   (and (eq_attr "type" "vecperm")
140        (eq_attr "cpu" "ppc7400"))
141   "ppc750_du,ppc7400_vec_du,vecperm_7xx")
142