OSDN Git Service

PR target/42549
authoruros <uros@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 30 Dec 2009 11:07:12 +0000 (11:07 +0000)
committeruros <uros@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 30 Dec 2009 11:07:12 +0000 (11:07 +0000)
* config/i386/mmx.md ("*mmx_subv2sf3): Fix insn operand number for
alternative 1.

testsuite/ChangeLog:

PR target/42549
* gcc.target/i386/mmx-3dnow-check.h: New file.
* gcc.target/i386/pr42549.c: New test.

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

gcc/ChangeLog
gcc/config/i386/mmx.md
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.target/i386/mmx-3dnow-check.h [new file with mode: 0644]
gcc/testsuite/gcc.target/i386/pr42549.c [new file with mode: 0644]

index 8e2ee77..bc55d0e 100644 (file)
@@ -1,3 +1,9 @@
+2009-12-30  Uros Bizjak  <ubizjak@gmail.com>
+
+       PR target/42549
+       * config/i386/mmx.md ("*mmx_subv2sf3): Fix insn operand number for
+       alternative 1.
+
 2009-12-30  Robert Millan  <rmh.gcc@aybabtu.com>
 
        PR other/42537
@@ -16,8 +22,7 @@
        * config/i386/i386.c (ix86_expand_int_vcond): Reformat.
 
 2009-12-29  Dave Korn  <dave.korn.cygwin@gmail.com>
-
-       2009-10-06 Iain Sandoe <iain.sandoe@sandoe-acoustics.co.uk>
+           Iain Sandoe <iain.sandoe@sandoe-acoustics.co.uk>
 
        PR objective-c++/41595
        * config/darwin.c (darwin_label_is_anonymous_local_objc_name):
 2009-12-19  Richard Guenther  <rguenther@suse.de>
 
        PR lto/42401
-       * lto-streamer-out.c (tree_is_indexable): Local statics
-       are indexable.
+       * lto-streamer-out.c (tree_is_indexable): Local statics are indexable.
        (lto_output_tree_ref): Adjust assert.
 
 2009-12-19  Richard Guenther  <rguenther@suse.de>
        PR middle-end/42397
        * builtins.c (get_object_alignment): Properly deal with
        a CONST_DECL base.
-       * expr.c (emit_block_move_hints): Assert the alignment makes
-       sense.
+       * expr.c (emit_block_move_hints): Assert the alignment makes sense.
 
 2009-12-17  Uros Bizjak  <ubizjak@gmail.com>
 
        (struct builtin_description) <__builtin_ia32_pslldqi128>: Update
        for renamed sse2_ashlv1ti3.
        <__builtin_ia32_psrldqi128>: Update for renamed sse2_lshrv1ti3.
-       
+
        Revert:
        2007-06-11  Uros Bizjak  <ubizjak@gmail.com>
 
 2009-12-17  Shujing Zhao  <pearly.zhao@oracle.com>
 
        * config/rs6000/rs6000-c.c (altivec_resolve_overloaded_builtin):
-       Update build_indirect_ref calls.        
+       Update build_indirect_ref calls.
 
 2009-12-17  Uros Bizjak  <ubizjak@gmail.com>
 
index c9aab21..5551bcb 100644 (file)
   "TARGET_3DNOW && !(MEM_P (operands[0]) && MEM_P (operands[1]))"
   "@
    pfsub\t{%2, %0|%0, %2}
-   pfsubr\t{%2, %0|%0, %2}"
+   pfsubr\t{%1, %0|%0, %1}"
   [(set_attr "type" "mmxadd")
    (set_attr "prefix_extra" "1")
    (set_attr "mode" "V2SF")])
index 9afb291..99f3daf 100644 (file)
@@ -1,3 +1,9 @@
+2009-12-30  Uros Bizjak  <ubizjak@gmail.com>
+
+       PR target/42549
+       * gcc.target/i386/mmx-3dnow-check.h: New file.
+       * gcc.target/i386/pr42549.c: New test.
+
 2009-12-29  Ian Lance Taylor  <iant@google.com>
 
        PR middle-end/42099
@@ -32,7 +38,7 @@
 
        PR tree-optimization/42231
        * gcc.c-torture/execute/pr42231.c: New test.
-       
+
 2009-12-27  Francois-Xavier Coudert  <fxcoudert@gcc.gnu.org>
            Daniel Kraft  <d@domob.eu>
 
@@ -73,7 +79,7 @@
 
        PR target/40670
        * gcc.target/arm/pr40670.c: New test.
-       
+
 2009-12-23  Uros Bizjak  <ubizjak@gmail.com>
 
        * gcc.target/alpha/20000715-1.c: Remove target selector.
diff --git a/gcc/testsuite/gcc.target/i386/mmx-3dnow-check.h b/gcc/testsuite/gcc.target/i386/mmx-3dnow-check.h
new file mode 100644 (file)
index 0000000..458e7cd
--- /dev/null
@@ -0,0 +1,21 @@
+#include <stdio.h>
+#include <stdlib.h>
+
+#include "cpuid.h"
+
+static void mmx_3dnow_test (void);
+
+int
+main ()
+{
+  unsigned int eax, ebx, ecx, edx;
+  if (!__get_cpuid (0x80000001, &eax, &ebx, &ecx, &edx))
+    return 0;
+
+  /* Run 3DNow! test only if host has 3DNow! support.  */
+  if (edx & bit_3DNOW)
+    mmx_3dnow_test ();
+
+  return 0;
+}
diff --git a/gcc/testsuite/gcc.target/i386/pr42549.c b/gcc/testsuite/gcc.target/i386/pr42549.c
new file mode 100644 (file)
index 0000000..5f96462
--- /dev/null
@@ -0,0 +1,37 @@
+/* { dg-do run } */
+/* { dg-options "-O2 -m3dnow" } */
+
+#include "mmx-3dnow-check.h"
+
+#include <mm3dnow.h>
+
+typedef union {
+  float f[2];
+  __m64 v;
+} vec_t;
+
+void __attribute__ ((noinline))
+Butterfly_3 (__m64 * D, __m64 SC)
+{
+  __m64 T, T1;
+
+  T = _m_pfmul (D[1], SC);
+  T1 = D[0];
+  D[0] = _m_pfadd (T1, T);
+  D[1] = _m_pfsub (T1, T);
+}
+
+void
+mmx_3dnow_test (void)
+{
+  vec_t D[2] = { { .f = { 2.0f, 3.0f } },
+                { .f = { 4.0f, 5.0f } } };
+
+  const vec_t SC = { .f = { 1.0f, 1.0f } };
+
+  Butterfly_3 (&D[0].v, SC.v);
+  _m_femms ();
+
+  if (D[1].f[0] != -2.0f || D[1].f[1] != -2.0f)
+    abort ();
+}