2 /* { dg-require-effective-target sse4 } */
3 /* { dg-options "-O2 -msse4.1" } */
5 #include "sse4_1-check.h"
17 unsigned short s
[NUM
];
19 unsigned short minVal
[NUM
/8];
21 unsigned short minValScalar
, minIndScalar
;
24 for (i
= 0; i
< NUM
; i
++)
25 src
.s
[i
] = i
* i
/ (i
+ i
/ 3.14 + 1.0);
27 for (i
= 0, j
= 0; i
< NUM
; i
+= 8, j
++)
29 res
= _mm_cvtsi128_si32 (_mm_minpos_epu16 (src
.x
[i
/8]));
30 minVal
[j
] = res
& 0xffff;
31 minInd
[j
] = (res
>> 16) & 0x3;
34 for (i
= 0; i
< NUM
; i
+= 8)
36 minValScalar
= src
.s
[i
];
39 for (j
= i
+ 1; j
< i
+ 8; j
++)
40 if (minValScalar
> src
.s
[j
])
42 minValScalar
= src
.s
[j
];
46 if (minValScalar
!= minVal
[i
/8] && minIndScalar
!= minInd
[i
/8])