On Fri, Dec 01, 2017 at 05:53:55PM -0600, Segher Boessenkool wrote:
> On Fri, Dec 01, 2017 at 12:40:22AM -0500, Michael Meissner wrote:
> > After committing the previous patch, I noticed that it was now generating
> > warnings for __{mul,div}kc3_{sw,hw} not having a prototype that I hadn't
> > noticed during development of the patch.  This is due to the fact that 
> > before I
> > added the ifunc support, it was only compiling __{mul,div}kc3, and those 
> > have
> > built-in declarations.  I installed this patch as being obvious:
> > 
> > 2017-11-30  Michael Meissner  <meiss...@linux.vnet.ibm.com>
> > 
> >     * config/rs6000/_mulkc3.c (__mulkc3): Add forward declaration.
> >     * config/rs6000/_divkc3.c (__divkc3): Likewise.
> > 
> > Index: libgcc/config/rs6000/_divkc3.c
> > ===================================================================
> > --- libgcc/config/rs6000/_divkc3.c  (revision 255288)
> > +++ libgcc/config/rs6000/_divkc3.c  (working copy)
> > @@ -37,6 +37,8 @@ typedef __complex float KCtype __attribu
> >  #define __divkc3 __divkc3_sw
> >  #endif
> >  
> > +extern KCtype __divkc3 (KFtype, KFtype, KFtype, KFtype);
> > +
> >  KCtype
> >  __divkc3 (KFtype a, KFtype b, KFtype c, KFtype d)
> >  {
> 
> How does this warn?  -Wmissing-declarations?  Should this declaration be
> in a header then?

The compiler creates the call to __mulkc3 and __divkc3, and internally it has
the appropriate prototype like it does for all built-in functions (in this
case, returning an _Float128 _Complex type, and taking 4 _Float128 arguments).

So before adding ifunc support, we never noticed it didn't have a prototype,
because the compiler already has a prototype.

With ifunc support, we now need to create two separate functions, __mulkc3_sw
and __mulkc3_hw, and make __multkc3 the ifunc resolver.

So there really isn't an include file that is appropriate to put the
definitions in.  I could change it to use the soft-fp includes (including
quadmath-float128.h) if desired.

Did you want me to do that?

> A code comment explaining why you do a declaration for exactly the same
> thing as there is two lines later would help; otherwise people will try
> to delete it again :-)

-- 
Michael Meissner, IBM
IBM, M/S 2506R, 550 King Street, Littleton, MA 01460-6245, USA
email: meiss...@linux.vnet.ibm.com, phone: +1 (978) 899-4797

Reply via email to