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

  1. /* Definitions of target machine for GNU compiler for Intel 80386.
  2.    Copyright (C) 1988, 1992 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. /* The purpose of this file is to define the characteristics of the i386,
  22.    independent of assembler syntax or operating system.
  23.  
  24.    Three other files build on this one to describe a specific assembler syntax:
  25.    bsd386.h, att386.h, and sun386.h.
  26.  
  27.    The actual tm.h file for a particular system should include
  28.    this file, and then the file for the appropriate assembler syntax.
  29.  
  30.    Many macros that specify assembler syntax are omitted entirely from
  31.    this file because they really belong in the files for particular
  32.    assemblers.  These include AS1, AS2, AS3, RP, IP, LPREFIX, L_SIZE,
  33.    PUT_OP_SIZE, USE_STAR, ADDR_BEG, ADDR_END, PRINT_IREG, PRINT_SCALE,
  34.    PRINT_B_I_S, and many that start with ASM_ or end in ASM_OP.  */
  35.  
  36. /* Names to predefine in the preprocessor for this target machine.  */
  37.  
  38. #define I386 1
  39.  
  40. /* Stubs for half-pic support if not OSF/1 reference platform.  */
  41.  
  42. #ifndef HALF_PIC_P
  43. #define HALF_PIC_P() 0
  44. #define HALF_PIC_NUMBER_PTRS 0
  45. #define HALF_PIC_NUMBER_REFS 0
  46. #define HALF_PIC_ENCODE(DECL)
  47. #define HALF_PIC_DECLARE(NAME)
  48. #define HALF_PIC_INIT()    error ("half-pic init called on systems that don't support it.")
  49. #define HALF_PIC_ADDRESS_P(X) 0
  50. #define HALF_PIC_PTR(X) X
  51. #define HALF_PIC_FINISH(STREAM)
  52. #endif
  53.  
  54. /* Run-time compilation parameters selecting different hardware subsets.  */
  55.  
  56. extern int target_flags;
  57.  
  58. /* Macros used in the machine description to test the flags.  */
  59.  
  60. /* configure can arrage to make this 2, to force a 486.  */
  61. #ifndef TARGET_CPU_DEFAULT
  62. #define TARGET_CPU_DEFAULT 0
  63. #endif
  64.  
  65. /* Compile 80387 insns for floating point (not library calls).  */
  66. #define TARGET_80387 (target_flags & 1)
  67. /* Compile code for an i486. */
  68. #define TARGET_486 (target_flags & 2)
  69. /* Compile using ret insn that pops args.
  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 & 8)
  73. /* Compile passing first two args in regs 0 and 1.
  74.    This exists only to test compiler features that will
  75.    be needed for RISC chips.  It is not usable
  76.    and is not intended to be usable on this cpu.  */
  77. #define TARGET_REGPARM (target_flags & 020)
  78.  
  79. /* Put uninitialized locals into bss, not data.
  80.    Meaningful only on svr3.  */
  81. #define TARGET_SVR3_SHLIB (target_flags & 040)
  82.  
  83. /* Use IEEE floating point comparisons.  These handle correctly the cases
  84.    where the result of a comparison is unordered.  Normally SIGFPE is
  85.    generated in such cases, in which case this isn't needed.  */
  86. #define TARGET_IEEE_FP (target_flags & 0100)
  87.  
  88. /* Functions that return a floating point value may return that value
  89.    in the 387 FPU or in 386 integer registers.  If set, this flag causes
  90.    the 387 to be used, which is compatible with most calling conventions. */
  91. #define TARGET_FLOAT_RETURNS_IN_80387 (target_flags & 0200)
  92.  
  93. /* Macro to define tables used to set the flags.
  94.    This is a list in braces of pairs in braces,
  95.    each pair being { "NAME", VALUE }
  96.    where VALUE is the bits to set or minus the bits to clear.
  97.    An empty string NAME is used to identify the default VALUE.  */
  98.  
  99. #define TARGET_SWITCHES  \
  100.   { { "80387", 1},                \
  101.     { "no-80387", -1},                \
  102.     { "soft-float", -1},            \
  103.     { "no-soft-float", 1},            \
  104.     { "486", 2},                \
  105.     { "no-486", -2},                \
  106.     { "386", -2},                \
  107.     { "rtd", 8},                \
  108.     { "no-rtd", -8},                \
  109.     { "regparm", 020},                \
  110.     { "no-regparm", -020},            \
  111.     { "svr3-shlib", 040},            \
  112.     { "no-svr3-shlib", -040},            \
  113.     { "ieee-fp", 0100},                \
  114.     { "no-ieee-fp", -0100},            \
  115.     { "fp-ret-in-387", 0200},            \
  116.     { "no-fp-ret-in-387", -0200},        \
  117.     SUBTARGET_SWITCHES                          \
  118.     { "", TARGET_DEFAULT | TARGET_CPU_DEFAULT}}
  119.  
  120. /* This is meant to be redefined in the host dependent files */
  121. #define SUBTARGET_SWITCHES
  122.  
  123.  
  124. /* target machine storage layout */
  125.  
  126. /* Define this if most significant byte of a word is the lowest numbered.  */
  127. /* That is true on the 80386.  */
  128.  
  129. #define BITS_BIG_ENDIAN 0
  130.  
  131. /* Define this if most significant byte of a word is the lowest numbered.  */
  132. /* That is not true on the 80386.  */
  133. #define BYTES_BIG_ENDIAN 0
  134.  
  135. /* Define this if most significant word of a multiword number is the lowest
  136.    numbered.  */
  137. /* Not true for 80386 */
  138. #define WORDS_BIG_ENDIAN 0
  139.  
  140. /* number of bits in an addressable storage unit */
  141. #define BITS_PER_UNIT 8
  142.  
  143. /* Width in bits of a "word", which is the contents of a machine register.
  144.    Note that this is not necessarily the width of data type `int';
  145.    if using 16-bit ints on a 80386, this would still be 32.
  146.    But on a machine with 16-bit registers, this would be 16.  */
  147. #define BITS_PER_WORD 32
  148.  
  149. /* Width of a word, in units (bytes).  */
  150. #define UNITS_PER_WORD 4
  151.  
  152. /* Width in bits of a pointer.
  153.    See also the macro `Pmode' defined below.  */
  154. #define POINTER_SIZE 32
  155.  
  156. /* Allocation boundary (in *bits*) for storing arguments in argument list.  */
  157. #define PARM_BOUNDARY 32
  158.  
  159. /* Boundary (in *bits*) on which stack pointer should be aligned.  */
  160. #define STACK_BOUNDARY 32
  161.  
  162. /* Allocation boundary (in *bits*) for the code of a function.
  163.    For i486, we get better performance by aligning to a cache
  164.    line (i.e. 16 byte) boundary.  */
  165. #define FUNCTION_BOUNDARY (TARGET_486 ? 128 : 32)
  166.  
  167. /* Alignment of field after `int : 0' in a structure. */
  168.  
  169. #define EMPTY_FIELD_BOUNDARY 32
  170.  
  171. /* Minimum size in bits of the largest boundary to which any
  172.    and all fundamental data types supported by the hardware
  173.    might need to be aligned. No data type wants to be aligned
  174.    rounder than this.  The i386 supports 64-bit floating point
  175.    quantities, but these can be aligned on any 32-bit boundary.  */
  176. #define BIGGEST_ALIGNMENT 32
  177.  
  178. /* Set this non-zero if move instructions will actually fail to work
  179.    when given unaligned data.  */
  180. #define STRICT_ALIGNMENT 0
  181.  
  182. /* If bit field type is int, don't let it cross an int,
  183.    and give entire struct the alignment of an int.  */
  184. /* Required on the 386 since it doesn't have bitfield insns.  */
  185. #define PCC_BITFIELD_TYPE_MATTERS 1
  186.  
  187. /* Align loop starts for optimal branching.  */
  188. #define ASM_OUTPUT_LOOP_ALIGN(FILE) \
  189.   ASM_OUTPUT_ALIGN (FILE, 2)
  190.  
  191. /* This is how to align an instruction for optimal branching.
  192.    On i486 we'll get better performance by aligning on a
  193.    cache line (i.e. 16 byte) boundary.  */
  194. #define ASM_OUTPUT_ALIGN_CODE(FILE)    \
  195.   ASM_OUTPUT_ALIGN ((FILE), (TARGET_486 ? 4 : 2))
  196.  
  197. /* Standard register usage.  */
  198.  
  199. /* This processor has special stack-like registers.  See reg-stack.c
  200.    for details. */
  201.  
  202. #define STACK_REGS
  203.  
  204. /* Number of actual hardware registers.
  205.    The hardware registers are assigned numbers for the compiler
  206.    from 0 to just below FIRST_PSEUDO_REGISTER.
  207.    All registers that the compiler knows about must be given numbers,
  208.    even those that are not normally considered general registers.
  209.  
  210.    In the 80386 we give the 8 general purpose registers the numbers 0-7.
  211.    We number the floating point registers 8-15.
  212.    Note that registers 0-7 can be accessed as a  short or int,
  213.    while only 0-3 may be used with byte `mov' instructions.
  214.  
  215.    Reg 16 does not correspond to any hardware register, but instead
  216.    appears in the RTL as an argument pointer prior to reload, and is
  217.    eliminated during reloading in favor of either the stack or frame
  218.    pointer. */
  219.  
  220. #define FIRST_PSEUDO_REGISTER 17
  221.  
  222. /* 1 for registers that have pervasive standard uses
  223.    and are not available for