Annotation of gcc/config/encore.h, revision 1.1.1.1

1.1       root        1: /* Definitions of target machine for GNU compiler.  ENCORE NS32000 version.
                      2:    Copyright (C) 1988 Free Software Foundation, Inc.
                      3:    Adapted by Robert Brown ([email protected]) from the Sequent
                      4:      version by Michael Tiemann ([email protected]).
                      5: 
                      6: This file is part of GNU CC.
                      7: 
                      8: GNU CC is free software; you can redistribute it and/or modify
                      9: it under the terms of the GNU General Public License as published by
                     10: the Free Software Foundation; either version 2, or (at your option)
                     11: any later version.
                     12: 
                     13: GNU CC is distributed in the hope that it will be useful,
                     14: but WITHOUT ANY WARRANTY; without even the implied warranty of
                     15: MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
                     16: GNU General Public License for more details.
                     17: 
                     18: You should have received a copy of the GNU General Public License
                     19: along with GNU CC; see the file COPYING.  If not, write to
                     20: the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.  */
                     21: 
                     22: 
                     23: /*
                     24:  *  Looks like all multiprocessors have this bug!
                     25:  */
                     26: 
                     27: #define SEQUENT_ADDRESS_BUG 1
                     28: 
                     29: #include "ns32k.h"
                     30: 
                     31: #define SDB_DEBUGGING_INFO
                     32: #undef DBX_REGISTER_NUMBER
                     33: #define DBX_REGISTER_NUMBER(REGNO) (REGNO)
                     34: 
                     35: /* Cause long-jump assembler to be used,
                     36:    since otherwise some files fail to be assembled right.  */
                     37: #define ASM_SPEC "-j"
                     38: 
                     39: #undef ASM_FILE_START
                     40: #undef ASM_GENERATE_INTERNAL_LABEL
                     41: #undef ASM_OUTPUT_ADDR_DIFF_ELT
                     42: #undef ASM_OUTPUT_ALIGN
                     43: #undef ASM_OUTPUT_ASCII
                     44: #undef ASM_OUTPUT_DOUBLE
                     45: #undef ASM_OUTPUT_INT
                     46: #undef ASM_OUTPUT_INTERNAL_LABEL
                     47: #undef ASM_OUTPUT_LOCAL
                     48: #undef CPP_PREDEFINES
                     49: #undef FUNCTION_BOUNDARY
                     50: #undef PRINT_OPERAND
                     51: #undef PRINT_OPERAND_ADDRESS
                     52: #undef TARGET_VERSION
                     53: #undef FUNCTION_PROFILER
                     54: #undef ASM_OUTPUT_LABELREF_AS_INT
                     55: 
                     56: #define TARGET_DEFAULT 25  /* 32532 with 32081 (guessing) */
                     57: #define TARGET_VERSION fprintf (stderr, " (32000, Encore syntax)");
                     58: /* Note Encore does not standardly do -Dencore.  */
                     59: /* budd: should have a -ns32332 (or -apc) switch! but no harm for now */
                     60: #define CPP_PREDEFINES "-Dns32000 -Dn16 -Dns16000 -Dns32332 -Dunix"
                     61: 
                     62: /* Ignore certain cpp directives used in header files on sysV.  */
                     63: #define SCCS_DIRECTIVE
                     64: 
                     65: /* Output #ident as a .ident.  */
                     66: #define ASM_OUTPUT_IDENT(FILE, NAME) fprintf (FILE, "\t.ident \"%s\"\n", NAME);
                     67: 
                     68: /* The .file command should always begin the output.  */
                     69: #define ASM_FILE_START(FILE) \
                     70: output_file_directive ((FILE), main_input_filename)
                     71: 
                     72: #define FUNCTION_BOUNDARY 128          /* speed optimization */
                     73: 
                     74: /*
                     75:  *  The Encore assembler uses ".align 2" to align on 2-byte boundaries.
                     76:  */
                     77: 
                     78: #define ASM_OUTPUT_ALIGN(FILE,LOG)                                     \
                     79:        fprintf (FILE, "\t.align %d\n", 1 << (LOG))
                     80: 
                     81: /*
                     82:  *  Internal labels are prefixed with a period.
                     83:  */
                     84: 
                     85: #define ASM_GENERATE_INTERNAL_LABEL(LABEL,PREFIX,NUM)                  \
                     86:        sprintf (LABEL, "*.%s%d", PREFIX, NUM)
                     87: #define ASM_OUTPUT_INTERNAL_LABEL(FILE,PREFIX,NUM)                     \
                     88:        fprintf (FILE, ".%s%d:\n", PREFIX, NUM)
                     89: #define ASM_OUTPUT_ADDR_DIFF_ELT(FILE, VALUE, REL)                     \
                     90:        fprintf (FILE, "\t.word .L%d-.LI%d\n", VALUE, REL)
                     91: 
                     92: /*
                     93:  *  Different syntax for integer constants, double constants, and
                     94:  *  uninitialized locals.
                     95:  */
                     96: 
                     97: #define ASM_OUTPUT_INT(FILE,VALUE)                             \
                     98: ( fprintf (FILE, "\t.double "),                                        \
                     99:   output_addr_const (FILE, (VALUE)),                           \
                    100:   fprintf (FILE, "\n"))
                    101: 
                    102: #define ASM_OUTPUT_LABELREF_AS_INT(STREAM, NAME)                       \
                    103: do {                                                                   \
                    104:   fprintf (STREAM, "\t.double\t");                                     \
                    105:   ASM_OUTPUT_LABELREF (STREAM, NAME);                                  \
                    106:   fprintf (STREAM, "\n");                                              \
                    107: } while (0)
                    108: 
                    109: 
                    110: #define ASM_OUTPUT_DOUBLE(FILE,VALUE)                          \
                    111:  fprintf (FILE, "\t.long 0f%.20e\n", (VALUE))
                    112: 
                    113: #define ASM_OUTPUT_LOCAL(FILE, NAME, SIZE, ROUNDED)            \
                    114: ( fputs ("\t.bss ", (FILE)),                                   \
                    115:   assemble_name ((FILE), (NAME)),                              \
                    116:   fprintf ((FILE), ",%u,%u\n", (SIZE), (ROUNDED)))
                    117: 
                    118:  /*
                    119:   *  Encore assembler can't handle huge string constants like the one in
                    120:   *  gcc.c.  If the default routine in varasm.c were more conservative, this
                    121:   *  code could be eliminated.  It starts a new .ascii directive every 40
                    122:   *  characters.
                    123:   */
                    124: 
                    125: #define ASM_OUTPUT_ASCII(file, p, size)                        \
                    126: {                                                      \
                    127:   for (i = 0; i < (size); i++)                         \
                    128:     {                                                  \
                    129:       register int c = (p)[i];                         \
                    130:       if ((i / 40) * 40 == i)                          \
                    131:       if (i == 0)                                      \
                    132:         fprintf ((file), "\t.ascii \"");               \
                    133:       else                                             \
                    134:         fprintf ((file), "\"\n\t.ascii \"");           \
                    135:       if (c == '\"' || c == '\\')                      \
                    136:         putc ('\\', (file));                           \
                    137:       if (c >= ' ' && c < 0177)                                \
                    138:         putc (c, (file));                              \
                    139:       else                                             \
                    140:         {                                              \
                    141:           fprintf ((file), "\\%o", c);                 \
                    142:           if (i < (size) - 1                           \
                    143:               && (p)[i + 1] >= '0' && (p)[i + 1] <= '9')\
                    144:           fprintf ((file), "\"\n\t.ascii \"");         \
                    145:         }                                              \
                    146:     }                                                  \
                    147:   fprintf ((file), "\"\n");                            \
                    148: }
                    149: 
                    150:  /*
                    151:   *  Dollar signs are required before immediate operands, double
                    152:   *  floating point constants use $0f syntax, and external addresses
                    153:   *  should be prefixed with a question mark to avoid assembler warnings
                    154:   *  about undefined symbols.
                    155:   */
                    156: 
                    157: #define PRINT_OPERAND(FILE, X, CODE)                                   \
                    158: { if (CODE == '$') putc ('$', FILE);                                   \
                    159:   else if (CODE == '?') fputc ('?', FILE);                             \
                    160:   else if (GET_CODE (X) == REG)                                                \
                    161:     fprintf (FILE, "%s", reg_names[REGNO (X)]);                                \
                    162:   else if (GET_CODE (X) == MEM)                                                \
                    163:     {                                                                  \
                    164:       rtx xfoo;                                                                \
                    165:       xfoo = XEXP (X, 0);                                              \
                    166:       switch (GET_CODE (xfoo))                                         \
                    167:        {                                                               \
                    168:        case MEM:                                                       \
                    169:          if (GET_CODE (XEXP (xfoo, 0)) == REG)                         \
                    170:            if (REGNO (XEXP (xfoo, 0)) == STACK_POINTER_REGNUM)         \
                    171:              fprintf (FILE, "0(0(sp))");                               \
                    172:            else fprintf (FILE, "0(0(%s))",                             \
                    173:                          reg_names[REGNO (XEXP (xfoo, 0))]);           \
                    174:          else                                                          \
                    175:            {                                                           \
                    176:              fprintf (FILE, "0(");                                     \
                    177:              output_address (xfoo);                                    \
                    178:              putc (')', FILE);                                         \
                    179:            }                                                           \
                    180:          break;                                                        \
                    181:        case REG:                                                       \
                    182:          fprintf (FILE, "0(%s)", reg_names[REGNO (xfoo)]);             \
                    183:          break;                                                        \
                    184:        case PRE_DEC:                                                   \
                    185:        case POST_INC:                                                  \
                    186:          fprintf (FILE, "tos");                                        \
                    187:          break;                                                        \
                    188:        case CONST_INT:                                                 \
                    189:          fprintf (FILE, "@%d", INTVAL (xfoo));                         \
                    190:          break;                                                        \
                    191:        default:                                                        \
                    192:          output_address (xfoo);                                        \
                    193:          break;                                                        \
                    194:        }                                                               \
                    195:     }                                                                  \
                    196:   else if (GET_CODE (X) == CONST_DOUBLE && GET_MODE (X) != DImode)     \
                    197:     if (GET_MODE (X) == DFmode)                                                \
                    198:       { union { double d; int i[2]; } u;                               \
                    199:        u.i[0] = CONST_DOUBLE_LOW (X); u.i[1] = CONST_DOUBLE_HIGH (X);  \
                    200:        fprintf (FILE, "$0f%.20e", u.d); }                              \
                    201:     else { union { double d; int i[2]; } u;                            \
                    202:           u.i[0] = CONST_DOUBLE_LOW (X); u.i[1] = CONST_DOUBLE_HIGH (X); \
                    203:           fprintf (FILE, "$0f%.20e", u.d); }                           \
                    204:   else if (GET_CODE (X) == CONST)                                      \
                    205:     output_addr_const (FILE, X);                                       \
                    206:   else { putc ('$', FILE); output_addr_const (FILE, X); }}
                    207: 
                    208: #define PRINT_OPERAND_ADDRESS(FILE, ADDR)  print_operand_address(FILE, ADDR)
                    209: 
                    210: /* Change the way in which data is allocated and initialized on the
                    211:    encore so that both private and shared data are supported.  Shared data
                    212:    that is initialized must be contained in the ".shrdata" section
                    213:    of the program.  This is accomplished by defining the SHARED_SECTION_ASM_OP
                    214:    macro.  Share data that is simply allocated, and not initialized must
                    215:    be prefixed with the ".shrcomm" or ".shrbss" pseudo op, for common or
                    216:    local data respectively.  This is accomplished by redefining the
                    217:    ASM_OUTPUT_COMMON and ASM_OUTPUT_LOCAL macros. */
                    218:     
                    219: /* Assembler pseudo-op for shared data segment. */
                    220: 
                    221: #define SHARED_SECTION_ASM_OP ".shrdata"
                    222: 
                    223: /* This says how to output an assembler line
                    224:    to define a shared common symbol. */
                    225: 
                    226: #define ASM_OUTPUT_SHARED_COMMON(FILE, NAME, SIZE, ROUNDED) \
                    227: ( fputs (".shrcomm ", (FILE)),                 \
                    228:   assemble_name ((FILE), (NAME)),              \
                    229:   fprintf ((FILE), ",%d\n", (ROUNDED)))
                    230: 
                    231: /* This says how to output an assembler line
                    232:    to define a shared local symbol. */
                    233: 
                    234: #define ASM_OUTPUT_SHARED_LOCAL(FILE, NAME, SIZE, ROUNDED) \
                    235: ( fputs ("\t.shrbss ", (FILE)),                                \
                    236:   assemble_name ((FILE), (NAME)),                      \
                    237:   fprintf ((FILE), ",%d,%d\n", (SIZE), (ROUNDED)))
                    238: 
                    239: #define FUNCTION_PROFILER(FILE, LABELNO)  \
                    240:    fprintf (FILE, "\taddr .LP%d,r0\n\tjsr mcount\n", (LABELNO))

unix.superglobalmegacorp.com

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