* target.h (asm_out.byte_op, asm_out.aligned_op, asm_out.unaligned_op,
[official-gcc.git] / gcc / config / elxsi / elxsi.h
blob13e39d8b7f044f1e1df7fdcd60a359d590d61f09
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
83 #define INT_TYPE_SIZE 32
85 #define LONG_TYPE_SIZE 32
87 #define LONG_LONG_TYPE_SIZE 64
89 #define FLOAT_TYPE_SIZE 32
91 #define DOUBLE_TYPE_SIZE 64
93 #define LONG_DOUBLE_TYPE_SIZE 64
95 /* Width of a word, in units (bytes). */
96 #define UNITS_PER_WORD 8
98 /* Width in bits of a pointer.
99 See also the macro `Pmode' defined below. */
100 #define POINTER_SIZE 32
102 /* Allocation boundary (in *bits*) for storing pointers in memory. */
103 #define POINTER_BOUNDARY 32
105 /* Allocation boundary (in *bits*) for storing arguments in argument list. */
106 #define PARM_BOUNDARY 32
108 /* Boundary (in *bits*) on which stack pointer should be aligned. */
109 #define STACK_BOUNDARY 32
111 /* Allocation boundary (in *bits*) for the code of a function. */
112 #define FUNCTION_BOUNDARY 8
114 /* Alignment of field after `int : 0' in a structure. */
115 #define EMPTY_FIELD_BOUNDARY 8
117 /* Every structure's size must be a multiple of this. */
118 #define STRUCTURE_SIZE_BOUNDARY 32
120 /* A bitfield declared as `int' forces `int' alignment for the struct. */
121 #define PCC_BITFIELD_TYPE_MATTERS 1
123 /* No data type wants to be aligned rounder than this. */
124 #define BIGGEST_ALIGNMENT 32
126 /* Define this if move instructions will actually fail to work
127 when given unaligned data. */
128 #define STRICT_ALIGNMENT 0
130 /* Standard register usage. */
132 /* Number of actual hardware registers.
133 The hardware registers are assigned numbers for the compiler
134 from 0 to just below FIRST_PSEUDO_REGISTER.
135 All registers that the compiler knows about must be given numbers,
136 even those that are not normally considered general registers. */
137 #define FIRST_PSEUDO_REGISTER 16
139 /* 1 for registers that have pervasive standard uses
140 and are not available for the register allocator.
141 On the elxsi, these is the .r15 (aka .sp). */
142 #define FIXED_REGISTERS {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1}
144 /* 1 for registers not available across function calls.
145 These must include the FIXED_REGISTERS and also any
146 registers that can be used without being saved.
147 The latter must include the registers where values are returned
148 and the register where structure-value addresses are passed.
149 Aside from that, you can include as many other registers as you like. */
150 #define CALL_USED_REGISTERS {1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1}
152 /* Return number of consecutive hard regs needed starting at reg REGNO
153 to hold something of mode MODE.
154 This is ordinarily the length in words of a value of mode MODE
155 but can be less for certain modes in special long registers.
156 On the VAX, all registers are one word long. */
157 #define HARD_REGNO_NREGS(REGNO, MODE) \
158 ((GET_MODE_SIZE (MODE) + UNITS_PER_WORD - 1) / UNITS_PER_WORD)
160 /* Value is 1 if hard register REGNO can hold a value of machine-mode MODE. */
161 #define HARD_REGNO_MODE_OK(REGNO, MODE) 1
163 /* Value is 1 if it is a good idea to tie two pseudo registers
164 when one has mode MODE1 and one has mode MODE2.
165 If HARD_REGNO_MODE_OK could produce different values for MODE1 and MODE2,
166 for any hard reg, then this must be 0 for correct output. */
167 #define MODES_TIEABLE_P(MODE1, MODE2) 1
169 /* Specify the registers used for certain standard purposes.
170 The values of these macros are register numbers. */
172 /* Register to use for pushing function arguments. */
173 #define STACK_POINTER_REGNUM 15
175 /* Base register for access to local variables of the function. */
176 #define FRAME_POINTER_REGNUM 14
178 /* Value should be nonzero if functions must have frame pointers.
179 Zero means the frame pointer need not be set up (and parms
180 may be accessed via the stack pointer) in functions that seem suitable.
181 This is computed in `reload', in reload1.c. */
182 #define FRAME_POINTER_REQUIRED 0
184 #define INITIAL_FRAME_POINTER_OFFSET(DEPTH) \
185 { int regno; \
186 int offset = 0; \
187 for( regno=0; regno < FIRST_PSEUDO_REGISTER; regno++ ) \
188 if( regs_ever_live[regno] && !call_used_regs[regno] ) \
189 offset += 8; \
190 (DEPTH) = (offset + ((get_frame_size() + 3) & ~3) ); \
191 (DEPTH) = 0; \
194 /* Base register for access to arguments of the function. */
195 #define ARG_POINTER_REGNUM 14
197 /* Register in which static-chain is passed to a function. */
198 #define STATIC_CHAIN_REGNUM 0
200 /* Register in which address to store a structure value
201 is passed to a function. */
202 #define STRUCT_VALUE_REGNUM 1
204 /* Define the classes of registers for register constraints in the
205 machine description. Also define ranges of constants.
207 One of the classes must always be named ALL_REGS and include all hard regs.
208 If there is more than one class, another class must be named NO_REGS
209 and contain no registers.
211 The name GENERAL_REGS must be the name of a class (or an alias for
212 another name such as ALL_REGS). This is the class of registers
213 that is allowed by "g" or "r" in a register constraint.
214 Also, registers outside this class are allocated only when
215 instructions express preferences for them.
217 The classes must be numbered in nondecreasing order; that is,
218 a larger-numbered class must never be contained completely
219 in a smaller-numbered class.
221 For any two classes, it is very desirable that there be another
222 class that represents their union. */
224 /* The VAX has only one kind of registers, so NO_REGS and ALL_REGS
225 are the only classes. */
227 enum reg_class { NO_REGS, GENERAL_REGS, ALL_REGS, LIM_REG_CLASSES };
229 #define N_REG_CLASSES (int) LIM_REG_CLASSES
231 /* Give names of register classes as strings for dump file. */
233 #define REG_CLASS_NAMES \
234 {"NO_REGS", "GENERAL_REGS", "ALL_REGS" }
236 /* Define which registers fit in which classes.
237 This is an initializer for a vector of HARD_REG_SET
238 of length N_REG_CLASSES. */
240 #define REG_CLASS_CONTENTS {{0}, {0x07fff}, {0xffff}}
242 /* The same information, inverted:
243 Return the class number of the smallest class containing
244 reg number REGNO. This could be a conditional expression
245 or could index an array. */
247 #define REGNO_REG_CLASS(REGNO) (REGNO == 15 ? ALL_REGS : GENERAL_REGS)
249 /* The class value for index registers, and the one for base regs. */
251 #define INDEX_REG_CLASS GENERAL_REGS
252 #define BASE_REG_CLASS GENERAL_REGS
254 /* Get reg_class from a letter such as appears in the machine description. */
256 #define REG_CLASS_FROM_LETTER(C) NO_REGS
258 /* The letters I, J, K, L and M in a register constraint string
259 can be used to stand for particular ranges of immediate operands.
260 This macro defines what the ranges are.
261 C is the letter, and VALUE is a constant value.
262 Return 1 if VALUE is in the range specified by C. */
264 #define CONST_OK_FOR_LETTER_P(VALUE, C) \
265 ((C) == 'I' ? (VALUE) >=-16 && (VALUE) <=15 : 0)
267 /* Similar, but for floating constants, and defining letters G and H.
268 Here VALUE is the CONST_DOUBLE rtx itself. */
270 #define CONST_DOUBLE_OK_FOR_LETTER_P(VALUE, C) 1
272 /* Given an rtx X being reloaded into a reg required to be
273 in class CLASS, return the class of reg to actually use.
274 In general this is just CLASS; but on some machines
275 in some cases it is preferable to use a more restrictive class. */
277 #define PREFERRED_RELOAD_CLASS(X,CLASS) (CLASS)
279 /* Return the maximum number of consecutive registers
280 needed to represent mode MODE in a register of class CLASS. */
281 /* On the VAX, this is always the size of MODE in words,
282 since all registers are the same size. */
283 #define CLASS_MAX_NREGS(CLASS, MODE) \
284 ((GET_MODE_SIZE (MODE) + UNITS_PER_WORD - 1) / UNITS_PER_WORD)
286 /* Stack layout; function entry, exit and calling. */
288 /* Define this if pushing a word on the stack
289 makes the stack pointer a smaller address. */
290 #define STACK_GROWS_DOWNWARD
292 /* Define this if the nominal address of the stack frame
293 is at the high-address end of the local variables;
294 that is, each additional local variable allocated
295 goes at a more negative offset in the frame. */
296 #define FRAME_GROWS_DOWNWARD
298 /* Offset within stack frame to start allocating local variables at.
299 If FRAME_GROWS_DOWNWARD, this is the offset to the END of the
300 first local allocated. Otherwise, it is the offset to the BEGINNING
301 of the first local allocated. */
302 #define STARTING_FRAME_OFFSET -4
304 /* Offset of first parameter from the argument pointer register value. */
305 #define FIRST_PARM_OFFSET(FNDECL) 4
307 /* Value is 1 if returning from a function call automatically
308 pops the arguments described by the number-of-args field in the call.
309 FUNDECL is the declaration node of the function (as a tree),
310 FUNTYPE is the data type of the function (as a tree),
311 or for a library call it is an identifier node for the subroutine name.
313 On the VAX, the RET insn always pops all the args for any function. */
315 #define RETURN_POPS_ARGS(FUNDECL,FUNTYPE,SIZE) (SIZE)
317 /* Define how to find the value returned by a function.
318 VALTYPE is the data type of the value (as a tree).
319 If the precise function being called is known, FUNC is its FUNCTION_DECL;
320 otherwise, FUNC is 0. */
322 /* On the VAX the return value is in R0 regardless. */
324 #define FUNCTION_VALUE(VALTYPE, FUNC) \
325 gen_rtx_REG (TYPE_MODE (VALTYPE), 0)
327 /* Define how to find the value returned by a library function
328 assuming the value has mode MODE. */
330 /* On the VAX the return value is in R0 regardless. */
332 #define LIBCALL_VALUE(MODE) gen_rtx_REG (MODE, 0)
334 /* Define this if PCC uses the nonreentrant convention for returning
335 structure and union values. */
337 #define PCC_STATIC_STRUCT_RETURN
339 /* 1 if N is a possible register number for a function value.
340 On the VAX, R0 is the only register thus used. */
342 #define FUNCTION_VALUE_REGNO_P(N) ((N) == 0)
344 /* 1 if N is a possible register number for function argument passing.
345 On the VAX, no registers are used in this way. */
347 #define FUNCTION_ARG_REGNO_P(N) 0
349 /* Define a data type for recording info about an argument list
350 during the scan of that argument list. This data type should
351 hold all necessary information about the function itself
352 and about the args processed so far, enough to enable macros
353 such as FUNCTION_ARG to determine where the next arg should go.
355 On the VAX, this is a single integer, which is a number of bytes
356 of arguments scanned so far. */
358 #define CUMULATIVE_ARGS int
360 /* Initialize a variable CUM of type CUMULATIVE_ARGS
361 for a call to a function whose data type is FNTYPE.
362 For a library call, FNTYPE is 0.
364 On the VAX, the offset starts at 0. */
366 #define INIT_CUMULATIVE_ARGS(CUM,FNTYPE,x,INDIRECT) \
367 ((CUM) = 0)
369 /* Update the data in CUM to advance over an argument
370 of mode MODE and data type TYPE.
371 (TYPE is null for libcalls where that information may not be available.) */
373 #define FUNCTION_ARG_ADVANCE(CUM, MODE, TYPE, NAMED) \
374 ((CUM) += ((MODE) != BLKmode \
375 ? (GET_MODE_SIZE (MODE) + 3) & ~3 \
376 : (int_size_in_bytes (TYPE) + 3) & ~3))
378 /* Define where to put the arguments to a function.
379 Value is zero to push the argument on the stack,
380 or a hard register in which to store the argument.
382 MODE is the argument's machine mode.
383 TYPE is the data type of the argument (as a tree).
384 This is null for libcalls where that information may
385 not be available.
386 CUM is a variable of type CUMULATIVE_ARGS which gives info about
387 the preceding args and about the function being called.
388 NAMED is nonzero if this argument is a named parameter
389 (otherwise it is an extra parameter matching an ellipsis). */
391 /* On the VAX all args are pushed. */
393 #define FUNCTION_ARG(CUM, MODE, TYPE, NAMED) 0
395 /* Output assembler code to FILE to increment profiler label # LABELNO
396 for profiling a function entry. */
398 #define FUNCTION_PROFILER(FILE, LABELNO) \
399 fprintf (FILE, "\tld.64\t.r0,.LP%d\n\tcall\tmcount\n", (LABELNO));
401 /* EXIT_IGNORE_STACK should be nonzero if, when returning from a function,
402 the stack pointer does not matter. The value is tested only in
403 functions that have frame pointers.
404 No definition is equivalent to always zero. */
406 #define EXIT_IGNORE_STACK 0
408 /* If the memory address ADDR is relative to the frame pointer,
409 correct it to be relative to the stack pointer instead.
410 This is for when we don't use a frame pointer.
411 ADDR should be a variable name. */
413 #define FIX_FRAME_POINTER_ADDRESS(ADDR,DEPTH) \
414 { int offset = -1; \
415 rtx regs = stack_pointer_rtx; \
416 if (ADDR == frame_pointer_rtx) \
417 offset = 0; \
418 else if (GET_CODE (ADDR) == PLUS && XEXP (ADDR, 1) == frame_pointer_rtx \
419 && GET_CODE (XEXP (ADDR, 0)) == CONST_INT) \
420 offset = INTVAL (XEXP (ADDR, 0)); \
421 else if (GET_CODE (ADDR) == PLUS && XEXP (ADDR, 0) == frame_pointer_rtx \
422 && GET_CODE (XEXP (ADDR, 1)) == CONST_INT) \
423 offset = INTVAL (XEXP (ADDR, 1)); \
424 else if (GET_CODE (ADDR) == PLUS && XEXP (ADDR, 0) == frame_pointer_rtx) \
425 { rtx other_reg = XEXP (ADDR, 1); \
426 offset = 0; \
427 regs = gen_rtx_PLUS (Pmode, stack_pointer_rtx, other_reg); } \
428 else if (GET_CODE (ADDR) == PLUS && XEXP (ADDR, 1) == frame_pointer_rtx) \
429 { rtx other_reg = XEXP (ADDR, 0); \
430 offset = 0; \
431 regs = gen_rtx_PLUS (Pmode, stack_pointer_rtx, other_reg); } \
432 if (offset >= 0) \
433 { int regno; \
434 extern char call_used_regs[]; \
435 offset += 4; /* I don't know why??? */ \
436 for (regno = 0; regno < FIRST_PSEUDO_REGISTER; regno++) \
437 if (regs_ever_live[regno] && ! call_used_regs[regno]) \
438 offset += 8; \
439 ADDR = plus_constant (regs, offset + (DEPTH)); } }
442 /* Addressing modes, and classification of registers for them. */
444 /* #define HAVE_POST_INCREMENT 0 */
445 /* #define HAVE_POST_DECREMENT 0 */
447 /* #define HAVE_PRE_DECREMENT 0 */
448 /* #define HAVE_PRE_INCREMENT 0 */
450 /* Macros to check register numbers against specific register classes. */
452 /* These assume that REGNO is a hard or pseudo reg number.
453 They give nonzero only if REGNO is a hard reg of the suitable class
454 or a pseudo reg currently allocated to a suitable hard reg.
455 Since they use reg_renumber, they are safe only once reg_renumber
456 has been allocated, which happens in local-alloc.c. */
458 #define REGNO_OK_FOR_INDEX_P(regno) \
459 ((regno) < FIRST_PSEUDO_REGISTER || reg_renumber[regno] >= 0)
460 #define REGNO_OK_FOR_BASE_P(regno) \
461 ((regno) < FIRST_PSEUDO_REGISTER || reg_renumber[regno] >= 0)
463 /* Maximum number of registers that can appear in a valid memory address. */
465 #define MAX_REGS_PER_ADDRESS 2
467 /* 1 if X is an rtx for a constant that is a valid address. */
469 #define CONSTANT_ADDRESS_P(X) \
470 (GET_CODE (X) == LABEL_REF || GET_CODE (X) == SYMBOL_REF \
471 || GET_CODE (X) == CONST_INT || GET_CODE (X) == CONST \
472 || GET_CODE (X) == HIGH)
474 /* Nonzero if the constant value X is a legitimate general operand.
475 It is given that X satisfies CONSTANT_P or is a CONST_DOUBLE. */
477 #define LEGITIMATE_CONSTANT_P(X) \
478 (GET_CODE (X) != CONST_DOUBLE)
480 /* The macros REG_OK_FOR..._P assume that the arg is a REG rtx
481 and check its validity for a certain class.
482 We have two alternate definitions for each of them.
483 The usual definition accepts all pseudo regs; the other rejects
484 them unless they have been allocated suitable hard regs.
485 The symbol REG_OK_STRICT causes the latter definition to be used.
487 Most source files want to accept pseudo regs in the hope that
488 they will get allocated to the class that the insn wants them to be in.
489 Source files for reload pass need to be strict.
490 After reload, it makes no difference, since pseudo regs have
491 been eliminated by then. */
493 #ifndef REG_OK_STRICT
495 /* Nonzero if X is a hard reg that can be used as an index
496 or if it is a pseudo reg. */
497 #define REG_OK_FOR_INDEX_P(X) 1
498 /* Nonzero if X is a hard reg that can be used as a base reg
499 or if it is a pseudo reg. */
500 #define REG_OK_FOR_BASE_P(X) 1
502 #else
504 /* Nonzero if X is a hard reg that can be used as an index. */
505 #define REG_OK_FOR_INDEX_P(X) REGNO_OK_FOR_INDEX_P (REGNO (X))
506 /* Nonzero if X is a hard reg that can be used as a base reg. */
507 #define REG_OK_FOR_BASE_P(X) REGNO_OK_FOR_BASE_P (REGNO (X))
509 #endif
511 /* GO_IF_LEGITIMATE_ADDRESS recognizes an RTL expression
512 that is a valid memory address for an instruction.
513 The MODE argument is the machine mode for the MEM expression
514 that wants to use this address.
516 CONSTANT_ADDRESS_P is actually machine-independent. */
518 #define GO_IF_LEGITIMATE_ADDRESS(MODE, X, ADDR) \
520 if (GET_CODE (X) == REG) goto ADDR; \
521 if (CONSTANT_ADDRESS_P (X)) goto ADDR; \
522 if (GET_CODE (X) == PLUS) \
524 /* Handle [index]<address> represented with index-sum outermost */\
525 if (GET_CODE (XEXP (X, 0)) == REG \
526 && REG_OK_FOR_BASE_P (XEXP (X, 0)) \
527 && GET_CODE (XEXP (X, 1)) == CONST_INT) \
528 goto ADDR; \
529 if (GET_CODE (XEXP (X, 1)) == REG \
530 && REG_OK_FOR_BASE_P (XEXP (X, 0)) \
531 && GET_CODE (XEXP (X, 0)) == CONST_INT) \
532 goto ADDR; \
537 /* Try machine-dependent ways of modifying an illegitimate address
538 to be legitimate. If we find one, return the new, valid address.
539 This macro is used in only one place: `memory_address' in explow.c.
541 OLDX is the address as it was before break_out_memory_refs was called.
542 In some cases it is useful to look at this to decide what needs to be done.
544 MODE and WIN are passed so that this macro can use
545 GO_IF_LEGITIMATE_ADDRESS.
547 It is always safe for this macro to do nothing. It exists to recognize
548 opportunities to optimize the output.
550 For the VAX, nothing needs to be done. */
552 #define LEGITIMIZE_ADDRESS(X,OLDX,MODE,WIN) {}
554 /* Go to LABEL if ADDR (a legitimate address expression)
555 has an effect that depends on the machine mode it is used for. */
556 #define GO_IF_MODE_DEPENDENT_ADDRESS(ADDR,LABEL)
559 /* Specify the machine mode that this machine uses
560 for the index in the tablejump instruction. */
561 #define CASE_VECTOR_MODE SImode
563 /* Define as C expression which evaluates to nonzero if the tablejump
564 instruction expects the table to contain offsets from the address of the
565 table.
566 Do not define this if the table should contain absolute addresses. */
567 /* #define CASE_VECTOR_PC_RELATIVE 1 */
569 /* Specify the tree operation to be used to convert reals to integers. */
570 #define IMPLICIT_FIX_EXPR FIX_ROUND_EXPR
572 /* This is the kind of divide that is easiest to do in the general case. */
573 #define EASY_DIV_EXPR TRUNC_DIV_EXPR
575 /* Define this as 1 if `char' should by default be signed; else as 0. */
576 #define DEFAULT_SIGNED_CHAR 1
578 /* This flag, if defined, says the same insns that convert to a signed fixnum
579 also convert validly to an unsigned one. */
580 #define FIXUNS_TRUNC_LIKE_FIX_TRUNC
582 /* Max number of bytes we can move from memory to memory
583 in one reasonably fast instruction. */
584 #define MOVE_MAX 8
586 /* Define this if zero-extension is slow (more than one real instruction). */
587 /* #define SLOW_ZERO_EXTEND */
589 /* Nonzero if access to memory by bytes is slow and undesirable. */
590 #define SLOW_BYTE_ACCESS 0
592 /* Define if shifts truncate the shift count
593 which implies one can omit a sign-extension or zero-extension
594 of a shift count. */
595 /* #define SHIFT_COUNT_TRUNCATED */
597 /* Value is 1 if truncating an integer of INPREC bits to OUTPREC bits
598 is done just by pretending it is already truncated. */
599 #define TRULY_NOOP_TRUNCATION(OUTPREC, INPREC) 1
601 /* Specify the machine mode that pointers have.
602 After generation of rtl, the compiler makes no further distinction
603 between pointers and any other objects of this machine mode. */
604 #define Pmode SImode
606 /* A function address in a call instruction
607 is a byte address (for indexing purposes)
608 so give the MEM rtx a byte's mode. */
609 #define FUNCTION_MODE QImode
611 /* Compute the cost of computing a constant rtl expression RTX
612 whose rtx-code is CODE. The body of this macro is a portion
613 of a switch statement. If the code is computed here,
614 return it with a return statement. Otherwise, break from the switch. */
616 #define CONST_COSTS(RTX,CODE,OUTER_CODE) \
617 case CONST_INT: \
618 /* Constant zero is super cheap due to clr instruction. */ \
619 if (RTX == const0_rtx) return 0; \
620 if ((unsigned) INTVAL (RTX) < 077) return 1; \
621 case CONST: \
622 case LABEL_REF: \
623 case SYMBOL_REF: \
624 return 3; \
625 case CONST_DOUBLE: \
626 return 5;
629 * We can use the BSD C library routines for the gnulib calls that are
630 * still generated, since that's what they boil down to anyways.
633 /* #define UDIVSI3_LIBCALL "*udiv" */
634 /* #define UMODSI3_LIBCALL "*urem" */
636 /* Tell final.c how to eliminate redundant test instructions. */
638 /* Here we define machine-dependent flags and fields in cc_status
639 (see `conditions.h'). No extra ones are needed for the VAX. */
641 /* Store in cc_status the expressions
642 that the condition codes will describe
643 after execution of an instruction whose pattern is EXP.
644 Do not alter them if the instruction would not alter the cc's. */
646 #define NOTICE_UPDATE_CC(EXP, INSN) \
647 CC_STATUS_INIT;
650 /* Control the assembler format that we output. */
652 /* Output the name of the file we are compiling. */
653 #define ASM_OUTPUT_SOURCE_FILENAME(STREAM, NAME) \
654 do { fprintf (STREAM, "\t.file\t"); \
655 output_quoted_string (STREAM, NAME); \
656 fprintf (STREAM, "\n"); \
657 } while (0)
659 /* Output at beginning of assembler file. */
660 #define ASM_FILE_START(FILE) fputs ("", (FILE));
662 /* Output to assembler file text saying following lines
663 may contain character constants, extra white space, comments, etc. */
665 #define ASM_APP_ON ""
667 /* Output to assembler file text saying following lines
668 no longer contain unusual constructs. */
670 #define ASM_APP_OFF ""
672 /* Output before read-only data. */
674 #define TEXT_SECTION_ASM_OP "\t.inst"
676 /* Output before writable data. */
678 #define DATA_SECTION_ASM_OP "\t.var"
680 /* How to refer to registers in assembler output.
681 This sequence is indexed by compiler's hard-register-number (see above). */
683 #define REGISTER_NAMES \
684 {".r0", ".r1", ".r2", ".r3", ".r4", ".r5", ".r6", ".r7", ".r8", \
685 ".r9", ".r10", ".r11", ".r12", ".r13", ".r14", ".sp"}
687 /* This is BSD, so it wants DBX format. */
689 /* #define DBX_DEBUGGING_INFO */
691 /* Do not break .stabs pseudos into continuations. */
693 #define DBX_CONTIN_LENGTH 0
695 /* This is the char to use for continuation (in case we need to turn
696 continuation back on). */
698 #define DBX_CONTIN_CHAR '?'
700 /* Don't use the `xsfoo;' construct in DBX output; this system
701 doesn't support it. */
703 #define DBX_NO_XREFS
705 /* This is how to output the definition of a user-level label named NAME,
706 such as the label on a static function or variable NAME. */
708 #define ASM_OUTPUT_LABEL(FILE,NAME) \
709 do { assemble_name (FILE, NAME); fputs (":\n", FILE); } while (0)
711 /* This is how to output a command to make the user-level label named NAME
712 defined for reference from other files. */
714 #define ASM_GLOBALIZE_LABEL(FILE,NAME) \
715 do { fputs ("\t.extdef\t", FILE); assemble_name (FILE, NAME); fputs ("\n", FILE);} while (0)
717 /* The prefix to add to user-visible assembler symbols. */
719 #define USER_LABEL_PREFIX ""
721 /* This is how to output an internal numbered label where
722 PREFIX is the class of label and NUM is the number within the class. */
724 #define ASM_OUTPUT_INTERNAL_LABEL(FILE,PREFIX,NUM) \
725 fprintf (FILE, ".%s%d:\n", PREFIX, NUM)
727 /* This is how to store into the string LABEL
728 the symbol_ref name of an internal numbered label where
729 PREFIX is the class of label and NUM is the number within the class.
730 This is suitable for output with `assemble_name'. */
732 #define ASM_GENERATE_INTERNAL_LABEL(LABEL,PREFIX,NUM) \
733 sprintf (LABEL, ".%s%d", PREFIX, NUM)
735 /* This is how to output an assembler line defining a `double' constant.
736 It is .dfloat or .gfloat, depending. */
738 #define ASM_OUTPUT_DOUBLE(FILE,VALUE) \
739 { union {double d; int i[2]; } tem; \
740 tem.d = (VALUE); \
741 fprintf (FILE, "\t.data\t%d{32}, %d{32}\n", tem.i[0], tem.i[1]); }
743 /* This is how to output an assembler line defining a `float' constant. */
745 #define ASM_OUTPUT_FLOAT(FILE,VALUE) \
746 { union {float f; int i; } tem; \
747 tem.f = (VALUE); \
748 fprintf (FILE, "\t.data %d{32}\n", tem.i); }
750 /* This is how to output an insn to push a register on the stack.
751 It need not be very fast code. */
753 #define ASM_OUTPUT_REG_PUSH(FILE,REGNO) \
754 fprintf (FILE, "\tsubi.64\t4,.sp\n\tst.32\t%s,[.sp]\n", reg_names[REGNO])
756 /* This is how to output an insn to pop a register from the stack.
757 It need not be very fast code. */
759 #define ASM_OUTPUT_REG_POP(FILE,REGNO) \
760 fprintf (FILE, "\tld.32\t%s,[.sp]\n\taddi.64\t4,.sp\n", reg_names[REGNO])
762 /* This is how to output an element of a case-vector that is absolute.
763 (The VAX does not use such vectors,
764 but we must define this macro anyway.) */
766 #define ASM_OUTPUT_ADDR_VEC_ELT(FILE, VALUE) \
767 fprintf (FILE, "\t.data .L%d{32}\n", VALUE)
769 /* This is how to output an element of a case-vector that is relative. */
771 #define ASM_OUTPUT_ADDR_DIFF_ELT(FILE, BODY, VALUE, REL) \
772 fprintf (FILE, "\t.data .L%d-.L%d{32}\n", VALUE, REL)
774 /* This is how to output an assembler line
775 that says to advance the location counter
776 to a multiple of 2**LOG bytes. */
778 #define ASM_OUTPUT_ALIGN(FILE,LOG) \
779 do { if (LOG!=0) fprintf (FILE, "\t.align\t%d\n", (LOG)); } while (0)
781 /* This is how to output an assembler line
782 that says to advance the location counter by SIZE bytes. */
784 #define ASM_OUTPUT_SKIP(FILE,SIZE) \
785 fprintf (FILE, "\t.space %d\n", (SIZE))
787 /* This says how to output an assembler line
788 to define a global common symbol. */
790 #define ASM_OUTPUT_COMMON(FILE, NAME, SIZE, ROUNDED) \
791 ( fputs (".comm ", (FILE)), \
792 assemble_name ((FILE), (NAME)), \
793 fprintf ((FILE), ",%d\n", (ROUNDED)))
795 /* This says how to output an assembler line
796 to define a local common symbol. */
798 #define ASM_OUTPUT_LOCAL(FILE, NAME, SIZE, ROUNDED) \
799 ( fputs (".bss ", (FILE)), \
800 assemble_name ((FILE), (NAME)), \
801 fprintf ((FILE), ",%d,%d\n", (SIZE),(ROUNDED)))
803 /* Store in OUTPUT a string (made with alloca) containing
804 an assembler-name for a local static variable named NAME.
805 LABELNO is an integer which is different for each call. */
807 #define ASM_FORMAT_PRIVATE_NAME(OUTPUT, NAME, LABELNO) \
808 ( (OUTPUT) = (char *) alloca (strlen ((NAME)) + 10), \
809 sprintf ((OUTPUT), "%s.%d", (NAME), (LABELNO)))
811 /* Print an instruction operand X on file FILE.
812 CODE is the code from the %-spec that requested printing this operand;
813 if `%z3' was used to print operand 3, then CODE is 'z'. */
815 #define PRINT_OPERAND(FILE, X, CODE) \
817 if (CODE == 'r' && GET_CODE (X) == MEM && GET_CODE (XEXP (X, 0)) == REG) \
818 fprintf (FILE, "%s", reg_names[REGNO (XEXP (X, 0))]); \
819 else if (GET_CODE (X) == REG) \
820 fprintf (FILE, "%s", reg_names[REGNO (X)]); \
821 else if (GET_CODE (X) == MEM) \
822 output_address (XEXP (X, 0)); \
823 else \
825 /*debug_rtx(X);*/ \
826 putc ('=', FILE); \
827 output_addr_const (FILE, X); } \
830 /* Print a memory operand whose address is X, on file FILE.
831 This uses a function in output-vax.c. */
833 #define PRINT_OPERAND_ADDRESS(FILE, ADDR) \
834 print_operand_address (FILE, ADDR)
836 /* These are stubs, and have yet to bee written. */
838 #define TRAMPOLINE_SIZE 26
839 #define TRAMPOLINE_TEMPLATE(FILE)
840 #define INITIALIZE_TRAMPOLINE(TRAMP,FNADDR,CXT)