aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorrguenth <>2012-02-28 15:28:32 +0000
committerrguenth <>2012-02-28 15:28:32 +0000
commitf22af02bf05267432545c0c52a833506c122f2f0 (patch)
treef7b146160a49c33abb23de4d3804f5e5c8fa39ea /gcc
parenta5cf01bb3a8c99c21df13257ae7436ad5e778637 (diff)
2012-02-28 Richard Guenther <rguenther@suse.de>
PR target/52407 * config/i386/i386.c (ix86_expand_vector_set): Fix element ordering for the VEC_CONCAT for two element vectors for V2SFmode, V2SImode and V2DImode. * gcc.dg/torture/pr52407.c: New testcase.
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog7
-rw-r--r--gcc/config/i386/i386.c8
-rw-r--r--gcc/testsuite/ChangeLog5
-rw-r--r--gcc/testsuite/gcc.dg/torture/pr52407.c33
4 files changed, 49 insertions, 4 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index f725ed580e1..8aa4054dd7c 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,10 @@
+2012-02-28 Richard Guenther <rguenther@suse.de>
+
+ PR target/52407
+ * config/i386/i386.c (ix86_expand_vector_set): Fix element
+ ordering for the VEC_CONCAT for two element vectors for
+ V2SFmode, V2SImode and V2DImode.
+
2012-02-28 Richard Earnshaw <rearnsha@arm.com>
PR target/49448
diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c
index 52fcb61a6d8..f93583f9046 100644
--- a/gcc/config/i386/i386.c
+++ b/gcc/config/i386/i386.c
@@ -33562,9 +33562,9 @@ ix86_expand_vector_set (bool mmx_ok, rtx target, rtx val, int elt)
tmp = gen_reg_rtx (GET_MODE_INNER (mode));
ix86_expand_vector_extract (true, tmp, target, 1 - elt);
if (elt == 0)
- tmp = gen_rtx_VEC_CONCAT (mode, tmp, val);
- else
tmp = gen_rtx_VEC_CONCAT (mode, val, tmp);
+ else
+ tmp = gen_rtx_VEC_CONCAT (mode, tmp, val);
emit_insn (gen_rtx_SET (VOIDmode, target, tmp));
return;
}
@@ -33578,9 +33578,9 @@ ix86_expand_vector_set (bool mmx_ok, rtx target, rtx val, int elt)
tmp = gen_reg_rtx (GET_MODE_INNER (mode));
ix86_expand_vector_extract (false, tmp, target, 1 - elt);
if (elt == 0)
- tmp = gen_rtx_VEC_CONCAT (mode, tmp, val);
- else
tmp = gen_rtx_VEC_CONCAT (mode, val, tmp);
+ else
+ tmp = gen_rtx_VEC_CONCAT (mode, tmp, val);
emit_insn (gen_rtx_SET (VOIDmode, target, tmp));
return;
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index 09da73f681c..ef3fe50434a 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,8 @@
+2012-02-28 Richard Guenther <rguenther@suse.de>
+
+ PR target/52407
+ * gcc.dg/torture/pr52407.c: New testcase.
+
2012-02-28 Ramana Radhakrishnan <ramana.radhakrishnan@arm.com>
* gcc.target/arm/vfp1.c (dg_do run): Run on all eabi variants.
diff --git a/gcc/testsuite/gcc.dg/torture/pr52407.c b/gcc/testsuite/gcc.dg/torture/pr52407.c
new file mode 100644
index 00000000000..bb95e51f25b
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/torture/pr52407.c
@@ -0,0 +1,33 @@
+/* { dg-do run } */
+
+extern void abort (void);
+
+typedef long long T;
+typedef T vl_t __attribute__((vector_size(2 * sizeof (T))));
+
+vl_t ul[4], vl[4] = { { 1, 2 }, { 3, 4 }, { 5, 6 }, { 7, 8 } };
+
+static void
+mul_vl_l(vl_t *u, vl_t *v, T x, int m)
+{
+ vl_t w;
+ T *p = (T *)&w;
+ p[0] = p[1] = x;
+ while (m--)
+ *u++ = *v++ * w;
+}
+
+int
+main(int argc, char *argv[])
+{
+ int i;
+ T *pl;
+
+ pl = (T *) &ul;
+ mul_vl_l(ul, vl, 2, 4);
+ for (i = 0; i < 8; i++)
+ if (pl[i] != 2 * (i + 1))
+ abort ();
+
+ return 0;
+}