update copyrights in config dir.
[official-gcc.git] / gcc / config / elxsi / elxsi.h
blob8b3e0061dc7e568a66d621747d183164ef8a8bb3
1 /* Definitions of target machine for GNU compiler. Elxsi version.
2 Copyright (C) 1987, 88, 92, 95, 96, 98, 99, 2000 Free Software Foundation, Inc.
3 Contributed by Mike Stump <mrs@cygnus.com> in 1988. This is the first
4 64 bit port of GNU CC.
5 Based upon the VAX port.
7 This file is part of GNU CC.
9 GNU CC is free software; you can redistribute it and/or modify
10 it under the terms of the GNU General Public License as published by
11 the Free Software Foundation; either version 1, or (at your option)
12 any later version.
14 GNU CC is distributed in the hope that it will be useful,
15 but WITHOUT ANY WARRANTY; without even the implied warranty of
16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 GNU General Public License for more details.
19 You should have received a copy of the GNU General Public License
20 along with GNU CC; see the file COPYING. If not, write to
21 the Free Software Foundation, 59 Temple Place - Suite 330,
22 Boston, MA 02111-1307, USA. */
25 /* Names to predefine in the preprocessor for this target machine. */
27 #define CPP_PREDEFINES "-Delxsi -Dunix -Asystem(unix) -Acpu(elxsi) -Amachine(elxsi)"
29 /* Print subsidiary information on the compiler version in use. */
31 #define TARGET_VERSION fprintf (stderr, " (elxsi)");
33 /* Run-time compilation parameters selecting different hardware subsets. */
35 extern int target_flags;
37 /* Macros used in the machine description to test the flags. */
39 /* Nonzero if compiling code that Unix assembler can assemble. */
40 #define TARGET_UNIX_ASM (target_flags & 1)
43 /* Macro to define tables used to set the flags.
44 This is a list in braces of pairs in braces,
45 each pair being { "NAME", VALUE }
46 where VALUE is the bits to set or minus the bits to clear.
47 An empty string NAME is used to identify the default VALUE. */
49 #define TARGET_SWITCHES \
50 { {"unix", 1, "Generate code the unix assembler can handle"}, \
51 {"embos", -1, "Generate code an embedded assembler can handle"}, \
52 { "", TARGET_DEFAULT, NULL}}
54 /* Default target_flags if no switches specified. */
56 #ifndef TARGET_DEFAULT
57 #define TARGET_DEFAULT 1
58 #endif
60 /* Target machine storage layout */
62 /* Define this if most significant bit is lowest numbered
63 in instructions that operate on numbered bit-fields.
64 This is not true on the vax. */
65 #define BITS_BIG_ENDIAN 0
67 /* Define this if most significant byte of a word is the lowest numbered. */
68 #define BYTES_BIG_ENDIAN 1
70 /* Define this if most significant word of a multiword number is numbered. */
71 #define WORDS_BIG_ENDIAN 1
73 /* Number of bits in an addressable storage unit */
74 #define BITS_PER_UNIT 8
76 /* Width in bits of a "word", which is the contents of a machine register.
77 Note that this is not necessarily the width of data type `int';
78 if using 16-bit ints on a 68000, this would still be 32.
79 But on a machine with 16-bit registers, this would be 16. */
80 #define BITS_PER_WORD 64
81 #define Rmode DImode
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 /* Allocation boundary (in *bits*) for the code of a function. */
109 #define FUNCTION_BOUNDARY 8
111 /* Alignment of field after `int : 0' in a structure. */
112 #define EMPTY_FIELD_BOUNDARY 8
114 /* Every structure's size must be a multiple of this. */
115 #define STRUCTURE_SIZE_BOUNDARY 32
117 /* A bitfield declared as `int' forces `int' alignment for the struct. */
118 #define PCC_BITFIELD_TYPE_MATTERS 1
120 /* No data type wants to be aligned rounder than this. */
121 #define BIGGEST_ALIGNMENT 32
123 /* Define this if move instructions will actually fail to work
124 when given unaligned data. */
125 #define STRICT_ALIGNMENT 0
127 /* Standard register usage. */
129 /* Number of actual hardware registers.
130 The hardware registers are assigned numbers for the compiler
131 from 0 to just below FIRST_PSEUDO_REGISTER.
132 All registers that the compiler knows about must be given numbers,
133 even those that are not normally considered general registers. */
134 #define FIRST_PSEUDO_REGISTER 16
136 /* 1 for registers that have pervasive standard uses
137 and are not available for the register allocator.
138 On the elxsi, these is the .r15 (aka .sp). */
139 #define FIXED_REGISTERS {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1}
141 /* 1 for registers not available across function calls.
142 These must include the FIXED_REGISTERS and also any
143 registers that can be used without being saved.
144 The latter must include the registers where values are returned
145 and the register where structure-value addresses are passed.
146 Aside from that, you can include as many other registers as you like. */
147 #define CALL_USED_REGISTERS {1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1}
149 /* Return number of consecutive hard regs needed starting at reg REGNO
150 to hold something of mode MODE.
151 This is ordinarily the length in words of a value of mode MODE
152 but can be less for certain modes in special long registers.
153 On the vax, all registers are one word long. */
154 #define HARD_REGNO_NREGS(REGNO, MODE) \
155 ((GET_MODE_SIZE (MODE) + UNITS_PER_WORD - 1) / UNITS_PER_WORD)
157 /* Value is 1 if hard register REGNO can hold a value of machine-mode MODE. */
158 #define HARD_REGNO_MODE_OK(REGNO, MODE) 1
160 /* Value is 1 if it is a good idea to tie two pseudo registers
161 when one has mode MODE1 and one has mode MODE2.
162 If HARD_REGNO_MODE_OK could produce different values for MODE1 and MODE2,
163 for any hard reg, then this must be 0 for correct output. */
164 #define MODES_TIEABLE_P(MODE1, MODE2) 1
166 /* Specify the registers used for certain standard purposes.
167 The values of these macros are register numbers. */
169 /* Register to use for pushing function arguments. */
170 #define STACK_POINTER_REGNUM 15
172 /* Base register for access to local variables of the function. */
173 #define FRAME_POINTER_REGNUM 14
175 /* Value should be nonzero if functions must have frame pointers.
176 Zero means the frame pointer need not be set up (and parms
177 may be accessed via the stack pointer) in functions that seem suitable.
178 This is computed in `reload', in reload1.c. */
179 #define FRAME_POINTER_REQUIRED 0
181 #define INITIAL_FRAME_POINTER_OFFSET(DEPTH) \
182 { int regno; \
183 int offset = 0; \
184 for( regno=0; regno < FIRST_PSEUDO_REGISTER; regno++ ) \
185 if( regs_ever_live[regno] && !call_used_regs[regno] ) \
186 offset += 8; \
187 (DEPTH) = (offset + ((get_frame_size() + 3) & ~3) ); \
188 (DEPTH) = 0; \
191 /* Base register for access to arguments of the function. */
192 #define ARG_POINTER_REGNUM 14
194 /* Register in which static-chain is passed to a function. */
195 #define STATIC_CHAIN_REGNUM 0
197 /* Register in which address to store a structure value
198 is passed to a function. */
199 #define STRUCT_VALUE_REGNUM 1
201 /* Define the classes of registers for register constraints in the
202 machine description. Also define ranges of constants.
204 One of the classes must always be named ALL_REGS and include all hard regs.
205 If there is more than one class, another class must be named NO_REGS
206 and contain no registers.
208 The name GENERAL_REGS must be the name of a class (or an alias for
209 another name such as ALL_REGS). This is the class of registers
210 that is allowed by "g" or "r" in a register constraint.
211 Also, registers outside this class are allocated only when
212 instructions express preferences for them.
214 The classes must be numbered in nondecreasing order; that is,
215 a larger-numbered class must never be contained completely
216 in a smaller-numbered class.
218 For any two classes, it is very desirable that there be another
219 class that represents their union. */
221 /* The vax has only one kind of registers, so NO_REGS and ALL_REGS
222 are the only classes. */
224 enum reg_class { NO_REGS, GENERAL_REGS, ALL_REGS, LIM_REG_CLASSES };
226 #define N_REG_CLASSES (int) LIM_REG_CLASSES
228 /* Give names of register classes as strings for dump file. */
230 #define REG_CLASS_NAMES \
231 {"NO_REGS", "GENERAL_REGS", "ALL_REGS" }
233 /* Define which registers fit in which classes.
234 This is an initializer for a vector of HARD_REG_SET
235 of length N_REG_CLASSES. */
237 #define REG_CLASS_CONTENTS {{0}, {0x07fff}, {0xffff}}
239 /* The same information, inverted:
240 Return the class number of the smallest class containing
241 reg number REGNO. This could be a conditional expression
242 or could index an array. */
244 #define REGNO_REG_CLASS(REGNO) (REGNO == 15 ? ALL_REGS : GENERAL_REGS)
246 /* The class value for index registers, and the one for base regs. */
248 #define INDEX_REG_CLASS GENERAL_REGS
249 #define BASE_REG_CLASS GENERAL_REGS
251 /* Get reg_class from a letter such as appears in the machine description. */
253 #define REG_CLASS_FROM_LETTER(C) NO_REGS
255 /* The letters I, J, K, L and M in a register constraint string
256 can be used to stand for particular ranges of immediate operands.
257 This macro defines what the ranges are.
258 C is the letter, and VALUE is a constant value.
259 Return 1 if VALUE is in the range specified by C. */
261 #define CONST_OK_FOR_LETTER_P(VALUE, C) \
262 ((C) == 'I' ? (VALUE) >=-16 && (VALUE) <=15 : 0)
264 /* Similar, but for floating constants, and defining letters G and H.
265 Here VALUE is the CONST_DOUBLE rtx itself. */
267 #define CONST_DOUBLE_OK_FOR_LETTER_P(VALUE, C) 1
269 /* Given an rtx X being reloaded into a reg required to be
270 in class CLASS, return the class of reg to actually use.
271 In general this is just CLASS; but on some machines
272 in some cases it is preferable to use a more restrictive class. */
274 #define PREFERRED_RELOAD_CLASS(X,CLASS) (CLASS)
276 /* Return the maximum number of consecutive registers
277 needed to represent mode MODE in a register of class CLASS. */
278 /* On the vax, this is always the size of MODE in words,
279 since all registers are the same size. */
280 #define CLASS_MAX_NREGS(CLASS, MODE) \
281 ((GET_MODE_SIZE (MODE) + UNITS_PER_WORD - 1) / UNITS_PER_WORD)
283 /* Stack layout; function entry, exit and calling. */
285 /* Define this if pushing a word on the stack
286 makes the stack pointer a smaller address. */
287 #define STACK_GROWS_DOWNWARD
289 /* Define this if the nominal address of the stack frame
290 is at the high-address end of the local variables;
291 that is, each additional local variable allocated
292 goes at a more negative offset in the frame. */
293 #define FRAME_GROWS_DOWNWARD
295 /* Offset within stack frame to start allocating local variables at.
296 If FRAME_GROWS_DOWNWARD, this is the offset to the END of the
297 first local allocated. Otherwise, it is the offset to the BEGINNING
298 of the first local allocated. */
299 #define STARTING_FRAME_OFFSET -4
301 /* Offset of first parameter from the argument pointer register value. */
302 #define FIRST_PARM_OFFSET(FNDECL) 4
304 /* Value is 1 if returning from a function call automatically
305 pops the arguments described by the number-of-args field in the call.
306 FUNDECL is the declaration node of the function (as a tree),
307 FUNTYPE is the data type of the function (as a tree),
308 or for a library call it is an identifier node for the subroutine name.
310 On the Vax, the RET insn always pops all the args for any function. */
312 #define RETURN_POPS_ARGS(FUNDECL,FUNTYPE,SIZE) (SIZE)
314 /* Define how to find the value returned by a function.
315 VALTYPE is the data type of the value (as a tree).
316 If the precise function being called is known, FUNC is its FUNCTION_DECL;
317 otherwise, FUNC is 0. */
319 /* On the Vax the return value is in R0 regardless. */
321 #define FUNCTION_VALUE(VALTYPE, FUNC) \
322 gen_rtx_REG (TYPE_MODE (VALTYPE), 0)
324 /* Define how to find the value returned by a library function
325 assuming the value has mode MODE. */
327 /* On the Vax the return value is in R0 regardless. */
329 #define LIBCALL_VALUE(MODE) gen_rtx_REG (MODE, 0)
331 /* Define this if PCC uses the nonreentrant convention for returning
332 structure and union values. */
334 #define PCC_STATIC_STRUCT_RETURN
336 /* 1 if N is a possible register number for a function value.
337 On the Vax, R0 is the only register thus used. */
339 #define FUNCTION_VALUE_REGNO_P(N) ((N) == 0)
341 /* 1 if N is a possible register number for function argument passing.
342 On the Vax, no registers are used in this way. */
344 #define FUNCTION_ARG_REGNO_P(N) 0
346 /* Define a data type for recording info about an argument list
347 during the scan of that argument list. This data type should
348 hold all necessary information about the function itself
349 and about the args processed so far, enough to enable macros
350 such as FUNCTION_ARG to determine where the next arg should go.
352 On the vax, this is a single integer, which is a number of bytes
353 of arguments scanned so far. */
355 #define CUMULATIVE_ARGS int
357 /* Initialize a variable CUM of type CUMULATIVE_ARGS
358 for a call to a function whose data type is FNTYPE.
359 For a library call, FNTYPE is 0.
361 On the vax, the offset starts at 0. */
363 #define INIT_CUMULATIVE_ARGS(CUM,FNTYPE,x,INDIRECT) \
364 ((CUM) = 0)
366 /* Update the data in CUM to advance over an argument
367 of mode MODE and data type TYPE.
368 (TYPE is null for libcalls where that information may not be available.) */
370 #define FUNCTION_ARG_ADVANCE(CUM, MODE, TYPE, NAMED) \
371 ((CUM) += ((MODE) != BLKmode \
372 ? (GET_MODE_SIZE (MODE) + 3) & ~3 \
373 : (int_size_in_bytes (TYPE) + 3) & ~3))
375 /* Define where to put the arguments to a function.
376 Value is zero to push the argument on the stack,
377 or a hard register in which to store the argument.
379 MODE is the argument's machine mode.
380 TYPE is the data type of the argument (as a tree).
381 This is null for libcalls where that information may
382 not be available.
383 CUM is a variable of type CUMULATIVE_ARGS which gives info about
384 the preceding args and about the function being called.
385 NAMED is nonzero if this argument is a named parameter
386 (otherwise it is an extra parameter matching an ellipsis). */
388 /* On the vax all args are pushed. */
390 #define FUNCTION_ARG(CUM, MODE, TYPE, NAMED) 0
392 /* This macro generates the assembly code for function entry.
393 FILE is a stdio stream to output the code to.
394 SIZE is an int: how many units of temporary storage to allocate.
395 Refer to the array `regs_ever_live' to determine which registers
396 to save; `regs_ever_live[I]' is nonzero if register number I
397 is ever used in the function. This macro is responsible for
398 knowing which registers should not be saved even if used. */
400 #define FUNCTION_PROLOGUE(FILE, SIZE) \
401 { register int regno; \
402 register int cnt = 0; \
403 extern char call_used_regs[]; \
404 /* the below two lines are a HACK, and should be deleted, but \
405 for now are very much needed (1.35) */ \
406 if (frame_pointer_needed) \
407 regs_ever_live[14]=1, call_used_regs[14]=0; \
408 for (regno = 0; regno < FIRST_PSEUDO_REGISTER; regno++) \
409 if (regs_ever_live[regno] && !call_used_regs[regno]) \
410 cnt+=8; \
411 if ((SIZE)+cnt) \
412 fprintf (FILE, "\tadd.64\t.sp,=%d\n", -(SIZE)-cnt); \
413 cnt = 0; \
414 for (regno = 0; regno < FIRST_PSEUDO_REGISTER; regno++) \
415 if (regs_ever_live[regno] && !call_used_regs[regno]) \
416 fprintf (FILE, "\tst.64\t.r%d,[.sp]%d\n", regno, (cnt+=8)-12); \
417 if (frame_pointer_needed) \
418 fprintf (FILE, "\tadd.64\t.r14,.sp,=%d\n", (SIZE)+cnt); \
421 /* Output assembler code to FILE to increment profiler label # LABELNO
422 for profiling a function entry. */
424 #define FUNCTION_PROFILER(FILE, LABELNO) \
425 fprintf (FILE, "\tld.64\t.r0,.LP%d\n\tcall\tmcount\n", (LABELNO));
427 /* EXIT_IGNORE_STACK should be nonzero if, when returning from a function,
428 the stack pointer does not matter. The value is tested only in
429 functions that have frame pointers.
430 No definition is equivalent to always zero. */
432 #define EXIT_IGNORE_STACK 0
434 /* This macro generates the assembly code for function exit,
435 on machines that need it. If FUNCTION_EPILOGUE is not defined
436 then individual return instructions are generated for each
437 return statement. Args are same as for FUNCTION_PROLOGUE. */
439 #define FUNCTION_EPILOGUE(FILE, SIZE) \
440 { register int regno; \
441 register int cnt = 0; \
442 extern char call_used_regs[]; \
443 /* this conditional is ONLY here because there is a BUG; \
444 EXIT_IGNORE_STACK is ignored itself when the first part of \
445 the condition is true! (at least in version 1.35) */ \
446 /* the 8*10 is for 64 bits of .r5 - .r14 */ \
447 if (current_function_calls_alloca || (SIZE)>=(256-8*10)) { \
448 /* use .r4 as a temporary! Ok for now.... */ \
449 fprintf (FILE, "\tld.64\t.r4,.r14\n"); \
450 for (regno = FIRST_PSEUDO_REGISTER-1; regno >= 0; --regno) \
451 if (regs_ever_live[regno] && !call_used_regs[regno]) \
452 cnt+=8; \
453 for (regno = 0; regno < FIRST_PSEUDO_REGISTER; ++regno) \
454 if (regs_ever_live[regno] && !call_used_regs[regno]) \
455 fprintf (FILE, "\tld.64\t.r%d,[.r14]%d\n", regno, \
456 -((cnt-=8) + 8)-4-(SIZE)); \
457 fprintf (FILE, "\tld.64\t.sp,.r4\n\texit\t0\n"); \
458 } else { \
459 for (regno = 0; regno < FIRST_PSEUDO_REGISTER; ++regno) \
460 if (regs_ever_live[regno] && !call_used_regs[regno]) \
461 fprintf (FILE, "\tld.64\t.r%d,[.sp]%d\n", regno, (cnt+=8)-12); \
462 fprintf (FILE, "\texit\t%d\n", (SIZE)+cnt); \
465 /* If the memory address ADDR is relative to the frame pointer,
466 correct it to be relative to the stack pointer instead.
467 This is for when we don't use a frame pointer.
468 ADDR should be a variable name. */
470 #define FIX_FRAME_POINTER_ADDRESS(ADDR,DEPTH) \
471 { int offset = -1; \
472 rtx regs = stack_pointer_rtx; \
473 if (ADDR == frame_pointer_rtx) \
474 offset = 0; \
475 else if (GET_CODE (ADDR) == PLUS && XEXP (ADDR, 1) == frame_pointer_rtx \
476 && GET_CODE (XEXP (ADDR, 0)) == CONST_INT) \
477 offset = INTVAL (XEXP (ADDR, 0)); \
478 else if (GET_CODE (ADDR) == PLUS && XEXP (ADDR, 0) == frame_pointer_rtx \
479 && GET_CODE (XEXP (ADDR, 1)) == CONST_INT) \
480 offset = INTVAL (XEXP (ADDR, 1)); \
481 else if (GET_CODE (ADDR) == PLUS && XEXP (ADDR, 0) == frame_pointer_rtx) \
482 { rtx other_reg = XEXP (ADDR, 1); \
483 offset = 0; \
484 regs = gen_rtx_PLUS (Pmode, stack_pointer_rtx, other_reg); } \
485 else if (GET_CODE (ADDR) == PLUS && XEXP (ADDR, 1) == frame_pointer_rtx) \
486 { rtx other_reg = XEXP (ADDR, 0); \
487 offset = 0; \
488 regs = gen_rtx_PLUS (Pmode, stack_pointer_rtx, other_reg); } \
489 if (offset >= 0) \
490 { int regno; \
491 extern char call_used_regs[]; \
492 offset += 4; /* I don't know why??? */ \
493 for (regno = 0; regno < FIRST_PSEUDO_REGISTER; regno++) \
494 if (regs_ever_live[regno] && ! call_used_regs[regno]) \
495 offset += 8; \
496 ADDR = plus_constant (regs, offset + (DEPTH)); } }
499 /* Addressing modes, and classification of registers for them. */
501 /* #define HAVE_POST_INCREMENT 0 */
502 /* #define HAVE_POST_DECREMENT 0 */
504 /* #define HAVE_PRE_DECREMENT 0 */
505 /* #define HAVE_PRE_INCREMENT 0 */
507 /* Macros to check register numbers against specific register classes. */
509 /* These assume that REGNO is a hard or pseudo reg number.
510 They give nonzero only if REGNO is a hard reg of the suitable class
511 or a pseudo reg currently allocated to a suitable hard reg.
512 Since they use reg_renumber, they are safe only once reg_renumber
513 has been allocated, which happens in local-alloc.c. */
515 #define REGNO_OK_FOR_INDEX_P(regno) \
516 ((regno) < FIRST_PSEUDO_REGISTER || reg_renumber[regno] >= 0)
517 #define REGNO_OK_FOR_BASE_P(regno) \
518 ((regno) < FIRST_PSEUDO_REGISTER || reg_renumber[regno] >= 0)
520 /* Maximum number of registers that can appear in a valid memory address. */
522 #define MAX_REGS_PER_ADDRESS 2
524 /* 1 if X is an rtx for a constant that is a valid address. */
526 #define CONSTANT_ADDRESS_P(X) \
527 (GET_CODE (X) == LABEL_REF || GET_CODE (X) == SYMBOL_REF \
528 || GET_CODE (X) == CONST_INT || GET_CODE (X) == CONST \
529 || GET_CODE (X) == HIGH)
531 /* Nonzero if the constant value X is a legitimate general operand.
532 It is given that X satisfies CONSTANT_P or is a CONST_DOUBLE. */
534 #define LEGITIMATE_CONSTANT_P(X) \
535 (GET_CODE (X) != CONST_DOUBLE)
537 /* The macros REG_OK_FOR..._P assume that the arg is a REG rtx
538 and check its validity for a certain class.
539 We have two alternate definitions for each of them.
540 The usual definition accepts all pseudo regs; the other rejects
541 them unless they have been allocated suitable hard regs.
542 The symbol REG_OK_STRICT causes the latter definition to be used.
544 Most source files want to accept pseudo regs in the hope that
545 they will get allocated to the class that the insn wants them to be in.
546 Source files for reload pass need to be strict.
547 After reload, it makes no difference, since pseudo regs have
548 been eliminated by then. */
550 #ifndef REG_OK_STRICT
552 /* Nonzero if X is a hard reg that can be used as an index
553 or if it is a pseudo reg. */
554 #define REG_OK_FOR_INDEX_P(X) 1
555 /* Nonzero if X is a hard reg that can be used as a base reg
556 or if it is a pseudo reg. */
557 #define REG_OK_FOR_BASE_P(X) 1
559 #else
561 /* Nonzero if X is a hard reg that can be used as an index. */
562 #define REG_OK_FOR_INDEX_P(X) REGNO_OK_FOR_INDEX_P (REGNO (X))
563 /* Nonzero if X is a hard reg that can be used as a base reg. */
564 #define REG_OK_FOR_BASE_P(X) REGNO_OK_FOR_BASE_P (REGNO (X))
566 #endif
568 /* GO_IF_LEGITIMATE_ADDRESS recognizes an RTL expression
569 that is a valid memory address for an instruction.
570 The MODE argument is the machine mode for the MEM expression
571 that wants to use this address.
573 CONSTANT_ADDRESS_P is actually machine-independent. */
575 #define GO_IF_LEGITIMATE_ADDRESS(MODE, X, ADDR) \
577 if (GET_CODE (X) == REG) goto ADDR; \
578 if (CONSTANT_ADDRESS_P (X)) goto ADDR; \
579 if (GET_CODE (X) == PLUS) \
581 /* Handle [index]<address> represented with index-sum outermost */\
582 if (GET_CODE (XEXP (X, 0)) == REG \
583 && REG_OK_FOR_BASE_P (XEXP (X, 0)) \
584 && GET_CODE (XEXP (X, 1)) == CONST_INT) \
585 goto ADDR; \
586 if (GET_CODE (XEXP (X, 1)) == REG \
587 && REG_OK_FOR_BASE_P (XEXP (X, 0)) \
588 && GET_CODE (XEXP (X, 0)) == CONST_INT) \
589 goto ADDR; \
594 /* Try machine-dependent ways of modifying an illegitimate address
595 to be legitimate. If we find one, return the new, valid address.
596 This macro is used in only one place: `memory_address' in explow.c.
598 OLDX is the address as it was before break_out_memory_refs was called.
599 In some cases it is useful to look at this to decide what needs to be done.
601 MODE and WIN are passed so that this macro can use
602 GO_IF_LEGITIMATE_ADDRESS.
604 It is always safe for this macro to do nothing. It exists to recognize
605 opportunities to optimize the output.
607 For the vax, nothing needs to be done. */
609 #define LEGITIMIZE_ADDRESS(X,OLDX,MODE,WIN) {}
611 /* Go to LABEL if ADDR (a legitimate address expression)
612 has an effect that depends on the machine mode it is used for. */
613 #define GO_IF_MODE_DEPENDENT_ADDRESS(ADDR,LABEL)
616 /* Specify the machine mode that this machine uses
617 for the index in the tablejump instruction. */
618 #define CASE_VECTOR_MODE SImode
620 /* Define as C expression which evaluates to nonzero if the tablejump
621 instruction expects the table to contain offsets from the address of the
622 table.
623 Do not define this if the table should contain absolute addresses. */
624 /* #define CASE_VECTOR_PC_RELATIVE 1 */
626 /* Specify the tree operation to be used to convert reals to integers. */
627 #define IMPLICIT_FIX_EXPR FIX_ROUND_EXPR
629 /* This is the kind of divide that is easiest to do in the general case. */
630 #define EASY_DIV_EXPR TRUNC_DIV_EXPR
632 /* Define this as 1 if `char' should by default be signed; else as 0. */
633 #define DEFAULT_SIGNED_CHAR 1
635 /* This flag, if defined, says the same insns that convert to a signed fixnum
636 also convert validly to an unsigned one. */
637 #define FIXUNS_TRUNC_LIKE_FIX_TRUNC
639 /* Max number of bytes we can move from memory to memory
640 in one reasonably fast instruction. */
641 #define MOVE_MAX 8
643 /* Define this if zero-extension is slow (more than one real instruction). */
644 /* #define SLOW_ZERO_EXTEND */
646 /* Nonzero if access to memory by bytes is slow and undesirable. */
647 #define SLOW_BYTE_ACCESS 0
649 /* Define if shifts truncate the shift count
650 which implies one can omit a sign-extension or zero-extension
651 of a shift count. */
652 /* #define SHIFT_COUNT_TRUNCATED */
654 /* Value is 1 if truncating an integer of INPREC bits to OUTPREC bits
655 is done just by pretending it is already truncated. */
656 #define TRULY_NOOP_TRUNCATION(OUTPREC, INPREC) 1
658 /* Specify the machine mode that pointers have.
659 After generation of rtl, the compiler makes no further distinction
660 between pointers and any other objects of this machine mode. */
661 #define Pmode SImode
663 /* A function address in a call instruction
664 is a byte address (for indexing purposes)
665 so give the MEM rtx a byte's mode. */
666 #define FUNCTION_MODE QImode
668 /* Compute the cost of computing a constant rtl expression RTX
669 whose rtx-code is CODE. The body of this macro is a portion
670 of a switch statement. If the code is computed here,
671 return it with a return statement. Otherwise, break from the switch. */
673 #define CONST_COSTS(RTX,CODE,OUTER_CODE) \
674 case CONST_INT: \
675 /* Constant zero is super cheap due to clr instruction. */ \
676 if (RTX == const0_rtx) return 0; \
677 if ((unsigned) INTVAL (RTX) < 077) return 1; \
678 case CONST: \
679 case LABEL_REF: \
680 case SYMBOL_REF: \
681 return 3; \
682 case CONST_DOUBLE: \
683 return 5;
686 * We can use the BSD C library routines for the gnulib calls that are
687 * still generated, since that's what they boil down to anyways.
690 /* #define UDIVSI3_LIBCALL "*udiv" */
691 /* #define UMODSI3_LIBCALL "*urem" */
693 /* Tell final.c how to eliminate redundant test instructions. */
695 /* Here we define machine-dependent flags and fields in cc_status
696 (see `conditions.h'). No extra ones are needed for the vax. */
698 /* Store in cc_status the expressions
699 that the condition codes will describe
700 after execution of an instruction whose pattern is EXP.
701 Do not alter them if the instruction would not alter the cc's. */
703 #define NOTICE_UPDATE_CC(EXP, INSN) \
704 CC_STATUS_INIT;
707 /* Control the assembler format that we output. */
709 /* Output the name of the file we are compiling. */
710 #define ASM_OUTPUT_SOURCE_FILENAME(STREAM, NAME) \
711 do { fprintf (STREAM, "\t.file\t"); \
712 output_quoted_string (STREAM, NAME); \
713 fprintf (STREAM, "\n"); \
714 } while (0)
716 /* Output at beginning of assembler file. */
717 #define ASM_FILE_START(FILE) fputs ("", (FILE));
719 /* Output to assembler file text saying following lines
720 may contain character constants, extra white space, comments, etc. */
722 #define ASM_APP_ON ""
724 /* Output to assembler file text saying following lines
725 no longer contain unusual constructs. */
727 #define ASM_APP_OFF ""
729 /* Output before read-only data. */
731 #define TEXT_SECTION_ASM_OP "\t.inst"
733 /* Output before writable data. */
735 #define DATA_SECTION_ASM_OP "\t.var"
737 /* How to refer to registers in assembler output.
738 This sequence is indexed by compiler's hard-register-number (see above). */
740 #define REGISTER_NAMES \
741 {".r0", ".r1", ".r2", ".r3", ".r4", ".r5", ".r6", ".r7", ".r8", \
742 ".r9", ".r10", ".r11", ".r12", ".r13", ".r14", ".sp"}
744 /* This is BSD, so it wants DBX format. */
746 /* #define DBX_DEBUGGING_INFO */
748 /* How to renumber registers for dbx and gdb.
749 Vax needs no change in the numeration. */
751 #define DBX_REGISTER_NUMBER(REGNO) (REGNO)
753 /* Do not break .stabs pseudos into continuations. */
755 #define DBX_CONTIN_LENGTH 0
757 /* This is the char to use for continuation (in case we need to turn
758 continuation back on). */
760 #define DBX_CONTIN_CHAR '?'
762 /* Don't use the `xsfoo;' construct in DBX output; this system
763 doesn't support it. */
765 #define DBX_NO_XREFS
767 /* This is how to output the definition of a user-level label named NAME,
768 such as the label on a static function or variable NAME. */
770 #define ASM_OUTPUT_LABEL(FILE,NAME) \
771 do { assemble_name (FILE, NAME); fputs (":\n", FILE); } while (0)
773 /* This is how to output a command to make the user-level label named NAME
774 defined for reference from other files. */
776 #define ASM_GLOBALIZE_LABEL(FILE,NAME) \
777 do { fputs ("\t.extdef\t", FILE); assemble_name (FILE, NAME); fputs ("\n", FILE);} while (0)
779 /* The prefix to add to user-visible assembler symbols. */
781 #define USER_LABEL_PREFIX ""
783 /* This is how to output an internal numbered label where
784 PREFIX is the class of label and NUM is the number within the class. */
786 #define ASM_OUTPUT_INTERNAL_LABEL(FILE,PREFIX,NUM) \
787 fprintf (FILE, ".%s%d:\n", PREFIX, NUM)
789 /* This is how to store into the string LABEL
790 the symbol_ref name of an internal numbered label where
791 PREFIX is the class of label and NUM is the number within the class.
792 This is suitable for output with `assemble_name'. */
794 #define ASM_GENERATE_INTERNAL_LABEL(LABEL,PREFIX,NUM) \
795 sprintf (LABEL, ".%s%d", PREFIX, NUM)
797 /* This is how to output an assembler line defining a `double' constant.
798 It is .dfloat or .gfloat, depending. */
800 #define ASM_OUTPUT_DOUBLE(FILE,VALUE) \
801 { union {double d; int i[2]; } tem; \
802 tem.d = (VALUE); \
803 fprintf (FILE, "\t.data\t%d{32}, %d{32}\n", tem.i[0], tem.i[1]); }
805 /* This is how to output an assembler line defining a `float' constant. */
807 #define ASM_OUTPUT_FLOAT(FILE,VALUE) \
808 { union {float f; int i; } tem; \
809 tem.f = (VALUE); \
810 fprintf (FILE, "\t.data %d{32}\n", tem.i); }
812 /* This is how to output an assembler line defining an `int' constant. */
814 #define ASM_OUTPUT_INT(FILE,VALUE) \
816 fprintf (FILE, "\t.data\t"), \
817 output_addr_const (FILE, (VALUE)), \
818 fprintf (FILE, "{32}\n"))
820 #define ASM_OUTPUT_DOUBLE_INT(FILE,VALUE) \
822 fprintf (FILE, "\t.data\t"); \
823 if (GET_CODE (VALUE) == CONST_DOUBLE) \
825 fprintf (FILE, "%d", CONST_DOUBLE_HIGH (VALUE)); \
826 fprintf (FILE, "{32}, "); \
827 fprintf (FILE, "%d", CONST_DOUBLE_LOW (VALUE)); \
828 fprintf (FILE, "{32}\n"); \
829 } else if (GET_CODE (VALUE) == CONST_INT) \
831 int val = INTVAL (VALUE); \
832 fprintf (FILE, "%d", val < 0 ? -1 : 0); \
833 fprintf (FILE, "{32}, "); \
834 fprintf (FILE, "%d", val); \
835 fprintf (FILE, "{32}\n"); \
836 } else abort (); \
839 /* Likewise for `char' and `short' constants. */
841 #define ASM_OUTPUT_SHORT(FILE,VALUE) \
842 ( fprintf (FILE, "\t.data\t"), \
843 output_addr_const (FILE, (VALUE)), \
844 fprintf (FILE, "{16}\n"))
846 #define ASM_OUTPUT_CHAR(FILE,VALUE) \
847 ( fprintf (FILE, "\t.data\t"), \
848 output_addr_const (FILE, (VALUE)), \
849 fprintf (FILE, "{8}\n"))
851 /* This is how to output an assembler line for a numeric constant byte. */
853 #define ASM_OUTPUT_BYTE(FILE,VALUE) \
854 fprintf (FILE, "\t.data\t%d{8}\n", (VALUE))
856 /* This is how to output an insn to push a register on the stack.
857 It need not be very fast code. */
859 #define ASM_OUTPUT_REG_PUSH(FILE,REGNO) \
860 fprintf (FILE, "\tsubi.64\t4,.sp\n\tst.32\t%s,[.sp]\n", reg_names[REGNO])
862 /* This is how to output an insn to pop a register from the stack.
863 It need not be very fast code. */
865 #define ASM_OUTPUT_REG_POP(FILE,REGNO) \
866 fprintf (FILE, "\tld.32\t%s,[.sp]\n\taddi.64\t4,.sp\n", reg_names[REGNO])
868 /* This is how to output an element of a case-vector that is absolute.
869 (The Vax does not use such vectors,
870 but we must define this macro anyway.) */
872 #define ASM_OUTPUT_ADDR_VEC_ELT(FILE, VALUE) \
873 fprintf (FILE, "\t.data .L%d{32}\n", VALUE)
875 /* This is how to output an element of a case-vector that is relative. */
877 #define ASM_OUTPUT_ADDR_DIFF_ELT(FILE, BODY, VALUE, REL) \
878 fprintf (FILE, "\t.data .L%d-.L%d{32}\n", VALUE, REL)
880 /* This is how to output an assembler line
881 that says to advance the location counter
882 to a multiple of 2**LOG bytes. */
884 #define ASM_OUTPUT_ALIGN(FILE,LOG) \
885 do { if (LOG!=0) fprintf (FILE, "\t.align\t%d\n", (LOG)); } while (0)
887 /* This is how to output an assembler line
888 that says to advance the location counter by SIZE bytes. */
890 #define ASM_OUTPUT_SKIP(FILE,SIZE) \
891 fprintf (FILE, "\t.space %d\n", (SIZE))
893 /* This says how to output an assembler line
894 to define a global common symbol. */
896 #define ASM_OUTPUT_COMMON(FILE, NAME, SIZE, ROUNDED) \
897 ( fputs (".comm ", (FILE)), \
898 assemble_name ((FILE), (NAME)), \
899 fprintf ((FILE), ",%d\n", (ROUNDED)))
901 /* This says how to output an assembler line
902 to define a local common symbol. */
904 #define ASM_OUTPUT_LOCAL(FILE, NAME, SIZE, ROUNDED) \
905 ( fputs (".bss ", (FILE)), \
906 assemble_name ((FILE), (NAME)), \
907 fprintf ((FILE), ",%d,%d\n", (SIZE),(ROUNDED)))
909 /* Store in OUTPUT a string (made with alloca) containing
910 an assembler-name for a local static variable named NAME.
911 LABELNO is an integer which is different for each call. */
913 #define ASM_FORMAT_PRIVATE_NAME(OUTPUT, NAME, LABELNO) \
914 ( (OUTPUT) = (char *) alloca (strlen ((NAME)) + 10), \
915 sprintf ((OUTPUT), "%s.%d", (NAME), (LABELNO)))
917 /* Define the parentheses used to group arithmetic operations
918 in assembler code. */
920 #define ASM_OPEN_PAREN "("
921 #define ASM_CLOSE_PAREN ")"
923 /* Define results of standard character escape sequences. */
924 #define TARGET_BELL 007
925 #define TARGET_BS 010
926 #define TARGET_TAB 011
927 #define TARGET_NEWLINE 012
928 #define TARGET_VT 013
929 #define TARGET_FF 014
930 #define TARGET_CR 015
932 /* Print an instruction operand X on file FILE.
933 CODE is the code from the %-spec that requested printing this operand;
934 if `%z3' was used to print operand 3, then CODE is 'z'. */
936 #define PRINT_OPERAND(FILE, X, CODE) \
938 if (CODE == 'r' && GET_CODE (X) == MEM && GET_CODE (XEXP (X, 0)) == REG) \
939 fprintf (FILE, "%s", reg_names[REGNO (XEXP (X, 0))]); \
940 else if (GET_CODE (X) == REG) \
941 fprintf (FILE, "%s", reg_names[REGNO (X)]); \
942 else if (GET_CODE (X) == MEM) \
943 output_address (XEXP (X, 0)); \
944 else \
946 /*debug_rtx(X);*/ \
947 putc ('=', FILE); \
948 output_addr_const (FILE, X); } \
951 /* Print a memory operand whose address is X, on file FILE.
952 This uses a function in output-vax.c. */
954 #define PRINT_OPERAND_ADDRESS(FILE, ADDR) \
955 print_operand_address (FILE, ADDR)
957 /* These are stubs, and have yet to bee written. */
959 #define TRAMPOLINE_SIZE 26
960 #define TRAMPOLINE_TEMPLATE(FILE)
961 #define INITIALIZE_TRAMPOLINE(TRAMP,FNADDR,CXT)