comparison gcc/config/arm/arm-protos.h @ 111:04ced10e8804

gcc 7
author kono
date Fri, 27 Oct 2017 22:46:09 +0900
parents f6334be47118
children 84e7813d76e9
comparison
equal deleted inserted replaced
68:561a7518be6b 111:04ced10e8804
1 /* Prototypes for exported functions defined in arm.c and pe.c 1 /* Prototypes for exported functions defined in arm.c and pe.c
2 Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2 Copyright (C) 1999-2017 Free Software Foundation, Inc.
3 2009, 2010 Free Software Foundation, Inc.
4 Contributed by Richard Earnshaw (rearnsha@arm.com) 3 Contributed by Richard Earnshaw (rearnsha@arm.com)
5 Minor hacks by Nick Clifton (nickc@cygnus.com) 4 Minor hacks by Nick Clifton (nickc@cygnus.com)
6 5
7 This file is part of GCC. 6 This file is part of GCC.
8 7
21 <http://www.gnu.org/licenses/>. */ 20 <http://www.gnu.org/licenses/>. */
22 21
23 #ifndef GCC_ARM_PROTOS_H 22 #ifndef GCC_ARM_PROTOS_H
24 #define GCC_ARM_PROTOS_H 23 #define GCC_ARM_PROTOS_H
25 24
25 #include "sbitmap.h"
26
27 extern enum unwind_info_type arm_except_unwind_info (struct gcc_options *);
26 extern int use_return_insn (int, rtx); 28 extern int use_return_insn (int, rtx);
29 extern bool use_simple_return_p (void);
27 extern enum reg_class arm_regno_class (int); 30 extern enum reg_class arm_regno_class (int);
28 extern void arm_load_pic_register (unsigned long); 31 extern void arm_load_pic_register (unsigned long);
29 extern int arm_volatile_func (void); 32 extern int arm_volatile_func (void);
30 extern const char *arm_output_epilogue (rtx);
31 extern void arm_expand_prologue (void); 33 extern void arm_expand_prologue (void);
34 extern void arm_expand_epilogue (bool);
35 extern void arm_declare_function_name (FILE *, const char *, tree);
36 extern void arm_asm_declare_function_name (FILE *, const char *, tree);
37 extern void thumb2_expand_return (bool);
32 extern const char *arm_strip_name_encoding (const char *); 38 extern const char *arm_strip_name_encoding (const char *);
33 extern void arm_asm_output_labelref (FILE *, const char *); 39 extern void arm_asm_output_labelref (FILE *, const char *);
34 extern void thumb2_asm_output_opcode (FILE *); 40 extern void thumb2_asm_output_opcode (FILE *);
35 extern unsigned long arm_current_func_type (void); 41 extern unsigned long arm_current_func_type (void);
36 extern HOST_WIDE_INT arm_compute_initial_elimination_offset (unsigned int, 42 extern HOST_WIDE_INT arm_compute_initial_elimination_offset (unsigned int,
37 unsigned int); 43 unsigned int);
38 extern HOST_WIDE_INT thumb_compute_initial_elimination_offset (unsigned int, 44 extern HOST_WIDE_INT thumb_compute_initial_elimination_offset (unsigned int,
39 unsigned int); 45 unsigned int);
40 extern unsigned int arm_dbx_register_number (unsigned int); 46 extern unsigned int arm_dbx_register_number (unsigned int);
41 extern void arm_output_fn_unwind (FILE *, bool); 47 extern void arm_output_fn_unwind (FILE *, bool);
42 48
43 49 extern rtx arm_expand_builtin (tree exp, rtx target, rtx subtarget
50 ATTRIBUTE_UNUSED, machine_mode mode
51 ATTRIBUTE_UNUSED, int ignore ATTRIBUTE_UNUSED);
52 extern tree arm_builtin_decl (unsigned code, bool initialize_p
53 ATTRIBUTE_UNUSED);
54 extern void arm_init_builtins (void);
55 extern void arm_atomic_assign_expand_fenv (tree *hold, tree *clear, tree *update);
56 extern rtx arm_simd_vect_par_cnst_half (machine_mode mode, bool high);
57 extern bool arm_simd_check_vect_par_cnst_half_p (rtx op, machine_mode mode,
58 bool high);
44 #ifdef RTX_CODE 59 #ifdef RTX_CODE
45 extern bool arm_vector_mode_supported_p (enum machine_mode); 60 extern void arm_gen_unlikely_cbranch (enum rtx_code, machine_mode cc_mode,
46 extern bool arm_small_register_classes_for_mode_p (enum machine_mode); 61 rtx label_ref);
47 extern int arm_hard_regno_mode_ok (unsigned int, enum machine_mode); 62 extern bool arm_vector_mode_supported_p (machine_mode);
63 extern bool arm_small_register_classes_for_mode_p (machine_mode);
48 extern int const_ok_for_arm (HOST_WIDE_INT); 64 extern int const_ok_for_arm (HOST_WIDE_INT);
49 extern int arm_split_constant (RTX_CODE, enum machine_mode, rtx, 65 extern int const_ok_for_op (HOST_WIDE_INT, enum rtx_code);
66 extern int const_ok_for_dimode_op (HOST_WIDE_INT, enum rtx_code);
67 extern int arm_split_constant (RTX_CODE, machine_mode, rtx,
50 HOST_WIDE_INT, rtx, rtx, int); 68 HOST_WIDE_INT, rtx, rtx, int);
51 extern RTX_CODE arm_canonicalize_comparison (RTX_CODE, rtx *, rtx *);
52 extern int legitimate_pic_operand_p (rtx); 69 extern int legitimate_pic_operand_p (rtx);
53 extern rtx legitimize_pic_address (rtx, enum machine_mode, rtx); 70 extern rtx legitimize_pic_address (rtx, machine_mode, rtx);
54 extern rtx legitimize_tls_address (rtx, rtx); 71 extern rtx legitimize_tls_address (rtx, rtx);
55 extern int arm_legitimate_address_outer_p (enum machine_mode, rtx, RTX_CODE, int); 72 extern bool arm_legitimate_address_p (machine_mode, rtx, bool);
56 extern int thumb_legitimate_offset_p (enum machine_mode, HOST_WIDE_INT); 73 extern int arm_legitimate_address_outer_p (machine_mode, rtx, RTX_CODE, int);
57 extern bool arm_legitimize_reload_address (rtx *, enum machine_mode, int, int, 74 extern int thumb_legitimate_offset_p (machine_mode, HOST_WIDE_INT);
58 int); 75 extern int thumb1_legitimate_address_p (machine_mode, rtx, int);
59 extern rtx thumb_legitimize_reload_address (rtx *, enum machine_mode, int, int, 76 extern bool ldm_stm_operation_p (rtx, bool, machine_mode mode,
60 int); 77 bool, bool);
61 extern int arm_const_double_rtx (rtx); 78 extern int arm_const_double_rtx (rtx);
62 extern int neg_const_double_rtx_ok_for_fpa (rtx);
63 extern int vfp3_const_double_rtx (rtx); 79 extern int vfp3_const_double_rtx (rtx);
64 extern int neon_immediate_valid_for_move (rtx, enum machine_mode, rtx *, int *); 80 extern int neon_immediate_valid_for_move (rtx, machine_mode, rtx *, int *);
65 extern int neon_immediate_valid_for_logic (rtx, enum machine_mode, int, rtx *, 81 extern int neon_immediate_valid_for_logic (rtx, machine_mode, int, rtx *,
66 int *); 82 int *);
83 extern int neon_immediate_valid_for_shift (rtx, machine_mode, rtx *,
84 int *, bool);
67 extern char *neon_output_logic_immediate (const char *, rtx *, 85 extern char *neon_output_logic_immediate (const char *, rtx *,
68 enum machine_mode, int, int); 86 machine_mode, int, int);
69 extern void neon_pairwise_reduce (rtx, rtx, enum machine_mode, 87 extern char *neon_output_shift_immediate (const char *, char, rtx *,
88 machine_mode, int, bool);
89 extern void neon_pairwise_reduce (rtx, rtx, machine_mode,
70 rtx (*) (rtx, rtx, rtx)); 90 rtx (*) (rtx, rtx, rtx));
71 extern rtx neon_make_constant (rtx); 91 extern rtx neon_make_constant (rtx);
92 extern tree arm_builtin_vectorized_function (unsigned int, tree, tree);
72 extern void neon_expand_vector_init (rtx, rtx); 93 extern void neon_expand_vector_init (rtx, rtx);
73 extern void neon_lane_bounds (rtx, HOST_WIDE_INT, HOST_WIDE_INT); 94 extern void neon_lane_bounds (rtx, HOST_WIDE_INT, HOST_WIDE_INT, const_tree);
74 extern void neon_const_bounds (rtx, HOST_WIDE_INT, HOST_WIDE_INT); 95 extern void arm_const_bounds (rtx, HOST_WIDE_INT, HOST_WIDE_INT);
75 extern HOST_WIDE_INT neon_element_bits (enum machine_mode); 96 extern HOST_WIDE_INT neon_element_bits (machine_mode);
76 extern void neon_reinterpret (rtx, rtx); 97 extern void neon_emit_pair_result_insn (machine_mode,
77 extern void neon_emit_pair_result_insn (enum machine_mode,
78 rtx (*) (rtx, rtx, rtx, rtx), 98 rtx (*) (rtx, rtx, rtx, rtx),
79 rtx, rtx, rtx); 99 rtx, rtx, rtx);
80 extern void neon_disambiguate_copy (rtx *, rtx *, rtx *, unsigned int); 100 extern void neon_disambiguate_copy (rtx *, rtx *, rtx *, unsigned int);
81 extern enum reg_class coproc_secondary_reload_class (enum machine_mode, rtx, 101 extern void neon_split_vcombine (rtx op[3]);
102 extern enum reg_class coproc_secondary_reload_class (machine_mode, rtx,
82 bool); 103 bool);
83 extern bool arm_tls_referenced_p (rtx); 104 extern bool arm_tls_referenced_p (rtx);
84 extern bool arm_cannot_force_const_mem (rtx); 105
85
86 extern int cirrus_memory_offset (rtx);
87 extern int arm_coproc_mem_operand (rtx, bool); 106 extern int arm_coproc_mem_operand (rtx, bool);
88 extern int neon_vector_mem_operand (rtx, int); 107 extern int neon_vector_mem_operand (rtx, int, bool);
89 extern int neon_struct_mem_operand (rtx); 108 extern int neon_struct_mem_operand (rtx);
90 extern int arm_no_early_store_addr_dep (rtx, rtx);
91 extern int arm_early_store_addr_dep (rtx, rtx);
92 extern int arm_early_load_addr_dep (rtx, rtx);
93 extern int arm_no_early_alu_shift_dep (rtx, rtx);
94 extern int arm_no_early_alu_shift_value_dep (rtx, rtx);
95 extern int arm_no_early_mul_dep (rtx, rtx);
96 extern int arm_mac_accumulator_is_mul_result (rtx, rtx);
97 109
98 extern int tls_mentioned_p (rtx); 110 extern int tls_mentioned_p (rtx);
99 extern int symbol_mentioned_p (rtx); 111 extern int symbol_mentioned_p (rtx);
100 extern int label_mentioned_p (rtx); 112 extern int label_mentioned_p (rtx);
101 extern RTX_CODE minmax_code (rtx); 113 extern RTX_CODE minmax_code (rtx);
114 extern bool arm_sat_operator_match (rtx, rtx, int *, bool *);
102 extern int adjacent_mem_locations (rtx, rtx); 115 extern int adjacent_mem_locations (rtx, rtx);
103 extern bool gen_ldm_seq (rtx *, int, bool); 116 extern bool gen_ldm_seq (rtx *, int, bool);
104 extern bool gen_stm_seq (rtx *, int); 117 extern bool gen_stm_seq (rtx *, int);
105 extern bool gen_const_stm_seq (rtx *, int); 118 extern bool gen_const_stm_seq (rtx *, int);
106 extern rtx arm_gen_load_multiple (int *, int, rtx, int, rtx, HOST_WIDE_INT *); 119 extern rtx arm_gen_load_multiple (int *, int, rtx, int, rtx, HOST_WIDE_INT *);
107 extern rtx arm_gen_store_multiple (int *, int, rtx, int, rtx, HOST_WIDE_INT *); 120 extern rtx arm_gen_store_multiple (int *, int, rtx, int, rtx, HOST_WIDE_INT *);
121 extern bool offset_ok_for_ldrd_strd (HOST_WIDE_INT);
122 extern bool operands_ok_ldrd_strd (rtx, rtx, rtx, HOST_WIDE_INT, bool, bool);
123 extern bool gen_operands_ldrd_strd (rtx *, bool, bool, bool);
108 extern int arm_gen_movmemqi (rtx *); 124 extern int arm_gen_movmemqi (rtx *);
109 extern enum machine_mode arm_select_cc_mode (RTX_CODE, rtx, rtx); 125 extern bool gen_movmem_ldrd_strd (rtx *);
110 extern enum machine_mode arm_select_dominance_cc_mode (rtx, rtx, 126 extern machine_mode arm_select_cc_mode (RTX_CODE, rtx, rtx);
127 extern machine_mode arm_select_dominance_cc_mode (rtx, rtx,
111 HOST_WIDE_INT); 128 HOST_WIDE_INT);
112 extern rtx arm_gen_compare_reg (RTX_CODE, rtx, rtx); 129 extern rtx arm_gen_compare_reg (RTX_CODE, rtx, rtx, rtx);
113 extern rtx arm_gen_return_addr_mask (void); 130 extern rtx arm_gen_return_addr_mask (void);
114 extern void arm_reload_in_hi (rtx *); 131 extern void arm_reload_in_hi (rtx *);
115 extern void arm_reload_out_hi (rtx *); 132 extern void arm_reload_out_hi (rtx *);
133 extern int arm_max_const_double_inline_cost (void);
116 extern int arm_const_double_inline_cost (rtx); 134 extern int arm_const_double_inline_cost (rtx);
117 extern bool arm_const_double_by_parts (rtx); 135 extern bool arm_const_double_by_parts (rtx);
118 extern bool arm_const_double_by_immediates (rtx); 136 extern bool arm_const_double_by_immediates (rtx);
119 extern const char *fp_immediate_constant (rtx); 137 extern void arm_emit_call_insn (rtx, rtx, bool);
120 extern void arm_emit_call_insn (rtx, rtx); 138 bool detect_cmse_nonsecure_call (tree);
121 extern const char *output_call (rtx *); 139 extern const char *output_call (rtx *);
122 extern const char *output_call_mem (rtx *);
123 void arm_emit_movpair (rtx, rtx); 140 void arm_emit_movpair (rtx, rtx);
124 extern const char *output_mov_long_double_fpa_from_arm (rtx *);
125 extern const char *output_mov_long_double_arm_from_fpa (rtx *);
126 extern const char *output_mov_long_double_arm_from_arm (rtx *); 141 extern const char *output_mov_long_double_arm_from_arm (rtx *);
127 extern const char *output_mov_double_fpa_from_arm (rtx *); 142 extern const char *output_move_double (rtx *, bool, int *count);
128 extern const char *output_mov_double_arm_from_fpa (rtx *);
129 extern const char *output_move_double (rtx *);
130 extern const char *output_move_quad (rtx *); 143 extern const char *output_move_quad (rtx *);
144 extern int arm_count_output_move_double_insns (rtx *);
131 extern const char *output_move_vfp (rtx *operands); 145 extern const char *output_move_vfp (rtx *operands);
132 extern const char *output_move_neon (rtx *operands); 146 extern const char *output_move_neon (rtx *operands);
133 extern int arm_attr_length_move_neon (rtx); 147 extern int arm_attr_length_move_neon (rtx_insn *);
134 extern int arm_address_offset_is_imm (rtx); 148 extern int arm_address_offset_is_imm (rtx_insn *);
135 extern const char *output_add_immediate (rtx *); 149 extern const char *output_add_immediate (rtx *);
136 extern const char *arithmetic_instr (rtx, int); 150 extern const char *arithmetic_instr (rtx, int);
137 extern void output_ascii_pseudo_op (FILE *, const unsigned char *, int); 151 extern void output_ascii_pseudo_op (FILE *, const unsigned char *, int);
138 extern const char *output_return_instruction (rtx, int, int); 152 extern const char *output_return_instruction (rtx, bool, bool, bool);
153 extern const char *output_probe_stack_range (rtx, rtx);
139 extern void arm_poke_function_name (FILE *, const char *); 154 extern void arm_poke_function_name (FILE *, const char *);
140 extern void arm_final_prescan_insn (rtx); 155 extern void arm_final_prescan_insn (rtx_insn *);
141 extern int arm_debugger_arg_offset (int, rtx); 156 extern int arm_debugger_arg_offset (int, rtx);
142 extern bool arm_is_long_call_p (tree); 157 extern bool arm_is_long_call_p (tree);
143 extern int arm_emit_vector_const (FILE *, rtx); 158 extern int arm_emit_vector_const (FILE *, rtx);
144 extern void arm_emit_fp16_const (rtx c); 159 extern void arm_emit_fp16_const (rtx c);
145 extern const char * arm_output_load_gr (rtx *); 160 extern const char * arm_output_load_gr (rtx *);
146 extern const char *vfp_output_fstmd (rtx *); 161 extern const char *vfp_output_vstmd (rtx *);
162 extern void arm_output_multireg_pop (rtx *, bool, rtx, bool, bool);
147 extern void arm_set_return_address (rtx, rtx); 163 extern void arm_set_return_address (rtx, rtx);
148 extern int arm_eliminable_register (rtx); 164 extern int arm_eliminable_register (rtx);
149 extern const char *arm_output_shift(rtx *, int); 165 extern const char *arm_output_shift(rtx *, int);
150 extern void arm_expand_sync (enum machine_mode, struct arm_sync_generator *, 166 extern const char *arm_output_iwmmxt_shift_immediate (const char *, rtx *, bool);
151 rtx, rtx, rtx, rtx); 167 extern const char *arm_output_iwmmxt_tinsr (rtx *);
152 extern const char *arm_output_memory_barrier (rtx *);
153 extern const char *arm_output_sync_insn (rtx, rtx *);
154 extern unsigned int arm_sync_loop_insns (rtx , rtx *); 168 extern unsigned int arm_sync_loop_insns (rtx , rtx *);
169 extern int arm_attr_length_push_multi(rtx, rtx);
170 extern int arm_attr_length_pop_multi(rtx *, bool, bool);
171 extern void arm_expand_compare_and_swap (rtx op[]);
172 extern void arm_split_compare_and_swap (rtx op[]);
173 extern void arm_split_atomic_op (enum rtx_code, rtx, rtx, rtx, rtx, rtx, rtx);
174 extern rtx arm_load_tp (rtx);
175 extern bool arm_coproc_builtin_available (enum unspecv);
176 extern bool arm_coproc_ldc_stc_legitimate_address (rtx);
155 177
156 #if defined TREE_CODE 178 #if defined TREE_CODE
157 extern void arm_init_cumulative_args (CUMULATIVE_ARGS *, tree, rtx, tree); 179 extern void arm_init_cumulative_args (CUMULATIVE_ARGS *, tree, rtx, tree);
158 extern bool arm_pad_arg_upward (enum machine_mode, const_tree); 180 extern bool arm_pad_reg_upward (machine_mode, tree, int);
159 extern bool arm_pad_reg_upward (enum machine_mode, tree, int);
160 #endif 181 #endif
161 extern int arm_apply_result_size (void); 182 extern int arm_apply_result_size (void);
162 extern rtx aapcs_libcall_value (enum machine_mode);
163 183
164 #endif /* RTX_CODE */ 184 #endif /* RTX_CODE */
165
166 extern int arm_float_words_big_endian (void);
167 185
168 /* Thumb functions. */ 186 /* Thumb functions. */
169 extern void arm_init_expanders (void); 187 extern void arm_init_expanders (void);
170 extern const char *thumb_unexpanded_epilogue (void); 188 extern const char *thumb1_unexpanded_epilogue (void);
171 extern void thumb1_expand_prologue (void); 189 extern void thumb1_expand_prologue (void);
172 extern void thumb1_expand_epilogue (void); 190 extern void thumb1_expand_epilogue (void);
173 #ifdef TREE_CODE 191 extern const char *thumb1_output_interwork (void);
174 extern int is_called_in_ARM_mode (tree);
175 #endif
176 extern int thumb_shiftable_const (unsigned HOST_WIDE_INT); 192 extern int thumb_shiftable_const (unsigned HOST_WIDE_INT);
177 #ifdef RTX_CODE 193 #ifdef RTX_CODE
178 extern void thumb1_final_prescan_insn (rtx); 194 extern enum arm_cond_code maybe_get_arm_condition_code (rtx);
179 extern void thumb2_final_prescan_insn (rtx); 195 extern void thumb1_final_prescan_insn (rtx_insn *);
196 extern void thumb2_final_prescan_insn (rtx_insn *);
180 extern const char *thumb_load_double_from_address (rtx *); 197 extern const char *thumb_load_double_from_address (rtx *);
181 extern const char *thumb_output_move_mem_multiple (int, rtx *); 198 extern const char *thumb_output_move_mem_multiple (int, rtx *);
182 extern const char *thumb_call_via_reg (rtx); 199 extern const char *thumb_call_via_reg (rtx);
183 extern void thumb_expand_movmemqi (rtx *); 200 extern void thumb_expand_movmemqi (rtx *);
184 extern rtx arm_return_addr (int, rtx); 201 extern rtx arm_return_addr (int, rtx);
185 extern void thumb_reload_out_hi (rtx *); 202 extern void thumb_reload_out_hi (rtx *);
186 extern void thumb_reload_in_hi (rtx *);
187 extern void thumb_set_return_address (rtx, rtx); 203 extern void thumb_set_return_address (rtx, rtx);
188 extern const char *thumb1_output_casesi (rtx *); 204 extern const char *thumb1_output_casesi (rtx *);
189 extern const char *thumb2_output_casesi (rtx *); 205 extern const char *thumb2_output_casesi (rtx *);
190 #endif 206 #endif
191 207
198 extern void arm_pe_encode_section_info (tree, rtx, int); 214 extern void arm_pe_encode_section_info (tree, rtx, int);
199 extern int arm_dllexport_p (tree); 215 extern int arm_dllexport_p (tree);
200 extern int arm_dllimport_p (tree); 216 extern int arm_dllimport_p (tree);
201 extern void arm_mark_dllexport (tree); 217 extern void arm_mark_dllexport (tree);
202 extern void arm_mark_dllimport (tree); 218 extern void arm_mark_dllimport (tree);
219 extern bool arm_change_mode_p (tree);
203 #endif 220 #endif
204 221
222 extern tree arm_valid_target_attribute_tree (tree, struct gcc_options *,
223 struct gcc_options *);
224 extern void arm_configure_build_target (struct arm_build_target *,
225 struct cl_target_option *,
226 struct gcc_options *, bool);
205 extern void arm_pr_long_calls (struct cpp_reader *); 227 extern void arm_pr_long_calls (struct cpp_reader *);
206 extern void arm_pr_no_long_calls (struct cpp_reader *); 228 extern void arm_pr_no_long_calls (struct cpp_reader *);
207 extern void arm_pr_long_calls_off (struct cpp_reader *); 229 extern void arm_pr_long_calls_off (struct cpp_reader *);
208 230
209 extern void arm_lang_object_attributes_init(void);
210
211 extern const char *arm_mangle_type (const_tree); 231 extern const char *arm_mangle_type (const_tree);
232 extern const char *arm_mangle_builtin_type (const_tree);
212 233
213 extern void arm_order_regs_for_local_alloc (void); 234 extern void arm_order_regs_for_local_alloc (void);
235
236 extern int arm_max_conditional_execute ();
237
238 /* Vectorizer cost model implementation. */
239 struct cpu_vec_costs {
240 const int scalar_stmt_cost; /* Cost of any scalar operation, excluding
241 load and store. */
242 const int scalar_load_cost; /* Cost of scalar load. */
243 const int scalar_store_cost; /* Cost of scalar store. */
244 const int vec_stmt_cost; /* Cost of any vector operation, excluding
245 load, store, vector-to-scalar and
246 scalar-to-vector operation. */
247 const int vec_to_scalar_cost; /* Cost of vect-to-scalar operation. */
248 const int scalar_to_vec_cost; /* Cost of scalar-to-vector operation. */
249 const int vec_align_load_cost; /* Cost of aligned vector load. */
250 const int vec_unalign_load_cost; /* Cost of unaligned vector load. */
251 const int vec_unalign_store_cost; /* Cost of unaligned vector load. */
252 const int vec_store_cost; /* Cost of vector store. */
253 const int cond_taken_branch_cost; /* Cost of taken branch for vectorizer
254 cost model. */
255 const int cond_not_taken_branch_cost;/* Cost of not taken branch for
256 vectorizer cost model. */
257 };
214 258
215 #ifdef RTX_CODE 259 #ifdef RTX_CODE
216 /* This needs to be here because we need RTX_CODE and similar. */ 260 /* This needs to be here because we need RTX_CODE and similar. */
217 261
262 struct cpu_cost_table;
263
264 /* Dump function ARM_PRINT_TUNE_INFO should be updated whenever this
265 structure is modified. */
266
218 struct tune_params 267 struct tune_params
219 { 268 {
220 bool (*rtx_costs) (rtx, RTX_CODE, RTX_CODE, int *, bool); 269 const struct cpu_cost_table *insn_extra_cost;
221 bool (*sched_adjust_cost) (rtx, rtx, rtx, int *); 270 bool (*sched_adjust_cost) (rtx_insn *, int, rtx_insn *, int *);
271 int (*branch_cost) (bool, bool);
272 /* Vectorizer costs. */
273 const struct cpu_vec_costs* vec_costs;
222 int constant_limit; 274 int constant_limit;
223 int num_prefetch_slots; 275 /* Maximum number of instructions to conditionalise. */
224 int l1_cache_size; 276 int max_insns_skipped;
225 int l1_cache_line_size; 277 /* Maximum number of instructions to inline calls to memset. */
226 }; 278 int max_insns_inline_memset;
279 /* Issue rate of the processor. */
280 unsigned int issue_rate;
281 /* Explicit prefetch data. */
282 struct
283 {
284 int num_slots;
285 int l1_cache_size;
286 int l1_cache_line_size;
287 } prefetch;
288 enum {PREF_CONST_POOL_FALSE, PREF_CONST_POOL_TRUE}
289 prefer_constant_pool: 1;
290 /* Prefer STRD/LDRD instructions over PUSH/POP/LDM/STM. */
291 enum {PREF_LDRD_FALSE, PREF_LDRD_TRUE} prefer_ldrd_strd: 1;
292 /* The preference for non short cirtcuit operation when optimizing for
293 performance. The first element covers Thumb state and the second one
294 is for ARM state. */
295 enum log_op_non_short_circuit {LOG_OP_NON_SHORT_CIRCUIT_FALSE,
296 LOG_OP_NON_SHORT_CIRCUIT_TRUE};
297 log_op_non_short_circuit logical_op_non_short_circuit_thumb: 1;
298 log_op_non_short_circuit logical_op_non_short_circuit_arm: 1;
299 /* Prefer 32-bit encoding instead of flag-setting 16-bit encoding. */
300 enum {DISPARAGE_FLAGS_NEITHER, DISPARAGE_FLAGS_PARTIAL, DISPARAGE_FLAGS_ALL}
301 disparage_flag_setting_t16_encodings: 2;
302 enum {PREF_NEON_64_FALSE, PREF_NEON_64_TRUE} prefer_neon_for_64bits: 1;
303 /* Prefer to inline string operations like memset by using Neon. */
304 enum {PREF_NEON_STRINGOPS_FALSE, PREF_NEON_STRINGOPS_TRUE}
305 string_ops_prefer_neon: 1;
306 /* Bitfield encoding the fusible pairs of instructions. Use FUSE_OPS
307 in an initializer if multiple fusion operations are supported on a
308 target. */
309 enum fuse_ops
310 {
311 FUSE_NOTHING = 0,
312 FUSE_MOVW_MOVT = 1 << 0,
313 FUSE_AES_AESMC = 1 << 1
314 } fusible_ops: 2;
315 /* Depth of scheduling queue to check for L2 autoprefetcher. */
316 enum {SCHED_AUTOPREF_OFF, SCHED_AUTOPREF_RANK, SCHED_AUTOPREF_FULL}
317 sched_autopref: 2;
318 };
319
320 /* Smash multiple fusion operations into a type that can be used for an
321 initializer. */
322 #define FUSE_OPS(x) ((tune_params::fuse_ops) (x))
227 323
228 extern const struct tune_params *current_tune; 324 extern const struct tune_params *current_tune;
325 extern int vfp3_const_double_for_fract_bits (rtx);
326 /* return power of two from operand, otherwise 0. */
327 extern int vfp3_const_double_for_bits (rtx);
328
329 extern void arm_emit_coreregs_64bit_shift (enum rtx_code, rtx, rtx, rtx, rtx,
330 rtx);
331 extern bool arm_fusion_enabled_p (tune_params::fuse_ops);
332 extern bool arm_valid_symbolic_address_p (rtx);
333 extern bool arm_validize_comparison (rtx *, rtx *, rtx *);
229 #endif /* RTX_CODE */ 334 #endif /* RTX_CODE */
230 335
336 extern bool arm_gen_setmem (rtx *);
337 extern void arm_expand_vec_perm (rtx target, rtx op0, rtx op1, rtx sel);
338 extern bool arm_expand_vec_perm_const (rtx target, rtx op0, rtx op1, rtx sel);
339
340 extern bool arm_autoinc_modes_ok_p (machine_mode, enum arm_auto_incmodes);
341
342 extern void arm_emit_eabi_attribute (const char *, int, int);
343
344 extern void arm_reset_previous_fndecl (void);
345 extern void save_restore_target_globals (tree);
346
347 /* Defined in gcc/common/config/arm-common.c. */
348 extern const char *arm_rewrite_selected_cpu (const char *name);
349
350 /* Defined in gcc/common/config/arm-c.c. */
351 extern void arm_lang_object_attributes_init (void);
352 extern void arm_register_target_pragmas (void);
353 extern void arm_cpu_cpp_builtins (struct cpp_reader *);
354
355 extern bool arm_is_constant_pool_ref (rtx);
356
357 /* The bits in this mask specify which instruction scheduling options should
358 be used. */
359 extern unsigned int tune_flags;
360
361 /* Nonzero if this chip supports the ARM Architecture 3M extensions. */
362 extern int arm_arch3m;
363
364 /* Nonzero if this chip supports the ARM Architecture 4 extensions. */
365 extern int arm_arch4;
366
367 /* Nonzero if this chip supports the ARM Architecture 4t extensions. */
368 extern int arm_arch4t;
369
370 /* Nonzero if this chip supports the ARM Architecture 5 extensions. */
371 extern int arm_arch5;
372
373 /* Nonzero if this chip supports the ARM Architecture 5E extensions. */
374 extern int arm_arch5e;
375
376 /* Nonzero if this chip supports the ARM Architecture 6 extensions. */
377 extern int arm_arch6;
378
379 /* Nonzero if this chip supports the ARM 6K extensions. */
380 extern int arm_arch6k;
381
382 /* Nonzero if this chip supports the ARM 6KZ extensions. */
383 extern int arm_arch6kz;
384
385 /* Nonzero if instructions present in ARMv6-M can be used. */
386 extern int arm_arch6m;
387
388 /* Nonzero if this chip supports the ARM 7 extensions. */
389 extern int arm_arch7;
390
391 /* Nonzero if this chip supports the Large Physical Address Extension. */
392 extern int arm_arch_lpae;
393
394 /* Nonzero if instructions not present in the 'M' profile can be used. */
395 extern int arm_arch_notm;
396
397 /* Nonzero if instructions present in ARMv7E-M can be used. */
398 extern int arm_arch7em;
399
400 /* Nonzero if instructions present in ARMv8 can be used. */
401 extern int arm_arch8;
402
403 /* Nonzero if this chip can benefit from load scheduling. */
404 extern int arm_ld_sched;
405
406 /* Nonzero if this chip is a StrongARM. */
407 extern int arm_tune_strongarm;
408
409 /* Nonzero if this chip supports Intel Wireless MMX technology. */
410 extern int arm_arch_iwmmxt;
411
412 /* Nonzero if this chip supports Intel Wireless MMX2 technology. */
413 extern int arm_arch_iwmmxt2;
414
415 /* Nonzero if this chip is an XScale. */
416 extern int arm_arch_xscale;
417
418 /* Nonzero if tuning for XScale */
419 extern int arm_tune_xscale;
420
421 /* Nonzero if we want to tune for stores that access the write-buffer.
422 This typically means an ARM6 or ARM7 with MMU or MPU. */
423 extern int arm_tune_wbuf;
424
425 /* Nonzero if tuning for Cortex-A9. */
426 extern int arm_tune_cortex_a9;
427
428 /* Nonzero if we should define __THUMB_INTERWORK__ in the
429 preprocessor.
430 XXX This is a bit of a hack, it's intended to help work around
431 problems in GLD which doesn't understand that armv5t code is
432 interworking clean. */
433 extern int arm_cpp_interwork;
434
435 /* Nonzero if chip supports Thumb 1. */
436 extern int arm_arch_thumb1;
437
438 /* Nonzero if chip supports Thumb 2. */
439 extern int arm_arch_thumb2;
440
441 /* Nonzero if chip supports integer division instruction. */
442 extern int arm_arch_arm_hwdiv;
443 extern int arm_arch_thumb_hwdiv;
444
445 /* Nonzero if chip disallows volatile memory access in IT block. */
446 extern int arm_arch_no_volatile_ce;
447
448 /* Nonzero if we should use Neon to handle 64-bits operations rather
449 than core registers. */
450 extern int prefer_neon_for_64bits;
451
452 /* Structure defining the current overall architectural target and tuning. */
453 struct arm_build_target
454 {
455 /* Name of the target CPU, if known, or NULL if the target CPU was not
456 specified by the user (and inferred from the -march option). */
457 const char *core_name;
458 /* Name of the target ARCH. NULL if there is a selected CPU. */
459 const char *arch_name;
460 /* Preprocessor substring (never NULL). */
461 const char *arch_pp_name;
462 /* The base architecture value. */
463 enum base_architecture base_arch;
464 /* The profile letter for the architecture, upper case by convention. */
465 char profile;
466 /* Bitmap encapsulating the isa_bits for the target environment. */
467 sbitmap isa;
468 /* Flags used for tuning. Long term, these move into tune_params. */
469 unsigned int tune_flags;
470 /* Tables with more detailed tuning information. */
471 const struct tune_params *tune;
472 /* CPU identifier for the tuning target. */
473 enum processor_type tune_core;
474 };
475
476 extern struct arm_build_target arm_active_target;
477
478 struct cpu_arch_extension
479 {
480 /* Feature name. */
481 const char *const name;
482 /* True if the option is negative (removes extensions). */
483 bool remove;
484 /* True if the option is an alias for another option with identical effect;
485 the option will be ignored for canonicalization. */
486 bool alias;
487 /* The modifier bits. */
488 const enum isa_feature isa_bits[isa_num_bits];
489 };
490
491 struct cpu_arch_option
492 {
493 /* Name for this option. */
494 const char *name;
495 /* List of feature extensions permitted. */
496 const struct cpu_arch_extension *extensions;
497 /* Standard feature bits. */
498 enum isa_feature isa_bits[isa_num_bits];
499 };
500
501 struct arch_option
502 {
503 /* Common option fields. */
504 cpu_arch_option common;
505 /* Short string for this architecture. */
506 const char *arch;
507 /* Base architecture, from which this specific architecture is derived. */
508 enum base_architecture base_arch;
509 /* The profile letter for the architecture, upper case by convention. */
510 const char profile;
511 /* Default tune target (in the absence of any more specific data). */
512 enum processor_type tune_id;
513 };
514
515 struct cpu_option
516 {
517 /* Common option fields. */
518 cpu_arch_option common;
519 /* Architecture upon which this CPU is based. */
520 enum arch_type arch;
521 };
522
523 extern const arch_option all_architectures[];
524 extern const cpu_option all_cores[];
525
526 const cpu_option *arm_parse_cpu_option_name (const cpu_option *, const char *,
527 const char *);
528 const arch_option *arm_parse_arch_option_name (const arch_option *,
529 const char *, const char *);
530 void arm_parse_option_features (sbitmap, const cpu_arch_option *,
531 const char *);
532
533 void arm_initialize_isa (sbitmap, const enum isa_feature *);
534
231 #endif /* ! GCC_ARM_PROTOS_H */ 535 #endif /* ! GCC_ARM_PROTOS_H */