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

  1. /* Definitions of target machine parameters for GNU compiler,
  2.    for Pyramid 90x, 9000, and MIServer Series.
  3.    Copyright (C) 1989 Free Software Foundation, Inc.
  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.  * If you're going to change this, and you haven't already,
  23.  * you should get and read
  24.  *     ``OSx Operating System Porting Guide'',
  25.  *      publication number 4100-0066-A
  26.  *      Revision A
  27.  *      Pyramid Technology Corporation.
  28.  *
  29.  * or whatever the most recent version is.  In any case, page and
  30.  * section number references given herein refer to this document.
  31.  *
  32.  *  The instruction table for gdb lists the available insns and
  33.  *  the valid addressing modes.
  34.  *
  35.  *  Any other information on the Pyramid architecture is proprietary
  36.  *  and hard to get. (Pyramid cc -S and adb are also useful.)
  37.  *
  38.  */
  39.  
  40. /*** Run-time compilation parameters selecting different hardware subsets. ***/
  41.  
  42. /* Names to predefine in the preprocessor for this target machine.  */
  43.  
  44. #define CPP_PREDEFINES "-Dpyr -Dunix"
  45.  
  46. /* Print subsidiary information on the compiler version in use.  */
  47.  
  48. #define TARGET_VERSION fprintf (stderr, " (pyr)");
  49.  
  50. extern int target_flags;
  51.  
  52. /* Nonzero if compiling code that Unix assembler can assemble.  */
  53. #define TARGET_UNIX_ASM (target_flags & 1)
  54.  
  55. /* Implement stdarg in the same fashion used on all other machines.  */
  56. #define TARGET_GNU_STDARG   (target_flags & 2)
  57.  
  58. /* Compile using RETD to pop off the args.
  59.    This will not work unless you use prototypes at least
  60.    for all functions that can take varying numbers of args.
  61.    This contravenes the Pyramid calling convention, so we don't
  62.    do it yet.  */
  63.  
  64. #define TARGET_RETD (target_flags & 4)
  65.  
  66. /* Macros used in the machine description to test the flags.  */
  67.  
  68. /* Macro to define tables used to set the flags.
  69.    This is a list in braces of pairs in braces,
  70.    each pair being { "NAME", VALUE }
  71.    where VALUE is the bits to set or minus the bits to clear.
  72.    An empty string NAME is used to identify the default VALUE.
  73.  
  74.    -mgnu will be useful if we ever have GAS on a pyramid.  */
  75.  
  76. #define TARGET_SWITCHES  \
  77.   { {"unix", 1},          \
  78.     {"gnu", -1},          \
  79.     {"gnu-stdarg", 2},        \
  80.     {"nognu-stdarg", -2},    \
  81.     {"retd", 4},        \
  82.     {"no-retd", -4},        \
  83.     { "", TARGET_DEFAULT}}
  84.  
  85. /* Default target_flags if no switches specified.
  86.  
  87.    (equivalent to "-munix -mindex -mgnu-stdarg")  */
  88.  
  89. #ifndef TARGET_DEFAULT
  90. #define TARGET_DEFAULT (1 + 2)
  91. #endif
  92.  
  93. /* Never allow $ in identifiers */
  94.  
  95. #define DOLLARS_IN_IDENTIFIERS 0
  96.  
  97. /*** Target machine storage layout ***/
  98.  
  99. /* Define this to non-zero if most significant bit is lowest
  100.    numbered in instructions that operate on numbered bit-fields.
  101.    This is not true on the pyramid.  */
  102. #define BITS_BIG_ENDIAN 0
  103.  
  104. /* Define this to non-zero if most significant byte of a word is
  105.    the lowest numbered.  */
  106. #define BYTES_BIG_ENDIAN 1
  107.  
  108. /* Define this to non-zero if most significant word of a multiword
  109.    number is the lowest numbered.  */
  110. #define WORDS_BIG_ENDIAN 1
  111.  
  112. /* Number of bits in an addressable storage unit */
  113. #define BITS_PER_UNIT 8
  114.  
  115. /* Width in bits of a "word", which is the contents of a machine register.
  116.    Note that this is not necessarily the width of data type `int';
  117.    if using 16-bit ints on a 68000, this would still be 32.
  118.    But on a machine with 16-bit registers, this would be 16.  */
  119. #define BITS_PER_WORD 32
  120.  
  121. /* Width of a word, in units (bytes).  */
  122. #define UNITS_PER_WORD 4
  123.  
  124. /* Width in bits of a pointer.
  125.    See also the macro `Pmode' defined below.  */
  126. #define POINTER_SIZE 32
  127.  
  128. /* Allocation boundary (in *bits*) for storing arguments in argument list.  */
  129. #define PARM_BOUNDARY 32
  130.  
  131. /* Boundary (in *bits*) on which stack pointer should be aligned.  */
  132. #define STACK_BOUNDARY 32
  133.  
  134. /* Allocation boundary (in *bits*) for the code of a function.  */
  135. #define FUNCTION_BOUNDARY 32
  136.  
  137. /* Alignment of field after `int : 0' in a structure.  */
  138. #define EMPTY_FIELD_BOUNDARY 32
  139.  
  140. /* Every structure's size must be a multiple of this.  */
  141. #define STRUCTURE_SIZE_BOUNDARY 32
  142.  
  143. /* No data type wants to be aligned rounder than this.  */
  144. #define BIGGEST_ALIGNMENT 32
  145.  
  146. /* Specified types of bitfields affect alignment of those fields
  147.    and of the structure as a whole.  */
  148. #define PCC_BITFIELD_TYPE_MATTERS 1
  149.  
  150. /* Make strings word-aligned so strcpy from constants will be faster. 
  151.    Pyramid documentation says the best alignment is to align
  152.    on the size of a cache line, which is 32 bytes.
  153.    Newer pyrs have single insns that do strcmp() and strcpy(), so this
  154.    may not actually win anything.   */
  155. #define CONSTANT_ALIGNMENT(EXP, ALIGN)  \
  156.   (TREE_CODE (EXP) == STRING_CST    \
  157.    && (ALIGN) < BITS_PER_WORD ? BITS_PER_WORD : (ALIGN))
  158.  
  159. /* Make arrays of chars word-aligned for the same reasons.  */
  160. #define DATA_ALIGNMENT(TYPE, ALIGN)        \
  161.   (TREE_CODE (TYPE) == ARRAY_TYPE        \
  162.    && TYPE_MODE (TREE_TYPE (TYPE)) == QImode    \
  163.    && (ALIGN) < BITS_PER_WORD ? BITS_PER_WORD : (ALIGN))
  164.  
  165. /* Set this nonzero if move instructions will actually fail to work
  166.    when given unaligned data.  */
  167. #define STRICT_ALIGNMENT 1
  168.  
  169. /*** Standard register usage.  ***/
  170.  
  171. /* Number of actual hardware registers.
  172.    The hardware registers are assigned numbers for the compiler
  173.    from 0 to just below FIRST_PSEUDO_REGISTER.
  174.    All registers that the compiler knows about must be given numbers,
  175.    even those that are not normally considered general registers.  */
  176.  
  177. /* Nota Bene:
  178.    Pyramids have 64 addressable 32-bit registers, arranged as four
  179.    groups of sixteen registers each. Pyramid names the groups
  180.    global, parameter, local, and temporary.
  181.  
  182.    The sixteen global registers are fairly conventional; the last
  183.    four are overloaded with a PSW, frame pointer, stack pointer, and pc.
  184.    The non-dedicated global registers used to be reserved for Pyramid
  185.    operating systems, and still have cryptic and undocumented uses for
  186.    certain library calls.  We do not use global registers gr0 through
  187.    gr11.
  188.  
  189.    The parameter, local, and temporary registers provide register
  190.    windowing.  Each procedure call has its own set of these 48
  191.    registers, which constitute its call frame. (These frames are
  192.    not allocated on the conventional stack, but contiguously
  193.    on a separate stack called the control stack.)
  194.    Register windowing is a facility whereby the temporary registers
  195.    of frame n become the parameter registers of frame n+1, viz.:
  196.  
  197.                                       0         15 0         15 0         15
  198.                                      +------------+------------+------------+
  199. frame n+1                            |            |            |            |
  200.                                      +------------+------------+------------+
  201.                                         Parameter     Local       Temporary
  202.  
  203.                                           ^
  204.                                           | These 16 regs are the same.
  205.                                           v
  206.  
  207.             0         15 0         15 0         15
  208.            +------------+------------+------------+
  209. frame n    |            |            |            |
  210.            +------------+------------+------------+
  211.              Parameter     Local       Temporary
  212.  
  213.    New frames are automatically allocated on the control stack by the
  214.    call instruction and de-allocated by the return insns "ret" and
  215.    "retd".  The control-stack grows contiguously upward from a
  216.    well-known address in memory; programs are free to allocate
  217.    a variable sized, conventional frame on the data stack, which
  218.    grows downwards in memory from just below the control stack.
  219.  
  220.    Tempor