From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from pigeon.gentoo.org ([208.92.234.80] helo=lists.gentoo.org) by finch.gentoo.org with esmtp (Exim 4.60) (envelope-from ) id 1Qm6lK-0007qY-FH for garchives@archives.gentoo.org; Wed, 27 Jul 2011 16:15:10 +0000 Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 41AC421C130; Wed, 27 Jul 2011 16:14:51 +0000 (UTC) Received: from mail-gw0-f53.google.com (mail-gw0-f53.google.com [74.125.83.53]) by pigeon.gentoo.org (Postfix) with ESMTP id F2B3021C19F for ; Wed, 27 Jul 2011 16:13:42 +0000 (UTC) Received: by gwj20 with SMTP id 20so1565002gwj.40 for ; Wed, 27 Jul 2011 09:13:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type; bh=6GDhbHFo5Tw2ajM1mtxfcmUkTXCDb1DaaNY/VhNIsao=; b=WgUCy3P1SeO46c8kcWt5ODHIRl/YJJwlp+nJZiU5ywAxexli4uKnvIF0RsP20678Cx /2Q2boHxEkvZeaTowTSf70zAJtasKXHyEtiLAOCgInTxcklnkJSxYFKSA0guSs+mcgsW 9chAnWXWXNgUAI48vFnjc7WXn1pkD/ZIxlVkk= Received: by 10.150.253.15 with SMTP id a15mr221795ybi.160.1311783222114; Wed, 27 Jul 2011 09:13:42 -0700 (PDT) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-user@lists.gentoo.org Reply-to: gentoo-user@lists.gentoo.org MIME-Version: 1.0 Received: by 10.151.157.15 with HTTP; Wed, 27 Jul 2011 09:13:21 -0700 (PDT) In-Reply-To: References: <4E2F253E.1000508@alokat.org> <4E2F13F9.8090809@coolmail.se> <4E301C1F.3020206@gmail.com> From: Kfir Lavi Date: Wed, 27 Jul 2011 19:13:21 +0300 Message-ID: Subject: Re: [gentoo-user] CFlags for CPU To: gentoo-user@lists.gentoo.org Content-Type: multipart/alternative; boundary=000e0cd23ef2f9f95404a90f54f2 X-Archives-Salt: X-Archives-Hash: 476aada0d07d456db523d2cbb9be2c47 --000e0cd23ef2f9f95404a90f54f2 Content-Type: text/plain; charset=UTF-8 On Wed, Jul 27, 2011 at 5:34 PM, Kfir Lavi wrote: > > > On Wed, Jul 27, 2011 at 5:09 PM, Andy Wilkinson wrote: > >> ** >> On 07/26/2011 12:22 PM, pk wrote: >> >> On 2011-07-26 22:36, Alokat wrote: >> >> >> model name : Intel(R) Core(TM)2 Duo CPU L7100 @ 1.20GHz >> >> >> >> >> I guess *core2* is the right one? >> >> Yes, acc. to:http://en.gentoo-wiki.com/wiki/Safe_Cflags/Intel#Core_2_Duo.2FQuad.2C_Xeon_51xx.2F53xx.2F54xx.2F3360.2C_Pentium_Dual-Core_T23xx.2B.2FExxxx.2C_Celeron_Dual-Core >> >> HTH >> >> Best regards >> >> Peter K >> >> >> Another good trick I've found on the forums is to run: >> >> $ gcc -### -e -v -march=native /usr/include/stdlib.h >> >> The last line of output will include the various CFLAGS that -march=native >> picks. In my case (Phenom II 955): >> >> "/usr/libexec/gcc/x86_64-pc-linux-gnu/4.4.5/cc1" "-quiet" >> "/usr/include/stdlib.h" "-D_FORTIFY_SOURCE=2" *"-march=amdfam10" "-mcx16" >> "-msahf" "-mpopcnt"* "--param" "l1-cache-size=64" "--param" >> "l1-cache-line-size=64" "--param" "l2-cache-size=512" "-mtune=amdfam10" >> "-quiet" "-dumpbase" "stdlib.h" "-auxbase" "stdlib" "-o" "/tmp/ccR1PlNZ.s" >> "--output-pch=/usr/include/stdlib.h.gch" >> >> I typically use -march=native when I don't need to worry about distcc, or >> the options from that output that start with "-m". >> >> -Andy >> > I must stay, this is brilliant ! > Thank you very much. > > Kfir > Just shared this trick in my blog. http://gentoo-what-did-you-say.blogspot.com/2011/07/finding-cpu-flags-using-gcc.html I added a link to this thread in the post. Kfir --000e0cd23ef2f9f95404a90f54f2 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable


On Wed, Jul 27, 2011 at= 5:34 PM, Kfir Lavi <lavi.kfir@gmail.com> wrote:


On Wed, Jul 27, 2011 at 5:09 PM, Andy Wilkinson <drukargin@gm= ail.com> wrote:
=20 =20 =20 =20
On 07/26/2011 12:22 PM, pk wrote:
On 2011-07-26 22:36, Alokat wrote:

model name      : Intel(R) Core(TM)2 Duo CPU     L7100  @ 1.20=
GHz
<snip>

I guess *core2* is the right one?
Yes, acc. to:
http://en.gentoo-wiki.com/wiki/Safe=
_Cflags/Intel#Core_2_Duo.2FQuad.2C_Xeon_51xx.2F53xx.2F54xx.2F3360.2C_Pentiu=
m_Dual-Core_T23xx.2B.2FExxxx.2C_Celeron_Dual-Core

HTH

Best regards

Peter K

Another good trick I've found on the forums is to run:

$ gcc -### -e -v -march=3Dnative /usr/include/stdlib.h

The last line of output will include the various CFLAGS that -march=3Dnative picks.=C2=A0 In my case (Phenom II 955):

=C2=A0"/usr/libexec/gcc/x86_64-pc-linux-gnu/4.4.5/cc1" &q= uot;-quiet" "/usr/include/stdlib.h" "-D_FORTIFY_SOURCE=3D2" <= b>"-march=3Damdfam10" "-mcx16" "-msahf" "-mpopcnt" &quo= t;--param" "l1-cache-size=3D64" "--param" "l1-cache-line-size=3D64" "--param= " "l2-cache-size=3D512" "-mtune=3Damdfam10" "-quiet" "-dumpbase"= ; "stdlib.h" "-auxbase" "stdlib" "-o" "/tmp/ccR1PlNZ.s" "--output-pch=3D/usr/include/stdlib.h.gch"

I typically use -march=3Dnative when I don't need to worry about distcc, or the options from that output that start with "-m".=

-Andy
I must stay, this is brilliant !
Thank yo= u very much.

Kfir

Just shared this trick in my blog.
http://gentoo-what-did-you-say.blogspot.com/2011/07/finding-cpu-fla= gs-using-gcc.html
I added a link to this thread in the post.

Kfir
--000e0cd23ef2f9f95404a90f54f2--