i386: Handle memory operand for direct call to cvtps2pd in unpack

gcc/ChangeLog:

	PR target/106180
	* config/i386/sse.md (sse2_cvtps2pd<mask_name>_1):
	Rename from *sse2_cvtps2pd<mask_name>_1.
	(vec_unpacks_lo_v4sf): Add handler for memory operand.

gcc/testsuite/ChangeLog:

	PR target/106180
	* g++.target/i386/pr106180-1.C: New test.
This commit is contained in:
Haochen Jiang 2022-07-05 14:12:18 +08:00
parent aa8fd7f656
commit bf3695691f
2 changed files with 41 additions and 2 deletions

View File

@ -9204,7 +9204,7 @@
(set_attr "prefix" "maybe_vex")
(set_attr "mode" "V2DF")])
(define_insn "*sse2_cvtps2pd<mask_name>_1"
(define_insn "sse2_cvtps2pd<mask_name>_1"
[(set (match_operand:V2DF 0 "register_operand" "=v")
(float_extend:V2DF
(match_operand:V2SF 1 "memory_operand" "m")))]
@ -9266,7 +9266,15 @@
(vec_select:V2SF
(match_operand:V4SF 1 "vector_operand")
(parallel [(const_int 0) (const_int 1)]))))]
"TARGET_SSE2")
"TARGET_SSE2"
{
if (MEM_P (operands[1]))
{
operands[1] = adjust_address_nv (operands[1], V2SFmode, 0);
emit_insn (gen_sse2_cvtps2pd_1 (operands[0], operands[1]));
DONE;
}
})
(define_expand "vec_unpacks_lo_v8sf"
[(set (match_operand:V4DF 0 "register_operand")

View File

@ -0,0 +1,31 @@
/* { dg-do compile } */
/* { dg-options "-O3 -c -ffloat-store -std=c++11" } */
struct PointT
{
double x, y;
};
using PointF = PointT;
template <int _Nm> struct __array_traits { typedef PointT _Type[_Nm]; };
template <int _Nm> struct array
{
typename __array_traits<_Nm>::_Type _M_elems;
};
float SampleGrid_low, SampleGrid_high;
using QuadrilateralF = array<4>;
struct PerspectiveTransform
{
PerspectiveTransform (QuadrilateralF, QuadrilateralF);
};
void SampleGrid()
{
PerspectiveTransform
{
{ PointF {SampleGrid_high, SampleGrid_low},
SampleGrid_low, SampleGrid_high },
{}
};
}