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 1QmAfs-0000tX-IE for garchives@archives.gentoo.org; Wed, 27 Jul 2011 20:25:48 +0000 Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 7D7FB21C16C; Wed, 27 Jul 2011 20:25:35 +0000 (UTC) Received: from mail-qw0-f53.google.com (mail-qw0-f53.google.com [209.85.216.53]) by pigeon.gentoo.org (Postfix) with ESMTP id BFB6D21C028 for ; Wed, 27 Jul 2011 20:24:34 +0000 (UTC) Received: by qwb7 with SMTP id 7so1322272qwb.40 for ; Wed, 27 Jul 2011 13:24:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; bh=Sfj8oWDePg1H8suMnxJLXo9KS6/iQMN4xsytCTdN8Dw=; b=Rlt0MNiahVxCh2bo6Gk3v/yI4IdMgAT4HbzeIhbsNL11jydqt0kYQ+s78OuAiuiGSc VPboSAfd6M25DKpf1g7c6OLQP6nz58W+yqISQX+LlONwEoXqUwA6/7dvEOm6rZZqY49z w3hoKjwNhgc/LpnPs563y1pdnMS7K7SNLw+yI= 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.224.209.200 with SMTP id gh8mr178220qab.365.1311798274220; Wed, 27 Jul 2011 13:24:34 -0700 (PDT) Received: by 10.224.2.77 with HTTP; Wed, 27 Jul 2011 13:24:33 -0700 (PDT) In-Reply-To: <201107271932.51559.michaelkintzios@gmail.com> References: <4E2F253E.1000508@alokat.org> <201107271932.51559.michaelkintzios@gmail.com> Date: Wed, 27 Jul 2011 13:24:33 -0700 Message-ID: Subject: Re: [gentoo-user] CFlags for CPU From: Mark Knecht To: gentoo-user@lists.gentoo.org Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Archives-Salt: X-Archives-Hash: e2dd07df472b6e5e8a51d93650e95985 On Wed, Jul 27, 2011 at 11:32 AM, Mick wrote: > On Wednesday 27 Jul 2011 17:13:21 Kfir Lavi wrote: >> On Wed, Jul 27, 2011 at 5:34 PM, Kfir Lavi wrote: >> > On Wed, Jul 27, 2011 at 5:09 PM, Andy Wilkinson >> >> >> >> =C2=A0Another 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=A0In my case (Phenom II 955): >> >> =C2=A0"/usr/libexec/gcc/x86_64-pc-linux-gnu/4.4.5/cc1" "-quiet" >> >> >> >> "/usr/include/stdlib.h" "-D_FORTIFY_SOURCE=3D2" *"-march=3Damdfam10" >> >> "-mcx16" "-msahf" "-mpopcnt"* "--param" "l1-cache-size=3D64" "--param= " >> >> "l1-cache-line-size=3D64" "--param" "l2-cache-size=3D512" "-mtune=3Da= mdfam10" >> >> "-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 dist= cc, >> >> or the options from that output that start with "-m". > >> Just shared this trick in my blog. >> http://gentoo-what-did-you-say.blogspot.com/2011/07/finding-cpu-flags-us= ing >> -gcc.html I added a link to this thread in the post. > > It seems that on my early i7, the -march=3Dcore2 does not have all the -m= sse* > flags enabled, while native does: > > $ diff -y --suppress-common-lines core2.txt native.txt > =C2=A0-mcx16 =C2=A0 =C2=A0 =C2=A0 =C2=A0[disabled] =C2=A0 =C2=A0 =C2=A0 = =C2=A0| =C2=A0 -mcx16 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0[enabled] > =C2=A0-mno-sse4 =C2=A0 =C2=A0 [enabled] =C2=A0 =C2=A0 =C2=A0 =C2=A0 | =C2= =A0 -mno-sse4 =C2=A0 =C2=A0 =C2=A0 [disabled] > =C2=A0-mpopcnt =C2=A0 =C2=A0 =C2=A0[disabled] =C2=A0 =C2=A0 =C2=A0 =C2=A0= | =C2=A0 -mpopcnt =C2=A0 =C2=A0 =C2=A0 =C2=A0[enabled] > =C2=A0-msahf =C2=A0 =C2=A0 =C2=A0 =C2=A0[disabled] =C2=A0 =C2=A0 =C2=A0 = =C2=A0| =C2=A0 -msahf =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0[enabled] > =C2=A0-msse =C2=A0 =C2=A0 =C2=A0 =C2=A0 [disabled] =C2=A0 =C2=A0 =C2=A0 = =C2=A0| =C2=A0 -msse =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 [enabled] > =C2=A0-msse2 =C2=A0 =C2=A0 =C2=A0 =C2=A0[disabled] =C2=A0 =C2=A0 =C2=A0 = =C2=A0| =C2=A0 -msse2 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0[enabled] > =C2=A0-msse3 =C2=A0 =C2=A0 =C2=A0 =C2=A0[disabled] =C2=A0 =C2=A0 =C2=A0 = =C2=A0| =C2=A0 -msse3 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0[enabled] > =C2=A0-msse4 =C2=A0 =C2=A0 =C2=A0 =C2=A0[disabled] =C2=A0 =C2=A0 =C2=A0 = =C2=A0| =C2=A0 -msse4 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0[enabled] > =C2=A0-msse4.1 =C2=A0 =C2=A0 =C2=A0[disabled] =C2=A0 =C2=A0 =C2=A0 =C2=A0= | =C2=A0 -msse4.1 =C2=A0 =C2=A0 =C2=A0 =C2=A0[enabled] > =C2=A0-msse4.2 =C2=A0 =C2=A0 =C2=A0[disabled] =C2=A0 =C2=A0 =C2=A0 =C2=A0= | =C2=A0 -msse4.2 =C2=A0 =C2=A0 =C2=A0 =C2=A0[enabled] > =C2=A0-mssse3 =C2=A0 =C2=A0 =C2=A0 [disabled] =C2=A0 =C2=A0 =C2=A0 =C2=A0= | =C2=A0 -mssse3 =C2=A0 =C2=A0 =C2=A0 =C2=A0 [enabled] > =C2=A0-mtune=3D =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 | =C2=A0 -mtune=3D =C2=A0 =C2=A0 =C2=A0 =C2=A0 = core2 > > > I wonder if I should just set it to "-march=3Dnative -O2 -pipe" and forge= t about > it ... native it seems to have more stuff switched on and it would probab= ly be > a-good-thing=C2=AE (although my understanding of what each flag does is r= ather > cursory). > -- > Regards, > Mick > Just curious if that's consistent with /proc/cpuinfo in the flags section? MAybe gcc is wrong in it's enable/disable choices, or maybe they know something specific. This is from an i7-980 Extreme from about 1 year ago: flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx pdpe1gb rdtscp lm constant_tsc arch_perfmon pebs bts rep_good nopl xtopology nonstop_tsc aperfmperf pni pclmulqdq dtes64 monitor ds_cpl vmx est tm2 ssse3 cx16 xtpr pdcm sse4_1 sse4_2 popcnt aes lahf_lm ida arat dts tpr_shadow vnmi flexpriority ept vpid - Mark