]> git.ipfire.org Git - thirdparty/gcc.git/blame - gcc/config/arm/arm-protos.h
AArch64: Fix initializer for array so it's a C initializer instead of C++.
[thirdparty/gcc.git] / gcc / config / arm / arm-protos.h
CommitLineData
eb3921e8 1/* Prototypes for exported functions defined in arm.c and pe.c
a5544970 2 Copyright (C) 1999-2019 Free Software Foundation, Inc.
eb3921e8
NC
3 Contributed by Richard Earnshaw (rearnsha@arm.com)
4 Minor hacks by Nick Clifton (nickc@cygnus.com)
5
4f448245 6 This file is part of GCC.
eb3921e8 7
4f448245
NC
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
2f83c7d6 10 the Free Software Foundation; either version 3, or (at your option)
4f448245 11 any later version.
eb3921e8 12
4f448245
NC
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.
eb3921e8 17
4f448245 18 You should have received a copy of the GNU General Public License
2f83c7d6
NC
19 along with GCC; see the file COPYING3. If not see
20 <http://www.gnu.org/licenses/>. */
eb3921e8 21
8b97c5f8
ZW
22#ifndef GCC_ARM_PROTOS_H
23#define GCC_ARM_PROTOS_H
24
851966d6 25#include "sbitmap.h"
70e73d3c 26
677f3fa8 27extern enum unwind_info_type arm_except_unwind_info (struct gcc_options *);
a72d4945 28extern int use_return_insn (int, rtx);
24d5b097 29extern bool use_simple_return_p (void);
bbbbb16a 30extern enum reg_class arm_regno_class (int);
89d75572 31extern void arm_load_pic_register (unsigned long, rtx);
e32bac5b 32extern int arm_volatile_func (void);
e32bac5b 33extern void arm_expand_prologue (void);
d461c88a 34extern void arm_expand_epilogue (bool);
258619bb 35extern void arm_declare_function_name (FILE *, const char *, tree);
9ad1f699 36extern void arm_asm_declare_function_name (FILE *, const char *, tree);
24d5b097 37extern void thumb2_expand_return (bool);
e32bac5b
RE
38extern const char *arm_strip_name_encoding (const char *);
39extern void arm_asm_output_labelref (FILE *, const char *);
5b3e6663 40extern void thumb2_asm_output_opcode (FILE *);
e32bac5b 41extern unsigned long arm_current_func_type (void);
b3f8d95d
MM
42extern HOST_WIDE_INT arm_compute_initial_elimination_offset (unsigned int,
43 unsigned int);
5848830f
PB
44extern HOST_WIDE_INT thumb_compute_initial_elimination_offset (unsigned int,
45 unsigned int);
2fa330b2 46extern unsigned int arm_dbx_register_number (unsigned int);
617a1b71 47extern void arm_output_fn_unwind (FILE *, bool);
33857df2
JG
48
49extern rtx arm_expand_builtin (tree exp, rtx target, rtx subtarget
b8506a8a 50 ATTRIBUTE_UNUSED, machine_mode mode
33857df2
JG
51 ATTRIBUTE_UNUSED, int ignore ATTRIBUTE_UNUSED);
52extern tree arm_builtin_decl (unsigned code, bool initialize_p
53 ATTRIBUTE_UNUSED);
54extern void arm_init_builtins (void);
55extern void arm_atomic_assign_expand_fenv (tree *hold, tree *clear, tree *update);
93c590ee
MC
56extern rtx arm_simd_vect_par_cnst_half (machine_mode mode, bool high);
57extern bool arm_simd_check_vect_par_cnst_half_p (rtx op, machine_mode mode,
58 bool high);
ebdb6f23
RE
59extern void arm_emit_speculation_barrier_function (void);
60
eb3921e8 61#ifdef RTX_CODE
c8cd4696
MC
62extern void arm_gen_unlikely_cbranch (enum rtx_code, machine_mode cc_mode,
63 rtx label_ref);
ef4bddc2
RS
64extern bool arm_vector_mode_supported_p (machine_mode);
65extern bool arm_small_register_classes_for_mode_p (machine_mode);
e32bac5b 66extern int const_ok_for_arm (HOST_WIDE_INT);
c2b640a7 67extern int const_ok_for_op (HOST_WIDE_INT, enum rtx_code);
44cd6810 68extern int const_ok_for_dimode_op (HOST_WIDE_INT, enum rtx_code);
ef4bddc2 69extern int arm_split_constant (RTX_CODE, machine_mode, rtx,
a406f566 70 HOST_WIDE_INT, rtx, rtx, int);
e32bac5b 71extern int legitimate_pic_operand_p (rtx);
89d75572 72extern rtx legitimize_pic_address (rtx, machine_mode, rtx, rtx, bool);
d3585b76 73extern rtx legitimize_tls_address (rtx, rtx);
ef4bddc2
RS
74extern bool arm_legitimate_address_p (machine_mode, rtx, bool);
75extern int arm_legitimate_address_outer_p (machine_mode, rtx, RTX_CODE, int);
76extern int thumb_legitimate_offset_p (machine_mode, HOST_WIDE_INT);
ef4bddc2
RS
77extern int thumb1_legitimate_address_p (machine_mode, rtx, int);
78extern bool ldm_stm_operation_p (rtx, bool, machine_mode mode,
fb40241d 79 bool, bool);
9b66ebb1 80extern int arm_const_double_rtx (rtx);
f1adb0a9 81extern int vfp3_const_double_rtx (rtx);
ef4bddc2
RS
82extern int neon_immediate_valid_for_move (rtx, machine_mode, rtx *, int *);
83extern int neon_immediate_valid_for_logic (rtx, machine_mode, int, rtx *,
88f77cba 84 int *);
ef4bddc2 85extern int neon_immediate_valid_for_shift (rtx, machine_mode, rtx *,
31a0c825 86 int *, bool);
88f77cba 87extern char *neon_output_logic_immediate (const char *, rtx *,
ef4bddc2 88 machine_mode, int, int);
31a0c825 89extern char *neon_output_shift_immediate (const char *, char, rtx *,
ef4bddc2
RS
90 machine_mode, int, bool);
91extern void neon_pairwise_reduce (rtx, rtx, machine_mode,
88f77cba 92 rtx (*) (rtx, rtx, rtx));
814a4c3b 93extern rtx neon_make_constant (rtx);
10766209 94extern tree arm_builtin_vectorized_function (unsigned int, tree, tree);
88f77cba 95extern void neon_expand_vector_init (rtx, rtx);
eaa80f64 96extern void neon_lane_bounds (rtx, HOST_WIDE_INT, HOST_WIDE_INT, const_tree);
d57daa0c 97extern void arm_const_bounds (rtx, HOST_WIDE_INT, HOST_WIDE_INT);
ef4bddc2 98extern HOST_WIDE_INT neon_element_bits (machine_mode);
ef4bddc2 99extern void neon_emit_pair_result_insn (machine_mode,
88f77cba
JB
100 rtx (*) (rtx, rtx, rtx, rtx),
101 rtx, rtx, rtx);
102extern void neon_disambiguate_copy (rtx *, rtx *, rtx *, unsigned int);
b440f324 103extern void neon_split_vcombine (rtx op[3]);
ef4bddc2 104extern enum reg_class coproc_secondary_reload_class (machine_mode, rtx,
fe2d934b 105 bool);
d3585b76 106extern bool arm_tls_referenced_p (rtx);
d5b7b3ae 107
fdd695fd 108extern int arm_coproc_mem_operand (rtx, bool);
33255ae3 109extern int neon_vector_mem_operand (rtx, int, bool);
88f77cba 110extern int neon_struct_mem_operand (rtx);
e32bac5b 111
ee8045e5 112extern rtx *neon_vcmla_lane_prepare_operands (rtx *);
c2b7062d 113
d3585b76 114extern int tls_mentioned_p (rtx);
e32bac5b
RE
115extern int symbol_mentioned_p (rtx);
116extern int label_mentioned_p (rtx);
117extern RTX_CODE minmax_code (rtx);
5d216c70 118extern bool arm_sat_operator_match (rtx, rtx, int *, bool *);
e32bac5b 119extern int adjacent_mem_locations (rtx, rtx);
37119410
BS
120extern bool gen_ldm_seq (rtx *, int, bool);
121extern bool gen_stm_seq (rtx *, int);
122extern bool gen_const_stm_seq (rtx *, int);
123extern rtx arm_gen_load_multiple (int *, int, rtx, int, rtx, HOST_WIDE_INT *);
124extern rtx arm_gen_store_multiple (int *, int, rtx, int, rtx, HOST_WIDE_INT *);
56289ed2
SD
125extern bool offset_ok_for_ldrd_strd (HOST_WIDE_INT);
126extern bool operands_ok_ldrd_strd (rtx, rtx, rtx, HOST_WIDE_INT, bool, bool);
4542a38a 127extern bool gen_operands_ldrd_strd (rtx *, bool, bool, bool);
70128ad9 128extern int arm_gen_movmemqi (rtx *);
798d3d04 129extern bool gen_movmem_ldrd_strd (rtx *);
ef4bddc2
RS
130extern machine_mode arm_select_cc_mode (RTX_CODE, rtx, rtx);
131extern machine_mode arm_select_dominance_cc_mode (rtx, rtx,
e32bac5b 132 HOST_WIDE_INT);
18f0fe6b 133extern rtx arm_gen_compare_reg (RTX_CODE, rtx, rtx, rtx);
e32bac5b
RE
134extern rtx arm_gen_return_addr_mask (void);
135extern void arm_reload_in_hi (rtx *);
136extern void arm_reload_out_hi (rtx *);
02231c13 137extern int arm_max_const_double_inline_cost (void);
2075b05d 138extern int arm_const_double_inline_cost (rtx);
b4a58f80 139extern bool arm_const_double_by_parts (rtx);
73160ba9 140extern bool arm_const_double_by_immediates (rtx);
7a32d6c4 141extern void arm_emit_call_insn (rtx, rtx, bool);
c92e08e3 142bool detect_cmse_nonsecure_call (tree);
e32bac5b 143extern const char *output_call (rtx *);
571191af 144void arm_emit_movpair (rtx, rtx);
e32bac5b 145extern const char *output_mov_long_double_arm_from_arm (rtx *);
3598da80 146extern const char *output_move_double (rtx *, bool, int *count);
88f77cba 147extern const char *output_move_quad (rtx *);
3598da80 148extern int arm_count_output_move_double_insns (rtx *);
5b3e6663 149extern const char *output_move_vfp (rtx *operands);
88f77cba 150extern const char *output_move_neon (rtx *operands);
647d790d
DM
151extern int arm_attr_length_move_neon (rtx_insn *);
152extern int arm_address_offset_is_imm (rtx_insn *);
e32bac5b
RE
153extern const char *output_add_immediate (rtx *);
154extern const char *arithmetic_instr (rtx, int);
155extern void output_ascii_pseudo_op (FILE *, const unsigned char *, int);
f79b86a4 156extern const char *output_return_instruction (rtx, bool, bool, bool);
4fb94ef9 157extern const char *output_probe_stack_range (rtx, rtx);
e32bac5b 158extern void arm_poke_function_name (FILE *, const char *);
81e3f921 159extern void arm_final_prescan_insn (rtx_insn *);
e32bac5b 160extern int arm_debugger_arg_offset (int, rtx);
25a65198 161extern bool arm_is_long_call_p (tree);
5a9335ef 162extern int arm_emit_vector_const (FILE *, rtx);
0fd8c3ad 163extern void arm_emit_fp16_const (rtx c);
5a9335ef 164extern const char * arm_output_load_gr (rtx *);
b27832ed 165extern const char *vfp_output_vstmd (rtx *);
3aee1982 166extern void arm_output_multireg_pop (rtx *, bool, rtx, bool, bool);
c9ca9b88 167extern void arm_set_return_address (rtx, rtx);
6555b6bd 168extern int arm_eliminable_register (rtx);
5b3e6663 169extern const char *arm_output_shift(rtx *, int);
8fd03515
XQ
170extern const char *arm_output_iwmmxt_shift_immediate (const char *, rtx *, bool);
171extern const char *arm_output_iwmmxt_tinsr (rtx *);
029e79eb 172extern unsigned int arm_sync_loop_insns (rtx , rtx *);
0c27e2d8 173extern int arm_attr_length_push_multi(rtx, rtx);
5775d58c 174extern int arm_attr_length_pop_multi(rtx *, bool, bool);
18f0fe6b
RH
175extern void arm_expand_compare_and_swap (rtx op[]);
176extern void arm_split_compare_and_swap (rtx op[]);
177extern void arm_split_atomic_op (enum rtx_code, rtx, rtx, rtx, rtx, rtx, rtx);
f959607b 178extern rtx arm_load_tp (rtx);
d57daa0c 179extern bool arm_coproc_builtin_available (enum unspecv);
3811581f 180extern bool arm_coproc_ldc_stc_legitimate_address (rtx);
d5b7b3ae
RE
181
182#if defined TREE_CODE
e32bac5b 183extern void arm_init_cumulative_args (CUMULATIVE_ARGS *, tree, rtx, tree);
ef4bddc2 184extern bool arm_pad_reg_upward (machine_mode, tree, int);
d5b7b3ae 185#endif
9f7bf991 186extern int arm_apply_result_size (void);
d5b7b3ae 187
eb3921e8
NC
188#endif /* RTX_CODE */
189
d5b7b3ae 190/* Thumb functions. */
e32bac5b 191extern void arm_init_expanders (void);
90911ab6 192extern const char *thumb1_unexpanded_epilogue (void);
5b3e6663
PB
193extern void thumb1_expand_prologue (void);
194extern void thumb1_expand_epilogue (void);
d018b46e 195extern const char *thumb1_output_interwork (void);
e32bac5b 196extern int thumb_shiftable_const (unsigned HOST_WIDE_INT);
cd2b33d0 197#ifdef RTX_CODE
723d95fe 198extern enum arm_cond_code maybe_get_arm_condition_code (rtx);
81e3f921
DM
199extern void thumb1_final_prescan_insn (rtx_insn *);
200extern void thumb2_final_prescan_insn (rtx_insn *);
e32bac5b
RE
201extern const char *thumb_load_double_from_address (rtx *);
202extern const char *thumb_output_move_mem_multiple (int, rtx *);
b12a00f1 203extern const char *thumb_call_via_reg (rtx);
70128ad9 204extern void thumb_expand_movmemqi (rtx *);
e32bac5b
RE
205extern rtx arm_return_addr (int, rtx);
206extern void thumb_reload_out_hi (rtx *);
c9ca9b88 207extern void thumb_set_return_address (rtx, rtx);
907dd0c7
RE
208extern const char *thumb1_output_casesi (rtx *);
209extern const char *thumb2_output_casesi (rtx *);
d5b7b3ae
RE
210#endif
211
212/* Defined in pe.c. */
e32bac5b
RE
213extern int arm_dllexport_name_p (const char *);
214extern int arm_dllimport_name_p (const char *);
d5b7b3ae
RE
215
216#ifdef TREE_CODE
e32bac5b
RE
217extern void arm_pe_unique_section (tree, int);
218extern void arm_pe_encode_section_info (tree, rtx, int);
219extern int arm_dllexport_p (tree);
220extern int arm_dllimport_p (tree);
221extern void arm_mark_dllexport (tree);
222extern void arm_mark_dllimport (tree);
d5524d52 223extern bool arm_change_mode_p (tree);
d5b7b3ae 224#endif
8b97c5f8 225
c84f825c
CB
226extern tree arm_valid_target_attribute_tree (tree, struct gcc_options *,
227 struct gcc_options *);
851966d6 228extern void arm_configure_build_target (struct arm_build_target *,
a53613c4 229 struct cl_target_option *,
851966d6 230 struct gcc_options *, bool);
008a11cc
TC
231extern void arm_option_reconfigure_globals (void);
232extern void arm_options_perform_arch_sanity_checks (void);
e32bac5b
RE
233extern void arm_pr_long_calls (struct cpp_reader *);
234extern void arm_pr_no_long_calls (struct cpp_reader *);
235extern void arm_pr_long_calls_off (struct cpp_reader *);
8b97c5f8 236
3101faab 237extern const char *arm_mangle_type (const_tree);
6276b630 238extern const char *arm_mangle_builtin_type (const_tree);
608063c3 239
795dc4fc
PB
240extern void arm_order_regs_for_local_alloc (void);
241
b24a2ce5
GY
242extern int arm_max_conditional_execute ();
243
2597da22
CL
244/* Vectorizer cost model implementation. */
245struct cpu_vec_costs {
246 const int scalar_stmt_cost; /* Cost of any scalar operation, excluding
247 load and store. */
248 const int scalar_load_cost; /* Cost of scalar load. */
249 const int scalar_store_cost; /* Cost of scalar store. */
250 const int vec_stmt_cost; /* Cost of any vector operation, excluding
251 load, store, vector-to-scalar and
252 scalar-to-vector operation. */
253 const int vec_to_scalar_cost; /* Cost of vect-to-scalar operation. */
254 const int scalar_to_vec_cost; /* Cost of scalar-to-vector operation. */
255 const int vec_align_load_cost; /* Cost of aligned vector load. */
256 const int vec_unalign_load_cost; /* Cost of unaligned vector load. */
257 const int vec_unalign_store_cost; /* Cost of unaligned vector load. */
258 const int vec_store_cost; /* Cost of vector store. */
259 const int cond_taken_branch_cost; /* Cost of taken branch for vectorizer
260 cost model. */
261 const int cond_not_taken_branch_cost;/* Cost of not taken branch for
262 vectorizer cost model. */
263};
264
1b78f575
RE
265#ifdef RTX_CODE
266/* This needs to be here because we need RTX_CODE and similar. */
267
5bea0c6c
KT
268struct cpu_cost_table;
269
612ea540
CB
270/* Addressing mode operations. Used to index tables in struct
271 addr_mode_cost_table. */
272enum arm_addr_mode_op
273{
274 AMO_DEFAULT,
275 AMO_NO_WB, /* Offset with no writeback. */
276 AMO_WB, /* Offset with writeback. */
277 AMO_MAX /* For array size. */
278};
279
280/* Table of additional costs in units of COSTS_N_INSNS() when using
281 addressing modes for each access type. */
282struct addr_mode_cost_table
283{
284 const int integer[AMO_MAX];
285 const int fp[AMO_MAX];
286 const int vector[AMO_MAX];
287};
288
2301ca74
BC
289/* Dump function ARM_PRINT_TUNE_INFO should be updated whenever this
290 structure is modified. */
291
1b78f575
RE
292struct tune_params
293{
5bea0c6c 294 const struct cpu_cost_table *insn_extra_cost;
612ea540 295 const struct addr_mode_cost_table *addr_mode_costs;
b505225b 296 bool (*sched_adjust_cost) (rtx_insn *, int, rtx_insn *, int *);
52c266ba
RE
297 int (*branch_cost) (bool, bool);
298 /* Vectorizer costs. */
299 const struct cpu_vec_costs* vec_costs;
1b78f575 300 int constant_limit;
b24a2ce5 301 /* Maximum number of instructions to conditionalise. */
16868d84 302 int max_insns_skipped;
52c266ba
RE
303 /* Maximum number of instructions to inline calls to memset. */
304 int max_insns_inline_memset;
305 /* Issue rate of the processor. */
306 unsigned int issue_rate;
307 /* Explicit prefetch data. */
308 struct
309 {
310 int num_slots;
311 int l1_cache_size;
312 int l1_cache_line_size;
313 } prefetch;
314 enum {PREF_CONST_POOL_FALSE, PREF_CONST_POOL_TRUE}
315 prefer_constant_pool: 1;
ab3dfff7 316 /* Prefer STRD/LDRD instructions over PUSH/POP/LDM/STM. */
52c266ba 317 enum {PREF_LDRD_FALSE, PREF_LDRD_TRUE} prefer_ldrd_strd: 1;
a51fb17f
BC
318 /* The preference for non short cirtcuit operation when optimizing for
319 performance. The first element covers Thumb state and the second one
320 is for ARM state. */
ffa7068e
JG
321 enum log_op_non_short_circuit {LOG_OP_NON_SHORT_CIRCUIT_FALSE,
322 LOG_OP_NON_SHORT_CIRCUIT_TRUE};
323 log_op_non_short_circuit logical_op_non_short_circuit_thumb: 1;
324 log_op_non_short_circuit logical_op_non_short_circuit_arm: 1;
46fbb3eb 325 /* Prefer 32-bit encoding instead of flag-setting 16-bit encoding. */
52c266ba
RE
326 enum {DISPARAGE_FLAGS_NEITHER, DISPARAGE_FLAGS_PARTIAL, DISPARAGE_FLAGS_ALL}
327 disparage_flag_setting_t16_encodings: 2;
328 enum {PREF_NEON_64_FALSE, PREF_NEON_64_TRUE} prefer_neon_for_64bits: 1;
ad421159 329 /* Prefer to inline string operations like memset by using Neon. */
52c266ba
RE
330 enum {PREF_NEON_STRINGOPS_FALSE, PREF_NEON_STRINGOPS_TRUE}
331 string_ops_prefer_neon: 1;
fe0b29c7 332 /* Bitfield encoding the fusible pairs of instructions. Use FUSE_OPS
52c266ba
RE
333 in an initializer if multiple fusion operations are supported on a
334 target. */
335 enum fuse_ops
336 {
337 FUSE_NOTHING = 0,
066c14c9
WD
338 FUSE_MOVW_MOVT = 1 << 0,
339 FUSE_AES_AESMC = 1 << 1
340 } fusible_ops: 2;
340c7904 341 /* Depth of scheduling queue to check for L2 autoprefetcher. */
52c266ba
RE
342 enum {SCHED_AUTOPREF_OFF, SCHED_AUTOPREF_RANK, SCHED_AUTOPREF_FULL}
343 sched_autopref: 2;
1b78f575
RE
344};
345
52c266ba
RE
346/* Smash multiple fusion operations into a type that can be used for an
347 initializer. */
348#define FUSE_OPS(x) ((tune_params::fuse_ops) (x))
349
1b78f575 350extern const struct tune_params *current_tune;
7f3d8f56 351extern int vfp3_const_double_for_fract_bits (rtx);
c75d51aa
RL
352/* return power of two from operand, otherwise 0. */
353extern int vfp3_const_double_for_bits (rtx);
99aea943
AS
354
355extern void arm_emit_coreregs_64bit_shift (enum rtx_code, rtx, rtx, rtx, rtx,
356 rtx);
39fa4aec 357extern bool arm_fusion_enabled_p (tune_params::fuse_ops);
6ce43645 358extern bool arm_valid_symbolic_address_p (rtx);
95ffee1f 359extern bool arm_validize_comparison (rtx *, rtx *, rtx *);
1b78f575
RE
360#endif /* RTX_CODE */
361
ad421159 362extern bool arm_gen_setmem (rtx *);
b440f324 363extern void arm_expand_vec_perm (rtx target, rtx op0, rtx op1, rtx sel);
b440f324 364
ef4bddc2 365extern bool arm_autoinc_modes_ok_p (machine_mode, enum arm_auto_incmodes);
8875e939 366
34dd397b
SB
367extern void arm_emit_eabi_attribute (const char *, int, int);
368
d5524d52 369extern void arm_reset_previous_fndecl (void);
eeb085f3 370extern void save_restore_target_globals (tree);
d5524d52 371
b848e289
JG
372/* Defined in gcc/common/config/arm-common.c. */
373extern const char *arm_rewrite_selected_cpu (const char *name);
374
7049e4eb
CB
375/* Defined in gcc/common/config/arm-c.c. */
376extern void arm_lang_object_attributes_init (void);
c84f825c 377extern void arm_register_target_pragmas (void);
7049e4eb
CB
378extern void arm_cpu_cpp_builtins (struct cpp_reader *);
379
b4c522fa
IB
380/* Defined in arm-d.c */
381extern void arm_d_target_versions (void);
382
aed773a2
CB
383extern bool arm_is_constant_pool_ref (rtx);
384
a27d8d80
JG
385/* The bits in this mask specify which instruction scheduling options should
386 be used. */
643a5717 387extern unsigned int tune_flags;
a27d8d80 388
a27d8d80
JG
389/* Nonzero if this chip supports the ARM Architecture 4 extensions. */
390extern int arm_arch4;
391
392/* Nonzero if this chip supports the ARM Architecture 4t extensions. */
393extern int arm_arch4t;
394
c3f808d3
KT
395/* Nonzero if this chip supports the ARM Architecture 5t extensions. */
396extern int arm_arch5t;
a27d8d80 397
c3f808d3
KT
398/* Nonzero if this chip supports the ARM Architecture 5te extensions. */
399extern int arm_arch5te;
a27d8d80
JG
400
401/* Nonzero if this chip supports the ARM Architecture 6 extensions. */
402extern int arm_arch6;
403
404/* Nonzero if this chip supports the ARM 6K extensions. */
405extern int arm_arch6k;
406
39c12541
MW
407/* Nonzero if this chip supports the ARM 6KZ extensions. */
408extern int arm_arch6kz;
409
a27d8d80
JG
410/* Nonzero if instructions present in ARMv6-M can be used. */
411extern int arm_arch6m;
412
413/* Nonzero if this chip supports the ARM 7 extensions. */
414extern int arm_arch7;
415
bf634d1c
TP
416/* Nonzero if this chip supports the Large Physical Address Extension. */
417extern int arm_arch_lpae;
6c466c7c 418
a27d8d80
JG
419/* Nonzero if instructions not present in the 'M' profile can be used. */
420extern int arm_arch_notm;
421
422/* Nonzero if instructions present in ARMv7E-M can be used. */
423extern int arm_arch7em;
424
425/* Nonzero if instructions present in ARMv8 can be used. */
426extern int arm_arch8;
427
428/* Nonzero if this chip can benefit from load scheduling. */
429extern int arm_ld_sched;
430
431/* Nonzero if this chip is a StrongARM. */
432extern int arm_tune_strongarm;
433
434/* Nonzero if this chip supports Intel Wireless MMX technology. */
435extern int arm_arch_iwmmxt;
436
437/* Nonzero if this chip supports Intel Wireless MMX2 technology. */
438extern int arm_arch_iwmmxt2;
439
440/* Nonzero if this chip is an XScale. */
441extern int arm_arch_xscale;
442
443/* Nonzero if tuning for XScale */
444extern int arm_tune_xscale;
445
446/* Nonzero if we want to tune for stores that access the write-buffer.
447 This typically means an ARM6 or ARM7 with MMU or MPU. */
448extern int arm_tune_wbuf;
449
450/* Nonzero if tuning for Cortex-A9. */
451extern int arm_tune_cortex_a9;
452
a27d8d80
JG
453/* Nonzero if we should define __THUMB_INTERWORK__ in the
454 preprocessor.
455 XXX This is a bit of a hack, it's intended to help work around
456 problems in GLD which doesn't understand that armv5t code is
457 interworking clean. */
458extern int arm_cpp_interwork;
459
52545641
TP
460/* Nonzero if chip supports Thumb 1. */
461extern int arm_arch_thumb1;
462
a27d8d80
JG
463/* Nonzero if chip supports Thumb 2. */
464extern int arm_arch_thumb2;
465
466/* Nonzero if chip supports integer division instruction. */
467extern int arm_arch_arm_hwdiv;
468extern int arm_arch_thumb_hwdiv;
469
afe006ad
TG
470/* Nonzero if chip disallows volatile memory access in IT block. */
471extern int arm_arch_no_volatile_ce;
472
a27d8d80
JG
473/* Nonzero if we should use Neon to handle 64-bits operations rather
474 than core registers. */
475extern int prefer_neon_for_64bits;
476
8341f8c4
RE
477/* Structure defining the current overall architectural target and tuning. */
478struct arm_build_target
479{
480 /* Name of the target CPU, if known, or NULL if the target CPU was not
481 specified by the user (and inferred from the -march option). */
482 const char *core_name;
483 /* Name of the target ARCH. NULL if there is a selected CPU. */
484 const char *arch_name;
485 /* Preprocessor substring (never NULL). */
486 const char *arch_pp_name;
8341f8c4
RE
487 /* The base architecture value. */
488 enum base_architecture base_arch;
8afb5358
RE
489 /* The profile letter for the architecture, upper case by convention. */
490 char profile;
8341f8c4
RE
491 /* Bitmap encapsulating the isa_bits for the target environment. */
492 sbitmap isa;
493 /* Flags used for tuning. Long term, these move into tune_params. */
494 unsigned int tune_flags;
495 /* Tables with more detailed tuning information. */
496 const struct tune_params *tune;
497 /* CPU identifier for the tuning target. */
498 enum processor_type tune_core;
499};
500
501extern struct arm_build_target arm_active_target;
a27d8d80 502
d4f680c6
RE
503/* Table entry for a CPU alias. */
504struct cpu_alias
505{
506 /* The alias name. */
507 const char *const name;
508 /* True if the name should be displayed in help text listing cpu names. */
509 bool visible;
510};
511
512/* Table entry for an architectural feature extension. */
050809ed
RE
513struct cpu_arch_extension
514{
357e1023 515 /* Feature name. */
050809ed 516 const char *const name;
357e1023 517 /* True if the option is negative (removes extensions). */
050809ed 518 bool remove;
357e1023
RE
519 /* True if the option is an alias for another option with identical effect;
520 the option will be ignored for canonicalization. */
521 bool alias;
522 /* The modifier bits. */
050809ed
RE
523 const enum isa_feature isa_bits[isa_num_bits];
524};
525
d4f680c6 526/* Common elements of both CPU and architectural options. */
050809ed
RE
527struct cpu_arch_option
528{
529 /* Name for this option. */
530 const char *name;
531 /* List of feature extensions permitted. */
532 const struct cpu_arch_extension *extensions;
533 /* Standard feature bits. */
534 enum isa_feature isa_bits[isa_num_bits];
535};
536
d4f680c6 537/* Table entry for an architecture entry. */
050809ed
RE
538struct arch_option
539{
540 /* Common option fields. */
541 cpu_arch_option common;
542 /* Short string for this architecture. */
543 const char *arch;
544 /* Base architecture, from which this specific architecture is derived. */
545 enum base_architecture base_arch;
8afb5358
RE
546 /* The profile letter for the architecture, upper case by convention. */
547 const char profile;
050809ed
RE
548 /* Default tune target (in the absence of any more specific data). */
549 enum processor_type tune_id;
550};
551
d4f680c6 552/* Table entry for a CPU entry. */
050809ed
RE
553struct cpu_option
554{
555 /* Common option fields. */
556 cpu_arch_option common;
d4f680c6
RE
557 /* List of aliases for this CPU. */
558 const struct cpu_alias *aliases;
050809ed
RE
559 /* Architecture upon which this CPU is based. */
560 enum arch_type arch;
561};
a27d8d80 562
435d1272
RE
563extern const arch_option all_architectures[];
564extern const cpu_option all_cores[];
565
566const cpu_option *arm_parse_cpu_option_name (const cpu_option *, const char *,
a4017ff7 567 const char *, bool = true);
435d1272 568const arch_option *arm_parse_arch_option_name (const arch_option *,
a4017ff7 569 const char *, const char *, bool = true);
435d1272
RE
570void arm_parse_option_features (sbitmap, const cpu_arch_option *,
571 const char *);
572
573void arm_initialize_isa (sbitmap, const enum isa_feature *);
574
88657302 575#endif /* ! GCC_ARM_PROTOS_H */