[NDS32] Support dwarf exception handling.
[official-gcc.git] / gcc / config / nds32 / nds32-protos.h
blob2f077005b067827edb9c673e03cbbe542eea50cc
1 /* Prototypes for exported functions of Andes NDS32 cpu for GNU compiler
2 Copyright (C) 2012-2018 Free Software Foundation, Inc.
3 Contributed by Andes Technology Corporation.
5 This file is part of GCC.
7 GCC is free software; you can redistribute it and/or modify it
8 under the terms of the GNU General Public License as published
9 by the Free Software Foundation; either version 3, or (at your
10 option) any later version.
12 GCC is distributed in the hope that it will be useful, but WITHOUT
13 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
14 or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
15 License for more details.
17 You should have received a copy of the GNU General Public License
18 along with GCC; see the file COPYING3. If not see
19 <http://www.gnu.org/licenses/>. */
22 /* ------------------------------------------------------------------------ */
24 /* Defining Data Structures for Per-function Information. */
26 extern void nds32_init_expanders (void);
29 /* Register Usage. */
31 /* -- Order of Allocation of Registers. */
32 extern void nds32_adjust_reg_alloc_order (void);
34 /* Register Classes. */
36 extern enum reg_class nds32_regno_reg_class (int);
39 /* Stack Layout and Calling Conventions. */
41 /* -- Basic Stack Layout. */
43 extern rtx nds32_dynamic_chain_address (rtx);
44 extern rtx nds32_return_addr_rtx (int, rtx);
46 /* -- Eliminating Frame Pointer and Arg Pointer. */
48 extern HOST_WIDE_INT nds32_initial_elimination_offset (unsigned int,
49 unsigned int);
51 /* -- Passing Arguments in Registers. */
53 extern void nds32_init_cumulative_args (CUMULATIVE_ARGS *,
54 tree, rtx, tree, int);
56 /* -- Function Entry and Exit. */
58 extern void nds32_expand_prologue (void);
59 extern void nds32_expand_epilogue (bool);
60 extern void nds32_expand_prologue_v3push (void);
61 extern void nds32_expand_epilogue_v3pop (bool);
62 extern void nds32_emit_push_fpr_callee_saved (int);
63 extern void nds32_emit_pop_fpr_callee_saved (int);
64 extern void nds32_emit_v3pop_fpr_callee_saved (int);
66 /* Controlling Debugging Information Format. */
68 extern unsigned int nds32_dbx_register_number (unsigned int);
70 /* ------------------------------------------------------------------------ */
72 /* Auxiliary functions for auxiliary macros in nds32.h. */
74 extern bool nds32_ls_333_p (rtx, rtx, rtx, machine_mode);
76 /* Auxiliary functions for lwm/smw. */
78 extern bool nds32_valid_smw_lwm_base_p (rtx);
80 /* Auxiliary functions for expanding rtl used in nds32-multiple.md. */
82 extern rtx nds32_expand_load_multiple (int, int, rtx, rtx, bool, rtx *);
83 extern rtx nds32_expand_store_multiple (int, int, rtx, rtx, bool, rtx *);
84 extern bool nds32_expand_movmemsi (rtx, rtx, rtx, rtx);
85 extern bool nds32_expand_setmem (rtx, rtx, rtx, rtx, rtx, rtx);
86 extern bool nds32_expand_strlen (rtx, rtx, rtx, rtx);
88 /* Auxiliary functions for expand unalign load instruction. */
90 extern void nds32_expand_unaligned_load (rtx *, enum machine_mode);
92 /* Auxiliary functions for expand unalign store instruction. */
94 extern void nds32_expand_unaligned_store (rtx *, enum machine_mode);
96 /* Auxiliary functions for multiple load/store predicate checking. */
98 extern bool nds32_valid_multiple_load_store_p (rtx, bool, bool);
100 /* Auxiliary functions for stack operation predicate checking. */
102 extern bool nds32_valid_stack_push_pop_p (rtx, bool);
104 /* Auxiliary functions for bit operation detection. */
106 extern int nds32_can_use_bclr_p (int);
107 extern int nds32_can_use_bset_p (int);
108 extern int nds32_can_use_btgl_p (int);
110 extern int nds32_can_use_bitci_p (int);
112 extern bool nds32_const_double_range_ok_p (rtx, machine_mode,
113 HOST_WIDE_INT, HOST_WIDE_INT);
115 /* Auxiliary function for 'Computing the Length of an Insn'. */
117 extern int nds32_adjust_insn_length (rtx_insn *, int);
119 /* Auxiliary functions for FP_AS_GP detection. */
121 extern int nds32_fp_as_gp_check_available (void);
123 extern bool nds32_symbol_load_store_p (rtx_insn *);
125 /* Auxiliary functions for jump table generation. */
127 extern const char *nds32_output_casesi_pc_relative (rtx *);
128 extern const char *nds32_output_casesi (rtx *);
130 /* Auxiliary functions for conditional branch generation. */
132 extern enum nds32_expand_result_type nds32_expand_cbranch (rtx *);
133 extern enum nds32_expand_result_type nds32_expand_cstore (rtx *);
134 extern void nds32_expand_float_cbranch (rtx *);
135 extern void nds32_expand_float_cstore (rtx *);
137 /* Auxiliary functions for conditional move generation. */
139 extern enum nds32_expand_result_type nds32_expand_movcc (rtx *);
140 extern void nds32_expand_float_movcc (rtx *);
143 /* Auxiliary functions to identify long-call symbol. */
144 extern bool nds32_long_call_p (rtx);
146 /* Auxiliary functions to identify conditional move comparison operand. */
148 extern int nds32_cond_move_p (rtx);
150 /* Auxiliary functions to identify 16 bit addresing mode. */
152 extern enum nds32_16bit_address_type nds32_mem_format (rtx);
154 /* Auxiliary functions to identify floating-point addresing mode. */
156 extern bool nds32_float_mem_operand_p (rtx);
158 /* Auxiliary functions to output assembly code. */
160 extern const char *nds32_output_16bit_store (rtx *, int);
161 extern const char *nds32_output_16bit_load (rtx *, int);
162 extern const char *nds32_output_32bit_store (rtx *, int);
163 extern const char *nds32_output_32bit_load (rtx *, int);
164 extern const char *nds32_output_32bit_load_s (rtx *, int);
165 extern const char *nds32_output_float_load(rtx *);
166 extern const char *nds32_output_float_store(rtx *);
167 extern const char *nds32_output_smw_single_word (rtx *);
168 extern const char *nds32_output_lmw_single_word (rtx *);
169 extern const char *nds32_output_double (rtx *, bool);
170 extern const char *nds32_output_cbranchsi4_equality_zero (rtx_insn *, rtx *);
171 extern const char *nds32_output_cbranchsi4_equality_reg (rtx_insn *, rtx *);
172 extern const char *nds32_output_cbranchsi4_equality_reg_or_const_int (rtx_insn *,
173 rtx *);
174 extern const char *nds32_output_cbranchsi4_greater_less_zero (rtx_insn *, rtx *);
176 extern const char *nds32_output_call (rtx, rtx *, rtx,
177 const char *, const char *, bool);
180 /* Auxiliary functions to output stack push/pop instruction. */
182 extern const char *nds32_output_stack_push (rtx);
183 extern const char *nds32_output_stack_pop (rtx);
184 extern const char *nds32_output_return (void);
186 /* Auxiliary functions to split double word RTX pattern. */
188 extern void nds32_spilt_doubleword (rtx *, bool);
190 /* Auxiliary functions to split large constant RTX pattern. */
192 extern void nds32_expand_constant (machine_mode,
193 HOST_WIDE_INT, rtx, rtx);
195 /* Auxiliary functions to check using return with null epilogue. */
197 extern int nds32_can_use_return_insn (void);
199 /* Auxiliary functions to decide output alignment or not. */
201 extern int nds32_target_alignment (rtx_insn *);
203 /* Auxiliary functions to expand builtin functions. */
205 extern void nds32_init_builtins_impl (void);
206 extern rtx nds32_expand_builtin_impl (tree, rtx, rtx,
207 machine_mode, int);
208 extern tree nds32_builtin_decl_impl (unsigned, bool);
210 /* Auxiliary functions for ISR implementation. */
212 extern void nds32_check_isr_attrs_conflict (tree, tree);
213 extern void nds32_construct_isr_vectors_information (tree, const char *);
214 extern void nds32_asm_file_start_for_isr (void);
215 extern void nds32_asm_file_end_for_isr (void);
216 extern bool nds32_isr_function_p (tree);
218 /* Auxiliary functions for cost calculation. */
220 extern bool nds32_rtx_costs_impl (rtx, machine_mode, int, int, int *, bool);
221 extern int nds32_address_cost_impl (rtx, machine_mode, addr_space_t, bool);
223 /* Auxiliary functions for pre-define marco. */
224 extern void nds32_cpu_cpp_builtins(struct cpp_reader *);
226 extern bool nds32_split_double_word_load_store_p (rtx *,bool);
228 /* Functions for create nds32 specific optimization pass. */
229 extern rtl_opt_pass *make_pass_nds32_relax_opt (gcc::context *);
231 /* ------------------------------------------------------------------------ */