v850.c (print_operand): Use SYMBOL_REF_[ZST]DA.
* config/v850/v850.c (print_operand): Use SYMBOL_REF_[ZST]DA. (print_operand_address): Likewise. (ep_memory_operand): Likewise. (special_symbolref_operand): Likewise. (v850_encode_data_area): Use SYMBOL_REF_FLAGS. (v850_encode_section_info): Call default_encode_section_info. (v850_strip_name_encoding): Remove. * config/v850/v850.h (EXTRA_CONSTRAINT): Use SYMBOL_REF_[ZST]DA. (ASM_OUTPUT_LABELREF): Remove. (ZDA_NAME_FLAG_CHAR, ZDA_NAME_P): Remove. (SDA_NAME_FLAG_CHAR, SDA_NAME_P): Remove. (TDA_NAME_FLAG_CHAR, TDA_NAME_P): Remove. (ENCODED_NAME_P): Remove. (SYMBOL_FLAG_ZDA, SYMBOL_REF_ZDA_P): New. (SYMBOL_FLAG_SDA, SYMBOL_REF_SDA_P): New. (SYMBOL_FLAG_TDA, SYMBOL_REF_TDA_P): New. From-SVN: r65738
This commit is contained in:
parent
e7d687bba6
commit
50d1ff6afc
@ -1,3 +1,22 @@
|
||||
2003-04-17 Richard Henderson <rth@redhat.com>
|
||||
|
||||
* config/v850/v850.c (print_operand): Use SYMBOL_REF_[ZST]DA.
|
||||
(print_operand_address): Likewise.
|
||||
(ep_memory_operand): Likewise.
|
||||
(special_symbolref_operand): Likewise.
|
||||
(v850_encode_data_area): Use SYMBOL_REF_FLAGS.
|
||||
(v850_encode_section_info): Call default_encode_section_info.
|
||||
(v850_strip_name_encoding): Remove.
|
||||
* config/v850/v850.h (EXTRA_CONSTRAINT): Use SYMBOL_REF_[ZST]DA.
|
||||
(ASM_OUTPUT_LABELREF): Remove.
|
||||
(ZDA_NAME_FLAG_CHAR, ZDA_NAME_P): Remove.
|
||||
(SDA_NAME_FLAG_CHAR, SDA_NAME_P): Remove.
|
||||
(TDA_NAME_FLAG_CHAR, TDA_NAME_P): Remove.
|
||||
(ENCODED_NAME_P): Remove.
|
||||
(SYMBOL_FLAG_ZDA, SYMBOL_REF_ZDA_P): New.
|
||||
(SYMBOL_FLAG_SDA, SYMBOL_REF_SDA_P): New.
|
||||
(SYMBOL_FLAG_TDA, SYMBOL_REF_TDA_P): New.
|
||||
|
||||
2003-04-17 Richard Henderson <rth@redhat.com>
|
||||
|
||||
* config/stormy16/stormy16.c (xstormy16_encode_section_info): Kill.
|
||||
|
@ -63,7 +63,6 @@ static void v850_insert_attributes PARAMS ((tree, tree *));
|
||||
static void v850_select_section PARAMS ((tree, int, unsigned HOST_WIDE_INT));
|
||||
static void v850_encode_data_area PARAMS ((tree));
|
||||
static void v850_encode_section_info PARAMS ((tree, int));
|
||||
static const char *v850_strip_name_encoding PARAMS ((const char *));
|
||||
|
||||
/* Information about the various small memory areas. */
|
||||
struct small_memory_info small_memory[ (int)SMALL_MEMORY_max ] =
|
||||
@ -104,8 +103,6 @@ static int v850_interrupt_p = FALSE;
|
||||
|
||||
#undef TARGET_ENCODE_SECTION_INFO
|
||||
#define TARGET_ENCODE_SECTION_INFO v850_encode_section_info
|
||||
#undef TARGET_STRIP_NAME_ENCODING
|
||||
#define TARGET_STRIP_NAME_ENCODING v850_strip_name_encoding
|
||||
|
||||
#undef TARGET_RTX_COSTS
|
||||
#define TARGET_RTX_COSTS v850_rtx_costs
|
||||
@ -509,20 +506,18 @@ print_operand (file, x, code)
|
||||
case 'O':
|
||||
if (special_symbolref_operand (x, VOIDmode))
|
||||
{
|
||||
const char *name;
|
||||
|
||||
if (GET_CODE (x) == SYMBOL_REF)
|
||||
name = XSTR (x, 0);
|
||||
;
|
||||
else if (GET_CODE (x) == CONST)
|
||||
name = XSTR (XEXP (XEXP (x, 0), 0), 0);
|
||||
x = XEXP (XEXP (x, 0), 0);
|
||||
else
|
||||
abort ();
|
||||
|
||||
if (ZDA_NAME_P (name))
|
||||
if (SYMBOL_REF_ZDA_P (x))
|
||||
fprintf (file, "zdaoff");
|
||||
else if (SDA_NAME_P (name))
|
||||
else if (SYMBOL_REF_SDA_P (x))
|
||||
fprintf (file, "sdaoff");
|
||||
else if (TDA_NAME_P (name))
|
||||
else if (SYMBOL_REF_TDA_P (x))
|
||||
fprintf (file, "tdaoff");
|
||||
else
|
||||
abort ();
|
||||
@ -539,20 +534,18 @@ print_operand (file, x, code)
|
||||
case 'Q':
|
||||
if (special_symbolref_operand (x, VOIDmode))
|
||||
{
|
||||
const char *name;
|
||||
|
||||
if (GET_CODE (x) == SYMBOL_REF)
|
||||
name = XSTR (x, 0);
|
||||
;
|
||||
else if (GET_CODE (x) == CONST)
|
||||
name = XSTR (XEXP (XEXP (x, 0), 0), 0);
|
||||
x = XEXP (XEXP (x, 0), 0);
|
||||
else
|
||||
abort ();
|
||||
|
||||
if (ZDA_NAME_P (name))
|
||||
if (SYMBOL_REF_ZDA_P (x))
|
||||
fprintf (file, "r0");
|
||||
else if (SDA_NAME_P (name))
|
||||
else if (SYMBOL_REF_SDA_P (x))
|
||||
fprintf (file, "gp");
|
||||
else if (TDA_NAME_P (name))
|
||||
else if (SYMBOL_REF_TDA_P (x))
|
||||
fprintf (file, "ep");
|
||||
else
|
||||
abort ();
|
||||
@ -692,55 +685,51 @@ print_operand_address (file, addr)
|
||||
}
|
||||
break;
|
||||
case SYMBOL_REF:
|
||||
if (ENCODED_NAME_P (XSTR (addr, 0)))
|
||||
{
|
||||
const char *name = XSTR (addr, 0);
|
||||
const char *off_name;
|
||||
const char *reg_name;
|
||||
{
|
||||
const char *off_name = NULL;
|
||||
const char *reg_name = NULL;
|
||||
|
||||
if (ZDA_NAME_P (name))
|
||||
{
|
||||
off_name = "zdaoff";
|
||||
reg_name = "r0";
|
||||
}
|
||||
else if (SDA_NAME_P (name))
|
||||
{
|
||||
off_name = "sdaoff";
|
||||
reg_name = "gp";
|
||||
}
|
||||
else if (TDA_NAME_P (name))
|
||||
{
|
||||
off_name = "tdaoff";
|
||||
reg_name = "ep";
|
||||
}
|
||||
else
|
||||
abort ();
|
||||
if (SYMBOL_REF_ZDA_P (addr))
|
||||
{
|
||||
off_name = "zdaoff";
|
||||
reg_name = "r0";
|
||||
}
|
||||
else if (SYMBOL_REF_SDA_P (addr))
|
||||
{
|
||||
off_name = "sdaoff";
|
||||
reg_name = "gp";
|
||||
}
|
||||
else if (SYMBOL_REF_TDA_P (addr))
|
||||
{
|
||||
off_name = "tdaoff";
|
||||
reg_name = "ep";
|
||||
}
|
||||
|
||||
if (off_name)
|
||||
fprintf (file, "%s(", off_name);
|
||||
output_addr_const (file, addr);
|
||||
fprintf (file, ")[%s]", reg_name);
|
||||
}
|
||||
else
|
||||
output_addr_const (file, addr);
|
||||
if (reg_name)
|
||||
fprintf (file, ")[%s]", reg_name);
|
||||
}
|
||||
break;
|
||||
case CONST:
|
||||
if (special_symbolref_operand (addr, VOIDmode))
|
||||
{
|
||||
const char *name = XSTR (XEXP (XEXP (addr, 0), 0), 0);
|
||||
rtx x = XEXP (XEXP (addr, 0), 0);
|
||||
const char *off_name;
|
||||
const char *reg_name;
|
||||
|
||||
if (ZDA_NAME_P (name))
|
||||
if (SYMBOL_REF_ZDA_P (x))
|
||||
{
|
||||
off_name = "zdaoff";
|
||||
reg_name = "r0";
|
||||
}
|
||||
else if (SDA_NAME_P (name))
|
||||
else if (SYMBOL_REF_SDA_P (x))
|
||||
{
|
||||
off_name = "sdaoff";
|
||||
reg_name = "gp";
|
||||
}
|
||||
else if (TDA_NAME_P (name))
|
||||
else if (SYMBOL_REF_TDA_P (x))
|
||||
{
|
||||
off_name = "tdaoff";
|
||||
reg_name = "ep";
|
||||
@ -1051,7 +1040,7 @@ ep_memory_operand (op, mode, unsigned_load)
|
||||
break;
|
||||
|
||||
case SYMBOL_REF:
|
||||
return TDA_NAME_P (XSTR (addr, 0));
|
||||
return SYMBOL_REF_TDA_P (addr);
|
||||
|
||||
case REG:
|
||||
return REGNO (addr) == EP_REGNUM;
|
||||
@ -1067,7 +1056,7 @@ ep_memory_operand (op, mode, unsigned_load)
|
||||
if (GET_CODE (op0) == REG && REGNO (op0) == EP_REGNUM)
|
||||
return TRUE;
|
||||
|
||||
if (GET_CODE (op0) == SYMBOL_REF && TDA_NAME_P (XSTR (op0, 0)))
|
||||
if (GET_CODE (op0) == SYMBOL_REF && SYMBOL_REF_TDA_P (op0))
|
||||
return TRUE;
|
||||
}
|
||||
break;
|
||||
@ -1151,15 +1140,15 @@ special_symbolref_operand (op, mode)
|
||||
rtx op;
|
||||
enum machine_mode ATTRIBUTE_UNUSED mode;
|
||||
{
|
||||
if (GET_CODE (op) == SYMBOL_REF)
|
||||
return ENCODED_NAME_P (XSTR (op, 0));
|
||||
if (GET_CODE (op) == CONST
|
||||
&& GET_CODE (XEXP (op, 0)) == PLUS
|
||||
&& GET_CODE (XEXP (XEXP (op, 0), 1)) == CONST_INT
|
||||
&& CONST_OK_FOR_K (INTVAL (XEXP (XEXP (op, 0), 1))))
|
||||
op = XEXP (XEXP (op, 0), 0);
|
||||
|
||||
else if (GET_CODE (op) == CONST)
|
||||
return (GET_CODE (XEXP (op, 0)) == PLUS
|
||||
&& GET_CODE (XEXP (XEXP (op, 0), 0)) == SYMBOL_REF
|
||||
&& ENCODED_NAME_P (XSTR (XEXP (XEXP (op, 0), 0), 0))
|
||||
&& GET_CODE (XEXP (XEXP (op, 0), 1)) == CONST_INT
|
||||
&& CONST_OK_FOR_K (INTVAL (XEXP (XEXP (op, 0), 1))));
|
||||
if (GET_CODE (op) == SYMBOL_REF)
|
||||
return (SYMBOL_REF_FLAGS (op)
|
||||
& (SYMBOL_FLAG_ZDA | SYMBOL_FLAG_TDA | SYMBOL_FLAG_SDA)) != 0;
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
@ -2338,9 +2327,8 @@ static void
|
||||
v850_encode_data_area (decl)
|
||||
tree decl;
|
||||
{
|
||||
const char *str = XSTR (XEXP (DECL_RTL (decl), 0), 0);
|
||||
int len = strlen (str);
|
||||
char * newstr;
|
||||
int flags;
|
||||
rtx symbol;
|
||||
|
||||
/* Map explict sections into the appropriate attribute */
|
||||
if (v850_get_data_area (decl) == DATA_AREA_NORMAL)
|
||||
@ -2380,19 +2368,16 @@ v850_encode_data_area (decl)
|
||||
return;
|
||||
}
|
||||
|
||||
newstr = alloca (len + 2);
|
||||
|
||||
strcpy (newstr + 1, str);
|
||||
|
||||
symbol = XEXP (DECL_RTL (decl), 0);
|
||||
flags = SYMBOL_REF_FLAGS (symbol);
|
||||
switch (v850_get_data_area (decl))
|
||||
{
|
||||
case DATA_AREA_ZDA: *newstr = ZDA_NAME_FLAG_CHAR; break;
|
||||
case DATA_AREA_TDA: *newstr = TDA_NAME_FLAG_CHAR; break;
|
||||
case DATA_AREA_SDA: *newstr = SDA_NAME_FLAG_CHAR; break;
|
||||
case DATA_AREA_ZDA: flags |= SYMBOL_FLAG_ZDA; break;
|
||||
case DATA_AREA_TDA: flags |= SYMBOL_FLAG_TDA; break;
|
||||
case DATA_AREA_SDA: flags |= SYMBOL_FLAG_SDA; break;
|
||||
default: abort ();
|
||||
}
|
||||
|
||||
XSTR (XEXP (DECL_RTL (decl), 0), 0) = ggc_alloc_string (newstr, len + 2);
|
||||
SYMBOL_REF_FLAGS (symbol) = flags;
|
||||
}
|
||||
|
||||
static void
|
||||
@ -2400,18 +2385,13 @@ v850_encode_section_info (decl, first)
|
||||
tree decl;
|
||||
int first;
|
||||
{
|
||||
if (first && TREE_CODE (decl) == VAR_DECL
|
||||
default_encode_section_info (decl, first);
|
||||
|
||||
if (TREE_CODE (decl) == VAR_DECL
|
||||
&& (TREE_STATIC (decl) || DECL_EXTERNAL (decl)))
|
||||
v850_encode_data_area (decl);
|
||||
}
|
||||
|
||||
static const char *
|
||||
v850_strip_name_encoding (str)
|
||||
const char *str;
|
||||
{
|
||||
return str + (ENCODED_NAME_P (str) || *str == '*');
|
||||
}
|
||||
|
||||
/* Return true if the given RTX is a register which can be restored
|
||||
by a function epilogue. */
|
||||
int
|
||||
|
@ -924,15 +924,17 @@ struct cum_arg { int nbytes; int anonymous_args; };
|
||||
register class that does not include r0 on the output. */
|
||||
|
||||
#define EXTRA_CONSTRAINT(OP, C) \
|
||||
((C) == 'Q' ? ep_memory_operand (OP, GET_MODE (OP), 0) \
|
||||
((C) == 'Q' ? ep_memory_operand (OP, GET_MODE (OP), 0) \
|
||||
: (C) == 'R' ? special_symbolref_operand (OP, VOIDmode) \
|
||||
: (C) == 'S' ? (GET_CODE (OP) == SYMBOL_REF && ! ZDA_NAME_P (XSTR (OP, 0))) \
|
||||
: (C) == 'T' ? ep_memory_operand(OP,GET_MODE(OP),TRUE) \
|
||||
: (C) == 'U' ? ((GET_CODE (OP) == SYMBOL_REF && ZDA_NAME_P (XSTR (OP, 0))) \
|
||||
: (C) == 'S' ? (GET_CODE (OP) == SYMBOL_REF \
|
||||
&& !SYMBOL_REF_ZDA_P (OP)) \
|
||||
: (C) == 'T' ? ep_memory_operand(OP,GET_MODE(OP),TRUE) \
|
||||
: (C) == 'U' ? ((GET_CODE (OP) == SYMBOL_REF \
|
||||
&& SYMBOL_REF_ZDA_P (OP)) \
|
||||
|| (GET_CODE (OP) == CONST \
|
||||
&& GET_CODE (XEXP (OP, 0)) == PLUS \
|
||||
&& GET_CODE (XEXP (XEXP (OP, 0), 0)) == SYMBOL_REF \
|
||||
&& ZDA_NAME_P (XSTR (XEXP (XEXP (OP, 0), 0), 0)))) \
|
||||
&& SYMBOL_REF_ZDA_P (XEXP (XEXP (OP, 0), 0)))) \
|
||||
: 0)
|
||||
|
||||
/* GO_IF_LEGITIMATE_ADDRESS recognizes an RTL expression
|
||||
@ -1201,13 +1203,6 @@ zbss_section () \
|
||||
/* Globalizing directive for a label. */
|
||||
#define GLOBAL_ASM_OP "\t.global "
|
||||
|
||||
/* This is how to output a reference to a user-level label named NAME.
|
||||
`assemble_name' uses this. */
|
||||
|
||||
#undef ASM_OUTPUT_LABELREF
|
||||
#define ASM_OUTPUT_LABELREF(FILE, NAME) \
|
||||
asm_fprintf (FILE, "%U%s", (*targetm.strip_name_encoding) (NAME))
|
||||
|
||||
#define ASM_PN_FORMAT "%s___%lu"
|
||||
|
||||
/* This is how we tell the assembler that two symbols have the same value. */
|
||||
@ -1433,18 +1428,12 @@ extern union tree_node * GHS_current_section_names [(int) COUNT_OF_GHS_SECTION_K
|
||||
|
||||
#define EP_REGNUM 30 /* ep register number */
|
||||
|
||||
#define ZDA_NAME_FLAG_CHAR '@'
|
||||
#define TDA_NAME_FLAG_CHAR '%'
|
||||
#define SDA_NAME_FLAG_CHAR '&'
|
||||
|
||||
#define ZDA_NAME_P(NAME) (*(NAME) == ZDA_NAME_FLAG_CHAR)
|
||||
#define TDA_NAME_P(NAME) (*(NAME) == TDA_NAME_FLAG_CHAR)
|
||||
#define SDA_NAME_P(NAME) (*(NAME) == SDA_NAME_FLAG_CHAR)
|
||||
|
||||
#define ENCODED_NAME_P(SYMBOL_NAME) \
|
||||
( ZDA_NAME_P (SYMBOL_NAME) \
|
||||
|| TDA_NAME_P (SYMBOL_NAME) \
|
||||
|| SDA_NAME_P (SYMBOL_NAME))
|
||||
#define SYMBOL_FLAG_ZDA (SYMBOL_FLAG_MACH_DEP << 0)
|
||||
#define SYMBOL_FLAG_TDA (SYMBOL_FLAG_MACH_DEP << 1)
|
||||
#define SYMBOL_FLAG_SDA (SYMBOL_FLAG_MACH_DEP << 2)
|
||||
#define SYMBOL_REF_ZDA_P(X) ((SYMBOL_REF_FLAGS (X) & SYMBOL_FLAG_ZDA) != 0)
|
||||
#define SYMBOL_REF_TDA_P(X) ((SYMBOL_REF_FLAGS (X) & SYMBOL_FLAG_TDA) != 0)
|
||||
#define SYMBOL_REF_SDA_P(X) ((SYMBOL_REF_FLAGS (X) & SYMBOL_FLAG_SDA) != 0)
|
||||
|
||||
/* Define this if you have defined special-purpose predicates in the
|
||||
file `MACHINE.c'. This macro is called within an initializer of an
|
||||
|
Loading…
Reference in New Issue
Block a user