diff mbox

[#2] , PowerPC support to enable -mlra and/or -mfloat128

Message ID 20160720170427.GA8834@ibm-tiger.the-meissners.org
State New
Headers show

Commit Message

Michael Meissner July 20, 2016, 5:04 p.m. UTC
This patch renames the configure switches to be explicit that they are for the
PowerPC, and that they are temporary.  I would hope by the time GCC 7 exits
stage1 that these switches will be removed, but having them now will allow us
to move to LRA and __float128 in an orderly fashion.

I built a bootstrap compiler using the --enable-powerpc-lra option, and it ran
fine.  There were two additional tests that generate different code with -mlra
and now fail.  These will be fixed in later patches.

I also built a C only compiler using the --enable-powerpc-float128 option
(disabling libquadmath and bootstrap), and the C tests looked fine.

Can I install these patches in the trunk?

2016-07-20  Michael Meissner  <meissner@linux.vnet.ibm.com>

	* doc/install.texi (Configuration): Document PowerPC specific
	configuration options --enable-powerpc-lra and
	--enable-powerpc-float128.
	* configure.ac: Add support for the configuration option
	--enable-powerpc-lra to enable the use of the LRA register
	allocator by default.  Add support for the configuration option
	--enable-powerpc-float128 to enable the use of the __float128 type
	in PowerPC Linux systems.
	* configure: Regenerate.
	* config.gcc (powerpc*-*-linux*): Add --enable-powerpc-lra and
	--enable-powerpc-float128 support.
	* config/rs6000/rs6000.c (rs6000_option_override_internal): Add
	support for --enable-powerpc-lra and --enable-powerpc-float128.
diff mbox

Patch

Index: gcc/config/rs6000/rs6000.c
===================================================================
--- gcc/config/rs6000/rs6000.c	(.../svn+ssh://meissner@gcc.gnu.org/svn/gcc/trunk/gcc/config/rs6000)	(revision 238445)
+++ gcc/config/rs6000/rs6000.c	(.../gcc/config/rs6000)	(working copy)
@@ -4306,6 +4306,17 @@  rs6000_option_override_internal (bool gl
       rs6000_isa_flags &= ~OPTION_MASK_P9_DFORM_SCALAR;
     }
 
+  /* Enable LRA if the compiler was configured with --enable-lra.  */
+#ifdef ENABLE_LRA
+  if ((rs6000_isa_flags_explicit & OPTION_MASK_LRA) == 0)
+    {
+      if (ENABLE_LRA)
+	rs6000_isa_flags |= OPTION_MASK_LRA;
+      else
+	rs6000_isa_flags &= ~OPTION_MASK_LRA;
+    }
+#endif
+
   /* There have been bugs with -mvsx-timode that don't show up with -mlra,
      but do show up with -mno-lra.  Given -mlra will become the default once
      PR 69847 is fixed, turn off the options with problems by default if
@@ -4372,6 +4383,17 @@  rs6000_option_override_internal (bool gl
 	}
     }
 
+  /* Enable FLOAT128 if the compiler was configured with --enable-float128.  */
+#ifdef ENABLE_FLOAT128
+  if (TARGET_VSX && (rs6000_isa_flags_explicit & OPTION_MASK_FLOAT128) == 0)
+    {
+      if (ENABLE_FLOAT128)
+	rs6000_isa_flags |= OPTION_MASK_FLOAT128;
+      else
+	rs6000_isa_flags &= ~(OPTION_MASK_FLOAT128 | OPTION_MASK_FLOAT128_HW);
+    }
+#endif
+
   /* __float128 requires VSX support.  */
   if (TARGET_FLOAT128 && !TARGET_VSX)
     {
Index: gcc/doc/install.texi
===================================================================
--- gcc/doc/install.texi	(.../svn+ssh://meissner@gcc.gnu.org/svn/gcc/trunk/gcc/doc)	(revision 238445)
+++ gcc/doc/install.texi	(.../gcc/doc)	(working copy)
@@ -1661,6 +1661,35 @@  Using the GNU Compiler Collection (GCC)}
 See ``RS/6000 and PowerPC Options'' in the main manual
 @end ifhtml
 
+@item --enable-powerpc-lra
+This option enables @option{-mlra} by default for powerpc-linux.  This
+switch is a temporary configuration switch that is intended to allow
+for the transition from the reload register allocator to the newer lra
+register allocator.  When the transition is complete, this switch
+may be deleted.
+@ifnothtml
+@xref{RS/6000 and PowerPC Options,, RS/6000 and PowerPC Options, gcc,
+Using the GNU Compiler Collection (GCC)},
+@end ifnothtml
+@ifhtml
+See ``RS/6000 and PowerPC Options'' in the main manual
+@end ifhtml
+
+@item --enable-powerpc-float128
+This option enables @option{-mfloat128} by default for powerpc-linux.
+This switch is a temporary configuation switch that is intended to
+allow the PowerPC GCC developers to work on implementing library
+support for PowerPC IEEE 128-bit floating point functions.  When the
+standard GCC libraries are enhanced to support @code{__float128} by
+default, this switch may be deleted.
+@ifnothtml
+@xref{RS/6000 and PowerPC Options,, RS/6000 and PowerPC Options, gcc,
+Using the GNU Compiler Collection (GCC)},
+@end ifnothtml
+@ifhtml
+See ``RS/6000 and PowerPC Options'' in the main manual
+@end ifhtml
+
 @item --enable-default-ssp
 Turn on @option{-fstack-protector-strong} by default.