OSDN Git Service

2005-12-22 Dale Johannesen <dalej@apple.com>
authordalej <dalej@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 22 Dec 2005 19:06:09 +0000 (19:06 +0000)
committerdalej <dalej@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 22 Dec 2005 19:06:09 +0000 (19:06 +0000)
* config/i386/sse.md (sse_movhlps):  Reverse operands for
2nd and 3rd alternatives.

2005-12-22  Dale Johannesen  <dalej@apple.com>

* gcc.target/i386/sse-17.c:  New.

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

gcc/ChangeLog
gcc/config/i386/sse.md
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.target/i386/sse-17.c [new file with mode: 0644]

index 8004d01..8e265ab 100644 (file)
@@ -1,3 +1,8 @@
+2005-12-22  Dale Johannesen  <dalej@apple.com>
+
+       * config/i386/sse.md (sse_movhlps):  Reverse operands for
+       2nd and 3rd alternatives.
+
 2005-12-22  Andrew Pinski <pinskia@physics.uc.edu>
 
        PR tree-opt/25513
index 8fc3da0..b444491 100644 (file)
   [(set (match_operand:V4SF 0 "nonimmediate_operand"     "=x,x,m")
        (vec_select:V4SF
          (vec_concat:V8SF
-           (match_operand:V4SF 1 "nonimmediate_operand" " 0,o,x")
-           (match_operand:V4SF 2 "nonimmediate_operand" " x,0,0"))
+           (match_operand:V4SF 1 "nonimmediate_operand" " 0,0,0")
+           (match_operand:V4SF 2 "nonimmediate_operand" " x,o,x"))
          (parallel [(const_int 6)
                     (const_int 7)
                     (const_int 2)
   "TARGET_SSE && !(MEM_P (operands[1]) && MEM_P (operands[2]))"
   "@
    movhlps\t{%2, %0|%0, %2}
-   movlps\t{%H1, %0|%0, %H1}
-   movhps\t{%1, %0|%0, %1}"
+   movlps\t{%H2, %0|%0, %H2}
+   movhps\t{%2, %0|%0, %2}"
   [(set_attr "type" "ssemov")
    (set_attr "mode" "V4SF,V2SF,V2SF")])
 
index 7bfb7cd..ebeb40a 100644 (file)
@@ -1,3 +1,7 @@
+2005-12-22  Dale Johannesen  <dalej@apple.com>
+
+       * gcc.target/i386/sse-17.c:  New.
+
 2005-12-22  Paul Brook  <paul@codesourcery.com>
 
        * gcc.dg/tree-ssa/loop-1.c: Look for jump/branch on m68k.
diff --git a/gcc/testsuite/gcc.target/i386/sse-17.c b/gcc/testsuite/gcc.target/i386/sse-17.c
new file mode 100644 (file)
index 0000000..86d22c4
--- /dev/null
@@ -0,0 +1,30 @@
+/* { dg-do run { target i?86-*-* x86_64-*-* } } */
+/* { dg-options "-O2 -msse2" } */
+#include <xmmintrin.h>
+extern void abort();
+int untrue = 0;
+typedef union {
+  __v4sf v;
+  float f[4];
+} u;
+void foo (u, u) __attribute__((noinline));
+void foo (u a, u b) {
+  if (b.f[0] != 7.0 || b.f[1] != 8.0 || b.f[2] != 3.0 || b.f[3] != 4.0)
+    abort();
+}
+void bar (__v4sf, __v4sf) __attribute__((noinline));
+void bar (__v4sf a __attribute((unused)), __v4sf b __attribute((unused))) { untrue = 0;}
+__v4sf setupa () __attribute((noinline));
+__v4sf setupa () { __v4sf t = { 1.0, 2.0, 3.0, 4.0 }; return t; }
+__v4sf setupb () __attribute((noinline));
+__v4sf setupb () { __v4sf t = { 5.0, 6.0, 7.0, 8.0 }; return t; }
+main() {
+  u a, b;
+  a.v = setupa ();
+  b.v = setupb ();
+  if (untrue)
+    bar(a.v, b.v);
+  b.v = (__v4sf) _mm_movehl_ps ((__m128)a.v, (__m128)b.v);
+  foo (a, b);
+  return 0;
+}