From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 1791) id 9EC6638555A3; Wed, 30 Aug 2023 12:38:20 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 9EC6638555A3 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1693399100; bh=eT3mYLAcS0eIzcaQb28BGk2iy1+FV0ythdm38qzQWJc=; h=From:To:Subject:Date:From; b=vf6wNMtLvRvIXp+aCUIZewNzo0xsvldunOqfKKDdwphIr3Zt9MbAikk3NV4rUqE5R h2cyCBpLiN33POWRiu/S9xaN8KqoDu+PgApfKZMGhsbPAANc1DUdNa4VVe64qH/8Mo 0DQG/nBpl48NWsSB7q5CdBrzpL8Qn5duHkAMYGC8= Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: Adhemerval Zanella To: glibc-cvs@sourceware.org Subject: [glibc/azanella/clang] x86_64: Disable libmvec tests if compiler does not issue them with openmp X-Act-Checkin: glibc X-Git-Author: Adhemerval Zanella X-Git-Refname: refs/heads/azanella/clang X-Git-Oldrev: 7c73783b0c1300e97354d2b9db1bb48ecc192887 X-Git-Newrev: e77af7f7e0f2ff6a55aa7a6e098e5da3e5770044 Message-Id: <20230830123820.9EC6638555A3@sourceware.org> Date: Wed, 30 Aug 2023 12:38:20 +0000 (GMT) List-Id: https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=e77af7f7e0f2ff6a55aa7a6e098e5da3e5770044 commit e77af7f7e0f2ff6a55aa7a6e098e5da3e5770044 Author: Adhemerval Zanella Date: Thu Jun 9 09:51:46 2022 -0300 x86_64: Disable libmvec tests if compiler does not issue them with openmp Diff: --- sysdeps/x86_64/fpu/Makeconfig | 2 ++ sysdeps/x86_64/fpu/configure | 61 +++++++++++++++++++++++++++++++++++++++++ sysdeps/x86_64/fpu/configure.ac | 30 ++++++++++++++++++++ 3 files changed, 93 insertions(+) diff --git a/sysdeps/x86_64/fpu/Makeconfig b/sysdeps/x86_64/fpu/Makeconfig index 7d81e6e859..1c7c018a97 100644 --- a/sysdeps/x86_64/fpu/Makeconfig +++ b/sysdeps/x86_64/fpu/Makeconfig @@ -93,6 +93,7 @@ bench-libmvec-float = \ $(addsuffix f, $(addprefix float-vlen8-avx2-, $(libmvec-bench-funcs))) \ $(addsuffix f, $(addprefix float-vlen16-, $(libmvec-bench-funcs))) \ +ifeq ($(build-mathvec-pragma-simd-omp),yes) # The base libmvec ABI tests. libmvec-abi-func-tests = \ $(addprefix test-double-libmvec-,$(libmvec-funcs)) \ @@ -109,6 +110,7 @@ libmvec-abi-func-avx2-tests = \ # The AVX512F libmvec ABI tests. libmvec-abi-func-avx512f-tests = \ $(addsuffix -avx512f,$(libmvec-abi-func-tests)) +endif $(common-objpfx)libmvec.mk: $(common-objpfx)config.make (echo "ifeq (\$$(subdir)\$$(build-mathvec),mathyes)"; \ diff --git a/sysdeps/x86_64/fpu/configure b/sysdeps/x86_64/fpu/configure new file mode 100644 index 0000000000..b7ba29c4b2 --- /dev/null +++ b/sysdeps/x86_64/fpu/configure @@ -0,0 +1,61 @@ +# This file is generated from configure.ac by Autoconf. DO NOT EDIT! + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether compiler supports libmvec calls through fopenmp" >&5 +$as_echo_n "checking whether compiler supports libmvec calls through fopenmp... " >&6; } +if ${libc_cv_libmvec_pragma_omp_simd_support+:} false; then : + $as_echo_n "(cached) " >&6 +else + +cat > conftest.c <&5 + (eval $ac_try) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; } + then + if { ac_try='grep '_ZGVbN4v_sinf' conftest.s >/dev/null' + { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5 + (eval $ac_try) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; } \ + || { ac_try='grep '_ZGVcN8v_sinf' conftest.s >/dev/null' + { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5 + (eval $ac_try) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; } \ + || { ac_try='grep '_ZGVdN8v_sinf' conftest.s >/dev/null' + { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5 + (eval $ac_try) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; } \ + || { ac_try='grep '_ZGVeN16v_sinf' conftest.s >/dev/null' + { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5 + (eval $ac_try) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; } + then + libc_cv_libmvec_pragma_omp_simd_support=yes + fi +fi +rm -f conftest* +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $libc_cv_libmvec_pragma_omp_simd_support" >&5 +$as_echo "$libc_cv_libmvec_pragma_omp_simd_support" >&6; } +config_vars="$config_vars +build-mathvec-pragma-simd-omp = $libc_cv_libmvec_pragma_omp_simd_support" diff --git a/sysdeps/x86_64/fpu/configure.ac b/sysdeps/x86_64/fpu/configure.ac new file mode 100644 index 0000000000..1bc5af4ebe --- /dev/null +++ b/sysdeps/x86_64/fpu/configure.ac @@ -0,0 +1,30 @@ +GLIBC_PROVIDES dnl See aclocal.m4 in the top level source directory. + +AC_CACHE_CHECK([whether compiler supports libmvec calls through fopenmp], + libc_cv_libmvec_pragma_omp_simd_support, [ +dnl +cat > conftest.c <&AS_MESSAGE_LOG_FD]) + then + if AC_TRY_COMMAND([grep '_ZGVbN4v_sinf' conftest.s >/dev/null]) \ + || AC_TRY_COMMAND([grep '_ZGVcN8v_sinf' conftest.s >/dev/null]) \ + || AC_TRY_COMMAND([grep '_ZGVdN8v_sinf' conftest.s >/dev/null]) \ + || AC_TRY_COMMAND([grep '_ZGVeN16v_sinf' conftest.s >/dev/null]) + then + libc_cv_libmvec_pragma_omp_simd_support=yes + fi +fi +rm -f conftest*]) +LIBC_CONFIG_VAR([build-mathvec-pragma-simd-omp], + [$libc_cv_libmvec_pragma_omp_simd_support])