2 /* { dg-require-effective-target sse4 } */
3 /* { dg-options "-O2 -msse4.2" } */
6 #define CHECK_H "sse4_2-check.h"
10 #define TEST sse4_2_test
15 #include "sse4_2-pcmpstr.h"
20 (_SIDD_SBYTE_OPS | _SIDD_CMP_RANGES | _SIDD_MASKED_POSITIVE_POLARITY)
22 (_SIDD_UBYTE_OPS | _SIDD_CMP_EQUAL_EACH | _SIDD_NEGATIVE_POLARITY \
23 | _SIDD_MOST_SIGNIFICANT)
25 (_SIDD_UWORD_OPS | _SIDD_CMP_EQUAL_ANY | _SIDD_MASKED_NEGATIVE_POLARITY)
27 (_SIDD_SWORD_OPS | _SIDD_CMP_EQUAL_ORDERED \
28 | _SIDD_MASKED_NEGATIVE_POLARITY | _SIDD_MOST_SIGNIFICANT)
39 int res
, correct
, correct_flags
;
40 int flags
, cf
, zf
, sf
, of
, af
;
43 for (i
= 0; i
< NUM
*16; i
++)
49 for (i
= 0; i
< NUM
; i
++)
51 switch ((rand () % 4))
54 res
= _mm_cmpistri (src1
.x
[i
], src2
.x
[i
], IMM_VAL0
);
55 cf
= _mm_cmpistrc (src1
.x
[i
], src2
.x
[i
], IMM_VAL0
);
56 zf
= _mm_cmpistrz (src1
.x
[i
], src2
.x
[i
], IMM_VAL0
);
57 sf
= _mm_cmpistrs (src1
.x
[i
], src2
.x
[i
], IMM_VAL0
);
58 of
= _mm_cmpistro (src1
.x
[i
], src2
.x
[i
], IMM_VAL0
);
59 af
= _mm_cmpistra (src1
.x
[i
], src2
.x
[i
], IMM_VAL0
);
60 correct
= cmp_ii (&src1
.x
[i
], &src2
.x
[i
], IMM_VAL0
,
65 res
= _mm_cmpistri (src1
.x
[i
], src2
.x
[i
], IMM_VAL1
);
66 cf
= _mm_cmpistrc (src1
.x
[i
], src2
.x
[i
], IMM_VAL1
);
67 zf
= _mm_cmpistrz (src1
.x
[i
], src2
.x
[i
], IMM_VAL1
);
68 sf
= _mm_cmpistrs (src1
.x
[i
], src2
.x
[i
], IMM_VAL1
);
69 of
= _mm_cmpistro (src1
.x
[i
], src2
.x
[i
], IMM_VAL1
);
70 af
= _mm_cmpistra (src1
.x
[i
], src2
.x
[i
], IMM_VAL1
);
71 correct
= cmp_ii (&src1
.x
[i
], &src2
.x
[i
], IMM_VAL1
,
76 res
= _mm_cmpistri (src1
.x
[i
], src2
.x
[i
], IMM_VAL2
);
77 cf
= _mm_cmpistrc (src1
.x
[i
], src2
.x
[i
], IMM_VAL2
);
78 zf
= _mm_cmpistrz (src1
.x
[i
], src2
.x
[i
], IMM_VAL2
);
79 sf
= _mm_cmpistrs (src1
.x
[i
], src2
.x
[i
], IMM_VAL2
);
80 of
= _mm_cmpistro (src1
.x
[i
], src2
.x
[i
], IMM_VAL2
);
81 af
= _mm_cmpistra (src1
.x
[i
], src2
.x
[i
], IMM_VAL2
);
82 correct
= cmp_ii (&src1
.x
[i
], &src2
.x
[i
], IMM_VAL2
,
87 res
= _mm_cmpistri (src1
.x
[i
], src2
.x
[i
], IMM_VAL3
);
88 cf
= _mm_cmpistrc (src1
.x
[i
], src2
.x
[i
], IMM_VAL3
);
89 zf
= _mm_cmpistrz (src1
.x
[i
], src2
.x
[i
], IMM_VAL3
);
90 sf
= _mm_cmpistrs (src1
.x
[i
], src2
.x
[i
], IMM_VAL3
);
91 of
= _mm_cmpistro (src1
.x
[i
], src2
.x
[i
], IMM_VAL3
);
92 af
= _mm_cmpistra (src1
.x
[i
], src2
.x
[i
], IMM_VAL3
);
93 correct
= cmp_ii (&src1
.x
[i
], &src2
.x
[i
], IMM_VAL3
,
111 if (flags
!= correct_flags
112 || (af
&& (cf
|| zf
))
113 || (!af
&& !(cf
|| zf
)))