00001 /* Target macros for the FRV port of GCC. 00002 Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005 00003 Free Software Foundation, Inc. 00004 Contributed by Red Hat Inc. 00005 00006 This file is part of GCC. 00007 00008 GCC is free software; you can redistribute it and/or modify it 00009 under the terms of the GNU General Public License as published 00010 by the Free Software Foundation; either version 2, or (at your 00011 option) any later version. 00012 00013 GCC is distributed in the hope that it will be useful, but WITHOUT 00014 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY 00015 or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public 00016 License for more details. 00017 00018 You should have received a copy of the GNU General Public License 00019 along with GCC; see the file COPYING. If not, write to the Free 00020 Software Foundation, 59 Temple Place - Suite 330, Boston, MA 00021 02111-1307, USA. */ 00022 00023 #ifndef __FRV_H__ 00024 #define __FRV_H__ 00025 00026 /* Frv general purpose macros. */ 00027 /* Align an address. */ 00028 #define ADDR_ALIGN(addr,align) (((addr) + (align) - 1) & ~((align) - 1)) 00029 00030 /* Return true if a value is inside a range. */ 00031 #define IN_RANGE_P(VALUE, LOW, HIGH) \ 00032 ( (((HOST_WIDE_INT)(VALUE)) >= (HOST_WIDE_INT)(LOW)) \ 00033 && (((HOST_WIDE_INT)(VALUE)) <= ((HOST_WIDE_INT)(HIGH)))) 00034 00035 00036 /* Driver configuration. */ 00037 00038 /* A C expression which determines whether the option `-CHAR' takes arguments. 00039 The value should be the number of arguments that option takes-zero, for many 00040 options. 00041 00042 By default, this macro is defined to handle the standard options properly. 00043 You need not define it unless you wish to add additional options which take 00044 arguments. 00045 00046 Defined in svr4.h. */ 00047 #undef SWITCH_TAKES_ARG 00048 #define SWITCH_TAKES_ARG(CHAR) \ 00049 (DEFAULT_SWITCH_TAKES_ARG (CHAR) || (CHAR) == 'G') 00050 00051 /* A C expression which determines whether the option `-NAME' takes arguments. 00052 The value should be the number of arguments that option takes-zero, for many 00053 options. This macro rather than `SWITCH_TAKES_ARG' is used for 00054 multi-character option names. 00055 00056 By default, this macro is defined as `DEFAULT_WORD_SWITCH_TAKES_ARG', which 00057 handles the standard options properly. You need not define 00058 `WORD_SWITCH_TAKES_ARG' unless you wish to add additional options which take 00059 arguments. Any redefinition should call `DEFAULT_WORD_SWITCH_TAKES_ARG' and 00060 then check for additional options. 00061 00062 Defined in svr4.h. */ 00063 #undef WORD_SWITCH_TAKES_ARG 00064 00065 /* -fpic and -fPIC used to imply the -mlibrary-pic multilib, but with 00066 FDPIC which multilib to use depends on whether FDPIC is in use or 00067 not. The trick we use is to introduce -multilib-library-pic as a 00068 pseudo-flag that selects the library-pic multilib, and map fpic 00069 and fPIC to it only if fdpic is not selected. Also, if fdpic is 00070 selected and no PIC/PIE options are present, we imply -fPIE. 00071 Otherwise, if -fpic or -fPIC are enabled and we're optimizing for 00072 speed, or if we have -On with n>=3, enable inlining of PLTs. As 00073 for -mgprel-ro, we want to enable it by default, but not for -fpic or 00074 -fpie. */ 00075 00076 #define DRIVER_SELF_SPECS SUBTARGET_DRIVER_SELF_SPECS \ 00077 "%{mno-pack:\ 00078 %{!mhard-float:-msoft-float}\ 00079 %{!mmedia:-mno-media}}\ 00080 %{!mfdpic:%{fpic|fPIC: -multilib-library-pic}}\ 00081 %{mfdpic:%{!fpic:%{!fpie:%{!fPIC:%{!fPIE:\ 00082 %{!fno-pic:%{!fno-pie:%{!fno-PIC:%{!fno-PIE:-fPIE}}}}}}}} \ 00083 %{!mno-inline-plt:%{O*:%{!O0:%{!Os:%{fpic|fPIC:-minline-plt} \ 00084 %{!fpic:%{!fPIC:%{!O:%{!O1:%{!O2:-minline-plt}}}}}}}}} \ 00085 %{!mno-gprel-ro:%{!fpic:%{!fpie:-mgprel-ro}}}} \ 00086 " 00087 #ifndef SUBTARGET_DRIVER_SELF_SPECS 00088 # define SUBTARGET_DRIVER_SELF_SPECS 00089 #endif 00090 00091 /* A C string constant that tells the GCC driver program options to pass to 00092 the assembler. It can also specify how to translate options you give to GNU 00093 CC into options for GCC to pass to the assembler. See the file `sun3.h' 00094 for an example of this. 00095 00096 Do not define this macro if it does not need to do anything. 00097 00098 Defined in svr4.h. */ 00099 #undef ASM_SPEC 00100 #define ASM_SPEC "\ 00101 %{G*} %{v} %{n} %{T} %{Ym,*} %{Yd,*} %{Wa,*:%*} \ 00102 %{mtomcat-stats} \ 00103 %{!mno-eflags: \ 00104 %{mcpu=*} \ 00105 %{mgpr-*} %{mfpr-*} \ 00106 %{msoft-float} %{mhard-float} \ 00107 %{mdword} %{mno-dword} \ 00108 %{mdouble} %{mno-double} \ 00109 %{mmedia} %{mno-media} \ 00110 %{mmuladd} %{mno-muladd} \ 00111 %{mpack} %{mno-pack} \ 00112 %{mno-fdpic:-mnopic} %{mfdpic} \ 00113 %{fpic|fpie: -mpic} %{fPIC|fPIE: -mPIC} %{mlibrary-pic}}" 00114 00115 /* Another C string constant used much like `LINK_SPEC'. The difference 00116 between the two is that `STARTFILE_SPEC' is used at the very beginning of 00117 the command given to the linker. 00118 00119 If this macro is not defined, a default is provided that loads the standard 00120 C startup file from the usual place. See `gcc.c'. 00121 00122 Defined in svr4.h. */ 00123 #undef STARTFILE_SPEC 00124 #define STARTFILE_SPEC "crt0%O%s frvbegin%O%s" 00125 00126 /* Another C string constant used much like `LINK_SPEC'. The difference 00127 between the two is that `ENDFILE_SPEC' is used at the very end of the 00128 command given to the linker. 00129 00130 Do not define this macro if it does not need to do anything. 00131 00132 Defined in svr4.h. */ 00133 #undef ENDFILE_SPEC 00134 #define ENDFILE_SPEC "frvend%O%s" 00135 00136 00137 #define MASK_DEFAULT_FRV \ 00138 (MASK_MEDIA \ 00139 | MASK_DOUBLE \ 00140 | MASK_MULADD \ 00141 | MASK_DWORD \ 00142 | MASK_PACK) 00143 00144 #define MASK_DEFAULT_FR500 \ 00145 (MASK_MEDIA | MASK_DWORD | MASK_PACK) 00146 00147 #define MASK_DEFAULT_FR550 \ 00148 (MASK_MEDIA | MASK_DWORD | MASK_PACK) 00149 00150 #define MASK_DEFAULT_FR450 \ 00151 (MASK_GPR_32 \ 00152 | MASK_FPR_32 \ 00153 | MASK_MEDIA \ 00154 | MASK_SOFT_FLOAT \ 00155 | MASK_DWORD \ 00156 | MASK_PACK) 00157 00158 #define MASK_DEFAULT_FR400 \ 00159 (MASK_GPR_32 \ 00160 | MASK_FPR_32 \ 00161 | MASK_MEDIA \ 00162 | MASK_ACC_4 \ 00163 | MASK_SOFT_FLOAT \ 00164 | MASK_DWORD \ 00165 | MASK_PACK) 00166 00167 #define MASK_DEFAULT_SIMPLE \ 00168 (MASK_GPR_32 | MASK_SOFT_FLOAT) 00169 00170 /* A C string constant that tells the GCC driver program options to pass to 00171 `cc1'. It can also specify how to translate options you give to GCC into 00172 options for GCC to pass to the `cc1'. 00173 00174 Do not define this macro if it does not need to do anything. */ 00175 /* For ABI compliance, we need to put bss data into the normal data section. */ 00176 #define CC1_SPEC "%{G*}" 00177 00178 /* A C string constant that tells the GCC driver program options to pass to 00179 the linker. It can also specify how to translate options you give to GCC 00180 into options for GCC to pass to the linker. 00181 00182 Do not define this macro if it does not need to do anything. 00183 00184 Defined in svr4.h. */ 00185 /* Override the svr4.h version with one that dispenses without the svr4 00186 shared library options, notably -G. */ 00187 #undef LINK_SPEC 00188 #define LINK_SPEC "\ 00189 %{h*} %{v:-V} \ 00190 %{b} %{Wl,*:%*} \ 00191 %{mfdpic:-melf32frvfd -z text} \ 00192 %{static:-dn -Bstatic} \ 00193 %{shared:-Bdynamic} \ 00194 %{symbolic:-Bsymbolic} \ 00195 %{G*} \ 00196 %{YP,*} \ 00197 %{Qy:} %{!Qn:-Qy}" 00198 00199 /* Another C string constant used much like `LINK_SPEC'. The difference 00200 between the two is that `LIB_SPEC' is used at the end of the command given 00201 to the linker. 00202 00203 If this macro is not defined, a default is provided that loads the standard 00204 C library from the usual place. See `gcc.c'. 00205 00206 Defined in svr4.h. */ 00207 00208 #undef LIB_SPEC 00209 #define LIB_SPEC "--start-group -lc -lsim --end-group" 00210 00211 #ifndef CPU_TYPE 00212 #define CPU_TYPE FRV_CPU_FR500 00213 #endif 00214 00215 /* Allow us to easily change the default for -malloc-cc. */ 00216 #ifndef DEFAULT_NO_ALLOC_CC 00217 #define MASK_DEFAULT_ALLOC_CC MASK_ALLOC_CC 00218 #else 00219 #define MASK_DEFAULT_ALLOC_CC 0 00220 #endif 00221 00222 /* Run-time target specifications */ 00223 00224 #define TARGET_CPU_CPP_BUILTINS() \ 00225 do \ 00226 { \ 00227 int issue_rate; \ 00228 \ 00229 builtin_define ("__frv__"); \ 00230 builtin_assert ("machine=frv"); \ 00231 \ 00232 issue_rate = frv_issue_rate (); \ 00233 if (issue_rate > 1) \ 00234 builtin_define_with_int_value ("__FRV_VLIW__", issue_rate); \ 00235 builtin_define_with_int_value ("__FRV_GPR__", NUM_GPRS); \ 00236 builtin_define_with_int_value ("__FRV_FPR__", NUM_FPRS); \ 00237 builtin_define_with_int_value ("__FRV_ACC__", NUM_ACCS); \ 00238 \ 00239 switch (frv_cpu_type) \ 00240 { \ 00241 case FRV_CPU_GENERIC: \ 00242 builtin_define ("__CPU_GENERIC__"); \ 00243 break; \ 00244 case FRV_CPU_FR550: \ 00245 builtin_define ("__CPU_FR550__"); \ 00246 break; \ 00247 case FRV_CPU_FR500: \ 00248 case FRV_CPU_TOMCAT: \ 00249 builtin_define ("__CPU_FR500__"); \ 00250 break; \ 00251 case FRV_CPU_FR450: \ 00252 builtin_define ("__CPU_FR450__"); \ 00253 break; \ 00254 case FRV_CPU_FR405: \ 00255 builtin_define ("__CPU_FR405__"); \ 00256 break; \ 00257 case FRV_CPU_FR400: \ 00258 builtin_define ("__CPU_FR400__"); \ 00259 break; \ 00260 case FRV_CPU_FR300: \ 00261 case FRV_CPU_SIMPLE: \ 00262 builtin_define ("__CPU_FR300__"); \ 00263 break; \ 00264 } \ 00265 \ 00266 if (TARGET_HARD_FLOAT) \ 00267 builtin_define ("__FRV_HARD_FLOAT__"); \ 00268 if (TARGET_DWORD) \ 00269 builtin_define ("__FRV_DWORD__"); \ 00270 if (TARGET_FDPIC) \ 00271 builtin_define ("__FRV_FDPIC__"); \ 00272 if (flag_leading_underscore > 0) \ 00273 builtin_define ("__FRV_UNDERSCORE__"); \ 00274 } \ 00275 while (0) 00276 00277 00278 /* This declaration should be present. */ 00279 extern int target_flags; 00280 00281 /* This series of macros is to allow compiler command arguments to enable or 00282 disable the use of optional features of the target machine. For example, 00283 one machine description serves both the 68000 and the 68020; a command 00284 argument tells the compiler whether it should use 68020-only instructions or 00285 not. This command argument works by means of a macro `TARGET_68020' that 00286 tests a bit in `target_flags'. 00287 00288 Define a macro `TARGET_FEATURENAME' for each such option. Its definition 00289 should test a bit in `target_flags'; for example: 00290 00291 #define TARGET_68020 (target_flags & 1) 00292 00293 One place where these macros are used is in the condition-expressions of 00294 instruction patterns. Note how `TARGET_68020' appears frequently in the 00295 68000 machine description file, `m68k.md'. Another place they are used is 00296 in the definitions of the other macros in the `MACHINE.h' file. */ 00297 00298 #define MASK_GPR_32 0x00000001 /* Limit gprs to 32 registers */ 00299 #define MASK_FPR_32 0x00000002 /* Limit fprs to 32 registers */ 00300 #define MASK_SOFT_FLOAT 0x00000004 /* Use software floating point */ 00301 #define MASK_ALLOC_CC 0x00000008 /* Dynamically allocate icc/fcc's */ 00302 #define MASK_DWORD 0x00000010 /* Change ABi to allow dbl word insns*/ 00303 #define MASK_DOUBLE 0x00000020 /* Use double precision instructions */ 00304 #define MASK_MEDIA 0x00000040 /* Use media instructions */ 00305 #define MASK_MULADD 0x00000080 /* Use multiply add/subtract insns */ 00306 #define MASK_LIBPIC 0x00000100 /* -fpic that can be linked w/o pic */ 00307 #define MASK_ACC_4 0x00000200 /* Only use four media accumulators */ 00308 #define MASK_PACK 0x00000400 /* Set to enable packed output */ 00309 #define MASK_LONG_CALLS 0x00000800 /* Use indirect calls */ 00310 #define MASK_ALIGN_LABELS 0x00001000 /* Optimize label alignments */ 00311 #define MASK_LINKED_FP 0x00002000 /* Follow ABI linkage requirements. */ 00312 #define MASK_BIG_TLS 0x00008000 /* Assume a big TLS segment */ 00313 00314 /* put debug masks up high */ 00315 #define MASK_DEBUG_ARG 0x40000000 /* debug argument handling */ 00316 #define MASK_DEBUG_ADDR 0x20000000 /* debug go_if_legitimate_address */ 00317 #define MASK_DEBUG_STACK 0x10000000 /* debug stack frame */ 00318 #define MASK_DEBUG 0x08000000 /* general debugging switch */ 00319 #define MASK_DEBUG_LOC 0x04000000 /* optimize line # table */ 00320 #define MASK_DEBUG_COND_EXEC 0x02000000 /* debug cond exec code */ 00321 #define MASK_NO_COND_MOVE 0x01000000 /* disable conditional moves */ 00322 #define MASK_NO_SCC 0x00800000 /* disable set conditional codes */ 00323 #define MASK_NO_COND_EXEC 0x00400000 /* disable conditional execution */ 00324 #define MASK_NO_VLIW_BRANCH 0x00200000 /* disable repacking branches */ 00325 #define MASK_NO_MULTI_CE 0x00100000 /* disable multi-level cond exec */ 00326 #define MASK_NO_NESTED_CE 0x00080000 /* disable nested cond exec */ 00327 #define MASK_FDPIC 0x00040000 /* Follow the new uClinux ABI. */ 00328 #define MASK_INLINE_PLT 0x00020000 /* Inline FDPIC PLTs. */ 00329 #define MASK_GPREL_RO 0x00010000 /* Use GPREL for read-only data. */ 00330 00331 #define MASK_DEFAULT MASK_DEFAULT_ALLOC_CC 00332 00333 #define TARGET_GPR_32 ((target_flags & MASK_GPR_32) != 0) 00334 #define TARGET_FPR_32 ((target_flags & MASK_FPR_32) != 0) 00335 #define TARGET_SOFT_FLOAT ((target_flags & MASK_SOFT_FLOAT) != 0) 00336 #define TARGET_ALLOC_CC ((target_flags & MASK_ALLOC_CC) != 0) 00337 #define TARGET_DWORD ((target_flags & MASK_DWORD) != 0) 00338 #define TARGET_DOUBLE ((target_flags & MASK_DOUBLE) != 0) 00339 #define TARGET_MEDIA ((target_flags & MASK_MEDIA) != 0) 00340 #define TARGET_MULADD ((target_flags & MASK_MULADD) != 0) 00341 #define TARGET_LIBPIC ((target_flags & MASK_LIBPIC) != 0) 00342 #define TARGET_ACC_4 ((target_flags & MASK_ACC_4) != 0) 00343 #define TARGET_DEBUG_ARG ((target_flags & MASK_DEBUG_ARG) != 0) 00344 #define TARGET_DEBUG_ADDR ((target_flags & MASK_DEBUG_ADDR) != 0) 00345 #define TARGET_DEBUG_STACK ((target_flags & MASK_DEBUG_STACK) != 0) 00346 #define TARGET_DEBUG ((target_flags & MASK_DEBUG) != 0) 00347 #define TARGET_DEBUG_LOC ((target_flags & MASK_DEBUG_LOC) != 0) 00348 #define TARGET_DEBUG_COND_EXEC ((target_flags & MASK_DEBUG_COND_EXEC) != 0) 00349 #define TARGET_NO_COND_MOVE ((target_flags & MASK_NO_COND_MOVE) != 0) 00350 #define TARGET_NO_SCC ((target_flags & MASK_NO_SCC) != 0) 00351 #define TARGET_NO_COND_EXEC ((target_flags & MASK_NO_COND_EXEC) != 0) 00352 #define TARGET_NO_VLIW_BRANCH ((target_flags & MASK_NO_VLIW_BRANCH) != 0) 00353 #define TARGET_NO_MULTI_CE ((target_flags & MASK_NO_MULTI_CE) != 0) 00354 #define TARGET_NO_NESTED_CE ((target_flags & MASK_NO_NESTED_CE) != 0) 00355 #define TARGET_FDPIC ((target_flags & MASK_FDPIC) != 0) 00356 #define TARGET_INLINE_PLT ((target_flags & MASK_INLINE_PLT) != 0) 00357 #define TARGET_BIG_TLS ((target_flags & MASK_BIG_TLS) != 0) 00358 #define TARGET_GPREL_RO ((target_flags & MASK_GPREL_RO) != 0) 00359 #define TARGET_PACK ((target_flags & MASK_PACK) != 0) 00360 #define TARGET_LONG_CALLS ((target_flags & MASK_LONG_CALLS) != 0) 00361 #define TARGET_ALIGN_LABELS ((target_flags & MASK_ALIGN_LABELS) != 0) 00362 #define TARGET_LINKED_FP ((target_flags & MASK_LINKED_FP) != 0) 00363 00364 #define TARGET_GPR_64 (! TARGET_GPR_32) 00365 #define TARGET_FPR_64 (! TARGET_FPR_32) 00366 #define TARGET_HARD_FLOAT (! TARGET_SOFT_FLOAT) 00367 #define TARGET_FIXED_CC (! TARGET_ALLOC_CC) 00368 #define TARGET_COND_MOVE (! TARGET_NO_COND_MOVE) 00369 #define TARGET_SCC (! TARGET_NO_SCC) 00370 #define TARGET_COND_EXEC (! TARGET_NO_COND_EXEC) 00371 #define TARGET_VLIW_BRANCH (! TARGET_NO_VLIW_BRANCH) 00372 #define TARGET_MULTI_CE (! TARGET_NO_MULTI_CE) 00373 #define TARGET_NESTED_CE (! TARGET_NO_NESTED_CE) 00374 #define TARGET_ACC_8 (! TARGET_ACC_4) 00375 00376 #define TARGET_HAS_FPRS (TARGET_HARD_FLOAT || TARGET_MEDIA) 00377 00378 #define NUM_GPRS (TARGET_GPR_32? 32 : 64) 00379 #define NUM_FPRS (!TARGET_HAS_FPRS? 0 : TARGET_FPR_32? 32 : 64) 00380 #define NUM_ACCS (!TARGET_MEDIA? 0 : TARGET_ACC_4? 4 : 8) 00381 00382 /* X is a valid accumulator number if (X & ACC_MASK) == X. */ 00383 #define ACC_MASK \ 00384 (!TARGET_MEDIA ? 0 \ 00385 : TARGET_ACC_4 ? 3 \ 00386 : frv_cpu_type == FRV_CPU_FR450 ? 11 \ 00387 : 7) 00388 00389 /* Macros to identify the blend of media instructions available. Revision 1 00390 is the one found on the FR500. Revision 2 includes the changes made for 00391 the FR400. 00392 00393 Treat the generic processor as a revision 1 machine for now, for 00394 compatibility with earlier releases. */ 00395 00396 #define TARGET_MEDIA_REV1 \ 00397 (TARGET_MEDIA \ 00398 && (frv_cpu_type == FRV_CPU_GENERIC \ 00399 || frv_cpu_type == FRV_CPU_FR500)) 00400 00401 #define TARGET_MEDIA_REV2 \ 00402 (TARGET_MEDIA \ 00403 && (frv_cpu_type == FRV_CPU_FR400 \ 00404 || frv_cpu_type == FRV_CPU_FR405 \ 00405 || frv_cpu_type == FRV_CPU_FR450 \ 00406 || frv_cpu_type == FRV_CPU_FR550)) 00407 00408 #define TARGET_MEDIA_FR450 \ 00409 (frv_cpu_type == FRV_CPU_FR450) 00410 00411 #define TARGET_FR500_FR550_BUILTINS \ 00412 (frv_cpu_type == FRV_CPU_FR500 \ 00413 || frv_cpu_type == FRV_CPU_FR550) 00414 00415 #define TARGET_FR405_BUILTINS \ 00416 (frv_cpu_type == FRV_CPU_FR405 \ 00417 || frv_cpu_type == FRV_CPU_FR450) 00418 00419 #ifndef HAVE_AS_TLS 00420 #define HAVE_AS_TLS 0 00421 #endif 00422 00423 /* This macro defines names of command options to set and clear bits in 00424 `target_flags'. Its definition is an initializer with a subgrouping for 00425 each command option. 00426 00427 Each subgrouping contains a string constant, that defines the option name, 00428 a number, which contains the bits to set in `target_flags', and an optional 00429 second string which is the textual description that will be displayed when 00430 the user passes --help on the command line. If the number entry is negative 00431 then the specified bits will be cleared instead of being set. If the second 00432 string entry is present but empty, then no help information will be displayed 00433 for that option, but it will not count as an undocumented option. The actual 00434 option name, asseen on the command line is made by appending `-m' to the 00435 specified name. 00436 00437 One of the subgroupings should have a null string. The number in this 00438 grouping is the default value for `target_flags'. Any target options act 00439 starting with that value. 00440 00441 Here is an example which defines `-m68000' and `-m68020' with opposite 00442 meanings, and picks the latter as the default: 00443 00444 #define TARGET_SWITCHES \ 00445 { { "68020", 1, ""}, \ 00446 { "68000", -1, "Compile for the m68000"}, \ 00447 { "", 1, }} 00448 00449 This declaration must be present. */ 00450 00451 #define TARGET_SWITCHES \ 00452 {{ "gpr-32", MASK_GPR_32, "Only use 32 gprs"}, \ 00453 { "gpr-64", -MASK_GPR_32, "Use 64 gprs"}, \ 00454 { "fpr-32", MASK_FPR_32, "Only use 32 fprs"}, \ 00455 { "fpr-64", -MASK_FPR_32, "Use 64 fprs"}, \ 00456 { "hard-float", -MASK_SOFT_FLOAT, "Use hardware floating point" },\ 00457 { "soft-float", MASK_SOFT_FLOAT, "Use software floating point" },\ 00458 { "alloc-cc", MASK_ALLOC_CC, "Dynamically allocate cc's" }, \ 00459 { "fixed-cc", -MASK_ALLOC_CC, "Just use icc0/fcc0" }, \ 00460 { "dword", MASK_DWORD, "Change ABI to allow double word insns" }, \ 00461 { "no-dword", -MASK_DWORD, "Do not use double word insns" }, \ 00462 { "double", MASK_DOUBLE, "Use fp double instructions" }, \ 00463 { "no-double", -MASK_DOUBLE, "Do not use fp double insns" }, \ 00464 { "media", MASK_MEDIA, "Use media instructions" }, \ 00465 { "no-media", -MASK_MEDIA, "Do not use media insns" }, \ 00466 { "muladd", MASK_MULADD, "Use multiply add/subtract instructions" }, \ 00467 { "no-muladd", -MASK_MULADD, "Do not use multiply add/subtract insns" }, \ 00468 { "ultilib-library-pic", 0, "Link with the library-pic libraries" }, \ 00469 { "library-pic", MASK_LIBPIC, "PIC support for building libraries" }, \ 00470 { "acc-4", MASK_ACC_4, "Use 4 media accumulators" }, \ 00471 { "acc-8", -MASK_ACC_4, "Use 8 media accumulators" }, \ 00472 { "pack", MASK_PACK, "Pack VLIW instructions" }, \ 00473 { "no-pack", -MASK_PACK, "Do not pack VLIW instructions" }, \ 00474 { "no-eflags", 0, "Do not mark ABI switches in e_flags" }, \ 00475 { "debug-arg", MASK_DEBUG_ARG, "Internal debug switch" }, \ 00476 { "debug-addr", MASK_DEBUG_ADDR, "Internal debug switch" }, \ 00477 { "debug-stack", MASK_DEBUG_STACK, "Internal debug switch" }, \ 00478 { "debug", MASK_DEBUG, "Internal debug switch" }, \ 00479 { "debug-cond-exec", MASK_DEBUG_COND_EXEC, "Internal debug switch" }, \ 00480 { "debug-loc", MASK_DEBUG_LOC, "Internal debug switch" }, \ 00481 { "align-labels", MASK_ALIGN_LABELS, "Enable label alignment optimizations" }, \ 00482 { "no-align-labels", -MASK_ALIGN_LABELS, "Disable label alignment optimizations" }, \ 00483 { "cond-move", -MASK_NO_COND_MOVE, "Enable conditional moves" }, \ 00484 { "no-cond-move", MASK_NO_COND_MOVE, "Disable conditional moves" }, \ 00485 { "scc", -MASK_NO_SCC, "Enable setting gprs to the result of comparisons" }, \ 00486 { "no-scc", MASK_NO_SCC, "Disable setting gprs to the result of comparisons" }, \ 00487 { "cond-exec", -MASK_NO_COND_EXEC, "Enable conditional execution other than moves/scc" }, \ 00488 { "no-cond-exec", MASK_NO_COND_EXEC, "Disable conditional execution other than moves/scc" }, \ 00489 { "vliw-branch", -MASK_NO_VLIW_BRANCH, "Run pass to pack branches into VLIW insns" }, \ 00490 { "no-vliw-branch", MASK_NO_VLIW_BRANCH, "Do not run pass to pack branches into VLIW insns" }, \ 00491 { "multi-cond-exec", -MASK_NO_MULTI_CE, "Disable optimizing &&/|| in conditional execution" }, \ 00492 { "no-multi-cond-exec", MASK_NO_MULTI_CE, "Enable optimizing &&/|| in conditional execution" }, \ 00493 { "nested-cond-exec", -MASK_NO_NESTED_CE, "Enable nested conditional execution optimizations" }, \ 00494 { "no-nested-cond-exec" ,MASK_NO_NESTED_CE, "Disable nested conditional execution optimizations" }, \ 00495 { "long-calls", MASK_LONG_CALLS, "Disallow direct calls to global functions" }, \ 00496 { "no-long-calls", -MASK_LONG_CALLS, "Allow direct calls to global functions" }, \ 00497 { "linked-fp", MASK_LINKED_FP, "Follow the EABI linkage requirements" }, \ 00498 { "no-linked-fp", -MASK_LINKED_FP, "Don't follow the EABI linkage requirements" }, \ 00499 { "fdpic", MASK_FDPIC, "Enable file descriptor PIC mode" }, \ 00500 { "no-fdpic", -MASK_FDPIC, "Disable file descriptor PIC mode" }, \ 00501 { "inline-plt", MASK_INLINE_PLT, "Enable inlining of PLT in function calls" }, \ 00502 { "no-inline-plt", -MASK_INLINE_PLT, "Disable inlining of PLT in function calls" }, \ 00503 { "TLS", MASK_BIG_TLS, "Assume a large TLS segment" }, \ 00504 { "tls", -MASK_BIG_TLS, "Do not assume a large TLS segment" }, \ 00505 { "gprel-ro", MASK_GPREL_RO, "Enable use of GPREL for read-only data in FDPIC" }, \ 00506 { "no-gprel-ro", -MASK_GPREL_RO, "Disable use of GPREL for read-only data in FDPIC" }, \ 00507 { "tomcat-stats", 0, "Cause gas to print tomcat statistics" }, \ 00508 { "", MASK_DEFAULT, "" }} \ 00509 00510 /* This macro is similar to `TARGET_SWITCHES' but defines names of command 00511 options that have values. Its definition is an initializer with a 00512 subgrouping for each command option. 00513 00514 Each subgrouping contains a string constant, that defines the fixed part of 00515 the option name, the address of a variable, and an optional description string. 00516 The variable, of type `char *', is set to the text following the fixed part of 00517 the option as it is specified on the command line. The actual option name is 00518 made by appending `-m' to the specified name. 00519 00520 Here is an example which defines `-mshort-data-NUMBER'. If the given option 00521 is `-mshort-data-512', the variable `m88k_short_data' will be set to the 00522 string `"512"'. 00523 00524 extern char *m88k_short_data; 00525 #define TARGET_OPTIONS \ 00526 { { "short-data-", & m88k_short_data, \ 00527 "Specify the size of the short data section" } } 00528 00529 This declaration is optional. */ 00530 #define TARGET_OPTIONS \ 00531 { \ 00532 { "cpu=", &frv_cpu_string, "Set cpu type", 0}, \ 00533 { "branch-cost=", &frv_branch_cost_string, "Internal debug switch", 0}, \ 00534 { "cond-exec-insns=", &frv_condexec_insns_str, "Internal debug switch", 0}, \ 00535 { "cond-exec-temps=", &frv_condexec_temps_str, "Internal debug switch", 0}, \ 00536 { "sched-lookahead=", &frv_sched_lookahead_str,"Internal debug switch", 0}, \ 00537 } 00538 00539 /* This macro is a C statement to print on `stderr' a string describing the 00540 particular machine description choice. Every machine description should 00541 define `TARGET_VERSION'. For example: 00542 00543 #ifdef MOTOROLA 00544 #define TARGET_VERSION \ 00545 fprintf (stderr, " (68k, Motorola syntax)"); 00546 #else 00547 #define TARGET_VERSION \ 00548 fprintf (stderr, " (68k, MIT syntax)"); 00549 #endif */ 00550 #define TARGET_VERSION fprintf (stderr, _(" (frv)")) 00551 00552 /* Sometimes certain combinations of command options do not make sense on a 00553 particular target machine. You can define a macro `OVERRIDE_OPTIONS' to 00554 take account of this. This macro, if defined, is executed once just after 00555 all the command options have been parsed. 00556 00557 Don't use this macro to turn on various extra optimizations for `-O'. That 00558 is what `OPTIMIZATION_OPTIONS' is for. */ 00559 00560 #define OVERRIDE_OPTIONS frv_override_options () 00561 00562 /* Some machines may desire to change what optimizations are performed for 00563 various optimization levels. This macro, if defined, is executed once just 00564 after the optimization level is determined and before the remainder of the 00565 command options have been parsed. Values set in this macro are used as the 00566 default values for the other command line options. 00567 00568 LEVEL is the optimization level specified; 2 if `-O2' is specified, 1 if 00569 `-O' is specified, and 0 if neither is specified. 00570 00571 SIZE is nonzero if `-Os' is specified, 0 otherwise. 00572 00573 You should not use this macro to change options that are not 00574 machine-specific. These should uniformly selected by the same optimization 00575 level on all supported machines. Use this macro to enable machbine-specific 00576 optimizations. 00577 00578 *Do not examine `write_symbols' in this macro!* The debugging options are 00579 *not supposed to alter the generated code. */ 00580 #define OPTIMIZATION_OPTIONS(LEVEL,SIZE) frv_optimization_options (LEVEL, SIZE) 00581 00582 00583 /* Define this macro if debugging can be performed even without a frame 00584 pointer. If this macro is defined, GCC will turn on the 00585 `-fomit-frame-pointer' option whenever `-O' is specified. */ 00586 /* Frv needs a specific frame layout that includes the frame pointer. */ 00587 00588 #define CAN_DEBUG_WITHOUT_FP 00589 00590 #define LABEL_ALIGN_AFTER_BARRIER(LABEL) (TARGET_ALIGN_LABELS ? 3 : 0) 00591 00592 /* Small Data Area Support. */ 00593 /* Maximum size of variables that go in .sdata/.sbss. 00594 The -msdata=foo switch also controls how small variables are handled. */ 00595 #ifndef SDATA_DEFAULT_SIZE 00596 #define SDATA_DEFAULT_SIZE 8 00597 #endif 00598 00599 00600 /* Storage Layout */ 00601 00602 /* Define this macro to have the value 1 if the most significant bit in a byte 00603 has the lowest number; otherwise define it to have the value zero. This 00604 means that bit-field instructions count from the most significant bit. If 00605 the machine has no bit-field instructions, then this must still be defined, 00606 but it doesn't matter which value it is defined to. This macro need not be 00607 a constant. 00608 00609 This macro does not affect the way structure fields are packed into bytes or 00610 words; that is controlled by `BYTES_BIG_ENDIAN'. */ 00611 #define BITS_BIG_ENDIAN 1 00612 00613 /* Define this macro to have the value 1 if the most significant byte in a word 00614 has the lowest number. This macro need not be a constant. */ 00615 #define BYTES_BIG_ENDIAN 1 00616 00617 /* Define this macro to have the value 1 if, in a multiword object, the most 00618 significant word has the lowest number. This applies to both memory 00619 locations and registers; GCC fundamentally assumes that the order of 00620 words in memory is the same as the order in registers. This macro need not 00621 be a constant. */ 00622 #define WORDS_BIG_ENDIAN 1 00623 00624 /* Number of storage units in a word; normally 4. */ 00625 #define UNITS_PER_WORD 4 00626 00627 /* A macro to update MODE and UNSIGNEDP when an object whose type is TYPE and 00628 which has the specified mode and signedness is to be stored in a register. 00629 This macro is only called when TYPE is a scalar type. 00630 00631 On most RISC machines, which only have operations that operate on a full 00632 register, define this macro to set M to `word_mode' if M is an integer mode 00633 narrower than `BITS_PER_WORD'. In most cases, only integer modes should be 00634 widened because wider-precision floating-point operations are usually more 00635 expensive than their narrower counterparts. 00636 00637 For most machines, the macro definition does not change UNSIGNEDP. However, 00638 some machines, have instructions that preferentially handle either signed or 00639 unsigned quantities of certain modes. For example, on the DEC Alpha, 32-bit 00640 loads from memory and 32-bit add instructions sign-extend the result to 64 00641 bits. On such machines, set UNSIGNEDP according to which kind of extension 00642 is more efficient. 00643 00644 Do not define this macro if it would never modify MODE. */ 00645 #define PROMOTE_MODE(MODE, UNSIGNEDP, TYPE) \ 00646 do \ 00647 { \ 00648 if (GET_MODE_CLASS (MODE) == MODE_INT \ 00649 && GET_MODE_SIZE (MODE) < 4) \ 00650 (MODE) = SImode; \ 00651 } \ 00652 while (0) 00653 00654 /* Normal alignment required for function parameters on the stack, in bits. 00655 All stack parameters receive at least this much alignment regardless of data 00656 type. On most machines, this is the same as the size of an integer. */ 00657 #define PARM_BOUNDARY 32 00658 00659 /* Define this macro if you wish to preserve a certain alignment for the stack 00660 pointer. The definition is a C expression for the desired alignment 00661 (measured in bits). 00662 00663 If `PUSH_ROUNDING' is not defined, the stack will always be aligned to the 00664 specified boundary. If `PUSH_ROUNDING' is defined and specifies a less 00665 strict alignment than `STACK_BOUNDARY', the stack may be momentarily 00666 unaligned while pushing arguments. */ 00667 #define STACK_BOUNDARY 64 00668 00669 /* Alignment required for a function entry point, in bits. */ 00670 #define FUNCTION_BOUNDARY 128 00671 00672 /* Biggest alignment that any data type can require on this machine, 00673 in bits. */ 00674 #define BIGGEST_ALIGNMENT 64 00675 00676 /* @@@ A hack, needed because libobjc wants to use ADJUST_FIELD_ALIGN for 00677 some reason. */ 00678 #ifdef IN_TARGET_LIBS 00679 #define BIGGEST_FIELD_ALIGNMENT 64 00680 #else 00681 /* An expression for the alignment of a structure field FIELD if the 00682 alignment computed in the usual way is COMPUTED. GCC uses this 00683 value instead of the value in `BIGGEST_ALIGNMENT' or 00684 `BIGGEST_FIELD_ALIGNMENT', if defined, for structure fields only. */ 00685 #define ADJUST_FIELD_ALIGN(FIELD, COMPUTED) \ 00686 frv_adjust_field_align (FIELD, COMPUTED) 00687 #endif 00688 00689 /* If defined, a C expression to compute the alignment for a static variable. 00690 TYPE is the data type, and ALIGN is the alignment that the object 00691 would ordinarily have. The value of this macro is used instead of that 00692 alignment to align the object. 00693 00694 If this macro is not defined, then ALIGN is used. 00695 00696 One use of this macro is to increase alignment of medium-size data to make 00697 it all fit in fewer cache lines. Another is to cause character arrays to be 00698 word-aligned so that `strcpy' calls that copy constants to character arrays 00699 can be done inline. */ 00700 #define DATA_ALIGNMENT(TYPE, ALIGN) \ 00701 (TREE_CODE (TYPE) == ARRAY_TYPE \ 00702 && TYPE_MODE (TREE_TYPE (TYPE)) == QImode \ 00703 && (ALIGN) < BITS_PER_WORD ? BITS_PER_WORD : (ALIGN)) 00704 00705 /* If defined, a C expression to compute the alignment given to a constant that 00706 is being placed in memory. CONSTANT is the constant and ALIGN is the 00707 alignment that the object would ordinarily have. The value of this macro is 00708 used instead of that alignment to align the object. 00709 00710 If this macro is not defined, then ALIGN is used. 00711 00712 The typical use of this macro is to increase alignment for string constants 00713 to be word aligned so that `strcpy' calls that copy constants can be done 00714 inline. */ 00715 #define CONSTANT_ALIGNMENT(EXP, ALIGN) \ 00716 (TREE_CODE (EXP) == STRING_CST \ 00717 && (ALIGN) < BITS_PER_WORD ? BITS_PER_WORD : (ALIGN)) 00718 00719 /* Define this macro to be the value 1 if instructions will fail to work if 00720 given data not on the nominal alignment. If instructions will merely go 00721 slower in that case, define this macro as 0. */ 00722 #define STRICT_ALIGNMENT 1 00723 00724 /* Define this if you wish to imitate the way many other C compilers handle 00725 alignment of bitfields and the structures that contain them. 00726 00727 The behavior is that the type written for a bit-field (`int', `short', or 00728 other integer type) imposes an alignment for the entire structure, as if the 00729 structure really did contain an ordinary field of that type. In addition, 00730 the bit-field is placed within the structure so that it would fit within such 00731 a field, not crossing a boundary for it. 00732 00733 Thus, on most machines, a bit-field whose type is written as `int' would not 00734 cross a four-byte boundary, and would force four-byte alignment for the 00735 whole structure. (The alignment used may not be four bytes; it is 00736 controlled by the other alignment parameters.) 00737 00738 If the macro is defined, its definition should be a C expression; a nonzero 00739 value for the expression enables this behavior. 00740 00741 Note that if this macro is not defined, or its value is zero, some bitfields 00742 may cross more than one alignment boundary. The compiler can support such 00743 references if there are `insv', `extv', and `extzv' insns that can directly 00744 reference memory. 00745 00746 The other known way of making bitfields work is to define 00747 `STRUCTURE_SIZE_BOUNDARY' as large as `BIGGEST_ALIGNMENT'. Then every 00748 structure can be accessed with fullwords. 00749 00750 Unless the machine has bit-field instructions or you define 00751 `STRUCTURE_SIZE_BOUNDARY' that way, you must define 00752 `PCC_BITFIELD_TYPE_MATTERS' to have a nonzero value. 00753 00754 If your aim is to make GCC use the same conventions for laying out 00755 bitfields as are used by another compiler, here is how to investigate what 00756 the other compiler does. Compile and run this program: 00757 00758 struct foo1 00759 { 00760 char x; 00761 char :0; 00762 char y; 00763 }; 00764 00765 struct foo2 00766 { 00767 char x; 00768 int :0; 00769 char y; 00770 }; 00771 00772 main () 00773 { 00774 printf ("Size of foo1 is %d\n", 00775 sizeof (struct foo1)); 00776 printf ("Size of foo2 is %d\n", 00777 sizeof (struct foo2)); 00778 exit (0); 00779 } 00780 00781 If this prints 2 and 5, then the compiler's behavior is what you would get 00782 from `PCC_BITFIELD_TYPE_MATTERS'. 00783 00784 Defined in svr4.h. */ 00785 #define PCC_BITFIELD_TYPE_MATTERS 1 00786 00787 00788 /* Layout of Source Language Data Types. */ 00789 00790 #define CHAR_TYPE_SIZE 8 00791 #define SHORT_TYPE_SIZE 16 00792 #define INT_TYPE_SIZE 32 00793 #define LONG_TYPE_SIZE 32 00794 #define LONG_LONG_TYPE_SIZE 64 00795 #define FLOAT_TYPE_SIZE 32 00796 #define DOUBLE_TYPE_SIZE 64 00797 #define LONG_DOUBLE_TYPE_SIZE 64 00798 00799 /* An expression whose value is 1 or 0, according to whether the type `char' 00800 should be signed or unsigned by default. The user can always override this 00801 default with the options `-fsigned-char' and `-funsigned-char'. */ 00802 #define DEFAULT_SIGNED_CHAR 1 00803 00804 00805 /* General purpose registers. */ 00806 #define GPR_FIRST 0 /* First gpr */ 00807 #define GPR_LAST (GPR_FIRST + 63) /* Last gpr */ 00808 #define GPR_R0 GPR_FIRST /* R0, constant 0 */ 00809 #define GPR_FP (GPR_FIRST + 2) /* Frame pointer */ 00810 #define GPR_SP (GPR_FIRST + 1) /* Stack pointer */ 00811 /* small data register */ 00812 #define SDA_BASE_REG ((unsigned)(TARGET_FDPIC ? -1 : flag_pic ? PIC_REGNO : (GPR_FIRST + 16))) 00813 #define PIC_REGNO (GPR_FIRST + (TARGET_FDPIC?15:17)) /* PIC register. */ 00814 #define FDPIC_FPTR_REGNO (GPR_FIRST + 14) /* uClinux PIC function pointer register. */ 00815 #define FDPIC_REGNO (GPR_FIRST + 15) /* uClinux PIC register. */ 00816 00817 #define OUR_FDPIC_REG get_hard_reg_initial_val (SImode, FDPIC_REGNO) 00818 00819 #define FPR_FIRST 64 /* First FP reg */ 00820 #define FPR_LAST 127 /* Last FP reg */ 00821 00822 #define DEFAULT_CONDEXEC_TEMPS 4 /* reserve 4 regs by default */ 00823 #define GPR_TEMP_NUM frv_condexec_temps /* # gprs to reserve for temps */ 00824 00825 /* We reserve the last CR and CCR in each category to be used as a reload 00826 register to reload the CR/CCR registers. This is a kludge. */ 00827 #define CC_FIRST 128 /* First ICC/FCC reg */ 00828 #define CC_LAST 135 /* Last ICC/FCC reg */ 00829 #define ICC_FIRST (CC_FIRST + 4) /* First ICC reg */ 00830 #define ICC_LAST (CC_FIRST + 7) /* Last ICC reg */ 00831 #define ICC_TEMP (CC_FIRST + 7) /* Temporary ICC reg */ 00832 #define FCC_FIRST (CC_FIRST) /* First FCC reg */ 00833 #define FCC_LAST (CC_FIRST + 3) /* Last FCC reg */ 00834 00835 /* Amount to shift a value to locate a ICC or FCC register in the CCR 00836 register and shift it to the bottom 4 bits. */ 00837 #define CC_SHIFT_RIGHT(REGNO) (((REGNO) - CC_FIRST) << 2) 00838 00839 /* Mask to isolate a single ICC/FCC value. */ 00840 #define CC_MASK 0xf 00841 00842 /* Masks to isolate the various bits in an ICC field. */ 00843 #define ICC_MASK_N 0x8 /* negative */ 00844 #define ICC_MASK_Z 0x4 /* zero */ 00845 #define ICC_MASK_V 0x2 /* overflow */ 00846 #define ICC_MASK_C 0x1 /* carry */ 00847 00848 /* Mask to isolate the N/Z flags in an ICC. */ 00849 #define ICC_MASK_NZ (ICC_MASK_N | ICC_MASK_Z) 00850 00851 /* Mask to isolate the Z/C flags in an ICC. */ 00852 #define ICC_MASK_ZC (ICC_MASK_Z | ICC_MASK_C) 00853 00854 /* Masks to isolate the various bits in a FCC field. */ 00855 #define FCC_MASK_E 0x8 /* equal */ 00856 #define FCC_MASK_L 0x4 /* less than */ 00857 #define FCC_MASK_G 0x2 /* greater than */ 00858 #define FCC_MASK_U 0x1 /* unordered */ 00859 00860 /* For CCR registers, the machine wants CR4..CR7 to be used for integer 00861 code and CR0..CR3 to be used for floating point. */ 00862 #define CR_FIRST 136 /* First CCR */ 00863 #define CR_LAST 143 /* Last CCR */ 00864 #define CR_NUM (CR_LAST-CR_FIRST+1) /* # of CCRs (8) */ 00865 #define ICR_FIRST (CR_FIRST + 4) /* First integer CCR */ 00866 #define ICR_LAST (CR_FIRST + 7) /* Last integer CCR */ 00867 #define ICR_TEMP ICR_LAST /* Temp integer CCR */ 00868 #define FCR_FIRST (CR_FIRST + 0) /* First float CCR */ 00869 #define FCR_LAST (CR_FIRST + 3) /* Last float CCR */ 00870 00871 /* Amount to shift a value to locate a CR register in the CCCR special purpose 00872 register and shift it to the bottom 2 bits. */ 00873 #define CR_SHIFT_RIGHT(REGNO) (((REGNO) - CR_FIRST) << 1) 00874 00875 /* Mask to isolate a single CR value. */ 00876 #define CR_MASK 0x3 00877 00878 #define ACC_FIRST 144 /* First acc register */ 00879 #define ACC_LAST 155 /* Last acc register */ 00880 00881 #define ACCG_FIRST 156 /* First accg register */ 00882 #define ACCG_LAST 167 /* Last accg register */ 00883 00884 #define AP_FIRST 168 /* fake argument pointer */ 00885 00886 #define SPR_FIRST 169 00887 #define SPR_LAST 172 00888 #define LR_REGNO (SPR_FIRST) 00889 #define LCR_REGNO (SPR_FIRST + 1) 00890 #define IACC_FIRST (SPR_FIRST + 2) 00891 #define IACC_LAST (SPR_FIRST + 3) 00892 00893 #define GPR_P(R) IN_RANGE_P (R, GPR_FIRST, GPR_LAST) 00894 #define GPR_OR_AP_P(R) (GPR_P (R) || (R) == ARG_POINTER_REGNUM) 00895 #define FPR_P(R) IN_RANGE_P (R, FPR_FIRST, FPR_LAST) 00896 #define CC_P(R) IN_RANGE_P (R, CC_FIRST, CC_LAST) 00897 #define ICC_P(R) IN_RANGE_P (R, ICC_FIRST, ICC_LAST) 00898 #define FCC_P(R) IN_RANGE_P (R, FCC_FIRST, FCC_LAST) 00899 #define CR_P(R) IN_RANGE_P (R, CR_FIRST, CR_LAST) 00900 #define ICR_P(R) IN_RANGE_P (R, ICR_FIRST, ICR_LAST) 00901 #define FCR_P(R) IN_RANGE_P (R, FCR_FIRST, FCR_LAST) 00902 #define ACC_P(R) IN_RANGE_P (R, ACC_FIRST, ACC_LAST) 00903 #define ACCG_P(R) IN_RANGE_P (R, ACCG_FIRST, ACCG_LAST) 00904 #define SPR_P(R) IN_RANGE_P (R, SPR_FIRST, SPR_LAST) 00905 00906 #define GPR_OR_PSEUDO_P(R) (GPR_P (R) || (R) >= FIRST_PSEUDO_REGISTER) 00907 #define FPR_OR_PSEUDO_P(R) (FPR_P (R) || (R) >= FIRST_PSEUDO_REGISTER) 00908 #define GPR_AP_OR_PSEUDO_P(R) (GPR_OR_AP_P (R) || (R) >= FIRST_PSEUDO_REGISTER) 00909 #define CC_OR_PSEUDO_P(R) (CC_P (R) || (R) >= FIRST_PSEUDO_REGISTER) 00910 #define ICC_OR_PSEUDO_P(R) (ICC_P (R) || (R) >= FIRST_PSEUDO_REGISTER) 00911 #define FCC_OR_PSEUDO_P(R) (FCC_P (R) || (R) >= FIRST_PSEUDO_REGISTER) 00912 #define CR_OR_PSEUDO_P(R) (CR_P (R) || (R) >= FIRST_PSEUDO_REGISTER) 00913 #define ICR_OR_PSEUDO_P(R) (ICR_P (R) || (R) >= FIRST_PSEUDO_REGISTER) 00914 #define FCR_OR_PSEUDO_P(R) (FCR_P (R) || (R) >= FIRST_PSEUDO_REGISTER) 00915 #define ACC_OR_PSEUDO_P(R) (ACC_P (R) || (R) >= FIRST_PSEUDO_REGISTER) 00916 #define ACCG_OR_PSEUDO_P(R) (ACCG_P (R) || (R) >= FIRST_PSEUDO_REGISTER) 00917 00918 #define MAX_STACK_IMMEDIATE_OFFSET 2047 00919 00920 00921 /* Register Basics. */ 00922 00923 /* Number of hardware registers known to the compiler. They receive numbers 0 00924 through `FIRST_PSEUDO_REGISTER-1'; thus, the first pseudo register's number 00925 really is assigned the number `FIRST_PSEUDO_REGISTER'. */ 00926 #define FIRST_PSEUDO_REGISTER (SPR_LAST + 1) 00927 00928 /* The first/last register that can contain the arguments to a function. */ 00929 #define FIRST_ARG_REGNUM (GPR_FIRST + 8) 00930 #define LAST_ARG_REGNUM (FIRST_ARG_REGNUM + FRV_NUM_ARG_REGS - 1) 00931 00932 /* Registers used by the exception handling functions. These should be 00933 registers that are not otherwise used by the calling sequence. */ 00934 #define FIRST_EH_REGNUM 14 00935 #define LAST_EH_REGNUM 15 00936 00937 /* Scratch registers used in the prologue, epilogue and thunks. 00938 OFFSET_REGNO is for loading constant addends that are too big for a 00939 single instruction. TEMP_REGNO is used for transferring SPRs to and from 00940 the stack, and various other activities. */ 00941 #define OFFSET_REGNO 4 00942 #define TEMP_REGNO 5 00943 00944 /* Registers used in the prologue. OLD_SP_REGNO is the old stack pointer, 00945 which is sometimes used to set up the frame pointer. */ 00946 #define OLD_SP_REGNO 6 00947 00948 /* Registers used in the epilogue. STACKADJ_REGNO stores the exception 00949 handler's stack adjustment. */ 00950 #define STACKADJ_REGNO 6 00951 00952 /* Registers used in thunks. JMP_REGNO is used for loading the target 00953 address. */ 00954 #define JUMP_REGNO 6 00955 00956 #define EH_RETURN_DATA_REGNO(N) ((N) <= (LAST_EH_REGNUM - FIRST_EH_REGNUM)? \ 00957 (N) + FIRST_EH_REGNUM : INVALID_REGNUM) 00958 #define EH_RETURN_STACKADJ_RTX gen_rtx_REG (SImode, STACKADJ_REGNO) 00959 #define EH_RETURN_HANDLER_RTX RETURN_ADDR_RTX (0, frame_pointer_rtx) 00960 00961 #define EPILOGUE_USES(REGNO) ((REGNO) == LR_REGNO) 00962 00963 /* An initializer that says which registers are used for fixed purposes all 00964 throughout the compiled code and are therefore not available for general 00965 allocation. These would include the stack pointer, the frame pointer 00966 (except on machines where that can be used as a general register when no 00967 frame pointer is needed), the program counter on machines where that is 00968 considered one of the addressable registers, and any other numbered register 00969 with a standard use. 00970 00971 This information is expressed as a sequence of numbers, separated by commas 00972 and surrounded by braces. The Nth number is 1 if register N is fixed, 0 00973 otherwise. 00974 00975 The table initialized from this macro, and the table initialized by the 00976 following one, may be overridden at run time either automatically, by the 00977 actions of the macro `CONDITIONAL_REGISTER_USAGE', or by the user with the 00978 command options `-ffixed-REG', `-fcall-used-REG' and `-fcall-saved-REG'. */ 00979 00980 /* gr0 -- Hard Zero 00981 gr1 -- Stack Pointer 00982 gr2 -- Frame Pointer 00983 gr3 -- Hidden Parameter 00984 gr16 -- Small Data reserved 00985 gr17 -- Pic reserved 00986 gr28 -- OS reserved 00987 gr29 -- OS reserved 00988 gr30 -- OS reserved 00989 gr31 -- OS reserved 00990 cr3 -- reserved to reload FCC registers. 00991 cr7 -- reserved to reload ICC registers. */ 00992 #define FIXED_REGISTERS \ 00993 { /* Integer Registers */ \ 00994 1, 1, 1, 1, 0, 0, 0, 0, /* 000-007, gr0 - gr7 */ \ 00995 0, 0, 0, 0, 0, 0, 0, 0, /* 008-015, gr8 - gr15 */ \ 00996 1, 1, 0, 0, 0, 0, 0, 0, /* 016-023, gr16 - gr23 */ \ 00997 0, 0, 0, 0, 1, 1, 1, 1, /* 024-031, gr24 - gr31 */ \ 00998 0, 0, 0, 0, 0, 0, 0, 0, /* 032-039, gr32 - gr39 */ \ 00999 0, 0, 0, 0, 0, 0, 0, 0, /* 040-040, gr48 - gr47 */ \ 01000 0, 0, 0, 0, 0, 0, 0, 0, /* 048-055, gr48 - gr55 */ \ 01001 0, 0, 0, 0, 0, 0, 0, 0, /* 056-063, gr56 - gr63 */ \ 01002 /* Float Registers */ \ 01003 0, 0, 0, 0, 0, 0, 0, 0, /* 064-071, fr0 - fr7 */ \ 01004 0, 0, 0, 0, 0, 0, 0, 0, /* 072-079, fr8 - fr15 */ \ 01005 0, 0, 0, 0, 0, 0, 0, 0, /* 080-087, fr16 - fr23 */ \ 01006 0, 0, 0, 0, 0, 0, 0, 0, /* 088-095, fr24 - fr31 */ \ 01007 0, 0, 0, 0, 0, 0, 0, 0, /* 096-103, fr32 - fr39 */ \ 01008 0, 0, 0, 0, 0, 0, 0, 0, /* 104-111, fr48 - fr47 */ \ 01009 0, 0, 0, 0, 0, 0, 0, 0, /* 112-119, fr48 - fr55 */ \ 01010 0, 0, 0, 0, 0, 0, 0, 0, /* 120-127, fr56 - fr63 */ \ 01011 /* Condition Code Registers */ \ 01012 0, 0, 0, 0, /* 128-131, fcc0 - fcc3 */ \ 01013 0, 0, 0, 1, /* 132-135, icc0 - icc3 */ \ 01014 /* Conditional execution Registers (CCR) */ \ 01015 0, 0, 0, 0, 0, 0, 0, 1, /* 136-143, cr0 - cr7 */ \ 01016 /* Accumulators */ \ 01017 1, 1, 1, 1, 1, 1, 1, 1, /* 144-151, acc0 - acc7 */ \ 01018 1, 1, 1, 1, /* 152-155, acc8 - acc11 */ \ 01019 1, 1, 1, 1, 1, 1, 1, 1, /* 156-163, accg0 - accg7 */ \ 01020 1, 1, 1, 1, /* 164-167, accg8 - accg11 */ \ 01021 /* Other registers */ \ 01022 1, /* 168, AP - fake arg ptr */ \ 01023 0, /* 169, LR - Link register*/ \ 01024 0, /* 170, LCR - Loop count reg*/ \ 01025 1, 1 /* 171-172, iacc0 */ \ 01026 } 01027 01028 /* Like `FIXED_REGISTERS' but has 1 for each register that is clobbered (in 01029 general) by function calls as well as for fixed registers. This macro 01030 therefore identifies the registers that are not available for general 01031 allocation of values that must live across function calls. 01032 01033 If a register has 0 in `CALL_USED_REGISTERS', the compiler automatically 01034 saves it on function entry and restores it on function exit, if the register 01035 is used within the function. */ 01036 #define CALL_USED_REGISTERS \ 01037 { /* Integer Registers */ \ 01038 1, 1, 1, 1, 1, 1, 1, 1, /* 000-007, gr0 - gr7 */ \ 01039 1, 1, 1, 1, 1, 1, 1, 1, /* 008-015, gr8 - gr15 */ \ 01040 1, 1, 0, 0, 0, 0, 0, 0, /* 016-023, gr16 - gr23 */ \ 01041 0, 0, 0, 0, 1, 1, 1, 1, /* 024-031, gr24 - gr31 */ \ 01042 1, 1, 1, 1, 1, 1, 1, 1, /* 032-039, gr32 - gr39 */ \ 01043 1, 1, 1, 1, 1, 1, 1, 1, /* 040-040, gr48 - gr47 */ \ 01044 0, 0, 0, 0, 0, 0, 0, 0, /* 048-055, gr48 - gr55 */ \ 01045 0, 0, 0, 0, 0, 0, 0, 0, /* 056-063, gr56 - gr63 */ \ 01046 /* Float Registers */ \ 01047 1, 1, 1, 1, 1, 1, 1, 1, /* 064-071, fr0 - fr7 */ \ 01048 1, 1, 1, 1, 1, 1, 1, 1, /* 072-079, fr8 - fr15 */ \ 01049 0, 0, 0, 0, 0, 0, 0, 0, /* 080-087, fr16 - fr23 */ \ 01050 0, 0, 0, 0, 0, 0, 0, 0, /* 088-095, fr24 - fr31 */ \ 01051 1, 1, 1, 1, 1, 1, 1, 1, /* 096-103, fr32 - fr39 */ \ 01052 1, 1, 1, 1, 1, 1, 1, 1, /* 104-111, fr48 - fr47 */ \ 01053 0, 0, 0, 0, 0, 0, 0, 0, /* 112-119, fr48 - fr55 */ \ 01054 0, 0, 0, 0, 0, 0, 0, 0, /* 120-127, fr56 - fr63 */ \ 01055 /* Condition Code Registers */ \ 01056 1, 1, 1, 1, /* 128-131, fcc0 - fcc3 */ \ 01057 1, 1, 1, 1, /* 132-135, icc0 - icc3 */ \ 01058 /* Conditional execution Registers (CCR) */ \ 01059 1, 1, 1, 1, 1, 1, 1, 1, /* 136-143, cr0 - cr7 */ \ 01060 /* Accumulators */ \ 01061 1, 1, 1, 1, 1, 1, 1, 1, /* 144-151, acc0 - acc7 */ \ 01062 1, 1, 1, 1, /* 152-155, acc8 - acc11 */ \ 01063 1, 1, 1, 1, 1, 1, 1, 1, /* 156-163, accg0 - accg7 */ \ 01064 1, 1, 1, 1, /* 164-167, accg8 - accg11 */ \ 01065 /* Other registers */ \ 01066 1, /* 168, AP - fake arg ptr */ \ 01067 1, /* 169, LR - Link register*/ \ 01068 1, /* 170, LCR - Loop count reg */ \ 01069 1, 1 /* 171-172, iacc0 */ \ 01070 } 01071 01072 /* Zero or more C statements that may conditionally modify two variables 01073 `fixed_regs' and `call_used_regs' (both of type `char []') after they have 01074 been initialized from the two preceding macros. 01075 01076 This is necessary in case the fixed or call-clobbered registers depend on 01077 target flags. 01078 01079 You need not define this macro if it has no work to do. 01080 01081 If the usage of an entire class of registers depends on the target flags, 01082 you may indicate this to GCC by using this macro to modify `fixed_regs' and 01083 `call_used_regs' to 1 for each of the registers in the classes which should 01084 not be used by GCC. Also define the macro `REG_CLASS_FROM_LETTER' to return 01085 `NO_REGS' if it is called with a letter for a class that shouldn't be used. 01086 01087 (However, if this class is not included in `GENERAL_REGS' and all of the 01088 insn patterns whose constraints permit this class are controlled by target 01089 switches, then GCC will automatically avoid using these registers when the 01090 target switches are opposed to them.) */ 01091 01092 #define CONDITIONAL_REGISTER_USAGE frv_conditional_register_usage () 01093 01094 01095 /* Order of allocation of registers. */ 01096 01097 /* If defined, an initializer for a vector of integers, containing the numbers 01098 of hard registers in the order in which GCC should prefer to use them 01099 (from most preferred to least). 01100 01101 If this macro is not defined, registers are used lowest numbered first (all 01102 else being equal). 01103 01104 One use of this macro is on machines where the highest numbered registers 01105 must always be saved and the save-multiple-registers instruction supports 01106 only sequences of consecutive registers. On such machines, define 01107 `REG_ALLOC_ORDER' to be an initializer that lists the highest numbered 01108 allocatable register first. */ 01109 01110 /* On the FRV, allocate GR16 and GR17 after other saved registers so that we 01111 have a better chance of allocating 2 registers at a time and can use the 01112 double word load/store instructions in the prologue. */ 01113 #define REG_ALLOC_ORDER \ 01114 { \ 01115 /* volatile registers */ \ 01116 GPR_FIRST + 4, GPR_FIRST + 5, GPR_FIRST + 6, GPR_FIRST + 7, \ 01117 GPR_FIRST + 8, GPR_FIRST + 9, GPR_FIRST + 10, GPR_FIRST + 11, \ 01118 GPR_FIRST + 12, GPR_FIRST + 13, GPR_FIRST + 14, GPR_FIRST + 15, \ 01119 GPR_FIRST + 32, GPR_FIRST + 33, GPR_FIRST + 34, GPR_FIRST + 35, \ 01120 GPR_FIRST + 36, GPR_FIRST + 37, GPR_FIRST + 38, GPR_FIRST + 39, \ 01121 GPR_FIRST + 40, GPR_FIRST + 41, GPR_FIRST + 42, GPR_FIRST + 43, \ 01122 GPR_FIRST + 44, GPR_FIRST + 45, GPR_FIRST + 46, GPR_FIRST + 47, \ 01123 \ 01124 FPR_FIRST + 0, FPR_FIRST + 1, FPR_FIRST + 2, FPR_FIRST + 3, \ 01125 FPR_FIRST + 4, FPR_FIRST + 5, FPR_FIRST + 6, FPR_FIRST + 7, \ 01126 FPR_FIRST + 8, FPR_FIRST + 9, FPR_FIRST + 10, FPR_FIRST + 11, \ 01127 FPR_FIRST + 12, FPR_FIRST + 13, FPR_FIRST + 14, FPR_FIRST + 15, \ 01128 FPR_FIRST + 32, FPR_FIRST + 33, FPR_FIRST + 34, FPR_FIRST + 35, \ 01129 FPR_FIRST + 36, FPR_FIRST + 37, FPR_FIRST + 38, FPR_FIRST + 39, \ 01130 FPR_FIRST + 40, FPR_FIRST + 41, FPR_FIRST + 42, FPR_FIRST + 43, \ 01131 FPR_FIRST + 44, FPR_FIRST + 45, FPR_FIRST + 46, FPR_FIRST + 47, \ 01132 \ 01133 ICC_FIRST + 0, ICC_FIRST + 1, ICC_FIRST + 2, ICC_FIRST + 3, \ 01134 FCC_FIRST + 0, FCC_FIRST + 1, FCC_FIRST + 2, FCC_FIRST + 3, \ 01135 CR_FIRST + 0, CR_FIRST + 1, CR_FIRST + 2, CR_FIRST + 3, \ 01136 CR_FIRST + 4, CR_FIRST + 5, CR_FIRST + 6, CR_FIRST + 7, \ 01137 \ 01138 /* saved registers */ \ 01139 GPR_FIRST + 18, GPR_FIRST + 19, \ 01140 GPR_FIRST + 20, GPR_FIRST + 21, GPR_FIRST + 22, GPR_FIRST + 23, \ 01141 GPR_FIRST + 24, GPR_FIRST + 25, GPR_FIRST + 26, GPR_FIRST + 27, \ 01142 GPR_FIRST + 48, GPR_FIRST + 49, GPR_FIRST + 50, GPR_FIRST + 51, \ 01143 GPR_FIRST + 52, GPR_FIRST + 53, GPR_FIRST + 54, GPR_FIRST + 55, \ 01144 GPR_FIRST + 56, GPR_FIRST + 57, GPR_FIRST + 58, GPR_FIRST + 59, \ 01145 GPR_FIRST + 60, GPR_FIRST + 61, GPR_FIRST + 62, GPR_FIRST + 63, \ 01146 GPR_FIRST + 16, GPR_FIRST + 17, \ 01147 \ 01148 FPR_FIRST + 16, FPR_FIRST + 17, FPR_FIRST + 18, FPR_FIRST + 19, \ 01149 FPR_FIRST + 20, FPR_FIRST + 21, FPR_FIRST + 22, FPR_FIRST + 23, \ 01150 FPR_FIRST + 24, FPR_FIRST + 25, FPR_FIRST + 26, FPR_FIRST + 27, \ 01151 FPR_FIRST + 28, FPR_FIRST + 29, FPR_FIRST + 30, FPR_FIRST + 31, \ 01152 FPR_FIRST + 48, FPR_FIRST + 49, FPR_FIRST + 50, FPR_FIRST + 51, \ 01153 FPR_FIRST + 52, FPR_FIRST + 53, FPR_FIRST + 54, FPR_FIRST + 55, \ 01154 FPR_FIRST + 56, FPR_FIRST + 57, FPR_FIRST + 58, FPR_FIRST + 59, \ 01155 FPR_FIRST + 60, FPR_FIRST + 61, FPR_FIRST + 62, FPR_FIRST + 63, \ 01156 \ 01157 /* special or fixed registers */ \ 01158 GPR_FIRST + 0, GPR_FIRST + 1, GPR_FIRST + 2, GPR_FIRST + 3, \ 01159 GPR_FIRST + 28, GPR_FIRST + 29, GPR_FIRST + 30, GPR_FIRST + 31, \ 01160 ACC_FIRST + 0, ACC_FIRST + 1, ACC_FIRST + 2, ACC_FIRST + 3, \ 01161 ACC_FIRST + 4, ACC_FIRST + 5, ACC_FIRST + 6, ACC_FIRST + 7, \ 01162 ACC_FIRST + 8, ACC_FIRST + 9, ACC_FIRST + 10, ACC_FIRST + 11, \ 01163 ACCG_FIRST + 0, ACCG_FIRST + 1, ACCG_FIRST + 2, ACCG_FIRST + 3, \ 01164 ACCG_FIRST + 4, ACCG_FIRST + 5, ACCG_FIRST + 6, ACCG_FIRST + 7, \ 01165 ACCG_FIRST + 8, ACCG_FIRST + 9, ACCG_FIRST + 10, ACCG_FIRST + 11, \ 01166 AP_FIRST, LR_REGNO, LCR_REGNO, \ 01167 IACC_FIRST + 0, IACC_FIRST + 1 \ 01168 } 01169 01170 01171 /* How Values Fit in Registers. */ 01172 01173 /* A C expression for the number of consecutive hard registers, starting at 01174 register number REGNO, required to hold a value of mode MODE. 01175 01176 On a machine where all registers are exactly one word, a suitable definition 01177 of this macro is 01178 01179 #define HARD_REGNO_NREGS(REGNO, MODE) \ 01180 ((GET_MODE_SIZE (MODE) + UNITS_PER_WORD - 1) \ 01181 / UNITS_PER_WORD)) */ 01182 01183 /* On the FRV, make the CC modes take 3 words in the integer registers, so that 01184 we can build the appropriate instructions to properly reload the values. */ 01185 #define HARD_REGNO_NREGS(REGNO, MODE) frv_hard_regno_nregs (REGNO, MODE) 01186 01187 /* A C expression that is nonzero if it is permissible to store a value of mode 01188 MODE in hard register number REGNO (or in several registers starting with 01189 that one). For a machine where all registers are equivalent, a suitable 01190 definition is 01191 01192 #define HARD_REGNO_MODE_OK(REGNO, MODE) 1 01193 01194 It is not necessary for this macro to check for the numbers of fixed 01195 registers, because the allocation mechanism considers them to be always 01196 occupied. 01197 01198 On some machines, double-precision values must be kept in even/odd register 01199 pairs. The way to implement that is to define this macro to reject odd 01200 register numbers for such modes. 01201 01202 The minimum requirement for a mode to be OK in a register is that the 01203 `movMODE' instruction pattern support moves between the register and any 01204 other hard register for which the mode is OK; and that moving a value into 01205 the register and back out not alter it. 01206 01207 Since the same instruction used to move `SImode' will work for all narrower 01208 integer modes, it is not necessary on any machine for `HARD_REGNO_MODE_OK' 01209 to distinguish between these modes, provided you define patterns `movhi', 01210 etc., to take advantage of this. This is useful because of the interaction 01211 between `HARD_REGNO_MODE_OK' and `MODES_TIEABLE_P'; it is very desirable for 01212 all integer modes to be tieable. 01213 01214 Many machines have special registers for floating point arithmetic. Often 01215 people assume that floating point machine modes are allowed only in floating 01216 point registers. This is not true. Any registers that can hold integers 01217 can safely *hold* a floating point machine mode, whether or not floating 01218 arithmetic can be done on it in those registers. Integer move instructions 01219 can be used to move the values. 01220 01221 On some machines, though, the converse is true: fixed-point machine modes 01222 may not go in floating registers. This is true if the floating registers 01223 normalize any value stored in them, because storing a non-floating value 01224 there would garble it. In this case, `HARD_REGNO_MODE_OK' should reject 01225 fixed-point machine modes in floating registers. But if the floating 01226 registers do not automatically normalize, if you can store any bit pattern 01227 in one and retrieve it unchanged without a trap, then any machine mode may 01228 go in a floating register, so you can define this macro to say so. 01229 01230 The primary significance of special floating registers is rather that they 01231 are the registers acceptable in floating point arithmetic instructions. 01232 However, this is of no concern to `HARD_REGNO_MODE_OK'. You handle it by 01233 writing the proper constraints for those instructions. 01234 01235 On some machines, the floating registers are especially slow to access, so 01236 that it is better to store a value in a stack frame than in such a register 01237 if floating point arithmetic is not being done. As long as the floating 01238 registers are not in class `GENERAL_REGS', they will not be used unless some 01239 pattern's constraint asks for one. */ 01240 #define HARD_REGNO_MODE_OK(REGNO, MODE) frv_hard_regno_mode_ok (REGNO, MODE) 01241 01242 /* A C expression that is nonzero if it is desirable to choose register 01243 allocation so as to avoid move instructions between a value of mode MODE1 01244 and a value of mode MODE2. 01245 01246 If `HARD_REGNO_MODE_OK (R, MODE1)' and `HARD_REGNO_MODE_OK (R, MODE2)' are 01247 ever different for any R, then `MODES_TIEABLE_P (MODE1, MODE2)' must be 01248 zero. */ 01249 #define MODES_TIEABLE_P(MODE1, MODE2) (MODE1 == MODE2) 01250 01251 /* Define this macro if the compiler should avoid copies to/from CCmode 01252 registers. You should only define this macro if support fo copying to/from 01253 CCmode is incomplete. */ 01254 #define AVOID_CCMODE_COPIES 01255 01256 01257 /* Register Classes. */ 01258 01259 /* An enumeral type that must be defined with all the register class names as 01260 enumeral values. `NO_REGS' must be first. `ALL_REGS' must be the last 01261 register class, followed by one more enumeral value, `LIM_REG_CLASSES', 01262 which is not a register class but rather tells how many classes there are. 01263 01264 Each register class has a number, which is the value of casting the class 01265 name to type `int'. The number serves as an index in many of the tables 01266 described below. */ 01267 enum reg_class 01268 { 01269 NO_REGS, 01270 ICC_REGS, 01271 FCC_REGS, 01272 CC_REGS, 01273 ICR_REGS, 01274 FCR_REGS, 01275 CR_REGS, 01276 LCR_REG, 01277 LR_REG, 01278 GR8_REGS, 01279 GR9_REGS, 01280 GR89_REGS, 01281 FDPIC_REGS, 01282 FDPIC_FPTR_REGS, 01283 FDPIC_CALL_REGS, 01284 SPR_REGS, 01285 QUAD_ACC_REGS, 01286 EVEN_ACC_REGS, 01287 ACC_REGS, 01288 ACCG_REGS, 01289 QUAD_FPR_REGS, 01290 FEVEN_REGS, 01291 FPR_REGS, 01292 QUAD_REGS, 01293 EVEN_REGS, 01294 GPR_REGS, 01295 ALL_REGS, 01296 LIM_REG_CLASSES 01297 }; 01298 01299 #define GENERAL_REGS GPR_REGS 01300 01301 /* The number of distinct register classes, defined as follows: 01302 01303 #define N_REG_CLASSES (int) LIM_REG_CLASSES */ 01304 #define N_REG_CLASSES ((int) LIM_REG_CLASSES) 01305 01306 /* An initializer containing the names of the register classes as C string 01307 constants. These names are used in writing some of the debugging dumps. */ 01308 #define REG_CLASS_NAMES { \ 01309 "NO_REGS", \ 01310 "ICC_REGS", \ 01311 "FCC_REGS", \ 01312 "CC_REGS", \ 01313 "ICR_REGS", \ 01314 "FCR_REGS", \ 01315 "CR_REGS", \ 01316 "LCR_REG", \ 01317 "LR_REG", \ 01318 "GR8_REGS", \ 01319 "GR9_REGS", \ 01320 "GR89_REGS", \ 01321 "FDPIC_REGS", \ 01322 "FDPIC_FPTR_REGS", \ 01323 "FDPIC_CALL_REGS", \ 01324 "SPR_REGS", \ 01325 "QUAD_ACC_REGS", \ 01326 "EVEN_ACC_REGS", \ 01327 "ACC_REGS", \ 01328 "ACCG_REGS", \ 01329 "QUAD_FPR_REGS", \ 01330 "FEVEN_REGS", \ 01331 "FPR_REGS", \ 01332 "QUAD_REGS", \ 01333 "EVEN_REGS", \ 01334 "GPR_REGS", \ 01335 "ALL_REGS" \ 01336 } 01337 01338 /* An initializer containing the contents of the register classes, as integers 01339 which are bit masks. The Nth integer specifies the contents of class N. 01340 The way the integer MASK is interpreted is that register R is in the class 01341 if `MASK & (1 << R)' is 1. 01342 01343 When the machine has more than 32 registers, an integer does not suffice. 01344 Then the integers are replaced by sub-initializers, braced groupings 01345 containing several integers. Each sub-initializer must be suitable as an 01346 initializer for the type `HARD_REG_SET' which is defined in 01347 `hard-reg-set.h'. */ 01348 #define REG_CLASS_CONTENTS \ 01349 { /* gr0-gr31 gr32-gr63 fr0-fr31 fr32-fr-63 cc/ccr/acc ap/spr */ \ 01350 { 0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x0}, /* NO_REGS */\ 01351 { 0x00000000,0x00000000,0x00000000,0x00000000,0x000000f0,0x0}, /* ICC_REGS */\ 01352 { 0x00000000,0x00000000,0x00000000,0x00000000,0x0000000f,0x0}, /* FCC_REGS */\ 01353 { 0x00000000,0x00000000,0x00000000,0x00000000,0x000000ff,0x0}, /* CC_REGS */\ 01354 { 0x00000000,0x00000000,0x00000000,0x00000000,0x0000f000,0x0}, /* ICR_REGS */\ 01355 { 0x00000000,0x00000000,0x00000000,0x00000000,0x00000f00,0x0}, /* FCR_REGS */\ 01356 { 0x00000000,0x00000000,0x00000000,0x00000000,0x0000ff00,0x0}, /* CR_REGS */\ 01357 { 0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x400}, /* LCR_REGS */\ 01358 { 0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x200}, /* LR_REGS */\ 01359 { 0x00000100,0x00000000,0x00000000,0x00000000,0x00000000,0x0}, /* GR8_REGS */\ 01360 { 0x00000200,0x00000000,0x00000000,0x00000000,0x00000000,0x0}, /* GR9_REGS */\ 01361 { 0x00000300,0x00000000,0x00000000,0x00000000,0x00000000,0x0}, /* GR89_REGS */\ 01362 { 0x00008000,0x00000000,0x00000000,0x00000000,0x00000000,0x0}, /* FDPIC_REGS */\ 01363 { 0x00004000,0x00000000,0x00000000,0x00000000,0x00000000,0x0}, /* FDPIC_FPTR_REGS */\ 01364 { 0x0000c000,0x00000000,0x00000000,0x00000000,0x00000000,0x0}, /* FDPIC_CALL_REGS */\ 01365 { 0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x1e00}, /* SPR_REGS */\ 01366 { 0x00000000,0x00000000,0x00000000,0x00000000,0x0fff0000,0x0}, /* QUAD_ACC */\ 01367 { 0x00000000,0x00000000,0x00000000,0x00000000,0x0fff0000,0x0}, /* EVEN_ACC */\ 01368 { 0x00000000,0x00000000,0x00000000,0x00000000,0x0fff0000,0x0}, /* ACC_REGS */\ 01369 { 0x00000000,0x00000000,0x00000000,0x00000000,0xf0000000,0xff}, /* ACCG_REGS*/\ 01370 { 0x00000000,0x00000000,0xffffffff,0xffffffff,0x00000000,0x0}, /* QUAD_FPR */\ 01371 { 0x00000000,0x00000000,0xffffffff,0xffffffff,0x00000000,0x0}, /* FEVEN_REG*/\ 01372 { 0x00000000,0x00000000,0xffffffff,0xffffffff,0x00000000,0x0}, /* FPR_REGS */\ 01373 { 0x0ffffffc,0xffffffff,0x00000000,0x00000000,0x00000000,0x0}, /* QUAD_REGS*/\ 01374 { 0xfffffffc,0xffffffff,0x00000000,0x00000000,0x00000000,0x0}, /* EVEN_REGS*/\ 01375 { 0xffffffff,0xffffffff,0x00000000,0x00000000,0x00000000,0x100}, /* GPR_REGS */\ 01376 { 0xffffffff,0xffffffff,0xffffffff,0xffffffff,0xffffffff,0x1fff}, /* ALL_REGS */\ 01377 } 01378 01379 /* A C expression whose value is a register class containing hard register 01380 REGNO. In general there is more than one such class; choose a class which 01381 is "minimal", meaning that no smaller class also contains the register. */ 01382 01383 extern enum reg_class regno_reg_class[]; 01384 #define REGNO_REG_CLASS(REGNO) regno_reg_class [REGNO] 01385 01386 /* A macro whose definition is the name of the class to which a valid base 01387 register must belong. A base register is one used in an address which is 01388 the register value plus a displacement. */ 01389 #define BASE_REG_CLASS GPR_REGS 01390 01391 /* A macro whose definition is the name of the class to which a valid index 01392 register must belong. An index register is one used in an address where its 01393 value is either multiplied by a scale factor or added to another register 01394 (as well as added to a displacement). */ 01395 #define INDEX_REG_CLASS GPR_REGS 01396 01397 /* A C expression which defines the machine-dependent operand constraint 01398 letters for register classes. If CHAR is such a letter, the value should be 01399 the register class corresponding to it. Otherwise, the value should be 01400 `NO_REGS'. The register letter `r', corresponding to class `GENERAL_REGS', 01401 will not be passed to this macro; you do not need to handle it. 01402 01403 The following letters are unavailable, due to being used as 01404 constraints: 01405 '0'..'9' 01406 '<', '>' 01407 'E', 'F', 'G', 'H' 01408 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P' 01409 'Q', 'R', 'S', 'T', 'U' 01410 'V', 'X' 01411 'g', 'i', 'm', 'n', 'o', 'p', 'r', 's' */ 01412 01413 extern enum reg_class reg_class_from_letter[]; 01414 #define REG_CLASS_FROM_LETTER(CHAR) reg_class_from_letter [(unsigned char)(CHAR)] 01415 01416 /* A C expression which is nonzero if register number NUM is suitable for use 01417 as a base register in operand addresses. It may be either a suitable hard 01418 register or a pseudo register that has been allocated such a hard register. */ 01419 #define REGNO_OK_FOR_BASE_P(NUM) \ 01420 ((NUM) < FIRST_PSEUDO_REGISTER \ 01421 ? GPR_P (NUM) \ 01422 : (reg_renumber [NUM] >= 0 && GPR_P (reg_renumber [NUM]))) 01423 01424 /* A C expression which is nonzero if register number NUM is suitable for use 01425 as an index register in operand addresses. It may be either a suitable hard 01426 register or a pseudo register that has been allocated such a hard register. 01427 01428 The difference between an index register and a base register is that the 01429 index register may be scaled. If an address involves the sum of two 01430 registers, neither one of them scaled, then either one may be labeled the 01431 "base" and the other the "index"; but whichever labeling is used must fit 01432 the machine's constraints of which registers may serve in each capacity. 01433 The compiler will try both labelings, looking for one that is valid, and 01434 will reload one or both registers only if neither labeling works. */ 01435 #define REGNO_OK_FOR_INDEX_P(NUM) \ 01436 ((NUM) < FIRST_PSEUDO_REGISTER \ 01437 ? GPR_P (NUM) \ 01438 : (reg_renumber [NUM] >= 0 && GPR_P (reg_renumber [NUM]))) 01439 01440 /* A C expression that places additional restrictions on the register class to 01441 use when it is necessary to copy value X into a register in class CLASS. 01442 The value is a register class; perhaps CLASS, or perhaps another, smaller 01443 class. On many machines, the following definition is safe: 01444 01445 #define PREFERRED_RELOAD_CLASS(X,CLASS) CLASS 01446 01447 Sometimes returning a more restrictive class makes better code. For 01448 example, on the 68000, when X is an integer constant that is in range for a 01449 `moveq' instruction, the value of this macro is always `DATA_REGS' as long 01450 as CLASS includes the data registers. Requiring a data register guarantees 01451 that a `moveq' will be used. 01452 01453 If X is a `const_double', by returning `NO_REGS' you can force X into a 01454 memory constant. This is useful on certain machines where immediate 01455 floating values cannot be loaded into certain kinds of registers. 01456 01457 This declaration must be present. */ 01458 #define PREFERRED_RELOAD_CLASS(X, CLASS) CLASS 01459 01460 #define SECONDARY_INPUT_RELOAD_CLASS(CLASS, MODE, X) \ 01461 frv_secondary_reload_class (CLASS, MODE, X, TRUE) 01462 01463 #define SECONDARY_OUTPUT_RELOAD_CLASS(CLASS, MODE, X) \ 01464 frv_secondary_reload_class (CLASS, MODE, X, FALSE) 01465 01466 /* A C expression whose value is nonzero if pseudos that have been assigned to 01467 registers of class CLASS would likely be spilled because registers of CLASS 01468 are needed for spill registers. 01469 01470 The default value of this macro returns 1 if CLASS has exactly one register 01471 and zero otherwise. On most machines, this default should be used. Only 01472 define this macro to some other expression if pseudo allocated by 01473 `local-alloc.c' end up in memory because their hard registers were needed 01474 for spill registers. If this macro returns nonzero for those classes, those 01475 pseudos will only be allocated by `global.c', which knows how to reallocate 01476 the pseudo to another register. If there would not be another register 01477 available for reallocation, you should not change the definition of this 01478 macro since the only effect of such a definition would be to slow down 01479 register allocation. */ 01480 #define CLASS_LIKELY_SPILLED_P(CLASS) frv_class_likely_spilled_p (CLASS) 01481 01482 /* A C expression for the maximum number of consecutive registers of 01483 class CLASS needed to hold a value of mode MODE. 01484 01485 This is closely related to the macro `HARD_REGNO_NREGS'. In fact, the value 01486 of the macro `CLASS_MAX_NREGS (CLASS, MODE)' should be the maximum value of 01487 `HARD_REGNO_NREGS (REGNO, MODE)' for all REGNO values in the class CLASS. 01488 01489 This macro helps control the handling of multiple-word values in 01490 the reload pass. 01491 01492 This declaration is required. */ 01493 #define CLASS_MAX_NREGS(CLASS, MODE) frv_class_max_nregs (CLASS, MODE) 01494 01495 #define ZERO_P(x) (x == CONST0_RTX (GET_MODE (x))) 01496 01497 /* 6 bit signed immediate. */ 01498 #define CONST_OK_FOR_I(VALUE) IN_RANGE_P(VALUE, -32, 31) 01499 /* 10 bit signed immediate. */ 01500 #define CONST_OK_FOR_J(VALUE) IN_RANGE_P(VALUE, -512, 511) 01501 /* Unused */ 01502 #define CONST_OK_FOR_K(VALUE) 0 01503 /* 16 bit signed immediate. */ 01504 #define CONST_OK_FOR_L(VALUE) IN_RANGE_P(VALUE, -32768, 32767) 01505 /* 16 bit unsigned immediate. */ 01506 #define CONST_OK_FOR_M(VALUE) IN_RANGE_P (VALUE, 0, 65535) 01507 /* 12 bit signed immediate that is negative. */ 01508 #define CONST_OK_FOR_N(VALUE) IN_RANGE_P(VALUE, -2048, -1) 01509 /* Zero */ 01510 #define CONST_OK_FOR_O(VALUE) ((VALUE) == 0) 01511 /* 12 bit signed immediate that is negative. */ 01512 #define CONST_OK_FOR_P(VALUE) IN_RANGE_P(VALUE, 1, 2047) 01513 01514 /* A C expression that defines the machine-dependent operand constraint letters 01515 (`I', `J', `K', .. 'P') that specify particular ranges of integer values. 01516 If C is one of those letters, the expression should check that VALUE, an 01517 integer, is in the appropriate range and return 1 if so, 0 otherwise. If C 01518 is not one of those letters, the value should be 0 regardless of VALUE. */ 01519 #define CONST_OK_FOR_LETTER_P(VALUE, C) \ 01520 ( (C) == 'I' ? CONST_OK_FOR_I (VALUE) \ 01521 : (C) == 'J' ? CONST_OK_FOR_J (VALUE) \ 01522 : (C) == 'K' ? CONST_OK_FOR_K (VALUE) \ 01523 : (C) == 'L' ? CONST_OK_FOR_L (VALUE) \ 01524 : (C) == 'M' ? CONST_OK_FOR_M (VALUE) \ 01525 : (C) == 'N' ? CONST_OK_FOR_N (VALUE) \ 01526 : (C) == 'O' ? CONST_OK_FOR_O (VALUE) \ 01527 : (C) == 'P' ? CONST_OK_FOR_P (VALUE) \ 01528 : 0) 01529 01530 01531 /* A C expression that defines the machine-dependent operand constraint letters 01532 (`G', `H') that specify particular ranges of `const_double' values. 01533 01534 If C is one of those letters, the expression should check that VALUE, an RTX 01535 of code `const_double', is in the appropriate range and return 1 if so, 0 01536 otherwise. If C is not one of those letters, the value should be 0 01537 regardless of VALUE. 01538 01539 `const_double' is used for all floating-point constants and for `DImode' 01540 fixed-point constants. A given letter can accept either or both kinds of 01541 values. It can use `GET_MODE' to distinguish between these kinds. */ 01542 01543 #define CONST_DOUBLE_OK_FOR_G(VALUE) \ 01544 ((GET_MODE (VALUE) == VOIDmode \ 01545 && CONST_DOUBLE_LOW (VALUE) == 0 \ 01546 && CONST_DOUBLE_HIGH (VALUE) == 0) \ 01547 || ((GET_MODE (VALUE) == SFmode \ 01548 || GET_MODE (VALUE) == DFmode) \ 01549 && (VALUE) == CONST0_RTX (GET_MODE (VALUE)))) 01550 01551 #define CONST_DOUBLE_OK_FOR_H(VALUE) 0 01552 01553 #define CONST_DOUBLE_OK_FOR_LETTER_P(VALUE, C) \ 01554 ( (C) == 'G' ? CONST_DOUBLE_OK_FOR_G (VALUE) \ 01555 : (C) == 'H' ? CONST_DOUBLE_OK_FOR_H (VALUE) \ 01556 : 0) 01557 01558 /* A C expression that defines the optional machine-dependent constraint 01559 letters (`Q', `R', `S', `T', `U') that can be used to segregate specific 01560 types of operands, usually memory references, for the target machine. 01561 Normally this macro will not be defined. If it is required for a particular 01562 target machine, it should return 1 if VALUE corresponds to the operand type 01563 represented by the constraint letter C. If C is not defined as an extra 01564 constraint, the value returned should be 0 regardless of VALUE. 01565 01566 For example, on the ROMP, load instructions cannot have their output in r0 01567 if the memory reference contains a symbolic address. Constraint letter `Q' 01568 is defined as representing a memory address that does *not* contain a 01569 symbolic address. An alternative is specified with a `Q' constraint on the 01570 input and `r' on the output. The next alternative specifies `m' on the 01571 input and a register class that does not include r0 on the output. */ 01572 01573 /* 12-bit relocations. */ 01574 #define EXTRA_CONSTRAINT_FOR_Q(VALUE) \ 01575 (got12_operand (VALUE, GET_MODE (VALUE))) 01576 01577 /* Double word memory ops that take one instruction. */ 01578 #define EXTRA_CONSTRAINT_FOR_R(VALUE) \ 01579 (dbl_memory_one_insn_operand (VALUE, GET_MODE (VALUE))) 01580 01581 /* SYMBOL_REF */ 01582 #define EXTRA_CONSTRAINT_FOR_S(VALUE) \ 01583 (CONSTANT_P (VALUE) && call_operand (VALUE, VOIDmode)) 01584 01585 /* Double word memory ops that take two instructions. */ 01586 #define EXTRA_CONSTRAINT_FOR_T(VALUE) \ 01587 (dbl_memory_two_insn_operand (VALUE, GET_MODE (VALUE))) 01588 01589 /* Memory operand for conditional execution. */ 01590 #define EXTRA_CONSTRAINT_FOR_U(VALUE) \ 01591 (condexec_memory_operand (VALUE, GET_MODE (VALUE))) 01592 01593 #define EXTRA_CONSTRAINT(VALUE, C) \ 01594 ( (C) == 'Q' ? EXTRA_CONSTRAINT_FOR_Q (VALUE) \ 01595 : (C) == 'R' ? EXTRA_CONSTRAINT_FOR_R (VALUE) \ 01596 : (C) == 'S' ? EXTRA_CONSTRAINT_FOR_S (VALUE) \ 01597 : (C) == 'T' ? EXTRA_CONSTRAINT_FOR_T (VALUE) \ 01598 : (C) == 'U' ? EXTRA_CONSTRAINT_FOR_U (VALUE) \ 01599 : 0) 01600 01601 #define CONSTRAINT_LEN(C, STR) \ 01602 ((C) == 'D' ? 3 : DEFAULT_CONSTRAINT_LEN ((C), (STR))) 01603 01604 #define REG_CLASS_FROM_CONSTRAINT(C, STR) \ 01605 (((C) == 'D' && (STR)[1] == '8' && (STR)[2] == '9') ? GR89_REGS : \ 01606 ((C) == 'D' && (STR)[1] == '0' && (STR)[2] == '9') ? GR9_REGS : \ 01607 ((C) == 'D' && (STR)[1] == '0' && (STR)[2] == '8') ? GR8_REGS : \ 01608 ((C) == 'D' && (STR)[1] == '1' && (STR)[2] == '4') ? FDPIC_FPTR_REGS : \ 01609 ((C) == 'D' && (STR)[1] == '1' && (STR)[2] == '5') ? FDPIC_REGS : \ 01610 REG_CLASS_FROM_LETTER ((C))) 01611 01612 01613 /* Basic Stack Layout. */ 01614 01615 /* Structure to describe information about a saved range of registers */ 01616 01617 typedef struct frv_stack_regs { 01618 const char * name; /* name of the register ranges */ 01619 int first; /* first register in the range */ 01620 int last; /* last register in the range */ 01621 int size_1word; /* # of bytes to be stored via 1 word stores */ 01622 int size_2words; /* # of bytes to be stored via 2 word stores */ 01623 unsigned char field_p; /* true if the registers are a single SPR */ 01624 unsigned char dword_p; /* true if we can do dword stores */ 01625 unsigned char special_p; /* true if the regs have a fixed save loc. */ 01626 } frv_stack_regs_t; 01627 01628 /* Register ranges to look into saving. */ 01629 #define STACK_REGS_GPR 0 /* Gprs (normally gr16..gr31, gr48..gr63) */ 01630 #define STACK_REGS_FPR 1 /* Fprs (normally fr16..fr31, fr48..fr63) */ 01631 #define STACK_REGS_LR 2 /* LR register */ 01632 #define STACK_REGS_CC 3 /* CCrs (normally not saved) */ 01633 #define STACK_REGS_LCR 5 /* lcr register */ 01634 #define STACK_REGS_STDARG 6 /* stdarg registers */ 01635 #define STACK_REGS_STRUCT 7 /* structure return (gr3) */ 01636 #define STACK_REGS_FP 8 /* FP register */ 01637 #define STACK_REGS_MAX 9 /* # of register ranges */ 01638 01639 /* Values for save_p field. */ 01640 #define REG_SAVE_NO_SAVE 0 /* register not saved */ 01641 #define REG_SAVE_1WORD 1 /* save the register */ 01642 #define REG_SAVE_2WORDS 2 /* save register and register+1 */ 01643 01644 /* Structure used to define the frv stack. */ 01645 01646 typedef struct frv_stack { 01647 int total_size; /* total bytes allocated for stack */ 01648 int vars_size; /* variable save area size */ 01649 int parameter_size; /* outgoing parameter size */ 01650 int stdarg_size; /* size of regs needed to be saved for stdarg */ 01651 int regs_size; /* size of the saved registers */ 01652 int regs_size_1word; /* # of bytes to be stored via 1 word stores */ 01653 int regs_size_2words; /* # of bytes to be stored via 2 word stores */ 01654 int header_size; /* size of the old FP, struct ret., LR save */ 01655 int pretend_size; /* size of pretend args */ 01656 int vars_offset; /* offset to save local variables from new SP*/ 01657 int regs_offset; /* offset to save registers from new SP */ 01658 /* register range information */ 01659 frv_stack_regs_t regs[STACK_REGS_MAX]; 01660 /* offset to store each register */ 01661 int reg_offset[FIRST_PSEUDO_REGISTER]; 01662 /* whether to save register (& reg+1) */ 01663 unsigned char save_p[FIRST_PSEUDO_REGISTER]; 01664 } frv_stack_t; 01665 01666 /* Define this macro if pushing a word onto the stack moves the stack pointer 01667 to a smaller address. */ 01668 #define STACK_GROWS_DOWNWARD 1 01669 01670 /* Define this macro if the addresses of local variable slots are at negative 01671 offsets from the frame pointer. */ 01672 #define FRAME_GROWS_DOWNWARD 01673 01674 /* Offset from the frame pointer to the first local variable slot to be 01675 allocated. 01676 01677 If `FRAME_GROWS_DOWNWARD', find the next slot's offset by subtracting the 01678 first slot's length from `STARTING_FRAME_OFFSET'. Otherwise, it is found by 01679 adding the length of the first slot to the value `STARTING_FRAME_OFFSET'. */ 01680 #define STARTING_FRAME_OFFSET 0 01681 01682 /* Offset from the stack pointer register to the first location at which 01683 outgoing arguments are placed. If not specified, the default value of zero 01684 is used. This is the proper value for most machines. 01685 01686 If `ARGS_GROW_DOWNWARD', this is the offset to the location above the first 01687 location at which outgoing arguments are placed. */ 01688 #define STACK_POINTER_OFFSET 0 01689 01690 /* Offset from the argument pointer register to the first argument's address. 01691 On some machines it may depend on the data type of the function. 01692 01693 If `ARGS_GROW_DOWNWARD', this is the offset to the location above the first 01694 argument's address. */ 01695 #define FIRST_PARM_OFFSET(FUNDECL) 0 01696 01697 /* A C expression whose value is RTL representing the address in a stack frame 01698 where the pointer to the caller's frame is stored. Assume that FRAMEADDR is 01699 an RTL expression for the address of the stack frame itself. 01700 01701 If you don't define this macro, the default is to return the value of 01702 FRAMEADDR--that is, the stack frame address is also the address of the stack 01703 word that points to the previous frame. */ 01704 #define DYNAMIC_CHAIN_ADDRESS(FRAMEADDR) frv_dynamic_chain_address (FRAMEADDR) 01705 01706 /* A C expression whose value is RTL representing the value of the return 01707 address for the frame COUNT steps up from the current frame, after the 01708 prologue. FRAMEADDR is the frame pointer of the COUNT frame, or the frame 01709 pointer of the COUNT - 1 frame if `RETURN_ADDR_IN_PREVIOUS_FRAME' is 01710 defined. 01711 01712 The value of the expression must always be the correct address when COUNT is 01713 zero, but may be `NULL_RTX' if there is not way to determine the return 01714 address of other frames. */ 01715 #define RETURN_ADDR_RTX(COUNT, FRAMEADDR) frv_return_addr_rtx (COUNT, FRAMEADDR) 01716 01717 /* This function contains machine specific function data. */ 01718 struct machine_function GTY(()) 01719 { 01720 /* True if we have created an rtx that relies on the stack frame. */ 01721 int frame_needed; 01722 }; 01723 01724 #define RETURN_POINTER_REGNUM LR_REGNO 01725 01726 /* A C expression whose value is RTL representing the location of the incoming 01727 return address at the beginning of any function, before the prologue. This 01728 RTL is either a `REG', indicating that the return value is saved in `REG', 01729 or a `MEM' representing a location in the stack. 01730 01731 You only need to define this macro if you want to support call frame 01732 debugging information like that provided by DWARF 2. */ 01733 #define INCOMING_RETURN_ADDR_RTX gen_rtx_REG (SImode, RETURN_POINTER_REGNUM) 01734 01735 01736 /* Register That Address the Stack Frame. */ 01737 01738 /* The register number of the stack pointer register, which must also be a 01739 fixed register according to `FIXED_REGISTERS'. On most machines, the 01740 hardware determines which register this is. */ 01741 #define STACK_POINTER_REGNUM (GPR_FIRST + 1) 01742 01743 /* The register number of the frame pointer register, which is used to access 01744 automatic variables in the stack frame. On some machines, the hardware 01745 determines which register this is. On other machines, you can choose any 01746 register you wish for this purpose. */ 01747 #define FRAME_POINTER_REGNUM (GPR_FIRST + 2) 01748 01749 /* The register number of the arg pointer register, which is used to access the 01750 function's argument list. On some machines, this is the same as the frame 01751 pointer register. On some machines, the hardware determines which register 01752 this is. On other machines, you can choose any register you wish for this 01753 purpose. If this is not the same register as the frame pointer register, 01754 then you must mark it as a fixed register according to `FIXED_REGISTERS', or 01755 arrange to be able to eliminate it. */ 01756 01757 /* On frv this is a fake register that is eliminated in 01758 terms of either the frame pointer or stack pointer. */ 01759 #define ARG_POINTER_REGNUM AP_FIRST 01760 01761 /* Register numbers used for passing a function's static chain pointer. If 01762 register windows are used, the register number as seen by the called 01763 function is `STATIC_CHAIN_INCOMING_REGNUM', while the register number as 01764 seen by the calling function is `STATIC_CHAIN_REGNUM'. If these registers 01765 are the same, `STATIC_CHAIN_INCOMING_REGNUM' need not be defined. 01766 01767 The static chain register need not be a fixed register. 01768 01769 If the static chain is passed in memory, these macros should not be defined; 01770 instead, the next two macros should be defined. */ 01771 #define STATIC_CHAIN_REGNUM (GPR_FIRST + 7) 01772 #define STATIC_CHAIN_INCOMING_REGNUM (GPR_FIRST + 7) 01773 01774 01775 /* Eliminating the Frame Pointer and the Arg Pointer. */ 01776 01777 /* A C expression which is nonzero if a function must have and use a frame 01778 pointer. This expression is evaluated in the reload pass. If its value is 01779 nonzero the function will have a frame pointer. 01780 01781 The expression can in principle examine the current function and decide 01782 according to the facts, but on most machines the constant 0 or the constant 01783 1 suffices. Use 0 when the machine allows code to be generated with no 01784 frame pointer, and doing so saves some time or space. Use 1 when there is 01785 no possible advantage to avoiding a frame pointer. 01786 01787 In certain cases, the compiler does not know how to produce valid code 01788 without a frame pointer. The compiler recognizes those cases and 01789 automatically gives the function a frame pointer regardless of what 01790 `FRAME_POINTER_REQUIRED' says. You don't need to worry about them. 01791 01792 In a function that does not require a frame pointer, the frame pointer 01793 register can be allocated for ordinary usage, unless you mark it as a fixed 01794 register. See `FIXED_REGISTERS' for more information. */ 01795 #define FRAME_POINTER_REQUIRED frv_frame_pointer_required () 01796 01797 /* If defined, this macro specifies a table of register pairs used to eliminate 01798 unneeded registers that point into the stack frame. If it is not defined, 01799 the only elimination attempted by the compiler is to replace references to 01800 the frame pointer with references to the stack pointer. 01801 01802 The definition of this macro is a list of structure initializations, each of 01803 which specifies an original and replacement register. 01804 01805 On some machines, the position of the argument pointer is not known until 01806 the compilation is completed. In such a case, a separate hard register must 01807 be used for the argument pointer. This register can be eliminated by 01808 replacing it with either the frame pointer or the argument pointer, 01809 depending on whether or not the frame pointer has been eliminated. 01810 01811 In this case, you might specify: 01812 #define ELIMINABLE_REGS \ 01813 {{ARG_POINTER_REGNUM, STACK_POINTER_REGNUM}, \ 01814 {ARG_POINTER_REGNUM, FRAME_POINTER_REGNUM}, \ 01815 {FRAME_POINTER_REGNUM, STACK_POINTER_REGNUM}} 01816 01817 Note that the elimination of the argument pointer with the stack pointer is 01818 specified first since that is the preferred elimination. */ 01819 01820 #define ELIMINABLE_REGS \ 01821 { \ 01822 {ARG_POINTER_REGNUM, STACK_POINTER_REGNUM}, \ 01823 {ARG_POINTER_REGNUM, FRAME_POINTER_REGNUM}, \ 01824 {FRAME_POINTER_REGNUM, STACK_POINTER_REGNUM} \ 01825 } 01826 01827 /* A C expression that returns nonzero if the compiler is allowed to try to 01828 replace register number FROM with register number TO. This macro need only 01829 be defined if `ELIMINABLE_REGS' is defined, and will usually be the constant 01830 1, since most of the cases preventing register elimination are things that 01831 the compiler already knows about. */ 01832 01833 #define CAN_ELIMINATE(FROM, TO) \ 01834 ((FROM) == ARG_POINTER_REGNUM && (TO) == STACK_POINTER_REGNUM \ 01835 ? ! frame_pointer_needed \ 01836 : 1) 01837 01838 /* This macro is similar to `INITIAL_FRAME_POINTER_OFFSET'. It specifies the 01839 initial difference between the specified pair of registers. This macro must 01840 be defined if `ELIMINABLE_REGS' is defined. */ 01841 01842 #define INITIAL_ELIMINATION_OFFSET(FROM, TO, OFFSET) \ 01843 (OFFSET) = frv_initial_elimination_offset (FROM, TO) 01844 01845 01846 /* Passing Function Arguments on the Stack. */ 01847 01848 /* If defined, the maximum amount of space required for outgoing arguments will 01849 be computed and placed into the variable 01850 `current_function_outgoing_args_size'. No space will be pushed onto the 01851 stack for each call; instead, the function prologue should increase the 01852 stack frame size by this amount. 01853 01854 Defining both `PUSH_ROUNDING' and `ACCUMULATE_OUTGOING_ARGS' is not 01855 proper. */ 01856 #define ACCUMULATE_OUTGOING_ARGS 1 01857 01858 /* A C expression that should indicate the number of bytes of its own arguments 01859 that a function pops on returning, or 0 if the function pops no arguments 01860 and the caller must therefore pop them all after the function returns. 01861 01862 FUNDECL is a C variable whose value is a tree node that describes the 01863 function in question. Normally it is a node of type `FUNCTION_DECL' that 01864 describes the declaration of the function. From this it is possible to 01865 obtain the DECL_ATTRIBUTES of the function. 01866 01867 FUNTYPE is a C variable whose value is a tree node that describes the 01868 function in question. Normally it is a node of type `FUNCTION_TYPE' that 01869 describes the data type of the function. From this it is possible to obtain 01870 the data types of the value and arguments (if known). 01871 01872 When a call to a library function is being considered, FUNTYPE will contain 01873 an identifier node for the library function. Thus, if you need to 01874 distinguish among various library functions, you can do so by their names. 01875 Note that "library function" in this context means a function used to 01876 perform arithmetic, whose name is known specially in the compiler and was 01877 not mentioned in the C code being compiled. 01878 01879 STACK-SIZE is the number of bytes of arguments passed on the stack. If a 01880 variable number of bytes is passed, it is zero, and argument popping will 01881 always be the responsibility of the calling function. 01882 01883 On the VAX, all functions always pop their arguments, so the definition of 01884 this macro is STACK-SIZE. On the 68000, using the standard calling 01885 convention, no functions pop their arguments, so the value of the macro is 01886 always 0 in this case. But an alternative calling convention is available 01887 in which functions that take a fixed number of arguments pop them but other 01888 functions (such as `printf') pop nothing (the caller pops all). When this 01889 convention is in use, FUNTYPE is examined to determine whether a function 01890 takes a fixed number of arguments. */ 01891 #define RETURN_POPS_ARGS(FUNDECL, FUNTYPE, STACK_SIZE) 0 01892 01893 01894 /* The number of register assigned to holding function arguments. */ 01895 01896 #define FRV_NUM_ARG_REGS 6 01897 01898 #define FUNCTION_ARG(CUM, MODE, TYPE, NAMED) \ 01899 frv_function_arg (&CUM, MODE, TYPE, NAMED, FALSE) 01900 01901 /* Define this macro if the target machine has "register windows", so that the 01902 register in which a function sees an arguments is not necessarily the same 01903 as the one in which the caller passed the argument. 01904 01905 For such machines, `FUNCTION_ARG' computes the register in which the caller 01906 passes the value, and `FUNCTION_INCOMING_ARG' should be defined in a similar 01907 fashion to tell the function being called where the arguments will arrive. 01908 01909 If `FUNCTION_INCOMING_ARG' is not defined, `FUNCTION_ARG' serves both 01910 purposes. */ 01911 01912 #define FUNCTION_INCOMING_ARG(CUM, MODE, TYPE, NAMED) \ 01913 frv_function_arg (&CUM, MODE, TYPE, NAMED, TRUE) 01914 01915 /* A C type for declaring a variable that is used as the first argument of 01916 `FUNCTION_ARG' and other related values. For some target machines, the type 01917 `int' suffices and can hold the number of bytes of argument so far. 01918 01919 There is no need to record in `CUMULATIVE_ARGS' anything about the arguments 01920 that have been passed on the stack. The compiler has other variables to 01921 keep track of that. For target machines on which all arguments are passed 01922 on the stack, there is no need to store anything in `CUMULATIVE_ARGS'; 01923 however, the data structure must exist and should not be empty, so use 01924 `int'. */ 01925 #define CUMULATIVE_ARGS int 01926 01927 /* A C statement (sans semicolon) for initializing the variable CUM for the 01928 state at the beginning of the argument list. The variable has type 01929 `CUMULATIVE_ARGS'. The value of FNTYPE is the tree node for the data type 01930 of the function which will receive the args, or 0 if the args are to a 01931 compiler support library function. The value of INDIRECT is nonzero when 01932 processing an indirect call, for example a call through a function pointer. 01933 The value of INDIRECT is zero for a call to an explicitly named function, a 01934 library function call, or when `INIT_CUMULATIVE_ARGS' is used to find 01935 arguments for the function being compiled. 01936 01937 When processing a call to a compiler support library function, LIBNAME 01938 identifies which one. It is a `symbol_ref' rtx which contains the name of 01939 the function, as a string. LIBNAME is 0 when an ordinary C function call is 01940 being processed. Thus, each time this macro is called, either LIBNAME or 01941 FNTYPE is nonzero, but never both of them at once. */ 01942 01943 #define INIT_CUMULATIVE_ARGS(CUM, FNTYPE, LIBNAME, FNDECL, N_NAMED_ARGS) \ 01944 frv_init_cumulative_args (&CUM, FNTYPE, LIBNAME, FNDECL, FALSE) 01945 01946 /* Like `INIT_CUMULATIVE_ARGS' but overrides it for the purposes of finding the 01947 arguments for the function being compiled. If this macro is undefined, 01948 `INIT_CUMULATIVE_ARGS' is used instead. 01949 01950 The value passed for LIBNAME is always 0, since library routines with 01951 special calling conventions are never compiled with GCC. The argument 01952 LIBNAME exists for symmetry with `INIT_CUMULATIVE_ARGS'. */ 01953 01954 #define INIT_CUMULATIVE_INCOMING_ARGS(CUM, FNTYPE, LIBNAME) \ 01955 frv_init_cumulative_args (&CUM, FNTYPE, LIBNAME, NULL, TRUE) 01956 01957 /* A C statement (sans semicolon) to update the summarizer variable CUM to 01958 advance past an argument in the argument list. The values MODE, TYPE and 01959 NAMED describe that argument. Once this is done, the variable CUM is 01960 suitable for analyzing the *following* argument with `FUNCTION_ARG', etc. 01961 01962 This macro need not do anything if the argument in question was passed on 01963 the stack. The compiler knows how to track the amount of stack space used 01964 for arguments without any special help. */ 01965 #define FUNCTION_ARG_ADVANCE(CUM, MODE, TYPE, NAMED) \ 01966 frv_function_arg_advance (&CUM, MODE, TYPE, NAMED) 01967 01968 /* If defined, a C expression that gives the alignment boundary, in bits, of an 01969 argument with the specified mode and type. If it is not defined, 01970 `PARM_BOUNDARY' is used for all arguments. */ 01971 01972 #define FUNCTION_ARG_BOUNDARY(MODE, TYPE) \ 01973 frv_function_arg_boundary (MODE, TYPE) 01974 01975 /* A C expression that is nonzero if REGNO is the number of a hard register in 01976 which function arguments are sometimes passed. This does *not* include 01977 implicit arguments such as the static chain and the structure-value address. 01978 On many machines, no registers can be used for this purpose since all 01979 function arguments are pushed on the stack. */ 01980 #define FUNCTION_ARG_REGNO_P(REGNO) \ 01981 ((REGNO) >= FIRST_ARG_REGNUM && ((REGNO) <= LAST_ARG_REGNUM)) 01982 01983 01984 /* How Scalar Function Values are Returned. */ 01985 01986 /* The number of the hard register that is used to return a scalar value from a 01987 function call. */ 01988 #define RETURN_VALUE_REGNUM (GPR_FIRST + 8) 01989 01990 /* A C expression to create an RTX representing the place where a function 01991 returns a value of data type VALTYPE. VALTYPE is a tree node representing a 01992 data type. Write `TYPE_MODE (VALTYPE)' to get the machine mode used to 01993 represent that type. On many machines, only the mode is relevant. 01994 (Actually, on most machines, scalar values are returned in the same place 01995 regardless of mode). 01996 01997 If `TARGET_PROMOTE_FUNCTION_RETURN' is defined to return true, you 01998 must apply the same promotion rules specified in `PROMOTE_MODE' if 01999 VALTYPE is a scalar type. 02000 02001 If the precise function being called is known, FUNC is a tree node 02002 (`FUNCTION_DECL') for it; otherwise, FUNC is a null pointer. This makes it 02003 possible to use a different value-returning convention for specific 02004 functions when all their calls are known. 02005 02006 `FUNCTION_VALUE' is not used for return vales with aggregate data types, 02007 because these are returned in another way. See 02008 `TARGET_STRUCT_VALUE_RTX' and related macros, below. */ 02009 #define FUNCTION_VALUE(VALTYPE, FUNC) \ 02010 gen_rtx_REG (TYPE_MODE (VALTYPE), RETURN_VALUE_REGNUM) 02011 02012 /* A C expression to create an RTX representing the place where a library 02013 function returns a value of mode MODE. 02014 02015 Note that "library function" in this context means a compiler support 02016 routine, used to perform arithmetic, whose name is known specially by the 02017 compiler and was not mentioned in the C code being compiled. 02018 02019 The definition of `LIBRARY_VALUE' need not be concerned aggregate data 02020 types, because none of the library functions returns such types. */ 02021 #define LIBCALL_VALUE(MODE) gen_rtx_REG (MODE, RETURN_VALUE_REGNUM) 02022 02023 /* A C expression that is nonzero if REGNO is the number of a hard register in 02024 which the values of called function may come back. 02025 02026 A register whose use for returning values is limited to serving as the 02027 second of a pair (for a value of type `double', say) need not be recognized 02028 by this macro. So for most machines, this definition suffices: 02029 02030 #define FUNCTION_VALUE_REGNO_P(N) ((N) == RETURN) 02031 02032 If the machine has register windows, so that the caller and the called 02033 function use different registers for the return value, this macro should 02034 recognize only the caller's register numbers. */ 02035 #define FUNCTION_VALUE_REGNO_P(REGNO) ((REGNO) == RETURN_VALUE_REGNUM) 02036 02037 02038 /* How Large Values are Returned. */ 02039 02040 /* The number of the register that is used to to pass the structure 02041 value address. */ 02042 #define FRV_STRUCT_VALUE_REGNUM (GPR_FIRST + 3) 02043 02044 02045 /* Function Entry and Exit. */ 02046 02047 /* Define this macro as a C expression that is nonzero if the return 02048 instruction or the function epilogue ignores the value of the stack pointer; 02049 in other words, if it is safe to delete an instruction to adjust the stack 02050 pointer before a return from the function. 02051 02052 Note that this macro's value is relevant only for functions for which frame 02053 pointers are maintained. It is never safe to delete a final stack 02054 adjustment in a function that has no frame pointer, and the compiler knows 02055 this regardless of `EXIT_IGNORE_STACK'. */ 02056 #define EXIT_IGNORE_STACK 1 02057 02058 /* Generating Code for Profiling. */ 02059 02060 /* A C statement or compound statement to output to FILE some assembler code to 02061 call the profiling subroutine `mcount'. Before calling, the assembler code 02062 must load the address of a counter variable into a register where `mcount' 02063 expects to find the address. The name of this variable is `LP' followed by 02064 the number LABELNO, so you would generate the name using `LP%d' in a 02065 `fprintf'. 02066 02067 The details of how the address should be passed to `mcount' are determined 02068 by your operating system environment, not by GCC. To figure them out, 02069 compile a small program for profiling using the system's installed C 02070 compiler and look at the assembler code that results. 02071 02072 This declaration must be present, but it can be an abort if profiling is 02073 not implemented. */ 02074 02075 #define FUNCTION_PROFILER(FILE, LABELNO) 02076 02077 02078 /* Implementing the Varargs Macros. */ 02079 02080 /* Implement the stdarg/varargs va_start macro. STDARG_P is nonzero if this 02081 is stdarg.h instead of varargs.h. VALIST is the tree of the va_list 02082 variable to initialize. NEXTARG is the machine independent notion of the 02083 'next' argument after the variable arguments. If not defined, a standard 02084 implementation will be defined that works for arguments passed on the stack. */ 02085 02086 #define EXPAND_BUILTIN_VA_START(VALIST, NEXTARG) \ 02087 (frv_expand_builtin_va_start(VALIST, NEXTARG)) 02088 02089 02090 /* Trampolines for Nested Functions. */ 02091 02092 /* A C expression for the size in bytes of the trampoline, as an integer. */ 02093 #define TRAMPOLINE_SIZE frv_trampoline_size () 02094 02095 /* Alignment required for trampolines, in bits. 02096 02097 If you don't define this macro, the value of `BIGGEST_ALIGNMENT' is used for 02098 aligning trampolines. */ 02099 #define TRAMPOLINE_ALIGNMENT (TARGET_FDPIC ? 64 : 32) 02100 02101 /* A C statement to initialize the variable parts of a trampoline. ADDR is an 02102 RTX for the address of the trampoline; FNADDR is an RTX for the address of 02103 the nested function; STATIC_CHAIN is an RTX for the static chain value that 02104 should be passed to the function when it is called. */ 02105 #define INITIALIZE_TRAMPOLINE(ADDR, FNADDR, STATIC_CHAIN) \ 02106 frv_initialize_trampoline (ADDR, FNADDR, STATIC_CHAIN) 02107 02108 /* Define this macro if trampolines need a special subroutine to do their work. 02109 The macro should expand to a series of `asm' statements which will be 02110 compiled with GCC. They go in a library function named 02111 `__transfer_from_trampoline'. 02112 02113 If you need to avoid executing the ordinary prologue code of a compiled C 02114 function when you jump to the subroutine, you can do so by placing a special 02115 label of your own in the assembler code. Use one `asm' statement to 02116 generate an assembler label, and another to make the label global. Then 02117 trampolines can use that label to jump directly to your special assembler 02118 code. */ 02119 02120 #ifdef __FRV_UNDERSCORE__ 02121 #define TRAMPOLINE_TEMPLATE_NAME "___trampoline_template" 02122 #else 02123 #define TRAMPOLINE_TEMPLATE_NAME "__trampoline_template" 02124 #endif 02125 02126 #define Twrite _write 02127 02128 #if ! __FRV_FDPIC__ 02129 #define TRANSFER_FROM_TRAMPOLINE \ 02130 extern int Twrite (int, const void *, unsigned); \ 02131 \ 02132 void \ 02133 __trampoline_setup (short * addr, int size, int fnaddr, int sc) \ 02134 { \ 02135 extern short __trampoline_template[]; \ 02136 short * to = addr; \ 02137 short * from = &__trampoline_template[0]; \ 02138 int i; \ 02139 \ 02140 if (size < 20) \ 02141 { \ 02142 Twrite (2, "__trampoline_setup bad size\n", \ 02143 sizeof ("__trampoline_setup bad size\n") - 1); \ 02144 exit (-1); \ 02145 } \ 02146 \ 02147 to[0] = from[0]; \ 02148 to[1] = (short)(fnaddr); \ 02149 to[2] = from[2]; \ 02150 to[3] = (short)(sc); \ 02151 to[4] = from[4]; \ 02152 to[5] = (short)(fnaddr >> 16); \ 02153 to[6] = from[6]; \ 02154 to[7] = (short)(sc >> 16); \ 02155 to[8] = from[8]; \ 02156 to[9] = from[9]; \ 02157 \ 02158 for (i = 0; i < 20; i++) \ 02159 __asm__ volatile ("dcf @(%0,%1)\n\tici @(%0,%1)" :: "r" (to), "r" (i)); \ 02160 } \ 02161 \ 02162 __asm__("\n" \ 02163 "\t.globl " TRAMPOLINE_TEMPLATE_NAME "\n" \ 02164 "\t.text\n" \ 02165 TRAMPOLINE_TEMPLATE_NAME ":\n" \ 02166 "\tsetlos #0, gr6\n" /* jump register */ \ 02167 "\tsetlos #0, gr7\n" /* static chain */ \ 02168 "\tsethi #0, gr6\n" \ 02169 "\tsethi #0, gr7\n" \ 02170 "\tjmpl @(gr0,gr6)\n"); 02171 #else 02172 #define TRANSFER_FROM_TRAMPOLINE \ 02173 extern int Twrite (int, const void *, unsigned); \ 02174 \ 02175 void \ 02176 __trampoline_setup (addr, size, fnaddr, sc) \ 02177 short * addr; \ 02178 int size; \ 02179 int fnaddr; \ 02180 int sc; \ 02181 { \ 02182 extern short __trampoline_template[]; \ 02183 short * from = &__trampoline_template[0]; \ 02184 int i; \ 02185 short **desc = (short **)addr; \ 02186 short * to = addr + 4; \ 02187 \ 02188 if (size != 32) \ 02189 { \ 02190 Twrite (2, "__trampoline_setup bad size\n", \ 02191 sizeof ("__trampoline_setup bad size\n") - 1); \ 02192 exit (-1); \ 02193 } \ 02194 \ 02195 /* Create a function descriptor with the address of the code below 02196 and NULL as the FDPIC value. We don't need the real GOT value 02197 here, since we don't use it, so we use NULL, that is just as 02198 good. */ \ 02199 desc[0] = to; \ 02200 desc[1] = NULL; \ 02201 size -= 8; \ 02202 \ 02203 to[0] = from[0]; \ 02204 to[1] = (short)(fnaddr); \ 02205 to[2] = from[2]; \ 02206 to[3] = (short)(sc); \ 02207 to[4] = from[4]; \ 02208 to[5] = (short)(fnaddr >> 16); \ 02209 to[6] = from[6]; \ 02210 to[7] = (short)(sc >> 16); \ 02211 to[8] = from[8]; \ 02212 to[9] = from[9]; \ 02213 to[10] = from[10]; \ 02214 to[11] = from[11]; \ 02215 \ 02216 for (i = 0; i < size; i++) \ 02217 __asm__ volatile ("dcf @(%0,%1)\n\tici @(%0,%1)" :: "r" (to), "r" (i)); \ 02218 } \ 02219 \ 02220 __asm__("\n" \ 02221 "\t.globl " TRAMPOLINE_TEMPLATE_NAME "\n" \ 02222 "\t.text\n" \ 02223 TRAMPOLINE_TEMPLATE_NAME ":\n" \ 02224 "\tsetlos #0, gr6\n" /* Jump register. */ \ 02225 "\tsetlos #0, gr7\n" /* Static chain. */ \ 02226 "\tsethi #0, gr6\n" \ 02227 "\tsethi #0, gr7\n" \ 02228 "\tldd @(gr6,gr0),gr14\n" \ 02229 "\tjmpl @(gr14,gr0)\n" \ 02230 ); 02231 #endif 02232 02233 02234 /* Addressing Modes. */ 02235 02236 /* A C expression that is 1 if the RTX X is a constant which is a valid 02237 address. On most machines, this can be defined as `CONSTANT_P (X)', but a 02238 few machines are more restrictive in which constant addresses are supported. 02239 02240 `CONSTANT_P' accepts integer-values expressions whose values are not 02241 explicitly known, such as `symbol_ref', `label_ref', and `high' expressions 02242 and `const' arithmetic expressions, in addition to `const_int' and 02243 `const_double' expressions. */ 02244 #define CONSTANT_ADDRESS_P(X) CONSTANT_P (X) 02245 02246 /* A number, the maximum number of registers that can appear in a valid memory 02247 address. Note that it is up to you to specify a value equal to the maximum 02248 number that `GO_IF_LEGITIMATE_ADDRESS' would ever accept. */ 02249 #define MAX_REGS_PER_ADDRESS 2 02250 02251 /* A C compound statement with a conditional `goto LABEL;' executed if X (an 02252 RTX) is a legitimate memory address on the target machine for a memory 02253 operand of mode MODE. 02254 02255 It usually pays to define several simpler macros to serve as subroutines for 02256 this one. Otherwise it may be too complicated to understand. 02257 02258 This macro must exist in two variants: a strict variant and a non-strict 02259 one. The strict variant is used in the reload pass. It must be defined so 02260 that any pseudo-register that has not been allocated a hard register is 02261 considered a memory reference. In contexts where some kind of register is 02262 required, a pseudo-register with no hard register must be rejected. 02263 02264 The non-strict variant is used in other passes. It must be defined to 02265 accept all pseudo-registers in every context where some kind of register is 02266 required. 02267 02268 Compiler source files that want to use the strict variant of this macro 02269 define the macro `REG_OK_STRICT'. You should use an `#ifdef REG_OK_STRICT' 02270 conditional to define the strict variant in that case and the non-strict 02271 variant otherwise. 02272 02273 Subroutines to check for acceptable registers for various purposes (one for 02274 base registers, one for index registers, and so on) are typically among the 02275 subroutines used to define `GO_IF_LEGITIMATE_ADDRESS'. Then only these 02276 subroutine macros need have two variants; the higher levels of macros may be 02277 the same whether strict or not. 02278 02279 Normally, constant addresses which are the sum of a `symbol_ref' and an 02280 integer are stored inside a `const' RTX to mark them as constant. 02281 Therefore, there is no need to recognize such sums specifically as 02282 legitimate addresses. Normally you would simply recognize any `const' as 02283 legitimate. 02284 02285 Usually `PRINT_OPERAND_ADDRESS' is not prepared to handle constant sums that 02286 are not marked with `const'. It assumes that a naked `plus' indicates 02287 indexing. If so, then you *must* reject such naked constant sums as 02288 illegitimate addresses, so that none of them will be given to 02289 `PRINT_OPERAND_ADDRESS'. 02290 02291 On some machines, whether a symbolic address is legitimate depends on the 02292 section that the address refers to. On these machines, define the macro 02293 `ENCODE_SECTION_INFO' to store the information into the `symbol_ref', and 02294 then check for it here. When you see a `const', you will have to look 02295 inside it to find the `symbol_ref' in order to determine the section. 02296 02297 The best way to modify the name string is by adding text to the beginning, 02298 with suitable punctuation to prevent any ambiguity. Allocate the new name 02299 in `saveable_obstack'. You will have to modify `ASM_OUTPUT_LABELREF' to 02300 remove and decode the added text and output the name accordingly, and define 02301 `(* targetm.strip_name_encoding)' to access the original name string. 02302 02303 You can check the information stored here into the `symbol_ref' in the 02304 definitions of the macros `GO_IF_LEGITIMATE_ADDRESS' and 02305 `PRINT_OPERAND_ADDRESS'. */ 02306 02307 #ifdef REG_OK_STRICT 02308 #define REG_OK_STRICT_P 1 02309 #else 02310 #define REG_OK_STRICT_P 0 02311 #endif 02312 02313 #define GO_IF_LEGITIMATE_ADDRESS(MODE, X, LABEL) \ 02314 do \ 02315 { \ 02316 if (frv_legitimate_address_p (MODE, X, REG_OK_STRICT_P, \ 02317 FALSE, FALSE)) \ 02318 goto LABEL; \ 02319 } \ 02320 while (0) 02321 02322 /* A C expression that is nonzero if X (assumed to be a `reg' RTX) is valid for 02323 use as a base register. For hard registers, it should always accept those 02324 which the hardware permits and reject the others. Whether the macro accepts 02325 or rejects pseudo registers must be controlled by `REG_OK_STRICT' as 02326 described above. This usually requires two variant definitions, of which 02327 `REG_OK_STRICT' controls the one actually used. */ 02328 #ifdef REG_OK_STRICT 02329 #define REG_OK_FOR_BASE_P(X) GPR_P (REGNO (X)) 02330 #else 02331 #define REG_OK_FOR_BASE_P(X) GPR_AP_OR_PSEUDO_P (REGNO (X)) 02332 #endif 02333 02334 /* A C expression that is nonzero if X (assumed to be a `reg' RTX) is valid for 02335 use as an index register. 02336 02337 The difference between an index register and a base register is that the 02338 index register may be scaled. If an address involves the sum of two 02339 registers, neither one of them scaled, then either one may be labeled the 02340 "base" and the other the "index"; but whichever labeling is used must fit 02341 the machine's constraints of which registers may serve in each capacity. 02342 The compiler will try both labelings, looking for one that is valid, and 02343 will reload one or both registers only if neither labeling works. */ 02344 #define REG_OK_FOR_INDEX_P(X) REG_OK_FOR_BASE_P (X) 02345 02346 #define LEGITIMIZE_ADDRESS(X, OLDX, MODE, WIN) \ 02347 do { \ 02348 rtx new_x = frv_legitimize_address (X, OLDX, MODE); \ 02349 if (new_x) \ 02350 { \ 02351 (X) = new_x; \ 02352 goto WIN; \ 02353 } \ 02354 } while (0) 02355 02356 #define FIND_BASE_TERM frv_find_base_term 02357 02358 /* A C statement or compound statement with a conditional `goto LABEL;' 02359 executed if memory address X (an RTX) can have different meanings depending 02360 on the machine mode of the memory reference it is used for or if the address 02361 is valid for some modes but not others. 02362 02363 Autoincrement and autodecrement addresses typically have mode-dependent 02364 effects because the amount of the increment or decrement is the size of the 02365 operand being addressed. Some machines have other mode-dependent addresses. 02366 Many RISC machines have no mode-dependent addresses. 02367 02368 You may assume that ADDR is a valid address for the machine. */ 02369 #define GO_IF_MODE_DEPENDENT_ADDRESS(ADDR, LABEL) 02370 02371 /* A C expression that is nonzero if X is a legitimate constant for an 02372 immediate operand on the target machine. You can assume that X satisfies 02373 `CONSTANT_P', so you need not check this. In fact, `1' is a suitable 02374 definition for this macro on machines where anything `CONSTANT_P' is valid. */ 02375 #define LEGITIMATE_CONSTANT_P(X) frv_legitimate_constant_p (X) 02376 02377 /* The load-and-update commands allow pre-modification in addresses. 02378 The index has to be in a register. */ 02379 #define HAVE_PRE_MODIFY_REG 1 02380 02381 02382 /* Returns a mode from class `MODE_CC' to be used when comparison operation 02383 code OP is applied to rtx X and Y. For example, on the SPARC, 02384 `SELECT_CC_MODE' is defined as (see *note Jump Patterns::. for a 02385 description of the reason for this definition) 02386 02387 #define SELECT_CC_MODE(OP,X,Y) \ 02388 (GET_MODE_CLASS (GET_MODE (X)) == MODE_FLOAT \ 02389 ? ((OP == EQ || OP == NE) ? CCFPmode : CCFPEmode) \ 02390 : ((GET_CODE (X) == PLUS || GET_CODE (X) == MINUS \ 02391 || GET_CODE (X) == NEG) \ 02392 ? CC_NOOVmode : CCmode)) 02393 02394 You need not define this macro if `EXTRA_CC_MODES' is not defined. */ 02395 #define SELECT_CC_MODE frv_select_cc_mode 02396 02397 /* A C expression whose value is one if it is always safe to reverse a 02398 comparison whose mode is MODE. If `SELECT_CC_MODE' can ever return MODE for 02399 a floating-point inequality comparison, then `REVERSIBLE_CC_MODE (MODE)' 02400 must be zero. 02401 02402 You need not define this macro if it would always returns zero or if the 02403 floating-point format is anything other than `IEEE_FLOAT_FORMAT'. For 02404 example, here is the definition used on the SPARC, where floating-point 02405 inequality comparisons are always given `CCFPEmode': 02406 02407 #define REVERSIBLE_CC_MODE(MODE) ((MODE) != CCFPEmode) */ 02408 02409 /* On frv, don't consider floating point comparisons to be reversible. In 02410 theory, fp equality comparisons can be reversible. */ 02411 #define REVERSIBLE_CC_MODE(MODE) \ 02412 ((MODE) == CCmode || (MODE) == CC_UNSmode || (MODE) == CC_NZmode) 02413 02414 /* Frv CCR_MODE's are not reversible. */ 02415 #define REVERSE_CONDEXEC_PREDICATES_P(x,y) 0 02416 02417 02418 /* Describing Relative Costs of Operations. */ 02419 02420 /* A C expression for the cost of moving data from a register in class FROM to 02421 one in class TO. The classes are expressed using the enumeration values 02422 such as `GENERAL_REGS'. A value of 4 is the default; other values are 02423 interpreted relative to that. 02424 02425 It is not required that the cost always equal 2 when FROM is the same as TO; 02426 on some machines it is expensive to move between registers if they are not 02427 general registers. 02428 02429 If reload sees an insn consisting of a single `set' between two hard 02430 registers, and if `REGISTER_MOVE_COST' applied to their classes returns a 02431 value of 2, reload does not check to ensure that the constraints of the insn 02432 are met. Setting a cost of other than 2 will allow reload to verify that 02433 the constraints are met. You should do this if the `movM' pattern's 02434 constraints do not allow such copying. */ 02435 #define REGISTER_MOVE_COST(MODE, FROM, TO) frv_register_move_cost (FROM, TO) 02436 02437 /* A C expression for the cost of moving data of mode M between a register and 02438 memory. A value of 2 is the default; this cost is relative to those in 02439 `REGISTER_MOVE_COST'. 02440 02441 If moving between registers and memory is more expensive than between two 02442 registers, you should define this macro to express the relative cost. */ 02443 #define MEMORY_MOVE_COST(M,C,I) 4 02444 02445 /* A C expression for the cost of a branch instruction. A value of 1 is the 02446 default; other values are interpreted relative to that. */ 02447 02448 /* Here are additional macros which do not specify precise relative costs, but 02449 only that certain actions are more expensive than GCC would ordinarily 02450 expect. */ 02451 02452 /* We used to default the branch cost to 2, but I changed it to 1, to avoid 02453 generating SCC instructions and or/and-ing them together, and then doing the 02454 branch on the result, which collectively generate much worse code. */ 02455 #ifndef DEFAULT_BRANCH_COST 02456 #define DEFAULT_BRANCH_COST 1 02457 #endif 02458 02459 #define BRANCH_COST frv_branch_cost_int 02460 02461 /* Define this macro as a C expression which is nonzero if accessing less than 02462 a word of memory (i.e. a `char' or a `short') is no faster than accessing a 02463 word of memory, i.e., if such access require more than one instruction or if 02464 there is no difference in cost between byte and (aligned) word loads. 02465 02466 When this macro is not defined, the compiler will access a field by finding 02467 the smallest containing object; when it is defined, a fullword load will be 02468 used if alignment permits. Unless bytes accesses are faster than word 02469 accesses, using word accesses is preferable since it may eliminate 02470 subsequent memory access if subsequent accesses occur to other fields in the 02471 same word of the structure, but to different bytes. */ 02472 #define SLOW_BYTE_ACCESS 1 02473 02474 /* Define this macro if it is as good or better to call a constant function 02475 address than to call an address kept in a register. */ 02476 #define NO_FUNCTION_CSE 02477 02478 02479 /* Dividing the output into sections. */ 02480 02481 /* A C expression whose value is a string containing the assembler operation 02482 that should precede instructions and read-only data. Normally `".text"' is 02483 right. */ 02484 #define TEXT_SECTION_ASM_OP "\t.text" 02485 02486 /* A C expression whose value is a string containing the assembler operation to 02487 identify the following data as writable initialized data. Normally 02488 `".data"' is right. */ 02489 #define DATA_SECTION_ASM_OP "\t.data" 02490 02491 /* If defined, a C expression whose value is a string containing the 02492 assembler operation to identify the following data as 02493 uninitialized global data. If not defined, and neither 02494 `ASM_OUTPUT_BSS' nor `ASM_OUTPUT_ALIGNED_BSS' are defined, 02495 uninitialized global data will be output in the data section if 02496 `-fno-common' is passed, otherwise `ASM_OUTPUT_COMMON' will be 02497 used. */ 02498 #define BSS_SECTION_ASM_OP "\t.section .bss,\"aw\"" 02499 02500 /* Short Data Support */ 02501 #define SDATA_SECTION_ASM_OP "\t.section .sdata,\"aw\"" 02502 02503 /* On svr4, we *do* have support for the .init and .fini sections, and we 02504 can put stuff in there to be executed before and after `main'. We let 02505 crtstuff.c and other files know this by defining the following symbols. 02506 The definitions say how to change sections to the .init and .fini 02507 sections. This is the same for all known svr4 assemblers. 02508 02509 The standard System V.4 macros will work, but they look ugly in the 02510 assembly output, so redefine them. */ 02511 02512 #undef INIT_SECTION_ASM_OP 02513 #undef FINI_SECTION_ASM_OP 02514 #define INIT_SECTION_ASM_OP "\t.section .init,\"ax\"" 02515 #define FINI_SECTION_ASM_OP "\t.section .fini,\"ax\"" 02516 02517 #undef CTORS_SECTION_ASM_OP 02518 #undef DTORS_SECTION_ASM_OP 02519 #define CTORS_SECTION_ASM_OP "\t.section\t.ctors,\"a\"" 02520 #define DTORS_SECTION_ASM_OP "\t.section\t.dtors,\"a\"" 02521 02522 /* A C expression whose value is a string containing the assembler operation to 02523 switch to the fixup section that records all initialized pointers in a -fpic 02524 program so they can be changed program startup time if the program is loaded 02525 at a different address than linked for. */ 02526 #define FIXUP_SECTION_ASM_OP "\t.section .rofixup,\"a\"" 02527 02528 /* A list of names for sections other than the standard two, which are 02529 `in_text' and `in_data'. You need not define this macro 02530 on a system with no other sections (that GCC needs to use). */ 02531 #undef EXTRA_SECTIONS 02532 #define EXTRA_SECTIONS in_sdata, in_const, in_fixup 02533 02534 /* One or more functions to be defined in "varasm.c". These 02535 functions should do jobs analogous to those of `text_section' and 02536 `data_section', for your additional sections. Do not define this 02537 macro if you do not define `EXTRA_SECTIONS'. */ 02538 #undef EXTRA_SECTION_FUNCTIONS 02539 #define EXTRA_SECTION_FUNCTIONS \ 02540 SDATA_SECTION_FUNCTION \ 02541 FIXUP_SECTION_FUNCTION 02542 02543 #define SDATA_SECTION_FUNCTION \ 02544 void \ 02545 sdata_section (void) \ 02546 { \ 02547 if (in_section != in_sdata) \ 02548 { \ 02549 fprintf (asm_out_file, "%s\n", SDATA_SECTION_ASM_OP); \ 02550 in_section = in_sdata; \ 02551 } \ 02552 } 02553 02554 #define FIXUP_SECTION_FUNCTION \ 02555 void \ 02556 fixup_section (void) \ 02557 { \ 02558 if (in_section != in_fixup) \ 02559 { \ 02560 fprintf (asm_out_file, "%s\n", FIXUP_SECTION_ASM_OP); \ 02561 in_section = in_fixup; \ 02562 } \ 02563 } 02564 02565 /* Position Independent Code. */ 02566 02567 /* A C expression that is nonzero if X is a legitimate immediate operand on the 02568 target machine when generating position independent code. You can assume 02569 that X satisfies `CONSTANT_P', so you need not check this. You can also 02570 assume FLAG_PIC is true, so you need not check it either. You need not 02571 define this macro if all constants (including `SYMBOL_REF') can be immediate 02572 operands when generating position independent code. */ 02573 #define LEGITIMATE_PIC_OPERAND_P(X) \ 02574 ( GET_CODE (X) == CONST_INT \ 02575 || GET_CODE (X) == CONST_DOUBLE \ 02576 || (GET_CODE (X) == HIGH && GET_CODE (XEXP (X, 0)) == CONST_INT) \ 02577 || got12_operand (X, VOIDmode)) \ 02578 02579 02580 /* The Overall Framework of an Assembler File. */ 02581 02582 /* A C string constant describing how to begin a comment in the target 02583 assembler language. The compiler assumes that the comment will end at the 02584 end of the line. */ 02585 #define ASM_COMMENT_START ";" 02586 02587 /* A C string constant for text to be output before each `asm' statement or 02588 group of consecutive ones. Normally this is `"#APP"', which is a comment 02589 that has no effect on most assemblers but tells the GNU assembler that it 02590 must check the lines that follow for all valid assembler constructs. */ 02591 #define ASM_APP_ON "#APP\n" 02592 02593 /* A C string constant for text to be output after each `asm' statement or 02594 group of consecutive ones. Normally this is `"#NO_APP"', which tells the 02595 GNU assembler to resume making the time-saving assumptions that are valid 02596 for ordinary compiler output. */ 02597 #define ASM_APP_OFF "#NO_APP\n" 02598 02599 02600 /* Output of Data. */ 02601 02602 /* This is how to output a label to dwarf/dwarf2. */ 02603 #define ASM_OUTPUT_DWARF_ADDR(STREAM, LABEL) \ 02604 do { \ 02605 fprintf (STREAM, "\t.picptr\t"); \ 02606 assemble_name (STREAM, LABEL); \ 02607 } while (0) 02608 02609 #if HAVE_AS_TLS 02610 /* Emit a dtp-relative reference to a TLS variable. */ 02611 02612 #define ASM_OUTPUT_DWARF_DTPREL(FILE, SIZE, X) \ 02613 frv_output_dwarf_dtprel ((FILE), (SIZE), (X)) 02614 #endif 02615 02616 /* Whether to emit the gas specific dwarf2 line number support. */ 02617 #define DWARF2_ASM_LINE_DEBUG_INFO (TARGET_DEBUG_LOC) 02618 02619 /* Output of Uninitialized Variables. */ 02620 02621 /* A C statement (sans semicolon) to output to the stdio stream STREAM the 02622 assembler definition of a local-common-label named NAME whose size is SIZE 02623 bytes. The variable ROUNDED is the size rounded up to whatever alignment 02624 the caller wants. 02625 02626 Use the expression `assemble_name (STREAM, NAME)' to output the name itself; 02627 before and after that, output the additional assembler syntax for defining 02628 the name, and a newline. 02629 02630 This macro controls how the assembler definitions of uninitialized static 02631 variables are output. */ 02632 #undef ASM_OUTPUT_LOCAL 02633 02634 /* Like `ASM_OUTPUT_LOCAL' except takes the required alignment as a separate, 02635 explicit argument. If you define this macro, it is used in place of 02636 `ASM_OUTPUT_LOCAL', and gives you more flexibility in handling the required 02637 alignment of the variable. The alignment is specified as the number of 02638 bits. 02639 02640 Defined in svr4.h. */ 02641 #undef ASM_OUTPUT_ALIGNED_LOCAL 02642 02643 /* This is for final.c, because it is used by ASM_DECLARE_OBJECT_NAME. */ 02644 extern int size_directive_output; 02645 02646 /* Like `ASM_OUTPUT_ALIGNED_LOCAL' except that it takes an additional 02647 parameter - the DECL of variable to be output, if there is one. 02648 This macro can be called with DECL == NULL_TREE. If you define 02649 this macro, it is used in place of `ASM_OUTPUT_LOCAL' and 02650 `ASM_OUTPUT_ALIGNED_LOCAL', and gives you more flexibility in 02651 handling the destination of the variable. */ 02652 #undef ASM_OUTPUT_ALIGNED_DECL_LOCAL 02653 #define ASM_OUTPUT_ALIGNED_DECL_LOCAL(STREAM, DECL, NAME, SIZE, ALIGN) \ 02654 do { \ 02655 if ((SIZE) > 0 && (SIZE) <= g_switch_value) \ 02656 named_section (0, ".sbss", 0); \ 02657 else \ 02658 bss_section (); \ 02659 ASM_OUTPUT_ALIGN (STREAM, floor_log2 ((ALIGN) / BITS_PER_UNIT)); \ 02660 ASM_DECLARE_OBJECT_NAME (STREAM, NAME, DECL); \ 02661 ASM_OUTPUT_SKIP (STREAM, (SIZE) ? (SIZE) : 1); \ 02662 } while (0) 02663 02664 02665 /* Output and Generation of Labels. */ 02666 02667 /* A C statement (sans semicolon) to output to the stdio stream STREAM the 02668 assembler definition of a label named NAME. Use the expression 02669 `assemble_name (STREAM, NAME)' to output the name itself; before and after 02670 that, output the additional assembler syntax for defining the name, and a 02671 newline. */ 02672 #define ASM_OUTPUT_LABEL(STREAM, NAME) \ 02673 do { \ 02674 assemble_name (STREAM, NAME); \ 02675 fputs (":\n", STREAM); \ 02676 } while (0) 02677 02678 /* Globalizing directive for a label. */ 02679 #define GLOBAL_ASM_OP "\t.globl " 02680 02681 /* A C statement to store into the string STRING a label whose name is made 02682 from the string PREFIX and the number NUM. 02683 02684 This string, when output subsequently by `assemble_name', should produce the 02685 output that `(*targetm.asm_out.internal_label)' would produce with the same PREFIX 02686 and NUM. 02687 02688 If the string begins with `*', then `assemble_name' will output the rest of 02689 the string unchanged. It is often convenient for 02690 `ASM_GENERATE_INTERNAL_LABEL' to use `*' in this way. If the string doesn't 02691 start with `*', then `ASM_OUTPUT_LABELREF' gets to output the string, and 02692 may change it. (Of course, `ASM_OUTPUT_LABELREF' is also part of your 02693 machine description, so you should know what it does on your machine.) 02694 02695 Defined in svr4.h. */ 02696 #undef ASM_GENERATE_INTERNAL_LABEL 02697 #define ASM_GENERATE_INTERNAL_LABEL(LABEL, PREFIX, NUM) \ 02698 do { \ 02699 sprintf (LABEL, "*.%s%ld", PREFIX, (long)NUM); \ 02700 } while (0) 02701 02702 02703 /* Macros Controlling Initialization Routines. */ 02704 02705 /* If defined, a C string constant for the assembler operation to identify the 02706 following data as initialization code. If not defined, GCC will assume 02707 such a section does not exist. When you are using special sections for 02708 initialization and termination functions, this macro also controls how 02709 `crtstuff.c' and `libgcc2.c' arrange to run the initialization functions. 02710 02711 Defined in svr4.h. */ 02712 #undef INIT_SECTION_ASM_OP 02713 02714 /* If defined, `main' will call `__main' despite the presence of 02715 `INIT_SECTION_ASM_OP'. This macro should be defined for systems where the 02716 init section is not actually run automatically, but is still useful for 02717 collecting the lists of constructors and destructors. */ 02718 #define INVOKE__main 02719 02720 /* Output of Assembler Instructions. */ 02721 02722 /* A C initializer containing the assembler's names for the machine registers, 02723 each one as a C string constant. This is what translates register numbers 02724 in the compiler into assembler language. */ 02725 #define REGISTER_NAMES \ 02726 { \ 02727 "gr0", "sp", "fp", "gr3", "gr4", "gr5", "gr6", "gr7", \ 02728 "gr8", "gr9", "gr10", "gr11", "gr12", "gr13", "gr14", "gr15", \ 02729 "gr16", "gr17", "gr18", "gr19", "gr20", "gr21", "gr22", "gr23", \ 02730 "gr24", "gr25", "gr26", "gr27", "gr28", "gr29", "gr30", "gr31", \ 02731 "gr32", "gr33", "gr34", "gr35", "gr36", "gr37", "gr38", "gr39", \ 02732 "gr40", "gr41", "gr42", "gr43", "gr44", "gr45", "gr46", "gr47", \ 02733 "gr48", "gr49", "gr50", "gr51", "gr52", "gr53", "gr54", "gr55", \ 02734 "gr56", "gr57", "gr58", "gr59", "gr60", "gr61", "gr62", "gr63", \ 02735 \ 02736 "fr0", "fr1", "fr2", "fr3", "fr4", "fr5", "fr6", "fr7", \ 02737 "fr8", "fr9", "fr10", "fr11", "fr12", "fr13", "fr14", "fr15", \ 02738 "fr16", "fr17", "fr18", "fr19", "fr20", "fr21", "fr22", "fr23", \ 02739 "fr24", "fr25", "fr26", "fr27", "fr28", "fr29", "fr30", "fr31", \ 02740 "fr32", "fr33", "fr34", "fr35", "fr36", "fr37", "fr38", "fr39", \ 02741 "fr40", "fr41", "fr42", "fr43", "fr44", "fr45", "fr46", "fr47", \ 02742 "fr48", "fr49", "fr50", "fr51", "fr52", "fr53", "fr54", "fr55", \ 02743 "fr56", "fr57", "fr58", "fr59", "fr60", "fr61", "fr62", "fr63", \ 02744 \ 02745 "fcc0", "fcc1", "fcc2", "fcc3", "icc0", "icc1", "icc2", "icc3", \ 02746 "cc0", "cc1", "cc2", "cc3", "cc4", "cc5", "cc6", "cc7", \ 02747 "acc0", "acc1", "acc2", "acc3", "acc4", "acc5", "acc6", "acc7", \ 02748 "acc8", "acc9", "acc10", "acc11", \ 02749 "accg0","accg1","accg2","accg3","accg4","accg5","accg6","accg7", \ 02750 "accg8", "accg9", "accg10", "accg11", \ 02751 "ap", "lr", "lcr", "iacc0h", "iacc0l" \ 02752 } 02753 02754 /* Define this macro if you are using an unusual assembler that 02755 requires different names for the machine instructions. 02756 02757 The definition is a C statement or statements which output an 02758 assembler instruction opcode to the stdio stream STREAM. The 02759 macro-operand PTR is a variable of type `char *' which points to 02760 the opcode name in its "internal" form--the form that is written 02761 in the machine description. The definition should output the 02762 opcode name to STREAM, performing any translation you desire, and 02763 increment the variable PTR to point at the end of the opcode so 02764 that it will not be output twice. 02765 02766 In fact, your macro definition may process less than the entire 02767 opcode name, or more than the opcode name; but if you want to 02768 process text that includes `%'-sequences to substitute operands, 02769 you must take care of the substitution yourself. Just be sure to 02770 increment PTR over whatever text should not be output normally. 02771 02772 If you need to look at the operand values, they can be found as the 02773 elements of `recog_operand'. 02774 02775 If the macro definition does nothing, the instruction is output in 02776 the usual way. */ 02777 02778 #define ASM_OUTPUT_OPCODE(STREAM, PTR)\ 02779 (PTR) = frv_asm_output_opcode (STREAM, PTR) 02780 02781 /* If defined, a C statement to be executed just prior to the output 02782 of assembler code for INSN, to modify the extracted operands so 02783 they will be output differently. 02784 02785 Here the argument OPVEC is the vector containing the operands 02786 extracted from INSN, and NOPERANDS is the number of elements of 02787 the vector which contain meaningful data for this insn. The 02788 contents of this vector are what will be used to convert the insn 02789 template into assembler code, so you can change the assembler 02790 output by changing the contents of the vector. 02791 02792 This macro is useful when various assembler syntaxes share a single 02793 file of instruction patterns; by defining this macro differently, 02794 you can cause a large class of instructions to be output 02795 differently (such as with rearranged operands). Naturally, 02796 variations in assembler syntax affecting individual insn patterns 02797 ought to be handled by writing conditional output routines in 02798 those patterns. 02799 02800 If this macro is not defined, it is equivalent to a null statement. */ 02801 02802 #define FINAL_PRESCAN_INSN(INSN, OPVEC, NOPERANDS)\ 02803 frv_final_prescan_insn (INSN, OPVEC, NOPERANDS) 02804 02805 02806 /* A C compound statement to output to stdio stream STREAM the assembler syntax 02807 for an instruction operand X. X is an RTL expression. 02808 02809 CODE is a value that can be used to specify one of several ways of printing 02810 the operand. It is used when identical operands must be printed differently 02811 depending on the context. CODE comes from the `%' specification that was 02812 used to request printing of the operand. If the specification was just 02813 `%DIGIT' then CODE is 0; if the specification was `%LTR DIGIT' then CODE is 02814 the ASCII code for LTR. 02815 02816 If X is a register, this macro should print the register's name. The names 02817 can be found in an array `reg_names' whose type is `char *[]'. `reg_names' 02818 is initialized from `REGISTER_NAMES'. 02819 02820 When the machine description has a specification `%PUNCT' (a `%' followed by 02821 a punctuation character), this macro is called with a null pointer for X and 02822 the punctuation character for CODE. */ 02823 #define PRINT_OPERAND(STREAM, X, CODE) frv_print_operand (STREAM, X, CODE) 02824 02825 /* A C expression which evaluates to true if CODE is a valid punctuation 02826 character for use in the `PRINT_OPERAND' macro. If 02827 `PRINT_OPERAND_PUNCT_VALID_P' is not defined, it means that no punctuation 02828 characters (except for the standard one, `%') are used in this way. */ 02829 /* . == gr0 02830 # == hint operand -- always zero for now 02831 @ == small data base register (gr16) 02832 ~ == pic register (gr17) 02833 * == temporary integer CCR register (cr3) 02834 & == temporary integer ICC register (icc3) */ 02835 #define PRINT_OPERAND_PUNCT_VALID_P(CODE) \ 02836 ((CODE) == '.' || (CODE) == '#' || (CODE) == '@' || (CODE) == '~' \ 02837 || (CODE) == '*' || (CODE) == '&') 02838 02839 /* A C compound statement to output to stdio stream STREAM the assembler syntax 02840 for an instruction operand that is a memory reference whose address is X. X 02841 is an RTL expression. 02842 02843 On some machines, the syntax for a symbolic address depends on the section 02844 that the address refers to. On these machines, define the macro 02845 `ENCODE_SECTION_INFO' to store the information into the `symbol_ref', and 02846 then check for it here. 02847 02848 This declaration must be present. */ 02849 #define PRINT_OPERAND_ADDRESS(STREAM, X) frv_print_operand_address (STREAM, X) 02850 02851 /* If defined, C string expressions to be used for the `%R', `%L', `%U', and 02852 `%I' options of `asm_fprintf' (see `final.c'). These are useful when a 02853 single `md' file must support multiple assembler formats. In that case, the 02854 various `tm.h' files can define these macros differently. 02855 02856 USER_LABEL_PREFIX is defined in svr4.h. */ 02857 #undef USER_LABEL_PREFIX 02858 #define USER_LABEL_PREFIX "" 02859 #define REGISTER_PREFIX "" 02860 #define LOCAL_LABEL_PREFIX "." 02861 #define IMMEDIATE_PREFIX "#" 02862 02863 02864 /* Output of dispatch tables. */ 02865 02866 /* This macro should be provided on machines where the addresses in a dispatch 02867 table are relative to the table's own address. 02868 02869 The definition should be a C statement to output to the stdio stream STREAM 02870 an assembler pseudo-instruction to generate a difference between two labels. 02871 VALUE and REL are the numbers of two internal labels. The definitions of 02872 these labels are output using `(*targetm.asm_out.internal_label)', and they must be 02873 printed in the same way here. For example, 02874 02875 fprintf (STREAM, "\t.word L%d-L%d\n", VALUE, REL) */ 02876 #define ASM_OUTPUT_ADDR_DIFF_ELT(STREAM, BODY, VALUE, REL) \ 02877 fprintf (STREAM, "\t.word .L%d-.L%d\n", VALUE, REL) 02878 02879 /* This macro should be provided on machines where the addresses in a dispatch 02880 table are absolute. 02881 02882 The definition should be a C statement to output to the stdio stream STREAM 02883 an assembler pseudo-instruction to generate a reference to a label. VALUE 02884 is the number of an internal label whose definition is output using 02885 `(*targetm.asm_out.internal_label)'. For example, 02886 02887 fprintf (STREAM, "\t.word L%d\n", VALUE) */ 02888 #define ASM_OUTPUT_ADDR_VEC_ELT(STREAM, VALUE) \ 02889 fprintf (STREAM, "\t.word .L%d\n", VALUE) 02890 02891 /* Define this if the label before a jump-table needs to be output specially. 02892 The first three arguments are the same as for `(*targetm.asm_out.internal_label)'; 02893 the fourth argument is the jump-table which follows (a `jump_insn' 02894 containing an `addr_vec' or `addr_diff_vec'). 02895 02896 This feature is used on system V to output a `swbeg' statement for the 02897 table. 02898 02899 If this macro is not defined, these labels are output with 02900 `(*targetm.asm_out.internal_label)'. 02901 02902 Defined in svr4.h. */ 02903 /* When generating embedded PIC or mips16 code we want to put the jump 02904 table in the .text section. In all other cases, we want to put the 02905 jump table in the .rdata section. Unfortunately, we can't use 02906 JUMP_TABLES_IN_TEXT_SECTION, because it is not conditional. 02907 Instead, we use ASM_OUTPUT_CASE_LABEL to switch back to the .text 02908 section if appropriate. */ 02909 02910 #undef ASM_OUTPUT_CASE_LABEL 02911 #define ASM_OUTPUT_CASE_LABEL(STREAM, PREFIX, NUM, TABLE) \ 02912 do { \ 02913 if (flag_pic) \ 02914 function_section (current_function_decl); \ 02915 (*targetm.asm_out.internal_label) (STREAM, PREFIX, NUM); \ 02916 } while (0) 02917 02918 02919 /* Assembler Commands for Exception Regions. */ 02920 02921 /* Define this macro to 0 if your target supports DWARF 2 frame unwind 02922 information, but it does not yet work with exception handling. Otherwise, 02923 if your target supports this information (if it defines 02924 `INCOMING_RETURN_ADDR_RTX' and either `UNALIGNED_INT_ASM_OP' or 02925 `OBJECT_FORMAT_ELF'), GCC will provide a default definition of 1. 02926 02927 If this macro is defined to 1, the DWARF 2 unwinder will be the default 02928 exception handling mechanism; otherwise, setjmp/longjmp will be used by 02929 default. 02930 02931 If this macro is defined to anything, the DWARF 2 unwinder will be used 02932 instead of inline unwinders and __unwind_function in the non-setjmp case. */ 02933 #define DWARF2_UNWIND_INFO 1 02934 02935 #define DWARF_FRAME_RETURN_COLUMN DWARF_FRAME_REGNUM (LR_REGNO) 02936 02937 /* Assembler Commands for Alignment. */ 02938 02939 /* A C statement to output to the stdio stream STREAM an assembler instruction 02940 to advance the location counter by NBYTES bytes. Those bytes should be zero 02941 when loaded. NBYTES will be a C expression of type `int'. 02942 02943 Defined in svr4.h. */ 02944 #undef ASM_OUTPUT_SKIP 02945 #define ASM_OUTPUT_SKIP(STREAM, NBYTES) \ 02946 fprintf (STREAM, "\t.zero\t%u\n", (int)(NBYTES)) 02947 02948 /* A C statement to output to the stdio stream STREAM an assembler command to 02949 advance the location counter to a multiple of 2 to the POWER bytes. POWER 02950 will be a C expression of type `int'. */ 02951 #define ASM_OUTPUT_ALIGN(STREAM, POWER) \ 02952 fprintf ((STREAM), "\t.p2align %d\n", (POWER)) 02953 02954 /* Inside the text section, align with unpacked nops rather than zeros. */ 02955 #define ASM_OUTPUT_ALIGN_WITH_NOP(STREAM, POWER) \ 02956 fprintf ((STREAM), "\t.p2alignl %d,0x80880000\n", (POWER)) 02957 02958 /* Macros Affecting all Debug Formats. */ 02959 02960 /* A C expression that returns the DBX register number for the compiler 02961 register number REGNO. In simple cases, the value of this expression may be 02962 REGNO itself. But sometimes there are some registers that the compiler 02963 knows about and DBX does not, or vice versa. In such cases, some register 02964 may need to have one number in the compiler and another for DBX. 02965 02966 If two registers have consecutive numbers inside GCC, and they can be 02967 used as a pair to hold a multiword value, then they *must* have consecutive 02968 numbers after renumbering with `DBX_REGISTER_NUMBER'. Otherwise, debuggers 02969 will be unable to access such a pair, because they expect register pairs to 02970 be consecutive in their own numbering scheme. 02971 02972 If you find yourself defining `DBX_REGISTER_NUMBER' in way that does not 02973 preserve register pairs, then what you must do instead is redefine the 02974 actual register numbering scheme. 02975 02976 This declaration is required. */ 02977 #define DBX_REGISTER_NUMBER(REGNO) (REGNO) 02978 02979 /* A C expression that returns the type of debugging output GCC produces 02980 when the user specifies `-g' or `-ggdb'. Define this if you have arranged 02981 for GCC to support more than one format of debugging output. Currently, 02982 the allowable values are `DBX_DEBUG', `SDB_DEBUG', `DWARF_DEBUG', 02983 `DWARF2_DEBUG', and `XCOFF_DEBUG'. 02984 02985 The value of this macro only affects the default debugging output; the user 02986 can always get a specific type of output by using `-gstabs', `-gcoff', 02987 `-gdwarf-1', `-gdwarf-2', or `-gxcoff'. 02988 02989 Defined in svr4.h. */ 02990 #undef PREFERRED_DEBUGGING_TYPE 02991 #define PREFERRED_DEBUGGING_TYPE DWARF2_DEBUG 02992 02993 /* Miscellaneous Parameters. */ 02994 02995 /* Define this if you have defined special-purpose predicates in the file 02996 `MACHINE.c'. This macro is called within an initializer of an array of 02997 structures. The first field in the structure is the name of a predicate and 02998 the second field is an array of rtl codes. For each predicate, list all rtl 02999 codes that can be in expressions matched by the predicate. The list should 03000 have a trailing comma. Here is an example of two entries in the list for a 03001 typical RISC machine: 03002 03003 #define PREDICATE_CODES \ 03004 {"gen_reg_rtx_operand", {SUBREG, REG}}, \ 03005 {"reg_or_short_cint_operand", {SUBREG, REG, CONST_INT}}, 03006 03007 Defining this macro does not affect the generated code (however, incorrect 03008 definitions that omit an rtl code that may be matched by the predicate can 03009 cause the compiler to malfunction). Instead, it allows the table built by 03010 `genrecog' to be more compact and efficient, thus speeding up the compiler. 03011 The most important predicates to include in the list specified by this macro 03012 are thoses used in the most insn patterns. */ 03013 #define PREDICATE_CODES \ 03014 { "integer_register_operand", { REG, SUBREG }}, \ 03015 { "frv_load_operand", { REG, SUBREG, MEM }}, \ 03016 { "gpr_no_subreg_operand", { REG }}, \ 03017 { "gpr_or_fpr_operand", { REG, SUBREG }}, \ 03018 { "gpr_or_int12_operand", { REG, SUBREG, CONST_INT }}, \ 03019 { "gpr_fpr_or_int12_operand", { REG, SUBREG, CONST_INT }}, \ 03020 { "gpr_or_int10_operand", { REG, SUBREG, CONST_INT }}, \ 03021 { "gpr_or_int_operand", { REG, SUBREG, CONST_INT }}, \ 03022 { "move_source_operand", { REG, SUBREG, CONST_INT, MEM, \ 03023 CONST_DOUBLE, CONST, \ 03024 SYMBOL_REF, LABEL_REF }}, \ 03025 { "move_destination_operand", { REG, SUBREG, MEM }}, \ 03026 { "movcc_fp_destination_operand", { REG, SUBREG, MEM }}, \ 03027 { "condexec_source_operand", { REG, SUBREG, CONST_INT, MEM, \ 03028 CONST_DOUBLE }}, \ 03029 { "condexec_dest_operand", { REG, SUBREG, MEM }}, \ 03030 { "reg_or_0_operand", { REG, SUBREG, CONST_INT }}, \ 03031 { "lr_operand", { REG }}, \ 03032 { "gpr_or_memory_operand", { REG, SUBREG, MEM }}, \ 03033 { "gpr_or_memory_operand_with_scratch", { REG, SUBREG, MEM }}, \ 03034 { "fpr_or_memory_operand", { REG, SUBREG, MEM }}, \ 03035 { "int12_operand", { CONST_INT }}, \ 03036 { "int_2word_operand", { CONST_INT, CONST_DOUBLE, \ 03037 SYMBOL_REF, LABEL_REF, CONST }}, \ 03038 { "fdpic_operand", { REG }}, \ 03039 { "fdpic_fptr_operand", { REG }}, \ 03040 { "ldd_address_operand", { REG, SUBREG, PLUS }}, \ 03041 { "got12_operand", { CONST }}, \ 03042 { "const_unspec_operand", { CONST }}, \ 03043 { "icc_operand", { REG }}, \ 03044 { "fcc_operand", { REG }}, \ 03045 { "cc_operand", { REG }}, \ 03046 { "icr_operand", { REG }}, \ 03047 { "fcr_operand", { REG }}, \ 03048 { "cr_operand", { REG }}, \ 03049 { "fpr_operand", { REG, SUBREG }}, \ 03050 { "even_reg_operand", { REG, SUBREG }}, \ 03051 { "odd_reg_operand", { REG, SUBREG }}, \ 03052 { "even_gpr_operand", { REG, SUBREG }}, \ 03053 { "odd_gpr_operand", { REG, SUBREG }}, \ 03054 { "quad_fpr_operand", { REG, SUBREG }}, \ 03055 { "even_fpr_operand", { REG, SUBREG }}, \ 03056 { "odd_fpr_operand", { REG, SUBREG }}, \ 03057 { "dbl_memory_one_insn_operand", { MEM }}, \ 03058 { "dbl_memory_two_insn_operand", { MEM }}, \ 03059 { "call_operand", { REG, SUBREG, CONST_INT, \ 03060 CONST, SYMBOL_REF }}, \ 03061 { "sibcall_operand", { REG, SUBREG, CONST_INT, \ 03062 CONST }}, \ 03063 { "upper_int16_operand", { CONST_INT }}, \ 03064 { "uint16_operand", { CONST_INT }}, \ 03065 { "symbolic_operand", { SYMBOL_REF, CONST_INT }}, \ 03066 { "relational_operator", { EQ, NE, LE, LT, GE, GT, \ 03067 LEU, LTU, GEU, GTU }}, \ 03068 { "integer_relational_operator", { EQ, NE, LE, LT, GE, GT, \ 03069 LEU, LTU, GEU, GTU }}, \ 03070 { "float_relational_operator", { EQ, NE, LE, LT, GE, GT }}, \ 03071 { "ccr_eqne_operator", { EQ, NE }}, \ 03072 { "minmax_operator", { SMIN, SMAX, UMIN, UMAX }}, \ 03073 { "condexec_si_binary_operator", { PLUS, MINUS, AND, IOR, XOR, \ 03074 ASHIFT, ASHIFTRT, LSHIFTRT }}, \ 03075 { "condexec_si_media_operator", { AND, IOR, XOR }}, \ 03076 { "condexec_si_divide_operator", { DIV, UDIV }}, \ 03077 { "condexec_si_unary_operator", { NOT, NEG }}, \ 03078 { "condexec_sf_add_operator", { PLUS, MINUS }}, \ 03079 { "condexec_sf_conv_operator", { ABS, NEG }}, \ 03080 { "intop_compare_operator", { PLUS, MINUS, AND, IOR, XOR, \ 03081 ASHIFT, ASHIFTRT, LSHIFTRT }}, \ 03082 { "fpr_or_int6_operand", { REG, SUBREG, CONST_INT }}, \ 03083 { "int6_operand", { CONST_INT }}, \ 03084 { "int5_operand", { CONST_INT }}, \ 03085 { "uint5_operand", { CONST_INT }}, \ 03086 { "uint4_operand", { CONST_INT }}, \ 03087 { "uint1_operand", { CONST_INT }}, \ 03088 { "acc_operand", { REG, SUBREG }}, \ 03089 { "even_acc_operand", { REG, SUBREG }}, \ 03090 { "quad_acc_operand", { REG, SUBREG }}, \ 03091 { "accg_operand", { REG, SUBREG }}, 03092 03093 /* An alias for a machine mode name. This is the machine mode that elements of 03094 a jump-table should have. */ 03095 #define CASE_VECTOR_MODE SImode 03096 03097 /* Define this macro if operations between registers with integral mode smaller 03098 than a word are always performed on the entire register. Most RISC machines 03099 have this property and most CISC machines do not. */ 03100 #define WORD_REGISTER_OPERATIONS 03101 03102 /* Define this macro to be a C expression indicating when insns that read 03103 memory in MODE, an integral mode narrower than a word, set the bits outside 03104 of MODE to be either the sign-extension or the zero-extension of the data 03105 read. Return `SIGN_EXTEND' for values of MODE for which the insn 03106 sign-extends, `ZERO_EXTEND' for which it zero-extends, and `UNKNOWN' for other 03107 modes. 03108 03109 This macro is not called with MODE non-integral or with a width greater than 03110 or equal to `BITS_PER_WORD', so you may return any value in this case. Do 03111 not define this macro if it would always return `UNKNOWN'. On machines where 03112 this macro is defined, you will normally define it as the constant 03113 `SIGN_EXTEND' or `ZERO_EXTEND'. */ 03114 #define LOAD_EXTEND_OP(MODE) SIGN_EXTEND 03115 03116 /* Define if loading short immediate values into registers sign extends. */ 03117 #define SHORT_IMMEDIATES_SIGN_EXTEND 03118 03119 /* The maximum number of bytes that a single instruction can move quickly from 03120 memory to memory. */ 03121 #define MOVE_MAX 8 03122 03123 /* A C expression which is nonzero if on this machine it is safe to "convert" 03124 an integer of INPREC bits to one of OUTPREC bits (where OUTPREC is smaller 03125 than INPREC) by merely operating on it as if it had only OUTPREC bits. 03126 03127 On many machines, this expression can be 1. 03128 03129 When `TRULY_NOOP_TRUNCATION' returns 1 for a pair of sizes for modes for 03130 which `MODES_TIEABLE_P' is 0, suboptimal code can result. If this is the 03131 case, making `TRULY_NOOP_TRUNCATION' return 0 in such cases may improve 03132 things. */ 03133 #define TRULY_NOOP_TRUNCATION(OUTPREC, INPREC) 1 03134 03135 /* An alias for the machine mode for pointers. On most machines, define this 03136 to be the integer mode corresponding to the width of a hardware pointer; 03137 `SImode' on 32-bit machine or `DImode' on 64-bit machines. On some machines 03138 you must define this to be one of the partial integer modes, such as 03139 `PSImode'. 03140 03141 The width of `Pmode' must be at least as large as the value of 03142 `POINTER_SIZE'. If it is not equal, you must define the macro 03143 `POINTERS_EXTEND_UNSIGNED' to specify how pointers are extended to `Pmode'. */ 03144 #define Pmode SImode 03145 03146 /* An alias for the machine mode used for memory references to functions being 03147 called, in `call' RTL expressions. On most machines this should be 03148 `QImode'. */ 03149 #define FUNCTION_MODE QImode 03150 03151 /* Define this macro to handle System V style pragmas: #pragma pack and 03152 #pragma weak. Note, #pragma weak will only be supported if SUPPORT_WEAK is 03153 defined. 03154 03155 Defined in svr4.h. */ 03156 #define HANDLE_SYSV_PRAGMA 1 03157 03158 /* A C expression for the maximum number of instructions to execute via 03159 conditional execution instructions instead of a branch. A value of 03160 BRANCH_COST+1 is the default if the machine does not use 03161 cc0, and 1 if it does use cc0. */ 03162 #define MAX_CONDITIONAL_EXECUTE frv_condexec_insns 03163 03164 /* Default value of MAX_CONDITIONAL_EXECUTE if no -mcond-exec-insns= */ 03165 #define DEFAULT_CONDEXEC_INSNS 8 03166 03167 /* A C expression to modify the code described by the conditional if 03168 information CE_INFO, possibly updating the tests in TRUE_EXPR, and 03169 FALSE_EXPR for converting if-then and if-then-else code to conditional 03170 instructions. Set either TRUE_EXPR or FALSE_EXPR to a null pointer if the 03171 tests cannot be converted. */ 03172 #define IFCVT_MODIFY_TESTS(CE_INFO, TRUE_EXPR, FALSE_EXPR) \ 03173 frv_ifcvt_modify_tests (CE_INFO, &TRUE_EXPR, &FALSE_EXPR) 03174 03175 /* A C expression to modify the code described by the conditional if 03176 information CE_INFO, for the basic block BB, possibly updating the tests in 03177 TRUE_EXPR, and FALSE_EXPR for converting the && and || parts of if-then or 03178 if-then-else code to conditional instructions. OLD_TRUE and OLD_FALSE are 03179 the previous tests. Set either TRUE_EXPR or FALSE_EXPR to a null pointer if 03180 the tests cannot be converted. */ 03181 #define IFCVT_MODIFY_MULTIPLE_TESTS(CE_INFO, BB, TRUE_EXPR, FALSE_EXPR) \ 03182 frv_ifcvt_modify_multiple_tests (CE_INFO, BB, &TRUE_EXPR, &FALSE_EXPR) 03183 03184 /* A C expression to modify the code described by the conditional if 03185 information CE_INFO with the new PATTERN in INSN. If PATTERN is a null 03186 pointer after the IFCVT_MODIFY_INSN macro executes, it is assumed that that 03187 insn cannot be converted to be executed conditionally. */ 03188 #define IFCVT_MODIFY_INSN(CE_INFO, PATTERN, INSN) \ 03189 (PATTERN) = frv_ifcvt_modify_insn (CE_INFO, PATTERN, INSN) 03190 03191 /* A C expression to perform any final machine dependent modifications in 03192 converting code to conditional execution in the code described by the 03193 conditional if information CE_INFO. */ 03194 #define IFCVT_MODIFY_FINAL(CE_INFO) frv_ifcvt_modify_final (CE_INFO) 03195 03196 /* A C expression to cancel any machine dependent modifications in converting 03197 code to conditional execution in the code described by the conditional if 03198 information CE_INFO. */ 03199 #define IFCVT_MODIFY_CANCEL(CE_INFO) frv_ifcvt_modify_cancel (CE_INFO) 03200 03201 /* Initialize the extra fields provided by IFCVT_EXTRA_FIELDS. */ 03202 #define IFCVT_INIT_EXTRA_FIELDS(CE_INFO) frv_ifcvt_init_extra_fields (CE_INFO) 03203 03204 /* The definition of the following macro results in that the 2nd jump 03205 optimization (after the 2nd insn scheduling) is minimal. It is 03206 necessary to define when start cycle marks of insns (TImode is used 03207 for this) is used for VLIW insn packing. Some jump optimizations 03208 make such marks invalid. These marks are corrected for some 03209 (minimal) optimizations. ??? Probably the macro is temporary. 03210 Final solution could making the 2nd jump optimizations before the 03211 2nd instruction scheduling or corrections of the marks for all jump 03212 optimizations. Although some jump optimizations are actually 03213 deoptimizations for VLIW (super-scalar) processors. */ 03214 03215 #define MINIMAL_SECOND_JUMP_OPTIMIZATION 03216 03217 03218 /* If the following macro is defined and nonzero and deterministic 03219 finite state automata are used for pipeline hazard recognition, the 03220 code making resource-constrained software pipelining is on. */ 03221 #define RCSP_SOFTWARE_PIPELINING 1 03222 03223 /* If the following macro is defined and nonzero and deterministic 03224 finite state automata are used for pipeline hazard recognition, we 03225 will try to exchange insns in queue ready to improve the schedule. 03226 The more macro value, the more tries will be made. */ 03227 #define FIRST_CYCLE_MULTIPASS_SCHEDULING 1 03228 03229 /* The following macro is used only when value of 03230 FIRST_CYCLE_MULTIPASS_SCHEDULING is nonzero. The more macro value, 03231 the more tries will be made to choose better schedule. If the 03232 macro value is zero or negative there will be no multi-pass 03233 scheduling. */ 03234 #define FIRST_CYCLE_MULTIPASS_SCHEDULING_LOOKAHEAD frv_sched_lookahead 03235 03236 enum frv_builtins 03237 { 03238 FRV_BUILTIN_MAND, 03239 FRV_BUILTIN_MOR, 03240 FRV_BUILTIN_MXOR, 03241 FRV_BUILTIN_MNOT, 03242 FRV_BUILTIN_MAVEH, 03243 FRV_BUILTIN_MSATHS, 03244 FRV_BUILTIN_MSATHU, 03245 FRV_BUILTIN_MADDHSS, 03246 FRV_BUILTIN_MADDHUS, 03247 FRV_BUILTIN_MSUBHSS, 03248 FRV_BUILTIN_MSUBHUS, 03249 FRV_BUILTIN_MPACKH, 03250 FRV_BUILTIN_MQADDHSS, 03251 FRV_BUILTIN_MQADDHUS, 03252 FRV_BUILTIN_MQSUBHSS, 03253 FRV_BUILTIN_MQSUBHUS, 03254 FRV_BUILTIN_MUNPACKH, 03255 FRV_BUILTIN_MDPACKH, 03256 FRV_BUILTIN_MBTOH, 03257 FRV_BUILTIN_MHTOB, 03258 FRV_BUILTIN_MCOP1, 03259 FRV_BUILTIN_MCOP2, 03260 FRV_BUILTIN_MROTLI, 03261 FRV_BUILTIN_MROTRI, 03262 FRV_BUILTIN_MWCUT, 03263 FRV_BUILTIN_MSLLHI, 03264 FRV_BUILTIN_MSRLHI, 03265 FRV_BUILTIN_MSRAHI, 03266 FRV_BUILTIN_MEXPDHW, 03267 FRV_BUILTIN_MEXPDHD, 03268 FRV_BUILTIN_MMULHS, 03269 FRV_BUILTIN_MMULHU, 03270 FRV_BUILTIN_MMULXHS, 03271 FRV_BUILTIN_MMULXHU, 03272 FRV_BUILTIN_MMACHS, 03273 FRV_BUILTIN_MMACHU, 03274 FRV_BUILTIN_MMRDHS, 03275 FRV_BUILTIN_MMRDHU, 03276 FRV_BUILTIN_MQMULHS, 03277 FRV_BUILTIN_MQMULHU, 03278 FRV_BUILTIN_MQMULXHU, 03279 FRV_BUILTIN_MQMULXHS, 03280 FRV_BUILTIN_MQMACHS, 03281 FRV_BUILTIN_MQMACHU, 03282 FRV_BUILTIN_MCPXRS, 03283 FRV_BUILTIN_MCPXRU, 03284 FRV_BUILTIN_MCPXIS, 03285 FRV_BUILTIN_MCPXIU, 03286 FRV_BUILTIN_MQCPXRS, 03287 FRV_BUILTIN_MQCPXRU, 03288 FRV_BUILTIN_MQCPXIS, 03289 FRV_BUILTIN_MQCPXIU, 03290 FRV_BUILTIN_MCUT, 03291 FRV_BUILTIN_MCUTSS, 03292 FRV_BUILTIN_MWTACC, 03293 FRV_BUILTIN_MWTACCG, 03294 FRV_BUILTIN_MRDACC, 03295 FRV_BUILTIN_MRDACCG, 03296 FRV_BUILTIN_MTRAP, 03297 FRV_BUILTIN_MCLRACC, 03298 FRV_BUILTIN_MCLRACCA, 03299 FRV_BUILTIN_MDUNPACKH, 03300 FRV_BUILTIN_MBTOHE, 03301 FRV_BUILTIN_MQXMACHS, 03302 FRV_BUILTIN_MQXMACXHS, 03303 FRV_BUILTIN_MQMACXHS, 03304 FRV_BUILTIN_MADDACCS, 03305 FRV_BUILTIN_MSUBACCS, 03306 FRV_BUILTIN_MASACCS, 03307 FRV_BUILTIN_MDADDACCS, 03308 FRV_BUILTIN_MDSUBACCS, 03309 FRV_BUILTIN_MDASACCS, 03310 FRV_BUILTIN_MABSHS, 03311 FRV_BUILTIN_MDROTLI, 03312 FRV_BUILTIN_MCPLHI, 03313 FRV_BUILTIN_MCPLI, 03314 FRV_BUILTIN_MDCUTSSI, 03315 FRV_BUILTIN_MQSATHS, 03316 FRV_BUILTIN_MQLCLRHS, 03317 FRV_BUILTIN_MQLMTHS, 03318 FRV_BUILTIN_MQSLLHI, 03319 FRV_BUILTIN_MQSRAHI, 03320 FRV_BUILTIN_MHSETLOS, 03321 FRV_BUILTIN_MHSETLOH, 03322 FRV_BUILTIN_MHSETHIS, 03323 FRV_BUILTIN_MHSETHIH, 03324 FRV_BUILTIN_MHDSETS, 03325 FRV_BUILTIN_MHDSETH, 03326 FRV_BUILTIN_SMUL, 03327 FRV_BUILTIN_UMUL, 03328 FRV_BUILTIN_PREFETCH0, 03329 FRV_BUILTIN_PREFETCH, 03330 FRV_BUILTIN_SMASS, 03331 FRV_BUILTIN_SMSSS, 03332 FRV_BUILTIN_SMU, 03333 FRV_BUILTIN_SCUTSS, 03334 FRV_BUILTIN_ADDSS, 03335 FRV_BUILTIN_SUBSS, 03336 FRV_BUILTIN_SLASS, 03337 FRV_BUILTIN_IACCreadll, 03338 FRV_BUILTIN_IACCreadl, 03339 FRV_BUILTIN_IACCsetll, 03340 FRV_BUILTIN_IACCsetl, 03341 FRV_BUILTIN_SCAN 03342 }; 03343 #define FRV_BUILTIN_FIRST_NONMEDIA FRV_BUILTIN_SMUL 03344 03345 /* Enable prototypes on the call rtl functions. */ 03346 #define MD_CALL_PROTOTYPES 1 03347 03348 extern GTY(()) rtx frv_compare_op0; /* operand save for */ 03349 extern GTY(()) rtx frv_compare_op1; /* comparison generation */ 03350 03351 #define CPU_UNITS_QUERY 1 03352 03353 #ifdef __FRV_FDPIC__ 03354 #define CRT_GET_RFIB_DATA(dbase) \ 03355 ({ extern void *_GLOBAL_OFFSET_TABLE_; (dbase) = &_GLOBAL_OFFSET_TABLE_; }) 03356 #endif 03357 03358 #endif /* __FRV_H__ */
1.5.6