Mercurial > hg > CbC > CbC_gcc
comparison gcc/config/frv/frv.c @ 145:1830386684a0
gcc-9.2.0
author | anatofuz |
---|---|
date | Thu, 13 Feb 2020 11:34:05 +0900 |
parents | 84e7813d76e9 |
children |
comparison
equal
deleted
inserted
replaced
131:84e7813d76e9 | 145:1830386684a0 |
---|---|
1 /* Copyright (C) 1997-2018 Free Software Foundation, Inc. | 1 /* Copyright (C) 1997-2020 Free Software Foundation, Inc. |
2 Contributed by Red Hat, Inc. | 2 Contributed by Red Hat, Inc. |
3 | 3 |
4 This file is part of GCC. | 4 This file is part of GCC. |
5 | 5 |
6 GCC is free software; you can redistribute it and/or modify | 6 GCC is free software; you can redistribute it and/or modify |
47 #include "langhooks.h" | 47 #include "langhooks.h" |
48 #include "dumpfile.h" | 48 #include "dumpfile.h" |
49 #include "builtins.h" | 49 #include "builtins.h" |
50 #include "ifcvt.h" | 50 #include "ifcvt.h" |
51 #include "rtl-iter.h" | 51 #include "rtl-iter.h" |
52 #include "calls.h" | |
52 | 53 |
53 /* This file should be included last. */ | 54 /* This file should be included last. */ |
54 #include "target-def.h" | 55 #include "target-def.h" |
55 | 56 |
56 #ifndef FRV_INLINE | 57 #ifndef FRV_INLINE |
356 static void frv_init_libfuncs (void); | 357 static void frv_init_libfuncs (void); |
357 static bool frv_in_small_data_p (const_tree); | 358 static bool frv_in_small_data_p (const_tree); |
358 static void frv_asm_output_mi_thunk | 359 static void frv_asm_output_mi_thunk |
359 (FILE *, tree, HOST_WIDE_INT, HOST_WIDE_INT, tree); | 360 (FILE *, tree, HOST_WIDE_INT, HOST_WIDE_INT, tree); |
360 static void frv_setup_incoming_varargs (cumulative_args_t, | 361 static void frv_setup_incoming_varargs (cumulative_args_t, |
361 machine_mode, | 362 const function_arg_info &, |
362 tree, int *, int); | 363 int *, int); |
363 static rtx frv_expand_builtin_saveregs (void); | 364 static rtx frv_expand_builtin_saveregs (void); |
364 static void frv_expand_builtin_va_start (tree, rtx); | 365 static void frv_expand_builtin_va_start (tree, rtx); |
365 static bool frv_rtx_costs (rtx, machine_mode, int, int, | 366 static bool frv_rtx_costs (rtx, machine_mode, int, int, |
366 int*, bool); | 367 int*, bool); |
367 static int frv_register_move_cost (machine_mode, | 368 static int frv_register_move_cost (machine_mode, |
376 static const char *unspec_got_name (int); | 377 static const char *unspec_got_name (int); |
377 static void frv_output_const_unspec (FILE *, | 378 static void frv_output_const_unspec (FILE *, |
378 const struct frv_unspec *); | 379 const struct frv_unspec *); |
379 static bool frv_function_ok_for_sibcall (tree, tree); | 380 static bool frv_function_ok_for_sibcall (tree, tree); |
380 static rtx frv_struct_value_rtx (tree, int); | 381 static rtx frv_struct_value_rtx (tree, int); |
381 static bool frv_must_pass_in_stack (machine_mode mode, const_tree type); | 382 static bool frv_must_pass_in_stack (const function_arg_info &); |
382 static int frv_arg_partial_bytes (cumulative_args_t, machine_mode, | 383 static int frv_arg_partial_bytes (cumulative_args_t, |
383 tree, bool); | 384 const function_arg_info &); |
384 static rtx frv_function_arg (cumulative_args_t, machine_mode, | 385 static rtx frv_function_arg (cumulative_args_t, const function_arg_info &); |
385 const_tree, bool); | 386 static rtx frv_function_incoming_arg (cumulative_args_t, |
386 static rtx frv_function_incoming_arg (cumulative_args_t, machine_mode, | 387 const function_arg_info &); |
387 const_tree, bool); | 388 static void frv_function_arg_advance (cumulative_args_t, |
388 static void frv_function_arg_advance (cumulative_args_t, machine_mode, | 389 const function_arg_info &); |
389 const_tree, bool); | |
390 static unsigned int frv_function_arg_boundary (machine_mode, | 390 static unsigned int frv_function_arg_boundary (machine_mode, |
391 const_tree); | 391 const_tree); |
392 static void frv_output_dwarf_dtprel (FILE *, int, rtx) | 392 static void frv_output_dwarf_dtprel (FILE *, int, rtx) |
393 ATTRIBUTE_UNUSED; | 393 ATTRIBUTE_UNUSED; |
394 static reg_class_t frv_secondary_reload (bool, rtx, reg_class_t, | 394 static reg_class_t frv_secondary_reload (bool, rtx, reg_class_t, |
1099 switch (range) | 1099 switch (range) |
1100 { | 1100 { |
1101 default: | 1101 default: |
1102 for (regno = first; regno <= last; regno++) | 1102 for (regno = first; regno <= last; regno++) |
1103 { | 1103 { |
1104 if ((df_regs_ever_live_p (regno) && !call_used_regs[regno]) | 1104 if ((df_regs_ever_live_p (regno) |
1105 && !call_used_or_fixed_reg_p (regno)) | |
1105 || (crtl->calls_eh_return | 1106 || (crtl->calls_eh_return |
1106 && (regno >= FIRST_EH_REGNUM && regno <= LAST_EH_REGNUM)) | 1107 && (regno >= FIRST_EH_REGNUM && regno <= LAST_EH_REGNUM)) |
1107 || (!TARGET_FDPIC && flag_pic | 1108 || (!TARGET_FDPIC && flag_pic |
1108 && crtl->uses_pic_offset_table && regno == PIC_REGNO)) | 1109 && crtl->uses_pic_offset_table && regno == PIC_REGNO)) |
1109 { | 1110 { |
1936 tree thunk_fndecl ATTRIBUTE_UNUSED, | 1937 tree thunk_fndecl ATTRIBUTE_UNUSED, |
1937 HOST_WIDE_INT delta, | 1938 HOST_WIDE_INT delta, |
1938 HOST_WIDE_INT vcall_offset ATTRIBUTE_UNUSED, | 1939 HOST_WIDE_INT vcall_offset ATTRIBUTE_UNUSED, |
1939 tree function) | 1940 tree function) |
1940 { | 1941 { |
1942 const char *fnname = IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (thunk_fndecl)); | |
1941 const char *name_func = XSTR (XEXP (DECL_RTL (function), 0), 0); | 1943 const char *name_func = XSTR (XEXP (DECL_RTL (function), 0), 0); |
1942 const char *name_arg0 = reg_names[FIRST_ARG_REGNUM]; | 1944 const char *name_arg0 = reg_names[FIRST_ARG_REGNUM]; |
1943 const char *name_jmp = reg_names[JUMP_REGNO]; | 1945 const char *name_jmp = reg_names[JUMP_REGNO]; |
1944 const char *parallel = (frv_issue_rate () > 1 ? ".p" : ""); | 1946 const char *parallel = (frv_issue_rate () > 1 ? ".p" : ""); |
1947 | |
1948 assemble_start_function (thunk_fndecl, fnname); | |
1945 | 1949 |
1946 /* Do the add using an addi if possible. */ | 1950 /* Do the add using an addi if possible. */ |
1947 if (IN_RANGE (delta, -2048, 2047)) | 1951 if (IN_RANGE (delta, -2048, 2047)) |
1948 fprintf (file, "\taddi %s,#%d,%s\n", name_arg0, (int) delta, name_arg0); | 1952 fprintf (file, "\taddi %s,#%d,%s\n", name_arg0, (int) delta, name_arg0); |
1949 else | 1953 else |
2016 fprintf (file, "\tadd %s,%s,%s\n", name_gppic, name_tmp, name_jmp); | 2020 fprintf (file, "\tadd %s,%s,%s\n", name_gppic, name_tmp, name_jmp); |
2017 } | 2021 } |
2018 | 2022 |
2019 /* Jump to the function address. */ | 2023 /* Jump to the function address. */ |
2020 fprintf (file, "\tjmpl @(%s,%s)\n", name_jmp, reg_names[GPR_FIRST+0]); | 2024 fprintf (file, "\tjmpl @(%s,%s)\n", name_jmp, reg_names[GPR_FIRST+0]); |
2025 assemble_end_function (thunk_fndecl, fnname); | |
2021 } | 2026 } |
2022 | 2027 |
2023 | 2028 |
2024 | 2029 |
2025 /* On frv, create a frame whenever we need to create stack. */ | 2030 /* On frv, create a frame whenever we need to create stack. */ |
2102 | 2107 |
2103 /* Worker function for TARGET_SETUP_INCOMING_VARARGS. */ | 2108 /* Worker function for TARGET_SETUP_INCOMING_VARARGS. */ |
2104 | 2109 |
2105 static void | 2110 static void |
2106 frv_setup_incoming_varargs (cumulative_args_t cum_v, | 2111 frv_setup_incoming_varargs (cumulative_args_t cum_v, |
2107 machine_mode mode, | 2112 const function_arg_info &arg, |
2108 tree type ATTRIBUTE_UNUSED, | 2113 int *pretend_size, |
2109 int *pretend_size, | 2114 int second_time) |
2110 int second_time) | |
2111 { | 2115 { |
2112 CUMULATIVE_ARGS *cum = get_cumulative_args (cum_v); | 2116 CUMULATIVE_ARGS *cum = get_cumulative_args (cum_v); |
2113 | 2117 |
2114 if (TARGET_DEBUG_ARG) | 2118 if (TARGET_DEBUG_ARG) |
2115 fprintf (stderr, | 2119 fprintf (stderr, |
2116 "setup_vararg: words = %2d, mode = %4s, pretend_size = %d, second_time = %d\n", | 2120 "setup_vararg: words = %2d, mode = %4s, pretend_size = %d, second_time = %d\n", |
2117 *cum, GET_MODE_NAME (mode), *pretend_size, second_time); | 2121 *cum, GET_MODE_NAME (arg.mode), *pretend_size, second_time); |
2118 } | 2122 } |
2119 | 2123 |
2120 | 2124 |
2121 /* Worker function for TARGET_EXPAND_BUILTIN_SAVEREGS. */ | 2125 /* Worker function for TARGET_EXPAND_BUILTIN_SAVEREGS. */ |
2122 | 2126 |
3072 | 3076 |
3073 /* Return true if we should pass an argument on the stack rather than | 3077 /* Return true if we should pass an argument on the stack rather than |
3074 in registers. */ | 3078 in registers. */ |
3075 | 3079 |
3076 static bool | 3080 static bool |
3077 frv_must_pass_in_stack (machine_mode mode, const_tree type) | 3081 frv_must_pass_in_stack (const function_arg_info &arg) |
3078 { | 3082 { |
3079 if (mode == BLKmode) | 3083 return arg.mode == BLKmode || arg.aggregate_type_p (); |
3080 return true; | |
3081 if (type == NULL) | |
3082 return false; | |
3083 return AGGREGATE_TYPE_P (type); | |
3084 } | 3084 } |
3085 | 3085 |
3086 /* If defined, a C expression that gives the alignment boundary, in bits, of an | 3086 /* If defined, a C expression that gives the alignment boundary, in bits, of an |
3087 argument with the specified mode and type. If it is not defined, | 3087 argument with the specified mode and type. If it is not defined, |
3088 `PARM_BOUNDARY' is used for all arguments. */ | 3088 `PARM_BOUNDARY' is used for all arguments. */ |
3093 { | 3093 { |
3094 return BITS_PER_WORD; | 3094 return BITS_PER_WORD; |
3095 } | 3095 } |
3096 | 3096 |
3097 static rtx | 3097 static rtx |
3098 frv_function_arg_1 (cumulative_args_t cum_v, machine_mode mode, | 3098 frv_function_arg_1 (cumulative_args_t cum_v, const function_arg_info &arg, |
3099 const_tree type ATTRIBUTE_UNUSED, bool named, | |
3100 bool incoming ATTRIBUTE_UNUSED) | 3099 bool incoming ATTRIBUTE_UNUSED) |
3101 { | 3100 { |
3102 const CUMULATIVE_ARGS *cum = get_cumulative_args (cum_v); | 3101 const CUMULATIVE_ARGS *cum = get_cumulative_args (cum_v); |
3103 | 3102 |
3104 machine_mode xmode = (mode == BLKmode) ? SImode : mode; | 3103 machine_mode xmode = (arg.mode == BLKmode) ? SImode : arg.mode; |
3105 int arg_num = *cum; | 3104 int arg_num = *cum; |
3106 rtx ret; | 3105 rtx ret; |
3107 const char *debstr; | 3106 const char *debstr; |
3108 | 3107 |
3109 /* Return a marker for use in the call instruction. */ | 3108 /* Return a marker for use in the call instruction. */ |
3126 } | 3125 } |
3127 | 3126 |
3128 if (TARGET_DEBUG_ARG) | 3127 if (TARGET_DEBUG_ARG) |
3129 fprintf (stderr, | 3128 fprintf (stderr, |
3130 "function_arg: words = %2d, mode = %4s, named = %d, size = %3d, arg = %s\n", | 3129 "function_arg: words = %2d, mode = %4s, named = %d, size = %3d, arg = %s\n", |
3131 arg_num, GET_MODE_NAME (mode), named, GET_MODE_SIZE (mode), debstr); | 3130 arg_num, GET_MODE_NAME (arg.mode), arg.named, |
3131 GET_MODE_SIZE (arg.mode), debstr); | |
3132 | 3132 |
3133 return ret; | 3133 return ret; |
3134 } | 3134 } |
3135 | 3135 |
3136 static rtx | 3136 static rtx |
3137 frv_function_arg (cumulative_args_t cum, machine_mode mode, | 3137 frv_function_arg (cumulative_args_t cum, const function_arg_info &arg) |
3138 const_tree type, bool named) | 3138 { |
3139 { | 3139 return frv_function_arg_1 (cum, arg, false); |
3140 return frv_function_arg_1 (cum, mode, type, named, false); | |
3141 } | 3140 } |
3142 | 3141 |
3143 static rtx | 3142 static rtx |
3144 frv_function_incoming_arg (cumulative_args_t cum, machine_mode mode, | 3143 frv_function_incoming_arg (cumulative_args_t cum, const function_arg_info &arg) |
3145 const_tree type, bool named) | 3144 { |
3146 { | 3145 return frv_function_arg_1 (cum, arg, true); |
3147 return frv_function_arg_1 (cum, mode, type, named, true); | |
3148 } | 3146 } |
3149 | 3147 |
3150 | 3148 |
3151 /* A C statement (sans semicolon) to update the summarizer variable CUM to | 3149 /* Implement TARGET_FUNCTION_ARG_ADVANCE. */ |
3152 advance past an argument in the argument list. The values MODE, TYPE and | |
3153 NAMED describe that argument. Once this is done, the variable CUM is | |
3154 suitable for analyzing the *following* argument with `FUNCTION_ARG', etc. | |
3155 | |
3156 This macro need not do anything if the argument in question was passed on | |
3157 the stack. The compiler knows how to track the amount of stack space used | |
3158 for arguments without any special help. */ | |
3159 | 3150 |
3160 static void | 3151 static void |
3161 frv_function_arg_advance (cumulative_args_t cum_v, | 3152 frv_function_arg_advance (cumulative_args_t cum_v, |
3162 machine_mode mode, | 3153 const function_arg_info &arg) |
3163 const_tree type ATTRIBUTE_UNUSED, | |
3164 bool named) | |
3165 { | 3154 { |
3166 CUMULATIVE_ARGS *cum = get_cumulative_args (cum_v); | 3155 CUMULATIVE_ARGS *cum = get_cumulative_args (cum_v); |
3167 | 3156 |
3168 machine_mode xmode = (mode == BLKmode) ? SImode : mode; | 3157 machine_mode xmode = (arg.mode == BLKmode) ? SImode : arg.mode; |
3169 int bytes = GET_MODE_SIZE (xmode); | 3158 int bytes = GET_MODE_SIZE (xmode); |
3170 int words = (bytes + UNITS_PER_WORD - 1) / UNITS_PER_WORD; | 3159 int words = (bytes + UNITS_PER_WORD - 1) / UNITS_PER_WORD; |
3171 int arg_num = *cum; | 3160 int arg_num = *cum; |
3172 | 3161 |
3173 *cum = arg_num + words; | 3162 *cum = arg_num + words; |
3174 | 3163 |
3175 if (TARGET_DEBUG_ARG) | 3164 if (TARGET_DEBUG_ARG) |
3176 fprintf (stderr, | 3165 fprintf (stderr, |
3177 "function_adv: words = %2d, mode = %4s, named = %d, size = %3d\n", | 3166 "function_adv: words = %2d, mode = %4s, named = %d, size = %3d\n", |
3178 arg_num, GET_MODE_NAME (mode), named, words * UNITS_PER_WORD); | 3167 arg_num, GET_MODE_NAME (arg.mode), arg.named, |
3168 words * UNITS_PER_WORD); | |
3179 } | 3169 } |
3180 | 3170 |
3181 | 3171 |
3182 /* A C expression for the number of words, at the beginning of an argument, | 3172 /* Implement TARGET_ARG_PARTIAL_BYTES. */ |
3183 must be put in registers. The value must be zero for arguments that are | |
3184 passed entirely in registers or that are entirely pushed on the stack. | |
3185 | |
3186 On some machines, certain arguments must be passed partially in registers | |
3187 and partially in memory. On these machines, typically the first N words of | |
3188 arguments are passed in registers, and the rest on the stack. If a | |
3189 multi-word argument (a `double' or a structure) crosses that boundary, its | |
3190 first few words must be passed in registers and the rest must be pushed. | |
3191 This macro tells the compiler when this occurs, and how many of the words | |
3192 should go in registers. | |
3193 | |
3194 `FUNCTION_ARG' for these arguments should return the first register to be | |
3195 used by the caller for this argument; likewise `FUNCTION_INCOMING_ARG', for | |
3196 the called function. */ | |
3197 | 3173 |
3198 static int | 3174 static int |
3199 frv_arg_partial_bytes (cumulative_args_t cum, machine_mode mode, | 3175 frv_arg_partial_bytes (cumulative_args_t cum, const function_arg_info &arg) |
3200 tree type ATTRIBUTE_UNUSED, bool named ATTRIBUTE_UNUSED) | 3176 { |
3201 { | 3177 machine_mode xmode = (arg.mode == BLKmode) ? SImode : arg.mode; |
3202 | |
3203 machine_mode xmode = (mode == BLKmode) ? SImode : mode; | |
3204 int bytes = GET_MODE_SIZE (xmode); | 3178 int bytes = GET_MODE_SIZE (xmode); |
3205 int words = (bytes + UNITS_PER_WORD - 1) / UNITS_PER_WORD; | 3179 int words = (bytes + UNITS_PER_WORD - 1) / UNITS_PER_WORD; |
3206 int arg_num = *get_cumulative_args (cum); | 3180 int arg_num = *get_cumulative_args (cum); |
3207 int ret; | 3181 int ret; |
3208 | 3182 |
5226 /* Figure out which registers we can allocate for our own purposes. Only | 5200 /* Figure out which registers we can allocate for our own purposes. Only |
5227 consider registers that are not preserved across function calls and are | 5201 consider registers that are not preserved across function calls and are |
5228 not fixed. However, allow the ICC/ICR temporary registers to be allocated | 5202 not fixed. However, allow the ICC/ICR temporary registers to be allocated |
5229 if we did not need to use them in reloading other registers. */ | 5203 if we did not need to use them in reloading other registers. */ |
5230 memset (&tmp_reg->regs, 0, sizeof (tmp_reg->regs)); | 5204 memset (&tmp_reg->regs, 0, sizeof (tmp_reg->regs)); |
5231 COPY_HARD_REG_SET (tmp_reg->regs, call_used_reg_set); | 5205 tmp_reg->regs = regs_invalidated_by_call & ~fixed_reg_set; |
5232 AND_COMPL_HARD_REG_SET (tmp_reg->regs, fixed_reg_set); | |
5233 SET_HARD_REG_BIT (tmp_reg->regs, ICC_TEMP); | 5206 SET_HARD_REG_BIT (tmp_reg->regs, ICC_TEMP); |
5234 SET_HARD_REG_BIT (tmp_reg->regs, ICR_TEMP); | 5207 SET_HARD_REG_BIT (tmp_reg->regs, ICR_TEMP); |
5235 | 5208 |
5236 /* If this is a nested IF, we need to discover whether the CC registers that | 5209 /* If this is a nested IF, we need to discover whether the CC registers that |
5237 are set/used inside of the block are used anywhere else. If not, we can | 5210 are set/used inside of the block are used anywhere else. If not, we can |
5336 int skip_nested_if = FALSE; | 5309 int skip_nested_if = FALSE; |
5337 HARD_REG_SET mentioned_regs; | 5310 HARD_REG_SET mentioned_regs; |
5338 | 5311 |
5339 CLEAR_HARD_REG_SET (mentioned_regs); | 5312 CLEAR_HARD_REG_SET (mentioned_regs); |
5340 find_all_hard_regs (PATTERN (insn), &mentioned_regs); | 5313 find_all_hard_regs (PATTERN (insn), &mentioned_regs); |
5341 AND_COMPL_HARD_REG_SET (tmp_reg->regs, mentioned_regs); | 5314 tmp_reg->regs &= ~mentioned_regs; |
5342 | 5315 |
5343 pattern = PATTERN (insn); | 5316 pattern = PATTERN (insn); |
5344 if (GET_CODE (pattern) == COND_EXEC) | 5317 if (GET_CODE (pattern) == COND_EXEC) |
5345 { | 5318 { |
5346 rtx reg = XEXP (COND_EXEC_TEST (pattern), 0); | 5319 rtx reg = XEXP (COND_EXEC_TEST (pattern), 0); |
5372 skip_nested_if = TRUE; | 5345 skip_nested_if = TRUE; |
5373 } | 5346 } |
5374 } | 5347 } |
5375 | 5348 |
5376 if (! skip_nested_if) | 5349 if (! skip_nested_if) |
5377 AND_COMPL_HARD_REG_SET (frv_ifcvt.nested_cc_ok_rewrite, | 5350 frv_ifcvt.nested_cc_ok_rewrite &= ~mentioned_regs; |
5378 mentioned_regs); | |
5379 } | 5351 } |
5380 | 5352 |
5381 if (insn == last_insn) | 5353 if (insn == last_insn) |
5382 break; | 5354 break; |
5383 | 5355 |
6712 case GR9_REGS: | 6684 case GR9_REGS: |
6713 case GR89_REGS: | 6685 case GR89_REGS: |
6714 case FDPIC_REGS: | 6686 case FDPIC_REGS: |
6715 case FDPIC_FPTR_REGS: | 6687 case FDPIC_FPTR_REGS: |
6716 case FDPIC_CALL_REGS: | 6688 case FDPIC_CALL_REGS: |
6717 | |
6718 switch (to) | 6689 switch (to) |
6719 { | 6690 { |
6720 default: | 6691 default: |
6721 break; | 6692 break; |
6722 | 6693 |
6726 case GR9_REGS: | 6697 case GR9_REGS: |
6727 case GR89_REGS: | 6698 case GR89_REGS: |
6728 case FDPIC_REGS: | 6699 case FDPIC_REGS: |
6729 case FDPIC_FPTR_REGS: | 6700 case FDPIC_FPTR_REGS: |
6730 case FDPIC_CALL_REGS: | 6701 case FDPIC_CALL_REGS: |
6731 | |
6732 return LOW_COST; | 6702 return LOW_COST; |
6733 | 6703 |
6734 case FPR_REGS: | 6704 case FPR_REGS: |
6735 return LOW_COST; | 6705 return LOW_COST; |
6736 | 6706 |
6737 case LCR_REG: | 6707 case LCR_REG: |
6738 case LR_REG: | 6708 case LR_REG: |
6739 case SPR_REGS: | 6709 case SPR_REGS: |
6740 return LOW_COST; | 6710 return LOW_COST; |
6741 } | 6711 } |
6712 break; | |
6742 | 6713 |
6743 case QUAD_FPR_REGS: | 6714 case QUAD_FPR_REGS: |
6744 switch (to) | 6715 switch (to) |
6745 { | 6716 { |
6746 default: | 6717 default: |
6760 return MEDIUM_COST; | 6731 return MEDIUM_COST; |
6761 | 6732 |
6762 case QUAD_FPR_REGS: | 6733 case QUAD_FPR_REGS: |
6763 return LOW_COST; | 6734 return LOW_COST; |
6764 } | 6735 } |
6736 break; | |
6765 | 6737 |
6766 case LCR_REG: | 6738 case LCR_REG: |
6767 case LR_REG: | 6739 case LR_REG: |
6768 case SPR_REGS: | 6740 case SPR_REGS: |
6769 switch (to) | 6741 switch (to) |
6777 case GR9_REGS: | 6749 case GR9_REGS: |
6778 case GR89_REGS: | 6750 case GR89_REGS: |
6779 case FDPIC_REGS: | 6751 case FDPIC_REGS: |
6780 case FDPIC_FPTR_REGS: | 6752 case FDPIC_FPTR_REGS: |
6781 case FDPIC_CALL_REGS: | 6753 case FDPIC_CALL_REGS: |
6782 | |
6783 return MEDIUM_COST; | 6754 return MEDIUM_COST; |
6784 } | 6755 } |
6756 break; | |
6785 | 6757 |
6786 case QUAD_ACC_REGS: | 6758 case QUAD_ACC_REGS: |
6787 case ACCG_REGS: | 6759 case ACCG_REGS: |
6788 switch (to) | 6760 switch (to) |
6789 { | 6761 { |
6790 default: | 6762 default: |
6791 break; | 6763 break; |
6792 | 6764 |
6793 case QUAD_FPR_REGS: | 6765 case QUAD_FPR_REGS: |
6794 return MEDIUM_COST; | 6766 return MEDIUM_COST; |
6795 | 6767 } |
6796 } | 6768 break; |
6797 } | 6769 } |
6798 | 6770 |
6799 return HIGH_COST; | 6771 return HIGH_COST; |
6800 } | 6772 } |
6801 | 6773 |
7161 if (GET_CODE (x) == COND_EXEC) | 7133 if (GET_CODE (x) == COND_EXEC) |
7162 { | 7134 { |
7163 flags |= frv_cond_flags (XEXP (x, 0)); | 7135 flags |= frv_cond_flags (XEXP (x, 0)); |
7164 x = XEXP (x, 1); | 7136 x = XEXP (x, 1); |
7165 } | 7137 } |
7166 note_stores (x, frv_registers_update_1, &flags); | 7138 note_pattern_stores (x, frv_registers_update_1, &flags); |
7167 } | 7139 } |
7168 | 7140 |
7169 | 7141 |
7170 /* Initialize frv_packet for the start of a new packet. */ | 7142 /* Initialize frv_packet for the start of a new packet. */ |
7171 | 7143 |
7795 | 7767 |
7796 default: | 7768 default: |
7797 /* Invalidate NEXT_IO's address if it depends on something that | 7769 /* Invalidate NEXT_IO's address if it depends on something that |
7798 is clobbered by INSN. */ | 7770 is clobbered by INSN. */ |
7799 if (next_io->var_address) | 7771 if (next_io->var_address) |
7800 note_stores (PATTERN (insn), frv_io_check_address, | 7772 note_stores (insn, frv_io_check_address, &next_io->var_address); |
7801 &next_io->var_address); | |
7802 | 7773 |
7803 /* If the next membar is associated with a __builtin_read, | 7774 /* If the next membar is associated with a __builtin_read, |
7804 see if INSN reads from that address. If it does, and if | 7775 see if INSN reads from that address. If it does, and if |
7805 the destination register is used before the next I/O access, | 7776 the destination register is used before the next I/O access, |
7806 there is no need for the membar. */ | 7777 there is no need for the membar. */ |
7839 that are used after it. Otherwise forget about uses that | 7810 that are used after it. Otherwise forget about uses that |
7840 are (or might be) defined by INSN. */ | 7811 are (or might be) defined by INSN. */ |
7841 if (volatile_refs_p (PATTERN (insn))) | 7812 if (volatile_refs_p (PATTERN (insn))) |
7842 CLEAR_HARD_REG_SET (used_regs); | 7813 CLEAR_HARD_REG_SET (used_regs); |
7843 else | 7814 else |
7844 note_stores (PATTERN (insn), frv_io_handle_set, &used_regs); | 7815 note_stores (insn, frv_io_handle_set, &used_regs); |
7845 | 7816 |
7846 note_uses (&PATTERN (insn), frv_io_handle_use, &used_regs); | 7817 note_uses (&PATTERN (insn), frv_io_handle_use, &used_regs); |
7847 break; | 7818 break; |
7848 } | 7819 } |
7849 } | 7820 } |
9107 rtx subtarget ATTRIBUTE_UNUSED, | 9078 rtx subtarget ATTRIBUTE_UNUSED, |
9108 machine_mode mode ATTRIBUTE_UNUSED, | 9079 machine_mode mode ATTRIBUTE_UNUSED, |
9109 int ignore ATTRIBUTE_UNUSED) | 9080 int ignore ATTRIBUTE_UNUSED) |
9110 { | 9081 { |
9111 tree fndecl = TREE_OPERAND (CALL_EXPR_FN (exp), 0); | 9082 tree fndecl = TREE_OPERAND (CALL_EXPR_FN (exp), 0); |
9112 unsigned fcode = (unsigned)DECL_FUNCTION_CODE (fndecl); | 9083 unsigned fcode = DECL_MD_FUNCTION_CODE (fndecl); |
9113 unsigned i; | 9084 unsigned i; |
9114 struct builtin_description *d; | 9085 struct builtin_description *d; |
9115 | 9086 |
9116 if (fcode < FRV_BUILTIN_FIRST_NONMEDIA && !TARGET_MEDIA) | 9087 if (fcode < FRV_BUILTIN_FIRST_NONMEDIA && !TARGET_MEDIA) |
9117 { | 9088 { |
9118 error ("media functions are not available unless -mmedia is used"); | 9089 error ("media functions are not available unless %<-mmedia%> is used"); |
9119 return NULL_RTX; | 9090 return NULL_RTX; |
9120 } | 9091 } |
9121 | 9092 |
9122 switch (fcode) | 9093 switch (fcode) |
9123 { | 9094 { |