* config/i386/netbsd-elf.h (TARGET_OS_CPP_BUILTINS): Define.
[official-gcc.git] / gcc / config / pdp11 / pdp11.h
blob99bb7fe32d529af1240ef7f4f840cf4af46130aa
1 /* Definitions of target machine for GNU compiler, for the pdp-11
2 Copyright (C) 1994, 1995, 1996, 1998, 1999, 2000, 2001, 2002
3 Free Software Foundation, Inc.
4 Contributed by Michael K. Gschwind (mike@vlsivie.tuwien.ac.at).
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 /* check whether load_fpu_reg or not */
25 #define LOAD_FPU_REG_P(x) ((x)>=8 && (x)<=11)
26 #define NO_LOAD_FPU_REG_P(x) ((x)==12 || (x)==13)
27 #define FPU_REG_P(x) (LOAD_FPU_REG_P(x) || NO_LOAD_FPU_REG_P(x))
28 #define CPU_REG_P(x) ((x)<8)
30 /* Names to predefine in the preprocessor for this target machine. */
32 #define CPP_PREDEFINES "-Dpdp11"
34 /* Print subsidiary information on the compiler version in use. */
35 #define TARGET_VERSION fprintf (stderr, " (pdp11)");
38 /* Generate DBX debugging information. */
40 /* #define DBX_DEBUGGING_INFO */
42 /* Run-time compilation parameters selecting different hardware subsets.
45 extern int target_flags;
47 /* Macro to define tables used to set the flags.
48 This is a list in braces of triplets in braces,
49 each triplet being { "NAME", VALUE, DOC }
50 where VALUE is the bits to set or minus the bits to clear and DOC
51 is the documentation for --help (NULL if intentionally undocumented).
52 An empty string NAME is used to identify the default VALUE. */
54 #define TARGET_SWITCHES \
55 { { "fpu", 1, N_("Use hardware floating point") }, \
56 { "soft-float", -1, N_("Do not use hardware floating point") }, \
57 /* return float result in ac0 */ \
58 { "ac0", 2, N_("Return floating point results in ac0") }, \
59 { "no-ac0", -2, N_("Return floating point results in memory") }, \
60 /* is 11/40 */ \
61 { "40", 4, N_("Generate code for an 11/40") }, \
62 { "no-40", -4, "" }, \
63 /* is 11/45 */ \
64 { "45", 8, N_("Generate code for an 11/45") }, \
65 { "no-45", -8, "" }, \
66 /* is 11/10 */ \
67 { "10", -12, N_("Generate code for an 11/10") }, \
68 /* use movstrhi for bcopy */ \
69 { "bcopy", 16, NULL }, \
70 { "bcopy-builtin", -16, NULL }, \
71 /* use 32 bit for int */ \
72 { "int32", 32, N_("Use 32 bit int") }, \
73 { "no-int16", 32, N_("Use 32 bit int") }, \
74 { "int16", -32, N_("Use 16 bit int") }, \
75 { "no-int32", -32, N_("Use 16 bit int") }, \
76 /* use 32 bit for float */ \
77 { "float32", 64, N_("Use 32 bit float") }, \
78 { "no-float64", 64, N_("Use 32 bit float") }, \
79 { "float64", -64, N_("Use 64 bit float") }, \
80 { "no-float32", -64, N_("Use 64 bit float") }, \
81 /* allow abshi pattern? - can trigger "optimizations" which make code SLOW! */\
82 { "abshi", 128, NULL }, \
83 { "no-abshi", -128, NULL }, \
84 /* is branching expensive - on a PDP, it's actually really cheap */ \
85 /* this is just to play around and check what code gcc generates */ \
86 { "branch-expensive", 256, NULL }, \
87 { "branch-cheap", -256, NULL }, \
88 /* split instruction and data memory? */ \
89 { "split", 1024, N_("Target has split I&D") }, \
90 { "no-split", -1024, N_("Target does not have split I&D") }, \
91 /* UNIX assembler syntax? */ \
92 { "unix-asm", 2048, N_("Use UNIX assembler syntax") }, \
93 { "dec-asm", -2048, N_("Use DEC assembler syntax") }, \
94 /* default */ \
95 { "", TARGET_DEFAULT, NULL} \
98 #define TARGET_DEFAULT (1 | 8 | 128 | TARGET_UNIX_ASM_DEFAULT)
100 #define TARGET_FPU (target_flags & 1)
101 #define TARGET_SOFT_FLOAT (!TARGET_FPU)
103 #define TARGET_AC0 ((target_flags & 2) && TARGET_FPU)
104 #define TARGET_NO_AC0 (! TARGET_AC0)
106 #define TARGET_45 (target_flags & 8)
107 #define TARGET_40_PLUS ((target_flags & 4) || (target_flags & 8))
108 #define TARGET_10 (! TARGET_40_PLUS)
110 #define TARGET_BCOPY_BUILTIN (! (target_flags & 16))
112 #define TARGET_INT16 (! TARGET_INT32)
113 #define TARGET_INT32 (target_flags & 32)
115 #define TARGET_FLOAT32 (target_flags & 64)
116 #define TARGET_FLOAT64 (! TARGET_FLOAT32)
118 #define TARGET_ABSHI_BUILTIN (target_flags & 128)
120 #define TARGET_BRANCH_EXPENSIVE (target_flags & 256)
121 #define TARGET_BRANCH_CHEAP (!TARGET_BRANCH_EXPENSIVE)
123 #define TARGET_SPLIT (target_flags & 1024)
124 #define TARGET_NOSPLIT (! TARGET_SPLIT)
126 #define TARGET_UNIX_ASM (target_flags & 2048)
127 #define TARGET_UNIX_ASM_DEFAULT 0
129 #define ASSEMBLER_DIALECT (TARGET_UNIX_ASM ? 1 : 0)
133 /* TYPE SIZES */
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 */
150 #define WCHAR_TYPE "int" /* or long int???? */
151 #define WCHAR_TYPE_SIZE 16
153 #define PTRDIFF_TYPE "int"
155 /* target machine storage layout */
157 /* Define this if most significant bit is lowest numbered
158 in instructions that operate on numbered bit-fields. */
159 #define BITS_BIG_ENDIAN 0
161 /* Define this if most significant byte of a word is the lowest numbered. */
162 #define BYTES_BIG_ENDIAN 0
164 /* Define this if most significant word of a multiword number is numbered. */
165 #define WORDS_BIG_ENDIAN 1
167 /* Width of a word, in units (bytes).
169 UNITS OR BYTES - seems like units */
170 #define UNITS_PER_WORD 2
172 /* Maximum sized of reasonable data type
173 DImode or Dfmode ...*/
174 #define MAX_FIXED_MODE_SIZE 64
176 /* Allocation boundary (in *bits*) for storing pointers in memory. */
177 #define POINTER_BOUNDARY 16
179 /* Allocation boundary (in *bits*) for storing arguments in argument list. */
180 #define PARM_BOUNDARY 16
182 /* Boundary (in *bits*) on which stack pointer should be aligned. */
183 #define STACK_BOUNDARY 16
185 /* Allocation boundary (in *bits*) for the code of a function. */
186 #define FUNCTION_BOUNDARY 16
188 /* Alignment of field after `int : 0' in a structure. */
189 #define EMPTY_FIELD_BOUNDARY 16
191 /* No data type wants to be aligned rounder than this. */
192 #define BIGGEST_ALIGNMENT 16
194 /* Define this if move instructions will actually fail to work
195 when given unaligned data. */
196 #define STRICT_ALIGNMENT 1
198 /* Standard register usage. */
200 /* Number of actual hardware registers.
201 The hardware registers are assigned numbers for the compiler
202 from 0 to just below FIRST_PSEUDO_REGISTER.
203 All registers that the compiler knows about must be given numbers,
204 even those that are not normally considered general registers.
206 we have 8 integer registers, plus 6 float
207 (don't use scratch float !) */
209 #define FIRST_PSEUDO_REGISTER 14
211 /* 1 for registers that have pervasive standard uses
212 and are not available for the register allocator.
214 On the pdp, these are:
215 Reg 7 = pc;
216 reg 6 = sp;
217 reg 5 = fp; not necessarily!
220 /* don't let them touch fp regs for the time being !*/
222 #define FIXED_REGISTERS \
223 {0, 0, 0, 0, 0, 0, 1, 1, \
224 0, 0, 0, 0, 0, 0 }
228 /* 1 for registers not available across function calls.
229 These must include the FIXED_REGISTERS and also any
230 registers that can be used without being saved.
231 The latter must include the registers where values are returned
232 and the register where structure-value addresses are passed.
233 Aside from that, you can include as many other registers as you like. */
235 /* don't know about fp */
236 #define CALL_USED_REGISTERS \
237 {1, 1, 0, 0, 0, 0, 1, 1, \
238 0, 0, 0, 0, 0, 0 }
241 /* Make sure everything's fine if we *don't* have an FPU.
242 This assumes that putting a register in fixed_regs will keep the
243 compiler's mitts completely off it. We don't bother to zero it out
244 of register classes. Also fix incompatible register naming with
245 the UNIX assembler.
247 #define CONDITIONAL_REGISTER_USAGE \
249 int i; \
250 HARD_REG_SET x; \
251 if (!TARGET_FPU) \
253 COPY_HARD_REG_SET (x, reg_class_contents[(int)FPU_REGS]); \
254 for (i = 0; i < FIRST_PSEUDO_REGISTER; i++ ) \
255 if (TEST_HARD_REG_BIT (x, i)) \
256 fixed_regs[i] = call_used_regs[i] = 1; \
259 if (TARGET_AC0) \
260 call_used_regs[8] = 1; \
261 if (TARGET_UNIX_ASM) \
263 /* Change names of FPU registers for the UNIX assembler. */ \
264 reg_names[8] = "fr0"; \
265 reg_names[9] = "fr1"; \
266 reg_names[10] = "fr2"; \
267 reg_names[11] = "fr3"; \
268 reg_names[12] = "fr4"; \
269 reg_names[13] = "fr5"; \
273 /* Return number of consecutive hard regs needed starting at reg REGNO
274 to hold something of mode MODE.
275 This is ordinarily the length in words of a value of mode MODE
276 but can be less for certain modes in special long registers.
279 #define HARD_REGNO_NREGS(REGNO, MODE) \
280 ((REGNO < 8)? \
281 ((GET_MODE_SIZE (MODE) + UNITS_PER_WORD - 1) / UNITS_PER_WORD) \
285 /* Value is 1 if hard register REGNO can hold a value of machine-mode MODE.
286 On the pdp, the cpu registers can hold any mode - check alignment
288 FPU can only hold DF - simplifies life!
290 #define HARD_REGNO_MODE_OK(REGNO, MODE) \
291 (((REGNO) < 8)? \
292 ((GET_MODE_BITSIZE(MODE) <= 16) \
293 || (GET_MODE_BITSIZE(MODE) == 32 && !((REGNO) & 1))) \
294 :(MODE) == DFmode)
297 /* Value is 1 if it is a good idea to tie two pseudo registers
298 when one has mode MODE1 and one has mode MODE2.
299 If HARD_REGNO_MODE_OK could produce different values for MODE1 and MODE2,
300 for any hard reg, then this must be 0 for correct output. */
301 #define MODES_TIEABLE_P(MODE1, MODE2) 0
303 /* Specify the registers used for certain standard purposes.
304 The values of these macros are register numbers. */
306 /* the pdp11 pc overloaded on a register that the compiler knows about. */
307 #define PC_REGNUM 7
309 /* Register to use for pushing function arguments. */
310 #define STACK_POINTER_REGNUM 6
312 /* Base register for access to local variables of the function. */
313 #define FRAME_POINTER_REGNUM 5
315 /* Value should be nonzero if functions must have frame pointers.
316 Zero means the frame pointer need not be set up (and parms
317 may be accessed via the stack pointer) in functions that seem suitable.
318 This is computed in `reload', in reload1.c.
321 #define FRAME_POINTER_REQUIRED 0
323 /* Base register for access to arguments of the function. */
324 #define ARG_POINTER_REGNUM 5
326 /* Register in which static-chain is passed to a function. */
327 /* ??? - i don't want to give up a reg for this! */
328 #define STATIC_CHAIN_REGNUM 4
330 /* Register in which address to store a structure value
331 is passed to a function.
332 let's make it an invisible first argument!!! */
334 #define STRUCT_VALUE 0
337 /* Define the classes of registers for register constraints in the
338 machine description. Also define ranges of constants.
340 One of the classes must always be named ALL_REGS and include all hard regs.
341 If there is more than one class, another class must be named NO_REGS
342 and contain no registers.
344 The name GENERAL_REGS must be the name of a class (or an alias for
345 another name such as ALL_REGS). This is the class of registers
346 that is allowed by "g" or "r" in a register constraint.
347 Also, registers outside this class are allocated only when
348 instructions express preferences for them.
350 The classes must be numbered in nondecreasing order; that is,
351 a larger-numbered class must never be contained completely
352 in a smaller-numbered class.
354 For any two classes, it is very desirable that there be another
355 class that represents their union. */
357 /* The pdp has a couple of classes:
359 MUL_REGS are used for odd numbered regs, to use in 16 bit multiplication
360 (even numbered do 32 bit multiply)
361 LMUL_REGS long multiply registers (even numbered regs )
362 (don't need them, all 32 bit regs are even numbered!)
363 GENERAL_REGS is all cpu
364 LOAD_FPU_REGS is the first four cpu regs, they are easier to load
365 NO_LOAD_FPU_REGS is ac4 and ac5, currently - difficult to load them
366 FPU_REGS is all fpu regs
369 enum reg_class { NO_REGS, MUL_REGS, GENERAL_REGS, LOAD_FPU_REGS, NO_LOAD_FPU_REGS, FPU_REGS, ALL_REGS, LIM_REG_CLASSES };
371 #define N_REG_CLASSES (int) LIM_REG_CLASSES
373 /* have to allow this till cmpsi/tstsi are fixed in a better way !! */
374 #define SMALL_REGISTER_CLASSES 1
376 /* Since GENERAL_REGS is the same class as ALL_REGS,
377 don't give it a different class number; just make it an alias. */
379 /* #define GENERAL_REGS ALL_REGS */
381 /* Give names of register classes as strings for dump file. */
383 #define REG_CLASS_NAMES {"NO_REGS", "MUL_REGS", "GENERAL_REGS", "LOAD_FPU_REGS", "NO_LOAD_FPU_REGS", "FPU_REGS", "ALL_REGS" }
385 /* Define which registers fit in which classes.
386 This is an initializer for a vector of HARD_REG_SET
387 of length N_REG_CLASSES. */
389 #define REG_CLASS_CONTENTS {{0}, {0x00aa}, {0x00ff}, {0x0f00}, {0x3000}, {0x3f00}, {0x3fff}}
391 /* The same information, inverted:
392 Return the class number of the smallest class containing
393 reg number REGNO. This could be a conditional expression
394 or could index an array. */
396 #define REGNO_REG_CLASS(REGNO) \
397 ((REGNO)>=8?((REGNO)<=11?LOAD_FPU_REGS:NO_LOAD_FPU_REGS):(((REGNO)&1)?MUL_REGS:GENERAL_REGS))
400 /* The class value for index registers, and the one for base regs. */
401 #define INDEX_REG_CLASS GENERAL_REGS
402 #define BASE_REG_CLASS GENERAL_REGS
404 /* Get reg_class from a letter such as appears in the machine description. */
406 #define REG_CLASS_FROM_LETTER(C) \
407 ((C) == 'f' ? FPU_REGS : \
408 ((C) == 'd' ? MUL_REGS : \
409 ((C) == 'a' ? LOAD_FPU_REGS : NO_REGS)))
412 /* The letters I, J, K, L and M in a register constraint string
413 can be used to stand for particular ranges of immediate operands.
414 This macro defines what the ranges are.
415 C is the letter, and VALUE is a constant value.
416 Return 1 if VALUE is in the range specified by C.
418 I bits 31-16 0000
419 J bits 15-00 0000
420 K completely random 32 bit
421 L,M,N -1,1,0 respectively
422 O where doing shifts in sequence is faster than
423 one big shift
426 #define CONST_OK_FOR_LETTER_P(VALUE, C) \
427 ((C) == 'I' ? ((VALUE) & 0xffff0000) == 0 \
428 : (C) == 'J' ? ((VALUE) & 0x0000ffff) == 0 \
429 : (C) == 'K' ? (((VALUE) & 0xffff0000) != 0 \
430 && ((VALUE) & 0x0000ffff) != 0) \
431 : (C) == 'L' ? ((VALUE) == 1) \
432 : (C) == 'M' ? ((VALUE) == -1) \
433 : (C) == 'N' ? ((VALUE) == 0) \
434 : (C) == 'O' ? (abs(VALUE) >1 && abs(VALUE) <= 4) \
435 : 0)
437 /* Similar, but for floating constants, and defining letters G and H.
438 Here VALUE is the CONST_DOUBLE rtx itself. */
440 #define CONST_DOUBLE_OK_FOR_LETTER_P(VALUE, C) \
441 ((C) == 'G' && XINT (VALUE, 0) == 0 && XINT (VALUE, 1) == 0)
444 /* Letters in the range `Q' through `U' may be defined in a
445 machine-dependent fashion to stand for arbitrary operand types.
446 The machine description macro `EXTRA_CONSTRAINT' is passed the
447 operand as its first argument and the constraint letter as its
448 second operand.
450 `Q' is for memory references using take more than 1 instruction.
451 `R' is for memory references which take 1 word for the instruction. */
453 #define EXTRA_CONSTRAINT(OP,CODE) \
454 ((GET_CODE (OP) != MEM) ? 0 \
455 : !legitimate_address_p (GET_MODE (OP), XEXP (OP, 0)) ? 0 \
456 : ((CODE) == 'Q') ? !simple_memory_operand (OP, GET_MODE (OP)) \
457 : ((CODE) == 'R') ? simple_memory_operand (OP, GET_MODE (OP)) \
458 : 0)
460 /* Given an rtx X being reloaded into a reg required to be
461 in class CLASS, return the class of reg to actually use.
462 In general this is just CLASS; but on some machines
463 in some cases it is preferable to use a more restrictive class.
465 loading is easier into LOAD_FPU_REGS than FPU_REGS! */
467 #define PREFERRED_RELOAD_CLASS(X,CLASS) \
468 (((CLASS) != FPU_REGS)?(CLASS):LOAD_FPU_REGS)
470 #define SECONDARY_RELOAD_CLASS(CLASS,MODE,x) \
471 (((CLASS) == NO_LOAD_FPU_REGS && !(REG_P(x) && LOAD_FPU_REG_P(REGNO(x))))?LOAD_FPU_REGS:NO_REGS)
473 /* Return the maximum number of consecutive registers
474 needed to represent mode MODE in a register of class CLASS. */
475 #define CLASS_MAX_NREGS(CLASS, MODE) \
476 ((CLASS == GENERAL_REGS || CLASS == MUL_REGS)? \
477 ((GET_MODE_SIZE (MODE) + UNITS_PER_WORD - 1) / UNITS_PER_WORD): \
482 /* Stack layout; function entry, exit and calling. */
484 /* Define this if pushing a word on the stack
485 makes the stack pointer a smaller address. */
486 #define STACK_GROWS_DOWNWARD
488 /* Define this if the nominal address of the stack frame
489 is at the high-address end of the local variables;
490 that is, each additional local variable allocated
491 goes at a more negative offset in the frame.
493 #define FRAME_GROWS_DOWNWARD
495 /* Offset within stack frame to start allocating local variables at.
496 If FRAME_GROWS_DOWNWARD, this is the offset to the END of the
497 first local allocated. Otherwise, it is the offset to the BEGINNING
498 of the first local allocated. */
499 #define STARTING_FRAME_OFFSET 0
501 /* If we generate an insn to push BYTES bytes,
502 this says how many the stack pointer really advances by.
503 On the pdp11, the stack is on an even boundary */
504 #define PUSH_ROUNDING(BYTES) ((BYTES + 1) & ~1)
506 /* current_first_parm_offset stores the # of registers pushed on the
507 stack */
508 extern int current_first_parm_offset;
510 /* Offset of first parameter from the argument pointer register value.
511 For the pdp11, this is non-zero to account for the return address.
512 1 - return address
513 2 - frame pointer (always saved, even when not used!!!!)
514 -- chnage some day !!!:q!
517 #define FIRST_PARM_OFFSET(FNDECL) 4
519 /* Value is 1 if returning from a function call automatically
520 pops the arguments described by the number-of-args field in the call.
521 FUNDECL is the declaration node of the function (as a tree),
522 FUNTYPE is the data type of the function (as a tree),
523 or for a library call it is an identifier node for the subroutine name. */
525 #define RETURN_POPS_ARGS(FUNDECL,FUNTYPE,SIZE) 0
527 /* Define how to find the value returned by a function.
528 VALTYPE is the data type of the value (as a tree).
529 If the precise function being called is known, FUNC is its FUNCTION_DECL;
530 otherwise, FUNC is 0. */
531 #define BASE_RETURN_VALUE_REG(MODE) \
532 ((MODE) == DFmode ? 8 : 0)
534 /* On the pdp11 the value is found in R0 (or ac0???
535 not without FPU!!!! ) */
537 #define FUNCTION_VALUE(VALTYPE, FUNC) \
538 gen_rtx_REG (TYPE_MODE (VALTYPE), BASE_RETURN_VALUE_REG(TYPE_MODE(VALTYPE)))
540 /* and the called function leaves it in the first register.
541 Difference only on machines with register windows. */
543 #define FUNCTION_OUTGOING_VALUE(VALTYPE, FUNC) \
544 gen_rtx_REG (TYPE_MODE (VALTYPE), BASE_RETURN_VALUE_REG(TYPE_MODE(VALTYPE)))
546 /* Define how to find the value returned by a library function
547 assuming the value has mode MODE. */
549 #define LIBCALL_VALUE(MODE) gen_rtx_REG (MODE, BASE_RETURN_VALUE_REG(MODE))
551 /* 1 if N is a possible register number for a function value
552 as seen by the caller.
553 On the pdp, the first "output" reg is the only register thus used.
555 maybe ac0 ? - as option someday! */
557 #define FUNCTION_VALUE_REGNO_P(N) (((N) == 0) || (TARGET_AC0 && (N) == 8))
559 /* should probably return DImode and DFmode in memory,lest
560 we fill up all regs!
562 have to, else we crash - exception: maybe return result in
563 ac0 if DFmode and FPU present - compatibility problem with
564 libraries for non-floating point ...
567 #define RETURN_IN_MEMORY(TYPE) \
568 (TYPE_MODE(TYPE) == DImode || (TYPE_MODE(TYPE) == DFmode && ! TARGET_AC0))
571 /* 1 if N is a possible register number for function argument passing.
572 - not used on pdp */
574 #define FUNCTION_ARG_REGNO_P(N) 0
576 /* Define a data type for recording info about an argument list
577 during the scan of that argument list. This data type should
578 hold all necessary information about the function itself
579 and about the args processed so far, enough to enable macros
580 such as FUNCTION_ARG to determine where the next arg should go.
584 #define CUMULATIVE_ARGS int
586 /* Initialize a variable CUM of type CUMULATIVE_ARGS
587 for a call to a function whose data type is FNTYPE.
588 For a library call, FNTYPE is 0.
590 ...., the offset normally starts at 0, but starts at 1 word
591 when the function gets a structure-value-address as an
592 invisible first argument. */
594 #define INIT_CUMULATIVE_ARGS(CUM,FNTYPE,LIBNAME,INDIRECT) \
595 ((CUM) = 0)
597 /* Update the data in CUM to advance over an argument
598 of mode MODE and data type TYPE.
599 (TYPE is null for libcalls where that information may not be available.)
604 #define FUNCTION_ARG_ADVANCE(CUM, MODE, TYPE, NAMED) \
605 ((CUM) += ((MODE) != BLKmode \
606 ? (GET_MODE_SIZE (MODE)) \
607 : (int_size_in_bytes (TYPE))))
609 /* Determine where to put an argument to a function.
610 Value is zero to push the argument on the stack,
611 or a hard register in which to store the argument.
613 MODE is the argument's machine mode.
614 TYPE is the data type of the argument (as a tree).
615 This is null for libcalls where that information may
616 not be available.
617 CUM is a variable of type CUMULATIVE_ARGS which gives info about
618 the preceding args and about the function being called.
619 NAMED is nonzero if this argument is a named parameter
620 (otherwise it is an extra parameter matching an ellipsis). */
622 #define FUNCTION_ARG(CUM, MODE, TYPE, NAMED) 0
624 /* Define where a function finds its arguments.
625 This would be different from FUNCTION_ARG if we had register windows. */
627 #define FUNCTION_INCOMING_ARG(CUM, MODE, TYPE, NAMED) \
628 FUNCTION_ARG (CUM, MODE, TYPE, NAMED)
631 /* For an arg passed partly in registers and partly in memory,
632 this is the number of registers used.
633 For args passed entirely in registers or entirely in memory, zero. */
635 #define FUNCTION_ARG_PARTIAL_NREGS(CUM, MODE, TYPE, NAMED) 0
637 /* Output assembler code to FILE to increment profiler label # LABELNO
638 for profiling a function entry. */
640 #define FUNCTION_PROFILER(FILE, LABELNO) \
641 abort ();
643 /* EXIT_IGNORE_STACK should be nonzero if, when returning from a function,
644 the stack pointer does not matter. The value is tested only in
645 functions that have frame pointers.
646 No definition is equivalent to always zero. */
648 extern int may_call_alloca;
650 #define EXIT_IGNORE_STACK 1
652 #define INITIAL_FRAME_POINTER_OFFSET(DEPTH_VAR) \
654 int offset, regno; \
655 offset = get_frame_size(); \
656 for (regno = 0; regno < 8; regno++) \
657 if (regs_ever_live[regno] && ! call_used_regs[regno]) \
658 offset += 2; \
659 for (regno = 8; regno < 14; regno++) \
660 if (regs_ever_live[regno] && ! call_used_regs[regno]) \
661 offset += 8; \
662 /* offset -= 2; no fp on stack frame */ \
663 (DEPTH_VAR) = offset; \
667 /* Addressing modes, and classification of registers for them. */
669 #define HAVE_POST_INCREMENT 1
670 /* #define HAVE_POST_DECREMENT 0 */
672 #define HAVE_PRE_DECREMENT 1
673 /* #define HAVE_PRE_INCREMENT 0 */
675 /* Macros to check register numbers against specific register classes. */
677 /* These assume that REGNO is a hard or pseudo reg number.
678 They give nonzero only if REGNO is a hard reg of the suitable class
679 or a pseudo reg currently allocated to a suitable hard reg.
680 Since they use reg_renumber, they are safe only once reg_renumber
681 has been allocated, which happens in local-alloc.c. */
683 #define REGNO_OK_FOR_INDEX_P(REGNO) \
684 ((REGNO) < 8 || (unsigned) reg_renumber[REGNO] < 8)
685 #define REGNO_OK_FOR_BASE_P(REGNO) \
686 ((REGNO) < 8 || (unsigned) reg_renumber[REGNO] < 8)
688 /* Now macros that check whether X is a register and also,
689 strictly, whether it is in a specified class.
694 /* Maximum number of registers that can appear in a valid memory address. */
696 #define MAX_REGS_PER_ADDRESS 2
698 /* Recognize any constant value that is a valid address. */
700 #define CONSTANT_ADDRESS_P(X) CONSTANT_P (X)
702 /* Nonzero if the constant value X is a legitimate general operand.
703 It is given that X satisfies CONSTANT_P or is a CONST_DOUBLE. */
705 #define LEGITIMATE_CONSTANT_P(X) (1)
707 /* The macros REG_OK_FOR..._P assume that the arg is a REG rtx
708 and check its validity for a certain class.
709 We have two alternate definitions for each of them.
710 The usual definition accepts all pseudo regs; the other rejects
711 them unless they have been allocated suitable hard regs.
712 The symbol REG_OK_STRICT causes the latter definition to be used.
714 Most source files want to accept pseudo regs in the hope that
715 they will get allocated to the class that the insn wants them to be in.
716 Source files for reload pass need to be strict.
717 After reload, it makes no difference, since pseudo regs have
718 been eliminated by then. */
720 #ifndef REG_OK_STRICT
722 /* Nonzero if X is a hard reg that can be used as an index
723 or if it is a pseudo reg. */
724 #define REG_OK_FOR_INDEX_P(X) (1)
725 /* Nonzero if X is a hard reg that can be used as a base reg
726 or if it is a pseudo reg. */
727 #define REG_OK_FOR_BASE_P(X) (1)
729 #else
731 /* Nonzero if X is a hard reg that can be used as an index. */
732 #define REG_OK_FOR_INDEX_P(X) REGNO_OK_FOR_INDEX_P (REGNO (X))
733 /* Nonzero if X is a hard reg that can be used as a base reg. */
734 #define REG_OK_FOR_BASE_P(X) REGNO_OK_FOR_BASE_P (REGNO (X))
736 #endif
738 /* GO_IF_LEGITIMATE_ADDRESS recognizes an RTL expression
739 that is a valid memory address for an instruction.
740 The MODE argument is the machine mode for the MEM expression
741 that wants to use this address.
745 #define GO_IF_LEGITIMATE_ADDRESS(mode, operand, ADDR) \
747 rtx xfoob; \
749 /* accept (R0) */ \
750 if (GET_CODE (operand) == REG \
751 && REG_OK_FOR_BASE_P(operand)) \
752 goto ADDR; \
754 /* accept @#address */ \
755 if (CONSTANT_ADDRESS_P (operand)) \
756 goto ADDR; \
758 /* accept X(R0) */ \
759 if (GET_CODE (operand) == PLUS \
760 && GET_CODE (XEXP (operand, 0)) == REG \
761 && REG_OK_FOR_BASE_P (XEXP (operand, 0)) \
762 && CONSTANT_ADDRESS_P (XEXP (operand, 1))) \
763 goto ADDR; \
765 /* accept -(R0) */ \
766 if (GET_CODE (operand) == PRE_DEC \
767 && GET_CODE (XEXP (operand, 0)) == REG \
768 && REG_OK_FOR_BASE_P (XEXP (operand, 0))) \
769 goto ADDR; \
771 /* accept (R0)+ */ \
772 if (GET_CODE (operand) == POST_INC \
773 && GET_CODE (XEXP (operand, 0)) == REG \
774 && REG_OK_FOR_BASE_P (XEXP (operand, 0))) \
775 goto ADDR; \
777 /* handle another level of indirection ! */ \
778 if (GET_CODE(operand) != MEM) \
779 goto fail; \
781 xfoob = XEXP (operand, 0); \
783 /* (MEM:xx (MEM:xx ())) is not valid for SI, DI and currently */ \
784 /* also forbidden for float, because we have to handle this */ \
785 /* in output_move_double and/or output_move_quad() - we could */ \
786 /* do it, but currently it's not worth it!!! */ \
787 /* now that DFmode cannot go into CPU register file, */ \
788 /* maybe I should allow float ... */ \
789 /* but then I have to handle memory-to-memory moves in movdf ?? */ \
791 if (GET_MODE_BITSIZE(mode) > 16) \
792 goto fail; \
794 /* accept @(R0) - which is @0(R0) */ \
795 if (GET_CODE (xfoob) == REG \
796 && REG_OK_FOR_BASE_P(xfoob)) \
797 goto ADDR; \
799 /* accept @address */ \
800 if (CONSTANT_ADDRESS_P (xfoob)) \
801 goto ADDR; \
803 /* accept @X(R0) */ \
804 if (GET_CODE (xfoob) == PLUS \
805 && GET_CODE (XEXP (xfoob, 0)) == REG \
806 && REG_OK_FOR_BASE_P (XEXP (xfoob, 0)) \
807 && CONSTANT_ADDRESS_P (XEXP (xfoob, 1))) \
808 goto ADDR; \
810 /* accept @-(R0) */ \
811 if (GET_CODE (xfoob) == PRE_DEC \
812 && GET_CODE (XEXP (xfoob, 0)) == REG \
813 && REG_OK_FOR_BASE_P (XEXP (xfoob, 0))) \
814 goto ADDR; \
816 /* accept @(R0)+ */ \
817 if (GET_CODE (xfoob) == POST_INC \
818 && GET_CODE (XEXP (xfoob, 0)) == REG \
819 && REG_OK_FOR_BASE_P (XEXP (xfoob, 0))) \
820 goto ADDR; \
822 /* anything else is invalid */ \
823 fail: ; \
827 /* Try machine-dependent ways of modifying an illegitimate address
828 to be legitimate. If we find one, return the new, valid address.
829 This macro is used in only one place: `memory_address' in explow.c.
831 OLDX is the address as it was before break_out_memory_refs was called.
832 In some cases it is useful to look at this to decide what needs to be done.
834 MODE and WIN are passed so that this macro can use
835 GO_IF_LEGITIMATE_ADDRESS.
837 It is always safe for this macro to do nothing. It exists to recognize
838 opportunities to optimize the output. */
840 #define LEGITIMIZE_ADDRESS(X,OLDX,MODE,WIN) {}
843 /* Go to LABEL if ADDR (a legitimate address expression)
844 has an effect that depends on the machine mode it is used for.
845 On the pdp this is for predec/postinc */
847 #define GO_IF_MODE_DEPENDENT_ADDRESS(ADDR,LABEL) \
848 { if (GET_CODE (ADDR) == POST_INC || GET_CODE (ADDR) == PRE_DEC) \
849 goto LABEL; \
853 /* Specify the machine mode that this machine uses
854 for the index in the tablejump instruction. */
855 #define CASE_VECTOR_MODE HImode
857 /* Define this if a raw index is all that is needed for a
858 `tablejump' insn. */
859 #define CASE_TAKES_INDEX_RAW
861 /* Define as C expression which evaluates to nonzero if the tablejump
862 instruction expects the table to contain offsets from the address of the
863 table.
864 Do not define this if the table should contain absolute addresses. */
865 /* #define CASE_VECTOR_PC_RELATIVE 1 */
867 /* Define this as 1 if `char' should by default be signed; else as 0. */
868 #define DEFAULT_SIGNED_CHAR 1
870 /* Max number of bytes we can move from memory to memory
871 in one reasonably fast instruction.
874 #define MOVE_MAX 2
876 /* Nonzero if access to memory by byte is slow and undesirable. -
878 #define SLOW_BYTE_ACCESS 0
880 /* Do not break .stabs pseudos into continuations. */
881 #define DBX_CONTIN_LENGTH 0
883 /* Value is 1 if truncating an integer of INPREC bits to OUTPREC bits
884 is done just by pretending it is already truncated. */
885 #define TRULY_NOOP_TRUNCATION(OUTPREC, INPREC) 1
888 /* Add any extra modes needed to represent the condition code.
890 CCFPmode is used for FPU, but should we use a separate reg? */
891 #define EXTRA_CC_MODES CC(CCFPmode, "CCFP")
893 /* Give a comparison code (EQ, NE etc) and the first operand of a COMPARE,
894 return the mode to be used for the comparison. For floating-point, CCFPmode
895 should be used. */
897 #define SELECT_CC_MODE(OP,X,Y) \
898 (GET_MODE_CLASS(GET_MODE(X)) == MODE_FLOAT? CCFPmode : CCmode)
900 /* We assume that the store-condition-codes instructions store 0 for false
901 and some other value for true. This is the value stored for true. */
903 /* #define STORE_FLAG_VALUE 1 */
905 /* Specify the machine mode that pointers have.
906 After generation of rtl, the compiler makes no further distinction
907 between pointers and any other objects of this machine mode. */
908 #define Pmode HImode
910 /* A function address in a call instruction
911 is a word address (for indexing purposes)
912 so give the MEM rtx a word's mode. */
913 #define FUNCTION_MODE HImode
915 /* Define this if addresses of constant functions
916 shouldn't be put through pseudo regs where they can be cse'd.
917 Desirable on machines where ordinary constants are expensive
918 but a CALL with constant address is cheap. */
919 /* #define NO_FUNCTION_CSE */
921 /* Compute the cost of computing a constant rtl expression RTX
922 whose rtx-code is CODE. The body of this macro is a portion
923 of a switch statement. If the code is computed here,
924 return it with a return statement. Otherwise, break from the switch.
926 -1, 0, 1 are cheaper for add, sub ...
929 #define CONST_COSTS(RTX,CODE,OUTER_CODE) \
930 case CONST_INT: \
931 if (INTVAL(RTX) == 0 \
932 || INTVAL(RTX) == -1 \
933 || INTVAL(RTX) == 1) \
934 return 0; \
935 case CONST: \
936 case LABEL_REF: \
937 case SYMBOL_REF: \
938 /* twice as expensive as REG */ \
939 return 2; \
940 case CONST_DOUBLE: \
941 /* twice (or 4 times) as expensive as 16 bit */ \
942 return 4;
944 /* cost of moving one register class to another */
945 #define REGISTER_MOVE_COST(MODE, CLASS1, CLASS2) \
946 register_move_cost (CLASS1, CLASS2)
948 /* Tell emit-rtl.c how to initialize special values on a per-function base. */
949 extern int optimize;
950 extern struct rtx_def *cc0_reg_rtx;
952 #define CC_STATUS_MDEP rtx
954 #define CC_STATUS_MDEP_INIT (cc_status.mdep = 0)
956 /* Tell final.c how to eliminate redundant test instructions. */
958 /* Here we define machine-dependent flags and fields in cc_status
959 (see `conditions.h'). */
961 #define CC_IN_FPU 04000
963 /* Do UPDATE_CC if EXP is a set, used in
964 NOTICE_UPDATE_CC
966 floats only do compare correctly, else nullify ...
968 get cc0 out soon ...
971 /* Store in cc_status the expressions
972 that the condition codes will describe
973 after execution of an instruction whose pattern is EXP.
974 Do not alter them if the instruction would not alter the cc's. */
976 #define NOTICE_UPDATE_CC(EXP, INSN) \
977 { if (GET_CODE (EXP) == SET) \
979 notice_update_cc_on_set(EXP, INSN); \
981 else if (GET_CODE (EXP) == PARALLEL \
982 && GET_CODE (XVECEXP (EXP, 0, 0)) == SET) \
984 notice_update_cc_on_set(XVECEXP (EXP, 0, 0), INSN); \
986 else if (GET_CODE (EXP) == CALL) \
987 { /* all bets are off */ CC_STATUS_INIT; } \
988 if (cc_status.value1 && GET_CODE (cc_status.value1) == REG \
989 && cc_status.value2 \
990 && reg_overlap_mentioned_p (cc_status.value1, cc_status.value2)) \
992 printf ("here!\n"); \
993 cc_status.value2 = 0; \
997 /* Control the assembler format that we output. */
999 /* Output at beginning of assembler file. */
1001 #if 0
1002 #define ASM_FILE_START(FILE) \
1004 fprintf (FILE, "\t.data\n"), \
1005 fprintf (FILE, "$help$: . = .+8 ; space for tmp moves!\n") \
1006 /* do we need reg def's R0 = %0 etc ??? */ \
1008 #else
1009 #define ASM_FILE_START(FILE)
1010 #endif
1013 /* Output to assembler file text saying following lines
1014 may contain character constants, extra white space, comments, etc. */
1016 #define ASM_APP_ON ""
1018 /* Output to assembler file text saying following lines
1019 no longer contain unusual constructs. */
1021 #define ASM_APP_OFF ""
1023 /* Output before read-only data. */
1025 #define TEXT_SECTION_ASM_OP "\t.text\n"
1027 /* Output before writable data. */
1029 #define DATA_SECTION_ASM_OP "\t.data\n"
1031 /* How to refer to registers in assembler output.
1032 This sequence is indexed by compiler's hard-register-number (see above). */
1034 #define REGISTER_NAMES \
1035 {"r0", "r1", "r2", "r3", "r4", "r5", "sp", "pc", \
1036 "ac0", "ac1", "ac2", "ac3", "ac4", "ac5" }
1038 /* This is how to output the definition of a user-level label named NAME,
1039 such as the label on a static function or variable NAME. */
1041 #define ASM_OUTPUT_LABEL(FILE,NAME) \
1042 do { assemble_name (FILE, NAME); fputs (":\n", FILE); } while (0)
1044 /* This is how to output a command to make the user-level label named NAME
1045 defined for reference from other files. */
1047 #define ASM_GLOBALIZE_LABEL(FILE,NAME) \
1048 do { fputs ("\t.globl ", FILE); assemble_name (FILE, NAME); fputs("\n", FILE); } while (0)
1050 /* The prefix to add to user-visible assembler symbols. */
1052 #define USER_LABEL_PREFIX "_"
1054 /* This is how to output an internal numbered label where
1055 PREFIX is the class of label and NUM is the number within the class. */
1057 #define ASM_OUTPUT_INTERNAL_LABEL(FILE,PREFIX,NUM) \
1058 fprintf (FILE, "%s_%d:\n", PREFIX, NUM)
1060 /* This is how to store into the string LABEL
1061 the symbol_ref name of an internal numbered label where
1062 PREFIX is the class of label and NUM is the number within the class.
1063 This is suitable for output with `assemble_name'. */
1065 #define ASM_GENERATE_INTERNAL_LABEL(LABEL,PREFIX,NUM) \
1066 sprintf (LABEL, "*%s_%d", PREFIX, NUM)
1068 #define ASM_OUTPUT_ASCII(FILE, P, SIZE) \
1069 output_ascii (FILE, P, SIZE)
1071 /* This is how to output an element of a case-vector that is absolute. */
1073 #define ASM_OUTPUT_ADDR_VEC_ELT(FILE, VALUE) \
1074 fprintf (FILE, "\t%sL_%d\n", TARGET_UNIX_ASM ? "" : ".word ", VALUE)
1076 /* This is how to output an element of a case-vector that is relative.
1077 Don't define this if it is not supported. */
1079 /* #define ASM_OUTPUT_ADDR_DIFF_ELT(FILE, VALUE, REL) */
1081 /* This is how to output an assembler line
1082 that says to advance the location counter
1083 to a multiple of 2**LOG bytes.
1085 who needs this????
1088 #define ASM_OUTPUT_ALIGN(FILE,LOG) \
1089 switch (LOG) \
1091 case 0: \
1092 break; \
1093 case 1: \
1094 fprintf (FILE, "\t.even\n"); \
1095 break; \
1096 default: \
1097 abort (); \
1100 #define ASM_OUTPUT_SKIP(FILE,SIZE) \
1101 fprintf (FILE, "\t.=.+ %o\n", (SIZE))
1103 /* This says how to output an assembler line
1104 to define a global common symbol. */
1106 #define ASM_OUTPUT_COMMON(FILE, NAME, SIZE, ROUNDED) \
1107 ( fprintf ((FILE), ".globl "), \
1108 assemble_name ((FILE), (NAME)), \
1109 fprintf ((FILE), "\n"), \
1110 assemble_name ((FILE), (NAME)), \
1111 fprintf ((FILE), ": .=.+ %o\n", (ROUNDED)) \
1114 /* This says how to output an assembler line
1115 to define a local common symbol. */
1117 #define ASM_OUTPUT_LOCAL(FILE, NAME, SIZE, ROUNDED) \
1118 ( assemble_name ((FILE), (NAME)), \
1119 fprintf ((FILE), ":\t.=.+ %o\n", (ROUNDED)))
1121 /* Store in OUTPUT a string (made with alloca) containing
1122 an assembler-name for a local static variable named NAME.
1123 LABELNO is an integer which is different for each call. */
1125 #define ASM_FORMAT_PRIVATE_NAME(OUTPUT, NAME, LABELNO) \
1126 ( (OUTPUT) = (char *) alloca (strlen ((NAME)) + 10), \
1127 sprintf ((OUTPUT), "%s.%d", (NAME), (LABELNO)))
1129 /* Print operand X (an rtx) in assembler syntax to file FILE.
1130 CODE is a letter or dot (`z' in `%z0') or 0 if no letter was specified.
1131 For `%' followed by punctuation, CODE is the punctuation and X is null.
1136 #define PRINT_OPERAND(FILE, X, CODE) \
1137 { if (CODE == '#') fprintf (FILE, "#"); \
1138 else if (GET_CODE (X) == REG) \
1139 fprintf (FILE, "%s", reg_names[REGNO (X)]); \
1140 else if (GET_CODE (X) == MEM) \
1141 output_address (XEXP (X, 0)); \
1142 else if (GET_CODE (X) == CONST_DOUBLE && GET_MODE (X) != SImode) \
1143 { REAL_VALUE_TYPE r; \
1144 char buf[30]; \
1145 REAL_VALUE_FROM_CONST_DOUBLE (r, X); \
1146 REAL_VALUE_TO_DECIMAL (r, "%.20e", buf); \
1147 fprintf (FILE, "#%s", buf); } \
1148 else { putc ('$', FILE); output_addr_const_pdp11 (FILE, X); }}
1150 /* Print a memory address as an operand to reference that memory location. */
1152 #define PRINT_OPERAND_ADDRESS(FILE, ADDR) \
1153 print_operand_address (FILE, ADDR)
1155 #define ASM_OUTPUT_REG_PUSH(FILE,REGNO) \
1157 fprintf (FILE, "\tmov %s, -(sp)\n", reg_names[REGNO]) \
1160 #define ASM_OUTPUT_REG_POP(FILE,REGNO) \
1162 fprintf (FILE, "\tmov (sp)+, %s\n", reg_names[REGNO]) \
1165 /* trampoline - how should i do it in separate i+d ?
1166 have some allocate_trampoline magic???
1168 the following should work for shared I/D: */
1170 /* lets see whether this works as trampoline:
1171 MV #STATIC, $4 0x940Y 0x0000 <- STATIC; Y = STATIC_CHAIN_REGNUM
1172 JMP FUNCTION 0x0058 0x0000 <- FUNCTION
1175 #define TRAMPOLINE_TEMPLATE(FILE) \
1177 if (TARGET_SPLIT) \
1178 abort(); \
1180 assemble_aligned_integer (2, GEN_INT (0x9400+STATIC_CHAIN_REGNUM)); \
1181 assemble_aligned_integer (2, const0_rtx); \
1182 assemble_aligned_integer (2, GEN_INT(0x0058)); \
1183 assemble_aligned_integer (2, const0_rtx); \
1186 #define TRAMPOLINE_SIZE 8
1187 #define TRAMPOLINE_ALIGNMENT 16
1189 /* Emit RTL insns to initialize the variable parts of a trampoline.
1190 FNADDR is an RTX for the address of the function's pure code.
1191 CXT is an RTX for the static chain value for the function. */
1193 #define INITIALIZE_TRAMPOLINE(TRAMP,FNADDR,CXT) \
1195 if (TARGET_SPLIT) \
1196 abort(); \
1198 emit_move_insn (gen_rtx_MEM (HImode, plus_constant (TRAMP, 2)), CXT); \
1199 emit_move_insn (gen_rtx_MEM (HImode, plus_constant (TRAMP, 6)), FNADDR); \
1203 /* Some machines may desire to change what optimizations are
1204 performed for various optimization levels. This macro, if
1205 defined, is executed once just after the optimization level is
1206 determined and before the remainder of the command options have
1207 been parsed. Values set in this macro are used as the default
1208 values for the other command line options.
1210 LEVEL is the optimization level specified; 2 if -O2 is
1211 specified, 1 if -O is specified, and 0 if neither is specified. */
1213 #define OPTIMIZATION_OPTIONS(LEVEL,SIZE) \
1215 if (LEVEL >= 3) \
1217 if (! SIZE) \
1218 flag_inline_functions = 1; \
1219 flag_omit_frame_pointer = 1; \
1220 /* flag_unroll_loops = 1; */ \
1225 /* Provide the costs of a rtl expression. This is in the body of a
1226 switch on CODE.
1228 we don't say how expensive SImode is - pretty expensive!!!
1230 there is something wrong in MULT because MULT is not
1231 as cheap as total = 2 even if we can shift!
1233 if optimizing for size make mult etc cheap, but not 1, so when
1234 in doubt the faster insn is chosen.
1237 #define RTX_COSTS(X,CODE,OUTER_CODE) \
1238 case MULT: \
1239 if (optimize_size) \
1240 total = COSTS_N_INSNS(2); \
1241 else \
1242 total = COSTS_N_INSNS (11); \
1243 break; \
1244 case DIV: \
1245 if (optimize_size) \
1246 total = COSTS_N_INSNS(2); \
1247 else \
1248 total = COSTS_N_INSNS (25); \
1249 break; \
1250 case MOD: \
1251 if (optimize_size) \
1252 total = COSTS_N_INSNS(2); \
1253 else \
1254 total = COSTS_N_INSNS (26); \
1255 break; \
1256 case ABS: \
1257 /* equivalent to length, so same for optimize_size */ \
1258 total = COSTS_N_INSNS (3); \
1259 break; \
1260 case ZERO_EXTEND: \
1261 /* only used for: qi->hi */ \
1262 total = COSTS_N_INSNS(1); \
1263 break; \
1264 case SIGN_EXTEND: \
1265 if (GET_MODE(X) == HImode) \
1266 total = COSTS_N_INSNS(1); \
1267 else if (GET_MODE(X) == SImode) \
1268 total = COSTS_N_INSNS(6); \
1269 else \
1270 total = COSTS_N_INSNS(2); \
1271 break; \
1272 /* case LSHIFT: */ \
1273 case ASHIFT: \
1274 case LSHIFTRT: \
1275 case ASHIFTRT: \
1276 if (optimize_size) \
1277 total = COSTS_N_INSNS(1); \
1278 else if (GET_MODE(X) == QImode) \
1280 if (GET_CODE(XEXP (X,1)) != CONST_INT) \
1281 total = COSTS_N_INSNS(8); /* worst case */ \
1282 else \
1283 total = COSTS_N_INSNS(INTVAL(XEXP (X,1))); \
1285 else if (GET_MODE(X) == HImode) \
1287 if (GET_CODE(XEXP (X,1)) == CONST_INT) \
1289 if (abs (INTVAL (XEXP (X, 1))) == 1) \
1290 total = COSTS_N_INSNS(1); \
1291 else \
1292 total = COSTS_N_INSNS(2.5 + 0.5 *INTVAL(XEXP(X,1))); \
1294 else /* worst case */ \
1295 total = COSTS_N_INSNS (10); \
1297 else if (GET_MODE(X) == SImode) \
1299 if (GET_CODE(XEXP (X,1)) == CONST_INT) \
1300 total = COSTS_N_INSNS(2.5 + 0.5 *INTVAL(XEXP(X,1))); \
1301 else /* worst case */ \
1302 total = COSTS_N_INSNS(18); \
1304 break;
1307 /* there is no point in avoiding branches on a pdp,
1308 since branches are really cheap - I just want to find out
1309 how much difference the BRANCH_COST macro makes in code */
1310 #define BRANCH_COST (TARGET_BRANCH_CHEAP ? 0 : 1)
1313 #define COMPARE_FLAG_MODE HImode