diff options
author | Franz Sirl <Franz.Sirl-kernel@lauterbach.com> | 2000-01-27 23:42:37 +0000 |
---|---|---|
committer | Franz Sirl <Franz.Sirl-kernel@lauterbach.com> | 2000-01-27 23:42:37 +0000 |
commit | caa2b5e42987700a837ad76db3d855b2dda806ef (patch) | |
tree | 31ed2563a02692216b97f2024258898356b682d8 | |
parent | ecaed1bcf850f868f3307d59488c3000fab79aeb (diff) |
* rs6000.h (SELECT_RTX_SECTION): Move to aix.h.
(ASM_FILE_START): Likewise.
(ASM_DECLARE_FUNCTION_NAME): Likewise.
(ASM_OUTPUT_LABELREF): Likewise.
(ASM_OUTPUT_SKIP): Likewise.
(ASM_OUTPUT_INTERNAL_LABEL): Likewise.
(ASM_GENERATE_INTERNAL_LABEL): Likewise.
(ASM_OUTPUT_CASE_LABEL): Likewise.
(ASM_OUTPUT_ALIGNED_COMMON): Likewise.
(ASM_OUTPUT_ASCII): Likewise.
git-svn-id: https://gcc.gnu.org/svn/gcc/branches/newppc-branch@31657 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r-- | gcc/config/rs6000/ChangeLog | 13 | ||||
-rw-r--r-- | gcc/config/rs6000/aix.h | 193 | ||||
-rw-r--r-- | gcc/config/rs6000/rs6000.h | 136 |
3 files changed, 180 insertions, 162 deletions
diff --git a/gcc/config/rs6000/ChangeLog b/gcc/config/rs6000/ChangeLog index 99be3627dba..9e1ffc1d876 100644 --- a/gcc/config/rs6000/ChangeLog +++ b/gcc/config/rs6000/ChangeLog @@ -1,3 +1,16 @@ +2000-01-27 Franz Sirl <Franz.Sirl-kernel@lauterbach.com> + + * rs6000.h (SELECT_RTX_SECTION): Move to aix.h. + (ASM_FILE_START): Likewise. + (ASM_DECLARE_FUNCTION_NAME): Likewise. + (ASM_OUTPUT_LABELREF): Likewise. + (ASM_OUTPUT_SKIP): Likewise. + (ASM_OUTPUT_INTERNAL_LABEL): Likewise. + (ASM_GENERATE_INTERNAL_LABEL): Likewise. + (ASM_OUTPUT_CASE_LABEL): Likewise. + (ASM_OUTPUT_ALIGNED_COMMON): Likewise. + (ASM_OUTPUT_ASCII): Likewise. + 2000-01-27 Clinton Popetz <cpopetz@cygnus.com> * rs6000.c (rs6000_emit_load_toc_table): Use "LCG" and diff --git a/gcc/config/rs6000/aix.h b/gcc/config/rs6000/aix.h index 12372ddae0a..ebd3baaa9f1 100644 --- a/gcc/config/rs6000/aix.h +++ b/gcc/config/rs6000/aix.h @@ -112,32 +112,6 @@ Boston, MA 02111-1307, USA. */ #define LIB_SPEC "%{pg:-L/lib/profiled -L/usr/lib/profiled}\ %{p:-L/lib/profiled -L/usr/lib/profiled} %{!shared:%{g*:-lg}} -lc" -#define ASM_OUTPUT_EXTERNAL(FILE, DECL, NAME) \ -{ rtx _symref = XEXP (DECL_RTL (DECL), 0); \ - if ((TREE_CODE (DECL) == VAR_DECL \ - || TREE_CODE (DECL) == FUNCTION_DECL) \ - && (NAME)[strlen (NAME) - 1] != ']') \ - { \ - char *_name = (char *) permalloc (strlen (XSTR (_symref, 0)) + 5); \ - strcpy (_name, XSTR (_symref, 0)); \ - strcat (_name, TREE_CODE (DECL) == FUNCTION_DECL ? "[DS]" : "[RW]"); \ - XSTR (_symref, 0) = _name; \ - } \ -} - -/* Output at end of assembler file. - - On the RS/6000, referencing data should automatically pull in text. */ - -#define ASM_FILE_END(FILE) \ -{ \ - text_section (); \ - fputs ("_section_.text:\n", FILE); \ - data_section (); \ - fputs (TARGET_32BIT \ - ? "\t.long _section_.text\n" : "\t.llong _section_.text\n", FILE); \ -} - /* Define the extra sections we need. We define three: one is the read-only data section which is used for constants. This is a csect whose name is derived from the name of the input file. The second is for initialized @@ -246,6 +220,19 @@ toc_section () \ } \ } +/* Select section for constant in constant pool. + + On RS/6000, all constants are in the private read-only data area. + However, if this is being placed in the TOC it must be output as a + toc entry. */ + +#define SELECT_RTX_SECTION(MODE, X) \ +{ if (ASM_OUTPUT_SPECIAL_POOL_ENTRY_P (X)) \ + toc_section (); \ + else \ + read_only_private_data_section (); \ +} + /* Indicate that jump tables go in the text section. */ #define JUMP_TABLES_IN_TEXT_SECTION 1 @@ -284,3 +271,157 @@ toc_section () \ /* AIX allows r13 to be used. */ #define FIXED_R13 0 + +/* Output at beginning of assembler file. + + Initialize the section names for the RS/6000 at this point. + + Specify filename, including full path, to assembler. + + We want to go into the TOC section so at least one .toc will be emitted. + Also, in order to output proper .bs/.es pairs, we need at least one static + [RW] section emitted. + + We then switch back to text to force the gcc2_compiled. label and the space + allocated after it (when profiling) into the text section. + + Finally, declare mcount when profiling to make the assembler happy. */ + +#define ASM_FILE_START(FILE) \ +{ \ + rs6000_gen_section_name (&xcoff_bss_section_name, \ + main_input_filename, ".bss_"); \ + rs6000_gen_section_name (&xcoff_private_data_section_name, \ + main_input_filename, ".rw_"); \ + rs6000_gen_section_name (&xcoff_read_only_section_name, \ + main_input_filename, ".ro_"); \ + \ + fprintf (FILE, "\t.file\t\"%s\"\n", main_input_filename); \ + if (TARGET_64BIT) \ + fputs ("\t.machine\t\"ppc64\"\n", FILE); \ + toc_section (); \ + if (write_symbols != NO_DEBUG) \ + private_data_section (); \ + text_section (); \ + if (profile_flag) \ + fprintf (FILE, "\t.extern %s\n", RS6000_MCOUNT); \ + rs6000_file_start (FILE, TARGET_CPU_DEFAULT); \ +} + +/* Output at end of assembler file. + + On the RS/6000, referencing data should automatically pull in text. */ + +#define ASM_FILE_END(FILE) \ +{ \ + text_section (); \ + fputs ("_section_.text:\n", FILE); \ + data_section (); \ + fputs (TARGET_32BIT \ + ? "\t.long _section_.text\n" : "\t.llong _section_.text\n", FILE); \ +} + +/* This macro produces the initial definition of a function name. + On the RS/6000, we need to place an extra '.' in the function name and + output the function descriptor. + + The csect for the function will have already been created by the + `text_section' call previously done. We do have to go back to that + csect, however. + + The third and fourth parameters to the .function pseudo-op (16 and 044) + are placeholders which no longer have any use. */ + +#define ASM_DECLARE_FUNCTION_NAME(FILE,NAME,DECL) \ +{ if (TREE_PUBLIC (DECL)) \ + { \ + fputs ("\t.globl .", FILE); \ + RS6000_OUTPUT_BASENAME (FILE, NAME); \ + putc ('\n', FILE); \ + } \ + else \ + { \ + fputs ("\t.lglobl .", FILE); \ + RS6000_OUTPUT_BASENAME (FILE, NAME); \ + putc ('\n', FILE); \ + } \ + fputs ("\t.csect ", FILE); \ + RS6000_OUTPUT_BASENAME (FILE, NAME); \ + fputs (TARGET_32BIT ? "[DS]\n" : "[DS],3\n", FILE); \ + RS6000_OUTPUT_BASENAME (FILE, NAME); \ + fputs (":\n", FILE); \ + fputs (TARGET_32BIT ? "\t.long ." : "\t.llong .", FILE); \ + RS6000_OUTPUT_BASENAME (FILE, NAME); \ + fputs (", TOC[tc0], 0\n", FILE); \ + fputs (TARGET_32BIT \ + ? "\t.csect .text[PR]\n." : "\t.csect .text[PR],3\n.", FILE); \ + RS6000_OUTPUT_BASENAME (FILE, NAME); \ + fputs (":\n", FILE); \ + if (write_symbols == XCOFF_DEBUG) \ + xcoffout_declare_function (FILE, DECL, NAME); \ +} + +/* This is how to output a reference to a user-level label named NAME. + `assemble_name' uses this. */ + +#define ASM_OUTPUT_LABELREF(FILE,NAME) \ + fputs (NAME, FILE) + +/* This says how to output an external. */ + +#define ASM_OUTPUT_EXTERNAL(FILE, DECL, NAME) \ +{ rtx _symref = XEXP (DECL_RTL (DECL), 0); \ + if ((TREE_CODE (DECL) == VAR_DECL \ + || TREE_CODE (DECL) == FUNCTION_DECL) \ + && (NAME)[strlen (NAME) - 1] != ']') \ + { \ + char *_name = (char *) permalloc (strlen (XSTR (_symref, 0)) + 5); \ + strcpy (_name, XSTR (_symref, 0)); \ + strcat (_name, TREE_CODE (DECL) == FUNCTION_DECL ? "[DS]" : "[RW]"); \ + XSTR (_symref, 0) = _name; \ + } \ +} + +/* This is how to output an internal numbered label where + PREFIX is the class of label and NUM is the number within the class. */ + +#define ASM_OUTPUT_INTERNAL_LABEL(FILE,PREFIX,NUM) \ + fprintf (FILE, "%s..%d:\n", PREFIX, NUM) + +/* This is how to output a label for a jump table. Arguments are the same as + for ASM_OUTPUT_INTERNAL_LABEL, except the insn for the jump table is + passed. */ + +#define ASM_OUTPUT_CASE_LABEL(FILE,PREFIX,NUM,TABLEINSN) \ +{ ASM_OUTPUT_ALIGN (FILE, 2); ASM_OUTPUT_INTERNAL_LABEL (FILE, PREFIX, NUM); } + +/* This is how to store into the string LABEL + the symbol_ref name of an internal numbered label where + PREFIX is the class of label and NUM is the number within the class. + This is suitable for output with `assemble_name'. */ + +#define ASM_GENERATE_INTERNAL_LABEL(LABEL,PREFIX,NUM) \ + sprintf (LABEL, "*%s..%d", PREFIX, NUM) + +/* This is how to output an assembler line to define N characters starting + at P to FILE. */ + +#define ASM_OUTPUT_ASCII(FILE, P, N) output_ascii ((FILE), (P), (N)) + +/* This is how to advance the location counter by SIZE bytes. */ + +#define ASM_OUTPUT_SKIP(FILE,SIZE) \ + fprintf (FILE, "\t.space %d\n", (SIZE)) + +/* This says how to output an assembler line + to define a global common symbol. */ + +#define ASM_OUTPUT_ALIGNED_COMMON(FILE, NAME, SIZE, ALIGNMENT) \ + do { fputs (".comm ", (FILE)); \ + RS6000_OUTPUT_BASENAME ((FILE), (NAME)); \ + if ( (SIZE) > 4) \ + fprintf ((FILE), ",%d,3\n", (SIZE)); \ + else \ + fprintf( (FILE), ",%d\n", (SIZE)); \ + } while (0) + diff --git a/gcc/config/rs6000/rs6000.h b/gcc/config/rs6000/rs6000.h index 6c94ea8053b..aca28456f7d 100644 --- a/gcc/config/rs6000/rs6000.h +++ b/gcc/config/rs6000/rs6000.h @@ -2341,42 +2341,6 @@ extern int rs6000_trunc_used; the end of the line. */ #define ASM_COMMENT_START " #" -/* Output at beginning of assembler file. - - Initialize the section names for the RS/6000 at this point. - - Specify filename, including full path, to assembler. - - We want to go into the TOC section so at least one .toc will be emitted. - Also, in order to output proper .bs/.es pairs, we need at least one static - [RW] section emitted. - - We then switch back to text to force the gcc2_compiled. label and the space - allocated after it (when profiling) into the text section. - - Finally, declare mcount when profiling to make the assembler happy. */ - -#define ASM_FILE_START(FILE) \ -{ \ - rs6000_gen_section_name (&xcoff_bss_section_name, \ - main_input_filename, ".bss_"); \ - rs6000_gen_section_name (&xcoff_private_data_section_name, \ - main_input_filename, ".rw_"); \ - rs6000_gen_section_name (&xcoff_read_only_section_name, \ - main_input_filename, ".ro_"); \ - \ - fprintf (FILE, "\t.file\t\"%s\"\n", main_input_filename); \ - if (TARGET_64BIT) \ - fputs ("\t.machine\t\"ppc64\"\n", FILE); \ - toc_section (); \ - if (write_symbols != NO_DEBUG) \ - private_data_section (); \ - text_section (); \ - if (profile_flag) \ - fprintf (FILE, "\t.extern %s\n", RS6000_MCOUNT); \ - rs6000_file_start (FILE, TARGET_CPU_DEFAULT); \ -} - /* We define this to prevent the name mangler from putting dollar signs into function names. */ @@ -2412,46 +2376,6 @@ extern int rs6000_trunc_used; /* Flag to say the TOC is initialized */ extern int toc_initialized; -/* This macro produces the initial definition of a function name. - On the RS/6000, we need to place an extra '.' in the function name and - output the function descriptor. - - The csect for the function will have already been created by the - `text_section' call previously done. We do have to go back to that - csect, however. - - The third and fourth parameters to the .function pseudo-op (16 and 044) - are placeholders which no longer have any use. */ - -#define ASM_DECLARE_FUNCTION_NAME(FILE,NAME,DECL) \ -{ if (TREE_PUBLIC (DECL)) \ - { \ - fputs ("\t.globl .", FILE); \ - RS6000_OUTPUT_BASENAME (FILE, NAME); \ - putc ('\n', FILE); \ - } \ - else \ - { \ - fputs ("\t.lglobl .", FILE); \ - RS6000_OUTPUT_BASENAME (FILE, NAME); \ - putc ('\n', FILE); \ - } \ - fputs ("\t.csect ", FILE); \ - RS6000_OUTPUT_BASENAME (FILE, NAME); \ - fputs (TARGET_32BIT ? "[DS]\n" : "[DS],3\n", FILE); \ - RS6000_OUTPUT_BASENAME (FILE, NAME); \ - fputs (":\n", FILE); \ - fputs (TARGET_32BIT ? "\t.long ." : "\t.llong .", FILE); \ - RS6000_OUTPUT_BASENAME (FILE, NAME); \ - fputs (", TOC[tc0], 0\n", FILE); \ - fputs (TARGET_32BIT \ - ? "\t.csect .text[PR]\n." : "\t.csect .text[PR],3\n.", FILE); \ - RS6000_OUTPUT_BASENAME (FILE, NAME); \ - fputs (":\n", FILE); \ - if (write_symbols == XCOFF_DEBUG) \ - xcoffout_declare_function (FILE, DECL, NAME); \ -} - /* Return non-zero if this entry is to be written into the constant pool in a special way. We do so if this is a SYMBOL_REF, LABEL_REF or a CONST containing one of them. If -mfp-in-toc (the default), we also do @@ -2474,19 +2398,6 @@ extern int toc_initialized; && BITS_PER_WORD == HOST_BITS_PER_INT))) #endif -/* Select section for constant in constant pool. - - On RS/6000, all constants are in the private read-only data area. - However, if this is being placed in the TOC it must be output as a - toc entry. */ - -#define SELECT_RTX_SECTION(MODE, X) \ -{ if (ASM_OUTPUT_SPECIAL_POOL_ENTRY_P (X)) \ - toc_section (); \ - else \ - read_only_private_data_section (); \ -} - /* Macro to output a special constant pool entry. Go to WIN if we output it. Otherwise, it is written the usual way. @@ -2718,39 +2629,12 @@ extern char rs6000_reg_names[][8]; /* register names (0 vs. %r0). */ do { fputs ("\t.globl ", FILE); \ RS6000_OUTPUT_BASENAME (FILE, NAME); putc ('\n', FILE);} while (0) -/* This is how to output a reference to a user-level label named NAME. - `assemble_name' uses this. */ - -#define ASM_OUTPUT_LABELREF(FILE,NAME) \ - fputs (NAME, FILE) - -/* This is how to output an internal numbered label where - PREFIX is the class of label and NUM is the number within the class. */ - -#define ASM_OUTPUT_INTERNAL_LABEL(FILE,PREFIX,NUM) \ - fprintf (FILE, "%s..%d:\n", PREFIX, NUM) - /* This is how to output an internal label prefix. rs6000.c uses this when generating traceback tables. */ #define ASM_OUTPUT_INTERNAL_LABEL_PREFIX(FILE,PREFIX) \ fprintf (FILE, "%s..", PREFIX) -/* This is how to output a label for a jump table. Arguments are the same as - for ASM_OUTPUT_INTERNAL_LABEL, except the insn for the jump table is - passed. */ - -#define ASM_OUTPUT_CASE_LABEL(FILE,PREFIX,NUM,TABLEINSN) \ -{ ASM_OUTPUT_ALIGN (FILE, 2); ASM_OUTPUT_INTERNAL_LABEL (FILE, PREFIX, NUM); } - -/* This is how to store into the string LABEL - the symbol_ref name of an internal numbered label where - PREFIX is the class of label and NUM is the number within the class. - This is suitable for output with `assemble_name'. */ - -#define ASM_GENERATE_INTERNAL_LABEL(LABEL,PREFIX,NUM) \ - sprintf (LABEL, "*%s..%d", PREFIX, NUM) - /* This is how to output an assembler line defining a `double' constant. */ #define ASM_OUTPUT_DOUBLE(FILE, VALUE) \ @@ -2811,11 +2695,6 @@ do { \ #define ASM_OUTPUT_BYTE(FILE,VALUE) \ fprintf (FILE, "\t.byte 0x%x\n", (VALUE)) -/* This is how to output an assembler line to define N characters starting - at P to FILE. */ - -#define ASM_OUTPUT_ASCII(FILE, P, N) output_ascii ((FILE), (P), (N)) - /* This is how to output an element of a case-vector that is absolute. (RS/6000 does not use such vectors, but we must define this macro anyway.) */ @@ -2849,21 +2728,6 @@ do { \ if ((LOG) != 0) \ fprintf (FILE, "\t.align %d\n", (LOG)) -#define ASM_OUTPUT_SKIP(FILE,SIZE) \ - fprintf (FILE, "\t.space %d\n", (SIZE)) - -/* This says how to output an assembler line - to define a global common symbol. */ - -#define ASM_OUTPUT_ALIGNED_COMMON(FILE, NAME, SIZE, ALIGNMENT) \ - do { fputs (".comm ", (FILE)); \ - RS6000_OUTPUT_BASENAME ((FILE), (NAME)); \ - if ( (SIZE) > 4) \ - fprintf ((FILE), ",%d,3\n", (SIZE)); \ - else \ - fprintf( (FILE), ",%d\n", (SIZE)); \ - } while (0) - /* This says how to output an assembler line to define a local common symbol. Alignment cannot be specified, but we can try to maintain |