Annotation of gcc/config/tm-sparc.h, revision 1.1.1.3

1.1       root        1: /* Definitions of target machine for GNU compiler, for Sun SPARC.
                      2:    Copyright (C) 1988 Free Software Foundation, Inc.
                      3:    Contributed by Michael Tiemann ([email protected]).
                      4: 
                      5: This file is part of GNU CC.
                      6: 
                      7: GNU CC is free software; you can redistribute it and/or modify
                      8: it under the terms of the GNU General Public License as published by
                      9: the Free Software Foundation; either version 1, or (at your option)
                     10: any later version.
                     11: 
                     12: GNU CC is distributed in the hope that it will be useful,
                     13: but WITHOUT ANY WARRANTY; without even the implied warranty of
                     14: MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
                     15: GNU General Public License for more details.
                     16: 
                     17: You should have received a copy of the GNU General Public License
                     18: along with GNU CC; see the file COPYING.  If not, write to
                     19: the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.  */
                     20: 
                     21: /* Note that some other tm- files include this one and then override
                     22:    many of the definitions that relate to assembler syntax.  */
                     23: 
                     24: /* Specify library to handle `-a' basic block profiling.  */
                     25: 
                     26: #define LIB_SPEC "%{a:/usr/lib/bb_link.o} \
                     27: %{!p:%{!pg:-lc}}%{p:-lc_p}%{pg:-lc_p} "
                     28: 
                     29: /* Provide required defaults for linker -e and -d switches.
                     30:    Also, it is hard to debug with shared libraries,
                     31:    so don't use them if going to debug.  */
                     32: 
1.1.1.3 ! root       33: #define LINK_SPEC "%{!e*:-e start} -dc -dp %{g:-Bstatic} %{static:-Bstatic} %{Bstatic}"
1.1       root       34: 
                     35: /* Special flags to the Sun-4 assembler when using pipe for input.  */
                     36: 
                     37: #define ASM_SPEC " %{pipe:-} "
                     38: 
1.1.1.3 ! root       39: /* Prevent error on `-dalign', `-sun4' and `-target sun4' options.  */
1.1       root       40: 
1.1.1.3 ! root       41: #define CC1_SPEC "%{dalign:} %{sun4:} %{target:}"
        !            42: 
        !            43: /* These compiler options take an argument.  We ignore -target for now.  */
        !            44: 
        !            45: #define WORD_SWITCH_TAKES_ARG(STR)     (!strcmp (STR, "target"))
1.1       root       46: 
                     47: /* Names to predefine in the preprocessor for this target machine.  */
                     48: 
                     49: #define CPP_PREDEFINES "-Dsparc -Dsun -Dunix"
                     50: 
                     51: /* Print subsidiary information on the compiler version in use.  */
                     52: 
                     53: #define TARGET_VERSION fprintf (stderr, " (sparc)");
                     54: 
                     55: /* Generate DBX debugging information.  */
                     56: 
                     57: #define DBX_DEBUGGING_INFO
                     58: 
                     59: /* Run-time compilation parameters selecting different hardware subsets.  */
                     60: 
                     61: extern int target_flags;
                     62: 
                     63: /* Nonzero if we should generate code to use the fpu.  */
                     64: #define TARGET_FPU (target_flags & 1)
                     65: 
                     66: /* Nonzero if we should use FUNCTION_EPILOGUE.  Otherwise, we
                     67:    use fast return insns, but lose some generality.  */
                     68: #define TARGET_EPILOGUE (target_flags & 2)
                     69: 
                     70: /* Nonzero if we expect to be passed through the Sun
                     71:    optimizing assembler.  This requires us to generate
                     72:    code which we otherwise would not.  For example,
                     73:    calls via pointers-to-functions must be output
                     74:    specially because Sun assemble does not do proper flow
                     75:    analysis for this case. */
                     76: #define TARGET_SUN_ASM (target_flags & 4)
                     77: 
                     78: /* Nonzero if we should do eager peepholes for conditional branch
                     79:    scheduling.  */
                     80: #define TARGET_EAGER (target_flags & 8)
                     81: 
                     82: /* Macro to define tables used to set the flags.
                     83:    This is a list in braces of pairs in braces,
                     84:    each pair being { "NAME", VALUE }
                     85:    where VALUE is the bits to set or minus the bits to clear.
                     86:    An empty string NAME is used to identify the default VALUE.  */
                     87: 
                     88: #define TARGET_SWITCHES  \
                     89:   { {"fpu", 1},                        \
                     90:     {"soft-float", -1},                \
                     91:     {"epilogue", 2},           \
                     92:     {"no-epilogue", -2},       \
                     93:     {"sun-asm", 4},            \
                     94:     {"eager", 8},              \
                     95:     { "", TARGET_DEFAULT}}
                     96: 
                     97: #define TARGET_DEFAULT 3
                     98: 
                     99: /* target machine storage layout */
                    100: 
                    101: /* Define this if most significant bit is lowest numbered
                    102:    in instructions that operate on numbered bit-fields.  */
                    103: #define BITS_BIG_ENDIAN
                    104: 
                    105: /* Define this if most significant byte of a word is the lowest numbered.  */
                    106: /* This is true on the SPARC.  */
                    107: #define BYTES_BIG_ENDIAN
                    108: 
                    109: /* Define this if most significant word of a multiword number is numbered.  */
                    110: /* For SPARC we can decide arbitrarily
                    111:    since there are no machine instructions for them.  */
                    112: /* #define WORDS_BIG_ENDIAN */
                    113: 
                    114: /* number of bits in an addressible storage unit */
                    115: #define BITS_PER_UNIT 8
                    116: 
                    117: /* Width in bits of a "word", which is the contents of a machine register.
                    118:    Note that this is not necessarily the width of data type `int';
                    119:    if using 16-bit ints on a 68000, this would still be 32.
                    120:    But on a machine with 16-bit registers, this would be 16.  */
                    121: #define BITS_PER_WORD 32
                    122: 
                    123: /* Width of a word, in units (bytes).  */
                    124: #define UNITS_PER_WORD 4
                    125: 
                    126: /* Width in bits of a pointer.
                    127:    See also the macro `Pmode' defined below.  */
                    128: #define POINTER_SIZE 32
                    129: 
                    130: /* Allocation boundary (in *bits*) for storing pointers in memory.  */
                    131: #define POINTER_BOUNDARY 32
                    132: 
                    133: /* Allocation boundary (in *bits*) for storing arguments in argument list.  */
                    134: #define PARM_BOUNDARY 32
                    135: 
                    136: /* Boundary (in *bits*) on which stack pointer should be aligned.  */
                    137: #define STACK_BOUNDARY 64
                    138: 
                    139: /* Allocation boundary (in *bits*) for the code of a function.  */
                    140: #define FUNCTION_BOUNDARY 32
                    141: 
                    142: /* Alignment of field after `int : 0' in a structure.  */
                    143: #define EMPTY_FIELD_BOUNDARY 32
                    144: 
                    145: /* Every structure's size must be a multiple of this.  */
                    146: #define STRUCTURE_SIZE_BOUNDARY 8
                    147: 
                    148: /* A bitfield declared as `int' forces `int' alignment for the struct.  */
1.1.1.3 ! root      149: #define PCC_BITFIELD_TYPE_MATTERS 1
1.1       root      150: 
                    151: /* No data type wants to be aligned rounder than this.  */
                    152: #define BIGGEST_ALIGNMENT 64
                    153: 
                    154: /* Define this if move instructions will actually fail to work
                    155:    when given unaligned data.  */
                    156: #define STRICT_ALIGNMENT
                    157: 
                    158: /* Things that must be doubleword aligned cannot go in the text section,
                    159:    because the linker fails to align the text section enough!
                    160:    Put them in the data section.  */
                    161: #define MAX_TEXT_ALIGN 32
                    162: 
                    163: #define SELECT_SECTION(T)                                              \
                    164: {                                                                      \
                    165:   if (TREE_CODE (T) == VAR_DECL)                                       \
                    166:     {                                                                  \
                    167:       if (TREE_READONLY (T) && ! TREE_VOLATILE (T)                     \
                    168:          && DECL_ALIGN (T) <= MAX_TEXT_ALIGN)                          \
                    169:        text_section ();                                                \
                    170:       else                                                             \
                    171:        data_section ();                                                \
                    172:     }                                                                  \
                    173:   if (*tree_code_type[(int) TREE_CODE (T)] == 'c')                     \
                    174:     {                                                                  \
                    175:       if ((TREE_CODE (T) == STRING_CST && flag_writable_strings)       \
                    176:          || TYPE_ALIGN (TREE_TYPE (T)) > MAX_TEXT_ALIGN)               \
                    177:        data_section ();                                                \
                    178:       else                                                             \
                    179:        text_section ();                                                \
                    180:     }                                                                  \
                    181: }
                    182: 
1.1.1.2   root      183: /* Use text section for a constant
                    184:    unless we need more alignment than that offers.  */
1.1       root      185: #define SELECT_RTX_SECTION(MODE, X)            \
                    186: {                                              \
1.1.1.2   root      187:   if (GET_MODE_BITSIZE (MODE) <= MAX_TEXT_ALIGN)\
1.1       root      188:     text_section ();                           \
                    189:   else                                         \
                    190:     data_section ();                           \
                    191: }
                    192: 
                    193: /* Standard register usage.  */
                    194: 
                    195: /* Number of actual hardware registers.
                    196:    The hardware registers are assigned numbers for the compiler
                    197:    from 0 to just below FIRST_PSEUDO_REGISTER.
                    198:    All registers that the compiler knows about must be given numbers,
                    199:    even those that are not normally considered general registers.
                    200: 
                    201:    SPARC has 32 fullword registers and 32 floating point registers.  */
                    202: 
                    203: #define FIRST_PSEUDO_REGISTER 64
                    204: 
                    205: /* 1 for registers that have pervasive standard uses
                    206:    and are not available for the register allocator.
                    207:    On SPARC, this includes all the global registers
                    208:    (registers r[0] through r[7]) and the callee return
                    209:    address register, r[15].  */
                    210: #define FIXED_REGISTERS  \
                    211:  {1, 1, 1, 1, 1, 1, 1, 1,      \
                    212:   0, 0, 0, 0, 0, 0, 1, 1,      \
                    213:   0, 0, 0, 0, 0, 0, 0, 0,      \
                    214:   0, 0, 0, 0, 0, 0, 1, 1,      \
                    215:                                \
                    216:   1, 1, 0, 0, 0, 0, 0, 0,      \
                    217:   0, 0, 0, 0, 0, 0, 0, 0,      \
                    218:   0, 0, 0, 0, 0, 0, 0, 0,      \
                    219:   0, 0, 0, 0, 0, 0, 0, 0}
                    220: 
                    221: 
                    222: /* 1 for registers not available across function calls.
                    223:    These must include the FIXED_REGISTERS and also any
                    224:    registers that can be used without being saved.
                    225:    The latter must include the registers where values are returned
                    226:    and the register where structure-value addresses are passed.
                    227:    Aside from that, you can include as many other registers as you like.  */
                    228: #define CALL_USED_REGISTERS  \
                    229:  {1, 1, 1, 1, 1, 1, 1, 1,      \
                    230:   1, 1, 1, 1, 1, 1, 1, 1,      \
                    231:   0, 0, 0, 0, 0, 0, 0, 0,      \
                    232:   0, 0, 0, 0, 0, 0, 1, 1,      \
                    233:                                \
                    234:   1, 1, 1, 1, 1, 1, 1, 1,      \
                    235:   1, 1, 1, 1, 1, 1, 1, 1,      \
                    236:   1, 1, 1, 1, 1, 1, 1, 1,      \
                    237:   1, 1, 1, 1, 1, 1, 1, 1}
                    238: 
                    239: /* Return number of consecutive hard regs needed starting at reg REGNO
                    240:    to hold something of mode MODE.
                    241:    This is ordinarily the length in words of a value of mode MODE
                    242:    but can be less for certain modes in special long registers.
                    243: 
                    244:    On SPARC, ordinary registers hold 32 bits worth;
                    245:    this means both integer and floating point registers.  */
                    246: #define HARD_REGNO_NREGS(REGNO, MODE)   \
                    247:   ((GET_MODE_SIZE (MODE) + UNITS_PER_WORD - 1) / UNITS_PER_WORD)
                    248: 
                    249: /* Value is 1 if hard register REGNO can hold a value of machine-mode MODE.
                    250:    On SPARC, the cpu registers can hold any mode but the float registers
                    251:    can only hold SFmode or DFmode.  */
                    252: #define HARD_REGNO_MODE_OK(REGNO, MODE) \
                    253:   ((REGNO) < 32 ? ((GET_MODE_SIZE (MODE) <= 4) ? 1 : ((REGNO) & 1) == 0) : \
                    254:    ((MODE) == SFmode ? 1 : (MODE) == DFmode && ((REGNO) & 1) == 0))
                    255: 
                    256: /* Value is 1 if it is a good idea to tie two pseudo registers
                    257:    when one has mode MODE1 and one has mode MODE2.
                    258:    If HARD_REGNO_MODE_OK could produce different values for MODE1 and MODE2,
                    259:    for any hard reg, then this must be 0 for correct output.  */
                    260: #define MODES_TIEABLE_P(MODE1, MODE2) \
                    261:   (((MODE1) == SFmode || (MODE1) == DFmode) \
                    262:    == ((MODE2) == SFmode || (MODE2) == DFmode))
                    263: 
                    264: /* Specify the registers used for certain standard purposes.
                    265:    The values of these macros are register numbers.  */
                    266: 
                    267: /* SPARC pc isn't overloaded on a register that the compiler knows about.  */
                    268: /* #define PC_REGNUM  */
                    269: 
                    270: /* Register to use for pushing function arguments.  */
                    271: #define STACK_POINTER_REGNUM 14
                    272: 
                    273: /* Actual top-of-stack address is 92 greater
                    274:    than the contents of the stack pointer register.  */
                    275: #define STACK_POINTER_OFFSET 92
                    276: 
                    277: /* Base register for access to local variables of the function.  */
                    278: #define FRAME_POINTER_REGNUM 30
                    279: 
                    280: /* Value should be nonzero if functions must have frame pointers.
                    281:    Zero means the frame pointer need not be set up (and parms
                    282:    may be accessed via the stack pointer) in functions that seem suitable.
                    283:    This is computed in `reload', in reload1.c.  */
                    284: #define FRAME_POINTER_REQUIRED 1
                    285: 
                    286: /* Base register for access to arguments of the function.  */
                    287: #define ARG_POINTER_REGNUM 30
                    288: 
                    289: /* Register in which static-chain is passed to a function.  */
                    290: /* ??? */
                    291: #define STATIC_CHAIN_REGNUM 1
                    292:   
                    293: 
                    294: /* Functions which return large structures get the address
                    295:    to place the wanted value at offset 64 from the frame.  */
                    296: #define STRUCT_VALUE_OFFSET 64 /* Used only in other #defines in this file.  */
                    297: #define STRUCT_VALUE \
                    298:   gen_rtx (MEM, Pmode,                                 \
                    299:           gen_rtx (PLUS, SImode, stack_pointer_rtx,    \
                    300:                    gen_rtx (CONST_INT, VOIDmode, STRUCT_VALUE_OFFSET)))
                    301: #define STRUCT_VALUE_INCOMING \
                    302:   gen_rtx (MEM, Pmode,                                 \
                    303:           gen_rtx (PLUS, SImode, frame_pointer_rtx,    \
                    304:                    gen_rtx (CONST_INT, VOIDmode, STRUCT_VALUE_OFFSET)))
                    305: 
                    306: /* Define the classes of registers for register constraints in the
                    307:    machine description.  Also define ranges of constants.
                    308: 
                    309:    One of the classes must always be named ALL_REGS and include all hard regs.
                    310:    If there is more than one class, another class must be named NO_REGS
                    311:    and contain no registers.
                    312: 
                    313:    The name GENERAL_REGS must be the name of a class (or an alias for
                    314:    another name such as ALL_REGS).  This is the class of registers
                    315:    that is allowed by "g" or "r" in a register constraint.
                    316:    Also, registers outside this class are allocated only when
                    317:    instructions express preferences for them.
                    318: 
                    319:    The classes must be numbered in nondecreasing order; that is,
                    320:    a larger-numbered class must never be contained completely
                    321:    in a smaller-numbered class.
                    322: 
                    323:    For any two classes, it is very desirable that there be another
                    324:    class that represents their union.  */
                    325:    
                    326: /* The SPARC has two kinds of registers, general and floating point.  */
                    327: 
                    328: enum reg_class { NO_REGS, GENERAL_REGS, FP_REGS, ALL_REGS, LIM_REG_CLASSES };
                    329: 
                    330: #define N_REG_CLASSES (int) LIM_REG_CLASSES
                    331: 
                    332: /* Give names of register classes as strings for dump file.   */
                    333: 
                    334: #define REG_CLASS_NAMES \
                    335:  {"NO_REGS", "GENERAL_REGS", "FP_REGS", "ALL_REGS" }
                    336: 
                    337: /* Define which registers fit in which classes.
                    338:    This is an initializer for a vector of HARD_REG_SET
                    339:    of length N_REG_CLASSES.  */
                    340: 
                    341: #define REG_CLASS_CONTENTS {{0, 0}, {-1, 0}, {0, -1}, {-1, -1}}
                    342: 
                    343: /* The same information, inverted:
                    344:    Return the class number of the smallest class containing
                    345:    reg number REGNO.  This could be a conditional expression
                    346:    or could index an array.  */
                    347: 
                    348: #define REGNO_REG_CLASS(REGNO) \
                    349:  ((REGNO) >= 32 ? FP_REGS : GENERAL_REGS)
                    350: 
                    351: /* The class value for index registers, and the one for base regs.  */
                    352: #define INDEX_REG_CLASS GENERAL_REGS
                    353: #define BASE_REG_CLASS GENERAL_REGS
                    354: 
                    355: /* Get reg_class from a letter such as appears in the machine description.  */
                    356: 
                    357: #define REG_CLASS_FROM_LETTER(C) \
                    358:   ((C) == 'f' ? FP_REGS : NO_REGS)
                    359: 
                    360: /* The letters I, J, K, L and M in a register constraint string
                    361:    can be used to stand for particular ranges of immediate operands.
                    362:    This macro defines what the ranges are.
                    363:    C is the letter, and VALUE is a constant value.
                    364:    Return 1 if VALUE is in the range specified by C.
                    365: 
                    366:    For SPARC, `I' is used for the range of constants an insn
                    367:    can actually contain.
                    368:    `J' is used for the range which is just zero (since that is R0).
                    369:    `K' is used for the 5-bit operand of a compare insns.  */
                    370: 
                    371: #define SMALL_INT(X) ((unsigned) (INTVAL (X) + 0x1000) < 0x2000)
                    372: 
                    373: #define CONST_OK_FOR_LETTER_P(VALUE, C)  \
                    374:   ((C) == 'I' ? (unsigned) ((VALUE) + 0x1000) < 0x2000 \
                    375:    : (C) == 'J' ? (VALUE) == 0                         \
                    376:    : (C) == 'K' ? (unsigned) (VALUE) < 0x20            \
                    377:    : 0)
                    378: 
                    379: /* Similar, but for floating constants, and defining letters G and H.
                    380:    Here VALUE is the CONST_DOUBLE rtx itself.  */
                    381: 
                    382: #define CONST_DOUBLE_OK_FOR_LETTER_P(VALUE, C)  \
                    383:   ((C) == 'G' && XINT (VALUE, 0) == 0 && XINT (VALUE, 1) == 0)
                    384: 
                    385: /* Given an rtx X being reloaded into a reg required to be
                    386:    in class CLASS, return the class of reg to actually use.
                    387:    In general this is just CLASS; but on some machines
                    388:    in some cases it is preferable to use a more restrictive class.  */
                    389: #define PREFERRED_RELOAD_CLASS(X,CLASS) (CLASS)
                    390: 
                    391: /* Return the maximum number of consecutive registers
                    392:    needed to represent mode MODE in a register of class CLASS.  */
                    393: /* On SPARC, this is the size of MODE in words,
                    394:    except in the FP regs, where a single reg is always enough.  */
                    395: #define CLASS_MAX_NREGS(CLASS, MODE)   \
                    396:   ((GET_MODE_SIZE (MODE) + UNITS_PER_WORD - 1) / UNITS_PER_WORD)
                    397: 
                    398: /* Stack layout; function entry, exit and calling.  */
                    399: 
                    400: /* Define this if pushing a word on the stack
                    401:    makes the stack pointer a smaller address.  */
                    402: #define STACK_GROWS_DOWNWARD
                    403: 
                    404: /* Define this if the nominal address of the stack frame
                    405:    is at the high-address end of the local variables;
                    406:    that is, each additional local variable allocated
                    407:    goes at a more negative offset in the frame.  */
                    408: #define FRAME_GROWS_DOWNWARD
                    409: 
                    410: /* Offset within stack frame to start allocating local variables at.
                    411:    If FRAME_GROWS_DOWNWARD, this is the offset to the END of the
                    412:    first local allocated.  Otherwise, it is the offset to the BEGINNING
                    413:    of the first local allocated.  */
                    414: #define STARTING_FRAME_OFFSET -16
                    415: 
                    416: /* If we generate an insn to push BYTES bytes,
                    417:    this says how many the stack pointer really advances by.
                    418:    On SPARC, don't define this because there are no push insns.  */
                    419: /*  #define PUSH_ROUNDING(BYTES) */
                    420: 
                    421: /* Offset of first parameter from the argument pointer register value.
                    422:    This is 64 for the ins and locals, plus 4 for the struct-return reg
                    423:    if this function isn't going to use it.  */
                    424: #define FIRST_PARM_OFFSET(FNDECL)              \
                    425:   (DECL_MODE (DECL_RESULT (fndecl)) == BLKmode \
                    426:    ? STRUCT_VALUE_OFFSET : STRUCT_VALUE_OFFSET + 4)
                    427: 
                    428: /* Offset from top-of-stack address to location to store the
                    429:    function parameter if it can't go in a register.
                    430:    Addresses for following parameters are computed relative to this one.  */
                    431: #define FIRST_PARM_CALLER_OFFSET(FNDECL)       \
                    432:   (STRUCT_VALUE_OFFSET + 4 - STACK_POINTER_OFFSET)
                    433: 
                    434: /* When a parameter is passed in a register, stack space is still
                    435:    allocated for it.  */
                    436: #define REG_PARM_STACK_SPACE
                    437: 
                    438: /* Value is 1 if returning from a function call automatically
                    439:    pops the arguments described by the number-of-args field in the call.
                    440:    FUNTYPE is the data type of the function (as a tree),
                    441:    or for a library call it is an identifier node for the subroutine name.  */
                    442: 
                    443: #define RETURN_POPS_ARGS(FUNTYPE) 0
                    444: 
                    445: /* Some subroutine macros specific to this machine.  */
                    446: #define BASE_RETURN_VALUE_REG(MODE) \
                    447:  ((MODE) == SFmode || (MODE) == DFmode ? 32 : 8)
                    448: #define BASE_OUTGOING_VALUE_REG(MODE) \
                    449:  ((MODE) == SFmode || (MODE) == DFmode ? 32 : 24)
                    450: #define BASE_PASSING_ARG_REG(MODE) (8)
                    451: #define BASE_INCOMING_ARG_REG(MODE) (24)
                    452: 
                    453: /* Define how to find the value returned by a function.
                    454:    VALTYPE is the data type of the value (as a tree).
                    455:    If the precise function being called is known, FUNC is its FUNCTION_DECL;
                    456:    otherwise, FUNC is 0.  */
                    457: 
                    458: /* On SPARC the value is found in the first "output" register.  */
                    459: 
                    460: #define FUNCTION_VALUE(VALTYPE, FUNC)  \
                    461:   gen_rtx (REG, TYPE_MODE (VALTYPE), BASE_RETURN_VALUE_REG (TYPE_MODE (VALTYPE)))
                    462: 
                    463: /* But the called function leaves it in the first "input" register.  */
                    464: 
                    465: #define FUNCTION_OUTGOING_VALUE(VALTYPE, FUNC)  \
                    466:   gen_rtx (REG, TYPE_MODE (VALTYPE), BASE_OUTGOING_VALUE_REG (TYPE_MODE (VALTYPE)))
                    467: 
                    468: /* Define how to find the value returned by a library function
                    469:    assuming the value has mode MODE.  */
                    470: 
                    471: #define LIBCALL_VALUE(MODE)    \
                    472:   gen_rtx (REG, MODE, BASE_RETURN_VALUE_REG (MODE))
                    473: 
                    474: /* 1 if N is a possible register number for a function value
                    475:    as seen by the caller.
                    476:    On SPARC, the first "output" reg is used for integer values,
                    477:    and the first floating point register is used for floating point values.  */
                    478: 
                    479: #define FUNCTION_VALUE_REGNO_P(N) ((N) == 8 || (N) == 32)
                    480: 
                    481: /* 1 if N is a possible register number for function argument passing.
                    482:    On SPARC, these are the "output" registers.  */
                    483: 
                    484: #define FUNCTION_ARG_REGNO_P(N) ((N) < 14 && (N) > 7)
                    485: 
                    486: /* Define a data type for recording info about an argument list
                    487:    during the scan of that argument list.  This data type should
                    488:    hold all necessary information about the function itself
                    489:    and about the args processed so far, enough to enable macros
                    490:    such as FUNCTION_ARG to determine where the next arg should go.
                    491: 
                    492:    On SPARC, this is a single integer, which is a number of words
                    493:    of arguments scanned so far (including the invisible argument,
                    494:    if any, which holds the structure-value-address).
                    495:    Thus 7 or more means all following args should go on the stack.  */
                    496: 
                    497: #define CUMULATIVE_ARGS int
                    498: 
                    499: /* Define the number of register that can hold parameters.
                    500:    This macro is used only in other macro definitions below.  */
                    501: #define NPARM_REGS 6
                    502: 
                    503: /* Initialize a variable CUM of type CUMULATIVE_ARGS
                    504:    for a call to a function whose data type is FNTYPE.
                    505:    For a library call, FNTYPE is 0.
                    506: 
                    507:    On SPARC, the offset always starts at 0: the first parm reg is always
                    508:    the same reg.  */
                    509: 
                    510: #define INIT_CUMULATIVE_ARGS(CUM,FNTYPE) ((CUM) = 0)
                    511: 
                    512: /* Update the data in CUM to advance over an argument
                    513:    of mode MODE and data type TYPE.
                    514:    (TYPE is null for libcalls where that information may not be available.)  */
                    515: 
                    516: #define FUNCTION_ARG_ADVANCE(CUM, MODE, TYPE, NAMED)   \
                    517:  ((CUM) += ((MODE) != BLKmode                          \
                    518:            ? (GET_MODE_SIZE (MODE) + 3) / 4            \
                    519:            : (int_size_in_bytes (TYPE) + 3) / 4))
                    520: 
                    521: /* Determine where to put an argument to a function.
                    522:    Value is zero to push the argument on the stack,
                    523:    or a hard register in which to store the argument.
                    524: 
                    525:    MODE is the argument's machine mode.
                    526:    TYPE is the data type of the argument (as a tree).
                    527:     This is null for libcalls where that information may
                    528:     not be available.
                    529:    CUM is a variable of type CUMULATIVE_ARGS which gives info about
                    530:     the preceding args and about the function being called.
                    531:    NAMED is nonzero if this argument is a named parameter
                    532:     (otherwise it is an extra parameter matching an ellipsis).  */
                    533: 
                    534: /* On SPARC the first six args are normally in registers
                    535:    and the rest are pushed.  Any arg that starts within the first 6 words
                    536:    is at least partially passed in a register unless its data type forbids.  */
                    537:   
                    538: #define FUNCTION_ARG(CUM, MODE, TYPE, NAMED)                           \
1.1.1.3 ! root      539: ((CUM) < NPARM_REGS                                                    \
        !           540:  && ((TYPE)==0 || ! TREE_ADDRESSABLE ((tree)(TYPE)))                   \
        !           541:  && ((MODE) != BLKmode || (TYPE_ALIGN ((TYPE)) % 32 == 0))             \
1.1       root      542:  ? gen_rtx (REG, (MODE), BASE_PASSING_ARG_REG (MODE) + (CUM)) : 0)
                    543: 
                    544: /* Define where a function finds its arguments.
                    545:    This is different from FUNCTION_ARG because of register windows.  */
                    546: 
                    547: #define FUNCTION_INCOMING_ARG(CUM, MODE, TYPE, NAMED)                  \
1.1.1.3 ! root      548: ((CUM) < NPARM_REGS                                                    \
        !           549:  && ((TYPE)==0 || ! TREE_ADDRESSABLE ((tree)(TYPE)))                   \
        !           550:  && ((MODE) != BLKmode || (TYPE_ALIGN ((TYPE)) % 32 == 0))             \
1.1       root      551:  ? gen_rtx (REG, (MODE), BASE_INCOMING_ARG_REG (MODE) + (CUM)) : 0)
                    552: 
                    553: /* For an arg passed partly in registers and partly in memory,
                    554:    this is the number of registers used.
                    555:    For args passed entirely in registers or entirely in memory, zero.
                    556:    Any arg that starts in the first 6 regs but won't entirely fit in them
                    557:    needs partial registers on the Sparc.  */
                    558:   
                    559: #define FUNCTION_ARG_PARTIAL_NREGS(CUM, MODE, TYPE, NAMED)             \
1.1.1.3 ! root      560:   (((CUM) < NPARM_REGS                                                 \
        !           561:     && ((TYPE)==0 || ! TREE_ADDRESSABLE ((tree)(TYPE)))                        \
        !           562:     && ((MODE) != BLKmode || (TYPE_ALIGN ((TYPE)) % 32 == 0))          \
1.1       root      563:     && ((CUM)                                                          \
                    564:        + ((MODE) == BLKmode                                            \
                    565:           ? (int_size_in_bytes (TYPE) + 3) / 4                         \
                    566:           : (GET_MODE_SIZE (MODE) + 3) / 4)) - NPARM_REGS > 0)         \
                    567:    ? (NPARM_REGS - (CUM))                                              \
                    568:    : 0)
                    569: 
                    570: /* Output the label for a function definition.  */
                    571: 
                    572: #define ASM_DECLARE_FUNCTION_NAME(FILE, NAME, DECL) \
                    573: {                                                      \
                    574:   extern tree double_type_node, float_type_node;       \
                    575:   if (TREE_TYPE (DECL) == float_type_node)             \
                    576:     fprintf (FILE, "\t.proc 6\n");                     \
                    577:   else if (TREE_TYPE (DECL) == double_type_node)       \
                    578:     fprintf (FILE, "\t.proc 7\n");                     \
                    579:   else if (TREE_TYPE (DECL) == void_type_node)         \
                    580:     fprintf (FILE, "\t.proc 0\n");                     \
                    581:   else fprintf (FILE, "\t.proc 1\n");                  \
                    582:   ASM_OUTPUT_LABEL (FILE, NAME);                       \
                    583: }
                    584: 
                    585: /* This macro generates the assembly code for function entry.
                    586:    FILE is a stdio stream to output the code to.
                    587:    SIZE is an int: how many units of temporary storage to allocate.
                    588:    Refer to the array `regs_ever_live' to determine which registers
                    589:    to save; `regs_ever_live[I]' is nonzero if register number I
                    590:    is ever used in the function.  This macro is responsible for
                    591:    knowing which registers should not be saved even if used.  */
                    592: 
                    593: /* On SPARC, move-double insns between fpu and cpu need an 8-byte block
                    594:    of memory.  If any fpu reg is used in the function, we allocate
                    595:    such a block here, at the bottom of the frame, just in case it's needed.
                    596: 
                    597:    If this function is a leaf procedure, then we may choose not
                    598:    to do a "save" insn.  Currently we do this only if it touches
                    599:    the "output" registers.  The "local" and "input" registers
                    600:    are off limits.  It might be better to allow one such register
                    601:    to go to the stack, but I doubt it.  */
                    602: 
                    603: #define FUNCTION_PROLOGUE(FILE, SIZE)                          \
                    604: {                                                              \
                    605:   extern char call_used_regs[];                                        \
                    606:   extern int current_function_pretend_args_size;               \
                    607:   extern int frame_pointer_needed;                             \
                    608:   int fsize = (((SIZE) + 7 - STARTING_FRAME_OFFSET) & -8);     \
                    609:   int actual_fsize;                                            \
                    610:   int n_fregs = 0, i;                                          \
                    611:   int n_iregs = 64;                                            \
                    612:   for (i = 32; i < FIRST_PSEUDO_REGISTER; i++)                 \
                    613:     if (regs_ever_live[i] && ! call_used_regs[i])              \
                    614:       n_fregs++;                                               \
                    615:   for (i = 16; i < 32; i++)                                    \
                    616:     if (regs_ever_live[i]) { n_iregs = 96; break; }            \
                    617:   fprintf (FILE, "\t!#PROLOGUE# 0\n");                         \
                    618:   actual_fsize = fsize + n_iregs + (n_fregs*4+7 & -8);         \
                    619:   fsize += current_function_pretend_args_size+7 & -8;          \
                    620:   actual_fsize += current_function_pretend_args_size+7 & -8;   \
                    621:   if (actual_fsize < 4096)                                     \
                    622:     fprintf (FILE, "\tsave %%sp,-%d,%%sp\n", actual_fsize);    \
                    623:   else                                                         \
                    624:     {                                                          \
                    625:       fprintf (FILE, "\tsethi %%hi(0x%x),%%g1\n\tadd %%g1,%%lo(0x%x),%%g1\n", \
                    626:               -actual_fsize, -actual_fsize);                   \
                    627:       fprintf (FILE, "\tsave %%sp,%%g1,%%sp\n");               \
                    628:     }                                                          \
                    629:   fprintf (FILE, "\t!#PROLOGUE# 1\n");                         \
                    630:   if (n_fregs)                                                 \
                    631:     {                                                          \
                    632:       for (i = 32, n_fregs = 0; i < FIRST_PSEUDO_REGISTER; i++)        \
                    633:         if (regs_ever_live[i] && ! call_used_regs[i])          \
                    634:           {                                                    \
                    635:            if (regs_ever_live[i+1] && ! call_used_regs[i+1])   \
                    636:              fprintf (FILE, "\tstd %s,[%%sp+0x%x]\n",          \
                    637:                       reg_names[i], n_iregs + 4 * n_fregs),    \
                    638:              n_fregs += 2, i += 1;                             \
                    639:            else                                                \
                    640:              fprintf (FILE, "\tstf %s,[%%sp+0x%x]\n",          \
                    641:                       reg_names[i], n_iregs + 4 * n_fregs++);  \
                    642:           }                                                    \
                    643:     }                                                          \
                    644:   if (regs_ever_live[32])                                      \
                    645:     fprintf (FILE, "\tst %s,[%%fp-16]\n\tst %s,[%%fp-12]\n",   \
                    646:             reg_names[0], reg_names[0]);                       \
                    647: }
                    648: 
                    649: /* Output assembler code to FILE to increment profiler label # LABELNO
                    650:    for profiling a function entry.  */
                    651: 
                    652: #define FUNCTION_PROFILER(FILE, LABELNO)  \
                    653:   fprintf (FILE, "\tsethi %%hi(LP%d),%%o0\n\tcall mcount\n\tor %%lo(LP%d),%%o0,%%o0\n", \
                    654:           (LABELNO), (LABELNO))
                    655: 
                    656: /* Output assembler code to FILE to initialize this source file's
                    657:    basic block profiling info, if that has not already been done.  */
                    658: 
                    659: #define FUNCTION_BLOCK_PROFILER(FILE, LABELNO)  \
                    660:   fprintf (FILE, "\tsethi %%hi(LPBX0),%%o0\n\tld [%%lo(LPBX0)+%%o0],%%o1\n\ttst %%o1\n\tbne LPY%d\n\tnop\n\tcall ___bb_init_func\n\tnop\nLPY%d:\n",  \
                    661:           (LABELNO), (LABELNO))
                    662: 
                    663: /* Output assembler code to FILE to increment the entry-count for
                    664:    the BLOCKNO'th basic block in this source file.  */
                    665: 
                    666: #define BLOCK_PROFILER(FILE, BLOCKNO) \
                    667: {                                                              \
                    668:   int blockn = (BLOCKNO);                                      \
                    669:   fprintf (FILE, "\tsethi %%hi(LPBX2+%d),%%g1\n\tld [%%lo(LPBX2+%d)+%%g1],%%g2\n\
                    670: \tadd %%g2,1,%%g2\n\tst %%g2,[%%lo(LPBX2+%d)+%%g1]\n",         \
                    671:           4 * blockn, 4 * blockn, 4 * blockn);                 \
                    672:   CC_STATUS_INIT;  /* We have clobbered %g1.  Also %g2.  */    \
                    673: }
                    674: 
                    675: /* EXIT_IGNORE_STACK should be nonzero if, when returning from a function,
                    676:    the stack pointer does not matter.  The value is tested only in
                    677:    functions that have frame pointers.
                    678:    No definition is equivalent to always zero.  */
                    679: 
                    680: extern int may_call_alloca;
                    681: extern int current_function_pretend_args_size;
                    682: 
                    683: #define EXIT_IGNORE_STACK      \
                    684:  (get_frame_size () != 0       \
                    685:   || may_call_alloca || current_function_pretend_args_size)
                    686: 
                    687: /* This macro generates the assembly code for function exit,
                    688:    on machines that need it.  If FUNCTION_EPILOGUE is not defined
                    689:    then individual return instructions are generated for each
                    690:    return statement.  Args are same as for FUNCTION_PROLOGUE.
                    691: 
                    692:    The function epilogue should not depend on the current stack pointer!
                    693:    It should use the frame pointer only.  This is mandatory because
                    694:    of alloca; we also take advantage of it to omit stack adjustments
                    695:    before returning.  */
                    696: 
                    697: /* This declaration is needed due to traditional/ANSI
                    698:    incompatibilities which cannot be #ifdefed away
                    699:    because they occur inside of macros.  Sigh.  */
                    700: extern union tree_node *current_function_decl;
                    701: 
                    702: #define FUNCTION_EPILOGUE(FILE, SIZE)                          \
                    703: {                                                              \
                    704:   extern char call_used_regs[];                                        \
                    705:   extern int may_call_alloca;                                  \
                    706:   extern int current_function_pretend_args_size;               \
                    707:   extern int max_pending_stack_adjust;                         \
                    708:   extern int frame_pointer_needed;                             \
                    709:   int fsize = (((SIZE) + 7 - STARTING_FRAME_OFFSET) & -8);     \
                    710:   int actual_fsize;                                            \
                    711:   int n_fregs = 0, i;                                          \
                    712:   int n_iregs = 64;                                            \
                    713:   for (i = 32, n_fregs = 0; i < FIRST_PSEUDO_REGISTER; i++)    \
                    714:     if (regs_ever_live[i] && ! call_used_regs[i])              \
                    715:       n_fregs++;                                               \
                    716:   for (i = 16; i < 32; i++)                                    \
                    717:     if (regs_ever_live[i]) { n_iregs = 96; break; }            \
                    718:   actual_fsize = fsize + n_iregs + (n_fregs*4+7 & -8);         \
                    719:   actual_fsize += current_function_pretend_args_size+7 & -8;   \
                    720:   fsize += current_function_pretend_args_size+7 & -8;          \
                    721:   if (n_fregs)                                                 \
                    722:     {                                                          \
                    723:       char *base;                                              \
                    724:       int offset;                                              \
                    725:       if (fsize < 4096)                                                \
                    726:        { base = "%fp"; offset = n_iregs - actual_fsize; }      \
                    727:       else                                                     \
                    728:        { base = "%g1"; offset = n_iregs;                       \
                    729:          if (fsize < 4096)                                     \
                    730:            fprintf (FILE, "sethi %%hi(0x%x),%%g1\n\tadd %%g1,%%lo(0x%x),%%g1\n\tadd %%fp,%%g1,%%g1\n", -actual_fsize, -actual_fsize);\
                    731:        }                                                       \
                    732:       for (i = 32, n_fregs = 0; i < FIRST_PSEUDO_REGISTER; i++)        \
                    733:        if (regs_ever_live[i] && ! call_used_regs[i])           \
                    734:          {                                                     \
                    735:            if (regs_ever_live[i+1] && ! call_used_regs[i+1])   \
                    736:              fprintf (FILE, "\tldd [%s%+d],%s\n",              \
                    737:                       base, offset + 4 * n_fregs,              \
                    738:                       reg_names[i]),                           \
                    739:              n_fregs += 2, i += 1;                             \
                    740:            else                                                \
                    741:              fprintf (FILE, "\tldf [%s%+d],%s\n",              \
                    742:                       base, offset + 4 * n_fregs++,            \
                    743:                       reg_names[i]);                           \
                    744:          }                                                     \
                    745:     }                                                          \
                    746:   fprintf (FILE, "\tret\n\trestore\n");                                \
                    747: }
                    748: 
                    749: /* If the memory address ADDR is relative to the frame pointer,
                    750:    correct it to be relative to the stack pointer instead.
                    751:    This is for when we don't use a frame pointer.
                    752:    ADDR should be a variable name.  */
                    753: 
                    754: #define FIX_FRAME_POINTER_ADDRESS(ADDR,DEPTH)  \
                    755: { int offset = -1;                                                     \
                    756:   rtx regs = stack_pointer_rtx;                                                \
                    757:   if (ADDR == frame_pointer_rtx)                                       \
                    758:     offset = 0;                                                                \
                    759:   else if (GET_CODE (ADDR) == PLUS && XEXP (ADDR, 0) == frame_pointer_rtx \
                    760:           && GET_CODE (XEXP (ADDR, 1)) == CONST_INT)                   \
                    761:     offset = INTVAL (XEXP (ADDR, 1));                                  \
                    762:   else if (GET_CODE (ADDR) == PLUS && XEXP (ADDR, 0) == frame_pointer_rtx) \
                    763:     { rtx other_reg = XEXP (ADDR, 1);                                  \
                    764:       offset = 0;                                                      \
                    765:       regs = gen_rtx (PLUS, Pmode, stack_pointer_rtx, other_reg); }    \
                    766:   else if (GET_CODE (ADDR) == PLUS && XEXP (ADDR, 1) == frame_pointer_rtx) \
                    767:     { rtx other_reg = XEXP (ADDR, 0);                                  \
                    768:       offset = 0;                                                      \
                    769:       regs = gen_rtx (PLUS, Pmode, stack_pointer_rtx, other_reg); }    \
                    770:   if (offset >= 0)                                                     \
                    771:     { int regno;                                                       \
                    772:       extern char call_used_regs[];                                    \
                    773:       for (regno = 0; regno < FIRST_PSEUDO_REGISTER; regno++)          \
                    774:         if (regs_ever_live[regno] && ! call_used_regs[regno])          \
                    775:           offset += 4;                                                 \
                    776:       offset -= 4;                                                     \
                    777:       ADDR = plus_constant (regs, offset + (DEPTH)); } }
                    778: 
                    779: /* Addressing modes, and classification of registers for them.  */
                    780: 
                    781: /* #define HAVE_POST_INCREMENT */
                    782: /* #define HAVE_POST_DECREMENT */
                    783: 
                    784: /* #define HAVE_PRE_DECREMENT */
                    785: /* #define HAVE_PRE_INCREMENT */
                    786: 
                    787: /* Macros to check register numbers against specific register classes.  */
                    788: 
                    789: /* These assume that REGNO is a hard or pseudo reg number.
                    790:    They give nonzero only if REGNO is a hard reg of the suitable class
                    791:    or a pseudo reg currently allocated to a suitable hard reg.
                    792:    Since they use reg_renumber, they are safe only once reg_renumber
                    793:    has been allocated, which happens in local-alloc.c.  */
                    794: 
                    795: #define REGNO_OK_FOR_INDEX_P(REGNO) \
                    796: ((REGNO) < 32 || (unsigned) reg_renumber[REGNO] < 32)
                    797: #define REGNO_OK_FOR_BASE_P(REGNO) \
                    798: ((REGNO) < 32 || (unsigned) reg_renumber[REGNO] < 32)
                    799: #define REGNO_OK_FOR_FP_P(REGNO) \
                    800: (((REGNO) ^ 0x20) < 32 || (unsigned) (reg_renumber[REGNO] ^ 0x20) < 32)
                    801: 
                    802: /* Now macros that check whether X is a register and also,
                    803:    strictly, whether it is in a specified class.
                    804: 
                    805:    These macros are specific to the SPARC, and may be used only
                    806:    in code for printing assembler insns and in conditions for
                    807:    define_optimization.  */
                    808: 
                    809: /* 1 if X is an fp register.  */
                    810: 
                    811: #define FP_REG_P(X) (REG_P (X) && REGNO_OK_FOR_FP_P (REGNO (X)))
                    812: 
                    813: /* Maximum number of registers that can appear in a valid memory address.  */
                    814: 
                    815: #define MAX_REGS_PER_ADDRESS 2
                    816: 
                    817: /* Recognize any constant value that is a valid address.  */
                    818: 
                    819: #define CONSTANT_ADDRESS_P(X)  CONSTANT_P (X)
                    820: 
                    821: /* Nonzero if the constant value X is a legitimate general operand.
                    822:    It is given that X satisfies CONSTANT_P or is a CONST_DOUBLE.
                    823: 
                    824:    Anything but a CONST_DOUBLE can be made to work.  */
                    825: 
                    826: #define LEGITIMATE_CONSTANT_P(X)               \
                    827:  (GET_CODE (X) != CONST_DOUBLE)
                    828: 
                    829: /* The macros REG_OK_FOR..._P assume that the arg is a REG rtx
                    830:    and check its validity for a certain class.
                    831:    We have two alternate definitions for each of them.
                    832:    The usual definition accepts all pseudo regs; the other rejects
                    833:    them unless they have been allocated suitable hard regs.
                    834:    The symbol REG_OK_STRICT causes the latter definition to be used.
                    835: 
                    836:    Most source files want to accept pseudo regs in the hope that
                    837:    they will get allocated to the class that the insn wants them to be in.
                    838:    Source files for reload pass need to be strict.
                    839:    After reload, it makes no difference, since pseudo regs have
                    840:    been eliminated by then.  */
                    841: 
                    842: #ifndef REG_OK_STRICT
                    843: 
                    844: /* Nonzero if X is a hard reg that can be used as an index
                    845:    or if it is a pseudo reg.  */
                    846: #define REG_OK_FOR_INDEX_P(X) (((unsigned) REGNO (X)) - 32 >= 32)
                    847: /* Nonzero if X is a hard reg that can be used as a base reg
                    848:    or if it is a pseudo reg.  */
                    849: #define REG_OK_FOR_BASE_P(X) (((unsigned) REGNO (X)) - 32 >= 32)
                    850: 
                    851: #else
                    852: 
                    853: /* Nonzero if X is a hard reg that can be used as an index.  */
                    854: #define REG_OK_FOR_INDEX_P(X) REGNO_OK_FOR_INDEX_P (REGNO (X))
                    855: /* Nonzero if X is a hard reg that can be used as a base reg.  */
                    856: #define REG_OK_FOR_BASE_P(X) REGNO_OK_FOR_BASE_P (REGNO (X))
                    857: 
                    858: #endif
                    859: 
                    860: /* GO_IF_LEGITIMATE_ADDRESS recognizes an RTL expression
                    861:    that is a valid memory address for an instruction.
                    862:    The MODE argument is the machine mode for the MEM expression
                    863:    that wants to use this address.
                    864: 
                    865:    On SPARC, the actual legitimate addresses must be REG+REG or REG+SMALLINT.
                    866:    But we can treat a SYMBOL_REF as legitimate if it is part of this
                    867:    function's constant-pool, because such addresses can actually
                    868:    be output as REG+SMALLINT.
                    869: 
                    870:    Try making SYMBOL_REF (and other things which are CONSTANT_ADDRESS_P)
                    871:    a legitimate address, regardless.  Because the only insns which can use
                    872:    memory are load or store insns, the added hair in the machine description
                    873:    is not that bad.  It should also speed up the compiler by halving the number
                    874:    of insns it must manage for each (MEM (SYMBOL_REF ...)) involved.  */
                    875: 
                    876: #define GO_IF_LEGITIMATE_ADDRESS(MODE, X, ADDR)                \
                    877: { if (GET_CODE (X) == REG)                             \
                    878:     { if (REG_OK_FOR_BASE_P (X)) goto ADDR; }          \
                    879:   else if (GET_CODE (X) == PLUS)                       \
                    880:     {                                                  \
                    881:       if (GET_CODE (XEXP (X, 0)) == REG                        \
                    882:          && REG_OK_FOR_BASE_P (XEXP (X, 0)))           \
                    883:        {                                               \
                    884:          if (GET_CODE (XEXP (X, 1)) == REG             \
                    885:              && REG_OK_FOR_INDEX_P (XEXP (X, 1)))      \
                    886:            goto ADDR;                                  \
                    887:          if (GET_CODE (XEXP (X, 1)) == CONST_INT       \
                    888:              && INTVAL (XEXP (X, 1)) >= -0x1000        \
                    889:              && INTVAL (XEXP (X, 1)) < 0x1000)         \
                    890:            goto ADDR;                                  \
                    891:        }                                               \
                    892:       else if (GET_CODE (XEXP (X, 1)) == REG           \
                    893:          && REG_OK_FOR_BASE_P (XEXP (X, 1)))           \
                    894:        {                                               \
                    895:          if (GET_CODE (XEXP (X, 0)) == REG             \
                    896:              && REG_OK_FOR_INDEX_P (XEXP (X, 0)))      \
                    897:            goto ADDR;                                  \
                    898:          if (GET_CODE (XEXP (X, 0)) == CONST_INT       \
                    899:              && INTVAL (XEXP (X, 0)) >= -0x1000        \
                    900:              && INTVAL (XEXP (X, 0)) < 0x1000)         \
                    901:            goto ADDR;                                  \
                    902:        }                                               \
                    903:     }                                                  \
                    904:   else if (CONSTANT_ADDRESS_P (X))                     \
                    905:     goto ADDR;                                         \
                    906: }
                    907: 
                    908: /* Try machine-dependent ways of modifying an illegitimate address
                    909:    to be legitimate.  If we find one, return the new, valid address.
                    910:    This macro is used in only one place: `memory_address' in explow.c.
                    911: 
                    912:    OLDX is the address as it was before break_out_memory_refs was called.
                    913:    In some cases it is useful to look at this to decide what needs to be done.
                    914: 
                    915:    MODE and WIN are passed so that this macro can use
                    916:    GO_IF_LEGITIMATE_ADDRESS.
                    917: 
                    918:    It is always safe for this macro to do nothing.  It exists to recognize
                    919:    opportunities to optimize the output.  */
                    920: 
                    921: /* On SPARC, change REG+N into REG+REG, and REG+(X*Y) into REG+REG.  */
                    922: 
                    923: #define LEGITIMIZE_ADDRESS(X,OLDX,MODE,WIN)    \
                    924: { if (GET_CODE (X) == PLUS && CONSTANT_ADDRESS_P (XEXP (X, 1)))        \
                    925:     (X) = gen_rtx (PLUS, SImode, XEXP (X, 0),                  \
                    926:                   copy_to_mode_reg (SImode, XEXP (X, 1)));     \
                    927:   if (GET_CODE (X) == PLUS && CONSTANT_ADDRESS_P (XEXP (X, 0)))        \
                    928:     (X) = gen_rtx (PLUS, SImode, XEXP (X, 1),                  \
                    929:                   copy_to_mode_reg (SImode, XEXP (X, 0)));     \
                    930:   if (GET_CODE (X) == PLUS && GET_CODE (XEXP (X, 0)) == MULT)  \
                    931:     (X) = gen_rtx (PLUS, SImode, XEXP (X, 1),                  \
                    932:                   force_operand (XEXP (X, 0), 0));             \
                    933:   if (GET_CODE (X) == PLUS && GET_CODE (XEXP (X, 1)) == MULT)  \
                    934:     (X) = gen_rtx (PLUS, SImode, XEXP (X, 0),                  \
                    935:                   force_operand (XEXP (X, 1), 0));             \
                    936:   if (GET_CODE (x) == SYMBOL_REF)                              \
                    937:     (X) = copy_to_reg (X);                                     \
                    938:   if (memory_address_p (MODE, X))                              \
                    939:     goto WIN; }
                    940: 
                    941: /* Go to LABEL if ADDR (a legitimate address expression)
                    942:    has an effect that depends on the machine mode it is used for.
                    943:    On the SPARC this is never true.  */
                    944: 
                    945: #define GO_IF_MODE_DEPENDENT_ADDRESS(ADDR,LABEL)
                    946: 
                    947: /* Specify the machine mode that this machine uses
                    948:    for the index in the tablejump instruction.  */
                    949: #define CASE_VECTOR_MODE SImode
                    950: 
                    951: /* Define this if the tablejump instruction expects the table
                    952:    to contain offsets from the address of the table.
                    953:    Do not define this if the table should contain absolute addresses.  */
                    954: /* #define CASE_VECTOR_PC_RELATIVE */
                    955: 
                    956: /* Specify the tree operation to be used to convert reals to integers.  */
                    957: #define IMPLICIT_FIX_EXPR FIX_ROUND_EXPR
                    958: 
                    959: /* This is the kind of divide that is easiest to do in the general case.  */
                    960: #define EASY_DIV_EXPR TRUNC_DIV_EXPR
                    961: 
                    962: /* Define this as 1 if `char' should by default be signed; else as 0.  */
                    963: #define DEFAULT_SIGNED_CHAR 1
                    964: 
                    965: /* Max number of bytes we can move from memory to memory
                    966:    in one reasonably fast instruction.  */
                    967: #define MOVE_MAX 4
                    968: 
                    969: /* Nonzero if access to memory by bytes is slow and undesirable.  */
                    970: #define SLOW_BYTE_ACCESS 0
                    971: 
                    972: /* We assume that the store-condition-codes instructions store 0 for false
                    973:    and some other value for true.  This is the value stored for true.  */
                    974: 
                    975: #define STORE_FLAG_VALUE 1
                    976: 
                    977: /* When a prototype says `char' or `short', really pass an `int'.  */
                    978: #define PROMOTE_PROTOTYPES
                    979: 
                    980: /* Define if shifts truncate the shift count
                    981:    which implies one can omit a sign-extension or zero-extension
                    982:    of a shift count.  */
                    983: #define SHIFT_COUNT_TRUNCATED
                    984: 
                    985: /* Value is 1 if truncating an integer of INPREC bits to OUTPREC bits
                    986:    is done just by pretending it is already truncated.  */
                    987: #define TRULY_NOOP_TRUNCATION(OUTPREC, INPREC) 1
                    988: 
                    989: /* Specify the machine mode that pointers have.
                    990:    After generation of rtl, the compiler makes no further distinction
                    991:    between pointers and any other objects of this machine mode.  */
                    992: #define Pmode SImode
                    993: 
                    994: /* A function address in a call instruction
                    995:    is a byte address (for indexing purposes)
                    996:    so give the MEM rtx a byte's mode.  */
                    997: #define FUNCTION_MODE SImode
                    998: 
                    999: /* Define this if addresses of constant functions
                   1000:    shouldn't be put through pseudo regs where they can be cse'd.
                   1001:    Desirable on machines where ordinary constants are expensive
                   1002:    but a CALL with constant address is cheap.  */
                   1003: #define NO_FUNCTION_CSE
                   1004: 
                   1005: /* Define subroutines to call to handle multiply and divide.
                   1006:    Use the subroutines that Sun's library provides.
                   1007:    The `*' prevents an underscore from being prepended by the compiler.  */
                   1008: 
                   1009: #define DIVSI3_LIBCALL "*.div"
                   1010: #define UDIVSI3_LIBCALL "*.udiv"
                   1011: #define MODSI3_LIBCALL "*.rem"
                   1012: #define UMODSI3_LIBCALL "*.urem"
                   1013: #define MULSI3_LIBCALL "*.mul"
                   1014: #define UMULSI3_LIBCALL "*.umul"
                   1015: 
                   1016: /* Compute the cost of computing a constant rtl expression RTX
                   1017:    whose rtx-code is CODE.  The body of this macro is a portion
                   1018:    of a switch statement.  If the code is computed here,
                   1019:    return it with a return statement.  Otherwise, break from the switch.  */
                   1020: 
                   1021: #define CONST_COSTS(RTX,CODE) \
                   1022:   case CONST_INT:                                              \
                   1023:     if (INTVAL (RTX) < 0x1000 && INTVAL (RTX) >= -0x1000) return 0; \
                   1024:   case CONST:                                                  \
                   1025:   case LABEL_REF:                                              \
                   1026:   case SYMBOL_REF:                                             \
                   1027:     return 2;                                                  \
                   1028:   case CONST_DOUBLE:                                           \
                   1029:     return 4;
                   1030: 
                   1031: /* Tell final.c how to eliminate redundant test instructions.  */
                   1032: 
                   1033: /* Here we define machine-dependent flags and fields in cc_status
                   1034:    (see `conditions.h').  */
                   1035: 
                   1036: /* This holds the value sourcing %hi(%g1).  We keep this info
                   1037:    around so that mem/mem ops, such as increment and decrement,
                   1038:    etc, can be performed reasonably.  */
                   1039: #define CC_STATUS_MDEP rtx
                   1040: 
                   1041: /* Nonzero if the results of the previous comparison are
                   1042:    in the floating point condition code register.  */
                   1043: 
                   1044: #define CC_IN_FCCR 04000
                   1045: 
                   1046: /* Nonzero if the results of the previous comparison are
                   1047:    int the coprocessor's condition code register.  */
                   1048: 
                   1049: #define CC_IN_CCCR 010000
                   1050: 
                   1051: /* Nonzero if we know (easily) that floating point register f0
                   1052:    (f1) contains the value 0.  */
                   1053: #define CC_F0_IS_0 020000
                   1054: #define CC_F1_IS_0 040000
                   1055: 
                   1056: /* Nonzero if we know the value of %hi(%g1).  */
                   1057: #define CC_KNOW_HI_G1 0100000
                   1058: 
                   1059: #define CC_STATUS_MDEP_INIT (cc_status.mdep = 0)
                   1060: 
                   1061: /* Store in cc_status the expressions
                   1062:    that the condition codes will describe
                   1063:    after execution of an instruction whose pattern is EXP.
                   1064:    Do not alter them if the instruction would not alter the cc's.  */
                   1065: 
                   1066: #define NOTICE_UPDATE_CC(EXP, INSN) \
                   1067: { if (GET_CODE (EXP) == SET)                                   \
                   1068:     { if (SET_DEST (EXP) == cc0_rtx)                           \
                   1069:        { cc_status.flags = 0;                                  \
                   1070:          cc_status.value1 = SET_DEST (EXP);                    \
                   1071:          cc_status.value2 = SET_SRC (EXP); }                   \
                   1072:       else if (GET_CODE (SET_SRC (EXP)) == CALL)               \
                   1073:        { CC_STATUS_INIT; }                                     \
                   1074:       else if (GET_CODE (SET_DEST (EXP)) == REG)               \
                   1075:        { if (cc_status.value1                                  \
                   1076:              && reg_overlap_mentioned_p (SET_DEST (EXP), cc_status.value1)) \
                   1077:            cc_status.value1 = 0;                               \
                   1078:          if (cc_status.value2                                  \
                   1079:              && reg_overlap_mentioned_p (SET_DEST (EXP), cc_status.value2)) \
                   1080:            cc_status.value2 = 0;                               \
                   1081:        }                                                       \
                   1082:       else if (GET_CODE (SET_DEST (EXP)) == MEM)               \
                   1083:        { rtx x = cc_status.mdep; int know = cc_status.flags & CC_KNOW_HI_G1;   \
                   1084:          CC_STATUS_INIT;                                       \
                   1085:          if (x && know)                                        \
                   1086:            { cc_status.mdep = x; cc_status.flags |= CC_KNOW_HI_G1; }           \
                   1087:        }                                                       \
                   1088:     }                                                          \
                   1089:   else if (GET_CODE (EXP) == PARALLEL                          \
                   1090:           && GET_CODE (XVECEXP (EXP, 0, 0)) == SET)            \
                   1091:     { if (SET_DEST (XVECEXP (EXP, 0, 0)) == cc0_rtx)           \
                   1092:        { cc_status.flags = 0;                                  \
                   1093:          cc_status.value1 = SET_DEST (XVECEXP (EXP, 0, 0));    \
                   1094:          cc_status.value2 = SET_SRC (XVECEXP (EXP, 0, 0));     \
                   1095:        }                                                       \
                   1096:       else if (GET_CODE (SET_SRC (XVECEXP (EXP, 0, 0))) == CALL) \
                   1097:        { /* all bets are off */ CC_STATUS_INIT; }              \
                   1098:       else if (GET_CODE (SET_DEST (XVECEXP (EXP, 0, 0))) == REG) \
                   1099:        { if (cc_status.value1                                  \
                   1100:              && reg_overlap_mentioned_p (SET_DEST (XVECEXP (EXP, 0, 0)), cc_status.value1)) \
                   1101:            cc_status.value1 = 0;                               \
                   1102:          if (cc_status.value2                                  \
                   1103:              && reg_overlap_mentioned_p (SET_DEST (XVECEXP (EXP, 0, 0)), cc_status.value2)) \
                   1104:            cc_status.value2 = 0;                               \
                   1105:        }                                                       \
                   1106:       else if (GET_CODE (SET_DEST (XVECEXP (EXP, 0, 0))) == MEM) \
                   1107:        { rtx x = cc_status.mdep; int know = cc_status.flags & CC_KNOW_HI_G1;   \
                   1108:          CC_STATUS_INIT;                                       \
                   1109:          if (x && know)                                        \
                   1110:            { cc_status.mdep = x; cc_status.flags |= CC_KNOW_HI_G1; }           \
                   1111:        }                                                       \
                   1112:     }                                                          \
                   1113:   else if (GET_CODE (EXP) == PARALLEL)                         \
                   1114:   /* insn-peep has changed this insn beyond recognition
                   1115:      by NOTICE_UPDATE_CC.  However, we know it is either
                   1116:      a call or a branch with a delay slot filled, so we can
                   1117:      give up on knowing condition codes in any case.  */       \
                   1118:     { CC_STATUS_INIT; }                                                \
                   1119:   else if (GET_CODE (EXP) == CALL)                             \
                   1120:     { /* all bets are off */ CC_STATUS_INIT; }                 \
                   1121: }
1.1.1.3 ! root     1122: 
        !          1123: #define OUTPUT_JUMP(NORMAL, NO_OV, FLOAT)  \
        !          1124: { if (cc_prev_status.flags & CC_IN_FCCR)                       \
        !          1125:     return FLOAT;                                              \
        !          1126:   if (cc_prev_status.flags & CC_NO_OVERFLOW)                   \
        !          1127:     return NO_OV;                                              \
        !          1128:   return NORMAL; }
1.1       root     1129: 
                   1130: /* Control the assembler format that we output.  */
                   1131: 
                   1132: /* Output at beginning of assembler file.  */
                   1133: 
                   1134: #define ASM_FILE_START(file)
                   1135: 
                   1136: /* Output to assembler file text saying following lines
                   1137:    may contain character constants, extra white space, comments, etc.  */
                   1138: 
                   1139: #define ASM_APP_ON ""
                   1140: 
                   1141: /* Output to assembler file text saying following lines
                   1142:    no longer contain unusual constructs.  */
                   1143: 
                   1144: #define ASM_APP_OFF ""
                   1145: 
                   1146: /* Output before read-only data.  */
                   1147: 
                   1148: #define TEXT_SECTION_ASM_OP ".text"
                   1149: 
                   1150: /* Output before writable data.  */
                   1151: 
                   1152: #define DATA_SECTION_ASM_OP ".data"
                   1153: 
                   1154: /* How to refer to registers in assembler output.
                   1155:    This sequence is indexed by compiler's hard-register-number (see above).  */
                   1156: 
                   1157: #define REGISTER_NAMES \
                   1158: {"%g0", "%g1", "%g2", "%g3", "%g4", "%g5", "%g6", "%g7",               \
                   1159:  "%o0", "%o1", "%o2", "%o3", "%o4", "%o5", "%sp", "%o7",               \
                   1160:  "%l0", "%l1", "%l2", "%l3", "%l4", "%l5", "%l6", "%l7",               \
                   1161:  "%i0", "%i1", "%i2", "%i3", "%i4", "%i5", "%fp", "%i7",               \
                   1162:  "%f0", "%f1", "%f2", "%f3", "%f4", "%f5", "%f6", "%f7",               \
                   1163:  "%f8", "%f9", "%f10", "%f11", "%f12", "%f13", "%f14", "%f15",         \
                   1164:  "%f16", "%f17", "%f18", "%f19", "%f20", "%f21", "%f22", "%f23",       \
                   1165:  "%f24", "%f25", "%f26", "%f27", "%f28", "%f29", "%f30", "%f31"}       \
                   1166: 
                   1167: /* How to renumber registers for dbx and gdb.  */
                   1168: 
                   1169: #define DBX_REGISTER_NUMBER(REGNO) (REGNO)
                   1170: 
                   1171: /* On Sun 4, this limit is 2048.  We use 1500 to be safe,
                   1172:    since the length can run past this up to a continuation point.  */
                   1173: #define DBX_CONTIN_LENGTH 1500
                   1174: 
                   1175: /* This is how to output a note to DBX telling it the line number
                   1176:    to which the following sequence of instructions corresponds.
                   1177: 
                   1178:    This is needed for SunOS 4.0, and should not hurt for 3.2
                   1179:    versions either.  */
                   1180: #define ASM_OUTPUT_SOURCE_LINE(file, line)             \
                   1181:   { static int sym_lineno = 1;                         \
                   1182:     fprintf (file, ".stabn 68,0,%d,LM%d\nLM%d:\n",     \
                   1183:             line, sym_lineno, sym_lineno);             \
                   1184:     sym_lineno += 1; }
                   1185: 
                   1186: /* This is how to output the definition of a user-level label named NAME,
                   1187:    such as the label on a static function or variable NAME.  */
                   1188: 
                   1189: #define ASM_OUTPUT_LABEL(FILE,NAME)    \
                   1190:   do { assemble_name (FILE, NAME); fputs (":\n", FILE); } while (0)
                   1191: 
                   1192: /* This is how to output a command to make the user-level label named NAME
                   1193:    defined for reference from other files.  */
                   1194: 
                   1195: #define ASM_GLOBALIZE_LABEL(FILE,NAME) \
                   1196:   do { fputs (".global ", FILE); assemble_name (FILE, NAME); fputs ("\n", FILE);} while (0)
                   1197: 
                   1198: /* This is how to output a reference to a user-level label named NAME.
                   1199:    `assemble_name' uses this.  */
                   1200: 
                   1201: #define ASM_OUTPUT_LABELREF(FILE,NAME) \
                   1202:   fprintf (FILE, "_%s", NAME)
                   1203: 
                   1204: /* This is how to output an internal numbered label where
                   1205:    PREFIX is the class of label and NUM is the number within the class.  */
                   1206: 
                   1207: #define ASM_OUTPUT_INTERNAL_LABEL(FILE,PREFIX,NUM)     \
                   1208:   fprintf (FILE, "%s%d:\n", PREFIX, NUM)
                   1209: 
                   1210: /* This is how to store into the string LABEL
                   1211:    the symbol_ref name of an internal numbered label where
                   1212:    PREFIX is the class of label and NUM is the number within the class.
                   1213:    This is suitable for output with `assemble_name'.  */
                   1214: 
                   1215: #define ASM_GENERATE_INTERNAL_LABEL(LABEL,PREFIX,NUM)  \
                   1216:   sprintf (LABEL, "*%s%d", PREFIX, NUM)
                   1217: 
                   1218: /* This is how to output an assembler line defining a `double' constant.  */
                   1219: 
                   1220: #define ASM_OUTPUT_DOUBLE(FILE,VALUE)                                  \
                   1221:   (isinf ((VALUE))                                                     \
                   1222:    ? fprintf (FILE, "\t.double 0r%s99e999\n", ((VALUE) > 0 ? "" : "-")) \
                   1223:    : fprintf (FILE, "\t.double 0r%.20e\n", (VALUE)))
                   1224: 
                   1225: /* This is how to output an assembler line defining a `float' constant.  */
                   1226: 
                   1227: #define ASM_OUTPUT_FLOAT(FILE,VALUE)                                   \
                   1228:   (isinf ((VALUE))                                                     \
                   1229:    ? fprintf (FILE, "\t.single 0r%s99e999\n", ((VALUE) > 0 ? "" : "-")) \
                   1230:    : fprintf (FILE, "\t.single 0r%.20e\n", (VALUE)))
                   1231: 
                   1232: /* This is how to output an assembler line defining an `int' constant.  */
                   1233: 
                   1234: #define ASM_OUTPUT_INT(FILE,VALUE)  \
                   1235: ( fprintf (FILE, "\t.word "),                  \
                   1236:   output_addr_const (FILE, (VALUE)),           \
                   1237:   fprintf (FILE, "\n"))
                   1238: 
                   1239: /* Likewise for `char' and `short' constants.  */
                   1240: 
                   1241: #define ASM_OUTPUT_SHORT(FILE,VALUE)  \
                   1242: ( fprintf (FILE, "\t.half "),                  \
                   1243:   output_addr_const (FILE, (VALUE)),           \
                   1244:   fprintf (FILE, "\n"))
                   1245: 
                   1246: #define ASM_OUTPUT_CHAR(FILE,VALUE)  \
                   1247: ( fprintf (FILE, "\t.byte "),                  \
                   1248:   output_addr_const (FILE, (VALUE)),           \
                   1249:   fprintf (FILE, "\n"))
                   1250: 
                   1251: /* This is how to output an assembler line for a numeric constant byte.  */
                   1252: 
                   1253: #define ASM_OUTPUT_BYTE(FILE,VALUE)  \
                   1254:   fprintf (FILE, "\t.byte 0x%x\n", (VALUE))
                   1255: 
                   1256: /* This is how to output an element of a case-vector that is absolute.  */
                   1257: 
                   1258: #define ASM_OUTPUT_ADDR_VEC_ELT(FILE, VALUE)  \
                   1259:   fprintf (FILE, "\t.word L%d\n", VALUE)
                   1260: 
                   1261: /* This is how to output an element of a case-vector that is relative.
                   1262:    (SPARC does not use such vectors,
                   1263:    but we must define this macro anyway.)  */
                   1264: 
                   1265: #define ASM_OUTPUT_ADDR_DIFF_ELT(FILE, VALUE, REL)  \
                   1266:   fprintf (FILE, "\t.word L%d-L%d\n", VALUE, REL)
                   1267: 
                   1268: /* This is how to output an assembler line
                   1269:    that says to advance the location counter
                   1270:    to a multiple of 2**LOG bytes.  */
                   1271: 
                   1272: #define ASM_OUTPUT_ALIGN(FILE,LOG)     \
                   1273:   if ((LOG) != 0)                      \
                   1274:     fprintf (FILE, "\t.align %d\n", (1<<(LOG)))
                   1275: 
                   1276: #define ASM_OUTPUT_SKIP(FILE,SIZE)  \
1.1.1.3 ! root     1277:   fprintf (FILE, "\t.skip %u\n", (SIZE))
1.1       root     1278: 
                   1279: /* This says how to output an assembler line
                   1280:    to define a global common symbol.  */
                   1281: 
                   1282: #define ASM_OUTPUT_COMMON(FILE, NAME, SIZE, ROUNDED)  \
                   1283: ( fputs (".global ", (FILE)),                  \
                   1284:   assemble_name ((FILE), (NAME)),              \
                   1285:   fputs ("\n.common ", (FILE)),                        \
                   1286:   assemble_name ((FILE), (NAME)),              \
1.1.1.3 ! root     1287:   fprintf ((FILE), ",%u,\"bss\"\n", (ROUNDED)))
1.1       root     1288: 
                   1289: /* This says how to output an assembler line
                   1290:    to define a local common symbol.  */
                   1291: 
                   1292: #define ASM_OUTPUT_LOCAL(FILE, NAME, SIZE, ROUNDED)  \
                   1293: ( fputs ("\n.reserve ", (FILE)),                       \
                   1294:   assemble_name ((FILE), (NAME)),              \
1.1.1.3 ! root     1295:   fprintf ((FILE), ",%u,\"bss\"\n", (ROUNDED)))
1.1       root     1296: 
                   1297: /* Store in OUTPUT a string (made with alloca) containing
                   1298:    an assembler-name for a local static variable named NAME.
                   1299:    LABELNO is an integer which is different for each call.  */
                   1300: 
                   1301: #define ASM_FORMAT_PRIVATE_NAME(OUTPUT, NAME, LABELNO) \
                   1302: ( (OUTPUT) = (char *) alloca (strlen ((NAME)) + 10),   \
                   1303:   sprintf ((OUTPUT), "%s.%d", (NAME), (LABELNO)))
                   1304: 
                   1305: /* Define the parentheses used to group arithmetic operations
                   1306:    in assembler code.  */
                   1307: 
                   1308: #define ASM_OPEN_PAREN "("
                   1309: #define ASM_CLOSE_PAREN ")"
                   1310: 
                   1311: /* Define results of standard character escape sequences.  */
                   1312: #define TARGET_BELL 007
                   1313: #define TARGET_BS 010
                   1314: #define TARGET_TAB 011
                   1315: #define TARGET_NEWLINE 012
                   1316: #define TARGET_VT 013
                   1317: #define TARGET_FF 014
                   1318: #define TARGET_CR 015
                   1319: 
                   1320: /* Print operand X (an rtx) in assembler syntax to file FILE.
                   1321:    CODE is a letter or dot (`z' in `%z0') or 0 if no letter was specified.
                   1322:    For `%' followed by punctuation, CODE is the punctuation and X is null.
                   1323: 
                   1324:    On SPARC, the CODE can be `r', meaning this is a register-only operand
                   1325:    and an immediate zero should be represented as `r0'.
                   1326:    It can also be `m', meaning that X is a memory reference but print
1.1.1.3 ! root     1327:    its address as a non-memory operand.
        !          1328: 
        !          1329:    Codes C, N, F, I, and U are used for printing the opcodes of conditional
        !          1330:    branches.  C prints the opcode for a given condition; N the negated opcode.
        !          1331:    F prints the negated floating point opcode (different because of nans).
        !          1332:    I prints the opcode that ignores the overflow bit, and U its negation.  */
1.1       root     1333: 
                   1334: #define PRINT_OPERAND(FILE, X, CODE)  \
                   1335: { if (GET_CODE (X) == REG)                                     \
                   1336:     fprintf (FILE, "%s", reg_names[REGNO (X)]);                        \
                   1337:   else if ((CODE) == 'm')                                      \
                   1338:     output_address (XEXP (X, 0));                              \
                   1339:   else if (GET_CODE (X) == MEM)                                        \
                   1340:     {                                                          \
                   1341:       fputc ('[', FILE);                                       \
                   1342:       output_address (XEXP (X, 0));                            \
                   1343:       fputc (']', FILE);                                       \
                   1344:     }                                                          \
                   1345:   else if (GET_CODE (X) == CONST_DOUBLE)                       \
                   1346:     abort ();                                                  \
                   1347:   else if ((CODE) == 'r' && (X) == const0_rtx)                 \
                   1348:     fprintf (FILE, "%%g0");                                    \
                   1349:   else if ((CODE) == 'C') switch (GET_CODE (X))                        \
                   1350:     {                                                          \
                   1351:     case EQ: fputs ("e", FILE); break;                         \
                   1352:     case NE: fputs ("ne", FILE); break;                                \
                   1353:     case GT: fputs ("g", FILE); break;                         \
                   1354:     case GE: fputs ("ge", FILE); break;                                \
                   1355:     case LT: fputs ("l", FILE); break;                         \
                   1356:     case LE: fputs ("le", FILE); break;                                \
                   1357:     case GTU: fputs ("gu", FILE); break;                       \
                   1358:     case GEU: fputs ("geu", FILE); break;                      \
                   1359:     case LTU: fputs ("lu", FILE); break;                       \
                   1360:     case LEU: fputs ("leu", FILE); break;                      \
                   1361:     }                                                          \
1.1.1.3 ! root     1362:   else if ((CODE) == 'I') switch (GET_CODE (X))                        \
        !          1363:     {                                                          \
        !          1364:     case EQ: fputs ("e", FILE); break;                         \
        !          1365:     case NE: fputs ("ne", FILE); break;                                \
        !          1366:     case GE: fputs ("pos", FILE); break;                       \
        !          1367:     case LT: fputs ("neg", FILE); break;                       \
        !          1368:     default:                                                   \
        !          1369:        abort ();                                               \
        !          1370:     }                                                          \
        !          1371:   else if ((CODE) == 'U') switch (GET_CODE (X))                        \
        !          1372:     {                                                          \
        !          1373:     case EQ: fputs ("ne", FILE); break;                                \
        !          1374:     case NE: fputs ("e", FILE); break;                         \
        !          1375:     case GE: fputs ("neg", FILE); break;                       \
        !          1376:     case LT: fputs ("pos", FILE); break;                       \
        !          1377:     default:                                                   \
        !          1378:        abort ();                                               \
        !          1379:     }                                                          \
1.1       root     1380:   else if ((CODE) == 'N') switch (GET_CODE (X))                        \
                   1381:     {                                                          \
                   1382:     case EQ: fputs ("ne", FILE); break;                                \
                   1383:     case NE: fputs ("e", FILE); break;                         \
                   1384:     case GT: fputs ("le", FILE); break;                                \
                   1385:     case GE: fputs ("l", FILE); break;                         \
                   1386:     case LT: fputs ("ge", FILE); break;                                \
                   1387:     case LE: fputs ("g", FILE); break;                         \
                   1388:     case GTU: fputs ("leu", FILE); break;                      \
                   1389:     case GEU: fputs ("lu", FILE); break;                       \
                   1390:     case LTU: fputs ("geu", FILE); break;                      \
                   1391:     case LEU: fputs ("gu", FILE); break;                       \
                   1392:     }                                                          \
                   1393:   else if ((CODE) == 'F') switch (GET_CODE (X))                        \
                   1394:     {                                                          \
                   1395:     case EQ: fputs ("ne", FILE); break;                                \
                   1396:     case NE: fputs ("e", FILE); break;                         \
                   1397:     case GT: fputs ("ule", FILE); break;                       \
                   1398:     case GE: fputs ("ul", FILE); break;                                \
                   1399:     case LT: fputs ("uge", FILE); break;                       \
                   1400:     case LE: fputs ("ug", FILE); break;                                \
                   1401:     default: abort ();                                         \
                   1402:     }                                                          \
                   1403:   else { output_addr_const (FILE, X); }}
                   1404: 
                   1405: /* Print a memory address as an operand to reference that memory location.  */
                   1406: 
                   1407: #define PRINT_OPERAND_ADDRESS(FILE, ADDR)  \
                   1408: { register rtx base, index = 0;                                        \
                   1409:   int offset = 0;                                              \
                   1410:   register rtx addr = ADDR;                                    \
                   1411:   if (GET_CODE (addr) == REG)                                  \
                   1412:     {                                                          \
                   1413:       fprintf (FILE, "%s", reg_names[REGNO (addr)]);           \
                   1414:     }                                                          \
                   1415:   else if (GET_CODE (addr) == PLUS)                            \
                   1416:     {                                                          \
                   1417:       if (GET_CODE (XEXP (addr, 0)) == CONST_INT)              \
                   1418:        offset = INTVAL (XEXP (addr, 0)), base = XEXP (addr, 1);\
                   1419:       else if (GET_CODE (XEXP (addr, 1)) == CONST_INT)         \
                   1420:        offset = INTVAL (XEXP (addr, 1)), base = XEXP (addr, 0);\
                   1421:       else                                                     \
                   1422:        base = XEXP (addr, 0), index = XEXP (addr, 1);          \
                   1423:       fprintf (FILE, "%s", reg_names[REGNO (base)]);           \
                   1424:       if (index == 0)                                          \
                   1425:        fprintf (FILE, "%+d", offset);                          \
                   1426:       else                                                     \
                   1427:        fprintf (FILE, "+%s", reg_names[REGNO (index)]);        \
                   1428:     }                                                          \
                   1429:   else                                                         \
                   1430:     {                                                          \
                   1431:       output_addr_const (FILE, addr);                          \
                   1432:     }                                                          \
                   1433: }
                   1434: 

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.