This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] PR libgcc/83112, Fix warnings on libgcc float128-ifunc.c


On Mon, Nov 27, 2017 at 03:40:58PM -0700, Martin Sebor wrote:
> On 11/27/2017 12:21 PM, Michael Meissner wrote:
> >The new -Wattribute-alias option now issues warnings for old-style ifunc
> >declarations that coerce the pointer to the function to void *.  The
> >float128-ifunc.c module in libgcc/config/rs6000 now gets a lot of warnings of
> >the form:
> >
> >../float128-ifunc.c:109:1: warning: ‘ifunc’ resolver for ‘__negkf2’ should
> >return ‘TFtype (*)(TFtype) {aka _Float128 (*)(_Float128)}’ [-Wattribute-alias]
> >
> >This patch fixes these warnings.  I have done a full bootstrap build and test
> >suite run.  I have verified that the ifunc handler works correctly, using
> >software emulation on a power8 and the hardware instructions on power9.  Can I
> >check this into the trunk?
> 
> Just as a side note, a convenient way to deal with this is to use
> typeof to deduce the return type of the resolver from the type of
> the function it returns.  I would expect something like
> the following untested change to do it and make the typedefs
> unnecessary:
> 
>   -static void *
>   +static __typeof__ (__addkf3_sw) *
>    __addkf3_resolve (void)
>    {
>   -  return (void *) SW_OR_HW (__addkf3_sw, __addkf3_hw);
>   +  return SW_OR_HW (__addkf3_sw, __addkf3_hw);
>    }
> 
> Martin

Thanks, that does simplify things.  I redid the patch for both PR libgcc/83112
(avoid the warnings in float128-ifunc) and PR libgcc/83103 (optimize complex
float128 multiply/divide when running on ISA 3.0 hardware).

This patch combines both PRs.  I have bootstrapped it and done a regression
test with no regressions.  Can I install this patch in the trunk?

2017-11-27  Michael Meissner  <meissner@linux.vnet.ibm.com>

	PR libgcc/83112
	* config/rs6000/float128-ifunc.c (__addkf3_resolve): Use the
	correct type for all ifunc resolvers to silence -Wattribute-alias
	warnings.  Eliminate the forward declaration of the resolver
	functions which is no longer needed.
	(__subkf3_resolve): Likewise.
	(__mulkf3_resolve): Likewise.
	(__divkf3_resolve): Likewise.
	(__negkf2_resolve): Likewise.
	(__eqkf2_resolve): Likewise.
	(__nekf2_resolve): Likewise.
	(__gekf2_resolve): Likewise.
	(__gtkf2_resolve): Likewise.
	(__lekf2_resolve): Likewise.
	(__ltkf2_resolve): Likewise.
	(__unordkf2_resolve): Likewise.
	(__extendsfkf2_resolve): Likewise.
	(__extenddfkf2_resolve): Likewise.
	(__trunckfsf2_resolve): Likewise.
	(__trunckfdf2_resolve): Likewise.
	(__fixkfsi_resolve): Likewise.
	(__fixkfdi_resolve): Likewise.
	(__fixunskfsi_resolve): Likewise.
	(__fixunskfdi_resolve): Likewise.
	(__floatsikf_resolve): Likewise.
	(__floatdikf_resolve): Likewise.
	(__floatunsikf_resolve): Likewise.
	(__floatundikf_resolve): Likewise.
	(__extendkftf2_resolve): Likewise.
	(__trunctfkf2_resolve): Likewise.

	PR libgcc/83103
	* config/rs6000/quad-float128.h (TF): Don't define if long double
	is IEEE 128-bit floating point.
	(TCtype): Define as either TCmode or KCmode, depending on whether
	long double is IEEE 128-bit floating point.
	(__mulkc3_sw): Add declarations for software/hardware versions of
	complex multiply/divide.
	(__divkc3_sw): Likewise.
	(__mulkc3_hw): Likewise.
	(__divkc3_hw): Likewise.
	* config/rs6000/_mulkc3.c (_mulkc3): If we are building ifunc
	handlers to switch between using software emulation and hardware
	float128 instructions, build the complex multiply/divide functions
	for both software and hardware support.
	* config/rs6000/_divkc3.c (_divkc3): Likewise.
	* config/rs6000/float128-ifunc.c (__mulkc3_resolve): Likewise.
	(__divkc3_resolve): Likewise.
	(__mulkc3): Likewise.
	(__divkc3): Likewise.
	* config/rs6000/t-float128-hw (fp128_hardfp_src): Likewise.
	(fp128_hw_src): Likewise.
	(fp128_hw_static_obj): Likewise.
	(fp128_hw_shared_obj): Likewise.
	(_mulkc3-hw.c): Likewise.
	(_divkc3-hw.c): Likewise.
	* config/rs6000/t-float128 (clean-float128): Delete _mulkc3-hw.c
	and _divkc3-hw.c.

-- 
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

Attachment: pr83112.patch02b
Description: Text document


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]