This patch changes the default options enabled for the PowerPC -mcpu=power9
option to include the undocumented -mpower9-minmax option.  This option enables
MIN/MAX instructions that do not require -ffast-math or -fhonor-nans.

I also changed the minimum option requirements for IEEE 128-bit floating point
to include the VSX small integer support (which is now on by default).
Strictly speaking, this isn't needed by the current code, but it will be needed
in the future when PR target/79038 is addressed.  Since the option is on by
default, it would only be an issue if some of the debug options were used.

Finally, I noticed that the float128-hw.c test was not being run, since it
required IEEE 128-bit floating point hardware.  This test just tests the
assembler output, so I changed it to just require the ISA 3.0 assembler.

I bootstrapped with these changes on a big endian power8 system.  There were no
regressions in the runs.  I verified that the float128-hw.c test is now run.
Can I check these changes into the trunk?

[gcc]
2017-01-18  Michael Meissner  <meiss...@linux.vnet.ibm.com>

        * config/rs6000/rs6000-cpus.def (ISA_3_0_MASKS_SERVER): Enable
        -mpower9-minmax by default for -mcpu=power9.
        (ISA_3_MASKS_IEEE): Require -mvsx-small-integer to enable IEEE
        128-bit floating point.

[gcc/testsuite]
2017-01-18  Michael Meissner  <meiss...@linux.vnet.ibm.com>

        * gcc.target/powerpc/float128-hw.c: Do not require IEEE 128-bit
        floating point hardware to run test.


-- 
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/config/rs6000/rs6000-cpus.def
===================================================================
--- gcc/config/rs6000/rs6000-cpus.def   (revision 244605)
+++ gcc/config/rs6000/rs6000-cpus.def   (working copy)
@@ -62,7 +62,6 @@
                                 | OPTION_MASK_VSX_SMALL_INTEGER)
 
 /* Add ISEL back into ISA 3.0, since it is supposed to be a win.  Do not add
-   P9_MINMAX until the hardware that supports it is available.  Do not add
    FLOAT128_HW here until we are ready to make -mfloat128 on by default.  */
 #define ISA_3_0_MASKS_SERVER   (ISA_2_7_MASKS_SERVER                   \
                                 | OPTION_MASK_ISEL                     \
@@ -70,6 +69,7 @@
                                 | OPTION_MASK_P9_FUSION                \
                                 | OPTION_MASK_P9_DFORM_SCALAR          \
                                 | OPTION_MASK_P9_DFORM_VECTOR          \
+                                | OPTION_MASK_P9_MINMAX                \
                                 | OPTION_MASK_P9_MISC                  \
                                 | OPTION_MASK_P9_VECTOR)
 
@@ -81,7 +81,8 @@
                                 | OPTION_MASK_DIRECT_MOVE              \
                                 | OPTION_MASK_UPPER_REGS_DI            \
                                 | OPTION_MASK_UPPER_REGS_DF            \
-                                | OPTION_MASK_UPPER_REGS_SF)
+                                | OPTION_MASK_UPPER_REGS_SF            \
+                                | OPTION_MASK_VSX_SMALL_INTEGER)
 
 #define POWERPC_7400_MASK      (OPTION_MASK_PPC_GFXOPT | OPTION_MASK_ALTIVEC)
 
Index: gcc/testsuite/gcc.target/powerpc/float128-hw.c
===================================================================
--- gcc/testsuite/gcc.target/powerpc/float128-hw.c      (revision 244605)
+++ gcc/testsuite/gcc.target/powerpc/float128-hw.c      (working copy)
@@ -1,7 +1,7 @@
 /* { dg-do compile { target { powerpc*-*-* && lp64 } } } */
-/* { dg-require-effective-target powerpc_float128_hw_ok } */
+/* { dg-require-effective-target powerpc_p9vector_ok } */
 /* { dg-skip-if "do not override -mcpu" { powerpc*-*-* } { "-mcpu=*" } { 
"-mcpu=power9" } } */
-/* { dg-options "-mcpu=power9 -O2" } */
+/* { dg-options "-mcpu=power9 -O2 -mfloat128" } */
 
 __float128 f128_add (__float128 a, __float128 b) { return a+b; }
 __float128 f128_sub (__float128 a, __float128 b) { return a-b; }

Reply via email to