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]

[PATCH], PR libgcc/83112, Add ifunc support for _mulkc3 and _divkc3


Unlike the other _Float128 emulation support in the PowerPC libgcc, the support
for _Complex _Float128 multiply and divide doesn't resolve into a single
instruction on the power9 system.

But these two functions do benefit if they are compiled for ISA 3.0 _Float128
hardware instructions, by eliminating calling __{add,sub,mul,div}kf2 through
PLT functions to get to the hardware instruction, and instead using the native
instruction.

I have done bootstrap builds on a little endian power8 system with/without the
patches and there were no regressions in the testsuite.

I have also built the compiler on a little endian power9 prototype system, and
I ran a test that did 100,000,000 passes of complex multiply and adds and then
100,000,000 passes of complex divide and minus.  The test with these fixes was
roughly 45% faster than the test with the unpatched compiler.  I also ran the
test on a power8 system, and it runs using the software emulation.

Can I check this patch into the trunk, assuming that the previously posted
patch for PR libgcc/813112 has also been applied?

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

	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): Add deleting
	_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: pr83103.patch02b
Description: Text document


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