<s> rtx word_mode_end = gen_reg_rtx ( SImode ) ; rtx size_for_word = gen_reg_rtx ( SImode ) ; size_for_word = expand_binop ( SImode , and_optab , size , gen_int_mode ( ~ <NUM_LIT> , SImode ) , NULL_RTX , <NUM_LIT> , OPTAB_WIDEN ) ; emit_move_insn ( byte_mode_size , size ) ; emit_cmp_and_jump_insns ( size_for_word , const0_rtx , EQ , NULL , SImode , <NUM_LIT> , word_mode_end_label ) ; word_mode_end = expand_binop ( Pmode , add_optab , itr , size_for_word , NULL_RTX , <NUM_LIT> , OPTAB_WIDEN ) ; byte_mode_size_tmp = expand_binop ( SImode , and_optab , size , GEN_INT ( <NUM_LIT> ) , NULL_RTX , <NUM_LIT> , OPTAB_WIDEN ) ; emit_move_insn ( byte_mode_size , byte_mode_size_tmp ) ; emit_label ( word_mode_label ) ; emit_insn ( gen_unaligned_store_update_base_w ( itr , itr , value ) ) ; emit_cmp_and_jump_insns ( word_mode_end , itr , NE , NULL , Pmode , <NUM_LIT> , word_mode_label ) ; emit_label ( word_mode_end_label ) ; return byte_mode_size ;


<s> if ( ! optimize_size && optimize > <NUM_LIT> ) return nds32_expand_movmemsi_loop ( dstmem , srcmem , total_bytes , alignment ) ;


<s> bool nds32_expand_movmemsi ( rtx dstmem , rtx srcmem , rtx total_bytes , rtx alignment ) { if ( nds32_expand_movmemsi_unroll ( dstmem , srcmem , total_bytes , alignment ) ) return true ;

if ( ! optimize_size && optimize > <NUM_LIT> ) return nds32_expand_movmemsi_loop ( dstmem , srcmem , total_bytes , alignment ) ;


<s> if ( CONST_INT_P ( size ) ) return nds32_expand_movmemsi_loop_known_size ( dstmem , srcmem , size , alignment ) ; else return nds32_expand_movmemsi_loop_unknown_size ( dstmem , srcmem , size , alignment ) ;


<s> if ( CONST_INT_P ( size ) ) return nds32_expand_movmemsi_loop_known_size ( dstmem , srcmem , size , alignment ) ;

else return nds32_expand_movmemsi_loop_unknown_size ( dstmem , srcmem , size , alignment ) ;


<s> return nds32_expand_movmemsi_loop_unknown_size ( dstmem , srcmem , size , alignment ) ;


<s> static bool nds32_expand_movmemsi_loop_unknown_size ( rtx dstmem , rtx srcmem , rtx size , rtx alignment ) { rtx dst_base_reg , src_base_reg ; rtx dst_itr , src_itr ; rtx dstmem_m , srcmem_m , dst_itr_m , src_itr_m ; rtx dst_end ; rtx size_least_3_bit ; rtx double_word_end ; rtx double_word_mode_loop , byte_mode_entry , byte_mode_loop , end_label ; rtx tmp ; rtx mask_least_3_bit ; int start_regno ; bool align_to_4_bytes = ( INTVAL ( alignment ) & <NUM_LIT> ) == <NUM_LIT> ; if ( TARGET_ISA_V3M && ! align_to_4_bytes ) return <NUM_LIT> ; if ( TARGET_REDUCED_REGS ) start_regno = <NUM_LIT> ; else start_regno = <NUM_LIT> ; dst_itr = gen_reg_rtx ( Pmode ) ; src_itr = gen_reg_rtx ( Pmode ) ; dst_end = gen_reg_rtx ( Pmode ) ; tmp = gen_reg_rtx ( QImode ) ; mask_least_3_bit = GEN_INT ( ~ <NUM_LIT> ) ; double_word_mode_loop = gen_label_rtx ( ) ; byte_mode_entry = gen_label_rtx ( ) ; byte_mode_loop = gen_label_rtx ( ) ; end_label = gen_label_rtx ( ) ; dst_base_reg = copy_to_mode_reg ( Pmode , XEXP ( dstmem , <NUM_LIT> ) ) ; src_base_reg = copy_to_mode_reg ( Pmode , XEXP ( srcmem , <NUM_LIT> ) ) ; size_least_3_bit = expand_binop ( SImode , and_optab , size , mask_least_3_bit , NULL_RTX , <NUM_LIT> , OPTAB_WIDEN ) ; dst_end = expand_binop ( Pmode , add_optab , dst_base_reg , size , NULL_RTX , <NUM_LIT> , OPTAB_WIDEN ) ; emit_move_insn ( dst_itr , dst_base_reg ) ; emit_move_insn ( src_itr , src_base_reg ) ; emit_cmp_and_jump_insns ( size_least_3_bit , const0_rtx , EQ , NULL , SImode , <NUM_LIT> , byte_mode_entry ) ; double_word_end = expand_binop ( Pmode , add_optab , dst_base_reg , size_least_3_bit , NULL_RTX , <NUM_LIT> , OPTAB_WIDEN ) ;


<s> static bool nds32_expand_movmemsi_unroll ( rtx dstmem , rtx srcmem , rtx total_bytes , rtx alignment ) { rtx dst_base_reg , src_base_reg ; rtx tmp_reg ; int maximum_bytes ; int maximum_bytes_per_inst ; int maximum_regs ; int start_regno ; int i , inst_num ; HOST_WIDE_INT remain_bytes , remain_words ; bool align_to_4_bytes = ( INTVAL ( alignment ) & <NUM_LIT> ) == <NUM_LIT> ; bool align_to_2_bytes = ( INTVAL ( alignment ) & <NUM_LIT> ) == <NUM_LIT> ; if ( TARGET_REDUCED_REGS ) { maximum_regs = <NUM_LIT> ; maximum_bytes = <NUM_LIT> ; start_regno = <NUM_LIT> ; } else { maximum_regs = <NUM_LIT> ; maximum_bytes = <NUM_LIT> ; start_regno = <NUM_LIT> ; } maximum_bytes_per_inst = maximum_regs * UNITS_PER_WORD ; if ( GET_CODE ( total_bytes ) != CONST_INT || GET_CODE ( alignment ) != CONST_INT || INTVAL ( total_bytes ) > maximum_bytes || MEM_VOLATILE_P ( dstmem ) || MEM_VOLATILE_P ( srcmem ) || ( TARGET_ISA_V3M && ! align_to_4_bytes ) ) return false ; dst_base_reg = copy_to_mode_reg ( SImode , XEXP ( dstmem , <NUM_LIT> ) ) ; src_base_reg = copy_to_mode_reg ( SImode , XEXP ( srcmem , <NUM_LIT> ) ) ; remain_bytes = INTVAL ( total_bytes ) ; inst_num = ( ( INTVAL ( total_bytes ) + ( maximum_bytes_per_inst - <NUM_LIT> ) ) / maximum_bytes_per_inst ) - <NUM_LIT> ; for ( i = <NUM_LIT> ; i < inst_num ; i ++ ) { nds32_emit_mem_move_block ( start_regno , maximum_regs , & dst_base_reg , & dstmem , & src_base_reg , & srcmem , true ) ; } remain_bytes -= maximum_bytes_per_inst * inst_num ; remain_words = remain_bytes / UNITS_PER_WORD ; remain_bytes = remain_bytes - ( remain_words * UNITS_PER_WORD ) ; if ( remain_words != <NUM_LIT> ) { if ( remain_bytes != <NUM_LIT> ) nds32_emit_mem_move_block ( start_regno , remain_words , & dst_base_reg , & dstmem , & src_base_reg , & srcmem , true ) ; else { if ( remain_words == <NUM_LIT> ) { if ( align_to_4_bytes ) nds32_emit_mem_move ( srcmem , dstmem , SImode , <NUM_LIT> ) ; else { tmp_reg = gen_reg_rtx ( SImode ) ; emit_insn ( gen_unaligned_load_w ( tmp_reg , gen_rtx_MEM ( SImode , src_base_reg ) ) ) ; emit_insn ( gen_unaligned_store_w ( gen_rtx_MEM ( SImode , dst_base_reg ) , tmp_reg ) ) ; } } else nds32_emit_mem_move_block ( start_regno , remain_words , & dst_base_reg , & dstmem , & src_base_reg , & srcmem , false ) ; } } switch ( remain_bytes ) { case <NUM_LIT> : case <NUM_LIT> : { if ( align_to_2_bytes ) nds32_emit_mem_move ( srcmem , dstmem , HImode , <NUM_LIT> ) ; else { nds32_emit_mem_move ( srcmem , dstmem , QImode , <NUM_LIT> ) ; nds32_emit_mem_move ( srcmem , dstmem , QImode , <NUM_LIT> ) ; } if ( remain_bytes == <NUM_LIT> ) nds32_emit_mem_move ( srcmem , dstmem , QImode , <NUM_LIT> ) ; break ;


<s> rtx value4word ; rtx value4byte ; rtx dst ; rtx byte_mode_size ; dst = copy_to_mode_reg ( SImode , XEXP ( dstmem , <NUM_LIT> ) ) ; value4word = nds32_gen_dup_4_byte_to_word_value ( value ) ; byte_mode_size = emit_setmem_word_loop ( dst , size , value4word ) ; value4byte = simplify_gen_subreg ( QImode , value4word , SImode , subreg_lowpart_offset ( QImode , SImode ) ) ;

emit_setmem_byte_loop ( dst , byte_mode_size , value4byte , false ) ;


<s> byte_mode_size = emit_setmem_word_loop ( dst , size , value4word ) ; value4byte = simplify_gen_subreg ( QImode , value4word , SImode , subreg_lowpart_offset ( QImode , SImode ) ) ; emit_setmem_byte_loop ( dst , byte_mode_size , value4byte , false ) ;


<s> rtx last_2_bit = gen_reg_rtx ( SImode ) ; rtx byte_loop_base = gen_reg_rtx ( SImode ) ; rtx byte_loop_size = gen_reg_rtx ( SImode ) ; rtx remain_size = gen_reg_rtx ( SImode ) ; rtx new_base_reg ; rtx value4byte , value4word ; rtx byte_mode_size ; rtx last_byte_loop_label = gen_label_rtx ( ) ; size = force_reg ( SImode , size ) ; value4word = nds32_gen_dup_4_byte_to_word_value ( value ) ; value4byte = simplify_gen_subreg ( QImode , value4word , SImode , <NUM_LIT> ) ; emit_move_insn ( byte_loop_size , size ) ; emit_move_insn ( byte_loop_base , base_reg ) ; emit_cmp_and_jump_insns ( size , gen_int_mode ( <NUM_LIT> , SImode ) , LE , NULL , SImode , <NUM_LIT> , last_byte_loop_label ) ; emit_insn ( gen_andsi3 ( last_2_bit , base_reg , gen_int_mode ( <NUM_LIT> , SImode ) ) ) ; emit_insn ( gen_subsi3 ( need_align_bytes , gen_int_mode ( <NUM_LIT> , SImode ) , last_2_bit ) ) ; new_base_reg = emit_setmem_byte_loop ( base_reg , need_align_bytes , value4byte , true ) ; emit_insn ( gen_subsi3 ( remain_size , size , need_align_bytes ) ) ; byte_mode_size = emit_setmem_word_loop ( new_base_reg , remain_size , value4word ) ; emit_move_insn ( byte_loop_base , new_base_reg ) ; emit_move_insn ( byte_loop_size , byte_mode_size ) ;


<s> src_base_reg = copy_to_mode_reg ( Pmode , XEXP ( srcmem , <NUM_LIT> ) ) ; if ( total_bytes < <NUM_LIT> ) { dst_end = expand_binop ( Pmode , add_optab , dst_base_reg , size , NULL_RTX , <NUM_LIT> , OPTAB_WIDEN ) ; emit_move_insn ( dst_itr , dst_base_reg ) ; emit_move_insn ( src_itr , src_base_reg ) ; emit_label ( byte_mode_loop ) ; nds32_emit_post_inc_load_store ( tmp , src_itr , QImode , true ) ; nds32_emit_post_inc_load_store ( tmp , dst_itr , QImode , false ) ; emit_cmp_and_jump_insns ( dst_itr , dst_end , NE , NULL , SImode , <NUM_LIT> , byte_mode_loop ) ; return true ; } else if ( total_bytes % <NUM_LIT> == <NUM_LIT> ) { dst_end = expand_binop ( Pmode , add_optab , dst_base_reg , size , NULL_RTX , <NUM_LIT> , OPTAB_WIDEN ) ; emit_move_insn ( dst_itr , dst_base_reg ) ; emit_move_insn ( src_itr , src_base_reg ) ; emit_label ( double_word_mode_loop ) ; src_itr_m = src_itr ; dst_itr_m = dst_itr ; srcmem_m = srcmem ; dstmem_m = dstmem ;

nds32_emit_mem_move_block ( start_regno , <NUM_LIT> , & dst_itr_m , & dstmem_m , & src_itr_m , & srcmem_m , true ) ;


<s> rtx end_label = gen_label_rtx ( ) ; value = force_reg ( QImode , value ) ; if ( need_end ) end = expand_binop ( Pmode , add_optab , itr , size , NULL_RTX , <NUM_LIT> , OPTAB_WIDEN ) ; emit_cmp_and_jump_insns ( size , const0_rtx , EQ , NULL , SImode , <NUM_LIT> , end_label ) ; if ( ! need_end ) end = expand_binop ( Pmode , add_optab , itr , size , NULL_RTX , <NUM_LIT> , OPTAB_WIDEN ) ; emit_label ( byte_mode_label ) ; nds32_emit_post_inc_load_store ( value , itr , QImode , false ) ; emit_cmp_and_jump_insns ( end , itr , NE , NULL , Pmode , <NUM_LIT> , byte_mode_label ) ;


<s> rtx end_label = gen_label_rtx ( ) ; value = force_reg ( QImode , value ) ; if ( need_end ) end = expand_binop ( Pmode , add_optab , itr , size , NULL_RTX , <NUM_LIT> , OPTAB_WIDEN ) ; emit_cmp_and_jump_insns ( size , const0_rtx , EQ , NULL , SImode , <NUM_LIT> , end_label ) ; if ( ! need_end ) end = expand_binop ( Pmode , add_optab , itr , size , NULL_RTX , <NUM_LIT> , OPTAB_WIDEN ) ; emit_label ( byte_mode_label ) ;

nds32_emit_post_inc_load_store ( value , itr , QImode , false ) ;


<s> byte_mode_size_tmp = expand_binop ( SImode , and_optab , size , GEN_INT ( <NUM_LIT> ) , NULL_RTX , <NUM_LIT> , OPTAB_WIDEN ) ; emit_move_insn ( byte_mode_size , byte_mode_size_tmp ) ; emit_label ( word_mode_label ) ; emit_insn ( gen_unaligned_store_update_base_dw ( itr , itr , value ) ) ; emit_cmp_and_jump_insns ( word_mode_end , itr , NE , NULL , Pmode , <NUM_LIT> , word_mode_label ) ; emit_label ( word_mode_end_label ) ; return byte_mode_size ;


<s> static void nds32_emit_load_store ( rtx reg , rtx mem , enum machine_mode mode , int offset , bool load_p ) { rtx new_mem ; new_mem = adjust_address ( mem , mode , offset ) ; if ( load_p ) emit_move_insn ( reg , new_mem ) ;


<s> gcc_assert ( MEM_P ( src ) && MEM_P ( dst ) ) ; rtx tmp_reg = gen_reg_rtx ( mode ) ; nds32_emit_load_store ( tmp_reg , src , mode , addr_offset , true ) ;

nds32_emit_load_store ( tmp_reg , dst , mode , addr_offset , false ) ;


<s> static void nds32_emit_mem_move ( rtx src , rtx dst , enum machine_mode mode , int addr_offset ) { gcc_assert ( MEM_P ( src ) && MEM_P ( dst ) ) ; rtx tmp_reg = gen_reg_rtx ( mode ) ; nds32_emit_load_store ( tmp_reg , src , mode , addr_offset , true ) ;


<s> emit_insn ( nds32_expand_store_multiple ( base_regno , count , * dst_base_reg , * dst_mem , update_base_reg_p , & new_base_reg ) ) ; if ( update_base_reg_p ) { * dst_base_reg = new_base_reg ;

* dst_mem = gen_rtx_MEM ( SImode , * dst_base_reg ) ;


<s> if ( update_base_reg_p ) { * src_base_reg = new_base_reg ; * src_mem = gen_rtx_MEM ( SImode , * src_base_reg ) ; } emit_insn ( nds32_expand_store_multiple ( base_regno , count , * dst_base_reg , * dst_mem , update_base_reg_p , & new_base_reg ) ) ;


<s> else emit_move_insn ( gen_rtx_MEM ( mode , base_reg ) , reg ) ; emit_move_insn ( base_reg , plus_constant ( Pmode , base_reg , GET_MODE_SIZE ( mode ) ) ) ;


<s> gcc_assert ( GET_MODE ( reg ) == mode ) ; gcc_assert ( GET_MODE ( base_reg ) == Pmode ) ; if ( load_p ) emit_move_insn ( reg , gen_rtx_MEM ( mode , base_reg ) ) ; else emit_move_insn ( gen_rtx_MEM ( mode , base_reg ) , reg ) ;

emit_move_insn ( base_reg , plus_constant ( Pmode , base_reg , GET_MODE_SIZE ( mode ) ) ) ;


<s> static bool nds32_expand_cpymemsi_loop ( rtx dstmem , rtx srcmem , rtx size , rtx alignment ) {

if ( CONST_INT_P ( size ) ) return nds32_expand_cpymemsi_loop_known_size ( dstmem , srcmem , size , alignment ) ;


<s> rtx dst_itr , src_itr ; rtx dstmem_m , srcmem_m , dst_itr_m , src_itr_m ; rtx dst_end ; rtx double_word_mode_loop , byte_mode_loop ; rtx tmp ; int start_regno ; bool align_to_4_bytes = ( INTVAL ( alignment ) & <NUM_LIT> ) == <NUM_LIT> ; unsigned HOST_WIDE_INT total_bytes = UINTVAL ( size ) ; if ( TARGET_ISA_V3M && ! align_to_4_bytes ) return <NUM_LIT> ; if ( TARGET_REDUCED_REGS ) start_regno = <NUM_LIT> ; else start_regno = <NUM_LIT> ; dst_itr = gen_reg_rtx ( Pmode ) ; src_itr = gen_reg_rtx ( Pmode ) ; dst_end = gen_reg_rtx ( Pmode ) ; tmp = gen_reg_rtx ( QImode ) ; double_word_mode_loop = gen_label_rtx ( ) ; byte_mode_loop = gen_label_rtx ( ) ; dst_base_reg = copy_to_mode_reg ( Pmode , XEXP ( dstmem , <NUM_LIT> ) ) ; src_base_reg = copy_to_mode_reg ( Pmode , XEXP ( srcmem , <NUM_LIT> ) ) ; if ( total_bytes < <NUM_LIT> ) { dst_end = expand_binop ( Pmode , add_optab , dst_base_reg , size , NULL_RTX , <NUM_LIT> , OPTAB_WIDEN ) ; emit_move_insn ( dst_itr , dst_base_reg ) ; emit_move_insn ( src_itr , src_base_reg ) ; emit_label ( byte_mode_loop ) ; nds32_emit_post_inc_load_store ( tmp , src_itr , QImode , true ) ; nds32_emit_post_inc_load_store ( tmp , dst_itr , QImode , false ) ; emit_cmp_and_jump_insns ( dst_itr , dst_end , NE , NULL , SImode , <NUM_LIT> , byte_mode_loop ) ; return true ; } else if ( total_bytes % <NUM_LIT> == <NUM_LIT> ) { dst_end = expand_binop ( Pmode , add_optab , dst_base_reg , size , NULL_RTX , <NUM_LIT> , OPTAB_WIDEN ) ; emit_move_insn ( dst_itr , dst_base_reg ) ; emit_move_insn ( src_itr , src_base_reg ) ; emit_label ( double_word_mode_loop ) ; src_itr_m = src_itr ; dst_itr_m = dst_itr ; srcmem_m = srcmem ; dstmem_m = dstmem ;


<s> else start_regno = <NUM_LIT> ; dst_itr = gen_reg_rtx ( Pmode ) ; src_itr = gen_reg_rtx ( Pmode ) ; dst_end = gen_reg_rtx ( Pmode ) ; tmp = gen_reg_rtx ( QImode ) ; double_word_mode_loop = gen_label_rtx ( ) ; byte_mode_loop = gen_label_rtx ( ) ; dst_base_reg = copy_to_mode_reg ( Pmode , XEXP ( dstmem , <NUM_LIT> ) ) ; src_base_reg = copy_to_mode_reg ( Pmode , XEXP ( srcmem , <NUM_LIT> ) ) ; if ( total_bytes < <NUM_LIT> ) { dst_end = expand_binop ( Pmode , add_optab , dst_base_reg , size , NULL_RTX , <NUM_LIT> , OPTAB_WIDEN ) ; emit_move_insn ( dst_itr , dst_base_reg ) ; emit_move_insn ( src_itr , src_base_reg ) ; emit_label ( byte_mode_loop ) ; nds32_emit_post_inc_load_store ( tmp , src_itr , QImode , true ) ;

nds32_emit_post_inc_load_store ( tmp , dst_itr , QImode , false ) ;


<s> int start_regno ; bool align_to_4_bytes = ( INTVAL ( alignment ) & <NUM_LIT> ) == <NUM_LIT> ; if ( TARGET_ISA_V3M && ! align_to_4_bytes ) return <NUM_LIT> ; if ( TARGET_REDUCED_REGS ) start_regno = <NUM_LIT> ; else start_regno = <NUM_LIT> ; dst_itr = gen_reg_rtx ( Pmode ) ; src_itr = gen_reg_rtx ( Pmode ) ; dst_end = gen_reg_rtx ( Pmode ) ; tmp = gen_reg_rtx ( QImode ) ; mask_least_3_bit = GEN_INT ( ~ <NUM_LIT> ) ; double_word_mode_loop = gen_label_rtx ( ) ; byte_mode_entry = gen_label_rtx ( ) ; byte_mode_loop = gen_label_rtx ( ) ; end_label = gen_label_rtx ( ) ; dst_base_reg = copy_to_mode_reg ( Pmode , XEXP ( dstmem , <NUM_LIT> ) ) ; src_base_reg = copy_to_mode_reg ( Pmode , XEXP ( srcmem , <NUM_LIT> ) ) ; size_least_3_bit = expand_binop ( SImode , and_optab , size , mask_least_3_bit , NULL_RTX , <NUM_LIT> , OPTAB_WIDEN ) ; dst_end = expand_binop ( Pmode , add_optab , dst_base_reg , size , NULL_RTX , <NUM_LIT> , OPTAB_WIDEN ) ; emit_move_insn ( dst_itr , dst_base_reg ) ; emit_move_insn ( src_itr , src_base_reg ) ; emit_cmp_and_jump_insns ( size_least_3_bit , const0_rtx , EQ , NULL , SImode , <NUM_LIT> , byte_mode_entry ) ; double_word_end = expand_binop ( Pmode , add_optab , dst_base_reg , size_least_3_bit , NULL_RTX , <NUM_LIT> , OPTAB_WIDEN ) ; emit_label ( double_word_mode_loop ) ; src_itr_m = src_itr ; dst_itr_m = dst_itr ;


<s> src_base_reg = copy_to_mode_reg ( SImode , XEXP ( srcmem , <NUM_LIT> ) ) ; remain_bytes = INTVAL ( total_bytes ) ; inst_num = ( ( INTVAL ( total_bytes ) + ( maximum_bytes_per_inst - <NUM_LIT> ) ) / maximum_bytes_per_inst ) - <NUM_LIT> ; for ( i = <NUM_LIT> ; i < inst_num ; i ++ ) { nds32_emit_mem_move_block ( start_regno , maximum_regs , & dst_base_reg , & dstmem , & src_base_reg , & srcmem , true ) ; } remain_bytes -= maximum_bytes_per_inst * inst_num ; remain_words = remain_bytes / UNITS_PER_WORD ; remain_bytes = remain_bytes - ( remain_words * UNITS_PER_WORD ) ; if ( remain_words != <NUM_LIT> ) { if ( remain_bytes != <NUM_LIT> ) nds32_emit_mem_move_block ( start_regno , remain_words , & dst_base_reg , & dstmem , & src_base_reg , & srcmem , true ) ; else { if ( remain_words == <NUM_LIT> ) { if ( align_to_4_bytes ) nds32_emit_mem_move ( srcmem , dstmem , SImode , <NUM_LIT> ) ; else { tmp_reg = gen_reg_rtx ( SImode ) ; emit_insn ( gen_unaligned_load_w ( tmp_reg , gen_rtx_MEM ( SImode , src_base_reg ) ) ) ; emit_insn ( gen_unaligned_store_w ( gen_rtx_MEM ( SImode , dst_base_reg ) , tmp_reg ) ) ; } } else nds32_emit_mem_move_block ( start_regno , remain_words , & dst_base_reg , & dstmem , & src_base_reg , & srcmem , false ) ; } } switch ( remain_bytes ) { case <NUM_LIT> : case <NUM_LIT> : { if ( align_to_2_bytes ) nds32_emit_mem_move ( srcmem , dstmem , HImode , <NUM_LIT> ) ; else { nds32_emit_mem_move ( srcmem , dstmem , QImode , <NUM_LIT> ) ; nds32_emit_mem_move ( srcmem , dstmem , QImode , <NUM_LIT> ) ; } if ( remain_bytes == <NUM_LIT> ) nds32_emit_mem_move ( srcmem , dstmem , QImode , <NUM_LIT> ) ; break ; }


<s> * update_base_reg = gen_reg_rtx ( SImode ) ; return gen_unaligned_load_update_base_w ( * update_base_reg , reg , base_addr ) ; } else return gen_unaligned_load_w ( reg , gen_rtx_MEM ( SImode , base_addr ) ) ; } if ( update_base_reg_p ) { result = gen_rtx_PARALLEL ( VOIDmode , rtvec_alloc ( count + <NUM_LIT> ) ) ; start_idx = <NUM_LIT> ; } else { result = gen_rtx_PARALLEL ( VOIDmode , rtvec_alloc ( count ) ) ; start_idx = <NUM_LIT> ; } if ( update_base_reg_p ) { offset = count * <NUM_LIT> ; new_addr = plus_constant ( Pmode , base_addr , offset ) ; * update_base_reg = gen_reg_rtx ( SImode ) ; XVECEXP ( result , <NUM_LIT> , <NUM_LIT> ) = gen_rtx_SET ( * update_base_reg , new_addr ) ; } for ( par_index = <NUM_LIT> ; par_index < count ; par_index ++ ) { offset = par_index * <NUM_LIT> ; new_addr = plus_constant ( Pmode , base_addr , offset ) ; mem = adjust_automodify_address_nv ( basemem , SImode , new_addr , offset ) ; reg = gen_rtx_REG ( SImode , base_regno + par_index ) ; XVECEXP ( result , <NUM_LIT> , ( par_index + start_idx ) ) = gen_rtx_SET ( reg , mem ) ; } return result ;


<s> if ( optimize_size || optimize < <NUM_LIT> ) return false ; if ( TARGET_ISA_V3M && ! align_to_4_bytes ) return nds32_expand_setmem_loop_v3m ( dstmem , size , value ) ;

if ( nds32_expand_setmem_unroll ( dstmem , size , value , align , expected_align , expected_size ) ) return true ;


<s> if ( nds32_expand_setmem_unroll ( dstmem , size , value , align , expected_align , expected_size ) ) return true ;

return nds32_expand_setmem_loop ( dstmem , size , value ) ;


value4byte = simplify_gen_subreg ( QImode , value4doubleword , DImode , subreg_lowpart_offset ( QImode , DImode ) ) ;


<s> unsigned maximum_regs , maximum_bytes , start_regno , regno ; rtx value4word ; rtx dst_base_reg , new_base_reg ; unsigned HOST_WIDE_INT remain_bytes , remain_words , prepare_regs , fill_per_smw ; unsigned HOST_WIDE_INT real_size ; if ( TARGET_REDUCED_REGS ) { maximum_regs = <NUM_LIT> ; maximum_bytes = <NUM_LIT> ; start_regno = <NUM_LIT> ; } else { maximum_regs = <NUM_LIT> ; maximum_bytes = <NUM_LIT> ; start_regno = <NUM_LIT> ; } real_size = UINTVAL ( size ) & GET_MODE_MASK ( SImode ) ; if ( ! ( CONST_INT_P ( size ) && real_size <= maximum_bytes ) ) return false ; remain_bytes = real_size ; gcc_assert ( GET_MODE ( value ) == QImode || CONST_INT_P ( value ) ) ; value4word = nds32_gen_dup_4_byte_to_word_value ( value ) ; prepare_regs = remain_bytes / UNITS_PER_WORD ; dst_base_reg = copy_to_mode_reg ( SImode , XEXP ( dstmem , <NUM_LIT> ) ) ; if ( prepare_regs > maximum_regs ) prepare_regs = maximum_regs ; fill_per_smw = prepare_regs * UNITS_PER_WORD ; regno = start_regno ; switch ( prepare_regs ) { case <NUM_LIT> : default : { rtx reg0 = gen_rtx_REG ( SImode , regno ) ; rtx reg1 = gen_rtx_REG ( SImode , regno + <NUM_LIT> ) ; unsigned last_regno = start_regno + prepare_regs - <NUM_LIT> ; emit_move_insn ( reg0 , value4word ) ; emit_move_insn ( reg1 , value4word ) ; rtx regd = gen_rtx_REG ( DImode , regno ) ; regno += <NUM_LIT> ; while ( regno <= last_regno ) { if ( ( regno + <NUM_LIT> ) <= last_regno ) { rtx reg = gen_rtx_REG ( DImode , regno ) ; emit_move_insn ( reg , regd ) ; regno += <NUM_LIT> ; } else { rtx reg = gen_rtx_REG ( SImode , regno ) ; emit_move_insn ( reg , reg0 ) ; regno += <NUM_LIT> ; } } break ; } case <NUM_LIT> : { rtx reg = gen_rtx_REG ( SImode , regno ++ ) ; emit_move_insn ( reg , value4word ) ; } break ; case <NUM_LIT> : break ; } if ( fill_per_smw ) for ( ; remain_bytes >= fill_per_smw ; remain_bytes -= fill_per_smw ) { emit_insn ( nds32_expand_store_multiple ( start_regno , prepare_regs , dst_base_reg , dstmem , true , & new_base_reg ) ) ; dst_base_reg = new_base_reg ; dstmem = gen_rtx_MEM ( SImode , dst_base_reg ) ; } remain_words = remain_bytes / UNITS_PER_WORD ; if ( remain_words ) { emit_insn ( nds32_expand_store_multiple ( start_regno , remain_words , dst_base_reg , dstmem , true , & new_base_reg ) ) ; dst_base_reg = new_base_reg ;


<s> } if ( update_base_reg_p ) { offset = count * <NUM_LIT> ; new_addr = plus_constant ( Pmode , base_addr , offset ) ; * update_base_reg = gen_reg_rtx ( SImode ) ; XVECEXP ( result , <NUM_LIT> , <NUM_LIT> ) = gen_rtx_SET ( * update_base_reg , new_addr ) ; } for ( par_index = <NUM_LIT> ; par_index < count ; par_index ++ ) { offset = par_index * <NUM_LIT> ; new_addr = plus_constant ( Pmode , base_addr , offset ) ; mem = adjust_automodify_address_nv ( basemem , SImode , new_addr , offset ) ; reg = gen_rtx_REG ( SImode , base_regno + par_index ) ; XVECEXP ( result , <NUM_LIT> , par_index + start_idx ) = gen_rtx_SET ( mem , reg ) ; } return result ;


<s> rtx loop_label , tmp ; if ( optimize_size || optimize < <NUM_LIT> ) return false ; gcc_assert ( MEM_P ( str ) ) ; gcc_assert ( CONST_INT_P ( target_char ) || REG_P ( target_char ) ) ; base_reg = copy_to_mode_reg ( SImode , XEXP ( str , <NUM_LIT> ) ) ; loop_label = gen_label_rtx ( ) ; ffb_result = gen_reg_rtx ( Pmode ) ; tmp = gen_reg_rtx ( SImode ) ; backup_base_reg = gen_reg_rtx ( SImode ) ; emit_move_insn ( backup_base_reg , base_reg ) ; emit_label ( loop_label ) ; emit_insn ( gen_unaligned_load_update_base_w ( base_reg , tmp , base_reg ) ) ; emit_insn ( gen_unspec_ffb ( ffb_result , tmp , target_char ) ) ; emit_cmp_and_jump_insns ( ffb_result , const0_rtx , EQ , NULL , SImode , <NUM_LIT> , loop_label ) ; target_char_ptr = expand_binop ( Pmode , add_optab , base_reg , ffb_result , NULL_RTX , <NUM_LIT> , OPTAB_WIDEN ) ; length = expand_binop ( Pmode , sub_optab , target_char_ptr , backup_base_reg , NULL_RTX , <NUM_LIT> , OPTAB_WIDEN ) ;


<s> rtx value4word = gen_reg_rtx ( SImode ) ; nds32_gen_dup_4_byte_to_word_value_aux ( value , value4word ) ; return value4word ;


<s> emit_move_insn ( value4word , new_val ) ; } else { if ( NDS32_EXT_DSP_P ( ) ) { rtx tmp = gen_reg_rtx ( SImode ) ; convert_move ( tmp , value , true ) ; emit_insn ( gen_insvsi_internal ( tmp , gen_int_mode ( <NUM_LIT> , SImode ) , tmp ) ) ; emit_insn ( gen_pkbbsi_1 ( value4word , tmp , tmp ) ) ; } else { rtx tmp1 , tmp2 , tmp3 , tmp4 ; tmp1 = expand_binop ( SImode , and_optab , value , gen_int_mode ( <NUM_LIT> , SImode ) , NULL_RTX , <NUM_LIT> , OPTAB_WIDEN ) ; tmp2 = expand_binop ( SImode , ashl_optab , tmp1 , gen_int_mode ( <NUM_LIT> , SImode ) , NULL_RTX , <NUM_LIT> , OPTAB_WIDEN ) ; tmp3 = expand_binop ( SImode , ior_optab , tmp1 , tmp2 , NULL_RTX , <NUM_LIT> , OPTAB_WIDEN ) ; tmp4 = expand_binop ( SImode , ashl_optab , tmp3 , gen_int_mode ( <NUM_LIT> , SImode ) , NULL_RTX , <NUM_LIT> , OPTAB_WIDEN ) ; emit_insn ( gen_iorsi3 ( value4word , tmp3 , tmp4 ) ) ; } } return value4word ;


<s> gcc_assert ( GET_MODE ( value ) == QImode || CONST_INT_P ( value ) ) ; if ( CONST_INT_P ( value ) ) { unsigned HOST_WIDE_INT val = UINTVAL ( value ) & GET_MODE_MASK ( QImode ) ; rtx new_val = gen_int_mode ( val | ( val << <NUM_LIT> ) | ( val << <NUM_LIT> ) | ( val << <NUM_LIT> ) , SImode ) ; emit_move_insn ( value4word , new_val ) ; } else { if ( NDS32_EXT_DSP_P ( ) ) { rtx tmp = gen_reg_rtx ( SImode ) ; convert_move ( tmp , value , true ) ; emit_insn ( gen_insvsi_internal ( tmp , gen_int_mode ( <NUM_LIT> , SImode ) , tmp ) ) ; emit_insn ( gen_pkbbsi_1 ( value4word , tmp , tmp ) ) ; }


<s> rtx value4doubleword = gen_reg_rtx ( DImode ) ; nds32_gen_dup_4_byte_to_word_value_aux ( value , nds32_di_low_part_subreg ( value4doubleword ) ) ; emit_move_insn ( nds32_di_high_part_subreg ( value4doubleword ) , nds32_di_low_part_subreg ( value4doubleword ) ) ;


nds32_gen_dup_4_byte_to_word_value_aux ( value , nds32_di_low_part_subreg ( value4doubleword ) ) ;


<s> else use_rtx = extract_mem_rtx ( consumer ) ; break ; case TYPE_STORE : if ( post_update_insn_p ( consumer ) ) use_rtx = extract_base_reg ( consumer ) ; else use_rtx = extract_mem_rtx ( consumer ) ; if ( reg_overlap_p ( def_reg , use_rtx ) ) return true ; if ( ! post_update_insn_p ( consumer ) && ! immed_offset_p ( extract_mem_rtx ( consumer ) ) ) return false ; use_rtx = SET_SRC ( PATTERN ( consumer ) ) ; break ; case TYPE_LOAD_MULTIPLE : use_rtx = extract_base_reg ( consumer ) ; break ; case TYPE_STORE_MULTIPLE : use_rtx = extract_base_reg ( consumer ) ; if ( reg_overlap_p ( def_reg , use_rtx ) ) return true ; use_rtx = extract_nth_access_rtx ( consumer , <NUM_LIT> ) ; break ; case TYPE_BRANCH : use_rtx = PATTERN ( consumer ) ; break ;


<s> use_rtx = SET_SRC ( PATTERN ( consumer ) ) ; break ; case TYPE_MAC : use_rtx = extract_mac_non_acc_rtx ( consumer ) ; break ; case TYPE_DIV : if ( INSN_CODE ( consumer ) == CODE_FOR_divmodsi4 || INSN_CODE ( consumer ) == CODE_FOR_udivmodsi4 ) use_rtx = SET_SRC ( parallel_element ( consumer , <NUM_LIT> ) ) ; else use_rtx = SET_SRC ( PATTERN ( consumer ) ) ; break ; case TYPE_BRANCH : use_rtx = extract_branch_condition_rtx ( consumer ) ; break ; case TYPE_STORE : if ( ! post_update_insn_p ( consumer ) && ! immed_offset_p ( extract_mem_rtx ( consumer ) ) ) return false ; use_rtx = SET_SRC ( PATTERN ( consumer ) ) ; break ; case TYPE_STORE_MULTIPLE : use_rtx = extract_nth_access_rtx ( consumer , <NUM_LIT> ) ; break ;


<s> case TYPE_MUL : use_rtx = SET_SRC ( PATTERN ( consumer ) ) ; break ; case TYPE_MAC : use_rtx = extract_mac_non_acc_rtx ( consumer ) ; break ; case TYPE_DIV : if ( INSN_CODE ( consumer ) == CODE_FOR_divmodsi4 || INSN_CODE ( consumer ) == CODE_FOR_udivmodsi4 ) use_rtx = SET_SRC ( parallel_element ( consumer , <NUM_LIT> ) ) ; else use_rtx = SET_SRC ( PATTERN ( consumer ) ) ; break ; case TYPE_BRANCH : use_rtx = extract_branch_condition_rtx ( consumer ) ; break ; case TYPE_STORE : if ( ! post_update_insn_p ( consumer ) && ! immed_offset_p ( extract_mem_rtx ( consumer ) ) ) return false ; use_rtx = SET_SRC ( PATTERN ( consumer ) ) ; break ; case TYPE_STORE_MULTIPLE : use_rtx = extract_nth_access_rtx ( consumer , <NUM_LIT> ) ; break ; default :


<s> if ( GET_CODE ( PATTERN ( consumer ) ) == SET ) use_rtx = SET_SRC ( PATTERN ( consumer ) ) ; else return true ; break ; case TYPE_LOAD : if ( post_update_insn_p ( consumer ) ) use_rtx = extract_base_reg ( consumer ) ; else use_rtx = extract_mem_rtx ( consumer ) ; break ; case TYPE_STORE : if ( post_update_insn_p ( consumer ) ) use_rtx = extract_base_reg ( consumer ) ; else use_rtx = extract_mem_rtx ( consumer ) ; if ( reg_overlap_p ( def_reg , use_rtx ) ) return true ; if ( ! post_update_insn_p ( consumer ) && ! immed_offset_p ( extract_mem_rtx ( consumer ) ) ) return false ; use_rtx = SET_SRC ( PATTERN ( consumer ) ) ; break ;


<s> use_rtx = extract_mac_non_acc_rtx ( consumer ) ; break ; case TYPE_DIV : if ( INSN_CODE ( consumer ) == CODE_FOR_divmodsi4 || INSN_CODE ( consumer ) == CODE_FOR_udivmodsi4 ) use_rtx = SET_SRC ( parallel_element ( consumer , <NUM_LIT> ) ) ; else use_rtx = SET_SRC ( PATTERN ( consumer ) ) ; break ; case TYPE_MMU : if ( GET_CODE ( PATTERN ( consumer ) ) == SET ) use_rtx = SET_SRC ( PATTERN ( consumer ) ) ; else return true ; break ; case TYPE_LOAD : case TYPE_STORE : use_rtx = extract_mem_rtx ( consumer ) ; break ; case TYPE_LOAD_MULTIPLE : case TYPE_STORE_MULTIPLE : use_rtx = extract_base_reg ( consumer ) ; break ; case TYPE_BRANCH : use_rtx = PATTERN ( consumer ) ; break ; default :


<s> return ( e8_consumed_by_addr_in_p ( consumer , def_reg1 ) || e8_consumed_by_addr_in_p ( consumer , def_reg2 ) ) ; } def_reg = SET_DEST ( PATTERN ( producer ) ) ; break ; case TYPE_LOAD : case TYPE_STORE : case TYPE_LOAD_MULTIPLE : case TYPE_STORE_MULTIPLE : if ( ! post_update_insn_p ( producer ) ) return false ; def_reg = extract_base_reg ( producer ) ; break ; default : gcc_unreachable ( ) ; } return e8_consumed_by_addr_in_p ( consumer , def_reg ) ;


<s> bool nds32_n8_ex_to_ii_p ( rtx_insn * producer , rtx_insn * consumer ) { rtx def_reg ; switch ( get_attr_type ( producer ) ) { case TYPE_ALU : if ( movd44_insn_p ( producer ) ) def_reg = extract_movd44_odd_reg ( producer ) ; else def_reg = SET_DEST ( PATTERN ( producer ) ) ; break ; case TYPE_MUL : case TYPE_MAC : def_reg = SET_DEST ( PATTERN ( producer ) ) ; break ; case TYPE_DIV : if ( INSN_CODE ( producer ) == CODE_FOR_divmodsi4 || INSN_CODE ( producer ) == CODE_FOR_udivmodsi4 ) def_reg = SET_DEST ( parallel_element ( producer , <NUM_LIT> ) ) ; else def_reg = SET_DEST ( PATTERN ( producer ) ) ; break ; case TYPE_LOAD : case TYPE_STORE : case TYPE_LOAD_MULTIPLE : case TYPE_STORE_MULTIPLE :

if ( ! post_update_insn_p ( producer ) ) return false ;


<s> case TYPE_ALU : if ( movd44_insn_p ( producer ) ) def_reg = extract_movd44_odd_reg ( producer ) ; else def_reg = SET_DEST ( PATTERN ( producer ) ) ; break ; case TYPE_MUL : case TYPE_MAC : def_reg = SET_DEST ( PATTERN ( producer ) ) ; break ; case TYPE_DIV : if ( INSN_CODE ( producer ) == CODE_FOR_divmodsi4 || INSN_CODE ( producer ) == CODE_FOR_udivmodsi4 ) def_reg = SET_DEST ( parallel_element ( producer , <NUM_LIT> ) ) ; else def_reg = SET_DEST ( PATTERN ( producer ) ) ; break ;


<s> if ( INSN_CODE ( producer ) == CODE_FOR_divmodsi4 || INSN_CODE ( producer ) == CODE_FOR_udivmodsi4 ) { rtx def_reg1 = SET_DEST ( parallel_element ( producer , <NUM_LIT> ) ) ; rtx def_reg2 = SET_DEST ( parallel_element ( producer , <NUM_LIT> ) ) ; return ( n9_3r2w_consumed_by_ex_dep_p ( consumer , def_reg1 ) || n9_3r2w_consumed_by_ex_dep_p ( consumer , def_reg2 ) ) ;


<s> } if ( GET_CODE ( reg1_1 ) == NOT ) { if ( rtx_equal_p ( reg1_1 , reg2_0 ) ) return reg_overlap_p ( def_reg , reg1_0 ) || reg_overlap_p ( def_reg , reg2_1 ) ; if ( rtx_equal_p ( reg1_1 , reg2_1 ) ) return reg_overlap_p ( def_reg , reg1_0 ) || reg_overlap_p ( def_reg , reg2_0 ) ; } if ( GET_CODE ( reg2_0 ) == NOT ) { if ( rtx_equal_p ( reg2_0 , reg1_0 ) ) return reg_overlap_p ( def_reg , reg2_1 ) || reg_overlap_p ( def_reg , reg1_1 ) ;


<s> case TYPE_LOAD_MULTIPLE : gcc_assert ( parallel_elements ( insn ) >= <NUM_LIT> ) ; post_update_rtx_index = find_post_update_rtx ( insn ) ; if ( post_update_rtx_index != - <NUM_LIT> ) plus_rtx = SET_SRC ( parallel_element ( insn , post_update_rtx_index ) ) ; else { mem_rtx = SET_SRC ( parallel_element ( insn , <NUM_LIT> ) ) ; if ( GET_CODE ( mem_rtx ) == UNSPEC ) mem_rtx = XVECEXP ( mem_rtx , <NUM_LIT> , <NUM_LIT> ) ; gcc_assert ( MEM_P ( mem_rtx ) ) ; plus_rtx = XEXP ( mem_rtx , <NUM_LIT> ) ; } break ; case TYPE_STORE_MULTIPLE : gcc_assert ( parallel_elements ( insn ) >= <NUM_LIT> ) ; post_update_rtx_index = find_post_update_rtx ( insn ) ; if ( post_update_rtx_index != - <NUM_LIT> ) plus_rtx = SET_SRC ( parallel_element ( insn , post_update_rtx_index ) ) ; else { mem_rtx = SET_DEST ( parallel_element ( insn , <NUM_LIT> ) ) ; if ( GET_CODE ( mem_rtx ) == UNSPEC ) mem_rtx = XVECEXP ( mem_rtx , <NUM_LIT> , <NUM_LIT> ) ; gcc_assert ( MEM_P ( mem_rtx ) ) ; plus_rtx = XEXP ( mem_rtx , <NUM_LIT> ) ; } break ; case TYPE_LOAD : case TYPE_STORE : mem_rtx = extract_mem_rtx ( insn ) ; switch ( GET_CODE ( XEXP ( mem_rtx , <NUM_LIT> ) ) ) { case POST_INC : return MEM_ACCESS_DIR_POS ; case POST_DEC : return MEM_ACCESS_DIR_NEG ; case PLUS : plus_rtx = XEXP ( mem_rtx , <NUM_LIT> ) ; break ; case POST_MODIFY : plus_rtx = XEXP ( XEXP ( mem_rtx , <NUM_LIT> ) , <NUM_LIT> ) ; break ; default : gcc_unreachable ( ) ;


<s> return n8_consumed_by_addr_in_p ( consumer , def_reg ) ;


<s> bool e8_consumed_by_ex_p ( rtx_insn * consumer , rtx def_reg ) { rtx use_rtx ; switch ( get_attr_type ( consumer ) ) { case TYPE_ALU : case TYPE_STORE : use_rtx = SET_SRC ( PATTERN ( consumer ) ) ; break ; case TYPE_MUL : case TYPE_MAC :


<s> case PARALLEL : return extract_nth_lmsw_access_reg ( insn , index ) ; case SET : return extract_nth_ls2_access_reg ( insn , index ) ; default : gcc_unreachable ( ) ;


<s> rtx extract_nth_access_reg ( rtx_insn * insn , int index ) { switch ( GET_CODE ( PATTERN ( insn ) ) ) {


<s> rtx extract_nth_access_rtx ( rtx_insn * insn , int n ) { int n_elems = parallel_elements ( insn ) ; int post_update_rtx_index = find_post_update_rtx ( insn ) ; memory_access_direction direction = determine_access_direction ( insn ) ; gcc_assert ( direction != MEM_ACCESS_DIR_UNKNOWN ) ;

if ( direction == MEM_ACCESS_DIR_NEG ) n = - <NUM_LIT> * n - <NUM_LIT> ;


<s> memory_access_direction direction = determine_access_direction ( insn ) ; gcc_assert ( direction != MEM_ACCESS_DIR_UNKNOWN ) ; if ( direction == MEM_ACCESS_DIR_NEG ) n = - <NUM_LIT> * n - <NUM_LIT> ; if ( post_update_rtx_index != - <NUM_LIT> ) { if ( n >= <NUM_LIT> && post_update_rtx_index <= n ) ++ n ; else if ( n < <NUM_LIT> && post_update_rtx_index >= n + n_elems ) -- n ; }


<s> rtx nth_rtx = extract_nth_access_rtx ( insn , n ) ; if ( nth_rtx == NULL_RTX ) return NULL_RTX ; switch ( get_attr_type ( insn ) ) { case TYPE_LOAD_MULTIPLE : return SET_DEST ( nth_rtx ) ;


<s> if ( direction == MEM_ACCESS_DIR_NEG ) n = - <NUM_LIT> * n - <NUM_LIT> ; } if ( n < - <NUM_LIT> || n > <NUM_LIT> ) return NULL_RTX ; if ( n < <NUM_LIT> ) n = <NUM_LIT> + n ; switch ( get_attr_type ( insn ) ) { case TYPE_LOAD : reg = SET_DEST ( PATTERN ( insn ) ) ; break ; case TYPE_STORE : reg = SET_SRC ( PATTERN ( insn ) ) ; break ; default : gcc_unreachable ( ) ; }

gcc_assert ( REG_P ( reg ) || GET_CODE ( reg ) == SUBREG ) ;


<s> case TYPE_DPACK : case TYPE_DINSB : case TYPE_DCMP : case TYPE_DCLIP : case TYPE_DALUROUND : use_rtx = SET_SRC ( PATTERN ( consumer ) ) ; break ; case TYPE_ALU_SHIFT : use_rtx = extract_shift_reg ( consumer ) ; break ; case TYPE_PBSADA : return pbsada_insn_ra_rb_dep_reg_p ( consumer , def_reg ) ; case TYPE_MAC : case TYPE_DMAC : use_rtx = extract_mac_non_acc_rtx ( consumer ) ; break ; case TYPE_DIV : if ( divmod_p ( consumer ) ) use_rtx = SET_SRC ( parallel_element ( consumer , <NUM_LIT> ) ) ;

else use_rtx = SET_SRC ( PATTERN ( consumer ) ) ;


<s> if ( REG_P ( def_reg ) ) { return rtx_equal_p ( def_reg , use_rtx ) ; } else if ( GET_CODE ( def_reg ) == SUBREG && GET_MODE ( def_reg ) == SImode && rtx_equal_p ( SUBREG_REG ( def_reg ) , use_rtx ) ) {

if ( TARGET_BIG_ENDIAN && SUBREG_BYTE ( def_reg ) == <NUM_LIT> ) return true ;


<s> rtx use_rtx = SET_SRC ( PATTERN ( insn ) ) ; if ( REG_P ( def_reg ) ) { return rtx_equal_p ( def_reg , use_rtx ) ; } else if ( GET_CODE ( def_reg ) == SUBREG && GET_MODE ( def_reg ) == SImode && rtx_equal_p ( SUBREG_REG ( def_reg ) , use_rtx ) ) { if ( TARGET_BIG_ENDIAN && SUBREG_BYTE ( def_reg ) == <NUM_LIT> ) return true ; if ( ! TARGET_BIG_ENDIAN && SUBREG_BYTE ( def_reg ) == <NUM_LIT> ) return true ; return false ;


<s> case TYPE_ALU_SHIFT : use_rtx = extract_shift_reg ( consumer ) ; break ; case TYPE_PBSADA : return pbsada_insn_ra_rb_dep_reg_p ( consumer , def_reg ) ; case TYPE_MAC : case TYPE_DMAC : use_rtx = extract_mac_non_acc_rtx ( consumer ) ; break ; case TYPE_DIV : if ( divmod_p ( consumer ) ) use_rtx = SET_SRC ( parallel_element ( consumer , <NUM_LIT> ) ) ; else use_rtx = SET_SRC ( PATTERN ( consumer ) ) ; break ; case TYPE_DWEXT : return wext_odd_dep_p ( consumer , def_reg ) ; case TYPE_DBPICK : return bpick_ra_rb_dep_p ( consumer , def_reg ) ; case TYPE_MMU : if ( GET_CODE ( PATTERN ( consumer ) ) == SET ) use_rtx = SET_SRC ( PATTERN ( consumer ) ) ; else return true ; break ; case TYPE_LOAD : case TYPE_STORE :

use_rtx = extract_mem_rtx ( consumer ) ;


<s> gcc_assert ( GET_CODE ( unspec_rtx ) == UNSPEC ) ; operand_ra = XVECEXP ( unspec_rtx , <NUM_LIT> , <NUM_LIT> ) ; operand_rb = XVECEXP ( unspec_rtx , <NUM_LIT> , <NUM_LIT> ) ; if ( rtx_equal_p ( def_reg , operand_ra ) || rtx_equal_p ( def_reg , operand_rb ) ) return true ;


<s> bool n13_alu_e1_insn_dep_reg_p ( rtx_insn * alu_e1_insn , rtx def_reg ) { rtx unspec_rtx , operand_ra , operand_rb ; rtx src_rtx , dst_rtx ; switch ( INSN_CODE ( alu_e1_insn ) ) { case CODE_FOR_unspec_bsp : case CODE_FOR_unspec_bse : unspec_rtx = SET_SRC ( parallel_element ( alu_e1_insn , <NUM_LIT> ) ) ; gcc_assert ( GET_CODE ( unspec_rtx ) == UNSPEC ) ; operand_ra = XVECEXP ( unspec_rtx , <NUM_LIT> , <NUM_LIT> ) ; operand_rb = XVECEXP ( unspec_rtx , <NUM_LIT> , <NUM_LIT> ) ; if ( rtx_equal_p ( def_reg , operand_ra ) || rtx_equal_p ( def_reg , operand_rb ) ) return true ; return false ; case CODE_FOR_move_di : case CODE_FOR_move_df : src_rtx = SET_SRC ( PATTERN ( alu_e1_insn ) ) ; dst_rtx = SET_DEST ( PATTERN ( alu_e1_insn ) ) ; if ( REG_P ( dst_rtx ) && REG_P ( src_rtx ) && rtx_equal_p ( src_rtx , def_reg ) ) return true ; return false ; default : return false ;


<s> use_rtx = SET_SRC ( PATTERN ( consumer ) ) ; break ; case TYPE_MAC : use_rtx = extract_mac_non_acc_rtx ( consumer ) ; break ; case TYPE_DIV : if ( divmod_p ( consumer ) ) use_rtx = SET_SRC ( parallel_element ( consumer , <NUM_LIT> ) ) ; else use_rtx = SET_SRC ( PATTERN ( consumer ) ) ; break ; case TYPE_MMU : if ( GET_CODE ( PATTERN ( consumer ) ) == SET ) use_rtx = SET_SRC ( PATTERN ( consumer ) ) ; else return true ; break ;


<s> case TYPE_DIV : if ( divmod_p ( consumer ) ) use_rtx = SET_SRC ( parallel_element ( consumer , <NUM_LIT> ) ) ; else use_rtx = SET_SRC ( PATTERN ( consumer ) ) ; break ; case TYPE_MMU : if ( GET_CODE ( PATTERN ( consumer ) ) == SET ) use_rtx = SET_SRC ( PATTERN ( consumer ) ) ; else return true ; break ; case TYPE_BRANCH :

use_rtx = extract_branch_target_rtx ( consumer ) ;


<s> bool n13_consumed_by_e2_dep_p ( rtx_insn * consumer , rtx def_reg ) { rtx use_rtx ; switch ( get_attr_type ( consumer ) ) { case TYPE_ALU : case TYPE_STORE : use_rtx = SET_SRC ( PATTERN ( consumer ) ) ; break ; case TYPE_ALU_SHIFT : use_rtx = extract_shift_reg ( consumer ) ; break ; case TYPE_PBSADA : return pbsada_insn_rt_dep_reg_p ( consumer , def_reg ) ; case TYPE_STORE_MULTIPLE : use_rtx = extract_nth_access_rtx ( consumer , <NUM_LIT> ) ; break ; case TYPE_BRANCH : use_rtx = extract_branch_condition_rtx ( consumer ) ; break ; default :


<s> if ( post_update_insn_p ( consumer ) ) use_rtx = extract_base_reg ( consumer ) ; else use_rtx = extract_mem_rtx ( consumer ) ; break ; case TYPE_STORE : if ( post_update_insn_p ( consumer ) ) use_rtx = extract_base_reg ( consumer ) ; else use_rtx = extract_mem_rtx ( consumer ) ; if ( reg_overlap_p ( def_reg , use_rtx ) ) return true ; if ( ! post_update_insn_p ( consumer ) && ! immed_offset_p ( extract_mem_rtx ( consumer ) ) ) return false ; use_rtx = SET_SRC ( PATTERN ( consumer ) ) ; break ; case TYPE_LOAD_MULTIPLE :


<s> break ; case TYPE_LOAD : if ( load_single_p ( consumer ) ) use_rtx = extract_mem_rtx ( consumer ) ; else use_rtx = extract_base_reg ( consumer ) ; break ; case TYPE_STORE : if ( store_single_p ( consumer ) && ( ! post_update_insn_p ( consumer ) || immed_offset_p ( extract_mem_rtx ( consumer ) ) ) ) use_rtx = extract_mem_rtx ( consumer ) ; else use_rtx = extract_base_reg ( consumer ) ; break ; case TYPE_LOAD_MULTIPLE : case TYPE_STORE_MULTIPLE : use_rtx = extract_base_reg ( consumer ) ;


<s> case TYPE_STORE : if ( post_update_insn_p ( consumer ) ) use_rtx = extract_base_reg ( consumer ) ; else use_rtx = extract_mem_rtx ( consumer ) ; if ( reg_overlap_p ( def_reg , use_rtx ) ) return true ; if ( ! post_update_insn_p ( consumer ) && ! immed_offset_p ( extract_mem_rtx ( consumer ) ) ) return false ; use_rtx = SET_SRC ( PATTERN ( consumer ) ) ; break ; case TYPE_LOAD_MULTIPLE : use_rtx = extract_base_reg ( consumer ) ; break ; case TYPE_STORE_MULTIPLE : use_rtx = extract_base_reg ( consumer ) ; if ( reg_overlap_p ( def_reg , use_rtx ) ) return true ; use_rtx = extract_nth_access_rtx ( consumer , <NUM_LIT> ) ; break ; case TYPE_BRANCH : use_rtx = PATTERN ( consumer ) ; break ; default : gcc_unreachable ( ) ; }


<s> if ( ( REG_P ( dest ) || GET_CODE ( dest ) == SUBREG ) && ( GET_CODE ( src ) == CONST_INT || GET_CODE ( src ) == HIGH ) ) return false ; } def_reg = SET_DEST ( PATTERN ( producer ) ) ; break ; case TYPE_MUL : case TYPE_MAC : def_reg = SET_DEST ( PATTERN ( producer ) ) ; break ; case TYPE_DIV : if ( divmod_p ( producer ) ) { rtx def_reg1 = SET_DEST ( parallel_element ( producer , <NUM_LIT> ) ) ; rtx def_reg2 = SET_DEST ( parallel_element ( producer , <NUM_LIT> ) ) ; return ( e8_consumed_by_addr_in_p ( consumer , def_reg1 ) || e8_consumed_by_addr_in_p ( consumer , def_reg2 ) ) ; } def_reg = SET_DEST ( PATTERN ( producer ) ) ;


<s> if ( last_def_reg == NULL_RTX ) return false ; gcc_assert ( REG_P ( last_def_reg ) || GET_CODE ( last_def_reg ) == SUBREG ) ; return e8_consumed_by_ex_p ( consumer , last_def_reg ) ;


<s> bool nds32_e8_last_load_to_ex_p ( rtx_insn * producer , rtx_insn * consumer ) { rtx last_def_reg = extract_nth_access_reg ( producer , - <NUM_LIT> ) ; if ( last_def_reg == NULL_RTX ) return false ; gcc_assert ( REG_P ( last_def_reg ) || GET_CODE ( last_def_reg ) == SUBREG ) ; return e8_consumed_by_ex_p ( consumer , last_def_reg ) ;


<s> if ( last_def_reg == NULL_RTX ) return false ;

gcc_assert ( REG_P ( last_def_reg ) || GET_CODE ( last_def_reg ) == SUBREG ) ;


<s> gcc_assert ( REG_P ( last_def_reg ) || GET_CODE ( last_def_reg ) == SUBREG ) ;

return e8_consumed_by_addr_in_p ( consumer , last_def_reg ) ;


<s> bool nds32_e8_load_to_ex_p ( rtx_insn * producer , rtx_insn * consumer ) { rtx def_reg = SET_DEST ( PATTERN ( producer ) ) ; return e8_consumed_by_ex_p ( consumer , def_reg ) ;


<s> rtx def_reg = SET_DEST ( PATTERN ( producer ) ) ;

return e8_consumed_by_ex_p ( consumer , def_reg ) ;


<s> bool nds32_e8_load_to_ii_p ( rtx_insn * producer , rtx_insn * consumer ) {

rtx def_reg = SET_DEST ( PATTERN ( producer ) ) ;


<s> return nds32_n10_ex_to_ex_p ( producer , consumer ) ;


<s> bool nds32_gw_last_load_to_ex_p ( rtx_insn * producer , rtx_insn * consumer ) { rtx last_def_reg = extract_nth_access_reg ( producer , - <NUM_LIT> ) ;

return gw_consumed_by_ex_dep_p ( consumer , last_def_reg ) ;


<s> rtx last_def_reg = extract_nth_access_reg ( producer , - <NUM_LIT> ) ;


<s> case TYPE_DMAC : case TYPE_DALUROUND : case TYPE_DBPICK : case TYPE_DWEXT : def_reg = SET_DEST ( PATTERN ( producer ) ) ; break ; case TYPE_DIV : if ( divmod_p ( producer ) ) { rtx def_reg1 = SET_DEST ( parallel_element ( producer , <NUM_LIT> ) ) ; rtx def_reg2 = SET_DEST ( parallel_element ( producer , <NUM_LIT> ) ) ; return ( gw_consumed_by_ex_dep_p ( consumer , def_reg1 ) || gw_consumed_by_ex_dep_p ( consumer , def_reg2 ) ) ; } def_reg = SET_DEST ( PATTERN ( producer ) ) ; break ; default :


<s> if ( ! post_update_insn_p ( producer ) ) return false ;

return reg_overlap_p ( extract_base_reg ( producer ) , extract_mem_rtx ( consumer ) ) ;


<s> if ( divmod_p ( producer ) ) { rtx def_reg1 = SET_DEST ( parallel_element ( producer , <NUM_LIT> ) ) ; rtx def_reg2 = SET_DEST ( parallel_element ( producer , <NUM_LIT> ) ) ; return ( n10_consumed_by_ex_dep_p ( consumer , def_reg1 ) || n10_consumed_by_ex_dep_p ( consumer , def_reg2 ) ) ; } def_reg = SET_DEST ( PATTERN ( producer ) ) ; break ; default : gcc_unreachable ( ) ; } return n10_consumed_by_ex_dep_p ( consumer , def_reg ) ;


<s> case TYPE_DWEXT : def_reg = SET_DEST ( PATTERN ( producer ) ) ; break ; case TYPE_DIV : if ( divmod_p ( producer ) ) { rtx def_reg1 = SET_DEST ( parallel_element ( producer , <NUM_LIT> ) ) ; rtx def_reg2 = SET_DEST ( parallel_element ( producer , <NUM_LIT> ) ) ; return ( n10_consumed_by_ex_dep_p ( consumer , def_reg1 ) || n10_consumed_by_ex_dep_p ( consumer , def_reg2 ) ) ; } def_reg = SET_DEST ( PATTERN ( producer ) ) ; break ; default : gcc_unreachable ( ) ;


<s> rtx def_reg1 = SET_DEST ( parallel_element ( producer , <NUM_LIT> ) ) ; rtx def_reg2 = SET_DEST ( parallel_element ( producer , <NUM_LIT> ) ) ; return ( n13_consumed_by_e1_dep_p ( consumer , def_reg1 ) || n13_consumed_by_e1_dep_p ( consumer , def_reg2 ) ) ; } def_reg = SET_DEST ( PATTERN ( producer ) ) ; break ; default : gcc_unreachable ( ) ;


<s> if ( divmod_p ( producer ) ) { rtx def_reg1 = SET_DEST ( parallel_element ( producer , <NUM_LIT> ) ) ; rtx def_reg2 = SET_DEST ( parallel_element ( producer , <NUM_LIT> ) ) ; return ( n13_consumed_by_e1_dep_p ( consumer , def_reg1 ) || n13_consumed_by_e1_dep_p ( consumer , def_reg2 ) ) ; } def_reg = SET_DEST ( PATTERN ( producer ) ) ; break ;


<s> bool nds32_n13_last_load_to_e1_p ( rtx_insn * producer , rtx_insn * consumer ) { rtx last_def_reg = extract_nth_access_reg ( producer , - <NUM_LIT> ) ; return n13_consumed_by_e1_dep_p ( consumer , last_def_reg ) ;


<s> bool nds32_n13_last_load_to_e1_p ( rtx_insn * producer , rtx_insn * consumer ) { rtx last_def_reg = extract_nth_access_reg ( producer , - <NUM_LIT> ) ;

return n13_consumed_by_e1_dep_p ( consumer , last_def_reg ) ;


<s> bool nds32_n13_last_load_to_e2_p ( rtx_insn * producer , rtx_insn * consumer ) {

rtx last_def_reg = extract_nth_access_reg ( producer , - <NUM_LIT> ) ;


<s> rtx last_two_def_reg = extract_nth_access_reg ( producer , - <NUM_LIT> ) ; if ( last_two_def_reg == NULL_RTX ) return false ;

return n13_consumed_by_e1_dep_p ( consumer , last_two_def_reg ) ;


<s> bool nds32_n13_last_two_load_to_e1_p ( rtx_insn * producer , rtx_insn * consumer ) { rtx last_two_def_reg = extract_nth_access_reg ( producer , - <NUM_LIT> ) ; if ( last_two_def_reg == NULL_RTX ) return false ; return n13_consumed_by_e1_dep_p ( consumer , last_two_def_reg ) ;


gcc_assert ( get_attr_type ( producer ) == TYPE_LOAD ) ;


<s> gcc_assert ( get_attr_type ( producer ) == TYPE_LOAD ) ; gcc_assert ( REG_P ( def_reg ) || GET_CODE ( def_reg ) == SUBREG ) ; return n13_consumed_by_e1_dep_p ( consumer , def_reg ) ;


<s> bool nds32_n13_load_to_e2_p ( rtx_insn * producer , rtx_insn * consumer ) { rtx def_reg = SET_DEST ( PATTERN ( producer ) ) ; gcc_assert ( get_attr_type ( producer ) == TYPE_LOAD ) ; gcc_assert ( REG_P ( def_reg ) || GET_CODE ( def_reg ) == SUBREG ) ;

return n13_consumed_by_e2_dep_p ( consumer , def_reg ) ;


<s> gcc_assert ( REG_P ( def_reg ) || GET_CODE ( def_reg ) == SUBREG ) ; return n13_consumed_by_e2_dep_p ( consumer , def_reg ) ;


<s> bool nds32_n7_last_load_to_ii_p ( rtx_insn * producer , rtx_insn * consumer ) { if ( post_update_insn_p ( producer ) ) return false ; rtx last_def_reg = extract_nth_access_reg ( producer , - <NUM_LIT> ) ; if ( last_def_reg == NULL_RTX ) return false ;


<s> if ( last_def_reg == NULL_RTX ) return false ; gcc_assert ( REG_P ( last_def_reg ) || GET_CODE ( last_def_reg ) == SUBREG ) ; return n7_consumed_by_ii_dep_p ( consumer , last_def_reg ) ;


<s> bool nds32_n7_load_to_ii_p ( rtx_insn * producer , rtx_insn * consumer ) {

if ( post_update_insn_p ( producer ) ) return false ;


<s> break ; case TYPE_MUL : case TYPE_MAC : def_reg = SET_DEST ( PATTERN ( producer ) ) ; break ; case TYPE_DIV : if ( divmod_p ( producer ) ) def_reg = SET_DEST ( parallel_element ( producer , <NUM_LIT> ) ) ; else def_reg = SET_DEST ( PATTERN ( producer ) ) ; break ; case TYPE_LOAD :


<s> case TYPE_DIV : if ( divmod_p ( producer ) ) def_reg = SET_DEST ( parallel_element ( producer , <NUM_LIT> ) ) ; else def_reg = SET_DEST ( PATTERN ( producer ) ) ; break ; case TYPE_LOAD : case TYPE_STORE : case TYPE_LOAD_MULTIPLE : case TYPE_STORE_MULTIPLE :

if ( ! post_update_insn_p ( producer ) ) return false ;


<s> rtx last_def_reg = extract_nth_access_reg ( producer , - <NUM_LIT> ) ;

if ( last_def_reg == NULL_RTX ) return false ;


<s> if ( post_update_insn_p ( producer ) ) return false ;


<s> rtx last_def_reg = extract_nth_access_reg ( producer , - <NUM_LIT> ) ; if ( last_def_reg == NULL_RTX ) return false ; gcc_assert ( REG_P ( last_def_reg ) || GET_CODE ( last_def_reg ) == SUBREG ) ; return n8_consumed_by_addr_in_p ( consumer , last_def_reg ) ;


<s> gcc_assert ( REG_P ( last_def_reg ) || GET_CODE ( last_def_reg ) == SUBREG ) ; return n8_consumed_by_addr_in_p ( consumer , last_def_reg ) ;


<s> if ( last_two_def_reg == NULL_RTX ) return false ; gcc_assert ( REG_P ( last_two_def_reg ) || GET_CODE ( last_two_def_reg ) == SUBREG ) ;

return n8_consumed_by_addr_in_p ( consumer , last_two_def_reg ) ;


<s> int index = - <NUM_LIT> ; if ( post_update_insn_p ( producer ) ) index = - <NUM_LIT> ;

rtx last_two_def_reg = extract_nth_access_reg ( producer , index ) ;


<s> if ( post_update_insn_p ( producer ) ) return false ; rtx def_reg = SET_DEST ( PATTERN ( producer ) ) ;

return n8_consumed_by_ex_p ( consumer , def_reg ) ;


<s> rtx def_reg = SET_DEST ( PATTERN ( producer ) ) ; return n8_consumed_by_addr_in_p ( consumer , def_reg ) ;


<s> bool nds32_n9_2r1w_mm_to_ex_p ( rtx_insn * producer , rtx_insn * consumer ) { rtx def_reg ; switch ( get_attr_type ( producer ) ) { case TYPE_LOAD : if ( post_update_insn_p ( producer ) ) return false ; def_reg = SET_DEST ( PATTERN ( producer ) ) ; break ; case TYPE_MUL : case TYPE_MAC : def_reg = SET_DEST ( PATTERN ( producer ) ) ; break ; default : gcc_unreachable ( ) ; } return n9_2r1w_consumed_by_ex_dep_p ( consumer , def_reg ) ;


<s> break ; case TYPE_DIV : if ( divmod_p ( producer ) ) { rtx def_reg1 = SET_DEST ( parallel_element ( producer , <NUM_LIT> ) ) ; rtx def_reg2 = SET_DEST ( parallel_element ( producer , <NUM_LIT> ) ) ;

return ( n9_3r2w_consumed_by_ex_dep_p ( consumer , def_reg1 ) || n9_3r2w_consumed_by_ex_dep_p ( consumer , def_reg2 ) ) ;


<s> if ( post_update_insn_p ( producer ) ) return false ; size_t i ; size_t n_elems = parallel_elements ( producer ) ; rtx base_reg = extract_base_reg ( producer ) ; for ( i = <NUM_LIT> ; i < n_elems ; ++ i ) { rtx load_rtx = extract_nth_access_rtx ( producer , i ) ; rtx list_element = SET_DEST ( load_rtx ) ; if ( rtx_equal_p ( base_reg , list_element ) && i != n_elems - <NUM_LIT> ) { last_def_reg = base_reg ; break ; } } return n9_2r1w_consumed_by_ex_dep_p ( consumer , last_def_reg ) ; } else return n9_3r2w_consumed_by_ex_dep_p ( consumer , last_def_reg ) ;


<s> rtx pbsada_rb = XVECEXP ( unspec_rtx , <NUM_LIT> , <NUM_LIT> ) ;

if ( rtx_equal_p ( def_reg , pbsada_ra ) || rtx_equal_p ( def_reg , pbsada_rb ) ) return true ;


<s> if ( rtx_equal_p ( def_reg , pbsada_rt ) ) return true ; return false ;


<s> rtx pbsada_rt = SET_DEST ( PATTERN ( pbsada_insn ) ) ; if ( rtx_equal_p ( def_reg , pbsada_rt ) ) return true ; return false ;


<s> bool reg_overlap_p ( rtx x , rtx in ) { if ( x == NULL_RTX || in == NULL_RTX ) return false ; return static_cast < bool > ( reg_overlap_mentioned_p ( x , in ) ) ;


<s> if ( GET_MODE ( def_reg ) == DImode ) return reg_overlap_p ( def_reg , use_reg ) ; gcc_assert ( REG_P ( def_reg ) || GET_CODE ( def_reg ) == SUBREG ) ; gcc_assert ( REG_P ( use_reg ) || GET_CODE ( use_reg ) == SUBREG ) ; if ( REG_P ( def_reg ) ) { if REG_P ( use_reg ) { if ( ! TARGET_BIG_ENDIAN ) return REGNO ( def_reg ) == REGNO ( use_reg ) + <NUM_LIT> ; else return REGNO ( def_reg ) == REGNO ( use_reg ) ; }


<s> one_bit_count = popcount_hwi ( ( unsigned HOST_WIDE_INT ) ( ~ ival ) ) ; return ( TARGET_PERF_EXT && ( one_bit_count == <NUM_LIT> ) ) ;


<s> return ( TARGET_PERF_EXT && ( one_bit_count == <NUM_LIT> ) ) ;


<s> int nds32_can_use_bitci_p ( int ival ) { return ( TARGET_ISA_V3 && ( ival < <NUM_LIT> ) && satisfies_constraint_Iu15 ( gen_int_mode ( ~ ival , SImode ) ) ) ;


<s> int one_bit_count ; one_bit_count = popcount_hwi ( ( unsigned HOST_WIDE_INT ) ( ival ) ) ; return ( TARGET_PERF_EXT && ( one_bit_count == <NUM_LIT> ) ) ;


<s> int nds32_can_use_btgl_p ( int ival ) { int one_bit_count ; one_bit_count = popcount_hwi ( ( unsigned HOST_WIDE_INT ) ( ival ) ) ;

return ( TARGET_PERF_EXT && ( one_bit_count == <NUM_LIT> ) ) ;


<s> int first_elt_regno ; rtx elt ; count = XVECLEN ( op , <NUM_LIT> ) ; elt = XVECEXP ( op , <NUM_LIT> , <NUM_LIT> ) ; if ( GET_CODE ( elt ) != SET || count <= <NUM_LIT> || count > <NUM_LIT> ) return false ; if ( load_p ) { if ( GET_CODE ( SET_DEST ( elt ) ) != REG || GET_CODE ( SET_SRC ( elt ) ) != MEM ) return false ;

first_elt_regno = REGNO ( SET_DEST ( elt ) ) ;


<s> int one_bit_count ; one_bit_count = popcount_hwi ( ( unsigned HOST_WIDE_INT ) ( ~ ival ) ) ;

return ( TARGET_EXT_PERF && ( one_bit_count == <NUM_LIT> ) ) ;


<s> int nds32_can_use_bclr_p ( int ival ) { int one_bit_count ;

one_bit_count = popcount_hwi ( ( unsigned HOST_WIDE_INT ) ( ~ ival ) ) ;


<s> int nds32_can_use_bset_p ( int ival ) { int one_bit_count ; one_bit_count = popcount_hwi ( ( unsigned HOST_WIDE_INT ) ( ival ) ) ; return ( TARGET_EXT_PERF && ( one_bit_count == <NUM_LIT> ) ) ;


one_bit_count = popcount_hwi ( ( unsigned HOST_WIDE_INT ) ( ival ) ) ;


<s> one_bit_count = popcount_hwi ( ( unsigned HOST_WIDE_INT ) ( ival ) ) ; return ( TARGET_EXT_PERF && ( one_bit_count == <NUM_LIT> ) ) ;


<s> int shift_adv ; int shift = <NUM_LIT> ; int nelem ; switch ( GET_MODE ( op ) ) { case E_V2HImode : mask = <NUM_LIT> ; shift_adv = <NUM_LIT> ; nelem = <NUM_LIT> ; break ; case E_V4QImode : mask = <NUM_LIT> ; shift_adv = <NUM_LIT> ; nelem = <NUM_LIT> ; break ; default : gcc_unreachable ( ) ; } if ( TARGET_BIG_ENDIAN ) { for ( i = <NUM_LIT> ; i < nelem ; ++ i ) { HOST_WIDE_INT val = XINT ( XVECEXP ( op , <NUM_LIT> , nelem - i - <NUM_LIT> ) , <NUM_LIT> ) ; hwint |= ( val & mask ) << shift ;


<s> break ; default : gcc_unreachable ( ) ; } if ( TARGET_BIG_ENDIAN ) { for ( i = <NUM_LIT> ; i < nelem ; ++ i ) { HOST_WIDE_INT val = XINT ( XVECEXP ( op , <NUM_LIT> , nelem - i - <NUM_LIT> ) , <NUM_LIT> ) ; hwint |= ( val & mask ) << shift ; shift = shift + shift_adv ; } } else { for ( i = <NUM_LIT> ; i < nelem ; ++ i ) { HOST_WIDE_INT val = XINT ( XVECEXP ( op , <NUM_LIT> , i ) , <NUM_LIT> ) ; hwint |= ( val & mask ) << shift ; shift = shift + shift_adv ;


<s> bool nds32_can_use_bclr_p ( HOST_WIDE_INT ival ) { int one_bit_count ; unsigned HOST_WIDE_INT mask = GET_MODE_MASK ( SImode ) ; one_bit_count = popcount_hwi ( ( unsigned HOST_WIDE_INT ) ( ~ ival ) & mask ) ;


<s> bool nds32_can_use_bitci_p ( HOST_WIDE_INT ival ) {

return ( TARGET_ISA_V3 && ( ival < <NUM_LIT> ) && satisfies_constraint_Iu15 ( gen_int_mode ( ~ ival , SImode ) ) ) ;


<s> one_bit_count = popcount_hwi ( ( unsigned HOST_WIDE_INT ) ( ival ) & mask ) ;


<s> unsigned HOST_WIDE_INT mask = GET_MODE_MASK ( SImode ) ; one_bit_count = popcount_hwi ( ( unsigned HOST_WIDE_INT ) ( ival ) & mask ) ; return ( TARGET_EXT_PERF && ( one_bit_count == <NUM_LIT> ) ) ;


<s> int one_bit_count ; unsigned HOST_WIDE_INT mask = GET_MODE_MASK ( SImode ) ;

one_bit_count = popcount_hwi ( ( unsigned HOST_WIDE_INT ) ( ival ) & mask ) ;


<s> machine_mode cmp0_mode = GET_MODE ( XEXP ( cmp_rtx , <NUM_LIT> ) ) ; machine_mode cmp1_mode = GET_MODE ( XEXP ( cmp_rtx , <NUM_LIT> ) ) ; enum rtx_code cond = GET_CODE ( cmp_rtx ) ; if ( ( cmp0_mode == DFmode || cmp0_mode == SFmode ) && ( cmp1_mode == DFmode || cmp1_mode == SFmode ) && ( cond == ORDERED || cond == UNORDERED ) ) return true ;


<s> int i ; int check_regno ; rtx elt ; rtx elt_reg ; rtx elt_mem ; for ( i = <NUM_LIT> ; i < count ; i ++ ) { elt = XVECEXP ( op , <NUM_LIT> , i + par_index ) ; if ( GET_CODE ( elt ) != SET ) return false ; elt_reg = load_p ? SET_DEST ( elt ) : SET_SRC ( elt ) ; elt_mem = load_p ? SET_SRC ( elt ) : SET_DEST ( elt ) ; if ( GET_CODE ( elt_reg ) != REG || GET_MODE ( elt_reg ) != SImode ) return false ;

if ( GET_CODE ( elt_mem ) != MEM || GET_MODE ( elt_mem ) != SImode ) return false ;


<s> int check_regno ; rtx elt ; rtx elt_reg ; rtx elt_mem ; for ( i = <NUM_LIT> ; i < count ; i ++ ) { elt = XVECEXP ( op , <NUM_LIT> , i + par_index ) ; if ( GET_CODE ( elt ) != SET ) return false ; elt_reg = load_p ? SET_DEST ( elt ) : SET_SRC ( elt ) ; elt_mem = load_p ? SET_SRC ( elt ) : SET_DEST ( elt ) ; if ( GET_CODE ( elt_reg ) != REG || GET_MODE ( elt_reg ) != SImode ) return false ; if ( GET_CODE ( elt_mem ) != MEM || GET_MODE ( elt_mem ) != SImode ) return false ; check_regno = first_elt_regno + i ;

if ( REGNO ( elt_reg ) != ( unsigned int ) check_regno ) return false ;


<s> const REAL_VALUE_TYPE * rv ; long val ; rv = CONST_DOUBLE_REAL_VALUE ( op ) ;

REAL_VALUE_TO_TARGET_SINGLE ( * rv , val ) ;


<s> const REAL_VALUE_TYPE * rv ; long val ; rv = CONST_DOUBLE_REAL_VALUE ( op ) ; REAL_VALUE_TO_TARGET_SINGLE ( * rv , val ) ; return val >= lower && val < upper ;


<s> if ( GET_CODE ( x ) == PLUS ) x = XEXP ( x , <NUM_LIT> ) ; if ( GET_CODE ( x ) == UNSPEC ) { switch ( XINT ( x , <NUM_LIT> ) ) { case UNSPEC_GOTINIT : case UNSPEC_GOT : case UNSPEC_GOTOFF : case UNSPEC_PLT : case UNSPEC_TLSGD : case UNSPEC_TLSLD : case UNSPEC_TLSIE : case UNSPEC_TLSLE : return false ; default : return true ; } } } if ( GET_CODE ( x ) == SYMBOL_REF && SYMBOL_REF_TLS_MODEL ( x ) ) return false ; return true ;


<s> if ( GET_CODE ( addr ) == PLUS ) { if ( GET_CODE ( XEXP ( addr , <NUM_LIT> ) ) == SYMBOL_REF ) return false ; if ( GET_CODE ( XEXP ( addr , <NUM_LIT> ) ) == CONST_INT ) { if ( ( mode == SImode || mode == SFmode ) && NDS32_SINGLE_WORD_ALIGN_P ( INTVAL ( XEXP ( addr , <NUM_LIT> ) ) ) && ! satisfies_constraint_Is14 ( XEXP ( addr , <NUM_LIT> ) ) ) return false ; if ( ( mode == DImode || mode == DFmode ) && NDS32_DOUBLE_WORD_ALIGN_P ( INTVAL ( XEXP ( addr , <NUM_LIT> ) ) ) && ! satisfies_constraint_Is14 ( XEXP ( addr , <NUM_LIT> ) ) ) return false ;


<s> if ( mem_src != NULL_RTX ) { if ( ( GET_CODE ( mem_src ) == ZERO_EXTEND ) || ( GET_CODE ( mem_src ) == SIGN_EXTEND ) ) mem_src = XEXP ( mem_src , <NUM_LIT> ) ; if ( ( GET_CODE ( XEXP ( mem_src , <NUM_LIT> ) ) == SYMBOL_REF ) || ( GET_CODE ( XEXP ( mem_src , <NUM_LIT> ) ) == LO_SUM ) ) return true ; } return false ;


<s> bool nds32_valid_CVhi_p ( rtx op ) { HOST_WIDE_INT ival = const_vector_to_hwint ( op ) ; return ( ival != <NUM_LIT> ) && ( ( ival & <NUM_LIT> ) == <NUM_LIT> ) ;


<s> bool nds32_valid_CVhi_p ( rtx op ) {

HOST_WIDE_INT ival = const_vector_to_hwint ( op ) ;


<s> bool nds32_valid_CVp5_p ( rtx op ) { HOST_WIDE_INT ival = const_vector_to_hwint ( op ) ;

return ( ival < ( ( <NUM_LIT> << <NUM_LIT> ) + <NUM_LIT> ) ) && ( ival >= ( <NUM_LIT> + <NUM_LIT> ) ) ;


<s> return ( ival < ( ( <NUM_LIT> << <NUM_LIT> ) + <NUM_LIT> ) ) && ( ival >= ( <NUM_LIT> + <NUM_LIT> ) ) ;


<s> bool nds32_valid_CVs2_p ( rtx op ) { HOST_WIDE_INT ival = const_vector_to_hwint ( op ) ; return ( ival < ( <NUM_LIT> << <NUM_LIT> ) ) && ( ival >= - ( <NUM_LIT> << <NUM_LIT> ) ) ;


<s> HOST_WIDE_INT ival = const_vector_to_hwint ( op ) ; return ( ival < ( <NUM_LIT> << <NUM_LIT> ) ) && ( ival >= - ( <NUM_LIT> << <NUM_LIT> ) ) ;


elt = XEXP ( SET_SRC ( update_base ) , <NUM_LIT> ) ;


update_base = XVECEXP ( op , <NUM_LIT> , update_base_elt_idx ) ;


if ( GET_CODE ( elt_mem ) != MEM || GET_CODE ( elt_reg ) != REG || REGNO ( elt_reg ) != GP_REGNUM ) return false ;


<s> if ( ! ( recog_memoized ( use_insn ) == CODE_FOR_lo_sum || nds32_symbol_load_store_p ( use_insn ) || ( nds32_reg_base_load_store_p ( use_insn ) && ! nds32_sp_base_or_plus_load_store_p ( use_insn ) ) ) ) return ; } group_id = GEN_INT ( relax_group_id ) ; emit_insn_before ( gen_relax_group ( group_id ) , sethi ) ; for ( link = DF_REF_CHAIN ( def_record ) ; link ; link = link -> next ) { if ( ! DF_REF_INSN_INFO ( link -> ref ) ) continue ; use_insn = DF_REF_INSN ( link -> ref ) ;


<s> for ( link = DF_REF_CHAIN ( def_record ) ; link ; link = link -> next ) { if ( ! DF_REF_INSN_INFO ( link -> ref ) ) continue ; use_insn = DF_REF_INSN ( link -> ref ) ; if ( ! dominated_by_p ( CDI_DOMINATORS , BLOCK_FOR_INSN ( use_insn ) , BLOCK_FOR_INSN ( sethi ) ) ) return ; use_record = DF_INSN_USES ( use_insn ) ; if ( DF_REF_CHAIN ( use_record ) && DF_REF_CHAIN ( use_record ) -> next ) return ; if ( ! active_insn_p ( use_insn ) ) return ; if ( ! ( recog_memoized ( use_insn ) == CODE_FOR_lo_sum || nds32_symbol_load_store_p ( use_insn ) || ( nds32_reg_base_load_store_p ( use_insn ) && ! nds32_sp_base_or_plus_load_store_p ( use_insn ) ) ) ) return ; } group_id = GEN_INT ( relax_group_id ) ; emit_insn_before ( gen_relax_group ( group_id ) , sethi ) ; for ( link = DF_REF_CHAIN ( def_record ) ; link ; link = link -> next ) { if ( ! DF_REF_INSN_INFO ( link -> ref ) ) continue ; use_insn = DF_REF_INSN ( link -> ref ) ;


<s> gcc_assert ( NOTE_P ( insn ) ) ; for ( insn = next_active_insn ( insn ) ; insn ; insn = next_active_insn ( insn ) ) { if ( NONJUMP_INSN_P ( insn ) ) { if ( recog_memoized ( insn ) == CODE_FOR_sethi && nds32_symbolic_operand ( XEXP ( SET_SRC ( PATTERN ( insn ) ) , <NUM_LIT> ) , SImode ) ) nds32_group_insns ( insn ) ; }


<s> calculate_dominance_info ( CDI_DOMINATORS ) ; insn = get_insns ( ) ; gcc_assert ( NOTE_P ( insn ) ) ; for ( insn = next_active_insn ( insn ) ; insn ; insn = next_active_insn ( insn ) ) { if ( NONJUMP_INSN_P ( insn ) ) { if ( recog_memoized ( insn ) == CODE_FOR_sethi && nds32_symbolic_operand ( XEXP ( SET_SRC ( PATTERN ( insn ) ) , <NUM_LIT> ) , SImode ) ) nds32_group_insns ( insn ) ; } } df_insn_rescan_all ( ) ; df_finish_pass ( false ) ;


<s> unsigned int execute ( function * ) { return nds32_relax_opt ( ) ;


<s> bool gate ( function * ) { return TARGET_RELAX_HINT ;


<s> int nds32_alloc_relax_group_id ( ) { return relax_group_id ++ ;


<s> rtx pat = PATTERN ( insn ) ; if ( get_attr_type ( insn ) == TYPE_FLOAD && GET_CODE ( pat ) == SET && ( GET_MODE ( XEXP ( pat , <NUM_LIT> ) ) == SFmode || GET_MODE ( XEXP ( pat , <NUM_LIT> ) ) == DFmode ) && MEM_P ( XEXP ( pat , <NUM_LIT> ) ) ) {

rtx addr = XEXP ( XEXP ( pat , <NUM_LIT> ) , <NUM_LIT> ) ;


<s> if ( ! dominated_by_p ( CDI_DOMINATORS , BLOCK_FOR_INSN ( use_insn ) , BLOCK_FOR_INSN ( insn ) ) ) return ; use_record = DF_INSN_USES ( use_insn ) ; if ( DF_REF_CHAIN ( use_record ) && DF_REF_CHAIN ( use_record ) -> next ) return ; if ( ! active_insn_p ( use_insn ) ) return ; if ( ! nds32_float_reg_load_store_p ( use_insn ) || find_post_update_rtx ( use_insn ) != - <NUM_LIT> ) return ; }

group_id = GEN_INT ( nds32_alloc_relax_group_id ( ) ) ;


<s> if ( ! active_insn_p ( use_insn ) ) return ; if ( ! nds32_float_reg_load_store_p ( use_insn ) || find_post_update_rtx ( use_insn ) != - <NUM_LIT> ) return ; } group_id = GEN_INT ( nds32_alloc_relax_group_id ( ) ) ; emit_insn_before ( gen_relax_group ( group_id ) , insn ) ; for ( link = DF_REF_CHAIN ( def_record ) ; link ; link = link -> next ) { if ( ! DF_REF_INSN_INFO ( link -> ref ) ) continue ; use_insn = DF_REF_INSN ( link -> ref ) ;


<s> if ( ! active_insn_p ( use_insn ) ) return ; if ( ! ( recog_memoized ( use_insn ) == CODE_FOR_lo_sum || nds32_symbol_load_store_p ( use_insn ) || ( nds32_reg_base_load_store_p ( use_insn ) && ! nds32_sp_base_or_plus_load_store_p ( use_insn ) ) ) ) return ; } group_id = GEN_INT ( nds32_alloc_relax_group_id ( ) ) ; emit_insn_before ( gen_relax_group ( group_id ) , sethi ) ; for ( link = DF_REF_CHAIN ( def_record ) ; link ; link = link -> next ) { if ( ! DF_REF_INSN_INFO ( link -> ref ) ) continue ; use_insn = DF_REF_INSN ( link -> ref ) ; if ( active_insn_p ( use_insn ) ) emit_insn_before ( gen_relax_group ( group_id ) , use_insn ) ; if ( use_insn != NULL && recog_memoized ( use_insn ) == CODE_FOR_lo_sum && ! nds32_const_unspec_p ( XEXP ( SET_SRC ( PATTERN ( use_insn ) ) , <NUM_LIT> ) ) ) { int sym_type = nds32_pic_tls_symbol_type ( use_insn ) ; valid = nds32_pic_tls_group ( use_insn , RELAX_ORI , sym_type ) ; while ( ! nds32_group_infos . is_empty ( ) ) { use_insn = nds32_group_infos . pop ( ) ; if ( valid ) emit_insn_before ( gen_relax_group ( group_id ) , use_insn ) ; } } }


<s> rtx group_id ; bool valid ; def_record = DF_INSN_DEFS ( sethi ) ; for ( link = DF_REF_CHAIN ( def_record ) ; link ; link = link -> next ) { if ( ! DF_REF_INSN_INFO ( link -> ref ) ) continue ; use_insn = DF_REF_INSN ( link -> ref ) ; if ( ! dominated_by_p ( CDI_DOMINATORS , BLOCK_FOR_INSN ( use_insn ) , BLOCK_FOR_INSN ( sethi ) ) ) return ; use_record = DF_INSN_USES ( use_insn ) ; if ( DF_REF_CHAIN ( use_record ) && DF_REF_CHAIN ( use_record ) -> next ) return ; if ( ! active_insn_p ( use_insn ) ) return ; if ( ! ( recog_memoized ( use_insn ) == CODE_FOR_lo_sum || nds32_symbol_load_store_p ( use_insn ) || ( nds32_reg_base_load_store_p ( use_insn ) && ! nds32_sp_base_or_plus_load_store_p ( use_insn ) ) ) ) return ; } group_id = GEN_INT ( nds32_alloc_relax_group_id ( ) ) ; emit_insn_before ( gen_relax_group ( group_id ) , sethi ) ; for ( link = DF_REF_CHAIN ( def_record ) ; link ; link = link -> next ) {


<s> rtx pat = PATTERN ( insn ) ; rtx unspec_relax_group = XEXP ( XVECEXP ( pat , <NUM_LIT> , <NUM_LIT> ) , <NUM_LIT> ) ;

int group_id = nds32_alloc_relax_group_id ( ) ;


<s> rtx pat = PATTERN ( insn ) ; rtx unspec_relax_group = XEXP ( XVECEXP ( pat , <NUM_LIT> , <NUM_LIT> ) , <NUM_LIT> ) ; int group_id = nds32_alloc_relax_group_id ( ) ; while ( GET_CODE ( pat ) != SET && GET_CODE ( pat ) == PARALLEL ) { pat = XVECEXP ( pat , <NUM_LIT> , <NUM_LIT> ) ; } if ( GET_CODE ( unspec_relax_group ) == UNSPEC && XINT ( unspec_relax_group , <NUM_LIT> ) == UNSPEC_VOLATILE_RELAX_GROUP ) { XVECEXP ( unspec_relax_group , <NUM_LIT> , <NUM_LIT> ) = GEN_INT ( group_id ) ; }


<s> static bool nds32_ict_const_p ( rtx x ) { if ( GET_CODE ( x ) == CONST ) { x = XEXP ( x , <NUM_LIT> ) ;

return nds32_indirect_call_referenced_p ( x ) ;


<s> switch ( relax_type ) { case RELAX_ORI : if ( ( sym_type == UNSPEC_TLSLE || sym_type == UNSPEC_GOTOFF ) && ( recog_memoized ( use_insn ) == CODE_FOR_addsi3 ) ) { pat = XEXP ( PATTERN ( use_insn ) , <NUM_LIT> ) ; new_pat = gen_rtx_UNSPEC ( SImode , gen_rtvec ( <NUM_LIT> , XEXP ( pat , <NUM_LIT> ) , XEXP ( pat , <NUM_LIT> ) ) , UNSPEC_ADD32 ) ; validate_replace_rtx ( pat , new_pat , use_insn ) ;


<s> if ( ! DF_REF_INSN_INFO ( link -> ref ) ) continue ; use_insn = DF_REF_INSN ( link -> ref ) ; if ( ! dominated_by_p ( CDI_DOMINATORS , BLOCK_FOR_INSN ( use_insn ) , BLOCK_FOR_INSN ( def_insn ) ) ) return FALSE ; if ( ! active_insn_p ( use_insn ) ) return FALSE ; switch ( relax_type ) { case RELAX_ORI : if ( ( sym_type == UNSPEC_TLSLE || sym_type == UNSPEC_GOTOFF ) && ( recog_memoized ( use_insn ) == CODE_FOR_addsi3 ) ) { pat = XEXP ( PATTERN ( use_insn ) , <NUM_LIT> ) ; new_pat = gen_rtx_UNSPEC ( SImode , gen_rtvec ( <NUM_LIT> , XEXP ( pat , <NUM_LIT> ) , XEXP ( pat , <NUM_LIT> ) ) , UNSPEC_ADD32 ) ; validate_replace_rtx ( pat , new_pat , use_insn ) ; nds32_group_infos . safe_push ( use_insn ) ; } else if ( nds32_plus_reg_load_store_p ( use_insn ) && ! nds32_sp_base_or_plus_load_store_p ( use_insn ) ) nds32_group_infos . safe_push ( use_insn ) ; else return FALSE ; break ;


<s> if ( GET_CODE ( x ) == CONST ) { x = XEXP ( x , <NUM_LIT> ) ; if ( GET_CODE ( x ) == PLUS ) x = XEXP ( x , <NUM_LIT> ) ; return XINT ( x , <NUM_LIT> ) ; } return XINT ( x , <NUM_LIT> ) ;


<s> if ( GET_CODE ( x ) == PLUS ) x = XEXP ( x , <NUM_LIT> ) ; return XINT ( x , <NUM_LIT> ) ;


<s> default : break ; } if ( mem_src != NULL_RTX ) { if ( ( GET_CODE ( mem_src ) == ZERO_EXTEND ) || ( GET_CODE ( mem_src ) == SIGN_EXTEND ) ) mem_src = XEXP ( mem_src , <NUM_LIT> ) ; if ( ( GET_CODE ( XEXP ( mem_src , <NUM_LIT> ) ) == PLUS ) ) mem_src = XEXP ( mem_src , <NUM_LIT> ) ; else return false ; if ( GET_CODE ( XEXP ( mem_src , <NUM_LIT> ) ) == REG ) return true ; } return false ;


<s> if ( ( GET_CODE ( mem_src ) == ZERO_EXTEND ) || ( GET_CODE ( mem_src ) == SIGN_EXTEND ) ) mem_src = XEXP ( mem_src , <NUM_LIT> ) ; if ( GET_CODE ( XEXP ( mem_src , <NUM_LIT> ) ) == REG ) return true ;


<s> break ; default : break ; } if ( mem_src != NULL_RTX ) {

if ( ( GET_CODE ( mem_src ) == ZERO_EXTEND ) || ( GET_CODE ( mem_src ) == SIGN_EXTEND ) ) mem_src = XEXP ( mem_src , <NUM_LIT> ) ;


<s> static void nds32_relax_group ( void ) { rtx_insn * insn ; compute_bb_for_insn ( ) ; df_chain_add_problem ( DF_DU_CHAIN | DF_UD_CHAIN ) ; df_insn_rescan_all ( ) ; df_analyze ( ) ; df_set_flags ( DF_DEFER_INSN_RESCAN ) ; calculate_dominance_info ( CDI_DOMINATORS ) ; insn = get_insns ( ) ; gcc_assert ( NOTE_P ( insn ) ) ; for ( insn = next_active_insn ( insn ) ; insn ; insn = next_active_insn ( insn ) ) { if ( NONJUMP_INSN_P ( insn ) ) { if ( recog_memoized ( insn ) == CODE_FOR_sethi && nds32_symbolic_operand ( XEXP ( SET_SRC ( PATTERN ( insn ) ) , <NUM_LIT> ) , SImode ) && ! nds32_ict_const_p ( XEXP ( SET_SRC ( PATTERN ( insn ) ) , <NUM_LIT> ) ) ) nds32_group_insns ( insn ) ; else if ( recog_memoized ( insn ) == CODE_FOR_tls_ie ) nds32_group_tls_insn ( insn ) ; else if ( TARGET_FPU_SINGLE && recog_memoized ( insn ) == CODE_FOR_move_addr && ! nds32_ict_const_p ( XEXP ( SET_SRC ( PATTERN ( insn ) ) , <NUM_LIT> ) ) ) { nds32_group_float_insns ( insn ) ; } } else if ( CALL_P ( insn ) && recog_memoized ( insn ) == CODE_FOR_tls_desc ) { nds32_group_tls_insn ( insn ) ; } } df_insn_rescan_all ( ) ; df_finish_pass ( false ) ;


<s> static unsigned int nds32_relax_opt ( void ) { if ( TARGET_RELAX_HINT ) nds32_relax_group ( ) ; return <NUM_LIT> ;


<s> if ( ( GET_CODE ( XEXP ( mem_src , <NUM_LIT> ) ) == PLUS ) ) mem_src = XEXP ( mem_src , <NUM_LIT> ) ; if ( REG_P ( XEXP ( mem_src , <NUM_LIT> ) ) && ( ( frame_pointer_needed && REGNO ( XEXP ( mem_src , <NUM_LIT> ) ) == FP_REGNUM ) || REGNO ( XEXP ( mem_src , <NUM_LIT> ) ) == SP_REGNUM ) ) return true ; } return false ;


<s> pass_nds32_relax_opt ( gcc :: context * ctxt ) : rtl_opt_pass ( pass_data_nds32_relax_opt , ctxt ) {


<s> case TYPE_LOAD_MULTIPLE : post_update_rtx_index = find_post_update_rtx ( insn ) ; if ( post_update_rtx_index != - <NUM_LIT> ) return SET_DEST ( parallel_element ( insn , post_update_rtx_index ) ) ; mem_rtx = SET_SRC ( parallel_element ( insn , <NUM_LIT> ) ) ; break ; case TYPE_STORE_MULTIPLE : post_update_rtx_index = find_post_update_rtx ( insn ) ; if ( post_update_rtx_index != - <NUM_LIT> ) return SET_DEST ( parallel_element ( insn , post_update_rtx_index ) ) ; mem_rtx = SET_DEST ( parallel_element ( insn , <NUM_LIT> ) ) ; break ; case TYPE_LOAD : case TYPE_FLOAD : case TYPE_STORE :


<s> case TYPE_LOAD_MULTIPLE : post_update_rtx_index = find_post_update_rtx ( insn ) ; if ( post_update_rtx_index != - <NUM_LIT> ) return SET_DEST ( parallel_element ( insn , post_update_rtx_index ) ) ; mem_rtx = SET_SRC ( parallel_element ( insn , <NUM_LIT> ) ) ; break ; case TYPE_STORE_MULTIPLE : post_update_rtx_index = find_post_update_rtx ( insn ) ; if ( post_update_rtx_index != - <NUM_LIT> ) return SET_DEST ( parallel_element ( insn , post_update_rtx_index ) ) ;

mem_rtx = SET_DEST ( parallel_element ( insn , <NUM_LIT> ) ) ;


<s> rtx exp = SET_SRC ( PATTERN ( insn ) ) ; switch ( get_attr_type ( insn ) ) { case TYPE_MAC : if ( REG_P ( XEXP ( exp , <NUM_LIT> ) ) ) return XEXP ( exp , <NUM_LIT> ) ; else return XEXP ( exp , <NUM_LIT> ) ;


<s> switch ( get_attr_type ( insn ) ) { case TYPE_MAC : if ( REG_P ( XEXP ( exp , <NUM_LIT> ) ) ) return XEXP ( exp , <NUM_LIT> ) ; else return XEXP ( exp , <NUM_LIT> ) ; default :


<s> if ( INSN_CODE ( insn ) == CODE_FOR_divmodsi4 || INSN_CODE ( insn ) == CODE_FOR_udivmodsi4 ) return true ;


<s> gcc_assert ( CALL_P ( insn ) || JUMP_P ( insn ) ) ; rtx body = PATTERN ( insn ) ; if ( GET_CODE ( body ) == SET ) { rtx if_then_else_rtx = SET_SRC ( body ) ;

if ( GET_CODE ( if_then_else_rtx ) == IF_THEN_ELSE ) return XEXP ( if_then_else_rtx , <NUM_LIT> ) ;


<s> return SET_SRC ( body ) ; } if ( GET_CODE ( body ) == CALL ) return XEXP ( body , <NUM_LIT> ) ; if ( GET_CODE ( body ) == PARALLEL ) { rtx first_rtx = parallel_element ( body , <NUM_LIT> ) ; if ( GET_CODE ( first_rtx ) == SET ) return SET_SRC ( first_rtx ) ; if ( GET_CODE ( first_rtx ) == CALL ) return XEXP ( first_rtx , <NUM_LIT> ) ; } if ( GET_CODE ( body ) == COND_EXEC ) { rtx addr_rtx = XEXP ( body , <NUM_LIT> ) ; if ( GET_CODE ( addr_rtx ) == SET ) return SET_SRC ( addr_rtx ) ; if ( GET_CODE ( addr_rtx ) == PARALLEL ) { rtx first_rtx = parallel_element ( addr_rtx , <NUM_LIT> ) ; if ( GET_CODE ( first_rtx ) == SET ) { rtx call_rtx = SET_SRC ( first_rtx ) ;

gcc_assert ( GET_CODE ( call_rtx ) == CALL ) ;


<s> switch ( get_attr_type ( insn ) ) { case TYPE_MAC : case TYPE_DMAC : if ( REG_P ( XEXP ( exp , <NUM_LIT> ) ) ) return XEXP ( exp , <NUM_LIT> ) ; else return XEXP ( exp , <NUM_LIT> ) ;


<s> rtx exp = SET_SRC ( PATTERN ( insn ) ) ; switch ( get_attr_type ( insn ) ) { case TYPE_MAC : case TYPE_DMAC : if ( REG_P ( XEXP ( exp , <NUM_LIT> ) ) ) return XEXP ( exp , <NUM_LIT> ) ; else return XEXP ( exp , <NUM_LIT> ) ; default :


<s> case TYPE_FSTORE : if ( MEM_P ( SET_DEST ( body ) ) ) return SET_DEST ( body ) ; if ( GET_CODE ( SET_DEST ( body ) ) == UNSPEC ) { gcc_assert ( MEM_P ( XVECEXP ( SET_DEST ( body ) , <NUM_LIT> , <NUM_LIT> ) ) ) ; return XVECEXP ( SET_DEST ( body ) , <NUM_LIT> , <NUM_LIT> ) ; } gcc_assert ( MEM_P ( XEXP ( SET_DEST ( body ) , <NUM_LIT> ) ) ) ; return XEXP ( SET_DEST ( body ) , <NUM_LIT> ) ; default : gcc_unreachable ( ) ; }


<s> rtx def_reg = SET_DEST ( PATTERN ( insn ) ) ; machine_mode mode ; gcc_assert ( REG_P ( def_reg ) || GET_CODE ( def_reg ) == SUBREG ) ; switch ( GET_MODE ( def_reg ) ) { case E_DImode : mode = SImode ;


<s> gcc_assert ( movd44_insn_p ( insn ) ) ; rtx def_reg = SET_DEST ( PATTERN ( insn ) ) ; machine_mode mode ;

gcc_assert ( REG_P ( def_reg ) || GET_CODE ( def_reg ) == SUBREG ) ;


<s> break ; default : gcc_unreachable ( ) ; } gcc_assert ( MEM_P ( mem_rtx ) ) ; if ( REG_P ( XEXP ( mem_rtx , <NUM_LIT> ) ) ) return NULL_RTX ; plus_rtx = XEXP ( mem_rtx , <NUM_LIT> ) ; switch ( GET_CODE ( plus_rtx ) ) { case SYMBOL_REF : case CONST : case POST_INC : case POST_DEC : return NULL_RTX ; case PLUS :

if ( REG_P ( XEXP ( plus_rtx , <NUM_LIT> ) ) ) offset_rtx = XEXP ( plus_rtx , <NUM_LIT> ) ;


<s> if ( INSN_P ( insn ) ) return PATTERN ( insn ) ;


<s> rtx shift_rtx ; if ( REG_P ( XEXP ( alu_rtx , <NUM_LIT> ) ) ) shift_rtx = XEXP ( alu_rtx , <NUM_LIT> ) ; else shift_rtx = XEXP ( alu_rtx , <NUM_LIT> ) ; return XEXP ( shift_rtx , <NUM_LIT> ) ;


<s> return - <NUM_LIT> ; case TYPE_LOAD : case TYPE_FLOAD : case TYPE_STORE : case TYPE_FSTORE : mem_rtx = extract_mem_rtx ( insn ) ; switch ( GET_CODE ( XEXP ( mem_rtx , <NUM_LIT> ) ) ) { case POST_INC : case POST_DEC : case POST_MODIFY : return <NUM_LIT> ; default : return - <NUM_LIT> ; }


<s> gcc_assert ( MEM_P ( mem_rtx ) ) ; rtx addr_rtx = XEXP ( mem_rtx , <NUM_LIT> ) ; if ( REG_P ( addr_rtx ) ) return true ;

if ( GET_CODE ( addr_rtx ) == PLUS && GET_CODE ( XEXP ( addr_rtx , <NUM_LIT> ) ) == CONST_INT ) return true ;


<s> if ( GET_CODE ( addr_rtx ) == PLUS && GET_CODE ( XEXP ( addr_rtx , <NUM_LIT> ) ) == CONST_INT ) return true ;


<s> bool load_double_p ( rtx_insn * insn ) { if ( get_attr_type ( insn ) != TYPE_LOAD ) return false ; if ( INSN_CODE ( insn ) != CODE_FOR_move_di && INSN_CODE ( insn ) != CODE_FOR_move_df ) return false ;


<s> rtx body = PATTERN ( insn ) ; gcc_assert ( GET_CODE ( body ) == SET ) ; rtx src = SET_SRC ( body ) ; rtx dest = SET_DEST ( body ) ; if ( ( REG_P ( src ) || GET_CODE ( src ) == SUBREG ) && ( REG_P ( dest ) || GET_CODE ( dest ) == SUBREG ) ) return true ; return false ; }


<s> rtx src = SET_SRC ( body ) ; rtx dest = SET_DEST ( body ) ;

if ( ( REG_P ( src ) || GET_CODE ( src ) == SUBREG ) && ( REG_P ( dest ) || GET_CODE ( dest ) == SUBREG ) ) return true ;


<s> gcc_assert ( GET_CODE ( parallel_rtx ) == PARALLEL ) ;

return XVECLEN ( parallel_rtx , <NUM_LIT> ) ;


<s> if ( INSN_CODE ( insn ) != CODE_FOR_move_di && INSN_CODE ( insn ) != CODE_FOR_move_df ) return false ; return true ;


<s> rtx offset_rtx = extract_offset_rtx ( insn ) ; if ( offset_rtx == NULL_RTX ) return false ;

if ( REG_P ( offset_rtx ) ) return true ;


<s> bool store_offset_reg_p ( rtx_insn * insn ) {

if ( get_attr_type ( insn ) != TYPE_STORE ) return false ;


<s> if ( get_attr_type ( insn ) != TYPE_STORE ) return false ;

if ( INSN_CODE ( insn ) == CODE_FOR_move_di || INSN_CODE ( insn ) == CODE_FOR_move_df ) return false ;


<s> unsigned int nds32_debugger_regno ( unsigned int regno ) {

if ( NDS32_IS_FPR_REGNUM ( regno ) ) return regno + <NUM_LIT> ;


<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 ) { 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> 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 ) { if ( ! flag_inline_asm_r15 ) { clobbers . safe_push ( gen_rtx_REG ( SImode , TA_REGNUM ) ) ; SET_HARD_REG_BIT ( clobbered_regs , TA_REGNUM ) ;


<s> 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 ; if ( ! TYPE_NO_NAMED_ARGS_STDARG_P ( TREE_TYPE ( current_function_decl ) ) ) 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 ) ; else num_of_used_regs = cum -> gpr_offset + NDS32_GPR_ARG_FIRST_REGNUM ; remaining_reg_count = total_args_regs - num_of_used_regs ; * pretend_args_size = remaining_reg_count * UNITS_PER_WORD ;


<s> if ( ! TYPE_NO_NAMED_ARGS_STDARG_P ( TREE_TYPE ( current_function_decl ) ) ) 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 ) ; else num_of_used_regs = cum -> gpr_offset + NDS32_GPR_ARG_FIRST_REGNUM ; remaining_reg_count = total_args_regs - num_of_used_regs ; * pretend_args_size = remaining_reg_count * UNITS_PER_WORD ; return ;


<s> if ( REG_P ( src ) && REG_P ( dst ) && ( REGNO ( src ) % <NUM_LIT> ) == <NUM_LIT> && ( REGNO ( dst ) % <NUM_LIT> ) == <NUM_LIT> ) length = <NUM_LIT> ; break ; default : break ; } return length ;


<s> unsigned int needed_reg_count ; unsigned int remaining_reg_count ; CUMULATIVE_ARGS * cum ; cum = get_cumulative_args ( ca ) ; if ( TARGET_HARD_FLOAT ) return <NUM_LIT> ;

if ( NDS32_AVAILABLE_REGNUM_FOR_GPR_ARG ( cum -> gpr_offset , mode , type ) >= NDS32_GPR_ARG_FIRST_REGNUM + NDS32_MAX_GPR_REGS_FOR_ARGS ) return <NUM_LIT> ;


<s> static int nds32_arg_partial_bytes ( cumulative_args_t ca , machine_mode mode , tree type , bool named ATTRIBUTE_UNUSED ) { unsigned int needed_reg_count ; unsigned int remaining_reg_count ; CUMULATIVE_ARGS * cum ; cum = get_cumulative_args ( ca ) ; if ( TARGET_HARD_FLOAT ) return <NUM_LIT> ; if ( NDS32_AVAILABLE_REGNUM_FOR_GPR_ARG ( cum -> gpr_offset , mode , type ) >= NDS32_GPR_ARG_FIRST_REGNUM + NDS32_MAX_GPR_REGS_FOR_ARGS ) return <NUM_LIT> ; needed_reg_count = NDS32_NEED_N_REGS_FOR_ARG ( mode , type ) ; remaining_reg_count = NDS32_MAX_GPR_REGS_FOR_ARGS - ( NDS32_AVAILABLE_REGNUM_FOR_GPR_ARG ( cum -> gpr_offset , mode , type ) - NDS32_GPR_ARG_FIRST_REGNUM ) ;


<s> nds32_asm_file_end_for_isr ( ) ; fprintf ( asm_out_file , <STR_LIT> ) ;


<s> fprintf ( asm_out_file , <STR_LIT> ) ;


<s> fprintf ( asm_out_file , <STR_LIT> ) ; fprintf ( asm_out_file , <STR_LIT> <STR_LIT> ) ; fprintf ( asm_out_file , <STR_LIT> , nds32_isr_vector_size ) ; fprintf ( asm_out_file , <STR_LIT> ) ; if ( TARGET_ISA_V2 ) fprintf ( asm_out_file , <STR_LIT> , <STR_LIT> ) ; if ( TARGET_ISA_V3 ) fprintf ( asm_out_file , <STR_LIT> , <STR_LIT> ) ; if ( TARGET_ISA_V3M ) fprintf ( asm_out_file , <STR_LIT> , <STR_LIT> ) ; if ( TARGET_CMODEL_SMALL ) fprintf ( asm_out_file , <STR_LIT> , <STR_LIT> ) ; if ( TARGET_CMODEL_MEDIUM ) fprintf ( asm_out_file , <STR_LIT> , <STR_LIT> ) ; if ( TARGET_CMODEL_LARGE ) fprintf ( asm_out_file , <STR_LIT> , <STR_LIT> ) ; fprintf ( asm_out_file , <STR_LIT> , ( ( TARGET_BIG_ENDIAN ) ? <STR_LIT> : <STR_LIT> ) ) ; fprintf ( asm_out_file , <STR_LIT> ) ; fprintf ( asm_out_file , <STR_LIT> , ( ( TARGET_CMOV ) ? <STR_LIT> : <STR_LIT> ) ) ; fprintf ( asm_out_file , <STR_LIT> , ( ( TARGET_PERF_EXT ) ? <STR_LIT> : <STR_LIT> ) ) ; fprintf ( asm_out_file , <STR_LIT> ) ; fprintf ( asm_out_file , <STR_LIT> , ( ( TARGET_V3PUSH ) ? <STR_LIT> : <STR_LIT> ) ) ; fprintf ( asm_out_file , <STR_LIT> , ( ( TARGET_16_BIT ) ? <STR_LIT> : <STR_LIT> ) ) ;

fprintf ( asm_out_file , <STR_LIT> , ( ( TARGET_REDUCED_REGS ) ? <STR_LIT> : <STR_LIT> ) ) ;


<s> fprintf ( asm_out_file , <STR_LIT> , ( ( TARGET_CMOV ) ? <STR_LIT> : <STR_LIT> ) ) ; fprintf ( asm_out_file , <STR_LIT> , ( ( TARGET_PERF_EXT ) ? <STR_LIT> : <STR_LIT> ) ) ; fprintf ( asm_out_file , <STR_LIT> ) ; fprintf ( asm_out_file , <STR_LIT> , ( ( TARGET_V3PUSH ) ? <STR_LIT> : <STR_LIT> ) ) ; fprintf ( asm_out_file , <STR_LIT> , ( ( TARGET_16_BIT ) ? <STR_LIT> : <STR_LIT> ) ) ; fprintf ( asm_out_file , <STR_LIT> , ( ( TARGET_REDUCED_REGS ) ? <STR_LIT> : <STR_LIT> ) ) ; fprintf ( asm_out_file , <STR_LIT> ) ; if ( optimize_size ) fprintf ( asm_out_file , <STR_LIT> ) ; else fprintf ( asm_out_file , <STR_LIT> , optimize ) ; fprintf ( asm_out_file , <STR_LIT> ) ; fprintf ( asm_out_file , <STR_LIT> , nds32_cache_block_size ) ; fprintf ( asm_out_file , <STR_LIT> ) ; nds32_asm_file_start_for_isr ( ) ;


<s> static void nds32_asm_function_begin_epilogue ( FILE * file ) {

if ( ! frame_pointer_needed && ! cfun -> machine -> naked_p && cfun -> machine -> fp_as_gp_p ) {


<s> fprintf ( file , <STR_LIT> ) ; fprintf ( file , <STR_LIT> ) ; }


<s> fprintf ( file , <STR_LIT> <STR_LIT> ) ; fprintf ( file , <STR_LIT> <STR_LIT> ) ; fprintf ( file , <STR_LIT> ) ; fprintf ( file , <STR_LIT> <STR_LIT> ) ; fprintf ( file , <STR_LIT> ) ;


<s> static void nds32_asm_function_epilogue ( FILE * file , HOST_WIDE_INT size ATTRIBUTE_UNUSED ) { fprintf ( file , <STR_LIT> ) ;


<s> fprintf ( file , <STR_LIT> , cfun -> machine -> local_size ) ; fprintf ( file , <STR_LIT> , cfun -> machine -> out_args_size ) ; fprintf ( file , <STR_LIT> ) ; for ( r = <NUM_LIT> ; r < <NUM_LIT> ; r ++ ) { if ( df_regs_ever_live_p ( r ) ) fprintf ( file , <STR_LIT> , reg_names [ r ] ) ; } fputc ( '\n' , file ) ; fprintf ( file , <STR_LIT> ) ; attrs = DECL_ATTRIBUTES ( current_function_decl ) ; if ( ! attrs ) fprintf ( file , <STR_LIT> ) ; func_name = IDENTIFIER_POINTER ( DECL_NAME ( current_function_decl ) ) ; nds32_construct_isr_vectors_information ( attrs , func_name ) ; while ( attrs ) { name = TREE_PURPOSE ( attrs ) ;

fprintf ( file , <STR_LIT> , IDENTIFIER_POINTER ( name ) ) ;


<s> if ( satisfies_constraint_Is15 ( GEN_INT ( delta ) ) ) { fprintf ( file , <STR_LIT> , this_regno , this_regno , delta ) ; } else if ( satisfies_constraint_Is20 ( GEN_INT ( delta ) ) ) { fprintf ( file , <STR_LIT> , delta ) ; fprintf ( file , <STR_LIT> , this_regno , this_regno ) ; } else { fprintf ( file , <STR_LIT> , delta ) ; fprintf ( file , <STR_LIT> , delta ) ; fprintf ( file , <STR_LIT> , this_regno , this_regno ) ; } }


<s> static void nds32_asm_output_mi_thunk ( FILE * file , tree thunk ATTRIBUTE_UNUSED , HOST_WIDE_INT delta , HOST_WIDE_INT vcall_offset ATTRIBUTE_UNUSED , tree function ) { int this_regno ; final_start_function ( emit_barrier ( ) , file , <NUM_LIT> ) ; this_regno = ( aggregate_value_p ( TREE_TYPE ( TREE_TYPE ( function ) ) , function ) ? <NUM_LIT> : <NUM_LIT> ) ; if ( delta != <NUM_LIT> ) { if ( satisfies_constraint_Is15 ( GEN_INT ( delta ) ) ) { fprintf ( file , <STR_LIT> , this_regno , this_regno , delta ) ; } else if ( satisfies_constraint_Is20 ( GEN_INT ( delta ) ) ) { fprintf ( file , <STR_LIT> , delta ) ; fprintf ( file , <STR_LIT> , this_regno , this_regno ) ; } else {


<s> return ( cfun -> machine -> naked_p && ( cfun -> machine -> va_args_size == <NUM_LIT> ) ) ;


<s> int nds32_can_use_return_insn ( void ) { if ( ! reload_completed ) return <NUM_LIT> ;

return ( cfun -> machine -> naked_p && ( cfun -> machine -> va_args_size == <NUM_LIT> ) ) ;


<s> if ( lookup_attribute ( <STR_LIT> , DECL_ATTRIBUTES ( current_function_decl ) ) || ( cfun -> machine -> callee_saved_first_gpr_regno == SP_REGNUM && cfun -> machine -> callee_saved_last_gpr_regno == SP_REGNUM && ! df_regs_ever_live_p ( FP_REGNUM ) && ! df_regs_ever_live_p ( LP_REGNUM ) && cfun -> machine -> local_size == <NUM_LIT> ) ) { cfun -> machine -> naked_p = <NUM_LIT> ; cfun -> machine -> fp_size = <NUM_LIT> ; cfun -> machine -> gp_size = <NUM_LIT> ; cfun -> machine -> lp_size = <NUM_LIT> ; if ( flag_stack_usage_info ) current_function_static_stack_size = <NUM_LIT> ; return ; } if ( TARGET_V3PUSH && ! nds32_isr_function_p ( current_function_decl ) && ( cfun -> machine -> va_args_size == <NUM_LIT> ) ) { cfun -> machine -> fp_size = <NUM_LIT> ; cfun -> machine -> gp_size = <NUM_LIT> ; cfun -> machine -> lp_size = <NUM_LIT> ; cfun -> machine -> callee_saved_first_gpr_regno = <NUM_LIT> ; if ( cfun -> machine -> callee_saved_last_gpr_regno <= <NUM_LIT> ) { cfun -> machine -> callee_saved_last_gpr_regno = <NUM_LIT> ; } else if ( cfun -> machine -> callee_saved_last_gpr_regno <= <NUM_LIT> ) { cfun -> machine -> callee_saved_last_gpr_regno = <NUM_LIT> ; } else if ( cfun -> machine -> callee_saved_last_gpr_regno <= <NUM_LIT> ) { cfun -> machine -> callee_saved_last_gpr_regno = <NUM_LIT> ; } else if ( cfun -> machine -> callee_saved_last_gpr_regno <= <NUM_LIT> ) { cfun -> machine -> callee_saved_last_gpr_regno = <NUM_LIT> ; } else if ( cfun -> machine -> callee_saved_last_gpr_regno == SP_REGNUM ) { cfun -> machine -> callee_saved_last_gpr_regno = <NUM_LIT> ; } else { gcc_unreachable ( ) ; } } if ( cfun -> machine -> callee_saved_last_gpr_regno != SP_REGNUM ) { cfun -> machine -> callee_saved_gpr_regs_size = <NUM_LIT> * ( cfun -> machine -> callee_saved_last_gpr_regno - cfun -> machine -> callee_saved_first_gpr_regno + <NUM_LIT> ) ; } block_size = cfun -> machine -> fp_size + cfun -> machine -> gp_size + cfun -> machine -> lp_size + cfun -> machine -> callee_saved_gpr_regs_size ; if ( ! NDS32_DOUBLE_WORD_ALIGN_P ( block_size ) ) {

cfun -> machine -> callee_saved_area_gpr_padding_bytes = NDS32_ROUND_UP_DOUBLE_WORD ( block_size ) - block_size ;


<s> return ; } if ( TARGET_V3PUSH && ! nds32_isr_function_p ( current_function_decl ) && ( cfun -> machine -> va_args_size == <NUM_LIT> ) ) { cfun -> machine -> fp_size = <NUM_LIT> ; cfun -> machine -> gp_size = <NUM_LIT> ; cfun -> machine -> lp_size = <NUM_LIT> ; cfun -> machine -> callee_saved_first_gpr_regno = <NUM_LIT> ; if ( cfun -> machine -> callee_saved_last_gpr_regno <= <NUM_LIT> ) { cfun -> machine -> callee_saved_last_gpr_regno = <NUM_LIT> ; } else if ( cfun -> machine -> callee_saved_last_gpr_regno <= <NUM_LIT> ) { cfun -> machine -> callee_saved_last_gpr_regno = <NUM_LIT> ; } else if ( cfun -> machine -> callee_saved_last_gpr_regno <= <NUM_LIT> ) { cfun -> machine -> callee_saved_last_gpr_regno = <NUM_LIT> ; } else if ( cfun -> machine -> callee_saved_last_gpr_regno <= <NUM_LIT> ) { cfun -> machine -> callee_saved_last_gpr_regno = <NUM_LIT> ; } else if ( cfun -> machine -> callee_saved_last_gpr_regno == SP_REGNUM ) { cfun -> machine -> callee_saved_last_gpr_regno = <NUM_LIT> ; } else { gcc_unreachable ( ) ; } } if ( cfun -> machine -> callee_saved_last_gpr_regno != SP_REGNUM ) { cfun -> machine -> callee_saved_gpr_regs_size = <NUM_LIT> * ( cfun -> machine -> callee_saved_last_gpr_regno - cfun -> machine -> callee_saved_first_gpr_regno + <NUM_LIT> ) ; } block_size = cfun -> machine -> fp_size + cfun -> machine -> gp_size + cfun -> machine -> lp_size + cfun -> machine -> callee_saved_gpr_regs_size ; if ( ! NDS32_DOUBLE_WORD_ALIGN_P ( block_size ) ) { cfun -> machine -> callee_saved_area_gpr_padding_bytes = NDS32_ROUND_UP_DOUBLE_WORD ( block_size ) - block_size ; } if ( flag_stack_usage_info ) { current_function_static_stack_size = NDS32_ROUND_UP_DOUBLE_WORD ( block_size ) + cfun -> machine -> local_size + cfun -> machine -> out_args_size ;


<s> par_index = <NUM_LIT> ; offset = <NUM_LIT> ; for ( regno = REGNO ( Rb ) ; regno <= ( int ) REGNO ( Re ) ; regno ++ ) { if ( regno == SP_REGNUM ) break ; reg = gen_rtx_REG ( SImode , regno ) ; mem = gen_frame_mem ( SImode , plus_constant ( Pmode , stack_pointer_rtx , offset ) ) ; pop_rtx = gen_rtx_SET ( VOIDmode , reg , mem ) ; XVECEXP ( parallel_insn , <NUM_LIT> , par_index ) = pop_rtx ; RTX_FRAME_RELATED_P ( pop_rtx ) = <NUM_LIT> ; offset = offset + <NUM_LIT> ; par_index ++ ; dwarf = alloc_reg_note ( REG_CFA_RESTORE , reg , dwarf ) ; } if ( save_fp ) { reg = gen_rtx_REG ( SImode , FP_REGNUM ) ; mem = gen_frame_mem ( SImode , plus_constant ( Pmode , stack_pointer_rtx , offset ) ) ; pop_rtx = gen_rtx_SET ( VOIDmode , reg , mem ) ; XVECEXP ( parallel_insn , <NUM_LIT> , par_index ) = pop_rtx ; RTX_FRAME_RELATED_P ( pop_rtx ) = <NUM_LIT> ; offset = offset + <NUM_LIT> ; par_index ++ ; dwarf = alloc_reg_note ( REG_CFA_RESTORE , reg , dwarf ) ; } if ( save_gp ) { reg = gen_rtx_REG ( SImode , GP_REGNUM ) ; mem = gen_frame_mem ( SImode , plus_constant ( Pmode , stack_pointer_rtx , offset ) ) ; pop_rtx = gen_rtx_SET ( VOIDmode , reg , mem ) ; XVECEXP ( parallel_insn , <NUM_LIT> , par_index ) = pop_rtx ; RTX_FRAME_RELATED_P ( pop_rtx ) = <NUM_LIT> ; offset = offset + <NUM_LIT> ; par_index ++ ; dwarf = alloc_reg_note ( REG_CFA_RESTORE , reg , dwarf ) ; } if ( save_lp ) {

reg = gen_rtx_REG ( SImode , LP_REGNUM ) ;


<s> for ( regno = REGNO ( Rb ) ; regno <= ( int ) REGNO ( Re ) ; regno ++ ) { if ( regno == SP_REGNUM ) break ; reg = gen_rtx_REG ( SImode , regno ) ; mem = gen_frame_mem ( SImode , plus_constant ( Pmode , stack_pointer_rtx , offset ) ) ; pop_rtx = gen_rtx_SET ( VOIDmode , reg , mem ) ; XVECEXP ( parallel_insn , <NUM_LIT> , par_index ) = pop_rtx ; RTX_FRAME_RELATED_P ( pop_rtx ) = <NUM_LIT> ; offset = offset + <NUM_LIT> ; par_index ++ ; dwarf = alloc_reg_note ( REG_CFA_RESTORE , reg , dwarf ) ; } if ( save_fp ) { reg = gen_rtx_REG ( SImode , FP_REGNUM ) ; mem = gen_frame_mem ( SImode , plus_constant ( Pmode , stack_pointer_rtx , offset ) ) ; pop_rtx = gen_rtx_SET ( VOIDmode , reg , mem ) ; XVECEXP ( parallel_insn , <NUM_LIT> , par_index ) = pop_rtx ; RTX_FRAME_RELATED_P ( pop_rtx ) = <NUM_LIT> ; offset = offset + <NUM_LIT> ; par_index ++ ; dwarf = alloc_reg_note ( REG_CFA_RESTORE , reg , dwarf ) ; } if ( save_gp ) { reg = gen_rtx_REG ( SImode , GP_REGNUM ) ; mem = gen_frame_mem ( SImode , plus_constant ( Pmode , stack_pointer_rtx , offset ) ) ; pop_rtx = gen_rtx_SET ( VOIDmode , reg , mem ) ; XVECEXP ( parallel_insn , <NUM_LIT> , par_index ) = pop_rtx ; RTX_FRAME_RELATED_P ( pop_rtx ) = <NUM_LIT> ; offset = offset + <NUM_LIT> ; par_index ++ ; dwarf = alloc_reg_note ( REG_CFA_RESTORE , reg , dwarf ) ;


<s> rtx parallel_insn ; rtx dwarf ; save_fp = INTVAL ( En4 ) & <NUM_LIT> ; save_gp = INTVAL ( En4 ) & <NUM_LIT> ; save_lp = INTVAL ( En4 ) & <NUM_LIT> ; extra_count = <NUM_LIT> ; if ( save_fp ) extra_count ++ ; if ( save_gp ) extra_count ++ ; if ( save_lp ) extra_count ++ ; if ( REGNO ( Rb ) == SP_REGNUM && REGNO ( Re ) == SP_REGNUM ) num_use_regs = extra_count ; else num_use_regs = REGNO ( Re ) - REGNO ( Rb ) + <NUM_LIT> + extra_count ; parallel_insn = gen_rtx_PARALLEL ( VOIDmode , rtvec_alloc ( num_use_regs + <NUM_LIT> ) ) ; par_index = <NUM_LIT> ; offset = - ( num_use_regs * <NUM_LIT> ) ; for ( regno = REGNO ( Rb ) ; regno <= ( int ) REGNO ( Re ) ; regno ++ ) { if ( regno == SP_REGNUM ) break ; reg = gen_rtx_REG ( SImode , regno ) ; mem = gen_frame_mem ( SImode , plus_constant ( Pmode , stack_pointer_rtx , offset ) ) ;

push_rtx = gen_rtx_SET ( VOIDmode , mem , reg ) ;


<s> mem = gen_frame_mem ( SImode , plus_constant ( Pmode , stack_pointer_rtx , offset ) ) ; push_rtx = gen_rtx_SET ( VOIDmode , mem , reg ) ; XVECEXP ( parallel_insn , <NUM_LIT> , par_index ) = push_rtx ; RTX_FRAME_RELATED_P ( push_rtx ) = <NUM_LIT> ; offset = offset + <NUM_LIT> ; par_index ++ ; } if ( save_fp ) { reg = gen_rtx_REG ( SImode , FP_REGNUM ) ; mem = gen_frame_mem ( SImode , plus_constant ( Pmode , stack_pointer_rtx , offset ) ) ; push_rtx = gen_rtx_SET ( VOIDmode , mem , reg ) ; XVECEXP ( parallel_insn , <NUM_LIT> , par_index ) = push_rtx ; RTX_FRAME_RELATED_P ( push_rtx ) = <NUM_LIT> ; offset = offset + <NUM_LIT> ; par_index ++ ; } if ( save_gp ) { reg = gen_rtx_REG ( SImode , GP_REGNUM ) ; mem = gen_frame_mem ( SImode , plus_constant ( Pmode , stack_pointer_rtx , offset ) ) ; push_rtx = gen_rtx_SET ( VOIDmode , mem , reg ) ; XVECEXP ( parallel_insn , <NUM_LIT> , par_index ) = push_rtx ; RTX_FRAME_RELATED_P ( push_rtx ) = <NUM_LIT> ; offset = offset + <NUM_LIT> ; par_index ++ ; } if ( save_lp ) { reg = gen_rtx_REG ( SImode , LP_REGNUM ) ; mem = gen_frame_mem ( SImode , plus_constant ( Pmode , stack_pointer_rtx , offset ) ) ; push_rtx = gen_rtx_SET ( VOIDmode , mem , reg ) ; XVECEXP ( parallel_insn , <NUM_LIT> , par_index ) = push_rtx ; RTX_FRAME_RELATED_P ( push_rtx ) = <NUM_LIT> ; offset = offset + <NUM_LIT> ; par_index ++ ; } offset = - ( num_use_regs * <NUM_LIT> ) ; adjust_sp_rtx = gen_rtx_SET ( VOIDmode , stack_pointer_rtx , plus_constant ( Pmode , stack_pointer_rtx , offset ) ) ; XVECEXP ( parallel_insn , <NUM_LIT> , par_index ) = adjust_sp_rtx ; RTX_FRAME_RELATED_P ( adjust_sp_rtx ) = <NUM_LIT> ; parallel_insn = emit_insn ( parallel_insn ) ;


<s> static void nds32_emit_stack_v3pop ( rtx Rb , rtx Re , rtx En4 ATTRIBUTE_UNUSED , rtx imm8u ) { int 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 = REGNO ( Re ) - REGNO ( Rb ) + <NUM_LIT> + <NUM_LIT> ; parallel_insn = gen_rtx_PARALLEL ( VOIDmode , rtvec_alloc ( num_use_regs + <NUM_LIT> ) ) ; par_index = <NUM_LIT> ; offset = <NUM_LIT> ; for ( regno = REGNO ( Rb ) ; regno <= ( int ) 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 ( VOIDmode , reg , mem ) ; XVECEXP ( parallel_insn , <NUM_LIT> , par_index ) = pop_rtx ; RTX_FRAME_RELATED_P ( pop_rtx ) = <NUM_LIT> ; offset = offset + <NUM_LIT> ; 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 ( VOIDmode , reg , mem ) ; XVECEXP ( parallel_insn , <NUM_LIT> , par_index ) = pop_rtx ; RTX_FRAME_RELATED_P ( pop_rtx ) = <NUM_LIT> ; offset = offset + <NUM_LIT> ; par_index ++ ; dwarf = alloc_reg_note ( REG_CFA_RESTORE , reg , dwarf ) ;

reg = gen_rtx_REG ( SImode , GP_REGNUM ) ;


<s> Re = gen_rtx_REG ( SImode , cfun -> machine -> callee_saved_last_gpr_regno ) ; en4_const = <NUM_LIT> ; if ( cfun -> machine -> fp_size ) en4_const += <NUM_LIT> ; if ( cfun -> machine -> gp_size ) en4_const += <NUM_LIT> ; if ( cfun -> machine -> lp_size ) en4_const += <NUM_LIT> ; if ( ! ( REGNO ( Rb ) == SP_REGNUM && REGNO ( Re ) == SP_REGNUM && en4_const == <NUM_LIT> ) ) { nds32_emit_stack_pop_multiple ( Rb , Re , GEN_INT ( en4_const ) ) ; } if ( cfun -> machine -> va_args_size != <NUM_LIT> ) { sp_adjust = cfun -> machine -> va_args_size + cfun -> machine -> va_args_area_padding_bytes ; sp_adjust_insn = gen_addsi3 ( stack_pointer_rtx , stack_pointer_rtx , GEN_INT ( sp_adjust ) ) ; sp_adjust_insn = emit_insn ( sp_adjust_insn ) ; RTX_FRAME_RELATED_P ( sp_adjust_insn ) = <NUM_LIT> ;


<s> rtx Rb , Re ; rtx sp_adjust_insn ; nds32_compute_stack_frame ( ) ; emit_insn ( gen_blockage ( ) ) ; if ( cfun -> machine -> naked_p ) { if ( ! sibcall_p ) emit_jump_insn ( gen_return_internal ( ) ) ; return ; } Rb = gen_rtx_REG ( SImode , cfun -> machine -> callee_saved_first_gpr_regno ) ; Re = gen_rtx_REG ( SImode , 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 ; if ( satisfies_constraint_Iu08 ( GEN_INT ( sp_adjust ) ) && NDS32_DOUBLE_WORD_ALIGN_P ( sp_adjust ) && ! cfun -> calls_alloca ) { nds32_emit_stack_v3pop ( Rb , Re , GEN_INT ( <NUM_LIT> ) , GEN_INT ( 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 ; sp_adjust_insn = gen_addsi3 ( stack_pointer_rtx , hard_frame_pointer_rtx , GEN_INT ( - <NUM_LIT> * sp_adjust ) ) ;