1 ;; Scheduling description for z196 (cpu 2817).
3 ;; Free Software Foundation, Inc.
4 ;; Contributed by Christian Borntraeger (Christian.Borntraeger@de.ibm.com)
5 ;; Andreas Krebbel (Andreas.Krebbel@de.ibm.com)
7 ;; This file is part of GCC.
9 ;; GCC is free software; you can redistribute it and/or modify it under
10 ;; the terms of the GNU General Public License as published by the Free
11 ;; Software Foundation; either version 3, or (at your option) any later
14 ;; GCC is distributed in the hope that it will be useful, but WITHOUT ANY
15 ;; WARRANTY; without even the implied warranty of MERCHANTABILITY or
16 ;; FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
19 ;; You should have received a copy of the GNU General Public License
20 ;; along with GCC; see the file COPYING3. If not see
21 ;; <http://www.gnu.org/licenses/>.
23 (define_automaton "z196_ipu")
26 (define_cpu_unit "z196_g1" "z196_ipu")
27 (define_cpu_unit "z196_g2" "z196_ipu")
28 (define_cpu_unit "z196_g3" "z196_ipu")
29 (define_cpu_unit "z196_cr1" "z196_ipu")
30 (define_cpu_unit "z196_cr2" "z196_ipu")
31 (define_cpu_unit "z196_cr3" "z196_ipu")
33 (final_presence_set "z196_g2" "z196_g1")
34 (final_presence_set "z196_g3" "z196_g2")
35 (final_presence_set "z196_cr2" "z196_cr1")
36 (final_presence_set "z196_cr3" "z196_cr2")
37 (exclusion_set "z196_g1" "z196_cr1")
39 ;; Instructions can be groupable, end a group, or be alone in a group.
40 (define_reservation "z196_simple" "( z196_g1 | z196_g2 | z196_g3 )")
41 (define_reservation "z196_ends" "( z196_g3 | ( z196_g2 + z196_g3 ) | ( z196_g1 + z196_g2 + z196_g3 ) )")
43 ;; Try to keep cracked and alone insns together in a clump. This will also
44 ;; improve the clumping of "normal" insns. We also allow crackes insns
45 ;; to go as a last instruction together with normal ones.
46 (define_reservation "z196_crack" "( z196_cr1 | z196_cr2 | z196_cr3 | z196_g3)")
47 (define_reservation "z196_alone" "( z196_cr1 | z196_cr2 | z196_cr3 )")
49 ;; Most simple instruction a fast enough to be handled by OOO even with
50 ;; latency == 0. This reduces life ranges and spilling. We want to increase
51 ;; life range for longer running ops, though, thats why we do not use
52 ;; -fno-schedule-insns.
53 (define_insn_reservation "z196_simple_LSU" 0
54 (and (eq_attr "cpu" "z196")
55 (and (eq_attr "type" "load,store,lr")
56 (eq_attr "z196prop" "none")))
59 (define_insn_reservation "z196_simple_FXU" 0
60 (and (eq_attr "cpu" "z196")
61 (and (eq_attr "type" "integer,la,larl,other")
62 (and (eq_attr "z196prop" "none")
63 (eq_attr "op_type" "RR"))))
66 (define_insn_reservation "z196_simple_DUAL" 0
67 (and (eq_attr "cpu" "z196")
68 (and (eq_attr "type" "integer,la,larl,other")
69 (and (eq_attr "z196prop" "none")
70 (eq_attr "op_type" "!RR"))))
73 (define_insn_reservation "z196_cracked" 0
74 (and (eq_attr "cpu" "z196")
75 (and (eq_attr "type" "integer,la,larl,load,lr,store,other")
76 (eq_attr "z196prop" "z196_cracked")))
79 (define_insn_reservation "z196_alone" 0
80 (and (eq_attr "cpu" "z196")
81 (and (eq_attr "type" "integer,la,larl,load,lr,store,other")
82 (eq_attr "z196prop" "z196_alone")))
85 (define_insn_reservation "z196_ends" 0
86 (and (eq_attr "cpu" "z196")
87 (and (eq_attr "type" "integer,la,larl,load,lr,store,other")
88 (eq_attr "z196prop" "z196_ends")))
91 (define_insn_reservation "z196_branch" 0
92 (and (eq_attr "cpu" "z196")
93 (eq_attr "type" "branch"))
96 (define_insn_reservation "z196_call" 0
97 (and (eq_attr "cpu" "z196")
98 (eq_attr "type" "jsr"))
101 (define_insn_reservation "z196_mul_hi" 10
102 (and (eq_attr "cpu" "z196")
103 (eq_attr "type" "imulhi"))
106 (define_insn_reservation "z196_mul_si" 12
107 (and (eq_attr "cpu" "z196")
108 (eq_attr "type" "imulsi"))
111 (define_insn_reservation "z196_mul_di" 14
112 (and (eq_attr "cpu" "z196")
113 (eq_attr "type" "imuldi"))
116 (define_insn_reservation "z196_div" 73
117 (and (eq_attr "cpu" "z196")
118 (eq_attr "type" "idiv"))
121 (define_insn_reservation "z196_sem" 0
122 (and (eq_attr "cpu" "z196")
123 (eq_attr "type" "sem"))
126 (define_insn_reservation "z196_cs" 0
127 (and (eq_attr "cpu" "z196")
128 (eq_attr "type" "cs"))
131 (define_insn_reservation "z196_vs" 0
132 (and (eq_attr "cpu" "z196")
133 (eq_attr "type" "vs"))
136 (define_insn_reservation "z196_lm_stm" 0
137 (and (eq_attr "cpu" "z196")
138 (eq_attr "type" "stm,lm"))
143 ;; Binary Floating Point
146 (define_insn_reservation "z196_fsimptf" 18
147 (and (eq_attr "cpu" "z196")
148 (eq_attr "type" "fsimptf,fhex"))
151 (define_insn_reservation "z196_fmultf" 47
152 (and (eq_attr "cpu" "z196")
153 (eq_attr "type" "fmultf"))
156 (define_insn_reservation "z196_fsimpdf" 7
157 (and (eq_attr "cpu" "z196")
158 (eq_attr "type" "fsimpdf,fmuldf,fhex"))
161 (define_insn_reservation "z196_fmadddf" 7
162 (and (eq_attr "cpu" "z196")
163 (eq_attr "type" "fmadddf"))
166 (define_insn_reservation "z196_fsimpsf" 7
167 (and (eq_attr "cpu" "z196")
168 (eq_attr "type" "fsimpsf,fmulsf,fhex"))
171 (define_insn_reservation "z196_fmaddsf" 7
172 (and (eq_attr "cpu" "z196")
173 (eq_attr "type" "fmaddsf"))
176 (define_insn_reservation "z196_fdivtf" 108
177 (and (eq_attr "cpu" "z196")
178 (eq_attr "type" "fdivtf,fsqrttf"))
181 (define_insn_reservation "z196_fdivdf" 36
182 (and (eq_attr "cpu" "z196")
183 (eq_attr "type" "fdivdf,fsqrtdf"))
186 (define_insn_reservation "z196_fdivsf" 29
187 (and (eq_attr "cpu" "z196")
188 (eq_attr "type" "fdivsf,fsqrtsf"))
192 ;; Loads and stores are cheap as well.
193 (define_insn_reservation "z196_floaddf" 0
194 (and (eq_attr "cpu" "z196")
195 (eq_attr "type" "floaddf"))
198 (define_insn_reservation "z196_floadsf" 0
199 (and (eq_attr "cpu" "z196")
200 (eq_attr "type" "floadsf"))
203 (define_insn_reservation "z196_fstoredf" 0
204 (and (eq_attr "cpu" "z196")
205 (eq_attr "type" "fstoredf"))
208 (define_insn_reservation "z196_fstoresf" 0
209 (and (eq_attr "cpu" "z196")
210 (eq_attr "type" "fstoresf"))
214 (define_insn_reservation "z196_ftrunctf" 9
215 (and (eq_attr "cpu" "z196")
216 (eq_attr "type" "ftrunctf"))
219 (define_insn_reservation "z196_ftruncdf" 7
220 (and (eq_attr "cpu" "z196")
221 (eq_attr "type" "ftruncdf"))
225 (define_insn_reservation "z196_ftoi" 7
226 (and (eq_attr "cpu" "z196")
227 (eq_attr "type" "ftoi"))
230 (define_insn_reservation "z196_itof" 7
231 (and (eq_attr "cpu" "z196")
232 (eq_attr "type" "itoftf,itofdf,itofsf"))
236 ;; Decimal Floating Point
240 (define_insn_reservation "z196_fdivdd" 33
241 (and (eq_attr "cpu" "z196")
242 (eq_attr "type" "fdivdd"))
246 (define_insn_reservation "z196_fdivtd" 35
247 (and (eq_attr "cpu" "z196")
248 (eq_attr "type" "fdivtd"))
252 (define_insn_reservation "z196_ftruncsd" 34
253 (and (eq_attr "cpu" "z196")
254 (eq_attr "type" "ftruncsd"))
258 (define_insn_reservation "z196_ftruncdd" 36
259 (and (eq_attr "cpu" "z196")
260 (eq_attr "type" "ftruncdd"))
263 ;; These are normal fp loads/stores - which are cheap.
264 (define_insn_reservation "z196_floadsddd" 0
265 (and (eq_attr "cpu" "z196")
266 (eq_attr "type" "floadsd,floaddd,fstoredd,fstoresd"))
270 (define_insn_reservation "z196_fmuldd" 23
271 (and (eq_attr "cpu" "z196")
272 (eq_attr "type" "fmuldd"))
276 (define_insn_reservation "z196_fmultd" 25
277 (and (eq_attr "cpu" "z196")
278 (eq_attr "type" "fmultd"))
281 ;; multiple different isns like add, sub etc.
282 ;; Just use the same defaults as z10.
283 (define_insn_reservation "z196_fsimpsd" 17
284 (and (eq_attr "cpu" "z196")
285 (eq_attr "type" "fsimpsd"))
287 (define_insn_reservation "z196_fsimpdd" 17
288 (and (eq_attr "cpu" "z196")
289 (eq_attr "type" "fsimpdd"))
291 (define_insn_reservation "z196_fsimptd" 18
292 (and (eq_attr "cpu" "z196")
293 (eq_attr "type" "fsimptd"))
297 (define_insn_reservation "z196_itofdd" 45
298 (and (eq_attr "cpu" "z196")
299 (eq_attr "type" "itofdd"))
303 (define_insn_reservation "z196_itoftd" 33
304 (and (eq_attr "cpu" "z196")
305 (eq_attr "type" "itoftd"))
309 (define_insn_reservation "z196_ftoidfp" 33
310 (and (eq_attr "cpu" "z196")
311 (eq_attr "type" "ftoidfp"))