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: Tue, 4 Oct 2022 12:59:16 +0000 (GMT) [thread overview] Message-ID: <20221004125916.15B593857C42@sourceware.org> (raw) https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=7f49c287146c97be29e0f2e7b504cfef2663675e commit 7f49c287146c97be29e0f2e7b504cfef2663675e 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 | 6 +++--- support/Makefile | 4 ++-- sysdeps/x86/fpu/Makefile | 4 ++-- 5 files changed, 37 insertions(+), 7 deletions(-) diff --git a/configure b/configure index 42ad611106..5fc7d6f0d4 100755 --- a/configure +++ b/configure @@ -6337,6 +6337,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 3cd9c8882b..fb698c3d7d 100644 --- a/configure.ac +++ b/configure.ac @@ -1455,6 +1455,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 dce94d0249..efe5b77cba 100644 --- a/math/Makefile +++ b/math/Makefile @@ -455,9 +455,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) diff --git a/support/Makefile b/support/Makefile index 4046b12fbd..2d1dcb5ffd 100644 --- a/support/Makefile +++ b/support/Makefile @@ -235,8 +235,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
next reply other threads:[~2022-10-04 12:59 UTC|newest] Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top 2022-10-04 12:59 Adhemerval Zanella [this message] -- strict thread matches above, loose matches on Subject: below -- 2024-04-17 20:06 Adhemerval Zanella 2024-04-02 15:52 Adhemerval Zanella 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-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-16 18:03 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=20221004125916.15B593857C42@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: linkBe 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).