OSDN Git Service

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