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

1.1       root        1: /* Definitions of target machine for GNU compiler.  HP-UX 68000/68020 version.
                      2:    Copyright (C) 1987, 1988 Free Software Foundation, Inc.
                      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 1, 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
                     18: the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.  */
                     19: 
                     20: /* Define USE_GAS if GCC is supposed to work with the GNU assembler,
                     21:    GNU linker and GNU debugger using DBX debugging information.
                     22:    (In other words, much of HPUX has been cast aside.)
                     23:    Undefine USE_GAS if you want GCC to feed the HP assembler.  */
                     24: 
                     25: /* #define USE_GAS */  /* Use tm-hp9k320g.h if you want this.  */
                     26: 
                     27: /* Control assembler-syntax conditionals in m68k.md.  */
                     28: 
                     29: #ifndef USE_GAS
                     30: #define MOTOROLA
                     31: #define SGS
                     32: #define HPUX_ASM
                     33: #endif
                     34: 
                     35: #include "tm-m68k.h"
                     36: 
                     37: /* See tm-m68k.h.  7 means 68020 with 68881.  */
                     38: 
                     39: #ifndef TARGET_DEFAULT
                     40: #define        TARGET_DEFAULT 7
                     41: #endif
                     42: 
                     43: /* Define __HAVE_68881__ in preprocessor, unless -msoft-float is specified.
                     44:    This will control the use of inline 68881 insns in certain macros.  */
                     45: 
                     46: /* For version 6.2 of HP-UX (or earlier), remove the "-V 3" from
                     47:    ASM_SPEC below. */
                     48: 
                     49: #ifdef HPUX_ASM
                     50: 
1.1.1.3 ! root       51: /* "-V 3" says that setjmp and longjmp need to save the fpu regs.  */
        !            52: 
1.1       root       53: #define ASM_SPEC "%{m68000:+X} -V 3"
                     54: 
                     55: #if TARGET_DEFAULT & 02  /* -m68881 is the default */
                     56: 
                     57: /* These definitions differ from those used for GAS by defining __HPUX_ASM__.
                     58:    This is needed because some programs, particularly GDB, need to
                     59:    know which assembler is being used so that the correct `asm'
                     60:    instructions can be used. */
                     61: 
                     62: #define CPP_SPEC \
                     63: "%{!msoft-float:-D__HAVE_68881__ }\
1.1.1.3 ! root       64: %{!ansi:%{!mc68000:%{!m68000:-Dmc68020}} -D_HPUX_SOURCE} -D__HPUX_ASM__"
1.1       root       65: 
                     66: #else /* default is -msoft-float */
                     67: 
                     68: #define CPP_SPEC \
                     69: "%{m68881:-D__HAVE_68881__ }\
1.1.1.3 ! root       70: %{!ansi:%{!mc68000:%{!m68000:-Dmc68020}} -D_HPUX_SOURCE} -D__HPUX_ASM__"
1.1       root       71: 
                     72: #endif /* default is -msoft-float */
                     73: 
                     74: #else /* not HPUX_ASM */
                     75: 
                     76: #if TARGET_DEFAULT & 02  /* -m68881 is the default */
                     77: 
                     78: #define CPP_SPEC \
                     79: "%{!msoft-float:-D__HAVE_68881__ }\
1.1.1.3 ! root       80: %{!ansi:%{!mc68000:%{!m68000:-Dmc68020}} -D_HPUX_SOURCE}"
1.1       root       81: 
                     82: #else /* default is -msoft-float */
                     83: 
                     84: #define CPP_SPEC \
                     85: "%{m68881:-D__HAVE_68881__ }\
1.1.1.3 ! root       86: %{!ansi:%{!mc68000:%{!m68000:-Dmc68020}} -D_HPUX_SOURCE}"
1.1       root       87: 
                     88: #endif /* default is -msoft-float */
                     89: 
                     90: 
                     91: /* -m68000 requires special flags to the assembler.  */
                     92: #define ASM_SPEC \
                     93:  "%{m68000:-mc68000}%{mc68000:-mc68000}%{!mc68000:%{!m68000:-mc68020}}"
                     94: 
                     95: /* special directory for gnu libs on hp-ux system */
1.1.1.3 ! root       96: #ifndef STANDARD_STARTFILE_PREFIX
1.1       root       97: #define STANDARD_STARTFILE_PREFIX "/usr/local/lib/gnu/"
1.1.1.3 ! root       98: #endif
1.1       root       99: 
                    100: #endif /* Not HPUX_ASM */
                    101: 
                    102: /* Names to predefine in the preprocessor for this target machine
                    103:    (for non-strict-ANSI programs only).  */
                    104: /* These are the ones defined by HPUX cc, plus mc68000 for uniformity with
                    105:    GCC on other 68000 systems.  */
                    106: 
1.1.1.3 ! root      107: #define CPP_PREDEFINES "-Dhp9000s200 -Dhp9000s300 -DPWB -Dhpux -Dunix -D__hp9000s300 -D__hp9000s200 -D__PWB -D__hpux -D__unix"
1.1       root      108: 
                    109: /* Every structure or union's size must be a multiple of 2 bytes.  */
                    110: 
                    111: #define STRUCTURE_SIZE_BOUNDARY 16
                    112: 
                    113: /* hpux doesn't use static area for struct returns. */
                    114: #undef PCC_STATIC_STRUCT_RETURN
                    115: 
                    116: /* Generate calls to memcpy, memcmp and memset.  */
                    117: #define TARGET_MEM_FUNCTIONS
                    118: 
1.1.1.3 ! root      119: /* Function calls do save some fp registers on hpux version 7.  */
1.1       root      120: 
                    121: #undef CALL_USED_REGISTERS
                    122: #define CALL_USED_REGISTERS                                            \
                    123:  {1, 1, 0, 0, 0, 0, 0, 0,                                              \
                    124:   1, 1, 0, 0, 0, 0, 0, 1,                                              \
1.1.1.3 ! root      125:   1, 1, 0, 0, 0, 0, 0, 0}
1.1       root      126: 
                    127: #ifdef HPUX_ASM
                    128: 
                    129: /* Override parts of tm-m68k.h to fit the HPUX assembler.  */
                    130: 
                    131: #undef TARGET_VERSION
                    132: #undef REGISTER_NAMES
                    133: #undef FUNCTION_PROLOGUE
                    134: #undef FUNCTION_EPILOGUE
                    135: #undef ASM_OUTPUT_REG_PUSH
                    136: #undef ASM_OUTPUT_REG_POP
                    137: #undef ASM_FILE_START
                    138: #undef ASM_APP_ON
                    139: #undef ASM_APP_OFF
                    140: #undef TEXT_SECTION_ASM_OP
                    141: #undef DATA_SECTION_ASM_OP
                    142: #undef ASM_OUTPUT_DOUBLE
                    143: #undef ASM_OUTPUT_FLOAT
                    144: #undef ASM_OUTPUT_INT
                    145: #undef ASM_OUTPUT_SHORT
                    146: #undef ASM_OUTPUT_CHAR
                    147: #undef ASM_OUTPUT_BYTE
                    148: #undef ASM_OUTPUT_ADDR_VEC_ELT
                    149: #undef ASM_OUTPUT_ADDR_DIFF_ELT
                    150: #undef ASM_OUTPUT_ALIGN
                    151: #undef ASM_OUTPUT_SKIP
                    152: #undef ASM_OUTPUT_COMMON
                    153: #undef ASM_OUTPUT_LOCAL
                    154: #undef ASM_FORMAT_PRIVATE_NAME
                    155: #undef PRINT_OPERAND
                    156: #undef PRINT_OPERAND_ADDRESS
                    157: #undef FUNCTION_PROFILER
                    158: #undef ASM_GLOBALIZE_LABEL
                    159: #undef ASM_OUTPUT_INTERNAL_LABEL
                    160: 
                    161: #define TARGET_VERSION fprintf (stderr, " (68k, SGS/hpux syntax)");
                    162: 
                    163: #define REGISTER_NAMES \
                    164: {"%d0", "%d1", "%d2", "%d3", "%d4", "%d5", "%d6", "%d7",       \
                    165:  "%a0", "%a1", "%a2", "%a3", "%a4", "%a5", "%fp", "%sp",       \
                    166:  "%fp0", "%fp1", "%fp2", "%fp3", "%fp4", "%fp5", "%fp6", "%fp7"}
                    167: 
                    168: #define FUNCTION_PROLOGUE(FILE, SIZE)     \
                    169: { register int regno;                                          \
                    170:   register int mask = 0;                                       \
                    171:   extern char call_used_regs[];                                        \
                    172:   int fsize = (SIZE);                                          \
                    173:   if (frame_pointer_needed)                                    \
                    174:     { if (fsize < 0x8000)                                      \
                    175:         fprintf (FILE, "\tlink.w %%a6,&%d\n", -fsize);         \
                    176:       else if (TARGET_68020)                                   \
                    177:         fprintf (FILE, "\tlink.l %%a6,&%d\n", -fsize);         \
                    178:       else                                                     \
                    179:        fprintf (FILE, "\tlink.w %%a6,&0\n\tsub.l &%d,%%sp\n", fsize); }  \
                    180:   for (regno = 16; regno < FIRST_PSEUDO_REGISTER; regno++)     \
                    181:     if (regs_ever_live[regno] && ! call_used_regs[regno])      \
                    182:        mask |= 1 << (regno - 16);                              \
                    183:   if (mask != 0)                                               \
                    184:     fprintf (FILE, "\tfmovem &0x%x,-(%%sp)\n", mask & 0xff);       \
                    185:   mask = 0;                                                    \
                    186:   for (regno = 0; regno < 16; regno++)                         \
                    187:     if (regs_ever_live[regno] && ! call_used_regs[regno])      \
                    188:        mask |= 1 << (15 - regno);                              \
                    189:   if (frame_pointer_needed)                                    \
                    190:     mask &= ~ (1 << (15-FRAME_POINTER_REGNUM));                        \
                    191:   if (exact_log2 (mask) >= 0)                                  \
                    192:     fprintf (FILE, "\tmov.l %s,-(%%sp)\n", reg_names[15 - exact_log2 (mask)]);  \
                    193:   else if (mask) fprintf (FILE, "\tmovm.l &0x%x,-(%%sp)\n", mask); }
                    194: 
1.1.1.3 ! root      195: #define PROFILE_BEFORE_PROLOGUE
        !           196: 
1.1       root      197: #define FUNCTION_PROFILER(FILE, LABEL_NO) \
                    198:    fprintf (FILE, "\tmov.l &LP%d,%%a0\n\tjsr mcount\n", (LABEL_NO));
                    199: 
                    200: #define FUNCTION_EPILOGUE(FILE, SIZE) \
                    201: { register int regno;                                          \
                    202:   register int mask, fmask;                                    \
                    203:   register int nregs;                                          \
                    204:   int offset, foffset;                                         \
                    205:   extern char call_used_regs[];                                        \
                    206:   extern int current_function_pops_args;                       \
                    207:   extern int current_function_args_size;                       \
                    208:   int fsize = (SIZE);                                          \
                    209:   int big = 0;                                                 \
                    210:   nregs = 0;  fmask = 0;                                       \
                    211:   for (regno = 16; regno < FIRST_PSEUDO_REGISTER; regno++)     \
                    212:     if (regs_ever_live[regno] && ! call_used_regs[regno])      \
                    213:       { nregs++; fmask |= 1 << (23 - regno); }                 \
                    214:   foffset = nregs * 12;                                                \
                    215:   nregs = 0;  mask = 0;                                                \
                    216:   if (frame_pointer_needed) regs_ever_live[FRAME_POINTER_REGNUM] = 0; \
                    217:   for (regno = 0; regno < 16; regno++)                         \
                    218:     if (regs_ever_live[regno] && ! call_used_regs[regno])      \
                    219:       { nregs++; mask |= 1 << regno; }                         \
                    220:   offset = foffset + nregs * 4;                                        \
                    221:   if (offset + fsize >= 0x8000 && frame_pointer_needed)                \
                    222:     { fprintf (FILE, "\tmov.l &%d,%%a0\n", -fsize);            \
                    223:       fsize = 0, big = 1; }                                    \
                    224:   if (exact_log2 (mask) >= 0) {                                        \
                    225:     if (big)                                                   \
                    226:       fprintf (FILE, "\tmov.l -%d(%%a6,%%a0.l),%s\n",          \
                    227:               offset + fsize, reg_names[exact_log2 (mask)]);   \
                    228:     else if (! frame_pointer_needed)                           \
                    229:       fprintf (FILE, "\tmov.l (%%sp)+,%s\n",                   \
                    230:               reg_names[exact_log2 (mask)]);                   \
                    231:     else                                                       \
                    232:       fprintf (FILE, "\tmov.l -%d(%%a6),%s\n",                 \
                    233:               offset + fsize, reg_names[exact_log2 (mask)]); } \
                    234:   else if (mask) {                                             \
                    235:     if (big)                                                   \
                    236:       fprintf (FILE, "\tmovm.l -%d(%%a6,%%a0.l),&0x%x\n",      \
                    237:               offset + fsize, mask);                           \
                    238:     else if (! frame_pointer_needed)                           \
                    239:       fprintf (FILE, "\tmovm.l (%%sp)+,&0x%x\n", mask);                \
                    240:     else                                                       \
                    241:       fprintf (FILE, "\tmovm.l -%d(%%a6),&0x%x\n",             \
                    242:               offset + fsize, mask); }                         \
                    243:   if (fmask) {                                                 \
                    244:     if (big)                                                   \
                    245:       fprintf (FILE, "\tfmovem -%d(%%a6,%%a0.l),&0x%x\n",      \
                    246:               foffset + fsize, fmask);                         \
                    247:     else if (! frame_pointer_needed)                           \
                    248:       fprintf (FILE, "\tfmovem (%%sp)+,&0x%x\n", fmask);       \
                    249:     else                                                       \
                    250:       fprintf (FILE, "\tfmovem -%d(%%a6),&0x%x\n",             \
                    251:               foffset + fsize, fmask); }                       \
                    252:   if (frame_pointer_needed)                                    \
                    253:     fprintf (FILE, "\tunlk %%a6\n");                           \
                    254:   if (current_function_pops_args && current_function_args_size)        \
                    255:     fprintf (FILE, "\trtd &%d\n", current_function_args_size); \
                    256:   else fprintf (FILE, "\trts\n"); }
                    257: 
                    258: /* This is how to output an insn to push a register on the stack.
                    259:    It need not be very fast code.  */
                    260: 
                    261: #define ASM_OUTPUT_REG_PUSH(FILE,REGNO)  \
                    262:   fprintf (FILE, "\tmov.l %s,-(%%sp)\n", reg_names[REGNO])
                    263: 
                    264: /* This is how to output an insn to pop a register from the stack.
                    265:    It need not be very fast code.  */
                    266: 
                    267: #define ASM_OUTPUT_REG_POP(FILE,REGNO)  \
                    268:   fprintf (FILE, "\tmov.l (%%sp)+,%s\n", reg_names[REGNO])
                    269: 
                    270: #define ASM_FILE_START(FILE)
                    271: 
                    272: #define ASM_APP_ON ""
                    273: 
                    274: #define ASM_APP_OFF ""
                    275: 
                    276: #define TEXT_SECTION_ASM_OP "text"
                    277: 
                    278: #define DATA_SECTION_ASM_OP "data"
                    279: 
                    280: #define        ASCII_DATA_ASM_OP "\tbyte"
                    281: 
                    282: /* This says how to output an assembler line
                    283:    to define a global common symbol.  */
                    284: 
                    285: #define ASM_OUTPUT_COMMON(FILE, NAME, SIZE, ROUNDED)  \
                    286: ( fputs ("\tcomm ", (FILE)),                   \
                    287:   assemble_name ((FILE), (NAME)),              \
1.1.1.3 ! root      288:   fprintf ((FILE), ",%u\n", (ROUNDED)))
1.1       root      289: 
                    290: /* This says how to output an assembler line
                    291:    to define a local common symbol.  */
                    292: 
                    293: #define ASM_OUTPUT_LOCAL(FILE, NAME, SIZE, ROUNDED)  \
                    294: ( fputs ("\tlcomm ", (FILE)),                  \
                    295:   assemble_name ((FILE), (NAME)),              \
1.1.1.3 ! root      296:   fprintf ((FILE), ",%u,2\n", (ROUNDED)))
1.1       root      297: 
                    298: /* Store in OUTPUT a string (made with alloca) containing
                    299:    an assembler-name for a local static variable named NAME.
                    300:    LABELNO is an integer which is different for each call.  */
                    301: 
                    302: #define ASM_FORMAT_PRIVATE_NAME(OUTPUT, NAME, LABELNO) \
                    303: ( (OUTPUT) = (char *) alloca (strlen ((NAME)) + 12),   \
                    304:   sprintf ((OUTPUT), "%s___%d", (NAME), (LABELNO)))
                    305: 
                    306: /* This is how to output a command to make the user-level label named NAME
                    307:    defined for reference from other files.  */
                    308: 
                    309: #define ASM_GLOBALIZE_LABEL(FILE,NAME) \
                    310:   do { fputs ("\tglobal ", FILE); assemble_name (FILE, NAME); fputs ("\n", FILE);} while (0)
                    311: 
                    312: #define ASM_OUTPUT_INTERNAL_LABEL(FILE,PREFIX,NUM)     \
                    313: do{  if (PREFIX[0] == 'L' && PREFIX[1] == 'I')         \
                    314:     fprintf(FILE, "\tset %s%d,.+2\n", PREFIX, NUM);    \
                    315:   else                                                 \
                    316:     fprintf (FILE, "%s%d:\n", PREFIX, NUM);            \
                    317: } while(0)
                    318: 
                    319: #define ASM_OUTPUT_DOUBLE(FILE, VALUE)                                 \
                    320:   fprintf (FILE, "\tdouble 0f%.20g\n", (VALUE))
                    321: 
                    322: #define ASM_OUTPUT_FLOAT(FILE, VALUE)                                  \
                    323:   fprintf (FILE, "\tfloat 0f%.9g\n", (VALUE))
                    324: 
                    325: /* This is how to output an assembler line defining an `int' constant.  */
                    326: 
                    327: #define ASM_OUTPUT_INT(FILE,VALUE)  \
                    328: ( fprintf (FILE, "\tlong "),                   \
                    329:   output_addr_const (FILE, (VALUE)),           \
                    330:   fprintf (FILE, "\n"))
                    331: 
                    332: /* Likewise for `char' and `short' constants.  */
                    333: 
                    334: #define ASM_OUTPUT_SHORT(FILE,VALUE)  \
                    335: ( fprintf (FILE, "\tshort "),                  \
                    336:   output_addr_const (FILE, (VALUE)),           \
                    337:   fprintf (FILE, "\n"))
                    338: 
                    339: #define ASM_OUTPUT_CHAR(FILE,VALUE)  \
                    340: ( fprintf (FILE, "\tbyte "),                   \
                    341:   output_addr_const (FILE, (VALUE)),           \
                    342:   fprintf (FILE, "\n"))
                    343: 
                    344: /* This is how to output an assembler line for a numeric constant byte.  */
                    345: 
                    346: #define ASM_OUTPUT_BYTE(FILE,VALUE)  \
                    347:   fprintf (FILE, "\tbyte 0x%x\n", (VALUE))
                    348: 
                    349: #define ASM_OUTPUT_ADDR_VEC_ELT(FILE, VALUE)  \
                    350:   fprintf (FILE, "\tlong L%d\n", VALUE)
                    351: 
                    352: #define ASM_OUTPUT_ADDR_DIFF_ELT(FILE, VALUE, REL)  \
                    353:   fprintf (FILE, "\tshort L%d-L%d\n", VALUE, REL)
                    354: 
                    355: #define ASM_OUTPUT_ALIGN(FILE,LOG)     \
                    356:   if ((LOG) == 1)                      \
                    357:     fprintf (FILE, "\tlalign 2\n");    \
                    358:   else if ((LOG) != 0)                 \
                    359:     abort ();
                    360: 
                    361: #define ASM_OUTPUT_SKIP(FILE,SIZE)  \
1.1.1.3 ! root      362:   fprintf (FILE, "\tspace %u\n", (SIZE))
1.1       root      363: 
                    364: #define ASM_OUTPUT_SOURCE_FILENAME(FILE, FILENAME)
                    365: #define ASM_OUTPUT_SOURCE_LINE(FILE, LINENO)
                    366: 
                    367: #define PRINT_OPERAND(FILE, X, CODE)  \
                    368: { if (CODE == '.') fprintf (FILE, ".");                                        \
                    369:   else if (CODE == '#') fprintf (FILE, "&");                           \
                    370:   else if (CODE == '-') fprintf (FILE, "-(%%sp)");                     \
                    371:   else if (CODE == '+') fprintf (FILE, "(%%sp)+");                     \
                    372:   else if (CODE == '@') fprintf (FILE, "(%%sp)");                      \
                    373:   else if (CODE == '!') fprintf (FILE, "%%cc");                                \
                    374:   else if (GET_CODE (X) == REG)                                                \
                    375:     fprintf (FILE, "%s", reg_names[REGNO (X)]);                                \
                    376:   else if (GET_CODE (X) == MEM)                                                \
                    377:     output_address (XEXP (X, 0));                                      \
                    378:   else if (GET_CODE (X) == CONST_DOUBLE && GET_MODE (X) == SFmode)     \
                    379:     { union { double d; int i[2]; } u;                                 \
                    380:       union { float f; int i; } u1;                                    \
                    381:       u.i[0] = CONST_DOUBLE_LOW (X); u.i[1] = CONST_DOUBLE_HIGH (X);   \
                    382:       u1.f = u.d;                                                      \
                    383:       if (CODE == 'f')                                                 \
                    384:         fprintf (FILE, "&0f%.9g", u1.f);                               \
                    385:       else                                                             \
                    386:         fprintf (FILE, "&0x%x", u1.i); }                               \
                    387:   else if (GET_CODE (X) == CONST_DOUBLE && GET_MODE (X) == DFmode)     \
                    388:     { union { double d; int i[2]; } u;                                 \
                    389:       u.i[0] = CONST_DOUBLE_LOW (X); u.i[1] = CONST_DOUBLE_HIGH (X);   \
                    390:       fprintf (FILE, "&0f%.20g", u.d); }                               \
                    391:   else { putc ('&', FILE); output_addr_const (FILE, X); }}
                    392: 
                    393: #define PRINT_OPERAND_ADDRESS(FILE, ADDR)  \
                    394: { register rtx reg1, reg2, breg, ireg;                                 \
                    395:   register rtx addr = ADDR;                                            \
                    396:   rtx offset;                                                          \
                    397:   switch (GET_CODE (addr))                                             \
                    398:     {                                                                  \
                    399:     case REG:                                                          \
                    400:       fprintf (FILE, "(%s)", reg_names[REGNO (addr)]);                 \
                    401:       break;                                                           \
                    402:     case PRE_DEC:                                                      \
                    403:       fprintf (FILE, "-(%s)", reg_names[REGNO (XEXP (addr, 0))]);      \
                    404:       break;                                                           \
                    405:     case POST_INC:                                                     \
                    406:       fprintf (FILE, "(%s)+", reg_names[REGNO (XEXP (addr, 0))]);      \
                    407:       break;                                                           \
                    408:     case PLUS:                                                         \
                    409:       reg1 = 0;        reg2 = 0;                                               \
                    410:       ireg = 0;        breg = 0;                                               \
                    411:       offset = 0;                                                      \
                    412:       if (CONSTANT_ADDRESS_P (XEXP (addr, 0)))                         \
                    413:        {                                                               \
                    414:          offset = XEXP (addr, 0);                                      \
                    415:          addr = XEXP (addr, 1);                                        \
                    416:        }                                                               \
                    417:       else if (CONSTANT_ADDRESS_P (XEXP (addr, 1)))                    \
                    418:        {                                                               \
                    419:          offset = XEXP (addr, 1);                                      \
                    420:          addr = XEXP (addr, 0);                                        \
                    421:        }                                                               \
                    422:       if (GET_CODE (addr) != PLUS) ;                                   \
                    423:       else if (GET_CODE (XEXP (addr, 0)) == SIGN_EXTEND)               \
                    424:        {                                                               \
                    425:          reg1 = XEXP (addr, 0);                                        \
                    426:          addr = XEXP (addr, 1);                                        \
                    427:        }                                                               \
                    428:       else if (GET_CODE (XEXP (addr, 1)) == SIGN_EXTEND)               \
                    429:        {                                                               \
                    430:          reg1 = XEXP (addr, 1);                                        \
                    431:          addr = XEXP (addr, 0);                                        \
                    432:        }                                                               \
                    433:       else if (GET_CODE (XEXP (addr, 0)) == MULT)                      \
                    434:        {                                                               \
                    435:          reg1 = XEXP (addr, 0);                                        \
                    436:          addr = XEXP (addr, 1);                                        \
                    437:        }                                                               \
                    438:       else if (GET_CODE (XEXP (addr, 1)) == MULT)                      \
                    439:        {                                                               \
                    440:          reg1 = XEXP (addr, 1);                                        \
                    441:          addr = XEXP (addr, 0);                                        \
                    442:        }                                                               \
                    443:       else if (GET_CODE (XEXP (addr, 0)) == REG)                       \
                    444:        {                                                               \
                    445:          reg1 = XEXP (addr, 0);                                        \
                    446:          addr = XEXP (addr, 1);                                        \
                    447:        }                                                               \
                    448:       else if (GET_CODE (XEXP (addr, 1)) == REG)                       \
                    449:        {                                                               \
                    450:          reg1 = XEXP (addr, 1);                                        \
                    451:          addr = XEXP (addr, 0);                                        \
                    452:        }                                                               \
                    453:       if (GET_CODE (addr) == REG || GET_CODE (addr) == MULT            \
                    454:          || GET_CODE (addr) == SIGN_EXTEND)                            \
                    455:        { if (reg1 == 0) reg1 = addr; else reg2 = addr; addr = 0; }     \
                    456: /*  for OLD_INDEXING                                                   \
                    457:       else if (GET_CODE (addr) == PLUS)                                        \
                    458:        {                                                               \
                    459:          if (GET_CODE (XEXP (addr, 0)) == REG)                         \
                    460:            {                                                           \
                    461:              reg2 = XEXP (addr, 0);                                    \
                    462:              addr = XEXP (addr, 1);                                    \
                    463:            }                                                           \
                    464:          else if (GET_CODE (XEXP (addr, 1)) == REG)                    \
                    465:            {                                                           \
                    466:              reg2 = XEXP (addr, 1);                                    \
                    467:              addr = XEXP (addr, 0);                                    \
                    468:            }                                                           \
                    469:        }                                                               \
                    470:   */                                                                   \
                    471:       if (offset != 0) { if (addr != 0) abort (); addr = offset; }     \
                    472:       if ((reg1 && (GET_CODE (reg1) == SIGN_EXTEND                     \
                    473:                    || GET_CODE (reg1) == MULT))                        \
                    474:          || (reg2 != 0 && REGNO_OK_FOR_BASE_P (REGNO (reg2))))         \
                    475:        { breg = reg2; ireg = reg1; }                                   \
                    476:       else if (reg1 != 0 && REGNO_OK_FOR_BASE_P (REGNO (reg1)))                \
                    477:        { breg = reg1; ireg = reg2; }                                   \
                    478:       if (ireg != 0 && breg == 0 && GET_CODE (addr) == LABEL_REF)      \
                    479:         { int scale = 1;                                               \
                    480:          if (GET_CODE (ireg) == MULT)                                  \
                    481:            { scale = INTVAL (XEXP (ireg, 1));                          \
                    482:              ireg = XEXP (ireg, 0); }                                  \
                    483:          if (GET_CODE (ireg) == SIGN_EXTEND)                           \
                    484:            fprintf (FILE, "L%d-LI%d(%%pc,%s.w",                        \
                    485:                     CODE_LABEL_NUMBER (XEXP (addr, 0)),                \
                    486:                     CODE_LABEL_NUMBER (XEXP (addr, 0)),                \
                    487:                     reg_names[REGNO (XEXP (ireg, 0))]);                \
                    488:          else                                                          \
                    489:            fprintf (FILE, "L%d-LI%d(%%pc,%s.l",                        \
                    490:                     CODE_LABEL_NUMBER (XEXP (addr, 0)),                \
                    491:                     CODE_LABEL_NUMBER (XEXP (addr, 0)),                \
                    492:                     reg_names[REGNO (ireg)]);                          \
                    493:          if (scale != 1) fprintf (FILE, "*%d", scale);                 \
                    494:          putc (')', FILE);                                             \
                    495:          break; }                                                      \
                    496:       if (ireg != 0 || breg != 0)                                      \
                    497:        { int scale = 1;                                                \
                    498:          if (breg == 0)                                                \
                    499:            abort ();                                                   \
                    500:          if (addr != 0)                                                \
                    501:            output_addr_const (FILE, addr);                             \
                    502:          fprintf (FILE, "(%s", reg_names[REGNO (breg)]);               \
                    503:          if (ireg != 0)                                                \
                    504:            putc (',', FILE);                                           \
                    505:          if (ireg != 0 && GET_CODE (ireg) == MULT)                     \
                    506:            { scale = INTVAL (XEXP (ireg, 1));                          \
                    507:              ireg = XEXP (ireg, 0); }                                  \
                    508:          if (ireg != 0 && GET_CODE (ireg) == SIGN_EXTEND)              \
                    509:            fprintf (FILE, "%s.w", reg_names[REGNO (XEXP (ireg, 0))]);  \
                    510:          else if (ireg != 0)                                           \
                    511:            fprintf (FILE, "%s.l", reg_names[REGNO (ireg)]);            \
                    512:          if (scale != 1) fprintf (FILE, "*%d", scale);                 \
                    513:          putc (')', FILE);                                             \
                    514:          break;                                                        \
                    515:        }                                                               \
                    516:       else if (reg1 != 0 && GET_CODE (addr) == LABEL_REF)              \
                    517:        { fprintf (FILE, "L%d-LI%d(%%pc,%s.w)",                         \
                    518:                   CODE_LABEL_NUMBER (XEXP (addr, 0)),                  \
                    519:                   CODE_LABEL_NUMBER (XEXP (addr, 0)),                  \
                    520:                   reg_names[REGNO (reg1)]);                            \
                    521:          break; }                                                      \
                    522:     default:                                                           \
                    523:       if (GET_CODE (addr) == CONST_INT                                 \
                    524:          && INTVAL (addr) < 0x8000                                     \
                    525:          && INTVAL (addr) >= -0x8000)                                  \
                    526:        fprintf (FILE, "%d.w", INTVAL (addr));                          \
                    527:       else                                                             \
                    528:         output_addr_const (FILE, addr);                                        \
                    529:     }}
                    530: 
                    531: #define        ASM_OUTPUT_ASCII(f, p, size)    \
                    532: { register int i;                      \
                    533:   int inside;                          \
                    534:   inside = FALSE;                      \
                    535:   for (i = 0; i < size; i++) {         \
                    536:     if (i % 8 == 0) {                  \
                    537:       if (i != 0) {                    \
                    538:        if (inside)                     \
                    539:          putc('"', f);                 \
                    540:        putc('\n', f);                  \
                    541:        inside = FALSE;                 \
                    542:       }                                        \
                    543:       fprintf(f, "%s ", ASCII_DATA_ASM_OP);    \
                    544:     }                                  \
                    545:     if (p[i] < 32 || p[i] == '\\' || p[i] == '"' || p[i] == 127) {     \
                    546:       if (inside) {                    \
                    547:        putc('"', f);                   \
                    548:        inside = FALSE;                 \
                    549:       }                                        \
                    550:       if (i % 8 != 0)                  \
                    551:        putc(',', f);                   \
                    552:       fprintf(f, "%d", p[i]);          \
                    553:     } else {                           \
                    554:       if (!inside) {                   \
                    555:        if (i % 8 != 0)                 \
                    556:          putc(',', f);                 \
                    557:        putc('"', f);                   \
                    558:        inside = TRUE;                  \
                    559:       }                                        \
                    560:       putc(p[i], f);                   \
                    561:     }                                  \
                    562:   }                                    \
                    563:   if (inside)                          \
                    564:     putc('"', f);                      \
                    565:   putc('\n', f);                       \
                    566: }
                    567: 
                    568: /* Translate Motorola opcodes such as `jbeq'
                    569:    into SGS opcodes such as `beq.w'.
                    570:    Delete the `e' in `move...' and `fmove'.
                    571:    Change `ftst' to `ftest'.  */
                    572: 
                    573: #define ASM_OUTPUT_OPCODE(FILE, PTR)                   \
                    574: { if ((PTR)[0] == 'j' && (PTR)[1] == 'b')              \
                    575:     { ++(PTR);                                         \
                    576:       while (*(PTR) != ' ')                            \
                    577:        { putc (*(PTR), (FILE)); ++(PTR); }             \
                    578:       fprintf ((FILE), ".w"); }                                \
                    579:   else if ((PTR)[0] == 'f')                            \
                    580:     {                                                  \
                    581:       if (!strncmp ((PTR), "fmove", 5))                        \
                    582:        { fprintf ((FILE), "fmov"); (PTR) += 5; }       \
                    583:       else if (!strncmp ((PTR), "ftst", 4))            \
                    584:        { fprintf ((FILE), "ftest"); (PTR) += 4; }      \
                    585:     }                                                  \
                    586:   else if ((PTR)[0] == 'm' && (PTR)[1] == 'o'          \
                    587:           && (PTR)[2] == 'v' && (PTR)[3] == 'e')       \
                    588:     { fprintf ((FILE), "mov"); (PTR) += 4; }           \
                    589: }
                    590: 
                    591: /* Prevent output of `gcc_compiled.:'.  */
                    592: 
                    593: #define ASM_IDENTIFY_GCC(FILE)
                    594: 
1.1.1.3 ! root      595: #endif /* HPUX_ASM */

unix.superglobalmegacorp.com

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