2 /* { dg-require-effective-target sse4 } */
3 /* { dg-options "-O2 -msse4.1" } */
5 #include "sse4_1-check.h"
17 init_blendpd (double *src1
, double *src2
)
21 for (i
= 0; i
< NUM
* 2; i
++)
23 src1
[i
] = i
* i
* sign
;
24 src2
[i
] = (i
+ 20) * sign
;
30 check_blendpd (__m128d
*dst
, double *src1
, double *src2
)
35 memcpy (&tmp
[0], src1
, sizeof (tmp
));
37 for(j
= 0; j
< 2; j
++)
38 if ((MASK
& (1 << j
)))
41 return memcmp (dst
, &tmp
[0], sizeof (tmp
));
60 init_blendpd (src1
.d
, src2
.d
);
62 /* Check blendpd imm8, m128, xmm */
63 for (i
= 0; i
< NUM
; i
++)
65 dst
.x
[i
] = _mm_blend_pd (src1
.x
[i
], src2
.x
[i
], MASK
);
66 if (check_blendpd (&dst
.x
[i
], &src1
.d
[i
* 2], &src2
.d
[i
* 2]))
70 /* Check blendpd imm8, xmm, xmm */
71 src3
.x
= _mm_setzero_pd ();
73 x
= _mm_blend_pd (dst
.x
[2], src3
.x
, MASK
);
74 y
= _mm_blend_pd (src3
.x
, dst
.x
[2], MASK
);
76 if (check_blendpd (&x
, &dst
.d
[4], &src3
.d
[0]))
79 if (check_blendpd (&y
, &src3
.d
[0], &dst
.d
[4]))