00001 /* Definitions of target machine for GNU compiler, 00002 for ATMEL AVR at90s8515, ATmega103/103L, ATmega603/603L microcontrollers. 00003 Copyright (C) 1998, 1999, 2000, 2001, 2002 Free Software Foundation, Inc. 00004 Contributed by Denis Chertykov (denisc@overta.ru) 00005 00006 This file is part of GNU CC. 00007 00008 GNU CC is free software; you can redistribute it and/or modify 00009 it under the terms of the GNU General Public License as published by 00010 the Free Software Foundation; either version 2, or (at your option) 00011 any later version. 00012 00013 GNU CC is distributed in the hope that it will be useful, 00014 but WITHOUT ANY WARRANTY; without even the implied warranty of 00015 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00016 GNU General Public License for more details. 00017 00018 You should have received a copy of the GNU General Public License 00019 along with GNU CC; see the file COPYING. If not, write to 00020 the Free Software Foundation, 59 Temple Place - Suite 330, 00021 Boston, MA 02111-1307, USA. */ 00022 00023 /* Names to predefine in the preprocessor for this target machine. */ 00024 00025 #define CPP_PREDEFINES "-DAVR" 00026 00027 00028 /* This declaration should be present. */ 00029 extern int target_flags; 00030 00031 #define MASK_RTL_DUMP 0x00000010 00032 #define MASK_ALL_DEBUG 0x00000FE0 00033 #define MASK_ORDER_1 0x00001000 00034 #define MASK_INSN_SIZE_DUMP 0x00002000 00035 #define MASK_ORDER_2 0x00004000 00036 #define MASK_NO_TABLEJUMP 0x00008000 00037 #define MASK_INT8 0x00010000 00038 #define MASK_NO_INTERRUPTS 0x00020000 00039 #define MASK_CALL_PROLOGUES 0x00040000 00040 #define MASK_TINY_STACK 0x00080000 00041 00042 #define TARGET_ORDER_1 (target_flags & MASK_ORDER_1) 00043 #define TARGET_ORDER_2 (target_flags & MASK_ORDER_2) 00044 #define TARGET_INT8 (target_flags & MASK_INT8) 00045 #define TARGET_NO_INTERRUPTS (target_flags & MASK_NO_INTERRUPTS) 00046 #define TARGET_INSN_SIZE_DUMP (target_flags & MASK_INSN_SIZE_DUMP) 00047 #define TARGET_CALL_PROLOGUES (target_flags & MASK_CALL_PROLOGUES) 00048 #define TARGET_TINY_STACK (target_flags & MASK_TINY_STACK) 00049 #define TARGET_NO_TABLEJUMP (target_flags & MASK_NO_TABLEJUMP) 00050 00051 /* Dump each assembler insn's rtl into the output file. 00052 This is for debugging the compiler itself. */ 00053 00054 #define TARGET_RTL_DUMP (target_flags & MASK_RTL_DUMP) 00055 #define TARGET_ALL_DEBUG (target_flags & MASK_ALL_DEBUG) 00056 00057 00058 00059 00060 #define TARGET_SWITCHES { \ 00061 { "order1", MASK_ORDER_1, NULL }, \ 00062 { "order2", MASK_ORDER_2, NULL }, \ 00063 { "int8", MASK_INT8, N_("Assume int to be 8 bit integer") }, \ 00064 { "no-interrupts", MASK_NO_INTERRUPTS, \ 00065 N_("Change the stack pointer without disabling interrupts") }, \ 00066 { "call-prologues", MASK_CALL_PROLOGUES, \ 00067 N_("Use subroutines for function prologue/epilogue") }, \ 00068 { "tiny-stack", MASK_TINY_STACK, \ 00069 N_("Change only the low 8 bits of the stack pointer") }, \ 00070 { "no-tablejump", MASK_NO_TABLEJUMP, \ 00071 N_("Do not generate tablejump insns") }, \ 00072 { "rtl", MASK_RTL_DUMP, NULL }, \ 00073 { "size", MASK_INSN_SIZE_DUMP, \ 00074 N_("Output instruction sizes to the asm file") }, \ 00075 { "deb", MASK_ALL_DEBUG, NULL }, \ 00076 { "", 0, NULL } } 00077 00078 extern const char *avr_init_stack; 00079 extern const char *avr_mcu_name; 00080 extern int avr_mega_p; 00081 extern int avr_enhanced_p; 00082 00083 #define AVR_MEGA (avr_mega_p) 00084 #define AVR_ENHANCED (avr_enhanced_p) 00085 00086 #define TARGET_OPTIONS { \ 00087 { "init-stack=", &avr_init_stack, N_("Specify the initial stack address") }, \ 00088 { "mcu=", &avr_mcu_name, N_("Specify the MCU name") } } 00089 00090 #define TARGET_VERSION fprintf (stderr, " (GNU assembler syntax)"); 00091 /* This macro is a C statement to print on `stderr' a string 00092 describing the particular machine description choice. Every 00093 machine description should define `TARGET_VERSION'. For example: 00094 00095 #ifdef MOTOROLA 00096 #define TARGET_VERSION \ 00097 fprintf (stderr, " (68k, Motorola syntax)"); 00098 #else 00099 #define TARGET_VERSION \ 00100 fprintf (stderr, " (68k, MIT syntax)"); 00101 #endif */ 00102 00103 #define OVERRIDE_OPTIONS avr_override_options() 00104 /* `OVERRIDE_OPTIONS' 00105 Sometimes certain combinations of command options do not make 00106 sense on a particular target machine. You can define a macro 00107 `OVERRIDE_OPTIONS' to take account of this. This macro, if 00108 defined, is executed once just after all the command options have 00109 been parsed. 00110 00111 Don't use this macro to turn on various extra optimizations for 00112 `-O'. That is what `OPTIMIZATION_OPTIONS' is for. */ 00113 00114 #define CAN_DEBUG_WITHOUT_FP 00115 /* Define this macro if debugging can be performed even without a 00116 frame pointer. If this macro is defined, GNU CC will turn on the 00117 `-fomit-frame-pointer' option whenever `-O' is specified. */ 00118 00119 /* Define this if most significant byte of a word is the lowest numbered. */ 00120 #define BITS_BIG_ENDIAN 0 00121 00122 /* Define this if most significant byte of a word is the lowest numbered. */ 00123 #define BYTES_BIG_ENDIAN 0 00124 00125 /* Define this if most significant word of a multiword number is the lowest 00126 numbered. */ 00127 #define WORDS_BIG_ENDIAN 0 00128 00129 /* number of bits in an addressable storage unit */ 00130 #define BITS_PER_UNIT 8 00131 00132 /* Width in bits of a "word", which is the contents of a machine register. 00133 Note that this is not necessarily the width of data type `int'; */ 00134 #define BITS_PER_WORD 8 00135 00136 #ifdef IN_LIBGCC2 00137 /* This is to get correct SI and DI modes in libgcc2.c (32 and 64 bits). */ 00138 #define UNITS_PER_WORD 4 00139 #else 00140 /* Width of a word, in units (bytes). */ 00141 #define UNITS_PER_WORD 1 00142 #endif 00143 00144 /* Width in bits of a pointer. 00145 See also the macro `Pmode' defined below. */ 00146 #define POINTER_SIZE 16 00147 00148 00149 /* Maximum sized of reasonable data type 00150 DImode or Dfmode ... */ 00151 #define MAX_FIXED_MODE_SIZE 32 00152 00153 /* Allocation boundary (in *bits*) for storing arguments in argument list. */ 00154 #define PARM_BOUNDARY 8 00155 00156 /* Allocation boundary (in *bits*) for the code of a function. */ 00157 #define FUNCTION_BOUNDARY 8 00158 00159 /* Alignment of field after `int : 0' in a structure. */ 00160 #define EMPTY_FIELD_BOUNDARY 8 00161 00162 /* No data type wants to be aligned rounder than this. */ 00163 #define BIGGEST_ALIGNMENT 8 00164 00165 00166 /* Define this if move instructions will actually fail to work 00167 when given unaligned data. */ 00168 #define STRICT_ALIGNMENT 0 00169 00170 /* A C expression for the size in bits of the type `int' on the 00171 target machine. If you don't define this, the default is one word. */ 00172 #define INT_TYPE_SIZE (TARGET_INT8 ? 8 : 16) 00173 00174 00175 /* A C expression for the size in bits of the type `short' on the 00176 target machine. If you don't define this, the default is half a 00177 word. (If this would be less than one storage unit, it is rounded 00178 up to one unit.) */ 00179 #define SHORT_TYPE_SIZE (INT_TYPE_SIZE == 8 ? INT_TYPE_SIZE : 16) 00180 00181 /* A C expression for the size in bits of the type `long' on the 00182 target machine. If you don't define this, the default is one word. */ 00183 #define LONG_TYPE_SIZE (INT_TYPE_SIZE == 8 ? 16 : 32) 00184 00185 #define MAX_LONG_TYPE_SIZE 32 00186 /* Maximum number for the size in bits of the type `long' on the 00187 target machine. If this is undefined, the default is 00188 `LONG_TYPE_SIZE'. Otherwise, it is the constant value that is the 00189 largest value that `LONG_TYPE_SIZE' can have at run-time. This is 00190 used in `cpp'. */ 00191 00192 00193 #define LONG_LONG_TYPE_SIZE 64 00194 /* A C expression for the size in bits of the type `long long' on the 00195 target machine. If you don't define this, the default is two 00196 words. If you want to support GNU Ada on your machine, the value 00197 of macro must be at least 64. */ 00198 00199 00200 #define CHAR_TYPE_SIZE 8 00201 /* A C expression for the size in bits of the type `char' on the 00202 target machine. If you don't define this, the default is one 00203 quarter of a word. (If this would be less than one storage unit, 00204 it is rounded up to one unit.) */ 00205 00206 #define FLOAT_TYPE_SIZE 32 00207 /* A C expression for the size in bits of the type `float' on the 00208 target machine. If you don't define this, the default is one word. */ 00209 00210 #define DOUBLE_TYPE_SIZE 32 00211 /* A C expression for the size in bits of the type `double' on the 00212 target machine. If you don't define this, the default is two 00213 words. */ 00214 00215 00216 #define LONG_DOUBLE_TYPE_SIZE 32 00217 /* A C expression for the size in bits of the type `long double' on 00218 the target machine. If you don't define this, the default is two 00219 words. */ 00220 00221 #define DEFAULT_SIGNED_CHAR 1 00222 /* An expression whose value is 1 or 0, according to whether the type 00223 `char' should be signed or unsigned by default. The user can 00224 always override this default with the options `-fsigned-char' and 00225 `-funsigned-char'. */ 00226 00227 /* `DEFAULT_SHORT_ENUMS' 00228 A C expression to determine whether to give an `enum' type only as 00229 many bytes as it takes to represent the range of possible values 00230 of that type. A nonzero value means to do that; a zero value 00231 means all `enum' types should be allocated like `int'. 00232 00233 If you don't define the macro, the default is 0. */ 00234 00235 #define SIZE_TYPE (INT_TYPE_SIZE == 8 ? "long unsigned int" : "unsigned int") 00236 /* A C expression for a string describing the name of the data type 00237 to use for size values. The typedef name `size_t' is defined 00238 using the contents of the string. 00239 00240 The string can contain more than one keyword. If so, separate 00241 them with spaces, and write first any length keyword, then 00242 `unsigned' if appropriate, and finally `int'. The string must 00243 exactly match one of the data type names defined in the function 00244 `init_decl_processing' in the file `c-decl.c'. You may not omit 00245 `int' or change the order--that would cause the compiler to crash 00246 on startup. 00247 00248 If you don't define this macro, the default is `"long unsigned 00249 int"'. */ 00250 00251 #define PTRDIFF_TYPE (INT_TYPE_SIZE == 8 ? "long int" :"int") 00252 /* A C expression for a string describing the name of the data type 00253 to use for the result of subtracting two pointers. The typedef 00254 name `ptrdiff_t' is defined using the contents of the string. See 00255 `SIZE_TYPE' above for more information. 00256 00257 If you don't define this macro, the default is `"long int"'. */ 00258 00259 00260 #define WCHAR_TYPE_SIZE 16 00261 /* A C expression for the size in bits of the data type for wide 00262 characters. This is used in `cpp', which cannot make use of 00263 `WCHAR_TYPE'. */ 00264 00265 #define FIRST_PSEUDO_REGISTER 36 00266 /* Number of hardware registers known to the compiler. They receive 00267 numbers 0 through `FIRST_PSEUDO_REGISTER-1'; thus, the first 00268 pseudo register's number really is assigned the number 00269 `FIRST_PSEUDO_REGISTER'. */ 00270 00271 #define FIXED_REGISTERS {\ 00272 1,1,/* r0 r1 */\ 00273 0,0,/* r2 r3 */\ 00274 0,0,/* r4 r5 */\ 00275 0,0,/* r6 r7 */\ 00276 0,0,/* r8 r9 */\ 00277 0,0,/* r10 r11 */\ 00278 0,0,/* r12 r13 */\ 00279 0,0,/* r14 r15 */\ 00280 0,0,/* r16 r17 */\ 00281 0,0,/* r18 r19 */\ 00282 0,0,/* r20 r21 */\ 00283 0,0,/* r22 r23 */\ 00284 0,0,/* r24 r25 */\ 00285 0,0,/* r26 r27 */\ 00286 0,0,/* r28 r29 */\ 00287 0,0,/* r30 r31 */\ 00288 1,1,/* STACK */\ 00289 1,1 /* arg pointer */ } 00290 /* An initializer that says which registers are used for fixed 00291 purposes all throughout the compiled code and are therefore not 00292 available for general allocation. These would include the stack 00293 pointer, the frame pointer (except on machines where that can be 00294 used as a general register when no frame pointer is needed), the 00295 program counter on machines where that is considered one of the 00296 addressable registers, and any other numbered register with a 00297 standard use. 00298 00299 This information is expressed as a sequence of numbers, separated 00300 by commas and surrounded by braces. The Nth number is 1 if 00301 register N is fixed, 0 otherwise. 00302 00303 The table initialized from this macro, and the table initialized by 00304 the following one, may be overridden at run time either 00305 automatically, by the actions of the macro 00306 `CONDITIONAL_REGISTER_USAGE', or by the user with the command 00307 options `-ffixed-REG', `-fcall-used-REG' and `-fcall-saved-REG'. */ 00308 00309 #define CALL_USED_REGISTERS { \ 00310 1,1,/* r0 r1 */ \ 00311 0,0,/* r2 r3 */ \ 00312 0,0,/* r4 r5 */ \ 00313 0,0,/* r6 r7 */ \ 00314 0,0,/* r8 r9 */ \ 00315 0,0,/* r10 r11 */ \ 00316 0,0,/* r12 r13 */ \ 00317 0,0,/* r14 r15 */ \ 00318 0,0,/* r16 r17 */ \ 00319 1,1,/* r18 r19 */ \ 00320 1,1,/* r20 r21 */ \ 00321 1,1,/* r22 r23 */ \ 00322 1,1,/* r24 r25 */ \ 00323 1,1,/* r26 r27 */ \ 00324 0,0,/* r28 r29 */ \ 00325 1,1,/* r30 r31 */ \ 00326 1,1,/* STACK */ \ 00327 1,1 /* arg pointer */ } 00328 /* Like `FIXED_REGISTERS' but has 1 for each register that is 00329 clobbered (in general) by function calls as well as for fixed 00330 registers. This macro therefore identifies the registers that are 00331 not available for general allocation of values that must live 00332 across function calls. 00333 00334 If a register has 0 in `CALL_USED_REGISTERS', the compiler 00335 automatically saves it on function entry and restores it on 00336 function exit, if the register is used within the function. */ 00337 00338 #define NON_SAVING_SETJMP 0 00339 /* If this macro is defined and has a nonzero value, it means that 00340 `setjmp' and related functions fail to save the registers, or that 00341 `longjmp' fails to restore them. To compensate, the compiler 00342 avoids putting variables in registers in functions that use 00343 `setjmp'. */ 00344 00345 #define REG_ALLOC_ORDER { \ 00346 24,25, \ 00347 18,19, \ 00348 20,21, \ 00349 22,23, \ 00350 30,31, \ 00351 26,27, \ 00352 28,29, \ 00353 17,16,15,14,13,12,11,10,9,8,7,6,5,4,3,2, \ 00354 0,1, \ 00355 32,33,34,35 \ 00356 } 00357 /* If defined, an initializer for a vector of integers, containing the 00358 numbers of hard registers in the order in which GNU CC should 00359 prefer to use them (from most preferred to least). 00360 00361 If this macro is not defined, registers are used lowest numbered 00362 first (all else being equal). 00363 00364 One use of this macro is on machines where the highest numbered 00365 registers must always be saved and the save-multiple-registers 00366 instruction supports only sequences of consetionve registers. On 00367 such machines, define `REG_ALLOC_ORDER' to be an initializer that 00368 lists the highest numbered allocatable register first. */ 00369 00370 #define ORDER_REGS_FOR_LOCAL_ALLOC order_regs_for_local_alloc () 00371 /* ORDER_REGS_FOR_LOCAL_ALLOC' 00372 A C statement (sans semicolon) to choose the order in which to 00373 allocate hard registers for pseudo-registers local to a basic 00374 block. 00375 00376 Store the desired register order in the array `reg_alloc_order'. 00377 Element 0 should be the register to allocate first; element 1, the 00378 next register; and so on. 00379 00380 The macro body should not assume anything about the contents of 00381 `reg_alloc_order' before execution of the macro. 00382 00383 On most machines, it is not necessary to define this macro. */ 00384 00385 00386 #define HARD_REGNO_NREGS(REGNO, MODE) ((GET_MODE_SIZE (MODE) + UNITS_PER_WORD - 1) / UNITS_PER_WORD) 00387 00388 /* A C expression for the number of consecutive hard registers, 00389 starting at register number REGNO, required to hold a value of mode 00390 MODE. 00391 00392 On a machine where all registers are exactly one word, a suitable 00393 definition of this macro is 00394 00395 #define HARD_REGNO_NREGS(REGNO, MODE) \ 00396 ((GET_MODE_SIZE (MODE) + UNITS_PER_WORD - 1) \ 00397 / UNITS_PER_WORD)) */ 00398 00399 #define HARD_REGNO_MODE_OK(REGNO, MODE) avr_hard_regno_mode_ok(REGNO, MODE) 00400 /* A C expression that is nonzero if it is permissible to store a 00401 value of mode MODE in hard register number REGNO (or in several 00402 registers starting with that one). For a machine where all 00403 registers are equivalent, a suitable definition is 00404 00405 #define HARD_REGNO_MODE_OK(REGNO, MODE) 1 00406 00407 It is not necessary for this macro to check for the numbers of 00408 fixed registers, because the allocation mechanism considers them 00409 to be always occupied. 00410 00411 On some machines, double-precision values must be kept in even/odd 00412 register pairs. The way to implement that is to define this macro 00413 to reject odd register numbers for such modes. 00414 00415 The minimum requirement for a mode to be OK in a register is that 00416 the `movMODE' instruction pattern support moves between the 00417 register and any other hard register for which the mode is OK; and 00418 that moving a value into the register and back out not alter it. 00419 00420 Since the same instruction used to move `SImode' will work for all 00421 narrower integer modes, it is not necessary on any machine for 00422 `HARD_REGNO_MODE_OK' to distinguish between these modes, provided 00423 you define patterns `movhi', etc., to take advantage of this. This 00424 is useful because of the interaction between `HARD_REGNO_MODE_OK' 00425 and `MODES_TIEABLE_P'; it is very desirable for all integer modes 00426 to be tieable. 00427 00428 Many machines have special registers for floating point arithmetic. 00429 Often people assume that floating point machine modes are allowed 00430 only in floating point registers. This is not true. Any 00431 registers that can hold integers can safely *hold* a floating 00432 point machine mode, whether or not floating arithmetic can be done 00433 on it in those registers. Integer move instructions can be used 00434 to move the values. 00435 00436 On some machines, though, the converse is true: fixed-point machine 00437 modes may not go in floating registers. This is true if the 00438 floating registers normalize any value stored in them, because 00439 storing a non-floating value there would garble it. In this case, 00440 `HARD_REGNO_MODE_OK' should reject fixed-point machine modes in 00441 floating registers. But if the floating registers do not 00442 automatically normalize, if you can store any bit pattern in one 00443 and retrieve it unchanged without a trap, then any machine mode 00444 may go in a floating register, so you can define this macro to say 00445 so. 00446 00447 The primary significance of special floating registers is rather 00448 that they are the registers acceptable in floating point arithmetic 00449 instructions. However, this is of no concern to 00450 `HARD_REGNO_MODE_OK'. You handle it by writing the proper 00451 constraints for those instructions. 00452 00453 On some machines, the floating registers are especially slow to 00454 access, so that it is better to store a value in a stack frame 00455 than in such a register if floating point arithmetic is not being 00456 done. As long as the floating registers are not in class 00457 `GENERAL_REGS', they will not be used unless some pattern's 00458 constraint asks for one. */ 00459 00460 #define MODES_TIEABLE_P(MODE1, MODE2) 0 00461 /* A C expression that is nonzero if it is desirable to choose 00462 register allocation so as to avoid move instructions between a 00463 value of mode MODE1 and a value of mode MODE2. 00464 00465 If `HARD_REGNO_MODE_OK (R, MODE1)' and `HARD_REGNO_MODE_OK (R, 00466 MODE2)' are ever different for any R, then `MODES_TIEABLE_P (MODE1, 00467 MODE2)' must be zero. */ 00468 00469 enum reg_class { 00470 NO_REGS, 00471 R0_REG, /* r0 */ 00472 POINTER_X_REGS, /* r26 - r27 */ 00473 POINTER_Y_REGS, /* r28 - r29 */ 00474 POINTER_Z_REGS, /* r30 - r31 */ 00475 STACK_REG, /* STACK */ 00476 BASE_POINTER_REGS, /* r28 - r31 */ 00477 POINTER_REGS, /* r26 - r31 */ 00478 ADDW_REGS, /* r24 - r31 */ 00479 SIMPLE_LD_REGS, /* r16 - r23 */ 00480 LD_REGS, /* r16 - r31 */ 00481 NO_LD_REGS, /* r0 - r15 */ 00482 GENERAL_REGS, /* r0 - r31 */ 00483 ALL_REGS, LIM_REG_CLASSES 00484 }; 00485 /* An enumeral type that must be defined with all the register class 00486 names as enumeral values. `NO_REGS' must be first. `ALL_REGS' 00487 must be the last register class, followed by one more enumeral 00488 value, `LIM_REG_CLASSES', which is not a register class but rather 00489 tells how many classes there are. 00490 00491 Each register class has a number, which is the value of casting 00492 the class name to type `int'. The number serves as an index in 00493 many of the tables described below. */ 00494 00495 00496 #define N_REG_CLASSES (int)LIM_REG_CLASSES 00497 /* The number of distinct register classes, defined as follows: 00498 00499 #define N_REG_CLASSES (int) LIM_REG_CLASSES */ 00500 00501 #define REG_CLASS_NAMES { \ 00502 "NO_REGS", \ 00503 "R0_REG", /* r0 */ \ 00504 "POINTER_X_REGS", /* r26 - r27 */ \ 00505 "POINTER_Y_REGS", /* r28 - r29 */ \ 00506 "POINTER_Z_REGS", /* r30 - r31 */ \ 00507 "STACK_REG", /* STACK */ \ 00508 "BASE_POINTER_REGS", /* r28 - r31 */ \ 00509 "POINTER_REGS", /* r26 - r31 */ \ 00510 "ADDW_REGS", /* r24 - r31 */ \ 00511 "SIMPLE_LD_REGS", /* r16 - r23 */ \ 00512 "LD_REGS", /* r16 - r31 */ \ 00513 "NO_LD_REGS", /* r0 - r15 */ \ 00514 "GENERAL_REGS", /* r0 - r31 */ \ 00515 "ALL_REGS" } 00516 /* An initializer containing the names of the register classes as C 00517 string constants. These names are used in writing some of the 00518 debugging dumps. */ 00519 00520 #define REG_X 26 00521 #define REG_Y 28 00522 #define REG_Z 30 00523 #define REG_W 24 00524 00525 #define REG_CLASS_CONTENTS { \ 00526 {0x00000000,0x00000000}, /* NO_REGS */ \ 00527 {0x00000001,0x00000000}, /* R0_REG */ \ 00528 {3 << REG_X,0x00000000}, /* POINTER_X_REGS, r26 - r27 */ \ 00529 {3 << REG_Y,0x00000000}, /* POINTER_Y_REGS, r28 - r29 */ \ 00530 {3 << REG_Z,0x00000000}, /* POINTER_Z_REGS, r30 - r31 */ \ 00531 {0x00000000,0x00000003}, /* STACK_REG, STACK */ \ 00532 {(3 << REG_Y) | (3 << REG_Z), \ 00533 0x00000000}, /* BASE_POINTER_REGS, r28 - r31 */ \ 00534 {(3 << REG_X) | (3 << REG_Y) | (3 << REG_Z), \ 00535 0x00000000}, /* POINTER_REGS, r26 - r31 */ \ 00536 {(3 << REG_X) | (3 << REG_Y) | (3 << REG_Z) | (3 << REG_W), \ 00537 0x00000000}, /* ADDW_REGS, r24 - r31 */ \ 00538 {0x00ff0000,0x00000000}, /* SIMPLE_LD_REGS r16 - r23 */ \ 00539 {(3 << REG_X)|(3 << REG_Y)|(3 << REG_Z)|(3 << REG_W)|(0xff << 16), \ 00540 0x00000000}, /* LD_REGS, r16 - r31 */ \ 00541 {0x0000ffff,0x00000000}, /* NO_LD_REGS r0 - r15 */ \ 00542 {0xffffffff,0x00000000}, /* GENERAL_REGS, r0 - r31 */ \ 00543 {0xffffffff,0x00000003} /* ALL_REGS */ \ 00544 } 00545 /* An initializer containing the contents of the register classes, as 00546 integers which are bit masks. The Nth integer specifies the 00547 contents of class N. The way the integer MASK is interpreted is 00548 that register R is in the class if `MASK & (1 << R)' is 1. 00549 00550 When the machine has more than 32 registers, an integer does not 00551 suffice. Then the integers are replaced by sub-initializers, 00552 braced groupings containing several integers. Each 00553 sub-initializer must be suitable as an initializer for the type 00554 `HARD_REG_SET' which is defined in `hard-reg-set.h'. */ 00555 00556 #define REGNO_REG_CLASS(R) avr_regno_reg_class(R) 00557 /* A C expression whose value is a register class containing hard 00558 register REGNO. In general there is more than one such class; 00559 choose a class which is "minimal", meaning that no smaller class 00560 also contains the register. */ 00561 00562 #define BASE_REG_CLASS POINTER_REGS 00563 /* A macro whose definition is the name of the class to which a valid 00564 base register must belong. A base register is one used in an 00565 address which is the register value plus a displacement. */ 00566 00567 #define INDEX_REG_CLASS NO_REGS 00568 /* A macro whose definition is the name of the class to which a valid 00569 index register must belong. An index register is one used in an 00570 address where its value is either multiplied by a scale factor or 00571 added to another register (as well as added to a displacement). */ 00572 00573 #define REG_CLASS_FROM_LETTER(C) avr_reg_class_from_letter(C) 00574 /* A C expression which defines the machine-dependent operand 00575 constraint letters for register classes. If CHAR is such a 00576 letter, the value should be the register class corresponding to 00577 it. Otherwise, the value should be `NO_REGS'. The register 00578 letter `r', corresponding to class `GENERAL_REGS', will not be 00579 passed to this macro; you do not need to handle it. */ 00580 00581 #define REGNO_OK_FOR_BASE_P(r) (((r) < FIRST_PSEUDO_REGISTER \ 00582 && ((r) == REG_X \ 00583 || (r) == REG_Y \ 00584 || (r) == REG_Z \ 00585 || (r) == ARG_POINTER_REGNUM)) \ 00586 || (reg_renumber \ 00587 && (reg_renumber[r] == REG_X \ 00588 || reg_renumber[r] == REG_Y \ 00589 || reg_renumber[r] == REG_Z \ 00590 || (reg_renumber[r] \ 00591 == ARG_POINTER_REGNUM)))) 00592 /* A C expression which is nonzero if register number NUM is suitable 00593 for use as a base register in operand addresses. It may be either 00594 a suitable hard register or a pseudo register that has been 00595 allocated such a hard register. */ 00596 00597 /* #define REGNO_MODE_OK_FOR_BASE_P(r, m) regno_mode_ok_for_base_p(r, m) 00598 A C expression that is just like `REGNO_OK_FOR_BASE_P', except that 00599 that expression may examine the mode of the memory reference in 00600 MODE. You should define this macro if the mode of the memory 00601 reference affects whether a register may be used as a base 00602 register. If you define this macro, the compiler will use it 00603 instead of `REGNO_OK_FOR_BASE_P'. */ 00604 00605 #define REGNO_OK_FOR_INDEX_P(NUM) 0 00606 /* A C expression which is nonzero if register number NUM is suitable 00607 for use as an index register in operand addresses. It may be 00608 either a suitable hard register or a pseudo register that has been 00609 allocated such a hard register. 00610 00611 The difference between an index register and a base register is 00612 that the index register may be scaled. If an address involves the 00613 sum of two registers, neither one of them scaled, then either one 00614 may be labeled the "base" and the other the "index"; but whichever 00615 labeling is used must fit the machine's constraints of which 00616 registers may serve in each capacity. The compiler will try both 00617 labelings, looking for one that is valid, and will reload one or 00618 both registers only if neither labeling works. */ 00619 00620 #define PREFERRED_RELOAD_CLASS(X, CLASS) preferred_reload_class(X,CLASS) 00621 /* A C expression that places additional restrictions on the register 00622 class to use when it is necessary to copy value X into a register 00623 in class CLASS. The value is a register class; perhaps CLASS, or 00624 perhaps another, smaller class. On many machines, the following 00625 definition is safe: 00626 00627 #define PREFERRED_RELOAD_CLASS(X,CLASS) CLASS 00628 00629 Sometimes returning a more restrictive class makes better code. 00630 For example, on the 68000, when X is an integer constant that is 00631 in range for a `moveq' instruction, the value of this macro is 00632 always `DATA_REGS' as long as CLASS includes the data registers. 00633 Requiring a data register guarantees that a `moveq' will be used. 00634 00635 If X is a `const_double', by returning `NO_REGS' you can force X 00636 into a memory constant. This is useful on certain machines where 00637 immediate floating values cannot be loaded into certain kinds of 00638 registers. */ 00639 /* `PREFERRED_OUTPUT_RELOAD_CLASS (X, CLASS)' 00640 Like `PREFERRED_RELOAD_CLASS', but for output reloads instead of 00641 input reloads. If you don't define this macro, the default is to 00642 use CLASS, unchanged. */ 00643 00644 /* `LIMIT_RELOAD_CLASS (MODE, CLASS)' 00645 A C expression that places additional restrictions on the register 00646 class to use when it is necessary to be able to hold a value of 00647 mode MODE in a reload register for which class CLASS would 00648 ordinarily be used. 00649 00650 Unlike `PREFERRED_RELOAD_CLASS', this macro should be used when 00651 there are certain modes that simply can't go in certain reload 00652 classes. 00653 00654 The value is a register class; perhaps CLASS, or perhaps another, 00655 smaller class. 00656 00657 Don't define this macro unless the target machine has limitations 00658 which require the macro to do something nontrivial. */ 00659 00660 /* SECONDARY_INPUT_RELOAD_CLASS(CLASS, MODE, X) 00661 `SECONDARY_RELOAD_CLASS (CLASS, MODE, X)' 00662 `SECONDARY_OUTPUT_RELOAD_CLASS (CLASS, MODE, X)' 00663 Many machines have some registers that cannot be copied directly 00664 to or from memory or even from other types of registers. An 00665 example is the `MQ' register, which on most machines, can only be 00666 copied to or from general registers, but not memory. Some 00667 machines allow copying all registers to and from memory, but 00668 require a scratch register for stores to some memory locations 00669 (e.g., those with symbolic address on the RT, and those with 00670 certain symbolic address on the Sparc when compiling PIC). In 00671 some cases, both an intermediate and a scratch register are 00672 required. 00673 00674 You should define these macros to indicate to the reload phase 00675 that it may need to allocate at least one register for a reload in 00676 addition to the register to contain the data. Specifically, if 00677 copying X to a register CLASS in MODE requires an intermediate 00678 register, you should define `SECONDARY_INPUT_RELOAD_CLASS' to 00679 return the largest register class all of whose registers can be 00680 used as intermediate registers or scratch registers. 00681 00682 If copying a register CLASS in MODE to X requires an intermediate 00683 or scratch register, `SECONDARY_OUTPUT_RELOAD_CLASS' should be 00684 defined to return the largest register class required. If the 00685 requirements for input and output reloads are the same, the macro 00686 `SECONDARY_RELOAD_CLASS' should be used instead of defining both 00687 macros identically. 00688 00689 The values returned by these macros are often `GENERAL_REGS'. 00690 Return `NO_REGS' if no spare register is needed; i.e., if X can be 00691 directly copied to or from a register of CLASS in MODE without 00692 requiring a scratch register. Do not define this macro if it 00693 would always return `NO_REGS'. 00694 00695 If a scratch register is required (either with or without an 00696 intermediate register), you should define patterns for 00697 `reload_inM' or `reload_outM', as required (*note Standard 00698 Names::.. These patterns, which will normally be implemented with 00699 a `define_expand', should be similar to the `movM' patterns, 00700 except that operand 2 is the scratch register. 00701 00702 Define constraints for the reload register and scratch register 00703 that contain a single register class. If the original reload 00704 register (whose class is CLASS) can meet the constraint given in 00705 the pattern, the value returned by these macros is used for the 00706 class of the scratch register. Otherwise, two additional reload 00707 registers are required. Their classes are obtained from the 00708 constraints in the insn pattern. 00709 00710 X might be a pseudo-register or a `subreg' of a pseudo-register, 00711 which could either be in a hard register or in memory. Use 00712 `true_regnum' to find out; it will return -1 if the pseudo is in 00713 memory and the hard register number if it is in a register. 00714 00715 These macros should not be used in the case where a particular 00716 class of registers can only be copied to memory and not to another 00717 class of registers. In that case, secondary reload registers are 00718 not needed and would not be helpful. Instead, a stack location 00719 must be used to perform the copy and the `movM' pattern should use 00720 memory as an intermediate storage. This case often occurs between 00721 floating-point and general registers. */ 00722 00723 /* `SECONDARY_MEMORY_NEEDED (CLASS1, CLASS2, M)' 00724 Certain machines have the property that some registers cannot be 00725 copied to some other registers without using memory. Define this 00726 macro on those machines to be a C expression that is non-zero if 00727 objects of mode M in registers of CLASS1 can only be copied to 00728 registers of class CLASS2 by storing a register of CLASS1 into 00729 memory and loading that memory location into a register of CLASS2. 00730 00731 Do not define this macro if its value would always be zero. 00732 00733 `SECONDARY_MEMORY_NEEDED_RTX (MODE)' 00734 Normally when `SECONDARY_MEMORY_NEEDED' is defined, the compiler 00735 allocates a stack slot for a memory location needed for register 00736 copies. If this macro is defined, the compiler instead uses the 00737 memory location defined by this macro. 00738 00739 Do not define this macro if you do not define 00740 `SECONDARY_MEMORY_NEEDED'. */ 00741 00742 #define SMALL_REGISTER_CLASSES 1 00743 /* Normally the compiler avoids choosing registers that have been 00744 explicitly mentioned in the rtl as spill registers (these 00745 registers are normally those used to pass parameters and return 00746 values). However, some machines have so few registers of certain 00747 classes that there would not be enough registers to use as spill 00748 registers if this were done. 00749 00750 Define `SMALL_REGISTER_CLASSES' to be an expression with a non-zero 00751 value on these machines. When this macro has a non-zero value, the 00752 compiler allows registers explicitly used in the rtl to be used as 00753 spill registers but avoids extending the lifetime of these 00754 registers. 00755 00756 It is always safe to define this macro with a non-zero value, but 00757 if you unnecessarily define it, you will reduce the amount of 00758 optimizations that can be performed in some cases. If you do not 00759 define this macro with a non-zero value when it is required, the 00760 compiler will run out of spill registers and print a fatal error 00761 message. For most machines, you should not define this macro at 00762 all. */ 00763 00764 #define CLASS_LIKELY_SPILLED_P(c) class_likely_spilled_p(c) 00765 /* A C expression whose value is nonzero if pseudos that have been 00766 assigned to registers of class CLASS would likely be spilled 00767 because registers of CLASS are needed for spill registers. 00768 00769 The default value of this macro returns 1 if CLASS has exactly one 00770 register and zero otherwise. On most machines, this default 00771 should be used. Only define this macro to some other expression 00772 if pseudo allocated by `local-alloc.c' end up in memory because 00773 their hard registers were needed for spill registers. If this 00774 macro returns nonzero for those classes, those pseudos will only 00775 be allocated by `global.c', which knows how to reallocate the 00776 pseudo to another register. If there would not be another 00777 register available for reallocation, you should not change the 00778 definition of this macro since the only effect of such a 00779 definition would be to slow down register allocation. */ 00780 00781 #define CLASS_MAX_NREGS(CLASS, MODE) class_max_nregs (CLASS, MODE) 00782 /* A C expression for the maximum number of consecutive registers of 00783 class CLASS needed to hold a value of mode MODE. 00784 00785 This is closely related to the macro `HARD_REGNO_NREGS'. In fact, 00786 the value of the macro `CLASS_MAX_NREGS (CLASS, MODE)' should be 00787 the maximum value of `HARD_REGNO_NREGS (REGNO, MODE)' for all 00788 REGNO values in the class CLASS. 00789 00790 This macro helps control the handling of multiple-word values in 00791 the reload pass. */ 00792 00793 #define CONST_OK_FOR_LETTER_P(VALUE, C) \ 00794 ((C) == 'I' ? (VALUE) >= 0 && (VALUE) <= 63 : \ 00795 (C) == 'J' ? (VALUE) <= 0 && (VALUE) >= -63: \ 00796 (C) == 'K' ? (VALUE) == 2 : \ 00797 (C) == 'L' ? (VALUE) == 0 : \ 00798 (C) == 'M' ? (VALUE) >= 0 && (VALUE) <= 0xff : \ 00799 (C) == 'N' ? (VALUE) == -1: \ 00800 (C) == 'O' ? (VALUE) == 8 || (VALUE) == 16 || (VALUE) == 24: \ 00801 (C) == 'P' ? (VALUE) == 1 : \ 00802 0) 00803 00804 /* A C expression that defines the machine-dependent operand 00805 constraint letters (`I', `J', `K', ... `P') that specify 00806 particular ranges of integer values. If C is one of those 00807 letters, the expression should check that VALUE, an integer, is in 00808 the appropriate range and return 1 if so, 0 otherwise. If C is 00809 not one of those letters, the value should be 0 regardless of 00810 VALUE. */ 00811 00812 #define CONST_DOUBLE_OK_FOR_LETTER_P(VALUE, C) \ 00813 ((C) == 'G' ? (VALUE) == CONST0_RTX (SFmode) \ 00814 : 0) 00815 /* `CONST_DOUBLE_OK_FOR_LETTER_P (VALUE, C)' 00816 A C expression that defines the machine-dependent operand 00817 constraint letters that specify particular ranges of 00818 `const_double' values (`G' or `H'). 00819 00820 If C is one of those letters, the expression should check that 00821 VALUE, an RTX of code `const_double', is in the appropriate range 00822 and return 1 if so, 0 otherwise. If C is not one of those 00823 letters, the value should be 0 regardless of VALUE. 00824 00825 `const_double' is used for all floating-point constants and for 00826 `DImode' fixed-point constants. A given letter can accept either 00827 or both kinds of values. It can use `GET_MODE' to distinguish 00828 between these kinds. */ 00829 00830 #define EXTRA_CONSTRAINT(x, c) extra_constraint(x, c) 00831 /* A C expression that defines the optional machine-dependent 00832 constraint letters (``Q', `R', `S', `T', `U') that can' 00833 be used to segregate specific types of operands, usually memory 00834 references, for the target machine. Normally this macro will not 00835 be defined. If it is required for a particular target machine, it 00836 should return 1 if VALUE corresponds to the operand type 00837 represented by the constraint letter C. If C is not defined as an 00838 extra constraint, the value returned should be 0 regardless of 00839 VALUE. 00840 00841 For example, on the ROMP, load instructions cannot have their 00842 output in r0 if the memory reference contains a symbolic address. 00843 Constraint letter `Q' is defined as representing a memory address 00844 that does *not* contain a symbolic address. An alternative is 00845 specified with a `Q' constraint on the input and `r' on the 00846 output. The next alternative specifies `m' on the input and a 00847 register class that does not include r0 on the output. */ 00848 00849 /* This is an undocumented variable which describes 00850 how GCC will push a data */ 00851 #define STACK_PUSH_CODE POST_DEC 00852 00853 #define STACK_GROWS_DOWNWARD 00854 /* Define this macro if pushing a word onto the stack moves the stack 00855 pointer to a smaller address. 00856 00857 When we say, "define this macro if ...," it means that the 00858 compiler checks this macro only with `#ifdef' so the precise 00859 definition used does not matter. */ 00860 00861 #define STARTING_FRAME_OFFSET 1 00862 /* Offset from the frame pointer to the first local variable slot to 00863 be allocated. 00864 00865 If `FRAME_GROWS_DOWNWARD', find the next slot's offset by 00866 subtracting the first slot's length from `STARTING_FRAME_OFFSET'. 00867 Otherwise, it is found by adding the length of the first slot to 00868 the value `STARTING_FRAME_OFFSET'. */ 00869 00870 #define STACK_POINTER_OFFSET 1 00871 /* Offset from the stack pointer register to the first location at 00872 which outgoing arguments are placed. If not specified, the 00873 default value of zero is used. This is the proper value for most 00874 machines. 00875 00876 If `ARGS_GROW_DOWNWARD', this is the offset to the location above 00877 the first location at which outgoing arguments are placed. */ 00878 00879 #define FIRST_PARM_OFFSET(FUNDECL) 0 00880 /* Offset from the argument pointer register to the first argument's 00881 address. On some machines it may depend on the data type of the 00882 function. 00883 00884 If `ARGS_GROW_DOWNWARD', this is the offset to the location above 00885 the first argument's address. */ 00886 00887 /* `STACK_DYNAMIC_OFFSET (FUNDECL)' 00888 Offset from the stack pointer register to an item dynamically 00889 allocated on the stack, e.g., by `alloca'. 00890 00891 The default value for this macro is `STACK_POINTER_OFFSET' plus the 00892 length of the outgoing arguments. The default is correct for most 00893 machines. See `function.c' for details. */ 00894 00895 #define STACK_BOUNDARY 8 00896 /* Define this macro if there is a guaranteed alignment for the stack 00897 pointer on this machine. The definition is a C expression for the 00898 desired alignment (measured in bits). This value is used as a 00899 default if PREFERRED_STACK_BOUNDARY is not defined. */ 00900 00901 #define STACK_POINTER_REGNUM 32 00902 /* The register number of the stack pointer register, which must also 00903 be a fixed register according to `FIXED_REGISTERS'. On most 00904 machines, the hardware determines which register this is. */ 00905 00906 #define FRAME_POINTER_REGNUM REG_Y 00907 /* The register number of the frame pointer register, which is used to 00908 access automatic variables in the stack frame. On some machines, 00909 the hardware determines which register this is. On other 00910 machines, you can choose any register you wish for this purpose. */ 00911 00912 #define ARG_POINTER_REGNUM 34 00913 /* The register number of the arg pointer register, which is used to 00914 access the function's argument list. On some machines, this is 00915 the same as the frame pointer register. On some machines, the 00916 hardware determines which register this is. On other machines, 00917 you can choose any register you wish for this purpose. If this is 00918 not the same register as the frame pointer register, then you must 00919 mark it as a fixed register according to `FIXED_REGISTERS', or 00920 arrange to be able to eliminate it (*note Elimination::.). */ 00921 00922 #define STATIC_CHAIN_REGNUM 2 00923 /* Register numbers used for passing a function's static chain 00924 pointer. If register windows are used, the register number as 00925 seen by the called function is `STATIC_CHAIN_INCOMING_REGNUM', 00926 while the register number as seen by the calling function is 00927 `STATIC_CHAIN_REGNUM'. If these registers are the same, 00928 `STATIC_CHAIN_INCOMING_REGNUM' need not be defined. 00929 00930 The static chain register need not be a fixed register. 00931 00932 If the static chain is passed in memory, these macros should not be 00933 defined; instead, the next two macros should be defined. */ 00934 00935 #define FRAME_POINTER_REQUIRED frame_pointer_required_p() 00936 /* A C expression which is nonzero if a function must have and use a 00937 frame pointer. This expression is evaluated in the reload pass. 00938 If its value is nonzero the function will have a frame pointer. 00939 00940 The expression can in principle examine the current function and 00941 decide according to the facts, but on most machines the constant 0 00942 or the constant 1 suffices. Use 0 when the machine allows code to 00943 be generated with no frame pointer, and doing so saves some time 00944 or space. Use 1 when there is no possible advantage to avoiding a 00945 frame pointer. 00946 00947 In certain cases, the compiler does not know how to produce valid 00948 code without a frame pointer. The compiler recognizes those cases 00949 and automatically gives the function a frame pointer regardless of 00950 what `FRAME_POINTER_REQUIRED' says. You don't need to worry about 00951 them. 00952 00953 In a function that does not require a frame pointer, the frame 00954 pointer register can be allocated for ordinary usage, unless you 00955 mark it as a fixed register. See `FIXED_REGISTERS' for more 00956 information. */ 00957 00958 #define ELIMINABLE_REGS { \ 00959 {ARG_POINTER_REGNUM, FRAME_POINTER_REGNUM}, \ 00960 {FRAME_POINTER_REGNUM, STACK_POINTER_REGNUM} \ 00961 ,{FRAME_POINTER_REGNUM+1,STACK_POINTER_REGNUM+1}} 00962 /* If defined, this macro specifies a table of register pairs used to 00963 eliminate unneeded registers that point into the stack frame. If 00964 it is not defined, the only elimination attempted by the compiler 00965 is to replace references to the frame pointer with references to 00966 the stack pointer. 00967 00968 The definition of this macro is a list of structure 00969 initializations, each of which specifies an original and 00970 replacement register. 00971 00972 On some machines, the position of the argument pointer is not 00973 known until the compilation is completed. In such a case, a 00974 separate hard register must be used for the argument pointer. 00975 This register can be eliminated by replacing it with either the 00976 frame pointer or the argument pointer, depending on whether or not 00977 the frame pointer has been eliminated. 00978 00979 In this case, you might specify: 00980 #define ELIMINABLE_REGS \ 00981 {{ARG_POINTER_REGNUM, STACK_POINTER_REGNUM}, \ 00982 {ARG_POINTER_REGNUM, FRAME_POINTER_REGNUM}, \ 00983 {FRAME_POINTER_REGNUM, STACK_POINTER_REGNUM}} 00984 00985 Note that the elimination of the argument pointer with the stack 00986 pointer is specified first since that is the preferred elimination. */ 00987 00988 #define CAN_ELIMINATE(FROM, TO) (((FROM) == ARG_POINTER_REGNUM \ 00989 && (TO) == FRAME_POINTER_REGNUM) \ 00990 || (((FROM) == FRAME_POINTER_REGNUM \ 00991 || (FROM) == FRAME_POINTER_REGNUM+1) \ 00992 && ! FRAME_POINTER_REQUIRED \ 00993 )) 00994 /* A C expression that returns non-zero if the compiler is allowed to 00995 try to replace register number FROM-REG with register number 00996 TO-REG. This macro need only be defined if `ELIMINABLE_REGS' is 00997 defined, and will usually be the constant 1, since most of the 00998 cases preventing register elimination are things that the compiler 00999 already knows about. */ 01000 01001 #define INITIAL_ELIMINATION_OFFSET(FROM, TO, OFFSET) \ 01002 OFFSET = initial_elimination_offset (FROM, TO) 01003 /* This macro is similar to `INITIAL_FRAME_POINTER_OFFSET'. It 01004 specifies the initial difference between the specified pair of 01005 registers. This macro must be defined if `ELIMINABLE_REGS' is 01006 defined. */ 01007 01008 #define RETURN_ADDR_RTX(count, x) \ 01009 gen_rtx_MEM (Pmode, memory_address (Pmode, plus_constant (tem, 1))) 01010 01011 #define PUSH_ROUNDING(NPUSHED) (NPUSHED) 01012 /* A C expression that is the number of bytes actually pushed onto the 01013 stack when an instruction attempts to push NPUSHED bytes. 01014 01015 If the target machine does not have a push instruction, do not 01016 define this macro. That directs GNU CC to use an alternate 01017 strategy: to allocate the entire argument block and then store the 01018 arguments into it. 01019 01020 On some machines, the definition 01021 01022 #define PUSH_ROUNDING(BYTES) (BYTES) 01023 01024 will suffice. But on other machines, instructions that appear to 01025 push one byte actually push two bytes in an attempt to maintain 01026 alignment. Then the definition should be 01027 01028 #define PUSH_ROUNDING(BYTES) (((BYTES) + 1) & ~1) */ 01029 01030 #define RETURN_POPS_ARGS(FUNDECL, FUNTYPE, STACK_SIZE) 0 01031 /* A C expression that should indicate the number of bytes of its own 01032 arguments that a function pops on returning, or 0 if the function 01033 pops no arguments and the caller must therefore pop them all after 01034 the function returns. 01035 01036 FUNDECL is a C variable whose value is a tree node that describes 01037 the function in question. Normally it is a node of type 01038 `FUNCTION_DECL' that describes the declaration of the function. 01039 From this you can obtain the DECL_ATTRIBUTES of the 01040 function. 01041 01042 FUNTYPE is a C variable whose value is a tree node that describes 01043 the function in question. Normally it is a node of type 01044 `FUNCTION_TYPE' that describes the data type of the function. 01045 From this it is possible to obtain the data types of the value and 01046 arguments (if known). 01047 01048 When a call to a library function is being considered, FUNDECL 01049 will contain an identifier node for the library function. Thus, if 01050 you need to distinguish among various library functions, you can 01051 do so by their names. Note that "library function" in this 01052 context means a function used to perform arithmetic, whose name is 01053 known specially in the compiler and was not mentioned in the C 01054 code being compiled. 01055 01056 STACK-SIZE is the number of bytes of arguments passed on the 01057 stack. If a variable number of bytes is passed, it is zero, and 01058 argument popping will always be the responsibility of the calling 01059 function. 01060 01061 On the VAX, all functions always pop their arguments, so the 01062 definition of this macro is STACK-SIZE. On the 68000, using the 01063 standard calling convention, no functions pop their arguments, so 01064 the value of the macro is always 0 in this case. But an 01065 alternative calling convention is available in which functions 01066 that take a fixed number of arguments pop them but other functions 01067 (such as `printf') pop nothing (the caller pops all). When this 01068 convention is in use, FUNTYPE is examined to determine whether a 01069 function takes a fixed number of arguments. */ 01070 01071 #define FUNCTION_ARG(CUM, MODE, TYPE, NAMED) (function_arg (&(CUM), MODE, TYPE, NAMED)) 01072 /* A C expression that controls whether a function argument is passed 01073 in a register, and which register. 01074 01075 The arguments are CUM, which summarizes all the previous 01076 arguments; MODE, the machine mode of the argument; TYPE, the data 01077 type of the argument as a tree node or 0 if that is not known 01078 (which happens for C support library functions); and NAMED, which 01079 is 1 for an ordinary argument and 0 for nameless arguments that 01080 correspond to `...' in the called function's prototype. 01081 01082 The value of the expression is usually either a `reg' RTX for the 01083 hard register in which to pass the argument, or zero to pass the 01084 argument on the stack. 01085 01086 For machines like the VAX and 68000, where normally all arguments 01087 are pushed, zero suffices as a definition. 01088 01089 The value of the expression can also be a `parallel' RTX. This is 01090 used when an argument is passed in multiple locations. The mode 01091 of the of the `parallel' should be the mode of the entire 01092 argument. The `parallel' holds any number of `expr_list' pairs; 01093 each one describes where part of the argument is passed. In each 01094 `expr_list', the first operand can be either a `reg' RTX for the 01095 hard register in which to pass this part of the argument, or zero 01096 to pass the argument on the stack. If this operand is a `reg', 01097 then the mode indicates how large this part of the argument is. 01098 The second operand of the `expr_list' is a `const_int' which gives 01099 the offset in bytes into the entire argument where this part 01100 starts. 01101 01102 The usual way to make the ANSI library `stdarg.h' work on a machine 01103 where some arguments are usually passed in registers, is to cause 01104 nameless arguments to be passed on the stack instead. This is done 01105 by making `FUNCTION_ARG' return 0 whenever NAMED is 0. 01106 01107 You may use the macro `MUST_PASS_IN_STACK (MODE, TYPE)' in the 01108 definition of this macro to determine if this argument is of a 01109 type that must be passed in the stack. If `REG_PARM_STACK_SPACE' 01110 is not defined and `FUNCTION_ARG' returns non-zero for such an 01111 argument, the compiler will abort. If `REG_PARM_STACK_SPACE' is 01112 defined, the argument will be computed in the stack and then 01113 loaded into a register. */ 01114 01115 typedef struct avr_args { 01116 int nregs; /* # registers available for passing */ 01117 int regno; /* next available register number */ 01118 } CUMULATIVE_ARGS; 01119 /* A C type for declaring a variable that is used as the first 01120 argument of `FUNCTION_ARG' and other related values. For some 01121 target machines, the type `int' suffices and can hold the number 01122 of bytes of argument so far. 01123 01124 There is no need to record in `CUMULATIVE_ARGS' anything about the 01125 arguments that have been passed on the stack. The compiler has 01126 other variables to keep track of that. For target machines on 01127 which all arguments are passed on the stack, there is no need to 01128 store anything in `CUMULATIVE_ARGS'; however, the data structure 01129 must exist and should not be empty, so use `int'. */ 01130 01131 #define INIT_CUMULATIVE_ARGS(CUM, FNTYPE, LIBNAME, INDIRECT) init_cumulative_args (&(CUM), FNTYPE, LIBNAME, INDIRECT) 01132 01133 /* A C statement (sans semicolon) for initializing the variable CUM 01134 for the state at the beginning of the argument list. The variable 01135 has type `CUMULATIVE_ARGS'. The value of FNTYPE is the tree node 01136 for the data type of the function which will receive the args, or 0 01137 if the args are to a compiler support library function. The value 01138 of INDIRECT is nonzero when processing an indirect call, for 01139 example a call through a function pointer. The value of INDIRECT 01140 is zero for a call to an explicitly named function, a library 01141 function call, or when `INIT_CUMULATIVE_ARGS' is used to find 01142 arguments for the function being compiled. 01143 01144 When processing a call to a compiler support library function, 01145 LIBNAME identifies which one. It is a `symbol_ref' rtx which 01146 contains the name of the function, as a string. LIBNAME is 0 when 01147 an ordinary C function call is being processed. Thus, each time 01148 this macro is called, either LIBNAME or FNTYPE is nonzero, but 01149 never both of them at once. */ 01150 01151 #define FUNCTION_ARG_ADVANCE(CUM, MODE, TYPE, NAMED) \ 01152 (function_arg_advance (&CUM, MODE, TYPE, NAMED)) 01153 01154 /* A C statement (sans semicolon) to update the summarizer variable 01155 CUM to advance past an argument in the argument list. The values 01156 MODE, TYPE and NAMED describe that argument. Once this is done, 01157 the variable CUM is suitable for analyzing the *following* 01158 argument with `FUNCTION_ARG', etc. 01159 01160 This macro need not do anything if the argument in question was 01161 passed on the stack. The compiler knows how to track the amount 01162 of stack space used for arguments without any special help. */ 01163 01164 #define FUNCTION_ARG_REGNO_P(r) function_arg_regno_p(r) 01165 /* A C expression that is nonzero if REGNO is the number of a hard 01166 register in which function arguments are sometimes passed. This 01167 does *not* include implicit arguments such as the static chain and 01168 the structure-value address. On many machines, no registers can be 01169 used for this purpose since all function arguments are pushed on 01170 the stack. */ 01171 01172 extern int avr_reg_order[]; 01173 01174 #define RET_REGISTER avr_ret_register () 01175 01176 #define FUNCTION_VALUE(VALTYPE, FUNC) avr_function_value (VALTYPE, FUNC) 01177 /* A C expression to create an RTX representing the place where a 01178 function returns a value of data type VALTYPE. VALTYPE is a tree 01179 node representing a data type. Write `TYPE_MODE (VALTYPE)' to get 01180 the machine mode used to represent that type. On many machines, 01181 only the mode is relevant. (Actually, on most machines, scalar 01182 values are returned in the same place regardless of mode). 01183 01184 The value of the expression is usually a `reg' RTX for the hard 01185 register where the return value is stored. The value can also be a 01186 `parallel' RTX, if the return value is in multiple places. See 01187 `FUNCTION_ARG' for an explanation of the `parallel' form. 01188 01189 If `PROMOTE_FUNCTION_RETURN' is defined, you must apply the same 01190 promotion rules specified in `PROMOTE_MODE' if VALTYPE is a scalar 01191 type. 01192 01193 If the precise function being called is known, FUNC is a tree node 01194 (`FUNCTION_DECL') for it; otherwise, FUNC is a null pointer. This 01195 makes it possible to use a different value-returning convention 01196 for specific functions when all their calls are known. 01197 01198 `FUNCTION_VALUE' is not used for return vales with aggregate data 01199 types, because these are returned in another way. See 01200 `STRUCT_VALUE_REGNUM' and related macros, below. */ 01201 01202 #define LIBCALL_VALUE(MODE) avr_libcall_value (MODE) 01203 /* A C expression to create an RTX representing the place where a 01204 library function returns a value of mode MODE. If the precise 01205 function being called is known, FUNC is a tree node 01206 (`FUNCTION_DECL') for it; otherwise, FUNC is a null pointer. This 01207 makes it possible to use a different value-returning convention 01208 for specific functions when all their calls are known. 01209 01210 Note that "library function" in this context means a compiler 01211 support routine, used to perform arithmetic, whose name is known 01212 specially by the compiler and was not mentioned in the C code being 01213 compiled. 01214 01215 The definition of `LIBRARY_VALUE' need not be concerned aggregate 01216 data types, because none of the library functions returns such 01217 types. */ 01218 01219 #define FUNCTION_VALUE_REGNO_P(N) ((N) == RET_REGISTER) 01220 /* A C expression that is nonzero if REGNO is the number of a hard 01221 register in which the values of called function may come back. 01222 01223 A register whose use for returning values is limited to serving as 01224 the second of a pair (for a value of type `double', say) need not 01225 be recognized by this macro. So for most machines, this definition 01226 suffices: 01227 01228 #define FUNCTION_VALUE_REGNO_P(N) ((N) == 0) 01229 01230 If the machine has register windows, so that the caller and the 01231 called function use different registers for the return value, this 01232 macro should recognize only the caller's register numbers. */ 01233 01234 #define RETURN_IN_MEMORY(TYPE) ((TYPE_MODE (TYPE) == BLKmode) \ 01235 ? int_size_in_bytes (TYPE) > 8 \ 01236 : 0) 01237 /* A C expression which can inhibit the returning of certain function 01238 values in registers, based on the type of value. A nonzero value 01239 says to return the function value in memory, just as large 01240 structures are always returned. Here TYPE will be a C expression 01241 of type `tree', representing the data type of the value. 01242 01243 Note that values of mode `BLKmode' must be explicitly handled by 01244 this macro. Also, the option `-fpcc-struct-return' takes effect 01245 regardless of this macro. On most systems, it is possible to 01246 leave the macro undefined; this causes a default definition to be 01247 used, whose value is the constant 1 for `BLKmode' values, and 0 01248 otherwise. 01249 01250 Do not use this macro to indicate that structures and unions 01251 should always be returned in memory. You should instead use 01252 `DEFAULT_PCC_STRUCT_RETURN' to indicate this. */ 01253 01254 #define DEFAULT_PCC_STRUCT_RETURN 0 01255 /* Define this macro to be 1 if all structure and union return values 01256 must be in memory. Since this results in slower code, this should 01257 be defined only if needed for compatibility with other compilers 01258 or with an ABI. If you define this macro to be 0, then the 01259 conventions used for structure and union return values are decided 01260 by the `RETURN_IN_MEMORY' macro. 01261 01262 If not defined, this defaults to the value 1. */ 01263 01264 #define STRUCT_VALUE 0 01265 /* If the structure value address is not passed in a register, define 01266 `STRUCT_VALUE' as an expression returning an RTX for the place 01267 where the address is passed. If it returns 0, the address is 01268 passed as an "invisible" first argument. */ 01269 01270 #define STRUCT_VALUE_INCOMING 0 01271 /* If the incoming location is not a register, then you should define 01272 `STRUCT_VALUE_INCOMING' as an expression for an RTX for where the 01273 called function should find the value. If it should find the 01274 value on the stack, define this to create a `mem' which refers to 01275 the frame pointer. A definition of 0 means that the address is 01276 passed as an "invisible" first argument. */ 01277 01278 #define EPILOGUE_USES(REGNO) 0 01279 /* Define this macro as a C expression that is nonzero for registers 01280 are used by the epilogue or the `return' pattern. The stack and 01281 frame pointer registers are already be assumed to be used as 01282 needed. */ 01283 01284 #define STRICT_ARGUMENT_NAMING 1 01285 /* Define this macro if the location where a function argument is 01286 passed depends on whether or not it is a named argument. 01287 01288 This macro controls how the NAMED argument to `FUNCTION_ARG' is 01289 set for varargs and stdarg functions. With this macro defined, 01290 the NAMED argument is always true for named arguments, and false 01291 for unnamed arguments. If this is not defined, but 01292 `SETUP_INCOMING_VARARGS' is defined, then all arguments are 01293 treated as named. Otherwise, all named arguments except the last 01294 are treated as named. */ 01295 01296 01297 #define HAVE_POST_INCREMENT 1 01298 /* Define this macro if the machine supports post-increment 01299 addressing. */ 01300 01301 #define HAVE_PRE_DECREMENT 1 01302 /* #define HAVE_PRE_INCREMENT 01303 #define HAVE_POST_DECREMENT */ 01304 /* Similar for other kinds of addressing. */ 01305 01306 #define CONSTANT_ADDRESS_P(X) CONSTANT_P (X) 01307 /* A C expression that is 1 if the RTX X is a constant which is a 01308 valid address. On most machines, this can be defined as 01309 `CONSTANT_P (X)', but a few machines are more restrictive in which 01310 constant addresses are supported. 01311 01312 `CONSTANT_P' accepts integer-values expressions whose values are 01313 not explicitly known, such as `symbol_ref', `label_ref', and 01314 `high' expressions and `const' arithmetic expressions, in addition 01315 to `const_int' and `const_double' expressions. */ 01316 01317 #define MAX_REGS_PER_ADDRESS 1 01318 /* A number, the maximum number of registers that can appear in a 01319 valid memory address. Note that it is up to you to specify a 01320 value equal to the maximum number that `GO_IF_LEGITIMATE_ADDRESS' 01321 would ever accept. */ 01322 01323 #ifdef REG_OK_STRICT 01324 # define GO_IF_LEGITIMATE_ADDRESS(mode, operand, ADDR) \ 01325 { \ 01326 if (legitimate_address_p (mode, operand, 1)) \ 01327 goto ADDR; \ 01328 } 01329 # else 01330 # define GO_IF_LEGITIMATE_ADDRESS(mode, operand, ADDR) \ 01331 { \ 01332 if (legitimate_address_p (mode, operand, 0)) \ 01333 goto ADDR; \ 01334 } 01335 #endif 01336 /* A C compound statement with a conditional `goto LABEL;' executed 01337 if X (an RTX) is a legitimate memory address on the target machine 01338 for a memory operand of mode MODE. 01339 01340 It usually pays to define several simpler macros to serve as 01341 subroutines for this one. Otherwise it may be too complicated to 01342 understand. 01343 01344 This macro must exist in two variants: a strict variant and a 01345 non-strict one. The strict variant is used in the reload pass. It 01346 must be defined so that any pseudo-register that has not been 01347 allocated a hard register is considered a memory reference. In 01348 contexts where some kind of register is required, a pseudo-register 01349 with no hard register must be rejected. 01350 01351 The non-strict variant is used in other passes. It must be 01352 defined to accept all pseudo-registers in every context where some 01353 kind of register is required. 01354 01355 Compiler source files that want to use the strict variant of this 01356 macro define the macro `REG_OK_STRICT'. You should use an `#ifdef 01357 REG_OK_STRICT' conditional to define the strict variant in that 01358 case and the non-strict variant otherwise. 01359 01360 Subroutines to check for acceptable registers for various purposes 01361 (one for base registers, one for index registers, and so on) are 01362 typically among the subroutines used to define 01363 `GO_IF_LEGITIMATE_ADDRESS'. Then only these subroutine macros 01364 need have two variants; the higher levels of macros may be the 01365 same whether strict or not. 01366 01367 Normally, constant addresses which are the sum of a `symbol_ref' 01368 and an integer are stored inside a `const' RTX to mark them as 01369 constant. Therefore, there is no need to recognize such sums 01370 specifically as legitimate addresses. Normally you would simply 01371 recognize any `const' as legitimate. 01372 01373 Usually `PRINT_OPERAND_ADDRESS' is not prepared to handle constant 01374 sums that are not marked with `const'. It assumes that a naked 01375 `plus' indicates indexing. If so, then you *must* reject such 01376 naked constant sums as illegitimate addresses, so that none of 01377 them will be given to `PRINT_OPERAND_ADDRESS'. 01378 01379 On some machines, whether a symbolic address is legitimate depends 01380 on the section that the address refers to. On these machines, 01381 define the macro `ENCODE_SECTION_INFO' to store the information 01382 into the `symbol_ref', and then check for it here. When you see a 01383 `const', you will have to look inside it to find the `symbol_ref' 01384 in order to determine the section. *Note Assembler Format::. 01385 01386 The best way to modify the name string is by adding text to the 01387 beginning, with suitable punctuation to prevent any ambiguity. 01388 Allocate the new name in `saveable_obstack'. You will have to 01389 modify `ASM_OUTPUT_LABELREF' to remove and decode the added text 01390 and output the name accordingly, and define `STRIP_NAME_ENCODING' 01391 to access the original name string. 01392 01393 You can check the information stored here into the `symbol_ref' in 01394 the definitions of the macros `GO_IF_LEGITIMATE_ADDRESS' and 01395 `PRINT_OPERAND_ADDRESS'. */ 01396 01397 /* `REG_OK_FOR_BASE_P (X)' 01398 A C expression that is nonzero if X (assumed to be a `reg' RTX) is 01399 valid for use as a base register. For hard registers, it should 01400 always accept those which the hardware permits and reject the 01401 others. Whether the macro accepts or rejects pseudo registers 01402 must be controlled by `REG_OK_STRICT' as described above. This 01403 usually requires two variant definitions, of which `REG_OK_STRICT' 01404 controls the one actually used. */ 01405 01406 #define REG_OK_FOR_BASE_NOSTRICT_P(X) \ 01407 (REGNO (X) >= FIRST_PSEUDO_REGISTER || REG_OK_FOR_BASE_STRICT_P(X)) 01408 01409 #define REG_OK_FOR_BASE_STRICT_P(X) REGNO_OK_FOR_BASE_P (REGNO (X)) 01410 01411 #ifdef REG_OK_STRICT 01412 # define REG_OK_FOR_BASE_P(X) REG_OK_FOR_BASE_STRICT_P (X) 01413 #else 01414 # define REG_OK_FOR_BASE_P(X) REG_OK_FOR_BASE_NOSTRICT_P (X) 01415 #endif 01416 01417 /* A C expression that is just like `REG_OK_FOR_BASE_P', except that 01418 that expression may examine the mode of the memory reference in 01419 MODE. You should define this macro if the mode of the memory 01420 reference affects whether a register may be used as a base 01421 register. If you define this macro, the compiler will use it 01422 instead of `REG_OK_FOR_BASE_P'. */ 01423 #define REG_OK_FOR_INDEX_P(X) 0 01424 /* A C expression that is nonzero if X (assumed to be a `reg' RTX) is 01425 valid for use as an index register. 01426 01427 The difference between an index register and a base register is 01428 that the index register may be scaled. If an address involves the 01429 sum of two registers, neither one of them scaled, then either one 01430 may be labeled the "base" and the other the "index"; but whichever 01431 labeling is used must fit the machine's constraints of which 01432 registers may serve in each capacity. The compiler will try both 01433 labelings, looking for one that is valid, and will reload one or 01434 both registers only if neither labeling works. */ 01435 01436 #define LEGITIMIZE_ADDRESS(X, OLDX, MODE, WIN) \ 01437 { \ 01438 (X) = legitimize_address (X, OLDX, MODE); \ 01439 if (memory_address_p (MODE, X)) \ 01440 goto WIN; \ 01441 } 01442 /* A C compound statement that attempts to replace X with a valid 01443 memory address for an operand of mode MODE. WIN will be a C 01444 statement label elsewhere in the code; the macro definition may use 01445 01446 GO_IF_LEGITIMATE_ADDRESS (MODE, X, WIN); 01447 01448 to avoid further processing if the address has become legitimate. 01449 01450 X will always be the result of a call to `break_out_memory_refs', 01451 and OLDX will be the operand that was given to that function to 01452 produce X. 01453 01454 The code generated by this macro should not alter the substructure 01455 of X. If it transforms X into a more legitimate form, it should 01456 assign X (which will always be a C variable) a new value. 01457 01458 It is not necessary for this macro to come up with a legitimate 01459 address. The compiler has standard ways of doing so in all cases. 01460 In fact, it is safe for this macro to do nothing. But often a 01461 machine-dependent strategy can generate better code. */ 01462 01463 #define XEXP_(X,Y) (X) 01464 #define LEGITIMIZE_RELOAD_ADDRESS(X, MODE, OPNUM, TYPE, IND_LEVELS, WIN) \ 01465 do { \ 01466 if (1&&(GET_CODE (X) == POST_INC || GET_CODE (X) == PRE_DEC)) \ 01467 { \ 01468 push_reload (XEXP (X,0), XEXP (X,0), &XEXP (X,0), &XEXP (X,0), \ 01469 POINTER_REGS, GET_MODE (X),GET_MODE (X) , 0, 0, \ 01470 OPNUM, RELOAD_OTHER); \ 01471 goto WIN; \ 01472 } \ 01473 if (GET_CODE (X) == PLUS \ 01474 && REG_P (XEXP (X, 0)) \ 01475 && GET_CODE (XEXP (X, 1)) == CONST_INT \ 01476 && INTVAL (XEXP (X, 1)) >= 1) \ 01477 { \ 01478 int fit = INTVAL (XEXP (X, 1)) <= (64 - GET_MODE_SIZE (MODE)); \ 01479 if (fit) \ 01480 { \ 01481 if (reg_equiv_address[REGNO (XEXP (X, 0))] != 0) \ 01482 { \ 01483 int regno = REGNO (XEXP (X, 0)); \ 01484 rtx mem = make_memloc (X, regno); \ 01485 push_reload (XEXP (mem,0), NULL, &XEXP (mem,0), NULL, \ 01486 POINTER_REGS, Pmode, VOIDmode, 0, 0, \ 01487 1, ADDR_TYPE (TYPE)); \ 01488 push_reload (mem, NULL_RTX, &XEXP (X, 0), NULL, \ 01489 BASE_POINTER_REGS, GET_MODE (X), VOIDmode, 0, 0, \ 01490 OPNUM, TYPE); \ 01491 goto WIN; \ 01492 } \ 01493 push_reload (XEXP (X, 0), NULL_RTX, &XEXP (X, 0), NULL, \ 01494 BASE_POINTER_REGS, GET_MODE (X), VOIDmode, 0, 0, \ 01495 OPNUM, TYPE); \ 01496 goto WIN; \ 01497 } \ 01498 else if (! (frame_pointer_needed && XEXP (X,0) == frame_pointer_rtx)) \ 01499 { \ 01500 push_reload (X, NULL_RTX, &X, NULL, \ 01501 POINTER_REGS, GET_MODE (X), VOIDmode, 0, 0, \ 01502 OPNUM, TYPE); \ 01503 goto WIN; \ 01504 } \ 01505 } \ 01506 } while(0) 01507 /* A C compound statement that attempts to replace X, which is an 01508 address that needs reloading, with a valid memory address for an 01509 operand of mode MODE. WIN will be a C statement label elsewhere 01510 in the code. It is not necessary to define this macro, but it 01511 might be useful for performance reasons. 01512 01513 For example, on the i386, it is sometimes possible to use a single 01514 reload register instead of two by reloading a sum of two pseudo 01515 registers into a register. On the other hand, for number of RISC 01516 processors offsets are limited so that often an intermediate 01517 address needs to be generated in order to address a stack slot. 01518 By defining LEGITIMIZE_RELOAD_ADDRESS appropriately, the 01519 intermediate addresses generated for adjacent some stack slots can 01520 be made identical, and thus be shared. 01521 01522 *Note*: This macro should be used with caution. It is necessary 01523 to know something of how reload works in order to effectively use 01524 this, and it is quite easy to produce macros that build in too 01525 much knowledge of reload internals. 01526 01527 *Note*: This macro must be able to reload an address created by a 01528 previous invocation of this macro. If it fails to handle such 01529 addresses then the compiler may generate incorrect code or abort. 01530 01531 The macro definition should use `push_reload' to indicate parts 01532 that need reloading; OPNUM, TYPE and IND_LEVELS are usually 01533 suitable to be passed unaltered to `push_reload'. 01534 01535 The code generated by this macro must not alter the substructure of 01536 X. If it transforms X into a more legitimate form, it should 01537 assign X (which will always be a C variable) a new value. This 01538 also applies to parts that you change indirectly by calling 01539 `push_reload'. 01540 01541 The macro definition may use `strict_memory_address_p' to test if 01542 the address has become legitimate. 01543 01544 If you want to change only a part of X, one standard way of doing 01545 this is to use `copy_rtx'. Note, however, that is unshares only a 01546 single level of rtl. Thus, if the part to be changed is not at the 01547 top level, you'll need to replace first the top leve It is not 01548 necessary for this macro to come up with a legitimate address; 01549 but often a machine-dependent strategy can generate better code. */ 01550 01551 #define GO_IF_MODE_DEPENDENT_ADDRESS(ADDR,LABEL) \ 01552 if (GET_CODE (ADDR) == POST_INC || GET_CODE (ADDR) == PRE_DEC) \ 01553 goto LABEL 01554 /* A C statement or compound statement with a conditional `goto 01555 LABEL;' executed if memory address X (an RTX) can have different 01556 meanings depending on the machine mode of the memory reference it 01557 is used for or if the address is valid for some modes but not 01558 others. 01559 01560 Autoincrement and autodecrement addresses typically have 01561 mode-dependent effects because the amount of the increment or 01562 decrement is the size of the operand being addressed. Some 01563 machines have other mode-dependent addresses. Many RISC machines 01564 have no mode-dependent addresses. 01565 01566 You may assume that ADDR is a valid address for the machine. */ 01567 01568 #define LEGITIMATE_CONSTANT_P(X) 1 01569 /* A C expression that is nonzero if X is a legitimate constant for 01570 an immediate operand on the target machine. You can assume that X 01571 satisfies `CONSTANT_P', so you need not check this. In fact, `1' 01572 is a suitable definition for this macro on machines where anything 01573 `CONSTANT_P' is valid. */ 01574 01575 #define CONST_COSTS(x,CODE,OUTER_CODE) \ 01576 case CONST_INT: \ 01577 if (OUTER_CODE == PLUS \ 01578 || OUTER_CODE == IOR \ 01579 || OUTER_CODE == AND \ 01580 || OUTER_CODE == MINUS \ 01581 || OUTER_CODE == SET \ 01582 || INTVAL (x) == 0) \ 01583 return 2; \ 01584 if (OUTER_CODE == COMPARE \ 01585 && INTVAL (x) >= 0 \ 01586 && INTVAL (x) <= 255) \ 01587 return 2; \ 01588 case CONST: \ 01589 case LABEL_REF: \ 01590 case SYMBOL_REF: \ 01591 return 4; \ 01592 case CONST_DOUBLE: \ 01593 return 4; 01594 01595 /* A part of a C `switch' statement that describes the relative costs 01596 of constant RTL expressions. It must contain `case' labels for 01597 expression codes `const_int', `const', `symbol_ref', `label_ref' 01598 and `const_double'. Each case must ultimately reach a `return' 01599 statement to return the relative cost of the use of that kind of 01600 constant value in an expression. The cost may depend on the 01601 precise value of the constant, which is available for examination 01602 in X, and the rtx code of the expression in which it is contained, 01603 found in OUTER_CODE. 01604 01605 CODE is the expression code--redundant, since it can be obtained 01606 with `GET_CODE (X)'. */ 01607 01608 #define DEFAULT_RTX_COSTS(x, code, outer_code) \ 01609 { \ 01610 int cst = default_rtx_costs (x, code, outer_code); \ 01611 if (cst>0) \ 01612 return cst; \ 01613 else if (cst<0) \ 01614 total += -cst; \ 01615 break; \ 01616 } 01617 01618 /* Like `CONST_COSTS' but applies to nonconstant RTL expressions. 01619 This can be used, for example, to indicate how costly a multiply 01620 instruction is. In writing this macro, you can use the construct 01621 `COSTS_N_INSNS (N)' to specify a cost equal to N fast 01622 instructions. OUTER_CODE is the code of the expression in which X 01623 is contained. 01624 01625 This macro is optional; do not define it if the default cost 01626 assumptions are adequate for the target machine. */ 01627 01628 #define ADDRESS_COST(ADDRESS) avr_address_cost (ADDRESS) 01629 01630 /* An expression giving the cost of an addressing mode that contains 01631 ADDRESS. If not defined, the cost is computed from the ADDRESS 01632 expression and the `CONST_COSTS' values. 01633 01634 For most CISC machines, the default cost is a good approximation 01635 of the true cost of the addressing mode. However, on RISC 01636 machines, all instructions normally have the same length and 01637 execution time. Hence all addresses will have equal costs. 01638 01639 In cases where more than one form of an address is known, the form 01640 with the lowest cost will be used. If multiple forms have the 01641 same, lowest, cost, the one that is the most complex will be used. 01642 01643 For example, suppose an address that is equal to the sum of a 01644 register and a constant is used twice in the same basic block. 01645 When this macro is not defined, the address will be computed in a 01646 register and memory references will be indirect through that 01647 register. On machines where the cost of the addressing mode 01648 containing the sum is no higher than that of a simple indirect 01649 reference, this will produce an additional instruction and 01650 possibly require an additional register. Proper specification of 01651 this macro eliminates this overhead for such machines. 01652 01653 Similar use of this macro is made in strength reduction of loops. 01654 01655 ADDRESS need not be valid as an address. In such a case, the cost 01656 is not relevant and can be any value; invalid addresses need not be 01657 assigned a different cost. 01658 01659 On machines where an address involving more than one register is as 01660 cheap as an address computation involving only one register, 01661 defining `ADDRESS_COST' to reflect this can cause two registers to 01662 be live over a region of code where only one would have been if 01663 `ADDRESS_COST' were not defined in that manner. This effect should 01664 be considered in the definition of this macro. Equivalent costs 01665 should probably only be given to addresses with different numbers 01666 of registers on machines with lots of registers. 01667 01668 This macro will normally either not be defined or be defined as a 01669 constant. */ 01670 01671 #define REGISTER_MOVE_COST(MODE, FROM, TO) ((FROM) == STACK_REG ? 6 \ 01672 : (TO) == STACK_REG ? 12 \ 01673 : 2) 01674 /* A C expression for the cost of moving data from a register in class 01675 FROM to one in class TO. The classes are expressed using the 01676 enumeration values such as `GENERAL_REGS'. A value of 2 is the 01677 default; other values are interpreted relative to that. 01678 01679 It is not required that the cost always equal 2 when FROM is the 01680 same as TO; on some machines it is expensive to move between 01681 registers if they are not general registers. 01682 01683 If reload sees an insn consisting of a single `set' between two 01684 hard registers, and if `REGISTER_MOVE_COST' applied to their 01685 classes returns a value of 2, reload does not check to ensure that 01686 the constraints of the insn are met. Setting a cost of other than 01687 2 will allow reload to verify that the constraints are met. You 01688 should do this if the `movM' pattern's constraints do not allow 01689 such copying. */ 01690 01691 #define MEMORY_MOVE_COST(MODE,CLASS,IN) ((MODE)==QImode ? 2 : \ 01692 (MODE)==HImode ? 4 : \ 01693 (MODE)==SImode ? 8 : \ 01694 (MODE)==SFmode ? 8 : 16) 01695 /* A C expression for the cost of moving data of mode M between a 01696 register and memory. A value of 4 is the default; this cost is 01697 relative to those in `REGISTER_MOVE_COST'. 01698 01699 If moving between registers and memory is more expensive than 01700 between two registers, you should define this macro to express the 01701 relative cost. */ 01702 01703 #define BRANCH_COST 0 01704 /* A C expression for the cost of a branch instruction. A value of 1 01705 is the default; other values are interpreted relative to that. 01706 01707 Here are additional macros which do not specify precise relative 01708 costs, but only that certain actions are more expensive than GCC would 01709 ordinarily expect. */ 01710 01711 #define SLOW_BYTE_ACCESS 0 01712 /* Define this macro as a C expression which is nonzero if accessing 01713 less than a word of memory (i.e. a `char' or a `short') is no 01714 faster than accessing a word of memory, i.e., if such access 01715 require more than one instruction or if there is no difference in 01716 cost between byte and (aligned) word loads. 01717 01718 When this macro is not defined, the compiler will access a field by 01719 finding the smallest containing object; when it is defined, a 01720 fullword load will be used if alignment permits. Unless bytes 01721 accesses are faster than word accesses, using word accesses is 01722 preferable since it may eliminate subsequent memory access if 01723 subsequent accesses occur to other fields in the same word of the 01724 structure, but to different bytes. 01725 01726 `SLOW_UNALIGNED_ACCESS' 01727 Define this macro to be the value 1 if unaligned accesses have a 01728 cost many times greater than aligned accesses, for example if they 01729 are emulated in a trap handler. 01730 01731 When this macro is non-zero, the compiler will act as if 01732 `STRICT_ALIGNMENT' were non-zero when generating code for block 01733 moves. This can cause significantly more instructions to be 01734 produced. Therefore, do not set this macro non-zero if unaligned 01735 accesses only add a cycle or two to the time for a memory access. 01736 01737 If the value of this macro is always zero, it need not be defined. 01738 01739 `DONT_REDUCE_ADDR' 01740 Define this macro to inhibit strength reduction of memory 01741 addresses. (On some machines, such strength reduction seems to do 01742 harm rather than good.) 01743 01744 `MOVE_RATIO' 01745 The number of scalar move insns which should be generated instead 01746 of a string move insn or a library call. Increasing the value 01747 will always make code faster, but eventually incurs high cost in 01748 increased code size. 01749 01750 If you don't define this, a reasonable default is used. */ 01751 01752 #define NO_FUNCTION_CSE 01753 /* Define this macro if it is as good or better to call a constant 01754 function address than to call an address kept in a register. */ 01755 01756 #define NO_RECURSIVE_FUNCTION_CSE 01757 /* Define this macro if it is as good or better for a function to call 01758 itself with an explicit address than to call an address kept in a 01759 register. */ 01760 01761 #define TEXT_SECTION_ASM_OP "\t.text" 01762 /* A C expression whose value is a string containing the assembler 01763 operation that should precede instructions and read-only data. 01764 Normally `"\t.text"' is right. */ 01765 01766 #define DATA_SECTION_ASM_OP "\t.data" 01767 /* A C expression whose value is a string containing the assembler 01768 operation to identify the following data as writable initialized 01769 data. Normally `"\t.data"' is right. */ 01770 01771 #define EXTRA_SECTIONS in_progmem 01772 /* A list of names for sections other than the standard two, which are 01773 `in_text' and `in_data'. You need not define this macro on a 01774 system with no other sections (that GCC needs to use). */ 01775 01776 #define EXTRA_SECTION_FUNCTIONS \ 01777 \ 01778 void \ 01779 progmem_section (void) \ 01780 { \ 01781 if (in_section != in_progmem) \ 01782 { \ 01783 fprintf (asm_out_file, \ 01784 "\t.section .progmem.gcc_sw_table, \"%s\", @progbits\n", \ 01785 AVR_MEGA ? "a" : "ax"); \ 01786 /* Should already be aligned, this is just to be safe if it isn't. */ \ 01787 fprintf (asm_out_file, "\t.p2align 1\n"); \ 01788 in_section = in_progmem; \ 01789 } \ 01790 } 01791 /* `EXTRA_SECTION_FUNCTIONS' 01792 One or more functions to be defined in `varasm.c'. These 01793 functions should do jobs analogous to those of `text_section' and 01794 `data_section', for your additional sections. Do not define this 01795 macro if you do not define `EXTRA_SECTIONS'. */ 01796 01797 #define READONLY_DATA_SECTION data_section 01798 /* On most machines, read-only variables, constants, and jump tables 01799 are placed in the text section. If this is not the case on your 01800 machine, this macro should be defined to be the name of a function 01801 (either `data_section' or a function defined in `EXTRA_SECTIONS') 01802 that switches to the section to be used for read-only items. 01803 01804 If these items should be placed in the text section, this macro 01805 should not be defined. */ 01806 01807 /* `SELECT_SECTION (EXP, RELOC, ALIGN)' 01808 A C statement or statements to switch to the appropriate section 01809 for output of EXP. You can assume that EXP is either a `VAR_DECL' 01810 node or a constant of some sort. RELOC indicates whether the 01811 initial value of EXP requires link-time relocations. Select the 01812 section by calling `text_section' or one of the alternatives for 01813 other sections. 01814 01815 Do not define this macro if you put all read-only variables and 01816 constants in the read-only data section (usually the text section). */ 01817 01818 /* `SELECT_RTX_SECTION (MODE, RTX, ALIGN)' 01819 A C statement or statements to switch to the appropriate section 01820 for output of RTX in mode MODE. You can assume that RTX is some 01821 kind of constant in RTL. The argument MODE is redundant except in 01822 the case of a `const_int' rtx. Select the section by calling 01823 `text_section' or one of the alternatives for other sections. 01824 01825 Do not define this macro if you put all constants in the read-only 01826 data section. */ 01827 01828 #define JUMP_TABLES_IN_TEXT_SECTION 0 01829 /* Define this macro if jump tables (for `tablejump' insns) should be 01830 output in the text section, along with the assembler instructions. 01831 Otherwise, the readonly data section is used. 01832 01833 This macro is irrelevant if there is no separate readonly data 01834 section. */ 01835 01836 #define ENCODE_SECTION_INFO(DECL) encode_section_info(DECL) 01837 /* Define this macro if references to a symbol must be treated 01838 differently depending on something about the variable or function 01839 named by the symbol (such as what section it is in). 01840 01841 The macro definition, if any, is executed immediately after the 01842 rtl for DECL has been created and stored in `DECL_RTL (DECL)'. 01843 The value of the rtl will be a `mem' whose address is a 01844 `symbol_ref'. 01845 01846 The usual thing for this macro to do is to record a flag in the 01847 `symbol_ref' (such as `SYMBOL_REF_FLAG') or to store a modified 01848 name string in the `symbol_ref' (if one bit is not enough 01849 information). */ 01850 01851 #define STRIP_NAME_ENCODING(VAR,SYMBOL_NAME) \ 01852 (VAR) = (SYMBOL_NAME) + ((SYMBOL_NAME)[0] == '*' || (SYMBOL_NAME)[0] == '@'); 01853 /* `STRIP_NAME_ENCODING (VAR, SYM_NAME)' 01854 Decode SYM_NAME and store the real name part in VAR, sans the 01855 characters that encode section info. Define this macro if 01856 `ENCODE_SECTION_INFO' alters the symbol's name string. */ 01857 01858 #define UNIQUE_SECTION(DECL, RELOC) unique_section (DECL, RELOC) 01859 /* `UNIQUE_SECTION (DECL, RELOC)' 01860 A C statement to build up a unique section name, expressed as a 01861 STRING_CST node, and assign it to `DECL_SECTION_NAME (DECL)'. 01862 RELOC indicates whether the initial value of EXP requires 01863 link-time relocations. If you do not define this macro, GNU CC 01864 will use the symbol name prefixed by `.' as the section name. */ 01865 01866 #define ASM_FILE_START(STREAM) asm_file_start (STREAM) 01867 /* A C expression which outputs to the stdio stream STREAM some 01868 appropriate text to go at the start of an assembler file. 01869 01870 Normally this macro is defined to output a line containing 01871 `#NO_APP', which is a comment that has no effect on most 01872 assemblers but tells the GNU assembler that it can save time by not 01873 checking for certain assembler constructs. 01874 01875 On systems that use SDB, it is necessary to output certain 01876 commands; see `attasm.h'. */ 01877 01878 #define ASM_FILE_END(STREAM) asm_file_end (STREAM) 01879 /* A C expression which outputs to the stdio stream STREAM some 01880 appropriate text to go at the end of an assembler file. 01881 01882 If this macro is not defined, the default is to output nothing 01883 special at the end of the file. Most systems don't require any 01884 definition. 01885 01886 On systems that use SDB, it is necessary to output certain 01887 commands; see `attasm.h'. */ 01888 01889 #define ASM_COMMENT_START " ; " 01890 /* A C string constant describing how to begin a comment in the target 01891 assembler language. The compiler assumes that the comment will 01892 end at the end of the line. */ 01893 01894 #define ASM_APP_ON "/* #APP */\n" 01895 /* A C string constant for text to be output before each `asm' 01896 statement or group of consecutive ones. Normally this is 01897 `"#APP"', which is a comment that has no effect on most assemblers 01898 but tells the GNU assembler that it must check the lines that 01899 follow for all valid assembler constructs. */ 01900 01901 #define ASM_APP_OFF "/* #NOAPP */\n" 01902 /* A C string constant for text to be output after each `asm' 01903 statement or group of consecutive ones. Normally this is 01904 `"#NO_APP"', which tells the GNU assembler to resume making the 01905 time-saving assumptions that are valid for ordinary compiler 01906 output. */ 01907 01908 #define ASM_OUTPUT_SOURCE_LINE(STREAM, LINE) fprintf (STREAM,"/* line: %d */\n",LINE) 01909 /* A C statement to output DBX or SDB debugging information before 01910 code for line number LINE of the current source file to the stdio 01911 stream STREAM. 01912 01913 This macro need not be defined if the standard form of debugging 01914 information for the debugger in use is appropriate. */ 01915 01916 /* Switch into a generic section. */ 01917 #define TARGET_ASM_NAMED_SECTION default_elf_asm_named_section 01918 01919 #define OBJC_PROLOGUE {} 01920 /* A C statement to output any assembler statements which are 01921 required to precede any Objective C object definitions or message 01922 sending. The statement is executed only when compiling an 01923 Objective C program. */ 01924 01925 01926 #define ASM_OUTPUT_ASCII(FILE, P, SIZE) gas_output_ascii (FILE,P,SIZE) 01927 /* `ASM_OUTPUT_ASCII (STREAM, PTR, LEN)' 01928 output_ascii (FILE, P, SIZE) 01929 A C statement to output to the stdio stream STREAM an assembler 01930 instruction to assemble a string constant containing the LEN bytes 01931 at PTR. PTR will be a C expression of type `char *' and LEN a C 01932 expression of type `int'. 01933 01934 If the assembler has a `.ascii' pseudo-op as found in the Berkeley 01935 Unix assembler, do not define the macro `ASM_OUTPUT_ASCII'. */ 01936 01937 #define IS_ASM_LOGICAL_LINE_SEPARATOR(C) ((C) == '\n' \ 01938 || ((C) == '$')) 01939 /* Define this macro as a C expression which is nonzero if C is used 01940 as a logical line separator by the assembler. 01941 01942 If you do not define this macro, the default is that only the 01943 character `;' is treated as a logical line separator. */ 01944 01945 /* These macros are provided by `real.h' for writing the definitions of 01946 `ASM_OUTPUT_DOUBLE' and the like: */ 01947 01948 #define ASM_OUTPUT_COMMON(STREAM, NAME, SIZE, ROUNDED) \ 01949 do { \ 01950 fputs ("\t.comm ", (STREAM)); \ 01951 assemble_name ((STREAM), (NAME)); \ 01952 fprintf ((STREAM), ",%d,1\n", (SIZE)); \ 01953 } while (0) 01954 /* A C statement (sans semicolon) to output to the stdio stream 01955 STREAM the assembler definition of a common-label named NAME whose 01956 size is SIZE bytes. The variable ROUNDED is the size rounded up 01957 to whatever alignment the caller wants. 01958 01959 Use the expression `assemble_name (STREAM, NAME)' to output the 01960 name itself; before and after that, output the additional 01961 assembler syntax for defining the name, and a newline. 01962 01963 This macro controls how the assembler definitions of uninitialized 01964 common global variables are output. */ 01965 01966 #define ASM_OUTPUT_LOCAL(STREAM, NAME, SIZE, ROUNDED) \ 01967 do { \ 01968 fputs ("\t.lcomm ", (STREAM)); \ 01969 assemble_name ((STREAM), (NAME)); \ 01970 fprintf ((STREAM), ",%d\n", (SIZE)); \ 01971 } while (0) 01972 /* A C statement (sans semicolon) to output to the stdio stream 01973 STREAM the assembler definition of a local-common-label named NAME 01974 whose size is SIZE bytes. The variable ROUNDED is the size 01975 rounded up to whatever alignment the caller wants. 01976 01977 Use the expression `assemble_name (STREAM, NAME)' to output the 01978 name itself; before and after that, output the additional 01979 assembler syntax for defining the name, and a newline. 01980 01981 This macro controls how the assembler definitions of uninitialized 01982 static variables are output. */ 01983 01984 #define ASM_OUTPUT_LABEL(STREAM, NAME) \ 01985 { \ 01986 assemble_name (STREAM, NAME); \ 01987 fprintf (STREAM, ":\n"); \ 01988 } 01989 /* A C statement (sans semicolon) to output to the stdio stream 01990 STREAM the assembler definition of a label named NAME. Use the 01991 expression `assemble_name (STREAM, NAME)' to output the name 01992 itself; before and after that, output the additional assembler 01993 syntax for defining the name, and a newline. */ 01994 01995 #undef TYPE_ASM_OP 01996 #undef SIZE_ASM_OP 01997 #undef WEAK_ASM_OP 01998 #define TYPE_ASM_OP "\t.type\t" 01999 #define SIZE_ASM_OP "\t.size\t" 02000 #define WEAK_ASM_OP "\t.weak\t" 02001 /* Define the strings used for the special svr4 .type and .size directives. 02002 These strings generally do not vary from one system running svr4 to 02003 another, but if a given system (e.g. m88k running svr) needs to use 02004 different pseudo-op names for these, they may be overridden in the 02005 file which includes this one. */ 02006 02007 02008 #undef TYPE_OPERAND_FMT 02009 #define TYPE_OPERAND_FMT "@%s" 02010 /* The following macro defines the format used to output the second 02011 operand of the .type assembler directive. Different svr4 assemblers 02012 expect various different forms for this operand. The one given here 02013 is just a default. You may need to override it in your machine- 02014 specific tm.h file (depending upon the particulars of your assembler). */ 02015 02016 02017 #define ASM_DECLARE_FUNCTION_NAME(FILE, NAME, DECL) \ 02018 do { \ 02019 fprintf (FILE, "%s", TYPE_ASM_OP); \ 02020 assemble_name (FILE, NAME); \ 02021 putc (',', FILE); \ 02022 fprintf (FILE, TYPE_OPERAND_FMT, "function"); \ 02023 putc ('\n', FILE); \ 02024 ASM_OUTPUT_LABEL (FILE, NAME); \ 02025 } while (0) 02026 /* A C statement (sans semicolon) to output to the stdio stream 02027 STREAM any text necessary for declaring the name NAME of a 02028 function which is being defined. This macro is responsible for 02029 outputting the label definition (perhaps using 02030 `ASM_OUTPUT_LABEL'). The argument DECL is the `FUNCTION_DECL' 02031 tree node representing the function. 02032 02033 If this macro is not defined, then the function name is defined in 02034 the usual manner as a label (by means of `ASM_OUTPUT_LABEL'). */ 02035 02036 #define ASM_DECLARE_FUNCTION_SIZE(FILE, FNAME, DECL) \ 02037 do { \ 02038 if (!flag_inhibit_size_directive) \ 02039 { \ 02040 char label[256]; \ 02041 static int labelno; \ 02042 labelno++; \ 02043 ASM_GENERATE_INTERNAL_LABEL (label, "Lfe", labelno); \ 02044 ASM_OUTPUT_INTERNAL_LABEL (FILE, "Lfe", labelno); \ 02045 fprintf (FILE, "%s", SIZE_ASM_OP); \ 02046 assemble_name (FILE, (FNAME)); \ 02047 fprintf (FILE, ","); \ 02048 assemble_name (FILE, label); \ 02049 fprintf (FILE, "-"); \ 02050 assemble_name (FILE, (FNAME)); \ 02051 putc ('\n', FILE); \ 02052 } \ 02053 } while (0) 02054 /* A C statement (sans semicolon) to output to the stdio stream 02055 STREAM any text necessary for declaring the size of a function 02056 which is being defined. The argument NAME is the name of the 02057 function. The argument DECL is the `FUNCTION_DECL' tree node 02058 representing the function. 02059 02060 If this macro is not defined, then the function size is not 02061 defined. */ 02062 02063 #define ASM_DECLARE_OBJECT_NAME(FILE, NAME, DECL) \ 02064 do { \ 02065 fprintf (FILE, "%s", TYPE_ASM_OP); \ 02066 assemble_name (FILE, NAME); \ 02067 putc (',', FILE); \ 02068 fprintf (FILE, TYPE_OPERAND_FMT, "object"); \ 02069 putc ('\n', FILE); \ 02070 size_directive_output = 0; \ 02071 if (!flag_inhibit_size_directive && DECL_SIZE (DECL)) \ 02072 { \ 02073 size_directive_output = 1; \ 02074 fprintf (FILE, "%s", SIZE_ASM_OP); \ 02075 assemble_name (FILE, NAME); \ 02076 fprintf (FILE, ",%d\n", int_size_in_bytes (TREE_TYPE (DECL))); \ 02077 } \ 02078 ASM_OUTPUT_LABEL(FILE, NAME); \ 02079 } while (0) 02080 /* A C statement (sans semicolon) to output to the stdio stream 02081 STREAM any text necessary for declaring the name NAME of an 02082 initialized variable which is being defined. This macro must 02083 output the label definition (perhaps using `ASM_OUTPUT_LABEL'). 02084 The argument DECL is the `VAR_DECL' tree node representing the 02085 variable. 02086 02087 If this macro is not defined, then the variable name is defined in 02088 the usual manner as a label (by means of `ASM_OUTPUT_LABEL'). */ 02089 02090 #define ASM_FINISH_DECLARE_OBJECT(FILE, DECL, TOP_LEVEL, AT_END) \ 02091 do { \ 02092 const char *name = XSTR (XEXP (DECL_RTL (DECL), 0), 0); \ 02093 if (!flag_inhibit_size_directive && DECL_SIZE (DECL) \ 02094 && ! AT_END && TOP_LEVEL \ 02095 && DECL_INITIAL (DECL) == error_mark_node \ 02096 && !size_directive_output) \ 02097 { \ 02098 size_directive_output = 1; \ 02099 fprintf (FILE, "%s", SIZE_ASM_OP); \ 02100 assemble_name (FILE, name); \ 02101 fprintf (FILE, ",%d\n", int_size_in_bytes (TREE_TYPE (DECL))); \ 02102 } \ 02103 } while (0) 02104 /* A C statement (sans semicolon) to finish up declaring a variable 02105 name once the compiler has processed its initializer fully and 02106 thus has had a chance to determine the size of an array when 02107 controlled by an initializer. This is used on systems where it's 02108 necessary to declare something about the size of the object. 02109 02110 If you don't define this macro, that is equivalent to defining it 02111 to do nothing. */ 02112 02113 02114 #define ESCAPES \ 02115 "\1\1\1\1\1\1\1\1btn\1fr\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\ 02116 \0\0\"\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\ 02117 \0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\\\0\0\0\ 02118 \0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\1\ 02119 \1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\ 02120 \1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\ 02121 \1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\ 02122 \1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1" 02123 /* A table of bytes codes used by the ASM_OUTPUT_ASCII and 02124 ASM_OUTPUT_LIMITED_STRING macros. Each byte in the table 02125 corresponds to a particular byte value [0..255]. For any 02126 given byte value, if the value in the corresponding table 02127 position is zero, the given character can be output directly. 02128 If the table value is 1, the byte must be output as a \ooo 02129 octal escape. If the tables value is anything else, then the 02130 byte value should be output as a \ followed by the value 02131 in the table. Note that we can use standard UN*X escape 02132 sequences for many control characters, but we don't use 02133 \a to represent BEL because some svr4 assemblers (e.g. on 02134 the i386) don't know about that. Also, we don't use \v 02135 since some versions of gas, such as 2.2 did not accept it. */ 02136 02137 #define STRING_LIMIT ((unsigned) 64) 02138 #define STRING_ASM_OP "\t.string\t" 02139 /* Some svr4 assemblers have a limit on the number of characters which 02140 can appear in the operand of a .string directive. If your assembler 02141 has such a limitation, you should define STRING_LIMIT to reflect that 02142 limit. Note that at least some svr4 assemblers have a limit on the 02143 actual number of bytes in the double-quoted string, and that they 02144 count each character in an escape sequence as one byte. Thus, an 02145 escape sequence like \377 would count as four bytes. 02146 02147 If your target assembler doesn't support the .string directive, you 02148 should define this to zero. */ 02149 02150 #define ASM_GLOBALIZE_LABEL(STREAM, NAME) \ 02151 do { \ 02152 fprintf (STREAM, ".global\t"); \ 02153 assemble_name (STREAM, NAME); \ 02154 fprintf (STREAM, "\n"); \ 02155 } \ 02156 while (0) 02157 02158 /* A C statement (sans semicolon) to output to the stdio stream 02159 STREAM some commands that will make the label NAME global; that 02160 is, available for reference from other files. Use the expression 02161 `assemble_name (STREAM, NAME)' to output the name itself; before 02162 and after that, output the additional assembler syntax for making 02163 that name global, and a newline. */ 02164 02165 #define ASM_WEAKEN_LABEL(FILE, NAME) \ 02166 do \ 02167 { \ 02168 fputs ("\t.weak\t", (FILE)); \ 02169 assemble_name ((FILE), (NAME)); \ 02170 fputc ('\n', (FILE)); \ 02171 } \ 02172 while (0) 02173 02174 /* A C statement (sans semicolon) to output to the stdio stream 02175 STREAM some commands that will make the label NAME weak; that is, 02176 available for reference from other files but only used if no other 02177 definition is available. Use the expression `assemble_name 02178 (STREAM, NAME)' to output the name itself; before and after that, 02179 output the additional assembler syntax for making that name weak, 02180 and a newline. 02181 02182 If you don't define this macro, GNU CC will not support weak 02183 symbols and you should not define the `SUPPORTS_WEAK' macro. 02184 */ 02185 02186 #define SUPPORTS_WEAK 1 02187 /* A C expression which evaluates to true if the target supports weak 02188 symbols. 02189 02190 If you don't define this macro, `defaults.h' provides a default 02191 definition. If `ASM_WEAKEN_LABEL' is defined, the default 02192 definition is `1'; otherwise, it is `0'. Define this macro if you 02193 want to control weak symbol support with a compiler flag such as 02194 `-melf'. 02195 02196 `MAKE_DECL_ONE_ONLY' 02197 A C statement (sans semicolon) to mark DECL to be emitted as a 02198 public symbol such that extra copies in multiple translation units 02199 will be discarded by the linker. Define this macro if your object 02200 file format provides support for this concept, such as the `COMDAT' 02201 section flags in the Microsoft Windows PE/COFF format, and this 02202 support requires changes to DECL, such as putting it in a separate 02203 section. 02204 02205 `SUPPORTS_WEAK' 02206 A C expression which evaluates to true if the target supports 02207 one-only semantics. 02208 02209 If you don't define this macro, `varasm.c' provides a default 02210 definition. If `MAKE_DECL_ONE_ONLY' is defined, the default 02211 definition is `1'; otherwise, it is `0'. Define this macro if you 02212 want to control weak symbol support with a compiler flag, or if 02213 setting the `DECL_ONE_ONLY' flag is enough to mark a declaration to 02214 be emitted as one-only. */ 02215 02216 #define ASM_OUTPUT_INTERNAL_LABEL(STREAM, PREFIX, NUM) \ 02217 fprintf(STREAM, ".%s%d:\n", PREFIX, NUM) 02218 /* A C statement to output to the stdio stream STREAM a label whose 02219 name is made from the string PREFIX and the number NUM. 02220 02221 It is absolutely essential that these labels be distinct from the 02222 labels used for user-level functions and variables. Otherwise, 02223 certain programs will have name conflicts with internal labels. 02224 02225 It is desirable to exclude internal labels from the symbol table 02226 of the object file. Most assemblers have a naming convention for 02227 labels that should be excluded; on many systems, the letter `L' at 02228 the beginning of a label has this effect. You should find out what 02229 convention your system uses, and follow it. 02230 02231 The usual definition of this macro is as follows: 02232 02233 fprintf (STREAM, "L%s%d:\n", PREFIX, NUM) */ 02234 02235 #define ASM_GENERATE_INTERNAL_LABEL(STRING, PREFIX, NUM) \ 02236 sprintf (STRING, "*.%s%d", PREFIX, NUM) 02237 /* A C statement to store into the string STRING a label whose name 02238 is made from the string PREFIX and the number NUM. 02239 02240 This string, when output subsequently by `assemble_name', should 02241 produce the output that `ASM_OUTPUT_INTERNAL_LABEL' would produce 02242 with the same PREFIX and NUM. 02243 02244 If the string begins with `*', then `assemble_name' will output 02245 the rest of the string unchanged. It is often convenient for 02246 `ASM_GENERATE_INTERNAL_LABEL' to use `*' in this way. If the 02247 string doesn't start with `*', then `ASM_OUTPUT_LABELREF' gets to 02248 output the string, and may change it. (Of course, 02249 `ASM_OUTPUT_LABELREF' is also part of your machine description, so 02250 you should know what it does on your machine.) */ 02251 02252 #define ASM_FORMAT_PRIVATE_NAME(OUTPUT, NAME, LABELNO) \ 02253 ( (OUTPUT) = (char *) alloca (strlen ((NAME)) + 10), \ 02254 sprintf ((OUTPUT), "%s.%d", (NAME), (LABELNO))) 02255 02256 /* A C expression to assign to OUTVAR (which is a variable of type 02257 `char *') a newly allocated string made from the string NAME and 02258 the number NUMBER, with some suitable punctuation added. Use 02259 `alloca' to get space for the string. 02260 02261 The string will be used as an argument to `ASM_OUTPUT_LABELREF' to 02262 produce an assembler label for an internal static variable whose 02263 name is NAME. Therefore, the string must be such as to result in 02264 valid assembler code. The argument NUMBER is different each time 02265 this macro is executed; it prevents conflicts between 02266 similarly-named internal static variables in different scopes. 02267 02268 Ideally this string should not be a valid C identifier, to prevent 02269 any conflict with the user's own symbols. Most assemblers allow 02270 periods or percent signs in assembler symbols; putting at least 02271 one of these between the name and the number will suffice. */ 02272 02273 /* `ASM_OUTPUT_WEAK_ALIAS (STREAM, NAME, VALUE)' 02274 A C statement to output to the stdio stream STREAM assembler code 02275 which defines (equates) the weak symbol NAME to have the value 02276 VALUE. 02277 02278 Define this macro if the target only supports weak aliases; define 02279 ASM_OUTPUT_DEF instead if possible. */ 02280 02281 #define HAS_INIT_SECTION 1 02282 /* If defined, `main' will not call `__main' as described above. 02283 This macro should be defined for systems that control the contents 02284 of the init section on a symbol-by-symbol basis, such as OSF/1, 02285 and should not be defined explicitly for systems that support 02286 `INIT_SECTION_ASM_OP'. */ 02287 02288 #define REGISTER_NAMES { \ 02289 "r0","r1","r2","r3","r4","r5","r6","r7", \ 02290 "r8","r9","r10","r11","r12","r13","r14","r15", \ 02291 "r16","r17","r18","r19","r20","r21","r22","r23", \ 02292 "r24","r25","r26","r27","r28","r29","r30","r31", \ 02293 "__SPL__","__SPH__","argL","argH"} 02294 /* A C initializer containing the assembler's names for the machine 02295 registers, each one as a C string constant. This is what 02296 translates register numbers in the compiler into assembler 02297 language. */ 02298 02299 #define FINAL_PRESCAN_INSN(insn, operand, nop) final_prescan_insn (insn, operand,nop) 02300 /* If defined, a C statement to be executed just prior to the output 02301 of assembler code for INSN, to modify the extracted operands so 02302 they will be output differently. 02303 02304 Here the argument OPVEC is the vector containing the operands 02305 extracted from INSN, and NOPERANDS is the number of elements of 02306 the vector which contain meaningful data for this insn. The 02307 contents of this vector are what will be used to convert the insn 02308 template into assembler code, so you can change the assembler 02309 output by changing the contents of the vector. 02310 02311 This macro is useful when various assembler syntaxes share a single 02312 file of instruction patterns; by defining this macro differently, 02313 you can cause a large class of instructions to be output 02314 differently (such as with rearranged operands). Naturally, 02315 variations in assembler syntax affecting individual insn patterns 02316 ought to be handled by writing conditional output routines in 02317 those patterns. 02318 02319 If this macro is not defined, it is equivalent to a null statement. */ 02320 02321 #define PRINT_OPERAND(STREAM, X, CODE) print_operand (STREAM, X, CODE) 02322 /* A C compound statement to output to stdio stream STREAM the 02323 assembler syntax for an instruction operand X. X is an RTL 02324 expression. 02325 02326 CODE is a value that can be used to specify one of several ways of 02327 printing the operand. It is used when identical operands must be 02328 printed differently depending on the context. CODE comes from the 02329 `%' specification that was used to request printing of the 02330 operand. If the specification was just `%DIGIT' then CODE is 0; 02331 if the specification was `%LTR DIGIT' then CODE is the ASCII code 02332 for LTR. 02333 02334 If X is a register, this macro should print the register's name. 02335 The names can be found in an array `reg_names' whose type is `char 02336 *[]'. `reg_names' is initialized from `REGISTER_NAMES'. 02337 02338 When the machine description has a specification `%PUNCT' (a `%' 02339 followed by a punctuation character), this macro is called with a 02340 null pointer for X and the punctuation character for CODE. */ 02341 02342 #define PRINT_OPERAND_PUNCT_VALID_P(CODE) ((CODE) == '~') 02343 /* A C expression which evaluates to true if CODE is a valid 02344 punctuation character for use in the `PRINT_OPERAND' macro. If 02345 `PRINT_OPERAND_PUNCT_VALID_P' is not defined, it means that no 02346 punctuation characters (except for the standard one, `%') are used 02347 in this way. */ 02348 02349 #define PRINT_OPERAND_ADDRESS(STREAM, X) print_operand_address(STREAM, X) 02350 /* A C compound statement to output to stdio stream STREAM the 02351 assembler syntax for an instruction operand that is a memory 02352 reference whose address is X. X is an RTL expression. 02353 02354 On some machines, the syntax for a symbolic address depends on the 02355 section that the address refers to. On these machines, define the 02356 macro `ENCODE_SECTION_INFO' to store the information into the 02357 `symbol_ref', and then check for it here. *Note Assembler 02358 Format::. */ 02359 02360 #define USER_LABEL_PREFIX "" 02361 /* `LOCAL_LABEL_PREFIX' 02362 `REGISTER_PREFIX' 02363 `IMMEDIATE_PREFIX' 02364 If defined, C string expressions to be used for the `%R', `%L', 02365 `%U', and `%I' options of `asm_fprintf' (see `final.c'). These 02366 are useful when a single `md' file must support multiple assembler 02367 formats. In that case, the various `tm.h' files can define these 02368 macros differently. */ 02369 02370 #define ASSEMBLER_DIALECT AVR_ENHANCED 02371 /* If your target supports multiple dialects of assembler language 02372 (such as different opcodes), define this macro as a C expression 02373 that gives the numeric index of the assembler language dialect to 02374 use, with zero as the first variant. 02375 02376 If this macro is defined, you may use constructs of the form 02377 `{option0|option1|option2...}' in the output templates of patterns 02378 (*note Output Template::.) or in the first argument of 02379 `asm_fprintf'. This construct outputs `option0', `option1' or 02380 `option2', etc., if the value of `ASSEMBLER_DIALECT' is zero, one 02381 or two, etc. Any special characters within these strings retain 02382 their usual meaning. 02383 02384 If you do not define this macro, the characters `{', `|' and `}' 02385 do not have any special meaning when used in templates or operands 02386 to `asm_fprintf'. 02387 02388 Define the macros `REGISTER_PREFIX', `LOCAL_LABEL_PREFIX', 02389 `USER_LABEL_PREFIX' and `IMMEDIATE_PREFIX' if you can express the 02390 variations in assembler language syntax with that mechanism. 02391 Define `ASSEMBLER_DIALECT' and use the `{option0|option1}' syntax 02392 if the syntax variant are larger and involve such things as 02393 different opcodes or operand order. */ 02394 02395 #define ASM_OUTPUT_REG_PUSH(STREAM, REGNO) \ 02396 { \ 02397 if (REGNO > 31) \ 02398 abort (); \ 02399 fprintf (STREAM, "\tpush\tr%d", REGNO); \ 02400 } 02401 /* A C expression to output to STREAM some assembler code which will 02402 push hard register number REGNO onto the stack. The code need not 02403 be optimal, since this macro is used only when profiling. */ 02404 02405 #define ASM_OUTPUT_REG_POP(STREAM, REGNO) \ 02406 { \ 02407 if (REGNO > 31) \ 02408 abort (); \ 02409 fprintf (STREAM, "\tpop\tr%d", REGNO); \ 02410 } 02411 /* A C expression to output to STREAM some assembler code which will 02412 pop hard register number REGNO off of the stack. The code need 02413 not be optimal, since this macro is used only when profiling. */ 02414 02415 #define ASM_OUTPUT_ADDR_VEC_ELT(STREAM, VALUE) \ 02416 avr_output_addr_vec_elt(STREAM, VALUE) 02417 /* This macro should be provided on machines where the addresses in a 02418 dispatch table are absolute. 02419 02420 The definition should be a C statement to output to the stdio 02421 stream STREAM an assembler pseudo-instruction to generate a 02422 reference to a label. VALUE is the number of an internal label 02423 whose definition is output using `ASM_OUTPUT_INTERNAL_LABEL'. For 02424 example, 02425 02426 fprintf (STREAM, "\t.word L%d\n", VALUE) */ 02427 02428 #define ASM_OUTPUT_CASE_LABEL(STREAM, PREFIX, NUM, TABLE) \ 02429 progmem_section (), ASM_OUTPUT_INTERNAL_LABEL (STREAM, PREFIX, NUM) 02430 02431 /* `ASM_OUTPUT_CASE_LABEL (STREAM, PREFIX, NUM, TABLE)' 02432 Define this if the label before a jump-table needs to be output 02433 specially. The first three arguments are the same as for 02434 `ASM_OUTPUT_INTERNAL_LABEL'; the fourth argument is the jump-table 02435 which follows (a `jump_insn' containing an `addr_vec' or 02436 `addr_diff_vec'). 02437 02438 This feature is used on system V to output a `swbeg' statement for 02439 the table. 02440 02441 If this macro is not defined, these labels are output with 02442 `ASM_OUTPUT_INTERNAL_LABEL'. */ 02443 02444 /* `ASM_OUTPUT_CASE_END (STREAM, NUM, TABLE)' 02445 Define this if something special must be output at the end of a 02446 jump-table. The definition should be a C statement to be executed 02447 after the assembler code for the table is written. It should write 02448 the appropriate code to stdio stream STREAM. The argument TABLE 02449 is the jump-table insn, and NUM is the label-number of the 02450 preceding label. 02451 02452 If this macro is not defined, nothing special is output at the end 02453 of the jump-table. */ 02454 02455 #define ASM_OUTPUT_SKIP(STREAM, N) \ 02456 fprintf (STREAM, "\t.skip %d,0\n", N) 02457 /* A C statement to output to the stdio stream STREAM an assembler 02458 instruction to advance the location counter by NBYTES bytes. 02459 Those bytes should be zero when loaded. NBYTES will be a C 02460 expression of type `int'. */ 02461 02462 #define ASM_OUTPUT_ALIGN(STREAM, POWER) 02463 /* A C statement to output to the stdio stream STREAM an assembler 02464 command to advance the location counter to a multiple of 2 to the 02465 POWER bytes. POWER will be a C expression of type `int'. */ 02466 02467 #define CASE_VECTOR_MODE HImode 02468 /* An alias for a machine mode name. This is the machine mode that 02469 elements of a jump-table should have. */ 02470 02471 extern int avr_case_values_threshold; 02472 02473 #define CASE_VALUES_THRESHOLD avr_case_values_threshold 02474 /* `CASE_VALUES_THRESHOLD' 02475 Define this to be the smallest number of different values for 02476 which it is best to use a jump-table instead of a tree of 02477 conditional branches. The default is four for machines with a 02478 `casesi' instruction and five otherwise. This is best for most 02479 machines. */ 02480 02481 #undef WORD_REGISTER_OPERATIONS 02482 /* Define this macro if operations between registers with integral 02483 mode smaller than a word are always performed on the entire 02484 register. Most RISC machines have this property and most CISC 02485 machines do not. */ 02486 02487 #define MOVE_MAX 4 02488 /* The maximum number of bytes that a single instruction can move 02489 quickly between memory and registers or between two memory 02490 locations. */ 02491 02492 #define TRULY_NOOP_TRUNCATION(OUTPREC, INPREC) 1 02493 /* A C expression which is nonzero if on this machine it is safe to 02494 "convert" an integer of INPREC bits to one of OUTPREC bits (where 02495 OUTPREC is smaller than INPREC) by merely operating on it as if it 02496 had only OUTPREC bits. 02497 02498 On many machines, this expression can be 1. 02499 02500 When `TRULY_NOOP_TRUNCATION' returns 1 for a pair of sizes for 02501 modes for which `MODES_TIEABLE_P' is 0, suboptimal code can result. 02502 If this is the case, making `TRULY_NOOP_TRUNCATION' return 0 in 02503 such cases may improve things. */ 02504 02505 #define Pmode HImode 02506 /* An alias for the machine mode for pointers. On most machines, 02507 define this to be the integer mode corresponding to the width of a 02508 hardware pointer; `SImode' on 32-bit machine or `DImode' on 64-bit 02509 machines. On some machines you must define this to be one of the 02510 partial integer modes, such as `PSImode'. 02511 02512 The width of `Pmode' must be at least as large as the value of 02513 `POINTER_SIZE'. If it is not equal, you must define the macro 02514 `POINTERS_EXTEND_UNSIGNED' to specify how pointers are extended to 02515 `Pmode'. */ 02516 02517 #define FUNCTION_MODE HImode 02518 /* An alias for the machine mode used for memory references to 02519 functions being called, in `call' RTL expressions. On most 02520 machines this should be `QImode'. */ 02521 /* 1 3 */ 02522 #define INTEGRATE_THRESHOLD(DECL) (1 + (3 * list_length (DECL_ARGUMENTS (DECL)) / 2)) 02523 02524 /* A C expression for the maximum number of instructions above which 02525 the function DECL should not be inlined. DECL is a 02526 `FUNCTION_DECL' node. 02527 02528 The default definition of this macro is 64 plus 8 times the number 02529 of arguments that the function accepts. Some people think a larger 02530 threshold should be used on RISC machines. */ 02531 02532 #define DOLLARS_IN_IDENTIFIERS 0 02533 /* Define this macro to control use of the character `$' in identifier 02534 names. 0 means `$' is not allowed by default; 1 means it is 02535 allowed. 1 is the default; there is no need to define this macro 02536 in that case. This macro controls the compiler proper; it does 02537 not affect the preprocessor. */ 02538 02539 #define NO_DOLLAR_IN_LABEL 1 02540 /* Define this macro if the assembler does not accept the character 02541 `$' in label names. By default constructors and destructors in 02542 G++ have `$' in the identifiers. If this macro is defined, `.' is 02543 used instead. */ 02544 02545 #define MACHINE_DEPENDENT_REORG(INSN) machine_dependent_reorg (INSN) 02546 /* In rare cases, correct code generation requires extra machine 02547 dependent processing between the second jump optimization pass and 02548 delayed branch scheduling. On those machines, define this macro 02549 as a C statement to act on the code starting at INSN. */ 02550 02551 #define GIV_SORT_CRITERION(X, Y) \ 02552 if (GET_CODE ((X)->add_val) == CONST_INT \ 02553 && GET_CODE ((Y)->add_val) == CONST_INT) \ 02554 return INTVAL ((X)->add_val) - INTVAL ((Y)->add_val); 02555 02556 /* `GIV_SORT_CRITERION(GIV1, GIV2)' 02557 In some cases, the strength reduction optimization pass can 02558 produce better code if this is defined. This macro controls the 02559 order that induction variables are combined. This macro is 02560 particularly useful if the target has limited addressing modes. 02561 For instance, the SH target has only positive offsets in 02562 addresses. Thus sorting to put the smallest address first allows 02563 the most combinations to be found. */ 02564 02565 #define TRAMPOLINE_TEMPLATE(FILE) \ 02566 internal_error ("trampolines not supported") 02567 02568 /* Length in units of the trampoline for entering a nested function. */ 02569 02570 #define TRAMPOLINE_SIZE 4 02571 02572 /* Emit RTL insns to initialize the variable parts of a trampoline. 02573 FNADDR is an RTX for the address of the function's pure code. 02574 CXT is an RTX for the static chain value for the function. */ 02575 02576 #define INITIALIZE_TRAMPOLINE(TRAMP, FNADDR, CXT) \ 02577 { \ 02578 emit_move_insn (gen_rtx (MEM, HImode, plus_constant ((TRAMP), 2)), CXT); \ 02579 emit_move_insn (gen_rtx (MEM, HImode, plus_constant ((TRAMP), 6)), FNADDR); \ 02580 } 02581 /* Store in cc_status the expressions 02582 that the condition codes will describe 02583 after execution of an instruction whose pattern is EXP. 02584 Do not alter them if the instruction would not alter the cc's. */ 02585 02586 #define NOTICE_UPDATE_CC(EXP, INSN) notice_update_cc(EXP, INSN) 02587 02588 /* The add insns don't set overflow in a usable way. */ 02589 #define CC_OVERFLOW_UNUSABLE 01000 02590 /* The mov,and,or,xor insns don't set carry. That's ok though as the 02591 Z bit is all we need when doing unsigned comparisons on the result of 02592 these insns (since they're always with 0). However, conditions.h has 02593 CC_NO_OVERFLOW defined for this purpose. Rename it to something more 02594 understandable. */ 02595 #define CC_NO_CARRY CC_NO_OVERFLOW 02596 02597 02598 /* Output assembler code to FILE to increment profiler label # LABELNO 02599 for profiling a function entry. */ 02600 02601 #define FUNCTION_PROFILER(FILE, LABELNO) \ 02602 fprintf (FILE, "/* profiler %d */", (LABELNO)) 02603 02604 /* `FIRST_INSN_ADDRESS' 02605 When the `length' insn attribute is used, this macro specifies the 02606 value to be assigned to the address of the first insn in a 02607 function. If not specified, 0 is used. */ 02608 02609 #define ADJUST_INSN_LENGTH(INSN, LENGTH) (LENGTH =\ 02610 adjust_insn_length (INSN, LENGTH)) 02611 /* If defined, modifies the length assigned to instruction INSN as a 02612 function of the context in which it is used. LENGTH is an lvalue 02613 that contains the initially computed length of the insn and should 02614 be updated with the correct length of the insn. If updating is 02615 required, INSN must not be a varying-length insn. 02616 02617 This macro will normally not be required. A case in which it is 02618 required is the ROMP. On this machine, the size of an `addr_vec' 02619 insn must be increased by two to compensate for the fact that 02620 alignment may be required. */ 02621 02622 #define TARGET_MEM_FUNCTIONS 02623 /* Define this macro if GNU CC should generate calls to the System V 02624 (and ANSI C) library functions `memcpy' and `memset' rather than 02625 the BSD functions `bcopy' and `bzero'. */ 02626 02627 #define CPP_SPEC "\ 02628 %{!mmcu*|mmcu=avr2:%(cpp_avr2)} \ 02629 %{mmcu=at90s2313:%(cpp_avr2) -D__AVR_AT90S2313__} \ 02630 %{mmcu=at90s2323:%(cpp_avr2) -D__AVR_AT90S2323__} \ 02631 %{mmcu=at90s2333:%(cpp_avr2) -D__AVR_AT90S2333__} \ 02632 %{mmcu=at90s2343:%(cpp_avr2) -D__AVR_AT90S2343__} \ 02633 %{mmcu=attiny22: %(cpp_avr2) -D__AVR_ATtiny22__} \ 02634 %{mmcu=at90s4433:%(cpp_avr2) -D__AVR_AT90S4433__} \ 02635 %{mmcu=at90s4414:%(cpp_avr2) -D__AVR_AT90S4414__} \ 02636 %{mmcu=at90s4434:%(cpp_avr2) -D__AVR_AT90S4434__} \ 02637 %{mmcu=at90s8515:%(cpp_avr2) -D__AVR_AT90S8515__} \ 02638 %{mmcu=at90s8535:%(cpp_avr2) -D__AVR_AT90S8535__} \ 02639 %{mmcu=at90c8534:%(cpp_avr2) -D__AVR_AT90C8534__} \ 02640 %{mmcu=avr3:%(cpp_avr3)} \ 02641 %{mmcu=atmega603:%(cpp_avr3) -D__AVR_ATmega603__} \ 02642 %{mmcu=atmega103:%(cpp_avr3) -D__AVR_ATmega103__} \ 02643 %{mmcu=at43usb320:%(cpp_avr3) -D__AVR_AT43USB320__} \ 02644 %{mmcu=at76c711: %(cpp_avr3) -D__AVR_AT76C711__} \ 02645 %{mmcu=avr4:%(cpp_avr4)} \ 02646 %{mmcu=atmega8: %(cpp_avr4) -D__AVR_ATmega8__} \ 02647 %{mmcu=atmega83: %(cpp_avr4) -D__AVR_ATmega83__} \ 02648 %{mmcu=atmega85: %(cpp_avr4) -D__AVR_ATmega85__} \ 02649 %{mmcu=avr5:%(cpp_avr5)} \ 02650 %{mmcu=atmega16: %(cpp_avr5) -D__AVR_ATmega16__} \ 02651 %{mmcu=atmega161:%(cpp_avr5) -D__AVR_ATmega161__} \ 02652 %{mmcu=atmega163:%(cpp_avr5) -D__AVR_ATmega163__} \ 02653 %{mmcu=atmega32: %(cpp_avr5) -D__AVR_ATmega32__} \ 02654 %{mmcu=atmega323:%(cpp_avr5) -D__AVR_ATmega323__} \ 02655 %{mmcu=atmega64: %(cpp_avr5) -D__AVR_ATmega64__} \ 02656 %{mmcu=atmega128:%(cpp_avr5) -D__AVR_ATmega128__} \ 02657 %{mmcu=at43usb355:%(cpp_avr5) -D__AVR_AT43USB355__} \ 02658 %{mmcu=at94k: %(cpp_avr5) -D__AVR_AT94K__} \ 02659 %{mmcu=avr1:%(cpp_avr1)} \ 02660 %{mmcu=at90s1200:%(cpp_avr1) -D__AVR_AT90S1200__} \ 02661 %{mmcu=attiny10|mmcu=attiny11: %(cpp_avr1) -D__AVR_ATtiny11__} \ 02662 %{mmcu=attiny12: %(cpp_avr1) -D__AVR_ATtiny12__} \ 02663 %{mmcu=attiny15: %(cpp_avr1) -D__AVR_ATtiny15__} \ 02664 %{mmcu=attiny28: %(cpp_avr1) -D__AVR_ATtiny28__} \ 02665 %{mno-interrupts:-D__NO_INTERRUPTS__} \ 02666 %{mint8:-D__SIZE_TYPE__=long\\ unsigned\\ int -D__PTRDIFF_TYPE__=long -D__INT_MAX__=127} \ 02667 %{!mint*:-D__SIZE_TYPE__=unsigned\\ int -D__PTRDIFF_TYPE__=int -D__INT_MAX__=32767} \ 02668 %{posix:-D_POSIX_SOURCE}" 02669 /* A C string constant that tells the GNU CC driver program options to 02670 pass to CPP. It can also specify how to translate options you 02671 give to GNU CC into options for GNU CC to pass to the CPP. 02672 02673 Do not define this macro if it does not need to do anything. */ 02674 02675 #define NO_BUILTIN_SIZE_TYPE 02676 /* If this macro is defined, the preprocessor will not define the 02677 builtin macro `__SIZE_TYPE__'. The macro `__SIZE_TYPE__' must 02678 then be defined by `CPP_SPEC' instead. 02679 02680 This should be defined if `SIZE_TYPE' depends on target dependent 02681 flags which are not accessible to the preprocessor. Otherwise, it 02682 should not be defined. */ 02683 02684 #define NO_BUILTIN_PTRDIFF_TYPE 02685 /* If this macro is defined, the preprocessor will not define the 02686 builtin macro `__PTRDIFF_TYPE__'. The macro `__PTRDIFF_TYPE__' 02687 must then be defined by `CPP_SPEC' instead. 02688 02689 This should be defined if `PTRDIFF_TYPE' depends on target 02690 dependent flags which are not accessible to the preprocessor. 02691 Otherwise, it should not be defined. */ 02692 02693 #define CC1_SPEC "%{profile:-p}" 02694 /* A C string constant that tells the GNU CC driver program options to 02695 pass to `cc1'. It can also specify how to translate options you 02696 give to GNU CC into options for GNU CC to pass to the `cc1'. 02697 02698 Do not define this macro if it does not need to do anything. */ 02699 02700 #define ASM_SPEC "%{mmcu=*:-mmcu=%*}" 02701 /* A C string constant that tells the GNU CC driver program options to 02702 pass to the assembler. It can also specify how to translate 02703 options you give to GNU CC into options for GNU CC to pass to the 02704 assembler. See the file `sun3.h' for an example of this. 02705 02706 Do not define this macro if it does not need to do anything. */ 02707 02708 #define ASM_FINAL_SPEC "" 02709 /* A C string constant that tells the GNU CC driver program how to 02710 run any programs which cleanup after the normal assembler. 02711 Normally, this is not needed. See the file `mips.h' for an 02712 example of this. 02713 02714 Do not define this macro if it does not need to do anything. */ 02715 02716 #define LINK_SPEC "\ 02717 %{!mmcu*:-m avr85xx} \ 02718 %{mmcu=atmega603:-m avrmega603} \ 02719 %{mmcu=atmega103:-m avrmega103} \ 02720 %{mmcu=at43usb320:-m avr3} \ 02721 %{mmcu=at76c711:-m avr3} \ 02722 %{mmcu=atmega16:-m avrmega161} \ 02723 %{mmcu=atmega161:-m avrmega161} \ 02724 %{mmcu=atmega163:-m avrmega161} \ 02725 %{mmcu=atmega32:-m avr5} \ 02726 %{mmcu=atmega323:-m avr5} \ 02727 %{mmcu=atmega64:-m avr5} \ 02728 %{mmcu=atmega128:-m avr5} \ 02729 %{mmcu=at43usb355:-m avr5} \ 02730 %{mmcu=at94k:-m avr5} \ 02731 %{mmcu=atmega8:-m avr4} \ 02732 %{mmcu=atmega83:-m avr4} \ 02733 %{mmcu=atmega85:-m avr4} \ 02734 %{mmcu=at90s1200|mmcu=attiny1*:-m avr1200} \ 02735 %{mmcu=attiny28:-m avr1} \ 02736 %{mmcu=at90s2313:-m avr23xx} \ 02737 %{mmcu=at90s2323:-m avr23xx} \ 02738 %{mmcu=attiny22:-m avr23xx} \ 02739 %{mmcu=at90s2333:-m avr23xx} \ 02740 %{mmcu=at90s2343:-m avr23xx} \ 02741 %{mmcu=at90s4433:-m avr4433} \ 02742 %{mmcu=at90s4414:-m avr44x4} \ 02743 %{mmcu=at90s4434:-m avr44x4} \ 02744 %{mmcu=at90c8534:-m avr85xx} \ 02745 %{mmcu=at90s8535:-m avr85xx} \ 02746 %{mmcu=at90s8515:-m avr85xx}" 02747 02748 /* A C string constant that tells the GNU CC driver program options to 02749 pass to the linker. It can also specify how to translate options 02750 you give to GNU CC into options for GNU CC to pass to the linker. 02751 02752 Do not define this macro if it does not need to do anything. */ 02753 02754 #define LIB_SPEC \ 02755 "%{!mmcu=at90s1*:%{!mmcu=attiny1*:%{!mmcu=attiny28: -lc }}}" 02756 /* Another C string constant used much like `LINK_SPEC'. The 02757 difference between the two is that `LIB_SPEC' is used at the end 02758 of the command given to the linker. 02759 02760 If this macro is not defined, a default is provided that loads the 02761 standard C library from the usual place. See `gcc.c'. */ 02762 02763 #define LIBGCC_SPEC \ 02764 "%{!mmcu=at90s1*:%{!mmcu=attiny1*:%{!mmcu=attiny28: -lgcc }}}" 02765 /* Another C string constant that tells the GNU CC driver program how 02766 and when to place a reference to `libgcc.a' into the linker 02767 command line. This constant is placed both before and after the 02768 value of `LIB_SPEC'. 02769 02770 If this macro is not defined, the GNU CC driver provides a default 02771 that passes the string `-lgcc' to the linker unless the `-shared' 02772 option is specified. */ 02773 02774 #define STARTFILE_SPEC "%(crt_binutils)" 02775 /* Another C string constant used much like `LINK_SPEC'. The 02776 difference between the two is that `STARTFILE_SPEC' is used at the 02777 very beginning of the command given to the linker. 02778 02779 If this macro is not defined, a default is provided that loads the 02780 standard C startup file from the usual place. See `gcc.c'. */ 02781 02782 #define ENDFILE_SPEC "" 02783 /* Another C string constant used much like `LINK_SPEC'. The 02784 difference between the two is that `ENDFILE_SPEC' is used at the 02785 very end of the command given to the linker. 02786 02787 Do not define this macro if it does not need to do anything. */ 02788 02789 #define CRT_BINUTILS_SPECS "\ 02790 %{mmcu=at90s1200|mmcu=avr1:crts1200.o%s} \ 02791 %{mmcu=attiny10|mmcu=attiny11:crttn11.o%s} \ 02792 %{mmcu=attiny12:crttn12.o%s} \ 02793 %{mmcu=attiny15:crttn15.o%s} \ 02794 %{mmcu=attiny28:crttn28.o%s} \ 02795 %{!mmcu*|mmcu=at90s8515|mmcu=avr2:crts8515.o%s} \ 02796 %{mmcu=at90s2313:crts2313.o%s} \ 02797 %{mmcu=at90s2323:crts2323.o%s} \ 02798 %{mmcu=attiny22:crttn22.o%s} \ 02799 %{mmcu=at90s2333:crts2333.o%s} \ 02800 %{mmcu=at90s2343:crts2343.o%s} \ 02801 %{mmcu=at90s4433:crts4433.o%s} \ 02802 %{mmcu=at90s4414:crts4414.o%s} \ 02803 %{mmcu=at90s4434:crts4434.o%s} \ 02804 %{mmcu=at90c8534:crtc8534.o%s} \ 02805 %{mmcu=at90s8535:crts8535.o%s} \ 02806 %{mmcu=atmega103|mmcu=avr3:crtm103.o%s} \ 02807 %{mmcu=atmega603:crtm603.o%s} \ 02808 %{mmcu=at43usb320:crt43320.o%s} \ 02809 %{mmcu=at76c711:crt76711.o%s } \ 02810 %{mmcu=atmega8:crtm8.o%s} \ 02811 %{mmcu=atmega83|mmcu=avr4:crtm83.o%s} \ 02812 %{mmcu=atmega85:crtm85.o%s} \ 02813 %{mmcu=atmega16:crtm16.o%s} \ 02814 %{mmcu=atmega161|mmcu=avr5:crtm161.o%s} \ 02815 %{mmcu=atmega163:crtm163.o%s} \ 02816 %{mmcu=atmega32:crtm32.o%s} \ 02817 %{mmcu=atmega323:crtm323.o%s} \ 02818 %{mmcu=atmega64:crtm64.o%s} \ 02819 %{mmcu=atmega128:crtm128.o%s} \ 02820 %{mmcu=at43usb355:crt43355.o%s} \ 02821 %{mmcu=at94k:crtat94k.o%s}" 02822 02823 #define CPP_AVR1_SPEC "-D__AVR_ARCH__=1 -D__AVR_ASM_ONLY__ " 02824 #define CPP_AVR2_SPEC "-D__AVR_ARCH__=2 " 02825 #define CPP_AVR3_SPEC "-D__AVR_ARCH__=3 -D__AVR_MEGA__ " 02826 #define CPP_AVR4_SPEC "-D__AVR_ARCH__=4 -D__AVR_ENHANCED__ " 02827 #define CPP_AVR5_SPEC "-D__AVR_ARCH__=5 -D__AVR_ENHANCED__ -D__AVR_MEGA__ " 02828 02829 #define EXTRA_SPECS \ 02830 {"cpp_avr1", CPP_AVR1_SPEC}, \ 02831 {"cpp_avr2", CPP_AVR2_SPEC}, \ 02832 {"cpp_avr3", CPP_AVR3_SPEC}, \ 02833 {"cpp_avr4", CPP_AVR4_SPEC}, \ 02834 {"cpp_avr5", CPP_AVR5_SPEC}, \ 02835 {"crt_binutils", CRT_BINUTILS_SPECS}, 02836 /* Define this macro to provide additional specifications to put in 02837 the `specs' file that can be used in various specifications like 02838 `CC1_SPEC'. 02839 02840 The definition should be an initializer for an array of structures, 02841 containing a string constant, that defines the specification name, 02842 and a string constant that provides the specification. 02843 02844 Do not define this macro if it does not need to do anything. 02845 02846 `EXTRA_SPECS' is useful when an architecture contains several 02847 related targets, which have various `..._SPECS' which are similar 02848 to each other, and the maintainer would like one central place to 02849 keep these definitions. 02850 02851 For example, the PowerPC System V.4 targets use `EXTRA_SPECS' to 02852 define either `_CALL_SYSV' when the System V calling sequence is 02853 used or `_CALL_AIX' when the older AIX-based calling sequence is 02854 used. 02855 02856 The `config/rs6000/rs6000.h' target file defines: 02857 02858 #define EXTRA_SPECS \ 02859 { "cpp_sysv_default", CPP_SYSV_DEFAULT }, 02860 02861 #define CPP_SYS_DEFAULT "" 02862 02863 The `config/rs6000/sysv.h' target file defines: 02864 #undef CPP_SPEC 02865 #define CPP_SPEC \ 02866 "%{posix: -D_POSIX_SOURCE } \ 02867 %{mcall-sysv: -D_CALL_SYSV } %{mcall-aix: -D_CALL_AIX } \ 02868 %{!mcall-sysv: %{!mcall-aix: %(cpp_sysv_default) }} \ 02869 %{msoft-float: -D_SOFT_FLOAT} %{mcpu=403: -D_SOFT_FLOAT}" 02870 02871 #undef CPP_SYSV_DEFAULT 02872 #define CPP_SYSV_DEFAULT "-D_CALL_SYSV" 02873 02874 while the `config/rs6000/eabiaix.h' target file defines 02875 `CPP_SYSV_DEFAULT' as: 02876 02877 #undef CPP_SYSV_DEFAULT 02878 #define CPP_SYSV_DEFAULT "-D_CALL_AIX" */ 02879 02880 /* This is the default without any -mmcu=* option (AT90S*). */ 02881 #define MULTILIB_DEFAULTS { "mmcu=avr2" } 02882 02883 /* This is undefined macro for collect2 disabling */ 02884 #define LINKER_NAME "ld" 02885 02886 #define TEST_HARD_REG_CLASS(CLASS, REGNO) \ 02887 TEST_HARD_REG_BIT (reg_class_contents[ (int) (CLASS)], REGNO) 02888 02889 /* Note that the other files fail to use these 02890 in some of the places where they should. */ 02891 02892 #if defined(__STDC__) || defined(ALMOST_STDC) 02893 #define AS2(a,b,c) #a " " #b "," #c 02894 #define AS2C(b,c) " " #b "," #c 02895 #define AS3(a,b,c,d) #a " " #b "," #c "," #d 02896 #define AS1(a,b) #a " " #b 02897 #else 02898 #define AS1(a,b) "a b" 02899 #define AS2(a,b,c) "a b,c" 02900 #define AS2C(b,c) " b,c" 02901 #define AS3(a,b,c,d) "a b,c,d" 02902 #endif 02903 #define OUT_AS1(a,b) output_asm_insn (AS1(a,b), operands) 02904 #define OUT_AS2(a,b,c) output_asm_insn (AS2(a,b,c), operands) 02905 #define CR_TAB "\n\t" 02906 02907 /* Define this macro as a C statement that declares additional library 02908 routines renames existing ones. `init_optabs' calls this macro 02909 after initializing all the normal library routines. */ 02910 02911 #define INIT_TARGET_OPTABS \ 02912 { \ 02913 avr_init_once (); \ 02914 } 02915 02916 /* Temporary register r0 */ 02917 #define TMP_REGNO 0 02918 02919 /* zero register r1 */ 02920 #define ZERO_REGNO 1 02921 02922 /* Temporary register which used for load immediate values to r0-r15 */ 02923 #define LDI_REG_REGNO 31 02924 02925 extern struct rtx_def *tmp_reg_rtx; 02926 extern struct rtx_def *zero_reg_rtx; 02927 extern struct rtx_def *ldi_reg_rtx; 02928 02929 #define TARGET_FLOAT_FORMAT IEEE_FLOAT_FORMAT 02930 02931 /* Define to use software floating point emulator for REAL_ARITHMETIC and 02932 decimal <-> binary conversion. */ 02933 #define REAL_ARITHMETIC 02934 02935 #define PREFERRED_DEBUGGING_TYPE DBX_DEBUG 02936 02937 /* Get the standard ELF stabs definitions. */ 02938 #include "dbxelf.h"
1.5.6