s390.h 35 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988
  1. /* Definitions of target machine for GNU compiler, for IBM S/390
  2. Copyright (C) 1999-2015 Free Software Foundation, Inc.
  3. Contributed by Hartmut Penner (hpenner@de.ibm.com) and
  4. Ulrich Weigand (uweigand@de.ibm.com).
  5. Andreas Krebbel (Andreas.Krebbel@de.ibm.com)
  6. This file is part of GCC.
  7. GCC is free software; you can redistribute it and/or modify it under
  8. the terms of the GNU General Public License as published by the Free
  9. Software Foundation; either version 3, or (at your option) any later
  10. version.
  11. GCC is distributed in the hope that it will be useful, but WITHOUT ANY
  12. WARRANTY; without even the implied warranty of MERCHANTABILITY or
  13. FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
  14. for more details.
  15. You should have received a copy of the GNU General Public License
  16. along with GCC; see the file COPYING3. If not see
  17. <http://www.gnu.org/licenses/>. */
  18. #ifndef _S390_H
  19. #define _S390_H
  20. /* Optional architectural facilities supported by the processor. */
  21. enum processor_flags
  22. {
  23. PF_IEEE_FLOAT = 1,
  24. PF_ZARCH = 2,
  25. PF_LONG_DISPLACEMENT = 4,
  26. PF_EXTIMM = 8,
  27. PF_DFP = 16,
  28. PF_Z10 = 32,
  29. PF_Z196 = 64,
  30. PF_ZEC12 = 128,
  31. PF_TX = 256,
  32. PF_Z13 = 512,
  33. PF_VX = 1024
  34. };
  35. /* This is necessary to avoid a warning about comparing different enum
  36. types. */
  37. #define s390_tune_attr ((enum attr_cpu)s390_tune)
  38. /* These flags indicate that the generated code should run on a cpu
  39. providing the respective hardware facility regardless of the
  40. current cpu mode (ESA or z/Architecture). */
  41. #define TARGET_CPU_IEEE_FLOAT \
  42. (s390_arch_flags & PF_IEEE_FLOAT)
  43. #define TARGET_CPU_ZARCH \
  44. (s390_arch_flags & PF_ZARCH)
  45. #define TARGET_CPU_LONG_DISPLACEMENT \
  46. (s390_arch_flags & PF_LONG_DISPLACEMENT)
  47. #define TARGET_CPU_EXTIMM \
  48. (s390_arch_flags & PF_EXTIMM)
  49. #define TARGET_CPU_DFP \
  50. (s390_arch_flags & PF_DFP)
  51. #define TARGET_CPU_Z10 \
  52. (s390_arch_flags & PF_Z10)
  53. #define TARGET_CPU_Z196 \
  54. (s390_arch_flags & PF_Z196)
  55. #define TARGET_CPU_ZEC12 \
  56. (s390_arch_flags & PF_ZEC12)
  57. #define TARGET_CPU_HTM \
  58. (s390_arch_flags & PF_TX)
  59. #define TARGET_CPU_Z13 \
  60. (s390_arch_flags & PF_Z13)
  61. #define TARGET_CPU_VX \
  62. (s390_arch_flags & PF_VX)
  63. /* These flags indicate that the generated code should run on a cpu
  64. providing the respective hardware facility when run in
  65. z/Architecture mode. */
  66. #define TARGET_LONG_DISPLACEMENT \
  67. (TARGET_ZARCH && TARGET_CPU_LONG_DISPLACEMENT)
  68. #define TARGET_EXTIMM \
  69. (TARGET_ZARCH && TARGET_CPU_EXTIMM)
  70. #define TARGET_DFP \
  71. (TARGET_ZARCH && TARGET_CPU_DFP && TARGET_HARD_FLOAT)
  72. #define TARGET_Z10 \
  73. (TARGET_ZARCH && TARGET_CPU_Z10)
  74. #define TARGET_Z196 \
  75. (TARGET_ZARCH && TARGET_CPU_Z196)
  76. #define TARGET_ZEC12 \
  77. (TARGET_ZARCH && TARGET_CPU_ZEC12)
  78. #define TARGET_HTM (TARGET_OPT_HTM)
  79. #define TARGET_Z13 \
  80. (TARGET_ZARCH && TARGET_CPU_Z13)
  81. #define TARGET_VX \
  82. (TARGET_ZARCH && TARGET_CPU_VX && TARGET_OPT_VX && TARGET_HARD_FLOAT)
  83. /* Use the ABI introduced with IBM z13:
  84. - pass vector arguments <= 16 bytes in VRs
  85. - align *all* vector types to 8 bytes */
  86. #define TARGET_VX_ABI TARGET_VX
  87. #define TARGET_AVOID_CMP_AND_BRANCH (s390_tune == PROCESSOR_2817_Z196)
  88. /* Run-time target specification. */
  89. /* Defaults for option flags defined only on some subtargets. */
  90. #ifndef TARGET_TPF_PROFILING
  91. #define TARGET_TPF_PROFILING 0
  92. #endif
  93. /* This will be overridden by OS headers. */
  94. #define TARGET_TPF 0
  95. /* Target CPU builtins. */
  96. #define TARGET_CPU_CPP_BUILTINS() s390_cpu_cpp_builtins (pfile)
  97. #ifdef DEFAULT_TARGET_64BIT
  98. #define TARGET_DEFAULT (MASK_64BIT | MASK_ZARCH | MASK_HARD_DFP \
  99. | MASK_OPT_HTM | MASK_OPT_VX)
  100. #else
  101. #define TARGET_DEFAULT 0
  102. #endif
  103. /* Support for configure-time defaults. */
  104. #define OPTION_DEFAULT_SPECS \
  105. { "mode", "%{!mesa:%{!mzarch:-m%(VALUE)}}" }, \
  106. { "arch", "%{!march=*:-march=%(VALUE)}" }, \
  107. { "tune", "%{!mtune=*:-mtune=%(VALUE)}" }
  108. /* Defaulting rules. */
  109. #ifdef DEFAULT_TARGET_64BIT
  110. #define DRIVER_SELF_SPECS \
  111. "%{!m31:%{!m64:-m64}}", \
  112. "%{!mesa:%{!mzarch:%{m31:-mesa}%{m64:-mzarch}}}", \
  113. "%{!march=*:%{mesa:-march=g5}%{mzarch:-march=z900}}"
  114. #else
  115. #define DRIVER_SELF_SPECS \
  116. "%{!m31:%{!m64:-m31}}", \
  117. "%{!mesa:%{!mzarch:%{m31:-mesa}%{m64:-mzarch}}}", \
  118. "%{!march=*:%{mesa:-march=g5}%{mzarch:-march=z900}}"
  119. #endif
  120. /* Constants needed to control the TEST DATA CLASS (TDC) instruction. */
  121. #define S390_TDC_POSITIVE_ZERO (1 << 11)
  122. #define S390_TDC_NEGATIVE_ZERO (1 << 10)
  123. #define S390_TDC_POSITIVE_NORMALIZED_BFP_NUMBER (1 << 9)
  124. #define S390_TDC_NEGATIVE_NORMALIZED_BFP_NUMBER (1 << 8)
  125. #define S390_TDC_POSITIVE_DENORMALIZED_BFP_NUMBER (1 << 7)
  126. #define S390_TDC_NEGATIVE_DENORMALIZED_BFP_NUMBER (1 << 6)
  127. #define S390_TDC_POSITIVE_INFINITY (1 << 5)
  128. #define S390_TDC_NEGATIVE_INFINITY (1 << 4)
  129. #define S390_TDC_POSITIVE_QUIET_NAN (1 << 3)
  130. #define S390_TDC_NEGATIVE_QUIET_NAN (1 << 2)
  131. #define S390_TDC_POSITIVE_SIGNALING_NAN (1 << 1)
  132. #define S390_TDC_NEGATIVE_SIGNALING_NAN (1 << 0)
  133. /* The following values are different for DFP. */
  134. #define S390_TDC_POSITIVE_DENORMALIZED_DFP_NUMBER (1 << 9)
  135. #define S390_TDC_NEGATIVE_DENORMALIZED_DFP_NUMBER (1 << 8)
  136. #define S390_TDC_POSITIVE_NORMALIZED_DFP_NUMBER (1 << 7)
  137. #define S390_TDC_NEGATIVE_NORMALIZED_DFP_NUMBER (1 << 6)
  138. /* For signbit, the BFP-DFP-difference makes no difference. */
  139. #define S390_TDC_SIGNBIT_SET (S390_TDC_NEGATIVE_ZERO \
  140. | S390_TDC_NEGATIVE_NORMALIZED_BFP_NUMBER \
  141. | S390_TDC_NEGATIVE_DENORMALIZED_BFP_NUMBER\
  142. | S390_TDC_NEGATIVE_INFINITY \
  143. | S390_TDC_NEGATIVE_QUIET_NAN \
  144. | S390_TDC_NEGATIVE_SIGNALING_NAN )
  145. #define S390_TDC_INFINITY (S390_TDC_POSITIVE_INFINITY \
  146. | S390_TDC_NEGATIVE_INFINITY )
  147. /* This is used by float.h to define the float_t and double_t data
  148. types. For historical reasons both are double on s390 what cannot
  149. be changed anymore. */
  150. #define TARGET_FLT_EVAL_METHOD 1
  151. /* Target machine storage layout. */
  152. /* Everything is big-endian. */
  153. #define BITS_BIG_ENDIAN 1
  154. #define BYTES_BIG_ENDIAN 1
  155. #define WORDS_BIG_ENDIAN 1
  156. #define STACK_SIZE_MODE (Pmode)
  157. /* Vector arguments are left-justified when placed on the stack during
  158. parameter passing. */
  159. #define FUNCTION_ARG_PADDING(MODE, TYPE) \
  160. (s390_function_arg_vector ((MODE), (TYPE)) \
  161. ? upward \
  162. : DEFAULT_FUNCTION_ARG_PADDING ((MODE), (TYPE)))
  163. #ifndef IN_LIBGCC2
  164. /* Width of a word, in units (bytes). */
  165. #define UNITS_PER_WORD (TARGET_ZARCH ? 8 : 4)
  166. /* Width of a pointer. To be used instead of UNITS_PER_WORD in
  167. ABI-relevant contexts. This always matches
  168. GET_MODE_SIZE (Pmode). */
  169. #define UNITS_PER_LONG (TARGET_64BIT ? 8 : 4)
  170. #define MIN_UNITS_PER_WORD 4
  171. #define MAX_BITS_PER_WORD 64
  172. #else
  173. /* In libgcc, UNITS_PER_WORD has ABI-relevant effects, e.g. whether
  174. the library should export TImode functions or not. Thus, we have
  175. to redefine UNITS_PER_WORD depending on __s390x__ for libgcc. */
  176. #ifdef __s390x__
  177. #define UNITS_PER_WORD 8
  178. #else
  179. #define UNITS_PER_WORD 4
  180. #endif
  181. #endif
  182. /* Width of a pointer, in bits. */
  183. #define POINTER_SIZE (TARGET_64BIT ? 64 : 32)
  184. /* Allocation boundary (in *bits*) for storing arguments in argument list. */
  185. #define PARM_BOUNDARY (TARGET_64BIT ? 64 : 32)
  186. /* Boundary (in *bits*) on which stack pointer should be aligned. */
  187. #define STACK_BOUNDARY 64
  188. /* Allocation boundary (in *bits*) for the code of a function. */
  189. #define FUNCTION_BOUNDARY 64
  190. /* There is no point aligning anything to a rounder boundary than this. */
  191. #define BIGGEST_ALIGNMENT 64
  192. /* Alignment of field after `int : 0' in a structure. */
  193. #define EMPTY_FIELD_BOUNDARY 32
  194. /* Alignment on even addresses for LARL instruction. */
  195. #define CONSTANT_ALIGNMENT(EXP, ALIGN) (ALIGN) < 16 ? 16 : (ALIGN)
  196. #define DATA_ABI_ALIGNMENT(TYPE, ALIGN) (ALIGN) < 16 ? 16 : (ALIGN)
  197. /* Alignment is not required by the hardware. */
  198. #define STRICT_ALIGNMENT 0
  199. /* Mode of stack savearea.
  200. FUNCTION is VOIDmode because calling convention maintains SP.
  201. BLOCK needs Pmode for SP.
  202. NONLOCAL needs twice Pmode to maintain both backchain and SP. */
  203. #define STACK_SAVEAREA_MODE(LEVEL) \
  204. (LEVEL == SAVE_FUNCTION ? VOIDmode \
  205. : LEVEL == SAVE_NONLOCAL ? (TARGET_64BIT ? OImode : TImode) : Pmode)
  206. /* Type layout. */
  207. /* Sizes in bits of the source language data types. */
  208. #define SHORT_TYPE_SIZE 16
  209. #define INT_TYPE_SIZE 32
  210. #define LONG_TYPE_SIZE (TARGET_64BIT ? 64 : 32)
  211. #define LONG_LONG_TYPE_SIZE 64
  212. #define FLOAT_TYPE_SIZE 32
  213. #define DOUBLE_TYPE_SIZE 64
  214. #define LONG_DOUBLE_TYPE_SIZE (TARGET_LONG_DOUBLE_128 ? 128 : 64)
  215. /* Work around target_flags dependency in ada/targtyps.c. */
  216. #define WIDEST_HARDWARE_FP_SIZE 64
  217. /* We use "unsigned char" as default. */
  218. #define DEFAULT_SIGNED_CHAR 0
  219. /* Register usage. */
  220. /* We have 16 general purpose registers (registers 0-15),
  221. and 16 floating point registers (registers 16-31).
  222. (On non-IEEE machines, we have only 4 fp registers.)
  223. Amongst the general purpose registers, some are used
  224. for specific purposes:
  225. GPR 11: Hard frame pointer (if needed)
  226. GPR 12: Global offset table pointer (if needed)
  227. GPR 13: Literal pool base register
  228. GPR 14: Return address register
  229. GPR 15: Stack pointer
  230. Registers 32-35 are 'fake' hard registers that do not
  231. correspond to actual hardware:
  232. Reg 32: Argument pointer
  233. Reg 33: Condition code
  234. Reg 34: Frame pointer
  235. Reg 35: Return address pointer
  236. Registers 36 and 37 are mapped to access registers
  237. 0 and 1, used to implement thread-local storage.
  238. Reg 38-53: Vector registers v16-v31 */
  239. #define FIRST_PSEUDO_REGISTER 54
  240. /* Standard register usage. */
  241. #define GENERAL_REGNO_P(N) ((int)(N) >= 0 && (N) < 16)
  242. #define ADDR_REGNO_P(N) ((N) >= 1 && (N) < 16)
  243. #define FP_REGNO_P(N) ((N) >= 16 && (N) < 32)
  244. #define CC_REGNO_P(N) ((N) == 33)
  245. #define FRAME_REGNO_P(N) ((N) == 32 || (N) == 34 || (N) == 35)
  246. #define ACCESS_REGNO_P(N) ((N) == 36 || (N) == 37)
  247. #define VECTOR_NOFP_REGNO_P(N) ((N) >= 38 && (N) <= 53)
  248. #define VECTOR_REGNO_P(N) (FP_REGNO_P (N) || VECTOR_NOFP_REGNO_P (N))
  249. #define GENERAL_REG_P(X) (REG_P (X) && GENERAL_REGNO_P (REGNO (X)))
  250. #define ADDR_REG_P(X) (REG_P (X) && ADDR_REGNO_P (REGNO (X)))
  251. #define FP_REG_P(X) (REG_P (X) && FP_REGNO_P (REGNO (X)))
  252. #define CC_REG_P(X) (REG_P (X) && CC_REGNO_P (REGNO (X)))
  253. #define FRAME_REG_P(X) (REG_P (X) && FRAME_REGNO_P (REGNO (X)))
  254. #define ACCESS_REG_P(X) (REG_P (X) && ACCESS_REGNO_P (REGNO (X)))
  255. #define VECTOR_NOFP_REG_P(X) (REG_P (X) && VECTOR_NOFP_REGNO_P (REGNO (X)))
  256. #define VECTOR_REG_P(X) (REG_P (X) && VECTOR_REGNO_P (REGNO (X)))
  257. /* Set up fixed registers and calling convention:
  258. GPRs 0-5 are always call-clobbered,
  259. GPRs 6-15 are always call-saved.
  260. GPR 12 is fixed if used as GOT pointer.
  261. GPR 13 is always fixed (as literal pool pointer).
  262. GPR 14 is always fixed on S/390 machines (as return address).
  263. GPR 15 is always fixed (as stack pointer).
  264. The 'fake' hard registers are call-clobbered and fixed.
  265. The access registers are call-saved and fixed.
  266. On 31-bit, FPRs 18-19 are call-clobbered;
  267. on 64-bit, FPRs 24-31 are call-clobbered.
  268. The remaining FPRs are call-saved.
  269. All non-FP vector registers are call-clobbered v16-v31. */
  270. #define FIXED_REGISTERS \
  271. { 0, 0, 0, 0, \
  272. 0, 0, 0, 0, \
  273. 0, 0, 0, 0, \
  274. 0, 1, 1, 1, \
  275. 0, 0, 0, 0, \
  276. 0, 0, 0, 0, \
  277. 0, 0, 0, 0, \
  278. 0, 0, 0, 0, \
  279. 1, 1, 1, 1, \
  280. 1, 1, \
  281. 0, 0, 0, 0, \
  282. 0, 0, 0, 0, \
  283. 0, 0, 0, 0, \
  284. 0, 0, 0, 0 }
  285. #define CALL_USED_REGISTERS \
  286. { 1, 1, 1, 1, \
  287. 1, 1, 0, 0, \
  288. 0, 0, 0, 0, \
  289. 0, 1, 1, 1, \
  290. 1, 1, 1, 1, \
  291. 1, 1, 1, 1, \
  292. 1, 1, 1, 1, \
  293. 1, 1, 1, 1, \
  294. 1, 1, 1, 1, \
  295. 1, 1, \
  296. 1, 1, 1, 1, \
  297. 1, 1, 1, 1, \
  298. 1, 1, 1, 1, \
  299. 1, 1, 1, 1 }
  300. #define CALL_REALLY_USED_REGISTERS \
  301. { 1, 1, 1, 1, /* r0 - r15 */ \
  302. 1, 1, 0, 0, \
  303. 0, 0, 0, 0, \
  304. 0, 0, 0, 0, \
  305. 1, 1, 1, 1, /* f0 (16) - f15 (31) */ \
  306. 1, 1, 1, 1, \
  307. 1, 1, 1, 1, \
  308. 1, 1, 1, 1, \
  309. 1, 1, 1, 1, /* arg, cc, fp, ret addr */ \
  310. 0, 0, /* a0 (36), a1 (37) */ \
  311. 1, 1, 1, 1, /* v16 (38) - v23 (45) */ \
  312. 1, 1, 1, 1, \
  313. 1, 1, 1, 1, /* v24 (46) - v31 (53) */ \
  314. 1, 1, 1, 1 }
  315. /* Preferred register allocation order. */
  316. #define REG_ALLOC_ORDER \
  317. { 1, 2, 3, 4, 5, 0, 12, 11, 10, 9, 8, 7, 6, 14, 13, \
  318. 16, 17, 18, 19, 20, 21, 22, 23, \
  319. 24, 25, 26, 27, 28, 29, 30, 31, \
  320. 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, \
  321. 15, 32, 33, 34, 35, 36, 37 }
  322. /* Fitting values into registers. */
  323. /* Integer modes <= word size fit into any GPR.
  324. Integer modes > word size fit into successive GPRs, starting with
  325. an even-numbered register.
  326. SImode and DImode fit into FPRs as well.
  327. Floating point modes <= word size fit into any FPR or GPR.
  328. Floating point modes > word size (i.e. DFmode on 32-bit) fit
  329. into any FPR, or an even-odd GPR pair.
  330. TFmode fits only into an even-odd FPR pair.
  331. Complex floating point modes fit either into two FPRs, or into
  332. successive GPRs (again starting with an even number).
  333. TCmode fits only into two successive even-odd FPR pairs.
  334. Condition code modes fit only into the CC register. */
  335. /* Because all registers in a class have the same size HARD_REGNO_NREGS
  336. is equivalent to CLASS_MAX_NREGS. */
  337. #define HARD_REGNO_NREGS(REGNO, MODE) \
  338. s390_class_max_nregs (REGNO_REG_CLASS (REGNO), (MODE))
  339. #define HARD_REGNO_MODE_OK(REGNO, MODE) \
  340. s390_hard_regno_mode_ok ((REGNO), (MODE))
  341. #define HARD_REGNO_RENAME_OK(FROM, TO) \
  342. s390_hard_regno_rename_ok (FROM, TO)
  343. #define MODES_TIEABLE_P(MODE1, MODE2) \
  344. (((MODE1) == SFmode || (MODE1) == DFmode) \
  345. == ((MODE2) == SFmode || (MODE2) == DFmode))
  346. /* When generating code that runs in z/Architecture mode,
  347. but conforms to the 31-bit ABI, GPRs can hold 8 bytes;
  348. the ABI guarantees only that the lower 4 bytes are
  349. saved across calls, however. */
  350. #define HARD_REGNO_CALL_PART_CLOBBERED(REGNO, MODE) \
  351. ((!TARGET_64BIT && TARGET_ZARCH \
  352. && GET_MODE_SIZE (MODE) > 4 \
  353. && (((REGNO) >= 6 && (REGNO) <= 15) || (REGNO) == 32)) \
  354. || (TARGET_VX \
  355. && GET_MODE_SIZE (MODE) > 8 \
  356. && (((TARGET_64BIT && (REGNO) >= 24 && (REGNO) <= 31)) \
  357. || (!TARGET_64BIT && ((REGNO) == 18 || (REGNO) == 19)))))
  358. /* Maximum number of registers to represent a value of mode MODE
  359. in a register of class CLASS. */
  360. #define CLASS_MAX_NREGS(CLASS, MODE) \
  361. s390_class_max_nregs ((CLASS), (MODE))
  362. #define CANNOT_CHANGE_MODE_CLASS(FROM, TO, CLASS) \
  363. s390_cannot_change_mode_class ((FROM), (TO), (CLASS))
  364. /* Register classes. */
  365. /* We use the following register classes:
  366. GENERAL_REGS All general purpose registers
  367. ADDR_REGS All general purpose registers except %r0
  368. (These registers can be used in address generation)
  369. FP_REGS All floating point registers
  370. CC_REGS The condition code register
  371. ACCESS_REGS The access registers
  372. GENERAL_FP_REGS Union of GENERAL_REGS and FP_REGS
  373. ADDR_FP_REGS Union of ADDR_REGS and FP_REGS
  374. GENERAL_CC_REGS Union of GENERAL_REGS and CC_REGS
  375. ADDR_CC_REGS Union of ADDR_REGS and CC_REGS
  376. NO_REGS No registers
  377. ALL_REGS All registers
  378. Note that the 'fake' frame pointer and argument pointer registers
  379. are included amongst the address registers here. */
  380. enum reg_class
  381. {
  382. NO_REGS, CC_REGS, ADDR_REGS, GENERAL_REGS, ACCESS_REGS,
  383. ADDR_CC_REGS, GENERAL_CC_REGS,
  384. FP_REGS, ADDR_FP_REGS, GENERAL_FP_REGS,
  385. VEC_REGS, ADDR_VEC_REGS, GENERAL_VEC_REGS,
  386. ALL_REGS, LIM_REG_CLASSES
  387. };
  388. #define N_REG_CLASSES (int) LIM_REG_CLASSES
  389. #define REG_CLASS_NAMES \
  390. { "NO_REGS", "CC_REGS", "ADDR_REGS", "GENERAL_REGS", "ACCESS_REGS", \
  391. "ADDR_CC_REGS", "GENERAL_CC_REGS", \
  392. "FP_REGS", "ADDR_FP_REGS", "GENERAL_FP_REGS", \
  393. "VEC_REGS", "ADDR_VEC_REGS", "GENERAL_VEC_REGS", \
  394. "ALL_REGS" }
  395. /* Class -> register mapping. */
  396. #define REG_CLASS_CONTENTS \
  397. { \
  398. { 0x00000000, 0x00000000 }, /* NO_REGS */ \
  399. { 0x00000000, 0x00000002 }, /* CC_REGS */ \
  400. { 0x0000fffe, 0x0000000d }, /* ADDR_REGS */ \
  401. { 0x0000ffff, 0x0000000d }, /* GENERAL_REGS */ \
  402. { 0x00000000, 0x00000030 }, /* ACCESS_REGS */ \
  403. { 0x0000fffe, 0x0000000f }, /* ADDR_CC_REGS */ \
  404. { 0x0000ffff, 0x0000000f }, /* GENERAL_CC_REGS */ \
  405. { 0xffff0000, 0x00000000 }, /* FP_REGS */ \
  406. { 0xfffffffe, 0x0000000d }, /* ADDR_FP_REGS */ \
  407. { 0xffffffff, 0x0000000d }, /* GENERAL_FP_REGS */ \
  408. { 0xffff0000, 0x003fffc0 }, /* VEC_REGS */ \
  409. { 0xfffffffe, 0x003fffcd }, /* ADDR_VEC_REGS */ \
  410. { 0xffffffff, 0x003fffcd }, /* GENERAL_VEC_REGS */ \
  411. { 0xffffffff, 0x003fffff }, /* ALL_REGS */ \
  412. }
  413. /* In some case register allocation order is not enough for IRA to
  414. generate a good code. The following macro (if defined) increases
  415. cost of REGNO for a pseudo approximately by pseudo usage frequency
  416. multiplied by the macro value.
  417. We avoid usage of BASE_REGNUM by nonzero macro value because the
  418. reload can decide not to use the hard register because some
  419. constant was forced to be in memory. */
  420. #define IRA_HARD_REGNO_ADD_COST_MULTIPLIER(regno) \
  421. (regno == BASE_REGNUM ? 0.0 : 0.5)
  422. /* Register -> class mapping. */
  423. extern const enum reg_class regclass_map[FIRST_PSEUDO_REGISTER];
  424. #define REGNO_REG_CLASS(REGNO) (regclass_map[REGNO])
  425. /* ADDR_REGS can be used as base or index register. */
  426. #define INDEX_REG_CLASS ADDR_REGS
  427. #define BASE_REG_CLASS ADDR_REGS
  428. /* Check whether REGNO is a hard register of the suitable class
  429. or a pseudo register currently allocated to one such. */
  430. #define REGNO_OK_FOR_INDEX_P(REGNO) \
  431. (((REGNO) < FIRST_PSEUDO_REGISTER \
  432. && REGNO_REG_CLASS ((REGNO)) == ADDR_REGS) \
  433. || ADDR_REGNO_P (reg_renumber[REGNO]))
  434. #define REGNO_OK_FOR_BASE_P(REGNO) REGNO_OK_FOR_INDEX_P (REGNO)
  435. /* We need secondary memory to move data between GPRs and FPRs.
  436. - With DFP the ldgr lgdr instructions are available. Due to the
  437. different alignment we cannot use them for SFmode. For 31 bit a
  438. 64 bit value in GPR would be a register pair so here we still
  439. need to go via memory.
  440. - With z13 we can do the SF/SImode moves with vlgvf. Due to the
  441. overlapping of FPRs and VRs we still disallow TF/TD modes to be
  442. in full VRs so as before also on z13 we do these moves via
  443. memory.
  444. FIXME: Should we try splitting it into two vlgvg's/vlvg's instead? */
  445. #define SECONDARY_MEMORY_NEEDED(CLASS1, CLASS2, MODE) \
  446. (((reg_classes_intersect_p (CLASS1, VEC_REGS) \
  447. && reg_classes_intersect_p (CLASS2, GENERAL_REGS)) \
  448. || (reg_classes_intersect_p (CLASS1, GENERAL_REGS) \
  449. && reg_classes_intersect_p (CLASS2, VEC_REGS))) \
  450. && (!TARGET_DFP || !TARGET_64BIT || GET_MODE_SIZE (MODE) != 8) \
  451. && (!TARGET_VX || (SCALAR_FLOAT_MODE_P (MODE) \
  452. && GET_MODE_SIZE (MODE) > 8)))
  453. /* Get_secondary_mem widens its argument to BITS_PER_WORD which loses on 64bit
  454. because the movsi and movsf patterns don't handle r/f moves. */
  455. #define SECONDARY_MEMORY_NEEDED_MODE(MODE) \
  456. (GET_MODE_BITSIZE (MODE) < 32 \
  457. ? mode_for_size (32, GET_MODE_CLASS (MODE), 0) \
  458. : MODE)
  459. /* Stack layout and calling conventions. */
  460. /* Our stack grows from higher to lower addresses. However, local variables
  461. are accessed by positive offsets, and function arguments are stored at
  462. increasing addresses. */
  463. #define STACK_GROWS_DOWNWARD
  464. #define FRAME_GROWS_DOWNWARD 1
  465. /* #undef ARGS_GROW_DOWNWARD */
  466. /* The basic stack layout looks like this: the stack pointer points
  467. to the register save area for called functions. Above that area
  468. is the location to place outgoing arguments. Above those follow
  469. dynamic allocations (alloca), and finally the local variables. */
  470. /* Offset from stack-pointer to first location of outgoing args. */
  471. #define STACK_POINTER_OFFSET (TARGET_64BIT ? 160 : 96)
  472. /* Offset within stack frame to start allocating local variables at. */
  473. #define STARTING_FRAME_OFFSET 0
  474. /* Offset from the stack pointer register to an item dynamically
  475. allocated on the stack, e.g., by `alloca'. */
  476. #define STACK_DYNAMIC_OFFSET(FUNDECL) \
  477. (STACK_POINTER_OFFSET + crtl->outgoing_args_size)
  478. /* Offset of first parameter from the argument pointer register value.
  479. We have a fake argument pointer register that points directly to
  480. the argument area. */
  481. #define FIRST_PARM_OFFSET(FNDECL) 0
  482. /* Defining this macro makes __builtin_frame_address(0) and
  483. __builtin_return_address(0) work with -fomit-frame-pointer. */
  484. #define INITIAL_FRAME_ADDRESS_RTX \
  485. (plus_constant (Pmode, arg_pointer_rtx, -STACK_POINTER_OFFSET))
  486. /* The return address of the current frame is retrieved
  487. from the initial value of register RETURN_REGNUM.
  488. For frames farther back, we use the stack slot where
  489. the corresponding RETURN_REGNUM register was saved. */
  490. #define DYNAMIC_CHAIN_ADDRESS(FRAME) \
  491. (TARGET_PACKED_STACK ? \
  492. plus_constant (Pmode, (FRAME), \
  493. STACK_POINTER_OFFSET - UNITS_PER_LONG) : (FRAME))
  494. /* For -mpacked-stack this adds 160 - 8 (96 - 4) to the output of
  495. builtin_frame_address. Otherwise arg pointer -
  496. STACK_POINTER_OFFSET would be returned for
  497. __builtin_frame_address(0) what might result in an address pointing
  498. somewhere into the middle of the local variables since the packed
  499. stack layout generally does not need all the bytes in the register
  500. save area. */
  501. #define FRAME_ADDR_RTX(FRAME) \
  502. DYNAMIC_CHAIN_ADDRESS ((FRAME))
  503. #define RETURN_ADDR_RTX(COUNT, FRAME) \
  504. s390_return_addr_rtx ((COUNT), DYNAMIC_CHAIN_ADDRESS ((FRAME)))
  505. /* In 31-bit mode, we need to mask off the high bit of return addresses. */
  506. #define MASK_RETURN_ADDR (TARGET_64BIT ? constm1_rtx : GEN_INT (0x7fffffff))
  507. /* Exception handling. */
  508. /* Describe calling conventions for DWARF-2 exception handling. */
  509. #define INCOMING_RETURN_ADDR_RTX gen_rtx_REG (Pmode, RETURN_REGNUM)
  510. #define INCOMING_FRAME_SP_OFFSET STACK_POINTER_OFFSET
  511. #define DWARF_FRAME_RETURN_COLUMN 14
  512. /* Describe how we implement __builtin_eh_return. */
  513. #define EH_RETURN_DATA_REGNO(N) ((N) < 4 ? (N) + 6 : INVALID_REGNUM)
  514. #define EH_RETURN_HANDLER_RTX gen_rtx_MEM (Pmode, return_address_pointer_rtx)
  515. /* Select a format to encode pointers in exception handling data. */
  516. #define ASM_PREFERRED_EH_DATA_FORMAT(CODE, GLOBAL) \
  517. (flag_pic \
  518. ? ((GLOBAL) ? DW_EH_PE_indirect : 0) | DW_EH_PE_pcrel | DW_EH_PE_sdata4 \
  519. : DW_EH_PE_absptr)
  520. /* Register save slot alignment. */
  521. #define DWARF_CIE_DATA_ALIGNMENT (-UNITS_PER_LONG)
  522. /* Let the assembler generate debug line info. */
  523. #define DWARF2_ASM_LINE_DEBUG_INFO 1
  524. /* Define the dwarf register mapping.
  525. v16-v31 -> 68-83
  526. rX -> X otherwise */
  527. #define DBX_REGISTER_NUMBER(regno) \
  528. ((regno >= 38 && regno <= 53) ? regno + 30 : regno)
  529. /* Frame registers. */
  530. #define STACK_POINTER_REGNUM 15
  531. #define FRAME_POINTER_REGNUM 34
  532. #define HARD_FRAME_POINTER_REGNUM 11
  533. #define ARG_POINTER_REGNUM 32
  534. #define RETURN_ADDRESS_POINTER_REGNUM 35
  535. /* The static chain must be call-clobbered, but not used for
  536. function argument passing. As register 1 is clobbered by
  537. the trampoline code, we only have one option. */
  538. #define STATIC_CHAIN_REGNUM 0
  539. /* Number of hardware registers that go into the DWARF-2 unwind info.
  540. To avoid ABI incompatibility, this number must not change even as
  541. 'fake' hard registers are added or removed. */
  542. #define DWARF_FRAME_REGISTERS 34
  543. /* Frame pointer and argument pointer elimination. */
  544. #define ELIMINABLE_REGS \
  545. {{ FRAME_POINTER_REGNUM, STACK_POINTER_REGNUM }, \
  546. { FRAME_POINTER_REGNUM, HARD_FRAME_POINTER_REGNUM }, \
  547. { ARG_POINTER_REGNUM, STACK_POINTER_REGNUM }, \
  548. { ARG_POINTER_REGNUM, HARD_FRAME_POINTER_REGNUM }, \
  549. { RETURN_ADDRESS_POINTER_REGNUM, STACK_POINTER_REGNUM }, \
  550. { RETURN_ADDRESS_POINTER_REGNUM, HARD_FRAME_POINTER_REGNUM }, \
  551. { BASE_REGNUM, BASE_REGNUM }}
  552. #define INITIAL_ELIMINATION_OFFSET(FROM, TO, OFFSET) \
  553. (OFFSET) = s390_initial_elimination_offset ((FROM), (TO))
  554. /* Stack arguments. */
  555. /* We need current_function_outgoing_args to be valid. */
  556. #define ACCUMULATE_OUTGOING_ARGS 1
  557. /* Register arguments. */
  558. typedef struct s390_arg_structure
  559. {
  560. int gprs; /* gpr so far */
  561. int fprs; /* fpr so far */
  562. int vrs; /* vr so far */
  563. }
  564. CUMULATIVE_ARGS;
  565. #define INIT_CUMULATIVE_ARGS(CUM, FNTYPE, LIBNAME, NN, N_NAMED_ARGS) \
  566. ((CUM).gprs=0, (CUM).fprs=0, (CUM).vrs=0)
  567. #define FIRST_VEC_ARG_REGNO 46
  568. #define LAST_VEC_ARG_REGNO 53
  569. /* Arguments can be placed in general registers 2 to 6, or in floating
  570. point registers 0 and 2 for 31 bit and fprs 0, 2, 4 and 6 for 64
  571. bit. */
  572. #define FUNCTION_ARG_REGNO_P(N) \
  573. (((N) >=2 && (N) < 7) || (N) == 16 || (N) == 17 \
  574. || (TARGET_64BIT && ((N) == 18 || (N) == 19)) \
  575. || (TARGET_VX && ((N) >= FIRST_VEC_ARG_REGNO && (N) <= LAST_VEC_ARG_REGNO)))
  576. /* Only gpr 2, fpr 0, and v24 are ever used as return registers. */
  577. #define FUNCTION_VALUE_REGNO_P(N) \
  578. ((N) == 2 || (N) == 16 \
  579. || (TARGET_VX && (N) == FIRST_VEC_ARG_REGNO))
  580. /* Function entry and exit. */
  581. /* When returning from a function, the stack pointer does not matter. */
  582. #define EXIT_IGNORE_STACK 1
  583. /* Profiling. */
  584. #define FUNCTION_PROFILER(FILE, LABELNO) \
  585. s390_function_profiler ((FILE), ((LABELNO)))
  586. #define PROFILE_BEFORE_PROLOGUE 1
  587. /* Trampolines for nested functions. */
  588. #define TRAMPOLINE_SIZE (TARGET_64BIT ? 32 : 16)
  589. #define TRAMPOLINE_ALIGNMENT BITS_PER_WORD
  590. /* Addressing modes, and classification of registers for them. */
  591. /* Recognize any constant value that is a valid address. */
  592. #define CONSTANT_ADDRESS_P(X) 0
  593. /* Maximum number of registers that can appear in a valid memory address. */
  594. #define MAX_REGS_PER_ADDRESS 2
  595. /* This definition replaces the formerly used 'm' constraint with a
  596. different constraint letter in order to avoid changing semantics of
  597. the 'm' constraint when accepting new address formats in
  598. TARGET_LEGITIMATE_ADDRESS_P. The constraint letter defined here
  599. must not be used in insn definitions or inline assemblies. */
  600. #define TARGET_MEM_CONSTRAINT 'e'
  601. /* Try a machine-dependent way of reloading an illegitimate address
  602. operand. If we find one, push the reload and jump to WIN. This
  603. macro is used in only one place: `find_reloads_address' in reload.c. */
  604. #define LEGITIMIZE_RELOAD_ADDRESS(AD, MODE, OPNUM, TYPE, IND, WIN) \
  605. do { \
  606. rtx new_rtx = legitimize_reload_address (AD, MODE, OPNUM, (int)(TYPE)); \
  607. if (new_rtx) \
  608. { \
  609. (AD) = new_rtx; \
  610. goto WIN; \
  611. } \
  612. } while (0)
  613. /* Helper macro for s390.c and s390.md to check for symbolic constants. */
  614. #define SYMBOLIC_CONST(X) \
  615. (GET_CODE (X) == SYMBOL_REF \
  616. || GET_CODE (X) == LABEL_REF \
  617. || (GET_CODE (X) == CONST && symbolic_reference_mentioned_p (X)))
  618. #define TLS_SYMBOLIC_CONST(X) \
  619. ((GET_CODE (X) == SYMBOL_REF && tls_symbolic_operand (X)) \
  620. || (GET_CODE (X) == CONST && tls_symbolic_reference_mentioned_p (X)))
  621. /* Condition codes. */
  622. /* Given a comparison code (EQ, NE, etc.) and the first operand of a COMPARE,
  623. return the mode to be used for the comparison. */
  624. #define SELECT_CC_MODE(OP, X, Y) s390_select_ccmode ((OP), (X), (Y))
  625. /* Relative costs of operations. */
  626. /* A C expression for the cost of a branch instruction. A value of 1
  627. is the default; other values are interpreted relative to that. */
  628. #define BRANCH_COST(speed_p, predictable_p) s390_branch_cost
  629. /* Nonzero if access to memory by bytes is slow and undesirable. */
  630. #define SLOW_BYTE_ACCESS 1
  631. /* An integer expression for the size in bits of the largest integer machine
  632. mode that should actually be used. We allow pairs of registers. */
  633. #define MAX_FIXED_MODE_SIZE GET_MODE_BITSIZE (TARGET_64BIT ? TImode : DImode)
  634. /* The maximum number of bytes that a single instruction can move quickly
  635. between memory and registers or between two memory locations. */
  636. #define MOVE_MAX (TARGET_ZARCH ? 16 : 8)
  637. #define MOVE_MAX_PIECES (TARGET_ZARCH ? 8 : 4)
  638. #define MAX_MOVE_MAX 16
  639. /* Don't perform CSE on function addresses. */
  640. #define NO_FUNCTION_CSE
  641. /* This value is used in tree-sra to decide whether it might benefical
  642. to split a struct move into several word-size moves. For S/390
  643. only small values make sense here since struct moves are relatively
  644. cheap thanks to mvc so the small default value chosen for archs
  645. with memmove patterns should be ok. But this value is multiplied
  646. in tree-sra with UNITS_PER_WORD to make a decision so we adjust it
  647. here to compensate for that factor since mvc costs exactly the same
  648. on 31 and 64 bit. */
  649. #define MOVE_RATIO(speed) (TARGET_64BIT? 2 : 4)
  650. /* Sections. */
  651. /* Output before read-only data. */
  652. #define TEXT_SECTION_ASM_OP ".text"
  653. /* Output before writable (initialized) data. */
  654. #define DATA_SECTION_ASM_OP ".data"
  655. /* Output before writable (uninitialized) data. */
  656. #define BSS_SECTION_ASM_OP ".bss"
  657. /* S/390 constant pool breaks the devices in crtstuff.c to control section
  658. in where code resides. We have to write it as asm code. */
  659. #ifndef __s390x__
  660. #define CRT_CALL_STATIC_FUNCTION(SECTION_OP, FUNC) \
  661. asm (SECTION_OP "\n\
  662. bras\t%r2,1f\n\
  663. 0: .long\t" USER_LABEL_PREFIX #FUNC " - 0b\n\
  664. 1: l\t%r3,0(%r2)\n\
  665. bas\t%r14,0(%r3,%r2)\n\
  666. .previous");
  667. #endif
  668. /* Position independent code. */
  669. #define PIC_OFFSET_TABLE_REGNUM (flag_pic ? 12 : INVALID_REGNUM)
  670. #define LEGITIMATE_PIC_OPERAND_P(X) legitimate_pic_operand_p (X)
  671. /* Assembler file format. */
  672. /* Character to start a comment. */
  673. #define ASM_COMMENT_START "#"
  674. /* Declare an uninitialized external linkage data object. */
  675. #define ASM_OUTPUT_ALIGNED_BSS(FILE, DECL, NAME, SIZE, ALIGN) \
  676. asm_output_aligned_bss (FILE, DECL, NAME, SIZE, ALIGN)
  677. /* Globalizing directive for a label. */
  678. #define GLOBAL_ASM_OP ".globl "
  679. /* Advance the location counter to a multiple of 2**LOG bytes. */
  680. #define ASM_OUTPUT_ALIGN(FILE, LOG) \
  681. if ((LOG)) fprintf ((FILE), "\t.align\t%d\n", 1 << (LOG))
  682. /* Advance the location counter by SIZE bytes. */
  683. #define ASM_OUTPUT_SKIP(FILE, SIZE) \
  684. fprintf ((FILE), "\t.set\t.,.+"HOST_WIDE_INT_PRINT_UNSIGNED"\n", (SIZE))
  685. /* The LOCAL_LABEL_PREFIX variable is used by dbxelf.h. */
  686. #define LOCAL_LABEL_PREFIX "."
  687. #define LABEL_ALIGN(LABEL) \
  688. s390_label_align (LABEL)
  689. /* How to refer to registers in assembler output. This sequence is
  690. indexed by compiler's hard-register-number (see above). */
  691. #define REGISTER_NAMES \
  692. { "%r0", "%r1", "%r2", "%r3", "%r4", "%r5", "%r6", "%r7", \
  693. "%r8", "%r9", "%r10", "%r11", "%r12", "%r13", "%r14", "%r15", \
  694. "%f0", "%f2", "%f4", "%f6", "%f1", "%f3", "%f5", "%f7", \
  695. "%f8", "%f10", "%f12", "%f14", "%f9", "%f11", "%f13", "%f15", \
  696. "%ap", "%cc", "%fp", "%rp", "%a0", "%a1", \
  697. "%v16", "%v18", "%v20", "%v22", "%v17", "%v19", "%v21", "%v23", \
  698. "%v24", "%v26", "%v28", "%v30", "%v25", "%v27", "%v29", "%v31" \
  699. }
  700. #define ADDITIONAL_REGISTER_NAMES \
  701. { { "v0", 16 }, { "v2", 17 }, { "v4", 18 }, { "v6", 19 }, \
  702. { "v1", 20 }, { "v3", 21 }, { "v5", 22 }, { "v7", 23 }, \
  703. { "v8", 24 }, { "v10", 25 }, { "v12", 26 }, { "v14", 27 }, \
  704. { "v9", 28 }, { "v11", 29 }, { "v13", 30 }, { "v15", 31 } };
  705. /* Print operand X (an rtx) in assembler syntax to file FILE. */
  706. #define PRINT_OPERAND(FILE, X, CODE) print_operand (FILE, X, CODE)
  707. #define PRINT_OPERAND_ADDRESS(FILE, ADDR) print_operand_address (FILE, ADDR)
  708. /* Output an element of a case-vector that is absolute. */
  709. #define ASM_OUTPUT_ADDR_VEC_ELT(FILE, VALUE) \
  710. do { \
  711. char buf[32]; \
  712. fputs (integer_asm_op (UNITS_PER_LONG, TRUE), (FILE)); \
  713. ASM_GENERATE_INTERNAL_LABEL (buf, "L", (VALUE)); \
  714. assemble_name ((FILE), buf); \
  715. fputc ('\n', (FILE)); \
  716. } while (0)
  717. /* Output an element of a case-vector that is relative. */
  718. #define ASM_OUTPUT_ADDR_DIFF_ELT(FILE, BODY, VALUE, REL) \
  719. do { \
  720. char buf[32]; \
  721. fputs (integer_asm_op (UNITS_PER_LONG, TRUE), (FILE)); \
  722. ASM_GENERATE_INTERNAL_LABEL (buf, "L", (VALUE)); \
  723. assemble_name ((FILE), buf); \
  724. fputc ('-', (FILE)); \
  725. ASM_GENERATE_INTERNAL_LABEL (buf, "L", (REL)); \
  726. assemble_name ((FILE), buf); \
  727. fputc ('\n', (FILE)); \
  728. } while (0)
  729. /* Mark the return register as used by the epilogue so that we can
  730. use it in unadorned (return) and (simple_return) instructions. */
  731. #define EPILOGUE_USES(REGNO) ((REGNO) == RETURN_REGNUM)
  732. #undef ASM_OUTPUT_FUNCTION_LABEL
  733. #define ASM_OUTPUT_FUNCTION_LABEL(FILE, NAME, DECL) \
  734. s390_asm_output_function_label (FILE, NAME, DECL)
  735. /* Miscellaneous parameters. */
  736. /* Specify the machine mode that this machine uses for the index in the
  737. tablejump instruction. */
  738. #define CASE_VECTOR_MODE (TARGET_64BIT ? DImode : SImode)
  739. /* Value is 1 if truncating an integer of INPREC bits to OUTPREC bits
  740. is done just by pretending it is already truncated. */
  741. #define TRULY_NOOP_TRUNCATION(OUTPREC, INPREC) 1
  742. /* Specify the machine mode that pointers have.
  743. After generation of rtl, the compiler makes no further distinction
  744. between pointers and any other objects of this machine mode. */
  745. #define Pmode ((machine_mode) (TARGET_64BIT ? DImode : SImode))
  746. /* This is -1 for "pointer mode" extend. See ptr_extend in s390.md. */
  747. #define POINTERS_EXTEND_UNSIGNED -1
  748. /* A function address in a call instruction is a byte address (for
  749. indexing purposes) so give the MEM rtx a byte's mode. */
  750. #define FUNCTION_MODE QImode
  751. /* Specify the value which is used when clz operand is zero. */
  752. #define CLZ_DEFINED_VALUE_AT_ZERO(MODE, VALUE) ((VALUE) = 64, 1)
  753. /* Machine-specific symbol_ref flags. */
  754. #define SYMBOL_FLAG_ALIGN1 (SYMBOL_FLAG_MACH_DEP << 0)
  755. #define SYMBOL_REF_ALIGN1_P(X) \
  756. ((SYMBOL_REF_FLAGS (X) & SYMBOL_FLAG_ALIGN1))
  757. #define SYMBOL_FLAG_NOT_NATURALLY_ALIGNED (SYMBOL_FLAG_MACH_DEP << 1)
  758. #define SYMBOL_REF_NOT_NATURALLY_ALIGNED_P(X) \
  759. ((SYMBOL_REF_FLAGS (X) & SYMBOL_FLAG_NOT_NATURALLY_ALIGNED))
  760. /* Check whether integer displacement is in range for a short displacement. */
  761. #define SHORT_DISP_IN_RANGE(d) ((d) >= 0 && (d) <= 4095)
  762. /* Check whether integer displacement is in range. */
  763. #define DISP_IN_RANGE(d) \
  764. (TARGET_LONG_DISPLACEMENT? ((d) >= -524288 && (d) <= 524287) \
  765. : SHORT_DISP_IN_RANGE(d))
  766. /* Reads can reuse write prefetches, used by tree-ssa-prefetch-loops.c. */
  767. #define READ_CAN_USE_WRITE_PREFETCH 1
  768. extern const int processor_flags_table[];
  769. /* The truth element value for vector comparisons. Our instructions
  770. always generate -1 in that case. */
  771. #define VECTOR_STORE_FLAG_VALUE(MODE) CONSTM1_RTX (GET_MODE_INNER (MODE))
  772. /* Target pragma. */
  773. /* resolve_overloaded_builtin can not be defined the normal way since
  774. it is defined in code which technically belongs to the
  775. front-end. */
  776. #define REGISTER_TARGET_PRAGMAS() \
  777. do { \
  778. s390_register_target_pragmas (); \
  779. } while (0)
  780. #endif /* S390_H */