public inbox for glibc-cvs@sourceware.org
help / color / mirror / Atom feed
From: Adhemerval Zanella <azanella@sourceware.org>
To: glibc-cvs@sourceware.org
Subject: [glibc/azanella/clang] math: Use -fexcess-precision=standard iff compiler supports it
Date: Wed, 16 Mar 2022 18:03:11 +0000 (GMT)	[thread overview]
Message-ID: <20220316180311.C13573947422@sourceware.org> (raw)

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

commit 7f921560de29bda362ac46ac618d4ad88677e90c
Author: Adhemerval Zanella <adhemerval.zanella@linaro.org>
Date:   Thu Mar 10 17:22:41 2022 -0300

    math: Use -fexcess-precision=standard iff compiler supports it

Diff:
---
 configure                | 22 ++++++++++++++++++++++
 configure.ac             |  8 ++++++++
 math/Makefile            | 16 +++++++++++++---
 support/Makefile         |  4 ++--
 sysdeps/x86/fpu/Makefile |  4 ++--
 5 files changed, 47 insertions(+), 7 deletions(-)

diff --git a/configure b/configure
index e0589dbebe..ff0a3841d2 100755
--- a/configure
+++ b/configure
@@ -6435,6 +6435,28 @@ $as_echo "$libc_cv_wno_maybe_uninitialized" >&6; }
 config_vars="$config_vars
 config-cflags-wno-maybe-uninitialized = $libc_cv_wno_maybe_uninitialized"
 
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for -fexcess-precision=standard" >&5
+$as_echo_n "checking for -fexcess-precision=standard... " >&6; }
+if ${libc_cv_fexcess_precision_standard+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  		if { ac_try='${CC-cc} -Werror -fexcess-precision=standard -xc /dev/null -S -o /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_fexcess_precision_standard=-fexcess-precision=standard
+else
+  libc_cv_fexcess_precision_standard=
+fi
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $libc_cv_fexcess_precision_standard" >&5
+$as_echo "$libc_cv_fexcess_precision_standard" >&6; }
+config_vars="$config_vars
+config-cflags-fexcess-precision-standard = $libc_cv_fexcess_precision_standard"
+
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether cc puts quotes around section names" >&5
 $as_echo_n "checking whether cc puts quotes around section names... " >&6; }
 if ${libc_cv_have_section_quotes+:} false; then :
diff --git a/configure.ac b/configure.ac
index d5b5b5e88c..dd8fb99867 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1543,6 +1543,14 @@ AC_CACHE_CHECK([for -Wno-maybe-uninitialized], libc_cv_wno_maybe_uninitialized,
 LIBC_CONFIG_VAR([config-cflags-wno-maybe-uninitialized],
 		[$libc_cv_wno_maybe_uninitialized])
 
+AC_CACHE_CHECK([for -fexcess-precision=standard], libc_cv_fexcess_precision_standard, [dnl
+		LIBC_TRY_CC_OPTION([-Werror -fexcess-precision=standard],
+				   [libc_cv_fexcess_precision_standard=-fexcess-precision=standard],
+				   [libc_cv_fexcess_precision_standard=])
+])
+LIBC_CONFIG_VAR([config-cflags-fexcess-precision-standard],
+		[$libc_cv_fexcess_precision_standard])
+
 AC_CACHE_CHECK(whether cc puts quotes around section names,
 	       libc_cv_have_section_quotes,
 	       [cat > conftest.c <<EOF
diff --git a/math/Makefile b/math/Makefile
index a4932b3d0b..b0bc84c49b 100644
--- a/math/Makefile
+++ b/math/Makefile
@@ -452,9 +452,9 @@ CFLAGS-test-math-iszero.cc += -std=gnu++11
 CFLAGS-test-math-issignaling.cc += -std=gnu++11
 CFLAGS-test-math-iscanonical.cc += -std=gnu++11
 
-CFLAGS-test-iszero-excess-precision.c += -fexcess-precision=standard
-CFLAGS-test-iseqsig-excess-precision.c += -fexcess-precision=standard
-CFLAGS-test-flt-eval-method.c += -fexcess-precision=standard
+CFLAGS-test-iszero-excess-precision.c += $(config-cflags-fexcess-precision-standard)
+CFLAGS-test-iseqsig-excess-precision.c += $(config-cflags-fexcess-precision-standard)
+CFLAGS-test-flt-eval-method.c += $(config-cflags-fexcess-precision-standard)
 
 CFLAGS-test-fe-snans-always-signal.c += $(config-cflags-signaling-nans)
 
@@ -773,6 +773,16 @@ CFLAGS-s_modff.c += $(config-cflags-signaling-nans)
 CFLAGS-s_modfl.c += $(config-cflags-signaling-nans)
 CFLAGS-s_modff128.c += $(config-cflags-signaling-nans)
 
+CFLAGS-s_llround.c += -Wno-incompatible-library-redeclaration
+CFLAGS-s_fabsl.c += -Wno-ignored-attributes
+CFLAGS-s_fabsf128.c += -Wno-ignored-attributes
+CFLAGS-fraiseexcpt.c += -Wno-ignored-attributes
+CFLAGS-fegetround.c += -Wno-ignored-attributes
+CFLAGS-fesetround.c += -Wno-ignored-attributes
+CFLAGS-fegetenv.c += -Wno-ignored-attributes
+CFLAGS-fesetenv.c += -Wno-ignored-attributes
+CFLAGS-feholdexcpt.c += -Wno-ignored-attributes
+
 $(addprefix $(objpfx),\
 	    $(filter-out $(tests-static) $(libm-tests-vector),\
 			 $(tests) $(tests-internal))): $(libm)
diff --git a/support/Makefile b/support/Makefile
index 5ddcb8d158..1a157eea4e 100644
--- a/support/Makefile
+++ b/support/Makefile
@@ -232,8 +232,8 @@ CFLAGS-support_paths.c = \
 # being withing the observed range.  The code uses double internally
 # in support_timespec_check_in_range and for that computation we use
 # -fexcess-precision=standard.
-CFLAGS-timespec.c += -fexcess-precision=standard
-CFLAGS-timespec-time64.c += -fexcess-precision=standard
+CFLAGS-timespec.c += $(config-cflags-fexcess-precision-standard)
+CFLAGS-timespec-time64.c += $(config-cflags-fexcess-precision-standard)
 
 ifeq (,$(CXX))
 LINKS_DSO_PROGRAM = links-dso-program-c
diff --git a/sysdeps/x86/fpu/Makefile b/sysdeps/x86/fpu/Makefile
index 600e42c3db..68bd42cdd3 100644
--- a/sysdeps/x86/fpu/Makefile
+++ b/sysdeps/x86/fpu/Makefile
@@ -8,7 +8,7 @@ tests += test-fenv-sse test-fenv-clear-sse test-fenv-x87 test-fenv-sse-2 \
 CFLAGS-test-fenv-sse.c += -msse2 -mfpmath=sse
 CFLAGS-test-fenv-clear-sse.c += -msse2 -mfpmath=sse
 CFLAGS-test-fenv-sse-2.c += -msse2 -mfpmath=sse
-CFLAGS-test-flt-eval-method-387.c += -fexcess-precision=standard -mfpmath=387
-CFLAGS-test-flt-eval-method-sse.c += -fexcess-precision=standard -msse2 \
+CFLAGS-test-flt-eval-method-387.c += $(config-cflags-fexcess-precision-standard) -mfpmath=387
+CFLAGS-test-flt-eval-method-sse.c += $(config-cflags-fexcess-precision-standard) -msse2 \
 				     -mfpmath=sse
 endif


             reply	other threads:[~2022-03-16 18:03 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-03-16 18:03 Adhemerval Zanella [this message]
  -- strict thread matches above, loose matches on Subject: below --
2024-02-09 17:31 Adhemerval Zanella
2024-02-07 14:06 Adhemerval Zanella
2024-01-29 17:56 Adhemerval Zanella
2023-12-21 18:53 Adhemerval Zanella
2023-09-28 17:51 Adhemerval Zanella
2023-08-30 12:36 Adhemerval Zanella
2023-02-09 19:48 Adhemerval Zanella
2022-10-28 17:41 Adhemerval Zanella
2022-10-04 12:59 Adhemerval Zanella
2022-06-09 21:19 Adhemerval Zanella
2022-06-09 13:16 Adhemerval Zanella
2022-06-03 14:05 Adhemerval Zanella
2022-05-13 14:19 Adhemerval Zanella
2022-05-12 19:33 Adhemerval Zanella
2022-05-10 18:23 Adhemerval Zanella
2022-04-29 14:03 Adhemerval Zanella
2022-04-04 12:54 Adhemerval Zanella
2022-03-31 19:06 Adhemerval Zanella
2022-03-29 20:29 Adhemerval Zanella
2022-03-15 18:40 Adhemerval Zanella
2022-03-11 17:24 Adhemerval Zanella

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220316180311.C13573947422@sourceware.org \
    --to=azanella@sourceware.org \
    --cc=glibc-cvs@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).