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