1 /* Test case for preserved AVX512 registers in dynamic linker,
2    -mavx512 part.
3    Copyright (C) 2017-2022 Free Software Foundation, Inc.
4    This file is part of the GNU C Library.
5 
6    The GNU C Library is free software; you can redistribute it and/or
7    modify it under the terms of the GNU Lesser General Public
8    License as published by the Free Software Foundation; either
9    version 2.1 of the License, or (at your option) any later version.
10 
11    The GNU C Library is distributed in the hope that it will be useful,
12    but WITHOUT ANY WARRANTY; without even the implied warranty of
13    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
14    Lesser General Public License for more details.
15 
16    You should have received a copy of the GNU Lesser General Public
17    License along with the GNU C Library; if not, see
18    <https://www.gnu.org/licenses/>.  */
19 
20 #include <immintrin.h>
21 #include <stdlib.h>
22 #include <string.h>
23 
24 int
tst_avx512_aux(void)25 tst_avx512_aux (void)
26 {
27 #ifdef __AVX512F__
28   extern __m512i avx512_test (__m512i, __m512i, __m512i, __m512i,
29 			      __m512i, __m512i, __m512i, __m512i);
30 
31   __m512i zmm0 = _mm512_set1_epi32 (0);
32   __m512i zmm1 = _mm512_set1_epi32 (1);
33   __m512i zmm2 = _mm512_set1_epi32 (2);
34   __m512i zmm3 = _mm512_set1_epi32 (3);
35   __m512i zmm4 = _mm512_set1_epi32 (4);
36   __m512i zmm5 = _mm512_set1_epi32 (5);
37   __m512i zmm6 = _mm512_set1_epi32 (6);
38   __m512i zmm7 = _mm512_set1_epi32 (7);
39   __m512i ret = avx512_test (zmm0, zmm1, zmm2, zmm3,
40 			     zmm4, zmm5, zmm6, zmm7);
41   zmm0 =  _mm512_set1_epi32 (0x12349876);
42   if (memcmp (&zmm0, &ret, sizeof (ret)))
43     abort ();
44   return 0;
45 #else  /* __AVX512F__ */
46   return 77;
47 #endif  /* __AVX512F__ */
48 }
49