OSDN Git Service

* config/arc/arc.c (arc_cpu_string): Make static. Default to "base"
[pf3gnuchains/gcc-fork.git] / gcc / config / arc / arc.h
1 /* Definitions of target machine for GNU compiler, Argonaut ARC cpu.
2    Copyright (C) 1994, 1995, 1997, 1998, 1999, 2000, 2001, 2002, 2004
3    Free Software Foundation, Inc.
4
5 This file is part of GCC.
6
7 GCC 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 GCC 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 GCC; 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 /* ??? This is an old port, and is undoubtedly suffering from bit rot.  */
23
24 /* Things to do:
25
26    - PREDICATE_CODES
27    - incscc, decscc?
28    - print active compiler options in assembler output
29 */
30
31
32 #undef ASM_SPEC
33 #undef LINK_SPEC
34 #undef STARTFILE_SPEC
35 #undef ENDFILE_SPEC
36 #undef SIZE_TYPE
37 #undef PTRDIFF_TYPE
38 #undef WCHAR_TYPE
39 #undef WCHAR_TYPE_SIZE
40 #undef ASM_OUTPUT_LABELREF
41 \f
42 /* Print subsidiary information on the compiler version in use.  */
43 #define TARGET_VERSION fprintf (stderr, " (arc)")
44
45 /* Names to predefine in the preprocessor for this target machine.  */
46 #define TARGET_CPU_CPP_BUILTINS()               \
47   do                                            \
48     {                                           \
49         builtin_define ("__arc__");             \
50         if (TARGET_BIG_ENDIAN)                  \
51           builtin_define ("__big_endian__");    \
52         if (arc_cpu_type == 0)                  \
53           builtin_define ("__base__");          \
54         builtin_assert ("cpu=arc");             \
55         builtin_assert ("machine=arc");         \
56     } while (0)
57
58 /* Pass -mmangle-cpu if we get -mcpu=*.
59    Doing it this way lets one have it on as default with -mcpu=*,
60    but also lets one turn it off with -mno-mangle-cpu.  */
61 #define CC1_SPEC "\
62 %{mcpu=*:-mmangle-cpu} \
63 %{EB:%{EL:%emay not use both -EB and -EL}} \
64 %{EB:-mbig-endian} %{EL:-mlittle-endian} \
65 "
66
67 #define ASM_SPEC "%{v} %{EB} %{EL}"
68
69 #define LINK_SPEC "%{v} %{EB} %{EL}"
70
71 #define STARTFILE_SPEC "%{!shared:crt0.o%s} crtinit.o%s"
72
73 #define ENDFILE_SPEC "crtfini.o%s"
74 \f
75 /* Instruction set characteristics.
76    These are internal macros, set by the appropriate -mcpu= option.  */
77
78 /* Nonzero means the cpu has a barrel shifter.  */
79 #define TARGET_SHIFTER 0
80
81 /* Which cpu we're compiling for.  */
82 extern int arc_cpu_type;
83
84 /* Check if CPU is an extension and set `arc_cpu_type' and `arc_mangle_cpu'
85    appropriately.  The result should be nonzero if the cpu is recognized,
86    otherwise zero.  This is intended to be redefined in a cover file.
87    This is used by arc_init.  */
88 #define ARC_EXTENSION_CPU(cpu) 0
89
90 /* Sometimes certain combinations of command options do not make
91    sense on a particular target machine.  You can define a macro
92    `OVERRIDE_OPTIONS' to take account of this.  This macro, if
93    defined, is executed once just after all the command options have
94    been parsed.
95
96    Don't use this macro to turn on various extra optimizations for
97    `-O'.  That is what `OPTIMIZATION_OPTIONS' is for.  */
98
99
100 #define OVERRIDE_OPTIONS \
101 do {                            \
102   /* These need to be done at start up.  It's convenient to do them here.  */ \
103   arc_init ();                  \
104 } while (0)
105 \f
106 /* Target machine storage layout.  */
107
108 /* Define this if most significant bit is lowest numbered
109    in instructions that operate on numbered bit-fields.  */
110 #define BITS_BIG_ENDIAN 1
111
112 /* Define this if most significant byte of a word is the lowest numbered.  */
113 #define BYTES_BIG_ENDIAN (TARGET_BIG_ENDIAN)
114
115 /* Define this if most significant word of a multiword number is the lowest
116    numbered.  */
117 #define WORDS_BIG_ENDIAN (TARGET_BIG_ENDIAN)
118
119 /* Define this to set the endianness to use in libgcc2.c, which can
120    not depend on target_flags.  */
121 #ifdef __big_endian__
122 #define LIBGCC2_WORDS_BIG_ENDIAN 1
123 #else
124 #define LIBGCC2_WORDS_BIG_ENDIAN 0
125 #endif
126
127 /* Width of a word, in units (bytes).  */
128 #define UNITS_PER_WORD 4
129
130 /* Define this macro if it is advisable to hold scalars in registers
131    in a wider mode than that declared by the program.  In such cases, 
132    the value is constrained to be within the bounds of the declared
133    type, but kept valid in the wider mode.  The signedness of the
134    extension may differ from that of the type.  */
135 #define PROMOTE_MODE(MODE,UNSIGNEDP,TYPE) \
136 if (GET_MODE_CLASS (MODE) == MODE_INT           \
137     && GET_MODE_SIZE (MODE) < UNITS_PER_WORD)   \
138 {                                               \
139   (MODE) = SImode;                              \
140 }
141
142 /* Allocation boundary (in *bits*) for storing arguments in argument list.  */
143 #define PARM_BOUNDARY 32
144
145 /* Boundary (in *bits*) on which stack pointer should be aligned.  */
146 #define STACK_BOUNDARY 64
147
148 /* ALIGN FRAMES on word boundaries */
149 #define ARC_STACK_ALIGN(LOC) (((LOC)+7) & ~7)
150
151 /* Allocation boundary (in *bits*) for the code of a function.  */
152 #define FUNCTION_BOUNDARY 32
153
154 /* Alignment of field after `int : 0' in a structure.  */
155 #define EMPTY_FIELD_BOUNDARY 32
156
157 /* Every structure's size must be a multiple of this.  */
158 #define STRUCTURE_SIZE_BOUNDARY 8
159
160 /* A bit-field declared as `int' forces `int' alignment for the struct.  */
161 #define PCC_BITFIELD_TYPE_MATTERS 1
162
163 /* No data type wants to be aligned rounder than this.  */
164 /* This is bigger than currently necessary for the ARC.  If 8 byte floats are
165    ever added it's not clear whether they'll need such alignment or not.  For
166    now we assume they will.  We can always relax it if necessary but the
167    reverse isn't true.  */
168 #define BIGGEST_ALIGNMENT 64
169
170 /* The best alignment to use in cases where we have a choice.  */
171 #define FASTEST_ALIGNMENT 32
172
173 /* Make strings word-aligned so strcpy from constants will be faster.  */
174 #define CONSTANT_ALIGNMENT(EXP, ALIGN)  \
175   ((TREE_CODE (EXP) == STRING_CST       \
176     && (ALIGN) < FASTEST_ALIGNMENT)     \
177    ? FASTEST_ALIGNMENT : (ALIGN))
178
179 /* Make arrays of chars word-aligned for the same reasons.  */
180 #define DATA_ALIGNMENT(TYPE, ALIGN)             \
181   (TREE_CODE (TYPE) == ARRAY_TYPE               \
182    && TYPE_MODE (TREE_TYPE (TYPE)) == QImode    \
183    && (ALIGN) < FASTEST_ALIGNMENT ? FASTEST_ALIGNMENT : (ALIGN))
184
185 /* Set this nonzero if move instructions will actually fail to work
186    when given unaligned data.  */
187 /* On the ARC the lower address bits are masked to 0 as necessary.  The chip
188    won't croak when given an unaligned address, but the insn will still fail
189    to produce the correct result.  */
190 #define STRICT_ALIGNMENT 1
191 \f
192 /* Layout of source language data types.  */
193
194 #define SHORT_TYPE_SIZE         16
195 #define INT_TYPE_SIZE           32
196 #define LONG_TYPE_SIZE          32
197 #define LONG_LONG_TYPE_SIZE     64
198 #define FLOAT_TYPE_SIZE         32
199 #define DOUBLE_TYPE_SIZE        64
200 #define LONG_DOUBLE_TYPE_SIZE   64
201
202 /* Define this as 1 if `char' should by default be signed; else as 0.  */
203 #define DEFAULT_SIGNED_CHAR 1
204
205 #define SIZE_TYPE "long unsigned int"
206 #define PTRDIFF_TYPE "long int"
207 #define WCHAR_TYPE "short unsigned int"
208 #define WCHAR_TYPE_SIZE 16
209 \f
210 /* Standard register usage.  */
211
212 /* Number of actual hardware registers.
213    The hardware registers are assigned numbers for the compiler
214    from 0 to just below FIRST_PSEUDO_REGISTER.
215    All registers that the compiler knows about must be given numbers,
216    even those that are not normally considered general registers.  */
217 /* Registers 61, 62, and 63 are not really registers and we needn't treat
218    them as such.  We still need a register for the condition code.  */
219 #define FIRST_PSEUDO_REGISTER 62
220
221 /* 1 for registers that have pervasive standard uses
222    and are not available for the register allocator.
223
224    0-28  - general purpose registers
225    29    - ilink1 (interrupt link register)
226    30    - ilink2 (interrupt link register)
227    31    - blink (branch link register)
228    32-59 - reserved for extensions
229    60    - LP_COUNT
230    61    - condition code
231
232    For doc purposes:
233    61    - short immediate data indicator (setting flags)
234    62    - long immediate data indicator
235    63    - short immediate data indicator (not setting flags).
236
237    The general purpose registers are further broken down into:
238    0-7   - arguments/results
239    8-15  - call used
240    16-23 - call saved
241    24    - call used, static chain pointer
242    25    - call used, gptmp
243    26    - global pointer
244    27    - frame pointer
245    28    - stack pointer
246
247    By default, the extension registers are not available.  */
248
249 #define FIXED_REGISTERS \
250 { 0, 0, 0, 0, 0, 0, 0, 0,       \
251   0, 0, 0, 0, 0, 0, 0, 0,       \
252   0, 0, 0, 0, 0, 0, 0, 0,       \
253   0, 0, 0, 1, 1, 1, 1, 0,       \
254                                 \
255   1, 1, 1, 1, 1, 1, 1, 1,       \
256   1, 1, 1, 1, 1, 1, 1, 1,       \
257   1, 1, 1, 1, 1, 1, 1, 1,       \
258   1, 1, 1, 1, 1, 1 }
259
260 /* 1 for registers not available across function calls.
261    These must include the FIXED_REGISTERS and also any
262    registers that can be used without being saved.
263    The latter must include the registers where values are returned
264    and the register where structure-value addresses are passed.
265    Aside from that, you can include as many other registers as you like.  */
266
267 #define CALL_USED_REGISTERS \
268 { 1, 1, 1, 1, 1, 1, 1, 1,       \
269   1, 1, 1, 1, 1, 1, 1, 1,       \
270   0, 0, 0, 0, 0, 0, 0, 0,       \
271   1, 1, 1, 1, 1, 1, 1, 1,       \
272                                 \
273   1, 1, 1, 1, 1, 1, 1, 1,       \
274   1, 1, 1, 1, 1, 1, 1, 1,       \
275   1, 1, 1, 1, 1, 1, 1, 1,       \
276   1, 1, 1, 1, 1, 1 }
277
278 /* If defined, an initializer for a vector of integers, containing the
279    numbers of hard registers in the order in which GCC should
280    prefer to use them (from most preferred to least).  */
281 #define REG_ALLOC_ORDER \
282 { 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 0, 1,                 \
283   16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 31,                       \
284   32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47,       \
285   48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61,               \
286   27, 28, 29, 30 }
287
288 /* Macro to conditionally modify fixed_regs/call_used_regs.  */
289 #define CONDITIONAL_REGISTER_USAGE                      \
290 do {                                                    \
291   if (PIC_OFFSET_TABLE_REGNUM != INVALID_REGNUM)        \
292     {                                                   \
293       fixed_regs[PIC_OFFSET_TABLE_REGNUM] = 1;          \
294       call_used_regs[PIC_OFFSET_TABLE_REGNUM] = 1;      \
295     }                                                   \
296 } while (0)
297
298 /* Return number of consecutive hard regs needed starting at reg REGNO
299    to hold something of mode MODE.
300    This is ordinarily the length in words of a value of mode MODE
301    but can be less for certain modes in special long registers.  */
302 #define HARD_REGNO_NREGS(REGNO, MODE) \
303 ((GET_MODE_SIZE (MODE) + UNITS_PER_WORD - 1) / UNITS_PER_WORD)
304
305 /* Value is 1 if hard register REGNO can hold a value of machine-mode MODE.  */
306 extern const unsigned int arc_hard_regno_mode_ok[];
307 extern unsigned int arc_mode_class[];
308 #define HARD_REGNO_MODE_OK(REGNO, MODE) \
309 ((arc_hard_regno_mode_ok[REGNO] & arc_mode_class[MODE]) != 0)
310
311 /* A C expression that is nonzero if it is desirable to choose
312    register allocation so as to avoid move instructions between a
313    value of mode MODE1 and a value of mode MODE2.
314
315    If `HARD_REGNO_MODE_OK (R, MODE1)' and `HARD_REGNO_MODE_OK (R,
316    MODE2)' are ever different for any R, then `MODES_TIEABLE_P (MODE1,
317    MODE2)' must be zero.  */
318
319 /* Tie QI/HI/SI modes together.  */
320 #define MODES_TIEABLE_P(MODE1, MODE2) \
321 (GET_MODE_CLASS (MODE1) == MODE_INT             \
322  && GET_MODE_CLASS (MODE2) == MODE_INT          \
323  && GET_MODE_SIZE (MODE1) <= UNITS_PER_WORD     \
324  && GET_MODE_SIZE (MODE2) <= UNITS_PER_WORD)
325 \f
326 /* Register classes and constants.  */
327
328 /* Define the classes of registers for register constraints in the
329    machine description.  Also define ranges of constants.
330
331    One of the classes must always be named ALL_REGS and include all hard regs.
332    If there is more than one class, another class must be named NO_REGS
333    and contain no registers.
334
335    The name GENERAL_REGS must be the name of a class (or an alias for
336    another name such as ALL_REGS).  This is the class of registers
337    that is allowed by "g" or "r" in a register constraint.
338    Also, registers outside this class are allocated only when
339    instructions express preferences for them.
340
341    The classes must be numbered in nondecreasing order; that is,
342    a larger-numbered class must never be contained completely
343    in a smaller-numbered class.
344
345    For any two classes, it is very desirable that there be another
346    class that represents their union.
347
348    It is important that any condition codes have class NO_REGS.
349    See `register_operand'.  */
350
351 enum reg_class {
352   NO_REGS, LPCOUNT_REG, GENERAL_REGS, ALL_REGS, LIM_REG_CLASSES
353 };
354
355 #define N_REG_CLASSES (int) LIM_REG_CLASSES
356
357 /* Give names of register classes as strings for dump file.  */
358 #define REG_CLASS_NAMES \
359 { "NO_REGS", "LPCOUNT_REG", "GENERAL_REGS", "ALL_REGS" }
360
361 /* Define which registers fit in which classes.
362    This is an initializer for a vector of HARD_REG_SET
363    of length N_REG_CLASSES.  */
364
365 #define REG_CLASS_CONTENTS \
366 { {0, 0}, {0, 0x10000000}, {0xffffffff, 0xfffffff}, \
367   {0xffffffff, 0x1fffffff} }
368
369 /* The same information, inverted:
370    Return the class number of the smallest class containing
371    reg number REGNO.  This could be a conditional expression
372    or could index an array.  */
373 extern enum reg_class arc_regno_reg_class[FIRST_PSEUDO_REGISTER];
374 #define REGNO_REG_CLASS(REGNO) \
375 (arc_regno_reg_class[REGNO])
376
377 /* The class value for index registers, and the one for base regs.  */
378 #define INDEX_REG_CLASS GENERAL_REGS
379 #define BASE_REG_CLASS GENERAL_REGS
380
381 /* Get reg_class from a letter such as appears in the machine description.  */
382 #define REG_CLASS_FROM_LETTER(C) \
383 ((C) == 'l' ? LPCOUNT_REG /* ??? needed? */ \
384  : NO_REGS)
385
386 /* These assume that REGNO is a hard or pseudo reg number.
387    They give nonzero only if REGNO is a hard reg of the suitable class
388    or a pseudo reg currently allocated to a suitable hard reg.
389    Since they use reg_renumber, they are safe only once reg_renumber
390    has been allocated, which happens in local-alloc.c.  */
391 #define REGNO_OK_FOR_BASE_P(REGNO) \
392 ((REGNO) < 32 || (unsigned) reg_renumber[REGNO] < 32)
393 #define REGNO_OK_FOR_INDEX_P(REGNO) \
394 ((REGNO) < 32 || (unsigned) reg_renumber[REGNO] < 32)
395
396 /* Given an rtx X being reloaded into a reg required to be
397    in class CLASS, return the class of reg to actually use.
398    In general this is just CLASS; but on some machines
399    in some cases it is preferable to use a more restrictive class.  */
400 #define PREFERRED_RELOAD_CLASS(X,CLASS) \
401 (CLASS)
402
403 /* Return the maximum number of consecutive registers
404    needed to represent mode MODE in a register of class CLASS.  */
405 #define CLASS_MAX_NREGS(CLASS, MODE) \
406 ((GET_MODE_SIZE (MODE) + UNITS_PER_WORD - 1) / UNITS_PER_WORD)
407
408 /* The letters I, J, K, L, M, N, O, P in a register constraint string
409    can be used to stand for particular ranges of immediate operands.
410    This macro defines what the ranges are.
411    C is the letter, and VALUE is a constant value.
412    Return 1 if VALUE is in the range specified by C.  */
413 /* 'I' is used for short immediates (always signed).
414    'J' is used for long immediates.
415    'K' is used for any constant up to 64 bits (for 64x32 situations?).  */
416
417 /* local to this file */
418 #define SMALL_INT(X) ((unsigned) ((X) + 0x100) < 0x200)
419 /* local to this file */
420 #define LARGE_INT(X) \
421 ((X) >= (-(HOST_WIDE_INT) 0x7fffffff - 1) \
422  && (unsigned HOST_WIDE_INT)(X) <= (unsigned HOST_WIDE_INT) 0xffffffff)
423
424 #define CONST_OK_FOR_LETTER_P(VALUE, C) \
425 ((C) == 'I' ? SMALL_INT (VALUE)         \
426  : (C) == 'J' ? LARGE_INT (VALUE)       \
427  : (C) == 'K' ? 1                       \
428  : 0)
429
430 /* Similar, but for floating constants, and defining letters G and H.
431    Here VALUE is the CONST_DOUBLE rtx itself.  */
432 /* 'G' is used for integer values for the multiplication insns where the
433    operands are extended from 4 bytes to 8 bytes.
434    'H' is used when any 64 bit constant is allowed.  */
435 #define CONST_DOUBLE_OK_FOR_LETTER_P(VALUE, C) \
436 ((C) == 'G' ? arc_double_limm_p (VALUE) \
437  : (C) == 'H' ? 1 \
438  : 0)
439
440 /* A C expression that defines the optional machine-dependent constraint
441    letters that can be used to segregate specific types of operands,
442    usually memory references, for the target machine.  It should return 1 if
443    VALUE corresponds to the operand type represented by the constraint letter
444    C.  If C is not defined as an extra constraint, the value returned should
445    be 0 regardless of VALUE.  */
446 /* ??? This currently isn't used.  Waiting for PIC.  */
447 #if 0
448 #define EXTRA_CONSTRAINT(VALUE, C) \
449 ((C) == 'R' ? (SYMBOL_REF_FUNCTION_P (VALUE) || GET_CODE (VALUE) == LABEL_REF) \
450  : 0)
451 #endif
452 \f
453 /* Stack layout and stack pointer usage.  */
454
455 /* Define this macro if pushing a word onto the stack moves the stack
456    pointer to a smaller address.  */
457 #define STACK_GROWS_DOWNWARD
458
459 /* Define this if the nominal address of the stack frame
460    is at the high-address end of the local variables;
461    that is, each additional local variable allocated
462    goes at a more negative offset in the frame.  */
463 #define FRAME_GROWS_DOWNWARD
464
465 /* Offset within stack frame to start allocating local variables at.
466    If FRAME_GROWS_DOWNWARD, this is the offset to the END of the
467    first local allocated.  Otherwise, it is the offset to the BEGINNING
468    of the first local allocated.  */
469 #define STARTING_FRAME_OFFSET 0
470
471 /* Offset from the stack pointer register to the first location at which
472    outgoing arguments are placed.  */
473 #define STACK_POINTER_OFFSET FIRST_PARM_OFFSET (0)
474
475 /* Offset of first parameter from the argument pointer register value.  */
476 /* 4 bytes for each of previous fp, return address, and previous gp.
477    4 byte reserved area for future considerations.  */
478 #define FIRST_PARM_OFFSET(FNDECL) 16
479
480 /* A C expression whose value is RTL representing the address in a
481    stack frame where the pointer to the caller's frame is stored.
482    Assume that FRAMEADDR is an RTL expression for the address of the
483    stack frame itself.
484
485    If you don't define this macro, the default is to return the value
486    of FRAMEADDR--that is, the stack frame address is also the address
487    of the stack word that points to the previous frame.  */
488 /* ??? unfinished */
489 /*define DYNAMIC_CHAIN_ADDRESS (FRAMEADDR)*/
490
491 /* A C expression whose value is RTL representing the value of the
492    return address for the frame COUNT steps up from the current frame.
493    FRAMEADDR is the frame pointer of the COUNT frame, or the frame
494    pointer of the COUNT - 1 frame if `RETURN_ADDR_IN_PREVIOUS_FRAME'
495    is defined.  */
496 /* The current return address is in r31.  The return address of anything
497    farther back is at [%fp,4].  */
498 #if 0 /* The default value should work.  */
499 #define RETURN_ADDR_RTX(COUNT, FRAME) \
500 (((COUNT) == -1)                                                        \
501  ? gen_rtx_REG (Pmode, 31)                                              \
502  : copy_to_reg (gen_rtx_MEM (Pmode,                                     \
503                              memory_address (Pmode,                     \
504                                              plus_constant ((FRAME),    \
505                                                             UNITS_PER_WORD)))))
506 #endif
507
508 /* Register to use for pushing function arguments.  */
509 #define STACK_POINTER_REGNUM 28
510
511 /* Base register for access to local variables of the function.  */
512 #define FRAME_POINTER_REGNUM 27
513
514 /* Base register for access to arguments of the function.  */
515 #define ARG_POINTER_REGNUM FRAME_POINTER_REGNUM
516
517 /* Register in which static-chain is passed to a function.  This must
518    not be a register used by the prologue.  */
519 #define STATIC_CHAIN_REGNUM 24
520
521 /* A C expression which is nonzero if a function must have and use a
522    frame pointer.  This expression is evaluated in the reload pass.
523    If its value is nonzero the function will have a frame pointer.  */
524 #define FRAME_POINTER_REQUIRED \
525 (current_function_calls_alloca)
526
527 /* C statement to store the difference between the frame pointer
528    and the stack pointer values immediately after the function prologue.  */
529 #define INITIAL_FRAME_POINTER_OFFSET(VAR) \
530 ((VAR) = arc_compute_frame_size (get_frame_size ()))
531 \f
532 /* Function argument passing.  */
533
534 /* If defined, the maximum amount of space required for outgoing
535    arguments will be computed and placed into the variable
536    `current_function_outgoing_args_size'.  No space will be pushed
537    onto the stack for each call; instead, the function prologue should
538    increase the stack frame size by this amount.  */
539 #define ACCUMULATE_OUTGOING_ARGS 1
540
541 /* Value is the number of bytes of arguments automatically
542    popped when returning from a subroutine call.
543    FUNDECL is the declaration node of the function (as a tree),
544    FUNTYPE is the data type of the function (as a tree),
545    or for a library call it is an identifier node for the subroutine name.
546    SIZE is the number of bytes of arguments passed on the stack.  */
547 #define RETURN_POPS_ARGS(DECL, FUNTYPE, SIZE) 0
548
549 /* Define a data type for recording info about an argument list
550    during the scan of that argument list.  This data type should
551    hold all necessary information about the function itself
552    and about the args processed so far, enough to enable macros
553    such as FUNCTION_ARG to determine where the next arg should go.  */
554 #define CUMULATIVE_ARGS int
555
556 /* Initialize a variable CUM of type CUMULATIVE_ARGS
557    for a call to a function whose data type is FNTYPE.
558    For a library call, FNTYPE is 0.  */
559 #define INIT_CUMULATIVE_ARGS(CUM, FNTYPE, LIBNAME, INDIRECT, N_NAMED_ARGS) \
560 ((CUM) = 0)
561
562 /* The number of registers used for parameter passing.  Local to this file.  */
563 #define MAX_ARC_PARM_REGS 8
564
565 /* 1 if N is a possible register number for function argument passing.  */
566 #define FUNCTION_ARG_REGNO_P(N) \
567 ((unsigned) (N) < MAX_ARC_PARM_REGS)
568
569 /* The ROUND_ADVANCE* macros are local to this file.  */
570 /* Round SIZE up to a word boundary.  */
571 #define ROUND_ADVANCE(SIZE) \
572 (((SIZE) + UNITS_PER_WORD - 1) / UNITS_PER_WORD)
573
574 /* Round arg MODE/TYPE up to the next word boundary.  */
575 #define ROUND_ADVANCE_ARG(MODE, TYPE) \
576 ((MODE) == BLKmode                              \
577  ? ROUND_ADVANCE (int_size_in_bytes (TYPE))     \
578  : ROUND_ADVANCE (GET_MODE_SIZE (MODE)))
579
580 /* Round CUM up to the necessary point for argument MODE/TYPE.  */
581 #define ROUND_ADVANCE_CUM(CUM, MODE, TYPE) \
582 ((((MODE) == BLKmode ? TYPE_ALIGN (TYPE) : GET_MODE_BITSIZE (MODE)) \
583   > BITS_PER_WORD)      \
584  ? (((CUM) + 1) & ~1)   \
585  : (CUM))
586
587 /* Return boolean indicating arg of type TYPE and mode MODE will be passed in
588    a reg.  This includes arguments that have to be passed by reference as the
589    pointer to them is passed in a reg if one is available (and that is what
590    we're given).
591    This macro is only used in this file.  */
592 #define PASS_IN_REG_P(CUM, MODE, TYPE) \
593 ((CUM) < MAX_ARC_PARM_REGS                                              \
594  && ((ROUND_ADVANCE_CUM ((CUM), (MODE), (TYPE))                         \
595       + ROUND_ADVANCE_ARG ((MODE), (TYPE))                              \
596       <= MAX_ARC_PARM_REGS)))
597
598 /* Determine where to put an argument to a function.
599    Value is zero to push the argument on the stack,
600    or a hard register in which to store the argument.
601
602    MODE is the argument's machine mode.
603    TYPE is the data type of the argument (as a tree).
604     This is null for libcalls where that information may
605     not be available.
606    CUM is a variable of type CUMULATIVE_ARGS which gives info about
607     the preceding args and about the function being called.
608    NAMED is nonzero if this argument is a named parameter
609     (otherwise it is an extra parameter matching an ellipsis).  */
610 /* On the ARC the first MAX_ARC_PARM_REGS args are normally in registers
611    and the rest are pushed.  */
612 #define FUNCTION_ARG(CUM, MODE, TYPE, NAMED) \
613 (PASS_IN_REG_P ((CUM), (MODE), (TYPE))                                  \
614  ? gen_rtx_REG ((MODE), ROUND_ADVANCE_CUM ((CUM), (MODE), (TYPE)))      \
615  : 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 #define FUNCTION_ARG_ADVANCE(CUM, MODE, TYPE, NAMED) \
621 ((CUM) = (ROUND_ADVANCE_CUM ((CUM), (MODE), (TYPE)) \
622           + ROUND_ADVANCE_ARG ((MODE), (TYPE))))
623
624 /* If defined, a C expression that gives the alignment boundary, in bits,
625    of an argument with the specified mode and type.  If it is not defined, 
626    PARM_BOUNDARY is used for all arguments.  */
627 #define FUNCTION_ARG_BOUNDARY(MODE, TYPE) \
628 (((TYPE) ? TYPE_ALIGN (TYPE) : GET_MODE_BITSIZE (MODE)) <= PARM_BOUNDARY \
629  ? PARM_BOUNDARY \
630  : 2 * PARM_BOUNDARY)
631 \f
632 /* Function results.  */
633
634 /* Define how to find the value returned by a function.
635    VALTYPE is the data type of the value (as a tree).
636    If the precise function being called is known, FUNC is its FUNCTION_DECL;
637    otherwise, FUNC is 0.  */
638 #define FUNCTION_VALUE(VALTYPE, FUNC) gen_rtx_REG (TYPE_MODE (VALTYPE), 0)
639
640 /* Define how to find the value returned by a library function
641    assuming the value has mode MODE.  */
642 #define LIBCALL_VALUE(MODE) gen_rtx_REG (MODE, 0)
643
644 /* 1 if N is a possible register number for a function value
645    as seen by the caller.  */
646 /* ??? What about r1 in DI/DF values.  */
647 #define FUNCTION_VALUE_REGNO_P(N) ((N) == 0)
648
649 /* Tell GCC to use TARGET_RETURN_IN_MEMORY.  */
650 #define DEFAULT_PCC_STRUCT_RETURN 0
651 \f
652 /* EXIT_IGNORE_STACK should be nonzero if, when returning from a function,
653    the stack pointer does not matter.  The value is tested only in
654    functions that have frame pointers.
655    No definition is equivalent to always zero.  */
656 #define EXIT_IGNORE_STACK 0
657
658 /* Epilogue delay slots.  */
659 #define DELAY_SLOTS_FOR_EPILOGUE arc_delay_slots_for_epilogue ()
660
661 #define ELIGIBLE_FOR_EPILOGUE_DELAY(TRIAL, SLOTS_FILLED) \
662 arc_eligible_for_epilogue_delay (TRIAL, SLOTS_FILLED)
663
664 /* Output assembler code to FILE to increment profiler label # LABELNO
665    for profiling a function entry.  */
666 #define FUNCTION_PROFILER(FILE, LABELNO)
667 \f
668 /* Trampolines.  */
669 /* ??? This doesn't work yet because GCC will use as the address of a nested
670    function the address of the trampoline.  We need to use that address
671    right shifted by 2.  It looks like we'll need PSImode after all. :-(  */
672
673 /* Output assembler code for a block containing the constant parts
674    of a trampoline, leaving space for the variable parts.  */
675 /* On the ARC, the trampoline is quite simple as we have 32 bit immediate
676    constants.
677
678         mov r24,STATIC
679         j.nd FUNCTION
680 */
681 #define TRAMPOLINE_TEMPLATE(FILE) \
682 do { \
683   assemble_aligned_integer (UNITS_PER_WORD, GEN_INT (0x631f7c00)); \
684   assemble_aligned_integer (UNITS_PER_WORD, const0_rtx); \
685   assemble_aligned_integer (UNITS_PER_WORD, GEN_INT (0x381f0000)); \
686   assemble_aligned_integer (UNITS_PER_WORD, const0_rtx); \
687 } while (0)
688
689 /* Length in units of the trampoline for entering a nested function.  */
690 #define TRAMPOLINE_SIZE 16
691
692 /* Emit RTL insns to initialize the variable parts of a trampoline.
693    FNADDR is an RTX for the address of the function's pure code.
694    CXT is an RTX for the static chain value for the function.  */
695 #define INITIALIZE_TRAMPOLINE(TRAMP, FNADDR, CXT) \
696 do { \
697   emit_move_insn (gen_rtx_MEM (SImode, plus_constant (TRAMP, 4)), CXT); \
698   emit_move_insn (gen_rtx_MEM (SImode, plus_constant (TRAMP, 12)), FNADDR); \
699   emit_insn (gen_flush_icache (validize_mem (gen_rtx_MEM (SImode, TRAMP)))); \
700 } while (0)
701 \f
702 /* Addressing modes, and classification of registers for them.  */
703
704 /* Maximum number of registers that can appear in a valid memory address.  */
705 /* The `ld' insn allows 2, but the `st' insn only allows 1.  */
706 #define MAX_REGS_PER_ADDRESS 1
707
708 /* We have pre inc/dec (load/store with update).  */
709 #define HAVE_PRE_INCREMENT 1
710 #define HAVE_PRE_DECREMENT 1
711
712 /* Recognize any constant value that is a valid address.  */
713 #define CONSTANT_ADDRESS_P(X) \
714 (GET_CODE (X) == LABEL_REF || GET_CODE (X) == SYMBOL_REF        \
715  || GET_CODE (X) == CONST_INT || GET_CODE (X) == CONST)
716
717 /* Nonzero if the constant value X is a legitimate general operand.
718    We can handle any 32 or 64 bit constant.  */
719 /* "1" should work since the largest constant should be a 64 bit critter.  */
720 /* ??? Not sure what to do for 64x32 compiler.  */
721 #define LEGITIMATE_CONSTANT_P(X) 1
722
723 /* The macros REG_OK_FOR..._P assume that the arg is a REG rtx
724    and check its validity for a certain class.
725    We have two alternate definitions for each of them.
726    The usual definition accepts all pseudo regs; the other rejects
727    them unless they have been allocated suitable hard regs.
728    The symbol REG_OK_STRICT causes the latter definition to be used.
729
730    Most source files want to accept pseudo regs in the hope that
731    they will get allocated to the class that the insn wants them to be in.
732    Source files for reload pass need to be strict.
733    After reload, it makes no difference, since pseudo regs have
734    been eliminated by then.  */
735
736 #ifndef REG_OK_STRICT
737
738 /* Nonzero if X is a hard reg that can be used as an index
739    or if it is a pseudo reg.  */
740 #define REG_OK_FOR_INDEX_P(X) \
741 ((unsigned) REGNO (X) - 32 >= FIRST_PSEUDO_REGISTER - 32)
742 /* Nonzero if X is a hard reg that can be used as a base reg
743    or if it is a pseudo reg.  */
744 #define REG_OK_FOR_BASE_P(X) \
745 ((unsigned) REGNO (X) - 32 >= FIRST_PSEUDO_REGISTER - 32)
746
747 #else
748
749 /* Nonzero if X is a hard reg that can be used as an index.  */
750 #define REG_OK_FOR_INDEX_P(X) REGNO_OK_FOR_INDEX_P (REGNO (X))
751 /* Nonzero if X is a hard reg that can be used as a base reg.  */
752 #define REG_OK_FOR_BASE_P(X) REGNO_OK_FOR_BASE_P (REGNO (X))
753
754 #endif
755
756 /* GO_IF_LEGITIMATE_ADDRESS recognizes an RTL expression
757    that is a valid memory address for an instruction.
758    The MODE argument is the machine mode for the MEM expression
759    that wants to use this address.  */
760 /* The `ld' insn allows [reg],[reg+shimm],[reg+limm],[reg+reg],[limm]
761    but the `st' insn only allows [reg],[reg+shimm],[limm].
762    The only thing we can do is only allow the most strict case `st' and hope
763    other parts optimize out the restrictions for `ld'.  */
764
765 /* local to this file */
766 #define RTX_OK_FOR_BASE_P(X) \
767 (REG_P (X) && REG_OK_FOR_BASE_P (X))
768
769 /* local to this file */
770 #define RTX_OK_FOR_INDEX_P(X) \
771 (0 && /*???*/ REG_P (X) && REG_OK_FOR_INDEX_P (X))
772
773 /* local to this file */
774 /* ??? Loads can handle any constant, stores can only handle small ones.  */
775 #define RTX_OK_FOR_OFFSET_P(X) \
776 (GET_CODE (X) == CONST_INT && SMALL_INT (INTVAL (X)))
777
778 #define LEGITIMATE_OFFSET_ADDRESS_P(MODE, X) \
779 (GET_CODE (X) == PLUS                           \
780  && RTX_OK_FOR_BASE_P (XEXP (X, 0))             \
781  && (RTX_OK_FOR_INDEX_P (XEXP (X, 1))           \
782      || RTX_OK_FOR_OFFSET_P (XEXP (X, 1))))
783
784 #define GO_IF_LEGITIMATE_ADDRESS(MODE, X, ADDR)         \
785 { if (RTX_OK_FOR_BASE_P (X))                            \
786     goto ADDR;                                          \
787   if (LEGITIMATE_OFFSET_ADDRESS_P ((MODE), (X)))        \
788     goto ADDR;                                          \
789   if (GET_CODE (X) == CONST_INT && LARGE_INT (INTVAL (X))) \
790     goto ADDR;                                          \
791   if (GET_CODE (X) == SYMBOL_REF                        \
792            || GET_CODE (X) == LABEL_REF                 \
793            || GET_CODE (X) == CONST)                    \
794     goto ADDR;                                          \
795   if ((GET_CODE (X) == PRE_DEC || GET_CODE (X) == PRE_INC) \
796       /* We're restricted here by the `st' insn.  */    \
797       && RTX_OK_FOR_BASE_P (XEXP ((X), 0)))             \
798     goto ADDR;                                          \
799 }
800
801 /* Go to LABEL if ADDR (a legitimate address expression)
802    has an effect that depends on the machine mode it is used for.  */
803 #define GO_IF_MODE_DEPENDENT_ADDRESS(ADDR, LABEL) \
804 { if (GET_CODE (ADDR) == PRE_DEC)       \
805     goto LABEL;                         \
806   if (GET_CODE (ADDR) == PRE_INC)       \
807     goto LABEL;                         \
808 }
809 \f
810 /* Given a comparison code (EQ, NE, etc.) and the first operand of a COMPARE,
811    return the mode to be used for the comparison.  */
812 #define SELECT_CC_MODE(OP, X, Y) \
813 arc_select_cc_mode (OP, X, Y)
814
815 /* Return nonzero if SELECT_CC_MODE will never return MODE for a
816    floating point inequality comparison.  */
817 #define REVERSIBLE_CC_MODE(MODE) 1 /*???*/
818 \f
819 /* Costs.  */
820
821 /* Compute extra cost of moving data between one register class
822    and another.  */
823 #define REGISTER_MOVE_COST(MODE, CLASS1, CLASS2) 2
824
825 /* Compute the cost of moving data between registers and memory.  */
826 /* Memory is 3 times as expensive as registers.
827    ??? Is that the right way to look at it?  */
828 #define MEMORY_MOVE_COST(MODE,CLASS,IN) \
829 (GET_MODE_SIZE (MODE) <= UNITS_PER_WORD ? 6 : 12)
830
831 /* The cost of a branch insn.  */
832 /* ??? What's the right value here?  Branches are certainly more
833    expensive than reg->reg moves.  */
834 #define BRANCH_COST 2
835
836 /* Nonzero if access to memory by bytes is slow and undesirable.
837    For RISC chips, it means that access to memory by bytes is no
838    better than access by words when possible, so grab a whole word
839    and maybe make use of that.  */
840 #define SLOW_BYTE_ACCESS 1
841
842 /* Define this macro if it is as good or better to call a constant
843    function address than to call an address kept in a register.  */
844 /* On the ARC, calling through registers is slow.  */
845 #define NO_FUNCTION_CSE
846 \f
847 /* Section selection.  */
848 /* WARNING: These section names also appear in dwarfout.c.  */
849
850 /* The names of the text, data, and readonly-data sections are runtime
851    selectable.  */
852
853 #define ARC_SECTION_FORMAT              "\t.section %s"
854 #define ARC_DEFAULT_TEXT_SECTION        ".text"
855 #define ARC_DEFAULT_DATA_SECTION        ".data"
856 #define ARC_DEFAULT_RODATA_SECTION      ".rodata"
857
858 extern const char *arc_text_section, *arc_data_section, *arc_rodata_section;
859
860 /* initfini.c uses this in an asm.  */
861 #if defined (CRT_INIT) || defined (CRT_FINI)
862 #define TEXT_SECTION_ASM_OP     "\t.section .text"
863 #else
864 #define TEXT_SECTION_ASM_OP     arc_text_section
865 #endif
866 #define DATA_SECTION_ASM_OP     arc_data_section
867
868 #undef  READONLY_DATA_SECTION_ASM_OP
869 #define READONLY_DATA_SECTION_ASM_OP    arc_rodata_section
870
871 #define BSS_SECTION_ASM_OP      "\t.section .bss"
872
873 /* Define this macro if jump tables (for tablejump insns) should be
874    output in the text section, along with the assembler instructions.
875    Otherwise, the readonly data section is used.
876    This macro is irrelevant if there is no separate readonly data section.  */
877 /*#define JUMP_TABLES_IN_TEXT_SECTION*/
878
879 /* For DWARF.  Marginally different than default so output is "prettier"
880    (and consistent with above).  */
881 #define PUSHSECTION_ASM_OP "\t.section "
882
883 /* Tell crtstuff.c we're using ELF.  */
884 #define OBJECT_FORMAT_ELF
885 \f
886 /* PIC */
887
888 /* The register number of the register used to address a table of static
889    data addresses in memory.  In some cases this register is defined by a
890    processor's ``application binary interface'' (ABI).  When this macro
891    is defined, RTL is generated for this register once, as with the stack
892    pointer and frame pointer registers.  If this macro is not defined, it
893    is up to the machine-dependent files to allocate such a register (if
894    necessary).  */
895 #define PIC_OFFSET_TABLE_REGNUM  (flag_pic ? 26 : INVALID_REGNUM)
896
897 /* Define this macro if the register defined by PIC_OFFSET_TABLE_REGNUM is
898    clobbered by calls.  Do not define this macro if PIC_OFFSET_TABLE_REGNUM
899    is not defined.  */
900 /* This register is call-saved on the ARC.  */
901 /*#define PIC_OFFSET_TABLE_REG_CALL_CLOBBERED*/
902
903 /* By generating position-independent code, when two different programs (A
904    and B) share a common library (libC.a), the text of the library can be
905    shared whether or not the library is linked at the same address for both
906    programs.  In some of these environments, position-independent code
907    requires not only the use of different addressing modes, but also
908    special code to enable the use of these addressing modes.
909
910    The FINALIZE_PIC macro serves as a hook to emit these special
911    codes once the function is being compiled into assembly code, but not
912    before.  (It is not done before, because in the case of compiling an
913    inline function, it would lead to multiple PIC prologues being
914    included in functions which used inline functions and were compiled to
915    assembly language.)  */
916
917 #define FINALIZE_PIC arc_finalize_pic ()
918
919 /* A C expression that is nonzero if X is a legitimate immediate
920    operand on the target machine when generating position independent code.
921    You can assume that X satisfies CONSTANT_P, so you need not
922    check this.  You can also assume `flag_pic' is true, so you need not
923    check it either.  You need not define this macro if all constants
924    (including SYMBOL_REF) can be immediate operands when generating
925    position independent code.  */
926 /*#define LEGITIMATE_PIC_OPERAND_P(X)*/
927 \f
928 /* Control the assembler format that we output.  */
929
930 /* A C string constant describing how to begin a comment in the target
931    assembler language.  The compiler assumes that the comment will
932    end at the end of the line.  */
933 #define ASM_COMMENT_START ";"
934
935 /* Output to assembler file text saying following lines
936    may contain character constants, extra white space, comments, etc.  */
937 #define ASM_APP_ON ""
938
939 /* Output to assembler file text saying following lines
940    no longer contain unusual constructs.  */
941 #define ASM_APP_OFF ""
942
943 /* Globalizing directive for a label.  */
944 #define GLOBAL_ASM_OP "\t.global\t"
945
946 /* This is how to output a reference to a user-level label named NAME.
947    `assemble_name' uses this.  */
948 /* We mangle all user labels to provide protection from linking code
949    compiled for different cpus.  */
950 /* We work around a dwarfout.c deficiency by watching for labels from it and
951    not adding the '_' prefix nor the cpu suffix.  There is a comment in
952    dwarfout.c that says it should be using (*targetm.asm_out.internal_label).  */
953 extern const char *arc_mangle_cpu;
954 #define ASM_OUTPUT_LABELREF(FILE, NAME) \
955 do {                                                    \
956   if ((NAME)[0] == '.' && (NAME)[1] == 'L')             \
957     fprintf (FILE, "%s", NAME);                         \
958   else                                                  \
959     {                                                   \
960       fputc ('_', FILE);                                \
961       if (TARGET_MANGLE_CPU && arc_mangle_cpu != NULL)  \
962         fprintf (FILE, "%s_", arc_mangle_cpu);          \
963       fprintf (FILE, "%s", NAME);                       \
964     }                                                   \
965 } while (0)
966
967 /* Assembler pseudo-op to equate one value with another.  */
968 /* ??? This is needed because dwarfout.c provides a default definition too
969    late for defaults.h (which contains the default definition of ASM_OUTPUT_DEF
970    that we use).  */
971 #define SET_ASM_OP "\t.set\t"
972
973 /* How to refer to registers in assembler output.
974    This sequence is indexed by compiler's hard-register-number (see above).  */
975 #define REGISTER_NAMES \
976 {"r0", "r1", "r2", "r3", "r4", "r5", "r6", "r7",                \
977  "r8", "r9", "r10", "r11", "r12", "r13", "r14", "r15",          \
978  "r16", "r17", "r18", "r19", "r20", "r21", "r22", "r23",        \
979  "r24", "r25", "r26", "fp", "sp", "ilink1", "ilink2", "blink",  \
980  "r32", "r33", "r34", "r35", "r36", "r37", "r38", "r39",        \
981  "r40", "r41", "r42", "r43", "r44", "r45", "r46", "r47",        \
982  "r48", "r49", "r50", "r51", "r52", "r53", "r54", "r55",        \
983  "r56", "r57", "r58", "r59", "lp_count", "cc"}
984
985 /* Entry to the insn conditionalizer.  */
986 #define FINAL_PRESCAN_INSN(INSN, OPVEC, NOPERANDS) \
987 arc_final_prescan_insn (INSN, OPVEC, NOPERANDS)
988
989 /* A C expression which evaluates to true if CODE is a valid
990    punctuation character for use in the `PRINT_OPERAND' macro.  */
991 extern char arc_punct_chars[256];
992 #define PRINT_OPERAND_PUNCT_VALID_P(CHAR) \
993 arc_punct_chars[(unsigned char) (CHAR)]
994
995 /* Print operand X (an rtx) in assembler syntax to file FILE.
996    CODE is a letter or dot (`z' in `%z0') or 0 if no letter was specified.
997    For `%' followed by punctuation, CODE is the punctuation and X is null.  */
998 #define PRINT_OPERAND(FILE, X, CODE) \
999 arc_print_operand (FILE, X, CODE)
1000
1001 /* A C compound statement to output to stdio stream STREAM the
1002    assembler syntax for an instruction operand that is a memory
1003    reference whose address is ADDR.  ADDR is an RTL expression.  */
1004 #define PRINT_OPERAND_ADDRESS(FILE, ADDR) \
1005 arc_print_operand_address (FILE, ADDR)
1006
1007 /* This is how to output an element of a case-vector that is absolute.  */
1008 #define ASM_OUTPUT_ADDR_VEC_ELT(FILE, VALUE)  \
1009 do {                                                    \
1010   char label[30];                                       \
1011   ASM_GENERATE_INTERNAL_LABEL (label, "L", VALUE);      \
1012   fprintf (FILE, "\t.word %%st(");                      \
1013   assemble_name (FILE, label);                          \
1014   fprintf (FILE, ")\n");                                \
1015 } while (0)
1016
1017 /* This is how to output an element of a case-vector that is relative.  */
1018 #define ASM_OUTPUT_ADDR_DIFF_ELT(FILE, BODY, VALUE, REL) \
1019 do {                                                    \
1020   char label[30];                                       \
1021   ASM_GENERATE_INTERNAL_LABEL (label, "L", VALUE);      \
1022   fprintf (FILE, "\t.word %%st(");                      \
1023   assemble_name (FILE, label);                          \
1024   fprintf (FILE, "-");                                  \
1025   ASM_GENERATE_INTERNAL_LABEL (label, "L", REL);        \
1026   assemble_name (FILE, label);                          \
1027   fprintf (FILE, ")\n");                                \
1028 } while (0)
1029
1030 /* The desired alignment for the location counter at the beginning
1031    of a loop.  */
1032 /* On the ARC, align loops to 32 byte boundaries (cache line size)
1033    if -malign-loops.  */
1034 #define LOOP_ALIGN(LABEL) (TARGET_ALIGN_LOOPS ? 5 : 0)
1035
1036 /* This is how to output an assembler line
1037    that says to advance the location counter
1038    to a multiple of 2**LOG bytes.  */
1039 #define ASM_OUTPUT_ALIGN(FILE,LOG) \
1040 do { if ((LOG) != 0) fprintf (FILE, "\t.align %d\n", 1 << (LOG)); } while (0)
1041 \f
1042 /* Debugging information.  */
1043
1044 /* Generate DBX and DWARF debugging information.  */
1045 #define DBX_DEBUGGING_INFO 1
1046
1047 /* Prefer STABS (for now).  */
1048 #undef PREFERRED_DEBUGGING_TYPE
1049 #define PREFERRED_DEBUGGING_TYPE DBX_DEBUG
1050
1051 /* Turn off splitting of long stabs.  */
1052 #define DBX_CONTIN_LENGTH 0
1053 \f
1054 /* Miscellaneous.  */
1055
1056 /* Specify the machine mode that this machine uses
1057    for the index in the tablejump instruction.  */
1058 #define CASE_VECTOR_MODE Pmode
1059
1060 /* Define if operations between registers always perform the operation
1061    on the full register even if a narrower mode is specified.  */
1062 #define WORD_REGISTER_OPERATIONS
1063
1064 /* Define if loading in MODE, an integral mode narrower than BITS_PER_WORD
1065    will either zero-extend or sign-extend.  The value of this macro should
1066    be the code that says which one of the two operations is implicitly
1067    done, UNKNOWN if none.  */
1068 #define LOAD_EXTEND_OP(MODE) ZERO_EXTEND
1069
1070 /* Max number of bytes we can move from memory to memory
1071    in one reasonably fast instruction.  */
1072 #define MOVE_MAX 4
1073
1074 /* Define this to be nonzero if shift instructions ignore all but the low-order
1075    few bits.  */
1076 #define SHIFT_COUNT_TRUNCATED 1
1077
1078 /* Value is 1 if truncating an integer of INPREC bits to OUTPREC bits
1079    is done just by pretending it is already truncated.  */
1080 #define TRULY_NOOP_TRUNCATION(OUTPREC, INPREC) 1
1081
1082 /* Specify the machine mode that pointers have.
1083    After generation of rtl, the compiler makes no further distinction
1084    between pointers and any other objects of this machine mode.  */
1085 /* ??? The arc doesn't have full 32 bit pointers, but making this PSImode has
1086    its own problems (you have to add extendpsisi2 and trucnsipsi2 but how does
1087    one do it without getting excess code?).  Try to avoid it.  */
1088 #define Pmode SImode
1089
1090 /* A function address in a call instruction.  */
1091 #define FUNCTION_MODE SImode
1092
1093 /* alloca should avoid clobbering the old register save area.  */
1094 /* ??? Not defined in tm.texi.  */
1095 #define SETJMP_VIA_SAVE_AREA
1096 \f
1097 /* Define the information needed to generate branch and scc insns.  This is
1098    stored from the compare operation.  Note that we can't use "rtx" here
1099    since it hasn't been defined!  */
1100 extern struct rtx_def *arc_compare_op0, *arc_compare_op1;
1101
1102 /* ARC function types.  */
1103 enum arc_function_type {
1104   ARC_FUNCTION_UNKNOWN, ARC_FUNCTION_NORMAL,
1105   /* These are interrupt handlers.  The name corresponds to the register
1106      name that contains the return address.  */
1107   ARC_FUNCTION_ILINK1, ARC_FUNCTION_ILINK2
1108 };
1109 #define ARC_INTERRUPT_P(TYPE) \
1110 ((TYPE) == ARC_FUNCTION_ILINK1 || (TYPE) == ARC_FUNCTION_ILINK2)
1111 /* Compute the type of a function from its DECL.  */
1112
1113 \f
1114 /* Implement `va_start' for varargs and stdarg.  */
1115 #define EXPAND_BUILTIN_VA_START(valist, nextarg) \
1116   arc_va_start (valist, nextarg)