1 /* Definitions of target machine for GNU compiler. AT&T we32000 version.
2 Contributed by John Wehle (john@feith1.uucp)
3 Copyright (C) 1991-1992 Free Software Foundation, Inc.
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)
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, 675 Mass Ave, Cambridge, MA 02139, USA. */
22 /* Names to predefine in the preprocessor for this target machine. */
24 #define CPP_PREDEFINES "-Dwe32000 -Du3b -Dunix"
26 /* Print subsidiary information on the compiler version in use. */
28 #define TARGET_VERSION fprintf (stderr, " (we32000)");
30 /* Run-time compilation parameters selecting different hardware subsets. */
32 extern int target_flags;
34 /* Macros used in the machine description to test the flags. */
36 /* Macro to define tables used to set the flags.
37 This is a list in braces of pairs in braces,
38 each pair being { "NAME", VALUE }
39 where VALUE is the bits to set or minus the bits to clear.
40 An empty string NAME is used to identify the default VALUE. */
42 #define TARGET_SWITCHES \
43 { { "", TARGET_DEFAULT}}
45 #define TARGET_DEFAULT 0
48 /* target machine storage layout */
50 /* Define this if most significant bit is lowest numbered
51 in instructions that operate on numbered bit-fields. */
52 #define BITS_BIG_ENDIAN 0
54 /* Define this if most significant byte of a word is the lowest numbered. */
55 /* That is true on the we32000. */
56 #define BYTES_BIG_ENDIAN 1
58 /* Define this if most significant word of a multiword is lowest numbered. */
59 /* For we32000 we can decide arbitrarily
60 since there are no machine instructions for them. */
61 #define WORDS_BIG_ENDIAN 1
63 /* number of bits in an addressible storage unit */
64 #define BITS_PER_UNIT 8
66 /* Width in bits of a "word", which is the contents of a machine register.
67 Note that this is not necessarily the width of data type `int';
68 if using 16-bit ints on a we32000, this would still be 32.
69 But on a machine with 16-bit registers, this would be 16. */
70 #define BITS_PER_WORD 32
72 /* Width of a word, in units (bytes). */
73 #define UNITS_PER_WORD 4
75 /* Width in bits of a pointer.
76 See also the macro `Pmode' defined below. */
77 #define POINTER_SIZE 32
79 /* Allocation boundary (in *bits*) for storing arguments in argument list. */
80 #define PARM_BOUNDARY 32
82 /* Boundary (in *bits*) on which stack pointer should be aligned. */
83 #define STACK_BOUNDARY 32
85 /* Allocation boundary (in *bits*) for the code of a function. */
86 #define FUNCTION_BOUNDARY 32
88 /* Alignment of field after `int : 0' in a structure. */
89 #define EMPTY_FIELD_BOUNDARY 32
91 /* No data type wants to be aligned rounder than this. */
92 #define BIGGEST_ALIGNMENT 32
94 /* Every structure's size must be a multiple of this. */
95 #define STRUCTURE_SIZE_BOUNDARY 32
97 /* Define this if move instructions will actually fail to work
98 when given unaligned data. */
99 #define STRICT_ALIGNMENT 1
101 /* Define number of bits in most basic integer type.
102 (If undefined, default is BITS_PER_WORD). */
103 #define INT_TYPE_SIZE 32
105 /* Integer bit fields should have the same size and alignment
106 as actual integers */
107 #define PCC_BITFIELD_TYPE_MATTERS 1
109 /* Standard register usage. */
111 /* Number of actual hardware registers.
112 The hardware registers are assigned numbers for the compiler
113 from 0 to just below FIRST_PSEUDO_REGISTER.
114 All registers that the compiler knows about must be given numbers,
115 even those that are not normally considered general registers. */
116 #define FIRST_PSEUDO_REGISTER 16
118 /* 1 for registers that have pervasive standard uses
119 and are not available for the register allocator. */
120 #define FIXED_REGISTERS \
121 {0, 0, 0, 0, 0, 0, 0, 0, \
122 0, 1, 1, 1, 1, 1, 1, 1, }
124 /* 1 for registers not available across function calls.
125 These must include the FIXED_REGISTERS and also any
126 registers that can be used without being saved.
127 The latter must include the registers where values are returned
128 and the register where structure-value addresses are passed.
129 Aside from that, you can include as many other registers as you like. */
130 #define CALL_USED_REGISTERS \
131 {1, 1, 1, 0, 0, 0, 0, 0, \
132 0, 1, 1, 1, 1, 1, 1, 1, }
134 /* Make sure everything's fine if we *don't* have a given processor.
135 This assumes that putting a register in fixed_regs will keep the
136 compilers mitt's completely off it. We don't bother to zero it out
137 of register classes. */
138 /* #define CONDITIONAL_REGISTER_USAGE */
140 /* Return number of consecutive hard regs needed starting at reg REGNO
141 to hold something of mode MODE.
142 This is ordinarily the length in words of a value of mode MODE
143 but can be less for certain modes in special long registers. */
144 #define HARD_REGNO_NREGS(REGNO, MODE) \
145 ((GET_MODE_SIZE (MODE) + UNITS_PER_WORD - 1) / UNITS_PER_WORD)
147 /* Value is 1 if hard register REGNO can hold a value of machine-mode MODE. */
148 #define HARD_REGNO_MODE_OK(REGNO, MODE) 1
150 /* Value is 1 if it is a good idea to tie two pseudo registers
151 when one has mode MODE1 and one has mode MODE2.
152 If HARD_REGNO_MODE_OK could produce different values for MODE1 and MODE2,
153 for any hard reg, then this must be 0 for correct output. */
154 #define MODES_TIEABLE_P(MODE1, MODE2) 0
156 /* Specify the registers used for certain standard purposes.
157 The values of these macros are register numbers. */
159 /* Register used for the program counter */
162 /* Register to use for pushing function arguments. */
163 #define STACK_POINTER_REGNUM 12
165 /* Base register for access to local variables of the function. */
166 #define FRAME_POINTER_REGNUM 9
168 /* Value should be nonzero if functions must have frame pointers.
169 Zero means the frame pointer need not be set up (and parms
170 may be accessed via the stack pointer) in functions that seem suitable.
171 This is computed in `reload', in reload1.c. */
172 #define FRAME_POINTER_REQUIRED 1
174 /* Base register for access to arguments of the function. */
175 #define ARG_POINTER_REGNUM 10
177 /* Register in which static-chain is passed to a function. */
178 #define STATIC_CHAIN_REGNUM 8
180 /* Register in which address to store a structure value
181 is passed to a function. */
182 #define STRUCT_VALUE_REGNUM 2
184 /* Order in which to allocate registers. */
185 #define REG_ALLOC_ORDER \
186 {0, 1, 8, 7, 6, 5, 4, 3}
188 /* Define the classes of registers for register constraints in the
189 machine description. Also define ranges of constants.
191 One of the classes must always be named ALL_REGS and include all hard regs.
192 If there is more than one class, another class must be named NO_REGS
193 and contain no registers.
195 The name GENERAL_REGS must be the name of a class (or an alias for
196 another name such as ALL_REGS). This is the class of registers
197 that is allowed by "g" or "r" in a register constraint.
198 Also, registers outside this class are allocated only when
199 instructions express preferences for them.
201 The classes must be numbered in nondecreasing order; that is,
202 a larger-numbered class must never be contained completely
203 in a smaller-numbered class.
205 For any two classes, it is very desirable that there be another
206 class that represents their union. */
208 enum reg_class { NO_REGS, GENERAL_REGS,
209 ALL_REGS, LIM_REG_CLASSES };
211 #define N_REG_CLASSES (int) LIM_REG_CLASSES
213 /* Give names of register classes as strings for dump file. */
215 #define REG_CLASS_NAMES \
216 { "NO_REGS", "GENERAL_REGS", "ALL_REGS" }
218 /* Define which registers fit in which classes.
219 This is an initializer for a vector of HARD_REG_SET
220 of length N_REG_CLASSES. */
222 #define REG_CLASS_CONTENTS \
225 0x000017ff, /* GENERAL_REGS */ \
226 0x0000ffff, /* ALL_REGS */ \
229 /* The same information, inverted:
230 Return the class number of the smallest class containing
231 reg number REGNO. This could be a conditional expression
232 or could index an array. */
234 #define REGNO_REG_CLASS(REGNO) \
235 (((REGNO) < 11 || (REGNO) == 12) ? GENERAL_REGS : ALL_REGS)
237 /* The class value for index registers, and the one for base regs. */
239 #define INDEX_REG_CLASS NO_REGS
240 #define BASE_REG_CLASS GENERAL_REGS
242 /* Get reg_class from a letter such as appears in the machine description.
243 We do a trick here to modify the effective constraints on the
244 machine description; we zorch the constraint letters that aren't
245 appropriate for a specific target. This allows us to guarantee
246 that a specific kind of register will not be used for a given target
247 without fiddling with the register classes above. */
249 #define REG_CLASS_FROM_LETTER(C) \
250 ((C) == 'r' ? GENERAL_REGS : NO_REGS)
252 /* The letters I, J, K, L and M in a register constraint string
253 can be used to stand for particular ranges of immediate operands.
254 This macro defines what the ranges are.
255 C is the letter, and VALUE is a constant value.
256 Return 1 if VALUE is in the range specified by C. */
258 #define CONST_OK_FOR_LETTER_P(VALUE, C) 0
263 #define CONST_DOUBLE_OK_FOR_LETTER_P(VALUE, C) 0
265 /* Given an rtx X being reloaded into a reg required to be
266 in class CLASS, return the class of reg to actually use.
267 In general this is just CLASS; but on some machines
268 in some cases it is preferable to use a more restrictive class. */
270 #define PREFERRED_RELOAD_CLASS(X,CLASS) (CLASS)
272 /* Return the maximum number of consecutive registers
273 needed to represent mode MODE in a register of class CLASS. */
274 #define CLASS_MAX_NREGS(CLASS, MODE) \
275 ((GET_MODE_SIZE (MODE) + UNITS_PER_WORD - 1) / UNITS_PER_WORD)
277 /* Stack layout; function entry, exit and calling. */
279 /* Define this if pushing a word on the stack
280 makes the stack pointer a smaller address. */
281 /* #define STACK_GROWS_DOWNWARD */
283 /* Define this if the nominal address of the stack frame
284 is at the high-address end of the local variables;
285 that is, each additional local variable allocated
286 goes at a more negative offset in the frame. */
287 /* #define FRAME_GROWS_DOWNWARD */
289 /* Offset within stack frame to start allocating local variables at.
290 If FRAME_GROWS_DOWNWARD, this is the offset to the END of the
291 first local allocated. Otherwise, it is the offset to the BEGINNING
292 of the first local allocated. */
293 #define STARTING_FRAME_OFFSET 0
295 /* If we generate an insn to push BYTES bytes,
296 this says how many the stack pointer really advances by. */
297 #define PUSH_ROUNDING(BYTES) (((BYTES) + 3) & ~3)
299 /* Offset of first parameter from the argument pointer register value. */
300 #define FIRST_PARM_OFFSET(FNDECL) 0
302 /* Value is 1 if returning from a function call automatically
303 pops the arguments described by the number-of-args field in the call.
304 FUNTYPE is the data type of the function (as a tree),
305 or for a library call it is an identifier node for the subroutine name. */
307 #define RETURN_POPS_ARGS(FUNTYPE,SIZE) (SIZE)
309 /* Define how to find the value returned by a function.
310 VALTYPE is the data type of the value (as a tree).
311 If the precise function being called is known, FUNC is its FUNCTION_DECL;
312 otherwise, FUNC is 0. */
314 /* On the we32000 the return value is in r0 regardless. */
316 #define FUNCTION_VALUE(VALTYPE, FUNC) \
317 gen_rtx (REG, TYPE_MODE (VALTYPE), 0)
319 /* Define how to find the value returned by a library function
320 assuming the value has mode MODE. */
322 /* On the we32000 the return value is in r0 regardless. */
324 #define LIBCALL_VALUE(MODE) gen_rtx (REG, MODE, 0)
326 /* 1 if N is a possible register number for a function value.
327 On the we32000, r0 is the only register thus used. */
329 #define FUNCTION_VALUE_REGNO_P(N) ((N) == 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 function argument passing.
337 On the we32000, no registers are used in this way. */
339 #define FUNCTION_ARG_REGNO_P(N) 0
341 /* Define a data type for recording info about an argument list
342 during the scan of that argument list. This data type should
343 hold all necessary information about the function itself
344 and about the args processed so far, enough to enable macros
345 such as FUNCTION_ARG to determine where the next arg should go.
347 On the we32k, this is a single integer, which is a number of bytes
348 of arguments scanned so far. */
350 #define CUMULATIVE_ARGS int
352 /* Initialize a variable CUM of type CUMULATIVE_ARGS
353 for a call to a function whose data type is FNTYPE.
354 For a library call, FNTYPE is 0.
356 On the we32k, the offset starts at 0. */
358 #define INIT_CUMULATIVE_ARGS(CUM,FNTYPE,LIBNAME) \
361 /* Update the data in CUM to advance over an argument
362 of mode MODE and data type TYPE.
363 (TYPE is null for libcalls where that information may not be available.) */
365 #define FUNCTION_ARG_ADVANCE(CUM, MODE, TYPE, NAMED) \
366 ((CUM) += ((MODE) != BLKmode \
367 ? (GET_MODE_SIZE (MODE) + 3) & ~3 \
368 : (int_size_in_bytes (TYPE) + 3) & ~3))
370 /* Define where to put the arguments to a function.
371 Value is zero to push the argument on the stack,
372 or a hard register in which to store the argument.
374 MODE is the argument's machine mode.
375 TYPE is the data type of the argument (as a tree).
376 This is null for libcalls where that information may
378 CUM is a variable of type CUMULATIVE_ARGS which gives info about
379 the preceding args and about the function being called.
380 NAMED is nonzero if this argument is a named parameter
381 (otherwise it is an extra parameter matching an ellipsis). */
383 /* On the we32000 all args are pushed */
385 #define FUNCTION_ARG(CUM, MODE, TYPE, NAMED) 0
387 /* For an arg passed partly in registers and partly in memory,
388 this is the number of registers used.
389 For args passed entirely in registers or entirely in memory, zero. */
391 #define FUNCTION_ARG_PARTIAL_NREGS(CUM, MODE, TYPE, NAMED) 0
393 /* This macro generates the assembly code for function entry.
394 FILE is a stdio stream to output the code to.
395 SIZE is an int: how many units of temporary storage to allocate.
396 Refer to the array `regs_ever_live' to determine which registers
397 to save; `regs_ever_live[I]' is nonzero if register number I
398 is ever used in the function. This macro is responsible for
399 knowing which registers should not be saved even if used. */
401 #define FUNCTION_PROLOGUE(FILE, SIZE) \
402 { register int nregs_to_save; \
403 register int regno; \
404 extern char call_used_regs[]; \
406 for (regno = 8; regno > 2; regno--) \
407 if (regs_ever_live[regno] && ! call_used_regs[regno]) \
408 nregs_to_save = (9 - regno); \
409 fprintf (FILE, "\tsave &%d\n", nregs_to_save); \
411 fprintf (FILE, "\taddw2 &%d,%%sp\n", ((SIZE) + 3) & ~3); }
413 /* Output assembler code to FILE to increment profiler label # LABELNO
414 for profiling a function entry. */
416 #define FUNCTION_PROFILER(FILE, LABELNO) \
417 fprintf (FILE, "\tmovw &.LP%d,%%r0\n\tjsb _mcount\n", (LABELNO))
419 /* Output assembler code to FILE to initialize this source file's
420 basic block profiling info, if that has not already been done. */
422 #define FUNCTION_BLOCK_PROFILER(FILE, LABELNO) \
423 fprintf (FILE, "\tcmpw .LPBX0,&0\n\tjne .LPI%d\n\tpushw &.LPBX0\n\tcall &1,__bb_init_func\n.LPI%d:\n", \
426 /* Output assembler code to FILE to increment the entry-count for
427 the BLOCKNO'th basic block in this source file. */
429 #define BLOCK_PROFILER(FILE, BLOCKNO) \
430 fprintf (FILE, "\taddw2 &1,.LPBX2+%d\n", 4 * BLOCKNO)
432 /* EXIT_IGNORE_STACK should be nonzero if, when returning from a function,
433 the stack pointer does not matter. The value is tested only in
434 functions that have frame pointers.
435 No definition is equivalent to always zero. */
437 #define EXIT_IGNORE_STACK 0
439 /* This macro generates the assembly code for function exit,
440 on machines that need it. If FUNCTION_EPILOGUE is not defined
441 then individual return instructions are generated for each
442 return statement. Args are same as for FUNCTION_PROLOGUE.
444 The function epilogue should not depend on the current stack pointer!
445 It should use the frame pointer only. This is mandatory because
446 of alloca; we also take advantage of it to omit stack adjustments
449 #define FUNCTION_EPILOGUE(FILE, SIZE) \
450 { register int nregs_to_restore; \
451 register int regno; \
452 extern char call_used_regs[]; \
453 nregs_to_restore = 0; \
454 for (regno = 8; regno > 2; regno--) \
455 if (regs_ever_live[regno] && ! call_used_regs[regno]) \
456 nregs_to_restore = (9 - regno); \
457 fprintf (FILE, "\tret &%d\n", nregs_to_restore); }
459 /* Store in the variable DEPTH the initial difference between the
460 frame pointer reg contents and the stack pointer reg contents,
461 as of the start of the function body. This depends on the layout
462 of the fixed parts of the stack frame and on how registers are saved.
464 On the we32k, FRAME_POINTER_REQUIRED is always 1, so the definition of this
465 macro doesn't matter. But it must be defined. */
467 #define INITIAL_FRAME_POINTER_OFFSET(DEPTH) (DEPTH) = 0;
469 /* Output assembler code for a block containing the constant parts
470 of a trampoline, leaving space for the variable parts. */
472 /* On the we32k, the trampoline contains two instructions:
476 #define TRAMPOLINE_TEMPLATE(FILE) \
478 ASM_OUTPUT_SHORT (FILE, gen_rtx (CONST_INT, VOIDmode, 0x844f)); \
479 ASM_OUTPUT_SHORT (FILE, const0_rtx); \
480 ASM_OUTPUT_SHORT (FILE, const0_rtx); \
481 ASM_OUTPUT_CHAR (FILE, gen_rtx (CONST_INT, VOIDmode, 0x48)); \
482 ASM_OUTPUT_SHORT (FILE, gen_rtx (CONST_INT, VOIDmode, 0x247f)); \
483 ASM_OUTPUT_SHORT (FILE, const0_rtx); \
484 ASM_OUTPUT_SHORT (FILE, const0_rtx); \
487 /* Length in units of the trampoline for entering a nested function. */
489 #define TRAMPOLINE_SIZE 13
491 /* Emit RTL insns to initialize the variable parts of a trampoline.
492 FNADDR is an RTX for the address of the function's pure code.
493 CXT is an RTX for the static chain value for the function. */
495 #define INITIALIZE_TRAMPOLINE(TRAMP, FNADDR, CXT) \
497 emit_move_insn (gen_rtx (MEM, SImode, plus_constant (TRAMP, 2)), CXT); \
498 emit_move_insn (gen_rtx (MEM, SImode, plus_constant (TRAMP, 9)), FNADDR); \
501 /* Generate calls to memcpy() and memset() rather
502 than bcopy() and bzero() */
503 #define TARGET_MEM_FUNCTIONS
505 /* Addressing modes, and classification of registers for them. */
507 /* #define HAVE_POST_INCREMENT */
508 /* #define HAVE_POST_DECREMENT */
510 /* #define HAVE_PRE_DECREMENT */
511 /* #define HAVE_PRE_INCREMENT */
513 /* Macros to check register numbers against specific register classes. */
515 /* These assume that REGNO is a hard or pseudo reg number.
516 They give nonzero only if REGNO is a hard reg of the suitable class
517 or a pseudo reg currently allocated to a suitable hard reg.
518 Since they use reg_renumber, they are safe only once reg_renumber
519 has been allocated, which happens in local-alloc.c. */
521 #define REGNO_OK_FOR_INDEX_P(REGNO) 0
523 #define REGNO_OK_FOR_BASE_P(REGNO) \
524 ((REGNO) < 11 || (REGNO) == 12 || \
525 (unsigned)reg_renumber[REGNO] < 11 || (unsigned)reg_renumber[REGNO] == 12)
527 /* Maximum number of registers that can appear in a valid memory address. */
529 #define MAX_REGS_PER_ADDRESS 1
531 /* Recognize any constant value that is a valid address. */
533 #define CONSTANT_ADDRESS_P(X) CONSTANT_P(X)
535 /* Nonzero if the constant value X is a legitimate general operand.
536 It is given that X satisfies CONSTANT_P or is a CONST_DOUBLE. */
538 #define LEGITIMATE_CONSTANT_P(X) 1
540 /* The macros REG_OK_FOR..._P assume that the arg is a REG rtx
541 and check its validity for a certain class.
542 We have two alternate definitions for each of them.
543 The usual definition accepts all pseudo regs; the other rejects
544 them unless they have been allocated suitable hard regs.
545 The symbol REG_OK_STRICT causes the latter definition to be used.
547 Most source files want to accept pseudo regs in the hope that
548 they will get allocated to the class that the insn wants them to be in.
549 Source files for reload pass need to be strict.
550 After reload, it makes no difference, since pseudo regs have
551 been eliminated by then. */
553 #ifndef REG_OK_STRICT
555 /* Nonzero if X is a hard reg that can be used as an index
556 or if it is a pseudo reg. */
557 #define REG_OK_FOR_INDEX_P(X) 0
559 /* Nonzero if X is a hard reg that can be used as a base reg
560 or if it is a pseudo reg. */
561 #define REG_OK_FOR_BASE_P(X) \
562 (REGNO(X) < 11 || REGNO(X) == 12 || REGNO(X) >= FIRST_PSEUDO_REGISTER)
566 /* Nonzero if X is a hard reg that can be used as an index. */
567 #define REG_OK_FOR_INDEX_P(X) REGNO_OK_FOR_INDEX_P (REGNO (X))
568 /* Nonzero if X is a hard reg that can be used as a base reg. */
569 #define REG_OK_FOR_BASE_P(X) REGNO_OK_FOR_BASE_P (REGNO (X))
573 /* GO_IF_LEGITIMATE_ADDRESS recognizes an RTL expression
574 that is a valid memory address for an instruction.
575 The MODE argument is the machine mode for the MEM expression
576 that wants to use this address. */
578 #define GO_IF_LEGITIMATE_ADDRESS(MODE, X, LABEL) \
579 { register rtx Addr = X; \
580 if (REG_P(Addr) && REG_OK_FOR_BASE_P(Addr)) \
582 if (CONSTANT_ADDRESS_P(Addr)) \
584 if (GET_CODE(Addr) == PLUS && \
585 ((REG_P(XEXP(Addr, 0)) && REG_OK_FOR_BASE_P(XEXP(Addr, 0)) && \
586 CONSTANT_ADDRESS_P(XEXP(Addr, 1))) || \
587 (REG_P(XEXP(Addr, 1)) && REG_OK_FOR_BASE_P(XEXP(Addr, 1)) && \
588 CONSTANT_ADDRESS_P(XEXP(Addr, 0))))) \
592 /* Try machine-dependent ways of modifying an illegitimate address
593 to be legitimate. If we find one, return the new, valid address.
594 This macro is used in only one place: `memory_address' in explow.c.
596 OLDX is the address as it was before break_out_memory_refs was called.
597 In some cases it is useful to look at this to decide what needs to be done.
599 MODE and WIN are passed so that this macro can use
600 GO_IF_LEGITIMATE_ADDRESS.
602 It is always safe for this macro to do nothing. It exists to recognize
603 opportunities to optimize the output. */
605 #define LEGITIMIZE_ADDRESS(X,OLDX,MODE,WIN) { }
607 /* Go to LABEL if ADDR (a legitimate address expression)
608 has an effect that depends on the machine mode it is used for. */
610 #define GO_IF_MODE_DEPENDENT_ADDRESS(ADDR,LABEL) { }
612 /* Specify the machine mode that this machine uses
613 for the index in the tablejump instruction. */
614 #define CASE_VECTOR_MODE SImode
616 /* Define this if the tablejump instruction expects the table
617 to contain offsets from the address of the table.
618 Do not define this if the table should contain absolute addresses. */
619 /* #define CASE_VECTOR_PC_RELATIVE */
621 /* Specify the tree operation to be used to convert reals to integers. */
622 #define IMPLICIT_FIX_EXPR FIX_ROUND_EXPR
624 /* This is the kind of divide that is easiest to do in the general case. */
625 #define EASY_DIV_EXPR TRUNC_DIV_EXPR
627 /* Define this as 1 if `char' should by default be signed; else as 0. */
628 #define DEFAULT_SIGNED_CHAR 0
630 /* Max number of bytes we can move from memory to memory
631 in one reasonably fast instruction. */
634 /* Define this if zero-extension is slow (more than one real instruction). */
635 /* #define SLOW_ZERO_EXTEND */
637 /* Nonzero if access to memory by bytes is slow and undesirable. */
638 #define SLOW_BYTE_ACCESS 0
640 /* Define if shifts truncate the shift count
641 which implies one can omit a sign-extension or zero-extension
643 #define SHIFT_COUNT_TRUNCATED
645 /* Value is 1 if truncating an integer of INPREC bits to OUTPREC bits
646 is done just by pretending it is already truncated. */
647 #define TRULY_NOOP_TRUNCATION(OUTPREC, INPREC) 1
649 /* We assume that the store-condition-codes instructions store 0 for false
650 and some other value for true. This is the value stored for true. */
652 #define STORE_FLAG_VALUE -1
654 /* When a prototype says `char' or `short', really pass an `int'. */
655 #define PROMOTE_PROTOTYPES
657 /* Specify the machine mode that pointers have.
658 After generation of rtl, the compiler makes no further distinction
659 between pointers and any other objects of this machine mode. */
662 /* A function address in a call instruction
663 is a byte address (for indexing purposes)
664 so give the MEM rtx a byte's mode. */
665 #define FUNCTION_MODE QImode
667 /* Compute the cost of computing a constant rtl expression RTX
668 whose rtx-code is CODE. The body of this macro is a portion
669 of a switch statement. If the code is computed here,
670 return it with a return statement. Otherwise, break from the switch. */
672 #define CONST_COSTS(RTX,CODE, OUTER_CODE) \
674 if ((unsigned) INTVAL (RTX) < 077) return 1; \
682 /* Tell final.c how to eliminate redundant test instructions. */
684 /* Here we define machine-dependent flags and fields in cc_status
685 (see `conditions.h'). */
687 #define NOTICE_UPDATE_CC(EXP, INSN) \
689 { CC_STATUS_INIT; } \
692 /* Control the assembler format that we output. */
694 /* Use crt1.o as a startup file and crtn.o as a closing file. */
696 #define STARTFILE_SPEC "%{pg:gcrt1.o%s}%{!pg:%{p:mcrt1.o%s}%{!p:crt1.o%s}}"
698 #define ENDFILE_SPEC "crtn.o%s"
700 /* The .file command should always begin the output. */
702 #define ASM_FILE_START(FILE) output_file_directive ((FILE), main_input_filename)
704 /* Output to assembler file text saying following lines
705 may contain character constants, extra white space, comments, etc. */
707 #define ASM_APP_ON "#APP\n"
709 /* Output to assembler file text saying following lines
710 no longer contain unusual constructs. */
712 #define ASM_APP_OFF "#NO_APP\n"
714 /* Output before code. */
716 #define TEXT_SECTION_ASM_OP ".text"
718 /* Output before writable data. */
720 #define DATA_SECTION_ASM_OP ".data"
722 /* Read-only data goes in the data section because
723 AT&T's assembler doesn't guarantee the proper alignment
724 of data in the text section even if an align statement
727 #define READONLY_DATA_SECTION() data_section()
729 /* How to refer to registers in assembler output.
730 This sequence is indexed by compiler's hard-register-number (see above). */
732 #define REGISTER_NAMES \
733 {"r0", "r1", "r2", "r3", "r4", "r5", "r6", "r7", \
734 "r8", "fp", "ap", "psw", "sp", "pcbp", "isp", "pc" }
736 /* How to renumber registers for dbx and gdb. */
738 #define DBX_REGISTER_NUMBER(REGNO) (REGNO)
740 /* Output SDB debugging info in response to the -g option. */
742 #define SDB_DEBUGGING_INFO
744 /* This is how to output the definition of a user-level label named NAME,
745 such as the label on a static function or variable NAME. */
747 #define ASM_OUTPUT_LABEL(FILE,NAME) \
748 do { assemble_name (FILE, NAME); fputs (":\n", FILE); } while (0)
750 /* This is how to output a command to make the user-level label named NAME
751 defined for reference from other files. */
753 #define ASM_GLOBALIZE_LABEL(FILE,NAME) \
755 fputs (".globl ", FILE); \
756 assemble_name (FILE, NAME); \
757 fputs ("\n", FILE); \
760 /* This is how to output a reference to a user-level label named NAME.
761 `assemble_name' uses this. */
763 #define ASM_OUTPUT_LABELREF(FILE,NAME) \
764 fprintf (FILE, "%s", NAME)
766 /* This is how to output an internal numbered label where
767 PREFIX is the class of label and NUM is the number within the class. */
769 #define ASM_OUTPUT_INTERNAL_LABEL(FILE,PREFIX,NUM) \
770 fprintf (FILE, ".%s%d:\n", PREFIX, NUM)
772 /* This is how to store into the string LABEL
773 the symbol_ref name of an internal numbered label where
774 PREFIX is the class of label and NUM is the number within the class.
775 This is suitable for output with `assemble_name'. */
777 #define ASM_GENERATE_INTERNAL_LABEL(LABEL,PREFIX,NUM) \
778 sprintf (LABEL, ".%s%d", PREFIX, NUM)
780 /* This is how to output an internal numbered label which
781 labels a jump table. */
783 #define ASM_OUTPUT_CASE_LABEL(FILE,PREFIX,NUM,TABLE) \
785 ASM_OUTPUT_ALIGN (FILE, 2); \
786 ASM_OUTPUT_INTERNAL_LABEL (FILE, PREFIX, NUM); \
789 /* Assembler pseudo to introduce byte constants. */
791 #define ASM_BYTE_OP "\t.byte"
793 /* This is how to output an assembler line defining a `double' constant. */
795 /* This is how to output an assembler line defining a `float' constant. */
797 /* AT&T's assembler can't handle floating constants written as floating.
798 However, when cross-compiling, always use that in case format differs. */
800 #ifdef CROSS_COMPILER
802 #define ASM_OUTPUT_DOUBLE(FILE,VALUE) \
803 fprintf (FILE, "\t.double 0r%.20g\n", (VALUE))
805 #define ASM_OUTPUT_FLOAT(FILE,VALUE) \
806 fprintf (FILE, "\t.float 0r%.10g\n", (VALUE))
810 #define ASM_OUTPUT_DOUBLE(FILE,VALUE) \
811 do { union { double d; long l[2];} tem; \
813 fprintf (FILE, "\t.word 0x%x, 0x%x\n", tem.l[0], tem.l[1]);\
816 #define ASM_OUTPUT_FLOAT(FILE,VALUE) \
817 do { union { float f; long l;} tem; \
819 fprintf (FILE, "\t.word 0x%x\n", tem.l); \
822 #endif /* not CROSS_COMPILER */
824 /* This is how to output an assembler line defining an `int' constant. */
826 #define ASM_OUTPUT_INT(FILE,VALUE) \
827 ( fprintf (FILE, "\t.word "), \
828 output_addr_const (FILE, (VALUE)), \
829 fprintf (FILE, "\n"))
831 /* Likewise for `char' and `short' constants. */
833 #define ASM_OUTPUT_SHORT(FILE,VALUE) \
834 ( fprintf (FILE, "\t.half "), \
835 output_addr_const (FILE, (VALUE)), \
836 fprintf (FILE, "\n"))
838 #define ASM_OUTPUT_CHAR(FILE,VALUE) \
839 ( fprintf (FILE, "\t.byte "), \
840 output_addr_const (FILE, (VALUE)), \
841 fprintf (FILE, "\n"))
843 /* This is how to output an assembler line for a numeric constant byte. */
845 #define ASM_OUTPUT_BYTE(FILE,VALUE) \
846 fprintf (FILE, "\t.byte 0x%x\n", (VALUE))
848 #define ASM_OUTPUT_ASCII(FILE,PTR,LEN) \
852 for (i = 0, s = (PTR); i < (LEN); s++, i++) \
855 fprintf ((FILE),"%s\t.byte\t",(i?"\n":"")); \
856 fprintf ((FILE), "%s0x%x", (i%8?",":""), (unsigned)*s); \
858 fputs ("\n", (FILE)); \
861 /* This is how to output an insn to push a register on the stack.
862 It need not be very fast code. */
864 #define ASM_OUTPUT_REG_PUSH(FILE,REGNO) \
865 fprintf (FILE, "\tpushw %s\n", reg_names[REGNO])
867 /* This is how to output an insn to pop a register from the stack.
868 It need not be very fast code. */
870 #define ASM_OUTPUT_REG_POP(FILE,REGNO) \
871 fprintf (FILE, "\tPOPW %s\n", reg_names[REGNO])
873 /* This is how to output an element of a case-vector that is absolute. */
875 #define ASM_OUTPUT_ADDR_VEC_ELT(FILE, VALUE) \
876 fprintf (FILE, "\t.word .L%d\n", VALUE)
878 /* This is how to output an element of a case-vector that is relative. */
880 #define ASM_OUTPUT_ADDR_DIFF_ELT(FILE, VALUE, REL) \
881 fprintf (FILE, "\t.word .L%d-.L%d\n", VALUE, REL)
883 /* This is how to output an assembler line
884 that says to advance the location counter
885 to a multiple of 2**LOG bytes. */
887 #define ASM_OUTPUT_ALIGN(FILE,LOG) \
889 fprintf (FILE, "\t.align %d\n", 1 << (LOG))
891 /* This is how to output an assembler line
892 that says to advance the location counter by SIZE bytes. */
894 /* The `space' pseudo in the text segment outputs nop insns rather than 0s,
895 so we must output 0s explicitly in the text segment. */
897 #define ASM_OUTPUT_SKIP(FILE,SIZE) \
898 if (in_text_section ()) \
901 for (i = 0; i < (SIZE) - 20; i += 20) \
902 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"); \
905 fprintf (FILE, "\t.byte 0"); \
907 for (; i < (SIZE); i++) \
908 fprintf (FILE, ",0"); \
909 fprintf (FILE, "\n"); \
913 fprintf ((FILE), "\t.set .,.+%u\n", (SIZE))
915 /* This says how to output an assembler line
916 to define a global common symbol. */
918 #define ASM_OUTPUT_COMMON(FILE, NAME, SIZE, ROUNDED) \
921 fputs ("\t.comm ", (FILE)); \
922 assemble_name ((FILE), (NAME)); \
923 fprintf ((FILE), ",%u\n", (SIZE)); \
926 /* This says how to output an assembler line
927 to define a local common symbol. */
929 #define ASM_OUTPUT_LOCAL(FILE, NAME, SIZE, ROUNDED) \
932 ASM_OUTPUT_ALIGN ((FILE), 2); \
933 ASM_OUTPUT_LABEL ((FILE), (NAME)); \
934 fprintf ((FILE), "\t.zero %u\n", (SIZE)); \
937 /* Store in OUTPUT a string (made with alloca) containing
938 an assembler-name for a local static variable named NAME.
939 LABELNO is an integer which is different for each call. */
941 #define ASM_FORMAT_PRIVATE_NAME(OUTPUT, NAME, LABELNO) \
942 ( (OUTPUT) = (char *) alloca (strlen ((NAME)) + 10), \
943 sprintf ((OUTPUT), "%s.%d", (NAME), (LABELNO)))
945 /* Output #ident as a .ident. */
947 #define ASM_OUTPUT_IDENT(FILE, NAME) fprintf (FILE, "\t.ident \"%s\"\n", NAME)
949 /* Define the parentheses used to group arithmetic operations
950 in assembler code. */
952 #define ASM_OPEN_PAREN "("
953 #define ASM_CLOSE_PAREN ")"
955 /* Define results of standard character escape sequences. */
956 #define TARGET_BELL 007
957 #define TARGET_BS 010
958 #define TARGET_TAB 011
959 #define TARGET_NEWLINE 012
960 #define TARGET_VT 013
961 #define TARGET_FF 014
962 #define TARGET_CR 015
964 /* Print operand X (an rtx) in assembler syntax to file FILE.
965 CODE is a letter or dot (`z' in `%z0') or 0 if no letter was specified.
966 For `%' followed by punctuation, CODE is the punctuation and X is null. */
968 #define PRINT_OPERAND_PUNCT_VALID_P(CODE) 0
970 #define PRINT_OPERAND(FILE, X, CODE) \
972 if (GET_CODE (X) == REG) \
973 fprintf (FILE, "%%%s", reg_names[REGNO (X)]); \
974 else if (GET_CODE (X) == MEM) \
975 output_address (XEXP (X, 0)); \
976 else if (GET_CODE (X) == CONST_DOUBLE && GET_MODE (X) == SFmode) \
978 union { double d; long l[2]; } dtem; \
979 union { float f; long l; } ftem; \
981 dtem.l[0] = CONST_DOUBLE_LOW (X); \
982 dtem.l[1] = CONST_DOUBLE_HIGH (X); \
984 fprintf(FILE, "&0x%lx", ftem.l); \
986 else { putc ('&', FILE); output_addr_const (FILE, X); }}
988 #define PRINT_OPERAND_ADDRESS(FILE, ADDR) \
989 { register rtx Addr = ADDR; \
992 if (GET_CODE (Addr) == MEM) { \
994 Addr = XEXP (Addr, 0); \
995 if (GET_CODE (Addr) == REG) \
998 switch (GET_CODE (Addr)) \
1001 fprintf (FILE, "(%%%s)", reg_names[REGNO (Addr)]); \
1006 if (CONSTANT_ADDRESS_P (XEXP (Addr, 0))) \
1008 offset = XEXP (Addr, 0); \
1009 Addr = XEXP (Addr, 1); \
1011 else if (CONSTANT_ADDRESS_P (XEXP (Addr, 1))) \
1013 offset = XEXP (Addr, 1); \
1014 Addr = XEXP (Addr, 0); \
1022 output_addr_const(FILE, offset); \
1023 fprintf(FILE, "(%%%s)", reg_names[REGNO(reg)]); \
1027 if ( !CONSTANT_ADDRESS_P(Addr)) \
1029 output_addr_const (FILE, Addr); \