recog_memoized works on an rtx_insn *
[official-gcc.git] / gcc / config / arm / arm-protos.h
blobf5a9bf30f56f647c0af0b3f2ce74304ba37d5f73
1 /* Prototypes for exported functions defined in arm.c and pe.c
2 Copyright (C) 1999-2014 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 bool arm_legitimate_address_p (enum machine_mode, rtx, bool);
60 extern int arm_legitimate_address_outer_p (enum machine_mode, rtx, RTX_CODE, int);
61 extern int thumb_legitimate_offset_p (enum machine_mode, HOST_WIDE_INT);
62 extern bool arm_legitimize_reload_address (rtx *, enum machine_mode, int, int,
63 int);
64 extern rtx thumb_legitimize_reload_address (rtx *, enum machine_mode, int, int,
65 int);
66 extern int thumb1_legitimate_address_p (enum machine_mode, rtx, int);
67 extern bool ldm_stm_operation_p (rtx, bool, enum machine_mode mode,
68 bool, bool);
69 extern int arm_const_double_rtx (rtx);
70 extern int vfp3_const_double_rtx (rtx);
71 extern int neon_immediate_valid_for_move (rtx, enum machine_mode, rtx *, int *);
72 extern int neon_immediate_valid_for_logic (rtx, enum machine_mode, int, rtx *,
73 int *);
74 extern int neon_immediate_valid_for_shift (rtx, enum machine_mode, rtx *,
75 int *, bool);
76 extern char *neon_output_logic_immediate (const char *, rtx *,
77 enum machine_mode, int, int);
78 extern char *neon_output_shift_immediate (const char *, char, rtx *,
79 enum machine_mode, int, bool);
80 extern void neon_pairwise_reduce (rtx, rtx, enum machine_mode,
81 rtx (*) (rtx, rtx, rtx));
82 extern rtx neon_make_constant (rtx);
83 extern tree arm_builtin_vectorized_function (tree, tree, tree);
84 extern void neon_expand_vector_init (rtx, rtx);
85 extern void neon_lane_bounds (rtx, HOST_WIDE_INT, HOST_WIDE_INT);
86 extern void neon_const_bounds (rtx, HOST_WIDE_INT, HOST_WIDE_INT);
87 extern HOST_WIDE_INT neon_element_bits (enum machine_mode);
88 extern void neon_reinterpret (rtx, rtx);
89 extern void neon_emit_pair_result_insn (enum machine_mode,
90 rtx (*) (rtx, rtx, rtx, rtx),
91 rtx, rtx, rtx);
92 extern void neon_disambiguate_copy (rtx *, rtx *, rtx *, unsigned int);
93 extern void neon_split_vcombine (rtx op[3]);
94 extern enum reg_class coproc_secondary_reload_class (enum machine_mode, rtx,
95 bool);
96 extern bool arm_tls_referenced_p (rtx);
98 extern int arm_coproc_mem_operand (rtx, bool);
99 extern int neon_vector_mem_operand (rtx, int, bool);
100 extern int neon_struct_mem_operand (rtx);
102 extern int tls_mentioned_p (rtx);
103 extern int symbol_mentioned_p (rtx);
104 extern int label_mentioned_p (rtx);
105 extern RTX_CODE minmax_code (rtx);
106 extern bool arm_sat_operator_match (rtx, rtx, int *, bool *);
107 extern int adjacent_mem_locations (rtx, rtx);
108 extern bool gen_ldm_seq (rtx *, int, bool);
109 extern bool gen_stm_seq (rtx *, int);
110 extern bool gen_const_stm_seq (rtx *, int);
111 extern rtx arm_gen_load_multiple (int *, int, rtx, int, rtx, HOST_WIDE_INT *);
112 extern rtx arm_gen_store_multiple (int *, int, rtx, int, rtx, HOST_WIDE_INT *);
113 extern bool offset_ok_for_ldrd_strd (HOST_WIDE_INT);
114 extern bool operands_ok_ldrd_strd (rtx, rtx, rtx, HOST_WIDE_INT, bool, bool);
115 extern bool gen_operands_ldrd_strd (rtx *, bool, bool, bool);
116 extern int arm_gen_movmemqi (rtx *);
117 extern bool gen_movmem_ldrd_strd (rtx *);
118 extern enum machine_mode arm_select_cc_mode (RTX_CODE, rtx, rtx);
119 extern enum machine_mode arm_select_dominance_cc_mode (rtx, rtx,
120 HOST_WIDE_INT);
121 extern rtx arm_gen_compare_reg (RTX_CODE, rtx, rtx, rtx);
122 extern rtx arm_gen_return_addr_mask (void);
123 extern void arm_reload_in_hi (rtx *);
124 extern void arm_reload_out_hi (rtx *);
125 extern int arm_max_const_double_inline_cost (void);
126 extern int arm_const_double_inline_cost (rtx);
127 extern bool arm_const_double_by_parts (rtx);
128 extern bool arm_const_double_by_immediates (rtx);
129 extern void arm_emit_call_insn (rtx, rtx, bool);
130 extern const char *output_call (rtx *);
131 extern const char *output_call_mem (rtx *);
132 void arm_emit_movpair (rtx, rtx);
133 extern const char *output_mov_long_double_arm_from_arm (rtx *);
134 extern const char *output_move_double (rtx *, bool, int *count);
135 extern const char *output_move_quad (rtx *);
136 extern int arm_count_output_move_double_insns (rtx *);
137 extern const char *output_move_vfp (rtx *operands);
138 extern const char *output_move_neon (rtx *operands);
139 extern int arm_attr_length_move_neon (rtx_insn *);
140 extern int arm_address_offset_is_imm (rtx_insn *);
141 extern const char *output_add_immediate (rtx *);
142 extern const char *arithmetic_instr (rtx, int);
143 extern void output_ascii_pseudo_op (FILE *, const unsigned char *, int);
144 extern const char *output_return_instruction (rtx, bool, bool, bool);
145 extern void arm_poke_function_name (FILE *, const char *);
146 extern void arm_final_prescan_insn (rtx_insn *);
147 extern int arm_debugger_arg_offset (int, rtx);
148 extern bool arm_is_long_call_p (tree);
149 extern int arm_emit_vector_const (FILE *, rtx);
150 extern void arm_emit_fp16_const (rtx c);
151 extern const char * arm_output_load_gr (rtx *);
152 extern const char *vfp_output_vstmd (rtx *);
153 extern void arm_output_multireg_pop (rtx *, bool, rtx, bool, bool);
154 extern void arm_set_return_address (rtx, rtx);
155 extern int arm_eliminable_register (rtx);
156 extern const char *arm_output_shift(rtx *, int);
157 extern const char *arm_output_iwmmxt_shift_immediate (const char *, rtx *, bool);
158 extern const char *arm_output_iwmmxt_tinsr (rtx *);
159 extern unsigned int arm_sync_loop_insns (rtx , rtx *);
160 extern int arm_attr_length_push_multi(rtx, rtx);
161 extern void arm_expand_compare_and_swap (rtx op[]);
162 extern void arm_split_compare_and_swap (rtx op[]);
163 extern void arm_split_atomic_op (enum rtx_code, rtx, rtx, rtx, rtx, rtx, rtx);
164 extern rtx arm_load_tp (rtx);
166 #if defined TREE_CODE
167 extern void arm_init_cumulative_args (CUMULATIVE_ARGS *, tree, rtx, tree);
168 extern bool arm_pad_arg_upward (enum machine_mode, const_tree);
169 extern bool arm_pad_reg_upward (enum machine_mode, tree, int);
170 #endif
171 extern int arm_apply_result_size (void);
173 #endif /* RTX_CODE */
175 /* Thumb functions. */
176 extern void arm_init_expanders (void);
177 extern const char *thumb1_unexpanded_epilogue (void);
178 extern void thumb1_expand_prologue (void);
179 extern void thumb1_expand_epilogue (void);
180 extern const char *thumb1_output_interwork (void);
181 #ifdef TREE_CODE
182 extern int is_called_in_ARM_mode (tree);
183 #endif
184 extern int thumb_shiftable_const (unsigned HOST_WIDE_INT);
185 #ifdef RTX_CODE
186 extern enum arm_cond_code maybe_get_arm_condition_code (rtx);
187 extern void thumb1_final_prescan_insn (rtx_insn *);
188 extern void thumb2_final_prescan_insn (rtx_insn *);
189 extern const char *thumb_load_double_from_address (rtx *);
190 extern const char *thumb_output_move_mem_multiple (int, rtx *);
191 extern const char *thumb_call_via_reg (rtx);
192 extern void thumb_expand_movmemqi (rtx *);
193 extern rtx arm_return_addr (int, rtx);
194 extern void thumb_reload_out_hi (rtx *);
195 extern void thumb_reload_in_hi (rtx *);
196 extern void thumb_set_return_address (rtx, rtx);
197 extern const char *thumb1_output_casesi (rtx *);
198 extern const char *thumb2_output_casesi (rtx *);
199 #endif
201 /* Defined in pe.c. */
202 extern int arm_dllexport_name_p (const char *);
203 extern int arm_dllimport_name_p (const char *);
205 #ifdef TREE_CODE
206 extern void arm_pe_unique_section (tree, int);
207 extern void arm_pe_encode_section_info (tree, rtx, int);
208 extern int arm_dllexport_p (tree);
209 extern int arm_dllimport_p (tree);
210 extern void arm_mark_dllexport (tree);
211 extern void arm_mark_dllimport (tree);
212 #endif
214 extern void arm_pr_long_calls (struct cpp_reader *);
215 extern void arm_pr_no_long_calls (struct cpp_reader *);
216 extern void arm_pr_long_calls_off (struct cpp_reader *);
218 extern void arm_lang_object_attributes_init(void);
220 extern const char *arm_mangle_type (const_tree);
222 extern void arm_order_regs_for_local_alloc (void);
224 extern int arm_max_conditional_execute ();
226 /* Vectorizer cost model implementation. */
227 struct cpu_vec_costs {
228 const int scalar_stmt_cost; /* Cost of any scalar operation, excluding
229 load and store. */
230 const int scalar_load_cost; /* Cost of scalar load. */
231 const int scalar_store_cost; /* Cost of scalar store. */
232 const int vec_stmt_cost; /* Cost of any vector operation, excluding
233 load, store, vector-to-scalar and
234 scalar-to-vector operation. */
235 const int vec_to_scalar_cost; /* Cost of vect-to-scalar operation. */
236 const int scalar_to_vec_cost; /* Cost of scalar-to-vector operation. */
237 const int vec_align_load_cost; /* Cost of aligned vector load. */
238 const int vec_unalign_load_cost; /* Cost of unaligned vector load. */
239 const int vec_unalign_store_cost; /* Cost of unaligned vector load. */
240 const int vec_store_cost; /* Cost of vector store. */
241 const int cond_taken_branch_cost; /* Cost of taken branch for vectorizer
242 cost model. */
243 const int cond_not_taken_branch_cost;/* Cost of not taken branch for
244 vectorizer cost model. */
247 #ifdef RTX_CODE
248 /* This needs to be here because we need RTX_CODE and similar. */
250 struct cpu_cost_table;
252 struct tune_params
254 bool (*rtx_costs) (rtx, RTX_CODE, RTX_CODE, int *, bool);
255 const struct cpu_cost_table *insn_extra_cost;
256 bool (*sched_adjust_cost) (rtx_insn *, rtx, rtx_insn *, int *);
257 int constant_limit;
258 /* Maximum number of instructions to conditionalise. */
259 int max_insns_skipped;
260 int num_prefetch_slots;
261 int l1_cache_size;
262 int l1_cache_line_size;
263 bool prefer_constant_pool;
264 int (*branch_cost) (bool, bool);
265 /* Prefer STRD/LDRD instructions over PUSH/POP/LDM/STM. */
266 bool prefer_ldrd_strd;
267 /* The preference for non short cirtcuit operation when optimizing for
268 performance. The first element covers Thumb state and the second one
269 is for ARM state. */
270 bool logical_op_non_short_circuit[2];
271 /* Vectorizer costs. */
272 const struct cpu_vec_costs* vec_costs;
273 /* Prefer Neon for 64-bit bitops. */
274 bool prefer_neon_for_64bits;
275 /* Prefer 32-bit encoding instead of flag-setting 16-bit encoding. */
276 bool disparage_flag_setting_t16_encodings;
277 /* Prefer 32-bit encoding instead of 16-bit encoding where subset of flags
278 would be set. */
279 bool disparage_partial_flag_setting_t16_encodings;
280 /* Prefer to inline string operations like memset by using Neon. */
281 bool string_ops_prefer_neon;
282 /* Maximum number of instructions to inline calls to memset. */
283 int max_insns_inline_memset;
286 extern const struct tune_params *current_tune;
287 extern int vfp3_const_double_for_fract_bits (rtx);
288 /* return power of two from operand, otherwise 0. */
289 extern int vfp3_const_double_for_bits (rtx);
291 extern void arm_emit_coreregs_64bit_shift (enum rtx_code, rtx, rtx, rtx, rtx,
292 rtx);
293 extern bool arm_validize_comparison (rtx *, rtx *, rtx *);
294 #endif /* RTX_CODE */
296 extern bool arm_gen_setmem (rtx *);
297 extern void arm_expand_vec_perm (rtx target, rtx op0, rtx op1, rtx sel);
298 extern bool arm_expand_vec_perm_const (rtx target, rtx op0, rtx op1, rtx sel);
300 extern bool arm_autoinc_modes_ok_p (enum machine_mode, enum arm_auto_incmodes);
302 extern void arm_emit_eabi_attribute (const char *, int, int);
304 /* Defined in gcc/common/config/arm-common.c. */
305 extern const char *arm_rewrite_selected_cpu (const char *name);
307 extern bool arm_is_constant_pool_ref (rtx);
309 #endif /* ! GCC_ARM_PROTOS_H */