* expr.c (do_tablejump): Let CASE_VECTOR_PC_RELATIVE be an
[official-gcc.git] / gcc / config / convex / convex.h
blob7538c1e345580db309b47e7b081a20a50245352b
1 /* Definitions of target machine for GNU compiler. Convex version.
2 Copyright (C) 1988, 1994, 1995, 1996 Free Software Foundation, Inc.
4 This file is part of GNU CC.
6 GNU CC is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation; either version 2, or (at your option)
9 any later version.
11 GNU CC is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
16 You should have received a copy of the GNU General Public License
17 along with GNU CC; see the file COPYING. If not, write to
18 the Free Software Foundation, 59 Temple Place - Suite 330,
19 Boston, MA 02111-1307, USA. */
22 /* Standard GCC variables that we reference. */
24 extern int target_flags;
26 /* Convex machine-specific flags
27 -mc1 target instruction set, libraries, scheduling
28 -mc2
29 -mc32
30 -mc34
31 -mc38
32 -margcount use standard calling sequence, with arg count word
33 -mno-argcount don't push arg count, depend on symbol table
34 -margcount-nop place arg count in a nop instruction (faster than push)
35 -mvolatile-cache use data cache for volatile mem refs (default)
36 -mvolatile-nocache bypass data cache for volatile mem refs
37 -mlong32 cc- and libc-compatible 32-bit longs
38 -mlong64 64-bit longs
41 /* Macro to define tables used to set -mXXX flags.
42 This is a list in braces of pairs in braces,
43 each pair being { "NAME", VALUE }
44 where VALUE is the bits to set or minus the bits to clear.
45 An empty string NAME is used to identify the default VALUE. */
47 #ifndef TARGET_DEFAULT
48 #define TARGET_DEFAULT 0
49 #endif
51 #define TARGET_SWITCHES \
52 { { "c1", 001 }, \
53 { "c2", 002 }, \
54 { "c32", 004 }, \
55 { "c34", 010 }, \
56 { "c38", 020 }, \
57 { "argcount", 0100 }, \
58 { "argcount-nop", 0200 }, \
59 { "no-argcount", -0300 }, \
60 { "volatile-cache", -0400 }, \
61 { "no-volatile-cache", 0400 }, \
62 { "volatile-nocache", 0400 }, \
63 { "long64", 01000 }, \
64 { "long32", -01000 }, \
65 { "", TARGET_DEFAULT | TARGET_CPU_DEFAULT}}
67 /* Macros used in the machine description to test the flags. */
69 #define TARGET_C1 (target_cpu == 0)
70 #define TARGET_C2 (target_cpu == 1)
71 #define TARGET_C34 (target_cpu == 2)
72 #define TARGET_C38 (target_cpu == 3)
73 #define TARGET_ARGCOUNT (target_flags & 0100)
74 #define TARGET_ARGCOUNT_NOP (target_flags & 0200)
75 #define TARGET_LONG64 (target_flags & 01000)
76 #define TARGET_VOLATILE_NOCACHE (target_flags & 0400)
78 #define OVERRIDE_OPTIONS \
79 { \
80 init_convex (); \
81 if ((target_flags & 077) != ((TARGET_DEFAULT | TARGET_CPU_DEFAULT) & 077)) \
82 target_flags &= ~ (TARGET_DEFAULT | TARGET_CPU_DEFAULT); \
83 if (target_flags & 001) \
84 target_cpu = 0; \
85 else if (target_flags & 006) \
86 target_cpu = 1; \
87 else if (target_flags & 010) \
88 target_cpu = 2; \
89 else if (target_flags & 020) \
90 target_cpu = 3; \
93 /* Names to predefine in the preprocessor for this target machine. */
95 #define CPP_PREDEFINES "-Dconvex -Dunix -Asystem(unix) -Acpu(convex) -Amachine(convex)"
97 /* Print subsidiary information on the compiler version in use. */
99 #define TARGET_VERSION fprintf (stderr, " (convex)");
101 /* Target-dependent specs.
102 Some libraries come in c1 and c2+ versions; use the appropriate ones.
103 Make a target-dependent __convex_cxx__ define to relay the target cpu
104 to the program being compiled. */
106 #if (TARGET_DEFAULT | TARGET_CPU_DEFAULT) & 1
108 /* C1 default */
110 #if _IEEE_FLOAT_
112 #define CPP_SPEC \
113 "%{!mc2:%{!mc32:%{!mc34:%{!mc38:-D__convex_c1__}}}} \
114 %{mc2:-D__convex_c2__} \
115 %{mc32:-D__convex_c32__} \
116 %{mc34:-D__convex_c34__} \
117 %{mc38:-D__convex_c38__} \
118 %{fno-builtin:-D__NO_INLINE} \
119 -D__NO_INLINE_MATH -D__NO_INLINE_STDLIB \
120 -D_IEEE_FLOAT_ \
121 %{.S:-P} \
122 %{!traditional:-D__stdc__} \
123 %{!traditional:-D_LONGLONG} \
124 %{!traditional:-Ds64_t=long\\ long -Du64_t=unsigned\\ long\\ long} \
125 %{!ansi:-D_POSIX_SOURCE} \
126 %{!ansi:-D_CONVEX_SOURCE}"
128 #else
130 #define CPP_SPEC \
131 "%{!mc2:%{!mc32:%{!mc34:%{!mc38:-D__convex_c1__}}}} \
132 %{mc2:-D__convex_c2__} \
133 %{mc32:-D__convex_c32__} \
134 %{mc34:-D__convex_c34__} \
135 %{mc38:-D__convex_c38__} \
136 %{fno-builtin:-D__NO_INLINE} \
137 -D__NO_INLINE_MATH -D__NO_INLINE_STDLIB \
138 -D_CONVEX_FLOAT_ \
139 %{.S:-P} \
140 %{!traditional:-D__stdc__} \
141 %{!traditional:-D_LONGLONG} \
142 %{!traditional:-Ds64_t=long\\ long -Du64_t=unsigned\\ long\\ long} \
143 %{!ansi:-D_POSIX_SOURCE} \
144 %{!ansi:-D_CONVEX_SOURCE}"
146 #endif
148 #define LIB_SPEC \
149 "%{!mc2:%{!mc32:%{!mc34:%{!mc38:-lC1%{traditional:_old}%{p:_p}%{pg:_p}}}}} \
150 %{mc2:-lC2%{traditional:_old}%{p:_p}%{pg:_p}} \
151 %{mc32:-lC2%{traditional:_old}%{p:_p}%{pg:_p}} \
152 %{mc34:-lC2%{traditional:_old}%{p:_p}%{pg:_p}} \
153 %{mc38:-lC2%{traditional:_old}%{p:_p}%{pg:_p}} \
154 -lc%{traditional:_old}%{p:_p}%{pg:_p}"
156 #endif
158 #if (TARGET_DEFAULT | TARGET_CPU_DEFAULT) & 2
160 /* C2 default */
162 #if _IEEE_FLOAT_
164 #define CPP_SPEC \
165 "%{mc1:-D__convex_c1__} \
166 %{!mc1:%{!mc32:%{!mc34:%{!mc38:-D__convex_c2__}}}} \
167 %{mc32:-D__convex_c32__} \
168 %{mc34:-D__convex_c34__} \
169 %{mc38:-D__convex_c38__} \
170 %{fno-builtin:-D__NO_INLINE} \
171 -D__NO_INLINE_MATH -D__NO_INLINE_STDLIB \
172 -D_IEEE_FLOAT_ \
173 %{.S:-P} \
174 %{!traditional:-D__stdc__} \
175 %{!traditional:-D_LONGLONG} \
176 %{!traditional:-Ds64_t=long\\ long -Du64_t=unsigned\\ long\\ long} \
177 %{!ansi:-D_POSIX_SOURCE} \
178 %{!ansi:-D_CONVEX_SOURCE}"
180 #else
182 #define CPP_SPEC \
183 "%{mc1:-D__convex_c1__} \
184 %{!mc1:%{!mc32:%{!mc34:%{!mc38:-D__convex_c2__}}}} \
185 %{mc32:-D__convex_c32__} \
186 %{mc34:-D__convex_c34__} \
187 %{mc38:-D__convex_c38__} \
188 %{fno-builtin:-D__NO_INLINE} \
189 -D__NO_INLINE_MATH -D__NO_INLINE_STDLIB \
190 -D_CONVEX_FLOAT_ \
191 %{.S:-P} \
192 %{!traditional:-D__stdc__} \
193 %{!traditional:-D_LONGLONG} \
194 %{!traditional:-Ds64_t=long\\ long -Du64_t=unsigned\\ long\\ long} \
195 %{!ansi:-D_POSIX_SOURCE} \
196 %{!ansi:-D_CONVEX_SOURCE}"
198 #endif
200 #define LIB_SPEC \
201 "%{mc1:-lC1%{traditional:_old}%{p:_p}%{pg:_p}} \
202 %{!mc1:%{!mc32:%{!mc34:%{!mc38:-lC2%{traditional:_old}%{p:_p}%{pg:_p}}}}} \
203 %{mc32:-lC2%{traditional:_old}%{p:_p}%{pg:_p}} \
204 %{mc34:-lC2%{traditional:_old}%{p:_p}%{pg:_p}} \
205 %{mc38:-lC2%{traditional:_old}%{p:_p}%{pg:_p}} \
206 -lc%{traditional:_old}%{p:_p}%{pg:_p}"
208 #endif
210 #if (TARGET_DEFAULT | TARGET_CPU_DEFAULT) & 4
212 /* C32 default */
214 #if _IEEE_FLOAT_
216 #define CPP_SPEC \
217 "%{mc1:-D__convex_c1__} \
218 %{mc2:-D__convex_c2__} \
219 %{!mc1:%{!mc2:%{!mc34:%{!mc38:-D__convex_c32__}}}} \
220 %{mc34:-D__convex_c34__} \
221 %{mc38:-D__convex_c38__} \
222 %{fno-builtin:-D__NO_INLINE} \
223 -D__NO_INLINE_MATH -D__NO_INLINE_STDLIB \
224 -D_IEEE_FLOAT_ \
225 %{.S:-P} \
226 %{!traditional:-D__stdc__} \
227 %{!traditional:-D_LONGLONG} \
228 %{!traditional:-Ds64_t=long\\ long -Du64_t=unsigned\\ long\\ long} \
229 %{!ansi:-D_POSIX_SOURCE} \
230 %{!ansi:-D_CONVEX_SOURCE}"
232 #else
234 #define CPP_SPEC \
235 "%{mc1:-D__convex_c1__} \
236 %{mc2:-D__convex_c2__} \
237 %{!mc1:%{!mc2:%{!mc34:%{!mc38:-D__convex_c32__}}}} \
238 %{mc34:-D__convex_c34__} \
239 %{mc38:-D__convex_c38__} \
240 %{fno-builtin:-D__NO_INLINE} \
241 -D__NO_INLINE_MATH -D__NO_INLINE_STDLIB \
242 -D_CONVEX_FLOAT_ \
243 %{.S:-P} \
244 %{!traditional:-D__stdc__} \
245 %{!traditional:-D_LONGLONG} \
246 %{!traditional:-Ds64_t=long\\ long -Du64_t=unsigned\\ long\\ long} \
247 %{!ansi:-D_POSIX_SOURCE} \
248 %{!ansi:-D_CONVEX_SOURCE}"
250 #endif
252 #define LIB_SPEC \
253 "%{mc1:-lC1%{traditional:_old}%{p:_p}%{pg:_p}} \
254 %{mc2:-lC2%{traditional:_old}%{p:_p}%{pg:_p}} \
255 %{!mc1:%{!mc2:%{!mc34:%{!mc38:-lC2%{traditional:_old}%{p:_p}%{pg:_p}}}}} \
256 %{mc34:-lC2%{traditional:_old}%{p:_p}%{pg:_p}} \
257 %{mc38:-lC2%{traditional:_old}%{p:_p}%{pg:_p}} \
258 -lc%{traditional:_old}%{p:_p}%{pg:_p}"
260 #endif
262 #if (TARGET_DEFAULT | TARGET_CPU_DEFAULT) & 010
264 /* C34 default */
266 #if _IEEE_FLOAT_
268 #define CPP_SPEC \
269 "%{mc1:-D__convex_c1__} \
270 %{mc2:-D__convex_c2__} \
271 %{mc32:-D__convex_c32__} \
272 %{!mc1:%{!mc2:%{!mc32:%{!mc38:-D__convex_c34__}}}} \
273 %{mc38:-D__convex_c38__} \
274 %{fno-builtin:-D__NO_INLINE} \
275 -D__NO_INLINE_MATH -D__NO_INLINE_STDLIB \
276 -D_IEEE_FLOAT_ \
277 %{.S:-P} \
278 %{!traditional:-D__stdc__} \
279 %{!traditional:-D_LONGLONG} \
280 %{!traditional:-Ds64_t=long\\ long -Du64_t=unsigned\\ long\\ long} \
281 %{!ansi:-D_POSIX_SOURCE} \
282 %{!ansi:-D_CONVEX_SOURCE}"
284 #else
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 %{!traditional:-D__stdc__} \
297 %{!traditional:-D_LONGLONG} \
298 %{!traditional:-Ds64_t=long\\ long -Du64_t=unsigned\\ long\\ long} \
299 %{!ansi:-D_POSIX_SOURCE} \
300 %{!ansi:-D_CONVEX_SOURCE}"
302 #endif
304 #define LIB_SPEC \
305 "%{mc1:-lC1%{traditional:_old}%{p:_p}%{pg:_p}} \
306 %{mc2:-lC2%{traditional:_old}%{p:_p}%{pg:_p}} \
307 %{mc32:-lC2%{traditional:_old}%{p:_p}%{pg:_p}} \
308 %{!mc1:%{!mc2:%{!mc32:%{!mc38:-lC2%{traditional:_old}%{p:_p}%{pg:_p}}}}} \
309 %{mc38:-lC2%{traditional:_old}%{p:_p}%{pg:_p}} \
310 -lc%{traditional:_old}%{p:_p}%{pg:_p}"
312 #endif
314 #if (TARGET_DEFAULT | TARGET_CPU_DEFAULT) & 020
316 /* C38 default */
318 #if _IEEE_FLOAT_
320 #define CPP_SPEC \
321 "%{mc1:-D__convex_c1__} \
322 %{mc2:-D__convex_c2__} \
323 %{mc32:-D__convex_c32__} \
324 %{mc34:-D__convex_c34__} \
325 %{fno-builtin:-D__NO_INLINE} \
326 -D__NO_INLINE_MATH -D__NO_INLINE_STDLIB \
327 -D_IEEE_FLOAT_ \
328 %{!mc1:%{!mc2:%{!mc32:%{!mc34:-D__convex_c38__}}}} \
329 %{.S:-P} \
330 %{!traditional:-D__stdc__} \
331 %{!traditional:-D_LONGLONG} \
332 %{!traditional:-Ds64_t=long\\ long -Du64_t=unsigned\\ long\\ long} \
333 %{!ansi:-D_POSIX_SOURCE} \
334 %{!ansi:-D_CONVEX_SOURCE}"
336 #else
338 #define CPP_SPEC \
339 "%{mc1:-D__convex_c1__} \
340 %{mc2:-D__convex_c2__} \
341 %{mc32:-D__convex_c32__} \
342 %{mc34:-D__convex_c34__} \
343 %{fno-builtin:-D__NO_INLINE} \
344 -D__NO_INLINE_MATH -D__NO_INLINE_STDLIB \
345 -D_CONVEX_FLOAT_ \
346 %{!mc1:%{!mc2:%{!mc32:%{!mc34:-D__convex_c38__}}}} \
347 %{.S:-P} \
348 %{!traditional:-D__stdc__} \
349 %{!traditional:-D_LONGLONG} \
350 %{!traditional:-Ds64_t=long\\ long -Du64_t=unsigned\\ long\\ long} \
351 %{!ansi:-D_POSIX_SOURCE} \
352 %{!ansi:-D_CONVEX_SOURCE}"
354 #endif
356 #define LIB_SPEC \
357 "%{mc1:-lC1%{traditional:_old}%{p:_p}%{pg:_p}} \
358 %{mc2:-lC2%{traditional:_old}%{p:_p}%{pg:_p}} \
359 %{mc32:-lC2%{traditional:_old}%{p:_p}%{pg:_p}} \
360 %{mc34:-lC2%{traditional:_old}%{p:_p}%{pg:_p}} \
361 %{!mc1:%{!mc2:%{!mc32:%{!mc34:-lC2%{traditional:_old}%{p:_p}%{pg:_p}}}}} \
362 -lc%{traditional:_old}%{p:_p}%{pg:_p}"
364 #endif
366 #if _IEEE_FLOAT_
368 /* ieee default */
370 #define ASM_SPEC "-fi"
372 #define LINK_SPEC \
373 "-E%{traditional:no}posix \
374 -X \
375 %{F} %{M*} %{y*} \
376 -fi \
377 -A__iob=___ap$iob \
378 -A_use_libc_sema=___ap$use_libc_sema \
379 %{traditional:-A___gcc_cleanup=__cleanup} \
380 %{!traditional:-A___gcc_cleanup=___ap$do_registered_functions} \
381 -L/usr/lib"
383 #define STARTFILE_SPEC \
384 "%{!pg:%{!p:/usr/lib/crt/crt0.o}} \
385 %{!pg:%{p:/usr/lib/crt/mcrt0.o}} \
386 %{pg:/usr/lib/crt/gcrt0.o} \
387 /usr/lib/crt/fpmode_i.o"
389 #else
391 /* native default */
393 #define ASM_SPEC "-fn"
395 #define LINK_SPEC \
396 "-E%{traditional:no}posix \
397 -X \
398 %{F} %{M*} %{y*} \
399 -fn \
400 -A__iob=___ap$iob \
401 -A_use_libc_sema=___ap$use_libc_sema \
402 %{traditional:-A___gcc_cleanup=__cleanup} \
403 %{!traditional:-A___gcc_cleanup=___ap$do_registered_functions} \
404 -L/usr/lib"
406 #define STARTFILE_SPEC \
407 "%{!pg:%{!p:/usr/lib/crt/crt0.o}} \
408 %{!pg:%{p:/usr/lib/crt/mcrt0.o}} \
409 %{pg:/usr/lib/crt/gcrt0.o}"
411 #endif
413 /* Use /path/libgcc.a instead of -lgcc, makes bootstrap work more smoothly. */
415 #define LINK_LIBGCC_SPECIAL_1
417 /* Since IEEE support was added to gcc, most things seem to like it
418 better if we disable exceptions and check afterward for infinity. */
420 #if __convex__
421 #if _IEEE_FLOAT_
422 #define REAL_VALUE_ISNAN(x) 0
423 #define REAL_VALUE_ISINF(x) ((*(short *) &(x) & 0x7ff0) == 0x7ff0)
424 #else
425 #define REAL_VALUE_ISNAN(x) 0
426 #define REAL_VALUE_ISINF(x) ((*(short *) &(x) & 0xfff0) == 0x8000)
427 #endif
428 #endif
430 /* Target machine storage layout */
432 /* Define this if most significant bit is lowest numbered
433 in instructions that operate on numbered bit-fields. */
434 #define BITS_BIG_ENDIAN 1
436 /* Define this if most significant byte of a word is the lowest numbered. */
437 #define BYTES_BIG_ENDIAN 1
439 /* Define this if most significant word of a multiword number is numbered. */
440 #define WORDS_BIG_ENDIAN 1
442 /* Number of bits in an addressable storage unit */
443 #define BITS_PER_UNIT 8
445 /* Width in bits of a "word", which is the contents of a machine register.
446 Note that this is not necessarily the width of data type `int';
447 if using 16-bit ints on a 68000, this would still be 32.
448 But on a machine with 16-bit registers, this would be 16. */
449 #define BITS_PER_WORD 64
451 /* Width of a word, in units (bytes). */
452 #define UNITS_PER_WORD 8
454 /* Width in bits of a pointer.
455 See also the macro `Pmode' defined below. */
456 #define POINTER_SIZE 32
458 /* Allocation boundary (in *bits*) for storing arguments in argument list. */
459 #define PARM_BOUNDARY 32
461 /* Boundary (in *bits*) on which stack pointer should be aligned. */
462 #define STACK_BOUNDARY 64
464 /* Allocation boundary (in *bits*) for the code of a function. */
465 #define FUNCTION_BOUNDARY 16
467 /* Alignment of field after `int : 0' in a structure. */
468 #define EMPTY_FIELD_BOUNDARY 32
470 /* Every structure's size must be a multiple of this. */
471 #define STRUCTURE_SIZE_BOUNDARY 8
473 /* A bitfield declared as `int' forces `int' alignment for the struct. */
474 #define PCC_BITFIELD_TYPE_MATTERS 1
476 /* No data type wants to be aligned rounder than this. */
477 /* beware of doubles in structs -- 64 is incompatible with cc */
478 #define BIGGEST_ALIGNMENT 32
480 /* Set this nonzero if move instructions will actually fail to work
481 when given unaligned data. */
482 #define STRICT_ALIGNMENT 0
484 /* Define sizes of basic C types to conform to ordinary usage -- these
485 types depend on BITS_PER_WORD otherwise. */
486 #define CHAR_TYPE_SIZE 8
487 #define SHORT_TYPE_SIZE 16
488 #define INT_TYPE_SIZE 32
489 #define LONG_TYPE_SIZE (TARGET_LONG64 ? 64 : 32)
490 #define LONG_LONG_TYPE_SIZE 64
491 #define FLOAT_TYPE_SIZE 32
492 #define DOUBLE_TYPE_SIZE 64
493 #define LONG_DOUBLE_TYPE_SIZE 64
494 /* This prevents cexp.c from depending on LONG_TYPE_SIZE. */
495 #define MAX_LONG_TYPE_SIZE 64
497 /* Declare the standard types used by builtins to match convex stddef.h --
498 with int rather than long. */
500 #define SIZE_TYPE "unsigned int"
501 #define PTRDIFF_TYPE "int"
503 /* Standard register usage. */
505 /* Number of actual hardware registers.
506 The hardware registers are assigned numbers for the compiler
507 from 0 to just below FIRST_PSEUDO_REGISTER.
508 All registers that the compiler knows about must be given numbers,
509 even those that are not normally considered general registers. */
510 #define FIRST_PSEUDO_REGISTER 16
512 /* 1 for registers that have pervasive standard uses
513 and are not available for the register allocator.
514 For Convex, these are AP, FP, and SP. */
515 #define FIXED_REGISTERS \
516 { 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 1 }
518 /* 1 for registers not available across function calls.
519 These must include the FIXED_REGISTERS and also any
520 registers that can be used without being saved.
521 The latter must include the registers where values are returned
522 and the register where structure-value addresses are passed.
523 Aside from that, you can include as many other registers as you like. */
524 #define CALL_USED_REGISTERS \
525 { 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 }
527 /* List the order in which to allocate registers. Each register must be
528 listed once, even those in FIXED_REGISTERS.
529 For Convex, put S0 (the return register) last. */
530 #define REG_ALLOC_ORDER \
531 { 1, 2, 3, 4, 5, 6, 7, 9, 10, 11, 12, 13, 0, 8, 14, 15 }
533 /* Return number of consecutive hard regs needed starting at reg REGNO
534 to hold something of mode MODE.
535 This is ordinarily the length in words of a value of mode MODE
536 but can be less for certain modes in special long registers. */
537 #define HARD_REGNO_NREGS(REGNO, MODE) \
538 ((GET_MODE_SIZE (MODE) + UNITS_PER_WORD - 1) / UNITS_PER_WORD)
540 /* Value is 1 if hard register REGNO can hold a value of machine-mode MODE.
541 On Convex, S registers can hold any type, A registers any nonfloat. */
542 #define HARD_REGNO_MODE_OK(REGNO, MODE) \
543 (S_REGNO_P (REGNO) \
544 || (GET_MODE_SIZE (MODE) <= 4 && (MODE) != SFmode))
546 /* Value is 1 if it is a good idea to tie two pseudo registers
547 when one has mode MODE1 and one has mode MODE2.
548 If HARD_REGNO_MODE_OK could produce different values for MODE1 and MODE2,
549 for any hard reg, then this must be 0 for correct output. */
550 #define MODES_TIEABLE_P(MODE1, MODE2) \
551 ((GET_MODE_SIZE (MODE1) <= 4 && (MODE1) != SFmode) \
552 == (GET_MODE_SIZE (MODE2) <= 4 && (MODE2) != SFmode))
554 /* Specify the registers used for certain standard purposes.
555 The values of these macros are register numbers. */
557 #define S0_REGNUM 0
558 #define A0_REGNUM 8
560 /* Register to use for pushing function arguments. */
561 #define STACK_POINTER_REGNUM A0_REGNUM
563 /* Base register for access to local variables of the function. */
564 #define FRAME_POINTER_REGNUM (A0_REGNUM + 7)
566 /* Value should be nonzero if functions must have frame pointers.
567 Zero means the frame pointer need not be set up (and parms
568 may be accessed via the stack pointer) in functions that seem suitable.
569 This is computed in `reload', in reload1.c. */
570 #define FRAME_POINTER_REQUIRED 1
572 /* Base register for access to arguments of the function. */
573 #define ARG_POINTER_REGNUM (A0_REGNUM + 6)
575 /* Register in which static-chain is passed to a function.
576 Use S0, not an A reg, because this rare use would otherwise prevent
577 an A reg from being available to global-alloc across calls. */
578 #define STATIC_CHAIN_REGNUM S0_REGNUM
580 /* Register in which address to store a structure value
581 is passed to a function. */
582 #define STRUCT_VALUE_REGNUM (A0_REGNUM + 1)
584 /* Define the classes of registers for register constraints in the
585 machine description. Also define ranges of constants.
587 One of the classes must always be named ALL_REGS and include all hard regs.
588 If there is more than one class, another class must be named NO_REGS
589 and contain no registers.
591 The name GENERAL_REGS must be the name of a class (or an alias for
592 another name such as ALL_REGS). This is the class of registers
593 that is allowed by "g" or "r" in a register constraint.
594 Also, registers outside this class are allocated only when
595 instructions express preferences for them.
597 The classes must be numbered in nondecreasing order; that is,
598 a larger-numbered class must never be contained completely
599 in a smaller-numbered class.
601 For any two classes, it is very desirable that there be another
602 class that represents their union. */
604 /* Convex has classes A (address) and S (scalar).
605 A is further divided into SP_REGS (stack pointer) and INDEX_REGS.
606 SI_REGS is S_REGS + INDEX_REGS -- all the regs except SP. */
608 enum reg_class {
609 NO_REGS, S_REGS, INDEX_REGS, SP_REGS, A_REGS, SI_REGS,
610 ALL_REGS, LIM_REG_CLASSES
613 #define N_REG_CLASSES (int) LIM_REG_CLASSES
615 /* Since GENERAL_REGS is the same class as ALL_REGS,
616 don't give it a different class number; just make it an alias. */
618 #define GENERAL_REGS ALL_REGS
620 /* Give names of register classes as strings for dump file. */
622 #define REG_CLASS_NAMES \
623 {"NO_REGS", "S_REGS", "INDEX_REGS", "SP_REGS", "A_REGS", "SI_REGS", \
624 "ALL_REGS" }
626 /* Define which registers fit in which classes.
627 This is an initializer for a vector of HARD_REG_SET
628 of length N_REG_CLASSES. */
630 #define REG_CLASS_CONTENTS \
631 { 0, 0x00ff, 0xfe00, 0x0100, 0xff00, 0xfeff, 0xffff }
633 /* The same information, inverted:
634 Return the class number of the smallest class containing
635 reg number REGNO. This could be a conditional expression
636 or could index an array. */
638 #define REGNO_REG_CLASS(REGNO) (regno_reg_class[REGNO])
640 #define S_REGNO_P(REGNO) (((REGNO) - S0_REGNUM) < (unsigned) 8)
641 #define A_REGNO_P(REGNO) (((REGNO) - A0_REGNUM) < (unsigned) 8)
643 #define S_REG_P(X) (REG_P (X) && S_REGNO_P (REGNO (X)))
644 #define A_REG_P(X) (REG_P (X) && A_REGNO_P (REGNO (X)))
646 /* The class value for index registers, and the one for base regs. */
648 #define INDEX_REG_CLASS INDEX_REGS
649 #define BASE_REG_CLASS INDEX_REGS
651 /* Get reg_class from a letter such as appears in the machine description. */
652 /* a => A_REGS
653 d => S_REGS ('s' is taken)
654 A => INDEX_REGS (i.e., A_REGS except sp) */
656 #define REG_CLASS_FROM_LETTER(C) \
657 reg_class_from_letter[(unsigned char) (C)]
659 /* The letters I, J, K, L and M in a register constraint string
660 can be used to stand for particular ranges of immediate operands.
661 This macro defines what the ranges are.
662 C is the letter, and VALUE is a constant value.
663 Return 1 if VALUE is in the range specified by C. */
664 /* 'I' is used to pass any CONST_INT and reject any CONST_DOUBLE.
665 CONST_DOUBLE integers are handled by G and H constraint chars. */
667 #define CONST_OK_FOR_LETTER_P(VALUE, C) 1
669 /* Similar, but for floating constants, and defining letters G and H.
670 Here VALUE is the CONST_DOUBLE rtx itself. */
671 /* Convex uses G, H:
672 value usable in ld.d (low word 0) or ld.l (high word all sign) */
674 #define CONST_DOUBLE_OK_FOR_LETTER_P(VALUE, C) \
675 (((C) == 'G' && LD_D_P (VALUE)) || \
676 ((C) == 'H' && LD_L_P (VALUE)) || \
679 #define LD_D_P(X) (const_double_low_int (X) == 0)
681 #define LD_L_P(X) (const_double_low_int (X) >= 0 \
682 ? const_double_high_int (X) == 0 \
683 : const_double_high_int (X) == -1)
685 /* Optional extra constraints for this machine.
686 For Convex, 'Q' means that OP is a volatile MEM.
687 For volatile scalars, we use instructions that bypass the data cache. */
689 #define EXTRA_CONSTRAINT(OP, C) \
690 ((C) == 'Q' ? (GET_CODE (OP) == MEM && MEM_VOLATILE_P (OP) \
691 && ! TARGET_C1 && TARGET_VOLATILE_NOCACHE) \
692 : 0)
694 /* Given an rtx X being reloaded into a reg required to be
695 in class CLASS, return the class of reg to actually use.
696 In general this is just CLASS; but on some machines
697 in some cases it is preferable to use a more restrictive class. */
699 /* Put 2-word constants that can't be immediate operands into memory. */
701 #define PREFERRED_RELOAD_CLASS(X,CLASS) \
702 ((GET_CODE (X) != CONST_DOUBLE \
703 || GET_MODE (X) == SFmode \
704 || LD_L_P (X) || LD_D_P (X)) ? (CLASS) : NO_REGS)
706 /* Return the maximum number of consecutive registers
707 needed to represent mode MODE in a register of class CLASS. */
708 #define CLASS_MAX_NREGS(CLASS, MODE) ((GET_MODE_SIZE (MODE) + 7) / 8)
710 /* Stack layout; function entry, exit and calling. */
712 /* Define this if pushing a word on the stack
713 makes the stack pointer a smaller address. */
714 #define STACK_GROWS_DOWNWARD
716 /* Define this if the nominal address of the stack frame
717 is at the high-address end of the local variables;
718 that is, each additional local variable allocated
719 goes at a more negative offset in the frame. */
720 #define FRAME_GROWS_DOWNWARD
722 /* Define this if should default to -fcaller-saves. */
723 #define DEFAULT_CALLER_SAVES
725 /* Offset within stack frame to start allocating local variables at.
726 If FRAME_GROWS_DOWNWARD, this is the offset to the END of the
727 first local allocated. Otherwise, it is the offset to the BEGINNING
728 of the first local allocated. */
729 #define STARTING_FRAME_OFFSET 0
731 /* If we generate an insn to push BYTES bytes,
732 this says how many the stack pointer really advances by. */
733 #define PUSH_ROUNDING(BYTES) (((BYTES) + 3) & ~3)
735 /* Offset of first parameter from the argument pointer register value. */
736 #define FIRST_PARM_OFFSET(FNDECL) 0
738 /* Value is the number of bytes of arguments automatically
739 popped when returning from a subroutine call.
740 FUNDECL is the declaration node of the function (as a tree),
741 FUNTYPE is the data type of the function (as a tree),
742 or for a library call it is an identifier node for the subroutine name.
743 SIZE is the number of bytes of arguments passed on the stack. */
745 #define RETURN_POPS_ARGS(FUNDECL,FUNTYPE,SIZE) (SIZE)
747 /* Define how to find the value returned by a function.
748 VALTYPE is the data type of the value (as a tree).
749 If the precise function being called is known, FUNC is its FUNCTION_DECL;
750 otherwise, FUNC is 0. */
752 #define FUNCTION_VALUE(VALTYPE, FUNC) \
753 gen_rtx (REG, TYPE_MODE (VALTYPE), S0_REGNUM)
755 /* Define how to find the value returned by a library function
756 assuming the value has mode MODE. */
758 #define LIBCALL_VALUE(MODE) gen_rtx (REG, MODE, S0_REGNUM)
760 /* Define this if PCC uses the nonreentrant convention for returning
761 structure and union values. */
763 #define PCC_STATIC_STRUCT_RETURN
765 /* 1 if N is a possible register number for a function value.
766 On the Convex, S0 is the only register thus used. */
768 #define FUNCTION_VALUE_REGNO_P(N) ((N) == S0_REGNUM)
770 /* 1 if N is a possible register number for function argument passing. */
772 #define FUNCTION_ARG_REGNO_P(N) 0
774 /* Define a data type for recording info about an argument list
775 during the scan of that argument list. This data type should
776 hold all necessary information about the function itself
777 and about the args processed so far, enough to enable macros
778 such as FUNCTION_ARG to determine where the next arg should go. */
779 /* On convex, simply count the arguments in case TARGET_ARGCOUNT is set. */
781 #define CUMULATIVE_ARGS int
783 /* Initialize a variable CUM of type CUMULATIVE_ARGS
784 for a call to a function whose data type is FNTYPE.
785 For a library call, FNTYPE is 0. */
787 #define INIT_CUMULATIVE_ARGS(CUM,FNTYPE,LIBNAME,INDIRECT) \
788 ((CUM) = 0)
790 /* Update the data in CUM to advance over an argument
791 of mode MODE and data type TYPE.
792 (TYPE is null for libcalls where that information may not be available.) */
794 #define FUNCTION_ARG_ADVANCE(CUM, MODE, TYPE, NAMED) \
795 ((CUM) += 1)
797 /* Define where to put the arguments to a function.
798 Value is zero to push the argument on the stack,
799 or a hard register in which to store the argument.
801 MODE is the argument's machine mode.
802 TYPE is the data type of the argument (as a tree).
803 This is null for libcalls where that information may
804 not be available.
805 CUM is a variable of type CUMULATIVE_ARGS which gives info about
806 the preceding args and about the function being called.
807 NAMED is nonzero if this argument is a named parameter
808 (otherwise it is an extra parameter matching an ellipsis).
810 Convex: all args go on the stack. But return the arg count
811 as the "next arg register" to be passed to gen_call. */
813 #define FUNCTION_ARG(CUM, MODE, TYPE, NAMED) \
814 ((MODE) == VOIDmode ? gen_rtx (CONST_INT, VOIDmode, (CUM)) : 0)
816 /* This macro generates the assembly code for function entry.
817 FILE is a stdio stream to output the code to.
818 SIZE is an int: how many units of temporary storage to allocate.
819 Refer to the array `regs_ever_live' to determine which registers
820 to save; `regs_ever_live[I]' is nonzero if register number I
821 is ever used in the function. This macro is responsible for
822 knowing which registers should not be saved even if used. */
824 #define FUNCTION_PROLOGUE(FILE, SIZE) \
826 int size = ((SIZE) + 7) & -8; \
827 if (size != 0) \
828 fprintf (FILE, "\tsub.w #%d,sp\n", size); \
831 /* This macro generates the assembly code for function exit,
832 on machines that need it. If FUNCTION_EPILOGUE is not defined
833 then individual return instructions are generated for each
834 return statement. Args are same as for FUNCTION_PROLOGUE. */
836 #define FUNCTION_EPILOGUE(FILE, SIZE) \
838 /* Follow function with a zero to stop c34 icache prefetching. */ \
839 fprintf (FILE, "\tds.h 0\n"); \
842 /* Output assembler code for a block containing the constant parts
843 of a trampoline, leaving space for the variable parts. */
845 /* On convex, the code for a trampoline is
846 ld.w #<link>,s0
847 jmp <func> */
849 #define TRAMPOLINE_TEMPLATE(FILE) \
851 fprintf (FILE, "\tld.w #69696969,s0\n"); \
852 fprintf (FILE, "\tjmp 52525252\n"); \
855 /* Length in units of the trampoline for entering a nested function. */
857 #define TRAMPOLINE_SIZE 12
859 /* Emit RTL insns to initialize the variable parts of a trampoline.
860 FNADDR is an RTX for the address of the function's pure code.
861 CXT is an RTX for the static chain value for the function. */
863 #define INITIALIZE_TRAMPOLINE(TRAMP, FNADDR, CXT) \
865 emit_move_insn (gen_rtx (MEM, Pmode, plus_constant (TRAMP, 2)), CXT); \
866 emit_move_insn (gen_rtx (MEM, Pmode, plus_constant (TRAMP, 8)), FNADDR); \
867 emit_call_insn (gen_call_pop (gen_rtx (MEM, QImode, \
868 gen_rtx (SYMBOL_REF, Pmode, \
869 "__enable_execute_stack")), \
870 const0_rtx, const0_rtx, const0_rtx)); \
873 /* Output assembler code to FILE to increment profiler label # LABELNO
874 for profiling a function entry. */
876 #define FUNCTION_PROFILER(FILE, LABELNO) \
877 fprintf (FILE, "\tldea LP%d,a1\n\tcallq mcount\n", (LABELNO));
879 /* EXIT_IGNORE_STACK should be nonzero if, when returning from a function,
880 the stack pointer does not matter. The value is tested only in
881 functions that have frame pointers.
882 No definition is equivalent to always zero. */
884 #define EXIT_IGNORE_STACK 1
886 /* Store in the variable DEPTH the initial difference between the
887 frame pointer reg contents and the stack pointer reg contents,
888 as of the start of the function body. This depends on the layout
889 of the fixed parts of the stack frame and on how registers are saved. */
890 #define INITIAL_FRAME_POINTER_OFFSET(DEPTH) \
891 { (DEPTH) = (get_frame_size () + 7) & -8; }
893 /* Addressing modes, and classification of registers for them. */
895 /* #define HAVE_POST_INCREMENT */
896 /* #define HAVE_POST_DECREMENT */
898 /* #define HAVE_PRE_DECREMENT */
899 /* #define HAVE_PRE_INCREMENT */
901 /* Macros to check register numbers against specific register classes. */
903 /* These assume that REGNO is a hard or pseudo reg number.
904 They give nonzero only if REGNO is a hard reg of the suitable class
905 or a pseudo reg currently allocated to a suitable hard reg.
906 Since they use reg_renumber, they are safe only once reg_renumber
907 has been allocated, which happens in local-alloc.c. */
909 #define REGNO_OK_FOR_INDEX_P(regno) \
910 ((regno) <= LAST_VIRTUAL_REGISTER \
911 ? regno_ok_for_index_p[regno] \
912 : regno_ok_for_index_p[reg_renumber[regno]])
914 #define REGNO_OK_FOR_BASE_P(regno) REGNO_OK_FOR_INDEX_P (regno)
916 /* Maximum number of registers that can appear in a valid memory address. */
918 #define MAX_REGS_PER_ADDRESS 1
920 /* 1 if X is an rtx for a constant that is a valid address. */
922 #define CONSTANT_ADDRESS_P(X) \
923 (GET_CODE (X) == LABEL_REF || GET_CODE (X) == SYMBOL_REF \
924 || GET_CODE (X) == CONST_INT || GET_CODE (X) == CONST \
925 || GET_CODE (X) == HIGH)
927 /* Nonzero if the constant value X is a legitimate general operand.
928 It is given that X satisfies CONSTANT_P or is a CONST_DOUBLE. */
930 /* For convex, bounce 2-word constants that can't be immediate operands. */
932 #define LEGITIMATE_CONSTANT_P(X) \
933 (GET_CODE (X) != CONST_DOUBLE \
934 || GET_MODE (X) == SFmode \
935 || LD_L_P (X) || LD_D_P (X))
937 /* The macros REG_OK_FOR..._P assume that the arg is a REG rtx
938 and check its validity for a certain class.
939 We have two alternate definitions for each of them.
940 The usual definition accepts all pseudo regs; the other rejects
941 them unless they have been allocated suitable hard regs.
942 The symbol REG_OK_STRICT causes the latter definition to be used.
944 Most source files want to accept pseudo regs in the hope that
945 they will get allocated to the class that the insn wants them to be in.
946 Source files for reload pass need to be strict.
947 After reload, it makes no difference, since pseudo regs have
948 been eliminated by then. */
950 #ifndef REG_OK_STRICT
952 /* Nonzero if X is a hard reg that can be used as an index
953 or if it is a pseudo reg. */
954 #define REG_OK_FOR_INDEX_P(X) \
955 (REGNO (X) > LAST_VIRTUAL_REGISTER || regno_ok_for_index_p[REGNO (X)])
957 /* Nonzero if X is a hard reg that can be used as a base reg
958 or if it is a pseudo reg. */
959 #define REG_OK_FOR_BASE_P(X) REG_OK_FOR_INDEX_P (X)
961 #else
963 /* Nonzero if X is a hard reg that can be used as an index. */
964 #define REG_OK_FOR_INDEX_P(X) REGNO_OK_FOR_INDEX_P (REGNO (X))
966 /* Nonzero if X is a hard reg that can be used as a base reg. */
967 #define REG_OK_FOR_BASE_P(X) REGNO_OK_FOR_BASE_P (REGNO (X))
969 #endif
971 /* GO_IF_LEGITIMATE_ADDRESS recognizes an RTL expression
972 that is a valid memory address for an instruction.
973 The MODE argument is the machine mode for the MEM expression
974 that wants to use this address.
976 For Convex, valid addresses are
977 indirectable or (MEM indirectable)
978 where indirectable is
979 const, reg, (PLUS reg const)
981 We don't use indirection since with insn scheduling, load + indexing
982 is better. */
984 /* 1 if X is an address that we could indirect through. */
985 #define INDIRECTABLE_ADDRESS_P(X) \
986 (CONSTANT_ADDRESS_P (X) \
987 || (GET_CODE (X) == REG && REG_OK_FOR_BASE_P (X)) \
988 || (GET_CODE (X) == PLUS \
989 && GET_CODE (XEXP (X, 0)) == REG \
990 && REG_OK_FOR_BASE_P (XEXP (X, 0)) \
991 && CONSTANT_ADDRESS_P (XEXP (X, 1))) \
992 || (GET_CODE (X) == PLUS \
993 && GET_CODE (XEXP (X, 1)) == REG \
994 && REG_OK_FOR_BASE_P (XEXP (X, 1)) \
995 && CONSTANT_ADDRESS_P (XEXP (X, 0))))
997 /* Go to ADDR if X is a valid address. */
998 #define GO_IF_LEGITIMATE_ADDRESS(MODE, X, ADDR) \
999 { register rtx xfoob = (X); \
1000 if (INDIRECTABLE_ADDRESS_P (xfoob)) \
1001 goto ADDR; \
1002 if (GET_CODE (xfoob) == PRE_DEC && XEXP (xfoob, 0) == stack_pointer_rtx) \
1003 goto ADDR; \
1006 /* Try machine-dependent ways of modifying an illegitimate address
1007 to be legitimate. If we find one, return the new, valid address.
1008 This macro is used in only one place: `memory_address' in explow.c.
1010 OLDX is the address as it was before break_out_memory_refs was called.
1011 In some cases it is useful to look at this to decide what needs to be done.
1013 MODE and WIN are passed so that this macro can use
1014 GO_IF_LEGITIMATE_ADDRESS.
1016 It is always safe for this macro to do nothing. It exists to recognize
1017 opportunities to optimize the output.
1019 For Convex, nothing needs to be done. */
1021 #define LEGITIMIZE_ADDRESS(X,OLDX,MODE,WIN) {}
1023 /* Go to LABEL if ADDR (a legitimate address expression)
1024 has an effect that depends on the machine mode it is used for. */
1026 #define GO_IF_MODE_DEPENDENT_ADDRESS(ADDR,LABEL) {}
1028 /* Specify the machine mode that this machine uses
1029 for the index in the tablejump instruction. */
1030 #define CASE_VECTOR_MODE SImode
1032 /* Define as C expression which evaluates to nonzero if the tablejump
1033 instruction expects the table to contain offsets from the address of the
1034 table.
1035 Do not define this if the table should contain absolute addresses. */
1036 /* #define CASE_VECTOR_PC_RELATIVE 1 */
1038 /* Define this if the case instruction drops through after the table
1039 when the index is out of range. Don't define it if the case insn
1040 jumps to the default label instead. */
1041 /* #define CASE_DROPS_THROUGH */
1043 /* Specify the tree operation to be used to convert reals to integers. */
1044 #define IMPLICIT_FIX_EXPR FIX_ROUND_EXPR
1046 /* This is the kind of divide that is easiest to do in the general case. */
1047 #define EASY_DIV_EXPR TRUNC_DIV_EXPR
1049 /* Define this as 1 if `char' should by default be signed; else as 0. */
1050 #define DEFAULT_SIGNED_CHAR 1
1052 /* This flag, if defined, says the same insns that convert to a signed fixnum
1053 also convert validly to an unsigned one. */
1054 #define FIXUNS_TRUNC_LIKE_FIX_TRUNC
1056 /* Max number of bytes we can move from memory to memory
1057 in one reasonably fast instruction. */
1058 #define MOVE_MAX 8
1060 /* Define this if zero-extension is slow (more than one real instruction). */
1061 /* #define SLOW_ZERO_EXTEND */
1063 /* Nonzero if access to memory by bytes is slow and undesirable. */
1064 #define SLOW_BYTE_ACCESS (! TARGET_C2)
1066 /* Define if shifts truncate the shift count
1067 which implies one can omit a sign-extension or zero-extension
1068 of a shift count. */
1069 /* #define SHIFT_COUNT_TRUNCATED */
1071 /* Value is 1 if truncating an integer of INPREC bits to OUTPREC bits
1072 is done just by pretending it is already truncated. */
1073 #define TRULY_NOOP_TRUNCATION(OUTPREC, INPREC) 1
1075 /* On Convex, it is as good to call a constant function address as to
1076 call an address kept in a register. */
1077 #define NO_FUNCTION_CSE
1079 /* When a prototype says `char' or `short', really pass an `int'. */
1080 #define PROMOTE_PROTOTYPES
1082 /* Specify the machine mode that pointers have.
1083 After generation of rtl, the compiler makes no further distinction
1084 between pointers and any other objects of this machine mode. */
1085 #define Pmode SImode
1087 /* A function address in a call instruction
1088 is a byte address (for indexing purposes)
1089 so give the MEM rtx a byte's mode. */
1090 #define FUNCTION_MODE QImode
1092 /* Compute the cost of computing a constant rtl expression RTX
1093 whose rtx-code is CODE. The body of this macro is a portion
1094 of a switch statement. If the code is computed here,
1095 return it with a return statement. Otherwise, break from the switch. */
1097 #define CONST_COSTS(RTX,CODE,OUTER_CODE) \
1098 case CONST: \
1099 case LABEL_REF: \
1100 case SYMBOL_REF: \
1101 case CONST_INT: \
1102 case CONST_DOUBLE: \
1103 return 0;
1105 /* Provide the costs of a rtl expression. This is in the body of a
1106 switch on CODE. */
1108 #define RTX_COSTS(RTX,CODE,OUTER_CODE) \
1109 case PLUS: \
1110 if (regno_pointer_flag != 0 \
1111 && GET_CODE (XEXP (RTX, 0)) == REG \
1112 && REGNO_POINTER_FLAG (REGNO (XEXP (RTX, 0))) \
1113 && GET_CODE (XEXP (RTX, 1)) == CONST_INT) \
1114 return 0; \
1115 else break; \
1116 case MULT: \
1117 return 4 * (char) (0x03060403 >> target_cpu * 8); \
1118 case ASHIFT: \
1119 case LSHIFTRT: \
1120 case ASHIFTRT: \
1121 return 4 * (char) (0x03010403 >> target_cpu * 8); \
1122 case MEM: \
1123 return 5;
1125 /* Compute the cost of an address. This is meant to approximate the size
1126 and/or execution delay of an insn using that address. If the cost is
1127 approximated by the RTL complexity, including CONST_COSTS above, as
1128 is usually the case for CISC machines, this macro should not be defined.
1129 For aggressively RISCy machines, only one insn format is allowed, so
1130 this macro should be a constant. The value of this macro only matters
1131 for valid addresses. */
1133 #define ADDRESS_COST(RTX) 0
1135 /* Specify the cost of a branch insn; roughly the number of extra insns that
1136 should be added to avoid a branch. */
1138 #define BRANCH_COST 0
1140 /* Adjust the cost of dependences. */
1142 #define ADJUST_COST(INSN,LINK,DEP,COST) \
1144 /* Antidependencies don't block issue. */ \
1145 if (REG_NOTE_KIND (LINK) != 0) \
1146 (COST) = 0; \
1147 /* C38 situations where delay depends on context */ \
1148 else if (TARGET_C38 \
1149 && GET_CODE (PATTERN (INSN)) == SET \
1150 && GET_CODE (PATTERN (DEP)) == SET) \
1152 enum attr_type insn_type = get_attr_type (INSN); \
1153 enum attr_type dep_type = get_attr_type (DEP); \
1154 /* index register must be ready one cycle early */ \
1155 if (insn_type == TYPE_MLDW || insn_type == TYPE_MLDL \
1156 || (insn_type == TYPE_MST \
1157 && reg_mentioned_p (SET_DEST (PATTERN (DEP)), \
1158 SET_SRC (PATTERN (INSN))))) \
1159 (COST) += 1; \
1160 /* alu forwarding off alu takes two */ \
1161 if (dep_type == TYPE_ALU \
1162 && insn_type != TYPE_ALU \
1163 && ! (insn_type == TYPE_MST \
1164 && SET_DEST (PATTERN (DEP)) == SET_SRC (PATTERN (INSN)))) \
1165 (COST) += 1; \
1169 /* Convex uses Vax or IEEE floats.
1170 Follow the host format. */
1171 #define TARGET_FLOAT_FORMAT HOST_FLOAT_FORMAT
1173 /* But must prevent real.c from constructing Vax dfloats */
1174 #define REAL_VALUE_ATOF(X,S) atof (X)
1175 extern double atof();
1177 /* Check a `double' value for validity for a particular machine mode. */
1178 #define CHECK_FLOAT_VALUE(MODE, D, OVERFLOW) \
1179 OVERFLOW = check_float_value (MODE, &D, OVERFLOW)
1181 /* Tell final.c how to eliminate redundant test instructions. */
1183 /* Here we define machine-dependent flags and fields in cc_status
1184 (see `conditions.h'). No extra ones are needed for convex. */
1186 /* Store in cc_status the expressions
1187 that the condition codes will describe
1188 after execution of an instruction whose pattern is EXP.
1189 Do not alter them if the instruction would not alter the cc's. */
1191 #define NOTICE_UPDATE_CC(EXP,INSN) {}
1193 /* Control the assembler format that we output. */
1195 /* Output at beginning of assembler file. */
1197 #if _IEEE_FLOAT_
1198 #define ASM_FILE_START(FILE) fprintf (FILE, ";NO_APP\n.fpmode ieee\n")
1199 #else
1200 #define ASM_FILE_START(FILE) fprintf (FILE, ";NO_APP\n.fpmode native\n")
1201 #endif
1203 /* Output to assembler file text saying following lines
1204 may contain character constants, extra white space, comments, etc. */
1206 #define ASM_APP_ON ";APP\n"
1208 /* Output to assembler file text saying following lines
1209 no longer contain unusual constructs. */
1211 #define ASM_APP_OFF ";NO_APP\n"
1213 /* Alignment with Convex's assembler goes like this:
1214 .text can be .aligned up to a halfword.
1215 .data and .bss can be .aligned up to a longword.
1216 .lcomm is not supported, explicit declarations in .bss must be used instead.
1217 We get alignment for word and longword .text data by conventionally
1218 using .text 2 for word-aligned data and .text 3 for longword-aligned
1219 data. This requires that the data's size be a multiple of its alignment,
1220 which seems to be always true. */
1222 /* Output before read-only data. */
1224 #define TEXT_SECTION_ASM_OP (current_section_is_text = 1, ".text")
1226 /* Output before writable data. */
1228 #define DATA_SECTION_ASM_OP (current_section_is_text = 0, ".data")
1230 /* Output before uninitialized data. */
1232 #define BSS_SECTION_ASM_OP (current_section_is_text = 0, ".bss")
1234 /* This is how to output an assembler line
1235 that says to advance the location counter
1236 to a multiple of 2**LOG bytes. */
1238 #define ASM_OUTPUT_ALIGN(FILE,LOG) \
1239 if (current_section_is_text && (LOG) > 1) \
1240 fprintf (FILE, ".text %d\n", LOG); \
1241 else if (current_section_is_text) \
1242 fprintf (FILE, ".text\n.align %d\n", 1 << (LOG)); \
1243 else \
1244 fprintf (FILE, ".align %d\n", 1 << (LOG))
1246 /* How to refer to registers in assembler output.
1247 This sequence is indexed by compiler's hard-register-number (see above). */
1249 #define REGISTER_NAMES \
1251 "s0", "s1", "s2", "s3", "s4", "s5", "s6", "s7", \
1252 "sp", "a1", "a2", "a3", "a4", "a5", "ap", "fp", \
1255 /* This is BSD, so it wants DBX format. */
1257 #define DBX_DEBUGGING_INFO
1259 /* How to renumber registers for dbx and gdb. */
1261 #define DBX_REGISTER_NUMBER(REGNO) (REGNO)
1263 /* Do not break .stabs pseudos into continuations. */
1265 #define DBX_CONTIN_LENGTH 0
1267 /* This is the char to use for continuation (in case we need to turn
1268 continuation back on). */
1270 #define DBX_CONTIN_CHAR '?'
1272 /* Don't use stab extensions until GDB v4 port is available for convex. */
1274 #define DEFAULT_GDB_EXTENSIONS 0
1275 #define DBX_NO_XREFS
1277 /* This is how to output the definition of a user-level label named NAME,
1278 such as the label on a static function or variable NAME. */
1280 #define ASM_OUTPUT_LABEL(FILE,NAME) \
1281 do { assemble_name (FILE, NAME); fputs (":\n", FILE); } while (0)
1283 /* This is how to output a command to make the user-level label named NAME
1284 defined for reference from other files. */
1286 #define ASM_GLOBALIZE_LABEL(FILE,NAME) \
1287 do { fputs (".globl ", FILE); assemble_name (FILE, NAME); fputs ("\n", FILE);} while (0)
1289 /* The prefix to add to user-visible assembler symbols. */
1291 #define USER_LABEL_PREFIX "_"
1293 /* This is how to output an internal numbered label where
1294 PREFIX is the class of label and NUM is the number within the class. */
1296 #define ASM_OUTPUT_INTERNAL_LABEL(FILE,PREFIX,NUM) \
1297 fprintf (FILE, "%s%d:\n", PREFIX, NUM)
1299 /* Put case tables in .text 2, where they will be word-aligned */
1301 #define ASM_OUTPUT_CASE_LABEL(FILE,PREFIX,NUM,TABLE) \
1302 ASM_OUTPUT_ALIGN (FILE, 2); \
1303 ASM_OUTPUT_INTERNAL_LABEL (FILE, PREFIX, NUM)
1305 #define ASM_OUTPUT_CASE_END(FILE,NUM,TABLE) \
1306 ASM_OUTPUT_ALIGN (FILE, 1)
1308 /* This is how to store into the string LABEL
1309 the symbol_ref name of an internal numbered label where
1310 PREFIX is the class of label and NUM is the number within the class.
1311 This is suitable for output with `assemble_name'. */
1313 #define ASM_GENERATE_INTERNAL_LABEL(LABEL,PREFIX,NUM) \
1314 sprintf (LABEL, "*%s%d", PREFIX, NUM)
1316 /* This is how to output an assembler line defining a `double' constant. */
1318 #define ASM_OUTPUT_DOUBLE(FILE,VALUE) \
1319 outfloat (FILE, VALUE, "%.17e", "\tds.d ", "\n")
1321 /* This is how to output an assembler line defining a `float' constant. */
1323 #define ASM_OUTPUT_FLOAT(FILE,VALUE) \
1324 outfloat (FILE, VALUE, "%.9e", "\tds.s ", "\n")
1326 /* This is how to output an assembler line defining an `int' constant. */
1328 #define ASM_OUTPUT_INT(FILE,VALUE) \
1330 fprintf (FILE, "\tds.w "); \
1331 output_addr_const (FILE, simplify_for_convex (VALUE)); \
1332 fprintf (FILE, "\n"); \
1335 /* Likewise for a `long long int' constant. */
1337 #define ASM_OUTPUT_DOUBLE_INT(FILE,VALUE) \
1339 if (GET_CODE (VALUE) == CONST_DOUBLE) \
1340 fprintf (FILE, "\tds.w %d,%d\n", \
1341 const_double_high_int (VALUE), const_double_low_int (VALUE)); \
1342 else if (GET_CODE (VALUE) == CONST_INT) \
1344 int val = INTVAL (VALUE); \
1345 fprintf (FILE, "\tds.w %d,%d\n", val < 0 ? -1 : 0, val); \
1347 else \
1348 abort (); \
1351 /* Likewise for `char' and `short' constants. */
1353 #define ASM_OUTPUT_SHORT(FILE,VALUE) \
1354 ( fprintf (FILE, "\tds.h "), \
1355 output_addr_const (FILE, (VALUE)), \
1356 fprintf (FILE, "\n"))
1358 #define ASM_OUTPUT_CHAR(FILE,VALUE) \
1359 ( fprintf (FILE, "\tds.b "), \
1360 output_addr_const (FILE, (VALUE)), \
1361 fprintf (FILE, "\n"))
1363 /* This is how to output an assembler line for a numeric constant byte. */
1365 #define ASM_OUTPUT_BYTE(FILE,VALUE) \
1366 fprintf (FILE, "\tds.b %#x\n", (VALUE))
1368 /* This is how to output a string */
1370 #define ASM_OUTPUT_ASCII(FILE,STR,SIZE) do { \
1371 int i; \
1372 fprintf ((FILE), "\tds.b \""); \
1373 for (i = 0; i < (SIZE); i++) { \
1374 register int c = (STR)[i] & 0377; \
1375 if (c >= ' ' && c < 0177 && c != '\\' && c != '"') \
1376 putc (c, (FILE)); \
1377 else \
1378 fprintf ((FILE), "\\%03o", c);} \
1379 fprintf ((FILE), "\"\n");} while (0)
1381 /* This is how to output an insn to push a register on the stack.
1382 It need not be very fast code. */
1384 #define ASM_OUTPUT_REG_PUSH(FILE,REGNO) \
1385 fprintf (FILE, "\tpsh.%c %s\n", \
1386 S_REGNO_P (REGNO) ? 'l' : 'w', \
1387 reg_names[REGNO])
1389 /* This is how to output an insn to pop a register from the stack.
1390 It need not be very fast code. */
1392 #define ASM_OUTPUT_REG_POP(FILE,REGNO) \
1393 fprintf (FILE, "\tpop.%c %s\n", \
1394 S_REGNO_P (REGNO) ? 'l' : 'w', \
1395 reg_names[REGNO])
1397 /* This is how to output an element of a case-vector that is absolute. */
1399 #define ASM_OUTPUT_ADDR_VEC_ELT(FILE, VALUE) \
1400 fprintf (FILE, "\tds.w L%d\n", VALUE)
1402 /* This is how to output an element of a case-vector that is relative.
1403 (not used on Convex) */
1405 #define ASM_OUTPUT_ADDR_DIFF_ELT(FILE, VALUE, REL) \
1406 fprintf (FILE, "\tds.w L%d-L%d\n", VALUE, REL)
1408 /* This is how to output an assembler line
1409 that says to advance the location counter by SIZE bytes. */
1411 #define ASM_OUTPUT_SKIP(FILE,SIZE) \
1412 fprintf (FILE, "\tds.b %u(0)\n", (SIZE))
1414 /* This says how to output an assembler line
1415 to define a global common symbol. */
1417 #define ASM_OUTPUT_COMMON(FILE, NAME, SIZE, ROUNDED) \
1418 ( fputs (".comm ", (FILE)), \
1419 assemble_name ((FILE), (NAME)), \
1420 fprintf ((FILE), ",%u\n", (ROUNDED)))
1422 /* This says how to output an assembler line
1423 to define a local common symbol. */
1425 #define ASM_OUTPUT_LOCAL(FILE, NAME, SIZE, ROUNDED) \
1426 ( bss_section (), \
1427 assemble_name ((FILE), (NAME)), \
1428 fprintf ((FILE), ":\tbs.b %u\n", (ROUNDED)))
1430 /* Store in OUTPUT a string (made with alloca) containing
1431 an assembler-name for a local static variable named NAME.
1432 LABELNO is an integer which is different for each call. */
1434 #define ASM_FORMAT_PRIVATE_NAME(OUTPUT, NAME, LABELNO) \
1435 ( (OUTPUT) = (char *) alloca (strlen ((NAME)) + 10), \
1436 sprintf ((OUTPUT), "%s.%d", (NAME), (LABELNO)))
1438 /* Output an arg count before function entries. */
1440 #define ASM_DECLARE_FUNCTION_NAME(FILE, NAME, DECL) \
1441 asm_declare_function_name (FILE, NAME, DECL)
1443 /* Define the parentheses used to group arithmetic operations
1444 in assembler code. */
1446 #define ASM_OPEN_PAREN "("
1447 #define ASM_CLOSE_PAREN ")"
1449 /* Define results of standard character escape sequences. */
1450 #define TARGET_BELL 007
1451 #define TARGET_BS 010
1452 #define TARGET_TAB 011
1453 #define TARGET_NEWLINE 012
1454 #define TARGET_VT 013
1455 #define TARGET_FF 014
1456 #define TARGET_CR 015
1458 /* Print an instruction operand X on file FILE.
1459 CODE is the code from the %-spec that requested printing this operand;
1460 if `%z3' was used to print operand 3, then CODE is 'z'. */
1462 #define PRINT_OPERAND(FILE, X, CODE) \
1463 print_operand (FILE, X, CODE)
1465 /* Print a memory operand whose address is X, on file FILE. */
1467 #define PRINT_OPERAND_ADDRESS(FILE, ADDR) \
1468 print_operand_address (FILE, ADDR)
1470 /* Do not put out GNU stabs for constructors and destructors.
1471 ld bounces them. */
1473 #define FASCIST_ASSEMBLER
1475 /* __gcc_cleanup is loader-aliased to __ap$do_registered_functions if we
1476 are linking against standard libc, 0 if old (-traditional) libc. */
1478 #define EXIT_BODY \
1480 extern void __gcc_cleanup (); \
1481 if (__gcc_cleanup != _cleanup) \
1482 __gcc_cleanup (); \
1483 _cleanup (); \
1486 /* Header for convex.c.
1487 Here at the end so we can use types defined above. */
1489 extern int target_cpu;
1490 extern int current_section_is_text;
1491 extern enum reg_class regno_reg_class[];
1492 extern enum reg_class reg_class_from_letter[];
1493 extern char regno_ok_for_index_p_base[];
1494 #define regno_ok_for_index_p (regno_ok_for_index_p_base + 1)
1496 extern int const_double_low_int ();
1497 extern int const_double_high_int ();
1498 extern char *output_cmp ();
1499 extern char *output_condjump ();
1500 extern char *output_call ();
1501 extern void gen_ap_for_call ();
1502 extern int check_float_value ();
1503 extern void asm_declare_function_name ();