<s> __builtin_loongarch_asrtgt_d ( ( long int ) _1 , ( long int ) _2 ) ;


<s> extern __inline void __attribute__ ( ( __gnu_inline__ , __always_inline__ , __artificial__ ) ) __asrtle_d ( long int _1 , long int _2 ) { __builtin_loongarch_asrtle_d ( ( long int ) _1 , ( long int ) _2 ) ;


<s> extern __inline void __attribute__ ( ( __gnu_inline__ , __always_inline__ , __artificial__ ) ) __asrtle_d ( long int _1 , long int _2 ) {

__builtin_loongarch_asrtle_d ( ( long int ) _1 , ( long int ) _2 ) ;


<s> __cpucfg ( unsigned int _1 ) { return ( unsigned int ) __builtin_loongarch_cpucfg ( ( unsigned int ) _1 ) ;


return ( int ) __builtin_loongarch_crcc_w_b_w ( ( char ) _1 , ( int ) _2 ) ;


<s> extern __inline int __attribute__ ( ( __gnu_inline__ , __always_inline__ , __artificial__ ) ) __crcc_w_b_w ( char _1 , int _2 ) { return ( int ) __builtin_loongarch_crcc_w_b_w ( ( char ) _1 , ( int ) _2 ) ;


<s> extern __inline int __attribute__ ( ( __gnu_inline__ , __always_inline__ , __artificial__ ) ) __crcc_w_d_w ( long int _1 , int _2 ) {

return ( int ) __builtin_loongarch_crcc_w_d_w ( ( long int ) _1 , ( int ) _2 ) ;


<s> return ( int ) __builtin_loongarch_crcc_w_h_w ( ( short ) _1 , ( int ) _2 ) ;


<s> extern __inline int __attribute__ ( ( __gnu_inline__ , __always_inline__ , __artificial__ ) ) __crcc_w_h_w ( short _1 , int _2 ) { return ( int ) __builtin_loongarch_crcc_w_h_w ( ( short ) _1 , ( int ) _2 ) ;


return ( int ) __builtin_loongarch_crcc_w_w_w ( ( int ) _1 , ( int ) _2 ) ;


<s> return ( int ) __builtin_loongarch_crcc_w_w_w ( ( int ) _1 , ( int ) _2 ) ;


<s> extern __inline int __attribute__ ( ( __gnu_inline__ , __always_inline__ , __artificial__ ) ) __crc_w_b_w ( char _1 , int _2 ) { return ( int ) __builtin_loongarch_crc_w_b_w ( ( char ) _1 , ( int ) _2 ) ;


<s> extern __inline int __attribute__ ( ( __gnu_inline__ , __always_inline__ , __artificial__ ) ) __crc_w_d_w ( long int _1 , int _2 ) { return ( int ) __builtin_loongarch_crc_w_d_w ( ( long int ) _1 , ( int ) _2 ) ;


<s> extern __inline int __attribute__ ( ( __gnu_inline__ , __always_inline__ , __artificial__ ) ) __crc_w_h_w ( short _1 , int _2 ) { return ( int ) __builtin_loongarch_crc_w_h_w ( ( short ) _1 , ( int ) _2 ) ;


return ( int ) __builtin_loongarch_crc_w_w_w ( ( int ) _1 , ( int ) _2 ) ;


<s> return ( int ) __builtin_loongarch_crc_w_w_w ( ( int ) _1 , ( int ) _2 ) ;


<s> char __attribute__ ( ( __gnu_inline__ , __always_inline__ , __artificial__ ) ) __iocsrrd_b ( unsigned int _1 ) {

return ( unsigned char ) __builtin_loongarch_iocsrrd_b ( ( unsigned int ) _1 ) ;


<s> return ( unsigned char ) __builtin_loongarch_iocsrrd_b ( ( unsigned int ) _1 ) ;


<s> __iocsrrd_d ( unsigned int _1 ) { return ( unsigned long int ) __builtin_loongarch_iocsrrd_d ( ( unsigned int ) _1 ) ;


<s> return ( unsigned int ) __builtin_loongarch_iocsrrd_w ( ( unsigned int ) _1 ) ;


<s> extern __inline void __attribute__ ( ( __gnu_inline__ , __always_inline__ , __artificial__ ) ) __iocsrwr_b ( unsigned char _1 , unsigned int _2 ) { __builtin_loongarch_iocsrwr_b ( ( unsigned char ) _1 , ( unsigned int ) _2 ) ;


<s> __builtin_loongarch_iocsrwr_h ( ( unsigned short ) _1 , ( unsigned int ) _2 ) ;


<s> extern __inline void __attribute__ ( ( __gnu_inline__ , __always_inline__ , __artificial__ ) ) __iocsrwr_w ( unsigned int _1 , unsigned int _2 ) { __builtin_loongarch_iocsrwr_w ( ( unsigned int ) _1 , ( unsigned int ) _2 ) ;


__asm__ volatile ( <STR_LIT> : [ val ] <STR_LIT> ( __rdtime . value ) , [ tid ] <STR_LIT> ( __rdtime . timeid ) : ) ;


<s> __asm__ volatile ( <STR_LIT> : [ val ] <STR_LIT> ( __rdtime . value ) , [ tid ] <STR_LIT> ( __rdtime . timeid ) : ) ; return __rdtime ;


<s> __asm__ volatile ( <STR_LIT> : [ val ] <STR_LIT> ( __rdtime . value ) , [ tid ] <STR_LIT> ( __rdtime . timeid ) : ) ;


<s> extern __inline __rdtime_t __attribute__ ( ( __gnu_inline__ , __always_inline__ , __artificial__ ) ) __rdtimel_w ( void ) { __rdtime_t __rdtime ; __asm__ volatile ( <STR_LIT> : [ val ] <STR_LIT> ( __rdtime . value ) , [ tid ] <STR_LIT> ( __rdtime . timeid ) : ) ;


<s> __rdtime_d ( void ) { __drdtime_t __drdtime ; __asm__ volatile ( <STR_LIT> : [ val ] <STR_LIT> ( __drdtime . dvalue ) , [ tid ] <STR_LIT> ( __drdtime . dtimeid ) : ) ; return __drdtime ;


<s> __asm__ volatile ( <STR_LIT> : [ val ] <STR_LIT> ( __drdtime . dvalue ) , [ tid ] <STR_LIT> ( __drdtime . dtimeid ) : ) ; return __drdtime ;


* update = build2 ( COMPOUND_EXPR , void_type_node , * update , atomic_feraiseexcept_call ) ;


<s> tree loongarch_builtin_decl ( unsigned int code , bool initialize_p ATTRIBUTE_UNUSED ) { if ( code >= ARRAY_SIZE ( loongarch_builtins ) ) return error_mark_node ; return loongarch_builtin_decls [ code ] ;


<s> unsigned int fcode , avail ; const struct loongarch_builtin_description * d ; fndecl = TREE_OPERAND ( CALL_EXPR_FN ( exp ) , <NUM_LIT> ) ; fcode = DECL_MD_FUNCTION_CODE ( fndecl ) ; gcc_assert ( fcode < ARRAY_SIZE ( loongarch_builtins ) ) ; d = & loongarch_builtins [ fcode ] ; avail = d -> avail ( ) ; gcc_assert ( avail != <NUM_LIT> ) ; switch ( d -> builtin_type ) { case LARCH_BUILTIN_DIRECT : return loongarch_expand_builtin_direct ( d -> icode , target , exp , true ) ;


<s> static rtx loongarch_expand_builtin_direct ( enum insn_code icode , rtx target , tree exp , bool has_target_p ) { struct expand_operand ops [ MAX_RECOG_OPERANDS ] ; int opno , argno ; opno = <NUM_LIT> ; if ( has_target_p ) create_output_operand ( & ops [ opno ++ ] , target , TYPE_MODE ( TREE_TYPE ( exp ) ) ) ; gcc_assert ( opno + call_expr_nargs ( exp ) == insn_data [ icode ] . n_generator_args ) ; for ( argno = <NUM_LIT> ; argno < call_expr_nargs ( exp ) ; argno ++ ) loongarch_prepare_builtin_arg ( & ops [ opno ++ ] , exp , argno ) ;

return loongarch_expand_builtin_insn ( icode , opno , ops , has_target_p ) ;


<s> if ( has_target_p ) create_output_operand ( & ops [ opno ++ ] , target , TYPE_MODE ( TREE_TYPE ( exp ) ) ) ; gcc_assert ( opno + call_expr_nargs ( exp ) == insn_data [ icode ] . n_generator_args ) ;

for ( argno = <NUM_LIT> ; argno < call_expr_nargs ( exp ) ; argno ++ ) loongarch_prepare_builtin_arg ( & ops [ opno ++ ] , exp , argno ) ;


<s> if ( ! maybe_expand_insn ( icode , nops , ops ) ) { error ( <STR_LIT> ) ;

return has_target_p ? gen_reg_rtx ( ops [ <NUM_LIT> ] . mode ) : const0_rtx ;


<s> error ( <STR_LIT> ) ; return has_target_p ? gen_reg_rtx ( ops [ <NUM_LIT> ] . mode ) : const0_rtx ; }

return has_target_p ? ops [ <NUM_LIT> ] . value : const0_rtx ;


<s> void loongarch_init_builtins ( void ) { const struct loongarch_builtin_description * d ; unsigned int i ; tree type ; for ( i = <NUM_LIT> ; i < ARRAY_SIZE ( loongarch_builtins ) ; i ++ ) { d = & loongarch_builtins [ i ] ; if ( d -> avail ( ) ) { type = loongarch_build_function_type ( d -> function_type ) ; loongarch_builtin_decls [ i ] = add_builtin_function ( d -> name , type , i , BUILT_IN_MD , NULL , NULL ) ; loongarch_get_builtin_decl_index [ d -> icode ] = i ; }


<s> static void loongarch_prepare_builtin_arg ( struct expand_operand * op , tree exp , unsigned int argno ) { tree arg ; rtx value ;


<s> for ( unsigned int i = <NUM_LIT> ; i < sizeof ( cpucfg_useful_idx ) / sizeof ( int ) ; i ++ ) { cpucfg_cache [ cpucfg_useful_idx [ i ] ] = read_cpucfg_word ( cpucfg_useful_idx [ i ] ) ;


<s> cpucfg_cache [ cpucfg_useful_idx [ i ] ] = read_cpucfg_word ( cpucfg_useful_idx [ i ] ) ;


loongarch_cpu_cache [ CPU_NATIVE ] . l1d_size = ( <NUM_LIT> << ( ( l1_szword & <NUM_LIT> ) >> <NUM_LIT> ) ) * ( ( l1_szword & <NUM_LIT> ) + <NUM_LIT> ) * ( <NUM_LIT> << ( ( l1_szword & <NUM_LIT> ) >> <NUM_LIT> ) ) >> <NUM_LIT> ;


<s> uint32_t get_native_prid ( void ) { return cpucfg_cache [ <NUM_LIT> ] ;


<s> static char prid_str [ <NUM_LIT> ] ; sprintf ( prid_str , <STR_LIT> , cpucfg_cache [ <NUM_LIT> ] ) ;


<s> static char prid_str [ <NUM_LIT> ] ;

sprintf ( prid_str , <STR_LIT> , cpucfg_cache [ <NUM_LIT> ] ) ;


<s> static uint32_t read_cpucfg_word ( int wordno ) { ( void ) wordno ;


<s> static uint32_t read_cpucfg_word ( int wordno ) { ( void ) wordno ; uint32_t ret = <NUM_LIT> ; __asm__ __volatile__ ( <STR_LIT> : <STR_LIT> ( ret ) : <STR_LIT> ( wordno ) : ) ; return ret ;


<s> return <STR_LIT> ; } loongarch_config_target ( & la_target , opt_switches , opt_arch_driver , opt_tune_driver , opt_fpu_driver , opt_abi_base_driver , opt_abi_ext_driver , opt_cmodel_driver , ! no_link ) ; obstack_blank ( & opts_obstack , <NUM_LIT> ) ; obstack_grow ( & opts_obstack , ( const void * ) ( S ) , \ sizeof ( ( S ) ) / sizeof ( char ) - <NUM_LIT> ) obstack_grow ( & opts_obstack , ( const void * ) ( S ) , strlen ( ( S ) ) ) APPEND_LTR ( <STR_LIT> OPTSTR_ ## NAME <STR_LIT> \ <STR_LIT> OPTSTR_ ## NAME <STR_LIT> ) for ( int i = <NUM_LIT> ; i < N_SWITCH_TYPES ; i ++ ) { APPEND_LTR ( <STR_LIT> ) ;

APPEND_VAL ( loongarch_switch_strings [ i ] ) ;


<s> obstack_blank ( & opts_obstack , <NUM_LIT> ) ; obstack_grow ( & opts_obstack , ( const void * ) ( S ) , \ sizeof ( ( S ) ) / sizeof ( char ) - <NUM_LIT> ) obstack_grow ( & opts_obstack , ( const void * ) ( S ) , strlen ( ( S ) ) ) APPEND_LTR ( <STR_LIT> OPTSTR_ ## NAME <STR_LIT> \ <STR_LIT> OPTSTR_ ## NAME <STR_LIT> ) for ( int i = <NUM_LIT> ; i < N_SWITCH_TYPES ; i ++ ) { APPEND_LTR ( <STR_LIT> ) ;


<s> int parm_off = <NUM_LIT> ; if ( argc != <NUM_LIT> ) return <STR_LIT> ; ( strncmp ( argv [ <NUM_LIT> ] , OPTSTR_ ## NAME <STR_LIT> , \ ( parm_off = sizeof ( OPTSTR_ ## NAME ) ) ) == <NUM_LIT> ) if ( strcmp ( argv [ <NUM_LIT> ] , <STR_LIT> ) == <NUM_LIT> ) {


<s> const struct loongarch_isa * isa2 = & isa_required ( abi ) ;

compatible = compatible && isa_base_compat_p ( isa , isa2 ) ;


<s> switch ( abi . base ) { case ABI_BASE_LP64D : case ABI_BASE_LP64F :


<s> case ABI_BASE_LP64F : case ABI_BASE_LP64S :

if ( abi . ext == ABI_EXT_BASE ) return CPU_LOONGARCH64 ;


<s> static const char * abi_str ( struct loongarch_abi abi ) {

if ( abi . ext == ABI_EXT_BASE ) return ( const char * ) obstack_copy0 ( & msg_obstack , loongarch_abi_base_strings [ abi . base ] , strlen ( loongarch_abi_base_strings [ abi . base ] ) ) ;


APPEND_STRING ( loongarch_abi_base_strings [ abi . base ] ) APPEND1 ( '/' ) APPEND_STRING ( loongarch_abi_ext_strings [ abi . ext ] ) APPEND1 ( '\0' ) return XOBFINISH ( & msg_obstack , const char * ) ;


<s> if ( target -> cpu_arch == CPU_NATIVE ) { if ( target -> cpu_native == CPU_NATIVE ) { const char * isa_string = isa_str ( & target -> isa , ',' ) ; APPEND_STRING ( <STR_LIT> ) APPEND_STRING ( get_native_prid_str ( ) ) APPEND_STRING ( <STR_LIT> ) APPEND_STRING ( isa_string ) APPEND1 ( '\0' ) } else APPEND_STRING ( loongarch_cpu_strings [ target -> cpu_native ] ) ; } else APPEND_STRING ( loongarch_cpu_strings [ target -> cpu_arch ] ) ; APPEND1 ( '\0' ) return XOBFINISH ( & msg_obstack , const char * ) ;


<s> if ( target -> cpu_native == CPU_NATIVE ) { const char * isa_string = isa_str ( & target -> isa , ',' ) ; APPEND_STRING ( <STR_LIT> ) APPEND_STRING ( get_native_prid_str ( ) ) APPEND_STRING ( <STR_LIT> ) APPEND_STRING ( isa_string ) APPEND1 ( '\0' ) }

else APPEND_STRING ( loongarch_cpu_strings [ target -> cpu_native ] ) ;


<s> enabled_abi_types [ DEFAULT_ABI_BASE ] [ DEFAULT_ABI_EXT ] = <NUM_LIT> ; int abi_base , abi_ext ; for ( unsigned int i = <NUM_LIT> ; i < MULTILIB_LIST_LEN ; i ++ ) { abi_base = tm_multilib_list [ i << <NUM_LIT> ] ;

abi_ext = tm_multilib_list [ ( i << <NUM_LIT> ) + <NUM_LIT> ] ;


<s> static void init_enabled_abi_types ( ) { enabled_abi_types [ DEFAULT_ABI_BASE ] [ DEFAULT_ABI_EXT ] = <NUM_LIT> ; int abi_base , abi_ext ; for ( unsigned int i = <NUM_LIT> ; i < MULTILIB_LIST_LEN ; i ++ ) { abi_base = tm_multilib_list [ i << <NUM_LIT> ] ;


<s> switch ( set2 -> base ) { case ISA_BASE_LA64V100 : return ( set1 -> base == ISA_BASE_LA64V100 ) ; default : gcc_unreachable ( ) ; }


<s> break ; case ISA_EXT_FPU32 : if ( isa -> base == ISA_BASE_LA64V100 ) abi . base = ABI_BASE_LP64F ; break ; case ISA_EXT_NOFPU : if ( isa -> base == ISA_BASE_LA64V100 ) abi . base = ABI_BASE_LP64S ; break ; default : gcc_unreachable ( ) ;


<s> case ISA_EXT_FPU64 : return set1 -> fpu == ISA_EXT_FPU64 ; case ISA_EXT_FPU32 : return set1 -> fpu == ISA_EXT_FPU32 || set1 -> fpu == ISA_EXT_FPU64 ;


<s> case ISA_EXT_FPU32 : return set1 -> fpu == ISA_EXT_FPU32 || set1 -> fpu == ISA_EXT_FPU64 ; case ISA_EXT_NOFPU : return <NUM_LIT> ; default : gcc_unreachable ( ) ;


<s> static const char * isa_str ( const struct loongarch_isa * isa , char separator ) { APPEND_STRING ( loongarch_isa_base_strings [ isa -> base ] ) APPEND1 ( separator ) if ( isa -> fpu == ISA_EXT_NOFPU ) { APPEND_STRING ( <STR_LIT> OPTSTR_ISA_EXT_FPU ) } else {

APPEND_STRING ( OPTSTR_ISA_EXT_FPU ) APPEND_STRING ( loongarch_isa_ext_strings [ isa -> fpu ] ) }


<s> static const char * isa_str ( const struct loongarch_isa * isa , char separator ) { APPEND_STRING ( loongarch_isa_base_strings [ isa -> base ] ) APPEND1 ( separator ) if ( isa -> fpu == ISA_EXT_NOFPU ) { APPEND_STRING ( <STR_LIT> OPTSTR_ISA_EXT_FPU ) } else { APPEND_STRING ( OPTSTR_ISA_EXT_FPU ) APPEND_STRING ( loongarch_isa_ext_strings [ isa -> fpu ] ) }

APPEND1 ( '\0' ) return XOBFINISH ( & msg_obstack , const char * ) ;


<s> static inline int is_multilib_enabled ( struct loongarch_abi abi ) {

return enabled_abi_types [ abi . base ] [ abi . ext ] ;


<s> constrained . fpu = <NUM_LIT> ; struct loongarch_isa default_isa = isa_required ( t . abi ) ; struct loongarch_isa force_isa = default_isa ; struct loongarch_abi force_abi = t . abi ; force_isa . fpu = opt_fpu ; force_abi . base = isa_default_abi ( & force_isa ) . base ; if ( constrained . abi_base && ( t . abi . base != force_abi . base ) ) inform ( UNKNOWN_LOCATION , <STR_LIT> , loongarch_switch_strings [ on_switch ] , OPTSTR_ABI_BASE , loongarch_abi_base_strings [ t . abi . base ] , abi_str ( force_abi ) ) ; t . abi . base = force_abi . base ; } if ( follow_multilib_list ) if ( t . abi . base != DEFAULT_ABI_BASE || t . abi . ext != DEFAULT_ABI_EXT ) { static const struct loongarch_abi default_abi = { DEFAULT_ABI_BASE , DEFAULT_ABI_EXT } ; warning ( <NUM_LIT> , <STR_LIT> , abi_str ( default_abi ) , abi_str ( t . abi ) ) ; } t . cpu_arch = constrained . arch ? opt_arch : DEFAULT_CPU_ARCH ; t . cpu_tune = constrained . tune ? opt_tune : ( constrained . arch ? DEFAULT_CPU_ARCH : DEFAULT_CPU_TUNE ) ; t . cpu_native = fill_native_cpu_config ( t . cpu_arch == CPU_NATIVE , t . cpu_tune == CPU_NATIVE ) ; if ( t . cpu_arch == CPU_NATIVE ) fatal_error ( UNKNOWN_LOCATION , <STR_LIT> , <STR_LIT> OPTSTR_ARCH <STR_LIT> STR_CPU_NATIVE ) ; else if ( t . cpu_tune == CPU_NATIVE ) fatal_error ( UNKNOWN_LOCATION , <STR_LIT> , <STR_LIT> OPTSTR_TUNE <STR_LIT> STR_CPU_NATIVE ) ; config_target_isa : t . isa = loongarch_cpu_default_isa [ LARCH_ACTUAL_ARCH ] ; t . isa . fpu = constrained . fpu ? opt_fpu : ( ( t . cpu_arch == CPU_NATIVE && constrained . arch ) ? t . isa . fpu : DEFAULT_ISA_EXT_FPU ) ; struct loongarch_abi abi_tmp ; const struct loongarch_isa * isa_min ; abi_tmp = t . abi ; isa_min = & isa_required ( abi_tmp ) ; if ( isa_base_compat_p ( & t . isa , isa_min ) ) ; else if ( ! constrained . arch ) { int fallback_arch = abi_default_cpu_arch ( t . abi ) ; if ( t . cpu_arch == CPU_NATIVE ) warning ( <NUM_LIT> , <STR_LIT> <STR_LIT> , arch_str ( & t ) , abi_str ( t . abi ) , OPTSTR_ARCH , loongarch_cpu_strings [ fallback_arch ] ) ; else warning ( <NUM_LIT> , <STR_LIT> <STR_LIT> , arch_str ( & t ) , abi_str ( t . abi ) , OPTSTR_ARCH , loongarch_cpu_strings [ fallback_arch ] ) ; t . cpu_arch = fallback_arch ; constrained . arch = <NUM_LIT> ; goto config_target_isa ; } else if ( ! constrained . abi_base ) { abi_tmp . base = isa_default_abi ( & t . isa ) . base ;


<s> int enabled_abi_idx [ MULTILIB_LIST_LEN ] = { <NUM_LIT> } ; const char * enabled_abi_str [ MULTILIB_LIST_LEN ] = { NULL } ; unsigned int j = <NUM_LIT> ; for ( unsigned int i = <NUM_LIT> ; i < ABI_COUNT && j < MULTILIB_LIST_LEN ; i ++ ) { if ( enabled_abi_types [ abi_priority_list [ i ] . base ] [ abi_priority_list [ i ] . ext ] ) { enabled_abi_idx [ j ++ ] = i ;


<s> return ( loongarch_classify_address ( & addr , x , mode , false ) && ( ( addr . type == ADDRESS_REG && CONST_INT_P ( addr . offset ) && LARCH_12BIT_OFFSET_P ( INTVAL ( addr . offset ) ) ) || addr . type == ADDRESS_LO_SUM ) ) ;


<s> struct loongarch_address_info addr ; int factor ; if ( ! loongarch_classify_address ( & addr , x , mode , false ) ) return <NUM_LIT> ;

if ( mode != BLKmode && might_split_p ) factor = ( GET_MODE_SIZE ( mode ) + UNITS_PER_WORD - <NUM_LIT> ) / UNITS_PER_WORD ;


<s> codes [ cost ] . code = UNKNOWN ; codes [ cost ] . method = METHOD_NORMAL ; codes [ cost ] . value = low_part & ~ ( IMM_REACH - <NUM_LIT> ) ; codes [ cost ] . curr_value = codes [ cost ] . value ; cost ++ ; HOST_WIDE_INT iorv = low_part & ( IMM_REACH - <NUM_LIT> ) ; if ( iorv != <NUM_LIT> ) { codes [ cost ] . code = IOR ; codes [ cost ] . method = METHOD_NORMAL ; codes [ cost ] . value = iorv ; codes [ cost ] . curr_value = low_part ; cost ++ ; } } if ( TARGET_64BIT ) { bool lu32i [ <NUM_LIT> ] = { ( value & LU32I_B ) == <NUM_LIT> , ( value & LU32I_B ) == LU32I_B } ; bool lu52i [ <NUM_LIT> ] = { ( value & LU52I_B ) == <NUM_LIT> , ( value & LU52I_B ) == LU52I_B } ; int sign31 = ( value & ( HOST_WIDE_INT_1U << <NUM_LIT> ) ) >> <NUM_LIT> ; int sign51 = ( value & ( HOST_WIDE_INT_1U << <NUM_LIT> ) ) >> <NUM_LIT> ; if ( lu32i [ sign31 ] && lu52i [ sign31 ] ) return cost ; else if ( lu32i [ sign31 ] ) { codes [ cost ] . method = METHOD_LU52I ; codes [ cost ] . value = value & LU52I_B ; codes [ cost ] . curr_value = value ; return cost + <NUM_LIT> ; } codes [ cost ] . method = METHOD_LU32I ;

codes [ cost ] . value = ( value & LU32I_B ) | ( sign51 ? LU52I_B : <NUM_LIT> ) ;


<s> bool lu32i [ <NUM_LIT> ] = { ( value & LU32I_B ) == <NUM_LIT> , ( value & LU32I_B ) == LU32I_B } ; bool lu52i [ <NUM_LIT> ] = { ( value & LU52I_B ) == <NUM_LIT> , ( value & LU52I_B ) == LU52I_B } ; int sign31 = ( value & ( HOST_WIDE_INT_1U << <NUM_LIT> ) ) >> <NUM_LIT> ; int sign51 = ( value & ( HOST_WIDE_INT_1U << <NUM_LIT> ) ) >> <NUM_LIT> ; if ( lu32i [ sign31 ] && lu52i [ sign31 ] ) return cost ; else if ( lu32i [ sign31 ] ) { codes [ cost ] . method = METHOD_LU52I ; codes [ cost ] . value = value & LU52I_B ; codes [ cost ] . curr_value = value ; return cost + <NUM_LIT> ; } codes [ cost ] . method = METHOD_LU32I ; codes [ cost ] . value = ( value & LU32I_B ) | ( sign51 ? LU52I_B : <NUM_LIT> ) ; codes [ cost ] . curr_value = ( value & <NUM_LIT> ) | ( sign51 ? LU52I_B : <NUM_LIT> ) ; cost ++ ; if ( ! lu52i [ ( value & ( HOST_WIDE_INT_1U << <NUM_LIT> ) ) >> <NUM_LIT> ] ) { codes [ cost ] . method = METHOD_LU52I ; codes [ cost ] . value = value & LU52I_B ; codes [ cost ] . curr_value = value ;


<s> rtx loc , a0 ; rtx_insn * insn ; rtx tmp = gen_reg_rtx ( Pmode ) ; a0 = gen_rtx_REG ( Pmode , GP_ARG_FIRST ) ; if ( ! loongarch_tls_symbol ) loongarch_tls_symbol = init_one_libfunc ( <STR_LIT> ) ; loc = loongarch_unspec_address ( sym , type ) ; start_sequence ( ) ; if ( TARGET_EXPLICIT_RELOCS ) { rtx high = gen_rtx_HIGH ( Pmode , copy_rtx ( loc ) ) ; high = loongarch_force_temporary ( tmp , high ) ; if ( TARGET_CMODEL_EXTREME ) { gcc_assert ( TARGET_EXPLICIT_RELOCS ) ; rtx tmp1 = gen_reg_rtx ( Pmode ) ; emit_insn ( gen_tls_low ( Pmode , tmp1 , gen_rtx_REG ( Pmode , <NUM_LIT> ) , loc ) ) ; emit_insn ( gen_lui_h_lo20 ( tmp1 , tmp1 , loc ) ) ; emit_insn ( gen_lui_h_hi12 ( tmp1 , tmp1 , loc ) ) ; emit_move_insn ( a0 , gen_rtx_PLUS ( Pmode , high , tmp1 ) ) ; } else emit_insn ( gen_tls_low ( Pmode , a0 , high , loc ) ) ; } else { if ( type == SYMBOL_TLSLDM ) emit_insn ( loongarch_got_load_tls_ld ( a0 , loc ) ) ; else if ( type == SYMBOL_TLSGD ) emit_insn ( loongarch_got_load_tls_gd ( a0 , loc ) ) ; else gcc_unreachable ( ) ; } if ( flag_plt ) { switch ( la_opt_cmodel ) { case CMODEL_NORMAL : insn = emit_call_insn ( gen_call_value_internal ( v0 , loongarch_tls_symbol , const0_rtx ) ) ; break ; case CMODEL_MEDIUM : { rtx reg = gen_reg_rtx ( Pmode ) ; if ( TARGET_EXPLICIT_RELOCS ) { emit_insn ( gen_pcalau12i ( Pmode , reg , loongarch_tls_symbol ) ) ; rtx call = gen_call_value_internal_1 ( Pmode , v0 , reg , loongarch_tls_symbol , const0_rtx ) ; insn = emit_call_insn ( call ) ; } else { emit_move_insn ( reg , loongarch_tls_symbol ) ; insn = emit_call_insn ( gen_call_value_internal ( v0 , reg , const0_rtx ) ) ; } break ; } case CMODEL_EXTREME : case CMODEL_LARGE : case CMODEL_TINY : case CMODEL_TINY_STATIC : default : gcc_unreachable ( ) ; } } else { rtx dest = gen_reg_rtx ( Pmode ) ; switch ( la_opt_cmodel ) { case CMODEL_NORMAL : case CMODEL_MEDIUM : { if ( TARGET_EXPLICIT_RELOCS ) { rtx high = gen_reg_rtx ( Pmode ) ; loongarch_emit_move ( high , gen_rtx_HIGH ( Pmode , loongarch_tls_symbol ) ) ; emit_insn ( gen_ld_from_got ( Pmode , dest , high , loongarch_tls_symbol ) ) ; } else loongarch_emit_move ( dest , loongarch_tls_symbol ) ; break ; } case CMODEL_EXTREME : { gcc_assert ( TARGET_EXPLICIT_RELOCS ) ; rtx tmp1 = gen_reg_rtx ( Pmode ) ; rtx high = gen_reg_rtx ( Pmode ) ; loongarch_emit_move ( high , gen_rtx_HIGH ( Pmode , loongarch_tls_symbol ) ) ;

loongarch_emit_move ( tmp1 , gen_rtx_LO_SUM ( Pmode , gen_rtx_REG ( Pmode , <NUM_LIT> ) , loongarch_tls_symbol ) ) ;


<s> bool loongarch_check_zero_div_p ( void ) { if ( target_flags_explicit & MASK_CHECK_ZERO_DIV ) return TARGET_CHECK_ZERO_DIV ;


<s> } info -> type = ADDRESS_REG ; info -> reg = XEXP ( x , <NUM_LIT> ) ; info -> offset = XEXP ( x , <NUM_LIT> ) ; return ( loongarch_valid_base_register_p ( info -> reg , mode , strict_p ) && loongarch_valid_offset_p ( info -> offset , mode ) ) ; case LO_SUM : info -> type = ADDRESS_LO_SUM ; info -> reg = XEXP ( x , <NUM_LIT> ) ; info -> offset = XEXP ( x , <NUM_LIT> ) ; info -> symbol_type = loongarch_classify_symbolic_expression ( info -> offset ) ; return ( loongarch_valid_base_register_p ( info -> reg , mode , strict_p ) && loongarch_valid_lo_sum_p ( info -> symbol_type , mode , info -> offset ) ) ; case CONST_INT :


<s> static enum loongarch_symbol_type loongarch_classify_symbol ( const_rtx x ) { enum loongarch_symbol_type pcrel = TARGET_CMODEL_EXTREME ? SYMBOL_PCREL64 : SYMBOL_PCREL ; if ( ! SYMBOL_REF_P ( x ) ) return pcrel ; if ( SYMBOL_REF_TLS_MODEL ( x ) ) return SYMBOL_TLS ; if ( ! loongarch_symbol_binds_local_p ( x ) ) return SYMBOL_GOT_DISP ; tree t = SYMBOL_REF_DECL ( x ) ; if ( ! t ) return pcrel ; t = lookup_attribute ( <STR_LIT> , DECL_ATTRIBUTES ( t ) ) ; if ( ! t ) return pcrel ; t = TREE_VALUE ( TREE_VALUE ( t ) ) ; gcc_assert ( TREE_CODE ( t ) == STRING_CST ) ; const char * model = TREE_STRING_POINTER ( t ) ;

if ( strcmp ( model , <STR_LIT> ) == <NUM_LIT> ) return SYMBOL_PCREL ;


<s> rtx offset ; split_const ( x , & x , & offset ) ; if ( UNSPEC_ADDRESS_P ( x ) ) return UNSPEC_ADDRESS_TYPE ( x ) ; return loongarch_classify_symbol ( x ) ;


<s> else frame -> fp_sp_offset = offset ; if ( frame -> mask ) { unsigned x_save_size = LARCH_STACK_ALIGN ( num_x_saved * UNITS_PER_WORD ) ; unsigned num_save_restore = <NUM_LIT> + loongarch_save_libcall_count ( frame -> mask ) ; if ( LARCH_STACK_ALIGN ( num_save_restore * UNITS_PER_WORD ) == x_save_size ) frame -> save_libcall_adjustment = x_save_size ; offset += x_save_size ; frame -> gp_sp_offset = offset - UNITS_PER_WORD ; } else frame -> gp_sp_offset = offset ; frame -> hard_frame_pointer_offset = offset ; offset += LARCH_STACK_ALIGN ( cfun -> machine -> varargs_size ) ; offset += LARCH_STACK_ALIGN ( crtl -> args . pretend_args_size ) ;

frame -> arg_pointer_offset = offset - crtl -> args . pretend_args_size ;


<s> int loongarch_const_insns ( rtx x ) { enum loongarch_symbol_type symbol_type ; rtx offset ; switch ( GET_CODE ( x ) ) { case HIGH : if ( ! loongarch_symbolic_constant_p ( XEXP ( x , <NUM_LIT> ) , & symbol_type ) || ! loongarch_split_symbol_type ( symbol_type ) ) return <NUM_LIT> ; return <NUM_LIT> ; case CONST_INT : return loongarch_integer_cost ( INTVAL ( x ) ) ; case CONST_VECTOR : case CONST_DOUBLE : return x == CONST0_RTX ( GET_MODE ( x ) ) ? <NUM_LIT> : <NUM_LIT> ; case CONST : if ( loongarch_symbolic_constant_p ( x , & symbol_type ) ) return loongarch_symbol_insns ( symbol_type , MAX_MACHINE_MODE ) ; split_const ( x , & x , & offset ) ; if ( offset != <NUM_LIT> ) { int n = loongarch_const_insns ( x ) ;


<s> for ( size_t i = <NUM_LIT> ; i < ARRAY_SIZE ( mag_comparisons ) ; i ++ ) { HOST_WIDE_INT new_rhs ; bool increment = * code == mag_comparisons [ i ] [ <NUM_LIT> ] ; bool decrement = * code == mag_comparisons [ i ] [ <NUM_LIT> ] ; if ( ! increment && ! decrement ) continue ; if ( ( increment && rhs == HOST_WIDE_INT_MAX ) || ( decrement && rhs == HOST_WIDE_INT_MIN ) ) break ; new_rhs = rhs + ( increment ? <NUM_LIT> : - <NUM_LIT> ) ; if ( loongarch_integer_cost ( new_rhs ) < loongarch_integer_cost ( rhs ) ) { * op1 = GEN_INT ( new_rhs ) ; * code = mag_comparisons [ i ] [ increment ] ; } break ;


<s> bool decrement = * code == mag_comparisons [ i ] [ <NUM_LIT> ] ; if ( ! increment && ! decrement ) continue ; if ( ( increment && rhs == HOST_WIDE_INT_MAX ) || ( decrement && rhs == HOST_WIDE_INT_MIN ) ) break ; new_rhs = rhs + ( increment ? <NUM_LIT> : - <NUM_LIT> ) ; if ( loongarch_integer_cost ( new_rhs ) < loongarch_integer_cost ( rhs ) ) { * op1 = GEN_INT ( new_rhs ) ; * code = mag_comparisons [ i ] [ increment ] ; } break ; } } } loongarch_extend_comparands ( * code , op0 , op1 ) ; * op0 = force_reg ( word_mode , * op0 ) ; if ( * op1 != const0_rtx ) * op1 = force_reg ( word_mode , * op1 ) ;


<s> } } else dump_stack_clash_frame_info ( NO_PROBE_SMALL_FRAME , true ) ; if ( size != rounded_size ) { if ( size - rounded_size >= <NUM_LIT> ) { emit_move_insn ( r14 , GEN_INT ( size - rounded_size ) ) ; emit_insn ( gen_rtx_SET ( stack_pointer_rtx , gen_rtx_MINUS ( Pmode , stack_pointer_rtx , r14 ) ) ) ; } else emit_insn ( gen_rtx_SET ( stack_pointer_rtx , gen_rtx_PLUS ( Pmode , stack_pointer_rtx , GEN_INT ( rounded_size - size ) ) ) ) ; } if ( first ) { emit_move_insn ( r12 , GEN_INT ( first ) ) ; emit_insn ( gen_rtx_SET ( stack_pointer_rtx , gen_rtx_PLUS ( Pmode , stack_pointer_rtx , r12 ) ) ) ; }


<s> emit_move_insn ( gen_rtx_MEM ( Pmode , gen_rtx_PLUS ( Pmode , stack_pointer_rtx , const0_rtx ) ) , const0_rtx ) ; emit_insn ( gen_blockage ( ) ) ; } dump_stack_clash_frame_info ( PROBE_INLINE , size != rounded_size ) ; } else { emit_move_insn ( r12 , GEN_INT ( rounded_size ) ) ; emit_insn ( gen_rtx_SET ( r12 , gen_rtx_MINUS ( Pmode , stack_pointer_rtx , r12 ) ) ) ; emit_insn ( gen_probe_stack_range ( Pmode , stack_pointer_rtx , stack_pointer_rtx , r12 , r14 ) ) ; emit_insn ( gen_blockage ( ) ) ; dump_stack_clash_frame_info ( PROBE_LOOP , size != rounded_size ) ; } } else dump_stack_clash_frame_info ( NO_PROBE_SMALL_FRAME , true ) ; if ( size != rounded_size ) { if ( size - rounded_size >= <NUM_LIT> ) { emit_move_insn ( r14 , GEN_INT ( size - rounded_size ) ) ; emit_insn ( gen_rtx_SET ( stack_pointer_rtx , gen_rtx_MINUS ( Pmode , stack_pointer_rtx , r14 ) ) ) ; } else emit_insn ( gen_rtx_SET ( stack_pointer_rtx , gen_rtx_PLUS ( Pmode , stack_pointer_rtx , GEN_INT ( rounded_size - size ) ) ) ) ; } if ( first ) { emit_move_insn ( r12 , GEN_INT ( first ) ) ; emit_insn ( gen_rtx_SET ( stack_pointer_rtx , gen_rtx_PLUS ( Pmode , stack_pointer_rtx , r12 ) ) ) ;


<s> static rtx loongarch_emit_set ( rtx target , rtx src ) { emit_insn ( gen_rtx_SET ( target , src ) ) ; return target ;


<s> else loongarch_emit_probe_stack_range ( first , size ) ; if ( size > <NUM_LIT> ) { insn = plus_constant ( Pmode , stack_pointer_rtx , - size ) ; insn = gen_rtx_SET ( stack_pointer_rtx , insn ) ; loongarch_set_frame_expr ( insn ) ; } return ; } if ( size > <NUM_LIT> ) { if ( IMM12_OPERAND ( - size ) ) { insn = gen_add3_insn ( stack_pointer_rtx , stack_pointer_rtx , GEN_INT ( - size ) ) ; RTX_FRAME_RELATED_P ( emit_insn ( insn ) ) = <NUM_LIT> ; } else { loongarch_emit_move ( LARCH_PROLOGUE_TEMP ( Pmode ) , GEN_INT ( - size ) ) ; emit_insn ( gen_add3_insn ( stack_pointer_rtx , stack_pointer_rtx , LARCH_PROLOGUE_TEMP ( Pmode ) ) ) ; insn = plus_constant ( Pmode , stack_pointer_rtx , - size ) ; insn = gen_rtx_SET ( stack_pointer_rtx , insn ) ; loongarch_set_frame_expr ( insn ) ;


<s> if ( flag_stack_usage_info ) current_function_static_stack_size = size ; if ( ( frame -> mask | frame -> fmask ) != <NUM_LIT> ) { HOST_WIDE_INT step1 = MIN ( size , loongarch_first_stack_step ( frame ) ) ; insn = gen_add3_insn ( stack_pointer_rtx , stack_pointer_rtx , GEN_INT ( - step1 ) ) ; RTX_FRAME_RELATED_P ( emit_insn ( insn ) ) = <NUM_LIT> ; size -= step1 ; loongarch_for_each_saved_reg ( size , loongarch_save_reg ) ; } if ( frame_pointer_needed ) { insn = gen_add3_insn ( hard_frame_pointer_rtx , stack_pointer_rtx , GEN_INT ( frame -> hard_frame_pointer_offset - size ) ) ; RTX_FRAME_RELATED_P ( emit_insn ( insn ) ) = <NUM_LIT> ; loongarch_emit_stack_tie ( ) ; } if ( flag_stack_check == STATIC_BUILTIN_STACK_CHECK || flag_stack_clash_protection ) { HOST_WIDE_INT first = get_stack_check_protect ( ) ; if ( frame -> total_size == <NUM_LIT> ) { dump_stack_clash_frame_info ( NO_PROBE_NO_FRAME , false ) ; return ; } if ( crtl -> is_leaf && ! cfun -> calls_alloca ) { HOST_WIDE_INT interval ; if ( flag_stack_clash_protection ) interval = STACK_CLASH_PROTECTION_GUARD_SIZE ;


<s> static HOST_WIDE_INT loongarch_first_stack_step ( struct loongarch_frame_info * frame ) { HOST_WIDE_INT min_first_step = LARCH_STACK_ALIGN ( frame -> total_size - frame -> fp_sp_offset ) ; if ( flag_stack_check == STATIC_BUILTIN_STACK_CHECK || ( flag_stack_clash_protection && frame -> total_size > STACK_CLASH_PROTECTION_GUARD_SIZE ) ) return min_first_step ; if ( IMM12_OPERAND ( frame -> total_size ) ) return frame -> total_size ;


<s> if ( DECL_CONTEXT ( decl ) && TREE_CODE ( DECL_CONTEXT ( decl ) ) == FUNCTION_DECL && ! TREE_STATIC ( decl ) ) { error_at ( DECL_SOURCE_LOCATION ( decl ) , <STR_LIT> <STR_LIT> , name ) ; * no_add_attrs = true ; return NULL_TREE ; } if ( DECL_REGISTER ( decl ) ) { error_at ( DECL_SOURCE_LOCATION ( decl ) , <STR_LIT> <STR_LIT> , name ) ; * no_add_attrs = true ; return NULL_TREE ; } if ( ! TARGET_EXPLICIT_RELOCS ) { error_at ( DECL_SOURCE_LOCATION ( decl ) , <STR_LIT> , name , <STR_LIT> ) ; * no_add_attrs = true ; return NULL_TREE ; } arg = TREE_VALUE ( arg ) ; if ( TREE_CODE ( arg ) != STRING_CST ) { error_at ( DECL_SOURCE_LOCATION ( decl ) , <STR_LIT> , name ) ; * no_add_attrs = true ; return NULL_TREE ; } const char * model = TREE_STRING_POINTER ( arg ) ; if ( strcmp ( model , <STR_LIT> ) != <NUM_LIT> && strcmp ( model , <STR_LIT> ) != <NUM_LIT> ) { error_at ( DECL_SOURCE_LOCATION ( decl ) , <STR_LIT> , name ) ; * no_add_attrs = true ; return NULL_TREE ; } if ( lookup_attribute ( <STR_LIT> , DECL_ATTRIBUTES ( decl ) ) ) { error_at ( DECL_SOURCE_LOCATION ( decl ) , <STR_LIT> , name ) ; * no_add_attrs = true ;


<s> error_at ( DECL_SOURCE_LOCATION ( decl ) , <STR_LIT> <STR_LIT> , name ) ; * no_add_attrs = true ; return NULL_TREE ; } if ( DECL_CONTEXT ( decl ) && TREE_CODE ( DECL_CONTEXT ( decl ) ) == FUNCTION_DECL && ! TREE_STATIC ( decl ) ) { error_at ( DECL_SOURCE_LOCATION ( decl ) , <STR_LIT> <STR_LIT> , name ) ; * no_add_attrs = true ; return NULL_TREE ; } if ( DECL_REGISTER ( decl ) ) { error_at ( DECL_SOURCE_LOCATION ( decl ) , <STR_LIT> <STR_LIT> , name ) ; * no_add_attrs = true ; return NULL_TREE ; } if ( ! TARGET_EXPLICIT_RELOCS ) { error_at ( DECL_SOURCE_LOCATION ( decl ) , <STR_LIT> , name , <STR_LIT> ) ; * no_add_attrs = true ; return NULL_TREE ;


<s> int loongarch_idiv_insns ( machine_mode mode ATTRIBUTE_UNUSED ) { int count ; count = <NUM_LIT> ; if ( loongarch_check_zero_div_p ( ) ) count += <NUM_LIT> ; return count ;


<s> HOST_WIDE_INT offset ; if ( loongarch_tls_symbol_p ( x ) ) return loongarch_legitimize_tls_address ( x ) ; if ( loongarch_split_symbol ( NULL , x , mode , & addr ) ) return loongarch_force_address ( addr , mode ) ; loongarch_split_plus ( x , & base , & offset ) ; if ( offset != <NUM_LIT> ) { if ( ! loongarch_valid_base_register_p ( base , mode , false ) ) base = copy_to_mode_reg ( Pmode , base ) ; addr = loongarch_add_offset ( NULL , base , offset ) ; return loongarch_force_address ( addr , mode ) ; } return x ;


<s> if ( TARGET_CMODEL_MEDIUM && TARGET_EXPLICIT_RELOCS && ( SYMBOL_REF_P ( addr ) || LABEL_REF_P ( addr ) ) && ( symbol_type == SYMBOL_PCREL || ( symbol_type == SYMBOL_GOT_DISP && flag_plt ) ) ) { rtx reg = gen_reg_rtx ( Pmode ) ; emit_insn ( gen_pcalau12i ( Pmode , reg , addr ) ) ; return gen_rtx_LO_SUM ( Pmode , reg , addr ) ; } return addr ;


<s> if ( offset != const0_rtx && ( targetm . cannot_force_const_mem ( mode , src ) || ( can_create_pseudo_p ( ) ) ) ) { base = loongarch_force_temporary ( dest , base ) ; loongarch_emit_move ( dest , loongarch_add_offset ( NULL , base , INTVAL ( offset ) ) ) ; return ; } src = force_const_mem ( mode , src ) ;


<s> loongarch_emit_move ( dest , loongarch_legitimize_tls_address ( src ) ) ; return ; } split_const ( src , & base , & offset ) ; if ( offset != const0_rtx && ( targetm . cannot_force_const_mem ( mode , src ) || ( can_create_pseudo_p ( ) ) ) ) { base = loongarch_force_temporary ( dest , base ) ; loongarch_emit_move ( dest , loongarch_add_offset ( NULL , base , INTVAL ( offset ) ) ) ;


<s> } else emit_insn ( loongarch_got_load_tls_ie ( tmp1 , loc ) ) ; emit_insn ( gen_add3_insn ( dest , tmp1 , tp ) ) ; } break ; case TLS_MODEL_LOCAL_EXEC : { tp = gen_rtx_REG ( Pmode , THREAD_POINTER_REGNUM ) ; tmp1 = gen_reg_rtx ( Pmode ) ; dest = gen_reg_rtx ( Pmode ) ; if ( TARGET_EXPLICIT_RELOCS ) { tmp2 = loongarch_unspec_address ( loc , SYMBOL_TLS_LE ) ; tmp3 = gen_reg_rtx ( Pmode ) ; rtx high = gen_rtx_HIGH ( Pmode , copy_rtx ( tmp2 ) ) ; high = loongarch_force_temporary ( tmp3 , high ) ; emit_insn ( gen_ori_l_lo12 ( Pmode , tmp1 , high , tmp2 ) ) ; if ( TARGET_CMODEL_EXTREME ) { gcc_assert ( TARGET_EXPLICIT_RELOCS ) ; emit_insn ( gen_lui_h_lo20 ( tmp1 , tmp1 , tmp2 ) ) ;


<s> if ( loongarch_check_zero_div_p ( ) ) { output_asm_insn ( s , operands ) ; s = <STR_LIT> ; } return s ;


<s> case <NUM_LIT> : if ( const_arith_operand ( offset , Pmode ) || GET_CODE ( offset ) == LO_SUM ) return <STR_LIT> ; else return <STR_LIT> ; case <NUM_LIT> : if ( const_arith_operand ( offset , Pmode ) || GET_CODE ( offset ) == LO_SUM ) return <STR_LIT> ; else return <STR_LIT> ; default : gcc_unreachable ( ) ; } } if ( src_code == HIGH ) { rtx offset , x ; split_const ( XEXP ( src , <NUM_LIT> ) , & x , & offset ) ; enum loongarch_symbol_type type = SYMBOL_PCREL ; if ( UNSPEC_ADDRESS_P ( x ) ) type = UNSPEC_ADDRESS_TYPE ( x ) ; if ( type == SYMBOL_TLS_LE ) return <STR_LIT> ; else return <STR_LIT> ; } if ( src_code == CONST_INT ) { if ( LU12I_INT ( src ) ) return <STR_LIT> ; else if ( IMM12_INT ( src ) ) return <STR_LIT> ; else if ( IMM12_INT_UNSIGNED ( src ) ) return <STR_LIT> ; else if ( LU52I_INT ( src ) ) return <STR_LIT> ; else gcc_unreachable ( ) ; } } if ( ! TARGET_EXPLICIT_RELOCS && dest_code == REG && symbolic_operand ( src , VOIDmode ) ) { if ( loongarch_classify_symbol ( src ) == SYMBOL_PCREL ) return <STR_LIT> ; else return <STR_LIT> ; } if ( src_code == REG && FP_REG_P ( REGNO ( src ) ) ) { if ( dest_code == REG && FP_REG_P ( REGNO ( dest ) ) ) return dbl_p ? <STR_LIT> : <STR_LIT> ; if ( dest_code == MEM ) { const char * insn = NULL ; insn = loongarch_output_move_index_float ( XEXP ( dest , <NUM_LIT> ) , GET_MODE ( dest ) , false ) ;


<s> rtx xops [ <NUM_LIT> ] ; ASM_GENERATE_INTERNAL_LABEL ( loop_lab , <STR_LIT> , labelno ++ ) ; ASM_OUTPUT_INTERNAL_LABEL ( asm_out_file , loop_lab ) ; xops [ <NUM_LIT> ] = reg1 ; xops [ <NUM_LIT> ] = reg3 ; if ( TARGET_64BIT ) output_asm_insn ( <STR_LIT> , xops ) ;

else output_asm_insn ( <STR_LIT> , xops ) ;


<s> return ; case ADDRESS_CONST_INT : fprintf ( file , <STR_LIT> , reg_names [ GP_REG_FIRST ] ) ; output_addr_const ( file , x ) ; return ; case ADDRESS_SYMBOLIC : output_addr_const ( file , loongarch_strip_unspec_address ( x ) ) ; return ; } if ( CONST_INT_P ( x ) ) output_addr_const ( file , x ) ;


<s> } case SYMBOL_PCREL : reloc = hi_reloc ? <STR_LIT> : <STR_LIT> ; break ; case SYMBOL_GOT_DISP : if ( hi64_part ) { if ( TARGET_CMODEL_EXTREME ) reloc = hi_reloc ? <STR_LIT> : <STR_LIT> ; else gcc_unreachable ( ) ; } else reloc = hi_reloc ? <STR_LIT> : <STR_LIT> ; break ; case SYMBOL_TLS_IE : if ( hi64_part ) { if ( TARGET_CMODEL_EXTREME ) reloc = hi_reloc ? <STR_LIT> : <STR_LIT> ; else gcc_unreachable ( ) ; } else reloc = hi_reloc ? <STR_LIT> : <STR_LIT> ; break ; case SYMBOL_TLS_LE : if ( hi64_part ) { if ( TARGET_CMODEL_EXTREME ) reloc = hi_reloc ? <STR_LIT> : <STR_LIT> ; else gcc_unreachable ( ) ; } else reloc = hi_reloc ? <STR_LIT> : <STR_LIT> ; break ; case SYMBOL_TLSGD : if ( hi64_part ) { if ( TARGET_CMODEL_EXTREME ) reloc = hi_reloc ? <STR_LIT> : <STR_LIT> ; else gcc_unreachable ( ) ; } else reloc = hi_reloc ? <STR_LIT> : <STR_LIT> ; break ; case SYMBOL_TLSLDM : if ( hi64_part ) { if ( TARGET_CMODEL_EXTREME ) reloc = hi_reloc ? <STR_LIT> : <STR_LIT> ; else gcc_unreachable ( ) ; } else reloc = hi_reloc ? <STR_LIT> : <STR_LIT> ; break ; default :


<s> if ( ! no_rtl && gp_saved > <NUM_LIT> ) { rtx ptr = plus_constant ( Pmode , virtual_incoming_args_rtx , REG_PARM_STACK_SPACE ( cfun -> decl ) - gp_saved * UNITS_PER_WORD ) ; rtx mem = gen_frame_mem ( BLKmode , ptr ) ; set_mem_alias_set ( mem , get_varargs_alias_set ( ) ) ; move_block_from_reg ( local_cum . num_gprs + GP_ARG_FIRST , mem , gp_saved ) ; }

if ( REG_PARM_STACK_SPACE ( cfun -> decl ) == <NUM_LIT> ) cfun -> machine -> varargs_size = gp_saved * UNITS_PER_WORD ;


<s> CUMULATIVE_ARGS local_cum ; int gp_saved ; local_cum = * get_cumulative_args ( cum ) ; if ( ! TYPE_NO_NAMED_ARGS_STDARG_P ( TREE_TYPE ( current_function_decl ) ) ) loongarch_function_arg_advance ( pack_cumulative_args ( & local_cum ) , arg ) ; gp_saved = MAX_ARGS_IN_REGISTERS - local_cum . num_gprs ; if ( ! no_rtl && gp_saved > <NUM_LIT> ) { rtx ptr = plus_constant ( Pmode , virtual_incoming_args_rtx , REG_PARM_STACK_SPACE ( cfun -> decl ) - gp_saved * UNITS_PER_WORD ) ; rtx mem = gen_frame_mem ( BLKmode , ptr ) ;

set_mem_alias_set ( mem , get_varargs_alias_set ( ) ) ;


<s> static bool loongarch_split_move_insn_p ( rtx dest , rtx src ) {

return loongarch_split_move_p ( dest , src ) ;


<s> if ( temp == NULL ) temp = gen_reg_rtx ( Pmode ) ; high = gen_rtx_HIGH ( Pmode , copy_rtx ( addr ) ) ; high = loongarch_force_temporary ( temp , high ) ; if ( loongarch_symbol_extreme_p ( symbol_type ) && can_create_pseudo_p ( ) ) { gcc_assert ( TARGET_EXPLICIT_RELOCS ) ; temp1 = gen_reg_rtx ( Pmode ) ; emit_move_insn ( temp1 , gen_rtx_LO_SUM ( Pmode , gen_rtx_REG ( Pmode , <NUM_LIT> ) , addr ) ) ; emit_insn ( gen_lui_h_lo20 ( temp1 , temp1 , addr ) ) ;

emit_insn ( gen_lui_h_hi12 ( temp1 , temp1 , addr ) ) ;


<s> case SYMBOL_TLS_IE : case SYMBOL_TLS_LE : case SYMBOL_TLSGD : case SYMBOL_TLSLDM : return true ; case SYMBOL_TLS : return false ; default : gcc_unreachable ( ) ; }


<s> rtx offset ; split_const ( x , & x , & offset ) ; if ( UNSPEC_ADDRESS_P ( x ) ) { * symbol_type = UNSPEC_ADDRESS_TYPE ( x ) ; x = UNSPEC_ADDRESS ( x ) ; } else if ( SYMBOL_REF_P ( x ) || LABEL_REF_P ( x ) ) { * symbol_type = loongarch_classify_symbol ( x ) ; if ( * symbol_type == SYMBOL_TLS ) return true ; } else return false ; if ( offset == const0_rtx ) return true ; switch ( * symbol_type ) { case SYMBOL_TLS_IE : case SYMBOL_TLS_LE : case SYMBOL_TLSGD : case SYMBOL_TLSLDM : case SYMBOL_PCREL : case SYMBOL_PCREL64 : return sext_hwi ( INTVAL ( offset ) , <NUM_LIT> ) == INTVAL ( offset ) ; case SYMBOL_GOT_DISP :


<s> if ( TARGET_DIRECT_EXTERN_ACCESS ) return true ; if ( SYMBOL_REF_P ( x ) ) return ( SYMBOL_REF_DECL ( x ) ? targetm . binds_local_p ( SYMBOL_REF_DECL ( x ) ) : SYMBOL_REF_LOCAL_P ( x ) ) ; else return false ;


<s> bool loongarch_symbol_binds_local_p ( const_rtx x ) { if ( TARGET_DIRECT_EXTERN_ACCESS ) return true ; if ( SYMBOL_REF_P ( x ) ) return ( SYMBOL_REF_DECL ( x ) ? targetm . binds_local_p ( SYMBOL_REF_DECL ( x ) ) : SYMBOL_REF_LOCAL_P ( x ) ) ;


<s> static bool loongarch_symbol_extreme_p ( enum loongarch_symbol_type type ) { switch ( type ) { case SYMBOL_PCREL : return false ; case SYMBOL_PCREL64 : return true ; default : return TARGET_CMODEL_EXTREME ;


<s> case SYMBOL_TLS_IE : case SYMBOL_TLS_LE : return <NUM_LIT> ; case SYMBOL_TLSGD : case SYMBOL_TLSLDM : return <NUM_LIT> ; case SYMBOL_PCREL64 : return <NUM_LIT> ;


<s> tree decl = SYMBOL_REF_DECL ( symbol ) ;

if ( decl && lookup_attribute ( <STR_LIT> , DECL_ATTRIBUTES ( decl ) ) ) return false ;


<s> tree decl = SYMBOL_REF_DECL ( symbol ) ; if ( decl && lookup_attribute ( <STR_LIT> , DECL_ATTRIBUTES ( decl ) ) ) return false ;

return default_use_anchors_for_symbol_p ( symbol ) ;


<s> static bool loongarch_valid_lo_sum_p ( enum loongarch_symbol_type symbol_type , machine_mode mode , rtx x ) { int align , size ; if ( loongarch_symbol_insns ( symbol_type , mode ) == <NUM_LIT> ) return false ; if ( ! loongarch_split_symbol_type ( symbol_type ) ) return false ; if ( mode == BLKmode ) { rtx offset ;


<s> FOR_EACH_SUBRTX_PTR ( iter , array , loc , ALL ) { rtx * loc = * iter ; if ( MEM_P ( * loc ) ) { loongarch_rewrite_small_data_1 ( & XEXP ( * loc , <NUM_LIT> ) ) ; iter . skip_subrtxes ( ) ;


if ( GET_CODE ( x ) == ASM_OPERANDS ) iter . skip_subrtxes ( ) ;


<s> rtx x = * iter ; if ( GET_CODE ( x ) == ASM_OPERANDS ) iter . skip_subrtxes ( ) ; else if ( MEM_P ( x ) ) { if ( loongarch_small_data_pattern_1 ( XEXP ( x , <NUM_LIT> ) ) ) return true ; iter . skip_subrtxes ( ) ;


<s> bool loongarch_12bit_offset_address_p ( rtx x , machine_mode mode ) { struct loongarch_address_info addr ; return ( loongarch_classify_address ( & addr , x , mode , false ) && addr . type == ADDRESS_REG && CONST_INT_P ( addr . offset ) && LARCH_U12BIT_OFFSET_P ( INTVAL ( addr . offset ) ) ) ;


<s> return ( loongarch_classify_address ( & addr , x , mode , false ) && addr . type == ADDRESS_REG && CONST_INT_P ( addr . offset ) && LARCH_16BIT_OFFSET_P ( INTVAL ( addr . offset ) ) && LARCH_SHIFT_2_OFFSET_P ( INTVAL ( addr . offset ) ) ) ;


<s> static int loongarch_address_cost ( rtx addr , machine_mode mode , addr_space_t as ATTRIBUTE_UNUSED , bool speed ATTRIBUTE_UNUSED ) {

return loongarch_address_insns ( addr , mode , false ) ;


<s> return loongarch_address_insns ( addr , mode , false ) ;


<s> if ( mode != BLKmode && might_split_p ) factor = ( GET_MODE_SIZE ( mode ) + UNITS_PER_WORD - <NUM_LIT> ) / UNITS_PER_WORD ; else factor = <NUM_LIT> ; if ( loongarch_classify_address ( & addr , x , mode , false ) ) switch ( addr . type ) { case ADDRESS_REG : return factor ; case ADDRESS_REG_REG : return factor ; case ADDRESS_CONST_INT : return factor ; case ADDRESS_SYMBOLIC :

return factor * loongarch_symbol_insns ( addr . symbol_type , mode ) ;


<s> else factor = <NUM_LIT> ; if ( loongarch_classify_address ( & addr , x , mode , false ) ) switch ( addr . type ) { case ADDRESS_REG : return factor ; case ADDRESS_REG_REG : return factor ; case ADDRESS_CONST_INT : return factor ; case ADDRESS_SYMBOLIC :


<s> static rtx loongarch_add_offset ( rtx temp , rtx reg , HOST_WIDE_INT offset ) { if ( ! IMM12_OPERAND ( offset ) ) { rtx high ; high = gen_int_mode ( CONST_HIGH_PART ( offset ) , Pmode ) ;


<s> static rtx loongarch_add_offset ( rtx temp , rtx reg , HOST_WIDE_INT offset ) { if ( ! IMM12_OPERAND ( offset ) ) { rtx high ; high = gen_int_mode ( CONST_HIGH_PART ( offset ) , Pmode ) ; offset = CONST_LOW_PART ( offset ) ;

high = loongarch_force_temporary ( temp , high ) ;


<s> * loop_reg = copy_addr_to_reg ( XEXP ( mem , <NUM_LIT> ) ) ;

* loop_mem = change_address ( mem , BLKmode , * loop_reg ) ;


<s> * loop_mem = change_address ( mem , BLKmode , * loop_reg ) ;

set_mem_align ( * loop_mem , MIN ( MEM_ALIGN ( mem ) , length * BITS_PER_UNIT ) ) ;


<s> static int loongarch_adjust_cost ( rtx_insn * , int dep_type , rtx_insn * , int cost , unsigned int ) { if ( dep_type != <NUM_LIT> && ( dep_type != REG_DEP_OUTPUT ) ) return <NUM_LIT> ; return cost ;


<s> if ( dep_type != <NUM_LIT> && ( dep_type != REG_DEP_OUTPUT ) ) return <NUM_LIT> ; return cost ;


<s> cfun -> machine -> next_fcc += - cfun -> machine -> next_fcc & ( count - <NUM_LIT> ) ; if ( cfun -> machine -> next_fcc > FCC_REG_LAST - FCC_REG_FIRST ) cfun -> machine -> next_fcc = <NUM_LIT> ; regno = FCC_REG_FIRST + cfun -> machine -> next_fcc ;


<s> if ( cfun -> machine -> next_fcc > FCC_REG_LAST - FCC_REG_FIRST ) cfun -> machine -> next_fcc = <NUM_LIT> ; regno = FCC_REG_FIRST + cfun -> machine -> next_fcc ; cfun -> machine -> next_fcc += count ;


<s> static int loongarch_arg_partial_bytes ( cumulative_args_t cum , const function_arg_info & generic_arg ) { struct loongarch_arg_info arg ;

loongarch_get_arg_info ( & arg , get_cumulative_args ( cum ) , generic_arg . mode , generic_arg . type , generic_arg . named , false ) ;


<s> return ( loongarch_classify_address ( & addr , x , mode , false ) && addr . type == ADDRESS_REG_REG && REG_P ( addr . offset ) ) ;


<s> HOST_WIDE_INT leftover ; leftover = length % bytes_per_iter ; length -= leftover ; loongarch_adjust_block_mem ( src , bytes_per_iter , & src_reg , & src ) ; loongarch_adjust_block_mem ( dest , bytes_per_iter , & dest_reg , & dest ) ; final_src = expand_simple_binop ( Pmode , PLUS , src_reg , GEN_INT ( length ) , <NUM_LIT> , <NUM_LIT> , OPTAB_WIDEN ) ; label = gen_label_rtx ( ) ; emit_label ( label ) ;

loongarch_block_move_straight ( dest , src , bytes_per_iter ) ;


<s> loongarch_adjust_block_mem ( dest , bytes_per_iter , & dest_reg , & dest ) ; final_src = expand_simple_binop ( Pmode , PLUS , src_reg , GEN_INT ( length ) , <NUM_LIT> , <NUM_LIT> , OPTAB_WIDEN ) ; label = gen_label_rtx ( ) ; emit_label ( label ) ; loongarch_block_move_straight ( dest , src , bytes_per_iter ) ; loongarch_emit_move ( src_reg , plus_constant ( Pmode , src_reg , bytes_per_iter ) ) ; loongarch_emit_move ( dest_reg , plus_constant ( Pmode , dest_reg , bytes_per_iter ) ) ; test = gen_rtx_NE ( VOIDmode , src_reg , final_src ) ;

if ( Pmode == DImode ) emit_jump_insn ( gen_cbranchdi4 ( test , src_reg , final_src , label ) ) ;


<s> delta = bits / BITS_PER_UNIT ; regs = XALLOCAVEC ( rtx , length / delta ) ; for ( offset = <NUM_LIT> , i = <NUM_LIT> ; offset + delta <= length ; offset += delta , i ++ ) { regs [ i ] = gen_reg_rtx ( mode ) ; loongarch_emit_move ( regs [ i ] , adjust_address ( src , mode , offset ) ) ; }

for ( offset = <NUM_LIT> , i = <NUM_LIT> ; offset + delta <= length ; offset += delta , i ++ ) loongarch_emit_move ( adjust_address ( dest , mode , offset ) , regs [ i ] ) ;


<s> if ( TARGET_64BIT ) { bool lu32i [ <NUM_LIT> ] = { ( value & LU32I_B ) == <NUM_LIT> , ( value & LU32I_B ) == LU32I_B } ; bool lu52i [ <NUM_LIT> ] = { ( value & LU52I_B ) == <NUM_LIT> , ( value & LU52I_B ) == LU52I_B } ; int sign31 = ( value & ( <NUM_LIT> << <NUM_LIT> ) ) >> <NUM_LIT> ; if ( lu32i [ sign31 ] && lu52i [ sign31 ] ) return cost ; else if ( lu32i [ sign31 ] ) { codes [ cost ] . method = METHOD_LU52I ; codes [ cost ] . value = ( value >> <NUM_LIT> ) << <NUM_LIT> ; return cost + <NUM_LIT> ; } codes [ cost ] . method = METHOD_LU32I ; codes [ cost ] . value = ( ( value << <NUM_LIT> ) >> <NUM_LIT> ) << <NUM_LIT> ;


<s> codes [ <NUM_LIT> ] . value = low_part & ~ ( IMM_REACH - <NUM_LIT> ) ; cost ++ ; HOST_WIDE_INT iorv = low_part & ( IMM_REACH - <NUM_LIT> ) ; if ( iorv != <NUM_LIT> ) { codes [ <NUM_LIT> ] . code = IOR ; codes [ <NUM_LIT> ] . method = METHOD_NORMAL ; codes [ <NUM_LIT> ] . value = iorv ; cost ++ ; } } if ( TARGET_64BIT ) { bool lu32i [ <NUM_LIT> ] = { ( value & LU32I_B ) == <NUM_LIT> , ( value & LU32I_B ) == LU32I_B } ; bool lu52i [ <NUM_LIT> ] = { ( value & LU52I_B ) == <NUM_LIT> , ( value & LU52I_B ) == LU52I_B } ; int sign31 = ( value & ( <NUM_LIT> << <NUM_LIT> ) ) >> <NUM_LIT> ; if ( lu32i [ sign31 ] && lu52i [ sign31 ] ) return cost ; else if ( lu32i [ sign31 ] ) { codes [ cost ] . method = METHOD_LU52I ; codes [ cost ] . value = ( value >> <NUM_LIT> ) << <NUM_LIT> ; return cost + <NUM_LIT> ; } codes [ cost ] . method = METHOD_LU32I ; codes [ cost ] . value = ( ( value << <NUM_LIT> ) >> <NUM_LIT> ) << <NUM_LIT> ; cost ++ ; if ( ! lu52i [ ( value & ( <NUM_LIT> << <NUM_LIT> ) ) >> <NUM_LIT> ] ) { codes [ cost ] . method = METHOD_LU52I ;


<s> rtx_insn * insn ; a0 = gen_rtx_REG ( Pmode , GP_ARG_FIRST ) ; if ( ! loongarch_tls_symbol ) loongarch_tls_symbol = init_one_libfunc ( <STR_LIT> ) ; loc = loongarch_unspec_address ( sym , type ) ; start_sequence ( ) ; if ( type == SYMBOL_TLSLDM ) emit_insn ( loongarch_got_load_tls_ld ( a0 , loc ) ) ; else if ( type == SYMBOL_TLSGD ) emit_insn ( loongarch_got_load_tls_gd ( a0 , loc ) ) ; else gcc_unreachable ( ) ; insn = emit_call_insn ( gen_call_value_internal ( v0 , loongarch_tls_symbol , const0_rtx ) ) ; RTL_CONST_CALL_P ( insn ) = <NUM_LIT> ; use_reg ( & CALL_INSN_FUNCTION_USAGE ( insn ) , a0 ) ;


<s> if ( type == SYMBOL_TLSLDM ) emit_insn ( loongarch_got_load_tls_ld ( a0 , loc ) ) ; else if ( type == SYMBOL_TLSGD ) emit_insn ( loongarch_got_load_tls_gd ( a0 , loc ) ) ; else gcc_unreachable ( ) ;


<s> if ( loongarch_symbolic_constant_p ( base , & type ) ) {

if ( IMM12_INT ( offset ) && loongarch_symbol_insns ( type , MAX_MACHINE_MODE ) > <NUM_LIT> ) return true ;


<s> rtx base , offset ; if ( CONST_INT_P ( x ) && loongarch_legitimate_constant_p ( mode , x ) ) return true ; split_const ( x , & base , & offset ) ; if ( loongarch_symbolic_constant_p ( base , & type ) ) { if ( IMM12_INT ( offset ) && loongarch_symbol_insns ( type , MAX_MACHINE_MODE ) > <NUM_LIT> ) return true ; }

if ( tls_referenced_p ( x ) ) return true ;


<s> if ( CONST_INT_P ( * cmp1 ) ) switch ( * code ) { case LE : plus_one = trunc_int_for_mode ( UINTVAL ( * cmp1 ) + <NUM_LIT> , mode ) ; if ( INTVAL ( * cmp1 ) < plus_one ) { * code = LT ; * cmp1 = force_reg ( mode , GEN_INT ( plus_one ) ) ; return true ; } break ; case LEU : plus_one = trunc_int_for_mode ( UINTVAL ( * cmp1 ) + <NUM_LIT> , mode ) ; if ( plus_one != <NUM_LIT> ) { * code = LTU ; * cmp1 = force_reg ( mode , GEN_INT ( plus_one ) ) ; return true ;


<s> if ( reg_class_subset_p ( rclass , GENERAL_REGS ) ) rclass = GENERAL_REGS ; return rclass ;


<s> return ! reg_classes_intersect_p ( FP_REGS , rclass ) ;


<s> return ( to == HARD_FRAME_POINTER_REGNUM || to == STACK_POINTER_REGNUM ) ;


<s> bool loongarch_can_use_return_insn ( void ) {

return reload_completed && cfun -> machine -> frame . total_size == <NUM_LIT> ;


<s> } if ( loongarch_valid_base_register_p ( XEXP ( x , <NUM_LIT> ) , mode , strict_p ) && loongarch_valid_index_p ( info , XEXP ( x , <NUM_LIT> ) , mode , strict_p ) ) { info -> reg = XEXP ( x , <NUM_LIT> ) ; return true ; } info -> type = ADDRESS_REG ; info -> reg = XEXP ( x , <NUM_LIT> ) ;

info -> offset = XEXP ( x , <NUM_LIT> ) ;


<s> static enum loongarch_symbol_type loongarch_classify_symbol ( const_rtx x ) {

if ( LABEL_REF_P ( x ) ) return SYMBOL_GOT_DISP ;


<s> static enum loongarch_symbol_type loongarch_classify_symbol ( const_rtx x ) { if ( LABEL_REF_P ( x ) ) return SYMBOL_GOT_DISP ; gcc_assert ( SYMBOL_REF_P ( x ) ) ; if ( SYMBOL_REF_TLS_MODEL ( x ) ) return SYMBOL_TLS ;

if ( SYMBOL_REF_P ( x ) ) return SYMBOL_GOT_DISP ;


<s> size = <NUM_LIT> ; left = reg_class_contents [ rclass ] ; if ( hard_reg_set_intersect_p ( left , reg_class_contents [ ( int ) FCC_REGS ] ) ) { if ( loongarch_hard_regno_mode_ok ( FCC_REG_FIRST , mode ) ) size = MIN ( size , <NUM_LIT> ) ; left &= ~ reg_class_contents [ FCC_REGS ] ;


<s> HOST_WIDE_INT offset ; unsigned int regno , i , num_x_saved = <NUM_LIT> , num_f_saved = <NUM_LIT> ; frame = & cfun -> machine -> frame ; memset ( frame , <NUM_LIT> , sizeof ( * frame ) ) ; for ( regno = GP_REG_FIRST ; regno <= GP_REG_LAST ; regno ++ ) if ( loongarch_save_reg_p ( regno ) ) frame -> mask |= <NUM_LIT> << ( regno - GP_REG_FIRST ) , num_x_saved ++ ; if ( crtl -> calls_eh_return ) for ( i = <NUM_LIT> ; ( regno = EH_RETURN_DATA_REGNO ( i ) ) != INVALID_REGNUM ; i ++ ) frame -> mask |= <NUM_LIT> << ( regno - GP_REG_FIRST ) , num_x_saved ++ ; if ( TARGET_HARD_FLOAT ) for ( regno = FP_REG_FIRST ; regno <= FP_REG_LAST ; regno ++ ) if ( loongarch_save_reg_p ( regno ) ) frame -> fmask |= <NUM_LIT> << ( regno - FP_REG_FIRST ) , num_f_saved ++ ;

offset = LARCH_STACK_ALIGN ( crtl -> outgoing_args_size ) ;


<s> static void loongarch_conditional_register_usage ( void ) {

if ( ! TARGET_HARD_FLOAT ) accessible_reg_set &= ~ ( reg_class_contents [ FP_REGS ] | reg_class_contents [ FCC_REGS ] ) ;


<s> static void loongarch_conditional_register_usage ( void ) { if ( ! TARGET_HARD_FLOAT ) accessible_reg_set &= ~ ( reg_class_contents [ FP_REGS ] | reg_class_contents [ FCC_REGS ] ) ;


<s> if ( TREE_CODE ( exp ) == STRING_CST || TREE_CODE ( exp ) == CONSTRUCTOR ) return MAX ( align , BITS_PER_WORD ) ;


<s> case CONST_VECTOR : case CONST_DOUBLE : return x == CONST0_RTX ( GET_MODE ( x ) ) ? <NUM_LIT> : <NUM_LIT> ; case CONST : if ( loongarch_symbolic_constant_p ( x , & symbol_type ) ) return loongarch_symbol_insns ( symbol_type , MAX_MACHINE_MODE ) ; split_const ( x , & x , & offset ) ; if ( offset != <NUM_LIT> ) { int n = loongarch_const_insns ( x ) ; if ( n != <NUM_LIT> ) { if ( IMM12_INT ( offset ) ) return n + <NUM_LIT> ; else if ( ! targetm . cannot_force_const_mem ( GET_MODE ( x ) , x ) ) return n + <NUM_LIT> + loongarch_integer_cost ( INTVAL ( offset ) ) ; }


<s> split_const ( x , & x , & offset ) ; if ( offset != <NUM_LIT> ) { int n = loongarch_const_insns ( x ) ; if ( n != <NUM_LIT> ) { if ( IMM12_INT ( offset ) ) return n + <NUM_LIT> ; else if ( ! targetm . cannot_force_const_mem ( GET_MODE ( x ) , x ) ) return n + <NUM_LIT> + loongarch_integer_cost ( INTVAL ( offset ) ) ; } } return <NUM_LIT> ; case SYMBOL_REF :


<s> if ( reg == stack_pointer_rtx || reg == frame_pointer_rtx || reg == hard_frame_pointer_rtx ) { offset -= cfun -> machine -> frame . total_size ; if ( reg == hard_frame_pointer_rtx ) offset += cfun -> machine -> frame . hard_frame_pointer_offset ;


<s> HOST_WIDE_INT loongarch_debugger_offset ( rtx addr , HOST_WIDE_INT offset ) { rtx offset2 = const0_rtx ; rtx reg = eliminate_constant_term ( addr , & offset2 ) ; if ( offset == <NUM_LIT> ) offset = INTVAL ( offset2 ) ; if ( reg == stack_pointer_rtx || reg == frame_pointer_rtx || reg == hard_frame_pointer_rtx ) {

offset -= cfun -> machine -> frame . total_size ;


<s> bool loongarch_eh_uses ( unsigned int regno ATTRIBUTE_UNUSED ) {


<s> enum rtx_code cmp_code = * code ; * code = NE ; * op0 = loongarch_allocate_fcc ( FCCmode ) ; * op1 = const0_rtx ;


<s> if ( IMM12_OPERAND ( - rhs ) ) { * op0 = loongarch_force_binary ( GET_MODE ( * op0 ) , PLUS , * op0 , GEN_INT ( - rhs ) ) ; * op1 = const0_rtx ; } } else { for ( size_t i = <NUM_LIT> ; i < ARRAY_SIZE ( mag_comparisons ) ; i ++ ) { HOST_WIDE_INT new_rhs ; bool increment = * code == mag_comparisons [ i ] [ <NUM_LIT> ] ; bool decrement = * code == mag_comparisons [ i ] [ <NUM_LIT> ] ; if ( ! increment && ! decrement ) continue ; new_rhs = rhs + ( increment ? <NUM_LIT> : - <NUM_LIT> ) ; if ( loongarch_integer_cost ( new_rhs ) < loongarch_integer_cost ( rhs ) && ( rhs < <NUM_LIT> ) == ( new_rhs < <NUM_LIT> ) ) {


<s> for ( size_t i = <NUM_LIT> ; i < ARRAY_SIZE ( mag_comparisons ) ; i ++ ) { HOST_WIDE_INT new_rhs ; bool increment = * code == mag_comparisons [ i ] [ <NUM_LIT> ] ; bool decrement = * code == mag_comparisons [ i ] [ <NUM_LIT> ] ; if ( ! increment && ! decrement ) continue ; new_rhs = rhs + ( increment ? <NUM_LIT> : - <NUM_LIT> ) ; if ( loongarch_integer_cost ( new_rhs ) < loongarch_integer_cost ( rhs ) && ( rhs < <NUM_LIT> ) == ( new_rhs < <NUM_LIT> ) ) { * op1 = GEN_INT ( new_rhs ) ; * code = mag_comparisons [ i ] [ increment ] ; } break ; } } } loongarch_extend_comparands ( * code , op0 , op1 ) ; * op0 = force_reg ( word_mode , * op0 ) ;

if ( * op1 != const0_rtx ) * op1 = force_reg ( word_mode , * op1 ) ;


<s> else { enum rtx_code inv_code = reverse_condition ( code ) ; if ( ! loongarch_canonicalize_int_order_test ( & inv_code , & cmp1 , mode ) ) { cmp1 = force_reg ( mode , cmp1 ) ; loongarch_emit_int_order_test ( code , invert_ptr , target , cmp0 , cmp1 ) ; }


<s> if ( ! loongarch_canonicalize_int_order_test ( & inv_code , & cmp1 , mode ) ) { cmp1 = force_reg ( mode , cmp1 ) ; loongarch_emit_int_order_test ( code , invert_ptr , target , cmp0 , cmp1 ) ; } else if ( invert_ptr == <NUM_LIT> ) { rtx inv_target ;


<s> rtx loongarch_emit_move ( rtx dest , rtx src ) {

return ( can_create_pseudo_p ( ) ? emit_move_insn ( dest , src ) : emit_move_insn_1 ( dest , src ) ) ;


<s> rtx loongarch_emit_move ( rtx dest , rtx src ) { return ( can_create_pseudo_p ( ) ? emit_move_insn ( dest , src ) : emit_move_insn_1 ( dest , src ) ) ;


<s> else { HOST_WIDE_INT rounded_size ; rtx r13 = LARCH_PROLOGUE_TEMP ( Pmode ) ; rtx r12 = LARCH_PROLOGUE_TEMP2 ( Pmode ) ; rtx r14 = LARCH_PROLOGUE_TEMP3 ( Pmode ) ; gcc_assert ( first <= <NUM_LIT> ) ; rounded_size = ROUND_DOWN ( size , PROBE_INTERVAL ) ; if ( first != <NUM_LIT> ) { emit_move_insn ( r14 , GEN_INT ( first ) ) ; emit_insn ( gen_rtx_SET ( r13 , gen_rtx_MINUS ( Pmode , stack_pointer_rtx , r14 ) ) ) ; } else emit_move_insn ( r13 , stack_pointer_rtx ) ; emit_move_insn ( r14 , GEN_INT ( PROBE_INTERVAL ) ) ; if ( rounded_size == <NUM_LIT> ) emit_move_insn ( r12 , r13 ) ; else { emit_move_insn ( r12 , GEN_INT ( rounded_size ) ) ; emit_insn ( gen_rtx_SET ( r12 , gen_rtx_MINUS ( Pmode , r13 , r12 ) ) ) ; emit_insn ( gen_probe_stack_range ( Pmode , r13 , r13 , r12 , r14 ) ) ; } if ( size != rounded_size ) { if ( TARGET_64BIT ) emit_stack_probe ( plus_constant ( Pmode , r12 , rounded_size - size ) ) ; else { HOST_WIDE_INT i ; for ( i = <NUM_LIT> ; i < ( size - rounded_size ) ; i += <NUM_LIT> ) { emit_stack_probe ( plus_constant ( Pmode , r12 , - i ) ) ; emit_insn ( gen_rtx_SET ( r12 , plus_constant ( Pmode , r12 , - <NUM_LIT> ) ) ) ; }

rtx r1 = plus_constant ( Pmode , r12 , - ( size - rounded_size - i + <NUM_LIT> ) ) ;


<s> else emit_move_insn ( r13 , stack_pointer_rtx ) ; emit_move_insn ( r14 , GEN_INT ( PROBE_INTERVAL ) ) ; if ( rounded_size == <NUM_LIT> ) emit_move_insn ( r12 , r13 ) ; else { emit_move_insn ( r12 , GEN_INT ( rounded_size ) ) ; emit_insn ( gen_rtx_SET ( r12 , gen_rtx_MINUS ( Pmode , r13 , r12 ) ) ) ; emit_insn ( gen_probe_stack_range ( Pmode , r13 , r13 , r12 , r14 ) ) ; } if ( size != rounded_size ) { if ( TARGET_64BIT ) emit_stack_probe ( plus_constant ( Pmode , r12 , rounded_size - size ) ) ; else { HOST_WIDE_INT i ; for ( i = <NUM_LIT> ; i < ( size - rounded_size ) ; i += <NUM_LIT> ) { emit_stack_probe ( plus_constant ( Pmode , r12 , - i ) ) ; emit_insn ( gen_rtx_SET ( r12 , plus_constant ( Pmode , r12 , - <NUM_LIT> ) ) ) ; } rtx r1 = plus_constant ( Pmode , r12 , - ( size - rounded_size - i + <NUM_LIT> ) ) ;


<s> emit_insn ( gen_stack_tie ( Pmode , stack_pointer_rtx , hard_frame_pointer_rtx ) ) ;


<s> MEM_VOLATILE_P ( memsi ) = MEM_VOLATILE_P ( mem ) ; shift = loongarch_force_binary ( Pmode , AND , orig_addr , GEN_INT ( <NUM_LIT> ) ) ; loongarch_emit_binary ( ASHIFT , shift , shift , GEN_INT ( <NUM_LIT> ) ) ; shiftsi = force_reg ( SImode , gen_lowpart ( SImode , shift ) ) ; unshifted_mask = GEN_INT ( GET_MODE_MASK ( mode ) ) ; unshifted_mask_reg = force_reg ( SImode , unshifted_mask ) ; mask = loongarch_force_binary ( SImode , ASHIFT , unshifted_mask_reg , shiftsi ) ; inverted_mask = gen_reg_rtx ( SImode ) ; emit_insn ( gen_rtx_SET ( inverted_mask , gen_rtx_NOT ( SImode , mask ) ) ) ; if ( oldval != const0_rtx ) { oldval = convert_modes ( SImode , mode , oldval , true ) ; oldval = force_reg ( SImode , oldval ) ; oldval = loongarch_force_binary ( SImode , ASHIFT , oldval , shiftsi ) ; } if ( newval && newval != const0_rtx ) { newval = convert_modes ( SImode , mode , newval , true ) ; newval = force_reg ( SImode , newval ) ; newval = loongarch_force_binary ( SImode , ASHIFT , newval , shiftsi ) ; } if ( result ) res = gen_reg_rtx ( SImode ) ; if ( newval ) si_op = generator . fn_7 ( res , memsi , mask , inverted_mask , oldval , newval , model ) ; else if ( result ) si_op = generator . fn_6 ( res , memsi , mask , inverted_mask , oldval , model ) ; else si_op = generator . fn_5 ( memsi , mask , inverted_mask , oldval , model ) ; emit_insn ( si_op ) ; if ( result ) { loongarch_emit_binary ( AND , res , res , mask ) ;

loongarch_emit_binary ( LSHIFTRT , res , res , shiftsi ) ;


<s> machine_mode mode ; mode = GET_MODE ( mem ) ; orig_addr = force_reg ( Pmode , XEXP ( mem , <NUM_LIT> ) ) ; memsi_addr = loongarch_force_binary ( Pmode , AND , orig_addr , force_reg ( Pmode , GEN_INT ( - <NUM_LIT> ) ) ) ; memsi = gen_rtx_MEM ( SImode , memsi_addr ) ; set_mem_alias_set ( memsi , ALIAS_SET_MEMORY_BARRIER ) ; MEM_VOLATILE_P ( memsi ) = MEM_VOLATILE_P ( mem ) ; shift = loongarch_force_binary ( Pmode , AND , orig_addr , GEN_INT ( <NUM_LIT> ) ) ; loongarch_emit_binary ( ASHIFT , shift , shift , GEN_INT ( <NUM_LIT> ) ) ; shiftsi = force_reg ( SImode , gen_lowpart ( SImode , shift ) ) ; unshifted_mask = GEN_INT ( GET_MODE_MASK ( mode ) ) ; unshifted_mask_reg = force_reg ( SImode , unshifted_mask ) ; mask = loongarch_force_binary ( SImode , ASHIFT , unshifted_mask_reg , shiftsi ) ; inverted_mask = gen_reg_rtx ( SImode ) ; emit_insn ( gen_rtx_SET ( inverted_mask , gen_rtx_NOT ( SImode , mask ) ) ) ;


<s> loongarch_block_move_straight ( dest , src , INTVAL ( length ) ) ; return true ; } else if ( optimize ) { loongarch_block_move_loop ( dest , src , INTVAL ( length ) , LARCH_MAX_MOVE_BYTES_PER_LOOP_ITER ) ; return true ; } }


<s> rtx op1 = operands [ <NUM_LIT> ] ; rtx condition ; if ( FLOAT_MODE_P ( GET_MODE ( op1 ) ) ) loongarch_emit_float_compare ( & code , & op0 , & op1 ) ;

else loongarch_emit_int_compare ( & code , & op0 , & op1 ) ;


<s> if ( FLOAT_MODE_P ( GET_MODE ( op1 ) ) ) loongarch_emit_float_compare ( & code , & op0 , & op1 ) ; else loongarch_emit_int_compare ( & code , & op0 , & op1 ) ; condition = gen_rtx_fmt_ee ( code , VOIDmode , op0 , op1 ) ;

emit_jump_insn ( gen_condjump ( condition , operands [ <NUM_LIT> ] ) ) ;


<s> op0 = force_reg ( word_mode , op0 ) ; if ( code == EQ || code == NE ) { op0 = loongarch_zero_if_equal ( op0 , op1 ) ; op1 = const0_rtx ; } else { bool invert = false ; rtx target = gen_reg_rtx ( GET_MODE ( op0 ) ) ; loongarch_emit_int_order_test ( code , & invert , target , op0 , op1 ) ; code = invert ? EQ : NE ; op0 = target ; op1 = const0_rtx ; } } rtx cond = gen_rtx_fmt_ee ( code , GET_MODE ( op0 ) , op0 , op1 ) ; if ( INTEGRAL_MODE_P ( GET_MODE ( operands [ <NUM_LIT> ] ) ) && register_operand ( operands [ <NUM_LIT> ] , VOIDmode ) && register_operand ( operands [ <NUM_LIT> ] , VOIDmode ) ) { machine_mode mode = GET_MODE ( operands [ <NUM_LIT> ] ) ; rtx temp = gen_reg_rtx ( mode ) ; rtx temp2 = gen_reg_rtx ( mode ) ; emit_insn ( gen_rtx_SET ( temp , gen_rtx_IF_THEN_ELSE ( mode , cond , operands [ <NUM_LIT> ] , const0_rtx ) ) ) ;

cond = gen_rtx_fmt_ee ( ( code == EQ ) ? NE : EQ , GET_MODE ( op0 ) , op0 , op1 ) ;


<s> if ( ( frame -> mask | frame -> fmask ) != <NUM_LIT> ) { step2 = loongarch_first_stack_step ( frame ) ; step1 -= step2 ; } if ( step1 > <NUM_LIT> ) { loongarch_emit_stack_tie ( ) ; need_barrier_p = false ; rtx adjust = GEN_INT ( step1 ) ; if ( ! IMM12_OPERAND ( step1 ) ) { loongarch_emit_move ( LARCH_PROLOGUE_TEMP ( Pmode ) , adjust ) ; adjust = LARCH_PROLOGUE_TEMP ( Pmode ) ; } insn = emit_insn ( gen_add3_insn ( stack_pointer_rtx , stack_pointer_rtx , adjust ) ) ; rtx dwarf = NULL_RTX ; rtx cfa_adjust_rtx = gen_rtx_PLUS ( Pmode , stack_pointer_rtx , GEN_INT ( step2 ) ) ; dwarf = alloc_reg_note ( REG_CFA_DEF_CFA , cfa_adjust_rtx , dwarf ) ; RTX_FRAME_RELATED_P ( insn ) = <NUM_LIT> ; REG_NOTES ( insn ) = dwarf ; }


<s> need_barrier_p = false ; rtx adjust = GEN_INT ( - frame -> hard_frame_pointer_offset ) ; if ( ! IMM12_OPERAND ( INTVAL ( adjust ) ) ) { loongarch_emit_move ( LARCH_PROLOGUE_TEMP ( Pmode ) , adjust ) ; adjust = LARCH_PROLOGUE_TEMP ( Pmode ) ; } insn = emit_insn ( gen_add3_insn ( stack_pointer_rtx , hard_frame_pointer_rtx , adjust ) ) ; rtx dwarf = NULL_RTX ; rtx minus_offset = GEN_INT ( - frame -> hard_frame_pointer_offset ) ; rtx cfa_adjust_value = gen_rtx_PLUS ( Pmode , hard_frame_pointer_rtx , minus_offset ) ; rtx cfa_adjust_rtx = gen_rtx_SET ( stack_pointer_rtx , cfa_adjust_value ) ; dwarf = alloc_reg_note ( REG_CFA_ADJUST_CFA , cfa_adjust_rtx , dwarf ) ; RTX_FRAME_RELATED_P ( insn ) = <NUM_LIT> ; REG_NOTES ( insn ) = dwarf ; } if ( ( frame -> mask | frame -> fmask ) != <NUM_LIT> ) { step2 = loongarch_first_stack_step ( frame ) ; step1 -= step2 ; } if ( step1 > <NUM_LIT> ) { loongarch_emit_stack_tie ( ) ; need_barrier_p = false ; rtx adjust = GEN_INT ( step1 ) ; if ( ! IMM12_OPERAND ( step1 ) ) { loongarch_emit_move ( LARCH_PROLOGUE_TEMP ( Pmode ) , adjust ) ; adjust = LARCH_PROLOGUE_TEMP ( Pmode ) ; } insn = emit_insn ( gen_add3_insn ( stack_pointer_rtx , stack_pointer_rtx , adjust ) ) ;


<s> else if ( size > <NUM_LIT> ) loongarch_emit_probe_stack_range ( get_stack_check_protect ( ) , size ) ; } if ( ( frame -> mask | frame -> fmask ) != <NUM_LIT> ) { HOST_WIDE_INT step1 = MIN ( size , loongarch_first_stack_step ( frame ) ) ; insn = gen_add3_insn ( stack_pointer_rtx , stack_pointer_rtx , GEN_INT ( - step1 ) ) ; RTX_FRAME_RELATED_P ( emit_insn ( insn ) ) = <NUM_LIT> ; size -= step1 ; loongarch_for_each_saved_reg ( size , loongarch_save_reg ) ; } if ( frame_pointer_needed ) { insn = gen_add3_insn ( hard_frame_pointer_rtx , stack_pointer_rtx , GEN_INT ( frame -> hard_frame_pointer_offset - size ) ) ; RTX_FRAME_RELATED_P ( emit_insn ( insn ) ) = <NUM_LIT> ; loongarch_emit_stack_tie ( ) ; }


<s> rtx target = operands [ <NUM_LIT> ] ; enum rtx_code code = GET_CODE ( operands [ <NUM_LIT> ] ) ; rtx op0 = operands [ <NUM_LIT> ] ; rtx op1 = operands [ <NUM_LIT> ] ; loongarch_extend_comparands ( code , & op0 , & op1 ) ; op0 = force_reg ( word_mode , op0 ) ; gcc_assert ( GET_MODE_CLASS ( GET_MODE ( op0 ) ) == MODE_INT ) ; if ( code == EQ || code == NE ) { rtx zie = loongarch_zero_if_equal ( op0 , op1 ) ;

loongarch_emit_binary ( code , target , zie , const0_rtx ) ;


<s> else * op1 = gen_rtx_ZERO_EXTEND ( word_mode , * op1 ) ; } else { * op0 = gen_rtx_SIGN_EXTEND ( word_mode , * op0 ) ; if ( * op1 != const0_rtx ) * op1 = gen_rtx_SIGN_EXTEND ( word_mode , * op1 ) ; } }


<s> if ( IMM12_OPERAND ( frame -> total_size ) ) return frame -> total_size ; HOST_WIDE_INT min_first_step = LARCH_STACK_ALIGN ( frame -> total_size - frame -> fp_sp_offset ) ;


<s> return loongarch_flatten_aggregate_field ( type , fields , <NUM_LIT> , <NUM_LIT> ) ;


<s> return n ; case ARRAY_TYPE : { HOST_WIDE_INT n_elts ; loongarch_aggregate_field subfields [ <NUM_LIT> ] ; tree index = TYPE_DOMAIN ( type ) ; tree elt_size = TYPE_SIZE_UNIT ( TREE_TYPE ( type ) ) ; int n_subfields = loongarch_flatten_aggregate_field ( TREE_TYPE ( type ) , subfields , <NUM_LIT> , offset ) ; if ( n_subfields <= <NUM_LIT> || ! COMPLETE_TYPE_P ( type ) || TREE_CODE ( TYPE_SIZE ( type ) ) != INTEGER_CST || ! index || ! TYPE_MAX_VALUE ( index ) || ! tree_fits_uhwi_p ( TYPE_MAX_VALUE ( index ) ) || ! TYPE_MIN_VALUE ( index ) || ! tree_fits_uhwi_p ( TYPE_MIN_VALUE ( index ) ) || ! tree_fits_uhwi_p ( elt_size ) ) return - <NUM_LIT> ; n_elts = <NUM_LIT> + tree_to_uhwi ( TYPE_MAX_VALUE ( index ) ) - tree_to_uhwi ( TYPE_MIN_VALUE ( index ) ) ; gcc_assert ( n_elts >= <NUM_LIT> ) ; for ( HOST_WIDE_INT i = <NUM_LIT> ; i < n_elts ; i ++ ) for ( int j = <NUM_LIT> ; j < n_subfields ; j ++ ) { if ( n >= <NUM_LIT> ) return - <NUM_LIT> ; fields [ n ] = subfields [ j ] ; fields [ n ++ ] . offset += i * tree_to_uhwi ( elt_size ) ; } return n ; }


<s> if ( ! loongarch_legitimate_address_p ( mode , x , false ) ) x = force_reg ( Pmode , x ) ;


<s> reg = gen_reg_rtx ( mode ) ; loongarch_emit_binary ( code , reg , op0 , op1 ) ; return reg ;


<s> if ( can_create_pseudo_p ( ) ) return force_reg ( Pmode , value ) ; else { loongarch_emit_move ( dest , value ) ;


<s> loongarch_save_restore_reg ( word_mode , regno , offset , fn ) ; offset -= UNITS_PER_WORD ; } offset = cfun -> machine -> frame . fp_sp_offset - sp_offset ; for ( int regno = FP_REG_FIRST ; regno <= FP_REG_LAST ; regno ++ ) if ( BITSET_P ( cfun -> machine -> frame . fmask , regno - FP_REG_FIRST ) ) { machine_mode mode = TARGET_DOUBLE_FLOAT ? DFmode : SFmode ; loongarch_save_restore_reg ( mode , regno , offset , fn ) ; offset -= GET_MODE_SIZE ( mode ) ;


<s> static void loongarch_for_each_saved_reg ( HOST_WIDE_INT sp_offset , loongarch_save_restore_fn fn ) { HOST_WIDE_INT offset ; offset = cfun -> machine -> frame . gp_sp_offset - sp_offset ; for ( int regno = GP_REG_FIRST ; regno <= GP_REG_LAST ; regno ++ ) if ( BITSET_P ( cfun -> machine -> frame . mask , regno - GP_REG_FIRST ) ) { loongarch_save_restore_reg ( word_mode , regno , offset , fn ) ; offset -= UNITS_PER_WORD ; } offset = cfun -> machine -> frame . fp_sp_offset - sp_offset ;

for ( int regno = FP_REG_FIRST ; regno <= FP_REG_LAST ; regno ++ ) if ( BITSET_P ( cfun -> machine -> frame . fmask , regno - FP_REG_FIRST ) ) {


<s> return mode == DFmode ? loongarch_cost -> fp_div_df : loongarch_cost -> fp_div_sf ;


<s> return mode == DFmode ? loongarch_cost -> fp_mult_df : loongarch_cost -> fp_mult_sf ;


<s> rtx set = gen_rtx_SET ( mem , reg ) ; RTX_FRAME_RELATED_P ( set ) = <NUM_LIT> ;


<s> rtx set = gen_rtx_SET ( mem , reg ) ;

RTX_FRAME_RELATED_P ( set ) = <NUM_LIT> ;


<s> if ( arg . end_marker_p ( ) ) return NULL ;

return loongarch_get_arg_info ( & info , cum , arg . mode , arg . type , arg . named , false ) ;


<s> static rtx loongarch_function_arg ( cumulative_args_t cum_v , const function_arg_info & arg ) { CUMULATIVE_ARGS * cum = get_cumulative_args ( cum_v ) ; struct loongarch_arg_info info ; if ( arg . end_marker_p ( ) ) return NULL ; return loongarch_get_arg_info ( & info , cum , arg . mode , arg . type , arg . named , false ) ;


<s> CUMULATIVE_ARGS * cum = get_cumulative_args ( cum_v ) ; struct loongarch_arg_info info ;

loongarch_get_arg_info ( & info , cum , arg . mode , arg . type , arg . named , false ) ;


<s> CUMULATIVE_ARGS * cum = get_cumulative_args ( cum_v ) ; struct loongarch_arg_info info ; loongarch_get_arg_info ( & info , cum , arg . mode , arg . type , arg . named , false ) ;

cum -> num_fprs = info . fpr_offset + info . num_fprs ;


<s> if ( type && ! AGGREGATE_TYPE_P ( type ) ) alignment = TYPE_ALIGN ( TYPE_MAIN_VARIANT ( type ) ) ; else alignment = type ? TYPE_ALIGN ( type ) : GET_MODE_ALIGNMENT ( mode ) ; return MIN ( PREFERRED_STACK_BOUNDARY , MAX ( PARM_BOUNDARY , alignment ) ) ;


<s> static bool loongarch_function_ok_for_sibcall ( tree decl ATTRIBUTE_UNUSED , tree exp ATTRIBUTE_UNUSED ) {


<s> return default_function_rodata_section ( decl , false ) ;


<s> static rtx loongarch_function_value ( const_tree valtype , const_tree fn_decl_or_type , bool outgoing ATTRIBUTE_UNUSED ) { return loongarch_function_value_1 ( valtype , fn_decl_or_type , VOIDmode ) ;


<s> int unsigned_p = TYPE_UNSIGNED ( type ) ; mode = TYPE_MODE ( type ) ; mode = promote_function_mode ( type , mode , & unsigned_p , func , <NUM_LIT> ) ; } memset ( & args , <NUM_LIT> , sizeof ( args ) ) ; return loongarch_get_arg_info ( & info , & args , mode , type , true , true ) ;


<s> memset ( & args , <NUM_LIT> , sizeof ( args ) ) ; return loongarch_get_arg_info ( & info , & args , mode , type , true , true ) ;


<s> static rtx loongarch_get_arg_info ( struct loongarch_arg_info * info , const CUMULATIVE_ARGS * cum , machine_mode mode , const_tree type , bool named , bool return_p ) { unsigned num_bytes , num_words ; unsigned fpr_base = return_p ? FP_RETURN : FP_ARG_FIRST ; unsigned gpr_base = return_p ? GP_RETURN : GP_ARG_FIRST ; unsigned alignment = loongarch_function_arg_boundary ( mode , type ) ; memset ( info , <NUM_LIT> , sizeof ( * info ) ) ; info -> gpr_offset = cum -> num_gprs ; info -> fpr_offset = cum -> num_fprs ; if ( named ) { loongarch_aggregate_field fields [ <NUM_LIT> ] ; unsigned fregno = fpr_base + info -> fpr_offset ; unsigned gregno = gpr_base + info -> gpr_offset ; if ( ( info -> num_fprs = loongarch_pass_aggregate_num_fpr ( type , fields ) ) && info -> fpr_offset + info -> num_fprs <= MAX_ARGS_IN_REGISTERS ) switch ( info -> num_fprs ) { case <NUM_LIT> : return loongarch_pass_fpr_single ( mode , fregno , TYPE_MODE ( fields [ <NUM_LIT> ] . type ) , fields [ <NUM_LIT> ] . offset ) ; case <NUM_LIT> : return loongarch_pass_fpr_pair ( mode , fregno , TYPE_MODE ( fields [ <NUM_LIT> ] . type ) , fields [ <NUM_LIT> ] . offset , fregno + <NUM_LIT> , TYPE_MODE ( fields [ <NUM_LIT> ] . type ) , fields [ <NUM_LIT> ] . offset ) ;


<s> bool loongarch_global_symbol_noweak_p ( const_rtx x ) { if ( LABEL_REF_P ( x ) ) return false ; const_tree decl = SYMBOL_REF_DECL ( x ) ; if ( ! decl ) return ! SYMBOL_REF_LOCAL_P ( x ) || SYMBOL_REF_EXTERNAL_P ( x ) ;

return DECL_P ( decl ) && TREE_PUBLIC ( decl ) ;


<s> if ( LABEL_REF_P ( x ) ) return false ;

const_tree decl = SYMBOL_REF_DECL ( x ) ;


<s> const_tree decl = SYMBOL_REF_DECL ( x ) ;

if ( ! decl ) return ! SYMBOL_REF_LOCAL_P ( x ) || SYMBOL_REF_EXTERNAL_P ( x ) ;


<s> bool loongarch_global_symbol_p ( const_rtx x ) { if ( LABEL_REF_P ( x ) ) return false ; const_tree decl = SYMBOL_REF_DECL ( x ) ;


<s> static rtx loongarch_got_load_tls_gd ( rtx dest , rtx sym ) {

return gen_got_load_tls_gd ( Pmode , dest , sym ) ;


<s> return gen_got_load_tls_ie ( Pmode , dest , sym ) ;


<s> static rtx loongarch_got_load_tls_ie ( rtx dest , rtx sym ) {

return gen_got_load_tls_ie ( Pmode , dest , sym ) ;


<s> return gen_got_load_tls_ld ( Pmode , dest , sym ) ;


<s> return gen_got_load_tls_le ( Pmode , dest , sym ) ;


<s> static rtx loongarch_got_load_tls_le ( rtx dest , rtx sym ) { return gen_got_load_tls_le ( Pmode , dest , sym ) ;


<s> machine_mode loongarch_hard_regno_caller_save_mode ( unsigned int regno , unsigned int nregs , machine_mode mode ) {

if ( mode == VOIDmode ) return choose_hard_reg_mode ( regno , nregs , NULL ) ;


<s> static bool loongarch_hard_regno_mode_ok ( unsigned int regno , machine_mode mode ) {

return loongarch_hard_regno_mode_ok_p [ mode ] [ regno ] ;


<s> unsigned int size ; enum mode_class mclass ; if ( mode == FCCmode ) return FCC_REG_P ( regno ) ; size = GET_MODE_SIZE ( mode ) ; mclass = GET_MODE_CLASS ( mode ) ; if ( GP_REG_P ( regno ) ) return ( ( regno - GP_REG_FIRST ) & <NUM_LIT> ) == <NUM_LIT> || size <= UNITS_PER_WORD ; if ( FP_REG_P ( regno ) ) { if ( mclass == MODE_FLOAT || mclass == MODE_COMPLEX_FLOAT || mclass == MODE_VECTOR_FLOAT ) return size <= UNITS_PER_FPVALUE ; if ( mclass == MODE_INT ) return size >= MIN_UNITS_PER_WORD && size <= UNITS_PER_FPREG ; }


<s> enum mode_class mclass ; if ( mode == FCCmode ) return FCC_REG_P ( regno ) ; size = GET_MODE_SIZE ( mode ) ; mclass = GET_MODE_CLASS ( mode ) ; if ( GP_REG_P ( regno ) ) return ( ( regno - GP_REG_FIRST ) & <NUM_LIT> ) == <NUM_LIT> || size <= UNITS_PER_WORD ; if ( FP_REG_P ( regno ) ) {

if ( mclass == MODE_FLOAT || mclass == MODE_COMPLEX_FLOAT || mclass == MODE_VECTOR_FLOAT ) return size <= UNITS_PER_FPVALUE ;


<s> static unsigned int loongarch_hard_regno_nregs ( unsigned int regno , machine_mode mode ) { if ( FCC_REG_P ( regno ) ) return ( GET_MODE_SIZE ( mode ) + <NUM_LIT> ) / <NUM_LIT> ;

if ( FP_REG_P ( regno ) ) return ( GET_MODE_SIZE ( mode ) + UNITS_PER_FPREG - <NUM_LIT> ) / UNITS_PER_FPREG ;


<s> count = <NUM_LIT> ; if ( TARGET_CHECK_ZERO_DIV ) count += <NUM_LIT> ;


<s> case LT : case LTU : return IMM12_OPERAND ( x ) ; case EQ : case NE : case GT : case GTU : return x == <NUM_LIT> ; case GE : case GEU : return x == <NUM_LIT> ; case LE : return IMM12_OPERAND ( x + <NUM_LIT> ) ; case LEU : return IMM12_OPERAND ( x + <NUM_LIT> ) && x + <NUM_LIT> != <NUM_LIT> ; case SIGN_EXTRACT : case ZERO_EXTRACT :


<s> if ( GET_CODE ( addr ) != PLUS || ! REG_P ( XEXP ( addr , <NUM_LIT> ) ) || ! REG_P ( XEXP ( addr , <NUM_LIT> ) ) ) return false ; return true ;


<s> if ( GET_CODE ( addr ) != PLUS || ! REG_P ( XEXP ( addr , <NUM_LIT> ) ) || ! REG_P ( XEXP ( addr , <NUM_LIT> ) ) ) return false ;


<s> else gcc_unreachable ( ) ; if ( from == FRAME_POINTER_REGNUM ) src = cfun -> machine -> frame . frame_pointer_offset ; else if ( from == ARG_POINTER_REGNUM ) src = cfun -> machine -> frame . arg_pointer_offset ;


<s> HOST_WIDE_INT src , dest ; loongarch_compute_frame_info ( ) ; if ( to == HARD_FRAME_POINTER_REGNUM ) dest = cfun -> machine -> frame . hard_frame_pointer_offset ; else if ( to == STACK_POINTER_REGNUM ) dest = <NUM_LIT> ; else gcc_unreachable ( ) ; if ( from == FRAME_POINTER_REGNUM ) src = cfun -> machine -> frame . frame_pointer_offset ;

else if ( from == ARG_POINTER_REGNUM ) src = cfun -> machine -> frame . arg_pointer_offset ;


<s> static struct machine_function * loongarch_init_machine_status ( void ) {

return ggc_cleared_alloc < machine_function > ( ) ;


<s> static struct machine_function * loongarch_init_machine_status ( void ) { return ggc_cleared_alloc < machine_function > ( ) ;


<s> for ( p = <STR_LIT> ; * p ; p ++ ) loongarch_print_operand_punct [ ( unsigned char ) * p ] = true ;


<s> return loongarch_build_integer ( codes , value ) ;


<s> return reg_or_0_operand ( cmp1 , VOIDmode ) ; case GE : case GEU : return cmp1 == const1_rtx ; case LT : case LTU : return arith_operand ( cmp1 , VOIDmode ) ; case LE : return sle_operand ( cmp1 , VOIDmode ) ; case LEU : return sleu_operand ( cmp1 , VOIDmode ) ; default :


<s> return cmp1 == const1_rtx ; case LT : case LTU : return arith_operand ( cmp1 , VOIDmode ) ; case LE : return sle_operand ( cmp1 , VOIDmode ) ; case LEU : return sleu_operand ( cmp1 , VOIDmode ) ;


<s> if ( TREE_CODE ( decl ) == STRING_CST || TREE_CODE ( decl ) == FUNCTION_DECL ) return false ; if ( VAR_P ( decl ) && DECL_SECTION_NAME ( decl ) != <NUM_LIT> ) { const char * name ; name = DECL_SECTION_NAME ( decl ) ; if ( strcmp ( name , <STR_LIT> ) != <NUM_LIT> && strcmp ( name , <STR_LIT> ) != <NUM_LIT> ) return false ; if ( ! DECL_EXTERNAL ( decl ) ) return true ;


<s> int size ; if ( TREE_CODE ( decl ) == STRING_CST || TREE_CODE ( decl ) == FUNCTION_DECL ) return false ; if ( VAR_P ( decl ) && DECL_SECTION_NAME ( decl ) != <NUM_LIT> ) { const char * name ; name = DECL_SECTION_NAME ( decl ) ;

if ( strcmp ( name , <STR_LIT> ) != <NUM_LIT> && strcmp ( name , <STR_LIT> ) != <NUM_LIT> ) return false ;


<s> static bool loongarch_legitimate_address_p ( machine_mode mode , rtx x , bool strict_p ) { struct loongarch_address_info addr ; return loongarch_classify_address ( & addr , x , mode , strict_p ) ;


<s> static bool loongarch_legitimate_constant_p ( machine_mode mode ATTRIBUTE_UNUSED , rtx x ) { return loongarch_const_insns ( x ) > <NUM_LIT> ;


<s> HOST_WIDE_INT offset ; if ( loongarch_tls_symbol_p ( x ) ) return loongarch_legitimize_tls_address ( x ) ; loongarch_split_plus ( x , & base , & offset ) ; if ( offset != <NUM_LIT> ) { if ( ! loongarch_valid_base_register_p ( base , mode , false ) ) base = copy_to_mode_reg ( Pmode , base ) ;

addr = loongarch_add_offset ( NULL , base , offset ) ;


<s> if ( offset != <NUM_LIT> ) { if ( ! loongarch_valid_base_register_p ( base , mode , false ) ) base = copy_to_mode_reg ( Pmode , base ) ; addr = loongarch_add_offset ( NULL , base , offset ) ;

return loongarch_force_address ( addr , mode ) ;


<s> rtx loongarch_legitimize_call_address ( rtx addr ) { if ( ! call_insn_operand ( addr , VOIDmode ) ) { rtx reg = gen_reg_rtx ( Pmode ) ; loongarch_emit_move ( reg , addr ) ; return reg ;


<s> if ( offset != const0_rtx && ( targetm . cannot_force_const_mem ( mode , src ) || ( can_create_pseudo_p ( ) ) ) ) { base = loongarch_force_temporary ( dest , base ) ; loongarch_emit_move ( dest , loongarch_add_offset ( NULL , base , INTVAL ( offset ) ) ) ; return ; } src = force_const_mem ( mode , src ) ;


<s> } if ( CONSTANT_P ( src ) && ! move_operand ( src , mode ) ) { loongarch_legitimize_const_move ( mode , dest , src ) ; set_unique_reg_note ( get_last_insn ( ) , REG_EQUAL , copy_rtx ( src ) ) ; return true ;


<s> return true ; } if ( ! register_operand ( dest , mode ) && ! register_operand ( src , mode ) && ! const_0_operand ( src , mode ) ) { loongarch_emit_move ( dest , force_reg ( mode , src ) ) ; return true ; } if ( CONSTANT_P ( src ) && ! move_operand ( src , mode ) ) { loongarch_legitimize_const_move ( mode , dest , src ) ;

set_unique_reg_note ( get_last_insn ( ) , REG_EQUAL , copy_rtx ( src ) ) ;


<s> emit_libcall_block ( insn , dest , tmp , loc ) ; break ; case TLS_MODEL_GLOBAL_DYNAMIC : tmp = gen_rtx_REG ( Pmode , GP_RETURN ) ; dest = gen_reg_rtx ( Pmode ) ; insn = loongarch_call_tls_get_addr ( loc , SYMBOL_TLSGD , tmp ) ; emit_libcall_block ( insn , dest , tmp , loc ) ; break ; case TLS_MODEL_INITIAL_EXEC : tp = gen_rtx_REG ( Pmode , THREAD_POINTER_REGNUM ) ; tmp = gen_reg_rtx ( Pmode ) ; emit_insn ( loongarch_got_load_tls_ie ( tmp , loc ) ) ; dest = gen_reg_rtx ( Pmode ) ; emit_insn ( gen_add3_insn ( dest , tmp , tp ) ) ;


<s> dest = gen_reg_rtx ( Pmode ) ; emit_insn ( gen_add3_insn ( dest , tmp , tp ) ) ; break ; case TLS_MODEL_LOCAL_EXEC : tp = gen_rtx_REG ( Pmode , THREAD_POINTER_REGNUM ) ; tmp = gen_reg_rtx ( Pmode ) ; emit_insn ( loongarch_got_load_tls_le ( tmp , loc ) ) ; dest = gen_reg_rtx ( Pmode ) ; emit_insn ( gen_add3_insn ( dest , tmp , tp ) ) ; break ; default :


<s> if ( load_p && ( REGNO ( reg1 ) == REGNO ( base1 ) || ( REGNO ( reg2 ) == REGNO ( base1 ) ) ) ) return false ; if ( load_p && REGNO ( reg1 ) == REGNO ( reg2 ) ) return false ; rc1 = REGNO_REG_CLASS ( REGNO ( reg1 ) ) ; rc2 = REGNO_REG_CLASS ( REGNO ( reg2 ) ) ; if ( rc1 != rc2 && ! reg_class_subset_p ( rc1 , rc2 ) && ! reg_class_subset_p ( rc2 , rc1 ) ) return false ; if ( abs ( offset1 - offset2 ) != GET_MODE_SIZE ( mode ) ) return false ;


<s> if ( load_p ) { reg1 = operands [ <NUM_LIT> ] ; reg2 = operands [ <NUM_LIT> ] ; mem1 = operands [ <NUM_LIT> ] ; mem2 = operands [ <NUM_LIT> ] ; } else { reg1 = operands [ <NUM_LIT> ] ; reg2 = operands [ <NUM_LIT> ] ; mem1 = operands [ <NUM_LIT> ] ; mem2 = operands [ <NUM_LIT> ] ; } if ( loongarch_address_insns ( XEXP ( mem1 , <NUM_LIT> ) , mode , false ) == <NUM_LIT> || loongarch_address_insns ( XEXP ( mem2 , <NUM_LIT> ) , mode , false ) == <NUM_LIT> ) return false ; loongarch_split_plus ( XEXP ( mem1 , <NUM_LIT> ) , & base1 , & offset1 ) ; loongarch_split_plus ( XEXP ( mem2 , <NUM_LIT> ) , & base2 , & offset2 ) ; if ( ! REG_P ( base1 ) || ! rtx_equal_p ( base1 , base2 ) ) return false ; if ( load_p && ( REGNO ( reg1 ) == REGNO ( base1 ) || ( REGNO ( reg2 ) == REGNO ( base1 ) ) ) ) return false ; if ( load_p && REGNO ( reg1 ) == REGNO ( reg2 ) ) return false ; rc1 = REGNO_REG_CLASS ( REGNO ( reg1 ) ) ; rc2 = REGNO_REG_CLASS ( REGNO ( reg2 ) ) ; if ( rc1 != rc2 && ! reg_class_subset_p ( rc1 , rc2 ) && ! reg_class_subset_p ( rc2 , rc1 ) ) return false ; if ( abs ( offset1 - offset2 ) != GET_MODE_SIZE ( mode ) ) return false ;


<s> bool might_split_p ; rtx set ; gcc_assert ( MEM_P ( mem ) ) ; mode = GET_MODE ( mem ) ; might_split_p = GET_MODE_SIZE ( mode ) > UNITS_PER_WORD ;


<s> case MEMMODEL_ACQ_REL : case MEMMODEL_SEQ_CST : case MEMMODEL_SYNC_SEQ_CST : case MEMMODEL_RELEASE : case MEMMODEL_SYNC_RELEASE : return true ; case MEMMODEL_ACQUIRE : case MEMMODEL_CONSUME : case MEMMODEL_SYNC_ACQUIRE :


<s> switch ( model ) { case MEMMODEL_ACQ_REL : case MEMMODEL_SEQ_CST : case MEMMODEL_SYNC_SEQ_CST : case MEMMODEL_RELEASE : case MEMMODEL_SYNC_RELEASE : case MEMMODEL_ACQUIRE : case MEMMODEL_CONSUME : case MEMMODEL_SYNC_ACQUIRE : return true ; case MEMMODEL_RELAXED :


<s> static int loongarch_memory_move_cost ( machine_mode mode , reg_class_t rclass , bool in ) {

return ( loongarch_cost -> memory_latency + memory_move_secondary_cost ( mode , rclass , in ) ) ;


<s> return ( loongarch_cost -> memory_latency + memory_move_secondary_cost ( mode , rclass , in ) ) ;


return ( mode1 == mode2 || ( ! loongarch_mode_ok_for_mov_fmt_p ( mode1 ) && ! loongarch_mode_ok_for_mov_fmt_p ( mode2 ) ) ) ;


<s> case E_FCCmode : case E_SFmode : return TARGET_HARD_FLOAT ;


<s> case E_SFmode : return TARGET_HARD_FLOAT ; case E_DFmode : return TARGET_HARD_FLOAT && TARGET_DOUBLE_FLOAT ; default : return <NUM_LIT> ; }


<s> break ; case METHOD_LU32I : emit_insn ( gen_rtx_SET ( x , gen_rtx_IOR ( DImode , gen_rtx_ZERO_EXTEND ( DImode , gen_rtx_SUBREG ( SImode , x , <NUM_LIT> ) ) , GEN_INT ( codes [ i ] . value ) ) ) ) ; break ; case METHOD_LU52I : emit_insn ( gen_lu52i_d ( x , x , GEN_INT ( <NUM_LIT> ) , GEN_INT ( codes [ i ] . value ) ) ) ; break ; case METHOD_INSV : emit_insn ( gen_rtx_SET ( gen_rtx_ZERO_EXTRACT ( DImode , x , GEN_INT ( <NUM_LIT> ) , GEN_INT ( <NUM_LIT> ) ) , gen_rtx_REG ( DImode , <NUM_LIT> ) ) ) ; break ; default :


<s> mode = GET_MODE ( dest ) ; num_ops = loongarch_build_integer ( codes , value ) ; x = GEN_INT ( codes [ <NUM_LIT> ] . value ) ; for ( i = <NUM_LIT> ; i < num_ops ; i ++ ) { if ( ! can_create_pseudo_p ( ) ) { emit_insn ( gen_rtx_SET ( temp , x ) ) ; x = temp ; } else x = force_reg ( mode , x ) ; switch ( codes [ i ] . method ) { case METHOD_NORMAL : x = gen_rtx_fmt_ee ( codes [ i ] . code , mode , x , GEN_INT ( codes [ i ] . value ) ) ; break ; case METHOD_LU32I : emit_insn ( gen_rtx_SET ( x , gen_rtx_IOR ( DImode , gen_rtx_ZERO_EXTEND ( DImode , gen_rtx_SUBREG ( SImode , x , <NUM_LIT> ) ) , GEN_INT ( codes [ i ] . value ) ) ) ) ; break ; case METHOD_LU52I : emit_insn ( gen_lu52i_d ( x , x , GEN_INT ( <NUM_LIT> ) , GEN_INT ( codes [ i ] . value ) ) ) ;


<s> switch ( from ) { case GENERAL_REGS : return <NUM_LIT> ; case FP_REGS : return <NUM_LIT> ;


<s> static int loongarch_multipass_dfa_lookahead ( void ) { if ( ( unsigned long ) LARCH_ACTUAL_TUNE < N_ARCH_TYPES ) return loongarch_cpu_multipass_dfa_lookahead [ LARCH_ACTUAL_TUNE ] ; else return <NUM_LIT> ;


<s> static void loongarch_option_override ( void ) {

loongarch_option_override_internal ( & global_options ) ;


<s> int cur_pos ; cur_pos = <NUM_LIT> ; fprintf ( stream , <STR_LIT> ) ; for ( i = <NUM_LIT> ; i < len ; i ++ ) { int c ; c = ( unsigned char ) string [ i ] ; if ( ISPRINT ( c ) ) { if ( c == '\\' || c == '\"' ) { putc ( '\\' , stream ) ; cur_pos ++ ; }


<s> putc ( '\\' , stream ) ; cur_pos ++ ; } putc ( c , stream ) ; cur_pos ++ ; } else { fprintf ( stream , <STR_LIT> , c ) ; cur_pos += <NUM_LIT> ; } if ( cur_pos > <NUM_LIT> && i + <NUM_LIT> < len ) { cur_pos = <NUM_LIT> ;


<s> taken = operands [ <NUM_LIT> ] ; operands [ <NUM_LIT> ] = not_taken ; output_asm_insn ( branch_if_false , operands ) ; output_asm_insn ( <STR_LIT> , & taken ) ; targetm . asm_out . internal_label ( asm_out_file , <STR_LIT> , CODE_LABEL_NUMBER ( not_taken ) ) ;


<s> gcc_assert ( LABEL_P ( operands [ <NUM_LIT> ] ) ) ; length = get_attr_length ( insn ) ; if ( length <= <NUM_LIT> ) { return branch_if_true ; } rtx_code_label * not_taken = gen_label_rtx ( ) ; taken = operands [ <NUM_LIT> ] ;


<s> output_asm_insn ( s , operands ) ; s = <STR_LIT> ; }


<s> const char * s ; s = division ; if ( TARGET_CHECK_ZERO_DIV ) { output_asm_insn ( s , operands ) ; s = <STR_LIT> ; }


<s> fputs ( <STR_LIT> , file ) ; break ; case <NUM_LIT> : fputs ( <STR_LIT> , file ) ; break ; default : gcc_unreachable ( ) ; }


<s> assemble_name ( file , name ) ; fprintf ( file , <STR_LIT> HOST_WIDE_INT_PRINT_DEC <STR_LIT> , int_size_in_bytes ( TREE_TYPE ( decl ) ) ) ; }


<s> void loongarch_output_external ( FILE * file , tree decl , const char * name ) { default_elf_asm_output_external ( file , decl , name ) ; if ( TREE_SYMBOL_REFERENCED ( DECL_ASSEMBLER_NAME ( decl ) ) ) { if ( loongarch_in_small_data_p ( decl ) ) {


<s> temp2 = gen_rtx_REG ( Pmode , <NUM_LIT> ) ; if ( aggregate_value_p ( TREE_TYPE ( TREE_TYPE ( function ) ) , function ) ) this_rtx = gen_rtx_REG ( Pmode , GP_ARG_FIRST + <NUM_LIT> ) ; else this_rtx = gen_rtx_REG ( Pmode , GP_ARG_FIRST ) ; if ( delta != <NUM_LIT> ) { rtx offset = GEN_INT ( delta ) ; if ( ! IMM12_OPERAND ( delta ) ) { loongarch_emit_move ( temp1 , offset ) ; offset = temp1 ; } emit_insn ( gen_add3_insn ( this_rtx , this_rtx , offset ) ) ; } if ( vcall_offset != <NUM_LIT> ) { rtx addr ; loongarch_emit_move ( temp1 , gen_rtx_MEM ( Pmode , this_rtx ) ) ; addr = loongarch_add_offset ( temp2 , temp1 , vcall_offset ) ; loongarch_emit_move ( temp1 , gen_rtx_MEM ( Pmode , addr ) ) ; emit_insn ( gen_add3_insn ( this_rtx , this_rtx , temp1 ) ) ; } if ( use_sibcall_p ) { insn = emit_call_insn ( gen_sibcall_internal ( fnaddr , const0_rtx ) ) ; SIBLING_CALL_P ( insn ) = <NUM_LIT> ; } else { loongarch_emit_move ( temp1 , fnaddr ) ; emit_jump_insn ( gen_indirect_jump ( temp1 ) ) ; } insn = get_insns ( ) ;


<s> use_sibcall_p = const_call_insn_operand ( fnaddr , Pmode ) ; temp1 = gen_rtx_REG ( Pmode , <NUM_LIT> ) ; temp2 = gen_rtx_REG ( Pmode , <NUM_LIT> ) ; if ( aggregate_value_p ( TREE_TYPE ( TREE_TYPE ( function ) ) , function ) ) this_rtx = gen_rtx_REG ( Pmode , GP_ARG_FIRST + <NUM_LIT> ) ; else this_rtx = gen_rtx_REG ( Pmode , GP_ARG_FIRST ) ; if ( delta != <NUM_LIT> ) { rtx offset = GEN_INT ( delta ) ; if ( ! IMM12_OPERAND ( delta ) ) { loongarch_emit_move ( temp1 , offset ) ; offset = temp1 ; } emit_insn ( gen_add3_insn ( this_rtx , this_rtx , offset ) ) ; } if ( vcall_offset != <NUM_LIT> ) { rtx addr ; loongarch_emit_move ( temp1 , gen_rtx_MEM ( Pmode , this_rtx ) ) ;


<s> else gcc_unreachable ( ) ; } if ( symbolic_operand ( src , VOIDmode ) ) { if ( ( TARGET_CMODEL_TINY && ( ! loongarch_global_symbol_p ( src ) || loongarch_symbol_binds_local_p ( src ) ) ) || ( TARGET_CMODEL_TINY_STATIC && ! loongarch_weak_symbol_p ( src ) ) ) { unsigned int align ; if ( LABEL_REF_P ( src ) ) align = <NUM_LIT> ; else if ( CONSTANT_POOL_ADDRESS_P ( src ) ) align = GET_MODE_ALIGNMENT ( get_pool_mode ( src ) ) ; else if ( TREE_CONSTANT_POOL_ADDRESS_P ( src ) ) { tree exp = SYMBOL_REF_DECL ( src ) ; align = TYPE_ALIGN ( TREE_TYPE ( exp ) ) ; align = loongarch_constant_alignment ( exp , align ) ; } else if ( SYMBOL_REF_DECL ( src ) ) align = DECL_ALIGN ( SYMBOL_REF_DECL ( src ) ) ; else if ( SYMBOL_REF_HAS_BLOCK_INFO_P ( src ) && SYMBOL_REF_BLOCK ( src ) != NULL ) align = SYMBOL_REF_BLOCK ( src ) -> alignment ; else align = BITS_PER_UNIT ; if ( align % ( <NUM_LIT> * <NUM_LIT> ) == <NUM_LIT> ) return <STR_LIT> ; } if ( TARGET_CMODEL_TINY || TARGET_CMODEL_TINY_STATIC || TARGET_CMODEL_NORMAL || TARGET_CMODEL_LARGE ) { if ( ! loongarch_global_symbol_p ( src ) || loongarch_symbol_binds_local_p ( src ) ) return <STR_LIT> ; else return <STR_LIT> ; } if ( TARGET_CMODEL_EXTREME ) { sorry ( <STR_LIT> ) ; gcc_unreachable ( ) ; } } } if ( src_code == REG && FP_REG_P ( REGNO ( src ) ) ) { if ( dest_code == REG && FP_REG_P ( REGNO ( dest ) ) ) return dbl_p ? <STR_LIT> : <STR_LIT> ; if ( dest_code == MEM ) { const char * insn = NULL ; insn = loongarch_output_move_index_float ( XEXP ( dest , <NUM_LIT> ) , GET_MODE ( dest ) , false ) ; if ( insn ) return insn ; return dbl_p ? <STR_LIT> : <STR_LIT> ; } } if ( dest_code == REG && FP_REG_P ( REGNO ( dest ) ) ) { if ( src_code == MEM ) { const char * insn = NULL ; insn = loongarch_output_move_index_float ( XEXP ( src , <NUM_LIT> ) , GET_MODE ( src ) , true ) ; if ( insn ) return insn ;


<s> int index = exact_log2 ( GET_MODE_SIZE ( mode ) ) ; if ( ! IN_RANGE ( index , <NUM_LIT> , <NUM_LIT> ) ) return NULL ; struct loongarch_address_info info ; if ( ( loongarch_classify_address ( & info , x , mode , false ) && ! ( info . type == ADDRESS_REG_REG ) ) || ! loongarch_legitimate_address_p ( mode , x , false ) ) return NULL ; const char * const insn [ ] [ <NUM_LIT> ] = { { <STR_LIT> , <STR_LIT> , <STR_LIT> , <STR_LIT> , } , { <STR_LIT> , <STR_LIT> , <STR_LIT> , <STR_LIT> , }


<s> if ( ! IN_RANGE ( index , <NUM_LIT> , <NUM_LIT> ) ) return NULL ; struct loongarch_address_info info ; if ( ( loongarch_classify_address ( & info , x , mode , false ) && ! ( info . type == ADDRESS_REG_REG ) ) || ! loongarch_legitimate_address_p ( mode , x , false ) ) return NULL ;

const char * const insn [ ] [ <NUM_LIT> ] = {


<s> const char * loongarch_output_move_index_float ( rtx x , machine_mode mode , bool ldr ) { int index = exact_log2 ( GET_MODE_SIZE ( mode ) ) ; if ( ! IN_RANGE ( index , <NUM_LIT> , <NUM_LIT> ) ) return NULL ;


<s> case LTU : case GT : case GTU : inverted_p = ! inverted_p ; case LE : case LEU : case GE : case GEU : branch [ ! inverted_p ] = LARCH_BRANCH ( <STR_LIT> , <STR_LIT> ) ; branch [ inverted_p ] = <STR_LIT> ; break ; default : gcc_unreachable ( ) ; } } else { switch ( GET_CODE ( operands [ <NUM_LIT> ] ) ) { case LE : case LEU : case GT : case GTU : case LT : case LTU : case GE : case GEU : branch [ ! inverted_p ] = LARCH_BRANCH ( <STR_LIT> , <STR_LIT> ) ; branch [ inverted_p ] = LARCH_BRANCH ( <STR_LIT> , <STR_LIT> ) ; break ; default : gcc_unreachable ( ) ; } } } else { switch ( GET_CODE ( operands [ <NUM_LIT> ] ) ) { case LEU : case GTU : case LTU : case GEU : case LE : case GT : case LT : case GE : branch [ ! inverted_p ] = LARCH_BRANCH ( <STR_LIT> , <STR_LIT> ) ; branch [ inverted_p ] = LARCH_BRANCH ( <STR_LIT> , <STR_LIT> ) ; break ; default :


<s> xops [ <NUM_LIT> ] = GEN_INT ( - PROBE_INTERVAL ) ; xops [ <NUM_LIT> ] = reg3 ; if ( TARGET_64BIT ) output_asm_insn ( <STR_LIT> , xops ) ; else output_asm_insn ( <STR_LIT> , xops ) ; xops [ <NUM_LIT> ] = reg2 ; strcpy ( tmp , <STR_LIT> ) ; if ( TARGET_64BIT ) output_asm_insn ( <STR_LIT> , xops ) ; else output_asm_insn ( <STR_LIT> , xops ) ;

output_asm_insn ( strcat ( tmp , & loop_lab [ <NUM_LIT> ] ) , xops ) ;


<s> ASM_OUTPUT_INTERNAL_LABEL ( asm_out_file , loop_lab ) ; xops [ <NUM_LIT> ] = reg1 ; xops [ <NUM_LIT> ] = GEN_INT ( - PROBE_INTERVAL ) ; xops [ <NUM_LIT> ] = reg3 ; if ( TARGET_64BIT ) output_asm_insn ( <STR_LIT> , xops ) ; else output_asm_insn ( <STR_LIT> , xops ) ; xops [ <NUM_LIT> ] = reg2 ; strcpy ( tmp , <STR_LIT> ) ; if ( TARGET_64BIT ) output_asm_insn ( <STR_LIT> , xops ) ; else output_asm_insn ( <STR_LIT> , xops ) ; output_asm_insn ( strcat ( tmp , & loop_lab [ <NUM_LIT> ] ) , xops ) ; return <STR_LIT> ;


<s> int n = loongarch_flatten_aggregate_argument ( type , fields ) ; for ( int i = <NUM_LIT> ; i < n ; i ++ ) { num_float += SCALAR_FLOAT_TYPE_P ( fields [ i ] . type ) ; num_int += INTEGRAL_TYPE_P ( fields [ i ] . type ) ;


<s> int n = loongarch_flatten_aggregate_argument ( type , fields ) ; for ( int i = <NUM_LIT> ; i < n ; i ++ ) { num_float += SCALAR_FLOAT_TYPE_P ( fields [ i ] . type ) ; num_int += INTEGRAL_TYPE_P ( fields [ i ] . type ) ; } return num_int == <NUM_LIT> && num_float == <NUM_LIT> ;


<s> for ( int i = <NUM_LIT> ; i < n ; i ++ ) if ( ! SCALAR_FLOAT_TYPE_P ( fields [ i ] . type ) ) return <NUM_LIT> ; return n > <NUM_LIT> ? n : <NUM_LIT> ;


<s> HOST_WIDE_INT size = arg . type_size_in_bytes ( ) ; struct loongarch_arg_info info ; CUMULATIVE_ARGS * cum = get_cumulative_args ( cum_v ) ; if ( cum != NULL ) { loongarch_get_arg_info ( & info , cum , arg . mode , arg . type , arg . named , false ) ; if ( info . num_fprs ) return false ;


<s> loongarch_get_arg_info ( & info , cum , arg . mode , arg . type , arg . named , false ) ; if ( info . num_fprs ) return false ;


<s> return gen_rtx_PARALLEL ( mode , gen_rtvec ( <NUM_LIT> , gen_rtx_EXPR_LIST ( VOIDmode , gen_rtx_REG ( mode1 , regno1 ) , GEN_INT ( offset1 ) ) , gen_rtx_EXPR_LIST ( VOIDmode , gen_rtx_REG ( mode2 , regno2 ) , GEN_INT ( offset2 ) ) ) ) ;


<s> x = gen_rtx_EXPR_LIST ( VOIDmode , x , GEN_INT ( offset ) ) ;

x = gen_rtx_PARALLEL ( type_mode , gen_rtvec ( <NUM_LIT> , x ) ) ;


<s> static unsigned loongarch_pass_mode_in_fpr_p ( machine_mode mode ) { if ( GET_MODE_UNIT_SIZE ( mode ) <= UNITS_PER_FP_ARG ) { if ( GET_MODE_CLASS ( mode ) == MODE_FLOAT ) return <NUM_LIT> ; if ( GET_MODE_CLASS ( mode ) == MODE_COMPLEX_FLOAT ) return <NUM_LIT> ; }


<s> static reg_class_t loongarch_preferred_reload_class ( rtx x , reg_class_t rclass ) { if ( reg_class_subset_p ( FP_REGS , rclass ) && loongarch_mode_ok_for_mov_fmt_p ( GET_MODE ( x ) ) ) return FP_REGS ; if ( reg_class_subset_p ( GR_REGS , rclass ) ) rclass = GR_REGS ;


<s> rtx loongarch_prefetch_cookie ( rtx write , rtx locality ) { if ( INTVAL ( locality ) <= <NUM_LIT> ) return GEN_INT ( INTVAL ( write ) + <NUM_LIT> ) ;

if ( INTVAL ( locality ) <= <NUM_LIT> ) return write ;


<s> case EQ : fputs ( <STR_LIT> , file ) ; break ; case NE :


<s> case LT : case LE : case GTU : case GEU : case LTU : case LEU : fputs ( GET_RTX_NAME ( code ) , file ) ; break ; default :

output_operand_lossage ( <STR_LIT> , letter ) ;


<s> case GEU : case LTU : case LEU : fputs ( GET_RTX_NAME ( code ) , file ) ; break ; default : output_operand_lossage ( <STR_LIT> , letter ) ; break ;


<s> } else output_operand_lossage ( <STR_LIT> , letter ) ; break ; case 'C' : loongarch_print_int_branch_condition ( file , code , letter ) ; break ; case 'N' : loongarch_print_int_branch_condition ( file , reverse_condition ( code ) , letter ) ; break ; case 'F' : loongarch_print_float_branch_condition ( file , code , letter ) ; break ; case 'W' : loongarch_print_float_branch_condition ( file , reverse_condition ( code ) , letter ) ; break ; case 'T' : case 't' : { int truth = ( code == NE ) == ( letter == 'T' ) ; fputc ( <STR_LIT> [ truth * <NUM_LIT> + FCC_REG_P ( REGNO ( XEXP ( op , <NUM_LIT> ) ) ) ] , file ) ; } break ; case 'Y' : if ( code == CONST_INT && UINTVAL ( op ) < ARRAY_SIZE ( loongarch_fp_conditions ) ) fputs ( loongarch_fp_conditions [ UINTVAL ( op ) ] , file ) ; else output_operand_lossage ( <STR_LIT> , letter ) ; break ; case 'Z' : loongarch_print_operand ( file , op , <NUM_LIT> ) ; fputc ( ',' , file ) ; break ; case 'A' : if ( loongarch_memmodel_needs_rel_acq_fence ( ( enum memmodel ) INTVAL ( op ) ) ) fputs ( <STR_LIT> , file ) ; break ; case 'G' : if ( loongarch_memmodel_needs_release_fence ( ( enum memmodel ) INTVAL ( op ) ) ) fputs ( <STR_LIT> , file ) ; break ; case 'i' :

if ( code != REG ) fputs ( <STR_LIT> , file ) ;