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

  1. /* Definitions of target machine for GNU compiler, for DEC Alpha.
  2.    Copyright (C) 1992 Free Software Foundation, Inc.
  3.    Contributed by Richard Kenner (kenner@nyu.edu)
  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. /* Names to predefine in the preprocessor for this target machine.  */
  23.  
  24. #define CPP_PREDEFINES "\
  25. -Dunix -D__osf__ -D__alpha -D__alpha__ -D_LONGLONG -DSYSTYPE_BSD  \
  26. -D_SYSTYPE_BSD"
  27.  
  28. /* Write out the correct language type definition for the header files.  */
  29. #define CPP_SPEC "\
  30. %{.c:    -D__LANGUAGE_C__  -D__LANGUAGE_C %{!ansi:-DLANGUAGE_C}}  \
  31. %{.h:    -D__LANGUAGE_C__  -D__LANGUAGE_C %{!ansi:-DLANGUAGE_C}}  \
  32. %{.S:    -D__LANGUAGE_ASSEMBLY__ -D__LANGUAGE_ASSEMBLY %{!ansi:-DLANGUAGE_ASSEMBLY}} \
  33. %{.cc:    -D__LANGUAGE_C_PLUS_PLUS__ -D__LANGUAGE_C_PLUS_PLUS} \
  34. %{.cxx:    -D__LANGUAGE_C_PLUS_PLUS__ -D__LANGUAGE_C_PLUS_PLUS} \
  35. %{.C:    -D__LANGUAGE_C_PLUS_PLUS__ -D__LANGUAGE_C_PLUS_PLUS} \
  36. %{.m:    -D__LANGUAGE_OBJECTIVE_C__ -D__LANGUAGE_OBJECTIVE_C}"
  37.  
  38. /* Set the spec to use for signed char.  The default tests the above macro
  39.    but DEC's compiler can't handle the conditional in a "constant"
  40.    operand.  */
  41.  
  42. #define SIGNED_CHAR_SPEC "%{funsigned-char:-D__CHAR_UNSIGNED__}"
  43.  
  44. /* No point in running CPP on our assembler output.  */
  45. #define ASM_SPEC "-nocpp"
  46.  
  47. /* Right now Alpha OSF/1 doesn't seem to have debugging or profiled 
  48.    libraries.  */
  49.  
  50. #define LIB_SPEC "-lc"
  51.  
  52. /* Print subsidiary information on the compiler version in use.  */
  53. #define TARGET_VERSION
  54.  
  55. /* Define the location for the startup file on OSF/1 for Alpha.  */
  56.  
  57. #define MD_STARTFILE_PREFIX "/usr/lib/cmplrs/cc/"
  58.  
  59. /* Run-time compilation parameters selecting different hardware subsets.  */
  60.  
  61. extern int target_flags;
  62.  
  63. /* This means that floating-point support exists in the target implementation
  64.    of the Alpha architecture.  This is usually the default.  */
  65.  
  66. #define TARGET_FP    (target_flags & 1)
  67.  
  68. /* This means that floating-point registers are allowed to be used.  Note
  69.    that Alpha implementations without FP operations are required to
  70.    provide the FP registers.  */
  71.  
  72. #define TARGET_FPREGS (target_flags & 2)
  73.  
  74. /* Macro to define tables used to set the flags.
  75.    This is a list in braces of pairs in braces,
  76.    each pair being { "NAME", VALUE }
  77.    where VALUE is the bits to set or minus the bits to clear.
  78.    An empty string NAME is used to identify the default VALUE.  */
  79.  
  80. #define TARGET_SWITCHES            \
  81.   { {"no-soft-float", 1},        \
  82.     {"soft-float", -1},            \
  83.     {"fp-regs", 2},            \
  84.     {"no-fp-regs", -3},            \
  85.     {"", TARGET_DEFAULT} }
  86.  
  87. #define TARGET_DEFAULT 3
  88.  
  89. /* Define this macro to change register usage conditional on target flags.
  90.  
  91.    On the Alpha, we use this to disable the floating-point registers when
  92.    they don't exist.  */
  93.  
  94. #define CONDITIONAL_REGISTER_USAGE    \
  95.   if (! TARGET_FPREGS)            \
  96.     for (i = 32; i < 64; i++)        \
  97.       fixed_regs[i] = call_used_regs[i] = 1;
  98.  
  99. /* Define this to change the optimizations performed by default.  */
  100.  
  101. #define OPTIMIZATION_OPTIONS(LEVEL)    \
  102. {                    \
  103.   if ((LEVEL) > 0)            \
  104.     {                    \
  105.       flag_force_addr = 1;        \
  106.       flag_force_mem = 1;        \
  107.       flag_omit_frame_pointer = 1;    \
  108.     }                    \
  109. }
  110.  
  111. /* target machine storage layout */
  112.  
  113. /* Define the size of `int'.  The default is the same as the word size.  */
  114. #define INT_TYPE_SIZE 32
  115.  
  116. /* Define the size of `long long'.  The default is the twice the word size.  */
  117. #define LONG_LONG_TYPE_SIZE 64
  118.  
  119. /* The two floating-point formats we support are S-floating, which is
  120.    4 bytes, and T-floating, which is 8 bytes.  `float' is S and `double'
  121.    and `long double' are T.  */
  122.  
  123. #define FLOAT_TYPE_SIZE 32
  124. #define DOUBLE_TYPE_SIZE 64
  125. #define LONG_DOUBLE_TYPE_SIZE 64
  126.  
  127. #define WCHAR_TYPE "short unsigned int"
  128. #define WCHAR_TYPE_SIZE 16
  129.  
  130. /* Define this macro if it is advisible to hold scalars in registers
  131.    in a wider mode than that declared by the program.  In such cases, 
  132.    the value is constrained to be within the bounds of the declared
  133.    type, but kept valid in the wider mode.  The signedness of the
  134.    extension may differ from that of the type.
  135.  
  136.    For Alpha, we always store objects in a full register.  32-bit objects
  137.    are always sign-extended, but smaller objects retain their signedness.  */
  138.  
  139. #define PROMOTE_MODE(MODE,UNSIGNEDP,TYPE)  \
  140.   if (GET_MODE_CLASS (MODE) == MODE_INT        \
  141.       && GET_MODE_SIZE (MODE) < UNITS_PER_WORD)    \
  142.     {                        \
  143.       if ((MODE) == SImode)            \
  144.     (UNSIGNEDP) = 0;            \
  145.       (MODE) = DImode;                \
  146.     }
  147.  
  148. /* Define this if function arguments should also be promoted using the above
  149.    procedure.  */
  150.  
  151. #define PROMOTE_FUNCTION_ARGS
  152.  
  153. /* Likewise, if the function return value is promoted.  */
  154.  
  155. #define PROMOTE_FUNCTION_RETURN
  156.  
  157. /* Define this if most significant bit is lowest numbered
  158.    in instructions that operate on numbered bit-fields.
  159.  
  160.    There are no such instructions on the Alpha, but the documentation
  161.    is little endian.  */
  162. #define BITS_BIG_ENDIAN 0
  163.  
  164. /* Define this if most significant byte of a word is the lowest numbered.
  165.    This is false on the Alpha.  */
  166. #define BYTES_BIG_ENDIAN 0
  167.  
  168. /* Define this if most significant word of a multiword number is lowest
  169.    numbered.
  170.  
  171.    For Alpha we can decide arbitrarily since there are no machine instructions
  172.    for them.  Might as well be consistent with bytes. */
  173. #define WORDS_BIG_ENDIAN 0
  174.  
  175. /* number of bits in an addressable storage unit */
  176. #define BITS_PER_UNIT 8
  177.  
  178. /* Width in bits of a "word", which is the contents of a machine register.
  179.    Note that this is not necessarily the width of data type `int';
  180.    if using 16-bit ints on a 68000, this would still be 32.
  181.    But on a machine with 16-bit registers, this would be 16.  */
  182. #define BITS_PER_WORD 64
  183.  
  184. /* Width of a word, in units (bytes).  */
  185. #define UNITS_PER_WORD 8
  186.  
  187. /* Width in bits of a pointer.
  188.    See also the macro `Pmode' defined below.  */
  189. #define POINTER_SIZE 64
  190.  
  191. /* Allocation boundary (in *bits*) for storing arguments in argument list.  */
  192. #define PARM_BOUNDARY 64
  193.  
  194. /* Boundary (in *bits*) on which stack pointer should be aligned.  */
  195. #define STACK_BOUNDARY 64
  196.  
  197. /* Allocation boundary (in *bits*) for the code of a function.  */
  198. #define FUNCTION_BOUNDARY 64
  199.  
  200. /* Alignment of field after `int : 0' in a structure.  */
  201. #define EMPTY_FIELD_BOUNDARY 64
  202.  
  203. /* Every structure's size must be a multiple of this.  */
  204. #define STRUCTURE_SIZE_BOUNDARY 8
  205.  
  206. /* A bitfield declared as `int' forces `int' alignment for the struct.  */
  207. #define PCC_BITFIELD_TYPE_MATTERS 1
  208.  
  209. /* Align loop starts for optimal branching. 
  210.  
  211.    Don't do this until they fix the assembler.  */
  212.  
  213. /* #define ASM_OUTPUT_LOOP_ALIGN(FILE) \
  214.   ASM_OUTPUT_ALIGN (FILE, 5)  */
  215.  
  216. /* This is how to align an instruction for optimal branching.
  217.    On Alpha we'll get better performance by aligning on a quadword
  218.    boundary.  */
  219. #define ASM_OUTPUT_ALIGN_CODE(FILE)    \
  220.   ASM_OUTPUT_ALIGN ((FILE), 4)
  221.  
  222. /* No data type wants to be aligned rounder than this.  */
  223. #define BIGGEST_ALIGNMENT 64
  224.  
  225. /* Make strings word-aligned so strcpy from constants will be faster.  */
  226. #define CONSTANT_ALIGNMENT(EXP, ALIGN)  \
  227.   (TREE_CODE (EXP) == STRING_CST    \
  228.    && (ALIGN) < BITS_PER_WORD ? BITS_PER_WORD : (ALIGN))
  229.  
  230. /* Make arrays of chars word-aligned for the same reasons.  */
  231. #define DATA_ALIGNMENT(TYPE, ALIGN)        \
  232.   (TREE_CODE (TYPE) == ARRAY_TYPE        \
  233.    && TYPE_MODE (TREE_TYPE (TYPE)) == QImode    \
  234.    && (ALIGN) < BITS_PER_WORD ? BITS_PER_WORD : (ALIGN))
  235.  
  236. /* Set this non-zero if move instructions will actually fail to work
  237.    when given unaligned data.
  238.  
  239.    Since we get an error message when we do one, call them invalid.  */
  240.  
  241. #define STRICT_ALIGNMENT 1
  242.  
  243. /* Set this non-z