Use -fcf-protection=return in cet-intrin-4.c
[official-gcc.git] / gcc / testsuite / gcc.target / i386 / sse4_1-pmuldq.c
blobfc3830a4579ae6fa43b8e687cd9d6cf387a7ac65
1 /* { dg-do run } */
2 /* { dg-require-effective-target sse4 } */
3 /* { dg-options "-O2 -msse4.1" } */
5 #ifndef CHECK_H
6 #define CHECK_H "sse4_1-check.h"
7 #endif
9 #ifndef TEST
10 #define TEST sse4_1_test
11 #endif
13 #include CHECK_H
15 #include <smmintrin.h>
17 #define NUM 64
19 static void
20 TEST (void)
22 union
24 __m128i x[NUM / 2];
25 long long ll[NUM];
26 } dst;
27 union
29 __m128i x[NUM / 2];
30 int i[NUM * 2];
31 } src1, src2;
32 int i, sign = 1;
33 long long value;
35 for (i = 0; i < NUM * 2; i += 2)
37 src1.i[i] = i * i * sign;
38 src2.i[i] = (i + 20) * sign;
39 sign = -sign;
42 for (i = 0; i < NUM; i += 2)
43 dst.x[i / 2] = _mm_mul_epi32 (src1.x[i / 2], src2.x[i / 2]);
45 for (i = 0; i < NUM; i++)
47 value = (long long) src1.i[i * 2] * (long long) src2.i[i * 2];
48 if (value != dst.ll[i])
49 abort ();