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

1.1       root        1: /* Definitions of target machine for GNU compiler.  Sun 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 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
                     18: the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.  */
                     19: 
                     20: /* This comment is here to see if it will keep Sun's cpp from dying.  */
                     21: 
                     22: /* If you do not need to generate floating point code for the optional
                     23:    Sun FPA board, you can safely comment out the SUPPORT_SUN_FPA define
                     24:    to gain a little speed and code size.  */
                     25: 
                     26: #define SUPPORT_SUN_FPA
                     27: 
                     28: #include "m68k.h"
                     29: 
                     30: /* See m68k.h.  7 means 68020 with 68881.  */
                     31: 
                     32: #ifndef TARGET_DEFAULT
                     33: #define TARGET_DEFAULT 7
                     34: #endif
                     35: 
                     36: /* Define __HAVE_FPA__ or __HAVE_68881__ in preprocessor,
                     37:    according to the -m flags.
                     38:    This will control the use of inline 68881 insns in certain macros.
                     39:    Also inform the program which CPU this is for.  */
                     40: 
                     41: #if TARGET_DEFAULT & 02
                     42: 
                     43: /* -m68881 is the default */
                     44: #define CPP_SPEC \
                     45: "%{!msoft-float:%{mfpa:-D__HAVE_FPA__ }%{!mfpa:-D__HAVE_68881__ }}\
                     46: %{!ansi:%{m68000:-Dmc68010}%{mc68000:-Dmc68010}%{!mc68000:%{!m68000:-Dmc68020}}}"
                     47: 
                     48: #else
                     49: #if TARGET_DEFAULT & 0100
                     50: 
                     51: /* -mfpa is the default */
                     52: #define CPP_SPEC \
                     53: "%{!msoft-float:%{m68881:-D__HAVE_68881__ }%{!m68881:-D__HAVE_FPA__ }}\
                     54: %{!ansi:%{m68000:-Dmc68010}%{mc68000:-Dmc68010}%{!mc68000:%{!m68000:-Dmc68020}}}"
                     55: 
                     56: #else
                     57: 
                     58: /* -msoft-float is the default */
                     59: #define CPP_SPEC \
                     60: "%{m68881:-D__HAVE_68881__ }%{mfpa:-D__HAVE_FPA__ }\
                     61: %{!ansi:%{m68000:-Dmc68010}%{mc68000:-Dmc68010}%{!mc68000:%{!m68000:-Dmc68020}}}"
                     62: 
                     63: #endif
                     64: #endif
                     65: 
                     66: /* Prevent error on `-sun3' and `-target sun3' options.  */
                     67: 
                     68: #define CC1_SPEC "%{sun3:} %{target:}"
                     69: 
                     70: #define PTRDIFF_TYPE "int"
                     71: #define SIZE_TYPE "int"
                     72: 
                     73: /* We must override m68k.h.  */
                     74: #undef WCHAR_TYPE
                     75: #undef WCHAR_TYPE_SIZE
                     76: #define WCHAR_TYPE "short unsigned int"
                     77: #define WCHAR_TYPE_SIZE 16
                     78: 
                     79: /* These compiler options take an argument.  We ignore -target for now.  */
                     80: 
                     81: #define WORD_SWITCH_TAKES_ARG(STR)                             \
                     82:  (!strcmp (STR, "Tdata") || !strcmp (STR, "include")           \
                     83:   || !strcmp (STR, "imacros") || !strcmp (STR, "target")       \
                     84:   || !strcmp (STR, "assert"))
                     85: 
                     86: /* -m68000 requires special flags to the assembler.  */
                     87: 
                     88: #define ASM_SPEC \
                     89:  "%{m68000:-mc68010}%{mc68000:-mc68010}%{!mc68000:%{!m68000:-mc68020}} \
                     90:   %{fpic:-k} %{fPIC:-k}"
                     91: 
                     92: /* Names to predefine in the preprocessor for this target machine.  */
                     93: 
                     94: #define CPP_PREDEFINES "-Dmc68000 -Dsun -Dunix"
                     95: 
                     96: /* STARTFILE_SPEC to include sun floating point initialization
                     97:    This is necessary (tr: Sun does it) for both the m68881 and the fpa
                     98:    routines.
                     99:    Note that includes knowledge of the default specs for gcc, ie. no
                    100:    args translates to the same effect as -m68881
                    101:    I'm not sure what would happen below if people gave contradictory
                    102:    arguments (eg. -msoft-float -mfpa) */
                    103: 
                    104: #if TARGET_DEFAULT & 0100
                    105: /* -mfpa is the default */
                    106: #define STARTFILE_SPEC                                 \
                    107:   "%{pg:gcrt0.o%s}%{!pg:%{p:mcrt0.o%s}%{!p:crt0.o%s}}  \
                    108:    %{m68881:Mcrt1.o%s}                                 \
                    109:    %{msoft-float:Fcrt1.o%s}                            \
                    110:    %{!m68881:%{!msoft-float:Wcrt1.o%s}}"
                    111: #else
                    112: #if TARGET_DEFAULT & 2
                    113: /* -m68881 is the default */
                    114: #define STARTFILE_SPEC                                 \
                    115:   "%{pg:gcrt0.o%s}%{!pg:%{p:mcrt0.o%s}%{!p:crt0.o%s}}  \
                    116:    %{mfpa:Wcrt1.o%s}                                   \
                    117:    %{msoft-float:Fcrt1.o%s}                            \
                    118:    %{!mfpa:%{!msoft-float:Mcrt1.o%s}}"
                    119: #else
                    120: /* -msoft-float is the default */
                    121: #define STARTFILE_SPEC                                 \
                    122:   "%{pg:gcrt0.o%s}%{!pg:%{p:mcrt0.o%s}%{!p:crt0.o%s}}  \
                    123:    %{m68881:Mcrt1.o%s}                                 \
                    124:    %{mfpa:Wcrt1.o%s}                                   \
                    125:    %{!m68881:%{!mfpa:Fcrt1.o%s}}"
                    126: #endif
                    127: #endif
                    128: 
                    129: /* Specify library to handle `-a' basic block profiling.
                    130:    Control choice of libm.a (if user says -lm)
                    131:    based on fp arith default and options.  */
                    132: 
                    133: #if TARGET_DEFAULT & 0100
                    134: /* -mfpa is the default */
                    135: #define LIB_SPEC "%{g:-lg} %{!p:%{!pg:-lc}}%{p:-lc_p}%{pg:-lc_p} \
                    136: %{a:/usr/lib/bb_link.o} %{g:-lg} \
                    137: %{msoft-float:-L/usr/lib/fsoft}%{m68881:-L/usr/lib/f68881}\
                    138: %{!msoft_float:%{!m68881:-L/usr/lib/ffpa}}"
                    139: #else
                    140: #if TARGET_DEFAULT & 2
                    141: /* -m68881 is the default */
                    142: #define LIB_SPEC "%{g:-lg} %{!p:%{!pg:-lc}}%{p:-lc_p}%{pg:-lc_p} \
                    143: %{a:/usr/lib/bb_link.o} %{g:-lg} \
                    144: %{msoft-float:-L/usr/lib/fsoft}%{!msoft-float:%{!mfpa:-L/usr/lib/f68881}}\
                    145: %{mfpa:-L/usr/lib/ffpa}"
                    146: #else
                    147: /* -msoft-float is the default */
                    148: #define LIB_SPEC "%{g:-lg} %{!p:%{!pg:-lc}}%{p:-lc_p}%{pg:-lc_p} \
                    149: %{a:/usr/lib/bb_link.o} %{g:-lg} \
                    150: %{!m68881:%{!mfpa:-L/usr/lib/fsoft}}%{m68881:-L/usr/lib/f68881}\
                    151: %{mfpa:-L/usr/lib/ffpa}"
                    152: #endif
                    153: #endif
                    154: 
                    155: /* Provide required defaults for linker -e and -d switches.
                    156:    Also, it is hard to debug with shared libraries,
                    157:    so don't use them if going to debug.  */
                    158: 
                    159: #define LINK_SPEC "%{!e*:-e start} -dc -dp %{g:-Bstatic} %{static:-Bstatic} \
                    160:   %{assert*}"
                    161: 
                    162: /* Every structure or union's size must be a multiple of 2 bytes.  */
                    163: 
                    164: #define STRUCTURE_SIZE_BOUNDARY 16
                    165: 
                    166: /* This is BSD, so it wants DBX format.  */
                    167: 
                    168: #define DBX_DEBUGGING_INFO
                    169: 
                    170: /* Allow folding division by zero.  */
                    171: #define REAL_INFINITY
                    172: 
                    173: /* This is how to output an assembler line defining a `double' constant.  */
                    174: 
                    175: #undef ASM_OUTPUT_DOUBLE
                    176: #define ASM_OUTPUT_DOUBLE(FILE,VALUE)                                  \
                    177:   {                                                                    \
                    178:     if (REAL_VALUE_ISINF (VALUE))                                      \
                    179:       fprintf (FILE, "\t.double 0r%s99e999\n", (VALUE) > 0 ? "" : "-");        \
                    180:     else if (isnan (VALUE))                                            \
                    181:       {                                                                        \
                    182:        union { double d; long l[2];} t;                                \
                    183:        t.d = (VALUE);                                                  \
                    184:        fprintf (FILE, "\t.long 0x%lx\n\t.long 0x%lx\n", t.l[0], t.l[1]); \
                    185:       }                                                                        \
                    186:     else                                                               \
                    187:       fprintf (FILE, "\t.double 0r%.17g\n", VALUE);                    \
                    188:   }
                    189: 
                    190: /* This is how to output an assembler line defining a `float' constant.  */
                    191: 
                    192: #undef ASM_OUTPUT_FLOAT
                    193: #define ASM_OUTPUT_FLOAT(FILE,VALUE)                                   \
                    194:   {                                                                    \
                    195:     if (REAL_VALUE_ISINF (VALUE))                                      \
                    196:       fprintf (FILE, "\t.single 0r%s99e999\n", (VALUE) > 0 ? "" : "-");        \
                    197:     else if (isnan (VALUE))                                            \
                    198:       {                                                                        \
                    199:        union { float f; long l;} t;                                    \
                    200:        t.f = (VALUE);                                                  \
                    201:        fprintf (FILE, "\t.long 0x%lx\n", t.l);                         \
                    202:       }                                                                        \
                    203:     else                                                               \
                    204:       fprintf (FILE, "\t.single 0r%.9g\n", VALUE);                     \
                    205:   }
                    206: 
                    207: /* This is how to output an assembler lines defining floating operands.
                    208:    There's no way to output a NaN's fraction, so we lose it.  */
                    209:   
                    210: #undef ASM_OUTPUT_FLOAT_OPERAND
                    211: #define ASM_OUTPUT_FLOAT_OPERAND(FILE,VALUE)                           \
                    212:   (REAL_VALUE_ISINF ((VALUE))                                          \
                    213:    ? (asm_fprintf (FILE, "%I0r%s99e999", ((VALUE) > 0 ? "" : "-")), 0) \
                    214:    : (VALUE) == -0.0                                                   \
                    215:    ? (asm_fprintf (FILE, "%I0r-0.0"), 0)                               \
                    216:    : (asm_fprintf (FILE, "%I0r%.9g", (VALUE)), 0))
                    217: 
                    218: #undef ASM_OUTPUT_DOUBLE_OPERAND
                    219: #define ASM_OUTPUT_DOUBLE_OPERAND(FILE,VALUE)                          \
                    220:   (REAL_VALUE_ISINF ((VALUE))                                          \
                    221:    ? (asm_fprintf (FILE, "%I0r%s99e999", ((VALUE) > 0 ? "" : "-")), 0) \
                    222:    : (VALUE) == -0.0                                                   \
                    223:    ? (asm_fprintf (FILE, "%I0r-0.0"), 0)                               \
                    224:    : (asm_fprintf (FILE, "%I0r%.17g", (VALUE)), 0))

unix.superglobalmegacorp.com

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