OSDN Git Service

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