2 /* { dg-require-effective-target sse4 } */
3 /* { dg-options "-O2 -msse4.1" } */
5 #include "sse4_1-check.h"
16 init_blendps (float *src1
, float *src2
)
20 for (i
= 0; i
< NUM
* 4; i
++)
22 src1
[i
] = i
* i
* sign
;
23 src2
[i
] = (i
+ 20) * sign
;
29 check_blendps (__m128
*dst
, float *src1
, float *src2
)
34 memcpy (&tmp
[0], src1
, sizeof (tmp
));
35 for (j
= 0; j
< 4; j
++)
36 if ((MASK
& (1 << j
)))
39 return memcmp (dst
, &tmp
[0], sizeof (tmp
));
58 init_blendps (src1
.f
, src2
.f
);
60 /* Check blendps imm8, m128, xmm */
61 for (i
= 0; i
< NUM
; i
++)
63 dst
.x
[i
] = _mm_blend_ps (src1
.x
[i
], src2
.x
[i
], MASK
);
64 if (check_blendps (&dst
.x
[i
], &src1
.f
[i
* 4], &src2
.f
[i
* 4]))
68 /* Check blendps imm8, xmm, xmm */
69 x
= _mm_blend_ps (dst
.x
[2], src3
.x
, MASK
);
70 y
= _mm_blend_ps (src3
.x
, dst
.x
[2], MASK
);
72 if (check_blendps (&x
, &dst
.f
[8], &src3
.f
[0]))
75 if (check_blendps (&y
, &src3
.f
[0], &dst
.f
[8]))