Re: [gentoo-user] gcc 4.2 and Core 2 Duo

2007-07-20 Thread Kenneth Prugh
Andrew Gaydenko wrote:
 I have noticed, the official portage tree has included gcc 4.2. Now for 
 Core 2 Duo CPU (amd64 Gentoo arch) I use in make.conf file:
 
 CFLAGS=-O2 -march=nocona -pipe
 
 gcc' changelog has this note:
 
 
 ...
 IA-32/x86-64
 
 * -mtune=generic can now be used to generate code running well on common 
 x86 chips. 
   This includes AMD Athlon, AMD Opteron, Intel Pentium-M, Intel Pentium 4 
 and Intel
   Core 2.
 * -mtune=native and -march=native will produce code optimized for the 
 host 
   architecture as detected using the cpuid instruction.
 ...
 
 
 The question is: must I replace '-march=nocona' with '-mtune=native and 
 -march=native'?

I have a Core2 Duo E6600 and use these CFLAGS with GCC 4.2:

CFLAGS=-Os -march=native -mtune=native -fomit-frame-pointer -pipe -mmmx
-msse2 -msse3

Native works fine here.
-- 
Kenneth Prugh - Ken69267
Gentoo AMD64 Arch Tester



signature.asc
Description: OpenPGP digital signature


Re: [gentoo-user] gcc 4.2 and Core 2 Duo

2007-07-20 Thread Daniel Pielmeier
Andrew Gaydenko schrieb:
 I have noticed, the official portage tree has included gcc 4.2. Now for 
 Core 2 Duo CPU (amd64 Gentoo arch) I use in make.conf file:
 
 CFLAGS=-O2 -march=nocona -pipe
 
 gcc' changelog has this note:
 
 
 ...
 IA-32/x86-64
 
 * -mtune=generic can now be used to generate code running well on common 
 x86 chips. 
   This includes AMD Athlon, AMD Opteron, Intel Pentium-M, Intel Pentium 4 
 and Intel
   Core 2.
 * -mtune=native and -march=native will produce code optimized for the 
 host 
   architecture as detected using the cpuid instruction.
 ...
 
 
 The question is: must I replace '-march=nocona' with '-mtune=native and 
 -march=native'?

Here you will find additional information http://tinyurl.com/2b6spk.
It is stated there that you can use either -march=cpu-type or
-mtune=cpu-type and that -march=cpu-type implies -mtune=cpu-type.

I think you can also use the nocona option for the cpu-type until gcc
4.3 is out which brings you -march=core2, see here http://tinyurl.com/ottvh.

Using mtune or march depends on where you want to use your compiled
software, if you only want to use it only on your own machine
-march=native is probably the best option and if you want to use it on
other machines too, you should choose -mtune=native. If you don't know
at all the weather the cpu is IA32 AMD64 or EM64T you should use
-mtune=generic.

Maybe someone could explain it better, but this is what i understand!

Regards,

Daniel
-- 
[EMAIL PROTECTED] mailing list



Re: [gentoo-user] gcc 4.2 and Core 2 Duo

2007-07-20 Thread Neil Bothwick
Hello Andrew Gaydenko,

 The question is: must I replace '-march=nocona' with '-mtune=native and
 -march=native'?

You CAN change them but there's no MUST about it. I've been running GCC
4.2 with -march=nocona for about ten days and it's working well.


-- 
Neil Bothwick

Linux like wigwam. No windows, no gates, Apache inside.


signature.asc
Description: PGP signature


Re: [gentoo-user] gcc 4.2 and Core 2 Duo

2007-07-20 Thread Andrew Gaydenko
  
  The question is: must I replace '-march=nocona' with '-mtune=native and 
  -march=native'?
 
 I have a Core2 Duo E6600 and use these CFLAGS with GCC 4.2:
 
 CFLAGS=-Os -march=native -mtune=native -fomit-frame-pointer -pipe -mmmx
 -msse2 -msse3
 
 Native works fine here.

Kenneth, thanks! I'll try your flags-string. I hope, there aren't any
resons to rebuld anything else after switching form 4.1.2 with curennt
flags to 4.2.0 with youe flags. Is it true?
-- 
[EMAIL PROTECTED] mailing list



Re: [gentoo-user] gcc 4.2 and Core 2 Duo

2007-07-20 Thread Volker Armin Hemmann
On Freitag, 20. Juli 2007, Andrew Gaydenko wrote:
 I have noticed, the official portage tree has included gcc 4.2. Now for
 Core 2 Duo CPU (amd64 Gentoo arch) I use in make.conf file:

 CFLAGS=-O2 -march=nocona -pipe

 gcc' changelog has this note:

 
 ...
 IA-32/x86-64

 * -mtune=generic can now be used to generate code running well on
 common x86 chips. This includes AMD Athlon, AMD Opteron, Intel Pentium-M,
 Intel Pentium 4 and Intel Core 2.
 * -mtune=native and -march=native will produce code optimized for the
 host architecture as detected using the cpuid instruction.
 ...
 

 The question is: must I replace '-march=nocona' with '-mtune=native and
 -march=native'?

first of all: using mtune AND march is stupid

Second, that 'feature' means that gcc looks at your CHOST and use that for the 
march/mtune setting.

So no, don't change anything at all. march=nocona is fine. Don't touch it.
-- 
[EMAIL PROTECTED] mailing list



Re: [gentoo-user] gcc 4.2 and Core 2 Duo

2007-07-20 Thread Florian Philipp
Am Freitag 20 Juli 2007 20:16 schrieb Kenneth Prugh:
 Andrew Gaydenko wrote:
  I have noticed, the official portage tree has included gcc 4.2. Now for
  Core 2 Duo CPU (amd64 Gentoo arch) I use in make.conf file:
 
  CFLAGS=-O2 -march=nocona -pipe
 
  gcc' changelog has this note:
 
  
  ...
  IA-32/x86-64
 
  * -mtune=generic can now be used to generate code running well on
  common x86 chips. This includes AMD Athlon, AMD Opteron, Intel Pentium-M,
  Intel Pentium 4 and Intel Core 2.
  * -mtune=native and -march=native will produce code optimized for the
  host architecture as detected using the cpuid instruction.
  ...
  
 
  The question is: must I replace '-march=nocona' with '-mtune=native and
  -march=native'?

 I have a Core2 Duo E6600 and use these CFLAGS with GCC 4.2:

 CFLAGS=-Os -march=native -mtune=native -fomit-frame-pointer -pipe -mmmx
 -msse2 -msse3

 Native works fine here.

I don't think that you need -msse3 -msse2 and -mmmx because -march takes care 
of that (refer to man gcc, one notable exeption: -march=athlon64 does not 
pull -msse3 in because not all Athlons support it). 
-fomit-frame-pointer is unneccessary on AMD64 (refer to man gcc, again).


pgpuTgRS3tYhK.pgp
Description: PGP signature


Re: [gentoo-user] gcc 4.2 and Core 2 Duo

2007-07-20 Thread Kenneth Prugh
Volker Armin Hemmann wrote:
 Second, that 'feature' means that gcc looks at your CHOST and use that for 
 the 
 march/mtune setting.
 
 So no, don't change anything at all. march=nocona is fine. Don't touch it.

That's completely wrong. If you look at the old patch [1] that fixed
mtune for the Core2's you'd see it is MUCH more complicated than that.

[1] http://gcc.gnu.org/ml/gcc-patches/2006-12/msg00061.html
-- 
Kenneth Prugh - Ken69267
Gentoo AMD64 Arch Tester



signature.asc
Description: OpenPGP digital signature


Re: [gentoo-user] gcc 4.2 and Core 2 Duo

2007-07-20 Thread Kenneth Prugh
Florian Philipp wrote:
 Am Freitag 20 Juli 2007 20:16 schrieb Kenneth Prugh:
 Andrew Gaydenko wrote:
 I have noticed, the official portage tree has included gcc 4.2. Now for
 Core 2 Duo CPU (amd64 Gentoo arch) I use in make.conf file:

 CFLAGS=-O2 -march=nocona -pipe

 gcc' changelog has this note:

 
 ...
 IA-32/x86-64

 * -mtune=generic can now be used to generate code running well on
 common x86 chips. This includes AMD Athlon, AMD Opteron, Intel Pentium-M,
 Intel Pentium 4 and Intel Core 2.
 * -mtune=native and -march=native will produce code optimized for the
 host architecture as detected using the cpuid instruction.
 ...
 

 The question is: must I replace '-march=nocona' with '-mtune=native and
 -march=native'?
 I have a Core2 Duo E6600 and use these CFLAGS with GCC 4.2:

 CFLAGS=-Os -march=native -mtune=native -fomit-frame-pointer -pipe -mmmx
 -msse2 -msse3

 Native works fine here.
 
 I don't think that you need -msse3 -msse2 and -mmmx because -march takes care 
 of that (refer to man gcc, one notable exeption: -march=athlon64 does not 
 pull -msse3 in because not all Athlons support it). 
 -fomit-frame-pointer is unneccessary on AMD64 (refer to man gcc, again).

Yeah I wasn't exactly positive if it did pull everything in, and
specifying specifically can't really hurt at all as long as you know
it's supported with your cpu.

-- 
Kenneth Prugh - Ken69267
Gentoo AMD64 Arch Tester



signature.asc
Description: OpenPGP digital signature


Re: [gentoo-user] gcc 4.2 and Core 2 Duo

2007-07-20 Thread Daniel Pielmeier
 march and mtune together? stupid.
 native when you know your CPU? Does your CHOST say 'x86_64' or nocona?
 mmmx, msse2, mss3 stupid. Its all part of nocona (maybe not msse3 but 
 everything else). And fomit-frame-pointer? AFAIK superfluos on the amd64 
 architecture, which was copied by intel - so it should be superfluos on 
 nocona.

I think nocona is not a valid CHOST. For 32bit use
CHOST=i686-pc-linux-gnu and for 64bit use CHOST=x86_64-pc-linux-gnu


@ Andrew Gaydenko

Take a look here
http://gentoo-wiki.com/Safe_Cflags#Intel_Core_2_Duo.2FQuad_.2F_Xeon_51xx.2F53xx
i think this settings should be used until gcc-4.3 is out! So your
current settings should do it until that happens!

Regards,

Daniel
-- 
[EMAIL PROTECTED] mailing list



Re: [gentoo-user] gcc 4.2 and Core 2 Duo

2007-07-20 Thread Kenneth Prugh
Andrew Gaydenko wrote:
 The question is: must I replace '-march=nocona' with '-mtune=native and 
 -march=native'?
 I have a Core2 Duo E6600 and use these CFLAGS with GCC 4.2:

 CFLAGS=-Os -march=native -mtune=native -fomit-frame-pointer -pipe -mmmx
 -msse2 -msse3

 Native works fine here.
 
 Kenneth, thanks! I'll try your flags-string. I hope, there aren't any
 resons to rebuld anything else after switching form 4.1.2 with curennt
 flags to 4.2.0 with youe flags. Is it true?

Personally I rebuilt everything on my system because I wanted everything
to be compiled under my shiny new toolchain. I accomplished it via this:

# emerge -eav system
# emerge -eav world

However, I don't believe you _have_ to rebuild. GCC 4.1 and 4.2 should
be binary compatible. I know that my GCC 4.1 LibTorrent works fine with
a GCC 4.2 built rtorrent, so I would like to say it should work fine.

-- 
Kenneth Prugh - Ken69267
Gentoo AMD64 Arch Tester



signature.asc
Description: OpenPGP digital signature


Re: [gentoo-user] gcc 4.2 and Core 2 Duo

2007-07-20 Thread Boyd Stephen Smith Jr.
On Friday 20 July 2007, Boyd Stephen Smith Jr. [EMAIL PROTECTED] 
wrote about 'Re: [gentoo-user] gcc 4.2 and Core 2 Duo':
 If they have the same value, or -march is listed after -mtune, yes. 
 -march implies -mtune, but you might do something like

-march=686 -mtune=native

-- 
Boyd Stephen Smith Jr. ,= ,-_-. =. 
[EMAIL PROTECTED]  ((_/)o o(\_))
ICQ: 514984 YM/AIM: DaTwinkDaddy   `-'(. .)`-' 
http://iguanasuicide.org/  \_/ 


signature.asc
Description: This is a digitally signed message part.


Re: [gentoo-user] gcc 4.2 and Core 2 Duo

2007-07-20 Thread Dale
Kenneth Prugh wrote:
 Andrew Gaydenko wrote:
   
 The question is: must I replace '-march=nocona' with '-mtune=native and 
 -march=native'?
 
 I have a Core2 Duo E6600 and use these CFLAGS with GCC 4.2:

 CFLAGS=-Os -march=native -mtune=native -fomit-frame-pointer -pipe -mmmx
 -msse2 -msse3

 Native works fine here.
   
 Kenneth, thanks! I'll try your flags-string. I hope, there aren't any
 resons to rebuld anything else after switching form 4.1.2 with curennt
 flags to 4.2.0 with youe flags. Is it true?
 

 Personally I rebuilt everything on my system because I wanted everything
 to be compiled under my shiny new toolchain. I accomplished it via this:

 # emerge -eav system
 # emerge -eav world

 However, I don't believe you _have_ to rebuild. GCC 4.1 and 4.2 should
 be binary compatible. I know that my GCC 4.1 LibTorrent works fine with
 a GCC 4.2 built rtorrent, so I would like to say it should work fine.

   

I have a script that you can run that rebuilds everything only once and
it is a complete bottom to top rebuild.  No need to do a system then
world this way.  I got it off the forums and I have used it a few times
and it works very well for me so far.  If you want it, I can send it to
you off list or post it here for everybody that wants to save a copy.  I
have not used it in a while so I'm not sure if portage changes may have
made it not work anymore.

Let me know.

Dale

:-)  :-)


Re: [gentoo-user] gcc 4.2 and Core 2 Duo

2007-07-20 Thread Tobias Heinlein
Volker Armin Hemmann wrote:
 On Freitag, 20. Juli 2007, Andrew Gaydenko wrote:
 march and mtune together? stupid.
 mmmx, msse2, mss3 stupid. Its all part of nocona (maybe not msse3 but 
 everything else). 

Yes, that's right. These flags don't need to be set again. But there are
some ebuilds that filter certain flags like march. By this filtering the
package would be compiled without mmx and msse2 if the flags aren't set
again. If they are, the package will still be compiled *with* mmx and
msse2 even though march is filtered.. Yes, the filtering in the ebuild
isn't done just for fun but some people still prefer to have mmx and
msse2 enabled (when march is filtered).
In short, settings these flags is not completley stupid but has a reason
(even though it's not a very good one). :)

 And then Os. That is a big nono.

Why? I have a complete system running with -Os here and it's working fine.
-- 
[EMAIL PROTECTED] mailing list



Re: [gentoo-user] gcc 4.2 and Core 2 Duo

2007-07-20 Thread Volker Armin Hemmann
On Freitag, 20. Juli 2007, Tobias Heinlein wrote:
 Volker Armin Hemmann wrote:
  On Freitag, 20. Juli 2007, Andrew Gaydenko wrote:
  march and mtune together? stupid.
  mmmx, msse2, mss3 stupid. Its all part of nocona (maybe not msse3 but
  everything else).

 Yes, that's right. These flags don't need to be set again. But there are
 some ebuilds that filter certain flags like march. By this filtering the
 package would be compiled without mmx and msse2 if the flags aren't set
 again. If they are, the package will still be compiled *with* mmx and
 msse2 even though march is filtered.. Yes, the filtering in the ebuild
 isn't done just for fun but some people still prefer to have mmx and
 msse2 enabled (when march is filtered).
 In short, settings these flags is not completley stupid but has a reason
 (even though it's not a very good one). :)


stupid is meant as 'uninformed' not imbecile in that case. But yes, choice of 
words was not good in my part.


  And then Os. That is a big nono.

 Why? I have a complete system running with -Os here and it's working fine.

because Os is known for miscompilations and it makes stuff slower a lot.

For example picture resizing in gwenview. Fast with O2, unbearable slow with 
Os. Last tried with gcc 4.1 ;)
-- 
[EMAIL PROTECTED] mailing list



Re: [gentoo-user] gcc 4.2 and Core 2 Duo

2007-07-20 Thread Vladimir G. Ivanovic
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Kenneth Prugh wrote:
 Andrew Gaydenko wrote:
 The question is: must I replace '-march=nocona' with '-mtune=native and 
 -march=native'?
 I have a Core2 Duo E6600 and use these CFLAGS with GCC 4.2:

 CFLAGS=-Os -march=native -mtune=native -fomit-frame-pointer -pipe -mmmx
 -msse2 -msse3

 Native works fine here.
 Kenneth, thanks! I'll try your flags-string. I hope, there aren't any
 resons to rebuld anything else after switching form 4.1.2 with curennt
 flags to 4.2.0 with youe flags. Is it true?
 
 Personally I rebuilt everything on my system because I wanted everything
 to be compiled under my shiny new toolchain. I accomplished it via this:
 
 # emerge -eav system
 # emerge -eav world
 
 However, I don't believe you _have_ to rebuild. GCC 4.1 and 4.2 should
 be binary compatible. I know that my GCC 4.1 LibTorrent works fine with
 a GCC 4.2 built rtorrent, so I would like to say it should work fine.
 

You, of course, remembered to change your default compiler with

   # gcc-config CHOST-gnu-4.2.0

before recompiling everything. (Run 'gcc-config' with no arguments for
more info.)

- --- Vladimir
-BEGIN PGP SIGNATURE-
Version: GnuPG v2.0.5 (GNU/Linux)

iD8DBQFGoTGSEo/yvZUwubMRApXJAJ4oTGTglnyFwwESe3XmY6vEUemq6wCfdLhU
+CgZTtunvWDOY7pVGWltwik=
=zs86
-END PGP SIGNATURE-
-- 
[EMAIL PROTECTED] mailing list



Re: [gentoo-user] gcc 4.2 and Core 2 Duo

2007-07-20 Thread Kenneth Prugh
Vladimir G. Ivanovic wrote:
snip
 You, of course, remembered to change your default compiler with
 
# gcc-config CHOST-gnu-4.2.0
 
 before recompiling everything. (Run 'gcc-config' with no arguments for
 more info.)
 
 --- Vladimir

Yep. I've also seen that with march/mtune set to native, GCC 4.1.2 fails
to compile anything (here at least), so it's a bit hard to make that
mistake.

-- 
Kenneth Prugh - Ken69267
Gentoo AMD64 Arch Tester



signature.asc
Description: OpenPGP digital signature


Re: [gentoo-user] gcc 4.2 and Core 2 Duo

2007-07-20 Thread Vladimir G. Ivanovic
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Kenneth Prugh wrote:
 Vladimir G. Ivanovic wrote:
 snip
 You, of course, remembered to change your default compiler with

# gcc-config CHOST-gnu-4.2.0

 before recompiling everything. (Run 'gcc-config' with no arguments for
 more info.)

 --- Vladimir
 
 Yep. I've also seen that with march/mtune set to native, GCC 4.1.2 fails
 to compile anything (here at least), so it's a bit hard to make that
 mistake.
 

Duh. I should have realized that native had no chance of working on
any version prior to 4.2.0 and so my reminder wasn't needed.

- --- Vladimir
-BEGIN PGP SIGNATURE-
Version: GnuPG v2.0.5 (GNU/Linux)

iD8DBQFGoX4FEo/yvZUwubMRAgkFAJ9wHxdGjV5Adstc91/V+Kp0PuuPOACfaLO1
E7yfaY4cgD6tQ5hVklrFU44=
=hN1b
-END PGP SIGNATURE-
-- 
[EMAIL PROTECTED] mailing list