aboutsummaryrefslogtreecommitdiff
path: root/gcc/config
diff options
context:
space:
mode:
authorRichard Guenther <rguenther@suse.de>2007-02-05 21:38:53 +0000
committerRichard Biener <rguenth@gcc.gnu.org>2007-02-05 21:38:53 +0000
commitb95becfc098b8853f95c5302657c0b46ff575cb3 (patch)
treeacd2d1f47d5813e7f9565319ed7b57c1c8a10607 /gcc/config
parentd6df67efcd64255f685a4556c20690f56315dad0 (diff)
downloadgcc-b95becfc098b8853f95c5302657c0b46ff575cb3.zip
gcc-b95becfc098b8853f95c5302657c0b46ff575cb3.tar.gz
gcc-b95becfc098b8853f95c5302657c0b46ff575cb3.tar.bz2
tree-vectorizer.h (vectorizable_function): Add argument type argument, change return type.
2007-02-05 Richard Guenther <rguenther@suse.de> * tree-vectorizer.h (vectorizable_function): Add argument type argument, change return type. * tree-vect-patterns.c (vect_recog_pow_pattern): Adjust caller. * tree-vect-transform.c (vectorizable_function): Handle extra argument, return vectorized function decl. (build_vectorized_function_call): Remove. (vectorizable_call): Handle calls with result and argument types differing. Handle loop vectorization factor correctly. * targhooks.c (default_builtin_vectorized_function): Adjust for extra argument. * targhooks.h (default_builtin_vectorized_function): Likewise. * target.h (builtin_vectorized_function): Add argument type argument. * config/i386/i386.c (ix86_builtin_vectorized_function): Handle extra argument, allow vectorizing of lrintf. * doc/tm.texi (TARGET_VECTORIZE_BUILTIN_VECTORIZED_FUNCTION): Adjust documentation of target hook. * gcc.target/i386/vectorize3.c: New testcase. From-SVN: r121617
Diffstat (limited to 'gcc/config')
-rw-r--r--gcc/config/i386/i386.c30
1 files changed, 21 insertions, 9 deletions
diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c
index e652d7e..ea12849 100644
--- a/gcc/config/i386/i386.c
+++ b/gcc/config/i386/i386.c
@@ -1355,7 +1355,7 @@ static bool ix86_pass_by_reference (CUMULATIVE_ARGS *, enum machine_mode,
tree, bool);
static void ix86_init_builtins (void);
static rtx ix86_expand_builtin (tree, rtx, rtx, enum machine_mode, int);
-static tree ix86_builtin_vectorized_function (enum built_in_function, tree);
+static tree ix86_builtin_vectorized_function (enum built_in_function, tree, tree);
static const char *ix86_mangle_fundamental_type (tree);
static tree ix86_stack_protect_fail (void);
static rtx ix86_internal_arg_pointer (void);
@@ -17661,29 +17661,41 @@ ix86_expand_builtin (tree exp, rtx target, rtx subtarget ATTRIBUTE_UNUSED,
if it is not available. */
static tree
-ix86_builtin_vectorized_function (enum built_in_function fn, tree type)
+ix86_builtin_vectorized_function (enum built_in_function fn, tree type_out,
+ tree type_in)
{
- enum machine_mode el_mode;
- int n;
+ enum machine_mode in_mode, out_mode;
+ int in_n, out_n;
- if (TREE_CODE (type) != VECTOR_TYPE)
+ if (TREE_CODE (type_out) != VECTOR_TYPE
+ || TREE_CODE (type_in) != VECTOR_TYPE)
return NULL_TREE;
- el_mode = TYPE_MODE (TREE_TYPE (type));
- n = TYPE_VECTOR_SUBPARTS (type);
+ out_mode = TYPE_MODE (TREE_TYPE (type_out));
+ out_n = TYPE_VECTOR_SUBPARTS (type_out);
+ in_mode = TYPE_MODE (TREE_TYPE (type_in));
+ in_n = TYPE_VECTOR_SUBPARTS (type_in);
switch (fn)
{
case BUILT_IN_SQRT:
- if (el_mode == DFmode && n == 2)
+ if (out_mode == DFmode && out_n == 2
+ && in_mode == DFmode && in_n == 2)
return ix86_builtins[IX86_BUILTIN_SQRTPD];
return NULL_TREE;
case BUILT_IN_SQRTF:
- if (el_mode == SFmode && n == 4)
+ if (out_mode == SFmode && out_n == 4
+ && in_mode == SFmode && in_n == 4)
return ix86_builtins[IX86_BUILTIN_SQRTPS];
return NULL_TREE;
+ case BUILT_IN_LRINTF:
+ if (out_mode == SImode && out_n == 4
+ && in_mode == SFmode && in_n == 4)
+ return ix86_builtins[IX86_BUILTIN_CVTPS2DQ];
+ return NULL_TREE;
+
default:
;
}