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 / ns32k.h < prev    next >
C/C++ Source or Header  |  1994-02-06  |  50KB  |  1,349 lines

  1. /* Definitions of target machine for GNU compiler.  NS32000 version.
  2.    Copyright (C) 1988 Free Software Foundation, Inc.
  3.    Contributed by Michael Tiemann (tiemann@mcc.com)
  4.  
  5. This file is part of GNU CC.
  6.  
  7. GNU CC is free software; you can redistribute it and/or modify
  8. it under the terms of the GNU General Public License as published by
  9. the Free Software Foundation; either version 2, or (at your option)
  10. any later version.
  11.  
  12. GNU CC is distributed in the hope that it will be useful,
  13. but WITHOUT ANY WARRANTY; without even the implied warranty of
  14. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  15. GNU General Public License for more details.
  16.  
  17. You should have received a copy of the GNU General Public License
  18. along with GNU CC; see the file COPYING.  If not, write to
  19. the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.  */
  20.  
  21.  
  22. /* Note that some other tm.h files include this one and then override
  23.    many of the definitions that relate to assembler syntax.  */
  24.  
  25. extern enum reg_class secondary_reload_class();
  26.  
  27. /* Names to predefine in the preprocessor for this target machine.  */
  28.  
  29. #define CPP_PREDEFINES "-Dns32000 -Dunix"
  30.  
  31. /* Print subsidiary information on the compiler version in use.  */
  32. #define TARGET_VERSION fprintf (stderr, " (32000, GAS syntax)");
  33.  
  34.  
  35. /* ABSOLUTE PREFIX, IMMEDIATE_PREFIX and EXTERNAL_PREFIX can be defined
  36.    to cover most NS32k addressing syntax variations.  This way we don't
  37.    need to redefine long macros in all the tm.h files for just slight
  38.    variations in assembler syntax. */
  39.  
  40. #ifndef ABSOLUTE_PREFIX
  41. #define ABSOLUTE_PREFIX '@'
  42. #endif
  43.  
  44. #if defined(IMMEDIATE_PREFIX) && IMMEDIATE_PREFIX
  45. #define PUT_IMMEDIATE_PREFIX(FILE) putc(IMMEDIATE_PREFIX, FILE)
  46. #else
  47. #define PUT_IMMEDIATE_PREFIX(FILE)
  48. #endif
  49. #if defined(ABSOLUTE_PREFIX) && ABSOLUTE_PREFIX
  50. #define PUT_ABSOLUTE_PREFIX(FILE) putc(ABSOLUTE_PREFIX, FILE)
  51. #else
  52. #define PUT_ABSOLUTE_PREFIX(FILE)
  53. #endif
  54. #if defined(EXTERNAL_PREFIX) && EXTERNAL_PREFIX
  55. #define PUT_EXTERNAL_PREFIX(FILE) putc(EXTERNAL_PREFIX, FILE)
  56. #else
  57. #define PUT_EXTERNAL_PREFIX(FILE)
  58. #endif
  59.  
  60. /* Run-time compilation parameters selecting different hardware subsets.  */
  61.  
  62. extern int target_flags;
  63.  
  64. /* Macros used in the machine description to test the flags.  */
  65.  
  66. /* Compile 32081 insns for floating point (not library calls). */
  67. #define TARGET_32081 (target_flags & 1)
  68.  
  69. /* Compile using rtd insn calling sequence.
  70.    This will not work unless you use prototypes at least
  71.    for all functions that can take varying numbers of args.  */
  72. #define TARGET_RTD (target_flags & 2)
  73.  
  74. /* Compile passing first two args in regs 0 and 1.  */
  75. #define TARGET_REGPARM (target_flags & 4)
  76.  
  77. /* Options to select type of CPU, for better optimization.
  78.    The output is correct for any kind of 32000 regardless of these options.  */
  79. #define TARGET_32532 (target_flags & 8)
  80. #define TARGET_32332 (target_flags & 16)
  81.  
  82. /* Ok to use the static base register (and presume it's 0) */
  83. #define TARGET_SB    ((target_flags & 32) == 0)
  84.  
  85. /* Macro to define tables used to set the flags.
  86.    This is a list in braces of pairs in braces,
  87.    each pair being { "NAME", VALUE }
  88.    where VALUE is the bits to set or minus the bits to clear.
  89.    An empty string NAME is used to identify the default VALUE.  */
  90.  
  91. #define TARGET_SWITCHES  \
  92.   { { "32081", 1},                \
  93.     { "soft-float", -1},            \
  94.     { "rtd", 2},                \
  95.     { "nortd", -2},                \
  96.     { "regparm", 4},                \
  97.     { "noregparm", -4},                \
  98.     { "32532", 24},                \
  99.     { "32332", -16},                \
  100.     { "32332", 8},                \
  101.     { "32032", -24},                \
  102.     { "sb", -32},                \
  103.     { "nosb", 32},                \
  104.     { "", TARGET_DEFAULT}}
  105. /* TARGET_DEFAULT is defined in encore.h, pc532.h, etc.  */
  106.  
  107. /* target machine storage layout */
  108.  
  109. /* Define this if most significant bit is lowest numbered
  110.    in instructions that operate on numbered bit-fields.
  111.    This is not true on the ns32k.  */
  112. #define BITS_BIG_ENDIAN 0
  113.  
  114. /* Define this if most significant byte of a word is the lowest numbered.  */
  115. /* That is not true on the ns32k.  */
  116. #define BYTES_BIG_ENDIAN 0
  117.  
  118. /* Define this if most significant word of a multiword number is lowest
  119.    numbered. This is not true on the ns32k.  */
  120. #define WORDS_BIG_ENDIAN 0
  121.  
  122. /* Number of bits in an addressable storage unit */
  123. #define BITS_PER_UNIT 8
  124.  
  125. /* Width in bits of a "word", which is the contents of a machine register.
  126.    Note that this is not necessarily the width of data type `int';
  127.    if using 16-bit ints on a 32000, this would still be 32.
  128.    But on a machine with 16-bit registers, this would be 16.  */
  129. #define BITS_PER_WORD 32
  130.  
  131. /* Width of a word, in units (bytes).  */
  132. #define UNITS_PER_WORD 4
  133.  
  134. /* Width in bits of a pointer.
  135.    See also the macro `Pmode' defined below.  */
  136. #define POINTER_SIZE 32
  137.  
  138. /* Allocation boundary (in *bits*) for storing arguments in argument list.  */
  139. #define PARM_BOUNDARY 32
  140.  
  141. /* Boundary (in *bits*) on which stack pointer should be aligned.  */
  142. #define STACK_BOUNDARY 32
  143.  
  144. /* Allocation boundary (in *bits*) for the code of a function.  */
  145. #define FUNCTION_BOUNDARY 16
  146.  
  147. /* Alignment of field after `int : 0' in a structure.  */
  148. #define EMPTY_FIELD_BOUNDARY 32
  149.  
  150. /* Every structure's size must be a multiple of this.  */
  151. #define STRUCTURE_SIZE_BOUNDARY 8
  152.  
  153. /* No data type wants to be aligned rounder than this.  */
  154. #define BIGGEST_ALIGNMENT 32
  155.  
  156. /* Set this nonzero if move instructions will actually fail to work
  157.    when given unaligned data.  National claims that the NS32032
  158.    works without strict alignment, but rumor has it that operands
  159.    crossing a page boundary cause unpredictable results.  */
  160. #define STRICT_ALIGNMENT 1
  161.  
  162. /* If bit field type is int, dont let it cross an int,
  163.    and give entire struct the alignment of an int.  */
  164. /* Required on the 386 since it doesn't have a full set of bitfield insns.
  165.    (There is no signed extv insn.)  */
  166. #define PCC_BITFIELD_TYPE_MATTERS 1
  167.  
  168. /* Standard register usage.  */
  169.  
  170. /* Number of actual hardware registers.
  171.    The hardware registers are assigned numbers for the compiler
  172.    from 0 to just below FIRST_PSEUDO_REGISTER.
  173.    All registers that the compiler knows about must be given numbers,
  174.    even those that are not normally considered general registers.  */
  175. #define FIRST_PSEUDO_REGISTER 18
  176.  
  177. /* 1 for registers that have pervasive standard uses
  178.    and are not available for the register allocator.
  179.    On the ns32k, these are the FP, SP, (SB and PC are not included here).  */
  180. #define FIXED_REGISTERS {0, 0, 0, 0, 0, 0, 0, 0, \
  181.              0, 0, 0, 0, 0, 0, 0, 0, \
  182.              1, 1}
  183.  
  184. /* 1 for registers not available across function calls.
  185.    These must include the FIXED_REGISTERS and also any
  186.    registers that can be used without being saved.
  187.    The latter must include the registers where values are returned
  188.    and the register where structure-value addresses are passed.
  189.    Aside from that, you can include as many other registers as you like.  */
  190. #define CALL_USED_REGISTERS {1, 1, 1, 0, 0, 0, 0, 0, \
  191.                  1, 1, 1, 1, 0, 0, 0, 0, \
  192.                  1, 1}
  193.  
  194. /* Return number of consecutive hard regs needed starting at reg REGNO
  195.    to hold something of mode MODE.
  196.    This is ordinarily the length in words of a value of mode MODE
  197.    but can be less for certain modes in special long registers.
  198.    On the ns32k, all registers are 32 bits long.  */
  199. #define HARD_REGNO_NREGS(REGNO, MODE)   \
  200.  ((GET_MODE_SIZE (MODE) + UNITS_PER_WORD - 1) / UNITS_PER_WORD)
  201.  
  202. /* Value is 1 if hard register REGNO can hold a value of machine-mode MODE. */
  203. #define HARD_REGNO_MODE_OK(REGNO, MODE) hard_regno_mode_ok (REGNO, MODE)
  204.  
  205. /* Value is 1 if it is a good idea to tie two pseudo registers
  206.    when one has mode MODE1 and one has mode MODE2.
  207.    If HARD_REGNO_MODE_OK could produce different values for MODE1 and MODE2,
  208.    for any hard reg, then this must be 0 for correct output.  */
  209. #define MODES_TIEABLE_P(MODE1, MODE2) \
  210.   (((MODE1) == DFmode || (MODE1) == DCmode || (MODE1) == DImode) ==    \
  211.    ((MODE2) == DFmode || (MODE2) == DCmode || (MODE2) == DImode))
  212.  
  213. /* Specify the registers used for certain standard purposes.
  214.    The values of these macros are register numbers.  */
  215.  
  216. /* NS32000 pc is not overloaded on a register.  */
  217. /* #define PC_REGNUM */
  218.  
  219. /* Register to use for pushing function arguments. */
  220. #define