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
/
tahoe.h
< prev
next >
Wrap
C/C++ Source or Header
|
1994-02-06
|
30KB
|
1,019 lines
/* Definitions of target machine for GNU compiler. Tahoe version.
Copyright (C) 1989 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. */
/*
* File: tahoe.h
*
* Original port made at the University of Buffalo by Devon Bowen,
* Dale Wiles and Kevin Zachmann.
*
* HCX/UX version by Piet van Oostrum (piet@cs.ruu.nl)
*
* Performance hacking by Michael Tiemann (tiemann@lurch.stanford.edu)
*
* Mail bugs reports or fixes to: gcc@cs.buffalo.edu
*/
/* define this for the HCX/UX version */
/* #define HCX_UX */
/*
* Run-time Target Specification
*/
#ifdef HCX_UX
/* no predefines, see Makefile and hcx-universe.c */
/* have cc1 print that this is the hcx version */
#define TARGET_VERSION printf (" (hcx)");
#else
/* we want "tahoe" and "unix" defined for all future compilations */
#define CPP_PREDEFINES "-Dtahoe -Dunix"
/* have cc1 print that this is the tahoe version */
#define TARGET_VERSION printf (" (tahoe)");
#endif
/* this is required in all tm files to hold flags */
extern int target_flags;
/* Zero if it is safe to output .dfloat and .float pseudos. */
#define TARGET_HEX_FLOAT (target_flags & 1)
#define TARGET_DEFAULT 1
#define TARGET_SWITCHES \
{ {"hex-float", 1}, \
{"no-hex-float", -1}, \
{ "", TARGET_DEFAULT} }
/*
* Storage Layout
*/
/* This symbol was previously not mentioned, so apparently the tahoe
is little-endian for bits, or else doesn't care. */
#define BITS_BIG_ENDIAN 0
/* tahoe uses a big endian byte order */
#define BYTES_BIG_ENDIAN 1
/* tahoe uses a big endian word order */
#define WORDS_BIG_ENDIAN 1
/* standard byte size is usable on tahoe */
#define BITS_PER_UNIT 8
/* longs on the tahoe are 4 byte groups */
#define BITS_PER_WORD 32
/* from the last two params we get 4 bytes per word */
#define UNITS_PER_WORD 4
/* addresses are 32 bits (one word) */
#define POINTER_SIZE 32
/* all parameters line up on 32 boundaries */
#define PARM_BOUNDARY 32
/* stack should line up on 32 boundaries */
#define STACK_BOUNDARY 32
/* line functions up on 32 bits */
#define FUNCTION_BOUNDARY 32
/* the biggest alignment the tahoe needs in 32 bits */
#define BIGGEST_ALIGNMENT 32
/* we have to align after an 'int : 0' in a structure */
#define EMPTY_FIELD_BOUNDARY 32
#ifdef HCX_UX
/* structures must be made of full words */
#define STRUCTURE_SIZE_BOUNDARY 32
#else
/* structures must be made of full bytes */
#define STRUCTURE_SIZE_BOUNDARY 8
#endif
/* tahoe is picky about data alignment */
#define STRICT_ALIGNMENT 1
/* keep things standard with pcc */
#define PCC_BITFIELD_TYPE_MATTERS 1
/* this section is borrowed from the vax version since the */
/* formats are the same in both of the architectures */
#define CHECK_FLOAT_VALUE(mode, d) \
if ((mode) == SFmode) \
{ \
if ((d) > 1.7014117331926443e+38) \
{ error ("magnitude of constant too large for `float'"); \
(d) = 1.7014117331926443e+38; } \
else if ((d) < -1.7014117331926443e+38) \
{ error ("magnitude of constant too large for `float'"); \
(d) = -1.7014117331926443e+38; } \
else if (((d) > 0) && ((d) < 2.9387358770557188e-39)) \
{ warning ("`float' constant truncated to zero"); \
(d) = 0.0; } \
else if (((d) < 0) && ((d) > -2.9387358770557188e-39)) \
{ warning ("`float' constant truncated to zero"); \
(d) = 0.0; } \
}
/*
* Register Usage
*/
/* define 15 general regs plus one for the floating point reg (FPP) */
#define FIRST_PSEUDO_REGISTER 17
/* let the compiler know what the fp, sp and pc are */
#define FIXED_REGISTERS {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 0}
/* lots of regs aren't guaranteed to return from a call. The FPP reg */
/* must be included in these since it can't be saved by the reg mask */
#define CALL_USED_REGISTERS {1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1}
/* A single fp reg can handle any type of float.
CPU regs hold just 32 bits. */
#define HARD_REGNO_NREGS(REGNO, MODE) \
(REGNO != 16 ? ((GET_MODE_SIZE(MODE)+UNITS_PER_WORD-1) / UNITS_PER_WORD) \
: GET_MODE_NUNITS ((MODE)))
/* any mode greater than 4 bytes (doubles) can only go in an even regs */
/* and the FPP can only hold SFmode and DFmode */
#define HARD_REGNO_MODE_OK(REGNO, MODE) \
(REGNO != 16 \
? (GET_MODE_UNIT_SIZE (MODE) <= 4 ? 1 : (REGNO % 2 - 1)) \
: ((MODE) == SFmode || (MODE) == DFmode \
|| (MODE) == SCmode || (MODE) == DCmode))
/* if mode1 or mode2, but not both, are doubles then modes cannot be tied */
#define MODES_TIEABLE_P(MODE1, MODE2) \
(((MODE1) == DFmode || (MODE1) == DCmode) \
== ((MODE2) == DFmode || (MODE2) == DCmode))
/* return nonzero if register variable of mode MODE is not
a priori a bad idea. Used only if defined. */
#define MODE_OK_FOR_USERVAR(MODE) \
((MODE) == SImode)
/* the program counter is reg 15 */
#define PC_REGNUM 15
/* the stack pointer is reg 14 */
#define STACK_POINTER_REGNUM 14
/* the frame pointer is reg 13 */
#define FRAME_POINTER_REGNUM 13
/* tahoe does require an fp */
#define FRAME_POINTER_REQUIRED 1
/* since tahoe doesn't have a argument pointer, make it the fp */
#define ARG_POINTER_REGNUM 13
/* this isn't currently used since C doesn't support this feature */
#define STATIC_CHAIN_REGNUM 0
/* we'll use reg 1 for structure passing cause the destination */
/* of the eventual movblk requires it to be there anyway. */
#define STRUCT_VALUE_REGNUM 1
/*
* Register Classes
*/
/* tahoe has two types of regs. GENERAL_REGS are all the regs up */
/* to number 15. FPP_REG is the special floating point processor */
/* register class (only one reg). */
enum reg_class {NO_REGS,GENERAL_REGS,FPP_REG,ALL_REGS,LIM_REG_CLASSES};
/* defines the number of reg classes. */
#define N_REG_CLASSES (int) LIM_REG_CLASSES
/* this defines what the classes are officially named for debugging */
#define REG_CLASS_NAMES \
{"NO_REGS","GENERAL_REGS","FPP_REG","ALL_REGS"}
/* set general regs to be the first 16 regs and the fpp reg to be 17th */
#define REG_CLASS_CONTENTS {0,0xffff,0x10000,0x1ffff}
/* register class for the fpp reg is FPP_REG, all others are GENERAL_REGS */
#define REGNO_REG_CLASS(REGNO) (REGNO == 16 ? FPP_REG : GENERAL_REGS)
/* only general registers can be used as a base reg */
#define BASE_REG_CLASS GENERAL_REGS
/* only general registers can be used to index */
#define INDEX_REG_CLASS GENERAL_REGS
/* 'a' as a constraint in the md file means the FFP_REG class */
#define REG_CLASS_FROM_LETTER(C) (C == 'a' ? FPP_REG : NO_REGS)
/* any general reg but the fpp can be a base reg */
#define REGNO_OK_FOR_BASE_P(regno) \
((regno) < FIRST_PSEUDO_REGISTER - 1 || reg_renumber[regno] >= 0)
/* any general reg except the pc and fpp can be an index reg */
#define REGNO_OK_FOR_INDEX_P(regno) \
((regno) < FIRST_PSEUDO_REGISTER - 2 || reg_renumber[regno] >= 0)
/* if your loading a floating point constant, it can't be done */
/* through a register. Force it to be a memory constant. */
#define PREFERRED_RELOAD_CLASS(X,CLASS) \
((GET_CODE (X) == CONST_DOUBLE) ? NO_REGS : CLASS)
/* for the fpp reg, all modes fit; for any others, you need two for doubles */
#define CLASS_MAX_NREGS(CLASS, MODE) \
(CLASS != FPP_REG ? ((GET_MODE_SIZE (MODE) + UNITS_PER_WORD - 1) / UNITS_PER_WORD) : 1)
/* we don't define any special constant sizes so all should fail */
#define CONST_OK_FOR_LETTER_P(VALUE, C) 0
/* we don't define any special double sizes so all should fail */
#define CONST_DOUBLE_OK_FOR_LETTER_P(VALUE, C)