public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH} rs6000: Enable PC-relative by default and test
@ 2019-05-23 21:15 Bill Schmidt
  2019-05-24  8:49 ` Segher Boessenkool
  0 siblings, 1 reply; 2+ messages in thread
From: Bill Schmidt @ 2019-05-23 21:15 UTC (permalink / raw)
  To: GCC Patches; +Cc: Segher Boessenkool

Hi,

This is a short patch that enables PC-relative support by default, and provides a
test case to ensure that the correct .localentry name,1 directive is produced iff
PC-relative support is enabled.

Bootstrapped and tested on powerpc64le-unknown-linux-gnu.  Okay for trunk?

Thanks,
Bill


[gcc]

2019-05-23  Bill Schmidt  <wschmidt@linux.ibm.com>
	    Michael Meissner  <meissner@linux.ibm.com>

	* config/rs6000/rs6000-cpus.def (OTHER_FUTURES_MASK): New #define.

[gcc/testsuite]

2019-05-23  Bill Schmidt  <wschmidt@linux.ibm.com>

	* gcc.target/powerpc/pcrel-detect-1.c: New file.


diff --git a/gcc/config/rs6000/rs6000-cpus.def b/gcc/config/rs6000/rs6000-cpus.def
index 64292c923e6..5337382bdcf 100644
--- a/gcc/config/rs6000/rs6000-cpus.def
+++ b/gcc/config/rs6000/rs6000-cpus.def
@@ -77,6 +77,9 @@
 				 | OPTION_MASK_FUTURE			\
 				 | OPTION_MASK_PCREL)
 
+/* Flags that need to be turned off if -mno-future.  */
+#define OTHER_FUTURE_MASKS	(OPTION_MASK_PCREL)
+
 /* Flags that need to be turned off if -mno-power9-vector.  */
 #define OTHER_P9_VECTOR_MASKS	(OPTION_MASK_FLOAT128_HW		\
 				 | OPTION_MASK_P9_MINMAX)
diff --git a/gcc/testsuite/gcc.target/powerpc/pcrel-detect-1.c b/gcc/testsuite/gcc.target/powerpc/pcrel-detect-1.c
new file mode 100644
index 00000000000..8e0e9053dc7
--- /dev/null
+++ b/gcc/testsuite/gcc.target/powerpc/pcrel-detect-1.c
@@ -0,0 +1,12 @@
+/* { dg-do compile { target { powerpc*-*-* } } } */
+/* { dg-require-effective-target powerpc_elfv2 } */
+/* { dg-options "-O3 -mdejagnu-cpu=future" } */
+
+
+int localentry1 () { return 5; }
+
+#pragma GCC target ("cpu=power9")
+int localentry2 () { return 5; }
+
+/* { dg-final { scan-assembler {\.localentry\tlocalentry1,1\M} } } */
+/* { dg-final { scan-assembler-not {\.localentry\tlocalentry2,1\M} } } */

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH} rs6000: Enable PC-relative by default and test
  2019-05-23 21:15 [PATCH} rs6000: Enable PC-relative by default and test Bill Schmidt
@ 2019-05-24  8:49 ` Segher Boessenkool
  0 siblings, 0 replies; 2+ messages in thread
From: Segher Boessenkool @ 2019-05-24  8:49 UTC (permalink / raw)
  To: Bill Schmidt; +Cc: GCC Patches

Hi,

On Thu, May 23, 2019 at 04:15:26PM -0500, Bill Schmidt wrote:
> This is a short patch that enables PC-relative support by default, and provides a
> test case to ensure that the correct .localentry name,1 directive is produced iff
> PC-relative support is enabled.

> 2019-05-23  Bill Schmidt  <wschmidt@linux.ibm.com>
> 
> 	* gcc.target/powerpc/pcrel-detect-1.c: New file.

That's a very strange file name for what it tests, then.  Improve it?

> diff --git a/gcc/testsuite/gcc.target/powerpc/pcrel-detect-1.c b/gcc/testsuite/gcc.target/powerpc/pcrel-detect-1.c
> new file mode 100644
> index 00000000000..8e0e9053dc7
> --- /dev/null
> +++ b/gcc/testsuite/gcc.target/powerpc/pcrel-detect-1.c
> @@ -0,0 +1,12 @@
> +/* { dg-do compile { target { powerpc*-*-* } } } */

Just

/* { dg-do compile } */

is enough.

> +/* { dg-require-effective-target powerpc_elfv2 } */
> +/* { dg-options "-O3 -mdejagnu-cpu=future" } */

Please use -O2 if there is not specific reason for -O3.

Okay with those things fixed somehow.  Thanks,


Segher

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2019-05-24  8:49 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-05-23 21:15 [PATCH} rs6000: Enable PC-relative by default and test Bill Schmidt
2019-05-24  8:49 ` Segher Boessenkool

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).