2 /* { dg-options "-O2 -mvsx -Wno-psabi" } */
3 /* { dg-require-effective-target vsx_hw } */
5 #define NO_WARN_X86_INTRINSICS 1
7 #define CHECK_H "sse4_1-check.h"
11 #define TEST sse4_1_test
16 #include <smmintrin.h>
18 #define DIM(a) (sizeof (a) / sizeof (a)[0])
29 { .s
= { 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000 } },
30 { .s
= { 0x0000, 0xffff, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000 } },
31 { .s
= { 0xffff, 0xffff, 0x0000, 0xffff, 0xffff, 0xffff, 0x0000, 0xffff } },
32 { .s
= { 0x0001, 0x0002, 0x0003, 0x0004, 0x0005, 0x0006, 0x0007, 0x0008 } },
33 { .s
= { 0x0008, 0x0007, 0x0006, 0x0005, 0x0004, 0x0003, 0x0002, 0x0001 } },
34 { .s
= { 0xfff4, 0xfff3, 0xfff2, 0xfff1, 0xfff3, 0xfff1, 0xfff2, 0xfff3 } }
36 unsigned short minVal
[DIM (src
)];
37 int minInd
[DIM (src
)];
38 unsigned short minValScalar
, minIndScalar
;
46 for (i
= 0; i
< DIM (src
); i
++)
48 res
.si
= _mm_cvtsi128_si32 (_mm_minpos_epu16 (src
[i
].x
));
50 minInd
[i
] = res
.s
[1] & 0b111;
53 for (i
= 0; i
< DIM (src
); i
++)
55 minValScalar
= src
[i
].s
[0];
58 for (j
= 1; j
< 8; j
++)
59 if (minValScalar
> src
[i
].s
[j
])
61 minValScalar
= src
[i
].s
[j
];
65 if (minValScalar
!= minVal
[i
] && minIndScalar
!= minInd
[i
])