OSDN Git Service

2009-11-04 Andrew Pinski <andrew_pinski@playstation.sony.com>
authorpinskia <pinskia@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 4 Nov 2009 18:35:57 +0000 (18:35 +0000)
committerpinskia <pinskia@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 4 Nov 2009 18:35:57 +0000 (18:35 +0000)
            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.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@153906 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/ChangeLog
gcc/simplify-rtx.c
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.target/powerpc/altivec-33.c [new file with mode: 0644]

index 619e450..d349080 100644 (file)
@@ -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>
        
index 39a791d..ee119bc 100644 (file)
@@ -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
        {
index f11bfa2..a0e861b 100644 (file)
@@ -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 (file)
index 0000000..c1c935a
--- /dev/null
@@ -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);
+}
+
+