From owner-freebsd-toolchain@FreeBSD.ORG Tue Nov 8 22:06:11 2011 Return-Path: Delivered-To: freebsd-toolchain@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CBECE106564A; Tue, 8 Nov 2011 22:06:11 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from tensor.andric.com (cl-327.ede-01.nl.sixxs.net [IPv6:2001:7b8:2ff:146::2]) by mx1.freebsd.org (Postfix) with ESMTP id 8DD6F8FC15; Tue, 8 Nov 2011 22:06:11 +0000 (UTC) Received: from [IPv6:2001:7b8:3a7:0:e5f2:b2e3:287d:70bb] (unknown [IPv6:2001:7b8:3a7:0:e5f2:b2e3:287d:70bb]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by tensor.andric.com (Postfix) with ESMTPSA id CFAFF5C59; Tue, 8 Nov 2011 23:06:10 +0100 (CET) Message-ID: <4EB9A7D1.9030800@FreeBSD.org> Date: Tue, 08 Nov 2011 23:06:09 +0100 From: Dimitry Andric Organization: The FreeBSD Project User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:8.0) Gecko/20111031 Thunderbird/8.0 MIME-Version: 1.0 To: Alexander Best References: <20111108002556.GA91218@freebsd.org> <4EB8E07B.5070908@FreeBSD.org> <20111108153856.GA90966@freebsd.org> <20111108210420.GA37161@freebsd.org> In-Reply-To: <20111108210420.GA37161@freebsd.org> X-Enigmail-Version: 1.3.3 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: freebsd-toolchain@freebsd.org Subject: Re: CPUTYPE=native handling X-BeenThere: freebsd-toolchain@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Maintenance of FreeBSD's integrated toolchain List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 08 Nov 2011 22:06:11 -0000 On 2011-11-08 22:04, Alexander Best wrote: ... > for me -march=native reports: > > otaku% gcc -march=native -E -v - Using built-in specs. > Target: amd64-undermydesk-freebsd > Configured with: FreeBSD/amd64 system compiler > Thread model: posix > gcc version 4.2.2 20070831 prerelease [FreeBSD] > /usr/libexec/cc1 -E -quiet -v -D_LONGLONG - -march=nocona -mtune=generic > #include "..." search starts here: > #include <...> search starts here: > /usr/include/gcc/4.2 > /usr/include > End of search list. > # 1 "" > # 1 "" > # 1 "" > # 1 "" > > where instead of nocona, core2 would have been the better choice: > > [1.000000] CPU: Intel(R) Pentium(R) Dual CPU E2160 @ 1.80GHz (1800.00-MHz K8-class CPU) > [1.000000] Origin = "GenuineIntel" Id = 0x6fd Family = 6 Model = f Stepping = 13 > [1.000000] Features=0xbfebfbff > [1.000000] Features2=0xe39d > [1.000000] AMD Features=0x20100800 > [1.000000] AMD Features2=0x1 > [1.000000] TSC: P-state invariant, performance statistics That's weird, the logic in gcc goes: cpuid (1, eax, ebx, ecx, edx); ... has_ssse3 = !!(ecx & bit_SSSE3); ... if (arch) { if (has_ssse3) cpu = "core2"; else if (has_sse3) { if (has_longmode) cpu = "nocona"; else cpu = "prescott"; } else if (has_sse2) cpu = "pentium4"; else if (has_cmov) cpu = "pentiumpro"; else if (has_mmx) cpu = "pentium-mmx"; else if (has_cmpxchg8b) cpu = "pentium"; else cpu = "i386"; } else cpu = "generic"; goto done; E.g. it seems to conclude your cpu *doesn't* have SSSE3, but does have long mode, and thus jumps to nocona. You might be able to debug this, by putting some printfs in this function. :)