summaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorAndrew Pinski <andrew_pinski@playstation.sony.com>2009-11-04 18:35:57 +0000
committerAndrew Pinski <pinskia@gcc.gnu.org>2009-11-04 10:35:57 -0800
commit0e159e0f2bfa8b235fef752c8a67d190ec869d15 (patch)
tree795d61d4f784b7538bcd75914efd3f4dabf69c68 /gcc
parentac3554c568c57f468e8f57e86de4ce2c86d55b62 (diff)
downloadgcc-0e159e0f2bfa8b235fef752c8a67d190ec869d15.tar.gz
re PR rtl-optimization/41833 (vec_splat followed by vec_splat could be improved)
2009-11-04 Andrew Pinski <andrew_pinski@playstation.sony.com> Trevor Smigiel <Trevor_Smigiel@playstation.sony.com> PR rtl-opt/41833 * simplify-rtx.c (simplify_binary_operation_1): Simplify vec_select of a vec_duplicate. 2009-11-04 Andrew Pinski <andrew_pinski@playstation.sony.com> PR rtl-opt/41833 * gcc.target/powerpc/altivec-33.c: New testcase. Co-Authored-By: Trevor Smigiel <Trevor_Smigiel@playstation.sony.com> From-SVN: r153906
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog9
-rw-r--r--gcc/simplify-rtx.c3
-rw-r--r--gcc/testsuite/ChangeLog5
-rw-r--r--gcc/testsuite/gcc.target/powerpc/altivec-33.c16
4 files changed, 32 insertions, 1 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 619e45045b6..d34908043dc 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,8 +1,15 @@
+2009-11-04 Andrew Pinski <andrew_pinski@playstation.sony.com>
+ Trevor Smigiel <Trevor_Smigiel@playstation.sony.com>
+
+ PR rtl-opt/41833
+ * simplify-rtx.c (simplify_binary_operation_1): Simplify vec_select of
+ a vec_duplicate.
+
2009-11-04 Richard Guenther <rguenther@suse.de>
Rafael Avila de Espindola <espindola@google.com>
* gcc.c (process_command): Handle arguments name@offset.
-
+
2009-11-04 Harsha Jagasia <harsha.jagasia@amd.com>
Dwarakanath Rajagopal <dwarak.rajagopal@amd.com>
diff --git a/gcc/simplify-rtx.c b/gcc/simplify-rtx.c
index 39a791d9890..ee119bcd65c 100644
--- a/gcc/simplify-rtx.c
+++ b/gcc/simplify-rtx.c
@@ -2946,6 +2946,9 @@ simplify_binary_operation_1 (enum rtx_code code, enum machine_mode mode,
tmp_op, gen_rtx_PARALLEL (VOIDmode, vec));
return tmp;
}
+ if (GET_CODE (trueop0) == VEC_DUPLICATE
+ && GET_MODE (XEXP (trueop0, 0)) == mode)
+ return XEXP (trueop0, 0);
}
else
{
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index f11bfa2d9e9..a0e861bc6c5 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,8 @@
+2009-11-04 Andrew Pinski <andrew_pinski@playstation.sony.com>
+
+ PR rtl-opt/41833
+ * gcc.target/powerpc/altivec-33.c: New testcase.
+
2009-11-04 Jason Merrill <jason@redhat.com>
PR c++/17365, DR 218
diff --git a/gcc/testsuite/gcc.target/powerpc/altivec-33.c b/gcc/testsuite/gcc.target/powerpc/altivec-33.c
new file mode 100644
index 00000000000..c1c935a1c59
--- /dev/null
+++ b/gcc/testsuite/gcc.target/powerpc/altivec-33.c
@@ -0,0 +1,16 @@
+/* { dg-do compile } */
+/* { dg-require-effective-target powerpc_altivec_ok } */
+/* { dg-options "-O2 -maltivec" } */
+
+/* We should only produce one vspltw as we already splatted the value. */
+/* { dg-final { scan-assembler-times "vspltw" 1 } } */
+
+#include <altivec.h>
+
+vector float f(vector float a)
+{
+ vector float b = vec_splat (a, 2);
+ return vec_splat (b, 0);
+}
+
+