1*c87b03e5Sespie /* Definitions of target machine for GNU compiler. Sun 2 running SunOS 4. 2*c87b03e5Sespie Copyright (C) 1987, 1988, 1993, 1996, 1997 Free Software Foundation, Inc. 3*c87b03e5Sespie 4*c87b03e5Sespie This file is part of GNU CC. 5*c87b03e5Sespie 6*c87b03e5Sespie GNU CC is free software; you can redistribute it and/or modify 7*c87b03e5Sespie it under the terms of the GNU General Public License as published by 8*c87b03e5Sespie the Free Software Foundation; either version 2, or (at your option) 9*c87b03e5Sespie any later version. 10*c87b03e5Sespie 11*c87b03e5Sespie GNU CC is distributed in the hope that it will be useful, 12*c87b03e5Sespie but WITHOUT ANY WARRANTY; without even the implied warranty of 13*c87b03e5Sespie MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14*c87b03e5Sespie GNU General Public License for more details. 15*c87b03e5Sespie 16*c87b03e5Sespie You should have received a copy of the GNU General Public License 17*c87b03e5Sespie along with GNU CC; see the file COPYING. If not, write to 18*c87b03e5Sespie the Free Software Foundation, 59 Temple Place - Suite 330, 19*c87b03e5Sespie Boston, MA 02111-1307, USA. */ 20*c87b03e5Sespie 21*c87b03e5Sespie #include "m68k/sun2.h" 22*c87b03e5Sespie 23*c87b03e5Sespie 24*c87b03e5Sespie /* Define __HAVE_SKY__ in preprocessor, according to the -m flags. 25*c87b03e5Sespie Also inform the program which CPU this is for. */ 26*c87b03e5Sespie 27*c87b03e5Sespie #undef CPP_SPEC 28*c87b03e5Sespie 29*c87b03e5Sespie #undef PTRDIFF_TYPE 30*c87b03e5Sespie #define PTRDIFF_TYPE "int" 31*c87b03e5Sespie #undef SIZE_TYPE 32*c87b03e5Sespie #define SIZE_TYPE "int" 33*c87b03e5Sespie #undef WCHAR_TYPE 34*c87b03e5Sespie #define WCHAR_TYPE "short unsigned int" 35*c87b03e5Sespie #undef WCHAR_TYPE_SIZE 36*c87b03e5Sespie #define WCHAR_TYPE_SIZE 16 37*c87b03e5Sespie 38*c87b03e5Sespie #if TARGET_DEFAULT & MASK_SKY 39*c87b03e5Sespie 40*c87b03e5Sespie /* -msky is the default */ 41*c87b03e5Sespie #define CPP_SPEC \ 42*c87b03e5Sespie "%{!msoft-float:-D__HAVE_SKY__}\ 43*c87b03e5Sespie %{!ansi:%{m68020:-Dmc68020}%{mc68020:-Dmc68020}%{!mc68020:%{!m68020:-Dmc68010}}}" 44*c87b03e5Sespie 45*c87b03e5Sespie #else 46*c87b03e5Sespie 47*c87b03e5Sespie /* -msoft-float is the default */ 48*c87b03e5Sespie #define CPP_SPEC \ 49*c87b03e5Sespie "%{msky:-D__HAVE_SKY__ }\ 50*c87b03e5Sespie %{!ansi:%{m68020:-Dmc68020}%{mc68020:-Dmc68020}%{!mc68020:%{!m68020:-Dmc68010}}}" 51*c87b03e5Sespie 52*c87b03e5Sespie #endif 53*c87b03e5Sespie 54*c87b03e5Sespie /* STARTFILE_SPEC to include sun floating point initialization 55*c87b03e5Sespie This is necessary (tr: Sun does it) for the sky routines. 56*c87b03e5Sespie I'm not sure what would happen below if people gave contradictory 57*c87b03e5Sespie arguments (eg. -msoft-float -mfpa) */ 58*c87b03e5Sespie 59*c87b03e5Sespie #undef STARTFILE_SPEC 60*c87b03e5Sespie 61*c87b03e5Sespie #if TARGET_DEFAULT & MASK_SKY 62*c87b03e5Sespie /* -msky is the default */ 63*c87b03e5Sespie #define STARTFILE_SPEC \ 64*c87b03e5Sespie "%{pg:gcrt0.o%s}%{!pg:%{p:mcrt0.o%s}%{!p:crt0.o%s}} \ 65*c87b03e5Sespie %{msoft-float:Fcrt1.o%s} \ 66*c87b03e5Sespie %{!msoft-float:Scrt1.o%s}" 67*c87b03e5Sespie #else 68*c87b03e5Sespie /* -msoft-float is the default */ 69*c87b03e5Sespie #define STARTFILE_SPEC \ 70*c87b03e5Sespie "%{pg:gcrt0.o%s}%{!pg:%{p:mcrt0.o%s}%{!p:crt0.o%s}} \ 71*c87b03e5Sespie %{msky:Scrt1.o%s} \ 72*c87b03e5Sespie %{!msky:Fcrt1.o%s}" 73*c87b03e5Sespie #endif 74*c87b03e5Sespie 75*c87b03e5Sespie /* Specify library to handle `-a' basic block profiling. 76*c87b03e5Sespie Control choice of libm.a (if user says -lm) 77*c87b03e5Sespie based on fp arith default and options. */ 78*c87b03e5Sespie 79*c87b03e5Sespie #undef LIB_SPEC 80*c87b03e5Sespie 81*c87b03e5Sespie #if TARGET_DEFAULT & MASK_SKY 82*c87b03e5Sespie /* -msky is the default */ 83*c87b03e5Sespie #define LIB_SPEC "%{!p:%{!pg:-lc}}%{p:-lc_p}%{pg:-lc_p} \ 84*c87b03e5Sespie %{a:/usr/lib/bb_link.o -lc} %{g:-lg} \ 85*c87b03e5Sespie %{msoft-float:-L/usr/lib/fsoft} \ 86*c87b03e5Sespie %{!msoft_float:-L/usr/lib/fsky}" 87*c87b03e5Sespie #else 88*c87b03e5Sespie /* -msoft-float is the default */ 89*c87b03e5Sespie #define LIB_SPEC "%{!p:%{!pg:-lc}}%{p:-lc_p}%{pg:-lc_p} \ 90*c87b03e5Sespie %{a:/usr/lib/bb_link.o -lc} %{g:-lg} \ 91*c87b03e5Sespie %{!msky:-L/usr/lib/fsoft} \ 92*c87b03e5Sespie %{msky:-L/usr/lib/ffpa}" 93*c87b03e5Sespie #endif 94*c87b03e5Sespie 95*c87b03e5Sespie #undef LINK_SPEC 96*c87b03e5Sespie #define LINK_SPEC \ 97*c87b03e5Sespie "%{!nostdlib:%{!r*:%{!e*:-e start}}} -dc -dp %{static:-Bstatic}" 98*c87b03e5Sespie 99*c87b03e5Sespie #undef ASM_OUTPUT_FLOAT_OPERAND 100*c87b03e5Sespie #define ASM_OUTPUT_FLOAT_OPERAND(CODE,FILE,VALUE) \ 101*c87b03e5Sespie do { \ 102*c87b03e5Sespie if (CODE != 'f') \ 103*c87b03e5Sespie { \ 104*c87b03e5Sespie long l; \ 105*c87b03e5Sespie REAL_VALUE_TO_TARGET_SINGLE (VALUE, l); \ 106*c87b03e5Sespie if (sizeof (int) == sizeof (long)) \ 107*c87b03e5Sespie asm_fprintf ((FILE), "%I0x%x", (int) l); \ 108*c87b03e5Sespie else \ 109*c87b03e5Sespie asm_fprintf ((FILE), "%I0x%lx", l); \ 110*c87b03e5Sespie } \ 111*c87b03e5Sespie else if (REAL_VALUE_ISINF (VALUE)) \ 112*c87b03e5Sespie { \ 113*c87b03e5Sespie if (REAL_VALUE_NEGATIVE (VALUE)) \ 114*c87b03e5Sespie fprintf (FILE, "#0r-99e999"); \ 115*c87b03e5Sespie else \ 116*c87b03e5Sespie fprintf (FILE, "#0r99e999"); \ 117*c87b03e5Sespie } \ 118*c87b03e5Sespie else if (REAL_VALUE_MINUS_ZERO (VALUE)) \ 119*c87b03e5Sespie { \ 120*c87b03e5Sespie fprintf (FILE, "#0r-0.0"); \ 121*c87b03e5Sespie } \ 122*c87b03e5Sespie else \ 123*c87b03e5Sespie { char dstr[30]; \ 124*c87b03e5Sespie real_to_decimal (dstr, &(VALUE), sizeof (dstr), 9, 0); \ 125*c87b03e5Sespie fprintf (FILE, "#0r%s", dstr); \ 126*c87b03e5Sespie } \ 127*c87b03e5Sespie } while (0) 128*c87b03e5Sespie 129*c87b03e5Sespie #undef ASM_OUTPUT_DOUBLE_OPERAND 130*c87b03e5Sespie #define ASM_OUTPUT_DOUBLE_OPERAND(FILE,VALUE) \ 131*c87b03e5Sespie do { if (REAL_VALUE_ISINF (VALUE)) \ 132*c87b03e5Sespie { \ 133*c87b03e5Sespie if (REAL_VALUE_NEGATIVE (VALUE)) \ 134*c87b03e5Sespie fprintf (FILE, "#0r-99e999"); \ 135*c87b03e5Sespie else \ 136*c87b03e5Sespie fprintf (FILE, "#0r99e999"); \ 137*c87b03e5Sespie } \ 138*c87b03e5Sespie else if (REAL_VALUE_MINUS_ZERO (VALUE)) \ 139*c87b03e5Sespie { \ 140*c87b03e5Sespie fprintf (FILE, "#0r-0.0"); \ 141*c87b03e5Sespie } \ 142*c87b03e5Sespie else \ 143*c87b03e5Sespie { char dstr[30]; \ 144*c87b03e5Sespie real_to_decimal (dstr, &(VALUE), sizeof (dstr), 0, 1); \ 145*c87b03e5Sespie fprintf (FILE, "#0r%s", dstr); \ 146*c87b03e5Sespie } \ 147*c87b03e5Sespie } while (0) 148