* config/i386/i386.md (movsi_1, movdi_1_rex64): Use mmxadd type
authorjakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 11 Oct 2005 08:42:25 +0000 (08:42 +0000)
committerjakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 11 Oct 2005 08:42:25 +0000 (08:42 +0000)
for setting MMX register to 0 rather than mmx.

* g++.dg/opt/mmx2.C: New test.

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

gcc/ChangeLog
gcc/config/i386/i386.md
gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/opt/mmx2.C [new file with mode: 0644]

index d1880fc..6b1f9c5 100644 (file)
@@ -1,3 +1,8 @@
+2005-10-11  Jakub Jelinek  <jakub@redhat.com>
+
+       * config/i386/i386.md (movsi_1, movdi_1_rex64): Use mmxadd type
+       for setting MMX register to 0 rather than mmx.
+
 2005-10-10  Steve Ellcey  <sje@cup.hp.com>
 
        PR target/12098
index f8059ad..849920e 100644 (file)
 }
   [(set (attr "type")
      (cond [(eq_attr "alternative" "2")
-             (const_string "mmx")
+             (const_string "mmxadd")
            (eq_attr "alternative" "3,4,5")
              (const_string "mmxmov")
            (eq_attr "alternative" "6")
 }
   [(set (attr "type")
      (cond [(eq_attr "alternative" "5")
-             (const_string "mmx")
+             (const_string "mmxadd")
            (eq_attr "alternative" "6,7,8")
              (const_string "mmxmov")
            (eq_attr "alternative" "9")
index dd19af6..8ebe56e 100644 (file)
@@ -1,3 +1,7 @@
+2005-10-11  Jakub Jelinek  <jakub@redhat.com>
+
+       * g++.dg/opt/mmx2.C: New test.
+
 2005-10-10  Mark Mitchell  <mark@codesourcery.com>
 
        PR c++/24277
diff --git a/gcc/testsuite/g++.dg/opt/mmx2.C b/gcc/testsuite/g++.dg/opt/mmx2.C
new file mode 100644 (file)
index 0000000..21dcdda
--- /dev/null
@@ -0,0 +1,23 @@
+// { dg-do link { target i?86-*-* x86_64-*-* } }
+// { dg-options "-O2 -mmmx" }
+
+#include <mmintrin.h>
+
+static union u { __m64 m; long long l; } u;
+extern "C" void abort (void);
+
+__attribute__((noinline))
+void bar (__m64 x)
+{
+  u.m = x;
+}
+
+int
+main ()
+{
+  bar (_mm_set_pi32 (0x000000FF,0xFFFF00FF));
+  _mm_empty ();
+  if (u.l != 0xffffff00ffLL)
+    abort ();
+  return 0;
+}