aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorPeter Bergner <bergner@vnet.ibm.com>2012-03-02 12:28:08 -0600
committerPeter Bergner <bergner@gcc.gnu.org>2012-03-02 12:28:08 -0600
commit2ff1689326c4f007bf2a388460d3a1aff72a769c (patch)
tree1219d0eae3e7421bd8deeadcd437a6d2defab805 /gcc
parent43743d63b3e6026088cb5bacca87ccc08acd97cd (diff)
downloadgcc-2ff1689326c4f007bf2a388460d3a1aff72a769c.zip
gcc-2ff1689326c4f007bf2a388460d3a1aff72a769c.tar.gz
gcc-2ff1689326c4f007bf2a388460d3a1aff72a769c.tar.bz2
vsx.md (vsx_set_<mode>): Reorder operands.
gcc/ * config/rs6000/vsx.md (vsx_set_<mode>): Reorder operands. gcc/testsuite/ * gcc.target/powerpc/pr52457.c: New test. From-SVN: r184811
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog4
-rw-r--r--gcc/config/rs6000/vsx.md4
-rw-r--r--gcc/testsuite/ChangeLog4
-rw-r--r--gcc/testsuite/gcc.target/powerpc/pr52457.c34
4 files changed, 44 insertions, 2 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index fa44419..677a90b 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,7 @@
+2012-03-02 Peter Bergner <bergner@vnet.ibm.com>
+
+ * config/rs6000/vsx.md (vsx_set_<mode>): Reorder operands.
+
2012-03-02 Ulrich Weigand <ulrich.weigand@linaro.org>
* config/arm/arm.c (arm_sat_operator_match): New function.
diff --git a/gcc/config/rs6000/vsx.md b/gcc/config/rs6000/vsx.md
index c23a835..37cb248 100644
--- a/gcc/config/rs6000/vsx.md
+++ b/gcc/config/rs6000/vsx.md
@@ -1119,9 +1119,9 @@
"VECTOR_MEM_VSX_P (<MODE>mode)"
{
if (INTVAL (operands[3]) == 0)
- return \"xxpermdi %x0,%x1,%x2,1\";
+ return \"xxpermdi %x0,%x2,%x1,1\";
else if (INTVAL (operands[3]) == 1)
- return \"xxpermdi %x0,%x2,%x1,0\";
+ return \"xxpermdi %x0,%x1,%x2,0\";
else
gcc_unreachable ();
}
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index 81dfa4f..27872a3 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,7 @@
+2012-03-02 Peter Bergner <bergner@vnet.ibm.com>
+
+ * gcc.target/powerpc/pr52457.c: New test.
+
2012-03-02 Ulrich Weigand <ulrich.weigand@linaro.org>
* gcc.target/arm/sat-1.c: New test.
diff --git a/gcc/testsuite/gcc.target/powerpc/pr52457.c b/gcc/testsuite/gcc.target/powerpc/pr52457.c
new file mode 100644
index 0000000..4470e55
--- /dev/null
+++ b/gcc/testsuite/gcc.target/powerpc/pr52457.c
@@ -0,0 +1,34 @@
+/* { dg-do run { target { powerpc*-*-linux* } } } */
+/* { dg-skip-if "" { powerpc*-*-darwin* } { "*" } { "" } } */
+/* { dg-skip-if "" { powerpc*-*-*spe* } { "*" } { "" } } */
+/* { dg-require-effective-target vsx_hw } */
+/* { dg-options "-O1 -mcpu=power7" } */
+
+extern void abort (void);
+
+typedef long long T;
+typedef T vl_t __attribute__((vector_size(2 * sizeof (T))));
+
+vl_t
+buggy_func (T x)
+{
+ vl_t w;
+ T *p = (T *)&w;
+ p[0] = p[1] = x;
+ return w;
+}
+
+int
+main(void)
+{
+ vl_t rval;
+ T *pl;
+
+ pl = (T *) &rval;
+ rval = buggy_func (2);
+
+ if (pl[0] != 2 || pl[1] != 2)
+ abort ();
+
+ return 0;
+}