]> gcc.gnu.org Git - gcc.git/blame - gcc/config/ia64/ia64.h
Revert unapproved changes that were inadvertanly brought in with the previous
[gcc.git] / gcc / config / ia64 / ia64.h
CommitLineData
c65ebc55 1/* Definitions of target machine GNU compiler. IA64 version.
be480cec 2 Copyright (C) 2000 Free Software Foundation, Inc.
c65ebc55
JW
3 Contributed by James E. Wilson <wilson@cygnus.com> and
4 David Mosberger <davidm@hpl.hp.com>.
5
6This file is part of GNU CC.
7
8GNU CC is free software; you can redistribute it and/or modify
9it under the terms of the GNU General Public License as published by
10the Free Software Foundation; either version 2, or (at your option)
11any later version.
12
13GNU CC is distributed in the hope that it will be useful,
14but WITHOUT ANY WARRANTY; without even the implied warranty of
15MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16GNU General Public License for more details.
17
18You should have received a copy of the GNU General Public License
19along with GNU CC; see the file COPYING. If not, write to
20the Free Software Foundation, 59 Temple Place - Suite 330,
21Boston, MA 02111-1307, USA. */
22
23/* ??? Use of the upper 32 FP registers for integer values will make context
24 switching slower, because the kernel only saves any registers past f32 if
25 it has to. */
26
27/* ??? Look at ABI group documents for list of preprocessor macros and
28 other features required for ABI compliance. */
29
30/* ??? Functions containing a non-local goto target save many registers. Why?
31 See for instance execute/920428-2.c. */
32
33/* ??? Get CAN_DEBUG_WITHOUT_FP working so that -fomit-frame-pointer is not
34 needed. */
35
36/* ??? Add support for short data/bss sections. */
37
38\f
39/* Run-time target specifications */
40
41/* Define this to be a string constant containing `-D' options to define the
42 predefined macros that identify this machine and system. These macros will
43 be predefined unless the `-ansi' option is specified. */
44/* ??? This is undefed in svr4.h. */
45#define CPP_PREDEFINES "-Dia64 -Amachine(ia64)"
46
47/* This declaration should be present. */
48extern int target_flags;
49
50/* This series of macros is to allow compiler command arguments to enable or
51 disable the use of optional features of the target machine. */
52
53#define MASK_BIG_ENDIAN 0x00000001 /* Generate big endian code. */
54
55#define MASK_GNU_AS 0x00000002 /* Generate code for GNU as. */
56
57#define MASK_GNU_LD 0x00000004 /* Generate code for GNU ld. */
58
59#define MASK_NO_PIC 0x00000008 /* Generate code without GP reg. */
60
61#define MASK_VOL_ASM_STOP 0x00000010 /* Emit stop bits for vol ext asm. */
62
63#define MASK_A_STEP 0x00000020 /* Emit code for Itanium A step. */
64
65#define MASK_REG_NAMES 0x00000040 /* Use in/loc/out register names. */
66
67#define MASK_NO_SDATA 0x00000080 /* Disable sdata/scommon/sbss. */
68
69#define MASK_DWARF2_ASM 0x40000000 /* test dwarf2 line info via gas. */
70
71#define TARGET_BIG_ENDIAN (target_flags & MASK_BIG_ENDIAN)
72
73#define TARGET_GNU_AS (target_flags & MASK_GNU_AS)
74
75#define TARGET_GNU_LD (target_flags & MASK_GNU_LD)
76
77#define TARGET_NO_PIC (target_flags & MASK_NO_PIC)
78
79#define TARGET_VOL_ASM_STOP (target_flags & MASK_VOL_ASM_STOP)
80
81#define TARGET_A_STEP (target_flags & MASK_A_STEP)
82
83#define TARGET_REG_NAMES (target_flags & MASK_REG_NAMES)
84
85#define TARGET_NO_SDATA (target_flags & MASK_NO_SDATA)
86
87#define TARGET_DWARF2_ASM (target_flags & MASK_DWARF2_ASM)
88
89/* This macro defines names of command options to set and clear bits in
90 `target_flags'. Its definition is an initializer with a subgrouping for
91 each command option. */
92
93#define TARGET_SWITCHES \
94{ \
95 { "big-endian", MASK_BIG_ENDIAN, \
96 "Generate big endian code" }, \
97 { "little-endian", -MASK_BIG_ENDIAN, \
98 "Generate little endian code" }, \
99 { "gnu-as", MASK_GNU_AS, \
100 "Generate code for GNU as" }, \
101 { "no-gnu-as", -MASK_GNU_AS, \
102 "Generate code for Intel as" }, \
103 { "gnu-ld", MASK_GNU_LD, \
104 "Generate code for GNU ld" }, \
105 { "no-gnu-ld", -MASK_GNU_LD, \
106 "Generate code for Intel ld" }, \
107 { "no-pic", MASK_NO_PIC, \
108 "Generate code without GP reg" }, \
109 { "volatile-asm-stop", MASK_VOL_ASM_STOP, \
110 "Emit stop bits before and after volatile extended asms" }, \
111 { "no-volatile-asm-stop", -MASK_VOL_ASM_STOP, \
112 "Don't emit stop bits before and after volatile extended asms" }, \
113 { "a-step", MASK_A_STEP, \
114 "Emit code for Itanium (TM) processor A step"}, \
115 { "register-names", MASK_REG_NAMES, \
116 "Use in/loc/out register names"}, \
117 { "no-sdata", MASK_NO_SDATA, \
118 "Disable use of sdata/scommon/sbss"}, \
119 { "sdata", -MASK_NO_SDATA, \
120 "Enable use of sdata/scommon/sbss"}, \
121 { "dwarf2-asm", MASK_DWARF2_ASM, \
122 "Enable Dwarf 2 line debug info via GNU as"}, \
123 { "no-dwarf2-asm", -MASK_DWARF2_ASM, \
124 "Disable Dwarf 2 line debug info via GNU as"}, \
125 { "", TARGET_DEFAULT | TARGET_CPU_DEFAULT, \
126 NULL } \
127}
128
129/* Default target_flags if no switches are specified */
130
131#ifndef TARGET_DEFAULT
132#define TARGET_DEFAULT MASK_DWARF2_ASM
133#endif
134
135#ifndef TARGET_CPU_DEFAULT
136#define TARGET_CPU_DEFAULT 0
137#endif
138
139/* This macro is similar to `TARGET_SWITCHES' but defines names of command
140 options that have values. Its definition is an initializer with a
141 subgrouping for each command option. */
142
143extern const char *ia64_fixed_range_string;
144#define TARGET_OPTIONS \
145{ \
146 { "fixed-range=", &ia64_fixed_range_string, \
147 "Specify range of registers to make fixed."}, \
148}
149
150/* This macro is a C statement to print on `stderr' a string describing the
151 particular machine description choice. */
152
153#define TARGET_VERSION fprintf (stderr, " (IA-64)");
154
155/* Sometimes certain combinations of command options do not make sense on a
156 particular target machine. You can define a macro `OVERRIDE_OPTIONS' to
157 take account of this. This macro, if defined, is executed once just after
158 all the command options have been parsed. */
159
160#define OVERRIDE_OPTIONS ia64_override_options ()
161
162/* Some machines may desire to change what optimizations are performed for
163 various optimization levels. This macro, if defined, is executed once just
164 after the optimization level is determined and before the remainder of the
165 command options have been parsed. Values set in this macro are used as the
166 default values for the other command line options. */
167
168/* #define OPTIMIZATION_OPTIONS(LEVEL,SIZE) */
169
170/* Define this macro if debugging can be performed even without a frame
171 pointer. If this macro is defined, GNU CC will turn on the
172 `-fomit-frame-pointer' option whenever `-O' is specified. */
173/* ??? Need to define this. */
174/* #define CAN_DEBUG_WITHOUT_FP */
175
176\f
177/* Driver configuration */
178
179/* A C string constant that tells the GNU CC driver program options to pass to
180 CPP. It can also specify how to translate options you give to GNU CC into
181 options for GNU CC to pass to the CPP. */
182
183/* ??? __LONG_MAX__ depends on LP64/ILP32 switch. */
184/* ??? An alternative is to modify glimits.h to check for __LP64__ instead
185 of checked for CPU specific defines. We could also get rid of all LONG_MAX
186 defines in other tm.h files. */
187#define CPP_SPEC \
188 "%{mcpu=itanium:-D__itanium__} %{mbig-endian:-D__BIG_ENDIAN__} \
189 -D__LONG_MAX__=9223372036854775807L"
190
191/* If this macro is defined, the preprocessor will not define the builtin macro
192 `__SIZE_TYPE__'. The macro `__SIZE_TYPE__' must then be defined by
193 `CPP_SPEC' instead.
194
195 This should be defined if `SIZE_TYPE' depends on target dependent flags
196 which are not accessible to the preprocessor. Otherwise, it should not be
197 defined. */
198/* ??? Needs to be defined for P64 code. */
199/* #define NO_BUILTIN_SIZE_TYPE */
200
201/* If this macro is defined, the preprocessor will not define the builtin macro
202 `__PTRDIFF_TYPE__'. The macro `__PTRDIFF_TYPE__' must then be defined by
203 `CPP_SPEC' instead.
204
205 This should be defined if `PTRDIFF_TYPE' depends on target dependent flags
206 which are not accessible to the preprocessor. Otherwise, it should not be
207 defined. */
208/* ??? Needs to be defined for P64 code. */
209/* #define NO_BUILTIN_PTRDIFF_TYPE */
210
211/* A C string constant that tells the GNU CC driver program options to pass to
212 `cc1'. It can also specify how to translate options you give to GNU CC into
213 options for GNU CC to pass to the `cc1'. */
214
215/* #define CC1_SPEC "" */
216
217/* A C string constant that tells the GNU CC driver program options to pass to
218 `cc1plus'. It can also specify how to translate options you give to GNU CC
219 into options for GNU CC to pass to the `cc1plus'. */
220
221/* #define CC1PLUS_SPEC "" */
222
223/* A C string constant that tells the GNU CC driver program options to pass to
224 the assembler. It can also specify how to translate options you give to GNU
225 CC into options for GNU CC to pass to the assembler. */
226
227#if ((TARGET_CPU_DEFAULT | TARGET_DEFAULT) & MASK_GNU_AS) != 0
228/* GNU AS. */
229#define ASM_SPEC "%{mno-gnu-as:-N so}"
230#else
231/* Intel ias. */
232#define ASM_SPEC "%{!mgnu-as:-N so}"
233#endif
234
235/* A C string constant that tells the GNU CC driver program options to pass to
236 the linker. It can also specify how to translate options you give to GNU CC
237 into options for GNU CC to pass to the linker. */
238
239/* The Intel linker does not support dynamic linking, so we need -dn.
240 The Intel linker gives annoying messages unless -N so is used. */
241#if ((TARGET_CPU_DEFAULT | TARGET_DEFAULT) & MASK_GNU_LD) != 0
242/* GNU LD. */
243#define LINK_SPEC "%{mno-gnu-ld:-dn -N so}"
244#else
245/* Intel ild. */
246#define LINK_SPEC "%{!mgnu-ld:-dn -N so}"
247#endif
248
249\f
250/* Storage Layout */
251
252/* Define this macro to have the value 1 if the most significant bit in a byte
253 has the lowest number; otherwise define it to have the value zero. */
254
255#define BITS_BIG_ENDIAN 0
256
257/* Define this macro to have the value 1 if the most significant byte in a word
258 has the lowest number. This macro need not be a constant. */
259
260#define BYTES_BIG_ENDIAN (TARGET_BIG_ENDIAN != 0)
261
262/* Define this macro to have the value 1 if, in a multiword object, the most
263 significant word has the lowest number. */
264
265#define WORDS_BIG_ENDIAN (TARGET_BIG_ENDIAN != 0)
266
267/* Define this macro if WORDS_BIG_ENDIAN is not constant. This must be a
268 constant value with the same meaning as WORDS_BIG_ENDIAN, which will be used
269 only when compiling libgcc2.c. Typically the value will be set based on
270 preprocessor defines. */
271#if defined(__BIG_ENDIAN__)
272#define LIBGCC2_WORDS_BIG_ENDIAN 1
273#else
274#define LIBGCC2_WORDS_BIG_ENDIAN 0
275#endif
276
277/* Define this macro to be the number of bits in an addressable storage unit
278 (byte); normally 8. */
279#define BITS_PER_UNIT 8
280
281/* Number of bits in a word; normally 32. */
282#define BITS_PER_WORD 64
283
284/* Number of storage units in a word; normally 4. */
285#define UNITS_PER_WORD 8
286
287/* Width of a pointer, in bits. You must specify a value no wider than the
288 width of `Pmode'. If it is not equal to the width of `Pmode', you must
289 define `POINTERS_EXTEND_UNSIGNED'. */
290/* ??? Implement optional 32 bit pointer size later? */
291#define POINTER_SIZE 64
292
293/* A C expression whose value is nonzero if pointers that need to be extended
294 from being `POINTER_SIZE' bits wide to `Pmode' are sign-extended and zero if
295 they are zero-extended.
296
297 You need not define this macro if the `POINTER_SIZE' is equal to the width
298 of `Pmode'. */
299/* ??? May need this for 32 bit pointers. */
300/* #define POINTERS_EXTEND_UNSIGNED */
301
302/* A macro to update MODE and UNSIGNEDP when an object whose type is TYPE and
303 which has the specified mode and signedness is to be stored in a register.
304 This macro is only called when TYPE is a scalar type. */
305
306/* ??? Maybe sign-extend 32 bit values like the alpha? Or maybe zero-extend
307 because we only have zero-extending loads? */
308#define PROMOTE_MODE(MODE,UNSIGNEDP,TYPE) \
309do \
310 { \
311 if (GET_MODE_CLASS (MODE) == MODE_INT \
312 && GET_MODE_SIZE (MODE) < UNITS_PER_WORD) \
313 (MODE) = DImode; \
314 } \
315while (0)
316
317/* Define this macro if the promotion described by `PROMOTE_MODE' should also
318 be done for outgoing function arguments. */
319/* ??? ABI doesn't allow us to define this. */
320/* #define PROMOTE_FUNCTION_ARGS */
321
322/* Define this macro if the promotion described by `PROMOTE_MODE' should also
323 be done for the return value of functions.
324
325 If this macro is defined, `FUNCTION_VALUE' must perform the same promotions
326 done by `PROMOTE_MODE'. */
327/* ??? ABI doesn't allow us to define this. */
328/* #define PROMOTE_FUNCTION_RETURN */
329
330/* Normal alignment required for function parameters on the stack, in bits.
331 All stack parameters receive at least this much alignment regardless of data
332 type. On most machines, this is the same as the size of an integer. */
333#define PARM_BOUNDARY 64
334
335/* Define this macro if you wish to preserve a certain alignment for the stack
336 pointer. The definition is a C expression for the desired alignment
337 (measured in bits). */
338
339#define STACK_BOUNDARY 128
340
341/* Align frames on double word boundaries */
342#ifndef IA64_STACK_ALIGN
343#define IA64_STACK_ALIGN(LOC) (((LOC) + 15) & ~15)
344#endif
345
346/* Alignment required for a function entry point, in bits. */
347#define FUNCTION_BOUNDARY 128
348
349/* Biggest alignment that any data type can require on this machine,
350 in bits. */
351/* Optional x86 80-bit float, quad-precision 128-bit float, and quad-word
352 128 bit integers all require 128 bit alignment. */
353#define BIGGEST_ALIGNMENT 128
354
355/* If defined, a C expression to compute the alignment for a static variable.
356 TYPE is the data type, and ALIGN is the alignment that the object
357 would ordinarily have. The value of this macro is used instead of that
358 alignment to align the object. */
359
360#define DATA_ALIGNMENT(TYPE, ALIGN) \
361 (TREE_CODE (TYPE) == ARRAY_TYPE \
362 && TYPE_MODE (TREE_TYPE (TYPE)) == QImode \
363 && (ALIGN) < BITS_PER_WORD ? BITS_PER_WORD : (ALIGN))
364
365/* If defined, a C expression to compute the alignment given to a constant that
366 is being placed in memory. CONSTANT is the constant and ALIGN is the
367 alignment that the object would ordinarily have. The value of this macro is
368 used instead of that alignment to align the object. */
369
370#define CONSTANT_ALIGNMENT(EXP, ALIGN) \
371 (TREE_CODE (EXP) == STRING_CST \
372 && (ALIGN) < BITS_PER_WORD ? BITS_PER_WORD : (ALIGN))
373
374/* Define this macro to be the value 1 if instructions will fail to work if
375 given data not on the nominal alignment. If instructions will merely go
376 slower in that case, define this macro as 0. */
377#define STRICT_ALIGNMENT 1
378
379/* Define this if you wish to imitate the way many other C compilers handle
380 alignment of bitfields and the structures that contain them.
381 The behavior is that the type written for a bitfield (`int', `short', or
382 other integer type) imposes an alignment for the entire structure, as if the
383 structure really did contain an ordinary field of that type. In addition,
384 the bitfield is placed within the structure so that it would fit within such
385 a field, not crossing a boundary for it. */
386#define PCC_BITFIELD_TYPE_MATTERS 1
387
388/* Define this macro as an expression for the overall size of a structure
389 (given by STRUCT as a tree node) when the size computed from the fields is
390 SIZE and the alignment is ALIGN.
391
392 The default is to round SIZE up to a multiple of ALIGN. */
393/* ??? Might need this for 80-bit double-extended floats. */
394/* #define ROUND_TYPE_SIZE(STRUCT, SIZE, ALIGN) */
395
396/* Define this macro as an expression for the alignment of a structure (given
397 by STRUCT as a tree node) if the alignment computed in the usual way is
398 COMPUTED and the alignment explicitly specified was SPECIFIED.
399
400 The default is to use SPECIFIED if it is larger; otherwise, use the smaller
401 of COMPUTED and `BIGGEST_ALIGNMENT' */
402/* ??? Might need this for 80-bit double-extended floats. */
403/* #define ROUND_TYPE_ALIGN(STRUCT, COMPUTED, SPECIFIED) */
404
405/* An integer expression for the size in bits of the largest integer machine
406 mode that should actually be used. */
407
408/* Allow pairs of registers to be used, which is the intent of the default. */
409#define MAX_FIXED_MODE_SIZE GET_MODE_BITSIZE (TImode)
410
411/* A code distinguishing the floating point format of the target machine. */
412#define TARGET_FLOAT_FORMAT IEEE_FLOAT_FORMAT
413
414/* GNU CC supports two ways of implementing C++ vtables: traditional or with
415 so-called "thunks". The flag `-fvtable-thunk' chooses between them. Define
416 this macro to be a C expression for the default value of that flag. If
417 `DEFAULT_VTABLE_THUNKS' is 0, GNU CC uses the traditional implementation by
418 default. The "thunk" implementation is more efficient (especially if you
419 have provided an implementation of `ASM_OUTPUT_MI_THUNK', but is not binary
420 compatible with code compiled using the traditional implementation. If you
421 are writing a new ports, define `DEFAULT_VTABLE_THUNKS' to 1.
422
423 If you do not define this macro, the default for `-fvtable-thunk' is 0. */
424#define DEFAULT_VTABLE_THUNKS 1
425
426\f
427/* Layout of Source Language Data Types */
428
429/* A C expression for the size in bits of the type `int' on the target machine.
430 If you don't define this, the default is one word. */
431#define INT_TYPE_SIZE 32
432
433/* A C expression for the size in bits of the type `short' on the target
434 machine. If you don't define this, the default is half a word. (If this
435 would be less than one storage unit, it is rounded up to one unit.) */
436#define SHORT_TYPE_SIZE 16
437
438/* A C expression for the size in bits of the type `long' on the target
439 machine. If you don't define this, the default is one word. */
440/* ??? Should be 32 for ILP32 code. */
441#define LONG_TYPE_SIZE 64
442
443/* Maximum number for the size in bits of the type `long' on the target
444 machine. If this is undefined, the default is `LONG_TYPE_SIZE'. Otherwise,
445 it is the constant value that is the largest value that `LONG_TYPE_SIZE' can
446 have at run-time. This is used in `cpp'. */
447/* ??? Should be 64 for ILP32 code. */
448/* #define MAX_LONG_TYPE_SIZE */
449
450/* A C expression for the size in bits of the type `long long' on the target
451 machine. If you don't define this, the default is two words. If you want
452 to support GNU Ada on your machine, the value of macro must be at least 64. */
453#define LONG_LONG_TYPE_SIZE 64
454
455/* A C expression for the size in bits of the type `char' on the target
456 machine. If you don't define this, the default is one quarter of a word.
457 (If this would be less than one storage unit, it is rounded up to one unit.) */
458#define CHAR_TYPE_SIZE 8
459
460/* A C expression for the size in bits of the type `float' on the target
461 machine. If you don't define this, the default is one word. */
462#define FLOAT_TYPE_SIZE 32
463
464/* A C expression for the size in bits of the type `double' on the target
465 machine. If you don't define this, the default is two words. */
466#define DOUBLE_TYPE_SIZE 64
467
468/* A C expression for the size in bits of the type `long double' on the target
469 machine. If you don't define this, the default is two words. */
470/* ??? We have an 80 bit extended double format. */
471#define LONG_DOUBLE_TYPE_SIZE 64
472
473/* An expression whose value is 1 or 0, according to whether the type `char'
474 should be signed or unsigned by default. The user can always override this
475 default with the options `-fsigned-char' and `-funsigned-char'. */
476#define DEFAULT_SIGNED_CHAR 1
477
478/* A C expression for a string describing the name of the data type to use for
479 size values. The typedef name `size_t' is defined using the contents of the
480 string. */
481/* ??? Needs to be defined for P64 code. */
482/* #define SIZE_TYPE */
483
484/* A C expression for a string describing the name of the data type to use for
485 the result of subtracting two pointers. The typedef name `ptrdiff_t' is
486 defined using the contents of the string. See `SIZE_TYPE' above for more
487 information. */
488/* ??? Needs to be defined for P64 code. */
489/* #define PTRDIFF_TYPE */
490
491/* A C expression for a string describing the name of the data type to use for
492 wide characters. The typedef name `wchar_t' is defined using the contents
493 of the string. See `SIZE_TYPE' above for more information. */
494/* #define WCHAR_TYPE */
495
496/* A C expression for the size in bits of the data type for wide characters.
497 This is used in `cpp', which cannot make use of `WCHAR_TYPE'. */
498/* #define WCHAR_TYPE_SIZE */
499
500/* Maximum number for the size in bits of the data type for wide characters.
501 If this is undefined, the default is `WCHAR_TYPE_SIZE'. Otherwise, it is
502 the constant value that is the largest value that `WCHAR_TYPE_SIZE' can have
503 at run-time. This is used in `cpp'. */
504/* #define MAX_WCHAR_TYPE_SIZE */
505
506/* A C constant expression for the integer value for escape sequence
507 `\a'. */
508#define TARGET_BELL 0x7
509
510/* C constant expressions for the integer values for escape sequences
511 `\b', `\t' and `\n'. */
512#define TARGET_BS 0x8
513#define TARGET_TAB 0x9
514#define TARGET_NEWLINE 0xa
515
516/* C constant expressions for the integer values for escape sequences
517 `\v', `\f' and `\r'. */
518#define TARGET_VT 0xb
519#define TARGET_FF 0xc
520#define TARGET_CR 0xd
521
522\f
523/* Register Basics */
524
525/* Number of hardware registers known to the compiler.
526 We have 128 general registers, 128 floating point registers, 64 predicate
527 registers, 8 branch registers, and one frame pointer register. */
528
529/* ??? Should add ar.lc, ar.ec and probably also ar.pfs. */
530
531#define FIRST_PSEUDO_REGISTER 330
532
533/* Ranges for the various kinds of registers. */
534#define ADDL_REGNO_P(REGNO) ((REGNO) >= 0 && (REGNO) <= 3)
535#define GR_REGNO_P(REGNO) ((REGNO) >= 0 && (REGNO) <= 127)
536#define FR_FP_REGNO_P(REGNO) \
537 (((REGNO) >= 128 && (REGNO) <= 143) || ((REGNO) >= 152 && (REGNO) <= 223))
538#define FR_INT_REGNO_P(REGNO) \
539 (((REGNO) >= 144 && (REGNO) <= 151) || ((REGNO) >= 224 && (REGNO) <= 255))
540#define FR_REGNO_P(REGNO) ((REGNO) >= 128 && (REGNO) <= 255)
541#define PR_REGNO_P(REGNO) ((REGNO) >= 256 && (REGNO) <= 319)
542#define BR_REGNO_P(REGNO) ((REGNO) >= 320 && (REGNO) <= 327)
543#define GENERAL_REGNO_P(REGNO) \
544 (GR_REGNO_P (REGNO) \
545 || (REGNO) == FRAME_POINTER_REGNUM \
546 || (REGNO) == RETURN_ADDRESS_REGNUM)
547
548#define GR_REG(REGNO) ((REGNO) + 0)
549#define FR_REG(REGNO) ((REGNO) + 128)
550#define PR_REG(REGNO) ((REGNO) + 256)
551#define BR_REG(REGNO) ((REGNO) + 320)
552#define OUT_REG(REGNO) ((REGNO) + 120)
553#define IN_REG(REGNO) ((REGNO) + 112)
554#define LOC_REG(REGNO) ((REGNO) + 32)
555
556#define IN_REGNO_P(REGNO) ((REGNO) >= IN_REG (0) && (REGNO) <= IN_REG (7))
557#define LOC_REGNO_P(REGNO) ((REGNO) >= LOC_REG (0) && (REGNO) <= LOC_REG (79))
558#define OUT_REGNO_P(REGNO) ((REGNO) >= OUT_REG (0) && (REGNO) <= OUT_REG (7))
559
560/* ??? Don't really need two sets of macros. I like this one better because
561 it is less typing. */
562#define R_GR(REGNO) GR_REG (REGNO)
563#define R_FR(REGNO) FR_REG (REGNO)
564#define R_PR(REGNO) PR_REG (REGNO)
565#define R_BR(REGNO) BR_REG (REGNO)
566
567/* An initializer that says which registers are used for fixed purposes all
568 throughout the compiled code and are therefore not available for general
569 allocation.
570
571 r0: constant 0
572 r1: global pointer (gp)
573 r12: stack pointer (sp)
574 r13: thread pointer (tp)
575 f0: constant 0.0
576 f1: constant 1.0
577 p0: constant true
578 fp: eliminable frame pointer */
579
580/* The last 16 stacked regs are fixed, because they are reserved for the 8
581 input and 8 output registers. */
582
583/* ??? Must mark the next 3 stacked regs as fixed, because ia64_expand_prologue
584 assumes that three locals are available for fp, b0, and ar.pfs. */
585
586/* ??? Should mark b0 as fixed? */
587
588/* ??? input and output registers do not have to be marked as fixed. */
589
590#define FIXED_REGISTERS \
591{ /* General registers. */ \
592 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, \
593 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, \
594 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, \
595 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, \
596 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, \
597 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, \
598 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, \
599 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, \
600 /* Floating-point registers. */ \
601 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, \
602 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, \
603 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, \
604 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, \
605 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, \
606 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, \
607 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, \
608 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, \
609 /* Predicate registers. */ \
610 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, \
611 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, \
612 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, \
613 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, \
614 /* Branch registers. */ \
615 0, 0, 0, 0, 0, 0, 0, 0, \
616 /*FP RA*/ \
617 1, 1, \
618 }
619
620/* Like `FIXED_REGISTERS' but has 1 for each register that is clobbered (in
621 general) by function calls as well as for fixed registers. This macro
622 therefore identifies the registers that are not available for general
623 allocation of values that must live across function calls. */
624
625/* ??? If inputs are not marked as fixed, then they are not call clobbered. */
626
627#define CALL_USED_REGISTERS \
628{ /* General registers. */ \
629 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, \
630 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, \
631 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, \
632 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, \
633 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, \
634 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, \
635 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, \
636 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, \
637 /* Floating-point registers. */ \
638 1, 1, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, \
639 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, \
640 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, \
641 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, \
642 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, \
643 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, \
644 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, \
645 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, \
646 /* Predicate registers. */ \
647 1, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, \
648 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, \
649 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, \
650 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, \
651 /* Branch registers. */ \
652 1, 0, 0, 0, 0, 0, 1, 1, \
653 /*FP RA*/ \
654 1, 1, \
655}
656
657/* Define this macro if the target machine has register windows. This C
658 expression returns the register number as seen by the called function
659 corresponding to the register number OUT as seen by the calling function.
660 Return OUT if register number OUT is not an outbound register. */
661
662#define INCOMING_REGNO(OUT) \
663 ((unsigned) ((OUT) - OUT_REG (0)) < 8 ? IN_REG ((OUT) - OUT_REG (0)) : (OUT))
664
665/* Define this macro if the target machine has register windows. This C
666 expression returns the register number as seen by the calling function
667 corresponding to the register number IN as seen by the called function.
668 Return IN if register number IN is not an inbound register. */
669
670#define OUTGOING_REGNO(IN) \
671 ((unsigned) ((IN) - IN_REG (0)) < 8 ? OUT_REG ((IN) - IN_REG (0)) : (IN))
672
673\f
674/* Order of allocation of registers */
675
676/* If defined, an initializer for a vector of integers, containing the numbers
677 of hard registers in the order in which GNU CC should prefer to use them
678 (from most preferred to least).
679
680 If this macro is not defined, registers are used lowest numbered first (all
681 else being equal).
682
683 One use of this macro is on machines where the highest numbered registers
684 must always be saved and the save-multiple-registers instruction supports
685 only sequences of consecutive registers. On such machines, define
686 `REG_ALLOC_ORDER' to be an initializer that lists the highest numbered
687 allocatable register first. */
688
689/* ??? Should the GR return value registers come before or after the rest
690 of the caller-save GRs? */
691
692/* ??? Output registers are cheap, because they will be not be saved
693 by the register engine. They probably should be early in the list.
694 We need to make them not fixed first though. Similarly, input registers
695 are callee-saved (RSE) like the stacked locals. */
696
697#define REG_ALLOC_ORDER \
698{ \
699 /* Caller-saved general registers. */ \
700 R_GR (14), R_GR (15), R_GR (16), R_GR (17), \
701 R_GR (18), R_GR (19), R_GR (20), R_GR (21), R_GR (22), R_GR (23), \
702 R_GR (24), R_GR (25), R_GR (26), R_GR (27), R_GR (28), R_GR (29), \
703 R_GR (30), R_GR (31), \
704 /* Caller-saved general registers, also used for return values. */ \
705 R_GR (8), R_GR (9), R_GR (10), R_GR (11), \
706 /* addl caller-saved general registers. */ \
707 R_GR (2), R_GR (3), \
708 /* Caller-saved FP registers. */ \
709 R_FR (6), R_FR (7), \
710 /* Caller-saved FP registers, used for parameters and return values. */ \
711 R_FR (8), R_FR (9), R_FR (10), R_FR (11), \
712 R_FR (12), R_FR (13), R_FR (14), R_FR (15), \
713 /* Rotating caller-saved FP registers. */ \
714 R_FR (32), R_FR (33), R_FR (34), R_FR (35), \
715 R_FR (36), R_FR (37), R_FR (38), R_FR (39), R_FR (40), R_FR (41), \
716 R_FR (42), R_FR (43), R_FR (44), R_FR (45), R_FR (46), R_FR (47), \
717 R_FR (48), R_FR (49), R_FR (50), R_FR (51), R_FR (52), R_FR (53), \
718 R_FR (54), R_FR (55), R_FR (56), R_FR (57), R_FR (58), R_FR (59), \
719 R_FR (60), R_FR (61), R_FR (62), R_FR (63), R_FR (64), R_FR (65), \
720 R_FR (66), R_FR (67), R_FR (68), R_FR (69), R_FR (70), R_FR (71), \
721 R_FR (72), R_FR (73), R_FR (74), R_FR (75), R_FR (76), R_FR (77), \
722 R_FR (78), R_FR (79), R_FR (80), R_FR (81), R_FR (82), R_FR (83), \
723 R_FR (84), R_FR (85), R_FR (86), R_FR (87), R_FR (88), R_FR (89), \
724 R_FR (90), R_FR (91), R_FR (92), R_FR (93), R_FR (94), R_FR (95), \
725 R_FR (96), R_FR (97), R_FR (98), R_FR (99), R_FR (100), R_FR (101), \
726 R_FR (102), R_FR (103), R_FR (104), R_FR (105), R_FR (106), R_FR (107), \
727 R_FR (108), R_FR (109), R_FR (110), R_FR (111), R_FR (112), R_FR (113), \
728 R_FR (114), R_FR (115), R_FR (116), R_FR (117), R_FR (118), R_FR (119), \
729 R_FR (120), R_FR (121), R_FR (122), R_FR (123), R_FR (124), R_FR (125), \
730 R_FR (126), R_FR (127), \
731 /* Caller-saved predicate registers. */ \
732 R_PR (6), R_PR (7), R_PR (8), R_PR (9), R_PR (10), R_PR (11), \
733 R_PR (12), R_PR (13), R_PR (14), R_PR (15), \
734 /* Rotating caller-saved predicate registers. */ \
735 R_PR (16), R_PR (17), \
736 R_PR (18), R_PR (19), R_PR (20), R_PR (21), R_PR (22), R_PR (23), \
737 R_PR (24), R_PR (25), R_PR (26), R_PR (27), R_PR (28), R_PR (29), \
738 R_PR (30), R_PR (31), R_PR (32), R_PR (33), R_PR (34), R_PR (35), \
739 R_PR (36), R_PR (37), R_PR (38), R_PR (39), R_PR (40), R_PR (41), \
740 R_PR (42), R_PR (43), R_PR (44), R_PR (45), R_PR (46), R_PR (47), \
741 R_PR (48), R_PR (49), R_PR (50), R_PR (51), R_PR (52), R_PR (53), \
742 R_PR (54), R_PR (55), R_PR (56), R_PR (57), R_PR (58), R_PR (59), \
743 R_PR (60), R_PR (61), R_PR (62), R_PR (63), \
744 /* Caller-saved branch registers. */ \
745 R_BR (6), R_BR (7), \
746 \
747 /* Stacked callee-saved general registers. */ \
748 R_GR (32), R_GR (33), R_GR (34), R_GR (35), \
749 R_GR (36), R_GR (37), R_GR (38), R_GR (39), R_GR (40), R_GR (41), \
750 R_GR (42), R_GR (43), R_GR (44), R_GR (45), R_GR (46), R_GR (47), \
751 R_GR (48), R_GR (49), R_GR (50), R_GR (51), R_GR (52), R_GR (53), \
752 R_GR (54), R_GR (55), R_GR (56), R_GR (57), R_GR (58), R_GR (59), \
753 R_GR (60), R_GR (61), R_GR (62), R_GR (63), R_GR (64), R_GR (65), \
754 R_GR (66), R_GR (67), R_GR (68), R_GR (69), R_GR (70), R_GR (71), \
755 R_GR (72), R_GR (73), R_GR (74), R_GR (75), R_GR (76), R_GR (77), \
756 R_GR (78), R_GR (79), R_GR (80), R_GR (81), R_GR (82), R_GR (83), \
757 R_GR (84), R_GR (85), R_GR (86), R_GR (87), R_GR (88), R_GR (89), \
758 R_GR (90), R_GR (91), R_GR (92), R_GR (93), R_GR (94), R_GR (95), \
759 R_GR (96), R_GR (97), R_GR (98), R_GR (99), R_GR (100), R_GR (101), \
760 R_GR (102), R_GR (103), R_GR (104), R_GR (105), R_GR (106), R_GR (107), \
761 R_GR (108), \
762 /* Callee-saved general registers. */ \
763 R_GR (4), R_GR (5), R_GR (6), R_GR (7), \
764 /* Callee-saved FP registers. */ \
765 R_FR (2), R_FR (3), R_FR (4), R_FR (5), R_FR (16), R_FR (17), \
766 R_FR (18), R_FR (19), R_FR (20), R_FR (21), R_FR (22), R_FR (23), \
767 R_FR (24), R_FR (25), R_FR (26), R_FR (27), R_FR (28), R_FR (29), \
768 R_FR (30), R_FR (31), \
769 /* Callee-saved predicate registers. */ \
770 R_PR (1), R_PR (2), R_PR (3), R_PR (4), R_PR (5), \
771 /* Callee-saved branch registers. */ \
772 R_BR (1), R_BR (2), R_BR (3), R_BR (4), R_BR (5), \
773 \
774 /* ??? Stacked registers reserved for fp, rp, and ar.pfs. */ \
775 R_GR (109), R_GR (110), R_GR (111), \
776 /* Input registers. */ \
777 R_GR (112), R_GR (113), R_GR (114), R_GR (115), R_GR (116), R_GR (117), \
778 R_GR (118), R_GR (119), \
779 /* Output registers. */ \
780 R_GR (120), R_GR (121), R_GR (122), R_GR (123), R_GR (124), R_GR (125), \
781 R_GR (126), R_GR (127), \
782 \
783 /* Special general registers. */ \
784 R_GR (0), R_GR (1), R_GR (12), R_GR (13), \
785 /* Special FP registers. */ \
786 R_FR (0), R_FR (1), \
787 /* Special predicate registers. */ \
788 R_PR (0), \
789 /* Special branch registers. */ \
790 R_BR (0), \
791 /* Frame pointer. Return address. */ \
792 FRAME_POINTER_REGNUM, RETURN_ADDRESS_REGNUM, \
793}
794
795\f
796/* How Values Fit in Registers */
797
798/* A C expression for the number of consecutive hard registers, starting at
799 register number REGNO, required to hold a value of mode MODE. */
800
801/* ??? x86 80-bit FP values only require 1 register. */
802/* ??? We say that CCmode values require two registers. This allows us to
803 easily store the normal and inverted values. If we want single register
804 predicates, we can use EXTRA_CC_MODES to give them a different mode. */
805
806#define HARD_REGNO_NREGS(REGNO, MODE) \
807 ((MODE) == CCmode && PR_REGNO_P (REGNO) ? 2 \
808 : FR_REGNO_P (REGNO) && (MODE) == XFmode ? 1 \
809 : (GET_MODE_SIZE (MODE) + UNITS_PER_WORD - 1) / UNITS_PER_WORD)
810
811/* A C expression that is nonzero if it is permissible to store a value of mode
812 MODE in hard register number REGNO (or in several registers starting with
813 that one). */
814
815#define HARD_REGNO_MODE_OK(REGNO, MODE) \
816 (FR_FP_REGNO_P (REGNO) ? ! INTEGRAL_MODE_P (MODE) \
817 : FR_INT_REGNO_P (REGNO) ? ! FLOAT_MODE_P (MODE) \
818 : PR_REGNO_P (REGNO) ? (MODE) == CCmode \
819 : 1)
820
821/* A C expression that is nonzero if it is desirable to choose register
822 allocation so as to avoid move instructions between a value of mode MODE1
823 and a value of mode MODE2.
824
825 If `HARD_REGNO_MODE_OK (R, MODE1)' and `HARD_REGNO_MODE_OK (R, MODE2)' are
826 ever different for any R, then `MODES_TIEABLE_P (MODE1, MODE2)' must be
827 zero. */
828/* ??? If the comments are true, then this must be zero if one mode is CCmode,
829 INTEGRAL_MODE_P or FLOAT_MODE_P and the other is not. Otherwise, it is
830 true. */
831#define MODES_TIEABLE_P(MODE1, MODE2) 1
832
833/* Define this macro if the compiler should avoid copies to/from CCmode
834 registers. You should only define this macro if support fo copying to/from
835 CCmode is incomplete. */
836/* ??? CCmode copies are very expensive, so we might want this defined. */
837/* #define AVOID_CCMODE_COPIES */
838
839\f
840/* Handling Leaf Functions */
841
842/* A C initializer for a vector, indexed by hard register number, which
843 contains 1 for a register that is allowable in a candidate for leaf function
844 treatment. */
845/* ??? This might be useful. */
846/* #define LEAF_REGISTERS */
847
848/* A C expression whose value is the register number to which REGNO should be
849 renumbered, when a function is treated as a leaf function. */
850/* ??? This might be useful. */
851/* #define LEAF_REG_REMAP(REGNO) */
852
853\f
854/* Register Classes */
855
856/* An enumeral type that must be defined with all the register class names as
857 enumeral values. `NO_REGS' must be first. `ALL_REGS' must be the last
858 register class, followed by one more enumeral value, `LIM_REG_CLASSES',
859 which is not a register class but rather tells how many classes there
860 are. */
861/* ??? FP registers hold INT and FP values in different representations, so
862 we can't just use a subreg to convert between the two. We get around this
863 problem by segmenting the FP register set into two parts. One part (FR_INT)
864 only holds integer values, and one part (FR_FP) only hold FP values. Thus
865 we always know which representation is being used. */
866/* ??? When compiling without optimization, it is possible for the only use of
867 a pseudo to be a parameter load from the stack with a REG_EQUIV note.
868 Regclass handles this case specially and does not assign any costs to the
869 pseudo. The pseudo then ends up using the last class before ALL_REGS.
870 Thus we must not let either PR_REGS or BR_REGS be the last class. The
871 testcase for this is gcc.c-torture/execute/va-arg-7.c. */
872enum reg_class
873{
874 NO_REGS,
875 PR_REGS,
876 BR_REGS,
877 ADDL_REGS,
878 GR_REGS,
879 FR_INT_REGS,
880 FR_FP_REGS,
881 FR_REGS,
882 GR_AND_FR_INT_REGS,
883 GR_AND_FR_FP_REGS,
884 GR_AND_FR_REGS,
885 ALL_REGS,
886 LIM_REG_CLASSES
887};
888
889#define GENERAL_REGS GR_REGS
890
891/* The number of distinct register classes. */
892#define N_REG_CLASSES ((int) LIM_REG_CLASSES)
893
894/* An initializer containing the names of the register classes as C string
895 constants. These names are used in writing some of the debugging dumps. */
896#define REG_CLASS_NAMES \
897{ "NO_REGS", "PR_REGS", "BR_REGS", "ADDL_REGS", "GR_REGS", "FR_INT_REGS", \
898 "FR_FP_REGS", "FR_REGS", "GR_AND_FR_INT_REGS", "GR_AND_FR_FP_REGS", \
899 "GR_AND_FR_REGS", "ALL_REGS" }
900
901/* An initializer containing the contents of the register classes, as integers
902 which are bit masks. The Nth integer specifies the contents of class N.
903 The way the integer MASK is interpreted is that register R is in the class
904 if `MASK & (1 << R)' is 1. */
905#define REG_CLASS_CONTENTS \
906{ \
907 /* NO_REGS. */ \
908 { 0x00000000, 0x00000000, 0x00000000, 0x00000000, \
909 0x00000000, 0x00000000, 0x00000000, 0x00000000, \
910 0x00000000, 0x00000000, 0x000 }, \
911 /* PR_REGS. */ \
912 { 0x00000000, 0x00000000, 0x00000000, 0x00000000, \
913 0x00000000, 0x00000000, 0x00000000, 0x00000000, \
914 0xFFFFFFFF, 0xFFFFFFFF, 0x000 }, \
915 /* BR_REGS. */ \
916 { 0x00000000, 0x00000000, 0x00000000, 0x00000000, \
917 0x00000000, 0x00000000, 0x00000000, 0x00000000, \
918 0x00000000, 0x00000000, 0x0FF }, \
919 /* ADDL_REGS. */ \
920 { 0x0000000F, 0x00000000, 0x00000000, 0x00000000, \
921 0x00000000, 0x00000000, 0x00000000, 0x00000000, \
922 0x00000000, 0x00000000, 0x000 }, \
923 /* GR_REGS. */ \
924 { 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, \
925 0x00000000, 0x00000000, 0x00000000, 0x00000000, \
926 0x00000000, 0x00000000, 0x300 }, \
927 /* FR_INT_REGS. */ \
928 { 0x00000000, 0x00000000, 0x00000000, 0x00000000, \
929 0x00FF0000, 0x00000000, 0x00000000, 0xFFFFFFFF, \
930 0x00000000, 0x00000000, 0x000 }, \
931 /* FR_FP_REGS. */ \
932 { 0x00000000, 0x00000000, 0x00000000, 0x00000000, \
933 0xFF00FFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0x00000000, \
934 0x00000000, 0x00000000, 0x000 }, \
935 /* FR_REGS. */ \
936 { 0x00000000, 0x00000000, 0x00000000, 0x00000000, \
937 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, \
938 0x00000000, 0x00000000, 0x000 }, \
939 /* GR_AND_FR_INT_REGS. */ \
940 { 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, \
941 0x00FF0000, 0x00000000, 0x00000000, 0xFFFFFFFF, \
942 0x00000000, 0x00000000, 0x300 }, \
943 /* GR_AND_FR_FP_REGS. */ \
944 { 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, \
945 0xFF00FFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0x00000000, \
946 0x00000000, 0x00000000, 0x300 }, \
947 /* GR_AND_FR_REGS. */ \
948 { 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, \
949 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, \
950 0x00000000, 0x00000000, 0x300 }, \
951 /* ALL_REGS. */ \
952 { 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, \
953 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, \
954 0xFFFFFFFF, 0xFFFFFFFF, 0x3FF }, \
955}
956
957/* A C expression whose value is a register class containing hard register
958 REGNO. In general there is more than one such class; choose a class which
959 is "minimal", meaning that no smaller class also contains the register. */
960/* The NO_REGS case is primarily for the benefit of rws_access_reg, which
961 may call here with private (invalid) register numbers, such as
962 REG_VOLATILE. */
963#define REGNO_REG_CLASS(REGNO) \
964(ADDL_REGNO_P (REGNO) ? ADDL_REGS \
965 : GENERAL_REGNO_P (REGNO) ? GR_REGS \
966 : FR_FP_REGNO_P (REGNO) ? FR_FP_REGS \
967 : FR_INT_REGNO_P (REGNO) ? FR_INT_REGS \
968 : PR_REGNO_P (REGNO) ? PR_REGS \
969 : BR_REGNO_P (REGNO) ? BR_REGS \
970 : NO_REGS)
971
972/* A macro whose definition is the name of the class to which a valid base
973 register must belong. A base register is one used in an address which is
974 the register value plus a displacement. */
975#define BASE_REG_CLASS GENERAL_REGS
976
977/* A macro whose definition is the name of the class to which a valid index
978 register must belong. An index register is one used in an address where its
979 value is either multiplied by a scale factor or added to another register
980 (as well as added to a displacement). */
981#define INDEX_REG_CLASS NO_REGS
982
983/* A C expression which defines the machine-dependent operand constraint
984 letters for register classes. If CHAR is such a letter, the value should be
985 the register class corresponding to it. Otherwise, the value should be
986 `NO_REGS'. The register letter `r', corresponding to class `GENERAL_REGS',
987 will not be passed to this macro; you do not need to handle it. */
988
989#define REG_CLASS_FROM_LETTER(CHAR) \
990((CHAR) == 'f' ? FR_FP_REGS \
991 : (CHAR) == 'e' ? FR_INT_REGS \
992 : (CHAR) == 'a' ? ADDL_REGS \
993 : (CHAR) == 'b' ? BR_REGS \
994 : (CHAR) == 'c' ? PR_REGS \
995 : NO_REGS)
996
997/* A C expression which is nonzero if register number NUM is suitable for use
998 as a base register in operand addresses. It may be either a suitable hard
999 register or a pseudo register that has been allocated such a hard reg. */
1000#define REGNO_OK_FOR_BASE_P(REGNO) \
1001 (GENERAL_REGNO_P (REGNO) || GENERAL_REGNO_P (reg_renumber[REGNO]))
1002
1003/* A C expression which is nonzero if register number NUM is suitable for use
1004 as an index register in operand addresses. It may be either a suitable hard
1005 register or a pseudo register that has been allocated such a hard reg. */
1006#define REGNO_OK_FOR_INDEX_P(NUM) 0
1007
1008/* A C expression that places additional restrictions on the register class to
1009 use when it is necessary to copy value X into a register in class CLASS.
1010 The value is a register class; perhaps CLASS, or perhaps another, smaller
1011 class. */
1012
1013#define PREFERRED_RELOAD_CLASS(X, CLASS) CLASS
1014
1015/* You should define this macro to indicate to the reload phase that it may
1016 need to allocate at least one register for a reload in addition to the
1017 register to contain the data. Specifically, if copying X to a register
1018 CLASS in MODE requires an intermediate register, you should define this
1019 to return the largest register class all of whose registers can be used
1020 as intermediate registers or scratch registers. */
1021
1022#define SECONDARY_RELOAD_CLASS(CLASS, MODE, X) \
1023 ia64_secondary_reload_class (CLASS, MODE, X)
1024
1025/* Certain machines have the property that some registers cannot be copied to
1026 some other registers without using memory. Define this macro on those
1027 machines to be a C expression that is non-zero if objects of mode M in
1028 registers of CLASS1 can only be copied to registers of class CLASS2 by
1029 storing a register of CLASS1 into memory and loading that memory location
1030 into a register of CLASS2. */
1031/* ??? We may need this for XFmode moves between FR and GR regs. Using
1032 getf.sig/getf.exp almost works, but the result in the GR regs is not
1033 properly formatted and has two extra bits. */
1034/* #define SECONDARY_MEMORY_NEEDED(CLASS1, CLASS2, M) */
1035
1036/* A C expression for the maximum number of consecutive registers of
1037 class CLASS needed to hold a value of mode MODE.
1038 This is closely related to the macro `HARD_REGNO_NREGS'. */
1039
1040#define CLASS_MAX_NREGS(CLASS, MODE) \
1041 ((MODE) == CCmode && (CLASS) == PR_REGS ? 2 \
1042 : (((CLASS) == FR_REGS || (CLASS) == FR_FP_REGS \
1043 || (CLASS) == FR_INT_REGS) && (MODE) == XFmode) ? 1 \
1044 : (GET_MODE_SIZE (MODE) + UNITS_PER_WORD - 1) / UNITS_PER_WORD)
1045
1046/* A C expression that defines the machine-dependent operand constraint letters
1047 (`I', `J', `K', .. 'P') that specify particular ranges of integer values. */
1048
1049/* 14 bit signed immediate for arithmetic instructions. */
1050#define CONST_OK_FOR_I(VALUE) \
1051 ((unsigned HOST_WIDE_INT)(VALUE) + 0x2000 < 0x4000)
1052/* 22 bit signed immediate for arith instructions with r0/r1/r2/r3 source. */
1053#define CONST_OK_FOR_J(VALUE) \
1054 ((unsigned HOST_WIDE_INT)(VALUE) + 0x200000 < 0x400000)
1055/* 8 bit signed immediate for logical instructions. */
1056#define CONST_OK_FOR_K(VALUE) ((unsigned HOST_WIDE_INT)(VALUE) + 0x80 < 0x100)
1057/* 8 bit adjusted signed immediate for compare pseudo-ops. */
1058#define CONST_OK_FOR_L(VALUE) ((unsigned HOST_WIDE_INT)(VALUE) + 0x7F < 0x100)
1059/* 6 bit unsigned immediate for shift counts. */
1060#define CONST_OK_FOR_M(VALUE) ((unsigned HOST_WIDE_INT)(VALUE) < 0x40)
1061/* 9 bit signed immediate for load/store post-increments. */
1062/* ??? N is currently not used. */
1063#define CONST_OK_FOR_N(VALUE) ((unsigned HOST_WIDE_INT)(VALUE) + 0x100 < 0x200)
1064/* 0 for r0. Used by Linux kernel, do not change. */
1065#define CONST_OK_FOR_O(VALUE) ((VALUE) == 0)
1066/* 0 or -1 for dep instruction. */
1067#define CONST_OK_FOR_P(VALUE) ((VALUE) == 0 || (VALUE) == -1)
1068
1069#define CONST_OK_FOR_LETTER_P(VALUE, C) \
1070((C) == 'I' ? CONST_OK_FOR_I (VALUE) \
1071 : (C) == 'J' ? CONST_OK_FOR_J (VALUE) \
1072 : (C) == 'K' ? CONST_OK_FOR_K (VALUE) \
1073 : (C) == 'L' ? CONST_OK_FOR_L (VALUE) \
1074 : (C) == 'M' ? CONST_OK_FOR_M (VALUE) \
1075 : (C) == 'N' ? CONST_OK_FOR_N (VALUE) \
1076 : (C) == 'O' ? CONST_OK_FOR_O (VALUE) \
1077 : (C) == 'P' ? CONST_OK_FOR_P (VALUE) \
1078 : 0)
1079
1080/* A C expression that defines the machine-dependent operand constraint letters
1081 (`G', `H') that specify particular ranges of `const_double' values. */
1082
1083/* 0.0 and 1.0 for fr0 and fr1. */
1084#define CONST_DOUBLE_OK_FOR_G(VALUE) \
1085 ((VALUE) == CONST0_RTX (GET_MODE (VALUE)) \
1086 || (VALUE) == CONST1_RTX (GET_MODE (VALUE)))
1087
1088#define CONST_DOUBLE_OK_FOR_LETTER_P(VALUE, C) \
1089 ((C) == 'G' ? CONST_DOUBLE_OK_FOR_G (VALUE) : 0)
1090
1091/* A C expression that defines the optional machine-dependent constraint
1092 letters (`Q', `R', `S', `T', `U') that can be used to segregate specific
1093 types of operands, usually memory references, for the target machine. */
1094/* ??? This might be useful considering that we have already used all of the
1095 integer constant contraint letters. */
1096/* #define EXTRA_CONSTRAINT(VALUE, C) */
1097\f
1098/* Basic Stack Layout */
1099
1100/* Define this macro if pushing a word onto the stack moves the stack pointer
1101 to a smaller address. */
1102#define STACK_GROWS_DOWNWARD 1
1103
1104/* Define this macro if the addresses of local variable slots are at negative
1105 offsets from the frame pointer. */
1106#define FRAME_GROWS_DOWNWARD
1107
1108/* Offset from the frame pointer to the first local variable slot to be
1109 allocated. */
1110/* ??? This leaves 16 bytes unused normally, but it looks funny to store locals
1111 into the 16-byte reserved area. */
1112/* ??? This isn't very efficient use of the frame pointer. Better would be
1113 to move it down a ways, so that we have positive and negative offsets. */
1114#define STARTING_FRAME_OFFSET \
1115 (current_function_pretend_args_size \
1116 ? 16 - current_function_pretend_args_size \
1117 : 0)
1118
1119/* Offset from the stack pointer register to the first location at which
1120 outgoing arguments are placed. If not specified, the default value of zero
1121 is used. This is the proper value for most machines. */
1122/* IA64 has a 16 byte scratch area that is at the bottom of the stack. */
1123#define STACK_POINTER_OFFSET 16
1124
1125/* Offset from the argument pointer register to the first argument's address.
1126 On some machines it may depend on the data type of the function. */
1127#define FIRST_PARM_OFFSET(FUNDECL) 0
1128
1129/* A C expression whose value is RTL representing the value of the return
1130 address for the frame COUNT steps up from the current frame, after the
1131 prologue. */
1132
1133/* ??? Frames other than zero would likely require interpreting the frame
1134 unwind info, so we don't try to support them. We would also need to define
1135 DYNAMIC_CHAIN_ADDRESS and SETUP_FRAME_ADDRESS (for the reg stack flush). */
1136
1137/* ??? This only works for non-leaf functions. In a leaf function, the return
1138 address would be in b0 (rp). */
1139
1140#define RETURN_ADDR_RTX(COUNT, FRAMEADDR) \
1141 ((count == 0) \
1142 ? gen_rtx_REG (Pmode, RETURN_ADDRESS_REGNUM) \
1143 : (rtx) 0)
1144
1145/* A C expression whose value is RTL representing the location of the incoming
1146 return address at the beginning of any function, before the prologue. This
1147 RTL is either a `REG', indicating that the return value is saved in `REG',
1148 or a `MEM' representing a location in the stack. This enables DWARF2
1149 unwind info for C++ EH. */
1150#define INCOMING_RETURN_ADDR_RTX gen_rtx_REG (VOIDmode, BR_REG (0))
1151/* ??? This is not defined because of three problems.
1152 1) dwarf2out.c assumes that DWARF_FRAME_RETURN_COLUMN fits in one byte.
1153 The default value is FIRST_PSEUDO_REGISTER which doesn't. This can be
1154 worked around by setting PC_REGNUM to FR_REG (0) which is an otherwise
1155 unused register number.
1156 2) dwarf2out_frame_debug core dumps while processing prologue insns. We
1157 need to refine which insns have RTX_FRAME_RELATED_P set and which don't.
1158 3) It isn't possible to turn off EH frame info by defining DWARF2_UNIND_INFO
1159 to zero, despite what the documentation implies, because it is tested in
1160 a few places with #ifdef instead of #if. */
1161#undef INCOMING_RETURN_ADDR_RTX
1162
1163/* A C expression whose value is an integer giving the offset, in bytes, from
1164 the value of the stack pointer register to the top of the stack frame at the
1165 beginning of any function, before the prologue. The top of the frame is
1166 defined to be the value of the stack pointer in the previous frame, just
1167 before the call instruction. */
1168#define INCOMING_FRAME_SP_OFFSET 0
1169
1170\f
1171/* Register That Address the Stack Frame. */
1172
1173/* The register number of the stack pointer register, which must also be a
1174 fixed register according to `FIXED_REGISTERS'. On most machines, the
1175 hardware determines which register this is. */
1176
1177#define STACK_POINTER_REGNUM 12
1178
1179/* The register number of the frame pointer register, which is used to access
1180 automatic variables in the stack frame. On some machines, the hardware
1181 determines which register this is. On other machines, you can choose any
1182 register you wish for this purpose. */
1183
1184#define FRAME_POINTER_REGNUM 328
1185
1186/* Register number where frame pointer was saved in the prologue, or zero
1187 if it was not saved. */
1188
1189extern int ia64_fp_regno;
1190
1191/* Number of input and local registers used. This is needed for the .regstk
1192 directive, and also for debugging info. */
1193
1194extern int ia64_input_regs;
1195extern int ia64_local_regs;
1196
1197/* The register number of the arg pointer register, which is used to access the
1198 function's argument list. */
1199/* r0 won't otherwise be used, so put the always eliminated argument pointer
1200 in it. */
1201#define ARG_POINTER_REGNUM R_GR(0)
1202
1203/* The register number for the return address register. This is modified by
1204 ia64_expand_prologue to point to the real return address save register. */
1205
1206#define RETURN_ADDRESS_REGNUM 329
1207
1208/* Register numbers used for passing a function's static chain pointer. */
1209
1210#define STATIC_CHAIN_REGNUM 15
1211
1212\f
1213/* Eliminating the Frame Pointer and the Arg Pointer */
1214
1215/* A C expression which is nonzero if a function must have and use a frame
1216 pointer. This expression is evaluated in the reload pass. If its value is
1217 nonzero the function will have a frame pointer. */
1218
1219#define FRAME_POINTER_REQUIRED 0
1220
1221/* If defined, this macro specifies a table of register pairs used to eliminate
1222 unneeded registers that point into the stack frame. */
1223
1224#define ELIMINABLE_REGS \
1225{ \
1226 {ARG_POINTER_REGNUM, STACK_POINTER_REGNUM}, \
1227 {ARG_POINTER_REGNUM, FRAME_POINTER_REGNUM}, \
1228 {FRAME_POINTER_REGNUM, STACK_POINTER_REGNUM} \
1229}
1230
1231/* A C expression that returns non-zero if the compiler is allowed to try to
1232 replace register number FROM with register number TO. There are no ia64
1233 specific restrictions. */
1234
1235#define CAN_ELIMINATE(FROM, TO) 1
1236
1237/* This macro is similar to `INITIAL_FRAME_POINTER_OFFSET'. It specifies the
1238 initial difference between the specified pair of registers. This macro must
1239 be defined if `ELIMINABLE_REGS' is defined. */
1240/* ??? I need to decide whether the frame pointer is the old frame SP
1241 or the new frame SP before dynamic allocs. */
1242#define INITIAL_ELIMINATION_OFFSET(FROM, TO, OFFSET) \
1243{ \
1244 unsigned int size = ia64_compute_frame_size (get_frame_size ()); \
1245 \
1246 if ((FROM) == FRAME_POINTER_REGNUM && (TO) == STACK_POINTER_REGNUM) \
1247 (OFFSET) = size; \
1248 else if ((FROM) == ARG_POINTER_REGNUM) \
1249 { \
1250 switch (TO) \
1251 { \
1252 case FRAME_POINTER_REGNUM: \
1253 /* Arguments start above the 16 byte save area, unless stdarg \
1254 in which case we store through the 16 byte save area. */ \
1255 (OFFSET) = 16 - current_function_pretend_args_size; \
1256 break; \
1257 case STACK_POINTER_REGNUM: \
1258 (OFFSET) = size + 16 - current_function_pretend_args_size; \
1259 break; \
1260 default: \
1261 abort (); \
1262 } \
1263 } \
1264 else \
1265 abort (); \
1266}
1267
1268\f
1269/* Passing Function Arguments on the Stack */
1270
1271/* Define this macro if an argument declared in a prototype as an integral type
1272 smaller than `int' should actually be passed as an `int'. In addition to
1273 avoiding errors in certain cases of mismatch, it also makes for better code
1274 on certain machines. */
1275/* ??? Investigate. */
1276/* #define PROMOTE_PROTOTYPES */
1277
1278/* If defined, the maximum amount of space required for outgoing arguments will
1279 be computed and placed into the variable
1280 `current_function_outgoing_args_size'. */
1281
1282#define ACCUMULATE_OUTGOING_ARGS
1283
1284/* A C expression that should indicate the number of bytes of its own arguments
1285 that a function pops on returning, or 0 if the function pops no arguments
1286 and the caller must therefore pop them all after the function returns. */
1287
1288#define RETURN_POPS_ARGS(FUNDECL, FUNTYPE, STACK_SIZE) 0
1289
1290\f
1291/* Function Arguments in Registers */
1292
1293#define MAX_ARGUMENT_SLOTS 8
1294#define MAX_INT_RETURN_SLOTS 4
1295#define GR_ARG_FIRST IN_REG (0)
1296#define GR_RET_FIRST GR_REG (8)
1297#define GR_RET_LAST GR_REG (11)
1298#define FR_ARG_FIRST FR_REG (8)
1299#define FR_RET_FIRST FR_REG (8)
1300#define FR_RET_LAST FR_REG (15)
1301#define AR_ARG_FIRST OUT_REG (0)
1302
1303/* A C expression that controls whether a function argument is passed in a
1304 register, and which register. */
1305
1306#define FUNCTION_ARG(CUM, MODE, TYPE, NAMED) \
1307 ia64_function_arg (&CUM, MODE, TYPE, NAMED, 0)
1308
1309/* Define this macro if the target machine has "register windows", so that the
1310 register in which a function sees an arguments is not necessarily the same
1311 as the one in which the caller passed the argument. */
1312
1313#define FUNCTION_INCOMING_ARG(CUM, MODE, TYPE, NAMED) \
1314 ia64_function_arg (&CUM, MODE, TYPE, NAMED, 1)
1315
1316/* A C expression for the number of words, at the beginning of an argument,
1317 must be put in registers. The value must be zero for arguments that are
1318 passed entirely in registers or that are entirely pushed on the stack. */
1319
1320#define FUNCTION_ARG_PARTIAL_NREGS(CUM, MODE, TYPE, NAMED) \
1321 ia64_function_arg_partial_nregs (&CUM, MODE, TYPE, NAMED)
1322
1323/* A C expression that indicates when an argument must be passed by reference.
1324 If nonzero for an argument, a copy of that argument is made in memory and a
1325 pointer to the argument is passed instead of the argument itself. The
1326 pointer is passed in whatever way is appropriate for passing a pointer to
1327 that type. */
1328
1329#define FUNCTION_ARG_PASS_BY_REFERENCE(CUM, MODE, TYPE, NAMED) 0
1330
1331/* A C type for declaring a variable that is used as the first argument of
1332 `FUNCTION_ARG' and other related values. For some target machines, the type
1333 `int' suffices and can hold the number of bytes of argument so far. */
1334
1335typedef struct ia64_args
1336{
1337 int words; /* # words of arguments so far */
1338 int fp_regs; /* # FR registers used so far */
1339 int prototype; /* whether function prototyped */
1340} CUMULATIVE_ARGS;
1341
1342/* A C statement (sans semicolon) for initializing the variable CUM for the
1343 state at the beginning of the argument list. */
1344
1345#define INIT_CUMULATIVE_ARGS(CUM, FNTYPE, LIBNAME, INDIRECT) \
1346do { \
1347 (CUM).words = 0; \
1348 (CUM).fp_regs = 0; \
1349 (CUM).prototype = ((FNTYPE) && TYPE_ARG_TYPES (FNTYPE)) || (LIBNAME); \
1350} while (0)
1351
1352/* Like `INIT_CUMULATIVE_ARGS' but overrides it for the purposes of finding the
1353 arguments for the function being compiled. If this macro is undefined,
1354 `INIT_CUMULATIVE_ARGS' is used instead. */
1355
1356/* We set prototype to true so that we never try to return a PARALLEL from
1357 function_arg. */
1358#define INIT_CUMULATIVE_INCOMING_ARGS(CUM, FNTYPE, LIBNAME) \
1359do { \
1360 (CUM).words = 0; \
1361 (CUM).fp_regs = 0; \
1362 (CUM).prototype = 1; \
1363} while (0)
1364
1365/* A C statement (sans semicolon) to update the summarizer variable CUM to
1366 advance past an argument in the argument list. The values MODE, TYPE and
1367 NAMED describe that argument. Once this is done, the variable CUM is
1368 suitable for analyzing the *following* argument with `FUNCTION_ARG'. */
1369
1370#define FUNCTION_ARG_ADVANCE(CUM, MODE, TYPE, NAMED) \
1371 ia64_function_arg_advance (&CUM, MODE, TYPE, NAMED)
1372
1373/* If defined, a C expression that gives the alignment boundary, in bits, of an
1374 argument with the specified mode and type. */
1375
1376/* Arguments larger than 64 bits require 128 bit alignment. */
1377
1378#define FUNCTION_ARG_BOUNDARY(MODE, TYPE) \
1379 (((((MODE) == BLKmode ? int_size_in_bytes (TYPE) : GET_MODE_SIZE (MODE)) \
1380 + UNITS_PER_WORD - 1) / UNITS_PER_WORD) > 1 ? 128 : PARM_BOUNDARY)
1381
1382/* A C expression that is nonzero if REGNO is the number of a hard register in
1383 which function arguments are sometimes passed. This does *not* include
1384 implicit arguments such as the static chain and the structure-value address.
1385 On many machines, no registers can be used for this purpose since all
1386 function arguments are pushed on the stack. */
1387#define FUNCTION_ARG_REGNO_P(REGNO) \
1388(((REGNO) >= GR_ARG_FIRST && (REGNO) < (GR_ARG_FIRST + MAX_ARGUMENT_SLOTS)) \
1389 || ((REGNO) >= FR_ARG_FIRST && (REGNO) < (FR_ARG_FIRST + MAX_ARGUMENT_SLOTS)))
1390\f
1391/* Implement `va_start' for varargs and stdarg. */
1392#define EXPAND_BUILTIN_VA_START(stdarg, valist, nextarg) \
1393 ia64_va_start (stdarg, valist, nextarg)
1394
1395/* Implement `va_arg'. */
1396#define EXPAND_BUILTIN_VA_ARG(valist, type) \
1397 ia64_va_arg (valist, type)
1398\f
1399/* How Scalar Function Values are Returned */
1400
1401/* A C expression to create an RTX representing the place where a function
1402 returns a value of data type VALTYPE. */
1403
1404#define FUNCTION_VALUE(VALTYPE, FUNC) \
1405 ia64_function_value (VALTYPE, FUNC)
1406
1407/* A C expression to create an RTX representing the place where a library
1408 function returns a value of mode MODE. */
1409
1410#define LIBCALL_VALUE(MODE) \
1411 gen_rtx_REG (MODE, \
1412 ((GET_MODE_CLASS (MODE) == MODE_FLOAT \
1413 || GET_MODE_CLASS (MODE) == MODE_COMPLEX_FLOAT) \
1414 ? FR_RET_FIRST : GR_RET_FIRST))
1415
1416/* A C expression that is nonzero if REGNO is the number of a hard register in
1417 which the values of called function may come back. */
1418
1419#define FUNCTION_VALUE_REGNO_P(REGNO) \
1420 (((REGNO) >= GR_RET_FIRST && (REGNO) <= GR_RET_LAST) \
1421 || ((REGNO) >= FR_RET_FIRST && (REGNO) <= FR_RET_LAST))
1422
1423\f
1424/* How Large Values are Returned */
1425
1426/* A nonzero value says to return the function value in memory, just as large
1427 structures are always returned. */
1428
1429#define RETURN_IN_MEMORY(TYPE) \
1430 ia64_return_in_memory (TYPE)
1431
1432/* If you define this macro to be 0, then the conventions used for structure
1433 and union return values are decided by the `RETURN_IN_MEMORY' macro. */
1434
1435#define DEFAULT_PCC_STRUCT_RETURN 0
1436
1437/* If the structure value address is passed in a register, then
1438 `STRUCT_VALUE_REGNUM' should be the number of that register. */
1439
1440#define STRUCT_VALUE_REGNUM GR_REG (8)
1441
1442\f
1443/* Caller-Saves Register Allocation */
1444
1445/* A C expression to determine whether it is worthwhile to consider placing a
1446 pseudo-register in a call-clobbered hard register and saving and restoring
1447 it around each function call. The expression should be 1 when this is worth
1448 doing, and 0 otherwise.
1449
1450 If you don't define this macro, a default is used which is good on most
1451 machines: `4 * CALLS < REFS'. */
1452/* ??? Investigate. */
1453/* #define CALLER_SAVE_PROFITABLE(REFS, CALLS) */
1454
1455\f
1456/* Function Entry and Exit */
1457
1458/* A C compound statement that outputs the assembler code for entry to a
1459 function. */
1460
1461#define FUNCTION_PROLOGUE(FILE, SIZE) \
1462 ia64_function_prologue (FILE, SIZE)
1463
1464/* Define this macro as a C expression that is nonzero if the return
1465 instruction or the function epilogue ignores the value of the stack pointer;
1466 in other words, if it is safe to delete an instruction to adjust the stack
1467 pointer before a return from the function. */
1468
1469#define EXIT_IGNORE_STACK 1
1470
1471/* Define this macro as a C expression that is nonzero for registers
1472 used by the epilogue or the `return' pattern. */
1473
1474#define EPILOGUE_USES(REGNO) ia64_epilogue_uses (REGNO)
1475
1476/* A C compound statement that outputs the assembler code for exit from a
1477 function. */
1478
1479#define FUNCTION_EPILOGUE(FILE, SIZE) \
1480 ia64_function_epilogue (FILE, SIZE)
1481
1482/* A C compound statement that outputs the assembler code for a thunk function,
1483 used to implement C++ virtual function calls with multiple inheritance. */
1484
1485/* ??? This only supports deltas up to 14 bits. If we need more, then we
1486 must load the delta into a register first. */
1487
1488#define ASM_OUTPUT_MI_THUNK(FILE, THUNK_FNDECL, DELTA, FUNCTION) \
1489do { \
1490 fprintf (FILE, "\tadd r32 = %d, r32\n", (DELTA)); \
1491 fprintf (FILE, "\tbr "); \
1492 assemble_name (FILE, XSTR (XEXP (DECL_RTL (FUNCTION), 0), 0)); \
1493 fprintf (FILE, "\n"); \
1494} while (0)
1495
1496\f
1497/* Generating Code for Profiling. */
1498
1499/* A C statement or compound statement to output to FILE some assembler code to
1500 call the profiling subroutine `mcount'. */
1501
1502/* ??? Unclear if this will actually work. No way to test this currently. */
1503
1504#define FUNCTION_PROFILER(FILE, LABELNO) \
1505do { \
1506 char buf[20]; \
1507 ASM_GENERATE_INTERNAL_LABEL (buf, "LP", LABELNO); \
1508 fputs ("\taddl r16 = @ltoff(", FILE); \
1509 assemble_name (FILE, buf); \
1510 fputs ("), gp\n", FILE); \
1511 fputs ("\tmov r17 = r1;;\n", FILE); \
1512 fputs ("\tld8 out0 = [r16]\n", FILE); \
1513 fputs ("\tmov r18 = b0\n", FILE); \
1514 fputs ("\tbr.call.sptk.many rp = mcount;;\n", FILE); \
1515 fputs ("\tmov b0 = r18\n", FILE); \
1516 fputs ("\tmov r1 = r17;;\n", FILE); \
1517} while (0)
1518
1519/* A C statement or compound statement to output to FILE some assembler code to
1520 initialize basic-block profiling for the current object module. */
1521
1522/* ??? Unclear if this will actually work. No way to test this currently. */
1523
1524#define FUNCTION_BLOCK_PROFILER(FILE, LABELNO) \
1525do { \
1526 int labelno = LABELNO; \
1527 switch (profile_block_flag) \
1528 { \
1529 case 2: \
1530 fputs ("\taddl r16 = @ltoff(LPBX0), gp\n", FILE); \
1531 fprintf (FILE, "\tmov out1 = %d;;\n", labelno); \
1532 fputs ("\tld8 out0 = [r16]\n", FILE); \
1533 fputs ("\tmov r17 = r1\n", FILE); \
1534 fputs ("\tmov r18 = b0\n", FILE); \
1535 fputs ("\tbr.call.sptk.many rp = __bb_init_trace_func;;\n", FILE);\
1536 fputs ("\tmov r1 = r17\n", FILE); \
1537 fputs ("\tmov b0 = r18;;\n", FILE); \
1538 break; \
1539 default: \
1540 fputs ("\taddl r16 = @ltoff(LPBX0), gp;;\n", FILE); \
1541 fputs ("\tld8 out0 = [r16];;\n", FILE); \
1542 fputs ("\tld8 r17 = [out0];;\n", FILE); \
1543 fputs ("\tcmp.eq p6, p0 = r0, r17;;\n", FILE); \
1544 fputs ("(p6)\tmov r16 = r1\n", FILE); \
1545 fputs ("(p6)\tmov r17 = b0\n", FILE); \
1546 fputs ("(p6)\tbr.call.sptk.many rp = __bb_init_func;;\n", FILE); \
1547 fputs ("(p6)\tmov r1 = r16\n", FILE); \
1548 fputs ("(p6)\tmov b0 = r17;;\n", FILE); \
1549 break; \
1550 } \
1551} while (0)
1552
1553/* A C statement or compound statement to output to FILE some assembler code to
1554 increment the count associated with the basic block number BLOCKNO. */
1555
1556/* ??? This can't work unless we mark some registers as fixed, so that we
1557 can use them as temporaries in this macro. We need two registers for -a
1558 profiling and 4 registers for -ax profiling. */
1559
1560#define BLOCK_PROFILER(FILE, BLOCKNO) \
1561do { \
1562 int blockn = BLOCKNO; \
1563 switch (profile_block_flag) \
1564 { \
1565 case 2: \
1566 fputs ("\taddl r2 = @ltoff(__bb), gp\n", FILE); \
1567 fputs ("\taddl r3 = @ltoff(LPBX0), gp;;\n", FILE); \
1568 fprintf (FILE, "\tmov r9 = %d\n", blockn); \
1569 fputs ("\tld8 r2 = [r2]\n", FILE); \
1570 fputs ("\tld8 r3 = [r3];;\n", FILE); \
1571 fputs ("\tadd r8 = 8, r2\n", FILE); \
1572 fputs ("\tst8 [r2] = r9;;\n", FILE); \
1573 fputs ("\tst8 [r8] = r3\n", FILE); \
1574 fputs ("\tbr.call.sptk.many rp = __bb_trace_func\n", FILE); \
1575 break; \
1576 \
1577 default: \
1578 fputs ("\taddl r2 = @ltoff(LPBX2), gp;;\n", FILE); \
1579 fputs ("\tld8 r2 = [r2];;\n", FILE); \
1580 fprintf (FILE, "\taddl r2 = %d, r2;;\n", 8 * blockn); \
1581 fputs ("\tld8 r3 = [r2];;\n", FILE); \
1582 fputs ("\tadd r3 = 1, r3;;\n", FILE); \
1583 fputs ("\tst8 [r2] = r3;;\n", FILE); \
1584 break; \
1585 } \
1586} while(0)
1587
1588/* A C statement or compound statement to output to FILE assembler
1589 code to call function `__bb_trace_ret'. */
1590
1591/* ??? Unclear if this will actually work. No way to test this currently. */
1592
1593/* ??? This needs to be emitted into the epilogue. Perhaps rewrite to emit
1594 rtl and call from ia64_expand_epilogue? */
1595
1596#define FUNCTION_BLOCK_PROFILER_EXIT(FILE) \
1597 fputs ("\tbr.call.sptk.many rp = __bb_trace_ret\n", FILE);
1598#undef FUNCTION_BLOCK_PROFILER_EXIT
1599
1600/* A C statement or compound statement to save all registers, which may be
1601 clobbered by a function call, including condition codes. */
1602
1603/* ??? We would have to save 20 GRs, 106 FRs, 10 PRs, 2 BRs, and possibly
1604 other things. This is not practical. Perhaps leave this feature (-ax)
1605 unsupported by undefining above macros? */
1606
1607/* #define MACHINE_STATE_SAVE(ID) */
1608
1609/* A C statement or compound statement to restore all registers, including
1610 condition codes, saved by `MACHINE_STATE_SAVE'. */
1611
1612/* ??? We would have to restore 20 GRs, 106 FRs, 10 PRs, 2 BRs, and possibly
1613 other things. This is not practical. Perhaps leave this feature (-ax)
1614 unsupported by undefining above macros? */
1615
1616/* #define MACHINE_STATE_RESTORE(ID) */
1617
1618\f
1619/* Implementing the Varargs Macros. */
1620
1621/* Define this macro to store the anonymous register arguments into the stack
1622 so that all the arguments appear to have been passed consecutively on the
1623 stack. */
1624
1625#define SETUP_INCOMING_VARARGS(ARGS_SO_FAR, MODE, TYPE, PRETEND_ARGS_SIZE, SECOND_TIME) \
1626 ia64_setup_incoming_varargs (ARGS_SO_FAR, MODE, TYPE, & PRETEND_ARGS_SIZE, SECOND_TIME)
1627
1628/* Define this macro if the location where a function argument is passed
1629 depends on whether or not it is a named argument. */
1630
1631#define STRICT_ARGUMENT_NAMING 1
1632
1633\f
1634/* Trampolines for Nested Functions. */
1635
1636/* We need 32 bytes, so we can save the sp, ar.rnat, ar.bsp, and ar.pfs of
1637 the function containing a non-local goto target. */
1638
1639#define STACK_SAVEAREA_MODE(LEVEL) \
1640 ((LEVEL) == SAVE_NONLOCAL ? OImode : Pmode)
1641
1642/* Output assembler code for a block containing the constant parts of
1643 a trampoline, leaving space for the variable parts.
1644
1645 The trampoline should set the static chain pointer to value placed
1646 into the trampoline and should branch to the specified routine. The
1647 gp doesn't have to be set since that is already done by the caller
1648 of the trampoline. To make the normal indirect-subroutine calling
1649 convention work, the trampoline must look like a function descriptor.
1650 That is, the first word must be the target address, the second
1651 word must be the target's global pointer. The complete trampoline
1652 has the following form:
1653
1654 +----------------+ \
1655 TRAMP: | TRAMP+32 | |
1656 +----------------+ > fake function descriptor
1657 | gp | |
1658 +----------------+ /
1659 | target addr |
1660 +----------------+
1661 | static link |
1662 +----------------+
1663 | mov r2=ip |
1664 + +
1665 | ;; |
1666 +----------------+
1667 | adds r4=-16,r2 |
1668 + adds r15=-8,r2 +
1669 | ;; |
1670 +----------------+
1671 | ld8 r4=[r4];; |
1672 + ld8 r15=[r15] +
1673 | mov b6=r4;; |
1674 +----------------+
1675 | br b6 |
1676 +----------------+
1677*/
1678
1679/* ??? Need a version of this and INITIALIZE_TRAMPOLINE for -mno-pic. */
1680
1681#define TRAMPOLINE_TEMPLATE(FILE) \
1682{ \
1683 fprintf (FILE, \
1684 "\tdata8 0,0,0,0\n" \
1685 "\t{ mov r2=ip }\n" \
1686 "\t;;\n" \
1687 "\t{ adds r4=-16,r2; adds r%d=-8,r2 }\n" \
1688 "\t;;\n" \
1689 "\t{ ld8 r4=[r4];; ld8 r%d=[r%d]; mov b6=r4 }\n" \
1690 "\t;;\n" \
1691 "\t{ br b6 }\n" \
1692 "\t;;\n", \
1693 STATIC_CHAIN_REGNUM, STATIC_CHAIN_REGNUM, \
1694 STATIC_CHAIN_REGNUM); \
1695}
1696
1697/* The name of a subroutine to switch to the section in which the trampoline
1698 template is to be placed.
1699
1700 On ia64, instructions may only be placed in a text segment. */
1701
1702#define TRAMPOLINE_SECTION text_section
1703
1704/* A C expression for the size in bytes of the trampoline, as an integer. */
1705
1706#define TRAMPOLINE_SIZE 96
1707
1708/* Alignment required for trampolines, in bits. */
1709
1710#define TRAMPOLINE_ALIGNMENT 256
1711
1712/* A C statement to initialize the variable parts of a trampoline. */
1713
1714#define INITIALIZE_TRAMPOLINE(ADDR, FNADDR, STATIC_CHAIN) \
1715{ \
1716 rtx addr, addr2, addr_reg, fdesc_addr; \
1717 \
1718 /* Load function descriptor address into a pseudo. */ \
1719 fdesc_addr = gen_reg_rtx (DImode); \
1720 emit_move_insn (fdesc_addr, FNADDR); \
1721 \
1722 /* Read target address from function descriptor and store in \
1723 trampoline. */ \
1724 addr = memory_address (Pmode, plus_constant (ADDR, 16)); \
1725 emit_move_insn (gen_rtx_MEM (Pmode, addr), \
1726 gen_rtx_MEM (Pmode, fdesc_addr)); \
1727 /* Store static chain in trampoline. */ \
1728 addr = memory_address (Pmode, plus_constant (ADDR, 24)); \
1729 emit_move_insn (gen_rtx_MEM (Pmode, addr), STATIC_CHAIN); \
1730 \
1731 /* Load GP value from function descriptor and store in trampoline. */\
1732 addr = memory_address (Pmode, plus_constant (ADDR, 8)); \
1733 addr2 = memory_address (Pmode, plus_constant (fdesc_addr, 8)); \
1734 emit_move_insn (gen_rtx_MEM (Pmode, addr), \
1735 gen_rtx_MEM (Pmode, addr2)); \
1736 \
1737 /* Store trampoline entry address in trampoline. */ \
1738 addr = memory_address (Pmode, ADDR); \
1739 addr2 = memory_address (Pmode, plus_constant (ADDR, 32)); \
1740 emit_move_insn (gen_rtx_MEM (Pmode, addr), addr2); \
1741 \
1742 /* Flush the relevant 64 bytes from the i-cache. */ \
1743 addr_reg = force_reg (DImode, plus_constant (ADDR, 0)); \
1744 emit_insn (gen_rtx_UNSPEC_VOLATILE (VOIDmode, \
1745 gen_rtvec (1, addr_reg), 3)); \
1746}
1747
1748\f
1749/* Implicit Calls to Library Routines */
1750
1751/* ??? The ia64 linux kernel requires that we use the standard names for
1752 divide and modulo routines. However, if we aren't careful, lib1funcs.asm
1753 will be overridden by libgcc2.c. We avoid this by using different names
1754 for lib1funcs.asm modules, e.g. __divdi3 vs _divdi3. Since lib1funcs.asm
1755 goes into libgcc.a first, the linker will find it first. */
1756
1757/* Define this macro as a C statement that declares additional library routines
1758 renames existing ones. */
1759
1760/* ??? Disable the SImode divide routines for now. */
1761#define INIT_TARGET_OPTABS \
1762do { \
1763 sdiv_optab->handlers[(int) SImode].libfunc = 0; \
1764 udiv_optab->handlers[(int) SImode].libfunc = 0; \
1765 smod_optab->handlers[(int) SImode].libfunc = 0; \
1766 umod_optab->handlers[(int) SImode].libfunc = 0; \
1767} while (0)
1768
1769/* Define this macro if GNU CC should generate calls to the System V (and ANSI
1770 C) library functions `memcpy' and `memset' rather than the BSD functions
1771 `bcopy' and `bzero'. */
1772
1773#define TARGET_MEM_FUNCTIONS
1774
1775\f
1776/* Addressing Modes */
1777
1778/* Define this macro if the machine supports post-increment addressing. */
1779
1780#define HAVE_POST_INCREMENT 1
1781#define HAVE_POST_DECREMENT 1
1782
1783/* A C expression that is 1 if the RTX X is a constant which is a valid
1784 address. */
1785
1786#define CONSTANT_ADDRESS_P(X) 0
1787
1788/* The max number of registers that can appear in a valid memory address. */
1789
1790#define MAX_REGS_PER_ADDRESS 1
1791
1792/* A C compound statement with a conditional `goto LABEL;' executed if X (an
1793 RTX) is a legitimate memory address on the target machine for a memory
1794 operand of mode MODE. */
1795
1796/* ??? IA64 post increment addressing mode is much more powerful than this. */
1797
1798#define GO_IF_LEGITIMATE_ADDRESS(MODE, X, LABEL) \
1799do { \
1800 if (GET_CODE (X) == REG && REG_OK_FOR_BASE_P (X)) \
1801 goto LABEL; \
1802 else if (GET_CODE (X) == SUBREG && GET_CODE (XEXP (X, 0)) == REG \
1803 && REG_OK_FOR_BASE_P (XEXP (X, 0))) \
1804 goto LABEL; \
1805 else if (GET_CODE (X) == POST_INC || GET_CODE (X) == POST_DEC) \
1806 { \
1807 if (GET_CODE (XEXP (X, 0)) == REG \
1808 && REG_OK_FOR_BASE_P (XEXP (X, 0))) \
1809 goto LABEL; \
1810 else if (GET_CODE (XEXP (X, 0)) == SUBREG \
1811 && GET_CODE (XEXP (XEXP (X, 0), 0)) == REG \
1812 && REG_OK_FOR_BASE_P (XEXP (XEXP (X, 0), 0))) \
1813 goto LABEL; \
1814 } \
1815} while (0)
1816
1817/* A C expression that is nonzero if X (assumed to be a `reg' RTX) is valid for
1818 use as a base register. */
1819
1820#ifdef REG_OK_STRICT
1821#define REG_OK_FOR_BASE_P(X) REGNO_OK_FOR_BASE_P (REGNO (X))
1822#else
1823#define REG_OK_FOR_BASE_P(X) \
1824 (GENERAL_REGNO_P (REGNO (X)) || (REGNO (X) >= FIRST_PSEUDO_REGISTER))
1825#endif
1826
1827/* A C expression that is nonzero if X (assumed to be a `reg' RTX) is valid for
1828 use as an index register. */
1829
1830#define REG_OK_FOR_INDEX_P(X) 0
1831
1832/* A C compound statement that attempts to replace X with a valid memory
1833 address for an operand of mode MODE.
1834
1835 This must be present, but there is nothing useful to be done here. */
1836
1837#define LEGITIMIZE_ADDRESS(X, OLDX, MODE, WIN)
1838
1839/* A C statement or compound statement with a conditional `goto LABEL;'
1840 executed if memory address X (an RTX) can have different meanings depending
1841 on the machine mode of the memory reference it is used for or if the address
1842 is valid for some modes but not others. */
1843
1844/* ??? Strictly speaking this isn't true, because we can use any increment with
1845 any mode. Unfortunately, the RTL implies that the increment depends on the
1846 mode, so we need this for now. */
1847
1848#define GO_IF_MODE_DEPENDENT_ADDRESS(ADDR, LABEL) \
1849 if (GET_CODE (ADDR) == POST_DEC || GET_CODE (ADDR) == POST_INC) \
1850 goto LABEL;
1851
1852/* A C expression that is nonzero if X is a legitimate constant for an
1853 immediate operand on the target machine. */
1854
1855#define LEGITIMATE_CONSTANT_P(X) \
1856 (GET_CODE (X) != CONST_DOUBLE || GET_MODE (X) == VOIDmode \
1857 || GET_MODE (X) == DImode || CONST_DOUBLE_OK_FOR_G (X)) \
1858
1859\f
1860/* Condition Code Status */
1861
1862/* One some machines not all possible comparisons are defined, but you can
1863 convert an invalid comparison into a valid one. */
1864/* ??? Investigate. See the alpha definition. */
1865/* #define CANONICALIZE_COMPARISON(CODE, OP0, OP1) */
1866
1867\f
1868/* Describing Relative Costs of Operations */
1869
1870/* A part of a C `switch' statement that describes the relative costs of
1871 constant RTL expressions. */
1872
1873/* ??? This is incomplete. */
1874
1875#define CONST_COSTS(X, CODE, OUTER_CODE) \
1876 case CONST_INT: \
1877 if ((X) == const0_rtx) \
1878 return 0; \
1879 case CONST_DOUBLE: \
1880 case CONST: \
1881 case SYMBOL_REF: \
1882 case LABEL_REF: \
1883 return COSTS_N_INSNS (1);
1884
1885/* Like `CONST_COSTS' but applies to nonconstant RTL expressions. */
1886
1887/* ??? Should define this to get better optimized code. */
1888
1889/* We make divide expensive, so that divide-by-constant will be optimized to
1890 a multiply. */
1891
1892#define RTX_COSTS(X, CODE, OUTER_CODE) \
1893 case DIV: \
1894 case UDIV: \
1895 case MOD: \
1896 case UMOD: \
1897 return COSTS_N_INSNS (20);
1898
1899/* An expression giving the cost of an addressing mode that contains ADDRESS.
1900 If not defined, the cost is computed from the ADDRESS expression and the
1901 `CONST_COSTS' values. */
1902
1903#define ADDRESS_COST(ADDRESS) 0
1904
1905/* A C expression for the cost of moving data from a register in class FROM to
1906 one in class TO. */
1907
1908#define REGISTER_MOVE_COST(FROM, TO) \
1909((FROM) == BR_REGS && (TO) == BR_REGS ? 8 \
294dac80
JW
1910 : (((FROM) == BR_REGS && (TO) != GENERAL_REGS) \
1911 || ((TO) == BR_REGS && (FROM) != GENERAL_REGS)) ? 6 \
1912 : (((FROM) == FR_FP_REGS && (TO) == FR_INT_REGS) \
1913 || ((FROM) == FR_INT_REGS && (TO) == FR_FP_REGS)) ? 4 \
c65ebc55
JW
1914 : 2)
1915
1916/* A C expression for the cost of moving data of mode M between a register and
1917 memory. */
1918/* ??? Investigate. Might get better code by defining this. */
1919/* #define MEMORY_MOVE_COST(M,C,I) */
1920
1921/* A C expression for the cost of a branch instruction. A value of 1 is the
1922 default; other values are interpreted relative to that. */
1923/* ??? Investigate. Might get better code by defining this. */
1924/* #define BRANCH_COST */
1925
1926/* Define this macro as a C expression which is nonzero if accessing less than
1927 a word of memory (i.e. a `char' or a `short') is no faster than accessing a
1928 word of memory. */
1929
1930#define SLOW_BYTE_ACCESS 1
1931
1932/* Define this macro if it is as good or better to call a constant function
1933 address than to call an address kept in a register.
1934
1935 Indirect function calls are more expensive that direct function calls, so
1936 don't cse function addresses. */
1937
1938#define NO_FUNCTION_CSE
1939
1940/* A C statement (sans semicolon) to update the integer variable COST based on
1941 the relationship between INSN that is dependent on DEP_INSN through the
1942 dependence LINK. */
1943
1944/* ??? Investigate. */
1945/* #define ADJUST_COST(INSN, LINK, DEP_INSN, COST) */
1946
1947/* A C statement (sans semicolon) to update the integer scheduling
1948 priority `INSN_PRIORITY(INSN)'. */
1949
1950/* ??? Investigate. */
1951/* #define ADJUST_PRIORITY (INSN) */
1952
1953\f
1954/* Dividing the output into sections. */
1955
1956/* A C expression whose value is a string containing the assembler operation
1957 that should precede instructions and read-only data. */
1958
1959#define TEXT_SECTION_ASM_OP ".text"
1960
1961/* A C expression whose value is a string containing the assembler operation to
1962 identify the following data as writable initialized data. */
1963
1964#define DATA_SECTION_ASM_OP ".data"
1965
1966/* If defined, a C expression whose value is a string containing the assembler
1967 operation to identify the following data as uninitialized global data. */
1968
1969#define BSS_SECTION_ASM_OP ".bss"
1970
1971/* Define this macro if jump tables (for `tablejump' insns) should be output in
1972 the text section, along with the assembler instructions. */
1973
1974/* ??? It is probably better for the jump tables to be in the rodata section,
1975 which is where they go by default. Unfortunately, that currently does not
1976 work, because of some problem with pcrelative relocations not getting
1977 resolved correctly. */
1978/* ??? FIXME ??? rth says that we should use @gprel to solve this problem. */
1979/* ??? If jump tables are in the text section, then we can use 4 byte
1980 entries instead of 8 byte entries. */
1981
1982#define JUMP_TABLES_IN_TEXT_SECTION 1
1983
1984/* Define this macro if references to a symbol must be treated differently
1985 depending on something about the variable or function named by the symbol
1986 (such as what section it is in). */
1987
1988#define ENCODE_SECTION_INFO(DECL) ia64_encode_section_info (DECL)
1989
1990#define SDATA_NAME_FLAG_CHAR '@'
1991
1992#define IA64_DEFAULT_GVALUE 8
1993
1994/* Decode SYM_NAME and store the real name part in VAR, sans the characters
1995 that encode section info. */
1996
1997#define STRIP_NAME_ENCODING(VAR, SYMBOL_NAME) \
1998 (VAR) = (SYMBOL_NAME) + ((SYMBOL_NAME)[0] == SDATA_NAME_FLAG_CHAR)
1999
2000\f
2001/* Position Independent Code. */
2002
2003/* The register number of the register used to address a table of static data
2004 addresses in memory. */
2005
2006/* ??? Should modify ia64.md to use pic_offset_table_rtx instead of
2007 gen_rtx_REG (DImode, 1). */
2008
2009/* ??? Should we set flag_pic? Probably need to define
2010 LEGITIMIZE_PIC_OPERAND_P to make that work. */
2011
2012#define PIC_OFFSET_TABLE_REGNUM GR_REG (1)
2013
2014/* Define this macro if the register defined by `PIC_OFFSET_TABLE_REGNUM' is
2015 clobbered by calls. */
2016
2017#define PIC_OFFSET_TABLE_REG_CALL_CLOBBERED
2018
2019\f
2020/* The Overall Framework of an Assembler File. */
2021
2022/* A C string constant describing how to begin a comment in the target
2023 assembler language. The compiler assumes that the comment will end at the
2024 end of the line. */
2025
2026#define ASM_COMMENT_START "//"
2027
2028/* A C string constant for text to be output before each `asm' statement or
2029 group of consecutive ones. */
2030
2031/* ??? This won't work with the Intel assembler, because it does not accept
2032 # as a comment start character. However, //APP does not work in gas, so we
2033 can't use that either. Same problem for ASM_APP_OFF below. */
2034
2035#define ASM_APP_ON "#APP\n"
2036
2037/* A C string constant for text to be output after each `asm' statement or
2038 group of consecutive ones. */
2039
2040#define ASM_APP_OFF "#NO_APP\n"
2041
2042\f
2043/* Output of Data. */
2044
2045/* A C statement to output to the stdio stream STREAM an assembler instruction
2046 to assemble a floating-point constant of `XFmode', `DFmode', `SFmode',
2047 respectively, whose value is VALUE. */
2048
2049/* ??? This has not been tested. Long doubles are really 10 bytes not 12
2050 bytes on ia64. */
2051
2052/* ??? Must reverse the word order for big-endian code? */
2053
2054#define ASM_OUTPUT_LONG_DOUBLE(FILE, VALUE) \
2055do { \
2056 long t[3]; \
2057 REAL_VALUE_TO_TARGET_LONG_DOUBLE (VALUE, t); \
2058 fprintf (FILE, "\tdata8 0x%08lx, 0x%08lx, 0x%08lx\n", \
2059 t[0] & 0xffffffff, t[1] & 0xffffffff, t[2] & 0xffffffff); \
2060} while (0)
2061
2062/* ??? Must reverse the word order for big-endian code? */
2063
2064#define ASM_OUTPUT_DOUBLE(FILE,VALUE) \
2065do { \
2066 long t[2]; \
2067 REAL_VALUE_TO_TARGET_DOUBLE (VALUE, t); \
2068 fprintf (FILE, "\tdata8 0x%08lx%08lx\n", \
2069 t[1] & 0xffffffff, t[0] & 0xffffffff); \
2070} while (0)
2071
2072#define ASM_OUTPUT_FLOAT(FILE,VALUE) \
2073 do { \
2074 long t; \
2075 REAL_VALUE_TO_TARGET_SINGLE (VALUE, t); \
2076 fprintf (FILE, "\tdata4 0x%lx\n", t & 0xffffffff); \
2077} while (0)
2078
2079/* A C statement to output to the stdio stream STREAM an assembler instruction
2080 to assemble an integer of 1, 2, 4, or 8 bytes, respectively, whose value
2081 is VALUE. */
2082
2083/* This is how to output an assembler line defining a `char' constant. */
2084
2085#define ASM_OUTPUT_CHAR(FILE, VALUE) \
2086do { \
2087 fprintf (FILE, "\t%s\t", ASM_BYTE_OP); \
2088 output_addr_const (FILE, (VALUE)); \
2089 fprintf (FILE, "\n"); \
2090} while (0)
2091
2092/* This is how to output an assembler line defining a `short' constant. */
2093
2094#define ASM_OUTPUT_SHORT(FILE, VALUE) \
2095do { \
2096 fprintf (FILE, "\tdata2\t"); \
2097 output_addr_const (FILE, (VALUE)); \
2098 fprintf (FILE, "\n"); \
2099} while (0)
2100
2101/* This is how to output an assembler line defining an `int' constant.
2102 We also handle symbol output here. */
2103
2104/* ??? For ILP32, also need to handle function addresses here. */
2105
2106#define ASM_OUTPUT_INT(FILE, VALUE) \
2107do { \
2108 fprintf (FILE, "\tdata4\t"); \
2109 output_addr_const (FILE, (VALUE)); \
2110 fprintf (FILE, "\n"); \
2111} while (0)
2112
2113/* This is how to output an assembler line defining a `long' constant.
2114 We also handle symbol output here. */
2115
2116#define ASM_OUTPUT_DOUBLE_INT(FILE, VALUE) \
2117do { \
2118 fprintf (FILE, "\tdata8\t"); \
2119 if (SYMBOL_REF_FLAG (VALUE)) \
2120 fprintf (FILE, "@fptr("); \
2121 output_addr_const (FILE, (VALUE)); \
2122 if (SYMBOL_REF_FLAG (VALUE)) \
2123 fprintf (FILE, ")"); \
2124 fprintf (FILE, "\n"); \
2125} while (0)
2126
2127/* A C statement to output to the stdio stream STREAM an assembler instruction
2128 to assemble a single byte containing the number VALUE. */
2129
2130#define ASM_OUTPUT_BYTE(STREAM, VALUE) \
2131 fprintf (STREAM, "\t%s\t0x%x\n", ASM_BYTE_OP, (VALUE))
2132
2133/* These macros are defined as C string constant, describing the syntax in the
2134 assembler for grouping arithmetic expressions. */
2135
2136#define ASM_OPEN_PAREN "("
2137#define ASM_CLOSE_PAREN ")"
2138
2139\f
2140/* Output of Uninitialized Variables. */
2141
2142/* This is all handled by svr4.h. */
2143
2144\f
2145/* Output and Generation of Labels. */
2146
2147/* A C statement (sans semicolon) to output to the stdio stream STREAM the
2148 assembler definition of a label named NAME. */
2149
2150/* See the ASM_OUTPUT_LABELREF definition in sysv4.h for an explanation of
2151 why ia64_asm_output_label exists. */
2152
2153extern int ia64_asm_output_label;
2154#define ASM_OUTPUT_LABEL(STREAM, NAME) \
2155do { \
2156 ia64_asm_output_label = 1; \
2157 assemble_name (STREAM, NAME); \
2158 fputs (":\n", STREAM); \
2159 ia64_asm_output_label = 0; \
2160} while (0)
2161
2162/* A C statement (sans semicolon) to output to the stdio stream STREAM some
2163 commands that will make the label NAME global; that is, available for
2164 reference from other files. */
2165
2166#define ASM_GLOBALIZE_LABEL(STREAM,NAME) \
2167do { \
2168 fputs ("\t.global ", STREAM); \
2169 assemble_name (STREAM, NAME); \
2170 fputs ("\n", STREAM); \
2171} while (0)
2172
2173/* A C statement (sans semicolon) to output to the stdio stream STREAM any text
2174 necessary for declaring the name of an external symbol named NAME which is
2175 referenced in this compilation but not defined. */
2176
2177#define ASM_OUTPUT_EXTERNAL(FILE, DECL, NAME) \
2178 ia64_asm_output_external (FILE, DECL, NAME)
2179
2180/* A C statement to store into the string STRING a label whose name is made
2181 from the string PREFIX and the number NUM. */
2182
2183#define ASM_GENERATE_INTERNAL_LABEL(LABEL, PREFIX, NUM) \
2184do { \
2185 sprintf (LABEL, "*.%s%d", PREFIX, NUM); \
2186} while (0)
2187
2188/* A C expression to assign to OUTVAR (which is a variable of type `char *') a
2189 newly allocated string made from the string NAME and the number NUMBER, with
2190 some suitable punctuation added. */
2191
2192/* ??? Not sure if using a ? in the name for Intel as is safe. */
2193
2194#define ASM_FORMAT_PRIVATE_NAME(OUTVAR, NAME, NUMBER) \
2195do { \
2196 (OUTVAR) = (char *) alloca (strlen (NAME) + 12); \
2197 sprintf (OUTVAR, "%s%c%ld", (NAME), (TARGET_GNU_AS ? '.' : '?'), \
2198 (long)(NUMBER)); \
2199} while (0)
2200
2201/* A C statement to output to the stdio stream STREAM assembler code which
2202 defines (equates) the symbol NAME to have the value VALUE. */
2203
2204#define ASM_OUTPUT_DEF(STREAM, NAME, VALUE) \
2205do { \
2206 assemble_name (STREAM, NAME); \
2207 fputs (" = ", STREAM); \
2208 assemble_name (STREAM, VALUE); \
2209 fputc ('\n', STREAM); \
2210} while (0)
2211
2212\f
2213/* Macros Controlling Initialization Routines. */
2214
2215/* This is handled by svr4.h and sysv4.h. */
2216
2217\f
2218/* Output of Assembler Instructions. */
2219
2220/* A C initializer containing the assembler's names for the machine registers,
2221 each one as a C string constant. */
2222
2223#define REGISTER_NAMES \
2224{ \
2225 /* General registers. */ \
2226 "r0", "r1", "r2", "r3", "r4", "r5", "r6", "r7", "r8", "r9", \
2227 "r10", "r11", "r12", "r13", "r14", "r15", "r16", "r17", "r18", "r19", \
2228 "r20", "r21", "r22", "r23", "r24", "r25", "r26", "r27", "r28", "r29", \
2229 "r30", "r31", \
2230 /* Local registers. */ \
2231 "loc0", "loc1", "loc2", "loc3", "loc4", "loc5", "loc6", "loc7", \
2232 "loc8", "loc9", "loc10","loc11","loc12","loc13","loc14","loc15", \
2233 "loc16","loc17","loc18","loc19","loc20","loc21","loc22","loc23", \
2234 "loc24","loc25","loc26","loc27","loc28","loc29","loc30","loc31", \
2235 "loc32","loc33","loc34","loc35","loc36","loc37","loc38","loc39", \
2236 "loc40","loc41","loc42","loc43","loc44","loc45","loc46","loc47", \
2237 "loc48","loc49","loc50","loc51","loc52","loc53","loc54","loc55", \
2238 "loc56","loc57","loc58","loc59","loc60","loc61","loc62","loc63", \
2239 "loc64","loc65","loc66","loc67","loc68","loc69","loc70","loc71", \
2240 "loc72","loc73","loc74","loc75","loc76","loc77","loc78","loc79", \
2241 /* Input registers. */ \
2242 "in0", "in1", "in2", "in3", "in4", "in5", "in6", "in7", \
2243 /* Output registers. */ \
2244 "out0", "out1", "out2", "out3", "out4", "out5", "out6", "out7", \
2245 /* Floating-point registers. */ \
2246 "f0", "f1", "f2", "f3", "f4", "f5", "f6", "f7", "f8", "f9", \
2247 "f10", "f11", "f12", "f13", "f14", "f15", "f16", "f17", "f18", "f19", \
2248 "f20", "f21", "f22", "f23", "f24", "f25", "f26", "f27", "f28", "f29", \
2249 "f30", "f31", "f32", "f33", "f34", "f35", "f36", "f37", "f38", "f39", \
2250 "f40", "f41", "f42", "f43", "f44", "f45", "f46", "f47", "f48", "f49", \
2251 "f50", "f51", "f52", "f53", "f54", "f55", "f56", "f57", "f58", "f59", \
2252 "f60", "f61", "f62", "f63", "f64", "f65", "f66", "f67", "f68", "f69", \
2253 "f70", "f71", "f72", "f73", "f74", "f75", "f76", "f77", "f78", "f79", \
2254 "f80", "f81", "f82", "f83", "f84", "f85", "f86", "f87", "f88", "f89", \
2255 "f90", "f91", "f92", "f93", "f94", "f95", "f96", "f97", "f98", "f99", \
2256 "f100","f101","f102","f103","f104","f105","f106","f107","f108","f109",\
2257 "f110","f111","f112","f113","f114","f115","f116","f117","f118","f119",\
2258 "f120","f121","f122","f123","f124","f125","f126","f127", \
2259 /* Predicate registers. */ \
2260 "p0", "p1", "p2", "p3", "p4", "p5", "p6", "p7", "p8", "p9", \
2261 "p10", "p11", "p12", "p13", "p14", "p15", "p16", "p17", "p18", "p19", \
2262 "p20", "p21", "p22", "p23", "p24", "p25", "p26", "p27", "p28", "p29", \
2263 "p30", "p31", "p32", "p33", "p34", "p35", "p36", "p37", "p38", "p39", \
2264 "p40", "p41", "p42", "p43", "p44", "p45", "p46", "p47", "p48", "p49", \
2265 "p50", "p51", "p52", "p53", "p54", "p55", "p56", "p57", "p58", "p59", \
2266 "p60", "p61", "p62", "p63", \
2267 /* Branch registers. */ \
2268 "b0", "b1", "b2", "b3", "b4", "b5", "b6", "b7", \
2269 /* Frame pointer. Return address. */ \
2270 "fp", "ra" \
2271}
2272
2273/* If defined, a C initializer for an array of structures containing a name and
2274 a register number. This macro defines additional names for hard registers,
2275 thus allowing the `asm' option in declarations to refer to registers using
2276 alternate names. */
2277
2278#define ADDITIONAL_REGISTER_NAMES \
2279{ \
2280 { "gp", R_GR (1) }, \
2281 { "sp", R_GR (12) }, \
2282 { "in0", IN_REG (0) }, \
2283 { "in1", IN_REG (1) }, \
2284 { "in2", IN_REG (2) }, \
2285 { "in3", IN_REG (3) }, \
2286 { "in4", IN_REG (4) }, \
2287 { "in5", IN_REG (5) }, \
2288 { "in6", IN_REG (6) }, \
2289 { "in7", IN_REG (7) }, \
2290 { "out0", OUT_REG (0) }, \
2291 { "out1", OUT_REG (1) }, \
2292 { "out2", OUT_REG (2) }, \
2293 { "out3", OUT_REG (3) }, \
2294 { "out4", OUT_REG (4) }, \
2295 { "out5", OUT_REG (5) }, \
2296 { "out6", OUT_REG (6) }, \
2297 { "out7", OUT_REG (7) }, \
2298 { "loc0", LOC_REG (0) }, \
2299 { "loc1", LOC_REG (1) }, \
2300 { "loc2", LOC_REG (2) }, \
2301 { "loc3", LOC_REG (3) }, \
2302 { "loc4", LOC_REG (4) }, \
2303 { "loc5", LOC_REG (5) }, \
2304 { "loc6", LOC_REG (6) }, \
2305 { "loc7", LOC_REG (7) }, \
2306 { "loc8", LOC_REG (8) }, \
2307 { "loc9", LOC_REG (9) }, \
2308 { "loc10", LOC_REG (10) }, \
2309 { "loc11", LOC_REG (11) }, \
2310 { "loc12", LOC_REG (12) }, \
2311 { "loc13", LOC_REG (13) }, \
2312 { "loc14", LOC_REG (14) }, \
2313 { "loc15", LOC_REG (15) }, \
2314 { "loc16", LOC_REG (16) }, \
2315 { "loc17", LOC_REG (17) }, \
2316 { "loc18", LOC_REG (18) }, \
2317 { "loc19", LOC_REG (19) }, \
2318 { "loc20", LOC_REG (20) }, \
2319 { "loc21", LOC_REG (21) }, \
2320 { "loc22", LOC_REG (22) }, \
2321 { "loc23", LOC_REG (23) }, \
2322 { "loc24", LOC_REG (24) }, \
2323 { "loc25", LOC_REG (25) }, \
2324 { "loc26", LOC_REG (26) }, \
2325 { "loc27", LOC_REG (27) }, \
2326 { "loc28", LOC_REG (28) }, \
2327 { "loc29", LOC_REG (29) }, \
2328 { "loc30", LOC_REG (30) }, \
2329 { "loc31", LOC_REG (31) }, \
2330 { "loc32", LOC_REG (32) }, \
2331 { "loc33", LOC_REG (33) }, \
2332 { "loc34", LOC_REG (34) }, \
2333 { "loc35", LOC_REG (35) }, \
2334 { "loc36", LOC_REG (36) }, \
2335 { "loc37", LOC_REG (37) }, \
2336 { "loc38", LOC_REG (38) }, \
2337 { "loc39", LOC_REG (39) }, \
2338 { "loc40", LOC_REG (40) }, \
2339 { "loc41", LOC_REG (41) }, \
2340 { "loc42", LOC_REG (42) }, \
2341 { "loc43", LOC_REG (43) }, \
2342 { "loc44", LOC_REG (44) }, \
2343 { "loc45", LOC_REG (45) }, \
2344 { "loc46", LOC_REG (46) }, \
2345 { "loc47", LOC_REG (47) }, \
2346 { "loc48", LOC_REG (48) }, \
2347 { "loc49", LOC_REG (49) }, \
2348 { "loc50", LOC_REG (50) }, \
2349 { "loc51", LOC_REG (51) }, \
2350 { "loc52", LOC_REG (52) }, \
2351 { "loc53", LOC_REG (53) }, \
2352 { "loc54", LOC_REG (54) }, \
2353 { "loc55", LOC_REG (55) }, \
2354 { "loc56", LOC_REG (56) }, \
2355 { "loc57", LOC_REG (57) }, \
2356 { "loc58", LOC_REG (58) }, \
2357 { "loc59", LOC_REG (59) }, \
2358 { "loc60", LOC_REG (60) }, \
2359 { "loc61", LOC_REG (61) }, \
2360 { "loc62", LOC_REG (62) }, \
2361 { "loc63", LOC_REG (63) }, \
2362 { "loc64", LOC_REG (64) }, \
2363 { "loc65", LOC_REG (65) }, \
2364 { "loc66", LOC_REG (66) }, \
2365 { "loc67", LOC_REG (67) }, \
2366 { "loc68", LOC_REG (68) }, \
2367 { "loc69", LOC_REG (69) }, \
2368 { "loc70", LOC_REG (70) }, \
2369 { "loc71", LOC_REG (71) }, \
2370 { "loc72", LOC_REG (72) }, \
2371 { "loc73", LOC_REG (73) }, \
2372 { "loc74", LOC_REG (74) }, \
2373 { "loc75", LOC_REG (75) }, \
2374 { "loc76", LOC_REG (76) }, \
2375 { "loc77", LOC_REG (77) }, \
2376 { "loc78", LOC_REG (78) }, \
794eefd9 2377 { "loc79", LOC_REG (79) }, \
c65ebc55
JW
2378}
2379
2380/* A C compound statement to output to stdio stream STREAM the assembler syntax
2381 for an instruction operand X. X is an RTL expression. */
2382
2383#define PRINT_OPERAND(STREAM, X, CODE) \
2384 ia64_print_operand (STREAM, X, CODE)
2385
2386/* A C expression which evaluates to true if CODE is a valid punctuation
2387 character for use in the `PRINT_OPERAND' macro. */
2388
2389/* ??? Keep this around for now, as we might need it later. */
2390
2391/* #define PRINT_OPERAND_PUNCT_VALID_P(CODE) */
2392
2393/* A C compound statement to output to stdio stream STREAM the assembler syntax
2394 for an instruction operand that is a memory reference whose address is X. X
2395 is an RTL expression. */
2396
2397#define PRINT_OPERAND_ADDRESS(STREAM, X) \
2398 ia64_print_operand_address (STREAM, X)
2399
2400/* If defined, C string expressions to be used for the `%R', `%L', `%U', and
2401 `%I' options of `asm_fprintf' (see `final.c'). */
2402
2403#define REGISTER_PREFIX ""
2404#define LOCAL_LABEL_PREFIX "."
2405#define USER_LABEL_PREFIX ""
2406#define IMMEDIATE_PREFIX ""
2407
2408\f
2409/* Output of dispatch tables. */
2410
2411/* This macro should be provided on machines where the addresses in a dispatch
2412 table are relative to the table's own address. */
2413
2414/* ??? Depends on the pointer size. */
2415
2416#define ASM_OUTPUT_ADDR_DIFF_ELT(STREAM, BODY, VALUE, REL) \
2417 fprintf (STREAM, "\tdata8 .L%d-.L%d\n", VALUE, REL)
2418
2419/* This is how to output an element of a case-vector that is absolute.
2420 (Ia64 does not use such vectors, but we must define this macro anyway.) */
2421
2422#define ASM_OUTPUT_ADDR_VEC_ELT(STREAM, VALUE) abort ()
2423
2424/* Define this if something special must be output at the end of a jump-table.
2425 We need to align back to a 16 byte boundary because offsets are smaller than
2426 instructions. */
2427
2428#define ASM_OUTPUT_CASE_END(STREAM, NUM, TABLE) ASM_OUTPUT_ALIGN (STREAM, 4)
2429
2430/* Jump tables only need 8 byte alignment. */
2431
2432#define ADDR_VEC_ALIGN(ADDR_VEC) 3
2433
2434\f
2435/* Assembler Commands for Exception Regions. */
2436
2437/* ??? This entire section of ia64.h needs to be implemented and then cleaned
2438 up. */
2439
2440/* A C expression to output text to mark the start of an exception region.
2441
2442 This macro need not be defined on most platforms. */
2443/* #define ASM_OUTPUT_EH_REGION_BEG() */
2444
2445/* A C expression to output text to mark the end of an exception region.
2446
2447 This macro need not be defined on most platforms. */
2448/* #define ASM_OUTPUT_EH_REGION_END() */
2449
2450/* A C expression to switch to the section in which the main exception table is
2451 to be placed. The default is a section named `.gcc_except_table' on machines
2452 that support named sections via `ASM_OUTPUT_SECTION_NAME', otherwise if `-fpic'
2453 or `-fPIC' is in effect, the `data_section', otherwise the
2454 `readonly_data_section'. */
2455/* #define EXCEPTION_SECTION() */
2456
2457/* If defined, a C string constant for the assembler operation to switch to the
2458 section for exception handling frame unwind information. If not defined,
2459 GNU CC will provide a default definition if the target supports named
2460 sections. `crtstuff.c' uses this macro to switch to the appropriate
2461 section.
2462
2463 You should define this symbol if your target supports DWARF 2 frame unwind
2464 information and the default definition does not work. */
2465/* #define EH_FRAME_SECTION_ASM_OP */
2466
2467/* A C expression that is nonzero if the normal exception table output should
2468 be omitted.
2469
2470 This macro need not be defined on most platforms. */
2471/* #define OMIT_EH_TABLE() */
2472
2473/* Alternate runtime support for looking up an exception at runtime and finding
2474 the associated handler, if the default method won't work.
2475
2476 This macro need not be defined on most platforms. */
2477/* #define EH_TABLE_LOOKUP() */
2478
2479/* A C expression that decides whether or not the current function needs to
2480 have a function unwinder generated for it. See the file `except.c' for
2481 details on when to define this, and how. */
2482/* #define DOESNT_NEED_UNWINDER */
2483
2484/* An rtx used to mask the return address found via RETURN_ADDR_RTX, so that it
2485 does not contain any extraneous set bits in it. */
2486/* #define MASK_RETURN_ADDR */
2487
2488/* Define this macro to 0 if your target supports DWARF 2 frame unwind
2489 information, but it does not yet work with exception handling. Otherwise,
2490 if your target supports this information (if it defines
2491 `INCOMING_RETURN_ADDR_RTX' and either `UNALIGNED_INT_ASM_OP' or
2492 `OBJECT_FORMAT_ELF'), GCC will provide a default definition of 1.
2493
2494 If this macro is defined to 1, the DWARF 2 unwinder will be the default
2495 exception handling mechanism; otherwise, setjmp/longjmp will be used by
2496 default.
2497
2498 If this macro is defined to anything, the DWARF 2 unwinder will be used
2499 instead of inline unwinders and __unwind_function in the non-setjmp case. */
2500/* #define DWARF2_UNWIND_INFO */
2501
2502\f
2503/* Assembler Commands for Alignment. */
2504
2505/* The alignment (log base 2) to put in front of LABEL, which follows
2506 a BARRIER. */
2507
2508/* ??? Investigate. */
2509
2510/* ??? Emitting align directives increases the size of the line number debug
2511 info, because each .align forces use of an extended opcode. Perhaps try
2512 to fix this in the assembler? */
2513
2514/* #define LABEL_ALIGN_AFTER_BARRIER(LABEL) */
2515
2516/* The desired alignment for the location counter at the beginning
2517 of a loop. */
2518
2519/* ??? Investigate. */
2520/* #define LOOP_ALIGN(LABEL) */
2521
2522/* Define this macro if `ASM_OUTPUT_SKIP' should not be used in the text
2523 section because it fails put zeros in the bytes that are skipped. */
2524
2525#define ASM_NO_SKIP_IN_TEXT 1
2526
2527/* A C statement to output to the stdio stream STREAM an assembler command to
2528 advance the location counter to a multiple of 2 to the POWER bytes. */
2529
2530#define ASM_OUTPUT_ALIGN(STREAM, POWER) \
2531 fprintf (STREAM, "\t.align %d\n", 1<<(POWER))
2532
2533\f
2534/* Macros Affecting all Debug Formats. */
2535
2536/* This is handled in svr4.h and sysv4.h. */
2537
2538\f
2539/* Specific Options for DBX Output. */
2540
2541/* This is handled by dbxelf.h which is included by svr4.h. */
2542
2543\f
2544/* Open ended Hooks for DBX Output. */
2545
2546/* Likewise. */
2547
2548\f
2549/* File names in DBX format. */
2550
2551/* Likewise. */
2552
2553\f
2554/* Macros for SDB and Dwarf Output. */
2555
2556/* Define this macro if GNU CC should produce dwarf version 2 format debugging
2557 output in response to the `-g' option. */
2558
2559#define DWARF2_DEBUGGING_INFO
2560
2561/* Section names for DWARF2 debug info. */
2562
2563#define DEBUG_INFO_SECTION ".debug_info, \"\", \"progbits\""
2564#define ABBREV_SECTION ".debug_abbrev, \"\", \"progbits\""
2565#define ARANGES_SECTION ".debug_aranges, \"\", \"progbits\""
2566#define DEBUG_LINE_SECTION ".debug_line, \"\", \"progbits\""
2567#define PUBNAMES_SECTION ".debug_pubnames, \"\", \"progbits\""
2568
2569/* C string constants giving the pseudo-op to use for a sequence of
2570 2, 4, and 8 byte unaligned constants. dwarf2out.c needs these. */
2571
2572#define UNALIGNED_SHORT_ASM_OP "data2.ua"
2573#define UNALIGNED_INT_ASM_OP "data4.ua"
2574#define UNALIGNED_DOUBLE_INT_ASM_OP "data8.ua"
2575
2576/* We need to override the default definition for this in dwarf2out.c so that
2577 we can emit the necessary # postfix. */
2578#define ASM_NAME_TO_STRING(STR, NAME) \
2579 do { \
2580 if ((NAME)[0] == '*') \
2581 dyn_string_append (STR, NAME + 1); \
2582 else \
2583 { \
2584 char *newstr; \
2585 STRIP_NAME_ENCODING (newstr, NAME); \
2586 dyn_string_append (STR, user_label_prefix); \
2587 dyn_string_append (STR, newstr); \
2588 dyn_string_append (STR, "#"); \
2589 } \
2590 } \
2591 while (0)
2592
2593#define DWARF2_ASM_LINE_DEBUG_INFO (TARGET_DWARF2_ASM)
2594
2595\f
2596/* Cross Compilation and Floating Point. */
2597
2598/* Define to enable software floating point emulation. */
2599#define REAL_ARITHMETIC
2600
2601\f
2602/* Miscellaneous Parameters. */
2603
2604/* Define this if you have defined special-purpose predicates in the file
2605 `MACHINE.c'. For each predicate, list all rtl codes that can be in
2606 expressions matched by the predicate. */
2607
2608#define PREDICATE_CODES \
2609{ "call_operand", {SUBREG, REG, SYMBOL_REF}}, \
2610{ "sdata_symbolic_operand", {SYMBOL_REF, CONST}}, \
2611{ "symbolic_operand", {SYMBOL_REF, CONST, LABEL_REF}}, \
2612{ "function_operand", {SYMBOL_REF}}, \
2613{ "setjmp_operand", {SYMBOL_REF}}, \
2614{ "move_operand", {SUBREG, REG, MEM, CONST_INT, CONST_DOUBLE, \
2615 CONSTANT_P_RTX, SYMBOL_REF, CONST, LABEL_REF}}, \
2616{ "reg_or_0_operand", {SUBREG, REG, CONST_INT}}, \
2617{ "reg_or_6bit_operand", {SUBREG, REG, CONST_INT, CONSTANT_P_RTX}}, \
2618{ "reg_or_8bit_operand", {SUBREG, REG, CONST_INT, CONSTANT_P_RTX}}, \
2619{ "reg_or_8bit_adjusted_operand", {SUBREG, REG, CONST_INT, \
2620 CONSTANT_P_RTX}}, \
2621{ "reg_or_8bit_and_adjusted_operand", {SUBREG, REG, CONST_INT, \
2622 CONSTANT_P_RTX}}, \
2623{ "reg_or_14bit_operand", {SUBREG, REG, CONST_INT, CONSTANT_P_RTX}}, \
2624{ "reg_or_22bit_operand", {SUBREG, REG, CONST_INT, CONSTANT_P_RTX}}, \
2625{ "shift_count_operand", {SUBREG, REG, CONST_INT, CONSTANT_P_RTX}}, \
2626{ "shift_32bit_count_operand", {SUBREG, REG, CONST_INT, \
2627 CONSTANT_P_RTX}}, \
2628{ "shladd_operand", {CONST_INT}}, \
2629{ "fetchadd_operand", {CONST_INT}}, \
2630{ "reg_or_fp01_operand", {SUBREG, REG, CONST_DOUBLE, CONSTANT_P_RTX}}, \
2631{ "normal_comparison_operator", {EQ, NE, GT, LE, GTU, LEU}}, \
2632{ "adjusted_comparison_operator", {LT, GE, LTU, GEU}}, \
2633{ "call_multiple_values_operation", {PARALLEL}},
2634
2635/* An alias for a machine mode name. This is the machine mode that elements of
2636 a jump-table should have. */
2637
2638#define CASE_VECTOR_MODE Pmode
2639
2640/* Define as C expression which evaluates to nonzero if the tablejump
2641 instruction expects the table to contain offsets from the address of the
2642 table. */
2643
2644#define CASE_VECTOR_PC_RELATIVE 1
2645
2646/* Define this macro if operations between registers with integral mode smaller
2647 than a word are always performed on the entire register. */
2648
2649#define WORD_REGISTER_OPERATIONS
2650
2651/* Define this macro to be a C expression indicating when insns that read
2652 memory in MODE, an integral mode narrower than a word, set the bits outside
2653 of MODE to be either the sign-extension or the zero-extension of the data
2654 read. */
2655
2656#define LOAD_EXTEND_OP(MODE) ZERO_EXTEND
2657
2658/* An alias for a tree code that should be used by default for conversion of
2659 floating point values to fixed point. */
2660
2661/* ??? Looks like this macro is obsolete and should be deleted everywhere. */
2662
2663#define IMPLICIT_FIX_EXPR FIX_ROUND_EXPR
2664
2665/* An alias for a tree code that is the easiest kind of division to compile
2666 code for in the general case. */
2667
2668#define EASY_DIV_EXPR TRUNC_DIV_EXPR
2669
2670/* The maximum number of bytes that a single instruction can move quickly from
2671 memory to memory. */
2672#define MOVE_MAX 8
2673
2674/* A C expression which is nonzero if on this machine it is safe to "convert"
2675 an integer of INPREC bits to one of OUTPREC bits (where OUTPREC is smaller
2676 than INPREC) by merely operating on it as if it had only OUTPREC bits. */
2677
2678#define TRULY_NOOP_TRUNCATION(OUTPREC, INPREC) 1
2679
2680/* A C expression describing the value returned by a comparison operator with
2681 an integral mode and stored by a store-flag instruction (`sCOND') when the
2682 condition is true. */
2683
2684/* ??? Investigate using -1 instead of 1. */
2685
2686#define STORE_FLAG_VALUE 1
2687
2688/* An alias for the machine mode for pointers. */
2689
2690/* ??? This would change if we had ILP32 support. */
2691
2692#define Pmode DImode
2693
2694/* An alias for the machine mode used for memory references to functions being
2695 called, in `call' RTL expressions. */
2696
2697#define FUNCTION_MODE Pmode
2698
2699/* Define this macro to handle System V style pragmas: #pragma pack and
2700 #pragma weak. Note, #pragma weak will only be supported if SUPPORT_WEAK is
2701 defined. */
2702
2703#define HANDLE_SYSV_PRAGMA
2704
2705/* If defined, a C expression whose value is nonzero if IDENTIFIER with
2706 arguments ARGS is a valid machine specific attribute for TYPE. The
2707 attributes in ATTRIBUTES have previously been assigned to TYPE. */
2708
2709#define VALID_MACHINE_TYPE_ATTRIBUTE(TYPE, ATTRIBUTES, IDENTIFIER, ARGS) \
2710 ia64_valid_type_attribute (TYPE, ATTRIBUTES, IDENTIFIER, ARGS)
2711
2712/* In rare cases, correct code generation requires extra machine dependent
2713 processing between the second jump optimization pass and delayed branch
2714 scheduling. On those machines, define this macro as a C statement to act on
2715 the code starting at INSN. */
2716
2717#define MACHINE_DEPENDENT_REORG(INSN) ia64_reorg (INSN)
2718
2719/* A C expression for the maximum number of instructions to execute via
2720 conditional execution instructions instead of a branch. A value of
2721 BRANCH_COST+1 is the default if the machine does not use
2722 cc0, and 1 if it does use cc0. */
2723/* ??? Investigate. */
2724/* #define MAX_CONDITIONAL_EXECUTE */
2725
2726/* Indicate how many instructions can be issued at the same time. */
2727
2728/* ??? For now, we just schedule to fill bundles. */
2729
2730#define ISSUE_RATE 3
2731
2732enum ia64_builtins
2733{
2734 IA64_BUILTIN_SYNCHRONIZE,
2735
2736 IA64_BUILTIN_FETCH_AND_ADD_SI,
2737 IA64_BUILTIN_FETCH_AND_SUB_SI,
2738 IA64_BUILTIN_FETCH_AND_OR_SI,
2739 IA64_BUILTIN_FETCH_AND_AND_SI,
2740 IA64_BUILTIN_FETCH_AND_XOR_SI,
2741 IA64_BUILTIN_FETCH_AND_NAND_SI,
2742
2743 IA64_BUILTIN_ADD_AND_FETCH_SI,
2744 IA64_BUILTIN_SUB_AND_FETCH_SI,
2745 IA64_BUILTIN_OR_AND_FETCH_SI,
2746 IA64_BUILTIN_AND_AND_FETCH_SI,
2747 IA64_BUILTIN_XOR_AND_FETCH_SI,
2748 IA64_BUILTIN_NAND_AND_FETCH_SI,
2749
2750 IA64_BUILTIN_BOOL_COMPARE_AND_SWAP_SI,
2751 IA64_BUILTIN_VAL_COMPARE_AND_SWAP_SI,
2752
2753 IA64_BUILTIN_SYNCHRONIZE_SI,
2754
2755 IA64_BUILTIN_LOCK_TEST_AND_SET_SI,
2756
2757 IA64_BUILTIN_LOCK_RELEASE_SI,
2758
2759 IA64_BUILTIN_FETCH_AND_ADD_DI,
2760 IA64_BUILTIN_FETCH_AND_SUB_DI,
2761 IA64_BUILTIN_FETCH_AND_OR_DI,
2762 IA64_BUILTIN_FETCH_AND_AND_DI,
2763 IA64_BUILTIN_FETCH_AND_XOR_DI,
2764 IA64_BUILTIN_FETCH_AND_NAND_DI,
2765
2766 IA64_BUILTIN_ADD_AND_FETCH_DI,
2767 IA64_BUILTIN_SUB_AND_FETCH_DI,
2768 IA64_BUILTIN_OR_AND_FETCH_DI,
2769 IA64_BUILTIN_AND_AND_FETCH_DI,
2770 IA64_BUILTIN_XOR_AND_FETCH_DI,
2771 IA64_BUILTIN_NAND_AND_FETCH_DI,
2772
2773 IA64_BUILTIN_BOOL_COMPARE_AND_SWAP_DI,
2774 IA64_BUILTIN_VAL_COMPARE_AND_SWAP_DI,
2775
2776 IA64_BUILTIN_SYNCHRONIZE_DI,
2777
2778 IA64_BUILTIN_LOCK_TEST_AND_SET_DI,
2779
2780 IA64_BUILTIN_LOCK_RELEASE_DI
2781};
2782
2783/* Codes for expand_compare_and_swap and expand_swap_and_compare. */
2784enum fetchop_code {
2785 IA64_ADD_OP, IA64_SUB_OP, IA64_OR_OP, IA64_AND_OP, IA64_XOR_OP, IA64_NAND_OP
2786};
2787
2788#define MD_INIT_BUILTINS do { \
2789 ia64_init_builtins (); \
2790 } while (0)
2791
2792#define MD_EXPAND_BUILTIN(EXP, TARGET, SUBTARGET, MODE, IGNORE) \
2793 ia64_expand_builtin ((EXP), (TARGET), (SUBTARGET), (MODE), (IGNORE))
2794
2795/* End of ia64.h */
This page took 0.293841 seconds and 5 git commands to generate.