190075Sobrien/* Definitions of target machine GNU compiler.  IA-64 version.
2169689Skan   Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006
3169689Skan   Free Software Foundation, Inc.
490075Sobrien   Contributed by James E. Wilson <wilson@cygnus.com> and
590075Sobrien   		  David Mosberger <davidm@hpl.hp.com>.
690075Sobrien
7132718SkanThis file is part of GCC.
890075Sobrien
9132718SkanGCC is free software; you can redistribute it and/or modify
1090075Sobrienit under the terms of the GNU General Public License as published by
1190075Sobrienthe Free Software Foundation; either version 2, or (at your option)
1290075Sobrienany later version.
1390075Sobrien
14132718SkanGCC is distributed in the hope that it will be useful,
1590075Sobrienbut WITHOUT ANY WARRANTY; without even the implied warranty of
1690075SobrienMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
1790075SobrienGNU General Public License for more details.
1890075Sobrien
1990075SobrienYou should have received a copy of the GNU General Public License
20132718Skanalong with GCC; see the file COPYING.  If not, write to
21169689Skanthe Free Software Foundation, 51 Franklin Street, Fifth Floor,
22169689SkanBoston, MA 02110-1301, USA.  */
2390075Sobrien
2490075Sobrien/* ??? Look at ABI group documents for list of preprocessor macros and
2590075Sobrien   other features required for ABI compliance.  */
2690075Sobrien
2790075Sobrien/* ??? Functions containing a non-local goto target save many registers.  Why?
2890075Sobrien   See for instance execute/920428-2.c.  */
2990075Sobrien
3090075Sobrien
3190075Sobrien/* Run-time target specifications */
3290075Sobrien
33117395Skan/* Target CPU builtins.  */
34117395Skan#define TARGET_CPU_CPP_BUILTINS()		\
35117395Skando {						\
36117395Skan	builtin_assert("cpu=ia64");		\
37117395Skan	builtin_assert("machine=ia64");		\
38117395Skan	builtin_define("__ia64");		\
39117395Skan	builtin_define("__ia64__");		\
40117395Skan	builtin_define("__itanium__");		\
41117395Skan	if (TARGET_BIG_ENDIAN)			\
42117395Skan	  builtin_define("__BIG_ENDIAN__");	\
43117395Skan} while (0)
44117395Skan
45132718Skan#ifndef SUBTARGET_EXTRA_SPECS
46132718Skan#define SUBTARGET_EXTRA_SPECS
47132718Skan#endif
48132718Skan
4996263Sobrien#define EXTRA_SPECS \
50132718Skan  { "asm_extra", ASM_EXTRA_SPEC }, \
51132718Skan  SUBTARGET_EXTRA_SPECS
5290075Sobrien
5390075Sobrien#define CC1_SPEC "%(cc1_cpu) "
5490075Sobrien
5596263Sobrien#define ASM_EXTRA_SPEC ""
5696263Sobrien
57169689Skan/* Variables which are this size or smaller are put in the sdata/sbss
58169689Skan   sections.  */
59169689Skanextern unsigned int ia64_section_threshold;
6096263Sobrien
61132718Skan/* If the assembler supports thread-local storage, assume that the
62132718Skan   system does as well.  If a particular target system has an
63132718Skan   assembler that supports TLS -- but the rest of the system does not
64132718Skan   support TLS -- that system should explicit define TARGET_HAVE_TLS
65132718Skan   to false in its own configuration file.  */
66132718Skan#if !defined(TARGET_HAVE_TLS) && defined(HAVE_AS_TLS)
67132718Skan#define TARGET_HAVE_TLS true
68132718Skan#endif
69132718Skan
70117395Skan#define TARGET_TLS14		(ia64_tls_size == 14)
71117395Skan#define TARGET_TLS22		(ia64_tls_size == 22)
72117395Skan#define TARGET_TLS64		(ia64_tls_size == 64)
73117395Skan
74132718Skan#define TARGET_HPUX		0
75117395Skan#define TARGET_HPUX_LD		0
76117395Skan
77169689Skan#ifndef TARGET_ILP32
78169689Skan#define TARGET_ILP32 0
79169689Skan#endif
80169689Skan
81117395Skan#ifndef HAVE_AS_LTOFFX_LDXMOV_RELOCS
82117395Skan#define HAVE_AS_LTOFFX_LDXMOV_RELOCS 0
83117395Skan#endif
84117395Skan
85169689Skan/* Values for TARGET_INLINE_FLOAT_DIV, TARGET_INLINE_INT_DIV, and
86169689Skan   TARGET_INLINE_SQRT.  */
8790075Sobrien
88169689Skanenum ia64_inline_type
89169689Skan{
90169689Skan  INL_NO = 0,
91169689Skan  INL_MIN_LAT = 1,
92169689Skan  INL_MAX_THR = 2
93169689Skan};
9490075Sobrien
9590075Sobrien/* Default target_flags if no switches are specified  */
9690075Sobrien
9790075Sobrien#ifndef TARGET_DEFAULT
98169689Skan#define TARGET_DEFAULT (MASK_DWARF2_ASM)
9990075Sobrien#endif
10090075Sobrien
10190075Sobrien#ifndef TARGET_CPU_DEFAULT
10290075Sobrien#define TARGET_CPU_DEFAULT 0
10390075Sobrien#endif
10490075Sobrien
105132718Skan/* Which processor to schedule for. The cpu attribute defines a list
106169689Skan   that mirrors this list, so changes to ia64.md must be made at the
107132718Skan   same time.  */
108132718Skan
109132718Skanenum processor_type
110132718Skan{
111169689Skan  PROCESSOR_ITANIUM,			/* Original Itanium.  */
112132718Skan  PROCESSOR_ITANIUM2,
113132718Skan  PROCESSOR_max
114132718Skan};
115132718Skan
116132718Skanextern enum processor_type ia64_tune;
117132718Skan
11890075Sobrien/* Sometimes certain combinations of command options do not make sense on a
11990075Sobrien   particular target machine.  You can define a macro `OVERRIDE_OPTIONS' to
12090075Sobrien   take account of this.  This macro, if defined, is executed once just after
12190075Sobrien   all the command options have been parsed.  */
12290075Sobrien
12390075Sobrien#define OVERRIDE_OPTIONS ia64_override_options ()
12490075Sobrien
12590075Sobrien/* Some machines may desire to change what optimizations are performed for
12690075Sobrien   various optimization levels.  This macro, if defined, is executed once just
12790075Sobrien   after the optimization level is determined and before the remainder of the
12890075Sobrien   command options have been parsed.  Values set in this macro are used as the
12990075Sobrien   default values for the other command line options.  */
13090075Sobrien
13190075Sobrien/* #define OPTIMIZATION_OPTIONS(LEVEL,SIZE) */
13290075Sobrien
13390075Sobrien/* Driver configuration */
13490075Sobrien
135132718Skan/* A C string constant that tells the GCC driver program options to pass to
136132718Skan   `cc1'.  It can also specify how to translate options you give to GCC into
137132718Skan   options for GCC to pass to the `cc1'.  */
13890075Sobrien
13990075Sobrien#undef CC1_SPEC
14090075Sobrien#define CC1_SPEC "%{G*}"
14190075Sobrien
142132718Skan/* A C string constant that tells the GCC driver program options to pass to
143132718Skan   `cc1plus'.  It can also specify how to translate options you give to GCC
144132718Skan   into options for GCC to pass to the `cc1plus'.  */
14590075Sobrien
14690075Sobrien/* #define CC1PLUS_SPEC "" */
14790075Sobrien
14890075Sobrien/* Storage Layout */
14990075Sobrien
15090075Sobrien/* Define this macro to have the value 1 if the most significant bit in a byte
15190075Sobrien   has the lowest number; otherwise define it to have the value zero.  */
15290075Sobrien
15390075Sobrien#define BITS_BIG_ENDIAN 0
15490075Sobrien
15590075Sobrien#define BYTES_BIG_ENDIAN (TARGET_BIG_ENDIAN != 0)
15690075Sobrien
15790075Sobrien/* Define this macro to have the value 1 if, in a multiword object, the most
15890075Sobrien   significant word has the lowest number.  */
15990075Sobrien
16090075Sobrien#define WORDS_BIG_ENDIAN (TARGET_BIG_ENDIAN != 0)
16190075Sobrien
16290075Sobrien#if defined(__BIG_ENDIAN__)
16390075Sobrien#define LIBGCC2_WORDS_BIG_ENDIAN 1
16490075Sobrien#else
16590075Sobrien#define LIBGCC2_WORDS_BIG_ENDIAN 0
16690075Sobrien#endif
16790075Sobrien
16890075Sobrien#define UNITS_PER_WORD 8
16990075Sobrien
17090075Sobrien#define POINTER_SIZE (TARGET_ILP32 ? 32 : 64)
17190075Sobrien
17290075Sobrien/* A C expression whose value is zero if pointers that need to be extended
17390075Sobrien   from being `POINTER_SIZE' bits wide to `Pmode' are sign-extended and one if
174132718Skan   they are zero-extended and negative one if there is a ptr_extend operation.
17590075Sobrien
17690075Sobrien   You need not define this macro if the `POINTER_SIZE' is equal to the width
17790075Sobrien   of `Pmode'.  */
17890075Sobrien/* Need this for 32 bit pointers, see hpux.h for setting it.  */
17990075Sobrien/* #define POINTERS_EXTEND_UNSIGNED */
18090075Sobrien
18190075Sobrien/* A macro to update MODE and UNSIGNEDP when an object whose type is TYPE and
18290075Sobrien   which has the specified mode and signedness is to be stored in a register.
18390075Sobrien   This macro is only called when TYPE is a scalar type.  */
18490075Sobrien#define PROMOTE_MODE(MODE,UNSIGNEDP,TYPE)				\
18590075Sobriendo									\
18690075Sobrien  {									\
18790075Sobrien    if (GET_MODE_CLASS (MODE) == MODE_INT				\
18890075Sobrien	&& GET_MODE_SIZE (MODE) < 4)					\
18990075Sobrien      (MODE) = SImode;							\
19090075Sobrien  }									\
19190075Sobrienwhile (0)
19290075Sobrien
19390075Sobrien#define PARM_BOUNDARY 64
19490075Sobrien
19590075Sobrien/* Define this macro if you wish to preserve a certain alignment for the stack
19690075Sobrien   pointer.  The definition is a C expression for the desired alignment
19790075Sobrien   (measured in bits).  */
19890075Sobrien
19990075Sobrien#define STACK_BOUNDARY 128
20090075Sobrien
20190075Sobrien/* Align frames on double word boundaries */
20290075Sobrien#ifndef IA64_STACK_ALIGN
20390075Sobrien#define IA64_STACK_ALIGN(LOC) (((LOC) + 15) & ~15)
20490075Sobrien#endif
20590075Sobrien
20690075Sobrien#define FUNCTION_BOUNDARY 128
20790075Sobrien
20890075Sobrien/* Optional x86 80-bit float, quad-precision 128-bit float, and quad-word
20990075Sobrien   128 bit integers all require 128 bit alignment.  */
21090075Sobrien#define BIGGEST_ALIGNMENT 128
21190075Sobrien
21290075Sobrien/* If defined, a C expression to compute the alignment for a static variable.
21390075Sobrien   TYPE is the data type, and ALIGN is the alignment that the object
21490075Sobrien   would ordinarily have.  The value of this macro is used instead of that
21590075Sobrien   alignment to align the object.  */
21690075Sobrien
21790075Sobrien#define DATA_ALIGNMENT(TYPE, ALIGN)		\
21890075Sobrien  (TREE_CODE (TYPE) == ARRAY_TYPE		\
21990075Sobrien   && TYPE_MODE (TREE_TYPE (TYPE)) == QImode	\
22090075Sobrien   && (ALIGN) < BITS_PER_WORD ? BITS_PER_WORD : (ALIGN))
22190075Sobrien
22290075Sobrien/* If defined, a C expression to compute the alignment given to a constant that
22390075Sobrien   is being placed in memory.  CONSTANT is the constant and ALIGN is the
22490075Sobrien   alignment that the object would ordinarily have.  The value of this macro is
22590075Sobrien   used instead of that alignment to align the object.  */
22690075Sobrien
22790075Sobrien#define CONSTANT_ALIGNMENT(EXP, ALIGN)  \
22890075Sobrien  (TREE_CODE (EXP) == STRING_CST	\
22990075Sobrien   && (ALIGN) < BITS_PER_WORD ? BITS_PER_WORD : (ALIGN))
23090075Sobrien
23190075Sobrien#define STRICT_ALIGNMENT 1
23290075Sobrien
23390075Sobrien/* Define this if you wish to imitate the way many other C compilers handle
23490075Sobrien   alignment of bitfields and the structures that contain them.
235117395Skan   The behavior is that the type written for a bit-field (`int', `short', or
23690075Sobrien   other integer type) imposes an alignment for the entire structure, as if the
23790075Sobrien   structure really did contain an ordinary field of that type.  In addition,
238117395Skan   the bit-field is placed within the structure so that it would fit within such
23990075Sobrien   a field, not crossing a boundary for it.  */
24090075Sobrien#define PCC_BITFIELD_TYPE_MATTERS 1
24190075Sobrien
24290075Sobrien/* An integer expression for the size in bits of the largest integer machine
24390075Sobrien   mode that should actually be used.  */
24490075Sobrien
24590075Sobrien/* Allow pairs of registers to be used, which is the intent of the default.  */
24690075Sobrien#define MAX_FIXED_MODE_SIZE GET_MODE_BITSIZE (TImode)
24790075Sobrien
24890075Sobrien/* By default, the C++ compiler will use function addresses in the
249117395Skan   vtable entries.  Setting this nonzero tells the compiler to use
25090075Sobrien   function descriptors instead.  The value of this macro says how
25196263Sobrien   many words wide the descriptor is (normally 2).  It is assumed
25290075Sobrien   that the address of a function descriptor may be treated as a
253117395Skan   pointer to a function.
254117395Skan
255117395Skan   For reasons known only to HP, the vtable entries (as opposed to
256117395Skan   normal function descriptors) are 16 bytes wide in 32-bit mode as
257117395Skan   well, even though the 3rd and 4th words are unused.  */
258117395Skan#define TARGET_VTABLE_USES_DESCRIPTORS (TARGET_ILP32 ? 4 : 2)
259117395Skan
260117395Skan/* Due to silliness in the HPUX linker, vtable entries must be
261117395Skan   8-byte aligned even in 32-bit mode.  Rather than create multiple
262117395Skan   ABIs, force this restriction on everyone else too.  */
263117395Skan#define TARGET_VTABLE_ENTRY_ALIGN  64
264117395Skan
265117395Skan/* Due to the above, we need extra padding for the data entries below 0
266117395Skan   to retain the alignment of the descriptors.  */
267117395Skan#define TARGET_VTABLE_DATA_ENTRY_DISTANCE (TARGET_ILP32 ? 2 : 1)
26890075Sobrien
26990075Sobrien/* Layout of Source Language Data Types */
27090075Sobrien
27190075Sobrien#define INT_TYPE_SIZE 32
27290075Sobrien
27390075Sobrien#define SHORT_TYPE_SIZE 16
27490075Sobrien
27590075Sobrien#define LONG_TYPE_SIZE (TARGET_ILP32 ? 32 : 64)
27690075Sobrien
27790075Sobrien#define LONG_LONG_TYPE_SIZE 64
27890075Sobrien
27990075Sobrien#define FLOAT_TYPE_SIZE 32
28090075Sobrien
28190075Sobrien#define DOUBLE_TYPE_SIZE 64
28290075Sobrien
283132718Skan/* long double is XFmode normally, TFmode for HPUX.  */
284169689Skan#define LONG_DOUBLE_TYPE_SIZE (TARGET_HPUX ? 128 : 80)
28590075Sobrien
286132718Skan/* We always want the XFmode operations from libgcc2.c.  */
287169689Skan#define LIBGCC2_LONG_DOUBLE_TYPE_SIZE 80
28890075Sobrien
28990075Sobrien#define DEFAULT_SIGNED_CHAR 1
29090075Sobrien
29190075Sobrien/* A C expression for a string describing the name of the data type to use for
29290075Sobrien   size values.  The typedef name `size_t' is defined using the contents of the
29390075Sobrien   string.  */
29490075Sobrien/* ??? Needs to be defined for P64 code.  */
29590075Sobrien/* #define SIZE_TYPE */
29690075Sobrien
29790075Sobrien/* A C expression for a string describing the name of the data type to use for
29890075Sobrien   the result of subtracting two pointers.  The typedef name `ptrdiff_t' is
29990075Sobrien   defined using the contents of the string.  See `SIZE_TYPE' above for more
30090075Sobrien   information.  */
30190075Sobrien/* ??? Needs to be defined for P64 code.  */
30290075Sobrien/* #define PTRDIFF_TYPE */
30390075Sobrien
30490075Sobrien/* A C expression for a string describing the name of the data type to use for
30590075Sobrien   wide characters.  The typedef name `wchar_t' is defined using the contents
30690075Sobrien   of the string.  See `SIZE_TYPE' above for more information.  */
30790075Sobrien/* #define WCHAR_TYPE */
30890075Sobrien
30990075Sobrien/* A C expression for the size in bits of the data type for wide characters.
31090075Sobrien   This is used in `cpp', which cannot make use of `WCHAR_TYPE'.  */
31190075Sobrien/* #define WCHAR_TYPE_SIZE */
31290075Sobrien
31390075Sobrien
31490075Sobrien/* Register Basics */
31590075Sobrien
31696263Sobrien/* Number of hardware registers known to the compiler.
31790075Sobrien   We have 128 general registers, 128 floating point registers,
31890075Sobrien   64 predicate registers, 8 branch registers, one frame pointer,
31990075Sobrien   and several "application" registers.  */
32090075Sobrien
321122180Skan#define FIRST_PSEUDO_REGISTER 334
32290075Sobrien
32390075Sobrien/* Ranges for the various kinds of registers.  */
32490075Sobrien#define ADDL_REGNO_P(REGNO) ((unsigned HOST_WIDE_INT) (REGNO) <= 3)
32590075Sobrien#define GR_REGNO_P(REGNO) ((unsigned HOST_WIDE_INT) (REGNO) <= 127)
32690075Sobrien#define FR_REGNO_P(REGNO) ((REGNO) >= 128 && (REGNO) <= 255)
327169689Skan#define FP_REGNO_P(REGNO) ((REGNO) >= 128 && (REGNO) <= 254 && (REGNO) != 159)
32890075Sobrien#define PR_REGNO_P(REGNO) ((REGNO) >= 256 && (REGNO) <= 319)
32990075Sobrien#define BR_REGNO_P(REGNO) ((REGNO) >= 320 && (REGNO) <= 327)
33090075Sobrien#define GENERAL_REGNO_P(REGNO) \
331122180Skan  (GR_REGNO_P (REGNO) || (REGNO) == FRAME_POINTER_REGNUM)
33290075Sobrien
33390075Sobrien#define GR_REG(REGNO) ((REGNO) + 0)
33490075Sobrien#define FR_REG(REGNO) ((REGNO) + 128)
33590075Sobrien#define PR_REG(REGNO) ((REGNO) + 256)
33690075Sobrien#define BR_REG(REGNO) ((REGNO) + 320)
33790075Sobrien#define OUT_REG(REGNO) ((REGNO) + 120)
33890075Sobrien#define IN_REG(REGNO) ((REGNO) + 112)
33990075Sobrien#define LOC_REG(REGNO) ((REGNO) + 32)
34090075Sobrien
341122180Skan#define AR_CCV_REGNUM	329
342122180Skan#define AR_UNAT_REGNUM  330
343122180Skan#define AR_PFS_REGNUM	331
344122180Skan#define AR_LC_REGNUM	332
345122180Skan#define AR_EC_REGNUM	333
34690075Sobrien
34790075Sobrien#define IN_REGNO_P(REGNO) ((REGNO) >= IN_REG (0) && (REGNO) <= IN_REG (7))
34890075Sobrien#define LOC_REGNO_P(REGNO) ((REGNO) >= LOC_REG (0) && (REGNO) <= LOC_REG (79))
34990075Sobrien#define OUT_REGNO_P(REGNO) ((REGNO) >= OUT_REG (0) && (REGNO) <= OUT_REG (7))
35090075Sobrien
35190075Sobrien#define AR_M_REGNO_P(REGNO) ((REGNO) == AR_CCV_REGNUM \
35290075Sobrien			     || (REGNO) == AR_UNAT_REGNUM)
35390075Sobrien#define AR_I_REGNO_P(REGNO) ((REGNO) >= AR_PFS_REGNUM \
35490075Sobrien			     && (REGNO) < FIRST_PSEUDO_REGISTER)
35590075Sobrien#define AR_REGNO_P(REGNO) ((REGNO) >= AR_CCV_REGNUM \
35690075Sobrien			   && (REGNO) < FIRST_PSEUDO_REGISTER)
35790075Sobrien
35890075Sobrien
35990075Sobrien/* ??? Don't really need two sets of macros.  I like this one better because
36090075Sobrien   it is less typing.  */
36190075Sobrien#define R_GR(REGNO) GR_REG (REGNO)
36290075Sobrien#define R_FR(REGNO) FR_REG (REGNO)
36390075Sobrien#define R_PR(REGNO) PR_REG (REGNO)
36490075Sobrien#define R_BR(REGNO) BR_REG (REGNO)
36590075Sobrien
36690075Sobrien/* An initializer that says which registers are used for fixed purposes all
36790075Sobrien   throughout the compiled code and are therefore not available for general
36890075Sobrien   allocation.
36990075Sobrien
37090075Sobrien   r0: constant 0
37190075Sobrien   r1: global pointer (gp)
37290075Sobrien   r12: stack pointer (sp)
37390075Sobrien   r13: thread pointer (tp)
37490075Sobrien   f0: constant 0.0
37590075Sobrien   f1: constant 1.0
37690075Sobrien   p0: constant true
37796263Sobrien   fp: eliminable frame pointer */
37890075Sobrien
37990075Sobrien/* The last 16 stacked regs are reserved for the 8 input and 8 output
38090075Sobrien   registers.  */
38190075Sobrien
38290075Sobrien#define FIXED_REGISTERS \
38390075Sobrien{ /* General registers.  */				\
38490075Sobrien  1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0,	\
38590075Sobrien  0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,	\
38690075Sobrien  0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,	\
38790075Sobrien  0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,	\
38890075Sobrien  0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,	\
38990075Sobrien  0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,	\
39090075Sobrien  0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,	\
39190075Sobrien  0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,	\
39290075Sobrien  /* Floating-point registers.  */			\
39390075Sobrien  1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,	\
39490075Sobrien  0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,	\
39590075Sobrien  0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,	\
39690075Sobrien  0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,	\
39790075Sobrien  0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,	\
39890075Sobrien  0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,	\
39990075Sobrien  0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,	\
40090075Sobrien  0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,	\
40190075Sobrien  /* Predicate registers.  */				\
40290075Sobrien  1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,	\
40390075Sobrien  0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,	\
40490075Sobrien  0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,	\
40590075Sobrien  0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,	\
40690075Sobrien  /* Branch registers.  */				\
40790075Sobrien  0, 0, 0, 0, 0, 0, 0, 0,				\
408122180Skan  /*FP CCV UNAT PFS LC EC */				\
409122180Skan     1,  1,   1,  1, 0, 1				\
41090075Sobrien }
41190075Sobrien
41290075Sobrien/* Like `FIXED_REGISTERS' but has 1 for each register that is clobbered
41390075Sobrien   (in general) by function calls as well as for fixed registers.  This
41490075Sobrien   macro therefore identifies the registers that are not available for
41590075Sobrien   general allocation of values that must live across function calls.  */
41690075Sobrien
41790075Sobrien#define CALL_USED_REGISTERS \
41890075Sobrien{ /* General registers.  */				\
41990075Sobrien  1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1,	\
42090075Sobrien  1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,	\
42190075Sobrien  0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,	\
42290075Sobrien  0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,	\
42390075Sobrien  0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,	\
42490075Sobrien  0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,	\
42590075Sobrien  0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,	\
42690075Sobrien  0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1,	\
42790075Sobrien  /* Floating-point registers.  */			\
42890075Sobrien  1, 1, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,	\
42990075Sobrien  0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,	\
43090075Sobrien  1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,	\
43190075Sobrien  1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,	\
43290075Sobrien  1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,	\
43390075Sobrien  1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,	\
43490075Sobrien  1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,	\
43590075Sobrien  1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,	\
43690075Sobrien  /* Predicate registers.  */				\
43790075Sobrien  1, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,	\
43890075Sobrien  0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,	\
43990075Sobrien  0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,	\
44090075Sobrien  0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,	\
44190075Sobrien  /* Branch registers.  */				\
44290075Sobrien  1, 0, 0, 0, 0, 0, 1, 1,				\
443122180Skan  /*FP CCV UNAT PFS LC EC */				\
444122180Skan     1,  1,   1,  1, 0, 1				\
44590075Sobrien}
44690075Sobrien
44796263Sobrien/* Like `CALL_USED_REGISTERS' but used to overcome a historical
44890075Sobrien   problem which makes CALL_USED_REGISTERS *always* include
44996263Sobrien   all the FIXED_REGISTERS.  Until this problem has been
45090075Sobrien   resolved this macro can be used to overcome this situation.
45196263Sobrien   In particular, block_propagate() requires this list
452132718Skan   be accurate, or we can remove registers which should be live.
45390075Sobrien   This macro is used in regs_invalidated_by_call.  */
45490075Sobrien
45590075Sobrien#define CALL_REALLY_USED_REGISTERS \
45690075Sobrien{ /* General registers.  */				\
457169689Skan  0, 1, 1, 1, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 1, 1,	\
45890075Sobrien  1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,	\
45990075Sobrien  0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,	\
46090075Sobrien  0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,	\
46190075Sobrien  0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,	\
46290075Sobrien  0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,	\
46390075Sobrien  0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,	\
46490075Sobrien  0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1,	\
46590075Sobrien  /* Floating-point registers.  */			\
466169689Skan  0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,	\
46790075Sobrien  0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,	\
46890075Sobrien  1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,	\
46990075Sobrien  1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,	\
47090075Sobrien  1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,	\
47190075Sobrien  1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,	\
47290075Sobrien  1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,	\
47390075Sobrien  1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,	\
47490075Sobrien  /* Predicate registers.  */				\
475169689Skan  0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,	\
47690075Sobrien  0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,	\
47790075Sobrien  0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,	\
47890075Sobrien  0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,	\
47990075Sobrien  /* Branch registers.  */				\
48090075Sobrien  1, 0, 0, 0, 0, 0, 1, 1,				\
481122180Skan  /*FP CCV UNAT PFS LC EC */				\
482122180Skan     0,  1,   0,  1, 0, 0				\
48390075Sobrien}
48490075Sobrien
48590075Sobrien
48690075Sobrien/* Define this macro if the target machine has register windows.  This C
48790075Sobrien   expression returns the register number as seen by the called function
48890075Sobrien   corresponding to the register number OUT as seen by the calling function.
48990075Sobrien   Return OUT if register number OUT is not an outbound register.  */
49090075Sobrien
49190075Sobrien#define INCOMING_REGNO(OUT) \
49290075Sobrien  ((unsigned) ((OUT) - OUT_REG (0)) < 8 ? IN_REG ((OUT) - OUT_REG (0)) : (OUT))
49390075Sobrien
49490075Sobrien/* Define this macro if the target machine has register windows.  This C
49590075Sobrien   expression returns the register number as seen by the calling function
49690075Sobrien   corresponding to the register number IN as seen by the called function.
49790075Sobrien   Return IN if register number IN is not an inbound register.  */
49890075Sobrien
49990075Sobrien#define OUTGOING_REGNO(IN) \
50090075Sobrien  ((unsigned) ((IN) - IN_REG (0)) < 8 ? OUT_REG ((IN) - IN_REG (0)) : (IN))
50190075Sobrien
50290075Sobrien/* Define this macro if the target machine has register windows.  This
50390075Sobrien   C expression returns true if the register is call-saved but is in the
50490075Sobrien   register window.  */
50590075Sobrien
50690075Sobrien#define LOCAL_REGNO(REGNO) \
50790075Sobrien  (IN_REGNO_P (REGNO) || LOC_REGNO_P (REGNO))
50890075Sobrien
509169689Skan/* We define CCImode in ia64-modes.def so we need a selector.  */
51090075Sobrien
51190075Sobrien#define SELECT_CC_MODE(OP,X,Y)  CCmode
51290075Sobrien
51390075Sobrien/* Order of allocation of registers */
51490075Sobrien
51590075Sobrien/* If defined, an initializer for a vector of integers, containing the numbers
516132718Skan   of hard registers in the order in which GCC should prefer to use them
51790075Sobrien   (from most preferred to least).
51890075Sobrien
51990075Sobrien   If this macro is not defined, registers are used lowest numbered first (all
52090075Sobrien   else being equal).
52190075Sobrien
52290075Sobrien   One use of this macro is on machines where the highest numbered registers
52390075Sobrien   must always be saved and the save-multiple-registers instruction supports
52490075Sobrien   only sequences of consecutive registers.  On such machines, define
52590075Sobrien   `REG_ALLOC_ORDER' to be an initializer that lists the highest numbered
52690075Sobrien   allocatable register first.  */
52790075Sobrien
52890075Sobrien/* ??? Should the GR return value registers come before or after the rest
52990075Sobrien   of the caller-save GRs?  */
53090075Sobrien
53190075Sobrien#define REG_ALLOC_ORDER							   \
53290075Sobrien{									   \
53390075Sobrien  /* Caller-saved general registers.  */				   \
53490075Sobrien  R_GR (14), R_GR (15), R_GR (16), R_GR (17),				   \
53590075Sobrien  R_GR (18), R_GR (19), R_GR (20), R_GR (21), R_GR (22), R_GR (23),	   \
53690075Sobrien  R_GR (24), R_GR (25), R_GR (26), R_GR (27), R_GR (28), R_GR (29),	   \
53790075Sobrien  R_GR (30), R_GR (31),							   \
53890075Sobrien  /* Output registers.  */						   \
53990075Sobrien  R_GR (120), R_GR (121), R_GR (122), R_GR (123), R_GR (124), R_GR (125),  \
54090075Sobrien  R_GR (126), R_GR (127),						   \
54190075Sobrien  /* Caller-saved general registers, also used for return values.  */	   \
54290075Sobrien  R_GR (8), R_GR (9), R_GR (10), R_GR (11),				   \
54390075Sobrien  /* addl caller-saved general registers.  */				   \
54490075Sobrien  R_GR (2), R_GR (3),							   \
54590075Sobrien  /* Caller-saved FP registers.  */					   \
54690075Sobrien  R_FR (6), R_FR (7),							   \
54790075Sobrien  /* Caller-saved FP registers, used for parameters and return values.  */ \
54890075Sobrien  R_FR (8), R_FR (9), R_FR (10), R_FR (11),				   \
54990075Sobrien  R_FR (12), R_FR (13), R_FR (14), R_FR (15),				   \
55090075Sobrien  /* Rotating caller-saved FP registers.  */				   \
55190075Sobrien  R_FR (32), R_FR (33), R_FR (34), R_FR (35),				   \
55290075Sobrien  R_FR (36), R_FR (37), R_FR (38), R_FR (39), R_FR (40), R_FR (41),	   \
55390075Sobrien  R_FR (42), R_FR (43), R_FR (44), R_FR (45), R_FR (46), R_FR (47),	   \
55490075Sobrien  R_FR (48), R_FR (49), R_FR (50), R_FR (51), R_FR (52), R_FR (53),	   \
55590075Sobrien  R_FR (54), R_FR (55), R_FR (56), R_FR (57), R_FR (58), R_FR (59),	   \
55690075Sobrien  R_FR (60), R_FR (61), R_FR (62), R_FR (63), R_FR (64), R_FR (65),	   \
55790075Sobrien  R_FR (66), R_FR (67), R_FR (68), R_FR (69), R_FR (70), R_FR (71),	   \
55890075Sobrien  R_FR (72), R_FR (73), R_FR (74), R_FR (75), R_FR (76), R_FR (77),	   \
55990075Sobrien  R_FR (78), R_FR (79), R_FR (80), R_FR (81), R_FR (82), R_FR (83),	   \
56090075Sobrien  R_FR (84), R_FR (85), R_FR (86), R_FR (87), R_FR (88), R_FR (89),	   \
56190075Sobrien  R_FR (90), R_FR (91), R_FR (92), R_FR (93), R_FR (94), R_FR (95),	   \
56290075Sobrien  R_FR (96), R_FR (97), R_FR (98), R_FR (99), R_FR (100), R_FR (101),	   \
56390075Sobrien  R_FR (102), R_FR (103), R_FR (104), R_FR (105), R_FR (106), R_FR (107),  \
56490075Sobrien  R_FR (108), R_FR (109), R_FR (110), R_FR (111), R_FR (112), R_FR (113),  \
56590075Sobrien  R_FR (114), R_FR (115), R_FR (116), R_FR (117), R_FR (118), R_FR (119),  \
56690075Sobrien  R_FR (120), R_FR (121), R_FR (122), R_FR (123), R_FR (124), R_FR (125),  \
56790075Sobrien  R_FR (126), R_FR (127),						   \
56890075Sobrien  /* Caller-saved predicate registers.  */				   \
56990075Sobrien  R_PR (6), R_PR (7), R_PR (8), R_PR (9), R_PR (10), R_PR (11),		   \
57090075Sobrien  R_PR (12), R_PR (13), R_PR (14), R_PR (15),				   \
57190075Sobrien  /* Rotating caller-saved predicate registers.  */			   \
57290075Sobrien  R_PR (16), R_PR (17),							   \
57390075Sobrien  R_PR (18), R_PR (19), R_PR (20), R_PR (21), R_PR (22), R_PR (23),	   \
57490075Sobrien  R_PR (24), R_PR (25), R_PR (26), R_PR (27), R_PR (28), R_PR (29),	   \
57590075Sobrien  R_PR (30), R_PR (31), R_PR (32), R_PR (33), R_PR (34), R_PR (35),	   \
57690075Sobrien  R_PR (36), R_PR (37), R_PR (38), R_PR (39), R_PR (40), R_PR (41),	   \
57790075Sobrien  R_PR (42), R_PR (43), R_PR (44), R_PR (45), R_PR (46), R_PR (47),	   \
57890075Sobrien  R_PR (48), R_PR (49), R_PR (50), R_PR (51), R_PR (52), R_PR (53),	   \
57990075Sobrien  R_PR (54), R_PR (55), R_PR (56), R_PR (57), R_PR (58), R_PR (59),	   \
58090075Sobrien  R_PR (60), R_PR (61), R_PR (62), R_PR (63),				   \
58190075Sobrien  /* Caller-saved branch registers.  */					   \
58290075Sobrien  R_BR (6), R_BR (7),							   \
58390075Sobrien									   \
58490075Sobrien  /* Stacked callee-saved general registers.  */			   \
58590075Sobrien  R_GR (32), R_GR (33), R_GR (34), R_GR (35),				   \
58690075Sobrien  R_GR (36), R_GR (37), R_GR (38), R_GR (39), R_GR (40), R_GR (41),	   \
58790075Sobrien  R_GR (42), R_GR (43), R_GR (44), R_GR (45), R_GR (46), R_GR (47),	   \
58890075Sobrien  R_GR (48), R_GR (49), R_GR (50), R_GR (51), R_GR (52), R_GR (53),	   \
58990075Sobrien  R_GR (54), R_GR (55), R_GR (56), R_GR (57), R_GR (58), R_GR (59),	   \
59090075Sobrien  R_GR (60), R_GR (61), R_GR (62), R_GR (63), R_GR (64), R_GR (65),	   \
59190075Sobrien  R_GR (66), R_GR (67), R_GR (68), R_GR (69), R_GR (70), R_GR (71),	   \
59290075Sobrien  R_GR (72), R_GR (73), R_GR (74), R_GR (75), R_GR (76), R_GR (77),	   \
59390075Sobrien  R_GR (78), R_GR (79), R_GR (80), R_GR (81), R_GR (82), R_GR (83),	   \
59490075Sobrien  R_GR (84), R_GR (85), R_GR (86), R_GR (87), R_GR (88), R_GR (89),	   \
59590075Sobrien  R_GR (90), R_GR (91), R_GR (92), R_GR (93), R_GR (94), R_GR (95),	   \
59690075Sobrien  R_GR (96), R_GR (97), R_GR (98), R_GR (99), R_GR (100), R_GR (101),	   \
59790075Sobrien  R_GR (102), R_GR (103), R_GR (104), R_GR (105), R_GR (106), R_GR (107),  \
59890075Sobrien  R_GR (108),								   \
59990075Sobrien  /* Input registers.  */						   \
60090075Sobrien  R_GR (112), R_GR (113), R_GR (114), R_GR (115), R_GR (116), R_GR (117),  \
60190075Sobrien  R_GR (118), R_GR (119),						   \
60290075Sobrien  /* Callee-saved general registers.  */				   \
60390075Sobrien  R_GR (4), R_GR (5), R_GR (6), R_GR (7),				   \
60490075Sobrien  /* Callee-saved FP registers.  */					   \
60590075Sobrien  R_FR (2), R_FR (3), R_FR (4), R_FR (5), R_FR (16), R_FR (17),		   \
60690075Sobrien  R_FR (18), R_FR (19), R_FR (20), R_FR (21), R_FR (22), R_FR (23),	   \
60790075Sobrien  R_FR (24), R_FR (25), R_FR (26), R_FR (27), R_FR (28), R_FR (29),	   \
60890075Sobrien  R_FR (30), R_FR (31),							   \
60990075Sobrien  /* Callee-saved predicate registers.  */				   \
61090075Sobrien  R_PR (1), R_PR (2), R_PR (3), R_PR (4), R_PR (5),			   \
61190075Sobrien  /* Callee-saved branch registers.  */					   \
61290075Sobrien  R_BR (1), R_BR (2), R_BR (3), R_BR (4), R_BR (5),			   \
61390075Sobrien									   \
61490075Sobrien  /* ??? Stacked registers reserved for fp, rp, and ar.pfs.  */		   \
61590075Sobrien  R_GR (109), R_GR (110), R_GR (111),					   \
61690075Sobrien									   \
61790075Sobrien  /* Special general registers.  */					   \
61890075Sobrien  R_GR (0), R_GR (1), R_GR (12), R_GR (13),				   \
61990075Sobrien  /* Special FP registers.  */						   \
62090075Sobrien  R_FR (0), R_FR (1),							   \
62190075Sobrien  /* Special predicate registers.  */					   \
62290075Sobrien  R_PR (0),								   \
62390075Sobrien  /* Special branch registers.  */					   \
62490075Sobrien  R_BR (0),								   \
62590075Sobrien  /* Other fixed registers.  */						   \
626122180Skan  FRAME_POINTER_REGNUM, 						   \
62790075Sobrien  AR_CCV_REGNUM, AR_UNAT_REGNUM, AR_PFS_REGNUM, AR_LC_REGNUM,		   \
62890075Sobrien  AR_EC_REGNUM		  						   \
62990075Sobrien}
63090075Sobrien
63190075Sobrien/* How Values Fit in Registers */
63290075Sobrien
63390075Sobrien/* A C expression for the number of consecutive hard registers, starting at
63490075Sobrien   register number REGNO, required to hold a value of mode MODE.  */
63590075Sobrien
63690075Sobrien/* ??? We say that BImode PR values require two registers.  This allows us to
63790075Sobrien   easily store the normal and inverted values.  We use CCImode to indicate
63890075Sobrien   a single predicate register.  */
63990075Sobrien
64090075Sobrien#define HARD_REGNO_NREGS(REGNO, MODE)					\
64190075Sobrien  ((REGNO) == PR_REG (0) && (MODE) == DImode ? 64			\
64290075Sobrien   : PR_REGNO_P (REGNO) && (MODE) == BImode ? 2				\
64390075Sobrien   : PR_REGNO_P (REGNO) && (MODE) == CCImode ? 1			\
644132718Skan   : FR_REGNO_P (REGNO) && (MODE) == XFmode ? 1				\
645169689Skan   : FR_REGNO_P (REGNO) && (MODE) == XCmode ? 2				\
64690075Sobrien   : (GET_MODE_SIZE (MODE) + UNITS_PER_WORD - 1) / UNITS_PER_WORD)
64790075Sobrien
64890075Sobrien/* A C expression that is nonzero if it is permissible to store a value of mode
64990075Sobrien   MODE in hard register number REGNO (or in several registers starting with
65090075Sobrien   that one).  */
65190075Sobrien
65290075Sobrien#define HARD_REGNO_MODE_OK(REGNO, MODE)				\
65390075Sobrien  (FR_REGNO_P (REGNO) ?						\
65490075Sobrien     GET_MODE_CLASS (MODE) != MODE_CC &&			\
65590075Sobrien     (MODE) != BImode &&					\
656132718Skan     (MODE) != TFmode 						\
65790075Sobrien   : PR_REGNO_P (REGNO) ?					\
65890075Sobrien     (MODE) == BImode || GET_MODE_CLASS (MODE) == MODE_CC	\
659169689Skan   : GR_REGNO_P (REGNO) ?					\
660169689Skan     (MODE) != CCImode && (MODE) != XFmode && (MODE) != XCmode	\
66190075Sobrien   : AR_REGNO_P (REGNO) ? (MODE) == DImode			\
66290075Sobrien   : BR_REGNO_P (REGNO) ? (MODE) == DImode			\
66390075Sobrien   : 0)
66490075Sobrien
66590075Sobrien/* A C expression that is nonzero if it is desirable to choose register
66690075Sobrien   allocation so as to avoid move instructions between a value of mode MODE1
66790075Sobrien   and a value of mode MODE2.
66890075Sobrien
66990075Sobrien   If `HARD_REGNO_MODE_OK (R, MODE1)' and `HARD_REGNO_MODE_OK (R, MODE2)' are
67090075Sobrien   ever different for any R, then `MODES_TIEABLE_P (MODE1, MODE2)' must be
67190075Sobrien   zero.  */
67290075Sobrien/* Don't tie integer and FP modes, as that causes us to get integer registers
673132718Skan   allocated for FP instructions.  XFmode only supported in FP registers so
67490075Sobrien   we can't tie it with any other modes.  */
67590075Sobrien#define MODES_TIEABLE_P(MODE1, MODE2)			\
67690075Sobrien  (GET_MODE_CLASS (MODE1) == GET_MODE_CLASS (MODE2)	\
677169689Skan   && ((((MODE1) == XFmode) || ((MODE1) == XCmode))	\
678169689Skan       == (((MODE2) == XFmode) || ((MODE2) == XCmode)))	\
67990075Sobrien   && (((MODE1) == BImode) == ((MODE2) == BImode)))
680132718Skan
681132718Skan/* Specify the modes required to caller save a given hard regno.
682132718Skan   We need to ensure floating pt regs are not saved as DImode.  */
683132718Skan
684132718Skan#define HARD_REGNO_CALLER_SAVE_MODE(REGNO, NREGS, MODE) \
685132718Skan  ((FR_REGNO_P (REGNO) && (NREGS) == 1) ? XFmode        \
686132718Skan   : choose_hard_reg_mode ((REGNO), (NREGS), false))
68790075Sobrien
68890075Sobrien/* Handling Leaf Functions */
68990075Sobrien
69090075Sobrien/* A C initializer for a vector, indexed by hard register number, which
69190075Sobrien   contains 1 for a register that is allowable in a candidate for leaf function
69290075Sobrien   treatment.  */
69390075Sobrien/* ??? This might be useful.  */
69490075Sobrien/* #define LEAF_REGISTERS */
69590075Sobrien
69690075Sobrien/* A C expression whose value is the register number to which REGNO should be
69790075Sobrien   renumbered, when a function is treated as a leaf function.  */
69890075Sobrien/* ??? This might be useful.  */
69990075Sobrien/* #define LEAF_REG_REMAP(REGNO) */
70090075Sobrien
70190075Sobrien
70290075Sobrien/* Register Classes */
70390075Sobrien
70490075Sobrien/* An enumeral type that must be defined with all the register class names as
70590075Sobrien   enumeral values.  `NO_REGS' must be first.  `ALL_REGS' must be the last
70690075Sobrien   register class, followed by one more enumeral value, `LIM_REG_CLASSES',
70790075Sobrien   which is not a register class but rather tells how many classes there
70890075Sobrien   are.  */
70990075Sobrien/* ??? When compiling without optimization, it is possible for the only use of
71090075Sobrien   a pseudo to be a parameter load from the stack with a REG_EQUIV note.
71190075Sobrien   Regclass handles this case specially and does not assign any costs to the
71290075Sobrien   pseudo.  The pseudo then ends up using the last class before ALL_REGS.
71390075Sobrien   Thus we must not let either PR_REGS or BR_REGS be the last class.  The
71490075Sobrien   testcase for this is gcc.c-torture/execute/va-arg-7.c.  */
71590075Sobrienenum reg_class
71690075Sobrien{
71790075Sobrien  NO_REGS,
71890075Sobrien  PR_REGS,
71990075Sobrien  BR_REGS,
72090075Sobrien  AR_M_REGS,
72190075Sobrien  AR_I_REGS,
72290075Sobrien  ADDL_REGS,
72390075Sobrien  GR_REGS,
724169689Skan  FP_REGS,
72590075Sobrien  FR_REGS,
72690075Sobrien  GR_AND_BR_REGS,
72790075Sobrien  GR_AND_FR_REGS,
72890075Sobrien  ALL_REGS,
72990075Sobrien  LIM_REG_CLASSES
73090075Sobrien};
73190075Sobrien
73290075Sobrien#define GENERAL_REGS GR_REGS
73390075Sobrien
73490075Sobrien/* The number of distinct register classes.  */
73590075Sobrien#define N_REG_CLASSES ((int) LIM_REG_CLASSES)
73690075Sobrien
73790075Sobrien/* An initializer containing the names of the register classes as C string
73890075Sobrien   constants.  These names are used in writing some of the debugging dumps.  */
73990075Sobrien#define REG_CLASS_NAMES \
74090075Sobrien{ "NO_REGS", "PR_REGS", "BR_REGS", "AR_M_REGS", "AR_I_REGS", \
741169689Skan  "ADDL_REGS", "GR_REGS", "FP_REGS", "FR_REGS", \
74290075Sobrien  "GR_AND_BR_REGS", "GR_AND_FR_REGS", "ALL_REGS" }
74390075Sobrien
74490075Sobrien/* An initializer containing the contents of the register classes, as integers
74590075Sobrien   which are bit masks.  The Nth integer specifies the contents of class N.
74690075Sobrien   The way the integer MASK is interpreted is that register R is in the class
74790075Sobrien   if `MASK & (1 << R)' is 1.  */
74890075Sobrien#define REG_CLASS_CONTENTS \
74990075Sobrien{ 							\
75090075Sobrien  /* NO_REGS.  */					\
75190075Sobrien  { 0x00000000, 0x00000000, 0x00000000, 0x00000000,	\
75290075Sobrien    0x00000000, 0x00000000, 0x00000000, 0x00000000,	\
75390075Sobrien    0x00000000, 0x00000000, 0x0000 },			\
75490075Sobrien  /* PR_REGS.  */					\
75590075Sobrien  { 0x00000000, 0x00000000, 0x00000000, 0x00000000,	\
75690075Sobrien    0x00000000, 0x00000000, 0x00000000, 0x00000000,	\
75790075Sobrien    0xFFFFFFFF, 0xFFFFFFFF, 0x0000 },			\
75890075Sobrien  /* BR_REGS.  */					\
75990075Sobrien  { 0x00000000, 0x00000000, 0x00000000, 0x00000000,	\
76090075Sobrien    0x00000000, 0x00000000, 0x00000000, 0x00000000,	\
76190075Sobrien    0x00000000, 0x00000000, 0x00FF },			\
76290075Sobrien  /* AR_M_REGS.  */					\
76390075Sobrien  { 0x00000000, 0x00000000, 0x00000000, 0x00000000,	\
76490075Sobrien    0x00000000, 0x00000000, 0x00000000, 0x00000000,	\
765122180Skan    0x00000000, 0x00000000, 0x0600 },			\
76690075Sobrien  /* AR_I_REGS.  */					\
76790075Sobrien  { 0x00000000, 0x00000000, 0x00000000, 0x00000000,	\
76890075Sobrien    0x00000000, 0x00000000, 0x00000000, 0x00000000,	\
769122180Skan    0x00000000, 0x00000000, 0x3800 },			\
77090075Sobrien  /* ADDL_REGS.  */					\
77190075Sobrien  { 0x0000000F, 0x00000000, 0x00000000, 0x00000000,	\
77290075Sobrien    0x00000000, 0x00000000, 0x00000000, 0x00000000,	\
77390075Sobrien    0x00000000, 0x00000000, 0x0000 },			\
77490075Sobrien  /* GR_REGS.  */					\
77590075Sobrien  { 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF,	\
77690075Sobrien    0x00000000, 0x00000000, 0x00000000, 0x00000000,	\
777122180Skan    0x00000000, 0x00000000, 0x0100 },			\
778169689Skan  /* FP_REGS.  */					\
779169689Skan  { 0x00000000, 0x00000000, 0x00000000, 0x00000000,	\
780169689Skan    0x7FFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0x7FFFFFFF,	\
781169689Skan    0x00000000, 0x00000000, 0x0000 },			\
78290075Sobrien  /* FR_REGS.  */					\
78390075Sobrien  { 0x00000000, 0x00000000, 0x00000000, 0x00000000,	\
78490075Sobrien    0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF,	\
78590075Sobrien    0x00000000, 0x00000000, 0x0000 },			\
78690075Sobrien  /* GR_AND_BR_REGS.  */				\
78790075Sobrien  { 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF,	\
78890075Sobrien    0x00000000, 0x00000000, 0x00000000, 0x00000000,	\
789122180Skan    0x00000000, 0x00000000, 0x01FF },			\
79090075Sobrien  /* GR_AND_FR_REGS.  */				\
79190075Sobrien  { 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF,	\
79290075Sobrien    0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF,	\
793122180Skan    0x00000000, 0x00000000, 0x0100 },			\
79490075Sobrien  /* ALL_REGS.  */					\
79590075Sobrien  { 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF,	\
79690075Sobrien    0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF,	\
797122180Skan    0xFFFFFFFF, 0xFFFFFFFF, 0x3FFF },			\
79890075Sobrien}
79990075Sobrien
80090075Sobrien/* A C expression whose value is a register class containing hard register
80190075Sobrien   REGNO.  In general there is more than one such class; choose a class which
80290075Sobrien   is "minimal", meaning that no smaller class also contains the register.  */
80390075Sobrien/* The NO_REGS case is primarily for the benefit of rws_access_reg, which
80490075Sobrien   may call here with private (invalid) register numbers, such as
80590075Sobrien   REG_VOLATILE.  */
80690075Sobrien#define REGNO_REG_CLASS(REGNO) \
80790075Sobrien(ADDL_REGNO_P (REGNO) ? ADDL_REGS	\
80890075Sobrien : GENERAL_REGNO_P (REGNO) ? GR_REGS	\
809169689Skan : FR_REGNO_P (REGNO) ? (REGNO) != R_FR (31) \
810169689Skan			&& (REGNO) != R_FR(127) ? FP_REGS : FR_REGS \
81190075Sobrien : PR_REGNO_P (REGNO) ? PR_REGS		\
81290075Sobrien : BR_REGNO_P (REGNO) ? BR_REGS		\
81390075Sobrien : AR_M_REGNO_P (REGNO) ? AR_M_REGS	\
81490075Sobrien : AR_I_REGNO_P (REGNO) ? AR_I_REGS	\
81590075Sobrien : NO_REGS)
81690075Sobrien
81790075Sobrien/* A macro whose definition is the name of the class to which a valid base
81890075Sobrien   register must belong.  A base register is one used in an address which is
81990075Sobrien   the register value plus a displacement.  */
82090075Sobrien#define BASE_REG_CLASS GENERAL_REGS
82190075Sobrien
82290075Sobrien/* A macro whose definition is the name of the class to which a valid index
82390075Sobrien   register must belong.  An index register is one used in an address where its
82490075Sobrien   value is either multiplied by a scale factor or added to another register
82590075Sobrien   (as well as added to a displacement).  This is needed for POST_MODIFY.  */
82690075Sobrien#define INDEX_REG_CLASS GENERAL_REGS
82790075Sobrien
82890075Sobrien/* A C expression which defines the machine-dependent operand constraint
82990075Sobrien   letters for register classes.  If CHAR is such a letter, the value should be
83090075Sobrien   the register class corresponding to it.  Otherwise, the value should be
83190075Sobrien   `NO_REGS'.  The register letter `r', corresponding to class `GENERAL_REGS',
83290075Sobrien   will not be passed to this macro; you do not need to handle it.  */
83390075Sobrien
83490075Sobrien#define REG_CLASS_FROM_LETTER(CHAR) \
83590075Sobrien((CHAR) == 'f' ? FR_REGS		\
83690075Sobrien : (CHAR) == 'a' ? ADDL_REGS		\
83790075Sobrien : (CHAR) == 'b' ? BR_REGS		\
83890075Sobrien : (CHAR) == 'c' ? PR_REGS		\
83990075Sobrien : (CHAR) == 'd' ? AR_M_REGS		\
84090075Sobrien : (CHAR) == 'e' ? AR_I_REGS		\
841169689Skan : (CHAR) == 'x' ? FP_REGS		\
84290075Sobrien : NO_REGS)
84390075Sobrien
84490075Sobrien/* A C expression which is nonzero if register number NUM is suitable for use
84590075Sobrien   as a base register in operand addresses.  It may be either a suitable hard
84690075Sobrien   register or a pseudo register that has been allocated such a hard reg.  */
84790075Sobrien#define REGNO_OK_FOR_BASE_P(REGNO) \
84890075Sobrien  (GENERAL_REGNO_P (REGNO) || GENERAL_REGNO_P (reg_renumber[REGNO]))
84990075Sobrien
85090075Sobrien/* A C expression which is nonzero if register number NUM is suitable for use
85190075Sobrien   as an index register in operand addresses.  It may be either a suitable hard
85290075Sobrien   register or a pseudo register that has been allocated such a hard reg.
85390075Sobrien   This is needed for POST_MODIFY.  */
85490075Sobrien#define REGNO_OK_FOR_INDEX_P(NUM) REGNO_OK_FOR_BASE_P (NUM)
85590075Sobrien
85690075Sobrien/* A C expression that places additional restrictions on the register class to
85790075Sobrien   use when it is necessary to copy value X into a register in class CLASS.
85890075Sobrien   The value is a register class; perhaps CLASS, or perhaps another, smaller
85990075Sobrien   class.  */
86090075Sobrien
86190075Sobrien#define PREFERRED_RELOAD_CLASS(X, CLASS) \
862169689Skan  ia64_preferred_reload_class (X, CLASS)
86390075Sobrien
86490075Sobrien/* You should define this macro to indicate to the reload phase that it may
86590075Sobrien   need to allocate at least one register for a reload in addition to the
86690075Sobrien   register to contain the data.  Specifically, if copying X to a register
86790075Sobrien   CLASS in MODE requires an intermediate register, you should define this
86890075Sobrien   to return the largest register class all of whose registers can be used
86990075Sobrien   as intermediate registers or scratch registers.  */
87090075Sobrien
87190075Sobrien#define SECONDARY_RELOAD_CLASS(CLASS, MODE, X) \
87290075Sobrien ia64_secondary_reload_class (CLASS, MODE, X)
87390075Sobrien
87490075Sobrien/* Certain machines have the property that some registers cannot be copied to
87590075Sobrien   some other registers without using memory.  Define this macro on those
876117395Skan   machines to be a C expression that is nonzero if objects of mode M in
87790075Sobrien   registers of CLASS1 can only be copied to registers of class CLASS2 by
87890075Sobrien   storing a register of CLASS1 into memory and loading that memory location
87990075Sobrien   into a register of CLASS2.  */
88090075Sobrien
88190075Sobrien#if 0
882132718Skan/* ??? May need this, but since we've disallowed XFmode in GR_REGS,
88390075Sobrien   I'm not quite sure how it could be invoked.  The normal problems
88490075Sobrien   with unions should be solved with the addressof fiddling done by
885132718Skan   movxf and friends.  */
88690075Sobrien#define SECONDARY_MEMORY_NEEDED(CLASS1, CLASS2, MODE)			\
887169689Skan  (((MODE) == XFmode || (MODE) == XCmode)				\
888169689Skan   && (((CLASS1) == GR_REGS && (CLASS2) == FR_REGS)			\
889169689Skan       || ((CLASS1) == FR_REGS && (CLASS2) == GR_REGS)))
89090075Sobrien#endif
89190075Sobrien
89290075Sobrien/* A C expression for the maximum number of consecutive registers of
89390075Sobrien   class CLASS needed to hold a value of mode MODE.
89490075Sobrien   This is closely related to the macro `HARD_REGNO_NREGS'.  */
89590075Sobrien
89690075Sobrien#define CLASS_MAX_NREGS(CLASS, MODE) \
89790075Sobrien  ((MODE) == BImode && (CLASS) == PR_REGS ? 2			\
898169689Skan   : (((CLASS) == FR_REGS || (CLASS) == FP_REGS) && (MODE) == XFmode) ? 1 \
899169689Skan   : (((CLASS) == FR_REGS || (CLASS) == FP_REGS) && (MODE) == XCmode) ? 2 \
90090075Sobrien   : (GET_MODE_SIZE (MODE) + UNITS_PER_WORD - 1) / UNITS_PER_WORD)
90190075Sobrien
902169689Skan/* In FP regs, we can't change FP values to integer values and vice versa,
903169689Skan   but we can change e.g. DImode to SImode, and V2SFmode into DImode.  */
90490075Sobrien
905169689Skan#define CANNOT_CHANGE_MODE_CLASS(FROM, TO, CLASS) 		\
906169689Skan  (SCALAR_FLOAT_MODE_P (FROM) != SCALAR_FLOAT_MODE_P (TO)	\
907117395Skan   ? reg_classes_intersect_p (CLASS, FR_REGS) : 0)
90890075Sobrien
90990075Sobrien/* A C expression that defines the machine-dependent operand constraint
91090075Sobrien   letters (`I', `J', `K', .. 'P') that specify particular ranges of
91190075Sobrien   integer values.  */
91290075Sobrien
91390075Sobrien/* 14 bit signed immediate for arithmetic instructions.  */
91490075Sobrien#define CONST_OK_FOR_I(VALUE) \
91590075Sobrien  ((unsigned HOST_WIDE_INT)(VALUE) + 0x2000 < 0x4000)
91690075Sobrien/* 22 bit signed immediate for arith instructions with r0/r1/r2/r3 source.  */
91790075Sobrien#define CONST_OK_FOR_J(VALUE) \
91890075Sobrien  ((unsigned HOST_WIDE_INT)(VALUE) + 0x200000 < 0x400000)
91990075Sobrien/* 8 bit signed immediate for logical instructions.  */
92090075Sobrien#define CONST_OK_FOR_K(VALUE) ((unsigned HOST_WIDE_INT)(VALUE) + 0x80 < 0x100)
92190075Sobrien/* 8 bit adjusted signed immediate for compare pseudo-ops.  */
92290075Sobrien#define CONST_OK_FOR_L(VALUE) ((unsigned HOST_WIDE_INT)(VALUE) + 0x7F < 0x100)
92390075Sobrien/* 6 bit unsigned immediate for shift counts.  */
92490075Sobrien#define CONST_OK_FOR_M(VALUE) ((unsigned HOST_WIDE_INT)(VALUE) < 0x40)
92590075Sobrien/* 9 bit signed immediate for load/store post-increments.  */
92690075Sobrien#define CONST_OK_FOR_N(VALUE) ((unsigned HOST_WIDE_INT)(VALUE) + 0x100 < 0x200)
92790075Sobrien/* 0 for r0.  Used by Linux kernel, do not change.  */
92890075Sobrien#define CONST_OK_FOR_O(VALUE) ((VALUE) == 0)
92990075Sobrien/* 0 or -1 for dep instruction.  */
93090075Sobrien#define CONST_OK_FOR_P(VALUE) ((VALUE) == 0 || (VALUE) == -1)
93190075Sobrien
93290075Sobrien#define CONST_OK_FOR_LETTER_P(VALUE, C) \
933169689Skan  ia64_const_ok_for_letter_p (VALUE, C)
93490075Sobrien
93590075Sobrien/* A C expression that defines the machine-dependent operand constraint letters
93690075Sobrien   (`G', `H') that specify particular ranges of `const_double' values.  */
93790075Sobrien
93890075Sobrien/* 0.0 and 1.0 for fr0 and fr1.  */
93990075Sobrien#define CONST_DOUBLE_OK_FOR_G(VALUE) \
94090075Sobrien  ((VALUE) == CONST0_RTX (GET_MODE (VALUE))	\
94190075Sobrien   || (VALUE) == CONST1_RTX (GET_MODE (VALUE)))
94290075Sobrien
94390075Sobrien#define CONST_DOUBLE_OK_FOR_LETTER_P(VALUE, C) \
944169689Skan  ia64_const_double_ok_for_letter_p (VALUE, C)
94590075Sobrien
94690075Sobrien/* A C expression that defines the optional machine-dependent constraint
94790075Sobrien   letters (`Q', `R', `S', `T', `U') that can be used to segregate specific
94890075Sobrien   types of operands, usually memory references, for the target machine.  */
94990075Sobrien
950169689Skan#define EXTRA_CONSTRAINT(VALUE, C) \
951169689Skan  ia64_extra_constraint (VALUE, C)
95290075Sobrien
953169689Skan/* Document the constraints that can accept reloaded memory operands.  This is
954169689Skan   needed by the extended asm support, and by reload.  'Q' accepts mem, but
955169689Skan   only non-volatile mem.  Since we can't reload a volatile mem into a
956169689Skan   non-volatile mem, it can not be listed here.  */
957169689Skan
958169689Skan#define EXTRA_MEMORY_CONSTRAINT(C, STR)  ((C) == 'S')
95990075Sobrien
96090075Sobrien/* Basic Stack Layout */
96190075Sobrien
96290075Sobrien/* Define this macro if pushing a word onto the stack moves the stack pointer
96390075Sobrien   to a smaller address.  */
96490075Sobrien#define STACK_GROWS_DOWNWARD 1
96590075Sobrien
966169689Skan/* Define this macro to nonzero if the addresses of local variable slots
967169689Skan   are at negative offsets from the frame pointer.  */
968169689Skan#define FRAME_GROWS_DOWNWARD 0
96990075Sobrien
97090075Sobrien/* Offset from the frame pointer to the first local variable slot to
97190075Sobrien   be allocated.  */
97290075Sobrien#define STARTING_FRAME_OFFSET 0
97390075Sobrien
97490075Sobrien/* Offset from the stack pointer register to the first location at which
97590075Sobrien   outgoing arguments are placed.  If not specified, the default value of zero
97690075Sobrien   is used.  This is the proper value for most machines.  */
97790075Sobrien/* IA64 has a 16 byte scratch area that is at the bottom of the stack.  */
97890075Sobrien#define STACK_POINTER_OFFSET 16
97990075Sobrien
98090075Sobrien/* Offset from the argument pointer register to the first argument's address.
98190075Sobrien   On some machines it may depend on the data type of the function.  */
98290075Sobrien#define FIRST_PARM_OFFSET(FUNDECL) 0
98390075Sobrien
98490075Sobrien/* A C expression whose value is RTL representing the value of the return
98590075Sobrien   address for the frame COUNT steps up from the current frame, after the
98690075Sobrien   prologue.  */
98790075Sobrien
98890075Sobrien/* ??? Frames other than zero would likely require interpreting the frame
98990075Sobrien   unwind info, so we don't try to support them.  We would also need to define
99090075Sobrien   DYNAMIC_CHAIN_ADDRESS and SETUP_FRAME_ADDRESS (for the reg stack flush).  */
99190075Sobrien
99290075Sobrien#define RETURN_ADDR_RTX(COUNT, FRAME) \
993122180Skan  ia64_return_addr_rtx (COUNT, FRAME)
99490075Sobrien
99590075Sobrien/* A C expression whose value is RTL representing the location of the incoming
99690075Sobrien   return address at the beginning of any function, before the prologue.  This
99790075Sobrien   RTL is either a `REG', indicating that the return value is saved in `REG',
99890075Sobrien   or a `MEM' representing a location in the stack.  This enables DWARF2
99990075Sobrien   unwind info for C++ EH.  */
100090075Sobrien#define INCOMING_RETURN_ADDR_RTX gen_rtx_REG (VOIDmode, BR_REG (0))
100190075Sobrien
100290075Sobrien/* ??? This is not defined because of three problems.
100390075Sobrien   1) dwarf2out.c assumes that DWARF_FRAME_RETURN_COLUMN fits in one byte.
100490075Sobrien   The default value is FIRST_PSEUDO_REGISTER which doesn't.  This can be
100590075Sobrien   worked around by setting PC_REGNUM to FR_REG (0) which is an otherwise
100690075Sobrien   unused register number.
100790075Sobrien   2) dwarf2out_frame_debug core dumps while processing prologue insns.  We
100890075Sobrien   need to refine which insns have RTX_FRAME_RELATED_P set and which don't.
100990075Sobrien   3) It isn't possible to turn off EH frame info by defining DWARF2_UNIND_INFO
101090075Sobrien   to zero, despite what the documentation implies, because it is tested in
101190075Sobrien   a few places with #ifdef instead of #if.  */
101290075Sobrien#undef INCOMING_RETURN_ADDR_RTX
101390075Sobrien
101490075Sobrien/* A C expression whose value is an integer giving the offset, in bytes, from
101590075Sobrien   the value of the stack pointer register to the top of the stack frame at the
101690075Sobrien   beginning of any function, before the prologue.  The top of the frame is
101790075Sobrien   defined to be the value of the stack pointer in the previous frame, just
101890075Sobrien   before the call instruction.  */
1019169689Skan/* The CFA is past the red zone, not at the entry-point stack
1020169689Skan   pointer.  */
1021169689Skan#define INCOMING_FRAME_SP_OFFSET STACK_POINTER_OFFSET
102290075Sobrien
1023169689Skan/* We shorten debug info by using CFA-16 as DW_AT_frame_base.  */
1024169689Skan#define CFA_FRAME_BASE_OFFSET(FUNDECL) (-INCOMING_FRAME_SP_OFFSET)
1025169689Skan
102690075Sobrien
102790075Sobrien/* Register That Address the Stack Frame.  */
102890075Sobrien
102990075Sobrien/* The register number of the stack pointer register, which must also be a
103090075Sobrien   fixed register according to `FIXED_REGISTERS'.  On most machines, the
103190075Sobrien   hardware determines which register this is.  */
103290075Sobrien
103390075Sobrien#define STACK_POINTER_REGNUM 12
103490075Sobrien
103590075Sobrien/* The register number of the frame pointer register, which is used to access
103690075Sobrien   automatic variables in the stack frame.  On some machines, the hardware
103790075Sobrien   determines which register this is.  On other machines, you can choose any
103890075Sobrien   register you wish for this purpose.  */
103990075Sobrien
104090075Sobrien#define FRAME_POINTER_REGNUM 328
104190075Sobrien
104290075Sobrien/* Base register for access to local variables of the function.  */
104390075Sobrien#define HARD_FRAME_POINTER_REGNUM  LOC_REG (79)
104490075Sobrien
104590075Sobrien/* The register number of the arg pointer register, which is used to access the
104690075Sobrien   function's argument list.  */
104790075Sobrien/* r0 won't otherwise be used, so put the always eliminated argument pointer
104890075Sobrien   in it.  */
104990075Sobrien#define ARG_POINTER_REGNUM R_GR(0)
105090075Sobrien
105196263Sobrien/* Due to the way varargs and argument spilling happens, the argument
105296263Sobrien   pointer is not 16-byte aligned like the stack pointer.  */
105396263Sobrien#define INIT_EXPANDERS					\
105496263Sobrien  do {							\
105596263Sobrien    if (cfun && cfun->emit->regno_pointer_align)	\
105696263Sobrien      REGNO_POINTER_ALIGN (ARG_POINTER_REGNUM) = 64;	\
105796263Sobrien  } while (0)
105896263Sobrien
105990075Sobrien/* Register numbers used for passing a function's static chain pointer.  */
106090075Sobrien/* ??? The ABI sez the static chain should be passed as a normal parameter.  */
106190075Sobrien#define STATIC_CHAIN_REGNUM 15
106290075Sobrien
106390075Sobrien/* Eliminating the Frame Pointer and the Arg Pointer */
106490075Sobrien
106590075Sobrien/* A C expression which is nonzero if a function must have and use a frame
106690075Sobrien   pointer.  This expression is evaluated in the reload pass.  If its value is
106790075Sobrien   nonzero the function will have a frame pointer.  */
106890075Sobrien#define FRAME_POINTER_REQUIRED 0
106990075Sobrien
107090075Sobrien/* Show we can debug even without a frame pointer.  */
107190075Sobrien#define CAN_DEBUG_WITHOUT_FP
107290075Sobrien
107390075Sobrien/* If defined, this macro specifies a table of register pairs used to eliminate
107490075Sobrien   unneeded registers that point into the stack frame.  */
107590075Sobrien
107690075Sobrien#define ELIMINABLE_REGS							\
107790075Sobrien{									\
107890075Sobrien  {ARG_POINTER_REGNUM,	 STACK_POINTER_REGNUM},				\
107990075Sobrien  {ARG_POINTER_REGNUM,	 HARD_FRAME_POINTER_REGNUM},			\
108090075Sobrien  {FRAME_POINTER_REGNUM, STACK_POINTER_REGNUM},				\
108190075Sobrien  {FRAME_POINTER_REGNUM, HARD_FRAME_POINTER_REGNUM},			\
108290075Sobrien}
108390075Sobrien
1084117395Skan/* A C expression that returns nonzero if the compiler is allowed to try to
108590075Sobrien   replace register number FROM with register number TO.  The frame pointer
108690075Sobrien   is automatically handled.  */
108790075Sobrien
108890075Sobrien#define CAN_ELIMINATE(FROM, TO) \
108990075Sobrien  (TO == BR_REG (0) ? current_function_is_leaf : 1)
109090075Sobrien
109190075Sobrien/* This macro is similar to `INITIAL_FRAME_POINTER_OFFSET'.  It
109290075Sobrien   specifies the initial difference between the specified pair of
109390075Sobrien   registers.  This macro must be defined if `ELIMINABLE_REGS' is
109490075Sobrien   defined.  */
109590075Sobrien#define INITIAL_ELIMINATION_OFFSET(FROM, TO, OFFSET) \
109690075Sobrien  ((OFFSET) = ia64_initial_elimination_offset ((FROM), (TO)))
109790075Sobrien
109890075Sobrien/* Passing Function Arguments on the Stack */
109990075Sobrien
110090075Sobrien/* If defined, the maximum amount of space required for outgoing arguments will
110190075Sobrien   be computed and placed into the variable
110290075Sobrien   `current_function_outgoing_args_size'.  */
110390075Sobrien
110490075Sobrien#define ACCUMULATE_OUTGOING_ARGS 1
110590075Sobrien
110690075Sobrien/* A C expression that should indicate the number of bytes of its own arguments
110790075Sobrien   that a function pops on returning, or 0 if the function pops no arguments
110890075Sobrien   and the caller must therefore pop them all after the function returns.  */
110990075Sobrien
111090075Sobrien#define RETURN_POPS_ARGS(FUNDECL, FUNTYPE, STACK_SIZE) 0
111190075Sobrien
111290075Sobrien
111390075Sobrien/* Function Arguments in Registers */
111490075Sobrien
111590075Sobrien#define MAX_ARGUMENT_SLOTS 8
111690075Sobrien#define MAX_INT_RETURN_SLOTS 4
111790075Sobrien#define GR_ARG_FIRST IN_REG (0)
111890075Sobrien#define GR_RET_FIRST GR_REG (8)
111990075Sobrien#define GR_RET_LAST  GR_REG (11)
112090075Sobrien#define FR_ARG_FIRST FR_REG (8)
112190075Sobrien#define FR_RET_FIRST FR_REG (8)
112290075Sobrien#define FR_RET_LAST  FR_REG (15)
112390075Sobrien#define AR_ARG_FIRST OUT_REG (0)
112490075Sobrien
112590075Sobrien/* A C expression that controls whether a function argument is passed in a
112690075Sobrien   register, and which register.  */
112790075Sobrien
112890075Sobrien#define FUNCTION_ARG(CUM, MODE, TYPE, NAMED) \
112990075Sobrien  ia64_function_arg (&CUM, MODE, TYPE, NAMED, 0)
113090075Sobrien
113190075Sobrien/* Define this macro if the target machine has "register windows", so that the
113290075Sobrien   register in which a function sees an arguments is not necessarily the same
113390075Sobrien   as the one in which the caller passed the argument.  */
113490075Sobrien
113590075Sobrien#define FUNCTION_INCOMING_ARG(CUM, MODE, TYPE, NAMED) \
113690075Sobrien  ia64_function_arg (&CUM, MODE, TYPE, NAMED, 1)
113790075Sobrien
113890075Sobrien/* A C type for declaring a variable that is used as the first argument of
113990075Sobrien   `FUNCTION_ARG' and other related values.  For some target machines, the type
114090075Sobrien   `int' suffices and can hold the number of bytes of argument so far.  */
114190075Sobrien
114290075Sobrientypedef struct ia64_args
114390075Sobrien{
114490075Sobrien  int words;			/* # words of arguments so far  */
114596263Sobrien  int int_regs;			/* # GR registers used so far  */
114690075Sobrien  int fp_regs;			/* # FR registers used so far  */
114790075Sobrien  int prototype;		/* whether function prototyped  */
114890075Sobrien} CUMULATIVE_ARGS;
114990075Sobrien
115090075Sobrien/* A C statement (sans semicolon) for initializing the variable CUM for the
115190075Sobrien   state at the beginning of the argument list.  */
115290075Sobrien
1153132718Skan#define INIT_CUMULATIVE_ARGS(CUM, FNTYPE, LIBNAME, INDIRECT, N_NAMED_ARGS) \
115490075Sobriendo {									\
115590075Sobrien  (CUM).words = 0;							\
115696263Sobrien  (CUM).int_regs = 0;							\
115790075Sobrien  (CUM).fp_regs = 0;							\
115890075Sobrien  (CUM).prototype = ((FNTYPE) && TYPE_ARG_TYPES (FNTYPE)) || (LIBNAME);	\
115990075Sobrien} while (0)
116090075Sobrien
116190075Sobrien/* Like `INIT_CUMULATIVE_ARGS' but overrides it for the purposes of finding the
116290075Sobrien   arguments for the function being compiled.  If this macro is undefined,
116390075Sobrien   `INIT_CUMULATIVE_ARGS' is used instead.  */
116490075Sobrien
116590075Sobrien/* We set prototype to true so that we never try to return a PARALLEL from
116690075Sobrien   function_arg.  */
116790075Sobrien#define INIT_CUMULATIVE_INCOMING_ARGS(CUM, FNTYPE, LIBNAME) \
116890075Sobriendo {									\
116990075Sobrien  (CUM).words = 0;							\
117096263Sobrien  (CUM).int_regs = 0;							\
117190075Sobrien  (CUM).fp_regs = 0;							\
117290075Sobrien  (CUM).prototype = 1;							\
117390075Sobrien} while (0)
117490075Sobrien
117590075Sobrien/* A C statement (sans semicolon) to update the summarizer variable CUM to
117690075Sobrien   advance past an argument in the argument list.  The values MODE, TYPE and
117790075Sobrien   NAMED describe that argument.  Once this is done, the variable CUM is
117890075Sobrien   suitable for analyzing the *following* argument with `FUNCTION_ARG'.  */
117990075Sobrien
118090075Sobrien#define FUNCTION_ARG_ADVANCE(CUM, MODE, TYPE, NAMED) \
118190075Sobrien ia64_function_arg_advance (&CUM, MODE, TYPE, NAMED)
118290075Sobrien
118390075Sobrien/* If defined, a C expression that gives the alignment boundary, in bits, of an
118490075Sobrien   argument with the specified mode and type.  */
118590075Sobrien
1186169689Skan/* Return the alignment boundary in bits for an argument with a specified
1187169689Skan   mode and type.  */
118890075Sobrien
118990075Sobrien#define FUNCTION_ARG_BOUNDARY(MODE, TYPE) \
1190169689Skan  ia64_function_arg_boundary (MODE, TYPE)
119190075Sobrien
119290075Sobrien/* A C expression that is nonzero if REGNO is the number of a hard register in
119390075Sobrien   which function arguments are sometimes passed.  This does *not* include
119490075Sobrien   implicit arguments such as the static chain and the structure-value address.
119590075Sobrien   On many machines, no registers can be used for this purpose since all
119690075Sobrien   function arguments are pushed on the stack.  */
119790075Sobrien#define FUNCTION_ARG_REGNO_P(REGNO) \
1198132718Skan(((REGNO) >= AR_ARG_FIRST && (REGNO) < (AR_ARG_FIRST + MAX_ARGUMENT_SLOTS)) \
119990075Sobrien || ((REGNO) >= FR_ARG_FIRST && (REGNO) < (FR_ARG_FIRST + MAX_ARGUMENT_SLOTS)))
120090075Sobrien
120190075Sobrien/* How Scalar Function Values are Returned */
120290075Sobrien
120390075Sobrien/* A C expression to create an RTX representing the place where a function
120490075Sobrien   returns a value of data type VALTYPE.  */
120590075Sobrien
120690075Sobrien#define FUNCTION_VALUE(VALTYPE, FUNC) \
120790075Sobrien  ia64_function_value (VALTYPE, FUNC)
120890075Sobrien
120990075Sobrien/* A C expression to create an RTX representing the place where a library
121090075Sobrien   function returns a value of mode MODE.  */
121190075Sobrien
121290075Sobrien#define LIBCALL_VALUE(MODE) \
121390075Sobrien  gen_rtx_REG (MODE,							\
121490075Sobrien	       (((GET_MODE_CLASS (MODE) == MODE_FLOAT			\
121590075Sobrien		 || GET_MODE_CLASS (MODE) == MODE_COMPLEX_FLOAT) &&	\
1216132718Skan		      (MODE) != TFmode)	\
121790075Sobrien		? FR_RET_FIRST : GR_RET_FIRST))
121890075Sobrien
121990075Sobrien/* A C expression that is nonzero if REGNO is the number of a hard register in
122090075Sobrien   which the values of called function may come back.  */
122190075Sobrien
122290075Sobrien#define FUNCTION_VALUE_REGNO_P(REGNO)				\
122390075Sobrien  (((REGNO) >= GR_RET_FIRST && (REGNO) <= GR_RET_LAST)		\
122496263Sobrien   || ((REGNO) >= FR_RET_FIRST && (REGNO) <= FR_RET_LAST))
122590075Sobrien
122690075Sobrien
122790075Sobrien/* How Large Values are Returned */
122890075Sobrien
122990075Sobrien#define DEFAULT_PCC_STRUCT_RETURN 0
123090075Sobrien
123190075Sobrien
123290075Sobrien/* Caller-Saves Register Allocation */
123390075Sobrien
123490075Sobrien/* A C expression to determine whether it is worthwhile to consider placing a
123590075Sobrien   pseudo-register in a call-clobbered hard register and saving and restoring
123690075Sobrien   it around each function call.  The expression should be 1 when this is worth
123790075Sobrien   doing, and 0 otherwise.
123890075Sobrien
123990075Sobrien   If you don't define this macro, a default is used which is good on most
124090075Sobrien   machines: `4 * CALLS < REFS'.  */
124190075Sobrien/* ??? Investigate.  */
124290075Sobrien/* #define CALLER_SAVE_PROFITABLE(REFS, CALLS) */
124390075Sobrien
124490075Sobrien
124590075Sobrien/* Function Entry and Exit */
124690075Sobrien
124790075Sobrien/* Define this macro as a C expression that is nonzero if the return
124890075Sobrien   instruction or the function epilogue ignores the value of the stack pointer;
124990075Sobrien   in other words, if it is safe to delete an instruction to adjust the stack
125090075Sobrien   pointer before a return from the function.  */
125190075Sobrien
125290075Sobrien#define EXIT_IGNORE_STACK 1
125390075Sobrien
125490075Sobrien/* Define this macro as a C expression that is nonzero for registers
125590075Sobrien   used by the epilogue or the `return' pattern.  */
125690075Sobrien
125790075Sobrien#define EPILOGUE_USES(REGNO) ia64_epilogue_uses (REGNO)
125890075Sobrien
125996263Sobrien/* Nonzero for registers used by the exception handling mechanism.  */
126096263Sobrien
126196263Sobrien#define EH_USES(REGNO) ia64_eh_uses (REGNO)
126296263Sobrien
126390075Sobrien/* Output part N of a function descriptor for DECL.  For ia64, both
126490075Sobrien   words are emitted with a single relocation, so ignore N > 0.  */
126590075Sobrien#define ASM_OUTPUT_FDESC(FILE, DECL, PART)				\
126690075Sobriendo {									\
126790075Sobrien  if ((PART) == 0)							\
126890075Sobrien    {									\
1269117395Skan      if (TARGET_ILP32)							\
1270117395Skan        fputs ("\tdata8.ua @iplt(", FILE);				\
1271117395Skan      else								\
1272117395Skan        fputs ("\tdata16.ua @iplt(", FILE);				\
1273169689Skan      mark_decl_referenced (DECL);					\
127490075Sobrien      assemble_name (FILE, XSTR (XEXP (DECL_RTL (DECL), 0), 0));	\
127590075Sobrien      fputs (")\n", FILE);						\
1276117395Skan      if (TARGET_ILP32)							\
1277117395Skan	fputs ("\tdata8.ua 0\n", FILE);					\
127890075Sobrien    }									\
127990075Sobrien} while (0)
128090075Sobrien
128190075Sobrien/* Generating Code for Profiling.  */
128290075Sobrien
128390075Sobrien/* A C statement or compound statement to output to FILE some assembler code to
128490075Sobrien   call the profiling subroutine `mcount'.  */
128590075Sobrien
128690075Sobrien#undef FUNCTION_PROFILER
1287169689Skan#define FUNCTION_PROFILER(FILE, LABELNO) \
1288169689Skan  ia64_output_function_profiler(FILE, LABELNO)
128990075Sobrien
1290169689Skan/* Neither hpux nor linux use profile counters.  */
1291169689Skan#define NO_PROFILE_COUNTERS 1
129290075Sobrien
129390075Sobrien/* Trampolines for Nested Functions.  */
129490075Sobrien
129590075Sobrien/* We need 32 bytes, so we can save the sp, ar.rnat, ar.bsp, and ar.pfs of
129690075Sobrien   the function containing a non-local goto target.  */
129790075Sobrien
129890075Sobrien#define STACK_SAVEAREA_MODE(LEVEL) \
129990075Sobrien  ((LEVEL) == SAVE_NONLOCAL ? OImode : Pmode)
130090075Sobrien
130190075Sobrien/* Output assembler code for a block containing the constant parts of
130290075Sobrien   a trampoline, leaving space for the variable parts.
130390075Sobrien
130490075Sobrien   The trampoline should set the static chain pointer to value placed
130590075Sobrien   into the trampoline and should branch to the specified routine.
130690075Sobrien   To make the normal indirect-subroutine calling convention work,
130790075Sobrien   the trampoline must look like a function descriptor; the first
130890075Sobrien   word being the target address and the second being the target's
130990075Sobrien   global pointer.
131090075Sobrien
131190075Sobrien   We abuse the concept of a global pointer by arranging for it
131290075Sobrien   to point to the data we need to load.  The complete trampoline
131390075Sobrien   has the following form:
131490075Sobrien
131590075Sobrien		+-------------------+ \
131690075Sobrien	TRAMP:	| __ia64_trampoline | |
131790075Sobrien		+-------------------+  > fake function descriptor
131890075Sobrien		| TRAMP+16          | |
131990075Sobrien		+-------------------+ /
132090075Sobrien		| target descriptor |
132190075Sobrien		+-------------------+
132290075Sobrien		| static link	    |
132390075Sobrien		+-------------------+
132490075Sobrien*/
132590075Sobrien
132690075Sobrien/* A C expression for the size in bytes of the trampoline, as an integer.  */
132790075Sobrien
132890075Sobrien#define TRAMPOLINE_SIZE		32
132990075Sobrien
133090075Sobrien/* Alignment required for trampolines, in bits.  */
133190075Sobrien
133290075Sobrien#define TRAMPOLINE_ALIGNMENT	64
133390075Sobrien
133490075Sobrien/* A C statement to initialize the variable parts of a trampoline.  */
133590075Sobrien
133690075Sobrien#define INITIALIZE_TRAMPOLINE(ADDR, FNADDR, STATIC_CHAIN) \
133790075Sobrien  ia64_initialize_trampoline((ADDR), (FNADDR), (STATIC_CHAIN))
133890075Sobrien
133990075Sobrien/* Addressing Modes */
134090075Sobrien
134190075Sobrien/* Define this macro if the machine supports post-increment addressing.  */
134290075Sobrien
134390075Sobrien#define HAVE_POST_INCREMENT 1
134490075Sobrien#define HAVE_POST_DECREMENT 1
134590075Sobrien#define HAVE_POST_MODIFY_DISP 1
134690075Sobrien#define HAVE_POST_MODIFY_REG 1
134790075Sobrien
134890075Sobrien/* A C expression that is 1 if the RTX X is a constant which is a valid
134990075Sobrien   address.  */
135090075Sobrien
135190075Sobrien#define CONSTANT_ADDRESS_P(X) 0
135290075Sobrien
135390075Sobrien/* The max number of registers that can appear in a valid memory address.  */
135490075Sobrien
135590075Sobrien#define MAX_REGS_PER_ADDRESS 2
135690075Sobrien
135790075Sobrien/* A C compound statement with a conditional `goto LABEL;' executed if X (an
135890075Sobrien   RTX) is a legitimate memory address on the target machine for a memory
135990075Sobrien   operand of mode MODE.  */
136090075Sobrien
136190075Sobrien#define LEGITIMATE_ADDRESS_REG(X)					\
136290075Sobrien  ((GET_CODE (X) == REG && REG_OK_FOR_BASE_P (X))			\
136390075Sobrien   || (GET_CODE (X) == SUBREG && GET_CODE (XEXP (X, 0)) == REG		\
136490075Sobrien       && REG_OK_FOR_BASE_P (XEXP (X, 0))))
136590075Sobrien
136690075Sobrien#define LEGITIMATE_ADDRESS_DISP(R, X)					\
136790075Sobrien  (GET_CODE (X) == PLUS							\
136890075Sobrien   && rtx_equal_p (R, XEXP (X, 0))					\
136990075Sobrien   && (LEGITIMATE_ADDRESS_REG (XEXP (X, 1))				\
137090075Sobrien       || (GET_CODE (XEXP (X, 1)) == CONST_INT				\
137190075Sobrien	   && INTVAL (XEXP (X, 1)) >= -256				\
137290075Sobrien	   && INTVAL (XEXP (X, 1)) < 256)))
137390075Sobrien
137490075Sobrien#define GO_IF_LEGITIMATE_ADDRESS(MODE, X, LABEL) 			\
137590075Sobriendo {									\
137690075Sobrien  if (LEGITIMATE_ADDRESS_REG (X))					\
137790075Sobrien    goto LABEL;								\
137890075Sobrien  else if ((GET_CODE (X) == POST_INC || GET_CODE (X) == POST_DEC)	\
137990075Sobrien	   && LEGITIMATE_ADDRESS_REG (XEXP (X, 0))			\
138090075Sobrien	   && XEXP (X, 0) != arg_pointer_rtx)				\
138190075Sobrien    goto LABEL;								\
138290075Sobrien  else if (GET_CODE (X) == POST_MODIFY					\
138390075Sobrien	   && LEGITIMATE_ADDRESS_REG (XEXP (X, 0))			\
138490075Sobrien	   && XEXP (X, 0) != arg_pointer_rtx				\
138590075Sobrien	   && LEGITIMATE_ADDRESS_DISP (XEXP (X, 0), XEXP (X, 1)))	\
138690075Sobrien    goto LABEL;								\
138790075Sobrien} while (0)
138890075Sobrien
138990075Sobrien/* A C expression that is nonzero if X (assumed to be a `reg' RTX) is valid for
139090075Sobrien   use as a base register.  */
139190075Sobrien
139290075Sobrien#ifdef REG_OK_STRICT
139390075Sobrien#define REG_OK_FOR_BASE_P(X) REGNO_OK_FOR_BASE_P (REGNO (X))
139490075Sobrien#else
139590075Sobrien#define REG_OK_FOR_BASE_P(X) \
139690075Sobrien  (GENERAL_REGNO_P (REGNO (X)) || (REGNO (X) >= FIRST_PSEUDO_REGISTER))
139790075Sobrien#endif
139890075Sobrien
139990075Sobrien/* A C expression that is nonzero if X (assumed to be a `reg' RTX) is valid for
140090075Sobrien   use as an index register.  This is needed for POST_MODIFY.  */
140190075Sobrien
140290075Sobrien#define REG_OK_FOR_INDEX_P(X) REG_OK_FOR_BASE_P (X)
140390075Sobrien
140490075Sobrien/* A C statement or compound statement with a conditional `goto LABEL;'
140590075Sobrien   executed if memory address X (an RTX) can have different meanings depending
140690075Sobrien   on the machine mode of the memory reference it is used for or if the address
140790075Sobrien   is valid for some modes but not others.  */
140890075Sobrien
140990075Sobrien#define GO_IF_MODE_DEPENDENT_ADDRESS(ADDR, LABEL)			\
141090075Sobrien  if (GET_CODE (ADDR) == POST_DEC || GET_CODE (ADDR) == POST_INC)	\
141190075Sobrien    goto LABEL;
141290075Sobrien
141390075Sobrien/* A C expression that is nonzero if X is a legitimate constant for an
141490075Sobrien   immediate operand on the target machine.  */
141590075Sobrien
1416169689Skan#define LEGITIMATE_CONSTANT_P(X) ia64_legitimate_constant_p (X)
141790075Sobrien
141890075Sobrien/* Condition Code Status */
141990075Sobrien
142090075Sobrien/* One some machines not all possible comparisons are defined, but you can
142190075Sobrien   convert an invalid comparison into a valid one.  */
142290075Sobrien/* ??? Investigate.  See the alpha definition.  */
142390075Sobrien/* #define CANONICALIZE_COMPARISON(CODE, OP0, OP1) */
142490075Sobrien
142590075Sobrien
142690075Sobrien/* Describing Relative Costs of Operations */
142790075Sobrien
142890075Sobrien/* A C expression for the cost of moving data from a register in class FROM to
142990075Sobrien   one in class TO, using MODE.  */
143090075Sobrien
143190075Sobrien#define REGISTER_MOVE_COST  ia64_register_move_cost
143290075Sobrien
143390075Sobrien/* A C expression for the cost of moving data of mode M between a
143490075Sobrien   register and memory.  */
143590075Sobrien#define MEMORY_MOVE_COST(MODE,CLASS,IN) \
1436169689Skan  ((CLASS) == GENERAL_REGS || (CLASS) == FR_REGS || (CLASS) == FP_REGS \
143790075Sobrien   || (CLASS) == GR_AND_FR_REGS ? 4 : 10)
143890075Sobrien
143990075Sobrien/* A C expression for the cost of a branch instruction.  A value of 1 is the
144096263Sobrien   default; other values are interpreted relative to that.  Used by the
144190075Sobrien   if-conversion code as max instruction count.  */
144290075Sobrien/* ??? This requires investigation.  The primary effect might be how
144390075Sobrien   many additional insn groups we run into, vs how good the dynamic
144490075Sobrien   branch predictor is.  */
144590075Sobrien
144690075Sobrien#define BRANCH_COST 6
144790075Sobrien
144890075Sobrien/* Define this macro as a C expression which is nonzero if accessing less than
144990075Sobrien   a word of memory (i.e. a `char' or a `short') is no faster than accessing a
145090075Sobrien   word of memory.  */
145190075Sobrien
145290075Sobrien#define SLOW_BYTE_ACCESS 1
145390075Sobrien
145490075Sobrien/* Define this macro if it is as good or better to call a constant function
145590075Sobrien   address than to call an address kept in a register.
145690075Sobrien
145790075Sobrien   Indirect function calls are more expensive that direct function calls, so
145890075Sobrien   don't cse function addresses.  */
145990075Sobrien
146090075Sobrien#define NO_FUNCTION_CSE
146190075Sobrien
146290075Sobrien
146390075Sobrien/* Dividing the output into sections.  */
146490075Sobrien
146590075Sobrien/* A C expression whose value is a string containing the assembler operation
146690075Sobrien   that should precede instructions and read-only data.  */
146790075Sobrien
146890075Sobrien#define TEXT_SECTION_ASM_OP "\t.text"
146990075Sobrien
147090075Sobrien/* A C expression whose value is a string containing the assembler operation to
147190075Sobrien   identify the following data as writable initialized data.  */
147290075Sobrien
147390075Sobrien#define DATA_SECTION_ASM_OP "\t.data"
147490075Sobrien
147590075Sobrien/* If defined, a C expression whose value is a string containing the assembler
147690075Sobrien   operation to identify the following data as uninitialized global data.  */
147790075Sobrien
147890075Sobrien#define BSS_SECTION_ASM_OP "\t.bss"
147990075Sobrien
148090075Sobrien#define IA64_DEFAULT_GVALUE 8
148190075Sobrien
148290075Sobrien/* Position Independent Code.  */
148390075Sobrien
148490075Sobrien/* The register number of the register used to address a table of static data
148590075Sobrien   addresses in memory.  */
148690075Sobrien
148790075Sobrien/* ??? Should modify ia64.md to use pic_offset_table_rtx instead of
148890075Sobrien   gen_rtx_REG (DImode, 1).  */
148990075Sobrien
149090075Sobrien/* ??? Should we set flag_pic?  Probably need to define
149190075Sobrien   LEGITIMIZE_PIC_OPERAND_P to make that work.  */
149290075Sobrien
149390075Sobrien#define PIC_OFFSET_TABLE_REGNUM GR_REG (1)
149490075Sobrien
149590075Sobrien/* Define this macro if the register defined by `PIC_OFFSET_TABLE_REGNUM' is
149690075Sobrien   clobbered by calls.  */
149790075Sobrien
149890075Sobrien#define PIC_OFFSET_TABLE_REG_CALL_CLOBBERED
149990075Sobrien
150090075Sobrien
150190075Sobrien/* The Overall Framework of an Assembler File.  */
150290075Sobrien
150390075Sobrien/* A C string constant describing how to begin a comment in the target
150490075Sobrien   assembler language.  The compiler assumes that the comment will end at the
150590075Sobrien   end of the line.  */
150690075Sobrien
150790075Sobrien#define ASM_COMMENT_START "//"
150890075Sobrien
150990075Sobrien/* A C string constant for text to be output before each `asm' statement or
151090075Sobrien   group of consecutive ones.  */
151190075Sobrien
1512132718Skan#define ASM_APP_ON (TARGET_GNU_AS ? "#APP\n" : "//APP\n")
151390075Sobrien
151490075Sobrien/* A C string constant for text to be output after each `asm' statement or
151590075Sobrien   group of consecutive ones.  */
151690075Sobrien
1517132718Skan#define ASM_APP_OFF (TARGET_GNU_AS ? "#NO_APP\n" : "//NO_APP\n")
151890075Sobrien
151990075Sobrien/* Output of Uninitialized Variables.  */
152090075Sobrien
152190075Sobrien/* This is all handled by svr4.h.  */
152290075Sobrien
152390075Sobrien
152490075Sobrien/* Output and Generation of Labels.  */
152590075Sobrien
152690075Sobrien/* A C statement (sans semicolon) to output to the stdio stream STREAM the
152790075Sobrien   assembler definition of a label named NAME.  */
152890075Sobrien
152990075Sobrien/* See the ASM_OUTPUT_LABELREF definition in sysv4.h for an explanation of
153090075Sobrien   why ia64_asm_output_label exists.  */
153190075Sobrien
153290075Sobrienextern int ia64_asm_output_label;
153390075Sobrien#define ASM_OUTPUT_LABEL(STREAM, NAME)					\
153490075Sobriendo {									\
153590075Sobrien  ia64_asm_output_label = 1;						\
153690075Sobrien  assemble_name (STREAM, NAME);						\
153790075Sobrien  fputs (":\n", STREAM);						\
153890075Sobrien  ia64_asm_output_label = 0;						\
153990075Sobrien} while (0)
154090075Sobrien
1541117395Skan/* Globalizing directive for a label.  */
1542117395Skan#define GLOBAL_ASM_OP "\t.global "
154390075Sobrien
154490075Sobrien/* A C statement (sans semicolon) to output to the stdio stream STREAM any text
154590075Sobrien   necessary for declaring the name of an external symbol named NAME which is
154690075Sobrien   referenced in this compilation but not defined.  */
154790075Sobrien
154890075Sobrien#define ASM_OUTPUT_EXTERNAL(FILE, DECL, NAME) \
154990075Sobrien  ia64_asm_output_external (FILE, DECL, NAME)
155090075Sobrien
155190075Sobrien/* A C statement to store into the string STRING a label whose name is made
155290075Sobrien   from the string PREFIX and the number NUM.  */
155390075Sobrien
155490075Sobrien#define ASM_GENERATE_INTERNAL_LABEL(LABEL, PREFIX, NUM) \
155590075Sobriendo {									\
155690075Sobrien  sprintf (LABEL, "*.%s%d", PREFIX, NUM);				\
155790075Sobrien} while (0)
155890075Sobrien
155990075Sobrien/* ??? Not sure if using a ? in the name for Intel as is safe.  */
156090075Sobrien
1561132718Skan#define ASM_PN_FORMAT (TARGET_GNU_AS ? "%s.%lu" : "%s?%lu")
156290075Sobrien
156390075Sobrien/* A C statement to output to the stdio stream STREAM assembler code which
156490075Sobrien   defines (equates) the symbol NAME to have the value VALUE.  */
156590075Sobrien
156690075Sobrien#define ASM_OUTPUT_DEF(STREAM, NAME, VALUE) \
156790075Sobriendo {									\
156890075Sobrien  assemble_name (STREAM, NAME);						\
156990075Sobrien  fputs (" = ", STREAM);						\
157090075Sobrien  assemble_name (STREAM, VALUE);					\
157190075Sobrien  fputc ('\n', STREAM);							\
157290075Sobrien} while (0)
157390075Sobrien
157490075Sobrien
157590075Sobrien/* Macros Controlling Initialization Routines.  */
157690075Sobrien
157790075Sobrien/* This is handled by svr4.h and sysv4.h.  */
157890075Sobrien
157990075Sobrien
158090075Sobrien/* Output of Assembler Instructions.  */
158190075Sobrien
158290075Sobrien/* A C initializer containing the assembler's names for the machine registers,
158390075Sobrien   each one as a C string constant.  */
158490075Sobrien
158590075Sobrien#define REGISTER_NAMES \
158690075Sobrien{									\
158790075Sobrien  /* General registers.  */						\
1588132718Skan  "ap", "r1", "r2", "r3", "r4", "r5", "r6", "r7", "r8", "r9",		\
158990075Sobrien  "r10", "r11", "r12", "r13", "r14", "r15", "r16", "r17", "r18", "r19",	\
159090075Sobrien  "r20", "r21", "r22", "r23", "r24", "r25", "r26", "r27", "r28", "r29",	\
159190075Sobrien  "r30", "r31",								\
159290075Sobrien  /* Local registers.  */						\
159390075Sobrien  "loc0", "loc1", "loc2", "loc3", "loc4", "loc5", "loc6", "loc7",	\
159490075Sobrien  "loc8", "loc9", "loc10","loc11","loc12","loc13","loc14","loc15",	\
159590075Sobrien  "loc16","loc17","loc18","loc19","loc20","loc21","loc22","loc23",	\
159690075Sobrien  "loc24","loc25","loc26","loc27","loc28","loc29","loc30","loc31",	\
159790075Sobrien  "loc32","loc33","loc34","loc35","loc36","loc37","loc38","loc39",	\
159890075Sobrien  "loc40","loc41","loc42","loc43","loc44","loc45","loc46","loc47",	\
159990075Sobrien  "loc48","loc49","loc50","loc51","loc52","loc53","loc54","loc55",	\
160090075Sobrien  "loc56","loc57","loc58","loc59","loc60","loc61","loc62","loc63",	\
160190075Sobrien  "loc64","loc65","loc66","loc67","loc68","loc69","loc70","loc71",	\
160290075Sobrien  "loc72","loc73","loc74","loc75","loc76","loc77","loc78","loc79",	\
160390075Sobrien  /* Input registers.  */						\
160490075Sobrien  "in0",  "in1",  "in2",  "in3",  "in4",  "in5",  "in6",  "in7",	\
160590075Sobrien  /* Output registers.  */						\
160690075Sobrien  "out0", "out1", "out2", "out3", "out4", "out5", "out6", "out7",	\
160790075Sobrien  /* Floating-point registers.  */					\
160890075Sobrien  "f0", "f1", "f2", "f3", "f4", "f5", "f6", "f7", "f8", "f9",		\
160990075Sobrien  "f10", "f11", "f12", "f13", "f14", "f15", "f16", "f17", "f18", "f19",	\
161090075Sobrien  "f20", "f21", "f22", "f23", "f24", "f25", "f26", "f27", "f28", "f29",	\
161190075Sobrien  "f30", "f31", "f32", "f33", "f34", "f35", "f36", "f37", "f38", "f39",	\
161290075Sobrien  "f40", "f41", "f42", "f43", "f44", "f45", "f46", "f47", "f48", "f49",	\
161390075Sobrien  "f50", "f51", "f52", "f53", "f54", "f55", "f56", "f57", "f58", "f59",	\
161490075Sobrien  "f60", "f61", "f62", "f63", "f64", "f65", "f66", "f67", "f68", "f69",	\
161590075Sobrien  "f70", "f71", "f72", "f73", "f74", "f75", "f76", "f77", "f78", "f79",	\
161690075Sobrien  "f80", "f81", "f82", "f83", "f84", "f85", "f86", "f87", "f88", "f89",	\
161790075Sobrien  "f90", "f91", "f92", "f93", "f94", "f95", "f96", "f97", "f98", "f99",	\
161890075Sobrien  "f100","f101","f102","f103","f104","f105","f106","f107","f108","f109",\
161990075Sobrien  "f110","f111","f112","f113","f114","f115","f116","f117","f118","f119",\
162090075Sobrien  "f120","f121","f122","f123","f124","f125","f126","f127",		\
162190075Sobrien  /* Predicate registers.  */						\
162290075Sobrien  "p0", "p1", "p2", "p3", "p4", "p5", "p6", "p7", "p8", "p9",		\
162390075Sobrien  "p10", "p11", "p12", "p13", "p14", "p15", "p16", "p17", "p18", "p19",	\
162490075Sobrien  "p20", "p21", "p22", "p23", "p24", "p25", "p26", "p27", "p28", "p29",	\
162590075Sobrien  "p30", "p31", "p32", "p33", "p34", "p35", "p36", "p37", "p38", "p39",	\
162690075Sobrien  "p40", "p41", "p42", "p43", "p44", "p45", "p46", "p47", "p48", "p49",	\
162790075Sobrien  "p50", "p51", "p52", "p53", "p54", "p55", "p56", "p57", "p58", "p59",	\
162890075Sobrien  "p60", "p61", "p62", "p63",						\
162990075Sobrien  /* Branch registers.  */						\
163090075Sobrien  "b0", "b1", "b2", "b3", "b4", "b5", "b6", "b7",			\
1631122180Skan  /* Frame pointer.  Application registers.  */				\
1632122180Skan  "sfp", "ar.ccv", "ar.unat", "ar.pfs", "ar.lc", "ar.ec",	\
163390075Sobrien}
163490075Sobrien
163590075Sobrien/* If defined, a C initializer for an array of structures containing a name and
163690075Sobrien   a register number.  This macro defines additional names for hard registers,
163790075Sobrien   thus allowing the `asm' option in declarations to refer to registers using
163890075Sobrien   alternate names.  */
163990075Sobrien
164090075Sobrien#define ADDITIONAL_REGISTER_NAMES \
164190075Sobrien{									\
164290075Sobrien  { "gp", R_GR (1) },							\
164390075Sobrien  { "sp", R_GR (12) },							\
164490075Sobrien  { "in0", IN_REG (0) },						\
164590075Sobrien  { "in1", IN_REG (1) },						\
164690075Sobrien  { "in2", IN_REG (2) },						\
164790075Sobrien  { "in3", IN_REG (3) },						\
164890075Sobrien  { "in4", IN_REG (4) },						\
164990075Sobrien  { "in5", IN_REG (5) },						\
165090075Sobrien  { "in6", IN_REG (6) },						\
165190075Sobrien  { "in7", IN_REG (7) },						\
165290075Sobrien  { "out0", OUT_REG (0) },						\
165390075Sobrien  { "out1", OUT_REG (1) },						\
165490075Sobrien  { "out2", OUT_REG (2) },						\
165590075Sobrien  { "out3", OUT_REG (3) },						\
165690075Sobrien  { "out4", OUT_REG (4) },						\
165790075Sobrien  { "out5", OUT_REG (5) },						\
165890075Sobrien  { "out6", OUT_REG (6) },						\
165990075Sobrien  { "out7", OUT_REG (7) },						\
166090075Sobrien  { "loc0", LOC_REG (0) },						\
166190075Sobrien  { "loc1", LOC_REG (1) },						\
166290075Sobrien  { "loc2", LOC_REG (2) },						\
166390075Sobrien  { "loc3", LOC_REG (3) },						\
166490075Sobrien  { "loc4", LOC_REG (4) },						\
166590075Sobrien  { "loc5", LOC_REG (5) },						\
166690075Sobrien  { "loc6", LOC_REG (6) },						\
166790075Sobrien  { "loc7", LOC_REG (7) },						\
166890075Sobrien  { "loc8", LOC_REG (8) }, 						\
166990075Sobrien  { "loc9", LOC_REG (9) }, 						\
167090075Sobrien  { "loc10", LOC_REG (10) }, 						\
167190075Sobrien  { "loc11", LOC_REG (11) }, 						\
167290075Sobrien  { "loc12", LOC_REG (12) }, 						\
167390075Sobrien  { "loc13", LOC_REG (13) }, 						\
167490075Sobrien  { "loc14", LOC_REG (14) }, 						\
167590075Sobrien  { "loc15", LOC_REG (15) }, 						\
167690075Sobrien  { "loc16", LOC_REG (16) }, 						\
167790075Sobrien  { "loc17", LOC_REG (17) }, 						\
167890075Sobrien  { "loc18", LOC_REG (18) }, 						\
167990075Sobrien  { "loc19", LOC_REG (19) }, 						\
168090075Sobrien  { "loc20", LOC_REG (20) }, 						\
168190075Sobrien  { "loc21", LOC_REG (21) }, 						\
168290075Sobrien  { "loc22", LOC_REG (22) }, 						\
168390075Sobrien  { "loc23", LOC_REG (23) }, 						\
168490075Sobrien  { "loc24", LOC_REG (24) }, 						\
168590075Sobrien  { "loc25", LOC_REG (25) }, 						\
168690075Sobrien  { "loc26", LOC_REG (26) }, 						\
168790075Sobrien  { "loc27", LOC_REG (27) }, 						\
168890075Sobrien  { "loc28", LOC_REG (28) }, 						\
168990075Sobrien  { "loc29", LOC_REG (29) }, 						\
169090075Sobrien  { "loc30", LOC_REG (30) }, 						\
169190075Sobrien  { "loc31", LOC_REG (31) }, 						\
169290075Sobrien  { "loc32", LOC_REG (32) }, 						\
169390075Sobrien  { "loc33", LOC_REG (33) }, 						\
169490075Sobrien  { "loc34", LOC_REG (34) }, 						\
169590075Sobrien  { "loc35", LOC_REG (35) }, 						\
169690075Sobrien  { "loc36", LOC_REG (36) }, 						\
169790075Sobrien  { "loc37", LOC_REG (37) }, 						\
169890075Sobrien  { "loc38", LOC_REG (38) }, 						\
169990075Sobrien  { "loc39", LOC_REG (39) }, 						\
170090075Sobrien  { "loc40", LOC_REG (40) }, 						\
170190075Sobrien  { "loc41", LOC_REG (41) }, 						\
170290075Sobrien  { "loc42", LOC_REG (42) }, 						\
170390075Sobrien  { "loc43", LOC_REG (43) }, 						\
170490075Sobrien  { "loc44", LOC_REG (44) }, 						\
170590075Sobrien  { "loc45", LOC_REG (45) }, 						\
170690075Sobrien  { "loc46", LOC_REG (46) }, 						\
170790075Sobrien  { "loc47", LOC_REG (47) }, 						\
170890075Sobrien  { "loc48", LOC_REG (48) }, 						\
170990075Sobrien  { "loc49", LOC_REG (49) }, 						\
171090075Sobrien  { "loc50", LOC_REG (50) }, 						\
171190075Sobrien  { "loc51", LOC_REG (51) }, 						\
171290075Sobrien  { "loc52", LOC_REG (52) }, 						\
171390075Sobrien  { "loc53", LOC_REG (53) }, 						\
171490075Sobrien  { "loc54", LOC_REG (54) }, 						\
171590075Sobrien  { "loc55", LOC_REG (55) }, 						\
171690075Sobrien  { "loc56", LOC_REG (56) }, 						\
171790075Sobrien  { "loc57", LOC_REG (57) }, 						\
171890075Sobrien  { "loc58", LOC_REG (58) }, 						\
171990075Sobrien  { "loc59", LOC_REG (59) }, 						\
172090075Sobrien  { "loc60", LOC_REG (60) }, 						\
172190075Sobrien  { "loc61", LOC_REG (61) }, 						\
172290075Sobrien  { "loc62", LOC_REG (62) }, 						\
172390075Sobrien  { "loc63", LOC_REG (63) }, 						\
172490075Sobrien  { "loc64", LOC_REG (64) }, 						\
172590075Sobrien  { "loc65", LOC_REG (65) }, 						\
172690075Sobrien  { "loc66", LOC_REG (66) }, 						\
172790075Sobrien  { "loc67", LOC_REG (67) }, 						\
172890075Sobrien  { "loc68", LOC_REG (68) }, 						\
172990075Sobrien  { "loc69", LOC_REG (69) }, 						\
173090075Sobrien  { "loc70", LOC_REG (70) }, 						\
173190075Sobrien  { "loc71", LOC_REG (71) }, 						\
173290075Sobrien  { "loc72", LOC_REG (72) }, 						\
173390075Sobrien  { "loc73", LOC_REG (73) }, 						\
173490075Sobrien  { "loc74", LOC_REG (74) }, 						\
173590075Sobrien  { "loc75", LOC_REG (75) }, 						\
173690075Sobrien  { "loc76", LOC_REG (76) }, 						\
173790075Sobrien  { "loc77", LOC_REG (77) }, 						\
173890075Sobrien  { "loc78", LOC_REG (78) }, 						\
173990075Sobrien  { "loc79", LOC_REG (79) }, 						\
174090075Sobrien}
174190075Sobrien
174290075Sobrien/* A C compound statement to output to stdio stream STREAM the assembler syntax
174390075Sobrien   for an instruction operand X.  X is an RTL expression.  */
174490075Sobrien
174590075Sobrien#define PRINT_OPERAND(STREAM, X, CODE) \
174690075Sobrien  ia64_print_operand (STREAM, X, CODE)
174790075Sobrien
174890075Sobrien/* A C expression which evaluates to true if CODE is a valid punctuation
174990075Sobrien   character for use in the `PRINT_OPERAND' macro.  */
175090075Sobrien
175190075Sobrien/* ??? Keep this around for now, as we might need it later.  */
175290075Sobrien
175390075Sobrien#define PRINT_OPERAND_PUNCT_VALID_P(CODE) \
175490075Sobrien  ((CODE) == '+' || (CODE) == ',')
175590075Sobrien
175690075Sobrien/* A C compound statement to output to stdio stream STREAM the assembler syntax
175790075Sobrien   for an instruction operand that is a memory reference whose address is X.  X
175890075Sobrien   is an RTL expression.  */
175990075Sobrien
176090075Sobrien#define PRINT_OPERAND_ADDRESS(STREAM, X) \
176190075Sobrien  ia64_print_operand_address (STREAM, X)
176290075Sobrien
176390075Sobrien/* If defined, C string expressions to be used for the `%R', `%L', `%U', and
176490075Sobrien   `%I' options of `asm_fprintf' (see `final.c').  */
176590075Sobrien
176690075Sobrien#define REGISTER_PREFIX ""
176790075Sobrien#define LOCAL_LABEL_PREFIX "."
176890075Sobrien#define USER_LABEL_PREFIX ""
176990075Sobrien#define IMMEDIATE_PREFIX ""
177090075Sobrien
177190075Sobrien
177290075Sobrien/* Output of dispatch tables.  */
177390075Sobrien
177490075Sobrien/* This macro should be provided on machines where the addresses in a dispatch
177590075Sobrien   table are relative to the table's own address.  */
177690075Sobrien
177790075Sobrien/* ??? Depends on the pointer size.  */
177890075Sobrien
1779117395Skan#define ASM_OUTPUT_ADDR_DIFF_ELT(STREAM, BODY, VALUE, REL)	\
1780117395Skan  do {								\
1781117395Skan  if (TARGET_ILP32)						\
1782117395Skan    fprintf (STREAM, "\tdata4 @pcrel(.L%d)\n", VALUE);		\
1783117395Skan  else								\
1784117395Skan    fprintf (STREAM, "\tdata8 @pcrel(.L%d)\n", VALUE);		\
1785117395Skan  } while (0)
178690075Sobrien
178790075Sobrien/* Jump tables only need 8 byte alignment.  */
178890075Sobrien
178990075Sobrien#define ADDR_VEC_ALIGN(ADDR_VEC) 3
179090075Sobrien
179190075Sobrien
179290075Sobrien/* Assembler Commands for Exception Regions.  */
179390075Sobrien
179490075Sobrien/* Select a format to encode pointers in exception handling data.  CODE
179590075Sobrien   is 0 for data, 1 for code labels, 2 for function pointers.  GLOBAL is
179690075Sobrien   true if the symbol may be affected by dynamic relocations.  */
179790075Sobrien#define ASM_PREFERRED_EH_DATA_FORMAT(CODE,GLOBAL)	\
179890075Sobrien  (((CODE) == 1 ? DW_EH_PE_textrel : DW_EH_PE_datarel)	\
1799117395Skan   | ((GLOBAL) ? DW_EH_PE_indirect : 0)			\
1800117395Skan   | (TARGET_ILP32 ? DW_EH_PE_udata4 : DW_EH_PE_udata8))
180190075Sobrien
180290075Sobrien/* Handle special EH pointer encodings.  Absolute, pc-relative, and
180390075Sobrien   indirect are handled automatically.  */
180490075Sobrien#define ASM_MAYBE_OUTPUT_ENCODED_ADDR_RTX(FILE, ENCODING, SIZE, ADDR, DONE) \
180590075Sobrien  do {									\
180690075Sobrien    const char *reltag = NULL;						\
180790075Sobrien    if (((ENCODING) & 0xF0) == DW_EH_PE_textrel)			\
180890075Sobrien      reltag = "@segrel(";						\
180990075Sobrien    else if (((ENCODING) & 0xF0) == DW_EH_PE_datarel)			\
181090075Sobrien      reltag = "@gprel(";						\
181190075Sobrien    if (reltag)								\
181290075Sobrien      {									\
181390075Sobrien	fputs (integer_asm_op (SIZE, FALSE), FILE);			\
181490075Sobrien	fputs (reltag, FILE);						\
181590075Sobrien	assemble_name (FILE, XSTR (ADDR, 0));				\
181690075Sobrien	fputc (')', FILE);						\
181790075Sobrien	goto DONE;							\
181890075Sobrien      }									\
181990075Sobrien  } while (0)
182090075Sobrien
182190075Sobrien
182290075Sobrien/* Assembler Commands for Alignment.  */
182390075Sobrien
182490075Sobrien/* ??? Investigate.  */
182590075Sobrien
182690075Sobrien/* The alignment (log base 2) to put in front of LABEL, which follows
182790075Sobrien   a BARRIER.  */
182890075Sobrien
182990075Sobrien/* #define LABEL_ALIGN_AFTER_BARRIER(LABEL) */
183090075Sobrien
183190075Sobrien/* The desired alignment for the location counter at the beginning
183290075Sobrien   of a loop.  */
183390075Sobrien
183490075Sobrien/* #define LOOP_ALIGN(LABEL) */
183590075Sobrien
183690075Sobrien/* Define this macro if `ASM_OUTPUT_SKIP' should not be used in the text
183790075Sobrien   section because it fails put zeros in the bytes that are skipped.  */
183890075Sobrien
183990075Sobrien#define ASM_NO_SKIP_IN_TEXT 1
184090075Sobrien
184190075Sobrien/* A C statement to output to the stdio stream STREAM an assembler command to
184290075Sobrien   advance the location counter to a multiple of 2 to the POWER bytes.  */
184390075Sobrien
184490075Sobrien#define ASM_OUTPUT_ALIGN(STREAM, POWER) \
184590075Sobrien  fprintf (STREAM, "\t.align %d\n", 1<<(POWER))
184690075Sobrien
184790075Sobrien
184890075Sobrien/* Macros Affecting all Debug Formats.  */
184990075Sobrien
185090075Sobrien/* This is handled in svr4.h and sysv4.h.  */
185190075Sobrien
185290075Sobrien
185390075Sobrien/* Specific Options for DBX Output.  */
185490075Sobrien
185590075Sobrien/* This is handled by dbxelf.h which is included by svr4.h.  */
185690075Sobrien
185790075Sobrien
185890075Sobrien/* Open ended Hooks for DBX Output.  */
185990075Sobrien
186090075Sobrien/* Likewise.  */
186190075Sobrien
186290075Sobrien
186390075Sobrien/* File names in DBX format.  */
186490075Sobrien
186590075Sobrien/* Likewise.  */
186690075Sobrien
186790075Sobrien
186890075Sobrien/* Macros for SDB and Dwarf Output.  */
186990075Sobrien
1870132718Skan/* Define this macro if GCC should produce dwarf version 2 format debugging
187190075Sobrien   output in response to the `-g' option.  */
187290075Sobrien
1873117395Skan#define DWARF2_DEBUGGING_INFO 1
187490075Sobrien
1875169689Skan/* We do not want call-frame info to be output, since debuggers are
1876169689Skan   supposed to use the target unwind info.  Leave this undefined it
1877169689Skan   TARGET_UNWIND_INFO might ever be false.  */
1878169689Skan
1879169689Skan#define DWARF2_FRAME_INFO 0
1880169689Skan
188190075Sobrien#define DWARF2_ASM_LINE_DEBUG_INFO (TARGET_DWARF2_ASM)
188290075Sobrien
188390075Sobrien/* Use tags for debug info labels, so that they don't break instruction
188490075Sobrien   bundles.  This also avoids getting spurious DV warnings from the
1885132718Skan   assembler.  This is similar to (*targetm.asm_out.internal_label), except that we
188690075Sobrien   add brackets around the label.  */
188790075Sobrien
188890075Sobrien#define ASM_OUTPUT_DEBUG_LABEL(FILE, PREFIX, NUM) \
1889132718Skan  fprintf (FILE, TARGET_GNU_AS ? "[.%s%d:]\n" : ".%s%d:\n", PREFIX, NUM)
189090075Sobrien
189190075Sobrien/* Use section-relative relocations for debugging offsets.  Unlike other
189296263Sobrien   targets that fake this by putting the section VMA at 0, IA-64 has
189390075Sobrien   proper relocations for them.  */
1894169689Skan#define ASM_OUTPUT_DWARF_OFFSET(FILE, SIZE, LABEL, SECTION)	\
1895169689Skan  do {								\
1896169689Skan    fputs (integer_asm_op (SIZE, FALSE), FILE);			\
1897169689Skan    fputs ("@secrel(", FILE);					\
1898169689Skan    assemble_name (FILE, LABEL);				\
1899169689Skan    fputc (')', FILE);						\
190090075Sobrien  } while (0)
190190075Sobrien
190290075Sobrien/* Emit a PC-relative relocation.  */
190390075Sobrien#define ASM_OUTPUT_DWARF_PCREL(FILE, SIZE, LABEL)	\
190490075Sobrien  do {							\
190590075Sobrien    fputs (integer_asm_op (SIZE, FALSE), FILE);		\
190690075Sobrien    fputs ("@pcrel(", FILE);				\
190790075Sobrien    assemble_name (FILE, LABEL);			\
190890075Sobrien    fputc (')', FILE);					\
190990075Sobrien  } while (0)
191090075Sobrien
191190075Sobrien/* Register Renaming Parameters.  */
191290075Sobrien
191390075Sobrien/* A C expression that is nonzero if hard register number REGNO2 can be
191490075Sobrien   considered for use as a rename register for REGNO1 */
191590075Sobrien
191690075Sobrien#define HARD_REGNO_RENAME_OK(REGNO1,REGNO2) \
191790075Sobrien  ia64_hard_regno_rename_ok((REGNO1), (REGNO2))
191890075Sobrien
191990075Sobrien
192090075Sobrien/* Miscellaneous Parameters.  */
192190075Sobrien
1922132718Skan/* Flag to mark data that is in the small address area (addressable
1923132718Skan   via "addl", that is, within a 2MByte offset of 0.  */
1924132718Skan#define SYMBOL_FLAG_SMALL_ADDR		(SYMBOL_FLAG_MACH_DEP << 0)
1925132718Skan#define SYMBOL_REF_SMALL_ADDR_P(X)	\
1926132718Skan	((SYMBOL_REF_FLAGS (X) & SYMBOL_FLAG_SMALL_ADDR) != 0)
1927132718Skan
192890075Sobrien/* An alias for a machine mode name.  This is the machine mode that elements of
192990075Sobrien   a jump-table should have.  */
193090075Sobrien
1931117395Skan#define CASE_VECTOR_MODE ptr_mode
193290075Sobrien
193390075Sobrien/* Define as C expression which evaluates to nonzero if the tablejump
193490075Sobrien   instruction expects the table to contain offsets from the address of the
193590075Sobrien   table.  */
193690075Sobrien
193790075Sobrien#define CASE_VECTOR_PC_RELATIVE 1
193890075Sobrien
193990075Sobrien/* Define this macro if operations between registers with integral mode smaller
194090075Sobrien   than a word are always performed on the entire register.  */
194190075Sobrien
194290075Sobrien#define WORD_REGISTER_OPERATIONS
194390075Sobrien
194490075Sobrien/* Define this macro to be a C expression indicating when insns that read
194590075Sobrien   memory in MODE, an integral mode narrower than a word, set the bits outside
194690075Sobrien   of MODE to be either the sign-extension or the zero-extension of the data
194790075Sobrien   read.  */
194890075Sobrien
194990075Sobrien#define LOAD_EXTEND_OP(MODE) ZERO_EXTEND
195090075Sobrien
195190075Sobrien/* The maximum number of bytes that a single instruction can move quickly from
195290075Sobrien   memory to memory.  */
195390075Sobrien#define MOVE_MAX 8
195490075Sobrien
195590075Sobrien/* A C expression which is nonzero if on this machine it is safe to "convert"
195690075Sobrien   an integer of INPREC bits to one of OUTPREC bits (where OUTPREC is smaller
195790075Sobrien   than INPREC) by merely operating on it as if it had only OUTPREC bits.  */
195890075Sobrien
195990075Sobrien#define TRULY_NOOP_TRUNCATION(OUTPREC, INPREC) 1
196090075Sobrien
196190075Sobrien/* A C expression describing the value returned by a comparison operator with
196290075Sobrien   an integral mode and stored by a store-flag instruction (`sCOND') when the
196390075Sobrien   condition is true.  */
196490075Sobrien
1965132718Skan/* ??? Investigate using STORE_FLAG_VALUE of -1 instead of 1.  */
196690075Sobrien
196790075Sobrien/* An alias for the machine mode for pointers.  */
196890075Sobrien
196990075Sobrien/* ??? This would change if we had ILP32 support.  */
197090075Sobrien
197190075Sobrien#define Pmode DImode
197290075Sobrien
197390075Sobrien/* An alias for the machine mode used for memory references to functions being
197490075Sobrien   called, in `call' RTL expressions.  */
197590075Sobrien
197690075Sobrien#define FUNCTION_MODE Pmode
197790075Sobrien
197890075Sobrien/* Define this macro to handle System V style pragmas: #pragma pack and
197990075Sobrien   #pragma weak.  Note, #pragma weak will only be supported if SUPPORT_WEAK is
198090075Sobrien   defined.  */
198190075Sobrien
198290075Sobrien/* If this architecture supports prefetch, define this to be the number of
198390075Sobrien   prefetch commands that can be executed in parallel.
198490075Sobrien
198590075Sobrien   ??? This number is bogus and needs to be replaced before the value is
198690075Sobrien   actually used in optimizations.  */
198790075Sobrien
198890075Sobrien#define SIMULTANEOUS_PREFETCHES 6
198990075Sobrien
199090075Sobrien/* If this architecture supports prefetch, define this to be the size of
199190075Sobrien   the cache line that is prefetched.  */
199290075Sobrien
199390075Sobrien#define PREFETCH_BLOCK 32
199490075Sobrien
1995117395Skan#define HANDLE_SYSV_PRAGMA 1
199690075Sobrien
199790075Sobrien/* A C expression for the maximum number of instructions to execute via
199890075Sobrien   conditional execution instructions instead of a branch.  A value of
199990075Sobrien   BRANCH_COST+1 is the default if the machine does not use
200090075Sobrien   cc0, and 1 if it does use cc0.  */
200190075Sobrien/* ??? Investigate.  */
200290075Sobrien#define MAX_CONDITIONAL_EXECUTE 12
200390075Sobrien
200490075Sobrienextern int ia64_final_schedule;
200590075Sobrien
2006169689Skan#define TARGET_UNWIND_INFO	1
200790075Sobrien
2008169689Skan#define TARGET_UNWIND_TABLES_DEFAULT true
2009169689Skan
201090075Sobrien#define EH_RETURN_DATA_REGNO(N) ((N) < 4 ? (N) + 15 : INVALID_REGNUM)
201190075Sobrien
201290075Sobrien/* This function contains machine specific function data.  */
2013117395Skanstruct machine_function GTY(())
201490075Sobrien{
201590075Sobrien  /* The new stack pointer when unwinding from EH.  */
2016117395Skan  rtx ia64_eh_epilogue_sp;
201790075Sobrien
201890075Sobrien  /* The new bsp value when unwinding from EH.  */
2019117395Skan  rtx ia64_eh_epilogue_bsp;
202090075Sobrien
202190075Sobrien  /* The GP value save register.  */
2022117395Skan  rtx ia64_gp_save;
202390075Sobrien
202490075Sobrien  /* The number of varargs registers to save.  */
202590075Sobrien  int n_varargs;
202690075Sobrien
2027169689Skan  /* The number of the next unwind state to copy.  */
2028169689Skan  int state_num;
202990075Sobrien};
203090075Sobrien
203196263Sobrien#define DONT_USE_BUILTIN_SETJMP
203296263Sobrien
203396263Sobrien/* Output any profiling code before the prologue.  */
203496263Sobrien
203596263Sobrien#undef  PROFILE_BEFORE_PROLOGUE
203696263Sobrien#define PROFILE_BEFORE_PROLOGUE 1
203796263Sobrien
2038169689Skan/* Initialize library function table. */
2039169689Skan#undef TARGET_INIT_LIBFUNCS
2040169689Skan#define TARGET_INIT_LIBFUNCS ia64_init_libfuncs
2041132718Skan
2042132718Skan
2043132718Skan/* Switch on code for querying unit reservations.  */
2044132718Skan#define CPU_UNITS_QUERY 1
2045132718Skan
2046169689Skan/* Define this to change the optimizations performed by default.  */
2047169689Skan#define OPTIMIZATION_OPTIONS(LEVEL, SIZE) \
2048169689Skan  ia64_optimization_options ((LEVEL), (SIZE))
2049169689Skan
205090075Sobrien/* End of ia64.h */
2051