[gcc/devel/ranger] i386: Fix *vec_extractv2sf_1 and *vec_extractv2sf_1 shufps alternative [PR93828]

Aldy Hernandez aldyh@gcc.gnu.org
Wed Jun 17 19:04:08 GMT 2020


https://gcc.gnu.org/g:f6088573d81d52e8573b704984fdb515e4391b1a

commit f6088573d81d52e8573b704984fdb515e4391b1a
Author: Uros Bizjak <ubizjak@gmail.com>
Date:   Thu Feb 20 21:04:44 2020 +0100

    i386: Fix *vec_extractv2sf_1 and *vec_extractv2sf_1 shufps alternative [PR93828]
    
    shufps moves two of the four packed single-precision floating-point values
    from *destination* operand (first operand) into the low quadword of the
    destination operand.  Match source operand to the destination.
    
            PR target/93828
            * config/i386/mmx.md (*vec_extractv2sf_1): Match source operand
            to destination operand for shufps alternative.
            (*vec_extractv2si_1): Ditto.
    
    testsuite/ChangeLog:
    
            PR target/93828
            * g++.target/i386/pr93828.C: New test.

Diff:
---
 gcc/testsuite/g++.target/i386/pr93828.C | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)

diff --git a/gcc/testsuite/g++.target/i386/pr93828.C b/gcc/testsuite/g++.target/i386/pr93828.C
new file mode 100644
index 00000000000..e0c19751599
--- /dev/null
+++ b/gcc/testsuite/g++.target/i386/pr93828.C
@@ -0,0 +1,17 @@
+// { dg-do run }
+// { dg-require-effective-target c++11 }
+// { dg-options "-O2 -march=k8" }
+
+using float2[[gnu::vector_size (8)]] = float;
+using int2[[gnu::vector_size (8)]] = int;
+float2 y = { 2, 2 };
+
+int
+main ()
+{
+  const auto k = y == float2 { 2, 2 };
+  if (k[1] == 0)
+    __builtin_abort ();
+  const auto a = k & int2 { 2, 2 };
+  return a[0] - 2;
+}


More information about the Gcc-cvs mailing list