OSDN Git Service

* doc/invoke.texi: Add cpu_type power6x
[pf3gnuchains/gcc-fork.git] / gcc / config / rs6000 / 7xx.md
1 ;; Scheduling description for Motorola PowerPC 750 and PowerPC 7400 processors.
2 ;;   Copyright (C) 2003, 2004 Free Software Foundation, Inc.
3 ;;
4 ;; This file is part of GCC.
5
6 ;; GCC is free software; you can redistribute it and/or modify it
7 ;; under the terms of the GNU General Public License as published
8 ;; by the Free Software Foundation; either version 2, or (at your
9 ;; option) any later version.
10
11 ;; GCC is distributed in the hope that it will be useful, but WITHOUT
12 ;; ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
13 ;; or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public
14 ;; License for more details.
15
16 ;; You should have received a copy of the GNU General Public License
17 ;; along with GCC; see the file COPYING.  If not, write to the
18 ;; Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston,
19 ;; MA 02110-1301, USA.
20
21 (define_automaton "ppc7xx,ppc7xxfp")
22 (define_cpu_unit "iu1_7xx,iu2_7xx" "ppc7xx")
23 (define_cpu_unit "fpu_7xx" "ppc7xxfp")
24 (define_cpu_unit "lsu_7xx,bpu_7xx,sru_7xx" "ppc7xx")
25 (define_cpu_unit "du1_7xx,du2_7xx" "ppc7xx")
26 (define_cpu_unit "veccmplx_7xx,vecperm_7xx,vdu_7xx" "ppc7xx")
27
28 ;; PPC740/PPC750/PPC7400  32-bit 2xIU, LSU, SRU, FPU, BPU
29 ;; IU1 can perform all integer operations
30 ;; IU2 can perform all integer operations except imul and idiv
31 ;; LSU 2 stage pipelined
32 ;; FPU 3 stage pipelined
33 ;; Max issue 3 insns/clock cycle (includes 1 branch)
34 ;; In-order execution
35
36
37 ;; The PPC750 user's manual recommends that to reduce branch mispredictions,
38 ;; the insn that sets CR bits should be separated from the branch insn
39 ;; that evaluates them.  There is no advantage have more than 10 cycles
40 ;; of separation.
41 ;; This could be artificially achieved by exaggerating the latency of
42 ;; compare insns but at the expense of a poorer schedule.
43
44 ;; Branches go straight to the BPU.  All other insns are handled
45 ;; by a dispatch unit which can issue a max of 2 insns per cycle.
46 (define_reservation "ppc750_du" "du1_7xx|du2_7xx")
47 (define_reservation "ppc7400_vec_du" "vdu_7xx")
48
49 (define_insn_reservation "ppc750-load" 2
50   (and (eq_attr "type" "load,load_ext,load_ext_u,load_ext_ux,\
51                         load_ux,load_u,fpload,fpload_ux,fpload_u,\
52                         vecload,load_l")
53        (eq_attr "cpu" "ppc750,ppc7400"))
54   "ppc750_du,lsu_7xx")
55
56 (define_insn_reservation "ppc750-store" 2
57   (and (eq_attr "type" "store,store_ux,store_u,\
58                         fpstore,fpstore_ux,fpstore_u,vecstore")
59        (eq_attr "cpu" "ppc750,ppc7400"))
60   "ppc750_du,lsu_7xx")
61
62 (define_insn_reservation "ppc750-storec" 8
63   (and (eq_attr "type" "store_c")
64        (eq_attr "cpu" "ppc750,ppc7400"))
65   "ppc750_du,lsu_7xx")
66
67 (define_insn_reservation "ppc750-integer" 1
68   (and (eq_attr "type" "integer,insert_word,insert_dword,shift,\
69                         trap,var_shift_rotate,cntlz,exts")
70        (eq_attr "cpu" "ppc750,ppc7400"))
71   "ppc750_du,iu1_7xx|iu2_7xx")
72
73 (define_insn_reservation "ppc750-two" 1
74   (and (eq_attr "type" "two")
75        (eq_attr "cpu" "ppc750,ppc7400"))
76   "ppc750_du,iu1_7xx|iu2_7xx,iu1_7xx|iu2_7xx")
77
78 (define_insn_reservation "ppc750-three" 1
79   (and (eq_attr "type" "three")
80        (eq_attr "cpu" "ppc750,ppc7400"))
81   "ppc750_du,iu1_7xx|iu2_7xx,iu1_7xx|iu2_7xx,iu1_7xx|iu2_7xx")
82
83 (define_insn_reservation "ppc750-imul" 4
84   (and (eq_attr "type" "imul,imul_compare")
85        (eq_attr "cpu" "ppc750,ppc7400"))
86   "ppc750_du,iu1_7xx*4")
87
88 (define_insn_reservation "ppc750-imul2" 3
89   (and (eq_attr "type" "imul2")
90        (eq_attr "cpu" "ppc750,ppc7400"))
91   "ppc750_du,iu1_7xx*2")
92
93 (define_insn_reservation "ppc750-imul3" 2
94   (and (eq_attr "type" "imul3")
95        (eq_attr "cpu" "ppc750,ppc7400"))
96   "ppc750_du,iu1_7xx")
97
98 (define_insn_reservation "ppc750-idiv" 19
99   (and (eq_attr "type" "idiv")
100        (eq_attr "cpu" "ppc750,ppc7400"))
101   "ppc750_du,iu1_7xx*19")
102
103 (define_insn_reservation "ppc750-compare" 2
104   (and (eq_attr "type" "cmp,fast_compare,compare,delayed_compare,\
105                         var_delayed_compare")
106        (eq_attr "cpu" "ppc750,ppc7400"))
107   "ppc750_du,(iu1_7xx|iu2_7xx)")
108
109 (define_insn_reservation "ppc750-fpcompare" 2
110   (and (eq_attr "type" "fpcompare")
111        (eq_attr "cpu" "ppc750,ppc7400"))
112   "ppc750_du,fpu_7xx")
113
114 (define_insn_reservation "ppc750-fp" 3
115   (and (eq_attr "type" "fp")
116        (eq_attr "cpu" "ppc750,ppc7400"))
117   "ppc750_du,fpu_7xx")
118
119 (define_insn_reservation "ppc750-dmul" 4
120   (and (eq_attr "type" "dmul")
121        (eq_attr "cpu" "ppc750"))
122   "ppc750_du,fpu_7xx*2")
123
124 (define_insn_reservation "ppc7400-dmul" 3
125   (and (eq_attr "type" "dmul")
126        (eq_attr "cpu" "ppc7400"))
127   "ppc750_du,fpu_7xx")
128
129 ; Divides are not pipelined
130 (define_insn_reservation "ppc750-sdiv" 17
131   (and (eq_attr "type" "sdiv")
132        (eq_attr "cpu" "ppc750,ppc7400"))
133   "ppc750_du,fpu_7xx*17")
134
135 (define_insn_reservation "ppc750-ddiv" 31
136   (and (eq_attr "type" "ddiv")
137        (eq_attr "cpu" "ppc750,ppc7400"))
138   "ppc750_du,fpu_7xx*31")
139
140 (define_insn_reservation "ppc750-mfcr" 2
141   (and (eq_attr "type" "mfcr,mtcr")
142        (eq_attr "cpu" "ppc750,ppc7400"))
143   "ppc750_du,iu1_7xx")
144
145 (define_insn_reservation "ppc750-crlogical" 3
146   (and (eq_attr "type" "cr_logical,delayed_cr")
147        (eq_attr "cpu" "ppc750,ppc7400"))
148   "nothing,sru_7xx*2")
149
150 (define_insn_reservation "ppc750-mtjmpr" 2
151   (and (eq_attr "type" "mtjmpr,isync,sync")
152        (eq_attr "cpu" "ppc750,ppc7400"))
153   "nothing,sru_7xx*2")
154
155 (define_insn_reservation "ppc750-mfjmpr" 3
156   (and (eq_attr "type" "mfjmpr")
157        (eq_attr "cpu" "ppc750,ppc7400"))
158   "nothing,sru_7xx*2")
159
160 (define_insn_reservation "ppc750-jmpreg" 1
161   (and (eq_attr "type" "jmpreg,branch,isync")
162        (eq_attr "cpu" "ppc750,ppc7400"))
163   "nothing,bpu_7xx")
164
165 ;; Altivec
166 (define_insn_reservation "ppc7400-vecsimple" 1
167   (and (eq_attr "type" "vecsimple,veccmp")
168        (eq_attr "cpu" "ppc7400"))
169   "ppc750_du,ppc7400_vec_du,veccmplx_7xx")
170
171 (define_insn_reservation "ppc7400-veccomplex" 4
172   (and (eq_attr "type" "veccomplex")
173        (eq_attr "cpu" "ppc7400"))
174   "ppc750_du,ppc7400_vec_du,veccmplx_7xx")
175
176 (define_insn_reservation "ppc7400-vecfloat" 4
177   (and (eq_attr "type" "vecfloat")
178        (eq_attr "cpu" "ppc7400"))
179   "ppc750_du,ppc7400_vec_du,veccmplx_7xx")
180
181 (define_insn_reservation "ppc7400-vecperm" 2
182   (and (eq_attr "type" "vecperm")
183        (eq_attr "cpu" "ppc7400"))
184   "ppc750_du,ppc7400_vec_du,vecperm_7xx")
185