Re: Recommended -march settings [was: Re: [gentoo-dev] CFLAGS paragraph submission for the GWN]

2006-10-14 Thread Mike Frysinger
On Saturday 14 October 2006 05:46, Wernfried Haas wrote:
> What about creating an official document for both -march/mtune and
> CFLAGS settings for different CPUs?

last i checked they're all supported
-mike


pgp04ODZTAmC0.pgp
Description: PGP signature


Re: Recommended -march settings [was: Re: [gentoo-dev] CFLAGS paragraph submission for the GWN]

2006-10-14 Thread Christian Heim
On Saturday, 14. October. 2006 11:46, Wernfried Haas wrote:
> On Sat, Oct 14, 2006 at 05:16:29AM -0400, Mike Frysinger wrote:
> > On Saturday 14 October 2006 04:49, Sebastian Bergmann wrote:
> > >  Do we have an official list of recommended -march settings somewhere?
> >
> > [..]
> > but what you actually want is a list that tells you what cpu value to
> > pass to -march/-mtune based upon the product name of the processor you're
> > running
>
> What about creating an official document for both -march/mtune and
> CFLAGS settings for different CPUs? If some other people like the idea
> and no one else volunteers i can go poke the different arch teams,
> toolchain folks and whoever else may be involved about it and compile
> a list based on their input.

I would really like that, I've searched for such a list some times in the past 
and the closest I could come up with is freehackers.orgĀ¹ and the cflags.sh 
script in the forums.

TIA, Christian

[1] http://www.freehackers.org/gentoo/gccflags/

-- 
Christian Heim 
GPG key ID: 9A9F68E6
Fingerprint: AEC4 87B8 32B8 4922 B3A9 DF79 CAE3 556F 9A9F 68E6


pgpoJaKqSOai9.pgp
Description: PGP signature


Re: Recommended -march settings [was: Re: [gentoo-dev] CFLAGS paragraph submission for the GWN]

2006-10-14 Thread Simon Stelling

Wernfried Haas wrote:

What about creating an official document for both -march/mtune and
CFLAGS settings for different CPUs? If some other people like the idea
and no one else volunteers i can go poke the different arch teams,
toolchain folks and whoever else may be involved about it and compile
a list based on their input.


Check out these packages [1] before doing that, they will probably 
supply all you need.


[1] http://packages.gentoo.org/search/?sstring=cpuinfo

--
Kind Regards,

Simon Stelling
Gentoo/AMD64 developer
--
gentoo-dev@gentoo.org mailing list



Re: Recommended -march settings [was: Re: [gentoo-dev] CFLAGS paragraph submission for the GWN]

2006-10-14 Thread Wernfried Haas
On Sat, Oct 14, 2006 at 05:16:29AM -0400, Mike Frysinger wrote:
> On Saturday 14 October 2006 04:49, Sebastian Bergmann wrote:
> >  Do we have an official list of recommended -march settings somewhere?
> [..]
> but what you actually want is a list that tells you what cpu value to pass 
> to -march/-mtune based upon the product name of the processor you're running

What about creating an official document for both -march/mtune and
CFLAGS settings for different CPUs? If some other people like the idea
and no one else volunteers i can go poke the different arch teams,
toolchain folks and whoever else may be involved about it and compile
a list based on their input.

I wouldn't try to make it a ricer issue but rather a list of flags
that are known to be sane and supported by Gentoo.

cheers,
Wernfried

-- 
Wernfried Haas (amne) - amne at gentoo dot org
Gentoo Forums: http://forums.gentoo.org
IRC: #gentoo-forums on freenode - email: forum-mods at gentoo dot org


pgpLCoRe889mh.pgp
Description: PGP signature


Re: Recommended -march settings [was: Re: [gentoo-dev] CFLAGS paragraph submission for the GWN]

2006-10-14 Thread Mike Frysinger
On Saturday 14 October 2006 04:49, Sebastian Bergmann wrote:
>  Do we have an official list of recommended -march settings somewhere?
>
>  I, for one, still do not know what the right CFLAGS for my ThinkPad X60s
>  with its Intel Core Duo CPU are.

but what you actually want is a list that tells you what cpu value to pass 
to -march/-mtune based upon the product name of the processor you're running

wikipedia.org is a good resource to find out the capabilities of your cpu ... 
or you could simply compare `man gcc` to /proc/cpuinfo

>CFLAGS="-march=pentium-m -O2 -pipe"

should work fine

>  while http://gentoo-wiki.com/Safe_Cflags suggests either
>
>CFLAGS="-march=prescott -O2 -pipe -fomit-frame-pointer"

here's a good reason why gentoo-wiki is not official ... this is wrong.  the 
duo cpu's are not based on the pentium4 which is what the prescott is

>CFLAGS="-march=pentium-m -msse3 -O2 -pipe -fomit-frame-pointer"

there is no gcc flag at the moment for duo's which means the pentium-m 
+ -msse3 is your best bet ... the base pentium-m did not include SSE3 support 
so by simply using that -march, you do not have SSE3 enabled
-mike


pgpBk9hGoIyXq.pgp
Description: PGP signature


Recommended -march settings [was: Re: [gentoo-dev] CFLAGS paragraph submission for the GWN]

2006-10-14 Thread Sebastian Bergmann
Lionel Bouton wrote:
> 
> We would like to remind you that using anything beyond -O2
> -fomit-frame-pointer -march/-mcpu/-mtune in CFLAGS or CXXFLAGS (and
> -mieee, -mabi etc. on selected archs that tell you to do this),
> and using anything at all in LDFLAGS or ASFLAGS, is usually not worth it
> for most users.

 Do we have an official list of recommended -march settings somewhere?

 I, for one, still do not know what the right CFLAGS for my ThinkPad X60s
 with its Intel Core Duo CPU are. At the moment I am using

   CFLAGS="-march=pentium-m -O2 -pipe"

 while http://gentoo-wiki.com/Safe_Cflags suggests either

   CFLAGS="-march=prescott -O2 -pipe -fomit-frame-pointer"

 or

   CFLAGS="-march=pentium-m -msse3 -O2 -pipe -fomit-frame-pointer"

 A tool that suggests CFLAGS based on /proc/cpuinfo and/or x86info would
 be nice, too.

-- 
Sebastian Bergmann  http://sebastian-bergmann.de/
GnuPG Key: 0xB85B5D69 / 27A7 2B14 09E4 98CD 6277 0E5B 6867 C514 B85B 5D69



signature.asc
Description: OpenPGP digital signature


Re: [gentoo-dev] CFLAGS paragraph submission for the GWN

2006-10-08 Thread Dice R. Random

On 10/8/06, Lionel Bouton <[EMAIL PROTECTED]> wrote:

Here's a draft of a paragraph discussing CFLAGS-related problems. This
is the result of a discussion I started on gentoo-dev. Thanks to all
devs who gave feedback this should bring some food for thought to GWN
readers.


Hi Lionel,

Thanks for writing this up, great job.  Nitpicking spelling and
grammar points to follow ;)


configurability that are hallmarks of the http://www.gentoo.org/main/en/about.xml> Gentoo experience.


Extra space before "Gentoo" here.


for most users. There's usually very little benefit, high risks and much
time spent on frustating tuning that could be enjoyed doing far more
interesting things.



"frustating" should be "frustrating"


Example of this are :


Should be plural: "Examples"


-fforce-addr and -fweb break regularly on x86 with
video libraries or graphic processing apps which use hand-optimised ASM.
-fweb may be safe on amd64 but like above no guarantees


"optimised" should be "optimized"


For example -ffast-math is added by the xmame/xmess ebuilds on
most architectures even tho you SHOULD NOT put it in your CFLAGS.


"tho" should be "though"
--
gentoo-dev@gentoo.org mailing list



[gentoo-dev] CFLAGS paragraph submission for the GWN

2006-10-08 Thread Lionel Bouton
Here's a draft of a paragraph discussing CFLAGS-related problems. This
is the result of a discussion I started on gentoo-dev. Thanks to all
devs who gave feedback this should bring some food for thought to GWN
readers.

--- Draft BEGIN ---

CFLAGS



Being able to tune CFLAGS is part of the user control and extreme
configurability that are hallmarks of the http://www.gentoo.org/main/en/about.xml> Gentoo experience.
Being in control brings both benefits and problems. CFLAGS tuning is not
an exception.



We would like to remind you that using anything beyond -O2
-fomit-frame-pointer -march/-mcpu/-mtune in CFLAGS or CXXFLAGS (and
-mieee, -mabi etc. on selected archs that tell you to do this),
and using anything at all in LDFLAGS or ASFLAGS, is usually not worth it
for most users. There's usually very little benefit, high risks and much
time spent on frustating tuning that could be enjoyed doing far more
interesting things.



The recent upgrade to gcc-4.1.1 for x86 and amd64 users changed the
CFLAGS landscape. Users that spent some time tuning their CFLAGS with
gcc-3.4.6 might find out that an upgrade to gcc-4.1.1 leaves them with
an unstable system.

Example of this are :

nss_ldap stopped working with -ffast-math (-ffast-math
is often misused and must be considered a dangerous flag)
-fvisibility-inlines-hidden still breaks some code
-ftree-loop-linear now breaks in gcc-4.1 (at least with
mesa)
-ftree-vectorize is known to be broken in gcc-4.1 (at least
for x86 and ppc, there are fewer problems reported by amd64 users but no
guarantees)
-fforce-addr and -fweb break regularly on x86 with
video libraries or graphic processing apps which use hand-optimised ASM.
-fweb may be safe on amd64 but like above no guarantees


There are known-to-be-broken flags for all GCC versions that you want
to check for too:

-fvisibility=hidden
-frename-registers (may be safe on amd64, at your own risks)
-ftracer
-D_FILE_OFFSET_BITS=64
-msse -mmmx -m3dnow (no need for them on amd64, there are wrapped up
by -march=k8/nocona/... and safely used there)
-W
-mfpmath=sse,387
-malign-double



Users with unsupported CFLAGS might want to return to safe CFLAGS (see
warning above) if recent updates caused them stability problems. On the
other hand, more adventurous users might want to experiment with CFLAGS
that didn't work properly with gcc-3.4.6... As always, the user is in
control (and the gun pointed to their feet is in his/her hand).


Final notes:

The gcc man page contains warnings for some unsafe optimization
options. You should read it carefully when you experiment with CFLAGS or
upgrade GCC on a CFLAGS-customized Gentoo.
Some options that are unsafe in the system-wide CFLAGS might be
added automatically in some ebuilds if the developper deems them safe
(by redefining CFLAGS or using append-flags of the flag-o-matic eclass).
For example -ffast-math is added by the xmame/xmess ebuilds on
most architectures even tho you SHOULD NOT put it in your CFLAGS.
You might get an idea of the stability issues of a specific
optimization option by running: find /usr/portage -name '*.ebuild'|
xargs grep -- '-'. It takes quite
some time, but might be enlightening: look for the
'filter-flags'.




--- Draft END ---

Lionel
-- 
gentoo-dev@gentoo.org mailing list