OSDN Git Service

* config/arc/arc-protos.h arc_select_cc_mode, gen_compare_reg):
[pf3gnuchains/gcc-fork.git] / gcc / target.h
index 2d8d69b..ad92d93 100644 (file)
@@ -1,24 +1,25 @@
 /* Data structure definitions for a generic GCC target.
-   Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006
+   Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007
    Free Software Foundation, Inc.
 
-This program is free software; you can redistribute it and/or modify it
-under the terms of the GNU General Public License as published by the
-Free Software Foundation; either version 2, or (at your option) any
-later version.
+   This program is free software; you can redistribute it and/or modify it
+   under the terms of the GNU General Public License as published by the
+   Free Software Foundation; either version 3, or (at your option) any
+   later version.
 
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
 
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+   You should have received a copy of the GNU General Public License
+   along with this program; see the file COPYING3.  If not see
+   <http://www.gnu.org/licenses/>.
+
+   In other words, you are welcome to use, share and improve this program.
+   You are forbidden to forbid anyone else to use, share and improve
+   what you give them.   Help stamp out software-hoarding!  */
 
- In other words, you are welcome to use, share and improve this program.
- You are forbidden to forbid anyone else to use, share and improve
- what you give them.   Help stamp out software-hoarding!  */
 
 /* This file contains a data structure that describes a GCC target.
    At present it is incomplete, but in future it should grow to
@@ -115,7 +116,7 @@ struct gcc_target
     /* Output code that will globalize a label.  */
     void (* globalize_label) (FILE *, const char *);
 
-    /* Output code that will globalise a declaration.  */
+    /* Output code that will globalize a declaration.  */
     void (* globalize_decl_name) (FILE *, tree);
 
     /* Output code that will emit a label for unwind info, if this
@@ -162,6 +163,12 @@ struct gcc_target
        which this section is associated.  */
     void (* named_section) (const char *name, unsigned int flags, tree decl);
 
+    /* Return a mask describing how relocations should be treated when
+       selecting sections.  Bit 1 should be set if global relocations
+       should be placed in a read-write section; bit 0 should be set if
+       local relocations should be placed in a read-write section.  */
+    int (*reloc_rw_mask) (void);
+
     /* Return a section for EXP.  It may be a DECL or a constant.  RELOC
        is nonzero if runtime relocations must be applied; bit 1 will be
        set if the runtime relocations require non-local name resolution.
@@ -296,6 +303,13 @@ struct gcc_target
     void (* init_dfa_post_cycle_insn) (void);
     rtx (* dfa_post_cycle_insn) (void);
 
+    /* The values of the following two members are pointers to
+       functions used to simplify the automaton descriptions.
+       dfa_pre_advance_cycle and dfa_post_advance_cycle are getting called
+       immediatelly before and after cycle is advanced.  */
+    void (* dfa_pre_advance_cycle) (void);
+    void (* dfa_post_advance_cycle) (void);
+
     /* The following member value is a pointer to a function returning value
        which defines how many insns in queue `ready' will we try for
        multi-pass scheduling.  If the member value is nonzero and the
@@ -397,12 +411,24 @@ struct gcc_target
        function, or NULL_TREE if not available.  */
     tree (* builtin_vectorized_function) (unsigned, tree, tree);
 
+    /* Returns a code for builtin that realizes vectorized version of
+       conversion, or NULL_TREE if not available.  */
+    tree (* builtin_conversion) (unsigned, tree);
+
     /* Target builtin that implements vector widening multiplication.
        builtin_mul_widen_eve computes the element-by-element products 
        for the even elements, and builtin_mul_widen_odd computes the
        element-by-element products for the odd elements.  */
     tree (* builtin_mul_widen_even) (tree);
     tree (* builtin_mul_widen_odd) (tree);
+
+    /* Returns the cost to be added to the overheads involved with
+       executing the vectorized version of a loop.  */
+    int (*builtin_vectorization_cost) (bool);
+
+    /* Return true if vector alignment is reachable (by peeling N
+       iterations) for the given type.  */
+    bool (* vector_alignment_reachable) (tree, bool);
   } vectorize;
 
   /* The initial value of target_flags.  */
@@ -415,9 +441,19 @@ struct gcc_target
      form was.  Return true if the switch was valid.  */
   bool (* handle_option) (size_t code, const char *arg, int value);
 
+  /* Display extra, target specific information in response to a
+     --target-help switch.  */
+  void (* target_help) (void);
+
   /* Return machine mode for filter value.  */
   enum machine_mode (* eh_return_filter_mode) (void);
 
+  /* Return machine mode for libgcc expanded cmp instructions.  */
+  enum machine_mode (* libgcc_cmp_return_mode) (void);
+
+  /* Return machine mode for libgcc expanded shift instructions.  */
+  enum machine_mode (* libgcc_shift_count_mode) (void);
+
   /* Given two decls, merge their attributes and return the result.  */
   tree (* merge_decl_attributes) (tree, tree);
 
@@ -450,6 +486,9 @@ struct gcc_target
   /* True if the target supports decimal floating point.  */
   bool (* decimal_float_supported_p) (void);
 
+  /* True if the target supports fixed-point.  */
+  bool (* fixed_point_supported_p) (void);
+
   /* Return true if anonymous bitfields affect structure alignment.  */
   bool (* align_anon_bitfield) (void);
 
@@ -473,10 +512,14 @@ struct gcc_target
   /* Fold a target-specific builtin.  */
   tree (* fold_builtin) (tree fndecl, tree arglist, bool ignore);
 
-  /* For a vendor-specific fundamental TYPE, return a pointer to
-     a statically-allocated string containing the C++ mangling for
-     TYPE.  In all other cases, return NULL.  */
-  const char * (* mangle_fundamental_type) (tree type);
+  /* Returns a code for a target-specific builtin that implements
+     reciprocal of the function, or NULL_TREE if not available.  */
+  tree (* builtin_reciprocal) (unsigned, bool, bool);
+
+  /* For a vendor-specific TYPE, return a pointer to a statically-allocated
+     string containing the C++ mangling for TYPE.  In all other cases, return
+     NULL.  */
+  const char * (* mangle_type) (tree type);
 
   /* Make any adjustments to libfunc names needed for this target.  */
   void (* init_libfuncs) (void);
@@ -534,6 +577,12 @@ struct gcc_target
      to the current module.  */
   bool (* binds_local_p) (tree);
 
+  /* Modify and return the identifier of a DECL's external name,
+     originally identified by ID, as required by the target,
+    (eg, append @nn to windows32 stdcall function names).
+     The default is to return ID without modification. */
+   tree (* mangle_decl_assembler_name) (tree decl, tree  id);
+
   /* Do something target-specific to record properties of the DECL into
      the associated SYMBOL_REF.  */
   void (* encode_section_info) (tree, rtx, int);
@@ -597,6 +646,12 @@ struct gcc_target
      hook should return NULL_RTX.  */
   rtx (* dwarf_register_span) (rtx);
 
+  /* If expand_builtin_init_dwarf_reg_sizes needs to fill in table
+     entries not corresponding directly to registers below
+     FIRST_PSEUDO_REGISTER, this hook should generate the necessary
+     code, given the address of the table.  */
+  void (* init_dwarf_reg_sizes_extra) (tree);
+
   /* Fetch the fixed register(s) which hold condition codes, for
      targets where it makes sense to look for duplicate assignments to
      the condition codes.  This should return true if there is such a
@@ -694,18 +749,18 @@ struct gcc_target
 
   /* Functions relating to calls - argument passing, returns, etc.  */
   struct calls {
-    bool (*promote_function_args) (tree fntype);
-    bool (*promote_function_return) (tree fntype);
-    bool (*promote_prototypes) (tree fntype);
+    bool (*promote_function_args) (const_tree fntype);
+    bool (*promote_function_return) (const_tree fntype);
+    bool (*promote_prototypes) (const_tree fntype);
     rtx (*struct_value_rtx) (tree fndecl, int incoming);
-    bool (*return_in_memory) (tree type, tree fndecl);
-    bool (*return_in_msb) (tree type);
+    bool (*return_in_memory) (const_tree type, const_tree fndecl);
+    bool (*return_in_msb) (const_tree type);
 
     /* Return true if a parameter must be passed by reference.  TYPE may
        be null if this is a libcall.  CA may be null if this query is
        from __builtin_va_arg.  */
     bool (*pass_by_reference) (CUMULATIVE_ARGS *ca, enum machine_mode mode,
-                              tree type, bool named_arg);
+                              const_tree type, bool named_arg);
 
     rtx (*expand_builtin_saveregs) (void);
     /* Returns pretend_argument_size.  */
@@ -726,13 +781,13 @@ struct gcc_target
        but must be passed on the stack.  */
     /* ??? This predicate should be applied strictly after pass-by-reference.
        Need audit to verify that this is the case.  */
-    bool (* must_pass_in_stack) (enum machine_mode mode, tree t);
+    bool (* must_pass_in_stack) (enum machine_mode mode, const_tree t);
 
     /* Return true if type TYPE, mode MODE, which is passed by reference,
        should have the object copy generated by the callee rather than
        the caller.  It is never called for TYPE requiring constructors.  */
     bool (* callee_copies) (CUMULATIVE_ARGS *ca, enum machine_mode mode,
-                           tree type, bool named);
+                           const_tree type, bool named);
 
     /* Return zero for arguments passed entirely on the stack or entirely
        in registers.  If passed in both, return the number of bytes passed
@@ -747,7 +802,7 @@ struct gcc_target
 
     /* Return an rtx for the return value location of the function
        specified by FN_DECL_OR_TYPE with a return type of RET_TYPE.  */
-    rtx (*function_value) (tree ret_type, tree fn_decl_or_type,
+    rtx (*function_value) (const_tree ret_type, const_tree fn_decl_or_type,
                           bool outgoing);
 
     /* Return an rtx for the argument pointer incoming to the
@@ -772,6 +827,13 @@ struct gcc_target
                                      enum machine_mode,
                                      struct secondary_reload_info *);
 
+  /* Functions specific to the C family of frontends.  */
+  struct c {
+    /* Return machine mode for non-standard suffix
+       or VOIDmode if non-standard suffixes are unsupported.  */
+    enum machine_mode (*mode_for_suffix) (char);
+  } c;
+
   /* Functions specific to the C++ frontend.  */
   struct cxx {
     /* Return the integer type used for guard variables.  */
@@ -882,4 +944,16 @@ struct gcc_target
 
 extern struct gcc_target targetm;
 
+struct gcc_targetcm {
+  /* Handle target switch CODE (an OPT_* value).  ARG is the argument
+     passed to the switch; it is NULL if no argument was.  VALUE is the
+     value of ARG if CODE specifies a UInteger option, otherwise it is
+     1 if the positive form of the switch was used and 0 if the negative
+     form was.  Return true if the switch was valid.  */
+  bool (*handle_c_option) (size_t code, const char *arg, int value);
+};
+
+/* Each target can provide their own.  */
+extern struct gcc_targetcm targetcm;
+
 #endif /* GCC_TARGET_H */