1;; Scheduling description for IBM POWER processor.
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 "rios1,rios1fp")
22(define_cpu_unit "iu_rios1" "rios1")
23(define_cpu_unit "fpu_rios1" "rios1fp")
24(define_cpu_unit "bpu_rios1" "rios1")
25
26;; RIOS1  32-bit IU, FPU, BPU
27
28(define_insn_reservation "rios1-load" 2
29  (and (eq_attr "type" "load,load_ext,load_ext_u,load_ext_ux,load_ux,load_u,\
30		        load_l,store_c,sync")
31       (eq_attr "cpu" "rios1,ppc601"))
32  "iu_rios1")
33
34(define_insn_reservation "rios1-store" 2
35  (and (eq_attr "type" "store,store_ux,store_u")
36       (eq_attr "cpu" "rios1,ppc601"))
37  "iu_rios1")
38
39(define_insn_reservation "rios1-fpload" 2
40  (and (eq_attr "type" "fpload,fpload_ux,fpload_u")
41       (eq_attr "cpu" "rios1"))
42  "iu_rios1")
43
44(define_insn_reservation "ppc601-fpload" 3
45  (and (eq_attr "type" "fpload,fpload_ux,fpload_u")
46       (eq_attr "cpu" "ppc601"))
47  "iu_rios1")
48
49(define_insn_reservation "rios1-fpstore" 3
50  (and (eq_attr "type" "fpstore,fpstore_ux,fpstore_u")
51       (eq_attr "cpu" "rios1,ppc601"))
52  "iu_rios1+fpu_rios1")
53
54(define_insn_reservation "rios1-integer" 1
55  (and (eq_attr "type" "integer,insert_word")
56       (eq_attr "cpu" "rios1,ppc601"))
57  "iu_rios1")
58
59(define_insn_reservation "rios1-two" 1
60  (and (eq_attr "type" "two")
61       (eq_attr "cpu" "rios1,ppc601"))
62  "iu_rios1,iu_rios1")
63
64(define_insn_reservation "rios1-three" 1
65  (and (eq_attr "type" "three")
66       (eq_attr "cpu" "rios1,ppc601"))
67  "iu_rios1,iu_rios1,iu_rios1")
68
69(define_insn_reservation "rios1-imul" 5
70  (and (eq_attr "type" "imul,imul_compare")
71       (eq_attr "cpu" "rios1"))
72  "iu_rios1*5")
73
74(define_insn_reservation "rios1-imul2" 4
75  (and (eq_attr "type" "imul2")
76       (eq_attr "cpu" "rios1"))
77  "iu_rios1*4")
78
79(define_insn_reservation "rios1-imul3" 3
80  (and (eq_attr "type" "imul")
81       (eq_attr "cpu" "rios1"))
82  "iu_rios1*3")
83
84(define_insn_reservation "ppc601-imul" 5
85  (and (eq_attr "type" "imul,imul2,imul3,imul_compare")
86       (eq_attr "cpu" "ppc601"))
87  "iu_rios1*5")
88
89(define_insn_reservation "rios1-idiv" 19
90  (and (eq_attr "type" "idiv")
91       (eq_attr "cpu" "rios1"))
92  "iu_rios1*19")
93
94(define_insn_reservation "ppc601-idiv" 36
95  (and (eq_attr "type" "idiv")
96       (eq_attr "cpu" "ppc601"))
97  "iu_rios1*36")
98
99; compare executes on integer unit, but feeds insns which
100; execute on the branch unit.
101(define_insn_reservation "rios1-compare" 4
102  (and (eq_attr "type" "cmp,fast_compare,compare")
103       (eq_attr "cpu" "rios1"))
104  "iu_rios1,nothing*2,bpu_rios1")
105
106(define_insn_reservation "rios1-delayed_compare" 5
107  (and (eq_attr "type" "delayed_compare")
108       (eq_attr "cpu" "rios1"))
109  "iu_rios1,nothing*3,bpu_rios1")
110
111(define_insn_reservation "ppc601-compare" 3
112  (and (eq_attr "type" "cmp,compare,delayed_compare")
113       (eq_attr "cpu" "ppc601"))
114  "iu_rios1,nothing,bpu_rios1")
115
116(define_insn_reservation "rios1-fpcompare" 9
117  (and (eq_attr "type" "fpcompare")
118       (eq_attr "cpu" "rios1"))
119  "fpu_rios1,nothing*3,bpu_rios1")
120
121(define_insn_reservation "ppc601-fpcompare" 5
122  (and (eq_attr "type" "fpcompare")
123       (eq_attr "cpu" "ppc601"))
124  "(fpu_rios1+iu_rios1*2),nothing*2,bpu_rios1")
125
126(define_insn_reservation "rios1-fp" 2
127  (and (eq_attr "type" "fp,dmul")
128       (eq_attr "cpu" "rios1"))
129  "fpu_rios1")
130
131(define_insn_reservation "ppc601-fp" 4
132  (and (eq_attr "type" "fp")
133       (eq_attr "cpu" "ppc601"))
134  "fpu_rios1")
135
136(define_insn_reservation "rios1-dmul" 5
137  (and (eq_attr "type" "dmul")
138       (eq_attr "cpu" "ppc601"))
139  "fpu_rios1*2")
140
141(define_insn_reservation "rios1-sdiv" 19
142  (and (eq_attr "type" "sdiv,ddiv")
143       (eq_attr "cpu" "rios1"))
144  "fpu_rios1*19")
145
146(define_insn_reservation "ppc601-sdiv" 17
147  (and (eq_attr "type" "sdiv")
148       (eq_attr "cpu" "ppc601"))
149  "fpu_rios1*17")
150
151(define_insn_reservation "ppc601-ddiv" 31
152  (and (eq_attr "type" "ddiv")
153       (eq_attr "cpu" "ppc601"))
154  "fpu_rios1*31")
155
156(define_insn_reservation "rios1-mfcr" 2
157  (and (eq_attr "type" "mfcr")
158       (eq_attr "cpu" "rios1,ppc601"))
159  "iu_rios1,bpu_rios1")
160
161(define_insn_reservation "rios1-mtcr" 4
162  (and (eq_attr "type" "mtcr")
163       (eq_attr "cpu" "rios1,ppc601"))
164  "iu_rios1,bpu_rios1")
165
166(define_insn_reservation "rios1-crlogical" 4
167  (and (eq_attr "type" "cr_logical,delayed_cr")
168       (eq_attr "cpu" "rios1,ppc601"))
169  "bpu_rios1")
170
171(define_insn_reservation "rios1-mtjmpr" 5
172  (and (eq_attr "type" "mtjmpr")
173       (eq_attr "cpu" "rios1"))
174  "iu_rios1,bpu_rios1")
175
176(define_insn_reservation "ppc601-mtjmpr" 4
177  (and (eq_attr "type" "mtjmpr")
178       (eq_attr "cpu" "ppc601"))
179  "iu_rios1,bpu_rios1")
180
181(define_insn_reservation "rios1-mfjmpr" 2
182  (and (eq_attr "type" "mfjmpr")
183       (eq_attr "cpu" "rios1,ppc601"))
184  "iu_rios1,bpu_rios1")
185
186(define_insn_reservation "rios1-branch" 1
187  (and (eq_attr "type" "jmpreg,branch,isync")
188       (eq_attr "cpu" "rios1,ppc601"))
189  "bpu_rios1")
190
191