OSDN Git Service

* config/rs6000/{603.md,6xx.md,7450.md,7xx.md,rs64.md}: Decrease
[pf3gnuchains/gcc-fork.git] / gcc / config / rs6000 / 7xx.md
1 ;; Scheduling description for Motorola PowerPC 750 and PowerPC 7400 processors.
2 ;;   Copyright (C) 2003 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, 59 Temple Place - Suite 330, Boston,
19 ;; MA 02111-1307, 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 exagerating 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,vecload")
52        (eq_attr "cpu" "ppc750,ppc7400"))
53   "ppc750_du,lsu_7xx")
54
55 (define_insn_reservation "ppc750-store" 1
56   (and (eq_attr "type" "store,store_ux,store_u,\
57                         fpstore,fpstore_ux,fpstore_u,vecstore")
58        (eq_attr "cpu" "ppc750,ppc7400"))
59   "ppc750_du,lsu_7xx")
60
61 (define_insn_reservation "ppc750-integer" 1
62   (and (eq_attr "type" "integer")
63        (eq_attr "cpu" "ppc750,ppc7400"))
64   "ppc750_du,(iu1_7xx|iu2_7xx)")
65
66 (define_insn_reservation "ppc750-imul" 4
67   (and (eq_attr "type" "imul,imul_compare")
68        (eq_attr "cpu" "ppc750,ppc7400"))
69   "ppc750_du,iu1_7xx*4")
70
71 (define_insn_reservation "ppc750-imul2" 3
72   (and (eq_attr "type" "imul2")
73        (eq_attr "cpu" "ppc750,ppc7400"))
74   "ppc750_du,iu1_7xx*2")
75
76 (define_insn_reservation "ppc750-imul3" 2
77   (and (eq_attr "type" "imul3")
78        (eq_attr "cpu" "ppc750,ppc7400"))
79   "ppc750_du,iu1_7xx")
80
81 (define_insn_reservation "ppc750-idiv" 19
82   (and (eq_attr "type" "idiv")
83        (eq_attr "cpu" "ppc750,ppc7400"))
84   "ppc750_du,iu1_7xx*19")
85
86 (define_insn_reservation "ppc750-compare" 2
87   (and (eq_attr "type" "cmp,fast_compare,compare,delayed_compare")
88        (eq_attr "cpu" "ppc750,ppc7400"))
89   "ppc750_du,(iu1_7xx|iu2_7xx)")
90
91 (define_insn_reservation "ppc750-fpcompare" 2
92   (and (eq_attr "type" "fpcompare")
93        (eq_attr "cpu" "ppc750,ppc7400"))
94   "ppc750_du,fpu_7xx")
95
96 (define_insn_reservation "ppc750-fp" 3
97   (and (eq_attr "type" "fp")
98        (eq_attr "cpu" "ppc750,ppc7400"))
99   "ppc750_du,fpu_7xx")
100
101 (define_insn_reservation "ppc750-dmul" 4
102   (and (eq_attr "type" "dmul")
103        (eq_attr "cpu" "ppc750"))
104   "ppc750_du,fpu_7xx*2")
105
106 (define_insn_reservation "ppc7400-dmul" 3
107   (and (eq_attr "type" "dmul")
108        (eq_attr "cpu" "ppc7400"))
109   "ppc750_du,fpu_7xx")
110
111 ; Divides are not pipelined
112 (define_insn_reservation "ppc750-sdiv" 17
113   (and (eq_attr "type" "sdiv")
114        (eq_attr "cpu" "ppc750,ppc7400"))
115   "ppc750_du,fpu_7xx*17")
116
117 (define_insn_reservation "ppc750-ddiv" 31
118   (and (eq_attr "type" "ddiv")
119        (eq_attr "cpu" "ppc750,ppc7400"))
120   "ppc750_du,fpu_7xx*31")
121
122 (define_insn_reservation "ppc750-mfcr" 2
123   (and (eq_attr "type" "mfcr,mtcr")
124        (eq_attr "cpu" "ppc750,ppc7400"))
125   "ppc750_du,iu1_7xx")
126
127 (define_insn_reservation "ppc750-crlogical" 3
128   (and (eq_attr "type" "cr_logical,delayed_cr")
129        (eq_attr "cpu" "ppc750,ppc7400"))
130   "ppc750_du,sru_7xx*2")
131
132 (define_insn_reservation "ppc750-mtjmpr" 2
133   (and (eq_attr "type" "mtjmpr")
134        (eq_attr "cpu" "ppc750,ppc7400"))
135   "nothing,sru_7xx*2")
136
137 (define_insn_reservation "ppc750-mfjmpr" 3
138   (and (eq_attr "type" "mfjmpr")
139        (eq_attr "cpu" "ppc750,ppc7400"))
140   "nothing,sru_7xx*2")
141
142 (define_insn_reservation "ppc750-jmpreg" 1
143   (and (eq_attr "type" "jmpreg,branch")
144        (eq_attr "cpu" "ppc750,ppc7400"))
145   "nothing,bpu_7xx")
146
147 ;; Altivec
148 (define_insn_reservation "ppc7400-vecsimple" 1
149   (and (eq_attr "type" "vecsimple,veccmp")
150        (eq_attr "cpu" "ppc7400"))
151   "ppc750_du,ppc7400_vec_du,veccmplx_7xx")
152
153 (define_insn_reservation "ppc7400-veccomplex" 4
154   (and (eq_attr "type" "veccomplex")
155        (eq_attr "cpu" "ppc7400"))
156   "ppc750_du,ppc7400_vec_du,veccmplx_7xx")
157
158 (define_insn_reservation "ppc7400-vecfloat" 4
159   (and (eq_attr "type" "vecfloat")
160        (eq_attr "cpu" "ppc7400"))
161   "ppc750_du,ppc7400_vec_du,veccmplx_7xx")
162
163 (define_insn_reservation "ppc7400-vecperm" 2
164   (and (eq_attr "type" "vecperm")
165        (eq_attr "cpu" "ppc7400"))
166   "ppc750_du,ppc7400_vec_du,vecperm_7xx")
167