This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH, version 3], Add support for _Float<N> and _Float<N>X sqrt, fma, fmin, fmax built-in functions
- From: Michael Meissner <meissner at linux dot vnet dot ibm dot com>
- To: Joseph Myers <joseph at codesourcery dot com>
- Cc: Michael Meissner <meissner at linux dot vnet dot ibm dot com>, GCC Patches <gcc-patches at gcc dot gnu dot org>, Segher Boessenkool <segher at kernel dot crashing dot org>, David Edelsohn <dje dot gcc at gmail dot com>, Bill Schmidt <wschmidt at linux dot vnet dot ibm dot com>
- Date: Tue, 24 Oct 2017 19:42:17 -0400
- Subject: Re: [PATCH, version 3], Add support for _Float<N> and _Float<N>X sqrt, fma, fmin, fmax built-in functions
- Authentication-results: sourceware.org; auth=none
- References: <20170913214600.GA24598@ibm-tiger.the-meissners.org> <alpine.DEB.2.20.1709132239500.28319@digraph.polyomino.org.uk> <20171019220831.GA27658@ibm-tiger.the-meissners.org> <alpine.DEB.2.20.1710192211280.9397@digraph.polyomino.org.uk> <20171024221900.GA24351@ibm-tiger.the-meissners.org> <alpine.DEB.2.20.1710242300560.8054@digraph.polyomino.org.uk>
On Tue, Oct 24, 2017 at 11:08:15PM +0000, Joseph Myers wrote:
> On Tue, 24 Oct 2017, Michael Meissner wrote:
>
> > This patch adds a new switch (-fimplicit-math-floatn) that when enabled, it
> > will add implicit declarations for copysign, fabs, fma, fmax, fmin, nan, and
> > sqrt _Float<N> and _Float<N>X variants. Like the previous patch, it adds fma,
> > fmax, fmin, and sqrt builtins to the machine independent built-in support, and
> > removed the PowerPC specific __builtin_{sqrt,fma}f128 functions.
>
> I don't see why this new option is needed. My expectation would be to use
> DEF_EXT_LIB_BUILTIN, as discussed before (i.e. declare the non-__builtin_*
> variants by default, but not if flag_iso).
>
> That they should be declared by default is clear, in line with the normal
> principle of enabling GNU extensions by default. That they should not be
> declared with existing -std=c11 etc. options is also clear. Sometimes
> there may be a use for an option to enable particular features of a TS
> (e.g. -fpermitted-flt-eval-methods=ts-18661-3,
> -fno-fp-int-builtin-inexact), I just don't see the requirement for it in
> this particular case. Of course, if in future TS 18661-3 gets added to
> C2x, such built-in functions could be enabled for -std=c2x, subject to any
> questions of the circumstances under which their names are reserved if the
> relevant feature test macros are not defined.
>
> (There are various issues with the documentation of the new option as
> well.)
Ok, I misunderstood your previous comment. I thought you were saying not to
export the normal functions (not huge_val, nan, inf) by default on the off
chance that somebody could declare a sqrtf128 function that did something
else.
I would prefer not to have the switch, but I wanted some way for fmaf128 and
sqrtf128 to automatically use the instructions. I'll switch it to
DEF_EXT_LIB_BUILTIN, and delete the option.
--
Michael Meissner, IBM
IBM, M/S 2506R, 550 King Street, Littleton, MA 01460-6245, USA
email: meissner@linux.vnet.ibm.com, phone: +1 (978) 899-4797
- References:
- [PATCH, version 2], Add support for _Float<N> and _Float<N>X sqrt, fma, fmin, fmax built-in functions
- Re: [PATCH, version 2], Add support for _Float<N> and _Float<N>X sqrt, fma, fmin, fmax built-in functions
- Re: [PATCH, version 3], Add support for _Float<N> and _Float<N>X sqrt, fma, fmin, fmax built-in functions
- Re: [PATCH, version 3], Add support for _Float<N> and _Float<N>X sqrt, fma, fmin, fmax built-in functions