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