OSDN Git Service

Add support for v850 special data areas.
[pf3gnuchains/gcc-fork.git] / gcc / config / v850 / v850.h
1 /* Definitions of target machine for GNU compiler. NEC V850 series
2    Copyright (C) 1996, 1997, 1998 Free Software Foundation, Inc.
3    Contributed by Jeff Law (law@cygnus.com).
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 2, 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 #include "svr4.h"       /* Automatically does #undef CPP_PREDEFINES */
23 #include "gansidecl.h"  /* For the PROTO macro  */
24
25 #undef ASM_SPEC
26 #define ASM_SPEC "%{mv*:-mv%*}"
27
28 #ifndef CPP_SPEC
29 #define CPP_SPEC "-D__v850__"
30 #endif
31
32 #undef ASM_FINAL_SPEC
33 #undef LIB_SPEC
34 #undef ENDFILE_SPEC
35 #undef LINK_SPEC
36 #undef STARTFILE_SPEC
37
38 /* Names to predefine in the preprocessor for this target machine.  */
39 #define CPP_PREDEFINES "-D__v851__ -D__v850"
40
41 /* Print subsidiary information on the compiler version in use.  */
42
43 #ifndef TARGET_VERSION
44 #define TARGET_VERSION fprintf (stderr, " (NEC V850)");
45 #endif
46
47
48 /* Run-time compilation parameters selecting different hardware subsets.  */
49
50 extern int target_flags;
51
52 /* Target flags bits, see below for an explanation of the bits.  */
53 #define MASK_GHS                0x00000001
54 #define MASK_LONG_CALLS         0x00000002
55 #define MASK_EP                 0x00000004
56 #define MASK_PROLOG_FUNCTION    0x00000008
57 #define MASK_DEBUG              0x40000000
58
59 #define MASK_CPU                0x00000030
60 #define MASK_V850               0x00000010
61
62 #define MASK_BIG_SWITCH         0x00000100
63
64 #ifndef MASK_DEFAULT
65 #define MASK_DEFAULT            MASK_V850
66 #endif
67
68 #define TARGET_V850             ((target_flags & MASK_CPU) == MASK_V850)
69
70
71 /* Macros used in the machine description to test the flags.  */
72
73 /* The GHS calling convention support doesn't really work,
74    mostly due to a lack of documentation.  Outstanding issues:
75
76      * How do varargs & stdarg really work.  How to they handle
77      passing structures (if at all).
78
79      * Doubles are normally 4 byte aligned, except in argument
80      lists where they are 8 byte aligned.  Is the alignment
81      in the argument list based on the first parameter,
82      first stack parameter, etc etc.
83
84      * Passing/returning of large structures probably isn't the same
85      as GHS.  We don't have enough documentation on their conventions
86      to be compatible.
87
88      * Tests of SETUP_INCOMING_VARARGS need to be made runtime checks
89      since it depends on TARGET_GHS.  */
90 #define TARGET_GHS (target_flags & MASK_GHS)
91  
92 /* Don't do PC-relative calls, instead load the address of the target
93    function into a register and perform a register indirect call.  */
94 #define TARGET_LONG_CALLS (target_flags & MASK_LONG_CALLS)
95
96 /* Whether to optimize space by using ep (r30) for pointers with small offsets
97    in basic blocks.  */
98 #define TARGET_EP (target_flags & MASK_EP)
99
100 /* Whether to call out-of-line functions to save registers or not.  */
101 #define TARGET_PROLOG_FUNCTION (target_flags & MASK_PROLOG_FUNCTION)
102
103 /* Whether to emit 2 byte per entry or 4 byte per entry switch tables.  */
104 #define TARGET_BIG_SWITCH (target_flags & MASK_BIG_SWITCH)
105
106 /* General debug flag */
107 #define TARGET_DEBUG (target_flags & MASK_DEBUG)
108
109 /* Macro to define tables used to set the flags.
110    This is a list in braces of pairs in braces,
111    each pair being { "NAME", VALUE }
112    where VALUE is the bits to set or minus the bits to clear.
113    An empty string NAME is used to identify the default VALUE.  */
114
115 #define TARGET_SWITCHES                                                 \
116   {{ "ghs",                      MASK_GHS, "Support Green Hills ABI" }, \
117    { "no-ghs",                  -MASK_GHS, "" },                        \
118    { "long-calls",               MASK_LONG_CALLS,                       \
119                                 "Prohibit PC relative function calls" },\
120    { "no-long-calls",           -MASK_LONG_CALLS, "" },                 \
121    { "ep",                       MASK_EP,                               \
122                                 "Reuse r30 on a per function basis" },  \
123    { "no-ep",                   -MASK_EP, "" },                         \
124    { "prolog-function",          MASK_PROLOG_FUNCTION,                  \
125                                 "Use stubs for function prologues" },   \
126    { "no-prolog-function",      -MASK_PROLOG_FUNCTION, "" },            \
127    { "space",                    MASK_EP | MASK_PROLOG_FUNCTION,        \
128                                 "Same as: -mep -mprolog-function" },    \
129    { "debug",                    MASK_DEBUG, "Enable backend debugging" }, \
130    { "v850",                     MASK_V850,                             \
131                                 "Compile for the v850 processor" },     \
132    { "v850",                     -(MASK_V850 ^ MASK_CPU), "" },         \
133    { "big-switch",               MASK_BIG_SWITCH,                       \
134                                 "Use 4 byte entries in switch tables" },\
135    EXTRA_SWITCHES                                                       \
136    { "",                         TARGET_DEFAULT, ""}}
137
138 #ifndef EXTRA_SWITCHES
139 #define EXTRA_SWITCHES
140 #endif
141
142 #ifndef TARGET_DEFAULT
143 #define TARGET_DEFAULT          MASK_DEFAULT
144 #endif
145
146 /* Information about the various small memory areas.  */
147 struct small_memory_info {
148   char *name;
149   char *value;
150   long max;
151   long physical_max;
152 };
153
154 enum small_memory_type {
155   /* tiny data area, using EP as base register */
156   SMALL_MEMORY_TDA = 0,
157   /* small data area using dp as base register */
158   SMALL_MEMORY_SDA,
159   /* zero data area using r0 as base register */
160   SMALL_MEMORY_ZDA,
161   SMALL_MEMORY_max
162 };
163
164 extern struct small_memory_info small_memory[(int)SMALL_MEMORY_max];
165
166 /* This macro is similar to `TARGET_SWITCHES' but defines names of
167    command options that have values.  Its definition is an
168    initializer with a subgrouping for each command option.
169
170    Each subgrouping contains a string constant, that defines the
171    fixed part of the option name, and the address of a variable.  The
172    variable, type `char *', is set to the variable part of the given
173    option if the fixed part matches.  The actual option name is made
174    by appending `-m' to the specified name.
175
176    Here is an example which defines `-mshort-data-NUMBER'.  If the
177    given option is `-mshort-data-512', the variable `m88k_short_data'
178    will be set to the string `"512"'.
179
180           extern char *m88k_short_data;
181           #define TARGET_OPTIONS \
182            { { "short-data-", &m88k_short_data } } */
183
184 #define TARGET_OPTIONS                                                  \
185 {                                                                       \
186   { "tda=",     &small_memory[ (int)SMALL_MEMORY_TDA ].value,           \
187       "Set the max size of data eligible for the TDA area"  },          \
188   { "tda-",     &small_memory[ (int)SMALL_MEMORY_TDA ].value, "" },     \
189   { "sda=",     &small_memory[ (int)SMALL_MEMORY_SDA ].value,           \
190       "Set the max size of data eligible for the SDA area"  },          \
191   { "sda-",     &small_memory[ (int)SMALL_MEMORY_SDA ].value, "" },     \
192   { "zda=",     &small_memory[ (int)SMALL_MEMORY_ZDA ].value,           \
193       "Set the max size of data eligible for the ZDA area"  },          \
194   { "zda-",     &small_memory[ (int)SMALL_MEMORY_ZDA ].value, "" },     \
195 }
196
197 /* Sometimes certain combinations of command options do not make
198    sense on a particular target machine.  You can define a macro
199    `OVERRIDE_OPTIONS' to take account of this.  This macro, if
200    defined, is executed once just after all the command options have
201    been parsed.
202
203    Don't use this macro to turn on various extra optimizations for
204    `-O'.  That is what `OPTIMIZATION_OPTIONS' is for.  */
205 #define OVERRIDE_OPTIONS override_options ()
206
207
208 /* Show we can debug even without a frame pointer.  */
209 #define CAN_DEBUG_WITHOUT_FP
210
211 /* Some machines may desire to change what optimizations are
212    performed for various optimization levels.   This macro, if
213    defined, is executed once just after the optimization level is
214    determined and before the remainder of the command options have
215    been parsed.  Values set in this macro are used as the default
216    values for the other command line options.
217
218    LEVEL is the optimization level specified; 2 if `-O2' is
219    specified, 1 if `-O' is specified, and 0 if neither is specified.
220
221    SIZE is non-zero if `-Os' is specified, 0 otherwise.  
222
223    You should not use this macro to change options that are not
224    machine-specific.  These should uniformly selected by the same
225    optimization level on all supported machines.  Use this macro to
226    enable machine-specific optimizations.
227
228    *Do not examine `write_symbols' in this macro!* The debugging
229    options are not supposed to alter the generated code. */
230
231 #define OPTIMIZATION_OPTIONS(LEVEL,SIZE)                                \
232 {                                                                       \
233   if (LEVEL)                                                            \
234     target_flags |= (MASK_EP | MASK_PROLOG_FUNCTION);                   \
235 }
236
237 \f
238 /* Target machine storage layout */
239
240 /* Define this if most significant bit is lowest numbered
241    in instructions that operate on numbered bit-fields.
242    This is not true on the NEC V850.  */
243 #define BITS_BIG_ENDIAN 0
244
245 /* Define this if most significant byte of a word is the lowest numbered.  */
246 /* This is not true on the NEC V850.  */
247 #define BYTES_BIG_ENDIAN 0
248
249 /* Define this if most significant word of a multiword number is lowest
250    numbered.
251    This is not true on the NEC V850.  */
252 #define WORDS_BIG_ENDIAN 0
253
254 /* Number of bits in an addressable storage unit */
255 #define BITS_PER_UNIT 8
256
257 /* Width in bits of a "word", which is the contents of a machine register.
258    Note that this is not necessarily the width of data type `int';
259    if using 16-bit ints on a 68000, this would still be 32.
260    But on a machine with 16-bit registers, this would be 16.  */
261 #define BITS_PER_WORD           32
262
263 /* Width of a word, in units (bytes).  */
264 #define UNITS_PER_WORD          4
265
266 /* Width in bits of a pointer.
267    See also the macro `Pmode' defined below.  */
268 #define POINTER_SIZE            32
269
270 /* Define this macro if it is advisable to hold scalars in registers
271    in a wider mode than that declared by the program.  In such cases,
272    the value is constrained to be within the bounds of the declared
273    type, but kept valid in the wider mode.  The signedness of the
274    extension may differ from that of the type.
275
276    Some simple experiments have shown that leaving UNSIGNEDP alone
277    generates the best overall code.  */
278
279 #define PROMOTE_MODE(MODE,UNSIGNEDP,TYPE)  \
280   if (GET_MODE_CLASS (MODE) == MODE_INT \
281       && GET_MODE_SIZE (MODE) < 4)      \
282     { (MODE) = SImode; }
283
284 /* Allocation boundary (in *bits*) for storing arguments in argument list.  */
285 #define PARM_BOUNDARY           32
286
287 /* The stack goes in 32 bit lumps.  */
288 #define STACK_BOUNDARY          32
289
290 /* Allocation boundary (in *bits*) for the code of a function.
291    16 is the minimum boundary; 32 would give better performance.  */
292 #define FUNCTION_BOUNDARY 16
293
294 /* No data type wants to be aligned rounder than this.  */
295 #define BIGGEST_ALIGNMENT       32
296
297 /* Alignment of field after `int : 0' in a structure.  */
298 #define EMPTY_FIELD_BOUNDARY 32
299
300 /* No structure field wants to be aligned rounder than this.  */
301 #define BIGGEST_FIELD_ALIGNMENT 32
302
303 /* Define this if move instructions will actually fail to work
304    when given unaligned data.  */
305 #define STRICT_ALIGNMENT 1
306
307 /* Define this as 1 if `char' should by default be signed; else as 0.
308
309    On the NEC V850, loads do sign extension, so make this default. */
310 #define DEFAULT_SIGNED_CHAR 1
311
312 /* Define results of standard character escape sequences.  */
313 #define TARGET_BELL 007
314 #define TARGET_BS 010
315 #define TARGET_TAB 011
316 #define TARGET_NEWLINE 012
317 #define TARGET_VT 013
318 #define TARGET_FF 014
319 #define TARGET_CR 015
320 \f
321 /* Standard register usage.  */
322
323 /* Number of actual hardware registers.
324    The hardware registers are assigned numbers for the compiler
325    from 0 to just below FIRST_PSEUDO_REGISTER.
326
327    All registers that the compiler knows about must be given numbers,
328    even those that are not normally considered general registers.  */
329
330 #define FIRST_PSEUDO_REGISTER 34
331
332 /* 1 for registers that have pervasive standard uses
333    and are not available for the register allocator.  */
334
335 #define FIXED_REGISTERS \
336   { 1, 1, 0, 1, 1, 0, 0, 0, \
337     0, 0, 0, 0, 0, 0, 0, 0, \
338     0, 0, 0, 0, 0, 0, 0, 0, \
339     0, 0, 0, 0, 0, 0, 1, 0, \
340     1, 1}
341
342 /* 1 for registers not available across function calls.
343    These must include the FIXED_REGISTERS and also any
344    registers that can be used without being saved.
345    The latter must include the registers where values are returned
346    and the register where structure-value addresses are passed.
347    Aside from that, you can include as many other registers as you
348    like.  */
349
350 #define CALL_USED_REGISTERS \
351   { 1, 1, 0, 1, 1, 1, 1, 1, \
352     1, 1, 1, 1, 1, 1, 1, 1, \
353     1, 1, 1, 1, 0, 0, 0, 0, \
354     0, 0, 0, 0, 0, 0, 1, 1, \
355     1, 1}
356
357 /* List the order in which to allocate registers.  Each register must be
358    listed once, even those in FIXED_REGISTERS.
359
360    On the 850, we make the return registers first, then all of the volatile
361    registers, then the saved registers in reverse order to better save the
362    registers with an out of line function, and finally the fixed
363    registers.  */
364
365 #define REG_ALLOC_ORDER                                                 \
366 {                                                                       \
367   10, 11,                               /* return registers */          \
368   12, 13, 14, 15, 16, 17, 18, 19,       /* scratch registers */         \
369    6,  7,  8,  9, 31,                   /* argument registers */        \
370   29, 28, 27, 26, 25, 24, 23, 22,       /* saved registers */           \
371   21, 20,  2,                                                           \
372    0,  1,  3,  4,  5, 30, 32, 33        /* fixed registers */           \
373 }
374
375 /* Return number of consecutive hard regs needed starting at reg REGNO
376    to hold something of mode MODE.
377
378    This is ordinarily the length in words of a value of mode MODE
379    but can be less for certain modes in special long registers.  */
380
381 #define HARD_REGNO_NREGS(REGNO, MODE)   \
382   ((GET_MODE_SIZE (MODE) + UNITS_PER_WORD - 1) / UNITS_PER_WORD)
383
384 /* Value is 1 if hard register REGNO can hold a value of machine-mode
385    MODE.  */
386
387 #define HARD_REGNO_MODE_OK(REGNO, MODE) \
388  ((((REGNO) & 1) == 0) || (GET_MODE_SIZE (MODE) <= 4))
389
390 /* Value is 1 if it is a good idea to tie two pseudo registers
391    when one has mode MODE1 and one has mode MODE2.
392    If HARD_REGNO_MODE_OK could produce different values for MODE1 and MODE2,
393    for any hard reg, then this must be 0 for correct output.  */
394 #define MODES_TIEABLE_P(MODE1, MODE2) \
395   (MODE1 == MODE2 || GET_MODE_SIZE (MODE1) <= 4 && GET_MODE_SIZE (MODE2) <= 4)
396
397 \f
398 /* Define the classes of registers for register constraints in the
399    machine description.  Also define ranges of constants.
400
401    One of the classes must always be named ALL_REGS and include all hard regs.
402    If there is more than one class, another class must be named NO_REGS
403    and contain no registers.
404
405    The name GENERAL_REGS must be the name of a class (or an alias for
406    another name such as ALL_REGS).  This is the class of registers
407    that is allowed by "g" or "r" in a register constraint.
408    Also, registers outside this class are allocated only when
409    instructions express preferences for them.
410
411    The classes must be numbered in nondecreasing order; that is,
412    a larger-numbered class must never be contained completely
413    in a smaller-numbered class.
414
415    For any two classes, it is very desirable that there be another
416    class that represents their union.  */
417    
418 enum reg_class
419 {
420   NO_REGS, GENERAL_REGS, ALL_REGS, LIM_REG_CLASSES
421 };
422
423 #define N_REG_CLASSES (int) LIM_REG_CLASSES
424
425 /* Give names of register classes as strings for dump file.   */
426
427 #define REG_CLASS_NAMES \
428 { "NO_REGS", "GENERAL_REGS", "ALL_REGS", "LIM_REGS" }
429
430 /* Define which registers fit in which classes.
431    This is an initializer for a vector of HARD_REG_SET
432    of length N_REG_CLASSES.  */
433
434 #define REG_CLASS_CONTENTS                      \
435 {  0x00000000,          /* No regs      */      \
436    0xffffffff,          /* GENERAL_REGS */      \
437    0xffffffff,          /* ALL_REGS     */      \
438 }
439
440 /* The same information, inverted:
441    Return the class number of the smallest class containing
442    reg number REGNO.  This could be a conditional expression
443    or could index an array.  */
444
445 #define REGNO_REG_CLASS(REGNO)  GENERAL_REGS
446
447 /* The class value for index registers, and the one for base regs.  */
448
449 #define INDEX_REG_CLASS NO_REGS
450 #define BASE_REG_CLASS  GENERAL_REGS
451
452 /* Get reg_class from a letter such as appears in the machine description.  */
453
454 #define REG_CLASS_FROM_LETTER(C) (NO_REGS)
455
456 /* Macros to check register numbers against specific register classes.  */
457
458 /* These assume that REGNO is a hard or pseudo reg number.
459    They give nonzero only if REGNO is a hard reg of the suitable class
460    or a pseudo reg currently allocated to a suitable hard reg.
461    Since they use reg_renumber, they are safe only once reg_renumber
462    has been allocated, which happens in local-alloc.c.  */
463  
464 #define REGNO_OK_FOR_BASE_P(regno) \
465   ((regno) < FIRST_PSEUDO_REGISTER || reg_renumber[regno] >= 0)
466
467 #define REGNO_OK_FOR_INDEX_P(regno) 0
468
469 /* Given an rtx X being reloaded into a reg required to be
470    in class CLASS, return the class of reg to actually use.
471    In general this is just CLASS; but on some machines
472    in some cases it is preferable to use a more restrictive class.  */
473
474 #define PREFERRED_RELOAD_CLASS(X,CLASS)  (CLASS)
475
476 /* Return the maximum number of consecutive registers
477    needed to represent mode MODE in a register of class CLASS.  */
478
479 #define CLASS_MAX_NREGS(CLASS, MODE)    \
480   ((GET_MODE_SIZE (MODE) + UNITS_PER_WORD - 1) / UNITS_PER_WORD)
481
482 /* The letters I, J, K, L, M, N, O, P in a register constraint string
483    can be used to stand for particular ranges of immediate operands.
484    This macro defines what the ranges are.
485    C is the letter, and VALUE is a constant value.
486    Return 1 if VALUE is in the range specified by C.  */
487
488 #define INT_7_BITS(VALUE) ((unsigned) (VALUE) + 0x40 < 0x80)
489 #define INT_8_BITS(VALUE) ((unsigned) (VALUE) + 0x80 < 0x100)
490 /* zero */
491 #define CONST_OK_FOR_I(VALUE) ((VALUE) == 0)
492 /* 5 bit signed immediate */
493 #define CONST_OK_FOR_J(VALUE) ((unsigned) (VALUE) + 0x10 < 0x20)
494 /* 16 bit signed immediate */
495 #define CONST_OK_FOR_K(VALUE) ((unsigned) (VALUE) + 0x8000 < 0x10000)
496 /* valid constant for movhi instruction.  */
497 #define CONST_OK_FOR_L(VALUE) \
498   (((unsigned) ((int) (VALUE) >> 16) + 0x8000 < 0x10000) \
499    && CONST_OK_FOR_I ((VALUE & 0xffff)))
500 /* 16 bit unsigned immediate */
501 #define CONST_OK_FOR_M(VALUE) ((unsigned)(VALUE) < 0x10000)
502 /* 5 bit unsigned immediate in shift instructions */
503 #define CONST_OK_FOR_N(VALUE) ((unsigned) (VALUE) <= 31)
504
505 #define CONST_OK_FOR_O(VALUE) 0
506 #define CONST_OK_FOR_P(VALUE) 0
507
508
509 #define CONST_OK_FOR_LETTER_P(VALUE, C)  \
510   ((C) == 'I' ? CONST_OK_FOR_I (VALUE) : \
511    (C) == 'J' ? CONST_OK_FOR_J (VALUE) : \
512    (C) == 'K' ? CONST_OK_FOR_K (VALUE) : \
513    (C) == 'L' ? CONST_OK_FOR_L (VALUE) : \
514    (C) == 'M' ? CONST_OK_FOR_M (VALUE) : \
515    (C) == 'N' ? CONST_OK_FOR_N (VALUE) : \
516    (C) == 'O' ? CONST_OK_FOR_O (VALUE) : \
517    (C) == 'P' ? CONST_OK_FOR_P (VALUE) : \
518    0)
519
520 /* Similar, but for floating constants, and defining letters G and H.
521    Here VALUE is the CONST_DOUBLE rtx itself. 
522      
523   `G' is a zero of some form.  */
524
525 #define CONST_DOUBLE_OK_FOR_G(VALUE)                                    \
526   ((GET_MODE_CLASS (GET_MODE (VALUE)) == MODE_FLOAT                     \
527     && (VALUE) == CONST0_RTX (GET_MODE (VALUE)))                        \
528    || (GET_MODE_CLASS (GET_MODE (VALUE)) == MODE_INT                    \
529        && CONST_DOUBLE_LOW (VALUE) == 0                                 \
530        && CONST_DOUBLE_HIGH (VALUE) == 0))
531
532 #define CONST_DOUBLE_OK_FOR_H(VALUE) 0
533
534 #define CONST_DOUBLE_OK_FOR_LETTER_P(VALUE, C)                          \
535   ((C) == 'G'   ? CONST_DOUBLE_OK_FOR_G (VALUE)                         \
536    : (C) == 'H' ? CONST_DOUBLE_OK_FOR_H (VALUE)                         \
537    : 0)
538
539 \f
540 /* Stack layout; function entry, exit and calling.  */
541
542 /* Define this if pushing a word on the stack
543    makes the stack pointer a smaller address.  */
544
545 #define STACK_GROWS_DOWNWARD
546
547 /* Define this if the nominal address of the stack frame
548    is at the high-address end of the local variables;
549    that is, each additional local variable allocated
550    goes at a more negative offset in the frame.  */
551
552 #define FRAME_GROWS_DOWNWARD
553
554 /* Offset within stack frame to start allocating local variables at.
555    If FRAME_GROWS_DOWNWARD, this is the offset to the END of the
556    first local allocated.  Otherwise, it is the offset to the BEGINNING
557    of the first local allocated.  */
558
559 #define STARTING_FRAME_OFFSET 0
560
561 /* Offset of first parameter from the argument pointer register value.  */
562 /* Is equal to the size of the saved fp + pc, even if an fp isn't
563    saved since the value is used before we know.  */
564
565 #define FIRST_PARM_OFFSET(FNDECL) 0
566
567 /* Specify the registers used for certain standard purposes.
568    The values of these macros are register numbers.  */
569
570 /* Register to use for pushing function arguments.  */
571 #define STACK_POINTER_REGNUM 3
572
573 /* Base register for access to local variables of the function.  */
574 #define FRAME_POINTER_REGNUM 32
575
576 /* On some machines the offset between the frame pointer and starting
577    offset of the automatic variables is not known until after register
578    allocation has been done (for example, because the saved registers
579    are between these two locations).  On those machines, define
580    `FRAME_POINTER_REGNUM' the number of a special, fixed register to
581    be used internally until the offset is known, and define
582    `HARD_FRAME_POINTER_REGNUM' to be actual the hard register number
583    used for the frame pointer.
584
585    You should define this macro only in the very rare circumstances
586    when it is not possible to calculate the offset between the frame
587    pointer and the automatic variables until after register
588    allocation has been completed.  When this macro is defined, you
589    must also indicate in your definition of `ELIMINABLE_REGS' how to
590    eliminate `FRAME_POINTER_REGNUM' into either
591    `HARD_FRAME_POINTER_REGNUM' or `STACK_POINTER_REGNUM'.
592
593    Do not define this macro if it would be the same as
594    `FRAME_POINTER_REGNUM'. */
595 #undef  HARD_FRAME_POINTER_REGNUM 
596 #define HARD_FRAME_POINTER_REGNUM 29
597
598 /* Base register for access to arguments of the function.  */
599 #define ARG_POINTER_REGNUM 33
600
601 /* Register in which static-chain is passed to a function.  */
602 #define STATIC_CHAIN_REGNUM 20
603
604 /* Value should be nonzero if functions must have frame pointers.
605    Zero means the frame pointer need not be set up (and parms
606    may be accessed via the stack pointer) in functions that seem suitable.
607    This is computed in `reload', in reload1.c.  */
608 #define FRAME_POINTER_REQUIRED 0
609
610 /* If defined, this macro specifies a table of register pairs used to
611    eliminate unneeded registers that point into the stack frame.  If
612    it is not defined, the only elimination attempted by the compiler
613    is to replace references to the frame pointer with references to
614    the stack pointer.
615
616    The definition of this macro is a list of structure
617    initializations, each of which specifies an original and
618    replacement register.
619
620    On some machines, the position of the argument pointer is not
621    known until the compilation is completed.  In such a case, a
622    separate hard register must be used for the argument pointer.
623    This register can be eliminated by replacing it with either the
624    frame pointer or the argument pointer, depending on whether or not
625    the frame pointer has been eliminated.
626
627    In this case, you might specify:
628         #define ELIMINABLE_REGS  \
629         {{ARG_POINTER_REGNUM, STACK_POINTER_REGNUM}, \
630          {ARG_POINTER_REGNUM, FRAME_POINTER_REGNUM}, \
631          {FRAME_POINTER_REGNUM, STACK_POINTER_REGNUM}}
632
633    Note that the elimination of the argument pointer with the stack
634    pointer is specified first since that is the preferred elimination. */
635
636 #define ELIMINABLE_REGS                                                 \
637 {{ FRAME_POINTER_REGNUM, STACK_POINTER_REGNUM },                        \
638  { FRAME_POINTER_REGNUM, HARD_FRAME_POINTER_REGNUM },                   \
639  { ARG_POINTER_REGNUM,   STACK_POINTER_REGNUM },                        \
640  { ARG_POINTER_REGNUM,   HARD_FRAME_POINTER_REGNUM }}                   \
641
642 /* A C expression that returns non-zero if the compiler is allowed to
643    try to replace register number FROM-REG with register number
644    TO-REG.  This macro need only be defined if `ELIMINABLE_REGS' is
645    defined, and will usually be the constant 1, since most of the
646    cases preventing register elimination are things that the compiler
647    already knows about. */
648
649 #define CAN_ELIMINATE(FROM, TO) \
650  ((TO) == STACK_POINTER_REGNUM ? ! frame_pointer_needed : 1)
651
652 /* This macro is similar to `INITIAL_FRAME_POINTER_OFFSET'.  It
653    specifies the initial difference between the specified pair of
654    registers.  This macro must be defined if `ELIMINABLE_REGS' is
655    defined. */
656
657 #define INITIAL_ELIMINATION_OFFSET(FROM, TO, OFFSET)                    \
658 {                                                                       \
659   if ((FROM) == FRAME_POINTER_REGNUM)                                   \
660     (OFFSET) = get_frame_size () + current_function_outgoing_args_size; \
661   else if ((FROM) == ARG_POINTER_REGNUM)                                \
662    (OFFSET) = compute_frame_size (get_frame_size (), (long *)0);        \
663   else                                                                  \
664     abort ();                                                           \
665 }
666
667 /* A guess for the V850.  */
668 #define PROMOTE_PROTOTYPES 1
669
670 /* Keep the stack pointer constant throughout the function.  */
671 #define ACCUMULATE_OUTGOING_ARGS
672
673 /* Value is the number of bytes of arguments automatically
674    popped when returning from a subroutine call.
675    FUNDECL is the declaration node of the function (as a tree),
676    FUNTYPE is the data type of the function (as a tree),
677    or for a library call it is an identifier node for the subroutine name.
678    SIZE is the number of bytes of arguments passed on the stack.  */
679
680 #define RETURN_POPS_ARGS(FUNDECL,FUNTYPE,SIZE) 0
681
682 \f
683 /* Define a data type for recording info about an argument list
684    during the scan of that argument list.  This data type should
685    hold all necessary information about the function itself
686    and about the args processed so far, enough to enable macros
687    such as FUNCTION_ARG to determine where the next arg should go.  */
688
689 #define CUMULATIVE_ARGS struct cum_arg
690 struct cum_arg { int nbytes; };
691
692 /* Define where to put the arguments to a function.
693    Value is zero to push the argument on the stack,
694    or a hard register in which to store the argument.
695
696    MODE is the argument's machine mode.
697    TYPE is the data type of the argument (as a tree).
698     This is null for libcalls where that information may
699     not be available.
700    CUM is a variable of type CUMULATIVE_ARGS which gives info about
701     the preceding args and about the function being called.
702    NAMED is nonzero if this argument is a named parameter
703     (otherwise it is an extra parameter matching an ellipsis).  */
704
705 #define FUNCTION_ARG(CUM, MODE, TYPE, NAMED) \
706   function_arg (&CUM, MODE, TYPE, NAMED)
707
708 #define FUNCTION_ARG_PARTIAL_NREGS(CUM, MODE, TYPE, NAMED) \
709   function_arg_partial_nregs (&CUM, MODE, TYPE, NAMED)
710
711 /* Initialize a variable CUM of type CUMULATIVE_ARGS
712    for a call to a function whose data type is FNTYPE.
713    For a library call, FNTYPE is 0.  */
714
715 #define INIT_CUMULATIVE_ARGS(CUM,FNTYPE,LIBNAME,INDIRECT)       \
716  ((CUM).nbytes = 0)
717
718 /* Update the data in CUM to advance over an argument
719    of mode MODE and data type TYPE.
720    (TYPE is null for libcalls where that information may not be available.)  */
721
722 #define FUNCTION_ARG_ADVANCE(CUM, MODE, TYPE, NAMED)    \
723  ((CUM).nbytes += ((MODE) != BLKmode                    \
724   ? (GET_MODE_SIZE (MODE) + UNITS_PER_WORD - 1) & -UNITS_PER_WORD       \
725   : (int_size_in_bytes (TYPE) + UNITS_PER_WORD - 1) & -UNITS_PER_WORD))
726
727 /* When a parameter is passed in a register, stack space is still
728    allocated for it.  */
729 #define REG_PARM_STACK_SPACE(DECL) (!TARGET_GHS ? 16 : 0)
730
731 /* Define this if the above stack space is to be considered part of the
732    space allocated by the caller.  */
733 #define OUTGOING_REG_PARM_STACK_SPACE
734
735 extern int current_function_anonymous_args;
736 /* Do any setup necessary for varargs/stdargs functions.  */
737 #define SETUP_INCOMING_VARARGS(CUM, MODE, TYPE, PAS, SECOND) \
738   current_function_anonymous_args = (!TARGET_GHS ? 1 : 0);
739
740 #define FUNCTION_ARG_PASS_BY_REFERENCE(CUM, MODE, TYPE, NAMED)          \
741   ((TYPE) && int_size_in_bytes (TYPE) > 8)
742  
743 #define FUNCTION_ARG_CALLEE_COPIES(CUM, MODE, TYPE, NAMED) \
744   ((TYPE) && int_size_in_bytes (TYPE) > 8)
745
746 /* 1 if N is a possible register number for function argument passing.  */
747
748 #define FUNCTION_ARG_REGNO_P(N) (N >= 6 && N <= 9)
749
750 /* Define how to find the value returned by a function.
751    VALTYPE is the data type of the value (as a tree).
752    If the precise function being called is known, FUNC is its FUNCTION_DECL;
753    otherwise, FUNC is 0.   */
754    
755 #define FUNCTION_VALUE(VALTYPE, FUNC) \
756   gen_rtx (REG, TYPE_MODE (VALTYPE), 10)
757
758 /* Define how to find the value returned by a library function
759    assuming the value has mode MODE.  */
760
761 #define LIBCALL_VALUE(MODE) \
762   gen_rtx (REG, MODE, 10)
763
764 /* 1 if N is a possible register number for a function value.  */
765
766 #define FUNCTION_VALUE_REGNO_P(N) ((N) == 10)
767
768 /* Return values > 8 bytes in length in memory.  */
769 #define DEFAULT_PCC_STRUCT_RETURN 0
770 #define RETURN_IN_MEMORY(TYPE)  \
771   (int_size_in_bytes (TYPE) > 8 || TYPE_MODE (TYPE) == BLKmode)
772
773 /* Register in which address to store a structure value
774    is passed to a function.  On the V850 it's passed as
775    the first parameter.  */
776
777 #define STRUCT_VALUE 0
778
779 /* EXIT_IGNORE_STACK should be nonzero if, when returning from a function,
780    the stack pointer does not matter.  The value is tested only in
781    functions that have frame pointers.
782    No definition is equivalent to always zero.  */
783
784 #define EXIT_IGNORE_STACK 1
785
786 /* Output assembler code to FILE to increment profiler label # LABELNO
787    for profiling a function entry.  */
788
789 #define FUNCTION_PROFILER(FILE, LABELNO) ;
790
791 #define TRAMPOLINE_TEMPLATE(FILE)                       \
792   do {                                                  \
793     fprintf (FILE, "\tjarl .+4,r12\n");                 \
794     fprintf (FILE, "\tld.w 12[r12],r5\n");              \
795     fprintf (FILE, "\tld.w 16[r12],r12\n");             \
796     fprintf (FILE, "\tjmp [r12]\n");                    \
797     fprintf (FILE, "\tnop\n");                          \
798     fprintf (FILE, "\t.long 0\n");                      \
799     fprintf (FILE, "\t.long 0\n");                      \
800   } while (0)
801
802 /* Length in units of the trampoline for entering a nested function.  */
803
804 #define TRAMPOLINE_SIZE 24
805
806 /* Emit RTL insns to initialize the variable parts of a trampoline.
807    FNADDR is an RTX for the address of the function's pure code.
808    CXT is an RTX for the static chain value for the function.  */
809
810 #define INITIALIZE_TRAMPOLINE(TRAMP, FNADDR, CXT)                       \
811 {                                                                       \
812   emit_move_insn (gen_rtx (MEM, SImode, plus_constant ((TRAMP), 16)),   \
813                  (CXT));                                                \
814   emit_move_insn (gen_rtx (MEM, SImode, plus_constant ((TRAMP), 20)),   \
815                  (FNADDR));                                             \
816 }
817
818 /* Addressing modes, and classification of registers for them.  */
819
820 \f
821 /* 1 if X is an rtx for a constant that is a valid address.  */
822
823 /* ??? This seems too exclusive.  May get better code by accepting more
824    possibilities here, in particular, should accept ZDA_NAME SYMBOL_REFs.  */
825
826 #define CONSTANT_ADDRESS_P(X)   \
827   (GET_CODE (X) == CONST_INT                            \
828    && CONST_OK_FOR_K (INTVAL (X)))
829
830 /* Maximum number of registers that can appear in a valid memory address.  */
831
832 #define MAX_REGS_PER_ADDRESS 1
833
834 /* The macros REG_OK_FOR..._P assume that the arg is a REG rtx
835    and check its validity for a certain class.
836    We have two alternate definitions for each of them.
837    The usual definition accepts all pseudo regs; the other rejects
838    them unless they have been allocated suitable hard regs.
839    The symbol REG_OK_STRICT causes the latter definition to be used.
840
841    Most source files want to accept pseudo regs in the hope that
842    they will get allocated to the class that the insn wants them to be in.
843    Source files for reload pass need to be strict.
844    After reload, it makes no difference, since pseudo regs have
845    been eliminated by then.  */
846
847 #ifndef REG_OK_STRICT
848
849 /* Nonzero if X is a hard reg that can be used as an index
850    or if it is a pseudo reg.  */
851 #define REG_OK_FOR_INDEX_P(X) 0
852 /* Nonzero if X is a hard reg that can be used as a base reg
853    or if it is a pseudo reg.  */
854 #define REG_OK_FOR_BASE_P(X) 1
855 #define REG_OK_FOR_INDEX_P_STRICT(X) 0
856 #define REG_OK_FOR_BASE_P_STRICT(X) REGNO_OK_FOR_BASE_P (REGNO (X))
857 #define STRICT 0
858
859 #else
860
861 /* Nonzero if X is a hard reg that can be used as an index.  */
862 #define REG_OK_FOR_INDEX_P(X) 0
863 /* Nonzero if X is a hard reg that can be used as a base reg.  */
864 #define REG_OK_FOR_BASE_P(X) REGNO_OK_FOR_BASE_P (REGNO (X))
865 #define STRICT 1
866
867 #endif
868
869 /* A C expression that defines the optional machine-dependent
870    constraint letters that can be used to segregate specific types of
871    operands, usually memory references, for the target machine.
872    Normally this macro will not be defined.  If it is required for a
873    particular target machine, it should return 1 if VALUE corresponds
874    to the operand type represented by the constraint letter C.  If C
875    is not defined as an extra constraint, the value returned should
876    be 0 regardless of VALUE.
877
878    For example, on the ROMP, load instructions cannot have their
879    output in r0 if the memory reference contains a symbolic address.
880    Constraint letter `Q' is defined as representing a memory address
881    that does *not* contain a symbolic address.  An alternative is
882    specified with a `Q' constraint on the input and `r' on the
883    output.  The next alternative specifies `m' on the input and a
884    register class that does not include r0 on the output.  */
885
886 #define EXTRA_CONSTRAINT(OP, C)                                         \
887  ((C) == 'Q'   ? ep_memory_operand (OP, GET_MODE (OP))                  \
888   : (C) == 'R' ? special_symbolref_operand (OP, VOIDmode)               \
889   : (C) == 'S' ? (GET_CODE (OP) == SYMBOL_REF && ! ZDA_NAME_P (XSTR (OP, 0))) \
890   : (C) == 'T' ? 0                                                      \
891   : (C) == 'U' ? ((GET_CODE (OP) == SYMBOL_REF && ZDA_NAME_P (XSTR (OP, 0))) \
892                   || (GET_CODE (OP) == CONST                            \
893                       && GET_CODE (XEXP (OP, 0)) == PLUS                \
894                       && GET_CODE (XEXP (XEXP (OP, 0), 0)) == SYMBOL_REF \
895                       && ZDA_NAME_P (XSTR (XEXP (XEXP (OP, 0), 0), 0)))) \
896   : 0)
897 \f
898 /* GO_IF_LEGITIMATE_ADDRESS recognizes an RTL expression
899    that is a valid memory address for an instruction.
900    The MODE argument is the machine mode for the MEM expression
901    that wants to use this address.
902
903    The other macros defined here are used only in GO_IF_LEGITIMATE_ADDRESS,
904    except for CONSTANT_ADDRESS_P which is actually
905    machine-independent.  */
906
907 /* Accept either REG or SUBREG where a register is valid.  */
908   
909 #define RTX_OK_FOR_BASE_P(X)                                            \
910   ((REG_P (X) && REG_OK_FOR_BASE_P (X))                                 \
911    || (GET_CODE (X) == SUBREG && REG_P (SUBREG_REG (X))                 \
912        && REG_OK_FOR_BASE_P (SUBREG_REG (X))))
913
914 #define GO_IF_LEGITIMATE_ADDRESS(MODE, X, ADDR)                         \
915 do {                                                                    \
916   if (RTX_OK_FOR_BASE_P (X)) goto ADDR;                                 \
917   if (CONSTANT_ADDRESS_P (X)                                            \
918       && (MODE == QImode || INTVAL (X) % 2 == 0))                       \
919     goto ADDR;                                                          \
920   if (GET_CODE (X) == LO_SUM                                            \
921       && GET_CODE (XEXP (X, 0)) == REG                                  \
922       && REG_OK_FOR_BASE_P (XEXP (X, 0))                                \
923       && CONSTANT_P (XEXP (X, 1))                                       \
924       && (GET_CODE (XEXP (X, 1)) != CONST_INT                           \
925           || ((MODE == QImode || INTVAL (XEXP (X, 1)) % 2 == 0)         \
926               && CONST_OK_FOR_K (INTVAL (XEXP (X, 1)))))                \
927       && GET_MODE_SIZE (MODE) <= GET_MODE_SIZE (word_mode))             \
928     goto ADDR;                                                          \
929   if (special_symbolref_operand (X, MODE)                               \
930       && (GET_MODE_SIZE (MODE) <= GET_MODE_SIZE (word_mode)))           \
931      goto ADDR;                                                         \
932   if (GET_CODE (X) == PLUS                                              \
933       && CONSTANT_ADDRESS_P (XEXP (X, 1))                               \
934       && (MODE == QImode || INTVAL (XEXP (X, 1)) % 2 == 0)              \
935       && RTX_OK_FOR_BASE_P (XEXP (X, 0))) goto ADDR;                    \
936 } while (0)
937
938 \f
939 /* Try machine-dependent ways of modifying an illegitimate address
940    to be legitimate.  If we find one, return the new, valid address.
941    This macro is used in only one place: `memory_address' in explow.c.
942
943    OLDX is the address as it was before break_out_memory_refs was called.
944    In some cases it is useful to look at this to decide what needs to be done.
945
946    MODE and WIN are passed so that this macro can use
947    GO_IF_LEGITIMATE_ADDRESS.
948
949    It is always safe for this macro to do nothing.  It exists to recognize
950    opportunities to optimize the output.   */
951
952 #define LEGITIMIZE_ADDRESS(X,OLDX,MODE,WIN)  {}
953
954 /* Go to LABEL if ADDR (a legitimate address expression)
955    has an effect that depends on the machine mode it is used for.  */
956
957 #define GO_IF_MODE_DEPENDENT_ADDRESS(ADDR,LABEL)  {}
958
959 /* Nonzero if the constant value X is a legitimate general operand.
960    It is given that X satisfies CONSTANT_P or is a CONST_DOUBLE.  */
961
962 #define LEGITIMATE_CONSTANT_P(X)                                        \
963   (GET_CODE (X) == CONST_DOUBLE                                         \
964    || !(GET_CODE (X) == CONST                                           \
965         && GET_CODE (XEXP (X, 0)) == PLUS                               \
966         && GET_CODE (XEXP (XEXP (X, 0), 0)) == SYMBOL_REF               \
967         && GET_CODE (XEXP (XEXP (X, 0), 1)) == CONST_INT                \
968         && ! CONST_OK_FOR_K (INTVAL (XEXP (XEXP (X, 0), 1)))))
969
970 /* In rare cases, correct code generation requires extra machine
971    dependent processing between the second jump optimization pass and
972    delayed branch scheduling.  On those machines, define this macro
973    as a C statement to act on the code starting at INSN.  */
974
975 #define MACHINE_DEPENDENT_REORG(INSN) v850_reorg (INSN)
976
977 \f
978 /* Tell final.c how to eliminate redundant test instructions.  */
979
980 /* Here we define machine-dependent flags and fields in cc_status
981    (see `conditions.h').  No extra ones are needed for the vax.  */
982
983 /* Store in cc_status the expressions
984    that the condition codes will describe
985    after execution of an instruction whose pattern is EXP.
986    Do not alter them if the instruction would not alter the cc's.  */
987
988 #define CC_OVERFLOW_UNUSABLE 0x200
989 #define CC_NO_CARRY CC_NO_OVERFLOW
990 #define NOTICE_UPDATE_CC(EXP, INSN) notice_update_cc(EXP, INSN)
991
992 /* A part of a C `switch' statement that describes the relative costs
993    of constant RTL expressions.  It must contain `case' labels for
994    expression codes `const_int', `const', `symbol_ref', `label_ref'
995    and `const_double'.  Each case must ultimately reach a `return'
996    statement to return the relative cost of the use of that kind of
997    constant value in an expression.  The cost may depend on the
998    precise value of the constant, which is available for examination
999    in X, and the rtx code of the expression in which it is contained,
1000    found in OUTER_CODE.
1001
1002    CODE is the expression code--redundant, since it can be obtained
1003    with `GET_CODE (X)'. */
1004
1005 #define CONST_COSTS(RTX,CODE,OUTER_CODE)                                \
1006   case CONST_INT:                                                       \
1007   case CONST_DOUBLE:                                                    \
1008   case CONST:                                                           \
1009   case SYMBOL_REF:                                                      \
1010   case LABEL_REF:                                                       \
1011     {                                                                   \
1012       int _zxy = const_costs(RTX, CODE);                                \
1013       return (_zxy) ? COSTS_N_INSNS (_zxy) : 0;                         \
1014     }
1015
1016 /* A crude cut at RTX_COSTS for the V850.  */
1017
1018 /* Provide the costs of a rtl expression.  This is in the body of a
1019    switch on CODE. 
1020
1021    There aren't DImode MOD, DIV or MULT operations, so call them
1022    very expensive.  Everything else is pretty much a constant cost.  */
1023
1024 #define RTX_COSTS(RTX,CODE,OUTER_CODE)                                  \
1025   case MOD:                                                             \
1026   case DIV:                                                             \
1027     return 60;                                                          \
1028   case MULT:                                                            \
1029     return 20;
1030
1031 /* All addressing modes have the same cost on the V850 series.  */
1032 #define ADDRESS_COST(ADDR) 1
1033
1034 /* Nonzero if access to memory by bytes or half words is no faster
1035    than accessing full words.  */
1036 #define SLOW_BYTE_ACCESS 1
1037
1038 /* Define this if zero-extension is slow (more than one real instruction).  */
1039 #define SLOW_ZERO_EXTEND 
1040
1041 /* According expr.c, a value of around 6 should minimize code size, and
1042    for the V850 series, that's our primary concern.  */
1043 #define MOVE_RATIO 6
1044
1045 /* Indirect calls are expensive, never turn a direct call
1046    into an indirect call.  */
1047 #define NO_FUNCTION_CSE
1048
1049 /* The four different data regions on the v850.  */
1050 typedef enum 
1051 {
1052   DATA_AREA_NORMAL,
1053   DATA_AREA_SDA,
1054   DATA_AREA_TDA,
1055   DATA_AREA_ZDA
1056 } v850_data_area;
1057
1058 /* A list of names for sections other than the standard two, which are
1059    `in_text' and `in_data'.  You need not define this macro on a
1060    system with no other sections (that GCC needs to use).  */
1061 #undef  EXTRA_SECTIONS
1062 #define EXTRA_SECTIONS in_tdata, in_sdata, in_zdata, in_const, in_ctors, \
1063 in_dtors, in_rozdata, in_rosdata, in_sbss, in_zbss, in_zcommon, in_scommon
1064
1065 /* One or more functions to be defined in `varasm.c'.  These
1066    functions should do jobs analogous to those of `text_section' and
1067    `data_section', for your additional sections.  Do not define this
1068    macro if you do not define `EXTRA_SECTIONS'. */
1069 #undef  EXTRA_SECTION_FUNCTIONS
1070
1071 /* This could be done a lot more cleanly using ANSI C ... */
1072 #define EXTRA_SECTION_FUNCTIONS                                         \
1073 CONST_SECTION_FUNCTION                                                  \
1074 CTORS_SECTION_FUNCTION                                                  \
1075 DTORS_SECTION_FUNCTION                                                  \
1076                                                                         \
1077 void                                                                    \
1078 sdata_section ()                                                        \
1079 {                                                                       \
1080   if (in_section != in_sdata)                                           \
1081     {                                                                   \
1082       fprintf (asm_out_file, "%s\n", SDATA_SECTION_ASM_OP);             \
1083       in_section = in_sdata;                                            \
1084     }                                                                   \
1085 }                                                                       \
1086                                                                         \
1087 void                                                                    \
1088 rosdata_section ()                                                      \
1089 {                                                                       \
1090   if (in_section != in_rosdata)                                         \
1091     {                                                                   \
1092       fprintf (asm_out_file, "%s\n", ROSDATA_SECTION_ASM_OP);           \
1093       in_section = in_sdata;                                            \
1094     }                                                                   \
1095 }                                                                       \
1096                                                                         \
1097 void                                                                    \
1098 sbss_section ()                                                         \
1099 {                                                                       \
1100   if (in_section != in_sbss)                                            \
1101     {                                                                   \
1102       fprintf (asm_out_file, "%s\n", SBSS_SECTION_ASM_OP);              \
1103       in_section = in_sbss;                                             \
1104     }                                                                   \
1105 }                                                                       \
1106                                                                         \
1107 void                                                                    \
1108 tdata_section ()                                                        \
1109 {                                                                       \
1110   if (in_section != in_tdata)                                           \
1111     {                                                                   \
1112       fprintf (asm_out_file, "%s\n", TDATA_SECTION_ASM_OP);             \
1113       in_section = in_tdata;                                            \
1114     }                                                                   \
1115 }                                                                       \
1116                                                                         \
1117 void                                                                    \
1118 zdata_section ()                                                        \
1119 {                                                                       \
1120   if (in_section != in_zdata)                                           \
1121     {                                                                   \
1122       fprintf (asm_out_file, "%s\n", ZDATA_SECTION_ASM_OP);             \
1123       in_section = in_zdata;                                            \
1124     }                                                                   \
1125 }                                                                       \
1126                                                                         \
1127 void                                                                    \
1128 rozdata_section ()                                                      \
1129 {                                                                       \
1130   if (in_section != in_rozdata)                                         \
1131     {                                                                   \
1132       fprintf (asm_out_file, "%s\n", ROZDATA_SECTION_ASM_OP);           \
1133       in_section = in_rozdata;                                          \
1134     }                                                                   \
1135 }                                                                       \
1136                                                                         \
1137 void                                                                    \
1138 zbss_section ()                                                         \
1139 {                                                                       \
1140   if (in_section != in_zbss)                                            \
1141     {                                                                   \
1142       fprintf (asm_out_file, "%s\n", ZBSS_SECTION_ASM_OP);              \
1143       in_section = in_zbss;                                             \
1144     }                                                                   \
1145 }
1146
1147 #define TEXT_SECTION_ASM_OP  "\t.section .text"
1148 #define DATA_SECTION_ASM_OP  "\t.section .data"
1149 #define BSS_SECTION_ASM_OP   "\t.section .bss"
1150 #define SDATA_SECTION_ASM_OP "\t.section .sdata,\"aw\""
1151 #define SBSS_SECTION_ASM_OP  "\t.section .sbss,\"aw\""
1152 #define ZDATA_SECTION_ASM_OP "\t.section .zdata,\"aw\""
1153 #define ZBSS_SECTION_ASM_OP  "\t.section .zbss,\"aw\""
1154 #define TDATA_SECTION_ASM_OP "\t.section .tdata,\"aw\""
1155 #define ROSDATA_SECTION_ASM_OP "\t.section .rosdata,\"a\""
1156 #define ROZDATA_SECTION_ASM_OP "\t.section .rozdata,\"a\""
1157
1158 #define SCOMMON_ASM_OP         ".scomm"
1159 #define ZCOMMON_ASM_OP         ".zcomm"
1160 #define TCOMMON_ASM_OP         ".tcomm"
1161
1162 /* A C statement or statements to switch to the appropriate section
1163    for output of EXP.  You can assume that EXP is either a `VAR_DECL'
1164    node or a constant of some sort.  RELOC indicates whether the
1165    initial value of EXP requires link-time relocations.  Select the
1166    section by calling `text_section' or one of the alternatives for
1167    other sections.
1168
1169    Do not define this macro if you put all read-only variables and
1170    constants in the read-only data section (usually the text section).  */
1171 #undef  SELECT_SECTION
1172 #define SELECT_SECTION(EXP, RELOC)                                      \
1173 do {                                                                    \
1174   if (TREE_CODE (EXP) == VAR_DECL)                                      \
1175     {                                                                   \
1176       int is_const;                                                     \
1177       if (!TREE_READONLY (EXP)                                          \
1178           || TREE_SIDE_EFFECTS (EXP)                                    \
1179           || !DECL_INITIAL (EXP)                                        \
1180           || (DECL_INITIAL (EXP) != error_mark_node                     \
1181               && !TREE_CONSTANT (DECL_INITIAL (EXP))))                  \
1182         is_const = FALSE;                                               \
1183       else                                                              \
1184         is_const = TRUE;                                                \
1185                                                                         \
1186       switch (v850_get_data_area (EXP))                                 \
1187         {                                                               \
1188         case DATA_AREA_ZDA:                                             \
1189           if (is_const)                                                 \
1190             rozdata_section ();                                         \
1191           else                                                          \
1192             zdata_section ();                                           \
1193           break;                                                        \
1194                                                                         \
1195         case DATA_AREA_TDA:                                             \
1196           tdata_section ();                                             \
1197           break;                                                        \
1198                                                                         \
1199         case DATA_AREA_SDA:                                             \
1200           if (is_const)                                                 \
1201             rosdata_section ();                                         \
1202           else                                                          \
1203             sdata_section ();                                           \
1204           break;                                                        \
1205                                                                         \
1206         default:                                                        \
1207           if (is_const)                                                 \
1208             const_section ();                                           \
1209           else                                                          \
1210             data_section ();                                            \
1211           break;                                                        \
1212         }                                                               \
1213     }                                                                   \
1214   else if (TREE_CODE (EXP) == STRING_CST)                               \
1215     {                                                                   \
1216       if (! flag_writable_strings)                                      \
1217         const_section ();                                               \
1218       else                                                              \
1219         data_section ();                                                \
1220     }                                                                   \
1221                                                                         \
1222   else                                                                  \
1223     const_section ();                                                   \
1224                                                                         \
1225 } while (0)
1226
1227 /* A C statement or statements to switch to the appropriate section
1228    for output of RTX in mode MODE.  You can assume that RTX is some
1229    kind of constant in RTL.  The argument MODE is redundant except in
1230    the case of a `const_int' rtx.  Select the section by calling
1231    `text_section' or one of the alternatives for other sections.
1232
1233    Do not define this macro if you put all constants in the read-only
1234    data section.  */
1235 /* #define SELECT_RTX_SECTION(MODE, RTX) */
1236
1237 /* Output at beginning/end of assembler file.  */
1238 #undef ASM_FILE_START
1239 #define ASM_FILE_START(FILE) asm_file_start(FILE)
1240
1241 #define ASM_COMMENT_START "#"
1242
1243 /* Output to assembler file text saying following lines
1244    may contain character constants, extra white space, comments, etc.  */
1245
1246 #define ASM_APP_ON "#APP\n"
1247
1248 /* Output to assembler file text saying following lines
1249    no longer contain unusual constructs.  */
1250
1251 #define ASM_APP_OFF "#NO_APP\n"
1252
1253 /* This is how to output an assembler line defining a `double' constant.
1254    It is .double or .float, depending.  */
1255
1256 #define ASM_OUTPUT_DOUBLE(FILE, VALUE)                  \
1257 do { char dstr[30];                                     \
1258      REAL_VALUE_TO_DECIMAL ((VALUE), "%.20e", dstr);    \
1259      fprintf (FILE, "\t.double %s\n", dstr);            \
1260    } while (0)
1261
1262
1263 /* This is how to output an assembler line defining a `float' constant.  */
1264 #define ASM_OUTPUT_FLOAT(FILE, VALUE)                   \
1265 do { char dstr[30];                                     \
1266      REAL_VALUE_TO_DECIMAL ((VALUE), "%.20e", dstr);    \
1267      fprintf (FILE, "\t.float %s\n", dstr);             \
1268    } while (0)
1269
1270 /* This is how to output an assembler line defining an `int' constant.  */
1271
1272 #define ASM_OUTPUT_INT(FILE, VALUE)             \
1273 ( fprintf (FILE, "\t.long "),                   \
1274   output_addr_const (FILE, (VALUE)),            \
1275   fprintf (FILE, "\n"))
1276
1277 /* Likewise for `char' and `short' constants.  */
1278
1279 #define ASM_OUTPUT_SHORT(FILE, VALUE)           \
1280 ( fprintf (FILE, "\t.hword "),                  \
1281   output_addr_const (FILE, (VALUE)),            \
1282   fprintf (FILE, "\n"))
1283
1284 #define ASM_OUTPUT_CHAR(FILE, VALUE)            \
1285 ( fprintf (FILE, "\t.byte "),                   \
1286   output_addr_const (FILE, (VALUE)),            \
1287   fprintf (FILE, "\n"))
1288
1289 /* This is how to output an assembler line for a numeric constant byte.  */
1290 #define ASM_OUTPUT_BYTE(FILE, VALUE)  \
1291   fprintf (FILE, "\t.byte 0x%x\n", (VALUE))
1292
1293 /* Define the parentheses used to group arithmetic operations
1294    in assembler code.  */
1295
1296 #define ASM_OPEN_PAREN "("
1297 #define ASM_CLOSE_PAREN ")"
1298
1299 /* This says how to output the assembler to define a global
1300    uninitialized but not common symbol.  */
1301
1302 #define ASM_OUTPUT_ALIGNED_BSS(FILE, DECL, NAME, SIZE, ALIGN) \
1303   asm_output_aligned_bss ((FILE), (DECL), (NAME), (SIZE), (ALIGN))
1304
1305 #undef  ASM_OUTPUT_ALIGNED_BSS 
1306 #define ASM_OUTPUT_ALIGNED_BSS(FILE, DECL, NAME, SIZE, ALIGN) \
1307   v850_output_aligned_bss (FILE, DECL, NAME, SIZE, ALIGN)
1308
1309 /* This says how to output the assembler to define a global
1310    uninitialized, common symbol. */
1311 #undef  ASM_OUTPUT_ALIGNED_COMMON
1312 #undef  ASM_OUTPUT_COMMON
1313 #define ASM_OUTPUT_ALIGNED_DECL_COMMON(FILE, DECL, NAME, SIZE, ALIGN) \
1314      v850_output_common (FILE, DECL, NAME, SIZE, ALIGN)
1315
1316 /* This says how to output the assembler to define a local
1317    uninitialized symbol. */
1318 #undef  ASM_OUTPUT_ALIGNED_LOCAL
1319 #undef  ASM_OUTPUT_LOCAL
1320 #define ASM_OUTPUT_ALIGNED_DECL_LOCAL(FILE, DECL, NAME, SIZE, ALIGN) \
1321      v850_output_local (FILE, DECL, NAME, SIZE, ALIGN)
1322      
1323 /* This is how to output the definition of a user-level label named NAME,
1324    such as the label on a static function or variable NAME.  */
1325
1326 #define ASM_OUTPUT_LABEL(FILE, NAME)    \
1327   do { assemble_name (FILE, NAME); fputs (":\n", FILE); } while (0)
1328
1329 /* This is how to output a command to make the user-level label named NAME
1330    defined for reference from other files.  */
1331
1332 #define ASM_GLOBALIZE_LABEL(FILE, NAME) \
1333   do { fputs ("\t.global ", FILE); assemble_name (FILE, NAME); fputs ("\n", FILE);} while (0)
1334
1335 /* This is how to output a reference to a user-level label named NAME.
1336    `assemble_name' uses this.  */
1337
1338 #undef ASM_OUTPUT_LABELREF
1339 #define ASM_OUTPUT_LABELREF(FILE, NAME)           \
1340   do {                                            \
1341   char* real_name;                                \
1342   STRIP_NAME_ENCODING (real_name, (NAME));        \
1343   fprintf (FILE, "_%s", real_name);               \
1344   } while (0)           
1345
1346 /* Store in OUTPUT a string (made with alloca) containing
1347    an assembler-name for a local static variable named NAME.
1348    LABELNO is an integer which is different for each call.  */
1349
1350 #define ASM_FORMAT_PRIVATE_NAME(OUTPUT, NAME, LABELNO)  \
1351 ( (OUTPUT) = (char *) alloca (strlen ((NAME)) + 10),    \
1352   sprintf ((OUTPUT), "%s___%d", (NAME), (LABELNO)))
1353
1354 /* This is how we tell the assembler that two symbols have the same value.  */
1355
1356 #define ASM_OUTPUT_DEF(FILE,NAME1,NAME2) \
1357   do { assemble_name(FILE, NAME1);       \
1358        fputs(" = ", FILE);               \
1359        assemble_name(FILE, NAME2);       \
1360        fputc('\n', FILE); } while (0)
1361
1362
1363 /* How to refer to registers in assembler output.
1364    This sequence is indexed by compiler's hard-register-number (see above).  */
1365
1366 #define REGISTER_NAMES                                                  \
1367 {  "r0",  "r1",  "r2",  "sp",  "gp",  "r5",  "r6" , "r7",               \
1368    "r8",  "r9", "r10", "r11", "r12", "r13", "r14", "r15",               \
1369   "r16", "r17", "r18", "r19", "r20", "r21", "r22", "r23",               \
1370   "r24", "r25", "r26", "r27", "r28", "r29",  "ep", "r31",               \
1371   ".fp", ".ap"}
1372
1373 #define ADDITIONAL_REGISTER_NAMES                                       \
1374 { { "zero",     0 },                                                    \
1375   { "hp",       2 },                                                    \
1376   { "r3",       3 },                                                    \
1377   { "r4",       4 },                                                    \
1378   { "tp",       5 },                                                    \
1379   { "fp",       29 },                                                   \
1380   { "r30",      30 },                                                   \
1381   { "lp",       31} }
1382
1383 /* Print an instruction operand X on file FILE.
1384    look in v850.c for details */
1385
1386 #define PRINT_OPERAND(FILE, X, CODE)  print_operand (FILE, X, CODE)
1387
1388 #define PRINT_OPERAND_PUNCT_VALID_P(CODE) \
1389   ((CODE) == '.')
1390
1391 /* Print a memory operand whose address is X, on file FILE.
1392    This uses a function in output-vax.c.  */
1393
1394 #define PRINT_OPERAND_ADDRESS(FILE, ADDR) print_operand_address (FILE, ADDR)
1395
1396 #define ASM_OUTPUT_REG_PUSH(FILE,REGNO)
1397 #define ASM_OUTPUT_REG_POP(FILE,REGNO)
1398
1399 /* This is how to output an element of a case-vector that is absolute.  */
1400
1401 #define ASM_OUTPUT_ADDR_VEC_ELT(FILE, VALUE) \
1402   asm_fprintf (FILE, "\t%s .L%d\n",                                     \
1403                (TARGET_BIG_SWITCH ? ".long" : ".short"), VALUE)
1404
1405 /* This is how to output an element of a case-vector that is relative.  */
1406
1407 #define ASM_OUTPUT_ADDR_DIFF_ELT(FILE, BODY, VALUE, REL) \
1408   fprintf (FILE, "\t%s .L%d-.L%d\n",                                    \
1409            (TARGET_BIG_SWITCH ? ".long" : ".short"),                    \
1410            VALUE, REL)
1411
1412 #define ASM_OUTPUT_ALIGN(FILE,LOG)      \
1413   if ((LOG) != 0)                       \
1414     fprintf (FILE, "\t.align %d\n", (LOG))
1415
1416 /* We don't have to worry about dbx compatibility for the v850.  */
1417 #define DEFAULT_GDB_EXTENSIONS 1
1418
1419 /* Use stabs debugging info by default.  */
1420 #undef PREFERRED_DEBUGGING_TYPE
1421 #define PREFERRED_DEBUGGING_TYPE DBX_DEBUG
1422
1423 #define DBX_REGISTER_NUMBER(REGNO) REGNO
1424
1425 /* Define to use software floating point emulator for REAL_ARITHMETIC and
1426    decimal <-> binary conversion. */
1427 #define REAL_ARITHMETIC
1428
1429 /* Specify the machine mode that this machine uses
1430    for the index in the tablejump instruction.  */
1431 #define CASE_VECTOR_MODE (TARGET_BIG_SWITCH ? SImode : HImode)
1432
1433 /* Define this if the case instruction drops through after the table
1434    when the index is out of range.  Don't define it if the case insn
1435    jumps to the default label instead.  */
1436 /* #define CASE_DROPS_THROUGH */
1437
1438 /* Define as C expression which evaluates to nonzero if the tablejump
1439    instruction expects the table to contain offsets from the address of the
1440    table.
1441    Do not define this if the table should contain absolute addresses. */
1442 #define CASE_VECTOR_PC_RELATIVE 1
1443
1444 /* The switch instruction requires that the jump table immediately follow
1445    it. */
1446 #define JUMP_TABLES_IN_TEXT_SECTION 1
1447
1448 /* svr4.h defines this assuming that 4 byte alignment is required.  */
1449 #undef ASM_OUTPUT_BEFORE_CASE_LABEL
1450 #define ASM_OUTPUT_BEFORE_CASE_LABEL(FILE,PREFIX,NUM,TABLE) \
1451   ASM_OUTPUT_ALIGN ((FILE), (TARGET_BIG_SWITCH ? 2 : 1));
1452
1453 #define WORD_REGISTER_OPERATIONS
1454
1455 /* Byte and short loads sign extend the value to a word.  */
1456 #define LOAD_EXTEND_OP(MODE) SIGN_EXTEND
1457
1458 /* Specify the tree operation to be used to convert reals to integers.  */
1459 #define IMPLICIT_FIX_EXPR FIX_ROUND_EXPR
1460
1461 /* This flag, if defined, says the same insns that convert to a signed fixnum
1462    also convert validly to an unsigned one.  */
1463 #define FIXUNS_TRUNC_LIKE_FIX_TRUNC
1464
1465 /* This is the kind of divide that is easiest to do in the general case.  */
1466 #define EASY_DIV_EXPR TRUNC_DIV_EXPR
1467
1468 /* Max number of bytes we can move from memory to memory
1469    in one reasonably fast instruction.  */
1470 #define MOVE_MAX        4
1471
1472 /* Define if shifts truncate the shift count
1473    which implies one can omit a sign-extension or zero-extension
1474    of a shift count.  */
1475 #define SHIFT_COUNT_TRUNCATED 1
1476
1477 /* Value is 1 if truncating an integer of INPREC bits to OUTPREC bits
1478    is done just by pretending it is already truncated.  */
1479 #define TRULY_NOOP_TRUNCATION(OUTPREC, INPREC) 1
1480
1481 #define STORE_FLAG_VALUE 1
1482
1483 /* Specify the machine mode that pointers have.
1484    After generation of rtl, the compiler makes no further distinction
1485    between pointers and any other objects of this machine mode.  */
1486 #define Pmode SImode
1487
1488 /* A function address in a call instruction
1489    is a byte address (for indexing purposes)
1490    so give the MEM rtx a byte's mode.  */
1491 #define FUNCTION_MODE QImode
1492
1493 /* A C expression whose value is nonzero if IDENTIFIER with arguments ARGS
1494    is a valid machine specific attribute for DECL.
1495    The attributes in ATTRIBUTES have previously been assigned to DECL.  */
1496 #define VALID_MACHINE_DECL_ATTRIBUTE(DECL, ATTRIBUTES, IDENTIFIER, ARGS) \
1497   v850_valid_machine_decl_attribute (DECL, IDENTIFIER, ARGS)
1498
1499 /* A C statement that assigns default attributes to a newly created DECL.  */
1500 #define SET_DEFAULT_DECL_ATTRIBUTES(decl, attr) \
1501      v850_set_default_decl_attr (decl)
1502
1503 /* Tell compiler we want to support GHS pragmas */
1504 #define HANDLE_PRAGMA(get, unget, name) v850_handle_pragma (get, unget, name)
1505
1506 enum v850_pragma_state
1507 {
1508   V850_PS_START,
1509   V850_PS_SHOULD_BE_DONE,
1510   V850_PS_BAD,
1511   V850_PS_MAYBE_SECTION_NAME,
1512   V850_PS_EXPECTING_EQUALS,
1513   V850_PS_EXPECTING_SECTION_ALIAS,
1514   V850_PS_MAYBE_COMMA
1515 };
1516
1517 enum v850_pragma_type
1518 {
1519   V850_PT_UNKNOWN,
1520   V850_PT_INTERRUPT,
1521   V850_PT_SECTION,
1522   V850_PT_START_SECTION,
1523   V850_PT_END_SECTION
1524 };
1525
1526 /* enum GHS_SECTION_KIND is an enumeration of the kinds of sections that
1527    can appear in the "ghs section" pragma.  These names are used to index
1528    into the GHS_default_section_names[] and GHS_current_section_names[]
1529    that are defined in v850.c, and so the ordering of each must remain
1530    consistant. 
1531
1532    These arrays give the default and current names for each kind of 
1533    section defined by the GHS pragmas.  The current names can be changed
1534    by the "ghs section" pragma.  If the current names are null, use 
1535    the default names.  Note that the two arrays have different types.
1536
1537    For the *normal* section kinds (like .data, .text, etc.) we do not
1538    want to explicitly force the name of these sections, but would rather
1539    let the linker (or at least the back end) choose the name of the 
1540    section, UNLESS the user has force a specific name for these section
1541    kinds.  To accomplish this set the name in ghs_default_section_names
1542    to null.  */
1543
1544 enum GHS_section_kind
1545
1546   GHS_SECTION_KIND_DEFAULT,
1547
1548   GHS_SECTION_KIND_TEXT,
1549   GHS_SECTION_KIND_DATA, 
1550   GHS_SECTION_KIND_RODATA,
1551   GHS_SECTION_KIND_BSS,
1552   GHS_SECTION_KIND_SDATA,
1553   GHS_SECTION_KIND_ROSDATA,
1554   GHS_SECTION_KIND_TDATA,
1555   GHS_SECTION_KIND_ZDATA,
1556   GHS_SECTION_KIND_ROZDATA,
1557
1558   COUNT_OF_GHS_SECTION_KINDS  /* must be last */
1559 };
1560
1561 /* The assembler op to start the file.  */
1562
1563 #define FILE_ASM_OP "\t.file\n"
1564
1565 /* Enable the register move pass to improve code.  */
1566 #define ENABLE_REGMOVE_PASS
1567
1568
1569 /* Implement ZDA, TDA, and SDA */
1570
1571 #define EP_REGNUM 30    /* ep register number */
1572
1573 #define ENCODE_SECTION_INFO(DECL)                                       \
1574 do {                                                                    \
1575   if ((TREE_STATIC (DECL) || DECL_EXTERNAL (DECL))                      \
1576       && TREE_CODE (DECL) == VAR_DECL)                                  \
1577     v850_encode_data_area (DECL);                                       \
1578 } while (0)
1579
1580 #define ZDA_NAME_FLAG_CHAR '@'
1581 #define TDA_NAME_FLAG_CHAR '%'
1582 #define SDA_NAME_FLAG_CHAR '&'
1583
1584 #define ZDA_NAME_P(NAME) (*(NAME) == ZDA_NAME_FLAG_CHAR)
1585 #define TDA_NAME_P(NAME) (*(NAME) == TDA_NAME_FLAG_CHAR)
1586 #define SDA_NAME_P(NAME) (*(NAME) == SDA_NAME_FLAG_CHAR)
1587
1588 #define ENCODED_NAME_P(SYMBOL_NAME)    \
1589   (ZDA_NAME_P (SYMBOL_NAME)            \
1590    || TDA_NAME_P (SYMBOL_NAME)         \
1591    || SDA_NAME_P (SYMBOL_NAME))
1592
1593 #define STRIP_NAME_ENCODING(VAR,SYMBOL_NAME) \
1594      (VAR) = (SYMBOL_NAME) + (ENCODED_NAME_P (SYMBOL_NAME) || *(SYMBOL_NAME) == '*')
1595
1596 /* Define this if you have defined special-purpose predicates in the
1597    file `MACHINE.c'.  This macro is called within an initializer of an
1598    array of structures.  The first field in the structure is the name
1599    of a predicate and the second field is an array of rtl codes.  For
1600    each predicate, list all rtl codes that can be in expressions
1601    matched by the predicate.  The list should have a trailing comma.  */
1602
1603 #define PREDICATE_CODES                                                 \
1604 { "ep_memory_operand",          { MEM }},                               \
1605 { "reg_or_0_operand",           { REG, SUBREG, CONST_INT, CONST_DOUBLE }}, \
1606 { "reg_or_int5_operand",        { REG, SUBREG, CONST_INT }},            \
1607 { "call_address_operand",       { REG, SYMBOL_REF }},                   \
1608 { "movsi_source_operand",       { LABEL_REF, SYMBOL_REF, CONST_INT,     \
1609                                   CONST_DOUBLE, CONST, HIGH, MEM,       \
1610                                   REG, SUBREG }},                       \
1611 { "special_symbolref_operand",  { SYMBOL_REF }},                        \
1612 { "power_of_two_operand",       { CONST_INT }},                         \
1613 { "pattern_is_ok_for_prologue", { PARALLEL }},                          \
1614 { "pattern_is_ok_for_epilogue", { PARALLEL }},                          \
1615 { "register_is_ok_for_epilogue",{ REG }},                               \
1616 { "not_power_of_two_operand",   { CONST_INT }},
1617
1618   /* Note, due to dependency and search path conflicts, prototypes
1619      involving the FILE, rtx or tree types cannot be included here.
1620      They are included at the start of v850.c  */
1621   
1622 extern void   asm_file_start                ();
1623 extern void   print_operand                 ();
1624 extern void   print_operand_address         ();
1625 extern int    function_arg_partial_nregs    ();
1626 extern int    const_costs                   ();
1627 extern char * output_move_double            ();
1628 extern char * output_move_single            ();
1629 extern int    ep_memory_operand             ();
1630 extern int    reg_or_0_operand              ();
1631 extern int    reg_or_int5_operand           ();
1632 extern int    call_address_operand          ();
1633 extern int    movsi_source_operand          ();
1634 extern int    power_of_two_operand          ();
1635 extern int    not_power_of_two_operand      ();
1636 extern int    special_symbolref_operand     ();
1637 extern void   v850_reorg                    ();
1638 extern void   notice_update_cc              ();
1639 extern int    v850_valid_machine_decl_attribute ();
1640 extern int    v850_interrupt_function_p     ();
1641 extern int    pattern_is_ok_for_prologue    ();
1642 extern int    pattern_is_ok_for_epilogue    ();
1643 extern int    register_is_ok_for_epilogue   ();
1644 extern char * construct_save_jarl           ();
1645 extern char * construct_restore_jr          ();
1646
1647 extern void   override_options              PROTO ((void));
1648 extern int    compute_register_save_size    PROTO ((long *));
1649 extern int    compute_frame_size            PROTO ((int, long *));
1650 extern void   expand_prologue               PROTO ((void));
1651 extern void   expand_epilogue               PROTO ((void));
1652
1653 extern void   v850_output_aligned_bss       ();
1654 extern void   v850_output_common            ();
1655 extern void   v850_output_local             ();
1656 extern void   sdata_section                 PROTO ((void));
1657 extern void   rosdata_section               PROTO ((void));
1658 extern void   sbss_section                  PROTO ((void));
1659 extern void   tdata_section                 PROTO ((void));
1660 extern void   zdata_section                 PROTO ((void));
1661 extern void   rozdata_section               PROTO ((void));
1662 extern void   zbss_section                  PROTO ((void));
1663 extern int    v850_handle_pragma            PROTO ((int (*)(void), void (*)(int), char *));
1664 extern void   v850_encode_data_area         ();
1665 extern void   v850_set_default_decl_attr    ();
1666 extern v850_data_area v850_get_data_area    ();