Sigh, I keep forgetting to attach the patch.

2016-07-11  Michael Meissner  <meiss...@linux.vnet.ibm.com>

        * doc/install.texi (Configuration): Document PowerPC specific
        configuration options --enable-lra and --enable-float128.
        * configure.ac: Add --enable-lra and --enable-float128 to turn on
        -mlra and -mfloat128 by default in the PowerPC compiler.
        * configure: Regenerate.
        * config.gcc (powerpc*-*-linux*): Add --enable-lra and
        --enable-float128 support.
        * config/rs6000/rs6000.c (rs6000_option_override_internal): Add
        support for --enable-lra and --enable-float128.

-- 
Michael Meissner, IBM
IBM, M/S 2506R, 550 King Street, Littleton, MA 01460-6245, USA
email: meiss...@linux.vnet.ibm.com, phone: +1 (978) 899-4797
Index: gcc/doc/install.texi
===================================================================
--- gcc/doc/install.texi        (revision 238170)
+++ gcc/doc/install.texi        (working copy)
@@ -1661,6 +1661,26 @@ Using the GNU Compiler Collection (GCC)}
 See ``RS/6000 and PowerPC Options'' in the main manual
 @end ifhtml
 
+@item --enable-lra
+This option enables @option{-mlra} by default for powerpc-linux.
+@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-float128
+This option enables @option{-mfloat128} by default for powerpc-linux.
+@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.
 
Index: gcc/configure
===================================================================
--- gcc/configure       (revision 238170)
+++ gcc/configure       (working copy)
@@ -918,6 +918,8 @@ enable_rpath
 with_libiconv_prefix
 enable_sjlj_exceptions
 enable_secureplt
+enable_lra
+enable_float128
 enable_leading_mingw64_underscores
 enable_cld
 enable_frame_pointer
@@ -1630,6 +1632,9 @@ Optional Features:
   --enable-sjlj-exceptions
                           arrange to use setjmp/longjmp exception handling
   --enable-secureplt      enable -msecure-plt by default for PowerPC
+  --enable-lra            enable -mlra by default for PowerPC
+  --enable-float128       enable -mfloat128 by default for PowerPC on Linux
+                          VSX systems
   --enable-leading-mingw64-underscores
                           enable leading underscores on 64 bit mingw targets
   --enable-cld            enable -mcld by default for 32bit x86
@@ -11984,6 +11989,18 @@ if test "${enable_secureplt+set}" = set;
 fi
 
 
+# Check whether --enable-lra was given.
+if test "${enable_lra+set}" = set; then :
+  enableval=$enable_lra;
+fi
+
+
+# Check whether --enable-float128 was given.
+if test "${enable_float128+set}" = set; then :
+  enableval=$enable_float128;
+fi
+
+
 # Check whether --enable-leading-mingw64-underscores was given.
 if test "${enable_leading_mingw64_underscores+set}" = set; then :
   enableval=$enable_leading_mingw64_underscores;
@@ -18475,7 +18492,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-#line 18478 "configure"
+#line 18495 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
@@ -18581,7 +18598,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-#line 18584 "configure"
+#line 18601 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
Index: gcc/configure.ac
===================================================================
--- gcc/configure.ac    (revision 238170)
+++ gcc/configure.ac    (working copy)
@@ -1798,6 +1798,17 @@ AC_ARG_ENABLE(secureplt,
                [enable -msecure-plt by default for PowerPC])],
 [], [])
 
+AC_ARG_ENABLE(lra,
+[AS_HELP_STRING([--enable-lra],
+               [enable -mlra by default for PowerPC])],
+[], [])
+
+AC_ARG_ENABLE(float128,
+[AS_HELP_STRING([--enable-float128],
+               [enable -mfloat128 by default for PowerPC on Linux VSX
+                systems])],
+[], [])
+
 AC_ARG_ENABLE(leading-mingw64-underscores,
   AS_HELP_STRING([--enable-leading-mingw64-underscores],
                  [enable leading underscores on 64 bit mingw targets]),
Index: gcc/config.gcc
===================================================================
--- gcc/config.gcc      (revision 238170)
+++ gcc/config.gcc      (working copy)
@@ -2414,6 +2414,12 @@ powerpc*-*-linux*)
        if test x${enable_secureplt} = xyes; then
                tm_file="rs6000/secureplt.h ${tm_file}"
        fi
+       if test x${enable_lra} = xyes; then
+           tm_defines="${tm_defines} ENABLE_LRA=1"
+       fi
+       if test x${enable_float128} = xyes; then
+           tm_defines="${tm_defines} ENABLE_FLOAT128=1"
+       fi
        ;;
 powerpc-wrs-vxworks|powerpc-wrs-vxworksae|powerpc-wrs-vxworksmils)
        tm_file="${tm_file} elfos.h freebsd-spec.h rs6000/sysv4.h"
Index: gcc/config/rs6000/rs6000.c
===================================================================
--- gcc/config/rs6000/rs6000.c  (revision 238170)
+++ gcc/config/rs6000/rs6000.c  (working copy)
@@ -4306,6 +4306,17 @@ rs6000_option_override_internal (bool gl
       rs6000_isa_flags &= ~OPTION_MASK_P9_VECTOR;
     }
 
+  /* 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)
     {

Reply via email to