1 /* Copyright (C) 1988-2020 Free Software Foundation, Inc.
3 This file is part of GCC.
5 GCC is free software; you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by
7 the Free Software Foundation; either version 3, or (at your option)
10 GCC is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details.
15 You should have received a copy of the GNU General Public License
16 along with GCC; see the file COPYING3. If not see
17 <http://www.gnu.org/licenses/>. */
19 #define IN_TARGET_CODE 1
23 #include "coretypes.h"
33 #include "stringpool.h"
40 #include "diagnostic.h"
43 #include "fold-const.h"
46 #include "stor-layout.h"
49 #include "insn-attr.h"
55 #include "common/common-target.h"
56 #include "langhooks.h"
60 #include "tm-constrs.h"
62 #include "sched-int.h"
64 #include "tree-pass.h"
66 #include "pass_manager.h"
67 #include "target-globals.h"
68 #include "gimple-iterator.h"
69 #include "tree-vectorizer.h"
70 #include "shrink-wrap.h"
73 #include "tree-iterator.h"
75 #include "case-cfn-macros.h"
77 #include "fold-const-call.h"
79 #include "tree-ssanames.h"
81 #include "selftest-rtl.h"
82 #include "print-rtl.h"
85 #include "symbol-summary.h"
87 #include "ipa-fnsummary.h"
88 #include "wide-int-bitmask.h"
89 #include "tree-vector-builder.h"
91 #include "dwarf2out.h"
92 #include "i386-options.h"
94 #include "x86-tune-costs.h"
96 #ifndef SUBTARGET32_DEFAULT_CPU
97 #define SUBTARGET32_DEFAULT_CPU "i386"
100 /* Processor feature/optimization bitmasks. */
101 #define m_386 (HOST_WIDE_INT_1U<<PROCESSOR_I386)
102 #define m_486 (HOST_WIDE_INT_1U<<PROCESSOR_I486)
103 #define m_PENT (HOST_WIDE_INT_1U<<PROCESSOR_PENTIUM)
104 #define m_LAKEMONT (HOST_WIDE_INT_1U<<PROCESSOR_LAKEMONT)
105 #define m_PPRO (HOST_WIDE_INT_1U<<PROCESSOR_PENTIUMPRO)
106 #define m_PENT4 (HOST_WIDE_INT_1U<<PROCESSOR_PENTIUM4)
107 #define m_NOCONA (HOST_WIDE_INT_1U<<PROCESSOR_NOCONA)
108 #define m_P4_NOCONA (m_PENT4 | m_NOCONA)
109 #define m_CORE2 (HOST_WIDE_INT_1U<<PROCESSOR_CORE2)
110 #define m_NEHALEM (HOST_WIDE_INT_1U<<PROCESSOR_NEHALEM)
111 #define m_SANDYBRIDGE (HOST_WIDE_INT_1U<<PROCESSOR_SANDYBRIDGE)
112 #define m_HASWELL (HOST_WIDE_INT_1U<<PROCESSOR_HASWELL)
113 #define m_BONNELL (HOST_WIDE_INT_1U<<PROCESSOR_BONNELL)
114 #define m_SILVERMONT (HOST_WIDE_INT_1U<<PROCESSOR_SILVERMONT)
115 #define m_KNL (HOST_WIDE_INT_1U<<PROCESSOR_KNL)
116 #define m_KNM (HOST_WIDE_INT_1U<<PROCESSOR_KNM)
117 #define m_SKYLAKE (HOST_WIDE_INT_1U<<PROCESSOR_SKYLAKE)
118 #define m_SKYLAKE_AVX512 (HOST_WIDE_INT_1U<<PROCESSOR_SKYLAKE_AVX512)
119 #define m_CANNONLAKE (HOST_WIDE_INT_1U<<PROCESSOR_CANNONLAKE)
120 #define m_ICELAKE_CLIENT (HOST_WIDE_INT_1U<<PROCESSOR_ICELAKE_CLIENT)
121 #define m_ICELAKE_SERVER (HOST_WIDE_INT_1U<<PROCESSOR_ICELAKE_SERVER)
122 #define m_CASCADELAKE (HOST_WIDE_INT_1U<<PROCESSOR_CASCADELAKE)
123 #define m_TIGERLAKE (HOST_WIDE_INT_1U<<PROCESSOR_TIGERLAKE)
124 #define m_COOPERLAKE (HOST_WIDE_INT_1U<<PROCESSOR_COOPERLAKE)
125 #define m_SAPPHIRERAPIDS (HOST_WIDE_INT_1U<<PROCESSOR_SAPPHIRERAPIDS)
126 #define m_ALDERLAKE (HOST_WIDE_INT_1U<<PROCESSOR_ALDERLAKE)
127 #define m_CORE_AVX512 (m_SKYLAKE_AVX512 | m_CANNONLAKE \
128 | m_ICELAKE_CLIENT | m_ICELAKE_SERVER | m_CASCADELAKE \
129 | m_TIGERLAKE | m_COOPERLAKE | m_SAPPHIRERAPIDS)
130 #define m_CORE_AVX2 (m_HASWELL | m_SKYLAKE | m_CORE_AVX512)
131 #define m_CORE_ALL (m_CORE2 | m_NEHALEM | m_SANDYBRIDGE | m_CORE_AVX2)
132 #define m_GOLDMONT (HOST_WIDE_INT_1U<<PROCESSOR_GOLDMONT)
133 #define m_GOLDMONT_PLUS (HOST_WIDE_INT_1U<<PROCESSOR_GOLDMONT_PLUS)
134 #define m_TREMONT (HOST_WIDE_INT_1U<<PROCESSOR_TREMONT)
135 #define m_INTEL (HOST_WIDE_INT_1U<<PROCESSOR_INTEL)
137 #define m_GEODE (HOST_WIDE_INT_1U<<PROCESSOR_GEODE)
138 #define m_K6 (HOST_WIDE_INT_1U<<PROCESSOR_K6)
139 #define m_K6_GEODE (m_K6 | m_GEODE)
140 #define m_K8 (HOST_WIDE_INT_1U<<PROCESSOR_K8)
141 #define m_ATHLON (HOST_WIDE_INT_1U<<PROCESSOR_ATHLON)
142 #define m_ATHLON_K8 (m_K8 | m_ATHLON)
143 #define m_AMDFAM10 (HOST_WIDE_INT_1U<<PROCESSOR_AMDFAM10)
144 #define m_BDVER1 (HOST_WIDE_INT_1U<<PROCESSOR_BDVER1)
145 #define m_BDVER2 (HOST_WIDE_INT_1U<<PROCESSOR_BDVER2)
146 #define m_BDVER3 (HOST_WIDE_INT_1U<<PROCESSOR_BDVER3)
147 #define m_BDVER4 (HOST_WIDE_INT_1U<<PROCESSOR_BDVER4)
148 #define m_ZNVER1 (HOST_WIDE_INT_1U<<PROCESSOR_ZNVER1)
149 #define m_ZNVER2 (HOST_WIDE_INT_1U<<PROCESSOR_ZNVER2)
150 #define m_ZNVER3 (HOST_WIDE_INT_1U<<PROCESSOR_ZNVER3)
151 #define m_BTVER1 (HOST_WIDE_INT_1U<<PROCESSOR_BTVER1)
152 #define m_BTVER2 (HOST_WIDE_INT_1U<<PROCESSOR_BTVER2)
153 #define m_BDVER (m_BDVER1 | m_BDVER2 | m_BDVER3 | m_BDVER4)
154 #define m_BTVER (m_BTVER1 | m_BTVER2)
155 #define m_ZNVER (m_ZNVER1 | m_ZNVER2 | m_ZNVER3)
156 #define m_AMD_MULTIPLE (m_ATHLON_K8 | m_AMDFAM10 | m_BDVER | m_BTVER \
159 #define m_GENERIC (HOST_WIDE_INT_1U<<PROCESSOR_GENERIC)
161 const char* ix86_tune_feature_names
[X86_TUNE_LAST
] = {
163 #define DEF_TUNE(tune, name, selector) name,
164 #include "x86-tune.def"
168 /* Feature tests against the various tunings. */
169 unsigned char ix86_tune_features
[X86_TUNE_LAST
];
171 /* Feature tests against the various tunings used to create ix86_tune_features
172 based on the processor mask. */
173 static unsigned HOST_WIDE_INT initial_ix86_tune_features
[X86_TUNE_LAST
] = {
175 #define DEF_TUNE(tune, name, selector) selector,
176 #include "x86-tune.def"
180 /* Feature tests against the various architecture variations. */
181 unsigned char ix86_arch_features
[X86_ARCH_LAST
];
183 struct ix86_target_opts
185 const char *option
; /* option string */
186 HOST_WIDE_INT mask
; /* isa mask options */
189 /* This table is ordered so that options like -msse4.2 that imply other
190 ISAs come first. Target string will be displayed in the same order. */
191 static struct ix86_target_opts isa2_opts
[] =
193 { "-mcx16", OPTION_MASK_ISA2_CX16
},
194 { "-mvaes", OPTION_MASK_ISA2_VAES
},
195 { "-mrdpid", OPTION_MASK_ISA2_RDPID
},
196 { "-mpconfig", OPTION_MASK_ISA2_PCONFIG
},
197 { "-mwbnoinvd", OPTION_MASK_ISA2_WBNOINVD
},
198 { "-mavx512vp2intersect", OPTION_MASK_ISA2_AVX512VP2INTERSECT
},
199 { "-msgx", OPTION_MASK_ISA2_SGX
},
200 { "-mavx5124vnniw", OPTION_MASK_ISA2_AVX5124VNNIW
},
201 { "-mavx5124fmaps", OPTION_MASK_ISA2_AVX5124FMAPS
},
202 { "-mhle", OPTION_MASK_ISA2_HLE
},
203 { "-mmovbe", OPTION_MASK_ISA2_MOVBE
},
204 { "-mclzero", OPTION_MASK_ISA2_CLZERO
},
205 { "-mmwaitx", OPTION_MASK_ISA2_MWAITX
},
206 { "-mmovdir64b", OPTION_MASK_ISA2_MOVDIR64B
},
207 { "-mwaitpkg", OPTION_MASK_ISA2_WAITPKG
},
208 { "-mcldemote", OPTION_MASK_ISA2_CLDEMOTE
},
209 { "-mptwrite", OPTION_MASK_ISA2_PTWRITE
},
210 { "-mavx512bf16", OPTION_MASK_ISA2_AVX512BF16
},
211 { "-menqcmd", OPTION_MASK_ISA2_ENQCMD
},
212 { "-mserialize", OPTION_MASK_ISA2_SERIALIZE
},
213 { "-mtsxldtrk", OPTION_MASK_ISA2_TSXLDTRK
},
214 { "-mamx-tile", OPTION_MASK_ISA2_AMX_TILE
},
215 { "-mamx-int8", OPTION_MASK_ISA2_AMX_INT8
},
216 { "-mamx-bf16", OPTION_MASK_ISA2_AMX_BF16
},
217 { "-muintr", OPTION_MASK_ISA2_UINTR
},
218 { "-mhreset", OPTION_MASK_ISA2_HRESET
},
219 { "-mkl", OPTION_MASK_ISA2_KL
},
220 { "-mwidekl", OPTION_MASK_ISA2_WIDEKL
},
221 { "-mavxvnni", OPTION_MASK_ISA2_AVXVNNI
}
223 static struct ix86_target_opts isa_opts
[] =
225 { "-mavx512vpopcntdq", OPTION_MASK_ISA_AVX512VPOPCNTDQ
},
226 { "-mavx512bitalg", OPTION_MASK_ISA_AVX512BITALG
},
227 { "-mvpclmulqdq", OPTION_MASK_ISA_VPCLMULQDQ
},
228 { "-mgfni", OPTION_MASK_ISA_GFNI
},
229 { "-mavx512vnni", OPTION_MASK_ISA_AVX512VNNI
},
230 { "-mavx512vbmi2", OPTION_MASK_ISA_AVX512VBMI2
},
231 { "-mavx512vbmi", OPTION_MASK_ISA_AVX512VBMI
},
232 { "-mavx512ifma", OPTION_MASK_ISA_AVX512IFMA
},
233 { "-mavx512vl", OPTION_MASK_ISA_AVX512VL
},
234 { "-mavx512bw", OPTION_MASK_ISA_AVX512BW
},
235 { "-mavx512dq", OPTION_MASK_ISA_AVX512DQ
},
236 { "-mavx512er", OPTION_MASK_ISA_AVX512ER
},
237 { "-mavx512pf", OPTION_MASK_ISA_AVX512PF
},
238 { "-mavx512cd", OPTION_MASK_ISA_AVX512CD
},
239 { "-mavx512f", OPTION_MASK_ISA_AVX512F
},
240 { "-mavx2", OPTION_MASK_ISA_AVX2
},
241 { "-mfma", OPTION_MASK_ISA_FMA
},
242 { "-mxop", OPTION_MASK_ISA_XOP
},
243 { "-mfma4", OPTION_MASK_ISA_FMA4
},
244 { "-mf16c", OPTION_MASK_ISA_F16C
},
245 { "-mavx", OPTION_MASK_ISA_AVX
},
246 /*{ "-msse4" OPTION_MASK_ISA_SSE4 }, */
247 { "-msse4.2", OPTION_MASK_ISA_SSE4_2
},
248 { "-msse4.1", OPTION_MASK_ISA_SSE4_1
},
249 { "-msse4a", OPTION_MASK_ISA_SSE4A
},
250 { "-mssse3", OPTION_MASK_ISA_SSSE3
},
251 { "-msse3", OPTION_MASK_ISA_SSE3
},
252 { "-maes", OPTION_MASK_ISA_AES
},
253 { "-msha", OPTION_MASK_ISA_SHA
},
254 { "-mpclmul", OPTION_MASK_ISA_PCLMUL
},
255 { "-msse2", OPTION_MASK_ISA_SSE2
},
256 { "-msse", OPTION_MASK_ISA_SSE
},
257 { "-m3dnowa", OPTION_MASK_ISA_3DNOW_A
},
258 { "-m3dnow", OPTION_MASK_ISA_3DNOW
},
259 { "-mmmx", OPTION_MASK_ISA_MMX
},
260 { "-mrtm", OPTION_MASK_ISA_RTM
},
261 { "-mprfchw", OPTION_MASK_ISA_PRFCHW
},
262 { "-mrdseed", OPTION_MASK_ISA_RDSEED
},
263 { "-madx", OPTION_MASK_ISA_ADX
},
264 { "-mprefetchwt1", OPTION_MASK_ISA_PREFETCHWT1
},
265 { "-mclflushopt", OPTION_MASK_ISA_CLFLUSHOPT
},
266 { "-mxsaves", OPTION_MASK_ISA_XSAVES
},
267 { "-mxsavec", OPTION_MASK_ISA_XSAVEC
},
268 { "-mxsaveopt", OPTION_MASK_ISA_XSAVEOPT
},
269 { "-mxsave", OPTION_MASK_ISA_XSAVE
},
270 { "-mabm", OPTION_MASK_ISA_ABM
},
271 { "-mbmi", OPTION_MASK_ISA_BMI
},
272 { "-mbmi2", OPTION_MASK_ISA_BMI2
},
273 { "-mlzcnt", OPTION_MASK_ISA_LZCNT
},
274 { "-mtbm", OPTION_MASK_ISA_TBM
},
275 { "-mpopcnt", OPTION_MASK_ISA_POPCNT
},
276 { "-msahf", OPTION_MASK_ISA_SAHF
},
277 { "-mcrc32", OPTION_MASK_ISA_CRC32
},
278 { "-mfsgsbase", OPTION_MASK_ISA_FSGSBASE
},
279 { "-mrdrnd", OPTION_MASK_ISA_RDRND
},
280 { "-mpku", OPTION_MASK_ISA_PKU
},
281 { "-mlwp", OPTION_MASK_ISA_LWP
},
282 { "-mfxsr", OPTION_MASK_ISA_FXSR
},
283 { "-mclwb", OPTION_MASK_ISA_CLWB
},
284 { "-mshstk", OPTION_MASK_ISA_SHSTK
},
285 { "-mmovdiri", OPTION_MASK_ISA_MOVDIRI
}
288 /* Return 1 if TRAIT NAME is present in the OpenMP context's
289 device trait set, return 0 if not present in any OpenMP context in the
290 whole translation unit, or -1 if not present in the current OpenMP context
291 but might be present in another OpenMP context in the same TU. */
294 ix86_omp_device_kind_arch_isa (enum omp_device_kind_arch_isa trait
,
299 case omp_device_kind
:
300 return strcmp (name
, "cpu") == 0;
301 case omp_device_arch
:
302 if (strcmp (name
, "x86") == 0)
307 return strcmp (name
, "x32") == 0;
309 return strcmp (name
, "x86_64") == 0;
311 if (strcmp (name
, "ia32") == 0 || strcmp (name
, "i386") == 0)
313 if (strcmp (name
, "i486") == 0)
314 return ix86_arch
!= PROCESSOR_I386
? 1 : -1;
315 if (strcmp (name
, "i586") == 0)
316 return (ix86_arch
!= PROCESSOR_I386
317 && ix86_arch
!= PROCESSOR_I486
) ? 1 : -1;
318 if (strcmp (name
, "i686") == 0)
319 return (ix86_arch
!= PROCESSOR_I386
320 && ix86_arch
!= PROCESSOR_I486
321 && ix86_arch
!= PROCESSOR_LAKEMONT
322 && ix86_arch
!= PROCESSOR_PENTIUM
) ? 1 : -1;
325 for (int i
= 0; i
< 2; i
++)
327 struct ix86_target_opts
*opts
= i
? isa2_opts
: isa_opts
;
328 size_t nopts
= i
? ARRAY_SIZE (isa2_opts
) : ARRAY_SIZE (isa_opts
);
329 HOST_WIDE_INT mask
= i
? ix86_isa_flags2
: ix86_isa_flags
;
330 for (size_t n
= 0; n
< nopts
; n
++)
332 /* Handle sse4 as an alias to sse4.2. */
333 if (opts
[n
].mask
== OPTION_MASK_ISA_SSE4_2
)
335 if (strcmp (name
, "sse4") == 0)
336 return (mask
& opts
[n
].mask
) != 0 ? 1 : -1;
338 if (strcmp (name
, opts
[n
].option
+ 2) == 0)
339 return (mask
& opts
[n
].mask
) != 0 ? 1 : -1;
348 /* Return a string that documents the current -m options. The caller is
349 responsible for freeing the string. */
352 ix86_target_string (HOST_WIDE_INT isa
, HOST_WIDE_INT isa2
,
353 int flags
, int flags2
,
354 const char *arch
, const char *tune
,
355 enum fpmath_unit fpmath
,
356 enum prefer_vector_width pvw
,
357 bool add_nl_p
, bool add_abi_p
)
360 static struct ix86_target_opts flag_opts
[] =
362 { "-m128bit-long-double", MASK_128BIT_LONG_DOUBLE
},
363 { "-mlong-double-128", MASK_LONG_DOUBLE_128
},
364 { "-mlong-double-64", MASK_LONG_DOUBLE_64
},
365 { "-m80387", MASK_80387
},
366 { "-maccumulate-outgoing-args", MASK_ACCUMULATE_OUTGOING_ARGS
},
367 { "-malign-double", MASK_ALIGN_DOUBLE
},
368 { "-mcld", MASK_CLD
},
369 { "-mfp-ret-in-387", MASK_FLOAT_RETURNS
},
370 { "-mieee-fp", MASK_IEEE_FP
},
371 { "-minline-all-stringops", MASK_INLINE_ALL_STRINGOPS
},
372 { "-minline-stringops-dynamically", MASK_INLINE_STRINGOPS_DYNAMICALLY
},
373 { "-mms-bitfields", MASK_MS_BITFIELD_LAYOUT
},
374 { "-mno-align-stringops", MASK_NO_ALIGN_STRINGOPS
},
375 { "-mno-fancy-math-387", MASK_NO_FANCY_MATH_387
},
376 { "-mno-push-args", MASK_NO_PUSH_ARGS
},
377 { "-mno-red-zone", MASK_NO_RED_ZONE
},
378 { "-momit-leaf-frame-pointer", MASK_OMIT_LEAF_FRAME_POINTER
},
379 { "-mrecip", MASK_RECIP
},
380 { "-mrtd", MASK_RTD
},
381 { "-msseregparm", MASK_SSEREGPARM
},
382 { "-mstack-arg-probe", MASK_STACK_PROBE
},
383 { "-mtls-direct-seg-refs", MASK_TLS_DIRECT_SEG_REFS
},
384 { "-mvect8-ret-in-mem", MASK_VECT8_RETURNS
},
385 { "-m8bit-idiv", MASK_USE_8BIT_IDIV
},
386 { "-mvzeroupper", MASK_VZEROUPPER
},
387 { "-mstv", MASK_STV
},
388 { "-mavx256-split-unaligned-load", MASK_AVX256_SPLIT_UNALIGNED_LOAD
},
389 { "-mavx256-split-unaligned-store", MASK_AVX256_SPLIT_UNALIGNED_STORE
},
390 { "-mcall-ms2sysv-xlogues", MASK_CALL_MS2SYSV_XLOGUES
}
393 /* Additional flag options. */
394 static struct ix86_target_opts flag2_opts
[] =
396 { "-mgeneral-regs-only", OPTION_MASK_GENERAL_REGS_ONLY
}
399 const char *opts
[ARRAY_SIZE (isa_opts
) + ARRAY_SIZE (isa2_opts
)
400 + ARRAY_SIZE (flag_opts
) + ARRAY_SIZE (flag2_opts
) + 6][2];
404 char flags_other
[40];
405 char flags2_other
[40];
415 memset (opts
, '\0', sizeof (opts
));
417 /* Add -march= option. */
420 opts
[num
][0] = "-march=";
421 opts
[num
++][1] = arch
;
424 /* Add -mtune= option. */
427 opts
[num
][0] = "-mtune=";
428 opts
[num
++][1] = tune
;
431 /* Add -m32/-m64/-mx32. */
434 if ((isa
& OPTION_MASK_ISA_64BIT
) != 0)
436 if ((isa
& OPTION_MASK_ABI_64
) != 0)
443 opts
[num
++][0] = abi
;
445 isa
&= ~(OPTION_MASK_ISA_64BIT
| OPTION_MASK_ABI_64
| OPTION_MASK_ABI_X32
);
447 /* Pick out the options in isa2 options. */
448 for (i
= 0; i
< ARRAY_SIZE (isa2_opts
); i
++)
450 if ((isa2
& isa2_opts
[i
].mask
) != 0)
452 opts
[num
++][0] = isa2_opts
[i
].option
;
453 isa2
&= ~ isa2_opts
[i
].mask
;
457 if (isa2
&& add_nl_p
)
459 opts
[num
++][0] = isa2_other
;
460 sprintf (isa2_other
, "(other isa2: %#" HOST_WIDE_INT_PRINT
"x)", isa2
);
463 /* Pick out the options in isa options. */
464 for (i
= 0; i
< ARRAY_SIZE (isa_opts
); i
++)
466 if ((isa
& isa_opts
[i
].mask
) != 0)
468 opts
[num
++][0] = isa_opts
[i
].option
;
469 isa
&= ~ isa_opts
[i
].mask
;
475 opts
[num
++][0] = isa_other
;
476 sprintf (isa_other
, "(other isa: %#" HOST_WIDE_INT_PRINT
"x)", isa
);
479 /* Add flag options. */
480 for (i
= 0; i
< ARRAY_SIZE (flag_opts
); i
++)
482 if ((flags
& flag_opts
[i
].mask
) != 0)
484 opts
[num
++][0] = flag_opts
[i
].option
;
485 flags
&= ~ flag_opts
[i
].mask
;
489 if (flags
&& add_nl_p
)
491 opts
[num
++][0] = flags_other
;
492 sprintf (flags_other
, "(other flags: %#x)", flags
);
495 /* Add additional flag options. */
496 for (i
= 0; i
< ARRAY_SIZE (flag2_opts
); i
++)
498 if ((flags2
& flag2_opts
[i
].mask
) != 0)
500 opts
[num
++][0] = flag2_opts
[i
].option
;
501 flags2
&= ~ flag2_opts
[i
].mask
;
505 if (flags2
&& add_nl_p
)
507 opts
[num
++][0] = flags2_other
;
508 sprintf (flags2_other
, "(other flags2: %#x)", flags2
);
511 /* Add -mfpmath= option. */
514 opts
[num
][0] = "-mfpmath=";
515 switch ((int) fpmath
)
518 opts
[num
++][1] = "387";
522 opts
[num
++][1] = "sse";
525 case FPMATH_387
| FPMATH_SSE
:
526 opts
[num
++][1] = "sse+387";
534 /* Add -mprefer-vector-width= option. */
537 opts
[num
][0] = "-mprefer-vector-width=";
541 opts
[num
++][1] = "128";
545 opts
[num
++][1] = "256";
549 opts
[num
++][1] = "512";
561 gcc_assert (num
< ARRAY_SIZE (opts
));
563 /* Size the string. */
565 sep_len
= (add_nl_p
) ? 3 : 1;
566 for (i
= 0; i
< num
; i
++)
569 for (j
= 0; j
< 2; j
++)
571 len
+= strlen (opts
[i
][j
]);
574 /* Build the string. */
575 ret
= ptr
= (char *) xmalloc (len
);
578 for (i
= 0; i
< num
; i
++)
582 for (j
= 0; j
< 2; j
++)
583 len2
[j
] = (opts
[i
][j
]) ? strlen (opts
[i
][j
]) : 0;
590 if (add_nl_p
&& line_len
+ len2
[0] + len2
[1] > 70)
598 for (j
= 0; j
< 2; j
++)
601 memcpy (ptr
, opts
[i
][j
], len2
[j
]);
608 gcc_assert (ret
+ len
>= ptr
);
613 /* Function that is callable from the debugger to print the current
615 void ATTRIBUTE_UNUSED
616 ix86_debug_options (void)
618 char *opts
= ix86_target_string (ix86_isa_flags
, ix86_isa_flags2
,
619 target_flags
, ix86_target_flags
,
620 ix86_arch_string
, ix86_tune_string
,
621 ix86_fpmath
, prefer_vector_width_type
,
626 fprintf (stderr
, "%s\n\n", opts
);
630 fputs ("<no options>\n\n", stderr
);
635 /* Save the current options */
638 ix86_function_specific_save (struct cl_target_option
*ptr
,
639 struct gcc_options
*opts
,
640 struct gcc_options */
* opts_set */
)
642 ptr
->arch
= ix86_arch
;
643 ptr
->schedule
= ix86_schedule
;
644 ptr
->prefetch_sse
= x86_prefetch_sse
;
645 ptr
->tune
= ix86_tune
;
646 ptr
->branch_cost
= ix86_branch_cost
;
647 ptr
->tune_defaulted
= ix86_tune_defaulted
;
648 ptr
->arch_specified
= ix86_arch_specified
;
649 ptr
->x_ix86_isa_flags_explicit
= opts
->x_ix86_isa_flags_explicit
;
650 ptr
->x_ix86_isa_flags2_explicit
= opts
->x_ix86_isa_flags2_explicit
;
651 ptr
->x_recip_mask_explicit
= opts
->x_recip_mask_explicit
;
652 ptr
->x_ix86_arch_string
= opts
->x_ix86_arch_string
;
653 ptr
->x_ix86_tune_string
= opts
->x_ix86_tune_string
;
654 ptr
->x_ix86_cmodel
= opts
->x_ix86_cmodel
;
655 ptr
->x_ix86_abi
= opts
->x_ix86_abi
;
656 ptr
->x_ix86_asm_dialect
= opts
->x_ix86_asm_dialect
;
657 ptr
->x_ix86_branch_cost
= opts
->x_ix86_branch_cost
;
658 ptr
->x_ix86_dump_tunes
= opts
->x_ix86_dump_tunes
;
659 ptr
->x_ix86_force_align_arg_pointer
= opts
->x_ix86_force_align_arg_pointer
;
660 ptr
->x_ix86_force_drap
= opts
->x_ix86_force_drap
;
661 ptr
->x_ix86_incoming_stack_boundary_arg
= opts
->x_ix86_incoming_stack_boundary_arg
;
662 ptr
->x_ix86_pmode
= opts
->x_ix86_pmode
;
663 ptr
->x_ix86_preferred_stack_boundary_arg
= opts
->x_ix86_preferred_stack_boundary_arg
;
664 ptr
->x_ix86_recip_name
= opts
->x_ix86_recip_name
;
665 ptr
->x_ix86_regparm
= opts
->x_ix86_regparm
;
666 ptr
->x_ix86_section_threshold
= opts
->x_ix86_section_threshold
;
667 ptr
->x_ix86_sse2avx
= opts
->x_ix86_sse2avx
;
668 ptr
->x_ix86_stack_protector_guard
= opts
->x_ix86_stack_protector_guard
;
669 ptr
->x_ix86_stringop_alg
= opts
->x_ix86_stringop_alg
;
670 ptr
->x_ix86_tls_dialect
= opts
->x_ix86_tls_dialect
;
671 ptr
->x_ix86_tune_ctrl_string
= opts
->x_ix86_tune_ctrl_string
;
672 ptr
->x_ix86_tune_memcpy_strategy
= opts
->x_ix86_tune_memcpy_strategy
;
673 ptr
->x_ix86_tune_memset_strategy
= opts
->x_ix86_tune_memset_strategy
;
674 ptr
->x_ix86_tune_no_default
= opts
->x_ix86_tune_no_default
;
675 ptr
->x_ix86_veclibabi_type
= opts
->x_ix86_veclibabi_type
;
677 /* The fields are char but the variables are not; make sure the
678 values fit in the fields. */
679 gcc_assert (ptr
->arch
== ix86_arch
);
680 gcc_assert (ptr
->schedule
== ix86_schedule
);
681 gcc_assert (ptr
->tune
== ix86_tune
);
682 gcc_assert (ptr
->branch_cost
== ix86_branch_cost
);
685 /* Feature tests against the various architecture variations, used to create
686 ix86_arch_features based on the processor mask. */
687 static unsigned HOST_WIDE_INT initial_ix86_arch_features
[X86_ARCH_LAST
] = {
688 /* X86_ARCH_CMOV: Conditional move was added for pentiumpro. */
689 ~(m_386
| m_486
| m_PENT
| m_LAKEMONT
| m_K6
),
691 /* X86_ARCH_CMPXCHG: Compare and exchange was added for 80486. */
694 /* X86_ARCH_CMPXCHG8B: Compare and exchange 8 bytes was added for pentium. */
697 /* X86_ARCH_XADD: Exchange and add was added for 80486. */
700 /* X86_ARCH_BSWAP: Byteswap was added for 80486. */
704 /* This table must be in sync with enum processor_type in i386.h. */
705 static const struct processor_costs
*processor_cost_table
[] =
753 /* Guarantee that the array is aligned with enum processor_type. */
754 STATIC_ASSERT (ARRAY_SIZE (processor_cost_table
) == PROCESSOR_max
);
757 ix86_option_override_internal (bool main_args_p
,
758 struct gcc_options
*opts
,
759 struct gcc_options
*opts_set
);
761 set_ix86_tune_features (struct gcc_options
*opts
,
762 enum processor_type ix86_tune
, bool dump
);
764 /* Restore the current options */
767 ix86_function_specific_restore (struct gcc_options
*opts
,
768 struct gcc_options */
* opts_set */
,
769 struct cl_target_option
*ptr
)
771 enum processor_type old_tune
= ix86_tune
;
772 enum processor_type old_arch
= ix86_arch
;
773 unsigned HOST_WIDE_INT ix86_arch_mask
;
776 /* We don't change -fPIC. */
777 opts
->x_flag_pic
= flag_pic
;
779 ix86_arch
= (enum processor_type
) ptr
->arch
;
780 ix86_schedule
= (enum attr_cpu
) ptr
->schedule
;
781 ix86_tune
= (enum processor_type
) ptr
->tune
;
782 x86_prefetch_sse
= ptr
->prefetch_sse
;
783 opts
->x_ix86_branch_cost
= ptr
->branch_cost
;
784 ix86_tune_defaulted
= ptr
->tune_defaulted
;
785 ix86_arch_specified
= ptr
->arch_specified
;
786 opts
->x_ix86_isa_flags_explicit
= ptr
->x_ix86_isa_flags_explicit
;
787 opts
->x_ix86_isa_flags2_explicit
= ptr
->x_ix86_isa_flags2_explicit
;
788 opts
->x_recip_mask_explicit
= ptr
->x_recip_mask_explicit
;
789 opts
->x_ix86_arch_string
= ptr
->x_ix86_arch_string
;
790 opts
->x_ix86_tune_string
= ptr
->x_ix86_tune_string
;
791 opts
->x_ix86_cmodel
= ptr
->x_ix86_cmodel
;
792 opts
->x_ix86_abi
= ptr
->x_ix86_abi
;
793 opts
->x_ix86_asm_dialect
= ptr
->x_ix86_asm_dialect
;
794 opts
->x_ix86_branch_cost
= ptr
->x_ix86_branch_cost
;
795 opts
->x_ix86_dump_tunes
= ptr
->x_ix86_dump_tunes
;
796 opts
->x_ix86_force_align_arg_pointer
= ptr
->x_ix86_force_align_arg_pointer
;
797 opts
->x_ix86_force_drap
= ptr
->x_ix86_force_drap
;
798 opts
->x_ix86_incoming_stack_boundary_arg
= ptr
->x_ix86_incoming_stack_boundary_arg
;
799 opts
->x_ix86_pmode
= ptr
->x_ix86_pmode
;
800 opts
->x_ix86_preferred_stack_boundary_arg
= ptr
->x_ix86_preferred_stack_boundary_arg
;
801 opts
->x_ix86_recip_name
= ptr
->x_ix86_recip_name
;
802 opts
->x_ix86_regparm
= ptr
->x_ix86_regparm
;
803 opts
->x_ix86_section_threshold
= ptr
->x_ix86_section_threshold
;
804 opts
->x_ix86_sse2avx
= ptr
->x_ix86_sse2avx
;
805 opts
->x_ix86_stack_protector_guard
= ptr
->x_ix86_stack_protector_guard
;
806 opts
->x_ix86_stringop_alg
= ptr
->x_ix86_stringop_alg
;
807 opts
->x_ix86_tls_dialect
= ptr
->x_ix86_tls_dialect
;
808 opts
->x_ix86_tune_ctrl_string
= ptr
->x_ix86_tune_ctrl_string
;
809 opts
->x_ix86_tune_memcpy_strategy
= ptr
->x_ix86_tune_memcpy_strategy
;
810 opts
->x_ix86_tune_memset_strategy
= ptr
->x_ix86_tune_memset_strategy
;
811 opts
->x_ix86_tune_no_default
= ptr
->x_ix86_tune_no_default
;
812 opts
->x_ix86_veclibabi_type
= ptr
->x_ix86_veclibabi_type
;
813 ix86_tune_cost
= processor_cost_table
[ix86_tune
];
814 /* TODO: ix86_cost should be chosen at instruction or function granuality
815 so for cold code we use size_cost even in !optimize_size compilation. */
816 if (opts
->x_optimize_size
)
817 ix86_cost
= &ix86_size_cost
;
819 ix86_cost
= ix86_tune_cost
;
821 /* Recreate the arch feature tests if the arch changed */
822 if (old_arch
!= ix86_arch
)
824 ix86_arch_mask
= HOST_WIDE_INT_1U
<< ix86_arch
;
825 for (i
= 0; i
< X86_ARCH_LAST
; ++i
)
826 ix86_arch_features
[i
]
827 = !!(initial_ix86_arch_features
[i
] & ix86_arch_mask
);
830 /* Recreate the tune optimization tests */
831 if (old_tune
!= ix86_tune
)
832 set_ix86_tune_features (opts
, ix86_tune
, false);
835 /* Adjust target options after streaming them in. This is mainly about
836 reconciling them with global options. */
839 ix86_function_specific_post_stream_in (struct cl_target_option
*ptr
)
841 /* flag_pic is a global option, but ix86_cmodel is target saved option
842 partly computed from flag_pic. If flag_pic is on, adjust x_ix86_cmodel
843 for PIC, or error out. */
845 switch (ptr
->x_ix86_cmodel
)
848 ptr
->x_ix86_cmodel
= CM_SMALL_PIC
;
852 ptr
->x_ix86_cmodel
= CM_MEDIUM_PIC
;
856 ptr
->x_ix86_cmodel
= CM_LARGE_PIC
;
860 error ("code model %s does not support PIC mode", "kernel");
867 switch (ptr
->x_ix86_cmodel
)
870 ptr
->x_ix86_cmodel
= CM_SMALL
;
874 ptr
->x_ix86_cmodel
= CM_MEDIUM
;
878 ptr
->x_ix86_cmodel
= CM_LARGE
;
886 /* Print the current options */
889 ix86_function_specific_print (FILE *file
, int indent
,
890 struct cl_target_option
*ptr
)
893 = ix86_target_string (ptr
->x_ix86_isa_flags
, ptr
->x_ix86_isa_flags2
,
894 ptr
->x_target_flags
, ptr
->x_ix86_target_flags
,
895 NULL
, NULL
, ptr
->x_ix86_fpmath
,
896 ptr
->x_prefer_vector_width_type
, false, true);
898 gcc_assert (ptr
->arch
< PROCESSOR_max
);
899 fprintf (file
, "%*sarch = %d (%s)\n",
901 ptr
->arch
, processor_names
[ptr
->arch
]);
903 gcc_assert (ptr
->tune
< PROCESSOR_max
);
904 fprintf (file
, "%*stune = %d (%s)\n",
906 ptr
->tune
, processor_names
[ptr
->tune
]);
908 fprintf (file
, "%*sbranch_cost = %d\n", indent
, "", ptr
->branch_cost
);
912 fprintf (file
, "%*s%s\n", indent
, "", target_string
);
913 free (target_string
);
918 /* Inner function to process the attribute((target(...))), take an argument and
919 set the current options from the argument. If we have a list, recursively go
923 ix86_valid_target_attribute_inner_p (tree fndecl
, tree args
, char *p_strings
[],
924 struct gcc_options
*opts
,
925 struct gcc_options
*opts_set
,
926 struct gcc_options
*enum_opts_set
,
927 bool target_clone_attr
)
932 #define IX86_ATTR_ISA(S,O) { S, sizeof (S)-1, ix86_opt_isa, O, 0 }
933 #define IX86_ATTR_STR(S,O) { S, sizeof (S)-1, ix86_opt_str, O, 0 }
934 #define IX86_ATTR_ENUM(S,O) { S, sizeof (S)-1, ix86_opt_enum, O, 0 }
935 #define IX86_ATTR_YES(S,O,M) { S, sizeof (S)-1, ix86_opt_yes, O, M }
936 #define IX86_ATTR_NO(S,O,M) { S, sizeof (S)-1, ix86_opt_no, O, M }
937 #define IX86_ATTR_IX86_YES(S,O,M) \
938 { S, sizeof (S)-1, ix86_opt_ix86_yes, O, M }
939 #define IX86_ATTR_IX86_NO(S,O,M) \
940 { S, sizeof (S)-1, ix86_opt_ix86_no, O, M }
958 enum ix86_opt_type type
;
963 IX86_ATTR_ISA ("pconfig", OPT_mpconfig
),
964 IX86_ATTR_ISA ("wbnoinvd", OPT_mwbnoinvd
),
965 IX86_ATTR_ISA ("sgx", OPT_msgx
),
966 IX86_ATTR_ISA ("avx5124fmaps", OPT_mavx5124fmaps
),
967 IX86_ATTR_ISA ("avx5124vnniw", OPT_mavx5124vnniw
),
968 IX86_ATTR_ISA ("avx512vpopcntdq", OPT_mavx512vpopcntdq
),
969 IX86_ATTR_ISA ("avx512vbmi2", OPT_mavx512vbmi2
),
970 IX86_ATTR_ISA ("avx512vnni", OPT_mavx512vnni
),
971 IX86_ATTR_ISA ("avx512bitalg", OPT_mavx512bitalg
),
972 IX86_ATTR_ISA ("avx512vp2intersect", OPT_mavx512vp2intersect
),
974 IX86_ATTR_ISA ("avx512vbmi", OPT_mavx512vbmi
),
975 IX86_ATTR_ISA ("avx512ifma", OPT_mavx512ifma
),
976 IX86_ATTR_ISA ("avx512vl", OPT_mavx512vl
),
977 IX86_ATTR_ISA ("avx512bw", OPT_mavx512bw
),
978 IX86_ATTR_ISA ("avx512dq", OPT_mavx512dq
),
979 IX86_ATTR_ISA ("avx512er", OPT_mavx512er
),
980 IX86_ATTR_ISA ("avx512pf", OPT_mavx512pf
),
981 IX86_ATTR_ISA ("avx512cd", OPT_mavx512cd
),
982 IX86_ATTR_ISA ("avx512f", OPT_mavx512f
),
983 IX86_ATTR_ISA ("avx2", OPT_mavx2
),
984 IX86_ATTR_ISA ("fma", OPT_mfma
),
985 IX86_ATTR_ISA ("xop", OPT_mxop
),
986 IX86_ATTR_ISA ("fma4", OPT_mfma4
),
987 IX86_ATTR_ISA ("f16c", OPT_mf16c
),
988 IX86_ATTR_ISA ("avx", OPT_mavx
),
989 IX86_ATTR_ISA ("sse4", OPT_msse4
),
990 IX86_ATTR_ISA ("sse4.2", OPT_msse4_2
),
991 IX86_ATTR_ISA ("sse4.1", OPT_msse4_1
),
992 IX86_ATTR_ISA ("sse4a", OPT_msse4a
),
993 IX86_ATTR_ISA ("ssse3", OPT_mssse3
),
994 IX86_ATTR_ISA ("sse3", OPT_msse3
),
995 IX86_ATTR_ISA ("aes", OPT_maes
),
996 IX86_ATTR_ISA ("sha", OPT_msha
),
997 IX86_ATTR_ISA ("pclmul", OPT_mpclmul
),
998 IX86_ATTR_ISA ("sse2", OPT_msse2
),
999 IX86_ATTR_ISA ("sse", OPT_msse
),
1000 IX86_ATTR_ISA ("3dnowa", OPT_m3dnowa
),
1001 IX86_ATTR_ISA ("3dnow", OPT_m3dnow
),
1002 IX86_ATTR_ISA ("mmx", OPT_mmmx
),
1003 IX86_ATTR_ISA ("rtm", OPT_mrtm
),
1004 IX86_ATTR_ISA ("prfchw", OPT_mprfchw
),
1005 IX86_ATTR_ISA ("rdseed", OPT_mrdseed
),
1006 IX86_ATTR_ISA ("adx", OPT_madx
),
1007 IX86_ATTR_ISA ("prefetchwt1", OPT_mprefetchwt1
),
1008 IX86_ATTR_ISA ("clflushopt", OPT_mclflushopt
),
1009 IX86_ATTR_ISA ("xsaves", OPT_mxsaves
),
1010 IX86_ATTR_ISA ("xsavec", OPT_mxsavec
),
1011 IX86_ATTR_ISA ("xsaveopt", OPT_mxsaveopt
),
1012 IX86_ATTR_ISA ("xsave", OPT_mxsave
),
1013 IX86_ATTR_ISA ("abm", OPT_mabm
),
1014 IX86_ATTR_ISA ("bmi", OPT_mbmi
),
1015 IX86_ATTR_ISA ("bmi2", OPT_mbmi2
),
1016 IX86_ATTR_ISA ("lzcnt", OPT_mlzcnt
),
1017 IX86_ATTR_ISA ("tbm", OPT_mtbm
),
1018 IX86_ATTR_ISA ("popcnt", OPT_mpopcnt
),
1019 IX86_ATTR_ISA ("cx16", OPT_mcx16
),
1020 IX86_ATTR_ISA ("sahf", OPT_msahf
),
1021 IX86_ATTR_ISA ("movbe", OPT_mmovbe
),
1022 IX86_ATTR_ISA ("crc32", OPT_mcrc32
),
1023 IX86_ATTR_ISA ("fsgsbase", OPT_mfsgsbase
),
1024 IX86_ATTR_ISA ("rdrnd", OPT_mrdrnd
),
1025 IX86_ATTR_ISA ("mwaitx", OPT_mmwaitx
),
1026 IX86_ATTR_ISA ("clzero", OPT_mclzero
),
1027 IX86_ATTR_ISA ("pku", OPT_mpku
),
1028 IX86_ATTR_ISA ("lwp", OPT_mlwp
),
1029 IX86_ATTR_ISA ("hle", OPT_mhle
),
1030 IX86_ATTR_ISA ("fxsr", OPT_mfxsr
),
1031 IX86_ATTR_ISA ("clwb", OPT_mclwb
),
1032 IX86_ATTR_ISA ("rdpid", OPT_mrdpid
),
1033 IX86_ATTR_ISA ("gfni", OPT_mgfni
),
1034 IX86_ATTR_ISA ("shstk", OPT_mshstk
),
1035 IX86_ATTR_ISA ("vaes", OPT_mvaes
),
1036 IX86_ATTR_ISA ("vpclmulqdq", OPT_mvpclmulqdq
),
1037 IX86_ATTR_ISA ("movdiri", OPT_mmovdiri
),
1038 IX86_ATTR_ISA ("movdir64b", OPT_mmovdir64b
),
1039 IX86_ATTR_ISA ("waitpkg", OPT_mwaitpkg
),
1040 IX86_ATTR_ISA ("cldemote", OPT_mcldemote
),
1041 IX86_ATTR_ISA ("uintr", OPT_muintr
),
1042 IX86_ATTR_ISA ("ptwrite", OPT_mptwrite
),
1043 IX86_ATTR_ISA ("kl", OPT_mkl
),
1044 IX86_ATTR_ISA ("widekl", OPT_mwidekl
),
1045 IX86_ATTR_ISA ("avx512bf16", OPT_mavx512bf16
),
1046 IX86_ATTR_ISA ("enqcmd", OPT_menqcmd
),
1047 IX86_ATTR_ISA ("serialize", OPT_mserialize
),
1048 IX86_ATTR_ISA ("tsxldtrk", OPT_mtsxldtrk
),
1049 IX86_ATTR_ISA ("amx-tile", OPT_mamx_tile
),
1050 IX86_ATTR_ISA ("amx-int8", OPT_mamx_int8
),
1051 IX86_ATTR_ISA ("amx-bf16", OPT_mamx_bf16
),
1052 IX86_ATTR_ISA ("hreset", OPT_mhreset
),
1053 IX86_ATTR_ISA ("avxvnni", OPT_mavxvnni
),
1056 IX86_ATTR_ENUM ("fpmath=", OPT_mfpmath_
),
1057 IX86_ATTR_ENUM ("prefer-vector-width=", OPT_mprefer_vector_width_
),
1059 /* string options */
1060 IX86_ATTR_STR ("arch=", IX86_FUNCTION_SPECIFIC_ARCH
),
1061 IX86_ATTR_STR ("tune=", IX86_FUNCTION_SPECIFIC_TUNE
),
1064 IX86_ATTR_YES ("cld",
1068 IX86_ATTR_NO ("fancy-math-387",
1069 OPT_mfancy_math_387
,
1070 MASK_NO_FANCY_MATH_387
),
1072 IX86_ATTR_YES ("ieee-fp",
1076 IX86_ATTR_YES ("inline-all-stringops",
1077 OPT_minline_all_stringops
,
1078 MASK_INLINE_ALL_STRINGOPS
),
1080 IX86_ATTR_YES ("inline-stringops-dynamically",
1081 OPT_minline_stringops_dynamically
,
1082 MASK_INLINE_STRINGOPS_DYNAMICALLY
),
1084 IX86_ATTR_NO ("align-stringops",
1085 OPT_mno_align_stringops
,
1086 MASK_NO_ALIGN_STRINGOPS
),
1088 IX86_ATTR_YES ("recip",
1092 IX86_ATTR_IX86_YES ("general-regs-only",
1093 OPT_mgeneral_regs_only
,
1094 OPTION_MASK_GENERAL_REGS_ONLY
),
1098 = fndecl
== NULL
? UNKNOWN_LOCATION
: DECL_SOURCE_LOCATION (fndecl
);
1099 const char *attr_name
= target_clone_attr
? "target_clone" : "target";
1101 /* If this is a list, recurse to get the options. */
1102 if (TREE_CODE (args
) == TREE_LIST
)
1106 for (; args
; args
= TREE_CHAIN (args
))
1107 if (TREE_VALUE (args
)
1108 && !ix86_valid_target_attribute_inner_p (fndecl
, TREE_VALUE (args
),
1109 p_strings
, opts
, opts_set
,
1117 else if (TREE_CODE (args
) != STRING_CST
)
1119 error_at (loc
, "attribute %qs argument is not a string", attr_name
);
1123 /* Handle multiple arguments separated by commas. */
1124 next_optstr
= ASTRDUP (TREE_STRING_POINTER (args
));
1126 while (next_optstr
&& *next_optstr
!= '\0')
1128 char *p
= next_optstr
;
1130 char *comma
= strchr (next_optstr
, ',');
1131 size_t len
, opt_len
;
1136 enum ix86_opt_type type
= ix86_opt_unknown
;
1142 len
= comma
- next_optstr
;
1143 next_optstr
= comma
+ 1;
1151 /* Recognize no-xxx. */
1152 if (len
> 3 && p
[0] == 'n' && p
[1] == 'o' && p
[2] == '-')
1161 /* Find the option. */
1164 for (i
= 0; i
< ARRAY_SIZE (attrs
); i
++)
1166 type
= attrs
[i
].type
;
1167 opt_len
= attrs
[i
].len
;
1168 if (ch
== attrs
[i
].string
[0]
1169 && ((type
!= ix86_opt_str
&& type
!= ix86_opt_enum
)
1172 && memcmp (p
, attrs
[i
].string
, opt_len
) == 0)
1175 mask
= attrs
[i
].mask
;
1180 /* Process the option. */
1183 error_at (loc
, "attribute %qs argument %qs is unknown",
1188 else if (type
== ix86_opt_isa
)
1190 struct cl_decoded_option decoded
;
1192 generate_option (opt
, NULL
, opt_set_p
, CL_TARGET
, &decoded
);
1193 ix86_handle_option (opts
, opts_set
,
1194 &decoded
, input_location
);
1197 else if (type
== ix86_opt_yes
|| type
== ix86_opt_no
)
1199 if (type
== ix86_opt_no
)
1200 opt_set_p
= !opt_set_p
;
1203 opts
->x_target_flags
|= mask
;
1205 opts
->x_target_flags
&= ~mask
;
1208 else if (type
== ix86_opt_ix86_yes
|| type
== ix86_opt_ix86_no
)
1210 if (mask
== OPTION_MASK_GENERAL_REGS_ONLY
)
1214 error_at (loc
, "pragma or attribute %<target(\"%s\")%> "
1215 "does not allow a negated form", p
);
1219 if (type
!= ix86_opt_ix86_yes
)
1222 opts
->x_ix86_target_flags
|= mask
;
1224 struct cl_decoded_option decoded
;
1225 generate_option (opt
, NULL
, opt_set_p
, CL_TARGET
,
1227 ix86_handle_option (opts
, opts_set
, &decoded
,
1232 if (type
== ix86_opt_ix86_no
)
1233 opt_set_p
= !opt_set_p
;
1236 opts
->x_ix86_target_flags
|= mask
;
1238 opts
->x_ix86_target_flags
&= ~mask
;
1242 else if (type
== ix86_opt_str
)
1246 error_at (loc
, "attribute value %qs was already specified "
1247 "in %qs attribute", orig_p
, attr_name
);
1252 p_strings
[opt
] = xstrdup (p
+ opt_len
);
1253 if (opt
== IX86_FUNCTION_SPECIFIC_ARCH
)
1255 /* If arch= is set, clear all bits in x_ix86_isa_flags,
1256 except for ISA_64BIT, ABI_64, ABI_X32, and CODE16
1257 and all bits in x_ix86_isa_flags2. */
1258 opts
->x_ix86_isa_flags
&= (OPTION_MASK_ISA_64BIT
1259 | OPTION_MASK_ABI_64
1260 | OPTION_MASK_ABI_X32
1261 | OPTION_MASK_CODE16
);
1262 opts
->x_ix86_isa_flags_explicit
&= (OPTION_MASK_ISA_64BIT
1263 | OPTION_MASK_ABI_64
1264 | OPTION_MASK_ABI_X32
1265 | OPTION_MASK_CODE16
);
1266 opts
->x_ix86_isa_flags2
= 0;
1267 opts
->x_ix86_isa_flags2_explicit
= 0;
1272 else if (type
== ix86_opt_enum
)
1277 arg_ok
= opt_enum_arg_to_value (opt
, p
+ opt_len
, &value
, CL_TARGET
);
1279 set_option (opts
, enum_opts_set
, opt
, value
,
1280 p
+ opt_len
, DK_UNSPECIFIED
, input_location
,
1284 error_at (loc
, "attribute value %qs is unknown in %qs attribute",
1297 /* Release allocated strings. */
1299 release_options_strings (char **option_strings
)
1301 /* Free up memory allocated to hold the strings */
1302 for (unsigned i
= 0; i
< IX86_FUNCTION_SPECIFIC_MAX
; i
++)
1303 free (option_strings
[i
]);
1306 /* Return a TARGET_OPTION_NODE tree of the target options listed or NULL. */
1309 ix86_valid_target_attribute_tree (tree fndecl
, tree args
,
1310 struct gcc_options
*opts
,
1311 struct gcc_options
*opts_set
,
1312 bool target_clone_attr
)
1314 const char *orig_arch_string
= opts
->x_ix86_arch_string
;
1315 const char *orig_tune_string
= opts
->x_ix86_tune_string
;
1316 enum fpmath_unit orig_fpmath_set
= opts_set
->x_ix86_fpmath
;
1317 enum prefer_vector_width orig_pvw_set
= opts_set
->x_prefer_vector_width_type
;
1318 int orig_tune_defaulted
= ix86_tune_defaulted
;
1319 int orig_arch_specified
= ix86_arch_specified
;
1320 char *option_strings
[IX86_FUNCTION_SPECIFIC_MAX
] = { NULL
, NULL
};
1322 struct cl_target_option
*def
1323 = TREE_TARGET_OPTION (target_option_default_node
);
1324 struct gcc_options enum_opts_set
;
1326 memset (&enum_opts_set
, 0, sizeof (enum_opts_set
));
1328 /* Process each of the options on the chain. */
1329 if (!ix86_valid_target_attribute_inner_p (fndecl
, args
, option_strings
, opts
,
1330 opts_set
, &enum_opts_set
,
1332 return error_mark_node
;
1334 /* If the changed options are different from the default, rerun
1335 ix86_option_override_internal, and then save the options away.
1336 The string options are attribute options, and will be undone
1337 when we copy the save structure. */
1338 if (opts
->x_ix86_isa_flags
!= def
->x_ix86_isa_flags
1339 || opts
->x_ix86_isa_flags2
!= def
->x_ix86_isa_flags2
1340 || opts
->x_target_flags
!= def
->x_target_flags
1341 || option_strings
[IX86_FUNCTION_SPECIFIC_ARCH
]
1342 || option_strings
[IX86_FUNCTION_SPECIFIC_TUNE
]
1343 || enum_opts_set
.x_ix86_fpmath
1344 || enum_opts_set
.x_prefer_vector_width_type
)
1346 /* If we are using the default tune= or arch=, undo the string assigned,
1347 and use the default. */
1348 if (option_strings
[IX86_FUNCTION_SPECIFIC_ARCH
])
1349 opts
->x_ix86_arch_string
1350 = ggc_strdup (option_strings
[IX86_FUNCTION_SPECIFIC_ARCH
]);
1351 else if (!orig_arch_specified
)
1352 opts
->x_ix86_arch_string
= NULL
;
1354 if (option_strings
[IX86_FUNCTION_SPECIFIC_TUNE
])
1355 opts
->x_ix86_tune_string
1356 = ggc_strdup (option_strings
[IX86_FUNCTION_SPECIFIC_TUNE
]);
1357 else if (orig_tune_defaulted
)
1358 opts
->x_ix86_tune_string
= NULL
;
1360 /* If fpmath= is not set, and we now have sse2 on 32-bit, use it. */
1361 if (enum_opts_set
.x_ix86_fpmath
)
1362 opts_set
->x_ix86_fpmath
= (enum fpmath_unit
) 1;
1363 if (enum_opts_set
.x_prefer_vector_width_type
)
1364 opts_set
->x_prefer_vector_width_type
= (enum prefer_vector_width
) 1;
1366 /* Do any overrides, such as arch=xxx, or tune=xxx support. */
1367 bool r
= ix86_option_override_internal (false, opts
, opts_set
);
1370 release_options_strings (option_strings
);
1371 return error_mark_node
;
1374 /* Add any builtin functions with the new isa if any. */
1375 ix86_add_new_builtins (opts
->x_ix86_isa_flags
, opts
->x_ix86_isa_flags2
);
1377 /* Save the current options unless we are validating options for
1379 t
= build_target_option_node (opts
, opts_set
);
1381 opts
->x_ix86_arch_string
= orig_arch_string
;
1382 opts
->x_ix86_tune_string
= orig_tune_string
;
1383 opts_set
->x_ix86_fpmath
= orig_fpmath_set
;
1384 opts_set
->x_prefer_vector_width_type
= orig_pvw_set
;
1386 release_options_strings (option_strings
);
1392 /* Hook to validate attribute((target("string"))). */
1395 ix86_valid_target_attribute_p (tree fndecl
,
1396 tree
ARG_UNUSED (name
),
1400 struct gcc_options func_options
, func_options_set
;
1401 tree new_target
, new_optimize
;
1404 /* attribute((target("default"))) does nothing, beyond
1405 affecting multi-versioning. */
1406 if (TREE_VALUE (args
)
1407 && TREE_CODE (TREE_VALUE (args
)) == STRING_CST
1408 && TREE_CHAIN (args
) == NULL_TREE
1409 && strcmp (TREE_STRING_POINTER (TREE_VALUE (args
)), "default") == 0)
1412 tree old_optimize
= build_optimization_node (&global_options
,
1413 &global_options_set
);
1415 /* Get the optimization options of the current function. */
1416 tree func_optimize
= DECL_FUNCTION_SPECIFIC_OPTIMIZATION (fndecl
);
1419 func_optimize
= old_optimize
;
1421 /* Init func_options. */
1422 memset (&func_options
, 0, sizeof (func_options
));
1423 init_options_struct (&func_options
, NULL
);
1424 lang_hooks
.init_options_struct (&func_options
);
1425 memset (&func_options_set
, 0, sizeof (func_options_set
));
1427 cl_optimization_restore (&func_options
, &func_options_set
,
1428 TREE_OPTIMIZATION (func_optimize
));
1430 /* Initialize func_options to the default before its target options can
1432 cl_target_option_restore (&func_options
, &func_options_set
,
1433 TREE_TARGET_OPTION (target_option_default_node
));
1435 /* FLAGS == 1 is used for target_clones attribute. */
1437 = ix86_valid_target_attribute_tree (fndecl
, args
, &func_options
,
1438 &func_options_set
, flags
== 1);
1440 new_optimize
= build_optimization_node (&func_options
, &func_options_set
);
1442 if (new_target
== error_mark_node
)
1445 else if (fndecl
&& new_target
)
1447 DECL_FUNCTION_SPECIFIC_TARGET (fndecl
) = new_target
;
1449 if (old_optimize
!= new_optimize
)
1450 DECL_FUNCTION_SPECIFIC_OPTIMIZATION (fndecl
) = new_optimize
;
1456 const char *stringop_alg_names
[] = {
1458 #define DEF_ALG(alg, name) #name,
1459 #include "stringop.def"
1464 /* Parse parameter string passed to -mmemcpy-strategy= or -mmemset-strategy=.
1465 The string is of the following form (or comma separated list of it):
1467 strategy_alg:max_size:[align|noalign]
1469 where the full size range for the strategy is either [0, max_size] or
1470 [min_size, max_size], in which min_size is the max_size + 1 of the
1471 preceding range. The last size range must have max_size == -1.
1476 -mmemcpy-strategy=libcall:-1:noalign
1478 this is equivalent to (for known size memcpy) -mstringop-strategy=libcall
1482 -mmemset-strategy=rep_8byte:16:noalign,vector_loop:2048:align,libcall:-1:noalign
1484 This is to tell the compiler to use the following strategy for memset
1485 1) when the expected size is between [1, 16], use rep_8byte strategy;
1486 2) when the size is between [17, 2048], use vector_loop;
1487 3) when the size is > 2048, use libcall. */
1489 struct stringop_size_range
1497 ix86_parse_stringop_strategy_string (char *strategy_str
, bool is_memset
)
1499 const struct stringop_algs
*default_algs
;
1500 stringop_size_range input_ranges
[MAX_STRINGOP_ALGS
];
1501 char *curr_range_str
, *next_range_str
;
1502 const char *opt
= is_memset
? "-mmemset_strategy=" : "-mmemcpy_strategy=";
1506 default_algs
= &ix86_cost
->memset
[TARGET_64BIT
!= 0];
1508 default_algs
= &ix86_cost
->memcpy
[TARGET_64BIT
!= 0];
1510 curr_range_str
= strategy_str
;
1517 next_range_str
= strchr (curr_range_str
, ',');
1519 *next_range_str
++ = '\0';
1521 if (sscanf (curr_range_str
, "%20[^:]:%d:%10s", alg_name
, &maxs
,
1524 error ("wrong argument %qs to option %qs", curr_range_str
, opt
);
1528 if (n
> 0 && (maxs
< (input_ranges
[n
- 1].max
+ 1) && maxs
!= -1))
1530 error ("size ranges of option %qs should be increasing", opt
);
1534 for (i
= 0; i
< last_alg
; i
++)
1535 if (!strcmp (alg_name
, stringop_alg_names
[i
]))
1540 error ("wrong strategy name %qs specified for option %qs",
1543 auto_vec
<const char *> candidates
;
1544 for (i
= 0; i
< last_alg
; i
++)
1545 if ((stringop_alg
) i
!= rep_prefix_8_byte
|| TARGET_64BIT
)
1546 candidates
.safe_push (stringop_alg_names
[i
]);
1550 = candidates_list_and_hint (alg_name
, s
, candidates
);
1552 inform (input_location
,
1553 "valid arguments to %qs are: %s; did you mean %qs?",
1556 inform (input_location
, "valid arguments to %qs are: %s",
1562 if ((stringop_alg
) i
== rep_prefix_8_byte
1565 /* rep; movq isn't available in 32-bit code. */
1566 error ("strategy name %qs specified for option %qs "
1567 "not supported for 32-bit code", alg_name
, opt
);
1571 input_ranges
[n
].max
= maxs
;
1572 input_ranges
[n
].alg
= (stringop_alg
) i
;
1573 if (!strcmp (align
, "align"))
1574 input_ranges
[n
].noalign
= false;
1575 else if (!strcmp (align
, "noalign"))
1576 input_ranges
[n
].noalign
= true;
1579 error ("unknown alignment %qs specified for option %qs", align
, opt
);
1583 curr_range_str
= next_range_str
;
1585 while (curr_range_str
);
1587 if (input_ranges
[n
- 1].max
!= -1)
1589 error ("the max value for the last size range should be -1"
1590 " for option %qs", opt
);
1594 if (n
> MAX_STRINGOP_ALGS
)
1596 error ("too many size ranges specified in option %qs", opt
);
1600 /* Now override the default algs array. */
1601 for (i
= 0; i
< n
; i
++)
1603 *const_cast<int *>(&default_algs
->size
[i
].max
) = input_ranges
[i
].max
;
1604 *const_cast<stringop_alg
*>(&default_algs
->size
[i
].alg
)
1605 = input_ranges
[i
].alg
;
1606 *const_cast<int *>(&default_algs
->size
[i
].noalign
)
1607 = input_ranges
[i
].noalign
;
1612 /* parse -mtune-ctrl= option. When DUMP is true,
1613 print the features that are explicitly set. */
1616 parse_mtune_ctrl_str (struct gcc_options
*opts
, bool dump
)
1618 if (!opts
->x_ix86_tune_ctrl_string
)
1621 char *next_feature_string
= NULL
;
1622 char *curr_feature_string
= xstrdup (opts
->x_ix86_tune_ctrl_string
);
1623 char *orig
= curr_feature_string
;
1629 next_feature_string
= strchr (curr_feature_string
, ',');
1630 if (next_feature_string
)
1631 *next_feature_string
++ = '\0';
1632 if (*curr_feature_string
== '^')
1634 curr_feature_string
++;
1637 for (i
= 0; i
< X86_TUNE_LAST
; i
++)
1639 if (!strcmp (curr_feature_string
, ix86_tune_feature_names
[i
]))
1641 ix86_tune_features
[i
] = !clear
;
1643 fprintf (stderr
, "Explicitly %s feature %s\n",
1644 clear
? "clear" : "set", ix86_tune_feature_names
[i
]);
1648 if (i
== X86_TUNE_LAST
)
1649 error ("unknown parameter to option %<-mtune-ctrl%>: %s",
1650 clear
? curr_feature_string
- 1 : curr_feature_string
);
1651 curr_feature_string
= next_feature_string
;
1653 while (curr_feature_string
);
1657 /* Helper function to set ix86_tune_features. IX86_TUNE is the
1661 set_ix86_tune_features (struct gcc_options
*opts
,
1662 enum processor_type ix86_tune
, bool dump
)
1664 unsigned HOST_WIDE_INT ix86_tune_mask
= HOST_WIDE_INT_1U
<< ix86_tune
;
1667 for (i
= 0; i
< X86_TUNE_LAST
; ++i
)
1669 if (ix86_tune_no_default
)
1670 ix86_tune_features
[i
] = 0;
1672 ix86_tune_features
[i
]
1673 = !!(initial_ix86_tune_features
[i
] & ix86_tune_mask
);
1678 fprintf (stderr
, "List of x86 specific tuning parameter names:\n");
1679 for (i
= 0; i
< X86_TUNE_LAST
; i
++)
1680 fprintf (stderr
, "%s : %s\n", ix86_tune_feature_names
[i
],
1681 ix86_tune_features
[i
] ? "on" : "off");
1684 parse_mtune_ctrl_str (opts
, dump
);
1688 /* Default align_* from the processor table. */
1691 ix86_default_align (struct gcc_options
*opts
)
1693 /* -falign-foo without argument: supply one. */
1694 if (opts
->x_flag_align_loops
&& !opts
->x_str_align_loops
)
1695 opts
->x_str_align_loops
= processor_cost_table
[ix86_tune
]->align_loop
;
1696 if (opts
->x_flag_align_jumps
&& !opts
->x_str_align_jumps
)
1697 opts
->x_str_align_jumps
= processor_cost_table
[ix86_tune
]->align_jump
;
1698 if (opts
->x_flag_align_labels
&& !opts
->x_str_align_labels
)
1699 opts
->x_str_align_labels
= processor_cost_table
[ix86_tune
]->align_label
;
1700 if (opts
->x_flag_align_functions
&& !opts
->x_str_align_functions
)
1701 opts
->x_str_align_functions
= processor_cost_table
[ix86_tune
]->align_func
;
1704 #ifndef USE_IX86_FRAME_POINTER
1705 #define USE_IX86_FRAME_POINTER 0
1708 /* (Re)compute option overrides affected by optimization levels in
1709 target-specific ways. */
1712 ix86_recompute_optlev_based_flags (struct gcc_options
*opts
,
1713 struct gcc_options
*opts_set
)
1715 /* Set the default values for switches whose default depends on TARGET_64BIT
1716 in case they weren't overwritten by command line options. */
1717 if (TARGET_64BIT_P (opts
->x_ix86_isa_flags
))
1719 if (opts
->x_optimize
>= 1)
1720 SET_OPTION_IF_UNSET (opts
, opts_set
, flag_omit_frame_pointer
,
1721 !USE_IX86_FRAME_POINTER
);
1722 if (opts
->x_flag_asynchronous_unwind_tables
1723 && TARGET_64BIT_MS_ABI
)
1724 SET_OPTION_IF_UNSET (opts
, opts_set
, flag_unwind_tables
, 1);
1725 if (opts
->x_flag_asynchronous_unwind_tables
== 2)
1726 opts
->x_flag_unwind_tables
1727 = opts
->x_flag_asynchronous_unwind_tables
= 1;
1728 if (opts
->x_flag_pcc_struct_return
== 2)
1729 opts
->x_flag_pcc_struct_return
= 0;
1733 if (opts
->x_optimize
>= 1)
1734 SET_OPTION_IF_UNSET (opts
, opts_set
, flag_omit_frame_pointer
,
1735 !(USE_IX86_FRAME_POINTER
|| opts
->x_optimize_size
));
1736 if (opts
->x_flag_asynchronous_unwind_tables
== 2)
1737 opts
->x_flag_asynchronous_unwind_tables
= !USE_IX86_FRAME_POINTER
;
1738 if (opts
->x_flag_pcc_struct_return
== 2)
1740 /* Intel MCU psABI specifies that -freg-struct-return should
1741 be on. Instead of setting DEFAULT_PCC_STRUCT_RETURN to 0,
1742 we check -miamcu so that -freg-struct-return is always
1743 turned on if -miamcu is used. */
1744 if (TARGET_IAMCU_P (opts
->x_target_flags
))
1745 opts
->x_flag_pcc_struct_return
= 0;
1747 opts
->x_flag_pcc_struct_return
= DEFAULT_PCC_STRUCT_RETURN
;
1752 /* Implement TARGET_OVERRIDE_OPTIONS_AFTER_CHANGE hook. */
1755 ix86_override_options_after_change (void)
1757 ix86_default_align (&global_options
);
1758 ix86_recompute_optlev_based_flags (&global_options
, &global_options_set
);
1761 /* Clear stack slot assignments remembered from previous functions.
1762 This is called from INIT_EXPANDERS once before RTL is emitted for each
1765 static struct machine_function
*
1766 ix86_init_machine_status (void)
1768 struct machine_function
*f
;
1770 f
= ggc_cleared_alloc
<machine_function
> ();
1771 f
->call_abi
= ix86_abi
;
1772 f
->stack_frame_required
= true;
1777 /* Override various settings based on options. If MAIN_ARGS_P, the
1778 options are from the command line, otherwise they are from
1779 attributes. Return true if there's an error related to march
1783 ix86_option_override_internal (bool main_args_p
,
1784 struct gcc_options
*opts
,
1785 struct gcc_options
*opts_set
)
1788 unsigned HOST_WIDE_INT ix86_arch_mask
;
1789 const bool ix86_tune_specified
= (opts
->x_ix86_tune_string
!= NULL
);
1791 /* -mrecip options. */
1794 const char *string
; /* option name */
1795 unsigned int mask
; /* mask bits to set */
1797 const recip_options
[] =
1799 { "all", RECIP_MASK_ALL
},
1800 { "none", RECIP_MASK_NONE
},
1801 { "div", RECIP_MASK_DIV
},
1802 { "sqrt", RECIP_MASK_SQRT
},
1803 { "vec-div", RECIP_MASK_VEC_DIV
},
1804 { "vec-sqrt", RECIP_MASK_VEC_SQRT
},
1808 /* Turn off both OPTION_MASK_ABI_64 and OPTION_MASK_ABI_X32 if
1809 TARGET_64BIT_DEFAULT is true and TARGET_64BIT is false. */
1810 if (TARGET_64BIT_DEFAULT
&& !TARGET_64BIT_P (opts
->x_ix86_isa_flags
))
1811 opts
->x_ix86_isa_flags
&= ~(OPTION_MASK_ABI_64
| OPTION_MASK_ABI_X32
);
1812 #ifdef TARGET_BI_ARCH
1815 #if TARGET_BI_ARCH == 1
1816 /* When TARGET_BI_ARCH == 1, by default, OPTION_MASK_ABI_64
1817 is on and OPTION_MASK_ABI_X32 is off. We turn off
1818 OPTION_MASK_ABI_64 if OPTION_MASK_ABI_X32 is turned on by
1820 if (TARGET_X32_P (opts
->x_ix86_isa_flags
))
1821 opts
->x_ix86_isa_flags
&= ~OPTION_MASK_ABI_64
;
1823 /* When TARGET_BI_ARCH == 2, by default, OPTION_MASK_ABI_X32 is
1824 on and OPTION_MASK_ABI_64 is off. We turn off
1825 OPTION_MASK_ABI_X32 if OPTION_MASK_ABI_64 is turned on by
1826 -m64 or OPTION_MASK_CODE16 is turned on by -m16. */
1827 if (TARGET_LP64_P (opts
->x_ix86_isa_flags
)
1828 || TARGET_16BIT_P (opts
->x_ix86_isa_flags
))
1829 opts
->x_ix86_isa_flags
&= ~OPTION_MASK_ABI_X32
;
1831 if (TARGET_64BIT_P (opts
->x_ix86_isa_flags
)
1832 && TARGET_IAMCU_P (opts
->x_target_flags
))
1833 sorry ("Intel MCU psABI isn%'t supported in %s mode",
1834 TARGET_X32_P (opts
->x_ix86_isa_flags
) ? "x32" : "64-bit");
1838 if (TARGET_X32_P (opts
->x_ix86_isa_flags
))
1840 /* Always turn on OPTION_MASK_ISA_64BIT and turn off
1841 OPTION_MASK_ABI_64 for TARGET_X32. */
1842 opts
->x_ix86_isa_flags
|= OPTION_MASK_ISA_64BIT
;
1843 opts
->x_ix86_isa_flags
&= ~OPTION_MASK_ABI_64
;
1845 else if (TARGET_16BIT_P (opts
->x_ix86_isa_flags
))
1846 opts
->x_ix86_isa_flags
&= ~(OPTION_MASK_ISA_64BIT
1847 | OPTION_MASK_ABI_X32
1848 | OPTION_MASK_ABI_64
);
1849 else if (TARGET_LP64_P (opts
->x_ix86_isa_flags
))
1851 /* Always turn on OPTION_MASK_ISA_64BIT and turn off
1852 OPTION_MASK_ABI_X32 for TARGET_LP64. */
1853 opts
->x_ix86_isa_flags
|= OPTION_MASK_ISA_64BIT
;
1854 opts
->x_ix86_isa_flags
&= ~OPTION_MASK_ABI_X32
;
1857 #ifdef SUBTARGET_OVERRIDE_OPTIONS
1858 SUBTARGET_OVERRIDE_OPTIONS
;
1861 #ifdef SUBSUBTARGET_OVERRIDE_OPTIONS
1862 SUBSUBTARGET_OVERRIDE_OPTIONS
;
1865 /* -fPIC is the default for x86_64. */
1866 if (TARGET_MACHO
&& TARGET_64BIT_P (opts
->x_ix86_isa_flags
))
1867 opts
->x_flag_pic
= 2;
1869 /* Need to check -mtune=generic first. */
1870 if (opts
->x_ix86_tune_string
)
1872 /* As special support for cross compilers we read -mtune=native
1873 as -mtune=generic. With native compilers we won't see the
1874 -mtune=native, as it was changed by the driver. */
1875 if (!strcmp (opts
->x_ix86_tune_string
, "native"))
1877 opts
->x_ix86_tune_string
= "generic";
1879 else if (!strcmp (opts
->x_ix86_tune_string
, "x86-64"))
1880 warning (OPT_Wdeprecated
,
1882 ? G_("%<-mtune=x86-64%> is deprecated; use %<-mtune=k8%> "
1883 "or %<-mtune=generic%> instead as appropriate")
1884 : G_("%<target(\"tune=x86-64\")%> is deprecated; use "
1885 "%<target(\"tune=k8\")%> or %<target(\"tune=generic\")%>"
1886 " instead as appropriate"));
1890 if (opts
->x_ix86_arch_string
)
1891 opts
->x_ix86_tune_string
= opts
->x_ix86_arch_string
;
1892 if (!opts
->x_ix86_tune_string
)
1894 opts
->x_ix86_tune_string
= processor_names
[TARGET_CPU_DEFAULT
];
1895 ix86_tune_defaulted
= 1;
1898 /* opts->x_ix86_tune_string is set to opts->x_ix86_arch_string
1899 or defaulted. We need to use a sensible tune option. */
1900 if (!strcmp (opts
->x_ix86_tune_string
, "x86-64"))
1902 opts
->x_ix86_tune_string
= "generic";
1906 if (opts
->x_ix86_stringop_alg
== rep_prefix_8_byte
1907 && !TARGET_64BIT_P (opts
->x_ix86_isa_flags
))
1909 /* rep; movq isn't available in 32-bit code. */
1910 error ("%<-mstringop-strategy=rep_8byte%> not supported for 32-bit code");
1911 opts
->x_ix86_stringop_alg
= no_stringop
;
1914 if (TARGET_UINTR
&& !TARGET_64BIT
)
1915 error ("%<-muintr%> not supported for 32-bit code");
1917 if (!opts
->x_ix86_arch_string
)
1918 opts
->x_ix86_arch_string
1919 = TARGET_64BIT_P (opts
->x_ix86_isa_flags
)
1920 ? "x86-64" : SUBTARGET32_DEFAULT_CPU
;
1922 ix86_arch_specified
= 1;
1924 if (opts_set
->x_ix86_pmode
)
1926 if ((TARGET_LP64_P (opts
->x_ix86_isa_flags
)
1927 && opts
->x_ix86_pmode
== PMODE_SI
)
1928 || (!TARGET_64BIT_P (opts
->x_ix86_isa_flags
)
1929 && opts
->x_ix86_pmode
== PMODE_DI
))
1930 error ("address mode %qs not supported in the %s bit mode",
1931 TARGET_64BIT_P (opts
->x_ix86_isa_flags
) ? "short" : "long",
1932 TARGET_64BIT_P (opts
->x_ix86_isa_flags
) ? "64" : "32");
1935 opts
->x_ix86_pmode
= TARGET_LP64_P (opts
->x_ix86_isa_flags
)
1936 ? PMODE_DI
: PMODE_SI
;
1938 SET_OPTION_IF_UNSET (opts
, opts_set
, ix86_abi
, DEFAULT_ABI
);
1940 if (opts
->x_ix86_abi
== MS_ABI
&& TARGET_X32_P (opts
->x_ix86_isa_flags
))
1941 error ("%<-mabi=ms%> not supported with X32 ABI");
1942 gcc_assert (opts
->x_ix86_abi
== SYSV_ABI
|| opts
->x_ix86_abi
== MS_ABI
);
1944 const char *abi_name
= opts
->x_ix86_abi
== MS_ABI
? "ms" : "sysv";
1945 if ((opts
->x_flag_sanitize
& SANITIZE_USER_ADDRESS
)
1946 && opts
->x_ix86_abi
!= DEFAULT_ABI
)
1947 error ("%<-mabi=%s%> not supported with %<-fsanitize=address%>", abi_name
);
1948 if ((opts
->x_flag_sanitize
& SANITIZE_KERNEL_ADDRESS
)
1949 && opts
->x_ix86_abi
!= DEFAULT_ABI
)
1950 error ("%<-mabi=%s%> not supported with %<-fsanitize=kernel-address%>",
1952 if ((opts
->x_flag_sanitize
& SANITIZE_THREAD
)
1953 && opts
->x_ix86_abi
!= DEFAULT_ABI
)
1954 error ("%<-mabi=%s%> not supported with %<-fsanitize=thread%>", abi_name
);
1956 /* For targets using ms ABI enable ms-extensions, if not
1957 explicit turned off. For non-ms ABI we turn off this
1959 SET_OPTION_IF_UNSET (opts
, opts_set
, flag_ms_extensions
,
1960 (MS_ABI
== DEFAULT_ABI
));
1962 if (opts_set
->x_ix86_cmodel
)
1964 switch (opts
->x_ix86_cmodel
)
1968 if (opts
->x_flag_pic
)
1969 opts
->x_ix86_cmodel
= CM_SMALL_PIC
;
1970 if (!TARGET_64BIT_P (opts
->x_ix86_isa_flags
))
1971 error ("code model %qs not supported in the %s bit mode",
1977 if (opts
->x_flag_pic
)
1978 opts
->x_ix86_cmodel
= CM_MEDIUM_PIC
;
1979 if (!TARGET_64BIT_P (opts
->x_ix86_isa_flags
))
1980 error ("code model %qs not supported in the %s bit mode",
1982 else if (TARGET_X32_P (opts
->x_ix86_isa_flags
))
1983 error ("code model %qs not supported in x32 mode",
1989 if (opts
->x_flag_pic
)
1990 opts
->x_ix86_cmodel
= CM_LARGE_PIC
;
1991 if (!TARGET_64BIT_P (opts
->x_ix86_isa_flags
))
1992 error ("code model %qs not supported in the %s bit mode",
1994 else if (TARGET_X32_P (opts
->x_ix86_isa_flags
))
1995 error ("code model %qs not supported in x32 mode",
2000 if (opts
->x_flag_pic
)
2001 error ("code model %s does not support PIC mode", "32");
2002 if (TARGET_64BIT_P (opts
->x_ix86_isa_flags
))
2003 error ("code model %qs not supported in the %s bit mode",
2008 if (opts
->x_flag_pic
)
2010 error ("code model %s does not support PIC mode", "kernel");
2011 opts
->x_ix86_cmodel
= CM_32
;
2013 if (!TARGET_64BIT_P (opts
->x_ix86_isa_flags
))
2014 error ("code model %qs not supported in the %s bit mode",
2024 /* For TARGET_64BIT and MS_ABI, force pic on, in order to enable the
2025 use of rip-relative addressing. This eliminates fixups that
2026 would otherwise be needed if this object is to be placed in a
2027 DLL, and is essentially just as efficient as direct addressing. */
2028 if (TARGET_64BIT_P (opts
->x_ix86_isa_flags
)
2029 && (TARGET_RDOS
|| TARGET_PECOFF
))
2030 opts
->x_ix86_cmodel
= CM_MEDIUM_PIC
, opts
->x_flag_pic
= 1;
2031 else if (TARGET_64BIT_P (opts
->x_ix86_isa_flags
))
2032 opts
->x_ix86_cmodel
= opts
->x_flag_pic
? CM_SMALL_PIC
: CM_SMALL
;
2034 opts
->x_ix86_cmodel
= CM_32
;
2036 if (TARGET_MACHO
&& opts
->x_ix86_asm_dialect
== ASM_INTEL
)
2038 error ("%<-masm=intel%> not supported in this configuration");
2039 opts
->x_ix86_asm_dialect
= ASM_ATT
;
2041 if ((TARGET_64BIT_P (opts
->x_ix86_isa_flags
) != 0)
2042 != ((opts
->x_ix86_isa_flags
& OPTION_MASK_ISA_64BIT
) != 0))
2043 sorry ("%i-bit mode not compiled in",
2044 (opts
->x_ix86_isa_flags
& OPTION_MASK_ISA_64BIT
) ? 64 : 32);
2046 for (i
= 0; i
< pta_size
; i
++)
2047 if (! strcmp (opts
->x_ix86_arch_string
, processor_alias_table
[i
].name
))
2049 if (!strcmp (opts
->x_ix86_arch_string
, "generic"))
2052 ? G_("%<generic%> CPU can be used only for %<-mtune=%> "
2054 : G_("%<generic%> CPU can be used only for "
2055 "%<target(\"tune=\")%> attribute"));
2058 else if (!strcmp (opts
->x_ix86_arch_string
, "intel"))
2061 ? G_("%<intel%> CPU can be used only for %<-mtune=%> "
2063 : G_("%<intel%> CPU can be used only for "
2064 "%<target(\"tune=\")%> attribute"));
2068 if (TARGET_64BIT_P (opts
->x_ix86_isa_flags
)
2069 && !((processor_alias_table
[i
].flags
& PTA_64BIT
) != 0))
2071 error ("CPU you selected does not support x86-64 "
2076 /* The feature-only micro-architecture levels that use
2077 PTA_NO_TUNE are only defined for the x86-64 psABI. */
2078 if ((processor_alias_table
[i
].flags
& PTA_NO_TUNE
) != 0
2079 && (!TARGET_64BIT_P (opts
->x_ix86_isa_flags
)
2080 || opts
->x_ix86_abi
!= SYSV_ABI
))
2082 error (G_("%qs architecture level is only defined"
2083 " for the x86-64 psABI"), opts
->x_ix86_arch_string
);
2087 ix86_schedule
= processor_alias_table
[i
].schedule
;
2088 ix86_arch
= processor_alias_table
[i
].processor
;
2090 /* Default cpu tuning to the architecture, unless the table
2091 entry requests not to do this. Used by the x86-64 psABI
2092 micro-architecture levels. */
2093 if ((processor_alias_table
[i
].flags
& PTA_NO_TUNE
) == 0)
2094 ix86_tune
= ix86_arch
;
2096 ix86_tune
= PROCESSOR_GENERIC
;
2098 if (((processor_alias_table
[i
].flags
& PTA_MMX
) != 0)
2099 && !(opts
->x_ix86_isa_flags_explicit
& OPTION_MASK_ISA_MMX
))
2100 opts
->x_ix86_isa_flags
|= OPTION_MASK_ISA_MMX
;
2101 if (((processor_alias_table
[i
].flags
& PTA_3DNOW
) != 0)
2102 && !(opts
->x_ix86_isa_flags_explicit
& OPTION_MASK_ISA_3DNOW
))
2103 opts
->x_ix86_isa_flags
|= OPTION_MASK_ISA_3DNOW
;
2104 if (((processor_alias_table
[i
].flags
& PTA_3DNOW_A
) != 0)
2105 && !(opts
->x_ix86_isa_flags_explicit
& OPTION_MASK_ISA_3DNOW_A
))
2106 opts
->x_ix86_isa_flags
|= OPTION_MASK_ISA_3DNOW_A
;
2107 if (((processor_alias_table
[i
].flags
& PTA_SSE
) != 0)
2108 && !(opts
->x_ix86_isa_flags_explicit
& OPTION_MASK_ISA_SSE
))
2109 opts
->x_ix86_isa_flags
|= OPTION_MASK_ISA_SSE
;
2110 if (((processor_alias_table
[i
].flags
& PTA_SSE2
) != 0)
2111 && !(opts
->x_ix86_isa_flags_explicit
& OPTION_MASK_ISA_SSE2
))
2112 opts
->x_ix86_isa_flags
|= OPTION_MASK_ISA_SSE2
;
2113 if (((processor_alias_table
[i
].flags
& PTA_SSE3
) != 0)
2114 && !(opts
->x_ix86_isa_flags_explicit
& OPTION_MASK_ISA_SSE3
))
2115 opts
->x_ix86_isa_flags
|= OPTION_MASK_ISA_SSE3
;
2116 if (((processor_alias_table
[i
].flags
& PTA_SSSE3
) != 0)
2117 && !(opts
->x_ix86_isa_flags_explicit
& OPTION_MASK_ISA_SSSE3
))
2118 opts
->x_ix86_isa_flags
|= OPTION_MASK_ISA_SSSE3
;
2119 if (((processor_alias_table
[i
].flags
& PTA_SSE4_1
) != 0)
2120 && !(opts
->x_ix86_isa_flags_explicit
& OPTION_MASK_ISA_SSE4_1
))
2121 opts
->x_ix86_isa_flags
|= OPTION_MASK_ISA_SSE4_1
;
2122 if (((processor_alias_table
[i
].flags
& PTA_SSE4_2
) != 0)
2123 && !(opts
->x_ix86_isa_flags_explicit
& OPTION_MASK_ISA_SSE4_2
))
2124 opts
->x_ix86_isa_flags
|= OPTION_MASK_ISA_SSE4_2
;
2125 if (((processor_alias_table
[i
].flags
& PTA_AVX
) != 0)
2126 && !(opts
->x_ix86_isa_flags_explicit
& OPTION_MASK_ISA_AVX
))
2127 opts
->x_ix86_isa_flags
|= OPTION_MASK_ISA_AVX
;
2128 if (((processor_alias_table
[i
].flags
& PTA_AVX2
) != 0)
2129 && !(opts
->x_ix86_isa_flags_explicit
& OPTION_MASK_ISA_AVX2
))
2130 opts
->x_ix86_isa_flags
|= OPTION_MASK_ISA_AVX2
;
2131 if (((processor_alias_table
[i
].flags
& PTA_FMA
) != 0)
2132 && !(opts
->x_ix86_isa_flags_explicit
& OPTION_MASK_ISA_FMA
))
2133 opts
->x_ix86_isa_flags
|= OPTION_MASK_ISA_FMA
;
2134 if (((processor_alias_table
[i
].flags
& PTA_SSE4A
) != 0)
2135 && !(opts
->x_ix86_isa_flags_explicit
& OPTION_MASK_ISA_SSE4A
))
2136 opts
->x_ix86_isa_flags
|= OPTION_MASK_ISA_SSE4A
;
2137 if (((processor_alias_table
[i
].flags
& PTA_FMA4
) != 0)
2138 && !(opts
->x_ix86_isa_flags_explicit
& OPTION_MASK_ISA_FMA4
))
2139 opts
->x_ix86_isa_flags
|= OPTION_MASK_ISA_FMA4
;
2140 if (((processor_alias_table
[i
].flags
& PTA_XOP
) != 0)
2141 && !(opts
->x_ix86_isa_flags_explicit
& OPTION_MASK_ISA_XOP
))
2142 opts
->x_ix86_isa_flags
|= OPTION_MASK_ISA_XOP
;
2143 if (((processor_alias_table
[i
].flags
& PTA_LWP
) != 0)
2144 && !(opts
->x_ix86_isa_flags_explicit
& OPTION_MASK_ISA_LWP
))
2145 opts
->x_ix86_isa_flags
|= OPTION_MASK_ISA_LWP
;
2146 if (((processor_alias_table
[i
].flags
& PTA_ABM
) != 0)
2147 && !(opts
->x_ix86_isa_flags_explicit
& OPTION_MASK_ISA_ABM
))
2148 opts
->x_ix86_isa_flags
|= OPTION_MASK_ISA_ABM
;
2149 if (((processor_alias_table
[i
].flags
& PTA_BMI
) != 0)
2150 && !(opts
->x_ix86_isa_flags_explicit
& OPTION_MASK_ISA_BMI
))
2151 opts
->x_ix86_isa_flags
|= OPTION_MASK_ISA_BMI
;
2152 if (((processor_alias_table
[i
].flags
& (PTA_LZCNT
| PTA_ABM
)) != 0)
2153 && !(opts
->x_ix86_isa_flags_explicit
& OPTION_MASK_ISA_LZCNT
))
2154 opts
->x_ix86_isa_flags
|= OPTION_MASK_ISA_LZCNT
;
2155 if (((processor_alias_table
[i
].flags
& PTA_TBM
) != 0)
2156 && !(opts
->x_ix86_isa_flags_explicit
& OPTION_MASK_ISA_TBM
))
2157 opts
->x_ix86_isa_flags
|= OPTION_MASK_ISA_TBM
;
2158 if (((processor_alias_table
[i
].flags
& PTA_BMI2
) != 0)
2159 && !(opts
->x_ix86_isa_flags_explicit
& OPTION_MASK_ISA_BMI2
))
2160 opts
->x_ix86_isa_flags
|= OPTION_MASK_ISA_BMI2
;
2161 if (((processor_alias_table
[i
].flags
& PTA_CX16
) != 0)
2162 && !(opts
->x_ix86_isa_flags2_explicit
& OPTION_MASK_ISA2_CX16
))
2163 opts
->x_ix86_isa_flags2
|= OPTION_MASK_ISA2_CX16
;
2164 if (((processor_alias_table
[i
].flags
& (PTA_POPCNT
| PTA_ABM
)) != 0)
2165 && !(opts
->x_ix86_isa_flags_explicit
& OPTION_MASK_ISA_POPCNT
))
2166 opts
->x_ix86_isa_flags
|= OPTION_MASK_ISA_POPCNT
;
2167 if (!(TARGET_64BIT_P (opts
->x_ix86_isa_flags
)
2168 && ((processor_alias_table
[i
].flags
& PTA_NO_SAHF
) != 0))
2169 && !(opts
->x_ix86_isa_flags_explicit
& OPTION_MASK_ISA_SAHF
))
2170 opts
->x_ix86_isa_flags
|= OPTION_MASK_ISA_SAHF
;
2171 if (((processor_alias_table
[i
].flags
& PTA_MOVBE
) != 0)
2172 && !(opts
->x_ix86_isa_flags2_explicit
& OPTION_MASK_ISA2_MOVBE
))
2173 opts
->x_ix86_isa_flags2
|= OPTION_MASK_ISA2_MOVBE
;
2174 if (((processor_alias_table
[i
].flags
& PTA_AES
) != 0)
2175 && !(ix86_isa_flags_explicit
& OPTION_MASK_ISA_AES
))
2176 ix86_isa_flags
|= OPTION_MASK_ISA_AES
;
2177 if (((processor_alias_table
[i
].flags
& PTA_SHA
) != 0)
2178 && !(ix86_isa_flags_explicit
& OPTION_MASK_ISA_SHA
))
2179 ix86_isa_flags
|= OPTION_MASK_ISA_SHA
;
2180 if (((processor_alias_table
[i
].flags
& PTA_PCLMUL
) != 0)
2181 && !(opts
->x_ix86_isa_flags_explicit
& OPTION_MASK_ISA_PCLMUL
))
2182 opts
->x_ix86_isa_flags
|= OPTION_MASK_ISA_PCLMUL
;
2183 if (((processor_alias_table
[i
].flags
& PTA_FSGSBASE
) != 0)
2184 && !(opts
->x_ix86_isa_flags_explicit
& OPTION_MASK_ISA_FSGSBASE
))
2185 opts
->x_ix86_isa_flags
|= OPTION_MASK_ISA_FSGSBASE
;
2186 if (((processor_alias_table
[i
].flags
& PTA_RDRND
) != 0)
2187 && !(opts
->x_ix86_isa_flags_explicit
& OPTION_MASK_ISA_RDRND
))
2188 opts
->x_ix86_isa_flags
|= OPTION_MASK_ISA_RDRND
;
2189 if (((processor_alias_table
[i
].flags
& PTA_F16C
) != 0)
2190 && !(opts
->x_ix86_isa_flags_explicit
& OPTION_MASK_ISA_F16C
))
2191 opts
->x_ix86_isa_flags
|= OPTION_MASK_ISA_F16C
;
2192 if (((processor_alias_table
[i
].flags
& PTA_RTM
) != 0)
2193 && !(opts
->x_ix86_isa_flags_explicit
& OPTION_MASK_ISA_RTM
))
2194 opts
->x_ix86_isa_flags
|= OPTION_MASK_ISA_RTM
;
2195 if (((processor_alias_table
[i
].flags
& PTA_HLE
) != 0)
2196 && !(opts
->x_ix86_isa_flags2_explicit
& OPTION_MASK_ISA2_HLE
))
2197 opts
->x_ix86_isa_flags2
|= OPTION_MASK_ISA2_HLE
;
2198 if (((processor_alias_table
[i
].flags
& PTA_PRFCHW
) != 0)
2199 && !(opts
->x_ix86_isa_flags_explicit
& OPTION_MASK_ISA_PRFCHW
))
2200 opts
->x_ix86_isa_flags
|= OPTION_MASK_ISA_PRFCHW
;
2201 if (((processor_alias_table
[i
].flags
& PTA_RDSEED
) != 0)
2202 && !(opts
->x_ix86_isa_flags_explicit
& OPTION_MASK_ISA_RDSEED
))
2203 opts
->x_ix86_isa_flags
|= OPTION_MASK_ISA_RDSEED
;
2204 if (((processor_alias_table
[i
].flags
& PTA_ADX
) != 0)
2205 && !(opts
->x_ix86_isa_flags_explicit
& OPTION_MASK_ISA_ADX
))
2206 opts
->x_ix86_isa_flags
|= OPTION_MASK_ISA_ADX
;
2207 if (((processor_alias_table
[i
].flags
& PTA_FXSR
) != 0)
2208 && !(opts
->x_ix86_isa_flags_explicit
& OPTION_MASK_ISA_FXSR
))
2209 opts
->x_ix86_isa_flags
|= OPTION_MASK_ISA_FXSR
;
2210 if (((processor_alias_table
[i
].flags
& PTA_XSAVE
) != 0)
2211 && !(opts
->x_ix86_isa_flags_explicit
& OPTION_MASK_ISA_XSAVE
))
2212 opts
->x_ix86_isa_flags
|= OPTION_MASK_ISA_XSAVE
;
2213 if (((processor_alias_table
[i
].flags
& PTA_XSAVEOPT
) != 0)
2214 && !(opts
->x_ix86_isa_flags_explicit
& OPTION_MASK_ISA_XSAVEOPT
))
2215 opts
->x_ix86_isa_flags
|= OPTION_MASK_ISA_XSAVEOPT
;
2216 if (((processor_alias_table
[i
].flags
& PTA_AVX512F
) != 0)
2217 && !(opts
->x_ix86_isa_flags_explicit
& OPTION_MASK_ISA_AVX512F
))
2218 opts
->x_ix86_isa_flags
|= OPTION_MASK_ISA_AVX512F
;
2219 if (((processor_alias_table
[i
].flags
& PTA_AVX512ER
) != 0)
2220 && !(opts
->x_ix86_isa_flags_explicit
& OPTION_MASK_ISA_AVX512ER
))
2221 opts
->x_ix86_isa_flags
|= OPTION_MASK_ISA_AVX512ER
;
2222 if (((processor_alias_table
[i
].flags
& PTA_AVX512PF
) != 0)
2223 && !(opts
->x_ix86_isa_flags_explicit
& OPTION_MASK_ISA_AVX512PF
))
2224 opts
->x_ix86_isa_flags
|= OPTION_MASK_ISA_AVX512PF
;
2225 if (((processor_alias_table
[i
].flags
& PTA_AVX512CD
) != 0)
2226 && !(opts
->x_ix86_isa_flags_explicit
& OPTION_MASK_ISA_AVX512CD
))
2227 opts
->x_ix86_isa_flags
|= OPTION_MASK_ISA_AVX512CD
;
2228 if (((processor_alias_table
[i
].flags
& PTA_PREFETCHWT1
) != 0)
2229 && !(opts
->x_ix86_isa_flags_explicit
& OPTION_MASK_ISA_PREFETCHWT1
))
2230 opts
->x_ix86_isa_flags
|= OPTION_MASK_ISA_PREFETCHWT1
;
2231 if (((processor_alias_table
[i
].flags
& PTA_CLWB
) != 0)
2232 && !(opts
->x_ix86_isa_flags_explicit
& OPTION_MASK_ISA_CLWB
))
2233 opts
->x_ix86_isa_flags
|= OPTION_MASK_ISA_CLWB
;
2234 if (((processor_alias_table
[i
].flags
& PTA_CLFLUSHOPT
) != 0)
2235 && !(opts
->x_ix86_isa_flags_explicit
& OPTION_MASK_ISA_CLFLUSHOPT
))
2236 opts
->x_ix86_isa_flags
|= OPTION_MASK_ISA_CLFLUSHOPT
;
2237 if (((processor_alias_table
[i
].flags
& PTA_CLZERO
) != 0)
2238 && !(opts
->x_ix86_isa_flags2_explicit
& OPTION_MASK_ISA2_CLZERO
))
2239 opts
->x_ix86_isa_flags2
|= OPTION_MASK_ISA2_CLZERO
;
2240 if (((processor_alias_table
[i
].flags
& PTA_XSAVEC
) != 0)
2241 && !(opts
->x_ix86_isa_flags_explicit
& OPTION_MASK_ISA_XSAVEC
))
2242 opts
->x_ix86_isa_flags
|= OPTION_MASK_ISA_XSAVEC
;
2243 if (((processor_alias_table
[i
].flags
& PTA_XSAVES
) != 0)
2244 && !(opts
->x_ix86_isa_flags_explicit
& OPTION_MASK_ISA_XSAVES
))
2245 opts
->x_ix86_isa_flags
|= OPTION_MASK_ISA_XSAVES
;
2246 if (((processor_alias_table
[i
].flags
& PTA_AVX512DQ
) != 0)
2247 && !(opts
->x_ix86_isa_flags_explicit
& OPTION_MASK_ISA_AVX512DQ
))
2248 opts
->x_ix86_isa_flags
|= OPTION_MASK_ISA_AVX512DQ
;
2249 if (((processor_alias_table
[i
].flags
& PTA_AVX512BW
) != 0)
2250 && !(opts
->x_ix86_isa_flags_explicit
& OPTION_MASK_ISA_AVX512BW
))
2251 opts
->x_ix86_isa_flags
|= OPTION_MASK_ISA_AVX512BW
;
2252 if (((processor_alias_table
[i
].flags
& PTA_AVX512VL
) != 0)
2253 && !(opts
->x_ix86_isa_flags_explicit
& OPTION_MASK_ISA_AVX512VL
))
2254 opts
->x_ix86_isa_flags
|= OPTION_MASK_ISA_AVX512VL
;
2255 if (((processor_alias_table
[i
].flags
& PTA_AVX512VBMI
) != 0)
2256 && !(opts
->x_ix86_isa_flags_explicit
& OPTION_MASK_ISA_AVX512VBMI
))
2257 opts
->x_ix86_isa_flags
|= OPTION_MASK_ISA_AVX512VBMI
;
2258 if (((processor_alias_table
[i
].flags
& PTA_AVX512IFMA
) != 0)
2259 && !(opts
->x_ix86_isa_flags_explicit
& OPTION_MASK_ISA_AVX512IFMA
))
2260 opts
->x_ix86_isa_flags
|= OPTION_MASK_ISA_AVX512IFMA
;
2261 if (((processor_alias_table
[i
].flags
& PTA_AVX512VNNI
) != 0)
2262 && !(opts
->x_ix86_isa_flags_explicit
& OPTION_MASK_ISA_AVX512VNNI
))
2263 opts
->x_ix86_isa_flags
|= OPTION_MASK_ISA_AVX512VNNI
;
2264 if (((processor_alias_table
[i
].flags
& PTA_GFNI
) != 0)
2265 && !(opts
->x_ix86_isa_flags_explicit
& OPTION_MASK_ISA_GFNI
))
2266 opts
->x_ix86_isa_flags
|= OPTION_MASK_ISA_GFNI
;
2267 if (((processor_alias_table
[i
].flags
& PTA_AVX512VBMI2
) != 0)
2268 && !(opts
->x_ix86_isa_flags_explicit
2269 & OPTION_MASK_ISA_AVX512VBMI2
))
2270 opts
->x_ix86_isa_flags
|= OPTION_MASK_ISA_AVX512VBMI2
;
2271 if (((processor_alias_table
[i
].flags
& PTA_VPCLMULQDQ
) != 0)
2272 && !(opts
->x_ix86_isa_flags_explicit
& OPTION_MASK_ISA_VPCLMULQDQ
))
2273 opts
->x_ix86_isa_flags
|= OPTION_MASK_ISA_VPCLMULQDQ
;
2274 if (((processor_alias_table
[i
].flags
& PTA_AVX512BITALG
) != 0)
2275 && !(opts
->x_ix86_isa_flags_explicit
2276 & OPTION_MASK_ISA_AVX512BITALG
))
2277 opts
->x_ix86_isa_flags
|= OPTION_MASK_ISA_AVX512BITALG
;
2279 if (((processor_alias_table
[i
].flags
& PTA_AVX512VP2INTERSECT
) != 0)
2280 && !(opts
->x_ix86_isa_flags2_explicit
2281 & OPTION_MASK_ISA2_AVX512VP2INTERSECT
))
2282 opts
->x_ix86_isa_flags2
|= OPTION_MASK_ISA2_AVX512VP2INTERSECT
;
2283 if (((processor_alias_table
[i
].flags
& PTA_AVX5124VNNIW
) != 0)
2284 && !(opts
->x_ix86_isa_flags2_explicit
2285 & OPTION_MASK_ISA2_AVX5124VNNIW
))
2286 opts
->x_ix86_isa_flags2
|= OPTION_MASK_ISA2_AVX5124VNNIW
;
2287 if (((processor_alias_table
[i
].flags
& PTA_AVX5124FMAPS
) != 0)
2288 && !(opts
->x_ix86_isa_flags2_explicit
2289 & OPTION_MASK_ISA2_AVX5124FMAPS
))
2290 opts
->x_ix86_isa_flags2
|= OPTION_MASK_ISA2_AVX5124FMAPS
;
2291 if (((processor_alias_table
[i
].flags
& PTA_AVX512VPOPCNTDQ
) != 0)
2292 && !(opts
->x_ix86_isa_flags_explicit
2293 & OPTION_MASK_ISA_AVX512VPOPCNTDQ
))
2294 opts
->x_ix86_isa_flags
|= OPTION_MASK_ISA_AVX512VPOPCNTDQ
;
2295 if (((processor_alias_table
[i
].flags
& PTA_AVX512BF16
) != 0)
2296 && !(opts
->x_ix86_isa_flags2_explicit
2297 & OPTION_MASK_ISA2_AVX512BF16
))
2298 opts
->x_ix86_isa_flags2
|= OPTION_MASK_ISA2_AVX512BF16
;
2299 if (((processor_alias_table
[i
].flags
& PTA_AMX_TILE
) != 0)
2300 && !(opts
->x_ix86_isa_flags2_explicit
2301 & OPTION_MASK_ISA2_AMX_TILE
))
2302 opts
->x_ix86_isa_flags2
|= OPTION_MASK_ISA2_AMX_TILE
;
2303 if (((processor_alias_table
[i
].flags
& PTA_AMX_INT8
) != 0)
2304 && !(opts
->x_ix86_isa_flags2_explicit
2305 & OPTION_MASK_ISA2_AMX_INT8
))
2306 opts
->x_ix86_isa_flags2
|= OPTION_MASK_ISA2_AMX_INT8
;
2307 if (((processor_alias_table
[i
].flags
& PTA_AMX_BF16
) != 0)
2308 && !(opts
->x_ix86_isa_flags2_explicit
2309 & OPTION_MASK_ISA2_AMX_BF16
))
2310 opts
->x_ix86_isa_flags2
|= OPTION_MASK_ISA2_AMX_BF16
;
2311 if (((processor_alias_table
[i
].flags
& PTA_AVXVNNI
) != 0)
2312 && !(opts
->x_ix86_isa_flags2_explicit
2313 & OPTION_MASK_ISA2_AVXVNNI
))
2314 opts
->x_ix86_isa_flags2
|= OPTION_MASK_ISA2_AVXVNNI
;
2315 if (((processor_alias_table
[i
].flags
& PTA_MOVDIRI
) != 0)
2316 && !(opts
->x_ix86_isa_flags_explicit
& OPTION_MASK_ISA_MOVDIRI
))
2317 opts
->x_ix86_isa_flags
|= OPTION_MASK_ISA_MOVDIRI
;
2318 if (((processor_alias_table
[i
].flags
& PTA_MOVDIR64B
) != 0)
2319 && !(opts
->x_ix86_isa_flags2_explicit
& OPTION_MASK_ISA2_MOVDIR64B
))
2320 opts
->x_ix86_isa_flags2
|= OPTION_MASK_ISA2_MOVDIR64B
;
2321 if (((processor_alias_table
[i
].flags
& PTA_SGX
) != 0)
2322 && !(opts
->x_ix86_isa_flags2_explicit
& OPTION_MASK_ISA2_SGX
))
2323 opts
->x_ix86_isa_flags2
|= OPTION_MASK_ISA2_SGX
;
2324 if (((processor_alias_table
[i
].flags
& PTA_VAES
) != 0)
2325 && !(opts
->x_ix86_isa_flags2_explicit
& OPTION_MASK_ISA2_VAES
))
2326 opts
->x_ix86_isa_flags2
|= OPTION_MASK_ISA2_VAES
;
2327 if (((processor_alias_table
[i
].flags
& PTA_RDPID
) != 0)
2328 && !(opts
->x_ix86_isa_flags2_explicit
& OPTION_MASK_ISA2_RDPID
))
2329 opts
->x_ix86_isa_flags2
|= OPTION_MASK_ISA2_RDPID
;
2330 if (((processor_alias_table
[i
].flags
& PTA_PCONFIG
) != 0)
2331 && !(opts
->x_ix86_isa_flags2_explicit
& OPTION_MASK_ISA2_PCONFIG
))
2332 opts
->x_ix86_isa_flags2
|= OPTION_MASK_ISA2_PCONFIG
;
2333 if (((processor_alias_table
[i
].flags
& PTA_WBNOINVD
) != 0)
2334 && !(opts
->x_ix86_isa_flags2_explicit
& OPTION_MASK_ISA2_WBNOINVD
))
2335 opts
->x_ix86_isa_flags2
|= OPTION_MASK_ISA2_WBNOINVD
;
2336 if (((processor_alias_table
[i
].flags
& PTA_PTWRITE
) != 0)
2337 && !(opts
->x_ix86_isa_flags2_explicit
& OPTION_MASK_ISA2_PTWRITE
))
2338 opts
->x_ix86_isa_flags2
|= OPTION_MASK_ISA2_PTWRITE
;
2339 if (((processor_alias_table
[i
].flags
& PTA_WAITPKG
) != 0)
2340 && !(opts
->x_ix86_isa_flags2_explicit
& OPTION_MASK_ISA2_WAITPKG
))
2341 opts
->x_ix86_isa_flags2
|= OPTION_MASK_ISA2_WAITPKG
;
2342 if (((processor_alias_table
[i
].flags
& PTA_ENQCMD
) != 0)
2343 && !(opts
->x_ix86_isa_flags2_explicit
& OPTION_MASK_ISA2_ENQCMD
))
2344 opts
->x_ix86_isa_flags2
|= OPTION_MASK_ISA2_ENQCMD
;
2345 if (((processor_alias_table
[i
].flags
& PTA_CLDEMOTE
) != 0)
2346 && !(opts
->x_ix86_isa_flags2_explicit
& OPTION_MASK_ISA2_CLDEMOTE
))
2347 opts
->x_ix86_isa_flags2
|= OPTION_MASK_ISA2_CLDEMOTE
;
2348 if (((processor_alias_table
[i
].flags
& PTA_SERIALIZE
) != 0)
2349 && !(opts
->x_ix86_isa_flags2_explicit
& OPTION_MASK_ISA2_SERIALIZE
))
2350 opts
->x_ix86_isa_flags2
|= OPTION_MASK_ISA2_SERIALIZE
;
2351 if (((processor_alias_table
[i
].flags
& PTA_TSXLDTRK
) != 0)
2352 && !(opts
->x_ix86_isa_flags2_explicit
& OPTION_MASK_ISA2_TSXLDTRK
))
2353 opts
->x_ix86_isa_flags2
|= OPTION_MASK_ISA2_TSXLDTRK
;
2354 if (((processor_alias_table
[i
].flags
& PTA_KL
) != 0)
2355 && !(opts
->x_ix86_isa_flags2_explicit
& OPTION_MASK_ISA2_KL
))
2356 opts
->x_ix86_isa_flags2
|= OPTION_MASK_ISA2_KL
;
2357 if (((processor_alias_table
[i
].flags
& PTA_WIDEKL
) != 0)
2358 && !(opts
->x_ix86_isa_flags2_explicit
& OPTION_MASK_ISA2_WIDEKL
))
2359 opts
->x_ix86_isa_flags2
|= OPTION_MASK_ISA2_WIDEKL
;
2361 if ((processor_alias_table
[i
].flags
2362 & (PTA_PREFETCH_SSE
| PTA_SSE
)) != 0)
2363 x86_prefetch_sse
= true;
2364 if (((processor_alias_table
[i
].flags
& PTA_MWAITX
) != 0)
2365 && !(opts
->x_ix86_isa_flags2_explicit
& OPTION_MASK_ISA2_MWAITX
))
2366 opts
->x_ix86_isa_flags2
|= OPTION_MASK_ISA2_MWAITX
;
2367 if (((processor_alias_table
[i
].flags
& PTA_PKU
) != 0)
2368 && !(opts
->x_ix86_isa_flags_explicit
& OPTION_MASK_ISA_PKU
))
2369 opts
->x_ix86_isa_flags
|= OPTION_MASK_ISA_PKU
;
2371 /* Don't enable x87 instructions if only general registers are
2372 allowed by target("general-regs-only") function attribute or
2373 -mgeneral-regs-only. */
2374 if (!(opts
->x_ix86_target_flags
& OPTION_MASK_GENERAL_REGS_ONLY
)
2375 && !(opts_set
->x_target_flags
& MASK_80387
))
2377 if (((processor_alias_table
[i
].flags
& PTA_NO_80387
) != 0))
2378 opts
->x_target_flags
&= ~MASK_80387
;
2380 opts
->x_target_flags
|= MASK_80387
;
2388 ? G_("bad value (%qs) for %<-march=%> switch")
2389 : G_("bad value (%qs) for %<target(\"arch=\")%> attribute"),
2390 opts
->x_ix86_arch_string
);
2392 auto_vec
<const char *> candidates
;
2393 for (i
= 0; i
< pta_size
; i
++)
2394 if (strcmp (processor_alias_table
[i
].name
, "generic")
2395 && strcmp (processor_alias_table
[i
].name
, "intel")
2396 && (!TARGET_64BIT_P (opts
->x_ix86_isa_flags
)
2397 || ((processor_alias_table
[i
].flags
& PTA_64BIT
) != 0)))
2398 candidates
.safe_push (processor_alias_table
[i
].name
);
2400 #ifdef HAVE_LOCAL_CPU_DETECT
2401 /* Add also "native" as possible value. */
2402 candidates
.safe_push ("native");
2407 = candidates_list_and_hint (opts
->x_ix86_arch_string
, s
, candidates
);
2409 inform (input_location
,
2411 ? G_("valid arguments to %<-march=%> switch are: "
2412 "%s; did you mean %qs?")
2413 : G_("valid arguments to %<target(\"arch=\")%> attribute are: "
2414 "%s; did you mean %qs?"), s
, hint
);
2416 inform (input_location
,
2418 ? G_("valid arguments to %<-march=%> switch are: %s")
2419 : G_("valid arguments to %<target(\"arch=\")%> attribute "
2424 ix86_arch_mask
= HOST_WIDE_INT_1U
<< ix86_arch
;
2425 for (i
= 0; i
< X86_ARCH_LAST
; ++i
)
2426 ix86_arch_features
[i
] = !!(initial_ix86_arch_features
[i
] & ix86_arch_mask
);
2428 for (i
= 0; i
< pta_size
; i
++)
2429 if (! strcmp (opts
->x_ix86_tune_string
, processor_alias_table
[i
].name
)
2430 && (processor_alias_table
[i
].flags
& PTA_NO_TUNE
) == 0)
2432 ix86_schedule
= processor_alias_table
[i
].schedule
;
2433 ix86_tune
= processor_alias_table
[i
].processor
;
2434 if (TARGET_64BIT_P (opts
->x_ix86_isa_flags
))
2436 if (!((processor_alias_table
[i
].flags
& PTA_64BIT
) != 0))
2438 if (ix86_tune_defaulted
)
2440 opts
->x_ix86_tune_string
= "x86-64";
2441 for (i
= 0; i
< pta_size
; i
++)
2442 if (! strcmp (opts
->x_ix86_tune_string
,
2443 processor_alias_table
[i
].name
))
2445 ix86_schedule
= processor_alias_table
[i
].schedule
;
2446 ix86_tune
= processor_alias_table
[i
].processor
;
2449 error ("CPU you selected does not support x86-64 "
2453 /* Intel CPUs have always interpreted SSE prefetch instructions as
2454 NOPs; so, we can enable SSE prefetch instructions even when
2455 -mtune (rather than -march) points us to a processor that has them.
2456 However, the VIA C3 gives a SIGILL, so we only do that for i686 and
2457 higher processors. */
2459 && ((processor_alias_table
[i
].flags
2460 & (PTA_PREFETCH_SSE
| PTA_SSE
)) != 0))
2461 x86_prefetch_sse
= true;
2465 if (ix86_tune_specified
&& i
== pta_size
)
2468 ? G_("bad value (%qs) for %<-mtune=%> switch")
2469 : G_("bad value (%qs) for %<target(\"tune=\")%> attribute"),
2470 opts
->x_ix86_tune_string
);
2472 auto_vec
<const char *> candidates
;
2473 for (i
= 0; i
< pta_size
; i
++)
2474 if ((!TARGET_64BIT_P (opts
->x_ix86_isa_flags
)
2475 || ((processor_alias_table
[i
].flags
& PTA_64BIT
) != 0))
2476 && (processor_alias_table
[i
].flags
& PTA_NO_TUNE
) == 0)
2477 candidates
.safe_push (processor_alias_table
[i
].name
);
2479 #ifdef HAVE_LOCAL_CPU_DETECT
2480 /* Add also "native" as possible value. */
2481 candidates
.safe_push ("native");
2486 = candidates_list_and_hint (opts
->x_ix86_tune_string
, s
, candidates
);
2488 inform (input_location
,
2490 ? G_("valid arguments to %<-mtune=%> switch are: "
2491 "%s; did you mean %qs?")
2492 : G_("valid arguments to %<target(\"tune=\")%> attribute are: "
2493 "%s; did you mean %qs?"), s
, hint
);
2495 inform (input_location
,
2497 ? G_("valid arguments to %<-mtune=%> switch are: %s")
2498 : G_("valid arguments to %<target(\"tune=\")%> attribute "
2503 set_ix86_tune_features (opts
, ix86_tune
, opts
->x_ix86_dump_tunes
);
2505 ix86_recompute_optlev_based_flags (opts
, opts_set
);
2507 ix86_tune_cost
= processor_cost_table
[ix86_tune
];
2508 /* TODO: ix86_cost should be chosen at instruction or function granuality
2509 so for cold code we use size_cost even in !optimize_size compilation. */
2510 if (opts
->x_optimize_size
)
2511 ix86_cost
= &ix86_size_cost
;
2513 ix86_cost
= ix86_tune_cost
;
2515 /* Arrange to set up i386_stack_locals for all functions. */
2516 init_machine_status
= ix86_init_machine_status
;
2518 /* Validate -mregparm= value. */
2519 if (opts_set
->x_ix86_regparm
)
2521 if (TARGET_64BIT_P (opts
->x_ix86_isa_flags
))
2522 warning (0, "%<-mregparm%> is ignored in 64-bit mode");
2523 else if (TARGET_IAMCU_P (opts
->x_target_flags
))
2524 warning (0, "%<-mregparm%> is ignored for Intel MCU psABI");
2525 if (opts
->x_ix86_regparm
> REGPARM_MAX
)
2527 error ("%<-mregparm=%d%> is not between 0 and %d",
2528 opts
->x_ix86_regparm
, REGPARM_MAX
);
2529 opts
->x_ix86_regparm
= 0;
2532 if (TARGET_IAMCU_P (opts
->x_target_flags
)
2533 || TARGET_64BIT_P (opts
->x_ix86_isa_flags
))
2534 opts
->x_ix86_regparm
= REGPARM_MAX
;
2536 /* Default align_* from the processor table. */
2537 ix86_default_align (opts
);
2539 /* Provide default for -mbranch-cost= value. */
2540 SET_OPTION_IF_UNSET (opts
, opts_set
, ix86_branch_cost
,
2541 ix86_tune_cost
->branch_cost
);
2543 if (TARGET_64BIT_P (opts
->x_ix86_isa_flags
))
2545 opts
->x_target_flags
2546 |= TARGET_SUBTARGET64_DEFAULT
& ~opts_set
->x_target_flags
;
2548 if (!ix86_arch_specified
)
2549 opts
->x_ix86_isa_flags
2550 |= TARGET_SUBTARGET64_ISA_DEFAULT
& ~opts
->x_ix86_isa_flags_explicit
;
2552 if (TARGET_RTD_P (opts
->x_target_flags
))
2555 ? G_("%<-mrtd%> is ignored in 64bit mode")
2556 : G_("%<target(\"rtd\")%> is ignored in 64bit mode"));
2560 opts
->x_target_flags
2561 |= TARGET_SUBTARGET32_DEFAULT
& ~opts_set
->x_target_flags
;
2563 if (!ix86_arch_specified
)
2564 opts
->x_ix86_isa_flags
2565 |= TARGET_SUBTARGET32_ISA_DEFAULT
& ~opts
->x_ix86_isa_flags_explicit
;
2567 /* i386 ABI does not specify red zone. It still makes sense to use it
2568 when programmer takes care to stack from being destroyed. */
2569 if (!(opts_set
->x_target_flags
& MASK_NO_RED_ZONE
))
2570 opts
->x_target_flags
|= MASK_NO_RED_ZONE
;
2573 /* Keep nonleaf frame pointers. */
2574 if (opts
->x_flag_omit_frame_pointer
)
2575 opts
->x_target_flags
&= ~MASK_OMIT_LEAF_FRAME_POINTER
;
2576 else if (TARGET_OMIT_LEAF_FRAME_POINTER_P (opts
->x_target_flags
))
2577 opts
->x_flag_omit_frame_pointer
= 1;
2579 /* If we're doing fast math, we don't care about comparison order
2580 wrt NaNs. This lets us use a shorter comparison sequence. */
2581 if (opts
->x_flag_finite_math_only
)
2582 opts
->x_target_flags
&= ~MASK_IEEE_FP
;
2584 /* If the architecture always has an FPU, turn off NO_FANCY_MATH_387,
2585 since the insns won't need emulation. */
2586 if (ix86_tune_features
[X86_TUNE_ALWAYS_FANCY_MATH_387
])
2587 opts
->x_target_flags
&= ~MASK_NO_FANCY_MATH_387
;
2589 /* Likewise, if the target doesn't have a 387, or we've specified
2590 software floating point, don't use 387 inline intrinsics. */
2591 if (!TARGET_80387_P (opts
->x_target_flags
))
2592 opts
->x_target_flags
|= MASK_NO_FANCY_MATH_387
;
2594 /* Turn on MMX builtins for -msse. */
2595 if (TARGET_SSE_P (opts
->x_ix86_isa_flags
))
2596 opts
->x_ix86_isa_flags
2597 |= OPTION_MASK_ISA_MMX
& ~opts
->x_ix86_isa_flags_explicit
;
2599 /* Enable SSE prefetch. */
2600 if (TARGET_SSE_P (opts
->x_ix86_isa_flags
)
2601 || (TARGET_PRFCHW_P (opts
->x_ix86_isa_flags
)
2602 && !TARGET_3DNOW_P (opts
->x_ix86_isa_flags
))
2603 || TARGET_PREFETCHWT1_P (opts
->x_ix86_isa_flags
))
2604 x86_prefetch_sse
= true;
2606 /* Enable popcnt instruction for -msse4.2 or -mabm. */
2607 if (TARGET_SSE4_2_P (opts
->x_ix86_isa_flags
)
2608 || TARGET_ABM_P (opts
->x_ix86_isa_flags
))
2609 opts
->x_ix86_isa_flags
2610 |= OPTION_MASK_ISA_POPCNT
& ~opts
->x_ix86_isa_flags_explicit
;
2612 /* Enable lzcnt instruction for -mabm. */
2613 if (TARGET_ABM_P(opts
->x_ix86_isa_flags
))
2614 opts
->x_ix86_isa_flags
2615 |= OPTION_MASK_ISA_LZCNT
& ~opts
->x_ix86_isa_flags_explicit
;
2617 /* Disable BMI, BMI2 and TBM instructions for -m16. */
2618 if (TARGET_16BIT_P(opts
->x_ix86_isa_flags
))
2619 opts
->x_ix86_isa_flags
2620 &= ~((OPTION_MASK_ISA_BMI
| OPTION_MASK_ISA_BMI2
| OPTION_MASK_ISA_TBM
)
2621 & ~opts
->x_ix86_isa_flags_explicit
);
2623 /* Validate -mpreferred-stack-boundary= value or default it to
2624 PREFERRED_STACK_BOUNDARY_DEFAULT. */
2625 ix86_preferred_stack_boundary
= PREFERRED_STACK_BOUNDARY_DEFAULT
;
2626 if (opts_set
->x_ix86_preferred_stack_boundary_arg
)
2628 int min
= TARGET_64BIT_P (opts
->x_ix86_isa_flags
)? 3 : 2;
2629 int max
= TARGET_SEH
? 4 : 12;
2631 if (opts
->x_ix86_preferred_stack_boundary_arg
< min
2632 || opts
->x_ix86_preferred_stack_boundary_arg
> max
)
2635 error ("%<-mpreferred-stack-boundary%> is not supported "
2638 error ("%<-mpreferred-stack-boundary=%d%> is not between %d and %d",
2639 opts
->x_ix86_preferred_stack_boundary_arg
, min
, max
);
2642 ix86_preferred_stack_boundary
2643 = (1 << opts
->x_ix86_preferred_stack_boundary_arg
) * BITS_PER_UNIT
;
2646 /* Set the default value for -mstackrealign. */
2647 SET_OPTION_IF_UNSET (opts
, opts_set
, ix86_force_align_arg_pointer
,
2648 STACK_REALIGN_DEFAULT
);
2650 ix86_default_incoming_stack_boundary
= PREFERRED_STACK_BOUNDARY
;
2652 /* Validate -mincoming-stack-boundary= value or default it to
2653 MIN_STACK_BOUNDARY/PREFERRED_STACK_BOUNDARY. */
2654 ix86_incoming_stack_boundary
= ix86_default_incoming_stack_boundary
;
2655 if (opts_set
->x_ix86_incoming_stack_boundary_arg
)
2657 int min
= TARGET_64BIT_P (opts
->x_ix86_isa_flags
) ? 3 : 2;
2659 if (opts
->x_ix86_incoming_stack_boundary_arg
< min
2660 || opts
->x_ix86_incoming_stack_boundary_arg
> 12)
2661 error ("%<-mincoming-stack-boundary=%d%> is not between %d and 12",
2662 opts
->x_ix86_incoming_stack_boundary_arg
, min
);
2665 ix86_user_incoming_stack_boundary
2666 = (1 << opts
->x_ix86_incoming_stack_boundary_arg
) * BITS_PER_UNIT
;
2667 ix86_incoming_stack_boundary
2668 = ix86_user_incoming_stack_boundary
;
2672 #ifndef NO_PROFILE_COUNTERS
2673 if (flag_nop_mcount
)
2674 error ("%<-mnop-mcount%> is not compatible with this target");
2676 if (flag_nop_mcount
&& flag_pic
)
2677 error ("%<-mnop-mcount%> is not implemented for %<-fPIC%>");
2679 /* Accept -msseregparm only if at least SSE support is enabled. */
2680 if (TARGET_SSEREGPARM_P (opts
->x_target_flags
)
2681 && ! TARGET_SSE_P (opts
->x_ix86_isa_flags
))
2683 ? G_("%<-msseregparm%> used without SSE enabled")
2684 : G_("%<target(\"sseregparm\")%> used without SSE enabled"));
2686 if (opts_set
->x_ix86_fpmath
)
2688 if (opts
->x_ix86_fpmath
& FPMATH_SSE
)
2690 if (!TARGET_SSE_P (opts
->x_ix86_isa_flags
))
2692 if (TARGET_80387_P (opts
->x_target_flags
))
2694 warning (0, "SSE instruction set disabled, using 387 arithmetics");
2695 opts
->x_ix86_fpmath
= FPMATH_387
;
2698 else if ((opts
->x_ix86_fpmath
& FPMATH_387
)
2699 && !TARGET_80387_P (opts
->x_target_flags
))
2701 warning (0, "387 instruction set disabled, using SSE arithmetics");
2702 opts
->x_ix86_fpmath
= FPMATH_SSE
;
2706 /* For all chips supporting SSE2, -mfpmath=sse performs better than
2707 fpmath=387. The second is however default at many targets since the
2708 extra 80bit precision of temporaries is considered to be part of ABI.
2709 Overwrite the default at least for -ffast-math.
2710 TODO: -mfpmath=both seems to produce same performing code with bit
2711 smaller binaries. It is however not clear if register allocation is
2712 ready for this setting.
2713 Also -mfpmath=387 is overall a lot more compact (bout 4-5%) than SSE
2714 codegen. We may switch to 387 with -ffast-math for size optimized
2716 else if (fast_math_flags_set_p (&global_options
)
2717 && TARGET_SSE2_P (opts
->x_ix86_isa_flags
))
2718 opts
->x_ix86_fpmath
= FPMATH_SSE
;
2720 opts
->x_ix86_fpmath
= TARGET_FPMATH_DEFAULT_P (opts
->x_ix86_isa_flags
);
2722 /* Use external vectorized library in vectorizing intrinsics. */
2723 if (opts_set
->x_ix86_veclibabi_type
)
2724 switch (opts
->x_ix86_veclibabi_type
)
2726 case ix86_veclibabi_type_svml
:
2727 ix86_veclib_handler
= &ix86_veclibabi_svml
;
2730 case ix86_veclibabi_type_acml
:
2731 ix86_veclib_handler
= &ix86_veclibabi_acml
;
2738 if (ix86_tune_features
[X86_TUNE_ACCUMULATE_OUTGOING_ARGS
]
2739 && !(opts_set
->x_target_flags
& MASK_ACCUMULATE_OUTGOING_ARGS
))
2740 opts
->x_target_flags
|= MASK_ACCUMULATE_OUTGOING_ARGS
;
2742 /* If stack probes are required, the space used for large function
2743 arguments on the stack must also be probed, so enable
2744 -maccumulate-outgoing-args so this happens in the prologue. */
2745 if (TARGET_STACK_PROBE_P (opts
->x_target_flags
)
2746 && !(opts
->x_target_flags
& MASK_ACCUMULATE_OUTGOING_ARGS
))
2748 if (opts_set
->x_target_flags
& MASK_ACCUMULATE_OUTGOING_ARGS
)
2751 ? G_("stack probing requires %<-maccumulate-outgoing-args%> "
2753 : G_("stack probing requires "
2754 "%<target(\"accumulate-outgoing-args\")%> for "
2756 opts
->x_target_flags
|= MASK_ACCUMULATE_OUTGOING_ARGS
;
2759 /* Stack realignment without -maccumulate-outgoing-args requires %ebp,
2760 so enable -maccumulate-outgoing-args when %ebp is fixed. */
2761 if (fixed_regs
[BP_REG
]
2762 && !(opts
->x_target_flags
& MASK_ACCUMULATE_OUTGOING_ARGS
))
2764 if (opts_set
->x_target_flags
& MASK_ACCUMULATE_OUTGOING_ARGS
)
2767 ? G_("fixed ebp register requires "
2768 "%<-maccumulate-outgoing-args%>")
2769 : G_("fixed ebp register requires "
2770 "%<target(\"accumulate-outgoing-args\")%>"));
2771 opts
->x_target_flags
|= MASK_ACCUMULATE_OUTGOING_ARGS
;
2774 /* Figure out what ASM_GENERATE_INTERNAL_LABEL builds as a prefix. */
2777 ASM_GENERATE_INTERNAL_LABEL (internal_label_prefix
, "LX", 0);
2778 p
= strchr (internal_label_prefix
, 'X');
2779 internal_label_prefix_len
= p
- internal_label_prefix
;
2783 /* When scheduling description is not available, disable scheduler pass
2784 so it won't slow down the compilation and make x87 code slower. */
2785 if (!TARGET_SCHEDULE
)
2786 opts
->x_flag_schedule_insns_after_reload
= opts
->x_flag_schedule_insns
= 0;
2788 SET_OPTION_IF_UNSET (opts
, opts_set
, param_simultaneous_prefetches
,
2789 ix86_tune_cost
->simultaneous_prefetches
);
2790 SET_OPTION_IF_UNSET (opts
, opts_set
, param_l1_cache_line_size
,
2791 ix86_tune_cost
->prefetch_block
);
2792 SET_OPTION_IF_UNSET (opts
, opts_set
, param_l1_cache_size
,
2793 ix86_tune_cost
->l1_cache_size
);
2794 SET_OPTION_IF_UNSET (opts
, opts_set
, param_l2_cache_size
,
2795 ix86_tune_cost
->l2_cache_size
);
2797 /* Enable sw prefetching at -O3 for CPUS that prefetching is helpful. */
2798 if (opts
->x_flag_prefetch_loop_arrays
< 0
2800 && (opts
->x_optimize
>= 3 || opts
->x_flag_profile_use
)
2801 && !opts
->x_optimize_size
2802 && TARGET_SOFTWARE_PREFETCHING_BENEFICIAL
)
2803 opts
->x_flag_prefetch_loop_arrays
= 1;
2805 /* If using typedef char *va_list, signal that __builtin_va_start (&ap, 0)
2806 can be opts->x_optimized to ap = __builtin_next_arg (0). */
2807 if (!TARGET_64BIT_P (opts
->x_ix86_isa_flags
) && !opts
->x_flag_split_stack
)
2808 targetm
.expand_builtin_va_start
= NULL
;
2811 /* Use -mcld by default for 32-bit code if configured with --enable-cld. */
2812 if (!TARGET_64BIT_P (opts
->x_ix86_isa_flags
))
2813 opts
->x_target_flags
|= MASK_CLD
& ~opts_set
->x_target_flags
;
2816 /* Set the default value for -mfentry. */
2817 if (!opts_set
->x_flag_fentry
)
2818 opts
->x_flag_fentry
= TARGET_SEH
;
2821 if (!TARGET_64BIT_P (opts
->x_ix86_isa_flags
) && opts
->x_flag_pic
2822 && opts
->x_flag_fentry
)
2823 sorry ("%<-mfentry%> isn%'t supported for 32-bit in combination "
2825 else if (TARGET_SEH
&& !opts
->x_flag_fentry
)
2826 sorry ("%<-mno-fentry%> isn%'t compatible with SEH");
2829 if (TARGET_SEH
&& TARGET_CALL_MS2SYSV_XLOGUES
)
2830 sorry ("%<-mcall-ms2sysv-xlogues%> isn%'t currently supported with SEH");
2832 if (!(opts_set
->x_target_flags
& MASK_VZEROUPPER
)
2833 && TARGET_EMIT_VZEROUPPER
)
2834 opts
->x_target_flags
|= MASK_VZEROUPPER
;
2835 if (!(opts_set
->x_target_flags
& MASK_STV
))
2836 opts
->x_target_flags
|= MASK_STV
;
2837 /* Disable STV if -mpreferred-stack-boundary={2,3} or
2838 -mincoming-stack-boundary={2,3} or -mstackrealign - the needed
2839 stack realignment will be extra cost the pass doesn't take into
2840 account and the pass can't realign the stack. */
2841 if (ix86_preferred_stack_boundary
< 128
2842 || ix86_incoming_stack_boundary
< 128
2843 || opts
->x_ix86_force_align_arg_pointer
)
2844 opts
->x_target_flags
&= ~MASK_STV
;
2845 if (!ix86_tune_features
[X86_TUNE_AVX256_UNALIGNED_LOAD_OPTIMAL
]
2846 && !(opts_set
->x_target_flags
& MASK_AVX256_SPLIT_UNALIGNED_LOAD
))
2847 opts
->x_target_flags
|= MASK_AVX256_SPLIT_UNALIGNED_LOAD
;
2848 if (!ix86_tune_features
[X86_TUNE_AVX256_UNALIGNED_STORE_OPTIMAL
]
2849 && !(opts_set
->x_target_flags
& MASK_AVX256_SPLIT_UNALIGNED_STORE
))
2850 opts
->x_target_flags
|= MASK_AVX256_SPLIT_UNALIGNED_STORE
;
2852 /* Enable 128-bit AVX instruction generation
2853 for the auto-vectorizer. */
2854 if (ix86_tune_features
[X86_TUNE_AVX128_OPTIMAL
]
2855 && (opts_set
->x_prefer_vector_width_type
== PVW_NONE
))
2856 opts
->x_prefer_vector_width_type
= PVW_AVX128
;
2858 /* Use 256-bit AVX instruction generation
2859 in the auto-vectorizer. */
2860 if (ix86_tune_features
[X86_TUNE_AVX256_OPTIMAL
]
2861 && (opts_set
->x_prefer_vector_width_type
== PVW_NONE
))
2862 opts
->x_prefer_vector_width_type
= PVW_AVX256
;
2864 if (opts
->x_ix86_recip_name
)
2866 char *p
= ASTRDUP (opts
->x_ix86_recip_name
);
2868 unsigned int mask
, i
;
2871 while ((q
= strtok (p
, ",")) != NULL
)
2882 if (!strcmp (q
, "default"))
2883 mask
= RECIP_MASK_ALL
;
2886 for (i
= 0; i
< ARRAY_SIZE (recip_options
); i
++)
2887 if (!strcmp (q
, recip_options
[i
].string
))
2889 mask
= recip_options
[i
].mask
;
2893 if (i
== ARRAY_SIZE (recip_options
))
2895 error ("unknown option for %<-mrecip=%s%>", q
);
2897 mask
= RECIP_MASK_NONE
;
2901 opts
->x_recip_mask_explicit
|= mask
;
2903 opts
->x_recip_mask
&= ~mask
;
2905 opts
->x_recip_mask
|= mask
;
2909 if (TARGET_RECIP_P (opts
->x_target_flags
))
2910 opts
->x_recip_mask
|= RECIP_MASK_ALL
& ~opts
->x_recip_mask_explicit
;
2911 else if (opts_set
->x_target_flags
& MASK_RECIP
)
2912 opts
->x_recip_mask
&= ~(RECIP_MASK_ALL
& ~opts
->x_recip_mask_explicit
);
2914 /* Default long double to 64-bit for 32-bit Bionic and to __float128
2915 for 64-bit Bionic. Also default long double to 64-bit for Intel
2917 if ((TARGET_HAS_BIONIC
|| TARGET_IAMCU
)
2918 && !(opts_set
->x_target_flags
2919 & (MASK_LONG_DOUBLE_64
| MASK_LONG_DOUBLE_128
)))
2920 opts
->x_target_flags
|= (TARGET_64BIT
2921 ? MASK_LONG_DOUBLE_128
2922 : MASK_LONG_DOUBLE_64
);
2924 /* Only one of them can be active. */
2925 gcc_assert ((opts
->x_target_flags
& MASK_LONG_DOUBLE_64
) == 0
2926 || (opts
->x_target_flags
& MASK_LONG_DOUBLE_128
) == 0);
2928 /* Handle stack protector */
2929 if (!opts_set
->x_ix86_stack_protector_guard
)
2931 #ifdef TARGET_THREAD_SSP_OFFSET
2932 if (!TARGET_HAS_BIONIC
)
2933 opts
->x_ix86_stack_protector_guard
= SSP_TLS
;
2936 opts
->x_ix86_stack_protector_guard
= SSP_GLOBAL
;
2939 if (opts_set
->x_ix86_stack_protector_guard_offset_str
)
2942 const char *str
= opts
->x_ix86_stack_protector_guard_offset_str
;
2947 #if defined(INT64_T_IS_LONG)
2948 offset
= strtol (str
, &endp
, 0);
2950 offset
= strtoll (str
, &endp
, 0);
2953 if (!*str
|| *endp
|| errno
)
2954 error ("%qs is not a valid number "
2955 "in %<-mstack-protector-guard-offset=%>", str
);
2957 if (!IN_RANGE (offset
, HOST_WIDE_INT_C (-0x80000000),
2958 HOST_WIDE_INT_C (0x7fffffff)))
2959 error ("%qs is not a valid offset "
2960 "in %<-mstack-protector-guard-offset=%>", str
);
2962 opts
->x_ix86_stack_protector_guard_offset
= offset
;
2964 #ifdef TARGET_THREAD_SSP_OFFSET
2966 opts
->x_ix86_stack_protector_guard_offset
= TARGET_THREAD_SSP_OFFSET
;
2969 if (opts_set
->x_ix86_stack_protector_guard_reg_str
)
2971 const char *str
= opts
->x_ix86_stack_protector_guard_reg_str
;
2972 addr_space_t seg
= ADDR_SPACE_GENERIC
;
2974 /* Discard optional register prefix. */
2978 if (strlen (str
) == 2 && str
[1] == 's')
2981 seg
= ADDR_SPACE_SEG_FS
;
2982 else if (str
[0] == 'g')
2983 seg
= ADDR_SPACE_SEG_GS
;
2986 if (seg
== ADDR_SPACE_GENERIC
)
2987 error ("%qs is not a valid base register "
2988 "in %<-mstack-protector-guard-reg=%>",
2989 opts
->x_ix86_stack_protector_guard_reg_str
);
2991 opts
->x_ix86_stack_protector_guard_reg
= seg
;
2995 opts
->x_ix86_stack_protector_guard_reg
= DEFAULT_TLS_SEG_REG
;
2997 /* The kernel uses a different segment register for performance
2998 reasons; a system call would not have to trash the userspace
2999 segment register, which would be expensive. */
3000 if (opts
->x_ix86_cmodel
== CM_KERNEL
)
3001 opts
->x_ix86_stack_protector_guard_reg
= ADDR_SPACE_SEG_GS
;
3004 /* Handle -mmemcpy-strategy= and -mmemset-strategy= */
3005 if (opts
->x_ix86_tune_memcpy_strategy
)
3007 char *str
= xstrdup (opts
->x_ix86_tune_memcpy_strategy
);
3008 ix86_parse_stringop_strategy_string (str
, false);
3012 if (opts
->x_ix86_tune_memset_strategy
)
3014 char *str
= xstrdup (opts
->x_ix86_tune_memset_strategy
);
3015 ix86_parse_stringop_strategy_string (str
, true);
3019 /* Save the initial options in case the user does function specific
3022 target_option_default_node
= target_option_current_node
3023 = build_target_option_node (opts
, opts_set
);
3025 if (opts
->x_flag_cf_protection
!= CF_NONE
)
3026 opts
->x_flag_cf_protection
3027 = (cf_protection_level
) (opts
->x_flag_cf_protection
| CF_SET
);
3029 if (ix86_tune_features
[X86_TUNE_AVOID_256FMA_CHAINS
])
3030 SET_OPTION_IF_UNSET (opts
, opts_set
, param_avoid_fma_max_bits
, 256);
3031 else if (ix86_tune_features
[X86_TUNE_AVOID_128FMA_CHAINS
])
3032 SET_OPTION_IF_UNSET (opts
, opts_set
, param_avoid_fma_max_bits
, 128);
3034 /* PR86952: jump table usage with retpolines is slow.
3035 The PR provides some numbers about the slowness. */
3036 if (ix86_indirect_branch
!= indirect_branch_keep
)
3037 SET_OPTION_IF_UNSET (opts
, opts_set
, flag_jump_tables
, 0);
3042 /* Implement the TARGET_OPTION_OVERRIDE hook. */
3045 ix86_option_override (void)
3047 ix86_option_override_internal (true, &global_options
, &global_options_set
);
3050 /* Remember the last target of ix86_set_current_function. */
3051 static GTY(()) tree ix86_previous_fndecl
;
3053 /* Set targets globals to the default (or current #pragma GCC target
3054 if active). Invalidate ix86_previous_fndecl cache. */
3057 ix86_reset_previous_fndecl (void)
3059 tree new_tree
= target_option_current_node
;
3060 cl_target_option_restore (&global_options
, &global_options_set
,
3061 TREE_TARGET_OPTION (new_tree
));
3062 if (TREE_TARGET_GLOBALS (new_tree
))
3063 restore_target_globals (TREE_TARGET_GLOBALS (new_tree
));
3064 else if (new_tree
== target_option_default_node
)
3065 restore_target_globals (&default_target_globals
);
3067 TREE_TARGET_GLOBALS (new_tree
) = save_target_globals_default_opts ();
3068 ix86_previous_fndecl
= NULL_TREE
;
3071 /* Add target attribute to SIMD clone NODE if needed. */
3074 ix86_simd_clone_adjust (struct cgraph_node
*node
)
3076 const char *str
= NULL
;
3078 /* Attributes need to be adjusted for definitions, not declarations. */
3079 if (!node
->definition
)
3082 gcc_assert (node
->decl
== cfun
->decl
);
3083 switch (node
->simdclone
->vecsize_mangle
)
3090 if (TARGET_PREFER_AVX128
)
3093 str
= "avx,prefer-vector-width=256";
3095 str
= "prefer-vector-width=256";
3097 else if (!TARGET_AVX
)
3101 if (TARGET_PREFER_AVX128
)
3104 str
= "avx2,prefer-vector-width=256";
3106 str
= "prefer-vector-width=256";
3108 else if (!TARGET_AVX2
)
3112 if (TARGET_PREFER_AVX256
)
3114 if (!TARGET_AVX512F
)
3115 str
= "avx512f,prefer-vector-width=512";
3117 str
= "prefer-vector-width=512";
3119 else if (!TARGET_AVX512F
)
3128 tree args
= build_tree_list (NULL_TREE
, build_string (strlen (str
), str
));
3129 bool ok
= ix86_valid_target_attribute_p (node
->decl
, NULL
, args
, 0);
3132 ix86_reset_previous_fndecl ();
3133 ix86_set_current_function (node
->decl
);
3138 /* Set the func_type field from the function FNDECL. */
3141 ix86_set_func_type (tree fndecl
)
3143 if (cfun
->machine
->func_type
== TYPE_UNKNOWN
)
3145 if (lookup_attribute ("interrupt",
3146 TYPE_ATTRIBUTES (TREE_TYPE (fndecl
))))
3148 if (ix86_function_naked (fndecl
))
3149 error_at (DECL_SOURCE_LOCATION (fndecl
),
3150 "interrupt and naked attributes are not compatible");
3153 for (tree arg
= DECL_ARGUMENTS (fndecl
);
3155 arg
= TREE_CHAIN (arg
))
3157 cfun
->machine
->no_caller_saved_registers
= true;
3158 cfun
->machine
->func_type
3159 = nargs
== 2 ? TYPE_EXCEPTION
: TYPE_INTERRUPT
;
3161 ix86_optimize_mode_switching
[X86_DIRFLAG
] = 1;
3163 /* Only dwarf2out.c can handle -WORD(AP) as a pointer argument. */
3164 if (write_symbols
!= NO_DEBUG
&& write_symbols
!= DWARF2_DEBUG
)
3165 sorry ("only DWARF debug format is supported for interrupt "
3170 cfun
->machine
->func_type
= TYPE_NORMAL
;
3171 if (lookup_attribute ("no_caller_saved_registers",
3172 TYPE_ATTRIBUTES (TREE_TYPE (fndecl
))))
3173 cfun
->machine
->no_caller_saved_registers
= true;
3178 /* Set the indirect_branch_type field from the function FNDECL. */
3181 ix86_set_indirect_branch_type (tree fndecl
)
3183 if (cfun
->machine
->indirect_branch_type
== indirect_branch_unset
)
3185 tree attr
= lookup_attribute ("indirect_branch",
3186 DECL_ATTRIBUTES (fndecl
));
3189 tree args
= TREE_VALUE (attr
);
3192 tree cst
= TREE_VALUE (args
);
3193 if (strcmp (TREE_STRING_POINTER (cst
), "keep") == 0)
3194 cfun
->machine
->indirect_branch_type
= indirect_branch_keep
;
3195 else if (strcmp (TREE_STRING_POINTER (cst
), "thunk") == 0)
3196 cfun
->machine
->indirect_branch_type
= indirect_branch_thunk
;
3197 else if (strcmp (TREE_STRING_POINTER (cst
), "thunk-inline") == 0)
3198 cfun
->machine
->indirect_branch_type
= indirect_branch_thunk_inline
;
3199 else if (strcmp (TREE_STRING_POINTER (cst
), "thunk-extern") == 0)
3200 cfun
->machine
->indirect_branch_type
= indirect_branch_thunk_extern
;
3205 cfun
->machine
->indirect_branch_type
= ix86_indirect_branch
;
3207 /* -mcmodel=large is not compatible with -mindirect-branch=thunk
3208 nor -mindirect-branch=thunk-extern. */
3209 if ((ix86_cmodel
== CM_LARGE
|| ix86_cmodel
== CM_LARGE_PIC
)
3210 && ((cfun
->machine
->indirect_branch_type
3211 == indirect_branch_thunk_extern
)
3212 || (cfun
->machine
->indirect_branch_type
3213 == indirect_branch_thunk
)))
3214 error ("%<-mindirect-branch=%s%> and %<-mcmodel=large%> are not "
3216 ((cfun
->machine
->indirect_branch_type
3217 == indirect_branch_thunk_extern
)
3218 ? "thunk-extern" : "thunk"));
3220 if (cfun
->machine
->indirect_branch_type
!= indirect_branch_keep
3221 && (cfun
->machine
->indirect_branch_type
3222 != indirect_branch_thunk_extern
)
3223 && (flag_cf_protection
& CF_RETURN
))
3224 error ("%<-mindirect-branch%> and %<-fcf-protection%> are not "
3228 if (cfun
->machine
->function_return_type
== indirect_branch_unset
)
3230 tree attr
= lookup_attribute ("function_return",
3231 DECL_ATTRIBUTES (fndecl
));
3234 tree args
= TREE_VALUE (attr
);
3237 tree cst
= TREE_VALUE (args
);
3238 if (strcmp (TREE_STRING_POINTER (cst
), "keep") == 0)
3239 cfun
->machine
->function_return_type
= indirect_branch_keep
;
3240 else if (strcmp (TREE_STRING_POINTER (cst
), "thunk") == 0)
3241 cfun
->machine
->function_return_type
= indirect_branch_thunk
;
3242 else if (strcmp (TREE_STRING_POINTER (cst
), "thunk-inline") == 0)
3243 cfun
->machine
->function_return_type
= indirect_branch_thunk_inline
;
3244 else if (strcmp (TREE_STRING_POINTER (cst
), "thunk-extern") == 0)
3245 cfun
->machine
->function_return_type
= indirect_branch_thunk_extern
;
3250 cfun
->machine
->function_return_type
= ix86_function_return
;
3252 /* -mcmodel=large is not compatible with -mfunction-return=thunk
3253 nor -mfunction-return=thunk-extern. */
3254 if ((ix86_cmodel
== CM_LARGE
|| ix86_cmodel
== CM_LARGE_PIC
)
3255 && ((cfun
->machine
->function_return_type
3256 == indirect_branch_thunk_extern
)
3257 || (cfun
->machine
->function_return_type
3258 == indirect_branch_thunk
)))
3259 error ("%<-mfunction-return=%s%> and %<-mcmodel=large%> are not "
3261 ((cfun
->machine
->function_return_type
3262 == indirect_branch_thunk_extern
)
3263 ? "thunk-extern" : "thunk"));
3265 if (cfun
->machine
->function_return_type
!= indirect_branch_keep
3266 && (cfun
->machine
->function_return_type
3267 != indirect_branch_thunk_extern
)
3268 && (flag_cf_protection
& CF_RETURN
))
3269 error ("%<-mfunction-return%> and %<-fcf-protection%> are not "
3274 /* Establish appropriate back-end context for processing the function
3275 FNDECL. The argument might be NULL to indicate processing at top
3276 level, outside of any function scope. */
3278 ix86_set_current_function (tree fndecl
)
3280 /* Only change the context if the function changes. This hook is called
3281 several times in the course of compiling a function, and we don't want to
3282 slow things down too much or call target_reinit when it isn't safe. */
3283 if (fndecl
== ix86_previous_fndecl
)
3285 /* There may be 2 function bodies for the same function FNDECL,
3286 one is extern inline and one isn't. Call ix86_set_func_type
3287 to set the func_type field. */
3288 if (fndecl
!= NULL_TREE
)
3290 ix86_set_func_type (fndecl
);
3291 ix86_set_indirect_branch_type (fndecl
);
3297 if (ix86_previous_fndecl
== NULL_TREE
)
3298 old_tree
= target_option_current_node
;
3299 else if (DECL_FUNCTION_SPECIFIC_TARGET (ix86_previous_fndecl
))
3300 old_tree
= DECL_FUNCTION_SPECIFIC_TARGET (ix86_previous_fndecl
);
3302 old_tree
= target_option_default_node
;
3304 if (fndecl
== NULL_TREE
)
3306 if (old_tree
!= target_option_current_node
)
3307 ix86_reset_previous_fndecl ();
3311 ix86_set_func_type (fndecl
);
3312 ix86_set_indirect_branch_type (fndecl
);
3314 tree new_tree
= DECL_FUNCTION_SPECIFIC_TARGET (fndecl
);
3315 if (new_tree
== NULL_TREE
)
3316 new_tree
= target_option_default_node
;
3318 if (old_tree
!= new_tree
)
3320 cl_target_option_restore (&global_options
, &global_options_set
,
3321 TREE_TARGET_OPTION (new_tree
));
3322 if (TREE_TARGET_GLOBALS (new_tree
))
3323 restore_target_globals (TREE_TARGET_GLOBALS (new_tree
));
3324 else if (new_tree
== target_option_default_node
)
3325 restore_target_globals (&default_target_globals
);
3327 TREE_TARGET_GLOBALS (new_tree
) = save_target_globals_default_opts ();
3329 ix86_previous_fndecl
= fndecl
;
3331 static bool prev_no_caller_saved_registers
;
3333 /* 64-bit MS and SYSV ABI have different set of call used registers.
3334 Avoid expensive re-initialization of init_regs each time we switch
3335 function context. */
3337 && (call_used_or_fixed_reg_p (SI_REG
)
3338 == (cfun
->machine
->call_abi
== MS_ABI
)))
3340 /* Need to re-initialize init_regs if caller-saved registers are
3342 else if (prev_no_caller_saved_registers
3343 != cfun
->machine
->no_caller_saved_registers
)
3346 if (cfun
->machine
->func_type
!= TYPE_NORMAL
3347 || cfun
->machine
->no_caller_saved_registers
)
3349 /* Don't allow SSE, MMX nor x87 instructions since they
3350 may change processor state. */
3354 else if (TARGET_MMX
)
3356 else if (TARGET_80387
)
3362 if (cfun
->machine
->func_type
!= TYPE_NORMAL
)
3363 sorry (cfun
->machine
->func_type
== TYPE_EXCEPTION
3364 ? G_("%s instructions aren%'t allowed in an"
3365 " exception service routine")
3366 : G_("%s instructions aren%'t allowed in an"
3367 " interrupt service routine"),
3370 sorry ("%s instructions aren%'t allowed in a function with "
3371 "the %<no_caller_saved_registers%> attribute", isa
);
3372 /* Don't issue the same error twice. */
3373 cfun
->machine
->func_type
= TYPE_NORMAL
;
3374 cfun
->machine
->no_caller_saved_registers
= false;
3378 prev_no_caller_saved_registers
3379 = cfun
->machine
->no_caller_saved_registers
;
3382 /* Implement the TARGET_OFFLOAD_OPTIONS hook. */
3384 ix86_offload_options (void)
3387 return xstrdup ("-foffload-abi=lp64");
3388 return xstrdup ("-foffload-abi=ilp32");
3391 /* Handle "cdecl", "stdcall", "fastcall", "regparm", "thiscall",
3392 and "sseregparm" calling convention attributes;
3393 arguments as in struct attribute_spec.handler. */
3396 ix86_handle_cconv_attribute (tree
*node
, tree name
, tree args
, int,
3399 if (TREE_CODE (*node
) != FUNCTION_TYPE
3400 && TREE_CODE (*node
) != METHOD_TYPE
3401 && TREE_CODE (*node
) != FIELD_DECL
3402 && TREE_CODE (*node
) != TYPE_DECL
)
3404 warning (OPT_Wattributes
, "%qE attribute only applies to functions",
3406 *no_add_attrs
= true;
3410 /* Can combine regparm with all attributes but fastcall, and thiscall. */
3411 if (is_attribute_p ("regparm", name
))
3415 if (lookup_attribute ("fastcall", TYPE_ATTRIBUTES (*node
)))
3417 error ("fastcall and regparm attributes are not compatible");
3420 if (lookup_attribute ("thiscall", TYPE_ATTRIBUTES (*node
)))
3422 error ("regparam and thiscall attributes are not compatible");
3425 cst
= TREE_VALUE (args
);
3426 if (TREE_CODE (cst
) != INTEGER_CST
)
3428 warning (OPT_Wattributes
,
3429 "%qE attribute requires an integer constant argument",
3431 *no_add_attrs
= true;
3433 else if (compare_tree_int (cst
, REGPARM_MAX
) > 0)
3435 warning (OPT_Wattributes
, "argument to %qE attribute larger than %d",
3437 *no_add_attrs
= true;
3445 /* Do not warn when emulating the MS ABI. */
3446 if ((TREE_CODE (*node
) != FUNCTION_TYPE
3447 && TREE_CODE (*node
) != METHOD_TYPE
)
3448 || ix86_function_type_abi (*node
) != MS_ABI
)
3449 warning (OPT_Wattributes
, "%qE attribute ignored",
3451 *no_add_attrs
= true;
3455 /* Can combine fastcall with stdcall (redundant) and sseregparm. */
3456 if (is_attribute_p ("fastcall", name
))
3458 if (lookup_attribute ("cdecl", TYPE_ATTRIBUTES (*node
)))
3460 error ("fastcall and cdecl attributes are not compatible");
3462 if (lookup_attribute ("stdcall", TYPE_ATTRIBUTES (*node
)))
3464 error ("fastcall and stdcall attributes are not compatible");
3466 if (lookup_attribute ("regparm", TYPE_ATTRIBUTES (*node
)))
3468 error ("fastcall and regparm attributes are not compatible");
3470 if (lookup_attribute ("thiscall", TYPE_ATTRIBUTES (*node
)))
3472 error ("fastcall and thiscall attributes are not compatible");
3476 /* Can combine stdcall with fastcall (redundant), regparm and
3478 else if (is_attribute_p ("stdcall", name
))
3480 if (lookup_attribute ("cdecl", TYPE_ATTRIBUTES (*node
)))
3482 error ("stdcall and cdecl attributes are not compatible");
3484 if (lookup_attribute ("fastcall", TYPE_ATTRIBUTES (*node
)))
3486 error ("stdcall and fastcall attributes are not compatible");
3488 if (lookup_attribute ("thiscall", TYPE_ATTRIBUTES (*node
)))
3490 error ("stdcall and thiscall attributes are not compatible");
3494 /* Can combine cdecl with regparm and sseregparm. */
3495 else if (is_attribute_p ("cdecl", name
))
3497 if (lookup_attribute ("stdcall", TYPE_ATTRIBUTES (*node
)))
3499 error ("stdcall and cdecl attributes are not compatible");
3501 if (lookup_attribute ("fastcall", TYPE_ATTRIBUTES (*node
)))
3503 error ("fastcall and cdecl attributes are not compatible");
3505 if (lookup_attribute ("thiscall", TYPE_ATTRIBUTES (*node
)))
3507 error ("cdecl and thiscall attributes are not compatible");
3510 else if (is_attribute_p ("thiscall", name
))
3512 if (TREE_CODE (*node
) != METHOD_TYPE
&& pedantic
)
3513 warning (OPT_Wattributes
, "%qE attribute is used for non-class method",
3515 if (lookup_attribute ("stdcall", TYPE_ATTRIBUTES (*node
)))
3517 error ("stdcall and thiscall attributes are not compatible");
3519 if (lookup_attribute ("fastcall", TYPE_ATTRIBUTES (*node
)))
3521 error ("fastcall and thiscall attributes are not compatible");
3523 if (lookup_attribute ("cdecl", TYPE_ATTRIBUTES (*node
)))
3525 error ("cdecl and thiscall attributes are not compatible");
3529 /* Can combine sseregparm with all attributes. */
3534 #ifndef CHECK_STACK_LIMIT
3535 #define CHECK_STACK_LIMIT (-1)
3538 /* The transactional memory builtins are implicitly regparm or fastcall
3539 depending on the ABI. Override the generic do-nothing attribute that
3540 these builtins were declared with, and replace it with one of the two
3541 attributes that we expect elsewhere. */
3544 ix86_handle_tm_regparm_attribute (tree
*node
, tree
, tree
,
3545 int flags
, bool *no_add_attrs
)
3549 /* In no case do we want to add the placeholder attribute. */
3550 *no_add_attrs
= true;
3552 /* The 64-bit ABI is unchanged for transactional memory. */
3556 /* ??? Is there a better way to validate 32-bit windows? We have
3557 cfun->machine->call_abi, but that seems to be set only for 64-bit. */
3558 if (CHECK_STACK_LIMIT
> 0)
3559 alt
= tree_cons (get_identifier ("fastcall"), NULL
, NULL
);
3562 alt
= tree_cons (NULL
, build_int_cst (NULL
, 2), NULL
);
3563 alt
= tree_cons (get_identifier ("regparm"), alt
, NULL
);
3565 decl_attributes (node
, alt
, flags
);
3570 /* Handle a "force_align_arg_pointer" attribute. */
3573 ix86_handle_force_align_arg_pointer_attribute (tree
*node
, tree name
,
3574 tree
, int, bool *no_add_attrs
)
3576 if (TREE_CODE (*node
) != FUNCTION_TYPE
3577 && TREE_CODE (*node
) != METHOD_TYPE
3578 && TREE_CODE (*node
) != FIELD_DECL
3579 && TREE_CODE (*node
) != TYPE_DECL
)
3581 warning (OPT_Wattributes
, "%qE attribute only applies to functions",
3583 *no_add_attrs
= true;
3589 /* Handle a "ms_struct" or "gcc_struct" attribute; arguments as in
3590 struct attribute_spec.handler. */
3593 ix86_handle_struct_attribute (tree
*node
, tree name
, tree
, int,
3599 if (TREE_CODE (*node
) == TYPE_DECL
)
3600 type
= &TREE_TYPE (*node
);
3605 if (!(type
&& RECORD_OR_UNION_TYPE_P (*type
)))
3607 warning (OPT_Wattributes
, "%qE attribute ignored",
3609 *no_add_attrs
= true;
3612 else if ((is_attribute_p ("ms_struct", name
)
3613 && lookup_attribute ("gcc_struct", TYPE_ATTRIBUTES (*type
)))
3614 || ((is_attribute_p ("gcc_struct", name
)
3615 && lookup_attribute ("ms_struct", TYPE_ATTRIBUTES (*type
)))))
3617 warning (OPT_Wattributes
, "%qE incompatible attribute ignored",
3619 *no_add_attrs
= true;
3625 /* Handle a "callee_pop_aggregate_return" attribute; arguments as
3626 in struct attribute_spec handler. */
3629 ix86_handle_callee_pop_aggregate_return (tree
*node
, tree name
, tree args
, int,
3632 if (TREE_CODE (*node
) != FUNCTION_TYPE
3633 && TREE_CODE (*node
) != METHOD_TYPE
3634 && TREE_CODE (*node
) != FIELD_DECL
3635 && TREE_CODE (*node
) != TYPE_DECL
)
3637 warning (OPT_Wattributes
, "%qE attribute only applies to functions",
3639 *no_add_attrs
= true;
3644 warning (OPT_Wattributes
, "%qE attribute only available for 32-bit",
3646 *no_add_attrs
= true;
3649 if (is_attribute_p ("callee_pop_aggregate_return", name
))
3653 cst
= TREE_VALUE (args
);
3654 if (TREE_CODE (cst
) != INTEGER_CST
)
3656 warning (OPT_Wattributes
,
3657 "%qE attribute requires an integer constant argument",
3659 *no_add_attrs
= true;
3661 else if (compare_tree_int (cst
, 0) != 0
3662 && compare_tree_int (cst
, 1) != 0)
3664 warning (OPT_Wattributes
,
3665 "argument to %qE attribute is neither zero, nor one",
3667 *no_add_attrs
= true;
3676 /* Handle a "ms_abi" or "sysv" attribute; arguments as in
3677 struct attribute_spec.handler. */
3680 ix86_handle_abi_attribute (tree
*node
, tree name
, tree
, int,
3683 if (TREE_CODE (*node
) != FUNCTION_TYPE
3684 && TREE_CODE (*node
) != METHOD_TYPE
3685 && TREE_CODE (*node
) != FIELD_DECL
3686 && TREE_CODE (*node
) != TYPE_DECL
)
3688 warning (OPT_Wattributes
, "%qE attribute only applies to functions",
3690 *no_add_attrs
= true;
3694 /* Can combine regparm with all attributes but fastcall. */
3695 if (is_attribute_p ("ms_abi", name
))
3697 if (lookup_attribute ("sysv_abi", TYPE_ATTRIBUTES (*node
)))
3699 error ("%qs and %qs attributes are not compatible",
3700 "ms_abi", "sysv_abi");
3705 else if (is_attribute_p ("sysv_abi", name
))
3707 if (lookup_attribute ("ms_abi", TYPE_ATTRIBUTES (*node
)))
3709 error ("%qs and %qs attributes are not compatible",
3710 "ms_abi", "sysv_abi");
3720 ix86_handle_fndecl_attribute (tree
*node
, tree name
, tree args
, int,
3723 if (TREE_CODE (*node
) != FUNCTION_DECL
)
3725 warning (OPT_Wattributes
, "%qE attribute only applies to functions",
3727 *no_add_attrs
= true;
3730 if (is_attribute_p ("indirect_branch", name
))
3732 tree cst
= TREE_VALUE (args
);
3733 if (TREE_CODE (cst
) != STRING_CST
)
3735 warning (OPT_Wattributes
,
3736 "%qE attribute requires a string constant argument",
3738 *no_add_attrs
= true;
3740 else if (strcmp (TREE_STRING_POINTER (cst
), "keep") != 0
3741 && strcmp (TREE_STRING_POINTER (cst
), "thunk") != 0
3742 && strcmp (TREE_STRING_POINTER (cst
), "thunk-inline") != 0
3743 && strcmp (TREE_STRING_POINTER (cst
), "thunk-extern") != 0)
3745 warning (OPT_Wattributes
,
3746 "argument to %qE attribute is not "
3747 "(keep|thunk|thunk-inline|thunk-extern)", name
);
3748 *no_add_attrs
= true;
3752 if (is_attribute_p ("function_return", name
))
3754 tree cst
= TREE_VALUE (args
);
3755 if (TREE_CODE (cst
) != STRING_CST
)
3757 warning (OPT_Wattributes
,
3758 "%qE attribute requires a string constant argument",
3760 *no_add_attrs
= true;
3762 else if (strcmp (TREE_STRING_POINTER (cst
), "keep") != 0
3763 && strcmp (TREE_STRING_POINTER (cst
), "thunk") != 0
3764 && strcmp (TREE_STRING_POINTER (cst
), "thunk-inline") != 0
3765 && strcmp (TREE_STRING_POINTER (cst
), "thunk-extern") != 0)
3767 warning (OPT_Wattributes
,
3768 "argument to %qE attribute is not "
3769 "(keep|thunk|thunk-inline|thunk-extern)", name
);
3770 *no_add_attrs
= true;
3778 ix86_handle_no_caller_saved_registers_attribute (tree
*, tree
, tree
,
3785 ix86_handle_interrupt_attribute (tree
*node
, tree
, tree
, int, bool *)
3787 /* DECL_RESULT and DECL_ARGUMENTS do not exist there yet,
3788 but the function type contains args and return type data. */
3789 tree func_type
= *node
;
3790 tree return_type
= TREE_TYPE (func_type
);
3793 tree current_arg_type
= TYPE_ARG_TYPES (func_type
);
3794 while (current_arg_type
3795 && ! VOID_TYPE_P (TREE_VALUE (current_arg_type
)))
3799 if (! POINTER_TYPE_P (TREE_VALUE (current_arg_type
)))
3800 error ("interrupt service routine should have a pointer "
3801 "as the first argument");
3803 else if (nargs
== 1)
3805 if (TREE_CODE (TREE_VALUE (current_arg_type
)) != INTEGER_TYPE
3806 || TYPE_MODE (TREE_VALUE (current_arg_type
)) != word_mode
)
3807 error ("interrupt service routine should have %qs "
3808 "as the second argument",
3810 ? (TARGET_X32
? "unsigned long long int"
3811 : "unsigned long int")
3815 current_arg_type
= TREE_CHAIN (current_arg_type
);
3817 if (!nargs
|| nargs
> 2)
3818 error ("interrupt service routine can only have a pointer argument "
3819 "and an optional integer argument");
3820 if (! VOID_TYPE_P (return_type
))
3821 error ("interrupt service routine must return %<void%>");
3826 /* Handle fentry_name / fentry_section attribute. */
3829 ix86_handle_fentry_name (tree
*node
, tree name
, tree args
,
3830 int, bool *no_add_attrs
)
3832 if (TREE_CODE (*node
) == FUNCTION_DECL
3833 && TREE_CODE (TREE_VALUE (args
)) == STRING_CST
)
3834 /* Do nothing else, just set the attribute. We'll get at
3835 it later with lookup_attribute. */
3839 warning (OPT_Wattributes
, "%qE attribute ignored", name
);
3840 *no_add_attrs
= true;
3846 /* Table of valid machine attributes. */
3847 const struct attribute_spec ix86_attribute_table
[] =
3849 /* { name, min_len, max_len, decl_req, type_req, fn_type_req,
3850 affects_type_identity, handler, exclude } */
3851 /* Stdcall attribute says callee is responsible for popping arguments
3852 if they are not variable. */
3853 { "stdcall", 0, 0, false, true, true, true, ix86_handle_cconv_attribute
,
3855 /* Fastcall attribute says callee is responsible for popping arguments
3856 if they are not variable. */
3857 { "fastcall", 0, 0, false, true, true, true, ix86_handle_cconv_attribute
,
3859 /* Thiscall attribute says callee is responsible for popping arguments
3860 if they are not variable. */
3861 { "thiscall", 0, 0, false, true, true, true, ix86_handle_cconv_attribute
,
3863 /* Cdecl attribute says the callee is a normal C declaration */
3864 { "cdecl", 0, 0, false, true, true, true, ix86_handle_cconv_attribute
,
3866 /* Regparm attribute specifies how many integer arguments are to be
3867 passed in registers. */
3868 { "regparm", 1, 1, false, true, true, true, ix86_handle_cconv_attribute
,
3870 /* Sseregparm attribute says we are using x86_64 calling conventions
3871 for FP arguments. */
3872 { "sseregparm", 0, 0, false, true, true, true, ix86_handle_cconv_attribute
,
3874 /* The transactional memory builtins are implicitly regparm or fastcall
3875 depending on the ABI. Override the generic do-nothing attribute that
3876 these builtins were declared with. */
3877 { "*tm regparm", 0, 0, false, true, true, true,
3878 ix86_handle_tm_regparm_attribute
, NULL
},
3879 /* force_align_arg_pointer says this function realigns the stack at entry. */
3880 { "force_align_arg_pointer", 0, 0,
3881 false, true, true, false, ix86_handle_force_align_arg_pointer_attribute
,
3883 #if TARGET_DLLIMPORT_DECL_ATTRIBUTES
3884 { "dllimport", 0, 0, false, false, false, false, handle_dll_attribute
,
3886 { "dllexport", 0, 0, false, false, false, false, handle_dll_attribute
,
3888 { "shared", 0, 0, true, false, false, false,
3889 ix86_handle_shared_attribute
, NULL
},
3891 { "ms_struct", 0, 0, false, false, false, false,
3892 ix86_handle_struct_attribute
, NULL
},
3893 { "gcc_struct", 0, 0, false, false, false, false,
3894 ix86_handle_struct_attribute
, NULL
},
3895 #ifdef SUBTARGET_ATTRIBUTE_TABLE
3896 SUBTARGET_ATTRIBUTE_TABLE
,
3898 /* ms_abi and sysv_abi calling convention function attributes. */
3899 { "ms_abi", 0, 0, false, true, true, true, ix86_handle_abi_attribute
, NULL
},
3900 { "sysv_abi", 0, 0, false, true, true, true, ix86_handle_abi_attribute
,
3902 { "ms_abi va_list", 0, 0, false, false, false, false, NULL
, NULL
},
3903 { "sysv_abi va_list", 0, 0, false, false, false, false, NULL
, NULL
},
3904 { "ms_hook_prologue", 0, 0, true, false, false, false,
3905 ix86_handle_fndecl_attribute
, NULL
},
3906 { "callee_pop_aggregate_return", 1, 1, false, true, true, true,
3907 ix86_handle_callee_pop_aggregate_return
, NULL
},
3908 { "interrupt", 0, 0, false, true, true, false,
3909 ix86_handle_interrupt_attribute
, NULL
},
3910 { "no_caller_saved_registers", 0, 0, false, true, true, false,
3911 ix86_handle_no_caller_saved_registers_attribute
, NULL
},
3912 { "naked", 0, 0, true, false, false, false,
3913 ix86_handle_fndecl_attribute
, NULL
},
3914 { "indirect_branch", 1, 1, true, false, false, false,
3915 ix86_handle_fndecl_attribute
, NULL
},
3916 { "function_return", 1, 1, true, false, false, false,
3917 ix86_handle_fndecl_attribute
, NULL
},
3918 { "indirect_return", 0, 0, false, true, true, false,
3920 { "fentry_name", 1, 1, true, false, false, false,
3921 ix86_handle_fentry_name
, NULL
},
3922 { "fentry_section", 1, 1, true, false, false, false,
3923 ix86_handle_fentry_name
, NULL
},
3924 { "cf_check", 0, 0, true, false, false, false,
3925 ix86_handle_fndecl_attribute
, NULL
},
3928 { NULL
, 0, 0, false, false, false, false, NULL
, NULL
}
3931 #include "gt-i386-options.h"