Commit 4eda77ec by Richard Earnshaw

(FUNCTION_PROFILER): Delete duplicate definition.

(FUNCTION_PROFILER, TRAMPOLINE_TEMPLATE, ASM_FILE_START,
 ASM_OUTPUT_REG_{PUSH,POP}, PRINT_OPERAND_ADDRESS):  Output register
 prefix before any explicit register name.
(ASM_OUTPUT_LONG_DOUBLE, ASM_OUTPUT_DOUBLE, ASM_OUTPUT_FLOAT,
 ASM_OUTPUT_COMMON): Output the target dependent comment char.
(ASM_FILE_START): Output register alias for r10.
(REGISTER_NAMES): Output "r9" now for r9, not "rfp".
(ADDITIONAL_REGISTER_NAMES): New macro.

From-SVN: r7444
parent 916cc8c5
...@@ -684,12 +684,12 @@ enum reg_class ...@@ -684,12 +684,12 @@ enum reg_class
puts this BEFORE the prolog but gcc pust it afterwards. The ``mov ip,lr'' puts this BEFORE the prolog but gcc pust it afterwards. The ``mov ip,lr''
seems like a good idea to stick with cc convention. ``prof'' doesn't seem seems like a good idea to stick with cc convention. ``prof'' doesn't seem
to mind about this! */ to mind about this! */
#define FUNCTION_PROFILER(STREAM,LABELNO) \ #define FUNCTION_PROFILER(STREAM,LABELNO) \
{ \ { \
fprintf(STREAM, "\tmov\tip, lr\n"); \ fprintf(STREAM, "\tmov\t%sip, %slr\n", ARM_REG_PREFIX, ARM_REG_PREFIX); \
fprintf(STREAM, "\tbl\tmcount\n"); \ fprintf(STREAM, "\tbl\tmcount\n"); \
fprintf(STREAM, "\t.word\tLP%d\n", (LABELNO)); \ fprintf(STREAM, "\t.word\tLP%d\n", (LABELNO)); \
arm_increase_location (12); \ arm_increase_location (12); \
} }
/* EXIT_IGNORE_STACK should be nonzero if, when returning from a function, /* EXIT_IGNORE_STACK should be nonzero if, when returning from a function,
...@@ -780,12 +780,14 @@ enum reg_class ...@@ -780,12 +780,14 @@ enum reg_class
ldr pc, [pc] ldr pc, [pc]
.word static chain value .word static chain value
.word function's address */ .word function's address */
#define TRAMPOLINE_TEMPLATE(FILE) \ #define TRAMPOLINE_TEMPLATE(FILE) \
{ \ { \
fprintf ((FILE), "\tldr\tr8, [pc, #0]\n"); \ fprintf ((FILE), "\tldr\t%sr8, [%spc, #0]\n", ARM_REG_PREFIX, \
fprintf ((FILE), "\tldr\tpc, [pc, #0]\n"); \ ARM_REG_PREFIX); \
fprintf ((FILE), "\t.word\t0\n"); \ fprintf ((FILE), "\tldr\t%spc, [%spc, #0]\n", ARM_REG_PREFIX, \
fprintf ((FILE), "\t.word\t0\n"); \ ARM_REG_PREFIX); \
fprintf ((FILE), "\t.word\t0\n"); \
fprintf ((FILE), "\t.word\t0\n"); \
} }
/* Length in units of the trampoline for entering a nested function. */ /* Length in units of the trampoline for entering a nested function. */
...@@ -805,17 +807,6 @@ enum reg_class ...@@ -805,17 +807,6 @@ enum reg_class
(FNADDR)); \ (FNADDR)); \
} }
/* Call the function profiler with a given profile label. The Acorn compiler
puts this BEFORE the prolog but gcc pust it afterwards. The ``mov ip,lr''
seems like a good idea to stick with cc convention. ``prof'' doesn't seem
to mind about this! */
#define FUNCTION_PROFILER(STREAM,LABELNO) \
{ \
fprintf(STREAM, "\tmov\tip, lr\n"); \
fprintf(STREAM, "\tbl\tmcount\n"); \
fprintf(STREAM, "\t.word\tLP%d\n", (LABELNO)); \
arm_increase_location (12); \
}
/* Addressing modes, and classification of registers for them. */ /* Addressing modes, and classification of registers for them. */
...@@ -1361,18 +1352,18 @@ extern int arm_compare_fp; ...@@ -1361,18 +1352,18 @@ extern int arm_compare_fp;
#endif #endif
/* The text to go at the start of the assembler file */ /* The text to go at the start of the assembler file */
#define ASM_FILE_START(STREAM) \ #define ASM_FILE_START(STREAM) \
{ \ { \
extern char *version_string; \ extern char *version_string; \
\ fprintf (STREAM,"%c Generated by gcc %s for ARM/%s\n", \
fprintf (STREAM,"@ Generated by gcc %s for ARM/%s\n", version_string, \ ARM_COMMENT_CHAR, version_string, ARM_OS_NAME); \
ARM_OS_NAME); \ fprintf (STREAM,"%srfp\t.req\t%sr9\n", ARM_REG_PREFIX, ARM_REG_PREFIX); \
fprintf (STREAM,"rfp\t.req\tr9\n"); \ fprintf (STREAM,"%ssl\t.req\t%sr10\n", ARM_REG_PREFIX, ARM_REG_PREFIX); \
fprintf (STREAM,"fp\t.req\tr11\n"); \ fprintf (STREAM,"%sfp\t.req\t%sr11\n", ARM_REG_PREFIX, ARM_REG_PREFIX); \
fprintf (STREAM,"ip\t.req\tr12\n"); \ fprintf (STREAM,"%sip\t.req\t%sr12\n", ARM_REG_PREFIX, ARM_REG_PREFIX); \
fprintf (STREAM,"sp\t.req\tr13\n"); \ fprintf (STREAM,"%ssp\t.req\t%sr13\n", ARM_REG_PREFIX, ARM_REG_PREFIX); \
fprintf (STREAM,"lr\t.req\tr14\n"); \ fprintf (STREAM,"%slr\t.req\t%sr14\n", ARM_REG_PREFIX, ARM_REG_PREFIX); \
fprintf (STREAM,"pc\t.req\tr15\n"); \ fprintf (STREAM,"%spc\t.req\t%sr15\n", ARM_REG_PREFIX, ARM_REG_PREFIX); \
} }
#define ASM_APP_ON "" #define ASM_APP_ON ""
...@@ -1382,17 +1373,41 @@ extern int arm_compare_fp; ...@@ -1382,17 +1373,41 @@ extern int arm_compare_fp;
#define TEXT_SECTION_ASM_OP ".text" #define TEXT_SECTION_ASM_OP ".text"
#define DATA_SECTION_ASM_OP ".data" #define DATA_SECTION_ASM_OP ".data"
/* The assembler's names for the registers. RFP need not always be used as /* The assembler's names for the registers. */
the Real framepointer; it can also be used as a normal general register. #ifndef REGISTER_NAMES
Note that the name `fp' is horribly misleading since `fp' is in fact only
the argument-and-return-context pointer. */
#define REGISTER_NAMES \ #define REGISTER_NAMES \
{ \ { \
"r0", "r1", "r2", "r3", "r4", "r5", "r6", "r7", \ "r0", "r1", "r2", "r3", "r4", "r5", "r6", "r7", \
"r8","rfp", "sl", "fp", "ip", "sp", "lr", "pc", \ "r8", "r9", "sl", "fp", "ip", "sp", "lr", "pc", \
"f0", "f1", "f2", "f3", "f4", "f5", "f6", "f7", \ "f0", "f1", "f2", "f3", "f4", "f5", "f6", "f7", \
"cc", "sfp", "afp" \ "cc", "sfp", "afp" \
} }
#endif
#ifndef ADDITIONAL_REGISTER_NAMES
#define ADDITIONAL_REGISTER_NAMES \
{ \
{"a1", 0}, \
{"a2", 1}, \
{"a3", 2}, \
{"a4", 3}, \
{"v1", 4}, \
{"v2", 5}, \
{"v3", 6}, \
{"v4", 7}, \
{"v5", 8}, \
{"v6", 9}, \
{"rfp", 9}, /* Gcc used to call it this */ \
{"sb", 9}, \
{"v7", 10}, \
{"r10", 10}, \
{"r11", 11}, /* fp */ \
{"r12", 12}, /* ip */ \
{"r13", 13}, /* sp */ \
{"r14", 14}, /* lr */ \
{"r15", 15} /* pc */ \
}
#endif
/* Arm Assembler barfs on dollars */ /* Arm Assembler barfs on dollars */
#define DOLLARS_IN_IDENTIFIERS 0 #define DOLLARS_IN_IDENTIFIERS 0
...@@ -1470,11 +1485,13 @@ do { \ ...@@ -1470,11 +1485,13 @@ do { \
sprintf ((OUTVAR), "%s.%d", (NAME), (NUMBER))) sprintf ((OUTVAR), "%s.%d", (NAME), (NUMBER)))
/* Output a push or a pop instruction (only used when profiling). */ /* Output a push or a pop instruction (only used when profiling). */
#define ASM_OUTPUT_REG_PUSH(STREAM,REGNO) \ #define ASM_OUTPUT_REG_PUSH(STREAM,REGNO) \
fprintf(STREAM,"\tstmfd\tsp!,{%s}\n", reg_names[REGNO]) fprintf(STREAM,"\tstmfd\t%ssp!,{%s%s}\n", ARM_REG_PREFIX, ARM_REG_PREFIX, \
reg_names[REGNO])
#define ASM_OUTPUT_REG_POP(STREAM,REGNO) \ #define ASM_OUTPUT_REG_POP(STREAM,REGNO) \
fprintf(STREAM,"\tldmfd\tsp!,{%s}\n", reg_names[REGNO]) fprintf(STREAM,"\tldmfd\t%ssp!,{%s%s}\n", ARM_REG_PREFIX, ARM_REG_PREFIX, \
reg_names[REGNO])
/* Output a relative address. Not needed since jump tables are absolute /* Output a relative address. Not needed since jump tables are absolute
but we must define it anyway. */ but we must define it anyway. */
...@@ -1497,11 +1514,11 @@ do { char dstr[30]; \ ...@@ -1497,11 +1514,11 @@ do { char dstr[30]; \
REAL_VALUE_TO_TARGET_LONG_DOUBLE (VALUE, l); \ REAL_VALUE_TO_TARGET_LONG_DOUBLE (VALUE, l); \
REAL_VALUE_TO_DECIMAL (VALUE, "%.20g", dstr); \ REAL_VALUE_TO_DECIMAL (VALUE, "%.20g", dstr); \
if (sizeof (int) == sizeof (long)) \ if (sizeof (int) == sizeof (long)) \
fprintf (STREAM, "\t.long 0x%x,0x%x,0x%x\t@ long double %s\n", \ fprintf (STREAM, "\t.long 0x%x,0x%x,0x%x\t%c long double %s\n", \
l[2], l[1], l[0], dstr); \ l[2], l[1], l[0], ARM_COMMENT_CHAR, dstr); \
else \ else \
fprintf (STREAM, "\t.long 0x%lx,0x%lx,0x%lx\t@ long double %s\n",\ fprintf (STREAM, "\t.long 0x%lx,0x%lx,0x%lx\t%c long double %s\n",\
l[0], l[1], l[2], dstr); \ l[0], l[1], l[2], ARM_COMMENT_CHAR, dstr); \
} while (0) } while (0)
...@@ -1512,11 +1529,11 @@ do { char dstr[30]; \ ...@@ -1512,11 +1529,11 @@ do { char dstr[30]; \
REAL_VALUE_TO_TARGET_DOUBLE (VALUE, l); \ REAL_VALUE_TO_TARGET_DOUBLE (VALUE, l); \
REAL_VALUE_TO_DECIMAL (VALUE, "%.14g", dstr); \ REAL_VALUE_TO_DECIMAL (VALUE, "%.14g", dstr); \
if (sizeof (int) == sizeof (long)) \ if (sizeof (int) == sizeof (long)) \
fprintf (STREAM, "\t.long 0x%x, 0x%x\t@ double %s\n", l[0], l[1],\ fprintf (STREAM, "\t.long 0x%x, 0x%x\t%c double %s\n", l[0], \
dstr); \ l[1], ARM_COMMENT_CHAR, dstr); \
else \ else \
fprintf (STREAM, "\t.long 0x%lx, 0x%lx\t@ double %s\n", l[0], \ fprintf (STREAM, "\t.long 0x%lx, 0x%lx\t%c double %s\n", l[0], \
l[1], dstr); \ l[1], ARM_COMMENT_CHAR, dstr); \
} while (0) } while (0)
#define ASM_OUTPUT_FLOAT(STREAM, VALUE) \ #define ASM_OUTPUT_FLOAT(STREAM, VALUE) \
...@@ -1526,9 +1543,11 @@ do { char dstr[30]; \ ...@@ -1526,9 +1543,11 @@ do { char dstr[30]; \
REAL_VALUE_TO_TARGET_SINGLE (VALUE, l); \ REAL_VALUE_TO_TARGET_SINGLE (VALUE, l); \
REAL_VALUE_TO_DECIMAL (VALUE, "%.7g", dstr); \ REAL_VALUE_TO_DECIMAL (VALUE, "%.7g", dstr); \
if (sizeof (int) == sizeof (long)) \ if (sizeof (int) == sizeof (long)) \
fprintf (STREAM, "\t.word 0x%x\t@ float %s\n", l, dstr); \ fprintf (STREAM, "\t.word 0x%x\t%c float %s\n", l, \
ARM_COMMENT_CHAR, dstr); \
else \ else \
fprintf (STREAM, "\t.word 0x%lx\t@ float %s\n", l, dstr); \ fprintf (STREAM, "\t.word 0x%lx\t%c float %s\n", l, \
ARM_COMMENT_CHAR, dstr); \
} while (0); } while (0);
#define ASM_OUTPUT_INT(STREAM, EXP) \ #define ASM_OUTPUT_INT(STREAM, EXP) \
...@@ -1579,10 +1598,10 @@ do { char dstr[30]; \ ...@@ -1579,10 +1598,10 @@ do { char dstr[30]; \
} while (0) } while (0)
/* Output a common block */ /* Output a common block */
#define ASM_OUTPUT_COMMON(STREAM, NAME, SIZE, ROUNDED) \ #define ASM_OUTPUT_COMMON(STREAM, NAME, SIZE, ROUNDED) \
(fprintf (STREAM, "\t.comm\t"), \ (fprintf (STREAM, "\t.comm\t"), \
assemble_name ((STREAM), (NAME)), \ assemble_name ((STREAM), (NAME)), \
fprintf(STREAM, ", %d\t@%d\n", ROUNDED, SIZE)) fprintf(STREAM, ", %d\t%c%d\n", ROUNDED, ARM_COMMENT_CHAR, SIZE))
/* Output a local common block. /bin/as can't do this, so hack a `.space' into /* Output a local common block. /bin/as can't do this, so hack a `.space' into
the bss segment. Note that this is *bad* practice. */ the bss segment. Note that this is *bad* practice. */
...@@ -1644,7 +1663,8 @@ do { char dstr[30]; \ ...@@ -1644,7 +1663,8 @@ do { char dstr[30]; \
int is_minus = GET_CODE (X) == MINUS; \ int is_minus = GET_CODE (X) == MINUS; \
\ \
if (GET_CODE (X) == REG) \ if (GET_CODE (X) == REG) \
fprintf (STREAM, "[%s, #0]", reg_names[REGNO (X)]); \ fprintf (STREAM, "[%s%s, #0]", ARM_REG_PREFIX, \
reg_names[REGNO (X)]); \
else if (GET_CODE (X) == PLUS || is_minus) \ else if (GET_CODE (X) == PLUS || is_minus) \
{ \ { \
rtx base = XEXP (X, 0); \ rtx base = XEXP (X, 0); \
...@@ -1665,12 +1685,14 @@ do { char dstr[30]; \ ...@@ -1665,12 +1685,14 @@ do { char dstr[30]; \
offset = INTVAL (index); \ offset = INTVAL (index); \
if (is_minus) \ if (is_minus) \
offset = -offset; \ offset = -offset; \
fprintf (STREAM, "[%s, #%d]", base_reg_name, offset); \ fprintf (STREAM, "[%s%s, #%d]", ARM_REG_PREFIX, \
base_reg_name, offset); \
break; \ break; \
\ \
case REG: \ case REG: \
fprintf (STREAM, "[%s, %s%s]", base_reg_name, \ fprintf (STREAM, "[%s%s, %s%s%s]", ARM_REG_PREFIX, \
is_minus ? "-" : "", reg_names[REGNO (index)] ); \ base_reg_name, is_minus ? "-" : "", \
ARM_REG_PREFIX, reg_names[REGNO (index)] ); \
break; \ break; \
\ \
case MULT: \ case MULT: \
...@@ -1679,8 +1701,8 @@ do { char dstr[30]; \ ...@@ -1679,8 +1701,8 @@ do { char dstr[30]; \
case ASHIFT: \ case ASHIFT: \
case ROTATERT: \ case ROTATERT: \
{ \ { \
fprintf (STREAM, "[%s, %s%s, ", base_reg_name, \ fprintf (STREAM, "[%s%s, %s%s%s, ", ARM_REG_PREFIX, \
is_minus ? "-" : "", \ base_reg_name, is_minus ? "-" : "", ARM_REG_PREFIX,\
reg_names[REGNO (XEXP (index, 0))]); \ reg_names[REGNO (XEXP (index, 0))]); \
arm_print_operand (STREAM, index, 'S'); \ arm_print_operand (STREAM, index, 'S'); \
fputs ("]", STREAM); \ fputs ("]", STREAM); \
...@@ -1700,11 +1722,13 @@ do { char dstr[30]; \ ...@@ -1700,11 +1722,13 @@ do { char dstr[30]; \
abort (); \ abort (); \
\ \
if (GET_CODE (X) == PRE_DEC || GET_CODE (X) == PRE_INC) \ if (GET_CODE (X) == PRE_DEC || GET_CODE (X) == PRE_INC) \
fprintf (STREAM, "[%s, #%s%d]!", reg_names[REGNO (XEXP (X, 0))],\ fprintf (STREAM, "[%s%s, #%s%d]!", ARM_REG_PREFIX, \
reg_names[REGNO (XEXP (X, 0))], \
GET_CODE (X) == PRE_DEC ? "-" : "", \ GET_CODE (X) == PRE_DEC ? "-" : "", \
GET_MODE_SIZE (output_memory_reference_mode)); \ GET_MODE_SIZE (output_memory_reference_mode)); \
else \ else \
fprintf (STREAM, "[%s], #%s%d", reg_names[REGNO (XEXP (X, 0))], \ fprintf (STREAM, "[%s%s], #%s%d", ARM_REG_PREFIX, \
reg_names[REGNO (XEXP (X, 0))], \
GET_CODE (X) == POST_DEC ? "-" : "", \ GET_CODE (X) == POST_DEC ? "-" : "", \
GET_MODE_SIZE (output_memory_reference_mode)); \ GET_MODE_SIZE (output_memory_reference_mode)); \
} \ } \
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment