1/* Target definitions for GNU compiler for Intel 80860 running OSF/1AD
2   Copyright (C) 1991, 1996 Free Software Foundation, Inc.
3   Based upon original work of Ron Guilmette (rfg@monkeys.com).
4   Contributed by Andy Pfiffer (andyp@ssd.intel.com).
5   Partially inspired by
6	Pete Beckman of Indiana University (beckman@cs.indiana.edu)
7	Harry Dolan of Intel Corporation (dolan@ssd.intel.com)
8
9This file is part of GNU CC.
10
11GNU CC is free software; you can redistribute it and/or modify
12it under the terms of the GNU General Public License as published by
13the Free Software Foundation; either version 2, or (at your option)
14any later version.
15
16GNU CC is distributed in the hope that it will be useful,
17but WITHOUT ANY WARRANTY; without even the implied warranty of
18MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
19GNU General Public License for more details.
20
21You should have received a copy of the GNU General Public License
22along with GNU CC; see the file COPYING.  If not, write to
23the Free Software Foundation, 59 Temple Place - Suite 330,
24Boston, MA 02111-1307, USA.  */
25
26/* For the sake of libgcc2.c, indicate target supports atexit.  */
27#define HAVE_ATEXIT
28
29#undef TARGET_SWITCHES
30#define TARGET_SWITCHES  \
31  { {"xp", 1, "Generate code which uses the FPU"},              \
32    {"noxp", -1, "Do not generate code which uses the FPU"},    \
33    {"xr", -1, "Do not generate code which uses the FPU"},      \
34    {"noieee", -1, "Do not generate code which uses the FPU"},	\
35    {"nx", 2, NULL},                  \
36    { "", TARGET_DEFAULT, NULL}}
37
38#undef TARGET_DEFAULT
39#define TARGET_DEFAULT 1
40
41/* The Intel as860 assembler does not understand .stabs, must use COFF */
42#define PREFERRED_DEBUGGING_TYPE SDB_DEBUG
43
44#undef TARGET_VERSION
45#define TARGET_VERSION fprintf (stderr, " (i860 OSF/1AD)");
46
47#undef CPP_PREDEFINES
48#define CPP_PREDEFINES	"-Di860 -D__i860 -D__i860__ -D__PARAGON__ -D__OSF1__ -D_COFF -Dunix -DMACH -DCMU"
49
50#define CPP_SPEC "%{mnx:-D__NODE}"
51
52/* autoinit.o autolaunches NX applications */
53#define STARTFILE_SPEC "crt0.o%s %{mnx:-yoptions/autoinit.o%s}"
54
55/* libic.a is the PGI intrinsic library */
56/* libpm.o and guard.o are for the performance monitoring modules (ignored) */
57/* /usr/lib/noieee contains non-IEEE compliant (but faster) math routines */
58#if	HAVE_DASH_G
59#define LIB_SPEC \
60"%{mnoieee:-L/usr/lib/noieee} %{mnx:-lnx} %{g*:-lg} -lc -lmach -lc -lic"
61#else	/* HAVE_DASH_G */
62/* can't use -g for -lg; libg.a doesn't have a symbol table and ld complains */
63#define LIB_SPEC "%{mnoieee:-L/usr/lib/noieee} %{mnx:-lnx} -lc -lmach -lc -lic"
64#endif	/* HAVE_DASH_G */
65
66/* Get rid of definition from svr3.h.  */
67#undef SIZE_TYPE
68
69#undef	I860_REG_PREFIX
70
71#undef	ASM_COMMENT_START
72#define ASM_COMMENT_START "//"
73
74#undef TYPE_OPERAND_FMT
75#define TYPE_OPERAND_FMT      "\"%s\""
76
77#define DBX_REGISTER_NUMBER(REGNO) (REGNO)
78
79#undef ASCII_DATA_ASM_OP
80#define ASCII_DATA_ASM_OP	".byte"
81
82/*
83 *	the assembler we're using doesn't grok .ident...
84 */
85#undef	ASM_OUTPUT_IDENT
86#define ASM_OUTPUT_IDENT(FILE, NAME) \
87  fprintf (FILE, "//\t.ident \"%s\"\n", NAME);
88
89/*
90 *	the assembler doesn't grok .double INF and the like
91 *	but does understand .long with hex numbers, so special
92 *	case the "symbolic" IEEE numbers.
93 */
94#undef ASM_OUTPUT_DOUBLE
95#define ASM_OUTPUT_DOUBLE(FILE,VALUE)				\
96  {								\
97    if (REAL_VALUE_ISINF (VALUE)				\
98        || REAL_VALUE_ISNAN (VALUE)				\
99	|| REAL_VALUE_MINUS_ZERO (VALUE))			\
100      {								\
101	long t[2];						\
102	REAL_VALUE_TO_TARGET_DOUBLE ((VALUE), t);		\
103	fprintf (FILE, "\t.long 0x%lx\n\t.long 0x%lx\n", t[0], t[1]); \
104      }								\
105    else							\
106      fprintf (FILE, "\t.double %.20e\n", VALUE);		\
107  }
108
109#undef ASM_OUTPUT_FLOAT
110#define ASM_OUTPUT_FLOAT(FILE,VALUE)				\
111  {								\
112    if (REAL_VALUE_ISINF (VALUE)				\
113        || REAL_VALUE_ISNAN (VALUE)				\
114	|| REAL_VALUE_MINUS_ZERO (VALUE))			\
115      {								\
116	long t;							\
117	REAL_VALUE_TO_TARGET_SINGLE ((VALUE), t);		\
118	fprintf (FILE, "\t.long 0x%lx\n", t);			\
119      }								\
120    else							\
121      fprintf (FILE, "\t.float %.12e\n", VALUE);		\
122  }
123
124#undef	ASM_OUTPUT_ASCII
125#define ASM_OUTPUT_ASCII(FILE, STR, LENGTH)			\
126  do								\
127    {								\
128      register unsigned char *str = (unsigned char *) (STR);	\
129      register unsigned char *limit = str + (LENGTH);		\
130      register unsigned bytes_in_chunk = 0;			\
131      for (; str < limit; str++)				\
132        {							\
133          register unsigned ch = *str;				\
134          if (ch < 32 || ch == '\\' || ch == '"' || ch >= 127)	\
135	    {							\
136	      if (bytes_in_chunk > 0)				\
137	        {						\
138	          fprintf ((FILE), "\"\n");			\
139	          bytes_in_chunk = 0;				\
140	        }						\
141	      fprintf ((FILE), "\t%s\t%d\n", ASM_BYTE_OP, ch);	\
142	    }							\
143          else							\
144	    {							\
145	      if (bytes_in_chunk >= 60)				\
146	        {						\
147	          fprintf ((FILE), "\"\n");			\
148	          bytes_in_chunk = 0;				\
149	        }						\
150	      if (bytes_in_chunk == 0)				\
151	        fprintf ((FILE), "\t%s\t\"", ASCII_DATA_ASM_OP);\
152	      putc (ch, (FILE));				\
153	      bytes_in_chunk++;					\
154	    }							\
155        }							\
156      if (bytes_in_chunk > 0)					\
157        fprintf ((FILE), "\"\n");				\
158    }								\
159  while (0)
160
161
162/* This says how to output an assembler line
163   to define a local common symbol.  */
164
165#undef ASM_OUTPUT_LOCAL
166#define ASM_OUTPUT_LOCAL(FILE, NAME, SIZE, ROUNDED)  \
167( fputs (".lcomm ", (FILE)),			\
168  assemble_name ((FILE), (NAME)),		\
169  fprintf ((FILE), ",%u\n", (ROUNDED)))
170
171/*
172 *	not defining ASM_STABS_OP yields .stabs in the .s file
173 *	when using g++ -- so, I'll define it.
174 */
175#define	ASM_STABS_OP	"//.stabs"
176
177/* Define this macro if an argument declared as `char' or `short' in a
178   prototype should actually be passed as an `int'.  In addition to
179   avoiding errors in certain cases of mismatch, it also makes for
180   better code on certain machines. */
181/*#define PROMOTE_PROTOTYPES*/
182
183/* Define this macro if an instruction to load a value narrower
184   than a word from memory into a register also zero-extends the
185   value to the whole  register.  */
186/*#define BYTE_LOADS_ZERO_EXTEND*/
187
188/* Define this macro as a C expression which is nonzero if
189   accessing less than a word of memory (i.e. a `char' or a
190   `short') is no faster than accessing a word of memory, i.e., if
191   such access require more than one instruction or if there is no
192   difference in cost between byte and (aligned) word loads.
193
194   On RISC machines, it tends to generate better code to define
195   this as 1, since it avoids making a QI or HI mode register.  */
196/*
197#undef SLOW_BYTE_ACCESS
198#define SLOW_BYTE_ACCESS 1
199*/
200
201/* Define if shifts truncate the shift count
202   which implies one can omit a sign-extension or zero-extension
203   of a shift count. */
204#define SHIFT_COUNT_TRUNCATED 1
205
206
207#define FASTEST_ALIGNMENT 32
208
209/* Make strings word-aligned so strcpy from constants will be faster.  */
210#define CONSTANT_ALIGNMENT(EXP, ALIGN)  \
211  (TREE_CODE (EXP) == STRING_CST	\
212   && (ALIGN) < FASTEST_ALIGNMENT ? FASTEST_ALIGNMENT : (ALIGN))
213
214/* Make arrays of chars word-aligned for the same reasons.  */
215#define DATA_ALIGNMENT(TYPE, ALIGN)		\
216  (TREE_CODE (TYPE) == ARRAY_TYPE		\
217   && TYPE_MODE (TREE_TYPE (TYPE)) == QImode	\
218   && (ALIGN) < FASTEST_ALIGNMENT ? FASTEST_ALIGNMENT : (ALIGN))
219
220/*
221 *	disable a few things picked up from svr3.h
222 */
223#undef INIT_SECTION_ASM_OP
224#undef FINI_SECTION_ASM_OP
225#undef CONST_SECTION_ASM_OP
226#undef CTORS_SECTION_ASM_OP
227#undef DTORS_SECTION_ASM_OP
228#undef DO_GLOBAL_CTORS_BODY
229#undef ASM_OUTPUT_DESTRUCTOR
230#undef SELECT_SECTION
231#undef SELECT_RTX_SECTION
232#undef READONLY_DATA_SECTION
233
234#define	BSS_SECTION_ASM_OP	".bss"		/* XXX */
235#undef EXTRA_SECTIONS
236#undef EXTRA_SECTION_FUNCTIONS
237