ia64.h 65 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718
  1. /* Definitions of target machine GNU compiler. IA-64 version.
  2. Copyright (C) 1999-2015 Free Software Foundation, Inc.
  3. Contributed by James E. Wilson <wilson@cygnus.com> and
  4. David Mosberger <davidm@hpl.hp.com>.
  5. This file is part of GCC.
  6. GCC 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 3, or (at your option)
  9. any later version.
  10. GCC is distributed in the hope that it will be useful,
  11. but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  13. GNU General Public License for more details.
  14. You should have received a copy of the GNU General Public License
  15. along with GCC; see the file COPYING3. If not see
  16. <http://www.gnu.org/licenses/>. */
  17. /* ??? Look at ABI group documents for list of preprocessor macros and
  18. other features required for ABI compliance. */
  19. /* ??? Functions containing a non-local goto target save many registers. Why?
  20. See for instance execute/920428-2.c. */
  21. /* Run-time target specifications */
  22. /* Target CPU builtins. */
  23. #define TARGET_CPU_CPP_BUILTINS() \
  24. do { \
  25. builtin_assert("cpu=ia64"); \
  26. builtin_assert("machine=ia64"); \
  27. builtin_define("__ia64"); \
  28. builtin_define("__ia64__"); \
  29. builtin_define("__itanium__"); \
  30. if (TARGET_BIG_ENDIAN) \
  31. builtin_define("__BIG_ENDIAN__"); \
  32. } while (0)
  33. #ifndef SUBTARGET_EXTRA_SPECS
  34. #define SUBTARGET_EXTRA_SPECS
  35. #endif
  36. #define EXTRA_SPECS \
  37. { "asm_extra", ASM_EXTRA_SPEC }, \
  38. SUBTARGET_EXTRA_SPECS
  39. #define CC1_SPEC "%(cc1_cpu) "
  40. #define ASM_EXTRA_SPEC ""
  41. /* Variables which are this size or smaller are put in the sdata/sbss
  42. sections. */
  43. extern unsigned int ia64_section_threshold;
  44. /* If the assembler supports thread-local storage, assume that the
  45. system does as well. If a particular target system has an
  46. assembler that supports TLS -- but the rest of the system does not
  47. support TLS -- that system should explicit define TARGET_HAVE_TLS
  48. to false in its own configuration file. */
  49. #if !defined(TARGET_HAVE_TLS) && defined(HAVE_AS_TLS)
  50. #define TARGET_HAVE_TLS true
  51. #endif
  52. #define TARGET_TLS14 (ia64_tls_size == 14)
  53. #define TARGET_TLS22 (ia64_tls_size == 22)
  54. #define TARGET_TLS64 (ia64_tls_size == 64)
  55. #define TARGET_HPUX 0
  56. #define TARGET_HPUX_LD 0
  57. #define TARGET_ABI_OPEN_VMS 0
  58. #ifndef TARGET_ILP32
  59. #define TARGET_ILP32 0
  60. #endif
  61. #ifndef HAVE_AS_LTOFFX_LDXMOV_RELOCS
  62. #define HAVE_AS_LTOFFX_LDXMOV_RELOCS 0
  63. #endif
  64. /* Values for TARGET_INLINE_FLOAT_DIV, TARGET_INLINE_INT_DIV, and
  65. TARGET_INLINE_SQRT. */
  66. enum ia64_inline_type
  67. {
  68. INL_NO = 0,
  69. INL_MIN_LAT = 1,
  70. INL_MAX_THR = 2
  71. };
  72. /* Default target_flags if no switches are specified */
  73. #ifndef TARGET_DEFAULT
  74. #define TARGET_DEFAULT (MASK_DWARF2_ASM)
  75. #endif
  76. #ifndef TARGET_CPU_DEFAULT
  77. #define TARGET_CPU_DEFAULT 0
  78. #endif
  79. /* Driver configuration */
  80. /* A C string constant that tells the GCC driver program options to pass to
  81. `cc1'. It can also specify how to translate options you give to GCC into
  82. options for GCC to pass to the `cc1'. */
  83. #undef CC1_SPEC
  84. #define CC1_SPEC "%{G*}"
  85. /* A C string constant that tells the GCC driver program options to pass to
  86. `cc1plus'. It can also specify how to translate options you give to GCC
  87. into options for GCC to pass to the `cc1plus'. */
  88. /* #define CC1PLUS_SPEC "" */
  89. /* Storage Layout */
  90. /* Define this macro to have the value 1 if the most significant bit in a byte
  91. has the lowest number; otherwise define it to have the value zero. */
  92. #define BITS_BIG_ENDIAN 0
  93. #define BYTES_BIG_ENDIAN (TARGET_BIG_ENDIAN != 0)
  94. /* Define this macro to have the value 1 if, in a multiword object, the most
  95. significant word has the lowest number. */
  96. #define WORDS_BIG_ENDIAN (TARGET_BIG_ENDIAN != 0)
  97. #define UNITS_PER_WORD 8
  98. #define POINTER_SIZE (TARGET_ILP32 ? 32 : 64)
  99. /* A C expression whose value is zero if pointers that need to be extended
  100. from being `POINTER_SIZE' bits wide to `Pmode' are sign-extended and one if
  101. they are zero-extended and negative one if there is a ptr_extend operation.
  102. You need not define this macro if the `POINTER_SIZE' is equal to the width
  103. of `Pmode'. */
  104. /* Need this for 32-bit pointers, see hpux.h for setting it. */
  105. /* #define POINTERS_EXTEND_UNSIGNED */
  106. /* A macro to update MODE and UNSIGNEDP when an object whose type is TYPE and
  107. which has the specified mode and signedness is to be stored in a register.
  108. This macro is only called when TYPE is a scalar type. */
  109. #define PROMOTE_MODE(MODE,UNSIGNEDP,TYPE) \
  110. do \
  111. { \
  112. if (GET_MODE_CLASS (MODE) == MODE_INT \
  113. && GET_MODE_SIZE (MODE) < 4) \
  114. (MODE) = SImode; \
  115. } \
  116. while (0)
  117. #define PARM_BOUNDARY 64
  118. /* Define this macro if you wish to preserve a certain alignment for the stack
  119. pointer. The definition is a C expression for the desired alignment
  120. (measured in bits). */
  121. #define STACK_BOUNDARY 128
  122. /* Align frames on double word boundaries */
  123. #ifndef IA64_STACK_ALIGN
  124. #define IA64_STACK_ALIGN(LOC) (((LOC) + 15) & ~15)
  125. #endif
  126. #define FUNCTION_BOUNDARY 128
  127. /* Optional x86 80-bit float, quad-precision 128-bit float, and quad-word
  128. 128-bit integers all require 128-bit alignment. */
  129. #define BIGGEST_ALIGNMENT 128
  130. /* If defined, a C expression to compute the alignment for a static variable.
  131. TYPE is the data type, and ALIGN is the alignment that the object
  132. would ordinarily have. The value of this macro is used instead of that
  133. alignment to align the object. */
  134. #define DATA_ALIGNMENT(TYPE, ALIGN) \
  135. (TREE_CODE (TYPE) == ARRAY_TYPE \
  136. && TYPE_MODE (TREE_TYPE (TYPE)) == QImode \
  137. && (ALIGN) < BITS_PER_WORD ? BITS_PER_WORD : (ALIGN))
  138. /* If defined, a C expression to compute the alignment given to a constant that
  139. is being placed in memory. CONSTANT is the constant and ALIGN is the
  140. alignment that the object would ordinarily have. The value of this macro is
  141. used instead of that alignment to align the object. */
  142. #define CONSTANT_ALIGNMENT(EXP, ALIGN) \
  143. (TREE_CODE (EXP) == STRING_CST \
  144. && (ALIGN) < BITS_PER_WORD ? BITS_PER_WORD : (ALIGN))
  145. #define STRICT_ALIGNMENT 1
  146. /* Define this if you wish to imitate the way many other C compilers handle
  147. alignment of bitfields and the structures that contain them.
  148. The behavior is that the type written for a bit-field (`int', `short', or
  149. other integer type) imposes an alignment for the entire structure, as if the
  150. structure really did contain an ordinary field of that type. In addition,
  151. the bit-field is placed within the structure so that it would fit within such
  152. a field, not crossing a boundary for it. */
  153. #define PCC_BITFIELD_TYPE_MATTERS 1
  154. /* An integer expression for the size in bits of the largest integer machine
  155. mode that should actually be used. */
  156. /* Allow pairs of registers to be used, which is the intent of the default. */
  157. #define MAX_FIXED_MODE_SIZE GET_MODE_BITSIZE (TImode)
  158. /* By default, the C++ compiler will use function addresses in the
  159. vtable entries. Setting this nonzero tells the compiler to use
  160. function descriptors instead. The value of this macro says how
  161. many words wide the descriptor is (normally 2). It is assumed
  162. that the address of a function descriptor may be treated as a
  163. pointer to a function.
  164. For reasons known only to HP, the vtable entries (as opposed to
  165. normal function descriptors) are 16 bytes wide in 32-bit mode as
  166. well, even though the 3rd and 4th words are unused. */
  167. #define TARGET_VTABLE_USES_DESCRIPTORS (TARGET_ILP32 ? 4 : 2)
  168. /* Due to silliness in the HPUX linker, vtable entries must be
  169. 8-byte aligned even in 32-bit mode. Rather than create multiple
  170. ABIs, force this restriction on everyone else too. */
  171. #define TARGET_VTABLE_ENTRY_ALIGN 64
  172. /* Due to the above, we need extra padding for the data entries below 0
  173. to retain the alignment of the descriptors. */
  174. #define TARGET_VTABLE_DATA_ENTRY_DISTANCE (TARGET_ILP32 ? 2 : 1)
  175. /* Layout of Source Language Data Types */
  176. #define INT_TYPE_SIZE 32
  177. #define SHORT_TYPE_SIZE 16
  178. #define LONG_TYPE_SIZE (TARGET_ILP32 ? 32 : 64)
  179. #define LONG_LONG_TYPE_SIZE 64
  180. #define FLOAT_TYPE_SIZE 32
  181. #define DOUBLE_TYPE_SIZE 64
  182. /* long double is XFmode normally, and TFmode for HPUX. It should be
  183. TFmode for VMS as well but we only support up to DFmode now. */
  184. #define LONG_DOUBLE_TYPE_SIZE \
  185. (TARGET_HPUX ? 128 \
  186. : TARGET_ABI_OPEN_VMS ? 64 \
  187. : 80)
  188. #define DEFAULT_SIGNED_CHAR 1
  189. /* A C expression for a string describing the name of the data type to use for
  190. size values. The typedef name `size_t' is defined using the contents of the
  191. string. */
  192. /* ??? Needs to be defined for P64 code. */
  193. /* #define SIZE_TYPE */
  194. /* A C expression for a string describing the name of the data type to use for
  195. the result of subtracting two pointers. The typedef name `ptrdiff_t' is
  196. defined using the contents of the string. See `SIZE_TYPE' above for more
  197. information. */
  198. /* ??? Needs to be defined for P64 code. */
  199. /* #define PTRDIFF_TYPE */
  200. /* A C expression for a string describing the name of the data type to use for
  201. wide characters. The typedef name `wchar_t' is defined using the contents
  202. of the string. See `SIZE_TYPE' above for more information. */
  203. /* #define WCHAR_TYPE */
  204. /* A C expression for the size in bits of the data type for wide characters.
  205. This is used in `cpp', which cannot make use of `WCHAR_TYPE'. */
  206. /* #define WCHAR_TYPE_SIZE */
  207. /* Register Basics */
  208. /* Number of hardware registers known to the compiler.
  209. We have 128 general registers, 128 floating point registers,
  210. 64 predicate registers, 8 branch registers, one frame pointer,
  211. and several "application" registers. */
  212. #define FIRST_PSEUDO_REGISTER 334
  213. /* Ranges for the various kinds of registers. */
  214. #define ADDL_REGNO_P(REGNO) ((unsigned HOST_WIDE_INT) (REGNO) <= 3)
  215. #define GR_REGNO_P(REGNO) ((unsigned HOST_WIDE_INT) (REGNO) <= 127)
  216. #define FR_REGNO_P(REGNO) ((REGNO) >= 128 && (REGNO) <= 255)
  217. #define FP_REGNO_P(REGNO) ((REGNO) >= 128 && (REGNO) <= 254 && (REGNO) != 159)
  218. #define PR_REGNO_P(REGNO) ((REGNO) >= 256 && (REGNO) <= 319)
  219. #define BR_REGNO_P(REGNO) ((REGNO) >= 320 && (REGNO) <= 327)
  220. #define GENERAL_REGNO_P(REGNO) \
  221. (GR_REGNO_P (REGNO) || (REGNO) == FRAME_POINTER_REGNUM)
  222. #define GR_REG(REGNO) ((REGNO) + 0)
  223. #define FR_REG(REGNO) ((REGNO) + 128)
  224. #define PR_REG(REGNO) ((REGNO) + 256)
  225. #define BR_REG(REGNO) ((REGNO) + 320)
  226. #define OUT_REG(REGNO) ((REGNO) + 120)
  227. #define IN_REG(REGNO) ((REGNO) + 112)
  228. #define LOC_REG(REGNO) ((REGNO) + 32)
  229. #define AR_CCV_REGNUM 329
  230. #define AR_UNAT_REGNUM 330
  231. #define AR_PFS_REGNUM 331
  232. #define AR_LC_REGNUM 332
  233. #define AR_EC_REGNUM 333
  234. #define IN_REGNO_P(REGNO) ((REGNO) >= IN_REG (0) && (REGNO) <= IN_REG (7))
  235. #define LOC_REGNO_P(REGNO) ((REGNO) >= LOC_REG (0) && (REGNO) <= LOC_REG (79))
  236. #define OUT_REGNO_P(REGNO) ((REGNO) >= OUT_REG (0) && (REGNO) <= OUT_REG (7))
  237. #define AR_M_REGNO_P(REGNO) ((REGNO) == AR_CCV_REGNUM \
  238. || (REGNO) == AR_UNAT_REGNUM)
  239. #define AR_I_REGNO_P(REGNO) ((REGNO) >= AR_PFS_REGNUM \
  240. && (REGNO) < FIRST_PSEUDO_REGISTER)
  241. #define AR_REGNO_P(REGNO) ((REGNO) >= AR_CCV_REGNUM \
  242. && (REGNO) < FIRST_PSEUDO_REGISTER)
  243. /* ??? Don't really need two sets of macros. I like this one better because
  244. it is less typing. */
  245. #define R_GR(REGNO) GR_REG (REGNO)
  246. #define R_FR(REGNO) FR_REG (REGNO)
  247. #define R_PR(REGNO) PR_REG (REGNO)
  248. #define R_BR(REGNO) BR_REG (REGNO)
  249. /* An initializer that says which registers are used for fixed purposes all
  250. throughout the compiled code and are therefore not available for general
  251. allocation.
  252. r0: constant 0
  253. r1: global pointer (gp)
  254. r12: stack pointer (sp)
  255. r13: thread pointer (tp)
  256. f0: constant 0.0
  257. f1: constant 1.0
  258. p0: constant true
  259. fp: eliminable frame pointer */
  260. /* The last 16 stacked regs are reserved for the 8 input and 8 output
  261. registers. */
  262. #define FIXED_REGISTERS \
  263. { /* General registers. */ \
  264. 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, \
  265. 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, \
  266. 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, \
  267. 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, \
  268. 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, \
  269. 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, \
  270. 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, \
  271. 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, \
  272. /* Floating-point registers. */ \
  273. 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, \
  274. 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, \
  275. 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, \
  276. 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, \
  277. 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, \
  278. 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, \
  279. 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, \
  280. 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, \
  281. /* Predicate registers. */ \
  282. 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, \
  283. 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, \
  284. 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, \
  285. 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, \
  286. /* Branch registers. */ \
  287. 0, 0, 0, 0, 0, 0, 0, 0, \
  288. /*FP CCV UNAT PFS LC EC */ \
  289. 1, 1, 1, 1, 1, 1 \
  290. }
  291. /* Like `FIXED_REGISTERS' but has 1 for each register that is clobbered
  292. (in general) by function calls as well as for fixed registers. This
  293. macro therefore identifies the registers that are not available for
  294. general allocation of values that must live across function calls. */
  295. #define CALL_USED_REGISTERS \
  296. { /* General registers. */ \
  297. 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, \
  298. 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, \
  299. 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, \
  300. 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, \
  301. 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, \
  302. 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, \
  303. 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, \
  304. 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, \
  305. /* Floating-point registers. */ \
  306. 1, 1, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, \
  307. 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, \
  308. 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, \
  309. 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, \
  310. 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, \
  311. 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, \
  312. 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, \
  313. 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, \
  314. /* Predicate registers. */ \
  315. 1, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, \
  316. 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, \
  317. 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, \
  318. 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, \
  319. /* Branch registers. */ \
  320. 1, 0, 0, 0, 0, 0, 1, 1, \
  321. /*FP CCV UNAT PFS LC EC */ \
  322. 1, 1, 1, 1, 1, 1 \
  323. }
  324. /* Like `CALL_USED_REGISTERS' but used to overcome a historical
  325. problem which makes CALL_USED_REGISTERS *always* include
  326. all the FIXED_REGISTERS. Until this problem has been
  327. resolved this macro can be used to overcome this situation.
  328. In particular, block_propagate() requires this list
  329. be accurate, or we can remove registers which should be live.
  330. This macro is used in regs_invalidated_by_call. */
  331. #define CALL_REALLY_USED_REGISTERS \
  332. { /* General registers. */ \
  333. 0, 1, 1, 1, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 1, 1, \
  334. 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, \
  335. 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, \
  336. 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, \
  337. 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, \
  338. 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, \
  339. 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, \
  340. 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, \
  341. /* Floating-point registers. */ \
  342. 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, \
  343. 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, \
  344. 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, \
  345. 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, \
  346. 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, \
  347. 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, \
  348. 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, \
  349. 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, \
  350. /* Predicate registers. */ \
  351. 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, \
  352. 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, \
  353. 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, \
  354. 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, \
  355. /* Branch registers. */ \
  356. 1, 0, 0, 0, 0, 0, 1, 1, \
  357. /*FP CCV UNAT PFS LC EC */ \
  358. 0, 1, 0, 1, 0, 0 \
  359. }
  360. /* Define this macro if the target machine has register windows. This C
  361. expression returns the register number as seen by the called function
  362. corresponding to the register number OUT as seen by the calling function.
  363. Return OUT if register number OUT is not an outbound register. */
  364. #define INCOMING_REGNO(OUT) \
  365. ((unsigned) ((OUT) - OUT_REG (0)) < 8 ? IN_REG ((OUT) - OUT_REG (0)) : (OUT))
  366. /* Define this macro if the target machine has register windows. This C
  367. expression returns the register number as seen by the calling function
  368. corresponding to the register number IN as seen by the called function.
  369. Return IN if register number IN is not an inbound register. */
  370. #define OUTGOING_REGNO(IN) \
  371. ((unsigned) ((IN) - IN_REG (0)) < 8 ? OUT_REG ((IN) - IN_REG (0)) : (IN))
  372. /* Define this macro if the target machine has register windows. This
  373. C expression returns true if the register is call-saved but is in the
  374. register window. */
  375. #define LOCAL_REGNO(REGNO) \
  376. (IN_REGNO_P (REGNO) || LOC_REGNO_P (REGNO))
  377. /* We define CCImode in ia64-modes.def so we need a selector. */
  378. #define SELECT_CC_MODE(OP,X,Y) CCmode
  379. /* Order of allocation of registers */
  380. /* If defined, an initializer for a vector of integers, containing the numbers
  381. of hard registers in the order in which GCC should prefer to use them
  382. (from most preferred to least).
  383. If this macro is not defined, registers are used lowest numbered first (all
  384. else being equal).
  385. One use of this macro is on machines where the highest numbered registers
  386. must always be saved and the save-multiple-registers instruction supports
  387. only sequences of consecutive registers. On such machines, define
  388. `REG_ALLOC_ORDER' to be an initializer that lists the highest numbered
  389. allocatable register first. */
  390. /* ??? Should the GR return value registers come before or after the rest
  391. of the caller-save GRs? */
  392. #define REG_ALLOC_ORDER \
  393. { \
  394. /* Caller-saved general registers. */ \
  395. R_GR (14), R_GR (15), R_GR (16), R_GR (17), \
  396. R_GR (18), R_GR (19), R_GR (20), R_GR (21), R_GR (22), R_GR (23), \
  397. R_GR (24), R_GR (25), R_GR (26), R_GR (27), R_GR (28), R_GR (29), \
  398. R_GR (30), R_GR (31), \
  399. /* Output registers. */ \
  400. R_GR (120), R_GR (121), R_GR (122), R_GR (123), R_GR (124), R_GR (125), \
  401. R_GR (126), R_GR (127), \
  402. /* Caller-saved general registers, also used for return values. */ \
  403. R_GR (8), R_GR (9), R_GR (10), R_GR (11), \
  404. /* addl caller-saved general registers. */ \
  405. R_GR (2), R_GR (3), \
  406. /* Caller-saved FP registers. */ \
  407. R_FR (6), R_FR (7), \
  408. /* Caller-saved FP registers, used for parameters and return values. */ \
  409. R_FR (8), R_FR (9), R_FR (10), R_FR (11), \
  410. R_FR (12), R_FR (13), R_FR (14), R_FR (15), \
  411. /* Rotating caller-saved FP registers. */ \
  412. R_FR (32), R_FR (33), R_FR (34), R_FR (35), \
  413. R_FR (36), R_FR (37), R_FR (38), R_FR (39), R_FR (40), R_FR (41), \
  414. R_FR (42), R_FR (43), R_FR (44), R_FR (45), R_FR (46), R_FR (47), \
  415. R_FR (48), R_FR (49), R_FR (50), R_FR (51), R_FR (52), R_FR (53), \
  416. R_FR (54), R_FR (55), R_FR (56), R_FR (57), R_FR (58), R_FR (59), \
  417. R_FR (60), R_FR (61), R_FR (62), R_FR (63), R_FR (64), R_FR (65), \
  418. R_FR (66), R_FR (67), R_FR (68), R_FR (69), R_FR (70), R_FR (71), \
  419. R_FR (72), R_FR (73), R_FR (74), R_FR (75), R_FR (76), R_FR (77), \
  420. R_FR (78), R_FR (79), R_FR (80), R_FR (81), R_FR (82), R_FR (83), \
  421. R_FR (84), R_FR (85), R_FR (86), R_FR (87), R_FR (88), R_FR (89), \
  422. R_FR (90), R_FR (91), R_FR (92), R_FR (93), R_FR (94), R_FR (95), \
  423. R_FR (96), R_FR (97), R_FR (98), R_FR (99), R_FR (100), R_FR (101), \
  424. R_FR (102), R_FR (103), R_FR (104), R_FR (105), R_FR (106), R_FR (107), \
  425. R_FR (108), R_FR (109), R_FR (110), R_FR (111), R_FR (112), R_FR (113), \
  426. R_FR (114), R_FR (115), R_FR (116), R_FR (117), R_FR (118), R_FR (119), \
  427. R_FR (120), R_FR (121), R_FR (122), R_FR (123), R_FR (124), R_FR (125), \
  428. R_FR (126), R_FR (127), \
  429. /* Caller-saved predicate registers. */ \
  430. R_PR (6), R_PR (7), R_PR (8), R_PR (9), R_PR (10), R_PR (11), \
  431. R_PR (12), R_PR (13), R_PR (14), R_PR (15), \
  432. /* Rotating caller-saved predicate registers. */ \
  433. R_PR (16), R_PR (17), \
  434. R_PR (18), R_PR (19), R_PR (20), R_PR (21), R_PR (22), R_PR (23), \
  435. R_PR (24), R_PR (25), R_PR (26), R_PR (27), R_PR (28), R_PR (29), \
  436. R_PR (30), R_PR (31), R_PR (32), R_PR (33), R_PR (34), R_PR (35), \
  437. R_PR (36), R_PR (37), R_PR (38), R_PR (39), R_PR (40), R_PR (41), \
  438. R_PR (42), R_PR (43), R_PR (44), R_PR (45), R_PR (46), R_PR (47), \
  439. R_PR (48), R_PR (49), R_PR (50), R_PR (51), R_PR (52), R_PR (53), \
  440. R_PR (54), R_PR (55), R_PR (56), R_PR (57), R_PR (58), R_PR (59), \
  441. R_PR (60), R_PR (61), R_PR (62), R_PR (63), \
  442. /* Caller-saved branch registers. */ \
  443. R_BR (6), R_BR (7), \
  444. \
  445. /* Stacked callee-saved general registers. */ \
  446. R_GR (32), R_GR (33), R_GR (34), R_GR (35), \
  447. R_GR (36), R_GR (37), R_GR (38), R_GR (39), R_GR (40), R_GR (41), \
  448. R_GR (42), R_GR (43), R_GR (44), R_GR (45), R_GR (46), R_GR (47), \
  449. R_GR (48), R_GR (49), R_GR (50), R_GR (51), R_GR (52), R_GR (53), \
  450. R_GR (54), R_GR (55), R_GR (56), R_GR (57), R_GR (58), R_GR (59), \
  451. R_GR (60), R_GR (61), R_GR (62), R_GR (63), R_GR (64), R_GR (65), \
  452. R_GR (66), R_GR (67), R_GR (68), R_GR (69), R_GR (70), R_GR (71), \
  453. R_GR (72), R_GR (73), R_GR (74), R_GR (75), R_GR (76), R_GR (77), \
  454. R_GR (78), R_GR (79), R_GR (80), R_GR (81), R_GR (82), R_GR (83), \
  455. R_GR (84), R_GR (85), R_GR (86), R_GR (87), R_GR (88), R_GR (89), \
  456. R_GR (90), R_GR (91), R_GR (92), R_GR (93), R_GR (94), R_GR (95), \
  457. R_GR (96), R_GR (97), R_GR (98), R_GR (99), R_GR (100), R_GR (101), \
  458. R_GR (102), R_GR (103), R_GR (104), R_GR (105), R_GR (106), R_GR (107), \
  459. R_GR (108), \
  460. /* Input registers. */ \
  461. R_GR (112), R_GR (113), R_GR (114), R_GR (115), R_GR (116), R_GR (117), \
  462. R_GR (118), R_GR (119), \
  463. /* Callee-saved general registers. */ \
  464. R_GR (4), R_GR (5), R_GR (6), R_GR (7), \
  465. /* Callee-saved FP registers. */ \
  466. R_FR (2), R_FR (3), R_FR (4), R_FR (5), R_FR (16), R_FR (17), \
  467. R_FR (18), R_FR (19), R_FR (20), R_FR (21), R_FR (22), R_FR (23), \
  468. R_FR (24), R_FR (25), R_FR (26), R_FR (27), R_FR (28), R_FR (29), \
  469. R_FR (30), R_FR (31), \
  470. /* Callee-saved predicate registers. */ \
  471. R_PR (1), R_PR (2), R_PR (3), R_PR (4), R_PR (5), \
  472. /* Callee-saved branch registers. */ \
  473. R_BR (1), R_BR (2), R_BR (3), R_BR (4), R_BR (5), \
  474. \
  475. /* ??? Stacked registers reserved for fp, rp, and ar.pfs. */ \
  476. R_GR (109), R_GR (110), R_GR (111), \
  477. \
  478. /* Special general registers. */ \
  479. R_GR (0), R_GR (1), R_GR (12), R_GR (13), \
  480. /* Special FP registers. */ \
  481. R_FR (0), R_FR (1), \
  482. /* Special predicate registers. */ \
  483. R_PR (0), \
  484. /* Special branch registers. */ \
  485. R_BR (0), \
  486. /* Other fixed registers. */ \
  487. FRAME_POINTER_REGNUM, \
  488. AR_CCV_REGNUM, AR_UNAT_REGNUM, AR_PFS_REGNUM, AR_LC_REGNUM, \
  489. AR_EC_REGNUM \
  490. }
  491. /* How Values Fit in Registers */
  492. /* A C expression for the number of consecutive hard registers, starting at
  493. register number REGNO, required to hold a value of mode MODE. */
  494. /* ??? We say that BImode PR values require two registers. This allows us to
  495. easily store the normal and inverted values. We use CCImode to indicate
  496. a single predicate register. */
  497. #define HARD_REGNO_NREGS(REGNO, MODE) \
  498. ((REGNO) == PR_REG (0) && (MODE) == DImode ? 64 \
  499. : PR_REGNO_P (REGNO) && (MODE) == BImode ? 2 \
  500. : (PR_REGNO_P (REGNO) || GR_REGNO_P (REGNO)) && (MODE) == CCImode ? 1\
  501. : FR_REGNO_P (REGNO) && (MODE) == XFmode ? 1 \
  502. : FR_REGNO_P (REGNO) && (MODE) == RFmode ? 1 \
  503. : FR_REGNO_P (REGNO) && (MODE) == XCmode ? 2 \
  504. : (GET_MODE_SIZE (MODE) + UNITS_PER_WORD - 1) / UNITS_PER_WORD)
  505. /* A C expression that is nonzero if it is permissible to store a value of mode
  506. MODE in hard register number REGNO (or in several registers starting with
  507. that one). */
  508. #define HARD_REGNO_MODE_OK(REGNO, MODE) \
  509. (FR_REGNO_P (REGNO) ? \
  510. GET_MODE_CLASS (MODE) != MODE_CC && \
  511. (MODE) != BImode && \
  512. (MODE) != TFmode \
  513. : PR_REGNO_P (REGNO) ? \
  514. (MODE) == BImode || GET_MODE_CLASS (MODE) == MODE_CC \
  515. : GR_REGNO_P (REGNO) ? \
  516. (MODE) != XFmode && (MODE) != XCmode && (MODE) != RFmode \
  517. : AR_REGNO_P (REGNO) ? (MODE) == DImode \
  518. : BR_REGNO_P (REGNO) ? (MODE) == DImode \
  519. : 0)
  520. /* A C expression that is nonzero if it is desirable to choose register
  521. allocation so as to avoid move instructions between a value of mode MODE1
  522. and a value of mode MODE2.
  523. If `HARD_REGNO_MODE_OK (R, MODE1)' and `HARD_REGNO_MODE_OK (R, MODE2)' are
  524. ever different for any R, then `MODES_TIEABLE_P (MODE1, MODE2)' must be
  525. zero. */
  526. /* Don't tie integer and FP modes, as that causes us to get integer registers
  527. allocated for FP instructions. XFmode only supported in FP registers so
  528. we can't tie it with any other modes. */
  529. #define MODES_TIEABLE_P(MODE1, MODE2) \
  530. (GET_MODE_CLASS (MODE1) == GET_MODE_CLASS (MODE2) \
  531. && ((((MODE1) == XFmode) || ((MODE1) == XCmode) || ((MODE1) == RFmode)) \
  532. == (((MODE2) == XFmode) || ((MODE2) == XCmode) || ((MODE2) == RFmode))) \
  533. && (((MODE1) == BImode) == ((MODE2) == BImode)))
  534. /* Specify the modes required to caller save a given hard regno.
  535. We need to ensure floating pt regs are not saved as DImode. */
  536. #define HARD_REGNO_CALLER_SAVE_MODE(REGNO, NREGS, MODE) \
  537. ((FR_REGNO_P (REGNO) && (NREGS) == 1) ? RFmode \
  538. : choose_hard_reg_mode ((REGNO), (NREGS), false))
  539. /* Handling Leaf Functions */
  540. /* A C initializer for a vector, indexed by hard register number, which
  541. contains 1 for a register that is allowable in a candidate for leaf function
  542. treatment. */
  543. /* ??? This might be useful. */
  544. /* #define LEAF_REGISTERS */
  545. /* A C expression whose value is the register number to which REGNO should be
  546. renumbered, when a function is treated as a leaf function. */
  547. /* ??? This might be useful. */
  548. /* #define LEAF_REG_REMAP(REGNO) */
  549. /* Register Classes */
  550. /* An enumeral type that must be defined with all the register class names as
  551. enumeral values. `NO_REGS' must be first. `ALL_REGS' must be the last
  552. register class, followed by one more enumeral value, `LIM_REG_CLASSES',
  553. which is not a register class but rather tells how many classes there
  554. are. */
  555. /* ??? When compiling without optimization, it is possible for the only use of
  556. a pseudo to be a parameter load from the stack with a REG_EQUIV note.
  557. Regclass handles this case specially and does not assign any costs to the
  558. pseudo. The pseudo then ends up using the last class before ALL_REGS.
  559. Thus we must not let either PR_REGS or BR_REGS be the last class. The
  560. testcase for this is gcc.c-torture/execute/va-arg-7.c. */
  561. enum reg_class
  562. {
  563. NO_REGS,
  564. PR_REGS,
  565. BR_REGS,
  566. AR_M_REGS,
  567. AR_I_REGS,
  568. ADDL_REGS,
  569. GR_REGS,
  570. FP_REGS,
  571. FR_REGS,
  572. GR_AND_BR_REGS,
  573. GR_AND_FR_REGS,
  574. ALL_REGS,
  575. LIM_REG_CLASSES
  576. };
  577. #define GENERAL_REGS GR_REGS
  578. /* The number of distinct register classes. */
  579. #define N_REG_CLASSES ((int) LIM_REG_CLASSES)
  580. /* An initializer containing the names of the register classes as C string
  581. constants. These names are used in writing some of the debugging dumps. */
  582. #define REG_CLASS_NAMES \
  583. { "NO_REGS", "PR_REGS", "BR_REGS", "AR_M_REGS", "AR_I_REGS", \
  584. "ADDL_REGS", "GR_REGS", "FP_REGS", "FR_REGS", \
  585. "GR_AND_BR_REGS", "GR_AND_FR_REGS", "ALL_REGS" }
  586. /* An initializer containing the contents of the register classes, as integers
  587. which are bit masks. The Nth integer specifies the contents of class N.
  588. The way the integer MASK is interpreted is that register R is in the class
  589. if `MASK & (1 << R)' is 1. */
  590. #define REG_CLASS_CONTENTS \
  591. { \
  592. /* NO_REGS. */ \
  593. { 0x00000000, 0x00000000, 0x00000000, 0x00000000, \
  594. 0x00000000, 0x00000000, 0x00000000, 0x00000000, \
  595. 0x00000000, 0x00000000, 0x0000 }, \
  596. /* PR_REGS. */ \
  597. { 0x00000000, 0x00000000, 0x00000000, 0x00000000, \
  598. 0x00000000, 0x00000000, 0x00000000, 0x00000000, \
  599. 0xFFFFFFFF, 0xFFFFFFFF, 0x0000 }, \
  600. /* BR_REGS. */ \
  601. { 0x00000000, 0x00000000, 0x00000000, 0x00000000, \
  602. 0x00000000, 0x00000000, 0x00000000, 0x00000000, \
  603. 0x00000000, 0x00000000, 0x00FF }, \
  604. /* AR_M_REGS. */ \
  605. { 0x00000000, 0x00000000, 0x00000000, 0x00000000, \
  606. 0x00000000, 0x00000000, 0x00000000, 0x00000000, \
  607. 0x00000000, 0x00000000, 0x0600 }, \
  608. /* AR_I_REGS. */ \
  609. { 0x00000000, 0x00000000, 0x00000000, 0x00000000, \
  610. 0x00000000, 0x00000000, 0x00000000, 0x00000000, \
  611. 0x00000000, 0x00000000, 0x3800 }, \
  612. /* ADDL_REGS. */ \
  613. { 0x0000000F, 0x00000000, 0x00000000, 0x00000000, \
  614. 0x00000000, 0x00000000, 0x00000000, 0x00000000, \
  615. 0x00000000, 0x00000000, 0x0000 }, \
  616. /* GR_REGS. */ \
  617. { 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, \
  618. 0x00000000, 0x00000000, 0x00000000, 0x00000000, \
  619. 0x00000000, 0x00000000, 0x0100 }, \
  620. /* FP_REGS. */ \
  621. { 0x00000000, 0x00000000, 0x00000000, 0x00000000, \
  622. 0x7FFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0x7FFFFFFF, \
  623. 0x00000000, 0x00000000, 0x0000 }, \
  624. /* FR_REGS. */ \
  625. { 0x00000000, 0x00000000, 0x00000000, 0x00000000, \
  626. 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, \
  627. 0x00000000, 0x00000000, 0x0000 }, \
  628. /* GR_AND_BR_REGS. */ \
  629. { 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, \
  630. 0x00000000, 0x00000000, 0x00000000, 0x00000000, \
  631. 0x00000000, 0x00000000, 0x01FF }, \
  632. /* GR_AND_FR_REGS. */ \
  633. { 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, \
  634. 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, \
  635. 0x00000000, 0x00000000, 0x0100 }, \
  636. /* ALL_REGS. */ \
  637. { 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, \
  638. 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, \
  639. 0xFFFFFFFF, 0xFFFFFFFF, 0x3FFF }, \
  640. }
  641. /* A C expression whose value is a register class containing hard register
  642. REGNO. In general there is more than one such class; choose a class which
  643. is "minimal", meaning that no smaller class also contains the register. */
  644. /* The NO_REGS case is primarily for the benefit of rws_access_reg, which
  645. may call here with private (invalid) register numbers, such as
  646. REG_VOLATILE. */
  647. #define REGNO_REG_CLASS(REGNO) \
  648. (ADDL_REGNO_P (REGNO) ? ADDL_REGS \
  649. : GENERAL_REGNO_P (REGNO) ? GR_REGS \
  650. : FR_REGNO_P (REGNO) ? (REGNO) != R_FR (31) \
  651. && (REGNO) != R_FR(127) ? FP_REGS : FR_REGS \
  652. : PR_REGNO_P (REGNO) ? PR_REGS \
  653. : BR_REGNO_P (REGNO) ? BR_REGS \
  654. : AR_M_REGNO_P (REGNO) ? AR_M_REGS \
  655. : AR_I_REGNO_P (REGNO) ? AR_I_REGS \
  656. : NO_REGS)
  657. /* A macro whose definition is the name of the class to which a valid base
  658. register must belong. A base register is one used in an address which is
  659. the register value plus a displacement. */
  660. #define BASE_REG_CLASS GENERAL_REGS
  661. /* A macro whose definition is the name of the class to which a valid index
  662. register must belong. An index register is one used in an address where its
  663. value is either multiplied by a scale factor or added to another register
  664. (as well as added to a displacement). This is needed for POST_MODIFY. */
  665. #define INDEX_REG_CLASS GENERAL_REGS
  666. /* A C expression which is nonzero if register number NUM is suitable for use
  667. as a base register in operand addresses. It may be either a suitable hard
  668. register or a pseudo register that has been allocated such a hard reg. */
  669. #define REGNO_OK_FOR_BASE_P(REGNO) \
  670. (GENERAL_REGNO_P (REGNO) || GENERAL_REGNO_P (reg_renumber[REGNO]))
  671. /* A C expression which is nonzero if register number NUM is suitable for use
  672. as an index register in operand addresses. It may be either a suitable hard
  673. register or a pseudo register that has been allocated such a hard reg.
  674. This is needed for POST_MODIFY. */
  675. #define REGNO_OK_FOR_INDEX_P(NUM) REGNO_OK_FOR_BASE_P (NUM)
  676. /* You should define this macro to indicate to the reload phase that it may
  677. need to allocate at least one register for a reload in addition to the
  678. register to contain the data. Specifically, if copying X to a register
  679. CLASS in MODE requires an intermediate register, you should define this
  680. to return the largest register class all of whose registers can be used
  681. as intermediate registers or scratch registers. */
  682. #define SECONDARY_RELOAD_CLASS(CLASS, MODE, X) \
  683. ia64_secondary_reload_class (CLASS, MODE, X)
  684. /* Certain machines have the property that some registers cannot be copied to
  685. some other registers without using memory. Define this macro on those
  686. machines to be a C expression that is nonzero if objects of mode M in
  687. registers of CLASS1 can only be copied to registers of class CLASS2 by
  688. storing a register of CLASS1 into memory and loading that memory location
  689. into a register of CLASS2. */
  690. #if 0
  691. /* ??? May need this, but since we've disallowed XFmode in GR_REGS,
  692. I'm not quite sure how it could be invoked. The normal problems
  693. with unions should be solved with the addressof fiddling done by
  694. movxf and friends. */
  695. #define SECONDARY_MEMORY_NEEDED(CLASS1, CLASS2, MODE) \
  696. (((MODE) == XFmode || (MODE) == XCmode) \
  697. && (((CLASS1) == GR_REGS && (CLASS2) == FR_REGS) \
  698. || ((CLASS1) == FR_REGS && (CLASS2) == GR_REGS)))
  699. #endif
  700. /* A C expression for the maximum number of consecutive registers of
  701. class CLASS needed to hold a value of mode MODE.
  702. This is closely related to the macro `HARD_REGNO_NREGS'. */
  703. #define CLASS_MAX_NREGS(CLASS, MODE) \
  704. ((MODE) == BImode && (CLASS) == PR_REGS ? 2 \
  705. : (((CLASS) == FR_REGS || (CLASS) == FP_REGS) && (MODE) == XFmode) ? 1 \
  706. : (((CLASS) == FR_REGS || (CLASS) == FP_REGS) && (MODE) == RFmode) ? 1 \
  707. : (((CLASS) == FR_REGS || (CLASS) == FP_REGS) && (MODE) == XCmode) ? 2 \
  708. : (GET_MODE_SIZE (MODE) + UNITS_PER_WORD - 1) / UNITS_PER_WORD)
  709. /* In BR regs, we can't change the DImode at all.
  710. In FP regs, we can't change FP values to integer values and vice versa,
  711. but we can change e.g. DImode to SImode, and V2SFmode into DImode. */
  712. #define CANNOT_CHANGE_MODE_CLASS(FROM, TO, CLASS) \
  713. (reg_classes_intersect_p (CLASS, BR_REGS) \
  714. ? (FROM) != (TO) \
  715. : (SCALAR_FLOAT_MODE_P (FROM) != SCALAR_FLOAT_MODE_P (TO) \
  716. ? reg_classes_intersect_p (CLASS, FR_REGS) \
  717. : 0))
  718. /* Basic Stack Layout */
  719. /* Define this macro if pushing a word onto the stack moves the stack pointer
  720. to a smaller address. */
  721. #define STACK_GROWS_DOWNWARD 1
  722. /* Define this macro to nonzero if the addresses of local variable slots
  723. are at negative offsets from the frame pointer. */
  724. #define FRAME_GROWS_DOWNWARD 0
  725. /* Offset from the frame pointer to the first local variable slot to
  726. be allocated. */
  727. #define STARTING_FRAME_OFFSET 0
  728. /* Offset from the stack pointer register to the first location at which
  729. outgoing arguments are placed. If not specified, the default value of zero
  730. is used. This is the proper value for most machines. */
  731. /* IA64 has a 16 byte scratch area that is at the bottom of the stack. */
  732. #define STACK_POINTER_OFFSET 16
  733. /* Offset from the argument pointer register to the first argument's address.
  734. On some machines it may depend on the data type of the function. */
  735. #define FIRST_PARM_OFFSET(FUNDECL) 0
  736. /* A C expression whose value is RTL representing the value of the return
  737. address for the frame COUNT steps up from the current frame, after the
  738. prologue. */
  739. /* ??? Frames other than zero would likely require interpreting the frame
  740. unwind info, so we don't try to support them. We would also need to define
  741. DYNAMIC_CHAIN_ADDRESS and SETUP_FRAME_ADDRESS (for the reg stack flush). */
  742. #define RETURN_ADDR_RTX(COUNT, FRAME) \
  743. ia64_return_addr_rtx (COUNT, FRAME)
  744. /* A C expression whose value is RTL representing the location of the incoming
  745. return address at the beginning of any function, before the prologue. This
  746. RTL is either a `REG', indicating that the return value is saved in `REG',
  747. or a `MEM' representing a location in the stack. This enables DWARF2
  748. unwind info for C++ EH. */
  749. #define INCOMING_RETURN_ADDR_RTX gen_rtx_REG (VOIDmode, BR_REG (0))
  750. /* A C expression whose value is an integer giving the offset, in bytes, from
  751. the value of the stack pointer register to the top of the stack frame at the
  752. beginning of any function, before the prologue. The top of the frame is
  753. defined to be the value of the stack pointer in the previous frame, just
  754. before the call instruction. */
  755. /* The CFA is past the red zone, not at the entry-point stack
  756. pointer. */
  757. #define INCOMING_FRAME_SP_OFFSET STACK_POINTER_OFFSET
  758. /* We shorten debug info by using CFA-16 as DW_AT_frame_base. */
  759. #define CFA_FRAME_BASE_OFFSET(FUNDECL) (-INCOMING_FRAME_SP_OFFSET)
  760. /* Register That Address the Stack Frame. */
  761. /* The register number of the stack pointer register, which must also be a
  762. fixed register according to `FIXED_REGISTERS'. On most machines, the
  763. hardware determines which register this is. */
  764. #define STACK_POINTER_REGNUM 12
  765. /* The register number of the frame pointer register, which is used to access
  766. automatic variables in the stack frame. On some machines, the hardware
  767. determines which register this is. On other machines, you can choose any
  768. register you wish for this purpose. */
  769. #define FRAME_POINTER_REGNUM 328
  770. /* Base register for access to local variables of the function. */
  771. #define HARD_FRAME_POINTER_REGNUM LOC_REG (79)
  772. /* The register number of the arg pointer register, which is used to access the
  773. function's argument list. */
  774. /* r0 won't otherwise be used, so put the always eliminated argument pointer
  775. in it. */
  776. #define ARG_POINTER_REGNUM R_GR(0)
  777. /* Due to the way varargs and argument spilling happens, the argument
  778. pointer is not 16-byte aligned like the stack pointer. */
  779. #define INIT_EXPANDERS \
  780. do { \
  781. ia64_init_expanders (); \
  782. if (crtl->emit.regno_pointer_align) \
  783. REGNO_POINTER_ALIGN (ARG_POINTER_REGNUM) = 64; \
  784. } while (0)
  785. /* Register numbers used for passing a function's static chain pointer. */
  786. /* ??? The ABI sez the static chain should be passed as a normal parameter. */
  787. #define STATIC_CHAIN_REGNUM 15
  788. /* Eliminating the Frame Pointer and the Arg Pointer */
  789. /* If defined, this macro specifies a table of register pairs used to eliminate
  790. unneeded registers that point into the stack frame. */
  791. #define ELIMINABLE_REGS \
  792. { \
  793. {ARG_POINTER_REGNUM, STACK_POINTER_REGNUM}, \
  794. {ARG_POINTER_REGNUM, HARD_FRAME_POINTER_REGNUM}, \
  795. {FRAME_POINTER_REGNUM, STACK_POINTER_REGNUM}, \
  796. {FRAME_POINTER_REGNUM, HARD_FRAME_POINTER_REGNUM}, \
  797. }
  798. /* This macro is similar to `INITIAL_FRAME_POINTER_OFFSET'. It
  799. specifies the initial difference between the specified pair of
  800. registers. This macro must be defined if `ELIMINABLE_REGS' is
  801. defined. */
  802. #define INITIAL_ELIMINATION_OFFSET(FROM, TO, OFFSET) \
  803. ((OFFSET) = ia64_initial_elimination_offset ((FROM), (TO)))
  804. /* Passing Function Arguments on the Stack */
  805. /* If defined, the maximum amount of space required for outgoing arguments will
  806. be computed and placed into the variable
  807. `crtl->outgoing_args_size'. */
  808. #define ACCUMULATE_OUTGOING_ARGS 1
  809. /* Function Arguments in Registers */
  810. #define MAX_ARGUMENT_SLOTS 8
  811. #define MAX_INT_RETURN_SLOTS 4
  812. #define GR_ARG_FIRST IN_REG (0)
  813. #define GR_RET_FIRST GR_REG (8)
  814. #define GR_RET_LAST GR_REG (11)
  815. #define FR_ARG_FIRST FR_REG (8)
  816. #define FR_RET_FIRST FR_REG (8)
  817. #define FR_RET_LAST FR_REG (15)
  818. #define AR_ARG_FIRST OUT_REG (0)
  819. /* A C type for declaring a variable that is used as the first argument of
  820. `FUNCTION_ARG' and other related values. For some target machines, the type
  821. `int' suffices and can hold the number of bytes of argument so far. */
  822. enum ivms_arg_type {I64, FF, FD, FG, FS, FT};
  823. /* VMS floating point formats VAX F, VAX D, VAX G, IEEE S, IEEE T. */
  824. typedef struct ia64_args
  825. {
  826. int words; /* # words of arguments so far */
  827. int int_regs; /* # GR registers used so far */
  828. int fp_regs; /* # FR registers used so far */
  829. int prototype; /* whether function prototyped */
  830. enum ivms_arg_type atypes[8]; /* which VMS float type or if not float */
  831. } CUMULATIVE_ARGS;
  832. /* A C statement (sans semicolon) for initializing the variable CUM for the
  833. state at the beginning of the argument list. */
  834. #define INIT_CUMULATIVE_ARGS(CUM, FNTYPE, LIBNAME, INDIRECT, N_NAMED_ARGS) \
  835. do { \
  836. (CUM).words = 0; \
  837. (CUM).int_regs = 0; \
  838. (CUM).fp_regs = 0; \
  839. (CUM).prototype = ((FNTYPE) && prototype_p (FNTYPE)) || (LIBNAME); \
  840. (CUM).atypes[0] = (CUM).atypes[1] = (CUM).atypes[2] = I64; \
  841. (CUM).atypes[3] = (CUM).atypes[4] = (CUM).atypes[5] = I64; \
  842. (CUM).atypes[6] = (CUM).atypes[7] = I64; \
  843. } while (0)
  844. /* Like `INIT_CUMULATIVE_ARGS' but overrides it for the purposes of finding the
  845. arguments for the function being compiled. If this macro is undefined,
  846. `INIT_CUMULATIVE_ARGS' is used instead. */
  847. /* We set prototype to true so that we never try to return a PARALLEL from
  848. function_arg. */
  849. #define INIT_CUMULATIVE_INCOMING_ARGS(CUM, FNTYPE, LIBNAME) \
  850. do { \
  851. (CUM).words = 0; \
  852. (CUM).int_regs = 0; \
  853. (CUM).fp_regs = 0; \
  854. (CUM).prototype = 1; \
  855. (CUM).atypes[0] = (CUM).atypes[1] = (CUM).atypes[2] = I64; \
  856. (CUM).atypes[3] = (CUM).atypes[4] = (CUM).atypes[5] = I64; \
  857. (CUM).atypes[6] = (CUM).atypes[7] = I64; \
  858. } while (0)
  859. /* A C expression that is nonzero if REGNO is the number of a hard register in
  860. which function arguments are sometimes passed. This does *not* include
  861. implicit arguments such as the static chain and the structure-value address.
  862. On many machines, no registers can be used for this purpose since all
  863. function arguments are pushed on the stack. */
  864. #define FUNCTION_ARG_REGNO_P(REGNO) \
  865. (((REGNO) >= AR_ARG_FIRST && (REGNO) < (AR_ARG_FIRST + MAX_ARGUMENT_SLOTS)) \
  866. || ((REGNO) >= FR_ARG_FIRST && (REGNO) < (FR_ARG_FIRST + MAX_ARGUMENT_SLOTS)))
  867. /* How Large Values are Returned */
  868. #define DEFAULT_PCC_STRUCT_RETURN 0
  869. /* Caller-Saves Register Allocation */
  870. /* A C expression to determine whether it is worthwhile to consider placing a
  871. pseudo-register in a call-clobbered hard register and saving and restoring
  872. it around each function call. The expression should be 1 when this is worth
  873. doing, and 0 otherwise.
  874. If you don't define this macro, a default is used which is good on most
  875. machines: `4 * CALLS < REFS'. */
  876. /* ??? Investigate. */
  877. /* #define CALLER_SAVE_PROFITABLE(REFS, CALLS) */
  878. /* Function Entry and Exit */
  879. /* Define this macro as a C expression that is nonzero if the return
  880. instruction or the function epilogue ignores the value of the stack pointer;
  881. in other words, if it is safe to delete an instruction to adjust the stack
  882. pointer before a return from the function. */
  883. #define EXIT_IGNORE_STACK 1
  884. /* Define this macro as a C expression that is nonzero for registers
  885. used by the epilogue or the `return' pattern. */
  886. #define EPILOGUE_USES(REGNO) ia64_epilogue_uses (REGNO)
  887. /* Nonzero for registers used by the exception handling mechanism. */
  888. #define EH_USES(REGNO) ia64_eh_uses (REGNO)
  889. /* Output part N of a function descriptor for DECL. For ia64, both
  890. words are emitted with a single relocation, so ignore N > 0. */
  891. #define ASM_OUTPUT_FDESC(FILE, DECL, PART) \
  892. do { \
  893. if ((PART) == 0) \
  894. { \
  895. if (TARGET_ILP32) \
  896. fputs ("\tdata8.ua @iplt(", FILE); \
  897. else \
  898. fputs ("\tdata16.ua @iplt(", FILE); \
  899. mark_decl_referenced (DECL); \
  900. assemble_name (FILE, XSTR (XEXP (DECL_RTL (DECL), 0), 0)); \
  901. fputs (")\n", FILE); \
  902. if (TARGET_ILP32) \
  903. fputs ("\tdata8.ua 0\n", FILE); \
  904. } \
  905. } while (0)
  906. /* Generating Code for Profiling. */
  907. /* A C statement or compound statement to output to FILE some assembler code to
  908. call the profiling subroutine `mcount'. */
  909. #undef FUNCTION_PROFILER
  910. #define FUNCTION_PROFILER(FILE, LABELNO) \
  911. ia64_output_function_profiler(FILE, LABELNO)
  912. /* Neither hpux nor linux use profile counters. */
  913. #define NO_PROFILE_COUNTERS 1
  914. /* Trampolines for Nested Functions. */
  915. /* We need 32 bytes, so we can save the sp, ar.rnat, ar.bsp, and ar.pfs of
  916. the function containing a non-local goto target. */
  917. #define STACK_SAVEAREA_MODE(LEVEL) \
  918. ((LEVEL) == SAVE_NONLOCAL ? OImode : Pmode)
  919. /* A C expression for the size in bytes of the trampoline, as an integer. */
  920. #define TRAMPOLINE_SIZE 32
  921. /* Alignment required for trampolines, in bits. */
  922. #define TRAMPOLINE_ALIGNMENT 64
  923. /* Addressing Modes */
  924. /* Define this macro if the machine supports post-increment addressing. */
  925. #define HAVE_POST_INCREMENT 1
  926. #define HAVE_POST_DECREMENT 1
  927. #define HAVE_POST_MODIFY_DISP 1
  928. #define HAVE_POST_MODIFY_REG 1
  929. /* A C expression that is 1 if the RTX X is a constant which is a valid
  930. address. */
  931. #define CONSTANT_ADDRESS_P(X) 0
  932. /* The max number of registers that can appear in a valid memory address. */
  933. #define MAX_REGS_PER_ADDRESS 2
  934. /* Condition Code Status */
  935. /* One some machines not all possible comparisons are defined, but you can
  936. convert an invalid comparison into a valid one. */
  937. /* ??? Investigate. See the alpha definition. */
  938. /* #define CANONICALIZE_COMPARISON(CODE, OP0, OP1) */
  939. /* Describing Relative Costs of Operations */
  940. /* A C expression for the cost of a branch instruction. A value of 1 is the
  941. default; other values are interpreted relative to that. Used by the
  942. if-conversion code as max instruction count. */
  943. /* ??? This requires investigation. The primary effect might be how
  944. many additional insn groups we run into, vs how good the dynamic
  945. branch predictor is. */
  946. #define BRANCH_COST(speed_p, predictable_p) 6
  947. /* Define this macro as a C expression which is nonzero if accessing less than
  948. a word of memory (i.e. a `char' or a `short') is no faster than accessing a
  949. word of memory. */
  950. #define SLOW_BYTE_ACCESS 1
  951. /* Define this macro if it is as good or better to call a constant function
  952. address than to call an address kept in a register.
  953. Indirect function calls are more expensive that direct function calls, so
  954. don't cse function addresses. */
  955. #define NO_FUNCTION_CSE
  956. /* Dividing the output into sections. */
  957. /* A C expression whose value is a string containing the assembler operation
  958. that should precede instructions and read-only data. */
  959. #define TEXT_SECTION_ASM_OP "\t.text"
  960. /* A C expression whose value is a string containing the assembler operation to
  961. identify the following data as writable initialized data. */
  962. #define DATA_SECTION_ASM_OP "\t.data"
  963. /* If defined, a C expression whose value is a string containing the assembler
  964. operation to identify the following data as uninitialized global data. */
  965. #define BSS_SECTION_ASM_OP "\t.bss"
  966. #define IA64_DEFAULT_GVALUE 8
  967. /* Position Independent Code. */
  968. /* The register number of the register used to address a table of static data
  969. addresses in memory. */
  970. /* ??? Should modify ia64.md to use pic_offset_table_rtx instead of
  971. gen_rtx_REG (DImode, 1). */
  972. /* ??? Should we set flag_pic? Probably need to define
  973. LEGITIMIZE_PIC_OPERAND_P to make that work. */
  974. #define PIC_OFFSET_TABLE_REGNUM GR_REG (1)
  975. /* Define this macro if the register defined by `PIC_OFFSET_TABLE_REGNUM' is
  976. clobbered by calls. */
  977. #define PIC_OFFSET_TABLE_REG_CALL_CLOBBERED 1
  978. /* The Overall Framework of an Assembler File. */
  979. /* A C string constant describing how to begin a comment in the target
  980. assembler language. The compiler assumes that the comment will end at the
  981. end of the line. */
  982. #define ASM_COMMENT_START "//"
  983. /* A C string constant for text to be output before each `asm' statement or
  984. group of consecutive ones. */
  985. #define ASM_APP_ON (TARGET_GNU_AS ? "#APP\n" : "//APP\n")
  986. /* A C string constant for text to be output after each `asm' statement or
  987. group of consecutive ones. */
  988. #define ASM_APP_OFF (TARGET_GNU_AS ? "#NO_APP\n" : "//NO_APP\n")
  989. /* Output and Generation of Labels. */
  990. /* A C statement (sans semicolon) to output to the stdio stream STREAM the
  991. assembler definition of a label named NAME. */
  992. /* See the ASM_OUTPUT_LABELREF definition in sysv4.h for an explanation of
  993. why ia64_asm_output_label exists. */
  994. extern int ia64_asm_output_label;
  995. #define ASM_OUTPUT_LABEL(STREAM, NAME) \
  996. do { \
  997. ia64_asm_output_label = 1; \
  998. assemble_name (STREAM, NAME); \
  999. fputs (":\n", STREAM); \
  1000. ia64_asm_output_label = 0; \
  1001. } while (0)
  1002. /* Globalizing directive for a label. */
  1003. #define GLOBAL_ASM_OP "\t.global "
  1004. /* A C statement (sans semicolon) to output to the stdio stream STREAM any text
  1005. necessary for declaring the name of an external symbol named NAME which is
  1006. referenced in this compilation but not defined. */
  1007. #define ASM_OUTPUT_EXTERNAL(FILE, DECL, NAME) \
  1008. ia64_asm_output_external (FILE, DECL, NAME)
  1009. /* A C statement to store into the string STRING a label whose name is made
  1010. from the string PREFIX and the number NUM. */
  1011. #define ASM_GENERATE_INTERNAL_LABEL(LABEL, PREFIX, NUM) \
  1012. do { \
  1013. sprintf (LABEL, "*.%s%d", PREFIX, NUM); \
  1014. } while (0)
  1015. /* ??? Not sure if using a ? in the name for Intel as is safe. */
  1016. #define ASM_PN_FORMAT (TARGET_GNU_AS ? "%s.%lu" : "%s?%lu")
  1017. /* A C statement to output to the stdio stream STREAM assembler code which
  1018. defines (equates) the symbol NAME to have the value VALUE. */
  1019. #define ASM_OUTPUT_DEF(STREAM, NAME, VALUE) \
  1020. do { \
  1021. assemble_name (STREAM, NAME); \
  1022. fputs (" = ", STREAM); \
  1023. if (ISDIGIT (*VALUE)) \
  1024. ia64_asm_output_label = 1; \
  1025. assemble_name (STREAM, VALUE); \
  1026. fputc ('\n', STREAM); \
  1027. ia64_asm_output_label = 0; \
  1028. } while (0)
  1029. /* Macros Controlling Initialization Routines. */
  1030. /* This is handled by sysv4.h. */
  1031. /* Output of Assembler Instructions. */
  1032. /* A C initializer containing the assembler's names for the machine registers,
  1033. each one as a C string constant. */
  1034. #define REGISTER_NAMES \
  1035. { \
  1036. /* General registers. */ \
  1037. "ap", "r1", "r2", "r3", "r4", "r5", "r6", "r7", "r8", "r9", \
  1038. "r10", "r11", "r12", "r13", "r14", "r15", "r16", "r17", "r18", "r19", \
  1039. "r20", "r21", "r22", "r23", "r24", "r25", "r26", "r27", "r28", "r29", \
  1040. "r30", "r31", \
  1041. /* Local registers. */ \
  1042. "loc0", "loc1", "loc2", "loc3", "loc4", "loc5", "loc6", "loc7", \
  1043. "loc8", "loc9", "loc10","loc11","loc12","loc13","loc14","loc15", \
  1044. "loc16","loc17","loc18","loc19","loc20","loc21","loc22","loc23", \
  1045. "loc24","loc25","loc26","loc27","loc28","loc29","loc30","loc31", \
  1046. "loc32","loc33","loc34","loc35","loc36","loc37","loc38","loc39", \
  1047. "loc40","loc41","loc42","loc43","loc44","loc45","loc46","loc47", \
  1048. "loc48","loc49","loc50","loc51","loc52","loc53","loc54","loc55", \
  1049. "loc56","loc57","loc58","loc59","loc60","loc61","loc62","loc63", \
  1050. "loc64","loc65","loc66","loc67","loc68","loc69","loc70","loc71", \
  1051. "loc72","loc73","loc74","loc75","loc76","loc77","loc78","loc79", \
  1052. /* Input registers. */ \
  1053. "in0", "in1", "in2", "in3", "in4", "in5", "in6", "in7", \
  1054. /* Output registers. */ \
  1055. "out0", "out1", "out2", "out3", "out4", "out5", "out6", "out7", \
  1056. /* Floating-point registers. */ \
  1057. "f0", "f1", "f2", "f3", "f4", "f5", "f6", "f7", "f8", "f9", \
  1058. "f10", "f11", "f12", "f13", "f14", "f15", "f16", "f17", "f18", "f19", \
  1059. "f20", "f21", "f22", "f23", "f24", "f25", "f26", "f27", "f28", "f29", \
  1060. "f30", "f31", "f32", "f33", "f34", "f35", "f36", "f37", "f38", "f39", \
  1061. "f40", "f41", "f42", "f43", "f44", "f45", "f46", "f47", "f48", "f49", \
  1062. "f50", "f51", "f52", "f53", "f54", "f55", "f56", "f57", "f58", "f59", \
  1063. "f60", "f61", "f62", "f63", "f64", "f65", "f66", "f67", "f68", "f69", \
  1064. "f70", "f71", "f72", "f73", "f74", "f75", "f76", "f77", "f78", "f79", \
  1065. "f80", "f81", "f82", "f83", "f84", "f85", "f86", "f87", "f88", "f89", \
  1066. "f90", "f91", "f92", "f93", "f94", "f95", "f96", "f97", "f98", "f99", \
  1067. "f100","f101","f102","f103","f104","f105","f106","f107","f108","f109",\
  1068. "f110","f111","f112","f113","f114","f115","f116","f117","f118","f119",\
  1069. "f120","f121","f122","f123","f124","f125","f126","f127", \
  1070. /* Predicate registers. */ \
  1071. "p0", "p1", "p2", "p3", "p4", "p5", "p6", "p7", "p8", "p9", \
  1072. "p10", "p11", "p12", "p13", "p14", "p15", "p16", "p17", "p18", "p19", \
  1073. "p20", "p21", "p22", "p23", "p24", "p25", "p26", "p27", "p28", "p29", \
  1074. "p30", "p31", "p32", "p33", "p34", "p35", "p36", "p37", "p38", "p39", \
  1075. "p40", "p41", "p42", "p43", "p44", "p45", "p46", "p47", "p48", "p49", \
  1076. "p50", "p51", "p52", "p53", "p54", "p55", "p56", "p57", "p58", "p59", \
  1077. "p60", "p61", "p62", "p63", \
  1078. /* Branch registers. */ \
  1079. "b0", "b1", "b2", "b3", "b4", "b5", "b6", "b7", \
  1080. /* Frame pointer. Application registers. */ \
  1081. "sfp", "ar.ccv", "ar.unat", "ar.pfs", "ar.lc", "ar.ec", \
  1082. }
  1083. /* If defined, a C initializer for an array of structures containing a name and
  1084. a register number. This macro defines additional names for hard registers,
  1085. thus allowing the `asm' option in declarations to refer to registers using
  1086. alternate names. */
  1087. #define ADDITIONAL_REGISTER_NAMES \
  1088. { \
  1089. { "gp", R_GR (1) }, \
  1090. { "sp", R_GR (12) }, \
  1091. { "in0", IN_REG (0) }, \
  1092. { "in1", IN_REG (1) }, \
  1093. { "in2", IN_REG (2) }, \
  1094. { "in3", IN_REG (3) }, \
  1095. { "in4", IN_REG (4) }, \
  1096. { "in5", IN_REG (5) }, \
  1097. { "in6", IN_REG (6) }, \
  1098. { "in7", IN_REG (7) }, \
  1099. { "out0", OUT_REG (0) }, \
  1100. { "out1", OUT_REG (1) }, \
  1101. { "out2", OUT_REG (2) }, \
  1102. { "out3", OUT_REG (3) }, \
  1103. { "out4", OUT_REG (4) }, \
  1104. { "out5", OUT_REG (5) }, \
  1105. { "out6", OUT_REG (6) }, \
  1106. { "out7", OUT_REG (7) }, \
  1107. { "loc0", LOC_REG (0) }, \
  1108. { "loc1", LOC_REG (1) }, \
  1109. { "loc2", LOC_REG (2) }, \
  1110. { "loc3", LOC_REG (3) }, \
  1111. { "loc4", LOC_REG (4) }, \
  1112. { "loc5", LOC_REG (5) }, \
  1113. { "loc6", LOC_REG (6) }, \
  1114. { "loc7", LOC_REG (7) }, \
  1115. { "loc8", LOC_REG (8) }, \
  1116. { "loc9", LOC_REG (9) }, \
  1117. { "loc10", LOC_REG (10) }, \
  1118. { "loc11", LOC_REG (11) }, \
  1119. { "loc12", LOC_REG (12) }, \
  1120. { "loc13", LOC_REG (13) }, \
  1121. { "loc14", LOC_REG (14) }, \
  1122. { "loc15", LOC_REG (15) }, \
  1123. { "loc16", LOC_REG (16) }, \
  1124. { "loc17", LOC_REG (17) }, \
  1125. { "loc18", LOC_REG (18) }, \
  1126. { "loc19", LOC_REG (19) }, \
  1127. { "loc20", LOC_REG (20) }, \
  1128. { "loc21", LOC_REG (21) }, \
  1129. { "loc22", LOC_REG (22) }, \
  1130. { "loc23", LOC_REG (23) }, \
  1131. { "loc24", LOC_REG (24) }, \
  1132. { "loc25", LOC_REG (25) }, \
  1133. { "loc26", LOC_REG (26) }, \
  1134. { "loc27", LOC_REG (27) }, \
  1135. { "loc28", LOC_REG (28) }, \
  1136. { "loc29", LOC_REG (29) }, \
  1137. { "loc30", LOC_REG (30) }, \
  1138. { "loc31", LOC_REG (31) }, \
  1139. { "loc32", LOC_REG (32) }, \
  1140. { "loc33", LOC_REG (33) }, \
  1141. { "loc34", LOC_REG (34) }, \
  1142. { "loc35", LOC_REG (35) }, \
  1143. { "loc36", LOC_REG (36) }, \
  1144. { "loc37", LOC_REG (37) }, \
  1145. { "loc38", LOC_REG (38) }, \
  1146. { "loc39", LOC_REG (39) }, \
  1147. { "loc40", LOC_REG (40) }, \
  1148. { "loc41", LOC_REG (41) }, \
  1149. { "loc42", LOC_REG (42) }, \
  1150. { "loc43", LOC_REG (43) }, \
  1151. { "loc44", LOC_REG (44) }, \
  1152. { "loc45", LOC_REG (45) }, \
  1153. { "loc46", LOC_REG (46) }, \
  1154. { "loc47", LOC_REG (47) }, \
  1155. { "loc48", LOC_REG (48) }, \
  1156. { "loc49", LOC_REG (49) }, \
  1157. { "loc50", LOC_REG (50) }, \
  1158. { "loc51", LOC_REG (51) }, \
  1159. { "loc52", LOC_REG (52) }, \
  1160. { "loc53", LOC_REG (53) }, \
  1161. { "loc54", LOC_REG (54) }, \
  1162. { "loc55", LOC_REG (55) }, \
  1163. { "loc56", LOC_REG (56) }, \
  1164. { "loc57", LOC_REG (57) }, \
  1165. { "loc58", LOC_REG (58) }, \
  1166. { "loc59", LOC_REG (59) }, \
  1167. { "loc60", LOC_REG (60) }, \
  1168. { "loc61", LOC_REG (61) }, \
  1169. { "loc62", LOC_REG (62) }, \
  1170. { "loc63", LOC_REG (63) }, \
  1171. { "loc64", LOC_REG (64) }, \
  1172. { "loc65", LOC_REG (65) }, \
  1173. { "loc66", LOC_REG (66) }, \
  1174. { "loc67", LOC_REG (67) }, \
  1175. { "loc68", LOC_REG (68) }, \
  1176. { "loc69", LOC_REG (69) }, \
  1177. { "loc70", LOC_REG (70) }, \
  1178. { "loc71", LOC_REG (71) }, \
  1179. { "loc72", LOC_REG (72) }, \
  1180. { "loc73", LOC_REG (73) }, \
  1181. { "loc74", LOC_REG (74) }, \
  1182. { "loc75", LOC_REG (75) }, \
  1183. { "loc76", LOC_REG (76) }, \
  1184. { "loc77", LOC_REG (77) }, \
  1185. { "loc78", LOC_REG (78) }, \
  1186. { "loc79", LOC_REG (79) }, \
  1187. }
  1188. /* If defined, C string expressions to be used for the `%R', `%L', `%U', and
  1189. `%I' options of `asm_fprintf' (see `final.c'). */
  1190. #define REGISTER_PREFIX ""
  1191. #define LOCAL_LABEL_PREFIX "."
  1192. #define USER_LABEL_PREFIX ""
  1193. #define IMMEDIATE_PREFIX ""
  1194. /* Output of dispatch tables. */
  1195. /* This macro should be provided on machines where the addresses in a dispatch
  1196. table are relative to the table's own address. */
  1197. /* ??? Depends on the pointer size. */
  1198. #define ASM_OUTPUT_ADDR_DIFF_ELT(STREAM, BODY, VALUE, REL) \
  1199. do { \
  1200. if (CASE_VECTOR_MODE == SImode) \
  1201. fprintf (STREAM, "\tdata4 @pcrel(.L%d)\n", VALUE); \
  1202. else \
  1203. fprintf (STREAM, "\tdata8 @pcrel(.L%d)\n", VALUE); \
  1204. } while (0)
  1205. /* Jump tables only need 4 or 8 byte alignment. */
  1206. #define ADDR_VEC_ALIGN(ADDR_VEC) (CASE_VECTOR_MODE == SImode ? 2 : 3)
  1207. /* Assembler Commands for Exception Regions. */
  1208. /* Select a format to encode pointers in exception handling data. CODE
  1209. is 0 for data, 1 for code labels, 2 for function pointers. GLOBAL is
  1210. true if the symbol may be affected by dynamic relocations. */
  1211. #define ASM_PREFERRED_EH_DATA_FORMAT(CODE,GLOBAL) \
  1212. (((CODE) == 1 ? DW_EH_PE_textrel : DW_EH_PE_datarel) \
  1213. | ((GLOBAL) ? DW_EH_PE_indirect : 0) \
  1214. | (TARGET_ILP32 ? DW_EH_PE_udata4 : DW_EH_PE_udata8))
  1215. /* Handle special EH pointer encodings. Absolute, pc-relative, and
  1216. indirect are handled automatically. */
  1217. #define ASM_MAYBE_OUTPUT_ENCODED_ADDR_RTX(FILE, ENCODING, SIZE, ADDR, DONE) \
  1218. do { \
  1219. const char *reltag = NULL; \
  1220. if (((ENCODING) & 0xF0) == DW_EH_PE_textrel) \
  1221. reltag = "@segrel("; \
  1222. else if (((ENCODING) & 0xF0) == DW_EH_PE_datarel) \
  1223. reltag = "@gprel("; \
  1224. if (reltag) \
  1225. { \
  1226. fputs (integer_asm_op (SIZE, FALSE), FILE); \
  1227. fputs (reltag, FILE); \
  1228. assemble_name (FILE, XSTR (ADDR, 0)); \
  1229. fputc (')', FILE); \
  1230. goto DONE; \
  1231. } \
  1232. } while (0)
  1233. /* Assembler Commands for Alignment. */
  1234. /* ??? Investigate. */
  1235. /* The alignment (log base 2) to put in front of LABEL, which follows
  1236. a BARRIER. */
  1237. /* #define LABEL_ALIGN_AFTER_BARRIER(LABEL) */
  1238. /* The desired alignment for the location counter at the beginning
  1239. of a loop. */
  1240. /* #define LOOP_ALIGN(LABEL) */
  1241. /* Define this macro if `ASM_OUTPUT_SKIP' should not be used in the text
  1242. section because it fails put zeros in the bytes that are skipped. */
  1243. #define ASM_NO_SKIP_IN_TEXT 1
  1244. /* A C statement to output to the stdio stream STREAM an assembler command to
  1245. advance the location counter to a multiple of 2 to the POWER bytes. */
  1246. #define ASM_OUTPUT_ALIGN(STREAM, POWER) \
  1247. fprintf (STREAM, "\t.align %d\n", 1<<(POWER))
  1248. /* Macros Affecting all Debug Formats. */
  1249. /* This is handled in sysv4.h. */
  1250. /* Specific Options for DBX Output. */
  1251. /* This is handled by dbxelf.h. */
  1252. /* Open ended Hooks for DBX Output. */
  1253. /* Likewise. */
  1254. /* File names in DBX format. */
  1255. /* Likewise. */
  1256. /* Macros for SDB and Dwarf Output. */
  1257. /* Define this macro if GCC should produce dwarf version 2 format debugging
  1258. output in response to the `-g' option. */
  1259. #define DWARF2_DEBUGGING_INFO 1
  1260. #define DWARF2_ASM_LINE_DEBUG_INFO (TARGET_DWARF2_ASM)
  1261. /* Use tags for debug info labels, so that they don't break instruction
  1262. bundles. This also avoids getting spurious DV warnings from the
  1263. assembler. This is similar to (*targetm.asm_out.internal_label), except that we
  1264. add brackets around the label. */
  1265. #define ASM_OUTPUT_DEBUG_LABEL(FILE, PREFIX, NUM) \
  1266. fprintf (FILE, TARGET_GNU_AS ? "[.%s%d:]\n" : ".%s%d:\n", PREFIX, NUM)
  1267. /* Use section-relative relocations for debugging offsets. Unlike other
  1268. targets that fake this by putting the section VMA at 0, IA-64 has
  1269. proper relocations for them. */
  1270. #define ASM_OUTPUT_DWARF_OFFSET(FILE, SIZE, LABEL, SECTION) \
  1271. do { \
  1272. fputs (integer_asm_op (SIZE, FALSE), FILE); \
  1273. fputs ("@secrel(", FILE); \
  1274. assemble_name (FILE, LABEL); \
  1275. fputc (')', FILE); \
  1276. } while (0)
  1277. /* Emit a PC-relative relocation. */
  1278. #define ASM_OUTPUT_DWARF_PCREL(FILE, SIZE, LABEL) \
  1279. do { \
  1280. fputs (integer_asm_op (SIZE, FALSE), FILE); \
  1281. fputs ("@pcrel(", FILE); \
  1282. assemble_name (FILE, LABEL); \
  1283. fputc (')', FILE); \
  1284. } while (0)
  1285. /* Register Renaming Parameters. */
  1286. /* A C expression that is nonzero if hard register number REGNO2 can be
  1287. considered for use as a rename register for REGNO1 */
  1288. #define HARD_REGNO_RENAME_OK(REGNO1,REGNO2) \
  1289. ia64_hard_regno_rename_ok((REGNO1), (REGNO2))
  1290. /* Miscellaneous Parameters. */
  1291. /* Flag to mark data that is in the small address area (addressable
  1292. via "addl", that is, within a 2MByte offset of 0. */
  1293. #define SYMBOL_FLAG_SMALL_ADDR (SYMBOL_FLAG_MACH_DEP << 0)
  1294. #define SYMBOL_REF_SMALL_ADDR_P(X) \
  1295. ((SYMBOL_REF_FLAGS (X) & SYMBOL_FLAG_SMALL_ADDR) != 0)
  1296. /* An alias for a machine mode name. This is the machine mode that elements of
  1297. a jump-table should have. */
  1298. #define CASE_VECTOR_MODE ptr_mode
  1299. /* Define as C expression which evaluates to nonzero if the tablejump
  1300. instruction expects the table to contain offsets from the address of the
  1301. table. */
  1302. #define CASE_VECTOR_PC_RELATIVE 1
  1303. /* Define this macro if operations between registers with integral mode smaller
  1304. than a word are always performed on the entire register. */
  1305. #define WORD_REGISTER_OPERATIONS
  1306. /* Define this macro to be a C expression indicating when insns that read
  1307. memory in MODE, an integral mode narrower than a word, set the bits outside
  1308. of MODE to be either the sign-extension or the zero-extension of the data
  1309. read. */
  1310. #define LOAD_EXTEND_OP(MODE) ZERO_EXTEND
  1311. /* The maximum number of bytes that a single instruction can move quickly from
  1312. memory to memory. */
  1313. #define MOVE_MAX 8
  1314. /* A C expression which is nonzero if on this machine it is safe to "convert"
  1315. an integer of INPREC bits to one of OUTPREC bits (where OUTPREC is smaller
  1316. than INPREC) by merely operating on it as if it had only OUTPREC bits. */
  1317. #define TRULY_NOOP_TRUNCATION(OUTPREC, INPREC) 1
  1318. /* A C expression describing the value returned by a comparison operator with
  1319. an integral mode and stored by a store-flag instruction (`sCOND') when the
  1320. condition is true. */
  1321. /* ??? Investigate using STORE_FLAG_VALUE of -1 instead of 1. */
  1322. /* An alias for the machine mode for pointers. */
  1323. /* ??? This would change if we had ILP32 support. */
  1324. #define Pmode DImode
  1325. /* An alias for the machine mode used for memory references to functions being
  1326. called, in `call' RTL expressions. */
  1327. #define FUNCTION_MODE Pmode
  1328. /* A C expression for the maximum number of instructions to execute via
  1329. conditional execution instructions instead of a branch. A value of
  1330. BRANCH_COST+1 is the default if the machine does not use
  1331. cc0, and 1 if it does use cc0. */
  1332. /* ??? Investigate. */
  1333. #define MAX_CONDITIONAL_EXECUTE 12
  1334. extern int ia64_final_schedule;
  1335. #define TARGET_UNWIND_TABLES_DEFAULT true
  1336. #define EH_RETURN_DATA_REGNO(N) ((N) < 4 ? (N) + 15 : INVALID_REGNUM)
  1337. /* This function contains machine specific function data. */
  1338. struct GTY(()) machine_function
  1339. {
  1340. /* The new stack pointer when unwinding from EH. */
  1341. rtx ia64_eh_epilogue_sp;
  1342. /* The new bsp value when unwinding from EH. */
  1343. rtx ia64_eh_epilogue_bsp;
  1344. /* The GP value save register. */
  1345. rtx ia64_gp_save;
  1346. /* The number of varargs registers to save. */
  1347. int n_varargs;
  1348. /* The number of the next unwind state to copy. */
  1349. int state_num;
  1350. };
  1351. #define DONT_USE_BUILTIN_SETJMP
  1352. /* Output any profiling code before the prologue. */
  1353. #undef PROFILE_BEFORE_PROLOGUE
  1354. #define PROFILE_BEFORE_PROLOGUE 1
  1355. /* Initialize library function table. */
  1356. #undef TARGET_INIT_LIBFUNCS
  1357. #define TARGET_INIT_LIBFUNCS ia64_init_libfuncs
  1358. /* Switch on code for querying unit reservations. */
  1359. #define CPU_UNITS_QUERY 1
  1360. /* End of ia64.h */