2 /* { dg-require-effective-target sse4 } */
3 /* { dg-options "-O2 -msse4.1" } */
6 #define CHECK_H "sse4_1-check.h"
10 #define TEST sse4_1_test
15 #include <smmintrin.h>
18 make_ptestz (__m128i m
, __m128i v
)
31 for (i
= 0; i
< 16; i
++)
32 if ((mask
.c
[i
] & val
.c
[i
]))
41 make_ptestc (__m128i m
, __m128i v
)
54 for (i
= 0; i
< 16; i
++)
55 if ((val
.c
[i
] & ~mask
.c
[i
]))
74 val
[0].i
[0] = 0x11111111;
75 val
[0].i
[1] = 0x00000000;
76 val
[0].i
[2] = 0x00000000;
77 val
[0].i
[3] = 0x11111111;
79 val
[1].i
[0] = 0x00000000;
80 val
[1].i
[1] = 0x11111111;
81 val
[1].i
[2] = 0x11111111;
82 val
[1].i
[3] = 0x00000000;
89 val
[3].i
[0] = 0xffffffff;
90 val
[3].i
[1] = 0xffffffff;
91 val
[3].i
[2] = 0xffffffff;
92 val
[3].i
[3] = 0xffffffff;
95 for(i
= 0; i
< 4; i
++)
96 for(j
= 0; j
< 4; j
++)
98 res
[l
++] = _mm_testz_si128 (val
[j
].x
, val
[i
].x
);
99 res
[l
++] = _mm_testc_si128 (val
[j
].x
, val
[i
].x
);
103 for(i
= 0; i
< 4; i
++)
104 for(j
= 0; j
< 4; j
++)
106 if (res
[l
++] != make_ptestz (val
[j
].x
, val
[i
].x
))
108 if (res
[l
++] != make_ptestc (val
[j
].x
, val
[i
].x
))
112 if (res
[2] != _mm_testz_si128 (val
[1].x
, val
[0].x
))
115 if (res
[3] != _mm_testc_si128 (val
[1].x
, val
[0].x
))