Annotation of gcc/config/m68k/hp320.h, revision 1.1.1.4

1.1       root        1: /* Definitions of target machine for GNU compiler.  HP-UX 68000/68020 version.
1.1.1.4 ! root        2:    Copyright (C) 1987, 1988, 1993, 1994, 1995 Free Software Foundation, Inc.
1.1       root        3: 
                      4: This file is part of GNU CC.
                      5: 
                      6: GNU CC is free software; you can redistribute it and/or modify
                      7: it under the terms of the GNU General Public License as published by
                      8: the Free Software Foundation; either version 2, or (at your option)
                      9: any later version.
                     10: 
                     11: GNU CC is distributed in the hope that it will be useful,
                     12: but WITHOUT ANY WARRANTY; without even the implied warranty of
                     13: MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
                     14: GNU General Public License for more details.
                     15: 
                     16: You should have received a copy of the GNU General Public License
                     17: along with GNU CC; see the file COPYING.  If not, write to
1.1.1.4 ! root       18: the Free Software Foundation, 59 Temple Place - Suite 330,
        !            19: Boston, MA 02111-1307, USA.  */
1.1       root       20: 
                     21: /* Define USE_GAS if GCC is supposed to work with the GNU assembler,
                     22:    GNU linker and GNU debugger using DBX debugging information.
                     23:    (In other words, much of HPUX has been cast aside.)
                     24:    Undefine USE_GAS if you want GCC to feed the HP assembler.  */
                     25: 
                     26: /* #define USE_GAS */  /* Use hp320g.h if you want this.  */
                     27: 
                     28: /* Control assembler-syntax conditionals in m68k.md.  */
                     29: 
                     30: #ifndef USE_GAS
                     31: #define MOTOROLA               /* Use Motorola syntax rather than "MIT" */
                     32: #define SGS                    /* Uses SGS assembler */
                     33: #define SGS_CMP_ORDER          /* Takes cmp operands in reverse order */
                     34: #define HPUX_ASM
                     35: 
                     36: #if !defined (CROSS_COMPILE) && !defined (NO_BUGS)
                     37: /* The assembler on HP 9k3xx machines running HPUX 8.0 doesn't translate
                     38:    floating point constants behind some operands.  The workaround is to
                     39:    use hex constants.  Reported by Thomas Nau ([email protected]).  */
                     40: #define AS_BUG_FLOATING_CONSTANT
                     41: /* The assembler on HP 9k3xx machines running HPUX 8.0 doesn't accept
                     42:    labels followed by a text, data, or other section directive.  Reported
                     43:    by Thomas Nau ([email protected]).  */
                     44: #define AS_BUG_TRAILING_LABEL
                     45: #endif
                     46: 
1.1.1.2   root       47: #endif /* not USE_GAS */
                     48: 
1.1       root       49: /* gcc.c should find libgcc.a itself rather than expecting linker to.  */
                     50: #define LINK_LIBGCC_SPECIAL
                     51: /* The arguments of -L must be a separate argv element.  */
                     52: #define SPACE_AFTER_L_OPTION
                     53: /* HP/UX doesn't have libg.a.  */
                     54: #define LIB_SPEC "%{!p:%{!pg:-lc}}%{p:-lc_p}%{pg:-lc_p}"
                     55: 
                     56: /* Be compatible with system stddef.h.  */
                     57: #define SIZE_TYPE "unsigned int"
                     58: 
                     59: /* Use atexit for static constructors/destructors, instead of defining
                     60:    our own exit function.  */
                     61: #define HAVE_ATEXIT
                     62: 
                     63: #include "m68k/m68k.h"
                     64: 
                     65: /* See m68k.h.  7 means 68020 with 68881.  */
                     66: 
                     67: #ifndef TARGET_DEFAULT
                     68: #define        TARGET_DEFAULT 7
                     69: #endif
                     70: 
                     71: /* Define __HAVE_68881__ in preprocessor, unless -msoft-float is specified.
                     72:    This will control the use of inline 68881 insns in certain macros.  */
                     73: 
                     74: #ifdef HPUX_ASM
                     75: 
                     76: #define ASM_SPEC "%{m68000:+X}%{mc68000:+X}"
                     77: 
1.1.1.3   root       78: #define NO_DOT_IN_LABEL
                     79: 
1.1       root       80: #if TARGET_DEFAULT & 02  /* -m68881 is the default */
                     81: 
                     82: /* These definitions differ from those used for GAS by defining __HPUX_ASM__.
                     83:    This is needed because some programs, particularly GDB, need to
                     84:    know which assembler is being used so that the correct `asm'
                     85:    instructions can be used. */
                     86: 
                     87: #define CPP_SPEC \
                     88: "%{!msoft-float:-D__HAVE_68881__ }\
                     89: %{!ansi:%{!mc68000:%{!m68000:-Dmc68020}} -D_HPUX_SOURCE} -D__HPUX_ASM__"
                     90: 
                     91: #else /* default is -msoft-float */
                     92: 
                     93: #define CPP_SPEC \
                     94: "%{m68881:-D__HAVE_68881__ }\
                     95: %{!ansi:%{!mc68000:%{!m68000:-Dmc68020}} -D_HPUX_SOURCE} -D__HPUX_ASM__"
                     96: 
                     97: #endif /* default is -msoft-float */
                     98: 
                     99: #else /* not HPUX_ASM */
                    100: 
                    101: #if TARGET_DEFAULT & 02  /* -m68881 is the default */
                    102: 
                    103: #define CPP_SPEC \
                    104: "%{!msoft-float:-D__HAVE_68881__ }\
                    105: %{!ansi:%{!mc68000:%{!m68000:-Dmc68020}} -D_HPUX_SOURCE}"
                    106: 
                    107: #else /* default is -msoft-float */
                    108: 
                    109: #define CPP_SPEC \
                    110: "%{m68881:-D__HAVE_68881__ }\
                    111: %{!ansi:%{!mc68000:%{!m68000:-Dmc68020}} -D_HPUX_SOURCE}"
                    112: 
                    113: #endif /* default is -msoft-float */
                    114: 
                    115: 
                    116: /* -m68000 requires special flags to the assembler.  */
                    117: #define ASM_SPEC \
                    118:  "%{m68000:-mc68000}%{mc68000:-mc68000}%{!mc68000:%{!m68000:-mc68020}}"
                    119: 
                    120: /* Tell GCC to put a space after -L when generating such options.  */
                    121: #define SPACE_AFTER_L_OPTION
                    122: 
                    123: #endif /* Not HPUX_ASM */
                    124: 
1.1.1.3   root      125: /* Translate -static for HPUX linker.  */
                    126: #define LINK_SPEC "%{static:-a archive}"
                    127: 
1.1       root      128: /* Names to predefine in the preprocessor for this target machine
                    129:    (for non-strict-ANSI programs only).  */
                    130: /* These are the ones defined by HPUX cc, plus mc68000 for uniformity with
                    131:    GCC on other 68000 systems.  */
                    132: 
1.1.1.2   root      133: #define CPP_PREDEFINES "-Dhp9000s200 -Dhp9000s300 -DPWB -Dhpux -Dunix -D__hp9000s300 -D__hp9000s200 -D__PWB -D__hpux -D__unix -D__motorola__ -Asystem(unix) -Asystem(hpux) -Acpu(m68k) -Amachine(m68k)"
1.1       root      134: 
                    135: /* Every structure or union's size must be a multiple of 2 bytes.  */
                    136: 
                    137: #define STRUCTURE_SIZE_BOUNDARY 16
                    138: 
                    139: /* hpux doesn't use static area for struct returns. */
                    140: #undef PCC_STATIC_STRUCT_RETURN
                    141: 
                    142: /* Generate calls to memcpy, memcmp and memset.  */
                    143: #define TARGET_MEM_FUNCTIONS
                    144: 
                    145: #if 0  /* No longer correct in HPUX version 6.5.  */
                    146: /* Function calls don't save any fp registers on hpux.  */
                    147: #undef CALL_USED_REGISTERS
                    148: #define CALL_USED_REGISTERS                                            \
                    149:  {1, 1, 0, 0, 0, 0, 0, 0,                                              \
                    150:   1, 1, 0, 0, 0, 0, 0, 1,                                              \
                    151:   1, 1, 1, 1, 1, 1, 1, 1}
                    152: #endif /* 0 */
                    153: 
                    154: #ifdef HPUX_ASM
                    155: 
                    156: /* Override parts of m68k.h to fit the HPUX assembler.  */
                    157: 
                    158: #undef TARGET_VERSION
                    159: #undef REGISTER_NAMES
                    160: #undef ASM_OUTPUT_REG_PUSH
                    161: #undef ASM_OUTPUT_REG_POP
                    162: #undef ASM_FILE_START
                    163: #undef ASM_APP_ON
                    164: #undef ASM_APP_OFF
                    165: #undef TEXT_SECTION_ASM_OP
                    166: #undef DATA_SECTION_ASM_OP
1.1.1.3   root      167: #undef READONLY_DATA_SECTION
1.1       root      168: #undef ASM_OUTPUT_DOUBLE
                    169: #undef ASM_OUTPUT_FLOAT
                    170: #undef ASM_OUTPUT_INT
                    171: #undef ASM_OUTPUT_SHORT
                    172: #undef ASM_OUTPUT_CHAR
                    173: #undef ASM_OUTPUT_BYTE
                    174: #undef ASM_OUTPUT_ADDR_VEC_ELT
                    175: #undef ASM_OUTPUT_ADDR_DIFF_ELT
                    176: #undef ASM_OUTPUT_ALIGN
                    177: #undef ASM_OUTPUT_SKIP
                    178: #undef ASM_OUTPUT_COMMON
                    179: #undef ASM_OUTPUT_LOCAL
                    180: #undef ASM_FORMAT_PRIVATE_NAME
                    181: #undef PRINT_OPERAND
                    182: #undef PRINT_OPERAND_ADDRESS
                    183: #undef FUNCTION_PROFILER
                    184: #undef ASM_OUTPUT_INTERNAL_LABEL
                    185: #undef GLOBAL_ASM_OP
1.1.1.3   root      186: #undef IMMEDIATE_PREFIX
                    187: #undef REGISTER_PREFIX
1.1       root      188: 
                    189: #define TARGET_VERSION fprintf (stderr, " (68k, SGS/hpux syntax)");
                    190: 
                    191: #define REGISTER_NAMES \
                    192: {"%d0", "%d1", "%d2", "%d3", "%d4", "%d5", "%d6", "%d7",       \
                    193:  "%a0", "%a1", "%a2", "%a3", "%a4", "%a5", "%fp", "%sp",       \
                    194:  "%fp0", "%fp1", "%fp2", "%fp3", "%fp4", "%fp5", "%fp6", "%fp7"}
                    195: 
1.1.1.3   root      196: #define IMMEDIATE_PREFIX        "&"
                    197: #define REGISTER_PREFIX         "%"
1.1       root      198: 
                    199: #define FUNCTION_PROFILER(FILE, LABEL_NO) \
                    200:    fprintf (FILE, "\tmov.l &LP%d,%%a0\n\tjsr mcount\n", (LABEL_NO));
                    201: 
                    202: /* This is how to output an insn to push a register on the stack.
                    203:    It need not be very fast code.  */
                    204: 
                    205: #define ASM_OUTPUT_REG_PUSH(FILE,REGNO)  \
                    206:   fprintf (FILE, "\tmov.l %s,-(%%sp)\n", reg_names[REGNO])
                    207: 
                    208: /* This is how to output an insn to pop a register from the stack.
                    209:    It need not be very fast code.  */
                    210: 
                    211: #define ASM_OUTPUT_REG_POP(FILE,REGNO)  \
                    212:   fprintf (FILE, "\tmov.l (%%sp)+,%s\n", reg_names[REGNO])
                    213: 
                    214: /* For HPUX versions before 6.5, define this macro as empty.  */
                    215: #define ASM_FILE_START(FILE)                                           \
                    216:   if (TARGET_68020)                                                    \
                    217:     {                                                                  \
                    218:       if (TARGET_68881)                                                        \
                    219:         fprintf (FILE, "\tversion 3\n"); /* 68020 fp regs saved */     \
                    220:       else                                                             \
                    221:         fprintf (FILE, "\tversion 2\n"); /* 68020 no fp regs saved */  \
                    222:     }                                                                  \
                    223:   else                                                                 \
                    224:     fprintf (FILE, "\tversion 1\n");   /* 68010 */
                    225: 
                    226: #define ASM_APP_ON ""
                    227: 
                    228: #define ASM_APP_OFF ""
                    229: 
                    230: #ifdef AS_BUG_TRAILING_LABEL
                    231: #define TEXT_SECTION_ASM_OP "\tlalign\t1\ntext"
                    232: #define DATA_SECTION_ASM_OP "\tlalign\t1\ndata"
                    233: #else
                    234: #define TEXT_SECTION_ASM_OP "text"
                    235: #define DATA_SECTION_ASM_OP "data"
                    236: #endif
                    237: #define        ASCII_DATA_ASM_OP "byte"
                    238:  
                    239: /* This is the command to make the user-level label named NAME
                    240:    defined for reference from other files.  */
                    241: 
                    242: #define GLOBAL_ASM_OP "global"
                    243: 
                    244: /* This says how to output an assembler line
                    245:    to define a global common symbol.  */
                    246: 
                    247: #define ASM_OUTPUT_COMMON(FILE, NAME, SIZE, ROUNDED)  \
                    248: ( fputs ("\tcomm ", (FILE)),                   \
                    249:   assemble_name ((FILE), (NAME)),              \
                    250:   fprintf ((FILE), ",%u\n", (ROUNDED)))
                    251: 
                    252: /* This says how to output an assembler line
                    253:    to define a local common symbol.  */
                    254: 
                    255: #define ASM_OUTPUT_LOCAL(FILE, NAME, SIZE, ROUNDED)  \
                    256: ( fputs ("\tlcomm ", (FILE)),                  \
                    257:   assemble_name ((FILE), (NAME)),              \
                    258:   fprintf ((FILE), ",%u,2\n", (ROUNDED)))
                    259: 
                    260: /* Store in OUTPUT a string (made with alloca) containing
                    261:    an assembler-name for a local static variable named NAME.
                    262:    LABELNO is an integer which is different for each call.  */
                    263: 
                    264: #define ASM_FORMAT_PRIVATE_NAME(OUTPUT, NAME, LABELNO) \
                    265: ( (OUTPUT) = (char *) alloca (strlen ((NAME)) + 12),   \
                    266:   sprintf ((OUTPUT), "%s___%d", (NAME), (LABELNO)))
                    267: 
                    268: #define ASM_OUTPUT_INTERNAL_LABEL(FILE,PREFIX,NUM)     \
                    269: do{  if (PREFIX[0] == 'L' && PREFIX[1] == 'I')         \
                    270:     fprintf(FILE, "\tset %s%d,.+2\n", PREFIX, NUM);    \
                    271:   else                                                 \
                    272:     fprintf (FILE, "%s%d:\n", PREFIX, NUM);            \
                    273: } while(0)
                    274: 
                    275: #define ASM_OUTPUT_DOUBLE(FILE, VALUE)                 \
                    276:   do { char dstr[30];                                  \
                    277:        REAL_VALUE_TO_DECIMAL (VALUE, "%.20g", dstr);   \
                    278:        fprintf (FILE, "\tdouble 0f%s\n", dstr);                \
                    279:      } while (0)
                    280: 
                    281: #define ASM_OUTPUT_FLOAT(FILE, VALUE)                  \
                    282:   do { char dstr[30];                                  \
                    283:        REAL_VALUE_TO_DECIMAL (VALUE, "%.9g", dstr);    \
                    284:        fprintf (FILE, "\tfloat 0f%s\n", dstr);         \
                    285:      } while (0)
                    286: 
                    287: #undef ASM_OUTPUT_LONG_DOUBLE
                    288: #define ASM_OUTPUT_LONG_DOUBLE(FILE,VALUE)                             \
                    289: do { long l[3];                                                                \
                    290:      REAL_VALUE_TO_TARGET_LONG_DOUBLE (VALUE, l);                      \
                    291:      fprintf (FILE, "\tlong 0x%x,0x%x,0x%x\n", l[0], l[1], l[2]);      \
                    292:    } while (0)
                    293:   
                    294: /* This is how to output an assembler line defining an `int' constant.  */
                    295: 
                    296: #define ASM_OUTPUT_INT(FILE,VALUE)  \
                    297: ( fprintf (FILE, "\tlong "),                   \
                    298:   output_addr_const (FILE, (VALUE)),           \
                    299:   fprintf (FILE, "\n"))
                    300: 
                    301: /* Likewise for `char' and `short' constants.  */
                    302: 
                    303: #define ASM_OUTPUT_SHORT(FILE,VALUE)  \
                    304: ( fprintf (FILE, "\tshort "),                  \
                    305:   output_addr_const (FILE, (VALUE)),           \
                    306:   fprintf (FILE, "\n"))
                    307: 
                    308: #define ASM_OUTPUT_CHAR(FILE,VALUE)  \
                    309: ( fprintf (FILE, "\tbyte "),                   \
                    310:   output_addr_const (FILE, (VALUE)),           \
                    311:   fprintf (FILE, "\n"))
                    312: 
                    313: /* This is how to output an assembler line for a numeric constant byte.  */
                    314: 
                    315: #define ASM_OUTPUT_BYTE(FILE,VALUE)  \
                    316:   fprintf (FILE, "\tbyte 0x%x\n", (VALUE))
                    317: 
                    318: #define ASM_OUTPUT_ADDR_VEC_ELT(FILE, VALUE)  \
                    319:   fprintf (FILE, "\tlong L%d\n", VALUE)
                    320: 
                    321: #define ASM_OUTPUT_ADDR_DIFF_ELT(FILE, VALUE, REL)  \
                    322:   fprintf (FILE, "\tshort L%d-L%d\n", VALUE, REL)
                    323: 
                    324: #define ASM_OUTPUT_ALIGN(FILE,LOG)     \
                    325:   if ((LOG) == 1)                      \
                    326:     fprintf (FILE, "\tlalign 2\n");    \
                    327:   else if ((LOG) != 0)                 \
                    328:     abort ();
                    329: 
                    330: #define ASM_OUTPUT_SKIP(FILE,SIZE)  \
                    331:   fprintf (FILE, "\tspace %u\n", (SIZE))
                    332: 
                    333: #define ASM_OUTPUT_SOURCE_FILENAME(FILE, FILENAME)
                    334: #define ASM_OUTPUT_SOURCE_LINE(FILE, LINENO)
                    335: 
                    336: #ifdef AS_BUG_FLOATING_CONSTANT
                    337: #define PRINT_OPERAND_FLOAT(CODE,FILE,VALUE,INT)       \
                    338:  do { REAL_VALUE_TO_TARGET_SINGLE (VALUE, INT);                \
                    339:       fprintf (FILE, "&0x%x", INT); } while (0)
                    340: #else
                    341: #define PRINT_OPERAND_FLOAT(CODE,FILE,VALUE,INT)       \
                    342:  do { if (CODE == 'f')                                 \
                    343:         { char dstr[30];                               \
                    344:           REAL_VALUE_TO_DECIMAL (VALUE, "%.9g", dstr); \
                    345:           fprintf (FILE, "&0f%s", dstr);               \
                    346:         }                                              \
                    347:       else                                             \
                    348:         {                                              \
                    349:           REAL_VALUE_TO_TARGET_SINGLE (VALUE, INT);    \
                    350:           fprintf (FILE, "&0x%x", INT); } } while (0)
                    351: #endif /* AS_BUG_FLOATING_CONSTANT */
                    352: 
                    353: #define PRINT_OPERAND(FILE, X, CODE)  \
                    354: { if (CODE == '.') fprintf (FILE, ".");                                        \
                    355:   else if (CODE == '#') fprintf (FILE, "&");                           \
                    356:   else if (CODE == '-') fprintf (FILE, "-(%%sp)");                     \
                    357:   else if (CODE == '+') fprintf (FILE, "(%%sp)+");                     \
                    358:   else if (CODE == '@') fprintf (FILE, "(%%sp)");                      \
                    359:   else if (CODE == '!') fprintf (FILE, "%%fpcr");                      \
                    360:   else if (CODE == '$') { if (TARGET_68040_ONLY) fprintf (FILE, "s"); } \
                    361:   else if (CODE == '&') { if (TARGET_68040_ONLY) fprintf (FILE, "d"); } \
                    362:   else if (CODE == '/')                                                        \
                    363:     fprintf (FILE, "%%");                                              \
                    364:   else if (GET_CODE (X) == REG)                                                \
                    365:     fprintf (FILE, "%s", reg_names[REGNO (X)]);                                \
                    366:   else if (GET_CODE (X) == MEM)                                                \
                    367:     output_address (XEXP (X, 0));                                      \
                    368:   else if (GET_CODE (X) == CONST_DOUBLE && GET_MODE (X) == SFmode)     \
                    369:     { REAL_VALUE_TYPE r;  long l;                                      \
                    370:       REAL_VALUE_FROM_CONST_DOUBLE (r, X);                             \
                    371:       PRINT_OPERAND_FLOAT (CODE, FILE, r, l); }                                \
                    372:   else if (GET_CODE (X) == CONST_DOUBLE && GET_MODE (X) == DFmode)     \
                    373:     { REAL_VALUE_TYPE r;  char dstr[30];                               \
                    374:       REAL_VALUE_FROM_CONST_DOUBLE (r, X);                             \
                    375:       REAL_VALUE_TO_DECIMAL (r, "%.20g", dstr);                                \
                    376:       fprintf (FILE, "&0f%s", dstr); }                                 \
                    377:   else if (GET_CODE (X) == CONST_DOUBLE && GET_MODE (X) == XFmode)     \
                    378:     { REAL_VALUE_TYPE r;  char dstr[30];                               \
                    379:       REAL_VALUE_FROM_CONST_DOUBLE (r, X);                             \
                    380:       REAL_VALUE_TO_DECIMAL (r, "%.20g", dstr);                                \
                    381:       fprintf (FILE, "&0f%s", dstr); }                                 \
                    382:   else { putc ('&', FILE); output_addr_const (FILE, X); }}
                    383: 
                    384: #define PRINT_OPERAND_ADDRESS(FILE, ADDR)  \
                    385: { register rtx reg1, reg2, breg, ireg;                                 \
                    386:   register rtx addr = ADDR;                                            \
                    387:   rtx offset;                                                          \
                    388:   switch (GET_CODE (addr))                                             \
                    389:     {                                                                  \
                    390:     case REG:                                                          \
                    391:       fprintf (FILE, "(%s)", reg_names[REGNO (addr)]);                 \
                    392:       break;                                                           \
                    393:     case PRE_DEC:                                                      \
                    394:       fprintf (FILE, "-(%s)", reg_names[REGNO (XEXP (addr, 0))]);      \
                    395:       break;                                                           \
                    396:     case POST_INC:                                                     \
                    397:       fprintf (FILE, "(%s)+", reg_names[REGNO (XEXP (addr, 0))]);      \
                    398:       break;                                                           \
                    399:     case PLUS:                                                         \
                    400:       reg1 = 0;        reg2 = 0;                                               \
                    401:       ireg = 0;        breg = 0;                                               \
                    402:       offset = 0;                                                      \
                    403:       if (CONSTANT_ADDRESS_P (XEXP (addr, 0)))                         \
                    404:        {                                                               \
                    405:          offset = XEXP (addr, 0);                                      \
                    406:          addr = XEXP (addr, 1);                                        \
                    407:        }                                                               \
                    408:       else if (CONSTANT_ADDRESS_P (XEXP (addr, 1)))                    \
                    409:        {                                                               \
                    410:          offset = XEXP (addr, 1);                                      \
                    411:          addr = XEXP (addr, 0);                                        \
                    412:        }                                                               \
                    413:       if (GET_CODE (addr) != PLUS) ;                                   \
                    414:       else if (GET_CODE (XEXP (addr, 0)) == SIGN_EXTEND)               \
                    415:        {                                                               \
                    416:          reg1 = XEXP (addr, 0);                                        \
                    417:          addr = XEXP (addr, 1);                                        \
                    418:        }                                                               \
                    419:       else if (GET_CODE (XEXP (addr, 1)) == SIGN_EXTEND)               \
                    420:        {                                                               \
                    421:          reg1 = XEXP (addr, 1);                                        \
                    422:          addr = XEXP (addr, 0);                                        \
                    423:        }                                                               \
                    424:       else if (GET_CODE (XEXP (addr, 0)) == MULT)                      \
                    425:        {                                                               \
                    426:          reg1 = XEXP (addr, 0);                                        \
                    427:          addr = XEXP (addr, 1);                                        \
                    428:        }                                                               \
                    429:       else if (GET_CODE (XEXP (addr, 1)) == MULT)                      \
                    430:        {                                                               \
                    431:          reg1 = XEXP (addr, 1);                                        \
                    432:          addr = XEXP (addr, 0);                                        \
                    433:        }                                                               \
                    434:       else if (GET_CODE (XEXP (addr, 0)) == REG)                       \
                    435:        {                                                               \
                    436:          reg1 = XEXP (addr, 0);                                        \
                    437:          addr = XEXP (addr, 1);                                        \
                    438:        }                                                               \
                    439:       else if (GET_CODE (XEXP (addr, 1)) == REG)                       \
                    440:        {                                                               \
                    441:          reg1 = XEXP (addr, 1);                                        \
                    442:          addr = XEXP (addr, 0);                                        \
                    443:        }                                                               \
                    444:       if (GET_CODE (addr) == REG || GET_CODE (addr) == MULT            \
                    445:          || GET_CODE (addr) == SIGN_EXTEND)                            \
                    446:        { if (reg1 == 0) reg1 = addr; else reg2 = addr; addr = 0; }     \
                    447: /*  for OLD_INDEXING                                                   \
                    448:       else if (GET_CODE (addr) == PLUS)                                        \
                    449:        {                                                               \
                    450:          if (GET_CODE (XEXP (addr, 0)) == REG)                         \
                    451:            {                                                           \
                    452:              reg2 = XEXP (addr, 0);                                    \
                    453:              addr = XEXP (addr, 1);                                    \
                    454:            }                                                           \
                    455:          else if (GET_CODE (XEXP (addr, 1)) == REG)                    \
                    456:            {                                                           \
                    457:              reg2 = XEXP (addr, 1);                                    \
                    458:              addr = XEXP (addr, 0);                                    \
                    459:            }                                                           \
                    460:        }                                                               \
                    461:   */                                                                   \
                    462:       if (offset != 0) { if (addr != 0) abort (); addr = offset; }     \
                    463:       if ((reg1 && (GET_CODE (reg1) == SIGN_EXTEND                     \
                    464:                    || GET_CODE (reg1) == MULT))                        \
                    465:          || (reg2 != 0 && REGNO_OK_FOR_BASE_P (REGNO (reg2))))         \
                    466:        { breg = reg2; ireg = reg1; }                                   \
                    467:       else if (reg1 != 0 && REGNO_OK_FOR_BASE_P (REGNO (reg1)))                \
                    468:        { breg = reg1; ireg = reg2; }                                   \
                    469:       if (ireg != 0 && breg == 0 && GET_CODE (addr) == LABEL_REF)      \
                    470:         { int scale = 1;                                               \
                    471:          if (GET_CODE (ireg) == MULT)                                  \
                    472:            { scale = INTVAL (XEXP (ireg, 1));                          \
                    473:              ireg = XEXP (ireg, 0); }                                  \
                    474:          if (GET_CODE (ireg) == SIGN_EXTEND)                           \
                    475:            fprintf (FILE, "L%d-LI%d(%%pc,%s.w",                        \
                    476:                     CODE_LABEL_NUMBER (XEXP (addr, 0)),                \
                    477:                     CODE_LABEL_NUMBER (XEXP (addr, 0)),                \
                    478:                     reg_names[REGNO (XEXP (ireg, 0))]);                \
                    479:          else                                                          \
                    480:            fprintf (FILE, "L%d-LI%d(%%pc,%s.l",                        \
                    481:                     CODE_LABEL_NUMBER (XEXP (addr, 0)),                \
                    482:                     CODE_LABEL_NUMBER (XEXP (addr, 0)),                \
                    483:                     reg_names[REGNO (ireg)]);                          \
                    484:          if (scale != 1) fprintf (FILE, "*%d", scale);                 \
                    485:          putc (')', FILE);                                             \
                    486:          break; }                                                      \
                    487:       if (ireg != 0 || breg != 0)                                      \
                    488:        { int scale = 1;                                                \
                    489:          if (breg == 0)                                                \
                    490:            abort ();                                                   \
                    491:          if (addr != 0)                                                \
                    492:            output_addr_const (FILE, addr);                             \
                    493:          fprintf (FILE, "(%s", reg_names[REGNO (breg)]);               \
                    494:          if (ireg != 0)                                                \
                    495:            putc (',', FILE);                                           \
                    496:          if (ireg != 0 && GET_CODE (ireg) == MULT)                     \
                    497:            { scale = INTVAL (XEXP (ireg, 1));                          \
                    498:              ireg = XEXP (ireg, 0); }                                  \
                    499:          if (ireg != 0 && GET_CODE (ireg) == SIGN_EXTEND)              \
                    500:            fprintf (FILE, "%s.w", reg_names[REGNO (XEXP (ireg, 0))]);  \
                    501:          else if (ireg != 0)                                           \
                    502:            fprintf (FILE, "%s.l", reg_names[REGNO (ireg)]);            \
                    503:          if (scale != 1) fprintf (FILE, "*%d", scale);                 \
                    504:          putc (')', FILE);                                             \
                    505:          break;                                                        \
                    506:        }                                                               \
                    507:       else if (reg1 != 0 && GET_CODE (addr) == LABEL_REF)              \
                    508:        { fprintf (FILE, "L%d-LI%d(%%pc,%s.w)",                         \
                    509:                   CODE_LABEL_NUMBER (XEXP (addr, 0)),                  \
                    510:                   CODE_LABEL_NUMBER (XEXP (addr, 0)),                  \
                    511:                   reg_names[REGNO (reg1)]);                            \
                    512:          break; }                                                      \
                    513:     default:                                                           \
                    514:       if (GET_CODE (addr) == CONST_INT                                 \
                    515:          && INTVAL (addr) < 0x8000                                     \
                    516:          && INTVAL (addr) >= -0x8000)                                  \
                    517:        fprintf (FILE, "%d.w", INTVAL (addr));                          \
                    518:       else                                                             \
                    519:         output_addr_const (FILE, addr);                                        \
                    520:     }}
                    521: 
                    522: #define        ASM_OUTPUT_ASCII(f, p, size)    \
1.1.1.3   root      523: do { register int i;                   \
1.1       root      524:   int inside;                          \
                    525:   inside = FALSE;                      \
                    526:   for (i = 0; i < (size); i++) {       \
                    527:     if (i % 8 == 0) {                  \
                    528:       if (i != 0) {                    \
                    529:        if (inside)                     \
                    530:          putc('"', (f));               \
                    531:        putc('\n', (f));                \
                    532:        inside = FALSE;                 \
                    533:       }                                        \
                    534:       fprintf((f), "\t%s ", ASCII_DATA_ASM_OP);        \
                    535:     }                                  \
                    536:     if ((p)[i] < 32 || (p)[i] == '\\' || (p)[i] == '"' || (p)[i] == 127) {     \
                    537:       if (inside) {                    \
                    538:        putc('"', (f));                 \
                    539:        inside = FALSE;                 \
                    540:       }                                        \
                    541:       if (i % 8 != 0)                  \
                    542:        putc(',', (f));                 \
                    543:       fprintf((f), "%d", (p)[i]);      \
                    544:     } else {                           \
                    545:       if (!inside) {                   \
                    546:        if (i % 8 != 0)                 \
                    547:          putc(',', (f));               \
                    548:        putc('"', (f));                 \
                    549:        inside = TRUE;                  \
                    550:       }                                        \
                    551:       putc((p)[i], (f));               \
                    552:     }                                  \
                    553:   }                                    \
                    554:   if (inside)                          \
                    555:     putc('"', (f));                    \
                    556:   putc('\n', (f));                     \
1.1.1.3   root      557: } while (0)
1.1       root      558: 
                    559: /* Translate Motorola opcodes such as `jbeq'
                    560:    into SGS opcodes such as `beq.w'.
                    561:    Delete the `e' in `move...' and `fmove'.
                    562:    Change `ftst' to `ftest'.  */
                    563: 
                    564: #define ASM_OUTPUT_OPCODE(FILE, PTR)                   \
                    565: { if ((PTR)[0] == 'j' && (PTR)[1] == 'b')              \
                    566:     { ++(PTR);                                         \
                    567:       while (*(PTR) != ' ')                            \
                    568:        { putc (*(PTR), (FILE)); ++(PTR); }             \
                    569:       fprintf ((FILE), ".w"); }                                \
                    570:   else if ((PTR)[0] == 'f')                            \
                    571:     {                                                  \
                    572:       if (!strncmp ((PTR), "fmove", 5))                        \
                    573:        { fprintf ((FILE), "fmov"); (PTR) += 5; }       \
                    574:       else if (!strncmp ((PTR), "ftst", 4))            \
                    575:        { fprintf ((FILE), "ftest"); (PTR) += 4; }      \
                    576:     }                                                  \
                    577:   else if ((PTR)[0] == 'm' && (PTR)[1] == 'o'          \
                    578:           && (PTR)[2] == 'v' && (PTR)[3] == 'e')       \
                    579:     { fprintf ((FILE), "mov"); (PTR) += 4; }           \
                    580: }
                    581: 
                    582: /* Prevent output of `gcc_compiled.:'.  */
                    583: 
                    584: #define ASM_IDENTIFY_GCC(FILE)
                    585: 
                    586: #else /* not HPUX_ASM */
                    587: 
                    588: #undef FUNCTION_PROFILER
                    589: 
                    590: /* HP-UX needs the call to mcount before the link instruction.
                    591:    Copy the return address onto the stack before the call to fake it out.  */
                    592: #define FUNCTION_PROFILER(FILE, LABEL_NO) \
1.1.1.3   root      593:   fprintf (FILE, \
                    594:           "\tmovel a6@(4),sp@-\n\tmovl #LP%d,a0\n\tjsr mcount\n\taddqw #4,sp\n", \
                    595:           (LABEL_NO));
1.1       root      596: 
                    597: #endif /* not HPUX_ASM */
1.1.1.4 ! root      598: 
1.1.1.3   root      599: /* In m68k svr4, a symbol_ref rtx can be a valid PIC operand if it is an
                    600:    operand of a function call. */
                    601: #undef LEGITIMATE_PIC_OPERAND_P
                    602: #define LEGITIMATE_PIC_OPERAND_P(X) \
1.1.1.4 ! root      603:   ((! symbolic_operand (X, VOIDmode) \
        !           604:     && ! (GET_CODE (X) == CONST_DOUBLE && CONST_DOUBLE_MEM (X) \
        !           605:          && GET_CODE (CONST_DOUBLE_MEM (X)) == MEM             \
        !           606:          && symbolic_operand (XEXP (CONST_DOUBLE_MEM (X), 0), VOIDmode))) \
        !           607:    || (GET_CODE (X) == SYMBOL_REF && SYMBOL_REF_FLAG (X)))
1.1.1.3   root      608: 
1.1.1.4 ! root      609: /* hpux8 and later have C++ compatible include files, so do not
1.1.1.3   root      610:    pretend they are `extern "C"'.  */
                    611: #define NO_IMPLICIT_EXTERN_C

unix.superglobalmegacorp.com

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