PR other/53317
[official-gcc.git] / gcc / config / arm / arm-protos.h
bloba426432061daa69e865cb0ee00ef43b698119919
1 /* Prototypes for exported functions defined in arm.c and pe.c
2 Copyright (C) 1999-2013 Free Software Foundation, Inc.
3 Contributed by Richard Earnshaw (rearnsha@arm.com)
4 Minor hacks by Nick Clifton (nickc@cygnus.com)
6 This file is part of GCC.
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.
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.
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/>. */
22 #ifndef GCC_ARM_PROTOS_H
23 #define GCC_ARM_PROTOS_H
25 extern enum unwind_info_type arm_except_unwind_info (struct gcc_options *);
26 extern int use_return_insn (int, rtx);
27 extern bool use_simple_return_p (void);
28 extern enum reg_class arm_regno_class (int);
29 extern void arm_load_pic_register (unsigned long);
30 extern int arm_volatile_func (void);
31 extern void arm_expand_prologue (void);
32 extern void arm_expand_epilogue (bool);
33 extern void thumb2_expand_return (bool);
34 extern const char *arm_strip_name_encoding (const char *);
35 extern void arm_asm_output_labelref (FILE *, const char *);
36 extern void thumb2_asm_output_opcode (FILE *);
37 extern unsigned long arm_current_func_type (void);
38 extern HOST_WIDE_INT arm_compute_initial_elimination_offset (unsigned int,
39 unsigned int);
40 extern HOST_WIDE_INT thumb_compute_initial_elimination_offset (unsigned int,
41 unsigned int);
42 extern unsigned int arm_dbx_register_number (unsigned int);
43 extern void arm_output_fn_unwind (FILE *, bool);
46 #ifdef RTX_CODE
47 extern bool arm_vector_mode_supported_p (enum machine_mode);
48 extern bool arm_small_register_classes_for_mode_p (enum machine_mode);
49 extern int arm_hard_regno_mode_ok (unsigned int, enum machine_mode);
50 extern bool arm_modes_tieable_p (enum machine_mode, enum machine_mode);
51 extern int const_ok_for_arm (HOST_WIDE_INT);
52 extern int const_ok_for_op (HOST_WIDE_INT, enum rtx_code);
53 extern int const_ok_for_dimode_op (HOST_WIDE_INT, enum rtx_code);
54 extern int arm_split_constant (RTX_CODE, enum machine_mode, rtx,
55 HOST_WIDE_INT, rtx, rtx, int);
56 extern int legitimate_pic_operand_p (rtx);
57 extern rtx legitimize_pic_address (rtx, enum machine_mode, rtx);
58 extern rtx legitimize_tls_address (rtx, rtx);
59 extern int arm_legitimate_address_outer_p (enum machine_mode, rtx, RTX_CODE, int);
60 extern int thumb_legitimate_offset_p (enum machine_mode, HOST_WIDE_INT);
61 extern bool arm_legitimize_reload_address (rtx *, enum machine_mode, int, int,
62 int);
63 extern rtx thumb_legitimize_reload_address (rtx *, enum machine_mode, int, int,
64 int);
65 extern int thumb1_legitimate_address_p (enum machine_mode, rtx, int);
66 extern bool ldm_stm_operation_p (rtx, bool, enum machine_mode mode,
67 bool, bool);
68 extern int arm_const_double_rtx (rtx);
69 extern int vfp3_const_double_rtx (rtx);
70 extern int neon_immediate_valid_for_move (rtx, enum machine_mode, rtx *, int *);
71 extern int neon_immediate_valid_for_logic (rtx, enum machine_mode, int, rtx *,
72 int *);
73 extern int neon_immediate_valid_for_shift (rtx, enum machine_mode, rtx *,
74 int *, bool);
75 extern char *neon_output_logic_immediate (const char *, rtx *,
76 enum machine_mode, int, int);
77 extern char *neon_output_shift_immediate (const char *, char, rtx *,
78 enum machine_mode, int, bool);
79 extern void neon_pairwise_reduce (rtx, rtx, enum machine_mode,
80 rtx (*) (rtx, rtx, rtx));
81 extern rtx neon_make_constant (rtx);
82 extern tree arm_builtin_vectorized_function (tree, tree, tree);
83 extern void neon_expand_vector_init (rtx, rtx);
84 extern void neon_lane_bounds (rtx, HOST_WIDE_INT, HOST_WIDE_INT);
85 extern void neon_const_bounds (rtx, HOST_WIDE_INT, HOST_WIDE_INT);
86 extern HOST_WIDE_INT neon_element_bits (enum machine_mode);
87 extern void neon_reinterpret (rtx, rtx);
88 extern void neon_emit_pair_result_insn (enum machine_mode,
89 rtx (*) (rtx, rtx, rtx, rtx),
90 rtx, rtx, rtx);
91 extern void neon_disambiguate_copy (rtx *, rtx *, rtx *, unsigned int);
92 extern void neon_split_vcombine (rtx op[3]);
93 extern enum reg_class coproc_secondary_reload_class (enum machine_mode, rtx,
94 bool);
95 extern bool arm_tls_referenced_p (rtx);
97 extern int arm_coproc_mem_operand (rtx, bool);
98 extern int neon_vector_mem_operand (rtx, int, bool);
99 extern int neon_struct_mem_operand (rtx);
100 extern int arm_no_early_store_addr_dep (rtx, rtx);
101 extern int arm_early_store_addr_dep (rtx, rtx);
102 extern int arm_early_load_addr_dep (rtx, rtx);
103 extern int arm_no_early_alu_shift_dep (rtx, rtx);
104 extern int arm_no_early_alu_shift_value_dep (rtx, rtx);
105 extern int arm_no_early_mul_dep (rtx, rtx);
106 extern int arm_mac_accumulator_is_result (rtx, rtx);
107 extern int arm_mac_accumulator_is_mul_result (rtx, rtx);
109 extern int tls_mentioned_p (rtx);
110 extern int symbol_mentioned_p (rtx);
111 extern int label_mentioned_p (rtx);
112 extern RTX_CODE minmax_code (rtx);
113 extern bool arm_sat_operator_match (rtx, rtx, int *, bool *);
114 extern int adjacent_mem_locations (rtx, rtx);
115 extern bool gen_ldm_seq (rtx *, int, bool);
116 extern bool gen_stm_seq (rtx *, int);
117 extern bool gen_const_stm_seq (rtx *, int);
118 extern rtx arm_gen_load_multiple (int *, int, rtx, int, rtx, HOST_WIDE_INT *);
119 extern rtx arm_gen_store_multiple (int *, int, rtx, int, rtx, HOST_WIDE_INT *);
120 extern bool offset_ok_for_ldrd_strd (HOST_WIDE_INT);
121 extern bool operands_ok_ldrd_strd (rtx, rtx, rtx, HOST_WIDE_INT, bool, bool);
122 extern bool gen_operands_ldrd_strd (rtx *, bool, bool, bool);
123 extern int arm_gen_movmemqi (rtx *);
124 extern bool gen_movmem_ldrd_strd (rtx *);
125 extern enum machine_mode arm_select_cc_mode (RTX_CODE, rtx, rtx);
126 extern enum machine_mode arm_select_dominance_cc_mode (rtx, rtx,
127 HOST_WIDE_INT);
128 extern rtx arm_gen_compare_reg (RTX_CODE, rtx, rtx, rtx);
129 extern rtx arm_gen_return_addr_mask (void);
130 extern void arm_reload_in_hi (rtx *);
131 extern void arm_reload_out_hi (rtx *);
132 extern int arm_const_double_inline_cost (rtx);
133 extern bool arm_const_double_by_parts (rtx);
134 extern bool arm_const_double_by_immediates (rtx);
135 extern const char *fp_immediate_constant (rtx);
136 extern void arm_emit_call_insn (rtx, rtx);
137 extern const char *output_call (rtx *);
138 extern const char *output_call_mem (rtx *);
139 void arm_emit_movpair (rtx, rtx);
140 extern const char *output_mov_long_double_arm_from_arm (rtx *);
141 extern const char *output_move_double (rtx *, bool, int *count);
142 extern const char *output_move_quad (rtx *);
143 extern int arm_count_output_move_double_insns (rtx *);
144 extern const char *output_move_vfp (rtx *operands);
145 extern const char *output_move_neon (rtx *operands);
146 extern int arm_attr_length_move_neon (rtx);
147 extern int arm_address_offset_is_imm (rtx);
148 extern const char *output_add_immediate (rtx *);
149 extern const char *arithmetic_instr (rtx, int);
150 extern void output_ascii_pseudo_op (FILE *, const unsigned char *, int);
151 extern const char *output_return_instruction (rtx, bool, bool, bool);
152 extern void arm_poke_function_name (FILE *, const char *);
153 extern void arm_final_prescan_insn (rtx);
154 extern int arm_debugger_arg_offset (int, rtx);
155 extern bool arm_is_long_call_p (tree);
156 extern int arm_emit_vector_const (FILE *, rtx);
157 extern void arm_emit_fp16_const (rtx c);
158 extern const char * arm_output_load_gr (rtx *);
159 extern const char *vfp_output_fstmd (rtx *);
160 extern void arm_output_multireg_pop (rtx *, bool, rtx, bool, bool);
161 extern void arm_set_return_address (rtx, rtx);
162 extern int arm_eliminable_register (rtx);
163 extern const char *arm_output_shift(rtx *, int);
164 extern const char *arm_output_iwmmxt_shift_immediate (const char *, rtx *, bool);
165 extern const char *arm_output_iwmmxt_tinsr (rtx *);
166 extern unsigned int arm_sync_loop_insns (rtx , rtx *);
167 extern int arm_attr_length_push_multi(rtx, rtx);
168 extern void arm_expand_compare_and_swap (rtx op[]);
169 extern void arm_split_compare_and_swap (rtx op[]);
170 extern void arm_split_atomic_op (enum rtx_code, rtx, rtx, rtx, rtx, rtx, rtx);
171 extern rtx arm_load_tp (rtx);
173 #if defined TREE_CODE
174 extern void arm_init_cumulative_args (CUMULATIVE_ARGS *, tree, rtx, tree);
175 extern bool arm_pad_arg_upward (enum machine_mode, const_tree);
176 extern bool arm_pad_reg_upward (enum machine_mode, tree, int);
177 #endif
178 extern int arm_apply_result_size (void);
180 #endif /* RTX_CODE */
182 /* Thumb functions. */
183 extern void arm_init_expanders (void);
184 extern const char *thumb1_unexpanded_epilogue (void);
185 extern void thumb1_expand_prologue (void);
186 extern void thumb1_expand_epilogue (void);
187 extern const char *thumb1_output_interwork (void);
188 #ifdef TREE_CODE
189 extern int is_called_in_ARM_mode (tree);
190 #endif
191 extern int thumb_shiftable_const (unsigned HOST_WIDE_INT);
192 #ifdef RTX_CODE
193 extern enum arm_cond_code maybe_get_arm_condition_code (rtx);
194 extern void thumb1_final_prescan_insn (rtx);
195 extern void thumb2_final_prescan_insn (rtx);
196 extern const char *thumb_load_double_from_address (rtx *);
197 extern const char *thumb_output_move_mem_multiple (int, rtx *);
198 extern const char *thumb_call_via_reg (rtx);
199 extern void thumb_expand_movmemqi (rtx *);
200 extern rtx arm_return_addr (int, rtx);
201 extern void thumb_reload_out_hi (rtx *);
202 extern void thumb_reload_in_hi (rtx *);
203 extern void thumb_set_return_address (rtx, rtx);
204 extern const char *thumb1_output_casesi (rtx *);
205 extern const char *thumb2_output_casesi (rtx *);
206 #endif
208 /* Defined in pe.c. */
209 extern int arm_dllexport_name_p (const char *);
210 extern int arm_dllimport_name_p (const char *);
212 #ifdef TREE_CODE
213 extern void arm_pe_unique_section (tree, int);
214 extern void arm_pe_encode_section_info (tree, rtx, int);
215 extern int arm_dllexport_p (tree);
216 extern int arm_dllimport_p (tree);
217 extern void arm_mark_dllexport (tree);
218 extern void arm_mark_dllimport (tree);
219 #endif
221 extern void arm_pr_long_calls (struct cpp_reader *);
222 extern void arm_pr_no_long_calls (struct cpp_reader *);
223 extern void arm_pr_long_calls_off (struct cpp_reader *);
225 extern void arm_lang_object_attributes_init(void);
227 extern const char *arm_mangle_type (const_tree);
229 extern void arm_order_regs_for_local_alloc (void);
231 /* Vectorizer cost model implementation. */
232 struct cpu_vec_costs {
233 const int scalar_stmt_cost; /* Cost of any scalar operation, excluding
234 load and store. */
235 const int scalar_load_cost; /* Cost of scalar load. */
236 const int scalar_store_cost; /* Cost of scalar store. */
237 const int vec_stmt_cost; /* Cost of any vector operation, excluding
238 load, store, vector-to-scalar and
239 scalar-to-vector operation. */
240 const int vec_to_scalar_cost; /* Cost of vect-to-scalar operation. */
241 const int scalar_to_vec_cost; /* Cost of scalar-to-vector operation. */
242 const int vec_align_load_cost; /* Cost of aligned vector load. */
243 const int vec_unalign_load_cost; /* Cost of unaligned vector load. */
244 const int vec_unalign_store_cost; /* Cost of unaligned vector load. */
245 const int vec_store_cost; /* Cost of vector store. */
246 const int cond_taken_branch_cost; /* Cost of taken branch for vectorizer
247 cost model. */
248 const int cond_not_taken_branch_cost;/* Cost of not taken branch for
249 vectorizer cost model. */
252 #ifdef RTX_CODE
253 /* This needs to be here because we need RTX_CODE and similar. */
255 struct tune_params
257 bool (*rtx_costs) (rtx, RTX_CODE, RTX_CODE, int *, bool);
258 bool (*sched_adjust_cost) (rtx, rtx, rtx, int *);
259 int constant_limit;
260 /* Maximum number of instructions to conditionalise in
261 arm_final_prescan_insn. */
262 int max_insns_skipped;
263 int num_prefetch_slots;
264 int l1_cache_size;
265 int l1_cache_line_size;
266 bool prefer_constant_pool;
267 int (*branch_cost) (bool, bool);
268 /* Prefer STRD/LDRD instructions over PUSH/POP/LDM/STM. */
269 bool prefer_ldrd_strd;
270 /* The preference for non short cirtcuit operation when optimizing for
271 performance. The first element covers Thumb state and the second one
272 is for ARM state. */
273 bool logical_op_non_short_circuit[2];
274 /* Vectorizer costs. */
275 const struct cpu_vec_costs* vec_costs;
276 /* Prefer Neon for 64-bit bitops. */
277 bool prefer_neon_for_64bits;
280 extern const struct tune_params *current_tune;
281 extern int vfp3_const_double_for_fract_bits (rtx);
283 extern void arm_emit_coreregs_64bit_shift (enum rtx_code, rtx, rtx, rtx, rtx,
284 rtx);
285 extern bool arm_validize_comparison (rtx *, rtx *, rtx *);
286 #endif /* RTX_CODE */
288 extern void arm_expand_vec_perm (rtx target, rtx op0, rtx op1, rtx sel);
289 extern bool arm_expand_vec_perm_const (rtx target, rtx op0, rtx op1, rtx sel);
291 extern bool arm_autoinc_modes_ok_p (enum machine_mode, enum arm_auto_incmodes);
293 extern void arm_emit_eabi_attribute (const char *, int, int);
295 #endif /* ! GCC_ARM_PROTOS_H */