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 >
C/C++ Source or Header  |  1994-02-06  |  30KB  |  1,019 lines

  1. /* Definitions of target machine for GNU compiler.  Tahoe version.
  2.    Copyright (C) 1989 Free Software Foundation, Inc.
  3.  
  4. This file is part of GNU CC.
  5.  
  6. GNU CC is free software; you can redistribute it and/or modify
  7. it under the terms of the GNU General Public License as published by
  8. the Free Software Foundation; either version 2, or (at your option)
  9. any later version.
  10.  
  11. GNU CC is distributed in the hope that it will be useful,
  12. but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  14. GNU General Public License for more details.
  15.  
  16. You should have received a copy of the GNU General Public License
  17. along with GNU CC; see the file COPYING.  If not, write to
  18. the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.  */
  19.  
  20. /*
  21.  * File: tahoe.h
  22.  *
  23.  * Original port made at the University of Buffalo by Devon Bowen,
  24.  * Dale Wiles and Kevin Zachmann.
  25.  *
  26.  * HCX/UX version by Piet van Oostrum (piet@cs.ruu.nl)
  27.  *
  28.  * Performance hacking by Michael Tiemann (tiemann@lurch.stanford.edu)
  29.  *
  30.  * Mail bugs reports or fixes to:    gcc@cs.buffalo.edu
  31.  */
  32.  
  33. /* define this for the HCX/UX version */
  34.  
  35. /* #define HCX_UX */
  36.  
  37. /*
  38.  * Run-time Target Specification
  39.  */
  40.  
  41. #ifdef HCX_UX
  42. /* no predefines, see Makefile and hcx-universe.c */
  43. /* have cc1 print that this is the hcx version */
  44. #define TARGET_VERSION printf (" (hcx)");
  45. #else
  46. /* we want "tahoe" and "unix" defined for all future compilations */
  47. #define CPP_PREDEFINES "-Dtahoe -Dunix"
  48. /* have cc1 print that this is the tahoe version */
  49. #define TARGET_VERSION printf (" (tahoe)");
  50. #endif
  51.  
  52. /* this is required in all tm files to hold flags */
  53.  
  54. extern int target_flags;
  55.  
  56. /* Zero if it is safe to output .dfloat and .float pseudos.  */
  57. #define TARGET_HEX_FLOAT (target_flags & 1)
  58.  
  59. #define TARGET_DEFAULT 1
  60.  
  61. #define TARGET_SWITCHES        \
  62.   { {"hex-float", 1},        \
  63.     {"no-hex-float", -1},    \
  64.     { "", TARGET_DEFAULT} }
  65.  
  66.  
  67. /*
  68.  * Storage Layout
  69.  */
  70.  
  71. /* This symbol was previously not mentioned, so apparently the tahoe
  72.    is little-endian for bits, or else doesn't care.  */
  73. #define BITS_BIG_ENDIAN 0
  74.  
  75. /* tahoe uses a big endian byte order */
  76.  
  77. #define BYTES_BIG_ENDIAN 1
  78.  
  79. /* tahoe uses a big endian word order */
  80.  
  81. #define WORDS_BIG_ENDIAN 1
  82.  
  83. /* standard byte size is usable on tahoe */
  84.  
  85. #define BITS_PER_UNIT 8
  86.  
  87. /* longs on the tahoe are 4 byte groups */
  88.  
  89. #define BITS_PER_WORD 32
  90.  
  91. /* from the last two params we get 4 bytes per word */
  92.  
  93. #define UNITS_PER_WORD 4
  94.  
  95. /* addresses are 32 bits (one word) */
  96.  
  97. #define POINTER_SIZE 32
  98.  
  99. /* all parameters line up on 32 boundaries */
  100.  
  101. #define PARM_BOUNDARY 32
  102.  
  103. /* stack should line up on 32 boundaries */
  104.  
  105. #define STACK_BOUNDARY 32
  106.  
  107. /* line functions up on 32 bits */
  108.  
  109. #define FUNCTION_BOUNDARY 32
  110.  
  111. /* the biggest alignment the tahoe needs in 32 bits */
  112.  
  113. #define BIGGEST_ALIGNMENT 32
  114.  
  115. /* we have to align after an 'int : 0' in a structure */
  116.  
  117. #define EMPTY_FIELD_BOUNDARY 32
  118.  
  119. #ifdef HCX_UX
  120. /* structures must be made of full words */
  121.  
  122. #define STRUCTURE_SIZE_BOUNDARY 32
  123. #else
  124. /* structures must be made of full bytes */
  125.  
  126. #define STRUCTURE_SIZE_BOUNDARY 8
  127. #endif
  128.  
  129. /* tahoe is picky about data alignment */
  130.  
  131. #define STRICT_ALIGNMENT 1
  132.  
  133. /* keep things standard with pcc */
  134.  
  135. #define PCC_BITFIELD_TYPE_MATTERS 1
  136.  
  137. /* this section is borrowed from the vax version since the */
  138. /* formats are the same in both of the architectures       */
  139.  
  140. #define CHECK_FLOAT_VALUE(mode, d) \
  141.   if ((mode) == SFmode) \
  142.     { \
  143.       if ((d) > 1.7014117331926443e+38) \
  144.     { error ("magnitude of constant too large for `float'"); \
  145.       (d) = 1.7014117331926443e+38; } \
  146.       else if ((d) < -1.7014117331926443e+38) \
  147.     { error ("magnitude of constant too large for `float'"); \
  148.       (d) = -1.7014117331926443e+38; } \
  149.       else if (((d) > 0) && ((d) < 2.9387358770557188e-39)) \
  150.     { warning ("`float' constant truncated to zero"); \
  151.       (d) = 0.0; } \
  152.       else if (((d) < 0) && ((d) > -2.9387358770557188e-39)) \
  153.     { warning ("`float' constant truncated to zero"); \
  154.       (d) = 0.0; } \
  155.     }
  156.  
  157.  
  158. /*
  159.  * Register Usage
  160.  */
  161.  
  162. /* define 15 general regs plus one for the floating point reg (FPP) */
  163.  
  164. #define FIRST_PSEUDO_REGISTER 17
  165.  
  166. /* let the compiler know what the fp, sp and pc are */
  167.  
  168. #define FIXED_REGISTERS {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 0}
  169.  
  170. /* lots of regs aren't guaranteed to return from a call. The FPP reg */
  171. /* must be included in these since it can't be saved by the reg mask */
  172.  
  173. #define CALL_USED_REGISTERS {1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1}
  174.  
  175. /* A single fp reg can handle any type of float.
  176.    CPU regs hold just 32 bits.  */
  177.  
  178. #define HARD_REGNO_NREGS(REGNO, MODE) \
  179.  (REGNO != 16 ? ((GET_MODE_SIZE(MODE)+UNITS_PER_WORD-1) / UNITS_PER_WORD)  \
  180.   : GET_MODE_NUNITS ((MODE)))
  181.  
  182. /* any mode greater than 4 bytes (doubles) can only go in an even regs */
  183. /* and the FPP can only hold SFmode and DFmode                    */
  184.  
  185. #define HARD_REGNO_MODE_OK(REGNO, MODE) \
  186.  (REGNO != 16                            \
  187.   ? (GET_MODE_UNIT_SIZE (MODE) <= 4 ? 1 : (REGNO % 2 - 1))    \
  188.   : ((MODE) == SFmode || (MODE) == DFmode            \
  189.      || (MODE) == SCmode || (MODE) == DCmode))
  190.  
  191. /* if mode1 or mode2, but not both, are doubles then modes cannot be tied */
  192.  
  193. #define MODES_TIEABLE_P(MODE1, MODE2) \
  194.  (((MODE1) == DFmode || (MODE1) == DCmode)    \
  195.   == ((MODE2) == DFmode || (MODE2) == DCmode))
  196.  
  197. /* return nonzero if register variable of mode MODE is not
  198.    a priori a bad idea.  Used only if defined.  */
  199. #define MODE_OK_FOR_USERVAR(MODE)    \
  200.   ((MODE) == SImode)
  201.  
  202. /* the program counter is reg 15 */
  203.  
  204. #define PC_REGNUM 15
  205.  
  206. /* the stack pointer is reg 14 */
  207.  
  208. #define STACK_POINTER_REGNUM 14
  209.  
  210. /* the frame pointer is reg 13 */
  211.  
  212. #define FRAME_POINTER_REGNUM 13
  213.  
  214. /* tahoe does require an fp */
  215.  
  216. #define FRAME_POINTER_REQUIRED 1
  217.  
  218. /* since tahoe doesn't have a argument pointer, make it the fp */
  219.  
  220. #define ARG_POINTER_REGNUM 13
  221.  
  222. /* this isn't currently used since C doesn't support this feature */
  223.  
  224. #define STATIC_CHAIN_REGNUM 0
  225.  
  226. /* we'll use reg 1 for structure passing cause the destination */
  227. /* of the eventual movblk requires it to be there anyway.      */
  228.  
  229. #define STRUCT_VALUE_REGNUM 1
  230.  
  231.  
  232. /*
  233.  * Register Classes
  234.  */
  235.  
  236. /* tahoe has two types of regs. GENERAL_REGS are all the regs up */
  237. /* to number 15. FPP_REG is the special floating point processor  */
  238. /* register class (only one reg).                  */
  239.  
  240. enum reg_class {NO_REGS,GENERAL_REGS,FPP_REG,ALL_REGS,LIM_REG_CLASSES};
  241.  
  242. /* defines the number of reg classes.                    */
  243.  
  244. #define N_REG_CLASSES (int) LIM_REG_CLASSES
  245.  
  246. /* this defines what the classes are officially named for debugging */
  247.  
  248. #define REG_CLASS_NAMES \
  249.  {"NO_REGS","GENERAL_REGS","FPP_REG","ALL_REGS"}
  250.  
  251. /* set general regs to be the first 16 regs and the fpp reg to be 17th */
  252.  
  253. #define REG_CLASS_CONTENTS {0,0xffff,0x10000,0x1ffff}
  254.  
  255. /* register class for the fpp reg is FPP_REG, all others are GENERAL_REGS */
  256.  
  257. #define REGNO_REG_CLASS(REGNO) (REGNO == 16 ? FPP_REG : GENERAL_REGS)
  258.  
  259. /* only general registers can be used as a base reg */
  260.  
  261. #define BASE_REG_CLASS GENERAL_REGS
  262.  
  263. /* only general registers can be used to index */
  264.  
  265. #define INDEX_REG_CLASS GENERAL_REGS
  266.  
  267. /* 'a' as a constraint in the md file means the FFP_REG class */
  268.  
  269. #define REG_CLASS_FROM_LETTER(C) (C == 'a' ? FPP_REG : NO_REGS)
  270.  
  271. /* any general reg but the fpp can be a base reg */
  272.  
  273. #define REGNO_OK_FOR_BASE_P(regno) \
  274. ((regno) < FIRST_PSEUDO_REGISTER - 1 || reg_renumber[regno] >= 0)
  275.  
  276. /* any general reg except the pc and fpp can be an index reg */
  277.  
  278. #define REGNO_OK_FOR_INDEX_P(regno)  \
  279. ((regno) < FIRST_PSEUDO_REGISTER - 2 || reg_renumber[regno] >= 0)
  280.  
  281. /* if your loading a floating point constant, it can't be done */
  282. /* through a register. Force it to be a memory constant.       */
  283.  
  284. #define PREFERRED_RELOAD_CLASS(X,CLASS) \
  285.     ((GET_CODE (X) == CONST_DOUBLE) ? NO_REGS : CLASS)
  286.  
  287. /* for the fpp reg, all modes fit; for any others, you need two for doubles */
  288.  
  289. #define CLASS_MAX_NREGS(CLASS, MODE)    \
  290.  (CLASS != FPP_REG ? ((GET_MODE_SIZE (MODE) + UNITS_PER_WORD - 1) / UNITS_PER_WORD) : 1)
  291.  
  292. /* we don't define any special constant sizes so all should fail */
  293.  
  294. #define CONST_OK_FOR_LETTER_P(VALUE, C)  0
  295.  
  296. /* we don't define any special double sizes so all should fail */
  297.  
  298. #define CONST_DOUBLE_OK_FOR_LETTER_P(VALUE, C)