real.h: Don't define REAL_INFINITY or REAL_IS_NOT_DOUBLE.
[gcc.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. Default to IEEE. */
1077 #define TARGET_FLOAT_FORMAT IEEE_FLOAT_FORMAT
1078
1079 /* Check a `double' value for validity for a particular machine mode. */
1080 #define CHECK_FLOAT_VALUE(MODE, D, OVERFLOW) \
1081 (OVERFLOW = check_float_value (MODE, &D, OVERFLOW))
1082 \f
1083 /* Tell final.c how to eliminate redundant test instructions. */
1084
1085 /* Here we define machine-dependent flags and fields in cc_status
1086 (see `conditions.h'). No extra ones are needed for convex. */
1087
1088 /* Store in cc_status the expressions
1089 that the condition codes will describe
1090 after execution of an instruction whose pattern is EXP.
1091 Do not alter them if the instruction would not alter the cc's. */
1092
1093 #define NOTICE_UPDATE_CC(EXP,INSN) {}
1094 \f
1095 /* Control the assembler format that we output. */
1096
1097 /* Output at beginning of assembler file. */
1098
1099 #if _IEEE_FLOAT_
1100 #define ASM_FILE_START(FILE) fprintf (FILE, ";NO_APP\n.fpmode ieee\n")
1101 #else
1102 #define ASM_FILE_START(FILE) fprintf (FILE, ";NO_APP\n.fpmode native\n")
1103 #endif
1104
1105 /* Output to assembler file text saying following lines
1106 may contain character constants, extra white space, comments, etc. */
1107
1108 #define ASM_APP_ON ";APP\n"
1109
1110 /* Output to assembler file text saying following lines
1111 no longer contain unusual constructs. */
1112
1113 #define ASM_APP_OFF ";NO_APP\n"
1114
1115 /* Alignment with Convex's assembler goes like this:
1116 .text can be .aligned up to a halfword.
1117 .data and .bss can be .aligned up to a longword.
1118 .lcomm is not supported, explicit declarations in .bss must be used instead.
1119 We get alignment for word and longword .text data by conventionally
1120 using .text 2 for word-aligned data and .text 3 for longword-aligned
1121 data. This requires that the data's size be a multiple of its alignment,
1122 which seems to be always true. */
1123
1124 /* Output before read-only data. */
1125
1126 #define TEXT_SECTION_ASM_OP (current_section_is_text = 1, "\t.text")
1127
1128 /* Output before writable data. */
1129
1130 #define DATA_SECTION_ASM_OP (current_section_is_text = 0, "\t.data")
1131
1132 /* Output before uninitialized data. */
1133
1134 #define BSS_SECTION_ASM_OP (current_section_is_text = 0, "\t.bss")
1135
1136 /* This is how to output an assembler line
1137 that says to advance the location counter
1138 to a multiple of 2**LOG bytes. */
1139
1140 #define ASM_OUTPUT_ALIGN(FILE,LOG) do { \
1141 if (current_section_is_text && (LOG) > 1) \
1142 fprintf (FILE, ".text %d\n", LOG); \
1143 else if (current_section_is_text) \
1144 fprintf (FILE, ".text\n.align %d\n", 1 << (LOG)); \
1145 else \
1146 fprintf (FILE, ".align %d\n", 1 << (LOG)); } while (0)
1147
1148 /* How to refer to registers in assembler output.
1149 This sequence is indexed by compiler's hard-register-number (see above). */
1150
1151 #define REGISTER_NAMES \
1152 { \
1153 "s0", "s1", "s2", "s3", "s4", "s5", "s6", "s7", \
1154 "sp", "a1", "a2", "a3", "a4", "a5", "ap", "fp", \
1155 }
1156
1157 /* This is BSD, so it wants DBX format. */
1158
1159 #define DBX_DEBUGGING_INFO
1160
1161 /* Do not break .stabs pseudos into continuations. */
1162
1163 #define DBX_CONTIN_LENGTH 0
1164
1165 /* This is the char to use for continuation (in case we need to turn
1166 continuation back on). */
1167
1168 #define DBX_CONTIN_CHAR '?'
1169
1170 /* Don't use stab extensions until GDB v4 port is available for convex. */
1171
1172 #define DEFAULT_GDB_EXTENSIONS 0
1173 #define DBX_NO_XREFS
1174
1175 /* This is how to output the definition of a user-level label named NAME,
1176 such as the label on a static function or variable NAME. */
1177
1178 #define ASM_OUTPUT_LABEL(FILE,NAME) \
1179 do { assemble_name (FILE, NAME); fputs (":\n", FILE); } while (0)
1180
1181 /* This is how to output a command to make the user-level label named NAME
1182 defined for reference from other files. */
1183
1184 #define ASM_GLOBALIZE_LABEL(FILE,NAME) \
1185 do { fputs (".globl ", FILE); assemble_name (FILE, NAME); fputs ("\n", FILE);} while (0)
1186
1187 /* The prefix to add to user-visible assembler symbols. */
1188
1189 #define USER_LABEL_PREFIX "_"
1190
1191 /* This is how to output an internal numbered label where
1192 PREFIX is the class of label and NUM is the number within the class. */
1193
1194 #define ASM_OUTPUT_INTERNAL_LABEL(FILE,PREFIX,NUM) \
1195 fprintf (FILE, "%s%d:\n", PREFIX, NUM)
1196
1197 /* Put case tables in .text 2, where they will be word-aligned */
1198
1199 #define ASM_OUTPUT_CASE_LABEL(FILE,PREFIX,NUM,TABLE) \
1200 ASM_OUTPUT_ALIGN (FILE, 2); \
1201 ASM_OUTPUT_INTERNAL_LABEL (FILE, PREFIX, NUM)
1202
1203 #define ASM_OUTPUT_CASE_END(FILE,NUM,TABLE) \
1204 ASM_OUTPUT_ALIGN (FILE, 1)
1205
1206 /* This is how to store into the string LABEL
1207 the symbol_ref name of an internal numbered label where
1208 PREFIX is the class of label and NUM is the number within the class.
1209 This is suitable for output with `assemble_name'. */
1210
1211 #define ASM_GENERATE_INTERNAL_LABEL(LABEL,PREFIX,NUM) \
1212 sprintf (LABEL, "*%s%d", PREFIX, NUM)
1213
1214 /* This is how to output a string */
1215
1216 #define ASM_OUTPUT_ASCII(FILE,STR,SIZE) do { \
1217 size_t i, limit = (SIZE); \
1218 fprintf ((FILE), "\tds.b \""); \
1219 for (i = 0; i < limit; i++) { \
1220 register int c = (STR)[i] & 0377; \
1221 if (c >= ' ' && c < 0177 && c != '\\' && c != '"') \
1222 putc (c, (FILE)); \
1223 else \
1224 fprintf ((FILE), "\\%03o", c);} \
1225 fprintf ((FILE), "\"\n");} while (0)
1226
1227 /* This is how to output an insn to push a register on the stack.
1228 It need not be very fast code. */
1229
1230 #define ASM_OUTPUT_REG_PUSH(FILE,REGNO) \
1231 fprintf (FILE, "\tpsh.%c %s\n", \
1232 S_REGNO_P (REGNO) ? 'l' : 'w', \
1233 reg_names[REGNO])
1234
1235 /* This is how to output an insn to pop a register from the stack.
1236 It need not be very fast code. */
1237
1238 #define ASM_OUTPUT_REG_POP(FILE,REGNO) \
1239 fprintf (FILE, "\tpop.%c %s\n", \
1240 S_REGNO_P (REGNO) ? 'l' : 'w', \
1241 reg_names[REGNO])
1242
1243 /* This is how to output an element of a case-vector that is absolute. */
1244
1245 #define ASM_OUTPUT_ADDR_VEC_ELT(FILE, VALUE) \
1246 fprintf (FILE, "\tds.w L%d\n", VALUE)
1247
1248 /* This is how to output an element of a case-vector that is relative.
1249 (not used on Convex) */
1250
1251 #define ASM_OUTPUT_ADDR_DIFF_ELT(FILE, BODY, VALUE, REL) \
1252 fprintf (FILE, "\tds.w L%d-L%d\n", VALUE, REL)
1253
1254 /* This is how to output an assembler line
1255 that says to advance the location counter by SIZE bytes. */
1256
1257 #define ASM_OUTPUT_SKIP(FILE,SIZE) \
1258 fprintf (FILE, "\tds.b %u(0)\n", (SIZE))
1259
1260 /* This says how to output an assembler line
1261 to define a global common symbol. */
1262
1263 #define ASM_OUTPUT_COMMON(FILE, NAME, SIZE, ROUNDED) \
1264 ( fputs (".comm ", (FILE)), \
1265 assemble_name ((FILE), (NAME)), \
1266 fprintf ((FILE), ",%u\n", (ROUNDED)))
1267
1268 /* This says how to output an assembler line
1269 to define a local common symbol. */
1270
1271 #define ASM_OUTPUT_LOCAL(FILE, NAME, SIZE, ROUNDED) \
1272 ( bss_section (), \
1273 assemble_name ((FILE), (NAME)), \
1274 fprintf ((FILE), ":\tbs.b %u\n", (ROUNDED)))
1275
1276 /* Store in OUTPUT a string (made with alloca) containing
1277 an assembler-name for a local static variable named NAME.
1278 LABELNO is an integer which is different for each call. */
1279
1280 #define ASM_FORMAT_PRIVATE_NAME(OUTPUT, NAME, LABELNO) \
1281 ( (OUTPUT) = (char *) alloca (strlen ((NAME)) + 10), \
1282 sprintf ((OUTPUT), "%s.%d", (NAME), (LABELNO)))
1283
1284 /* Output an arg count before function entries. */
1285
1286 #define ASM_DECLARE_FUNCTION_NAME(FILE, NAME, DECL) \
1287 asm_declare_function_name (FILE, NAME, DECL)
1288
1289 /* Print an instruction operand X on file FILE.
1290 CODE is the code from the %-spec that requested printing this operand;
1291 if `%z3' was used to print operand 3, then CODE is 'z'. */
1292
1293 #define PRINT_OPERAND(FILE, X, CODE) \
1294 print_operand (FILE, X, CODE)
1295
1296 /* Print a memory operand whose address is X, on file FILE. */
1297
1298 #define PRINT_OPERAND_ADDRESS(FILE, ADDR) \
1299 print_operand_address (FILE, ADDR)
1300 \f
1301 /* Do not put out GNU stabs for constructors and destructors.
1302 ld bounces them. */
1303
1304 #define FASCIST_ASSEMBLER
1305
1306 /* __gcc_cleanup is loader-aliased to __ap$do_registered_functions if we
1307 are linking against standard libc. */
1308
1309 #define EXIT_BODY \
1310 { \
1311 extern void __gcc_cleanup (); \
1312 if (__gcc_cleanup != _cleanup) \
1313 __gcc_cleanup (); \
1314 _cleanup (); \
1315 }
1316 \f
1317 /* Header for convex.c.
1318 Here at the end so we can use types defined above. */
1319
1320 extern int target_cpu;
1321 extern int current_section_is_text;
1322 extern enum reg_class regno_reg_class[FIRST_PSEUDO_REGISTER];
1323 extern enum reg_class reg_class_from_letter[256];
1324 extern char regno_ok_for_index_p_base[];
1325 #define regno_ok_for_index_p (regno_ok_for_index_p_base + 1)
1326