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 71806, Fix -mfloat128/-mfloat128-hardware defaults on power9


If you configure either GCC 6.x or trunk with the --with-cpu=power9 option, it
will enable __float128 support, since power9 has the ISA 3.0 hardware IEEE
128-bit floating point instructions.  However, the libquadmath and libstdc++
libraries have not been fixed to enable the PowerPC support, and the build
fails.  Similarly, users who use -mcpu=power9 will get __float128 enabled, and
they will run into problems if they use features that are not yet present.

This patch, changes the behavior so that IEEE 128-bit floating point
instructions are enabled if you use ISA 3.0 (-mcpu=power9), provding you use
the -mfloat128 option.  Or if you use the -mfloat128-hardware option, it will
enable the base -mfloat128 support.

It is expected that when glibc, libstdc++, and libquadmath are enhanced to add
__float128 support, that the -mfloat128 option will be enabled automatically
for power7/power8 systems, and -mfloat128-hardware will be enabled for power9
systems.

Included in this post are two attachments, one for trunk, and the other for the
GCC 6.x branch.  I have tested both patches against their respected bases, and
there are no regressions (once the one test that assumed -mcpu=power9 enabled
IEEE 128-bit floating point is fixed with this patch).  Are these ok to install
in their respective trees?

The only difference between the GCC 6 patch and the trunk patch is the trunk
adds a check for -mupper-regs-di, which has not been backported to the GCC 6
branch.

[gcc]
2016-07-08  Michael Meissner  <meissner@linux.vnet.ibm.com>

	PR target/71806
	* config/rs6000/rs6000-cpus.def (ISA_3_0_MASKS_SERVER): Do not
	enable -mfloat128-hardware by default.
	(ISA_3_0_MASKS_IEEE): New macro to give all of the VSX options
	that IEEE 128-bit hardware support needs.
	* config/rs6000/rs6000.c (rs6000_option_override_internal): If
	-mcpu=power9 -mfloat128, enable -mfloat128-hardware by default.
	Use ISA_3_0_MASKS_IEEE as the set of options that IEEE 128-bit
	floating point requires.
	* doc/invoke.texi (RS/6000 and PowerPC Options): Document
	-mfloat128 and -mfloat128-hardware changes.

[gcc/testsuite]
2016-07-08  Michael Meissner  <meissner@linux.vnet.ibm.com>

	* gcc.target/powerpc/p9-lxvx-stxvx-3.c: Add -mfloat128 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

Attachment: pr71806.patch01-trunk
Description: Text document

Attachment: pr71806.patch01-gcc6
Description: Text document


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