From: Uros Bizjak Date: Thu, 20 Feb 2020 20:04:44 +0000 (+0100) Subject: i386: Fix *vec_extractv2sf_1 and *vec_extractv2sf_1 shufps alternative [PR93828] X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=f6088573d81d52e8573b704984fdb515e4391b1a;p=gcc.git 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 --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; +}