Mercurial > hg > CbC > CbC_gcc
comparison gcc/config/nds32/nds32-protos.h @ 131:84e7813d76e9
gcc-8.2
author | mir3636 |
---|---|
date | Thu, 25 Oct 2018 07:37:49 +0900 |
parents | 04ced10e8804 |
children | 1830386684a0 |
comparison
equal
deleted
inserted
replaced
111:04ced10e8804 | 131:84e7813d76e9 |
---|---|
1 /* Prototypes for exported functions of Andes NDS32 cpu for GNU compiler | 1 /* Prototypes for exported functions of Andes NDS32 cpu for GNU compiler |
2 Copyright (C) 2012-2017 Free Software Foundation, Inc. | 2 Copyright (C) 2012-2018 Free Software Foundation, Inc. |
3 Contributed by Andes Technology Corporation. | 3 Contributed by Andes Technology Corporation. |
4 | 4 |
5 This file is part of GCC. | 5 This file is part of GCC. |
6 | 6 |
7 GCC is free software; you can redistribute it and/or modify it | 7 GCC is free software; you can redistribute it and/or modify it |
24 /* Defining Data Structures for Per-function Information. */ | 24 /* Defining Data Structures for Per-function Information. */ |
25 | 25 |
26 extern void nds32_init_expanders (void); | 26 extern void nds32_init_expanders (void); |
27 | 27 |
28 | 28 |
29 /* Register Usage. */ | |
30 | |
31 /* -- Order of Allocation of Registers. */ | |
32 extern void nds32_adjust_reg_alloc_order (void); | |
33 | |
29 /* Register Classes. */ | 34 /* Register Classes. */ |
30 | 35 |
31 extern enum reg_class nds32_regno_reg_class (int); | 36 extern enum reg_class nds32_regno_reg_class (int); |
32 | 37 |
33 | 38 |
34 /* Stack Layout and Calling Conventions. */ | 39 /* Stack Layout and Calling Conventions. */ |
35 | 40 |
36 /* -- Basic Stack Layout. */ | 41 /* -- Basic Stack Layout. */ |
37 | 42 |
43 extern rtx nds32_dynamic_chain_address (rtx); | |
38 extern rtx nds32_return_addr_rtx (int, rtx); | 44 extern rtx nds32_return_addr_rtx (int, rtx); |
39 | 45 |
40 /* -- Eliminating Frame Pointer and Arg Pointer. */ | 46 /* -- Eliminating Frame Pointer and Arg Pointer. */ |
41 | 47 |
42 extern HOST_WIDE_INT nds32_initial_elimination_offset (unsigned int, | 48 extern HOST_WIDE_INT nds32_initial_elimination_offset (unsigned int, |
51 | 57 |
52 extern void nds32_expand_prologue (void); | 58 extern void nds32_expand_prologue (void); |
53 extern void nds32_expand_epilogue (bool); | 59 extern void nds32_expand_epilogue (bool); |
54 extern void nds32_expand_prologue_v3push (void); | 60 extern void nds32_expand_prologue_v3push (void); |
55 extern void nds32_expand_epilogue_v3pop (bool); | 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); | |
65 | |
66 /* Controlling Debugging Information Format. */ | |
67 | |
68 extern unsigned int nds32_dbx_register_number (unsigned int); | |
56 | 69 |
57 /* ------------------------------------------------------------------------ */ | 70 /* ------------------------------------------------------------------------ */ |
58 | 71 |
59 /* Auxiliary functions for auxiliary macros in nds32.h. */ | 72 /* Auxiliary functions for manipulation DI mode. */ |
60 | 73 |
61 extern bool nds32_ls_333_p (rtx, rtx, rtx, machine_mode); | 74 extern rtx nds32_di_high_part_subreg(rtx); |
75 extern rtx nds32_di_low_part_subreg(rtx); | |
62 | 76 |
63 /* Auxiliary functions for expanding rtl used in nds32-multiple.md. */ | 77 /* Auxiliary functions for expanding rtl used in nds32-multiple.md. */ |
64 | 78 |
65 extern rtx nds32_expand_load_multiple (int, int, rtx, rtx); | 79 extern rtx nds32_expand_load_multiple (int, int, rtx, rtx, bool, rtx *); |
66 extern rtx nds32_expand_store_multiple (int, int, rtx, rtx); | 80 extern rtx nds32_expand_store_multiple (int, int, rtx, rtx, bool, rtx *); |
67 extern int nds32_expand_movmemqi (rtx, rtx, rtx, rtx); | 81 extern bool nds32_expand_movmemsi (rtx, rtx, rtx, rtx); |
82 extern bool nds32_expand_setmem (rtx, rtx, rtx, rtx, rtx, rtx); | |
83 extern bool nds32_expand_strlen (rtx, rtx, rtx, rtx); | |
84 | |
85 /* Auxiliary functions for expand unalign load instruction. */ | |
86 | |
87 extern void nds32_expand_unaligned_load (rtx *, enum machine_mode); | |
88 | |
89 /* Auxiliary functions for expand unalign store instruction. */ | |
90 | |
91 extern void nds32_expand_unaligned_store (rtx *, enum machine_mode); | |
68 | 92 |
69 /* Auxiliary functions for multiple load/store predicate checking. */ | 93 /* Auxiliary functions for multiple load/store predicate checking. */ |
70 | 94 |
71 extern bool nds32_valid_multiple_load_store (rtx, bool); | 95 extern bool nds32_valid_multiple_load_store_p (rtx, bool, bool); |
96 | |
97 /* Auxiliary functions for guard function checking in pipelines.md. */ | |
98 | |
99 extern bool nds32_n7_load_to_ii_p (rtx_insn *, rtx_insn *); | |
100 extern bool nds32_n7_last_load_to_ii_p (rtx_insn *, rtx_insn *); | |
101 | |
102 extern bool nds32_n8_load_to_ii_p (rtx_insn *, rtx_insn *); | |
103 extern bool nds32_n8_load_bi_to_ii_p (rtx_insn *, rtx_insn *); | |
104 extern bool nds32_n8_load_to_ex_p (rtx_insn *, rtx_insn *); | |
105 extern bool nds32_n8_ex_to_ii_p (rtx_insn *, rtx_insn *); | |
106 extern bool nds32_n8_last_load_to_ii_p (rtx_insn *, rtx_insn *); | |
107 extern bool nds32_n8_last_load_two_to_ii_p (rtx_insn *, rtx_insn *); | |
108 extern bool nds32_n8_last_load_to_ex_p (rtx_insn *, rtx_insn *); | |
109 | |
110 extern bool nds32_e8_load_to_ii_p (rtx_insn *, rtx_insn *); | |
111 extern bool nds32_e8_load_to_ex_p (rtx_insn *, rtx_insn *); | |
112 extern bool nds32_e8_ex_to_ii_p (rtx_insn *, rtx_insn *); | |
113 extern bool nds32_e8_last_load_to_ii_p (rtx_insn *, rtx_insn *); | |
114 extern bool nds32_e8_last_load_to_ex_p (rtx_insn *, rtx_insn *); | |
115 | |
116 extern bool nds32_n9_2r1w_mm_to_ex_p (rtx_insn *, rtx_insn *); | |
117 extern bool nds32_n9_3r2w_mm_to_ex_p (rtx_insn *, rtx_insn *); | |
118 extern bool nds32_n9_last_load_to_ex_p (rtx_insn *, rtx_insn *); | |
119 | |
120 extern bool nds32_n10_ex_to_ex_p (rtx_insn *, rtx_insn *); | |
121 extern bool nds32_n10_mm_to_ex_p (rtx_insn *, rtx_insn *); | |
122 extern bool nds32_n10_last_load_to_ex_p (rtx_insn *, rtx_insn *); | |
123 | |
124 extern bool nds32_gw_ex_to_ex_p (rtx_insn *, rtx_insn *); | |
125 extern bool nds32_gw_mm_to_ex_p (rtx_insn *, rtx_insn *); | |
126 extern bool nds32_gw_last_load_to_ex_p (rtx_insn *, rtx_insn *); | |
127 | |
128 extern bool nds32_n13_e2_to_e1_p (rtx_insn *, rtx_insn *); | |
129 extern bool nds32_n13_load_to_e1_p (rtx_insn *, rtx_insn *); | |
130 extern bool nds32_n13_load_to_e2_p (rtx_insn *, rtx_insn *); | |
131 extern bool nds32_n13_last_load_to_e1_p (rtx_insn *, rtx_insn *); | |
132 extern bool nds32_n13_last_load_to_e2_p (rtx_insn *, rtx_insn *); | |
133 extern bool nds32_n13_last_two_load_to_e1_p (rtx_insn *, rtx_insn *); | |
72 | 134 |
73 /* Auxiliary functions for stack operation predicate checking. */ | 135 /* Auxiliary functions for stack operation predicate checking. */ |
74 | 136 |
75 extern bool nds32_valid_stack_push_pop_p (rtx, bool); | 137 extern bool nds32_valid_stack_push_pop_p (rtx, bool); |
76 | 138 |
77 /* Auxiliary functions for bit operation detection. */ | 139 /* Auxiliary functions for bit operation detection. */ |
78 | 140 |
79 extern int nds32_can_use_bclr_p (int); | 141 extern bool nds32_can_use_bclr_p (HOST_WIDE_INT); |
80 extern int nds32_can_use_bset_p (int); | 142 extern bool nds32_can_use_bset_p (HOST_WIDE_INT); |
81 extern int nds32_can_use_btgl_p (int); | 143 extern bool nds32_can_use_btgl_p (HOST_WIDE_INT); |
82 | 144 |
83 extern int nds32_can_use_bitci_p (int); | 145 extern bool nds32_can_use_bitci_p (HOST_WIDE_INT); |
146 | |
147 extern bool nds32_const_double_range_ok_p (rtx, machine_mode, | |
148 HOST_WIDE_INT, HOST_WIDE_INT); | |
149 | |
150 extern bool nds32_const_unspec_p (rtx x); | |
84 | 151 |
85 /* Auxiliary function for 'Computing the Length of an Insn'. */ | 152 /* Auxiliary function for 'Computing the Length of an Insn'. */ |
86 | 153 |
87 extern int nds32_adjust_insn_length (rtx_insn *, int); | 154 extern int nds32_adjust_insn_length (rtx_insn *, int); |
88 | 155 |
89 /* Auxiliary functions for FP_AS_GP detection. */ | 156 /* Auxiliary functions for FP_AS_GP detection. */ |
90 | 157 |
91 extern int nds32_fp_as_gp_check_available (void); | 158 extern bool nds32_symbol_load_store_p (rtx_insn *); |
159 extern bool nds32_naked_function_p (tree); | |
92 | 160 |
93 /* Auxiliary functions for jump table generation. */ | 161 /* Auxiliary functions for jump table generation. */ |
94 | 162 |
95 extern const char *nds32_output_casesi_pc_relative (rtx *); | 163 extern const char *nds32_output_casesi_pc_relative (rtx *); |
96 extern const char *nds32_output_casesi (rtx *); | 164 extern const char *nds32_output_casesi (rtx *); |
97 | 165 |
166 /* Auxiliary functions for conditional branch generation. */ | |
167 | |
168 extern enum nds32_expand_result_type nds32_expand_cbranch (rtx *); | |
169 extern enum nds32_expand_result_type nds32_expand_cstore (rtx *); | |
170 extern void nds32_expand_float_cbranch (rtx *); | |
171 extern void nds32_expand_float_cstore (rtx *); | |
172 | |
173 /* Auxiliary functions for conditional move generation. */ | |
174 | |
175 extern enum nds32_expand_result_type nds32_expand_movcc (rtx *); | |
176 extern void nds32_expand_float_movcc (rtx *); | |
177 | |
178 /* Auxiliary functions for expand extv/insv instruction. */ | |
179 | |
180 extern enum nds32_expand_result_type nds32_expand_extv (rtx *); | |
181 extern enum nds32_expand_result_type nds32_expand_insv (rtx *); | |
182 | |
183 /* Auxiliary functions for expand PIC instruction. */ | |
184 | |
185 extern void nds32_expand_pic_move (rtx *); | |
186 | |
187 /* Auxiliary functions to legitimize PIC address. */ | |
188 | |
189 extern rtx nds32_legitimize_pic_address (rtx); | |
190 | |
191 /* Auxiliary functions for expand TLS instruction. */ | |
192 | |
193 extern void nds32_expand_tls_move (rtx *); | |
194 | |
195 /* Auxiliary functions to legitimize TLS address. */ | |
196 | |
197 extern rtx nds32_legitimize_tls_address (rtx); | |
198 | |
199 /* Auxiliary functions to identify thread-local symbol. */ | |
200 | |
201 extern bool nds32_tls_referenced_p (rtx); | |
202 | |
203 /* Auxiliary functions for expand ICT instruction. */ | |
204 | |
205 extern void nds32_expand_ict_move (rtx *); | |
206 | |
207 /* Auxiliary functions to legitimize address for indirect-call symbol. */ | |
208 | |
209 extern rtx nds32_legitimize_ict_address (rtx); | |
210 | |
211 /* Auxiliary functions to identify indirect-call symbol. */ | |
212 | |
213 extern bool nds32_indirect_call_referenced_p (rtx); | |
214 | |
215 /* Auxiliary functions to identify long-call symbol. */ | |
216 extern bool nds32_long_call_p (rtx); | |
217 | |
218 /* Auxiliary functions to identify SYMBOL_REF and LABEL_REF pattern. */ | |
219 | |
220 extern bool symbolic_reference_mentioned_p (rtx); | |
221 | |
222 /* Auxiliary functions to identify conditional move comparison operand. */ | |
223 | |
224 extern int nds32_cond_move_p (rtx); | |
225 | |
98 /* Auxiliary functions to identify 16 bit addresing mode. */ | 226 /* Auxiliary functions to identify 16 bit addresing mode. */ |
99 | 227 |
100 extern enum nds32_16bit_address_type nds32_mem_format (rtx); | 228 extern enum nds32_16bit_address_type nds32_mem_format (rtx); |
229 | |
230 /* Auxiliary functions to identify floating-point addresing mode. */ | |
231 | |
232 extern bool nds32_float_mem_operand_p (rtx); | |
101 | 233 |
102 /* Auxiliary functions to output assembly code. */ | 234 /* Auxiliary functions to output assembly code. */ |
103 | 235 |
104 extern const char *nds32_output_16bit_store (rtx *, int); | 236 extern const char *nds32_output_16bit_store (rtx *, int); |
105 extern const char *nds32_output_16bit_load (rtx *, int); | 237 extern const char *nds32_output_16bit_load (rtx *, int); |
106 extern const char *nds32_output_32bit_store (rtx *, int); | 238 extern const char *nds32_output_32bit_store (rtx *, int); |
107 extern const char *nds32_output_32bit_load (rtx *, int); | 239 extern const char *nds32_output_32bit_load (rtx *, int); |
108 extern const char *nds32_output_32bit_load_s (rtx *, int); | 240 extern const char *nds32_output_32bit_load_s (rtx *, int); |
241 extern const char *nds32_output_float_load(rtx *); | |
242 extern const char *nds32_output_float_store(rtx *); | |
243 extern const char *nds32_output_smw_single_word (rtx *); | |
244 extern const char *nds32_output_smw_double_word (rtx *); | |
245 extern const char *nds32_output_lmw_single_word (rtx *); | |
246 extern const char *nds32_output_double (rtx *, bool); | |
247 extern const char *nds32_output_cbranchsi4_equality_zero (rtx_insn *, rtx *); | |
248 extern const char *nds32_output_cbranchsi4_equality_reg (rtx_insn *, rtx *); | |
249 extern const char *nds32_output_cbranchsi4_equality_reg_or_const_int (rtx_insn *, | |
250 rtx *); | |
251 extern const char *nds32_output_cbranchsi4_greater_less_zero (rtx_insn *, rtx *); | |
252 | |
253 extern const char *nds32_output_unpkd8 (rtx, rtx, rtx, rtx, bool); | |
254 | |
255 extern const char *nds32_output_call (rtx, rtx *, rtx, | |
256 const char *, const char *, bool); | |
257 extern const char *nds32_output_tls_desc (rtx *); | |
258 extern const char *nds32_output_tls_ie (rtx *); | |
109 | 259 |
110 /* Auxiliary functions to output stack push/pop instruction. */ | 260 /* Auxiliary functions to output stack push/pop instruction. */ |
111 | 261 |
112 extern const char *nds32_output_stack_push (rtx); | 262 extern const char *nds32_output_stack_push (rtx); |
113 extern const char *nds32_output_stack_pop (rtx); | 263 extern const char *nds32_output_stack_pop (rtx); |
264 extern const char *nds32_output_return (void); | |
265 | |
266 | |
267 /* Auxiliary functions to split/output sms pattern. */ | |
268 extern bool nds32_need_split_sms_p (rtx, rtx, rtx, rtx); | |
269 extern const char *nds32_output_sms (rtx, rtx, rtx, rtx); | |
270 extern void nds32_split_sms (rtx, rtx, rtx, rtx, rtx, rtx, rtx); | |
271 | |
272 /* Auxiliary functions to split double word RTX pattern. */ | |
273 | |
274 extern void nds32_spilt_doubleword (rtx *, bool); | |
275 extern void nds32_split_ashiftdi3 (rtx, rtx, rtx); | |
276 extern void nds32_split_ashiftrtdi3 (rtx, rtx, rtx); | |
277 extern void nds32_split_lshiftrtdi3 (rtx, rtx, rtx); | |
278 extern void nds32_split_rotatertdi3 (rtx, rtx, rtx); | |
279 | |
280 /* Auxiliary functions to split large constant RTX pattern. */ | |
281 | |
282 extern void nds32_expand_constant (machine_mode, | |
283 HOST_WIDE_INT, rtx, rtx); | |
114 | 284 |
115 /* Auxiliary functions to check using return with null epilogue. */ | 285 /* Auxiliary functions to check using return with null epilogue. */ |
116 | 286 |
117 extern int nds32_can_use_return_insn (void); | 287 extern int nds32_can_use_return_insn (void); |
288 extern scalar_int_mode nds32_case_vector_shorten_mode (int, int, rtx); | |
118 | 289 |
119 /* Auxiliary functions to decide output alignment or not. */ | 290 /* Auxiliary functions to decide output alignment or not. */ |
120 | 291 |
121 extern int nds32_target_alignment (rtx_insn *); | 292 extern int nds32_target_alignment (rtx_insn *); |
293 extern unsigned int nds32_data_alignment (tree, unsigned int); | |
294 extern unsigned int nds32_local_alignment (tree, unsigned int); | |
122 | 295 |
123 /* Auxiliary functions to expand builtin functions. */ | 296 /* Auxiliary functions to expand builtin functions. */ |
124 | 297 |
125 extern void nds32_init_builtins_impl (void); | 298 extern void nds32_init_builtins_impl (void); |
126 extern rtx nds32_expand_builtin_impl (tree, rtx, rtx, | 299 extern rtx nds32_expand_builtin_impl (tree, rtx, rtx, |
127 machine_mode, int); | 300 machine_mode, int); |
301 extern tree nds32_builtin_decl_impl (unsigned, bool); | |
128 | 302 |
129 /* Auxiliary functions for ISR implementation. */ | 303 /* Auxiliary functions for ISR implementation. */ |
130 | 304 |
131 extern void nds32_check_isr_attrs_conflict (tree, tree); | 305 extern void nds32_check_isr_attrs_conflict (tree, tree); |
132 extern void nds32_construct_isr_vectors_information (tree, const char *); | 306 extern void nds32_construct_isr_vectors_information (tree, const char *); |
133 extern void nds32_asm_file_start_for_isr (void); | 307 extern void nds32_asm_file_start_for_isr (void); |
134 extern void nds32_asm_file_end_for_isr (void); | 308 extern void nds32_asm_file_end_for_isr (void); |
135 extern bool nds32_isr_function_p (tree); | 309 extern bool nds32_isr_function_p (tree); |
310 extern bool nds32_isr_function_critical_p (tree); | |
136 | 311 |
137 /* Auxiliary functions for cost calculation. */ | 312 /* Auxiliary functions for cost calculation. */ |
138 | 313 |
314 extern void nds32_init_rtx_costs (void); | |
139 extern bool nds32_rtx_costs_impl (rtx, machine_mode, int, int, int *, bool); | 315 extern bool nds32_rtx_costs_impl (rtx, machine_mode, int, int, int *, bool); |
140 extern int nds32_address_cost_impl (rtx, machine_mode, addr_space_t, bool); | 316 extern int nds32_address_cost_impl (rtx, machine_mode, addr_space_t, bool); |
141 | 317 |
318 /* Auxiliary functions for pre-define marco. */ | |
319 extern void nds32_cpu_cpp_builtins(struct cpp_reader *); | |
320 | |
321 /* Auxiliary functions for const_vector's constraints. */ | |
322 | |
323 extern HOST_WIDE_INT const_vector_to_hwint (rtx); | |
324 extern bool nds32_valid_CVp5_p (rtx); | |
325 extern bool nds32_valid_CVs5_p (rtx); | |
326 extern bool nds32_valid_CVs2_p (rtx); | |
327 extern bool nds32_valid_CVhi_p (rtx); | |
328 | |
329 /* Auxiliary functions for lwm/smw. */ | |
330 | |
331 extern bool nds32_valid_smw_lwm_base_p (rtx); | |
332 | |
333 extern bool nds32_split_double_word_load_store_p (rtx *,bool); | |
334 | |
335 namespace nds32 { | |
336 | |
337 extern rtx extract_pattern_from_insn (rtx); | |
338 | |
339 size_t parallel_elements (rtx); | |
340 rtx parallel_element (rtx, int); | |
341 bool load_single_p (rtx_insn *); | |
342 bool store_single_p (rtx_insn *); | |
343 bool load_double_p (rtx_insn *); | |
344 bool store_double_p (rtx_insn *); | |
345 bool store_offset_reg_p (rtx_insn *); | |
346 bool post_update_insn_p (rtx_insn *); | |
347 bool immed_offset_p (rtx); | |
348 int find_post_update_rtx (rtx_insn *); | |
349 rtx extract_mem_rtx (rtx_insn *); | |
350 rtx extract_base_reg (rtx_insn *); | |
351 rtx extract_offset_rtx (rtx_insn *); | |
352 | |
353 rtx extract_shift_reg (rtx); | |
354 | |
355 bool movd44_insn_p (rtx_insn *); | |
356 rtx extract_movd44_odd_reg (rtx_insn *); | |
357 | |
358 rtx extract_mac_non_acc_rtx (rtx_insn *); | |
359 | |
360 bool divmod_p (rtx_insn *); | |
361 | |
362 rtx extract_branch_target_rtx (rtx_insn *); | |
363 rtx extract_branch_condition_rtx (rtx_insn *); | |
364 } // namespace nds32 | |
365 | |
366 extern bool nds32_use_load_post_increment(machine_mode); | |
367 | |
368 /* Functions for create nds32 specific optimization pass. */ | |
369 extern rtl_opt_pass *make_pass_nds32_relax_opt (gcc::context *); | |
370 extern rtl_opt_pass *make_pass_nds32_fp_as_gp (gcc::context *); | |
371 | |
142 /* ------------------------------------------------------------------------ */ | 372 /* ------------------------------------------------------------------------ */ |