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