Line 0
Link Here
|
|
|
1 |
;; Atom Scheduling |
2 |
;; Copyright (C) 2009 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 |
7 |
;; it under the terms of the GNU General Public License as published by |
8 |
;; the Free Software Foundation; either version 2, or (at your option) |
9 |
;; any later version. |
10 |
;; |
11 |
;; GCC is distributed in the hope that it will be useful, |
12 |
;; but WITHOUT ANY WARRANTY; without even the implied warranty of |
13 |
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
14 |
;; GNU General Public 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 |
18 |
;; the Free Software Foundation, 51 Franklin Street, Fifth Floor, |
19 |
;; Boston, MA 02110-1301, USA. */ |
20 |
;; |
21 |
;; Atom is an in-order core with two integer pipelines. |
22 |
|
23 |
|
24 |
(define_attr "atom_unit" "sishuf,simul,jeu,complex,other" |
25 |
(const_string "other")) |
26 |
|
27 |
(define_attr "atom_sse_attr" "rcp,movdup,lfence,fence,prefetch,sqrt,mxcsr,other" |
28 |
(const_string "other")) |
29 |
|
30 |
(define_automaton "atom") |
31 |
|
32 |
;; Atom has two ports: port 0 and port 1 connecting to all execution units |
33 |
(define_cpu_unit "atom-port-0,atom-port-1" "atom") |
34 |
|
35 |
;; EU: Execution Unit |
36 |
;; Atom EUs are connected by port 0 or port 1. |
37 |
|
38 |
(define_cpu_unit "atom-eu-0, atom-eu-1, |
39 |
atom-imul-1, atom-imul-2, atom-imul-3, atom-imul-4" |
40 |
"atom") |
41 |
|
42 |
;; Some EUs have duplicated copied and can be accessed via either |
43 |
;; port 0 or port 1 |
44 |
;; (define_reservation "atom-port-either" "(atom-port-0 | atom-port-1)") |
45 |
|
46 |
;;; Some instructions is dual-pipe execution, need both ports |
47 |
;;; Complex multi-op macro-instructoins need both ports and all EUs |
48 |
(define_reservation "atom-port-dual" "(atom-port-0 + atom-port-1)") |
49 |
(define_reservation "atom-all-eu" "(atom-eu-0 + atom-eu-1 + |
50 |
atom-imul-1 + atom-imul-2 + atom-imul-3 + |
51 |
atom-imul-4)") |
52 |
|
53 |
;;; Most of simple instructions have 1 cycle latency. Some of them |
54 |
;;; issue in port 0, some in port 0 and some in either port. |
55 |
(define_reservation "atom-simple-0" "(atom-port-0 + atom-eu-0)") |
56 |
(define_reservation "atom-simple-1" "(atom-port-1 + atom-eu-1)") |
57 |
(define_reservation "atom-simple-either" "(atom-simple-0 | atom-simple-1)") |
58 |
|
59 |
;;; Some insn issues in port 0 with 3 cycle latency and 1 cycle tput |
60 |
(define_reservation "atom-eu-0-3-1" "(atom-port-0 + atom-eu-0, nothing*2)") |
61 |
|
62 |
;;; fmul insn can have 4 or 5 cycles latency |
63 |
(define_reservation "atom-fmul-5c" "(atom-port-0 + atom-eu-0), nothing*4") |
64 |
(define_reservation "atom-fmul-4c" "(atom-port-0 + atom-eu-0), nothing*3") |
65 |
|
66 |
;;; fadd can has 5 cycles latency depends on instruction forms |
67 |
(define_reservation "atom-fadd-5c" "(atom-port-1 + atom-eu-1), nothing*5") |
68 |
|
69 |
;;; imul insn has 5 cycles latency |
70 |
(define_reservation "atom-imul-32" |
71 |
"atom-imul-1, atom-imul-2, atom-imul-3, atom-imul-4, |
72 |
atom-port-0") |
73 |
;;; imul instruction excludes other non-FP instructions. |
74 |
(exclusion_set "atom-eu-0, atom-eu-1" |
75 |
"atom-imul-1, atom-imul-2, atom-imul-3, atom-imul-4") |
76 |
|
77 |
;;; dual-execution instructions can have 1,2,4,5 cycles latency depends on |
78 |
;;; instruction forms |
79 |
(define_reservation "atom-dual-1c" "(atom-port-dual + atom-eu-0 + atom-eu-1)") |
80 |
(define_reservation "atom-dual-2c" |
81 |
"(atom-port-dual + atom-eu-0 + atom-eu-1, nothing)") |
82 |
(define_reservation "atom-dual-5c" |
83 |
"(atom-port-dual + atom-eu-0 + atom-eu-1, nothing*4)") |
84 |
|
85 |
;;; Complex macro-instruction has variants of latency, and uses both ports. |
86 |
(define_reservation "atom-complex" "(atom-port-dual + atom-all-eu)") |
87 |
|
88 |
(define_insn_reservation "atom_other" 9 |
89 |
(and (eq_attr "cpu" "atom") |
90 |
(and (eq_attr "type" "other") |
91 |
(eq_attr "atom_unit" "!jeu"))) |
92 |
"atom-complex, atom-all-eu*8") |
93 |
|
94 |
;; return has type "other" with atom_unit "jeu" |
95 |
(define_insn_reservation "atom_other_2" 1 |
96 |
(and (eq_attr "cpu" "atom") |
97 |
(and (eq_attr "type" "other") |
98 |
(eq_attr "atom_unit" "jeu"))) |
99 |
"atom-dual-1c") |
100 |
|
101 |
(define_insn_reservation "atom_multi" 9 |
102 |
(and (eq_attr "cpu" "atom") |
103 |
(eq_attr "type" "multi")) |
104 |
"atom-complex, atom-all-eu*8") |
105 |
|
106 |
;; Normal alu insns without carry |
107 |
(define_insn_reservation "atom_alu" 1 |
108 |
(and (eq_attr "cpu" "atom") |
109 |
(and (eq_attr "type" "alu") |
110 |
(and (eq_attr "memory" "none") |
111 |
(eq_attr "use_carry" "0")))) |
112 |
"atom-simple-either") |
113 |
|
114 |
;; Normal alu insns without carry |
115 |
(define_insn_reservation "atom_alu_mem" 1 |
116 |
(and (eq_attr "cpu" "atom") |
117 |
(and (eq_attr "type" "alu") |
118 |
(and (eq_attr "memory" "!none") |
119 |
(eq_attr "use_carry" "0")))) |
120 |
"atom-simple-either") |
121 |
|
122 |
;; Alu insn consuming CF, such as add/sbb |
123 |
(define_insn_reservation "atom_alu_carry" 1 |
124 |
(and (eq_attr "cpu" "atom") |
125 |
(and (eq_attr "type" "alu") |
126 |
(and (eq_attr "memory" "none") |
127 |
(eq_attr "use_carry" "1")))) |
128 |
"atom-simple-either") |
129 |
|
130 |
;; Alu insn consuming CF, such as add/sbb |
131 |
(define_insn_reservation "atom_alu_carry_mem" 1 |
132 |
(and (eq_attr "cpu" "atom") |
133 |
(and (eq_attr "type" "alu") |
134 |
(and (eq_attr "memory" "!none") |
135 |
(eq_attr "use_carry" "1")))) |
136 |
"atom-simple-either") |
137 |
|
138 |
(define_insn_reservation "atom_alu1" 1 |
139 |
(and (eq_attr "cpu" "atom") |
140 |
(and (eq_attr "type" "alu1") |
141 |
(eq_attr "memory" "none"))) |
142 |
"atom-simple-either") |
143 |
|
144 |
(define_insn_reservation "atom_alu1_mem" 1 |
145 |
(and (eq_attr "cpu" "atom") |
146 |
(and (eq_attr "type" "alu1") |
147 |
(eq_attr "memory" "!none"))) |
148 |
"atom-simple-either") |
149 |
|
150 |
(define_insn_reservation "atom_negnot" 1 |
151 |
(and (eq_attr "cpu" "atom") |
152 |
(and (eq_attr "type" "negnot") |
153 |
(eq_attr "memory" "none"))) |
154 |
"atom-simple-either") |
155 |
|
156 |
(define_insn_reservation "atom_negnot_mem" 1 |
157 |
(and (eq_attr "cpu" "atom") |
158 |
(and (eq_attr "type" "negnot") |
159 |
(eq_attr "memory" "!none"))) |
160 |
"atom-simple-either") |
161 |
|
162 |
(define_insn_reservation "atom_imov" 1 |
163 |
(and (eq_attr "cpu" "atom") |
164 |
(and (eq_attr "type" "imov") |
165 |
(eq_attr "memory" "none"))) |
166 |
"atom-simple-either") |
167 |
|
168 |
(define_insn_reservation "atom_imov_mem" 1 |
169 |
(and (eq_attr "cpu" "atom") |
170 |
(and (eq_attr "type" "imov") |
171 |
(eq_attr "memory" "!none"))) |
172 |
"atom-simple-either") |
173 |
|
174 |
;; 16<-16, 32<-32 |
175 |
(define_insn_reservation "atom_imovx" 1 |
176 |
(and (eq_attr "cpu" "atom") |
177 |
(and (eq_attr "type" "imovx") |
178 |
(and (eq_attr "memory" "none") |
179 |
(ior (and (match_operand:HI 0 "register_operand") |
180 |
(match_operand:HI 1 "general_operand")) |
181 |
(and (match_operand:SI 0 "register_operand") |
182 |
(match_operand:SI 1 "general_operand")))))) |
183 |
"atom-simple-either") |
184 |
|
185 |
;; 16<-16, 32<-32, mem |
186 |
(define_insn_reservation "atom_imovx_mem" 1 |
187 |
(and (eq_attr "cpu" "atom") |
188 |
(and (eq_attr "type" "imovx") |
189 |
(and (eq_attr "memory" "!none") |
190 |
(ior (and (match_operand:HI 0 "register_operand") |
191 |
(match_operand:HI 1 "general_operand")) |
192 |
(and (match_operand:SI 0 "register_operand") |
193 |
(match_operand:SI 1 "general_operand")))))) |
194 |
"atom-simple-either") |
195 |
|
196 |
;; 32<-16, 32<-8, 64<-16, 64<-8, 64<-32, 8<-8 |
197 |
(define_insn_reservation "atom_imovx_2" 1 |
198 |
(and (eq_attr "cpu" "atom") |
199 |
(and (eq_attr "type" "imovx") |
200 |
(and (eq_attr "memory" "none") |
201 |
(ior (match_operand:QI 0 "register_operand") |
202 |
(ior (and (match_operand:SI 0 "register_operand") |
203 |
(not (match_operand:SI 1 "general_operand"))) |
204 |
(match_operand:DI 0 "register_operand")))))) |
205 |
"atom-simple-0") |
206 |
|
207 |
;; 32<-16, 32<-8, 64<-16, 64<-8, 64<-32, 8<-8, mem |
208 |
(define_insn_reservation "atom_imovx_2_mem" 1 |
209 |
(and (eq_attr "cpu" "atom") |
210 |
(and (eq_attr "type" "imovx") |
211 |
(and (eq_attr "memory" "!none") |
212 |
(ior (match_operand:QI 0 "register_operand") |
213 |
(ior (and (match_operand:SI 0 "register_operand") |
214 |
(not (match_operand:SI 1 "general_operand"))) |
215 |
(match_operand:DI 0 "register_operand")))))) |
216 |
"atom-simple-0") |
217 |
|
218 |
;; 16<-8 |
219 |
(define_insn_reservation "atom_imovx_3" 3 |
220 |
(and (eq_attr "cpu" "atom") |
221 |
(and (eq_attr "type" "imovx") |
222 |
(and (match_operand:HI 0 "register_operand") |
223 |
(match_operand:QI 1 "general_operand")))) |
224 |
"atom-complex, atom-all-eu*2") |
225 |
|
226 |
(define_insn_reservation "atom_lea" 1 |
227 |
(and (eq_attr "cpu" "atom") |
228 |
(and (eq_attr "type" "lea") |
229 |
(eq_attr "mode" "!HI"))) |
230 |
"atom-simple-either") |
231 |
|
232 |
;; lea 16bit address is complex insn |
233 |
(define_insn_reservation "atom_lea_2" 2 |
234 |
(and (eq_attr "cpu" "atom") |
235 |
(and (eq_attr "type" "lea") |
236 |
(eq_attr "mode" "HI"))) |
237 |
"atom-complex, atom-all-eu") |
238 |
|
239 |
(define_insn_reservation "atom_incdec" 1 |
240 |
(and (eq_attr "cpu" "atom") |
241 |
(and (eq_attr "type" "incdec") |
242 |
(eq_attr "memory" "none"))) |
243 |
"atom-simple-either") |
244 |
|
245 |
(define_insn_reservation "atom_incdec_mem" 1 |
246 |
(and (eq_attr "cpu" "atom") |
247 |
(and (eq_attr "type" "incdec") |
248 |
(eq_attr "memory" "!none"))) |
249 |
"atom-simple-either") |
250 |
|
251 |
;; simple shift instruction use SHIFT eu, none memory |
252 |
(define_insn_reservation "atom_ishift" 1 |
253 |
(and (eq_attr "cpu" "atom") |
254 |
(and (eq_attr "type" "ishift") |
255 |
(and (eq_attr "memory" "none") (eq_attr "prefix_0f" "0")))) |
256 |
"atom-simple-0") |
257 |
|
258 |
;; simple shift instruction use SHIFT eu, memory |
259 |
(define_insn_reservation "atom_ishift_mem" 1 |
260 |
(and (eq_attr "cpu" "atom") |
261 |
(and (eq_attr "type" "ishift") |
262 |
(and (eq_attr "memory" "!none") (eq_attr "prefix_0f" "0")))) |
263 |
"atom-simple-0") |
264 |
|
265 |
;; DF shift (prefixed with 0f) is complex insn with latency of 7 cycles |
266 |
(define_insn_reservation "atom_ishift_3" 7 |
267 |
(and (eq_attr "cpu" "atom") |
268 |
(and (eq_attr "type" "ishift") |
269 |
(eq_attr "prefix_0f" "1"))) |
270 |
"atom-complex, atom-all-eu*6") |
271 |
|
272 |
(define_insn_reservation "atom_ishift1" 1 |
273 |
(and (eq_attr "cpu" "atom") |
274 |
(and (eq_attr "type" "ishift1") |
275 |
(eq_attr "memory" "none"))) |
276 |
"atom-simple-0") |
277 |
|
278 |
(define_insn_reservation "atom_ishift1_mem" 1 |
279 |
(and (eq_attr "cpu" "atom") |
280 |
(and (eq_attr "type" "ishift1") |
281 |
(eq_attr "memory" "!none"))) |
282 |
"atom-simple-0") |
283 |
|
284 |
(define_insn_reservation "atom_rotate" 1 |
285 |
(and (eq_attr "cpu" "atom") |
286 |
(and (eq_attr "type" "rotate") |
287 |
(eq_attr "memory" "none"))) |
288 |
"atom-simple-0") |
289 |
|
290 |
(define_insn_reservation "atom_rotate_mem" 1 |
291 |
(and (eq_attr "cpu" "atom") |
292 |
(and (eq_attr "type" "rotate") |
293 |
(eq_attr "memory" "!none"))) |
294 |
"atom-simple-0") |
295 |
|
296 |
(define_insn_reservation "atom_rotate1" 1 |
297 |
(and (eq_attr "cpu" "atom") |
298 |
(and (eq_attr "type" "rotate1") |
299 |
(eq_attr "memory" "none"))) |
300 |
"atom-simple-0") |
301 |
|
302 |
(define_insn_reservation "atom_rotate1_mem" 1 |
303 |
(and (eq_attr "cpu" "atom") |
304 |
(and (eq_attr "type" "rotate1") |
305 |
(eq_attr "memory" "!none"))) |
306 |
"atom-simple-0") |
307 |
|
308 |
(define_insn_reservation "atom_imul" 5 |
309 |
(and (eq_attr "cpu" "atom") |
310 |
(and (eq_attr "type" "imul") |
311 |
(and (eq_attr "memory" "none") (eq_attr "mode" "SI")))) |
312 |
"atom-imul-32") |
313 |
|
314 |
(define_insn_reservation "atom_imul_mem" 5 |
315 |
(and (eq_attr "cpu" "atom") |
316 |
(and (eq_attr "type" "imul") |
317 |
(and (eq_attr "memory" "!none") (eq_attr "mode" "SI")))) |
318 |
"atom-imul-32") |
319 |
|
320 |
;; latency set to 10 as common 64x64 imul |
321 |
(define_insn_reservation "atom_imul_3" 10 |
322 |
(and (eq_attr "cpu" "atom") |
323 |
(and (eq_attr "type" "imul") |
324 |
(eq_attr "mode" "!SI"))) |
325 |
"atom-complex, atom-all-eu*9") |
326 |
|
327 |
(define_insn_reservation "atom_idiv" 65 |
328 |
(and (eq_attr "cpu" "atom") |
329 |
(eq_attr "type" "idiv")) |
330 |
"atom-complex, atom-all-eu*32, nothing*32") |
331 |
|
332 |
(define_insn_reservation "atom_icmp" 1 |
333 |
(and (eq_attr "cpu" "atom") |
334 |
(and (eq_attr "type" "icmp") |
335 |
(eq_attr "memory" "none"))) |
336 |
"atom-simple-either") |
337 |
|
338 |
(define_insn_reservation "atom_icmp_mem" 1 |
339 |
(and (eq_attr "cpu" "atom") |
340 |
(and (eq_attr "type" "icmp") |
341 |
(eq_attr "memory" "!none"))) |
342 |
"atom-simple-either") |
343 |
|
344 |
(define_insn_reservation "atom_test" 1 |
345 |
(and (eq_attr "cpu" "atom") |
346 |
(and (eq_attr "type" "test") |
347 |
(eq_attr "memory" "none"))) |
348 |
"atom-simple-either") |
349 |
|
350 |
(define_insn_reservation "atom_test_mem" 1 |
351 |
(and (eq_attr "cpu" "atom") |
352 |
(and (eq_attr "type" "test") |
353 |
(eq_attr "memory" "!none"))) |
354 |
"atom-simple-either") |
355 |
|
356 |
(define_insn_reservation "atom_ibr" 1 |
357 |
(and (eq_attr "cpu" "atom") |
358 |
(and (eq_attr "type" "ibr") |
359 |
(eq_attr "memory" "!load"))) |
360 |
"atom-simple-1") |
361 |
|
362 |
;; complex if jump target is from address |
363 |
(define_insn_reservation "atom_ibr_2" 2 |
364 |
(and (eq_attr "cpu" "atom") |
365 |
(and (eq_attr "type" "ibr") |
366 |
(eq_attr "memory" "load"))) |
367 |
"atom-complex, atom-all-eu") |
368 |
|
369 |
(define_insn_reservation "atom_setcc" 1 |
370 |
(and (eq_attr "cpu" "atom") |
371 |
(and (eq_attr "type" "setcc") |
372 |
(eq_attr "memory" "!store"))) |
373 |
"atom-simple-either") |
374 |
|
375 |
;; 2 cycles complex if target is in memory |
376 |
(define_insn_reservation "atom_setcc_2" 2 |
377 |
(and (eq_attr "cpu" "atom") |
378 |
(and (eq_attr "type" "setcc") |
379 |
(eq_attr "memory" "store"))) |
380 |
"atom-complex, atom-all-eu") |
381 |
|
382 |
(define_insn_reservation "atom_icmov" 1 |
383 |
(and (eq_attr "cpu" "atom") |
384 |
(and (eq_attr "type" "icmov") |
385 |
(eq_attr "memory" "none"))) |
386 |
"atom-simple-either") |
387 |
|
388 |
(define_insn_reservation "atom_icmov_mem" 1 |
389 |
(and (eq_attr "cpu" "atom") |
390 |
(and (eq_attr "type" "icmov") |
391 |
(eq_attr "memory" "!none"))) |
392 |
"atom-simple-either") |
393 |
|
394 |
;; UCODE if segreg, ignored |
395 |
(define_insn_reservation "atom_push" 2 |
396 |
(and (eq_attr "cpu" "atom") |
397 |
(eq_attr "type" "push")) |
398 |
"atom-dual-2c") |
399 |
|
400 |
;; pop r64 is 1 cycle. UCODE if segreg, ignored |
401 |
(define_insn_reservation "atom_pop" 1 |
402 |
(and (eq_attr "cpu" "atom") |
403 |
(and (eq_attr "type" "pop") |
404 |
(eq_attr "mode" "DI"))) |
405 |
"atom-dual-1c") |
406 |
|
407 |
;; pop non-r64 is 2 cycles. UCODE if segreg, ignored |
408 |
(define_insn_reservation "atom_pop_2" 2 |
409 |
(and (eq_attr "cpu" "atom") |
410 |
(and (eq_attr "type" "pop") |
411 |
(eq_attr "mode" "!DI"))) |
412 |
"atom-dual-2c") |
413 |
|
414 |
;; UCODE if segreg, ignored |
415 |
(define_insn_reservation "atom_call" 1 |
416 |
(and (eq_attr "cpu" "atom") |
417 |
(eq_attr "type" "call")) |
418 |
"atom-dual-1c") |
419 |
|
420 |
(define_insn_reservation "atom_callv" 1 |
421 |
(and (eq_attr "cpu" "atom") |
422 |
(eq_attr "type" "callv")) |
423 |
"atom-dual-1c") |
424 |
|
425 |
(define_insn_reservation "atom_leave" 3 |
426 |
(and (eq_attr "cpu" "atom") |
427 |
(eq_attr "type" "leave")) |
428 |
"atom-complex, atom-all-eu*2") |
429 |
|
430 |
(define_insn_reservation "atom_str" 3 |
431 |
(and (eq_attr "cpu" "atom") |
432 |
(eq_attr "type" "str")) |
433 |
"atom-complex, atom-all-eu*2") |
434 |
|
435 |
(define_insn_reservation "atom_sselog" 1 |
436 |
(and (eq_attr "cpu" "atom") |
437 |
(and (eq_attr "type" "sselog") |
438 |
(eq_attr "memory" "none"))) |
439 |
"atom-simple-either") |
440 |
|
441 |
(define_insn_reservation "atom_sselog_mem" 1 |
442 |
(and (eq_attr "cpu" "atom") |
443 |
(and (eq_attr "type" "sselog") |
444 |
(eq_attr "memory" "!none"))) |
445 |
"atom-simple-either") |
446 |
|
447 |
(define_insn_reservation "atom_sselog1" 1 |
448 |
(and (eq_attr "cpu" "atom") |
449 |
(and (eq_attr "type" "sselog1") |
450 |
(eq_attr "memory" "none"))) |
451 |
"atom-simple-0") |
452 |
|
453 |
(define_insn_reservation "atom_sselog1_mem" 1 |
454 |
(and (eq_attr "cpu" "atom") |
455 |
(and (eq_attr "type" "sselog1") |
456 |
(eq_attr "memory" "!none"))) |
457 |
"atom-simple-0") |
458 |
|
459 |
;; not pmad, not psad |
460 |
(define_insn_reservation "atom_sseiadd" 1 |
461 |
(and (eq_attr "cpu" "atom") |
462 |
(and (eq_attr "type" "sseiadd") |
463 |
(and (not (match_operand:V2DI 0 "register_operand")) |
464 |
(and (eq_attr "atom_unit" "!simul") |
465 |
(eq_attr "atom_unit" "!complex"))))) |
466 |
"atom-simple-either") |
467 |
|
468 |
;; pmad, psad and 64 |
469 |
(define_insn_reservation "atom_sseiadd_2" 4 |
470 |
(and (eq_attr "cpu" "atom") |
471 |
(and (eq_attr "type" "sseiadd") |
472 |
(and (not (match_operand:V2DI 0 "register_operand")) |
473 |
(and (eq_attr "atom_unit" "simul" ) |
474 |
(eq_attr "mode" "DI"))))) |
475 |
"atom-fmul-4c") |
476 |
|
477 |
;; pmad, psad and 128 |
478 |
(define_insn_reservation "atom_sseiadd_3" 5 |
479 |
(and (eq_attr "cpu" "atom") |
480 |
(and (eq_attr "type" "sseiadd") |
481 |
(and (not (match_operand:V2DI 0 "register_operand")) |
482 |
(and (eq_attr "atom_unit" "simul" ) |
483 |
(eq_attr "mode" "TI"))))) |
484 |
"atom-fmul-5c") |
485 |
|
486 |
;; if paddq(64 bit op), phadd/phsub |
487 |
(define_insn_reservation "atom_sseiadd_4" 6 |
488 |
(and (eq_attr "cpu" "atom") |
489 |
(and (eq_attr "type" "sseiadd") |
490 |
(ior (match_operand:V2DI 0 "register_operand") |
491 |
(eq_attr "atom_unit" "complex")))) |
492 |
"atom-complex, atom-all-eu*5") |
493 |
|
494 |
;; if immediate op. |
495 |
(define_insn_reservation "atom_sseishft" 1 |
496 |
(and (eq_attr "cpu" "atom") |
497 |
(and (eq_attr "type" "sseishft") |
498 |
(and (eq_attr "atom_unit" "!sishuf") |
499 |
(match_operand 2 "immediate_operand")))) |
500 |
"atom-simple-either") |
501 |
|
502 |
;; if palignr or psrldq |
503 |
(define_insn_reservation "atom_sseishft_2" 1 |
504 |
(and (eq_attr "cpu" "atom") |
505 |
(and (eq_attr "type" "sseishft") |
506 |
(and (eq_attr "atom_unit" "sishuf") |
507 |
(match_operand 2 "immediate_operand")))) |
508 |
"atom-simple-0") |
509 |
|
510 |
;; if reg/mem op |
511 |
(define_insn_reservation "atom_sseishft_3" 2 |
512 |
(and (eq_attr "cpu" "atom") |
513 |
(and (eq_attr "type" "sseishft") |
514 |
(not (match_operand 2 "immediate_operand")))) |
515 |
"atom-complex, atom-all-eu") |
516 |
|
517 |
(define_insn_reservation "atom_sseimul" 1 |
518 |
(and (eq_attr "cpu" "atom") |
519 |
(eq_attr "type" "sseimul")) |
520 |
"atom-simple-0") |
521 |
|
522 |
;; rcpss or rsqrtss |
523 |
(define_insn_reservation "atom_sse" 4 |
524 |
(and (eq_attr "cpu" "atom") |
525 |
(and (eq_attr "type" "sse") |
526 |
(and (eq_attr "atom_sse_attr" "rcp") (eq_attr "mode" "SF")))) |
527 |
"atom-fmul-4c") |
528 |
|
529 |
;; movshdup, movsldup. Suggest to type sseishft |
530 |
(define_insn_reservation "atom_sse_2" 1 |
531 |
(and (eq_attr "cpu" "atom") |
532 |
(and (eq_attr "type" "sse") |
533 |
(eq_attr "atom_sse_attr" "movdup"))) |
534 |
"atom-simple-0") |
535 |
|
536 |
;; lfence |
537 |
(define_insn_reservation "atom_sse_3" 1 |
538 |
(and (eq_attr "cpu" "atom") |
539 |
(and (eq_attr "type" "sse") |
540 |
(eq_attr "atom_sse_attr" "lfence"))) |
541 |
"atom-simple-either") |
542 |
|
543 |
;; sfence,clflush,mfence, prefetch |
544 |
(define_insn_reservation "atom_sse_4" 1 |
545 |
(and (eq_attr "cpu" "atom") |
546 |
(and (eq_attr "type" "sse") |
547 |
(ior (eq_attr "atom_sse_attr" "fence") |
548 |
(eq_attr "atom_sse_attr" "prefetch")))) |
549 |
"atom-simple-0") |
550 |
|
551 |
;; rcpps, rsqrtss, sqrt, ldmxcsr |
552 |
(define_insn_reservation "atom_sse_5" 7 |
553 |
(and (eq_attr "cpu" "atom") |
554 |
(and (eq_attr "type" "sse") |
555 |
(ior (ior (eq_attr "atom_sse_attr" "sqrt") |
556 |
(eq_attr "atom_sse_attr" "mxcsr")) |
557 |
(and (eq_attr "atom_sse_attr" "rcp") |
558 |
(eq_attr "mode" "V4SF"))))) |
559 |
"atom-complex, atom-all-eu*6") |
560 |
|
561 |
;; xmm->xmm |
562 |
(define_insn_reservation "atom_ssemov" 1 |
563 |
(and (eq_attr "cpu" "atom") |
564 |
(and (eq_attr "type" "ssemov") |
565 |
(and (match_operand 0 "register_operand" "xy") (match_operand 1 "register_operand" "xy")))) |
566 |
"atom-simple-either") |
567 |
|
568 |
;; reg->xmm |
569 |
(define_insn_reservation "atom_ssemov_2" 1 |
570 |
(and (eq_attr "cpu" "atom") |
571 |
(and (eq_attr "type" "ssemov") |
572 |
(and (match_operand 0 "register_operand" "xy") (match_operand 1 "register_operand" "r")))) |
573 |
"atom-simple-0") |
574 |
|
575 |
;; xmm->reg |
576 |
(define_insn_reservation "atom_ssemov_3" 3 |
577 |
(and (eq_attr "cpu" "atom") |
578 |
(and (eq_attr "type" "ssemov") |
579 |
(and (match_operand 0 "register_operand" "r") (match_operand 1 "register_operand" "xy")))) |
580 |
"atom-eu-0-3-1") |
581 |
|
582 |
;; mov mem |
583 |
(define_insn_reservation "atom_ssemov_4" 1 |
584 |
(and (eq_attr "cpu" "atom") |
585 |
(and (eq_attr "type" "ssemov") |
586 |
(and (eq_attr "movu" "0") (eq_attr "memory" "!none")))) |
587 |
"atom-simple-0") |
588 |
|
589 |
;; movu mem |
590 |
(define_insn_reservation "atom_ssemov_5" 2 |
591 |
(and (eq_attr "cpu" "atom") |
592 |
(and (eq_attr "type" "ssemov") |
593 |
(ior (eq_attr "movu" "1") (eq_attr "memory" "!none")))) |
594 |
"atom-complex, atom-all-eu") |
595 |
|
596 |
;; no memory simple |
597 |
(define_insn_reservation "atom_sseadd" 5 |
598 |
(and (eq_attr "cpu" "atom") |
599 |
(and (eq_attr "type" "sseadd") |
600 |
(and (eq_attr "memory" "none") |
601 |
(and (eq_attr "mode" "!V2DF") |
602 |
(eq_attr "atom_unit" "!complex"))))) |
603 |
"atom-fadd-5c") |
604 |
|
605 |
;; memory simple |
606 |
(define_insn_reservation "atom_sseadd_mem" 5 |
607 |
(and (eq_attr "cpu" "atom") |
608 |
(and (eq_attr "type" "sseadd") |
609 |
(and (eq_attr "memory" "!none") |
610 |
(and (eq_attr "mode" "!V2DF") |
611 |
(eq_attr "atom_unit" "!complex"))))) |
612 |
"atom-dual-5c") |
613 |
|
614 |
;; maxps, minps, *pd, hadd, hsub |
615 |
(define_insn_reservation "atom_sseadd_3" 8 |
616 |
(and (eq_attr "cpu" "atom") |
617 |
(and (eq_attr "type" "sseadd") |
618 |
(ior (eq_attr "mode" "V2DF") (eq_attr "atom_unit" "complex")))) |
619 |
"atom-complex, atom-all-eu*7") |
620 |
|
621 |
;; Except dppd/dpps |
622 |
(define_insn_reservation "atom_ssemul" 5 |
623 |
(and (eq_attr "cpu" "atom") |
624 |
(and (eq_attr "type" "ssemul") |
625 |
(eq_attr "mode" "!SF"))) |
626 |
"atom-fmul-5c") |
627 |
|
628 |
;; Except dppd/dpps, 4 cycle if mulss |
629 |
(define_insn_reservation "atom_ssemul_2" 4 |
630 |
(and (eq_attr "cpu" "atom") |
631 |
(and (eq_attr "type" "ssemul") |
632 |
(eq_attr "mode" "SF"))) |
633 |
"atom-fmul-4c") |
634 |
|
635 |
(define_insn_reservation "atom_ssecmp" 1 |
636 |
(and (eq_attr "cpu" "atom") |
637 |
(eq_attr "type" "ssecmp")) |
638 |
"atom-simple-either") |
639 |
|
640 |
(define_insn_reservation "atom_ssecomi" 10 |
641 |
(and (eq_attr "cpu" "atom") |
642 |
(eq_attr "type" "ssecomi")) |
643 |
"atom-complex, atom-all-eu*9") |
644 |
|
645 |
;; no memory and cvtpi2ps, cvtps2pi, cvttps2pi |
646 |
(define_insn_reservation "atom_ssecvt" 5 |
647 |
(and (eq_attr "cpu" "atom") |
648 |
(and (eq_attr "type" "ssecvt") |
649 |
(ior (and (match_operand:V2SI 0 "register_operand") |
650 |
(match_operand:V4SF 1 "register_operand")) |
651 |
(and (match_operand:V4SF 0 "register_operand") |
652 |
(match_operand:V2SI 1 "register_operand"))))) |
653 |
"atom-fadd-5c") |
654 |
|
655 |
;; memory and cvtpi2ps, cvtps2pi, cvttps2pi |
656 |
(define_insn_reservation "atom_ssecvt_2" 5 |
657 |
(and (eq_attr "cpu" "atom") |
658 |
(and (eq_attr "type" "ssecvt") |
659 |
(ior (and (match_operand:V2SI 0 "register_operand") |
660 |
(match_operand:V4SF 1 "memory_operand")) |
661 |
(and (match_operand:V4SF 0 "register_operand") |
662 |
(match_operand:V2SI 1 "memory_operand"))))) |
663 |
"atom-dual-5c") |
664 |
|
665 |
;; otherwise. 7 cycles average for cvtss2sd |
666 |
(define_insn_reservation "atom_ssecvt_3" 7 |
667 |
(and (eq_attr "cpu" "atom") |
668 |
(and (eq_attr "type" "ssecvt") |
669 |
(not (ior (and (match_operand:V2SI 0 "register_operand") |
670 |
(match_operand:V4SF 1 "nonimmediate_operand")) |
671 |
(and (match_operand:V4SF 0 "register_operand") |
672 |
(match_operand:V2SI 1 "nonimmediate_operand")))))) |
673 |
"atom-complex, atom-all-eu*6") |
674 |
|
675 |
;; memory and cvtsi2sd |
676 |
(define_insn_reservation "atom_sseicvt" 5 |
677 |
(and (eq_attr "cpu" "atom") |
678 |
(and (eq_attr "type" "sseicvt") |
679 |
(and (match_operand:V2DF 0 "register_operand") |
680 |
(match_operand:SI 1 "memory_operand")))) |
681 |
"atom-dual-5c") |
682 |
|
683 |
;; otherwise. 8 cycles average for cvtsd2si |
684 |
(define_insn_reservation "atom_sseicvt_2" 8 |
685 |
(and (eq_attr "cpu" "atom") |
686 |
(and (eq_attr "type" "sseicvt") |
687 |
(not (and (match_operand:V2DF 0 "register_operand") |
688 |
(match_operand:SI 1 "memory_operand"))))) |
689 |
"atom-complex, atom-all-eu*7") |
690 |
|
691 |
(define_insn_reservation "atom_ssediv" 62 |
692 |
(and (eq_attr "cpu" "atom") |
693 |
(eq_attr "type" "ssediv")) |
694 |
"atom-complex, atom-all-eu*12, nothing*49") |
695 |
|
696 |
;; simple for fmov |
697 |
(define_insn_reservation "atom_fmov" 1 |
698 |
(and (eq_attr "cpu" "atom") |
699 |
(and (eq_attr "type" "fmov") |
700 |
(eq_attr "memory" "none"))) |
701 |
"atom-simple-either") |
702 |
|
703 |
;; simple for fmov |
704 |
(define_insn_reservation "atom_fmov_mem" 1 |
705 |
(and (eq_attr "cpu" "atom") |
706 |
(and (eq_attr "type" "fmov") |
707 |
(eq_attr "memory" "!none"))) |
708 |
"atom-simple-either") |
709 |
|
710 |
;; Define bypass here |
711 |
|
712 |
;; There will be no stall from lea to non-mem EX insns |
713 |
(define_bypass 0 "atom_lea" |
714 |
"atom_alu_carry, |
715 |
atom_alu,atom_alu1,atom_negnot,atom_imov,atom_imovx, |
716 |
atom_incdec, atom_setcc, atom_icmov, atom_pop") |
717 |
|
718 |
(define_bypass 0 "atom_lea" |
719 |
"atom_alu_mem, atom_alu_carry_mem, atom_alu1_mem, |
720 |
atom_imovx_mem, atom_imovx_2_mem, |
721 |
atom_imov_mem, atom_icmov_mem, atom_fmov_mem" |
722 |
"!ix86_agi_dependent") |
723 |
|
724 |
;; There will be 3 cycles stall from EX insns to AGAN insns LEA |
725 |
(define_bypass 4 "atom_alu_carry, |
726 |
atom_alu,atom_alu1,atom_negnot,atom_imov,atom_imovx, |
727 |
atom_incdec,atom_ishift,atom_ishift1,atom_rotate, |
728 |
atom_rotate1, atom_setcc, atom_icmov, atom_pop, |
729 |
atom_alu_mem, atom_alu_carry_mem, atom_alu1_mem, |
730 |
atom_imovx_mem, atom_imovx_2_mem, |
731 |
atom_imov_mem, atom_icmov_mem, atom_fmov_mem" |
732 |
"atom_lea") |
733 |
|
734 |
;; There will be 3 cycles stall from EX insns to insns need addr calculation |
735 |
(define_bypass 4 "atom_alu_carry, |
736 |
atom_alu,atom_alu1,atom_negnot,atom_imov,atom_imovx, |
737 |
atom_incdec,atom_ishift,atom_ishift1,atom_rotate, |
738 |
atom_rotate1, atom_setcc, atom_icmov, atom_pop, |
739 |
atom_imovx_mem, atom_imovx_2_mem, |
740 |
atom_alu_mem, atom_alu_carry_mem, atom_alu1_mem, |
741 |
atom_imov_mem, atom_icmov_mem, atom_fmov_mem" |
742 |
"atom_alu_mem, atom_alu_carry_mem, atom_alu1_mem, |
743 |
atom_negnot_mem, atom_imov_mem, atom_incdec_mem, |
744 |
atom_imovx_mem, atom_imovx_2_mem, |
745 |
atom_imul_mem, atom_icmp_mem, |
746 |
atom_test_mem, atom_icmov_mem, atom_sselog_mem, |
747 |
atom_sselog1_mem, atom_fmov_mem, atom_sseadd_mem, |
748 |
atom_ishift_mem, atom_ishift1_mem, |
749 |
atom_rotate_mem, atom_rotate1_mem" |
750 |
"ix86_agi_dependent") |
751 |
|
752 |
;; Stall from imul to lea is 8 cycles. |
753 |
(define_bypass 9 "atom_imul, atom_imul_mem" "atom_lea") |
754 |
|
755 |
;; Stall from imul to memory address is 8 cycles. |
756 |
(define_bypass 9 "atom_imul, atom_imul_mem" |
757 |
"atom_alu_mem, atom_alu_carry_mem, atom_alu1_mem, |
758 |
atom_negnot_mem, atom_imov_mem, atom_incdec_mem, |
759 |
atom_ishift_mem, atom_ishift1_mem, atom_rotate_mem, |
760 |
atom_rotate1_mem, atom_imul_mem, atom_icmp_mem, |
761 |
atom_test_mem, atom_icmov_mem, atom_sselog_mem, |
762 |
atom_sselog1_mem, atom_fmov_mem, atom_sseadd_mem" |
763 |
"ix86_agi_dependent") |
764 |
|
765 |
;; There will be 0 cycle stall from cmp/test to jcc |
766 |
|
767 |
;; There will be 1 cycle stall from flag producer to cmov and adc/sbb |
768 |
(define_bypass 2 "atom_icmp, atom_test, atom_alu, atom_alu_carry, |
769 |
atom_alu1, atom_negnot, atom_incdec, atom_ishift, |
770 |
atom_ishift1, atom_rotate, atom_rotate1" |
771 |
"atom_icmov, atom_alu_carry") |
772 |
|
773 |
;; lea to shift count stall is 2 cycles |
774 |
(define_bypass 3 "atom_lea" |
775 |
"atom_ishift, atom_ishift1, atom_rotate, atom_rotate1, |
776 |
atom_ishift_mem, atom_ishift1_mem, |
777 |
atom_rotate_mem, atom_rotate1_mem" |
778 |
"ix86_dep_by_shift_count") |
779 |
|
780 |
;; lea to shift source stall is 1 cycle |
781 |
(define_bypass 2 "atom_lea" |
782 |
"atom_ishift, atom_ishift1, atom_rotate, atom_rotate1" |
783 |
"!ix86_dep_by_shift_count") |
784 |
|
785 |
;; non-lea to shift count stall is 1 cycle |
786 |
(define_bypass 2 "atom_alu_carry, |
787 |
atom_alu,atom_alu1,atom_negnot,atom_imov,atom_imovx, |
788 |
atom_incdec,atom_ishift,atom_ishift1,atom_rotate, |
789 |
atom_rotate1, atom_setcc, atom_icmov, atom_pop, |
790 |
atom_alu_mem, atom_alu_carry_mem, atom_alu1_mem, |
791 |
atom_imovx_mem, atom_imovx_2_mem, |
792 |
atom_imov_mem, atom_icmov_mem, atom_fmov_mem" |
793 |
"atom_ishift, atom_ishift1, atom_rotate, atom_rotate1, |
794 |
atom_ishift_mem, atom_ishift1_mem, |
795 |
atom_rotate_mem, atom_rotate1_mem" |
796 |
"ix86_dep_by_shift_count") |