From owner-freebsd-questions@FreeBSD.ORG Sat Jan 24 20:13:04 2009 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 280C2106566B for ; Sat, 24 Jan 2009 20:13:04 +0000 (UTC) (envelope-from freebsd-questions@pp.dyndns.biz) Received: from proxy3.bredband.net (proxy3.bredband.net [195.54.101.73]) by mx1.freebsd.org (Postfix) with ESMTP id CF3838FC1E for ; Sat, 24 Jan 2009 20:13:03 +0000 (UTC) (envelope-from freebsd-questions@pp.dyndns.biz) Received: from ironport.bredband.com (195.54.101.120) by proxy3.bredband.net (7.3.127) id 492A9CFF015838AE for freebsd-questions@freebsd.org; Sat, 24 Jan 2009 21:13:02 +0100 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AgNBAKMEe0lV4jp1PGdsb2JhbAAwgTyHJYpgAQEBATW0d4VM X-IronPort-AV: E=Sophos;i="4.37,318,1231110000"; d="scan'208";a="477786157" Received: from c-753ae255.107-1-64736c10.cust.bredbandsbolaget.se (HELO gatekeeper.pp.dyndns.biz) ([85.226.58.117]) by ironport1.bredband.com with ESMTP; 24 Jan 2009 21:13:02 +0100 Received: from [192.168.69.67] (phobos [192.168.69.67]) by gatekeeper.pp.dyndns.biz (8.14.2/8.14.2) with ESMTP id n0OKD0kP010871 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Sat, 24 Jan 2009 21:13:01 +0100 (CET) (envelope-from freebsd-questions@pp.dyndns.biz) Message-ID: <497B764C.4080109@pp.dyndns.biz> Date: Sat, 24 Jan 2009 21:13:00 +0100 From: =?ISO-8859-1?Q?Morgan_Wesstr=F6m?= User-Agent: Thunderbird 2.0.0.19 (X11/20090102) MIME-Version: 1.0 To: FreeBSD Questions References: <20090124124535.3006687c@gumby.homeunix.com> <9a52b1190901240451i14dc544fm1c241d6f43fa897b@mail.gmail.com> <20090124131629.1f9fabe4@gumby.homeunix.com> <497B2536.7030907@pp.dyndns.biz> <20090124174357.4aafcf1a@gumby.homeunix.com> <497B5686.8050600@pp.dyndns.biz> <9a52b1190901241107h5bff8c1al6c980b7ad8e99051@mail.gmail.com> In-Reply-To: <9a52b1190901241107h5bff8c1al6c980b7ad8e99051@mail.gmail.com> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit Subject: Re: default CFLAGS X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 24 Jan 2009 20:13:04 -0000 Saifi Khan wrote: > On Sat, Jan 24, 2009 at 5:57 PM, Pojken Purken wrote: >> RW wrote: >>> On Sat, 24 Jan 2009 15:27:02 +0100 >>> Morgan Wesström wrote: >>> >>> >>>> The section "options enabled" will list them all. I usually only add >>>> "-march=native" to my CFLAGS to enable a few more CPU specific >>>> optimizations. >>> If you set CPUTYPE, -march is set to match, so setting -march=native >>> should be redundant. OTOH a number of other make variables are defined >>> from CPUTYPE, so if you set -march=native, but not CPUTYPE you might >>> miss some optimisations based on build options. >>> >>> I've no idea whether there are any such options, just that you're >>> probably not going to do better than setting CPUTYPE, and leaving the >>> rest alone. >> I'm sorry I was unclear. I set CPUTYPE to native of course which is then >> passed as -march=native to compiler. >> > > The entry in file /var/run/dmesg.boot shows the CPU information as > CPU: Intel (R) Celeron (R) CPU 2.40 GHz (686-class CPU) > > The entry in /usr/share/examples/etc/make.conf shows CPU types for Intel as > core2 core nocona pentium4m pentium4 prescott pentium3m pentium3 pentium-m > pentium2 pentiumpro pentium-mx pentium i486 i386 > > What would be the appropriate CPUTYPE specification in this case ? > > Is there any table which sort of maps the marketing names of the Intel processor > with the CPU information shown in dmesg ? > gcc 4.2 and later will figure out the correct -march and -mtune for you automatically if you use CPUTYPE=native. How it does it in detail can be seen in its source code but basically it's decided by checking manufacturer, cpu family and whether sse2 and sse3 support is present. Your processor is most likely a prescott and you can see what gcc selects by running the compilation example from my previous post. The choice shows up in its output. /Morgan