X-Git-Url: http://git.sourceforge.jp/view?p=pf3gnuchains%2Fgcc-fork.git;a=blobdiff_plain;f=gcc%2Fconfig%2Fm68k%2Fhp320.h;h=7a18c52256a80ef0136af81c1d65367102774750;hp=4b5afcb0f56d5b0e380245327595705c76afc575;hb=6cde52a223b2e66a6fc4fe46c098cbde8b340c25;hpb=137a039c12795e9daf1d5b824cfbbc562245b59f diff --git a/gcc/config/m68k/hp320.h b/gcc/config/m68k/hp320.h index 4b5afcb0f56..7a18c52256a 100644 --- a/gcc/config/m68k/hp320.h +++ b/gcc/config/m68k/hp320.h @@ -1,5 +1,6 @@ /* Definitions of target machine for GNU compiler. HP-UX 68000/68020 version. - Copyright (C) 1987, 1988, 1993, 1994 Free Software Foundation, Inc. + Copyright (C) 1987, 1988, 1993, 1994, 1995, 1996, 1997, 1999, 2000, 2002 + Free Software Foundation, Inc. This file is part of GNU CC. @@ -15,7 +16,8 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License along with GNU CC; see the file COPYING. If not, write to -the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */ +the Free Software Foundation, 59 Temple Place - Suite 330, +Boston, MA 02111-1307, USA. */ /* Define USE_GAS if GCC is supposed to work with the GNU assembler, GNU linker and GNU debugger using DBX debugging information. @@ -55,16 +57,15 @@ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */ /* Be compatible with system stddef.h. */ #define SIZE_TYPE "unsigned int" -/* Use atexit for static constructors/destructors, instead of defining - our own exit function. */ -#define HAVE_ATEXIT - #include "m68k/m68k.h" +#undef INT_OP_GROUP +#define INT_OP_GROUP INT_OP_NO_DOT + /* See m68k.h. 7 means 68020 with 68881. */ #ifndef TARGET_DEFAULT -#define TARGET_DEFAULT 7 +#define TARGET_DEFAULT (MASK_BITFIELD|MASK_68881|MASK_68020) #endif /* Define __HAVE_68881__ in preprocessor, unless -msoft-float is specified. @@ -74,12 +75,14 @@ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */ #define ASM_SPEC "%{m68000:+X}%{mc68000:+X}" -#if TARGET_DEFAULT & 02 /* -m68881 is the default */ +#define NO_DOT_IN_LABEL + +#if TARGET_DEFAULT & MASK_68881 /* -m68881 is the default */ /* These definitions differ from those used for GAS by defining __HPUX_ASM__. This is needed because some programs, particularly GDB, need to know which assembler is being used so that the correct `asm' - instructions can be used. */ + instructions can be used. */ #define CPP_SPEC \ "%{!msoft-float:-D__HAVE_68881__ }\ @@ -95,7 +98,7 @@ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */ #else /* not HPUX_ASM */ -#if TARGET_DEFAULT & 02 /* -m68881 is the default */ +#if TARGET_DEFAULT & MASK_68881 /* -m68881 is the default */ #define CPP_SPEC \ "%{!msoft-float:-D__HAVE_68881__ }\ @@ -127,13 +130,13 @@ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */ /* These are the ones defined by HPUX cc, plus mc68000 for uniformity with GCC on other 68000 systems. */ -#define CPP_PREDEFINES "-Dhp9000s200 -Dhp9000s300 -DPWB -Dhpux -Dunix -D__hp9000s300 -D__hp9000s200 -D__PWB -D__hpux -D__unix -D__motorola__ -Asystem(unix) -Asystem(hpux) -Acpu(m68k) -Amachine(m68k)" +#define CPP_PREDEFINES "-Dhp9000s200 -Dhp9000s300 -DPWB -Dhpux -Dunix -D__hp9000s300 -D__hp9000s200 -D__PWB -D__hpux -D__unix -D__motorola__ -Asystem=unix -Asystem=hpux -Acpu=m68k -Amachine=m68k" /* Every structure or union's size must be a multiple of 2 bytes. */ #define STRUCTURE_SIZE_BOUNDARY 16 -/* hpux doesn't use static area for struct returns. */ +/* hpux doesn't use static area for struct returns. */ #undef PCC_STATIC_STRUCT_RETURN /* Generate calls to memcpy, memcmp and memset. */ @@ -154,8 +157,6 @@ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */ #undef TARGET_VERSION #undef REGISTER_NAMES -#undef FUNCTION_PROLOGUE -#undef FUNCTION_EPILOGUE #undef ASM_OUTPUT_REG_PUSH #undef ASM_OUTPUT_REG_POP #undef ASM_FILE_START @@ -163,13 +164,7 @@ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */ #undef ASM_APP_OFF #undef TEXT_SECTION_ASM_OP #undef DATA_SECTION_ASM_OP -#undef READONLY_DATA_SECTION -#undef ASM_OUTPUT_DOUBLE -#undef ASM_OUTPUT_FLOAT -#undef ASM_OUTPUT_INT -#undef ASM_OUTPUT_SHORT -#undef ASM_OUTPUT_CHAR -#undef ASM_OUTPUT_BYTE +#undef READONLY_DATA_SECTION_ASM_OP #undef ASM_OUTPUT_ADDR_VEC_ELT #undef ASM_OUTPUT_ADDR_DIFF_ELT #undef ASM_OUTPUT_ALIGN @@ -177,11 +172,11 @@ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */ #undef ASM_OUTPUT_COMMON #undef ASM_OUTPUT_LOCAL #undef ASM_FORMAT_PRIVATE_NAME -#undef PRINT_OPERAND -#undef PRINT_OPERAND_ADDRESS #undef FUNCTION_PROFILER #undef ASM_OUTPUT_INTERNAL_LABEL #undef GLOBAL_ASM_OP +#undef IMMEDIATE_PREFIX +#undef REGISTER_PREFIX #define TARGET_VERSION fprintf (stderr, " (68k, SGS/hpux syntax)"); @@ -190,100 +185,12 @@ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */ "%a0", "%a1", "%a2", "%a3", "%a4", "%a5", "%fp", "%sp", \ "%fp0", "%fp1", "%fp2", "%fp3", "%fp4", "%fp5", "%fp6", "%fp7"} -#define FUNCTION_PROLOGUE(FILE, SIZE) \ -{ register int regno; \ - register int mask = 0; \ - extern char call_used_regs[]; \ - int fsize = (SIZE); \ - if (frame_pointer_needed) \ - { if (fsize < 0x8000) \ - fprintf (FILE, "\tlink.w %%a6,&%d\n", -fsize); \ - else if (TARGET_68020) \ - fprintf (FILE, "\tlink.l %%a6,&%d\n", -fsize); \ - else \ - fprintf (FILE, "\tlink.w %%a6,&0\n\tsub.l &%d,%%sp\n", fsize); } \ - for (regno = 16; regno < FIRST_PSEUDO_REGISTER; regno++) \ - if (regs_ever_live[regno] && ! call_used_regs[regno]) \ - mask |= 1 << (regno - 16); \ - if (mask != 0) \ - fprintf (FILE, "\tfmovem &0x%x,-(%%sp)\n", mask & 0xff); \ - mask = 0; \ - for (regno = 0; regno < 16; regno++) \ - if (regs_ever_live[regno] && ! call_used_regs[regno]) \ - mask |= 1 << (15 - regno); \ - if (frame_pointer_needed) \ - mask &= ~ (1 << (15-FRAME_POINTER_REGNUM)); \ - if (exact_log2 (mask) >= 0) \ - fprintf (FILE, "\tmov.l %s,-(%%sp)\n", reg_names[15 - exact_log2 (mask)]); \ - else if (mask) fprintf (FILE, "\tmovm.l &0x%x,-(%%sp)\n", mask); }\ - if (flag_pic && current_function_uses_pic_offset_table) \ - { \ - fprintf (FILE, "\tmov.l &DLT, %s\n",\ - reg_names[PIC_OFFSET_TABLE_REGNUM]); \ - fprintf (FILE, "\tlea.l -0x6(%%pc,%s.l),%s\n", \ - reg_names[PIC_OFFSET_TABLE_REGNUM], \ - reg_names[PIC_OFFSET_TABLE_REGNUM]); \ - } +#define IMMEDIATE_PREFIX "&" +#define REGISTER_PREFIX "%" #define FUNCTION_PROFILER(FILE, LABEL_NO) \ fprintf (FILE, "\tmov.l &LP%d,%%a0\n\tjsr mcount\n", (LABEL_NO)); -#define FUNCTION_EPILOGUE(FILE, SIZE) \ -{ register int regno; \ - register int mask, fmask; \ - register int nregs; \ - int offset, foffset; \ - extern char call_used_regs[]; \ - int fsize = (SIZE); \ - int big = 0; \ - nregs = 0; fmask = 0; \ - for (regno = 16; regno < FIRST_PSEUDO_REGISTER; regno++) \ - if (regs_ever_live[regno] && ! call_used_regs[regno]) \ - { nregs++; fmask |= 1 << (23 - regno); } \ - foffset = nregs * 12; \ - nregs = 0; mask = 0; \ - if (frame_pointer_needed) regs_ever_live[FRAME_POINTER_REGNUM] = 0; \ - for (regno = 0; regno < 16; regno++) \ - if (regs_ever_live[regno] && ! call_used_regs[regno]) \ - { nregs++; mask |= 1 << regno; } \ - offset = foffset + nregs * 4; \ - if (offset + fsize >= 0x8000 && frame_pointer_needed) \ - { fprintf (FILE, "\tmov.l &%d,%%a0\n", -fsize); \ - fsize = 0, big = 1; } \ - if (exact_log2 (mask) >= 0) { \ - if (big) \ - fprintf (FILE, "\tmov.l -%d(%%a6,%%a0.l),%s\n", \ - offset + fsize, reg_names[exact_log2 (mask)]); \ - else if (! frame_pointer_needed) \ - fprintf (FILE, "\tmov.l (%%sp)+,%s\n", \ - reg_names[exact_log2 (mask)]); \ - else \ - fprintf (FILE, "\tmov.l -%d(%%a6),%s\n", \ - offset + fsize, reg_names[exact_log2 (mask)]); } \ - else if (mask) { \ - if (big) \ - fprintf (FILE, "\tmovm.l -%d(%%a6,%%a0.l),&0x%x\n", \ - offset + fsize, mask); \ - else if (! frame_pointer_needed) \ - fprintf (FILE, "\tmovm.l (%%sp)+,&0x%x\n", mask); \ - else \ - fprintf (FILE, "\tmovm.l -%d(%%a6),&0x%x\n", \ - offset + fsize, mask); } \ - if (fmask) { \ - if (big) \ - fprintf (FILE, "\tfmovem -%d(%%a6,%%a0.l),&0x%x\n", \ - foffset + fsize, fmask); \ - else if (! frame_pointer_needed) \ - fprintf (FILE, "\tfmovem (%%sp)+,&0x%x\n", fmask); \ - else \ - fprintf (FILE, "\tfmovem -%d(%%a6),&0x%x\n", \ - foffset + fsize, fmask); } \ - if (frame_pointer_needed) \ - fprintf (FILE, "\tunlk %%a6\n"); \ - if (current_function_pops_args) \ - fprintf (FILE, "\trtd &%d\n", current_function_pops_args); \ - else fprintf (FILE, "\trts\n"); } - /* This is how to output an insn to push a register on the stack. It need not be very fast code. */ @@ -319,13 +226,12 @@ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */ #define TEXT_SECTION_ASM_OP "text" #define DATA_SECTION_ASM_OP "data" #endif -#define READONLY_DATA_SECTION data_section -#define ASCII_DATA_ASM_OP "byte" +#define ASCII_DATA_ASM_OP "\tbyte\t" /* This is the command to make the user-level label named NAME defined for reference from other files. */ -#define GLOBAL_ASM_OP "global" +#define GLOBAL_ASM_OP "\tglobal\t" /* This says how to output an assembler line to define a global common symbol. */ @@ -358,60 +264,19 @@ do{ if (PREFIX[0] == 'L' && PREFIX[1] == 'I') \ fprintf (FILE, "%s%d:\n", PREFIX, NUM); \ } while(0) -#define ASM_OUTPUT_DOUBLE(FILE, VALUE) \ - do { char dstr[30]; \ - REAL_VALUE_TO_DECIMAL (VALUE, "%.20g", dstr); \ - fprintf (FILE, "\tdouble 0f%s\n", dstr); \ - } while (0) - -#define ASM_OUTPUT_FLOAT(FILE, VALUE) \ - do { char dstr[30]; \ - REAL_VALUE_TO_DECIMAL (VALUE, "%.9g", dstr); \ - fprintf (FILE, "\tfloat 0f%s\n", dstr); \ - } while (0) - -#undef ASM_OUTPUT_LONG_DOUBLE -#define ASM_OUTPUT_LONG_DOUBLE(FILE,VALUE) \ -do { long l[3]; \ - REAL_VALUE_TO_TARGET_LONG_DOUBLE (VALUE, l); \ - fprintf (FILE, "\tlong 0x%x,0x%x,0x%x\n", l[0], l[1], l[2]); \ - } while (0) - -/* This is how to output an assembler line defining an `int' constant. */ - -#define ASM_OUTPUT_INT(FILE,VALUE) \ -( fprintf (FILE, "\tlong "), \ - output_addr_const (FILE, (VALUE)), \ - fprintf (FILE, "\n")) - -/* Likewise for `char' and `short' constants. */ - -#define ASM_OUTPUT_SHORT(FILE,VALUE) \ -( fprintf (FILE, "\tshort "), \ - output_addr_const (FILE, (VALUE)), \ - fprintf (FILE, "\n")) - -#define ASM_OUTPUT_CHAR(FILE,VALUE) \ -( fprintf (FILE, "\tbyte "), \ - output_addr_const (FILE, (VALUE)), \ - fprintf (FILE, "\n")) - -/* This is how to output an assembler line for a numeric constant byte. */ - -#define ASM_OUTPUT_BYTE(FILE,VALUE) \ - fprintf (FILE, "\tbyte 0x%x\n", (VALUE)) - #define ASM_OUTPUT_ADDR_VEC_ELT(FILE, VALUE) \ fprintf (FILE, "\tlong L%d\n", VALUE) -#define ASM_OUTPUT_ADDR_DIFF_ELT(FILE, VALUE, REL) \ +#define ASM_OUTPUT_ADDR_DIFF_ELT(FILE, BODY, VALUE, REL) \ fprintf (FILE, "\tshort L%d-L%d\n", VALUE, REL) #define ASM_OUTPUT_ALIGN(FILE,LOG) \ +do { \ if ((LOG) == 1) \ fprintf (FILE, "\tlalign 2\n"); \ else if ((LOG) != 0) \ - abort (); + abort (); \ +} while (0) #define ASM_OUTPUT_SKIP(FILE,SIZE) \ fprintf (FILE, "\tspace %u\n", (SIZE)) @@ -419,23 +284,54 @@ do { long l[3]; \ #define ASM_OUTPUT_SOURCE_FILENAME(FILE, FILENAME) #define ASM_OUTPUT_SOURCE_LINE(FILE, LINENO) +/* Output a float value (represented as a C double) as an immediate operand. + This macro is a 68k-specific macro. */ + +#undef ASM_OUTPUT_FLOAT_OPERAND #ifdef AS_BUG_FLOATING_CONSTANT -#define PRINT_OPERAND_FLOAT(CODE,FILE,VALUE,INT) \ - do { REAL_VALUE_TO_TARGET_SINGLE (VALUE, INT); \ - fprintf (FILE, "&0x%x", INT); } while (0) +#define ASM_OUTPUT_FLOAT_OPERAND(CODE,FILE,VALUE) \ + do { long l; \ + REAL_VALUE_TO_TARGET_SINGLE (VALUE, l); \ + fprintf ((FILE), "&0x%lx", l); \ + } while (0) #else -#define PRINT_OPERAND_FLOAT(CODE,FILE,VALUE,INT) \ - do { if (CODE == 'f') \ - { char dstr[30]; \ - REAL_VALUE_TO_DECIMAL (VALUE, "%.9g", dstr); \ - fprintf (FILE, "&0f%s", dstr); \ - } \ - else \ - { \ - REAL_VALUE_TO_TARGET_SINGLE (VALUE, INT); \ - fprintf (FILE, "&0x%x", INT); } } while (0) +#define ASM_OUTPUT_FLOAT_OPERAND(CODE,FILE,VALUE) \ + do { \ + if (CODE == 'f') \ + { \ + char dstr[30]; \ + REAL_VALUE_TO_DECIMAL (VALUE, "%.9g", dstr); \ + fprintf ((FILE), "&0f%s", dstr); \ + } \ + else \ + { \ + long l; \ + REAL_VALUE_TO_TARGET_SINGLE (VALUE, l); \ + fprintf ((FILE), "&0x%lx", l); \ + } \ + } while (0) #endif /* AS_BUG_FLOATING_CONSTANT */ +/* Output a double value (represented as a C double) as an immediate operand. + This macro is a 68k-specific macro. */ +#undef ASM_OUTPUT_DOUBLE_OPERAND +#define ASM_OUTPUT_DOUBLE_OPERAND(FILE,VALUE) \ + do { char dstr[30]; \ + REAL_VALUE_TO_DECIMAL (VALUE, "%.20g", dstr); \ + fprintf (FILE, "&0f%s", dstr); \ + } while (0) + +/* Note, long double immediate operands are not actually + generated by m68k.md. */ +#undef ASM_OUTPUT_LONG_DOUBLE_OPERAND +#define ASM_OUTPUT_LONG_DOUBLE_OPERAND(FILE,VALUE) \ + do { char dstr[30]; \ + REAL_VALUE_TO_DECIMAL (VALUE, "%.20g", dstr); \ + fprintf (FILE, "&0f%s", dstr); \ + } while (0) + +#if 0 +#undef PRINT_OPERAND #define PRINT_OPERAND(FILE, X, CODE) \ { if (CODE == '.') fprintf (FILE, "."); \ else if (CODE == '#') fprintf (FILE, "&"); \ @@ -466,7 +362,9 @@ do { long l[3]; \ REAL_VALUE_TO_DECIMAL (r, "%.20g", dstr); \ fprintf (FILE, "&0f%s", dstr); } \ else { putc ('&', FILE); output_addr_const (FILE, X); }} +#endif +#undef PRINT_OPERAND_ADDRESS #define PRINT_OPERAND_ADDRESS(FILE, ADDR) \ { register rtx reg1, reg2, breg, ireg; \ register rtx addr = ADDR; \ @@ -605,11 +503,11 @@ do { long l[3]; \ output_addr_const (FILE, addr); \ }} -#define ASM_OUTPUT_ASCII(f, p, size) \ -do { register int i; \ +#define ASM_OUTPUT_ASCII(f, p, SIZE) \ +do { size_t i, limit = (SIZE); \ int inside; \ inside = FALSE; \ - for (i = 0; i < (size); i++) { \ + for (i = 0; i < limit; i++) { \ if (i % 8 == 0) { \ if (i != 0) { \ if (inside) \ @@ -617,7 +515,7 @@ do { register int i; \ putc('\n', (f)); \ inside = FALSE; \ } \ - fprintf((f), "\t%s ", ASCII_DATA_ASM_OP); \ + fprintf((f), "%s", ASCII_DATA_ASM_OP); \ } \ if ((p)[i] < 32 || (p)[i] == '\\' || (p)[i] == '"' || (p)[i] == 127) { \ if (inside) { \ @@ -665,10 +563,6 @@ do { register int i; \ { fprintf ((FILE), "mov"); (PTR) += 4; } \ } -/* Prevent output of `gcc_compiled.:'. */ - -#define ASM_IDENTIFY_GCC(FILE) - #else /* not HPUX_ASM */ #undef FUNCTION_PROFILER @@ -681,13 +575,19 @@ do { register int i; \ (LABEL_NO)); #endif /* not HPUX_ASM */ + /* In m68k svr4, a symbol_ref rtx can be a valid PIC operand if it is an - operand of a function call. */ + operand of a function call. */ #undef LEGITIMATE_PIC_OPERAND_P #define LEGITIMATE_PIC_OPERAND_P(X) \ - (! symbolic_operand (X, VOIDmode) \ - || ((GET_CODE(X) == SYMBOL_REF) && SYMBOL_REF_FLAG(X))) - -/* hpux8 and later have C++ compatable include files, so do not + ((! symbolic_operand (X, VOIDmode) \ + && ! (GET_CODE (X) == CONST_DOUBLE && mem_for_const_double (X) != 0 \ + && GET_CODE (mem_for_const_double (X)) == MEM \ + && symbolic_operand (XEXP (mem_for_const_double (X), 0), \ + VOIDmode))) \ + || (GET_CODE (X) == SYMBOL_REF && SYMBOL_REF_FLAG (X)) \ + || PCREL_GENERAL_OPERAND_OK) + +/* hpux8 and later have C++ compatible include files, so do not pretend they are `extern "C"'. */ #define NO_IMPLICIT_EXTERN_C