public inbox for glibc-cvs@sourceware.org
help / color / mirror / Atom feed
* [glibc/azanella/clang] x86_64: Disable libmvec tests if compiler does not support attribute '__simd__'
@ 2024-04-17 20:09 Adhemerval Zanella
  0 siblings, 0 replies; 7+ messages in thread
From: Adhemerval Zanella @ 2024-04-17 20:09 UTC (permalink / raw)
  To: glibc-cvs

https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=22997a0a53a8d400bf0e62019f14f633383437a5

commit 22997a0a53a8d400bf0e62019f14f633383437a5
Author: Adhemerval Zanella <adhemerval.zanella@linaro.org>
Date:   Thu Jun 9 09:51:46 2022 -0300

    x86_64: Disable libmvec tests if compiler does not support attribute '__simd__'
    
    clang ignore the attribute, which is required by libmvec tests.

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 716c4578c4..f868f67dab 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 <<EOF
+__attribute__ ((__simd__)) float sinf (float);
+void
+foo (float *x)
+{
+  #pragma omp simd
+  for (int i = 0; i < 256; i++)
+    x[i] = sinf (x[i]);
+}
+EOF
+libc_cv_libmvec_pragma_omp_simd_support=no
+# Check regardless of the ABI used
+if { ac_try='${CC-cc} $CFLAGS -fno-inline -fopenmp -Wno-unknown-pragmas -S conftest.c -o conftest.s 1>&5'
+  { { 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
+  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 <<EOF
+__attribute__ ((__simd__)) float sinf (float);
+void
+foo (float *x)
+{
+  #pragma omp simd
+  for (int i = 0; i < 256; i++)
+    x[[i]] = sinf (x[[i]]);
+}
+EOF
+libc_cv_libmvec_pragma_omp_simd_support=no
+# Check regardless of the ABI used
+if AC_TRY_COMMAND([${CC-cc} $CFLAGS -fno-inline -fopenmp -Wno-unknown-pragmas -S conftest.c -o conftest.s 1>&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])

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [glibc/azanella/clang] x86_64: Disable libmvec tests if compiler does not support attribute '__simd__'
@ 2024-04-02 15:55 Adhemerval Zanella
  0 siblings, 0 replies; 7+ messages in thread
From: Adhemerval Zanella @ 2024-04-02 15:55 UTC (permalink / raw)
  To: glibc-cvs

https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=115086044e239097caaa834b872c4370ec6adc14

commit 115086044e239097caaa834b872c4370ec6adc14
Author: Adhemerval Zanella <adhemerval.zanella@linaro.org>
Date:   Thu Jun 9 09:51:46 2022 -0300

    x86_64: Disable libmvec tests if compiler does not support attribute '__simd__'
    
    clang ignore the attribute, which is required by libmvec tests.

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 716c4578c4..f868f67dab 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 <<EOF
+__attribute__ ((__simd__)) float sinf (float);
+void
+foo (float *x)
+{
+  #pragma omp simd
+  for (int i = 0; i < 256; i++)
+    x[i] = sinf (x[i]);
+}
+EOF
+libc_cv_libmvec_pragma_omp_simd_support=no
+# Check regardless of the ABI used
+if { ac_try='${CC-cc} $CFLAGS -fno-inline -fopenmp -Wno-unknown-pragmas -S conftest.c -o conftest.s 1>&5'
+  { { 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
+  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 <<EOF
+__attribute__ ((__simd__)) float sinf (float);
+void
+foo (float *x)
+{
+  #pragma omp simd
+  for (int i = 0; i < 256; i++)
+    x[[i]] = sinf (x[[i]]);
+}
+EOF
+libc_cv_libmvec_pragma_omp_simd_support=no
+# Check regardless of the ABI used
+if AC_TRY_COMMAND([${CC-cc} $CFLAGS -fno-inline -fopenmp -Wno-unknown-pragmas -S conftest.c -o conftest.s 1>&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])

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [glibc/azanella/clang] x86_64: Disable libmvec tests if compiler does not support attribute '__simd__'
@ 2024-02-09 17:33 Adhemerval Zanella
  0 siblings, 0 replies; 7+ messages in thread
From: Adhemerval Zanella @ 2024-02-09 17:33 UTC (permalink / raw)
  To: glibc-cvs

https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=4da4759d3c2ebbf1caed96da65649f9c684f56d7

commit 4da4759d3c2ebbf1caed96da65649f9c684f56d7
Author: Adhemerval Zanella <adhemerval.zanella@linaro.org>
Date:   Thu Jun 9 09:51:46 2022 -0300

    x86_64: Disable libmvec tests if compiler does not support attribute '__simd__'
    
    clang ignore the attribute, which is required by libmvec tests.

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 716c4578c4..f868f67dab 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 <<EOF
+__attribute__ ((__simd__)) float sinf (float);
+void
+foo (float *x)
+{
+  #pragma omp simd
+  for (int i = 0; i < 256; i++)
+    x[i] = sinf (x[i]);
+}
+EOF
+libc_cv_libmvec_pragma_omp_simd_support=no
+# Check regardless of the ABI used
+if { ac_try='${CC-cc} $CFLAGS -fno-inline -fopenmp -Wno-unknown-pragmas -S conftest.c -o conftest.s 1>&5'
+  { { 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
+  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 <<EOF
+__attribute__ ((__simd__)) float sinf (float);
+void
+foo (float *x)
+{
+  #pragma omp simd
+  for (int i = 0; i < 256; i++)
+    x[[i]] = sinf (x[[i]]);
+}
+EOF
+libc_cv_libmvec_pragma_omp_simd_support=no
+# Check regardless of the ABI used
+if AC_TRY_COMMAND([${CC-cc} $CFLAGS -fno-inline -fopenmp -Wno-unknown-pragmas -S conftest.c -o conftest.s 1>&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])

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [glibc/azanella/clang] x86_64: Disable libmvec tests if compiler does not support attribute '__simd__'
@ 2024-02-07 14:09 Adhemerval Zanella
  0 siblings, 0 replies; 7+ messages in thread
From: Adhemerval Zanella @ 2024-02-07 14:09 UTC (permalink / raw)
  To: glibc-cvs

https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=5dae78cc9be91a61c9e5e769becf8e85d52e010e

commit 5dae78cc9be91a61c9e5e769becf8e85d52e010e
Author: Adhemerval Zanella <adhemerval.zanella@linaro.org>
Date:   Thu Jun 9 09:51:46 2022 -0300

    x86_64: Disable libmvec tests if compiler does not support attribute '__simd__'
    
    clang ignore the attribute, which is required by libmvec tests.

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 716c4578c4..f868f67dab 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 <<EOF
+__attribute__ ((__simd__)) float sinf (float);
+void
+foo (float *x)
+{
+  #pragma omp simd
+  for (int i = 0; i < 256; i++)
+    x[i] = sinf (x[i]);
+}
+EOF
+libc_cv_libmvec_pragma_omp_simd_support=no
+# Check regardless of the ABI used
+if { ac_try='${CC-cc} $CFLAGS -fno-inline -fopenmp -Wno-unknown-pragmas -S conftest.c -o conftest.s 1>&5'
+  { { 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
+  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 <<EOF
+__attribute__ ((__simd__)) float sinf (float);
+void
+foo (float *x)
+{
+  #pragma omp simd
+  for (int i = 0; i < 256; i++)
+    x[[i]] = sinf (x[[i]]);
+}
+EOF
+libc_cv_libmvec_pragma_omp_simd_support=no
+# Check regardless of the ABI used
+if AC_TRY_COMMAND([${CC-cc} $CFLAGS -fno-inline -fopenmp -Wno-unknown-pragmas -S conftest.c -o conftest.s 1>&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])

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [glibc/azanella/clang] x86_64: Disable libmvec tests if compiler does not support attribute '__simd__'
@ 2024-01-29 17:59 Adhemerval Zanella
  0 siblings, 0 replies; 7+ messages in thread
From: Adhemerval Zanella @ 2024-01-29 17:59 UTC (permalink / raw)
  To: glibc-cvs

https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=bd03e9748370ba506beee68fcf2e171f8ad124b8

commit bd03e9748370ba506beee68fcf2e171f8ad124b8
Author: Adhemerval Zanella <adhemerval.zanella@linaro.org>
Date:   Thu Jun 9 09:51:46 2022 -0300

    x86_64: Disable libmvec tests if compiler does not support attribute '__simd__'
    
    clang ignore the attribute, which is required by libmvec tests.

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 716c4578c4..f868f67dab 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 <<EOF
+__attribute__ ((__simd__)) float sinf (float);
+void
+foo (float *x)
+{
+  #pragma omp simd
+  for (int i = 0; i < 256; i++)
+    x[i] = sinf (x[i]);
+}
+EOF
+libc_cv_libmvec_pragma_omp_simd_support=no
+# Check regardless of the ABI used
+if { ac_try='${CC-cc} $CFLAGS -fno-inline -fopenmp -Wno-unknown-pragmas -S conftest.c -o conftest.s 1>&5'
+  { { 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
+  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 <<EOF
+__attribute__ ((__simd__)) float sinf (float);
+void
+foo (float *x)
+{
+  #pragma omp simd
+  for (int i = 0; i < 256; i++)
+    x[[i]] = sinf (x[[i]]);
+}
+EOF
+libc_cv_libmvec_pragma_omp_simd_support=no
+# Check regardless of the ABI used
+if AC_TRY_COMMAND([${CC-cc} $CFLAGS -fno-inline -fopenmp -Wno-unknown-pragmas -S conftest.c -o conftest.s 1>&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])

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [glibc/azanella/clang] x86_64: Disable libmvec tests if compiler does not support attribute '__simd__'
@ 2023-12-21 18:55 Adhemerval Zanella
  0 siblings, 0 replies; 7+ messages in thread
From: Adhemerval Zanella @ 2023-12-21 18:55 UTC (permalink / raw)
  To: glibc-cvs

https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=310daf521ba6593106a0b8520a23cc29f1d25e90

commit 310daf521ba6593106a0b8520a23cc29f1d25e90
Author: Adhemerval Zanella <adhemerval.zanella@linaro.org>
Date:   Thu Jun 9 09:51:46 2022 -0300

    x86_64: Disable libmvec tests if compiler does not support attribute '__simd__'
    
    clang ignore the attribute, which is required by libmvec tests.

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 <<EOF
+__attribute__ ((__simd__)) float sinf (float);
+void
+foo (float *x)
+{
+  #pragma omp simd
+  for (int i = 0; i < 256; i++)
+    x[i] = sinf (x[i]);
+}
+EOF
+libc_cv_libmvec_pragma_omp_simd_support=no
+# Check regardless of the ABI used
+if { ac_try='${CC-cc} $CFLAGS -fno-inline -fopenmp -Wno-unknown-pragmas -S conftest.c -o conftest.s 1>&5'
+  { { 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
+  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 <<EOF
+__attribute__ ((__simd__)) float sinf (float);
+void
+foo (float *x)
+{
+  #pragma omp simd
+  for (int i = 0; i < 256; i++)
+    x[[i]] = sinf (x[[i]]);
+}
+EOF
+libc_cv_libmvec_pragma_omp_simd_support=no
+# Check regardless of the ABI used
+if AC_TRY_COMMAND([${CC-cc} $CFLAGS -fno-inline -fopenmp -Wno-unknown-pragmas -S conftest.c -o conftest.s 1>&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])

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [glibc/azanella/clang] x86_64: Disable libmvec tests if compiler does not support attribute '__simd__'
@ 2023-09-28 17:54 Adhemerval Zanella
  0 siblings, 0 replies; 7+ messages in thread
From: Adhemerval Zanella @ 2023-09-28 17:54 UTC (permalink / raw)
  To: glibc-cvs

https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=c5123bc61a8169db08c1ea6478276891742c0b3c

commit c5123bc61a8169db08c1ea6478276891742c0b3c
Author: Adhemerval Zanella <adhemerval.zanella@linaro.org>
Date:   Thu Jun 9 09:51:46 2022 -0300

    x86_64: Disable libmvec tests if compiler does not support attribute '__simd__'
    
    clang ignore the attribute, which is required by libmvec tests.

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 <<EOF
+__attribute__ ((__simd__)) float sinf (float);
+void
+foo (float *x)
+{
+  #pragma omp simd
+  for (int i = 0; i < 256; i++)
+    x[i] = sinf (x[i]);
+}
+EOF
+libc_cv_libmvec_pragma_omp_simd_support=no
+# Check regardless of the ABI used
+if { ac_try='${CC-cc} $CFLAGS -fno-inline -fopenmp -Wno-unknown-pragmas -S conftest.c -o conftest.s 1>&5'
+  { { 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
+  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 <<EOF
+__attribute__ ((__simd__)) float sinf (float);
+void
+foo (float *x)
+{
+  #pragma omp simd
+  for (int i = 0; i < 256; i++)
+    x[[i]] = sinf (x[[i]]);
+}
+EOF
+libc_cv_libmvec_pragma_omp_simd_support=no
+# Check regardless of the ABI used
+if AC_TRY_COMMAND([${CC-cc} $CFLAGS -fno-inline -fopenmp -Wno-unknown-pragmas -S conftest.c -o conftest.s 1>&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])

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2024-04-17 20:09 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-04-17 20:09 [glibc/azanella/clang] x86_64: Disable libmvec tests if compiler does not support attribute '__simd__' Adhemerval Zanella
  -- strict thread matches above, loose matches on Subject: below --
2024-04-02 15:55 Adhemerval Zanella
2024-02-09 17:33 Adhemerval Zanella
2024-02-07 14:09 Adhemerval Zanella
2024-01-29 17:59 Adhemerval Zanella
2023-12-21 18:55 Adhemerval Zanella
2023-09-28 17:54 Adhemerval Zanella

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).