2 /* { dg-options "-O2 -mvsx -Wno-psabi" } */
3 /* { dg-additional-options "-mdejagnu-cpu=power8" { target { ! has_arch_pwr8 } } } */
4 /* { dg-require-effective-target p8vector_hw } */
6 #define NO_WARN_X86_INTRINSICS 1
8 #define CHECK_H "sse4_1-check.h"
12 #define TEST sse4_1_test
17 #include <smmintrin.h>
23 init_pblendvb (unsigned char *src1
, unsigned char *src2
,
28 for (i
= 0; i
< NUM
* 16; i
++)
30 src1
[i
] = i
* i
* sign
;
31 src2
[i
] = (i
+ 20) * sign
;
32 mask
[i
] = (i
% 3) + ((i
* (14 + sign
))
33 ^ (src1
[i
] | src2
[i
] | (i
*3)));
39 check_pblendvb (__m128i
*dst
, unsigned char *src1
,
40 unsigned char *src2
, unsigned char *mask
)
42 unsigned char tmp
[16];
45 memcpy (&tmp
[0], src1
, sizeof (tmp
));
46 for (j
= 0; j
< 16; j
++)
50 return memcmp (dst
, &tmp
[0], sizeof (tmp
));
59 unsigned char c
[NUM
* 16];
60 } dst
, src1
, src2
, mask
;
63 init_pblendvb (src1
.c
, src2
.c
, mask
.c
);
65 for (i
= 0; i
< NUM
; i
++)
67 dst
.x
[i
] = _mm_blendv_epi8 (src1
.x
[i
], src2
.x
[i
], mask
.x
[i
]);
68 if (check_pblendvb (&dst
.x
[i
], &src1
.c
[i
* 16], &src2
.c
[i
* 16],