mirror of
git://gcc.gnu.org/git/gcc.git
synced 2025-01-13 06:24:30 +08:00
sh.c (unspec_caller_rtx_p): New.
* config/sh/sh.c (unspec_caller_rtx_p): New. (sh_cannot_copy_insn_p): New. (TARGET_CANNOT_COPY_INSN_P): New. From-SVN: r63084
This commit is contained in:
parent
d7ddbe241a
commit
9f3a9a0809
@ -1,3 +1,9 @@
|
|||||||
|
2003-02-18 Kaz Kojima <kkojima@gcc.gnu.org>
|
||||||
|
|
||||||
|
* config/sh/sh.c (unspec_caller_rtx_p): New.
|
||||||
|
(sh_cannot_copy_insn_p): New.
|
||||||
|
(TARGET_CANNOT_COPY_INSN_P): New.
|
||||||
|
|
||||||
2003-02-18 Richard Henderson <rth@redhat.com>
|
2003-02-18 Richard Henderson <rth@redhat.com>
|
||||||
|
|
||||||
* c-common.c (handle_used_attribute): Accept static data too.
|
* c-common.c (handle_used_attribute): Accept static data too.
|
||||||
|
@ -218,6 +218,8 @@ static int shiftcosts PARAMS ((rtx));
|
|||||||
static int andcosts PARAMS ((rtx));
|
static int andcosts PARAMS ((rtx));
|
||||||
static int addsubcosts PARAMS ((rtx));
|
static int addsubcosts PARAMS ((rtx));
|
||||||
static int multcosts PARAMS ((rtx));
|
static int multcosts PARAMS ((rtx));
|
||||||
|
static bool unspec_caller_rtx_p PARAMS ((rtx));
|
||||||
|
static bool sh_cannot_copy_insn_p PARAMS ((rtx));
|
||||||
static bool sh_rtx_costs PARAMS ((rtx, int, int, int *));
|
static bool sh_rtx_costs PARAMS ((rtx, int, int, int *));
|
||||||
static int sh_address_cost PARAMS ((rtx));
|
static int sh_address_cost PARAMS ((rtx));
|
||||||
|
|
||||||
@ -271,6 +273,8 @@ static int sh_address_cost PARAMS ((rtx));
|
|||||||
#undef TARGET_FUNCTION_OK_FOR_SIBCALL
|
#undef TARGET_FUNCTION_OK_FOR_SIBCALL
|
||||||
#define TARGET_FUNCTION_OK_FOR_SIBCALL sh_function_ok_for_sibcall
|
#define TARGET_FUNCTION_OK_FOR_SIBCALL sh_function_ok_for_sibcall
|
||||||
|
|
||||||
|
#undef TARGET_CANNOT_COPY_INSN_P
|
||||||
|
#define TARGET_CANNOT_COPY_INSN_P sh_cannot_copy_insn_p
|
||||||
#undef TARGET_RTX_COSTS
|
#undef TARGET_RTX_COSTS
|
||||||
#define TARGET_RTX_COSTS sh_rtx_costs
|
#define TARGET_RTX_COSTS sh_rtx_costs
|
||||||
#undef TARGET_ADDRESS_COST
|
#undef TARGET_ADDRESS_COST
|
||||||
@ -1215,6 +1219,59 @@ output_file_start (file)
|
|||||||
TARGET_SHMEDIA64 ? 64 : 32);
|
TARGET_SHMEDIA64 ? 64 : 32);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Check if PAT includes UNSPEC_CALLER unspec pattern. */
|
||||||
|
|
||||||
|
static bool
|
||||||
|
unspec_caller_rtx_p (pat)
|
||||||
|
rtx pat;
|
||||||
|
{
|
||||||
|
switch (GET_CODE (pat))
|
||||||
|
{
|
||||||
|
case CONST:
|
||||||
|
return unspec_caller_rtx_p (XEXP (pat, 0));
|
||||||
|
case PLUS:
|
||||||
|
case MINUS:
|
||||||
|
if (unspec_caller_rtx_p (XEXP (pat, 0)))
|
||||||
|
return true;
|
||||||
|
return unspec_caller_rtx_p (XEXP (pat, 1));
|
||||||
|
case UNSPEC:
|
||||||
|
if (XINT (pat, 1) == UNSPEC_CALLER)
|
||||||
|
return true;
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Indicate that INSN cannot be duplicated. This is true for insn
|
||||||
|
that generates an unique label. */
|
||||||
|
|
||||||
|
static bool
|
||||||
|
sh_cannot_copy_insn_p (insn)
|
||||||
|
rtx insn;
|
||||||
|
{
|
||||||
|
rtx pat;
|
||||||
|
|
||||||
|
if (!reload_completed || !flag_pic)
|
||||||
|
return false;
|
||||||
|
|
||||||
|
if (GET_CODE (insn) != INSN)
|
||||||
|
return false;
|
||||||
|
if (asm_noperands (insn) >= 0)
|
||||||
|
return false;
|
||||||
|
|
||||||
|
pat = PATTERN (insn);
|
||||||
|
if (GET_CODE (pat) != SET)
|
||||||
|
return false;
|
||||||
|
pat = SET_SRC (pat);
|
||||||
|
|
||||||
|
if (unspec_caller_rtx_p (pat))
|
||||||
|
return true;
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
/* Actual number of instructions used to make a shift by N. */
|
/* Actual number of instructions used to make a shift by N. */
|
||||||
static const char ashiftrt_insns[] =
|
static const char ashiftrt_insns[] =
|
||||||
{ 0,1,2,3,4,5,8,8,8,8,8,8,8,8,8,8,2,3,4,5,8,8,8,8,8,8,8,8,8,8,8,2};
|
{ 0,1,2,3,4,5,8,8,8,8,8,8,8,8,8,8,2,3,4,5,8,8,8,8,8,8,8,8,8,8,8,2};
|
||||||
|
Loading…
Reference in New Issue
Block a user