OSDN Git Service

* flags.h (g_switch_value): Change to an unsigned
[pf3gnuchains/gcc-fork.git] / gcc / config / frv / frv.h
1 /* Target macros for the FRV port of GCC.
2    Copyright (C) 1999, 2000, 2001, 2002 Free Software Foundation, Inc.
3    Contributed by Red Hat Inc.
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 2, 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 COPYING.  If not, write to the Free
19    Software Foundation, 59 Temple Place - Suite 330, Boston, MA
20    02111-1307, USA.  */
21
22 #ifndef __FRV_H__
23 #define __FRV_H__
24
25 /* Set up System V.4 (aka ELF) defaults.  */
26 #include "svr4.h"
27
28 \f
29 /* Frv general purpose macros.  */
30 /* Align an address.  */
31 #define ADDR_ALIGN(addr,align) (((addr) + (align) - 1) & ~((align) - 1))
32
33 /* Return true if a value is inside a range.  */
34 #define IN_RANGE_P(VALUE, LOW, HIGH)                            \
35   (   (((HOST_WIDE_INT)(VALUE)) >= (HOST_WIDE_INT)(LOW))        \
36    && (((HOST_WIDE_INT)(VALUE)) <= ((HOST_WIDE_INT)(HIGH))))
37
38 \f
39 /* Driver configuration.  */
40
41 /* A C expression which determines whether the option `-CHAR' takes arguments.
42    The value should be the number of arguments that option takes-zero, for many
43    options.
44
45    By default, this macro is defined to handle the standard options properly.
46    You need not define it unless you wish to add additional options which take
47    arguments.
48
49    Defined in svr4.h.  */
50 #undef  SWITCH_TAKES_ARG
51 #define SWITCH_TAKES_ARG(CHAR)                                          \
52   (DEFAULT_SWITCH_TAKES_ARG (CHAR) || (CHAR) == 'G')
53
54 /* A C expression which determines whether the option `-NAME' takes arguments.
55    The value should be the number of arguments that option takes-zero, for many
56    options.  This macro rather than `SWITCH_TAKES_ARG' is used for
57    multi-character option names.
58
59    By default, this macro is defined as `DEFAULT_WORD_SWITCH_TAKES_ARG', which
60    handles the standard options properly.  You need not define
61    `WORD_SWITCH_TAKES_ARG' unless you wish to add additional options which take
62    arguments.  Any redefinition should call `DEFAULT_WORD_SWITCH_TAKES_ARG' and
63    then check for additional options.
64
65    Defined in svr4.h.  */
66 #undef WORD_SWITCH_TAKES_ARG
67
68 /* A C string constant that tells the GNU CC driver program options to pass to
69    the assembler.  It can also specify how to translate options you give to GNU
70    CC into options for GNU CC to pass to the assembler.  See the file `sun3.h'
71    for an example of this.
72
73    Do not define this macro if it does not need to do anything.
74
75    Defined in svr4.h.  */
76 #undef  ASM_SPEC
77 #define ASM_SPEC "\
78 %{G*} %{v} %{n} %{T} %{Ym,*} %{Yd,*} %{Wa,*:%*} \
79 %{mtomcat-stats} \
80 %{!mno-eflags: \
81     %{mcpu=*} \
82     %{mgpr-*} %{mfpr-*} \
83     %{msoft-float} %{mhard-float} \
84     %{mdword} %{mno-dword} \
85     %{mdouble} %{mno-double} \
86     %{mmedia} %{mno-media} \
87     %{mmuladd} %{mno-muladd} \
88     %{mpack} %{mno-pack} \
89     %{fpic: -mpic} %{fPIC: -mPIC} %{mlibrary-pic}}"
90
91 /* Another C string constant used much like `LINK_SPEC'.  The difference
92    between the two is that `STARTFILE_SPEC' is used at the very beginning of
93    the command given to the linker.
94
95    If this macro is not defined, a default is provided that loads the standard
96    C startup file from the usual place.  See `gcc.c'.
97
98    Defined in svr4.h.  */
99 #undef  STARTFILE_SPEC
100 #define STARTFILE_SPEC "crt0%O%s frvbegin%O%s"
101
102 /* Another C string constant used much like `LINK_SPEC'.  The difference
103    between the two is that `ENDFILE_SPEC' is used at the very end of the
104    command given to the linker.
105
106    Do not define this macro if it does not need to do anything.
107
108    Defined in svr4.h.  */
109 #undef  ENDFILE_SPEC
110 #define ENDFILE_SPEC "frvend%O%s"
111
112 /* A C string constant that tells the GNU CC driver program options to pass to
113    CPP.  It can also specify how to translate options you give to GNU CC into
114    options for GNU CC to pass to the CPP.
115
116    Do not define this macro if it does not need to do anything.  */
117
118 /* The idea here is to use the -mcpu option to define macros based on the
119    processor's features, using the features of the default processor if
120    no -mcpu option is given.  These macros can then be overridden by
121    other -m options.  */
122 #define CPP_SPEC "\
123 %{mcpu=frv: %(cpp_frv)} \
124 %{mcpu=fr500: %(cpp_fr500)} \
125 %{mcpu=fr400: %(cpp_fr400)} \
126 %{mcpu=fr300: %(cpp_simple)} \
127 %{mcpu=tomcat: %(cpp_fr500)} \
128 %{mcpu=simple: %(cpp_simple)} \
129 %{!mcpu*: %(cpp_cpu_default)} \
130 %{mno-media: -D__FRV_ACC__=0 %{msoft-float: -D__FRV_FPR__=0}} \
131 %{mhard-float: -D__FRV_HARD_FLOAT__} \
132 %{msoft-float: -U__FRV_HARD_FLOAT__} \
133 %{mgpr-32: -U__FRV_GPR__ -D__FRV_GPR__=32} \
134 %{mgpr-64: -U__FRV_GPR__ -D__FRV_GPR__=64} \
135 %{mfpr-32: -U__FRV_FPR__ -D__FRV_FPR__=32} \
136 %{mfpr-64: -U__FRV_FPR__ -D__FRV_FPR__=64} \
137 %{macc-4: -U__FRV_ACC__ -D__FRV_ACC__=4} \
138 %{macc-8: -U__FRV_ACC__ -D__FRV_ACC__=8} \
139 %{mdword: -D__FRV_DWORD__} \
140 %{mno-dword: -U__FRV_DWORD__} \
141 %{mno-pack: -U__FRV_VLIW__} \
142 %{fleading-underscore: -D__FRV_UNDERSCORE__}"
143
144 /* CPU defaults.  Each CPU has its own CPP spec that defines the default
145    macros for that CPU.  Each CPU also has its own default target mask.
146
147    CPU          GPRs    FPRs    ACCs    FPU     MulAdd  ldd/std  Issue rate
148    ---          ----    ----    ----    ---     ------  -------  ----------
149    FRV          64      64      8       double  yes     yes      4
150    FR500        64      64      8       single  no      yes      4
151    FR400        32      32      4       none    no      yes      2
152    Simple       32      0       0       none    no      no       1 */
153
154
155 #define CPP_FRV_SPEC "\
156 -D__FRV_GPR__=64 \
157 -D__FRV_FPR__=64 \
158 -D__FRV_ACC__=8 \
159 -D__FRV_HARD_FLOAT__ \
160 -D__FRV_DWORD__ \
161 -D__FRV_VLIW__=4"
162
163 #define CPP_FR500_SPEC "\
164 -D__FRV_GPR__=64 \
165 -D__FRV_FPR__=64 \
166 -D__FRV_ACC__=8 \
167 -D__FRV_HARD_FLOAT__ \
168 -D__FRV_DWORD__ \
169 -D__FRV_VLIW__=4"
170
171 #define CPP_FR400_SPEC "\
172 -D__FRV_GPR__=32 \
173 -D__FRV_FPR__=32 \
174 -D__FRV_ACC__=4 \
175 -D__FRV_DWORD__ \
176 -D__FRV_VLIW__=2"
177
178 #define CPP_SIMPLE_SPEC "\
179 -D__FRV_GPR__=32 \
180 -D__FRV_FPR__=0 \
181 -D__FRV_ACC__=0 \
182 %{mmedia: -D__FRV_ACC__=8} \
183 %{mhard-float|mmedia: -D__FRV_FPR__=64}"
184
185 #define MASK_DEFAULT_FRV        \
186   (MASK_MEDIA                   \
187    | MASK_DOUBLE                \
188    | MASK_MULADD                \
189    | MASK_DWORD                 \
190    | MASK_PACK)
191
192 #define MASK_DEFAULT_FR500 \
193   (MASK_MEDIA | MASK_DWORD | MASK_PACK)
194
195 #define MASK_DEFAULT_FR400      \
196   (MASK_GPR_32                  \
197    | MASK_FPR_32                \
198    | MASK_MEDIA                 \
199    | MASK_ACC_4                 \
200    | MASK_SOFT_FLOAT            \
201    | MASK_DWORD                 \
202    | MASK_PACK)
203
204 #define MASK_DEFAULT_SIMPLE \
205   (MASK_GPR_32 | MASK_SOFT_FLOAT)
206
207 /* A C string constant that tells the GNU CC driver program options to pass to
208    `cc1'.  It can also specify how to translate options you give to GNU CC into
209    options for GNU CC to pass to the `cc1'.
210
211    Do not define this macro if it does not need to do anything.  */
212 /* For ABI compliance, we need to put bss data into the normal data section.  */
213 #define CC1_SPEC "%{G*}"
214
215 /* A C string constant that tells the GNU CC driver program options to pass to
216    the linker.  It can also specify how to translate options you give to GNU CC
217    into options for GNU CC to pass to the linker.
218
219    Do not define this macro if it does not need to do anything.
220
221    Defined in svr4.h.  */
222 /* Override the svr4.h version with one that dispenses without the svr4
223    shared library options, notably -G.  */
224 #undef  LINK_SPEC
225 #define LINK_SPEC "\
226 %{h*} %{v:-V} \
227 %{b} %{Wl,*:%*} \
228 %{static:-dn -Bstatic} \
229 %{shared:-Bdynamic} \
230 %{symbolic:-Bsymbolic} \
231 %{G*} \
232 %{YP,*} \
233 %{Qy:} %{!Qn:-Qy}"
234
235 /* Another C string constant used much like `LINK_SPEC'.  The difference
236    between the two is that `LIB_SPEC' is used at the end of the command given
237    to the linker.
238
239    If this macro is not defined, a default is provided that loads the standard
240    C library from the usual place.  See `gcc.c'.
241
242    Defined in svr4.h.  */
243
244 #undef  LIB_SPEC
245 #define LIB_SPEC "--start-group -lc -lsim --end-group"
246
247 /* This macro defines names of additional specifications to put in the specs
248    that can be used in various specifications like CC1_SPEC.  Its definition
249    is an initializer with a subgrouping for each command option.
250
251    Each subgrouping contains a string constant, that defines the
252    specification name, and a string constant that used by the GNU CC driver
253    program.
254
255    Do not define this macro if it does not need to do anything.  */
256
257 #ifndef SUBTARGET_EXTRA_SPECS
258 #define SUBTARGET_EXTRA_SPECS
259 #endif
260
261 #define EXTRA_SPECS                                                     \
262   { "cpp_frv",          CPP_FRV_SPEC },                                 \
263   { "cpp_fr500",        CPP_FR500_SPEC },                               \
264   { "cpp_fr400",        CPP_FR400_SPEC },                               \
265   { "cpp_simple",       CPP_SIMPLE_SPEC },                              \
266   { "cpp_cpu_default",  CPP_CPU_DEFAULT_SPEC },                         \
267   SUBTARGET_EXTRA_SPECS
268
269 #ifndef CPP_CPU_DEFAULT_SPEC
270 #define CPP_CPU_DEFAULT_SPEC    CPP_FR500_SPEC
271 #define CPU_TYPE                FRV_CPU_FR500
272 #endif
273
274 /* Allow us to easily change the default for -malloc-cc.  */
275 #ifndef DEFAULT_NO_ALLOC_CC
276 #define MASK_DEFAULT_ALLOC_CC   MASK_ALLOC_CC
277 #else
278 #define MASK_DEFAULT_ALLOC_CC   0
279 #endif
280
281 /* Run-time target specifications */
282
283 #define TARGET_CPU_CPP_BUILTINS()               \
284   do                                            \
285     {                                           \
286       builtin_define ("__frv__");               \
287       builtin_assert ("machine=frv");           \
288     }                                           \
289   while (0)
290
291 \f
292 /* This declaration should be present.  */
293 extern int target_flags;
294
295 /* This series of macros is to allow compiler command arguments to enable or
296    disable the use of optional features of the target machine.  For example,
297    one machine description serves both the 68000 and the 68020; a command
298    argument tells the compiler whether it should use 68020-only instructions or
299    not.  This command argument works by means of a macro `TARGET_68020' that
300    tests a bit in `target_flags'.
301
302    Define a macro `TARGET_FEATURENAME' for each such option.  Its definition
303    should test a bit in `target_flags'; for example:
304
305         #define TARGET_68020 (target_flags & 1)
306
307    One place where these macros are used is in the condition-expressions of
308    instruction patterns.  Note how `TARGET_68020' appears frequently in the
309    68000 machine description file, `m68k.md'.  Another place they are used is
310    in the definitions of the other macros in the `MACHINE.h' file.  */
311
312 #define MASK_GPR_32          0x00000001 /* Limit gprs to 32 registers */
313 #define MASK_FPR_32          0x00000002 /* Limit fprs to 32 registers */
314 #define MASK_SOFT_FLOAT      0x00000004 /* Use software floating point */
315 #define MASK_ALLOC_CC        0x00000008 /* Dynamically allocate icc/fcc's */
316 #define MASK_DWORD           0x00000010 /* Change ABi to allow dbl word insns*/
317 #define MASK_DOUBLE          0x00000020 /* Use double precision instructions */
318 #define MASK_MEDIA           0x00000040 /* Use media instructions */
319 #define MASK_MULADD          0x00000080 /* Use multiply add/subtract insns */
320 #define MASK_LIBPIC          0x00000100 /* -fpic that can be linked w/o pic */
321 #define MASK_ACC_4           0x00000200 /* Only use four media accumulators */
322 #define MASK_PACK            0x00000400 /* Set to enable packed output */
323
324                                         /* put debug masks up high */
325 #define MASK_DEBUG_ARG       0x40000000 /* debug argument handling */
326 #define MASK_DEBUG_ADDR      0x20000000 /* debug go_if_legitimate_address */
327 #define MASK_DEBUG_STACK     0x10000000 /* debug stack frame */
328 #define MASK_DEBUG           0x08000000 /* general debugging switch */
329 #define MASK_DEBUG_LOC       0x04000000 /* optimize line # table */
330 #define MASK_DEBUG_COND_EXEC 0x02000000 /* debug cond exec code */
331 #define MASK_NO_COND_MOVE    0x01000000 /* disable conditional moves */
332 #define MASK_NO_SCC          0x00800000 /* disable set conditional codes */
333 #define MASK_NO_COND_EXEC    0x00400000 /* disable conditional execution */
334 #define MASK_NO_VLIW_BRANCH  0x00200000 /* disable repacking branches */
335 #define MASK_NO_MULTI_CE     0x00100000 /* disable multi-level cond exec */
336 #define MASK_NO_NESTED_CE    0x00080000 /* disable nested cond exec */
337
338 #define MASK_DEFAULT            MASK_DEFAULT_ALLOC_CC
339
340 #define TARGET_GPR_32           ((target_flags & MASK_GPR_32) != 0)
341 #define TARGET_FPR_32           ((target_flags & MASK_FPR_32) != 0)
342 #define TARGET_SOFT_FLOAT       ((target_flags & MASK_SOFT_FLOAT) != 0)
343 #define TARGET_ALLOC_CC         ((target_flags & MASK_ALLOC_CC) != 0)
344 #define TARGET_DWORD            ((target_flags & MASK_DWORD) != 0)
345 #define TARGET_DOUBLE           ((target_flags & MASK_DOUBLE) != 0)
346 #define TARGET_MEDIA            ((target_flags & MASK_MEDIA) != 0)
347 #define TARGET_MULADD           ((target_flags & MASK_MULADD) != 0)
348 #define TARGET_LIBPIC           ((target_flags & MASK_LIBPIC) != 0)
349 #define TARGET_ACC_4            ((target_flags & MASK_ACC_4) != 0)
350 #define TARGET_DEBUG_ARG        ((target_flags & MASK_DEBUG_ARG) != 0)
351 #define TARGET_DEBUG_ADDR       ((target_flags & MASK_DEBUG_ADDR) != 0)
352 #define TARGET_DEBUG_STACK      ((target_flags & MASK_DEBUG_STACK) != 0)
353 #define TARGET_DEBUG            ((target_flags & MASK_DEBUG) != 0)
354 #define TARGET_DEBUG_LOC        ((target_flags & MASK_DEBUG_LOC) != 0)
355 #define TARGET_DEBUG_COND_EXEC  ((target_flags & MASK_DEBUG_COND_EXEC) != 0)
356 #define TARGET_NO_COND_MOVE     ((target_flags & MASK_NO_COND_MOVE) != 0)
357 #define TARGET_NO_SCC           ((target_flags & MASK_NO_SCC) != 0)
358 #define TARGET_NO_COND_EXEC     ((target_flags & MASK_NO_COND_EXEC) != 0)
359 #define TARGET_NO_VLIW_BRANCH   ((target_flags & MASK_NO_VLIW_BRANCH) != 0)
360 #define TARGET_NO_MULTI_CE      ((target_flags & MASK_NO_MULTI_CE) != 0)
361 #define TARGET_NO_NESTED_CE     ((target_flags & MASK_NO_NESTED_CE) != 0)
362 #define TARGET_PACK             ((target_flags & MASK_PACK) != 0)
363
364 #define TARGET_GPR_64           (! TARGET_GPR_32)
365 #define TARGET_FPR_64           (! TARGET_FPR_32)
366 #define TARGET_HARD_FLOAT       (! TARGET_SOFT_FLOAT)
367 #define TARGET_FIXED_CC         (! TARGET_ALLOC_CC)
368 #define TARGET_COND_MOVE        (! TARGET_NO_COND_MOVE)
369 #define TARGET_SCC              (! TARGET_NO_SCC)
370 #define TARGET_COND_EXEC        (! TARGET_NO_COND_EXEC)
371 #define TARGET_VLIW_BRANCH      (! TARGET_NO_VLIW_BRANCH)
372 #define TARGET_MULTI_CE         (! TARGET_NO_MULTI_CE)
373 #define TARGET_NESTED_CE        (! TARGET_NO_NESTED_CE)
374 #define TARGET_ACC_8            (! TARGET_ACC_4)
375
376 #define TARGET_HAS_FPRS         (TARGET_HARD_FLOAT || TARGET_MEDIA)
377
378 #define NUM_GPRS                (TARGET_GPR_32? 32 : 64)
379 #define NUM_FPRS                (!TARGET_HAS_FPRS? 0 : TARGET_FPR_32? 32 : 64)
380 #define NUM_ACCS                (!TARGET_MEDIA? 0 : TARGET_ACC_4? 4 : 8)
381
382 /* Macros to identify the blend of media instructions available.  Revision 1
383    is the one found on the FR500.  Revision 2 includes the changes made for
384    the FR400.
385
386    Treat the generic processor as a revision 1 machine for now, for
387    compatibility with earlier releases.  */
388
389 #define TARGET_MEDIA_REV1                                       \
390   (TARGET_MEDIA                                                 \
391    && (frv_cpu_type == FRV_CPU_GENERIC                          \
392        || frv_cpu_type == FRV_CPU_FR500))
393
394 #define TARGET_MEDIA_REV2                                       \
395   (TARGET_MEDIA && frv_cpu_type == FRV_CPU_FR400)
396
397 /* This macro defines names of command options to set and clear bits in
398    `target_flags'.  Its definition is an initializer with a subgrouping for
399    each command option.
400
401    Each subgrouping contains a string constant, that defines the option name,
402    a number, which contains the bits to set in `target_flags', and an optional
403    second string which is the textual description that will be displayed when
404    the user passes --help on the command line.  If the number entry is negative
405    then the specified bits will be cleared instead of being set.  If the second
406    string entry is present but empty, then no help information will be displayed
407    for that option, but it will not count as an undocumented option.  The actual
408    option name, asseen on the command line is made by appending `-m' to the
409    specified name.
410
411    One of the subgroupings should have a null string.  The number in this
412    grouping is the default value for `target_flags'.  Any target options act
413    starting with that value.
414
415    Here is an example which defines `-m68000' and `-m68020' with opposite
416    meanings, and picks the latter as the default:
417
418         #define TARGET_SWITCHES \
419           { { "68020",  1, ""},      \
420             { "68000", -1, "Compile for the m68000"},     \
421             { "",       1, }}
422
423    This declaration must be present.  */
424
425 #define TARGET_SWITCHES                                                     \
426 {{ "gpr-32",              MASK_GPR_32,          "Only use 32 gprs"},        \
427  { "gpr-64",             -MASK_GPR_32,          "Use 64 gprs"},             \
428  { "fpr-32",              MASK_FPR_32,          "Only use 32 fprs"},        \
429  { "fpr-64",             -MASK_FPR_32,          "Use 64 fprs"},             \
430  { "hard-float",         -MASK_SOFT_FLOAT,      "Use hardware floating point" },\
431  { "soft-float",          MASK_SOFT_FLOAT,      "Use software floating point" },\
432  { "alloc-cc",            MASK_ALLOC_CC,        "Dynamically allocate cc's" }, \
433  { "fixed-cc",           -MASK_ALLOC_CC,        "Just use icc0/fcc0" },     \
434  { "dword",               MASK_DWORD,           "Change ABI to allow double word insns" }, \
435  { "no-dword",           -MASK_DWORD,           "Do not use double word insns" }, \
436  { "double",              MASK_DOUBLE,          "Use fp double instructions" }, \
437  { "no-double",          -MASK_DOUBLE,          "Do not use fp double insns" }, \
438  { "media",               MASK_MEDIA,           "Use media instructions" }, \
439  { "no-media",           -MASK_MEDIA,           "Do not use media insns" }, \
440  { "muladd",              MASK_MULADD,          "Use multiply add/subtract instructions" }, \
441  { "no-muladd",          -MASK_MULADD,          "Do not use multiply add/subtract insns" }, \
442  { "library-pic",         MASK_LIBPIC,          "PIC support for building libraries" }, \
443  { "acc-4",               MASK_ACC_4,           "Use 4 media accumulators" }, \
444  { "acc-8",              -MASK_ACC_4,           "Use 8 media accumulators" }, \
445  { "pack",                MASK_PACK,            "Pack VLIW instructions" }, \
446  { "no-pack",            -MASK_PACK,            "Do not pack VLIW instructions" }, \
447  { "no-eflags",           0,                    "Do not mark ABI switches in e_flags" }, \
448  { "debug-arg",           MASK_DEBUG_ARG,       "Internal debug switch" },  \
449  { "debug-addr",          MASK_DEBUG_ADDR,      "Internal debug switch" },  \
450  { "debug-stack",         MASK_DEBUG_STACK,     "Internal debug switch" },  \
451  { "debug",               MASK_DEBUG,           "Internal debug switch" },  \
452  { "debug-cond-exec",     MASK_DEBUG_COND_EXEC, "Internal debug switch" },  \
453  { "debug-loc",           MASK_DEBUG_LOC,       "Internal debug switch" },  \
454  { "cond-move",          -MASK_NO_COND_MOVE,    "Enable conditional moves" },  \
455  { "no-cond-move",        MASK_NO_COND_MOVE,    "Disable conditional moves" },  \
456  { "scc",                -MASK_NO_SCC,          "Enable setting gprs to the result of comparisons" },  \
457  { "no-scc",              MASK_NO_SCC,          "Disable setting gprs to the result of comparisons" },  \
458  { "cond-exec",          -MASK_NO_COND_EXEC,    "Enable conditional execution other than moves/scc" }, \
459  { "no-cond-exec",        MASK_NO_COND_EXEC,    "Disable conditional execution other than moves/scc" }, \
460  { "vliw-branch",        -MASK_NO_VLIW_BRANCH,  "Run pass to pack branches into VLIW insns" }, \
461  { "no-vliw-branch",      MASK_NO_VLIW_BRANCH,  "Do not run pass to pack branches into VLIW insns" }, \
462  { "multi-cond-exec",    -MASK_NO_MULTI_CE,     "Disable optimizing &&/|| in conditional execution" }, \
463  { "no-multi-cond-exec",  MASK_NO_MULTI_CE,     "Enable optimizing &&/|| in conditional execution" }, \
464  { "nested-cond-exec",   -MASK_NO_NESTED_CE,    "Enable nested conditional execution optimizations" }, \
465  { "no-nested-cond-exec" ,MASK_NO_NESTED_CE,    "Disable nested conditional execution optimizations" }, \
466  { "tomcat-stats",        0,                    "Cause gas to print tomcat statistics" }, \
467  { "",                    MASK_DEFAULT,         "" }}                       \
468
469 /* This macro is similar to `TARGET_SWITCHES' but defines names of command
470    options that have values.  Its definition is an initializer with a
471    subgrouping for each command option.
472
473    Each subgrouping contains a string constant, that defines the fixed part of
474    the option name, the address of a variable, and an optional description string.
475    The variable, of type `char *', is set to the text following the fixed part of
476    the option as it is specified on the command line.  The actual option name is
477    made by appending `-m' to the specified name.
478
479    Here is an example which defines `-mshort-data-NUMBER'.  If the given option
480    is `-mshort-data-512', the variable `m88k_short_data' will be set to the
481    string `"512"'.
482
483         extern char *m88k_short_data;
484         #define TARGET_OPTIONS \
485          { { "short-data-", & m88k_short_data, \
486          "Specify the size of the short data section"  } }
487
488    This declaration is optional.  */
489 #define TARGET_OPTIONS                                                        \
490 {                                                                             \
491   { "cpu=",             &frv_cpu_string,         "Set cpu type", 0},          \
492   { "branch-cost=",     &frv_branch_cost_string, "Internal debug switch", 0}, \
493   { "cond-exec-insns=", &frv_condexec_insns_str, "Internal debug switch", 0}, \
494   { "cond-exec-temps=", &frv_condexec_temps_str, "Internal debug switch", 0}, \
495   { "sched-lookahead=", &frv_sched_lookahead_str,"Internal debug switch", 0}, \
496 }
497
498 /* This macro is a C statement to print on `stderr' a string describing the
499    particular machine description choice.  Every machine description should
500    define `TARGET_VERSION'.  For example:
501
502         #ifdef MOTOROLA
503         #define TARGET_VERSION \
504           fprintf (stderr, " (68k, Motorola syntax)");
505         #else
506         #define TARGET_VERSION \
507           fprintf (stderr, " (68k, MIT syntax)");
508         #endif  */
509 #define TARGET_VERSION fprintf (stderr, _(" (frv)"))
510
511 /* Sometimes certain combinations of command options do not make sense on a
512    particular target machine.  You can define a macro `OVERRIDE_OPTIONS' to
513    take account of this.  This macro, if defined, is executed once just after
514    all the command options have been parsed.
515
516    Don't use this macro to turn on various extra optimizations for `-O'.  That
517    is what `OPTIMIZATION_OPTIONS' is for.  */
518
519 #define OVERRIDE_OPTIONS frv_override_options ()
520
521 /* Some machines may desire to change what optimizations are performed for
522    various optimization levels.  This macro, if defined, is executed once just
523    after the optimization level is determined and before the remainder of the
524    command options have been parsed.  Values set in this macro are used as the
525    default values for the other command line options.
526
527    LEVEL is the optimization level specified; 2 if `-O2' is specified, 1 if
528    `-O' is specified, and 0 if neither is specified.
529
530    SIZE is nonzero if `-Os' is specified, 0 otherwise.
531
532    You should not use this macro to change options that are not
533    machine-specific.  These should uniformly selected by the same optimization
534    level on all supported machines.  Use this macro to enable machbine-specific
535    optimizations.
536
537    *Do not examine `write_symbols' in this macro!* The debugging options are
538    *not supposed to alter the generated code.  */
539 #define OPTIMIZATION_OPTIONS(LEVEL,SIZE) frv_optimization_options (LEVEL, SIZE)
540
541
542 /* Define this macro if debugging can be performed even without a frame
543    pointer.  If this macro is defined, GNU CC will turn on the
544    `-fomit-frame-pointer' option whenever `-O' is specified.  */
545 /* Frv needs a specific frame layout that includes the frame pointer */
546
547 #define CAN_DEBUG_WITHOUT_FP
548
549 \f
550 /* Small Data Area Support.  */
551 /* Maximum size of variables that go in .sdata/.sbss.
552    The -msdata=foo switch also controls how small variables are handled.  */
553 #ifndef SDATA_DEFAULT_SIZE
554 #define SDATA_DEFAULT_SIZE 8
555 #endif
556
557
558 /* Storage Layout */
559
560 /* Define this macro to have the value 1 if the most significant bit in a byte
561    has the lowest number; otherwise define it to have the value zero.  This
562    means that bit-field instructions count from the most significant bit.  If
563    the machine has no bit-field instructions, then this must still be defined,
564    but it doesn't matter which value it is defined to.  This macro need not be
565    a constant.
566
567    This macro does not affect the way structure fields are packed into bytes or
568    words; that is controlled by `BYTES_BIG_ENDIAN'.  */
569 #define BITS_BIG_ENDIAN 1
570
571 /* Define this macro to have the value 1 if the most significant byte in a word
572    has the lowest number.  This macro need not be a constant.  */
573 #define BYTES_BIG_ENDIAN 1
574
575 /* Define this macro to have the value 1 if, in a multiword object, the most
576    significant word has the lowest number.  This applies to both memory
577    locations and registers; GNU CC fundamentally assumes that the order of
578    words in memory is the same as the order in registers.  This macro need not
579    be a constant.  */
580 #define WORDS_BIG_ENDIAN 1
581
582 /* Number of storage units in a word; normally 4.  */
583 #define UNITS_PER_WORD 4
584
585 /* A macro to update MODE and UNSIGNEDP when an object whose type is TYPE and
586    which has the specified mode and signedness is to be stored in a register.
587    This macro is only called when TYPE is a scalar type.
588
589    On most RISC machines, which only have operations that operate on a full
590    register, define this macro to set M to `word_mode' if M is an integer mode
591    narrower than `BITS_PER_WORD'.  In most cases, only integer modes should be
592    widened because wider-precision floating-point operations are usually more
593    expensive than their narrower counterparts.
594
595    For most machines, the macro definition does not change UNSIGNEDP.  However,
596    some machines, have instructions that preferentially handle either signed or
597    unsigned quantities of certain modes.  For example, on the DEC Alpha, 32-bit
598    loads from memory and 32-bit add instructions sign-extend the result to 64
599    bits.  On such machines, set UNSIGNEDP according to which kind of extension
600    is more efficient.
601
602    Do not define this macro if it would never modify MODE.  */
603 #define PROMOTE_MODE(MODE, UNSIGNEDP, TYPE)     \
604   do                                            \
605     {                                           \
606       if (GET_MODE_CLASS (MODE) == MODE_INT     \
607           && GET_MODE_SIZE (MODE) < 4)          \
608         (MODE) = SImode;                        \
609     }                                           \
610   while (0)
611
612 /* Normal alignment required for function parameters on the stack, in bits.
613    All stack parameters receive at least this much alignment regardless of data
614    type.  On most machines, this is the same as the size of an integer.  */
615 #define PARM_BOUNDARY 32
616
617 /* Define this macro if you wish to preserve a certain alignment for the stack
618    pointer.  The definition is a C expression for the desired alignment
619    (measured in bits).
620
621    If `PUSH_ROUNDING' is not defined, the stack will always be aligned to the
622    specified boundary.  If `PUSH_ROUNDING' is defined and specifies a less
623    strict alignment than `STACK_BOUNDARY', the stack may be momentarily
624    unaligned while pushing arguments.  */
625 #define STACK_BOUNDARY 64
626
627 /* Alignment required for a function entry point, in bits.  */
628 #define FUNCTION_BOUNDARY 128
629
630 /* Biggest alignment that any data type can require on this machine,
631    in bits.  */
632 #define BIGGEST_ALIGNMENT 64
633
634 /* @@@ A hack, needed because libobjc wants to use ADJUST_FIELD_ALIGN for
635    some reason.  */
636 #ifdef IN_TARGET_LIBS
637 #define BIGGEST_FIELD_ALIGNMENT 64
638 #else
639 /* An expression for the alignment of a structure field FIELD if the
640    alignment computed in the usual way is COMPUTED.  GNU CC uses this
641    value instead of the value in `BIGGEST_ALIGNMENT' or
642    `BIGGEST_FIELD_ALIGNMENT', if defined, for structure fields only.  */
643 #define ADJUST_FIELD_ALIGN(FIELD, COMPUTED)                             \
644   frv_adjust_field_align (FIELD, COMPUTED)
645 #endif
646
647 /* If defined, a C expression to compute the alignment for a static variable.
648    TYPE is the data type, and ALIGN is the alignment that the object
649    would ordinarily have.  The value of this macro is used instead of that
650    alignment to align the object.
651
652    If this macro is not defined, then ALIGN is used.
653
654    One use of this macro is to increase alignment of medium-size data to make
655    it all fit in fewer cache lines.  Another is to cause character arrays to be
656    word-aligned so that `strcpy' calls that copy constants to character arrays
657    can be done inline.  */
658 #define DATA_ALIGNMENT(TYPE, ALIGN)             \
659   (TREE_CODE (TYPE) == ARRAY_TYPE               \
660    && TYPE_MODE (TREE_TYPE (TYPE)) == QImode    \
661    && (ALIGN) < BITS_PER_WORD ? BITS_PER_WORD : (ALIGN))
662
663 /* If defined, a C expression to compute the alignment given to a constant that
664    is being placed in memory.  CONSTANT is the constant and ALIGN is the
665    alignment that the object would ordinarily have.  The value of this macro is
666    used instead of that alignment to align the object.
667
668    If this macro is not defined, then ALIGN is used.
669
670    The typical use of this macro is to increase alignment for string constants
671    to be word aligned so that `strcpy' calls that copy constants can be done
672    inline.  */
673 #define CONSTANT_ALIGNMENT(EXP, ALIGN)  \
674   (TREE_CODE (EXP) == STRING_CST        \
675    && (ALIGN) < BITS_PER_WORD ? BITS_PER_WORD : (ALIGN))
676
677 /* Define this macro to be the value 1 if instructions will fail to work if
678    given data not on the nominal alignment.  If instructions will merely go
679    slower in that case, define this macro as 0.  */
680 #define STRICT_ALIGNMENT 1
681
682 /* Define this if you wish to imitate the way many other C compilers handle
683    alignment of bitfields and the structures that contain them.
684
685    The behavior is that the type written for a bit-field (`int', `short', or
686    other integer type) imposes an alignment for the entire structure, as if the
687    structure really did contain an ordinary field of that type.  In addition,
688    the bit-field is placed within the structure so that it would fit within such
689    a field, not crossing a boundary for it.
690
691    Thus, on most machines, a bit-field whose type is written as `int' would not
692    cross a four-byte boundary, and would force four-byte alignment for the
693    whole structure.  (The alignment used may not be four bytes; it is
694    controlled by the other alignment parameters.)
695
696    If the macro is defined, its definition should be a C expression; a nonzero
697    value for the expression enables this behavior.
698
699    Note that if this macro is not defined, or its value is zero, some bitfields
700    may cross more than one alignment boundary.  The compiler can support such
701    references if there are `insv', `extv', and `extzv' insns that can directly
702    reference memory.
703
704    The other known way of making bitfields work is to define
705    `STRUCTURE_SIZE_BOUNDARY' as large as `BIGGEST_ALIGNMENT'.  Then every
706    structure can be accessed with fullwords.
707
708    Unless the machine has bit-field instructions or you define
709    `STRUCTURE_SIZE_BOUNDARY' that way, you must define
710    `PCC_BITFIELD_TYPE_MATTERS' to have a nonzero value.
711
712    If your aim is to make GNU CC use the same conventions for laying out
713    bitfields as are used by another compiler, here is how to investigate what
714    the other compiler does.  Compile and run this program:
715
716         struct foo1
717         {
718           char x;
719           char :0;
720           char y;
721         };
722
723         struct foo2
724         {
725           char x;
726           int :0;
727           char y;
728         };
729
730         main ()
731         {
732           printf ("Size of foo1 is %d\n",
733                   sizeof (struct foo1));
734           printf ("Size of foo2 is %d\n",
735                   sizeof (struct foo2));
736           exit (0);
737         }
738
739    If this prints 2 and 5, then the compiler's behavior is what you would get
740    from `PCC_BITFIELD_TYPE_MATTERS'.
741
742    Defined in svr4.h.  */
743 #define PCC_BITFIELD_TYPE_MATTERS 1
744
745 \f
746 /* Layout of Source Language Data Types.  */
747
748 #define CHAR_TYPE_SIZE         8
749 #define SHORT_TYPE_SIZE       16
750 #define INT_TYPE_SIZE         32
751 #define LONG_TYPE_SIZE        32
752 #define LONG_LONG_TYPE_SIZE   64
753 #define FLOAT_TYPE_SIZE       32
754 #define DOUBLE_TYPE_SIZE      64
755 #define LONG_DOUBLE_TYPE_SIZE 64
756
757 /* An expression whose value is 1 or 0, according to whether the type `char'
758    should be signed or unsigned by default.  The user can always override this
759    default with the options `-fsigned-char' and `-funsigned-char'.  */
760 #define DEFAULT_SIGNED_CHAR 1
761
762 \f
763 /* General purpose registers.  */
764 #define GPR_FIRST       0                       /* First gpr */
765 #define GPR_LAST        (GPR_FIRST + 63)        /* Last gpr */
766 #define GPR_R0          GPR_FIRST               /* R0, constant 0 */
767 #define GPR_FP          (GPR_FIRST + 2)         /* Frame pointer */
768 #define GPR_SP          (GPR_FIRST + 1)         /* Stack pointer */
769                                                 /* small data register */
770 #define SDA_BASE_REG    ((unsigned)(flag_pic ? PIC_REGNO : (GPR_FIRST+16)))
771 #define PIC_REGNO       (GPR_FIRST + 17)        /* PIC register */
772
773 #define FPR_FIRST       64                      /* First FP reg */
774 #define FPR_LAST        127                     /* Last  FP reg */
775
776 #define DEFAULT_CONDEXEC_TEMPS 4                /* reserve 4 regs by default */
777 #define GPR_TEMP_NUM    frv_condexec_temps      /* # gprs to reserve for temps */
778
779 /* We reserve the last CR and CCR in each category to be used as a reload
780    register to reload the CR/CCR registers.  This is a kludge.  */
781 #define CC_FIRST        128                     /* First ICC/FCC reg */
782 #define CC_LAST         135                     /* Last  ICC/FCC reg */
783 #define ICC_FIRST       (CC_FIRST + 4)          /* First ICC reg */
784 #define ICC_LAST        (CC_FIRST + 7)          /* Last  ICC reg */
785 #define ICC_TEMP        (CC_FIRST + 7)          /* Temporary ICC reg */
786 #define FCC_FIRST       (CC_FIRST)              /* First FCC reg */
787 #define FCC_LAST        (CC_FIRST + 3)          /* Last  FCC reg */
788
789 /* Amount to shift a value to locate a ICC or FCC register in the CCR
790    register and shift it to the bottom 4 bits.  */
791 #define CC_SHIFT_RIGHT(REGNO) (((REGNO) - CC_FIRST) << 2)
792
793 /* Mask to isolate a single ICC/FCC value.  */
794 #define CC_MASK         0xf
795
796 /* Masks to isolate the various bits in an ICC field.  */
797 #define ICC_MASK_N      0x8     /* negative */
798 #define ICC_MASK_Z      0x4     /* zero */
799 #define ICC_MASK_V      0x2     /* overflow */
800 #define ICC_MASK_C      0x1     /* carry */
801
802 /* Mask to isolate the N/Z flags in an ICC.  */
803 #define ICC_MASK_NZ (ICC_MASK_N | ICC_MASK_Z)
804
805 /* Mask to isolate the Z/C flags in an ICC.  */
806 #define ICC_MASK_ZC (ICC_MASK_Z | ICC_MASK_C)
807
808 /* Masks to isolate the various bits in a FCC field.  */
809 #define FCC_MASK_E      0x8     /* equal */
810 #define FCC_MASK_L      0x4     /* less than */
811 #define FCC_MASK_G      0x2     /* greater than */
812 #define FCC_MASK_U      0x1     /* unordered */
813
814 /* For CCR registers, the machine wants CR4..CR7 to be used for integer
815    code and CR0..CR3 to be used for floating point.  */
816 #define CR_FIRST        136                     /* First CCR */
817 #define CR_LAST         143                     /* Last  CCR */
818 #define CR_NUM          (CR_LAST-CR_FIRST+1)    /* # of CCRs (8) */
819 #define ICR_FIRST       (CR_FIRST + 4)          /* First integer CCR */
820 #define ICR_LAST        (CR_FIRST + 7)          /* Last  integer CCR */
821 #define ICR_TEMP        ICR_LAST                /* Temp  integer CCR */
822 #define FCR_FIRST       (CR_FIRST + 0)          /* First float CCR */
823 #define FCR_LAST        (CR_FIRST + 3)          /* Last  float CCR */
824
825 /* Amount to shift a value to locate a CR register in the CCCR special purpose
826    register and shift it to the bottom 2 bits.  */
827 #define CR_SHIFT_RIGHT(REGNO) (((REGNO) - CR_FIRST) << 1)
828
829 /* Mask to isolate a single CR value.  */
830 #define CR_MASK         0x3
831
832 #define ACC_FIRST       144                     /* First acc register */
833 #define ACC_LAST        151                     /* Last  acc register */
834
835 #define ACCG_FIRST      152                     /* First accg register */
836 #define ACCG_LAST       159                     /* Last  accg register */
837
838 #define AP_FIRST        160                     /* fake argument pointer */
839
840 #define SPR_FIRST       161
841 #define SPR_LAST        162
842 #define LR_REGNO        (SPR_FIRST)
843 #define LCR_REGNO       (SPR_FIRST + 1)
844
845 #define GPR_P(R)        IN_RANGE_P (R, GPR_FIRST, GPR_LAST)
846 #define GPR_OR_AP_P(R)  (GPR_P (R) || (R) == ARG_POINTER_REGNUM)
847 #define FPR_P(R)        IN_RANGE_P (R, FPR_FIRST, FPR_LAST)
848 #define CC_P(R)         IN_RANGE_P (R, CC_FIRST, CC_LAST)
849 #define ICC_P(R)        IN_RANGE_P (R, ICC_FIRST, ICC_LAST)
850 #define FCC_P(R)        IN_RANGE_P (R, FCC_FIRST, FCC_LAST)
851 #define CR_P(R)         IN_RANGE_P (R, CR_FIRST, CR_LAST)
852 #define ICR_P(R)        IN_RANGE_P (R, ICR_FIRST, ICR_LAST)
853 #define FCR_P(R)        IN_RANGE_P (R, FCR_FIRST, FCR_LAST)
854 #define ACC_P(R)        IN_RANGE_P (R, ACC_FIRST, ACC_LAST)
855 #define ACCG_P(R)       IN_RANGE_P (R, ACCG_FIRST, ACCG_LAST)
856 #define SPR_P(R)        IN_RANGE_P (R, SPR_FIRST, SPR_LAST)
857
858 #define GPR_OR_PSEUDO_P(R)      (GPR_P (R) || (R) >= FIRST_PSEUDO_REGISTER)
859 #define FPR_OR_PSEUDO_P(R)      (FPR_P (R) || (R) >= FIRST_PSEUDO_REGISTER)
860 #define GPR_AP_OR_PSEUDO_P(R)   (GPR_OR_AP_P (R) || (R) >= FIRST_PSEUDO_REGISTER)
861 #define CC_OR_PSEUDO_P(R)       (CC_P (R) || (R) >= FIRST_PSEUDO_REGISTER)
862 #define ICC_OR_PSEUDO_P(R)      (ICC_P (R) || (R) >= FIRST_PSEUDO_REGISTER)
863 #define FCC_OR_PSEUDO_P(R)      (FCC_P (R) || (R) >= FIRST_PSEUDO_REGISTER)
864 #define CR_OR_PSEUDO_P(R)       (CR_P (R) || (R) >= FIRST_PSEUDO_REGISTER)
865 #define ICR_OR_PSEUDO_P(R)      (ICR_P (R) || (R) >= FIRST_PSEUDO_REGISTER)
866 #define FCR_OR_PSEUDO_P(R)      (FCR_P (R) || (R) >= FIRST_PSEUDO_REGISTER)
867 #define ACC_OR_PSEUDO_P(R)      (ACC_P (R) || (R) >= FIRST_PSEUDO_REGISTER)
868 #define ACCG_OR_PSEUDO_P(R)     (ACCG_P (R) || (R) >= FIRST_PSEUDO_REGISTER)
869
870 #define MAX_STACK_IMMEDIATE_OFFSET 2047
871
872 \f
873 /* Register Basics.  */
874
875 /* Number of hardware registers known to the compiler.  They receive numbers 0
876    through `FIRST_PSEUDO_REGISTER-1'; thus, the first pseudo register's number
877    really is assigned the number `FIRST_PSEUDO_REGISTER'.  */
878 #define FIRST_PSEUDO_REGISTER (SPR_LAST + 1)
879
880 /* The first/last register that can contain the arguments to a function.  */
881 #define FIRST_ARG_REGNUM        (GPR_FIRST + 8)
882 #define LAST_ARG_REGNUM         (FIRST_ARG_REGNUM + FRV_NUM_ARG_REGS - 1)
883
884 /* Registers used by the exception handling functions.  These should be
885    registers that are not otherwised used by the calling sequence.  */
886 #define FIRST_EH_REGNUM         14
887 #define LAST_EH_REGNUM          15
888
889 /* Scratch registers used in the prologue, epilogue and thunks.
890    OFFSET_REGNO is for loading constant addends that are too big for a
891    single instruction.  TEMP_REGNO is used for transferring SPRs to and from
892    the stack, and various other activities.  */
893 #define OFFSET_REGNO            4
894 #define TEMP_REGNO              5
895
896 /* Registers used in the prologue.  OLD_SP_REGNO is the old stack pointer,
897    which is sometimes used to set up the frame pointer.  */
898 #define OLD_SP_REGNO            6
899
900 /* Registers used in the epilogue.  STACKADJ_REGNO stores the exception
901    handler's stack adjustment.  */
902 #define STACKADJ_REGNO          6
903
904 /* Registers used in thunks.  JMP_REGNO is used for loading the target
905    address.  */
906 #define JUMP_REGNO              6
907
908 #define EH_RETURN_DATA_REGNO(N) ((N) <= (LAST_EH_REGNUM - FIRST_EH_REGNUM)? \
909                                  (N) + FIRST_EH_REGNUM : INVALID_REGNUM)
910 #define EH_RETURN_STACKADJ_RTX  gen_rtx_REG (SImode, STACKADJ_REGNO)
911 #define EH_RETURN_HANDLER_RTX   RETURN_ADDR_RTX (0, frame_pointer_rtx)
912
913 /* An initializer that says which registers are used for fixed purposes all
914    throughout the compiled code and are therefore not available for general
915    allocation.  These would include the stack pointer, the frame pointer
916    (except on machines where that can be used as a general register when no
917    frame pointer is needed), the program counter on machines where that is
918    considered one of the addressable registers, and any other numbered register
919    with a standard use.
920
921    This information is expressed as a sequence of numbers, separated by commas
922    and surrounded by braces.  The Nth number is 1 if register N is fixed, 0
923    otherwise.
924
925    The table initialized from this macro, and the table initialized by the
926    following one, may be overridden at run time either automatically, by the
927    actions of the macro `CONDITIONAL_REGISTER_USAGE', or by the user with the
928    command options `-ffixed-REG', `-fcall-used-REG' and `-fcall-saved-REG'.  */
929
930 /* gr0  -- Hard Zero
931    gr1  -- Stack Pointer
932    gr2  -- Frame Pointer
933    gr3  -- Hidden Parameter
934    gr16 -- Small Data reserved
935    gr17 -- Pic reserved
936    gr28 -- OS reserved
937    gr29 -- OS reserved
938    gr30 -- OS reserved
939    gr31 -- OS reserved
940    cr3  -- reserved to reload FCC registers.
941    cr7  -- reserved to reload ICC registers.  */
942 #define FIXED_REGISTERS                                                 \
943 {       /* Integer Registers */                                         \
944         1, 1, 1, 1, 0, 0, 0, 0,         /* 000-007, gr0  - gr7  */      \
945         0, 0, 0, 0, 0, 0, 0, 0,         /* 008-015, gr8  - gr15 */      \
946         1, 1, 0, 0, 0, 0, 0, 0,         /* 016-023, gr16 - gr23 */      \
947         0, 0, 0, 0, 1, 1, 1, 1,         /* 024-031, gr24 - gr31 */      \
948         0, 0, 0, 0, 0, 0, 0, 0,         /* 032-039, gr32 - gr39 */      \
949         0, 0, 0, 0, 0, 0, 0, 0,         /* 040-040, gr48 - gr47 */      \
950         0, 0, 0, 0, 0, 0, 0, 0,         /* 048-055, gr48 - gr55 */      \
951         0, 0, 0, 0, 0, 0, 0, 0,         /* 056-063, gr56 - gr63 */      \
952         /* Float Registers */                                           \
953         0, 0, 0, 0, 0, 0, 0, 0,         /* 064-071, fr0  - fr7  */      \
954         0, 0, 0, 0, 0, 0, 0, 0,         /* 072-079, fr8  - fr15 */      \
955         0, 0, 0, 0, 0, 0, 0, 0,         /* 080-087, fr16 - fr23 */      \
956         0, 0, 0, 0, 0, 0, 0, 0,         /* 088-095, fr24 - fr31 */      \
957         0, 0, 0, 0, 0, 0, 0, 0,         /* 096-103, fr32 - fr39 */      \
958         0, 0, 0, 0, 0, 0, 0, 0,         /* 104-111, fr48 - fr47 */      \
959         0, 0, 0, 0, 0, 0, 0, 0,         /* 112-119, fr48 - fr55 */      \
960         0, 0, 0, 0, 0, 0, 0, 0,         /* 120-127, fr56 - fr63 */      \
961         /* Condition Code Registers */                                  \
962         0, 0, 0, 0,                     /* 128-131, fcc0 - fcc3  */     \
963         0, 0, 0, 1,                     /* 132-135, icc0 - icc3 */      \
964         /* Conditional execution Registers (CCR) */                     \
965         0, 0, 0, 0, 0, 0, 0, 1,         /* 136-143, cr0 - cr7 */        \
966         /* Accumulators */                                              \
967         1, 1, 1, 1, 1, 1, 1, 1,         /* 144-151, acc0  - acc7 */     \
968         1, 1, 1, 1, 1, 1, 1, 1,         /* 152-159, accg0 - accg7 */    \
969         /* Other registers */                                           \
970         1,                              /* 160, AP   - fake arg ptr */  \
971         0,                              /* 161, LR   - Link register*/  \
972         0,                              /* 162, LCR  - Loop count reg*/ \
973 }
974
975 /* Like `FIXED_REGISTERS' but has 1 for each register that is clobbered (in
976    general) by function calls as well as for fixed registers.  This macro
977    therefore identifies the registers that are not available for general
978    allocation of values that must live across function calls.
979
980    If a register has 0 in `CALL_USED_REGISTERS', the compiler automatically
981    saves it on function entry and restores it on function exit, if the register
982    is used within the function.  */
983 #define CALL_USED_REGISTERS                                             \
984 {       /* Integer Registers */                                         \
985         1, 1, 1, 1, 1, 1, 1, 1,         /* 000-007, gr0  - gr7  */      \
986         1, 1, 1, 1, 1, 1, 1, 1,         /* 008-015, gr8  - gr15 */      \
987         1, 1, 0, 0, 0, 0, 0, 0,         /* 016-023, gr16 - gr23 */      \
988         0, 0, 0, 0, 1, 1, 1, 1,         /* 024-031, gr24 - gr31 */      \
989         1, 1, 1, 1, 1, 1, 1, 1,         /* 032-039, gr32 - gr39 */      \
990         1, 1, 1, 1, 1, 1, 1, 1,         /* 040-040, gr48 - gr47 */      \
991         0, 0, 0, 0, 0, 0, 0, 0,         /* 048-055, gr48 - gr55 */      \
992         0, 0, 0, 0, 0, 0, 0, 0,         /* 056-063, gr56 - gr63 */      \
993         /* Float Registers */                                           \
994         1, 1, 1, 1, 1, 1, 1, 1,         /* 064-071, fr0  - fr7  */      \
995         1, 1, 1, 1, 1, 1, 1, 1,         /* 072-079, fr8  - fr15 */      \
996         0, 0, 0, 0, 0, 0, 0, 0,         /* 080-087, fr16 - fr23 */      \
997         0, 0, 0, 0, 0, 0, 0, 0,         /* 088-095, fr24 - fr31 */      \
998         1, 1, 1, 1, 1, 1, 1, 1,         /* 096-103, fr32 - fr39 */      \
999         1, 1, 1, 1, 1, 1, 1, 1,         /* 104-111, fr48 - fr47 */      \
1000         0, 0, 0, 0, 0, 0, 0, 0,         /* 112-119, fr48 - fr55 */      \
1001         0, 0, 0, 0, 0, 0, 0, 0,         /* 120-127, fr56 - fr63 */      \
1002         /* Condition Code Registers */                                  \
1003         1, 1, 1, 1,                     /* 128-131, fcc0 - fcc3 */      \
1004         1, 1, 1, 1,                     /* 132-135, icc0 - icc3  */     \
1005         /* Conditional execution Registers (CCR) */                     \
1006         1, 1, 1, 1, 1, 1, 1, 1,         /* 136-143, cr0 - cr7 */        \
1007         /* Accumulators */                                              \
1008         1, 1, 1, 1, 1, 1, 1, 1,         /* 144-151, acc0 - acc7 */      \
1009         1, 1, 1, 1, 1, 1, 1, 1,         /* 152-159, accg0 - accg7 */    \
1010         /* Other registers */                                           \
1011         1,                              /* 160, AP  - fake arg ptr */   \
1012         1,                              /* 161, LR  - Link register*/   \
1013         1,                              /* 162, LCR - Loop count reg */ \
1014 }
1015
1016 /* Zero or more C statements that may conditionally modify two variables
1017    `fixed_regs' and `call_used_regs' (both of type `char []') after they have
1018    been initialized from the two preceding macros.
1019
1020    This is necessary in case the fixed or call-clobbered registers depend on
1021    target flags.
1022
1023    You need not define this macro if it has no work to do.
1024
1025    If the usage of an entire class of registers depends on the target flags,
1026    you may indicate this to GCC by using this macro to modify `fixed_regs' and
1027    `call_used_regs' to 1 for each of the registers in the classes which should
1028    not be used by GCC.  Also define the macro `REG_CLASS_FROM_LETTER' to return
1029    `NO_REGS' if it is called with a letter for a class that shouldn't be used.
1030
1031    (However, if this class is not included in `GENERAL_REGS' and all of the
1032    insn patterns whose constraints permit this class are controlled by target
1033    switches, then GCC will automatically avoid using these registers when the
1034    target switches are opposed to them.)  */
1035
1036 #define CONDITIONAL_REGISTER_USAGE frv_conditional_register_usage ()
1037
1038 \f
1039 /* Order of allocation of registers.  */
1040
1041 /* If defined, an initializer for a vector of integers, containing the numbers
1042    of hard registers in the order in which GNU CC should prefer to use them
1043    (from most preferred to least).
1044
1045    If this macro is not defined, registers are used lowest numbered first (all
1046    else being equal).
1047
1048    One use of this macro is on machines where the highest numbered registers
1049    must always be saved and the save-multiple-registers instruction supports
1050    only sequences of consecutive registers.  On such machines, define
1051    `REG_ALLOC_ORDER' to be an initializer that lists the highest numbered
1052    allocatable register first.  */
1053
1054 /* On the FRV, allocate GR16 and GR17 after other saved registers so that we
1055    have a better chance of allocating 2 registers at a time and can use the
1056    double word load/store instructions in the prologue.  */
1057 #define REG_ALLOC_ORDER                                                 \
1058 {                                                                       \
1059   /* volatile registers */                                              \
1060   GPR_FIRST  +  4, GPR_FIRST  +  5, GPR_FIRST  +  6, GPR_FIRST  +  7,   \
1061   GPR_FIRST  +  8, GPR_FIRST  +  9, GPR_FIRST  + 10, GPR_FIRST  + 11,   \
1062   GPR_FIRST  + 12, GPR_FIRST  + 13, GPR_FIRST  + 14, GPR_FIRST  + 15,   \
1063   GPR_FIRST  + 32, GPR_FIRST  + 33, GPR_FIRST  + 34, GPR_FIRST  + 35,   \
1064   GPR_FIRST  + 36, GPR_FIRST  + 37, GPR_FIRST  + 38, GPR_FIRST  + 39,   \
1065   GPR_FIRST  + 40, GPR_FIRST  + 41, GPR_FIRST  + 42, GPR_FIRST  + 43,   \
1066   GPR_FIRST  + 44, GPR_FIRST  + 45, GPR_FIRST  + 46, GPR_FIRST  + 47,   \
1067                                                                         \
1068   FPR_FIRST  +  0, FPR_FIRST  +  1, FPR_FIRST  +  2, FPR_FIRST  +  3,   \
1069   FPR_FIRST  +  4, FPR_FIRST  +  5, FPR_FIRST  +  6, FPR_FIRST  +  7,   \
1070   FPR_FIRST  +  8, FPR_FIRST  +  9, FPR_FIRST  + 10, FPR_FIRST  + 11,   \
1071   FPR_FIRST  + 12, FPR_FIRST  + 13, FPR_FIRST  + 14, FPR_FIRST  + 15,   \
1072   FPR_FIRST  + 32, FPR_FIRST  + 33, FPR_FIRST  + 34, FPR_FIRST  + 35,   \
1073   FPR_FIRST  + 36, FPR_FIRST  + 37, FPR_FIRST  + 38, FPR_FIRST  + 39,   \
1074   FPR_FIRST  + 40, FPR_FIRST  + 41, FPR_FIRST  + 42, FPR_FIRST  + 43,   \
1075   FPR_FIRST  + 44, FPR_FIRST  + 45, FPR_FIRST  + 46, FPR_FIRST  + 47,   \
1076                                                                         \
1077   ICC_FIRST  +  0, ICC_FIRST  +  1, ICC_FIRST  +  2, ICC_FIRST  +  3,   \
1078   FCC_FIRST  +  0, FCC_FIRST  +  1, FCC_FIRST  +  2, FCC_FIRST  +  3,   \
1079   CR_FIRST   +  0, CR_FIRST   +  1, CR_FIRST   +  2, CR_FIRST   +  3,   \
1080   CR_FIRST   +  4, CR_FIRST   +  5, CR_FIRST   +  6, CR_FIRST   +  7,   \
1081                                                                         \
1082   /* saved registers */                                                 \
1083   GPR_FIRST  + 18, GPR_FIRST  + 19,                                     \
1084   GPR_FIRST  + 20, GPR_FIRST  + 21, GPR_FIRST  + 22, GPR_FIRST  + 23,   \
1085   GPR_FIRST  + 24, GPR_FIRST  + 25, GPR_FIRST  + 26, GPR_FIRST  + 27,   \
1086   GPR_FIRST  + 48, GPR_FIRST  + 49, GPR_FIRST  + 50, GPR_FIRST  + 51,   \
1087   GPR_FIRST  + 52, GPR_FIRST  + 53, GPR_FIRST  + 54, GPR_FIRST  + 55,   \
1088   GPR_FIRST  + 56, GPR_FIRST  + 57, GPR_FIRST  + 58, GPR_FIRST  + 59,   \
1089   GPR_FIRST  + 60, GPR_FIRST  + 61, GPR_FIRST  + 62, GPR_FIRST  + 63,   \
1090   GPR_FIRST  + 16, GPR_FIRST  + 17,                                     \
1091                                                                         \
1092   FPR_FIRST  + 16, FPR_FIRST  + 17, FPR_FIRST  + 18, FPR_FIRST  + 19,   \
1093   FPR_FIRST  + 20, FPR_FIRST  + 21, FPR_FIRST  + 22, FPR_FIRST  + 23,   \
1094   FPR_FIRST  + 24, FPR_FIRST  + 25, FPR_FIRST  + 26, FPR_FIRST  + 27,   \
1095   FPR_FIRST  + 28, FPR_FIRST  + 29, FPR_FIRST  + 30, FPR_FIRST  + 31,   \
1096   FPR_FIRST  + 48, FPR_FIRST  + 49, FPR_FIRST  + 50, FPR_FIRST  + 51,   \
1097   FPR_FIRST  + 52, FPR_FIRST  + 53, FPR_FIRST  + 54, FPR_FIRST  + 55,   \
1098   FPR_FIRST  + 56, FPR_FIRST  + 57, FPR_FIRST  + 58, FPR_FIRST  + 59,   \
1099   FPR_FIRST  + 60, FPR_FIRST  + 61, FPR_FIRST  + 62, FPR_FIRST  + 63,   \
1100                                                                         \
1101   /* special or fixed registers */                                      \
1102   GPR_FIRST  +  0, GPR_FIRST  +  1, GPR_FIRST  +  2, GPR_FIRST  +  3,   \
1103   GPR_FIRST  + 28, GPR_FIRST  + 29, GPR_FIRST  + 30, GPR_FIRST  + 31,   \
1104   ACC_FIRST  +  0, ACC_FIRST  +  1, ACC_FIRST  +  2, ACC_FIRST  +  3,   \
1105   ACC_FIRST  +  4, ACC_FIRST  +  5, ACC_FIRST  +  6, ACC_FIRST  +  7,   \
1106   ACCG_FIRST +  0, ACCG_FIRST +  1, ACCG_FIRST +  2, ACCG_FIRST +  3,   \
1107   ACCG_FIRST +  4, ACCG_FIRST +  5, ACCG_FIRST +  6, ACCG_FIRST +  7,   \
1108   AP_FIRST,        LR_REGNO,       LCR_REGNO                            \
1109 }
1110
1111 \f
1112 /* How Values Fit in Registers.  */
1113
1114 /* A C expression for the number of consecutive hard registers, starting at
1115    register number REGNO, required to hold a value of mode MODE.
1116
1117    On a machine where all registers are exactly one word, a suitable definition
1118    of this macro is
1119
1120         #define HARD_REGNO_NREGS(REGNO, MODE)            \
1121            ((GET_MODE_SIZE (MODE) + UNITS_PER_WORD - 1)  \
1122             / UNITS_PER_WORD))  */
1123
1124 /* On the FRV, make the CC modes take 3 words in the integer registers, so that
1125    we can build the appropriate instructions to properly reload the values.  */
1126 #define HARD_REGNO_NREGS(REGNO, MODE) frv_hard_regno_nregs (REGNO, MODE)
1127
1128 /* A C expression that is nonzero if it is permissible to store a value of mode
1129    MODE in hard register number REGNO (or in several registers starting with
1130    that one).  For a machine where all registers are equivalent, a suitable
1131    definition is
1132
1133         #define HARD_REGNO_MODE_OK(REGNO, MODE) 1
1134
1135    It is not necessary for this macro to check for the numbers of fixed
1136    registers, because the allocation mechanism considers them to be always
1137    occupied.
1138
1139    On some machines, double-precision values must be kept in even/odd register
1140    pairs.  The way to implement that is to define this macro to reject odd
1141    register numbers for such modes.
1142
1143    The minimum requirement for a mode to be OK in a register is that the
1144    `movMODE' instruction pattern support moves between the register and any
1145    other hard register for which the mode is OK; and that moving a value into
1146    the register and back out not alter it.
1147
1148    Since the same instruction used to move `SImode' will work for all narrower
1149    integer modes, it is not necessary on any machine for `HARD_REGNO_MODE_OK'
1150    to distinguish between these modes, provided you define patterns `movhi',
1151    etc., to take advantage of this.  This is useful because of the interaction
1152    between `HARD_REGNO_MODE_OK' and `MODES_TIEABLE_P'; it is very desirable for
1153    all integer modes to be tieable.
1154
1155    Many machines have special registers for floating point arithmetic.  Often
1156    people assume that floating point machine modes are allowed only in floating
1157    point registers.  This is not true.  Any registers that can hold integers
1158    can safely *hold* a floating point machine mode, whether or not floating
1159    arithmetic can be done on it in those registers.  Integer move instructions
1160    can be used to move the values.
1161
1162    On some machines, though, the converse is true: fixed-point machine modes
1163    may not go in floating registers.  This is true if the floating registers
1164    normalize any value stored in them, because storing a non-floating value
1165    there would garble it.  In this case, `HARD_REGNO_MODE_OK' should reject
1166    fixed-point machine modes in floating registers.  But if the floating
1167    registers do not automatically normalize, if you can store any bit pattern
1168    in one and retrieve it unchanged without a trap, then any machine mode may
1169    go in a floating register, so you can define this macro to say so.
1170
1171    The primary significance of special floating registers is rather that they
1172    are the registers acceptable in floating point arithmetic instructions.
1173    However, this is of no concern to `HARD_REGNO_MODE_OK'.  You handle it by
1174    writing the proper constraints for those instructions.
1175
1176    On some machines, the floating registers are especially slow to access, so
1177    that it is better to store a value in a stack frame than in such a register
1178    if floating point arithmetic is not being done.  As long as the floating
1179    registers are not in class `GENERAL_REGS', they will not be used unless some
1180    pattern's constraint asks for one.  */
1181 #define HARD_REGNO_MODE_OK(REGNO, MODE) frv_hard_regno_mode_ok (REGNO, MODE)
1182
1183 /* A C expression that is nonzero if it is desirable to choose register
1184    allocation so as to avoid move instructions between a value of mode MODE1
1185    and a value of mode MODE2.
1186
1187    If `HARD_REGNO_MODE_OK (R, MODE1)' and `HARD_REGNO_MODE_OK (R, MODE2)' are
1188    ever different for any R, then `MODES_TIEABLE_P (MODE1, MODE2)' must be
1189    zero.  */
1190 #define MODES_TIEABLE_P(MODE1, MODE2) (MODE1 == MODE2)
1191
1192 /* Define this macro if the compiler should avoid copies to/from CCmode
1193    registers.  You should only define this macro if support fo copying to/from
1194    CCmode is incomplete.  */
1195 #define AVOID_CCMODE_COPIES
1196
1197 \f
1198 /* Register Classes.  */
1199
1200 /* An enumeral type that must be defined with all the register class names as
1201    enumeral values.  `NO_REGS' must be first.  `ALL_REGS' must be the last
1202    register class, followed by one more enumeral value, `LIM_REG_CLASSES',
1203    which is not a register class but rather tells how many classes there are.
1204
1205    Each register class has a number, which is the value of casting the class
1206    name to type `int'.  The number serves as an index in many of the tables
1207    described below.  */
1208 enum reg_class
1209 {
1210   NO_REGS,
1211   ICC_REGS,
1212   FCC_REGS,
1213   CC_REGS,
1214   ICR_REGS,
1215   FCR_REGS,
1216   CR_REGS,
1217   LCR_REG,
1218   LR_REG,
1219   SPR_REGS,
1220   QUAD_ACC_REGS,
1221   EVEN_ACC_REGS,
1222   ACC_REGS,
1223   ACCG_REGS,
1224   QUAD_FPR_REGS,
1225   FEVEN_REGS,
1226   FPR_REGS,
1227   QUAD_REGS,
1228   EVEN_REGS,
1229   GPR_REGS,
1230   ALL_REGS,
1231   LIM_REG_CLASSES
1232 };
1233
1234 #define GENERAL_REGS GPR_REGS
1235
1236 /* The number of distinct register classes, defined as follows:
1237
1238         #define N_REG_CLASSES (int) LIM_REG_CLASSES  */
1239 #define N_REG_CLASSES ((int) LIM_REG_CLASSES)
1240
1241 /* An initializer containing the names of the register classes as C string
1242    constants.  These names are used in writing some of the debugging dumps.  */
1243 #define REG_CLASS_NAMES {                                               \
1244    "NO_REGS",                                                           \
1245    "ICC_REGS",                                                          \
1246    "FCC_REGS",                                                          \
1247    "CC_REGS",                                                           \
1248    "ICR_REGS",                                                          \
1249    "FCR_REGS",                                                          \
1250    "CR_REGS",                                                           \
1251    "LCR_REG",                                                           \
1252    "LR_REG",                                                            \
1253    "SPR_REGS",                                                          \
1254    "QUAD_ACC_REGS",                                                     \
1255    "EVEN_ACC_REGS",                                                     \
1256    "ACC_REGS",                                                          \
1257    "ACCG_REGS",                                                         \
1258    "QUAD_FPR_REGS",                                                     \
1259    "FEVEN_REGS",                                                        \
1260    "FPR_REGS",                                                          \
1261    "QUAD_REGS",                                                         \
1262    "EVEN_REGS",                                                         \
1263    "GPR_REGS",                                                          \
1264    "ALL_REGS"                                                           \
1265 }
1266
1267 /* An initializer containing the contents of the register classes, as integers
1268    which are bit masks.  The Nth integer specifies the contents of class N.
1269    The way the integer MASK is interpreted is that register R is in the class
1270    if `MASK & (1 << R)' is 1.
1271
1272    When the machine has more than 32 registers, an integer does not suffice.
1273    Then the integers are replaced by sub-initializers, braced groupings
1274    containing several integers.  Each sub-initializer must be suitable as an
1275    initializer for the type `HARD_REG_SET' which is defined in
1276    `hard-reg-set.h'.  */
1277 #define REG_CLASS_CONTENTS                                                     \
1278 {  /* gr0-gr31 gr32-gr63  fr0-fr31   fr32-fr-63 cc/ccr/acc ap/spr */           \
1279   { 0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x0}, /* NO_REGS  */\
1280   { 0x00000000,0x00000000,0x00000000,0x00000000,0x000000f0,0x0}, /* ICC_REGS */\
1281   { 0x00000000,0x00000000,0x00000000,0x00000000,0x0000000f,0x0}, /* FCC_REGS */\
1282   { 0x00000000,0x00000000,0x00000000,0x00000000,0x000000ff,0x0}, /* CC_REGS  */\
1283   { 0x00000000,0x00000000,0x00000000,0x00000000,0x0000f000,0x0}, /* ICR_REGS */\
1284   { 0x00000000,0x00000000,0x00000000,0x00000000,0x00000f00,0x0}, /* FCR_REGS */\
1285   { 0x00000000,0x00000000,0x00000000,0x00000000,0x0000ff00,0x0}, /* CR_REGS  */\
1286   { 0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x4}, /* LCR_REGS */\
1287   { 0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x2}, /* LR_REGS  */\
1288   { 0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x6}, /* SPR_REGS */\
1289   { 0x00000000,0x00000000,0x00000000,0x00000000,0x00ff0000,0x0}, /* QUAD_ACC */\
1290   { 0x00000000,0x00000000,0x00000000,0x00000000,0x00ff0000,0x0}, /* EVEN_ACC */\
1291   { 0x00000000,0x00000000,0x00000000,0x00000000,0x00ff0000,0x0}, /* ACC_REGS */\
1292   { 0x00000000,0x00000000,0x00000000,0x00000000,0xff000000,0x0}, /* ACCG_REGS*/\
1293   { 0x00000000,0x00000000,0xffffffff,0xffffffff,0x00000000,0x0}, /* QUAD_FPR */\
1294   { 0x00000000,0x00000000,0xffffffff,0xffffffff,0x00000000,0x0}, /* FEVEN_REG*/\
1295   { 0x00000000,0x00000000,0xffffffff,0xffffffff,0x00000000,0x0}, /* FPR_REGS */\
1296   { 0x0ffffffc,0xffffffff,0x00000000,0x00000000,0x00000000,0x0}, /* QUAD_REGS*/\
1297   { 0xfffffffc,0xffffffff,0x00000000,0x00000000,0x00000000,0x0}, /* EVEN_REGS*/\
1298   { 0xffffffff,0xffffffff,0x00000000,0x00000000,0x00000000,0x1}, /* GPR_REGS */\
1299   { 0xffffffff,0xffffffff,0xffffffff,0xffffffff,0xffffffff,0x7}, /* ALL_REGS */\
1300 }
1301
1302 /* A C expression whose value is a register class containing hard register
1303    REGNO.  In general there is more than one such class; choose a class which
1304    is "minimal", meaning that no smaller class also contains the register.  */
1305
1306 extern enum reg_class regno_reg_class[];
1307 #define REGNO_REG_CLASS(REGNO) regno_reg_class [REGNO]
1308
1309 /* A macro whose definition is the name of the class to which a valid base
1310    register must belong.  A base register is one used in an address which is
1311    the register value plus a displacement.  */
1312 #define BASE_REG_CLASS GPR_REGS
1313
1314 /* A macro whose definition is the name of the class to which a valid index
1315    register must belong.  An index register is one used in an address where its
1316    value is either multiplied by a scale factor or added to another register
1317    (as well as added to a displacement).  */
1318 #define INDEX_REG_CLASS GPR_REGS
1319
1320 /* A C expression which defines the machine-dependent operand constraint
1321    letters for register classes.  If CHAR is such a letter, the value should be
1322    the register class corresponding to it.  Otherwise, the value should be
1323    `NO_REGS'.  The register letter `r', corresponding to class `GENERAL_REGS',
1324    will not be passed to this macro; you do not need to handle it.
1325
1326    The following letters are unavailable, due to being used as
1327    constraints:
1328         '0'..'9'
1329         '<', '>'
1330         'E', 'F', 'G', 'H'
1331         'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P'
1332         'Q', 'R', 'S', 'T', 'U'
1333         'V', 'X'
1334         'g', 'i', 'm', 'n', 'o', 'p', 'r', 's' */
1335
1336 extern enum reg_class reg_class_from_letter[];
1337 #define REG_CLASS_FROM_LETTER(CHAR) reg_class_from_letter [(unsigned char)(CHAR)]
1338
1339 /* A C expression which is nonzero if register number NUM is suitable for use
1340    as a base register in operand addresses.  It may be either a suitable hard
1341    register or a pseudo register that has been allocated such a hard register.  */
1342 #define REGNO_OK_FOR_BASE_P(NUM)           \
1343   ((NUM) < FIRST_PSEUDO_REGISTER           \
1344    ? GPR_P (NUM)                           \
1345    : (reg_renumber [NUM] >= 0 && GPR_P (reg_renumber [NUM])))
1346
1347 /* A C expression which is nonzero if register number NUM is suitable for use
1348    as an index register in operand addresses.  It may be either a suitable hard
1349    register or a pseudo register that has been allocated such a hard register.
1350
1351    The difference between an index register and a base register is that the
1352    index register may be scaled.  If an address involves the sum of two
1353    registers, neither one of them scaled, then either one may be labeled the
1354    "base" and the other the "index"; but whichever labeling is used must fit
1355    the machine's constraints of which registers may serve in each capacity.
1356    The compiler will try both labelings, looking for one that is valid, and
1357    will reload one or both registers only if neither labeling works.  */
1358 #define REGNO_OK_FOR_INDEX_P(NUM)                                       \
1359   ((NUM) < FIRST_PSEUDO_REGISTER                                        \
1360    ? GPR_P (NUM)                                                        \
1361    : (reg_renumber [NUM] >= 0 && GPR_P (reg_renumber [NUM])))
1362
1363 /* A C expression that places additional restrictions on the register class to
1364    use when it is necessary to copy value X into a register in class CLASS.
1365    The value is a register class; perhaps CLASS, or perhaps another, smaller
1366    class.  On many machines, the following definition is safe:
1367
1368         #define PREFERRED_RELOAD_CLASS(X,CLASS) CLASS
1369
1370    Sometimes returning a more restrictive class makes better code.  For
1371    example, on the 68000, when X is an integer constant that is in range for a
1372    `moveq' instruction, the value of this macro is always `DATA_REGS' as long
1373    as CLASS includes the data registers.  Requiring a data register guarantees
1374    that a `moveq' will be used.
1375
1376    If X is a `const_double', by returning `NO_REGS' you can force X into a
1377    memory constant.  This is useful on certain machines where immediate
1378    floating values cannot be loaded into certain kinds of registers.
1379
1380    This declaration must be present.  */
1381 #define PREFERRED_RELOAD_CLASS(X, CLASS) CLASS
1382
1383 #define SECONDARY_INPUT_RELOAD_CLASS(CLASS, MODE, X) \
1384   frv_secondary_reload_class (CLASS, MODE, X, TRUE)
1385
1386 #define SECONDARY_OUTPUT_RELOAD_CLASS(CLASS, MODE, X) \
1387   frv_secondary_reload_class (CLASS, MODE, X, FALSE)
1388
1389 /* A C expression whose value is nonzero if pseudos that have been assigned to
1390    registers of class CLASS would likely be spilled because registers of CLASS
1391    are needed for spill registers.
1392
1393    The default value of this macro returns 1 if CLASS has exactly one register
1394    and zero otherwise.  On most machines, this default should be used.  Only
1395    define this macro to some other expression if pseudo allocated by
1396    `local-alloc.c' end up in memory because their hard registers were needed
1397    for spill registers.  If this macro returns nonzero for those classes, those
1398    pseudos will only be allocated by `global.c', which knows how to reallocate
1399    the pseudo to another register.  If there would not be another register
1400    available for reallocation, you should not change the definition of this
1401    macro since the only effect of such a definition would be to slow down
1402    register allocation.  */
1403 #define CLASS_LIKELY_SPILLED_P(CLASS) frv_class_likely_spilled_p (CLASS)
1404
1405 /* A C expression for the maximum number of consecutive registers of
1406    class CLASS needed to hold a value of mode MODE.
1407
1408    This is closely related to the macro `HARD_REGNO_NREGS'.  In fact, the value
1409    of the macro `CLASS_MAX_NREGS (CLASS, MODE)' should be the maximum value of
1410    `HARD_REGNO_NREGS (REGNO, MODE)' for all REGNO values in the class CLASS.
1411
1412    This macro helps control the handling of multiple-word values in
1413    the reload pass.
1414
1415    This declaration is required.  */
1416 #define CLASS_MAX_NREGS(CLASS, MODE) frv_class_max_nregs (CLASS, MODE)
1417
1418 #define ZERO_P(x) (x == CONST0_RTX (GET_MODE (x)))
1419
1420 /* 6 bit signed immediate.  */
1421 #define CONST_OK_FOR_I(VALUE) IN_RANGE_P(VALUE, -32, 31)
1422 /* 10 bit signed immediate.  */
1423 #define CONST_OK_FOR_J(VALUE) IN_RANGE_P(VALUE, -512, 511)
1424 /* Unused */
1425 #define CONST_OK_FOR_K(VALUE)  0
1426 /* 16 bit signed immediate.  */
1427 #define CONST_OK_FOR_L(VALUE) IN_RANGE_P(VALUE, -32768, 32767)
1428 /* 16 bit unsigned immediate.  */
1429 #define CONST_OK_FOR_M(VALUE)  IN_RANGE_P (VALUE, 0, 65535)
1430 /* 12 bit signed immediate that is negative.  */
1431 #define CONST_OK_FOR_N(VALUE) IN_RANGE_P(VALUE, -2048, -1)
1432 /* Zero */
1433 #define CONST_OK_FOR_O(VALUE) ((VALUE) == 0)
1434 /* 12 bit signed immediate that is negative.  */
1435 #define CONST_OK_FOR_P(VALUE) IN_RANGE_P(VALUE, 1, 2047)
1436
1437 /* A C expression that defines the machine-dependent operand constraint letters
1438    (`I', `J', `K', .. 'P') that specify particular ranges of integer values.
1439    If C is one of those letters, the expression should check that VALUE, an
1440    integer, is in the appropriate range and return 1 if so, 0 otherwise.  If C
1441    is not one of those letters, the value should be 0 regardless of VALUE.  */
1442 #define CONST_OK_FOR_LETTER_P(VALUE, C)         \
1443   (  (C) == 'I' ? CONST_OK_FOR_I (VALUE)        \
1444    : (C) == 'J' ? CONST_OK_FOR_J (VALUE)        \
1445    : (C) == 'K' ? CONST_OK_FOR_K (VALUE)        \
1446    : (C) == 'L' ? CONST_OK_FOR_L (VALUE)        \
1447    : (C) == 'M' ? CONST_OK_FOR_M (VALUE)        \
1448    : (C) == 'N' ? CONST_OK_FOR_N (VALUE)        \
1449    : (C) == 'O' ? CONST_OK_FOR_O (VALUE)        \
1450    : (C) == 'P' ? CONST_OK_FOR_P (VALUE)        \
1451    : 0)
1452
1453
1454 /* A C expression that defines the machine-dependent operand constraint letters
1455    (`G', `H') that specify particular ranges of `const_double' values.
1456
1457    If C is one of those letters, the expression should check that VALUE, an RTX
1458    of code `const_double', is in the appropriate range and return 1 if so, 0
1459    otherwise.  If C is not one of those letters, the value should be 0
1460    regardless of VALUE.
1461
1462    `const_double' is used for all floating-point constants and for `DImode'
1463    fixed-point constants.  A given letter can accept either or both kinds of
1464    values.  It can use `GET_MODE' to distinguish between these kinds.  */
1465
1466 #define CONST_DOUBLE_OK_FOR_G(VALUE)                                    \
1467   ((GET_MODE (VALUE) == VOIDmode                                        \
1468     && CONST_DOUBLE_LOW (VALUE) == 0                                    \
1469     && CONST_DOUBLE_HIGH (VALUE) == 0)                                  \
1470    || ((GET_MODE (VALUE) == SFmode                                      \
1471         || GET_MODE (VALUE) == DFmode)                                  \
1472        && (VALUE) == CONST0_RTX (GET_MODE (VALUE))))
1473
1474 #define CONST_DOUBLE_OK_FOR_H(VALUE) 0
1475
1476 #define CONST_DOUBLE_OK_FOR_LETTER_P(VALUE, C)                          \
1477   (  (C) == 'G' ? CONST_DOUBLE_OK_FOR_G (VALUE)                         \
1478    : (C) == 'H' ? CONST_DOUBLE_OK_FOR_H (VALUE)                         \
1479    : 0)
1480
1481 /* A C expression that defines the optional machine-dependent constraint
1482    letters (`Q', `R', `S', `T', `U') that can be used to segregate specific
1483    types of operands, usually memory references, for the target machine.
1484    Normally this macro will not be defined.  If it is required for a particular
1485    target machine, it should return 1 if VALUE corresponds to the operand type
1486    represented by the constraint letter C.  If C is not defined as an extra
1487    constraint, the value returned should be 0 regardless of VALUE.
1488
1489    For example, on the ROMP, load instructions cannot have their output in r0
1490    if the memory reference contains a symbolic address.  Constraint letter `Q'
1491    is defined as representing a memory address that does *not* contain a
1492    symbolic address.  An alternative is specified with a `Q' constraint on the
1493    input and `r' on the output.  The next alternative specifies `m' on the
1494    input and a register class that does not include r0 on the output.  */
1495
1496 /* Small data references */
1497 #define EXTRA_CONSTRAINT_FOR_Q(VALUE)                                   \
1498   (small_data_symbolic_operand (VALUE, GET_MODE (VALUE)))
1499
1500 /* Double word memory ops that take one instruction.  */
1501 #define EXTRA_CONSTRAINT_FOR_R(VALUE)                                   \
1502   (dbl_memory_one_insn_operand (VALUE, GET_MODE (VALUE)))
1503
1504 /* SYMBOL_REF */
1505 #define EXTRA_CONSTRAINT_FOR_S(VALUE) (GET_CODE (VALUE) == SYMBOL_REF)
1506
1507 /* Double word memory ops that take two instructions.  */
1508 #define EXTRA_CONSTRAINT_FOR_T(VALUE)                                   \
1509   (dbl_memory_two_insn_operand (VALUE, GET_MODE (VALUE)))
1510
1511 /* Memory operand for conditional execution.  */
1512 #define EXTRA_CONSTRAINT_FOR_U(VALUE)                                   \
1513   (condexec_memory_operand (VALUE, GET_MODE (VALUE)))
1514
1515 #define EXTRA_CONSTRAINT(VALUE, C)                                      \
1516   (  (C) == 'Q'   ? EXTRA_CONSTRAINT_FOR_Q (VALUE)                      \
1517    : (C) == 'R' ? EXTRA_CONSTRAINT_FOR_R (VALUE)                        \
1518    : (C) == 'S' ? EXTRA_CONSTRAINT_FOR_S (VALUE)                        \
1519    : (C) == 'T' ? EXTRA_CONSTRAINT_FOR_T (VALUE)                        \
1520    : (C) == 'U' ? EXTRA_CONSTRAINT_FOR_U (VALUE)                        \
1521    : 0)
1522
1523 \f
1524 /* Basic Stack Layout.  */
1525
1526 /* Structure to describe information about a saved range of registers */
1527
1528 typedef struct frv_stack_regs {
1529   const char * name;            /* name of the register ranges */
1530   int first;                    /* first register in the range */
1531   int last;                     /* last register in the range */
1532   int size_1word;               /* # of bytes to be stored via 1 word stores */
1533   int size_2words;              /* # of bytes to be stored via 2 word stores */
1534   unsigned char field_p;        /* true if the registers are a single SPR */
1535   unsigned char dword_p;        /* true if we can do dword stores */
1536   unsigned char special_p;      /* true if the regs have a fixed save loc.  */
1537 } frv_stack_regs_t;
1538
1539 /* Register ranges to look into saving.  */
1540 #define STACK_REGS_GPR          0       /* Gprs (normally gr16..gr31, gr48..gr63) */
1541 #define STACK_REGS_FPR          1       /* Fprs (normally fr16..fr31, fr48..fr63) */
1542 #define STACK_REGS_LR           2       /* LR register */
1543 #define STACK_REGS_CC           3       /* CCrs (normally not saved) */
1544 #define STACK_REGS_LCR          5       /* lcr register */
1545 #define STACK_REGS_STDARG       6       /* stdarg registers */
1546 #define STACK_REGS_STRUCT       7       /* structure return (gr3) */
1547 #define STACK_REGS_FP           8       /* FP register */
1548 #define STACK_REGS_MAX          9       /* # of register ranges */
1549
1550 /* Values for save_p field.  */
1551 #define REG_SAVE_NO_SAVE        0       /* register not saved */
1552 #define REG_SAVE_1WORD          1       /* save the register */
1553 #define REG_SAVE_2WORDS         2       /* save register and register+1 */
1554
1555 /* Structure used to define the frv stack.  */
1556
1557 typedef struct frv_stack {
1558   int total_size;               /* total bytes allocated for stack */
1559   int vars_size;                /* variable save area size */
1560   int parameter_size;           /* outgoing parameter size */
1561   int stdarg_size;              /* size of regs needed to be saved for stdarg */
1562   int regs_size;                /* size of the saved registers */
1563   int regs_size_1word;          /* # of bytes to be stored via 1 word stores */
1564   int regs_size_2words;         /* # of bytes to be stored via 2 word stores */
1565   int header_size;              /* size of the old FP, struct ret., LR save */
1566   int pretend_size;             /* size of pretend args */
1567   int vars_offset;              /* offset to save local variables from new SP*/
1568   int regs_offset;              /* offset to save registers from new SP */
1569                                 /* register range information */
1570   frv_stack_regs_t regs[STACK_REGS_MAX];
1571                                 /* offset to store each register */
1572   int reg_offset[FIRST_PSEUDO_REGISTER];
1573                                 /* whether to save register (& reg+1) */
1574   unsigned char save_p[FIRST_PSEUDO_REGISTER];
1575 } frv_stack_t;
1576
1577 /* Define this macro if pushing a word onto the stack moves the stack pointer
1578    to a smaller address.  */
1579 #define STACK_GROWS_DOWNWARD 1
1580
1581 /* Define this macro if the addresses of local variable slots are at negative
1582    offsets from the frame pointer.  */
1583 #define FRAME_GROWS_DOWNWARD
1584
1585 /* Offset from the frame pointer to the first local variable slot to be
1586    allocated.
1587
1588    If `FRAME_GROWS_DOWNWARD', find the next slot's offset by subtracting the
1589    first slot's length from `STARTING_FRAME_OFFSET'.  Otherwise, it is found by
1590    adding the length of the first slot to the value `STARTING_FRAME_OFFSET'.  */
1591 #define STARTING_FRAME_OFFSET 0
1592
1593 /* Offset from the stack pointer register to the first location at which
1594    outgoing arguments are placed.  If not specified, the default value of zero
1595    is used.  This is the proper value for most machines.
1596
1597    If `ARGS_GROW_DOWNWARD', this is the offset to the location above the first
1598    location at which outgoing arguments are placed.  */
1599 #define STACK_POINTER_OFFSET 0
1600
1601 /* Offset from the argument pointer register to the first argument's address.
1602    On some machines it may depend on the data type of the function.
1603
1604    If `ARGS_GROW_DOWNWARD', this is the offset to the location above the first
1605    argument's address.  */
1606 #define FIRST_PARM_OFFSET(FUNDECL) 0
1607
1608 /* A C expression whose value is RTL representing the address in a stack frame
1609    where the pointer to the caller's frame is stored.  Assume that FRAMEADDR is
1610    an RTL expression for the address of the stack frame itself.
1611
1612    If you don't define this macro, the default is to return the value of
1613    FRAMEADDR--that is, the stack frame address is also the address of the stack
1614    word that points to the previous frame.  */
1615 #define DYNAMIC_CHAIN_ADDRESS(FRAMEADDR) frv_dynamic_chain_address (FRAMEADDR)
1616
1617 /* A C expression whose value is RTL representing the value of the return
1618    address for the frame COUNT steps up from the current frame, after the
1619    prologue.  FRAMEADDR is the frame pointer of the COUNT frame, or the frame
1620    pointer of the COUNT - 1 frame if `RETURN_ADDR_IN_PREVIOUS_FRAME' is
1621    defined.
1622
1623    The value of the expression must always be the correct address when COUNT is
1624    zero, but may be `NULL_RTX' if there is not way to determine the return
1625    address of other frames.  */
1626 #define RETURN_ADDR_RTX(COUNT, FRAMEADDR) frv_return_addr_rtx (COUNT, FRAMEADDR)
1627
1628 /* This function contains machine specific function data.  */
1629 struct machine_function GTY(())
1630 {
1631   /* True if we have created an rtx that relies on the stack frame.  */
1632   int frame_needed;
1633 };
1634
1635 #define RETURN_POINTER_REGNUM LR_REGNO
1636
1637 /* A C expression whose value is RTL representing the location of the incoming
1638    return address at the beginning of any function, before the prologue.  This
1639    RTL is either a `REG', indicating that the return value is saved in `REG',
1640    or a `MEM' representing a location in the stack.
1641
1642    You only need to define this macro if you want to support call frame
1643    debugging information like that provided by DWARF 2.  */
1644 #define INCOMING_RETURN_ADDR_RTX gen_rtx_REG (SImode, RETURN_POINTER_REGNUM)
1645
1646 \f
1647 /* Register That Address the Stack Frame.  */
1648
1649 /* The register number of the stack pointer register, which must also be a
1650    fixed register according to `FIXED_REGISTERS'.  On most machines, the
1651    hardware determines which register this is.  */
1652 #define STACK_POINTER_REGNUM (GPR_FIRST + 1)
1653
1654 /* The register number of the frame pointer register, which is used to access
1655    automatic variables in the stack frame.  On some machines, the hardware
1656    determines which register this is.  On other machines, you can choose any
1657    register you wish for this purpose.  */
1658 #define FRAME_POINTER_REGNUM (GPR_FIRST + 2)
1659
1660 /* The register number of the arg pointer register, which is used to access the
1661    function's argument list.  On some machines, this is the same as the frame
1662    pointer register.  On some machines, the hardware determines which register
1663    this is.  On other machines, you can choose any register you wish for this
1664    purpose.  If this is not the same register as the frame pointer register,
1665    then you must mark it as a fixed register according to `FIXED_REGISTERS', or
1666    arrange to be able to eliminate it.  */
1667
1668 /* On frv this is a fake register that is eliminated in
1669    terms of either the frame pointer or stack pointer.  */
1670 #define ARG_POINTER_REGNUM AP_FIRST
1671
1672 /* Register numbers used for passing a function's static chain pointer.  If
1673    register windows are used, the register number as seen by the called
1674    function is `STATIC_CHAIN_INCOMING_REGNUM', while the register number as
1675    seen by the calling function is `STATIC_CHAIN_REGNUM'.  If these registers
1676    are the same, `STATIC_CHAIN_INCOMING_REGNUM' need not be defined.
1677
1678    The static chain register need not be a fixed register.
1679
1680    If the static chain is passed in memory, these macros should not be defined;
1681    instead, the next two macros should be defined.  */
1682 #define STATIC_CHAIN_REGNUM (GPR_FIRST + 7)
1683 #define STATIC_CHAIN_INCOMING_REGNUM (GPR_FIRST + 7)
1684
1685 \f
1686 /* Eliminating the Frame Pointer and the Arg Pointer.  */
1687
1688 /* A C expression which is nonzero if a function must have and use a frame
1689    pointer.  This expression is evaluated in the reload pass.  If its value is
1690    nonzero the function will have a frame pointer.
1691
1692    The expression can in principle examine the current function and decide
1693    according to the facts, but on most machines the constant 0 or the constant
1694    1 suffices.  Use 0 when the machine allows code to be generated with no
1695    frame pointer, and doing so saves some time or space.  Use 1 when there is
1696    no possible advantage to avoiding a frame pointer.
1697
1698    In certain cases, the compiler does not know how to produce valid code
1699    without a frame pointer.  The compiler recognizes those cases and
1700    automatically gives the function a frame pointer regardless of what
1701    `FRAME_POINTER_REQUIRED' says.  You don't need to worry about them.
1702
1703    In a function that does not require a frame pointer, the frame pointer
1704    register can be allocated for ordinary usage, unless you mark it as a fixed
1705    register.  See `FIXED_REGISTERS' for more information.  */
1706 #define FRAME_POINTER_REQUIRED frv_frame_pointer_required ()
1707
1708 /* If defined, this macro specifies a table of register pairs used to eliminate
1709    unneeded registers that point into the stack frame.  If it is not defined,
1710    the only elimination attempted by the compiler is to replace references to
1711    the frame pointer with references to the stack pointer.
1712
1713    The definition of this macro is a list of structure initializations, each of
1714    which specifies an original and replacement register.
1715
1716    On some machines, the position of the argument pointer is not known until
1717    the compilation is completed.  In such a case, a separate hard register must
1718    be used for the argument pointer.  This register can be eliminated by
1719    replacing it with either the frame pointer or the argument pointer,
1720    depending on whether or not the frame pointer has been eliminated.
1721
1722    In this case, you might specify:
1723         #define ELIMINABLE_REGS  \
1724         {{ARG_POINTER_REGNUM, STACK_POINTER_REGNUM}, \
1725          {ARG_POINTER_REGNUM, FRAME_POINTER_REGNUM}, \
1726          {FRAME_POINTER_REGNUM, STACK_POINTER_REGNUM}}
1727
1728    Note that the elimination of the argument pointer with the stack pointer is
1729    specified first since that is the preferred elimination.  */
1730
1731 #define ELIMINABLE_REGS                                                 \
1732 {                                                                       \
1733   {ARG_POINTER_REGNUM,   STACK_POINTER_REGNUM},                         \
1734   {ARG_POINTER_REGNUM,   FRAME_POINTER_REGNUM},                         \
1735   {FRAME_POINTER_REGNUM, STACK_POINTER_REGNUM}                          \
1736 }
1737
1738 /* A C expression that returns nonzero if the compiler is allowed to try to
1739    replace register number FROM with register number TO.  This macro need only
1740    be defined if `ELIMINABLE_REGS' is defined, and will usually be the constant
1741    1, since most of the cases preventing register elimination are things that
1742    the compiler already knows about.  */
1743
1744 #define CAN_ELIMINATE(FROM, TO)                                         \
1745   ((FROM) == ARG_POINTER_REGNUM && (TO) == STACK_POINTER_REGNUM         \
1746    ? ! frame_pointer_needed                                             \
1747    : 1)
1748
1749 /* This macro is similar to `INITIAL_FRAME_POINTER_OFFSET'.  It specifies the
1750    initial difference between the specified pair of registers.  This macro must
1751    be defined if `ELIMINABLE_REGS' is defined.  */
1752
1753 #define INITIAL_ELIMINATION_OFFSET(FROM, TO, OFFSET)                    \
1754   (OFFSET) = frv_initial_elimination_offset (FROM, TO)
1755
1756 \f
1757 /* Passing Function Arguments on the Stack.  */
1758
1759 /* If defined, the maximum amount of space required for outgoing arguments will
1760    be computed and placed into the variable
1761    `current_function_outgoing_args_size'.  No space will be pushed onto the
1762    stack for each call; instead, the function prologue should increase the
1763    stack frame size by this amount.
1764
1765    Defining both `PUSH_ROUNDING' and `ACCUMULATE_OUTGOING_ARGS' is not
1766    proper.  */
1767 #define ACCUMULATE_OUTGOING_ARGS 1
1768
1769 /* A C expression that should indicate the number of bytes of its own arguments
1770    that a function pops on returning, or 0 if the function pops no arguments
1771    and the caller must therefore pop them all after the function returns.
1772
1773    FUNDECL is a C variable whose value is a tree node that describes the
1774    function in question.  Normally it is a node of type `FUNCTION_DECL' that
1775    describes the declaration of the function.  From this it is possible to
1776    obtain the DECL_ATTRIBUTES of the function.
1777
1778    FUNTYPE is a C variable whose value is a tree node that describes the
1779    function in question.  Normally it is a node of type `FUNCTION_TYPE' that
1780    describes the data type of the function.  From this it is possible to obtain
1781    the data types of the value and arguments (if known).
1782
1783    When a call to a library function is being considered, FUNTYPE will contain
1784    an identifier node for the library function.  Thus, if you need to
1785    distinguish among various library functions, you can do so by their names.
1786    Note that "library function" in this context means a function used to
1787    perform arithmetic, whose name is known specially in the compiler and was
1788    not mentioned in the C code being compiled.
1789
1790    STACK-SIZE is the number of bytes of arguments passed on the stack.  If a
1791    variable number of bytes is passed, it is zero, and argument popping will
1792    always be the responsibility of the calling function.
1793
1794    On the VAX, all functions always pop their arguments, so the definition of
1795    this macro is STACK-SIZE.  On the 68000, using the standard calling
1796    convention, no functions pop their arguments, so the value of the macro is
1797    always 0 in this case.  But an alternative calling convention is available
1798    in which functions that take a fixed number of arguments pop them but other
1799    functions (such as `printf') pop nothing (the caller pops all).  When this
1800    convention is in use, FUNTYPE is examined to determine whether a function
1801    takes a fixed number of arguments.  */
1802 #define RETURN_POPS_ARGS(FUNDECL, FUNTYPE, STACK_SIZE) 0
1803
1804 \f
1805 /* Function Arguments in Registers.  */
1806
1807 /* Nonzero if we do not know how to pass TYPE solely in registers.
1808    We cannot do so in the following cases:
1809
1810    - if the type has variable size
1811    - if the type is marked as addressable (it is required to be constructed
1812      into the stack)
1813    - if the type is a structure or union.  */
1814
1815 #define MUST_PASS_IN_STACK(MODE,TYPE)                           \
1816    (((MODE) == BLKmode)                                         \
1817     || ((TYPE) != 0                                             \
1818          && (TREE_CODE (TYPE_SIZE (TYPE)) != INTEGER_CST        \
1819              || TREE_CODE (TYPE) == RECORD_TYPE                 \
1820              || TREE_CODE (TYPE) == UNION_TYPE                  \
1821              || TREE_CODE (TYPE) == QUAL_UNION_TYPE             \
1822              || TREE_ADDRESSABLE (TYPE))))
1823
1824 /* The number of register assigned to holding function arguments.  */
1825
1826 #define FRV_NUM_ARG_REGS        6
1827
1828 /* A C expression that controls whether a function argument is passed in a
1829    register, and which register.
1830
1831    The arguments are CUM, of type CUMULATIVE_ARGS, which summarizes (in a way
1832    defined by INIT_CUMULATIVE_ARGS and FUNCTION_ARG_ADVANCE) all of the previous
1833    arguments so far passed in registers; MODE, the machine mode of the argument;
1834    TYPE, the data type of the argument as a tree node or 0 if that is not known
1835    (which happens for C support library functions); and NAMED, which is 1 for an
1836    ordinary argument and 0 for nameless arguments that correspond to `...' in the
1837    called function's prototype.
1838
1839    The value of the expression should either be a `reg' RTX for the hard
1840    register in which to pass the argument, or zero to pass the argument on the
1841    stack.
1842
1843    For machines like the VAX and 68000, where normally all arguments are
1844    pushed, zero suffices as a definition.
1845
1846    The usual way to make the ANSI library `stdarg.h' work on a machine where
1847    some arguments are usually passed in registers, is to cause nameless
1848    arguments to be passed on the stack instead.  This is done by making
1849    `FUNCTION_ARG' return 0 whenever NAMED is 0.
1850
1851    You may use the macro `MUST_PASS_IN_STACK (MODE, TYPE)' in the definition of
1852    this macro to determine if this argument is of a type that must be passed in
1853    the stack.  If `REG_PARM_STACK_SPACE' is not defined and `FUNCTION_ARG'
1854    returns nonzero for such an argument, the compiler will abort.  If
1855    `REG_PARM_STACK_SPACE' is defined, the argument will be computed in the
1856    stack and then loaded into a register.  */
1857 #define FUNCTION_ARG(CUM, MODE, TYPE, NAMED)                    \
1858   frv_function_arg (&CUM, MODE, TYPE, NAMED, FALSE)
1859
1860 /* Define this macro if the target machine has "register windows", so that the
1861    register in which a function sees an arguments is not necessarily the same
1862    as the one in which the caller passed the argument.
1863
1864    For such machines, `FUNCTION_ARG' computes the register in which the caller
1865    passes the value, and `FUNCTION_INCOMING_ARG' should be defined in a similar
1866    fashion to tell the function being called where the arguments will arrive.
1867
1868    If `FUNCTION_INCOMING_ARG' is not defined, `FUNCTION_ARG' serves both
1869    purposes.  */
1870
1871 #define FUNCTION_INCOMING_ARG(CUM, MODE, TYPE, NAMED)                   \
1872   frv_function_arg (&CUM, MODE, TYPE, NAMED, TRUE)
1873
1874 /* A C expression for the number of words, at the beginning of an argument,
1875    must be put in registers.  The value must be zero for arguments that are
1876    passed entirely in registers or that are entirely pushed on the stack.
1877
1878    On some machines, certain arguments must be passed partially in registers
1879    and partially in memory.  On these machines, typically the first N words of
1880    arguments are passed in registers, and the rest on the stack.  If a
1881    multi-word argument (a `double' or a structure) crosses that boundary, its
1882    first few words must be passed in registers and the rest must be pushed.
1883    This macro tells the compiler when this occurs, and how many of the words
1884    should go in registers.
1885
1886    `FUNCTION_ARG' for these arguments should return the first register to be
1887    used by the caller for this argument; likewise `FUNCTION_INCOMING_ARG', for
1888    the called function.  */
1889 #define FUNCTION_ARG_PARTIAL_NREGS(CUM, MODE, TYPE, NAMED)              \
1890   frv_function_arg_partial_nregs (&CUM, MODE, TYPE, NAMED)
1891
1892 /* extern int frv_function_arg_partial_nregs PARAMS ((CUMULATIVE_ARGS, int, Tree, int));  */
1893
1894 /* A C expression that indicates when an argument must be passed by reference.
1895    If nonzero for an argument, a copy of that argument is made in memory and a
1896    pointer to the argument is passed instead of the argument itself.  The
1897    pointer is passed in whatever way is appropriate for passing a pointer to
1898    that type.
1899
1900    On machines where `REG_PARM_STACK_SPACE' is not defined, a suitable
1901    definition of this macro might be
1902         #define FUNCTION_ARG_PASS_BY_REFERENCE(CUM, MODE, TYPE, NAMED)  \
1903           MUST_PASS_IN_STACK (MODE, TYPE)  */
1904 #define FUNCTION_ARG_PASS_BY_REFERENCE(CUM, MODE, TYPE, NAMED)          \
1905   frv_function_arg_pass_by_reference (&CUM, MODE, TYPE, NAMED)
1906
1907 /* If defined, a C expression that indicates when it is the called function's
1908    responsibility to make a copy of arguments passed by invisible reference.
1909    Normally, the caller makes a copy and passes the address of the copy to the
1910    routine being called.  When FUNCTION_ARG_CALLEE_COPIES is defined and is
1911    nonzero, the caller does not make a copy.  Instead, it passes a pointer to
1912    the "live" value.  The called function must not modify this value.  If it
1913    can be determined that the value won't be modified, it need not make a copy;
1914    otherwise a copy must be made.  */
1915 #define FUNCTION_ARG_CALLEE_COPIES(CUM, MODE, TYPE, NAMED)              \
1916   frv_function_arg_callee_copies (&CUM, MODE, TYPE, NAMED)
1917
1918 /* If defined, a C expression that indicates when it is more desirable to keep
1919    an argument passed by invisible reference as a reference, rather than
1920    copying it to a pseudo register.  */
1921 #define FUNCTION_ARG_KEEP_AS_REFERENCE(CUM, MODE, TYPE, NAMED)          \
1922   frv_function_arg_keep_as_reference (&CUM, MODE, TYPE, NAMED)
1923
1924 /* A C type for declaring a variable that is used as the first argument of
1925    `FUNCTION_ARG' and other related values.  For some target machines, the type
1926    `int' suffices and can hold the number of bytes of argument so far.
1927
1928    There is no need to record in `CUMULATIVE_ARGS' anything about the arguments
1929    that have been passed on the stack.  The compiler has other variables to
1930    keep track of that.  For target machines on which all arguments are passed
1931    on the stack, there is no need to store anything in `CUMULATIVE_ARGS';
1932    however, the data structure must exist and should not be empty, so use
1933    `int'.  */
1934 #define CUMULATIVE_ARGS int
1935
1936 /* A C statement (sans semicolon) for initializing the variable CUM for the
1937    state at the beginning of the argument list.  The variable has type
1938    `CUMULATIVE_ARGS'.  The value of FNTYPE is the tree node for the data type
1939    of the function which will receive the args, or 0 if the args are to a
1940    compiler support library function.  The value of INDIRECT is nonzero when
1941    processing an indirect call, for example a call through a function pointer.
1942    The value of INDIRECT is zero for a call to an explicitly named function, a
1943    library function call, or when `INIT_CUMULATIVE_ARGS' is used to find
1944    arguments for the function being compiled.
1945
1946    When processing a call to a compiler support library function, LIBNAME
1947    identifies which one.  It is a `symbol_ref' rtx which contains the name of
1948    the function, as a string.  LIBNAME is 0 when an ordinary C function call is
1949    being processed.  Thus, each time this macro is called, either LIBNAME or
1950    FNTYPE is nonzero, but never both of them at once.  */
1951
1952 #define INIT_CUMULATIVE_ARGS(CUM, FNTYPE, LIBNAME, FNDECL) \
1953   frv_init_cumulative_args (&CUM, FNTYPE, LIBNAME, FNDECL, FALSE)
1954
1955 /* Like `INIT_CUMULATIVE_ARGS' but overrides it for the purposes of finding the
1956    arguments for the function being compiled.  If this macro is undefined,
1957    `INIT_CUMULATIVE_ARGS' is used instead.
1958
1959    The value passed for LIBNAME is always 0, since library routines with
1960    special calling conventions are never compiled with GNU CC.  The argument
1961    LIBNAME exists for symmetry with `INIT_CUMULATIVE_ARGS'.  */
1962
1963 #define INIT_CUMULATIVE_INCOMING_ARGS(CUM, FNTYPE, LIBNAME) \
1964   frv_init_cumulative_args (&CUM, FNTYPE, LIBNAME, NULL, TRUE)
1965
1966 /* A C statement (sans semicolon) to update the summarizer variable CUM to
1967    advance past an argument in the argument list.  The values MODE, TYPE and
1968    NAMED describe that argument.  Once this is done, the variable CUM is
1969    suitable for analyzing the *following* argument with `FUNCTION_ARG', etc.
1970
1971    This macro need not do anything if the argument in question was passed on
1972    the stack.  The compiler knows how to track the amount of stack space used
1973    for arguments without any special help.  */
1974 #define FUNCTION_ARG_ADVANCE(CUM, MODE, TYPE, NAMED)                    \
1975   frv_function_arg_advance (&CUM, MODE, TYPE, NAMED)
1976
1977 /* If defined, a C expression that gives the alignment boundary, in bits, of an
1978    argument with the specified mode and type.  If it is not defined,
1979    `PARM_BOUNDARY' is used for all arguments.  */
1980
1981 #define FUNCTION_ARG_BOUNDARY(MODE, TYPE) \
1982   frv_function_arg_boundary (MODE, TYPE)
1983
1984 /* A C expression that is nonzero if REGNO is the number of a hard register in
1985    which function arguments are sometimes passed.  This does *not* include
1986    implicit arguments such as the static chain and the structure-value address.
1987    On many machines, no registers can be used for this purpose since all
1988    function arguments are pushed on the stack.  */
1989 #define FUNCTION_ARG_REGNO_P(REGNO) \
1990   ((REGNO) >= FIRST_ARG_REGNUM && ((REGNO) <= LAST_ARG_REGNUM))
1991
1992 \f
1993 /* How Scalar Function Values are Returned.  */
1994
1995 /* The number of the hard register that is used to return a scalar value from a
1996    function call.  */
1997 #define RETURN_VALUE_REGNUM     (GPR_FIRST + 8)
1998
1999 /* A C expression to create an RTX representing the place where a function
2000    returns a value of data type VALTYPE.  VALTYPE is a tree node representing a
2001    data type.  Write `TYPE_MODE (VALTYPE)' to get the machine mode used to
2002    represent that type.  On many machines, only the mode is relevant.
2003    (Actually, on most machines, scalar values are returned in the same place
2004    regardless of mode).
2005
2006    If `PROMOTE_FUNCTION_RETURN' is defined, you must apply the same promotion
2007    rules specified in `PROMOTE_MODE' if VALTYPE is a scalar type.
2008
2009    If the precise function being called is known, FUNC is a tree node
2010    (`FUNCTION_DECL') for it; otherwise, FUNC is a null pointer.  This makes it
2011    possible to use a different value-returning convention for specific
2012    functions when all their calls are known.
2013
2014    `FUNCTION_VALUE' is not used for return vales with aggregate data types,
2015    because these are returned in another way.  See `STRUCT_VALUE_REGNUM' and
2016    related macros, below.  */
2017 #define FUNCTION_VALUE(VALTYPE, FUNC) \
2018   gen_rtx (REG, TYPE_MODE (VALTYPE), RETURN_VALUE_REGNUM)
2019
2020 /* A C expression to create an RTX representing the place where a library
2021    function returns a value of mode MODE.
2022
2023    Note that "library function" in this context means a compiler support
2024    routine, used to perform arithmetic, whose name is known specially by the
2025    compiler and was not mentioned in the C code being compiled.
2026
2027    The definition of `LIBRARY_VALUE' need not be concerned aggregate data
2028    types, because none of the library functions returns such types.  */
2029 #define LIBCALL_VALUE(MODE) gen_rtx (REG, MODE, RETURN_VALUE_REGNUM)
2030
2031 /* A C expression that is nonzero if REGNO is the number of a hard register in
2032    which the values of called function may come back.
2033
2034    A register whose use for returning values is limited to serving as the
2035    second of a pair (for a value of type `double', say) need not be recognized
2036    by this macro.  So for most machines, this definition suffices:
2037
2038         #define FUNCTION_VALUE_REGNO_P(N) ((N) == RETURN)
2039
2040    If the machine has register windows, so that the caller and the called
2041    function use different registers for the return value, this macro should
2042    recognize only the caller's register numbers.  */
2043 #define FUNCTION_VALUE_REGNO_P(REGNO) ((REGNO) == RETURN_VALUE_REGNUM)
2044
2045 \f
2046 /* How Large Values are Returned.  */
2047
2048 /* If the structure value address is passed in a register, then
2049    `STRUCT_VALUE_REGNUM' should be the number of that register.  */
2050 #define STRUCT_VALUE_REGNUM (GPR_FIRST + 3)
2051
2052 \f
2053 /* Function Entry and Exit.  */
2054
2055 /* Define this macro as a C expression that is nonzero if the return
2056    instruction or the function epilogue ignores the value of the stack pointer;
2057    in other words, if it is safe to delete an instruction to adjust the stack
2058    pointer before a return from the function.
2059
2060    Note that this macro's value is relevant only for functions for which frame
2061    pointers are maintained.  It is never safe to delete a final stack
2062    adjustment in a function that has no frame pointer, and the compiler knows
2063    this regardless of `EXIT_IGNORE_STACK'.  */
2064 #define EXIT_IGNORE_STACK 1
2065 \f
2066 /* Generating Code for Profiling.  */
2067
2068 /* A C statement or compound statement to output to FILE some assembler code to
2069    call the profiling subroutine `mcount'.  Before calling, the assembler code
2070    must load the address of a counter variable into a register where `mcount'
2071    expects to find the address.  The name of this variable is `LP' followed by
2072    the number LABELNO, so you would generate the name using `LP%d' in a
2073    `fprintf'.
2074
2075    The details of how the address should be passed to `mcount' are determined
2076    by your operating system environment, not by GNU CC.  To figure them out,
2077    compile a small program for profiling using the system's installed C
2078    compiler and look at the assembler code that results.
2079
2080    This declaration must be present, but it can be an abort if profiling is
2081    not implemented.  */
2082
2083 #define FUNCTION_PROFILER(FILE, LABELNO) abort ()
2084
2085 \f
2086 /* Implementing the Varargs Macros.  */
2087
2088 /* If defined, is a C expression that produces the machine-specific code for a
2089    call to `__builtin_saveregs'.  This code will be moved to the very beginning
2090    of the function, before any parameter access are made.  The return value of
2091    this function should be an RTX that contains the value to use as the return
2092    of `__builtin_saveregs'.
2093
2094    If this macro is not defined, the compiler will output an ordinary call to
2095    the library function `__builtin_saveregs'.  */
2096
2097 #define EXPAND_BUILTIN_SAVEREGS() frv_expand_builtin_saveregs ()
2098
2099 /* This macro offers an alternative to using `__builtin_saveregs' and defining
2100    the macro `EXPAND_BUILTIN_SAVEREGS'.  Use it to store the anonymous register
2101    arguments into the stack so that all the arguments appear to have been
2102    passed consecutively on the stack.  Once this is done, you can use the
2103    standard implementation of varargs that works for machines that pass all
2104    their arguments on the stack.
2105
2106    The argument ARGS_SO_FAR is the `CUMULATIVE_ARGS' data structure, containing
2107    the values that obtain after processing of the named arguments.  The
2108    arguments MODE and TYPE describe the last named argument--its machine mode
2109    and its data type as a tree node.
2110
2111    The macro implementation should do two things: first, push onto the stack
2112    all the argument registers *not* used for the named arguments, and second,
2113    store the size of the data thus pushed into the `int'-valued variable whose
2114    name is supplied as the argument PRETEND_ARGS_SIZE.  The value that you
2115    store here will serve as additional offset for setting up the stack frame.
2116
2117    Because you must generate code to push the anonymous arguments at compile
2118    time without knowing their data types, `SETUP_INCOMING_VARARGS' is only
2119    useful on machines that have just a single category of argument register and
2120    use it uniformly for all data types.
2121
2122    If the argument SECOND_TIME is nonzero, it means that the arguments of the
2123    function are being analyzed for the second time.  This happens for an inline
2124    function, which is not actually compiled until the end of the source file.
2125    The macro `SETUP_INCOMING_VARARGS' should not generate any instructions in
2126    this case.  */
2127 #define SETUP_INCOMING_VARARGS(ARGS_SO_FAR, MODE, TYPE, PRETEND_ARGS_SIZE, SECOND_TIME) \
2128   frv_setup_incoming_varargs (& ARGS_SO_FAR, (int) MODE, TYPE,  \
2129                               & PRETEND_ARGS_SIZE, SECOND_TIME)
2130
2131 /* Implement the stdarg/varargs va_start macro.  STDARG_P is nonzero if this
2132    is stdarg.h instead of varargs.h.  VALIST is the tree of the va_list
2133    variable to initialize.  NEXTARG is the machine independent notion of the
2134    'next' argument after the variable arguments.  If not defined, a standard
2135    implementation will be defined that works for arguments passed on the stack.  */
2136
2137 #define EXPAND_BUILTIN_VA_START(VALIST, NEXTARG)                \
2138   (frv_expand_builtin_va_start(VALIST, NEXTARG))
2139
2140 /* Implement the stdarg/varargs va_arg macro.  VALIST is the variable of type
2141    va_list as a tree, TYPE is the type passed to va_arg.  */
2142
2143 #define EXPAND_BUILTIN_VA_ARG(VALIST, TYPE)                             \
2144   (frv_expand_builtin_va_arg (VALIST, TYPE))
2145
2146 \f
2147 /* Trampolines for Nested Functions.  */
2148
2149 /* A C expression for the size in bytes of the trampoline, as an integer.  */
2150 #define TRAMPOLINE_SIZE frv_trampoline_size ()
2151
2152 /* Alignment required for trampolines, in bits.
2153
2154    If you don't define this macro, the value of `BIGGEST_ALIGNMENT' is used for
2155    aligning trampolines.  */
2156 #define TRAMPOLINE_ALIGNMENT 32
2157
2158 /* A C statement to initialize the variable parts of a trampoline.  ADDR is an
2159    RTX for the address of the trampoline; FNADDR is an RTX for the address of
2160    the nested function; STATIC_CHAIN is an RTX for the static chain value that
2161    should be passed to the function when it is called.  */
2162 #define INITIALIZE_TRAMPOLINE(ADDR, FNADDR, STATIC_CHAIN) \
2163   frv_initialize_trampoline (ADDR, FNADDR, STATIC_CHAIN)
2164
2165 /* Define this macro if trampolines need a special subroutine to do their work.
2166    The macro should expand to a series of `asm' statements which will be
2167    compiled with GNU CC.  They go in a library function named
2168    `__transfer_from_trampoline'.
2169
2170    If you need to avoid executing the ordinary prologue code of a compiled C
2171    function when you jump to the subroutine, you can do so by placing a special
2172    label of your own in the assembler code.  Use one `asm' statement to
2173    generate an assembler label, and another to make the label global.  Then
2174    trampolines can use that label to jump directly to your special assembler
2175    code.  */
2176
2177 #ifdef __FRV_UNDERSCORE__
2178 #define TRAMPOLINE_TEMPLATE_NAME "___trampoline_template"
2179 #else
2180 #define TRAMPOLINE_TEMPLATE_NAME "__trampoline_template"
2181 #endif
2182
2183 #define TRANSFER_FROM_TRAMPOLINE                                        \
2184 extern int _write (int, const void *, unsigned);                        \
2185                                                                         \
2186 void                                                                    \
2187 __trampoline_setup (addr, size, fnaddr, sc)                             \
2188      short * addr;                                                      \
2189      int size;                                                          \
2190      int fnaddr;                                                        \
2191      int sc;                                                            \
2192 {                                                                       \
2193   extern short __trampoline_template[];                                 \
2194   short * to = addr;                                                    \
2195   short * from = &__trampoline_template[0];                             \
2196   int i;                                                                \
2197                                                                         \
2198   if (size < 20)                                                        \
2199     {                                                                   \
2200       _write (2, "__trampoline_setup bad size\n",                       \
2201               sizeof ("__trampoline_setup bad size\n") - 1);            \
2202       exit (-1);                                                        \
2203     }                                                                   \
2204                                                                         \
2205   to[0] = from[0];                                                      \
2206   to[1] = (short)(fnaddr);                                              \
2207   to[2] = from[2];                                                      \
2208   to[3] = (short)(sc);                                                  \
2209   to[4] = from[4];                                                      \
2210   to[5] = (short)(fnaddr >> 16);                                        \
2211   to[6] = from[6];                                                      \
2212   to[7] = (short)(sc >> 16);                                            \
2213   to[8] = from[8];                                                      \
2214   to[9] = from[9];                                                      \
2215                                                                         \
2216   for (i = 0; i < 20; i++)                                              \
2217     __asm__ volatile ("dcf @(%0,%1)\n\tici @(%0,%1)" :: "r" (to), "r" (i)); \
2218 }                                                                       \
2219                                                                         \
2220 __asm__("\n"                                                            \
2221         "\t.globl " TRAMPOLINE_TEMPLATE_NAME "\n"                       \
2222         "\t.text\n"                                                     \
2223         TRAMPOLINE_TEMPLATE_NAME ":\n"                                  \
2224         "\tsetlos #0, gr6\n"    /* jump register */                     \
2225         "\tsetlos #0, gr7\n"    /* static chain */                      \
2226         "\tsethi #0, gr6\n"                                             \
2227         "\tsethi #0, gr7\n"                                             \
2228         "\tjmpl @(gr0,gr6)\n");
2229
2230 \f
2231 /* Implicit Calls to Library Routines.  */
2232
2233 /* A C string constant giving the name of the function to call for the
2234    remainder in division of one signed full-word by another.  If you do not
2235    define this macro, the default name is used, which is `__modsi3', a function
2236    defined in `libgcc.a'.  */
2237 #define MODSI3_LIBCALL "__modi"
2238
2239 /* A C string constant giving the name of the function to call for the
2240    remainder in division of one unsigned full-word by another.  If you do not
2241    define this macro, the default name is used, which is `__umodsi3', a
2242    function defined in `libgcc.a'.  */
2243 #define UMODSI3_LIBCALL "__umodi"
2244
2245 /* A C string constant giving the name of the function to call for
2246    multiplication of one signed double-word by another.  If you do not define
2247    this macro, the default name is used, which is `__muldi3', a function
2248    defined in `libgcc.a'.  */
2249 #define MULDI3_LIBCALL "__mulll"
2250
2251 /* A C string constant giving the name of the function to call for division of
2252    one signed double-word by another.  If you do not define this macro, the
2253    default name is used, which is `__divdi3', a function defined in `libgcc.a'.  */
2254 #define DIVDI3_LIBCALL "__divll"
2255
2256 /* A C string constant giving the name of the function to call for division of
2257    one unsigned full-word by another.  If you do not define this macro, the
2258    default name is used, which is `__udivdi3', a function defined in
2259    `libgcc.a'.  */
2260 #define UDIVDI3_LIBCALL "__udivll"
2261
2262 /* A C string constant giving the name of the function to call for the
2263    remainder in division of one signed double-word by another.  If you do not
2264    define this macro, the default name is used, which is `__moddi3', a function
2265    defined in `libgcc.a'.  */
2266 #define MODDI3_LIBCALL "__modll"
2267
2268 /* A C string constant giving the name of the function to call for the
2269    remainder in division of one unsigned full-word by another.  If you do not
2270    define this macro, the default name is used, which is `__umoddi3', a
2271    function defined in `libgcc.a'.  */
2272 #define UMODDI3_LIBCALL "__umodll"
2273
2274 /* Define this macro as a C statement that declares additional library routines
2275    renames existing ones. `init_optabs' calls this macro after initializing all
2276    the normal library routines.  */
2277 #define INIT_TARGET_OPTABS                                      \
2278   do                                                            \
2279     {                                                           \
2280       add_optab->handlers [(int) DImode].libfunc                \
2281         = init_one_libfunc ("__addll");                         \
2282       sub_optab->handlers [(int) DImode].libfunc                \
2283         = init_one_libfunc ("__subll");                         \
2284       and_optab->handlers [(int) DImode].libfunc                \
2285         = init_one_libfunc ("__andll");                         \
2286       ior_optab->handlers [(int) DImode].libfunc                \
2287         = init_one_libfunc ("__orll");                          \
2288       xor_optab->handlers [(int) DImode].libfunc                \
2289         = init_one_libfunc ("__xorll");                         \
2290       one_cmpl_optab->handlers [(int) DImode].libfunc           \
2291         = init_one_libfunc ("__notll");                         \
2292       add_optab->handlers [(int) SFmode].libfunc                \
2293         = init_one_libfunc ("__addf");                          \
2294       sub_optab->handlers [(int) SFmode].libfunc                \
2295         = init_one_libfunc ("__subf");                          \
2296       smul_optab->handlers [(int) SFmode].libfunc               \
2297         = init_one_libfunc ("__mulf");                          \
2298       sdiv_optab->handlers [(int) SFmode].libfunc               \
2299         = init_one_libfunc ("__divf");                          \
2300       add_optab->handlers [(int) DFmode].libfunc                \
2301         = init_one_libfunc ("__addd");                          \
2302       sub_optab->handlers [(int) DFmode].libfunc                \
2303         = init_one_libfunc ("__subd");                          \
2304       smul_optab->handlers [(int) DFmode].libfunc               \
2305         = init_one_libfunc ("__muld");                          \
2306       sdiv_optab->handlers [(int) DFmode].libfunc               \
2307         = init_one_libfunc ("__divd");                          \
2308       fixsfsi_libfunc = init_one_libfunc ("__ftoi");            \
2309       fixunssfsi_libfunc = init_one_libfunc ("__ftoui");        \
2310       fixsfdi_libfunc = init_one_libfunc ("__ftoll");           \
2311       fixunssfdi_libfunc = init_one_libfunc ("__ftoull");       \
2312       fixdfsi_libfunc = init_one_libfunc ("__dtoi");            \
2313       fixunsdfsi_libfunc = init_one_libfunc ("__dtoui");        \
2314       fixdfdi_libfunc = init_one_libfunc ("__dtoll");           \
2315       fixunsdfdi_libfunc = init_one_libfunc ("__dtoull");       \
2316       floatsisf_libfunc = init_one_libfunc ("__itof");          \
2317       floatdisf_libfunc = init_one_libfunc ("__lltof");         \
2318       floatsidf_libfunc = init_one_libfunc ("__itod");          \
2319       floatdidf_libfunc = init_one_libfunc ("__lltod");         \
2320       extendsfdf2_libfunc = init_one_libfunc ("__ftod");        \
2321       truncdfsf2_libfunc = init_one_libfunc ("__dtof");         \
2322     }                                                           \
2323   while (0)
2324
2325 \f
2326 /* Addressing Modes.  */
2327
2328 /* A C expression that is 1 if the RTX X is a constant which is a valid
2329    address.  On most machines, this can be defined as `CONSTANT_P (X)', but a
2330    few machines are more restrictive in which constant addresses are supported.
2331
2332    `CONSTANT_P' accepts integer-values expressions whose values are not
2333    explicitly known, such as `symbol_ref', `label_ref', and `high' expressions
2334    and `const' arithmetic expressions, in addition to `const_int' and
2335    `const_double' expressions.  */
2336 #define CONSTANT_ADDRESS_P(X) CONSTANT_P (X)
2337
2338 /* A number, the maximum number of registers that can appear in a valid memory
2339    address.  Note that it is up to you to specify a value equal to the maximum
2340    number that `GO_IF_LEGITIMATE_ADDRESS' would ever accept.  */
2341 #define MAX_REGS_PER_ADDRESS 2
2342
2343 /* A C compound statement with a conditional `goto LABEL;' executed if X (an
2344    RTX) is a legitimate memory address on the target machine for a memory
2345    operand of mode MODE.
2346
2347    It usually pays to define several simpler macros to serve as subroutines for
2348    this one.  Otherwise it may be too complicated to understand.
2349
2350    This macro must exist in two variants: a strict variant and a non-strict
2351    one.  The strict variant is used in the reload pass.  It must be defined so
2352    that any pseudo-register that has not been allocated a hard register is
2353    considered a memory reference.  In contexts where some kind of register is
2354    required, a pseudo-register with no hard register must be rejected.
2355
2356    The non-strict variant is used in other passes.  It must be defined to
2357    accept all pseudo-registers in every context where some kind of register is
2358    required.
2359
2360    Compiler source files that want to use the strict variant of this macro
2361    define the macro `REG_OK_STRICT'.  You should use an `#ifdef REG_OK_STRICT'
2362    conditional to define the strict variant in that case and the non-strict
2363    variant otherwise.
2364
2365    Subroutines to check for acceptable registers for various purposes (one for
2366    base registers, one for index registers, and so on) are typically among the
2367    subroutines used to define `GO_IF_LEGITIMATE_ADDRESS'.  Then only these
2368    subroutine macros need have two variants; the higher levels of macros may be
2369    the same whether strict or not.
2370
2371    Normally, constant addresses which are the sum of a `symbol_ref' and an
2372    integer are stored inside a `const' RTX to mark them as constant.
2373    Therefore, there is no need to recognize such sums specifically as
2374    legitimate addresses.  Normally you would simply recognize any `const' as
2375    legitimate.
2376
2377    Usually `PRINT_OPERAND_ADDRESS' is not prepared to handle constant sums that
2378    are not marked with `const'.  It assumes that a naked `plus' indicates
2379    indexing.  If so, then you *must* reject such naked constant sums as
2380    illegitimate addresses, so that none of them will be given to
2381    `PRINT_OPERAND_ADDRESS'.
2382
2383    On some machines, whether a symbolic address is legitimate depends on the
2384    section that the address refers to.  On these machines, define the macro
2385    `ENCODE_SECTION_INFO' to store the information into the `symbol_ref', and
2386    then check for it here.  When you see a `const', you will have to look
2387    inside it to find the `symbol_ref' in order to determine the section.
2388
2389    The best way to modify the name string is by adding text to the beginning,
2390    with suitable punctuation to prevent any ambiguity.  Allocate the new name
2391    in `saveable_obstack'.  You will have to modify `ASM_OUTPUT_LABELREF' to
2392    remove and decode the added text and output the name accordingly, and define
2393    `(* targetm.strip_name_encoding)' to access the original name string.
2394
2395    You can check the information stored here into the `symbol_ref' in the
2396    definitions of the macros `GO_IF_LEGITIMATE_ADDRESS' and
2397    `PRINT_OPERAND_ADDRESS'.  */
2398
2399 #ifdef REG_OK_STRICT
2400 #define REG_OK_STRICT_P 1
2401 #else
2402 #define REG_OK_STRICT_P 0
2403 #endif
2404
2405 #define GO_IF_LEGITIMATE_ADDRESS(MODE, X, LABEL)                        \
2406   do                                                                    \
2407     {                                                                   \
2408       if (frv_legitimate_address_p (MODE, X, REG_OK_STRICT_P, FALSE))   \
2409         goto LABEL;                                                     \
2410     }                                                                   \
2411   while (0)
2412
2413 /* A C expression that is nonzero if X (assumed to be a `reg' RTX) is valid for
2414    use as a base register.  For hard registers, it should always accept those
2415    which the hardware permits and reject the others.  Whether the macro accepts
2416    or rejects pseudo registers must be controlled by `REG_OK_STRICT' as
2417    described above.  This usually requires two variant definitions, of which
2418    `REG_OK_STRICT' controls the one actually used.  */
2419 #ifdef REG_OK_STRICT
2420 #define REG_OK_FOR_BASE_P(X) GPR_P (REGNO (X))
2421 #else
2422 #define REG_OK_FOR_BASE_P(X) GPR_AP_OR_PSEUDO_P (REGNO (X))
2423 #endif
2424
2425 /* A C expression that is nonzero if X (assumed to be a `reg' RTX) is valid for
2426    use as an index register.
2427
2428    The difference between an index register and a base register is that the
2429    index register may be scaled.  If an address involves the sum of two
2430    registers, neither one of them scaled, then either one may be labeled the
2431    "base" and the other the "index"; but whichever labeling is used must fit
2432    the machine's constraints of which registers may serve in each capacity.
2433    The compiler will try both labelings, looking for one that is valid, and
2434    will reload one or both registers only if neither labeling works.  */
2435 #define REG_OK_FOR_INDEX_P(X) REG_OK_FOR_BASE_P (X)
2436
2437 /* A C compound statement that attempts to replace X with a valid memory
2438    address for an operand of mode MODE.  WIN will be a C statement label
2439    elsewhere in the code; the macro definition may use
2440
2441         GO_IF_LEGITIMATE_ADDRESS (MODE, X, WIN);
2442
2443    to avoid further processing if the address has become legitimate.
2444
2445    X will always be the result of a call to `break_out_memory_refs', and OLDX
2446    will be the operand that was given to that function to produce X.
2447
2448    The code generated by this macro should not alter the substructure of X.  If
2449    it transforms X into a more legitimate form, it should assign X (which will
2450    always be a C variable) a new value.
2451
2452    It is not necessary for this macro to come up with a legitimate address.
2453    The compiler has standard ways of doing so in all cases.  In fact, it is
2454    safe for this macro to do nothing.  But often a machine-dependent strategy
2455    can generate better code.  */
2456
2457 /* On the FRV, we use it to convert small data and pic references into using
2458    the appropriate pointer in the address.  */
2459 #define LEGITIMIZE_ADDRESS(X, OLDX, MODE, WIN)                  \
2460   do                                                            \
2461     {                                                           \
2462       rtx newx = frv_legitimize_address (X, OLDX, MODE);        \
2463                                                                 \
2464       if (newx)                                                 \
2465         {                                                       \
2466           (X) = newx;                                           \
2467           goto WIN;                                             \
2468         }                                                       \
2469     }                                                           \
2470   while (0)
2471
2472 /* A C statement or compound statement with a conditional `goto LABEL;'
2473    executed if memory address X (an RTX) can have different meanings depending
2474    on the machine mode of the memory reference it is used for or if the address
2475    is valid for some modes but not others.
2476
2477    Autoincrement and autodecrement addresses typically have mode-dependent
2478    effects because the amount of the increment or decrement is the size of the
2479    operand being addressed.  Some machines have other mode-dependent addresses.
2480    Many RISC machines have no mode-dependent addresses.
2481
2482    You may assume that ADDR is a valid address for the machine.  */
2483 #define GO_IF_MODE_DEPENDENT_ADDRESS(ADDR, LABEL)
2484
2485 /* A C expression that is nonzero if X is a legitimate constant for an
2486    immediate operand on the target machine.  You can assume that X satisfies
2487    `CONSTANT_P', so you need not check this.  In fact, `1' is a suitable
2488    definition for this macro on machines where anything `CONSTANT_P' is valid.  */
2489 #define LEGITIMATE_CONSTANT_P(X) frv_legitimate_constant_p (X)
2490
2491 /* The load-and-update commands allow pre-modification in addresses.
2492    The index has to be in a register.  */
2493 #define HAVE_PRE_MODIFY_REG 1
2494
2495 \f
2496 /* Returns a mode from class `MODE_CC' to be used when comparison operation
2497    code OP is applied to rtx X and Y.  For example, on the SPARC,
2498    `SELECT_CC_MODE' is defined as (see *note Jump Patterns::.  for a
2499    description of the reason for this definition)
2500
2501         #define SELECT_CC_MODE(OP,X,Y) \
2502           (GET_MODE_CLASS (GET_MODE (X)) == MODE_FLOAT          \
2503            ? ((OP == EQ || OP == NE) ? CCFPmode : CCFPEmode)    \
2504            : ((GET_CODE (X) == PLUS || GET_CODE (X) == MINUS    \
2505                || GET_CODE (X) == NEG) \
2506               ? CC_NOOVmode : CCmode))
2507
2508    You need not define this macro if `EXTRA_CC_MODES' is not defined.  */
2509 #define SELECT_CC_MODE(OP, X, Y)                                        \
2510   (GET_MODE_CLASS (GET_MODE (X)) == MODE_FLOAT                          \
2511    ? CC_FPmode                                                          \
2512    : (((OP) == LEU || (OP) == GTU || (OP) == LTU || (OP) == GEU)        \
2513       ? CC_UNSmode                                                      \
2514       : CCmode))
2515
2516 /* A C expression whose value is one if it is always safe to reverse a
2517    comparison whose mode is MODE.  If `SELECT_CC_MODE' can ever return MODE for
2518    a floating-point inequality comparison, then `REVERSIBLE_CC_MODE (MODE)'
2519    must be zero.
2520
2521    You need not define this macro if it would always returns zero or if the
2522    floating-point format is anything other than `IEEE_FLOAT_FORMAT'.  For
2523    example, here is the definition used on the SPARC, where floating-point
2524    inequality comparisons are always given `CCFPEmode':
2525
2526         #define REVERSIBLE_CC_MODE(MODE)  ((MODE) != CCFPEmode)  */
2527
2528 /* On frv, don't consider floating point comparisons to be reversible.  In
2529    theory, fp equality comparisons can be reversible */
2530 #define REVERSIBLE_CC_MODE(MODE) ((MODE) == CCmode || (MODE) == CC_UNSmode)
2531
2532 /* Frv CCR_MODE's are not reversible.  */
2533 #define REVERSE_CONDEXEC_PREDICATES_P(x,y)      0
2534
2535 \f
2536 /* Describing Relative Costs of Operations.  */
2537
2538 /* A C expression for the cost of moving data from a register in class FROM to
2539    one in class TO.  The classes are expressed using the enumeration values
2540    such as `GENERAL_REGS'.  A value of 4 is the default; other values are
2541    interpreted relative to that.
2542
2543    It is not required that the cost always equal 2 when FROM is the same as TO;
2544    on some machines it is expensive to move between registers if they are not
2545    general registers.
2546
2547    If reload sees an insn consisting of a single `set' between two hard
2548    registers, and if `REGISTER_MOVE_COST' applied to their classes returns a
2549    value of 2, reload does not check to ensure that the constraints of the insn
2550    are met.  Setting a cost of other than 2 will allow reload to verify that
2551    the constraints are met.  You should do this if the `movM' pattern's
2552    constraints do not allow such copying.  */
2553 #define REGISTER_MOVE_COST(MODE, FROM, TO) frv_register_move_cost (FROM, TO)
2554
2555 /* A C expression for the cost of moving data of mode M between a register and
2556    memory.  A value of 2 is the default; this cost is relative to those in
2557    `REGISTER_MOVE_COST'.
2558
2559    If moving between registers and memory is more expensive than between two
2560    registers, you should define this macro to express the relative cost.  */
2561 #define MEMORY_MOVE_COST(M,C,I) 4
2562
2563 /* A C expression for the cost of a branch instruction.  A value of 1 is the
2564    default; other values are interpreted relative to that.  */
2565
2566 /* Here are additional macros which do not specify precise relative costs, but
2567    only that certain actions are more expensive than GNU CC would ordinarily
2568    expect.  */
2569
2570 /* We used to default the branch cost to 2, but I changed it to 1, to avoid
2571    generating SCC instructions and or/and-ing them together, and then doing the
2572    branch on the result, which collectively generate much worse code.  */
2573 #ifndef DEFAULT_BRANCH_COST
2574 #define DEFAULT_BRANCH_COST 1
2575 #endif
2576
2577 #define BRANCH_COST frv_branch_cost_int
2578
2579 /* Define this macro as a C expression which is nonzero if accessing less than
2580    a word of memory (i.e. a `char' or a `short') is no faster than accessing a
2581    word of memory, i.e., if such access require more than one instruction or if
2582    there is no difference in cost between byte and (aligned) word loads.
2583
2584    When this macro is not defined, the compiler will access a field by finding
2585    the smallest containing object; when it is defined, a fullword load will be
2586    used if alignment permits.  Unless bytes accesses are faster than word
2587    accesses, using word accesses is preferable since it may eliminate
2588    subsequent memory access if subsequent accesses occur to other fields in the
2589    same word of the structure, but to different bytes.  */
2590 #define SLOW_BYTE_ACCESS 1
2591
2592 /* Define this macro if it is as good or better to call a constant function
2593    address than to call an address kept in a register.  */
2594 #define NO_FUNCTION_CSE
2595
2596 /* Define this macro if it is as good or better for a function to call itself
2597    with an explicit address than to call an address kept in a register.  */
2598 #define NO_RECURSIVE_FUNCTION_CSE
2599
2600 \f
2601 /* Dividing the output into sections.  */
2602
2603 /* A C expression whose value is a string containing the assembler operation
2604    that should precede instructions and read-only data.  Normally `".text"' is
2605    right.  */
2606 #define TEXT_SECTION_ASM_OP "\t.text"
2607
2608 /* A C expression whose value is a string containing the assembler operation to
2609    identify the following data as writable initialized data.  Normally
2610    `".data"' is right.  */
2611 #define DATA_SECTION_ASM_OP "\t.data"
2612
2613 /* If defined, a C expression whose value is a string containing the
2614    assembler operation to identify the following data as
2615    uninitialized global data.  If not defined, and neither
2616    `ASM_OUTPUT_BSS' nor `ASM_OUTPUT_ALIGNED_BSS' are defined,
2617    uninitialized global data will be output in the data section if
2618    `-fno-common' is passed, otherwise `ASM_OUTPUT_COMMON' will be
2619    used.  */
2620 #define BSS_SECTION_ASM_OP "\t.section .bss,\"aw\""
2621
2622 /* Short Data Support */
2623 #define SDATA_SECTION_ASM_OP    "\t.section .sdata,\"aw\""
2624 #define SBSS_SECTION_ASM_OP     "\t.section .sbss,\"aw\""
2625
2626 /* On svr4, we *do* have support for the .init and .fini sections, and we
2627    can put stuff in there to be executed before and after `main'.  We let
2628    crtstuff.c and other files know this by defining the following symbols.
2629    The definitions say how to change sections to the .init and .fini
2630    sections.  This is the same for all known svr4 assemblers.
2631
2632    The standard System V.4 macros will work, but they look ugly in the
2633    assembly output, so redefine them.  */
2634
2635 #undef  INIT_SECTION_ASM_OP
2636 #undef  FINI_SECTION_ASM_OP
2637 #define INIT_SECTION_ASM_OP     "\t.section .init,\"ax\""
2638 #define FINI_SECTION_ASM_OP     "\t.section .fini,\"ax\""
2639
2640 #undef CTORS_SECTION_ASM_OP
2641 #undef DTORS_SECTION_ASM_OP
2642 #define CTORS_SECTION_ASM_OP    "\t.section\t.ctors,\"a\""
2643 #define DTORS_SECTION_ASM_OP    "\t.section\t.dtors,\"a\""
2644
2645 /* A C expression whose value is a string containing the assembler operation to
2646    switch to the fixup section that records all initialized pointers in a -fpic
2647    program so they can be changed program startup time if the program is loaded
2648    at a different address than linked for.  */
2649 #define FIXUP_SECTION_ASM_OP    "\t.section .rofixup,\"a\""
2650
2651 /* A list of names for sections other than the standard two, which are
2652    `in_text' and `in_data'.  You need not define this macro
2653    on a system with no other sections (that GCC needs to use).  */
2654 #undef  EXTRA_SECTIONS
2655 #define EXTRA_SECTIONS in_sdata, in_sbss, in_const, in_fixup
2656
2657 /* One or more functions to be defined in "varasm.c".  These
2658    functions should do jobs analogous to those of `text_section' and
2659    `data_section', for your additional sections.  Do not define this
2660    macro if you do not define `EXTRA_SECTIONS'.  */
2661 #undef  EXTRA_SECTION_FUNCTIONS
2662 #define EXTRA_SECTION_FUNCTIONS                                         \
2663         SDATA_SECTION_FUNCTION                                          \
2664         SBSS_SECTION_FUNCTION                                           \
2665         FIXUP_SECTION_FUNCTION
2666
2667 #define SDATA_SECTION_FUNCTION                                          \
2668 void                                                                    \
2669 sdata_section ()                                                        \
2670 {                                                                       \
2671   if (in_section != in_sdata)                                           \
2672     {                                                                   \
2673       fprintf (asm_out_file, "%s\n", SDATA_SECTION_ASM_OP);             \
2674       in_section = in_sdata;                                            \
2675     }                                                                   \
2676 }
2677
2678 #define SBSS_SECTION_FUNCTION                                           \
2679 void                                                                    \
2680 sbss_section ()                                                         \
2681 {                                                                       \
2682   if (in_section != in_sbss)                                            \
2683     {                                                                   \
2684       fprintf (asm_out_file, "%s\n", SBSS_SECTION_ASM_OP);              \
2685       in_section = in_sbss;                                             \
2686     }                                                                   \
2687 }
2688
2689 #define FIXUP_SECTION_FUNCTION                                          \
2690 void                                                                    \
2691 fixup_section ()                                                        \
2692 {                                                                       \
2693   if (in_section != in_fixup)                                           \
2694     {                                                                   \
2695       fprintf (asm_out_file, "%s\n", FIXUP_SECTION_ASM_OP);             \
2696       in_section = in_fixup;                                            \
2697     }                                                                   \
2698 }
2699 \f
2700 /* Position Independent Code.  */
2701
2702 /* A C expression that is nonzero if X is a legitimate immediate operand on the
2703    target machine when generating position independent code.  You can assume
2704    that X satisfies `CONSTANT_P', so you need not check this.  You can also
2705    assume FLAG_PIC is true, so you need not check it either.  You need not
2706    define this macro if all constants (including `SYMBOL_REF') can be immediate
2707    operands when generating position independent code.  */
2708 #define LEGITIMATE_PIC_OPERAND_P(X)                                     \
2709   (   GET_CODE (X) == CONST_INT                                         \
2710    || GET_CODE (X) == CONST_DOUBLE                                      \
2711    || (GET_CODE (X) == HIGH && GET_CODE (XEXP (X, 0)) == CONST_INT)     \
2712    || GET_CODE (X) == CONSTANT_P_RTX)
2713
2714 \f
2715 /* The Overall Framework of an Assembler File.  */
2716
2717 /* A C string constant describing how to begin a comment in the target
2718    assembler language.  The compiler assumes that the comment will end at the
2719    end of the line.  */
2720 #define ASM_COMMENT_START ";"
2721
2722 /* A C string constant for text to be output before each `asm' statement or
2723    group of consecutive ones.  Normally this is `"#APP"', which is a comment
2724    that has no effect on most assemblers but tells the GNU assembler that it
2725    must check the lines that follow for all valid assembler constructs.  */
2726 #define ASM_APP_ON "#APP\n"
2727
2728 /* A C string constant for text to be output after each `asm' statement or
2729    group of consecutive ones.  Normally this is `"#NO_APP"', which tells the
2730    GNU assembler to resume making the time-saving assumptions that are valid
2731    for ordinary compiler output.  */
2732 #define ASM_APP_OFF "#NO_APP\n"
2733
2734 \f
2735 /* Output of Data.  */
2736
2737 /* This is how to output a label to dwarf/dwarf2.  */
2738 #define ASM_OUTPUT_DWARF_ADDR(STREAM, LABEL)                            \
2739 do {                                                                    \
2740   fprintf (STREAM, "\t.picptr\t");                                      \
2741   assemble_name (STREAM, LABEL);                                        \
2742 } while (0)
2743
2744 /* Whether to emit the gas specific dwarf2 line number support.  */
2745 #define DWARF2_ASM_LINE_DEBUG_INFO (TARGET_DEBUG_LOC)
2746 \f
2747 /* Output of Uninitialized Variables.  */
2748
2749 /* A C statement (sans semicolon) to output to the stdio stream STREAM the
2750    assembler definition of a local-common-label named NAME whose size is SIZE
2751    bytes.  The variable ROUNDED is the size rounded up to whatever alignment
2752    the caller wants.
2753
2754    Use the expression `assemble_name (STREAM, NAME)' to output the name itself;
2755    before and after that, output the additional assembler syntax for defining
2756    the name, and a newline.
2757
2758    This macro controls how the assembler definitions of uninitialized static
2759    variables are output.  */
2760 #undef ASM_OUTPUT_LOCAL
2761
2762 /* Like `ASM_OUTPUT_LOCAL' except takes the required alignment as a separate,
2763    explicit argument.  If you define this macro, it is used in place of
2764    `ASM_OUTPUT_LOCAL', and gives you more flexibility in handling the required
2765    alignment of the variable.  The alignment is specified as the number of
2766    bits.
2767
2768    Defined in svr4.h.  */
2769 #undef ASM_OUTPUT_ALIGNED_LOCAL
2770
2771 /* This is for final.c, because it is used by ASM_DECLARE_OBJECT_NAME.  */
2772 extern int size_directive_output;
2773
2774 /* Like `ASM_OUTPUT_ALIGNED_LOCAL' except that it takes an additional
2775    parameter - the DECL of variable to be output, if there is one.
2776    This macro can be called with DECL == NULL_TREE.  If you define
2777    this macro, it is used in place of `ASM_OUTPUT_LOCAL' and
2778    `ASM_OUTPUT_ALIGNED_LOCAL', and gives you more flexibility in
2779    handling the destination of the variable.  */
2780 #undef ASM_OUTPUT_ALIGNED_DECL_LOCAL
2781 #define ASM_OUTPUT_ALIGNED_DECL_LOCAL(STREAM, DECL, NAME, SIZE, ALIGN)  \
2782 do {                                                                    \
2783   extern unsigned HOST_WIDE_INT g_switch_value;                         \
2784                                                                         \
2785   if ((SIZE) > 0 && (SIZE) <= g_switch_value)                           \
2786     sbss_section ();                                                    \
2787   else                                                                  \
2788     bss_section ();                                                     \
2789   ASM_OUTPUT_ALIGN (STREAM, floor_log2 ((ALIGN) / BITS_PER_UNIT));      \
2790   ASM_DECLARE_OBJECT_NAME (STREAM, NAME, DECL);                         \
2791   ASM_OUTPUT_SKIP (STREAM, (SIZE) ? (SIZE) : 1);                        \
2792 } while (0)
2793
2794 \f
2795 /* Output and Generation of Labels.  */
2796
2797 /* A C statement (sans semicolon) to output to the stdio stream STREAM the
2798    assembler definition of a label named NAME.  Use the expression
2799    `assemble_name (STREAM, NAME)' to output the name itself; before and after
2800    that, output the additional assembler syntax for defining the name, and a
2801    newline.  */
2802 #define ASM_OUTPUT_LABEL(STREAM, NAME)                                  \
2803 do {                                                                    \
2804   assemble_name (STREAM, NAME);                                         \
2805   fputs (":\n", STREAM);                                                \
2806 } while (0)
2807
2808 /* Globalizing directive for a label.  */
2809 #define GLOBAL_ASM_OP "\t.globl "
2810
2811 /* A C statement to store into the string STRING a label whose name is made
2812    from the string PREFIX and the number NUM.
2813
2814    This string, when output subsequently by `assemble_name', should produce the
2815    output that `(*targetm.asm_out.internal_label)' would produce with the same PREFIX
2816    and NUM.
2817
2818    If the string begins with `*', then `assemble_name' will output the rest of
2819    the string unchanged.  It is often convenient for
2820    `ASM_GENERATE_INTERNAL_LABEL' to use `*' in this way.  If the string doesn't
2821    start with `*', then `ASM_OUTPUT_LABELREF' gets to output the string, and
2822    may change it.  (Of course, `ASM_OUTPUT_LABELREF' is also part of your
2823    machine description, so you should know what it does on your machine.)
2824
2825    Defined in svr4.h.  */
2826 #undef ASM_GENERATE_INTERNAL_LABEL
2827 #define ASM_GENERATE_INTERNAL_LABEL(LABEL, PREFIX, NUM)                 \
2828 do {                                                                    \
2829   sprintf (LABEL, "*.%s%ld", PREFIX, (long)NUM);                        \
2830 } while (0)
2831
2832 \f
2833 /* Macros Controlling Initialization Routines.  */
2834
2835 /* If defined, a C string constant for the assembler operation to identify the
2836    following data as initialization code.  If not defined, GNU CC will assume
2837    such a section does not exist.  When you are using special sections for
2838    initialization and termination functions, this macro also controls how
2839    `crtstuff.c' and `libgcc2.c' arrange to run the initialization functions.
2840
2841    Defined in svr4.h.  */
2842 #undef INIT_SECTION_ASM_OP
2843
2844 /* If defined, `main' will call `__main' despite the presence of
2845    `INIT_SECTION_ASM_OP'.  This macro should be defined for systems where the
2846    init section is not actually run automatically, but is still useful for
2847    collecting the lists of constructors and destructors.  */
2848 #define INVOKE__main
2849 \f
2850 /* Output of Assembler Instructions.  */
2851
2852 /* A C initializer containing the assembler's names for the machine registers,
2853    each one as a C string constant.  This is what translates register numbers
2854    in the compiler into assembler language.  */
2855 #define REGISTER_NAMES                                                  \
2856 {                                                                       \
2857  "gr0",  "sp",   "fp",   "gr3",  "gr4",  "gr5",  "gr6",  "gr7",         \
2858   "gr8",  "gr9",  "gr10", "gr11", "gr12", "gr13", "gr14", "gr15",       \
2859   "gr16", "gr17", "gr18", "gr19", "gr20", "gr21", "gr22", "gr23",       \
2860   "gr24", "gr25", "gr26", "gr27", "gr28", "gr29", "gr30", "gr31",       \
2861   "gr32", "gr33", "gr34", "gr35", "gr36", "gr37", "gr38", "gr39",       \
2862   "gr40", "gr41", "gr42", "gr43", "gr44", "gr45", "gr46", "gr47",       \
2863   "gr48", "gr49", "gr50", "gr51", "gr52", "gr53", "gr54", "gr55",       \
2864   "gr56", "gr57", "gr58", "gr59", "gr60", "gr61", "gr62", "gr63",       \
2865                                                                         \
2866   "fr0",  "fr1",  "fr2",  "fr3",  "fr4",  "fr5",  "fr6",  "fr7",        \
2867   "fr8",  "fr9",  "fr10", "fr11", "fr12", "fr13", "fr14", "fr15",       \
2868   "fr16", "fr17", "fr18", "fr19", "fr20", "fr21", "fr22", "fr23",       \
2869   "fr24", "fr25", "fr26", "fr27", "fr28", "fr29", "fr30", "fr31",       \
2870   "fr32", "fr33", "fr34", "fr35", "fr36", "fr37", "fr38", "fr39",       \
2871   "fr40", "fr41", "fr42", "fr43", "fr44", "fr45", "fr46", "fr47",       \
2872   "fr48", "fr49", "fr50", "fr51", "fr52", "fr53", "fr54", "fr55",       \
2873   "fr56", "fr57", "fr58", "fr59", "fr60", "fr61", "fr62", "fr63",       \
2874                                                                         \
2875   "fcc0", "fcc1", "fcc2", "fcc3", "icc0", "icc1", "icc2", "icc3",       \
2876   "cc0",  "cc1",  "cc2",  "cc3",  "cc4",  "cc5",  "cc6",  "cc7",        \
2877   "acc0", "acc1", "acc2", "acc3", "acc4", "acc5", "acc6", "acc7",       \
2878   "accg0","accg1","accg2","accg3","accg4","accg5","accg6","accg7",      \
2879   "ap",   "lr",   "lcr"                                                 \
2880 }
2881
2882 /* Define this macro if you are using an unusual assembler that
2883    requires different names for the machine instructions.
2884
2885    The definition is a C statement or statements which output an
2886    assembler instruction opcode to the stdio stream STREAM.  The
2887    macro-operand PTR is a variable of type `char *' which points to
2888    the opcode name in its "internal" form--the form that is written
2889    in the machine description.  The definition should output the
2890    opcode name to STREAM, performing any translation you desire, and
2891    increment the variable PTR to point at the end of the opcode so
2892    that it will not be output twice.
2893
2894    In fact, your macro definition may process less than the entire
2895    opcode name, or more than the opcode name; but if you want to
2896    process text that includes `%'-sequences to substitute operands,
2897    you must take care of the substitution yourself.  Just be sure to
2898    increment PTR over whatever text should not be output normally.
2899
2900    If you need to look at the operand values, they can be found as the
2901    elements of `recog_operand'.
2902
2903    If the macro definition does nothing, the instruction is output in
2904    the usual way.  */
2905
2906 #define ASM_OUTPUT_OPCODE(STREAM, PTR)\
2907    (PTR) = frv_asm_output_opcode (STREAM, PTR)
2908
2909 /* If defined, a C statement to be executed just prior to the output
2910    of assembler code for INSN, to modify the extracted operands so
2911    they will be output differently.
2912
2913    Here the argument OPVEC is the vector containing the operands
2914    extracted from INSN, and NOPERANDS is the number of elements of
2915    the vector which contain meaningful data for this insn.  The
2916    contents of this vector are what will be used to convert the insn
2917    template into assembler code, so you can change the assembler
2918    output by changing the contents of the vector.
2919
2920    This macro is useful when various assembler syntaxes share a single
2921    file of instruction patterns; by defining this macro differently,
2922    you can cause a large class of instructions to be output
2923    differently (such as with rearranged operands).  Naturally,
2924    variations in assembler syntax affecting individual insn patterns
2925    ought to be handled by writing conditional output routines in
2926    those patterns.
2927
2928    If this macro is not defined, it is equivalent to a null statement.  */
2929
2930 #define FINAL_PRESCAN_INSN(INSN, OPVEC, NOPERANDS)\
2931   frv_final_prescan_insn (INSN, OPVEC, NOPERANDS)
2932
2933
2934 /* A C compound statement to output to stdio stream STREAM the assembler syntax
2935    for an instruction operand X.  X is an RTL expression.
2936
2937    CODE is a value that can be used to specify one of several ways of printing
2938    the operand.  It is used when identical operands must be printed differently
2939    depending on the context.  CODE comes from the `%' specification that was
2940    used to request printing of the operand.  If the specification was just
2941    `%DIGIT' then CODE is 0; if the specification was `%LTR DIGIT' then CODE is
2942    the ASCII code for LTR.
2943
2944    If X is a register, this macro should print the register's name.  The names
2945    can be found in an array `reg_names' whose type is `char *[]'.  `reg_names'
2946    is initialized from `REGISTER_NAMES'.
2947
2948    When the machine description has a specification `%PUNCT' (a `%' followed by
2949    a punctuation character), this macro is called with a null pointer for X and
2950    the punctuation character for CODE.  */
2951 #define PRINT_OPERAND(STREAM, X, CODE) frv_print_operand (STREAM, X, CODE)
2952
2953 /* A C expression which evaluates to true if CODE is a valid punctuation
2954    character for use in the `PRINT_OPERAND' macro.  If
2955    `PRINT_OPERAND_PUNCT_VALID_P' is not defined, it means that no punctuation
2956    characters (except for the standard one, `%') are used in this way.  */
2957 /* . == gr0
2958    # == hint operand -- always zero for now
2959    @ == small data base register (gr16)
2960    ~ == pic register (gr17)
2961    * == temporary integer CCR register (cr3)
2962    & == temporary integer ICC register (icc3)  */
2963 #define PRINT_OPERAND_PUNCT_VALID_P(CODE)                               \
2964 ((CODE) == '.' || (CODE) == '#' || (CODE) == '@' || (CODE) == '~'       \
2965  || (CODE) == '*' || (CODE) == '&')
2966
2967 /* A C compound statement to output to stdio stream STREAM the assembler syntax
2968    for an instruction operand that is a memory reference whose address is X.  X
2969    is an RTL expression.
2970
2971    On some machines, the syntax for a symbolic address depends on the section
2972    that the address refers to.  On these machines, define the macro
2973    `ENCODE_SECTION_INFO' to store the information into the `symbol_ref', and
2974    then check for it here.
2975
2976    This declaration must be present.  */
2977 #define PRINT_OPERAND_ADDRESS(STREAM, X) frv_print_operand_address (STREAM, X)
2978
2979 /* If defined, C string expressions to be used for the `%R', `%L', `%U', and
2980    `%I' options of `asm_fprintf' (see `final.c').  These are useful when a
2981    single `md' file must support multiple assembler formats.  In that case, the
2982    various `tm.h' files can define these macros differently.
2983
2984    USER_LABEL_PREFIX is defined in svr4.h.  */
2985 #undef USER_LABEL_PREFIX
2986 #define USER_LABEL_PREFIX ""
2987 #define REGISTER_PREFIX ""
2988 #define LOCAL_LABEL_PREFIX "."
2989 #define IMMEDIATE_PREFIX "#"
2990
2991 \f
2992 /* Output of dispatch tables.  */
2993
2994 /* This macro should be provided on machines where the addresses in a dispatch
2995    table are relative to the table's own address.
2996
2997    The definition should be a C statement to output to the stdio stream STREAM
2998    an assembler pseudo-instruction to generate a difference between two labels.
2999    VALUE and REL are the numbers of two internal labels.  The definitions of
3000    these labels are output using `(*targetm.asm_out.internal_label)', and they must be
3001    printed in the same way here.  For example,
3002
3003         fprintf (STREAM, "\t.word L%d-L%d\n", VALUE, REL)  */
3004 #define ASM_OUTPUT_ADDR_DIFF_ELT(STREAM, BODY, VALUE, REL) \
3005 fprintf (STREAM, "\t.word .L%d-.L%d\n", VALUE, REL)
3006
3007 /* This macro should be provided on machines where the addresses in a dispatch
3008    table are absolute.
3009
3010    The definition should be a C statement to output to the stdio stream STREAM
3011    an assembler pseudo-instruction to generate a reference to a label.  VALUE
3012    is the number of an internal label whose definition is output using
3013    `(*targetm.asm_out.internal_label)'.  For example,
3014
3015         fprintf (STREAM, "\t.word L%d\n", VALUE)  */
3016 #define ASM_OUTPUT_ADDR_VEC_ELT(STREAM, VALUE) \
3017 fprintf (STREAM, "\t.word .L%d\n", VALUE)
3018
3019 /* Define this if the label before a jump-table needs to be output specially.
3020    The first three arguments are the same as for `(*targetm.asm_out.internal_label)';
3021    the fourth argument is the jump-table which follows (a `jump_insn'
3022    containing an `addr_vec' or `addr_diff_vec').
3023
3024    This feature is used on system V to output a `swbeg' statement for the
3025    table.
3026
3027    If this macro is not defined, these labels are output with
3028    `(*targetm.asm_out.internal_label)'.
3029
3030    Defined in svr4.h.  */
3031 /* When generating embedded PIC or mips16 code we want to put the jump
3032    table in the .text section.  In all other cases, we want to put the
3033    jump table in the .rdata section.  Unfortunately, we can't use
3034    JUMP_TABLES_IN_TEXT_SECTION, because it is not conditional.
3035    Instead, we use ASM_OUTPUT_CASE_LABEL to switch back to the .text
3036    section if appropriate.  */
3037
3038 #undef  ASM_OUTPUT_CASE_LABEL
3039 #define ASM_OUTPUT_CASE_LABEL(STREAM, PREFIX, NUM, TABLE)               \
3040 do {                                                                    \
3041   if (flag_pic)                                                         \
3042     function_section (current_function_decl);                           \
3043   (*targetm.asm_out.internal_label) (STREAM, PREFIX, NUM);                      \
3044 } while (0)
3045
3046 /* Define this to determine whether case statement labels are relative to
3047    the start of the case statement or not.  */
3048
3049 #define CASE_VECTOR_PC_RELATIVE (flag_pic)
3050
3051 \f
3052 /* Assembler Commands for Exception Regions.  */
3053
3054 /* Define this macro to 0 if your target supports DWARF 2 frame unwind
3055    information, but it does not yet work with exception handling.  Otherwise,
3056    if your target supports this information (if it defines
3057    `INCOMING_RETURN_ADDR_RTX' and either `UNALIGNED_INT_ASM_OP' or
3058    `OBJECT_FORMAT_ELF'), GCC will provide a default definition of 1.
3059
3060    If this macro is defined to 1, the DWARF 2 unwinder will be the default
3061    exception handling mechanism; otherwise, setjmp/longjmp will be used by
3062    default.
3063
3064    If this macro is defined to anything, the DWARF 2 unwinder will be used
3065    instead of inline unwinders and __unwind_function in the non-setjmp case.  */
3066 #define DWARF2_UNWIND_INFO 1
3067
3068 #define DWARF_FRAME_RETURN_COLUMN DWARF_FRAME_REGNUM (LR_REGNO)
3069 \f
3070 /* Assembler Commands for Alignment.  */
3071
3072 /* A C statement to output to the stdio stream STREAM an assembler instruction
3073    to advance the location counter by NBYTES bytes.  Those bytes should be zero
3074    when loaded.  NBYTES will be a C expression of type `int'.
3075
3076    Defined in svr4.h.  */
3077 #undef  ASM_OUTPUT_SKIP
3078 #define ASM_OUTPUT_SKIP(STREAM, NBYTES) \
3079   fprintf (STREAM, "\t.zero\t%u\n", (int)(NBYTES))
3080
3081 /* A C statement to output to the stdio stream STREAM an assembler command to
3082    advance the location counter to a multiple of 2 to the POWER bytes.  POWER
3083    will be a C expression of type `int'.  */
3084 #define ASM_OUTPUT_ALIGN(STREAM, POWER) \
3085   fprintf ((STREAM), "\t.p2align %d\n", (POWER))
3086
3087 \f
3088 /* Macros Affecting all Debug Formats.  */
3089
3090 /* A C expression that returns the DBX register number for the compiler
3091    register number REGNO.  In simple cases, the value of this expression may be
3092    REGNO itself.  But sometimes there are some registers that the compiler
3093    knows about and DBX does not, or vice versa.  In such cases, some register
3094    may need to have one number in the compiler and another for DBX.
3095
3096    If two registers have consecutive numbers inside GNU CC, and they can be
3097    used as a pair to hold a multiword value, then they *must* have consecutive
3098    numbers after renumbering with `DBX_REGISTER_NUMBER'.  Otherwise, debuggers
3099    will be unable to access such a pair, because they expect register pairs to
3100    be consecutive in their own numbering scheme.
3101
3102    If you find yourself defining `DBX_REGISTER_NUMBER' in way that does not
3103    preserve register pairs, then what you must do instead is redefine the
3104    actual register numbering scheme.
3105
3106    This declaration is required.  */
3107 #define DBX_REGISTER_NUMBER(REGNO) (REGNO)
3108
3109 /* A C expression that returns the type of debugging output GNU CC produces
3110    when the user specifies `-g' or `-ggdb'.  Define this if you have arranged
3111    for GNU CC to support more than one format of debugging output.  Currently,
3112    the allowable values are `DBX_DEBUG', `SDB_DEBUG', `DWARF_DEBUG',
3113    `DWARF2_DEBUG', and `XCOFF_DEBUG'.
3114
3115    The value of this macro only affects the default debugging output; the user
3116    can always get a specific type of output by using `-gstabs', `-gcoff',
3117    `-gdwarf-1', `-gdwarf-2', or `-gxcoff'.
3118
3119    Defined in svr4.h.  */
3120 #undef  PREFERRED_DEBUGGING_TYPE
3121 #define PREFERRED_DEBUGGING_TYPE DWARF2_DEBUG
3122 \f
3123 /* Miscellaneous Parameters.  */
3124
3125 /* Define this if you have defined special-purpose predicates in the file
3126    `MACHINE.c'.  This macro is called within an initializer of an array of
3127    structures.  The first field in the structure is the name of a predicate and
3128    the second field is an array of rtl codes.  For each predicate, list all rtl
3129    codes that can be in expressions matched by the predicate.  The list should
3130    have a trailing comma.  Here is an example of two entries in the list for a
3131    typical RISC machine:
3132
3133         #define PREDICATE_CODES \
3134           {"gen_reg_rtx_operand", {SUBREG, REG}},  \
3135           {"reg_or_short_cint_operand", {SUBREG, REG, CONST_INT}},
3136
3137    Defining this macro does not affect the generated code (however, incorrect
3138    definitions that omit an rtl code that may be matched by the predicate can
3139    cause the compiler to malfunction).  Instead, it allows the table built by
3140    `genrecog' to be more compact and efficient, thus speeding up the compiler.
3141    The most important predicates to include in the list specified by this macro
3142    are thoses used in the most insn patterns.  */
3143 #define PREDICATE_CODES                                                 \
3144   { "integer_register_operand",         { REG, SUBREG }},               \
3145   { "frv_load_operand",                 { REG, SUBREG, MEM }},          \
3146   { "gpr_no_subreg_operand",            { REG }},                       \
3147   { "gpr_or_fpr_operand",               { REG, SUBREG }},               \
3148   { "gpr_or_int12_operand",             { REG, SUBREG, CONST_INT }},    \
3149   { "gpr_fpr_or_int12_operand",         { REG, SUBREG, CONST_INT }},    \
3150   { "gpr_or_int10_operand",             { REG, SUBREG, CONST_INT }},    \
3151   { "gpr_or_int_operand",               { REG, SUBREG, CONST_INT }},    \
3152   { "move_source_operand",              { REG, SUBREG, CONST_INT, MEM,  \
3153                                           CONST_DOUBLE, CONST,          \
3154                                           SYMBOL_REF, LABEL_REF }},     \
3155   { "move_destination_operand",         { REG, SUBREG, MEM }},          \
3156   { "condexec_source_operand",          { REG, SUBREG, CONST_INT, MEM,  \
3157                                           CONST_DOUBLE }},              \
3158   { "condexec_dest_operand",            { REG, SUBREG, MEM }},          \
3159   { "reg_or_0_operand",                 { REG, SUBREG, CONST_INT }},    \
3160   { "lr_operand",                       { REG }},                       \
3161   { "gpr_or_memory_operand",            { REG, SUBREG, MEM }},          \
3162   { "fpr_or_memory_operand",            { REG, SUBREG, MEM }},          \
3163   { "int12_operand",                    { CONST_INT }},                 \
3164   { "int_2word_operand",                { CONST_INT, CONST_DOUBLE,      \
3165                                           SYMBOL_REF, LABEL_REF, CONST }}, \
3166   { "pic_register_operand",             { REG }},                       \
3167   { "pic_symbolic_operand",             { SYMBOL_REF, LABEL_REF, CONST }}, \
3168   { "small_data_register_operand",      { REG }},                       \
3169   { "small_data_symbolic_operand",      { SYMBOL_REF, CONST }},         \
3170   { "icc_operand",                      { REG }},                       \
3171   { "fcc_operand",                      { REG }},                       \
3172   { "cc_operand",                       { REG }},                       \
3173   { "icr_operand",                      { REG }},                       \
3174   { "fcr_operand",                      { REG }},                       \
3175   { "cr_operand",                       { REG }},                       \
3176   { "fpr_operand",                      { REG, SUBREG }},               \
3177   { "even_reg_operand",                 { REG, SUBREG }},               \
3178   { "odd_reg_operand",                  { REG, SUBREG }},               \
3179   { "even_gpr_operand",                 { REG, SUBREG }},               \
3180   { "odd_gpr_operand",                  { REG, SUBREG }},               \
3181   { "quad_fpr_operand",                 { REG, SUBREG }},               \
3182   { "even_fpr_operand",                 { REG, SUBREG }},               \
3183   { "odd_fpr_operand",                  { REG, SUBREG }},               \
3184   { "dbl_memory_one_insn_operand",      { MEM }},                       \
3185   { "dbl_memory_two_insn_operand",      { MEM }},                       \
3186   { "call_operand",                     { REG, SUBREG, PLUS, CONST_INT, \
3187                                           SYMBOL_REF, LABEL_REF, CONST }}, \
3188   { "upper_int16_operand",              { CONST_INT }},                 \
3189   { "uint16_operand",                   { CONST_INT }},                 \
3190   { "relational_operator",              { EQ, NE, LE, LT, GE, GT,       \
3191                                           LEU, LTU, GEU, GTU }},        \
3192   { "signed_relational_operator",       { EQ, NE, LE, LT, GE, GT }},    \
3193   { "unsigned_relational_operator",     { LEU, LTU, GEU, GTU }},        \
3194   { "float_relational_operator",        { EQ, NE, LE, LT, GE, GT }},    \
3195   { "ccr_eqne_operator",                { EQ, NE }},                    \
3196   { "minmax_operator",                  { SMIN, SMAX, UMIN, UMAX }},    \
3197   { "condexec_si_binary_operator",      { PLUS, MINUS, AND, IOR, XOR,   \
3198                                           ASHIFT, ASHIFTRT, LSHIFTRT }}, \
3199   { "condexec_si_divide_operator",      { DIV, UDIV }},                 \
3200   { "condexec_si_unary_operator",       { NOT, NEG }},                  \
3201   { "condexec_sf_binary_operator",      { PLUS, MINUS, MULT, DIV }},    \
3202   { "condexec_sf_unary_operator",       { ABS, NEG, SQRT }},            \
3203   { "intop_compare_operator",           { PLUS, MINUS, AND, IOR, XOR,   \
3204                                           ASHIFT, ASHIFTRT, LSHIFTRT }}, \
3205   { "condexec_intop_cmp_operator",      { PLUS, MINUS, AND, IOR, XOR,   \
3206                                           ASHIFT, ASHIFTRT, LSHIFTRT }}, \
3207   { "fpr_or_int6_operand",              { REG, SUBREG, CONST_INT }},    \
3208   { "int6_operand",                     { CONST_INT }},                 \
3209   { "int5_operand",                     { CONST_INT }},                 \
3210   { "uint5_operand",                    { CONST_INT }},                 \
3211   { "uint4_operand",                    { CONST_INT }},                 \
3212   { "uint1_operand",                    { CONST_INT }},                 \
3213   { "acc_operand",                      { REG, SUBREG }},               \
3214   { "even_acc_operand",                 { REG, SUBREG }},               \
3215   { "quad_acc_operand",                 { REG, SUBREG }},               \
3216   { "accg_operand",                     { REG, SUBREG }},
3217
3218 /* An alias for a machine mode name.  This is the machine mode that elements of
3219    a jump-table should have.  */
3220 #define CASE_VECTOR_MODE SImode
3221
3222 /* Define this macro if operations between registers with integral mode smaller
3223    than a word are always performed on the entire register.  Most RISC machines
3224    have this property and most CISC machines do not.  */
3225 #define WORD_REGISTER_OPERATIONS
3226
3227 /* Define this macro to be a C expression indicating when insns that read
3228    memory in MODE, an integral mode narrower than a word, set the bits outside
3229    of MODE to be either the sign-extension or the zero-extension of the data
3230    read.  Return `SIGN_EXTEND' for values of MODE for which the insn
3231    sign-extends, `ZERO_EXTEND' for which it zero-extends, and `NIL' for other
3232    modes.
3233
3234    This macro is not called with MODE non-integral or with a width greater than
3235    or equal to `BITS_PER_WORD', so you may return any value in this case.  Do
3236    not define this macro if it would always return `NIL'.  On machines where
3237    this macro is defined, you will normally define it as the constant
3238    `SIGN_EXTEND' or `ZERO_EXTEND'.  */
3239 #define LOAD_EXTEND_OP(MODE) SIGN_EXTEND
3240
3241 /* Define if loading short immediate values into registers sign extends.  */
3242 #define SHORT_IMMEDIATES_SIGN_EXTEND
3243
3244 /* The maximum number of bytes that a single instruction can move quickly from
3245    memory to memory.  */
3246 #define MOVE_MAX 8
3247
3248 /* A C expression which is nonzero if on this machine it is safe to "convert"
3249    an integer of INPREC bits to one of OUTPREC bits (where OUTPREC is smaller
3250    than INPREC) by merely operating on it as if it had only OUTPREC bits.
3251
3252    On many machines, this expression can be 1.
3253
3254    When `TRULY_NOOP_TRUNCATION' returns 1 for a pair of sizes for modes for
3255    which `MODES_TIEABLE_P' is 0, suboptimal code can result.  If this is the
3256    case, making `TRULY_NOOP_TRUNCATION' return 0 in such cases may improve
3257    things.  */
3258 #define TRULY_NOOP_TRUNCATION(OUTPREC, INPREC) 1
3259
3260 /* An alias for the machine mode for pointers.  On most machines, define this
3261    to be the integer mode corresponding to the width of a hardware pointer;
3262    `SImode' on 32-bit machine or `DImode' on 64-bit machines.  On some machines
3263    you must define this to be one of the partial integer modes, such as
3264    `PSImode'.
3265
3266    The width of `Pmode' must be at least as large as the value of
3267    `POINTER_SIZE'.  If it is not equal, you must define the macro
3268    `POINTERS_EXTEND_UNSIGNED' to specify how pointers are extended to `Pmode'.  */
3269 #define Pmode SImode
3270
3271 /* An alias for the machine mode used for memory references to functions being
3272    called, in `call' RTL expressions.  On most machines this should be
3273    `QImode'.  */
3274 #define FUNCTION_MODE QImode
3275
3276 /* Define this macro to handle System V style pragmas: #pragma pack and
3277    #pragma weak.  Note, #pragma weak will only be supported if SUPPORT_WEAK is
3278    defined.
3279
3280    Defined in svr4.h.  */
3281 #define HANDLE_SYSV_PRAGMA 1
3282
3283 /* A C expression for the maximum number of instructions to execute via
3284    conditional execution instructions instead of a branch.  A value of
3285    BRANCH_COST+1 is the default if the machine does not use
3286    cc0, and 1 if it does use cc0.  */
3287 #define MAX_CONDITIONAL_EXECUTE frv_condexec_insns
3288
3289 /* Default value of MAX_CONDITIONAL_EXECUTE if no -mcond-exec-insns= */
3290 #define DEFAULT_CONDEXEC_INSNS 8
3291
3292 /* A C expression to modify the code described by the conditional if
3293    information CE_INFO, possibly updating the tests in TRUE_EXPR, and
3294    FALSE_EXPR for converting if-then and if-then-else code to conditional
3295    instructions.  Set either TRUE_EXPR or FALSE_EXPR to a null pointer if the
3296    tests cannot be converted.  */
3297 #define IFCVT_MODIFY_TESTS(CE_INFO, TRUE_EXPR, FALSE_EXPR)              \
3298 frv_ifcvt_modify_tests (CE_INFO, &TRUE_EXPR, &FALSE_EXPR)
3299
3300 /* A C expression to modify the code described by the conditional if
3301    information CE_INFO, for the basic block BB, possibly updating the tests in
3302    TRUE_EXPR, and FALSE_EXPR for converting the && and || parts of if-then or
3303    if-then-else code to conditional instructions.  OLD_TRUE and OLD_FALSE are
3304    the previous tests.  Set either TRUE_EXPR or FALSE_EXPR to a null pointer if
3305    the tests cannot be converted.  */
3306 #define IFCVT_MODIFY_MULTIPLE_TESTS(CE_INFO, BB, TRUE_EXPR, FALSE_EXPR) \
3307 frv_ifcvt_modify_multiple_tests (CE_INFO, BB, &TRUE_EXPR, &FALSE_EXPR)
3308
3309 /* A C expression to modify the code described by the conditional if
3310    information CE_INFO with the new PATTERN in INSN.  If PATTERN is a null
3311    pointer after the IFCVT_MODIFY_INSN macro executes, it is assumed that that
3312    insn cannot be converted to be executed conditionally.  */
3313 #define IFCVT_MODIFY_INSN(CE_INFO, PATTERN, INSN) \
3314 (PATTERN) = frv_ifcvt_modify_insn (CE_INFO, PATTERN, INSN)
3315
3316 /* A C expression to perform any final machine dependent modifications in
3317    converting code to conditional execution in the code described by the
3318    conditional if information CE_INFO.  */
3319 #define IFCVT_MODIFY_FINAL(CE_INFO) frv_ifcvt_modify_final (CE_INFO)
3320
3321 /* A C expression to cancel any machine dependent modifications in converting
3322    code to conditional execution in the code described by the conditional if
3323    information CE_INFO.  */
3324 #define IFCVT_MODIFY_CANCEL(CE_INFO) frv_ifcvt_modify_cancel (CE_INFO)
3325
3326 /* Initialize the extra fields provided by IFCVT_EXTRA_FIELDS.  */
3327 #define IFCVT_INIT_EXTRA_FIELDS(CE_INFO) frv_ifcvt_init_extra_fields (CE_INFO)
3328
3329 /* Indicate how many instructions can be issued at the same time.  */
3330 #define ISSUE_RATE                                                      \
3331 (! TARGET_PACK ? 1                                                      \
3332  : (frv_cpu_type == FRV_CPU_GENERIC                                     \
3333     || frv_cpu_type == FRV_CPU_FR500                                    \
3334     || frv_cpu_type == FRV_CPU_TOMCAT) ? 4                              \
3335  : frv_cpu_type == FRV_CPU_FR400 ? 2 : 1)
3336
3337 /* Set and clear whether this insn begins a VLIW insn.  */
3338 #define CLEAR_VLIW_START(INSN) PUT_MODE (INSN, VOIDmode)
3339 #define SET_VLIW_START(INSN) PUT_MODE (INSN, TImode)
3340
3341 /* The definition of the following macro results in that the 2nd jump
3342    optimization (after the 2nd insn scheduling) is minimal.  It is
3343    necessary to define when start cycle marks of insns (TImode is used
3344    for this) is used for VLIW insn packing.  Some jump optimizations
3345    make such marks invalid.  These marks are corrected for some
3346    (minimal) optimizations.  ??? Probably the macro is temporary.
3347    Final solution could making the 2nd jump optimizations before the
3348    2nd instruction scheduling or corrections of the marks for all jump
3349    optimizations.  Although some jump optimizations are actually
3350    deoptimizations for VLIW (super-scalar) processors.  */
3351
3352 #define MINIMAL_SECOND_JUMP_OPTIMIZATION
3353
3354 /* Return true if parallel operations are expected to be emitted via the
3355    packing flag.  */
3356 #define PACKING_FLAG_USED_P() \
3357 (optimize && flag_schedule_insns_after_reload && ISSUE_RATE > 1)
3358
3359 /* If the following macro is defined and nonzero and deterministic
3360    finite state automata are used for pipeline hazard recognition, the
3361    code making resource-constrained software pipelining is on.  */
3362 #define RCSP_SOFTWARE_PIPELINING 1
3363
3364 /* If the following macro is defined and nonzero and deterministic
3365    finite state automata are used for pipeline hazard recognition, we
3366    will try to exchange insns in queue ready to improve the schedule.
3367    The more macro value, the more tries will be made.  */
3368 #define FIRST_CYCLE_MULTIPASS_SCHEDULING 1
3369
3370 /* The following macro is used only when value of
3371    FIRST_CYCLE_MULTIPASS_SCHEDULING is nonzero.  The more macro value,
3372    the more tries will be made to choose better schedule.  If the
3373    macro value is zero or negative there will be no multi-pass
3374    scheduling.  */
3375 #define FIRST_CYCLE_MULTIPASS_SCHEDULING_LOOKAHEAD frv_sched_lookahead
3376
3377 enum frv_builtins
3378 {
3379   FRV_BUILTIN_MAND,
3380   FRV_BUILTIN_MOR,
3381   FRV_BUILTIN_MXOR,
3382   FRV_BUILTIN_MNOT,
3383   FRV_BUILTIN_MAVEH,
3384   FRV_BUILTIN_MSATHS,
3385   FRV_BUILTIN_MSATHU,
3386   FRV_BUILTIN_MADDHSS,
3387   FRV_BUILTIN_MADDHUS,
3388   FRV_BUILTIN_MSUBHSS,
3389   FRV_BUILTIN_MSUBHUS,
3390   FRV_BUILTIN_MPACKH,
3391   FRV_BUILTIN_MQADDHSS,
3392   FRV_BUILTIN_MQADDHUS,
3393   FRV_BUILTIN_MQSUBHSS,
3394   FRV_BUILTIN_MQSUBHUS,
3395   FRV_BUILTIN_MUNPACKH,
3396   FRV_BUILTIN_MDPACKH,
3397   FRV_BUILTIN_MBTOH,
3398   FRV_BUILTIN_MHTOB,
3399   FRV_BUILTIN_MCOP1,
3400   FRV_BUILTIN_MCOP2,
3401   FRV_BUILTIN_MROTLI,
3402   FRV_BUILTIN_MROTRI,
3403   FRV_BUILTIN_MWCUT,
3404   FRV_BUILTIN_MSLLHI,
3405   FRV_BUILTIN_MSRLHI,
3406   FRV_BUILTIN_MSRAHI,
3407   FRV_BUILTIN_MEXPDHW,
3408   FRV_BUILTIN_MEXPDHD,
3409   FRV_BUILTIN_MMULHS,
3410   FRV_BUILTIN_MMULHU,
3411   FRV_BUILTIN_MMULXHS,
3412   FRV_BUILTIN_MMULXHU,
3413   FRV_BUILTIN_MMACHS,
3414   FRV_BUILTIN_MMACHU,
3415   FRV_BUILTIN_MMRDHS,
3416   FRV_BUILTIN_MMRDHU,
3417   FRV_BUILTIN_MQMULHS,
3418   FRV_BUILTIN_MQMULHU,
3419   FRV_BUILTIN_MQMULXHU,
3420   FRV_BUILTIN_MQMULXHS,
3421   FRV_BUILTIN_MQMACHS,
3422   FRV_BUILTIN_MQMACHU,
3423   FRV_BUILTIN_MCPXRS,
3424   FRV_BUILTIN_MCPXRU,
3425   FRV_BUILTIN_MCPXIS,
3426   FRV_BUILTIN_MCPXIU,
3427   FRV_BUILTIN_MQCPXRS,
3428   FRV_BUILTIN_MQCPXRU,
3429   FRV_BUILTIN_MQCPXIS,
3430   FRV_BUILTIN_MQCPXIU,
3431   FRV_BUILTIN_MCUT,
3432   FRV_BUILTIN_MCUTSS,
3433   FRV_BUILTIN_MWTACC,
3434   FRV_BUILTIN_MWTACCG,
3435   FRV_BUILTIN_MRDACC,
3436   FRV_BUILTIN_MRDACCG,
3437   FRV_BUILTIN_MTRAP,
3438   FRV_BUILTIN_MCLRACC,
3439   FRV_BUILTIN_MCLRACCA,
3440   FRV_BUILTIN_MDUNPACKH,
3441   FRV_BUILTIN_MBTOHE,
3442   FRV_BUILTIN_MQXMACHS,
3443   FRV_BUILTIN_MQXMACXHS,
3444   FRV_BUILTIN_MQMACXHS,
3445   FRV_BUILTIN_MADDACCS,
3446   FRV_BUILTIN_MSUBACCS,
3447   FRV_BUILTIN_MASACCS,
3448   FRV_BUILTIN_MDADDACCS,
3449   FRV_BUILTIN_MDSUBACCS,
3450   FRV_BUILTIN_MDASACCS,
3451   FRV_BUILTIN_MABSHS,
3452   FRV_BUILTIN_MDROTLI,
3453   FRV_BUILTIN_MCPLHI,
3454   FRV_BUILTIN_MCPLI,
3455   FRV_BUILTIN_MDCUTSSI,
3456   FRV_BUILTIN_MQSATHS,
3457   FRV_BUILTIN_MHSETLOS,
3458   FRV_BUILTIN_MHSETLOH,
3459   FRV_BUILTIN_MHSETHIS,
3460   FRV_BUILTIN_MHSETHIH,
3461   FRV_BUILTIN_MHDSETS,
3462   FRV_BUILTIN_MHDSETH
3463 };
3464
3465 /* Enable prototypes on the call rtl functions.  */
3466 #define MD_CALL_PROTOTYPES 1
3467
3468 extern GTY(()) rtx frv_compare_op0;                     /* operand save for */
3469 extern GTY(()) rtx frv_compare_op1;                     /* comparison generation */
3470
3471 #endif /* __FRV_H__ */