+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
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));
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);
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));
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})
/* 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. */
/* Default target hook functions.
- Copyright (C) 2003, 2004, 2005, 2007, 2008, 2009
+ Copyright (C) 2003, 2004, 2005, 2007, 2008, 2009, 2010
Free Software Foundation, Inc.
This file is part of GCC.
/* Mapping of builtin functions to vectorized variants. */
tree
-default_builtin_vectorized_function (unsigned int fn ATTRIBUTE_UNUSED,
+default_builtin_vectorized_function (tree fndecl ATTRIBUTE_UNUSED,
tree type_out ATTRIBUTE_UNUSED,
tree type_in ATTRIBUTE_UNUSED)
{
/* Default target hook functions.
- Copyright (C) 2003, 2004, 2005, 2007, 2008, 2009
+ Copyright (C) 2003, 2004, 2005, 2007, 2008, 2009, 2010
Free Software Foundation, Inc.
This file is part of GCC.
extern const char * default_invalid_within_doloop (const_rtx);
-extern tree default_builtin_vectorized_function (unsigned int, tree, tree);
+extern tree default_builtin_vectorized_function (tree, tree, tree);
extern tree default_builtin_vectorized_conversion (unsigned int, tree);
/* Statement Analysis and Transformation for Vectorization
- Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software
- Foundation, Inc.
+ Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010
+ Free Software Foundation, Inc.
Contributed by Dorit Naishlos <dorit@il.ibm.com>
and Ira Rosen <irar@il.ibm.com>
vectorizable_function (gimple call, tree vectype_out, tree vectype_in)
{
tree fndecl = gimple_call_fndecl (call);
- enum built_in_function code;
/* We only handle functions that do not read or clobber memory -- i.e.
const or novops ones. */
|| !DECL_BUILT_IN (fndecl))
return NULL_TREE;
- code = DECL_FUNCTION_CODE (fndecl);
- return targetm.vectorize.builtin_vectorized_function (code, vectype_out,
+ return targetm.vectorize.builtin_vectorized_function (fndecl, vectype_out,
vectype_in);
}