2 /* { dg-require-effective-target p8vector_hw } */
3 /* { dg-options "-O2 -mvsx -Wno-psabi" } */
4 /* { dg-additional-options "-mdejagnu-cpu=power8" { target { ! has_arch_pwr8 } } } */
7 #define CHECK_H "sse4_1-check.h"
11 #define TEST sse4_1_test
16 #include <smmintrin.h>
26 init_blendpd (double *src1
, double *src2
)
30 for (i
= 0; i
< NUM
* 2; i
++)
32 src1
[i
] = i
* i
* sign
;
33 src2
[i
] = (i
+ 20) * sign
;
39 check_blendpd (__m128d
*dst
, double *src1
, double *src2
)
44 memcpy (&tmp
[0], src1
, sizeof (tmp
));
46 for(j
= 0; j
< 2; j
++)
47 if ((MASK
& (1 << j
)))
50 return memcmp (dst
, &tmp
[0], sizeof (tmp
));
69 init_blendpd (src1
.d
, src2
.d
);
71 /* Check blendpd imm8, m128, xmm */
72 for (i
= 0; i
< NUM
; i
++)
74 dst
.x
[i
] = _mm_blend_pd (src1
.x
[i
], src2
.x
[i
], MASK
);
75 if (check_blendpd (&dst
.x
[i
], &src1
.d
[i
* 2], &src2
.d
[i
* 2]))
79 /* Check blendpd imm8, xmm, xmm */
80 src3
.x
= _mm_setzero_pd ();
82 x
= _mm_blend_pd (dst
.x
[2], src3
.x
, MASK
);
83 y
= _mm_blend_pd (src3
.x
, dst
.x
[2], MASK
);
85 if (check_blendpd (&x
, &dst
.d
[4], &src3
.d
[0]))
88 if (check_blendpd (&y
, &src3
.d
[0], &dst
.d
[4]))