OSDN Git Service

* target.def (target_option.optimization): New hook.
[pf3gnuchains/gcc-fork.git] / gcc / config / ia64 / ia64.h
index 618ba24..dbb5ebd 100644 (file)
@@ -1,6 +1,6 @@
 /* Definitions of target machine GNU compiler.  IA-64 version.
-   Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007
-   Free Software Foundation, Inc.
+   Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008,
+   2009, 2010 Free Software Foundation, Inc.
    Contributed by James E. Wilson <wilson@cygnus.com> and
                  David Mosberger <davidm@hpl.hp.com>.
 
@@ -53,6 +53,9 @@ do {                                          \
 
 #define ASM_EXTRA_SPEC ""
 
+#define SWITCH_TAKES_ARG(CHAR)                                         \
+  (DEFAULT_SWITCH_TAKES_ARG (CHAR) || (CHAR) == 'G')
+
 /* Variables which are this size or smaller are put in the sdata/sbss
    sections.  */
 extern unsigned int ia64_section_threshold;
@@ -73,6 +76,8 @@ extern unsigned int ia64_section_threshold;
 #define TARGET_HPUX            0
 #define TARGET_HPUX_LD         0
 
+#define TARGET_ABI_OPEN_VMS 0
+
 #ifndef TARGET_ILP32
 #define TARGET_ILP32 0
 #endif
@@ -94,7 +99,7 @@ enum ia64_inline_type
 /* Default target_flags if no switches are specified  */
 
 #ifndef TARGET_DEFAULT
-#define TARGET_DEFAULT (MASK_DWARF2_ASM)
+#define TARGET_DEFAULT (MASK_DWARF2_ASM | MASK_FUSED_MADD)
 #endif
 
 #ifndef TARGET_CPU_DEFAULT
@@ -113,21 +118,6 @@ enum processor_type
 };
 
 extern enum processor_type ia64_tune;
-
-/* Sometimes certain combinations of command options do not make sense on a
-   particular target machine.  You can define a macro `OVERRIDE_OPTIONS' to
-   take account of this.  This macro, if defined, is executed once just after
-   all the command options have been parsed.  */
-
-#define OVERRIDE_OPTIONS ia64_override_options ()
-
-/* Some machines may desire to change what optimizations are performed for
-   various optimization levels.  This macro, if defined, is executed once just
-   after the optimization level is determined and before the remainder of the
-   command options have been parsed.  Values set in this macro are used as the
-   default values for the other command line options.  */
-
-/* #define OPTIMIZATION_OPTIONS(LEVEL,SIZE) */
 \f
 /* Driver configuration */
 
@@ -279,11 +269,17 @@ while (0)
 
 #define DOUBLE_TYPE_SIZE 64
 
-/* long double is XFmode normally, TFmode for HPUX.  */
-#define LONG_DOUBLE_TYPE_SIZE (TARGET_HPUX ? 128 : 80)
+/* long double is XFmode normally, and TFmode for HPUX.  It should be
+   TFmode for VMS as well but we only support up to DFmode now.  */
+#define LONG_DOUBLE_TYPE_SIZE \
+  (TARGET_HPUX ? 128 \
+   : TARGET_ABI_OPEN_VMS ? 64 \
+   : 80)
+
+/* We always want the XFmode operations from libgcc2.c, except on VMS
+   where this yields references to unimplemented "insns".  */
+#define LIBGCC2_LONG_DOUBLE_TYPE_SIZE  (TARGET_ABI_OPEN_VMS ? 64 : 80)
 
-/* We always want the XFmode operations from libgcc2.c.  */
-#define LIBGCC2_LONG_DOUBLE_TYPE_SIZE 80
 
 /* On HP-UX, we use the l suffix for TFmode in libgcc2.c.  */
 #define LIBGCC2_TF_CEXT l
@@ -408,7 +404,7 @@ while (0)
   /* Branch registers.  */                             \
   0, 0, 0, 0, 0, 0, 0, 0,                              \
   /*FP CCV UNAT PFS LC EC */                           \
-     1,  1,   1,  1, 0, 1                              \
+     1,  1,   1,  1, 1, 1                              \
  }
 
 /* Like `FIXED_REGISTERS' but has 1 for each register that is clobbered
@@ -443,7 +439,7 @@ while (0)
   /* Branch registers.  */                             \
   1, 0, 0, 0, 0, 0, 1, 1,                              \
   /*FP CCV UNAT PFS LC EC */                           \
-     1,  1,   1,  1, 0, 1                              \
+     1,  1,   1,  1, 1, 1                              \
 }
 
 /* Like `CALL_USED_REGISTERS' but used to overcome a historical
@@ -642,7 +638,7 @@ while (0)
 #define HARD_REGNO_NREGS(REGNO, MODE)                                  \
   ((REGNO) == PR_REG (0) && (MODE) == DImode ? 64                      \
    : PR_REGNO_P (REGNO) && (MODE) == BImode ? 2                                \
-   : PR_REGNO_P (REGNO) && (MODE) == CCImode ? 1                       \
+   : (PR_REGNO_P (REGNO) || GR_REGNO_P (REGNO)) && (MODE) == CCImode ? 1\
    : FR_REGNO_P (REGNO) && (MODE) == XFmode ? 1                                \
    : FR_REGNO_P (REGNO) && (MODE) == RFmode ? 1                                \
    : FR_REGNO_P (REGNO) && (MODE) == XCmode ? 2                                \
@@ -660,7 +656,7 @@ while (0)
    : PR_REGNO_P (REGNO) ?                                      \
      (MODE) == BImode || GET_MODE_CLASS (MODE) == MODE_CC      \
    : GR_REGNO_P (REGNO) ?                                      \
-     (MODE) != CCImode && (MODE) != XFmode && (MODE) != XCmode && (MODE) != RFmode \
+     (MODE) != XFmode && (MODE) != XCmode && (MODE) != RFmode  \
    : AR_REGNO_P (REGNO) ? (MODE) == DImode                     \
    : BR_REGNO_P (REGNO) ? (MODE) == DImode                     \
    : 0)
@@ -800,6 +796,19 @@ enum reg_class
     0xFFFFFFFF, 0xFFFFFFFF, 0x3FFF },                  \
 }
 
+/* The following macro defines cover classes for Integrated Register
+   Allocator.  Cover classes is a set of non-intersected register
+   classes covering all hard registers used for register allocation
+   purpose.  Any move between two registers of a cover class should be
+   cheaper than load or store of the registers.  The macro value is
+   array of register classes with LIM_REG_CLASSES used as the end
+   marker.  */
+
+#define IRA_COVER_CLASSES                                                   \
+{                                                                           \
+  PR_REGS, BR_REGS, AR_M_REGS, AR_I_REGS, GR_REGS, FR_REGS, LIM_REG_CLASSES  \
+}
+
 /* A C expression whose value is a register class containing hard register
    REGNO.  In general there is more than one such class; choose a class which
    is "minimal", meaning that no smaller class also contains the register.  */
@@ -982,7 +991,7 @@ enum reg_class
 #define INIT_EXPANDERS                                 \
   do {                                                 \
     ia64_init_expanders ();                             \
-    if (rtl.emit.regno_pointer_align)  \
+    if (crtl->emit.regno_pointer_align)        \
       REGNO_POINTER_ALIGN (ARG_POINTER_REGNUM) = 64;   \
   } while (0)
 
@@ -992,11 +1001,6 @@ enum reg_class
 \f
 /* Eliminating the Frame Pointer and the Arg Pointer */
 
-/* A C expression which is nonzero if a function must have and use a frame
-   pointer.  This expression is evaluated in the reload pass.  If its value is
-   nonzero the function will have a frame pointer.  */
-#define FRAME_POINTER_REQUIRED 0
-
 /* Show we can debug even without a frame pointer.  */
 #define CAN_DEBUG_WITHOUT_FP
 
@@ -1011,13 +1015,6 @@ enum reg_class
   {FRAME_POINTER_REGNUM, HARD_FRAME_POINTER_REGNUM},                   \
 }
 
-/* A C expression that returns nonzero if the compiler is allowed to try to
-   replace register number FROM with register number TO.  The frame pointer
-   is automatically handled.  */
-
-#define CAN_ELIMINATE(FROM, TO) \
-  (TO == BR_REG (0) ? current_function_is_leaf : 1)
-
 /* This macro is similar to `INITIAL_FRAME_POINTER_OFFSET'.  It
    specifies the initial difference between the specified pair of
    registers.  This macro must be defined if `ELIMINABLE_REGS' is
@@ -1029,16 +1026,10 @@ enum reg_class
 
 /* If defined, the maximum amount of space required for outgoing arguments will
    be computed and placed into the variable
-   `current_function_outgoing_args_size'.  */
+   `crtl->outgoing_args_size'.  */
 
 #define ACCUMULATE_OUTGOING_ARGS 1
 
-/* A C expression that should indicate the number of bytes of its own arguments
-   that a function pops on returning, or 0 if the function pops no arguments
-   and the caller must therefore pop them all after the function returns.  */
-
-#define RETURN_POPS_ARGS(FUNDECL, FUNTYPE, STACK_SIZE) 0
-
 \f
 /* Function Arguments in Registers */
 
@@ -1069,12 +1060,16 @@ enum reg_class
    `FUNCTION_ARG' and other related values.  For some target machines, the type
    `int' suffices and can hold the number of bytes of argument so far.  */
 
+enum ivms_arg_type {I64, FF, FD, FG, FS, FT};
+/* VMS floating point formats VAX F, VAX D, VAX G, IEEE S, IEEE T.  */
+
 typedef struct ia64_args
 {
   int words;                   /* # words of arguments so far  */
   int int_regs;                        /* # GR registers used so far  */
   int fp_regs;                 /* # FR registers used so far  */
   int prototype;               /* whether function prototyped  */
+  enum ivms_arg_type atypes[8]; /* which VMS float type or if not float */
 } CUMULATIVE_ARGS;
 
 /* A C statement (sans semicolon) for initializing the variable CUM for the
@@ -1086,6 +1081,9 @@ do {                                                                      \
   (CUM).int_regs = 0;                                                  \
   (CUM).fp_regs = 0;                                                   \
   (CUM).prototype = ((FNTYPE) && TYPE_ARG_TYPES (FNTYPE)) || (LIBNAME);        \
+  (CUM).atypes[0] = (CUM).atypes[1] = (CUM).atypes[2] = I64;           \
+  (CUM).atypes[3] = (CUM).atypes[4] = (CUM).atypes[5] = I64;            \
+  (CUM).atypes[6] = (CUM).atypes[7] = I64;                              \
 } while (0)
 
 /* Like `INIT_CUMULATIVE_ARGS' but overrides it for the purposes of finding the
@@ -1100,6 +1098,9 @@ do {                                                                      \
   (CUM).int_regs = 0;                                                  \
   (CUM).fp_regs = 0;                                                   \
   (CUM).prototype = 1;                                                 \
+  (CUM).atypes[0] = (CUM).atypes[1] = (CUM).atypes[2] = I64;           \
+  (CUM).atypes[3] = (CUM).atypes[4] = (CUM).atypes[5] = I64;            \
+  (CUM).atypes[6] = (CUM).atypes[7] = I64;                              \
 } while (0)
 
 /* A C statement (sans semicolon) to update the summarizer variable CUM to
@@ -1127,31 +1128,6 @@ do {                                                                     \
 #define FUNCTION_ARG_REGNO_P(REGNO) \
 (((REGNO) >= AR_ARG_FIRST && (REGNO) < (AR_ARG_FIRST + MAX_ARGUMENT_SLOTS)) \
  || ((REGNO) >= FR_ARG_FIRST && (REGNO) < (FR_ARG_FIRST + MAX_ARGUMENT_SLOTS)))
-\f
-/* How Scalar Function Values are Returned */
-
-/* A C expression to create an RTX representing the place where a function
-   returns a value of data type VALTYPE.  */
-
-#define FUNCTION_VALUE(VALTYPE, FUNC) \
-  ia64_function_value (VALTYPE, FUNC)
-
-/* A C expression to create an RTX representing the place where a library
-   function returns a value of mode MODE.  */
-
-#define LIBCALL_VALUE(MODE) \
-  gen_rtx_REG (MODE,                                                   \
-              (((GET_MODE_CLASS (MODE) == MODE_FLOAT                   \
-                || GET_MODE_CLASS (MODE) == MODE_COMPLEX_FLOAT) &&     \
-                     (MODE) != TFmode) \
-               ? FR_RET_FIRST : GR_RET_FIRST))
-
-/* A C expression that is nonzero if REGNO is the number of a hard register in
-   which the values of called function may come back.  */
-
-#define FUNCTION_VALUE_REGNO_P(REGNO)                          \
-  (((REGNO) >= GR_RET_FIRST && (REGNO) <= GR_RET_LAST)         \
-   || ((REGNO) >= FR_RET_FIRST && (REGNO) <= FR_RET_LAST))
 
 \f
 /* How Large Values are Returned */
@@ -1228,31 +1204,6 @@ do {                                                                     \
 #define STACK_SAVEAREA_MODE(LEVEL) \
   ((LEVEL) == SAVE_NONLOCAL ? OImode : Pmode)
 
-/* Output assembler code for a block containing the constant parts of
-   a trampoline, leaving space for the variable parts.
-
-   The trampoline should set the static chain pointer to value placed
-   into the trampoline and should branch to the specified routine.
-   To make the normal indirect-subroutine calling convention work,
-   the trampoline must look like a function descriptor; the first
-   word being the target address and the second being the target's
-   global pointer.
-
-   We abuse the concept of a global pointer by arranging for it
-   to point to the data we need to load.  The complete trampoline
-   has the following form:
-
-               +-------------------+ \
-       TRAMP:  | __ia64_trampoline | |
-               +-------------------+  > fake function descriptor
-               | TRAMP+16          | |
-               +-------------------+ /
-               | target descriptor |
-               +-------------------+
-               | static link       |
-               +-------------------+
-*/
-
 /* A C expression for the size in bytes of the trampoline, as an integer.  */
 
 #define TRAMPOLINE_SIZE                32
@@ -1260,11 +1211,6 @@ do {                                                                     \
 /* Alignment required for trampolines, in bits.  */
 
 #define TRAMPOLINE_ALIGNMENT   64
-
-/* A C statement to initialize the variable parts of a trampoline.  */
-
-#define INITIALIZE_TRAMPOLINE(ADDR, FNADDR, STATIC_CHAIN) \
-  ia64_initialize_trampoline((ADDR), (FNADDR), (STATIC_CHAIN))
 \f
 /* Addressing Modes */
 
@@ -1331,13 +1277,6 @@ do {                                                                     \
 
 #define REG_OK_FOR_INDEX_P(X) REG_OK_FOR_BASE_P (X)
 
-/* A C statement or compound statement with a conditional `goto LABEL;'
-   executed if memory address X (an RTX) can have different meanings depending
-   on the machine mode of the memory reference it is used for or if the address
-   is valid for some modes but not others.  */
-
-#define GO_IF_MODE_DEPENDENT_ADDRESS(ADDR, LABEL)
-
 /* A C expression that is nonzero if X is a legitimate constant for an
    immediate operand on the target machine.  */
 
@@ -1353,17 +1292,6 @@ do {                                                                     \
 \f
 /* Describing Relative Costs of Operations */
 
-/* A C expression for the cost of moving data from a register in class FROM to
-   one in class TO, using MODE.  */
-
-#define REGISTER_MOVE_COST  ia64_register_move_cost
-
-/* A C expression for the cost of moving data of mode M between a
-   register and memory.  */
-#define MEMORY_MOVE_COST(MODE,CLASS,IN) \
-  ((CLASS) == GENERAL_REGS || (CLASS) == FR_REGS || (CLASS) == FP_REGS \
-   || (CLASS) == GR_AND_FR_REGS ? 4 : 10)
-
 /* A C expression for the cost of a branch instruction.  A value of 1 is the
    default; other values are interpreted relative to that.  Used by the
    if-conversion code as max instruction count.  */
@@ -1371,7 +1299,7 @@ do {                                                                      \
    many additional insn groups we run into, vs how good the dynamic
    branch predictor is.  */
 
-#define BRANCH_COST 6
+#define BRANCH_COST(speed_p, predictable_p) 6
 
 /* Define this macro as a C expression which is nonzero if accessing less than
    a word of memory (i.e. a `char' or a `short') is no faster than accessing a
@@ -1423,7 +1351,7 @@ do {                                                                      \
 /* Define this macro if the register defined by `PIC_OFFSET_TABLE_REGNUM' is
    clobbered by calls.  */
 
-#define PIC_OFFSET_TABLE_REG_CALL_CLOBBERED
+#define PIC_OFFSET_TABLE_REG_CALL_CLOBBERED 1
 
 \f
 /* The Overall Framework of an Assembler File.  */
@@ -1495,8 +1423,11 @@ do {                                                                     \
 do {                                                                   \
   assemble_name (STREAM, NAME);                                                \
   fputs (" = ", STREAM);                                               \
+  if (ISDIGIT (*VALUE))                                                        \
+    ia64_asm_output_label = 1;                                         \
   assemble_name (STREAM, VALUE);                                       \
   fputc ('\n', STREAM);                                                        \
+  ia64_asm_output_label = 0;                                           \
 } while (0)
 
 \f
@@ -1925,7 +1856,7 @@ extern int ia64_final_schedule;
 #define EH_RETURN_DATA_REGNO(N) ((N) < 4 ? (N) + 15 : INVALID_REGNUM)
 
 /* This function contains machine specific function data.  */
-struct machine_function GTY(())
+struct GTY(()) machine_function
 {
   /* The new stack pointer when unwinding from EH.  */
   rtx ia64_eh_epilogue_sp;
@@ -1958,8 +1889,4 @@ struct machine_function GTY(())
 /* Switch on code for querying unit reservations.  */
 #define CPU_UNITS_QUERY 1
 
-/* Define this to change the optimizations performed by default.  */
-#define OPTIMIZATION_OPTIONS(LEVEL, SIZE) \
-  ia64_optimization_options ((LEVEL), (SIZE))
-
 /* End of ia64.h */