From f6088573d81d52e8573b704984fdb515e4391b1a Mon Sep 17 00:00:00 2001 From: Uros Bizjak Date: Thu, 20 Feb 2020 21:04:44 +0100 Subject: [PATCH] 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. --- gcc/testsuite/g++.target/i386/pr93828.C | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 gcc/testsuite/g++.target/i386/pr93828.C 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; +} -- 2.30.2