final.c (output_addr_const): Use target opening and closing parentheses.
[gcc.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
3 Free Software Foundation, Inc.
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 /* ??? 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 /* ??? Create elf.h and have svr4.h include it. */
32 #include "svr4.h"
33
34 #undef ASM_SPEC
35 #undef LINK_SPEC
36 #undef STARTFILE_SPEC
37 #undef ENDFILE_SPEC
38 #undef SIZE_TYPE
39 #undef PTRDIFF_TYPE
40 #undef WCHAR_TYPE
41 #undef WCHAR_TYPE_SIZE
42 #undef ASM_OUTPUT_LABELREF
43 \f
44 /* Print subsidiary information on the compiler version in use. */
45 #define TARGET_VERSION fprintf (stderr, " (arc)")
46
47 /* Names to predefine in the preprocessor for this target machine. */
48 #define CPP_PREDEFINES "-Acpu=arc -Amachine=arc -D__arc__"
49
50 /* Additional flags for the preprocessor. */
51 #define CPP_SPEC "\
52 %{!mcpu=*:-D__base__} %{mcpu=base:-D__base__} \
53 %{EB:-D__big_endian__} \
54 "
55
56 /* Pass -mmangle-cpu if we get -mcpu=*.
57 Doing it this way lets one have it on as default with -mcpu=*,
58 but also lets one turn it off with -mno-mangle-cpu. */
59 #define CC1_SPEC "\
60 %{mcpu=*:-mmangle-cpu} \
61 %{EB:%{EL:%emay not use both -EB and -EL}} \
62 %{EB:-mbig-endian} %{EL:-mlittle-endian} \
63 "
64
65 #define ASM_SPEC "%{v} %{EB} %{EL}"
66
67 #define LINK_SPEC "%{v} %{EB} %{EL}"
68
69 #define STARTFILE_SPEC "%{!shared:crt0.o%s} crtinit.o%s"
70
71 #define ENDFILE_SPEC "crtfini.o%s"
72 \f
73 /* Run-time compilation parameters selecting different hardware subsets. */
74
75 extern int target_flags;
76
77 /* Mangle all user symbols for the specified cpu.
78 ARC's can be shipped in which a collection of cpus are coupled together.
79 Each CPU may be different in some way, and thus we may need to distinguish
80 code compiled for one to ensure it isn't linked with code compiled for
81 another. */
82 #define TARGET_MASK_MANGLE_CPU 1
83 #define TARGET_MANGLE_CPU (target_flags & TARGET_MASK_MANGLE_CPU)
84
85 #if 0
86 /* Mangle libgcc symbols by adding a suffix for the specified cpu. */
87 #define TARGET_MASK_MANGLE_CPU_LIBGCC 2
88 #define TARGET_MANGLE_CPU_LIBGCC (target_flags & TARGET_MASK_MANGLE_CPU_LIBGCC)
89 #endif
90
91 /* Align loops to 32 byte boundaries (cache line size). */
92 #define TARGET_MASK_ALIGN_LOOPS 4
93 #define TARGET_ALIGN_LOOPS (target_flags & TARGET_MASK_ALIGN_LOOPS)
94
95 /* Big Endian. */
96 #define TARGET_MASK_BIG_ENDIAN 8
97 #define TARGET_BIG_ENDIAN (target_flags & TARGET_MASK_BIG_ENDIAN)
98
99 /* Turn off conditional execution optimization,
100 so we can see how well it does, or in case it's buggy. */
101 #define TARGET_MASK_NO_COND_EXEC 0x10
102 #define TARGET_NO_COND_EXEC (target_flags & TARGET_MASK_NO_COND_EXEC)
103
104 /* Macro to define tables used to set the flags.
105 This is a list in braces of pairs in braces,
106 each pair being { "NAME", VALUE }
107 where VALUE is the bits to set or minus the bits to clear.
108 An empty string NAME is used to identify the default VALUE. */
109
110 #define TARGET_SWITCHES \
111 { \
112 { "mangle-cpu", TARGET_MASK_MANGLE_CPU }, \
113 { "no-mangle-cpu", -TARGET_MASK_MANGLE_CPU }, \
114 /* { "mangle-cpu-libgcc", TARGET_MASK_MANGLE_CPU_LIBGCC }, */ \
115 /* { "no-mangle-cpu-libgcc", -TARGET_MASK_MANGLE_CPU_LIBGCC }, */ \
116 { "align-loops", TARGET_MASK_ALIGN_LOOPS }, \
117 { "no-align-loops", -TARGET_MASK_ALIGN_LOOPS }, \
118 { "big-endian", TARGET_MASK_BIG_ENDIAN }, \
119 { "little-endian", -TARGET_MASK_BIG_ENDIAN }, \
120 { "no-cond-exec", TARGET_MASK_NO_COND_EXEC }, \
121 SUBTARGET_SWITCHES \
122 { "", TARGET_DEFAULT } \
123 }
124
125 #define TARGET_DEFAULT (0)
126
127 #define SUBTARGET_SWITCHES
128
129 /* Instruction set characteristics.
130 These are internal macros, set by the appropriate -mcpu= option. */
131
132 /* Non-zero means the cpu has a barrel shifter. */
133 #define TARGET_SHIFTER 0
134
135 /* This macro is similar to `TARGET_SWITCHES' but defines names of
136 command options that have values. Its definition is an
137 initializer with a subgrouping for each command option.
138
139 Each subgrouping contains a string constant, that defines the
140 fixed part of the option name, and the address of a variable.
141 The variable, type `char *', is set to the variable part of the
142 given option if the fixed part matches. The actual option name
143 is made by appending `-m' to the specified name.
144
145 Here is an example which defines `-mshort-data-NUMBER'. If the
146 given option is `-mshort-data-512', the variable `m88k_short_data'
147 will be set to the string `"512"'.
148
149 extern char *m88k_short_data;
150 #define TARGET_OPTIONS { { "short-data-", &m88k_short_data } } */
151
152 extern const char *arc_cpu_string;
153 extern const char *arc_text_string,*arc_data_string,*arc_rodata_string;
154
155 #define TARGET_OPTIONS \
156 { \
157 { "cpu=", &arc_cpu_string }, \
158 { "text=", &arc_text_string }, \
159 { "data=", &arc_data_string }, \
160 { "rodata=", &arc_rodata_string }, \
161 }
162
163 /* Which cpu we're compiling for. */
164 extern int arc_cpu_type;
165
166 /* Check if CPU is an extension and set `arc_cpu_type' and `arc_mangle_cpu'
167 appropriately. The result should be non-zero if the cpu is recognized,
168 otherwise zero. This is intended to be redefined in a cover file.
169 This is used by arc_init. */
170 #define ARC_EXTENSION_CPU(cpu) 0
171
172 /* Sometimes certain combinations of command options do not make
173 sense on a particular target machine. You can define a macro
174 `OVERRIDE_OPTIONS' to take account of this. This macro, if
175 defined, is executed once just after all the command options have
176 been parsed.
177
178 Don't use this macro to turn on various extra optimizations for
179 `-O'. That is what `OPTIMIZATION_OPTIONS' is for. */
180
181
182 #define OVERRIDE_OPTIONS \
183 do { \
184 /* These need to be done at start up. It's convenient to do them here. */ \
185 arc_init (); \
186 } while (0)
187 \f
188 /* Target machine storage layout. */
189
190 /* Define to use software floating point emulator for REAL_ARITHMETIC and
191 decimal <-> binary conversion. */
192 #define REAL_ARITHMETIC
193
194 /* Define this if most significant bit is lowest numbered
195 in instructions that operate on numbered bit-fields. */
196 #define BITS_BIG_ENDIAN 1
197
198 /* Define this if most significant byte of a word is the lowest numbered. */
199 #define BYTES_BIG_ENDIAN (TARGET_BIG_ENDIAN)
200
201 /* Define this if most significant word of a multiword number is the lowest
202 numbered. */
203 #define WORDS_BIG_ENDIAN (TARGET_BIG_ENDIAN)
204
205 /* Define this to set the endianness to use in libgcc2.c, which can
206 not depend on target_flags. */
207 #ifdef __big_endian__
208 #define LIBGCC2_WORDS_BIG_ENDIAN 1
209 #else
210 #define LIBGCC2_WORDS_BIG_ENDIAN 0
211 #endif
212
213 /* Number of bits in an addressable storage unit. */
214 #define BITS_PER_UNIT 8
215
216 /* Width in bits of a "word", which is the contents of a machine register.
217 Note that this is not necessarily the width of data type `int';
218 if using 16-bit ints on a 68000, this would still be 32.
219 But on a machine with 16-bit registers, this would be 16. */
220 #define BITS_PER_WORD 32
221
222 /* Width of a word, in units (bytes). */
223 #define UNITS_PER_WORD 4
224
225 /* Define this macro if it is advisable to hold scalars in registers
226 in a wider mode than that declared by the program. In such cases,
227 the value is constrained to be within the bounds of the declared
228 type, but kept valid in the wider mode. The signedness of the
229 extension may differ from that of the type. */
230 #define PROMOTE_MODE(MODE,UNSIGNEDP,TYPE) \
231 if (GET_MODE_CLASS (MODE) == MODE_INT \
232 && GET_MODE_SIZE (MODE) < UNITS_PER_WORD) \
233 { \
234 (MODE) = SImode; \
235 }
236
237 /* Define this macro if the promotion described by `PROMOTE_MODE'
238 should also be done for outgoing function arguments. */
239 #define PROMOTE_FUNCTION_ARGS
240
241 /* Likewise, if the function return value is promoted. */
242 #define PROMOTE_FUNCTION_RETURN
243
244 /* Width in bits of a pointer.
245 See also the macro `Pmode' defined below. */
246 #define POINTER_SIZE 32
247
248 /* Allocation boundary (in *bits*) for storing arguments in argument list. */
249 #define PARM_BOUNDARY 32
250
251 /* Boundary (in *bits*) on which stack pointer should be aligned. */
252 #define STACK_BOUNDARY 64
253
254 /* ALIGN FRAMES on word boundaries */
255 #define ARC_STACK_ALIGN(LOC) (((LOC)+7) & ~7)
256
257 /* Allocation boundary (in *bits*) for the code of a function. */
258 #define FUNCTION_BOUNDARY 32
259
260 /* Alignment of field after `int : 0' in a structure. */
261 #define EMPTY_FIELD_BOUNDARY 32
262
263 /* Every structure's size must be a multiple of this. */
264 #define STRUCTURE_SIZE_BOUNDARY 8
265
266 /* A bitfield declared as `int' forces `int' alignment for the struct. */
267 #define PCC_BITFIELD_TYPE_MATTERS 1
268
269 /* No data type wants to be aligned rounder than this. */
270 /* This is bigger than currently necessary for the ARC. If 8 byte floats are
271 ever added it's not clear whether they'll need such alignment or not. For
272 now we assume they will. We can always relax it if necessary but the
273 reverse isn't true. */
274 #define BIGGEST_ALIGNMENT 64
275
276 /* The best alignment to use in cases where we have a choice. */
277 #define FASTEST_ALIGNMENT 32
278
279 /* Make strings word-aligned so strcpy from constants will be faster. */
280 #define CONSTANT_ALIGNMENT(EXP, ALIGN) \
281 ((TREE_CODE (EXP) == STRING_CST \
282 && (ALIGN) < FASTEST_ALIGNMENT) \
283 ? FASTEST_ALIGNMENT : (ALIGN))
284
285 /* Make arrays of chars word-aligned for the same reasons. */
286 #define DATA_ALIGNMENT(TYPE, ALIGN) \
287 (TREE_CODE (TYPE) == ARRAY_TYPE \
288 && TYPE_MODE (TREE_TYPE (TYPE)) == QImode \
289 && (ALIGN) < FASTEST_ALIGNMENT ? FASTEST_ALIGNMENT : (ALIGN))
290
291 /* Set this nonzero if move instructions will actually fail to work
292 when given unaligned data. */
293 /* On the ARC the lower address bits are masked to 0 as necessary. The chip
294 won't croak when given an unaligned address, but the insn will still fail
295 to produce the correct result. */
296 #define STRICT_ALIGNMENT 1
297 \f
298 /* Layout of source language data types. */
299
300 #define SHORT_TYPE_SIZE 16
301 #define INT_TYPE_SIZE 32
302 #define LONG_TYPE_SIZE 32
303 #define LONG_LONG_TYPE_SIZE 64
304 #define FLOAT_TYPE_SIZE 32
305 #define DOUBLE_TYPE_SIZE 64
306 #define LONG_DOUBLE_TYPE_SIZE 64
307
308 /* Define this as 1 if `char' should by default be signed; else as 0. */
309 #define DEFAULT_SIGNED_CHAR 1
310
311 #define SIZE_TYPE "long unsigned int"
312 #define PTRDIFF_TYPE "long int"
313 #define WCHAR_TYPE "short unsigned int"
314 #define WCHAR_TYPE_SIZE 16
315 \f
316 /* Standard register usage. */
317
318 /* Number of actual hardware registers.
319 The hardware registers are assigned numbers for the compiler
320 from 0 to just below FIRST_PSEUDO_REGISTER.
321 All registers that the compiler knows about must be given numbers,
322 even those that are not normally considered general registers. */
323 /* Registers 61, 62, and 63 are not really registers and we needn't treat
324 them as such. We still need a register for the condition code. */
325 #define FIRST_PSEUDO_REGISTER 62
326
327 /* 1 for registers that have pervasive standard uses
328 and are not available for the register allocator.
329
330 0-28 - general purpose registers
331 29 - ilink1 (interrupt link register)
332 30 - ilink2 (interrupt link register)
333 31 - blink (branch link register)
334 32-59 - reserved for extensions
335 60 - LP_COUNT
336 61 - condition code
337
338 For doc purposes:
339 61 - short immediate data indicator (setting flags)
340 62 - long immediate data indicator
341 63 - short immediate data indicator (not setting flags).
342
343 The general purpose registers are further broken down into:
344 0-7 - arguments/results
345 8-15 - call used
346 16-23 - call saved
347 24 - call used, static chain pointer
348 25 - call used, gptmp
349 26 - global pointer
350 27 - frame pointer
351 28 - stack pointer
352
353 By default, the extension registers are not available. */
354
355 #define FIXED_REGISTERS \
356 { 0, 0, 0, 0, 0, 0, 0, 0, \
357 0, 0, 0, 0, 0, 0, 0, 0, \
358 0, 0, 0, 0, 0, 0, 0, 0, \
359 0, 0, 0, 1, 1, 1, 1, 0, \
360 \
361 1, 1, 1, 1, 1, 1, 1, 1, \
362 1, 1, 1, 1, 1, 1, 1, 1, \
363 1, 1, 1, 1, 1, 1, 1, 1, \
364 1, 1, 1, 1, 1, 1 }
365
366 /* 1 for registers not available across function calls.
367 These must include the FIXED_REGISTERS and also any
368 registers that can be used without being saved.
369 The latter must include the registers where values are returned
370 and the register where structure-value addresses are passed.
371 Aside from that, you can include as many other registers as you like. */
372
373 #define CALL_USED_REGISTERS \
374 { 1, 1, 1, 1, 1, 1, 1, 1, \
375 1, 1, 1, 1, 1, 1, 1, 1, \
376 0, 0, 0, 0, 0, 0, 0, 0, \
377 1, 1, 1, 1, 1, 1, 1, 1, \
378 \
379 1, 1, 1, 1, 1, 1, 1, 1, \
380 1, 1, 1, 1, 1, 1, 1, 1, \
381 1, 1, 1, 1, 1, 1, 1, 1, \
382 1, 1, 1, 1, 1, 1 }
383
384 /* If defined, an initializer for a vector of integers, containing the
385 numbers of hard registers in the order in which GNU CC should
386 prefer to use them (from most preferred to least). */
387 #define REG_ALLOC_ORDER \
388 { 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 0, 1, \
389 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 31, \
390 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, \
391 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, \
392 27, 28, 29, 30 }
393
394 /* Return number of consecutive hard regs needed starting at reg REGNO
395 to hold something of mode MODE.
396 This is ordinarily the length in words of a value of mode MODE
397 but can be less for certain modes in special long registers. */
398 #define HARD_REGNO_NREGS(REGNO, MODE) \
399 ((GET_MODE_SIZE (MODE) + UNITS_PER_WORD - 1) / UNITS_PER_WORD)
400
401 /* Value is 1 if hard register REGNO can hold a value of machine-mode MODE. */
402 extern unsigned int arc_hard_regno_mode_ok[];
403 extern unsigned int arc_mode_class[];
404 #define HARD_REGNO_MODE_OK(REGNO, MODE) \
405 ((arc_hard_regno_mode_ok[REGNO] & arc_mode_class[MODE]) != 0)
406
407 /* A C expression that is nonzero if it is desirable to choose
408 register allocation so as to avoid move instructions between a
409 value of mode MODE1 and a value of mode MODE2.
410
411 If `HARD_REGNO_MODE_OK (R, MODE1)' and `HARD_REGNO_MODE_OK (R,
412 MODE2)' are ever different for any R, then `MODES_TIEABLE_P (MODE1,
413 MODE2)' must be zero. */
414
415 /* Tie QI/HI/SI modes together. */
416 #define MODES_TIEABLE_P(MODE1, MODE2) \
417 (GET_MODE_CLASS (MODE1) == MODE_INT \
418 && GET_MODE_CLASS (MODE2) == MODE_INT \
419 && GET_MODE_SIZE (MODE1) <= UNITS_PER_WORD \
420 && GET_MODE_SIZE (MODE2) <= UNITS_PER_WORD)
421 \f
422 /* Register classes and constants. */
423
424 /* Define the classes of registers for register constraints in the
425 machine description. Also define ranges of constants.
426
427 One of the classes must always be named ALL_REGS and include all hard regs.
428 If there is more than one class, another class must be named NO_REGS
429 and contain no registers.
430
431 The name GENERAL_REGS must be the name of a class (or an alias for
432 another name such as ALL_REGS). This is the class of registers
433 that is allowed by "g" or "r" in a register constraint.
434 Also, registers outside this class are allocated only when
435 instructions express preferences for them.
436
437 The classes must be numbered in nondecreasing order; that is,
438 a larger-numbered class must never be contained completely
439 in a smaller-numbered class.
440
441 For any two classes, it is very desirable that there be another
442 class that represents their union.
443
444 It is important that any condition codes have class NO_REGS.
445 See `register_operand'. */
446
447 enum reg_class {
448 NO_REGS, LPCOUNT_REG, GENERAL_REGS, ALL_REGS, LIM_REG_CLASSES
449 };
450
451 #define N_REG_CLASSES (int) LIM_REG_CLASSES
452
453 /* Give names of register classes as strings for dump file. */
454 #define REG_CLASS_NAMES \
455 { "NO_REGS", "LPCOUNT_REG", "GENERAL_REGS", "ALL_REGS" }
456
457 /* Define which registers fit in which classes.
458 This is an initializer for a vector of HARD_REG_SET
459 of length N_REG_CLASSES. */
460
461 #define REG_CLASS_CONTENTS \
462 { {0, 0}, {0, 0x10000000}, {0xffffffff, 0xfffffff}, \
463 {0xffffffff, 0x1fffffff} }
464
465 /* The same information, inverted:
466 Return the class number of the smallest class containing
467 reg number REGNO. This could be a conditional expression
468 or could index an array. */
469 extern enum reg_class arc_regno_reg_class[];
470 #define REGNO_REG_CLASS(REGNO) \
471 (arc_regno_reg_class[REGNO])
472
473 /* The class value for index registers, and the one for base regs. */
474 #define INDEX_REG_CLASS GENERAL_REGS
475 #define BASE_REG_CLASS GENERAL_REGS
476
477 /* Get reg_class from a letter such as appears in the machine description. */
478 #define REG_CLASS_FROM_LETTER(C) \
479 ((C) == 'l' ? LPCOUNT_REG /* ??? needed? */ \
480 : NO_REGS)
481
482 /* These assume that REGNO is a hard or pseudo reg number.
483 They give nonzero only if REGNO is a hard reg of the suitable class
484 or a pseudo reg currently allocated to a suitable hard reg.
485 Since they use reg_renumber, they are safe only once reg_renumber
486 has been allocated, which happens in local-alloc.c. */
487 #define REGNO_OK_FOR_BASE_P(REGNO) \
488 ((REGNO) < 29 || (unsigned) reg_renumber[REGNO] < 29)
489 #define REGNO_OK_FOR_INDEX_P(REGNO) \
490 ((REGNO) < 29 || (unsigned) reg_renumber[REGNO] < 29)
491
492 /* Given an rtx X being reloaded into a reg required to be
493 in class CLASS, return the class of reg to actually use.
494 In general this is just CLASS; but on some machines
495 in some cases it is preferable to use a more restrictive class. */
496 #define PREFERRED_RELOAD_CLASS(X,CLASS) \
497 (CLASS)
498
499 /* Return the maximum number of consecutive registers
500 needed to represent mode MODE in a register of class CLASS. */
501 #define CLASS_MAX_NREGS(CLASS, MODE) \
502 ((GET_MODE_SIZE (MODE) + UNITS_PER_WORD - 1) / UNITS_PER_WORD)
503
504 /* The letters I, J, K, L, M, N, O, P in a register constraint string
505 can be used to stand for particular ranges of immediate operands.
506 This macro defines what the ranges are.
507 C is the letter, and VALUE is a constant value.
508 Return 1 if VALUE is in the range specified by C. */
509 /* 'I' is used for short immediates (always signed).
510 'J' is used for long immediates.
511 'K' is used for any constant up to 64 bits (for 64x32 situations?). */
512
513 /* local to this file */
514 #define SMALL_INT(X) ((unsigned) ((X) + 0x100) < 0x200)
515 /* local to this file */
516 #define LARGE_INT(X) \
517 ((X) >= (-(HOST_WIDE_INT) 0x7fffffff - 1) \
518 && (X) <= (unsigned HOST_WIDE_INT) 0xffffffff)
519
520 #define CONST_OK_FOR_LETTER_P(VALUE, C) \
521 ((C) == 'I' ? SMALL_INT (VALUE) \
522 : (C) == 'J' ? LARGE_INT (VALUE) \
523 : (C) == 'K' ? 1 \
524 : 0)
525
526 /* Similar, but for floating constants, and defining letters G and H.
527 Here VALUE is the CONST_DOUBLE rtx itself. */
528 /* 'G' is used for integer values for the multiplication insns where the
529 operands are extended from 4 bytes to 8 bytes.
530 'H' is used when any 64 bit constant is allowed. */
531 #define CONST_DOUBLE_OK_FOR_LETTER_P(VALUE, C) \
532 ((C) == 'G' ? arc_double_limm_p (VALUE) \
533 : (C) == 'H' ? 1 \
534 : 0)
535
536 /* A C expression that defines the optional machine-dependent constraint
537 letters that can be used to segregate specific types of operands,
538 usually memory references, for the target machine. It should return 1 if
539 VALUE corresponds to the operand type represented by the constraint letter
540 C. If C is not defined as an extra constraint, the value returned should
541 be 0 regardless of VALUE. */
542 /* ??? This currently isn't used. Waiting for PIC. */
543 #if 0
544 #define EXTRA_CONSTRAINT(VALUE, C) \
545 ((C) == 'R' ? (SYMBOL_REF_FLAG (VALUE) || GET_CODE (VALUE) == LABEL_REF) \
546 : 0)
547 #endif
548 \f
549 /* Stack layout and stack pointer usage. */
550
551 /* Define this macro if pushing a word onto the stack moves the stack
552 pointer to a smaller address. */
553 #define STACK_GROWS_DOWNWARD
554
555 /* Define this if the nominal address of the stack frame
556 is at the high-address end of the local variables;
557 that is, each additional local variable allocated
558 goes at a more negative offset in the frame. */
559 #define FRAME_GROWS_DOWNWARD
560
561 /* Offset within stack frame to start allocating local variables at.
562 If FRAME_GROWS_DOWNWARD, this is the offset to the END of the
563 first local allocated. Otherwise, it is the offset to the BEGINNING
564 of the first local allocated. */
565 #define STARTING_FRAME_OFFSET 0
566
567 /* Offset from the stack pointer register to the first location at which
568 outgoing arguments are placed. */
569 #define STACK_POINTER_OFFSET FIRST_PARM_OFFSET (0)
570
571 /* Offset of first parameter from the argument pointer register value. */
572 /* 4 bytes for each of previous fp, return address, and previous gp.
573 4 byte reserved area for future considerations. */
574 #define FIRST_PARM_OFFSET(FNDECL) 16
575
576 /* A C expression whose value is RTL representing the address in a
577 stack frame where the pointer to the caller's frame is stored.
578 Assume that FRAMEADDR is an RTL expression for the address of the
579 stack frame itself.
580
581 If you don't define this macro, the default is to return the value
582 of FRAMEADDR--that is, the stack frame address is also the address
583 of the stack word that points to the previous frame. */
584 /* ??? unfinished */
585 /*define DYNAMIC_CHAIN_ADDRESS (FRAMEADDR)*/
586
587 /* A C expression whose value is RTL representing the value of the
588 return address for the frame COUNT steps up from the current frame.
589 FRAMEADDR is the frame pointer of the COUNT frame, or the frame
590 pointer of the COUNT - 1 frame if `RETURN_ADDR_IN_PREVIOUS_FRAME'
591 is defined. */
592 /* The current return address is in r31. The return address of anything
593 farther back is at [%fp,4]. */
594 #if 0 /* The default value should work. */
595 #define RETURN_ADDR_RTX(COUNT, FRAME) \
596 (((COUNT) == -1) \
597 ? gen_rtx_REG (Pmode, 31) \
598 : copy_to_reg (gen_rtx_MEM (Pmode, \
599 memory_address (Pmode, \
600 plus_constant ((FRAME), \
601 UNITS_PER_WORD)))))
602 #endif
603
604 /* Register to use for pushing function arguments. */
605 #define STACK_POINTER_REGNUM 28
606
607 /* Base register for access to local variables of the function. */
608 #define FRAME_POINTER_REGNUM 27
609
610 /* Base register for access to arguments of the function. */
611 #define ARG_POINTER_REGNUM FRAME_POINTER_REGNUM
612
613 /* Register in which static-chain is passed to a function. This must
614 not be a register used by the prologue. */
615 #define STATIC_CHAIN_REGNUM 24
616
617 /* A C expression which is nonzero if a function must have and use a
618 frame pointer. This expression is evaluated in the reload pass.
619 If its value is nonzero the function will have a frame pointer. */
620 #define FRAME_POINTER_REQUIRED \
621 (current_function_calls_alloca)
622
623 /* C statement to store the difference between the frame pointer
624 and the stack pointer values immediately after the function prologue. */
625 #define INITIAL_FRAME_POINTER_OFFSET(VAR) \
626 ((VAR) = arc_compute_frame_size (get_frame_size ()))
627 \f
628 /* Function argument passing. */
629
630 /* When a prototype says `char' or `short', really pass an `int'. */
631 #define PROMOTE_PROTOTYPES 1
632
633 /* If defined, the maximum amount of space required for outgoing
634 arguments will be computed and placed into the variable
635 `current_function_outgoing_args_size'. No space will be pushed
636 onto the stack for each call; instead, the function prologue should
637 increase the stack frame size by this amount. */
638 #define ACCUMULATE_OUTGOING_ARGS 1
639
640 /* Value is the number of bytes of arguments automatically
641 popped when returning from a subroutine call.
642 FUNDECL is the declaration node of the function (as a tree),
643 FUNTYPE is the data type of the function (as a tree),
644 or for a library call it is an identifier node for the subroutine name.
645 SIZE is the number of bytes of arguments passed on the stack. */
646 #define RETURN_POPS_ARGS(DECL, FUNTYPE, SIZE) 0
647
648 /* Define a data type for recording info about an argument list
649 during the scan of that argument list. This data type should
650 hold all necessary information about the function itself
651 and about the args processed so far, enough to enable macros
652 such as FUNCTION_ARG to determine where the next arg should go. */
653 #define CUMULATIVE_ARGS int
654
655 /* Initialize a variable CUM of type CUMULATIVE_ARGS
656 for a call to a function whose data type is FNTYPE.
657 For a library call, FNTYPE is 0. */
658 #define INIT_CUMULATIVE_ARGS(CUM,FNTYPE,LIBNAME,INDIRECT) \
659 ((CUM) = 0)
660
661 /* The number of registers used for parameter passing. Local to this file. */
662 #define MAX_ARC_PARM_REGS 8
663
664 /* 1 if N is a possible register number for function argument passing. */
665 #define FUNCTION_ARG_REGNO_P(N) \
666 ((unsigned) (N) < MAX_ARC_PARM_REGS)
667
668 /* The ROUND_ADVANCE* macros are local to this file. */
669 /* Round SIZE up to a word boundary. */
670 #define ROUND_ADVANCE(SIZE) \
671 (((SIZE) + UNITS_PER_WORD - 1) / UNITS_PER_WORD)
672
673 /* Round arg MODE/TYPE up to the next word boundary. */
674 #define ROUND_ADVANCE_ARG(MODE, TYPE) \
675 ((MODE) == BLKmode \
676 ? ROUND_ADVANCE (int_size_in_bytes (TYPE)) \
677 : ROUND_ADVANCE (GET_MODE_SIZE (MODE)))
678
679 /* Round CUM up to the necessary point for argument MODE/TYPE. */
680 #define ROUND_ADVANCE_CUM(CUM, MODE, TYPE) \
681 ((((MODE) == BLKmode ? TYPE_ALIGN (TYPE) : GET_MODE_BITSIZE (MODE)) \
682 > BITS_PER_WORD) \
683 ? (((CUM) + 1) & ~1) \
684 : (CUM))
685
686 /* Return boolean indicating arg of type TYPE and mode MODE will be passed in
687 a reg. This includes arguments that have to be passed by reference as the
688 pointer to them is passed in a reg if one is available (and that is what
689 we're given).
690 When passing arguments NAMED is always 1. When receiving arguments NAMED
691 is 1 for each argument except the last in a stdarg/varargs function. In
692 a stdarg function we want to treat the last named arg as named. In a
693 varargs function we want to treat the last named arg (which is
694 `__builtin_va_alist') as unnamed.
695 This macro is only used in this file. */
696 #define PASS_IN_REG_P(CUM, MODE, TYPE, NAMED) \
697 ((!current_function_varargs || (NAMED)) \
698 && (CUM) < MAX_ARC_PARM_REGS \
699 && ((ROUND_ADVANCE_CUM ((CUM), (MODE), (TYPE)) \
700 + ROUND_ADVANCE_ARG ((MODE), (TYPE)) \
701 <= MAX_ARC_PARM_REGS)))
702
703 /* Determine where to put an argument to a function.
704 Value is zero to push the argument on the stack,
705 or a hard register in which to store the argument.
706
707 MODE is the argument's machine mode.
708 TYPE is the data type of the argument (as a tree).
709 This is null for libcalls where that information may
710 not be available.
711 CUM is a variable of type CUMULATIVE_ARGS which gives info about
712 the preceding args and about the function being called.
713 NAMED is nonzero if this argument is a named parameter
714 (otherwise it is an extra parameter matching an ellipsis). */
715 /* On the ARC the first MAX_ARC_PARM_REGS args are normally in registers
716 and the rest are pushed. */
717 #define FUNCTION_ARG(CUM, MODE, TYPE, NAMED) \
718 (PASS_IN_REG_P ((CUM), (MODE), (TYPE), (NAMED)) \
719 ? gen_rtx_REG ((MODE), ROUND_ADVANCE_CUM ((CUM), (MODE), (TYPE))) \
720 : 0)
721
722 /* A C expression for the number of words, at the beginning of an
723 argument, must be put in registers. The value must be zero for
724 arguments that are passed entirely in registers or that are entirely
725 pushed on the stack.
726
727 On some machines, certain arguments must be passed partially in
728 registers and partially in memory. On these machines, typically the
729 first @var{n} words of arguments are passed in registers, and the rest
730 on the stack. If a multi-word argument (a @code{double} or a
731 structure) crosses that boundary, its first few words must be passed
732 in registers and the rest must be pushed. This macro tells the
733 compiler when this occurs, and how many of the words should go in
734 registers. */
735 #define FUNCTION_ARG_PARTIAL_NREGS(CUM, MODE, TYPE, NAMED) 0
736
737 /* A C expression that indicates when an argument must be passed by
738 reference. If nonzero for an argument, a copy of that argument is
739 made in memory and a pointer to the argument is passed instead of
740 the argument itself. The pointer is passed in whatever way is
741 appropriate for passing a pointer to that type. */
742 /* All aggregates and arguments greater than 8 bytes are passed this way. */
743 #define FUNCTION_ARG_PASS_BY_REFERENCE(CUM, MODE, TYPE, NAMED) \
744 (TYPE \
745 && (AGGREGATE_TYPE_P (TYPE) \
746 || int_size_in_bytes (TYPE) > 8))
747
748 /* A C expression that indicates when it is the called function's
749 responsibility to make copies of arguments passed by reference.
750 If the callee can determine that the argument won't be modified, it can
751 avoid the copy. */
752 /* ??? We'd love to be able to use NAMED here. Unfortunately, it doesn't
753 include the last named argument so we keep track of the args ourselves. */
754
755 #define FUNCTION_ARG_CALLEE_COPIES(CUM, MODE, TYPE, NAMED) \
756 FUNCTION_ARG_PASS_BY_REFERENCE ((CUM), (MODE), (TYPE), (NAMED))
757
758 /* Update the data in CUM to advance over an argument
759 of mode MODE and data type TYPE.
760 (TYPE is null for libcalls where that information may not be available.) */
761 #define FUNCTION_ARG_ADVANCE(CUM, MODE, TYPE, NAMED) \
762 ((CUM) = (ROUND_ADVANCE_CUM ((CUM), (MODE), (TYPE)) \
763 + ROUND_ADVANCE_ARG ((MODE), (TYPE))))
764
765 /* If defined, a C expression that gives the alignment boundary, in bits,
766 of an argument with the specified mode and type. If it is not defined,
767 PARM_BOUNDARY is used for all arguments. */
768 #define FUNCTION_ARG_BOUNDARY(MODE, TYPE) \
769 (((TYPE) ? TYPE_ALIGN (TYPE) : GET_MODE_BITSIZE (MODE)) <= PARM_BOUNDARY \
770 ? PARM_BOUNDARY \
771 : 2 * PARM_BOUNDARY)
772
773 /* This macro offers an alternative
774 to using `__builtin_saveregs' and defining the macro
775 `EXPAND_BUILTIN_SAVEREGS'. Use it to store the anonymous register
776 arguments into the stack so that all the arguments appear to have
777 been passed consecutively on the stack. Once this is done, you
778 can use the standard implementation of varargs that works for
779 machines that pass all their arguments on the stack.
780
781 The argument ARGS_SO_FAR is the `CUMULATIVE_ARGS' data structure,
782 containing the values that obtain after processing of the named
783 arguments. The arguments MODE and TYPE describe the last named
784 argument--its machine mode and its data type as a tree node.
785
786 The macro implementation should do two things: first, push onto the
787 stack all the argument registers *not* used for the named
788 arguments, and second, store the size of the data thus pushed into
789 the `int'-valued variable whose name is supplied as the argument
790 PRETEND_SIZE. The value that you store here will serve as
791 additional offset for setting up the stack frame.
792
793 If the argument NO_RTL is nonzero, it means that the
794 arguments of the function are being analyzed for the second time.
795 This happens for an inline function, which is not actually
796 compiled until the end of the source file. The macro
797 `SETUP_INCOMING_VARARGS' should not generate any instructions in
798 this case. */
799
800 #define SETUP_INCOMING_VARARGS(ARGS_SO_FAR, MODE, TYPE, PRETEND_SIZE, NO_RTL) \
801 arc_setup_incoming_varargs(&ARGS_SO_FAR, MODE, TYPE, &PRETEND_SIZE, NO_RTL)
802 \f
803 /* Function results. */
804
805 /* Define how to find the value returned by a function.
806 VALTYPE is the data type of the value (as a tree).
807 If the precise function being called is known, FUNC is its FUNCTION_DECL;
808 otherwise, FUNC is 0. */
809 #define FUNCTION_VALUE(VALTYPE, FUNC) gen_rtx_REG (TYPE_MODE (VALTYPE), 0)
810
811 /* Define how to find the value returned by a library function
812 assuming the value has mode MODE. */
813 #define LIBCALL_VALUE(MODE) gen_rtx_REG (MODE, 0)
814
815 /* 1 if N is a possible register number for a function value
816 as seen by the caller. */
817 /* ??? What about r1 in DI/DF values. */
818 #define FUNCTION_VALUE_REGNO_P(N) ((N) == 0)
819
820 /* A C expression which can inhibit the returning of certain function
821 values in registers, based on the type of value. A nonzero value says
822 to return the function value in memory, just as large structures are
823 always returned. Here TYPE will be a C expression of type `tree',
824 representing the data type of the value. */
825 #define RETURN_IN_MEMORY(TYPE) \
826 (AGGREGATE_TYPE_P (TYPE) \
827 || int_size_in_bytes (TYPE) > 8 \
828 || TREE_ADDRESSABLE (TYPE))
829
830 /* Tell GCC to use RETURN_IN_MEMORY. */
831 #define DEFAULT_PCC_STRUCT_RETURN 0
832
833 /* Register in which address to store a structure value
834 is passed to a function, or 0 to use `invisible' first argument. */
835 #define STRUCT_VALUE 0
836 \f
837 /* EXIT_IGNORE_STACK should be nonzero if, when returning from a function,
838 the stack pointer does not matter. The value is tested only in
839 functions that have frame pointers.
840 No definition is equivalent to always zero. */
841 #define EXIT_IGNORE_STACK 0
842
843 /* Epilogue delay slots. */
844 #define DELAY_SLOTS_FOR_EPILOGUE arc_delay_slots_for_epilogue ()
845
846 #define ELIGIBLE_FOR_EPILOGUE_DELAY(TRIAL, SLOTS_FILLED) \
847 arc_eligible_for_epilogue_delay (TRIAL, SLOTS_FILLED)
848
849 /* Output assembler code to FILE to increment profiler label # LABELNO
850 for profiling a function entry. */
851 #define FUNCTION_PROFILER(FILE, LABELNO)
852 \f
853 /* Trampolines. */
854 /* ??? This doesn't work yet because GCC will use as the address of a nested
855 function the address of the trampoline. We need to use that address
856 right shifted by 2. It looks like we'll need PSImode after all. :-( */
857
858 /* Output assembler code for a block containing the constant parts
859 of a trampoline, leaving space for the variable parts. */
860 /* On the ARC, the trampoline is quite simple as we have 32 bit immediate
861 constants.
862
863 mov r24,STATIC
864 j.nd FUNCTION
865 */
866 #define TRAMPOLINE_TEMPLATE(FILE) \
867 do { \
868 ASM_OUTPUT_INT (FILE, GEN_INT (0x631f7c00)); \
869 ASM_OUTPUT_INT (FILE, const0_rtx); \
870 ASM_OUTPUT_INT (FILE, GEN_INT (0x381f0000)); \
871 ASM_OUTPUT_INT (FILE, const0_rtx); \
872 } while (0)
873
874 /* Length in units of the trampoline for entering a nested function. */
875 #define TRAMPOLINE_SIZE 16
876
877 /* Emit RTL insns to initialize the variable parts of a trampoline.
878 FNADDR is an RTX for the address of the function's pure code.
879 CXT is an RTX for the static chain value for the function. */
880 #define INITIALIZE_TRAMPOLINE(TRAMP, FNADDR, CXT) \
881 do { \
882 emit_move_insn (gen_rtx_MEM (SImode, plus_constant (TRAMP, 4)), CXT); \
883 emit_move_insn (gen_rtx_MEM (SImode, plus_constant (TRAMP, 12)), FNADDR); \
884 emit_insn (gen_flush_icache (validize_mem (gen_rtx_MEM (SImode, TRAMP)))); \
885 } while (0)
886 \f
887 /* Library calls. */
888
889 /* Generate calls to memcpy, memcmp and memset. */
890 #define TARGET_MEM_FUNCTIONS
891 \f
892 /* Addressing modes, and classification of registers for them. */
893
894 /* Maximum number of registers that can appear in a valid memory address. */
895 /* The `ld' insn allows 2, but the `st' insn only allows 1. */
896 #define MAX_REGS_PER_ADDRESS 1
897
898 /* We have pre inc/dec (load/store with update). */
899 #define HAVE_PRE_INCREMENT 1
900 #define HAVE_PRE_DECREMENT 1
901
902 /* Recognize any constant value that is a valid address. */
903 #define CONSTANT_ADDRESS_P(X) \
904 (GET_CODE (X) == LABEL_REF || GET_CODE (X) == SYMBOL_REF \
905 || GET_CODE (X) == CONST_INT || GET_CODE (X) == CONST)
906
907 /* Nonzero if the constant value X is a legitimate general operand.
908 We can handle any 32 or 64 bit constant. */
909 /* "1" should work since the largest constant should be a 64 bit critter. */
910 /* ??? Not sure what to do for 64x32 compiler. */
911 #define LEGITIMATE_CONSTANT_P(X) 1
912
913 /* The macros REG_OK_FOR..._P assume that the arg is a REG rtx
914 and check its validity for a certain class.
915 We have two alternate definitions for each of them.
916 The usual definition accepts all pseudo regs; the other rejects
917 them unless they have been allocated suitable hard regs.
918 The symbol REG_OK_STRICT causes the latter definition to be used.
919
920 Most source files want to accept pseudo regs in the hope that
921 they will get allocated to the class that the insn wants them to be in.
922 Source files for reload pass need to be strict.
923 After reload, it makes no difference, since pseudo regs have
924 been eliminated by then. */
925
926 #ifndef REG_OK_STRICT
927
928 /* Nonzero if X is a hard reg that can be used as an index
929 or if it is a pseudo reg. */
930 #define REG_OK_FOR_INDEX_P(X) \
931 ((unsigned) REGNO (X) - 29 >= FIRST_PSEUDO_REGISTER - 29)
932 /* Nonzero if X is a hard reg that can be used as a base reg
933 or if it is a pseudo reg. */
934 #define REG_OK_FOR_BASE_P(X) \
935 ((unsigned) REGNO (X) - 29 >= FIRST_PSEUDO_REGISTER - 29)
936
937 #else
938
939 /* Nonzero if X is a hard reg that can be used as an index. */
940 #define REG_OK_FOR_INDEX_P(X) REGNO_OK_FOR_INDEX_P (REGNO (X))
941 /* Nonzero if X is a hard reg that can be used as a base reg. */
942 #define REG_OK_FOR_BASE_P(X) REGNO_OK_FOR_BASE_P (REGNO (X))
943
944 #endif
945
946 /* GO_IF_LEGITIMATE_ADDRESS recognizes an RTL expression
947 that is a valid memory address for an instruction.
948 The MODE argument is the machine mode for the MEM expression
949 that wants to use this address. */
950 /* The `ld' insn allows [reg],[reg+shimm],[reg+limm],[reg+reg],[limm]
951 but the `st' insn only allows [reg],[reg+shimm],[limm].
952 The only thing we can do is only allow the most strict case `st' and hope
953 other parts optimize out the restrictions for `ld'. */
954
955 /* local to this file */
956 #define RTX_OK_FOR_BASE_P(X) \
957 (REG_P (X) && REG_OK_FOR_BASE_P (X))
958
959 /* local to this file */
960 #define RTX_OK_FOR_INDEX_P(X) \
961 (0 && /*???*/ REG_P (X) && REG_OK_FOR_INDEX_P (X))
962
963 /* local to this file */
964 /* ??? Loads can handle any constant, stores can only handle small ones. */
965 #define RTX_OK_FOR_OFFSET_P(X) \
966 (GET_CODE (X) == CONST_INT && SMALL_INT (INTVAL (X)))
967
968 #define LEGITIMATE_OFFSET_ADDRESS_P(MODE, X) \
969 (GET_CODE (X) == PLUS \
970 && RTX_OK_FOR_BASE_P (XEXP (X, 0)) \
971 && (RTX_OK_FOR_INDEX_P (XEXP (X, 1)) \
972 || RTX_OK_FOR_OFFSET_P (XEXP (X, 1))))
973
974 #define GO_IF_LEGITIMATE_ADDRESS(MODE, X, ADDR) \
975 { if (RTX_OK_FOR_BASE_P (X)) \
976 goto ADDR; \
977 if (LEGITIMATE_OFFSET_ADDRESS_P ((MODE), (X))) \
978 goto ADDR; \
979 if (GET_CODE (X) == CONST_INT && LARGE_INT (INTVAL (X))) \
980 goto ADDR; \
981 if (GET_CODE (X) == SYMBOL_REF \
982 || GET_CODE (X) == LABEL_REF \
983 || GET_CODE (X) == CONST) \
984 goto ADDR; \
985 if ((GET_CODE (X) == PRE_DEC || GET_CODE (X) == PRE_INC) \
986 /* We're restricted here by the `st' insn. */ \
987 && RTX_OK_FOR_BASE_P (XEXP ((X), 0))) \
988 goto ADDR; \
989 }
990
991 /* Try machine-dependent ways of modifying an illegitimate address
992 to be legitimate. If we find one, return the new, valid address.
993 This macro is used in only one place: `memory_address' in explow.c.
994
995 OLDX is the address as it was before break_out_memory_refs was called.
996 In some cases it is useful to look at this to decide what needs to be done.
997
998 MODE and WIN are passed so that this macro can use
999 GO_IF_LEGITIMATE_ADDRESS.
1000
1001 It is always safe for this macro to do nothing. It exists to recognize
1002 opportunities to optimize the output. */
1003
1004 #define LEGITIMIZE_ADDRESS(X, OLDX, MODE, WIN)
1005
1006 /* Go to LABEL if ADDR (a legitimate address expression)
1007 has an effect that depends on the machine mode it is used for. */
1008 #define GO_IF_MODE_DEPENDENT_ADDRESS(ADDR, LABEL) \
1009 { if (GET_CODE (ADDR) == PRE_DEC) \
1010 goto LABEL; \
1011 if (GET_CODE (ADDR) == PRE_INC) \
1012 goto LABEL; \
1013 }
1014 \f
1015 /* Condition code usage. */
1016
1017 /* Some insns set all condition code flags, some only set the ZNC flags, and
1018 some only set the ZN flags. */
1019
1020 #define EXTRA_CC_MODES \
1021 CC(CCZNCmode, "CCZNC") \
1022 CC(CCZNmode, "CCZN")
1023
1024 /* Given a comparison code (EQ, NE, etc.) and the first operand of a COMPARE,
1025 return the mode to be used for the comparison. */
1026 #define SELECT_CC_MODE(OP, X, Y) \
1027 arc_select_cc_mode (OP, X, Y)
1028
1029 /* Return non-zero if SELECT_CC_MODE will never return MODE for a
1030 floating point inequality comparison. */
1031 #define REVERSIBLE_CC_MODE(MODE) 1 /*???*/
1032 \f
1033 /* Costs. */
1034
1035 /* An insn is define to cost 4 "units", and we work from there.
1036 COSTS_N_INSNS (N) is defined as (N) * 4 - 2 so that seems reasonable.
1037 Some values are supposed to be defined relative to each other and thus
1038 aren't necessarily related to COSTS_N_INSNS. */
1039
1040 /* Compute the cost of computing a constant rtl expression RTX
1041 whose rtx-code is CODE. The body of this macro is a portion
1042 of a switch statement. If the code is computed here,
1043 return it with a return statement. Otherwise, break from the switch. */
1044 /* Small integers are as cheap as registers. 4 byte values can be fetched
1045 as immediate constants - let's give that the cost of an extra insn. */
1046 #define CONST_COSTS(X, CODE, OUTER_CODE) \
1047 case CONST_INT : \
1048 if (SMALL_INT (INTVAL (X))) \
1049 return 0; \
1050 /* fall through */ \
1051 case CONST : \
1052 case LABEL_REF : \
1053 case SYMBOL_REF : \
1054 return 4; \
1055 case CONST_DOUBLE : \
1056 { \
1057 rtx high, low; \
1058 split_double (X, &high, &low); \
1059 return 4 * (!SMALL_INT (INTVAL (high)) \
1060 + !SMALL_INT (INTVAL (low))); \
1061 }
1062
1063 /* Compute the cost of an address. */
1064 #define ADDRESS_COST(ADDR) (REG_P (ADDR) ? 1 : arc_address_cost (ADDR))
1065
1066 /* Compute extra cost of moving data between one register class
1067 and another. */
1068 #define REGISTER_MOVE_COST(MODE, CLASS1, CLASS2) 2
1069
1070 /* Compute the cost of moving data between registers and memory. */
1071 /* Memory is 3 times as expensive as registers.
1072 ??? Is that the right way to look at it? */
1073 #define MEMORY_MOVE_COST(MODE,CLASS,IN) \
1074 (GET_MODE_SIZE (MODE) <= UNITS_PER_WORD ? 6 : 12)
1075
1076 /* The cost of a branch insn. */
1077 /* ??? What's the right value here? Branches are certainly more
1078 expensive than reg->reg moves. */
1079 #define BRANCH_COST 2
1080
1081 /* Provide the costs of a rtl expression. This is in the body of a
1082 switch on CODE. The purpose for the cost of MULT is to encourage
1083 `synth_mult' to find a synthetic multiply when reasonable.
1084
1085 If we need more than 12 insns to do a multiply, then go out-of-line,
1086 since the call overhead will be < 10% of the cost of the multiply. */
1087 #define RTX_COSTS(X, CODE, OUTER_CODE) \
1088 case ASHIFT : \
1089 case ASHIFTRT : \
1090 case LSHIFTRT : \
1091 if (TARGET_SHIFTER) \
1092 return COSTS_N_INSNS (1); \
1093 if (GET_CODE (XEXP ((X), 1)) != CONST_INT) \
1094 return COSTS_N_INSNS (16); \
1095 return COSTS_N_INSNS (INTVAL (XEXP ((X), 1)));
1096
1097 /* Nonzero if access to memory by bytes is slow and undesirable.
1098 For RISC chips, it means that access to memory by bytes is no
1099 better than access by words when possible, so grab a whole word
1100 and maybe make use of that. */
1101 #define SLOW_BYTE_ACCESS 1
1102
1103 /* Define this macro if it is as good or better to call a constant
1104 function address than to call an address kept in a register. */
1105 /* On the ARC, calling through registers is slow. */
1106 #define NO_FUNCTION_CSE
1107
1108 /* Define this macro if it is as good or better for a function to call
1109 itself with an explicit address than to call an address kept in a
1110 register. */
1111 /* On the ARC, calling through registers is slow. */
1112 #define NO_RECURSIVE_FUNCTION_CSE
1113 \f
1114 /* Section selection. */
1115 /* WARNING: These section names also appear in dwarfout.c. */
1116
1117 /* The names of the text, data, and readonly-data sections are runtime
1118 selectable. */
1119
1120 #define ARC_SECTION_FORMAT "\t.section %s"
1121 #define ARC_DEFAULT_TEXT_SECTION ".text"
1122 #define ARC_DEFAULT_DATA_SECTION ".data"
1123 #define ARC_DEFAULT_RODATA_SECTION ".rodata"
1124
1125 extern const char *arc_text_section, *arc_data_section, *arc_rodata_section;
1126
1127 /* initfini.c uses this in an asm. */
1128 #if defined (CRT_INIT) || defined (CRT_FINI)
1129 #define TEXT_SECTION_ASM_OP "\t.section .text"
1130 #else
1131 #define TEXT_SECTION_ASM_OP arc_text_section /*"\t.section .text"*/
1132 #endif
1133 #define DATA_SECTION_ASM_OP arc_data_section /*"\t.section .data"*/
1134
1135 #undef CONST_SECTION_ASM_OP
1136 #define CONST_SECTION_ASM_OP arc_rodata_section /*"\t.section .rodata"*/
1137
1138 #define BSS_SECTION_ASM_OP "\t.section .bss"
1139
1140 /* Define this macro if jump tables (for tablejump insns) should be
1141 output in the text section, along with the assembler instructions.
1142 Otherwise, the readonly data section is used.
1143 This macro is irrelevant if there is no separate readonly data section. */
1144 /*#define JUMP_TABLES_IN_TEXT_SECTION*/
1145
1146 /* Define this macro if references to a symbol must be treated
1147 differently depending on something about the variable or
1148 function named by the symbol (such as what section it is in).
1149
1150 The macro definition, if any, is executed immediately after the
1151 rtl for DECL or other node is created.
1152 The value of the rtl will be a `mem' whose address is a
1153 `symbol_ref'.
1154
1155 The usual thing for this macro to do is to store a flag in the
1156 `symbol_ref' (such as `SYMBOL_REF_FLAG') or to store a modified
1157 name string in the `symbol_ref' (if one bit is not enough
1158 information). */
1159
1160 /* On the ARC, function addresses are not the same as normal addresses.
1161 Branch to absolute address insns take an address that is right-shifted
1162 by 2. We encode the fact that we have a function here, and then emit a
1163 special assembler op when outputting the address. */
1164 #define ENCODE_SECTION_INFO(DECL) \
1165 do { \
1166 if (TREE_CODE (DECL) == FUNCTION_DECL) \
1167 SYMBOL_REF_FLAG (XEXP (DECL_RTL (DECL), 0)) = 1; \
1168 } while (0)
1169
1170 /* Decode SYM_NAME and store the real name part in VAR, sans
1171 the characters that encode section info. Define this macro if
1172 ENCODE_SECTION_INFO alters the symbol's name string. */
1173 /*#define STRIP_NAME_ENCODING(VAR, SYM_NAME)*/
1174
1175 /* For DWARF. Marginally different than default so output is "prettier"
1176 (and consistent with above). */
1177 #define PUSHSECTION_ASM_OP "\t.section "
1178
1179 /* Tell crtstuff.c we're using ELF. */
1180 #define OBJECT_FORMAT_ELF
1181 \f
1182 /* PIC */
1183
1184 /* The register number of the register used to address a table of static
1185 data addresses in memory. In some cases this register is defined by a
1186 processor's ``application binary interface'' (ABI). When this macro
1187 is defined, RTL is generated for this register once, as with the stack
1188 pointer and frame pointer registers. If this macro is not defined, it
1189 is up to the machine-dependent files to allocate such a register (if
1190 necessary). */
1191 #define PIC_OFFSET_TABLE_REGNUM 26
1192
1193 /* Define this macro if the register defined by PIC_OFFSET_TABLE_REGNUM is
1194 clobbered by calls. Do not define this macro if PIC_OFFSET_TABLE_REGNUM
1195 is not defined. */
1196 /* This register is call-saved on the ARC. */
1197 /*#define PIC_OFFSET_TABLE_REG_CALL_CLOBBERED*/
1198
1199 /* By generating position-independent code, when two different programs (A
1200 and B) share a common library (libC.a), the text of the library can be
1201 shared whether or not the library is linked at the same address for both
1202 programs. In some of these environments, position-independent code
1203 requires not only the use of different addressing modes, but also
1204 special code to enable the use of these addressing modes.
1205
1206 The FINALIZE_PIC macro serves as a hook to emit these special
1207 codes once the function is being compiled into assembly code, but not
1208 before. (It is not done before, because in the case of compiling an
1209 inline function, it would lead to multiple PIC prologues being
1210 included in functions which used inline functions and were compiled to
1211 assembly language.) */
1212
1213 #define FINALIZE_PIC arc_finalize_pic ()
1214
1215 /* A C expression that is nonzero if X is a legitimate immediate
1216 operand on the target machine when generating position independent code.
1217 You can assume that X satisfies CONSTANT_P, so you need not
1218 check this. You can also assume `flag_pic' is true, so you need not
1219 check it either. You need not define this macro if all constants
1220 (including SYMBOL_REF) can be immediate operands when generating
1221 position independent code. */
1222 /*#define LEGITIMATE_PIC_OPERAND_P(X)*/
1223 \f
1224 /* Control the assembler format that we output. */
1225
1226 /* Output at beginning of assembler file. */
1227 #undef ASM_FILE_START
1228 #define ASM_FILE_START(FILE) arc_asm_file_start (FILE)
1229
1230 /* A C string constant describing how to begin a comment in the target
1231 assembler language. The compiler assumes that the comment will
1232 end at the end of the line. */
1233 #define ASM_COMMENT_START ";"
1234
1235 /* Output to assembler file text saying following lines
1236 may contain character constants, extra white space, comments, etc. */
1237 #define ASM_APP_ON ""
1238
1239 /* Output to assembler file text saying following lines
1240 no longer contain unusual constructs. */
1241 #define ASM_APP_OFF ""
1242
1243 /* This is how to output an assembler line defining a `char' constant. */
1244 #define ASM_OUTPUT_CHAR(FILE, VALUE) \
1245 ( fprintf (FILE, "\t.byte\t"), \
1246 output_addr_const (FILE, (VALUE)), \
1247 fprintf (FILE, "\n"))
1248
1249 /* This is how to output an assembler line defining a `short' constant. */
1250 #define ASM_OUTPUT_SHORT(FILE, VALUE) \
1251 ( fprintf (FILE, "\t.hword\t"), \
1252 output_addr_const (FILE, (VALUE)), \
1253 fprintf (FILE, "\n"))
1254
1255 /* This is how to output an assembler line defining an `int' constant.
1256 We also handle symbol output here. Code addresses must be right shifted
1257 by 2 because that's how the jump instruction wants them. */
1258 #define ASM_OUTPUT_INT(FILE, VALUE) \
1259 do { \
1260 fprintf (FILE, "\t.word\t"); \
1261 if ((GET_CODE (VALUE) == SYMBOL_REF && SYMBOL_REF_FLAG (VALUE)) \
1262 || GET_CODE (VALUE) == LABEL_REF) \
1263 { \
1264 fprintf (FILE, "%%st("); \
1265 output_addr_const (FILE, (VALUE)); \
1266 fprintf (FILE, ")"); \
1267 } \
1268 else \
1269 output_addr_const (FILE, (VALUE)); \
1270 fprintf (FILE, "\n"); \
1271 } while (0)
1272
1273 /* This is how to output an assembler line defining a `float' constant. */
1274 #define ASM_OUTPUT_FLOAT(FILE, VALUE) \
1275 { \
1276 long t; \
1277 char str[30]; \
1278 REAL_VALUE_TO_TARGET_SINGLE ((VALUE), t); \
1279 REAL_VALUE_TO_DECIMAL ((VALUE), "%.20e", str); \
1280 fprintf (FILE, "\t.word\t0x%lx %s %s\n", \
1281 t, ASM_COMMENT_START, str); \
1282 }
1283
1284 /* This is how to output an assembler line defining a `double' constant. */
1285 #define ASM_OUTPUT_DOUBLE(FILE, VALUE) \
1286 { \
1287 long t[2]; \
1288 char str[30]; \
1289 REAL_VALUE_TO_TARGET_DOUBLE ((VALUE), t); \
1290 REAL_VALUE_TO_DECIMAL ((VALUE), "%.20e", str); \
1291 fprintf (FILE, "\t.word\t0x%lx %s %s\n\t.word\t0x%lx\n", \
1292 t[0], ASM_COMMENT_START, str, t[1]); \
1293 }
1294
1295 /* This is how to output an assembler line for a numeric constant byte. */
1296 #define ASM_BYTE_OP "\t.byte\t"
1297 #define ASM_OUTPUT_BYTE(FILE, VALUE) \
1298 fprintf (FILE, "%s0x%x\n", ASM_BYTE_OP, (VALUE))
1299
1300 /* This is how to output the definition of a user-level label named NAME,
1301 such as the label on a static function or variable NAME. */
1302 #define ASM_OUTPUT_LABEL(FILE, NAME) \
1303 do { assemble_name (FILE, NAME); fputs (":\n", FILE); } while (0)
1304
1305 /* This is how to output a command to make the user-level label named NAME
1306 defined for reference from other files. */
1307 #define ASM_GLOBALIZE_LABEL(FILE, NAME) \
1308 do { \
1309 fputs ("\t.global\t", FILE); \
1310 assemble_name (FILE, NAME); \
1311 fputs ("\n", FILE); \
1312 } while (0)
1313
1314 /* A C statement (sans semicolon) to output on FILE an assembler pseudo-op to
1315 declare a library function name external. The name of the library function
1316 is given by SYMREF, which has type RTX and is a SYMBOL_REF. */
1317 #if 0
1318 /* On the ARC we want to have libgcc's for multiple cpus in one binary.
1319 We can't use `assemble_name' here as that will call ASM_OUTPUT_LABELREF
1320 and we'll get another suffix added on if -mmangle-cpu. */
1321 extern const char *arc_mangle_cpu;
1322 #define ASM_OUTPUT_EXTERNAL_LIBCALL(FILE, SYMREF) \
1323 do { \
1324 if (TARGET_MANGLE_CPU_LIBGCC) \
1325 { \
1326 fprintf (FILE, "\t.rename\t_%s, _%s%s\n", \
1327 XSTR (SYMREF, 0), XSTR (SYMREF, 0), \
1328 arc_mangle_suffix); \
1329 } \
1330 } while (0)
1331 #endif
1332
1333 /* This is how to output a reference to a user-level label named NAME.
1334 `assemble_name' uses this. */
1335 /* We mangle all user labels to provide protection from linking code
1336 compiled for different cpus. */
1337 /* We work around a dwarfout.c deficiency by watching for labels from it and
1338 not adding the '_' prefix nor the cpu suffix. There is a comment in
1339 dwarfout.c that says it should be using ASM_OUTPUT_INTERNAL_LABEL. */
1340 extern const char *arc_mangle_cpu;
1341 #define ASM_OUTPUT_LABELREF(FILE, NAME) \
1342 do { \
1343 if ((NAME)[0] == '.' && (NAME)[1] == 'L') \
1344 fprintf (FILE, "%s", NAME); \
1345 else \
1346 { \
1347 fputc ('_', FILE); \
1348 if (TARGET_MANGLE_CPU && arc_mangle_cpu != NULL) \
1349 fprintf (FILE, "%s_", arc_mangle_cpu); \
1350 fprintf (FILE, "%s", NAME); \
1351 } \
1352 } while (0)
1353
1354 /* This is how to output a definition of an internal numbered label where
1355 PREFIX is the class of label and NUM is the number within the class. */
1356 #undef ASM_OUTPUT_INTERNAL_LABEL
1357 #define ASM_OUTPUT_INTERNAL_LABEL(FILE, PREFIX, NUM) \
1358 do { \
1359 arc_ccfsm_at_label (PREFIX, NUM); \
1360 fprintf (FILE, ".%s%d:\n", PREFIX, NUM); \
1361 } while (0)
1362
1363 /* Store in OUTPUT a string (made with alloca) containing
1364 an assembler-name for a local static variable named NAME.
1365 LABELNO is an integer which is different for each call. */
1366 #define ASM_FORMAT_PRIVATE_NAME(OUTPUT, NAME, LABELNO) \
1367 ( (OUTPUT) = (char *) alloca (strlen ((NAME)) + 10), \
1368 sprintf ((OUTPUT), "%s.%d", (NAME), (LABELNO)))
1369
1370 /* Assembler pseudo-op to equate one value with another. */
1371 /* ??? This is needed because dwarfout.c provides a default definition too
1372 late for defaults.h (which contains the default definition of ASM_OUTPUT_DEF
1373 that we use). */
1374 #define SET_ASM_OP "\t.set\t"
1375
1376 /* A C statement (sans semicolon) to output an element in the table of
1377 global constructors. */
1378 #undef ASM_OUTPUT_CONSTRUCTOR
1379 #define ASM_OUTPUT_CONSTRUCTOR(FILE, NAME) \
1380 do { \
1381 ctors_section (); \
1382 fprintf (FILE, "\t.word\t%%st("); \
1383 assemble_name (FILE, NAME); \
1384 fprintf (FILE, ")\n"); \
1385 } while (0)
1386
1387 /* A C statement (sans semicolon) to output an element in the table of
1388 global destructors. */
1389 #undef ASM_OUTPUT_DESTRUCTOR
1390 #define ASM_OUTPUT_DESTRUCTOR(FILE, NAME) \
1391 do { \
1392 dtors_section (); \
1393 fprintf (FILE, "\t.word\t%%st("); \
1394 assemble_name (FILE, NAME); \
1395 fprintf (FILE, ")\n"); \
1396 } while (0)
1397
1398 /* How to refer to registers in assembler output.
1399 This sequence is indexed by compiler's hard-register-number (see above). */
1400 #define REGISTER_NAMES \
1401 {"r0", "r1", "r2", "r3", "r4", "r5", "r6", "r7", \
1402 "r8", "r9", "r10", "r11", "r12", "r13", "r14", "r15", \
1403 "r16", "r17", "r18", "r19", "r20", "r21", "r22", "r23", \
1404 "r24", "r25", "r26", "fp", "sp", "ilink1", "ilink2", "blink", \
1405 "r32", "r33", "r34", "r35", "r36", "r37", "r38", "r39", \
1406 "r40", "r41", "r42", "r43", "r44", "r45", "r46", "r47", \
1407 "r48", "r49", "r50", "r51", "r52", "r53", "r54", "r55", \
1408 "r56", "r57", "r58", "r59", "lp_count", "cc"}
1409
1410 /* Entry to the insn conditionalizer. */
1411 #define FINAL_PRESCAN_INSN(INSN, OPVEC, NOPERANDS) \
1412 arc_final_prescan_insn (INSN, OPVEC, NOPERANDS)
1413
1414 /* A C expression which evaluates to true if CODE is a valid
1415 punctuation character for use in the `PRINT_OPERAND' macro. */
1416 extern char arc_punct_chars[];
1417 #define PRINT_OPERAND_PUNCT_VALID_P(CHAR) \
1418 arc_punct_chars[(unsigned char) (CHAR)]
1419
1420 /* Print operand X (an rtx) in assembler syntax to file FILE.
1421 CODE is a letter or dot (`z' in `%z0') or 0 if no letter was specified.
1422 For `%' followed by punctuation, CODE is the punctuation and X is null. */
1423 #define PRINT_OPERAND(FILE, X, CODE) \
1424 arc_print_operand (FILE, X, CODE)
1425
1426 /* A C compound statement to output to stdio stream STREAM the
1427 assembler syntax for an instruction operand that is a memory
1428 reference whose address is ADDR. ADDR is an RTL expression.
1429
1430 On some machines, the syntax for a symbolic address depends on
1431 the section that the address refers to. On these machines,
1432 define the macro `ENCODE_SECTION_INFO' to store the information
1433 into the `symbol_ref', and then check for it here. */
1434 #define PRINT_OPERAND_ADDRESS(FILE, ADDR) \
1435 arc_print_operand_address (FILE, ADDR)
1436
1437 /* This is how to output an element of a case-vector that is absolute. */
1438 #define ASM_OUTPUT_ADDR_VEC_ELT(FILE, VALUE) \
1439 do { \
1440 char label[30]; \
1441 ASM_GENERATE_INTERNAL_LABEL (label, "L", VALUE); \
1442 fprintf (FILE, "\t.word %%st("); \
1443 assemble_name (FILE, label); \
1444 fprintf (FILE, ")\n"); \
1445 } while (0)
1446
1447 /* This is how to output an element of a case-vector that is relative. */
1448 #define ASM_OUTPUT_ADDR_DIFF_ELT(FILE, BODY, VALUE, REL) \
1449 do { \
1450 char label[30]; \
1451 ASM_GENERATE_INTERNAL_LABEL (label, "L", VALUE); \
1452 fprintf (FILE, "\t.word %%st("); \
1453 assemble_name (FILE, label); \
1454 fprintf (FILE, "-"); \
1455 ASM_GENERATE_INTERNAL_LABEL (label, "L", REL); \
1456 assemble_name (FILE, label); \
1457 fprintf (FILE, ")\n"); \
1458 } while (0)
1459
1460 /* The desired alignment for the location counter at the beginning
1461 of a loop. */
1462 /* On the ARC, align loops to 32 byte boundaries (cache line size)
1463 if -malign-loops. */
1464 #define LOOP_ALIGN(LABEL) (TARGET_ALIGN_LOOPS ? 5 : 0)
1465
1466 /* This is how to output an assembler line
1467 that says to advance the location counter
1468 to a multiple of 2**LOG bytes. */
1469 #define ASM_OUTPUT_ALIGN(FILE,LOG) \
1470 do { if ((LOG) != 0) fprintf (FILE, "\t.align %d\n", 1 << (LOG)); } while (0)
1471 \f
1472 /* Debugging information. */
1473
1474 /* Generate DBX and DWARF debugging information. */
1475 #ifndef DBX_DEBUGGING_INFO
1476 #define DBX_DEBUGGING_INFO
1477 #endif
1478 #ifndef DWARF_DEBUGGING_INFO
1479 #define DWARF_DEBUGGING_INFO
1480 #endif
1481
1482 /* Prefer STABS (for now). */
1483 #undef PREFERRED_DEBUGGING_TYPE
1484 #define PREFERRED_DEBUGGING_TYPE DBX_DEBUG
1485
1486 /* How to renumber registers for dbx and gdb. */
1487 #define DBX_REGISTER_NUMBER(REGNO) (REGNO)
1488
1489 /* Turn off splitting of long stabs. */
1490 #define DBX_CONTIN_LENGTH 0
1491 \f
1492 /* Miscellaneous. */
1493
1494 /* Specify the machine mode that this machine uses
1495 for the index in the tablejump instruction. */
1496 #define CASE_VECTOR_MODE Pmode
1497
1498 /* Define as C expression which evaluates to nonzero if the tablejump
1499 instruction expects the table to contain offsets from the address of the
1500 table.
1501 Do not define this if the table should contain absolute addresses. */
1502 /* It's not clear what PIC will look like or whether we want to use -fpic
1503 for the embedded form currently being talked about. For now require -fpic
1504 to get pc relative switch tables. */
1505 /*#define CASE_VECTOR_PC_RELATIVE 1 */
1506
1507 /* Define if operations between registers always perform the operation
1508 on the full register even if a narrower mode is specified. */
1509 #define WORD_REGISTER_OPERATIONS
1510
1511 /* Define if loading in MODE, an integral mode narrower than BITS_PER_WORD
1512 will either zero-extend or sign-extend. The value of this macro should
1513 be the code that says which one of the two operations is implicitly
1514 done, NIL if none. */
1515 #define LOAD_EXTEND_OP(MODE) ZERO_EXTEND
1516
1517 /* Specify the tree operation to be used to convert reals to integers. */
1518 #define IMPLICIT_FIX_EXPR FIX_ROUND_EXPR
1519
1520 /* This is the kind of divide that is easiest to do in the general case. */
1521 #define EASY_DIV_EXPR TRUNC_DIV_EXPR
1522
1523 /* Max number of bytes we can move from memory to memory
1524 in one reasonably fast instruction. */
1525 #define MOVE_MAX 4
1526
1527 /* Define this to be nonzero if shift instructions ignore all but the low-order
1528 few bits. */
1529 #define SHIFT_COUNT_TRUNCATED 1
1530
1531 /* Value is 1 if truncating an integer of INPREC bits to OUTPREC bits
1532 is done just by pretending it is already truncated. */
1533 #define TRULY_NOOP_TRUNCATION(OUTPREC, INPREC) 1
1534
1535 /* We assume that the store-condition-codes instructions store 0 for false
1536 and some other value for true. This is the value stored for true. */
1537 #define STORE_FLAG_VALUE 1
1538
1539 /* Specify the machine mode that pointers have.
1540 After generation of rtl, the compiler makes no further distinction
1541 between pointers and any other objects of this machine mode. */
1542 /* ??? The arc doesn't have full 32 bit pointers, but making this PSImode has
1543 its own problems (you have to add extendpsisi2 and trucnsipsi2 but how does
1544 one do it without getting excess code?). Try to avoid it. */
1545 #define Pmode SImode
1546
1547 /* A function address in a call instruction. */
1548 #define FUNCTION_MODE SImode
1549
1550 /* alloca should avoid clobbering the old register save area. */
1551 /* ??? Not defined in tm.texi. */
1552 #define SETJMP_VIA_SAVE_AREA
1553 \f
1554 /* Define the information needed to generate branch and scc insns. This is
1555 stored from the compare operation. Note that we can't use "rtx" here
1556 since it hasn't been defined! */
1557 extern struct rtx_def *arc_compare_op0, *arc_compare_op1;
1558
1559 /* ARC function types. */
1560 enum arc_function_type {
1561 ARC_FUNCTION_UNKNOWN, ARC_FUNCTION_NORMAL,
1562 /* These are interrupt handlers. The name corresponds to the register
1563 name that contains the return address. */
1564 ARC_FUNCTION_ILINK1, ARC_FUNCTION_ILINK2
1565 };
1566 #define ARC_INTERRUPT_P(TYPE) \
1567 ((TYPE) == ARC_FUNCTION_ILINK1 || (TYPE) == ARC_FUNCTION_ILINK2)
1568 /* Compute the type of a function from its DECL. */
1569
1570 \f
1571 /* Implement `va_start' for varargs and stdarg. */
1572 #define EXPAND_BUILTIN_VA_START(stdarg, valist, nextarg) \
1573 arc_va_start (stdarg, valist, nextarg)
1574
1575 /* Implement `va_arg'. */
1576 #define EXPAND_BUILTIN_VA_ARG(valist, type) \
1577 arc_va_arg (valist, type)