* varasm.c (assemble_real): Use REAL_VALUE_TO_x and assemble_integer
[official-gcc.git] / gcc / config / we32k / we32k.h
blob094c9c3b9294bbd31f3e3864a1bc40dec7dff4f6
1 /* Definitions of target machine for GNU compiler. AT&T we32000 version.
2 Copyright (C) 1991, 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000
3 Free Software Foundation, Inc.
4 Contributed by John Wehle (john@feith1.uucp)
6 This file is part of GNU CC.
8 GNU CC is free software; you can redistribute it and/or modify
9 it under the terms of the GNU General Public License as published by
10 the Free Software Foundation; either version 2, or (at your option)
11 any later version.
13 GNU CC is distributed in the hope that it will be useful,
14 but WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 GNU General Public License for more details.
18 You should have received a copy of the GNU General Public License
19 along with GNU CC; see the file COPYING. If not, write to
20 the Free Software Foundation, 59 Temple Place - Suite 330,
21 Boston, MA 02111-1307, USA. */
24 /* Names to predefine in the preprocessor for this target machine. */
26 #define CPP_PREDEFINES "-Dwe32000 -Du3b2 -Dunix -Asystem=unix -Acpu=we32000 -Amachine=we32000"
28 /* Print subsidiary information on the compiler version in use. */
30 #define TARGET_VERSION fprintf (stderr, " (we32000)");
32 /* Run-time compilation parameters selecting different hardware subsets. */
34 extern int target_flags;
36 /* Macros used in the machine description to test the flags. */
38 /* Macro to define tables used to set the flags.
39 This is a list in braces of pairs in braces,
40 each pair being { "NAME", VALUE }
41 where VALUE is the bits to set or minus the bits to clear.
42 An empty string NAME is used to identify the default VALUE. */
44 #define TARGET_SWITCHES \
45 { { "", TARGET_DEFAULT, 0}}
47 #define TARGET_DEFAULT 0
50 /* target machine storage layout */
52 /* Define this if most significant bit is lowest numbered
53 in instructions that operate on numbered bit-fields. */
54 #define BITS_BIG_ENDIAN 0
56 /* Define this if most significant byte of a word is the lowest numbered. */
57 /* That is true on the we32000. */
58 #define BYTES_BIG_ENDIAN 1
60 /* Define this if most significant word of a multiword is lowest numbered. */
61 /* For we32000 we can decide arbitrarily
62 since there are no machine instructions for them. */
63 #define WORDS_BIG_ENDIAN 1
65 /* number of bits in an addressable storage unit */
66 #define BITS_PER_UNIT 8
68 /* Width in bits of a "word", which is the contents of a machine register.
69 Note that this is not necessarily the width of data type `int';
70 if using 16-bit ints on a we32000, this would still be 32.
71 But on a machine with 16-bit registers, this would be 16. */
72 #define BITS_PER_WORD 32
74 /* Width of a word, in units (bytes). */
75 #define UNITS_PER_WORD 4
77 /* Width in bits of a pointer.
78 See also the macro `Pmode' defined below. */
79 #define POINTER_SIZE 32
81 /* Allocation boundary (in *bits*) for storing arguments in argument list. */
82 #define PARM_BOUNDARY 32
84 /* Boundary (in *bits*) on which stack pointer should be aligned. */
85 #define STACK_BOUNDARY 32
87 /* Allocation boundary (in *bits*) for the code of a function. */
88 #define FUNCTION_BOUNDARY 32
90 /* Alignment of field after `int : 0' in a structure. */
91 #define EMPTY_FIELD_BOUNDARY 32
93 /* No data type wants to be aligned rounder than this. */
94 #define BIGGEST_ALIGNMENT 32
96 /* Every structure's size must be a multiple of this. */
97 #define STRUCTURE_SIZE_BOUNDARY 32
99 /* Define this if move instructions will actually fail to work
100 when given unaligned data. */
101 #define STRICT_ALIGNMENT 1
103 /* Define number of bits in most basic integer type.
104 (If undefined, default is BITS_PER_WORD). */
105 #define INT_TYPE_SIZE 32
107 /* Integer bit fields should have the same size and alignment
108 as actual integers */
109 #define PCC_BITFIELD_TYPE_MATTERS 1
111 /* Specify the size_t type. */
112 #define SIZE_TYPE "unsigned int"
114 /* Standard register usage. */
116 /* Number of actual hardware registers.
117 The hardware registers are assigned numbers for the compiler
118 from 0 to just below FIRST_PSEUDO_REGISTER.
119 All registers that the compiler knows about must be given numbers,
120 even those that are not normally considered general registers. */
121 #define FIRST_PSEUDO_REGISTER 16
123 /* 1 for registers that have pervasive standard uses
124 and are not available for the register allocator. */
125 #define FIXED_REGISTERS \
126 {0, 0, 0, 0, 0, 0, 0, 0, \
127 0, 1, 1, 1, 1, 1, 1, 1, }
129 /* 1 for registers not available across function calls.
130 These must include the FIXED_REGISTERS and also any
131 registers that can be used without being saved.
132 The latter must include the registers where values are returned
133 and the register where structure-value addresses are passed.
134 Aside from that, you can include as many other registers as you like. */
135 #define CALL_USED_REGISTERS \
136 {1, 1, 1, 0, 0, 0, 0, 0, \
137 0, 1, 1, 1, 1, 1, 1, 1, }
139 /* Make sure everything's fine if we *don't* have a given processor.
140 This assumes that putting a register in fixed_regs will keep the
141 compilers mitt's completely off it. We don't bother to zero it out
142 of register classes. */
143 /* #define CONDITIONAL_REGISTER_USAGE */
145 /* Return number of consecutive hard regs needed starting at reg REGNO
146 to hold something of mode MODE.
147 This is ordinarily the length in words of a value of mode MODE
148 but can be less for certain modes in special long registers. */
149 #define HARD_REGNO_NREGS(REGNO, MODE) \
150 ((GET_MODE_SIZE (MODE) + UNITS_PER_WORD - 1) / UNITS_PER_WORD)
152 /* Value is 1 if hard register REGNO can hold a value of machine-mode MODE. */
153 #define HARD_REGNO_MODE_OK(REGNO, MODE) 1
155 /* Value is 1 if it is a good idea to tie two pseudo registers
156 when one has mode MODE1 and one has mode MODE2.
157 If HARD_REGNO_MODE_OK could produce different values for MODE1 and MODE2,
158 for any hard reg, then this must be 0 for correct output. */
159 #define MODES_TIEABLE_P(MODE1, MODE2) 0
161 /* Specify the registers used for certain standard purposes.
162 The values of these macros are register numbers. */
164 /* Register used for the program counter */
165 #define PC_REGNUM 15
167 /* Register to use for pushing function arguments. */
168 #define STACK_POINTER_REGNUM 12
170 /* Base register for access to local variables of the function. */
171 #define FRAME_POINTER_REGNUM 9
173 /* Value should be nonzero if functions must have frame pointers.
174 Zero means the frame pointer need not be set up (and parms
175 may be accessed via the stack pointer) in functions that seem suitable.
176 This is computed in `reload', in reload1.c. */
177 #define FRAME_POINTER_REQUIRED 1
179 /* Base register for access to arguments of the function. */
180 #define ARG_POINTER_REGNUM 10
182 /* Register in which static-chain is passed to a function. */
183 #define STATIC_CHAIN_REGNUM 8
185 /* Register in which address to store a structure value
186 is passed to a function. */
187 #define STRUCT_VALUE_REGNUM 2
189 /* Order in which to allocate registers. */
190 #define REG_ALLOC_ORDER \
191 {0, 1, 8, 7, 6, 5, 4, 3}
193 /* Define the classes of registers for register constraints in the
194 machine description. Also define ranges of constants.
196 One of the classes must always be named ALL_REGS and include all hard regs.
197 If there is more than one class, another class must be named NO_REGS
198 and contain no registers.
200 The name GENERAL_REGS must be the name of a class (or an alias for
201 another name such as ALL_REGS). This is the class of registers
202 that is allowed by "g" or "r" in a register constraint.
203 Also, registers outside this class are allocated only when
204 instructions express preferences for them.
206 The classes must be numbered in nondecreasing order; that is,
207 a larger-numbered class must never be contained completely
208 in a smaller-numbered class.
210 For any two classes, it is very desirable that there be another
211 class that represents their union. */
213 enum reg_class { NO_REGS, GENERAL_REGS,
214 ALL_REGS, LIM_REG_CLASSES };
216 #define N_REG_CLASSES (int) LIM_REG_CLASSES
218 /* Give names of register classes as strings for dump file. */
220 #define REG_CLASS_NAMES \
221 { "NO_REGS", "GENERAL_REGS", "ALL_REGS" }
223 /* Define which registers fit in which classes.
224 This is an initializer for a vector of HARD_REG_SET
225 of length N_REG_CLASSES. */
227 #define REG_CLASS_CONTENTS \
229 {0}, /* NO_REGS */ \
230 {0x000017ff}, /* GENERAL_REGS */ \
231 {0x0000ffff}, /* ALL_REGS */ \
234 /* The same information, inverted:
235 Return the class number of the smallest class containing
236 reg number REGNO. This could be a conditional expression
237 or could index an array. */
239 #define REGNO_REG_CLASS(REGNO) \
240 (((REGNO) < 11 || (REGNO) == 12) ? GENERAL_REGS : ALL_REGS)
242 /* The class value for index registers, and the one for base regs. */
244 #define INDEX_REG_CLASS NO_REGS
245 #define BASE_REG_CLASS GENERAL_REGS
247 /* Get reg_class from a letter such as appears in the machine description.
248 We do a trick here to modify the effective constraints on the
249 machine description; we zorch the constraint letters that aren't
250 appropriate for a specific target. This allows us to guarantee
251 that a specific kind of register will not be used for a given target
252 without fiddling with the register classes above. */
254 #define REG_CLASS_FROM_LETTER(C) \
255 ((C) == 'r' ? GENERAL_REGS : NO_REGS)
257 /* The letters I, J, K, L and M in a register constraint string
258 can be used to stand for particular ranges of immediate operands.
259 This macro defines what the ranges are.
260 C is the letter, and VALUE is a constant value.
261 Return 1 if VALUE is in the range specified by C. */
263 #define CONST_OK_FOR_LETTER_P(VALUE, C) 0
268 #define CONST_DOUBLE_OK_FOR_LETTER_P(VALUE, C) 0
270 /* Given an rtx X being reloaded into a reg required to be
271 in class CLASS, return the class of reg to actually use.
272 In general this is just CLASS; but on some machines
273 in some cases it is preferable to use a more restrictive class. */
275 #define PREFERRED_RELOAD_CLASS(X,CLASS) (CLASS)
277 /* Return the maximum number of consecutive registers
278 needed to represent mode MODE in a register of class CLASS. */
279 #define CLASS_MAX_NREGS(CLASS, MODE) \
280 ((GET_MODE_SIZE (MODE) + UNITS_PER_WORD - 1) / UNITS_PER_WORD)
282 /* Stack layout; function entry, exit and calling. */
284 /* Define this if pushing a word on the stack
285 makes the stack pointer a smaller address. */
286 /* #define STACK_GROWS_DOWNWARD */
288 /* Define this if the nominal address of the stack frame
289 is at the high-address end of the local variables;
290 that is, each additional local variable allocated
291 goes at a more negative offset in the frame. */
292 /* #define FRAME_GROWS_DOWNWARD */
294 /* Offset within stack frame to start allocating local variables at.
295 If FRAME_GROWS_DOWNWARD, this is the offset to the END of the
296 first local allocated. Otherwise, it is the offset to the BEGINNING
297 of the first local allocated. */
298 #define STARTING_FRAME_OFFSET 0
300 /* If we generate an insn to push BYTES bytes,
301 this says how many the stack pointer really advances by. */
302 #define PUSH_ROUNDING(BYTES) (((BYTES) + 3) & ~3)
304 /* Offset of first parameter from the argument pointer register value. */
305 #define FIRST_PARM_OFFSET(FNDECL) 0
307 /* Value is 1 if returning from a function call automatically
308 pops the arguments described by the number-of-args field in the call.
309 FUNDECL is the declaration node of the function (as a tree),
310 FUNTYPE is the data type of the function (as a tree),
311 or for a library call it is an identifier node for the subroutine name. */
313 #define RETURN_POPS_ARGS(FUNDECL,FUNTYPE,SIZE) (SIZE)
315 /* Define how to find the value returned by a function.
316 VALTYPE is the data type of the value (as a tree).
317 If the precise function being called is known, FUNC is its FUNCTION_DECL;
318 otherwise, FUNC is 0. */
320 /* On the we32000 the return value is in r0 regardless. */
322 #define FUNCTION_VALUE(VALTYPE, FUNC) \
323 gen_rtx_REG (TYPE_MODE (VALTYPE), 0)
325 /* Define how to find the value returned by a library function
326 assuming the value has mode MODE. */
328 /* On the we32000 the return value is in r0 regardless. */
330 #define LIBCALL_VALUE(MODE) gen_rtx_REG (MODE, 0)
332 /* 1 if N is a possible register number for a function value.
333 On the we32000, r0 is the only register thus used. */
335 #define FUNCTION_VALUE_REGNO_P(N) ((N) == 0)
337 /* Define this if PCC uses the nonreentrant convention for returning
338 structure and union values. */
340 /* #define PCC_STATIC_STRUCT_RETURN */
342 /* 1 if N is a possible register number for function argument passing.
343 On the we32000, no registers are used in this way. */
345 #define FUNCTION_ARG_REGNO_P(N) 0
347 /* Define a data type for recording info about an argument list
348 during the scan of that argument list. This data type should
349 hold all necessary information about the function itself
350 and about the args processed so far, enough to enable macros
351 such as FUNCTION_ARG to determine where the next arg should go.
353 On the we32k, this is a single integer, which is a number of bytes
354 of arguments scanned so far. */
356 #define CUMULATIVE_ARGS int
358 /* Initialize a variable CUM of type CUMULATIVE_ARGS
359 for a call to a function whose data type is FNTYPE.
360 For a library call, FNTYPE is 0.
362 On the we32k, the offset starts at 0. */
364 #define INIT_CUMULATIVE_ARGS(CUM,FNTYPE,LIBNAME,INDIRECT) \
365 ((CUM) = 0)
367 /* Update the data in CUM to advance over an argument
368 of mode MODE and data type TYPE.
369 (TYPE is null for libcalls where that information may not be available.) */
371 #define FUNCTION_ARG_ADVANCE(CUM, MODE, TYPE, NAMED) \
372 ((CUM) += ((MODE) != BLKmode \
373 ? (GET_MODE_SIZE (MODE) + 3) & ~3 \
374 : (int_size_in_bytes (TYPE) + 3) & ~3))
376 /* Define where to put the arguments to a function.
377 Value is zero to push the argument on the stack,
378 or a hard register in which to store the argument.
380 MODE is the argument's machine mode.
381 TYPE is the data type of the argument (as a tree).
382 This is null for libcalls where that information may
383 not be available.
384 CUM is a variable of type CUMULATIVE_ARGS which gives info about
385 the preceding args and about the function being called.
386 NAMED is nonzero if this argument is a named parameter
387 (otherwise it is an extra parameter matching an ellipsis). */
389 /* On the we32000 all args are pushed */
391 #define FUNCTION_ARG(CUM, MODE, TYPE, NAMED) 0
393 /* For an arg passed partly in registers and partly in memory,
394 this is the number of registers used.
395 For args passed entirely in registers or entirely in memory, zero. */
397 #define FUNCTION_ARG_PARTIAL_NREGS(CUM, MODE, TYPE, NAMED) 0
399 /* Output assembler code to FILE to increment profiler label # LABELNO
400 for profiling a function entry. */
402 #define FUNCTION_PROFILER(FILE, LABELNO) \
403 fprintf (FILE, "\tmovw &.LP%d,%%r0\n\tjsb _mcount\n", (LABELNO))
405 /* Output assembler code to FILE to initialize this source file's
406 basic block profiling info, if that has not already been done. */
408 #define FUNCTION_BLOCK_PROFILER(FILE, LABELNO) \
409 fprintf (FILE, "\tcmpw .LPBX0,&0\n\tjne .LPI%d\n\tpushw &.LPBX0\n\tcall &1,__bb_init_func\n.LPI%d:\n", \
410 LABELNO, LABELNO);
412 /* Output assembler code to FILE to increment the entry-count for
413 the BLOCKNO'th basic block in this source file. */
415 #define BLOCK_PROFILER(FILE, BLOCKNO) \
416 fprintf (FILE, "\taddw2 &1,.LPBX2+%d\n", 4 * BLOCKNO)
418 /* EXIT_IGNORE_STACK should be nonzero if, when returning from a function,
419 the stack pointer does not matter. The value is tested only in
420 functions that have frame pointers.
421 No definition is equivalent to always zero. */
423 #define EXIT_IGNORE_STACK 0
425 /* Store in the variable DEPTH the initial difference between the
426 frame pointer reg contents and the stack pointer reg contents,
427 as of the start of the function body. This depends on the layout
428 of the fixed parts of the stack frame and on how registers are saved.
430 On the we32k, FRAME_POINTER_REQUIRED is always 1, so the definition of this
431 macro doesn't matter. But it must be defined. */
433 #define INITIAL_FRAME_POINTER_OFFSET(DEPTH) (DEPTH) = 0;
435 /* Output assembler code for a block containing the constant parts
436 of a trampoline, leaving space for the variable parts. */
438 /* On the we32k, the trampoline contains two instructions:
439 mov #STATIC,%r8
440 jmp #FUNCTION */
442 #define TRAMPOLINE_TEMPLATE(FILE) \
444 assemble_aligned_integer (2, GEN_INT (0x844f)); \
445 assemble_aligned_integer (2, const0_rtx); \
446 assemble_aligned_integer (2, const0_rtx); \
447 assemble_aligned_integer (1, GEN_INT (0x48)); \
448 assemble_aligned_integer (2, GEN_INT (0x247f)); \
449 assemble_aligned_integer (2, const0_rtx); \
450 assemble_aligned_integer (2, const0_rtx); \
453 /* Length in units of the trampoline for entering a nested function. */
455 #define TRAMPOLINE_SIZE 13
457 /* Emit RTL insns to initialize the variable parts of a trampoline.
458 FNADDR is an RTX for the address of the function's pure code.
459 CXT is an RTX for the static chain value for the function. */
461 #define INITIALIZE_TRAMPOLINE(TRAMP, FNADDR, CXT) \
463 emit_move_insn (gen_rtx_MEM (SImode, plus_constant (TRAMP, 2)), CXT); \
464 emit_move_insn (gen_rtx_MEM (SImode, plus_constant (TRAMP, 9)), FNADDR); \
467 /* Generate calls to memcpy() and memset() rather
468 than bcopy() and bzero() */
469 #define TARGET_MEM_FUNCTIONS
471 /* Addressing modes, and classification of registers for them. */
473 /* #define HAVE_POST_INCREMENT 0 */
474 /* #define HAVE_POST_DECREMENT 0 */
476 /* #define HAVE_PRE_DECREMENT 0 */
477 /* #define HAVE_PRE_INCREMENT 0 */
479 /* Macros to check register numbers against specific register classes. */
481 /* These assume that REGNO is a hard or pseudo reg number.
482 They give nonzero only if REGNO is a hard reg of the suitable class
483 or a pseudo reg currently allocated to a suitable hard reg.
484 Since they use reg_renumber, they are safe only once reg_renumber
485 has been allocated, which happens in local-alloc.c. */
487 #define REGNO_OK_FOR_INDEX_P(REGNO) 0
489 #define REGNO_OK_FOR_BASE_P(REGNO) \
490 ((REGNO) < 11 || (REGNO) == 12 || \
491 (unsigned)reg_renumber[REGNO] < 11 || (unsigned)reg_renumber[REGNO] == 12)
493 /* Maximum number of registers that can appear in a valid memory address. */
495 #define MAX_REGS_PER_ADDRESS 1
497 /* Recognize any constant value that is a valid address. */
499 #define CONSTANT_ADDRESS_P(X) \
500 (GET_CODE (X) == LABEL_REF || GET_CODE (X) == SYMBOL_REF \
501 || GET_CODE (X) == CONST_INT || GET_CODE (X) == CONST \
502 || GET_CODE (X) == HIGH)
504 /* Nonzero if the constant value X is a legitimate general operand.
505 It is given that X satisfies CONSTANT_P or is a CONST_DOUBLE. */
507 #define LEGITIMATE_CONSTANT_P(X) 1
509 /* The macros REG_OK_FOR..._P assume that the arg is a REG rtx
510 and check its validity for a certain class.
511 We have two alternate definitions for each of them.
512 The usual definition accepts all pseudo regs; the other rejects
513 them unless they have been allocated suitable hard regs.
514 The symbol REG_OK_STRICT causes the latter definition to be used.
516 Most source files want to accept pseudo regs in the hope that
517 they will get allocated to the class that the insn wants them to be in.
518 Source files for reload pass need to be strict.
519 After reload, it makes no difference, since pseudo regs have
520 been eliminated by then. */
522 #ifndef REG_OK_STRICT
524 /* Nonzero if X is a hard reg that can be used as an index
525 or if it is a pseudo reg. */
526 #define REG_OK_FOR_INDEX_P(X) 0
528 /* Nonzero if X is a hard reg that can be used as a base reg
529 or if it is a pseudo reg. */
530 #define REG_OK_FOR_BASE_P(X) \
531 (REGNO(X) < 11 || REGNO(X) == 12 || REGNO(X) >= FIRST_PSEUDO_REGISTER)
533 #else
535 /* Nonzero if X is a hard reg that can be used as an index. */
536 #define REG_OK_FOR_INDEX_P(X) REGNO_OK_FOR_INDEX_P (REGNO (X))
537 /* Nonzero if X is a hard reg that can be used as a base reg. */
538 #define REG_OK_FOR_BASE_P(X) REGNO_OK_FOR_BASE_P (REGNO (X))
540 #endif
542 /* GO_IF_LEGITIMATE_ADDRESS recognizes an RTL expression
543 that is a valid memory address for an instruction.
544 The MODE argument is the machine mode for the MEM expression
545 that wants to use this address. */
547 #define GO_IF_LEGITIMATE_ADDRESS(MODE, X, LABEL) \
548 { register rtx Addr = X; \
549 if ((MODE) == QImode || (MODE) == HImode || \
550 (MODE) == PSImode || (MODE) == SImode || (MODE) == SFmode) \
551 if (GET_CODE(Addr) == MEM) \
552 Addr = XEXP(Addr, 0); \
553 if (CONSTANT_ADDRESS_P(Addr)) \
554 goto LABEL; \
555 if (REG_P(Addr) && REG_OK_FOR_BASE_P(Addr)) \
556 goto LABEL; \
557 if (GET_CODE(Addr) == PLUS && \
558 ((REG_P(XEXP(Addr, 0)) && REG_OK_FOR_BASE_P(XEXP(Addr, 0)) && \
559 CONSTANT_ADDRESS_P(XEXP(Addr, 1))) || \
560 (REG_P(XEXP(Addr, 1)) && REG_OK_FOR_BASE_P(XEXP(Addr, 1)) && \
561 CONSTANT_ADDRESS_P(XEXP(Addr, 0))))) \
562 goto LABEL; \
565 /* Try machine-dependent ways of modifying an illegitimate address
566 to be legitimate. If we find one, return the new, valid address.
567 This macro is used in only one place: `memory_address' in explow.c.
569 OLDX is the address as it was before break_out_memory_refs was called.
570 In some cases it is useful to look at this to decide what needs to be done.
572 MODE and WIN are passed so that this macro can use
573 GO_IF_LEGITIMATE_ADDRESS.
575 It is always safe for this macro to do nothing. It exists to recognize
576 opportunities to optimize the output. */
578 #define LEGITIMIZE_ADDRESS(X,OLDX,MODE,WIN) { }
580 /* Go to LABEL if ADDR (a legitimate address expression)
581 has an effect that depends on the machine mode it is used for. */
583 #define GO_IF_MODE_DEPENDENT_ADDRESS(ADDR,LABEL) { }
585 /* Specify the machine mode that this machine uses
586 for the index in the tablejump instruction. */
587 #define CASE_VECTOR_MODE SImode
589 /* Define as C expression which evaluates to nonzero if the tablejump
590 instruction expects the table to contain offsets from the address of the
591 table.
592 Do not define this if the table should contain absolute addresses. */
593 /* #define CASE_VECTOR_PC_RELATIVE 1 */
595 /* Specify the tree operation to be used to convert reals to integers. */
596 #define IMPLICIT_FIX_EXPR FIX_ROUND_EXPR
598 /* This is the kind of divide that is easiest to do in the general case. */
599 #define EASY_DIV_EXPR TRUNC_DIV_EXPR
601 /* Define this as 1 if `char' should by default be signed; else as 0. */
602 #define DEFAULT_SIGNED_CHAR 0
604 /* Max number of bytes we can move from memory to memory
605 in one reasonably fast instruction. */
606 #define MOVE_MAX 4
608 /* Define this if zero-extension is slow (more than one real instruction). */
609 /* #define SLOW_ZERO_EXTEND */
611 /* Nonzero if access to memory by bytes is slow and undesirable. */
612 #define SLOW_BYTE_ACCESS 0
614 /* Define this to be nonzero if shift instructions ignore all but the low-order
615 few bits. */
616 #define SHIFT_COUNT_TRUNCATED 1
618 /* Value is 1 if truncating an integer of INPREC bits to OUTPREC bits
619 is done just by pretending it is already truncated. */
620 #define TRULY_NOOP_TRUNCATION(OUTPREC, INPREC) 1
622 /* We assume that the store-condition-codes instructions store 0 for false
623 and some other value for true. This is the value stored for true. */
625 #define STORE_FLAG_VALUE (-1)
627 /* When a prototype says `char' or `short', really pass an `int'. */
628 #define PROMOTE_PROTOTYPES 1
630 /* Specify the machine mode that pointers have.
631 After generation of rtl, the compiler makes no further distinction
632 between pointers and any other objects of this machine mode. */
633 #define Pmode SImode
635 /* A function address in a call instruction
636 is a byte address (for indexing purposes)
637 so give the MEM rtx a byte's mode. */
638 #define FUNCTION_MODE QImode
640 /* Compute the cost of computing a constant rtl expression RTX
641 whose rtx-code is CODE. The body of this macro is a portion
642 of a switch statement. If the code is computed here,
643 return it with a return statement. Otherwise, break from the switch. */
645 #define CONST_COSTS(RTX,CODE, OUTER_CODE) \
646 case CONST_INT: \
647 if (INTVAL (RTX) >= -16 && INTVAL (RTX) <= 63) return 0; \
648 if (INTVAL (RTX) >= -128 && INTVAL (RTX) <= 127) return 1; \
649 if (INTVAL (RTX) >= -32768 && INTVAL (RTX) <= 32767) return 2; \
650 case CONST: \
651 case LABEL_REF: \
652 case SYMBOL_REF: \
653 return 3; \
654 case CONST_DOUBLE: \
655 return 5;
657 /* Tell final.c how to eliminate redundant test instructions. */
659 /* Here we define machine-dependent flags and fields in cc_status
660 (see `conditions.h'). */
662 #define NOTICE_UPDATE_CC(EXP, INSN) \
664 { CC_STATUS_INIT; } \
667 /* Control the assembler format that we output. */
669 /* Use crt1.o as a startup file and crtn.o as a closing file. */
671 #define STARTFILE_SPEC "%{pg:gcrt1.o%s}%{!pg:%{p:mcrt1.o%s}%{!p:crt1.o%s}}"
673 #define ENDFILE_SPEC "crtn.o%s"
675 /* The .file command should always begin the output. */
677 #define ASM_FILE_START(FILE) output_file_directive ((FILE), main_input_filename)
679 /* Output to assembler file text saying following lines
680 may contain character constants, extra white space, comments, etc. */
682 #define ASM_APP_ON "#APP\n"
684 /* Output to assembler file text saying following lines
685 no longer contain unusual constructs. */
687 #define ASM_APP_OFF "#NO_APP\n"
689 /* Output before code. */
691 #define TEXT_SECTION_ASM_OP "\t.text"
693 /* Output before writable data. */
695 #define DATA_SECTION_ASM_OP "\t.data"
697 /* Read-only data goes in the data section because
698 AT&T's assembler doesn't guarantee the proper alignment
699 of data in the text section even if an align statement
700 is used. */
702 #define READONLY_DATA_SECTION() data_section()
704 /* How to refer to registers in assembler output.
705 This sequence is indexed by compiler's hard-register-number (see above). */
707 #define REGISTER_NAMES \
708 {"r0", "r1", "r2", "r3", "r4", "r5", "r6", "r7", \
709 "r8", "fp", "ap", "psw", "sp", "pcbp", "isp", "pc" }
711 /* Output SDB debugging info in response to the -g option. */
713 #define SDB_DEBUGGING_INFO
715 /* This is how to output the definition of a user-level label named NAME,
716 such as the label on a static function or variable NAME. */
718 #define ASM_OUTPUT_LABEL(FILE,NAME) \
719 do { assemble_name (FILE, NAME); fputs (":\n", FILE); } while (0)
721 /* This is how to output a command to make the user-level label named NAME
722 defined for reference from other files. */
724 #define ASM_GLOBALIZE_LABEL(FILE,NAME) \
725 do { \
726 fputs (".globl ", FILE); \
727 assemble_name (FILE, NAME); \
728 fputs ("\n", FILE); \
729 } while (0)
731 /* The prefix to add to user-visible assembler symbols. */
733 #define USER_LABEL_PREFIX ""
735 /* This is how to output an internal numbered label where
736 PREFIX is the class of label and NUM is the number within the class. */
738 #define ASM_OUTPUT_INTERNAL_LABEL(FILE,PREFIX,NUM) \
739 fprintf (FILE, ".%s%d:\n", PREFIX, NUM)
741 /* This is how to store into the string LABEL
742 the symbol_ref name of an internal numbered label where
743 PREFIX is the class of label and NUM is the number within the class.
744 This is suitable for output with `assemble_name'. */
746 #define ASM_GENERATE_INTERNAL_LABEL(LABEL,PREFIX,NUM) \
747 sprintf (LABEL, ".%s%d", PREFIX, NUM)
749 /* This is how to output an internal numbered label which
750 labels a jump table. */
752 #define ASM_OUTPUT_CASE_LABEL(FILE,PREFIX,NUM,TABLE) \
753 do { \
754 ASM_OUTPUT_ALIGN (FILE, 2); \
755 ASM_OUTPUT_INTERNAL_LABEL (FILE, PREFIX, NUM); \
756 } while (0)
758 #define ASM_OUTPUT_ASCII(FILE,PTR,LEN) \
759 do { \
760 const unsigned char *s; \
761 size_t i, limit = (LEN); \
762 for (i = 0, s = (const unsigned char *)(PTR); i < limit; s++, i++) \
764 if ((i % 8) == 0) \
765 fprintf ((FILE),"%s\t.byte\t",(i?"\n":"")); \
766 fprintf ((FILE), "%s0x%x", (i%8?",":""), (unsigned)*s); \
768 fputs ("\n", (FILE)); \
769 } while (0)
771 /* This is how to output an insn to push a register on the stack.
772 It need not be very fast code. */
774 #define ASM_OUTPUT_REG_PUSH(FILE,REGNO) \
775 fprintf (FILE, "\tpushw %s\n", reg_names[REGNO])
777 /* This is how to output an insn to pop a register from the stack.
778 It need not be very fast code. */
780 #define ASM_OUTPUT_REG_POP(FILE,REGNO) \
781 fprintf (FILE, "\tPOPW %s\n", reg_names[REGNO])
783 /* This is how to output an element of a case-vector that is absolute. */
785 #define ASM_OUTPUT_ADDR_VEC_ELT(FILE, VALUE) \
786 fprintf (FILE, "\t.word .L%d\n", VALUE)
788 /* This is how to output an element of a case-vector that is relative. */
790 #define ASM_OUTPUT_ADDR_DIFF_ELT(FILE, BODY, VALUE, REL) \
791 fprintf (FILE, "\t.word .L%d-.L%d\n", VALUE, REL)
793 /* This is how to output an assembler line
794 that says to advance the location counter
795 to a multiple of 2**LOG bytes. */
797 #define ASM_OUTPUT_ALIGN(FILE,LOG) \
798 if ((LOG) != 0) \
799 fprintf (FILE, "\t.align %d\n", 1 << (LOG))
801 /* This is how to output an assembler line
802 that says to advance the location counter by SIZE bytes. */
804 /* The `space' pseudo in the text segment outputs nop insns rather than 0s,
805 so we must output 0s explicitly in the text segment. */
807 #define ASM_OUTPUT_SKIP(FILE,SIZE) do { \
808 if (in_text_section ()) \
810 int i; \
811 for (i = 0; i < (SIZE) - 20; i += 20) \
812 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"); \
813 if (i < (SIZE)) \
815 fprintf (FILE, "\t.byte 0"); \
816 i++; \
817 for (; i < (SIZE); i++) \
818 fprintf (FILE, ",0"); \
819 fprintf (FILE, "\n"); \
822 else \
823 fprintf ((FILE), "\t.set .,.+%u\n", (SIZE)); } while (0)
825 /* This says how to output an assembler line
826 to define a global common symbol. */
828 #define ASM_OUTPUT_COMMON(FILE, NAME, SIZE, ROUNDED) \
829 do { \
830 data_section(); \
831 fputs ("\t.comm ", (FILE)); \
832 assemble_name ((FILE), (NAME)); \
833 fprintf ((FILE), ",%u\n", (SIZE)); \
834 } while (0)
836 /* This says how to output an assembler line
837 to define a local common symbol. */
839 #define ASM_OUTPUT_LOCAL(FILE, NAME, SIZE, ROUNDED) \
840 do { \
841 data_section(); \
842 ASM_OUTPUT_ALIGN ((FILE), 2); \
843 ASM_OUTPUT_LABEL ((FILE), (NAME)); \
844 fprintf ((FILE), "\t.zero %u\n", (SIZE)); \
845 } while (0)
847 /* Store in OUTPUT a string (made with alloca) containing
848 an assembler-name for a local static variable named NAME.
849 LABELNO is an integer which is different for each call. */
851 #define ASM_FORMAT_PRIVATE_NAME(OUTPUT, NAME, LABELNO) \
852 ( (OUTPUT) = (char *) alloca (strlen ((NAME)) + 10), \
853 sprintf ((OUTPUT), "%s.%d", (NAME), (LABELNO)))
855 /* Output #ident as a .ident. */
857 #define ASM_OUTPUT_IDENT(FILE, NAME) fprintf (FILE, "\t.ident \"%s\"\n", NAME)
859 /* Print operand X (an rtx) in assembler syntax to file FILE.
860 CODE is a letter or dot (`z' in `%z0') or 0 if no letter was specified.
861 For `%' followed by punctuation, CODE is the punctuation and X is null. */
863 #define PRINT_OPERAND_PUNCT_VALID_P(CODE) 0
865 #define PRINT_OPERAND(FILE, X, CODE) \
866 { if (GET_CODE (X) == REG) \
867 fprintf (FILE, "%%%s", reg_names[REGNO (X)]); \
868 else if (GET_CODE (X) == MEM) \
869 output_address (XEXP (X, 0)); \
870 else if (GET_CODE (X) == CONST_DOUBLE && GET_MODE (X) == SFmode) \
872 union { double d; long l[2]; } dtem; \
873 union { float f; long l; } ftem; \
875 dtem.l[0] = CONST_DOUBLE_LOW (X); \
876 dtem.l[1] = CONST_DOUBLE_HIGH (X); \
877 ftem.f = dtem.d; \
878 fprintf(FILE, "&0x%lx", ftem.l); \
880 else { putc ('&', FILE); output_addr_const (FILE, X); }}
882 #define PRINT_OPERAND_ADDRESS(FILE, ADDR) \
883 { register rtx Addr = ADDR; \
884 rtx offset; \
885 rtx reg; \
886 if (GET_CODE (Addr) == MEM) { \
887 putc ('*', FILE); \
888 Addr = XEXP (Addr, 0); \
889 if (GET_CODE (Addr) == REG) \
890 putc ('0', FILE); \
892 switch (GET_CODE (Addr)) \
894 case REG: \
895 fprintf (FILE, "(%%%s)", reg_names[REGNO (Addr)]); \
896 break; \
898 case PLUS: \
899 offset = NULL; \
900 if (CONSTANT_ADDRESS_P (XEXP (Addr, 0))) \
902 offset = XEXP (Addr, 0); \
903 Addr = XEXP (Addr, 1); \
905 else if (CONSTANT_ADDRESS_P (XEXP (Addr, 1))) \
907 offset = XEXP (Addr, 1); \
908 Addr = XEXP (Addr, 0); \
910 else \
911 abort(); \
912 if (REG_P (Addr)) \
913 reg = Addr; \
914 else \
915 abort(); \
916 output_addr_const(FILE, offset); \
917 fprintf(FILE, "(%%%s)", reg_names[REGNO(reg)]); \
918 break; \
920 default: \
921 if ( !CONSTANT_ADDRESS_P(Addr)) \
922 abort(); \
923 output_addr_const (FILE, Addr); \
927 Local variables:
928 version-control: t
929 End: