]>
Commit | Line | Data |
---|---|---|
df41dbaf | 1 | /* Costs of operations of individual x86 CPUs. |
a945c346 | 2 | Copyright (C) 1988-2024 Free Software Foundation, Inc. |
64766e8d | 3 | |
df41dbaf JH |
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 3, 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 | Under Section 7 of GPL version 3, you are granted additional | |
17 | permissions described in the GCC Runtime Library Exception, version | |
18 | 3.1, as published by the Free Software Foundation. | |
19 | ||
20 | You should have received a copy of the GNU General Public License and | |
21 | a copy of the GCC Runtime Library Exception along with this program; | |
22 | see the files COPYING3 and COPYING.RUNTIME respectively. If not, see | |
23 | <http://www.gnu.org/licenses/>. */ | |
64766e8d JH |
24 | /* Processor costs (relative to an add) */ |
25 | /* We assume COSTS_N_INSNS is defined as (N)*4 and an addition is 2 bytes. */ | |
26 | #define COSTS_N_BYTES(N) ((N) * 2) | |
27 | ||
28 | #define DUMMY_STRINGOP_ALGS {libcall, {{-1, libcall, false}}} | |
29 | ||
30 | static stringop_algs ix86_size_memcpy[2] = { | |
31 | {rep_prefix_1_byte, {{-1, rep_prefix_1_byte, false}}}, | |
32 | {rep_prefix_1_byte, {{-1, rep_prefix_1_byte, false}}}}; | |
33 | static stringop_algs ix86_size_memset[2] = { | |
34 | {rep_prefix_1_byte, {{-1, rep_prefix_1_byte, false}}}, | |
35 | {rep_prefix_1_byte, {{-1, rep_prefix_1_byte, false}}}}; | |
36 | ||
37 | const | |
38 | struct processor_costs ix86_size_cost = {/* costs for tuning for size */ | |
72bb85f8 | 39 | { |
d321551c L |
40 | /* Start of register allocator costs. integer->integer move cost is 2. */ |
41 | 2, /* cost for loading QImode using movzbl */ | |
42 | {2, 2, 2}, /* cost of loading integer registers | |
43 | in QImode, HImode and SImode. | |
44 | Relative to reg-reg move (2). */ | |
45 | {2, 2, 2}, /* cost of storing integer registers */ | |
46 | 2, /* cost of reg,reg fld/fst */ | |
47 | {2, 2, 2}, /* cost of loading fp registers | |
48 | in SFmode, DFmode and XFmode */ | |
49 | {2, 2, 2}, /* cost of storing fp registers | |
50 | in SFmode, DFmode and XFmode */ | |
51 | 3, /* cost of moving MMX register */ | |
52 | {3, 3}, /* cost of loading MMX registers | |
53 | in SImode and DImode */ | |
54 | {3, 3}, /* cost of storing MMX registers | |
55 | in SImode and DImode */ | |
56 | 3, 3, 3, /* cost of moving XMM,YMM,ZMM register */ | |
57 | {3, 3, 3, 3, 3}, /* cost of loading SSE registers | |
58 | in 32,64,128,256 and 512-bit */ | |
59 | {3, 3, 3, 3, 3}, /* cost of storing SSE registers | |
60 | in 32,64,128,256 and 512-bit */ | |
ecc3135a | 61 | 3, 3, /* SSE->integer and integer->SSE moves */ |
62 | 3, 3, /* mask->integer and integer->mask moves */ | |
00cb3494 L |
63 | {2, 2, 2}, /* cost of loading mask register |
64 | in QImode, HImode, SImode. */ | |
65 | {2, 2, 2}, /* cost if storing mask register | |
66 | in QImode, HImode, SImode. */ | |
67 | 2, /* cost of moving mask register. */ | |
d321551c | 68 | /* End of register allocator costs. */ |
72bb85f8 | 69 | }, |
d321551c | 70 | |
64766e8d JH |
71 | COSTS_N_BYTES (2), /* cost of an add instruction */ |
72 | COSTS_N_BYTES (3), /* cost of a lea instruction */ | |
73 | COSTS_N_BYTES (2), /* variable shift costs */ | |
74 | COSTS_N_BYTES (3), /* constant shift costs */ | |
75 | {COSTS_N_BYTES (3), /* cost of starting multiply for QI */ | |
76 | COSTS_N_BYTES (3), /* HI */ | |
77 | COSTS_N_BYTES (3), /* SI */ | |
78 | COSTS_N_BYTES (3), /* DI */ | |
79 | COSTS_N_BYTES (5)}, /* other */ | |
80 | 0, /* cost of multiply per each bit set */ | |
81 | {COSTS_N_BYTES (3), /* cost of a divide/mod for QI */ | |
82 | COSTS_N_BYTES (3), /* HI */ | |
83 | COSTS_N_BYTES (3), /* SI */ | |
84 | COSTS_N_BYTES (3), /* DI */ | |
85 | COSTS_N_BYTES (5)}, /* other */ | |
86 | COSTS_N_BYTES (3), /* cost of movsx */ | |
87 | COSTS_N_BYTES (3), /* cost of movzx */ | |
88 | 0, /* "large" insn */ | |
89 | 2, /* MOVE_RATIO */ | |
25e22b19 | 90 | 2, /* CLEAR_RATIO */ |
64766e8d JH |
91 | {2, 2, 2}, /* cost of loading integer registers |
92 | in QImode, HImode and SImode. | |
93 | Relative to reg-reg move (2). */ | |
94 | {2, 2, 2}, /* cost of storing integer registers */ | |
d321551c L |
95 | {3, 3, 3, 3, 3}, /* cost of loading SSE register |
96 | in 32bit, 64bit, 128bit, 256bit and 512bit */ | |
97 | {3, 3, 3, 3, 3}, /* cost of storing SSE register | |
98 | in 32bit, 64bit, 128bit, 256bit and 512bit */ | |
df41dbaf JH |
99 | {3, 3, 3, 3, 3}, /* cost of unaligned SSE load |
100 | in 128bit, 256bit and 512bit */ | |
d321551c | 101 | {3, 3, 3, 3, 3}, /* cost of unaligned SSE store |
df41dbaf | 102 | in 128bit, 256bit and 512bit */ |
d321551c L |
103 | 3, 3, 3, /* cost of moving XMM,YMM,ZMM register */ |
104 | 3, /* cost of moving SSE register to integer. */ | |
a4fe6139 JH |
105 | 5, 0, /* Gather load static, per_elt. */ |
106 | 5, 0, /* Gather store static, per_elt. */ | |
64766e8d JH |
107 | 0, /* size of l1 cache */ |
108 | 0, /* size of l2 cache */ | |
109 | 0, /* size of prefetch block */ | |
110 | 0, /* number of parallel prefetches */ | |
111 | 2, /* Branch cost */ | |
112 | COSTS_N_BYTES (2), /* cost of FADD and FSUB insns. */ | |
113 | COSTS_N_BYTES (2), /* cost of FMUL instruction. */ | |
114 | COSTS_N_BYTES (2), /* cost of FDIV instruction. */ | |
115 | COSTS_N_BYTES (2), /* cost of FABS instruction. */ | |
116 | COSTS_N_BYTES (2), /* cost of FCHS instruction. */ | |
117 | COSTS_N_BYTES (2), /* cost of FSQRT instruction. */ | |
6065f444 | 118 | |
c53c148c | 119 | COSTS_N_BYTES (2), /* cost of cheap SSE instruction. */ |
6065f444 JH |
120 | COSTS_N_BYTES (2), /* cost of ADDSS/SD SUBSS/SD insns. */ |
121 | COSTS_N_BYTES (2), /* cost of MULSS instruction. */ | |
122 | COSTS_N_BYTES (2), /* cost of MULSD instruction. */ | |
c53c148c JH |
123 | COSTS_N_BYTES (2), /* cost of FMA SS instruction. */ |
124 | COSTS_N_BYTES (2), /* cost of FMA SD instruction. */ | |
6065f444 JH |
125 | COSTS_N_BYTES (2), /* cost of DIVSS instruction. */ |
126 | COSTS_N_BYTES (2), /* cost of DIVSD instruction. */ | |
127 | COSTS_N_BYTES (2), /* cost of SQRTSS instruction. */ | |
128 | COSTS_N_BYTES (2), /* cost of SQRTSD instruction. */ | |
64766e8d JH |
129 | 1, 1, 1, 1, /* reassoc int, fp, vec_int, vec_fp. */ |
130 | ix86_size_memcpy, | |
131 | ix86_size_memset, | |
f6fd8f2b JH |
132 | COSTS_N_BYTES (1), /* cond_taken_branch_cost. */ |
133 | COSTS_N_BYTES (1), /* cond_not_taken_branch_cost. */ | |
7dc58b50 ML |
134 | NULL, /* Loop alignment. */ |
135 | NULL, /* Jump alignment. */ | |
136 | NULL, /* Label alignment. */ | |
137 | NULL, /* Func alignment. */ | |
071e428c HW |
138 | 4, /* Small unroll limit. */ |
139 | 2, /* Small unroll factor. */ | |
64766e8d JH |
140 | }; |
141 | ||
142 | /* Processor costs (relative to an add) */ | |
143 | static stringop_algs i386_memcpy[2] = { | |
144 | {rep_prefix_1_byte, {{-1, rep_prefix_1_byte, false}}}, | |
145 | DUMMY_STRINGOP_ALGS}; | |
146 | static stringop_algs i386_memset[2] = { | |
147 | {rep_prefix_1_byte, {{-1, rep_prefix_1_byte, false}}}, | |
148 | DUMMY_STRINGOP_ALGS}; | |
149 | ||
150 | static const | |
151 | struct processor_costs i386_cost = { /* 386 specific costs */ | |
72bb85f8 | 152 | { |
d321551c L |
153 | /* Start of register allocator costs. integer->integer move cost is 2. */ |
154 | 4, /* cost for loading QImode using movzbl */ | |
155 | {2, 4, 2}, /* cost of loading integer registers | |
156 | in QImode, HImode and SImode. | |
157 | Relative to reg-reg move (2). */ | |
158 | {2, 4, 2}, /* cost of storing integer registers */ | |
159 | 2, /* cost of reg,reg fld/fst */ | |
160 | {8, 8, 8}, /* cost of loading fp registers | |
161 | in SFmode, DFmode and XFmode */ | |
162 | {8, 8, 8}, /* cost of storing fp registers | |
163 | in SFmode, DFmode and XFmode */ | |
164 | 2, /* cost of moving MMX register */ | |
165 | {4, 8}, /* cost of loading MMX registers | |
166 | in SImode and DImode */ | |
167 | {4, 8}, /* cost of storing MMX registers | |
168 | in SImode and DImode */ | |
169 | 2, 4, 8, /* cost of moving XMM,YMM,ZMM register */ | |
170 | {4, 8, 16, 32, 64}, /* cost of loading SSE registers | |
171 | in 32,64,128,256 and 512-bit */ | |
172 | {4, 8, 16, 32, 64}, /* cost of storing SSE registers | |
173 | in 32,64,128,256 and 512-bit */ | |
ecc3135a | 174 | 3, 3, /* SSE->integer and integer->SSE moves */ |
175 | 3, 3, /* mask->integer and integer->mask moves */ | |
00cb3494 L |
176 | {2, 4, 2}, /* cost of loading mask register |
177 | in QImode, HImode, SImode. */ | |
178 | {2, 4, 2}, /* cost if storing mask register | |
179 | in QImode, HImode, SImode. */ | |
180 | 2, /* cost of moving mask register. */ | |
d321551c | 181 | /* End of register allocator costs. */ |
72bb85f8 | 182 | }, |
d321551c | 183 | |
64766e8d JH |
184 | COSTS_N_INSNS (1), /* cost of an add instruction */ |
185 | COSTS_N_INSNS (1), /* cost of a lea instruction */ | |
186 | COSTS_N_INSNS (3), /* variable shift costs */ | |
187 | COSTS_N_INSNS (2), /* constant shift costs */ | |
188 | {COSTS_N_INSNS (6), /* cost of starting multiply for QI */ | |
189 | COSTS_N_INSNS (6), /* HI */ | |
190 | COSTS_N_INSNS (6), /* SI */ | |
191 | COSTS_N_INSNS (6), /* DI */ | |
192 | COSTS_N_INSNS (6)}, /* other */ | |
193 | COSTS_N_INSNS (1), /* cost of multiply per each bit set */ | |
194 | {COSTS_N_INSNS (23), /* cost of a divide/mod for QI */ | |
195 | COSTS_N_INSNS (23), /* HI */ | |
196 | COSTS_N_INSNS (23), /* SI */ | |
197 | COSTS_N_INSNS (23), /* DI */ | |
198 | COSTS_N_INSNS (23)}, /* other */ | |
199 | COSTS_N_INSNS (3), /* cost of movsx */ | |
200 | COSTS_N_INSNS (2), /* cost of movzx */ | |
201 | 15, /* "large" insn */ | |
202 | 3, /* MOVE_RATIO */ | |
25e22b19 | 203 | 3, /* CLEAR_RATIO */ |
64766e8d JH |
204 | {2, 4, 2}, /* cost of loading integer registers |
205 | in QImode, HImode and SImode. | |
206 | Relative to reg-reg move (2). */ | |
207 | {2, 4, 2}, /* cost of storing integer registers */ | |
d321551c L |
208 | {4, 8, 16, 32, 64}, /* cost of loading SSE register |
209 | in 32bit, 64bit, 128bit, 256bit and 512bit */ | |
210 | {4, 8, 16, 32, 64}, /* cost of storing SSE register | |
211 | in 32bit, 64bit, 128bit, 256bit and 512bit */ | |
df41dbaf | 212 | {4, 8, 16, 32, 64}, /* cost of unaligned loads. */ |
df41dbaf | 213 | {4, 8, 16, 32, 64}, /* cost of unaligned stores. */ |
d321551c L |
214 | 2, 4, 8, /* cost of moving XMM,YMM,ZMM register */ |
215 | 3, /* cost of moving SSE register to integer. */ | |
a4fe6139 JH |
216 | 4, 4, /* Gather load static, per_elt. */ |
217 | 4, 4, /* Gather store static, per_elt. */ | |
64766e8d JH |
218 | 0, /* size of l1 cache */ |
219 | 0, /* size of l2 cache */ | |
220 | 0, /* size of prefetch block */ | |
221 | 0, /* number of parallel prefetches */ | |
222 | 1, /* Branch cost */ | |
223 | COSTS_N_INSNS (23), /* cost of FADD and FSUB insns. */ | |
224 | COSTS_N_INSNS (27), /* cost of FMUL instruction. */ | |
225 | COSTS_N_INSNS (88), /* cost of FDIV instruction. */ | |
226 | COSTS_N_INSNS (22), /* cost of FABS instruction. */ | |
227 | COSTS_N_INSNS (24), /* cost of FCHS instruction. */ | |
228 | COSTS_N_INSNS (122), /* cost of FSQRT instruction. */ | |
6065f444 | 229 | |
c53c148c | 230 | COSTS_N_INSNS (1), /* cost of cheap SSE instruction. */ |
6065f444 JH |
231 | COSTS_N_INSNS (23), /* cost of ADDSS/SD SUBSS/SD insns. */ |
232 | COSTS_N_INSNS (27), /* cost of MULSS instruction. */ | |
233 | COSTS_N_INSNS (27), /* cost of MULSD instruction. */ | |
c53c148c JH |
234 | COSTS_N_INSNS (27), /* cost of FMA SS instruction. */ |
235 | COSTS_N_INSNS (27), /* cost of FMA SD instruction. */ | |
6065f444 JH |
236 | COSTS_N_INSNS (88), /* cost of DIVSS instruction. */ |
237 | COSTS_N_INSNS (88), /* cost of DIVSD instruction. */ | |
238 | COSTS_N_INSNS (122), /* cost of SQRTSS instruction. */ | |
239 | COSTS_N_INSNS (122), /* cost of SQRTSD instruction. */ | |
64766e8d JH |
240 | 1, 1, 1, 1, /* reassoc int, fp, vec_int, vec_fp. */ |
241 | i386_memcpy, | |
242 | i386_memset, | |
f6fd8f2b JH |
243 | COSTS_N_INSNS (3), /* cond_taken_branch_cost. */ |
244 | COSTS_N_INSNS (1), /* cond_not_taken_branch_cost. */ | |
7dc58b50 ML |
245 | "4", /* Loop alignment. */ |
246 | "4", /* Jump alignment. */ | |
247 | NULL, /* Label alignment. */ | |
248 | "4", /* Func alignment. */ | |
071e428c HW |
249 | 4, /* Small unroll limit. */ |
250 | 2, /* Small unroll factor. */ | |
64766e8d JH |
251 | }; |
252 | ||
253 | static stringop_algs i486_memcpy[2] = { | |
254 | {rep_prefix_4_byte, {{-1, rep_prefix_4_byte, false}}}, | |
255 | DUMMY_STRINGOP_ALGS}; | |
256 | static stringop_algs i486_memset[2] = { | |
257 | {rep_prefix_4_byte, {{-1, rep_prefix_4_byte, false}}}, | |
258 | DUMMY_STRINGOP_ALGS}; | |
259 | ||
260 | static const | |
261 | struct processor_costs i486_cost = { /* 486 specific costs */ | |
72bb85f8 | 262 | { |
d321551c L |
263 | /* Start of register allocator costs. integer->integer move cost is 2. */ |
264 | 4, /* cost for loading QImode using movzbl */ | |
265 | {2, 4, 2}, /* cost of loading integer registers | |
266 | in QImode, HImode and SImode. | |
267 | Relative to reg-reg move (2). */ | |
268 | {2, 4, 2}, /* cost of storing integer registers */ | |
269 | 2, /* cost of reg,reg fld/fst */ | |
270 | {8, 8, 8}, /* cost of loading fp registers | |
271 | in SFmode, DFmode and XFmode */ | |
272 | {8, 8, 8}, /* cost of storing fp registers | |
273 | in SFmode, DFmode and XFmode */ | |
274 | 2, /* cost of moving MMX register */ | |
275 | {4, 8}, /* cost of loading MMX registers | |
276 | in SImode and DImode */ | |
277 | {4, 8}, /* cost of storing MMX registers | |
278 | in SImode and DImode */ | |
279 | 2, 4, 8, /* cost of moving XMM,YMM,ZMM register */ | |
280 | {4, 8, 16, 32, 64}, /* cost of loading SSE registers | |
281 | in 32,64,128,256 and 512-bit */ | |
282 | {4, 8, 16, 32, 64}, /* cost of storing SSE registers | |
283 | in 32,64,128,256 and 512-bit */ | |
ecc3135a | 284 | 3, 3, /* SSE->integer and integer->SSE moves */ |
285 | 3, 3, /* mask->integer and integer->mask moves */ | |
00cb3494 L |
286 | {2, 4, 2}, /* cost of loading mask register |
287 | in QImode, HImode, SImode. */ | |
288 | {2, 4, 2}, /* cost if storing mask register | |
289 | in QImode, HImode, SImode. */ | |
290 | 2, /* cost of moving mask register. */ | |
d321551c | 291 | /* End of register allocator costs. */ |
72bb85f8 | 292 | }, |
d321551c | 293 | |
64766e8d JH |
294 | COSTS_N_INSNS (1), /* cost of an add instruction */ |
295 | COSTS_N_INSNS (1), /* cost of a lea instruction */ | |
296 | COSTS_N_INSNS (3), /* variable shift costs */ | |
297 | COSTS_N_INSNS (2), /* constant shift costs */ | |
298 | {COSTS_N_INSNS (12), /* cost of starting multiply for QI */ | |
299 | COSTS_N_INSNS (12), /* HI */ | |
300 | COSTS_N_INSNS (12), /* SI */ | |
301 | COSTS_N_INSNS (12), /* DI */ | |
302 | COSTS_N_INSNS (12)}, /* other */ | |
303 | 1, /* cost of multiply per each bit set */ | |
304 | {COSTS_N_INSNS (40), /* cost of a divide/mod for QI */ | |
305 | COSTS_N_INSNS (40), /* HI */ | |
306 | COSTS_N_INSNS (40), /* SI */ | |
307 | COSTS_N_INSNS (40), /* DI */ | |
308 | COSTS_N_INSNS (40)}, /* other */ | |
309 | COSTS_N_INSNS (3), /* cost of movsx */ | |
310 | COSTS_N_INSNS (2), /* cost of movzx */ | |
311 | 15, /* "large" insn */ | |
312 | 3, /* MOVE_RATIO */ | |
25e22b19 | 313 | 3, /* CLEAR_RATIO */ |
64766e8d JH |
314 | {2, 4, 2}, /* cost of loading integer registers |
315 | in QImode, HImode and SImode. | |
316 | Relative to reg-reg move (2). */ | |
317 | {2, 4, 2}, /* cost of storing integer registers */ | |
d321551c L |
318 | {4, 8, 16, 32, 64}, /* cost of loading SSE register |
319 | in 32bit, 64bit, 128bit, 256bit and 512bit */ | |
320 | {4, 8, 16, 32, 64}, /* cost of storing SSE register | |
321 | in 32bit, 64bit, 128bit, 256bit and 512bit */ | |
df41dbaf | 322 | {4, 8, 16, 32, 64}, /* cost of unaligned loads. */ |
df41dbaf | 323 | {4, 8, 16, 32, 64}, /* cost of unaligned stores. */ |
d321551c L |
324 | 2, 4, 8, /* cost of moving XMM,YMM,ZMM register */ |
325 | 3, /* cost of moving SSE register to integer. */ | |
a4fe6139 JH |
326 | 4, 4, /* Gather load static, per_elt. */ |
327 | 4, 4, /* Gather store static, per_elt. */ | |
64766e8d JH |
328 | 4, /* size of l1 cache. 486 has 8kB cache |
329 | shared for code and data, so 4kB is | |
330 | not really precise. */ | |
331 | 4, /* size of l2 cache */ | |
332 | 0, /* size of prefetch block */ | |
333 | 0, /* number of parallel prefetches */ | |
334 | 1, /* Branch cost */ | |
335 | COSTS_N_INSNS (8), /* cost of FADD and FSUB insns. */ | |
336 | COSTS_N_INSNS (16), /* cost of FMUL instruction. */ | |
337 | COSTS_N_INSNS (73), /* cost of FDIV instruction. */ | |
338 | COSTS_N_INSNS (3), /* cost of FABS instruction. */ | |
339 | COSTS_N_INSNS (3), /* cost of FCHS instruction. */ | |
340 | COSTS_N_INSNS (83), /* cost of FSQRT instruction. */ | |
6065f444 | 341 | |
c53c148c | 342 | COSTS_N_INSNS (1), /* cost of cheap SSE instruction. */ |
6065f444 JH |
343 | COSTS_N_INSNS (8), /* cost of ADDSS/SD SUBSS/SD insns. */ |
344 | COSTS_N_INSNS (16), /* cost of MULSS instruction. */ | |
345 | COSTS_N_INSNS (16), /* cost of MULSD instruction. */ | |
c53c148c JH |
346 | COSTS_N_INSNS (16), /* cost of FMA SS instruction. */ |
347 | COSTS_N_INSNS (16), /* cost of FMA SD instruction. */ | |
6065f444 JH |
348 | COSTS_N_INSNS (73), /* cost of DIVSS instruction. */ |
349 | COSTS_N_INSNS (74), /* cost of DIVSD instruction. */ | |
350 | COSTS_N_INSNS (83), /* cost of SQRTSS instruction. */ | |
351 | COSTS_N_INSNS (83), /* cost of SQRTSD instruction. */ | |
64766e8d JH |
352 | 1, 1, 1, 1, /* reassoc int, fp, vec_int, vec_fp. */ |
353 | i486_memcpy, | |
354 | i486_memset, | |
f6fd8f2b JH |
355 | COSTS_N_INSNS (3), /* cond_taken_branch_cost. */ |
356 | COSTS_N_INSNS (1), /* cond_not_taken_branch_cost. */ | |
7dc58b50 ML |
357 | "16", /* Loop alignment. */ |
358 | "16", /* Jump alignment. */ | |
359 | "0:0:8", /* Label alignment. */ | |
360 | "16", /* Func alignment. */ | |
071e428c HW |
361 | 4, /* Small unroll limit. */ |
362 | 2, /* Small unroll factor. */ | |
64766e8d JH |
363 | }; |
364 | ||
365 | static stringop_algs pentium_memcpy[2] = { | |
366 | {libcall, {{256, rep_prefix_4_byte, false}, {-1, libcall, false}}}, | |
367 | DUMMY_STRINGOP_ALGS}; | |
368 | static stringop_algs pentium_memset[2] = { | |
369 | {libcall, {{-1, rep_prefix_4_byte, false}}}, | |
370 | DUMMY_STRINGOP_ALGS}; | |
371 | ||
372 | static const | |
373 | struct processor_costs pentium_cost = { | |
72bb85f8 | 374 | { |
d321551c L |
375 | /* Start of register allocator costs. integer->integer move cost is 2. */ |
376 | 6, /* cost for loading QImode using movzbl */ | |
377 | {2, 4, 2}, /* cost of loading integer registers | |
378 | in QImode, HImode and SImode. | |
379 | Relative to reg-reg move (2). */ | |
380 | {2, 4, 2}, /* cost of storing integer registers */ | |
381 | 2, /* cost of reg,reg fld/fst */ | |
382 | {2, 2, 6}, /* cost of loading fp registers | |
383 | in SFmode, DFmode and XFmode */ | |
384 | {4, 4, 6}, /* cost of storing fp registers | |
385 | in SFmode, DFmode and XFmode */ | |
386 | 8, /* cost of moving MMX register */ | |
387 | {8, 8}, /* cost of loading MMX registers | |
388 | in SImode and DImode */ | |
389 | {8, 8}, /* cost of storing MMX registers | |
390 | in SImode and DImode */ | |
391 | 2, 4, 8, /* cost of moving XMM,YMM,ZMM register */ | |
392 | {4, 8, 16, 32, 64}, /* cost of loading SSE registers | |
393 | in 32,64,128,256 and 512-bit */ | |
394 | {4, 8, 16, 32, 64}, /* cost of storing SSE registers | |
395 | in 32,64,128,256 and 512-bit */ | |
ecc3135a | 396 | 3, 3, /* SSE->integer and integer->SSE moves */ |
397 | 3, 3, /* mask->integer and integer->mask moves */ | |
00cb3494 L |
398 | {2, 4, 2}, /* cost of loading mask register |
399 | in QImode, HImode, SImode. */ | |
400 | {2, 4, 2}, /* cost if storing mask register | |
401 | in QImode, HImode, SImode. */ | |
402 | 2, /* cost of moving mask register. */ | |
d321551c | 403 | /* End of register allocator costs. */ |
72bb85f8 | 404 | }, |
d321551c | 405 | |
64766e8d JH |
406 | COSTS_N_INSNS (1), /* cost of an add instruction */ |
407 | COSTS_N_INSNS (1), /* cost of a lea instruction */ | |
408 | COSTS_N_INSNS (4), /* variable shift costs */ | |
409 | COSTS_N_INSNS (1), /* constant shift costs */ | |
410 | {COSTS_N_INSNS (11), /* cost of starting multiply for QI */ | |
411 | COSTS_N_INSNS (11), /* HI */ | |
412 | COSTS_N_INSNS (11), /* SI */ | |
413 | COSTS_N_INSNS (11), /* DI */ | |
414 | COSTS_N_INSNS (11)}, /* other */ | |
415 | 0, /* cost of multiply per each bit set */ | |
416 | {COSTS_N_INSNS (25), /* cost of a divide/mod for QI */ | |
417 | COSTS_N_INSNS (25), /* HI */ | |
418 | COSTS_N_INSNS (25), /* SI */ | |
419 | COSTS_N_INSNS (25), /* DI */ | |
420 | COSTS_N_INSNS (25)}, /* other */ | |
421 | COSTS_N_INSNS (3), /* cost of movsx */ | |
422 | COSTS_N_INSNS (2), /* cost of movzx */ | |
423 | 8, /* "large" insn */ | |
424 | 6, /* MOVE_RATIO */ | |
25e22b19 | 425 | 6, /* CLEAR_RATIO */ |
64766e8d JH |
426 | {2, 4, 2}, /* cost of loading integer registers |
427 | in QImode, HImode and SImode. | |
428 | Relative to reg-reg move (2). */ | |
429 | {2, 4, 2}, /* cost of storing integer registers */ | |
d321551c L |
430 | {4, 8, 16, 32, 64}, /* cost of loading SSE register |
431 | in 32bit, 64bit, 128bit, 256bit and 512bit */ | |
432 | {4, 8, 16, 32, 64}, /* cost of storing SSE register | |
433 | in 32bit, 64bit, 128bit, 256bit and 512bit */ | |
df41dbaf | 434 | {4, 8, 16, 32, 64}, /* cost of unaligned loads. */ |
df41dbaf | 435 | {4, 8, 16, 32, 64}, /* cost of unaligned stores. */ |
d321551c L |
436 | 2, 4, 8, /* cost of moving XMM,YMM,ZMM register */ |
437 | 3, /* cost of moving SSE register to integer. */ | |
a4fe6139 JH |
438 | 4, 4, /* Gather load static, per_elt. */ |
439 | 4, 4, /* Gather store static, per_elt. */ | |
64766e8d JH |
440 | 8, /* size of l1 cache. */ |
441 | 8, /* size of l2 cache */ | |
442 | 0, /* size of prefetch block */ | |
443 | 0, /* number of parallel prefetches */ | |
444 | 2, /* Branch cost */ | |
445 | COSTS_N_INSNS (3), /* cost of FADD and FSUB insns. */ | |
446 | COSTS_N_INSNS (3), /* cost of FMUL instruction. */ | |
447 | COSTS_N_INSNS (39), /* cost of FDIV instruction. */ | |
448 | COSTS_N_INSNS (1), /* cost of FABS instruction. */ | |
449 | COSTS_N_INSNS (1), /* cost of FCHS instruction. */ | |
450 | COSTS_N_INSNS (70), /* cost of FSQRT instruction. */ | |
6065f444 | 451 | |
c53c148c | 452 | COSTS_N_INSNS (1), /* cost of cheap SSE instruction. */ |
6065f444 JH |
453 | COSTS_N_INSNS (3), /* cost of ADDSS/SD SUBSS/SD insns. */ |
454 | COSTS_N_INSNS (3), /* cost of MULSS instruction. */ | |
455 | COSTS_N_INSNS (3), /* cost of MULSD instruction. */ | |
c53c148c JH |
456 | COSTS_N_INSNS (6), /* cost of FMA SS instruction. */ |
457 | COSTS_N_INSNS (6), /* cost of FMA SD instruction. */ | |
6065f444 JH |
458 | COSTS_N_INSNS (39), /* cost of DIVSS instruction. */ |
459 | COSTS_N_INSNS (39), /* cost of DIVSD instruction. */ | |
460 | COSTS_N_INSNS (70), /* cost of SQRTSS instruction. */ | |
461 | COSTS_N_INSNS (70), /* cost of SQRTSD instruction. */ | |
64766e8d JH |
462 | 1, 1, 1, 1, /* reassoc int, fp, vec_int, vec_fp. */ |
463 | pentium_memcpy, | |
464 | pentium_memset, | |
f6fd8f2b JH |
465 | COSTS_N_INSNS (3), /* cond_taken_branch_cost. */ |
466 | COSTS_N_INSNS (1), /* cond_not_taken_branch_cost. */ | |
7dc58b50 ML |
467 | "16:8:8", /* Loop alignment. */ |
468 | "16:8:8", /* Jump alignment. */ | |
469 | "0:0:8", /* Label alignment. */ | |
470 | "16", /* Func alignment. */ | |
071e428c HW |
471 | 4, /* Small unroll limit. */ |
472 | 2, /* Small unroll factor. */ | |
64766e8d JH |
473 | }; |
474 | ||
475 | static const | |
476 | struct processor_costs lakemont_cost = { | |
72bb85f8 | 477 | { |
d321551c L |
478 | /* Start of register allocator costs. integer->integer move cost is 2. */ |
479 | 6, /* cost for loading QImode using movzbl */ | |
480 | {2, 4, 2}, /* cost of loading integer registers | |
481 | in QImode, HImode and SImode. | |
482 | Relative to reg-reg move (2). */ | |
483 | {2, 4, 2}, /* cost of storing integer registers */ | |
484 | 2, /* cost of reg,reg fld/fst */ | |
485 | {2, 2, 6}, /* cost of loading fp registers | |
486 | in SFmode, DFmode and XFmode */ | |
487 | {4, 4, 6}, /* cost of storing fp registers | |
488 | in SFmode, DFmode and XFmode */ | |
489 | 8, /* cost of moving MMX register */ | |
490 | {8, 8}, /* cost of loading MMX registers | |
491 | in SImode and DImode */ | |
492 | {8, 8}, /* cost of storing MMX registers | |
493 | in SImode and DImode */ | |
494 | 2, 4, 8, /* cost of moving XMM,YMM,ZMM register */ | |
495 | {4, 8, 16, 32, 64}, /* cost of loading SSE registers | |
496 | in 32,64,128,256 and 512-bit */ | |
497 | {4, 8, 16, 32, 64}, /* cost of storing SSE registers | |
498 | in 32,64,128,256 and 512-bit */ | |
ecc3135a | 499 | 3, 3, /* SSE->integer and integer->SSE moves */ |
500 | 3, 3, /* mask->integer and integer->mask moves */ | |
00cb3494 L |
501 | {2, 4, 2}, /* cost of loading mask register |
502 | in QImode, HImode, SImode. */ | |
503 | {2, 4, 2}, /* cost if storing mask register | |
504 | in QImode, HImode, SImode. */ | |
505 | 2, /* cost of moving mask register. */ | |
d321551c | 506 | /* End of register allocator costs. */ |
72bb85f8 | 507 | }, |
d321551c | 508 | |
64766e8d JH |
509 | COSTS_N_INSNS (1), /* cost of an add instruction */ |
510 | COSTS_N_INSNS (1) + 1, /* cost of a lea instruction */ | |
511 | COSTS_N_INSNS (1), /* variable shift costs */ | |
512 | COSTS_N_INSNS (1), /* constant shift costs */ | |
513 | {COSTS_N_INSNS (11), /* cost of starting multiply for QI */ | |
514 | COSTS_N_INSNS (11), /* HI */ | |
515 | COSTS_N_INSNS (11), /* SI */ | |
516 | COSTS_N_INSNS (11), /* DI */ | |
517 | COSTS_N_INSNS (11)}, /* other */ | |
518 | 0, /* cost of multiply per each bit set */ | |
519 | {COSTS_N_INSNS (25), /* cost of a divide/mod for QI */ | |
520 | COSTS_N_INSNS (25), /* HI */ | |
521 | COSTS_N_INSNS (25), /* SI */ | |
522 | COSTS_N_INSNS (25), /* DI */ | |
523 | COSTS_N_INSNS (25)}, /* other */ | |
524 | COSTS_N_INSNS (3), /* cost of movsx */ | |
525 | COSTS_N_INSNS (2), /* cost of movzx */ | |
526 | 8, /* "large" insn */ | |
527 | 17, /* MOVE_RATIO */ | |
25e22b19 | 528 | 6, /* CLEAR_RATIO */ |
64766e8d JH |
529 | {2, 4, 2}, /* cost of loading integer registers |
530 | in QImode, HImode and SImode. | |
531 | Relative to reg-reg move (2). */ | |
532 | {2, 4, 2}, /* cost of storing integer registers */ | |
d321551c L |
533 | {4, 8, 16, 32, 64}, /* cost of loading SSE register |
534 | in 32bit, 64bit, 128bit, 256bit and 512bit */ | |
535 | {4, 8, 16, 32, 64}, /* cost of storing SSE register | |
536 | in 32bit, 64bit, 128bit, 256bit and 512bit */ | |
df41dbaf | 537 | {4, 8, 16, 32, 64}, /* cost of unaligned loads. */ |
df41dbaf | 538 | {4, 8, 16, 32, 64}, /* cost of unaligned stores. */ |
d321551c L |
539 | 2, 4, 8, /* cost of moving XMM,YMM,ZMM register */ |
540 | 3, /* cost of moving SSE register to integer. */ | |
a4fe6139 JH |
541 | 4, 4, /* Gather load static, per_elt. */ |
542 | 4, 4, /* Gather store static, per_elt. */ | |
64766e8d JH |
543 | 8, /* size of l1 cache. */ |
544 | 8, /* size of l2 cache */ | |
545 | 0, /* size of prefetch block */ | |
546 | 0, /* number of parallel prefetches */ | |
547 | 2, /* Branch cost */ | |
548 | COSTS_N_INSNS (3), /* cost of FADD and FSUB insns. */ | |
549 | COSTS_N_INSNS (3), /* cost of FMUL instruction. */ | |
550 | COSTS_N_INSNS (39), /* cost of FDIV instruction. */ | |
551 | COSTS_N_INSNS (1), /* cost of FABS instruction. */ | |
552 | COSTS_N_INSNS (1), /* cost of FCHS instruction. */ | |
553 | COSTS_N_INSNS (70), /* cost of FSQRT instruction. */ | |
6065f444 | 554 | |
c53c148c | 555 | COSTS_N_INSNS (1), /* cost of cheap SSE instruction. */ |
6065f444 JH |
556 | COSTS_N_INSNS (5), /* cost of ADDSS/SD SUBSS/SD insns. */ |
557 | COSTS_N_INSNS (5), /* cost of MULSS instruction. */ | |
558 | COSTS_N_INSNS (5), /* cost of MULSD instruction. */ | |
c53c148c JH |
559 | COSTS_N_INSNS (10), /* cost of FMA SS instruction. */ |
560 | COSTS_N_INSNS (10), /* cost of FMA SD instruction. */ | |
6065f444 JH |
561 | COSTS_N_INSNS (31), /* cost of DIVSS instruction. */ |
562 | COSTS_N_INSNS (60), /* cost of DIVSD instruction. */ | |
563 | COSTS_N_INSNS (31), /* cost of SQRTSS instruction. */ | |
564 | COSTS_N_INSNS (63), /* cost of SQRTSD instruction. */ | |
64766e8d JH |
565 | 1, 1, 1, 1, /* reassoc int, fp, vec_int, vec_fp. */ |
566 | pentium_memcpy, | |
567 | pentium_memset, | |
f6fd8f2b JH |
568 | COSTS_N_INSNS (3), /* cond_taken_branch_cost. */ |
569 | COSTS_N_INSNS (1), /* cond_not_taken_branch_cost. */ | |
7dc58b50 ML |
570 | "16:8:8", /* Loop alignment. */ |
571 | "16:8:8", /* Jump alignment. */ | |
572 | "0:0:8", /* Label alignment. */ | |
573 | "16", /* Func alignment. */ | |
071e428c HW |
574 | 4, /* Small unroll limit. */ |
575 | 2, /* Small unroll factor. */ | |
64766e8d JH |
576 | }; |
577 | ||
578 | /* PentiumPro has optimized rep instructions for blocks aligned by 8 bytes | |
579 | (we ensure the alignment). For small blocks inline loop is still a | |
580 | noticeable win, for bigger blocks either rep movsl or rep movsb is | |
581 | way to go. Rep movsb has apparently more expensive startup time in CPU, | |
582 | but after 4K the difference is down in the noise. */ | |
583 | static stringop_algs pentiumpro_memcpy[2] = { | |
584 | {rep_prefix_4_byte, {{128, loop, false}, {1024, unrolled_loop, false}, | |
585 | {8192, rep_prefix_4_byte, false}, | |
586 | {-1, rep_prefix_1_byte, false}}}, | |
587 | DUMMY_STRINGOP_ALGS}; | |
588 | static stringop_algs pentiumpro_memset[2] = { | |
589 | {rep_prefix_4_byte, {{1024, unrolled_loop, false}, | |
590 | {8192, rep_prefix_4_byte, false}, | |
591 | {-1, libcall, false}}}, | |
592 | DUMMY_STRINGOP_ALGS}; | |
593 | static const | |
594 | struct processor_costs pentiumpro_cost = { | |
72bb85f8 | 595 | { |
d321551c L |
596 | /* Start of register allocator costs. integer->integer move cost is 2. */ |
597 | 2, /* cost for loading QImode using movzbl */ | |
598 | {4, 4, 4}, /* cost of loading integer registers | |
599 | in QImode, HImode and SImode. | |
600 | Relative to reg-reg move (2). */ | |
601 | {2, 2, 2}, /* cost of storing integer registers */ | |
602 | 2, /* cost of reg,reg fld/fst */ | |
603 | {2, 2, 6}, /* cost of loading fp registers | |
604 | in SFmode, DFmode and XFmode */ | |
605 | {4, 4, 6}, /* cost of storing fp registers | |
606 | in SFmode, DFmode and XFmode */ | |
607 | 2, /* cost of moving MMX register */ | |
608 | {2, 2}, /* cost of loading MMX registers | |
609 | in SImode and DImode */ | |
610 | {2, 2}, /* cost of storing MMX registers | |
611 | in SImode and DImode */ | |
612 | 2, 4, 8, /* cost of moving XMM,YMM,ZMM register */ | |
613 | {4, 8, 16, 32, 64}, /* cost of loading SSE registers | |
614 | in 32,64,128,256 and 512-bit */ | |
615 | {4, 8, 16, 32, 64}, /* cost of storing SSE registers | |
616 | in 32,64,128,256 and 512-bit */ | |
ecc3135a | 617 | 3, 3, /* SSE->integer and integer->SSE moves */ |
618 | 3, 3, /* mask->integer and integer->mask moves */ | |
00cb3494 L |
619 | {4, 4, 4}, /* cost of loading mask register |
620 | in QImode, HImode, SImode. */ | |
621 | {2, 2, 2}, /* cost if storing mask register | |
622 | in QImode, HImode, SImode. */ | |
623 | 2, /* cost of moving mask register. */ | |
d321551c | 624 | /* End of register allocator costs. */ |
72bb85f8 | 625 | }, |
d321551c | 626 | |
64766e8d JH |
627 | COSTS_N_INSNS (1), /* cost of an add instruction */ |
628 | COSTS_N_INSNS (1), /* cost of a lea instruction */ | |
629 | COSTS_N_INSNS (1), /* variable shift costs */ | |
630 | COSTS_N_INSNS (1), /* constant shift costs */ | |
631 | {COSTS_N_INSNS (4), /* cost of starting multiply for QI */ | |
632 | COSTS_N_INSNS (4), /* HI */ | |
633 | COSTS_N_INSNS (4), /* SI */ | |
634 | COSTS_N_INSNS (4), /* DI */ | |
635 | COSTS_N_INSNS (4)}, /* other */ | |
636 | 0, /* cost of multiply per each bit set */ | |
637 | {COSTS_N_INSNS (17), /* cost of a divide/mod for QI */ | |
638 | COSTS_N_INSNS (17), /* HI */ | |
639 | COSTS_N_INSNS (17), /* SI */ | |
640 | COSTS_N_INSNS (17), /* DI */ | |
641 | COSTS_N_INSNS (17)}, /* other */ | |
642 | COSTS_N_INSNS (1), /* cost of movsx */ | |
643 | COSTS_N_INSNS (1), /* cost of movzx */ | |
644 | 8, /* "large" insn */ | |
645 | 6, /* MOVE_RATIO */ | |
25e22b19 | 646 | 6, /* CLEAR_RATIO */ |
64766e8d JH |
647 | {4, 4, 4}, /* cost of loading integer registers |
648 | in QImode, HImode and SImode. | |
649 | Relative to reg-reg move (2). */ | |
650 | {2, 2, 2}, /* cost of storing integer registers */ | |
d321551c L |
651 | {4, 8, 16, 32, 64}, /* cost of loading SSE register |
652 | in 32bit, 64bit, 128bit, 256bit and 512bit */ | |
653 | {4, 8, 16, 32, 64}, /* cost of storing SSE register | |
654 | in 32bit, 64bit, 128bit, 256bit and 512bit */ | |
df41dbaf | 655 | {4, 8, 16, 32, 64}, /* cost of unaligned loads. */ |
df41dbaf | 656 | {4, 8, 16, 32, 64}, /* cost of unaligned stores. */ |
d321551c L |
657 | 2, 4, 8, /* cost of moving XMM,YMM,ZMM register */ |
658 | 3, /* cost of moving SSE register to integer. */ | |
a4fe6139 JH |
659 | 4, 4, /* Gather load static, per_elt. */ |
660 | 4, 4, /* Gather store static, per_elt. */ | |
64766e8d JH |
661 | 8, /* size of l1 cache. */ |
662 | 256, /* size of l2 cache */ | |
663 | 32, /* size of prefetch block */ | |
664 | 6, /* number of parallel prefetches */ | |
665 | 2, /* Branch cost */ | |
666 | COSTS_N_INSNS (3), /* cost of FADD and FSUB insns. */ | |
667 | COSTS_N_INSNS (5), /* cost of FMUL instruction. */ | |
668 | COSTS_N_INSNS (56), /* cost of FDIV instruction. */ | |
669 | COSTS_N_INSNS (2), /* cost of FABS instruction. */ | |
670 | COSTS_N_INSNS (2), /* cost of FCHS instruction. */ | |
671 | COSTS_N_INSNS (56), /* cost of FSQRT instruction. */ | |
6065f444 | 672 | |
c53c148c | 673 | COSTS_N_INSNS (1), /* cost of cheap SSE instruction. */ |
6065f444 JH |
674 | COSTS_N_INSNS (3), /* cost of ADDSS/SD SUBSS/SD insns. */ |
675 | COSTS_N_INSNS (4), /* cost of MULSS instruction. */ | |
676 | COSTS_N_INSNS (4), /* cost of MULSD instruction. */ | |
c53c148c JH |
677 | COSTS_N_INSNS (7), /* cost of FMA SS instruction. */ |
678 | COSTS_N_INSNS (7), /* cost of FMA SD instruction. */ | |
6065f444 JH |
679 | COSTS_N_INSNS (18), /* cost of DIVSS instruction. */ |
680 | COSTS_N_INSNS (18), /* cost of DIVSD instruction. */ | |
681 | COSTS_N_INSNS (31), /* cost of SQRTSS instruction. */ | |
682 | COSTS_N_INSNS (31), /* cost of SQRTSD instruction. */ | |
64766e8d JH |
683 | 1, 1, 1, 1, /* reassoc int, fp, vec_int, vec_fp. */ |
684 | pentiumpro_memcpy, | |
685 | pentiumpro_memset, | |
f6fd8f2b JH |
686 | COSTS_N_INSNS (3), /* cond_taken_branch_cost. */ |
687 | COSTS_N_INSNS (1), /* cond_not_taken_branch_cost. */ | |
7dc58b50 ML |
688 | "16", /* Loop alignment. */ |
689 | "16:11:8", /* Jump alignment. */ | |
690 | "0:0:8", /* Label alignment. */ | |
691 | "16", /* Func alignment. */ | |
071e428c HW |
692 | 4, /* Small unroll limit. */ |
693 | 2, /* Small unroll factor. */ | |
64766e8d JH |
694 | }; |
695 | ||
696 | static stringop_algs geode_memcpy[2] = { | |
697 | {libcall, {{256, rep_prefix_4_byte, false}, {-1, libcall, false}}}, | |
698 | DUMMY_STRINGOP_ALGS}; | |
699 | static stringop_algs geode_memset[2] = { | |
700 | {libcall, {{256, rep_prefix_4_byte, false}, {-1, libcall, false}}}, | |
701 | DUMMY_STRINGOP_ALGS}; | |
702 | static const | |
703 | struct processor_costs geode_cost = { | |
72bb85f8 | 704 | { |
d321551c L |
705 | /* Start of register allocator costs. integer->integer move cost is 2. */ |
706 | 2, /* cost for loading QImode using movzbl */ | |
707 | {2, 2, 2}, /* cost of loading integer registers | |
708 | in QImode, HImode and SImode. | |
709 | Relative to reg-reg move (2). */ | |
710 | {2, 2, 2}, /* cost of storing integer registers */ | |
711 | 2, /* cost of reg,reg fld/fst */ | |
712 | {2, 2, 2}, /* cost of loading fp registers | |
713 | in SFmode, DFmode and XFmode */ | |
714 | {4, 6, 6}, /* cost of storing fp registers | |
715 | in SFmode, DFmode and XFmode */ | |
716 | 2, /* cost of moving MMX register */ | |
717 | {2, 2}, /* cost of loading MMX registers | |
718 | in SImode and DImode */ | |
719 | {2, 2}, /* cost of storing MMX registers | |
720 | in SImode and DImode */ | |
721 | 2, 4, 8, /* cost of moving XMM,YMM,ZMM register */ | |
722 | {2, 2, 8, 16, 32}, /* cost of loading SSE registers | |
723 | in 32,64,128,256 and 512-bit */ | |
724 | {2, 2, 8, 16, 32}, /* cost of storing SSE registers | |
725 | in 32,64,128,256 and 512-bit */ | |
ecc3135a | 726 | 6, 6, /* SSE->integer and integer->SSE moves */ |
727 | 6, 6, /* mask->integer and integer->mask moves */ | |
00cb3494 L |
728 | {2, 2, 2}, /* cost of loading mask register |
729 | in QImode, HImode, SImode. */ | |
730 | {2, 2, 2}, /* cost if storing mask register | |
731 | in QImode, HImode, SImode. */ | |
732 | 2, /* cost of moving mask register. */ | |
d321551c | 733 | /* End of register allocator costs. */ |
72bb85f8 | 734 | }, |
d321551c | 735 | |
64766e8d JH |
736 | COSTS_N_INSNS (1), /* cost of an add instruction */ |
737 | COSTS_N_INSNS (1), /* cost of a lea instruction */ | |
738 | COSTS_N_INSNS (2), /* variable shift costs */ | |
739 | COSTS_N_INSNS (1), /* constant shift costs */ | |
740 | {COSTS_N_INSNS (3), /* cost of starting multiply for QI */ | |
741 | COSTS_N_INSNS (4), /* HI */ | |
742 | COSTS_N_INSNS (7), /* SI */ | |
743 | COSTS_N_INSNS (7), /* DI */ | |
744 | COSTS_N_INSNS (7)}, /* other */ | |
745 | 0, /* cost of multiply per each bit set */ | |
746 | {COSTS_N_INSNS (15), /* cost of a divide/mod for QI */ | |
747 | COSTS_N_INSNS (23), /* HI */ | |
748 | COSTS_N_INSNS (39), /* SI */ | |
749 | COSTS_N_INSNS (39), /* DI */ | |
750 | COSTS_N_INSNS (39)}, /* other */ | |
751 | COSTS_N_INSNS (1), /* cost of movsx */ | |
752 | COSTS_N_INSNS (1), /* cost of movzx */ | |
753 | 8, /* "large" insn */ | |
754 | 4, /* MOVE_RATIO */ | |
25e22b19 | 755 | 4, /* CLEAR_RATIO */ |
df41dbaf | 756 | {2, 2, 2}, /* cost of loading integer registers |
64766e8d JH |
757 | in QImode, HImode and SImode. |
758 | Relative to reg-reg move (2). */ | |
df41dbaf | 759 | {2, 2, 2}, /* cost of storing integer registers */ |
d321551c L |
760 | {2, 2, 8, 16, 32}, /* cost of loading SSE register |
761 | in 32bit, 64bit, 128bit, 256bit and 512bit */ | |
762 | {2, 2, 8, 16, 32}, /* cost of storing SSE register | |
763 | in 32bit, 64bit, 128bit, 256bit and 512bit */ | |
df41dbaf | 764 | {2, 2, 8, 16, 32}, /* cost of unaligned loads. */ |
df41dbaf | 765 | {2, 2, 8, 16, 32}, /* cost of unaligned stores. */ |
d321551c L |
766 | 2, 4, 8, /* cost of moving XMM,YMM,ZMM register */ |
767 | 6, /* cost of moving SSE register to integer. */ | |
a4fe6139 JH |
768 | 2, 2, /* Gather load static, per_elt. */ |
769 | 2, 2, /* Gather store static, per_elt. */ | |
64766e8d JH |
770 | 64, /* size of l1 cache. */ |
771 | 128, /* size of l2 cache. */ | |
772 | 32, /* size of prefetch block */ | |
773 | 1, /* number of parallel prefetches */ | |
774 | 1, /* Branch cost */ | |
775 | COSTS_N_INSNS (6), /* cost of FADD and FSUB insns. */ | |
776 | COSTS_N_INSNS (11), /* cost of FMUL instruction. */ | |
777 | COSTS_N_INSNS (47), /* cost of FDIV instruction. */ | |
778 | COSTS_N_INSNS (1), /* cost of FABS instruction. */ | |
779 | COSTS_N_INSNS (1), /* cost of FCHS instruction. */ | |
780 | COSTS_N_INSNS (54), /* cost of FSQRT instruction. */ | |
6065f444 | 781 | |
c53c148c | 782 | COSTS_N_INSNS (1), /* cost of cheap SSE instruction. */ |
6065f444 JH |
783 | COSTS_N_INSNS (6), /* cost of ADDSS/SD SUBSS/SD insns. */ |
784 | COSTS_N_INSNS (11), /* cost of MULSS instruction. */ | |
785 | COSTS_N_INSNS (11), /* cost of MULSD instruction. */ | |
c53c148c JH |
786 | COSTS_N_INSNS (17), /* cost of FMA SS instruction. */ |
787 | COSTS_N_INSNS (17), /* cost of FMA SD instruction. */ | |
6065f444 JH |
788 | COSTS_N_INSNS (47), /* cost of DIVSS instruction. */ |
789 | COSTS_N_INSNS (47), /* cost of DIVSD instruction. */ | |
790 | COSTS_N_INSNS (54), /* cost of SQRTSS instruction. */ | |
791 | COSTS_N_INSNS (54), /* cost of SQRTSD instruction. */ | |
64766e8d JH |
792 | 1, 1, 1, 1, /* reassoc int, fp, vec_int, vec_fp. */ |
793 | geode_memcpy, | |
794 | geode_memset, | |
f6fd8f2b JH |
795 | COSTS_N_INSNS (3), /* cond_taken_branch_cost. */ |
796 | COSTS_N_INSNS (1), /* cond_not_taken_branch_cost. */ | |
7dc58b50 ML |
797 | NULL, /* Loop alignment. */ |
798 | NULL, /* Jump alignment. */ | |
799 | NULL, /* Label alignment. */ | |
800 | NULL, /* Func alignment. */ | |
071e428c HW |
801 | 4, /* Small unroll limit. */ |
802 | 2, /* Small unroll factor. */ | |
64766e8d JH |
803 | }; |
804 | ||
805 | static stringop_algs k6_memcpy[2] = { | |
806 | {libcall, {{256, rep_prefix_4_byte, false}, {-1, libcall, false}}}, | |
807 | DUMMY_STRINGOP_ALGS}; | |
808 | static stringop_algs k6_memset[2] = { | |
809 | {libcall, {{256, rep_prefix_4_byte, false}, {-1, libcall, false}}}, | |
810 | DUMMY_STRINGOP_ALGS}; | |
811 | static const | |
812 | struct processor_costs k6_cost = { | |
72bb85f8 | 813 | { |
d321551c L |
814 | /* Start of register allocator costs. integer->integer move cost is 2. */ |
815 | 3, /* cost for loading QImode using movzbl */ | |
816 | {4, 5, 4}, /* cost of loading integer registers | |
817 | in QImode, HImode and SImode. | |
818 | Relative to reg-reg move (2). */ | |
819 | {2, 3, 2}, /* cost of storing integer registers */ | |
820 | 4, /* cost of reg,reg fld/fst */ | |
821 | {6, 6, 6}, /* cost of loading fp registers | |
822 | in SFmode, DFmode and XFmode */ | |
823 | {4, 4, 4}, /* cost of storing fp registers | |
824 | in SFmode, DFmode and XFmode */ | |
825 | 2, /* cost of moving MMX register */ | |
826 | {2, 2}, /* cost of loading MMX registers | |
827 | in SImode and DImode */ | |
828 | {2, 2}, /* cost of storing MMX registers | |
829 | in SImode and DImode */ | |
830 | 2, 4, 8, /* cost of moving XMM,YMM,ZMM register */ | |
831 | {2, 2, 8, 16, 32}, /* cost of loading SSE registers | |
832 | in 32,64,128,256 and 512-bit */ | |
833 | {2, 2, 8, 16, 32}, /* cost of storing SSE registers | |
834 | in 32,64,128,256 and 512-bit */ | |
ecc3135a | 835 | 6, 6, /* SSE->integer and integer->SSE moves */ |
836 | 6, 6, /* mask->integer and integer->mask moves */ | |
00cb3494 L |
837 | {4, 5, 4}, /* cost of loading mask register |
838 | in QImode, HImode, SImode. */ | |
839 | {2, 3, 2}, /* cost if storing mask register | |
840 | in QImode, HImode, SImode. */ | |
841 | 2, /* cost of moving mask register. */ | |
d321551c | 842 | /* End of register allocator costs. */ |
72bb85f8 | 843 | }, |
d321551c | 844 | |
64766e8d JH |
845 | COSTS_N_INSNS (1), /* cost of an add instruction */ |
846 | COSTS_N_INSNS (2), /* cost of a lea instruction */ | |
847 | COSTS_N_INSNS (1), /* variable shift costs */ | |
848 | COSTS_N_INSNS (1), /* constant shift costs */ | |
849 | {COSTS_N_INSNS (3), /* cost of starting multiply for QI */ | |
850 | COSTS_N_INSNS (3), /* HI */ | |
851 | COSTS_N_INSNS (3), /* SI */ | |
852 | COSTS_N_INSNS (3), /* DI */ | |
853 | COSTS_N_INSNS (3)}, /* other */ | |
854 | 0, /* cost of multiply per each bit set */ | |
855 | {COSTS_N_INSNS (18), /* cost of a divide/mod for QI */ | |
856 | COSTS_N_INSNS (18), /* HI */ | |
857 | COSTS_N_INSNS (18), /* SI */ | |
858 | COSTS_N_INSNS (18), /* DI */ | |
859 | COSTS_N_INSNS (18)}, /* other */ | |
860 | COSTS_N_INSNS (2), /* cost of movsx */ | |
861 | COSTS_N_INSNS (2), /* cost of movzx */ | |
862 | 8, /* "large" insn */ | |
863 | 4, /* MOVE_RATIO */ | |
25e22b19 | 864 | 4, /* CLEAR_RATIO */ |
64766e8d JH |
865 | {4, 5, 4}, /* cost of loading integer registers |
866 | in QImode, HImode and SImode. | |
867 | Relative to reg-reg move (2). */ | |
868 | {2, 3, 2}, /* cost of storing integer registers */ | |
d321551c L |
869 | {2, 2, 8, 16, 32}, /* cost of loading SSE register |
870 | in 32bit, 64bit, 128bit, 256bit and 512bit */ | |
871 | {2, 2, 8, 16, 32}, /* cost of storing SSE register | |
872 | in 32bit, 64bit, 128bit, 256bit and 512bit */ | |
df41dbaf | 873 | {2, 2, 8, 16, 32}, /* cost of unaligned loads. */ |
df41dbaf | 874 | {2, 2, 8, 16, 32}, /* cost of unaligned stores. */ |
d321551c L |
875 | 2, 4, 8, /* cost of moving XMM,YMM,ZMM register */ |
876 | 6, /* cost of moving SSE register to integer. */ | |
a4fe6139 JH |
877 | 2, 2, /* Gather load static, per_elt. */ |
878 | 2, 2, /* Gather store static, per_elt. */ | |
64766e8d JH |
879 | 32, /* size of l1 cache. */ |
880 | 32, /* size of l2 cache. Some models | |
881 | have integrated l2 cache, but | |
882 | optimizing for k6 is not important | |
883 | enough to worry about that. */ | |
884 | 32, /* size of prefetch block */ | |
885 | 1, /* number of parallel prefetches */ | |
886 | 1, /* Branch cost */ | |
887 | COSTS_N_INSNS (2), /* cost of FADD and FSUB insns. */ | |
888 | COSTS_N_INSNS (2), /* cost of FMUL instruction. */ | |
889 | COSTS_N_INSNS (56), /* cost of FDIV instruction. */ | |
890 | COSTS_N_INSNS (2), /* cost of FABS instruction. */ | |
891 | COSTS_N_INSNS (2), /* cost of FCHS instruction. */ | |
892 | COSTS_N_INSNS (56), /* cost of FSQRT instruction. */ | |
6065f444 | 893 | |
c53c148c | 894 | COSTS_N_INSNS (1), /* cost of cheap SSE instruction. */ |
6065f444 JH |
895 | COSTS_N_INSNS (2), /* cost of ADDSS/SD SUBSS/SD insns. */ |
896 | COSTS_N_INSNS (2), /* cost of MULSS instruction. */ | |
897 | COSTS_N_INSNS (2), /* cost of MULSD instruction. */ | |
c53c148c JH |
898 | COSTS_N_INSNS (4), /* cost of FMA SS instruction. */ |
899 | COSTS_N_INSNS (4), /* cost of FMA SD instruction. */ | |
6065f444 JH |
900 | COSTS_N_INSNS (56), /* cost of DIVSS instruction. */ |
901 | COSTS_N_INSNS (56), /* cost of DIVSD instruction. */ | |
902 | COSTS_N_INSNS (56), /* cost of SQRTSS instruction. */ | |
903 | COSTS_N_INSNS (56), /* cost of SQRTSD instruction. */ | |
64766e8d JH |
904 | 1, 1, 1, 1, /* reassoc int, fp, vec_int, vec_fp. */ |
905 | k6_memcpy, | |
906 | k6_memset, | |
f6fd8f2b JH |
907 | COSTS_N_INSNS (3), /* cond_taken_branch_cost. */ |
908 | COSTS_N_INSNS (1), /* cond_not_taken_branch_cost. */ | |
7dc58b50 ML |
909 | "32:8:8", /* Loop alignment. */ |
910 | "32:8:8", /* Jump alignment. */ | |
911 | "0:0:8", /* Label alignment. */ | |
912 | "32", /* Func alignment. */ | |
071e428c HW |
913 | 4, /* Small unroll limit. */ |
914 | 2, /* Small unroll factor. */ | |
64766e8d JH |
915 | }; |
916 | ||
917 | /* For some reason, Athlon deals better with REP prefix (relative to loops) | |
918 | compared to K8. Alignment becomes important after 8 bytes for memcpy and | |
919 | 128 bytes for memset. */ | |
920 | static stringop_algs athlon_memcpy[2] = { | |
921 | {libcall, {{2048, rep_prefix_4_byte, false}, {-1, libcall, false}}}, | |
922 | DUMMY_STRINGOP_ALGS}; | |
923 | static stringop_algs athlon_memset[2] = { | |
924 | {libcall, {{2048, rep_prefix_4_byte, false}, {-1, libcall, false}}}, | |
925 | DUMMY_STRINGOP_ALGS}; | |
926 | static const | |
927 | struct processor_costs athlon_cost = { | |
72bb85f8 | 928 | { |
d321551c L |
929 | /* Start of register allocator costs. integer->integer move cost is 2. */ |
930 | 4, /* cost for loading QImode using movzbl */ | |
931 | {3, 4, 3}, /* cost of loading integer registers | |
932 | in QImode, HImode and SImode. | |
933 | Relative to reg-reg move (2). */ | |
934 | {3, 4, 3}, /* cost of storing integer registers */ | |
935 | 4, /* cost of reg,reg fld/fst */ | |
936 | {4, 4, 12}, /* cost of loading fp registers | |
937 | in SFmode, DFmode and XFmode */ | |
938 | {6, 6, 8}, /* cost of storing fp registers | |
939 | in SFmode, DFmode and XFmode */ | |
940 | 2, /* cost of moving MMX register */ | |
941 | {4, 4}, /* cost of loading MMX registers | |
942 | in SImode and DImode */ | |
943 | {4, 4}, /* cost of storing MMX registers | |
944 | in SImode and DImode */ | |
945 | 2, 4, 8, /* cost of moving XMM,YMM,ZMM register */ | |
946 | {4, 4, 12, 12, 24}, /* cost of loading SSE registers | |
947 | in 32,64,128,256 and 512-bit */ | |
948 | {4, 4, 10, 10, 20}, /* cost of storing SSE registers | |
949 | in 32,64,128,256 and 512-bit */ | |
ecc3135a | 950 | 5, 5, /* SSE->integer and integer->SSE moves */ |
951 | 5, 5, /* mask->integer and integer->mask moves */ | |
00cb3494 L |
952 | {3, 4, 3}, /* cost of loading mask register |
953 | in QImode, HImode, SImode. */ | |
954 | {3, 4, 3}, /* cost if storing mask register | |
955 | in QImode, HImode, SImode. */ | |
956 | 2, /* cost of moving mask register. */ | |
d321551c | 957 | /* End of register allocator costs. */ |
72bb85f8 | 958 | }, |
d321551c | 959 | |
64766e8d JH |
960 | COSTS_N_INSNS (1), /* cost of an add instruction */ |
961 | COSTS_N_INSNS (2), /* cost of a lea instruction */ | |
962 | COSTS_N_INSNS (1), /* variable shift costs */ | |
963 | COSTS_N_INSNS (1), /* constant shift costs */ | |
964 | {COSTS_N_INSNS (5), /* cost of starting multiply for QI */ | |
965 | COSTS_N_INSNS (5), /* HI */ | |
966 | COSTS_N_INSNS (5), /* SI */ | |
967 | COSTS_N_INSNS (5), /* DI */ | |
968 | COSTS_N_INSNS (5)}, /* other */ | |
969 | 0, /* cost of multiply per each bit set */ | |
970 | {COSTS_N_INSNS (18), /* cost of a divide/mod for QI */ | |
971 | COSTS_N_INSNS (26), /* HI */ | |
972 | COSTS_N_INSNS (42), /* SI */ | |
973 | COSTS_N_INSNS (74), /* DI */ | |
974 | COSTS_N_INSNS (74)}, /* other */ | |
975 | COSTS_N_INSNS (1), /* cost of movsx */ | |
976 | COSTS_N_INSNS (1), /* cost of movzx */ | |
977 | 8, /* "large" insn */ | |
978 | 9, /* MOVE_RATIO */ | |
25e22b19 | 979 | 6, /* CLEAR_RATIO */ |
64766e8d JH |
980 | {3, 4, 3}, /* cost of loading integer registers |
981 | in QImode, HImode and SImode. | |
982 | Relative to reg-reg move (2). */ | |
983 | {3, 4, 3}, /* cost of storing integer registers */ | |
d321551c L |
984 | {4, 4, 12, 12, 24}, /* cost of loading SSE register |
985 | in 32bit, 64bit, 128bit, 256bit and 512bit */ | |
986 | {4, 4, 10, 10, 20}, /* cost of storing SSE register | |
987 | in 32bit, 64bit, 128bit, 256bit and 512bit */ | |
b7167993 | 988 | {4, 4, 12, 12, 24}, /* cost of unaligned loads. */ |
b7167993 | 989 | {4, 4, 10, 10, 20}, /* cost of unaligned stores. */ |
d321551c L |
990 | 2, 4, 8, /* cost of moving XMM,YMM,ZMM register */ |
991 | 5, /* cost of moving SSE register to integer. */ | |
a4fe6139 JH |
992 | 4, 4, /* Gather load static, per_elt. */ |
993 | 4, 4, /* Gather store static, per_elt. */ | |
64766e8d JH |
994 | 64, /* size of l1 cache. */ |
995 | 256, /* size of l2 cache. */ | |
996 | 64, /* size of prefetch block */ | |
997 | 6, /* number of parallel prefetches */ | |
998 | 5, /* Branch cost */ | |
999 | COSTS_N_INSNS (4), /* cost of FADD and FSUB insns. */ | |
1000 | COSTS_N_INSNS (4), /* cost of FMUL instruction. */ | |
1001 | COSTS_N_INSNS (24), /* cost of FDIV instruction. */ | |
1002 | COSTS_N_INSNS (2), /* cost of FABS instruction. */ | |
1003 | COSTS_N_INSNS (2), /* cost of FCHS instruction. */ | |
1004 | COSTS_N_INSNS (35), /* cost of FSQRT instruction. */ | |
6065f444 | 1005 | |
c53c148c | 1006 | COSTS_N_INSNS (2), /* cost of cheap SSE instruction. */ |
6065f444 JH |
1007 | COSTS_N_INSNS (4), /* cost of ADDSS/SD SUBSS/SD insns. */ |
1008 | COSTS_N_INSNS (4), /* cost of MULSS instruction. */ | |
1009 | COSTS_N_INSNS (4), /* cost of MULSD instruction. */ | |
c53c148c JH |
1010 | COSTS_N_INSNS (8), /* cost of FMA SS instruction. */ |
1011 | COSTS_N_INSNS (8), /* cost of FMA SD instruction. */ | |
6065f444 JH |
1012 | /* 11-16 */ |
1013 | COSTS_N_INSNS (16), /* cost of DIVSS instruction. */ | |
1014 | COSTS_N_INSNS (24), /* cost of DIVSD instruction. */ | |
1015 | COSTS_N_INSNS (19), /* cost of SQRTSS instruction. */ | |
1016 | COSTS_N_INSNS (19), /* cost of SQRTSD instruction. */ | |
64766e8d JH |
1017 | 1, 1, 1, 1, /* reassoc int, fp, vec_int, vec_fp. */ |
1018 | athlon_memcpy, | |
1019 | athlon_memset, | |
f6fd8f2b JH |
1020 | COSTS_N_INSNS (3), /* cond_taken_branch_cost. */ |
1021 | COSTS_N_INSNS (1), /* cond_not_taken_branch_cost. */ | |
7dc58b50 ML |
1022 | "16:8:8", /* Loop alignment. */ |
1023 | "16:8:8", /* Jump alignment. */ | |
1024 | "0:0:8", /* Label alignment. */ | |
1025 | "16", /* Func alignment. */ | |
071e428c HW |
1026 | 4, /* Small unroll limit. */ |
1027 | 2, /* Small unroll factor. */ | |
64766e8d JH |
1028 | }; |
1029 | ||
1030 | /* K8 has optimized REP instruction for medium sized blocks, but for very | |
1031 | small blocks it is better to use loop. For large blocks, libcall can | |
1032 | do nontemporary accesses and beat inline considerably. */ | |
1033 | static stringop_algs k8_memcpy[2] = { | |
1034 | {libcall, {{6, loop, false}, {14, unrolled_loop, false}, | |
1035 | {-1, rep_prefix_4_byte, false}}}, | |
1036 | {libcall, {{16, loop, false}, {8192, rep_prefix_8_byte, false}, | |
1037 | {-1, libcall, false}}}}; | |
1038 | static stringop_algs k8_memset[2] = { | |
1039 | {libcall, {{8, loop, false}, {24, unrolled_loop, false}, | |
1040 | {2048, rep_prefix_4_byte, false}, {-1, libcall, false}}}, | |
1041 | {libcall, {{48, unrolled_loop, false}, | |
1042 | {8192, rep_prefix_8_byte, false}, {-1, libcall, false}}}}; | |
1043 | static const | |
1044 | struct processor_costs k8_cost = { | |
72bb85f8 | 1045 | { |
d321551c L |
1046 | /* Start of register allocator costs. integer->integer move cost is 2. */ |
1047 | 4, /* cost for loading QImode using movzbl */ | |
1048 | {3, 4, 3}, /* cost of loading integer registers | |
1049 | in QImode, HImode and SImode. | |
1050 | Relative to reg-reg move (2). */ | |
1051 | {3, 4, 3}, /* cost of storing integer registers */ | |
1052 | 4, /* cost of reg,reg fld/fst */ | |
1053 | {4, 4, 12}, /* cost of loading fp registers | |
1054 | in SFmode, DFmode and XFmode */ | |
1055 | {6, 6, 8}, /* cost of storing fp registers | |
1056 | in SFmode, DFmode and XFmode */ | |
1057 | 2, /* cost of moving MMX register */ | |
1058 | {3, 3}, /* cost of loading MMX registers | |
1059 | in SImode and DImode */ | |
1060 | {4, 4}, /* cost of storing MMX registers | |
1061 | in SImode and DImode */ | |
1062 | 2, 4, 8, /* cost of moving XMM,YMM,ZMM register */ | |
1063 | {4, 3, 12, 12, 24}, /* cost of loading SSE registers | |
1064 | in 32,64,128,256 and 512-bit */ | |
1065 | {4, 4, 10, 10, 20}, /* cost of storing SSE registers | |
1066 | in 32,64,128,256 and 512-bit */ | |
ecc3135a | 1067 | 5, 5, /* SSE->integer and integer->SSE moves */ |
1068 | 5, 5, /* mask->integer and integer->mask moves */ | |
00cb3494 L |
1069 | {3, 4, 3}, /* cost of loading mask register |
1070 | in QImode, HImode, SImode. */ | |
1071 | {3, 4, 3}, /* cost if storing mask register | |
1072 | in QImode, HImode, SImode. */ | |
1073 | 2, /* cost of moving mask register. */ | |
d321551c | 1074 | /* End of register allocator costs. */ |
72bb85f8 | 1075 | }, |
d321551c | 1076 | |
64766e8d JH |
1077 | COSTS_N_INSNS (1), /* cost of an add instruction */ |
1078 | COSTS_N_INSNS (2), /* cost of a lea instruction */ | |
1079 | COSTS_N_INSNS (1), /* variable shift costs */ | |
1080 | COSTS_N_INSNS (1), /* constant shift costs */ | |
1081 | {COSTS_N_INSNS (3), /* cost of starting multiply for QI */ | |
1082 | COSTS_N_INSNS (4), /* HI */ | |
1083 | COSTS_N_INSNS (3), /* SI */ | |
1084 | COSTS_N_INSNS (4), /* DI */ | |
1085 | COSTS_N_INSNS (5)}, /* other */ | |
1086 | 0, /* cost of multiply per each bit set */ | |
1087 | {COSTS_N_INSNS (18), /* cost of a divide/mod for QI */ | |
1088 | COSTS_N_INSNS (26), /* HI */ | |
1089 | COSTS_N_INSNS (42), /* SI */ | |
1090 | COSTS_N_INSNS (74), /* DI */ | |
1091 | COSTS_N_INSNS (74)}, /* other */ | |
1092 | COSTS_N_INSNS (1), /* cost of movsx */ | |
1093 | COSTS_N_INSNS (1), /* cost of movzx */ | |
1094 | 8, /* "large" insn */ | |
1095 | 9, /* MOVE_RATIO */ | |
25e22b19 | 1096 | 6, /* CLEAR_RATIO */ |
64766e8d JH |
1097 | {3, 4, 3}, /* cost of loading integer registers |
1098 | in QImode, HImode and SImode. | |
1099 | Relative to reg-reg move (2). */ | |
1100 | {3, 4, 3}, /* cost of storing integer registers */ | |
d321551c L |
1101 | {4, 3, 12, 12, 24}, /* cost of loading SSE register |
1102 | in 32bit, 64bit, 128bit, 256bit and 512bit */ | |
1103 | {4, 4, 10, 10, 20}, /* cost of storing SSE register | |
1104 | in 32bit, 64bit, 128bit, 256bit and 512bit */ | |
b7167993 | 1105 | {4, 3, 12, 12, 24}, /* cost of unaligned loads. */ |
b7167993 | 1106 | {4, 4, 10, 10, 20}, /* cost of unaligned stores. */ |
d321551c L |
1107 | 2, 4, 8, /* cost of moving XMM,YMM,ZMM register */ |
1108 | 5, /* cost of moving SSE register to integer. */ | |
a4fe6139 JH |
1109 | 4, 4, /* Gather load static, per_elt. */ |
1110 | 4, 4, /* Gather store static, per_elt. */ | |
64766e8d JH |
1111 | 64, /* size of l1 cache. */ |
1112 | 512, /* size of l2 cache. */ | |
1113 | 64, /* size of prefetch block */ | |
1114 | /* New AMD processors never drop prefetches; if they cannot be performed | |
1115 | immediately, they are queued. We set number of simultaneous prefetches | |
1116 | to a large constant to reflect this (it probably is not a good idea not | |
1117 | to limit number of prefetches at all, as their execution also takes some | |
1118 | time). */ | |
1119 | 100, /* number of parallel prefetches */ | |
1120 | 3, /* Branch cost */ | |
1121 | COSTS_N_INSNS (4), /* cost of FADD and FSUB insns. */ | |
1122 | COSTS_N_INSNS (4), /* cost of FMUL instruction. */ | |
1123 | COSTS_N_INSNS (19), /* cost of FDIV instruction. */ | |
1124 | COSTS_N_INSNS (2), /* cost of FABS instruction. */ | |
1125 | COSTS_N_INSNS (2), /* cost of FCHS instruction. */ | |
1126 | COSTS_N_INSNS (35), /* cost of FSQRT instruction. */ | |
6065f444 | 1127 | |
c53c148c | 1128 | COSTS_N_INSNS (2), /* cost of cheap SSE instruction. */ |
6065f444 JH |
1129 | COSTS_N_INSNS (4), /* cost of ADDSS/SD SUBSS/SD insns. */ |
1130 | COSTS_N_INSNS (4), /* cost of MULSS instruction. */ | |
1131 | COSTS_N_INSNS (4), /* cost of MULSD instruction. */ | |
c53c148c JH |
1132 | COSTS_N_INSNS (8), /* cost of FMA SS instruction. */ |
1133 | COSTS_N_INSNS (8), /* cost of FMA SD instruction. */ | |
6065f444 JH |
1134 | /* 11-16 */ |
1135 | COSTS_N_INSNS (16), /* cost of DIVSS instruction. */ | |
1136 | COSTS_N_INSNS (20), /* cost of DIVSD instruction. */ | |
1137 | COSTS_N_INSNS (19), /* cost of SQRTSS instruction. */ | |
1138 | COSTS_N_INSNS (27), /* cost of SQRTSD instruction. */ | |
64766e8d JH |
1139 | 1, 1, 1, 1, /* reassoc int, fp, vec_int, vec_fp. */ |
1140 | k8_memcpy, | |
1141 | k8_memset, | |
f6fd8f2b JH |
1142 | COSTS_N_INSNS (3), /* cond_taken_branch_cost. */ |
1143 | COSTS_N_INSNS (2), /* cond_not_taken_branch_cost. */ | |
7dc58b50 ML |
1144 | "16:8:8", /* Loop alignment. */ |
1145 | "16:8:8", /* Jump alignment. */ | |
1146 | "0:0:8", /* Label alignment. */ | |
1147 | "16", /* Func alignment. */ | |
071e428c HW |
1148 | 4, /* Small unroll limit. */ |
1149 | 2, /* Small unroll factor. */ | |
64766e8d JH |
1150 | }; |
1151 | ||
1152 | /* AMDFAM10 has optimized REP instruction for medium sized blocks, but for | |
1153 | very small blocks it is better to use loop. For large blocks, libcall can | |
1154 | do nontemporary accesses and beat inline considerably. */ | |
1155 | static stringop_algs amdfam10_memcpy[2] = { | |
1156 | {libcall, {{6, loop, false}, {14, unrolled_loop, false}, | |
1157 | {-1, rep_prefix_4_byte, false}}}, | |
1158 | {libcall, {{16, loop, false}, {8192, rep_prefix_8_byte, false}, | |
1159 | {-1, libcall, false}}}}; | |
1160 | static stringop_algs amdfam10_memset[2] = { | |
1161 | {libcall, {{8, loop, false}, {24, unrolled_loop, false}, | |
1162 | {2048, rep_prefix_4_byte, false}, {-1, libcall, false}}}, | |
1163 | {libcall, {{48, unrolled_loop, false}, {8192, rep_prefix_8_byte, false}, | |
1164 | {-1, libcall, false}}}}; | |
1165 | struct processor_costs amdfam10_cost = { | |
72bb85f8 | 1166 | { |
d321551c | 1167 | /* Start of register allocator costs. integer->integer move cost is 2. */ |
64766e8d JH |
1168 | 4, /* cost for loading QImode using movzbl */ |
1169 | {3, 4, 3}, /* cost of loading integer registers | |
1170 | in QImode, HImode and SImode. | |
1171 | Relative to reg-reg move (2). */ | |
1172 | {3, 4, 3}, /* cost of storing integer registers */ | |
1173 | 4, /* cost of reg,reg fld/fst */ | |
1174 | {4, 4, 12}, /* cost of loading fp registers | |
1175 | in SFmode, DFmode and XFmode */ | |
1176 | {6, 6, 8}, /* cost of storing fp registers | |
1177 | in SFmode, DFmode and XFmode */ | |
1178 | 2, /* cost of moving MMX register */ | |
1179 | {3, 3}, /* cost of loading MMX registers | |
1180 | in SImode and DImode */ | |
1181 | {4, 4}, /* cost of storing MMX registers | |
1182 | in SImode and DImode */ | |
df41dbaf JH |
1183 | 2, 4, 8, /* cost of moving XMM,YMM,ZMM register */ |
1184 | {4, 4, 3, 6, 12}, /* cost of loading SSE registers | |
1185 | in 32,64,128,256 and 512-bit */ | |
df41dbaf JH |
1186 | {4, 4, 5, 10, 20}, /* cost of storing SSE registers |
1187 | in 32,64,128,256 and 512-bit */ | |
ecc3135a | 1188 | 3, 3, /* SSE->integer and integer->SSE moves */ |
1189 | 3, 3, /* mask->integer and integer->mask moves */ | |
00cb3494 L |
1190 | {3, 4, 3}, /* cost of loading mask register |
1191 | in QImode, HImode, SImode. */ | |
1192 | {3, 4, 3}, /* cost if storing mask register | |
1193 | in QImode, HImode, SImode. */ | |
1194 | 2, /* cost of moving mask register. */ | |
d321551c | 1195 | |
64766e8d JH |
1196 | /* On K8: |
1197 | MOVD reg64, xmmreg Double FSTORE 4 | |
1198 | MOVD reg32, xmmreg Double FSTORE 4 | |
1199 | On AMDFAM10: | |
1200 | MOVD reg64, xmmreg Double FADD 3 | |
1201 | 1/1 1/1 | |
1202 | MOVD reg32, xmmreg Double FADD 3 | |
1203 | 1/1 1/1 */ | |
d321551c | 1204 | /* End of register allocator costs. */ |
72bb85f8 | 1205 | }, |
d321551c L |
1206 | |
1207 | COSTS_N_INSNS (1), /* cost of an add instruction */ | |
1208 | COSTS_N_INSNS (2), /* cost of a lea instruction */ | |
1209 | COSTS_N_INSNS (1), /* variable shift costs */ | |
1210 | COSTS_N_INSNS (1), /* constant shift costs */ | |
1211 | {COSTS_N_INSNS (3), /* cost of starting multiply for QI */ | |
1212 | COSTS_N_INSNS (4), /* HI */ | |
1213 | COSTS_N_INSNS (3), /* SI */ | |
1214 | COSTS_N_INSNS (4), /* DI */ | |
1215 | COSTS_N_INSNS (5)}, /* other */ | |
1216 | 0, /* cost of multiply per each bit set */ | |
1217 | {COSTS_N_INSNS (19), /* cost of a divide/mod for QI */ | |
1218 | COSTS_N_INSNS (35), /* HI */ | |
1219 | COSTS_N_INSNS (51), /* SI */ | |
1220 | COSTS_N_INSNS (83), /* DI */ | |
1221 | COSTS_N_INSNS (83)}, /* other */ | |
1222 | COSTS_N_INSNS (1), /* cost of movsx */ | |
1223 | COSTS_N_INSNS (1), /* cost of movzx */ | |
1224 | 8, /* "large" insn */ | |
1225 | 9, /* MOVE_RATIO */ | |
25e22b19 | 1226 | 6, /* CLEAR_RATIO */ |
d321551c L |
1227 | {3, 4, 3}, /* cost of loading integer registers |
1228 | in QImode, HImode and SImode. | |
1229 | Relative to reg-reg move (2). */ | |
1230 | {3, 4, 3}, /* cost of storing integer registers */ | |
1231 | {4, 4, 3, 6, 12}, /* cost of loading SSE register | |
1232 | in 32bit, 64bit, 128bit, 256bit and 512bit */ | |
1233 | {4, 4, 5, 10, 20}, /* cost of storing SSE register | |
1234 | in 32bit, 64bit, 128bit, 256bit and 512bit */ | |
1235 | {4, 4, 3, 7, 12}, /* cost of unaligned loads. */ | |
1236 | {4, 4, 5, 10, 20}, /* cost of unaligned stores. */ | |
1237 | 2, 4, 8, /* cost of moving XMM,YMM,ZMM register */ | |
1238 | 3, /* cost of moving SSE register to integer. */ | |
a4fe6139 JH |
1239 | 4, 4, /* Gather load static, per_elt. */ |
1240 | 4, 4, /* Gather store static, per_elt. */ | |
64766e8d JH |
1241 | 64, /* size of l1 cache. */ |
1242 | 512, /* size of l2 cache. */ | |
1243 | 64, /* size of prefetch block */ | |
1244 | /* New AMD processors never drop prefetches; if they cannot be performed | |
1245 | immediately, they are queued. We set number of simultaneous prefetches | |
1246 | to a large constant to reflect this (it probably is not a good idea not | |
1247 | to limit number of prefetches at all, as their execution also takes some | |
1248 | time). */ | |
1249 | 100, /* number of parallel prefetches */ | |
1250 | 2, /* Branch cost */ | |
1251 | COSTS_N_INSNS (4), /* cost of FADD and FSUB insns. */ | |
1252 | COSTS_N_INSNS (4), /* cost of FMUL instruction. */ | |
1253 | COSTS_N_INSNS (19), /* cost of FDIV instruction. */ | |
1254 | COSTS_N_INSNS (2), /* cost of FABS instruction. */ | |
1255 | COSTS_N_INSNS (2), /* cost of FCHS instruction. */ | |
1256 | COSTS_N_INSNS (35), /* cost of FSQRT instruction. */ | |
6065f444 | 1257 | |
c53c148c | 1258 | COSTS_N_INSNS (2), /* cost of cheap SSE instruction. */ |
6065f444 JH |
1259 | COSTS_N_INSNS (4), /* cost of ADDSS/SD SUBSS/SD insns. */ |
1260 | COSTS_N_INSNS (4), /* cost of MULSS instruction. */ | |
1261 | COSTS_N_INSNS (4), /* cost of MULSD instruction. */ | |
c53c148c JH |
1262 | COSTS_N_INSNS (8), /* cost of FMA SS instruction. */ |
1263 | COSTS_N_INSNS (8), /* cost of FMA SD instruction. */ | |
6065f444 JH |
1264 | /* 11-16 */ |
1265 | COSTS_N_INSNS (16), /* cost of DIVSS instruction. */ | |
1266 | COSTS_N_INSNS (20), /* cost of DIVSD instruction. */ | |
1267 | COSTS_N_INSNS (19), /* cost of SQRTSS instruction. */ | |
1268 | COSTS_N_INSNS (27), /* cost of SQRTSD instruction. */ | |
64766e8d JH |
1269 | 1, 1, 1, 1, /* reassoc int, fp, vec_int, vec_fp. */ |
1270 | amdfam10_memcpy, | |
1271 | amdfam10_memset, | |
f6fd8f2b JH |
1272 | COSTS_N_INSNS (2), /* cond_taken_branch_cost. */ |
1273 | COSTS_N_INSNS (1), /* cond_not_taken_branch_cost. */ | |
7dc58b50 ML |
1274 | "32:25:8", /* Loop alignment. */ |
1275 | "32:8:8", /* Jump alignment. */ | |
1276 | "0:0:8", /* Label alignment. */ | |
1277 | "32", /* Func alignment. */ | |
071e428c HW |
1278 | 4, /* Small unroll limit. */ |
1279 | 2, /* Small unroll factor. */ | |
64766e8d JH |
1280 | }; |
1281 | ||
c727b835 | 1282 | /* BDVER has optimized REP instruction for medium sized blocks, but for |
64766e8d JH |
1283 | very small blocks it is better to use loop. For large blocks, libcall |
1284 | can do nontemporary accesses and beat inline considerably. */ | |
c727b835 | 1285 | static stringop_algs bdver_memcpy[2] = { |
64766e8d JH |
1286 | {libcall, {{6, loop, false}, {14, unrolled_loop, false}, |
1287 | {-1, rep_prefix_4_byte, false}}}, | |
1288 | {libcall, {{16, loop, false}, {8192, rep_prefix_8_byte, false}, | |
1289 | {-1, libcall, false}}}}; | |
c727b835 | 1290 | static stringop_algs bdver_memset[2] = { |
64766e8d JH |
1291 | {libcall, {{8, loop, false}, {24, unrolled_loop, false}, |
1292 | {2048, rep_prefix_4_byte, false}, {-1, libcall, false}}}, | |
1293 | {libcall, {{48, unrolled_loop, false}, {8192, rep_prefix_8_byte, false}, | |
1294 | {-1, libcall, false}}}}; | |
1295 | ||
c727b835 | 1296 | const struct processor_costs bdver_cost = { |
72bb85f8 | 1297 | { |
d321551c L |
1298 | /* Start of register allocator costs. integer->integer move cost is 2. */ |
1299 | 8, /* cost for loading QImode using movzbl */ | |
1300 | {8, 8, 8}, /* cost of loading integer registers | |
1301 | in QImode, HImode and SImode. | |
1302 | Relative to reg-reg move (2). */ | |
1303 | {8, 8, 8}, /* cost of storing integer registers */ | |
1304 | 4, /* cost of reg,reg fld/fst */ | |
1305 | {12, 12, 28}, /* cost of loading fp registers | |
1306 | in SFmode, DFmode and XFmode */ | |
1307 | {10, 10, 18}, /* cost of storing fp registers | |
1308 | in SFmode, DFmode and XFmode */ | |
1309 | 4, /* cost of moving MMX register */ | |
1310 | {12, 12}, /* cost of loading MMX registers | |
1311 | in SImode and DImode */ | |
1312 | {10, 10}, /* cost of storing MMX registers | |
1313 | in SImode and DImode */ | |
1314 | 2, 4, 8, /* cost of moving XMM,YMM,ZMM register */ | |
1315 | {12, 12, 10, 40, 60}, /* cost of loading SSE registers | |
1316 | in 32,64,128,256 and 512-bit */ | |
1317 | {10, 10, 10, 40, 60}, /* cost of storing SSE registers | |
1318 | in 32,64,128,256 and 512-bit */ | |
1319 | 16, 20, /* SSE->integer and integer->SSE moves */ | |
ecc3135a | 1320 | 16, 20, /* mask->integer and integer->mask moves */ |
00cb3494 L |
1321 | {8, 8, 8}, /* cost of loading mask register |
1322 | in QImode, HImode, SImode. */ | |
1323 | {8, 8, 8}, /* cost if storing mask register | |
1324 | in QImode, HImode, SImode. */ | |
1325 | 2, /* cost of moving mask register. */ | |
d321551c | 1326 | /* End of register allocator costs. */ |
72bb85f8 | 1327 | }, |
d321551c | 1328 | |
64766e8d JH |
1329 | COSTS_N_INSNS (1), /* cost of an add instruction */ |
1330 | COSTS_N_INSNS (1), /* cost of a lea instruction */ | |
1331 | COSTS_N_INSNS (1), /* variable shift costs */ | |
1332 | COSTS_N_INSNS (1), /* constant shift costs */ | |
1333 | {COSTS_N_INSNS (4), /* cost of starting multiply for QI */ | |
1334 | COSTS_N_INSNS (4), /* HI */ | |
1335 | COSTS_N_INSNS (4), /* SI */ | |
1336 | COSTS_N_INSNS (6), /* DI */ | |
1337 | COSTS_N_INSNS (6)}, /* other */ | |
1338 | 0, /* cost of multiply per each bit set */ | |
1339 | {COSTS_N_INSNS (19), /* cost of a divide/mod for QI */ | |
1340 | COSTS_N_INSNS (35), /* HI */ | |
1341 | COSTS_N_INSNS (51), /* SI */ | |
1342 | COSTS_N_INSNS (83), /* DI */ | |
1343 | COSTS_N_INSNS (83)}, /* other */ | |
1344 | COSTS_N_INSNS (1), /* cost of movsx */ | |
1345 | COSTS_N_INSNS (1), /* cost of movzx */ | |
1346 | 8, /* "large" insn */ | |
1347 | 9, /* MOVE_RATIO */ | |
25e22b19 | 1348 | 6, /* CLEAR_RATIO */ |
df41dbaf | 1349 | {8, 8, 8}, /* cost of loading integer registers |
64766e8d JH |
1350 | in QImode, HImode and SImode. |
1351 | Relative to reg-reg move (2). */ | |
df41dbaf | 1352 | {8, 8, 8}, /* cost of storing integer registers */ |
d321551c L |
1353 | {12, 12, 10, 40, 60}, /* cost of loading SSE register |
1354 | in 32bit, 64bit, 128bit, 256bit and 512bit */ | |
1355 | {10, 10, 10, 40, 60}, /* cost of storing SSE register | |
1356 | in 32bit, 64bit, 128bit, 256bit and 512bit */ | |
b7167993 | 1357 | {12, 12, 10, 40, 60}, /* cost of unaligned loads. */ |
b7167993 | 1358 | {10, 10, 10, 40, 60}, /* cost of unaligned stores. */ |
d321551c L |
1359 | 2, 4, 8, /* cost of moving XMM,YMM,ZMM register */ |
1360 | 16, /* cost of moving SSE register to integer. */ | |
a4fe6139 JH |
1361 | 12, 12, /* Gather load static, per_elt. */ |
1362 | 10, 10, /* Gather store static, per_elt. */ | |
64766e8d JH |
1363 | 16, /* size of l1 cache. */ |
1364 | 2048, /* size of l2 cache. */ | |
1365 | 64, /* size of prefetch block */ | |
1366 | /* New AMD processors never drop prefetches; if they cannot be performed | |
1367 | immediately, they are queued. We set number of simultaneous prefetches | |
1368 | to a large constant to reflect this (it probably is not a good idea not | |
1369 | to limit number of prefetches at all, as their execution also takes some | |
1370 | time). */ | |
1371 | 100, /* number of parallel prefetches */ | |
1372 | 2, /* Branch cost */ | |
1373 | COSTS_N_INSNS (6), /* cost of FADD and FSUB insns. */ | |
1374 | COSTS_N_INSNS (6), /* cost of FMUL instruction. */ | |
1375 | COSTS_N_INSNS (42), /* cost of FDIV instruction. */ | |
1376 | COSTS_N_INSNS (2), /* cost of FABS instruction. */ | |
1377 | COSTS_N_INSNS (2), /* cost of FCHS instruction. */ | |
1378 | COSTS_N_INSNS (52), /* cost of FSQRT instruction. */ | |
6065f444 | 1379 | |
c53c148c | 1380 | COSTS_N_INSNS (2), /* cost of cheap SSE instruction. */ |
6065f444 JH |
1381 | COSTS_N_INSNS (6), /* cost of ADDSS/SD SUBSS/SD insns. */ |
1382 | COSTS_N_INSNS (6), /* cost of MULSS instruction. */ | |
1383 | COSTS_N_INSNS (6), /* cost of MULSD instruction. */ | |
c53c148c JH |
1384 | COSTS_N_INSNS (6), /* cost of FMA SS instruction. */ |
1385 | COSTS_N_INSNS (6), /* cost of FMA SD instruction. */ | |
6065f444 JH |
1386 | /* 9-24 */ |
1387 | COSTS_N_INSNS (24), /* cost of DIVSS instruction. */ | |
1388 | /* 9-27 */ | |
1389 | COSTS_N_INSNS (27), /* cost of DIVSD instruction. */ | |
1390 | COSTS_N_INSNS (15), /* cost of SQRTSS instruction. */ | |
1391 | COSTS_N_INSNS (26), /* cost of SQRTSD instruction. */ | |
64766e8d | 1392 | 1, 2, 1, 1, /* reassoc int, fp, vec_int, vec_fp. */ |
c727b835 RB |
1393 | bdver_memcpy, |
1394 | bdver_memset, | |
f6fd8f2b JH |
1395 | COSTS_N_INSNS (4), /* cond_taken_branch_cost. */ |
1396 | COSTS_N_INSNS (2), /* cond_not_taken_branch_cost. */ | |
7dc58b50 ML |
1397 | "16:11:8", /* Loop alignment. */ |
1398 | "16:8:8", /* Jump alignment. */ | |
1399 | "0:0:8", /* Label alignment. */ | |
1400 | "11", /* Func alignment. */ | |
071e428c HW |
1401 | 4, /* Small unroll limit. */ |
1402 | 2, /* Small unroll factor. */ | |
64766e8d JH |
1403 | }; |
1404 | ||
1405 | ||
1406 | /* ZNVER1 has optimized REP instruction for medium sized blocks, but for | |
1407 | very small blocks it is better to use loop. For large blocks, libcall | |
1408 | can do nontemporary accesses and beat inline considerably. */ | |
1409 | static stringop_algs znver1_memcpy[2] = { | |
da346efd ML |
1410 | /* 32-bit tuning. */ |
1411 | {libcall, {{6, loop, false}, | |
1412 | {14, unrolled_loop, false}, | |
dc65aba7 | 1413 | {-1, libcall, false}}}, |
da346efd ML |
1414 | /* 64-bit tuning. */ |
1415 | {libcall, {{16, loop, false}, | |
dc65aba7 | 1416 | {128, rep_prefix_8_byte, false}, |
64766e8d JH |
1417 | {-1, libcall, false}}}}; |
1418 | static stringop_algs znver1_memset[2] = { | |
da346efd ML |
1419 | /* 32-bit tuning. */ |
1420 | {libcall, {{8, loop, false}, | |
1421 | {24, unrolled_loop, false}, | |
dc65aba7 | 1422 | {128, rep_prefix_4_byte, false}, |
da346efd ML |
1423 | {-1, libcall, false}}}, |
1424 | /* 64-bit tuning. */ | |
1425 | {libcall, {{48, unrolled_loop, false}, | |
dc65aba7 | 1426 | {128, rep_prefix_8_byte, false}, |
64766e8d JH |
1427 | {-1, libcall, false}}}}; |
1428 | struct processor_costs znver1_cost = { | |
72bb85f8 | 1429 | { |
d321551c L |
1430 | /* Start of register allocator costs. integer->integer move cost is 2. */ |
1431 | ||
1432 | /* reg-reg moves are done by renaming and thus they are even cheaper than | |
1433 | 1 cycle. Becuase reg-reg move cost is 2 and the following tables correspond | |
1434 | to doubles of latencies, we do not model this correctly. It does not | |
1435 | seem to make practical difference to bump prices up even more. */ | |
1436 | 6, /* cost for loading QImode using | |
1437 | movzbl. */ | |
1438 | {6, 6, 6}, /* cost of loading integer registers | |
1439 | in QImode, HImode and SImode. | |
1440 | Relative to reg-reg move (2). */ | |
1441 | {8, 8, 8}, /* cost of storing integer | |
1442 | registers. */ | |
1443 | 2, /* cost of reg,reg fld/fst. */ | |
1444 | {6, 6, 16}, /* cost of loading fp registers | |
1445 | in SFmode, DFmode and XFmode. */ | |
1446 | {8, 8, 16}, /* cost of storing fp registers | |
1447 | in SFmode, DFmode and XFmode. */ | |
1448 | 2, /* cost of moving MMX register. */ | |
1449 | {6, 6}, /* cost of loading MMX registers | |
1450 | in SImode and DImode. */ | |
1451 | {8, 8}, /* cost of storing MMX registers | |
1452 | in SImode and DImode. */ | |
1453 | 2, 3, 6, /* cost of moving XMM,YMM,ZMM register. */ | |
1454 | {6, 6, 6, 12, 24}, /* cost of loading SSE registers | |
1455 | in 32,64,128,256 and 512-bit. */ | |
1456 | {8, 8, 8, 16, 32}, /* cost of storing SSE registers | |
1457 | in 32,64,128,256 and 512-bit. */ | |
ecc3135a | 1458 | 6, 6, /* SSE->integer and integer->SSE moves. */ |
1459 | 8, 8, /* mask->integer and integer->mask moves */ | |
00cb3494 L |
1460 | {6, 6, 6}, /* cost of loading mask register |
1461 | in QImode, HImode, SImode. */ | |
1462 | {8, 8, 8}, /* cost if storing mask register | |
1463 | in QImode, HImode, SImode. */ | |
1464 | 2, /* cost of moving mask register. */ | |
d321551c | 1465 | /* End of register allocator costs. */ |
72bb85f8 | 1466 | }, |
d321551c | 1467 | |
64766e8d JH |
1468 | COSTS_N_INSNS (1), /* cost of an add instruction. */ |
1469 | COSTS_N_INSNS (1), /* cost of a lea instruction. */ | |
1470 | COSTS_N_INSNS (1), /* variable shift costs. */ | |
1471 | COSTS_N_INSNS (1), /* constant shift costs. */ | |
1472 | {COSTS_N_INSNS (3), /* cost of starting multiply for QI. */ | |
1473 | COSTS_N_INSNS (3), /* HI. */ | |
1474 | COSTS_N_INSNS (3), /* SI. */ | |
6065f444 JH |
1475 | COSTS_N_INSNS (3), /* DI. */ |
1476 | COSTS_N_INSNS (3)}, /* other. */ | |
64766e8d JH |
1477 | 0, /* cost of multiply per each bit |
1478 | set. */ | |
6065f444 JH |
1479 | /* Depending on parameters, idiv can get faster on ryzen. This is upper |
1480 | bound. */ | |
1481 | {COSTS_N_INSNS (16), /* cost of a divide/mod for QI. */ | |
1482 | COSTS_N_INSNS (22), /* HI. */ | |
1483 | COSTS_N_INSNS (30), /* SI. */ | |
1484 | COSTS_N_INSNS (45), /* DI. */ | |
1485 | COSTS_N_INSNS (45)}, /* other. */ | |
64766e8d JH |
1486 | COSTS_N_INSNS (1), /* cost of movsx. */ |
1487 | COSTS_N_INSNS (1), /* cost of movzx. */ | |
1488 | 8, /* "large" insn. */ | |
1489 | 9, /* MOVE_RATIO. */ | |
25e22b19 | 1490 | 6, /* CLEAR_RATIO */ |
01118373 | 1491 | {6, 6, 6}, /* cost of loading integer registers |
64766e8d JH |
1492 | in QImode, HImode and SImode. |
1493 | Relative to reg-reg move (2). */ | |
01118373 | 1494 | {8, 8, 8}, /* cost of storing integer |
64766e8d | 1495 | registers. */ |
d321551c L |
1496 | {6, 6, 6, 12, 24}, /* cost of loading SSE register |
1497 | in 32bit, 64bit, 128bit, 256bit and 512bit */ | |
1498 | {8, 8, 8, 16, 32}, /* cost of storing SSE register | |
1499 | in 32bit, 64bit, 128bit, 256bit and 512bit */ | |
b7167993 | 1500 | {6, 6, 6, 12, 24}, /* cost of unaligned loads. */ |
b7167993 | 1501 | {8, 8, 8, 16, 32}, /* cost of unaligned stores. */ |
d321551c L |
1502 | 2, 3, 6, /* cost of moving XMM,YMM,ZMM register. */ |
1503 | 6, /* cost of moving SSE register to integer. */ | |
a4fe6139 JH |
1504 | /* VGATHERDPD is 23 uops and throughput is 9, VGATHERDPD is 35 uops, |
1505 | throughput 12. Approx 9 uops do not depend on vector size and every load | |
1506 | is 7 uops. */ | |
1507 | 18, 8, /* Gather load static, per_elt. */ | |
1508 | 18, 10, /* Gather store static, per_elt. */ | |
64766e8d JH |
1509 | 32, /* size of l1 cache. */ |
1510 | 512, /* size of l2 cache. */ | |
1511 | 64, /* size of prefetch block. */ | |
1512 | /* New AMD processors never drop prefetches; if they cannot be performed | |
1513 | immediately, they are queued. We set number of simultaneous prefetches | |
1514 | to a large constant to reflect this (it probably is not a good idea not | |
1515 | to limit number of prefetches at all, as their execution also takes some | |
1516 | time). */ | |
1517 | 100, /* number of parallel prefetches. */ | |
1518 | 3, /* Branch cost. */ | |
6065f444 JH |
1519 | COSTS_N_INSNS (5), /* cost of FADD and FSUB insns. */ |
1520 | COSTS_N_INSNS (5), /* cost of FMUL instruction. */ | |
1521 | /* Latency of fdiv is 8-15. */ | |
1522 | COSTS_N_INSNS (15), /* cost of FDIV instruction. */ | |
1523 | COSTS_N_INSNS (1), /* cost of FABS instruction. */ | |
1524 | COSTS_N_INSNS (1), /* cost of FCHS instruction. */ | |
1525 | /* Latency of fsqrt is 4-10. */ | |
1526 | COSTS_N_INSNS (10), /* cost of FSQRT instruction. */ | |
1527 | ||
c53c148c | 1528 | COSTS_N_INSNS (1), /* cost of cheap SSE instruction. */ |
6065f444 JH |
1529 | COSTS_N_INSNS (3), /* cost of ADDSS/SD SUBSS/SD insns. */ |
1530 | COSTS_N_INSNS (3), /* cost of MULSS instruction. */ | |
1531 | COSTS_N_INSNS (4), /* cost of MULSD instruction. */ | |
c53c148c JH |
1532 | COSTS_N_INSNS (5), /* cost of FMA SS instruction. */ |
1533 | COSTS_N_INSNS (5), /* cost of FMA SD instruction. */ | |
6065f444 JH |
1534 | COSTS_N_INSNS (10), /* cost of DIVSS instruction. */ |
1535 | /* 9-13 */ | |
1536 | COSTS_N_INSNS (13), /* cost of DIVSD instruction. */ | |
1537 | COSTS_N_INSNS (10), /* cost of SQRTSS instruction. */ | |
1538 | COSTS_N_INSNS (15), /* cost of SQRTSD instruction. */ | |
64766e8d JH |
1539 | /* Zen can execute 4 integer operations per cycle. FP operations take 3 cycles |
1540 | and it can execute 2 integer additions and 2 multiplications thus | |
1541 | reassociation may make sense up to with of 6. SPEC2k6 bencharks suggests | |
1542 | that 4 works better than 6 probably due to register pressure. | |
1543 | ||
1544 | Integer vector operations are taken by FP unit and execute 3 vector | |
1545 | plus/minus operations per cycle but only one multiply. This is adjusted | |
1546 | in ix86_reassociation_width. */ | |
1547 | 4, 4, 3, 6, /* reassoc int, fp, vec_int, vec_fp. */ | |
1548 | znver1_memcpy, | |
1549 | znver1_memset, | |
f6fd8f2b JH |
1550 | COSTS_N_INSNS (4), /* cond_taken_branch_cost. */ |
1551 | COSTS_N_INSNS (2), /* cond_not_taken_branch_cost. */ | |
7dc58b50 ML |
1552 | "16", /* Loop alignment. */ |
1553 | "16", /* Jump alignment. */ | |
1554 | "0:0:8", /* Label alignment. */ | |
1555 | "16", /* Func alignment. */ | |
071e428c HW |
1556 | 4, /* Small unroll limit. */ |
1557 | 2, /* Small unroll factor. */ | |
64766e8d JH |
1558 | }; |
1559 | ||
2901f42f VK |
1560 | /* ZNVER2 has optimized REP instruction for medium sized blocks, but for |
1561 | very small blocks it is better to use loop. For large blocks, libcall | |
1562 | can do nontemporary accesses and beat inline considerably. */ | |
1563 | static stringop_algs znver2_memcpy[2] = { | |
da346efd ML |
1564 | /* 32-bit tuning. */ |
1565 | {libcall, {{6, loop, false}, | |
1566 | {14, unrolled_loop, false}, | |
dc65aba7 | 1567 | {-1, libcall, false}}}, |
da346efd ML |
1568 | /* 64-bit tuning. */ |
1569 | {libcall, {{16, loop, false}, | |
1570 | {64, rep_prefix_4_byte, false}, | |
2901f42f VK |
1571 | {-1, libcall, false}}}}; |
1572 | static stringop_algs znver2_memset[2] = { | |
da346efd ML |
1573 | /* 32-bit tuning. */ |
1574 | {libcall, {{8, loop, false}, | |
1575 | {24, unrolled_loop, false}, | |
dc65aba7 | 1576 | {128, rep_prefix_4_byte, false}, |
da346efd ML |
1577 | {-1, libcall, false}}}, |
1578 | /* 64-bit tuning. */ | |
1579 | {libcall, {{24, rep_prefix_4_byte, false}, | |
1580 | {128, rep_prefix_8_byte, false}, | |
2901f42f VK |
1581 | {-1, libcall, false}}}}; |
1582 | ||
1583 | struct processor_costs znver2_cost = { | |
72bb85f8 | 1584 | { |
d321551c | 1585 | /* Start of register allocator costs. integer->integer move cost is 2. */ |
2901f42f | 1586 | |
5b32a181 JH |
1587 | /* reg-reg moves are done by renaming and thus they are even cheaper than |
1588 | 1 cycle. Because reg-reg move cost is 2 and following tables correspond | |
1589 | to doubles of latencies, we do not model this correctly. It does not | |
1590 | seem to make practical difference to bump prices up even more. */ | |
1591 | 6, /* cost for loading QImode using | |
1592 | movzbl. */ | |
1593 | {6, 6, 6}, /* cost of loading integer registers | |
1594 | in QImode, HImode and SImode. | |
1595 | Relative to reg-reg move (2). */ | |
1596 | {8, 8, 8}, /* cost of storing integer | |
1597 | registers. */ | |
1598 | 2, /* cost of reg,reg fld/fst. */ | |
1599 | {6, 6, 16}, /* cost of loading fp registers | |
1600 | in SFmode, DFmode and XFmode. */ | |
1601 | {8, 8, 16}, /* cost of storing fp registers | |
1602 | in SFmode, DFmode and XFmode. */ | |
1603 | 2, /* cost of moving MMX register. */ | |
1604 | {6, 6}, /* cost of loading MMX registers | |
1605 | in SImode and DImode. */ | |
1606 | {8, 8}, /* cost of storing MMX registers | |
1607 | in SImode and DImode. */ | |
1608 | 2, 2, 3, /* cost of moving XMM,YMM,ZMM | |
1609 | register. */ | |
1610 | {6, 6, 6, 6, 12}, /* cost of loading SSE registers | |
1611 | in 32,64,128,256 and 512-bit. */ | |
1612 | {8, 8, 8, 8, 16}, /* cost of storing SSE registers | |
1613 | in 32,64,128,256 and 512-bit. */ | |
1614 | 6, 6, /* SSE->integer and integer->SSE | |
1615 | moves. */ | |
1616 | 8, 8, /* mask->integer and integer->mask moves */ | |
1617 | {6, 6, 6}, /* cost of loading mask register | |
1618 | in QImode, HImode, SImode. */ | |
1619 | {8, 8, 8}, /* cost if storing mask register | |
1620 | in QImode, HImode, SImode. */ | |
1621 | 2, /* cost of moving mask register. */ | |
1622 | /* End of register allocator costs. */ | |
1623 | }, | |
1624 | ||
1625 | COSTS_N_INSNS (1), /* cost of an add instruction. */ | |
1626 | COSTS_N_INSNS (1), /* cost of a lea instruction. */ | |
1627 | COSTS_N_INSNS (1), /* variable shift costs. */ | |
1628 | COSTS_N_INSNS (1), /* constant shift costs. */ | |
1629 | {COSTS_N_INSNS (3), /* cost of starting multiply for QI. */ | |
1630 | COSTS_N_INSNS (3), /* HI. */ | |
1631 | COSTS_N_INSNS (3), /* SI. */ | |
1632 | COSTS_N_INSNS (3), /* DI. */ | |
1633 | COSTS_N_INSNS (3)}, /* other. */ | |
1634 | 0, /* cost of multiply per each bit | |
1635 | set. */ | |
1636 | /* Depending on parameters, idiv can get faster on ryzen. This is upper | |
1637 | bound. */ | |
1638 | {COSTS_N_INSNS (16), /* cost of a divide/mod for QI. */ | |
1639 | COSTS_N_INSNS (22), /* HI. */ | |
1640 | COSTS_N_INSNS (30), /* SI. */ | |
1641 | COSTS_N_INSNS (45), /* DI. */ | |
1642 | COSTS_N_INSNS (45)}, /* other. */ | |
1643 | COSTS_N_INSNS (1), /* cost of movsx. */ | |
1644 | COSTS_N_INSNS (1), /* cost of movzx. */ | |
1645 | 8, /* "large" insn. */ | |
1646 | 9, /* MOVE_RATIO. */ | |
1647 | 6, /* CLEAR_RATIO */ | |
1648 | {6, 6, 6}, /* cost of loading integer registers | |
1649 | in QImode, HImode and SImode. | |
1650 | Relative to reg-reg move (2). */ | |
1651 | {8, 8, 8}, /* cost of storing integer | |
1652 | registers. */ | |
1653 | {6, 6, 6, 6, 12}, /* cost of loading SSE registers | |
1654 | in 32bit, 64bit, 128bit, 256bit and 512bit */ | |
1655 | {8, 8, 8, 8, 16}, /* cost of storing SSE register | |
1656 | in 32bit, 64bit, 128bit, 256bit and 512bit */ | |
1657 | {6, 6, 6, 6, 12}, /* cost of unaligned loads. */ | |
1658 | {8, 8, 8, 8, 16}, /* cost of unaligned stores. */ | |
1659 | 2, 2, 3, /* cost of moving XMM,YMM,ZMM | |
1660 | register. */ | |
1661 | 6, /* cost of moving SSE register to integer. */ | |
1662 | /* VGATHERDPD is 23 uops and throughput is 9, VGATHERDPD is 35 uops, | |
1663 | throughput 12. Approx 9 uops do not depend on vector size and every load | |
1664 | is 7 uops. */ | |
1665 | 18, 8, /* Gather load static, per_elt. */ | |
1666 | 18, 10, /* Gather store static, per_elt. */ | |
1667 | 32, /* size of l1 cache. */ | |
1668 | 512, /* size of l2 cache. */ | |
1669 | 64, /* size of prefetch block. */ | |
1670 | /* New AMD processors never drop prefetches; if they cannot be performed | |
1671 | immediately, they are queued. We set number of simultaneous prefetches | |
1672 | to a large constant to reflect this (it probably is not a good idea not | |
1673 | to limit number of prefetches at all, as their execution also takes some | |
1674 | time). */ | |
1675 | 100, /* number of parallel prefetches. */ | |
1676 | 3, /* Branch cost. */ | |
1677 | COSTS_N_INSNS (5), /* cost of FADD and FSUB insns. */ | |
1678 | COSTS_N_INSNS (5), /* cost of FMUL instruction. */ | |
1679 | /* Latency of fdiv is 8-15. */ | |
1680 | COSTS_N_INSNS (15), /* cost of FDIV instruction. */ | |
1681 | COSTS_N_INSNS (1), /* cost of FABS instruction. */ | |
1682 | COSTS_N_INSNS (1), /* cost of FCHS instruction. */ | |
1683 | /* Latency of fsqrt is 4-10. */ | |
1684 | COSTS_N_INSNS (10), /* cost of FSQRT instruction. */ | |
1685 | ||
1686 | COSTS_N_INSNS (1), /* cost of cheap SSE instruction. */ | |
1687 | COSTS_N_INSNS (3), /* cost of ADDSS/SD SUBSS/SD insns. */ | |
1688 | COSTS_N_INSNS (3), /* cost of MULSS instruction. */ | |
1689 | COSTS_N_INSNS (3), /* cost of MULSD instruction. */ | |
1690 | COSTS_N_INSNS (5), /* cost of FMA SS instruction. */ | |
1691 | COSTS_N_INSNS (5), /* cost of FMA SD instruction. */ | |
1692 | COSTS_N_INSNS (10), /* cost of DIVSS instruction. */ | |
1693 | /* 9-13. */ | |
1694 | COSTS_N_INSNS (13), /* cost of DIVSD instruction. */ | |
1695 | COSTS_N_INSNS (10), /* cost of SQRTSS instruction. */ | |
1696 | COSTS_N_INSNS (15), /* cost of SQRTSD instruction. */ | |
1697 | /* Zen can execute 4 integer operations per cycle. FP operations | |
1698 | take 3 cycles and it can execute 2 integer additions and 2 | |
1699 | multiplications thus reassociation may make sense up to with of 6. | |
1700 | SPEC2k6 bencharks suggests | |
1701 | that 4 works better than 6 probably due to register pressure. | |
1702 | ||
1703 | Integer vector operations are taken by FP unit and execute 3 vector | |
1704 | plus/minus operations per cycle but only one multiply. This is adjusted | |
1705 | in ix86_reassociation_width. */ | |
1706 | 4, 4, 3, 6, /* reassoc int, fp, vec_int, vec_fp. */ | |
1707 | znver2_memcpy, | |
1708 | znver2_memset, | |
1709 | COSTS_N_INSNS (4), /* cond_taken_branch_cost. */ | |
1710 | COSTS_N_INSNS (2), /* cond_not_taken_branch_cost. */ | |
1711 | "16", /* Loop alignment. */ | |
1712 | "16", /* Jump alignment. */ | |
1713 | "0:0:8", /* Label alignment. */ | |
1714 | "16", /* Func alignment. */ | |
071e428c HW |
1715 | 4, /* Small unroll limit. */ |
1716 | 2, /* Small unroll factor. */ | |
5b32a181 JH |
1717 | }; |
1718 | ||
1719 | struct processor_costs znver3_cost = { | |
1720 | { | |
1721 | /* Start of register allocator costs. integer->integer move cost is 2. */ | |
1722 | ||
bf3b532b TJ |
1723 | /* reg-reg moves are done by renaming and thus they are even cheaper than |
1724 | 1 cycle. Because reg-reg move cost is 2 and following tables correspond | |
1725 | to doubles of latencies, we do not model this correctly. It does not | |
1726 | seem to make practical difference to bump prices up even more. */ | |
1727 | 6, /* cost for loading QImode using | |
1728 | movzbl. */ | |
1729 | {6, 6, 6}, /* cost of loading integer registers | |
1730 | in QImode, HImode and SImode. | |
1731 | Relative to reg-reg move (2). */ | |
1732 | {8, 8, 8}, /* cost of storing integer | |
1733 | registers. */ | |
1734 | 2, /* cost of reg,reg fld/fst. */ | |
1735 | {6, 6, 16}, /* cost of loading fp registers | |
1736 | in SFmode, DFmode and XFmode. */ | |
1737 | {8, 8, 16}, /* cost of storing fp registers | |
1738 | in SFmode, DFmode and XFmode. */ | |
1739 | 2, /* cost of moving MMX register. */ | |
1740 | {6, 6}, /* cost of loading MMX registers | |
1741 | in SImode and DImode. */ | |
1742 | {8, 8}, /* cost of storing MMX registers | |
1743 | in SImode and DImode. */ | |
1744 | 2, 2, 3, /* cost of moving XMM,YMM,ZMM | |
1745 | register. */ | |
1746 | {6, 6, 6, 6, 12}, /* cost of loading SSE registers | |
1747 | in 32,64,128,256 and 512-bit. */ | |
1748 | {8, 8, 8, 8, 16}, /* cost of storing SSE registers | |
1749 | in 32,64,128,256 and 512-bit. */ | |
1750 | 6, 6, /* SSE->integer and integer->SSE | |
1751 | moves. */ | |
1752 | 8, 8, /* mask->integer and integer->mask moves */ | |
1753 | {6, 6, 6}, /* cost of loading mask register | |
1754 | in QImode, HImode, SImode. */ | |
1755 | {8, 8, 8}, /* cost if storing mask register | |
1756 | in QImode, HImode, SImode. */ | |
1757 | 2, /* cost of moving mask register. */ | |
1758 | /* End of register allocator costs. */ | |
1759 | }, | |
1760 | ||
1761 | COSTS_N_INSNS (1), /* cost of an add instruction. */ | |
1762 | COSTS_N_INSNS (1), /* cost of a lea instruction. */ | |
1763 | COSTS_N_INSNS (1), /* variable shift costs. */ | |
1764 | COSTS_N_INSNS (1), /* constant shift costs. */ | |
1765 | {COSTS_N_INSNS (3), /* cost of starting multiply for QI. */ | |
1766 | COSTS_N_INSNS (3), /* HI. */ | |
1767 | COSTS_N_INSNS (3), /* SI. */ | |
1768 | COSTS_N_INSNS (3), /* DI. */ | |
1769 | COSTS_N_INSNS (3)}, /* other. */ | |
1770 | 0, /* cost of multiply per each bit | |
1771 | set. */ | |
1772 | {COSTS_N_INSNS (9), /* cost of a divide/mod for QI. */ | |
1773 | COSTS_N_INSNS (10), /* HI. */ | |
1774 | COSTS_N_INSNS (12), /* SI. */ | |
1775 | COSTS_N_INSNS (17), /* DI. */ | |
1776 | COSTS_N_INSNS (17)}, /* other. */ | |
1777 | COSTS_N_INSNS (1), /* cost of movsx. */ | |
1778 | COSTS_N_INSNS (1), /* cost of movzx. */ | |
1779 | 8, /* "large" insn. */ | |
1780 | 9, /* MOVE_RATIO. */ | |
1781 | 6, /* CLEAR_RATIO */ | |
1782 | {6, 6, 6}, /* cost of loading integer registers | |
1783 | in QImode, HImode and SImode. | |
1784 | Relative to reg-reg move (2). */ | |
1785 | {8, 8, 8}, /* cost of storing integer | |
1786 | registers. */ | |
1787 | {6, 6, 6, 6, 12}, /* cost of loading SSE registers | |
1788 | in 32bit, 64bit, 128bit, 256bit and 512bit */ | |
1789 | {8, 8, 8, 8, 16}, /* cost of storing SSE register | |
1790 | in 32bit, 64bit, 128bit, 256bit and 512bit */ | |
1791 | {6, 6, 6, 6, 12}, /* cost of unaligned loads. */ | |
1792 | {8, 8, 8, 8, 16}, /* cost of unaligned stores. */ | |
1793 | 2, 2, 3, /* cost of moving XMM,YMM,ZMM | |
1794 | register. */ | |
1795 | 6, /* cost of moving SSE register to integer. */ | |
1796 | /* VGATHERDPD is 15 uops and throughput is 4, VGATHERDPS is 23 uops, | |
1797 | throughput 9. Approx 7 uops do not depend on vector size and every load | |
1798 | is 4 uops. */ | |
1799 | 14, 8, /* Gather load static, per_elt. */ | |
1800 | 14, 10, /* Gather store static, per_elt. */ | |
1801 | 32, /* size of l1 cache. */ | |
1802 | 512, /* size of l2 cache. */ | |
1803 | 64, /* size of prefetch block. */ | |
1804 | /* New AMD processors never drop prefetches; if they cannot be performed | |
1805 | immediately, they are queued. We set number of simultaneous prefetches | |
1806 | to a large constant to reflect this (it probably is not a good idea not | |
1807 | to limit number of prefetches at all, as their execution also takes some | |
1808 | time). */ | |
1809 | 100, /* number of parallel prefetches. */ | |
1810 | 3, /* Branch cost. */ | |
1811 | COSTS_N_INSNS (5), /* cost of FADD and FSUB insns. */ | |
1812 | COSTS_N_INSNS (5), /* cost of FMUL instruction. */ | |
1813 | /* Latency of fdiv is 8-15. */ | |
1814 | COSTS_N_INSNS (15), /* cost of FDIV instruction. */ | |
1815 | COSTS_N_INSNS (1), /* cost of FABS instruction. */ | |
1816 | COSTS_N_INSNS (1), /* cost of FCHS instruction. */ | |
1817 | /* Latency of fsqrt is 4-10. */ | |
1818 | COSTS_N_INSNS (10), /* cost of FSQRT instruction. */ | |
1819 | ||
1820 | COSTS_N_INSNS (1), /* cost of cheap SSE instruction. */ | |
1821 | COSTS_N_INSNS (3), /* cost of ADDSS/SD SUBSS/SD insns. */ | |
1822 | COSTS_N_INSNS (3), /* cost of MULSS instruction. */ | |
1823 | COSTS_N_INSNS (3), /* cost of MULSD instruction. */ | |
1824 | COSTS_N_INSNS (5), /* cost of FMA SS instruction. */ | |
1825 | COSTS_N_INSNS (5), /* cost of FMA SD instruction. */ | |
1826 | COSTS_N_INSNS (10), /* cost of DIVSS instruction. */ | |
1827 | /* 9-13. */ | |
1828 | COSTS_N_INSNS (13), /* cost of DIVSD instruction. */ | |
1829 | COSTS_N_INSNS (10), /* cost of SQRTSS instruction. */ | |
1830 | COSTS_N_INSNS (15), /* cost of SQRTSD instruction. */ | |
1831 | /* Zen can execute 4 integer operations per cycle. FP operations | |
1832 | take 3 cycles and it can execute 2 integer additions and 2 | |
1833 | multiplications thus reassociation may make sense up to with of 6. | |
1834 | SPEC2k6 bencharks suggests | |
1835 | that 4 works better than 6 probably due to register pressure. | |
1836 | ||
1837 | Integer vector operations are taken by FP unit and execute 3 vector | |
1838 | plus/minus operations per cycle but only one multiply. This is adjusted | |
1839 | in ix86_reassociation_width. */ | |
1840 | 4, 4, 3, 6, /* reassoc int, fp, vec_int, vec_fp. */ | |
1841 | znver2_memcpy, | |
1842 | znver2_memset, | |
1843 | COSTS_N_INSNS (4), /* cond_taken_branch_cost. */ | |
1844 | COSTS_N_INSNS (2), /* cond_not_taken_branch_cost. */ | |
1845 | "16", /* Loop alignment. */ | |
1846 | "16", /* Jump alignment. */ | |
1847 | "0:0:8", /* Label alignment. */ | |
1848 | "16", /* Func alignment. */ | |
071e428c HW |
1849 | 4, /* Small unroll limit. */ |
1850 | 2, /* Small unroll factor. */ | |
bf3b532b TJ |
1851 | }; |
1852 | ||
1853 | /* This table currently replicates znver3_cost table. */ | |
1854 | struct processor_costs znver4_cost = { | |
1855 | { | |
1856 | /* Start of register allocator costs. integer->integer move cost is 2. */ | |
1857 | ||
2901f42f VK |
1858 | /* reg-reg moves are done by renaming and thus they are even cheaper than |
1859 | 1 cycle. Because reg-reg move cost is 2 and following tables correspond | |
1860 | to doubles of latencies, we do not model this correctly. It does not | |
1861 | seem to make practical difference to bump prices up even more. */ | |
1862 | 6, /* cost for loading QImode using | |
1863 | movzbl. */ | |
1864 | {6, 6, 6}, /* cost of loading integer registers | |
1865 | in QImode, HImode and SImode. | |
1866 | Relative to reg-reg move (2). */ | |
1867 | {8, 8, 8}, /* cost of storing integer | |
1868 | registers. */ | |
1869 | 2, /* cost of reg,reg fld/fst. */ | |
bbe04bad | 1870 | {14, 14, 17}, /* cost of loading fp registers |
2901f42f | 1871 | in SFmode, DFmode and XFmode. */ |
bbe04bad | 1872 | {12, 12, 16}, /* cost of storing fp registers |
2901f42f VK |
1873 | in SFmode, DFmode and XFmode. */ |
1874 | 2, /* cost of moving MMX register. */ | |
1875 | {6, 6}, /* cost of loading MMX registers | |
1876 | in SImode and DImode. */ | |
1877 | {8, 8}, /* cost of storing MMX registers | |
1878 | in SImode and DImode. */ | |
187dd65d | 1879 | 2, 2, 3, /* cost of moving XMM,YMM,ZMM |
2901f42f | 1880 | register. */ |
bbe04bad | 1881 | {6, 6, 10, 10, 12}, /* cost of loading SSE registers |
2901f42f | 1882 | in 32,64,128,256 and 512-bit. */ |
bbe04bad | 1883 | {8, 8, 8, 12, 12}, /* cost of storing SSE registers |
2901f42f | 1884 | in 32,64,128,256 and 512-bit. */ |
bbe04bad | 1885 | 6, 8, /* SSE->integer and integer->SSE |
2901f42f | 1886 | moves. */ |
bbe04bad | 1887 | 8, 8, /* mask->integer and integer->mask moves */ |
00cb3494 L |
1888 | {6, 6, 6}, /* cost of loading mask register |
1889 | in QImode, HImode, SImode. */ | |
1890 | {8, 8, 8}, /* cost if storing mask register | |
1891 | in QImode, HImode, SImode. */ | |
1892 | 2, /* cost of moving mask register. */ | |
d321551c | 1893 | /* End of register allocator costs. */ |
72bb85f8 | 1894 | }, |
d321551c L |
1895 | |
1896 | COSTS_N_INSNS (1), /* cost of an add instruction. */ | |
bbe04bad | 1897 | /* TODO: Lea with 3 components has cost 2. */ |
d321551c L |
1898 | COSTS_N_INSNS (1), /* cost of a lea instruction. */ |
1899 | COSTS_N_INSNS (1), /* variable shift costs. */ | |
1900 | COSTS_N_INSNS (1), /* constant shift costs. */ | |
1901 | {COSTS_N_INSNS (3), /* cost of starting multiply for QI. */ | |
1902 | COSTS_N_INSNS (3), /* HI. */ | |
1903 | COSTS_N_INSNS (3), /* SI. */ | |
1904 | COSTS_N_INSNS (3), /* DI. */ | |
1905 | COSTS_N_INSNS (3)}, /* other. */ | |
1906 | 0, /* cost of multiply per each bit | |
1907 | set. */ | |
bbe04bad JH |
1908 | {COSTS_N_INSNS (12), /* cost of a divide/mod for QI. */ |
1909 | COSTS_N_INSNS (13), /* HI. */ | |
1910 | COSTS_N_INSNS (13), /* SI. */ | |
1911 | COSTS_N_INSNS (18), /* DI. */ | |
1912 | COSTS_N_INSNS (18)}, /* other. */ | |
d321551c L |
1913 | COSTS_N_INSNS (1), /* cost of movsx. */ |
1914 | COSTS_N_INSNS (1), /* cost of movzx. */ | |
1915 | 8, /* "large" insn. */ | |
1916 | 9, /* MOVE_RATIO. */ | |
25e22b19 | 1917 | 6, /* CLEAR_RATIO */ |
d321551c L |
1918 | {6, 6, 6}, /* cost of loading integer registers |
1919 | in QImode, HImode and SImode. | |
1920 | Relative to reg-reg move (2). */ | |
1921 | {8, 8, 8}, /* cost of storing integer | |
1922 | registers. */ | |
bbe04bad | 1923 | {6, 6, 10, 10, 12}, /* cost of loading SSE registers |
d321551c | 1924 | in 32bit, 64bit, 128bit, 256bit and 512bit */ |
bbe04bad | 1925 | {8, 8, 8, 12, 12}, /* cost of storing SSE register |
d321551c | 1926 | in 32bit, 64bit, 128bit, 256bit and 512bit */ |
bbe04bad JH |
1927 | {6, 6, 6, 6, 6}, /* cost of unaligned loads. */ |
1928 | {8, 8, 8, 8, 8}, /* cost of unaligned stores. */ | |
1929 | 2, 2, 2, /* cost of moving XMM,YMM,ZMM | |
d321551c L |
1930 | register. */ |
1931 | 6, /* cost of moving SSE register to integer. */ | |
bbe04bad JH |
1932 | /* VGATHERDPD is 17 uops and throughput is 4, VGATHERDPS is 24 uops, |
1933 | throughput 5. Approx 7 uops do not depend on vector size and every load | |
1934 | is 5 uops. */ | |
1935 | 14, 10, /* Gather load static, per_elt. */ | |
1936 | 14, 20, /* Gather store static, per_elt. */ | |
2901f42f | 1937 | 32, /* size of l1 cache. */ |
bbe04bad | 1938 | 1024, /* size of l2 cache. */ |
2901f42f VK |
1939 | 64, /* size of prefetch block. */ |
1940 | /* New AMD processors never drop prefetches; if they cannot be performed | |
1941 | immediately, they are queued. We set number of simultaneous prefetches | |
1942 | to a large constant to reflect this (it probably is not a good idea not | |
1943 | to limit number of prefetches at all, as their execution also takes some | |
1944 | time). */ | |
1945 | 100, /* number of parallel prefetches. */ | |
1946 | 3, /* Branch cost. */ | |
bbe04bad JH |
1947 | COSTS_N_INSNS (7), /* cost of FADD and FSUB insns. */ |
1948 | COSTS_N_INSNS (7), /* cost of FMUL instruction. */ | |
2901f42f VK |
1949 | /* Latency of fdiv is 8-15. */ |
1950 | COSTS_N_INSNS (15), /* cost of FDIV instruction. */ | |
1951 | COSTS_N_INSNS (1), /* cost of FABS instruction. */ | |
1952 | COSTS_N_INSNS (1), /* cost of FCHS instruction. */ | |
1953 | /* Latency of fsqrt is 4-10. */ | |
bbe04bad | 1954 | COSTS_N_INSNS (25), /* cost of FSQRT instruction. */ |
2901f42f VK |
1955 | |
1956 | COSTS_N_INSNS (1), /* cost of cheap SSE instruction. */ | |
1957 | COSTS_N_INSNS (3), /* cost of ADDSS/SD SUBSS/SD insns. */ | |
1958 | COSTS_N_INSNS (3), /* cost of MULSS instruction. */ | |
187dd65d | 1959 | COSTS_N_INSNS (3), /* cost of MULSD instruction. */ |
bbe04bad JH |
1960 | COSTS_N_INSNS (4), /* cost of FMA SS instruction. */ |
1961 | COSTS_N_INSNS (4), /* cost of FMA SD instruction. */ | |
1962 | COSTS_N_INSNS (13), /* cost of DIVSS instruction. */ | |
2901f42f VK |
1963 | /* 9-13. */ |
1964 | COSTS_N_INSNS (13), /* cost of DIVSD instruction. */ | |
bbe04bad JH |
1965 | COSTS_N_INSNS (15), /* cost of SQRTSS instruction. */ |
1966 | COSTS_N_INSNS (21), /* cost of SQRTSD instruction. */ | |
2901f42f VK |
1967 | /* Zen can execute 4 integer operations per cycle. FP operations |
1968 | take 3 cycles and it can execute 2 integer additions and 2 | |
1969 | multiplications thus reassociation may make sense up to with of 6. | |
1970 | SPEC2k6 bencharks suggests | |
1971 | that 4 works better than 6 probably due to register pressure. | |
1972 | ||
1973 | Integer vector operations are taken by FP unit and execute 3 vector | |
1974 | plus/minus operations per cycle but only one multiply. This is adjusted | |
1975 | in ix86_reassociation_width. */ | |
1976 | 4, 4, 3, 6, /* reassoc int, fp, vec_int, vec_fp. */ | |
1977 | znver2_memcpy, | |
1978 | znver2_memset, | |
1979 | COSTS_N_INSNS (4), /* cond_taken_branch_cost. */ | |
1980 | COSTS_N_INSNS (2), /* cond_not_taken_branch_cost. */ | |
1981 | "16", /* Loop alignment. */ | |
1982 | "16", /* Jump alignment. */ | |
1983 | "0:0:8", /* Label alignment. */ | |
1984 | "16", /* Func alignment. */ | |
071e428c HW |
1985 | 4, /* Small unroll limit. */ |
1986 | 2, /* Small unroll factor. */ | |
2901f42f VK |
1987 | }; |
1988 | ||
c234d831 UB |
1989 | /* skylake_cost should produce code tuned for Skylake familly of CPUs. */ |
1990 | static stringop_algs skylake_memcpy[2] = { | |
a32452a5 L |
1991 | {libcall, |
1992 | {{256, rep_prefix_1_byte, true}, | |
1993 | {256, loop, false}, | |
1994 | {-1, libcall, false}}}, | |
1995 | {libcall, | |
1996 | {{256, rep_prefix_1_byte, true}, | |
1997 | {256, loop, false}, | |
1998 | {-1, libcall, false}}}}; | |
c234d831 UB |
1999 | |
2000 | static stringop_algs skylake_memset[2] = { | |
a32452a5 L |
2001 | {libcall, |
2002 | {{256, rep_prefix_1_byte, true}, | |
2003 | {256, loop, false}, | |
2004 | {-1, libcall, false}}}, | |
2005 | {libcall, | |
2006 | {{256, rep_prefix_1_byte, true}, | |
2007 | {256, loop, false}, | |
2008 | {-1, libcall, false}}}}; | |
c234d831 UB |
2009 | |
2010 | static const | |
2011 | struct processor_costs skylake_cost = { | |
72bb85f8 | 2012 | { |
d321551c L |
2013 | /* Start of register allocator costs. integer->integer move cost is 2. */ |
2014 | 6, /* cost for loading QImode using movzbl */ | |
2015 | {4, 4, 4}, /* cost of loading integer registers | |
2016 | in QImode, HImode and SImode. | |
2017 | Relative to reg-reg move (2). */ | |
7706f2f3 | 2018 | {6, 6, 6}, /* cost of storing integer registers */ |
d321551c L |
2019 | 2, /* cost of reg,reg fld/fst */ |
2020 | {6, 6, 8}, /* cost of loading fp registers | |
2021 | in SFmode, DFmode and XFmode */ | |
2022 | {6, 6, 10}, /* cost of storing fp registers | |
2023 | in SFmode, DFmode and XFmode */ | |
2024 | 2, /* cost of moving MMX register */ | |
2025 | {6, 6}, /* cost of loading MMX registers | |
2026 | in SImode and DImode */ | |
2027 | {6, 6}, /* cost of storing MMX registers | |
2028 | in SImode and DImode */ | |
2029 | 2, 2, 4, /* cost of moving XMM,YMM,ZMM register */ | |
2030 | {6, 6, 6, 10, 20}, /* cost of loading SSE registers | |
2031 | in 32,64,128,256 and 512-bit */ | |
2032 | {8, 8, 8, 12, 24}, /* cost of storing SSE registers | |
2033 | in 32,64,128,256 and 512-bit */ | |
ecc3135a | 2034 | 6, 6, /* SSE->integer and integer->SSE moves */ |
657612fb | 2035 | 6, 6, /* mask->integer and integer->mask moves */ |
ecc3135a | 2036 | {8, 8, 8}, /* cost of loading mask register |
00cb3494 | 2037 | in QImode, HImode, SImode. */ |
ecc3135a | 2038 | {6, 6, 6}, /* cost if storing mask register |
00cb3494 | 2039 | in QImode, HImode, SImode. */ |
16516644 | 2040 | 3, /* cost of moving mask register. */ |
d321551c | 2041 | /* End of register allocator costs. */ |
72bb85f8 | 2042 | }, |
d321551c | 2043 | |
c234d831 UB |
2044 | COSTS_N_INSNS (1), /* cost of an add instruction */ |
2045 | COSTS_N_INSNS (1)+1, /* cost of a lea instruction */ | |
2046 | COSTS_N_INSNS (1), /* variable shift costs */ | |
2047 | COSTS_N_INSNS (1), /* constant shift costs */ | |
2048 | {COSTS_N_INSNS (3), /* cost of starting multiply for QI */ | |
2049 | COSTS_N_INSNS (4), /* HI */ | |
2050 | COSTS_N_INSNS (3), /* SI */ | |
a2ef9558 MT |
2051 | COSTS_N_INSNS (3), /* DI */ |
2052 | COSTS_N_INSNS (3)}, /* other */ | |
c234d831 | 2053 | 0, /* cost of multiply per each bit set */ |
02308bd3 MT |
2054 | /* Expanding div/mod currently doesn't consider parallelism. So the cost |
2055 | model is not realistic. We compensate by increasing the latencies a bit. */ | |
2056 | {COSTS_N_INSNS (11), /* cost of a divide/mod for QI */ | |
2057 | COSTS_N_INSNS (11), /* HI */ | |
2058 | COSTS_N_INSNS (14), /* SI */ | |
c234d831 UB |
2059 | COSTS_N_INSNS (76), /* DI */ |
2060 | COSTS_N_INSNS (76)}, /* other */ | |
2061 | COSTS_N_INSNS (1), /* cost of movsx */ | |
2062 | COSTS_N_INSNS (0), /* cost of movzx */ | |
2063 | 8, /* "large" insn */ | |
2064 | 17, /* MOVE_RATIO */ | |
a32452a5 | 2065 | 17, /* CLEAR_RATIO */ |
269edf4e | 2066 | {6, 6, 6}, /* cost of loading integer registers |
c234d831 UB |
2067 | in QImode, HImode and SImode. |
2068 | Relative to reg-reg move (2). */ | |
269edf4e CL |
2069 | {8, 8, 8}, /* cost of storing integer registers */ |
2070 | {8, 8, 8, 8, 16}, /* cost of loading SSE register | |
d321551c | 2071 | in 32bit, 64bit, 128bit, 256bit and 512bit */ |
d3152981 | 2072 | {8, 8, 8, 8, 16}, /* cost of storing SSE register |
d321551c | 2073 | in 32bit, 64bit, 128bit, 256bit and 512bit */ |
269edf4e | 2074 | {8, 8, 8, 8, 16}, /* cost of unaligned loads. */ |
c234d831 | 2075 | {8, 8, 8, 8, 16}, /* cost of unaligned stores. */ |
d321551c | 2076 | 2, 2, 4, /* cost of moving XMM,YMM,ZMM register */ |
83858ba1 | 2077 | 6, /* cost of moving SSE register to integer. */ |
c234d831 UB |
2078 | 20, 8, /* Gather load static, per_elt. */ |
2079 | 22, 10, /* Gather store static, per_elt. */ | |
2080 | 64, /* size of l1 cache. */ | |
2081 | 512, /* size of l2 cache. */ | |
2082 | 64, /* size of prefetch block */ | |
2083 | 6, /* number of parallel prefetches */ | |
2084 | 3, /* Branch cost */ | |
2085 | COSTS_N_INSNS (3), /* cost of FADD and FSUB insns. */ | |
2086 | COSTS_N_INSNS (4), /* cost of FMUL instruction. */ | |
2087 | COSTS_N_INSNS (20), /* cost of FDIV instruction. */ | |
2088 | COSTS_N_INSNS (1), /* cost of FABS instruction. */ | |
2089 | COSTS_N_INSNS (1), /* cost of FCHS instruction. */ | |
2090 | COSTS_N_INSNS (20), /* cost of FSQRT instruction. */ | |
2091 | ||
2092 | COSTS_N_INSNS (1), /* cost of cheap SSE instruction. */ | |
2093 | COSTS_N_INSNS (4), /* cost of ADDSS/SD SUBSS/SD insns. */ | |
2094 | COSTS_N_INSNS (4), /* cost of MULSS instruction. */ | |
2095 | COSTS_N_INSNS (4), /* cost of MULSD instruction. */ | |
2096 | COSTS_N_INSNS (4), /* cost of FMA SS instruction. */ | |
2097 | COSTS_N_INSNS (4), /* cost of FMA SD instruction. */ | |
2098 | COSTS_N_INSNS (11), /* cost of DIVSS instruction. */ | |
2099 | COSTS_N_INSNS (14), /* cost of DIVSD instruction. */ | |
2100 | COSTS_N_INSNS (12), /* cost of SQRTSS instruction. */ | |
2101 | COSTS_N_INSNS (18), /* cost of SQRTSD instruction. */ | |
2102 | 1, 4, 2, 2, /* reassoc int, fp, vec_int, vec_fp. */ | |
2103 | skylake_memcpy, | |
2104 | skylake_memset, | |
2105 | COSTS_N_INSNS (3), /* cond_taken_branch_cost. */ | |
2106 | COSTS_N_INSNS (1), /* cond_not_taken_branch_cost. */ | |
7dc58b50 ML |
2107 | "16:11:8", /* Loop alignment. */ |
2108 | "16:11:8", /* Jump alignment. */ | |
2109 | "0:0:8", /* Label alignment. */ | |
2110 | "16", /* Func alignment. */ | |
071e428c HW |
2111 | 4, /* Small unroll limit. */ |
2112 | 2, /* Small unroll factor. */ | |
c234d831 | 2113 | }; |
bf24f4ec L |
2114 | |
2115 | /* icelake_cost should produce code tuned for Icelake family of CPUs. | |
2116 | NB: rep_prefix_1_byte is used only for known size. */ | |
2117 | ||
2118 | static stringop_algs icelake_memcpy[2] = { | |
2119 | {libcall, | |
2120 | {{256, rep_prefix_1_byte, true}, | |
2121 | {256, loop, false}, | |
2122 | {-1, libcall, false}}}, | |
2123 | {libcall, | |
2124 | {{256, rep_prefix_1_byte, true}, | |
2125 | {256, loop, false}, | |
2126 | {-1, libcall, false}}}}; | |
2127 | ||
2128 | static stringop_algs icelake_memset[2] = { | |
2129 | {libcall, | |
2130 | {{256, rep_prefix_1_byte, true}, | |
2131 | {256, loop, false}, | |
2132 | {-1, libcall, false}}}, | |
2133 | {libcall, | |
2134 | {{256, rep_prefix_1_byte, true}, | |
2135 | {256, loop, false}, | |
2136 | {-1, libcall, false}}}}; | |
2137 | ||
2138 | static const | |
2139 | struct processor_costs icelake_cost = { | |
2140 | { | |
2141 | /* Start of register allocator costs. integer->integer move cost is 2. */ | |
2142 | 6, /* cost for loading QImode using movzbl */ | |
2143 | {4, 4, 4}, /* cost of loading integer registers | |
2144 | in QImode, HImode and SImode. | |
2145 | Relative to reg-reg move (2). */ | |
2146 | {6, 6, 6}, /* cost of storing integer registers */ | |
2147 | 2, /* cost of reg,reg fld/fst */ | |
2148 | {6, 6, 8}, /* cost of loading fp registers | |
2149 | in SFmode, DFmode and XFmode */ | |
2150 | {6, 6, 10}, /* cost of storing fp registers | |
2151 | in SFmode, DFmode and XFmode */ | |
2152 | 2, /* cost of moving MMX register */ | |
2153 | {6, 6}, /* cost of loading MMX registers | |
2154 | in SImode and DImode */ | |
2155 | {6, 6}, /* cost of storing MMX registers | |
2156 | in SImode and DImode */ | |
2157 | 2, 2, 4, /* cost of moving XMM,YMM,ZMM register */ | |
2158 | {6, 6, 6, 10, 20}, /* cost of loading SSE registers | |
2159 | in 32,64,128,256 and 512-bit */ | |
2160 | {8, 8, 8, 12, 24}, /* cost of storing SSE registers | |
2161 | in 32,64,128,256 and 512-bit */ | |
2162 | 6, 6, /* SSE->integer and integer->SSE moves */ | |
657612fb | 2163 | 6, 6, /* mask->integer and integer->mask moves */ |
bf24f4ec L |
2164 | {8, 8, 8}, /* cost of loading mask register |
2165 | in QImode, HImode, SImode. */ | |
2166 | {6, 6, 6}, /* cost if storing mask register | |
2167 | in QImode, HImode, SImode. */ | |
2168 | 3, /* cost of moving mask register. */ | |
2169 | /* End of register allocator costs. */ | |
2170 | }, | |
2171 | ||
2172 | COSTS_N_INSNS (1), /* cost of an add instruction */ | |
2173 | COSTS_N_INSNS (1)+1, /* cost of a lea instruction */ | |
2174 | COSTS_N_INSNS (1), /* variable shift costs */ | |
2175 | COSTS_N_INSNS (1), /* constant shift costs */ | |
2176 | {COSTS_N_INSNS (3), /* cost of starting multiply for QI */ | |
2177 | COSTS_N_INSNS (4), /* HI */ | |
2178 | COSTS_N_INSNS (3), /* SI */ | |
2179 | COSTS_N_INSNS (3), /* DI */ | |
2180 | COSTS_N_INSNS (3)}, /* other */ | |
2181 | 0, /* cost of multiply per each bit set */ | |
2182 | /* Expanding div/mod currently doesn't consider parallelism. So the cost | |
2183 | model is not realistic. We compensate by increasing the latencies a bit. */ | |
2184 | {COSTS_N_INSNS (11), /* cost of a divide/mod for QI */ | |
2185 | COSTS_N_INSNS (11), /* HI */ | |
2186 | COSTS_N_INSNS (14), /* SI */ | |
2187 | COSTS_N_INSNS (76), /* DI */ | |
2188 | COSTS_N_INSNS (76)}, /* other */ | |
2189 | COSTS_N_INSNS (1), /* cost of movsx */ | |
2190 | COSTS_N_INSNS (0), /* cost of movzx */ | |
2191 | 8, /* "large" insn */ | |
2192 | 17, /* MOVE_RATIO */ | |
2193 | 17, /* CLEAR_RATIO */ | |
269edf4e | 2194 | {6, 6, 6}, /* cost of loading integer registers |
bf24f4ec L |
2195 | in QImode, HImode and SImode. |
2196 | Relative to reg-reg move (2). */ | |
269edf4e CL |
2197 | {8, 8, 8}, /* cost of storing integer registers */ |
2198 | {8, 8, 8, 8, 16}, /* cost of loading SSE register | |
bf24f4ec | 2199 | in 32bit, 64bit, 128bit, 256bit and 512bit */ |
d3152981 | 2200 | {8, 8, 8, 8, 16}, /* cost of storing SSE register |
bf24f4ec | 2201 | in 32bit, 64bit, 128bit, 256bit and 512bit */ |
269edf4e | 2202 | {8, 8, 8, 8, 16}, /* cost of unaligned loads. */ |
bf24f4ec L |
2203 | {8, 8, 8, 8, 16}, /* cost of unaligned stores. */ |
2204 | 2, 2, 4, /* cost of moving XMM,YMM,ZMM register */ | |
2205 | 6, /* cost of moving SSE register to integer. */ | |
2206 | 20, 8, /* Gather load static, per_elt. */ | |
2207 | 22, 10, /* Gather store static, per_elt. */ | |
2208 | 64, /* size of l1 cache. */ | |
2209 | 512, /* size of l2 cache. */ | |
2210 | 64, /* size of prefetch block */ | |
2211 | 6, /* number of parallel prefetches */ | |
2212 | 3, /* Branch cost */ | |
2213 | COSTS_N_INSNS (3), /* cost of FADD and FSUB insns. */ | |
2214 | COSTS_N_INSNS (4), /* cost of FMUL instruction. */ | |
2215 | COSTS_N_INSNS (20), /* cost of FDIV instruction. */ | |
2216 | COSTS_N_INSNS (1), /* cost of FABS instruction. */ | |
2217 | COSTS_N_INSNS (1), /* cost of FCHS instruction. */ | |
2218 | COSTS_N_INSNS (20), /* cost of FSQRT instruction. */ | |
2219 | ||
2220 | COSTS_N_INSNS (1), /* cost of cheap SSE instruction. */ | |
2221 | COSTS_N_INSNS (4), /* cost of ADDSS/SD SUBSS/SD insns. */ | |
2222 | COSTS_N_INSNS (4), /* cost of MULSS instruction. */ | |
2223 | COSTS_N_INSNS (4), /* cost of MULSD instruction. */ | |
2224 | COSTS_N_INSNS (4), /* cost of FMA SS instruction. */ | |
2225 | COSTS_N_INSNS (4), /* cost of FMA SD instruction. */ | |
2226 | COSTS_N_INSNS (11), /* cost of DIVSS instruction. */ | |
2227 | COSTS_N_INSNS (14), /* cost of DIVSD instruction. */ | |
2228 | COSTS_N_INSNS (12), /* cost of SQRTSS instruction. */ | |
2229 | COSTS_N_INSNS (18), /* cost of SQRTSD instruction. */ | |
2230 | 1, 4, 2, 2, /* reassoc int, fp, vec_int, vec_fp. */ | |
2231 | icelake_memcpy, | |
2232 | icelake_memset, | |
2233 | COSTS_N_INSNS (3), /* cond_taken_branch_cost. */ | |
2234 | COSTS_N_INSNS (1), /* cond_not_taken_branch_cost. */ | |
2235 | "16:11:8", /* Loop alignment. */ | |
2236 | "16:11:8", /* Jump alignment. */ | |
2237 | "0:0:8", /* Label alignment. */ | |
2238 | "16", /* Func alignment. */ | |
071e428c HW |
2239 | 4, /* Small unroll limit. */ |
2240 | 2, /* Small unroll factor. */ | |
bf24f4ec L |
2241 | }; |
2242 | ||
4f442a3b CL |
2243 | /* alderlake_cost should produce code tuned for alderlake family of CPUs. */ |
2244 | static stringop_algs alderlake_memcpy[2] = { | |
2245 | {libcall, | |
2246 | {{256, rep_prefix_1_byte, true}, | |
2247 | {256, loop, false}, | |
2248 | {-1, libcall, false}}}, | |
2249 | {libcall, | |
2250 | {{256, rep_prefix_1_byte, true}, | |
2251 | {256, loop, false}, | |
2252 | {-1, libcall, false}}}}; | |
2253 | static stringop_algs alderlake_memset[2] = { | |
2254 | {libcall, | |
2255 | {{256, rep_prefix_1_byte, true}, | |
2256 | {256, loop, false}, | |
2257 | {-1, libcall, false}}}, | |
2258 | {libcall, | |
2259 | {{256, rep_prefix_1_byte, true}, | |
2260 | {256, loop, false}, | |
2261 | {-1, libcall, false}}}}; | |
2262 | static const | |
2263 | struct processor_costs alderlake_cost = { | |
2264 | { | |
2265 | /* Start of register allocator costs. integer->integer move cost is 2. */ | |
2266 | 6, /* cost for loading QImode using movzbl */ | |
2267 | {6, 6, 6}, /* cost of loading integer registers | |
2268 | in QImode, HImode and SImode. | |
2269 | Relative to reg-reg move (2). */ | |
2270 | {6, 6, 6}, /* cost of storing integer registers */ | |
2271 | 4, /* cost of reg,reg fld/fst */ | |
2272 | {6, 6, 12}, /* cost of loading fp registers | |
2273 | in SFmode, DFmode and XFmode */ | |
2274 | {6, 6, 12}, /* cost of storing fp registers | |
2275 | in SFmode, DFmode and XFmode */ | |
2276 | 2, /* cost of moving MMX register */ | |
2277 | {6, 6}, /* cost of loading MMX registers | |
2278 | in SImode and DImode */ | |
2279 | {6, 6}, /* cost of storing MMX registers | |
2280 | in SImode and DImode */ | |
2281 | 2, 3, 4, /* cost of moving XMM,YMM,ZMM register */ | |
2282 | {6, 6, 6, 10, 15}, /* cost of loading SSE registers | |
2283 | in 32,64,128,256 and 512-bit */ | |
2284 | {6, 6, 6, 10, 15}, /* cost of storing SSE registers | |
2285 | in 32,64,128,256 and 512-bit */ | |
2286 | 6, 6, /* SSE->integer and integer->SSE moves */ | |
2287 | 6, 6, /* mask->integer and integer->mask moves */ | |
2288 | {6, 6, 6}, /* cost of loading mask register | |
2289 | in QImode, HImode, SImode. */ | |
2290 | {6, 6, 6}, /* cost if storing mask register | |
2291 | in QImode, HImode, SImode. */ | |
2292 | 2, /* cost of moving mask register. */ | |
2293 | /* End of register allocator costs. */ | |
2294 | }, | |
2295 | ||
2296 | COSTS_N_INSNS (1), /* cost of an add instruction */ | |
2297 | COSTS_N_INSNS (1) + 1, /* cost of a lea instruction */ | |
2298 | COSTS_N_INSNS (1), /* variable shift costs */ | |
2299 | COSTS_N_INSNS (1), /* constant shift costs */ | |
2300 | {COSTS_N_INSNS (3), /* cost of starting multiply for QI */ | |
2301 | COSTS_N_INSNS (4), /* HI */ | |
2302 | COSTS_N_INSNS (3), /* SI */ | |
2303 | COSTS_N_INSNS (4), /* DI */ | |
2304 | COSTS_N_INSNS (4)}, /* other */ | |
2305 | 0, /* cost of multiply per each bit set */ | |
2306 | {COSTS_N_INSNS (16), /* cost of a divide/mod for QI */ | |
2307 | COSTS_N_INSNS (22), /* HI */ | |
2308 | COSTS_N_INSNS (30), /* SI */ | |
2309 | COSTS_N_INSNS (74), /* DI */ | |
2310 | COSTS_N_INSNS (74)}, /* other */ | |
2311 | COSTS_N_INSNS (1), /* cost of movsx */ | |
2312 | COSTS_N_INSNS (1), /* cost of movzx */ | |
2313 | 8, /* "large" insn */ | |
2314 | 17, /* MOVE_RATIO */ | |
2315 | 17, /* CLEAR_RATIO */ | |
2316 | {6, 6, 6}, /* cost of loading integer registers | |
2317 | in QImode, HImode and SImode. | |
2318 | Relative to reg-reg move (2). */ | |
269edf4e CL |
2319 | {8, 8, 8}, /* cost of storing integer registers */ |
2320 | {8, 8, 8, 10, 15}, /* cost of loading SSE register | |
4f442a3b | 2321 | in 32bit, 64bit, 128bit, 256bit and 512bit */ |
269edf4e | 2322 | {8, 8, 8, 10, 15}, /* cost of storing SSE register |
4f442a3b | 2323 | in 32bit, 64bit, 128bit, 256bit and 512bit */ |
269edf4e CL |
2324 | {8, 8, 8, 10, 15}, /* cost of unaligned loads. */ |
2325 | {8, 8, 8, 10, 15}, /* cost of unaligned storess. */ | |
4f442a3b CL |
2326 | 2, 3, 4, /* cost of moving XMM,YMM,ZMM register */ |
2327 | 6, /* cost of moving SSE register to integer. */ | |
2328 | 18, 6, /* Gather load static, per_elt. */ | |
2329 | 18, 6, /* Gather store static, per_elt. */ | |
2330 | 32, /* size of l1 cache. */ | |
2331 | 512, /* size of l2 cache. */ | |
2332 | 64, /* size of prefetch block */ | |
2333 | 6, /* number of parallel prefetches */ | |
2334 | 3, /* Branch cost */ | |
2335 | COSTS_N_INSNS (3), /* cost of FADD and FSUB insns. */ | |
2336 | COSTS_N_INSNS (5), /* cost of FMUL instruction. */ | |
2337 | COSTS_N_INSNS (17), /* cost of FDIV instruction. */ | |
2338 | COSTS_N_INSNS (1), /* cost of FABS instruction. */ | |
2339 | COSTS_N_INSNS (1), /* cost of FCHS instruction. */ | |
2340 | COSTS_N_INSNS (14), /* cost of FSQRT instruction. */ | |
2341 | ||
2342 | COSTS_N_INSNS (1), /* cost of cheap SSE instruction. */ | |
2343 | COSTS_N_INSNS (3), /* cost of ADDSS/SD SUBSS/SD insns. */ | |
2344 | COSTS_N_INSNS (4), /* cost of MULSS instruction. */ | |
2345 | COSTS_N_INSNS (5), /* cost of MULSD instruction. */ | |
2346 | COSTS_N_INSNS (5), /* cost of FMA SS instruction. */ | |
2347 | COSTS_N_INSNS (5), /* cost of FMA SD instruction. */ | |
2348 | COSTS_N_INSNS (13), /* cost of DIVSS instruction. */ | |
2349 | COSTS_N_INSNS (17), /* cost of DIVSD instruction. */ | |
2350 | COSTS_N_INSNS (14), /* cost of SQRTSS instruction. */ | |
2351 | COSTS_N_INSNS (18), /* cost of SQRTSD instruction. */ | |
2352 | 1, 4, 3, 3, /* reassoc int, fp, vec_int, vec_fp. */ | |
2353 | alderlake_memcpy, | |
2354 | alderlake_memset, | |
2355 | COSTS_N_INSNS (4), /* cond_taken_branch_cost. */ | |
2356 | COSTS_N_INSNS (2), /* cond_not_taken_branch_cost. */ | |
2357 | "16:11:8", /* Loop alignment. */ | |
2358 | "16:11:8", /* Jump alignment. */ | |
2359 | "0:0:8", /* Label alignment. */ | |
2360 | "16", /* Func alignment. */ | |
071e428c HW |
2361 | 4, /* Small unroll limit. */ |
2362 | 2, /* Small unroll factor. */ | |
4f442a3b CL |
2363 | }; |
2364 | ||
64766e8d JH |
2365 | /* BTVER1 has optimized REP instruction for medium sized blocks, but for |
2366 | very small blocks it is better to use loop. For large blocks, libcall can | |
2367 | do nontemporary accesses and beat inline considerably. */ | |
2368 | static stringop_algs btver1_memcpy[2] = { | |
2369 | {libcall, {{6, loop, false}, {14, unrolled_loop, false}, | |
2370 | {-1, rep_prefix_4_byte, false}}}, | |
2371 | {libcall, {{16, loop, false}, {8192, rep_prefix_8_byte, false}, | |
2372 | {-1, libcall, false}}}}; | |
2373 | static stringop_algs btver1_memset[2] = { | |
2374 | {libcall, {{8, loop, false}, {24, unrolled_loop, false}, | |
2375 | {2048, rep_prefix_4_byte, false}, {-1, libcall, false}}}, | |
2376 | {libcall, {{48, unrolled_loop, false}, {8192, rep_prefix_8_byte, false}, | |
2377 | {-1, libcall, false}}}}; | |
2378 | const struct processor_costs btver1_cost = { | |
72bb85f8 | 2379 | { |
d321551c L |
2380 | /* Start of register allocator costs. integer->integer move cost is 2. */ |
2381 | 8, /* cost for loading QImode using movzbl */ | |
2382 | {6, 8, 6}, /* cost of loading integer registers | |
2383 | in QImode, HImode and SImode. | |
2384 | Relative to reg-reg move (2). */ | |
2385 | {6, 8, 6}, /* cost of storing integer registers */ | |
2386 | 4, /* cost of reg,reg fld/fst */ | |
2387 | {12, 12, 28}, /* cost of loading fp registers | |
2388 | in SFmode, DFmode and XFmode */ | |
2389 | {12, 12, 38}, /* cost of storing fp registers | |
2390 | in SFmode, DFmode and XFmode */ | |
2391 | 4, /* cost of moving MMX register */ | |
2392 | {10, 10}, /* cost of loading MMX registers | |
2393 | in SImode and DImode */ | |
2394 | {12, 12}, /* cost of storing MMX registers | |
2395 | in SImode and DImode */ | |
2396 | 2, 4, 8, /* cost of moving XMM,YMM,ZMM register */ | |
2397 | {10, 10, 12, 48, 96}, /* cost of loading SSE registers | |
2398 | in 32,64,128,256 and 512-bit */ | |
2399 | {10, 10, 12, 48, 96}, /* cost of storing SSE registers | |
2400 | in 32,64,128,256 and 512-bit */ | |
2401 | 14, 14, /* SSE->integer and integer->SSE moves */ | |
ecc3135a | 2402 | 14, 14, /* mask->integer and integer->mask moves */ |
00cb3494 L |
2403 | {6, 8, 6}, /* cost of loading mask register |
2404 | in QImode, HImode, SImode. */ | |
2405 | {6, 8, 6}, /* cost if storing mask register | |
2406 | in QImode, HImode, SImode. */ | |
2407 | 2, /* cost of moving mask register. */ | |
d321551c | 2408 | /* End of register allocator costs. */ |
72bb85f8 | 2409 | }, |
d321551c | 2410 | |
64766e8d JH |
2411 | COSTS_N_INSNS (1), /* cost of an add instruction */ |
2412 | COSTS_N_INSNS (2), /* cost of a lea instruction */ | |
2413 | COSTS_N_INSNS (1), /* variable shift costs */ | |
2414 | COSTS_N_INSNS (1), /* constant shift costs */ | |
2415 | {COSTS_N_INSNS (3), /* cost of starting multiply for QI */ | |
2416 | COSTS_N_INSNS (4), /* HI */ | |
2417 | COSTS_N_INSNS (3), /* SI */ | |
2418 | COSTS_N_INSNS (4), /* DI */ | |
2419 | COSTS_N_INSNS (5)}, /* other */ | |
2420 | 0, /* cost of multiply per each bit set */ | |
2421 | {COSTS_N_INSNS (19), /* cost of a divide/mod for QI */ | |
2422 | COSTS_N_INSNS (35), /* HI */ | |
2423 | COSTS_N_INSNS (51), /* SI */ | |
2424 | COSTS_N_INSNS (83), /* DI */ | |
2425 | COSTS_N_INSNS (83)}, /* other */ | |
2426 | COSTS_N_INSNS (1), /* cost of movsx */ | |
2427 | COSTS_N_INSNS (1), /* cost of movzx */ | |
2428 | 8, /* "large" insn */ | |
2429 | 9, /* MOVE_RATIO */ | |
25e22b19 | 2430 | 6, /* CLEAR_RATIO */ |
df41dbaf | 2431 | {6, 8, 6}, /* cost of loading integer registers |
64766e8d JH |
2432 | in QImode, HImode and SImode. |
2433 | Relative to reg-reg move (2). */ | |
df41dbaf | 2434 | {6, 8, 6}, /* cost of storing integer registers */ |
d321551c L |
2435 | {10, 10, 12, 48, 96}, /* cost of loading SSE register |
2436 | in 32bit, 64bit, 128bit, 256bit and 512bit */ | |
2437 | {10, 10, 12, 48, 96}, /* cost of storing SSE register | |
2438 | in 32bit, 64bit, 128bit, 256bit and 512bit */ | |
b7167993 | 2439 | {10, 10, 12, 48, 96}, /* cost of unaligned loads. */ |
b7167993 | 2440 | {10, 10, 12, 48, 96}, /* cost of unaligned stores. */ |
d321551c L |
2441 | 2, 4, 8, /* cost of moving XMM,YMM,ZMM register */ |
2442 | 14, /* cost of moving SSE register to integer. */ | |
a4fe6139 JH |
2443 | 10, 10, /* Gather load static, per_elt. */ |
2444 | 10, 10, /* Gather store static, per_elt. */ | |
64766e8d JH |
2445 | 32, /* size of l1 cache. */ |
2446 | 512, /* size of l2 cache. */ | |
2447 | 64, /* size of prefetch block */ | |
2448 | 100, /* number of parallel prefetches */ | |
2449 | 2, /* Branch cost */ | |
2450 | COSTS_N_INSNS (4), /* cost of FADD and FSUB insns. */ | |
2451 | COSTS_N_INSNS (4), /* cost of FMUL instruction. */ | |
2452 | COSTS_N_INSNS (19), /* cost of FDIV instruction. */ | |
2453 | COSTS_N_INSNS (2), /* cost of FABS instruction. */ | |
2454 | COSTS_N_INSNS (2), /* cost of FCHS instruction. */ | |
2455 | COSTS_N_INSNS (35), /* cost of FSQRT instruction. */ | |
6065f444 | 2456 | |
c53c148c | 2457 | COSTS_N_INSNS (1), /* cost of cheap SSE instruction. */ |
6065f444 JH |
2458 | COSTS_N_INSNS (3), /* cost of ADDSS/SD SUBSS/SD insns. */ |
2459 | COSTS_N_INSNS (2), /* cost of MULSS instruction. */ | |
2460 | COSTS_N_INSNS (4), /* cost of MULSD instruction. */ | |
c53c148c JH |
2461 | COSTS_N_INSNS (5), /* cost of FMA SS instruction. */ |
2462 | COSTS_N_INSNS (5), /* cost of FMA SD instruction. */ | |
6065f444 JH |
2463 | COSTS_N_INSNS (13), /* cost of DIVSS instruction. */ |
2464 | COSTS_N_INSNS (17), /* cost of DIVSD instruction. */ | |
2465 | COSTS_N_INSNS (14), /* cost of SQRTSS instruction. */ | |
2466 | COSTS_N_INSNS (48), /* cost of SQRTSD instruction. */ | |
64766e8d JH |
2467 | 1, 1, 1, 1, /* reassoc int, fp, vec_int, vec_fp. */ |
2468 | btver1_memcpy, | |
2469 | btver1_memset, | |
f6fd8f2b JH |
2470 | COSTS_N_INSNS (2), /* cond_taken_branch_cost. */ |
2471 | COSTS_N_INSNS (1), /* cond_not_taken_branch_cost. */ | |
7dc58b50 ML |
2472 | "16:11:8", /* Loop alignment. */ |
2473 | "16:8:8", /* Jump alignment. */ | |
2474 | "0:0:8", /* Label alignment. */ | |
2475 | "11", /* Func alignment. */ | |
071e428c HW |
2476 | 4, /* Small unroll limit. */ |
2477 | 2, /* Small unroll factor. */ | |
64766e8d JH |
2478 | }; |
2479 | ||
2480 | static stringop_algs btver2_memcpy[2] = { | |
2481 | {libcall, {{6, loop, false}, {14, unrolled_loop, false}, | |
2482 | {-1, rep_prefix_4_byte, false}}}, | |
2483 | {libcall, {{16, loop, false}, {8192, rep_prefix_8_byte, false}, | |
2484 | {-1, libcall, false}}}}; | |
2485 | static stringop_algs btver2_memset[2] = { | |
2486 | {libcall, {{8, loop, false}, {24, unrolled_loop, false}, | |
2487 | {2048, rep_prefix_4_byte, false}, {-1, libcall, false}}}, | |
2488 | {libcall, {{48, unrolled_loop, false}, {8192, rep_prefix_8_byte, false}, | |
2489 | {-1, libcall, false}}}}; | |
2490 | const struct processor_costs btver2_cost = { | |
72bb85f8 | 2491 | { |
d321551c L |
2492 | /* Start of register allocator costs. integer->integer move cost is 2. */ |
2493 | 8, /* cost for loading QImode using movzbl */ | |
2494 | {8, 8, 6}, /* cost of loading integer registers | |
2495 | in QImode, HImode and SImode. | |
2496 | Relative to reg-reg move (2). */ | |
2497 | {8, 8, 6}, /* cost of storing integer registers */ | |
2498 | 4, /* cost of reg,reg fld/fst */ | |
2499 | {12, 12, 28}, /* cost of loading fp registers | |
2500 | in SFmode, DFmode and XFmode */ | |
2501 | {12, 12, 38}, /* cost of storing fp registers | |
2502 | in SFmode, DFmode and XFmode */ | |
2503 | 4, /* cost of moving MMX register */ | |
2504 | {10, 10}, /* cost of loading MMX registers | |
2505 | in SImode and DImode */ | |
2506 | {12, 12}, /* cost of storing MMX registers | |
2507 | in SImode and DImode */ | |
2508 | 2, 4, 8, /* cost of moving XMM,YMM,ZMM register */ | |
2509 | {10, 10, 12, 48, 96}, /* cost of loading SSE registers | |
2510 | in 32,64,128,256 and 512-bit */ | |
2511 | {10, 10, 12, 48, 96}, /* cost of storing SSE registers | |
2512 | in 32,64,128,256 and 512-bit */ | |
2513 | 14, 14, /* SSE->integer and integer->SSE moves */ | |
ecc3135a | 2514 | 14, 14, /* mask->integer and integer->mask moves */ |
00cb3494 L |
2515 | {8, 8, 6}, /* cost of loading mask register |
2516 | in QImode, HImode, SImode. */ | |
2517 | {8, 8, 6}, /* cost if storing mask register | |
2518 | in QImode, HImode, SImode. */ | |
2519 | 2, /* cost of moving mask register. */ | |
d321551c | 2520 | /* End of register allocator costs. */ |
72bb85f8 | 2521 | }, |
d321551c | 2522 | |
64766e8d JH |
2523 | COSTS_N_INSNS (1), /* cost of an add instruction */ |
2524 | COSTS_N_INSNS (2), /* cost of a lea instruction */ | |
2525 | COSTS_N_INSNS (1), /* variable shift costs */ | |
2526 | COSTS_N_INSNS (1), /* constant shift costs */ | |
2527 | {COSTS_N_INSNS (3), /* cost of starting multiply for QI */ | |
2528 | COSTS_N_INSNS (4), /* HI */ | |
2529 | COSTS_N_INSNS (3), /* SI */ | |
2530 | COSTS_N_INSNS (4), /* DI */ | |
2531 | COSTS_N_INSNS (5)}, /* other */ | |
2532 | 0, /* cost of multiply per each bit set */ | |
2533 | {COSTS_N_INSNS (19), /* cost of a divide/mod for QI */ | |
2534 | COSTS_N_INSNS (35), /* HI */ | |
2535 | COSTS_N_INSNS (51), /* SI */ | |
2536 | COSTS_N_INSNS (83), /* DI */ | |
2537 | COSTS_N_INSNS (83)}, /* other */ | |
2538 | COSTS_N_INSNS (1), /* cost of movsx */ | |
2539 | COSTS_N_INSNS (1), /* cost of movzx */ | |
2540 | 8, /* "large" insn */ | |
2541 | 9, /* MOVE_RATIO */ | |
25e22b19 | 2542 | 6, /* CLEAR_RATIO */ |
df41dbaf | 2543 | {8, 8, 6}, /* cost of loading integer registers |
64766e8d JH |
2544 | in QImode, HImode and SImode. |
2545 | Relative to reg-reg move (2). */ | |
df41dbaf | 2546 | {8, 8, 6}, /* cost of storing integer registers */ |
d321551c L |
2547 | {10, 10, 12, 48, 96}, /* cost of loading SSE register |
2548 | in 32bit, 64bit, 128bit, 256bit and 512bit */ | |
2549 | {10, 10, 12, 48, 96}, /* cost of storing SSE register | |
2550 | in 32bit, 64bit, 128bit, 256bit and 512bit */ | |
b7167993 | 2551 | {10, 10, 12, 48, 96}, /* cost of unaligned loads. */ |
b7167993 | 2552 | {10, 10, 12, 48, 96}, /* cost of unaligned stores. */ |
d321551c L |
2553 | 2, 4, 8, /* cost of moving XMM,YMM,ZMM register */ |
2554 | 14, /* cost of moving SSE register to integer. */ | |
a4fe6139 JH |
2555 | 10, 10, /* Gather load static, per_elt. */ |
2556 | 10, 10, /* Gather store static, per_elt. */ | |
64766e8d JH |
2557 | 32, /* size of l1 cache. */ |
2558 | 2048, /* size of l2 cache. */ | |
2559 | 64, /* size of prefetch block */ | |
2560 | 100, /* number of parallel prefetches */ | |
2561 | 2, /* Branch cost */ | |
2562 | COSTS_N_INSNS (4), /* cost of FADD and FSUB insns. */ | |
2563 | COSTS_N_INSNS (4), /* cost of FMUL instruction. */ | |
2564 | COSTS_N_INSNS (19), /* cost of FDIV instruction. */ | |
2565 | COSTS_N_INSNS (2), /* cost of FABS instruction. */ | |
2566 | COSTS_N_INSNS (2), /* cost of FCHS instruction. */ | |
2567 | COSTS_N_INSNS (35), /* cost of FSQRT instruction. */ | |
6065f444 | 2568 | |
c53c148c | 2569 | COSTS_N_INSNS (1), /* cost of cheap SSE instruction. */ |
6065f444 JH |
2570 | COSTS_N_INSNS (3), /* cost of ADDSS/SD SUBSS/SD insns. */ |
2571 | COSTS_N_INSNS (2), /* cost of MULSS instruction. */ | |
2572 | COSTS_N_INSNS (4), /* cost of MULSD instruction. */ | |
c53c148c JH |
2573 | COSTS_N_INSNS (5), /* cost of FMA SS instruction. */ |
2574 | COSTS_N_INSNS (5), /* cost of FMA SD instruction. */ | |
6065f444 JH |
2575 | COSTS_N_INSNS (13), /* cost of DIVSS instruction. */ |
2576 | COSTS_N_INSNS (19), /* cost of DIVSD instruction. */ | |
2577 | COSTS_N_INSNS (16), /* cost of SQRTSS instruction. */ | |
2578 | COSTS_N_INSNS (21), /* cost of SQRTSD instruction. */ | |
64766e8d JH |
2579 | 1, 1, 1, 1, /* reassoc int, fp, vec_int, vec_fp. */ |
2580 | btver2_memcpy, | |
2581 | btver2_memset, | |
f6fd8f2b JH |
2582 | COSTS_N_INSNS (2), /* cond_taken_branch_cost. */ |
2583 | COSTS_N_INSNS (1), /* cond_not_taken_branch_cost. */ | |
7dc58b50 ML |
2584 | "16:11:8", /* Loop alignment. */ |
2585 | "16:8:8", /* Jump alignment. */ | |
2586 | "0:0:8", /* Label alignment. */ | |
2587 | "11", /* Func alignment. */ | |
071e428c HW |
2588 | 4, /* Small unroll limit. */ |
2589 | 2, /* Small unroll factor. */ | |
64766e8d JH |
2590 | }; |
2591 | ||
2592 | static stringop_algs pentium4_memcpy[2] = { | |
2593 | {libcall, {{12, loop_1_byte, false}, {-1, rep_prefix_4_byte, false}}}, | |
2594 | DUMMY_STRINGOP_ALGS}; | |
2595 | static stringop_algs pentium4_memset[2] = { | |
2596 | {libcall, {{6, loop_1_byte, false}, {48, loop, false}, | |
2597 | {20480, rep_prefix_4_byte, false}, {-1, libcall, false}}}, | |
2598 | DUMMY_STRINGOP_ALGS}; | |
2599 | ||
2600 | static const | |
2601 | struct processor_costs pentium4_cost = { | |
72bb85f8 | 2602 | { |
d321551c | 2603 | /* Start of register allocator costs. integer->integer move cost is 2. */ |
df41dbaf | 2604 | 5, /* cost for loading QImode using movzbl */ |
64766e8d JH |
2605 | {4, 5, 4}, /* cost of loading integer registers |
2606 | in QImode, HImode and SImode. | |
2607 | Relative to reg-reg move (2). */ | |
2608 | {2, 3, 2}, /* cost of storing integer registers */ | |
df41dbaf JH |
2609 | 12, /* cost of reg,reg fld/fst */ |
2610 | {14, 14, 14}, /* cost of loading fp registers | |
64766e8d | 2611 | in SFmode, DFmode and XFmode */ |
df41dbaf | 2612 | {14, 14, 14}, /* cost of storing fp registers |
64766e8d | 2613 | in SFmode, DFmode and XFmode */ |
df41dbaf JH |
2614 | 12, /* cost of moving MMX register */ |
2615 | {16, 16}, /* cost of loading MMX registers | |
64766e8d | 2616 | in SImode and DImode */ |
df41dbaf | 2617 | {16, 16}, /* cost of storing MMX registers |
64766e8d | 2618 | in SImode and DImode */ |
df41dbaf JH |
2619 | 12, 24, 48, /* cost of moving XMM,YMM,ZMM register */ |
2620 | {16, 16, 16, 32, 64}, /* cost of loading SSE registers | |
2621 | in 32,64,128,256 and 512-bit */ | |
d321551c L |
2622 | {16, 16, 16, 32, 64}, /* cost of storing SSE registers |
2623 | in 32,64,128,256 and 512-bit */ | |
2624 | 20, 12, /* SSE->integer and integer->SSE moves */ | |
ecc3135a | 2625 | 20, 12, /* mask->integer and integer->mask moves */ |
00cb3494 L |
2626 | {4, 5, 4}, /* cost of loading mask register |
2627 | in QImode, HImode, SImode. */ | |
2628 | {2, 3, 2}, /* cost if storing mask register | |
2629 | in QImode, HImode, SImode. */ | |
2630 | 2, /* cost of moving mask register. */ | |
d321551c | 2631 | /* End of register allocator costs. */ |
72bb85f8 | 2632 | }, |
d321551c L |
2633 | |
2634 | COSTS_N_INSNS (1), /* cost of an add instruction */ | |
2635 | COSTS_N_INSNS (3), /* cost of a lea instruction */ | |
2636 | COSTS_N_INSNS (4), /* variable shift costs */ | |
2637 | COSTS_N_INSNS (4), /* constant shift costs */ | |
2638 | {COSTS_N_INSNS (15), /* cost of starting multiply for QI */ | |
2639 | COSTS_N_INSNS (15), /* HI */ | |
2640 | COSTS_N_INSNS (15), /* SI */ | |
2641 | COSTS_N_INSNS (15), /* DI */ | |
2642 | COSTS_N_INSNS (15)}, /* other */ | |
2643 | 0, /* cost of multiply per each bit set */ | |
2644 | {COSTS_N_INSNS (56), /* cost of a divide/mod for QI */ | |
2645 | COSTS_N_INSNS (56), /* HI */ | |
2646 | COSTS_N_INSNS (56), /* SI */ | |
2647 | COSTS_N_INSNS (56), /* DI */ | |
2648 | COSTS_N_INSNS (56)}, /* other */ | |
2649 | COSTS_N_INSNS (1), /* cost of movsx */ | |
2650 | COSTS_N_INSNS (1), /* cost of movzx */ | |
2651 | 16, /* "large" insn */ | |
2652 | 6, /* MOVE_RATIO */ | |
25e22b19 | 2653 | 6, /* CLEAR_RATIO */ |
d321551c L |
2654 | {4, 5, 4}, /* cost of loading integer registers |
2655 | in QImode, HImode and SImode. | |
2656 | Relative to reg-reg move (2). */ | |
2657 | {2, 3, 2}, /* cost of storing integer registers */ | |
2658 | {16, 16, 16, 32, 64}, /* cost of loading SSE register | |
2659 | in 32bit, 64bit, 128bit, 256bit and 512bit */ | |
2660 | {16, 16, 16, 32, 64}, /* cost of storing SSE register | |
2661 | in 32bit, 64bit, 128bit, 256bit and 512bit */ | |
df41dbaf | 2662 | {32, 32, 32, 64, 128}, /* cost of unaligned loads. */ |
df41dbaf | 2663 | {32, 32, 32, 64, 128}, /* cost of unaligned stores. */ |
d321551c L |
2664 | 12, 24, 48, /* cost of moving XMM,YMM,ZMM register */ |
2665 | 20, /* cost of moving SSE register to integer. */ | |
a4fe6139 JH |
2666 | 16, 16, /* Gather load static, per_elt. */ |
2667 | 16, 16, /* Gather store static, per_elt. */ | |
64766e8d JH |
2668 | 8, /* size of l1 cache. */ |
2669 | 256, /* size of l2 cache. */ | |
2670 | 64, /* size of prefetch block */ | |
2671 | 6, /* number of parallel prefetches */ | |
2672 | 2, /* Branch cost */ | |
2673 | COSTS_N_INSNS (5), /* cost of FADD and FSUB insns. */ | |
2674 | COSTS_N_INSNS (7), /* cost of FMUL instruction. */ | |
2675 | COSTS_N_INSNS (43), /* cost of FDIV instruction. */ | |
2676 | COSTS_N_INSNS (2), /* cost of FABS instruction. */ | |
2677 | COSTS_N_INSNS (2), /* cost of FCHS instruction. */ | |
2678 | COSTS_N_INSNS (43), /* cost of FSQRT instruction. */ | |
6065f444 | 2679 | |
c53c148c | 2680 | COSTS_N_INSNS (2), /* cost of cheap SSE instruction. */ |
6065f444 JH |
2681 | COSTS_N_INSNS (4), /* cost of ADDSS/SD SUBSS/SD insns. */ |
2682 | COSTS_N_INSNS (6), /* cost of MULSS instruction. */ | |
2683 | COSTS_N_INSNS (6), /* cost of MULSD instruction. */ | |
c53c148c JH |
2684 | COSTS_N_INSNS (6), /* cost of FMA SS instruction. */ |
2685 | COSTS_N_INSNS (6), /* cost of FMA SD instruction. */ | |
6065f444 JH |
2686 | COSTS_N_INSNS (23), /* cost of DIVSS instruction. */ |
2687 | COSTS_N_INSNS (38), /* cost of DIVSD instruction. */ | |
2688 | COSTS_N_INSNS (23), /* cost of SQRTSS instruction. */ | |
2689 | COSTS_N_INSNS (38), /* cost of SQRTSD instruction. */ | |
64766e8d JH |
2690 | 1, 1, 1, 1, /* reassoc int, fp, vec_int, vec_fp. */ |
2691 | pentium4_memcpy, | |
2692 | pentium4_memset, | |
f6fd8f2b JH |
2693 | COSTS_N_INSNS (3), /* cond_taken_branch_cost. */ |
2694 | COSTS_N_INSNS (1), /* cond_not_taken_branch_cost. */ | |
7dc58b50 ML |
2695 | NULL, /* Loop alignment. */ |
2696 | NULL, /* Jump alignment. */ | |
2697 | NULL, /* Label alignment. */ | |
2698 | NULL, /* Func alignment. */ | |
071e428c HW |
2699 | 4, /* Small unroll limit. */ |
2700 | 2, /* Small unroll factor. */ | |
64766e8d JH |
2701 | }; |
2702 | ||
2703 | static stringop_algs nocona_memcpy[2] = { | |
2704 | {libcall, {{12, loop_1_byte, false}, {-1, rep_prefix_4_byte, false}}}, | |
2705 | {libcall, {{32, loop, false}, {20000, rep_prefix_8_byte, false}, | |
2706 | {100000, unrolled_loop, false}, {-1, libcall, false}}}}; | |
2707 | ||
2708 | static stringop_algs nocona_memset[2] = { | |
2709 | {libcall, {{6, loop_1_byte, false}, {48, loop, false}, | |
2710 | {20480, rep_prefix_4_byte, false}, {-1, libcall, false}}}, | |
2711 | {libcall, {{24, loop, false}, {64, unrolled_loop, false}, | |
2712 | {8192, rep_prefix_8_byte, false}, {-1, libcall, false}}}}; | |
2713 | ||
2714 | static const | |
2715 | struct processor_costs nocona_cost = { | |
72bb85f8 | 2716 | { |
d321551c L |
2717 | /* Start of register allocator costs. integer->integer move cost is 2. */ |
2718 | 4, /* cost for loading QImode using movzbl */ | |
2719 | {4, 4, 4}, /* cost of loading integer registers | |
2720 | in QImode, HImode and SImode. | |
2721 | Relative to reg-reg move (2). */ | |
2722 | {4, 4, 4}, /* cost of storing integer registers */ | |
2723 | 12, /* cost of reg,reg fld/fst */ | |
2724 | {14, 14, 14}, /* cost of loading fp registers | |
2725 | in SFmode, DFmode and XFmode */ | |
2726 | {14, 14, 14}, /* cost of storing fp registers | |
2727 | in SFmode, DFmode and XFmode */ | |
2728 | 14, /* cost of moving MMX register */ | |
2729 | {12, 12}, /* cost of loading MMX registers | |
2730 | in SImode and DImode */ | |
2731 | {12, 12}, /* cost of storing MMX registers | |
2732 | in SImode and DImode */ | |
2733 | 6, 12, 24, /* cost of moving XMM,YMM,ZMM register */ | |
2734 | {12, 12, 12, 24, 48}, /* cost of loading SSE registers | |
2735 | in 32,64,128,256 and 512-bit */ | |
2736 | {12, 12, 12, 24, 48}, /* cost of storing SSE registers | |
2737 | in 32,64,128,256 and 512-bit */ | |
2738 | 20, 12, /* SSE->integer and integer->SSE moves */ | |
ecc3135a | 2739 | 20, 12, /* mask->integer and integer->mask moves */ |
00cb3494 L |
2740 | {4, 4, 4}, /* cost of loading mask register |
2741 | in QImode, HImode, SImode. */ | |
2742 | {4, 4, 4}, /* cost if storing mask register | |
2743 | in QImode, HImode, SImode. */ | |
2744 | 2, /* cost of moving mask register. */ | |
d321551c | 2745 | /* End of register allocator costs. */ |
72bb85f8 | 2746 | }, |
d321551c | 2747 | |
64766e8d JH |
2748 | COSTS_N_INSNS (1), /* cost of an add instruction */ |
2749 | COSTS_N_INSNS (1), /* cost of a lea instruction */ | |
2750 | COSTS_N_INSNS (1), /* variable shift costs */ | |
2751 | COSTS_N_INSNS (1), /* constant shift costs */ | |
2752 | {COSTS_N_INSNS (10), /* cost of starting multiply for QI */ | |
2753 | COSTS_N_INSNS (10), /* HI */ | |
2754 | COSTS_N_INSNS (10), /* SI */ | |
2755 | COSTS_N_INSNS (10), /* DI */ | |
2756 | COSTS_N_INSNS (10)}, /* other */ | |
2757 | 0, /* cost of multiply per each bit set */ | |
2758 | {COSTS_N_INSNS (66), /* cost of a divide/mod for QI */ | |
2759 | COSTS_N_INSNS (66), /* HI */ | |
2760 | COSTS_N_INSNS (66), /* SI */ | |
2761 | COSTS_N_INSNS (66), /* DI */ | |
2762 | COSTS_N_INSNS (66)}, /* other */ | |
2763 | COSTS_N_INSNS (1), /* cost of movsx */ | |
2764 | COSTS_N_INSNS (1), /* cost of movzx */ | |
2765 | 16, /* "large" insn */ | |
2766 | 17, /* MOVE_RATIO */ | |
25e22b19 | 2767 | 6, /* CLEAR_RATIO */ |
64766e8d JH |
2768 | {4, 4, 4}, /* cost of loading integer registers |
2769 | in QImode, HImode and SImode. | |
2770 | Relative to reg-reg move (2). */ | |
2771 | {4, 4, 4}, /* cost of storing integer registers */ | |
d321551c L |
2772 | {12, 12, 12, 24, 48}, /* cost of loading SSE register |
2773 | in 32bit, 64bit, 128bit, 256bit and 512bit */ | |
2774 | {12, 12, 12, 24, 48}, /* cost of storing SSE register | |
2775 | in 32bit, 64bit, 128bit, 256bit and 512bit */ | |
df41dbaf | 2776 | {24, 24, 24, 48, 96}, /* cost of unaligned loads. */ |
df41dbaf | 2777 | {24, 24, 24, 48, 96}, /* cost of unaligned stores. */ |
d321551c L |
2778 | 6, 12, 24, /* cost of moving XMM,YMM,ZMM register */ |
2779 | 20, /* cost of moving SSE register to integer. */ | |
a4fe6139 JH |
2780 | 12, 12, /* Gather load static, per_elt. */ |
2781 | 12, 12, /* Gather store static, per_elt. */ | |
64766e8d JH |
2782 | 8, /* size of l1 cache. */ |
2783 | 1024, /* size of l2 cache. */ | |
2784 | 64, /* size of prefetch block */ | |
2785 | 8, /* number of parallel prefetches */ | |
2786 | 1, /* Branch cost */ | |
2787 | COSTS_N_INSNS (6), /* cost of FADD and FSUB insns. */ | |
2788 | COSTS_N_INSNS (8), /* cost of FMUL instruction. */ | |
2789 | COSTS_N_INSNS (40), /* cost of FDIV instruction. */ | |
2790 | COSTS_N_INSNS (3), /* cost of FABS instruction. */ | |
2791 | COSTS_N_INSNS (3), /* cost of FCHS instruction. */ | |
2792 | COSTS_N_INSNS (44), /* cost of FSQRT instruction. */ | |
6065f444 | 2793 | |
c53c148c | 2794 | COSTS_N_INSNS (2), /* cost of cheap SSE instruction. */ |
6065f444 JH |
2795 | COSTS_N_INSNS (5), /* cost of ADDSS/SD SUBSS/SD insns. */ |
2796 | COSTS_N_INSNS (7), /* cost of MULSS instruction. */ | |
2797 | COSTS_N_INSNS (7), /* cost of MULSD instruction. */ | |
c53c148c JH |
2798 | COSTS_N_INSNS (7), /* cost of FMA SS instruction. */ |
2799 | COSTS_N_INSNS (7), /* cost of FMA SD instruction. */ | |
6065f444 JH |
2800 | COSTS_N_INSNS (32), /* cost of DIVSS instruction. */ |
2801 | COSTS_N_INSNS (40), /* cost of DIVSD instruction. */ | |
2802 | COSTS_N_INSNS (32), /* cost of SQRTSS instruction. */ | |
2803 | COSTS_N_INSNS (41), /* cost of SQRTSD instruction. */ | |
64766e8d JH |
2804 | 1, 1, 1, 1, /* reassoc int, fp, vec_int, vec_fp. */ |
2805 | nocona_memcpy, | |
2806 | nocona_memset, | |
f6fd8f2b JH |
2807 | COSTS_N_INSNS (3), /* cond_taken_branch_cost. */ |
2808 | COSTS_N_INSNS (1), /* cond_not_taken_branch_cost. */ | |
7dc58b50 ML |
2809 | NULL, /* Loop alignment. */ |
2810 | NULL, /* Jump alignment. */ | |
2811 | NULL, /* Label alignment. */ | |
2812 | NULL, /* Func alignment. */ | |
071e428c HW |
2813 | 4, /* Small unroll limit. */ |
2814 | 2, /* Small unroll factor. */ | |
64766e8d JH |
2815 | }; |
2816 | ||
2817 | static stringop_algs atom_memcpy[2] = { | |
2818 | {libcall, {{11, loop, false}, {-1, rep_prefix_4_byte, false}}}, | |
2819 | {libcall, {{32, loop, false}, {64, rep_prefix_4_byte, false}, | |
2820 | {8192, rep_prefix_8_byte, false}, {-1, libcall, false}}}}; | |
2821 | static stringop_algs atom_memset[2] = { | |
2822 | {libcall, {{8, loop, false}, {15, unrolled_loop, false}, | |
2823 | {2048, rep_prefix_4_byte, false}, {-1, libcall, false}}}, | |
2824 | {libcall, {{24, loop, false}, {32, unrolled_loop, false}, | |
2825 | {8192, rep_prefix_8_byte, false}, {-1, libcall, false}}}}; | |
2826 | static const | |
2827 | struct processor_costs atom_cost = { | |
72bb85f8 | 2828 | { |
d321551c L |
2829 | /* Start of register allocator costs. integer->integer move cost is 2. */ |
2830 | 6, /* cost for loading QImode using movzbl */ | |
2831 | {6, 6, 6}, /* cost of loading integer registers | |
2832 | in QImode, HImode and SImode. | |
2833 | Relative to reg-reg move (2). */ | |
2834 | {6, 6, 6}, /* cost of storing integer registers */ | |
2835 | 4, /* cost of reg,reg fld/fst */ | |
2836 | {6, 6, 18}, /* cost of loading fp registers | |
2837 | in SFmode, DFmode and XFmode */ | |
2838 | {14, 14, 24}, /* cost of storing fp registers | |
2839 | in SFmode, DFmode and XFmode */ | |
2840 | 2, /* cost of moving MMX register */ | |
2841 | {8, 8}, /* cost of loading MMX registers | |
2842 | in SImode and DImode */ | |
2843 | {10, 10}, /* cost of storing MMX registers | |
2844 | in SImode and DImode */ | |
2845 | 2, 4, 8, /* cost of moving XMM,YMM,ZMM register */ | |
2846 | {8, 8, 8, 16, 32}, /* cost of loading SSE registers | |
2847 | in 32,64,128,256 and 512-bit */ | |
2848 | {8, 8, 8, 16, 32}, /* cost of storing SSE registers | |
2849 | in 32,64,128,256 and 512-bit */ | |
ecc3135a | 2850 | 8, 6, /* SSE->integer and integer->SSE moves */ |
2851 | 8, 6, /* mask->integer and integer->mask moves */ | |
00cb3494 L |
2852 | {6, 6, 6}, /* cost of loading mask register |
2853 | in QImode, HImode, SImode. */ | |
2854 | {6, 6, 6}, /* cost if storing mask register | |
2855 | in QImode, HImode, SImode. */ | |
2856 | 2, /* cost of moving mask register. */ | |
d321551c | 2857 | /* End of register allocator costs. */ |
72bb85f8 | 2858 | }, |
d321551c | 2859 | |
64766e8d JH |
2860 | COSTS_N_INSNS (1), /* cost of an add instruction */ |
2861 | COSTS_N_INSNS (1) + 1, /* cost of a lea instruction */ | |
2862 | COSTS_N_INSNS (1), /* variable shift costs */ | |
2863 | COSTS_N_INSNS (1), /* constant shift costs */ | |
2864 | {COSTS_N_INSNS (3), /* cost of starting multiply for QI */ | |
2865 | COSTS_N_INSNS (4), /* HI */ | |
2866 | COSTS_N_INSNS (3), /* SI */ | |
2867 | COSTS_N_INSNS (4), /* DI */ | |
2868 | COSTS_N_INSNS (2)}, /* other */ | |
2869 | 0, /* cost of multiply per each bit set */ | |
2870 | {COSTS_N_INSNS (18), /* cost of a divide/mod for QI */ | |
2871 | COSTS_N_INSNS (26), /* HI */ | |
2872 | COSTS_N_INSNS (42), /* SI */ | |
2873 | COSTS_N_INSNS (74), /* DI */ | |
2874 | COSTS_N_INSNS (74)}, /* other */ | |
2875 | COSTS_N_INSNS (1), /* cost of movsx */ | |
2876 | COSTS_N_INSNS (1), /* cost of movzx */ | |
2877 | 8, /* "large" insn */ | |
2878 | 17, /* MOVE_RATIO */ | |
25e22b19 | 2879 | 6, /* CLEAR_RATIO */ |
df41dbaf | 2880 | {6, 6, 6}, /* cost of loading integer registers |
64766e8d JH |
2881 | in QImode, HImode and SImode. |
2882 | Relative to reg-reg move (2). */ | |
df41dbaf | 2883 | {6, 6, 6}, /* cost of storing integer registers */ |
d321551c L |
2884 | {8, 8, 8, 16, 32}, /* cost of loading SSE register |
2885 | in 32bit, 64bit, 128bit, 256bit and 512bit */ | |
2886 | {8, 8, 8, 16, 32}, /* cost of storing SSE register | |
2887 | in 32bit, 64bit, 128bit, 256bit and 512bit */ | |
df41dbaf | 2888 | {16, 16, 16, 32, 64}, /* cost of unaligned loads. */ |
df41dbaf | 2889 | {16, 16, 16, 32, 64}, /* cost of unaligned stores. */ |
d321551c L |
2890 | 2, 4, 8, /* cost of moving XMM,YMM,ZMM register */ |
2891 | 8, /* cost of moving SSE register to integer. */ | |
a4fe6139 JH |
2892 | 8, 8, /* Gather load static, per_elt. */ |
2893 | 8, 8, /* Gather store static, per_elt. */ | |
64766e8d JH |
2894 | 32, /* size of l1 cache. */ |
2895 | 256, /* size of l2 cache. */ | |
2896 | 64, /* size of prefetch block */ | |
2897 | 6, /* number of parallel prefetches */ | |
2898 | 3, /* Branch cost */ | |
2899 | COSTS_N_INSNS (8), /* cost of FADD and FSUB insns. */ | |
2900 | COSTS_N_INSNS (8), /* cost of FMUL instruction. */ | |
2901 | COSTS_N_INSNS (20), /* cost of FDIV instruction. */ | |
2902 | COSTS_N_INSNS (8), /* cost of FABS instruction. */ | |
2903 | COSTS_N_INSNS (8), /* cost of FCHS instruction. */ | |
2904 | COSTS_N_INSNS (40), /* cost of FSQRT instruction. */ | |
6065f444 | 2905 | |
c53c148c | 2906 | COSTS_N_INSNS (1), /* cost of cheap SSE instruction. */ |
6065f444 JH |
2907 | COSTS_N_INSNS (5), /* cost of ADDSS/SD SUBSS/SD insns. */ |
2908 | COSTS_N_INSNS (4), /* cost of MULSS instruction. */ | |
2909 | COSTS_N_INSNS (5), /* cost of MULSD instruction. */ | |
c53c148c JH |
2910 | COSTS_N_INSNS (6), /* cost of FMA SS instruction. */ |
2911 | COSTS_N_INSNS (6), /* cost of FMA SD instruction. */ | |
6065f444 JH |
2912 | COSTS_N_INSNS (31), /* cost of DIVSS instruction. */ |
2913 | COSTS_N_INSNS (60), /* cost of DIVSD instruction. */ | |
2914 | COSTS_N_INSNS (31), /* cost of SQRTSS instruction. */ | |
2915 | COSTS_N_INSNS (63), /* cost of SQRTSD instruction. */ | |
64766e8d JH |
2916 | 2, 2, 2, 2, /* reassoc int, fp, vec_int, vec_fp. */ |
2917 | atom_memcpy, | |
2918 | atom_memset, | |
f6fd8f2b JH |
2919 | COSTS_N_INSNS (3), /* cond_taken_branch_cost. */ |
2920 | COSTS_N_INSNS (1), /* cond_not_taken_branch_cost. */ | |
7dc58b50 ML |
2921 | "16", /* Loop alignment. */ |
2922 | "16:8:8", /* Jump alignment. */ | |
2923 | "0:0:8", /* Label alignment. */ | |
2924 | "16", /* Func alignment. */ | |
071e428c HW |
2925 | 4, /* Small unroll limit. */ |
2926 | 2, /* Small unroll factor. */ | |
64766e8d JH |
2927 | }; |
2928 | ||
2929 | static stringop_algs slm_memcpy[2] = { | |
2930 | {libcall, {{11, loop, false}, {-1, rep_prefix_4_byte, false}}}, | |
2931 | {libcall, {{32, loop, false}, {64, rep_prefix_4_byte, false}, | |
2932 | {8192, rep_prefix_8_byte, false}, {-1, libcall, false}}}}; | |
2933 | static stringop_algs slm_memset[2] = { | |
2934 | {libcall, {{8, loop, false}, {15, unrolled_loop, false}, | |
2935 | {2048, rep_prefix_4_byte, false}, {-1, libcall, false}}}, | |
2936 | {libcall, {{24, loop, false}, {32, unrolled_loop, false}, | |
2937 | {8192, rep_prefix_8_byte, false}, {-1, libcall, false}}}}; | |
2938 | static const | |
2939 | struct processor_costs slm_cost = { | |
72bb85f8 | 2940 | { |
d321551c L |
2941 | /* Start of register allocator costs. integer->integer move cost is 2. */ |
2942 | 8, /* cost for loading QImode using movzbl */ | |
2943 | {8, 8, 8}, /* cost of loading integer registers | |
2944 | in QImode, HImode and SImode. | |
2945 | Relative to reg-reg move (2). */ | |
2946 | {6, 6, 6}, /* cost of storing integer registers */ | |
2947 | 2, /* cost of reg,reg fld/fst */ | |
2948 | {8, 8, 18}, /* cost of loading fp registers | |
2949 | in SFmode, DFmode and XFmode */ | |
2950 | {6, 6, 18}, /* cost of storing fp registers | |
2951 | in SFmode, DFmode and XFmode */ | |
2952 | 2, /* cost of moving MMX register */ | |
2953 | {8, 8}, /* cost of loading MMX registers | |
2954 | in SImode and DImode */ | |
2955 | {6, 6}, /* cost of storing MMX registers | |
2956 | in SImode and DImode */ | |
2957 | 2, 4, 8, /* cost of moving XMM,YMM,ZMM register */ | |
2958 | {8, 8, 8, 16, 32}, /* cost of loading SSE registers | |
2959 | in 32,64,128,256 and 512-bit */ | |
2960 | {8, 8, 8, 16, 32}, /* cost of storing SSE registers | |
2961 | in 32,64,128,256 and 512-bit */ | |
ecc3135a | 2962 | 8, 6, /* SSE->integer and integer->SSE moves */ |
2963 | 8, 6, /* mask->integer and integer->mask moves */ | |
00cb3494 L |
2964 | {8, 8, 8}, /* cost of loading mask register |
2965 | in QImode, HImode, SImode. */ | |
2966 | {6, 6, 6}, /* cost if storing mask register | |
2967 | in QImode, HImode, SImode. */ | |
2968 | 2, /* cost of moving mask register. */ | |
d321551c | 2969 | /* End of register allocator costs. */ |
72bb85f8 | 2970 | }, |
d321551c | 2971 | |
64766e8d JH |
2972 | COSTS_N_INSNS (1), /* cost of an add instruction */ |
2973 | COSTS_N_INSNS (1) + 1, /* cost of a lea instruction */ | |
2974 | COSTS_N_INSNS (1), /* variable shift costs */ | |
2975 | COSTS_N_INSNS (1), /* constant shift costs */ | |
2976 | {COSTS_N_INSNS (3), /* cost of starting multiply for QI */ | |
2977 | COSTS_N_INSNS (3), /* HI */ | |
2978 | COSTS_N_INSNS (3), /* SI */ | |
2979 | COSTS_N_INSNS (4), /* DI */ | |
2980 | COSTS_N_INSNS (2)}, /* other */ | |
2981 | 0, /* cost of multiply per each bit set */ | |
2982 | {COSTS_N_INSNS (18), /* cost of a divide/mod for QI */ | |
2983 | COSTS_N_INSNS (26), /* HI */ | |
2984 | COSTS_N_INSNS (42), /* SI */ | |
2985 | COSTS_N_INSNS (74), /* DI */ | |
2986 | COSTS_N_INSNS (74)}, /* other */ | |
2987 | COSTS_N_INSNS (1), /* cost of movsx */ | |
2988 | COSTS_N_INSNS (1), /* cost of movzx */ | |
2989 | 8, /* "large" insn */ | |
2990 | 17, /* MOVE_RATIO */ | |
25e22b19 | 2991 | 6, /* CLEAR_RATIO */ |
df41dbaf | 2992 | {8, 8, 8}, /* cost of loading integer registers |
64766e8d JH |
2993 | in QImode, HImode and SImode. |
2994 | Relative to reg-reg move (2). */ | |
df41dbaf | 2995 | {6, 6, 6}, /* cost of storing integer registers */ |
d321551c L |
2996 | {8, 8, 8, 16, 32}, /* cost of loading SSE register |
2997 | in 32bit, 64bit, 128bit, 256bit and 512bit */ | |
2998 | {8, 8, 8, 16, 32}, /* cost of storing SSE register | |
2999 | in SImode, DImode and TImode. */ | |
df41dbaf | 3000 | {16, 16, 16, 32, 64}, /* cost of unaligned loads. */ |
df41dbaf | 3001 | {16, 16, 16, 32, 64}, /* cost of unaligned stores. */ |
d321551c L |
3002 | 2, 4, 8, /* cost of moving XMM,YMM,ZMM register */ |
3003 | 8, /* cost of moving SSE register to integer. */ | |
a4fe6139 JH |
3004 | 8, 8, /* Gather load static, per_elt. */ |
3005 | 8, 8, /* Gather store static, per_elt. */ | |
64766e8d JH |
3006 | 32, /* size of l1 cache. */ |
3007 | 256, /* size of l2 cache. */ | |
3008 | 64, /* size of prefetch block */ | |
3009 | 6, /* number of parallel prefetches */ | |
3010 | 3, /* Branch cost */ | |
3011 | COSTS_N_INSNS (8), /* cost of FADD and FSUB insns. */ | |
3012 | COSTS_N_INSNS (8), /* cost of FMUL instruction. */ | |
3013 | COSTS_N_INSNS (20), /* cost of FDIV instruction. */ | |
3014 | COSTS_N_INSNS (8), /* cost of FABS instruction. */ | |
3015 | COSTS_N_INSNS (8), /* cost of FCHS instruction. */ | |
3016 | COSTS_N_INSNS (40), /* cost of FSQRT instruction. */ | |
6065f444 | 3017 | |
c53c148c | 3018 | COSTS_N_INSNS (1), /* cost of cheap SSE instruction. */ |
6065f444 JH |
3019 | COSTS_N_INSNS (3), /* cost of ADDSS/SD SUBSS/SD insns. */ |
3020 | COSTS_N_INSNS (4), /* cost of MULSS instruction. */ | |
3021 | COSTS_N_INSNS (5), /* cost of MULSD instruction. */ | |
c53c148c JH |
3022 | COSTS_N_INSNS (6), /* cost of FMA SS instruction. */ |
3023 | COSTS_N_INSNS (6), /* cost of FMA SD instruction. */ | |
6065f444 JH |
3024 | COSTS_N_INSNS (39), /* cost of DIVSS instruction. */ |
3025 | COSTS_N_INSNS (69), /* cost of DIVSD instruction. */ | |
3026 | COSTS_N_INSNS (20), /* cost of SQRTSS instruction. */ | |
3027 | COSTS_N_INSNS (35), /* cost of SQRTSD instruction. */ | |
64766e8d JH |
3028 | 1, 2, 1, 1, /* reassoc int, fp, vec_int, vec_fp. */ |
3029 | slm_memcpy, | |
3030 | slm_memset, | |
f6fd8f2b JH |
3031 | COSTS_N_INSNS (3), /* cond_taken_branch_cost. */ |
3032 | COSTS_N_INSNS (1), /* cond_not_taken_branch_cost. */ | |
7dc58b50 ML |
3033 | "16", /* Loop alignment. */ |
3034 | "16:8:8", /* Jump alignment. */ | |
3035 | "0:0:8", /* Label alignment. */ | |
3036 | "16", /* Func alignment. */ | |
071e428c HW |
3037 | 4, /* Small unroll limit. */ |
3038 | 2, /* Small unroll factor. */ | |
64766e8d JH |
3039 | }; |
3040 | ||
c3a2437f L |
3041 | static stringop_algs tremont_memcpy[2] = { |
3042 | {libcall, | |
3043 | {{256, rep_prefix_1_byte, true}, | |
3044 | {256, loop, false}, | |
3045 | {-1, libcall, false}}}, | |
3046 | {libcall, | |
3047 | {{256, rep_prefix_1_byte, true}, | |
3048 | {256, loop, false}, | |
3049 | {-1, libcall, false}}}}; | |
3050 | static stringop_algs tremont_memset[2] = { | |
3051 | {libcall, | |
3052 | {{256, rep_prefix_1_byte, true}, | |
3053 | {256, loop, false}, | |
3054 | {-1, libcall, false}}}, | |
3055 | {libcall, | |
3056 | {{256, rep_prefix_1_byte, true}, | |
3057 | {256, loop, false}, | |
3058 | {-1, libcall, false}}}}; | |
3059 | static const | |
3060 | struct processor_costs tremont_cost = { | |
3061 | { | |
3062 | /* Start of register allocator costs. integer->integer move cost is 2. */ | |
3063 | 6, /* cost for loading QImode using movzbl */ | |
3064 | {6, 6, 6}, /* cost of loading integer registers | |
3065 | in QImode, HImode and SImode. | |
3066 | Relative to reg-reg move (2). */ | |
3067 | {6, 6, 6}, /* cost of storing integer registers */ | |
3068 | 4, /* cost of reg,reg fld/fst */ | |
3069 | {6, 6, 12}, /* cost of loading fp registers | |
3070 | in SFmode, DFmode and XFmode */ | |
3071 | {6, 6, 12}, /* cost of storing fp registers | |
3072 | in SFmode, DFmode and XFmode */ | |
3073 | 2, /* cost of moving MMX register */ | |
3074 | {6, 6}, /* cost of loading MMX registers | |
3075 | in SImode and DImode */ | |
3076 | {6, 6}, /* cost of storing MMX registers | |
3077 | in SImode and DImode */ | |
3078 | 2, 3, 4, /* cost of moving XMM,YMM,ZMM register */ | |
3079 | {6, 6, 6, 10, 15}, /* cost of loading SSE registers | |
3080 | in 32,64,128,256 and 512-bit */ | |
3081 | {6, 6, 6, 10, 15}, /* cost of storing SSE registers | |
3082 | in 32,64,128,256 and 512-bit */ | |
3083 | 6, 6, /* SSE->integer and integer->SSE moves */ | |
3084 | 6, 6, /* mask->integer and integer->mask moves */ | |
3085 | {6, 6, 6}, /* cost of loading mask register | |
3086 | in QImode, HImode, SImode. */ | |
3087 | {6, 6, 6}, /* cost if storing mask register | |
3088 | in QImode, HImode, SImode. */ | |
3089 | 2, /* cost of moving mask register. */ | |
3090 | /* End of register allocator costs. */ | |
3091 | }, | |
3092 | ||
3093 | COSTS_N_INSNS (1), /* cost of an add instruction */ | |
3094 | /* Setting cost to 2 makes our current implementation of synth_mult result in | |
3095 | use of unnecessary temporary registers causing regression on several | |
3096 | SPECfp benchmarks. */ | |
3097 | COSTS_N_INSNS (1) + 1, /* cost of a lea instruction */ | |
3098 | COSTS_N_INSNS (1), /* variable shift costs */ | |
3099 | COSTS_N_INSNS (1), /* constant shift costs */ | |
3100 | {COSTS_N_INSNS (3), /* cost of starting multiply for QI */ | |
3101 | COSTS_N_INSNS (4), /* HI */ | |
3102 | COSTS_N_INSNS (3), /* SI */ | |
3103 | COSTS_N_INSNS (4), /* DI */ | |
3104 | COSTS_N_INSNS (4)}, /* other */ | |
3105 | 0, /* cost of multiply per each bit set */ | |
3106 | {COSTS_N_INSNS (16), /* cost of a divide/mod for QI */ | |
3107 | COSTS_N_INSNS (22), /* HI */ | |
3108 | COSTS_N_INSNS (30), /* SI */ | |
3109 | COSTS_N_INSNS (74), /* DI */ | |
3110 | COSTS_N_INSNS (74)}, /* other */ | |
3111 | COSTS_N_INSNS (1), /* cost of movsx */ | |
3112 | COSTS_N_INSNS (1), /* cost of movzx */ | |
3113 | 8, /* "large" insn */ | |
3114 | 17, /* MOVE_RATIO */ | |
3115 | 17, /* CLEAR_RATIO */ | |
3116 | {6, 6, 6}, /* cost of loading integer registers | |
3117 | in QImode, HImode and SImode. | |
3118 | Relative to reg-reg move (2). */ | |
3119 | {6, 6, 6}, /* cost of storing integer registers */ | |
3120 | {6, 6, 6, 10, 15}, /* cost of loading SSE register | |
3121 | in 32bit, 64bit, 128bit, 256bit and 512bit */ | |
3122 | {6, 6, 6, 10, 15}, /* cost of storing SSE register | |
3123 | in 32bit, 64bit, 128bit, 256bit and 512bit */ | |
3124 | {6, 6, 6, 10, 15}, /* cost of unaligned loads. */ | |
3125 | {6, 6, 6, 10, 15}, /* cost of unaligned storess. */ | |
3126 | 2, 3, 4, /* cost of moving XMM,YMM,ZMM register */ | |
3127 | 6, /* cost of moving SSE register to integer. */ | |
3128 | 18, 6, /* Gather load static, per_elt. */ | |
3129 | 18, 6, /* Gather store static, per_elt. */ | |
3130 | 32, /* size of l1 cache. */ | |
3131 | 512, /* size of l2 cache. */ | |
3132 | 64, /* size of prefetch block */ | |
3133 | 6, /* number of parallel prefetches */ | |
3134 | /* Benchmarks shows large regressions on K8 sixtrack benchmark when this | |
3135 | value is increased to perhaps more appropriate value of 5. */ | |
3136 | 3, /* Branch cost */ | |
3137 | COSTS_N_INSNS (3), /* cost of FADD and FSUB insns. */ | |
3138 | COSTS_N_INSNS (5), /* cost of FMUL instruction. */ | |
3139 | COSTS_N_INSNS (17), /* cost of FDIV instruction. */ | |
3140 | COSTS_N_INSNS (1), /* cost of FABS instruction. */ | |
3141 | COSTS_N_INSNS (1), /* cost of FCHS instruction. */ | |
3142 | COSTS_N_INSNS (14), /* cost of FSQRT instruction. */ | |
3143 | ||
3144 | COSTS_N_INSNS (1), /* cost of cheap SSE instruction. */ | |
3145 | COSTS_N_INSNS (3), /* cost of ADDSS/SD SUBSS/SD insns. */ | |
3146 | COSTS_N_INSNS (4), /* cost of MULSS instruction. */ | |
3147 | COSTS_N_INSNS (5), /* cost of MULSD instruction. */ | |
3148 | COSTS_N_INSNS (5), /* cost of FMA SS instruction. */ | |
3149 | COSTS_N_INSNS (5), /* cost of FMA SD instruction. */ | |
3150 | COSTS_N_INSNS (13), /* cost of DIVSS instruction. */ | |
3151 | COSTS_N_INSNS (17), /* cost of DIVSD instruction. */ | |
3152 | COSTS_N_INSNS (14), /* cost of SQRTSS instruction. */ | |
3153 | COSTS_N_INSNS (18), /* cost of SQRTSD instruction. */ | |
3154 | 1, 4, 3, 3, /* reassoc int, fp, vec_int, vec_fp. */ | |
3155 | tremont_memcpy, | |
3156 | tremont_memset, | |
3157 | COSTS_N_INSNS (4), /* cond_taken_branch_cost. */ | |
3158 | COSTS_N_INSNS (2), /* cond_not_taken_branch_cost. */ | |
3159 | "16:11:8", /* Loop alignment. */ | |
3160 | "16:11:8", /* Jump alignment. */ | |
3161 | "0:0:8", /* Label alignment. */ | |
3162 | "16", /* Func alignment. */ | |
071e428c HW |
3163 | 4, /* Small unroll limit. */ |
3164 | 2, /* Small unroll factor. */ | |
c3a2437f L |
3165 | }; |
3166 | ||
64766e8d JH |
3167 | static stringop_algs intel_memcpy[2] = { |
3168 | {libcall, {{11, loop, false}, {-1, rep_prefix_4_byte, false}}}, | |
3169 | {libcall, {{32, loop, false}, {64, rep_prefix_4_byte, false}, | |
3170 | {8192, rep_prefix_8_byte, false}, {-1, libcall, false}}}}; | |
3171 | static stringop_algs intel_memset[2] = { | |
3172 | {libcall, {{8, loop, false}, {15, unrolled_loop, false}, | |
3173 | {2048, rep_prefix_4_byte, false}, {-1, libcall, false}}}, | |
3174 | {libcall, {{24, loop, false}, {32, unrolled_loop, false}, | |
3175 | {8192, rep_prefix_8_byte, false}, {-1, libcall, false}}}}; | |
3176 | static const | |
3177 | struct processor_costs intel_cost = { | |
72bb85f8 | 3178 | { |
d321551c L |
3179 | /* Start of register allocator costs. integer->integer move cost is 2. */ |
3180 | 6, /* cost for loading QImode using movzbl */ | |
3181 | {4, 4, 4}, /* cost of loading integer registers | |
3182 | in QImode, HImode and SImode. | |
3183 | Relative to reg-reg move (2). */ | |
3184 | {6, 6, 6}, /* cost of storing integer registers */ | |
3185 | 2, /* cost of reg,reg fld/fst */ | |
3186 | {6, 6, 8}, /* cost of loading fp registers | |
3187 | in SFmode, DFmode and XFmode */ | |
3188 | {6, 6, 10}, /* cost of storing fp registers | |
3189 | in SFmode, DFmode and XFmode */ | |
3190 | 2, /* cost of moving MMX register */ | |
3191 | {6, 6}, /* cost of loading MMX registers | |
3192 | in SImode and DImode */ | |
3193 | {6, 6}, /* cost of storing MMX registers | |
3194 | in SImode and DImode */ | |
3195 | 2, 2, 2, /* cost of moving XMM,YMM,ZMM register */ | |
3196 | {6, 6, 6, 6, 6}, /* cost of loading SSE registers | |
3197 | in 32,64,128,256 and 512-bit */ | |
3198 | {6, 6, 6, 6, 6}, /* cost of storing SSE registers | |
3199 | in 32,64,128,256 and 512-bit */ | |
ecc3135a | 3200 | 4, 4, /* SSE->integer and integer->SSE moves */ |
3201 | 4, 4, /* mask->integer and integer->mask moves */ | |
00cb3494 L |
3202 | {4, 4, 4}, /* cost of loading mask register |
3203 | in QImode, HImode, SImode. */ | |
3204 | {6, 6, 6}, /* cost if storing mask register | |
3205 | in QImode, HImode, SImode. */ | |
3206 | 2, /* cost of moving mask register. */ | |
d321551c | 3207 | /* End of register allocator costs. */ |
72bb85f8 | 3208 | }, |
d321551c | 3209 | |
64766e8d JH |
3210 | COSTS_N_INSNS (1), /* cost of an add instruction */ |
3211 | COSTS_N_INSNS (1) + 1, /* cost of a lea instruction */ | |
3212 | COSTS_N_INSNS (1), /* variable shift costs */ | |
3213 | COSTS_N_INSNS (1), /* constant shift costs */ | |
3214 | {COSTS_N_INSNS (3), /* cost of starting multiply for QI */ | |
3215 | COSTS_N_INSNS (3), /* HI */ | |
3216 | COSTS_N_INSNS (3), /* SI */ | |
3217 | COSTS_N_INSNS (4), /* DI */ | |
3218 | COSTS_N_INSNS (2)}, /* other */ | |
3219 | 0, /* cost of multiply per each bit set */ | |
3220 | {COSTS_N_INSNS (18), /* cost of a divide/mod for QI */ | |
3221 | COSTS_N_INSNS (26), /* HI */ | |
3222 | COSTS_N_INSNS (42), /* SI */ | |
3223 | COSTS_N_INSNS (74), /* DI */ | |
3224 | COSTS_N_INSNS (74)}, /* other */ | |
3225 | COSTS_N_INSNS (1), /* cost of movsx */ | |
3226 | COSTS_N_INSNS (1), /* cost of movzx */ | |
3227 | 8, /* "large" insn */ | |
3228 | 17, /* MOVE_RATIO */ | |
25e22b19 | 3229 | 6, /* CLEAR_RATIO */ |
64766e8d JH |
3230 | {4, 4, 4}, /* cost of loading integer registers |
3231 | in QImode, HImode and SImode. | |
3232 | Relative to reg-reg move (2). */ | |
af863030 | 3233 | {6, 6, 6}, /* cost of storing integer registers */ |
d321551c L |
3234 | {6, 6, 6, 6, 6}, /* cost of loading SSE register |
3235 | in 32bit, 64bit, 128bit, 256bit and 512bit */ | |
3236 | {6, 6, 6, 6, 6}, /* cost of storing SSE register | |
3237 | in 32bit, 64bit, 128bit, 256bit and 512bit */ | |
df41dbaf | 3238 | {10, 10, 10, 10, 10}, /* cost of unaligned loads. */ |
df41dbaf | 3239 | {10, 10, 10, 10, 10}, /* cost of unaligned loads. */ |
d321551c L |
3240 | 2, 2, 2, /* cost of moving XMM,YMM,ZMM register */ |
3241 | 4, /* cost of moving SSE register to integer. */ | |
a4fe6139 JH |
3242 | 6, 6, /* Gather load static, per_elt. */ |
3243 | 6, 6, /* Gather store static, per_elt. */ | |
64766e8d JH |
3244 | 32, /* size of l1 cache. */ |
3245 | 256, /* size of l2 cache. */ | |
3246 | 64, /* size of prefetch block */ | |
3247 | 6, /* number of parallel prefetches */ | |
3248 | 3, /* Branch cost */ | |
3249 | COSTS_N_INSNS (8), /* cost of FADD and FSUB insns. */ | |
3250 | COSTS_N_INSNS (8), /* cost of FMUL instruction. */ | |
3251 | COSTS_N_INSNS (20), /* cost of FDIV instruction. */ | |
3252 | COSTS_N_INSNS (8), /* cost of FABS instruction. */ | |
3253 | COSTS_N_INSNS (8), /* cost of FCHS instruction. */ | |
3254 | COSTS_N_INSNS (40), /* cost of FSQRT instruction. */ | |
6065f444 | 3255 | |
3ff59baa | 3256 | COSTS_N_INSNS (1), /* cost of cheap SSE instruction. */ |
6065f444 JH |
3257 | COSTS_N_INSNS (8), /* cost of ADDSS/SD SUBSS/SD insns. */ |
3258 | COSTS_N_INSNS (8), /* cost of MULSS instruction. */ | |
3259 | COSTS_N_INSNS (8), /* cost of MULSD instruction. */ | |
c53c148c JH |
3260 | COSTS_N_INSNS (6), /* cost of FMA SS instruction. */ |
3261 | COSTS_N_INSNS (6), /* cost of FMA SD instruction. */ | |
6065f444 JH |
3262 | COSTS_N_INSNS (20), /* cost of DIVSS instruction. */ |
3263 | COSTS_N_INSNS (20), /* cost of DIVSD instruction. */ | |
3264 | COSTS_N_INSNS (40), /* cost of SQRTSS instruction. */ | |
3265 | COSTS_N_INSNS (40), /* cost of SQRTSD instruction. */ | |
64766e8d JH |
3266 | 1, 4, 1, 1, /* reassoc int, fp, vec_int, vec_fp. */ |
3267 | intel_memcpy, | |
3268 | intel_memset, | |
f6fd8f2b JH |
3269 | COSTS_N_INSNS (3), /* cond_taken_branch_cost. */ |
3270 | COSTS_N_INSNS (1), /* cond_not_taken_branch_cost. */ | |
7dc58b50 ML |
3271 | "16", /* Loop alignment. */ |
3272 | "16:8:8", /* Jump alignment. */ | |
3273 | "0:0:8", /* Label alignment. */ | |
3274 | "16", /* Func alignment. */ | |
071e428c HW |
3275 | 4, /* Small unroll limit. */ |
3276 | 2, /* Small unroll factor. */ | |
64766e8d JH |
3277 | }; |
3278 | ||
a239aff8 M |
3279 | /* lujiazui_cost should produce code tuned for ZHAOXIN lujiazui CPU. */ |
3280 | static stringop_algs lujiazui_memcpy[2] = { | |
3281 | {libcall, {{32, loop, false}, {8192, rep_prefix_4_byte, false}, | |
3282 | {-1, libcall, false}}}, | |
3283 | {libcall, {{12, unrolled_loop, true}, {32, loop, false}, | |
3284 | {6144, rep_prefix_8_byte, false}, | |
3285 | {-1, libcall, false}}}}; | |
3286 | static stringop_algs lujiazui_memset[2] = { | |
3287 | {libcall, {{32, loop, false}, {8192, rep_prefix_4_byte, false}, | |
3288 | {-1, libcall, false}}}, | |
3289 | {libcall, {{12, loop, true}, {32, loop, false}, | |
3290 | {640, rep_prefix_8_byte, false}, | |
3291 | {-1, libcall, false}}}}; | |
3292 | static const | |
3293 | struct processor_costs lujiazui_cost = { | |
3294 | { | |
3295 | /* Start of register allocator costs. integer->integer move cost is 2. */ | |
3296 | 6, /* cost for loading QImode using movzbl. */ | |
3297 | {6, 6, 6}, /* cost of loading integer registers | |
3298 | in QImode, HImode and SImode. | |
3299 | Relative to reg-reg move (2). */ | |
3300 | {6, 6, 6}, /* cost of storing integer registers. */ | |
3301 | 2, /* cost of reg,reg fld/fst. */ | |
3302 | {6, 6, 8}, /* cost of loading fp registers | |
3303 | in SFmode, DFmode and XFmode. */ | |
3304 | {6, 6, 8}, /* cost of storing fp registers | |
3305 | in SFmode, DFmode and XFmode. */ | |
3306 | 2, /* cost of moving MMX register. */ | |
3307 | {6, 6}, /* cost of loading MMX registers | |
3308 | in SImode and DImode. */ | |
3309 | {6, 6}, /* cost of storing MMX registers | |
3310 | in SImode and DImode. */ | |
3311 | 2, 3, 4, /* cost of moving XMM,YMM,ZMM register. */ | |
3312 | {6, 6, 6, 10, 15}, /* cost of loading SSE registers | |
3313 | in 32,64,128,256 and 512-bit. */ | |
3314 | {6, 6, 6, 10, 15}, /* cost of storing SSE registers | |
3315 | in 32,64,128,256 and 512-bit. */ | |
3316 | 6, 6, /* SSE->integer and integer->SSE moves. */ | |
3317 | 6, 6, /* mask->integer and integer->mask moves. */ | |
3318 | {6, 6, 6}, /* cost of loading mask register | |
3319 | in QImode, HImode, SImode. */ | |
3320 | {6, 6, 6}, /* cost if storing mask register | |
3321 | in QImode, HImode, SImode. */ | |
3322 | 2, /* cost of moving mask register. */ | |
3323 | /* End of register allocator costs. */ | |
3324 | }, | |
3325 | ||
3326 | COSTS_N_INSNS (1), /* cost of an add instruction. */ | |
3327 | COSTS_N_INSNS (1) + 1, /* cost of a lea instruction. */ | |
3328 | COSTS_N_INSNS (1), /* variable shift costs. */ | |
3329 | COSTS_N_INSNS (1), /* constant shift costs. */ | |
3330 | {COSTS_N_INSNS (2), /* cost of starting multiply for QI. */ | |
3331 | COSTS_N_INSNS (3), /* HI. */ | |
3332 | COSTS_N_INSNS (3), /* SI. */ | |
3333 | COSTS_N_INSNS (12), /* DI. */ | |
3334 | COSTS_N_INSNS (14)}, /* other. */ | |
3335 | 0, /* cost of multiply per each bit set. */ | |
3336 | {COSTS_N_INSNS (22), /* cost of a divide/mod for QI. */ | |
3337 | COSTS_N_INSNS (24), /* HI. */ | |
3338 | COSTS_N_INSNS (24), /* SI. */ | |
3339 | COSTS_N_INSNS (150), /* DI. */ | |
3340 | COSTS_N_INSNS (152)}, /* other. */ | |
3341 | COSTS_N_INSNS (1), /* cost of movsx. */ | |
3342 | COSTS_N_INSNS (1), /* cost of movzx. */ | |
3343 | 8, /* "large" insn. */ | |
3344 | 17, /* MOVE_RATIO. */ | |
3345 | 6, /* CLEAR_RATIO. */ | |
3346 | {6, 6, 6}, /* cost of loading integer registers | |
3347 | in QImode, HImode and SImode. | |
3348 | Relative to reg-reg move (2). */ | |
3349 | {6, 6, 6}, /* cost of storing integer registers. */ | |
3350 | {6, 6, 6, 10, 15}, /* cost of loading SSE register | |
3351 | in 32bit, 64bit, 128bit, 256bit and 512bit. */ | |
3352 | {6, 6, 6, 10, 15}, /* cost of storing SSE register | |
3353 | in 32bit, 64bit, 128bit, 256bit and 512bit. */ | |
3354 | {6, 6, 6, 10, 15}, /* cost of unaligned loads. */ | |
3355 | {6, 6, 6, 10, 15}, /* cost of unaligned storess. */ | |
3356 | 2, 3, 4, /* cost of moving XMM,YMM,ZMM register. */ | |
3357 | 6, /* cost of moving SSE register to integer. */ | |
3358 | 18, 6, /* Gather load static, per_elt. */ | |
3359 | 18, 6, /* Gather store static, per_elt. */ | |
3360 | 32, /* size of l1 cache. */ | |
3361 | 4096, /* size of l2 cache. */ | |
3362 | 64, /* size of prefetch block. */ | |
3363 | /* Lujiazui processor never drop prefetches, like AMD processors. */ | |
3364 | 100, /* number of parallel prefetches. */ | |
3365 | 3, /* Branch cost. */ | |
3366 | COSTS_N_INSNS (3), /* cost of FADD and FSUB insns. */ | |
3367 | COSTS_N_INSNS (4), /* cost of FMUL instruction. */ | |
3368 | COSTS_N_INSNS (22), /* cost of FDIV instruction. */ | |
3369 | COSTS_N_INSNS (1), /* cost of FABS instruction. */ | |
3370 | COSTS_N_INSNS (1), /* cost of FCHS instruction. */ | |
3371 | COSTS_N_INSNS (44), /* cost of FSQRT instruction. */ | |
3372 | ||
3373 | COSTS_N_INSNS (1), /* cost of cheap SSE instruction. */ | |
3374 | COSTS_N_INSNS (3), /* cost of ADDSS/SD SUBSS/SD insns. */ | |
3375 | COSTS_N_INSNS (3), /* cost of MULSS instruction. */ | |
3376 | COSTS_N_INSNS (4), /* cost of MULSD instruction. */ | |
3377 | COSTS_N_INSNS (6), /* cost of FMA SS instruction. */ | |
3378 | COSTS_N_INSNS (6), /* cost of FMA SD instruction. */ | |
3379 | COSTS_N_INSNS (13), /* cost of DIVSS instruction. */ | |
3380 | COSTS_N_INSNS (17), /* cost of DIVSD instruction. */ | |
3381 | COSTS_N_INSNS (32), /* cost of SQRTSS instruction. */ | |
3382 | COSTS_N_INSNS (60), /* cost of SQRTSD instruction. */ | |
3383 | 1, 4, 3, 3, /* reassoc int, fp, vec_int, vec_fp. */ | |
3384 | lujiazui_memcpy, | |
3385 | lujiazui_memset, | |
3386 | COSTS_N_INSNS (4), /* cond_taken_branch_cost. */ | |
3387 | COSTS_N_INSNS (2), /* cond_not_taken_branch_cost. */ | |
3388 | "16:11:8", /* Loop alignment. */ | |
3389 | "16:11:8", /* Jump alignment. */ | |
3390 | "0:0:8", /* Label alignment. */ | |
3391 | "16", /* Func alignment. */ | |
071e428c HW |
3392 | 4, /* Small unroll limit. */ |
3393 | 2, /* Small unroll factor. */ | |
a239aff8 M |
3394 | }; |
3395 | ||
94c0b26f M |
3396 | /* yongfeng_cost should produce code tuned for ZHAOXIN yongfeng CPU. */ |
3397 | static stringop_algs yongfeng_memcpy[2] = { | |
3398 | {libcall, {{6, unrolled_loop, true}, {256, unrolled_loop, false}, | |
3399 | {-1, libcall, false}}}, | |
3400 | {libcall, {{8, loop, false}, {512, unrolled_loop, false}, | |
3401 | {-1, libcall, false}}}}; | |
3402 | static stringop_algs yongfeng_memset[2] = { | |
3403 | {libcall, {{6, loop_1_byte, false}, {128, loop, false}, | |
3404 | {-1, libcall, false}}}, | |
3405 | {libcall, {{2, rep_prefix_4_byte, false}, {64, loop, false}, | |
3406 | {1024, vector_loop, false}, | |
3407 | {-1, libcall, false}}}}; | |
3408 | static const | |
3409 | struct processor_costs yongfeng_cost = { | |
3410 | { | |
3411 | /* Start of register allocator costs. integer->integer move cost is 2. */ | |
3412 | 8, /* cost for loading QImode using movzbl. */ | |
3413 | {8, 8, 8}, /* cost of loading integer registers | |
3414 | in QImode, HImode and SImode. | |
3415 | Relative to reg-reg move (2). */ | |
3416 | {8, 8, 8}, /* cost of storing integer registers. */ | |
3417 | 2, /* cost of reg,reg fld/fst. */ | |
3418 | {8, 8, 8}, /* cost of loading fp registers | |
3419 | in SFmode, DFmode and XFmode. */ | |
3420 | {8, 8, 8}, /* cost of storing fp registers | |
3421 | in SFmode, DFmode and XFmode. */ | |
3422 | 2, /* cost of moving MMX register. */ | |
3423 | {8, 8}, /* cost of loading MMX registers | |
3424 | in SImode and DImode. */ | |
3425 | {8, 8}, /* cost of storing MMX registers | |
3426 | in SImode and DImode. */ | |
3427 | 2, 3, 4, /* cost of moving XMM,YMM,ZMM register. */ | |
3428 | {8, 8, 8, 10, 15}, /* cost of loading SSE registers | |
3429 | in 32,64,128,256 and 512-bit. */ | |
3430 | {8, 8, 8, 10, 15}, /* cost of storing SSE registers | |
3431 | in 32,64,128,256 and 512-bit. */ | |
3432 | 8, 8, /* SSE->integer and integer->SSE moves. */ | |
3433 | 8, 8, /* mask->integer and integer->mask moves. */ | |
3434 | {8, 8, 8}, /* cost of loading mask register | |
3435 | in QImode, HImode, SImode. */ | |
3436 | {8, 8, 8}, /* cost if storing mask register | |
3437 | in QImode, HImode, SImode. */ | |
3438 | 2, /* cost of moving mask register. */ | |
3439 | /* End of register allocator costs. */ | |
3440 | }, | |
3441 | ||
3442 | COSTS_N_INSNS (1), /* cost of an add instruction. */ | |
3443 | COSTS_N_INSNS (1), /* cost of a lea instruction. */ | |
3444 | COSTS_N_INSNS (1), /* variable shift costs. */ | |
3445 | COSTS_N_INSNS (1), /* constant shift costs. */ | |
3446 | {COSTS_N_INSNS (2), /* cost of starting multiply for QI. */ | |
3447 | COSTS_N_INSNS (3), /* HI. */ | |
3448 | COSTS_N_INSNS (2), /* SI. */ | |
3449 | COSTS_N_INSNS (2), /* DI. */ | |
3450 | COSTS_N_INSNS (3)}, /* other. */ | |
3451 | 0, /* cost of multiply per each bit set. */ | |
3452 | {COSTS_N_INSNS (8), /* cost of a divide/mod for QI. */ | |
3453 | COSTS_N_INSNS (9), /* HI. */ | |
3454 | COSTS_N_INSNS (8), /* SI. */ | |
3455 | COSTS_N_INSNS (41), /* DI. */ | |
3456 | COSTS_N_INSNS (41)}, /* other. */ | |
3457 | COSTS_N_INSNS (1), /* cost of movsx. */ | |
3458 | COSTS_N_INSNS (1), /* cost of movzx. */ | |
3459 | 8, /* "large" insn. */ | |
3460 | 17, /* MOVE_RATIO. */ | |
3461 | 6, /* CLEAR_RATIO. */ | |
3462 | {8, 8, 8}, /* cost of loading integer registers | |
3463 | in QImode, HImode and SImode. | |
3464 | Relative to reg-reg move (2). */ | |
3465 | {8, 8, 8}, /* cost of storing integer registers. */ | |
3466 | {8, 8, 8, 12, 15}, /* cost of loading SSE register | |
3467 | in 32bit, 64bit, 128bit, 256bit and 512bit. */ | |
3468 | {8, 8, 8, 12, 15}, /* cost of storing SSE register | |
3469 | in 32bit, 64bit, 128bit, 256bit and 512bit. */ | |
3470 | {8, 8, 8, 12, 15}, /* cost of unaligned loads. */ | |
3471 | {8, 8, 8, 12, 15}, /* cost of unaligned storess. */ | |
3472 | 2, 3, 4, /* cost of moving XMM,YMM,ZMM register. */ | |
3473 | 8, /* cost of moving SSE register to integer. */ | |
3474 | 18, 6, /* Gather load static, per_elt. */ | |
3475 | 18, 6, /* Gather store static, per_elt. */ | |
3476 | 32, /* size of l1 cache. */ | |
3477 | 256, /* size of l2 cache. */ | |
3478 | 64, /* size of prefetch block. */ | |
3479 | 12, /* number of parallel prefetches. */ | |
3480 | 3, /* Branch cost. */ | |
3481 | COSTS_N_INSNS (3), /* cost of FADD and FSUB insns. */ | |
3482 | COSTS_N_INSNS (3), /* cost of FMUL instruction. */ | |
3483 | COSTS_N_INSNS (14), /* cost of FDIV instruction. */ | |
3484 | COSTS_N_INSNS (1), /* cost of FABS instruction. */ | |
3485 | COSTS_N_INSNS (1), /* cost of FCHS instruction. */ | |
3486 | COSTS_N_INSNS (40), /* cost of FSQRT instruction. */ | |
3487 | ||
3488 | COSTS_N_INSNS (1), /* cost of cheap SSE instruction. */ | |
3489 | COSTS_N_INSNS (3), /* cost of ADDSS/SD SUBSS/SD insns. */ | |
3490 | COSTS_N_INSNS (3), /* cost of MULSS instruction. */ | |
3491 | COSTS_N_INSNS (3), /* cost of MULSD instruction. */ | |
3492 | COSTS_N_INSNS (5), /* cost of FMA SS instruction. */ | |
3493 | COSTS_N_INSNS (5), /* cost of FMA SD instruction. */ | |
3494 | COSTS_N_INSNS (10), /* cost of DIVSS instruction. */ | |
3495 | COSTS_N_INSNS (14), /* cost of DIVSD instruction. */ | |
3496 | COSTS_N_INSNS (20), /* cost of SQRTSS instruction. */ | |
3497 | COSTS_N_INSNS (35), /* cost of SQRTSD instruction. */ | |
3498 | 4, 4, 4, 4, /* reassoc int, fp, vec_int, vec_fp. */ | |
3499 | yongfeng_memcpy, | |
3500 | yongfeng_memset, | |
3501 | COSTS_N_INSNS (3), /* cond_taken_branch_cost. */ | |
3502 | COSTS_N_INSNS (1), /* cond_not_taken_branch_cost. */ | |
3503 | "16:11:8", /* Loop alignment. */ | |
3504 | "16:11:8", /* Jump alignment. */ | |
3505 | "0:0:8", /* Label alignment. */ | |
3506 | "16", /* Func alignment. */ | |
3507 | 4, /* Small unroll limit. */ | |
3508 | 2, /* Small unroll factor. */ | |
3509 | }; | |
3510 | ||
3511 | ||
64766e8d JH |
3512 | /* Generic should produce code tuned for Core-i7 (and newer chips) |
3513 | and btver1 (and newer chips). */ | |
3514 | ||
3515 | static stringop_algs generic_memcpy[2] = { | |
3516 | {libcall, {{32, loop, false}, {8192, rep_prefix_4_byte, false}, | |
3517 | {-1, libcall, false}}}, | |
3518 | {libcall, {{32, loop, false}, {8192, rep_prefix_8_byte, false}, | |
3519 | {-1, libcall, false}}}}; | |
3520 | static stringop_algs generic_memset[2] = { | |
3521 | {libcall, {{32, loop, false}, {8192, rep_prefix_4_byte, false}, | |
3522 | {-1, libcall, false}}}, | |
3523 | {libcall, {{32, loop, false}, {8192, rep_prefix_8_byte, false}, | |
3524 | {-1, libcall, false}}}}; | |
3525 | static const | |
3526 | struct processor_costs generic_cost = { | |
72bb85f8 | 3527 | { |
d321551c L |
3528 | /* Start of register allocator costs. integer->integer move cost is 2. */ |
3529 | 6, /* cost for loading QImode using movzbl */ | |
3530 | {6, 6, 6}, /* cost of loading integer registers | |
3531 | in QImode, HImode and SImode. | |
3532 | Relative to reg-reg move (2). */ | |
3533 | {6, 6, 6}, /* cost of storing integer registers */ | |
3534 | 4, /* cost of reg,reg fld/fst */ | |
3535 | {6, 6, 12}, /* cost of loading fp registers | |
3536 | in SFmode, DFmode and XFmode */ | |
3537 | {6, 6, 12}, /* cost of storing fp registers | |
3538 | in SFmode, DFmode and XFmode */ | |
3539 | 2, /* cost of moving MMX register */ | |
3540 | {6, 6}, /* cost of loading MMX registers | |
3541 | in SImode and DImode */ | |
3542 | {6, 6}, /* cost of storing MMX registers | |
3543 | in SImode and DImode */ | |
3544 | 2, 3, 4, /* cost of moving XMM,YMM,ZMM register */ | |
3545 | {6, 6, 6, 10, 15}, /* cost of loading SSE registers | |
3546 | in 32,64,128,256 and 512-bit */ | |
3547 | {6, 6, 6, 10, 15}, /* cost of storing SSE registers | |
3548 | in 32,64,128,256 and 512-bit */ | |
ecc3135a | 3549 | 6, 6, /* SSE->integer and integer->SSE moves */ |
3550 | 6, 6, /* mask->integer and integer->mask moves */ | |
00cb3494 L |
3551 | {6, 6, 6}, /* cost of loading mask register |
3552 | in QImode, HImode, SImode. */ | |
3553 | {6, 6, 6}, /* cost if storing mask register | |
3554 | in QImode, HImode, SImode. */ | |
3555 | 2, /* cost of moving mask register. */ | |
d321551c | 3556 | /* End of register allocator costs. */ |
72bb85f8 | 3557 | }, |
d321551c | 3558 | |
64766e8d | 3559 | COSTS_N_INSNS (1), /* cost of an add instruction */ |
ef9eec0b | 3560 | /* Setting cost to 2 makes our current implementation of synth_mult result in |
64766e8d JH |
3561 | use of unnecessary temporary registers causing regression on several |
3562 | SPECfp benchmarks. */ | |
3563 | COSTS_N_INSNS (1) + 1, /* cost of a lea instruction */ | |
3564 | COSTS_N_INSNS (1), /* variable shift costs */ | |
3565 | COSTS_N_INSNS (1), /* constant shift costs */ | |
3566 | {COSTS_N_INSNS (3), /* cost of starting multiply for QI */ | |
3567 | COSTS_N_INSNS (4), /* HI */ | |
3568 | COSTS_N_INSNS (3), /* SI */ | |
3569 | COSTS_N_INSNS (4), /* DI */ | |
7c080ade | 3570 | COSTS_N_INSNS (4)}, /* other */ |
64766e8d | 3571 | 0, /* cost of multiply per each bit set */ |
7c080ade JH |
3572 | {COSTS_N_INSNS (16), /* cost of a divide/mod for QI */ |
3573 | COSTS_N_INSNS (22), /* HI */ | |
3574 | COSTS_N_INSNS (30), /* SI */ | |
64766e8d JH |
3575 | COSTS_N_INSNS (74), /* DI */ |
3576 | COSTS_N_INSNS (74)}, /* other */ | |
3577 | COSTS_N_INSNS (1), /* cost of movsx */ | |
3578 | COSTS_N_INSNS (1), /* cost of movzx */ | |
3579 | 8, /* "large" insn */ | |
3580 | 17, /* MOVE_RATIO */ | |
25e22b19 | 3581 | 6, /* CLEAR_RATIO */ |
d555138e | 3582 | {6, 6, 6}, /* cost of loading integer registers |
64766e8d JH |
3583 | in QImode, HImode and SImode. |
3584 | Relative to reg-reg move (2). */ | |
af863030 | 3585 | {6, 6, 6}, /* cost of storing integer registers */ |
d321551c L |
3586 | {6, 6, 6, 10, 15}, /* cost of loading SSE register |
3587 | in 32bit, 64bit, 128bit, 256bit and 512bit */ | |
3588 | {6, 6, 6, 10, 15}, /* cost of storing SSE register | |
3589 | in 32bit, 64bit, 128bit, 256bit and 512bit */ | |
7c080ade | 3590 | {6, 6, 6, 10, 15}, /* cost of unaligned loads. */ |
7c080ade | 3591 | {6, 6, 6, 10, 15}, /* cost of unaligned storess. */ |
d321551c L |
3592 | 2, 3, 4, /* cost of moving XMM,YMM,ZMM register */ |
3593 | 6, /* cost of moving SSE register to integer. */ | |
7c080ade JH |
3594 | 18, 6, /* Gather load static, per_elt. */ |
3595 | 18, 6, /* Gather store static, per_elt. */ | |
64766e8d JH |
3596 | 32, /* size of l1 cache. */ |
3597 | 512, /* size of l2 cache. */ | |
3598 | 64, /* size of prefetch block */ | |
3599 | 6, /* number of parallel prefetches */ | |
3600 | /* Benchmarks shows large regressions on K8 sixtrack benchmark when this | |
3601 | value is increased to perhaps more appropriate value of 5. */ | |
3602 | 3, /* Branch cost */ | |
ef9eec0b | 3603 | COSTS_N_INSNS (3), /* cost of FADD and FSUB insns. */ |
7c080ade | 3604 | COSTS_N_INSNS (5), /* cost of FMUL instruction. */ |
e8e3054e | 3605 | COSTS_N_INSNS (17), /* cost of FDIV instruction. */ |
ef9eec0b JH |
3606 | COSTS_N_INSNS (1), /* cost of FABS instruction. */ |
3607 | COSTS_N_INSNS (1), /* cost of FCHS instruction. */ | |
e8e3054e | 3608 | COSTS_N_INSNS (14), /* cost of FSQRT instruction. */ |
6065f444 | 3609 | |
ef9eec0b JH |
3610 | COSTS_N_INSNS (1), /* cost of cheap SSE instruction. */ |
3611 | COSTS_N_INSNS (3), /* cost of ADDSS/SD SUBSS/SD insns. */ | |
3612 | COSTS_N_INSNS (4), /* cost of MULSS instruction. */ | |
3613 | COSTS_N_INSNS (5), /* cost of MULSD instruction. */ | |
3614 | COSTS_N_INSNS (5), /* cost of FMA SS instruction. */ | |
3615 | COSTS_N_INSNS (5), /* cost of FMA SD instruction. */ | |
e8e3054e JH |
3616 | COSTS_N_INSNS (13), /* cost of DIVSS instruction. */ |
3617 | COSTS_N_INSNS (17), /* cost of DIVSD instruction. */ | |
3618 | COSTS_N_INSNS (14), /* cost of SQRTSS instruction. */ | |
3619 | COSTS_N_INSNS (18), /* cost of SQRTSD instruction. */ | |
7c080ade | 3620 | 1, 4, 3, 3, /* reassoc int, fp, vec_int, vec_fp. */ |
64766e8d JH |
3621 | generic_memcpy, |
3622 | generic_memset, | |
e8e3054e JH |
3623 | COSTS_N_INSNS (4), /* cond_taken_branch_cost. */ |
3624 | COSTS_N_INSNS (2), /* cond_not_taken_branch_cost. */ | |
7dc58b50 ML |
3625 | "16:11:8", /* Loop alignment. */ |
3626 | "16:11:8", /* Jump alignment. */ | |
3627 | "0:0:8", /* Label alignment. */ | |
3628 | "16", /* Func alignment. */ | |
071e428c HW |
3629 | 4, /* Small unroll limit. */ |
3630 | 2, /* Small unroll factor. */ | |
64766e8d JH |
3631 | }; |
3632 | ||
3633 | /* core_cost should produce code tuned for Core familly of CPUs. */ | |
3634 | static stringop_algs core_memcpy[2] = { | |
3635 | {libcall, {{1024, rep_prefix_4_byte, true}, {-1, libcall, false}}}, | |
3636 | {libcall, {{24, loop, true}, {128, rep_prefix_8_byte, true}, | |
3637 | {-1, libcall, false}}}}; | |
3638 | static stringop_algs core_memset[2] = { | |
3639 | {libcall, {{6, loop_1_byte, true}, | |
3640 | {24, loop, true}, | |
3641 | {8192, rep_prefix_4_byte, true}, | |
3642 | {-1, libcall, false}}}, | |
3643 | {libcall, {{24, loop, true}, {512, rep_prefix_8_byte, true}, | |
3644 | {-1, libcall, false}}}}; | |
3645 | ||
3646 | static const | |
3647 | struct processor_costs core_cost = { | |
72bb85f8 | 3648 | { |
d321551c L |
3649 | /* Start of register allocator costs. integer->integer move cost is 2. */ |
3650 | 6, /* cost for loading QImode using movzbl */ | |
3651 | {4, 4, 4}, /* cost of loading integer registers | |
3652 | in QImode, HImode and SImode. | |
3653 | Relative to reg-reg move (2). */ | |
3654 | {6, 6, 6}, /* cost of storing integer registers */ | |
3655 | 2, /* cost of reg,reg fld/fst */ | |
3656 | {6, 6, 8}, /* cost of loading fp registers | |
3657 | in SFmode, DFmode and XFmode */ | |
3658 | {6, 6, 10}, /* cost of storing fp registers | |
3659 | in SFmode, DFmode and XFmode */ | |
3660 | 2, /* cost of moving MMX register */ | |
3661 | {6, 6}, /* cost of loading MMX registers | |
3662 | in SImode and DImode */ | |
3663 | {6, 6}, /* cost of storing MMX registers | |
3664 | in SImode and DImode */ | |
3665 | 2, 2, 4, /* cost of moving XMM,YMM,ZMM register */ | |
3666 | {6, 6, 6, 6, 12}, /* cost of loading SSE registers | |
3667 | in 32,64,128,256 and 512-bit */ | |
3668 | {6, 6, 6, 6, 12}, /* cost of storing SSE registers | |
3669 | in 32,64,128,256 and 512-bit */ | |
ecc3135a | 3670 | 6, 6, /* SSE->integer and integer->SSE moves */ |
3671 | 6, 6, /* mask->integer and integer->mask moves */ | |
00cb3494 L |
3672 | {4, 4, 4}, /* cost of loading mask register |
3673 | in QImode, HImode, SImode. */ | |
3674 | {6, 6, 6}, /* cost if storing mask register | |
3675 | in QImode, HImode, SImode. */ | |
3676 | 2, /* cost of moving mask register. */ | |
d321551c | 3677 | /* End of register allocator costs. */ |
72bb85f8 | 3678 | }, |
d321551c | 3679 | |
64766e8d JH |
3680 | COSTS_N_INSNS (1), /* cost of an add instruction */ |
3681 | /* On all chips taken into consideration lea is 2 cycles and more. With | |
3682 | this cost however our current implementation of synth_mult results in | |
3683 | use of unnecessary temporary registers causing regression on several | |
3684 | SPECfp benchmarks. */ | |
3685 | COSTS_N_INSNS (1) + 1, /* cost of a lea instruction */ | |
3686 | COSTS_N_INSNS (1), /* variable shift costs */ | |
3687 | COSTS_N_INSNS (1), /* constant shift costs */ | |
3688 | {COSTS_N_INSNS (3), /* cost of starting multiply for QI */ | |
3689 | COSTS_N_INSNS (4), /* HI */ | |
3690 | COSTS_N_INSNS (3), /* SI */ | |
a2ef9558 MT |
3691 | /* Here we tune for Sandybridge or newer. */ |
3692 | COSTS_N_INSNS (3), /* DI */ | |
3693 | COSTS_N_INSNS (3)}, /* other */ | |
64766e8d | 3694 | 0, /* cost of multiply per each bit set */ |
02308bd3 MT |
3695 | /* Expanding div/mod currently doesn't consider parallelism. So the cost |
3696 | model is not realistic. We compensate by increasing the latencies a bit. */ | |
3697 | {COSTS_N_INSNS (11), /* cost of a divide/mod for QI */ | |
3698 | COSTS_N_INSNS (11), /* HI */ | |
3699 | COSTS_N_INSNS (14), /* SI */ | |
ffa3ce53 JH |
3700 | COSTS_N_INSNS (81), /* DI */ |
3701 | COSTS_N_INSNS (81)}, /* other */ | |
64766e8d JH |
3702 | COSTS_N_INSNS (1), /* cost of movsx */ |
3703 | COSTS_N_INSNS (1), /* cost of movzx */ | |
3704 | 8, /* "large" insn */ | |
3705 | 17, /* MOVE_RATIO */ | |
25e22b19 | 3706 | 6, /* CLEAR_RATIO */ |
64766e8d JH |
3707 | {4, 4, 4}, /* cost of loading integer registers |
3708 | in QImode, HImode and SImode. | |
3709 | Relative to reg-reg move (2). */ | |
ffa3ce53 | 3710 | {6, 6, 6}, /* cost of storing integer registers */ |
d321551c L |
3711 | {6, 6, 6, 6, 12}, /* cost of loading SSE register |
3712 | in 32bit, 64bit, 128bit, 256bit and 512bit */ | |
3713 | {6, 6, 6, 6, 12}, /* cost of storing SSE register | |
3714 | in 32bit, 64bit, 128bit, 256bit and 512bit */ | |
df41dbaf | 3715 | {6, 6, 6, 6, 12}, /* cost of unaligned loads. */ |
df41dbaf | 3716 | {6, 6, 6, 6, 12}, /* cost of unaligned stores. */ |
d321551c L |
3717 | 2, 2, 4, /* cost of moving XMM,YMM,ZMM register */ |
3718 | 2, /* cost of moving SSE register to integer. */ | |
a4fe6139 JH |
3719 | /* VGATHERDPD is 7 uops, rec throughput 5, while VGATHERDPD is 9 uops, |
3720 | rec. throughput 6. | |
3721 | So 5 uops statically and one uops per load. */ | |
3722 | 10, 6, /* Gather load static, per_elt. */ | |
3723 | 10, 6, /* Gather store static, per_elt. */ | |
64766e8d JH |
3724 | 64, /* size of l1 cache. */ |
3725 | 512, /* size of l2 cache. */ | |
3726 | 64, /* size of prefetch block */ | |
3727 | 6, /* number of parallel prefetches */ | |
3728 | /* FIXME perhaps more appropriate value is 5. */ | |
3729 | 3, /* Branch cost */ | |
ef9eec0b JH |
3730 | COSTS_N_INSNS (3), /* cost of FADD and FSUB insns. */ |
3731 | COSTS_N_INSNS (5), /* cost of FMUL instruction. */ | |
ffa3ce53 | 3732 | /* 10-24 */ |
ef9eec0b JH |
3733 | COSTS_N_INSNS (24), /* cost of FDIV instruction. */ |
3734 | COSTS_N_INSNS (1), /* cost of FABS instruction. */ | |
3735 | COSTS_N_INSNS (1), /* cost of FCHS instruction. */ | |
ffa3ce53 | 3736 | COSTS_N_INSNS (23), /* cost of FSQRT instruction. */ |
6065f444 | 3737 | |
c53c148c | 3738 | COSTS_N_INSNS (1), /* cost of cheap SSE instruction. */ |
6065f444 JH |
3739 | COSTS_N_INSNS (3), /* cost of ADDSS/SD SUBSS/SD insns. */ |
3740 | COSTS_N_INSNS (4), /* cost of MULSS instruction. */ | |
3741 | COSTS_N_INSNS (5), /* cost of MULSD instruction. */ | |
c53c148c JH |
3742 | COSTS_N_INSNS (5), /* cost of FMA SS instruction. */ |
3743 | COSTS_N_INSNS (5), /* cost of FMA SD instruction. */ | |
6065f444 JH |
3744 | COSTS_N_INSNS (18), /* cost of DIVSS instruction. */ |
3745 | COSTS_N_INSNS (32), /* cost of DIVSD instruction. */ | |
3746 | COSTS_N_INSNS (30), /* cost of SQRTSS instruction. */ | |
3747 | COSTS_N_INSNS (58), /* cost of SQRTSD instruction. */ | |
64766e8d JH |
3748 | 1, 4, 2, 2, /* reassoc int, fp, vec_int, vec_fp. */ |
3749 | core_memcpy, | |
3750 | core_memset, | |
f6fd8f2b JH |
3751 | COSTS_N_INSNS (3), /* cond_taken_branch_cost. */ |
3752 | COSTS_N_INSNS (1), /* cond_not_taken_branch_cost. */ | |
7dc58b50 ML |
3753 | "16:11:8", /* Loop alignment. */ |
3754 | "16:11:8", /* Jump alignment. */ | |
3755 | "0:0:8", /* Label alignment. */ | |
3756 | "16", /* Func alignment. */ | |
071e428c HW |
3757 | 4, /* Small unroll limit. */ |
3758 | 2, /* Small unroll factor. */ | |
64766e8d JH |
3759 | }; |
3760 |