00001 /* Definitions of target machine for GNU compiler. 00002 Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 00003 2000, 2001, 2002 Free Software Foundation, Inc. 00004 Contributed by O.M.Kellogg, DASA (oliver.kellogg@space.otn.dasa.de) 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 00024 /* Names to predefine in the preprocessor for this target machine. */ 00025 00026 /* See tm-sun3.h, tm-sun2.h, tm-isi68.h for different CPP_PREDEFINES. */ 00027 #define CPP_PREDEFINES "" 00028 00029 /* Print subsidiary information on the compiler version in use. */ 00030 #ifdef IEEE 00031 #define TARGET_VERSION fprintf (stderr, " (1750A, IEEE syntax)"); 00032 #else 00033 #define TARGET_VERSION fprintf (stderr, " (MIL-STD-1750A)"); 00034 #endif 00035 00036 /* Run-time compilation parameters selecting different hardware subsets. */ 00037 00038 #define TARGET_SWITCHES \ 00039 { {"vaxc-alignment", 2, N_("Use VAX-C alignment")}, \ 00040 { "", TARGET_DEFAULT, NULL}} 00041 00042 /* Default target_flags if no switches specified. */ 00043 00044 #ifndef TARGET_DEFAULT 00045 #define TARGET_DEFAULT 1 00046 #endif 00047 00048 /*****************************************************************************/ 00049 00050 /* SPECIAL ADDITION FOR MIL-STD-1750A by O.M.Kellogg, 15-Apr-1993 */ 00051 /* See file aux-output.c for the actual data instances. */ 00052 struct datalabel_array { 00053 char *name; 00054 char value[14]; 00055 int size; 00056 }; 00057 struct jumplabel_array { 00058 int pc; 00059 int num; 00060 }; 00061 enum section { Init, Normal, Konst, Static }; 00062 #define DATALBL_ARRSIZ 256 00063 #define JMPLBL_ARRSIZ 256 00064 #ifndef __datalbl 00065 extern struct datalabel_array datalbl[DATALBL_ARRSIZ]; 00066 extern struct jumplabel_array jmplbl[JMPLBL_ARRSIZ]; 00067 extern int datalbl_ndx, jmplbl_ndx, label_pending, program_counter; 00068 extern enum section current_section; 00069 extern const char *const sectname[4]; 00070 #endif 00071 /*--------------------------------------------------------------------*/ 00072 00073 /* target machine storage layout */ 00074 00075 /* Define this if most significant bit is lowest numbered 00076 in instructions that operate on numbered bit-fields. 00077 Though 1750 actually counts bits in big-endian fashion, the sign bit 00078 is still the most significant bit, which is leftmost. Therefore leaving 00079 this little-endian. Adjust short before assembler output when needed: 00080 e.g. in QImode, a GCC bit n is a 1750 bit (15-n). */ 00081 #define BITS_BIG_ENDIAN 0 00082 00083 /* Define this if most significant byte of a word is the lowest numbered. */ 00084 /* For 1750 we can decide arbitrarily 00085 since there are no machine instructions for them. */ 00086 #define BYTES_BIG_ENDIAN 0 00087 00088 /* Define this if most significant word of a multiword value is lowest 00089 numbered. 00090 True for 1750. */ 00091 #define WORDS_BIG_ENDIAN 1 00092 00093 /* number of bits in an addressable storage unit */ 00094 #define BITS_PER_UNIT 16 00095 00096 /* Width in bits of a "word", which is the contents of a machine register. 00097 Note that this is not necessarily the width of data type `int'; 00098 if using 16-bit ints on a 68000, this would still be 32. 00099 But on a machine with 16-bit registers, this would be 16. */ 00100 #define BITS_PER_WORD 16 00101 00102 /* Width of a word, in units (bytes). */ 00103 #define UNITS_PER_WORD 1 00104 00105 /* Width in bits of a pointer. 00106 See also the macro `Pmode' defined below. */ 00107 #define POINTER_SIZE 16 00108 00109 #define PTRDIFF_TYPE "int" 00110 00111 /* Type to use for `size_t'. If undefined, uses `long unsigned int'. */ 00112 #define SIZE_TYPE "int" 00113 00114 /* 1750a preliminary. Ought to properly define the format in real.c. */ 00115 #define TARGET_FLOAT_FORMAT UNKNOWN_FLOAT_FORMAT 00116 00117 /* Allocation boundary (in *bits*) for storing pointers in memory. */ 00118 #define POINTER_BOUNDARY 16 00119 00120 /* Allocation boundary (in *bits*) for storing arguments in argument list. */ 00121 /* 1750: should have had to make this 32 when BITS_PER_WORD is 32. */ 00122 #define PARM_BOUNDARY 16 00123 00124 /* Boundary (in *bits*) on which stack pointer should be aligned. */ 00125 #define STACK_BOUNDARY 16 00126 00127 /* Allocation boundary (in *bits*) for the code of a function. */ 00128 #define FUNCTION_BOUNDARY 16 00129 00130 /* Alignment of field after `int : 0' in a structure. */ 00131 #define EMPTY_FIELD_BOUNDARY 16 00132 00133 /* No data type wants to be aligned rounder than this. */ 00134 #define BIGGEST_ALIGNMENT 16 00135 00136 /* Define this to 1 if move instructions will actually fail to work 00137 when given unaligned data. */ 00138 #define STRICT_ALIGNMENT 0 00139 00140 /* Define number of bits in most basic integer type. 00141 (If undefined, default is BITS_PER_WORD). 00142 #define INT_TYPE_SIZE 16 */ 00143 00144 /* Define number of bits in short integer type. 00145 (If undefined, default is half of BITS_PER_WORD). */ 00146 #define SHORT_TYPE_SIZE 16 00147 00148 /* Define number of bits in long integer type. 00149 (If undefined, default is BITS_PER_WORD). */ 00150 #define LONG_TYPE_SIZE 32 00151 00152 /* Define number of bits in long long integer type. 00153 (If undefined, default is twice BITS_PER_WORD). */ 00154 /* 1750 PRELIMINARY : no processor support for `long long', therefore 00155 need to check out the long-long opencodings ! */ 00156 #define LONG_LONG_TYPE_SIZE 64 00157 00158 /* Define number of bits in char type. 00159 (If undefined, default is one fourth of BITS_PER_WORD). */ 00160 #define CHAR_TYPE_SIZE 16 00161 00162 /* Define number of bits in float type. 00163 (If undefined, default is BITS_PER_WORD). */ 00164 #define FLOAT_TYPE_SIZE 32 00165 00166 /* Define number of bits in double type. 00167 (If undefined, default is twice BITS_PER_WORD). */ 00168 #define DOUBLE_TYPE_SIZE 48 00169 00170 /*****************************************************************************/ 00171 00172 /* Standard register usage. */ 00173 00174 /* Number of actual hardware registers. 00175 The hardware registers are assigned numbers for the compiler 00176 from 0 to just below FIRST_PSEUDO_REGISTER. 00177 All registers that the compiler knows about must be given numbers, 00178 even those that are not normally considered general registers. */ 00179 #define FIRST_PSEUDO_REGISTER 16 00180 00181 /* 1 for registers that have pervasive standard uses 00182 and are not available for the register allocator. 00183 R15 is the 1750A stack pointer. R14 is the frame pointer. */ 00184 00185 #define FIXED_REGISTERS \ 00186 { 0, 0, 0, 0, 0, 0, 0, 0, \ 00187 0, 0, 0, 0, 0, 0, 1, 1 } 00188 00189 /* 1 for registers not available across function calls. 00190 These must include the FIXED_REGISTERS and also any 00191 registers that can be used without being saved. 00192 The latter must include the registers where values are returned 00193 and the register where structure-value addresses are passed. 00194 Aside from that, you can include as many other registers as you like. 00195 1750: return value in R0 foll. (depending on size of retval). 00196 Should be possible to refine this (how many regs are actually used) */ 00197 00198 #define CALL_USED_REGISTERS \ 00199 { 1, 1, 1, 1, 1, 1, 1, 1, \ 00200 1, 1, 1, 1, 1, 1, 1, 1 } 00201 00202 /* Order in which to allocate registers. Each register must be 00203 listed once, even those in FIXED_REGISTERS. List frame pointer 00204 late and fixed registers last. Note that, in general, we prefer 00205 registers listed in CALL_USED_REGISTERS, keeping the others 00206 available for storage of persistent values. */ 00207 00208 /* #define REG_ALLOC_ORDER \ 00209 { 2, 0, 1, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15 } 00210 */ 00211 00212 /* Return number of consecutive hard regs needed starting at reg REGNO 00213 to hold something of mode MODE. 00214 This is ordinarily the length in words of a value of mode MODE 00215 but can be less for certain modes in special long registers. 00216 All 1750 registers are one word long. */ 00217 #define HARD_REGNO_NREGS(REGNO, MODE) \ 00218 ((GET_MODE_SIZE (MODE) + UNITS_PER_WORD - 1) / UNITS_PER_WORD) 00219 00220 /* Value is 1 if hard register REGNO can hold a value of machine-mode MODE. */ 00221 #define HARD_REGNO_MODE_OK(REGNO, MODE) 1 00222 00223 /* Value is 1 if it is a good idea to tie two pseudo registers 00224 when one has mode MODE1 and one has mode MODE2. 00225 If HARD_REGNO_MODE_OK could produce different values for MODE1 and MODE2, 00226 for any hard reg, then this must be 0 for correct output. */ 00227 #define MODES_TIEABLE_P(MODE1, MODE2) 1 00228 00229 /* Specify the registers used for certain standard purposes. 00230 The values of these macros are register numbers. */ 00231 00232 /* 1750A pc isn't overloaded on a register. */ 00233 /* #define PC_REGNUM */ 00234 00235 /* Register to use for pushing function arguments. */ 00236 #define STACK_POINTER_REGNUM 15 00237 00238 /* Base register for access to local variables of the function. */ 00239 #define FRAME_POINTER_REGNUM 14 00240 00241 /* Value should be nonzero if functions must have frame pointers. 00242 Zero means the frame pointer need not be set up (and parms 00243 may be accessed via the stack pointer) in functions that seem suitable. 00244 This is computed in `reload', in reload1.c. */ 00245 #define FRAME_POINTER_REQUIRED 0 00246 00247 /* Base register for access to arguments of the function. */ 00248 #define ARG_POINTER_REGNUM 14 00249 00250 /* Define this if successive args to a function occupy decreasing addresses 00251 on the stack. 00252 #define ARGS_GROW_DOWNWARD 00253 */ 00254 00255 /* Register in which static-chain is passed to a function. */ 00256 #define STATIC_CHAIN_REGNUM 13 00257 00258 /* Place in which caller passes the structure value address. 00259 0 means push the value on the stack like an argument. 00260 #define STRUCT_VALUE 0 00261 */ 00262 00263 /* Register in which address to store a structure value 00264 arrives in the function. 00265 #define STRUCT_VALUE_INCOMING 0 00266 */ 00267 00268 /* Register in which address to store a structure value 00269 is passed to a function. */ 00270 #define STRUCT_VALUE_REGNUM 12 00271 00272 /* Define this to be 1 if all structure return values must be in memory. */ 00273 #define DEFAULT_PCC_STRUCT_RETURN 0 00274 00275 /*****************************************************************************/ 00276 00277 /* Define the classes of registers for register constraints in the 00278 machine description. Also define ranges of constants. 00279 00280 One of the classes must always be named ALL_REGS and include all hard regs. 00281 If there is more than one class, another class must be named NO_REGS 00282 and contain no registers. 00283 00284 The name GENERAL_REGS must be the name of a class (or an alias for 00285 another name such as ALL_REGS). This is the class of registers 00286 that is allowed by "g" or "r" in a register constraint. 00287 Also, registers outside this class are allocated only when 00288 instructions express preferences for them. 00289 00290 The classes must be numbered in nondecreasing order; that is, 00291 a larger-numbered class must never be contained completely 00292 in a smaller-numbered class. 00293 00294 For any two classes, it is very desirable that there be another 00295 class that represents their union. */ 00296 00297 /* 1750 note: The names (BASE_REGS/INDEX_REGS) are used in their *gcc sense* 00298 (i.e. *opposite* to the MIL-STD-1750A defined meanings). This means that 00299 R1..R15 are called "base" regs and R12..R15 are "index" regs. 00300 Index reg mode (in the gcc sense) is not yet implemented (these are the 00301 1750 "Base with Index Reg" instructions, LBX etc. See 1750.md) 00302 00303 Here's an example to drive this point home: in "LBX B12,R5" 00304 B12 shall be called the "index" reg and R5 shall be the "base" reg. 00305 This naming inversion is due to the GCC defined capabilities of 00306 "Base" vs. "Index" regs. */ 00307 00308 enum reg_class { NO_REGS, R2, R0_1, INDEX_REGS, BASE_REGS, ALL_REGS, LIM_REG_CLASSES }; 00309 00310 #define N_REG_CLASSES (int) LIM_REG_CLASSES 00311 00312 /* Since GENERAL_REGS is the same class as ALL_REGS, 00313 don't give it a different class number; just make it an alias. */ 00314 #define GENERAL_REGS ALL_REGS 00315 00316 /* Give names of register classes as strings for dump file. */ 00317 00318 #define REG_CLASS_NAMES \ 00319 { "NO_REGS", "R2", "R0_1", "INDEX_REGS", "BASE_REGS", "ALL_REGS" } 00320 00321 /* Define which registers fit in which classes. 00322 This is an initializer for a vector of HARD_REG_SET 00323 of length N_REG_CLASSES. 00324 1750 "index" (remember, in the *GCC* sense!) regs are R12 through R15. 00325 The only 1750 register not usable as BASE_REG is R0. */ 00326 00327 #define REG_CLASS_CONTENTS { {0}, {0x0004}, {0x0003}, {0xf000}, {0xfffe}, {0xffff} } 00328 00329 /* The same information, inverted: 00330 Return the class number of the smallest class containing 00331 reg number REGNO. This could be a conditional expression 00332 or could index an array. */ 00333 #define REGNO_REG_CLASS(REGNO) ((REGNO) == 2 ? R2 : (REGNO) == 0 ? R0_1 : \ 00334 (REGNO) >= 12 ? INDEX_REGS : (REGNO) > 0 ? BASE_REGS : ALL_REGS) 00335 00336 /* The class value for index registers, and the one for base regs. */ 00337 00338 #define BASE_REG_CLASS BASE_REGS 00339 #define INDEX_REG_CLASS INDEX_REGS 00340 00341 /* Get reg_class from a letter such as appears in the machine description. 00342 For the 1750, we have 'z' for R0_1, 't' for R2, 'b' for gcc Base regs 00343 and 'x' for gcc Index regs. */ 00344 00345 #define REG_CLASS_FROM_LETTER(C) ((C) == 't' ? R2 : \ 00346 (C) == 'z' ? R0_1 : \ 00347 (C) == 'b' ? BASE_REGS : \ 00348 (C) == 'x' ? INDEX_REGS : NO_REGS) 00349 00350 /* The letters I,J,K,.. to P in a register constraint string 00351 can be used to stand for particular ranges of immediate operands. 00352 This macro defines what the ranges are. 00353 C is the letter, and VALUE is a constant value. 00354 Return 1 if VALUE is in the range specified by C. 00355 00356 For the 1750A, 00357 `I' is used for ISP mode instructions, 00358 `J' is used for ISN mode instructions, 00359 `K' is used for the STC instruction's constant range, 00360 `L' is used for unsigned 8-bit address displacements in instructions 00361 of addressing mode "Base Relative", 00362 `M' is for IM mode instructions et al., 00363 `O' is a synonym for (const_int 0). */ 00364 00365 #define CONST_OK_FOR_LETTER_P(VALUE, C) \ 00366 ((C) == 'I' ? (VALUE) > 0 && (VALUE) <= 16 : \ 00367 (C) == 'J' ? (VALUE) < 0 && (VALUE) >= -16 : \ 00368 (C) == 'K' ? (VALUE) >= 0 && (VALUE) <= 15 : \ 00369 (C) == 'L' ? (VALUE) >= 0 && (VALUE) <= 0xFF : \ 00370 (C) == 'M' ? (VALUE) >= -0x8000 && (VALUE) <= 0x7FFF : \ 00371 (C) == 'O' ? (VALUE) == 0 : 0) 00372 00373 /* Similar, but for floating constants, and defining letter 'G'. 00374 Here VALUE is the CONST_DOUBLE rtx itself. */ 00375 #define CONST_DOUBLE_OK_FOR_LETTER_P(VALUE, C) \ 00376 ((C) == 'G' ? ((VALUE) == CONST0_RTX (HFmode) \ 00377 || (VALUE) == CONST0_RTX (TQFmode)) : 0) 00378 00379 /* Optional extra constraints for this machine. 00380 00381 For the 1750, `Q' means that this is a memory operand consisting 00382 of the sum of an Index Register (in the GCC sense, i.e. R12..R15) 00383 and a constant in the range 0..255. This constraint is used for 00384 the Base Register with Offset address mode instructions (LB,STB,AB,..) */ 00385 00386 #define EXTRA_CONSTRAINT(OP, C) \ 00387 ((C) == 'Q' && b_mode_operand (OP)) 00388 00389 /* Given an rtx X being reloaded into a reg required to be 00390 in class CLASS, return the class of reg to actually use. 00391 In general this is just CLASS; but on some machines 00392 in some cases it is preferable to use a more restrictive class. */ 00393 00394 #define PREFERRED_RELOAD_CLASS(X,CLASS) CLASS 00395 00396 /* Return the maximum number of consecutive registers 00397 needed to represent mode MODE in a register of class CLASS. 00398 On the 1750A, this is the size of MODE in words, 00399 since class doesn't make any difference. */ 00400 #define CLASS_MAX_NREGS(CLASS,MODE) GET_MODE_SIZE(MODE) 00401 00402 /*****************************************************************************/ 00403 00404 /* Stack layout; function entry, exit and calling. */ 00405 00406 /* Define this if pushing a word on the stack 00407 makes the stack pointer a smaller address. */ 00408 #define STACK_GROWS_DOWNWARD 1 00409 00410 /* Define this if the nominal address of the stack frame 00411 is at the high-address end of the local variables; 00412 goes at a more negative offset in the frame. 00413 #define FRAME_GROWS_DOWNWARD 00414 */ 00415 00416 /* Offset within stack frame to start allocating local variables at. 00417 If FRAME_GROWS_DOWNWARD, this is the offset to the END of the 00418 first local allocated. Otherwise, it is the offset to the BEGINNING 00419 of the first local allocated. 00420 */ 00421 #define STARTING_FRAME_OFFSET 1 00422 00423 /* This is the default anyway: 00424 #define DYNAMIC_CHAIN_ADDRESS(FRAMEADDR) FRAMEADDR 00425 */ 00426 00427 /* If we generate an insn to push BYTES bytes, 00428 this says how many the stack pointer really advances by. 00429 1750 note: what GCC calls a "byte" is really a 16-bit word, 00430 because BITS_PER_UNIT is 16. */ 00431 00432 #define PUSH_ROUNDING(BYTES) (BYTES) 00433 00434 /* Define this macro if functions should assume that stack space has 00435 been allocated for arguments even when their values are passed in 00436 registers. 00437 Size, in bytes, of the area reserved for arguments passed in 00438 registers for the function represented by FNDECL. 00439 #define REG_PARM_STACK_SPACE(FNDECL) 14 */ 00440 00441 /* Define this if it is the responsibility of the caller to allocate 00442 the area reserved for arguments passed in registers. 00443 #define OUTGOING_REG_PARM_STACK_SPACE */ 00444 00445 /* Offset of first parameter from the argument pointer register value. 00446 1750 note: 00447 Parameters appear in reversed order on the frame (so when they are 00448 popped, they come off in the normal left-to-right order.) 00449 Computed as follows: 00450 one word for the caller's (PC+1) (i.e. the return address) 00451 plus total size of called function's "auto" variables 00452 plus one word for the caller's frame pointer (i.e. the old FP) */ 00453 00454 #define FIRST_PARM_OFFSET(FNDECL) \ 00455 (1 + get_frame_size() + 1) 00456 00457 /* Value is 1 if returning from a function call automatically 00458 pops the arguments described by the number-of-args field in the call. 00459 FUNDECL is the declaration node of the function (as a tree), 00460 FUNTYPE is the data type of the function (as a tree), 00461 or for a library call it is an identifier node for the subroutine name. 00462 */ 00463 00464 #define RETURN_POPS_ARGS(FUNDECL,FUNTYPE,SIZE) 0 00465 00466 /* Define how to find the value returned by a function. 00467 VALTYPE is the data type of the value (as a tree). 00468 If the precise function being called is known, FUNC is its FUNCTION_DECL; 00469 otherwise, FUNC is 0. */ 00470 00471 #define FUNCTION_VALUE(VALTYPE, FUNC) \ 00472 gen_rtx_REG (TYPE_MODE (VALTYPE), 0) 00473 00474 /* Define how to find the value returned by a library function 00475 assuming the value has mode MODE. */ 00476 /* 1750 note: no libcalls yet */ 00477 00478 #define LIBCALL_VALUE(MODE) printf("LIBCALL_VALUE called!\n"), \ 00479 gen_rtx_REG (MODE, 0) 00480 00481 /* 1 if N is a possible register number for a function value. */ 00482 00483 #define FUNCTION_VALUE_REGNO_P(N) ((N) == 0) 00484 00485 /* 1 if the tree TYPE should be returned in memory instead of in regs. 00486 #define RETURN_IN_MEMORY(TYPE) \ 00487 (int_size_in_bytes(TYPE) > 12) 00488 */ 00489 00490 /* Define this if PCC uses the nonreentrant convention for returning 00491 structure and union values. 00492 #define PCC_STATIC_STRUCT_RETURN */ 00493 00494 /* 1 if N is a possible register number for function argument passing. */ 00495 00496 #define FUNCTION_ARG_REGNO_P(N) ((N) < 12) 00497 00498 /*****************************************************************************/ 00499 00500 /* Define a data type for recording info about an argument list 00501 during the scan of that argument list. This data type should 00502 hold all necessary information about the function itself 00503 and about the args processed so far, enough to enable macros 00504 such as FUNCTION_ARG to determine where the next arg should go. 00505 00506 For 1750A, this is a single integer, which is a number of words 00507 of arguments scanned so far. */ 00508 00509 #define CUMULATIVE_ARGS int 00510 00511 /* Initialize a variable CUM of type CUMULATIVE_ARGS 00512 for a call to a function whose data type is FNTYPE. 00513 For a library call, FNTYPE is 0. 00514 00515 For 1750A, the offset starts at 0. */ 00516 00517 #define INIT_CUMULATIVE_ARGS(CUM,FNTYPE,LIBNAME,INDIRECT) ((CUM) = 0) 00518 00519 /* Update the data in CUM to advance over an argument 00520 of mode MODE and data type TYPE. 00521 (TYPE is null for libcalls where that information may not be available.) 00522 00523 1750 note: "int_size_in_bytes()" returns a unit relative to 00524 BITS_PER_UNIT, so in our case not bytes, but 16-bit words. */ 00525 00526 #define FUNCTION_ARG_ADVANCE(CUM, MODE, TYPE, NAMED) \ 00527 ((CUM) += (MODE) == BLKmode ? int_size_in_bytes(TYPE) : GET_MODE_SIZE(MODE)) 00528 00529 /* Define where to put the arguments to a function. 00530 Value is zero to push the argument on the stack, 00531 or a hard register in which to store the argument. 00532 00533 MODE is the argument's machine mode. 00534 TYPE is the data type of the argument (as a tree). 00535 This is null for libcalls where that information may 00536 not be available. 00537 CUM is a variable of type CUMULATIVE_ARGS which gives info about 00538 the preceding args and about the function being called. 00539 NAMED is nonzero if this argument is a named parameter 00540 (otherwise it is an extra parameter matching an ellipsis). */ 00541 00542 #define FUNCTION_ARG(CUM, MODE, TYPE, NAMED) function_arg (CUM,MODE,TYPE,NAMED) 00543 00544 /* Define the following macro if function calls on the target machine 00545 do not preserve any registers; in other words, if `CALL_USED_REGISTERS' 00546 has 1 for all registers. This macro enables `-fcaller-saves' by 00547 default. Eventually that option will be enabled by default on all 00548 machines and both the option and this macro will be eliminated. */ 00549 00550 #define DEFAULT_CALLER_SAVES 00551 00552 /************* 1750: PROFILER HANDLING NOT YET DONE !!!!!!! *************/ 00553 /* Output assembler code to FILE to increment profiler label # LABELNO 00554 for profiling a function entry. */ 00555 00556 #define FUNCTION_PROFILER(FILE, LABELNO) \ 00557 fprintf (FILE, "; got into FUNCTION_PROFILER with label # %d\n", (LABELNO)) 00558 00559 /* EXIT_IGNORE_STACK should be nonzero if, when returning from a function, 00560 the stack pointer does not matter. The value is tested only in 00561 functions that have frame pointers. 00562 No definition is equivalent to always zero. */ 00563 00564 #define EXIT_IGNORE_STACK 0 00565 00566 /* If the memory address ADDR is relative to the frame pointer, 00567 correct it to be relative to the stack pointer instead. 00568 This is for when we don't use a frame pointer. 00569 ADDR should be a variable name. 00570 00571 #define FIX_FRAME_POINTER_ADDRESS(ADDR,DEPTH) 00572 */ 00573 00574 /* Store in the variable DEPTH the initial difference between the 00575 frame pointer reg contents and the stack pointer reg contents, 00576 as of the start of the function body. This depends on the layout 00577 of the fixed parts of the stack frame and on how registers are saved. 00578 #define INITIAL_FRAME_POINTER_OFFSET(DEPTH) DEPTH = 0 00579 */ 00580 00581 #define ELIMINABLE_REGS { \ 00582 { ARG_POINTER_REGNUM, STACK_POINTER_REGNUM }, \ 00583 { ARG_POINTER_REGNUM, FRAME_POINTER_REGNUM }, \ 00584 { FRAME_POINTER_REGNUM, STACK_POINTER_REGNUM } } 00585 00586 #define CAN_ELIMINATE(FROM, TO) 1 00587 00588 #define INITIAL_ELIMINATION_OFFSET(FROM, TO, OFFSET) \ 00589 OFFSET = (TO == STACK_POINTER_REGNUM) ? -1 : 0 00590 00591 00592 /* Output assembler code for a block containing the constant parts 00593 of a trampoline, leaving space for the variable parts. */ 00594 00595 #define TRAMPOLINE_TEMPLATE(FILE) fprintf(FILE,"TRAMPOLINE_TEMPLATE called\n") 00596 00597 /* Length in units of the trampoline for entering a nested function. */ 00598 00599 #define TRAMPOLINE_SIZE 2 00600 00601 /* Emit RTL insns to initialize the variable parts of a trampoline. 00602 FNADDR is an RTX for the address of the function's pure code. 00603 CXT is an RTX for the static chain value for the function. */ 00604 00605 #define INITIALIZE_TRAMPOLINE(TRAMP, FNADDR, CXT) printf("INITIALIZE_TRAMPO called\n") 00606 /* { \ 00607 emit_move_insn (gen_rtx_MEM (QImode, plus_constant (TRAMP, 1)), CXT); \ 00608 emit_move_insn (gen_rtx_MEM (QImode, plus_constant (TRAMP, 6)), FNADDR); \ 00609 } */ 00610 00611 00612 /*****************************************************************************/ 00613 00614 /* Addressing modes, and classification of registers for them. */ 00615 00616 /* 1750 doesn't have a lot of auto-incr./decr. - just for the stack ptr. */ 00617 00618 /* #define HAVE_POST_INCREMENT 0 just for R15 (stack pointer) */ 00619 /* #define HAVE_POST_DECREMENT 0 */ 00620 /* #define HAVE_PRE_DECREMENT 0 just for R15 (stack pointer) */ 00621 /* #define HAVE_PRE_INCREMENT 0 */ 00622 00623 /* Macros to check register numbers against specific register classes. */ 00624 00625 /* These assume that REGNO is a hard or pseudo reg number. 00626 They give nonzero only if REGNO is a hard reg of the suitable class 00627 or a pseudo reg currently allocated to a suitable hard reg. 00628 Since they use reg_renumber, they are safe only once reg_renumber 00629 has been allocated, which happens in local-alloc.c. 00630 1750 note: The words BASE and INDEX are used in their GCC senses: 00631 The "Index Registers", R12 through R15, are used in the 1750 00632 instructions LB,STB,AB,SBB,MB,DB,LBX,STBX,... 00633 */ 00634 00635 #define REGNO_OK_FOR_BASE_P(REGNO) \ 00636 (((REGNO) > 0 && (REGNO) <= 15) || \ 00637 (reg_renumber[REGNO] > 0 && reg_renumber[REGNO] <= 15)) 00638 #define REGNO_OK_FOR_INDEX_P(REGNO) \ 00639 (((REGNO) >= 12 && (REGNO) <= 15) || \ 00640 (reg_renumber[REGNO] >= 12 && reg_renumber[REGNO] <= 15)) 00641 00642 /* Now macros that check whether X is a register and also, 00643 strictly, whether it is in a specified class. */ 00644 00645 /* 1 if X is an address register */ 00646 00647 #define ADDRESS_REG_P(X) (REG_P (X) && REGNO_OK_FOR_BASE_P (REGNO (X))) 00648 00649 /* Maximum number of registers that can appear in a valid memory address. */ 00650 #define MAX_REGS_PER_ADDRESS 1 00651 00652 /* Recognize any constant value that is a valid address. */ 00653 00654 #define CONSTANT_ADDRESS_P(X) CONSTANT_P(X) 00655 00656 /* Nonzero if the constant value X is a legitimate general operand. 00657 It is given that X satisfies CONSTANT_P or is a CONST_DOUBLE. */ 00658 00659 #define LEGITIMATE_CONSTANT_P(X) 1 00660 00661 /* The macros REG_OK_FOR..._P assume that the arg is a REG rtx 00662 and check its validity for a certain class. 00663 We have two alternate definitions for each of them. 00664 The usual definition accepts all pseudo regs; the other rejects 00665 them unless they have been allocated suitable hard regs. 00666 The symbol REG_OK_STRICT causes the latter definition to be used. 00667 00668 Most source files want to accept pseudo regs in the hope that 00669 they will get allocated to the class that the insn wants them to be in. 00670 Source files for reload pass need to be strict. 00671 After reload, it makes no difference, since pseudo regs have 00672 been eliminated by then. */ 00673 00674 #ifdef REG_OK_STRICT 00675 00676 /* Nonzero if X is a hard reg that can be used as an index. */ 00677 #define REG_OK_FOR_INDEX_P(X) REGNO_OK_FOR_INDEX_P(REGNO(X)) 00678 /* Nonzero if X is a hard reg that can be used as a base reg. */ 00679 #define REG_OK_FOR_BASE_P(X) REGNO_OK_FOR_BASE_P(REGNO(X)) 00680 00681 #else 00682 00683 /* Nonzero if X is a hard reg that can be used as an index 00684 or if it is a pseudo reg. */ 00685 #define REG_OK_FOR_INDEX_P(X) (REGNO (X) >= 12) 00686 /* Nonzero if X is a hard reg that can be used as a base reg 00687 or if it is a pseudo reg. */ 00688 #define REG_OK_FOR_BASE_P(X) (REGNO (X) > 0) 00689 00690 #endif 00691 00692 00693 /* GO_IF_LEGITIMATE_ADDRESS recognizes an RTL expression 00694 that is a valid memory address for an instruction. 00695 The MODE argument is the machine mode for the MEM expression 00696 that wants to use this address. 00697 The other macros defined here are used only in GO_IF_LEGITIMATE_ADDRESS. 00698 00699 1750 note: Currently we don't implement address expressions that use 00700 GCC "Index"-class regs. To be expanded to handle the 1750 "Base with Index" 00701 instructions (see also MAX_REGS_PER_ADDRESS and others). */ 00702 00703 #define GO_IF_BASED_ADDRESS(X, ADDR) { \ 00704 if ((GET_CODE (X) == REG && REG_OK_FOR_BASE_P(X))) \ 00705 goto ADDR; \ 00706 if (GET_CODE (X) == PLUS) \ 00707 { register rtx x0 = XEXP(X,0), x1 = XEXP(X,1); \ 00708 if ((REG_P(x0) && REG_OK_FOR_BASE_P(x0) && CONSTANT_ADDRESS_P(x1)) \ 00709 || (REG_P(x1) && REG_OK_FOR_BASE_P(x1) && CONSTANT_ADDRESS_P(x0))) \ 00710 goto ADDR; } } 00711 00712 #define GO_IF_LEGITIMATE_ADDRESS(MODE, X, ADDR) { \ 00713 if (CONSTANT_ADDRESS_P(X)) goto ADDR; \ 00714 GO_IF_BASED_ADDRESS(X,ADDR) } 00715 00716 00717 /* Try machine-dependent ways of modifying an illegitimate address 00718 to be legitimate. If we find one, return the new, valid address. 00719 This macro is used in only one place: `memory_address' in explow.c. 00720 00721 OLDX is the address as it was before break_out_memory_refs was called. 00722 In some cases it is useful to look at this to decide what needs to be done. 00723 00724 MODE and WIN are passed so that this macro can use 00725 GO_IF_LEGITIMATE_ADDRESS. 00726 00727 It is always safe for this macro to do nothing. It exists to recognize 00728 opportunities to optimize the output. */ 00729 00730 #define LEGITIMIZE_ADDRESS(X,OLDX,MODE,WIN) 00731 00732 /* Go to LABEL if ADDR (a legitimate address expression) 00733 has an effect that depends on the machine mode it is used for. 00734 On the 68000, only predecrement and postincrement address depend thus 00735 (the amount of decrement or increment being the length of the operand). */ 00736 /* 1750: not used. */ 00737 00738 #define GO_IF_MODE_DEPENDENT_ADDRESS(ADDR,LABEL) 00739 00740 /*****************************************************************************/ 00741 00742 /* Specify the machine mode that this machine uses 00743 for the index in the tablejump instruction. */ 00744 #define CASE_VECTOR_MODE QImode 00745 00746 /* Define as C expression which evaluates to nonzero if the tablejump 00747 instruction expects the table to contain offsets from the address of the 00748 table. 00749 Do not define this if the table should contain absolute addresses. */ 00750 /* #define CASE_VECTOR_PC_RELATIVE 1 */ 00751 00752 /* Define this as 1 if `char' should by default be signed; else as 0. */ 00753 #define DEFAULT_SIGNED_CHAR 1 00754 00755 /* Max number of bytes we can move from memory to memory 00756 in one reasonably fast instruction. */ 00757 #define MOVE_MAX 65536 00758 00759 /* If a memory-to-memory move would take MOVE_RATIO or more simple 00760 move-instruction pairs, we will do a movstr or libcall instead. */ 00761 #define MOVE_RATIO 4 00762 00763 /* Nonzero if access to memory by bytes is slow and undesirable. */ 00764 #define SLOW_BYTE_ACCESS 0 00765 00766 /* Define if shifts truncate the shift count 00767 which implies one can omit a sign-extension or zero-extension 00768 of a shift count. */ 00769 /* #define SHIFT_COUNT_TRUNCATED 1 */ 00770 00771 /* Value is 1 if truncating an integer of INPREC bits to OUTPREC bits 00772 is done just by pretending it is already truncated. */ 00773 #define TRULY_NOOP_TRUNCATION(OUTPREC, INPREC) 1 00774 00775 /* We assume that the store-condition-codes instructions store 0 for false 00776 and some other value for true. This is the value stored for true. */ 00777 00778 #define STORE_FLAG_VALUE 1 00779 00780 /* When a prototype says `char' or `short', really pass an `int'. 00781 1750: for now, `char' is 16 bits wide anyway. */ 00782 #define PROMOTE_PROTOTYPES 0 00783 00784 /* Specify the machine mode that pointers have. 00785 After generation of rtl, the compiler makes no further distinction 00786 between pointers and any other objects of this machine mode. */ 00787 #define Pmode QImode 00788 00789 /* A function address in a call instruction 00790 is a 16-bit address (for indexing purposes) */ 00791 #define FUNCTION_MODE QImode 00792 00793 /* Compute the cost of computing a constant rtl expression RTX 00794 whose rtx-code is CODE. The body of this macro is a portion 00795 of a switch statement. If the code is computed here, 00796 return it with a return statement. Otherwise, break from the switch. */ 00797 00798 #define CONST_COSTS(RTX,CODE,OUTER_CODE) \ 00799 case CONST_INT: \ 00800 return (INTVAL(RTX) >= -16 && INTVAL(RTX) <= 16) ? 1 : 3; \ 00801 case CONST: \ 00802 case LABEL_REF: \ 00803 case SYMBOL_REF: \ 00804 return 3; \ 00805 case CONST_DOUBLE: \ 00806 return 4; 00807 00808 #define ADDRESS_COST(ADDRESS) (memop_valid (ADDRESS) ? 3 : 10) 00809 00810 #define REGISTER_MOVE_COST(MODE,FROM,TO) 2 00811 00812 #define MEMORY_MOVE_COST(M,C,I) 4 00813 00814 /* Tell final.c how to eliminate redundant test instructions. */ 00815 00816 /* Here we define machine-dependent flags and fields in cc_status 00817 (see `conditions.h'). */ 00818 /* MIL-STD-1750: none -- just has the garden variety C,P,Z,N flags. */ 00819 00820 /* Store in cc_status the expressions 00821 that the condition codes will describe 00822 after execution of an instruction whose pattern is EXP. 00823 Do not alter them if the instruction would not alter the cc's. 00824 1750: See file out-1750a.c for notice_update_cc(). */ 00825 00826 #define NOTICE_UPDATE_CC(EXP, INSN) notice_update_cc(EXP) 00827 00828 /**********************************************/ 00829 /* Produce debugging info in the DWARF format 00830 #define DWARF_DEBUGGING_INFO 00831 */ 00832 00833 /*****************************************************************************/ 00834 00835 /* Control the assembler format that we output. */ 00836 00837 /* Output at beginning of assembler file. */ 00838 00839 #define ASM_FILE_START(FILE) { \ 00840 char *p2, name[40]; \ 00841 const char *p; \ 00842 if ((p = strrchr(main_input_filename,'/')) != NULL ? 1 : \ 00843 (p = strrchr(main_input_filename,']')) != NULL) \ 00844 p++; \ 00845 else \ 00846 p = main_input_filename; \ 00847 strcpy(name,p); \ 00848 if ((p2 = strchr(name,'.'))) \ 00849 *p2 = '\0'; \ 00850 fprintf(FILE,"\tname %s\n",name); \ 00851 fprintf(FILE,"\tnolist\n\tinclude \"ms1750.inc\"\n\tlist\n\n"); \ 00852 fprintf(FILE,"\tglobal\t__main\n\n"); } 00853 00854 /* Output at end of assembler file. 00855 For 1750, we copy the data labels accrued in datalbl[] from the Constants 00856 section (Konst) to the Writable-Data section (Static). */ 00857 00858 #define ASM_FILE_END(FILE) \ 00859 do { \ 00860 if (datalbl_ndx >= 0) { \ 00861 int i, cum_size=0; \ 00862 fprintf(FILE,"\n\tstatic\ninit_srel\n"); \ 00863 for (i = 0; i <= datalbl_ndx; i++) { \ 00864 if (datalbl[i].name == NULL) \ 00865 { \ 00866 fprintf(stderr, "asm_file_end internal datalbl err\n"); \ 00867 exit (0); \ 00868 } \ 00869 fprintf(FILE,"%s \tblock %d\n", \ 00870 datalbl[i].name,datalbl[i].size); \ 00871 cum_size += datalbl[i].size; \ 00872 } \ 00873 fprintf(FILE,"\n\tinit\n"); \ 00874 fprintf(FILE,"\tlim\tr0,init_srel\n"); /* destin. */ \ 00875 fprintf(FILE,"\tlim\tr1,%d\n",cum_size); /* count */ \ 00876 fprintf(FILE,"\tlim\tr2,K%s\n",datalbl[0].name); /* source */ \ 00877 fprintf(FILE,"\tmov\tr0,r2\n"); \ 00878 fprintf(FILE,"\n\tnormal\n"); \ 00879 datalbl_ndx = -1; /* reset stuff */ \ 00880 for (i = 0; i < DATALBL_ARRSIZ; i++) \ 00881 datalbl[i].size = 0; \ 00882 } \ 00883 fprintf(FILE,"\n\tend\n"); \ 00884 } while (0) 00885 00886 /* Output to assembler file text saying following lines 00887 may contain character constants, extra white space, comments, etc. */ 00888 00889 #define ASM_APP_ON "; ASM_APP_ON\n" 00890 00891 /* Output to assembler file text saying following lines 00892 no longer contain unusual constructs. */ 00893 00894 #define ASM_APP_OFF "; ASM_APP_OFF\n" 00895 00896 00897 #define EXTRA_SECTIONS in_readonly_data 00898 00899 #define EXTRA_SECTION_FUNCTIONS \ 00900 extern void const_section PARAMS ((void)); \ 00901 void const_section() \ 00902 { \ 00903 fprintf(asm_out_file,"\tkonst\n"); \ 00904 current_section = Konst; \ 00905 } \ 00906 void check_section(sect) \ 00907 enum section sect; \ 00908 { \ 00909 if (current_section != sect) { \ 00910 fprintf(asm_out_file,"\t%s\n",sectname[(int)sect]); \ 00911 current_section = sect; \ 00912 } \ 00913 switch (sect) { \ 00914 case Init: \ 00915 case Normal: \ 00916 in_section = in_text; \ 00917 break; \ 00918 case Static: \ 00919 in_section = in_data; \ 00920 break; \ 00921 case Konst: \ 00922 in_section = in_readonly_data; \ 00923 break; \ 00924 } \ 00925 } 00926 00927 00928 /* Function that switches to the read-only data section (optional) */ 00929 #define READONLY_DATA_SECTION const_section 00930 00931 /* Output before program init section */ 00932 #define INIT_SECTION_ASM_OP "\n\tinit ; init_section\n" 00933 00934 /* Output before program text section */ 00935 #define TEXT_SECTION_ASM_OP "\n\tnormal ; text_section\n" 00936 00937 /* Output before writable data. 00938 1750 Note: This is actually read-only data. The copying from read-only 00939 to writable memory is done elsewhere (in ASM_FILE_END.) 00940 */ 00941 #define DATA_SECTION_ASM_OP "\n\tkonst ; data_section\n" 00942 00943 /* How to refer to registers in assembler output. 00944 This sequence is indexed by compiler's hard-register-number (see above). */ 00945 00946 #define REGISTER_NAMES \ 00947 { "0", "1", "2", "3", "4", "5", "6", "7", \ 00948 "8", "9","10","11","12","13","14","15" } 00949 00950 /****************** Assembler output formatting **********************/ 00951 00952 #define ASM_COMMENT_START ";" 00953 00954 #define ASM_OUTPUT_OPCODE(FILE,PTR) do { \ 00955 while (*(PTR) != '\0' && *(PTR) != ' ') { \ 00956 putc (*(PTR), FILE); \ 00957 (PTR)++; \ 00958 } \ 00959 while (*(PTR) == ' ') \ 00960 (PTR)++; \ 00961 putc ('\t', FILE); \ 00962 program_counter += 2; \ 00963 } while (0) 00964 00965 #define ASM_DECLARE_FUNCTION_NAME(FILE,NAME,DECL) \ 00966 fprintf(FILE,"%s\n",NAME) 00967 00968 /* This is how to output the definition of a user-level label named NAME, 00969 such as the label on a static function or variable NAME. */ 00970 /* 1750 note: Labels are prefixed with a 'K'. This is because handling 00971 has been changed for labels to be output in the "Constants" section 00972 (named "Konst"), and special initialization code takes care of copying 00973 the Const-section data into the writable data section (named "Static"). 00974 In the Static section we therefore have the true label names (i.e. 00975 not prefixed with 'K'). */ 00976 00977 #define ASM_OUTPUT_LABEL(FILE,NAME) \ 00978 do { if (NAME[0] == '.') { \ 00979 fprintf(stderr,"Oops! label %s can't begin with '.'\n",NAME); \ 00980 abort(); \ 00981 } \ 00982 else { \ 00983 check_section(Konst); \ 00984 fprintf(FILE,"K%s\n",NAME); \ 00985 fflush(FILE); \ 00986 datalbl[++datalbl_ndx].name = (char *)xstrdup (NAME);\ 00987 datalbl[datalbl_ndx].size = 0; \ 00988 label_pending = 1; \ 00989 } \ 00990 } while (0) 00991 00992 00993 /* This is how to output a command to make the user-level label named NAME 00994 defined for reference from other files. */ 00995 00996 #define ASM_GLOBALIZE_LABEL(FILE,NAME) do { \ 00997 fprintf (FILE, "\tglobal %s\t; export\n", NAME); \ 00998 } while (0) 00999 01000 /* The prefix to add to user-visible assembler symbols. */ 01001 01002 #define USER_LABEL_PREFIX "" 01003 01004 /* This is how to output an internal numbered label where 01005 PREFIX is the class of label and NUM is the number within the class. */ 01006 01007 #define ASM_OUTPUT_INTERNAL_LABEL(FILE,PREFIX,NUM) \ 01008 do { \ 01009 if (strcmp(PREFIX,"LC") == 0) { \ 01010 label_pending = 1; \ 01011 datalbl[++datalbl_ndx].name = (char *) xmalloc (9);\ 01012 sprintf(datalbl[datalbl_ndx].name,"LC%d",NUM); \ 01013 datalbl[datalbl_ndx].size = 0; \ 01014 check_section(Konst); \ 01015 fprintf(FILE,"K%s%d\n",PREFIX,NUM); \ 01016 } \ 01017 else if (find_jmplbl(NUM) < 0) { \ 01018 jmplbl[++jmplbl_ndx].num = NUM; \ 01019 jmplbl[jmplbl_ndx].pc = program_counter; \ 01020 fprintf(FILE, "%s%d\n", PREFIX, NUM); \ 01021 } \ 01022 fflush(FILE); \ 01023 } while (0) 01024 01025 01026 /* This is how to store into the string LABEL 01027 the symbol_ref name of an internal numbered label where 01028 PREFIX is the class of label and NUM is the number within the class. 01029 This is suitable for output with `assemble_name'. */ 01030 01031 #define ASM_GENERATE_INTERNAL_LABEL(LABEL,PREFIX,NUM) \ 01032 sprintf (LABEL, "%s%d", PREFIX, NUM) 01033 01034 /* Output at the end of a jump table. 01035 1750: To be uncommented when we can put jump tables in Konst. 01036 #define ASM_OUTPUT_CASE_END(FILE,NUM,INSN) \ 01037 fprintf (FILE, "\tnormal\t; case_end\n") 01038 */ 01039 01040 /* Currently, it is not possible to put jump tables in section Konst. 01041 This is because there is a one-to-one relation between sections Konst 01042 and Static (i.e., all Konst data are copied to Static, and the order 01043 of data is the same between the two sections.) However, jump tables are 01044 not copied to Static, which destroys the equivalence between Konst and 01045 Static. When a more intelligent Konst-to-Static copying mechanism is 01046 implemented (i.e. one that excludes the copying of jumptables), then 01047 ASM_OUTPUT_CASE_END shall be defined, and JUMP_LABELS_IN_TEXT_SECTION 01048 shall be undefined. */ 01049 01050 #define JUMP_TABLES_IN_TEXT_SECTION 1 01051 01052 /* This is how to output an assembler line defining a string constant. */ 01053 01054 #define ASM_OUTPUT_ASCII(FILE, PTR, LEN) do { \ 01055 int i; \ 01056 if (label_pending) \ 01057 label_pending = 0; \ 01058 datalbl[datalbl_ndx].size += LEN; \ 01059 for (i = 0; i < (int) LEN; i++) { \ 01060 if ((i % 15) == 0) { \ 01061 if (i != 0) \ 01062 fprintf(FILE,"\n"); \ 01063 fprintf(FILE,"\tdata\t"); \ 01064 } \ 01065 else \ 01066 fprintf(FILE,","); \ 01067 if (PTR[i] >= 32 && PTR[i] < 127) \ 01068 fprintf(FILE,"'%c'",PTR[i]); \ 01069 else \ 01070 fprintf(FILE,"%d",PTR[i]); \ 01071 } \ 01072 fprintf(FILE,"\n"); \ 01073 } while (0) 01074 01075 /* This is how to output an insn to push a register on the stack. 01076 It need not be very fast code. */ 01077 01078 #define ASM_OUTPUT_REG_PUSH(FILE,REGNO) \ 01079 fprintf (FILE, "\tPSHM R%s,R%s\n", reg_names[REGNO], "FIXME: missing arg") 01080 01081 /* This is how to output an insn to pop a register from the stack. 01082 It need not be very fast code. */ 01083 01084 #define ASM_OUTPUT_REG_POP(FILE,REGNO) \ 01085 fprintf (FILE, "\tPOPM R%s,R%s\n", reg_names[REGNO], "FIXME: missing arg") 01086 01087 /* This is how to output an element of a case-vector that is absolute. */ 01088 01089 #define ASM_OUTPUT_ADDR_VEC_ELT(FILE, VALUE) \ 01090 fprintf (FILE, "\tdata\tL%d ;addr_vec_elt\n", VALUE) 01091 01092 /* This is how to output an element of a case-vector that is relative. */ 01093 01094 #define ASM_OUTPUT_ADDR_DIFF_ELT(FILE, BODY, VALUE, REL) \ 01095 fprintf (FILE, "\tdata\tL%d-L%d ;addr_diff_elt\n", VALUE,REL) 01096 01097 /* This is how to output an assembler line 01098 that says to advance the location counter 01099 to a multiple of 2**LOG bytes. */ 01100 01101 #define ASM_OUTPUT_ALIGN(FILE,LOG) \ 01102 fprintf(FILE,"; in ASM_OUTPUT_ALIGN: pwr_of_2_bytcnt=%d\n",LOG) 01103 01104 #define ASM_OUTPUT_SKIP(FILE,SIZE) \ 01105 fprintf(FILE,"; in ASM_OUTPUT_SKIP: size=%d\n",SIZE) 01106 01107 /* This says how to output an assembler line 01108 to define a global common symbol. */ 01109 01110 #define ASM_OUTPUT_COMMON(FILE, NAME, SIZE, ROUNDED) do { \ 01111 check_section(Static); \ 01112 fprintf (FILE, "\tcommon %s,%d\n", NAME, SIZE); \ 01113 } while (0) 01114 01115 #define ASM_OUTPUT_EXTERNAL(FILE, DECL, NAME) do { \ 01116 fprintf (FILE, "\tglobal %s\t; import\n", NAME); \ 01117 } while (0) 01118 01119 /* This says how to output an assembler line 01120 to define a local common symbol. */ 01121 01122 #define ASM_OUTPUT_LOCAL(FILE, NAME, SIZE, ROUNDED) do { \ 01123 check_section (Static); \ 01124 fprintf(FILE,"%s \tblock %d\t; local common\n",NAME,SIZE); \ 01125 } while (0) 01126 01127 /* Store in OUTPUT a string (made with alloca) containing 01128 an assembler-name for a local static variable named NAME. 01129 LABELNO is an integer which is different for each call. */ 01130 01131 #define ASM_FORMAT_PRIVATE_NAME(OUTPUT, NAME, LABELNO) \ 01132 ( (OUTPUT) = (char *) alloca (strlen ((NAME)) + 10), \ 01133 sprintf ((OUTPUT), "%s.%d", (NAME), (LABELNO))) 01134 01135 /* Print operand X (an rtx) in assembler syntax to file FILE. 01136 CODE is a letter or dot (`z' in `%z0') or 0 if no letter was specified. 01137 For `%' followed by punctuation, CODE is the punctuation and X is null. 01138 1750 note: there are three special CODE characters: 01139 'D', 'E': print a reference to a floating point constant (D=double, 01140 E=single precision) label name 01141 'F': print a label defining a floating-point constant value 01142 'J': print the absolute value of a negative INT_CONST 01143 (this is used in LISN/CISN/MISN/SISP and others) 01144 'Q': print a 1750 Base-Register-with-offset instruction's operands 01145 */ 01146 01147 #define PRINT_OPERAND(FILE, X, CODE) print_operand(FILE,X,CODE) 01148 #define PRINT_OPERAND_ADDRESS(FILE, ADDR) print_operand_address(FILE,ADDR) 01149 01150 /* Convert a REAL_VALUE_TYPE to the target 1750a float format. */ 01151 #define REAL_VALUE_TO_TARGET_SINGLE(IN, OUT) \ 01152 ((OUT) = real_value_to_target_single(IN)) 01153 01154 /* Convert a REAL_VALUE_TYPE to the target 1750a extended float format. */ 01155 #define REAL_VALUE_TO_TARGET_DOUBLE(IN, OUT) \ 01156 real_value_to_target_double((IN), (OUT))
1.5.6