1 /* Prototypes for exported functions of Andes NDS32 cpu for GNU compiler 2 Copyright (C) 2012-2016 Free Software Foundation, Inc. 3 Contributed by Andes Technology Corporation. 4 5 This file is part of GCC. 6 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. 11 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. 16 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/>. */ 20 21 22 /* ------------------------------------------------------------------------ */ 23 24 /* Defining Data Structures for Per-function Information. */ 25 26 extern void nds32_init_expanders (void); 27 28 29 /* Register Usage. */ 30 31 /* -- How Values Fit in Registers. */ 32 33 extern int nds32_hard_regno_nregs (int, machine_mode); 34 extern int nds32_hard_regno_mode_ok (int, machine_mode); 35 36 37 /* Register Classes. */ 38 39 extern enum reg_class nds32_regno_reg_class (int); 40 41 42 /* Stack Layout and Calling Conventions. */ 43 44 /* -- Basic Stack Layout. */ 45 46 extern rtx nds32_return_addr_rtx (int, rtx); 47 48 /* -- Eliminating Frame Pointer and Arg Pointer. */ 49 50 extern HOST_WIDE_INT nds32_initial_elimination_offset (unsigned int, 51 unsigned int); 52 53 /* -- Passing Arguments in Registers. */ 54 55 extern void nds32_init_cumulative_args (CUMULATIVE_ARGS *, 56 tree, rtx, tree, int); 57 58 /* -- Function Entry and Exit. */ 59 60 extern void nds32_expand_prologue (void); 61 extern void nds32_expand_epilogue (bool); 62 extern void nds32_expand_prologue_v3push (void); 63 extern void nds32_expand_epilogue_v3pop (bool); 64 65 /* ------------------------------------------------------------------------ */ 66 67 /* Auxiliary functions for auxiliary macros in nds32.h. */ 68 69 extern bool nds32_ls_333_p (rtx, rtx, rtx, machine_mode); 70 71 /* Auxiliary functions for expanding rtl used in nds32-multiple.md. */ 72 73 extern rtx nds32_expand_load_multiple (int, int, rtx, rtx); 74 extern rtx nds32_expand_store_multiple (int, int, rtx, rtx); 75 extern int nds32_expand_movmemqi (rtx, rtx, rtx, rtx); 76 77 /* Auxiliary functions for multiple load/store predicate checking. */ 78 79 extern bool nds32_valid_multiple_load_store (rtx, bool); 80 81 /* Auxiliary functions for stack operation predicate checking. */ 82 83 extern bool nds32_valid_stack_push_pop_p (rtx, bool); 84 85 /* Auxiliary functions for bit operation detection. */ 86 87 extern int nds32_can_use_bclr_p (int); 88 extern int nds32_can_use_bset_p (int); 89 extern int nds32_can_use_btgl_p (int); 90 91 extern int nds32_can_use_bitci_p (int); 92 93 /* Auxiliary function for 'Computing the Length of an Insn'. */ 94 95 extern int nds32_adjust_insn_length (rtx_insn *, int); 96 97 /* Auxiliary functions for FP_AS_GP detection. */ 98 99 extern int nds32_fp_as_gp_check_available (void); 100 101 /* Auxiliary functions for jump table generation. */ 102 103 extern const char *nds32_output_casesi_pc_relative (rtx *); 104 extern const char *nds32_output_casesi (rtx *); 105 106 /* Auxiliary functions to identify 16 bit addresing mode. */ 107 108 extern enum nds32_16bit_address_type nds32_mem_format (rtx); 109 110 /* Auxiliary functions to output assembly code. */ 111 112 extern const char *nds32_output_16bit_store (rtx *, int); 113 extern const char *nds32_output_16bit_load (rtx *, int); 114 extern const char *nds32_output_32bit_store (rtx *, int); 115 extern const char *nds32_output_32bit_load (rtx *, int); 116 extern const char *nds32_output_32bit_load_s (rtx *, int); 117 118 /* Auxiliary functions to output stack push/pop instruction. */ 119 120 extern const char *nds32_output_stack_push (rtx); 121 extern const char *nds32_output_stack_pop (rtx); 122 123 /* Auxiliary functions to check using return with null epilogue. */ 124 125 extern int nds32_can_use_return_insn (void); 126 127 /* Auxiliary functions to decide output alignment or not. */ 128 129 extern int nds32_target_alignment (rtx); 130 131 /* Auxiliary functions to expand builtin functions. */ 132 133 extern void nds32_init_builtins_impl (void); 134 extern rtx nds32_expand_builtin_impl (tree, rtx, rtx, 135 machine_mode, int); 136 137 /* Auxiliary functions for ISR implementation. */ 138 139 extern void nds32_check_isr_attrs_conflict (tree, tree); 140 extern void nds32_construct_isr_vectors_information (tree, const char *); 141 extern void nds32_asm_file_start_for_isr (void); 142 extern void nds32_asm_file_end_for_isr (void); 143 extern bool nds32_isr_function_p (tree); 144 145 /* Auxiliary functions for cost calculation. */ 146 147 extern bool nds32_rtx_costs_impl (rtx, machine_mode, int, int, int *, bool); 148 extern int nds32_address_cost_impl (rtx, machine_mode, addr_space_t, bool); 149 150 /* ------------------------------------------------------------------------ */ 151