PATCH: Use -mtune= instead of -mcpu=

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

PATCH: Use -mtune= instead of -mcpu=

H.J. Lu-27
I believe all required gcc support -mtune= and -mcpu= is deprecated.


H.J.
----
2007-09-14  H.J. Lu  <[hidden email]>

        * Makeconfig (cflags): Use -mtune= instead of -mcpu=.

--- Makeconfig.tune 2007-07-23 11:02:47.000000000 -0700
+++ Makeconfig 2007-09-14 10:44:45.000000000 -0700
@@ -642,7 +642,7 @@ ifeq "$(strip $(+cflags))" ""
 +cflags := $(default_cflags)
 endif # $(+cflags) == ""
 
-+cflags += $(addprefix -mcpu=,$(with-cpu)) $(+gccwarn) $(+merge-constants)
++cflags += $(addprefix -mtune=,$(with-cpu)) $(+gccwarn) $(+merge-constants)
 +gcc-nowarn := -w
 
 # Don't duplicate options if we inherited variables from the parent.
Reply | Threaded
Open this post in threaded view
|

Re: PATCH: Use -mtune= instead of -mcpu=

Ulrich Drepper
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

H.J. Lu wrote:
> I believe all required gcc support -mtune= and -mcpu= is deprecated.

You never say why would think changes are needed.  I'm not applying
anything just because it might be nicer if there is a chance it might
break something.

- --
➧ Ulrich Drepper ➧ Red Hat, Inc. ➧ 444 Castro St ➧ Mountain View, CA ❖
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.7 (GNU/Linux)

iD8DBQFG6xs92ijCOnn/RHQRAn2hAJ40JC5c6Ri1xwTRaYPrP3rv1xIRPgCgnomD
GHqpRrHNa+dXdt1pGd2mvpE=
=NXdM
-----END PGP SIGNATURE-----
Reply | Threaded
Open this post in threaded view
|

Re: PATCH: Use -mtune= instead of -mcpu=

Steve Munroe
In reply to this post by H.J. Lu-27
[hidden email] wrote on 09/14/2007 01:14:24 PM:

> I believe all required gcc support -mtune= and -mcpu= is deprecated.
>

No this is true only for Intel, PowerPC still uses -mcpu. This change would
disable the existing -with-cpu= optimization available for PowerPC.

The equivalent for Intel is -march= because we want to select source
optimizations based on ISA version or processor extention. -mtune is
implied, but can and should be specified separately (via CFLAGS).

If you want to change this you need to condition use of -mcpu vs -march
based on $machine or $base_machine.

>
> H.J.
> ----
> 2007-09-14  H.J. Lu  <[hidden email]>
>
>    * Makeconfig (cflags): Use -mtune= instead of -mcpu=.
>
> --- Makeconfig.tune   2007-07-23 11:02:47.000000000 -0700
> +++ Makeconfig   2007-09-14 10:44:45.000000000 -0700
> @@ -642,7 +642,7 @@ ifeq   "$(strip $(+cflags))" ""
>  +cflags   := $(default_cflags)
>  endif   # $(+cflags) == ""
>
> -+cflags += $(addprefix -mcpu=,$(with-cpu)) $(+gccwarn)
$(+merge-constants)
> ++cflags += $(addprefix -mtune=,$(with-cpu)) $(+gccwarn)
$(+merge-constants)
>  +gcc-nowarn := -w
>
>  # Don't duplicate options if we inherited variables from the parent.


Steven J. Munroe
Linux on Power Toolchain Architect
IBM Corporation, Linux Technology Center