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