summaryrefslogtreecommitdiff
path: root/gcc/config/spu/spu.c
diff options
context:
space:
mode:
authorwschmidt <wschmidt@138bc75d-0d04-0410-961f-82ee72b054a4>2012-06-13 12:27:57 +0000
committerwschmidt <wschmidt@138bc75d-0d04-0410-961f-82ee72b054a4>2012-06-13 12:27:57 +0000
commitd13adc778dc54efc4fdd0aba6c72a6e50296bf08 (patch)
treea90486546faa1a3cb017da25e97444b6cabc379f /gcc/config/spu/spu.c
parent6b3952d72db67ed85177976bad4a7bf961d858f5 (diff)
downloadgcc-d13adc778dc54efc4fdd0aba6c72a6e50296bf08.tar.gz
2012-06-13 Bill Schmidt <wschmidt@linux.ibm.com>
* targhooks.c (default_builtin_vectorized_conversion): Handle vec_construct, using vectype to base cost on subparts. * target.h (enum vect_cost_for_stmt): Add vec_construct. * tree-vect-stmts.c (vect_model_load_cost): Use vec_construct instead of scalar_to-vec. * config/spu/spu.c (spu_builtin_vectorization_cost): Handle vec_construct in same way as default for now. * config/i386/i386.c (ix86_builtin_vectorization_cost): Likewise. * config/rs6000/rs6000.c (rs6000_builtin_vectorization_cost): Handle vec_construct, including special case for 32-bit loads. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@188508 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/config/spu/spu.c')
-rw-r--r--gcc/config/spu/spu.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/gcc/config/spu/spu.c b/gcc/config/spu/spu.c
index b81bf5e8f2d..5310ba7f2f0 100644
--- a/gcc/config/spu/spu.c
+++ b/gcc/config/spu/spu.c
@@ -6908,9 +6908,11 @@ spu_builtin_mask_for_load (void)
/* Implement targetm.vectorize.builtin_vectorization_cost. */
static int
spu_builtin_vectorization_cost (enum vect_cost_for_stmt type_of_cost,
- tree vectype ATTRIBUTE_UNUSED,
+ tree vectype,
int misalign ATTRIBUTE_UNUSED)
{
+ unsigned elements;
+
switch (type_of_cost)
{
case scalar_stmt:
@@ -6937,6 +6939,10 @@ spu_builtin_vectorization_cost (enum vect_cost_for_stmt type_of_cost,
case cond_branch_taken:
return 6;
+ case vec_construct:
+ elements = TYPE_VECTOR_SUBPARTS (vectype);
+ return elements / 2 + 1;
+
default:
gcc_unreachable ();
}