1 /* 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 Free Software Foundation, Inc.
5 This file is part of GCC.
7 GCC is free software; you can redistribute it and/or modify
8 it under the terms of the GNU General Public License as published by
9 the Free Software Foundation; either version 2, or (at your option)
12 GCC is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 GNU General Public License for more details.
17 You should have received a copy of the GNU General Public License
18 along with GCC; see the file COPYING. If not, write to
19 the Free Software Foundation, 59 Temple Place - Suite 330,
20 Boston, MA 02111-1307, USA. */
22 /* Functions in i386.c */
23 extern void override_options (void);
24 extern void optimization_options (int, int);
26 extern int ix86_can_use_return_insn_p (void);
27 extern int ix86_frame_pointer_required (void);
28 extern void ix86_setup_frame_addresses (void);
30 extern void ix86_file_end (void);
31 extern HOST_WIDE_INT
ix86_initial_elimination_offset (int, int);
32 extern void ix86_expand_prologue (void);
33 extern void ix86_expand_epilogue (int);
35 extern void ix86_output_addr_vec_elt (FILE *, int);
36 extern void ix86_output_addr_diff_elt (FILE *, int, int);
39 extern int ix86_aligned_p (rtx
);
41 extern int standard_80387_constant_p (rtx
);
42 extern const char *standard_80387_constant_opcode (rtx
);
43 extern rtx
standard_80387_constant_rtx (int);
44 extern int standard_sse_constant_p (rtx
);
45 extern int symbolic_reference_mentioned_p (rtx
);
46 extern bool extended_reg_mentioned_p (rtx
);
47 extern bool x86_extended_QIreg_mentioned_p (rtx
);
48 extern bool x86_extended_reg_mentioned_p (rtx
);
50 extern int any_fp_register_operand (rtx
, enum machine_mode
);
51 extern int register_and_not_any_fp_reg_operand (rtx
, enum machine_mode
);
53 extern int fp_register_operand (rtx
, enum machine_mode
);
54 extern int register_and_not_fp_reg_operand (rtx
, enum machine_mode
);
56 extern int x86_64_general_operand (rtx
, enum machine_mode
);
57 extern int x86_64_szext_general_operand (rtx
, enum machine_mode
);
58 extern int x86_64_nonmemory_operand (rtx
, enum machine_mode
);
59 extern int x86_64_szext_nonmemory_operand (rtx
, enum machine_mode
);
60 extern int x86_64_immediate_operand (rtx
, enum machine_mode
);
61 extern int x86_64_zext_immediate_operand (rtx
, enum machine_mode
);
62 extern int symbolic_operand (rtx
, enum machine_mode
);
63 extern int tls_symbolic_operand (rtx
, enum machine_mode
);
64 extern int global_dynamic_symbolic_operand (rtx
, enum machine_mode
);
65 extern int local_dynamic_symbolic_operand (rtx
, enum machine_mode
);
66 extern int initial_exec_symbolic_operand (rtx
, enum machine_mode
);
67 extern int local_exec_symbolic_operand (rtx
, enum machine_mode
);
68 extern int pic_symbolic_operand (rtx
, enum machine_mode
);
69 extern int call_insn_operand (rtx
, enum machine_mode
);
70 extern int sibcall_insn_operand (rtx
, enum machine_mode
);
71 extern int constant_call_address_operand (rtx
, enum machine_mode
);
72 extern int const0_operand (rtx
, enum machine_mode
);
73 extern int const1_operand (rtx
, enum machine_mode
);
74 extern int const248_operand (rtx
, enum machine_mode
);
75 extern int incdec_operand (rtx
, enum machine_mode
);
76 extern int reg_no_sp_operand (rtx
, enum machine_mode
);
77 extern int mmx_reg_operand (rtx
, enum machine_mode
);
78 extern int general_no_elim_operand (rtx
, enum machine_mode
);
79 extern int nonmemory_no_elim_operand (rtx
, enum machine_mode
);
80 extern int q_regs_operand (rtx
, enum machine_mode
);
81 extern int non_q_regs_operand (rtx
, enum machine_mode
);
82 extern int sse_comparison_operator (rtx
, enum machine_mode
);
83 extern int fcmov_comparison_operator (rtx
, enum machine_mode
);
84 extern int cmp_fp_expander_operand (rtx
, enum machine_mode
);
85 extern int ix86_comparison_operator (rtx
, enum machine_mode
);
86 extern int ext_register_operand (rtx
, enum machine_mode
);
87 extern int binary_fp_operator (rtx
, enum machine_mode
);
88 extern int mult_operator (rtx
, enum machine_mode
);
89 extern int div_operator (rtx
, enum machine_mode
);
90 extern int arith_or_logical_operator (rtx
, enum machine_mode
);
91 extern int promotable_binary_operator (rtx
, enum machine_mode
);
92 extern int memory_displacement_operand (rtx
, enum machine_mode
);
93 extern int cmpsi_operand (rtx
, enum machine_mode
);
94 extern int long_memory_operand (rtx
, enum machine_mode
);
95 extern int aligned_operand (rtx
, enum machine_mode
);
96 extern enum machine_mode
ix86_cc_mode (enum rtx_code
, rtx
, rtx
);
98 extern int ix86_expand_movmem (rtx
, rtx
, rtx
, rtx
);
99 extern int ix86_expand_clrmem (rtx
, rtx
, rtx
);
100 extern int ix86_expand_strlen (rtx
, rtx
, rtx
, rtx
);
102 extern bool legitimate_constant_p (rtx
);
103 extern bool constant_address_p (rtx
);
104 extern bool legitimate_pic_operand_p (rtx
);
105 extern int legitimate_pic_address_disp_p (rtx
);
106 extern int legitimate_address_p (enum machine_mode
, rtx
, int);
107 extern rtx
legitimize_address (rtx
, rtx
, enum machine_mode
);
109 extern void print_reg (rtx
, int, FILE*);
110 extern void print_operand (FILE*, rtx
, int);
111 extern void print_operand_address (FILE*, rtx
);
112 extern bool output_addr_const_extra (FILE*, rtx
);
114 extern void split_di (rtx
[], int, rtx
[], rtx
[]);
115 extern void split_ti (rtx
[], int, rtx
[], rtx
[]);
117 extern const char *output_set_got (rtx
);
118 extern const char *output_387_binary_op (rtx
, rtx
*);
119 extern const char *output_387_reg_move (rtx
, rtx
*);
120 extern const char *output_fix_trunc (rtx
, rtx
*, int);
121 extern const char *output_fp_compare (rtx
, rtx
*, int, int);
123 extern void i386_output_dwarf_dtprel (FILE*, int, rtx
);
125 extern void ix86_expand_clear (rtx
);
126 extern void ix86_expand_move (enum machine_mode
, rtx
[]);
127 extern void ix86_expand_vector_move (enum machine_mode
, rtx
[]);
128 extern void ix86_expand_vector_move_misalign (enum machine_mode
, rtx
[]);
129 extern void ix86_expand_push (enum machine_mode
, rtx
);
130 extern rtx
ix86_fixup_binary_operands (enum rtx_code
,
131 enum machine_mode
, rtx
[]);
132 extern void ix86_fixup_binary_operands_no_copy (enum rtx_code
,
133 enum machine_mode
, rtx
[]);
134 extern void ix86_expand_binary_operator (enum rtx_code
,
135 enum machine_mode
, rtx
[]);
136 extern int ix86_binary_operator_ok (enum rtx_code
, enum machine_mode
, rtx
[]);
137 extern void ix86_expand_unary_operator (enum rtx_code
, enum machine_mode
,
139 extern rtx
ix86_build_signbit_mask (enum machine_mode
, bool, bool);
140 extern void ix86_expand_fp_absneg_operator (enum rtx_code
, enum machine_mode
,
142 extern void ix86_expand_copysign (rtx
[]);
143 extern void ix86_split_copysign_const (rtx
[]);
144 extern void ix86_split_copysign_var (rtx
[]);
145 extern int ix86_unary_operator_ok (enum rtx_code
, enum machine_mode
, rtx
[]);
146 extern int ix86_match_ccmode (rtx
, enum machine_mode
);
147 extern rtx
ix86_expand_compare (enum rtx_code
, rtx
*, rtx
*);
148 extern int ix86_use_fcomi_compare (enum rtx_code
);
149 extern void ix86_expand_branch (enum rtx_code
, rtx
);
150 extern int ix86_expand_setcc (enum rtx_code
, rtx
);
151 extern int ix86_expand_int_movcc (rtx
[]);
152 extern int ix86_expand_fp_movcc (rtx
[]);
153 extern void ix86_split_sse_movcc (rtx
[]);
154 extern int ix86_expand_int_addcc (rtx
[]);
155 extern void ix86_expand_call (rtx
, rtx
, rtx
, rtx
, rtx
, int);
156 extern void x86_initialize_trampoline (rtx
, rtx
, rtx
);
157 extern rtx
ix86_zero_extend_to_Pmode (rtx
);
158 extern void ix86_split_long_move (rtx
[]);
159 extern void ix86_split_ashldi (rtx
*, rtx
);
160 extern void ix86_split_ashrdi (rtx
*, rtx
);
161 extern void ix86_split_lshrdi (rtx
*, rtx
);
162 extern rtx
ix86_find_base_term (rtx
);
163 extern int ix86_check_movabs (rtx
, int);
165 extern rtx
assign_386_stack_local (enum machine_mode
, int);
166 extern int ix86_attr_length_immediate_default (rtx
, int);
167 extern int ix86_attr_length_address_default (rtx
);
169 extern enum machine_mode
ix86_fp_compare_mode (enum rtx_code
);
171 extern rtx
ix86_libcall_value (enum machine_mode
);
172 extern bool ix86_function_value_regno_p (int);
173 extern bool ix86_function_arg_regno_p (int);
174 extern int ix86_function_arg_boundary (enum machine_mode
, tree
);
175 extern int ix86_return_in_memory (tree
);
176 extern void ix86_va_start (tree
, rtx
);
177 extern rtx
ix86_va_arg (tree
, tree
);
179 extern rtx
ix86_force_to_memory (enum machine_mode
, rtx
);
180 extern void ix86_free_from_memory (enum machine_mode
);
181 extern void ix86_split_fp_branch (enum rtx_code code
, rtx
, rtx
,
183 extern bool ix86_hard_regno_mode_ok (int, enum machine_mode
);
184 extern bool ix86_modes_tieable_p (enum machine_mode
, enum machine_mode
);
185 extern int ix86_register_move_cost (enum machine_mode
, enum reg_class
,
187 extern int ix86_secondary_memory_needed (enum reg_class
, enum reg_class
,
188 enum machine_mode
, int);
189 extern enum reg_class
ix86_preferred_reload_class (rtx
, enum reg_class
);
190 extern int ix86_memory_move_cost (enum machine_mode
, enum reg_class
, int);
191 extern void emit_i387_cw_initialization (rtx
, rtx
, int);
192 extern bool ix86_fp_jump_nontrivial_p (enum rtx_code
);
193 extern void x86_order_regs_for_local_alloc (void);
194 extern void x86_function_profiler (FILE *, int);
195 extern void x86_emit_floatuns (rtx
[2]);
196 extern void ix86_emit_fp_unordered_jump (rtx
);
198 extern void ix86_emit_i387_log1p (rtx
, rtx
);
200 extern enum rtx_code
ix86_reverse_condition (enum rtx_code
, enum machine_mode
);
203 extern void init_cumulative_args (CUMULATIVE_ARGS
*, tree
, rtx
, tree
);
204 extern rtx
function_arg (CUMULATIVE_ARGS
*, enum machine_mode
, tree
, int);
205 extern void function_arg_advance (CUMULATIVE_ARGS
*, enum machine_mode
,
207 extern rtx
ix86_function_value (tree
);
213 extern int ix86_return_pops_args (tree
, tree
, int);
215 extern int ix86_data_alignment (tree
, int);
216 extern int ix86_local_alignment (tree
, int);
217 extern int ix86_constant_alignment (tree
, int);
218 extern tree
ix86_handle_shared_attribute (tree
*, tree
, tree
, int, bool *);
219 extern tree
ix86_handle_selectany_attribute (tree
*, tree
, tree
, int, bool *);
221 extern unsigned int i386_pe_section_type_flags (tree
, const char *, int);
222 extern void i386_pe_asm_named_section (const char *, unsigned int, tree
);
223 extern int x86_field_alignment (tree
, int);
226 extern rtx
ix86_tls_get_addr (void);
228 extern void ix86_expand_vector_init (bool, rtx
, rtx
);
229 extern void ix86_expand_vector_set (bool, rtx
, rtx
, int);
230 extern void ix86_expand_vector_extract (bool, rtx
, rtx
, int);
233 extern int i386_pe_dllexport_name_p (const char *);
234 extern int i386_pe_dllimport_name_p (const char *);
235 extern void i386_pe_unique_section (tree
, int);
236 extern void i386_pe_declare_function_type (FILE *, const char *, int);
237 extern void i386_pe_record_external_function (tree
, const char *);
238 extern void i386_pe_record_exported_symbol (const char *, int);
239 extern void i386_pe_asm_file_end (FILE *);
240 extern void i386_pe_encode_section_info (tree
, rtx
, int);
241 extern const char *i386_pe_strip_name_encoding (const char *);
242 extern const char *i386_pe_strip_name_encoding_full (const char *);
243 extern void i386_pe_output_labelref (FILE *, const char *);
244 extern rtx
maybe_get_pool_constant (rtx
);
246 extern char internal_label_prefix
[16];
247 extern int internal_label_prefix_len
;
249 enum ix86_address_seg
{ SEG_DEFAULT
, SEG_FS
, SEG_GS
};
252 rtx base
, index
, disp
;
254 enum ix86_address_seg seg
;
257 extern int ix86_decompose_address (rtx
, struct ix86_address
*);
258 extern int memory_address_length (rtx addr
);
261 extern void ix86_fp_comparison_codes (enum rtx_code code
, enum rtx_code
*,
262 enum rtx_code
*, enum rtx_code
*);
263 extern enum rtx_code
ix86_fp_compare_code_to_integer (enum rtx_code
);