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
/
a29k.h
< prev
next >
Wrap
C/C++ Source or Header
|
1994-02-06
|
61KB
|
1,593 lines
/* Definitions of target machine for GNU compiler, for AMD Am29000 CPU.
Copyright (C) 1988, 1990, 1991, 1992 Free Software Foundation, Inc.
Contributed by Richard Kenner (kenner@nyu.edu)
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. */
/* Names to predefine in the preprocessor for this target machine. */
#define CPP_PREDEFINES "-D_AM29K -D_AM29000 -D_EPI"
/* Print subsidiary information on the compiler version in use. */
#define TARGET_VERSION
/* Pass -w to assembler. */
#define ASM_SPEC "-w"
/* Run-time compilation parameters selecting different hardware subsets. */
extern int target_flags;
/* Macro to define tables used to set the flags.
This is a list in braces of pairs in braces,
each pair being { "NAME", VALUE }
where VALUE is the bits to set or minus the bits to clear.
An empty string NAME is used to identify the default VALUE. */
/* This means that the DW bit will be enabled, to allow direct loads
of bytes. */
#define TARGET_DW_ENABLE (target_flags & 1)
/* This means that the external hardware does supports byte writes. */
#define TARGET_BYTE_WRITES (target_flags & 2)
/* This means that a "small memory model" has been selected where all
function addresses are known to be within 256K. This allows CALL to be
used. */
#define TARGET_SMALL_MEMORY (target_flags & 4)
/* This means that we are compiling for a 29050. */
#define TARGET_29050 (target_flags & 8)
/* This means that we are compiling for the kernel which means that we use
gr64-gr95 instead of gr96-126. */
#define TARGET_KERNEL_REGISTERS (target_flags & 16)
/* This means that a call to "__msp_check" should be inserted after each stack
adjustment to check for stack overflow. */
#define TARGET_STACK_CHECK (target_flags & 32)
/* This handles 29k processors which cannot handle the separation
of a mtsrim insns and a storem insn (most 29000 chips to date, but
not the 29050. */
#define TARGET_NO_STOREM_BUG (target_flags & 64)
/* This forces the compiler not to use incoming argument registers except
for copying out arguments. It helps detect problems when a function is
called with fewer arguments than it is declared with. */
#define TARGET_NO_REUSE_ARGS (target_flags & 128)
#define TARGET_SWITCHES \
{ {"dw", 1}, \
{"ndw", -1}, \
{"bw", 2}, \
{"nbw", - (1|2)}, \
{"small", 4}, \
{"large", -4}, \
{"29050", 8+64}, \
{"29000", -8}, \
{"kernel-registers", 16}, \
{"user-registers", -16}, \
{"stack-check", 32}, \
{"no-stack-check", - 32}, \
{"storem-bug", -64}, \
{"no-storem-bug", 64}, \
{"reuse-arg-regs", -128}, \
{"no-reuse-arg-regs", 128}, \
{"", TARGET_DEFAULT}}
#define TARGET_DEFAULT 3
/* Define this to change the optimizations performed by default. */
#define OPTIMIZATION_OPTIONS(LEVEL) \
{ \
if ((LEVEL) > 0) \
{ \
flag_force_addr = 1; \
flag_force_mem = 1; \
flag_omit_frame_pointer = 1; \
} \
}
/* target machine storage layout */
/* Define the types for size_t, ptrdiff_t, and wchar_t. These are the
same as those used by EPI. The type for wchar_t does not make much
sense, but is what is used. */
#define SIZE_TYPE "unsigned int"
#define PTRDIFF_TYPE "int"
#define WCHAR_TYPE "char"
#define WCHAR_TYPE_SIZE BITS_PER_UNIT
/* Define this macro if it is advisible to hold scalars in registers
in a wider mode than that declared by the program. In such cases,
the value is constrained to be within the bounds of the declared
type, but kept valid in the wider mode. The signedness of the
extension may differ from that of the type. */
#define PROMOTE_MODE(MODE,UNSIGNEDP,TYPE) \
if (GET_MODE_CLASS (MODE) == MODE_INT \
&& GET_MODE_SIZE (MODE) < 4) \
(MODE) == SImode;
/* Define this if most significant bit is lowest numbered
in instructions that operate on numbered bit-fields.
This is arbitrary on the 29k since it has no actual bit-field insns.
It is better to define this as TRUE because BYTES_BIG_ENDIAN is TRUE
and we want to be able to convert BP position to bit position with
just a shift. */
#define BITS_BIG_ENDIAN 1
/* Define this if most significant byte of a word is the lowest numbered.
This is true on 29k. */
#define BYTES_BIG_ENDIAN 1
/* Define this if most significant word of a multiword number is lowest
numbered.
For 29k we can decide arbitrarily since there are no machine instructions
for them. Might as well be consistent with bytes. */
#define WORDS_BIG_ENDIAN 1
/* number of bits in an addressable storage unit */
#define BITS_PER_UNIT 8
/* Width in bits of a "word", which is the contents of a machine register.
Note that this is not necessarily the width of data type `int';
if using 16-bit ints on a 68000, this would still be 32.
But on a machine with 16-bit registers, this would be 16. */
#define BITS_PER_WORD 32
/* Width of a word, in units (bytes). */
#define UNITS_PER_WORD 4
/* Width in bits of a pointer.
See also the macro `Pmode' defined below. */
#define POINTER_SIZE 32
/* Allocation boundary (in *bits*) for storing arguments in argument list. */
#define PARM_BOUNDARY 32
/* Boundary (in *bits*) on which stack pointer should be aligned. */
#define STACK_BOUNDARY 64
/* Allocation boundary (in *bits*) for the code of a function. */
#define FUNCTION_BOUNDARY 32
/* Alignment of field after `int : 0' in a structure. */
#define EMPTY_FIELD_BOUNDARY 32
/* Every structure's size must be a multiple of this. */
#define STRUCTURE_SIZE_BOUNDARY 8
/* A bitfield declared as `int' forces `int' alignment for the struct. */
#define PCC_BITFIELD_TYPE_MATTERS 1
/* No data type wants to be aligned rounder than this. */
#define BIGGEST_ALIGNMENT 32
/* Make strings word-aligned so strcpy from constants will be faster. */
#define CONSTANT_ALIGNMENT(EXP, ALIGN) \
(TREE_CODE (EXP) == STRING_CST \
&& (ALIGN) < BITS_PER_WORD ? BITS_PER_WORD : (ALIGN))
/* Make arrays of chars word-aligned for the same reasons. */
#define DATA_ALIGNMENT(TYPE, ALIGN) \
(TREE_CODE (TYPE) == ARRAY_TYPE \
&& TYPE_MODE (TREE_TYPE (TYPE)) == QImode \
&& (ALIGN) < BITS_PER_WORD ? BITS_PER_WORD : (ALIGN))
/* Set this non-zero if move instructions will actually fail to work
when given unaligned data. */
#define STRICT_ALIGNMENT 0
/* Set this non-zero if unaligned move instructions are extremely slow.
On the 29k, they trap. */
#define SLOW_UNALIGNED_ACCESS 1
/* Standard register usage. */
/* Number of actual hardware registers.
The hardware registers are assigned numbers for the compiler
from 0 to just below FIRST_PSEUDO_REGISTER.
All registers that the compiler knows about must be given numbers,
even those that are not normally considered general registers.
29k has 256 registers, of which 62 are not defined. gr0 and gr1 are
not produced in generated RTL so we can start at gr96, and call it
register zero.
So 0-31 are gr96-gr127, lr0-lr127 are 32-159. To represent the input
arguments, whose register numbers we won't know until we are done,
use register 160-175. They cannot be modified. Similarly, 176 is used
for the frame pointer. It is assigned the last local register number
once the number of registers used is known.
We use 177, 178, 179, and 180 for the special registers BP, FC, CR, and Q,
respectively. Registers 181 through 199 are used for the other special
registers that may be used by the programm