This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PING][Patch] Add support for IEEE-conformant versions of scalar fmin* and fmax*
- From: Joseph Myers <joseph at codesourcery dot com>
- To: Richard Biener <richard dot guenther at gmail dot com>
- Cc: David Sherwood <David dot Sherwood at arm dot com>, GCC Patches <gcc-patches at gcc dot gnu dot org>, <richard dot sandiford at arm dot com>
- Date: Wed, 19 Aug 2015 15:31:42 +0000
- Subject: Re: [PING][Patch] Add support for IEEE-conformant versions of scalar fmin* and fmax*
- Authentication-results: sourceware.org; auth=none
- References: <000001d0d5b0$5da4dbb0$18ee9310$ at arm dot com> <CAFiYyc1bgWwdV4PRLBuUv3yC0X-k5gJVuyyV9V7Vrz3Lte+wZw at mail dot gmail dot com> <000001d0d8cf$2fb42770$8f1c7650$ at arm dot com> <CAFiYyc2XT+iqyRNgp+N2gWsaP-=1xVUWsuUEj+bOq_UmE_1eLw at mail dot gmail dot com> <000001d0d9a6$1efdc350$5cf949f0$ at arm dot com> <CAFiYyc3CLF8beK5GaB86Ad7623gWc9yhc8nTom-ByoaHTEMyOg at mail dot gmail dot com> <87fv3gbs36 dot fsf at e105548-lin dot cambridge dot arm dot com> <CAFiYyc1q7deng7mjnt788RwqkHuvdDCKW=uWpd=goEvTeZiK5Q at mail dot gmail dot com> <8737zfbo2j dot fsf at e105548-lin dot cambridge dot arm dot com> <CAFiYyc1any7rSNCYqEpMDqsCesPte1N=ancreby-XSFBJmJ1Tg at mail dot gmail dot com> <87y4h7a35q dot fsf at e105548-lin dot cambridge dot arm dot com> <CAFiYyc2W82jzYE3saLQkNhhDEH1+BFk0yShrh3OVBdjHkkyr3A at mail dot gmail dot com>
On Wed, 19 Aug 2015, Richard Biener wrote:
> As an additional point for many math functions we have to support errno
> which means, like, BUILT_IN_SQRT can be rewritten to SQRT_EXPR
> only if -fno-math-errno is in effect. But then code has to handle
I'd say that for functions like that (which can be expanded inline only
for -fno-math-errno) there should be no-errno built-in function variants
that users can call even if -fmath-errno (if not expanded inline, they'd
still result in a call to a libm function that might set errno).
An example of a use for that is AArch64 sqrt intrinsics that need an
architecture-specific built-in __builtin_aarch64_sqrtdf when
__builtin_sqrt_noerrno would do just as well if it existed. As another
example: various libm functions are marked in builtins.def as not setting
errno, even though their proper semantics mean they might set errno; see
bug 64101 for the example of erf. One such function is fma. But if you
limit fma inline expansion (for calls to fma / __builtin_fma in the user's
program; obviously this doesn't affect expansion via contraction of a * b
+ c) to allow for the possibility of errno setting, you definitely want a
way for user programs to get back the efficient inline expansion if they
don't need errno set; for example, glibc uses __builtin_fma in various
cases if _FP_FAST_FMA, and does not need errno setting in those cases, so
would want to use __builtin_fma_noerrno in the event of any such change.
--
Joseph S. Myers
joseph@codesourcery.com