--- gcc/config/m68k/hp320.h 2018/04/24 18:10:24 1.1.1.1 +++ gcc/config/m68k/hp320.h 2018/04/24 18:28:02 1.1.1.4 @@ -1,5 +1,5 @@ /* Definitions of target machine for GNU compiler. HP-UX 68000/68020 version. - Copyright (C) 1987, 1988 Free Software Foundation, Inc. + Copyright (C) 1987, 1988, 1993, 1994, 1995 Free Software Foundation, Inc. This file is part of GNU CC. @@ -15,7 +15,8 @@ GNU General Public License for more deta 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. @@ -43,13 +44,14 @@ the Free Software Foundation, 675 Mass A #define AS_BUG_TRAILING_LABEL #endif +#endif /* not USE_GAS */ + /* gcc.c should find libgcc.a itself rather than expecting linker to. */ #define LINK_LIBGCC_SPECIAL /* The arguments of -L must be a separate argv element. */ #define SPACE_AFTER_L_OPTION /* HP/UX doesn't have libg.a. */ #define LIB_SPEC "%{!p:%{!pg:-lc}}%{p:-lc_p}%{pg:-lc_p}" -#endif /* Be compatible with system stddef.h. */ #define SIZE_TYPE "unsigned int" @@ -73,6 +75,8 @@ the Free Software Foundation, 675 Mass A #define ASM_SPEC "%{m68000:+X}%{mc68000:+X}" +#define NO_DOT_IN_LABEL + #if TARGET_DEFAULT & 02 /* -m68881 is the default */ /* These definitions differ from those used for GAS by defining __HPUX_ASM__. @@ -118,12 +122,15 @@ the Free Software Foundation, 675 Mass A #endif /* Not HPUX_ASM */ +/* Translate -static for HPUX linker. */ +#define LINK_SPEC "%{static:-a archive}" + /* Names to predefine in the preprocessor for this target machine (for non-strict-ANSI programs only). */ /* 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" +#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. */ @@ -150,8 +157,6 @@ the Free Software Foundation, 675 Mass A #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 @@ -159,6 +164,7 @@ the Free Software Foundation, 675 Mass A #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 @@ -177,6 +183,8 @@ the Free Software Foundation, 675 Mass A #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)"); @@ -185,92 +193,12 @@ the Free Software Foundation, 675 Mass A "%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); } +#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. */ @@ -306,7 +234,6 @@ the Free Software Foundation, 675 Mass A #define TEXT_SECTION_ASM_OP "text" #define DATA_SECTION_ASM_OP "data" #endif - #define ASCII_DATA_ASM_OP "byte" /* This is the command to make the user-level label named NAME @@ -593,7 +520,7 @@ do { long l[3]; \ }} #define ASM_OUTPUT_ASCII(f, p, size) \ -{ register int i; \ +do { register int i; \ int inside; \ inside = FALSE; \ for (i = 0; i < (size); i++) { \ @@ -627,7 +554,7 @@ do { long l[3]; \ if (inside) \ putc('"', (f)); \ putc('\n', (f)); \ -} +} while (0) /* Translate Motorola opcodes such as `jbeq' into SGS opcodes such as `beq.w'. @@ -663,8 +590,22 @@ do { long l[3]; \ /* HP-UX needs the call to mcount before the link instruction. Copy the return address onto the stack before the call to fake it out. */ #define FUNCTION_PROFILER(FILE, LABEL_NO) \ - fprintf (FILE, "\tmovel a6@(4),sp@-\n" \ - "\tmovl #LP%d,a0\n\tjsr mcount\n" \ - "\taddqw #4,sp\n", (LABEL_NO)); + fprintf (FILE, \ + "\tmovel a6@(4),sp@-\n\tmovl #LP%d,a0\n\tjsr mcount\n\taddqw #4,sp\n", \ + (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. */ +#undef LEGITIMATE_PIC_OPERAND_P +#define LEGITIMATE_PIC_OPERAND_P(X) \ + ((! symbolic_operand (X, VOIDmode) \ + && ! (GET_CODE (X) == CONST_DOUBLE && CONST_DOUBLE_MEM (X) \ + && GET_CODE (CONST_DOUBLE_MEM (X)) == MEM \ + && symbolic_operand (XEXP (CONST_DOUBLE_MEM (X), 0), VOIDmode))) \ + || (GET_CODE (X) == SYMBOL_REF && SYMBOL_REF_FLAG (X))) + +/* hpux8 and later have C++ compatible include files, so do not + pretend they are `extern "C"'. */ +#define NO_IMPLICIT_EXTERN_C