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