1 /* Definitions of target machine for GCC for IA-32.
2 Copyright (C) 1988-2016 Free Software Foundation, Inc.
4 This file is part of GCC.
6 GCC is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation; either version 3, or (at your option)
11 GCC is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
16 You should have received a copy of the GNU General Public License
17 along with GCC; see the file COPYING3. If not see
18 <http://www.gnu.org/licenses/>. */
20 /* In i386-common.c. */
21 extern bool ix86_handle_option (struct gcc_options
*opts
,
22 struct gcc_options
*opts_set ATTRIBUTE_UNUSED
,
23 const struct cl_decoded_option
*decoded
,
26 /* Functions in i386.c */
27 extern bool ix86_target_stack_probe (void);
28 extern bool ix86_can_use_return_insn_p (void);
29 extern void ix86_setup_frame_addresses (void);
31 extern HOST_WIDE_INT
ix86_initial_elimination_offset (int, int);
32 extern void ix86_expand_prologue (void);
33 extern void ix86_maybe_emit_epilogue_vzeroupper (void);
34 extern void ix86_expand_epilogue (int);
35 extern void ix86_expand_split_stack_prologue (void);
37 extern void ix86_output_addr_vec_elt (FILE *, int);
38 extern void ix86_output_addr_diff_elt (FILE *, int, int);
40 extern enum calling_abi
ix86_cfun_abi (void);
41 extern enum calling_abi
ix86_function_type_abi (const_tree
);
43 extern bool ix86_use_pseudo_pic_reg (void);
45 extern void ix86_reset_previous_fndecl (void);
47 extern bool ix86_using_red_zone (void);
50 extern int standard_80387_constant_p (rtx
);
51 extern const char *standard_80387_constant_opcode (rtx
);
52 extern rtx
standard_80387_constant_rtx (int);
53 extern int standard_sse_constant_p (rtx
, machine_mode
);
54 extern const char *standard_sse_constant_opcode (rtx_insn
*, rtx
);
55 extern bool ix86_standard_x87sse_constant_load_p (const rtx_insn
*, rtx
);
56 extern bool symbolic_reference_mentioned_p (rtx
);
57 extern bool extended_reg_mentioned_p (rtx
);
58 extern bool x86_extended_QIreg_mentioned_p (rtx_insn
*);
59 extern bool x86_extended_reg_mentioned_p (rtx
);
60 extern bool x86_maybe_negate_const_int (rtx
*, machine_mode
);
61 extern machine_mode
ix86_cc_mode (enum rtx_code
, rtx
, rtx
);
63 extern int avx_vpermilp_parallel (rtx par
, machine_mode mode
);
64 extern int avx_vperm2f128_parallel (rtx par
, machine_mode mode
);
66 extern bool ix86_expand_strlen (rtx
, rtx
, rtx
, rtx
);
67 extern bool ix86_expand_set_or_movmem (rtx
, rtx
, rtx
, rtx
, rtx
, rtx
,
68 rtx
, rtx
, rtx
, rtx
, bool);
70 extern bool constant_address_p (rtx
);
71 extern bool legitimate_pic_operand_p (rtx
);
72 extern bool legitimate_pic_address_disp_p (rtx
);
73 extern bool ix86_force_load_from_GOT_p (rtx
);
74 extern void print_reg (rtx
, int, FILE*);
75 extern void ix86_print_operand (FILE *, rtx
, int);
77 extern void split_double_mode (machine_mode
, rtx
[], int, rtx
[], rtx
[]);
79 extern const char *output_set_got (rtx
, rtx
);
80 extern const char *output_387_binary_op (rtx
, rtx
*);
81 extern const char *output_387_reg_move (rtx
, rtx
*);
82 extern const char *output_fix_trunc (rtx_insn
*, rtx
*, bool);
83 extern const char *output_fp_compare (rtx
, rtx
*, bool, bool);
84 extern const char *output_adjust_stack_and_probe (rtx
);
85 extern const char *output_probe_stack_range (rtx
, rtx
);
87 extern void ix86_expand_clear (rtx
);
88 extern void ix86_expand_move (machine_mode
, rtx
[]);
89 extern void ix86_expand_vector_move (machine_mode
, rtx
[]);
90 extern void ix86_expand_vector_move_misalign (machine_mode
, rtx
[]);
91 extern rtx
ix86_fixup_binary_operands (enum rtx_code
,
93 extern void ix86_fixup_binary_operands_no_copy (enum rtx_code
,
95 extern void ix86_expand_binary_operator (enum rtx_code
,
97 extern void ix86_expand_vector_logical_operator (enum rtx_code
,
99 extern bool ix86_binary_operator_ok (enum rtx_code
, machine_mode
, rtx
[]);
100 extern bool ix86_avoid_lea_for_add (rtx_insn
*, rtx
[]);
101 extern bool ix86_use_lea_for_mov (rtx_insn
*, rtx
[]);
102 extern bool ix86_avoid_lea_for_addr (rtx_insn
*, rtx
[]);
103 extern void ix86_split_lea_for_addr (rtx_insn
*, rtx
[], machine_mode
);
104 extern bool ix86_lea_for_add_ok (rtx_insn
*, rtx
[]);
105 extern bool ix86_vec_interleave_v2df_operator_ok (rtx operands
[3], bool high
);
106 extern bool ix86_dep_by_shift_count (const_rtx set_insn
, const_rtx use_insn
);
107 extern bool ix86_agi_dependent (rtx_insn
*set_insn
, rtx_insn
*use_insn
);
108 extern void ix86_expand_unary_operator (enum rtx_code
, machine_mode
,
110 extern rtx
ix86_build_const_vector (machine_mode
, bool, rtx
);
111 extern rtx
ix86_build_signbit_mask (machine_mode
, bool, bool);
112 extern void ix86_split_convert_uns_si_sse (rtx
[]);
113 extern void ix86_expand_convert_uns_didf_sse (rtx
, rtx
);
114 extern void ix86_expand_convert_uns_sixf_sse (rtx
, rtx
);
115 extern void ix86_expand_convert_uns_sidf_sse (rtx
, rtx
);
116 extern void ix86_expand_convert_uns_sisf_sse (rtx
, rtx
);
117 extern void ix86_expand_convert_sign_didf_sse (rtx
, rtx
);
118 extern void ix86_expand_vector_convert_uns_vsivsf (rtx
, rtx
);
119 extern rtx
ix86_expand_adjust_ufix_to_sfix_si (rtx
, rtx
*);
120 extern enum ix86_fpcmp_strategy
ix86_fp_comparison_strategy (enum rtx_code
);
121 extern void ix86_expand_fp_absneg_operator (enum rtx_code
, machine_mode
,
123 extern void ix86_expand_copysign (rtx
[]);
124 extern void ix86_split_copysign_const (rtx
[]);
125 extern void ix86_split_copysign_var (rtx
[]);
126 extern bool ix86_unary_operator_ok (enum rtx_code
, machine_mode
, rtx
[]);
127 extern bool ix86_match_ccmode (rtx
, machine_mode
);
128 extern void ix86_expand_branch (enum rtx_code
, rtx
, rtx
, rtx
);
129 extern void ix86_expand_setcc (rtx
, enum rtx_code
, rtx
, rtx
);
130 extern bool ix86_expand_int_movcc (rtx
[]);
131 extern bool ix86_expand_fp_movcc (rtx
[]);
132 extern bool ix86_expand_fp_vcond (rtx
[]);
133 extern bool ix86_expand_int_vcond (rtx
[]);
134 extern void ix86_expand_vec_perm (rtx
[]);
135 extern bool ix86_expand_vec_perm_const (rtx
[]);
136 extern bool ix86_expand_mask_vec_cmp (rtx
[]);
137 extern bool ix86_expand_int_vec_cmp (rtx
[]);
138 extern bool ix86_expand_fp_vec_cmp (rtx
[]);
139 extern void ix86_expand_sse_movcc (rtx
, rtx
, rtx
, rtx
);
140 extern void ix86_expand_sse_unpack (rtx
, rtx
, bool, bool);
141 extern bool ix86_expand_int_addcc (rtx
[]);
142 extern rtx
ix86_expand_call (rtx
, rtx
, rtx
, rtx
, rtx
, bool);
143 extern void ix86_split_call_vzeroupper (rtx
, rtx
);
144 extern void x86_initialize_trampoline (rtx
, rtx
, rtx
);
145 extern rtx
ix86_zero_extend_to_Pmode (rtx
);
146 extern void ix86_split_long_move (rtx
[]);
147 extern void ix86_split_ashl (rtx
*, rtx
, machine_mode
);
148 extern void ix86_split_ashr (rtx
*, rtx
, machine_mode
);
149 extern void ix86_split_lshr (rtx
*, rtx
, machine_mode
);
150 extern rtx
ix86_find_base_term (rtx
);
151 extern bool ix86_check_movabs (rtx
, int);
152 extern bool ix86_check_no_addr_space (rtx
);
153 extern void ix86_split_idivmod (machine_mode
, rtx
[], bool);
155 extern rtx
assign_386_stack_local (machine_mode
, enum ix86_stack_slot
);
156 extern int ix86_attr_length_immediate_default (rtx_insn
*, bool);
157 extern int ix86_attr_length_address_default (rtx_insn
*);
158 extern int ix86_attr_length_vex_default (rtx_insn
*, bool, bool);
160 extern machine_mode
ix86_fp_compare_mode (enum rtx_code
);
162 extern rtx
ix86_libcall_value (machine_mode
);
163 extern bool ix86_function_arg_regno_p (int);
164 extern void ix86_asm_output_function_label (FILE *, const char *, tree
);
165 extern void ix86_call_abi_override (const_tree
);
166 extern int ix86_reg_parm_stack_space (const_tree
);
168 extern void ix86_split_fp_branch (enum rtx_code code
, rtx
, rtx
,
170 extern bool ix86_hard_regno_mode_ok (int, machine_mode
);
171 extern bool ix86_modes_tieable_p (machine_mode
, machine_mode
);
172 extern bool ix86_secondary_memory_needed (enum reg_class
, enum reg_class
,
174 extern bool ix86_cannot_change_mode_class (machine_mode
,
175 machine_mode
, enum reg_class
);
177 extern bool ix86_libc_has_function (enum function_class fn_class
);
179 extern void x86_order_regs_for_local_alloc (void);
180 extern void x86_function_profiler (FILE *, int);
181 extern void x86_emit_floatuns (rtx
[2]);
182 extern void ix86_emit_fp_unordered_jump (rtx
);
184 extern void ix86_emit_i387_log1p (rtx
, rtx
);
185 extern void ix86_emit_i387_round (rtx
, rtx
);
186 extern void ix86_emit_swdivsf (rtx
, rtx
, rtx
, machine_mode
);
187 extern void ix86_emit_swsqrtsf (rtx
, rtx
, machine_mode
, bool);
189 extern enum rtx_code
ix86_reverse_condition (enum rtx_code
, machine_mode
);
191 extern void ix86_expand_lround (rtx
, rtx
);
192 extern void ix86_expand_lfloorceil (rtx
, rtx
, bool);
193 extern void ix86_expand_rint (rtx
, rtx
);
194 extern void ix86_expand_floorceil (rtx
, rtx
, bool);
195 extern void ix86_expand_floorceildf_32 (rtx
, rtx
, bool);
196 extern void ix86_expand_round_sse4 (rtx
, rtx
);
197 extern void ix86_expand_round (rtx
, rtx
);
198 extern void ix86_expand_rounddf_32 (rtx
, rtx
);
199 extern void ix86_expand_trunc (rtx
, rtx
);
200 extern void ix86_expand_truncdf_32 (rtx
, rtx
);
202 extern void ix86_expand_vecop_qihi (enum rtx_code
, rtx
, rtx
, rtx
);
205 extern void init_cumulative_args (CUMULATIVE_ARGS
*, tree
, rtx
, tree
, int);
206 #endif /* TREE_CODE */
208 #endif /* RTX_CODE */
211 extern int ix86_data_alignment (tree
, int, bool);
212 extern unsigned int ix86_local_alignment (tree
, machine_mode
,
214 extern unsigned int ix86_minimum_alignment (tree
, machine_mode
,
216 extern int ix86_constant_alignment (tree
, int);
217 extern tree
ix86_handle_shared_attribute (tree
*, tree
, tree
, int, bool *);
218 extern tree
ix86_handle_selectany_attribute (tree
*, tree
, tree
, int, bool *);
219 extern int x86_field_alignment (tree
, int);
220 extern tree
ix86_valid_target_attribute_tree (tree
,
221 struct gcc_options
*,
222 struct gcc_options
*);
223 extern unsigned int ix86_get_callcvt (const_tree
);
227 extern rtx
ix86_tls_module_base (void);
229 extern void ix86_expand_vector_init (bool, rtx
, rtx
);
230 extern void ix86_expand_vector_set (bool, rtx
, rtx
, int);
231 extern void ix86_expand_vector_extract (bool, rtx
, rtx
, int);
232 extern void ix86_expand_reduc (rtx (*)(rtx
, rtx
, rtx
), rtx
, rtx
);
234 extern void ix86_expand_vec_extract_even_odd (rtx
, rtx
, rtx
, unsigned);
235 extern bool ix86_expand_pextr (rtx
*);
236 extern bool ix86_expand_pinsr (rtx
*);
237 extern void ix86_expand_mul_widen_evenodd (rtx
, rtx
, rtx
, bool, bool);
238 extern void ix86_expand_mul_widen_hilo (rtx
, rtx
, rtx
, bool, bool);
239 extern void ix86_expand_sse2_mulv4si3 (rtx
, rtx
, rtx
);
240 extern void ix86_expand_sse2_mulvxdi3 (rtx
, rtx
, rtx
);
241 extern void ix86_expand_sse2_abs (rtx
, rtx
);
243 extern bool ix86_bnd_prefixed_insn_p (rtx
);
246 extern void ix86_target_macros (void);
247 extern void ix86_register_pragmas (void);
250 extern void i386_pe_unique_section (tree
, int);
251 extern void i386_pe_declare_function_type (FILE *, const char *, int);
252 extern void i386_pe_record_external_function (tree
, const char *);
253 extern void i386_pe_maybe_record_exported_symbol (tree
, const char *, int);
254 extern void i386_pe_encode_section_info (tree
, rtx
, int);
255 extern bool i386_pe_binds_local_p (const_tree
);
256 extern const char *i386_pe_strip_name_encoding_full (const char *);
257 extern bool i386_pe_valid_dllimport_attribute_p (const_tree
);
258 extern unsigned int i386_pe_section_type_flags (tree
, const char *, int);
259 extern void i386_pe_asm_named_section (const char *, unsigned int, tree
);
260 extern void i386_pe_asm_output_aligned_decl_common (FILE *, tree
,
264 extern void i386_pe_file_end (void);
265 extern void i386_pe_start_function (FILE *, const char *, tree
);
266 extern void i386_pe_end_function (FILE *, const char *, tree
);
267 extern void i386_pe_assemble_visibility (tree
, int);
268 extern tree
i386_pe_mangle_decl_assembler_name (tree
, tree
);
269 extern tree
i386_pe_mangle_assembler_name (const char *);
270 extern void i386_pe_record_stub (const char *);
272 extern void i386_pe_seh_init (FILE *);
273 extern void i386_pe_seh_end_prologue (FILE *);
274 extern void i386_pe_seh_unwind_emit (FILE *, rtx_insn
*);
275 extern void i386_pe_seh_emit_except_personality (rtx
);
276 extern void i386_pe_seh_init_sections (void);
278 /* In winnt-cxx.c and winnt-stubs.c */
279 extern void i386_pe_adjust_class_at_definition (tree
);
280 extern bool i386_pe_type_dllimport_p (tree
);
281 extern bool i386_pe_type_dllexport_p (tree
);
283 extern int i386_pe_reloc_rw_mask (void);
285 extern rtx
maybe_get_pool_constant (rtx
);
287 extern char internal_label_prefix
[16];
288 extern int internal_label_prefix_len
;
290 extern bool ix86_epilogue_uses (int);
294 rtx base
, index
, disp
;
299 extern int ix86_decompose_address (rtx
, struct ix86_address
*);
300 extern int memory_address_length (rtx
, bool);
301 extern void x86_output_aligned_bss (FILE *, tree
, const char *,
302 unsigned HOST_WIDE_INT
, int);
303 extern void x86_elf_aligned_decl_common (FILE *, tree
, const char *,
304 unsigned HOST_WIDE_INT
, int);
307 extern void ix86_fp_comparison_codes (enum rtx_code code
, enum rtx_code
*,
308 enum rtx_code
*, enum rtx_code
*);
309 extern enum rtx_code
ix86_fp_compare_code_to_integer (enum rtx_code
);
311 extern int asm_preferred_eh_data_format (int, int);
314 extern enum attr_cpu ix86_schedule
;
317 extern const char * ix86_output_call_insn (rtx_insn
*insn
, rtx call_op
);
318 extern bool ix86_operands_ok_for_move_multiple (rtx
*operands
, bool load
,
319 enum machine_mode mode
);
322 /* Target data for multipass lookahead scheduling.
323 Currently used for Core 2/i7 tuning. */
324 struct ix86_first_cycle_multipass_data_
326 /* The length (in bytes) of ifetch block in this solution. */
327 int ifetch_block_len
;
328 /* Number of instructions in ifetch block in this solution. */
329 int ifetch_block_n_insns
;
330 /* Bitmap to remember changes to ready_try for backtracking. */
331 sbitmap ready_try_change
;
332 /* Size of the bitmap. */
333 int ready_try_change_size
;
335 # define TARGET_SCHED_FIRST_CYCLE_MULTIPASS_DATA_T \
336 struct ix86_first_cycle_multipass_data_
337 #endif /* RTX_CODE */
339 const addr_space_t ADDR_SPACE_SEG_FS
= 1;
340 const addr_space_t ADDR_SPACE_SEG_GS
= 2;
342 namespace gcc
{ class context
; }
345 extern rtl_opt_pass
*make_pass_insert_vzeroupper (gcc::context
*);
346 extern rtl_opt_pass
*make_pass_stv (gcc::context
*);