diff options
author | jakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4> | 2010-12-21 22:37:23 +0000 |
---|---|---|
committer | jakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4> | 2010-12-21 22:37:23 +0000 |
commit | ff6a33df5b4bee1b525cefee5c8899215c78b130 (patch) | |
tree | 02e1aec91a45dc7debada0d82f5698e4cd7a13d2 | |
parent | 89b224863c8e51486b23f8fb41c9c4d0e3afed8c (diff) | |
download | gcc-ff6a33df5b4bee1b525cefee5c8899215c78b130.tar.gz |
PR target/46880
* config/i386/sse.md (sse2_loadlpd, sse2_movsd): Fix shufpd source
operand.
* gcc.target/i386/pr46880.c: New test.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@168135 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r-- | gcc/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/config/i386/sse.md | 4 | ||||
-rw-r--r-- | gcc/testsuite/ChangeLog | 7 | ||||
-rw-r--r-- | gcc/testsuite/gcc.target/i386/pr46880.c | 28 |
4 files changed, 42 insertions, 3 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index bc44e7bd474..133b65bbf0b 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2010-12-21 Jakub Jelinek <jakub@redhat.com> + + PR target/46880 + * config/i386/sse.md (sse2_loadlpd, sse2_movsd): Fix shufpd source + operand. + 2010-12-21 Ira Rosen <irar@il.ibm.com> PR tree-optimization/47001 diff --git a/gcc/config/i386/sse.md b/gcc/config/i386/sse.md index e13308c0de4..a942a2b1717 100644 --- a/gcc/config/i386/sse.md +++ b/gcc/config/i386/sse.md @@ -4990,7 +4990,7 @@ movsd\t{%2, %0|%0, %2} movlpd\t{%2, %0|%0, %2} movsd\t{%2, %0|%0, %2} - shufpd\t{$2, %2, %0|%0, %2, 2} + shufpd\t{$2, %1, %0|%0, %1, 2} movhpd\t{%H1, %0|%0, %H1} # # @@ -5067,7 +5067,7 @@ movsd\t{%2, %0|%0, %2} movlpd\t{%2, %0|%0, %2} movlpd\t{%2, %0|%0, %2} - shufpd\t{$2, %2, %0|%0, %2, 2} + shufpd\t{$2, %1, %0|%0, %1, 2} movhps\t{%H1, %0|%0, %H1} movhps\t{%1, %H0|%H0, %1}" [(set_attr "type" "ssemov,ssemov,ssemov,sselog,ssemov,ssemov") diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index b03b602e12d..ea27d4ac4f0 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,4 +1,9 @@ -2010-12-21 Ira Rosen <irar@il.ibm.com>i +2010-12-21 Jakub Jelinek <jakub@redhat.com> + + PR target/46880 + * gcc.target/i386/pr46880.c: New test. + +2010-12-21 Ira Rosen <irar@il.ibm.com> PR tree-optimization/47001 * gcc.dg/vect/pr47001.c: New. diff --git a/gcc/testsuite/gcc.target/i386/pr46880.c b/gcc/testsuite/gcc.target/i386/pr46880.c new file mode 100644 index 00000000000..bc6d642994c --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/pr46880.c @@ -0,0 +1,28 @@ +/* PR target/46880 */ +/* { dg-do run } */ +/* { dg-options "-O2 -fno-strict-aliasing -msse2" } */ +/* { dg-require-effective-target sse2_runtime } */ + +typedef double __m128d __attribute__ ((__vector_size__ (16), __may_alias__)); +typedef double (*T)[2]; + +static __attribute__ ((noinline, noclone)) __m128d +foo (__m128d c, __m128d d) +{ + T cp = (T) &c; + T dp = (T) &d; + __m128d e = { (*cp)[1], (*dp)[1] }; + return e; +} + +int +main () +{ + __m128d c = { 1.0, 2.0 }; + __m128d d = { 3.0, 4.0 }; + union { __m128d x; double d[2]; } u; + u.x = foo (c, d); + if (u.d[0] != 2.0 || u.d[1] != 4.0) + __builtin_abort (); + return 0; +} |