OSDN Git Service

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