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