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
/
mot3300.h
< prev
next >
Wrap
C/C++ Source or Header
|
1994-02-06
|
28KB
|
796 lines
/* Definitions of target machine for GNU compiler.
SysV68 Motorola 3300 Delta Series
Written by Abramo and Roberto Bagnara
after Alex Crain's 3B1 definitions.
Bug reports to bagnara@dipisa.di.unipi.it
Copyright (C) 1987 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 MOTOROLA /* Use Motorola syntax rather than "MIT" */
#define SGS /* Uses SGS assembler */
#define SGS_CMP_ORDER /* Takes cmp operands in reverse order */
#define SGS_SWAP_W /* Use swap.w rather than just plain swap */
#define SGS_SWITCH_TABLES /* Different switch table handling */
#include "m68k.h"
/* See m68k.h. 7 means 68020 with 68881. */
#ifndef TARGET_DEFAULT
#define TARGET_DEFAULT 7
#endif
/* NYI: FP= is equivalent to -msoft-float */
/* We use /lib/libp/lib* when profiling. */
/* NYI: if FP=M68881U library is -lc881u */
/* NYI: if FP= library is -lc. */
/* Default for us: FP=M68881 library is -lc881 */
#undef LIB_SPEC
#define LIB_SPEC "%{!shlib:%{p:-L/usr/lib/libp} %{pg:-L/usr/lib/libp} -lc881}"
#define CPP_SPEC "%{!msoft-float:-D__HAVE_68881__}"
/* Shared libraries need to use crt0s.o */
#undef STARTFILE_SPEC
#define STARTFILE_SPEC \
"%{!shlib:%{pg:mcrt0.o%s}%{!pg:%{p:mcrt0.o%s}%{!p:crt0.o%s}}}\
%{shlib:crt0s.o%s shlib.ifile%s} "
/* Generate calls to memcpy, memcmp and memset. */
#define TARGET_MEM_FUNCTIONS
/* size_t is unsigned int. */
#define SIZE_TYPE "unsigned int"
/* Every structure or union's size must be a multiple of 2 bytes. */
#define STRUCTURE_SIZE_BOUNDARY 16
/* cpp has to support a #sccs directive for the /usr/include files */
#define SCCS_DIRECTIVE
/* Make output for SDB. */
#define SDB_DEBUGGING_INFO
#undef REGISTER_NAMES
#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"}
#undef FUNCTION_PROLOGUE
#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 %%fp,&%d\n", -fsize); \
else if (TARGET_68020) \
fprintf (FILE, "\tlink.l %%fp,&%d\n", -fsize); \
else \
fprintf (FILE, "\tlink.w %%fp,&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); }
#undef FUNCTION_PROFILER
#define FUNCTION_PROFILER(FILE, LABEL_NO) \
fprintf (FILE, "\tmov.l &LP%%%d,%%a0\n\tjsr mcount%%\n", (LABEL_NO))
#undef FUNCTION_EPILOGUE
#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(%%fp,%%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(%%fp),%s\n", \
offset + fsize, reg_names[exact_log2 (mask)]); } \
else if (mask) { \
if (big) \
fprintf (FILE, "\tmovm.l -%d(%%fp,%%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(%%fp),&0x%x\n", \
offset + fsize, mask); } \
if (fmask) { \
if (big) \
fprintf (FILE, "\tfmovem -%d(%%fp,%%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(%%fp),&0x%x\n", \
foffset + fsize, fmask); } \
if (frame_pointer_needed) \
fprintf (FILE, "\tunlk %%fp\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. */
#undef ASM_OUTPUT_REG_PUSH
#define ASM_OUTPUT_REG_PUSH(FILE,REGNO) \
fprintf (FILE, "\tmov.l %s,-(%%sp)\n", reg_names[REGNO])
/* This is how to output an insn to pop a register from the stack.
It need not be very fast code. */
#undef ASM_OUTPUT_REG_POP
#define ASM_OUTPUT_REG_POP(FILE,REGNO) \
fprintf (FILE, "\tmov.l (%%sp)+,%s\n", reg_names[REGNO])
#undef ASM_APP_ON
#define ASM_APP_ON ""
#undef ASM_APP_OFF
#define ASM_APP_OFF ""
#undef TEXT_SECTION_ASM_OP
#define TEXT_SECTION_ASM_OP "text"
#undef DATA_SECTION_ASM_OP
#define DATA_SECTION_ASM_OP "data"
#undef ASCII_DATA_ASM_OP
#define ASCII_DATA_ASM_OP "byte"
/* The file command should always begin the output. */
#undef ASM_FILE_START
#define ASM_FILE_START(FILE) \
output_file_directive ((FILE), main_input_filename)
/* Don't try to define `gcc_compiled.' since the assembler might not
accept symbols with periods and GDB doesn't run on this machine anyway. */
#define ASM_IDENTIFY_GCC(FILE)
/* Names to predefine in the preprocessor for this target machine. */
/* ihnp4!lmayk!lgm@eddie.mit.edu says mc68000 and m68k should not be here,
on the other hand I don't care what he says. */
#undef CPP_PREDEFINES
#define CPP_PREDEFINES "-Dm68k -Dunix -DsysV68"
/* Specify how to pad function arguments.
Value should be `upward', `downward' or `none'.
Same as the default, except no padding for large or variable-size args. */
#define FUNCTION_ARG_PADDING(MODE, TYPE) \
(((MODE) == BLKmode \
? ((TYPE) && TREE_CODE (TYPE_SIZE (TYPE)) == INTEGER_CST \
&& int_size_in_bytes (TYPE) < PARM_BOUNDARY / BITS_PER_UNIT) \
: GET_MODE_BITSIZE (MODE) < PARM_BOUNDARY) \
? downward : none)
/* Override part of the obstack macros. */
#define __PTR_TO_INT(P) ((int)(P))
#define __INT_TO_PTR(P) ((char *)(P))
#undef TARGET_VERSION
#define TARGET_VERSION fprintf (s