Commit 4957645d authored by rguenth's avatar rguenth
Browse files

2006-11-30 Richard Guenther <rguenther@suse.de>

	* tree-vectorizer.h (vectorizable_function): Export.
	* tree-vect-transform.c (vectorizable_function): Likewise.
        * tree-vect-patterns.c (vect_recog_pow_pattern): Set
        type_in to scalar type in recognition of squaring.
	Make sure the target can vectorize sqrt in recognition
	of sqrt, set type_in to vector type in this case.

	* gcc.dg/vect/vect-pow-1.c: Rename ...
	* gcc.dg/vect/fast-math-vect-pow-1.c: ... to this.  Use
	floats instead of doubles, check successful vectorization.


git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@119362 138bc75d-0d04-0410-961f-82ee72b054a4
parent 8a355d81
2006-11-30 Richard Guenther <rguenther@suse.de>
* tree-vectorizer.h (vectorizable_function): Export.
* tree-vect-transform.c (vectorizable_function): Likewise.
* tree-vect-patterns.c (vect_recog_pow_pattern): Set
type_in to scalar type in recognition of squaring.
Make sure the target can vectorize sqrt in recognition
of sqrt, set type_in to vector type in this case.
2006-11-30 Uros Bizjak <ubizjak@gmail.com>
 
* config/i386/i386.md (R10_REG): New constant.
......
2006-11-30 Richard Guenther <rguenther@suse.de>
* gcc.dg/vect/vect-pow-1.c: Rename ...
* gcc.dg/vect/fast-math-vect-pow-1.c: ... to this. Use
floats instead of doubles, check successful vectorization.
2006-11-29 Andrew Pinski <andrew_pinski@playstation.sony.com>
 
PR target/29945
/* { dg-do compile } */
/* { dg-options "-O2 -ftree-vectorize -ffast-math -fdump-tree-vect-details" } */
/* { dg-require-effective-target vect_float } */
double x[256];
float x[256];
void foo(void)
{
......@@ -10,5 +10,5 @@ void foo(void)
x[i] = x[i] * x[i];
}
/* { dg-final { scan-tree-dump "pattern recognized" "vect" } } */
/* { dg-final { scan-tree-dump "vectorized 1 loops" "vect" } } */
/* { dg-final { cleanup-tree-dump "vect" } } */
......@@ -466,7 +466,6 @@ vect_recog_pow_pattern (tree last_stmt, tree *type_in, tree *type_out)
/* We now have a pow or powi builtin function call with a constant
exponent. */
*type_in = get_vectype_for_scalar_type (TREE_TYPE (base));
*type_out = NULL_TREE;
/* Catch squaring. */
......@@ -474,7 +473,10 @@ vect_recog_pow_pattern (tree last_stmt, tree *type_in, tree *type_out)
&& tree_low_cst (exp, 0) == 2)
|| (TREE_CODE (exp) == REAL_CST
&& REAL_VALUES_EQUAL (TREE_REAL_CST (exp), dconst2)))
return build2 (MULT_EXPR, TREE_TYPE (base), base, base);
{
*type_in = TREE_TYPE (base);
return build2 (MULT_EXPR, TREE_TYPE (base), base, base);
}
/* Catch square root. */
if (TREE_CODE (exp) == REAL_CST
......@@ -482,7 +484,13 @@ vect_recog_pow_pattern (tree last_stmt, tree *type_in, tree *type_out)
{
tree newfn = mathfn_built_in (TREE_TYPE (base), BUILT_IN_SQRT);
tree newarglist = build_tree_list (NULL_TREE, base);
return build_function_call_expr (newfn, newarglist);
*type_in = get_vectype_for_scalar_type (TREE_TYPE (base));
if (*type_in)
{
newfn = build_function_call_expr (newfn, newarglist);
if (vectorizable_function (newfn, *type_in))
return newfn;
}
}
return NULL_TREE;
......
......@@ -1570,7 +1570,7 @@ vectorizable_reduction (tree stmt, block_stmt_iterator *bsi, tree *vec_stmt)
true if the target has a vectorized version of the function,
or false if the function cannot be vectorized. */
static bool
bool
vectorizable_function (tree call, tree vectype)
{
tree fndecl = get_callee_fndecl (call);
......
......@@ -398,6 +398,7 @@ extern bool vectorizable_operation (tree, block_stmt_iterator *, tree *);
extern bool vectorizable_type_promotion (tree, block_stmt_iterator *, tree *);
extern bool vectorizable_type_demotion (tree, block_stmt_iterator *, tree *);
extern bool vectorizable_assignment (tree, block_stmt_iterator *, tree *);
extern bool vectorizable_function (tree, tree);
extern bool vectorizable_call (tree, block_stmt_iterator *, tree *);
extern bool vectorizable_condition (tree, block_stmt_iterator *, tree *);
extern bool vectorizable_live_operation (tree, block_stmt_iterator *, tree *);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment