1 /* Test case for x86-64 preserved AVX registers in dynamic linker. */
2
3 #ifdef __AVX__
4 #include <stdlib.h>
5 #include <string.h>
6 #include <immintrin.h>
7
8 __m256i
avx_test(__m256i x0,__m256i x1,__m256i x2,__m256i x3,__m256i x4,__m256i x5,__m256i x6,__m256i x7)9 avx_test (__m256i x0, __m256i x1, __m256i x2, __m256i x3,
10 __m256i x4, __m256i x5, __m256i x6, __m256i x7)
11 {
12 __m256i ymm;
13
14 ymm = _mm256_set1_epi32 (0);
15 if (memcmp (&ymm, &x0, sizeof (ymm)))
16 abort ();
17
18 ymm = _mm256_set1_epi32 (1);
19 if (memcmp (&ymm, &x1, sizeof (ymm)))
20 abort ();
21
22 ymm = _mm256_set1_epi32 (2);
23 if (memcmp (&ymm, &x2, sizeof (ymm)))
24 abort ();
25
26 ymm = _mm256_set1_epi32 (3);
27 if (memcmp (&ymm, &x3, sizeof (ymm)))
28 abort ();
29
30 ymm = _mm256_set1_epi32 (4);
31 if (memcmp (&ymm, &x4, sizeof (ymm)))
32 abort ();
33
34 ymm = _mm256_set1_epi32 (5);
35 if (memcmp (&ymm, &x5, sizeof (ymm)))
36 abort ();
37
38 ymm = _mm256_set1_epi32 (6);
39 if (memcmp (&ymm, &x6, sizeof (ymm)))
40 abort ();
41
42 ymm = _mm256_set1_epi32 (7);
43 if (memcmp (&ymm, &x7, sizeof (ymm)))
44 abort ();
45
46 return _mm256_set1_epi32 (0x12349876);
47 }
48 #endif
49