[NDS32] Add relax optimization as new pass.
[official-gcc.git] / gcc / config / nds32 / nds32-protos.h
blob1387cca62ea643e4e242c6152c28dd13a226ad8e
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_return_addr_rtx (int, rtx);
45 /* -- Eliminating Frame Pointer and Arg Pointer. */
47 extern HOST_WIDE_INT nds32_initial_elimination_offset (unsigned int,
48 unsigned int);
50 /* -- Passing Arguments in Registers. */
52 extern void nds32_init_cumulative_args (CUMULATIVE_ARGS *,
53 tree, rtx, tree, int);
55 /* -- Function Entry and Exit. */
57 extern void nds32_expand_prologue (void);
58 extern void nds32_expand_epilogue (bool);
59 extern void nds32_expand_prologue_v3push (void);
60 extern void nds32_expand_epilogue_v3pop (bool);
62 /* ------------------------------------------------------------------------ */
64 /* Auxiliary functions for auxiliary macros in nds32.h. */
66 extern bool nds32_ls_333_p (rtx, rtx, rtx, machine_mode);
68 /* Auxiliary functions for lwm/smw. */
70 extern bool nds32_valid_smw_lwm_base_p (rtx);
72 /* Auxiliary functions for expanding rtl used in nds32-multiple.md. */
74 extern rtx nds32_expand_load_multiple (int, int, rtx, rtx, bool, rtx *);
75 extern rtx nds32_expand_store_multiple (int, int, rtx, rtx, bool, rtx *);
76 extern bool nds32_expand_movmemsi (rtx, rtx, rtx, rtx);
77 extern bool nds32_expand_setmem (rtx, rtx, rtx, rtx, rtx, rtx);
78 extern bool nds32_expand_strlen (rtx, rtx, rtx, rtx);
80 /* Auxiliary functions for expand unalign load instruction. */
82 extern void nds32_expand_unaligned_load (rtx *, enum machine_mode);
84 /* Auxiliary functions for expand unalign store instruction. */
86 extern void nds32_expand_unaligned_store (rtx *, enum machine_mode);
88 /* Auxiliary functions for multiple load/store predicate checking. */
90 extern bool nds32_valid_multiple_load_store_p (rtx, bool, bool);
92 /* Auxiliary functions for stack operation predicate checking. */
94 extern bool nds32_valid_stack_push_pop_p (rtx, bool);
96 /* Auxiliary functions for bit operation detection. */
98 extern int nds32_can_use_bclr_p (int);
99 extern int nds32_can_use_bset_p (int);
100 extern int nds32_can_use_btgl_p (int);
102 extern int nds32_can_use_bitci_p (int);
104 /* Auxiliary function for 'Computing the Length of an Insn'. */
106 extern int nds32_adjust_insn_length (rtx_insn *, int);
108 /* Auxiliary functions for FP_AS_GP detection. */
110 extern int nds32_fp_as_gp_check_available (void);
112 extern bool nds32_symbol_load_store_p (rtx_insn *);
114 /* Auxiliary functions for jump table generation. */
116 extern const char *nds32_output_casesi_pc_relative (rtx *);
117 extern const char *nds32_output_casesi (rtx *);
119 /* Auxiliary functions to identify 16 bit addresing mode. */
121 extern enum nds32_16bit_address_type nds32_mem_format (rtx);
123 /* Auxiliary functions to output assembly code. */
125 extern const char *nds32_output_16bit_store (rtx *, int);
126 extern const char *nds32_output_16bit_load (rtx *, int);
127 extern const char *nds32_output_32bit_store (rtx *, int);
128 extern const char *nds32_output_32bit_load (rtx *, int);
129 extern const char *nds32_output_32bit_load_s (rtx *, int);
130 extern const char *nds32_output_smw_single_word (rtx *);
131 extern const char *nds32_output_lmw_single_word (rtx *);
133 /* Auxiliary functions to output stack push/pop instruction. */
135 extern const char *nds32_output_stack_push (rtx);
136 extern const char *nds32_output_stack_pop (rtx);
138 /* Auxiliary functions to check using return with null epilogue. */
140 extern int nds32_can_use_return_insn (void);
142 /* Auxiliary functions to decide output alignment or not. */
144 extern int nds32_target_alignment (rtx_insn *);
146 /* Auxiliary functions to expand builtin functions. */
148 extern void nds32_init_builtins_impl (void);
149 extern rtx nds32_expand_builtin_impl (tree, rtx, rtx,
150 machine_mode, int);
151 extern tree nds32_builtin_decl_impl (unsigned, bool);
153 /* Auxiliary functions for ISR implementation. */
155 extern void nds32_check_isr_attrs_conflict (tree, tree);
156 extern void nds32_construct_isr_vectors_information (tree, const char *);
157 extern void nds32_asm_file_start_for_isr (void);
158 extern void nds32_asm_file_end_for_isr (void);
159 extern bool nds32_isr_function_p (tree);
161 /* Auxiliary functions for cost calculation. */
163 extern bool nds32_rtx_costs_impl (rtx, machine_mode, int, int, int *, bool);
164 extern int nds32_address_cost_impl (rtx, machine_mode, addr_space_t, bool);
166 /* Auxiliary functions for pre-define marco. */
167 extern void nds32_cpu_cpp_builtins(struct cpp_reader *);
169 /* Functions for create nds32 specific optimization pass. */
170 extern rtl_opt_pass *make_pass_nds32_relax_opt (gcc::context *);
172 /* ------------------------------------------------------------------------ */