OSDN Git Service

* emit-rtl.c, final.c, fold-const.c, gengenrtl.c, optabs.c,
[pf3gnuchains/gcc-fork.git] / gcc / config / convex / convex.h
1 /* Definitions of target machine for GNU compiler.  Convex version.
2    Copyright (C) 1988, 1994, 1995, 1996, 2000, 2001, 2002
3    Free Software Foundation, Inc.
4
5 This file is part of GNU CC.
6
7 GNU CC is free software; you can redistribute it and/or modify
8 it under the terms of the GNU General Public License as published by
9 the Free Software Foundation; either version 2, or (at your option)
10 any later version.
11
12 GNU CC is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15 GNU General Public License for more details.
16
17 You should have received a copy of the GNU General Public License
18 along with GNU CC; see the file COPYING.  If not, write to
19 the Free Software Foundation, 59 Temple Place - Suite 330,
20 Boston, MA 02111-1307, USA.  */
21
22
23 /* Standard GCC variables that we reference.  */
24
25 extern int target_flags;
26
27 /* Convex machine-specific flags
28    -mc1               target instruction set, libraries, scheduling 
29    -mc2 
30    -mc32
31    -mc34
32    -mc38
33    -margcount         use standard calling sequence, with arg count word
34    -mno-argcount      don't push arg count, depend on symbol table
35    -margcount-nop     place arg count in a nop instruction (faster than push)
36    -mvolatile-cache   use data cache for volatile mem refs (default)
37    -mvolatile-nocache  bypass data cache for volatile mem refs
38    -mlong32           cc- and libc-compatible 32-bit longs
39    -mlong64           64-bit longs
40 */
41
42 /* Macro to define tables used to set -mXXX flags.
43    This is a list in braces of pairs in braces,
44    each pair being { "NAME", VALUE }
45    where VALUE is the bits to set or minus the bits to clear.
46    An empty string NAME is used to identify the default VALUE.  */
47
48 #ifndef TARGET_DEFAULT
49 #define TARGET_DEFAULT 0
50 #endif
51
52 #define TARGET_SWITCHES                                                 \
53   { { "c1", 001, N_("Generate code for c1") },                          \
54     { "c2", 002, N_("Generate code for c2") },                          \
55     { "c32", 004, N_("Generate code for c32") },                        \
56     { "c34", 010, N_("Generate code for c34") },                        \
57     { "c38", 020, N_("Generate code for c34") },                        \
58     { "argcount", 0100,                                                 \
59       N_("Use standard calling sequence, with arg count word")},        \
60     { "argcount-nop", 0200,                                             \
61       N_("Place arg count in a nop instruction (faster than push)") },  \
62     { "no-argcount", -0300,                                             \
63       N_("Don't push arg count, depend on symbol table") },             \
64     { "volatile-cache", -0400,                                          \
65       N_("Use data cache for volatile mem refs (default)") },           \
66     { "no-volatile-cache", 0400,                                        \
67       N_("Don't use data cache for volatile mem refs") },               \
68     { "volatile-nocache", 0400,                                         \
69       N_("Bypass data cache for volatile mem refs") },                  \
70     { "long64", 01000, N_("Use 64-bit longs") },                        \
71     { "long32", -01000, N_("Use cc- and libc-compatible 32-bit longs")},\
72     { "", TARGET_DEFAULT | TARGET_CPU_DEFAULT}}
73
74 /* Macros used in the machine description to test the flags.  */
75
76 #define TARGET_C1 (target_cpu == 0)
77 #define TARGET_C2 (target_cpu == 1)
78 #define TARGET_C34 (target_cpu == 2)
79 #define TARGET_C38 (target_cpu == 3)
80 #define TARGET_ARGCOUNT (target_flags & 0100)
81 #define TARGET_ARGCOUNT_NOP (target_flags & 0200)
82 #define TARGET_LONG64 (target_flags & 01000)
83 #define TARGET_VOLATILE_NOCACHE (target_flags & 0400)
84
85 #define OVERRIDE_OPTIONS                                                \
86 {                                                                       \
87   init_convex ();                                                       \
88   if ((target_flags & 077) != ((TARGET_DEFAULT | TARGET_CPU_DEFAULT) & 077)) \
89     target_flags &= ~ (TARGET_DEFAULT | TARGET_CPU_DEFAULT);            \
90   if (target_flags & 001)                                               \
91     target_cpu = 0;                                                     \
92   else if (target_flags & 006)                                          \
93     target_cpu = 1;                                                     \
94   else if (target_flags & 010)                                          \
95     target_cpu = 2;                                                     \
96   else if (target_flags & 020)                                          \
97     target_cpu = 3;                                                     \
98 }
99
100 /* Names to predefine in the preprocessor for this target machine.  */
101
102 #define CPP_PREDEFINES "-Dconvex -Dunix -Asystem=unix -Acpu=convex -Amachine=convex"
103
104 /* Print subsidiary information on the compiler version in use.  */
105
106 #define TARGET_VERSION fprintf (stderr, " (convex)");
107
108 /* Target-dependent specs.
109    Some libraries come in c1 and c2+ versions; use the appropriate ones.
110    Make a target-dependent __convex_cxx__ define to relay the target cpu
111    to the program being compiled.  */
112
113 #if (TARGET_DEFAULT | TARGET_CPU_DEFAULT) & 1
114
115 /* C1 default */
116
117 #if _IEEE_FLOAT_
118
119 #define CPP_SPEC                                                        \
120 "%{!mc2:%{!mc32:%{!mc34:%{!mc38:-D__convex_c1__}}}}                     \
121  %{mc2:-D__convex_c2__}                                                 \
122  %{mc32:-D__convex_c32__}                                               \
123  %{mc34:-D__convex_c34__}                                               \
124  %{mc38:-D__convex_c38__}                                               \
125  %{fno-builtin:-D__NO_INLINE}                                           \
126  -D__NO_INLINE_MATH -D__NO_INLINE_STDLIB                                \
127  -D_IEEE_FLOAT_                                                         \
128  %{.S:-P}                                                               \
129  -D__stdc__ -D_LONGLONG                                                 \
130  -Ds64_t=long\\ long -Du64_t=unsigned\\ long\\ long                     \
131  %{!ansi:-D_POSIX_SOURCE}                                               \
132  %{!ansi:-D_CONVEX_SOURCE}"
133
134 #else
135
136 #define CPP_SPEC                                                        \
137 "%{!mc2:%{!mc32:%{!mc34:%{!mc38:-D__convex_c1__}}}}                     \
138  %{mc2:-D__convex_c2__}                                                 \
139  %{mc32:-D__convex_c32__}                                               \
140  %{mc34:-D__convex_c34__}                                               \
141  %{mc38:-D__convex_c38__}                                               \
142  %{fno-builtin:-D__NO_INLINE}                                           \
143  -D__NO_INLINE_MATH -D__NO_INLINE_STDLIB                                \
144  -D_CONVEX_FLOAT_                                                       \
145  %{.S:-P}                                                               \
146  -D__stdc__ -D_LONGLONG                                                 \
147  -Ds64_t=long\\ long -Du64_t=unsigned\\ long\\ long                     \
148  %{!ansi:-D_POSIX_SOURCE}                                               \
149  %{!ansi:-D_CONVEX_SOURCE}"
150
151 #endif
152
153 #define LIB_SPEC                                                        \
154 "%{!mc2:%{!mc32:%{!mc34:%{!mc38:-lC1%{p:_p}%{pg:_p}}}}} \
155  %{mc2:-lC2%{p:_p}%{pg:_p}}                             \
156  %{mc32:-lC2%{p:_p}%{pg:_p}}                            \
157  %{mc34:-lC2%{p:_p}%{pg:_p}}                            \
158  %{mc38:-lC2%{p:_p}%{pg:_p}}                            \
159  -lc%{p:_p}%{pg:_p}"
160
161 #endif
162
163 #if (TARGET_DEFAULT | TARGET_CPU_DEFAULT) & 2
164
165 /* C2 default */
166
167 #if _IEEE_FLOAT_
168
169 #define CPP_SPEC                                                        \
170 "%{mc1:-D__convex_c1__}                                                 \
171  %{!mc1:%{!mc32:%{!mc34:%{!mc38:-D__convex_c2__}}}}                     \
172  %{mc32:-D__convex_c32__}                                               \
173  %{mc34:-D__convex_c34__}                                               \
174  %{mc38:-D__convex_c38__}                                               \
175  %{fno-builtin:-D__NO_INLINE}                                           \
176  -D__NO_INLINE_MATH -D__NO_INLINE_STDLIB                                \
177  -D_IEEE_FLOAT_                                                         \
178  %{.S:-P}                                                               \
179  -D__stdc__ -D_LONGLONG                                                 \
180  -Ds64_t=long\\ long -Du64_t=unsigned\\ long\\ long                     \
181  %{!ansi:-D_POSIX_SOURCE}                                               \
182  %{!ansi:-D_CONVEX_SOURCE}"
183
184 #else
185
186 #define CPP_SPEC                                                        \
187 "%{mc1:-D__convex_c1__}                                                 \
188  %{!mc1:%{!mc32:%{!mc34:%{!mc38:-D__convex_c2__}}}}                     \
189  %{mc32:-D__convex_c32__}                                               \
190  %{mc34:-D__convex_c34__}                                               \
191  %{mc38:-D__convex_c38__}                                               \
192  %{fno-builtin:-D__NO_INLINE}                                           \
193  -D__NO_INLINE_MATH -D__NO_INLINE_STDLIB                                \
194  -D_CONVEX_FLOAT_                                                       \
195  %{.S:-P}                                                               \
196  -D__stdc__ -D_LONGLONG                                                 \
197  -Ds64_t=long\\ long -Du64_t=unsigned\\ long\\ long                     \
198  %{!ansi:-D_POSIX_SOURCE}                                               \
199  %{!ansi:-D_CONVEX_SOURCE}"
200
201 #endif
202
203 #define LIB_SPEC                                                        \
204 "%{mc1:-lC1%{p:_p}%{pg:_p}}                             \
205  %{!mc1:%{!mc32:%{!mc34:%{!mc38:-lC2%{p:_p}%{pg:_p}}}}} \
206  %{mc32:-lC2%{p:_p}%{pg:_p}}                            \
207  %{mc34:-lC2%{p:_p}%{pg:_p}}                            \
208  %{mc38:-lC2%{p:_p}%{pg:_p}}                            \
209  -lc%{p:_p}%{pg:_p}"
210
211 #endif
212
213 #if (TARGET_DEFAULT | TARGET_CPU_DEFAULT) & 4
214
215 /* C32 default */
216
217 #if _IEEE_FLOAT_
218
219 #define CPP_SPEC                                                        \
220 "%{mc1:-D__convex_c1__}                                                 \
221  %{mc2:-D__convex_c2__}                                                 \
222  %{!mc1:%{!mc2:%{!mc34:%{!mc38:-D__convex_c32__}}}}                     \
223  %{mc34:-D__convex_c34__}                                               \
224  %{mc38:-D__convex_c38__}                                               \
225  %{fno-builtin:-D__NO_INLINE}                                           \
226  -D__NO_INLINE_MATH -D__NO_INLINE_STDLIB                                \
227  -D_IEEE_FLOAT_                                                         \
228  %{.S:-P}                                                               \
229  -D__stdc__ -D_LONGLONG                                                 \
230  -Ds64_t=long\\ long -Du64_t=unsigned\\ long\\ long                     \
231  %{!ansi:-D_POSIX_SOURCE}                                               \
232  %{!ansi:-D_CONVEX_SOURCE}"
233
234 #else
235
236 #define CPP_SPEC                                                        \
237 "%{mc1:-D__convex_c1__}                                                 \
238  %{mc2:-D__convex_c2__}                                                 \
239  %{!mc1:%{!mc2:%{!mc34:%{!mc38:-D__convex_c32__}}}}                     \
240  %{mc34:-D__convex_c34__}                                               \
241  %{mc38:-D__convex_c38__}                                               \
242  %{fno-builtin:-D__NO_INLINE}                                           \
243  -D__NO_INLINE_MATH -D__NO_INLINE_STDLIB                                \
244  -D_CONVEX_FLOAT_                                                       \
245  %{.S:-P}                                                               \
246  -D__stdc__ -D_LONGLONG                                                 \
247  -Ds64_t=long\\ long -Du64_t=unsigned\\ long\\ long                     \
248  %{!ansi:-D_POSIX_SOURCE}                                               \
249  %{!ansi:-D_CONVEX_SOURCE}"
250
251 #endif
252
253 #define LIB_SPEC                                                        \
254 "%{mc1:-lC1%{p:_p}%{pg:_p}}                             \
255  %{mc2:-lC2%{p:_p}%{pg:_p}}                             \
256  %{!mc1:%{!mc2:%{!mc34:%{!mc38:-lC2%{p:_p}%{pg:_p}}}}} \
257  %{mc34:-lC2%{p:_p}%{pg:_p}}                            \
258  %{mc38:-lC2%{p:_p}%{pg:_p}}                            \
259  -lc%{p:_p}%{pg:_p}"
260
261 #endif
262
263 #if (TARGET_DEFAULT | TARGET_CPU_DEFAULT) & 010
264
265 /* C34 default */
266
267 #if _IEEE_FLOAT_
268
269 #define CPP_SPEC                                                        \
270 "%{mc1:-D__convex_c1__}                                                 \
271  %{mc2:-D__convex_c2__}                                                 \
272  %{mc32:-D__convex_c32__}                                               \
273  %{!mc1:%{!mc2:%{!mc32:%{!mc38:-D__convex_c34__}}}}                     \
274  %{mc38:-D__convex_c38__}                                               \
275  %{fno-builtin:-D__NO_INLINE}                                           \
276  -D__NO_INLINE_MATH -D__NO_INLINE_STDLIB                                \
277  -D_IEEE_FLOAT_                                                         \
278  %{.S:-P}                                                               \
279  -D__stdc__ -D_LONGLONG                                                 \
280  -Ds64_t=long\\ long -Du64_t=unsigned\\ long\\ long                     \
281  %{!ansi:-D_POSIX_SOURCE}                                               \
282  %{!ansi:-D_CONVEX_SOURCE}"
283
284 #else
285
286 #define CPP_SPEC                                                        \
287 "%{mc1:-D__convex_c1__}                                                 \
288  %{mc2:-D__convex_c2__}                                                 \
289  %{mc32:-D__convex_c32__}                                               \
290  %{!mc1:%{!mc2:%{!mc32:%{!mc38:-D__convex_c34__}}}}                     \
291  %{mc38:-D__convex_c38__}                                               \
292  %{fno-builtin:-D__NO_INLINE}                                           \
293  -D__NO_INLINE_MATH -D__NO_INLINE_STDLIB                                \
294  -D_CONVEX_FLOAT_                                                       \
295  %{.S:-P}                                                               \
296  -D__stdc__ -D_LONGLONG                                                 \
297  -Ds64_t=long\\ long -Du64_t=unsigned\\ long\\ long                     \
298  %{!ansi:-D_POSIX_SOURCE}                                               \
299  %{!ansi:-D_CONVEX_SOURCE}"
300
301 #endif
302
303 #define LIB_SPEC                                                        \
304 "%{mc1:-lC1%{p:_p}%{pg:_p}}                             \
305  %{mc2:-lC2%{p:_p}%{pg:_p}}                             \
306  %{mc32:-lC2%{p:_p}%{pg:_p}}                            \
307  %{!mc1:%{!mc2:%{!mc32:%{!mc38:-lC2%{p:_p}%{pg:_p}}}}} \
308  %{mc38:-lC2%{p:_p}%{pg:_p}}                            \
309  -lc%{p:_p}%{pg:_p}"
310
311 #endif
312
313 #if (TARGET_DEFAULT | TARGET_CPU_DEFAULT) & 020
314
315 /* C38 default */
316
317 #if _IEEE_FLOAT_
318
319 #define CPP_SPEC                                                        \
320 "%{mc1:-D__convex_c1__}                                                 \
321  %{mc2:-D__convex_c2__}                                                 \
322  %{mc32:-D__convex_c32__}                                               \
323  %{mc34:-D__convex_c34__}                                               \
324  %{fno-builtin:-D__NO_INLINE}                                           \
325  -D__NO_INLINE_MATH -D__NO_INLINE_STDLIB                                \
326  -D_IEEE_FLOAT_                                                         \
327  %{!mc1:%{!mc2:%{!mc32:%{!mc34:-D__convex_c38__}}}}                     \
328  %{.S:-P}                                                               \
329  -D__stdc__ -D_LONGLONG                                                 \
330  -Ds64_t=long\\ long -Du64_t=unsigned\\ long\\ long                     \
331  %{!ansi:-D_POSIX_SOURCE}                                               \
332  %{!ansi:-D_CONVEX_SOURCE}"
333
334 #else
335
336 #define CPP_SPEC                                                        \
337 "%{mc1:-D__convex_c1__}                                                 \
338  %{mc2:-D__convex_c2__}                                                 \
339  %{mc32:-D__convex_c32__}                                               \
340  %{mc34:-D__convex_c34__}                                               \
341  %{fno-builtin:-D__NO_INLINE}                                           \
342  -D__NO_INLINE_MATH -D__NO_INLINE_STDLIB                                \
343  -D_CONVEX_FLOAT_                                                       \
344  %{!mc1:%{!mc2:%{!mc32:%{!mc34:-D__convex_c38__}}}}                     \
345  %{.S:-P}                                                               \
346  -D__stdc__ -D_LONGLONG                                                 \
347  -Ds64_t=long\\ long -Du64_t=unsigned\\ long\\ long                     \
348  %{!ansi:-D_POSIX_SOURCE}                                               \
349  %{!ansi:-D_CONVEX_SOURCE}"
350
351 #endif
352
353 #define LIB_SPEC                                        \
354 "%{mc1:-lC1%{p:_p}%{pg:_p}}                             \
355  %{mc2:-lC2%{p:_p}%{pg:_p}}                             \
356  %{mc32:-lC2%{p:_p}%{pg:_p}}                            \
357  %{mc34:-lC2%{p:_p}%{pg:_p}}                            \
358  %{!mc1:%{!mc2:%{!mc32:%{!mc34:-lC2%{p:_p}%{pg:_p}}}}}  \
359  -lc%{p:_p}%{pg:_p}"
360
361 #endif
362
363 #if _IEEE_FLOAT_
364
365 /* ieee default */
366
367 #define ASM_SPEC "-fi"
368
369 #define LINK_SPEC                                                       \
370 "-Eposix                                                                \
371  -X                                                                     \
372  %{F} %{M*} %{y*}                                                       \
373  -fi                                                                    \
374  -A__iob=___ap$iob                                                      \
375  -A_use_libc_sema=___ap$use_libc_sema                                   \
376  %-A___gcc_cleanup=___ap$do_registered_functions                        \
377  -L/usr/lib"
378
379 #define STARTFILE_SPEC                                                  \
380 "%{!pg:%{!p:/usr/lib/crt/crt0.o}}                                       \
381  %{!pg:%{p:/usr/lib/crt/mcrt0.o}}                                       \
382  %{pg:/usr/lib/crt/gcrt0.o}                                             \
383  /usr/lib/crt/fpmode_i.o"
384
385 #else
386
387 /* native default */
388
389 #define ASM_SPEC "-fn"
390
391 #define LINK_SPEC                                                       \
392 "-Eposix                                                                \
393  -X                                                                     \
394  %{F} %{M*} %{y*}                                                       \
395  -fn                                                                    \
396  -A__iob=___ap$iob                                                      \
397  -A_use_libc_sema=___ap$use_libc_sema                                   \
398  -A___gcc_cleanup=___ap$do_registered_functions                         \
399  -L/usr/lib"
400
401 #define STARTFILE_SPEC                                                  \
402 "%{!pg:%{!p:/usr/lib/crt/crt0.o}}                                       \
403  %{!pg:%{p:/usr/lib/crt/mcrt0.o}}                                       \
404  %{pg:/usr/lib/crt/gcrt0.o}"
405
406 #endif
407
408 /* Use /path/libgcc.a instead of -lgcc, makes bootstrap work more smoothly.  */
409
410 #define LINK_LIBGCC_SPECIAL_1
411
412 \f
413 /* Target machine storage layout */
414
415 /* Define this if most significant bit is lowest numbered
416    in instructions that operate on numbered bit-fields.  */
417 #define BITS_BIG_ENDIAN 1
418
419 /* Define this if most significant byte of a word is the lowest numbered.  */
420 #define BYTES_BIG_ENDIAN 1
421
422 /* Define this if most significant word of a multiword number is numbered.  */
423 #define WORDS_BIG_ENDIAN 1
424
425 /* Width of a word, in units (bytes).  */
426 #define UNITS_PER_WORD 8
427
428 /* Width in bits of a pointer.
429    See also the macro `Pmode' defined below.  */
430 #define POINTER_SIZE 32
431
432 /* Allocation boundary (in *bits*) for storing arguments in argument list.  */
433 #define PARM_BOUNDARY 32
434
435 /* Boundary (in *bits*) on which stack pointer should be aligned.  */
436 #define STACK_BOUNDARY 64
437
438 /* Allocation boundary (in *bits*) for the code of a function.  */
439 #define FUNCTION_BOUNDARY 16
440
441 /* Alignment of field after `int : 0' in a structure.  */
442 #define EMPTY_FIELD_BOUNDARY 32
443
444 /* Every structure's size must be a multiple of this.  */
445 #define STRUCTURE_SIZE_BOUNDARY 8
446
447 /* A bitfield declared as `int' forces `int' alignment for the struct.  */
448 #define PCC_BITFIELD_TYPE_MATTERS 1
449
450 /* No data type wants to be aligned rounder than this.  */
451 /* beware of doubles in structs -- 64 is incompatible with cc */
452 #define BIGGEST_ALIGNMENT 32
453
454 /* Set this nonzero if move instructions will actually fail to work
455    when given unaligned data.  */
456 #define STRICT_ALIGNMENT 0
457
458 /* Define sizes of basic C types to conform to ordinary usage -- these
459    types depend on BITS_PER_WORD otherwise.  */
460 #define SHORT_TYPE_SIZE         16
461 #define INT_TYPE_SIZE           32
462 #define LONG_TYPE_SIZE          (TARGET_LONG64 ? 64 : 32)
463 #define LONG_LONG_TYPE_SIZE     64
464 #define FLOAT_TYPE_SIZE         32
465 #define DOUBLE_TYPE_SIZE        64
466 #define LONG_DOUBLE_TYPE_SIZE   64
467 #define MAX_LONG_TYPE_SIZE      64
468
469 /* Declare the standard types used by builtins to match convex stddef.h --
470    with int rather than long.  */
471
472 #define SIZE_TYPE "unsigned int"
473 #define PTRDIFF_TYPE "int"
474 \f
475 /* Standard register usage.  */
476
477 /* Number of actual hardware registers.
478    The hardware registers are assigned numbers for the compiler
479    from 0 to just below FIRST_PSEUDO_REGISTER.
480    All registers that the compiler knows about must be given numbers,
481    even those that are not normally considered general registers.  */
482 #define FIRST_PSEUDO_REGISTER 16
483
484 /* 1 for registers that have pervasive standard uses
485    and are not available for the register allocator.
486    For Convex, these are AP, FP, and SP.  */
487 #define FIXED_REGISTERS \
488   { 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 1 }
489
490 /* 1 for registers not available across function calls.
491    These must include the FIXED_REGISTERS and also any
492    registers that can be used without being saved.
493    The latter must include the registers where values are returned
494    and the register where structure-value addresses are passed.
495    Aside from that, you can include as many other registers as you like.  */
496 #define CALL_USED_REGISTERS \
497   { 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 }
498
499 /* List the order in which to allocate registers.  Each register must be
500    listed once, even those in FIXED_REGISTERS.
501    For Convex, put S0 (the return register) last.  */
502 #define REG_ALLOC_ORDER \
503   { 1, 2, 3, 4, 5, 6, 7, 9, 10, 11, 12, 13, 0, 8, 14, 15 }
504
505 /* Return number of consecutive hard regs needed starting at reg REGNO
506    to hold something of mode MODE.
507    This is ordinarily the length in words of a value of mode MODE
508    but can be less for certain modes in special long registers.  */
509 #define HARD_REGNO_NREGS(REGNO, MODE) \
510    ((GET_MODE_SIZE (MODE) + UNITS_PER_WORD - 1) / UNITS_PER_WORD)
511
512 /* Value is 1 if hard register REGNO can hold a value of machine-mode MODE.
513    On Convex, S registers can hold any type, A registers any nonfloat.  */
514 #define HARD_REGNO_MODE_OK(REGNO, MODE) \
515   (S_REGNO_P (REGNO)                                                    \
516    || (GET_MODE_SIZE (MODE) <= 4 && (MODE) != SFmode))
517
518 /* Value is 1 if it is a good idea to tie two pseudo registers
519    when one has mode MODE1 and one has mode MODE2.
520    If HARD_REGNO_MODE_OK could produce different values for MODE1 and MODE2,
521    for any hard reg, then this must be 0 for correct output.  */
522 #define MODES_TIEABLE_P(MODE1, MODE2)  \
523   ((GET_MODE_SIZE (MODE1) <= 4 && (MODE1) != SFmode)                    \
524    == (GET_MODE_SIZE (MODE2) <= 4 && (MODE2) != SFmode))
525
526 /* Specify the registers used for certain standard purposes.
527    The values of these macros are register numbers.  */
528
529 #define S0_REGNUM 0
530 #define A0_REGNUM 8
531
532 /* Register to use for pushing function arguments.  */
533 #define STACK_POINTER_REGNUM A0_REGNUM
534
535 /* Base register for access to local variables of the function.  */
536 #define FRAME_POINTER_REGNUM (A0_REGNUM + 7)
537
538 /* Value should be nonzero if functions must have frame pointers.
539    Zero means the frame pointer need not be set up (and parms
540    may be accessed via the stack pointer) in functions that seem suitable.
541    This is computed in `reload', in reload1.c.  */
542 #define FRAME_POINTER_REQUIRED 1
543
544 /* Base register for access to arguments of the function.  */
545 #define ARG_POINTER_REGNUM (A0_REGNUM + 6)
546
547 /* Register in which static-chain is passed to a function.
548    Use S0, not an A reg, because this rare use would otherwise prevent
549    an A reg from being available to global-alloc across calls.  */
550 #define STATIC_CHAIN_REGNUM S0_REGNUM
551
552 /* Register in which address to store a structure value
553    is passed to a function.  */
554 #define STRUCT_VALUE_REGNUM (A0_REGNUM + 1)
555 \f
556 /* Define the classes of registers for register constraints in the
557    machine description.  Also define ranges of constants.
558
559    One of the classes must always be named ALL_REGS and include all hard regs.
560    If there is more than one class, another class must be named NO_REGS
561    and contain no registers.
562
563    The name GENERAL_REGS must be the name of a class (or an alias for
564    another name such as ALL_REGS).  This is the class of registers
565    that is allowed by "g" or "r" in a register constraint.
566    Also, registers outside this class are allocated only when
567    instructions express preferences for them.
568
569    The classes must be numbered in nondecreasing order; that is,
570    a larger-numbered class must never be contained completely
571    in a smaller-numbered class.
572
573    For any two classes, it is very desirable that there be another
574    class that represents their union.  */
575    
576 /* Convex has classes A (address) and S (scalar).
577    A is further divided into SP_REGS (stack pointer) and INDEX_REGS.
578    SI_REGS is S_REGS + INDEX_REGS -- all the regs except SP.  */
579
580 enum reg_class {
581   NO_REGS, S_REGS, INDEX_REGS, SP_REGS, A_REGS, SI_REGS,
582   ALL_REGS, LIM_REG_CLASSES 
583 };
584
585 #define N_REG_CLASSES (int) LIM_REG_CLASSES
586
587 /* Since GENERAL_REGS is the same class as ALL_REGS,
588    don't give it a different class number; just make it an alias.  */
589
590 #define GENERAL_REGS ALL_REGS
591
592 /* Give names of register classes as strings for dump file.   */
593
594 #define REG_CLASS_NAMES \
595  {"NO_REGS", "S_REGS", "INDEX_REGS", "SP_REGS", "A_REGS", "SI_REGS", \
596   "ALL_REGS" }
597
598 /* Define which registers fit in which classes.
599    This is an initializer for a vector of HARD_REG_SET
600    of length N_REG_CLASSES.  */
601
602 #define REG_CLASS_CONTENTS \
603   { {0}, {0x00ff}, {0xfe00}, {0x0100}, {0xff00}, {0xfeff}, {0xffff} }
604
605 /* The same information, inverted:
606    Return the class number of the smallest class containing
607    reg number REGNO.  This could be a conditional expression
608    or could index an array.  */
609
610 #define REGNO_REG_CLASS(REGNO) (regno_reg_class[REGNO])
611
612 #define S_REGNO_P(REGNO) ((unsigned)((REGNO) - S0_REGNUM) < 8)
613 #define A_REGNO_P(REGNO) ((unsigned)((REGNO) - A0_REGNUM) < 8)
614
615 #define S_REG_P(X) (REG_P (X) && S_REGNO_P (REGNO (X)))
616 #define A_REG_P(X) (REG_P (X) && A_REGNO_P (REGNO (X)))
617
618 /* The class value for index registers, and the one for base regs.  */
619
620 #define INDEX_REG_CLASS INDEX_REGS
621 #define BASE_REG_CLASS INDEX_REGS
622
623 /* Get reg_class from a letter such as appears in the machine description.  */
624 /* a => A_REGS
625    d => S_REGS  ('s' is taken)
626    A => INDEX_REGS  (i.e., A_REGS except sp) */
627
628 #define REG_CLASS_FROM_LETTER(C) \
629   reg_class_from_letter[(unsigned char) (C)]
630
631 /* The letters I, J, K, L and M in a register constraint string
632    can be used to stand for particular ranges of immediate operands.
633    This macro defines what the ranges are.
634    C is the letter, and VALUE is a constant value.
635    Return 1 if VALUE is in the range specified by C.  */
636 /* 'I' is used to pass any CONST_INT and reject any CONST_DOUBLE.
637    CONST_DOUBLE integers are handled by G and H constraint chars.  */
638
639 #define CONST_OK_FOR_LETTER_P(VALUE, C)  1
640
641 /* Similar, but for floating constants, and defining letters G and H.
642    Here VALUE is the CONST_DOUBLE rtx itself.  */
643 /* Convex uses G, H:
644    value usable in ld.d (low word 0) or ld.l (high word all sign) */
645
646 #define CONST_DOUBLE_OK_FOR_LETTER_P(VALUE, C)                          \
647   (((C) == 'G' && LD_D_P (VALUE)) ||                                    \
648    ((C) == 'H' && LD_L_P (VALUE)) ||                                    \
649    0)
650
651 #define LD_D_P(X) (const_double_low_int (X) == 0)
652
653 #define LD_L_P(X) (const_double_low_int (X) >= 0 \
654                    ? const_double_high_int (X) == 0 \
655                    : const_double_high_int (X) == -1)
656
657 /* Optional extra constraints for this machine.
658    For Convex, 'Q' means that OP is a volatile MEM.
659    For volatile scalars, we use instructions that bypass the data cache.  */
660
661 #define EXTRA_CONSTRAINT(OP, C) \
662   ((C) == 'Q' ? (GET_CODE (OP) == MEM && MEM_VOLATILE_P (OP)            \
663                  && ! TARGET_C1 && TARGET_VOLATILE_NOCACHE)             \
664    : 0)
665
666 /* Given an rtx X being reloaded into a reg required to be
667    in class CLASS, return the class of reg to actually use.
668    In general this is just CLASS; but on some machines
669    in some cases it is preferable to use a more restrictive class.  */
670
671 /* Put 2-word constants that can't be immediate operands into memory.  */
672
673 #define PREFERRED_RELOAD_CLASS(X,CLASS) \
674   ((GET_CODE (X) != CONST_DOUBLE                                        \
675     || GET_MODE (X) == SFmode                                           \
676     || LD_L_P (X) || LD_D_P (X))  ? (CLASS) : NO_REGS)
677
678 /* Return the maximum number of consecutive registers
679    needed to represent mode MODE in a register of class CLASS.  */
680 #define CLASS_MAX_NREGS(CLASS, MODE)  ((GET_MODE_SIZE (MODE) + 7) / 8)
681 \f
682 /* Stack layout; function entry, exit and calling.  */
683
684 /* Define this if pushing a word on the stack
685    makes the stack pointer a smaller address.  */
686 #define STACK_GROWS_DOWNWARD
687
688 /* Define this if the nominal address of the stack frame
689    is at the high-address end of the local variables;
690    that is, each additional local variable allocated
691    goes at a more negative offset in the frame.  */
692 #define FRAME_GROWS_DOWNWARD
693
694 /* Define this if should default to -fcaller-saves.  */
695 #define DEFAULT_CALLER_SAVES
696
697 /* Offset within stack frame to start allocating local variables at.
698    If FRAME_GROWS_DOWNWARD, this is the offset to the END of the
699    first local allocated.  Otherwise, it is the offset to the BEGINNING
700    of the first local allocated.  */
701 #define STARTING_FRAME_OFFSET 0
702
703 /* If we generate an insn to push BYTES bytes,
704    this says how many the stack pointer really advances by.  */
705 #define PUSH_ROUNDING(BYTES) (((BYTES) + 3) & ~3)
706
707 /* Offset of first parameter from the argument pointer register value.  */
708 #define FIRST_PARM_OFFSET(FNDECL) 0
709
710 /* Value is the number of bytes of arguments automatically
711    popped when returning from a subroutine call.
712    FUNDECL is the declaration node of the function (as a tree),
713    FUNTYPE is the data type of the function (as a tree),
714    or for a library call it is an identifier node for the subroutine name.
715    SIZE is the number of bytes of arguments passed on the stack.  */
716
717 #define RETURN_POPS_ARGS(FUNDECL,FUNTYPE,SIZE) (SIZE)
718
719 /* Define how to find the value returned by a function.
720    VALTYPE is the data type of the value (as a tree).
721    If the precise function being called is known, FUNC is its FUNCTION_DECL;
722    otherwise, FUNC is 0.  */
723
724 #define FUNCTION_VALUE(VALTYPE, FUNC) \
725   gen_rtx (REG, TYPE_MODE (VALTYPE), S0_REGNUM)
726
727 /* Define how to find the value returned by a library function
728    assuming the value has mode MODE.  */
729
730 #define LIBCALL_VALUE(MODE)  gen_rtx (REG, MODE, S0_REGNUM)
731
732 /* Define this if PCC uses the nonreentrant convention for returning
733    structure and union values.  */
734
735 #define PCC_STATIC_STRUCT_RETURN
736
737 /* 1 if N is a possible register number for a function value.
738    On the Convex, S0 is the only register thus used.  */
739
740 #define FUNCTION_VALUE_REGNO_P(N) ((N) == S0_REGNUM)
741
742 /* 1 if N is a possible register number for function argument passing.  */
743
744 #define FUNCTION_ARG_REGNO_P(N) 0
745 \f
746 /* Define a data type for recording info about an argument list
747    during the scan of that argument list.  This data type should
748    hold all necessary information about the function itself
749    and about the args processed so far, enough to enable macros
750    such as FUNCTION_ARG to determine where the next arg should go.  */
751 /* On convex, simply count the arguments in case TARGET_ARGCOUNT is set.  */
752
753 #define CUMULATIVE_ARGS int
754
755 /* Initialize a variable CUM of type CUMULATIVE_ARGS
756    for a call to a function whose data type is FNTYPE.
757    For a library call, FNTYPE is 0.  */
758
759 #define INIT_CUMULATIVE_ARGS(CUM,FNTYPE,LIBNAME,INDIRECT) \
760   ((CUM) = 0)
761
762 /* Update the data in CUM to advance over an argument
763    of mode MODE and data type TYPE.
764    (TYPE is null for libcalls where that information may not be available.)  */
765
766 #define FUNCTION_ARG_ADVANCE(CUM, MODE, TYPE, NAMED) \
767   ((CUM) += 1)
768
769 /* Define where to put the arguments to a function.
770    Value is zero to push the argument on the stack,
771    or a hard register in which to store the argument.
772
773    MODE is the argument's machine mode.
774    TYPE is the data type of the argument (as a tree).
775     This is null for libcalls where that information may
776     not be available.
777    CUM is a variable of type CUMULATIVE_ARGS which gives info about
778     the preceding args and about the function being called.
779    NAMED is nonzero if this argument is a named parameter
780     (otherwise it is an extra parameter matching an ellipsis).
781
782     Convex: all args go on the stack.  But return the arg count
783     as the "next arg register" to be passed to gen_call.  */
784
785 #define FUNCTION_ARG(CUM, MODE, TYPE, NAMED) \
786   ((MODE) == VOIDmode ? GEN_INT ((CUM)) : 0)
787
788 /* Output assembler code for a block containing the constant parts
789    of a trampoline, leaving space for the variable parts.  */
790
791 /* On convex, the code for a trampoline is
792        ld.w #<link>,s0
793        jmp <func>  */
794
795 #define TRAMPOLINE_TEMPLATE(FILE) \
796 {                                                                       \
797   fprintf (FILE, "\tld.w #69696969,s0\n");                              \
798   fprintf (FILE, "\tjmp 52525252\n");                                   \
799 }
800
801 /* Length in units of the trampoline for entering a nested function.  */
802
803 #define TRAMPOLINE_SIZE 12
804
805 /* Emit RTL insns to initialize the variable parts of a trampoline.
806    FNADDR is an RTX for the address of the function's pure code.
807    CXT is an RTX for the static chain value for the function.  */
808
809 #define INITIALIZE_TRAMPOLINE(TRAMP, FNADDR, CXT) \
810 {                                                                       \
811   emit_move_insn (gen_rtx (MEM, Pmode, plus_constant (TRAMP, 2)), CXT); \
812   emit_move_insn (gen_rtx (MEM, Pmode, plus_constant (TRAMP, 8)), FNADDR); \
813   emit_call_insn (gen_call_pop (gen_rtx (MEM, QImode,                   \
814                                          gen_rtx (SYMBOL_REF, Pmode,    \
815                                                   "__enable_execute_stack")), \
816                                 const0_rtx, const0_rtx, const0_rtx));   \
817 }
818
819 /* Output assembler code to FILE to increment profiler label # LABELNO
820    for profiling a function entry.  */
821
822 #define FUNCTION_PROFILER(FILE, LABELNO)  \
823    fprintf (FILE, "\tldea LP%d,a1\n\tcallq mcount\n", (LABELNO));
824
825 /* EXIT_IGNORE_STACK should be nonzero if, when returning from a function,
826    the stack pointer does not matter.  The value is tested only in
827    functions that have frame pointers.
828    No definition is equivalent to always zero.  */
829
830 #define EXIT_IGNORE_STACK 1
831
832 /* Store in the variable DEPTH the initial difference between the
833    frame pointer reg contents and the stack pointer reg contents,
834    as of the start of the function body.  This depends on the layout
835    of the fixed parts of the stack frame and on how registers are saved.  */
836 #define INITIAL_FRAME_POINTER_OFFSET(DEPTH)                     \
837 { (DEPTH) = (get_frame_size () + 7) & -8; }
838 \f
839 /* Addressing modes, and classification of registers for them.  */
840
841 /* #define HAVE_POST_INCREMENT 0 */
842 /* #define HAVE_POST_DECREMENT 0 */
843
844 /* #define HAVE_PRE_DECREMENT 0 */
845 /* #define HAVE_PRE_INCREMENT 0 */
846
847 /* Macros to check register numbers against specific register classes.  */
848
849 /* These assume that REGNO is a hard or pseudo reg number.
850    They give nonzero only if REGNO is a hard reg of the suitable class
851    or a pseudo reg currently allocated to a suitable hard reg.
852    Since they use reg_renumber, they are safe only once reg_renumber
853    has been allocated, which happens in local-alloc.c.  */
854
855 #define REGNO_OK_FOR_INDEX_P(regno)  \
856   ((regno) <= LAST_VIRTUAL_REGISTER                                     \
857     ? regno_ok_for_index_p[regno]                                       \
858     : regno_ok_for_index_p[reg_renumber[regno]])
859
860 #define REGNO_OK_FOR_BASE_P(regno)  REGNO_OK_FOR_INDEX_P (regno)
861 \f
862 /* Maximum number of registers that can appear in a valid memory address.  */
863
864 #define MAX_REGS_PER_ADDRESS 1
865
866 /* 1 if X is an rtx for a constant that is a valid address.  */
867
868 #define CONSTANT_ADDRESS_P(X)   \
869   (GET_CODE (X) == LABEL_REF || GET_CODE (X) == SYMBOL_REF              \
870    || GET_CODE (X) == CONST_INT || GET_CODE (X) == CONST                \
871    || GET_CODE (X) == HIGH)
872
873 /* Nonzero if the constant value X is a legitimate general operand.
874    It is given that X satisfies CONSTANT_P or is a CONST_DOUBLE.  */
875
876 /* For convex, bounce 2-word constants that can't be immediate operands.  */
877
878 #define LEGITIMATE_CONSTANT_P(X) \
879   (GET_CODE (X) != CONST_DOUBLE                                         \
880    || GET_MODE (X) == SFmode                                            \
881    || LD_L_P (X) || LD_D_P (X))
882
883 /* The macros REG_OK_FOR..._P assume that the arg is a REG rtx
884    and check its validity for a certain class.
885    We have two alternate definitions for each of them.
886    The usual definition accepts all pseudo regs; the other rejects
887    them unless they have been allocated suitable hard regs.
888    The symbol REG_OK_STRICT causes the latter definition to be used.
889
890    Most source files want to accept pseudo regs in the hope that
891    they will get allocated to the class that the insn wants them to be in.
892    Source files for reload pass need to be strict.
893    After reload, it makes no difference, since pseudo regs have
894    been eliminated by then.  */
895
896 #ifndef REG_OK_STRICT
897
898 /* Nonzero if X is a hard reg that can be used as an index
899    or if it is a pseudo reg.  */
900 #define REG_OK_FOR_INDEX_P(X) \
901   (REGNO (X) > LAST_VIRTUAL_REGISTER || regno_ok_for_index_p[REGNO (X)])
902
903 /* Nonzero if X is a hard reg that can be used as a base reg
904    or if it is a pseudo reg.  */
905 #define REG_OK_FOR_BASE_P(X) REG_OK_FOR_INDEX_P (X)
906
907 #else
908
909 /* Nonzero if X is a hard reg that can be used as an index.  */
910 #define REG_OK_FOR_INDEX_P(X) REGNO_OK_FOR_INDEX_P (REGNO (X))
911
912 /* Nonzero if X is a hard reg that can be used as a base reg.  */
913 #define REG_OK_FOR_BASE_P(X) REGNO_OK_FOR_BASE_P (REGNO (X))
914
915 #endif
916 \f
917 /* GO_IF_LEGITIMATE_ADDRESS recognizes an RTL expression
918    that is a valid memory address for an instruction.
919    The MODE argument is the machine mode for the MEM expression
920    that wants to use this address.
921
922    For Convex, valid addresses are
923        indirectable or (MEM indirectable)
924    where indirectable is 
925        const, reg, (PLUS reg const)
926
927    We don't use indirection since with insn scheduling, load + indexing
928    is better.  */
929
930 /* 1 if X is an address that we could indirect through.  */
931 #define INDIRECTABLE_ADDRESS_P(X)  \
932   (CONSTANT_ADDRESS_P (X)                                               \
933    || (GET_CODE (X) == REG && REG_OK_FOR_BASE_P (X))                    \
934    || (GET_CODE (X) == PLUS                                             \
935        && GET_CODE (XEXP (X, 0)) == REG                                 \
936        && REG_OK_FOR_BASE_P (XEXP (X, 0))                               \
937        && CONSTANT_ADDRESS_P (XEXP (X, 1)))                             \
938    || (GET_CODE (X) == PLUS                                             \
939        && GET_CODE (XEXP (X, 1)) == REG                                 \
940        && REG_OK_FOR_BASE_P (XEXP (X, 1))                               \
941        && CONSTANT_ADDRESS_P (XEXP (X, 0))))
942
943 /* Go to ADDR if X is a valid address.  */
944 #define GO_IF_LEGITIMATE_ADDRESS(MODE, X, ADDR)  \
945 { register rtx xfoob = (X);                                             \
946   if (INDIRECTABLE_ADDRESS_P (xfoob))                                   \
947     goto ADDR;                                                          \
948   if (GET_CODE (xfoob) == PRE_DEC && XEXP (xfoob, 0) == stack_pointer_rtx) \
949     goto ADDR;                                                          \
950 }
951 \f
952 /* Try machine-dependent ways of modifying an illegitimate address
953    to be legitimate.  If we find one, return the new, valid address.
954    This macro is used in only one place: `memory_address' in explow.c.
955
956    OLDX is the address as it was before break_out_memory_refs was called.
957    In some cases it is useful to look at this to decide what needs to be done.
958
959    MODE and WIN are passed so that this macro can use
960    GO_IF_LEGITIMATE_ADDRESS.
961
962    It is always safe for this macro to do nothing.  It exists to recognize
963    opportunities to optimize the output.
964
965    For Convex, nothing needs to be done.  */
966
967 #define LEGITIMIZE_ADDRESS(X,OLDX,MODE,WIN)  {}
968
969 /* Go to LABEL if ADDR (a legitimate address expression)
970    has an effect that depends on the machine mode it is used for.  */
971
972 #define GO_IF_MODE_DEPENDENT_ADDRESS(ADDR,LABEL)  {}
973 \f
974 /* Specify the machine mode that this machine uses
975    for the index in the tablejump instruction.  */
976 #define CASE_VECTOR_MODE SImode
977
978 /* Define as C expression which evaluates to nonzero if the tablejump
979    instruction expects the table to contain offsets from the address of the
980    table.
981    Do not define this if the table should contain absolute addresses.  */
982 /* #define CASE_VECTOR_PC_RELATIVE 1 */
983
984 /* Define this if the case instruction drops through after the table
985    when the index is out of range.  Don't define it if the case insn
986    jumps to the default label instead.  */
987 /* #define CASE_DROPS_THROUGH */
988
989 /* Define this as 1 if `char' should by default be signed; else as 0.  */
990 #define DEFAULT_SIGNED_CHAR 1
991
992 /* This flag, if defined, says the same insns that convert to a signed fixnum
993    also convert validly to an unsigned one.  */
994 #define FIXUNS_TRUNC_LIKE_FIX_TRUNC
995
996 /* Max number of bytes we can move from memory to memory
997    in one reasonably fast instruction.  */
998 #define MOVE_MAX 8
999
1000 /* Nonzero if access to memory by bytes is slow and undesirable.  */
1001 #define SLOW_BYTE_ACCESS (! TARGET_C2)
1002
1003 /* Define if shifts truncate the shift count
1004    which implies one can omit a sign-extension or zero-extension
1005    of a shift count.  */
1006 /* #define SHIFT_COUNT_TRUNCATED */
1007
1008 /* Value is 1 if truncating an integer of INPREC bits to OUTPREC bits
1009    is done just by pretending it is already truncated.  */
1010 #define TRULY_NOOP_TRUNCATION(OUTPREC, INPREC) 1
1011
1012 /* On Convex, it is as good to call a constant function address as to
1013    call an address kept in a register.  */
1014 #define NO_FUNCTION_CSE
1015
1016 /* When a prototype says `char' or `short', really pass an `int'.  */
1017 #define PROMOTE_PROTOTYPES 1
1018
1019 /* Specify the machine mode that pointers have.
1020    After generation of rtl, the compiler makes no further distinction
1021    between pointers and any other objects of this machine mode.  */
1022 #define Pmode SImode
1023
1024 /* A function address in a call instruction
1025    is a byte address (for indexing purposes)
1026    so give the MEM rtx a byte's mode.  */
1027 #define FUNCTION_MODE QImode
1028
1029 /* Compute the cost of computing a constant rtl expression RTX
1030    whose rtx-code is CODE.  The body of this macro is a portion
1031    of a switch statement.  If the code is computed here,
1032    return it with a return statement.  Otherwise, break from the switch.  */
1033
1034 #define CONST_COSTS(RTX,CODE,OUTER_CODE) \
1035   case CONST: \
1036   case LABEL_REF: \
1037   case SYMBOL_REF: \
1038   case CONST_INT: \
1039   case CONST_DOUBLE: \
1040     return 0;
1041
1042 /* Provide the costs of a rtl expression.  This is in the body of a
1043    switch on CODE.  */
1044
1045 #define RTX_COSTS(RTX,CODE,OUTER_CODE) \
1046   case PLUS:                                                            \
1047     if (GET_CODE (XEXP (RTX, 0)) == REG                                 \
1048         && REG_POINTER (XEXP (RTX, 0))                                  \
1049         && GET_CODE (XEXP (RTX, 1)) == CONST_INT)                       \
1050       return 0;                                                         \
1051     else break;                                                         \
1052   case MULT:                                                            \
1053     return 4 * (char) (0x03060403 >> target_cpu * 8);                   \
1054   case ASHIFT:                                                          \
1055   case LSHIFTRT:                                                        \
1056   case ASHIFTRT:                                                        \
1057     return 4 * (char) (0x03010403 >> target_cpu * 8);                   \
1058   case MEM:                                                             \
1059     return 5;
1060
1061 /* Compute the cost of an address.  This is meant to approximate the size
1062    and/or execution delay of an insn using that address.  If the cost is
1063    approximated by the RTL complexity, including CONST_COSTS above, as
1064    is usually the case for CISC machines, this macro should not be defined.
1065    For aggressively RISCy machines, only one insn format is allowed, so
1066    this macro should be a constant.  The value of this macro only matters
1067    for valid addresses.  */
1068
1069 #define ADDRESS_COST(RTX) 0
1070
1071 /* Specify the cost of a branch insn; roughly the number of extra insns that
1072    should be added to avoid a branch.  */
1073
1074 #define BRANCH_COST 0
1075
1076 /* Convex uses VAX or IEEE floats.
1077    Follow the host format.  */
1078 #define TARGET_FLOAT_FORMAT HOST_FLOAT_FORMAT
1079
1080 /* Check a `double' value for validity for a particular machine mode.  */
1081 #define CHECK_FLOAT_VALUE(MODE, D, OVERFLOW) \
1082    (OVERFLOW = check_float_value (MODE, &D, OVERFLOW))
1083 \f
1084 /* Tell final.c how to eliminate redundant test instructions.  */
1085
1086 /* Here we define machine-dependent flags and fields in cc_status
1087    (see `conditions.h').  No extra ones are needed for convex.  */
1088
1089 /* Store in cc_status the expressions
1090    that the condition codes will describe
1091    after execution of an instruction whose pattern is EXP.
1092    Do not alter them if the instruction would not alter the cc's.  */
1093
1094 #define NOTICE_UPDATE_CC(EXP,INSN)  {}
1095 \f
1096 /* Control the assembler format that we output.  */
1097
1098 /* Output at beginning of assembler file.  */
1099
1100 #if _IEEE_FLOAT_
1101 #define ASM_FILE_START(FILE)  fprintf (FILE, ";NO_APP\n.fpmode ieee\n")
1102 #else
1103 #define ASM_FILE_START(FILE)  fprintf (FILE, ";NO_APP\n.fpmode native\n")
1104 #endif
1105
1106 /* Output to assembler file text saying following lines
1107    may contain character constants, extra white space, comments, etc.  */
1108
1109 #define ASM_APP_ON ";APP\n"
1110
1111 /* Output to assembler file text saying following lines
1112    no longer contain unusual constructs.  */
1113
1114 #define ASM_APP_OFF ";NO_APP\n"
1115
1116 /* Alignment with Convex's assembler goes like this:
1117    .text can be .aligned up to a halfword.
1118    .data and .bss can be .aligned up to a longword.
1119    .lcomm is not supported, explicit declarations in .bss must be used instead.
1120    We get alignment for word and longword .text data by conventionally
1121    using .text 2 for word-aligned data and .text 3 for longword-aligned
1122    data.  This requires that the data's size be a multiple of its alignment,
1123    which seems to be always true.  */
1124
1125 /* Output before read-only data.  */
1126
1127 #define TEXT_SECTION_ASM_OP (current_section_is_text = 1, "\t.text")
1128
1129 /* Output before writable data.  */
1130
1131 #define DATA_SECTION_ASM_OP (current_section_is_text = 0, "\t.data") 
1132
1133 /* Output before uninitialized data.  */
1134
1135 #define BSS_SECTION_ASM_OP (current_section_is_text = 0, "\t.bss") 
1136
1137 /* This is how to output an assembler line
1138    that says to advance the location counter
1139    to a multiple of 2**LOG bytes.  */
1140
1141 #define ASM_OUTPUT_ALIGN(FILE,LOG) do { \
1142   if (current_section_is_text && (LOG) > 1)                             \
1143     fprintf (FILE, ".text %d\n", LOG);                                  \
1144   else if (current_section_is_text)                                     \
1145     fprintf (FILE, ".text\n.align %d\n", 1 << (LOG));                   \
1146   else                                                                  \
1147     fprintf (FILE, ".align %d\n", 1 << (LOG)); } while (0)
1148
1149 /* How to refer to registers in assembler output.
1150    This sequence is indexed by compiler's hard-register-number (see above).  */
1151
1152 #define REGISTER_NAMES                                                  \
1153 {                                                                       \
1154   "s0", "s1", "s2", "s3", "s4", "s5", "s6", "s7",                       \
1155   "sp", "a1", "a2", "a3", "a4", "a5", "ap", "fp",                       \
1156 }
1157
1158 /* This is BSD, so it wants DBX format.  */
1159
1160 #define DBX_DEBUGGING_INFO
1161
1162 /* Do not break .stabs pseudos into continuations.  */
1163
1164 #define DBX_CONTIN_LENGTH 0
1165
1166 /* This is the char to use for continuation (in case we need to turn
1167    continuation back on).  */
1168
1169 #define DBX_CONTIN_CHAR '?'
1170
1171 /* Don't use stab extensions until GDB v4 port is available for convex.  */
1172
1173 #define DEFAULT_GDB_EXTENSIONS 0
1174 #define DBX_NO_XREFS
1175
1176 /* This is how to output the definition of a user-level label named NAME,
1177    such as the label on a static function or variable NAME.  */
1178
1179 #define ASM_OUTPUT_LABEL(FILE,NAME)     \
1180   do { assemble_name (FILE, NAME); fputs (":\n", FILE); } while (0)
1181
1182 /* This is how to output a command to make the user-level label named NAME
1183    defined for reference from other files.  */
1184
1185 #define ASM_GLOBALIZE_LABEL(FILE,NAME)  \
1186   do { fputs (".globl ", FILE); assemble_name (FILE, NAME); fputs ("\n", FILE);} while (0)
1187
1188 /* The prefix to add to user-visible assembler symbols.  */
1189
1190 #define USER_LABEL_PREFIX "_"
1191
1192 /* This is how to output an internal numbered label where
1193    PREFIX is the class of label and NUM is the number within the class.  */
1194
1195 #define ASM_OUTPUT_INTERNAL_LABEL(FILE,PREFIX,NUM)      \
1196   fprintf (FILE, "%s%d:\n", PREFIX, NUM)
1197
1198 /* Put case tables in .text 2, where they will be word-aligned */
1199
1200 #define ASM_OUTPUT_CASE_LABEL(FILE,PREFIX,NUM,TABLE) \
1201   ASM_OUTPUT_ALIGN (FILE, 2); \
1202   ASM_OUTPUT_INTERNAL_LABEL (FILE, PREFIX, NUM)
1203
1204 #define ASM_OUTPUT_CASE_END(FILE,NUM,TABLE) \
1205   ASM_OUTPUT_ALIGN (FILE, 1)
1206
1207 /* This is how to store into the string LABEL
1208    the symbol_ref name of an internal numbered label where
1209    PREFIX is the class of label and NUM is the number within the class.
1210    This is suitable for output with `assemble_name'.  */
1211
1212 #define ASM_GENERATE_INTERNAL_LABEL(LABEL,PREFIX,NUM)   \
1213   sprintf (LABEL, "*%s%d", PREFIX, NUM)
1214
1215 /* This is how to output a string */
1216
1217 #define ASM_OUTPUT_ASCII(FILE,STR,SIZE) do {                            \
1218   size_t i, limit = (SIZE);                                             \
1219   fprintf ((FILE), "\tds.b \"");                                        \
1220   for (i = 0; i < limit; i++) {                                         \
1221       register int c = (STR)[i] & 0377;                                 \
1222       if (c >= ' ' && c < 0177 && c != '\\' && c != '"')                \
1223           putc (c, (FILE));                                             \
1224       else                                                              \
1225           fprintf ((FILE), "\\%03o", c);}                               \
1226   fprintf ((FILE), "\"\n");} while (0)
1227
1228 /* This is how to output an insn to push a register on the stack.
1229    It need not be very fast code.  */
1230
1231 #define ASM_OUTPUT_REG_PUSH(FILE,REGNO)         \
1232    fprintf (FILE, "\tpsh.%c %s\n",              \
1233             S_REGNO_P (REGNO) ? 'l' : 'w',      \
1234             reg_names[REGNO])
1235
1236 /* This is how to output an insn to pop a register from the stack.
1237    It need not be very fast code.  */
1238
1239 #define ASM_OUTPUT_REG_POP(FILE,REGNO)          \
1240    fprintf (FILE, "\tpop.%c %s\n",              \
1241             S_REGNO_P (REGNO) ? 'l' : 'w',      \
1242             reg_names[REGNO])
1243
1244 /* This is how to output an element of a case-vector that is absolute.  */
1245
1246 #define ASM_OUTPUT_ADDR_VEC_ELT(FILE, VALUE)  \
1247   fprintf (FILE, "\tds.w L%d\n", VALUE)
1248
1249 /* This is how to output an element of a case-vector that is relative.  
1250    (not used on Convex) */
1251
1252 #define ASM_OUTPUT_ADDR_DIFF_ELT(FILE, BODY, VALUE, REL)  \
1253   fprintf (FILE, "\tds.w L%d-L%d\n", VALUE, REL)
1254
1255 /* This is how to output an assembler line
1256    that says to advance the location counter by SIZE bytes.  */
1257
1258 #define ASM_OUTPUT_SKIP(FILE,SIZE)  \
1259   fprintf (FILE, "\tds.b %u(0)\n", (SIZE))
1260
1261 /* This says how to output an assembler line
1262    to define a global common symbol.  */
1263
1264 #define ASM_OUTPUT_COMMON(FILE, NAME, SIZE, ROUNDED)  \
1265 ( fputs (".comm ", (FILE)),                     \
1266   assemble_name ((FILE), (NAME)),               \
1267   fprintf ((FILE), ",%u\n", (ROUNDED)))
1268
1269 /* This says how to output an assembler line
1270    to define a local common symbol.  */
1271
1272 #define ASM_OUTPUT_LOCAL(FILE, NAME, SIZE, ROUNDED)  \
1273 ( bss_section (),                               \
1274   assemble_name ((FILE), (NAME)),               \
1275   fprintf ((FILE), ":\tbs.b %u\n", (ROUNDED)))
1276
1277 /* Store in OUTPUT a string (made with alloca) containing
1278    an assembler-name for a local static variable named NAME.
1279    LABELNO is an integer which is different for each call.  */
1280
1281 #define ASM_FORMAT_PRIVATE_NAME(OUTPUT, NAME, LABELNO)  \
1282 ( (OUTPUT) = (char *) alloca (strlen ((NAME)) + 10),    \
1283   sprintf ((OUTPUT), "%s.%d", (NAME), (LABELNO)))
1284
1285 /* Output an arg count before function entries.  */
1286
1287 #define ASM_DECLARE_FUNCTION_NAME(FILE, NAME, DECL)     \
1288   asm_declare_function_name (FILE, NAME, DECL)
1289
1290 /* Print an instruction operand X on file FILE.
1291    CODE is the code from the %-spec that requested printing this operand;
1292    if `%z3' was used to print operand 3, then CODE is 'z'.  */
1293
1294 #define PRINT_OPERAND(FILE, X, CODE)  \
1295     print_operand (FILE, X, CODE)
1296
1297 /* Print a memory operand whose address is X, on file FILE.  */
1298
1299 #define PRINT_OPERAND_ADDRESS(FILE, ADDR)                               \
1300     print_operand_address (FILE, ADDR)
1301 \f
1302 /* Do not put out GNU stabs for constructors and destructors.
1303    ld bounces them.  */
1304
1305 #define FASCIST_ASSEMBLER
1306
1307 /* __gcc_cleanup is loader-aliased to __ap$do_registered_functions if we
1308    are linking against standard libc.   */
1309
1310 #define EXIT_BODY \
1311 {                                                                       \
1312   extern void __gcc_cleanup ();                                         \
1313   if (__gcc_cleanup != _cleanup)                                        \
1314     __gcc_cleanup ();                                                   \
1315   _cleanup ();                                                          \
1316 }
1317 \f
1318 /* Header for convex.c.
1319    Here at the end so we can use types defined above.  */
1320
1321 extern int target_cpu;
1322 extern int current_section_is_text;
1323 extern enum reg_class regno_reg_class[FIRST_PSEUDO_REGISTER];
1324 extern enum reg_class reg_class_from_letter[256];
1325 extern char regno_ok_for_index_p_base[];
1326 #define regno_ok_for_index_p (regno_ok_for_index_p_base + 1)
1327