rx.h 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657
  1. /* GCC backend definitions for the Renesas RX processor.
  2. Copyright (C) 2008-2015 Free Software Foundation, Inc.
  3. Contributed by Red Hat.
  4. This file is part of GCC.
  5. GCC is free software; you can redistribute it and/or modify it
  6. under the terms of the GNU General Public License as published
  7. by the Free Software Foundation; either version 3, or (at your
  8. option) any later version.
  9. GCC is distributed in the hope that it will be useful, but WITHOUT
  10. ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
  11. or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
  12. License for more details.
  13. You should have received a copy of the GNU General Public License
  14. along with GCC; see the file COPYING3. If not see
  15. <http://www.gnu.org/licenses/>. */
  16. #define TARGET_CPU_CPP_BUILTINS() \
  17. do \
  18. { \
  19. builtin_define ("__RX__"); \
  20. builtin_assert ("cpu=RX"); \
  21. if (rx_cpu_type == RX610) \
  22. { \
  23. builtin_define ("__RX610__"); \
  24. builtin_assert ("machine=RX610"); \
  25. } \
  26. else if (rx_cpu_type == RX100) \
  27. { \
  28. builtin_define ("__RX100__"); \
  29. builtin_assert ("machine=RX100"); \
  30. } \
  31. else if (rx_cpu_type == RX200) \
  32. { \
  33. builtin_define ("__RX200__"); \
  34. builtin_assert ("machine=RX200"); \
  35. } \
  36. else if (rx_cpu_type == RX600) \
  37. { \
  38. builtin_define ("__RX600__"); \
  39. builtin_assert ("machine=RX600"); \
  40. } \
  41. \
  42. if (TARGET_BIG_ENDIAN_DATA) \
  43. builtin_define ("__RX_BIG_ENDIAN__"); \
  44. else \
  45. builtin_define ("__RX_LITTLE_ENDIAN__");\
  46. \
  47. if (TARGET_64BIT_DOUBLES) \
  48. builtin_define ("__RX_64BIT_DOUBLES__");\
  49. else \
  50. builtin_define ("__RX_32BIT_DOUBLES__");\
  51. \
  52. if (ALLOW_RX_FPU_INSNS) \
  53. builtin_define ("__RX_FPU_INSNS__"); \
  54. \
  55. if (TARGET_AS100_SYNTAX) \
  56. builtin_define ("__RX_AS100_SYNTAX__"); \
  57. else \
  58. builtin_define ("__RX_GAS_SYNTAX__"); \
  59. \
  60. if (TARGET_GCC_ABI) \
  61. builtin_define ("__RX_GCC_ABI__"); \
  62. else \
  63. builtin_define ("__RX_ABI__"); \
  64. } \
  65. while (0)
  66. #undef CC1_SPEC
  67. #define CC1_SPEC "\
  68. %{mas100-syntax:%{gdwarf*:%e-mas100-syntax is incompatible with -gdwarf}} \
  69. %{mcpu=rx100:%{fpu:%erx100 cpu does not have FPU hardware}} \
  70. %{mcpu=rx200:%{fpu:%erx200 cpu does not have FPU hardware}}"
  71. #undef STARTFILE_SPEC
  72. #define STARTFILE_SPEC "%{pg:gcrt0.o%s}%{!pg:crt0.o%s} crtbegin.o%s"
  73. #undef ENDFILE_SPEC
  74. #define ENDFILE_SPEC "crtend.o%s crtn.o%s"
  75. #undef CPP_SPEC
  76. #define CPP_SPEC "\
  77. %{mpid:-D_RX_PID=1} \
  78. %{mint-register=*:-D_RX_INT_REGISTERS=%*} \
  79. %{msmall-data-limit*:-D_RX_SMALL_DATA} \
  80. "
  81. #undef ASM_SPEC
  82. #define ASM_SPEC "\
  83. %{mbig-endian-data:-mbig-endian-data} \
  84. %{m64bit-doubles:-m64bit-doubles} \
  85. %{!m64bit-doubles:-m32bit-doubles} \
  86. %{msmall-data-limit*:-msmall-data-limit} \
  87. %{mrelax:-relax} \
  88. %{mpid} \
  89. %{mint-register=*} \
  90. %{mgcc-abi:-mgcc-abi} %{!mgcc-abi:-mrx-abi} \
  91. %{mcpu=*} \
  92. "
  93. #undef LIB_SPEC
  94. #define LIB_SPEC " \
  95. --start-group \
  96. -lc \
  97. %{msim:-lsim}%{!msim:-lnosys} \
  98. %{fprofile-arcs|fprofile-generate|coverage:-lgcov} \
  99. --end-group \
  100. %{!T*: %{msim:%Trx-sim.ld}%{!msim:%Trx.ld}} \
  101. "
  102. #undef LINK_SPEC
  103. #define LINK_SPEC "%{mbig-endian-data:--oformat elf32-rx-be} %{mrelax:-relax}"
  104. #define BITS_BIG_ENDIAN 0
  105. #define BYTES_BIG_ENDIAN TARGET_BIG_ENDIAN_DATA
  106. #define WORDS_BIG_ENDIAN TARGET_BIG_ENDIAN_DATA
  107. #define UNITS_PER_WORD 4
  108. #define INT_TYPE_SIZE 32
  109. #define LONG_TYPE_SIZE 32
  110. #define LONG_LONG_TYPE_SIZE 64
  111. #define FLOAT_TYPE_SIZE 32
  112. #define DOUBLE_TYPE_SIZE (TARGET_64BIT_DOUBLES ? 64 : 32)
  113. #define LONG_DOUBLE_TYPE_SIZE DOUBLE_TYPE_SIZE
  114. #define DEFAULT_SIGNED_CHAR 0
  115. /* RX load/store instructions can handle unaligned addresses. */
  116. #define STRICT_ALIGNMENT 0
  117. #define FUNCTION_BOUNDARY ((rx_cpu_type == RX100 || rx_cpu_type == RX200) ? 4 : 8)
  118. #define BIGGEST_ALIGNMENT 32
  119. #define STACK_BOUNDARY 32
  120. #define PARM_BOUNDARY 8
  121. #define STACK_GROWS_DOWNWARD 1
  122. #define FRAME_GROWS_DOWNWARD 0
  123. #define FIRST_PARM_OFFSET(FNDECL) 0
  124. #define MAX_REGS_PER_ADDRESS 2
  125. #define Pmode SImode
  126. #define POINTER_SIZE 32
  127. #undef SIZE_TYPE
  128. #define SIZE_TYPE "long unsigned int"
  129. #undef PTRDIFF_TYPE
  130. #define PTRDIFF_TYPE "long int"
  131. #undef WCHAR_TYPE
  132. #define WCHAR_TYPE "long int"
  133. #undef WCHAR_TYPE_SIZE
  134. #define WCHAR_TYPE_SIZE BITS_PER_WORD
  135. #define POINTERS_EXTEND_UNSIGNED 1
  136. #define FUNCTION_MODE QImode
  137. #define CASE_VECTOR_MODE Pmode
  138. #define WORD_REGISTER_OPERATIONS 1
  139. #define HAS_LONG_COND_BRANCH 0
  140. #define HAS_LONG_UNCOND_BRANCH 0
  141. #define MOVE_MAX 4
  142. #define STARTING_FRAME_OFFSET 0
  143. #define TRULY_NOOP_TRUNCATION(OUTPREC, INPREC) 1
  144. #define HAVE_PRE_DECREMENT 1
  145. #define HAVE_POST_INCREMENT 1
  146. #define MOVE_RATIO(SPEED) ((SPEED) ? 4 : 2)
  147. #define SLOW_BYTE_ACCESS 1
  148. #define STORE_FLAG_VALUE 1
  149. #define LOAD_EXTEND_OP(MODE) SIGN_EXTEND
  150. #define SHORT_IMMEDIATES_SIGN_EXTEND 1
  151. enum reg_class
  152. {
  153. NO_REGS, /* No registers in set. */
  154. GR_REGS, /* Integer registers. */
  155. ALL_REGS, /* All registers. */
  156. LIM_REG_CLASSES /* Max value + 1. */
  157. };
  158. #define REG_CLASS_NAMES \
  159. { \
  160. "NO_REGS", \
  161. "GR_REGS", \
  162. "ALL_REGS" \
  163. }
  164. #define REG_CLASS_CONTENTS \
  165. { \
  166. { 0x00000000 }, /* No registers, */ \
  167. { 0x0000ffff }, /* Integer registers. */ \
  168. { 0x0000ffff } /* All registers. */ \
  169. }
  170. #define N_REG_CLASSES (int) LIM_REG_CLASSES
  171. #define CLASS_MAX_NREGS(CLASS, MODE) ((GET_MODE_SIZE (MODE) \
  172. + UNITS_PER_WORD - 1) \
  173. / UNITS_PER_WORD)
  174. #define GENERAL_REGS GR_REGS
  175. #define BASE_REG_CLASS GR_REGS
  176. #define INDEX_REG_CLASS GR_REGS
  177. #define FIRST_PSEUDO_REGISTER 17
  178. #define REGNO_REG_CLASS(REGNO) ((REGNO) < FIRST_PSEUDO_REGISTER \
  179. ? GR_REGS : NO_REGS)
  180. #define STACK_POINTER_REGNUM 0
  181. #define FUNC_RETURN_REGNUM 1
  182. #define FRAME_POINTER_REGNUM 6
  183. #define ARG_POINTER_REGNUM 7
  184. #define STATIC_CHAIN_REGNUM 8
  185. #define TRAMPOLINE_TEMP_REGNUM 9
  186. #define STRUCT_VAL_REGNUM 15
  187. #define CC_REGNUM 16
  188. /* This is the register which will probably be used to hold the address of
  189. the start of the small data area, if -msmall-data-limit is being used,
  190. or the address of the constant data area if -mpid is being used. If both
  191. features are in use then two consecutive registers will be used.
  192. Note - these registers must not be call_used because otherwise library
  193. functions that are compiled without -msmall-data-limit/-mpid support
  194. might clobber them.
  195. Note that the actual values used depends on other options; use
  196. rx_gp_base_regnum() and rx_pid_base_regnum() instead. */
  197. #define GP_BASE_REGNUM 13
  198. #define ELIMINABLE_REGS \
  199. {{ ARG_POINTER_REGNUM, STACK_POINTER_REGNUM }, \
  200. { ARG_POINTER_REGNUM, FRAME_POINTER_REGNUM }, \
  201. { FRAME_POINTER_REGNUM, STACK_POINTER_REGNUM }}
  202. #define INITIAL_ELIMINATION_OFFSET(FROM, TO, OFFSET) \
  203. (OFFSET) = rx_initial_elimination_offset ((FROM), (TO))
  204. #define FUNCTION_ARG_REGNO_P(N) (((N) >= 1) && ((N) <= 4))
  205. #define FUNCTION_VALUE_REGNO_P(N) ((N) == FUNC_RETURN_REGNUM)
  206. #define DEFAULT_PCC_STRUCT_RETURN 0
  207. #define FIXED_REGISTERS \
  208. { \
  209. 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1 \
  210. }
  211. #define CALL_USED_REGISTERS \
  212. { \
  213. 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1 \
  214. }
  215. #define LIBCALL_VALUE(MODE) \
  216. gen_rtx_REG (((GET_MODE_CLASS (MODE) != MODE_INT \
  217. || COMPLEX_MODE_P (MODE) \
  218. || GET_MODE_SIZE (MODE) >= 4) \
  219. ? (MODE) \
  220. : SImode), \
  221. FUNC_RETURN_REGNUM)
  222. /* Order of allocation of registers. */
  223. #define REG_ALLOC_ORDER \
  224. { 7, 10, 11, 12, 13, 14, 4, 3, 2, 1, 9, 8, 6, 5, 15 \
  225. }
  226. #define REGNO_IN_RANGE(REGNO, MIN, MAX) \
  227. (IN_RANGE ((REGNO), (MIN), (MAX)) \
  228. || (reg_renumber != NULL \
  229. && reg_renumber[(REGNO)] >= (MIN) \
  230. && reg_renumber[(REGNO)] <= (MAX)))
  231. #ifdef REG_OK_STRICT
  232. #define REGNO_OK_FOR_BASE_P(regno) REGNO_IN_RANGE (regno, 0, 15)
  233. #else
  234. #define REGNO_OK_FOR_BASE_P(regno) 1
  235. #endif
  236. #define REGNO_OK_FOR_INDEX_P(regno) REGNO_OK_FOR_BASE_P (regno)
  237. #define RTX_OK_FOR_BASE(X, STRICT) \
  238. ((STRICT) ? \
  239. ( (REG_P (X) \
  240. && REGNO_IN_RANGE (REGNO (X), 0, 15)) \
  241. || (GET_CODE (X) == SUBREG \
  242. && REG_P (SUBREG_REG (X)) \
  243. && REGNO_IN_RANGE (REGNO (SUBREG_REG (X)), 0, 15))) \
  244. : \
  245. ( (REG_P (X) \
  246. || (GET_CODE (X) == SUBREG \
  247. && REG_P (SUBREG_REG (X))))))
  248. #define RETURN_ADDR_RTX(COUNT, FRAMEADDR) \
  249. ((COUNT) == 0 \
  250. ? gen_rtx_MEM (Pmode, gen_rtx_PLUS (Pmode, arg_pointer_rtx, GEN_INT (-4))) \
  251. : NULL_RTX)
  252. #define INCOMING_RETURN_ADDR_RTX gen_rtx_MEM (Pmode, stack_pointer_rtx)
  253. #define ACCUMULATE_OUTGOING_ARGS 1
  254. typedef unsigned int CUMULATIVE_ARGS;
  255. #define INIT_CUMULATIVE_ARGS(CUM, FNTYPE, LIBNAME, INDIRECT, N_NAMED_ARGS) \
  256. (CUM) = 0
  257. #define TRAMPOLINE_SIZE (! TARGET_BIG_ENDIAN_DATA ? 14 : 20)
  258. #define TRAMPOLINE_ALIGNMENT 32
  259. #define NO_PROFILE_COUNTERS 1
  260. #define PROFILE_BEFORE_PROLOGUE 1
  261. #define FUNCTION_PROFILER(FILE, LABELNO) \
  262. fprintf (FILE, "\tbsr\t__mcount\n");
  263. #define HARD_REGNO_NREGS(REGNO, MODE) CLASS_MAX_NREGS (0, MODE)
  264. #define HARD_REGNO_MODE_OK(REGNO, MODE) \
  265. (REGNO_REG_CLASS (REGNO) == GR_REGS)
  266. #define MODES_TIEABLE_P(MODE1, MODE2) \
  267. ( ( GET_MODE_CLASS (MODE1) == MODE_FLOAT \
  268. || GET_MODE_CLASS (MODE1) == MODE_COMPLEX_FLOAT) \
  269. == ( GET_MODE_CLASS (MODE2) == MODE_FLOAT \
  270. || GET_MODE_CLASS (MODE2) == MODE_COMPLEX_FLOAT))
  271. #define REGISTER_NAMES \
  272. { \
  273. "r0", "r1", "r2", "r3", "r4", "r5", "r6", "r7", \
  274. "r8", "r9", "r10", "r11", "r12", "r13", "r14", "r15", "cc" \
  275. }
  276. #define ADDITIONAL_REGISTER_NAMES \
  277. { \
  278. { "sp", STACK_POINTER_REGNUM } \
  279. , { "fp", FRAME_POINTER_REGNUM } \
  280. , { "arg", ARG_POINTER_REGNUM } \
  281. , { "chain", STATIC_CHAIN_REGNUM } \
  282. }
  283. #define DATA_SECTION_ASM_OP \
  284. (TARGET_AS100_SYNTAX ? "\t.SECTION D,DATA" \
  285. : "\t.section D,\"aw\",@progbits\n\t.p2align 2")
  286. #define SDATA_SECTION_ASM_OP \
  287. (TARGET_AS100_SYNTAX ? "\t.SECTION D_2,DATA,ALIGN=2" \
  288. : "\t.section D_2,\"aw\",@progbits\n\t.p2align 1")
  289. #undef READONLY_DATA_SECTION_ASM_OP
  290. #define READONLY_DATA_SECTION_ASM_OP \
  291. (TARGET_AS100_SYNTAX ? "\t.SECTION C,ROMDATA,ALIGN=4" \
  292. : "\t.section C,\"a\",@progbits\n\t.p2align 2")
  293. #define BSS_SECTION_ASM_OP \
  294. (TARGET_AS100_SYNTAX ? "\t.SECTION B,DATA,ALIGN=4" \
  295. : "\t.section B,\"w\",@nobits\n\t.p2align 2")
  296. #define SBSS_SECTION_ASM_OP \
  297. (TARGET_AS100_SYNTAX ? "\t.SECTION B_2,DATA,ALIGN=2" \
  298. : "\t.section B_2,\"w\",@nobits\n\t.p2align 1")
  299. /* The following definitions are conditional depending upon whether the
  300. compiler is being built or crtstuff.c is being compiled by the built
  301. compiler. */
  302. #if defined CRT_BEGIN || defined CRT_END
  303. # ifdef __RX_AS100_SYNTAX
  304. # define TEXT_SECTION_ASM_OP "\t.SECTION P,CODE"
  305. # define CTORS_SECTION_ASM_OP "\t.SECTION init_array,CODE"
  306. # define DTORS_SECTION_ASM_OP "\t.SECTION fini_array,CODE"
  307. # define INIT_ARRAY_SECTION_ASM_OP "\t.SECTION init_array,CODE"
  308. # define FINI_ARRAY_SECTION_ASM_OP "\t.SECTION fini_array,CODE"
  309. # else
  310. # define TEXT_SECTION_ASM_OP "\t.section P,\"ax\""
  311. # define CTORS_SECTION_ASM_OP \
  312. "\t.section\t.init_array,\"awx\",@init_array"
  313. # define DTORS_SECTION_ASM_OP \
  314. "\t.section\t.fini_array,\"awx\",@fini_array"
  315. # define INIT_ARRAY_SECTION_ASM_OP \
  316. "\t.section\t.init_array,\"awx\",@init_array"
  317. # define FINI_ARRAY_SECTION_ASM_OP \
  318. "\t.section\t.fini_array,\"awx\",@fini_array"
  319. # endif
  320. #else
  321. # define TEXT_SECTION_ASM_OP \
  322. (TARGET_AS100_SYNTAX ? "\t.SECTION P,CODE" : "\t.section P,\"ax\"")
  323. # define CTORS_SECTION_ASM_OP \
  324. (TARGET_AS100_SYNTAX ? "\t.SECTION init_array,CODE" \
  325. : "\t.section\t.init_array,\"awx\",@init_array")
  326. # define DTORS_SECTION_ASM_OP \
  327. (TARGET_AS100_SYNTAX ? "\t.SECTION fini_array,CODE" \
  328. : "\t.section\t.fini_array,\"awx\",@fini_array")
  329. # define INIT_ARRAY_SECTION_ASM_OP \
  330. (TARGET_AS100_SYNTAX ? "\t.SECTION init_array,CODE" \
  331. : "\t.section\t.init_array,\"awx\",@init_array")
  332. # define FINI_ARRAY_SECTION_ASM_OP \
  333. (TARGET_AS100_SYNTAX ? "\t.SECTION fini_array,CODE" \
  334. : "\t.section\t.fini_array,\"awx\",@fini_array")
  335. #endif
  336. #define GLOBAL_ASM_OP \
  337. (TARGET_AS100_SYNTAX ? "\t.GLB\t" : "\t.global\t")
  338. #define ASM_COMMENT_START " ;"
  339. #define ASM_APP_ON ""
  340. #define ASM_APP_OFF ""
  341. #define LOCAL_LABEL_PREFIX "L"
  342. #undef USER_LABEL_PREFIX
  343. #define USER_LABEL_PREFIX "_"
  344. /* Compute the alignment needed for label X in various situations.
  345. If the user has specified an alignment then honour that, otherwise
  346. use rx_align_for_label. */
  347. #define JUMP_ALIGN(x) (align_jumps > 1 ? align_jumps_log : rx_align_for_label (x, 0))
  348. #define LABEL_ALIGN(x) (align_labels > 1 ? align_labels_log : rx_align_for_label (x, 3))
  349. #define LOOP_ALIGN(x) (align_loops > 1 ? align_loops_log : rx_align_for_label (x, 2))
  350. #define LABEL_ALIGN_AFTER_BARRIER(x) rx_align_for_label (x, 0)
  351. #define ASM_OUTPUT_MAX_SKIP_ALIGN(STREAM, LOG, MAX_SKIP) \
  352. do \
  353. { \
  354. if ((LOG) == 0 || (MAX_SKIP) == 0) \
  355. break; \
  356. if (TARGET_AS100_SYNTAX) \
  357. { \
  358. if ((LOG) >= 2) \
  359. fprintf (STREAM, "\t.ALIGN 4\t; %d alignment actually requested\n", 1 << (LOG)); \
  360. else \
  361. fprintf (STREAM, "\t.ALIGN 2\n"); \
  362. } \
  363. else \
  364. fprintf (STREAM, "\t.balign %d,3,%d\n", 1 << (LOG), (MAX_SKIP)); \
  365. } \
  366. while (0)
  367. #define ASM_OUTPUT_ALIGN(STREAM, LOG) \
  368. do \
  369. { \
  370. if ((LOG) == 0) \
  371. break; \
  372. if (TARGET_AS100_SYNTAX) \
  373. { \
  374. if ((LOG) >= 2) \
  375. fprintf (STREAM, "\t.ALIGN 4\t; %d alignment actually requested\n", 1 << (LOG)); \
  376. else \
  377. fprintf (STREAM, "\t.ALIGN 2\n"); \
  378. } \
  379. else \
  380. fprintf (STREAM, "\t.balign %d\n", 1 << (LOG)); \
  381. } \
  382. while (0)
  383. #define ASM_OUTPUT_ADDR_VEC_ELT(FILE, VALUE) \
  384. fprintf (FILE, TARGET_AS100_SYNTAX ? "\t.LWORD L%d\n" : "\t.long .L%d\n", \
  385. VALUE)
  386. /* This is how to output an element of a case-vector that is relative.
  387. Note: The local label referenced by the "1b" below is emitted by
  388. the tablejump insn. */
  389. #define ASM_OUTPUT_ADDR_DIFF_ELT(FILE, BODY, VALUE, REL) \
  390. fprintf (FILE, TARGET_AS100_SYNTAX \
  391. ? "\t.LWORD L%d - ?-\n" : "\t.long .L%d - 1b\n", VALUE)
  392. #define CASE_VECTOR_PC_RELATIVE (TARGET_PID)
  393. #define ASM_OUTPUT_SIZE_DIRECTIVE(STREAM, NAME, SIZE) \
  394. do \
  395. { \
  396. HOST_WIDE_INT size_ = (SIZE); \
  397. \
  398. /* The as100 assembler does not have an equivalent of the SVR4 \
  399. .size pseudo-op. */ \
  400. if (TARGET_AS100_SYNTAX) \
  401. break; \
  402. \
  403. fputs (SIZE_ASM_OP, STREAM); \
  404. assemble_name (STREAM, NAME); \
  405. fprintf (STREAM, ", " HOST_WIDE_INT_PRINT_DEC "\n", size_); \
  406. } \
  407. while (0)
  408. #define ASM_OUTPUT_MEASURED_SIZE(STREAM, NAME) \
  409. do \
  410. { \
  411. /* The as100 assembler does not have an equivalent of the SVR4 \
  412. .size pseudo-op. */ \
  413. if (TARGET_AS100_SYNTAX) \
  414. break; \
  415. fputs (SIZE_ASM_OP, STREAM); \
  416. assemble_name (STREAM, NAME); \
  417. fputs (", .-", STREAM); \
  418. assemble_name (STREAM, NAME); \
  419. putc ('\n', STREAM); \
  420. } \
  421. while (0)
  422. #define ASM_OUTPUT_TYPE_DIRECTIVE(STREAM, NAME, TYPE) \
  423. do \
  424. { \
  425. /* The as100 assembler does not have an equivalent of the SVR4 \
  426. .size pseudo-op. */ \
  427. if (TARGET_AS100_SYNTAX) \
  428. break; \
  429. fputs (TYPE_ASM_OP, STREAM); \
  430. assemble_name (STREAM, NAME); \
  431. fputs (", ", STREAM); \
  432. fprintf (STREAM, TYPE_OPERAND_FMT, TYPE); \
  433. putc ('\n', STREAM); \
  434. } \
  435. while (0)
  436. #undef ASM_GENERATE_INTERNAL_LABEL
  437. #define ASM_GENERATE_INTERNAL_LABEL(LABEL, PREFIX, NUM) \
  438. do \
  439. { \
  440. sprintf (LABEL, TARGET_AS100_SYNTAX ? "*%s%u" : "*.%s%u", \
  441. PREFIX, (unsigned) (NUM)); \
  442. } \
  443. while (0)
  444. #undef ASM_OUTPUT_EXTERNAL
  445. #define ASM_OUTPUT_EXTERNAL(FILE, DECL, NAME) \
  446. do \
  447. { \
  448. if (TARGET_AS100_SYNTAX) \
  449. targetm.asm_out.globalize_label (FILE, NAME); \
  450. default_elf_asm_output_external (FILE, DECL, NAME); \
  451. } \
  452. while (0)
  453. #undef ASM_OUTPUT_ALIGNED_COMMON
  454. #define ASM_OUTPUT_ALIGNED_COMMON(FILE, NAME, SIZE, ALIGN) \
  455. do \
  456. { \
  457. if (TARGET_AS100_SYNTAX) \
  458. { \
  459. fprintf ((FILE), "\t.GLB\t"); \
  460. assemble_name ((FILE), (NAME)); \
  461. fprintf ((FILE), "\n"); \
  462. assemble_name ((FILE), (NAME)); \
  463. switch ((ALIGN) / BITS_PER_UNIT) \
  464. { \
  465. case 4: \
  466. fprintf ((FILE), ":\t.BLKL\t"HOST_WIDE_INT_PRINT_UNSIGNED"\n",\
  467. (SIZE) / 4); \
  468. break; \
  469. case 2: \
  470. fprintf ((FILE), ":\t.BLKW\t"HOST_WIDE_INT_PRINT_UNSIGNED"\n",\
  471. (SIZE) / 2); \
  472. break; \
  473. default: \
  474. fprintf ((FILE), ":\t.BLKB\t"HOST_WIDE_INT_PRINT_UNSIGNED"\n",\
  475. (SIZE)); \
  476. break; \
  477. } \
  478. } \
  479. else \
  480. { \
  481. fprintf ((FILE), "%s", COMMON_ASM_OP); \
  482. assemble_name ((FILE), (NAME)); \
  483. fprintf ((FILE), ","HOST_WIDE_INT_PRINT_UNSIGNED",%u\n", \
  484. (SIZE), (ALIGN) / BITS_PER_UNIT); \
  485. } \
  486. } \
  487. while (0)
  488. #undef SKIP_ASM_OP
  489. #define SKIP_ASM_OP (TARGET_AS100_SYNTAX ? "\t.BLKB\t" : "\t.zero\t")
  490. #undef ASM_OUTPUT_LIMITED_STRING
  491. #define ASM_OUTPUT_LIMITED_STRING(FILE, STR) \
  492. do \
  493. { \
  494. const unsigned char *_limited_str = \
  495. (const unsigned char *) (STR); \
  496. unsigned ch; \
  497. \
  498. fprintf ((FILE), TARGET_AS100_SYNTAX \
  499. ? "\t.BYTE\t\"" : "\t.string\t\""); \
  500. \
  501. for (; (ch = *_limited_str); _limited_str++) \
  502. { \
  503. int escape; \
  504. \
  505. switch (escape = ESCAPES[ch]) \
  506. { \
  507. case 0: \
  508. putc (ch, (FILE)); \
  509. break; \
  510. case 1: \
  511. fprintf ((FILE), "\\%03o", ch); \
  512. break; \
  513. default: \
  514. putc ('\\', (FILE)); \
  515. putc (escape, (FILE)); \
  516. break; \
  517. } \
  518. } \
  519. \
  520. fprintf ((FILE), TARGET_AS100_SYNTAX ? "\"\n\t.BYTE\t0\n" : "\"\n");\
  521. } \
  522. while (0)
  523. /* For PIC put jump tables into the text section so that the offsets that
  524. they contain are always computed between two same-section symbols. */
  525. #define JUMP_TABLES_IN_TEXT_SECTION (TARGET_PID || flag_pic)
  526. /* This is a version of REG_P that also returns TRUE for SUBREGs. */
  527. #define RX_REG_P(rtl) (REG_P (rtl) || GET_CODE (rtl) == SUBREG)
  528. /* Like REG_P except that this macro is true for SET expressions. */
  529. #define SET_P(rtl) (GET_CODE (rtl) == SET)
  530. /* The AS100 assembler does not support .leb128 and .uleb128, but
  531. the compiler-build-time configure tests will have enabled their
  532. use because GAS supports them. So default to generating STABS
  533. debug information instead of DWARF2 when generating AS100
  534. compatible output. */
  535. #undef PREFERRED_DEBUGGING_TYPE
  536. #define PREFERRED_DEBUGGING_TYPE (TARGET_AS100_SYNTAX \
  537. ? DBX_DEBUG : DWARF2_DEBUG)
  538. #define INCOMING_FRAME_SP_OFFSET 4
  539. #define ARG_POINTER_CFA_OFFSET(FNDECL) 4
  540. #define TARGET_USE_FPU (! TARGET_NO_USE_FPU)
  541. /* This macro is used to decide when RX FPU instructions can be used. */
  542. #define ALLOW_RX_FPU_INSNS (TARGET_USE_FPU)
  543. #define BRANCH_COST(SPEED,PREDICT) 1
  544. #define REGISTER_MOVE_COST(MODE,FROM,TO) 2
  545. #define SELECT_CC_MODE(OP,X,Y) rx_select_cc_mode(OP, X, Y)
  546. #define ADJUST_INSN_LENGTH(INSN,LENGTH) \
  547. do \
  548. { \
  549. (LENGTH) = rx_adjust_insn_length ((INSN), (LENGTH)); \
  550. } \
  551. while (0)