]> git.ipfire.org Git - thirdparty/gcc.git/blame - gcc/config/i386/i386.h
Update copyright years.
[thirdparty/gcc.git] / gcc / config / i386 / i386.h
CommitLineData
188fc5b5 1/* Definitions of target machine for GCC for IA-32.
7adcbafe 2 Copyright (C) 1988-2022 Free Software Foundation, Inc.
c98f8742 3
188fc5b5 4This file is part of GCC.
c98f8742 5
188fc5b5 6GCC is free software; you can redistribute it and/or modify
c98f8742 7it under the terms of the GNU General Public License as published by
2f83c7d6 8the Free Software Foundation; either version 3, or (at your option)
c98f8742
JVA
9any later version.
10
188fc5b5 11GCC is distributed in the hope that it will be useful,
c98f8742
JVA
12but WITHOUT ANY WARRANTY; without even the implied warranty of
13MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14GNU General Public License for more details.
15
748086b7
JJ
16Under Section 7 of GPL version 3, you are granted additional
17permissions described in the GCC Runtime Library Exception, version
183.1, as published by the Free Software Foundation.
19
20You should have received a copy of the GNU General Public License and
21a copy of the GCC Runtime Library Exception along with this program;
22see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
2f83c7d6 23<http://www.gnu.org/licenses/>. */
c98f8742 24
ccf8e764
RH
25/* The purpose of this file is to define the characteristics of the i386,
26 independent of assembler syntax or operating system.
27
28 Three other files build on this one to describe a specific assembler syntax:
29 bsd386.h, att386.h, and sun386.h.
30
31 The actual tm.h file for a particular system should include
32 this file, and then the file for the appropriate assembler syntax.
33
34 Many macros that specify assembler syntax are omitted entirely from
35 this file because they really belong in the files for particular
36 assemblers. These include RP, IP, LPREFIX, PUT_OP_SIZE, USE_STAR,
37 ADDR_BEG, ADDR_END, PRINT_IREG, PRINT_SCALE, PRINT_B_I_S, and many
38 that start with ASM_ or end in ASM_OP. */
39
0a1c5e55
UB
40/* Redefines for option macros. */
41
1751bec0
ML
42#define TARGET_CMPXCHG16B TARGET_CX16
43#define TARGET_CMPXCHG16B_P(x) TARGET_CX16_P(x)
41a4ef22 44
1751bec0 45#define TARGET_LP64 TARGET_ABI_64
bf7b5747 46#define TARGET_LP64_P(x) TARGET_ABI_64_P(x)
1751bec0
ML
47#define TARGET_X32 TARGET_ABI_X32
48#define TARGET_X32_P(x) TARGET_ABI_X32_P(x)
49#define TARGET_16BIT TARGET_CODE16
d5d618b5 50#define TARGET_16BIT_P(x) TARGET_CODE16_P(x)
04e1d06b 51
dfa61b9e
L
52#define TARGET_MMX_WITH_SSE (TARGET_64BIT && TARGET_SSE2)
53
26b5109f
RS
54#include "config/vxworks-dummy.h"
55
7eb68c06 56#include "config/i386/i386-opts.h"
ccf8e764 57
c69fa2d4 58#define MAX_STRINGOP_ALGS 4
ccf8e764 59
8c996513
JH
60/* Specify what algorithm to use for stringops on known size.
61 When size is unknown, the UNKNOWN_SIZE alg is used. When size is
62 known at compile time or estimated via feedback, the SIZE array
63 is walked in order until MAX is greater then the estimate (or -1
4f3f76e6 64 means infinity). Corresponding ALG is used then.
340ef734
JH
65 When NOALIGN is true the code guaranting the alignment of the memory
66 block is skipped.
67
8c996513 68 For example initializer:
4f3f76e6 69 {{256, loop}, {-1, rep_prefix_4_byte}}
8c996513 70 will use loop for blocks smaller or equal to 256 bytes, rep prefix will
ccf8e764 71 be used otherwise. */
8c996513
JH
72struct stringop_algs
73{
74 const enum stringop_alg unknown_size;
75 const struct stringop_strategy {
f99f6eb5
IS
76 /* Several older compilers delete the default constructor because of the
77 const entries (see PR100246). Manually specifying a CTOR works around
78 this issue. Since this header is used by code compiled with the C
79 compiler we must guard the addition. */
80#ifdef __cplusplus
858d7ee1
JJ
81 constexpr
82 stringop_strategy (int _max = -1, enum stringop_alg _alg = libcall,
83 int _noalign = false)
f99f6eb5
IS
84 : max (_max), alg (_alg), noalign (_noalign) {}
85#endif
8c996513
JH
86 const int max;
87 const enum stringop_alg alg;
340ef734 88 int noalign;
c69fa2d4 89 } size [MAX_STRINGOP_ALGS];
8c996513
JH
90};
91
f8977166
RS
92/* Analog of COSTS_N_INSNS when optimizing for size. */
93#ifndef COSTS_N_BYTES
94#define COSTS_N_BYTES(N) ((N) * 2)
95#endif
96
d321551c
L
97/* Define the specific costs for a given cpu. NB: hard_register is used
98 by TARGET_REGISTER_MOVE_COST and TARGET_MEMORY_MOVE_COST to compute
99 hard register move costs by register allocator. Relative costs of
100 pseudo register load and store versus pseudo register moves in RTL
101 expressions for TARGET_RTX_COSTS can be different from relative
102 costs of hard registers to get the most efficient operations with
103 pseudo registers. */
d4ba09c0
SC
104
105struct processor_costs {
d321551c
L
106 /* Costs used by register allocator. integer->integer register move
107 cost is 2. */
108 struct
109 {
110 const int movzbl_load; /* cost of loading using movzbl */
111 const int int_load[3]; /* cost of loading integer registers
112 in QImode, HImode and SImode relative
113 to reg-reg move (2). */
114 const int int_store[3]; /* cost of storing integer register
115 in QImode, HImode and SImode */
116 const int fp_move; /* cost of reg,reg fld/fst */
117 const int fp_load[3]; /* cost of loading FP register
118 in SFmode, DFmode and XFmode */
119 const int fp_store[3]; /* cost of storing FP register
120 in SFmode, DFmode and XFmode */
121 const int mmx_move; /* cost of moving MMX register. */
122 const int mmx_load[2]; /* cost of loading MMX register
123 in SImode and DImode */
124 const int mmx_store[2]; /* cost of storing MMX register
125 in SImode and DImode */
126 const int xmm_move; /* cost of moving XMM register. */
127 const int ymm_move; /* cost of moving XMM register. */
128 const int zmm_move; /* cost of moving XMM register. */
129 const int sse_load[5]; /* cost of loading SSE register
130 in 32bit, 64bit, 128bit, 256bit and 512bit */
131 const int sse_store[5]; /* cost of storing SSE register
132 in SImode, DImode and TImode. */
133 const int sse_to_integer; /* cost of moving SSE register to integer. */
134 const int integer_to_sse; /* cost of moving integer register to SSE. */
00cb3494
L
135 const int mask_to_integer; /* cost of moving mask register to integer. */
136 const int integer_to_mask; /* cost of moving integer register to mask. */
137 const int mask_load[3]; /* cost of loading mask registers
138 in QImode, HImode and SImode. */
139 const int mask_store[3]; /* cost of storing mask register
140 in QImode, HImode and SImode. */
141 const int mask_move; /* cost of moving mask register. */
d321551c
L
142 } hard_register;
143
8b60264b
KG
144 const int add; /* cost of an add instruction */
145 const int lea; /* cost of a lea instruction */
146 const int shift_var; /* variable shift costs */
147 const int shift_const; /* constant shift costs */
f676971a 148 const int mult_init[5]; /* cost of starting a multiply
4977bab6 149 in QImode, HImode, SImode, DImode, TImode*/
8b60264b 150 const int mult_bit; /* cost of multiply per each bit set */
f676971a 151 const int divide[5]; /* cost of a divide/mod
4977bab6 152 in QImode, HImode, SImode, DImode, TImode*/
44cf5b6a
JH
153 int movsx; /* The cost of movsx operation. */
154 int movzx; /* The cost of movzx operation. */
8b60264b
KG
155 const int large_insn; /* insns larger than this cost more */
156 const int move_ratio; /* The threshold of number of scalar
ac775968 157 memory-to-memory move insns. */
25e22b19
L
158 const int clear_ratio; /* The threshold of number of scalar
159 memory clearing insns. */
8b60264b 160 const int int_load[3]; /* cost of loading integer registers
96e7ae40
JH
161 in QImode, HImode and SImode relative
162 to reg-reg move (2). */
8b60264b 163 const int int_store[3]; /* cost of storing integer register
96e7ae40 164 in QImode, HImode and SImode */
df41dbaf
JH
165 const int sse_load[5]; /* cost of loading SSE register
166 in 32bit, 64bit, 128bit, 256bit and 512bit */
df41dbaf 167 const int sse_store[5]; /* cost of storing SSE register
d321551c
L
168 in 32bit, 64bit, 128bit, 256bit and 512bit */
169 const int sse_unaligned_load[5];/* cost of unaligned load. */
df41dbaf 170 const int sse_unaligned_store[5];/* cost of unaligned store. */
d321551c
L
171 const int xmm_move, ymm_move, /* cost of moving XMM and YMM register. */
172 zmm_move;
66574c53 173 const int sse_to_integer; /* cost of moving SSE register to integer. */
a4fe6139
JH
174 const int gather_static, gather_per_elt; /* Cost of gather load is computed
175 as static + per_item * nelts. */
176 const int scatter_static, scatter_per_elt; /* Cost of gather store is
177 computed as static + per_item * nelts. */
46cb0441
ZD
178 const int l1_cache_size; /* size of l1 cache, in kilobytes. */
179 const int l2_cache_size; /* size of l2 cache, in kilobytes. */
f4365627
JH
180 const int prefetch_block; /* bytes moved to cache for prefetch. */
181 const int simultaneous_prefetches; /* number of parallel prefetch
182 operations. */
4977bab6 183 const int branch_cost; /* Default value for BRANCH_COST. */
229b303a
RS
184 const int fadd; /* cost of FADD and FSUB instructions. */
185 const int fmul; /* cost of FMUL instruction. */
186 const int fdiv; /* cost of FDIV instruction. */
187 const int fabs; /* cost of FABS instruction. */
188 const int fchs; /* cost of FCHS instruction. */
189 const int fsqrt; /* cost of FSQRT instruction. */
8c996513 190 /* Specify what algorithm
bee51209 191 to use for stringops on unknown size. */
c53c148c 192 const int sse_op; /* cost of cheap SSE instruction. */
6065f444
JH
193 const int addss; /* cost of ADDSS/SD SUBSS/SD instructions. */
194 const int mulss; /* cost of MULSS instructions. */
195 const int mulsd; /* cost of MULSD instructions. */
c53c148c
JH
196 const int fmass; /* cost of FMASS instructions. */
197 const int fmasd; /* cost of FMASD instructions. */
6065f444
JH
198 const int divss; /* cost of DIVSS instructions. */
199 const int divsd; /* cost of DIVSD instructions. */
200 const int sqrtss; /* cost of SQRTSS instructions. */
201 const int sqrtsd; /* cost of SQRTSD instructions. */
a813c280
JH
202 const int reassoc_int, reassoc_fp, reassoc_vec_int, reassoc_vec_fp;
203 /* Specify reassociation width for integer,
204 fp, vector integer and vector fp
205 operations. Generally should correspond
206 to number of instructions executed in
207 parallel. See also
208 ix86_reassociation_width. */
ad83025e 209 struct stringop_algs *memcpy, *memset;
e70444a8
HJ
210 const int cond_taken_branch_cost; /* Cost of taken branch for vectorizer
211 cost model. */
212 const int cond_not_taken_branch_cost;/* Cost of not taken branch for
213 vectorizer cost model. */
7dc58b50
ML
214
215 /* The "0:0:8" label alignment specified for some processors generates
216 secondary 8-byte alignment only for those label/jump/loop targets
217 which have primary alignment. */
218 const char *const align_loop; /* Loop alignment. */
219 const char *const align_jump; /* Jump alignment. */
220 const char *const align_label; /* Label alignment. */
221 const char *const align_func; /* Function alignment. */
d4ba09c0
SC
222};
223
8b60264b 224extern const struct processor_costs *ix86_cost;
b2077fd2
JH
225extern const struct processor_costs ix86_size_cost;
226
227#define ix86_cur_cost() \
228 (optimize_insn_for_size_p () ? &ix86_size_cost: ix86_cost)
d4ba09c0 229
c98f8742
JVA
230/* Macros used in the machine description to test the flags. */
231
b97de419 232/* configure can arrange to change it. */
e075ae69 233
35b528be 234#ifndef TARGET_CPU_DEFAULT
b97de419 235#define TARGET_CPU_DEFAULT PROCESSOR_GENERIC
10e9fecc 236#endif
35b528be 237
004d3859
GK
238#ifndef TARGET_FPMATH_DEFAULT
239#define TARGET_FPMATH_DEFAULT \
240 (TARGET_64BIT && TARGET_SSE ? FPMATH_SSE : FPMATH_387)
241#endif
242
bf7b5747
ST
243#ifndef TARGET_FPMATH_DEFAULT_P
244#define TARGET_FPMATH_DEFAULT_P(x) \
245 (TARGET_64BIT_P(x) && TARGET_SSE_P(x) ? FPMATH_SSE : FPMATH_387)
246#endif
247
c207fd99
L
248/* If the i387 is disabled or -miamcu is used , then do not return
249 values in it. */
250#define TARGET_FLOAT_RETURNS_IN_80387 \
251 (TARGET_FLOAT_RETURNS && TARGET_80387 && !TARGET_IAMCU)
252#define TARGET_FLOAT_RETURNS_IN_80387_P(x) \
253 (TARGET_FLOAT_RETURNS_P(x) && TARGET_80387_P(x) && !TARGET_IAMCU_P(x))
b08de47e 254
5791cc29
JT
255/* 64bit Sledgehammer mode. For libgcc2 we make sure this is a
256 compile-time constant. */
257#ifdef IN_LIBGCC2
6ac49599 258#undef TARGET_64BIT
5791cc29
JT
259#ifdef __x86_64__
260#define TARGET_64BIT 1
261#else
262#define TARGET_64BIT 0
263#endif
264#else
6ac49599
RS
265#ifndef TARGET_BI_ARCH
266#undef TARGET_64BIT
e49080ec 267#undef TARGET_64BIT_P
67adf6a9 268#if TARGET_64BIT_DEFAULT
0c2dc519 269#define TARGET_64BIT 1
e49080ec 270#define TARGET_64BIT_P(x) 1
0c2dc519
JH
271#else
272#define TARGET_64BIT 0
e49080ec 273#define TARGET_64BIT_P(x) 0
0c2dc519
JH
274#endif
275#endif
5791cc29 276#endif
25f94bb5 277
750054a2
CT
278#define HAS_LONG_COND_BRANCH 1
279#define HAS_LONG_UNCOND_BRANCH 1
280
f23881fc 281#define TARGET_CPU_P(CPU) (ix86_tune == PROCESSOR_ ## CPU)
a269a03c 282
80fd744f
RH
283/* Feature tests against the various tunings. */
284enum ix86_tune_indices {
4b8bc035 285#undef DEF_TUNE
3ad20bd4 286#define DEF_TUNE(tune, name, selector) tune,
4b8bc035
XDL
287#include "x86-tune.def"
288#undef DEF_TUNE
289X86_TUNE_LAST
80fd744f
RH
290};
291
ab442df7 292extern unsigned char ix86_tune_features[X86_TUNE_LAST];
80fd744f
RH
293
294#define TARGET_USE_LEAVE ix86_tune_features[X86_TUNE_USE_LEAVE]
295#define TARGET_PUSH_MEMORY ix86_tune_features[X86_TUNE_PUSH_MEMORY]
296#define TARGET_ZERO_EXTEND_WITH_AND \
297 ix86_tune_features[X86_TUNE_ZERO_EXTEND_WITH_AND]
80fd744f 298#define TARGET_UNROLL_STRLEN ix86_tune_features[X86_TUNE_UNROLL_STRLEN]
80fd744f
RH
299#define TARGET_BRANCH_PREDICTION_HINTS \
300 ix86_tune_features[X86_TUNE_BRANCH_PREDICTION_HINTS]
301#define TARGET_DOUBLE_WITH_ADD ix86_tune_features[X86_TUNE_DOUBLE_WITH_ADD]
302#define TARGET_USE_SAHF ix86_tune_features[X86_TUNE_USE_SAHF]
303#define TARGET_MOVX ix86_tune_features[X86_TUNE_MOVX]
304#define TARGET_PARTIAL_REG_STALL ix86_tune_features[X86_TUNE_PARTIAL_REG_STALL]
305#define TARGET_PARTIAL_FLAG_REG_STALL \
306 ix86_tune_features[X86_TUNE_PARTIAL_FLAG_REG_STALL]
7b38ee83
TJ
307#define TARGET_LCP_STALL \
308 ix86_tune_features[X86_TUNE_LCP_STALL]
80fd744f
RH
309#define TARGET_USE_HIMODE_FIOP ix86_tune_features[X86_TUNE_USE_HIMODE_FIOP]
310#define TARGET_USE_SIMODE_FIOP ix86_tune_features[X86_TUNE_USE_SIMODE_FIOP]
311#define TARGET_USE_MOV0 ix86_tune_features[X86_TUNE_USE_MOV0]
312#define TARGET_USE_CLTD ix86_tune_features[X86_TUNE_USE_CLTD]
313#define TARGET_USE_XCHGB ix86_tune_features[X86_TUNE_USE_XCHGB]
314#define TARGET_SPLIT_LONG_MOVES ix86_tune_features[X86_TUNE_SPLIT_LONG_MOVES]
315#define TARGET_READ_MODIFY_WRITE ix86_tune_features[X86_TUNE_READ_MODIFY_WRITE]
316#define TARGET_READ_MODIFY ix86_tune_features[X86_TUNE_READ_MODIFY]
317#define TARGET_PROMOTE_QImode ix86_tune_features[X86_TUNE_PROMOTE_QIMODE]
318#define TARGET_FAST_PREFIX ix86_tune_features[X86_TUNE_FAST_PREFIX]
319#define TARGET_SINGLE_STRINGOP ix86_tune_features[X86_TUNE_SINGLE_STRINGOP]
bf24f4ec
L
320#define TARGET_PREFER_KNOWN_REP_MOVSB_STOSB \
321 ix86_tune_features[X86_TUNE_PREFER_KNOWN_REP_MOVSB_STOSB]
5783ad0e
UB
322#define TARGET_MISALIGNED_MOVE_STRING_PRO_EPILOGUES \
323 ix86_tune_features[X86_TUNE_MISALIGNED_MOVE_STRING_PRO_EPILOGUES]
80fd744f
RH
324#define TARGET_QIMODE_MATH ix86_tune_features[X86_TUNE_QIMODE_MATH]
325#define TARGET_HIMODE_MATH ix86_tune_features[X86_TUNE_HIMODE_MATH]
326#define TARGET_PROMOTE_QI_REGS ix86_tune_features[X86_TUNE_PROMOTE_QI_REGS]
327#define TARGET_PROMOTE_HI_REGS ix86_tune_features[X86_TUNE_PROMOTE_HI_REGS]
d8b08ecd
UB
328#define TARGET_SINGLE_POP ix86_tune_features[X86_TUNE_SINGLE_POP]
329#define TARGET_DOUBLE_POP ix86_tune_features[X86_TUNE_DOUBLE_POP]
330#define TARGET_SINGLE_PUSH ix86_tune_features[X86_TUNE_SINGLE_PUSH]
331#define TARGET_DOUBLE_PUSH ix86_tune_features[X86_TUNE_DOUBLE_PUSH]
80fd744f
RH
332#define TARGET_INTEGER_DFMODE_MOVES \
333 ix86_tune_features[X86_TUNE_INTEGER_DFMODE_MOVES]
334#define TARGET_PARTIAL_REG_DEPENDENCY \
335 ix86_tune_features[X86_TUNE_PARTIAL_REG_DEPENDENCY]
336#define TARGET_SSE_PARTIAL_REG_DEPENDENCY \
337 ix86_tune_features[X86_TUNE_SSE_PARTIAL_REG_DEPENDENCY]
48b3caff
L
338#define TARGET_SSE_PARTIAL_REG_FP_CONVERTS_DEPENDENCY \
339 ix86_tune_features[X86_TUNE_SSE_PARTIAL_REG_FP_CONVERTS_DEPENDENCY]
340#define TARGET_SSE_PARTIAL_REG_CONVERTS_DEPENDENCY \
341 ix86_tune_features[X86_TUNE_SSE_PARTIAL_REG_CONVERTS_DEPENDENCY]
1133125e
HJ
342#define TARGET_SSE_UNALIGNED_LOAD_OPTIMAL \
343 ix86_tune_features[X86_TUNE_SSE_UNALIGNED_LOAD_OPTIMAL]
344#define TARGET_SSE_UNALIGNED_STORE_OPTIMAL \
345 ix86_tune_features[X86_TUNE_SSE_UNALIGNED_STORE_OPTIMAL]
346#define TARGET_SSE_PACKED_SINGLE_INSN_OPTIMAL \
347 ix86_tune_features[X86_TUNE_SSE_PACKED_SINGLE_INSN_OPTIMAL]
80fd744f
RH
348#define TARGET_SSE_SPLIT_REGS ix86_tune_features[X86_TUNE_SSE_SPLIT_REGS]
349#define TARGET_SSE_TYPELESS_STORES \
350 ix86_tune_features[X86_TUNE_SSE_TYPELESS_STORES]
351#define TARGET_SSE_LOAD0_BY_PXOR ix86_tune_features[X86_TUNE_SSE_LOAD0_BY_PXOR]
352#define TARGET_MEMORY_MISMATCH_STALL \
353 ix86_tune_features[X86_TUNE_MEMORY_MISMATCH_STALL]
354#define TARGET_PROLOGUE_USING_MOVE \
355 ix86_tune_features[X86_TUNE_PROLOGUE_USING_MOVE]
356#define TARGET_EPILOGUE_USING_MOVE \
357 ix86_tune_features[X86_TUNE_EPILOGUE_USING_MOVE]
358#define TARGET_SHIFT1 ix86_tune_features[X86_TUNE_SHIFT1]
359#define TARGET_USE_FFREEP ix86_tune_features[X86_TUNE_USE_FFREEP]
00fcb892
UB
360#define TARGET_INTER_UNIT_MOVES_TO_VEC \
361 ix86_tune_features[X86_TUNE_INTER_UNIT_MOVES_TO_VEC]
362#define TARGET_INTER_UNIT_MOVES_FROM_VEC \
363 ix86_tune_features[X86_TUNE_INTER_UNIT_MOVES_FROM_VEC]
364#define TARGET_INTER_UNIT_CONVERSIONS \
630ecd8d 365 ix86_tune_features[X86_TUNE_INTER_UNIT_CONVERSIONS]
80fd744f
RH
366#define TARGET_FOUR_JUMP_LIMIT ix86_tune_features[X86_TUNE_FOUR_JUMP_LIMIT]
367#define TARGET_SCHEDULE ix86_tune_features[X86_TUNE_SCHEDULE]
368#define TARGET_USE_BT ix86_tune_features[X86_TUNE_USE_BT]
369#define TARGET_USE_INCDEC ix86_tune_features[X86_TUNE_USE_INCDEC]
370#define TARGET_PAD_RETURNS ix86_tune_features[X86_TUNE_PAD_RETURNS]
e7ed95a2
L
371#define TARGET_PAD_SHORT_FUNCTION \
372 ix86_tune_features[X86_TUNE_PAD_SHORT_FUNCTION]
80fd744f
RH
373#define TARGET_EXT_80387_CONSTANTS \
374 ix86_tune_features[X86_TUNE_EXT_80387_CONSTANTS]
ddff69b9
MM
375#define TARGET_AVOID_VECTOR_DECODE \
376 ix86_tune_features[X86_TUNE_AVOID_VECTOR_DECODE]
a646aded
UB
377#define TARGET_TUNE_PROMOTE_HIMODE_IMUL \
378 ix86_tune_features[X86_TUNE_PROMOTE_HIMODE_IMUL]
ddff69b9
MM
379#define TARGET_SLOW_IMUL_IMM32_MEM \
380 ix86_tune_features[X86_TUNE_SLOW_IMUL_IMM32_MEM]
381#define TARGET_SLOW_IMUL_IMM8 ix86_tune_features[X86_TUNE_SLOW_IMUL_IMM8]
382#define TARGET_MOVE_M1_VIA_OR ix86_tune_features[X86_TUNE_MOVE_M1_VIA_OR]
383#define TARGET_NOT_UNPAIRABLE ix86_tune_features[X86_TUNE_NOT_UNPAIRABLE]
384#define TARGET_NOT_VECTORMODE ix86_tune_features[X86_TUNE_NOT_VECTORMODE]
54723b46
L
385#define TARGET_USE_VECTOR_FP_CONVERTS \
386 ix86_tune_features[X86_TUNE_USE_VECTOR_FP_CONVERTS]
354f84af
UB
387#define TARGET_USE_VECTOR_CONVERTS \
388 ix86_tune_features[X86_TUNE_USE_VECTOR_CONVERTS]
a4ef7f3e
ES
389#define TARGET_SLOW_PSHUFB \
390 ix86_tune_features[X86_TUNE_SLOW_PSHUFB]
8e0dc054
JJ
391#define TARGET_AVOID_4BYTE_PREFIXES \
392 ix86_tune_features[X86_TUNE_AVOID_4BYTE_PREFIXES]
f6aa5171
JH
393#define TARGET_USE_GATHER \
394 ix86_tune_features[X86_TUNE_USE_GATHER]
0dc41f28
WM
395#define TARGET_FUSE_CMP_AND_BRANCH_32 \
396 ix86_tune_features[X86_TUNE_FUSE_CMP_AND_BRANCH_32]
397#define TARGET_FUSE_CMP_AND_BRANCH_64 \
398 ix86_tune_features[X86_TUNE_FUSE_CMP_AND_BRANCH_64]
354f84af 399#define TARGET_FUSE_CMP_AND_BRANCH \
0dc41f28
WM
400 (TARGET_64BIT ? TARGET_FUSE_CMP_AND_BRANCH_64 \
401 : TARGET_FUSE_CMP_AND_BRANCH_32)
402#define TARGET_FUSE_CMP_AND_BRANCH_SOFLAGS \
403 ix86_tune_features[X86_TUNE_FUSE_CMP_AND_BRANCH_SOFLAGS]
404#define TARGET_FUSE_ALU_AND_BRANCH \
405 ix86_tune_features[X86_TUNE_FUSE_ALU_AND_BRANCH]
b6837b94 406#define TARGET_OPT_AGU ix86_tune_features[X86_TUNE_OPT_AGU]
9a7f94d7
L
407#define TARGET_AVOID_LEA_FOR_ADDR \
408 ix86_tune_features[X86_TUNE_AVOID_LEA_FOR_ADDR]
5d0878e7
JH
409#define TARGET_SOFTWARE_PREFETCHING_BENEFICIAL \
410 ix86_tune_features[X86_TUNE_SOFTWARE_PREFETCHING_BENEFICIAL]
586bbef1
HL
411#define TARGET_AVX256_SPLIT_REGS \
412 ix86_tune_features[X86_TUNE_AVX256_SPLIT_REGS]
55a2c322
VM
413#define TARGET_GENERAL_REGS_SSE_SPILL \
414 ix86_tune_features[X86_TUNE_GENERAL_REGS_SSE_SPILL]
6c72ea12
UB
415#define TARGET_AVOID_MEM_OPND_FOR_CMOVE \
416 ix86_tune_features[X86_TUNE_AVOID_MEM_OPND_FOR_CMOVE]
55805e54 417#define TARGET_SPLIT_MEM_OPND_FOR_FP_CONVERTS \
0f1d3965 418 ix86_tune_features[X86_TUNE_SPLIT_MEM_OPND_FOR_FP_CONVERTS]
2f62165d
GG
419#define TARGET_ADJUST_UNROLL \
420 ix86_tune_features[X86_TUNE_ADJUST_UNROLL]
374f5bf8
UB
421#define TARGET_AVOID_FALSE_DEP_FOR_BMI \
422 ix86_tune_features[X86_TUNE_AVOID_FALSE_DEP_FOR_BMI]
ca90b1ed
YR
423#define TARGET_ONE_IF_CONV_INSN \
424 ix86_tune_features[X86_TUNE_ONE_IF_CONV_INSN]
3c5e83d5 425#define TARGET_AVOID_MFENCE ix86_tune_features[X86_TUNE_AVOID_MFENCE]
348188bf
L
426#define TARGET_EMIT_VZEROUPPER \
427 ix86_tune_features[X86_TUNE_EMIT_VZEROUPPER]
da86c5af
HW
428#define TARGET_EXPAND_ABS \
429 ix86_tune_features[X86_TUNE_EXPAND_ABS]
97d51c17 430#define TARGET_V2DF_REDUCTION_PREFER_HADDPD \
431 ix86_tune_features[X86_TUNE_V2DF_REDUCTION_PREFER_HADDPD]
df7b0cc4 432
80fd744f
RH
433/* Feature tests against the various architecture variations. */
434enum ix86_arch_indices {
cef31f9c 435 X86_ARCH_CMOV,
80fd744f
RH
436 X86_ARCH_CMPXCHG,
437 X86_ARCH_CMPXCHG8B,
438 X86_ARCH_XADD,
439 X86_ARCH_BSWAP,
440
441 X86_ARCH_LAST
442};
4f3f76e6 443
ab442df7 444extern unsigned char ix86_arch_features[X86_ARCH_LAST];
80fd744f 445
cef31f9c 446#define TARGET_CMOV ix86_arch_features[X86_ARCH_CMOV]
80fd744f
RH
447#define TARGET_CMPXCHG ix86_arch_features[X86_ARCH_CMPXCHG]
448#define TARGET_CMPXCHG8B ix86_arch_features[X86_ARCH_CMPXCHG8B]
449#define TARGET_XADD ix86_arch_features[X86_ARCH_XADD]
450#define TARGET_BSWAP ix86_arch_features[X86_ARCH_BSWAP]
451
cef31f9c
UB
452/* For sane SSE instruction set generation we need fcomi instruction.
453 It is safe to enable all CMOVE instructions. Also, RDRAND intrinsic
454 expands to a sequence that includes conditional move. */
455#define TARGET_CMOVE (TARGET_CMOV || TARGET_SSE || TARGET_RDRND)
456
80fd744f
RH
457#define TARGET_FISTTP (TARGET_SSE3 && TARGET_80387)
458
08a4adcf
UB
459extern unsigned char ix86_prefetch_sse;
460#define TARGET_PREFETCH_SSE ix86_prefetch_sse
80fd744f 461
80fd744f
RH
462#define ASSEMBLER_DIALECT (ix86_asm_dialect)
463
464#define TARGET_SSE_MATH ((ix86_fpmath & FPMATH_SSE) != 0)
465#define TARGET_MIX_SSE_I387 \
466 ((ix86_fpmath & (FPMATH_SSE | FPMATH_387)) == (FPMATH_SSE | FPMATH_387))
467
5fa578f0
UB
468#define TARGET_HARD_SF_REGS (TARGET_80387 || TARGET_MMX || TARGET_SSE)
469#define TARGET_HARD_DF_REGS (TARGET_80387 || TARGET_SSE)
470#define TARGET_HARD_XF_REGS (TARGET_80387)
471
80fd744f
RH
472#define TARGET_GNU_TLS (ix86_tls_dialect == TLS_DIALECT_GNU)
473#define TARGET_GNU2_TLS (ix86_tls_dialect == TLS_DIALECT_GNU2)
474#define TARGET_ANY_GNU_TLS (TARGET_GNU_TLS || TARGET_GNU2_TLS)
d2af65b9 475#define TARGET_SUN_TLS 0
1ef45b77 476
67adf6a9
RH
477#ifndef TARGET_64BIT_DEFAULT
478#define TARGET_64BIT_DEFAULT 0
25f94bb5 479#endif
74dc3e94
RH
480#ifndef TARGET_TLS_DIRECT_SEG_REFS_DEFAULT
481#define TARGET_TLS_DIRECT_SEG_REFS_DEFAULT 0
482#endif
25f94bb5 483
e0ea8797
AH
484#define TARGET_SSP_GLOBAL_GUARD (ix86_stack_protector_guard == SSP_GLOBAL)
485#define TARGET_SSP_TLS_GUARD (ix86_stack_protector_guard == SSP_TLS)
486
79f5e442
ZD
487/* Fence to use after loop using storent. */
488
489extern tree x86_mfence;
490#define FENCE_FOLLOWING_MOVNT x86_mfence
491
0ed4a390
JL
492/* Once GDB has been enhanced to deal with functions without frame
493 pointers, we can change this to allow for elimination of
494 the frame pointer in leaf functions. */
495#define TARGET_DEFAULT 0
67adf6a9 496
0a1c5e55
UB
497/* Extra bits to force. */
498#define TARGET_SUBTARGET_DEFAULT 0
499#define TARGET_SUBTARGET_ISA_DEFAULT 0
500
501/* Extra bits to force on w/ 32-bit mode. */
502#define TARGET_SUBTARGET32_DEFAULT 0
503#define TARGET_SUBTARGET32_ISA_DEFAULT 0
504
ccf8e764
RH
505/* Extra bits to force on w/ 64-bit mode. */
506#define TARGET_SUBTARGET64_DEFAULT 0
8b131a8a
UB
507/* Enable MMX, SSE and SSE2 by default. */
508#define TARGET_SUBTARGET64_ISA_DEFAULT \
509 (OPTION_MASK_ISA_MMX | OPTION_MASK_ISA_SSE | OPTION_MASK_ISA_SSE2)
ccf8e764 510
fee3eacd
IS
511/* Replace MACH-O, ifdefs by in-line tests, where possible.
512 (a) Macros defined in config/i386/darwin.h */
b069de3b 513#define TARGET_MACHO 0
d308419c 514#define TARGET_MACHO_SYMBOL_STUBS 0
fee3eacd
IS
515#define MACHOPIC_ATT_STUB 0
516/* (b) Macros defined in config/darwin.h */
517#define MACHO_DYNAMIC_NO_PIC_P 0
518#define MACHOPIC_INDIRECT 0
519#define MACHOPIC_PURE 0
9005471b 520
5a579c3b
LE
521/* For the RDOS */
522#define TARGET_RDOS 0
523
9005471b 524/* For the Windows 64-bit ABI. */
7c800926
KT
525#define TARGET_64BIT_MS_ABI (TARGET_64BIT && ix86_cfun_abi () == MS_ABI)
526
6510e8bb
KT
527/* For the Windows 32-bit ABI. */
528#define TARGET_32BIT_MS_ABI (!TARGET_64BIT && ix86_cfun_abi () == MS_ABI)
529
f81c9774
RH
530/* This is re-defined by cygming.h. */
531#define TARGET_SEH 0
532
51212b32 533/* The default abi used by target. */
7c800926 534#define DEFAULT_ABI SYSV_ABI
ccf8e764 535
b8b3f0ca 536/* The default TLS segment register used by target. */
00402c94
RH
537#define DEFAULT_TLS_SEG_REG \
538 (TARGET_64BIT ? ADDR_SPACE_SEG_FS : ADDR_SPACE_SEG_GS)
b8b3f0ca 539
cc69336f
RH
540/* Subtargets may reset this to 1 in order to enable 96-bit long double
541 with the rounding mode forced to 53 bits. */
542#define TARGET_96_ROUND_53_LONG_DOUBLE 0
543
98ae96d2
PB
544#ifndef SUBTARGET_DRIVER_SELF_SPECS
545# define SUBTARGET_DRIVER_SELF_SPECS ""
546#endif
547
548#define DRIVER_SELF_SPECS SUBTARGET_DRIVER_SELF_SPECS
549
682cd442
GK
550/* -march=native handling only makes sense with compiler running on
551 an x86 or x86_64 chip. If changing this condition, also change
552 the condition in driver-i386.c. */
553#if defined(__i386__) || defined(__x86_64__)
fa959ce4
MM
554/* In driver-i386.c. */
555extern const char *host_detect_local_cpu (int argc, const char **argv);
556#define EXTRA_SPEC_FUNCTIONS \
557 { "local_cpu_detect", host_detect_local_cpu },
682cd442 558#define HAVE_LOCAL_CPU_DETECT
fa959ce4
MM
559#endif
560
8981c15b
JM
561#if TARGET_64BIT_DEFAULT
562#define OPT_ARCH64 "!m32"
563#define OPT_ARCH32 "m32"
564#else
f0ea7581
L
565#define OPT_ARCH64 "m64|mx32"
566#define OPT_ARCH32 "m64|mx32:;"
8981c15b
JM
567#endif
568
1cba2b96
EC
569/* Support for configure-time defaults of some command line options.
570 The order here is important so that -march doesn't squash the
571 tune or cpu values. */
ce998900 572#define OPTION_DEFAULT_SPECS \
da2d4c01 573 {"tune", "%{!mtune=*:%{!mcpu=*:%{!march=*:-mtune=%(VALUE)}}}" }, \
8981c15b
JM
574 {"tune_32", "%{" OPT_ARCH32 ":%{!mtune=*:%{!mcpu=*:%{!march=*:-mtune=%(VALUE)}}}}" }, \
575 {"tune_64", "%{" OPT_ARCH64 ":%{!mtune=*:%{!mcpu=*:%{!march=*:-mtune=%(VALUE)}}}}" }, \
ce998900 576 {"cpu", "%{!mtune=*:%{!mcpu=*:%{!march=*:-mtune=%(VALUE)}}}" }, \
8981c15b
JM
577 {"cpu_32", "%{" OPT_ARCH32 ":%{!mtune=*:%{!mcpu=*:%{!march=*:-mtune=%(VALUE)}}}}" }, \
578 {"cpu_64", "%{" OPT_ARCH64 ":%{!mtune=*:%{!mcpu=*:%{!march=*:-mtune=%(VALUE)}}}}" }, \
579 {"arch", "%{!march=*:-march=%(VALUE)}"}, \
580 {"arch_32", "%{" OPT_ARCH32 ":%{!march=*:-march=%(VALUE)}}"}, \
581 {"arch_64", "%{" OPT_ARCH64 ":%{!march=*:-march=%(VALUE)}}"},
7816bea0 582
241e1a89
SC
583/* Specs for the compiler proper */
584
628714d8 585#ifndef CC1_CPU_SPEC
eb5bb0fd 586#define CC1_CPU_SPEC_1 ""
fa959ce4 587
682cd442 588#ifndef HAVE_LOCAL_CPU_DETECT
fa959ce4
MM
589#define CC1_CPU_SPEC CC1_CPU_SPEC_1
590#else
cc11b924 591#define ARCH_ARG "%{" OPT_ARCH64 ":64;:32}"
fa959ce4 592#define CC1_CPU_SPEC CC1_CPU_SPEC_1 \
cc11b924
L
593"%{march=native:%>march=native %:local_cpu_detect(arch " ARCH_ARG ") \
594 %{!mtune=*:%>mtune=native %:local_cpu_detect(tune " ARCH_ARG ")}} \
595%{mtune=native:%>mtune=native %:local_cpu_detect(tune " ARCH_ARG ")}"
fa959ce4 596#endif
241e1a89 597#endif
c98f8742 598\f
30efe578 599/* Target CPU builtins. */
ab442df7
MM
600#define TARGET_CPU_CPP_BUILTINS() ix86_target_macros ()
601
602/* Target Pragmas. */
603#define REGISTER_TARGET_PRAGMAS() ix86_register_pragmas ()
30efe578 604
d253a6f7 605/* Target hooks for D language. */
b4c522fa 606#define TARGET_D_CPU_VERSIONS ix86_d_target_versions
3785d2b2 607#define TARGET_D_REGISTER_CPU_TARGET_INFO ix86_d_register_target_info
d253a6f7 608#define TARGET_D_HAS_STDCALL_CONVENTION ix86_d_has_stdcall_convention
b4c522fa 609
628714d8 610#ifndef CC1_SPEC
8015b78d 611#define CC1_SPEC "%(cc1_cpu) "
628714d8
RK
612#endif
613
614/* This macro defines names of additional specifications to put in the
615 specs that can be used in various specifications like CC1_SPEC. Its
616 definition is an initializer with a subgrouping for each command option.
bcd86433
SC
617
618 Each subgrouping contains a string constant, that defines the
188fc5b5 619 specification name, and a string constant that used by the GCC driver
bcd86433
SC
620 program.
621
622 Do not define this macro if it does not need to do anything. */
623
624#ifndef SUBTARGET_EXTRA_SPECS
625#define SUBTARGET_EXTRA_SPECS
626#endif
627
628#define EXTRA_SPECS \
628714d8 629 { "cc1_cpu", CC1_CPU_SPEC }, \
bcd86433
SC
630 SUBTARGET_EXTRA_SPECS
631\f
ce998900 632
8ce94e44
JM
633/* Whether to allow x87 floating-point arithmetic on MODE (one of
634 SFmode, DFmode and XFmode) in the current excess precision
635 configuration. */
b8cab8a5 636#define X87_ENABLE_ARITH(MODE) \
e401db7b
JJ
637 (ix86_unsafe_math_optimizations \
638 || ix86_excess_precision == EXCESS_PRECISION_FAST \
b8cab8a5 639 || (MODE) == XFmode)
8ce94e44
JM
640
641/* Likewise, whether to allow direct conversions from integer mode
642 IMODE (HImode, SImode or DImode) to MODE. */
643#define X87_ENABLE_FLOAT(MODE, IMODE) \
e401db7b
JJ
644 (ix86_unsafe_math_optimizations \
645 || ix86_excess_precision == EXCESS_PRECISION_FAST \
8ce94e44
JM
646 || (MODE) == XFmode \
647 || ((MODE) == DFmode && (IMODE) == SImode) \
648 || (IMODE) == HImode)
649
979c67a5
UB
650/* target machine storage layout */
651
65d9c0ab
JH
652#define SHORT_TYPE_SIZE 16
653#define INT_TYPE_SIZE 32
f0ea7581
L
654#define LONG_TYPE_SIZE (TARGET_X32 ? 32 : BITS_PER_WORD)
655#define POINTER_SIZE (TARGET_X32 ? 32 : BITS_PER_WORD)
a96ad348 656#define LONG_LONG_TYPE_SIZE 64
65d9c0ab 657#define FLOAT_TYPE_SIZE 32
65d9c0ab 658#define DOUBLE_TYPE_SIZE 64
a2a1ddb5
L
659#define LONG_DOUBLE_TYPE_SIZE \
660 (TARGET_LONG_DOUBLE_64 ? 64 : (TARGET_LONG_DOUBLE_128 ? 128 : 80))
979c67a5 661
c637141a 662#define WIDEST_HARDWARE_FP_SIZE 80
65d9c0ab 663
67adf6a9 664#if defined (TARGET_BI_ARCH) || TARGET_64BIT_DEFAULT
0c2dc519 665#define MAX_BITS_PER_WORD 64
0c2dc519
JH
666#else
667#define MAX_BITS_PER_WORD 32
0c2dc519
JH
668#endif
669
c98f8742
JVA
670/* Define this if most significant byte of a word is the lowest numbered. */
671/* That is true on the 80386. */
672
673#define BITS_BIG_ENDIAN 0
674
675/* Define this if most significant byte of a word is the lowest numbered. */
676/* That is not true on the 80386. */
677#define BYTES_BIG_ENDIAN 0
678
679/* Define this if most significant word of a multiword number is the lowest
680 numbered. */
681/* Not true for 80386 */
682#define WORDS_BIG_ENDIAN 0
683
c98f8742 684/* Width of a word, in units (bytes). */
4ae8027b 685#define UNITS_PER_WORD (TARGET_64BIT ? 8 : 4)
63001560
UB
686
687#ifndef IN_LIBGCC2
2e64c636
JH
688#define MIN_UNITS_PER_WORD 4
689#endif
c98f8742 690
c98f8742 691/* Allocation boundary (in *bits*) for storing arguments in argument list. */
65d9c0ab 692#define PARM_BOUNDARY BITS_PER_WORD
c98f8742 693
e075ae69 694/* Boundary (in *bits*) on which stack pointer should be aligned. */
bd5d3961 695#define STACK_BOUNDARY (TARGET_64BIT_MS_ABI ? 128 : BITS_PER_WORD)
c98f8742 696
2e3f842f
L
697/* Stack boundary of the main function guaranteed by OS. */
698#define MAIN_STACK_BOUNDARY (TARGET_64BIT ? 128 : 32)
699
de1132d1 700/* Minimum stack boundary. */
cba9c789 701#define MIN_STACK_BOUNDARY BITS_PER_WORD
2e3f842f 702
d1f87653 703/* Boundary (in *bits*) on which the stack pointer prefers to be
3af4bd89 704 aligned; the compiler cannot rely on having this alignment. */
e075ae69 705#define PREFERRED_STACK_BOUNDARY ix86_preferred_stack_boundary
65954bd8 706
de1132d1 707/* It should be MIN_STACK_BOUNDARY. But we set it to 128 bits for
2e3f842f
L
708 both 32bit and 64bit, to support codes that need 128 bit stack
709 alignment for SSE instructions, but can't realign the stack. */
d9063947
L
710#define PREFERRED_STACK_BOUNDARY_DEFAULT \
711 (TARGET_IAMCU ? MIN_STACK_BOUNDARY : 128)
2e3f842f
L
712
713/* 1 if -mstackrealign should be turned on by default. It will
714 generate an alternate prologue and epilogue that realigns the
715 runtime stack if nessary. This supports mixing codes that keep a
716 4-byte aligned stack, as specified by i386 psABI, with codes that
890b9b96 717 need a 16-byte aligned stack, as required by SSE instructions. */
2e3f842f
L
718#define STACK_REALIGN_DEFAULT 0
719
720/* Boundary (in *bits*) on which the incoming stack is aligned. */
721#define INCOMING_STACK_BOUNDARY ix86_incoming_stack_boundary
1d482056 722
a2851b75
TG
723/* According to Windows x64 software convention, the maximum stack allocatable
724 in the prologue is 4G - 8 bytes. Furthermore, there is a limited set of
725 instructions allowed to adjust the stack pointer in the epilog, forcing the
726 use of frame pointer for frames larger than 2 GB. This theorical limit
727 is reduced by 256, an over-estimated upper bound for the stack use by the
728 prologue.
729 We define only one threshold for both the prolog and the epilog. When the
4e523f33 730 frame size is larger than this threshold, we allocate the area to save SSE
a2851b75
TG
731 regs, then save them, and then allocate the remaining. There is no SEH
732 unwind info for this later allocation. */
733#define SEH_MAX_FRAME_SIZE ((2U << 30) - 256)
734
ebff937c
SH
735/* Target OS keeps a vector-aligned (128-bit, 16-byte) stack. This is
736 mandatory for the 64-bit ABI, and may or may not be true for other
737 operating systems. */
738#define TARGET_KEEPS_VECTOR_ALIGNED_STACK TARGET_64BIT
739
f963b5d9
RS
740/* Minimum allocation boundary for the code of a function. */
741#define FUNCTION_BOUNDARY 8
742
743/* C++ stores the virtual bit in the lowest bit of function pointers. */
744#define TARGET_PTRMEMFUNC_VBIT_LOCATION ptrmemfunc_vbit_in_pfn
c98f8742 745
c98f8742
JVA
746/* Minimum size in bits of the largest boundary to which any
747 and all fundamental data types supported by the hardware
748 might need to be aligned. No data type wants to be aligned
17f24ff0 749 rounder than this.
fce5a9f2 750
d1f87653 751 Pentium+ prefers DFmode values to be aligned to 64 bit boundary
6d2b7199
BS
752 and Pentium Pro XFmode values at 128 bit boundaries.
753
754 When increasing the maximum, also update
755 TARGET_ABSOLUTE_BIGGEST_ALIGNMENT. */
17f24ff0 756
3f97cb0b 757#define BIGGEST_ALIGNMENT \
0076c82f 758 (TARGET_IAMCU ? 32 : (TARGET_AVX512F ? 512 : (TARGET_AVX ? 256 : 128)))
17f24ff0 759
2e3f842f
L
760/* Maximum stack alignment. */
761#define MAX_STACK_ALIGNMENT MAX_OFILE_ALIGNMENT
762
6e4f1168
L
763/* Alignment value for attribute ((aligned)). It is a constant since
764 it is the part of the ABI. We shouldn't change it with -mavx. */
e9c9e772 765#define ATTRIBUTE_ALIGNED_VALUE (TARGET_IAMCU ? 32 : 128)
6e4f1168 766
822eda12 767/* Decide whether a variable of mode MODE should be 128 bit aligned. */
a7180f70 768#define ALIGN_MODE_128(MODE) \
4501d314 769 ((MODE) == XFmode || SSE_REG_MODE_P (MODE))
a7180f70 770
17f24ff0 771/* The published ABIs say that doubles should be aligned on word
d1f87653 772 boundaries, so lower the alignment for structure fields unless
6fc605d8 773 -malign-double is set. */
e932b21b 774
e83f3cff
RH
775/* ??? Blah -- this macro is used directly by libobjc. Since it
776 supports no vector modes, cut out the complexity and fall back
777 on BIGGEST_FIELD_ALIGNMENT. */
778#ifdef IN_TARGET_LIBS
ef49d42e
JH
779#ifdef __x86_64__
780#define BIGGEST_FIELD_ALIGNMENT 128
781#else
e83f3cff 782#define BIGGEST_FIELD_ALIGNMENT 32
ef49d42e 783#endif
e83f3cff 784#else
a4cf4b64
RB
785#define ADJUST_FIELD_ALIGN(FIELD, TYPE, COMPUTED) \
786 x86_field_alignment ((TYPE), (COMPUTED))
e83f3cff 787#endif
c98f8742 788
8a022443
JW
789/* If defined, a C expression to compute the alignment for a static
790 variable. TYPE is the data type, and ALIGN is the alignment that
791 the object would ordinarily have. The value of this macro is used
792 instead of that alignment to align the object.
793
794 If this macro is not defined, then ALIGN is used.
795
796 One use of this macro is to increase alignment of medium-size
797 data to make it all fit in fewer cache lines. Another is to
798 cause character arrays to be word-aligned so that `strcpy' calls
799 that copy constants to character arrays can be done inline. */
800
df8a1d28
JJ
801#define DATA_ALIGNMENT(TYPE, ALIGN) \
802 ix86_data_alignment ((TYPE), (ALIGN), true)
803
804/* Similar to DATA_ALIGNMENT, but for the cases where the ABI mandates
805 some alignment increase, instead of optimization only purposes. E.g.
806 AMD x86-64 psABI says that variables with array type larger than 15 bytes
807 must be aligned to 16 byte boundaries.
808
809 If this macro is not defined, then ALIGN is used. */
810
811#define DATA_ABI_ALIGNMENT(TYPE, ALIGN) \
812 ix86_data_alignment ((TYPE), (ALIGN), false)
d16790f2
JW
813
814/* If defined, a C expression to compute the alignment for a local
815 variable. TYPE is the data type, and ALIGN is the alignment that
816 the object would ordinarily have. The value of this macro is used
817 instead of that alignment to align the object.
818
819 If this macro is not defined, then ALIGN is used.
820
821 One use of this macro is to increase alignment of medium-size
822 data to make it all fit in fewer cache lines. */
823
76fe54f0
L
824#define LOCAL_ALIGNMENT(TYPE, ALIGN) \
825 ix86_local_alignment ((TYPE), VOIDmode, (ALIGN))
826
827/* If defined, a C expression to compute the alignment for stack slot.
828 TYPE is the data type, MODE is the widest mode available, and ALIGN
829 is the alignment that the slot would ordinarily have. The value of
830 this macro is used instead of that alignment to align the slot.
831
832 If this macro is not defined, then ALIGN is used when TYPE is NULL,
833 Otherwise, LOCAL_ALIGNMENT will be used.
834
835 One use of this macro is to set alignment of stack slot to the
836 maximum alignment of all possible modes which the slot may have. */
837
838#define STACK_SLOT_ALIGNMENT(TYPE, MODE, ALIGN) \
839 ix86_local_alignment ((TYPE), (MODE), (ALIGN))
8a022443 840
9bfaf89d
JJ
841/* If defined, a C expression to compute the alignment for a local
842 variable DECL.
843
844 If this macro is not defined, then
845 LOCAL_ALIGNMENT (TREE_TYPE (DECL), DECL_ALIGN (DECL)) will be used.
846
847 One use of this macro is to increase alignment of medium-size
848 data to make it all fit in fewer cache lines. */
849
850#define LOCAL_DECL_ALIGNMENT(DECL) \
851 ix86_local_alignment ((DECL), VOIDmode, DECL_ALIGN (DECL))
852
ae58e548
JJ
853/* If defined, a C expression to compute the minimum required alignment
854 for dynamic stack realignment purposes for EXP (a TYPE or DECL),
855 MODE, assuming normal alignment ALIGN.
856
857 If this macro is not defined, then (ALIGN) will be used. */
858
859#define MINIMUM_ALIGNMENT(EXP, MODE, ALIGN) \
1a6e82b8 860 ix86_minimum_alignment ((EXP), (MODE), (ALIGN))
ae58e548 861
9bfaf89d 862
9cd10576 863/* Set this nonzero if move instructions will actually fail to work
c98f8742 864 when given unaligned data. */
b4ac57ab 865#define STRICT_ALIGNMENT 0
c98f8742
JVA
866
867/* If bit field type is int, don't let it cross an int,
868 and give entire struct the alignment of an int. */
43a88a8c 869/* Required on the 386 since it doesn't have bit-field insns. */
c98f8742 870#define PCC_BITFIELD_TYPE_MATTERS 1
c98f8742
JVA
871\f
872/* Standard register usage. */
873
874/* This processor has special stack-like registers. See reg-stack.c
892a2d68 875 for details. */
c98f8742
JVA
876
877#define STACK_REGS
ce998900 878
f48b4284
UB
879#define IS_STACK_MODE(MODE) \
880 (X87_FLOAT_MODE_P (MODE) \
881 && (!(SSE_FLOAT_MODE_P (MODE) && TARGET_SSE_MATH) \
882 || TARGET_MIX_SSE_I387))
c98f8742
JVA
883
884/* Number of actual hardware registers.
885 The hardware registers are assigned numbers for the compiler
886 from 0 to just below FIRST_PSEUDO_REGISTER.
887 All registers that the compiler knows about must be given numbers,
888 even those that are not normally considered general registers.
889
890 In the 80386 we give the 8 general purpose registers the numbers 0-7.
891 We number the floating point registers 8-15.
892 Note that registers 0-7 can be accessed as a short or int,
893 while only 0-3 may be used with byte `mov' instructions.
894
895 Reg 16 does not correspond to any hardware register, but instead
896 appears in the RTL as an argument pointer prior to reload, and is
897 eliminated during reloading in favor of either the stack or frame
892a2d68 898 pointer. */
c98f8742 899
05416670 900#define FIRST_PSEUDO_REGISTER FIRST_PSEUDO_REG
c98f8742 901
3073d01c
ML
902/* Number of hardware registers that go into the DWARF-2 unwind info.
903 If not defined, equals FIRST_PSEUDO_REGISTER. */
904
905#define DWARF_FRAME_REGISTERS 17
906
c98f8742
JVA
907/* 1 for registers that have pervasive standard uses
908 and are not available for the register allocator.
3f3f2124 909 On the 80386, the stack pointer is such, as is the arg pointer.
fce5a9f2 910
621bc046
UB
911 REX registers are disabled for 32bit targets in
912 TARGET_CONDITIONAL_REGISTER_USAGE. */
913
a7180f70
BS
914#define FIXED_REGISTERS \
915/*ax,dx,cx,bx,si,di,bp,sp,st,st1,st2,st3,st4,st5,st6,st7*/ \
3a4416fb 916{ 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, \
eaa17c21
UB
917/*arg,flags,fpsr,frame*/ \
918 1, 1, 1, 1, \
a7180f70
BS
919/*xmm0,xmm1,xmm2,xmm3,xmm4,xmm5,xmm6,xmm7*/ \
920 0, 0, 0, 0, 0, 0, 0, 0, \
78168632 921/* mm0, mm1, mm2, mm3, mm4, mm5, mm6, mm7*/ \
3f3f2124
JH
922 0, 0, 0, 0, 0, 0, 0, 0, \
923/* r8, r9, r10, r11, r12, r13, r14, r15*/ \
621bc046 924 0, 0, 0, 0, 0, 0, 0, 0, \
3f3f2124 925/*xmm8,xmm9,xmm10,xmm11,xmm12,xmm13,xmm14,xmm15*/ \
3f97cb0b
AI
926 0, 0, 0, 0, 0, 0, 0, 0, \
927/*xmm16,xmm17,xmm18,xmm19,xmm20,xmm21,xmm22,xmm23*/ \
928 0, 0, 0, 0, 0, 0, 0, 0, \
929/*xmm24,xmm25,xmm26,xmm27,xmm28,xmm29,xmm30,xmm31*/ \
85a77221
AI
930 0, 0, 0, 0, 0, 0, 0, 0, \
931/* k0, k1, k2, k3, k4, k5, k6, k7*/ \
eafa30ef 932 0, 0, 0, 0, 0, 0, 0, 0 }
c98f8742
JVA
933
934/* 1 for registers not available across function calls.
935 These must include the FIXED_REGISTERS and also any
936 registers that can be used without being saved.
937 The latter must include the registers where values are returned
938 and the register where structure-value addresses are passed.
fce5a9f2
EC
939 Aside from that, you can include as many other registers as you like.
940
621bc046
UB
941 Value is set to 1 if the register is call used unconditionally.
942 Bit one is set if the register is call used on TARGET_32BIT ABI.
943 Bit two is set if the register is call used on TARGET_64BIT ABI.
944 Bit three is set if the register is call used on TARGET_64BIT_MS_ABI.
945
946 Proper values are computed in TARGET_CONDITIONAL_REGISTER_USAGE. */
947
1f3ccbc8
L
948#define CALL_USED_REGISTERS_MASK(IS_64BIT_MS_ABI) \
949 ((IS_64BIT_MS_ABI) ? (1 << 3) : TARGET_64BIT ? (1 << 2) : (1 << 1))
950
a7180f70
BS
951#define CALL_USED_REGISTERS \
952/*ax,dx,cx,bx,si,di,bp,sp,st,st1,st2,st3,st4,st5,st6,st7*/ \
621bc046 953{ 1, 1, 1, 0, 4, 4, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, \
eaa17c21
UB
954/*arg,flags,fpsr,frame*/ \
955 1, 1, 1, 1, \
a7180f70 956/*xmm0,xmm1,xmm2,xmm3,xmm4,xmm5,xmm6,xmm7*/ \
621bc046 957 1, 1, 1, 1, 1, 1, 6, 6, \
78168632 958/* mm0, mm1, mm2, mm3, mm4, mm5, mm6, mm7*/ \
3a4416fb 959 1, 1, 1, 1, 1, 1, 1, 1, \
3f3f2124 960/* r8, r9, r10, r11, r12, r13, r14, r15*/ \
3a4416fb 961 1, 1, 1, 1, 2, 2, 2, 2, \
3f3f2124 962/*xmm8,xmm9,xmm10,xmm11,xmm12,xmm13,xmm14,xmm15*/ \
3f97cb0b
AI
963 6, 6, 6, 6, 6, 6, 6, 6, \
964/*xmm16,xmm17,xmm18,xmm19,xmm20,xmm21,xmm22,xmm23*/ \
79ab8c43 965 1, 1, 1, 1, 1, 1, 1, 1, \
3f97cb0b 966/*xmm24,xmm25,xmm26,xmm27,xmm28,xmm29,xmm30,xmm31*/ \
79ab8c43 967 1, 1, 1, 1, 1, 1, 1, 1, \
85a77221 968 /* k0, k1, k2, k3, k4, k5, k6, k7*/ \
eafa30ef 969 1, 1, 1, 1, 1, 1, 1, 1 }
c98f8742 970
3cc5f862
UB
971/* Order in which to allocate registers. Each register must be
972 listed once, even those in FIXED_REGISTERS. List frame pointer
973 late and fixed registers last. Note that, in general, we prefer
974 registers listed in CALL_USED_REGISTERS, keeping the others
975 available for storage of persistent values.
976
977 The ADJUST_REG_ALLOC_ORDER actually overwrite the order,
978 so this is just empty initializer for array. */
979
980#define REG_ALLOC_ORDER \
981{ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, \
982 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, \
983 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, \
984 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, \
985 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75 }
986
5a733826 987/* ADJUST_REG_ALLOC_ORDER is a macro which permits reg_alloc_order
162f023b 988 to be rearranged based on a particular function. When using sse math,
03c259ad 989 we want to allocate SSE before x87 registers and vice versa. */
3b3c6a3f 990
5a733826 991#define ADJUST_REG_ALLOC_ORDER x86_order_regs_for_local_alloc ()
3b3c6a3f 992
f5316dfe 993
7c800926
KT
994#define OVERRIDE_ABI_FORMAT(FNDECL) ix86_call_abi_override (FNDECL)
995
8521c414 996#define HARD_REGNO_NREGS_HAS_PADDING(REGNO, MODE) \
7bf65250
UB
997 (TARGET_128BIT_LONG_DOUBLE && !TARGET_64BIT \
998 && GENERAL_REGNO_P (REGNO) \
999 && ((MODE) == XFmode || (MODE) == XCmode))
8521c414
JM
1000
1001#define HARD_REGNO_NREGS_WITH_PADDING(REGNO, MODE) ((MODE) == XFmode ? 4 : 8)
1002
e21b52af
HL
1003#define REGMODE_NATURAL_SIZE(MODE) ix86_regmode_natural_size (MODE)
1004
95879c72
L
1005#define VALID_AVX256_REG_MODE(MODE) \
1006 ((MODE) == V32QImode || (MODE) == V16HImode || (MODE) == V8SImode \
8a0436cb 1007 || (MODE) == V4DImode || (MODE) == V2TImode || (MODE) == V8SFmode \
271e36d9 1008 || (MODE) == V4DFmode || (MODE) == V16HFmode)
95879c72 1009
271e36d9
UB
1010#define VALID_AVX256_REG_OR_OI_MODE(MODE) \
1011 (VALID_AVX256_REG_MODE (MODE) || (MODE) == OImode)
ff97910d 1012
3f97cb0b
AI
1013#define VALID_AVX512F_SCALAR_MODE(MODE) \
1014 ((MODE) == DImode || (MODE) == DFmode || (MODE) == SImode \
271e36d9
UB
1015 || (MODE) == SFmode)
1016
1017#define VALID_AVX512FP16_SCALAR_MODE(MODE) \
1018 ((MODE) == HImode || (MODE) == HFmode)
3f97cb0b
AI
1019
1020#define VALID_AVX512F_REG_MODE(MODE) \
1021 ((MODE) == V8DImode || (MODE) == V8DFmode || (MODE) == V64QImode \
9e4a4dd6 1022 || (MODE) == V16SImode || (MODE) == V16SFmode || (MODE) == V32HImode \
271e36d9 1023 || (MODE) == V4TImode || (MODE) == V32HFmode)
9e4a4dd6 1024
e6f146d2
SP
1025#define VALID_AVX512F_REG_OR_XI_MODE(MODE) \
1026 (VALID_AVX512F_REG_MODE (MODE) || (MODE) == XImode)
1027
05416670 1028#define VALID_AVX512VL_128_REG_MODE(MODE) \
9e4a4dd6 1029 ((MODE) == V2DImode || (MODE) == V2DFmode || (MODE) == V16QImode \
40bd4bf9 1030 || (MODE) == V4SImode || (MODE) == V4SFmode || (MODE) == V8HImode \
9e2a82e1 1031 || (MODE) == TFmode || (MODE) == V1TImode || (MODE) == V8HFmode \
1032 || (MODE) == TImode)
1033
1034#define VALID_AVX512FP16_REG_MODE(MODE) \
eea10afe
HW
1035 ((MODE) == V8HFmode || (MODE) == V16HFmode || (MODE) == V32HFmode \
1036 || (MODE) == V2HFmode)
3f97cb0b 1037
ce998900
UB
1038#define VALID_SSE2_REG_MODE(MODE) \
1039 ((MODE) == V16QImode || (MODE) == V8HImode || (MODE) == V2DFmode \
271e36d9 1040 || (MODE) == V8HFmode || (MODE) == V4HFmode || (MODE) == V2HFmode \
663a014e 1041 || (MODE) == V4QImode || (MODE) == V2HImode || (MODE) == V1SImode \
9ff206d3
UB
1042 || (MODE) == V2DImode || (MODE) == V2QImode || (MODE) == DFmode \
1043 || (MODE) == HFmode)
fbe5eb6d 1044
d9a5f180 1045#define VALID_SSE_REG_MODE(MODE) \
fe6ae2da
UB
1046 ((MODE) == V1TImode || (MODE) == TImode \
1047 || (MODE) == V4SFmode || (MODE) == V4SImode \
f364cdff 1048 || (MODE) == SFmode || (MODE) == TFmode || (MODE) == TDmode)
a7180f70 1049
47f339cf 1050#define VALID_MMX_REG_MODE_3DNOW(MODE) \
ce998900 1051 ((MODE) == V2SFmode || (MODE) == SFmode)
47f339cf 1052
eea10afe 1053/* To match ia32 psABI, V4HFmode should be added here. */
d9a5f180 1054#define VALID_MMX_REG_MODE(MODE) \
879f9d0b 1055 ((MODE) == V1DImode || (MODE) == DImode \
10a97ae6 1056 || (MODE) == V2SImode || (MODE) == SImode \
eea10afe
HW
1057 || (MODE) == V4HImode || (MODE) == V8QImode \
1058 || (MODE) == V4HFmode)
a7180f70 1059
05416670
UB
1060#define VALID_MASK_REG_MODE(MODE) ((MODE) == HImode || (MODE) == QImode)
1061
1062#define VALID_MASK_AVX512BW_MODE(MODE) ((MODE) == SImode || (MODE) == DImode)
1063
d9a5f180 1064#define VALID_FP_MODE_P(MODE) \
ce998900 1065 ((MODE) == SFmode || (MODE) == DFmode || (MODE) == XFmode \
a6841211 1066 || (MODE) == SCmode || (MODE) == DCmode || (MODE) == XCmode)
a946dd00 1067
d9a5f180 1068#define VALID_INT_MODE_P(MODE) \
46ca31d6
UB
1069 ((MODE) == QImode || (MODE) == HImode \
1070 || (MODE) == SImode || (MODE) == DImode \
1071 || (MODE) == CQImode || (MODE) == CHImode \
1072 || (MODE) == CSImode || (MODE) == CDImode \
f364cdff 1073 || (MODE) == SDmode || (MODE) == DDmode \
7cbc870c 1074 || (MODE) == HFmode || (MODE) == HCmode \
271e36d9 1075 || (MODE) == V2HImode || (MODE) == V2HFmode \
9ff206d3 1076 || (MODE) == V1SImode || (MODE) == V4QImode || (MODE) == V2QImode \
46ca31d6
UB
1077 || (TARGET_64BIT \
1078 && ((MODE) == TImode || (MODE) == CTImode \
ea30c7bd
UB
1079 || (MODE) == TFmode || (MODE) == TCmode \
1080 || (MODE) == V8QImode || (MODE) == V4HImode \
f364cdff 1081 || (MODE) == V2SImode || (MODE) == TDmode)))
a946dd00 1082
822eda12 1083/* Return true for modes passed in SSE registers. */
ce998900 1084#define SSE_REG_MODE_P(MODE) \
fe6ae2da
UB
1085 ((MODE) == V1TImode || (MODE) == TImode || (MODE) == V16QImode \
1086 || (MODE) == TFmode || (MODE) == V8HImode || (MODE) == V2DFmode \
1087 || (MODE) == V2DImode || (MODE) == V4SFmode || (MODE) == V4SImode \
1088 || (MODE) == V32QImode || (MODE) == V16HImode || (MODE) == V8SImode \
8a0436cb 1089 || (MODE) == V4DImode || (MODE) == V8SFmode || (MODE) == V4DFmode \
3f97cb0b
AI
1090 || (MODE) == V2TImode || (MODE) == V8DImode || (MODE) == V64QImode \
1091 || (MODE) == V16SImode || (MODE) == V32HImode || (MODE) == V8DFmode \
eea10afe
HW
1092 || (MODE) == V16SFmode || (MODE) == V32HFmode || (MODE) == V16HFmode \
1093 || (MODE) == V8HFmode)
822eda12 1094
05416670
UB
1095#define X87_FLOAT_MODE_P(MODE) \
1096 (TARGET_80387 && ((MODE) == SFmode || (MODE) == DFmode || (MODE) == XFmode))
85a77221 1097
05416670
UB
1098#define SSE_FLOAT_MODE_P(MODE) \
1099 ((TARGET_SSE && (MODE) == SFmode) || (TARGET_SSE2 && (MODE) == DFmode))
1100
a6841211
GX
1101#define SSE_FLOAT_MODE_SSEMATH_OR_HF_P(MODE) \
1102 ((SSE_FLOAT_MODE_P (MODE) && TARGET_SSE_MATH) \
1103 || (TARGET_AVX512FP16 && (MODE) == HFmode))
1104
05416670
UB
1105#define FMA4_VEC_FLOAT_MODE_P(MODE) \
1106 (TARGET_FMA4 && ((MODE) == V4SFmode || (MODE) == V2DFmode \
1107 || (MODE) == V8SFmode || (MODE) == V4DFmode))
9e4a4dd6 1108
7026bb95 1109#define VALID_BCST_MODE_P(MODE) \
1110 ((MODE) == SFmode || (MODE) == DFmode \
7afcb534 1111 || (MODE) == SImode || (MODE) == DImode \
1112 || (MODE) == HFmode)
7026bb95 1113
ff25ef99
ZD
1114/* It is possible to write patterns to move flags; but until someone
1115 does it, */
1116#define AVOID_CCMODE_COPIES
c98f8742 1117
e075ae69 1118/* Specify the modes required to caller save a given hard regno.
787dc842 1119 We do this on i386 to prevent flags from being saved at all.
e075ae69 1120
787dc842
JH
1121 Kill any attempts to combine saving of modes. */
1122
d9a5f180
GS
1123#define HARD_REGNO_CALLER_SAVE_MODE(REGNO, NREGS, MODE) \
1124 (CC_REGNO_P (REGNO) ? VOIDmode \
1125 : (MODE) == VOIDmode && (NREGS) != 1 ? VOIDmode \
737d6a1a 1126 : (MODE) == VOIDmode ? choose_hard_reg_mode ((REGNO), (NREGS), NULL) \
a60c3351
UB
1127 : (MODE) == HImode && !((GENERAL_REGNO_P (REGNO) \
1128 && TARGET_PARTIAL_REG_STALL) \
85a77221 1129 || MASK_REGNO_P (REGNO)) ? SImode \
a60c3351 1130 : (MODE) == QImode && !(ANY_QI_REGNO_P (REGNO) \
85a77221 1131 || MASK_REGNO_P (REGNO)) ? SImode \
d2836273 1132 : (MODE))
ce998900 1133
c98f8742
JVA
1134/* Specify the registers used for certain standard purposes.
1135 The values of these macros are register numbers. */
1136
1137/* on the 386 the pc register is %eip, and is not usable as a general
1138 register. The ordinary mov instructions won't work */
1139/* #define PC_REGNUM */
1140
05416670
UB
1141/* Base register for access to arguments of the function. */
1142#define ARG_POINTER_REGNUM ARGP_REG
1143
c98f8742 1144/* Register to use for pushing function arguments. */
05416670 1145#define STACK_POINTER_REGNUM SP_REG
c98f8742
JVA
1146
1147/* Base register for access to local variables of the function. */
05416670
UB
1148#define FRAME_POINTER_REGNUM FRAME_REG
1149#define HARD_FRAME_POINTER_REGNUM BP_REG
564d80f4 1150
05416670
UB
1151#define FIRST_INT_REG AX_REG
1152#define LAST_INT_REG SP_REG
c98f8742 1153
05416670
UB
1154#define FIRST_QI_REG AX_REG
1155#define LAST_QI_REG BX_REG
c98f8742
JVA
1156
1157/* First & last stack-like regs */
05416670
UB
1158#define FIRST_STACK_REG ST0_REG
1159#define LAST_STACK_REG ST7_REG
c98f8742 1160
05416670
UB
1161#define FIRST_SSE_REG XMM0_REG
1162#define LAST_SSE_REG XMM7_REG
fce5a9f2 1163
05416670
UB
1164#define FIRST_MMX_REG MM0_REG
1165#define LAST_MMX_REG MM7_REG
a7180f70 1166
05416670
UB
1167#define FIRST_REX_INT_REG R8_REG
1168#define LAST_REX_INT_REG R15_REG
3f3f2124 1169
05416670
UB
1170#define FIRST_REX_SSE_REG XMM8_REG
1171#define LAST_REX_SSE_REG XMM15_REG
3f3f2124 1172
05416670
UB
1173#define FIRST_EXT_REX_SSE_REG XMM16_REG
1174#define LAST_EXT_REX_SSE_REG XMM31_REG
3f97cb0b 1175
05416670
UB
1176#define FIRST_MASK_REG MASK0_REG
1177#define LAST_MASK_REG MASK7_REG
85a77221 1178
aabcd309 1179/* Override this in other tm.h files to cope with various OS lossage
6fca22eb
RH
1180 requiring a frame pointer. */
1181#ifndef SUBTARGET_FRAME_POINTER_REQUIRED
1182#define SUBTARGET_FRAME_POINTER_REQUIRED 0
1183#endif
1184
d730fd95
AT
1185/* Define the shadow offset for asan. Other OS's can override in the
1186 respective tm.h files. */
1187#ifndef SUBTARGET_SHADOW_OFFSET
1188#define SUBTARGET_SHADOW_OFFSET \
1189 (TARGET_LP64 ? HOST_WIDE_INT_C (0x7fff8000) : HOST_WIDE_INT_1 << 29)
1190#endif
1191
6fca22eb
RH
1192/* Make sure we can access arbitrary call frames. */
1193#define SETUP_FRAME_ADDRESSES() ix86_setup_frame_addresses ()
c98f8742 1194
c98f8742 1195/* Register to hold the addressing base for position independent
5b43fed1
RH
1196 code access to data items. We don't use PIC pointer for 64bit
1197 mode. Define the regnum to dummy value to prevent gcc from
fce5a9f2 1198 pessimizing code dealing with EBX.
bd09bdeb
RH
1199
1200 To avoid clobbering a call-saved register unnecessarily, we renumber
1201 the pic register when possible. The change is visible after the
1202 prologue has been emitted. */
1203
e8b5eb25 1204#define REAL_PIC_OFFSET_TABLE_REGNUM (TARGET_64BIT ? R15_REG : BX_REG)
bd09bdeb 1205
bcb21886 1206#define PIC_OFFSET_TABLE_REGNUM \
d290bb1d
IE
1207 (ix86_use_pseudo_pic_reg () \
1208 ? (pic_offset_table_rtx \
1209 ? INVALID_REGNUM \
1210 : REAL_PIC_OFFSET_TABLE_REGNUM) \
1211 : INVALID_REGNUM)
c98f8742 1212
5fc0e5df
KW
1213#define GOT_SYMBOL_NAME "_GLOBAL_OFFSET_TABLE_"
1214
c51e6d85 1215/* This is overridden by <cygwin.h>. */
5e062767
DS
1216#define MS_AGGREGATE_RETURN 0
1217
61fec9ff 1218#define KEEP_AGGREGATE_RETURN_POINTER 0
c98f8742
JVA
1219\f
1220/* Define the classes of registers for register constraints in the
1221 machine description. Also define ranges of constants.
1222
1223 One of the classes must always be named ALL_REGS and include all hard regs.
1224 If there is more than one class, another class must be named NO_REGS
1225 and contain no registers.
1226
1227 The name GENERAL_REGS must be the name of a class (or an alias for
1228 another name such as ALL_REGS). This is the class of registers
1229 that is allowed by "g" or "r" in a register constraint.
1230 Also, registers outside this class are allocated only when
1231 instructions express preferences for them.
1232
1233 The classes must be numbered in nondecreasing order; that is,
1234 a larger-numbered class must never be contained completely
2e24efd3
AM
1235 in a smaller-numbered class. This is why CLOBBERED_REGS class
1236 is listed early, even though in 64-bit mode it contains more
1237 registers than just %eax, %ecx, %edx.
c98f8742
JVA
1238
1239 For any two classes, it is very desirable that there be another
ab408a86
JVA
1240 class that represents their union.
1241
eaa17c21 1242 The flags and fpsr registers are in no class. */
c98f8742
JVA
1243
1244enum reg_class
1245{
1246 NO_REGS,
e075ae69 1247 AREG, DREG, CREG, BREG, SIREG, DIREG,
4b71cd6e 1248 AD_REGS, /* %eax/%edx for DImode */
2e24efd3 1249 CLOBBERED_REGS, /* call-clobbered integer registers */
c98f8742 1250 Q_REGS, /* %eax %ebx %ecx %edx */
564d80f4 1251 NON_Q_REGS, /* %esi %edi %ebp %esp */
de86ff8f 1252 TLS_GOTBASE_REGS, /* %ebx %ecx %edx %esi %edi %ebp */
c98f8742 1253 INDEX_REGS, /* %eax %ebx %ecx %edx %esi %edi %ebp */
3f3f2124 1254 LEGACY_REGS, /* %eax %ebx %ecx %edx %esi %edi %ebp %esp */
63001560
UB
1255 GENERAL_REGS, /* %eax %ebx %ecx %edx %esi %edi %ebp %esp
1256 %r8 %r9 %r10 %r11 %r12 %r13 %r14 %r15 */
c98f8742
JVA
1257 FP_TOP_REG, FP_SECOND_REG, /* %st(0) %st(1) */
1258 FLOAT_REGS,
06f4e35d 1259 SSE_FIRST_REG,
45392c76 1260 NO_REX_SSE_REGS,
a7180f70 1261 SSE_REGS,
3f97cb0b 1262 ALL_SSE_REGS,
a7180f70 1263 MMX_REGS,
446988df
JH
1264 FLOAT_SSE_REGS,
1265 FLOAT_INT_REGS,
1266 INT_SSE_REGS,
1267 FLOAT_INT_SSE_REGS,
85a77221 1268 MASK_REGS,
d18cbbf6 1269 ALL_MASK_REGS,
2d2bc36c 1270 INT_MASK_REGS,
d18cbbf6
UB
1271 ALL_REGS,
1272 LIM_REG_CLASSES
c98f8742
JVA
1273};
1274
d9a5f180
GS
1275#define N_REG_CLASSES ((int) LIM_REG_CLASSES)
1276
1277#define INTEGER_CLASS_P(CLASS) \
1278 reg_class_subset_p ((CLASS), GENERAL_REGS)
1279#define FLOAT_CLASS_P(CLASS) \
1280 reg_class_subset_p ((CLASS), FLOAT_REGS)
1281#define SSE_CLASS_P(CLASS) \
3f97cb0b 1282 reg_class_subset_p ((CLASS), ALL_SSE_REGS)
d1011a41 1283#define INT_SSE_CLASS_P(CLASS) \
1284 reg_class_subset_p ((CLASS), INT_SSE_REGS)
d9a5f180 1285#define MMX_CLASS_P(CLASS) \
f75959a6 1286 ((CLASS) == MMX_REGS)
4ed04e93 1287#define MASK_CLASS_P(CLASS) \
d18cbbf6 1288 reg_class_subset_p ((CLASS), ALL_MASK_REGS)
d9a5f180
GS
1289#define MAYBE_INTEGER_CLASS_P(CLASS) \
1290 reg_classes_intersect_p ((CLASS), GENERAL_REGS)
1291#define MAYBE_FLOAT_CLASS_P(CLASS) \
1292 reg_classes_intersect_p ((CLASS), FLOAT_REGS)
1293#define MAYBE_SSE_CLASS_P(CLASS) \
3f97cb0b 1294 reg_classes_intersect_p ((CLASS), ALL_SSE_REGS)
d9a5f180 1295#define MAYBE_MMX_CLASS_P(CLASS) \
0bd72901 1296 reg_classes_intersect_p ((CLASS), MMX_REGS)
85a77221 1297#define MAYBE_MASK_CLASS_P(CLASS) \
d18cbbf6 1298 reg_classes_intersect_p ((CLASS), ALL_MASK_REGS)
d9a5f180
GS
1299
1300#define Q_CLASS_P(CLASS) \
1301 reg_class_subset_p ((CLASS), Q_REGS)
7c6b971d 1302
0bd72901
UB
1303#define MAYBE_NON_Q_CLASS_P(CLASS) \
1304 reg_classes_intersect_p ((CLASS), NON_Q_REGS)
1305
43f3a59d 1306/* Give names of register classes as strings for dump file. */
c98f8742
JVA
1307
1308#define REG_CLASS_NAMES \
1309{ "NO_REGS", \
ab408a86 1310 "AREG", "DREG", "CREG", "BREG", \
c98f8742 1311 "SIREG", "DIREG", \
e075ae69 1312 "AD_REGS", \
2e24efd3 1313 "CLOBBERED_REGS", \
e075ae69 1314 "Q_REGS", "NON_Q_REGS", \
de86ff8f 1315 "TLS_GOTBASE_REGS", \
c98f8742 1316 "INDEX_REGS", \
3f3f2124 1317 "LEGACY_REGS", \
c98f8742
JVA
1318 "GENERAL_REGS", \
1319 "FP_TOP_REG", "FP_SECOND_REG", \
1320 "FLOAT_REGS", \
cb482895 1321 "SSE_FIRST_REG", \
45392c76 1322 "NO_REX_SSE_REGS", \
a7180f70 1323 "SSE_REGS", \
3f97cb0b 1324 "ALL_SSE_REGS", \
a7180f70 1325 "MMX_REGS", \
446988df 1326 "FLOAT_SSE_REGS", \
8fcaaa80 1327 "FLOAT_INT_REGS", \
446988df
JH
1328 "INT_SSE_REGS", \
1329 "FLOAT_INT_SSE_REGS", \
85a77221 1330 "MASK_REGS", \
d18cbbf6 1331 "ALL_MASK_REGS", \
2d2bc36c 1332 "INT_MASK_REGS", \
c98f8742
JVA
1333 "ALL_REGS" }
1334
ac2e563f
RH
1335/* Define which registers fit in which classes. This is an initializer
1336 for a vector of HARD_REG_SET of length N_REG_CLASSES.
1337
621bc046
UB
1338 Note that CLOBBERED_REGS are calculated by
1339 TARGET_CONDITIONAL_REGISTER_USAGE. */
c98f8742 1340
d18cbbf6 1341#define REG_CLASS_CONTENTS \
eaa17c21
UB
1342{ { 0x0, 0x0, 0x0 }, /* NO_REGS */ \
1343 { 0x01, 0x0, 0x0 }, /* AREG */ \
1344 { 0x02, 0x0, 0x0 }, /* DREG */ \
1345 { 0x04, 0x0, 0x0 }, /* CREG */ \
1346 { 0x08, 0x0, 0x0 }, /* BREG */ \
1347 { 0x10, 0x0, 0x0 }, /* SIREG */ \
1348 { 0x20, 0x0, 0x0 }, /* DIREG */ \
1349 { 0x03, 0x0, 0x0 }, /* AD_REGS */ \
1350 { 0x07, 0x0, 0x0 }, /* CLOBBERED_REGS */ \
1351 { 0x0f, 0x0, 0x0 }, /* Q_REGS */ \
1352 { 0x900f0, 0x0, 0x0 }, /* NON_Q_REGS */ \
1353 { 0x7e, 0xff0, 0x0 }, /* TLS_GOTBASE_REGS */ \
1354 { 0x7f, 0xff0, 0x0 }, /* INDEX_REGS */ \
1355 { 0x900ff, 0x0, 0x0 }, /* LEGACY_REGS */ \
1356 { 0x900ff, 0xff0, 0x0 }, /* GENERAL_REGS */ \
1357 { 0x100, 0x0, 0x0 }, /* FP_TOP_REG */ \
1358 { 0x200, 0x0, 0x0 }, /* FP_SECOND_REG */ \
1359 { 0xff00, 0x0, 0x0 }, /* FLOAT_REGS */ \
1360 { 0x100000, 0x0, 0x0 }, /* SSE_FIRST_REG */ \
1361 { 0xff00000, 0x0, 0x0 }, /* NO_REX_SSE_REGS */ \
1362 { 0xff00000, 0xff000, 0x0 }, /* SSE_REGS */ \
1363 { 0xff00000, 0xfffff000, 0xf }, /* ALL_SSE_REGS */ \
1364{ 0xf0000000, 0xf, 0x0 }, /* MMX_REGS */ \
1365 { 0xff0ff00, 0xfffff000, 0xf }, /* FLOAT_SSE_REGS */ \
1366 { 0x9ffff, 0xff0, 0x0 }, /* FLOAT_INT_REGS */ \
1367 { 0xff900ff, 0xfffffff0, 0xf }, /* INT_SSE_REGS */ \
1368 { 0xff9ffff, 0xfffffff0, 0xf }, /* FLOAT_INT_SSE_REGS */ \
1369 { 0x0, 0x0, 0xfe0 }, /* MASK_REGS */ \
1370 { 0x0, 0x0, 0xff0 }, /* ALL_MASK_REGS */ \
2d2bc36c 1371 { 0x900ff, 0xff0, 0xff0 }, /* INT_MASK_REGS */ \
eaa17c21 1372{ 0xffffffff, 0xffffffff, 0xfff } /* ALL_REGS */ \
e075ae69 1373}
c98f8742
JVA
1374
1375/* The same information, inverted:
1376 Return the class number of the smallest class containing
1377 reg number REGNO. This could be a conditional expression
1378 or could index an array. */
1379
1a6e82b8 1380#define REGNO_REG_CLASS(REGNO) (regclass_map[(REGNO)])
c98f8742 1381
42db504c
SB
1382/* When this hook returns true for MODE, the compiler allows
1383 registers explicitly used in the rtl to be used as spill registers
1384 but prevents the compiler from extending the lifetime of these
1385 registers. */
1386#define TARGET_SMALL_REGISTER_CLASSES_FOR_MODE_P hook_bool_mode_true
c98f8742 1387
fc27f749 1388#define QI_REG_P(X) (REG_P (X) && QI_REGNO_P (REGNO (X)))
05416670
UB
1389#define QI_REGNO_P(N) IN_RANGE ((N), FIRST_QI_REG, LAST_QI_REG)
1390
1391#define LEGACY_INT_REG_P(X) (REG_P (X) && LEGACY_INT_REGNO_P (REGNO (X)))
1392#define LEGACY_INT_REGNO_P(N) (IN_RANGE ((N), FIRST_INT_REG, LAST_INT_REG))
1393
1394#define REX_INT_REG_P(X) (REG_P (X) && REX_INT_REGNO_P (REGNO (X)))
1395#define REX_INT_REGNO_P(N) \
1396 IN_RANGE ((N), FIRST_REX_INT_REG, LAST_REX_INT_REG)
3f3f2124 1397
58b0b34c 1398#define GENERAL_REG_P(X) (REG_P (X) && GENERAL_REGNO_P (REGNO (X)))
fc27f749 1399#define GENERAL_REGNO_P(N) \
58b0b34c 1400 (LEGACY_INT_REGNO_P (N) || REX_INT_REGNO_P (N))
3f3f2124 1401
fc27f749
UB
1402#define ANY_QI_REG_P(X) (REG_P (X) && ANY_QI_REGNO_P (REGNO (X)))
1403#define ANY_QI_REGNO_P(N) \
1404 (TARGET_64BIT ? GENERAL_REGNO_P (N) : QI_REGNO_P (N))
3f3f2124 1405
66aaf16f
UB
1406#define STACK_REG_P(X) (REG_P (X) && STACK_REGNO_P (REGNO (X)))
1407#define STACK_REGNO_P(N) IN_RANGE ((N), FIRST_STACK_REG, LAST_STACK_REG)
fc27f749 1408
fc27f749 1409#define SSE_REG_P(X) (REG_P (X) && SSE_REGNO_P (REGNO (X)))
fb84c7a0 1410#define SSE_REGNO_P(N) \
ef342b2d 1411 (LEGACY_SSE_REGNO_P (N) \
3f97cb0b
AI
1412 || REX_SSE_REGNO_P (N) \
1413 || EXT_REX_SSE_REGNO_P (N))
3f3f2124 1414
ef342b2d
UB
1415#define LEGACY_SSE_REGNO_P(N) \
1416 IN_RANGE ((N), FIRST_SSE_REG, LAST_SSE_REG)
1417
4977bab6 1418#define REX_SSE_REGNO_P(N) \
fb84c7a0 1419 IN_RANGE ((N), FIRST_REX_SSE_REG, LAST_REX_SSE_REG)
4977bab6 1420
0a48088a
IT
1421#define EXT_REX_SSE_REG_P(X) (REG_P (X) && EXT_REX_SSE_REGNO_P (REGNO (X)))
1422
3f97cb0b
AI
1423#define EXT_REX_SSE_REGNO_P(N) \
1424 IN_RANGE ((N), FIRST_EXT_REX_SSE_REG, LAST_EXT_REX_SSE_REG)
1425
05416670
UB
1426#define ANY_FP_REG_P(X) (REG_P (X) && ANY_FP_REGNO_P (REGNO (X)))
1427#define ANY_FP_REGNO_P(N) (STACK_REGNO_P (N) || SSE_REGNO_P (N))
3f97cb0b 1428
9e4a4dd6 1429#define MASK_REG_P(X) (REG_P (X) && MASK_REGNO_P (REGNO (X)))
85a77221 1430#define MASK_REGNO_P(N) IN_RANGE ((N), FIRST_MASK_REG, LAST_MASK_REG)
e21b52af 1431#define MASK_PAIR_REGNO_P(N) ((((N) - FIRST_MASK_REG) & 1) == 0)
446988df 1432
fc27f749 1433#define MMX_REG_P(X) (REG_P (X) && MMX_REGNO_P (REGNO (X)))
fb84c7a0 1434#define MMX_REGNO_P(N) IN_RANGE ((N), FIRST_MMX_REG, LAST_MMX_REG)
fce5a9f2 1435
e075ae69 1436#define CC_REG_P(X) (REG_P (X) && CC_REGNO_P (REGNO (X)))
adb67ffb 1437#define CC_REGNO_P(X) ((X) == FLAGS_REG)
e075ae69 1438
5fbb13a7
KY
1439#define MOD4_SSE_REG_P(X) (REG_P (X) && MOD4_SSE_REGNO_P (REGNO (X)))
1440#define MOD4_SSE_REGNO_P(N) ((N) == XMM0_REG \
1441 || (N) == XMM4_REG \
1442 || (N) == XMM8_REG \
1443 || (N) == XMM12_REG \
1444 || (N) == XMM16_REG \
1445 || (N) == XMM20_REG \
1446 || (N) == XMM24_REG \
1447 || (N) == XMM28_REG)
1448
05416670
UB
1449/* First floating point reg */
1450#define FIRST_FLOAT_REG FIRST_STACK_REG
1451#define STACK_TOP_P(X) (REG_P (X) && REGNO (X) == FIRST_FLOAT_REG)
1452
02469d3a
UB
1453#define GET_SSE_REGNO(N) \
1454 ((N) < 8 ? FIRST_SSE_REG + (N) \
1455 : (N) < 16 ? FIRST_REX_SSE_REG + (N) - 8 \
1456 : FIRST_EXT_REX_SSE_REG + (N) - 16)
05416670 1457
c98f8742
JVA
1458/* The class value for index registers, and the one for base regs. */
1459
1460#define INDEX_REG_CLASS INDEX_REGS
1461#define BASE_REG_CLASS GENERAL_REGS
c98f8742
JVA
1462\f
1463/* Stack layout; function entry, exit and calling. */
1464
1465/* Define this if pushing a word on the stack
1466 makes the stack pointer a smaller address. */
62f9f30b 1467#define STACK_GROWS_DOWNWARD 1
c98f8742 1468
a4d05547 1469/* Define this to nonzero if the nominal address of the stack frame
c98f8742
JVA
1470 is at the high-address end of the local variables;
1471 that is, each additional local variable allocated
1472 goes at a more negative offset in the frame. */
f62c8a5c 1473#define FRAME_GROWS_DOWNWARD 1
c98f8742 1474
7b4df2bf 1475#define PUSH_ROUNDING(BYTES) ix86_push_rounding (BYTES)
8c2b2fae
UB
1476
1477/* If defined, the maximum amount of space required for outgoing arguments
1478 will be computed and placed into the variable `crtl->outgoing_args_size'.
1479 No space will be pushed onto the stack for each call; instead, the
1480 function prologue should increase the stack frame size by this amount.
41ee845b
JH
1481
1482 In 32bit mode enabling argument accumulation results in about 5% code size
56aae4b7 1483 growth because move instructions are less compact than push. In 64bit
41ee845b
JH
1484 mode the difference is less drastic but visible.
1485
1486 FIXME: Unlike earlier implementations, the size of unwind info seems to
f830ddc2 1487 actually grow with accumulation. Is that because accumulated args
41ee845b 1488 unwind info became unnecesarily bloated?
f830ddc2
RH
1489
1490 With the 64-bit MS ABI, we can generate correct code with or without
1491 accumulated args, but because of OUTGOING_REG_PARM_STACK_SPACE the code
1492 generated without accumulated args is terrible.
41ee845b
JH
1493
1494 If stack probes are required, the space used for large function
1495 arguments on the stack must also be probed, so enable
f8071c05
L
1496 -maccumulate-outgoing-args so this happens in the prologue.
1497
1498 We must use argument accumulation in interrupt function if stack
1499 may be realigned to avoid DRAP. */
f73ad30e 1500
6c6094f1 1501#define ACCUMULATE_OUTGOING_ARGS \
f8071c05
L
1502 ((TARGET_ACCUMULATE_OUTGOING_ARGS \
1503 && optimize_function_for_speed_p (cfun)) \
1504 || (cfun->machine->func_type != TYPE_NORMAL \
1505 && crtl->stack_realign_needed) \
1506 || TARGET_STACK_PROBE \
1507 || TARGET_64BIT_MS_ABI \
ff734e26 1508 || (TARGET_MACHO && crtl->profile))
f73ad30e 1509
2da4124d 1510/* We want the stack and args grow in opposite directions, even if
967b4653 1511 targetm.calls.push_argument returns false. */
2da4124d
L
1512#define PUSH_ARGS_REVERSED 1
1513
c98f8742
JVA
1514/* Offset of first parameter from the argument pointer register value. */
1515#define FIRST_PARM_OFFSET(FNDECL) 0
1516
a7180f70
BS
1517/* Define this macro if functions should assume that stack space has been
1518 allocated for arguments even when their values are passed in registers.
1519
1520 The value of this macro is the size, in bytes, of the area reserved for
1521 arguments passed in registers for the function represented by FNDECL.
1522
1523 This space can be allocated by the caller, or be a part of the
1524 machine-dependent stack frame: `OUTGOING_REG_PARM_STACK_SPACE' says
1525 which. */
7c800926
KT
1526#define REG_PARM_STACK_SPACE(FNDECL) ix86_reg_parm_stack_space (FNDECL)
1527
4ae8027b 1528#define OUTGOING_REG_PARM_STACK_SPACE(FNTYPE) \
6510e8bb 1529 (TARGET_64BIT && ix86_function_type_abi (FNTYPE) == MS_ABI)
7c800926 1530
c98f8742
JVA
1531/* Define how to find the value returned by a library function
1532 assuming the value has mode MODE. */
1533
4ae8027b 1534#define LIBCALL_VALUE(MODE) ix86_libcall_value (MODE)
c98f8742 1535
e9125c09
TW
1536/* Define the size of the result block used for communication between
1537 untyped_call and untyped_return. The block contains a DImode value
1538 followed by the block used by fnsave and frstor. */
1539
1540#define APPLY_RESULT_SIZE (8+108)
1541
b08de47e 1542/* 1 if N is a possible register number for function argument passing. */
53c17031 1543#define FUNCTION_ARG_REGNO_P(N) ix86_function_arg_regno_p (N)
c98f8742
JVA
1544
1545/* Define a data type for recording info about an argument list
1546 during the scan of that argument list. This data type should
1547 hold all necessary information about the function itself
1548 and about the args processed so far, enough to enable macros
b08de47e 1549 such as FUNCTION_ARG to determine where the next arg should go. */
c98f8742 1550
e075ae69 1551typedef struct ix86_args {
fa283935 1552 int words; /* # words passed so far */
b08de47e
MM
1553 int nregs; /* # registers available for passing */
1554 int regno; /* next available register number */
3e65f251
KT
1555 int fastcall; /* fastcall or thiscall calling convention
1556 is used */
fa283935 1557 int sse_words; /* # sse words passed so far */
a7180f70 1558 int sse_nregs; /* # sse registers available for passing */
223cdd15
UB
1559 int warn_avx512f; /* True when we want to warn
1560 about AVX512F ABI. */
95879c72 1561 int warn_avx; /* True when we want to warn about AVX ABI. */
47a37ce4 1562 int warn_sse; /* True when we want to warn about SSE ABI. */
fa283935 1563 int warn_mmx; /* True when we want to warn about MMX ABI. */
974aedcc
MP
1564 int warn_empty; /* True when we want to warn about empty classes
1565 passing ABI change. */
fa283935
UB
1566 int sse_regno; /* next available sse register number */
1567 int mmx_words; /* # mmx words passed so far */
bcf17554
JH
1568 int mmx_nregs; /* # mmx registers available for passing */
1569 int mmx_regno; /* next available mmx register number */
892a2d68 1570 int maybe_vaarg; /* true for calls to possibly vardic fncts. */
2767a7f2 1571 int caller; /* true if it is caller. */
2824d6e5
UB
1572 int float_in_sse; /* Set to 1 or 2 for 32bit targets if
1573 SFmode/DFmode arguments should be passed
1574 in SSE registers. Otherwise 0. */
d5e254e1 1575 int stdarg; /* Set to 1 if function is stdarg. */
51212b32 1576 enum calling_abi call_abi; /* Set to SYSV_ABI for sysv abi. Otherwise
7c800926 1577 MS_ABI for ms abi. */
e66fc623 1578 tree decl; /* Callee decl. */
b08de47e 1579} CUMULATIVE_ARGS;
c98f8742
JVA
1580
1581/* Initialize a variable CUM of type CUMULATIVE_ARGS
1582 for a call to a function whose data type is FNTYPE.
b08de47e 1583 For a library call, FNTYPE is 0. */
c98f8742 1584
0f6937fe 1585#define INIT_CUMULATIVE_ARGS(CUM, FNTYPE, LIBNAME, FNDECL, N_NAMED_ARGS) \
2767a7f2
L
1586 init_cumulative_args (&(CUM), (FNTYPE), (LIBNAME), (FNDECL), \
1587 (N_NAMED_ARGS) != -1)
c98f8742 1588
c98f8742
JVA
1589/* Output assembler code to FILE to increment profiler label # LABELNO
1590 for profiling a function entry. */
1591
1a6e82b8
UB
1592#define FUNCTION_PROFILER(FILE, LABELNO) \
1593 x86_function_profiler ((FILE), (LABELNO))
a5fa1ecd
JH
1594
1595#define MCOUNT_NAME "_mcount"
1596
3c5273a9
KT
1597#define MCOUNT_NAME_BEFORE_PROLOGUE "__fentry__"
1598
a5fa1ecd 1599#define PROFILE_COUNT_REGISTER "edx"
c98f8742
JVA
1600
1601/* EXIT_IGNORE_STACK should be nonzero if, when returning from a function,
1602 the stack pointer does not matter. The value is tested only in
1603 functions that have frame pointers.
1604 No definition is equivalent to always zero. */
fce5a9f2 1605/* Note on the 386 it might be more efficient not to define this since
c98f8742
JVA
1606 we have to restore it ourselves from the frame pointer, in order to
1607 use pop */
1608
1609#define EXIT_IGNORE_STACK 1
1610
f8071c05
L
1611/* Define this macro as a C expression that is nonzero for registers
1612 used by the epilogue or the `return' pattern. */
1613
1614#define EPILOGUE_USES(REGNO) ix86_epilogue_uses (REGNO)
1615
c98f8742
JVA
1616/* Output assembler code for a block containing the constant parts
1617 of a trampoline, leaving space for the variable parts. */
1618
a269a03c 1619/* On the 386, the trampoline contains two instructions:
c98f8742 1620 mov #STATIC,ecx
a269a03c
JC
1621 jmp FUNCTION
1622 The trampoline is generated entirely at runtime. The operand of JMP
1623 is the address of FUNCTION relative to the instruction following the
1624 JMP (which is 5 bytes long). */
c98f8742
JVA
1625
1626/* Length in units of the trampoline for entering a nested function. */
1627
6514899f 1628#define TRAMPOLINE_SIZE (TARGET_64BIT ? 28 : 14)
c98f8742
JVA
1629\f
1630/* Definitions for register eliminations.
1631
1632 This is an array of structures. Each structure initializes one pair
1633 of eliminable registers. The "from" register number is given first,
1634 followed by "to". Eliminations of the same "from" register are listed
1635 in order of preference.
1636
afc2cd05
NC
1637 There are two registers that can always be eliminated on the i386.
1638 The frame pointer and the arg pointer can be replaced by either the
1639 hard frame pointer or to the stack pointer, depending upon the
1640 circumstances. The hard frame pointer is not used before reload and
1641 so it is not eligible for elimination. */
c98f8742 1642
564d80f4
JH
1643#define ELIMINABLE_REGS \
1644{{ ARG_POINTER_REGNUM, STACK_POINTER_REGNUM}, \
1645 { ARG_POINTER_REGNUM, HARD_FRAME_POINTER_REGNUM}, \
1646 { FRAME_POINTER_REGNUM, STACK_POINTER_REGNUM}, \
1647 { FRAME_POINTER_REGNUM, HARD_FRAME_POINTER_REGNUM}} \
c98f8742 1648
c98f8742
JVA
1649/* Define the offset between two registers, one to be eliminated, and the other
1650 its replacement, at the start of a routine. */
1651
d9a5f180
GS
1652#define INITIAL_ELIMINATION_OFFSET(FROM, TO, OFFSET) \
1653 ((OFFSET) = ix86_initial_elimination_offset ((FROM), (TO)))
c98f8742
JVA
1654\f
1655/* Addressing modes, and classification of registers for them. */
1656
c98f8742
JVA
1657/* Macros to check register numbers against specific register classes. */
1658
1659/* These assume that REGNO is a hard or pseudo reg number.
1660 They give nonzero only if REGNO is a hard reg of the suitable class
1661 or a pseudo reg currently allocated to a suitable hard reg.
1662 Since they use reg_renumber, they are safe only once reg_renumber
aeb9f7cf
SB
1663 has been allocated, which happens in reginfo.c during register
1664 allocation. */
c98f8742 1665
3f3f2124
JH
1666#define REGNO_OK_FOR_INDEX_P(REGNO) \
1667 ((REGNO) < STACK_POINTER_REGNUM \
fb84c7a0
UB
1668 || REX_INT_REGNO_P (REGNO) \
1669 || (unsigned) reg_renumber[(REGNO)] < STACK_POINTER_REGNUM \
1670 || REX_INT_REGNO_P ((unsigned) reg_renumber[(REGNO)]))
c98f8742 1671
3f3f2124 1672#define REGNO_OK_FOR_BASE_P(REGNO) \
fb84c7a0 1673 (GENERAL_REGNO_P (REGNO) \
3f3f2124
JH
1674 || (REGNO) == ARG_POINTER_REGNUM \
1675 || (REGNO) == FRAME_POINTER_REGNUM \
fb84c7a0 1676 || GENERAL_REGNO_P ((unsigned) reg_renumber[(REGNO)]))
c98f8742 1677
c98f8742
JVA
1678/* The macros REG_OK_FOR..._P assume that the arg is a REG rtx
1679 and check its validity for a certain class.
1680 We have two alternate definitions for each of them.
1681 The usual definition accepts all pseudo regs; the other rejects
1682 them unless they have been allocated suitable hard regs.
1683 The symbol REG_OK_STRICT causes the latter definition to be used.
1684
1685 Most source files want to accept pseudo regs in the hope that
1686 they will get allocated to the class that the insn wants them to be in.
1687 Source files for reload pass need to be strict.
1688 After reload, it makes no difference, since pseudo regs have
1689 been eliminated by then. */
1690
c98f8742 1691
ff482c8d 1692/* Non strict versions, pseudos are ok. */
3b3c6a3f
MM
1693#define REG_OK_FOR_INDEX_NONSTRICT_P(X) \
1694 (REGNO (X) < STACK_POINTER_REGNUM \
fb84c7a0 1695 || REX_INT_REGNO_P (REGNO (X)) \
c98f8742
JVA
1696 || REGNO (X) >= FIRST_PSEUDO_REGISTER)
1697
3b3c6a3f 1698#define REG_OK_FOR_BASE_NONSTRICT_P(X) \
fb84c7a0 1699 (GENERAL_REGNO_P (REGNO (X)) \
3b3c6a3f 1700 || REGNO (X) == ARG_POINTER_REGNUM \
3f3f2124 1701 || REGNO (X) == FRAME_POINTER_REGNUM \
3b3c6a3f 1702 || REGNO (X) >= FIRST_PSEUDO_REGISTER)
c98f8742 1703
3b3c6a3f
MM
1704/* Strict versions, hard registers only */
1705#define REG_OK_FOR_INDEX_STRICT_P(X) REGNO_OK_FOR_INDEX_P (REGNO (X))
1706#define REG_OK_FOR_BASE_STRICT_P(X) REGNO_OK_FOR_BASE_P (REGNO (X))
c98f8742 1707
3b3c6a3f 1708#ifndef REG_OK_STRICT
d9a5f180
GS
1709#define REG_OK_FOR_INDEX_P(X) REG_OK_FOR_INDEX_NONSTRICT_P (X)
1710#define REG_OK_FOR_BASE_P(X) REG_OK_FOR_BASE_NONSTRICT_P (X)
3b3c6a3f
MM
1711
1712#else
d9a5f180
GS
1713#define REG_OK_FOR_INDEX_P(X) REG_OK_FOR_INDEX_STRICT_P (X)
1714#define REG_OK_FOR_BASE_P(X) REG_OK_FOR_BASE_STRICT_P (X)
c98f8742
JVA
1715#endif
1716
331d9186 1717/* TARGET_LEGITIMATE_ADDRESS_P recognizes an RTL expression
c98f8742
JVA
1718 that is a valid memory address for an instruction.
1719 The MODE argument is the machine mode for the MEM expression
1720 that wants to use this address.
1721
331d9186 1722 The other macros defined here are used only in TARGET_LEGITIMATE_ADDRESS_P,
c98f8742
JVA
1723 except for CONSTANT_ADDRESS_P which is usually machine-independent.
1724
1725 See legitimize_pic_address in i386.c for details as to what
1726 constitutes a legitimate address when -fpic is used. */
1727
1728#define MAX_REGS_PER_ADDRESS 2
1729
f996902d 1730#define CONSTANT_ADDRESS_P(X) constant_address_p (X)
c98f8742 1731
b949ea8b
JW
1732/* If defined, a C expression to determine the base term of address X.
1733 This macro is used in only one place: `find_base_term' in alias.c.
1734
1735 It is always safe for this macro to not be defined. It exists so
1736 that alias analysis can understand machine-dependent addresses.
1737
1738 The typical use of this macro is to handle addresses containing
1739 a label_ref or symbol_ref within an UNSPEC. */
1740
d9a5f180 1741#define FIND_BASE_TERM(X) ix86_find_base_term (X)
b949ea8b 1742
c98f8742 1743/* Nonzero if the constant value X is a legitimate general operand
fce5a9f2 1744 when generating PIC code. It is given that flag_pic is on and
c98f8742
JVA
1745 that X satisfies CONSTANT_P or is a CONST_DOUBLE. */
1746
f996902d 1747#define LEGITIMATE_PIC_OPERAND_P(X) legitimate_pic_operand_p (X)
c98f8742 1748
6ddb30f9 1749#define STRIP_UNARY(X) (UNARY_P (X) ? XEXP (X, 0) : X)
1750
c98f8742 1751#define SYMBOLIC_CONST(X) \
d9a5f180
GS
1752 (GET_CODE (X) == SYMBOL_REF \
1753 || GET_CODE (X) == LABEL_REF \
1754 || (GET_CODE (X) == CONST && symbolic_reference_mentioned_p (X)))
c98f8742 1755\f
b08de47e
MM
1756/* Max number of args passed in registers. If this is more than 3, we will
1757 have problems with ebx (register #4), since it is a caller save register and
1758 is also used as the pic register in ELF. So for now, don't allow more than
1759 3 registers to be passed in registers. */
1760
7c800926
KT
1761/* Abi specific values for REGPARM_MAX and SSE_REGPARM_MAX */
1762#define X86_64_REGPARM_MAX 6
72fa3605 1763#define X86_64_MS_REGPARM_MAX 4
7c800926 1764
72fa3605 1765#define X86_32_REGPARM_MAX 3
7c800926 1766
4ae8027b 1767#define REGPARM_MAX \
2824d6e5
UB
1768 (TARGET_64BIT \
1769 ? (TARGET_64BIT_MS_ABI \
1770 ? X86_64_MS_REGPARM_MAX \
1771 : X86_64_REGPARM_MAX) \
4ae8027b 1772 : X86_32_REGPARM_MAX)
d2836273 1773
72fa3605
UB
1774#define X86_64_SSE_REGPARM_MAX 8
1775#define X86_64_MS_SSE_REGPARM_MAX 4
1776
b6010cab 1777#define X86_32_SSE_REGPARM_MAX (TARGET_SSE ? (TARGET_MACHO ? 4 : 3) : 0)
72fa3605 1778
4ae8027b 1779#define SSE_REGPARM_MAX \
2824d6e5
UB
1780 (TARGET_64BIT \
1781 ? (TARGET_64BIT_MS_ABI \
1782 ? X86_64_MS_SSE_REGPARM_MAX \
1783 : X86_64_SSE_REGPARM_MAX) \
4ae8027b 1784 : X86_32_SSE_REGPARM_MAX)
bcf17554 1785
f4a0e873
UB
1786#define X86_32_MMX_REGPARM_MAX (TARGET_MMX ? (TARGET_MACHO ? 0 : 3) : 0)
1787
1788#define MMX_REGPARM_MAX (TARGET_64BIT ? 0 : X86_32_MMX_REGPARM_MAX)
c98f8742
JVA
1789\f
1790/* Specify the machine mode that this machine uses
1791 for the index in the tablejump instruction. */
dc4d7240 1792#define CASE_VECTOR_MODE \
6025b127 1793 (!TARGET_LP64 || (flag_pic && ix86_cmodel != CM_LARGE_PIC) ? SImode : DImode)
c98f8742 1794
c98f8742
JVA
1795/* Define this as 1 if `char' should by default be signed; else as 0. */
1796#define DEFAULT_SIGNED_CHAR 1
1797
29f0e955
L
1798/* The constant maximum number of bytes that a single instruction can
1799 move quickly between memory and registers or between two memory
1800 locations. */
1801#define MAX_MOVE_MAX 64
1802
1803/* Max number of bytes we can move from memory to memory in one
1804 reasonably fast instruction, as opposed to MOVE_MAX_PIECES which
1805 is the number of bytes at a time which we can move efficiently.
1806 MOVE_MAX_PIECES defaults to MOVE_MAX. */
1807
1808#define MOVE_MAX \
654cd743
L
1809 ((TARGET_AVX512F \
1810 && (ix86_move_max == PVW_AVX512 \
1811 || ix86_store_max == PVW_AVX512)) \
29f0e955
L
1812 ? 64 \
1813 : ((TARGET_AVX \
654cd743
L
1814 && (ix86_move_max >= PVW_AVX256 \
1815 || ix86_store_max >= PVW_AVX256)) \
29f0e955
L
1816 ? 32 \
1817 : ((TARGET_SSE2 \
1818 && TARGET_SSE_UNALIGNED_LOAD_OPTIMAL \
1819 && TARGET_SSE_UNALIGNED_STORE_OPTIMAL) \
1820 ? 16 : UNITS_PER_WORD)))
1821
5738a64f
L
1822/* STORE_MAX_PIECES is the number of bytes at a time that we can store
1823 efficiently. Allow 16/32/64 bytes only if inter-unit move is enabled
1824 since vec_duplicate enabled by inter-unit move is used to implement
1825 store_by_pieces of 16/32/64 bytes. */
29f0e955 1826#define STORE_MAX_PIECES \
5738a64f 1827 (TARGET_INTER_UNIT_MOVES_TO_VEC \
654cd743 1828 ? ((TARGET_AVX512F && ix86_store_max == PVW_AVX512) \
5738a64f
L
1829 ? 64 \
1830 : ((TARGET_AVX \
654cd743 1831 && ix86_store_max >= PVW_AVX256) \
5738a64f
L
1832 ? 32 \
1833 : ((TARGET_SSE2 \
1834 && TARGET_SSE_UNALIGNED_STORE_OPTIMAL) \
1835 ? 16 : UNITS_PER_WORD))) \
1836 : UNITS_PER_WORD)
c98f8742 1837
7e24ffc9 1838/* If a memory-to-memory move would take MOVE_RATIO or more simple
76715c32 1839 move-instruction pairs, we will do a cpymem or libcall instead.
7e24ffc9
HPN
1840 Increasing the value will always make code faster, but eventually
1841 incurs high cost in increased code size.
c98f8742 1842
e2e52e1b 1843 If you don't define this, a reasonable default is used. */
c98f8742 1844
e04ad03d 1845#define MOVE_RATIO(speed) ((speed) ? ix86_cost->move_ratio : 3)
c98f8742 1846
45d78e7f
JJ
1847/* If a clear memory operation would take CLEAR_RATIO or more simple
1848 move-instruction sequences, we will do a clrmem or libcall instead. */
1849
25e22b19 1850#define CLEAR_RATIO(speed) ((speed) ? ix86_cost->clear_ratio : 2)
45d78e7f 1851
53f00dde
UB
1852/* Define if shifts truncate the shift count which implies one can
1853 omit a sign-extension or zero-extension of a shift count.
1854
1855 On i386, shifts do truncate the count. But bit test instructions
1856 take the modulo of the bit offset operand. */
c98f8742
JVA
1857
1858/* #define SHIFT_COUNT_TRUNCATED */
1859
d9f32422
JH
1860/* A macro to update M and UNSIGNEDP when an object whose type is
1861 TYPE and which has the specified mode and signedness is to be
1862 stored in a register. This macro is only called when TYPE is a
1863 scalar type.
1864
f710504c 1865 On i386 it is sometimes useful to promote HImode and QImode
d9f32422
JH
1866 quantities to SImode. The choice depends on target type. */
1867
1868#define PROMOTE_MODE(MODE, UNSIGNEDP, TYPE) \
d9a5f180 1869do { \
d9f32422
JH
1870 if (((MODE) == HImode && TARGET_PROMOTE_HI_REGS) \
1871 || ((MODE) == QImode && TARGET_PROMOTE_QI_REGS)) \
d9a5f180
GS
1872 (MODE) = SImode; \
1873} while (0)
d9f32422 1874
c98f8742
JVA
1875/* Specify the machine mode that pointers have.
1876 After generation of rtl, the compiler makes no further distinction
1877 between pointers and any other objects of this machine mode. */
28968d91 1878#define Pmode (ix86_pmode == PMODE_DI ? DImode : SImode)
c98f8742 1879
5e1e91c4
L
1880/* Supply a definition of STACK_SAVEAREA_MODE for emit_stack_save.
1881 NONLOCAL needs space to save both shadow stack and stack pointers.
1882
1883 FIXME: We only need to save and restore stack pointer in ptr_mode.
1884 But expand_builtin_setjmp_setup and expand_builtin_longjmp use Pmode
1885 to save and restore stack pointer. See
1886 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84150
1887 */
1888#define STACK_SAVEAREA_MODE(LEVEL) \
1889 ((LEVEL) == SAVE_NONLOCAL ? (TARGET_64BIT ? TImode : DImode) : Pmode)
1890
d16b9d1c
UB
1891/* Specify the machine_mode of the size increment
1892 operand of an 'allocate_stack' named pattern. */
1893#define STACK_SIZE_MODE Pmode
1894
f0ea7581
L
1895/* A C expression whose value is zero if pointers that need to be extended
1896 from being `POINTER_SIZE' bits wide to `Pmode' are sign-extended and
1897 greater then zero if they are zero-extended and less then zero if the
1898 ptr_extend instruction should be used. */
1899
1900#define POINTERS_EXTEND_UNSIGNED 1
1901
c98f8742
JVA
1902/* A function address in a call instruction
1903 is a byte address (for indexing purposes)
1904 so give the MEM rtx a byte's mode. */
1905#define FUNCTION_MODE QImode
d4ba09c0 1906\f
d4ba09c0 1907
d4ba09c0
SC
1908/* A C expression for the cost of a branch instruction. A value of 1
1909 is the default; other values are interpreted relative to that. */
1910
3a4fd356
JH
1911#define BRANCH_COST(speed_p, predictable_p) \
1912 (!(speed_p) ? 2 : (predictable_p) ? 0 : ix86_branch_cost)
d4ba09c0 1913
e327d1a3
L
1914/* An integer expression for the size in bits of the largest integer machine
1915 mode that should actually be used. We allow pairs of registers. */
1916#define MAX_FIXED_MODE_SIZE GET_MODE_BITSIZE (TARGET_64BIT ? TImode : DImode)
1917
d4ba09c0
SC
1918/* Define this macro as a C expression which is nonzero if accessing
1919 less than a word of memory (i.e. a `char' or a `short') is no
1920 faster than accessing a word of memory, i.e., if such access
1921 require more than one instruction or if there is no difference in
1922 cost between byte and (aligned) word loads.
1923
1924 When this macro is not defined, the compiler will access a field by
1925 finding the smallest containing object; when it is defined, a
1926 fullword load will be used if alignment permits. Unless bytes
1927 accesses are faster than word accesses, using word accesses is
1928 preferable since it may eliminate subsequent memory access if
1929 subsequent accesses occur to other fields in the same word of the
1930 structure, but to different bytes. */
1931
1932#define SLOW_BYTE_ACCESS 0
1933
1934/* Nonzero if access to memory by shorts is slow and undesirable. */
1935#define SLOW_SHORT_ACCESS 0
1936
d4ba09c0
SC
1937/* Define this macro if it is as good or better to call a constant
1938 function address than to call an address kept in a register.
1939
1940 Desirable on the 386 because a CALL with a constant address is
1941 faster than one with a register address. */
1942
1e8552c2 1943#define NO_FUNCTION_CSE 1
c98f8742 1944\f
c572e5ba
JVA
1945/* Given a comparison code (EQ, NE, etc.) and the first operand of a COMPARE,
1946 return the mode to be used for the comparison.
1947
1948 For floating-point equality comparisons, CCFPEQmode should be used.
e075ae69 1949 VOIDmode should be used in all other cases.
c572e5ba 1950
16189740 1951 For integer comparisons against zero, reduce to CCNOmode or CCZmode if
e075ae69 1952 possible, to allow for more combinations. */
c98f8742 1953
d9a5f180 1954#define SELECT_CC_MODE(OP, X, Y) ix86_cc_mode ((OP), (X), (Y))
9e7adcb3 1955
9cd10576 1956/* Return nonzero if MODE implies a floating point inequality can be
9e7adcb3
JH
1957 reversed. */
1958
1959#define REVERSIBLE_CC_MODE(MODE) 1
1960
1961/* A C expression whose value is reversed condition code of the CODE for
1962 comparison done in CC_MODE mode. */
3c5cb3e4 1963#define REVERSE_CONDITION(CODE, MODE) ix86_reverse_condition ((CODE), (MODE))
9e7adcb3 1964
c98f8742
JVA
1965\f
1966/* Control the assembler format that we output, to the extent
1967 this does not vary between assemblers. */
1968
1969/* How to refer to registers in assembler output.
892a2d68 1970 This sequence is indexed by compiler's hard-register-number (see above). */
c98f8742 1971
a7b376ee 1972/* In order to refer to the first 8 regs as 32-bit regs, prefix an "e".
c98f8742
JVA
1973 For non floating point regs, the following are the HImode names.
1974
1975 For float regs, the stack top is sometimes referred to as "%st(0)"
6e2188e0
NF
1976 instead of just "%st". TARGET_PRINT_OPERAND handles this with the
1977 "y" code. */
c98f8742 1978
a7180f70
BS
1979#define HI_REGISTER_NAMES \
1980{"ax","dx","cx","bx","si","di","bp","sp", \
480feac0 1981 "st","st(1)","st(2)","st(3)","st(4)","st(5)","st(6)","st(7)", \
eaa17c21 1982 "argp", "flags", "fpsr", "frame", \
a7180f70 1983 "xmm0","xmm1","xmm2","xmm3","xmm4","xmm5","xmm6","xmm7", \
03c259ad 1984 "mm0", "mm1", "mm2", "mm3", "mm4", "mm5", "mm6", "mm7", \
3f3f2124 1985 "r8", "r9", "r10", "r11", "r12", "r13", "r14", "r15", \
3f97cb0b
AI
1986 "xmm8", "xmm9", "xmm10", "xmm11", "xmm12", "xmm13", "xmm14", "xmm15", \
1987 "xmm16", "xmm17", "xmm18", "xmm19", \
1988 "xmm20", "xmm21", "xmm22", "xmm23", \
1989 "xmm24", "xmm25", "xmm26", "xmm27", \
85a77221 1990 "xmm28", "xmm29", "xmm30", "xmm31", \
eafa30ef 1991 "k0", "k1", "k2", "k3", "k4", "k5", "k6", "k7" }
a7180f70 1992
c98f8742
JVA
1993#define REGISTER_NAMES HI_REGISTER_NAMES
1994
50bec228
UB
1995#define QI_REGISTER_NAMES \
1996{"al", "dl", "cl", "bl", "sil", "dil", "bpl", "spl"}
1997
1998#define QI_HIGH_REGISTER_NAMES \
1999{"ah", "dh", "ch", "bh"}
2000
c98f8742
JVA
2001/* Table of additional register names to use in user input. */
2002
eaa17c21
UB
2003#define ADDITIONAL_REGISTER_NAMES \
2004{ \
2005 { "eax", AX_REG }, { "edx", DX_REG }, { "ecx", CX_REG }, { "ebx", BX_REG }, \
2006 { "esi", SI_REG }, { "edi", DI_REG }, { "ebp", BP_REG }, { "esp", SP_REG }, \
2007 { "rax", AX_REG }, { "rdx", DX_REG }, { "rcx", CX_REG }, { "rbx", BX_REG }, \
2008 { "rsi", SI_REG }, { "rdi", DI_REG }, { "rbp", BP_REG }, { "rsp", SP_REG }, \
2009 { "al", AX_REG }, { "dl", DX_REG }, { "cl", CX_REG }, { "bl", BX_REG }, \
50bec228 2010 { "sil", SI_REG }, { "dil", DI_REG }, { "bpl", BP_REG }, { "spl", SP_REG }, \
eaa17c21
UB
2011 { "ah", AX_REG }, { "dh", DX_REG }, { "ch", CX_REG }, { "bh", BX_REG }, \
2012 { "ymm0", XMM0_REG }, { "ymm1", XMM1_REG }, { "ymm2", XMM2_REG }, { "ymm3", XMM3_REG }, \
2013 { "ymm4", XMM4_REG }, { "ymm5", XMM5_REG }, { "ymm6", XMM6_REG }, { "ymm7", XMM7_REG }, \
2014 { "ymm8", XMM8_REG }, { "ymm9", XMM9_REG }, { "ymm10", XMM10_REG }, { "ymm11", XMM11_REG }, \
2015 { "ymm12", XMM12_REG }, { "ymm13", XMM13_REG }, { "ymm14", XMM14_REG }, { "ymm15", XMM15_REG }, \
2016 { "ymm16", XMM16_REG }, { "ymm17", XMM17_REG }, { "ymm18", XMM18_REG }, { "ymm19", XMM19_REG }, \
2017 { "ymm20", XMM20_REG }, { "ymm21", XMM21_REG }, { "ymm22", XMM22_REG }, { "ymm23", XMM23_REG }, \
2018 { "ymm24", XMM24_REG }, { "ymm25", XMM25_REG }, { "ymm26", XMM26_REG }, { "ymm27", XMM27_REG }, \
2019 { "ymm28", XMM28_REG }, { "ymm29", XMM29_REG }, { "ymm30", XMM30_REG }, { "ymm31", XMM31_REG }, \
2020 { "zmm0", XMM0_REG }, { "zmm1", XMM1_REG }, { "zmm2", XMM2_REG }, { "zmm3", XMM3_REG }, \
2021 { "zmm4", XMM4_REG }, { "zmm5", XMM5_REG }, { "zmm6", XMM6_REG }, { "zmm7", XMM7_REG }, \
2022 { "zmm8", XMM8_REG }, { "zmm9", XMM9_REG }, { "zmm10", XMM10_REG }, { "zmm11", XMM11_REG }, \
2023 { "zmm12", XMM12_REG }, { "zmm13", XMM13_REG }, { "zmm14", XMM14_REG }, { "zmm15", XMM15_REG }, \
2024 { "zmm16", XMM16_REG }, { "zmm17", XMM17_REG }, { "zmm18", XMM18_REG }, { "zmm19", XMM19_REG }, \
2025 { "zmm20", XMM20_REG }, { "zmm21", XMM21_REG }, { "zmm22", XMM22_REG }, { "zmm23", XMM23_REG }, \
2026 { "zmm24", XMM24_REG }, { "zmm25", XMM25_REG }, { "zmm26", XMM26_REG }, { "zmm27", XMM27_REG }, \
2027 { "zmm28", XMM28_REG }, { "zmm29", XMM29_REG }, { "zmm30", XMM30_REG }, { "zmm31", XMM31_REG } \
2028}
c98f8742 2029
c98f8742
JVA
2030/* How to renumber registers for dbx and gdb. */
2031
d9a5f180
GS
2032#define DBX_REGISTER_NUMBER(N) \
2033 (TARGET_64BIT ? dbx64_register_map[(N)] : dbx_register_map[(N)])
83774849 2034
9a82e702
MS
2035extern int const dbx_register_map[FIRST_PSEUDO_REGISTER];
2036extern int const dbx64_register_map[FIRST_PSEUDO_REGISTER];
2037extern int const svr4_dbx_register_map[FIRST_PSEUDO_REGISTER];
c98f8742 2038
469ac993
JM
2039/* Before the prologue, RA is at 0(%esp). */
2040#define INCOMING_RETURN_ADDR_RTX \
2efb4214 2041 gen_rtx_MEM (Pmode, stack_pointer_rtx)
fce5a9f2 2042
e414ab29 2043/* After the prologue, RA is at -4(AP) in the current frame. */
1a6e82b8
UB
2044#define RETURN_ADDR_RTX(COUNT, FRAME) \
2045 ((COUNT) == 0 \
2046 ? gen_rtx_MEM (Pmode, plus_constant (Pmode, arg_pointer_rtx, \
2047 -UNITS_PER_WORD)) \
2048 : gen_rtx_MEM (Pmode, plus_constant (Pmode, (FRAME), UNITS_PER_WORD)))
e414ab29 2049
892a2d68 2050/* PC is dbx register 8; let's use that column for RA. */
0f7fa3d0 2051#define DWARF_FRAME_RETURN_COLUMN (TARGET_64BIT ? 16 : 8)
469ac993 2052
a10b3cf1
L
2053/* Before the prologue, there are return address and error code for
2054 exception handler on the top of the frame. */
2055#define INCOMING_FRAME_SP_OFFSET \
2056 (cfun->machine->func_type == TYPE_EXCEPTION \
2057 ? 2 * UNITS_PER_WORD : UNITS_PER_WORD)
a6ab3aad 2058
26fc730d
JJ
2059/* The value of INCOMING_FRAME_SP_OFFSET the assembler assumes in
2060 .cfi_startproc. */
2061#define DEFAULT_INCOMING_FRAME_SP_OFFSET UNITS_PER_WORD
2062
1020a5ab 2063/* Describe how we implement __builtin_eh_return. */
2824d6e5
UB
2064#define EH_RETURN_DATA_REGNO(N) ((N) <= DX_REG ? (N) : INVALID_REGNUM)
2065#define EH_RETURN_STACKADJ_RTX gen_rtx_REG (Pmode, CX_REG)
1020a5ab 2066
ad919812 2067
e4c4ebeb
RH
2068/* Select a format to encode pointers in exception handling data. CODE
2069 is 0 for data, 1 for code labels, 2 for function pointers. GLOBAL is
2070 true if the symbol may be affected by dynamic relocations.
2071
2072 ??? All x86 object file formats are capable of representing this.
2073 After all, the relocation needed is the same as for the call insn.
2074 Whether or not a particular assembler allows us to enter such, I
2075 guess we'll have to see. */
d9a5f180 2076#define ASM_PREFERRED_EH_DATA_FORMAT(CODE, GLOBAL) \
72ce3d4a 2077 asm_preferred_eh_data_format ((CODE), (GLOBAL))
e4c4ebeb 2078
ec1895c1
UB
2079/* These are a couple of extensions to the formats accepted
2080 by asm_fprintf:
2081 %z prints out opcode suffix for word-mode instruction
2082 %r prints out word-mode name for reg_names[arg] */
2083#define ASM_FPRINTF_EXTENSIONS(FILE, ARGS, P) \
2084 case 'z': \
2085 fputc (TARGET_64BIT ? 'q' : 'l', (FILE)); \
2086 break; \
2087 \
2088 case 'r': \
2089 { \
2090 unsigned int regno = va_arg ((ARGS), int); \
2091 if (LEGACY_INT_REGNO_P (regno)) \
2092 fputc (TARGET_64BIT ? 'r' : 'e', (FILE)); \
2093 fputs (reg_names[regno], (FILE)); \
2094 break; \
2095 }
2096
2097/* This is how to output an insn to push a register on the stack. */
2098
2099#define ASM_OUTPUT_REG_PUSH(FILE, REGNO) \
2100 asm_fprintf ((FILE), "\tpush%z\t%%%r\n", (REGNO))
2101
2102/* This is how to output an insn to pop a register from the stack. */
c98f8742 2103
d9a5f180 2104#define ASM_OUTPUT_REG_POP(FILE, REGNO) \
ec1895c1 2105 asm_fprintf ((FILE), "\tpop%z\t%%%r\n", (REGNO))
c98f8742 2106
f88c65f7 2107/* This is how to output an element of a case-vector that is absolute. */
c98f8742
JVA
2108
2109#define ASM_OUTPUT_ADDR_VEC_ELT(FILE, VALUE) \
d9a5f180 2110 ix86_output_addr_vec_elt ((FILE), (VALUE))
c98f8742 2111
f88c65f7 2112/* This is how to output an element of a case-vector that is relative. */
c98f8742 2113
33f7f353 2114#define ASM_OUTPUT_ADDR_DIFF_ELT(FILE, BODY, VALUE, REL) \
d9a5f180 2115 ix86_output_addr_diff_elt ((FILE), (VALUE), (REL))
f88c65f7 2116
63001560 2117/* When we see %v, we will print the 'v' prefix if TARGET_AVX is true. */
95879c72
L
2118
2119#define ASM_OUTPUT_AVX_PREFIX(STREAM, PTR) \
2120{ \
2121 if ((PTR)[0] == '%' && (PTR)[1] == 'v') \
63001560 2122 (PTR) += TARGET_AVX ? 1 : 2; \
95879c72
L
2123}
2124
2125/* A C statement or statements which output an assembler instruction
2126 opcode to the stdio stream STREAM. The macro-operand PTR is a
2127 variable of type `char *' which points to the opcode name in
2128 its "internal" form--the form that is written in the machine
2129 description. */
2130
2131#define ASM_OUTPUT_OPCODE(STREAM, PTR) \
2132 ASM_OUTPUT_AVX_PREFIX ((STREAM), (PTR))
2133
6a90d232
L
2134/* A C statement to output to the stdio stream FILE an assembler
2135 command to pad the location counter to a multiple of 1<<LOG
2136 bytes if it is within MAX_SKIP bytes. */
2137
2138#ifdef HAVE_GAS_MAX_SKIP_P2ALIGN
c4551a27
AO
2139# define ASM_OUTPUT_MAX_SKIP_ALIGN(FILE,LOG,MAX_SKIP) \
2140 do { \
2141 if ((LOG) != 0) { \
dd047c67 2142 if ((MAX_SKIP) == 0 || (MAX_SKIP) >= (1 << (LOG)) - 1) \
c4551a27 2143 fprintf ((FILE), "\t.p2align %d\n", (LOG)); \
6a90d232 2144 else \
c4551a27
AO
2145 fprintf ((FILE), "\t.p2align %d,,%d\n", (LOG), (MAX_SKIP)); \
2146 } \
2147 } while (0)
6a90d232
L
2148#endif
2149
135a687e
KT
2150/* Write the extra assembler code needed to declare a function
2151 properly. */
2152
2153#undef ASM_OUTPUT_FUNCTION_LABEL
2154#define ASM_OUTPUT_FUNCTION_LABEL(FILE, NAME, DECL) \
1a6e82b8 2155 ix86_asm_output_function_label ((FILE), (NAME), (DECL))
135a687e 2156
c892d8f5
JJ
2157/* A C statement (sans semicolon) to output a reference to SYMBOL_REF SYM.
2158 If not defined, assemble_name will be used to output the name of the
2159 symbol. This macro may be used to modify the way a symbol is referenced
2160 depending on information encoded by TARGET_ENCODE_SECTION_INFO. */
2161
2162#ifndef ASM_OUTPUT_SYMBOL_REF
2163#define ASM_OUTPUT_SYMBOL_REF(FILE, SYM) \
2164 do { \
2165 const char *name \
2166 = assemble_name_resolve (XSTR (x, 0)); \
2167 /* In -masm=att wrap identifiers that start with $ \
2168 into parens. */ \
2169 if (ASSEMBLER_DIALECT == ASM_ATT \
2170 && name[0] == '$' \
2171 && user_label_prefix[0] == '\0') \
2172 { \
2173 fputc ('(', (FILE)); \
2174 assemble_name_raw ((FILE), name); \
2175 fputc (')', (FILE)); \
2176 } \
2177 else \
2178 assemble_name_raw ((FILE), name); \
2179 } while (0)
2180#endif
2181
f7288899
EC
2182/* Under some conditions we need jump tables in the text section,
2183 because the assembler cannot handle label differences between
85e10e4f 2184 sections. */
f88c65f7
RH
2185
2186#define JUMP_TABLES_IN_TEXT_SECTION \
85e10e4f 2187 (flag_pic && !(TARGET_64BIT || HAVE_AS_GOTOFF_IN_DATA))
c98f8742 2188
cea3bd3e
RH
2189/* Switch to init or fini section via SECTION_OP, emit a call to FUNC,
2190 and switch back. For x86 we do this only to save a few bytes that
2191 would otherwise be unused in the text section. */
ad211091
KT
2192#define CRT_MKSTR2(VAL) #VAL
2193#define CRT_MKSTR(x) CRT_MKSTR2(x)
2194
2195#define CRT_CALL_STATIC_FUNCTION(SECTION_OP, FUNC) \
2196 asm (SECTION_OP "\n\t" \
2197 "call " CRT_MKSTR(__USER_LABEL_PREFIX__) #FUNC "\n" \
cea3bd3e 2198 TEXT_SECTION_ASM_OP);
5a579c3b
LE
2199
2200/* Default threshold for putting data in large sections
2201 with x86-64 medium memory model */
2202#define DEFAULT_LARGE_SECTION_THRESHOLD 65536
74b42c8b 2203\f
b97de419
L
2204/* Which processor to tune code generation for. These must be in sync
2205 with processor_target_table in i386.c. */
5bf0ebab
RH
2206
2207enum processor_type
2208{
b97de419
L
2209 PROCESSOR_GENERIC = 0,
2210 PROCESSOR_I386, /* 80386 */
5bf0ebab
RH
2211 PROCESSOR_I486, /* 80486DX, 80486SX, 80486DX[24] */
2212 PROCESSOR_PENTIUM,
2d6b2e28 2213 PROCESSOR_LAKEMONT,
5bf0ebab 2214 PROCESSOR_PENTIUMPRO,
5bf0ebab 2215 PROCESSOR_PENTIUM4,
89c43c0a 2216 PROCESSOR_NOCONA,
340ef734 2217 PROCESSOR_CORE2,
d3c11974
L
2218 PROCESSOR_NEHALEM,
2219 PROCESSOR_SANDYBRIDGE,
3a579e09 2220 PROCESSOR_HASWELL,
d3c11974
L
2221 PROCESSOR_BONNELL,
2222 PROCESSOR_SILVERMONT,
50e461df 2223 PROCESSOR_GOLDMONT,
74b2bb19 2224 PROCESSOR_GOLDMONT_PLUS,
a548a5a1 2225 PROCESSOR_TREMONT,
52747219 2226 PROCESSOR_KNL,
cace2309 2227 PROCESSOR_KNM,
176a3386 2228 PROCESSOR_SKYLAKE,
06caf59d 2229 PROCESSOR_SKYLAKE_AVX512,
c234d831 2230 PROCESSOR_CANNONLAKE,
79ab5364
JK
2231 PROCESSOR_ICELAKE_CLIENT,
2232 PROCESSOR_ICELAKE_SERVER,
7cab07f0 2233 PROCESSOR_CASCADELAKE,
a9fcfec3
HL
2234 PROCESSOR_TIGERLAKE,
2235 PROCESSOR_COOPERLAKE,
ba9c87d3
CL
2236 PROCESSOR_SAPPHIRERAPIDS,
2237 PROCESSOR_ALDERLAKE,
c02c39fa 2238 PROCESSOR_ROCKETLAKE,
9a7f94d7 2239 PROCESSOR_INTEL,
b97de419
L
2240 PROCESSOR_GEODE,
2241 PROCESSOR_K6,
2242 PROCESSOR_ATHLON,
2243 PROCESSOR_K8,
21efb4d4 2244 PROCESSOR_AMDFAM10,
1133125e 2245 PROCESSOR_BDVER1,
4d652a18 2246 PROCESSOR_BDVER2,
eb2f2b44 2247 PROCESSOR_BDVER3,
ed97ad47 2248 PROCESSOR_BDVER4,
14b52538 2249 PROCESSOR_BTVER1,
e32bfc16 2250 PROCESSOR_BTVER2,
9ce29eb0 2251 PROCESSOR_ZNVER1,
2901f42f 2252 PROCESSOR_ZNVER2,
3e2ae3ee 2253 PROCESSOR_ZNVER3,
5bf0ebab
RH
2254 PROCESSOR_max
2255};
2256
c98c2430 2257#if !defined(IN_LIBGCC2) && !defined(IN_TARGET_LIBS) && !defined(IN_RTS)
2559ef9f 2258extern const char *const processor_names[];
c98c2430
ML
2259
2260#include "wide-int-bitmask.h"
2261
14431e66
ML
2262enum pta_flag
2263{
2264#define DEF_PTA(NAME) _ ## NAME,
2265#include "i386-isa.def"
2266#undef DEF_PTA
2267 END_PTA
2268};
2269
2270/* wide_int_bitmask can handle only 128 flags. */
2271STATIC_ASSERT (END_PTA <= 128);
2272
2273#define WIDE_INT_BITMASK_FROM_NTH(N) (N < 64 ? wide_int_bitmask (0, 1ULL << N) \
2274 : wide_int_bitmask (1ULL << (N - 64), 0))
2275
2276#define DEF_PTA(NAME) constexpr wide_int_bitmask PTA_ ## NAME \
2277 = WIDE_INT_BITMASK_FROM_NTH ((pta_flag) _ ## NAME);
2278#include "i386-isa.def"
2279#undef DEF_PTA
a1541628
JJ
2280
2281constexpr wide_int_bitmask PTA_X86_64_BASELINE = PTA_64BIT | PTA_MMX | PTA_SSE
324bec55 2282 | PTA_SSE2 | PTA_NO_SAHF | PTA_FXSR;
a1541628
JJ
2283constexpr wide_int_bitmask PTA_X86_64_V2 = (PTA_X86_64_BASELINE
2284 & (~PTA_NO_SAHF))
324bec55 2285 | PTA_CX16 | PTA_POPCNT | PTA_SSE3 | PTA_SSE4_1 | PTA_SSE4_2 | PTA_SSSE3;
a1541628 2286constexpr wide_int_bitmask PTA_X86_64_V3 = PTA_X86_64_V2
324bec55
FW
2287 | PTA_AVX | PTA_AVX2 | PTA_BMI | PTA_BMI2 | PTA_F16C | PTA_FMA | PTA_LZCNT
2288 | PTA_MOVBE | PTA_XSAVE;
a1541628 2289constexpr wide_int_bitmask PTA_X86_64_V4 = PTA_X86_64_V3
324bec55 2290 | PTA_AVX512F | PTA_AVX512BW | PTA_AVX512CD | PTA_AVX512DQ | PTA_AVX512VL;
299a53d7 2291
a1541628 2292constexpr wide_int_bitmask PTA_CORE2 = PTA_64BIT | PTA_MMX | PTA_SSE | PTA_SSE2
c98c2430 2293 | PTA_SSE3 | PTA_SSSE3 | PTA_CX16 | PTA_FXSR;
a1541628 2294constexpr wide_int_bitmask PTA_NEHALEM = PTA_CORE2 | PTA_SSE4_1 | PTA_SSE4_2
c98c2430 2295 | PTA_POPCNT;
a1541628
JJ
2296constexpr wide_int_bitmask PTA_WESTMERE = PTA_NEHALEM | PTA_PCLMUL;
2297constexpr wide_int_bitmask PTA_SANDYBRIDGE = PTA_WESTMERE | PTA_AVX | PTA_XSAVE
c98c2430 2298 | PTA_XSAVEOPT;
a1541628 2299constexpr wide_int_bitmask PTA_IVYBRIDGE = PTA_SANDYBRIDGE | PTA_FSGSBASE
c98c2430 2300 | PTA_RDRND | PTA_F16C;
a1541628 2301constexpr wide_int_bitmask PTA_HASWELL = PTA_IVYBRIDGE | PTA_AVX2 | PTA_BMI
c98c2430 2302 | PTA_BMI2 | PTA_LZCNT | PTA_FMA | PTA_MOVBE | PTA_HLE;
a1541628 2303constexpr wide_int_bitmask PTA_BROADWELL = PTA_HASWELL | PTA_ADX | PTA_RDSEED
c2099c16 2304 | PTA_PRFCHW;
a1541628
JJ
2305constexpr wide_int_bitmask PTA_SKYLAKE = PTA_BROADWELL | PTA_AES
2306 | PTA_CLFLUSHOPT | PTA_XSAVEC | PTA_XSAVES | PTA_SGX;
2307constexpr wide_int_bitmask PTA_SKYLAKE_AVX512 = PTA_SKYLAKE | PTA_AVX512F
c98c2430
ML
2308 | PTA_AVX512CD | PTA_AVX512VL | PTA_AVX512BW | PTA_AVX512DQ | PTA_PKU
2309 | PTA_CLWB;
a1541628
JJ
2310constexpr wide_int_bitmask PTA_CASCADELAKE = PTA_SKYLAKE_AVX512
2311 | PTA_AVX512VNNI;
2312constexpr wide_int_bitmask PTA_COOPERLAKE = PTA_CASCADELAKE | PTA_AVX512BF16;
2313constexpr wide_int_bitmask PTA_CANNONLAKE = PTA_SKYLAKE | PTA_AVX512F
c98c2430
ML
2314 | PTA_AVX512CD | PTA_AVX512VL | PTA_AVX512BW | PTA_AVX512DQ | PTA_PKU
2315 | PTA_AVX512VBMI | PTA_AVX512IFMA | PTA_SHA;
a1541628 2316constexpr wide_int_bitmask PTA_ICELAKE_CLIENT = PTA_CANNONLAKE | PTA_AVX512VNNI
c98c2430 2317 | PTA_GFNI | PTA_VAES | PTA_AVX512VBMI2 | PTA_VPCLMULQDQ | PTA_AVX512BITALG
c422e5f8 2318 | PTA_RDPID | PTA_AVX512VPOPCNTDQ;
c02c39fa 2319constexpr wide_int_bitmask PTA_ROCKETLAKE = PTA_ICELAKE_CLIENT & ~PTA_SGX;
a1541628
JJ
2320constexpr wide_int_bitmask PTA_ICELAKE_SERVER = PTA_ICELAKE_CLIENT
2321 | PTA_PCONFIG | PTA_WBNOINVD | PTA_CLWB;
2322constexpr wide_int_bitmask PTA_TIGERLAKE = PTA_ICELAKE_CLIENT | PTA_MOVDIRI
632a2f50 2323 | PTA_MOVDIR64B | PTA_CLWB | PTA_AVX512VP2INTERSECT | PTA_KL | PTA_WIDEKL;
a1541628 2324constexpr wide_int_bitmask PTA_SAPPHIRERAPIDS = PTA_COOPERLAKE | PTA_MOVDIRI
ba9c87d3 2325 | PTA_MOVDIR64B | PTA_AVX512VP2INTERSECT | PTA_ENQCMD | PTA_CLDEMOTE
5c609842 2326 | PTA_PTWRITE | PTA_WAITPKG | PTA_SERIALIZE | PTA_TSXLDTRK | PTA_AMX_TILE
a6841211 2327 | PTA_AMX_INT8 | PTA_AMX_BF16 | PTA_UINTR | PTA_AVXVNNI | PTA_AVX512FP16;
a1541628
JJ
2328constexpr wide_int_bitmask PTA_KNL = PTA_BROADWELL | PTA_AVX512PF
2329 | PTA_AVX512ER | PTA_AVX512F | PTA_AVX512CD | PTA_PREFETCHWT1;
2330constexpr wide_int_bitmask PTA_BONNELL = PTA_CORE2 | PTA_MOVBE;
2331constexpr wide_int_bitmask PTA_SILVERMONT = PTA_WESTMERE | PTA_MOVBE
2332 | PTA_RDRND | PTA_PRFCHW;
2333constexpr wide_int_bitmask PTA_GOLDMONT = PTA_SILVERMONT | PTA_AES | PTA_SHA
2334 | PTA_XSAVE | PTA_RDSEED | PTA_XSAVEC | PTA_XSAVES | PTA_CLFLUSHOPT
2335 | PTA_XSAVEOPT | PTA_FSGSBASE;
2336constexpr wide_int_bitmask PTA_GOLDMONT_PLUS = PTA_GOLDMONT | PTA_RDPID
41f8d1fc 2337 | PTA_SGX | PTA_PTWRITE;
a1541628 2338constexpr wide_int_bitmask PTA_TREMONT = PTA_GOLDMONT_PLUS | PTA_CLWB
dc7e8839 2339 | PTA_GFNI | PTA_MOVDIRI | PTA_MOVDIR64B | PTA_CLDEMOTE | PTA_WAITPKG;
f2be0833
CL
2340constexpr wide_int_bitmask PTA_ALDERLAKE = PTA_TREMONT | PTA_ADX | PTA_AVX
2341 | PTA_AVX2 | PTA_BMI | PTA_BMI2 | PTA_F16C | PTA_FMA | PTA_LZCNT
2342 | PTA_PCONFIG | PTA_PKU | PTA_VAES | PTA_VPCLMULQDQ | PTA_SERIALIZE
2343 | PTA_HRESET | PTA_KL | PTA_WIDEKL | PTA_AVXVNNI;
a1541628 2344constexpr wide_int_bitmask PTA_KNM = PTA_KNL | PTA_AVX5124VNNIW
c98c2430
ML
2345 | PTA_AVX5124FMAPS | PTA_AVX512VPOPCNTDQ;
2346
2347#ifndef GENERATOR_FILE
2348
2349#include "insn-attr-common.h"
2350
3fb2c2f4
L
2351#include "common/config/i386/i386-cpuinfo.h"
2352
6c1dae73 2353class pta
c98c2430 2354{
6c1dae73 2355public:
c98c2430
ML
2356 const char *const name; /* processor name or nickname. */
2357 const enum processor_type processor;
2358 const enum attr_cpu schedule;
2359 const wide_int_bitmask flags;
3fb2c2f4
L
2360 const int model;
2361 const enum feature_priority priority;
c98c2430
ML
2362};
2363
2364extern const pta processor_alias_table[];
5ebdd535 2365extern unsigned int const pta_size;
3fb2c2f4 2366extern unsigned int const num_arch_names;
c98c2430
ML
2367#endif
2368
2369#endif
2370
9e555526 2371extern enum processor_type ix86_tune;
5bf0ebab 2372extern enum processor_type ix86_arch;
5bf0ebab 2373
8362f420
JH
2374/* Size of the RED_ZONE area. */
2375#define RED_ZONE_SIZE 128
2376/* Reserved area of the red zone for temporaries. */
2377#define RED_ZONE_RESERVE 8
c93e80a5 2378
95899b34 2379extern unsigned int ix86_preferred_stack_boundary;
2e3f842f 2380extern unsigned int ix86_incoming_stack_boundary;
5bf0ebab
RH
2381
2382/* Smallest class containing REGNO. */
2383extern enum reg_class const regclass_map[FIRST_PSEUDO_REGISTER];
2384
0948ccb2
PB
2385enum ix86_fpcmp_strategy {
2386 IX86_FPCMP_SAHF,
2387 IX86_FPCMP_COMI,
2388 IX86_FPCMP_ARITH
2389};
22fb740d
JH
2390\f
2391/* To properly truncate FP values into integers, we need to set i387 control
2392 word. We can't emit proper mode switching code before reload, as spills
2393 generated by reload may truncate values incorrectly, but we still can avoid
2394 redundant computation of new control word by the mode switching pass.
2395 The fldcw instructions are still emitted redundantly, but this is probably
2396 not going to be noticeable problem, as most CPUs do have fast path for
fce5a9f2 2397 the sequence.
22fb740d
JH
2398
2399 The machinery is to emit simple truncation instructions and split them
2400 before reload to instructions having USEs of two memory locations that
2401 are filled by this code to old and new control word.
fce5a9f2 2402
22fb740d
JH
2403 Post-reload pass may be later used to eliminate the redundant fildcw if
2404 needed. */
2405
c7ca8ef8
UB
2406enum ix86_stack_slot
2407{
2408 SLOT_TEMP = 0,
2409 SLOT_CW_STORED,
d3b92f35 2410 SLOT_CW_ROUNDEVEN,
c7ca8ef8
UB
2411 SLOT_CW_TRUNC,
2412 SLOT_CW_FLOOR,
2413 SLOT_CW_CEIL,
80008279 2414 SLOT_STV_TEMP,
c7ca8ef8
UB
2415 MAX_386_STACK_LOCALS
2416};
2417
ff680eb1
UB
2418enum ix86_entity
2419{
c7ca8ef8
UB
2420 X86_DIRFLAG = 0,
2421 AVX_U128,
d3b92f35 2422 I387_ROUNDEVEN,
ff97910d 2423 I387_TRUNC,
ff680eb1
UB
2424 I387_FLOOR,
2425 I387_CEIL,
ff680eb1
UB
2426 MAX_386_ENTITIES
2427};
2428
c7ca8ef8 2429enum x86_dirflag_state
ff680eb1 2430{
c7ca8ef8
UB
2431 X86_DIRFLAG_RESET,
2432 X86_DIRFLAG_ANY
ff680eb1 2433};
22fb740d 2434
ff97910d
VY
2435enum avx_u128_state
2436{
2437 AVX_U128_CLEAN,
2438 AVX_U128_DIRTY,
2439 AVX_U128_ANY
2440};
2441
22fb740d
JH
2442/* Define this macro if the port needs extra instructions inserted
2443 for mode switching in an optimizing compilation. */
2444
ff680eb1
UB
2445#define OPTIMIZE_MODE_SWITCHING(ENTITY) \
2446 ix86_optimize_mode_switching[(ENTITY)]
22fb740d
JH
2447
2448/* If you define `OPTIMIZE_MODE_SWITCHING', you have to define this as
2449 initializer for an array of integers. Each initializer element N
2450 refers to an entity that needs mode switching, and specifies the
2451 number of different modes that might need to be set for this
2452 entity. The position of the initializer in the initializer -
2453 starting counting at zero - determines the integer that is used to
2454 refer to the mode-switched entity in question. */
2455
c7ca8ef8
UB
2456#define NUM_MODES_FOR_MODE_SWITCHING \
2457 { X86_DIRFLAG_ANY, AVX_U128_ANY, \
d3b92f35 2458 I387_CW_ANY, I387_CW_ANY, I387_CW_ANY, I387_CW_ANY }
22fb740d 2459
0f0138b6
JH
2460\f
2461/* Avoid renaming of stack registers, as doing so in combination with
2462 scheduling just increases amount of live registers at time and in
2463 the turn amount of fxch instructions needed.
2464
3f97cb0b
AI
2465 ??? Maybe Pentium chips benefits from renaming, someone can try....
2466
2467 Don't rename evex to non-evex sse registers. */
0f0138b6 2468
1a6e82b8
UB
2469#define HARD_REGNO_RENAME_OK(SRC, TARGET) \
2470 (!STACK_REGNO_P (SRC) \
2471 && EXT_REX_SSE_REGNO_P (SRC) == EXT_REX_SSE_REGNO_P (TARGET))
22fb740d 2472
3b3c6a3f 2473\f
e91f04de 2474#define FASTCALL_PREFIX '@'
fa1a0d02 2475\f
77560086
BE
2476#ifndef USED_FOR_TARGET
2477/* Structure describing stack frame layout.
2478 Stack grows downward:
2479
2480 [arguments]
2481 <- ARG_POINTER
2482 saved pc
2483
2484 saved static chain if ix86_static_chain_on_stack
2485
2486 saved frame pointer if frame_pointer_needed
2487 <- HARD_FRAME_POINTER
2488 [saved regs]
2489 <- reg_save_offset
2490 [padding0]
2491 <- stack_realign_offset
2492 [saved SSE regs]
2493 OR
2494 [stub-saved registers for ms x64 --> sysv clobbers
2495 <- Start of out-of-line, stub-saved/restored regs
2496 (see libgcc/config/i386/(sav|res)ms64*.S)
2497 [XMM6-15]
2498 [RSI]
2499 [RDI]
2500 [?RBX] only if RBX is clobbered
2501 [?RBP] only if RBP and RBX are clobbered
2502 [?R12] only if R12 and all previous regs are clobbered
2503 [?R13] only if R13 and all previous regs are clobbered
2504 [?R14] only if R14 and all previous regs are clobbered
2505 [?R15] only if R15 and all previous regs are clobbered
2506 <- end of stub-saved/restored regs
2507 [padding1]
2508 ]
5d9d834d 2509 <- sse_reg_save_offset
77560086
BE
2510 [padding2]
2511 | <- FRAME_POINTER
2512 [va_arg registers] |
2513 |
2514 [frame] |
2515 |
2516 [padding2] | = to_allocate
2517 <- STACK_POINTER
2518 */
2519struct GTY(()) ix86_frame
2520{
2521 int nsseregs;
2522 int nregs;
2523 int va_arg_size;
2524 int red_zone_size;
2525 int outgoing_arguments_size;
2526
2527 /* The offsets relative to ARG_POINTER. */
2528 HOST_WIDE_INT frame_pointer_offset;
2529 HOST_WIDE_INT hard_frame_pointer_offset;
2530 HOST_WIDE_INT stack_pointer_offset;
2531 HOST_WIDE_INT hfp_save_offset;
2532 HOST_WIDE_INT reg_save_offset;
122f9da1 2533 HOST_WIDE_INT stack_realign_allocate;
77560086 2534 HOST_WIDE_INT stack_realign_offset;
77560086
BE
2535 HOST_WIDE_INT sse_reg_save_offset;
2536
2537 /* When save_regs_using_mov is set, emit prologue using
2538 move instead of push instructions. */
2539 bool save_regs_using_mov;
2f007861
RS
2540
2541 /* Assume without checking that:
2542 EXPENSIVE_P = expensive_function_p (EXPENSIVE_COUNT). */
2543 bool expensive_p;
2544 int expensive_count;
77560086
BE
2545};
2546
122f9da1
DS
2547/* Machine specific frame tracking during prologue/epilogue generation. All
2548 values are positive, but since the x86 stack grows downward, are subtratced
2549 from the CFA to produce a valid address. */
cd9c1ca8 2550
ec7ded37 2551struct GTY(()) machine_frame_state
cd9c1ca8 2552{
ec7ded37
RH
2553 /* This pair tracks the currently active CFA as reg+offset. When reg
2554 is drap_reg, we don't bother trying to record here the real CFA when
2555 it might really be a DW_CFA_def_cfa_expression. */
2556 rtx cfa_reg;
2557 HOST_WIDE_INT cfa_offset;
2558
2559 /* The current offset (canonically from the CFA) of ESP and EBP.
2560 When stack frame re-alignment is active, these may not be relative
2561 to the CFA. However, in all cases they are relative to the offsets
2562 of the saved registers stored in ix86_frame. */
2563 HOST_WIDE_INT sp_offset;
2564 HOST_WIDE_INT fp_offset;
2565
2566 /* The size of the red-zone that may be assumed for the purposes of
2567 eliding register restore notes in the epilogue. This may be zero
2568 if no red-zone is in effect, or may be reduced from the real
2569 red-zone value by a maximum runtime stack re-alignment value. */
2570 int red_zone_offset;
2571
2572 /* Indicate whether each of ESP, EBP or DRAP currently holds a valid
2573 value within the frame. If false then the offset above should be
2574 ignored. Note that DRAP, if valid, *always* points to the CFA and
2575 thus has an offset of zero. */
2576 BOOL_BITFIELD sp_valid : 1;
2577 BOOL_BITFIELD fp_valid : 1;
2578 BOOL_BITFIELD drap_valid : 1;
c9f4c451
RH
2579
2580 /* Indicate whether the local stack frame has been re-aligned. When
2581 set, the SP/FP offsets above are relative to the aligned frame
2582 and not the CFA. */
2583 BOOL_BITFIELD realigned : 1;
d6d4d770
DS
2584
2585 /* Indicates whether the stack pointer has been re-aligned. When set,
2586 SP/FP continue to be relative to the CFA, but the stack pointer
122f9da1
DS
2587 should only be used for offsets > sp_realigned_offset, while
2588 the frame pointer should be used for offsets <= sp_realigned_fp_last.
d6d4d770
DS
2589 The flags realigned and sp_realigned are mutually exclusive. */
2590 BOOL_BITFIELD sp_realigned : 1;
2591
122f9da1
DS
2592 /* If sp_realigned is set, this is the last valid offset from the CFA
2593 that can be used for access with the frame pointer. */
2594 HOST_WIDE_INT sp_realigned_fp_last;
2595
2596 /* If sp_realigned is set, this is the offset from the CFA that the stack
2597 pointer was realigned, and may or may not be equal to sp_realigned_fp_last.
2598 Access via the stack pointer is only valid for offsets that are greater than
2599 this value. */
d6d4d770 2600 HOST_WIDE_INT sp_realigned_offset;
cd9c1ca8
RH
2601};
2602
f81c9774
RH
2603/* Private to winnt.c. */
2604struct seh_frame_state;
2605
f8071c05
L
2606enum function_type
2607{
2608 TYPE_UNKNOWN = 0,
2609 TYPE_NORMAL,
2610 /* The current function is an interrupt service routine with a
2611 pointer argument as specified by the "interrupt" attribute. */
2612 TYPE_INTERRUPT,
2613 /* The current function is an interrupt service routine with a
2614 pointer argument and an integer argument as specified by the
2615 "interrupt" attribute. */
2616 TYPE_EXCEPTION
2617};
2618
3dcea658
L
2619enum queued_insn_type
2620{
2621 TYPE_NONE = 0,
2622 TYPE_ENDBR,
2623 TYPE_PATCHABLE_AREA
2624};
2625
d1b38208 2626struct GTY(()) machine_function {
fa1a0d02 2627 struct stack_local_entry *stack_locals;
4aab97f9
L
2628 int varargs_gpr_size;
2629 int varargs_fpr_size;
ff680eb1 2630 int optimize_mode_switching[MAX_386_ENTITIES];
3452586b 2631
77560086
BE
2632 /* Cached initial frame layout for the current function. */
2633 struct ix86_frame frame;
3452586b 2634
7458026b
ILT
2635 /* For -fsplit-stack support: A stack local which holds a pointer to
2636 the stack arguments for a function with a variable number of
2637 arguments. This is set at the start of the function and is used
2638 to initialize the overflow_arg_area field of the va_list
2639 structure. */
2640 rtx split_stack_varargs_pointer;
2641
3452586b
RH
2642 /* This value is used for amd64 targets and specifies the current abi
2643 to be used. MS_ABI means ms abi. Otherwise SYSV_ABI means sysv abi. */
25efe060 2644 ENUM_BITFIELD(calling_abi) call_abi : 8;
3452586b
RH
2645
2646 /* Nonzero if the function accesses a previous frame. */
2647 BOOL_BITFIELD accesses_prev_frame : 1;
2648
922e3e33
UB
2649 /* Set by ix86_compute_frame_layout and used by prologue/epilogue
2650 expander to determine the style used. */
3452586b
RH
2651 BOOL_BITFIELD use_fast_prologue_epilogue : 1;
2652
1e4490dc
UB
2653 /* Nonzero if the current function calls pc thunk and
2654 must not use the red zone. */
2655 BOOL_BITFIELD pc_thunk_call_expanded : 1;
2656
5bf5a10b
AO
2657 /* If true, the current function needs the default PIC register, not
2658 an alternate register (on x86) and must not use the red zone (on
2659 x86_64), even if it's a leaf function. We don't want the
2660 function to be regarded as non-leaf because TLS calls need not
2661 affect register allocation. This flag is set when a TLS call
2662 instruction is expanded within a function, and never reset, even
2663 if all such instructions are optimized away. Use the
2664 ix86_current_function_calls_tls_descriptor macro for a better
2665 approximation. */
3452586b
RH
2666 BOOL_BITFIELD tls_descriptor_call_expanded_p : 1;
2667
2668 /* If true, the current function has a STATIC_CHAIN is placed on the
2669 stack below the return address. */
2670 BOOL_BITFIELD static_chain_on_stack : 1;
25efe060 2671
529a6471
JJ
2672 /* If true, it is safe to not save/restore DRAP register. */
2673 BOOL_BITFIELD no_drap_save_restore : 1;
2674
f8071c05
L
2675 /* Function type. */
2676 ENUM_BITFIELD(function_type) func_type : 2;
2677
da99fd4a
L
2678 /* How to generate indirec branch. */
2679 ENUM_BITFIELD(indirect_branch) indirect_branch_type : 3;
2680
2681 /* If true, the current function has local indirect jumps, like
2682 "indirect_jump" or "tablejump". */
2683 BOOL_BITFIELD has_local_indirect_jump : 1;
2684
45e14019
L
2685 /* How to generate function return. */
2686 ENUM_BITFIELD(indirect_branch) function_return_type : 3;
2687
f8071c05
L
2688 /* If true, the current function is a function specified with
2689 the "interrupt" or "no_caller_saved_registers" attribute. */
2690 BOOL_BITFIELD no_caller_saved_registers : 1;
2691
a0ff7835
L
2692 /* If true, there is register available for argument passing. This
2693 is used only in ix86_function_ok_for_sibcall by 32-bit to determine
2694 if there is scratch register available for indirect sibcall. In
2695 64-bit, rax, r10 and r11 are scratch registers which aren't used to
2696 pass arguments and can be used for indirect sibcall. */
2697 BOOL_BITFIELD arg_reg_available : 1;
2698
d6d4d770 2699 /* If true, we're out-of-lining reg save/restore for regs clobbered
5d9d834d 2700 by 64-bit ms_abi functions calling a sysv_abi function. */
d6d4d770
DS
2701 BOOL_BITFIELD call_ms2sysv : 1;
2702
2703 /* If true, the incoming 16-byte aligned stack has an offset (of 8) and
5d9d834d 2704 needs padding prior to out-of-line stub save/restore area. */
d6d4d770
DS
2705 BOOL_BITFIELD call_ms2sysv_pad_in : 1;
2706
d6d4d770
DS
2707 /* This is the number of extra registers saved by stub (valid range is
2708 0-6). Each additional register is only saved/restored by the stubs
2709 if all successive ones are. (Will always be zero when using a hard
2710 frame pointer.) */
2711 unsigned int call_ms2sysv_extra_regs:3;
2712
35c95658
L
2713 /* Nonzero if the function places outgoing arguments on stack. */
2714 BOOL_BITFIELD outgoing_args_on_stack : 1;
2715
3dcea658
L
2716 /* If true, ENDBR or patchable area is queued at function entrance. */
2717 ENUM_BITFIELD(queued_insn_type) insn_queued_at_entrance : 2;
2718
2719 /* If true, the function label has been emitted. */
2720 BOOL_BITFIELD function_label_emitted : 1;
708c728d 2721
c2080a1f
L
2722 /* True if the function needs a stack frame. */
2723 BOOL_BITFIELD stack_frame_required : 1;
2724
5e2eabe1
L
2725 /* True if we should act silently, rather than raise an error for
2726 invalid calls. */
2727 BOOL_BITFIELD silent_p : 1;
2728
3f04e378
L
2729 /* True if red zone is used. */
2730 BOOL_BITFIELD red_zone_used : 1;
2731
cd3410cc
L
2732 /* The largest alignment, in bytes, of stack slot actually used. */
2733 unsigned int max_used_stack_alignment;
2734
ec7ded37
RH
2735 /* During prologue/epilogue generation, the current frame state.
2736 Otherwise, the frame state at the end of the prologue. */
2737 struct machine_frame_state fs;
f81c9774
RH
2738
2739 /* During SEH output, this is non-null. */
2740 struct seh_frame_state * GTY((skip(""))) seh;
fa1a0d02 2741};
2bf6d935
ML
2742
2743extern GTY(()) tree sysv_va_list_type_node;
2744extern GTY(()) tree ms_va_list_type_node;
cd9c1ca8 2745#endif
fa1a0d02
JH
2746
2747#define ix86_stack_locals (cfun->machine->stack_locals)
4aab97f9
L
2748#define ix86_varargs_gpr_size (cfun->machine->varargs_gpr_size)
2749#define ix86_varargs_fpr_size (cfun->machine->varargs_fpr_size)
fa1a0d02 2750#define ix86_optimize_mode_switching (cfun->machine->optimize_mode_switching)
1e4490dc 2751#define ix86_pc_thunk_call_expanded (cfun->machine->pc_thunk_call_expanded)
5bf5a10b
AO
2752#define ix86_tls_descriptor_calls_expanded_in_cfun \
2753 (cfun->machine->tls_descriptor_call_expanded_p)
2754/* Since tls_descriptor_call_expanded is not cleared, even if all TLS
2755 calls are optimized away, we try to detect cases in which it was
2756 optimized away. Since such instructions (use (reg REG_SP)), we can
2757 verify whether there's any such instruction live by testing that
2758 REG_SP is live. */
2759#define ix86_current_function_calls_tls_descriptor \
6fb5fa3c 2760 (ix86_tls_descriptor_calls_expanded_in_cfun && df_regs_ever_live_p (SP_REG))
3452586b 2761#define ix86_static_chain_on_stack (cfun->machine->static_chain_on_stack)
3f04e378 2762#define ix86_red_zone_used (cfun->machine->red_zone_used)
249e6b63 2763
1bc7c5b6
ZW
2764/* Control behavior of x86_file_start. */
2765#define X86_FILE_START_VERSION_DIRECTIVE false
2766#define X86_FILE_START_FLTUSED false
2767
7dcbf659
JH
2768/* Flag to mark data that is in the large address area. */
2769#define SYMBOL_FLAG_FAR_ADDR (SYMBOL_FLAG_MACH_DEP << 0)
2770#define SYMBOL_REF_FAR_ADDR_P(X) \
2771 ((SYMBOL_REF_FLAGS (X) & SYMBOL_FLAG_FAR_ADDR) != 0)
da489f73
RH
2772
2773/* Flags to mark dllimport/dllexport. Used by PE ports, but handy to
2774 have defined always, to avoid ifdefing. */
2775#define SYMBOL_FLAG_DLLIMPORT (SYMBOL_FLAG_MACH_DEP << 1)
2776#define SYMBOL_REF_DLLIMPORT_P(X) \
2777 ((SYMBOL_REF_FLAGS (X) & SYMBOL_FLAG_DLLIMPORT) != 0)
2778
2779#define SYMBOL_FLAG_DLLEXPORT (SYMBOL_FLAG_MACH_DEP << 2)
2780#define SYMBOL_REF_DLLEXPORT_P(X) \
2781 ((SYMBOL_REF_FLAGS (X) & SYMBOL_FLAG_DLLEXPORT) != 0)
2782
82c0e1a0
KT
2783#define SYMBOL_FLAG_STUBVAR (SYMBOL_FLAG_MACH_DEP << 4)
2784#define SYMBOL_REF_STUBVAR_P(X) \
2785 ((SYMBOL_REF_FLAGS (X) & SYMBOL_FLAG_STUBVAR) != 0)
2786
7942e47e
RY
2787extern void debug_ready_dispatch (void);
2788extern void debug_dispatch_window (int);
2789
91afcfa3
QN
2790/* The value at zero is only defined for the BMI instructions
2791 LZCNT and TZCNT, not the BSR/BSF insns in the original isa. */
2792#define CTZ_DEFINED_VALUE_AT_ZERO(MODE, VALUE) \
4f73bf20 2793 ((VALUE) = GET_MODE_BITSIZE (MODE), TARGET_BMI ? 2 : 0)
91afcfa3 2794#define CLZ_DEFINED_VALUE_AT_ZERO(MODE, VALUE) \
4f73bf20 2795 ((VALUE) = GET_MODE_BITSIZE (MODE), TARGET_LZCNT ? 2 : 0)
91afcfa3
QN
2796
2797
b8ce4e94
KT
2798/* Flags returned by ix86_get_callcvt (). */
2799#define IX86_CALLCVT_CDECL 0x1
2800#define IX86_CALLCVT_STDCALL 0x2
2801#define IX86_CALLCVT_FASTCALL 0x4
2802#define IX86_CALLCVT_THISCALL 0x8
2803#define IX86_CALLCVT_REGPARM 0x10
2804#define IX86_CALLCVT_SSEREGPARM 0x20
2805
2806#define IX86_BASE_CALLCVT(FLAGS) \
2807 ((FLAGS) & (IX86_CALLCVT_CDECL | IX86_CALLCVT_STDCALL \
2808 | IX86_CALLCVT_FASTCALL | IX86_CALLCVT_THISCALL))
2809
b86b9f44
MM
2810#define RECIP_MASK_NONE 0x00
2811#define RECIP_MASK_DIV 0x01
2812#define RECIP_MASK_SQRT 0x02
2813#define RECIP_MASK_VEC_DIV 0x04
2814#define RECIP_MASK_VEC_SQRT 0x08
2815#define RECIP_MASK_ALL (RECIP_MASK_DIV | RECIP_MASK_SQRT \
2816 | RECIP_MASK_VEC_DIV | RECIP_MASK_VEC_SQRT)
bbe996ec 2817#define RECIP_MASK_DEFAULT (RECIP_MASK_VEC_DIV | RECIP_MASK_VEC_SQRT)
b86b9f44
MM
2818
2819#define TARGET_RECIP_DIV ((recip_mask & RECIP_MASK_DIV) != 0)
2820#define TARGET_RECIP_SQRT ((recip_mask & RECIP_MASK_SQRT) != 0)
2821#define TARGET_RECIP_VEC_DIV ((recip_mask & RECIP_MASK_VEC_DIV) != 0)
2822#define TARGET_RECIP_VEC_SQRT ((recip_mask & RECIP_MASK_VEC_SQRT) != 0)
2823
ab2c4ec8
SS
2824/* Use 128-bit AVX instructions in the auto-vectorizer. */
2825#define TARGET_PREFER_AVX128 (prefer_vector_width_type == PVW_AVX128)
2826/* Use 256-bit AVX instructions in the auto-vectorizer. */
02a70367
SS
2827#define TARGET_PREFER_AVX256 (TARGET_PREFER_AVX128 \
2828 || prefer_vector_width_type == PVW_AVX256)
ab2c4ec8 2829
c2c601b2
L
2830#define TARGET_INDIRECT_BRANCH_REGISTER \
2831 (ix86_indirect_branch_register \
2832 || cfun->machine->indirect_branch_type != indirect_branch_keep)
2833
5dcfdccd
KY
2834#define IX86_HLE_ACQUIRE (1 << 16)
2835#define IX86_HLE_RELEASE (1 << 17)
2836
e83b8e2e
JJ
2837/* For switching between functions with different target attributes. */
2838#define SWITCHABLE_TARGET 1
2839
44d0de8d
UB
2840#define TARGET_SUPPORTS_WIDE_INT 1
2841
2bf6d935
ML
2842#if !defined(GENERATOR_FILE) && !defined(IN_LIBGCC2)
2843extern enum attr_cpu ix86_schedule;
2844
2845#define NUM_X86_64_MS_CLOBBERED_REGS 12
2846#endif
2847
c98f8742
JVA
2848/*
2849Local variables:
2850version-control: t
2851End:
2852*/