<s> static void nds32_emit_stack_v3pop ( unsigned Rb , unsigned Re , unsigned imm8u ) { unsigned regno ; int num_use_regs ; int par_index ; int offset ; rtx reg ; rtx mem ; rtx pop_rtx ; rtx adjust_sp_rtx ; rtx parallel_insn ; rtx dwarf = NULL_RTX ; num_use_regs = Re - Rb + 1 + 3 ; parallel_insn = gen_rtx_PARALLEL ( VOIDmode , rtvec_alloc ( num_use_regs + 1 ) ) ; par_index = 0 ; offset = 0 ; for ( regno = Rb ; regno <= Re ; regno ++ ) { reg = gen_rtx_REG ( SImode , regno ) ; mem = gen_frame_mem ( SImode , plus_constant ( Pmode , stack_pointer_rtx , offset ) ) ; pop_rtx = gen_rtx_SET ( reg , mem ) ; XVECEXP ( parallel_insn , 0 , par_index ) = pop_rtx ; RTX_FRAME_RELATED_P ( pop_rtx ) = 1 ; offset = offset + 4 ; par_index ++ ; dwarf = alloc_reg_note ( REG_CFA_RESTORE , reg , dwarf ) ; } reg = gen_rtx_REG ( SImode , FP_REGNUM ) ; mem = gen_frame_mem ( SImode , plus_constant ( Pmode , stack_pointer_rtx , offset ) ) ; pop_rtx = gen_rtx_SET ( reg , mem ) ; XVECEXP ( parallel_insn , 0 , par_index ) = pop_rtx ; RTX_FRAME_RELATED_P ( pop_rtx ) = 1 ; offset = offset + 4 ; par_index ++ ; dwarf = alloc_reg_note ( REG_CFA_RESTORE , reg , dwarf ) ; reg = gen_rtx_REG ( SImode , GP_REGNUM ) ; mem = gen_frame_mem ( SImode , plus_constant ( Pmode , stack_pointer_rtx , offset ) ) ; pop_rtx = gen_rtx_SET ( reg , mem ) ; XVECEXP ( parallel_insn , 0 , par_index ) = pop_rtx ; RTX_FRAME_RELATED_P ( pop_rtx ) = 1 ; offset = offset + 4 ; par_index ++ ; dwarf = alloc_reg_note ( REG_CFA_RESTORE , reg , dwarf ) ; reg = gen_rtx_REG ( SImode , LP_REGNUM ) ; mem = gen_frame_mem ( SImode , plus_constant ( Pmode , stack_pointer_rtx , offset ) ) ; pop_rtx = gen_rtx_SET ( reg , mem ) ; XVECEXP ( parallel_insn , 0 , par_index ) = pop_rtx ; RTX_FRAME_RELATED_P ( pop_rtx ) = 1 ; offset = offset + 4 ; par_index ++ ; dwarf = alloc_reg_note ( REG_CFA_RESTORE , reg , dwarf ) ; adjust_sp_rtx = gen_rtx_SET ( stack_pointer_rtx , plus_constant ( Pmode , stack_pointer_rtx , offset + imm8u ) ) ; XVECEXP ( parallel_insn , 0 , par_index ) = adjust_sp_rtx ; if ( frame_pointer_needed ) { rtx cfa_adjust_rtx = gen_rtx_PLUS ( Pmode , stack_pointer_rtx , const0_rtx ) ; dwarf = alloc_reg_note ( REG_CFA_DEF_CFA , cfa_adjust_rtx , dwarf ) ; } else { dwarf = alloc_reg_note ( REG_CFA_ADJUST_CFA , copy_rtx ( adjust_sp_rtx ) , dwarf ) ; } parallel_insn = emit_insn ( parallel_insn ) ; RTX_FRAME_RELATED_P ( parallel_insn ) = 1 ; REG_NOTES ( parallel_insn ) = dwarf ; } </s>

Function to create a parallel rtx pattern which presents stack v3pop behavior . The overall concept are : `` pop registers from memory '' , `` adjust stack pointer '' .


<s> static void nds32_emit_stack_v3push ( unsigned Rb , unsigned Re , unsigned imm8u ) { unsigned regno ; int num_use_regs ; int par_index ; int offset ; rtx reg ; rtx mem ; rtx push_rtx ; rtx adjust_sp_rtx ; rtx parallel_insn ; num_use_regs = Re - Rb + 1 + 3 ; parallel_insn = gen_rtx_PARALLEL ( VOIDmode , rtvec_alloc ( num_use_regs + 1 ) ) ; par_index = 0 ; offset = - ( num_use_regs * 4 ) ; for ( regno = Rb ; regno <= Re ; regno ++ ) { reg = gen_rtx_REG ( SImode , regno ) ; mem = gen_frame_mem ( SImode , plus_constant ( Pmode , stack_pointer_rtx , offset ) ) ; push_rtx = gen_rtx_SET ( mem , reg ) ; XVECEXP ( parallel_insn , 0 , par_index ) = push_rtx ; RTX_FRAME_RELATED_P ( push_rtx ) = 1 ; offset = offset + 4 ; par_index ++ ; } reg = gen_rtx_REG ( SImode , FP_REGNUM ) ; mem = gen_frame_mem ( SImode , plus_constant ( Pmode , stack_pointer_rtx , offset ) ) ; push_rtx = gen_rtx_SET ( mem , reg ) ; XVECEXP ( parallel_insn , 0 , par_index ) = push_rtx ; RTX_FRAME_RELATED_P ( push_rtx ) = 1 ; offset = offset + 4 ; par_index ++ ; reg = gen_rtx_REG ( SImode , GP_REGNUM ) ; mem = gen_frame_mem ( SImode , plus_constant ( Pmode , stack_pointer_rtx , offset ) ) ; push_rtx = gen_rtx_SET ( mem , reg ) ; XVECEXP ( parallel_insn , 0 , par_index ) = push_rtx ; RTX_FRAME_RELATED_P ( push_rtx ) = 1 ; offset = offset + 4 ; par_index ++ ; reg = gen_rtx_REG ( SImode , LP_REGNUM ) ; mem = gen_frame_mem ( SImode , plus_constant ( Pmode , stack_pointer_rtx , offset ) ) ; push_rtx = gen_rtx_SET ( mem , reg ) ; XVECEXP ( parallel_insn , 0 , par_index ) = push_rtx ; RTX_FRAME_RELATED_P ( push_rtx ) = 1 ; offset = offset + 4 ; par_index ++ ; offset = - ( num_use_regs * 4 ) ; adjust_sp_rtx = gen_rtx_SET ( stack_pointer_rtx , plus_constant ( Pmode , stack_pointer_rtx , offset - imm8u ) ) ; XVECEXP ( parallel_insn , 0 , par_index ) = adjust_sp_rtx ; RTX_FRAME_RELATED_P ( adjust_sp_rtx ) = 1 ; parallel_insn = emit_insn ( parallel_insn ) ; RTX_FRAME_RELATED_P ( parallel_insn ) = 1 ; } </s>

Function to create a parallel rtx pattern which presents stack v3push behavior . The overall concept are : `` push registers to memory '' , `` adjust stack pointer '' .


<s> static void nds32_encode_section_info ( tree decl , rtx rtl , int new_decl_p ) { default_encode_section_info ( decl , rtl , new_decl_p ) ; if ( MEM_P ( rtl ) && MEM_READONLY_P ( rtl ) ) { rtx addr = XEXP ( rtl , 0 ) ; if ( GET_CODE ( addr ) == SYMBOL_REF ) { SYMBOL_REF_FLAGS ( addr ) |= NDS32_SYMBOL_FLAG_RODATA ; } else if ( GET_CODE ( addr ) == CONST && GET_CODE ( XEXP ( addr , 0 ) ) == PLUS ) { rtx plus_op = XEXP ( addr , 0 ) ; rtx op0 = XEXP ( plus_op , 0 ) ; rtx op1 = XEXP ( plus_op , 1 ) ; if ( GET_CODE ( op0 ) == SYMBOL_REF && CONST_INT_P ( op1 ) ) SYMBOL_REF_FLAGS ( op0 ) |= NDS32_SYMBOL_FLAG_RODATA ; } } } </s>

If references to a symbol or a constant must be treated differently depending on something about the variable or function named by the symbol ( such as what section it is in ) , we use this hook to store flags in symbol_ref rtx .


<s> void nds32_expand_epilogue_v3pop ( bool sibcall_p ) { int sp_adjust ; unsigned Rb , Re ; nds32_compute_stack_frame ( ) ; emit_insn ( gen_blockage ( ) ) ; if ( cfun -> machine -> naked_p ) { if ( ! sibcall_p ) { if ( cfun -> machine -> attr_naked_p && ! flag_ret_in_naked_func ) return ; emit_jump_insn ( gen_return_internal ( ) ) ; } return ; } Rb = cfun -> machine -> callee_saved_first_gpr_regno ; Re = cfun -> machine -> callee_saved_last_gpr_regno ; sp_adjust = cfun -> machine -> local_size + cfun -> machine -> out_args_size + cfun -> machine -> callee_saved_area_gpr_padding_bytes + cfun -> machine -> callee_saved_fpr_regs_size ; if ( satisfies_constraint_Iu08 ( GEN_INT ( sp_adjust ) ) && NDS32_DOUBLE_WORD_ALIGN_P ( sp_adjust ) && ! cfun -> calls_alloca ) { if ( cfun -> machine -> callee_saved_first_fpr_regno != SP_REGNUM ) { int fpr_position = cfun -> machine -> local_size + cfun -> machine -> out_args_size ; nds32_emit_v3pop_fpr_callee_saved ( fpr_position ) ; } nds32_emit_stack_v3pop ( Rb , Re , sp_adjust ) ; } else { if ( frame_pointer_needed ) { sp_adjust = cfun -> machine -> fp_size + cfun -> machine -> gp_size + cfun -> machine -> lp_size + cfun -> machine -> callee_saved_gpr_regs_size ; if ( cfun -> machine -> callee_saved_first_fpr_regno != SP_REGNUM ) { sp_adjust = sp_adjust + cfun -> machine -> callee_saved_area_gpr_padding_bytes + cfun -> machine -> callee_saved_fpr_regs_size ; nds32_emit_adjust_frame ( stack_pointer_rtx , hard_frame_pointer_rtx , - 1 * sp_adjust ) ; nds32_emit_v3pop_fpr_callee_saved ( 0 ) ; } else { nds32_emit_adjust_frame ( stack_pointer_rtx , hard_frame_pointer_rtx , - 1 * sp_adjust ) ; } } else { sp_adjust = cfun -> machine -> local_size + cfun -> machine -> out_args_size + cfun -> machine -> callee_saved_area_gpr_padding_bytes + cfun -> machine -> callee_saved_fpr_regs_size ; if ( cfun -> machine -> callee_saved_first_fpr_regno != SP_REGNUM ) { sp_adjust = sp_adjust - cfun -> machine -> callee_saved_area_gpr_padding_bytes - cfun -> machine -> callee_saved_fpr_regs_size ; nds32_emit_adjust_frame ( stack_pointer_rtx , stack_pointer_rtx , sp_adjust ) ; nds32_emit_v3pop_fpr_callee_saved ( 0 ) ; } else { nds32_emit_adjust_frame ( stack_pointer_rtx , stack_pointer_rtx , sp_adjust ) ; } } if ( cfun -> machine -> callee_saved_first_fpr_regno != SP_REGNUM ) { int fpr_space = cfun -> machine -> callee_saved_area_gpr_padding_bytes + cfun -> machine -> callee_saved_fpr_regs_size ; nds32_emit_stack_v3pop ( Rb , Re , fpr_space ) ; } else { nds32_emit_stack_v3pop ( Rb , Re , 0 ) ; } } emit_jump_insn ( gen_pop25return ( ) ) ; } </s>


<s> void nds32_expand_prologue_v3push ( void ) { int fp_adjust ; int sp_adjust ; int fpr_space = 0 ; unsigned Rb , Re ; nds32_compute_stack_frame ( ) ; if ( cfun -> machine -> callee_saved_gpr_regs_size > 0 ) df_set_regs_ever_live ( FP_REGNUM , 1 ) ; if ( frame_pointer_needed ) cfun -> machine -> fp_as_gp_p = false ; if ( cfun -> machine -> naked_p && ! flag_pic ) return ; Rb = cfun -> machine -> callee_saved_first_gpr_regno ; Re = cfun -> machine -> callee_saved_last_gpr_regno ; sp_adjust = cfun -> machine -> local_size + cfun -> machine -> out_args_size + cfun -> machine -> callee_saved_area_gpr_padding_bytes + cfun -> machine -> callee_saved_fpr_regs_size ; if ( satisfies_constraint_Iu08 ( GEN_INT ( sp_adjust ) ) && NDS32_DOUBLE_WORD_ALIGN_P ( sp_adjust ) ) { nds32_emit_stack_v3push ( Rb , Re , sp_adjust ) ; if ( cfun -> machine -> callee_saved_first_fpr_regno != SP_REGNUM ) { int fpr_position = cfun -> machine -> local_size + cfun -> machine -> out_args_size ; nds32_emit_push_fpr_callee_saved ( fpr_position ) ; } if ( frame_pointer_needed ) { fp_adjust = cfun -> machine -> fp_size + cfun -> machine -> gp_size + cfun -> machine -> lp_size + cfun -> machine -> callee_saved_gpr_regs_size + sp_adjust ; nds32_emit_adjust_frame ( hard_frame_pointer_rtx , stack_pointer_rtx , fp_adjust ) ; } } else { if ( cfun -> machine -> callee_saved_first_fpr_regno != SP_REGNUM ) { fpr_space = cfun -> machine -> callee_saved_area_gpr_padding_bytes + cfun -> machine -> callee_saved_fpr_regs_size ; nds32_emit_stack_v3push ( Rb , Re , fpr_space ) ; nds32_emit_push_fpr_callee_saved ( 0 ) ; } else { nds32_emit_stack_v3push ( Rb , Re , 0 ) ; } if ( frame_pointer_needed ) { fp_adjust = cfun -> machine -> fp_size + cfun -> machine -> gp_size + cfun -> machine -> lp_size + cfun -> machine -> callee_saved_gpr_regs_size ; if ( cfun -> machine -> callee_saved_first_fpr_regno != SP_REGNUM ) { fp_adjust = fp_adjust + fpr_space ; } nds32_emit_adjust_frame ( hard_frame_pointer_rtx , stack_pointer_rtx , fp_adjust ) ; } if ( cfun -> machine -> callee_saved_first_fpr_regno != SP_REGNUM ) { sp_adjust = sp_adjust - fpr_space ; } nds32_emit_adjust_frame ( stack_pointer_rtx , stack_pointer_rtx , - 1 * sp_adjust ) ; } if ( flag_pic && df_regs_ever_live_p ( PIC_OFFSET_TABLE_REGNUM ) ) nds32_emit_load_gp ( ) ; emit_insn ( gen_blockage ( ) ) ; } </s>


<s> static void nds32_expand_to_rtl_hook ( void ) { cfun -> machine -> strict_aligned_p = 1 ; } </s>

This function will be called just before expansion into rtl .


<s> static bool nds32_function_ok_for_sibcall ( tree decl , tree exp ATTRIBUTE_UNUSED ) { return ( ! TARGET_V3PUSH && ! nds32_isr_function_p ( current_function_decl ) && ( cfun -> machine -> va_args_size == 0 ) && decl && ! flag_pic ) ; } </s>

Return true if it is ok to do sibling call optimization .


<s> static bool nds32_hard_regno_mode_ok ( unsigned int regno , machine_mode mode ) { if ( regno >= FIRST_PSEUDO_REGISTER ) return true ; if ( ( TARGET_FPU_SINGLE || TARGET_FPU_DOUBLE ) && NDS32_IS_FPR_REGNUM ( regno ) ) { if ( NDS32_IS_EXT_FPR_REGNUM ( regno ) ) return ( NDS32_FPR_REGNO_OK_FOR_DOUBLE ( regno ) && ( mode == DFmode ) ) ; else if ( mode == SFmode || mode == SImode ) return NDS32_FPR_REGNO_OK_FOR_SINGLE ( regno ) ; else if ( mode == DFmode ) return NDS32_FPR_REGNO_OK_FOR_DOUBLE ( regno ) ; return false ; } if ( regno <= NDS32_LAST_GPR_REGNUM ) return ( targetm . hard_regno_nregs ( regno , mode ) == 1 || ! ( ( regno ) & 1 ) ) ; return false ; } </s>


<s> static void nds32_init_builtins ( void ) { nds32_init_builtins_impl ( ) ; } </s>


<s> void nds32_init_expanders ( void ) { init_machine_status = nds32_init_machine_status ; } </s>

Defining Data Structures for Per-function Information .


<s> static void nds32_init_libfuncs ( void ) { if ( TARGET_LINUX_ABI ) init_sync_libfuncs ( UNITS_PER_WORD ) ; } </s>


<s> static struct machine_function * nds32_init_machine_status ( void ) { struct machine_function * machine ; machine = ggc_cleared_alloc < machine_function > ( ) ; machine -> use_eh_return_p = 0 ; machine -> naked_p = 0 ; machine -> fp_as_gp_p = 0 ; machine -> strict_aligned_p = 0 ; machine -> attr_naked_p = 0 ; machine -> attr_no_prologue_p = 0 ; return machine ; } </s>

Function to save and restore machine-specific function data .


<s> static bool nds32_legitimate_index_p ( machine_mode outer_mode , rtx index , bool strict ) { int regno ; rtx op0 ; rtx op1 ; switch ( GET_CODE ( index ) ) { case REG : regno = REGNO ( index ) ; if ( strict ) return REGNO_OK_FOR_INDEX_P ( regno ) ; else return true ; case CONST_INT : switch ( GET_MODE_SIZE ( outer_mode ) ) { case 1 : if ( satisfies_constraint_Is15 ( index ) ) return true ; break ; case 2 : if ( satisfies_constraint_Is16 ( index ) ) { if ( ! cfun -> machine -> strict_aligned_p ) return true ; else if ( NDS32_HALF_WORD_ALIGN_P ( INTVAL ( index ) ) ) return true ; } break ; case 4 : if ( satisfies_constraint_Is17 ( index ) ) { if ( ( TARGET_FPU_SINGLE || TARGET_FPU_DOUBLE ) ) { if ( ! satisfies_constraint_Is14 ( index ) ) return false ; } if ( ! cfun -> machine -> strict_aligned_p ) return true ; else if ( NDS32_SINGLE_WORD_ALIGN_P ( INTVAL ( index ) ) ) return true ; } break ; case 8 : if ( satisfies_constraint_Is17 ( gen_int_mode ( INTVAL ( index ) + 4 , SImode ) ) ) { if ( ( TARGET_FPU_SINGLE || TARGET_FPU_DOUBLE ) ) { if ( ! satisfies_constraint_Is14 ( index ) ) return false ; } if ( ! cfun -> machine -> strict_aligned_p ) return true ; else if ( NDS32_SINGLE_WORD_ALIGN_P ( INTVAL ( index ) ) ) return true ; } break ; default : return false ; } return false ; case MULT : op0 = XEXP ( index , 0 ) ; op1 = XEXP ( index , 1 ) ; if ( REG_P ( op0 ) && CONST_INT_P ( op1 ) ) { int multiplier ; multiplier = INTVAL ( op1 ) ; if ( multiplier != 1 && multiplier != 2 && multiplier != 4 && multiplier != 8 ) return false ; regno = REGNO ( op0 ) ; if ( strict ) return REGNO_OK_FOR_INDEX_P ( regno ) ; else return true ; } return false ; case ASHIFT : op0 = XEXP ( index , 0 ) ; op1 = XEXP ( index , 1 ) ; if ( REG_P ( op0 ) && CONST_INT_P ( op1 ) ) { int sv ; sv = INTVAL ( op1 ) ; if ( sv != 0 && sv != 1 && sv != 2 && sv != 3 ) return false ; regno = REGNO ( op0 ) ; if ( strict ) return REGNO_OK_FOR_INDEX_P ( regno ) ; else return true ; } return false ; default : return false ; } } </s>

Function that check if 'INDEX ' is valid to be a index rtx for address . OUTER_MODE : Machine mode of outer address rtx . INDEX : Check if this rtx is valid to be a index for address . STRICT : If it is true , we are in reload pass or after reload pass .


<s> unsigned int nds32_local_alignment ( tree local ATTRIBUTE_UNUSED , unsigned int basic_align ) { bool at_least_align_to_word = false ; switch ( TREE_CODE ( local ) ) { case ARRAY_TYPE : case RECORD_TYPE : case UNION_TYPE : at_least_align_to_word = true ; break ; default : at_least_align_to_word = false ; break ; } if ( at_least_align_to_word && ( basic_align < BITS_PER_WORD ) ) return BITS_PER_WORD ; else return basic_align ; } </s>


<s> static rtx_insn * nds32_md_asm_adjust ( vec < rtx > & outputs ATTRIBUTE_UNUSED , vec < rtx > & inputs ATTRIBUTE_UNUSED , vec < machine_mode > & input_modes ATTRIBUTE_UNUSED , vec < const char * > & constraints ATTRIBUTE_UNUSED , vec < rtx > & clobbers , HARD_REG_SET & clobbered_regs , location_t ) { if ( ! flag_inline_asm_r15 ) { clobbers . safe_push ( gen_rtx_REG ( SImode , TA_REGNUM ) ) ; SET_HARD_REG_BIT ( clobbered_regs , TA_REGNUM ) ; } return NULL ; } </s>


<s> static tree nds32_merge_decl_attributes ( tree olddecl , tree newdecl ) { tree combined_attrs ; combined_attrs = merge_attributes ( DECL_ATTRIBUTES ( olddecl ) , DECL_ATTRIBUTES ( newdecl ) ) ; if ( TREE_CODE ( olddecl ) == FUNCTION_DECL ) { nds32_check_isr_attrs_conflict ( olddecl , combined_attrs ) ; } return combined_attrs ; } </s>

Add some checking after merging attributes .


<s> static bool nds32_modes_tieable_p ( machine_mode mode1 , machine_mode mode2 ) { if ( ( GET_MODE_CLASS ( mode1 ) == MODE_INT && GET_MODE_CLASS ( mode2 ) == MODE_INT ) && GET_MODE_SIZE ( mode1 ) <= UNITS_PER_WORD && GET_MODE_SIZE ( mode2 ) <= UNITS_PER_WORD ) return true ; if ( GET_MODE_SIZE ( mode1 ) == GET_MODE_SIZE ( mode2 ) ) { if ( ( TARGET_FPU_SINGLE && ! TARGET_FPU_DOUBLE ) && ( mode1 == DFmode || mode2 == DFmode ) ) return false ; else return true ; } return false ; } </s>

Implement TARGET_MODES_TIEABLE_P . We can use general registers to tie QI/HI/SI modes together .


<s> bool nds32_naked_function_p ( tree func ) { tree t_naked ; tree t_no_prologue ; if ( TREE_CODE ( func ) != FUNCTION_DECL ) abort ( ) ; t_naked = lookup_attribute ( "naked" , DECL_ATTRIBUTES ( func ) ) ; t_no_prologue = lookup_attribute ( "no_prologue" , DECL_ATTRIBUTES ( func ) ) ; return ( ( t_naked != NULL_TREE ) || ( t_no_prologue != NULL_TREE ) ) ; } </s>

Return true if FUNC is a naked function .


<s> static bool nds32_needs_double_word_align ( machine_mode mode , const_tree type ) { unsigned int align ; align = NDS32_MODE_TYPE_ALIGN ( mode , type ) ; return ( align > PARM_BOUNDARY ) ; } </s>

Return true if MODE/TYPE need double word alignment .


<s> static int nds32_register_move_cost ( machine_mode mode , reg_class_t from , reg_class_t to ) { if ( TARGET_PIPELINE_GRAYWOLF ) { if ( GET_MODE_SIZE ( mode ) == 8 ) { if ( from == FP_REGS && to != FP_REGS ) return 3 ; if ( from != FP_REGS && to == FP_REGS ) return 2 ; } else { if ( ( from == FP_REGS && to != FP_REGS ) || ( from != FP_REGS && to == FP_REGS ) ) return 2 ; } } if ( ( from == FP_REGS && to != FP_REGS ) || ( from != FP_REGS && to == FP_REGS ) ) return 3 ; else if ( from == HIGH_REGS || to == HIGH_REGS ) return optimize_size ? 6 : 2 ; else return 2 ; } </s>

Describing Relative Costs of Operations .


<s> static void nds32_register_passes ( void ) { nds32_register_pass ( make_pass_nds32_fp_as_gp , PASS_POS_INSERT_BEFORE , "ira" ) ; nds32_register_pass ( make_pass_nds32_relax_opt , PASS_POS_INSERT_AFTER , "mach" ) ; } </s>

This function is called from nds32_option_override ( ) . All new passes should be registered here .


<s> enum reg_class nds32_regno_reg_class ( int regno ) { if ( regno >= 0 && regno <= 7 ) return LOW_REGS ; else if ( regno >= 8 && regno <= 11 ) return MIDDLE_REGS ; else if ( regno >= 12 && regno <= 14 ) return HIGH_REGS ; else if ( regno == 15 ) return R15_TA_REG ; else if ( regno >= 16 && regno <= 19 ) return MIDDLE_REGS ; else if ( regno >= 20 && regno <= 31 ) return HIGH_REGS ; else if ( regno == 32 || regno == 33 ) { return GENERAL_REGS ; } else if ( regno >= 34 && regno <= 97 ) return FP_REGS ; else return NO_REGS ; } </s>


<s> static bool nds32_rtx_costs ( rtx x , machine_mode mode , int outer_code , int opno , int * total , bool speed ) { return nds32_rtx_costs_impl ( x , mode , outer_code , opno , total , speed ) ; } </s>

This target hook describes the relative costs of RTL expressions . Return 'true ' when all subexpressions of x have been processed . Return 'false ' to sum the costs of sub-rtx , plus cost of this operation . Refer to gcc/rtlanal.cc for more information .


<s> static void nds32_setup_incoming_varargs ( cumulative_args_t ca , const function_arg_info & arg , int * pretend_args_size , int second_time ATTRIBUTE_UNUSED ) { unsigned int total_args_regs ; unsigned int num_of_used_regs ; unsigned int remaining_reg_count ; CUMULATIVE_ARGS * cum ; if ( TARGET_HARD_FLOAT ) return ; cum = get_cumulative_args ( ca ) ; total_args_regs = NDS32_MAX_GPR_REGS_FOR_ARGS + NDS32_GPR_ARG_FIRST_REGNUM ; num_of_used_regs = NDS32_AVAILABLE_REGNUM_FOR_GPR_ARG ( cum -> gpr_offset , arg . mode , arg . type ) + NDS32_NEED_N_REGS_FOR_ARG ( arg . mode , arg . type ) ; remaining_reg_count = total_args_regs - num_of_used_regs ; * pretend_args_size = remaining_reg_count * UNITS_PER_WORD ; return ; } </s>


<s> int nds32_target_alignment ( rtx_insn * label ) { rtx_insn * insn ; if ( ! NDS32_ALIGN_P ( ) ) return 0 ; insn = next_active_insn ( label ) ; if ( insn == 0 || ( get_attr_length ( insn ) == 2 && ! JUMP_P ( insn ) && ! CALL_P ( insn ) ) ) return 0 ; else return 2 ; } </s>

Return align 2 ( log base 2 ) if the next instruction of LABEL is 4 byte .


"a nested function is not supported for reduced registers"

Emit RTL insns to initialize the variable parts of a trampoline .


<s> bool nds32_use_load_post_increment ( machine_mode mode ) { return ( GET_MODE_SIZE ( mode ) <= GET_MODE_SIZE ( E_DImode ) ) ; } </s>

Function that determine whether a load postincrement is a good thing to use for a given mode .


<s> static bool nds32_warn_func_return ( tree decl ) { return ! nds32_naked_function_p ( decl ) ; } </s>

Determine whether we need to enable warning for function return check .