OSDN Git Service

PR 43544, change TARGET_VECTORIZE_BUILTIN_VECTORIZED_FUNCTION to take a tree argument
authormeissner <meissner@138bc75d-0d04-0410-961f-82ee72b054a4>
Sat, 27 Mar 2010 10:27:39 +0000 (10:27 +0000)
committerMasaki Muranaka <monaka@monami-software.com>
Sun, 23 May 2010 00:37:23 +0000 (09:37 +0900)
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@157770 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/ChangeLog
gcc/config/i386/i386.c
gcc/config/rs6000/rs6000.c
gcc/doc/tm.texi
gcc/target.h

index eb2928d..c89990b 100644 (file)
@@ -1,3 +1,18 @@
+2010-03-26  Michael Meissner  <meissner@linux.vnet.ibm.com>
+
+       PR tree-optimization/43544
+       * doc/tm.texi (TARGET_VECTORIZE_BUILTIN_VECTORIZED_FUNCTION):
+       First argument for builtin vectorized function hook is now a
+       tree to be able to distinguish between machine specific and
+       standard builtins.
+       * targhooks.c (default_builtin_vectorized_function): Ditto.
+       * targhooks.h (default_builtin_vectorized_function): Ditto.
+       * target.h (struct gcc_target): Ditto.
+       * tree-vect-stmts.c (vectorizable_function): Ditto.
+       * config/i386/i386.c (ix86_builtin_vectorized_function): Ditto.
+       * config/rs6000/rs6000.c (rs6000_builtin_vectorized_function):
+       Ditto.
+
 2010-03-26  Joseph Myers  <joseph@codesourcery.com>
 
        PR c/43381
index 985a3e5..39b1da4 100644 (file)
@@ -24375,14 +24375,16 @@ ix86_expand_builtin (tree exp, rtx target, rtx subtarget ATTRIBUTE_UNUSED,
    if it is not available.  */
 
 static tree
-ix86_builtin_vectorized_function (unsigned int fn, tree type_out,
+ix86_builtin_vectorized_function (tree fndecl, tree type_out,
                                  tree type_in)
 {
   enum machine_mode in_mode, out_mode;
   int in_n, out_n;
+  enum built_in_function fn = DECL_FUNCTION_CODE (fndecl);
 
   if (TREE_CODE (type_out) != VECTOR_TYPE
-      || TREE_CODE (type_in) != VECTOR_TYPE)
+      || TREE_CODE (type_in) != VECTOR_TYPE
+      || DECL_BUILT_IN_CLASS (fndecl) != BUILT_IN_NORMAL)
     return NULL_TREE;
 
   out_mode = TYPE_MODE (TREE_TYPE (type_out));
index 98b4d94..91f66a9 100644 (file)
@@ -909,7 +909,7 @@ static rtx rs6000_emit_stack_reset (rs6000_stack_t *, rtx, rtx, int, bool);
 static rtx rs6000_make_savres_rtx (rs6000_stack_t *, rtx, int,
                                   enum machine_mode, bool, bool, bool);
 static bool rs6000_reg_live_or_pic_offset_p (int);
-static tree rs6000_builtin_vectorized_function (unsigned int, tree, tree);
+static tree rs6000_builtin_vectorized_function (tree, tree, tree);
 static int rs6000_savres_strategy (rs6000_stack_t *, bool, int, int);
 static void rs6000_restore_saved_cr (rtx, int);
 static void rs6000_output_function_prologue (FILE *, HOST_WIDE_INT);
@@ -3179,15 +3179,17 @@ rs6000_parse_fpu_option (const char *option)
    if it is not available.  */
 
 static tree
-rs6000_builtin_vectorized_function (unsigned int fn, tree type_out,
+rs6000_builtin_vectorized_function (tree fndecl, tree type_out,
                                    tree type_in)
 {
   enum machine_mode in_mode, out_mode;
   int in_n, out_n;
+  enum built_in_function fn = DECL_FUNCTION_CODE (fndecl);
 
   if (TREE_CODE (type_out) != VECTOR_TYPE
       || TREE_CODE (type_in) != VECTOR_TYPE
-      || !TARGET_VECTORIZE_BUILTINS)
+      || !TARGET_VECTORIZE_BUILTINS
+      || DECL_BUILT_IN_CLASS (fndecl) != BUILT_IN_NORMAL)
     return NULL_TREE;
 
   out_mode = TYPE_MODE (TREE_TYPE (type_out));
index a11e99e..012edd7 100644 (file)
@@ -5717,13 +5717,13 @@ If this hook is defined, the autovectorizer will use the
 conversion. Otherwise, it will return @code{NULL_TREE}.
 @end deftypefn
 
-@deftypefn {Target Hook} tree TARGET_VECTORIZE_BUILTIN_VECTORIZED_FUNCTION (unsigned @var{code}, tree @var{vec_type_out}, tree @var{vec_type_in})
-This hook should return the decl of a function that implements the vectorized
-variant of the builtin function with builtin function code @var{code} or
-@code{NULL_TREE} if such a function is not available.  The value of @var{code}
-is one of the enumerators in @code{enum built_in_function}.  The return type of
-the vectorized function shall be of vector type @var{vec_type_out} and the
-argument types should be @var{vec_type_in}.
+@deftypefn {Target Hook} tree TARGET_VECTORIZE_BUILTIN_VECTORIZED_FUNCTION (tree @var{fndecl}, tree @var{vec_type_out}, tree @var{vec_type_in})
+This hook should return the decl of a function that implements the
+vectorized variant of the builtin function with builtin function code
+@var{code} or @code{NULL_TREE} if such a function is not available.
+The value of @var{fndecl} is the builtin function declaration.  The
+return type of the vectorized function shall be of vector type
+@var{vec_type_out} and the argument types should be @var{vec_type_in}.
 @end deftypefn
 
 @deftypefn {Target Hook} bool TARGET_SUPPORT_VECTOR_MISALIGNMENT (enum machine_mode @var{mode}, const_tree @var{type}, int @var{misalignment}, bool @var{is_packed})
index 645bd0a..41ae3e3 100644 (file)
@@ -471,7 +471,7 @@ struct gcc_target
 
     /* Returns a code for builtin that realizes vectorized version of
        function, or NULL_TREE if not available.  */
-    tree (* builtin_vectorized_function) (unsigned, tree, tree);
+    tree (* builtin_vectorized_function) (tree, tree, tree);
 
     /* Returns a code for builtin that realizes vectorized version of
        conversion, or NULL_TREE if not available.  */