Re: [gentoo-user] Re: -march=auto

2009-05-22 Thread Alex Schuster
maxim wexler writes:

> > If so, Daniel's tip about 'gcc -Q --help=target -march=native' will give
> > you the exact options to use.

> See attachment please. Some stuff is enabled, some disabled, some blank.

Try this:
gcc -Q --help=target -march=native > /tmp/gccoptions.native
gcc -Q --help=target   > /tmp/gccoptions.plain
diff /tmp/gccoptions.*

This will show the things that specifying -march=native turns on. Put this 
in your CFLAGS, unless you use -march=native.

> And -march=prescott !?

Why not? Seems gcc 4.3 does not have the -march=atom optimization yet. It's 
also suggested here:
http://en.gentoo-wiki.com/wiki/Safe_Cflags/Intel#Atom

Wonko



Re: [gentoo-user] Re: -march=auto

2009-05-22 Thread maxim wexler
> If so, Daniel's 
> tip about 'gcc -Q --help=target -march=native' will give
> you the exact 
> options to use.
>  
>     Wonko
> 
>

See attachment please. Some stuff is enabled, some disabled, some blank. And 
-march=prescott !?

Maxim


  __
The new Internet Explorer® 8 - Faster, safer, easier.  Optimized for Yahoo!  
Get it Now for Free! at http://downloads.yahoo.com/ca/internetexplorer/

gcc-Q
Description: Binary data


Re: [gentoo-user] Re: -march=auto

2009-05-22 Thread Alex Schuster
maxim wexler writes:

> --- On Thu, 5/21/09, Alex Schuster  wrote:

> > But it suggests using -march=k8 - isn't that a 64-bit-only
> > thing? I'm not
>
> For an 900A w/intel Atom?

No, I have an AMD Athlon(tm) Dual Core Processor 4850e.

> This is what I get:
>
> Warning: Your compiler supports the -march=native option which you may
> prefer Warning: Newer versions of GCC better support your CPU with
> -march=atom -march=core2 -mtune=pentium -mfpmath=sse.
>
> Now I'm confused. It says *my* compiler supports -march=native. Then it
> says "Newer versions". Isn't v4.3.2 new? It was from a new pkg about a
> month ago. Is it giving me a choice here? Can I really declare two -march
> variables? What about mtune and mfpath, are they meant to be "instead of"
> or "in addition to"?

I'm also confused. Multiple -march options make no sense I believe, as does 
specifying both -march and -mtune, as -mtune is implied by -march. And the 
docs say in the section about
-mfpmath=sse:

For the i386 compiler, you need to use `-march=CPU-TYPE',
`-msse' or `-msse2' switches to enable SSE extensions and
make this option effective.  For the x86-64 compiler, these
extensions are enabled by default.

So it seems to me that -mfpmath does not need to be set.

Well, I'd just use -march=native, unless when using distcc. If so, Daniel's 
tip about 'gcc -Q --help=target -march=native' will give you the exact 
options to use.
 
Wonko



[gentoo-user] Re: -march=auto

2009-05-22 Thread Alex Schuster
Daniel Iliev writes:

> Alex Schuster  wrote:

> > BTW, is there a possibility to let gcc tell what flags it will
> > actually use with -march=auto?
>
> gcc -Q --help=target  -march=native

Cool, thanks!

Wonko



[gentoo-user] Re: -march=auto

2009-05-22 Thread ABCD
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

maxim wexler wrote:
> 
> For an 900A w/intel Atom?
> 
> This is what I get:
> 
> Warning: Your compiler supports the -march=native option which you
> may prefer

If you use this, then you 1) must be using >=sys-devel/gcc-4.2, and 2)
will always have the "best" optimization for your machine, so far as the
version of gcc you are using understands.

> Warning: Newer versions of GCC better support your CPU with -march=atom

In order to use this, you will need gcc-4.5, which hasn't been released yet.

> -march=core2 -mtune=pentium -mfpmath=sse.

This is the recommendation that the script actually made - it suggests
to use all of these.

> Now I'm confused. It says *my* compiler supports -march=native. Then
> it says "Newer versions". Isn't v4.3.2 new? It was from a new pkg about
> a month ago. Is it giving me a choice here? Can I really declare two
> -march variables? What about mtune and mfpath, are they meant to be
> "instead of" or "in addition to"? What goes in the kernel config? What
> in /etc/paludis/bashrc?

The newest version of gcc out right now is 4.4.0 (currently in
package.mask).  I would suggest setting CFLAGS="-O2 -march=native -pipe"
and CXXFLAGS="-O2 -march=native -pipe" in /etc/paludis/bashrc (assuming
that that is the proper location for those variables).

- --
ABCD
-BEGIN PGP SIGNATURE-
Version: GnuPG v2.0.11 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iEYEARECAAYFAkoXGvUACgkQOypDUo0oQOoDGgCfQdRS+hQtTVKIITl2UvExt5NH
6g4AoJvL7fC2+Gr2KlYIS3WqMnyeJ9qE
=1r28
-END PGP SIGNATURE-




Re: [gentoo-user] Re: -march=auto

2009-05-22 Thread maxim wexler



--- On Thu, 5/21/09, Alex Schuster  wrote:

> From: Alex Schuster 
> Subject: [gentoo-user] Re: -march=auto
> To: gentoo-user@lists.gentoo.org
> Received: Thursday, May 21, 2009, 12:30 PM
> I just wrote:
> 
> > > Could also perhaps try -march=auto if you're
> using a version of GCC
> > > that supports it.
> 
> Oh, it's -march=native.
> 
> > BTW, is there a possibility to let gcc tell what flags
> it will actually
> > use with -march=auto?
> 
> Paul Hartman just posted a link to a script that seems to
> do what I was 
> looking for in the "[OT]eee 900a intel atom is what
> processor family?" 
> thread: <http://www.pixelbeat.org/scripts/gcccpuopt>
> 
> But it suggests using -march=k8 - isn't that a 64-bit-only
> thing? I'm not 

For an 900A w/intel Atom?

This is what I get:

Warning: Your compiler supports the -march=native option which you may prefer
Warning: Newer versions of GCC better support your CPU with -march=atom
-march=core2 -mtune=pentium -mfpmath=sse.

Now I'm confused. It says *my* compiler supports -march=native. Then it says 
"Newer versions". Isn't v4.3.2 new? It was from a new pkg about a month ago. Is 
it giving me a choice here? Can I really declare two -march variables? What 
about mtune and mfpath, are they meant to be "instead of" or "in addition to"? 
What goes in the kernel config? What in /etc/paludis/bashrc?

Maxim




  __
Yahoo! Canada Toolbar: Search from anywhere on the web, and bookmark your 
favourite sites. Download it now
http://ca.toolbar.yahoo.com.



Re: [gentoo-user] Re: -march=auto

2009-05-21 Thread Alex Schuster
Peter Humphrey writes:

> On Thursday 21 May 2009 20:30:19 Alex Schuster wrote:
> > Paul Hartman just posted a link to a script that seems to do what I was
> > looking for in the "[OT]eee 900a intel atom is what processor family?"
> > thread: 
>
> It's the same thread as your own message is in. Changing the subject does
> not remove references from headers, nor should it. In other words, if you
> want to start a new thread, click "new", not "reply".

I wanted to keep the thread, but change the topic accordingly. I just did 
not check the original topic, so I overlooked the posting I mentioned was 
supposed to be in the same thread - that's a little silly of me, actually :) 
It shows up in a different thread, though, because the references were lost. 
looks like Maxim's YahooMailWebService always drops them.

Wonko



Re: [gentoo-user] Re: -march=auto

2009-05-21 Thread Peter Humphrey
On Thursday 21 May 2009 20:30:19 Alex Schuster wrote:

> Paul Hartman just posted a link to a script that seems to do what I was
> looking for in the "[OT]eee 900a intel atom is what processor family?"
> thread: 

It's the same thread as your own message is in. Changing the subject does 
not remove references from headers, nor should it. In other words, if you 
want to start a new thread, click "new", not "reply".



-- 
Rgds
Peter



Re: [gentoo-user] Re: -march=auto

2009-05-21 Thread Paul Hartman
On Thu, May 21, 2009 at 2:30 PM, Alex Schuster  wrote:
> Paul Hartman just posted a link to a script that seems to do what I was
> looking for in the "[OT]eee 900a intel atom is what processor family?"
> thread: 
>
> But it suggests using -march=k8 - isn't that a 64-bit-only thing? I'm not
> compiling for AMD64, I'm still using 32-bit mode. So I have -march=athlon-xp
> in my CFLAGS for my AMD Athlon(tm) Dual Core Processor 4850e CPU.

Hi,

That script says it is specifically for 32-bit only, so I think you
should be good.

According to:
http://gcc.gnu.org/onlinedocs/gcc-4.3.3/gcc/i386-and-x86_002d64-Options.html

It looks like that CPU type supports the amd64 instruction set but I
don't think itt necessarily means you are using it in 64-bit mode. I
think it would just simply not work at all if it's not valid for
32-bit mode.



[gentoo-user] Re: -march=auto

2009-05-21 Thread Alex Schuster
I just wrote:

> > Could also perhaps try -march=auto if you're using a version of GCC
> > that supports it.

Oh, it's -march=native.

> BTW, is there a possibility to let gcc tell what flags it will actually
> use with -march=auto?

Paul Hartman just posted a link to a script that seems to do what I was 
looking for in the "[OT]eee 900a intel atom is what processor family?" 
thread: 

But it suggests using -march=k8 - isn't that a 64-bit-only thing? I'm not 
compiling for AMD64, I'm still using 32-bit mode. So I have -march=athlon-xp 
in my CFLAGS for my AMD Athlon(tm) Dual Core Processor 4850e CPU.

Wonko