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.
This commit is contained in:
Uros Bizjak 2020-02-20 21:04:44 +01:00
parent 6e63438a0d
commit f6088573d8

View file

@ -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;
}