update copyrights in config dir.
[official-gcc.git] / gcc / config / pdp11 / pdp11.h
blob6ca396256cbbdf48bd0e0be9adbec55882f727d3
1 /* Definitions of target machine for GNU compiler, for the pdp-11
2 Copyright (C) 1994, 95, 96, 98, 99, 2000 Free Software Foundation, Inc.
3 Contributed by Michael K. Gschwind (mike@vlsivie.tuwien.ac.at).
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 /* check whether load_fpu_reg or not */
24 #define LOAD_FPU_REG_P(x) ((x)>=8 && (x)<=11)
25 #define NO_LOAD_FPU_REG_P(x) ((x)==12 || (x)==13)
26 #define FPU_REG_P(x) (LOAD_FPU_REG_P(x) || NO_LOAD_FPU_REG_P(x))
27 #define CPU_REG_P(x) ((x)<8)
29 /* Names to predefine in the preprocessor for this target machine. */
31 #define CPP_PREDEFINES "-Dpdp11"
33 /* Print subsidiary information on the compiler version in use. */
34 #define TARGET_VERSION fprintf (stderr, " (pdp11)");
37 /* Generate DBX debugging information. */
39 /* #define DBX_DEBUGGING_INFO */
41 /* Run-time compilation parameters selecting different hardware subsets.
44 extern int target_flags;
46 /* Macro to define tables used to set the flags.
47 This is a list in braces of triplets in braces,
48 each triplet being { "NAME", VALUE, DOC }
49 where VALUE is the bits to set or minus the bits to clear and DOC
50 is the documentation for --help (NULL if intentionally undocumented).
51 An empty string NAME is used to identify the default VALUE. */
53 #define TARGET_SWITCHES \
54 { { "fpu", 1, "Use hardware floating point" }, \
55 { "soft-float", -1, "Do not use hardware floating point" }, \
56 /* return float result in ac0 */ \
57 { "ac0", 2, "Return floating point results in ac0" }, \
58 { "no-ac0", -2, "Return floating point results in memory" },\
59 /* is 11/40 */ \
60 { "40", 4, "Generate code for an 11/40" }, \
61 { "no-40", -4, "" }, \
62 /* is 11/45 */ \
63 { "45", 8, "Generate code for an 11/45" }, \
64 { "no-45", -8, "" }, \
65 /* is 11/10 */ \
66 { "10", -12, "Generate code for an 11/10" }, \
67 /* use movstrhi for bcopy */ \
68 { "bcopy", 16, NULL }, \
69 { "bcopy-builtin", -16, NULL }, \
70 /* use 32 bit for int */ \
71 { "int32", 32, "Use 32 bit int" }, \
72 { "no-int16", 32, "Use 32 bit int" }, \
73 { "int16", -32, "Use 16 bit int" }, \
74 { "no-int32", -32, "Use 16 bit int" }, \
75 /* use 32 bit for float */ \
76 { "float32", 64, "Use 32 bit float" }, \
77 { "no-float64", 64, "Use 32 bit float" }, \
78 { "float64", -64, "Use 64 bit float" }, \
79 { "no-float32", -64, "Use 64 bit float" }, \
80 /* allow abshi pattern? - can trigger "optimizations" which make code SLOW! */\
81 { "abshi", 128, NULL }, \
82 { "no-abshi", -128, NULL }, \
83 /* is branching expensive - on a PDP, it's actually really cheap */ \
84 /* this is just to play around and check what code gcc generates */ \
85 { "branch-expensive", 256, NULL }, \
86 { "branch-cheap", -256, NULL }, \
87 /* split instruction and data memory? */ \
88 { "split", 1024, "Target has split I&D" }, \
89 { "no-split", -1024, "Target does not have split I&D" }, \
90 /* UNIX assembler syntax? */ \
91 { "unix-asm", 2048, "Use UNIX assembler syntax" }, \
92 { "dec-asm", -2048, "Use DEC assembler syntax" }, \
93 /* default */ \
94 { "", TARGET_DEFAULT, NULL} \
97 #define TARGET_DEFAULT (1 | 8 | 128 | TARGET_UNIX_ASM_DEFAULT)
99 #define TARGET_FPU (target_flags & 1)
100 #define TARGET_SOFT_FLOAT (!TARGET_FPU)
102 #define TARGET_AC0 ((target_flags & 2) && TARGET_FPU)
103 #define TARGET_NO_AC0 (! TARGET_AC0)
105 #define TARGET_45 (target_flags & 8)
106 #define TARGET_40_PLUS ((target_flags & 4) || (target_flags & 8))
107 #define TARGET_10 (! TARGET_40_PLUS)
109 #define TARGET_BCOPY_BUILTIN (! (target_flags & 16))
111 #define TARGET_INT16 (! TARGET_INT32)
112 #define TARGET_INT32 (target_flags & 32)
114 #define TARGET_FLOAT32 (target_flags & 64)
115 #define TARGET_FLOAT64 (! TARGET_FLOAT32)
117 #define TARGET_ABSHI_BUILTIN (target_flags & 128)
119 #define TARGET_BRANCH_EXPENSIVE (target_flags & 256)
120 #define TARGET_BRANCH_CHEAP (!TARGET_BRANCH_EXPENSIVE)
122 #define TARGET_SPLIT (target_flags & 1024)
123 #define TARGET_NOSPLIT (! TARGET_SPLIT)
125 #define TARGET_UNIX_ASM (target_flags & 2048)
126 #define TARGET_UNIX_ASM_DEFAULT 0
128 #define ASSEMBLER_DIALECT (TARGET_UNIX_ASM ? 1 : 0)
132 /* TYPE SIZES */
133 #define CHAR_TYPE_SIZE 8
134 #define SHORT_TYPE_SIZE 16
135 #define INT_TYPE_SIZE (TARGET_INT16 ? 16 : 32)
136 #define LONG_TYPE_SIZE 32
137 #define LONG_LONG_TYPE_SIZE 64
139 /* if we set FLOAT_TYPE_SIZE to 32, we could have the benefit
140 of saving core for huge arrays - the definitions are
141 already in md - but floats can never reside in
142 an FPU register - we keep the FPU in double float mode
143 all the time !! */
144 #define FLOAT_TYPE_SIZE (TARGET_FLOAT32 ? 32 : 64)
145 #define DOUBLE_TYPE_SIZE 64
146 #define LONG_DOUBLE_TYPE_SIZE 64
148 /* machine types from ansi */
149 #define SIZE_TYPE "unsigned int" /* definition of size_t */
151 /* is used in cexp.y - we don't have target_flags there,
152 so just give default definition
154 hope it does not come back to haunt us! */
155 #define WCHAR_TYPE "int" /* or long int???? */
156 #define WCHAR_TYPE_SIZE 16
158 #define PTRDIFF_TYPE "int"
160 /* target machine storage layout */
162 /* Define this if most significant bit is lowest numbered
163 in instructions that operate on numbered bit-fields. */
164 #define BITS_BIG_ENDIAN 0
166 /* Define this if most significant byte of a word is the lowest numbered. */
167 #define BYTES_BIG_ENDIAN 0
169 /* Define this if most significant word of a multiword number is numbered. */
170 #define WORDS_BIG_ENDIAN 1
172 /* number of bits in an addressable storage unit */
173 #define BITS_PER_UNIT 8
175 /* Width in bits of a "word", which is the contents of a machine register.
176 Note that this is not necessarily the width of data type `int';
177 if using 16-bit ints on a 68000, this would still be 32.
178 But on a machine with 16-bit registers, this would be 16. */
179 /* This is a machine with 16-bit registers */
180 #define BITS_PER_WORD 16
182 /* Width of a word, in units (bytes).
184 UNITS OR BYTES - seems like units */
185 #define UNITS_PER_WORD 2
187 /* Maximum sized of reasonable data type
188 DImode or Dfmode ...*/
189 #define MAX_FIXED_MODE_SIZE 64
191 /* Width in bits of a pointer.
192 See also the macro `Pmode' defined below. */
193 #define POINTER_SIZE 16
195 /* Allocation boundary (in *bits*) for storing pointers in memory. */
196 #define POINTER_BOUNDARY 16
198 /* Allocation boundary (in *bits*) for storing arguments in argument list. */
199 #define PARM_BOUNDARY 16
201 /* Allocation boundary (in *bits*) for the code of a function. */
202 #define FUNCTION_BOUNDARY 16
204 /* Alignment of field after `int : 0' in a structure. */
205 #define EMPTY_FIELD_BOUNDARY 16
207 /* No data type wants to be aligned rounder than this. */
208 #define BIGGEST_ALIGNMENT 16
210 /* Define this if move instructions will actually fail to work
211 when given unaligned data. */
212 #define STRICT_ALIGNMENT 1
214 /* Standard register usage. */
216 /* Number of actual hardware registers.
217 The hardware registers are assigned numbers for the compiler
218 from 0 to just below FIRST_PSEUDO_REGISTER.
219 All registers that the compiler knows about must be given numbers,
220 even those that are not normally considered general registers.
222 we have 8 integer registers, plus 6 float
223 (don't use scratch float !) */
225 #define FIRST_PSEUDO_REGISTER 14
227 /* 1 for registers that have pervasive standard uses
228 and are not available for the register allocator.
230 On the pdp, these are:
231 Reg 7 = pc;
232 reg 6 = sp;
233 reg 5 = fp; not necessarily!
236 /* don't let them touch fp regs for the time being !*/
238 #define FIXED_REGISTERS \
239 {0, 0, 0, 0, 0, 0, 1, 1, \
240 0, 0, 0, 0, 0, 0 }
244 /* 1 for registers not available across function calls.
245 These must include the FIXED_REGISTERS and also any
246 registers that can be used without being saved.
247 The latter must include the registers where values are returned
248 and the register where structure-value addresses are passed.
249 Aside from that, you can include as many other registers as you like. */
251 /* don't know about fp */
252 #define CALL_USED_REGISTERS \
253 {1, 1, 0, 0, 0, 0, 1, 1, \
254 0, 0, 0, 0, 0, 0 }
257 /* Make sure everything's fine if we *don't* have an FPU.
258 This assumes that putting a register in fixed_regs will keep the
259 compiler's mitts completely off it. We don't bother to zero it out
260 of register classes. Also fix incompatible register naming with
261 the UNIX assembler.
263 #define CONDITIONAL_REGISTER_USAGE \
265 int i; \
266 HARD_REG_SET x; \
267 if (!TARGET_FPU) \
269 COPY_HARD_REG_SET (x, reg_class_contents[(int)FPU_REGS]); \
270 for (i = 0; i < FIRST_PSEUDO_REGISTER; i++ ) \
271 if (TEST_HARD_REG_BIT (x, i)) \
272 fixed_regs[i] = call_used_regs[i] = 1; \
275 if (TARGET_AC0) \
276 call_used_regs[8] = 1; \
277 if (TARGET_UNIX_ASM) \
279 /* Change names of FPU registers for the UNIX assembler. */ \
280 reg_names[8] = "fr0"; \
281 reg_names[9] = "fr1"; \
282 reg_names[10] = "fr2"; \
283 reg_names[11] = "fr3"; \
284 reg_names[12] = "fr4"; \
285 reg_names[13] = "fr5"; \
289 /* Return number of consecutive hard regs needed starting at reg REGNO
290 to hold something of mode MODE.
291 This is ordinarily the length in words of a value of mode MODE
292 but can be less for certain modes in special long registers.
295 #define HARD_REGNO_NREGS(REGNO, MODE) \
296 ((REGNO < 8)? \
297 ((GET_MODE_SIZE (MODE) + UNITS_PER_WORD - 1) / UNITS_PER_WORD) \
301 /* Value is 1 if hard register REGNO can hold a value of machine-mode MODE.
302 On the pdp, the cpu registers can hold any mode - check alignment
304 FPU can only hold DF - simplifies life!
306 #define HARD_REGNO_MODE_OK(REGNO, MODE) \
307 (((REGNO) < 8)? \
308 ((GET_MODE_BITSIZE(MODE) <= 16) \
309 || (GET_MODE_BITSIZE(MODE) == 32 && !((REGNO) & 1))) \
310 :(MODE) == DFmode)
313 /* Value is 1 if it is a good idea to tie two pseudo registers
314 when one has mode MODE1 and one has mode MODE2.
315 If HARD_REGNO_MODE_OK could produce different values for MODE1 and MODE2,
316 for any hard reg, then this must be 0 for correct output. */
317 #define MODES_TIEABLE_P(MODE1, MODE2) 0
319 /* Specify the registers used for certain standard purposes.
320 The values of these macros are register numbers. */
322 /* the pdp11 pc overloaded on a register that the compiler knows about. */
323 #define PC_REGNUM 7
325 /* Register to use for pushing function arguments. */
326 #define STACK_POINTER_REGNUM 6
328 /* Base register for access to local variables of the function. */
329 #define FRAME_POINTER_REGNUM 5
331 /* Value should be nonzero if functions must have frame pointers.
332 Zero means the frame pointer need not be set up (and parms
333 may be accessed via the stack pointer) in functions that seem suitable.
334 This is computed in `reload', in reload1.c.
337 #define FRAME_POINTER_REQUIRED 0
339 /* Base register for access to arguments of the function. */
340 #define ARG_POINTER_REGNUM 5
342 /* Register in which static-chain is passed to a function. */
343 /* ??? - i don't want to give up a reg for this! */
344 #define STATIC_CHAIN_REGNUM 4
346 /* Register in which address to store a structure value
347 is passed to a function.
348 let's make it an invisible first argument!!! */
350 #define STRUCT_VALUE 0
353 /* Define the classes of registers for register constraints in the
354 machine description. Also define ranges of constants.
356 One of the classes must always be named ALL_REGS and include all hard regs.
357 If there is more than one class, another class must be named NO_REGS
358 and contain no registers.
360 The name GENERAL_REGS must be the name of a class (or an alias for
361 another name such as ALL_REGS). This is the class of registers
362 that is allowed by "g" or "r" in a register constraint.
363 Also, registers outside this class are allocated only when
364 instructions express preferences for them.
366 The classes must be numbered in nondecreasing order; that is,
367 a larger-numbered class must never be contained completely
368 in a smaller-numbered class.
370 For any two classes, it is very desirable that there be another
371 class that represents their union. */
373 /* The pdp has a couple of classes:
375 MUL_REGS are used for odd numbered regs, to use in 16 bit multiplication
376 (even numbered do 32 bit multiply)
377 LMUL_REGS long multiply registers (even numbered regs )
378 (don't need them, all 32 bit regs are even numbered!)
379 GENERAL_REGS is all cpu
380 LOAD_FPU_REGS is the first four cpu regs, they are easier to load
381 NO_LOAD_FPU_REGS is ac4 and ac5, currently - difficult to load them
382 FPU_REGS is all fpu regs
385 enum reg_class { NO_REGS, MUL_REGS, GENERAL_REGS, LOAD_FPU_REGS, NO_LOAD_FPU_REGS, FPU_REGS, ALL_REGS, LIM_REG_CLASSES };
387 #define N_REG_CLASSES (int) LIM_REG_CLASSES
389 /* have to allow this till cmpsi/tstsi are fixed in a better way !! */
390 #define SMALL_REGISTER_CLASSES 1
392 /* Since GENERAL_REGS is the same class as ALL_REGS,
393 don't give it a different class number; just make it an alias. */
395 /* #define GENERAL_REGS ALL_REGS */
397 /* Give names of register classes as strings for dump file. */
399 #define REG_CLASS_NAMES {"NO_REGS", "MUL_REGS", "GENERAL_REGS", "LOAD_FPU_REGS", "NO_LOAD_FPU_REGS", "FPU_REGS", "ALL_REGS" }
401 /* Define which registers fit in which classes.
402 This is an initializer for a vector of HARD_REG_SET
403 of length N_REG_CLASSES. */
405 #define REG_CLASS_CONTENTS {{0}, {0x00aa}, {0x00ff}, {0x0f00}, {0x3000}, {0x3f00}, {0x3fff}}
407 /* The same information, inverted:
408 Return the class number of the smallest class containing
409 reg number REGNO. This could be a conditional expression
410 or could index an array. */
412 #define REGNO_REG_CLASS(REGNO) \
413 ((REGNO)>=8?((REGNO)<=11?LOAD_FPU_REGS:NO_LOAD_FPU_REGS):(((REGNO)&1)?MUL_REGS:GENERAL_REGS))
416 /* The class value for index registers, and the one for base regs. */
417 #define INDEX_REG_CLASS GENERAL_REGS
418 #define BASE_REG_CLASS GENERAL_REGS
420 /* Get reg_class from a letter such as appears in the machine description. */
422 #define REG_CLASS_FROM_LETTER(C) \
423 ((C) == 'f' ? FPU_REGS : \
424 ((C) == 'd' ? MUL_REGS : \
425 ((C) == 'a' ? LOAD_FPU_REGS : NO_REGS)))
428 /* The letters I, J, K, L and M in a register constraint string
429 can be used to stand for particular ranges of immediate operands.
430 This macro defines what the ranges are.
431 C is the letter, and VALUE is a constant value.
432 Return 1 if VALUE is in the range specified by C.
434 I bits 31-16 0000
435 J bits 15-00 0000
436 K completely random 32 bit
437 L,M,N -1,1,0 respectively
438 O where doing shifts in sequence is faster than
439 one big shift
442 #define CONST_OK_FOR_LETTER_P(VALUE, C) \
443 ((C) == 'I' ? ((VALUE) & 0xffff0000) == 0 \
444 : (C) == 'J' ? ((VALUE) & 0x0000ffff) == 0 \
445 : (C) == 'K' ? (((VALUE) & 0xffff0000) != 0 \
446 && ((VALUE) & 0x0000ffff) != 0) \
447 : (C) == 'L' ? ((VALUE) == 1) \
448 : (C) == 'M' ? ((VALUE) == -1) \
449 : (C) == 'N' ? ((VALUE) == 0) \
450 : (C) == 'O' ? (abs(VALUE) >1 && abs(VALUE) <= 4) \
451 : 0)
453 /* Similar, but for floating constants, and defining letters G and H.
454 Here VALUE is the CONST_DOUBLE rtx itself. */
456 #define CONST_DOUBLE_OK_FOR_LETTER_P(VALUE, C) \
457 ((C) == 'G' && XINT (VALUE, 0) == 0 && XINT (VALUE, 1) == 0)
460 /* Letters in the range `Q' through `U' may be defined in a
461 machine-dependent fashion to stand for arbitrary operand types.
462 The machine description macro `EXTRA_CONSTRAINT' is passed the
463 operand as its first argument and the constraint letter as its
464 second operand.
466 `Q' is for memory references using take more than 1 instruction.
467 `R' is for memory references which take 1 word for the instruction. */
469 #define EXTRA_CONSTRAINT(OP,CODE) \
470 ((GET_CODE (OP) != MEM) ? 0 \
471 : !legitimate_address_p (GET_MODE (OP), XEXP (OP, 0)) ? 0 \
472 : ((CODE) == 'Q') ? !simple_memory_operand (OP, GET_MODE (OP)) \
473 : ((CODE) == 'R') ? simple_memory_operand (OP, GET_MODE (OP)) \
474 : 0)
476 /* Given an rtx X being reloaded into a reg required to be
477 in class CLASS, return the class of reg to actually use.
478 In general this is just CLASS; but on some machines
479 in some cases it is preferable to use a more restrictive class.
481 loading is easier into LOAD_FPU_REGS than FPU_REGS! */
483 #define PREFERRED_RELOAD_CLASS(X,CLASS) \
484 (((CLASS) != FPU_REGS)?(CLASS):LOAD_FPU_REGS)
486 #define SECONDARY_RELOAD_CLASS(CLASS,MODE,x) \
487 (((CLASS) == NO_LOAD_FPU_REGS && !(REG_P(x) && LOAD_FPU_REG_P(REGNO(x))))?LOAD_FPU_REGS:NO_REGS)
489 /* Return the maximum number of consecutive registers
490 needed to represent mode MODE in a register of class CLASS. */
491 #define CLASS_MAX_NREGS(CLASS, MODE) \
492 ((CLASS == GENERAL_REGS || CLASS == MUL_REGS)? \
493 ((GET_MODE_SIZE (MODE) + UNITS_PER_WORD - 1) / UNITS_PER_WORD): \
498 /* Stack layout; function entry, exit and calling. */
500 /* Define this if pushing a word on the stack
501 makes the stack pointer a smaller address. */
502 #define STACK_GROWS_DOWNWARD
504 /* Define this if the nominal address of the stack frame
505 is at the high-address end of the local variables;
506 that is, each additional local variable allocated
507 goes at a more negative offset in the frame.
509 #define FRAME_GROWS_DOWNWARD
511 /* Offset within stack frame to start allocating local variables at.
512 If FRAME_GROWS_DOWNWARD, this is the offset to the END of the
513 first local allocated. Otherwise, it is the offset to the BEGINNING
514 of the first local allocated. */
515 #define STARTING_FRAME_OFFSET 0
517 /* If we generate an insn to push BYTES bytes,
518 this says how many the stack pointer really advances by.
519 On the pdp11, the stack is on an even boundary */
520 #define PUSH_ROUNDING(BYTES) ((BYTES + 1) & ~1)
522 /* current_first_parm_offset stores the # of registers pushed on the
523 stack */
524 extern int current_first_parm_offset;
526 /* Offset of first parameter from the argument pointer register value.
527 For the pdp11, this is non-zero to account for the return address.
528 1 - return address
529 2 - frame pointer (always saved, even when not used!!!!)
530 -- chnage some day !!!:q!
533 #define FIRST_PARM_OFFSET(FNDECL) 4
535 /* Value is 1 if returning from a function call automatically
536 pops the arguments described by the number-of-args field in the call.
537 FUNDECL is the declaration node of the function (as a tree),
538 FUNTYPE is the data type of the function (as a tree),
539 or for a library call it is an identifier node for the subroutine name. */
541 #define RETURN_POPS_ARGS(FUNDECL,FUNTYPE,SIZE) 0
543 /* Define how to find the value returned by a function.
544 VALTYPE is the data type of the value (as a tree).
545 If the precise function being called is known, FUNC is its FUNCTION_DECL;
546 otherwise, FUNC is 0. */
547 #define BASE_RETURN_VALUE_REG(MODE) \
548 ((MODE) == DFmode ? 8 : 0)
550 /* On the pdp11 the value is found in R0 (or ac0???
551 not without FPU!!!! ) */
553 #define FUNCTION_VALUE(VALTYPE, FUNC) \
554 gen_rtx_REG (TYPE_MODE (VALTYPE), BASE_RETURN_VALUE_REG(TYPE_MODE(VALTYPE)))
556 /* and the called function leaves it in the first register.
557 Difference only on machines with register windows. */
559 #define FUNCTION_OUTGOING_VALUE(VALTYPE, FUNC) \
560 gen_rtx_REG (TYPE_MODE (VALTYPE), BASE_RETURN_VALUE_REG(TYPE_MODE(VALTYPE)))
562 /* Define how to find the value returned by a library function
563 assuming the value has mode MODE. */
565 #define LIBCALL_VALUE(MODE) gen_rtx_REG (MODE, BASE_RETURN_VALUE_REG(MODE))
567 /* 1 if N is a possible register number for a function value
568 as seen by the caller.
569 On the pdp, the first "output" reg is the only register thus used.
571 maybe ac0 ? - as option someday! */
573 #define FUNCTION_VALUE_REGNO_P(N) (((N) == 0) || (TARGET_AC0 && (N) == 8))
575 /* should probably return DImode and DFmode in memory,lest
576 we fill up all regs!
578 have to, else we crash - exception: maybe return result in
579 ac0 if DFmode and FPU present - compatibility problem with
580 libraries for non-floating point ...
583 #define RETURN_IN_MEMORY(TYPE) \
584 (TYPE_MODE(TYPE) == DImode || (TYPE_MODE(TYPE) == DFmode && ! TARGET_AC0))
587 /* 1 if N is a possible register number for function argument passing.
588 - not used on pdp */
590 #define FUNCTION_ARG_REGNO_P(N) 0
592 /* Define a data type for recording info about an argument list
593 during the scan of that argument list. This data type should
594 hold all necessary information about the function itself
595 and about the args processed so far, enough to enable macros
596 such as FUNCTION_ARG to determine where the next arg should go.
600 #define CUMULATIVE_ARGS int
602 /* Initialize a variable CUM of type CUMULATIVE_ARGS
603 for a call to a function whose data type is FNTYPE.
604 For a library call, FNTYPE is 0.
606 ...., the offset normally starts at 0, but starts at 1 word
607 when the function gets a structure-value-address as an
608 invisible first argument. */
610 #define INIT_CUMULATIVE_ARGS(CUM,FNTYPE,LIBNAME,INDIRECT) \
611 ((CUM) = 0)
613 /* Update the data in CUM to advance over an argument
614 of mode MODE and data type TYPE.
615 (TYPE is null for libcalls where that information may not be available.)
620 #define FUNCTION_ARG_ADVANCE(CUM, MODE, TYPE, NAMED) \
621 ((CUM) += ((MODE) != BLKmode \
622 ? (GET_MODE_SIZE (MODE)) \
623 : (int_size_in_bytes (TYPE))))
625 /* Determine where to put an argument to a function.
626 Value is zero to push the argument on the stack,
627 or a hard register in which to store the argument.
629 MODE is the argument's machine mode.
630 TYPE is the data type of the argument (as a tree).
631 This is null for libcalls where that information may
632 not be available.
633 CUM is a variable of type CUMULATIVE_ARGS which gives info about
634 the preceding args and about the function being called.
635 NAMED is nonzero if this argument is a named parameter
636 (otherwise it is an extra parameter matching an ellipsis). */
638 #define FUNCTION_ARG(CUM, MODE, TYPE, NAMED) 0
640 /* Define where a function finds its arguments.
641 This would be different from FUNCTION_ARG if we had register windows. */
643 #define FUNCTION_INCOMING_ARG(CUM, MODE, TYPE, NAMED) \
644 FUNCTION_ARG (CUM, MODE, TYPE, NAMED)
647 /* For an arg passed partly in registers and partly in memory,
648 this is the number of registers used.
649 For args passed entirely in registers or entirely in memory, zero. */
651 #define FUNCTION_ARG_PARTIAL_NREGS(CUM, MODE, TYPE, NAMED) 0
653 /* This macro generates the assembly code for function entry. */
654 #define FUNCTION_PROLOGUE(FILE, SIZE) \
655 output_function_prologue(FILE, SIZE);
657 /* Output assembler code to FILE to increment profiler label # LABELNO
658 for profiling a function entry. */
660 #define FUNCTION_PROFILER(FILE, LABELNO) \
661 abort ();
663 /* EXIT_IGNORE_STACK should be nonzero if, when returning from a function,
664 the stack pointer does not matter. The value is tested only in
665 functions that have frame pointers.
666 No definition is equivalent to always zero. */
668 extern int may_call_alloca;
670 #define EXIT_IGNORE_STACK 1
672 /* This macro generates the assembly code for function exit,
673 on machines that need it. If FUNCTION_EPILOGUE is not defined
674 then individual return instructions are generated for each
675 return statement. Args are same as for FUNCTION_PROLOGUE.
678 #define FUNCTION_EPILOGUE(FILE, SIZE) \
679 output_function_epilogue(FILE, SIZE);
681 #define INITIAL_FRAME_POINTER_OFFSET(DEPTH_VAR) \
683 int offset, regno; \
684 offset = get_frame_size(); \
685 for (regno = 0; regno < 8; regno++) \
686 if (regs_ever_live[regno] && ! call_used_regs[regno]) \
687 offset += 2; \
688 for (regno = 8; regno < 14; regno++) \
689 if (regs_ever_live[regno] && ! call_used_regs[regno]) \
690 offset += 8; \
691 /* offset -= 2; no fp on stack frame */ \
692 (DEPTH_VAR) = offset; \
696 /* Addressing modes, and classification of registers for them. */
698 #define HAVE_POST_INCREMENT 1
699 /* #define HAVE_POST_DECREMENT 0 */
701 #define HAVE_PRE_DECREMENT 1
702 /* #define HAVE_PRE_INCREMENT 0 */
704 /* Macros to check register numbers against specific register classes. */
706 /* These assume that REGNO is a hard or pseudo reg number.
707 They give nonzero only if REGNO is a hard reg of the suitable class
708 or a pseudo reg currently allocated to a suitable hard reg.
709 Since they use reg_renumber, they are safe only once reg_renumber
710 has been allocated, which happens in local-alloc.c. */
712 #define REGNO_OK_FOR_INDEX_P(REGNO) \
713 ((REGNO) < 8 || (unsigned) reg_renumber[REGNO] < 8)
714 #define REGNO_OK_FOR_BASE_P(REGNO) \
715 ((REGNO) < 8 || (unsigned) reg_renumber[REGNO] < 8)
717 /* Now macros that check whether X is a register and also,
718 strictly, whether it is in a specified class.
723 /* Maximum number of registers that can appear in a valid memory address. */
725 #define MAX_REGS_PER_ADDRESS 2
727 /* Recognize any constant value that is a valid address. */
729 #define CONSTANT_ADDRESS_P(X) CONSTANT_P (X)
731 /* Nonzero if the constant value X is a legitimate general operand.
732 It is given that X satisfies CONSTANT_P or is a CONST_DOUBLE. */
734 #define LEGITIMATE_CONSTANT_P(X) (1)
736 /* The macros REG_OK_FOR..._P assume that the arg is a REG rtx
737 and check its validity for a certain class.
738 We have two alternate definitions for each of them.
739 The usual definition accepts all pseudo regs; the other rejects
740 them unless they have been allocated suitable hard regs.
741 The symbol REG_OK_STRICT causes the latter definition to be used.
743 Most source files want to accept pseudo regs in the hope that
744 they will get allocated to the class that the insn wants them to be in.
745 Source files for reload pass need to be strict.
746 After reload, it makes no difference, since pseudo regs have
747 been eliminated by then. */
749 #ifndef REG_OK_STRICT
751 /* Nonzero if X is a hard reg that can be used as an index
752 or if it is a pseudo reg. */
753 #define REG_OK_FOR_INDEX_P(X) (1)
754 /* Nonzero if X is a hard reg that can be used as a base reg
755 or if it is a pseudo reg. */
756 #define REG_OK_FOR_BASE_P(X) (1)
758 #else
760 /* Nonzero if X is a hard reg that can be used as an index. */
761 #define REG_OK_FOR_INDEX_P(X) REGNO_OK_FOR_INDEX_P (REGNO (X))
762 /* Nonzero if X is a hard reg that can be used as a base reg. */
763 #define REG_OK_FOR_BASE_P(X) REGNO_OK_FOR_BASE_P (REGNO (X))
765 #endif
767 /* GO_IF_LEGITIMATE_ADDRESS recognizes an RTL expression
768 that is a valid memory address for an instruction.
769 The MODE argument is the machine mode for the MEM expression
770 that wants to use this address.
774 #define GO_IF_LEGITIMATE_ADDRESS(mode, operand, ADDR) \
776 rtx xfoob; \
778 /* accept (R0) */ \
779 if (GET_CODE (operand) == REG \
780 && REG_OK_FOR_BASE_P(operand)) \
781 goto ADDR; \
783 /* accept @#address */ \
784 if (CONSTANT_ADDRESS_P (operand)) \
785 goto ADDR; \
787 /* accept X(R0) */ \
788 if (GET_CODE (operand) == PLUS \
789 && GET_CODE (XEXP (operand, 0)) == REG \
790 && REG_OK_FOR_BASE_P (XEXP (operand, 0)) \
791 && CONSTANT_ADDRESS_P (XEXP (operand, 1))) \
792 goto ADDR; \
794 /* accept -(R0) */ \
795 if (GET_CODE (operand) == PRE_DEC \
796 && GET_CODE (XEXP (operand, 0)) == REG \
797 && REG_OK_FOR_BASE_P (XEXP (operand, 0))) \
798 goto ADDR; \
800 /* accept (R0)+ */ \
801 if (GET_CODE (operand) == POST_INC \
802 && GET_CODE (XEXP (operand, 0)) == REG \
803 && REG_OK_FOR_BASE_P (XEXP (operand, 0))) \
804 goto ADDR; \
806 /* handle another level of indirection ! */ \
807 if (GET_CODE(operand) != MEM) \
808 goto fail; \
810 xfoob = XEXP (operand, 0); \
812 /* (MEM:xx (MEM:xx ())) is not valid for SI, DI and currently */ \
813 /* also forbidden for float, because we have to handle this */ \
814 /* in output_move_double and/or output_move_quad() - we could */ \
815 /* do it, but currently it's not worth it!!! */ \
816 /* now that DFmode cannot go into CPU register file, */ \
817 /* maybe I should allow float ... */ \
818 /* but then I have to handle memory-to-memory moves in movdf ?? */ \
820 if (GET_MODE_BITSIZE(mode) > 16) \
821 goto fail; \
823 /* accept @(R0) - which is @0(R0) */ \
824 if (GET_CODE (xfoob) == REG \
825 && REG_OK_FOR_BASE_P(xfoob)) \
826 goto ADDR; \
828 /* accept @address */ \
829 if (CONSTANT_ADDRESS_P (xfoob)) \
830 goto ADDR; \
832 /* accept @X(R0) */ \
833 if (GET_CODE (xfoob) == PLUS \
834 && GET_CODE (XEXP (xfoob, 0)) == REG \
835 && REG_OK_FOR_BASE_P (XEXP (xfoob, 0)) \
836 && CONSTANT_ADDRESS_P (XEXP (xfoob, 1))) \
837 goto ADDR; \
839 /* accept @-(R0) */ \
840 if (GET_CODE (xfoob) == PRE_DEC \
841 && GET_CODE (XEXP (xfoob, 0)) == REG \
842 && REG_OK_FOR_BASE_P (XEXP (xfoob, 0))) \
843 goto ADDR; \
845 /* accept @(R0)+ */ \
846 if (GET_CODE (xfoob) == POST_INC \
847 && GET_CODE (XEXP (xfoob, 0)) == REG \
848 && REG_OK_FOR_BASE_P (XEXP (xfoob, 0))) \
849 goto ADDR; \
851 /* anything else is invalid */ \
852 fail: ; \
856 /* Try machine-dependent ways of modifying an illegitimate address
857 to be legitimate. If we find one, return the new, valid address.
858 This macro is used in only one place: `memory_address' in explow.c.
860 OLDX is the address as it was before break_out_memory_refs was called.
861 In some cases it is useful to look at this to decide what needs to be done.
863 MODE and WIN are passed so that this macro can use
864 GO_IF_LEGITIMATE_ADDRESS.
866 It is always safe for this macro to do nothing. It exists to recognize
867 opportunities to optimize the output. */
869 #define LEGITIMIZE_ADDRESS(X,OLDX,MODE,WIN) {}
872 /* Go to LABEL if ADDR (a legitimate address expression)
873 has an effect that depends on the machine mode it is used for.
874 On the pdp this is for predec/postinc */
876 #define GO_IF_MODE_DEPENDENT_ADDRESS(ADDR,LABEL) \
877 { if (GET_CODE (ADDR) == POST_INC || GET_CODE (ADDR) == PRE_DEC) \
878 goto LABEL; \
882 /* Specify the machine mode that this machine uses
883 for the index in the tablejump instruction. */
884 #define CASE_VECTOR_MODE HImode
886 /* Define this if a raw index is all that is needed for a
887 `tablejump' insn. */
888 #define CASE_TAKES_INDEX_RAW
890 /* Define as C expression which evaluates to nonzero if the tablejump
891 instruction expects the table to contain offsets from the address of the
892 table.
893 Do not define this if the table should contain absolute addresses. */
894 /* #define CASE_VECTOR_PC_RELATIVE 1 */
896 /* Specify the tree operation to be used to convert reals to integers. */
897 #define IMPLICIT_FIX_EXPR FIX_ROUND_EXPR
899 /* This is the kind of divide that is easiest to do in the general case. */
900 #define EASY_DIV_EXPR TRUNC_DIV_EXPR
902 /* Define this as 1 if `char' should by default be signed; else as 0. */
903 #define DEFAULT_SIGNED_CHAR 1
905 /* Max number of bytes we can move from memory to memory
906 in one reasonably fast instruction.
909 #define MOVE_MAX 2
911 /* Zero extension is faster if the target is known to be zero */
912 /* #define SLOW_ZERO_EXTEND */
914 /* Nonzero if access to memory by byte is slow and undesirable. -
916 #define SLOW_BYTE_ACCESS 0
918 /* Do not break .stabs pseudos into continuations. */
919 #define DBX_CONTIN_LENGTH 0
921 /* Value is 1 if truncating an integer of INPREC bits to OUTPREC bits
922 is done just by pretending it is already truncated. */
923 #define TRULY_NOOP_TRUNCATION(OUTPREC, INPREC) 1
926 /* Add any extra modes needed to represent the condition code.
928 CCFPmode is used for FPU, but should we use a separate reg? */
929 #define EXTRA_CC_MODES CC(CCFPmode, "CCFP")
931 /* Give a comparison code (EQ, NE etc) and the first operand of a COMPARE,
932 return the mode to be used for the comparison. For floating-point, CCFPmode
933 should be used. */
935 #define SELECT_CC_MODE(OP,X,Y) \
936 (GET_MODE_CLASS(GET_MODE(X)) == MODE_FLOAT? CCFPmode : CCmode)
938 /* We assume that the store-condition-codes instructions store 0 for false
939 and some other value for true. This is the value stored for true. */
941 /* #define STORE_FLAG_VALUE 1 */
943 /* Specify the machine mode that pointers have.
944 After generation of rtl, the compiler makes no further distinction
945 between pointers and any other objects of this machine mode. */
946 #define Pmode HImode
948 /* A function address in a call instruction
949 is a word address (for indexing purposes)
950 so give the MEM rtx a word's mode. */
951 #define FUNCTION_MODE HImode
953 /* Define this if addresses of constant functions
954 shouldn't be put through pseudo regs where they can be cse'd.
955 Desirable on machines where ordinary constants are expensive
956 but a CALL with constant address is cheap. */
957 /* #define NO_FUNCTION_CSE */
959 /* Compute the cost of computing a constant rtl expression RTX
960 whose rtx-code is CODE. The body of this macro is a portion
961 of a switch statement. If the code is computed here,
962 return it with a return statement. Otherwise, break from the switch.
964 -1, 0, 1 are cheaper for add, sub ...
967 #define CONST_COSTS(RTX,CODE,OUTER_CODE) \
968 case CONST_INT: \
969 if (INTVAL(RTX) == 0 \
970 || INTVAL(RTX) == -1 \
971 || INTVAL(RTX) == 1) \
972 return 0; \
973 case CONST: \
974 case LABEL_REF: \
975 case SYMBOL_REF: \
976 /* twice as expensive as REG */ \
977 return 2; \
978 case CONST_DOUBLE: \
979 /* twice (or 4 times) as expensive as 16 bit */ \
980 return 4;
982 /* cost of moving one register class to another */
983 #define REGISTER_MOVE_COST(CLASS1, CLASS2) register_move_cost(CLASS1, CLASS2)
985 /* Tell emit-rtl.c how to initialize special values on a per-function base. */
986 extern int optimize;
987 extern struct rtx_def *cc0_reg_rtx;
989 #define CC_STATUS_MDEP rtx
991 #define CC_STATUS_MDEP_INIT (cc_status.mdep = 0)
993 /* Tell final.c how to eliminate redundant test instructions. */
995 /* Here we define machine-dependent flags and fields in cc_status
996 (see `conditions.h'). */
998 #define CC_IN_FPU 04000
1000 /* Do UPDATE_CC if EXP is a set, used in
1001 NOTICE_UPDATE_CC
1003 floats only do compare correctly, else nullify ...
1005 get cc0 out soon ...
1008 /* Store in cc_status the expressions
1009 that the condition codes will describe
1010 after execution of an instruction whose pattern is EXP.
1011 Do not alter them if the instruction would not alter the cc's. */
1013 #define NOTICE_UPDATE_CC(EXP, INSN) \
1014 { if (GET_CODE (EXP) == SET) \
1016 notice_update_cc_on_set(EXP, INSN); \
1018 else if (GET_CODE (EXP) == PARALLEL \
1019 && GET_CODE (XVECEXP (EXP, 0, 0)) == SET) \
1021 notice_update_cc_on_set(XVECEXP (EXP, 0, 0), INSN); \
1023 else if (GET_CODE (EXP) == CALL) \
1024 { /* all bets are off */ CC_STATUS_INIT; } \
1025 if (cc_status.value1 && GET_CODE (cc_status.value1) == REG \
1026 && cc_status.value2 \
1027 && reg_overlap_mentioned_p (cc_status.value1, cc_status.value2)) \
1029 printf ("here!\n"); \
1030 cc_status.value2 = 0; \
1034 /* Control the assembler format that we output. */
1036 /* Output at beginning of assembler file. */
1038 #if 0
1039 #define ASM_FILE_START(FILE) \
1041 fprintf (FILE, "\t.data\n"), \
1042 fprintf (FILE, "$help$: . = .+8 ; space for tmp moves!\n") \
1043 /* do we need reg def's R0 = %0 etc ??? */ \
1045 #else
1046 #define ASM_FILE_START(FILE)
1047 #endif
1050 /* Output to assembler file text saying following lines
1051 may contain character constants, extra white space, comments, etc. */
1053 #define ASM_APP_ON ""
1055 /* Output to assembler file text saying following lines
1056 no longer contain unusual constructs. */
1058 #define ASM_APP_OFF ""
1060 /* Output before read-only data. */
1062 #define TEXT_SECTION_ASM_OP "\t.text\n"
1064 /* Output before writable data. */
1066 #define DATA_SECTION_ASM_OP "\t.data\n"
1068 /* How to refer to registers in assembler output.
1069 This sequence is indexed by compiler's hard-register-number (see above). */
1071 #define REGISTER_NAMES \
1072 {"r0", "r1", "r2", "r3", "r4", "r5", "sp", "pc", \
1073 "ac0", "ac1", "ac2", "ac3", "ac4", "ac5" }
1075 /* How to renumber registers for dbx and gdb. */
1077 #define DBX_REGISTER_NUMBER(REGNO) (REGNO)
1079 /* This is how to output the definition of a user-level label named NAME,
1080 such as the label on a static function or variable NAME. */
1082 #define ASM_OUTPUT_LABEL(FILE,NAME) \
1083 do { assemble_name (FILE, NAME); fputs (":\n", FILE); } while (0)
1085 /* This is how to output a command to make the user-level label named NAME
1086 defined for reference from other files. */
1088 #define ASM_GLOBALIZE_LABEL(FILE,NAME) \
1089 do { fputs ("\t.globl ", FILE); assemble_name (FILE, NAME); fputs("\n", FILE); } while (0)
1091 /* The prefix to add to user-visible assembler symbols. */
1093 #define USER_LABEL_PREFIX "_"
1095 /* This is how to output an internal numbered label where
1096 PREFIX is the class of label and NUM is the number within the class. */
1098 #define ASM_OUTPUT_INTERNAL_LABEL(FILE,PREFIX,NUM) \
1099 fprintf (FILE, "%s_%d:\n", PREFIX, NUM)
1101 /* This is how to store into the string LABEL
1102 the symbol_ref name of an internal numbered label where
1103 PREFIX is the class of label and NUM is the number within the class.
1104 This is suitable for output with `assemble_name'. */
1106 #define ASM_GENERATE_INTERNAL_LABEL(LABEL,PREFIX,NUM) \
1107 sprintf (LABEL, "*%s_%d", PREFIX, NUM)
1109 /* This is how to output an assembler line defining a `double' constant. */
1111 #define ASM_OUTPUT_DOUBLE(FILE,VALUE) \
1112 fprintf (FILE, "\tdouble %.20e\n", (VALUE))
1114 /* This is how to output an assembler line defining a `float' constant. */
1116 #define ASM_OUTPUT_FLOAT(FILE,VALUE) \
1117 fprintf (FILE, "\tfloat %.12e\n", (VALUE))
1119 /* Likewise for `short' and `char' constants. */
1121 #define ASM_OUTPUT_SHORT(FILE,VALUE) \
1122 ( fprintf (FILE, TARGET_UNIX_ASM ? "\t" : "\t.word "), \
1123 output_addr_const_pdp11 (FILE, (VALUE)), \
1124 fprintf (FILE, " /*short*/\n"))
1126 #define ASM_OUTPUT_CHAR(FILE,VALUE) \
1127 ( fprintf (FILE, "\t.byte "), \
1128 output_addr_const_pdp11 (FILE, (VALUE)), \
1129 fprintf (FILE, " /* char */\n"))
1131 /* This is how to output an assembler line for a numeric constant byte.
1132 This won't actually be used since we define ASM_OUTPUT_CHAR.
1135 #define ASM_OUTPUT_BYTE(FILE,VALUE) \
1136 fprintf (FILE, "\t.byte %o\n", (VALUE))
1138 #define ASM_OUTPUT_ASCII(FILE, P, SIZE) \
1139 output_ascii (FILE, P, SIZE)
1141 /* This is how to output an element of a case-vector that is absolute. */
1143 #define ASM_OUTPUT_ADDR_VEC_ELT(FILE, VALUE) \
1144 fprintf (FILE, "\t%sL_%d\n", TARGET_UNIX_ASM ? "" : ".word ", VALUE)
1146 /* This is how to output an element of a case-vector that is relative.
1147 Don't define this if it is not supported. */
1149 /* #define ASM_OUTPUT_ADDR_DIFF_ELT(FILE, VALUE, REL) */
1151 /* This is how to output an assembler line
1152 that says to advance the location counter
1153 to a multiple of 2**LOG bytes.
1155 who needs this????
1158 #define ASM_OUTPUT_ALIGN(FILE,LOG) \
1159 switch (LOG) \
1161 case 0: \
1162 break; \
1163 case 1: \
1164 fprintf (FILE, "\t.even\n"); \
1165 break; \
1166 default: \
1167 abort (); \
1170 #define ASM_OUTPUT_SKIP(FILE,SIZE) \
1171 fprintf (FILE, "\t.=.+ %o\n", (SIZE))
1173 /* This says how to output an assembler line
1174 to define a global common symbol. */
1176 #define ASM_OUTPUT_COMMON(FILE, NAME, SIZE, ROUNDED) \
1177 ( fprintf ((FILE), ".globl "), \
1178 assemble_name ((FILE), (NAME)), \
1179 fprintf ((FILE), "\n"), \
1180 assemble_name ((FILE), (NAME)), \
1181 fprintf ((FILE), ": .=.+ %o\n", (ROUNDED)) \
1184 /* This says how to output an assembler line
1185 to define a local common symbol. */
1187 #define ASM_OUTPUT_LOCAL(FILE, NAME, SIZE, ROUNDED) \
1188 ( assemble_name ((FILE), (NAME)), \
1189 fprintf ((FILE), ":\t.=.+ %o\n", (ROUNDED)))
1191 /* Store in OUTPUT a string (made with alloca) containing
1192 an assembler-name for a local static variable named NAME.
1193 LABELNO is an integer which is different for each call. */
1195 #define ASM_FORMAT_PRIVATE_NAME(OUTPUT, NAME, LABELNO) \
1196 ( (OUTPUT) = (char *) alloca (strlen ((NAME)) + 10), \
1197 sprintf ((OUTPUT), "%s.%d", (NAME), (LABELNO)))
1199 /* Define the parentheses used to group arithmetic operations
1200 in assembler code. */
1202 #define ASM_OPEN_PAREN "["
1203 #define ASM_CLOSE_PAREN "]"
1205 /* Define results of standard character escape sequences. */
1206 #define TARGET_BELL 007
1207 #define TARGET_BS 010
1208 #define TARGET_TAB 011
1209 #define TARGET_NEWLINE 012
1210 #define TARGET_VT 013
1211 #define TARGET_FF 014
1212 #define TARGET_CR 015
1214 /* Print operand X (an rtx) in assembler syntax to file FILE.
1215 CODE is a letter or dot (`z' in `%z0') or 0 if no letter was specified.
1216 For `%' followed by punctuation, CODE is the punctuation and X is null.
1221 #define PRINT_OPERAND(FILE, X, CODE) \
1222 { if (CODE == '#') fprintf (FILE, "#"); \
1223 else if (GET_CODE (X) == REG) \
1224 fprintf (FILE, "%s", reg_names[REGNO (X)]); \
1225 else if (GET_CODE (X) == MEM) \
1226 output_address (XEXP (X, 0)); \
1227 else if (GET_CODE (X) == CONST_DOUBLE && GET_MODE (X) != SImode) \
1228 { union { double d; int i[2]; } u; \
1229 u.i[0] = CONST_DOUBLE_LOW (X); u.i[1] = CONST_DOUBLE_HIGH (X); \
1230 fprintf (FILE, "#%.20e", u.d); } \
1231 else { putc ('$', FILE); output_addr_const_pdp11 (FILE, X); }}
1233 /* Print a memory address as an operand to reference that memory location. */
1235 #define PRINT_OPERAND_ADDRESS(FILE, ADDR) \
1236 print_operand_address (FILE, ADDR)
1238 #define ASM_OUTPUT_REG_PUSH(FILE,REGNO) \
1240 fprintf (FILE, "\tmov %s, -(sp)\n", reg_names[REGNO]) \
1243 #define ASM_OUTPUT_REG_POP(FILE,REGNO) \
1245 fprintf (FILE, "\tmov (sp)+, %s\n", reg_names[REGNO]) \
1249 #define ASM_IDENTIFY_GCC(FILE) \
1250 fprintf(FILE, "gcc_compiled:\n")
1252 /* trampoline - how should i do it in separate i+d ?
1253 have some allocate_trampoline magic???
1255 the following should work for shared I/D: */
1257 /* lets see whether this works as trampoline:
1258 MV #STATIC, $4 0x940Y 0x0000 <- STATIC; Y = STATIC_CHAIN_REGNUM
1259 JMP FUNCTION 0x0058 0x0000 <- FUNCTION
1262 #define TRAMPOLINE_TEMPLATE(FILE) \
1264 if (TARGET_SPLIT) \
1265 abort(); \
1267 ASM_OUTPUT_SHORT (FILE, GEN_INT (0x9400+STATIC_CHAIN_REGNUM)); \
1268 ASM_OUTPUT_SHORT (FILE, const0_rtx); \
1269 ASM_OUTPUT_SHORT (FILE, GEN_INT(0x0058)); \
1270 ASM_OUTPUT_SHORT (FILE, const0_rtx); \
1273 #define TRAMPOLINE_SIZE 8
1274 #define TRAMPOLINE_ALIGN 16
1276 /* Emit RTL insns to initialize the variable parts of a trampoline.
1277 FNADDR is an RTX for the address of the function's pure code.
1278 CXT is an RTX for the static chain value for the function. */
1280 #define INITIALIZE_TRAMPOLINE(TRAMP,FNADDR,CXT) \
1282 if (TARGET_SPLIT) \
1283 abort(); \
1285 emit_move_insn (gen_rtx_MEM (HImode, plus_constant (TRAMP, 2)), CXT); \
1286 emit_move_insn (gen_rtx_MEM (HImode, plus_constant (TRAMP, 6)), FNADDR); \
1290 /* Some machines may desire to change what optimizations are
1291 performed for various optimization levels. This macro, if
1292 defined, is executed once just after the optimization level is
1293 determined and before the remainder of the command options have
1294 been parsed. Values set in this macro are used as the default
1295 values for the other command line options.
1297 LEVEL is the optimization level specified; 2 if -O2 is
1298 specified, 1 if -O is specified, and 0 if neither is specified. */
1300 #define OPTIMIZATION_OPTIONS(LEVEL,SIZE) \
1302 if (LEVEL >= 3) \
1304 if (! SIZE) \
1305 flag_inline_functions = 1; \
1306 flag_omit_frame_pointer = 1; \
1307 /* flag_unroll_loops = 1; */ \
1312 /* Provide the costs of a rtl expression. This is in the body of a
1313 switch on CODE.
1315 we don't say how expensive SImode is - pretty expensive!!!
1317 there is something wrong in MULT because MULT is not
1318 as cheap as total = 2 even if we can shift!
1320 if optimizing for size make mult etc cheap, but not 1, so when
1321 in doubt the faster insn is chosen.
1324 #define RTX_COSTS(X,CODE,OUTER_CODE) \
1325 case MULT: \
1326 if (optimize_size) \
1327 total = COSTS_N_INSNS(2); \
1328 else \
1329 total = COSTS_N_INSNS (11); \
1330 break; \
1331 case DIV: \
1332 if (optimize_size) \
1333 total = COSTS_N_INSNS(2); \
1334 else \
1335 total = COSTS_N_INSNS (25); \
1336 break; \
1337 case MOD: \
1338 if (optimize_size) \
1339 total = COSTS_N_INSNS(2); \
1340 else \
1341 total = COSTS_N_INSNS (26); \
1342 break; \
1343 case ABS: \
1344 /* equivalent to length, so same for optimize_size */ \
1345 total = COSTS_N_INSNS (3); \
1346 break; \
1347 case ZERO_EXTEND: \
1348 /* only used for: qi->hi */ \
1349 total = COSTS_N_INSNS(1); \
1350 break; \
1351 case SIGN_EXTEND: \
1352 if (GET_MODE(X) == HImode) \
1353 total = COSTS_N_INSNS(1); \
1354 else if (GET_MODE(X) == SImode) \
1355 total = COSTS_N_INSNS(6); \
1356 else \
1357 total = COSTS_N_INSNS(2); \
1358 break; \
1359 /* case LSHIFT: */ \
1360 case ASHIFT: \
1361 case LSHIFTRT: \
1362 case ASHIFTRT: \
1363 if (optimize_size) \
1364 total = COSTS_N_INSNS(1); \
1365 else if (GET_MODE(X) == QImode) \
1367 if (GET_CODE(XEXP (X,1)) != CONST_INT) \
1368 total = COSTS_N_INSNS(8); /* worst case */ \
1369 else \
1370 total = COSTS_N_INSNS(INTVAL(XEXP (X,1))); \
1372 else if (GET_MODE(X) == HImode) \
1374 if (GET_CODE(XEXP (X,1)) == CONST_INT) \
1376 if (abs (INTVAL (XEXP (X, 1))) == 1) \
1377 total = COSTS_N_INSNS(1); \
1378 else \
1379 total = COSTS_N_INSNS(2.5 + 0.5 *INTVAL(XEXP(X,1))); \
1381 else /* worst case */ \
1382 total = COSTS_N_INSNS (10); \
1384 else if (GET_MODE(X) == SImode) \
1386 if (GET_CODE(XEXP (X,1)) == CONST_INT) \
1387 total = COSTS_N_INSNS(2.5 + 0.5 *INTVAL(XEXP(X,1))); \
1388 else /* worst case */ \
1389 total = COSTS_N_INSNS(18); \
1391 break;
1394 /* there is no point in avoiding branches on a pdp,
1395 since branches are really cheap - I just want to find out
1396 how much difference the BRANCH_COST macro makes in code */
1397 #define BRANCH_COST (TARGET_BRANCH_CHEAP ? 0 : 1)
1400 #define COMPARE_FLAG_MODE HImode