Update concepts branch to revision 131834
[official-gcc.git] / gcc / testsuite / gcc.target / i386 / sse4_1-pmovsxbd.c
blob7da95a7ccf73466367e5e2fd63fbc99161f0a6da
1 /* { dg-do run } */
2 /* { dg-require-effective-target sse4 } */
3 /* { dg-options "-O2 -msse4.1" } */
5 #include "sse4_1-check.h"
7 #include <smmintrin.h>
9 #define NUM 128
11 static void
12 sse4_1_test (void)
14 union
16 __m128i x[NUM / 4];
17 int i[NUM];
18 char c[NUM * 4];
19 } dst, src;
20 int i, sign = 1;
22 for (i = 0; i < NUM; i++)
24 src.c[(i % 4) + (i / 4) * 16] = i * i * sign;
25 sign = -sign;
28 for (i = 0; i < NUM; i += 4)
29 dst.x [i / 4] = _mm_cvtepi8_epi32 (src.x [i / 4]);
31 for (i = 0; i < NUM; i++)
32 if (src.c[(i % 4) + (i / 4) * 16] != dst.i[i])
33 abort ();