(TARGET_CPU_arm*, TARGET_CPU_strongarm*, TARGET_CPU_generic):
[official-gcc.git] / gcc / config / we32k / we32k.h
blob460fc3d282014d9a9a9b94a622848a1d4e8c1ea9
1 /* Definitions of target machine for GNU compiler. AT&T we32000 version.
2 Copyright (C) 1991, 92, 93, 94, 95, 1996 Free Software Foundation, Inc.
3 Contributed by John Wehle (john@feith1.uucp)
5 This file is part of GNU CC.
7 GNU CC is free software; you can redistribute it and/or modify
8 it under the terms of the GNU General Public License as published by
9 the Free Software Foundation; either version 1, or (at your option)
10 any later version.
12 GNU CC is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 GNU General Public License for more details.
17 You should have received a copy of the GNU General Public License
18 along with GNU CC; see the file COPYING. If not, write to
19 the Free Software Foundation, 59 Temple Place - Suite 330,
20 Boston, MA 02111-1307, USA. */
23 /* Names to predefine in the preprocessor for this target machine. */
25 #define CPP_PREDEFINES "-Dwe32000 -Du3b2 -Dunix -Asystem(unix) -Acpu(we32000) -Amachine(we32000)"
27 /* Print subsidiary information on the compiler version in use. */
29 #define TARGET_VERSION fprintf (stderr, " (we32000)");
31 /* Run-time compilation parameters selecting different hardware subsets. */
33 extern int target_flags;
35 /* Macros used in the machine description to test the flags. */
37 /* Macro to define tables used to set the flags.
38 This is a list in braces of pairs in braces,
39 each pair being { "NAME", VALUE }
40 where VALUE is the bits to set or minus the bits to clear.
41 An empty string NAME is used to identify the default VALUE. */
43 #define TARGET_SWITCHES \
44 { { "", TARGET_DEFAULT}}
46 #define TARGET_DEFAULT 0
49 /* target machine storage layout */
51 /* Define this if most significant bit is lowest numbered
52 in instructions that operate on numbered bit-fields. */
53 #define BITS_BIG_ENDIAN 0
55 /* Define this if most significant byte of a word is the lowest numbered. */
56 /* That is true on the we32000. */
57 #define BYTES_BIG_ENDIAN 1
59 /* Define this if most significant word of a multiword is lowest numbered. */
60 /* For we32000 we can decide arbitrarily
61 since there are no machine instructions for them. */
62 #define WORDS_BIG_ENDIAN 1
64 /* number of bits in an addressable storage unit */
65 #define BITS_PER_UNIT 8
67 /* Width in bits of a "word", which is the contents of a machine register.
68 Note that this is not necessarily the width of data type `int';
69 if using 16-bit ints on a we32000, this would still be 32.
70 But on a machine with 16-bit registers, this would be 16. */
71 #define BITS_PER_WORD 32
73 /* Width of a word, in units (bytes). */
74 #define UNITS_PER_WORD 4
76 /* Width in bits of a pointer.
77 See also the macro `Pmode' defined below. */
78 #define POINTER_SIZE 32
80 /* Allocation boundary (in *bits*) for storing arguments in argument list. */
81 #define PARM_BOUNDARY 32
83 /* Boundary (in *bits*) on which stack pointer should be aligned. */
84 #define STACK_BOUNDARY 32
86 /* Allocation boundary (in *bits*) for the code of a function. */
87 #define FUNCTION_BOUNDARY 32
89 /* Alignment of field after `int : 0' in a structure. */
90 #define EMPTY_FIELD_BOUNDARY 32
92 /* No data type wants to be aligned rounder than this. */
93 #define BIGGEST_ALIGNMENT 32
95 /* Every structure's size must be a multiple of this. */
96 #define STRUCTURE_SIZE_BOUNDARY 32
98 /* Define this if move instructions will actually fail to work
99 when given unaligned data. */
100 #define STRICT_ALIGNMENT 1
102 /* Define number of bits in most basic integer type.
103 (If undefined, default is BITS_PER_WORD). */
104 #define INT_TYPE_SIZE 32
106 /* Integer bit fields should have the same size and alignment
107 as actual integers */
108 #define PCC_BITFIELD_TYPE_MATTERS 1
110 /* Specify the size_t type. */
111 #define SIZE_TYPE "unsigned int"
113 /* Standard register usage. */
115 /* Number of actual hardware registers.
116 The hardware registers are assigned numbers for the compiler
117 from 0 to just below FIRST_PSEUDO_REGISTER.
118 All registers that the compiler knows about must be given numbers,
119 even those that are not normally considered general registers. */
120 #define FIRST_PSEUDO_REGISTER 16
122 /* 1 for registers that have pervasive standard uses
123 and are not available for the register allocator. */
124 #define FIXED_REGISTERS \
125 {0, 0, 0, 0, 0, 0, 0, 0, \
126 0, 1, 1, 1, 1, 1, 1, 1, }
128 /* 1 for registers not available across function calls.
129 These must include the FIXED_REGISTERS and also any
130 registers that can be used without being saved.
131 The latter must include the registers where values are returned
132 and the register where structure-value addresses are passed.
133 Aside from that, you can include as many other registers as you like. */
134 #define CALL_USED_REGISTERS \
135 {1, 1, 1, 0, 0, 0, 0, 0, \
136 0, 1, 1, 1, 1, 1, 1, 1, }
138 /* Make sure everything's fine if we *don't* have a given processor.
139 This assumes that putting a register in fixed_regs will keep the
140 compilers mitt's completely off it. We don't bother to zero it out
141 of register classes. */
142 /* #define CONDITIONAL_REGISTER_USAGE */
144 /* Return number of consecutive hard regs needed starting at reg REGNO
145 to hold something of mode MODE.
146 This is ordinarily the length in words of a value of mode MODE
147 but can be less for certain modes in special long registers. */
148 #define HARD_REGNO_NREGS(REGNO, MODE) \
149 ((GET_MODE_SIZE (MODE) + UNITS_PER_WORD - 1) / UNITS_PER_WORD)
151 /* Value is 1 if hard register REGNO can hold a value of machine-mode MODE. */
152 #define HARD_REGNO_MODE_OK(REGNO, MODE) 1
154 /* Value is 1 if it is a good idea to tie two pseudo registers
155 when one has mode MODE1 and one has mode MODE2.
156 If HARD_REGNO_MODE_OK could produce different values for MODE1 and MODE2,
157 for any hard reg, then this must be 0 for correct output. */
158 #define MODES_TIEABLE_P(MODE1, MODE2) 0
160 /* Specify the registers used for certain standard purposes.
161 The values of these macros are register numbers. */
163 /* Register used for the program counter */
164 #define PC_REGNUM 15
166 /* Register to use for pushing function arguments. */
167 #define STACK_POINTER_REGNUM 12
169 /* Base register for access to local variables of the function. */
170 #define FRAME_POINTER_REGNUM 9
172 /* Value should be nonzero if functions must have frame pointers.
173 Zero means the frame pointer need not be set up (and parms
174 may be accessed via the stack pointer) in functions that seem suitable.
175 This is computed in `reload', in reload1.c. */
176 #define FRAME_POINTER_REQUIRED 1
178 /* Base register for access to arguments of the function. */
179 #define ARG_POINTER_REGNUM 10
181 /* Register in which static-chain is passed to a function. */
182 #define STATIC_CHAIN_REGNUM 8
184 /* Register in which address to store a structure value
185 is passed to a function. */
186 #define STRUCT_VALUE_REGNUM 2
188 /* Order in which to allocate registers. */
189 #define REG_ALLOC_ORDER \
190 {0, 1, 8, 7, 6, 5, 4, 3}
192 /* Define the classes of registers for register constraints in the
193 machine description. Also define ranges of constants.
195 One of the classes must always be named ALL_REGS and include all hard regs.
196 If there is more than one class, another class must be named NO_REGS
197 and contain no registers.
199 The name GENERAL_REGS must be the name of a class (or an alias for
200 another name such as ALL_REGS). This is the class of registers
201 that is allowed by "g" or "r" in a register constraint.
202 Also, registers outside this class are allocated only when
203 instructions express preferences for them.
205 The classes must be numbered in nondecreasing order; that is,
206 a larger-numbered class must never be contained completely
207 in a smaller-numbered class.
209 For any two classes, it is very desirable that there be another
210 class that represents their union. */
212 enum reg_class { NO_REGS, GENERAL_REGS,
213 ALL_REGS, LIM_REG_CLASSES };
215 #define N_REG_CLASSES (int) LIM_REG_CLASSES
217 /* Give names of register classes as strings for dump file. */
219 #define REG_CLASS_NAMES \
220 { "NO_REGS", "GENERAL_REGS", "ALL_REGS" }
222 /* Define which registers fit in which classes.
223 This is an initializer for a vector of HARD_REG_SET
224 of length N_REG_CLASSES. */
226 #define REG_CLASS_CONTENTS \
228 0, /* NO_REGS */ \
229 0x000017ff, /* GENERAL_REGS */ \
230 0x0000ffff, /* ALL_REGS */ \
233 /* The same information, inverted:
234 Return the class number of the smallest class containing
235 reg number REGNO. This could be a conditional expression
236 or could index an array. */
238 #define REGNO_REG_CLASS(REGNO) \
239 (((REGNO) < 11 || (REGNO) == 12) ? GENERAL_REGS : ALL_REGS)
241 /* The class value for index registers, and the one for base regs. */
243 #define INDEX_REG_CLASS NO_REGS
244 #define BASE_REG_CLASS GENERAL_REGS
246 /* Get reg_class from a letter such as appears in the machine description.
247 We do a trick here to modify the effective constraints on the
248 machine description; we zorch the constraint letters that aren't
249 appropriate for a specific target. This allows us to guarantee
250 that a specific kind of register will not be used for a given target
251 without fiddling with the register classes above. */
253 #define REG_CLASS_FROM_LETTER(C) \
254 ((C) == 'r' ? GENERAL_REGS : 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) 0
267 #define CONST_DOUBLE_OK_FOR_LETTER_P(VALUE, C) 0
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 #define CLASS_MAX_NREGS(CLASS, MODE) \
279 ((GET_MODE_SIZE (MODE) + UNITS_PER_WORD - 1) / UNITS_PER_WORD)
281 /* Stack layout; function entry, exit and calling. */
283 /* Define this if pushing a word on the stack
284 makes the stack pointer a smaller address. */
285 /* #define STACK_GROWS_DOWNWARD */
287 /* Define this if the nominal address of the stack frame
288 is at the high-address end of the local variables;
289 that is, each additional local variable allocated
290 goes at a more negative offset in the frame. */
291 /* #define FRAME_GROWS_DOWNWARD */
293 /* Offset within stack frame to start allocating local variables at.
294 If FRAME_GROWS_DOWNWARD, this is the offset to the END of the
295 first local allocated. Otherwise, it is the offset to the BEGINNING
296 of the first local allocated. */
297 #define STARTING_FRAME_OFFSET 0
299 /* If we generate an insn to push BYTES bytes,
300 this says how many the stack pointer really advances by. */
301 #define PUSH_ROUNDING(BYTES) (((BYTES) + 3) & ~3)
303 /* Offset of first parameter from the argument pointer register value. */
304 #define FIRST_PARM_OFFSET(FNDECL) 0
306 /* Value is 1 if returning from a function call automatically
307 pops the arguments described by the number-of-args field in the call.
308 FUNDECL is the declaration node of the function (as a tree),
309 FUNTYPE is the data type of the function (as a tree),
310 or for a library call it is an identifier node for the subroutine name. */
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 we32000 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 we32000 the return value is in r0 regardless. */
329 #define LIBCALL_VALUE(MODE) gen_rtx (REG, MODE, 0)
331 /* 1 if N is a possible register number for a function value.
332 On the we32000, r0 is the only register thus used. */
334 #define FUNCTION_VALUE_REGNO_P(N) ((N) == 0)
336 /* Define this if PCC uses the nonreentrant convention for returning
337 structure and union values. */
339 /* #define PCC_STATIC_STRUCT_RETURN */
341 /* 1 if N is a possible register number for function argument passing.
342 On the we32000, 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 we32k, 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 we32k, the offset starts at 0. */
363 #define INIT_CUMULATIVE_ARGS(CUM,FNTYPE,LIBNAME,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 we32000 all args are pushed */
390 #define FUNCTION_ARG(CUM, MODE, TYPE, NAMED) 0
392 /* For an arg passed partly in registers and partly in memory,
393 this is the number of registers used.
394 For args passed entirely in registers or entirely in memory, zero. */
396 #define FUNCTION_ARG_PARTIAL_NREGS(CUM, MODE, TYPE, NAMED) 0
398 /* This macro generates the assembly code for function entry.
399 FILE is a stdio stream to output the code to.
400 SIZE is an int: how many units of temporary storage to allocate.
401 Refer to the array `regs_ever_live' to determine which registers
402 to save; `regs_ever_live[I]' is nonzero if register number I
403 is ever used in the function. This macro is responsible for
404 knowing which registers should not be saved even if used. */
406 #define FUNCTION_PROLOGUE(FILE, SIZE) \
407 { register int nregs_to_save; \
408 register int regno; \
409 extern char call_used_regs[]; \
410 nregs_to_save = 0; \
411 for (regno = 8; regno > 2; regno--) \
412 if (regs_ever_live[regno] && ! call_used_regs[regno]) \
413 nregs_to_save = (9 - regno); \
414 fprintf (FILE, "\tsave &%d\n", nregs_to_save); \
415 if (SIZE) \
416 fprintf (FILE, "\taddw2 &%d,%%sp\n", ((SIZE) + 3) & ~3); }
418 /* Output assembler code to FILE to increment profiler label # LABELNO
419 for profiling a function entry. */
421 #define FUNCTION_PROFILER(FILE, LABELNO) \
422 fprintf (FILE, "\tmovw &.LP%d,%%r0\n\tjsb _mcount\n", (LABELNO))
424 /* Output assembler code to FILE to initialize this source file's
425 basic block profiling info, if that has not already been done. */
427 #define FUNCTION_BLOCK_PROFILER(FILE, LABELNO) \
428 fprintf (FILE, "\tcmpw .LPBX0,&0\n\tjne .LPI%d\n\tpushw &.LPBX0\n\tcall &1,__bb_init_func\n.LPI%d:\n", \
429 LABELNO, LABELNO);
431 /* Output assembler code to FILE to increment the entry-count for
432 the BLOCKNO'th basic block in this source file. */
434 #define BLOCK_PROFILER(FILE, BLOCKNO) \
435 fprintf (FILE, "\taddw2 &1,.LPBX2+%d\n", 4 * BLOCKNO)
437 /* EXIT_IGNORE_STACK should be nonzero if, when returning from a function,
438 the stack pointer does not matter. The value is tested only in
439 functions that have frame pointers.
440 No definition is equivalent to always zero. */
442 #define EXIT_IGNORE_STACK 0
444 /* This macro generates the assembly code for function exit,
445 on machines that need it. If FUNCTION_EPILOGUE is not defined
446 then individual return instructions are generated for each
447 return statement. Args are same as for FUNCTION_PROLOGUE.
449 The function epilogue should not depend on the current stack pointer!
450 It should use the frame pointer only. This is mandatory because
451 of alloca; we also take advantage of it to omit stack adjustments
452 before returning. */
454 #define FUNCTION_EPILOGUE(FILE, SIZE) \
455 { register int nregs_to_restore; \
456 register int regno; \
457 extern char call_used_regs[]; \
458 nregs_to_restore = 0; \
459 for (regno = 8; regno > 2; regno--) \
460 if (regs_ever_live[regno] && ! call_used_regs[regno]) \
461 nregs_to_restore = (9 - regno); \
462 fprintf (FILE, "\tret &%d\n", nregs_to_restore); }
464 /* Store in the variable DEPTH the initial difference between the
465 frame pointer reg contents and the stack pointer reg contents,
466 as of the start of the function body. This depends on the layout
467 of the fixed parts of the stack frame and on how registers are saved.
469 On the we32k, FRAME_POINTER_REQUIRED is always 1, so the definition of this
470 macro doesn't matter. But it must be defined. */
472 #define INITIAL_FRAME_POINTER_OFFSET(DEPTH) (DEPTH) = 0;
474 /* Output assembler code for a block containing the constant parts
475 of a trampoline, leaving space for the variable parts. */
477 /* On the we32k, the trampoline contains two instructions:
478 mov #STATIC,%r8
479 jmp #FUNCTION */
481 #define TRAMPOLINE_TEMPLATE(FILE) \
483 ASM_OUTPUT_SHORT (FILE, gen_rtx (CONST_INT, VOIDmode, 0x844f)); \
484 ASM_OUTPUT_SHORT (FILE, const0_rtx); \
485 ASM_OUTPUT_SHORT (FILE, const0_rtx); \
486 ASM_OUTPUT_CHAR (FILE, gen_rtx (CONST_INT, VOIDmode, 0x48)); \
487 ASM_OUTPUT_SHORT (FILE, gen_rtx (CONST_INT, VOIDmode, 0x247f)); \
488 ASM_OUTPUT_SHORT (FILE, const0_rtx); \
489 ASM_OUTPUT_SHORT (FILE, const0_rtx); \
492 /* Length in units of the trampoline for entering a nested function. */
494 #define TRAMPOLINE_SIZE 13
496 /* Emit RTL insns to initialize the variable parts of a trampoline.
497 FNADDR is an RTX for the address of the function's pure code.
498 CXT is an RTX for the static chain value for the function. */
500 #define INITIALIZE_TRAMPOLINE(TRAMP, FNADDR, CXT) \
502 emit_move_insn (gen_rtx (MEM, SImode, plus_constant (TRAMP, 2)), CXT); \
503 emit_move_insn (gen_rtx (MEM, SImode, plus_constant (TRAMP, 9)), FNADDR); \
506 /* Generate calls to memcpy() and memset() rather
507 than bcopy() and bzero() */
508 #define TARGET_MEM_FUNCTIONS
510 /* Addressing modes, and classification of registers for them. */
512 /* #define HAVE_POST_INCREMENT */
513 /* #define HAVE_POST_DECREMENT */
515 /* #define HAVE_PRE_DECREMENT */
516 /* #define HAVE_PRE_INCREMENT */
518 /* Macros to check register numbers against specific register classes. */
520 /* These assume that REGNO is a hard or pseudo reg number.
521 They give nonzero only if REGNO is a hard reg of the suitable class
522 or a pseudo reg currently allocated to a suitable hard reg.
523 Since they use reg_renumber, they are safe only once reg_renumber
524 has been allocated, which happens in local-alloc.c. */
526 #define REGNO_OK_FOR_INDEX_P(REGNO) 0
528 #define REGNO_OK_FOR_BASE_P(REGNO) \
529 ((REGNO) < 11 || (REGNO) == 12 || \
530 (unsigned)reg_renumber[REGNO] < 11 || (unsigned)reg_renumber[REGNO] == 12)
532 /* Maximum number of registers that can appear in a valid memory address. */
534 #define MAX_REGS_PER_ADDRESS 1
536 /* Recognize any constant value that is a valid address. */
538 #define CONSTANT_ADDRESS_P(X) \
539 (GET_CODE (X) == LABEL_REF || GET_CODE (X) == SYMBOL_REF \
540 || GET_CODE (X) == CONST_INT || GET_CODE (X) == CONST \
541 || GET_CODE (X) == HIGH)
543 /* Nonzero if the constant value X is a legitimate general operand.
544 It is given that X satisfies CONSTANT_P or is a CONST_DOUBLE. */
546 #define LEGITIMATE_CONSTANT_P(X) 1
548 /* The macros REG_OK_FOR..._P assume that the arg is a REG rtx
549 and check its validity for a certain class.
550 We have two alternate definitions for each of them.
551 The usual definition accepts all pseudo regs; the other rejects
552 them unless they have been allocated suitable hard regs.
553 The symbol REG_OK_STRICT causes the latter definition to be used.
555 Most source files want to accept pseudo regs in the hope that
556 they will get allocated to the class that the insn wants them to be in.
557 Source files for reload pass need to be strict.
558 After reload, it makes no difference, since pseudo regs have
559 been eliminated by then. */
561 #ifndef REG_OK_STRICT
563 /* Nonzero if X is a hard reg that can be used as an index
564 or if it is a pseudo reg. */
565 #define REG_OK_FOR_INDEX_P(X) 0
567 /* Nonzero if X is a hard reg that can be used as a base reg
568 or if it is a pseudo reg. */
569 #define REG_OK_FOR_BASE_P(X) \
570 (REGNO(X) < 11 || REGNO(X) == 12 || REGNO(X) >= FIRST_PSEUDO_REGISTER)
572 #else
574 /* Nonzero if X is a hard reg that can be used as an index. */
575 #define REG_OK_FOR_INDEX_P(X) REGNO_OK_FOR_INDEX_P (REGNO (X))
576 /* Nonzero if X is a hard reg that can be used as a base reg. */
577 #define REG_OK_FOR_BASE_P(X) REGNO_OK_FOR_BASE_P (REGNO (X))
579 #endif
581 /* GO_IF_LEGITIMATE_ADDRESS recognizes an RTL expression
582 that is a valid memory address for an instruction.
583 The MODE argument is the machine mode for the MEM expression
584 that wants to use this address. */
586 #define GO_IF_LEGITIMATE_ADDRESS(MODE, X, LABEL) \
587 { register rtx Addr = X; \
588 if ((MODE) == QImode || (MODE) == HImode || \
589 (MODE) == PSImode || (MODE) == SImode || (MODE) == SFmode) \
590 if (GET_CODE(Addr) == MEM) \
591 Addr = XEXP(Addr, 0); \
592 if (CONSTANT_ADDRESS_P(Addr)) \
593 goto LABEL; \
594 if (REG_P(Addr) && REG_OK_FOR_BASE_P(Addr)) \
595 goto LABEL; \
596 if (GET_CODE(Addr) == PLUS && \
597 ((REG_P(XEXP(Addr, 0)) && REG_OK_FOR_BASE_P(XEXP(Addr, 0)) && \
598 CONSTANT_ADDRESS_P(XEXP(Addr, 1))) || \
599 (REG_P(XEXP(Addr, 1)) && REG_OK_FOR_BASE_P(XEXP(Addr, 1)) && \
600 CONSTANT_ADDRESS_P(XEXP(Addr, 0))))) \
601 goto LABEL; \
604 /* Try machine-dependent ways of modifying an illegitimate address
605 to be legitimate. If we find one, return the new, valid address.
606 This macro is used in only one place: `memory_address' in explow.c.
608 OLDX is the address as it was before break_out_memory_refs was called.
609 In some cases it is useful to look at this to decide what needs to be done.
611 MODE and WIN are passed so that this macro can use
612 GO_IF_LEGITIMATE_ADDRESS.
614 It is always safe for this macro to do nothing. It exists to recognize
615 opportunities to optimize the output. */
617 #define LEGITIMIZE_ADDRESS(X,OLDX,MODE,WIN) { }
619 /* Go to LABEL if ADDR (a legitimate address expression)
620 has an effect that depends on the machine mode it is used for. */
622 #define GO_IF_MODE_DEPENDENT_ADDRESS(ADDR,LABEL) { }
624 /* Specify the machine mode that this machine uses
625 for the index in the tablejump instruction. */
626 #define CASE_VECTOR_MODE SImode
628 /* Define this if the tablejump instruction expects the table
629 to contain offsets from the address of the table.
630 Do not define this if the table should contain absolute addresses. */
631 /* #define CASE_VECTOR_PC_RELATIVE */
633 /* Specify the tree operation to be used to convert reals to integers. */
634 #define IMPLICIT_FIX_EXPR FIX_ROUND_EXPR
636 /* This is the kind of divide that is easiest to do in the general case. */
637 #define EASY_DIV_EXPR TRUNC_DIV_EXPR
639 /* Define this as 1 if `char' should by default be signed; else as 0. */
640 #define DEFAULT_SIGNED_CHAR 0
642 /* Max number of bytes we can move from memory to memory
643 in one reasonably fast instruction. */
644 #define MOVE_MAX 4
646 /* Define this if zero-extension is slow (more than one real instruction). */
647 /* #define SLOW_ZERO_EXTEND */
649 /* Nonzero if access to memory by bytes is slow and undesirable. */
650 #define SLOW_BYTE_ACCESS 0
652 /* Define this to be nonzero if shift instructions ignore all but the low-order
653 few bits. */
654 #define SHIFT_COUNT_TRUNCATED 1
656 /* Value is 1 if truncating an integer of INPREC bits to OUTPREC bits
657 is done just by pretending it is already truncated. */
658 #define TRULY_NOOP_TRUNCATION(OUTPREC, INPREC) 1
660 /* We assume that the store-condition-codes instructions store 0 for false
661 and some other value for true. This is the value stored for true. */
663 #define STORE_FLAG_VALUE -1
665 /* When a prototype says `char' or `short', really pass an `int'. */
666 #define PROMOTE_PROTOTYPES
668 /* Specify the machine mode that pointers have.
669 After generation of rtl, the compiler makes no further distinction
670 between pointers and any other objects of this machine mode. */
671 #define Pmode SImode
673 /* A function address in a call instruction
674 is a byte address (for indexing purposes)
675 so give the MEM rtx a byte's mode. */
676 #define FUNCTION_MODE QImode
678 /* Compute the cost of computing a constant rtl expression RTX
679 whose rtx-code is CODE. The body of this macro is a portion
680 of a switch statement. If the code is computed here,
681 return it with a return statement. Otherwise, break from the switch. */
683 #define CONST_COSTS(RTX,CODE, OUTER_CODE) \
684 case CONST_INT: \
685 if (INTVAL (RTX) >= -16 && INTVAL (RTX) <= 63) return 0; \
686 if (INTVAL (RTX) >= -128 && INTVAL (RTX) <= 127) return 1; \
687 if (INTVAL (RTX) >= -32768 && INTVAL (RTX) <= 32767) return 2; \
688 case CONST: \
689 case LABEL_REF: \
690 case SYMBOL_REF: \
691 return 3; \
692 case CONST_DOUBLE: \
693 return 5;
695 /* Tell final.c how to eliminate redundant test instructions. */
697 /* Here we define machine-dependent flags and fields in cc_status
698 (see `conditions.h'). */
700 #define NOTICE_UPDATE_CC(EXP, INSN) \
702 { CC_STATUS_INIT; } \
705 /* Control the assembler format that we output. */
707 /* Use crt1.o as a startup file and crtn.o as a closing file. */
709 #define STARTFILE_SPEC "%{pg:gcrt1.o%s}%{!pg:%{p:mcrt1.o%s}%{!p:crt1.o%s}}"
711 #define ENDFILE_SPEC "crtn.o%s"
713 /* The .file command should always begin the output. */
715 #define ASM_FILE_START(FILE) output_file_directive ((FILE), main_input_filename)
717 /* Output to assembler file text saying following lines
718 may contain character constants, extra white space, comments, etc. */
720 #define ASM_APP_ON "#APP\n"
722 /* Output to assembler file text saying following lines
723 no longer contain unusual constructs. */
725 #define ASM_APP_OFF "#NO_APP\n"
727 /* Output before code. */
729 #define TEXT_SECTION_ASM_OP ".text"
731 /* Output before writable data. */
733 #define DATA_SECTION_ASM_OP ".data"
735 /* Read-only data goes in the data section because
736 AT&T's assembler doesn't guarantee the proper alignment
737 of data in the text section even if an align statement
738 is used. */
740 #define READONLY_DATA_SECTION() data_section()
742 /* How to refer to registers in assembler output.
743 This sequence is indexed by compiler's hard-register-number (see above). */
745 #define REGISTER_NAMES \
746 {"r0", "r1", "r2", "r3", "r4", "r5", "r6", "r7", \
747 "r8", "fp", "ap", "psw", "sp", "pcbp", "isp", "pc" }
749 /* How to renumber registers for dbx and gdb. */
751 #define DBX_REGISTER_NUMBER(REGNO) (REGNO)
753 /* Output SDB debugging info in response to the -g option. */
755 #define SDB_DEBUGGING_INFO
757 /* This is how to output the definition of a user-level label named NAME,
758 such as the label on a static function or variable NAME. */
760 #define ASM_OUTPUT_LABEL(FILE,NAME) \
761 do { assemble_name (FILE, NAME); fputs (":\n", FILE); } while (0)
763 /* This is how to output a command to make the user-level label named NAME
764 defined for reference from other files. */
766 #define ASM_GLOBALIZE_LABEL(FILE,NAME) \
767 do { \
768 fputs (".globl ", FILE); \
769 assemble_name (FILE, NAME); \
770 fputs ("\n", FILE); \
771 } while (0)
773 /* The prefix to add to user-visible assembler symbols. */
775 #define USER_LABEL_PREFIX ""
777 /* This is how to output an internal numbered label where
778 PREFIX is the class of label and NUM is the number within the class. */
780 #define ASM_OUTPUT_INTERNAL_LABEL(FILE,PREFIX,NUM) \
781 fprintf (FILE, ".%s%d:\n", PREFIX, NUM)
783 /* This is how to store into the string LABEL
784 the symbol_ref name of an internal numbered label where
785 PREFIX is the class of label and NUM is the number within the class.
786 This is suitable for output with `assemble_name'. */
788 #define ASM_GENERATE_INTERNAL_LABEL(LABEL,PREFIX,NUM) \
789 sprintf (LABEL, ".%s%d", PREFIX, NUM)
791 /* This is how to output an internal numbered label which
792 labels a jump table. */
794 #define ASM_OUTPUT_CASE_LABEL(FILE,PREFIX,NUM,TABLE) \
795 do { \
796 ASM_OUTPUT_ALIGN (FILE, 2); \
797 ASM_OUTPUT_INTERNAL_LABEL (FILE, PREFIX, NUM); \
798 } while (0)
800 /* Assembler pseudo to introduce byte constants. */
802 #define ASM_BYTE_OP "\t.byte"
804 /* This is how to output an assembler line defining a `double' constant. */
806 /* This is how to output an assembler line defining a `float' constant. */
808 /* AT&T's assembler can't handle floating constants written as floating.
809 However, when cross-compiling, always use that in case format differs. */
811 #ifdef CROSS_COMPILER
813 #define ASM_OUTPUT_DOUBLE(FILE,VALUE) \
814 fprintf (FILE, "\t.double 0r%.20g\n", (VALUE))
816 #define ASM_OUTPUT_FLOAT(FILE,VALUE) \
817 fprintf (FILE, "\t.float 0r%.10g\n", (VALUE))
819 #else
821 #define ASM_OUTPUT_DOUBLE(FILE,VALUE) \
822 do { union { double d; long l[2];} tem; \
823 tem.d = (VALUE); \
824 fprintf (FILE, "\t.word 0x%x, 0x%x\n", tem.l[0], tem.l[1]);\
825 } while (0)
827 #define ASM_OUTPUT_FLOAT(FILE,VALUE) \
828 do { union { float f; long l;} tem; \
829 tem.f = (VALUE); \
830 fprintf (FILE, "\t.word 0x%x\n", tem.l); \
831 } while (0)
833 #endif /* not CROSS_COMPILER */
835 /* This is how to output an assembler line defining an `int' constant. */
837 #define ASM_OUTPUT_INT(FILE,VALUE) \
838 ( fprintf (FILE, "\t.word "), \
839 output_addr_const (FILE, (VALUE)), \
840 fprintf (FILE, "\n"))
842 /* Likewise for `char' and `short' constants. */
844 #define ASM_OUTPUT_SHORT(FILE,VALUE) \
845 ( fprintf (FILE, "\t.half "), \
846 output_addr_const (FILE, (VALUE)), \
847 fprintf (FILE, "\n"))
849 #define ASM_OUTPUT_CHAR(FILE,VALUE) \
850 ( fprintf (FILE, "\t.byte "), \
851 output_addr_const (FILE, (VALUE)), \
852 fprintf (FILE, "\n"))
854 /* This is how to output an assembler line for a numeric constant byte. */
856 #define ASM_OUTPUT_BYTE(FILE,VALUE) \
857 fprintf (FILE, "\t.byte 0x%x\n", (VALUE))
859 #define ASM_OUTPUT_ASCII(FILE,PTR,LEN) \
860 do { \
861 unsigned char *s; \
862 int i; \
863 for (i = 0, s = (unsigned char *)(PTR); i < (LEN); s++, i++) \
865 if ((i % 8) == 0) \
866 fprintf ((FILE),"%s\t.byte\t",(i?"\n":"")); \
867 fprintf ((FILE), "%s0x%x", (i%8?",":""), (unsigned)*s); \
869 fputs ("\n", (FILE)); \
870 } while (0)
872 /* This is how to output an insn to push a register on the stack.
873 It need not be very fast code. */
875 #define ASM_OUTPUT_REG_PUSH(FILE,REGNO) \
876 fprintf (FILE, "\tpushw %s\n", reg_names[REGNO])
878 /* This is how to output an insn to pop a register from the stack.
879 It need not be very fast code. */
881 #define ASM_OUTPUT_REG_POP(FILE,REGNO) \
882 fprintf (FILE, "\tPOPW %s\n", reg_names[REGNO])
884 /* This is how to output an element of a case-vector that is absolute. */
886 #define ASM_OUTPUT_ADDR_VEC_ELT(FILE, VALUE) \
887 fprintf (FILE, "\t.word .L%d\n", VALUE)
889 /* This is how to output an element of a case-vector that is relative. */
891 #define ASM_OUTPUT_ADDR_DIFF_ELT(FILE, VALUE, REL) \
892 fprintf (FILE, "\t.word .L%d-.L%d\n", VALUE, REL)
894 /* This is how to output an assembler line
895 that says to advance the location counter
896 to a multiple of 2**LOG bytes. */
898 #define ASM_OUTPUT_ALIGN(FILE,LOG) \
899 if ((LOG) != 0) \
900 fprintf (FILE, "\t.align %d\n", 1 << (LOG))
902 /* This is how to output an assembler line
903 that says to advance the location counter by SIZE bytes. */
905 /* The `space' pseudo in the text segment outputs nop insns rather than 0s,
906 so we must output 0s explicitly in the text segment. */
908 #define ASM_OUTPUT_SKIP(FILE,SIZE) \
909 if (in_text_section ()) \
911 int i; \
912 for (i = 0; i < (SIZE) - 20; i += 20) \
913 fprintf (FILE, "\t.byte 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n"); \
914 if (i < (SIZE)) \
916 fprintf (FILE, "\t.byte 0"); \
917 i++; \
918 for (; i < (SIZE); i++) \
919 fprintf (FILE, ",0"); \
920 fprintf (FILE, "\n"); \
923 else \
924 fprintf ((FILE), "\t.set .,.+%u\n", (SIZE))
926 /* This says how to output an assembler line
927 to define a global common symbol. */
929 #define ASM_OUTPUT_COMMON(FILE, NAME, SIZE, ROUNDED) \
930 do { \
931 data_section(); \
932 fputs ("\t.comm ", (FILE)); \
933 assemble_name ((FILE), (NAME)); \
934 fprintf ((FILE), ",%u\n", (SIZE)); \
935 } while (0)
937 /* This says how to output an assembler line
938 to define a local common symbol. */
940 #define ASM_OUTPUT_LOCAL(FILE, NAME, SIZE, ROUNDED) \
941 do { \
942 data_section(); \
943 ASM_OUTPUT_ALIGN ((FILE), 2); \
944 ASM_OUTPUT_LABEL ((FILE), (NAME)); \
945 fprintf ((FILE), "\t.zero %u\n", (SIZE)); \
946 } while (0)
948 /* Store in OUTPUT a string (made with alloca) containing
949 an assembler-name for a local static variable named NAME.
950 LABELNO is an integer which is different for each call. */
952 #define ASM_FORMAT_PRIVATE_NAME(OUTPUT, NAME, LABELNO) \
953 ( (OUTPUT) = (char *) alloca (strlen ((NAME)) + 10), \
954 sprintf ((OUTPUT), "%s.%d", (NAME), (LABELNO)))
956 /* Output #ident as a .ident. */
958 #define ASM_OUTPUT_IDENT(FILE, NAME) fprintf (FILE, "\t.ident \"%s\"\n", NAME)
960 /* Define the parentheses used to group arithmetic operations
961 in assembler code. */
963 #define ASM_OPEN_PAREN "("
964 #define ASM_CLOSE_PAREN ")"
966 /* Define results of standard character escape sequences. */
967 #define TARGET_BELL 007
968 #define TARGET_BS 010
969 #define TARGET_TAB 011
970 #define TARGET_NEWLINE 012
971 #define TARGET_VT 013
972 #define TARGET_FF 014
973 #define TARGET_CR 015
975 /* Print operand X (an rtx) in assembler syntax to file FILE.
976 CODE is a letter or dot (`z' in `%z0') or 0 if no letter was specified.
977 For `%' followed by punctuation, CODE is the punctuation and X is null. */
979 #define PRINT_OPERAND_PUNCT_VALID_P(CODE) 0
981 #define PRINT_OPERAND(FILE, X, CODE) \
982 { int i; \
983 if (GET_CODE (X) == REG) \
984 fprintf (FILE, "%%%s", reg_names[REGNO (X)]); \
985 else if (GET_CODE (X) == MEM) \
986 output_address (XEXP (X, 0)); \
987 else if (GET_CODE (X) == CONST_DOUBLE && GET_MODE (X) == SFmode) \
989 union { double d; long l[2]; } dtem; \
990 union { float f; long l; } ftem; \
992 dtem.l[0] = CONST_DOUBLE_LOW (X); \
993 dtem.l[1] = CONST_DOUBLE_HIGH (X); \
994 ftem.f = dtem.d; \
995 fprintf(FILE, "&0x%lx", ftem.l); \
997 else { putc ('&', FILE); output_addr_const (FILE, X); }}
999 #define PRINT_OPERAND_ADDRESS(FILE, ADDR) \
1000 { register rtx Addr = ADDR; \
1001 rtx offset; \
1002 rtx reg; \
1003 if (GET_CODE (Addr) == MEM) { \
1004 putc ('*', FILE); \
1005 Addr = XEXP (Addr, 0); \
1006 if (GET_CODE (Addr) == REG) \
1007 putc ('0', FILE); \
1009 switch (GET_CODE (Addr)) \
1011 case REG: \
1012 fprintf (FILE, "(%%%s)", reg_names[REGNO (Addr)]); \
1013 break; \
1015 case PLUS: \
1016 offset = NULL; \
1017 if (CONSTANT_ADDRESS_P (XEXP (Addr, 0))) \
1019 offset = XEXP (Addr, 0); \
1020 Addr = XEXP (Addr, 1); \
1022 else if (CONSTANT_ADDRESS_P (XEXP (Addr, 1))) \
1024 offset = XEXP (Addr, 1); \
1025 Addr = XEXP (Addr, 0); \
1027 else \
1028 abort(); \
1029 if (REG_P (Addr)) \
1030 reg = Addr; \
1031 else \
1032 abort(); \
1033 output_addr_const(FILE, offset); \
1034 fprintf(FILE, "(%%%s)", reg_names[REGNO(reg)]); \
1035 break; \
1037 default: \
1038 if ( !CONSTANT_ADDRESS_P(Addr)) \
1039 abort(); \
1040 output_addr_const (FILE, Addr); \
1044 Local variables:
1045 version-control: t
1046 End: