OSDN Git Service

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