home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Fresh Fish 7
/
FreshFishVol7.bin
/
bbs
/
gnu
/
gcc-2.3.3-src.lha
/
GNU
/
src
/
amiga
/
gcc-2.3.3
/
config
/
hp320.h
< prev
next >
Wrap
C/C++ Source or Header
|
1994-02-06
|
22KB
|
664 lines
/* Definitions of target machine for GNU compiler. HP-UX 68000/68020 version.
Copyright (C) 1987, 1988 Free Software Foundation, Inc.
This file is part of GNU CC.
GNU CC is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2, or (at your option)
any later version.
GNU CC is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
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. */
/* Define USE_GAS if GCC is supposed to work with the GNU assembler,
GNU linker and GNU debugger using DBX debugging information.
(In other words, much of HPUX has been cast aside.)
Undefine USE_GAS if you want GCC to feed the HP assembler. */
/* #define USE_GAS */ /* Use hp320g.h if you want this. */
/* Control assembler-syntax conditionals in m68k.md. */
#ifndef USE_GAS
#define MOTOROLA /* Use Motorola syntax rather than "MIT" */
#define SGS /* Uses SGS assembler */
#define SGS_CMP_ORDER /* Takes cmp operands in reverse order */
#define HPUX_ASM
#if !defined (CROSS_COMPILE) && !defined (NO_BUGS)
/* The assembler on HP 9k3xx machines running HPUX 8.0 doesn't translate
floating point constants behind some operands. The workaround is to
use hex constants. Reported by Thomas Nau (nau@medizin.uni-ulm.de). */
#define AS_BUG_FLOATING_CONSTANT
/* The assembler on HP 9k3xx machines running HPUX 8.0 doesn't accept
labels followed by a text, data, or other section directive. Reported
by Thomas Nau (nau@medizin.uni-ulm.de). */
#define AS_BUG_TRAILING_LABEL
#endif
/* 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"
/* Use atexit for static constructors/destructors, instead of defining
our own exit function. */
#define HAVE_ATEXIT
#include "m68k.h"
/* See m68k.h. 7 means 68020 with 68881. */
#ifndef TARGET_DEFAULT
#define TARGET_DEFAULT 7
#endif
/* Define __HAVE_68881__ in preprocessor, unless -msoft-float is specified.
This will control the use of inline 68881 insns in certain macros. */
#ifdef HPUX_ASM
#define ASM_SPEC "%{m68000:+X}%{mc68000:+X}"
#if TARGET_DEFAULT & 02 /* -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. */
#define CPP_SPEC \
"%{!msoft-float:-D__HAVE_68881__ }\
%{!ansi:%{!mc68000:%{!m68000:-Dmc68020}} -D_HPUX_SOURCE} -D__HPUX_ASM__"
#else /* default is -msoft-float */
#define CPP_SPEC \
"%{m68881:-D__HAVE_68881__ }\
%{!ansi:%{!mc68000:%{!m68000:-Dmc68020}} -D_HPUX_SOURCE} -D__HPUX_ASM__"
#endif /* default is -msoft-float */
#else /* not HPUX_ASM */
#if TARGET_DEFAULT & 02 /* -m68881 is the default */
#define CPP_SPEC \
"%{!msoft-float:-D__HAVE_68881__ }\
%{!ansi:%{!mc68000:%{!m68000:-Dmc68020}} -D_HPUX_SOURCE}"
#else /* default is -msoft-float */
#define CPP_SPEC \
"%{m68881:-D__HAVE_68881__ }\
%{!ansi:%{!mc68000:%{!m68000:-Dmc68020}} -D_HPUX_SOURCE}"
#endif /* default is -msoft-float */
/* -m68000 requires special flags to the assembler. */
#define ASM_SPEC \
"%{m68000:-mc68000}%{mc68000:-mc68000}%{!mc68000:%{!m68000:-mc68020}}"
/* Tell GCC to put a space after -L when generating such options. */
#define SPACE_AFTER_L_OPTION
#endif /* Not HPUX_ASM */
/* 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"
/* 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. */
#undef PCC_STATIC_STRUCT_RETURN
/* Generate calls to memcpy, memcmp and memset. */
#define TARGET_MEM_FUNCTIONS
#if 0 /* No longer correct in HPUX version 6.5. */
/* Function calls don't save any fp registers on hpux. */
#undef CALL_USED_REGISTERS
#define CALL_USED_REGISTERS \
{1, 1, 0, 0, 0, 0, 0, 0, \
1, 1, 0, 0, 0, 0, 0, 1, \
1, 1, 1, 1, 1, 1, 1, 1}
#endif /* 0 */
#ifdef HPUX_ASM
/* Override parts of m68k.h to fit the HPUX assembler. */
#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
#undef ASM_APP_ON
#undef ASM_APP_OFF
#undef TEXT_SECTION_ASM_OP
#undef DATA_SECTION_ASM_OP
#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 ASM_OUTPUT_ADDR_VEC_ELT
#undef ASM_OUTPUT_ADDR_DIFF_ELT
#undef ASM_OUTPUT_ALIGN
#undef ASM_OUTPUT_SKIP
#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
#define TARGET_VERSION fprintf (stderr, " (68k, SGS/hpux syntax)");
#define REGISTER_NAMES \
{"%d0", "%d1", "%d2", "%d3", "%d4", "%d5", "%d6", "%d7", \
"%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 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); \
fsi