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 ] =
#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
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 ();
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 ();
}
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;
-
- 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 ();
-
+ {
+ const char *off_name = NULL;
+ const char *reg_name = NULL;
+
+ 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";
break;
case SYMBOL_REF:
- return TDA_NAME_P (XSTR (addr, 0));
+ return SYMBOL_REF_TDA_P (addr);
case REG:
return REGNO (addr) == EP_REGNUM;
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;
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;
}
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)
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
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
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)
\f
/* GO_IF_LEGITIMATE_ADDRESS recognizes an RTL expression
/* 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. */
#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