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], Enable -mfloat128 by default on PowerPC VSX systems


This patch enables -mfloat128 to be the default on PowerPC Linux VSX systems.

This patch depends on the libquadmatch/81848 patch being approved and
installed:
https://gcc.gnu.org/ml/gcc-patches/2017-08/msg00977.html

In this patch, I removed the old undocumented -mfloat128-type switch, and made
the default to be on for PowerPC Linux systems.  The default is off for other
systems (such as AIX) because they don't build the float128 emulation routines
in libgcc.

This patch also supersedes the patch for target/70589 that was previously
submitted.  It includes the changes for that bug to enable/disable -mfloat128
via target pragmas/attributes with the exception that the option
-mfloat128-type is now deleted:
https://gcc.gnu.org/ml/gcc-patches/2017-08/msg00894.html

I fixed up all of the float128 tests to remove the explict -mfloat128 option
and add -mno-float128 as needed.

I've checked this on a big endian power7 system (both 32-bit and 64-bit) and a
little endian power8 system.  It bootstrapped fine and had no regressions in
the test suite.  I also built the latest boost library and got the same results
for the pre -mfloat128 compiler and the compiler with -mfloat128 as the
default, and there were no changes.  I also built and ran spec 2006 FP tests
with the two compilers, and there no changes in runtime of the tests.

Can I check this into the trunk once the patch for 81848 has been applied?

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

	PR target/81872
	* config/rs6000/rs6000-cpus.def (OTHER_VSX_VECTOR_MASKS): Delete
	OPTION_MASK_FLOAT128_TYPE.
	(POWERPC_MASKS): Likewise.
	* config/rs6000/rs6000.opt (TARGET_FLOAT128_ENABLE_TYPE): Make
	this a variable instead of a target switch.
	(-mfloat128-type): Delete switch.
	* config/rs6000/rs6000.c (rs6000_option_override_internal): Set
	-mfloat128 by default on Linux VSX systems.  Remove support for
	an explicit -mfloat128-type option.  Rework how
	-mfloat128-hardware is set on ISA 3.0 systems.  Even if
	-mno-float128 is used, enable the IEEE 128-bit type support
	internally.
	(rs6000_opt_masks): Delete -mfloat128-type.
	* config/rs6000/rs6000.h (MASK_FLOAT128_TYPE): Delete.
	(MASK_FLOAT128_KEYWORD): Define.
	(RS6000_BTM_FLOAT128): Use the mask for -mfloat128 instead of
	-mfloat128-type to signal we should build the IEEE 128-bit
	built-in functions.  The function rs6000_builtin_mask_calculate in
	rs6000.c still uses TARGET_FLOAT128_ENABLE_TYPE to determine
	whether to enable the built-in functions or not.
	* doc/invoke.texi (RS/6000 and PowerPC Options): Update -mfloat128
	and -mfloat128-hardware documentation.

	PR target/70589
	* config/rs6000/rs6000-c.c (rs6000_target_modify_macros): Make the
	real keyword for IEEE 128-bit be __ieee128 for VSX runs, and define
	__float128 to be __ieee128 if -mfloat128 is used or a float128
	target attribute/pragma is used.  Enable _Float128 all of the
	time.
	(rs6000_cpu_cpp_builtins): Likewise.
	* config/rs6000/rs6000.c (rs6000_init_builtins): Likewise.
	(rs6000_floatn_mode): Likewise.
	(rs6000_opt_masks): Likewise.

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

	PR target/81872
	* gcc.target/powerpc/float128-1.c: Change float128 tests to assume
	-mfloat128 is on by default.  Explicitly use -mno-float128 to test
	when the __float128 keyword should not be available.  Use -mvsx,
	-mpower8-vector, or -mpower9-vector instead of -mcpu=power7/8/9 in
	many cases.
	* gcc.target/powerpc/float128-2.c: Likewise.
	* gcc.target/powerpc/float128-cmp.c: Likewise.
	* gcc.target/powerpc/float128-complex-1.c: Likewise.
	* gcc.target/powerpc/float128-complex-2.c: Likewise.
	* gcc.target/powerpc/float128-hw.c: Likewise.
	* gcc.target/powerpc/float128-mix.c: Likewise.
	* gcc.target/powerpc/float128-type-1.c: Likewise.
	* gcc.target/powerpc/float128-type-2.c: Likewise.

	PR target/70589
	* gcc.target/powerpc/float128-3.c: New test.
	* gcc.target/powerpc/float128-4.c: Likewise.
	* gcc.target/powerpc/float128-5.c: Likewise.

-- 
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: ieee128-patch23b
Description: Text document


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