diff mbox

[rs6000] Add support for HAVE_AS_POWER9

Message ID 57689581.7090307@linux.vnet.ibm.com
State New
Headers show

Commit Message

Kelvin Nilsen June 21, 2016, 1:16 a.m. UTC
A "#define HAVE_AS_POWER9" or "#undef HAVE_AS_POWER9" preprocessor
directive is emitted into the $GCC_BUILD/gcc/auto-host.h file at
configuration time, depending on whether the available assembler
supports the Power9 instruction set.  This patch arranges to disable
Power9-specific compiler features if HAVE_AS_POWER9 is not defined.

The patch includes code to modify the behavior of the compiler along with
directives to adjust the treatment of certain dejagnu tests.  Disable
the Power9-specific tests on aix because of known incompatibilities.

This patch has bootstrapped and regression tested on
powerpc64le-unknown-linux-gnu with both a configuration that has a
Power9 assembler and one that does not have a Power9 assembler.  In
both cases, there were no regressions.  Is this ok for the trunk?  Is
this patch ok for gcc-6 after a few days of burn-in on the trunk?

Thanks.

gcc/ChangeLog:

2016-06-20  Kelvin Nilsen  <kelvin@gcc.gnu.org>

	* config/rs6000/rs6000.h: Add conditional preprocessing directives
	to disable Power9-specific compiler features if HAVE_AS_POWER9 is
	not defined.

gcc/testsuite/ChangeLog:

2016-06-20  Kelvin Nilsen  <kelvin@gcc.gnu.org>

	* gcc.target/powerpc/darn-0.c: Add dejagnu directives to disable
	test if effective-target is not powerpc_p9vector_ok, or if a -mcpu
	override other than -mcpu=power9 command-line option is specified,
	or if the target operating system is aix.
	* gcc.target/powerpc/darn-1.c: Likewise.
	* gcc.target/powerpc/darn-2.c: Likewise.
	* gcc.target/powerpc/vslv-0.c: Add dejagnu directives to disable
	test if effective-target is not powerpc_p9vector_ok or if the
	target operating system is not defined.
	* gcc.target/powerpc/vslv-1.c: Likewise.
	* gcc.target/powerpc/vsrv-0.c: Likewise.
	* gcc.target/powerpc/vsrv-1.c: Likewise.

Comments

Segher Boessenkool June 21, 2016, 2:06 p.m. UTC | #1
On Mon, Jun 20, 2016 at 07:16:49PM -0600, Kelvin Nilsen wrote:
> A "#define HAVE_AS_POWER9" or "#undef HAVE_AS_POWER9" preprocessor
> directive is emitted into the $GCC_BUILD/gcc/auto-host.h file at
> configuration time, depending on whether the available assembler
> supports the Power9 instruction set.  This patch arranges to disable
> Power9-specific compiler features if HAVE_AS_POWER9 is not defined.
> 
> The patch includes code to modify the behavior of the compiler along with
> directives to adjust the treatment of certain dejagnu tests.  Disable
> the Power9-specific tests on aix because of known incompatibilities.
> 
> This patch has bootstrapped and regression tested on
> powerpc64le-unknown-linux-gnu with both a configuration that has a
> Power9 assembler and one that does not have a Power9 assembler.  In
> both cases, there were no regressions.  Is this ok for the trunk?  Is
> this patch ok for gcc-6 after a few days of burn-in on the trunk?

Okay for trunk, okay for 6 after a week.  Thanks,


Segher
diff mbox

Patch

Index: gcc/config/rs6000/rs6000.h
===================================================================
--- gcc/config/rs6000/rs6000.h	(revision 237530)
+++ gcc/config/rs6000/rs6000.h	(working copy)
@@ -302,6 +302,26 @@  extern const char *host_detect_local_cpu (int argc
 #define TARGET_P8_VECTOR 0
 #endif
 
+/* Define the ISA 3.0 flags as 0 if the target assembler does not support
+   Power9 instructions.  Allow -mpower9-fusion, since it does not add new
+   instructions.  Allow -misel, since it predates ISA 3.0 and does
+   not require any Power9 features.  */
+
+#ifndef HAVE_AS_POWER9
+#undef  TARGET_FLOAT128_HW
+#undef  TARGET_MODULO
+#undef  TARGET_P9_VECTOR
+#undef  TARGET_P9_MINMAX
+#undef  TARGET_P9_DFORM_SCALAR
+#undef  TARGET_P9_DFORM_VECTOR
+#define TARGET_FLOAT128_HW 0
+#define TARGET_MODULO 0
+#define TARGET_P9_VECTOR 0
+#define TARGET_P9_MINMAX 0
+#define TARGET_P9_DFORM_SCALAR 0
+#define TARGET_P9_DFORM_VECTOR 0
+#endif
+
 /* Define TARGET_LWSYNC_INSTRUCTION if the assembler knows about lwsync.  If
    not, generate the lwsync code as an integer constant.  */
 #ifdef HAVE_AS_LWSYNC
Index: gcc/testsuite/gcc.target/powerpc/darn-0.c
===================================================================
--- gcc/testsuite/gcc.target/powerpc/darn-0.c	(revision 237530)
+++ gcc/testsuite/gcc.target/powerpc/darn-0.c	(working copy)
@@ -1,4 +1,7 @@ 
 /* { dg-do compile { target { powerpc*-*-* } } } */
+/* { dg-skip-if "do not override -mcpu" { powerpc*-*-* } { "-mcpu=*" } { "-mcpu=power9" } } */
+/* { dg-require-effective-target powerpc_p9vector_ok } */
+/* { dg-skip-if "" { powerpc*-*-aix* } } */
 /* { dg-options "-mcpu=power9" } */
 
 /* This test should succeed on both 32- and 64-bit configurations.  */
Index: gcc/testsuite/gcc.target/powerpc/darn-1.c
===================================================================
--- gcc/testsuite/gcc.target/powerpc/darn-1.c	(revision 237530)
+++ gcc/testsuite/gcc.target/powerpc/darn-1.c	(working copy)
@@ -1,6 +1,9 @@ 
 /* { dg-do compile { target { powerpc*-*-* } } } */
+/* { dg-skip-if "do not override -mcpu" { powerpc*-*-* } { "-mcpu=*" } { "-mcpu=power9" } } */
+/* { dg-require-effective-target powerpc_p9vector_ok } */
+/* { dg-require-effective-target lp64 } */
+/* { dg-skip-if "" { powerpc*-*-aix* } } */
 /* { dg-options "-mcpu=power9" } */
-/* { dg-require-effective-target lp64 } */
 
 #include <altivec.h>
 
Index: gcc/testsuite/gcc.target/powerpc/darn-2.c
===================================================================
--- gcc/testsuite/gcc.target/powerpc/darn-2.c	(revision 237530)
+++ gcc/testsuite/gcc.target/powerpc/darn-2.c	(working copy)
@@ -1,6 +1,9 @@ 
 /* { dg-do compile { target { powerpc*-*-* } } } */
+/* { dg-skip-if "do not override -mcpu" { powerpc*-*-* } { "-mcpu=*" } { "-mcpu=power9" } } */
+/* { dg-require-effective-target powerpc_p9vector_ok } */
+/* { dg-require-effective-target lp64 } */
+/* { dg-skip-if "" { powerpc*-*-aix* } } */
 /* { dg-options "-mcpu=power9" } */
-/* { dg-require-effective-target lp64 } */
 
 #include <altivec.h>
 
Index: gcc/testsuite/gcc.target/powerpc/vslv-0.c
===================================================================
--- gcc/testsuite/gcc.target/powerpc/vslv-0.c	(revision 237530)
+++ gcc/testsuite/gcc.target/powerpc/vslv-0.c	(working copy)
@@ -1,5 +1,7 @@ 
 /* { dg-do compile { target { powerpc*-*-* } } } */
 /* { dg-skip-if "do not override -mcpu" { powerpc*-*-* } { "-mcpu=*" } { "-mcpu=power9" } } */
+/* { dg-require-effective-target powerpc_p9vector_ok } */
+/* { dg-skip-if "" { powerpc*-*-aix* } } */
 /* { dg-options "-mcpu=power9" } */
 
 #include <altivec.h>
Index: gcc/testsuite/gcc.target/powerpc/vslv-1.c
===================================================================
--- gcc/testsuite/gcc.target/powerpc/vslv-1.c	(revision 237530)
+++ gcc/testsuite/gcc.target/powerpc/vslv-1.c	(working copy)
@@ -1,5 +1,7 @@ 
 /* { dg-do compile { target { powerpc*-*-* } } } */
 /* { dg-skip-if "do not override -mcpu" { powerpc*-*-* } { "-mcpu=*" } { "-mcpu=power9" } } */
+/* { dg-require-effective-target powerpc_p9vector_ok } */
+/* { dg-skip-if "" { powerpc*-*-aix* } } */
 /* { dg-options "-mcpu=power9" } */
 
 #include <altivec.h>
Index: gcc/testsuite/gcc.target/powerpc/vsrv-0.c
===================================================================
--- gcc/testsuite/gcc.target/powerpc/vsrv-0.c	(revision 237530)
+++ gcc/testsuite/gcc.target/powerpc/vsrv-0.c	(working copy)
@@ -1,5 +1,7 @@ 
 /* { dg-do compile { target { powerpc*-*-* } } } */
 /* { dg-skip-if "do not override -mcpu" { powerpc*-*-* } { "-mcpu=*" } { "-mcpu=power9" } } */
+/* { dg-require-effective-target powerpc_p9vector_ok } */
+/* { dg-skip-if "" { powerpc*-*-aix* } } */
 /* { dg-options "-mcpu=power9" } */
 
 #include <altivec.h>
Index: gcc/testsuite/gcc.target/powerpc/vsrv-1.c
===================================================================
--- gcc/testsuite/gcc.target/powerpc/vsrv-1.c	(revision 237530)
+++ gcc/testsuite/gcc.target/powerpc/vsrv-1.c	(working copy)
@@ -1,5 +1,7 @@ 
 /* { dg-do compile { target { powerpc*-*-* } } } */
 /* { dg-skip-if "do not override -mcpu" { powerpc*-*-* } { "-mcpu=*" } { "-mcpu=power9" } } */
+/* { dg-require-effective-target powerpc_p9vector_ok } */
+/* { dg-skip-if "" { powerpc*-*-aix* } } */
 /* { dg-options "-mcpu=power9" } */
 
 #include <altivec.h>