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

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

unix.superglobalmegacorp.com

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