1 |
709 |
jeremybenn |
/* Definitions of target machine for GCC for IA-32.
|
2 |
|
|
Copyright (C) 1988, 1992, 1994, 1995, 1996, 1996, 1997, 1998, 1999,
|
3 |
|
|
2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011
|
4 |
|
|
Free Software Foundation, Inc.
|
5 |
|
|
|
6 |
|
|
This file is part of GCC.
|
7 |
|
|
|
8 |
|
|
GCC is free software; you can redistribute it and/or modify
|
9 |
|
|
it under the terms of the GNU General Public License as published by
|
10 |
|
|
the Free Software Foundation; either version 3, or (at your option)
|
11 |
|
|
any later version.
|
12 |
|
|
|
13 |
|
|
GCC is distributed in the hope that it will be useful,
|
14 |
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
15 |
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
16 |
|
|
GNU General Public License for more details.
|
17 |
|
|
|
18 |
|
|
You should have received a copy of the GNU General Public License
|
19 |
|
|
along with GCC; see the file COPYING3. If not see
|
20 |
|
|
<http://www.gnu.org/licenses/>. */
|
21 |
|
|
|
22 |
|
|
/* In i386-common.c. */
|
23 |
|
|
extern bool ix86_handle_option (struct gcc_options *opts,
|
24 |
|
|
struct gcc_options *opts_set ATTRIBUTE_UNUSED,
|
25 |
|
|
const struct cl_decoded_option *decoded,
|
26 |
|
|
location_t loc);
|
27 |
|
|
|
28 |
|
|
/* Functions in i386.c */
|
29 |
|
|
extern bool ix86_target_stack_probe (void);
|
30 |
|
|
extern bool ix86_can_use_return_insn_p (void);
|
31 |
|
|
extern void ix86_setup_frame_addresses (void);
|
32 |
|
|
|
33 |
|
|
extern HOST_WIDE_INT ix86_initial_elimination_offset (int, int);
|
34 |
|
|
extern void ix86_expand_prologue (void);
|
35 |
|
|
extern void ix86_maybe_emit_epilogue_vzeroupper (void);
|
36 |
|
|
extern void ix86_expand_epilogue (int);
|
37 |
|
|
extern void ix86_expand_split_stack_prologue (void);
|
38 |
|
|
|
39 |
|
|
extern void ix86_output_addr_vec_elt (FILE *, int);
|
40 |
|
|
extern void ix86_output_addr_diff_elt (FILE *, int, int);
|
41 |
|
|
|
42 |
|
|
extern enum calling_abi ix86_cfun_abi (void);
|
43 |
|
|
extern enum calling_abi ix86_function_type_abi (const_tree);
|
44 |
|
|
|
45 |
|
|
#ifdef RTX_CODE
|
46 |
|
|
extern int standard_80387_constant_p (rtx);
|
47 |
|
|
extern const char *standard_80387_constant_opcode (rtx);
|
48 |
|
|
extern rtx standard_80387_constant_rtx (int);
|
49 |
|
|
extern int standard_sse_constant_p (rtx);
|
50 |
|
|
extern const char *standard_sse_constant_opcode (rtx, rtx);
|
51 |
|
|
extern bool symbolic_reference_mentioned_p (rtx);
|
52 |
|
|
extern bool extended_reg_mentioned_p (rtx);
|
53 |
|
|
extern bool x86_extended_QIreg_mentioned_p (rtx);
|
54 |
|
|
extern bool x86_extended_reg_mentioned_p (rtx);
|
55 |
|
|
extern bool x86_maybe_negate_const_int (rtx *, enum machine_mode);
|
56 |
|
|
extern enum machine_mode ix86_cc_mode (enum rtx_code, rtx, rtx);
|
57 |
|
|
|
58 |
|
|
extern int avx_vpermilp_parallel (rtx par, enum machine_mode mode);
|
59 |
|
|
extern int avx_vperm2f128_parallel (rtx par, enum machine_mode mode);
|
60 |
|
|
|
61 |
|
|
extern bool ix86_expand_movmem (rtx, rtx, rtx, rtx, rtx, rtx);
|
62 |
|
|
extern bool ix86_expand_setmem (rtx, rtx, rtx, rtx, rtx, rtx);
|
63 |
|
|
extern bool ix86_expand_strlen (rtx, rtx, rtx, rtx);
|
64 |
|
|
|
65 |
|
|
extern bool constant_address_p (rtx);
|
66 |
|
|
extern bool legitimate_pic_operand_p (rtx);
|
67 |
|
|
extern bool legitimate_pic_address_disp_p (rtx);
|
68 |
|
|
|
69 |
|
|
extern void print_reg (rtx, int, FILE*);
|
70 |
|
|
extern void ix86_print_operand (FILE *, rtx, int);
|
71 |
|
|
|
72 |
|
|
extern void split_double_mode (enum machine_mode, rtx[], int, rtx[], rtx[]);
|
73 |
|
|
|
74 |
|
|
extern const char *output_set_got (rtx, rtx);
|
75 |
|
|
extern const char *output_387_binary_op (rtx, rtx*);
|
76 |
|
|
extern const char *output_387_reg_move (rtx, rtx*);
|
77 |
|
|
extern const char *output_fix_trunc (rtx, rtx*, bool);
|
78 |
|
|
extern const char *output_fp_compare (rtx, rtx*, bool, bool);
|
79 |
|
|
extern const char *output_adjust_stack_and_probe (rtx);
|
80 |
|
|
extern const char *output_probe_stack_range (rtx, rtx);
|
81 |
|
|
|
82 |
|
|
extern void ix86_expand_clear (rtx);
|
83 |
|
|
extern void ix86_expand_move (enum machine_mode, rtx[]);
|
84 |
|
|
extern void ix86_expand_vector_move (enum machine_mode, rtx[]);
|
85 |
|
|
extern void ix86_expand_vector_move_misalign (enum machine_mode, rtx[]);
|
86 |
|
|
extern void ix86_expand_push (enum machine_mode, rtx);
|
87 |
|
|
extern rtx ix86_fixup_binary_operands (enum rtx_code,
|
88 |
|
|
enum machine_mode, rtx[]);
|
89 |
|
|
extern void ix86_fixup_binary_operands_no_copy (enum rtx_code,
|
90 |
|
|
enum machine_mode, rtx[]);
|
91 |
|
|
extern void ix86_expand_binary_operator (enum rtx_code,
|
92 |
|
|
enum machine_mode, rtx[]);
|
93 |
|
|
extern bool ix86_binary_operator_ok (enum rtx_code, enum machine_mode, rtx[]);
|
94 |
|
|
extern bool ix86_lea_outperforms (rtx, unsigned int, unsigned int,
|
95 |
|
|
unsigned int, unsigned int);
|
96 |
|
|
extern bool ix86_avoid_lea_for_add (rtx, rtx[]);
|
97 |
|
|
extern bool ix86_use_lea_for_mov (rtx, rtx[]);
|
98 |
|
|
extern bool ix86_avoid_lea_for_addr (rtx, rtx[]);
|
99 |
|
|
extern void ix86_split_lea_for_addr (rtx[], enum machine_mode);
|
100 |
|
|
extern bool ix86_lea_for_add_ok (rtx, rtx[]);
|
101 |
|
|
extern bool ix86_vec_interleave_v2df_operator_ok (rtx operands[3], bool high);
|
102 |
|
|
extern bool ix86_dep_by_shift_count (const_rtx set_insn, const_rtx use_insn);
|
103 |
|
|
extern bool ix86_agi_dependent (rtx set_insn, rtx use_insn);
|
104 |
|
|
extern void ix86_expand_unary_operator (enum rtx_code, enum machine_mode,
|
105 |
|
|
rtx[]);
|
106 |
|
|
extern rtx ix86_build_const_vector (enum machine_mode, bool, rtx);
|
107 |
|
|
extern rtx ix86_build_signbit_mask (enum machine_mode, bool, bool);
|
108 |
|
|
extern void ix86_split_convert_uns_si_sse (rtx[]);
|
109 |
|
|
extern void ix86_expand_convert_uns_didf_sse (rtx, rtx);
|
110 |
|
|
extern void ix86_expand_convert_uns_sixf_sse (rtx, rtx);
|
111 |
|
|
extern void ix86_expand_convert_uns_sidf_sse (rtx, rtx);
|
112 |
|
|
extern void ix86_expand_convert_uns_sisf_sse (rtx, rtx);
|
113 |
|
|
extern void ix86_expand_convert_sign_didf_sse (rtx, rtx);
|
114 |
|
|
extern void ix86_expand_vector_convert_uns_vsivsf (rtx, rtx);
|
115 |
|
|
extern rtx ix86_expand_adjust_ufix_to_sfix_si (rtx, rtx *);
|
116 |
|
|
extern enum ix86_fpcmp_strategy ix86_fp_comparison_strategy (enum rtx_code);
|
117 |
|
|
extern void ix86_expand_fp_absneg_operator (enum rtx_code, enum machine_mode,
|
118 |
|
|
rtx[]);
|
119 |
|
|
extern void ix86_expand_copysign (rtx []);
|
120 |
|
|
extern void ix86_split_copysign_const (rtx []);
|
121 |
|
|
extern void ix86_split_copysign_var (rtx []);
|
122 |
|
|
extern bool ix86_unary_operator_ok (enum rtx_code, enum machine_mode, rtx[]);
|
123 |
|
|
extern bool ix86_match_ccmode (rtx, enum machine_mode);
|
124 |
|
|
extern void ix86_expand_branch (enum rtx_code, rtx, rtx, rtx);
|
125 |
|
|
extern void ix86_expand_setcc (rtx, enum rtx_code, rtx, rtx);
|
126 |
|
|
extern bool ix86_expand_int_movcc (rtx[]);
|
127 |
|
|
extern bool ix86_expand_fp_movcc (rtx[]);
|
128 |
|
|
extern bool ix86_expand_fp_vcond (rtx[]);
|
129 |
|
|
extern bool ix86_expand_int_vcond (rtx[]);
|
130 |
|
|
extern void ix86_expand_vec_perm (rtx[]);
|
131 |
|
|
extern bool ix86_expand_vec_perm_const (rtx[]);
|
132 |
|
|
extern void ix86_expand_sse_unpack (rtx[], bool, bool);
|
133 |
|
|
extern bool ix86_expand_int_addcc (rtx[]);
|
134 |
|
|
extern rtx ix86_expand_call (rtx, rtx, rtx, rtx, rtx, bool);
|
135 |
|
|
extern void ix86_split_call_vzeroupper (rtx, rtx);
|
136 |
|
|
extern void x86_initialize_trampoline (rtx, rtx, rtx);
|
137 |
|
|
extern rtx ix86_zero_extend_to_Pmode (rtx);
|
138 |
|
|
extern void ix86_split_long_move (rtx[]);
|
139 |
|
|
extern void ix86_split_ashl (rtx *, rtx, enum machine_mode);
|
140 |
|
|
extern void ix86_split_ashr (rtx *, rtx, enum machine_mode);
|
141 |
|
|
extern void ix86_split_lshr (rtx *, rtx, enum machine_mode);
|
142 |
|
|
extern rtx ix86_find_base_term (rtx);
|
143 |
|
|
extern bool ix86_check_movabs (rtx, int);
|
144 |
|
|
extern void ix86_split_idivmod (enum machine_mode, rtx[], bool);
|
145 |
|
|
|
146 |
|
|
extern rtx assign_386_stack_local (enum machine_mode, enum ix86_stack_slot);
|
147 |
|
|
extern int ix86_attr_length_immediate_default (rtx, bool);
|
148 |
|
|
extern int ix86_attr_length_address_default (rtx);
|
149 |
|
|
extern int ix86_attr_length_vex_default (rtx, bool, bool);
|
150 |
|
|
|
151 |
|
|
extern enum machine_mode ix86_fp_compare_mode (enum rtx_code);
|
152 |
|
|
|
153 |
|
|
extern rtx ix86_libcall_value (enum machine_mode);
|
154 |
|
|
extern bool ix86_function_arg_regno_p (int);
|
155 |
|
|
extern void ix86_asm_output_function_label (FILE *, const char *, tree);
|
156 |
|
|
extern rtx ix86_force_to_memory (enum machine_mode, rtx);
|
157 |
|
|
extern void ix86_free_from_memory (enum machine_mode);
|
158 |
|
|
extern void ix86_call_abi_override (const_tree);
|
159 |
|
|
extern int ix86_reg_parm_stack_space (const_tree);
|
160 |
|
|
|
161 |
|
|
extern void ix86_split_fp_branch (enum rtx_code code, rtx, rtx,
|
162 |
|
|
rtx, rtx, rtx, rtx);
|
163 |
|
|
extern bool ix86_hard_regno_mode_ok (int, enum machine_mode);
|
164 |
|
|
extern bool ix86_modes_tieable_p (enum machine_mode, enum machine_mode);
|
165 |
|
|
extern bool ix86_secondary_memory_needed (enum reg_class, enum reg_class,
|
166 |
|
|
enum machine_mode, int);
|
167 |
|
|
extern bool ix86_cannot_change_mode_class (enum machine_mode,
|
168 |
|
|
enum machine_mode, enum reg_class);
|
169 |
|
|
extern int ix86_mode_needed (int, rtx);
|
170 |
|
|
extern void emit_i387_cw_initialization (int);
|
171 |
|
|
extern void x86_order_regs_for_local_alloc (void);
|
172 |
|
|
extern void x86_function_profiler (FILE *, int);
|
173 |
|
|
extern void x86_emit_floatuns (rtx [2]);
|
174 |
|
|
extern void ix86_emit_fp_unordered_jump (rtx);
|
175 |
|
|
|
176 |
|
|
extern void ix86_emit_i387_log1p (rtx, rtx);
|
177 |
|
|
extern void ix86_emit_i387_round (rtx, rtx);
|
178 |
|
|
extern void ix86_emit_swdivsf (rtx, rtx, rtx, enum machine_mode);
|
179 |
|
|
extern void ix86_emit_swsqrtsf (rtx, rtx, enum machine_mode, bool);
|
180 |
|
|
|
181 |
|
|
extern enum rtx_code ix86_reverse_condition (enum rtx_code, enum machine_mode);
|
182 |
|
|
|
183 |
|
|
extern void ix86_expand_lround (rtx, rtx);
|
184 |
|
|
extern void ix86_expand_lfloorceil (rtx, rtx, bool);
|
185 |
|
|
extern void ix86_expand_rint (rtx, rtx);
|
186 |
|
|
extern void ix86_expand_floorceil (rtx, rtx, bool);
|
187 |
|
|
extern void ix86_expand_floorceildf_32 (rtx, rtx, bool);
|
188 |
|
|
extern void ix86_expand_round_sse4 (rtx, rtx);
|
189 |
|
|
extern void ix86_expand_round (rtx, rtx);
|
190 |
|
|
extern void ix86_expand_rounddf_32 (rtx, rtx);
|
191 |
|
|
extern void ix86_expand_trunc (rtx, rtx);
|
192 |
|
|
extern void ix86_expand_truncdf_32 (rtx, rtx);
|
193 |
|
|
|
194 |
|
|
#ifdef TREE_CODE
|
195 |
|
|
extern void init_cumulative_args (CUMULATIVE_ARGS *, tree, rtx, tree, int);
|
196 |
|
|
#endif /* TREE_CODE */
|
197 |
|
|
|
198 |
|
|
#endif /* RTX_CODE */
|
199 |
|
|
|
200 |
|
|
#ifdef TREE_CODE
|
201 |
|
|
extern int ix86_data_alignment (tree, int);
|
202 |
|
|
extern unsigned int ix86_local_alignment (tree, enum machine_mode,
|
203 |
|
|
unsigned int);
|
204 |
|
|
extern unsigned int ix86_minimum_alignment (tree, enum machine_mode,
|
205 |
|
|
unsigned int);
|
206 |
|
|
extern int ix86_constant_alignment (tree, int);
|
207 |
|
|
extern tree ix86_handle_shared_attribute (tree *, tree, tree, int, bool *);
|
208 |
|
|
extern tree ix86_handle_selectany_attribute (tree *, tree, tree, int, bool *);
|
209 |
|
|
extern int x86_field_alignment (tree, int);
|
210 |
|
|
extern tree ix86_valid_target_attribute_tree (tree);
|
211 |
|
|
extern unsigned int ix86_get_callcvt (const_tree);
|
212 |
|
|
|
213 |
|
|
#endif
|
214 |
|
|
|
215 |
|
|
extern rtx ix86_tls_module_base (void);
|
216 |
|
|
|
217 |
|
|
extern void ix86_expand_vector_init (bool, rtx, rtx);
|
218 |
|
|
extern void ix86_expand_vector_set (bool, rtx, rtx, int);
|
219 |
|
|
extern void ix86_expand_vector_extract (bool, rtx, rtx, int);
|
220 |
|
|
extern void ix86_expand_reduc (rtx (*)(rtx, rtx, rtx), rtx, rtx);
|
221 |
|
|
|
222 |
|
|
extern void ix86_expand_vec_extract_even_odd (rtx, rtx, rtx, unsigned);
|
223 |
|
|
extern bool ix86_expand_pinsr (rtx *);
|
224 |
|
|
|
225 |
|
|
/* In i386-c.c */
|
226 |
|
|
extern void ix86_target_macros (void);
|
227 |
|
|
extern void ix86_register_pragmas (void);
|
228 |
|
|
|
229 |
|
|
/* In winnt.c */
|
230 |
|
|
extern void i386_pe_unique_section (tree, int);
|
231 |
|
|
extern void i386_pe_declare_function_type (FILE *, const char *, int);
|
232 |
|
|
extern void i386_pe_record_external_function (tree, const char *);
|
233 |
|
|
extern void i386_pe_maybe_record_exported_symbol (tree, const char *, int);
|
234 |
|
|
extern void i386_pe_encode_section_info (tree, rtx, int);
|
235 |
|
|
extern bool i386_pe_binds_local_p (const_tree);
|
236 |
|
|
extern const char *i386_pe_strip_name_encoding_full (const char *);
|
237 |
|
|
extern bool i386_pe_valid_dllimport_attribute_p (const_tree);
|
238 |
|
|
extern unsigned int i386_pe_section_type_flags (tree, const char *, int);
|
239 |
|
|
extern void i386_pe_asm_named_section (const char *, unsigned int, tree);
|
240 |
|
|
extern void i386_pe_asm_output_aligned_decl_common (FILE *, tree,
|
241 |
|
|
const char *,
|
242 |
|
|
HOST_WIDE_INT,
|
243 |
|
|
HOST_WIDE_INT);
|
244 |
|
|
extern void i386_pe_file_end (void);
|
245 |
|
|
extern void i386_pe_start_function (FILE *, const char *, tree);
|
246 |
|
|
extern void i386_pe_end_function (FILE *, const char *, tree);
|
247 |
|
|
extern void i386_pe_assemble_visibility (tree, int);
|
248 |
|
|
extern tree i386_pe_mangle_decl_assembler_name (tree, tree);
|
249 |
|
|
extern tree i386_pe_mangle_assembler_name (const char *);
|
250 |
|
|
|
251 |
|
|
extern void i386_pe_seh_init (FILE *);
|
252 |
|
|
extern void i386_pe_seh_end_prologue (FILE *);
|
253 |
|
|
extern void i386_pe_seh_unwind_emit (FILE *, rtx);
|
254 |
|
|
|
255 |
|
|
/* In winnt-cxx.c and winnt-stubs.c */
|
256 |
|
|
extern void i386_pe_adjust_class_at_definition (tree);
|
257 |
|
|
extern bool i386_pe_type_dllimport_p (tree);
|
258 |
|
|
extern bool i386_pe_type_dllexport_p (tree);
|
259 |
|
|
|
260 |
|
|
extern rtx maybe_get_pool_constant (rtx);
|
261 |
|
|
|
262 |
|
|
extern char internal_label_prefix[16];
|
263 |
|
|
extern int internal_label_prefix_len;
|
264 |
|
|
|
265 |
|
|
enum ix86_address_seg { SEG_DEFAULT, SEG_FS, SEG_GS };
|
266 |
|
|
struct ix86_address
|
267 |
|
|
{
|
268 |
|
|
rtx base, index, disp;
|
269 |
|
|
HOST_WIDE_INT scale;
|
270 |
|
|
enum ix86_address_seg seg;
|
271 |
|
|
};
|
272 |
|
|
|
273 |
|
|
extern int ix86_decompose_address (rtx, struct ix86_address *);
|
274 |
|
|
extern int memory_address_length (rtx addr);
|
275 |
|
|
extern void x86_output_aligned_bss (FILE *, tree, const char *,
|
276 |
|
|
unsigned HOST_WIDE_INT, int);
|
277 |
|
|
extern void x86_elf_aligned_common (FILE *, const char *,
|
278 |
|
|
unsigned HOST_WIDE_INT, int);
|
279 |
|
|
|
280 |
|
|
#ifdef RTX_CODE
|
281 |
|
|
extern void ix86_fp_comparison_codes (enum rtx_code code, enum rtx_code *,
|
282 |
|
|
enum rtx_code *, enum rtx_code *);
|
283 |
|
|
extern enum rtx_code ix86_fp_compare_code_to_integer (enum rtx_code);
|
284 |
|
|
extern rtx construct_plt_address (rtx);
|
285 |
|
|
#endif
|
286 |
|
|
extern int asm_preferred_eh_data_format (int, int);
|
287 |
|
|
|
288 |
|
|
#ifdef HAVE_ATTR_cpu
|
289 |
|
|
extern enum attr_cpu ix86_schedule;
|
290 |
|
|
#endif
|
291 |
|
|
|
292 |
|
|
extern const char * ix86_output_call_insn (rtx insn, rtx call_op);
|
293 |
|
|
|
294 |
|
|
#ifdef RTX_CODE
|
295 |
|
|
/* Target data for multipass lookahead scheduling.
|
296 |
|
|
Currently used for Core 2/i7 tuning. */
|
297 |
|
|
struct ix86_first_cycle_multipass_data_
|
298 |
|
|
{
|
299 |
|
|
/* The length (in bytes) of ifetch block in this solution. */
|
300 |
|
|
int ifetch_block_len;
|
301 |
|
|
/* Number of instructions in ifetch block in this solution. */
|
302 |
|
|
int ifetch_block_n_insns;
|
303 |
|
|
/* Bitmap to remember changes to ready_try for backtracking. */
|
304 |
|
|
sbitmap ready_try_change;
|
305 |
|
|
/* Size of the bitmap. */
|
306 |
|
|
int ready_try_change_size;
|
307 |
|
|
};
|
308 |
|
|
# define TARGET_SCHED_FIRST_CYCLE_MULTIPASS_DATA_T \
|
309 |
|
|
struct ix86_first_cycle_multipass_data_
|
310 |
|
|
#endif /* RTX_CODE */
|