More strict check of AVX512 support in assembler.
[glibc.git] / sysdeps / x86_64 / configure
blob552f535ac6af9682646f770d86634d0eb386da28
2 # ac_fn_c_check_header_compile LINENO HEADER VAR INCLUDES
3 # -------------------------------------------------------
4 # Tests whether HEADER exists and can be compiled using the include files in
5 # INCLUDES, setting the cache variable VAR accordingly.
6 ac_fn_c_check_header_compile ()
8   as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
9   { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
10 $as_echo_n "checking for $2... " >&6; }
11 if eval \${$3+:} false; then :
12   $as_echo_n "(cached) " >&6
13 else
14   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
15 /* end confdefs.h.  */
17 #include <$2>
18 _ACEOF
19 if ac_fn_c_try_compile "$LINENO"; then :
20   eval "$3=yes"
21 else
22   eval "$3=no"
24 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
26 eval ac_res=\$$3
27                { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
28 $as_echo "$ac_res" >&6; }
29   eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
31 } # ac_fn_c_check_header_compile
32 # This file is generated from configure.ac by Autoconf.  DO NOT EDIT!
33  # Local configure fragment for sysdeps/x86_64.
36 ac_fn_c_check_header_compile "$LINENO" "cpuid.h" "ac_cv_header_cpuid_h" "/* No default includes.  */
38 if test "x$ac_cv_header_cpuid_h" = xyes; then :
40 else
41   as_fn_error $? "gcc must provide the <cpuid.h> header" "$LINENO" 5
46 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for SSE4 support" >&5
47 $as_echo_n "checking for SSE4 support... " >&6; }
48 if ${libc_cv_cc_sse4+:} false; then :
49   $as_echo_n "(cached) " >&6
50 else
51   if { ac_try='${CC-cc} -msse4 -xc /dev/null -S -o /dev/null'
52   { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
53   (eval $ac_try) 2>&5
54   ac_status=$?
55   $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
56   test $ac_status = 0; }; }; then :
57   libc_cv_cc_sse4=yes
58 else
59   libc_cv_cc_sse4=no
63 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $libc_cv_cc_sse4" >&5
64 $as_echo "$libc_cv_cc_sse4" >&6; }
65 if test $libc_cv_cc_sse4 = yes; then
66   $as_echo "#define HAVE_SSE4_SUPPORT 1" >>confdefs.h
69 config_vars="$config_vars
70 config-cflags-sse4 = $libc_cv_cc_sse4"
72 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for AVX support" >&5
73 $as_echo_n "checking for AVX support... " >&6; }
74 if ${libc_cv_cc_avx+:} false; then :
75   $as_echo_n "(cached) " >&6
76 else
77   if { ac_try='${CC-cc} -mavx -xc /dev/null -S -o /dev/null'
78   { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
79   (eval $ac_try) 2>&5
80   ac_status=$?
81   $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
82   test $ac_status = 0; }; }; then :
83   libc_cv_cc_avx=yes
84 else
85   libc_cv_cc_avx=no
89 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $libc_cv_cc_avx" >&5
90 $as_echo "$libc_cv_cc_avx" >&6; }
91 if test $libc_cv_cc_avx = yes; then
92   $as_echo "#define HAVE_AVX_SUPPORT 1" >>confdefs.h
95 config_vars="$config_vars
96 config-cflags-avx = $libc_cv_cc_avx"
98 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for AVX512 support in assembler" >&5
99 $as_echo_n "checking for AVX512 support in assembler... " >&6; }
100 if ${libc_cv_asm_avx512+:} false; then :
101   $as_echo_n "(cached) " >&6
102 else
103   cat > conftest.s <<\EOF
104         vmovdqu64 %zmm0, (%rsp)
105         vandpd (%rax), %zmm6, %zmm1
107 if { ac_try='${CC-cc} -c $ASFLAGS conftest.s 1>&5'
108   { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
109   (eval $ac_try) 2>&5
110   ac_status=$?
111   $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
112   test $ac_status = 0; }; }; then
113   libc_cv_asm_avx512=yes
114 else
115   libc_cv_asm_avx512=no
117 rm -f conftest*
119 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $libc_cv_asm_avx512" >&5
120 $as_echo "$libc_cv_asm_avx512" >&6; }
121 if test $libc_cv_asm_avx512 == yes; then
122   $as_echo "#define HAVE_AVX512_ASM_SUPPORT 1" >>confdefs.h
126 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for AVX512 support" >&5
127 $as_echo_n "checking for AVX512 support... " >&6; }
128 if ${libc_cv_cc_avx512+:} false; then :
129   $as_echo_n "(cached) " >&6
130 else
131   if { ac_try='${CC-cc} -mavx512f -xc /dev/null -S -o /dev/null'
132   { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
133   (eval $ac_try) 2>&5
134   ac_status=$?
135   $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
136   test $ac_status = 0; }; }; then :
137   libc_cv_cc_avx512=$libc_cv_asm_avx512
138 else
139   libc_cv_cc_avx512=no
143 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $libc_cv_cc_avx512" >&5
144 $as_echo "$libc_cv_cc_avx512" >&6; }
145 if test $libc_cv_cc_avx512 = yes; then
146   $as_echo "#define HAVE_AVX512_SUPPORT 1" >>confdefs.h
149 config_vars="$config_vars
150 config-cflags-avx512 = $libc_cv_cc_avx512"
152 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for AVX encoding of SSE instructions" >&5
153 $as_echo_n "checking for AVX encoding of SSE instructions... " >&6; }
154 if ${libc_cv_cc_sse2avx+:} false; then :
155   $as_echo_n "(cached) " >&6
156 else
157   if { ac_try='${CC-cc} -msse2avx -xc /dev/null -S -o /dev/null'
158   { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
159   (eval $ac_try) 2>&5
160   ac_status=$?
161   $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
162   test $ac_status = 0; }; }; then :
163   libc_cv_cc_sse2avx=yes
164 else
165   libc_cv_cc_sse2avx=no
169 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $libc_cv_cc_sse2avx" >&5
170 $as_echo "$libc_cv_cc_sse2avx" >&6; }
171 if test $libc_cv_cc_sse2avx = yes; then
172   $as_echo "#define HAVE_SSE2AVX_SUPPORT 1" >>confdefs.h
175 config_vars="$config_vars
176 config-cflags-sse2avx = $libc_cv_cc_sse2avx"
178 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for FMA4 support" >&5
179 $as_echo_n "checking for FMA4 support... " >&6; }
180 if ${libc_cv_cc_fma4+:} false; then :
181   $as_echo_n "(cached) " >&6
182 else
183   if { ac_try='${CC-cc} -mfma4 -xc /dev/null -S -o /dev/null'
184   { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
185   (eval $ac_try) 2>&5
186   ac_status=$?
187   $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
188   test $ac_status = 0; }; }; then :
189   libc_cv_cc_fma4=yes
190 else
191   libc_cv_cc_fma4=no
195 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $libc_cv_cc_fma4" >&5
196 $as_echo "$libc_cv_cc_fma4" >&6; }
197 if test $libc_cv_cc_fma4 = yes; then
198   $as_echo "#define HAVE_FMA4_SUPPORT 1" >>confdefs.h
201 config_vars="$config_vars
202 have-mfma4 = $libc_cv_cc_fma4"
204 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -mno-vzeroupper support" >&5
205 $as_echo_n "checking for -mno-vzeroupper support... " >&6; }
206 if ${libc_cv_cc_novzeroupper+:} false; then :
207   $as_echo_n "(cached) " >&6
208 else
209   if { ac_try='${CC-cc} -mno-vzeroupper -xc /dev/null -S -o /dev/null'
210   { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
211   (eval $ac_try) 2>&5
212   ac_status=$?
213   $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
214   test $ac_status = 0; }; }; then :
215   libc_cv_cc_novzeroupper=yes
216 else
217   libc_cv_cc_novzeroupper=no
221 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $libc_cv_cc_novzeroupper" >&5
222 $as_echo "$libc_cv_cc_novzeroupper" >&6; }
223 config_vars="$config_vars
224 config-cflags-novzeroupper = $libc_cv_cc_novzeroupper"
226 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Intel MPX support" >&5
227 $as_echo_n "checking for Intel MPX support... " >&6; }
228 if ${libc_cv_asm_mpx+:} false; then :
229   $as_echo_n "(cached) " >&6
230 else
231   cat > conftest.s <<\EOF
232         bndmov %bnd0,(%rsp)
234 if { ac_try='${CC-cc} -c $ASFLAGS conftest.s 1>&5'
235   { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
236   (eval $ac_try) 2>&5
237   ac_status=$?
238   $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
239   test $ac_status = 0; }; }; then
240   libc_cv_asm_mpx=yes
241 else
242   libc_cv_asm_mpx=no
244 rm -f conftest*
246 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $libc_cv_asm_mpx" >&5
247 $as_echo "$libc_cv_asm_mpx" >&6; }
248 if test $libc_cv_asm_mpx == yes; then
249   $as_echo "#define HAVE_MPX_SUPPORT 1" >>confdefs.h
253 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for AVX2 support" >&5
254 $as_echo_n "checking for AVX2 support... " >&6; }
255 if ${libc_cv_cc_avx2+:} false; then :
256   $as_echo_n "(cached) " >&6
257 else
258   if { ac_try='${CC-cc} -mavx2 -xc /dev/null -S -o /dev/null'
259   { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
260   (eval $ac_try) 2>&5
261   ac_status=$?
262   $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
263   test $ac_status = 0; }; }; then :
264   libc_cv_cc_avx2=yes
265 else
266   libc_cv_cc_avx2=no
270 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $libc_cv_cc_avx2" >&5
271 $as_echo "$libc_cv_cc_avx2" >&6; }
272 if test $libc_cv_cc_avx2 = yes; then
273   $as_echo "#define HAVE_AVX2_SUPPORT 1" >>confdefs.h
276 config_vars="$config_vars
277 config-cflags-avx2 = $libc_cv_cc_avx2"
279 if test x"$build_mathvec" = xnotset; then
280   build_mathvec=yes
283 $as_echo "#define PI_STATIC_AND_HIDDEN 1" >>confdefs.h
285 # work around problem with autoconf and empty lines at the end of files