tm-vax.h 9.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272
  1. /* Definitions of target machine characteristics for GNU C compiler.
  2. VAX version.
  3. Copyright (C) 1984 by Richard M. Stallman.
  4. This will be free software eventually, but not until it is finished. */
  5. /* Define this if most significant byte of a word is the lowest numbered. */
  6. /* That is not true on the vax. */
  7. /* #define BIG_ENDIAN */
  8. /* target machine register layout */
  9. #define FIRST_PSEUDO_REGISTER 16
  10. /* Registers available for general temporary use. */
  11. #define FIXED_REGISTERS {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1}
  12. /* Registers available for use that are not clobbered by calls. */
  13. #define CALL_USED_REGISTERS {1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1}
  14. /* Order in which registers should be allocated. */
  15. #define ALLOCATE_REGISTERS {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11}
  16. /* Order in which registers should be vacated for use for indexing. */
  17. #define SPILL_REGISTERS {11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0}
  18. /* target machine storage layout */
  19. /* @@ Source should be checked to see if all of these are still used. */
  20. #define BITS_PER_UNIT 8
  21. /* number of bits in an addressible storage unit */
  22. #define BITS_PER_HALF_WORD 16
  23. #define BITS_PER_WORD 32
  24. /* number of bits in a word, preferred allocation boundary */
  25. #define BITS_PER_DOUBLE_WORD 64
  26. #define BITS_PER_TETRA_WORD 128
  27. /* @@ Source should be checked to see if all of these are still used. */
  28. #define POINTER_SIZE BITS_PER_WORD
  29. /* size and allocation boundary of a pointer */
  30. #define DOUBLE_POINTER_SIZE BITS_PER_DOUBLE_WORD
  31. #define POINTER_BOUNDARY 32
  32. /* All function parameters must appear on at least this boundary
  33. within the parameter list. */
  34. #define PARM_BOUNDARY 32
  35. /* There is no point aligning anything to a rounder boundary than this. */
  36. #define BIGGEST_ALIGNMENT 32
  37. #define CASE_VECTOR_MODE HImode
  38. #define CASE_VECTOR_PC_RELATIVE
  39. #define PC_REGNUM 15
  40. #define STACK_POINTER_REGNUM 14
  41. #define FRAME_POINTER_REGNUM 13
  42. #define ARG_POINTER_REGNUM 12
  43. #define STATIC_CHAIN_REGNUM 0
  44. #define FUNCTION_VALUE_REGNUM 0
  45. /* Define this if pushing a word on the stack
  46. makes the stack pointer a smaller address. */
  47. #define STACK_GROWS_DOWNWARD
  48. /* Define this if the nominal address of the stack frame
  49. is at the high-address end of the local variables;
  50. that is, each additional local variable allocated
  51. goes at a more negative offset in the frame. */
  52. #define FRAME_GROWS_DOWNWARD
  53. /* Offset within stack frame to start allocating local variables at.
  54. If FRAME_GROWS_DOWNWARD, this is the offset to the END of the
  55. first local allocated. Otherwise, it is the offset to the BEGINNING
  56. of the first local allocated. */
  57. #define STARTING_FRAME_OFFSET 0
  58. /* Offset of first parameter from the argument pointer register value. */
  59. #define FIRST_PARM_OFFSET 4
  60. /* GO_IF_LEGITIMATE_ADDRESS recognizes an RTL expression
  61. that is a valid memory address for an instruction.
  62. The MODE argument is the machine mode for the MEM expression
  63. that wants to use this address.
  64. The other macros defined here are used only in GO_IF_LEGITIMATE_ADDRESS,
  65. except for CONSTANT_ADDRESS_P which is used in constant_address_p().
  66. CONSTANT_ADDRESS_P is actually machine-independent. */
  67. /* These are subroutines for the caller to redefine, if appropriate,
  68. to return nonzero only for REG rtx's that will map into hard registers,
  69. and zero for those that are relegated to memory.
  70. You can assume that the argument to this macro has code REG. */
  71. #define REG_OK_FOR_INDEX_P(X) 1
  72. #define REG_OK_FOR_BASE_P(X) 1
  73. #define CONSTANT_ADDRESS_P(X) \
  74. (GET_CODE (X) == LABEL_REF || GET_CODE (X) == SYMBOL_REF \
  75. || GET_CODE (X) == CONST_INT \
  76. || ((GET_CODE (X) == PLUS || GET_CODE (X) == MINUS) \
  77. && constant_address_p (FORMAT_e (X, 0)) \
  78. && constant_address_p (FORMAT_e (X, 1))))
  79. #define INDIRECTABLE_ADDRESS_P(X) \
  80. (CONSTANT_ADDRESS_P (X) \
  81. || (GET_CODE (X) == REG && REG_OK_FOR_BASE_P (X)) \
  82. || (GET_CODE (X) == PLUS \
  83. && GET_CODE (FORMAT_e (X, 0)) == REG \
  84. && REG_OK_FOR_BASE_P (FORMAT_e (X, 0)) \
  85. && constant_address_p (FORMAT_e (X, 1))))
  86. #define GO_IF_NONINDEXED_ADDRESS(X, ADDR) \
  87. { register rtx arg; \
  88. if (GET_CODE (X) == REG) goto ADDR; \
  89. if (INDIRECTABLE_ADDRESS_P (X)) goto ADDR; \
  90. arg = FORMAT_e (X, 0); \
  91. if ((GET_CODE (X) == MEM && INDIRECTABLE_ADDRESS_P (arg)) \
  92. || ((GET_CODE (X) == PRE_DEC || GET_CODE (X) == POST_INC) \
  93. && GET_CODE (arg) == REG && REG_OK_FOR_BASE_P (arg))) \
  94. goto ADDR; }
  95. #define GO_IF_LEGITIMATE_ADDRESS(MODE, X, ADDR) \
  96. { GO_IF_NONINDEXED_ADDRESS (X, ADDR); \
  97. if (GET_CODE (X) == PLUS && GET_CODE (FORMAT_e (X, 0)) == MULT \
  98. && GET_CODE (FORMAT_e (FORMAT_e (X, 0), 0)) == REG \
  99. && REG_OK_FOR_INDEX_P (FORMAT_e (FORMAT_e (X, 0), 0)) \
  100. && GET_CODE (FORMAT_e (FORMAT_e (X, 0), 1)) == CONST_INT \
  101. && FORMAT_i (FORMAT_e (FORMAT_e (X, 0), 1), 0) == GET_MODE_SIZE(MODE))\
  102. GO_IF_NONINDEXED_ADDRESS (FORMAT_e (X, 1), ADDR); \
  103. if (1 == GET_MODE_SIZE (MODE)) \
  104. { \
  105. if (GET_CODE (X) == PLUS \
  106. && GET_CODE (FORMAT_e (X, 0)) == REG \
  107. && REG_OK_FOR_INDEX_P (FORMAT_e (X, 0))) \
  108. { GO_IF_NONINDEXED_ADDRESS (FORMAT_e (X, 1), ADDR); } \
  109. else if (GET_CODE (X) == PLUS \
  110. && GET_CODE (FORMAT_e (X, 1)) == REG \
  111. && REG_OK_FOR_INDEX_P (FORMAT_e (X, 1))) \
  112. { GO_IF_NONINDEXED_ADDRESS (FORMAT_e (X, 0), ADDR); } }}
  113. #define HAVE_POST_INCREMENT
  114. /* #define HAVE_POST_DECREMENT */
  115. #define HAVE_PRE_DECREMENT
  116. /* #define HAVE_PRE_INCREMENT */
  117. #define IMPLICIT_FIX_EXPR FIX_ROUND_EXPR
  118. /* A pointer is the same size as a word,
  119. and the conversion between them is a no-op. */
  120. #define Pmode SImode
  121. /* A function address in a call instruction
  122. is a byte address (for indexing purposes)
  123. so give the MEM rtx a byte's mode. */
  124. #define FUNCTION_MODE QImode
  125. /* Define if returning from a function call automatically
  126. pops the arguments described by the number-of-args field in the call. */
  127. #define RETURN_POPS_ARGS
  128. #define FUNCTION_PROLOGUE(FILE, SIZE) \
  129. { register int regno; \
  130. register int mask = 0; \
  131. for (regno = 0; regno < FIRST_PSEUDO_REGISTER; regno++) \
  132. if (regs_ever_live[regno]) mask |= 1 << regno; \
  133. fprintf (FILE, "\t.word 0x%x\n", mask & ~077); \
  134. if ((SIZE) >= 64) fprintf (FILE, "\tmovab %d(sp),sp\n", SIZE);\
  135. else if (SIZE) fprintf (FILE, "\tsubl2 $%d,sp\n", - (SIZE)); }
  136. /* not needed on the vax */
  137. /* #define FUNCTION_EPILOGUE(FILE, SIZE) */
  138. #define REGISTER_NAMES \
  139. {"r0", "r1", "r2", "r3", "r4", "r5", "r6", "r7", "r8", \
  140. "r9", "r10", "r11", "ap", "fp", "sp", "pc"}
  141. /* Number of bytes of boundary to align beginnings of functions on. */
  142. #define FUNCTION_ALIGN 2
  143. /* Store in CCVAR0 and CCVAR1 the expressions
  144. that the condition codes will describe
  145. after execution of an instruction whose pattern is EXP.
  146. Two variables are provided so two different equivalent expressions
  147. can be stored (they have the same value, so either could be tested).
  148. Set CCVAR0 and CCVAR1 to zero if the CC's will be undefined then.
  149. Do not alter them if the instruction would not alter the cc's. */
  150. #define NOTICE_UPDATE_CC(CCVAR0,CCVAR1,EXP) \
  151. { if (GET_CODE (EXP) == SET) \
  152. { if (GET_CODE (FORMAT_e (EXP, 0)) != PC) \
  153. { CCVAR0 = FORMAT_e (EXP, 0); \
  154. CCVAR1 = FORMAT_e (EXP, 1); } } \
  155. else if (GET_CODE (EXP) == PARALLEL \
  156. && GET_CODE (FORMAT_E (EXP, 0, 0)) == SET) \
  157. { if (GET_CODE (FORMAT_e (FORMAT_E (EXP, 0, 0), 0)) != PC) \
  158. { CCVAR0 = FORMAT_e (FORMAT_E (EXP, 0, 0), 0); \
  159. CCVAR1 = FORMAT_e (FORMAT_E (EXP, 0, 0), 1); } } \
  160. else CCVAR0 = 0, CCVAR1 = 0; }
  161. /* Define the classes of registers.
  162. One of the classes must always be named ALL_REGS and include all hard regs.
  163. If there is more than one class, another class must be named NO_REGS
  164. and contain none of the registers.
  165. The classes must be numbered in nondecreasing order; that is,
  166. a larger-numbered class must never be contained completely
  167. in a smaller-numbered class.
  168. For any two classes, it is very desirable that there be another
  169. class that represents their union. */
  170. /* The Vax has only one class of registers, which includes all of them. */
  171. enum reg_class { ALL_REGS, LIM_REG_CLASSES };
  172. #define N_REG_CLASSES (int) LIM_REG_CLASSES
  173. /* Define which registers fit in which classes.
  174. This is an initializer for a vector of HARD_REG_SET
  175. of length N_REG_CLASSES. */
  176. #define REG_CLASS_CONTENTS {0xffff}
  177. /* The same information, inverted:
  178. Return the class number of the smallest class containing
  179. reg number REGNO. This could be a conditional expression
  180. or could index an array. */
  181. #define REGNO_REG_CLASS(REGNO) ALL_REGS
  182. /* Define a table that lets us find quickly all the reg classes
  183. containing a given one. This is the initializer for an
  184. N_REG_CLASSES x N_REG_CLASSES array of reg class codes.
  185. Row N is a sequence containing all the class codes for
  186. classes that contain all the regs in class N. Each row
  187. contains no duplicates, and is terminated by a -1. */
  188. #define REG_CLASS_SUPERCLASSES {{(enum reg_class) -1}}
  189. /* Define a table that lets us find quickly the class
  190. for the subunion of any two classes.
  191. We say "Subunion" because the result need not be exactly
  192. the union; it may instead be a subclass of the union
  193. (though the closer to the union, the better).
  194. But if it contains anything beyond union of the two classes,
  195. you will lose!
  196. This is an initializer for an N_REG_CLASSES x N_REG_CLASSES
  197. array of reg class codes. The subunion of classes C1 and C2
  198. is just element [C1, C2]. */
  199. #define REG_CLASS_SUBUNION {{ALL_REGS}}
  200. /* The class value for index registers, and the one for base regs. */
  201. #define INDEX_REG_CLASS ALL_REGS
  202. #define BASE_REG_CLASS ALL_REGS
  203. /*
  204. Local variables:
  205. version-control: t
  206. End:
  207. */