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