OSDN Git Service

ba09af3941b63a5a4245dbe43390b86428f85386
[pf3gnuchains/gcc-fork.git] / gcc / config / i860 / paragon.h
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
9 This file is part of GNU CC.
10
11 GNU CC is free software; you can redistribute it and/or modify
12 it under the terms of the GNU General Public License as published by
13 the Free Software Foundation; either version 2, or (at your option)
14 any later version.
15
16 GNU CC is distributed in the hope that it will be useful,
17 but WITHOUT ANY WARRANTY; without even the implied warranty of
18 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
19 GNU General Public License for more details.
20
21 You should have received a copy of the GNU General Public License
22 along with GNU CC; see the file COPYING.  If not, write to
23 the Free Software Foundation, 59 Temple Place - Suite 330,
24 Boston, 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 instruction to load a value narrower
178    than a word from memory into a register also zero-extends the
179    value to the whole  register.  */
180 /*#define BYTE_LOADS_ZERO_EXTEND*/
181
182 /* Define this macro as a C expression which is nonzero if
183    accessing less than a word of memory (i.e. a `char' or a
184    `short') is no faster than accessing a word of memory, i.e., if
185    such access require more than one instruction or if there is no
186    difference in cost between byte and (aligned) word loads.
187
188    On RISC machines, it tends to generate better code to define
189    this as 1, since it avoids making a QI or HI mode register.  */
190 /*
191 #undef SLOW_BYTE_ACCESS
192 #define SLOW_BYTE_ACCESS 1
193 */
194
195 /* Define if shifts truncate the shift count
196    which implies one can omit a sign-extension or zero-extension
197    of a shift count. */
198 #define SHIFT_COUNT_TRUNCATED 1
199
200
201 #define FASTEST_ALIGNMENT 32
202
203 /* Make strings word-aligned so strcpy from constants will be faster.  */
204 #define CONSTANT_ALIGNMENT(EXP, ALIGN)  \
205   (TREE_CODE (EXP) == STRING_CST        \
206    && (ALIGN) < FASTEST_ALIGNMENT ? FASTEST_ALIGNMENT : (ALIGN))
207
208 /* Make arrays of chars word-aligned for the same reasons.  */
209 #define DATA_ALIGNMENT(TYPE, ALIGN)             \
210   (TREE_CODE (TYPE) == ARRAY_TYPE               \
211    && TYPE_MODE (TREE_TYPE (TYPE)) == QImode    \
212    && (ALIGN) < FASTEST_ALIGNMENT ? FASTEST_ALIGNMENT : (ALIGN))
213
214 /*
215  *      disable a few things picked up from svr3.h
216  */
217 #undef INIT_SECTION_ASM_OP
218 #undef FINI_SECTION_ASM_OP
219 #undef CONST_SECTION_ASM_OP
220 #undef CTORS_SECTION_ASM_OP
221 #undef DTORS_SECTION_ASM_OP
222 #undef DO_GLOBAL_CTORS_BODY
223 #undef ASM_OUTPUT_DESTRUCTOR
224 #undef SELECT_SECTION
225 #undef SELECT_RTX_SECTION
226 #undef READONLY_DATA_SECTION
227
228 #define BSS_SECTION_ASM_OP      ".bss"          /* XXX */
229 #undef EXTRA_SECTIONS
230 #undef EXTRA_SECTION_FUNCTIONS