home *** CD-ROM | disk | FTP | other *** search
/ Education Sampler 1992 [NeXTSTEP] / Education_1992_Sampler.iso / NeXT / GnuSource / cc-61.0.1 / cc / config / tm-sun3.h < prev    next >
C/C++ Source or Header  |  1991-06-03  |  7KB  |  205 lines

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