Home | History | Annotate | Line # | Download | only in visium
visium.h revision 1.5
      1 /* Definitions of target machine for Visium.
      2    Copyright (C) 2002-2019 Free Software Foundation, Inc.
      3    Contributed by C.Nettleton, J.P.Parkes and P.Garbett.
      4 
      5    This file is part of GCC.
      6 
      7    GCC is free software; you can redistribute it and/or modify it
      8    under the terms of the GNU General Public License as published
      9    by the Free Software Foundation; either version 3, or (at your
     10    option) any later version.
     11 
     12    GCC is distributed in the hope that it will be useful, but WITHOUT
     13    ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
     14    or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public
     15    License for more details.
     16 
     17    You should have received a copy of the GNU General Public License
     18    along with GCC; see the file COPYING3.  If not see
     19    <http://www.gnu.org/licenses/>.  */
     20 
     21 
     22 /* Controlling the Compilation Driver, `gcc'  */
     23 
     24 /* Pass -mtune=* options to the assembler */
     25 #undef ASM_SPEC
     26 #define ASM_SPEC "%{mcpu=gr6:-mtune=gr6; :-mtune=mcm}"
     27 
     28 /* Define symbols for the preprocessor.  */
     29 #define CPP_SPEC "%{mcpu=gr6:-D__gr6__; :-D__gr5__}"
     30 
     31 /* Targets of a link */
     32 #define LIB_SPEC \
     33   "--start-group -lc %{msim:-lsim; mdebug:-ldebug; :-lserial} --end-group"
     34 
     35 #define ENDFILE_SPEC "crtend.o%s crtn.o%s"
     36 #define STARTFILE_SPEC "crti.o%s crtbegin.o%s crt0.o%s"
     37 
     38 /* Run-time Target Specification */
     39 
     40 /* TARGET_CPU_CPP_BUILTINS() This function-like macro expands to a
     41    block of code that defines built-in preprocessor macros and
     42    assertions for the target cpu, using the functions builtin_define,
     43    builtin_define_std and builtin_assert. When the front end calls
     44    this macro it provides a trailing semicolon, and since it has
     45    finished command line option processing your code can use those
     46    results freely.  builtin_assert takes a string in the form you pass
     47    to the command-line option -A, such as cpu=mips, and creates the
     48    assertion. builtin_define takes a string in the form accepted by
     49    option -D and unconditionally defines the macro.
     50 
     51    builtin_define_std takes a string representing the name of an
     52    object-like macro. If it doesn't lie in the user's namespace,
     53    builtin_define_std defines it unconditionally. Otherwise, it
     54    defines a version with two leading underscores, and another version
     55    with two leading and trailing underscores, and defines the original
     56    only if an ISO standard was not requested on the command line. For
     57    example, passing unix defines __unix, __unix__ and possibly unix;
     58    passing _mips defines __mips, __mips__ and possibly _mips, and
     59    passing _ABI64 defines only _ABI64.
     60 
     61    You can also test for the C dialect being compiled. The variable
     62    c_language is set to one of clk_c, clk_cplusplus or
     63    clk_objective_c. Note that if we are preprocessing assembler, this
     64    variable will be clk_c but the function-like macro
     65    preprocessing_asm_p() will return true, so you might want to check
     66    for that first.  If you need to check for strict ANSI, the variable
     67    flag_iso can be used. The function-like macro
     68    preprocessing_trad_p() can be used to check for traditional
     69    preprocessing.  */
     70 #define TARGET_CPU_CPP_BUILTINS()			\
     71   do							\
     72     {							\
     73       builtin_define ("__VISIUM__");			\
     74       if (TARGET_MCM)					\
     75 	builtin_define ("__VISIUM_ARCH_MCM__");		\
     76       if (TARGET_BMI)					\
     77 	builtin_define ("__VISIUM_ARCH_BMI__");		\
     78       if (TARGET_FPU_IEEE)				\
     79 	builtin_define ("__VISIUM_ARCH_FPU_IEEE__");	\
     80     }							\
     81   while (0)
     82 
     83 /* Recast the cpu class to be the cpu attribute.
     84    Every file includes us, but not every file includes insn-attr.h.  */
     85 #define visium_cpu_attr ((enum attr_cpu) visium_cpu)
     86 
     87 /* Defining data structures for per-function information.
     88 
     89    If the target needs to store information on a per-function basis,
     90    GCC provides a macro and a couple of variables to allow this. Note,
     91    just using statics to store the information is a bad idea, since
     92    GCC supports nested functions, so you can be halfway through
     93    encoding one function when another one comes along.
     94 
     95    GCC defines a data structure called struct function which contains
     96    all of the data specific to an individual function. This structure
     97    contains a field called machine whose type is struct
     98    machine_function *, which can be used by targets to point to their
     99    own specific data.
    100 
    101    If a target needs per-function specific data it should define the
    102    type struct machine_function and also the macro
    103    INIT_EXPANDERS. This macro should be used to initialize the
    104    function pointer init_machine_status.  This pointer is explained
    105    below.
    106 
    107    One typical use of per-function, target specific data is to create
    108    an RTX to hold the register containing the function's return
    109    address.  This RTX can then be used to implement the
    110    __builtin_return_address function, for level 0.
    111 
    112    Note--earlier implementations of GCC used a single data area to
    113    hold all of the per-function information. Thus when processing of a
    114    nested function began the old per-function data had to be pushed
    115    onto a stack, and when the processing was finished, it had to be
    116    popped off the stack.  GCC used to provide function pointers called
    117    save_machine_status and restore_machine_status to handle the saving
    118    and restoring of the target specific information. Since the single
    119    data area approach is no longer used, these pointers are no longer
    120    supported.
    121 
    122    The macro and function pointers are described below.
    123 
    124    INIT_EXPANDERS:
    125 
    126    Macro called to initialize any target specific information. This
    127    macro is called once per function, before generation of any RTL has
    128    begun.  The intention of this macro is to allow the initialization
    129    of the function pointers below.
    130 
    131    init_machine_status:
    132    This is a void (*)(struct function *) function pointer. If this
    133    pointer is non-NULL it will be called once per function, before
    134    function compilation starts, in order to allow the target to
    135    perform any target specific initialization of the struct function
    136    structure. It is intended that this would be used to initialize the
    137    machine of that structure.  struct machine_function structures are
    138    expected to be freed by GC.  Generally, any memory that they
    139    reference must be allocated by using ggc_alloc, including the
    140    structure itself. */
    141 
    142 #define INIT_EXPANDERS visium_init_expanders ()
    143 
    144 /* Storage Layout
    145 
    146    Note that the definitions of the macros in this table which are
    147    sizes or alignments measured in bits do not need to be constant.
    148    They can be C expressions that refer to static variables, such as
    149    the `target_flags'.
    150 
    151    `BITS_BIG_ENDIAN'
    152 
    153    Define this macro to have the value 1 if the most significant bit
    154    in a byte has the lowest number; otherwise define it to have the
    155    value zero.  This means that bit-field instructions count from the
    156    most significant bit.  If the machine has no bit-field
    157    instructions, then this must still be defined, but it doesn't
    158    matter which value it is defined to.  This macro need not be a
    159    constant.
    160 
    161    This macro does not affect the way structure fields are packed into
    162    bytes or words; that is controlled by `BYTES_BIG_ENDIAN'. */
    163 #define BITS_BIG_ENDIAN 1
    164 
    165 /* `BYTES_BIG_ENDIAN'
    166 
    167    Define this macro to have the value 1 if the most significant byte
    168    in a word has the lowest number.  This macro need not be a
    169    constant.*/
    170 #define BYTES_BIG_ENDIAN 1
    171 
    172 /* `WORDS_BIG_ENDIAN'
    173 
    174    Define this macro to have the value 1 if, in a multiword object,
    175    the most significant word has the lowest number.  This applies to
    176    both memory locations and registers; GNU CC fundamentally assumes
    177    that the order of words in memory is the same as the order in
    178    registers.  This macro need not be a constant.  */
    179 #define WORDS_BIG_ENDIAN 1
    180 
    181 /* `BITS_PER_WORD'
    182 
    183    Number of bits in a word; normally 32. */
    184 #define BITS_PER_WORD 32
    185 
    186 /* `UNITS_PER_WORD'
    187 
    188    Number of storage units in a word; normally 4. */
    189 #define UNITS_PER_WORD 4
    190 
    191 /* `POINTER_SIZE'
    192 
    193    Width of a pointer, in bits.  You must specify a value no wider
    194    than the width of `Pmode'.  If it is not equal to the width of
    195    `Pmode', you must define `POINTERS_EXTEND_UNSIGNED'.  */
    196 #define POINTER_SIZE 32
    197 
    198 /* `PARM_BOUNDARY'
    199 
    200    Normal alignment required for function parameters on the stack, in
    201    bits.  All stack parameters receive at least this much alignment
    202    regardless of data type.  On most machines, this is the same as the
    203    size of an integer. */
    204 #define PARM_BOUNDARY 32
    205 
    206 /* `STACK_BOUNDARY'
    207 
    208    Define this macro if you wish to preserve a certain alignment for
    209    the stack pointer.  The definition is a C expression for the
    210    desired alignment (measured in bits).
    211 
    212    If `PUSH_ROUNDING' is not defined, the stack will always be aligned
    213    to the specified boundary.  If `PUSH_ROUNDING' is defined and
    214    specifies a less strict alignment than `STACK_BOUNDARY', the stack
    215    may be momentarily unaligned while pushing arguments. */
    216 #define STACK_BOUNDARY 32
    217 
    218 #define VISIUM_STACK_ALIGN(LOC) (((LOC) + 3) & ~3)
    219 
    220 /* `FUNCTION_BOUNDARY'
    221 
    222    Alignment required for a function entry point, in bits. */
    223 #define FUNCTION_BOUNDARY 32
    224 
    225 /* `BIGGEST_ALIGNMENT'
    226 
    227    Biggest alignment that any data type can require on this machine,
    228    in bits. */
    229 #define BIGGEST_ALIGNMENT 32
    230 
    231 /* `DATA_ALIGNMENT (TYPE, BASIC-ALIGN)`
    232 
    233    If defined, a C expression to compute the alignment for a variable
    234    in the static store.  TYPE is the data type, and BASIC-ALIGN is
    235    the alignment that the object would ordinarily have.  The value of
    236    this macro is used instead of that alignment to align the object. */
    237 #define DATA_ALIGNMENT(TYPE,ALIGN) visium_data_alignment (TYPE, ALIGN)
    238 
    239 /* `LOCAL_ALIGNMENT (TYPE, BASIC-ALIGN)`
    240 
    241    If defined, a C expression to compute the alignment for a variable
    242    in the local store.  TYPE is the data type, and BASIC-ALIGN is the
    243    alignment that the object would ordinarily have.  The value of this
    244    macro is used instead of that alignment to align the object. */
    245 #define LOCAL_ALIGNMENT(TYPE,ALIGN) visium_data_alignment (TYPE, ALIGN)
    246 
    247 /* `EMPTY_FIELD_BOUNDARY'
    248 
    249    Alignment in bits to be given to a structure bit field that follows
    250    an empty field such as `int : 0;'.
    251 
    252    Note that `PCC_BITFIELD_TYPE_MATTERS' also affects the alignment
    253    that results from an empty field. */
    254 #define EMPTY_FIELD_BOUNDARY 32
    255 
    256 /* `STRICT_ALIGNMENT'
    257 
    258    Define this macro to be the value 1 if instructions will fail to
    259    work if given data not on the nominal alignment.  If instructions
    260    will merely go slower in that case, define this macro as 0. */
    261 #define STRICT_ALIGNMENT 1
    262 
    263 /* `TARGET_FLOAT_FORMAT'
    264 
    265    A code distinguishing the floating point format of the target
    266    machine.  There are three defined values:
    267 
    268    `IEEE_FLOAT_FORMAT'
    269           This code indicates IEEE floating point.  It is the default;
    270           there is no need to define this macro when the format is IEEE.
    271 
    272     `VAX_FLOAT_FORMAT'
    273           This code indicates the peculiar format used on the Vax.
    274 
    275     `UNKNOWN_FLOAT_FORMAT'
    276           This code indicates any other format.
    277 
    278     The value of this macro is compared with `HOST_FLOAT_FORMAT' to
    279     determine whether the target machine has the same format as the
    280     host machine.  If any other formats are actually in use on
    281     supported machines, new codes should be defined for them.
    282 
    283     The ordering of the component words of floating point values
    284     stored in memory is controlled by `FLOAT_WORDS_BIG_ENDIAN' for the
    285     target machine and `HOST_FLOAT_WORDS_BIG_ENDIAN' for the host. */
    286 #define TARGET_FLOAT_FORMAT IEEE_FLOAT_FORMAT
    287 #define UNITS_PER_HWFPVALUE 4
    288 
    289 /* Layout of Source Language Data Types
    290 
    291    These macros define the sizes and other characteristics of the
    292    standard basic data types used in programs being compiled.  Unlike
    293    the macros in the previous section, these apply to specific
    294    features of C and related languages, rather than to fundamental
    295    aspects of storage layout. */
    296 
    297 /* `INT_TYPE_SIZE'
    298 
    299    A C expression for the size in bits of the type `int' on the target
    300    machine.  If you don't define this, the default is one word. */
    301 #define INT_TYPE_SIZE  32
    302 
    303 /* `SHORT_TYPE_SIZE'
    304 
    305    A C expression for the size in bits of the type `short' on the
    306    target machine.  If you don't define this, the default is half a
    307    word.  (If this would be less than one storage unit, it is rounded
    308    up to one unit.) */
    309 #define SHORT_TYPE_SIZE 16
    310 
    311 /* `LONG_TYPE_SIZE'
    312 
    313    A C expression for the size in bits of the type `long' on the
    314    target machine.  If you don't define this, the default is one word. */
    315 #define LONG_TYPE_SIZE  32
    316 
    317 /* `LONG_LONG_TYPE_SIZE'
    318 
    319    A C expression for the size in bits of the type `long long' on the
    320    target machine.  If you don't define this, the default is two
    321    words.  If you want to support GNU Ada on your machine, the value
    322    of macro must be at least 64. */
    323 #define LONG_LONG_TYPE_SIZE  64
    324 
    325 /* `CHAR_TYPE_SIZE'
    326 
    327    A C expression for the size in bits of the type `char' on the
    328    target machine.  If you don't define this, the default is one
    329    quarter of a word.  (If this would be less than one storage unit,
    330    it is rounded up to one unit.) */
    331 #define CHAR_TYPE_SIZE  8
    332 
    333 /* `FLOAT_TYPE_SIZE'
    334 
    335    A C expression for the size in bits of the type `float' on the
    336    target machine.  If you don't define this, the default is one word. */
    337 #define FLOAT_TYPE_SIZE  32
    338 
    339 /* `DOUBLE_TYPE_SIZE'
    340 
    341    A C expression for the size in bits of the type `double' on the
    342    target machine.  If you don't define this, the default is two
    343    words. */
    344 #define DOUBLE_TYPE_SIZE  64
    345 
    346 /* `LONG_DOUBLE_TYPE_SIZE'
    347 
    348    A C expression for the size in bits of the type `long double' on
    349    the target machine.  If you don't define this, the default is two
    350    words. */
    351 #define LONG_DOUBLE_TYPE_SIZE   DOUBLE_TYPE_SIZE
    352 
    353 /* `WIDEST_HARDWARE_FP_SIZE'
    354 
    355    A C expression for the size in bits of the widest floating-point
    356    format supported by the hardware.  If you define this macro, you
    357    must specify a value less than or equal to the value of
    358    `LONG_DOUBLE_TYPE_SIZE'.  If you do not define this macro, the
    359    value of `LONG_DOUBLE_TYPE_SIZE' is the default. */
    360 
    361 /* `DEFAULT_SIGNED_CHAR'
    362 
    363    An expression whose value is 1 or 0, according to whether the type
    364    `char' should be signed or unsigned by default.  The user can
    365    always override this default with the options `-fsigned-char' and
    366    `-funsigned-char'. */
    367 #define DEFAULT_SIGNED_CHAR 0
    368 
    369 /* `SIZE_TYPE'
    370 
    371    A C expression for a string describing the name of the data type to
    372    use for size values.  The typedef name `size_t' is defined using
    373    the contents of the string.
    374 
    375    The string can contain more than one keyword.  If so, separate them
    376    with spaces, and write first any length keyword, then `unsigned' if
    377    appropriate, and finally `int'.  The string must exactly match one
    378    of the data type names defined in the function
    379    `init_decl_processing' in the file `c-decl.c'.  You may not omit
    380    `int' or change the order--that would cause the compiler to crash
    381    on startup.
    382 
    383    If you don't define this macro, the default is `"long unsigned
    384    int"'. */
    385 #define SIZE_TYPE "unsigned int"
    386 
    387 /* `PTRDIFF_TYPE'
    388 
    389    A C expression for a string describing the name of the data type to
    390    use for the result of subtracting two pointers.  The typedef name
    391    `ptrdiff_t' is defined using the contents of the string.  See
    392    `SIZE_TYPE' above for more information.
    393 
    394    If you don't define this macro, the default is `"long int"'. */
    395 #define PTRDIFF_TYPE "long int"
    396 
    397 /* Newlib uses the unsigned type corresponding to ptrdiff_t for
    398    uintptr_t; this is the same as size_t for most newlib-using
    399    targets, but not for us.  */
    400 #define UINTPTR_TYPE "long unsigned int"
    401 
    402 /* `WCHAR_TYPE'
    403 
    404    A C expression for a string describing the name of the data type to
    405    use for wide characters.  The typedef name `wchar_t' is defined
    406    using the contents of the string.  See `SIZE_TYPE' above for more
    407    information.
    408 
    409    If you don't define this macro, the default is `"int"'. */
    410 #define WCHAR_TYPE "short int"
    411 
    412 /* `WCHAR_TYPE_SIZE'
    413 
    414    A C expression for the size in bits of the data type for wide
    415    characters.  This is used in `cpp', which cannot make use of
    416    `WCHAR_TYPE'. */
    417 #define WCHAR_TYPE_SIZE 16
    418 
    419 /* Register Usage
    420 
    421    This section explains how to describe what registers the target
    422    machine has, and how (in general) they can be used.  */
    423 
    424 /* `FIRST_PSEUDO_REGISTER'
    425 
    426    Number of actual hardware registers.
    427    The hardware registers are assigned numbers for the compiler
    428    from 0 to just below FIRST_PSEUDO_REGISTER.
    429    All registers that the compiler knows about must be given numbers,
    430    even those that are not normally considered general registers.
    431 
    432    Register 51 is used as the argument pointer register.
    433    Register 52 is used as the soft frame pointer register.  */
    434 #define FIRST_PSEUDO_REGISTER 53
    435 
    436 #define RETURN_REGNUM        1
    437 #define PROLOGUE_TMP_REGNUM  9
    438 #define LINK_REGNUM         21
    439 #define GP_LAST_REGNUM      31
    440 #define GP_REGISTER_P(REGNO) \
    441   (((unsigned) (REGNO)) <= GP_LAST_REGNUM)
    442 
    443 #define MDB_REGNUM          32
    444 #define MDC_REGNUM          33
    445 
    446 #define FP_FIRST_REGNUM     34
    447 #define FP_LAST_REGNUM      49
    448 #define FP_RETURN_REGNUM    (FP_FIRST_REGNUM + 1)
    449 #define FP_REGISTER_P(REGNO) \
    450   (FP_FIRST_REGNUM <= (REGNO) && (REGNO) <= FP_LAST_REGNUM)
    451 
    452 #define FLAGS_REGNUM        50
    453 
    454 /* `FIXED_REGISTERS'
    455 
    456    An initializer that says which registers are used for fixed
    457    purposes all throughout the compiled code and are therefore not
    458    available for general allocation.  These would include the stack
    459    pointer, the frame pointer (except on machines where that can be
    460    used as a general register when no frame pointer is needed), the
    461    program counter on machines where that is considered one of the
    462    addressable registers, and any other numbered register with a
    463    standard use.
    464 
    465    This information is expressed as a sequence of numbers, separated
    466    by commas and surrounded by braces.  The Nth number is 1 if
    467    register N is fixed, 0 otherwise.
    468 
    469    The table initialized from this macro, and the table initialized by
    470    the following one, may be overridden at run time either
    471    automatically, by the actions of the macro
    472    `CONDITIONAL_REGISTER_USAGE', or by the user with the command
    473    options `-ffixed-REG', `-fcall-used-REG' and `-fcall-saved-REG'.
    474 
    475    r0 and f0 are immutable registers hardwired to 0.
    476    r21 is the link register used for procedure linkage.
    477    r23 is the stack pointer register.
    478    r29 and r30 hold the interrupt context.
    479    mdc is a read-only register because the writemdc instruction
    480    terminates all the operations of the EAM on the GR6.  */
    481 #define FIXED_REGISTERS  \
    482  { 1, 0, 0, 0, 0, 0, 0, 0, /* r0 .. r7 */      \
    483    0, 0, 0, 0, 0, 0, 0, 0, /* r8 .. r15 */     \
    484    0, 0, 0, 0, 0, 1, 0, 1, /* r16 .. r23 */    \
    485    0, 0, 0, 0, 0, 1, 1, 0, /* r24 .. r31 */    \
    486    0, 1,                   /* mdb, mdc */      \
    487    1, 0, 0, 0, 0, 0, 0, 0, /* f0 .. f7 */      \
    488    0, 0, 0, 0, 0, 0, 0, 0, /* f8 .. f15 */     \
    489    1, 1, 1 }               /* flags, arg, frame */
    490 
    491 /* `CALL_USED_REGISTERS'
    492 
    493    Like `FIXED_REGISTERS' but has 1 for each register that is
    494    clobbered (in general) by function calls as well as for fixed
    495    registers.  This macro therefore identifies the registers that are
    496    not available for general allocation of values that must live
    497    across function calls.
    498 
    499    If a register has 0 in `CALL_USED_REGISTERS', the compiler
    500    automatically saves it on function entry and restores it on
    501    function exit, if the register is used within the function.  */
    502 #define CALL_USED_REGISTERS \
    503  { 1, 1, 1, 1, 1, 1, 1, 1, /* r0 .. r7 */      \
    504    1, 1, 1, 0, 0, 0, 0, 0, /* r8 .. r15 */     \
    505    0, 0, 0, 0, 1, 1, 0, 1, /* r16 .. r23 */    \
    506    1, 1, 1, 1, 1, 1, 1, 1, /* r24 .. r31 */    \
    507    1, 1,                   /* mdb, mdc */      \
    508    1, 1, 1, 1, 1, 1, 1, 1, /* f0 .. f7 */      \
    509    1, 0, 0, 0, 0, 0, 0, 0, /* f8 .. f15 */     \
    510    1, 1, 1 }               /* flags, arg, frame */
    511 
    512 /* Like `CALL_USED_REGISTERS' except this macro doesn't require that
    513    the entire set of `FIXED_REGISTERS' be included.
    514    (`CALL_USED_REGISTERS' must be a superset of `FIXED_REGISTERS').
    515    This macro is optional.  If not specified, it defaults to the value
    516    of `CALL_USED_REGISTERS'.  */
    517 #define CALL_REALLY_USED_REGISTERS  \
    518  { 0, 1, 1, 1, 1, 1, 1, 1, /* r0 .. r7 */      \
    519    1, 1, 1, 0, 0, 0, 0, 0, /* r8 .. r15 */     \
    520    0, 0, 0, 0, 1, 0, 0, 0, /* r16 .. r23 */    \
    521    1, 1, 1, 1, 1, 0, 0, 1, /* r24 .. r31 */    \
    522    1, 1,                   /* mdb, mdc */      \
    523    1, 1, 1, 1, 1, 1, 1, 1, /* f0 .. f7 */      \
    524    1, 0, 0, 0, 0, 0, 0, 0, /* f8 .. f15 */     \
    525    1, 0, 0 }               /* flags, arg, frame */
    526 
    527 /* `REG_ALLOC_ORDER'
    528 
    529    If defined, an initializer for a vector of integers, containing the
    530    numbers of hard registers in the order in which GCC should prefer
    531    to use them (from most preferred to least).
    532 
    533    If this macro is not defined, registers are used lowest numbered
    534    first (all else being equal).  */
    535 #define REG_ALLOC_ORDER \
    536  { 10, 9, 8, 7, 6, 5, 4, 3, 2, 1,          /* r10 .. r1 */   \
    537    11, 12, 13, 14, 15, 16, 17, 18, 19, 20, /* r11 .. r20 */  \
    538    22,                                     /* fp */          \
    539    24, 25, 26, 27, 28,                     /* r24 .. r28 */  \
    540    31,                                     /* r31 */         \
    541    32, 33,                                 /* mdb, mdc */    \
    542    42, 41, 40, 39, 38, 37, 36, 35,         /* f8 .. f1 */    \
    543    43, 44, 45, 46, 47, 48, 49,             /* f9 .. f15 */   \
    544    21, 23,                                 /* lr, sp */      \
    545    29, 30,                                 /* r29, r30 */    \
    546    50, 51, 52,                             /* flags, arg, frame */ \
    547    0, 34 }                                 /* r0, f0 */
    548 
    549 /* `HARD_REGNO_RENAME_OK (OLD_REG, NEW_REG)'
    550 
    551    A C expression which is nonzero if hard register NEW_REG can be
    552    considered for use as a rename register for hard register OLD_REG. */
    553 #define HARD_REGNO_RENAME_OK(OLD_REG, NEW_REG) \
    554   visium_hard_regno_rename_ok (OLD_REG, NEW_REG)
    555 
    556 /* Register Classes
    557 
    558    On many machines, the numbered registers are not all equivalent.
    559    For example, certain registers may not be allowed for indexed
    560    addressing; certain registers may not be allowed in some
    561    instructions.  These machine restrictions are described to the
    562    compiler using "register classes".
    563 
    564    `enum reg_class'
    565 
    566    An enumeral type that must be defined with all the register class
    567    names as enumeral values.  `NO_REGS' must be first.  `ALL_REGS'
    568    must be the last register class, followed by one more enumeral
    569    value, `LIM_REG_CLASSES', which is not a register class but rather
    570    tells how many classes there are.
    571 
    572    Each register class has a number, which is the value of casting the
    573    class name to type `int'.  The number serves as an index in many of
    574    the tables described below. */
    575 
    576 enum reg_class
    577 {
    578   NO_REGS,
    579   MDB,
    580   MDC,
    581   FP_REGS,
    582   FLAGS,
    583   R1,
    584   R2,
    585   R3,
    586   SIBCALL_REGS,
    587   LOW_REGS,
    588   GENERAL_REGS,
    589   ALL_REGS,
    590   LIM_REG_CLASSES
    591 };
    592 
    593 /* `N_REG_CLASSES'
    594 
    595    The number of distinct register classes, defined as follows.  */
    596 #define N_REG_CLASSES (int) LIM_REG_CLASSES
    597 
    598 /* `REG_CLASS_NAMES'
    599 
    600    An initializer containing the names of the register classes as C
    601    string constants.  These names are used in writing some of the
    602    debugging dumps. */
    603 #define REG_CLASS_NAMES \
    604  {"NO_REGS", "MDB", "MDC", "FP_REGS", "FLAGS", "R1", "R2", "R3", \
    605   "SIBCALL_REGS", "LOW_REGS", "GENERAL_REGS", "ALL_REGS"}
    606 
    607 /* `REG_CLASS_CONTENTS'
    608 
    609    An initializer containing the contents of the register classes, as
    610    integers which are bit masks.  The Nth integer specifies the
    611    contents of class N.  The way the integer MASK is interpreted is
    612    that register R is in the class if `MASK & (1 << R)' is 1.
    613 
    614    When the machine has more than 32 registers, an integer does not
    615    suffice.  Then the integers are replaced by sub-initializers,
    616    braced groupings containing several integers.  Each sub-initializer
    617    must be suitable as an initializer for the type `HARD_REG_SET'
    618    which is defined in `hard-reg-set.h'. */
    619 #define REG_CLASS_CONTENTS {                     \
    620     {0x00000000, 0x00000000}, /* NO_REGS */      \
    621     {0x00000000, 0x00000001}, /* MDB */          \
    622     {0x00000000, 0x00000002}, /* MDC */          \
    623     {0x00000000, 0x0003fffc}, /* FP_REGS */      \
    624     {0x00000000, 0x00040000}, /* FLAGS */        \
    625     {0x00000002, 0x00000000}, /* R1 */           \
    626     {0x00000004, 0x00000000}, /* R2 */           \
    627     {0x00000008, 0x00000000}, /* R3 */           \
    628     {0x000005ff, 0x00000000}, /* SIBCALL_REGS */ \
    629     {0x1fffffff, 0x00000000}, /* LOW_REGS */     \
    630     {0xffffffff, 0x00180000}, /* GENERAL_REGS */ \
    631     {0xffffffff, 0x001fffff}} /* ALL_REGS */
    632 
    633 /* `REGNO_REG_CLASS (REGNO)'
    634 
    635    A C expression whose value is a register class containing hard
    636    register REGNO.  In general there is more than one such class;
    637    choose a class which is "minimal", meaning that no smaller class
    638    also contains the register. */
    639 #define REGNO_REG_CLASS(REGNO)                    \
    640   ((REGNO) == MDB_REGNUM ? MDB :                  \
    641    (REGNO) == MDC_REGNUM ? MDC :                  \
    642    FP_REGISTER_P (REGNO) ? FP_REGS :              \
    643    (REGNO) == FLAGS_REGNUM ? FLAGS :              \
    644    (REGNO) == 1 ? R1 :                            \
    645    (REGNO) == 2 ? R2 :                            \
    646    (REGNO) == 3 ? R3 :                            \
    647    (REGNO) <= 8 || (REGNO) == 10 ? SIBCALL_REGS : \
    648    (REGNO) <= 28 ? LOW_REGS :                     \
    649    GENERAL_REGS)
    650 
    651 /* `BASE_REG_CLASS'
    652 
    653    A macro whose definition is the name of the class to which a valid
    654    base register must belong.  A base register is one used in an
    655    address which is the register value plus a displacement. */
    656 #define BASE_REG_CLASS GENERAL_REGS
    657 
    658 #define BASE_REGISTER_P(REGNO)        \
    659   (GP_REGISTER_P (REGNO)              \
    660    || (REGNO) == ARG_POINTER_REGNUM   \
    661    || (REGNO) == FRAME_POINTER_REGNUM)
    662 
    663 /* `INDEX_REG_CLASS'
    664 
    665    A macro whose definition is the name of the class to which a valid
    666    index register must belong.  An index register is one used in an
    667    address where its value is either multiplied by a scale factor or
    668    added to another register (as well as added to a displacement). */
    669 #define INDEX_REG_CLASS NO_REGS
    670 
    671 /* `REGNO_OK_FOR_BASE_P (NUM)'
    672 
    673    A C expression which is nonzero if register number NUM is suitable
    674    for use as a base register in operand addresses.  It may be either
    675    a suitable hard register or a pseudo register that has been
    676    allocated such a hard register. */
    677 #define REGNO_OK_FOR_BASE_P(REGNO) \
    678   (BASE_REGISTER_P (REGNO) || BASE_REGISTER_P ((unsigned)reg_renumber[REGNO]))
    679 
    680 /* `REGNO_OK_FOR_INDEX_P (NUM)'
    681 
    682    A C expression which is nonzero if register number NUM is suitable
    683    for use as an index register in operand addresses.  It may be
    684    either a suitable hard register or a pseudo register that has been
    685    allocated such a hard register.
    686 
    687    The difference between an index register and a base register is
    688    that the index register may be scaled.  If an address involves the
    689    sum of two registers, neither one of them scaled, then either one
    690    may be labeled the "base" and the other the "index"; but whichever
    691    labeling is used must fit the machine's constraints of which
    692    registers may serve in each capacity.  The compiler will try both
    693    labelings, looking for one that is valid, and will reload one or
    694    both registers only if neither labeling works. */
    695 #define REGNO_OK_FOR_INDEX_P(REGNO) 0
    696 
    697 /* `PREFERRED_RELOAD_CLASS (X, CLASS)'
    698 
    699    A C expression that places additional restrictions on the register
    700    class to use when it is necessary to copy value X into a register
    701    in class CLASS.  The value is a register class; perhaps CLASS, or
    702    perhaps another, smaller class.
    703 
    704    Sometimes returning a more restrictive class makes better code.
    705    For example, on the 68000, when X is an integer constant that is in
    706    range for a `moveq' instruction, the value of this macro is always
    707    `DATA_REGS' as long as CLASS includes the data registers.
    708    Requiring a data register guarantees that a `moveq' will be used.
    709 
    710    If X is a `const_double', by returning `NO_REGS' you can force X
    711    into a memory constant.  This is useful on certain machines where
    712    immediate floating values cannot be loaded into certain kinds of
    713    registers. */
    714 #define PREFERRED_RELOAD_CLASS(X,CLASS) CLASS
    715 
    716 #define CLASS_MAX_NREGS(CLASS, MODE)    \
    717   ((CLASS) == MDB ?                     \
    718   ((GET_MODE_SIZE (MODE) + 2 * UNITS_PER_WORD - 1) / (2 * UNITS_PER_WORD)) \
    719   : ((GET_MODE_SIZE (MODE) + UNITS_PER_WORD - 1) / UNITS_PER_WORD))
    720 
    721 /* Stack Layout and Calling Conventions
    722 
    723    Basic Stack Layout
    724 
    725    `STACK_GROWS_DOWNWARD'
    726    Define this macro if pushing a word onto the stack moves the stack
    727    pointer to a smaller address.  */
    728 #define STACK_GROWS_DOWNWARD 1
    729 
    730 /* `FIRST_PARM_OFFSET (FUNDECL)'
    731 
    732    Offset from the argument pointer register to the first argument's
    733    address.  On some machines it may depend on the data type of the
    734    function.
    735 
    736    If `ARGS_GROW_DOWNWARD', this is the offset to the location above
    737    the first argument's address. */
    738 #define FIRST_PARM_OFFSET(FNDECL) 0
    739 
    740 /* `DYNAMIC_CHAIN_ADDRESS (FRAMEADDR)'
    741 
    742    A C expression whose value is RTL representing the address in a
    743    stack frame where the pointer to the caller's frame is stored.
    744    Assume that FRAMEADDR is an RTL expression for the address of the
    745    stack frame itself.
    746 
    747    If you don't define this macro, the default is to return the value
    748    of FRAMEADDR--that is, the stack frame address is also the address
    749    of the stack word that points to the previous frame. */
    750 #define DYNAMIC_CHAIN_ADDRESS(FRAMEADDR) \
    751   visium_dynamic_chain_address (FRAMEADDR)
    752 
    753 /* `RETURN_ADDR_RTX (COUNT, FRAMEADDR)'
    754 
    755    A C expression whose value is RTL representing the value of the
    756    return address for the frame COUNT steps up from the current frame,
    757    after the prologue.  FRAMEADDR is the frame pointer of the COUNT
    758    frame, or the frame pointer of the COUNT - 1 frame if
    759    `RETURN_ADDR_IN_PREVIOUS_FRAME' is defined.
    760 
    761    The value of the expression must always be the correct address when
    762    COUNT is zero, but may be `NULL_RTX' if there is not way to
    763    determine the return address of other frames.  */
    764 #define RETURN_ADDR_RTX(COUNT,FRAMEADDR) \
    765   visium_return_addr_rtx (COUNT, FRAMEADDR)
    766 
    767 /* Exception Handling
    768 
    769    `EH_RETURN_DATA_REGNO'
    770 
    771    A C expression whose value is the Nth register number used for data
    772    by exception handlers or INVALID_REGNUM if fewer than N registers
    773    are available.
    774 
    775    The exception handling library routines communicate with the
    776    exception handlers via a set of agreed upon registers. */
    777 #define EH_RETURN_DATA_REGNO(N) ((N) < 4 ? (N) + 11 : INVALID_REGNUM)
    778 #define EH_RETURN_STACKADJ_RTX gen_rtx_REG (SImode, 8)
    779 #define EH_RETURN_HANDLER_RTX visium_eh_return_handler_rtx ()
    780 
    781 /* Registers That Address the Stack Frame
    782 
    783    This discusses registers that address the stack frame.
    784 
    785    `STACK_POINTER_REGNUM'
    786 
    787    The register number of the stack pointer register, which must also
    788    be a fixed register according to `FIXED_REGISTERS'.  On most
    789    machines, the hardware determines which register this is. */
    790 #define STACK_POINTER_REGNUM 23
    791 
    792 /* `FRAME_POINTER_REGNUM'
    793 
    794    The register number of the frame pointer register, which is used to
    795    access automatic variables in the stack frame.  On some machines,
    796    the hardware determines which register this is.  On other machines,
    797    you can choose any register you wish for this purpose. */
    798 #define FRAME_POINTER_REGNUM 52
    799 
    800 /* `HARD_FRAME_POINTER_REGNUM'
    801 
    802    On some machines the offset between the frame pointer and starting
    803    offset of the automatic variables is not known until after register
    804    allocation has been done (for example, because the saved registers
    805    are between these two locations).  On those machines, define
    806    `FRAME_POINTER_REGNUM' the number of a special, fixed register to
    807    be used internally until the offset is known, and define
    808    `HARD_FRAME_POINTER_REGNUM' to be the actual hard register number
    809    used for the frame pointer.  */
    810 #define HARD_FRAME_POINTER_REGNUM 22
    811 
    812 /* `ARG_POINTER_REGNUM'
    813 
    814    The register number of the arg pointer register, which is used to
    815    access the function's argument list.  On some machines, this is the
    816    same as the frame pointer register.  On some machines, the hardware
    817    determines which register this is.  On other machines, you can
    818    choose any register you wish for this purpose.  If this is not the
    819    same register as the frame pointer register, then you must mark it
    820    as a fixed register according to `FIXED_REGISTERS', or arrange to
    821    be able to eliminate it (*note Elimination::.).  */
    822 #define ARG_POINTER_REGNUM 51
    823 
    824 /* `STATIC_CHAIN_REGNUM'
    825    `STATIC_CHAIN_INCOMING_REGNUM'
    826 
    827    Register numbers used for passing a function's static chain
    828    pointer.  If register windows are used, the register number as seen
    829    by the called function is `STATIC_CHAIN_INCOMING_REGNUM', while the
    830    register number as seen by the calling function is
    831    `STATIC_CHAIN_REGNUM'.  If these registers are the same,
    832    `STATIC_CHAIN_INCOMING_REGNUM' need not be defined.
    833 
    834    The static chain register need not be a fixed register.
    835 
    836    If the static chain is passed in memory, these macros should not be
    837    defined; instead, the next two macros should be defined. */
    838 #define STATIC_CHAIN_REGNUM 20
    839 
    840 /* `ELIMINABLE_REGS'
    841 
    842    If defined, this macro specifies a table of register pairs used to
    843    eliminate unneeded registers that point into the stack frame.  If
    844    it is not defined, the only elimination attempted by the compiler
    845    is to replace references to the frame pointer with references to
    846    the stack pointer.
    847 
    848    The definition of this macro is a list of structure
    849    initializations, each of which specifies an original and
    850    replacement register.
    851 
    852    On some machines, the position of the argument pointer is not known
    853    until the compilation is completed.  In such a case, a separate
    854    hard register must be used for the argument pointer.  This register
    855    can be eliminated by replacing it with either the frame pointer or
    856    the argument pointer, depending on whether or not the frame pointer
    857    has been eliminated.
    858 
    859    Note that the elimination of the argument pointer with the stack
    860    pointer is specified first since that is the preferred elimination.  */
    861 #define ELIMINABLE_REGS				     \
    862 {{ ARG_POINTER_REGNUM, STACK_POINTER_REGNUM},	     \
    863  { ARG_POINTER_REGNUM, HARD_FRAME_POINTER_REGNUM},   \
    864  { FRAME_POINTER_REGNUM, STACK_POINTER_REGNUM},	     \
    865  { FRAME_POINTER_REGNUM, HARD_FRAME_POINTER_REGNUM}}
    866 
    867 /* `INITIAL_ELIMINATION_OFFSET (FROM-REG, TO-REG, OFFSET-VAR)'
    868 
    869    This macro returns the initial difference between the specified pair
    870    of registers.  */
    871 #define INITIAL_ELIMINATION_OFFSET(FROM, TO, OFFSET) \
    872   (OFFSET = visium_initial_elimination_offset (FROM, TO))
    873 
    874 /* Passing Function Arguments on the Stack
    875 
    876    The macros in this section control how arguments are passed on the
    877    stack.  See the following section for other macros that control
    878    passing certain arguments in registers.
    879 
    880    Passing Arguments in Registers
    881 
    882    This section describes the macros which let you control how various
    883    types of arguments are passed in registers or how they are arranged
    884    in the stack.
    885 
    886    Define the general purpose, and floating point registers used for
    887    passing arguments */
    888 #define MAX_ARGS_IN_GP_REGISTERS 8
    889 #define GP_ARG_FIRST 1
    890 #define GP_ARG_LAST (GP_ARG_FIRST + MAX_ARGS_IN_GP_REGISTERS - 1)
    891 #define MAX_ARGS_IN_FP_REGISTERS 8
    892 #define FP_ARG_FIRST (FP_FIRST_REGNUM + 1)
    893 #define FP_ARG_LAST (FP_ARG_FIRST + MAX_ARGS_IN_FP_REGISTERS - 1)
    894 
    895 /* Define a data type for recording info about an argument list during the
    896 processing of that argument list. */
    897 
    898 struct visium_args
    899 {
    900   /* The count of general registers used */
    901   int grcount;
    902   /* The count of floating registers used */
    903   int frcount;
    904   /* The number of stack words used by named arguments */
    905   int stack_words;
    906 };
    907 
    908 /* `CUMULATIVE_ARGS'
    909 
    910    A C type for declaring a variable that is used as the first
    911    argument of `FUNCTION_ARG' and other related values.  For some
    912    target machines, the type `int' suffices and can hold the number of
    913    bytes of argument so far.
    914 
    915    There is no need to record in `CUMULATIVE_ARGS' anything about the
    916    arguments that have been passed on the stack.  The compiler has
    917    other variables to keep track of that.  For target machines on
    918    which all arguments are passed on the stack, there is no need to
    919    store anything in `CUMULATIVE_ARGS'; however, the data structure
    920    must exist and should not be empty, so use `int'. */
    921 #define CUMULATIVE_ARGS struct visium_args
    922 
    923 #define INIT_CUMULATIVE_ARGS(CUM,FNTYPE,LIBNAME,FNDECL,N_NAMED_ARGS) \
    924   do {                        \
    925        (CUM).grcount = 0;     \
    926        (CUM).frcount = 0;     \
    927        (CUM).stack_words = 0; \
    928      } while (0)
    929 
    930 /* `FUNCTION_ARG_REGNO_P (REGNO)'
    931 
    932    A C expression that is nonzero if REGNO is the number of a hard
    933    register in which function arguments are sometimes passed.  This
    934    does *not* include implicit arguments such as the static chain and
    935    the structure-value address.  On many machines, no registers can be
    936    used for this purpose since all function arguments are pushed on
    937    the stack. */
    938 #define FUNCTION_ARG_REGNO_P(N)               	\
    939   ((GP_ARG_FIRST <= (N) && (N) <= GP_ARG_LAST)	\
    940    || (TARGET_FPU && FP_ARG_FIRST <= (N) && (N) <= FP_ARG_LAST))
    941 
    942 /* `FUNCTION_VALUE_REGNO_P (REGNO)'
    943 
    944    A C expression that is nonzero if REGNO is the number of a hard
    945    register in which the values of called function may come back.
    946 
    947    A register whose use for returning values is limited to serving as
    948    the second of a pair (for a value of type `double', say) need not
    949    be recognized by this macro. If the machine has register windows,
    950    so that the caller and the called function use different registers
    951    for the return value, this macro should recognize only the caller's
    952    register numbers. */
    953 #define FUNCTION_VALUE_REGNO_P(N) \
    954   ((N) == RETURN_REGNUM || (TARGET_FPU && (N) == FP_RETURN_REGNUM))
    955 
    956 /* How Large Values Are Returned
    957 
    958    When a function value's mode is `BLKmode' (and in some other
    959    cases), the value is not returned according to `FUNCTION_VALUE'.
    960    Instead, the caller passes the address of a block of memory in
    961    which the value should be stored.  This address is called the
    962    "structure value address".
    963 
    964    This section describes how to control returning structure values in
    965    memory.
    966 
    967    `DEFAULT_PCC_STRUCT_RETURN'
    968 
    969    Define this macro to be 1 if all structure and union return values
    970    must be in memory.  Since this results in slower code, this should
    971    be defined only if needed for compatibility with other compilers or
    972    with an ABI.  If you define this macro to be 0, then the
    973    conventions used for structure and union return values are decided
    974    by the `RETURN_IN_MEMORY' macro.
    975 
    976    If not defined, this defaults to the value 1. */
    977 #define DEFAULT_PCC_STRUCT_RETURN 0
    978 
    979 /* Caller-Saves Register Allocation
    980 
    981    If you enable it, GNU CC can save registers around function calls.
    982    This makes it possible to use call-clobbered registers to hold
    983    variables that must live across calls.
    984 
    985    Function Entry and Exit
    986 
    987    This section describes the macros that output function entry
    988    ("prologue") and exit ("epilogue") code.
    989 
    990    `EXIT_IGNORE_STACK'
    991 
    992    Define this macro as a C expression that is nonzero if the return
    993    instruction or the function epilogue ignores the value of the stack
    994    pointer; in other words, if it is safe to delete an instruction to
    995    adjust the stack pointer before a return from the function.
    996 
    997    Note that this macro's value is relevant only for functions for
    998    which frame pointers are maintained.  It is never safe to delete a
    999    final stack adjustment in a function that has no frame pointer, and
   1000    the compiler knows this regardless of `EXIT_IGNORE_STACK'. */
   1001 #define EXIT_IGNORE_STACK 1
   1002 
   1003 /* `EPILOGUE_USES (REGNO)'
   1004 
   1005    Define this macro as a C expression that is nonzero for registers
   1006    are used by the epilogue or the `return' pattern.  The stack and
   1007    frame pointer registers are already be assumed to be used as
   1008    needed. */
   1009 #define EPILOGUE_USES(REGNO) visium_epilogue_uses (REGNO)
   1010 
   1011 /* Generating Code for Profiling
   1012 
   1013    These macros will help you generate code for profiling. */
   1014 
   1015 #define PROFILE_HOOK(LABEL) visium_profile_hook ()
   1016 #define FUNCTION_PROFILER(FILE, LABELNO) do {} while (0)
   1017 #define NO_PROFILE_COUNTERS 1
   1018 
   1019 /* Trampolines for Nested Functions
   1020 
   1021    A trampoline is a small piece of code that is created at run time
   1022    when the address of a nested function is taken. It normally resides
   1023    on the stack, in the stack frame of the containing function. These
   1024    macros tell GCC how to generate code to allocate and initialize a
   1025    trampoline.
   1026 
   1027    The instructions in the trampoline must do two things: load a
   1028    constant address into the static chain register, and jump to the
   1029    real address of the nested function. On CISC machines such as the
   1030    m68k, this requires two instructions, a move immediate and a
   1031    jump. Then the two addresses exist in the trampoline as word-long
   1032    immediate operands. On RISC machines, it is often necessary to load
   1033    each address into a register in two parts. Then pieces of each
   1034    address form separate immediate operands.
   1035 
   1036    The code generated to initialize the trampoline must store the
   1037    variable parts--the static chain value and the function
   1038    address--into the immediate operands of the instructions. On a CISC
   1039    machine, this is simply a matter of copying each address to a
   1040    memory reference at the proper offset from the start of the
   1041    trampoline. On a RISC machine, it may be necessary to take out
   1042    pieces of the address and store them separately.
   1043 
   1044    On the Visium, the trampoline is
   1045 
   1046 	moviu	r9,%u FUNCTION
   1047 	movil	r9,%l FUNCTION
   1048 	[nop]
   1049 	moviu	r20,%u STATIC
   1050 	bra	tr,r9,r0
   1051 	 movil	r20,%l STATIC
   1052 
   1053     A difficulty is setting the correct instruction parity at run time.
   1054 
   1055 
   1056     TRAMPOLINE_SIZE
   1057     A C expression for the size in bytes of the trampoline, as an integer. */
   1058 #define TRAMPOLINE_SIZE (visium_cpu == PROCESSOR_GR6 ? 24 : 20)
   1059 
   1060 /* Alignment required for trampolines, in bits.  */
   1061 #define TRAMPOLINE_ALIGNMENT (visium_cpu == PROCESSOR_GR6 ? 64 : 32)
   1062 
   1063 /* Implicit calls to library routines
   1064 
   1065    Avoid calling library routines (sqrtf) just to set `errno' to EDOM */
   1066 #define TARGET_EDOM 33
   1067 
   1068 /* Addressing Modes
   1069 
   1070    `MAX_REGS_PER_ADDRESS'
   1071 
   1072    A number, the maximum number of registers that can appear in a
   1073    valid memory address.  Note that it is up to you to specify a value
   1074    equal to the maximum number that `TARGET_LEGITIMATE_ADDRESS_P' would
   1075    ever accept.  */
   1076 #define MAX_REGS_PER_ADDRESS 1
   1077 
   1078 /* `LEGITIMIZE_RELOAD_ADDRESS (X, MODE, OPNUM, TYPE, IND_LEVELS, WIN)'
   1079 
   1080    A C compound statement that attempts to replace X, which is an
   1081    address that needs reloading, with a valid memory address for an
   1082    operand of mode MODE.  WIN will be a C statement label elsewhere
   1083    in the code.  It is not necessary to define this macro, but it
   1084    might be useful for performance reasons.  */
   1085 #define LEGITIMIZE_RELOAD_ADDRESS(AD, MODE, OPNUM, TYPE, IND, WIN) 	\
   1086 do									\
   1087 {									\
   1088   rtx new_x = visium_legitimize_reload_address ((AD), (MODE), (OPNUM),	\
   1089 					(int) (TYPE), (IND));		\
   1090   if (new_x)								\
   1091     {									\
   1092       (AD) = new_x;							\
   1093       goto WIN;								\
   1094     }									\
   1095 } while (0)
   1096 
   1097 /* Given a comparison code (EQ, NE, etc.) and the operands of a COMPARE,
   1098    return the mode to be used for the comparison.  */
   1099 #define SELECT_CC_MODE(OP,X,Y) visium_select_cc_mode ((OP), (X), (Y))
   1100 
   1101 /* Return nonzero if MODE implies a floating point inequality can be
   1102    reversed.  For Visium this is always true because we have a full
   1103    compliment of ordered and unordered comparisons, but until generic
   1104    code knows how to reverse it correctly we keep the old definition.  */
   1105 #define REVERSIBLE_CC_MODE(MODE) ((MODE) != CCFPEmode && (MODE) != CCFPmode)
   1106 
   1107 /* `BRANCH_COST'
   1108 
   1109    A C expression for the cost of a branch instruction.  A value of 1
   1110    is the default; other values are interpreted relative to that.  */
   1111 #define BRANCH_COST(A,B)  10
   1112 
   1113 /* Override BRANCH_COST heuristics for complex logical ops.  */
   1114 #define LOGICAL_OP_NON_SHORT_CIRCUIT 0
   1115 
   1116 /* `SLOW_BYTE_ACCESS'
   1117 
   1118    Define this macro as a C expression which is nonzero if accessing
   1119    less than a word of memory (i.e. a `char' or a `short') is no
   1120    faster than accessing a word of memory, i.e., if such access
   1121    require more than one instruction or if there is no difference in
   1122    cost between byte and (aligned) word loads.
   1123 
   1124    When this macro is not defined, the compiler will access a field by
   1125    finding the smallest containing object; when it is defined, a
   1126    fullword load will be used if alignment permits.  Unless bytes
   1127    accesses are faster than word accesses, using word accesses is
   1128    preferable since it may eliminate subsequent memory access if
   1129    subsequent accesses occur to other fields in the same word of the
   1130    structure, but to different bytes. */
   1131 #define SLOW_BYTE_ACCESS 0
   1132 
   1133 /* `MOVE_RATIO (SPEED)`
   1134 
   1135    The threshold of number of scalar memory-to-memory move insns,
   1136    _below_ which a sequence of insns should be generated instead of a
   1137    string move insn or a library call.  Increasing the value will
   1138    always make code faster, but eventually incurs high cost in
   1139    increased code size.
   1140 
   1141    Since we have a movmemsi pattern, the default MOVE_RATIO is 2, which
   1142    is too low given that movmemsi will invoke a libcall.  */
   1143 #define MOVE_RATIO(speed) ((speed) ? 9 : 3)
   1144 
   1145 /* `CLEAR_RATIO (SPEED)`
   1146 
   1147    The threshold of number of scalar move insns, _below_ which a
   1148    sequence of insns should be generated to clear memory instead of a
   1149    string clear insn or a library call.  Increasing the value will
   1150    always make code faster, but eventually incurs high cost in
   1151    increased code size.
   1152 
   1153    Since we have a setmemsi pattern, the default CLEAR_RATIO is 2, which
   1154    is too low given that setmemsi will invoke a libcall.  */
   1155 #define CLEAR_RATIO(speed) ((speed) ? 13 : 5)
   1156 
   1157 /* `MOVE_MAX'
   1158 
   1159    The maximum number of bytes that a single instruction can move
   1160    quickly between memory and registers or between two memory
   1161    locations. */
   1162 #define MOVE_MAX 4
   1163 
   1164 /* `MAX_MOVE_MAX'
   1165 
   1166    The maximum number of bytes that a single instruction can move
   1167    quickly between memory and registers or between two memory
   1168    locations.  If this is undefined, the default is `MOVE_MAX'.
   1169    Otherwise, it is the constant value that is the largest value that
   1170    `MOVE_MAX' can have at run-time. */
   1171 #define MAX_MOVE_MAX 4
   1172 
   1173 /* `SHIFT_COUNT_TRUNCATED'
   1174 
   1175    A C expression that is nonzero if on this machine the number of
   1176    bits actually used for the count of a shift operation is equal to
   1177    the number of bits needed to represent the size of the object being
   1178    shifted.  When this macro is non-zero, the compiler will assume
   1179    that it is safe to omit a sign-extend, zero-extend, and certain
   1180    bitwise `and' instructions that truncates the count of a shift
   1181    operation.  On machines that have instructions that act on
   1182    bitfields at variable positions, which may include `bit test'
   1183    instructions, a nonzero `SHIFT_COUNT_TRUNCATED' also enables
   1184    deletion of truncations of the values that serve as arguments to
   1185    bitfield instructions. */
   1186 #define SHIFT_COUNT_TRUNCATED 0
   1187 
   1188 /* `STORE_FLAG_VALUE'
   1189 
   1190    A C expression describing the value returned by a comparison
   1191    operator with an integral mode and stored by a store-flag
   1192    instruction (`sCOND') when the condition is true.  This description
   1193    must apply to *all* the `sCOND' patterns and all the comparison
   1194    operators whose results have a `MODE_INT' mode. */
   1195 #define STORE_FLAG_VALUE 1
   1196 
   1197 /* `Pmode'
   1198 
   1199    An alias for the machine mode for pointers.  On most machines,
   1200    define this to be the integer mode corresponding to the width of a
   1201    hardware pointer; `SImode' on 32-bit machine or `DImode' on 64-bit
   1202    machines.  On some machines you must define this to be one of the
   1203    partial integer modes, such as `PSImode'.
   1204 
   1205    The width of `Pmode' must be at least as large as the value of
   1206    `POINTER_SIZE'.  If it is not equal, you must define the macro
   1207    `POINTERS_EXTEND_UNSIGNED' to specify how pointers are extended to
   1208    `Pmode'. */
   1209 #define Pmode SImode
   1210 
   1211 /* `FUNCTION_MODE'
   1212 
   1213    An alias for the machine mode used for memory references to
   1214    functions being called, in `call' RTL expressions.  On most
   1215    machines this should be `QImode'. */
   1216 #define FUNCTION_MODE SImode
   1217 
   1218 /* Dividing the Output into Sections (Texts, Data, ...)
   1219 
   1220    An object file is divided into sections containing different types
   1221    of data.  In the most common case, there are three sections: the
   1222    "text section", which holds instructions and read-only data; the
   1223    "data section", which holds initialized writable data; and the "bss
   1224    section", which holds uninitialized data.  Some systems have other
   1225    kinds of sections.
   1226 
   1227    `TEXT_SECTION_ASM_OP'
   1228 
   1229    A C expression whose value is a string containing the assembler
   1230    operation that should precede instructions and read-only data.
   1231    Normally `".text"' is right. */
   1232 #define TEXT_SECTION_ASM_OP "\t.text"
   1233 
   1234 /* `DATA_SECTION_ASM_OP'
   1235 
   1236    A C expression whose value is a string containing the assembler
   1237    operation to identify the following data as writable initialized
   1238    data.  Normally `".data"' is right. */
   1239 #define DATA_SECTION_ASM_OP "\t.data"
   1240 
   1241 /* `BSS_SECTION_ASM_OP'
   1242 
   1243    If defined, a C expression whose value is a string containing the
   1244    assembler operation to identify the following data as uninitialized
   1245    global data.  If not defined, and neither `ASM_OUTPUT_BSS' nor
   1246    `ASM_OUTPUT_ALIGNED_BSS' are defined, uninitialized global data
   1247    will be output in the data section if `-fno-common' is passed,
   1248    otherwise `ASM_OUTPUT_COMMON' will be used.
   1249 
   1250    `EXTRA_SECTIONS'
   1251 
   1252    A list of names for sections other than the standard two, which are
   1253    `in_text' and `in_data'.  You need not define this macro on a
   1254    system with no other sections (that GCC needs to use).
   1255 
   1256    `EXTRA_SECTION_FUNCTIONS'
   1257 
   1258    One or more functions to be defined in `varasm.c'.  These functions
   1259    should do jobs analogous to those of `text_section' and
   1260    `data_section', for your additional sections.  Do not define this
   1261    macro if you do not define `EXTRA_SECTIONS'.
   1262 
   1263    `JUMP_TABLES_IN_TEXT_SECTION' Define this macro if jump tables (for
   1264    `tablejump' insns) should be output in the text section, along with
   1265    the assembler instructions.  Otherwise, the readonly data section
   1266    is used.
   1267 
   1268    This macro is irrelevant if there is no separate readonly data
   1269    section. */
   1270 #undef JUMP_TABLES_IN_TEXT_SECTION
   1271 
   1272 
   1273 /* The Overall Framework of an Assembler File
   1274 
   1275    This describes the overall framework of an assembler file.
   1276 
   1277    `ASM_COMMENT_START'
   1278 
   1279    A C string constant describing how to begin a comment in the target
   1280    assembler language.  The compiler assumes that the comment will end
   1281    at the end of the line. */
   1282 #define ASM_COMMENT_START ";"
   1283 
   1284 /* `ASM_APP_ON'
   1285 
   1286    A C string constant for text to be output before each `asm'
   1287    statement or group of consecutive ones.  Normally this is `"#APP"',
   1288    which is a comment that has no effect on most assemblers but tells
   1289    the GNU assembler that it must check the lines that follow for all
   1290    valid assembler constructs. */
   1291 #define ASM_APP_ON "#APP\n"
   1292 
   1293 /* `ASM_APP_OFF'
   1294 
   1295    A C string constant for text to be output after each `asm'
   1296    statement or group of consecutive ones.  Normally this is
   1297    `"#NO_APP"', which tells the GNU assembler to resume making the
   1298    time-saving assumptions that are valid for ordinary compiler
   1299    output. */
   1300 #define ASM_APP_OFF "#NO_APP\n"
   1301 
   1302 /* Output of Data
   1303 
   1304    This describes data output.
   1305 
   1306    Output and Generation of Labels
   1307 
   1308    This is about outputting labels.
   1309 
   1310    `ASM_OUTPUT_LABEL (STREAM, NAME)'
   1311 
   1312    A C statement (sans semicolon) to output to the stdio stream STREAM
   1313    the assembler definition of a label named NAME.  Use the expression
   1314    `assemble_name (STREAM, NAME)' to output the name itself; before
   1315    and after that, output the additional assembler syntax for defining
   1316    the name, and a newline. */
   1317 #define ASM_OUTPUT_LABEL(STREAM,NAME)     \
   1318   do { assemble_name (STREAM, NAME); fputs (":\n", STREAM); } while (0)
   1319 
   1320 /* Globalizing directive for a label */
   1321 #define GLOBAL_ASM_OP "\t.global "
   1322 
   1323 /* `ASM_OUTPUT_LABELREF (STREAM, NAME)'
   1324 
   1325    A C statement (sans semicolon) to output to the stdio stream STREAM
   1326    a reference in assembler syntax to a label named NAME.  This should
   1327    add `_' to the front of the name, if that is customary on your
   1328    operating system, as it is in most Berkeley Unix systems.  This
   1329    macro is used in `assemble_name'. */
   1330 #define ASM_OUTPUT_LABELREF(STREAM,NAME)  \
   1331   asm_fprintf (STREAM, "%U%s", NAME)
   1332 
   1333 /* Output of Assembler Instructions
   1334 
   1335    This describes assembler instruction output.
   1336 
   1337    `REGISTER_NAMES'
   1338 
   1339    A C initializer containing the assembler's names for the machine
   1340    registers, each one as a C string constant.  This is what
   1341    translates register numbers in the compiler into assembler
   1342    language. */
   1343 #define REGISTER_NAMES \
   1344  {"r0",  "r1",  "r2",  "r3",  "r4",  "r5",  "r6",  "r7",  \
   1345   "r8",  "r9",  "r10", "r11", "r12", "r13", "r14", "r15", \
   1346   "r16", "r17", "r18", "r19", "r20", "r21", "fp",  "sp",  \
   1347   "r24", "r25", "r26", "r27", "r28", "r29", "r30", "r31", \
   1348   "mdb", "mdc",                                           \
   1349   "f0",  "f1",  "f2",  "f3",  "f4",  "f5",  "f6",  "f7",  \
   1350   "f8",  "f9",  "f10", "f11", "f12", "f13", "f14", "f15", \
   1351   "flags","argp","sfp" }
   1352 
   1353 /* `ADDITIONAL_REGISTER_NAMES`
   1354 
   1355    If defined, a C initializer for an array of structures containing
   1356    a name and a register number.  This macro defines additional names
   1357    for hard registers, thus allowing the `asm' option in declarations
   1358    to refer to registers using alternate names.  */
   1359 #define ADDITIONAL_REGISTER_NAMES \
   1360   {{"r22", HARD_FRAME_POINTER_REGNUM}, {"r23", STACK_POINTER_REGNUM}}
   1361 
   1362 /* `REGISTER_PREFIX'
   1363    `LOCAL_LABEL_PREFIX'
   1364    `USER_LABEL_PREFIX'
   1365    `IMMEDIATE_PREFIX'
   1366 
   1367    If defined, C string expressions to be used for the `%R', `%L',
   1368    `%U', and `%I' options of `asm_fprintf' (see `final.c').  These are
   1369    useful when a single `md' file must support multiple assembler
   1370    formats.  In that case, the various `tm.h' files can define these
   1371    macros differently. */
   1372 #define REGISTER_PREFIX ""
   1373 #define LOCAL_LABEL_PREFIX "."
   1374 #define IMMEDIATE_PREFIX "#"
   1375 
   1376 /* `ASM_OUTPUT_REG_PUSH (STREAM, REGNO)'
   1377 
   1378    A C expression to output to STREAM some assembler code which will
   1379    push hard register number REGNO onto the stack.  The code need not
   1380    be optimal, since this macro is used only when profiling. */
   1381 #define ASM_OUTPUT_REG_PUSH(STREAM,REGNO)  \
   1382   asm_fprintf (STREAM, "\tsubi    sp,4\n\twrite.l (sp),%s\n", \
   1383                reg_names[REGNO])
   1384 
   1385 /* `ASM_OUTPUT_REG_POP (STREAM, REGNO)'
   1386 
   1387    A C expression to output to STREAM some assembler code which will
   1388    pop hard register number REGNO off of the stack.  The code need not
   1389    be optimal, since this macro is used only when profiling. */
   1390 #define ASM_OUTPUT_REG_POP(STREAM,REGNO)  \
   1391   asm_fprintf (STREAM, "\tread.l  %s,(sp)\n\taddi    sp,4\n", \
   1392                reg_names[REGNO])
   1393 
   1394 
   1395 /* Output of Dispatch Tables
   1396 
   1397    This concerns dispatch tables.
   1398 
   1399    `ASM_OUTPUT_ADDR_DIFF_ELT (STREAM, VALUE, REL)'
   1400 
   1401    A C statement to output to the stdio stream STREAM an assembler
   1402    pseudo-instruction to generate a difference between two labels.
   1403    VALUE and REL are the numbers of two internal labels.  The
   1404    definitions of these labels are output using
   1405    `ASM_OUTPUT_INTERNAL_LABEL', and they must be printed in the same
   1406    way here.
   1407 
   1408    You must provide this macro on machines where the addresses in a
   1409    dispatch table are relative to the table's own address.  If
   1410    defined, GNU CC will also use this macro on all machines when
   1411    producing PIC. */
   1412 #define ASM_OUTPUT_ADDR_DIFF_ELT(STREAM,BODY,VALUE,REL)  		\
   1413   switch (GET_MODE (BODY))						\
   1414     {									\
   1415     case E_SImode:							\
   1416       asm_fprintf ((STREAM), "\t.long\t%LL%d-%LL%d\n", (VALUE),(REL));	\
   1417       break;								\
   1418     case E_HImode:							\
   1419       asm_fprintf ((STREAM), "\t.word\t%LL%d-%LL%d\n", (VALUE),(REL));	\
   1420       break;								\
   1421     case E_QImode:							\
   1422       asm_fprintf ((STREAM), "\t.byte\t%LL%d-%LL%d\n", (VALUE),(REL));	\
   1423       break;								\
   1424     default:								\
   1425       break;								\
   1426     }
   1427 
   1428 /* `ASM_OUTPUT_ADDR_VEC_ELT (STREAM, VALUE)'
   1429 
   1430    This macro should be provided on machines where the addresses in a
   1431    dispatch table are absolute.
   1432 
   1433    The definition should be a C statement to output to the stdio
   1434    stream STREAM an assembler pseudo-instruction to generate a
   1435    reference to a label.  VALUE is the number of an internal label
   1436    whose definition is output using `ASM_OUTPUT_INTERNAL_LABEL'. */
   1437 #define ASM_OUTPUT_ADDR_VEC_ELT(STREAM, VALUE)  \
   1438   asm_fprintf (STREAM, "\t.long   %LL%d\n", VALUE)
   1439 
   1440 /* `ASM_OUTPUT_CASE_END (STREAM, NUM, TABLE)'
   1441 
   1442    Define this if something special must be output at the end of a
   1443    jump-table. The definition should be a C statement to be executed
   1444    after the assembler code for the table is written. It should write
   1445    the appropriate code to stdio stream STREAM. The argument TABLE is
   1446    the jump-table insn, and NUM is the label-number of the preceding
   1447    label.
   1448 
   1449    If this macro is not defined, nothing special is output at the end
   1450    of a jump table.
   1451 
   1452    Here we output a word of zero so that jump-tables can be seperated
   1453    in reverse assembly. */
   1454 #define ASM_OUTPUT_CASE_END(STREAM, NUM, TABLE) \
   1455   asm_fprintf (STREAM, "\t.long   0\n")
   1456 
   1457 /* Support subalignment values.  */
   1458 
   1459 #define SUBALIGN_LOG 3
   1460 
   1461 /* Assembler Commands for Alignment
   1462 
   1463    This describes commands for alignment.
   1464 
   1465    `ASM_OUTPUT_ALIGN_CODE (STREAM)'
   1466 
   1467    A C expression to output text to align the location counter in the
   1468    way that is desirable at a point in the code that is reached only
   1469    by jumping.
   1470 
   1471    This macro need not be defined if you don't want any special
   1472    alignment to be done at such a time.  Most machine descriptions do
   1473    not currently define the macro. */
   1474 #undef ASM_OUTPUT_ALIGN_CODE
   1475 
   1476 /* `ASM_OUTPUT_LOOP_ALIGN (STREAM)'
   1477 
   1478    A C expression to output text to align the location counter in the
   1479    way that is desirable at the beginning of a loop.
   1480 
   1481    This macro need not be defined if you don't want any special
   1482    alignment to be done at such a time.  Most machine descriptions do
   1483    not currently define the macro. */
   1484 #undef ASM_OUTPUT_LOOP_ALIGN
   1485 
   1486 /* `ASM_OUTPUT_ALIGN (STREAM, POWER)'
   1487 
   1488    A C statement to output to the stdio stream STREAM an assembler
   1489    command to advance the location counter to a multiple of 2 to the
   1490    POWER bytes.  POWER will be a C expression of type `int'. */
   1491 #define ASM_OUTPUT_ALIGN(STREAM,LOG)      \
   1492   if ((LOG) != 0)                       \
   1493     fprintf (STREAM, "\t.align  %d\n", (1 << (LOG)))
   1494 
   1495 /* `ASM_OUTPUT_MAX_SKIP_ALIGN (STREAM, POWER, MAX_SKIP)`
   1496 
   1497    A C statement to output to the stdio stream STREAM an assembler
   1498    command to advance the location counter to a multiple of 2 to the
   1499    POWER bytes, but only if MAX_SKIP or fewer bytes are needed to
   1500    satisfy the alignment request.  POWER and MAX_SKIP will be a C
   1501    expression of type `int'. */
   1502 #define ASM_OUTPUT_MAX_SKIP_ALIGN(STREAM,LOG,MAX_SKIP)			\
   1503   if ((LOG) != 0) {							\
   1504     if ((MAX_SKIP) == 0 || (MAX_SKIP) >= (1 << (LOG)) - 1)		\
   1505       fprintf ((STREAM), "\t.p2align %d\n", (LOG));			\
   1506     else								\
   1507       fprintf ((STREAM), "\t.p2align %d,,%d\n", (LOG), (MAX_SKIP));	\
   1508   }
   1509 
   1510 /* Controlling Debugging Information Format
   1511 
   1512    This describes how to specify debugging information.
   1513 
   1514     mda is known to GDB, but not to GCC. */
   1515 #define DBX_REGISTER_NUMBER(REGNO) \
   1516   ((REGNO) > MDB_REGNUM ? (REGNO) + 1 : (REGNO))
   1517 
   1518 /* `DEBUGGER_AUTO_OFFSET (X)'
   1519 
   1520    A C expression that returns the integer offset value for an
   1521    automatic variable having address X (an RTL expression).  The
   1522    default computation assumes that X is based on the frame-pointer
   1523    and gives the offset from the frame-pointer.  This is required for
   1524    targets that produce debugging output for DBX and allow the frame-pointer
   1525    to be eliminated when the `-g' options is used. */
   1526 #define DEBUGGER_AUTO_OFFSET(X) \
   1527   (GET_CODE (X) == PLUS ? INTVAL (XEXP (X, 1)) : 0)
   1528 
   1529 /* Miscellaneous Parameters
   1530 
   1531    `CASE_VECTOR_MODE'
   1532 
   1533    An alias for a machine mode name.  This is the machine mode that
   1534    elements of a jump-table should have. */
   1535 #define CASE_VECTOR_MODE SImode
   1536 
   1537 /* `CASE_VECTOR_PC_RELATIVE'
   1538    Define this macro if jump-tables should contain relative addresses. */
   1539 #undef CASE_VECTOR_PC_RELATIVE
   1540 
   1541 /* This says how to output assembler code to declare an
   1542    unitialised external linkage data object. */
   1543 #define ASM_OUTPUT_COMMON(STREAM, NAME, SIZE, ROUNDED)      \
   1544 ( fputs ("\n\t.comm  ", (STREAM)),                        \
   1545   assemble_name ((STREAM), (NAME)),                         \
   1546   fprintf ((STREAM), "," HOST_WIDE_INT_PRINT_UNSIGNED"\n", ROUNDED))
   1547 
   1548 /* This says how to output assembler code to declare an
   1549    unitialised internal linkage data object. */
   1550 #define ASM_OUTPUT_LOCAL(STREAM, NAME, SIZE, ROUNDED)     \
   1551 ( fputs ("\n\t.lcomm ", (STREAM)),                      \
   1552   assemble_name ((STREAM), (NAME)),                     \
   1553   fprintf ((STREAM), "," HOST_WIDE_INT_PRINT_UNSIGNED"\n", ROUNDED))
   1554 
   1555 /* Prettify the assembly.  */
   1556 extern int visium_indent_opcode;
   1557 
   1558 #define ASM_OUTPUT_OPCODE(FILE, PTR)	\
   1559   do {					\
   1560     if (visium_indent_opcode)		\
   1561       {					\
   1562 	putc (' ', FILE);		\
   1563 	visium_indent_opcode = 0;	\
   1564       }					\
   1565   } while (0)
   1566 
   1567 /* Configure-time default values for common options.  */
   1568 #define OPTION_DEFAULT_SPECS { "cpu", "%{!mcpu=*:-mcpu=%(VALUE)}" }
   1569 
   1570 /* Values of TARGET_CPU_DEFAULT specified via --with-cpu.  */
   1571 #define TARGET_CPU_gr5	0
   1572 #define TARGET_CPU_gr6	1
   1573 
   1574 /* Default -mcpu multilib for above values.  */
   1575 #if TARGET_CPU_DEFAULT == TARGET_CPU_gr5
   1576 #define MULTILIB_DEFAULTS { "mcpu=gr5" }
   1577 #elif TARGET_CPU_DEFAULT == TARGET_CPU_gr6
   1578 #define MULTILIB_DEFAULTS { "mcpu=gr6" }
   1579 #else
   1580 #error Unrecognized value in TARGET_CPU_DEFAULT
   1581 #endif
   1582