* Makefile.in (final.o): Depend on target.h.
[official-gcc.git] / gcc / config / elxsi / elxsi.h
blobfb2885d1165ce6504549b592c47cb5c55c253995
1 /* Definitions of target machine for GNU compiler. Elxsi version.
2 Copyright (C) 1987, 1988, 1992, 1995, 1996, 1998, 1999, 2000
3 Free Software Foundation, Inc.
4 Contributed by Mike Stump <mrs@cygnus.com> in 1988. This is the first
5 64 bit port of GNU CC.
6 Based upon the VAX port.
8 This file is part of GNU CC.
10 GNU CC is free software; you can redistribute it and/or modify
11 it under the terms of the GNU General Public License as published by
12 the Free Software Foundation; either version 2, or (at your option)
13 any later version.
15 GNU CC is distributed in the hope that it will be useful,
16 but WITHOUT ANY WARRANTY; without even the implied warranty of
17 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 GNU General Public License for more details.
20 You should have received a copy of the GNU General Public License
21 along with GNU CC; see the file COPYING. If not, write to
22 the Free Software Foundation, 59 Temple Place - Suite 330,
23 Boston, MA 02111-1307, USA. */
26 /* Names to predefine in the preprocessor for this target machine. */
28 #define CPP_PREDEFINES "-Delxsi -Dunix -Asystem=unix -Acpu=elxsi -Amachine=elxsi"
30 /* Print subsidiary information on the compiler version in use. */
32 #define TARGET_VERSION fprintf (stderr, " (elxsi)");
34 /* Run-time compilation parameters selecting different hardware subsets. */
36 extern int target_flags;
38 /* Macros used in the machine description to test the flags. */
40 /* Nonzero if compiling code that Unix assembler can assemble. */
41 #define TARGET_UNIX_ASM (target_flags & 1)
44 /* Macro to define tables used to set the flags.
45 This is a list in braces of pairs in braces,
46 each pair being { "NAME", VALUE }
47 where VALUE is the bits to set or minus the bits to clear.
48 An empty string NAME is used to identify the default VALUE. */
50 #define TARGET_SWITCHES \
51 { {"unix", 1, N_("Generate code the unix assembler can handle")}, \
52 {"embos", -1, N_("Generate code an embedded assembler can handle")},\
53 { "", TARGET_DEFAULT, NULL}}
55 /* Default target_flags if no switches specified. */
57 #ifndef TARGET_DEFAULT
58 #define TARGET_DEFAULT 1
59 #endif
61 /* Target machine storage layout */
63 /* Define this if most significant bit is lowest numbered
64 in instructions that operate on numbered bit-fields.
65 This is not true on the vax. */
66 #define BITS_BIG_ENDIAN 0
68 /* Define this if most significant byte of a word is the lowest numbered. */
69 #define BYTES_BIG_ENDIAN 1
71 /* Define this if most significant word of a multiword number is numbered. */
72 #define WORDS_BIG_ENDIAN 1
74 /* Number of bits in an addressable storage unit */
75 #define BITS_PER_UNIT 8
77 /* Width in bits of a "word", which is the contents of a machine register.
78 Note that this is not necessarily the width of data type `int';
79 if using 16-bit ints on a 68000, this would still be 32.
80 But on a machine with 16-bit registers, this would be 16. */
81 #define BITS_PER_WORD 64
82 #define Rmode DImode
84 #define INT_TYPE_SIZE 32
86 #define LONG_TYPE_SIZE 32
88 #define LONG_LONG_TYPE_SIZE 64
90 #define FLOAT_TYPE_SIZE 32
92 #define DOUBLE_TYPE_SIZE 64
94 #define LONG_DOUBLE_TYPE_SIZE 64
96 /* Width of a word, in units (bytes). */
97 #define UNITS_PER_WORD 8
99 /* Width in bits of a pointer.
100 See also the macro `Pmode' defined below. */
101 #define POINTER_SIZE 32
103 /* Allocation boundary (in *bits*) for storing pointers in memory. */
104 #define POINTER_BOUNDARY 32
106 /* Allocation boundary (in *bits*) for storing arguments in argument list. */
107 #define PARM_BOUNDARY 32
109 /* Allocation boundary (in *bits*) for the code of a function. */
110 #define FUNCTION_BOUNDARY 8
112 /* Alignment of field after `int : 0' in a structure. */
113 #define EMPTY_FIELD_BOUNDARY 8
115 /* Every structure's size must be a multiple of this. */
116 #define STRUCTURE_SIZE_BOUNDARY 32
118 /* A bitfield declared as `int' forces `int' alignment for the struct. */
119 #define PCC_BITFIELD_TYPE_MATTERS 1
121 /* No data type wants to be aligned rounder than this. */
122 #define BIGGEST_ALIGNMENT 32
124 /* Define this if move instructions will actually fail to work
125 when given unaligned data. */
126 #define STRICT_ALIGNMENT 0
128 /* Standard register usage. */
130 /* Number of actual hardware registers.
131 The hardware registers are assigned numbers for the compiler
132 from 0 to just below FIRST_PSEUDO_REGISTER.
133 All registers that the compiler knows about must be given numbers,
134 even those that are not normally considered general registers. */
135 #define FIRST_PSEUDO_REGISTER 16
137 /* 1 for registers that have pervasive standard uses
138 and are not available for the register allocator.
139 On the elxsi, these is the .r15 (aka .sp). */
140 #define FIXED_REGISTERS {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1}
142 /* 1 for registers not available across function calls.
143 These must include the FIXED_REGISTERS and also any
144 registers that can be used without being saved.
145 The latter must include the registers where values are returned
146 and the register where structure-value addresses are passed.
147 Aside from that, you can include as many other registers as you like. */
148 #define CALL_USED_REGISTERS {1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1}
150 /* Return number of consecutive hard regs needed starting at reg REGNO
151 to hold something of mode MODE.
152 This is ordinarily the length in words of a value of mode MODE
153 but can be less for certain modes in special long registers.
154 On the vax, all registers are one word long. */
155 #define HARD_REGNO_NREGS(REGNO, MODE) \
156 ((GET_MODE_SIZE (MODE) + UNITS_PER_WORD - 1) / UNITS_PER_WORD)
158 /* Value is 1 if hard register REGNO can hold a value of machine-mode MODE. */
159 #define HARD_REGNO_MODE_OK(REGNO, MODE) 1
161 /* Value is 1 if it is a good idea to tie two pseudo registers
162 when one has mode MODE1 and one has mode MODE2.
163 If HARD_REGNO_MODE_OK could produce different values for MODE1 and MODE2,
164 for any hard reg, then this must be 0 for correct output. */
165 #define MODES_TIEABLE_P(MODE1, MODE2) 1
167 /* Specify the registers used for certain standard purposes.
168 The values of these macros are register numbers. */
170 /* Register to use for pushing function arguments. */
171 #define STACK_POINTER_REGNUM 15
173 /* Base register for access to local variables of the function. */
174 #define FRAME_POINTER_REGNUM 14
176 /* Value should be nonzero if functions must have frame pointers.
177 Zero means the frame pointer need not be set up (and parms
178 may be accessed via the stack pointer) in functions that seem suitable.
179 This is computed in `reload', in reload1.c. */
180 #define FRAME_POINTER_REQUIRED 0
182 #define INITIAL_FRAME_POINTER_OFFSET(DEPTH) \
183 { int regno; \
184 int offset = 0; \
185 for( regno=0; regno < FIRST_PSEUDO_REGISTER; regno++ ) \
186 if( regs_ever_live[regno] && !call_used_regs[regno] ) \
187 offset += 8; \
188 (DEPTH) = (offset + ((get_frame_size() + 3) & ~3) ); \
189 (DEPTH) = 0; \
192 /* Base register for access to arguments of the function. */
193 #define ARG_POINTER_REGNUM 14
195 /* Register in which static-chain is passed to a function. */
196 #define STATIC_CHAIN_REGNUM 0
198 /* Register in which address to store a structure value
199 is passed to a function. */
200 #define STRUCT_VALUE_REGNUM 1
202 /* Define the classes of registers for register constraints in the
203 machine description. Also define ranges of constants.
205 One of the classes must always be named ALL_REGS and include all hard regs.
206 If there is more than one class, another class must be named NO_REGS
207 and contain no registers.
209 The name GENERAL_REGS must be the name of a class (or an alias for
210 another name such as ALL_REGS). This is the class of registers
211 that is allowed by "g" or "r" in a register constraint.
212 Also, registers outside this class are allocated only when
213 instructions express preferences for them.
215 The classes must be numbered in nondecreasing order; that is,
216 a larger-numbered class must never be contained completely
217 in a smaller-numbered class.
219 For any two classes, it is very desirable that there be another
220 class that represents their union. */
222 /* The vax has only one kind of registers, so NO_REGS and ALL_REGS
223 are the only classes. */
225 enum reg_class { NO_REGS, GENERAL_REGS, ALL_REGS, LIM_REG_CLASSES };
227 #define N_REG_CLASSES (int) LIM_REG_CLASSES
229 /* Give names of register classes as strings for dump file. */
231 #define REG_CLASS_NAMES \
232 {"NO_REGS", "GENERAL_REGS", "ALL_REGS" }
234 /* Define which registers fit in which classes.
235 This is an initializer for a vector of HARD_REG_SET
236 of length N_REG_CLASSES. */
238 #define REG_CLASS_CONTENTS {{0}, {0x07fff}, {0xffff}}
240 /* The same information, inverted:
241 Return the class number of the smallest class containing
242 reg number REGNO. This could be a conditional expression
243 or could index an array. */
245 #define REGNO_REG_CLASS(REGNO) (REGNO == 15 ? ALL_REGS : GENERAL_REGS)
247 /* The class value for index registers, and the one for base regs. */
249 #define INDEX_REG_CLASS GENERAL_REGS
250 #define BASE_REG_CLASS GENERAL_REGS
252 /* Get reg_class from a letter such as appears in the machine description. */
254 #define REG_CLASS_FROM_LETTER(C) NO_REGS
256 /* The letters I, J, K, L and M in a register constraint string
257 can be used to stand for particular ranges of immediate operands.
258 This macro defines what the ranges are.
259 C is the letter, and VALUE is a constant value.
260 Return 1 if VALUE is in the range specified by C. */
262 #define CONST_OK_FOR_LETTER_P(VALUE, C) \
263 ((C) == 'I' ? (VALUE) >=-16 && (VALUE) <=15 : 0)
265 /* Similar, but for floating constants, and defining letters G and H.
266 Here VALUE is the CONST_DOUBLE rtx itself. */
268 #define CONST_DOUBLE_OK_FOR_LETTER_P(VALUE, C) 1
270 /* Given an rtx X being reloaded into a reg required to be
271 in class CLASS, return the class of reg to actually use.
272 In general this is just CLASS; but on some machines
273 in some cases it is preferable to use a more restrictive class. */
275 #define PREFERRED_RELOAD_CLASS(X,CLASS) (CLASS)
277 /* Return the maximum number of consecutive registers
278 needed to represent mode MODE in a register of class CLASS. */
279 /* On the vax, this is always the size of MODE in words,
280 since all registers are the same size. */
281 #define CLASS_MAX_NREGS(CLASS, MODE) \
282 ((GET_MODE_SIZE (MODE) + UNITS_PER_WORD - 1) / UNITS_PER_WORD)
284 /* Stack layout; function entry, exit and calling. */
286 /* Define this if pushing a word on the stack
287 makes the stack pointer a smaller address. */
288 #define STACK_GROWS_DOWNWARD
290 /* Define this if the nominal address of the stack frame
291 is at the high-address end of the local variables;
292 that is, each additional local variable allocated
293 goes at a more negative offset in the frame. */
294 #define FRAME_GROWS_DOWNWARD
296 /* Offset within stack frame to start allocating local variables at.
297 If FRAME_GROWS_DOWNWARD, this is the offset to the END of the
298 first local allocated. Otherwise, it is the offset to the BEGINNING
299 of the first local allocated. */
300 #define STARTING_FRAME_OFFSET -4
302 /* Offset of first parameter from the argument pointer register value. */
303 #define FIRST_PARM_OFFSET(FNDECL) 4
305 /* Value is 1 if returning from a function call automatically
306 pops the arguments described by the number-of-args field in the call.
307 FUNDECL is the declaration node of the function (as a tree),
308 FUNTYPE is the data type of the function (as a tree),
309 or for a library call it is an identifier node for the subroutine name.
311 On the Vax, the RET insn always pops all the args for any function. */
313 #define RETURN_POPS_ARGS(FUNDECL,FUNTYPE,SIZE) (SIZE)
315 /* Define how to find the value returned by a function.
316 VALTYPE is the data type of the value (as a tree).
317 If the precise function being called is known, FUNC is its FUNCTION_DECL;
318 otherwise, FUNC is 0. */
320 /* On the Vax the return value is in R0 regardless. */
322 #define FUNCTION_VALUE(VALTYPE, FUNC) \
323 gen_rtx_REG (TYPE_MODE (VALTYPE), 0)
325 /* Define how to find the value returned by a library function
326 assuming the value has mode MODE. */
328 /* On the Vax the return value is in R0 regardless. */
330 #define LIBCALL_VALUE(MODE) gen_rtx_REG (MODE, 0)
332 /* Define this if PCC uses the nonreentrant convention for returning
333 structure and union values. */
335 #define PCC_STATIC_STRUCT_RETURN
337 /* 1 if N is a possible register number for a function value.
338 On the Vax, R0 is the only register thus used. */
340 #define FUNCTION_VALUE_REGNO_P(N) ((N) == 0)
342 /* 1 if N is a possible register number for function argument passing.
343 On the Vax, no registers are used in this way. */
345 #define FUNCTION_ARG_REGNO_P(N) 0
347 /* Define a data type for recording info about an argument list
348 during the scan of that argument list. This data type should
349 hold all necessary information about the function itself
350 and about the args processed so far, enough to enable macros
351 such as FUNCTION_ARG to determine where the next arg should go.
353 On the vax, this is a single integer, which is a number of bytes
354 of arguments scanned so far. */
356 #define CUMULATIVE_ARGS int
358 /* Initialize a variable CUM of type CUMULATIVE_ARGS
359 for a call to a function whose data type is FNTYPE.
360 For a library call, FNTYPE is 0.
362 On the vax, the offset starts at 0. */
364 #define INIT_CUMULATIVE_ARGS(CUM,FNTYPE,x,INDIRECT) \
365 ((CUM) = 0)
367 /* Update the data in CUM to advance over an argument
368 of mode MODE and data type TYPE.
369 (TYPE is null for libcalls where that information may not be available.) */
371 #define FUNCTION_ARG_ADVANCE(CUM, MODE, TYPE, NAMED) \
372 ((CUM) += ((MODE) != BLKmode \
373 ? (GET_MODE_SIZE (MODE) + 3) & ~3 \
374 : (int_size_in_bytes (TYPE) + 3) & ~3))
376 /* Define where to put the arguments to a function.
377 Value is zero to push the argument on the stack,
378 or a hard register in which to store the argument.
380 MODE is the argument's machine mode.
381 TYPE is the data type of the argument (as a tree).
382 This is null for libcalls where that information may
383 not be available.
384 CUM is a variable of type CUMULATIVE_ARGS which gives info about
385 the preceding args and about the function being called.
386 NAMED is nonzero if this argument is a named parameter
387 (otherwise it is an extra parameter matching an ellipsis). */
389 /* On the vax all args are pushed. */
391 #define FUNCTION_ARG(CUM, MODE, TYPE, NAMED) 0
393 /* Output assembler code to FILE to increment profiler label # LABELNO
394 for profiling a function entry. */
396 #define FUNCTION_PROFILER(FILE, LABELNO) \
397 fprintf (FILE, "\tld.64\t.r0,.LP%d\n\tcall\tmcount\n", (LABELNO));
399 /* EXIT_IGNORE_STACK should be nonzero if, when returning from a function,
400 the stack pointer does not matter. The value is tested only in
401 functions that have frame pointers.
402 No definition is equivalent to always zero. */
404 #define EXIT_IGNORE_STACK 0
406 /* If the memory address ADDR is relative to the frame pointer,
407 correct it to be relative to the stack pointer instead.
408 This is for when we don't use a frame pointer.
409 ADDR should be a variable name. */
411 #define FIX_FRAME_POINTER_ADDRESS(ADDR,DEPTH) \
412 { int offset = -1; \
413 rtx regs = stack_pointer_rtx; \
414 if (ADDR == frame_pointer_rtx) \
415 offset = 0; \
416 else if (GET_CODE (ADDR) == PLUS && XEXP (ADDR, 1) == frame_pointer_rtx \
417 && GET_CODE (XEXP (ADDR, 0)) == CONST_INT) \
418 offset = INTVAL (XEXP (ADDR, 0)); \
419 else if (GET_CODE (ADDR) == PLUS && XEXP (ADDR, 0) == frame_pointer_rtx \
420 && GET_CODE (XEXP (ADDR, 1)) == CONST_INT) \
421 offset = INTVAL (XEXP (ADDR, 1)); \
422 else if (GET_CODE (ADDR) == PLUS && XEXP (ADDR, 0) == frame_pointer_rtx) \
423 { rtx other_reg = XEXP (ADDR, 1); \
424 offset = 0; \
425 regs = gen_rtx_PLUS (Pmode, stack_pointer_rtx, other_reg); } \
426 else if (GET_CODE (ADDR) == PLUS && XEXP (ADDR, 1) == frame_pointer_rtx) \
427 { rtx other_reg = XEXP (ADDR, 0); \
428 offset = 0; \
429 regs = gen_rtx_PLUS (Pmode, stack_pointer_rtx, other_reg); } \
430 if (offset >= 0) \
431 { int regno; \
432 extern char call_used_regs[]; \
433 offset += 4; /* I don't know why??? */ \
434 for (regno = 0; regno < FIRST_PSEUDO_REGISTER; regno++) \
435 if (regs_ever_live[regno] && ! call_used_regs[regno]) \
436 offset += 8; \
437 ADDR = plus_constant (regs, offset + (DEPTH)); } }
440 /* Addressing modes, and classification of registers for them. */
442 /* #define HAVE_POST_INCREMENT 0 */
443 /* #define HAVE_POST_DECREMENT 0 */
445 /* #define HAVE_PRE_DECREMENT 0 */
446 /* #define HAVE_PRE_INCREMENT 0 */
448 /* Macros to check register numbers against specific register classes. */
450 /* These assume that REGNO is a hard or pseudo reg number.
451 They give nonzero only if REGNO is a hard reg of the suitable class
452 or a pseudo reg currently allocated to a suitable hard reg.
453 Since they use reg_renumber, they are safe only once reg_renumber
454 has been allocated, which happens in local-alloc.c. */
456 #define REGNO_OK_FOR_INDEX_P(regno) \
457 ((regno) < FIRST_PSEUDO_REGISTER || reg_renumber[regno] >= 0)
458 #define REGNO_OK_FOR_BASE_P(regno) \
459 ((regno) < FIRST_PSEUDO_REGISTER || reg_renumber[regno] >= 0)
461 /* Maximum number of registers that can appear in a valid memory address. */
463 #define MAX_REGS_PER_ADDRESS 2
465 /* 1 if X is an rtx for a constant that is a valid address. */
467 #define CONSTANT_ADDRESS_P(X) \
468 (GET_CODE (X) == LABEL_REF || GET_CODE (X) == SYMBOL_REF \
469 || GET_CODE (X) == CONST_INT || GET_CODE (X) == CONST \
470 || GET_CODE (X) == HIGH)
472 /* Nonzero if the constant value X is a legitimate general operand.
473 It is given that X satisfies CONSTANT_P or is a CONST_DOUBLE. */
475 #define LEGITIMATE_CONSTANT_P(X) \
476 (GET_CODE (X) != CONST_DOUBLE)
478 /* The macros REG_OK_FOR..._P assume that the arg is a REG rtx
479 and check its validity for a certain class.
480 We have two alternate definitions for each of them.
481 The usual definition accepts all pseudo regs; the other rejects
482 them unless they have been allocated suitable hard regs.
483 The symbol REG_OK_STRICT causes the latter definition to be used.
485 Most source files want to accept pseudo regs in the hope that
486 they will get allocated to the class that the insn wants them to be in.
487 Source files for reload pass need to be strict.
488 After reload, it makes no difference, since pseudo regs have
489 been eliminated by then. */
491 #ifndef REG_OK_STRICT
493 /* Nonzero if X is a hard reg that can be used as an index
494 or if it is a pseudo reg. */
495 #define REG_OK_FOR_INDEX_P(X) 1
496 /* Nonzero if X is a hard reg that can be used as a base reg
497 or if it is a pseudo reg. */
498 #define REG_OK_FOR_BASE_P(X) 1
500 #else
502 /* Nonzero if X is a hard reg that can be used as an index. */
503 #define REG_OK_FOR_INDEX_P(X) REGNO_OK_FOR_INDEX_P (REGNO (X))
504 /* Nonzero if X is a hard reg that can be used as a base reg. */
505 #define REG_OK_FOR_BASE_P(X) REGNO_OK_FOR_BASE_P (REGNO (X))
507 #endif
509 /* GO_IF_LEGITIMATE_ADDRESS recognizes an RTL expression
510 that is a valid memory address for an instruction.
511 The MODE argument is the machine mode for the MEM expression
512 that wants to use this address.
514 CONSTANT_ADDRESS_P is actually machine-independent. */
516 #define GO_IF_LEGITIMATE_ADDRESS(MODE, X, ADDR) \
518 if (GET_CODE (X) == REG) goto ADDR; \
519 if (CONSTANT_ADDRESS_P (X)) goto ADDR; \
520 if (GET_CODE (X) == PLUS) \
522 /* Handle [index]<address> represented with index-sum outermost */\
523 if (GET_CODE (XEXP (X, 0)) == REG \
524 && REG_OK_FOR_BASE_P (XEXP (X, 0)) \
525 && GET_CODE (XEXP (X, 1)) == CONST_INT) \
526 goto ADDR; \
527 if (GET_CODE (XEXP (X, 1)) == REG \
528 && REG_OK_FOR_BASE_P (XEXP (X, 0)) \
529 && GET_CODE (XEXP (X, 0)) == CONST_INT) \
530 goto ADDR; \
535 /* Try machine-dependent ways of modifying an illegitimate address
536 to be legitimate. If we find one, return the new, valid address.
537 This macro is used in only one place: `memory_address' in explow.c.
539 OLDX is the address as it was before break_out_memory_refs was called.
540 In some cases it is useful to look at this to decide what needs to be done.
542 MODE and WIN are passed so that this macro can use
543 GO_IF_LEGITIMATE_ADDRESS.
545 It is always safe for this macro to do nothing. It exists to recognize
546 opportunities to optimize the output.
548 For the vax, nothing needs to be done. */
550 #define LEGITIMIZE_ADDRESS(X,OLDX,MODE,WIN) {}
552 /* Go to LABEL if ADDR (a legitimate address expression)
553 has an effect that depends on the machine mode it is used for. */
554 #define GO_IF_MODE_DEPENDENT_ADDRESS(ADDR,LABEL)
557 /* Specify the machine mode that this machine uses
558 for the index in the tablejump instruction. */
559 #define CASE_VECTOR_MODE SImode
561 /* Define as C expression which evaluates to nonzero if the tablejump
562 instruction expects the table to contain offsets from the address of the
563 table.
564 Do not define this if the table should contain absolute addresses. */
565 /* #define CASE_VECTOR_PC_RELATIVE 1 */
567 /* Specify the tree operation to be used to convert reals to integers. */
568 #define IMPLICIT_FIX_EXPR FIX_ROUND_EXPR
570 /* This is the kind of divide that is easiest to do in the general case. */
571 #define EASY_DIV_EXPR TRUNC_DIV_EXPR
573 /* Define this as 1 if `char' should by default be signed; else as 0. */
574 #define DEFAULT_SIGNED_CHAR 1
576 /* This flag, if defined, says the same insns that convert to a signed fixnum
577 also convert validly to an unsigned one. */
578 #define FIXUNS_TRUNC_LIKE_FIX_TRUNC
580 /* Max number of bytes we can move from memory to memory
581 in one reasonably fast instruction. */
582 #define MOVE_MAX 8
584 /* Define this if zero-extension is slow (more than one real instruction). */
585 /* #define SLOW_ZERO_EXTEND */
587 /* Nonzero if access to memory by bytes is slow and undesirable. */
588 #define SLOW_BYTE_ACCESS 0
590 /* Define if shifts truncate the shift count
591 which implies one can omit a sign-extension or zero-extension
592 of a shift count. */
593 /* #define SHIFT_COUNT_TRUNCATED */
595 /* Value is 1 if truncating an integer of INPREC bits to OUTPREC bits
596 is done just by pretending it is already truncated. */
597 #define TRULY_NOOP_TRUNCATION(OUTPREC, INPREC) 1
599 /* Specify the machine mode that pointers have.
600 After generation of rtl, the compiler makes no further distinction
601 between pointers and any other objects of this machine mode. */
602 #define Pmode SImode
604 /* A function address in a call instruction
605 is a byte address (for indexing purposes)
606 so give the MEM rtx a byte's mode. */
607 #define FUNCTION_MODE QImode
609 /* Compute the cost of computing a constant rtl expression RTX
610 whose rtx-code is CODE. The body of this macro is a portion
611 of a switch statement. If the code is computed here,
612 return it with a return statement. Otherwise, break from the switch. */
614 #define CONST_COSTS(RTX,CODE,OUTER_CODE) \
615 case CONST_INT: \
616 /* Constant zero is super cheap due to clr instruction. */ \
617 if (RTX == const0_rtx) return 0; \
618 if ((unsigned) INTVAL (RTX) < 077) return 1; \
619 case CONST: \
620 case LABEL_REF: \
621 case SYMBOL_REF: \
622 return 3; \
623 case CONST_DOUBLE: \
624 return 5;
627 * We can use the BSD C library routines for the gnulib calls that are
628 * still generated, since that's what they boil down to anyways.
631 /* #define UDIVSI3_LIBCALL "*udiv" */
632 /* #define UMODSI3_LIBCALL "*urem" */
634 /* Tell final.c how to eliminate redundant test instructions. */
636 /* Here we define machine-dependent flags and fields in cc_status
637 (see `conditions.h'). No extra ones are needed for the vax. */
639 /* Store in cc_status the expressions
640 that the condition codes will describe
641 after execution of an instruction whose pattern is EXP.
642 Do not alter them if the instruction would not alter the cc's. */
644 #define NOTICE_UPDATE_CC(EXP, INSN) \
645 CC_STATUS_INIT;
648 /* Control the assembler format that we output. */
650 /* Output the name of the file we are compiling. */
651 #define ASM_OUTPUT_SOURCE_FILENAME(STREAM, NAME) \
652 do { fprintf (STREAM, "\t.file\t"); \
653 output_quoted_string (STREAM, NAME); \
654 fprintf (STREAM, "\n"); \
655 } while (0)
657 /* Output at beginning of assembler file. */
658 #define ASM_FILE_START(FILE) fputs ("", (FILE));
660 /* Output to assembler file text saying following lines
661 may contain character constants, extra white space, comments, etc. */
663 #define ASM_APP_ON ""
665 /* Output to assembler file text saying following lines
666 no longer contain unusual constructs. */
668 #define ASM_APP_OFF ""
670 /* Output before read-only data. */
672 #define TEXT_SECTION_ASM_OP "\t.inst"
674 /* Output before writable data. */
676 #define DATA_SECTION_ASM_OP "\t.var"
678 /* How to refer to registers in assembler output.
679 This sequence is indexed by compiler's hard-register-number (see above). */
681 #define REGISTER_NAMES \
682 {".r0", ".r1", ".r2", ".r3", ".r4", ".r5", ".r6", ".r7", ".r8", \
683 ".r9", ".r10", ".r11", ".r12", ".r13", ".r14", ".sp"}
685 /* This is BSD, so it wants DBX format. */
687 /* #define DBX_DEBUGGING_INFO */
689 /* How to renumber registers for dbx and gdb.
690 Vax needs no change in the numeration. */
692 #define DBX_REGISTER_NUMBER(REGNO) (REGNO)
694 /* Do not break .stabs pseudos into continuations. */
696 #define DBX_CONTIN_LENGTH 0
698 /* This is the char to use for continuation (in case we need to turn
699 continuation back on). */
701 #define DBX_CONTIN_CHAR '?'
703 /* Don't use the `xsfoo;' construct in DBX output; this system
704 doesn't support it. */
706 #define DBX_NO_XREFS
708 /* This is how to output the definition of a user-level label named NAME,
709 such as the label on a static function or variable NAME. */
711 #define ASM_OUTPUT_LABEL(FILE,NAME) \
712 do { assemble_name (FILE, NAME); fputs (":\n", FILE); } while (0)
714 /* This is how to output a command to make the user-level label named NAME
715 defined for reference from other files. */
717 #define ASM_GLOBALIZE_LABEL(FILE,NAME) \
718 do { fputs ("\t.extdef\t", FILE); assemble_name (FILE, NAME); fputs ("\n", FILE);} while (0)
720 /* The prefix to add to user-visible assembler symbols. */
722 #define USER_LABEL_PREFIX ""
724 /* This is how to output an internal numbered label where
725 PREFIX is the class of label and NUM is the number within the class. */
727 #define ASM_OUTPUT_INTERNAL_LABEL(FILE,PREFIX,NUM) \
728 fprintf (FILE, ".%s%d:\n", PREFIX, NUM)
730 /* This is how to store into the string LABEL
731 the symbol_ref name of an internal numbered label where
732 PREFIX is the class of label and NUM is the number within the class.
733 This is suitable for output with `assemble_name'. */
735 #define ASM_GENERATE_INTERNAL_LABEL(LABEL,PREFIX,NUM) \
736 sprintf (LABEL, ".%s%d", PREFIX, NUM)
738 /* This is how to output an assembler line defining a `double' constant.
739 It is .dfloat or .gfloat, depending. */
741 #define ASM_OUTPUT_DOUBLE(FILE,VALUE) \
742 { union {double d; int i[2]; } tem; \
743 tem.d = (VALUE); \
744 fprintf (FILE, "\t.data\t%d{32}, %d{32}\n", tem.i[0], tem.i[1]); }
746 /* This is how to output an assembler line defining a `float' constant. */
748 #define ASM_OUTPUT_FLOAT(FILE,VALUE) \
749 { union {float f; int i; } tem; \
750 tem.f = (VALUE); \
751 fprintf (FILE, "\t.data %d{32}\n", tem.i); }
753 /* This is how to output an assembler line defining an `int' constant. */
755 #define ASM_OUTPUT_INT(FILE,VALUE) \
757 fprintf (FILE, "\t.data\t"), \
758 output_addr_const (FILE, (VALUE)), \
759 fprintf (FILE, "{32}\n"))
761 #define ASM_OUTPUT_DOUBLE_INT(FILE,VALUE) \
763 fprintf (FILE, "\t.data\t"); \
764 if (GET_CODE (VALUE) == CONST_DOUBLE) \
766 fprintf (FILE, "%d", CONST_DOUBLE_HIGH (VALUE)); \
767 fprintf (FILE, "{32}, "); \
768 fprintf (FILE, "%d", CONST_DOUBLE_LOW (VALUE)); \
769 fprintf (FILE, "{32}\n"); \
770 } else if (GET_CODE (VALUE) == CONST_INT) \
772 int val = INTVAL (VALUE); \
773 fprintf (FILE, "%d", val < 0 ? -1 : 0); \
774 fprintf (FILE, "{32}, "); \
775 fprintf (FILE, "%d", val); \
776 fprintf (FILE, "{32}\n"); \
777 } else abort (); \
780 /* Likewise for `char' and `short' constants. */
782 #define ASM_OUTPUT_SHORT(FILE,VALUE) \
783 ( fprintf (FILE, "\t.data\t"), \
784 output_addr_const (FILE, (VALUE)), \
785 fprintf (FILE, "{16}\n"))
787 #define ASM_OUTPUT_CHAR(FILE,VALUE) \
788 ( fprintf (FILE, "\t.data\t"), \
789 output_addr_const (FILE, (VALUE)), \
790 fprintf (FILE, "{8}\n"))
792 /* This is how to output an assembler line for a numeric constant byte. */
794 #define ASM_OUTPUT_BYTE(FILE,VALUE) \
795 fprintf (FILE, "\t.data\t%d{8}\n", (VALUE))
797 /* This is how to output an insn to push a register on the stack.
798 It need not be very fast code. */
800 #define ASM_OUTPUT_REG_PUSH(FILE,REGNO) \
801 fprintf (FILE, "\tsubi.64\t4,.sp\n\tst.32\t%s,[.sp]\n", reg_names[REGNO])
803 /* This is how to output an insn to pop a register from the stack.
804 It need not be very fast code. */
806 #define ASM_OUTPUT_REG_POP(FILE,REGNO) \
807 fprintf (FILE, "\tld.32\t%s,[.sp]\n\taddi.64\t4,.sp\n", reg_names[REGNO])
809 /* This is how to output an element of a case-vector that is absolute.
810 (The Vax does not use such vectors,
811 but we must define this macro anyway.) */
813 #define ASM_OUTPUT_ADDR_VEC_ELT(FILE, VALUE) \
814 fprintf (FILE, "\t.data .L%d{32}\n", VALUE)
816 /* This is how to output an element of a case-vector that is relative. */
818 #define ASM_OUTPUT_ADDR_DIFF_ELT(FILE, BODY, VALUE, REL) \
819 fprintf (FILE, "\t.data .L%d-.L%d{32}\n", VALUE, REL)
821 /* This is how to output an assembler line
822 that says to advance the location counter
823 to a multiple of 2**LOG bytes. */
825 #define ASM_OUTPUT_ALIGN(FILE,LOG) \
826 do { if (LOG!=0) fprintf (FILE, "\t.align\t%d\n", (LOG)); } while (0)
828 /* This is how to output an assembler line
829 that says to advance the location counter by SIZE bytes. */
831 #define ASM_OUTPUT_SKIP(FILE,SIZE) \
832 fprintf (FILE, "\t.space %d\n", (SIZE))
834 /* This says how to output an assembler line
835 to define a global common symbol. */
837 #define ASM_OUTPUT_COMMON(FILE, NAME, SIZE, ROUNDED) \
838 ( fputs (".comm ", (FILE)), \
839 assemble_name ((FILE), (NAME)), \
840 fprintf ((FILE), ",%d\n", (ROUNDED)))
842 /* This says how to output an assembler line
843 to define a local common symbol. */
845 #define ASM_OUTPUT_LOCAL(FILE, NAME, SIZE, ROUNDED) \
846 ( fputs (".bss ", (FILE)), \
847 assemble_name ((FILE), (NAME)), \
848 fprintf ((FILE), ",%d,%d\n", (SIZE),(ROUNDED)))
850 /* Store in OUTPUT a string (made with alloca) containing
851 an assembler-name for a local static variable named NAME.
852 LABELNO is an integer which is different for each call. */
854 #define ASM_FORMAT_PRIVATE_NAME(OUTPUT, NAME, LABELNO) \
855 ( (OUTPUT) = (char *) alloca (strlen ((NAME)) + 10), \
856 sprintf ((OUTPUT), "%s.%d", (NAME), (LABELNO)))
858 /* Define the parentheses used to group arithmetic operations
859 in assembler code. */
861 #define ASM_OPEN_PAREN "("
862 #define ASM_CLOSE_PAREN ")"
864 /* Print an instruction operand X on file FILE.
865 CODE is the code from the %-spec that requested printing this operand;
866 if `%z3' was used to print operand 3, then CODE is 'z'. */
868 #define PRINT_OPERAND(FILE, X, CODE) \
870 if (CODE == 'r' && GET_CODE (X) == MEM && GET_CODE (XEXP (X, 0)) == REG) \
871 fprintf (FILE, "%s", reg_names[REGNO (XEXP (X, 0))]); \
872 else if (GET_CODE (X) == REG) \
873 fprintf (FILE, "%s", reg_names[REGNO (X)]); \
874 else if (GET_CODE (X) == MEM) \
875 output_address (XEXP (X, 0)); \
876 else \
878 /*debug_rtx(X);*/ \
879 putc ('=', FILE); \
880 output_addr_const (FILE, X); } \
883 /* Print a memory operand whose address is X, on file FILE.
884 This uses a function in output-vax.c. */
886 #define PRINT_OPERAND_ADDRESS(FILE, ADDR) \
887 print_operand_address (FILE, ADDR)
889 /* These are stubs, and have yet to bee written. */
891 #define TRAMPOLINE_SIZE 26
892 #define TRAMPOLINE_TEMPLATE(FILE)
893 #define INITIALIZE_TRAMPOLINE(TRAMP,FNADDR,CXT)