rs6000: Disable -m[no-]direct-move (PR85293)

Message ID bc1dbabbc9085cb04b2a4499c811a9187cc9dc01.1523662330.git.segher@kernel.crashing.org
State New
Headers show
Series
  • rs6000: Disable -m[no-]direct-move (PR85293)
Related show

Commit Message

Segher Boessenkool April 13, 2018, 11:48 p.m.
The -mno-direct-move option causes a lot of problems, since it forces
us to be able to generate code for p8 and up with some crucial
instructions missing.  This patch removes the -m[no-]direct-move
options so that the user cannot put us into this unexpected situation
anymore.  Internally we still have all the same flags, and they are
automatically set based on -mcpu; getting rid of that is a lot more
work and will have to wait for GCC 9 (in some places the flag is used
to see if we are compiling for a p8 _at all_).

Tested on powerpc64-linux {-m32,-m64}.  Will also test on a p9 before
committing.


Segher


2018-04-13  Segher Boessenkool  <segher@kernel.crashing.org>

	PR target/85293
	* config/rs6000/rs6000.opt (mdirect-move): Make deprecated.
	* doc/invoke.texi (RS/6000 and PowerPC Options): Remove -mdirect-move
	and -mno-direct-move.

gcc/testsuite/
	PR target/85293
	* gcc.target/powerpc/pr80098-2.c: Remove -mdirect-move.  Remove the
	corresponding dg-error clause.
	* gcc.target/powerpc/pr80098-3.c: Ditto.
	* gcc.target/powerpc/pr80103-1.c: Delete.

---
 gcc/config/rs6000/rs6000.opt                 |  3 +--
 gcc/doc/invoke.texi                          | 12 ++----------
 gcc/testsuite/gcc.target/powerpc/pr80098-2.c |  3 +--
 gcc/testsuite/gcc.target/powerpc/pr80098-3.c |  3 +--
 gcc/testsuite/gcc.target/powerpc/pr80103-1.c | 15 ---------------
 5 files changed, 5 insertions(+), 31 deletions(-)
 delete mode 100644 gcc/testsuite/gcc.target/powerpc/pr80103-1.c

Patch

diff --git a/gcc/config/rs6000/rs6000.opt b/gcc/config/rs6000/rs6000.opt
index 596f3fb..bbe3a64 100644
--- a/gcc/config/rs6000/rs6000.opt
+++ b/gcc/config/rs6000/rs6000.opt
@@ -534,8 +534,7 @@  Target Report Mask(CRYPTO) Var(rs6000_isa_flags)
 Use ISA 2.07 Category:Vector.AES and Category:Vector.SHA2 instructions.
 
 mdirect-move
-Target Report Mask(DIRECT_MOVE) Var(rs6000_isa_flags)
-Use ISA 2.07 direct move between GPR & VSX register instructions.
+Target Undocumented Mask(DIRECT_MOVE) Var(rs6000_isa_flags) Ignore Warn(%qs is deprecated)
 
 mhtm
 Target Report Mask(HTM) Var(rs6000_isa_flags)
diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi
index a8e2672..70896f7 100644
--- a/gcc/doc/invoke.texi
+++ b/gcc/doc/invoke.texi
@@ -1095,7 +1095,7 @@  See RS/6000 and PowerPC Options.
 -mpointers-to-nested-functions  -mno-pointers-to-nested-functions @gol
 -msave-toc-indirect  -mno-save-toc-indirect @gol
 -mpower8-fusion  -mno-mpower8-fusion  -mpower8-vector  -mno-power8-vector @gol
--mcrypto  -mno-crypto  -mhtm  -mno-htm  -mdirect-move  -mno-direct-move @gol
+-mcrypto  -mno-crypto  -mhtm  -mno-htm @gol
 -mquad-memory  -mno-quad-memory @gol
 -mquad-memory-atomic  -mno-quad-memory-atomic @gol
 -mcompat-align-parm  -mno-compat-align-parm @gol
@@ -23353,7 +23353,7 @@  following options:
 -mpopcntb -mpopcntd  -mpowerpc64 @gol
 -mpowerpc-gpopt  -mpowerpc-gfxopt  -msingle-float -mdouble-float @gol
 -msimple-fpu  -mmulhw  -mdlmzb  -mmfpgpr -mvsx @gol
--mcrypto -mdirect-move -mhtm -mpower8-fusion -mpower8-vector @gol
+-mcrypto -mhtm -mpower8-fusion -mpower8-vector @gol
 -mquad-memory -mquad-memory-atomic -mfloat128 -mfloat128-hardware}
 
 The particular options set for any particular CPU varies between
@@ -23495,14 +23495,6 @@  Enable the use (disable) of the built-in functions that allow direct
 access to the cryptographic instructions that were added in version
 2.07 of the PowerPC ISA.
 
-@item -mdirect-move
-@itemx -mno-direct-move
-@opindex mdirect-move
-@opindex mno-direct-move
-Generate code that uses (does not use) the instructions to move data
-between the general purpose registers and the vector/scalar (VSX)
-registers that were added in version 2.07 of the PowerPC ISA.
-
 @item -mhtm
 @itemx -mno-htm
 @opindex mhtm
diff --git a/gcc/testsuite/gcc.target/powerpc/pr80098-2.c b/gcc/testsuite/gcc.target/powerpc/pr80098-2.c
index 88f7ee4..5a6421b 100644
--- a/gcc/testsuite/gcc.target/powerpc/pr80098-2.c
+++ b/gcc/testsuite/gcc.target/powerpc/pr80098-2.c
@@ -1,9 +1,8 @@ 
 /* { dg-do compile { target { powerpc64*-*-* } } } */
 /* { dg-skip-if "do not override -mcpu" { powerpc*-*-* } { "-mcpu=*" } { "-mcpu=power8" } } */
 /* { dg-require-effective-target powerpc_p8vector_ok } */
-/* { dg-options "-mcpu=power8 -mno-power8-vector -mdirect-move -mcrypto" } */
+/* { dg-options "-mcpu=power8 -mno-power8-vector -mcrypto" } */
 
 int i;
 
-/* { dg-error "'-mno-power8-vector' turns off '-mdirect-move'" "PR80098" { target *-*-* } 0 } */
 /* { dg-error "'-mno-power8-vector' turns off '-mcrypto'"      "PR80098" { target *-*-* } 0 } */
diff --git a/gcc/testsuite/gcc.target/powerpc/pr80098-3.c b/gcc/testsuite/gcc.target/powerpc/pr80098-3.c
index aae8fa1..e62418b 100644
--- a/gcc/testsuite/gcc.target/powerpc/pr80098-3.c
+++ b/gcc/testsuite/gcc.target/powerpc/pr80098-3.c
@@ -1,9 +1,8 @@ 
 /* { dg-do compile { target { powerpc64*-*-* } } } */
 /* { dg-skip-if "do not override -mcpu" { powerpc*-*-* } { "-mcpu=*" } { "-mcpu=power7" } } */
 /* { dg-require-effective-target powerpc_vsx_ok } */
-/* { dg-options "-mcpu=power7 -mno-vsx -mdirect-move -mcrypto" } */
+/* { dg-options "-mcpu=power7 -mno-vsx -mcrypto" } */
 
 int i;
 
-/* { dg-error "'-mno-vsx' turns off '-mdirect-move'" "PR80098" { target *-*-* } 0 } */
 /* { dg-error "'-mno-vsx' turns off '-mcrypto'"      "PR80098" { target *-*-* } 0 } */
diff --git a/gcc/testsuite/gcc.target/powerpc/pr80103-1.c b/gcc/testsuite/gcc.target/powerpc/pr80103-1.c
deleted file mode 100644
index a25d617..0000000
--- a/gcc/testsuite/gcc.target/powerpc/pr80103-1.c
+++ /dev/null
@@ -1,15 +0,0 @@ 
-/* { dg-do compile { target { powerpc*-*-* } } } */
-/* { dg-skip-if "do not override -mcpu" { powerpc*-*-* } { "-mcpu=*" } { "-mcpu=power9" } } */
-/* { dg-require-effective-target powerpc_p9vector_ok } */
-/* { dg-options "-mpower9-minmax -mno-direct-move" } */
-/* { dg-excess-errors "expect error due to conflicting target options" } */
-/* Since the error message is not associated with a particular line
-   number, we cannot use the dg-error directive and cannot specify a
-   regexp to describe the expected error message.  The expected error
-   message is: "-mpower9-minmax requires -mdirect-move" */
-
-int a;
-void b (__attribute__ ((__vector_size__ (16))) char c)
-{
-  a = ((__attribute__ ((__vector_size__ (2 * sizeof (long)))) long) c)[0];
-}