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