aboutsummaryrefslogtreecommitdiff
path: root/gcc/config
diff options
context:
space:
mode:
authorRichard Guenther <rguenther@suse.de>2006-12-05 15:42:54 +0000
committerRichard Biener <rguenth@gcc.gnu.org>2006-12-05 15:42:54 +0000
commitdb3cf6bd4c939568b128daebc99c6c5633bd449c (patch)
tree865bc35f1b4093688f743a1e2cf5b1b182c558fa /gcc/config
parent928341b20854c6c73ae57a888e7c0dfe23efe354 (diff)
downloadgcc-db3cf6bd4c939568b128daebc99c6c5633bd449c.zip
gcc-db3cf6bd4c939568b128daebc99c6c5633bd449c.tar.gz
gcc-db3cf6bd4c939568b128daebc99c6c5633bd449c.tar.bz2
i386.c (ix86_builtin_vectorized_function): Declare.
2006-12-05 Richard Guenther <rguenther@suse.de> * config/i386/i386.c (ix86_builtin_vectorized_function): Declare. (TARGET_VECTORIZE_BUILTIN_VECTORIZED_FUNCTION): Define. (ix86_builtin_vectorized_function): New function to vectorize sqrt. * gcc.dg/vect/vect.exp: Add support for -fno-math-errno tests. * gcc.dg/vect/vect-pow-2.c: Rename to ... * gcc.dg/vect/no-math-errno-vect-pow-1.c: ... this. Require vect_double, xfail for spu*-*-*. From-SVN: r119542
Diffstat (limited to 'gcc/config')
-rw-r--r--gcc/config/i386/i386.c38
1 files changed, 38 insertions, 0 deletions
diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c
index 22ed4a9..40d96a0 100644
--- a/gcc/config/i386/i386.c
+++ b/gcc/config/i386/i386.c
@@ -1354,6 +1354,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 const char *ix86_mangle_fundamental_type (tree);
static tree ix86_stack_protect_fail (void);
static rtx ix86_internal_arg_pointer (void);
@@ -1418,6 +1419,8 @@ static section *x86_64_elf_select_section (tree decl, int reloc,
#define TARGET_INIT_BUILTINS ix86_init_builtins
#undef TARGET_EXPAND_BUILTIN
#define TARGET_EXPAND_BUILTIN ix86_expand_builtin
+#undef TARGET_VECTORIZE_BUILTIN_VECTORIZED_FUNCTION
+#define TARGET_VECTORIZE_BUILTIN_VECTORIZED_FUNCTION ix86_builtin_vectorized_function
#undef TARGET_ASM_FUNCTION_EPILOGUE
#define TARGET_ASM_FUNCTION_EPILOGUE ix86_output_function_epilogue
@@ -17639,6 +17642,41 @@ ix86_expand_builtin (tree exp, rtx target, rtx subtarget ATTRIBUTE_UNUSED,
gcc_unreachable ();
}
+/* Returns a function decl for a vectorized version of the builtin function
+ with builtin function code FN and the result vector type TYPE, or NULL_TREE
+ if it is not available. */
+
+static tree
+ix86_builtin_vectorized_function (enum built_in_function fn, tree type)
+{
+ enum machine_mode el_mode;
+ int n;
+
+ if (TREE_CODE (type) != VECTOR_TYPE)
+ return NULL_TREE;
+
+ el_mode = TYPE_MODE (TREE_TYPE (type));
+ n = TYPE_VECTOR_SUBPARTS (type);
+
+ switch (fn)
+ {
+ case BUILT_IN_SQRT:
+ if (el_mode == DFmode && n == 2)
+ return ix86_builtins[IX86_BUILTIN_SQRTPD];
+ return NULL_TREE;
+
+ case BUILT_IN_SQRTF:
+ if (el_mode == SFmode && n == 4)
+ return ix86_builtins[IX86_BUILTIN_SQRTPS];
+ return NULL_TREE;
+
+ default:
+ ;
+ }
+
+ return NULL_TREE;
+}
+
/* Store OPERAND to the memory after reload is completed. This means
that we can't easily use assign_stack_local. */
rtx