public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH] Fix --with-tune{,-32,-64} on powerpc
@ 2009-10-14 17:49 Jakub Jelinek
  2009-10-14 22:38 ` David Edelsohn
  0 siblings, 1 reply; 2+ messages in thread
From: Jakub Jelinek @ 2009-10-14 17:49 UTC (permalink / raw)
  To: David Edelsohn; +Cc: gcc-patches

Hi!

I've noticed that --with-cpu=default32 --with-cpu-32=power4 \
--with-cpu-64=power4 --with-tune-32=power6 --with-tune-64=power6
configured gcc behaves differently from just --with-cpu=default32 configured
one when
gcc test.c -mcpu=power5
is used, which is certainly unexpected.  I believe we say in many places
that when -mtune= isn't used, but -mcpu= is (s/cpu/arch/ for x86_64 etc.),
then tuning is done for the explicitly chosen CPU ISA.
It seems i386/x86_64 does this right, since Honza's fix from mid 2003.

Other targets might need similar changes.

Ok for trunk?

2009-10-14  Jakub Jelinek  <jakub@redhat.com>

	* config/rs6000/option-defaults.h (OPTION_DEFAULT_SPECS): Don't
	add --with-tune{,-32,-64} configured default for -mtune if explicit
	-mcpu is used.

--- gcc/config/rs6000/option-defaults.h.jj	2009-06-02 18:36:50.000000000 +0200
+++ gcc/config/rs6000/option-defaults.h	2009-10-14 18:28:50.134723716 +0200
@@ -50,15 +50,15 @@
 /* Support for a compile-time default CPU, et cetera.  The rules are:
    --with-cpu is ignored if -mcpu is specified; likewise --with-cpu-32
      and --with-cpu-64.
-   --with-tune is ignored if -mtune is specified; likewise --with-tune-32
-     and --with-tune-64.
+   --with-tune is ignored if -mtune or -mcpu is specified; likewise
+     --with-tune-32 and --with-tune-64.
    --with-float is ignored if -mhard-float or -msoft-float are
-    specified.  */
+     specified.  */
 #define OPTION_DEFAULT_SPECS \
+  {"tune", "%{!mtune=*:%{!mcpu=*:-mtune=%(VALUE)}}" }, \
+  {"tune_32", "%{" OPT_ARCH32 ":%{!mtune=*:%{!mcpu=*:-mtune=%(VALUE)}}}" }, \
+  {"tune_64", "%{" OPT_ARCH64 ":%{!mtune=*:%{!mcpu=*:-mtune=%(VALUE)}}}" }, \
   {"cpu", "%{!mcpu=*:-mcpu=%(VALUE)}" }, \
   {"cpu_32", "%{" OPT_ARCH32 ":%{!mcpu=*:-mcpu=%(VALUE)}}" }, \
   {"cpu_64", "%{" OPT_ARCH64 ":%{!mcpu=*:-mcpu=%(VALUE)}}" }, \
-  {"tune", "%{!mtune=*:-mtune=%(VALUE)}" }, \
-  {"tune_32", "%{" OPT_ARCH32 ":%{!mtune=*:-mtune=%(VALUE)}}" }, \
-  {"tune_64", "%{" OPT_ARCH64 ":%{!mtune=*:-mtune=%(VALUE)}}" }, \
   {"float", "%{!msoft-float:%{!mhard-float:-m%(VALUE)-float}}" }

	Jakub

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

* Re: [PATCH] Fix --with-tune{,-32,-64} on powerpc
  2009-10-14 17:49 [PATCH] Fix --with-tune{,-32,-64} on powerpc Jakub Jelinek
@ 2009-10-14 22:38 ` David Edelsohn
  0 siblings, 0 replies; 2+ messages in thread
From: David Edelsohn @ 2009-10-14 22:38 UTC (permalink / raw)
  To: Jakub Jelinek; +Cc: gcc-patches

On Wed, Oct 14, 2009 at 1:02 PM, Jakub Jelinek <jakub@redhat.com> wrote:
> Hi!
>
> I've noticed that --with-cpu=default32 --with-cpu-32=power4 \
> --with-cpu-64=power4 --with-tune-32=power6 --with-tune-64=power6
> configured gcc behaves differently from just --with-cpu=default32 configured
> one when
> gcc test.c -mcpu=power5
> is used, which is certainly unexpected.  I believe we say in many places
> that when -mtune= isn't used, but -mcpu= is (s/cpu/arch/ for x86_64 etc.),
> then tuning is done for the explicitly chosen CPU ISA.
> It seems i386/x86_64 does this right, since Honza's fix from mid 2003.
>
> Other targets might need similar changes.
>
> Ok for trunk?
>
> 2009-10-14  Jakub Jelinek  <jakub@redhat.com>
>
>        * config/rs6000/option-defaults.h (OPTION_DEFAULT_SPECS): Don't
>        add --with-tune{,-32,-64} configured default for -mtune if explicit
>        -mcpu is used.

Okay.

Thanks, David

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

end of thread, other threads:[~2009-10-14 22:23 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-10-14 17:49 [PATCH] Fix --with-tune{,-32,-64} on powerpc Jakub Jelinek
2009-10-14 22:38 ` David Edelsohn

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).