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
/
crds.h
< prev
next >
Wrap
C/C++ Source or Header
|
1994-02-06
|
22KB
|
604 lines
/* Definitions of target machine for GNU compiler.
Charles River Data Systems UNiverse/32
Written by Gary E. Miller
bug reports to Gary_Edmunds_Miller@cup.portal.com
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_SWITCH_TABLES /* Different switch table handling */
#define CRDS /* Charles River Data Systems assembler */
#include "m68k.h"
/* Without STRUCTURE_SIZE_BOUNDARY, we can't ensure that structures are
aligned such that we can correctly extract bitfields from them.
Someone should check whether the usual compiler on the crds machine
provides the equivalent behavior of STRUCTURE_SIZE_BOUNDARY. */
#error This doesn't define STRUCTURE_SIZE_BOUNDARY
/* See m68k.h. 0 means 680[01]0 with no 68881. */
#undef TARGET_DEFAULT
#define TARGET_DEFAULT 0
/* special flags to the unos assembler. */
#undef ASM_SPEC
#define ASM_SPEC "-g"
#undef LIB_SPEC
#define LIB_SPEC "%{!p:%{!pg:-lunos}}%{p:-lc_p}%{pg:-lc_p}"
#undef STARTFILE_SPEC
#define STARTFILE_SPEC \
"%{pg:gcrt0.o%s}%{!pg:%{p:mc68rt0.o%s}%{!p:c68rt0.o%s}}"
/* CC1 spec */
#if 0
/* c.sac only used in _s_call_r() in libunos.a and malloc() in libmalloc.a */
/* so we do not need to bother ! */
#define CC1_SPEC "-fpcc-struct-return"
#endif
/* -O2 for MAX optimization */
#undef CC1_SPEC
#define CC1_SPEC "%{O2:-fstrength-reduce}"
/* cpp has to support a #sccs directive for the /usr/include files */
#define SCCS_DIRECTIVE
/* Make output for SDB. */
/* #define SDB_DEBUGGING_INFO UNOS casm has no debugging :-( */
/* UNOS has vprintf() */
#define HAVE_VPRINTF
/* UNOS need stack probe :-( */
#define HAVE_probe 1
#define gen_probe() gen_rtx(ASM_INPUT, VOIDmode, "tstb -2048(sp)\t;probe\n")
/* use memcpy, memset instead of bcopy, etc. */
#define TARGET_MEM_FUNCTIONS
/* 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)
/* Define __HAVE_68881__ in preprocessor if -m68881 is specified.
This will control the use of inline 68881 insns in certain macros. */
#undef CPP_SPEC
#define CPP_SPEC "%{m68881:-D__HAVE_68881__}"
/* Names to predefine in the preprocessor for this target machine. */
#undef CPP_PREDEFINES
#define CPP_PREDEFINES "-Dmc68k -DM68000 -Dmc68000 -Dunos -Dunix"
/* Register in which address to store a structure value
is passed to a function. */
/* unos uses ".comm c.sac" returns &c.sac in d0 */
/* make pointer to c.sac ?
#undef STRUCT_VALUE_REGNUM
#define STRUCT_VALUE gen_rtx(MEM, Pmode, gen_rtx( , , ) )
*/
#define EXTRA_SECTIONS in_bss
#define EXTRA_SECTION_FUNCTIONS \
void \
bss_section () \
{ \
if (in_section != in_bss) \
{ \
fprintf (asm_out_file, ".bss\n"); \
in_section = in_bss; \
} \
}
/* 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))
/* Override parts of m68k.h to fit the CRuDS assembler. */
#undef TARGET_VERSION
#define TARGET_VERSION fprintf (stderr, " (68k, CRDS/UNOS)");
/* Specify extra dir to search for include files. */
#define SYSTEM_INCLUDE_DIR "/include"
/* Control the assembler format that we output. */
/* Output at beginning of assembler file. */
#undef ASM_FILE_START
#define ASM_FILE_START(FILE) \
fprintf (FILE, ";#NO_APP\n");
/* Output to assembler file text saying following lines
may contain character constants, extra white space, comments, etc. */
#undef ASM_APP_ON
#define ASM_APP_ON ";#APP\n"
/* Output to assembler file text saying following lines
no longer contain unusual constructs. */
#undef ASM_APP_OFF
#define ASM_APP_OFF ";#NO_APP\n"
/* This is how to output an assembler line defining a `double' constant. */
#undef ASM_OUTPUT_DOUBLE
#define ASM_OUTPUT_DOUBLE(FILE,VALUE) \
do { union { double f; long l[2];} tem; \
tem.f = (VALUE); \
fprintf (FILE, "\t.long 0x%x, 0x%x\n", tem.l[0], tem.l[1]); \
} while (0)
/*unos has no .skip :-( */
#undef ASM_OUTPUT_SKIP
#define ASM_OUTPUT_SKIP(FILE,SIZE) \
fprintf (FILE, "\t. = . + %u\n", (SIZE));
/* This says how to output an assembler line
to define a local common symbol. */
/* should use bss_section instead of data_section but this makes casm die ? */
#undef ASM_OUTPUT_LOCAL
#define ASM_OUTPUT_LOCAL(FILE, NAME, SIZE, ROUNDED) \
{ data_section (); \
if ((SIZE) > 1) fprintf (FILE, "\t.even\n"); \
assemble_name ((FILE), (NAME)); \
fprintf ((FILE), ":\t. = . + %u\n", (ROUNDED));}
/* 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, "\tmovel %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, "\tmovel (sp)+,%s\n", reg_names[REGNO])
#undef ASM_OUTPUT_ASCII
#define ASM_OUTPUT_ASCII(FILE, P , SIZE) \
{ int i; \
fprintf ((FILE), "\t.ascii \""); \
for (i = 0; i < (SIZE); i++) \
{ \
register int c = (P)[i]; \
if (i != 0 && (i / 200) * 200 == i) \
fprintf ((FILE), "\"\n\t.ascii \""); \
if (c >= ' ' && c < 0177) { \
if (c != '\"' && c != '\\') { \
putc (c, (FILE)); \
continue; \
} \
} \
/* brain dead asm doesn't understand char escapes */ \
fprintf ((FILE), "\"\n\t.byte\t%d\n\t.ascii \"", c); \
} \
fprintf ((FILE), "\"\n"); \
}
/* Change all JBxx to Bxx. Also change all DBRA to DBF.
Also change divs.l, etc., to divs, etc. But don't change divsl.l. */
#define ASM_OUTPUT_OPCODE(FILE, PTR) \
{ if ((PTR)[0] == 'j' && (PTR)[1] == 'b') \
{ ++(PTR); } \
else if ((PTR)[0] == 'd') \
{ \
if (!strncmp ((PTR), "dbra", 4)) \
{ fprintf ((FILE), "dbf"); (PTR) += 4; } \
else if (!strncmp ((PTR), "div", 3) && (PTR)[5] == ' ') \
{ fprintf ((FILE), "div%c", (PTR)[3]); (PTR) += 6; } \
} \
}
/* Print operand X (an rtx) in assembler syntax to file FILE.
CODE is a letter or dot (`z' in `%z0') or 0 if no letter was specified.
For `%' followed by punctuation, CODE is the punctuation and X is null.
On the 68000, we use several CODE characters:
'.' for dot needed in Motorola-style opcode names.
'-' for an operand pushing on the stack:
sp@-, -(sp) or -(%sp) depending on the style of syntax.
'+' for an operand pushing on the stack:
sp@+, (sp)+ or (%sp)+ depending on the style of syntax.
'@' for a reference to the top word on the stack:
sp@, (sp) or (%sp) depending on the style of syntax.
'#' for an immediate operand prefix (# in MIT and Motorola syntax