(FUNCTION_PROFILER): Delete duplicate definition.
authorRichard Earnshaw <erich@gnu.org>
Sat, 4 Jun 1994 11:17:23 +0000 (11:17 +0000)
committerRichard Earnshaw <erich@gnu.org>
Sat, 4 Jun 1994 11:17:23 +0000 (11:17 +0000)
(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

gcc/config/arm/arm.h

index 3163cd9..bf5e8d1 100644 (file)
@@ -684,12 +684,12 @@ enum reg_class
    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);                                \
+#define FUNCTION_PROFILER(STREAM,LABELNO)                                  \
+{                                                                          \
+    fprintf(STREAM, "\tmov\t%sip, %slr\n", ARM_REG_PREFIX, ARM_REG_PREFIX); \
+    fprintf(STREAM, "\tbl\tmcount\n");                                     \
+    fprintf(STREAM, "\t.word\tLP%d\n", (LABELNO));                         \
+    arm_increase_location (12);                                                    \
 }
 
 /* EXIT_IGNORE_STACK should be nonzero if, when returning from a function,
@@ -780,12 +780,14 @@ enum reg_class
           ldr          pc, [pc]
           .word        static chain value
           .word        function's address  */
-#define TRAMPOLINE_TEMPLATE(FILE)  \
-{                                              \
-  fprintf ((FILE), "\tldr\tr8, [pc, #0]\n");   \
-  fprintf ((FILE), "\tldr\tpc, [pc, #0]\n");   \
-  fprintf ((FILE), "\t.word\t0\n");            \
-  fprintf ((FILE), "\t.word\t0\n");            \
+#define TRAMPOLINE_TEMPLATE(FILE)                              \
+{                                                              \
+  fprintf ((FILE), "\tldr\t%sr8, [%spc, #0]\n", ARM_REG_PREFIX,        \
+          ARM_REG_PREFIX);                                     \
+  fprintf ((FILE), "\tldr\t%spc, [%spc, #0]\n", ARM_REG_PREFIX,        \
+          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.  */
@@ -805,17 +807,6 @@ enum reg_class
                  (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);                                \
-}
 \f
 /* Addressing modes, and classification of registers for them.  */
 
@@ -1361,18 +1352,18 @@ extern int arm_compare_fp;
 #endif
 
 /* The text to go at the start of the assembler file */
-#define ASM_FILE_START(STREAM)  \
-{                                                                             \
-  extern char *version_string;                                                \
-                                                                             \
-  fprintf (STREAM,"@ Generated by gcc %s for ARM/%s\n", version_string,              \
-          ARM_OS_NAME);                                                      \
-  fprintf (STREAM,"rfp\t.req\tr9\n");                                         \
-  fprintf (STREAM,"fp\t.req\tr11\n");                                        \
-  fprintf (STREAM,"ip\t.req\tr12\n");                                        \
-  fprintf (STREAM,"sp\t.req\tr13\n");                                        \
-  fprintf (STREAM,"lr\t.req\tr14\n");                                        \
-  fprintf (STREAM,"pc\t.req\tr15\n");                                        \
+#define ASM_FILE_START(STREAM)                                           \
+{                                                                        \
+  extern char *version_string;                                           \
+  fprintf (STREAM,"%c Generated by gcc %s for ARM/%s\n",                 \
+          ARM_COMMENT_CHAR, version_string, ARM_OS_NAME);                \
+  fprintf (STREAM,"%srfp\t.req\t%sr9\n", ARM_REG_PREFIX, ARM_REG_PREFIX); \
+  fprintf (STREAM,"%ssl\t.req\t%sr10\n", ARM_REG_PREFIX, ARM_REG_PREFIX); \
+  fprintf (STREAM,"%sfp\t.req\t%sr11\n", ARM_REG_PREFIX, ARM_REG_PREFIX); \
+  fprintf (STREAM,"%sip\t.req\t%sr12\n", ARM_REG_PREFIX, ARM_REG_PREFIX); \
+  fprintf (STREAM,"%ssp\t.req\t%sr13\n", ARM_REG_PREFIX, ARM_REG_PREFIX); \
+  fprintf (STREAM,"%slr\t.req\t%sr14\n", ARM_REG_PREFIX, ARM_REG_PREFIX); \
+  fprintf (STREAM,"%spc\t.req\t%sr15\n", ARM_REG_PREFIX, ARM_REG_PREFIX); \
 }
 
 #define ASM_APP_ON  ""
@@ -1382,17 +1373,41 @@ extern int arm_compare_fp;
 #define TEXT_SECTION_ASM_OP  ".text"
 #define DATA_SECTION_ASM_OP  ".data"
 
-/* The assembler's names for the registers.  RFP need not always be used as
-   the Real framepointer; it can also be used as a normal general register.
-   Note that the name `fp' is horribly misleading since `fp' is in fact only
-   the argument-and-return-context pointer.  */
+/* The assembler's names for the registers.  */
+#ifndef REGISTER_NAMES
 #define REGISTER_NAMES  \
 {                                                 \
   "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",  \
   "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 */
 #define DOLLARS_IN_IDENTIFIERS 0
@@ -1470,11 +1485,13 @@ do {                                                                    \
    sprintf ((OUTVAR), "%s.%d", (NAME), (NUMBER)))
 
 /* Output a push or a pop instruction (only used when profiling).  */
-#define ASM_OUTPUT_REG_PUSH(STREAM,REGNO)   \
-  fprintf(STREAM,"\tstmfd\tsp!,{%s}\n", reg_names[REGNO])
+#define ASM_OUTPUT_REG_PUSH(STREAM,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)   \
-  fprintf(STREAM,"\tldmfd\tsp!,{%s}\n", reg_names[REGNO])
+#define ASM_OUTPUT_REG_POP(STREAM,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
    but we must define it anyway.  */
@@ -1497,11 +1514,11 @@ do { char dstr[30];                                                     \
      REAL_VALUE_TO_TARGET_LONG_DOUBLE (VALUE, l);                      \
      REAL_VALUE_TO_DECIMAL (VALUE, "%.20g", dstr);                     \
      if (sizeof (int) == sizeof (long))                                        \
-       fprintf (STREAM, "\t.long 0x%x,0x%x,0x%x\t@ long double %s\n",  \
-               l[2], l[1], l[0], dstr);                                \
+       fprintf (STREAM, "\t.long 0x%x,0x%x,0x%x\t%c long double %s\n", \
+               l[2], l[1], l[0], ARM_COMMENT_CHAR, dstr);              \
      else                                                              \
-       fprintf (STREAM, "\t.long 0x%lx,0x%lx,0x%lx\t@ long double %s\n",\
-               l[0], l[1], l[2], dstr);                                \
+       fprintf (STREAM, "\t.long 0x%lx,0x%lx,0x%lx\t%c long double %s\n",\
+               l[0], l[1], l[2], ARM_COMMENT_CHAR, dstr);              \
    } while (0)
 
     
@@ -1512,11 +1529,11 @@ do { char dstr[30];                                                     \
      REAL_VALUE_TO_TARGET_DOUBLE (VALUE, l);                           \
      REAL_VALUE_TO_DECIMAL (VALUE, "%.14g", dstr);                     \
      if (sizeof (int) == sizeof (long))                                        \
-       fprintf (STREAM, "\t.long 0x%x, 0x%x\t@ double %s\n", l[0], l[1],\
-               dstr);                                                  \
+       fprintf (STREAM, "\t.long 0x%x, 0x%x\t%c double %s\n", l[0],    \
+               l[1], ARM_COMMENT_CHAR, dstr);                          \
      else                                                              \
-       fprintf (STREAM, "\t.long 0x%lx, 0x%lx\t@ double %s\n", l[0],   \
-               l[1], dstr);                                            \
+       fprintf (STREAM, "\t.long 0x%lx, 0x%lx\t%c double %s\n", l[0],  \
+               l[1], ARM_COMMENT_CHAR, dstr);                          \
    } while (0)
 
 #define ASM_OUTPUT_FLOAT(STREAM, VALUE)                                        \
@@ -1526,9 +1543,11 @@ do { char dstr[30];                                                      \
      REAL_VALUE_TO_TARGET_SINGLE (VALUE, l);                           \
      REAL_VALUE_TO_DECIMAL (VALUE, "%.7g", dstr);                      \
      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                                                              \
-       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);
 
 #define ASM_OUTPUT_INT(STREAM, EXP)    \
@@ -1579,10 +1598,10 @@ do { char dstr[30];                                                     \
     } while (0)
 
 /* Output a common block */
-#define ASM_OUTPUT_COMMON(STREAM, NAME, SIZE, ROUNDED)  \
-  (fprintf (STREAM, "\t.comm\t"),                   \
-   assemble_name ((STREAM), (NAME)),                \
-   fprintf(STREAM, ", %d\t@%d\n", ROUNDED, SIZE))
+#define ASM_OUTPUT_COMMON(STREAM, NAME, SIZE, ROUNDED)                 \
+  (fprintf (STREAM, "\t.comm\t"),                                      \
+   assemble_name ((STREAM), (NAME)),                                   \
+   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
    the bss segment.  Note that this is *bad* practice.  */
@@ -1644,7 +1663,8 @@ do { char dstr[30];                                                       \
     int is_minus = GET_CODE (X) == MINUS;                              \
                                                                        \
     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)                         \
       {                                                                        \
        rtx base = XEXP (X, 0);                                         \
@@ -1665,12 +1685,14 @@ do { char dstr[30];                                                     \
            offset = INTVAL (index);                                    \
            if (is_minus)                                               \
              offset = -offset;                                         \
-           fprintf (STREAM, "[%s, #%d]", base_reg_name, offset);       \
+           fprintf (STREAM, "[%s%s, #%d]", ARM_REG_PREFIX,             \
+                    base_reg_name, offset);                            \
            break;                                                      \
                                                                        \
          case REG:                                                     \
-           fprintf (STREAM, "[%s, %s%s]", base_reg_name,               \
-                    is_minus ? "-" : "", reg_names[REGNO (index)] );   \
+           fprintf (STREAM, "[%s%s, %s%s%s]", ARM_REG_PREFIX,          \
+                    base_reg_name, is_minus ? "-" : "",                \
+                    ARM_REG_PREFIX, reg_names[REGNO (index)] );        \
            break;                                                      \
                                                                        \
          case MULT:                                                    \
@@ -1679,8 +1701,8 @@ do { char dstr[30];                                                       \
          case ASHIFT:                                                  \
          case ROTATERT:                                                \
          {                                                             \
-           fprintf (STREAM, "[%s, %s%s, ", base_reg_name,              \
-                    is_minus ? "-" : "",                               \
+           fprintf (STREAM, "[%s%s, %s%s%s, ", ARM_REG_PREFIX,         \
+                    base_reg_name, is_minus ? "-" : "", ARM_REG_PREFIX,\
                     reg_names[REGNO (XEXP (index, 0))]);               \
            arm_print_operand (STREAM, index, 'S');                     \
            fputs ("]", STREAM);                                        \
@@ -1700,11 +1722,13 @@ do { char dstr[30];                                                     \
        abort ();                                                       \
                                                                        \
       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_MODE_SIZE (output_memory_reference_mode));         \
       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_MODE_SIZE (output_memory_reference_mode));         \
     }                                                                  \