From owner-freebsd-arch@FreeBSD.ORG Fri Nov 16 01:03:19 2012 Return-Path: Delivered-To: freebsd-arch@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id C8274B8 for ; Fri, 16 Nov 2012 01:03:19 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from hammer.pct.niksun.com (freefall.freebsd.org [IPv6:2001:1900:2254:206c::16:87]) by mx1.freebsd.org (Postfix) with ESMTP id 5BBD58FC08 for ; Fri, 16 Nov 2012 01:03:19 +0000 (UTC) Message-ID: <50A590A4.2040406@FreeBSD.org> Date: Thu, 15 Nov 2012 20:02:28 -0500 From: Jung-uk Kim User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:16.0) Gecko/20121031 Thunderbird/16.0.2 MIME-Version: 1.0 To: freebsd-arch@freebsd.org Subject: Re: [RFC] bsd.cpu.mk update for newer processors References: <50A410B5.9070001@FreeBSD.org> In-Reply-To: <50A410B5.9070001@FreeBSD.org> X-Enigmail-Version: 1.4.5 Content-Type: multipart/mixed; boundary="------------080802080106010609000609" X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 16 Nov 2012 01:03:19 -0000 This is a multi-part message in MIME format. --------------080802080106010609000609 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On 2012-11-14 16:44:21 -0500, Jung-uk Kim wrote: > Since we have enabled clang by default on current, I'd like to > update bsd.cpu.mk as well. Please see the attachment. It is also > available from here: > > http://people.freebsd.org/~jkim/cpu.diff > > I only added most popular SIMD features to MACHINE_CPU (i.e., > sse4a, sse41, sse42, and avx) and clang-supported archs to CPUTYPE > (i.e., amdfam10, btver1, bdver1, bdver2, corei7, corei7-avx, and > core-avx-i). I updated the patch to include xop for bdver1 and bdver2: http://people.freebsd.org/~jkim/cpu2.diff I think the feature is too important to miss out. If nobody objects, I am going to commit it around next Monday. Thanks, Jung-uk Kim -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.19 (FreeBSD) Comment: Using GnuPG with Mozilla - http://www.enigmail.net/ iEYEARECAAYFAlClkKQACgkQmlay1b9qnVNCdQCeN7kFUWlBxFtVVxG005MsMWZ4 o5UAnR3i3G9ohHJJYnloWaClg9DWIHDL =Zsq3 -----END PGP SIGNATURE----- --------------080802080106010609000609 Content-Type: text/plain; charset=UTF-8; name="cpu2.diff" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="cpu2.diff" Index: share/mk/bsd.cpu.mk =================================================================== --- share/mk/bsd.cpu.mk (revision 243111) +++ share/mk/bsd.cpu.mk (working copy) @@ -27,10 +27,10 @@ MACHINE_CPU = mips # between e.g. i586 and pentium) . if ${MACHINE_CPUARCH} == "i386" -. if ${CPUTYPE} == "nocona" +. if ${CPUTYPE} == "nocona" || ${CPUTYPE} == "core" || \ + ${CPUTYPE} == "core2" || ${CPUTYPE} == "corei7" || \ + ${CPUTYPE} == "corei7-avx" || ${CPUTYPE} == "core-avx-i" CPUTYPE = prescott -. elif ${CPUTYPE} == "core" -CPUTYPE = prescott . elif ${CPUTYPE} == "p4" CPUTYPE = pentium4 . elif ${CPUTYPE} == "p4m" @@ -50,10 +50,11 @@ CPUTYPE = pentium-mmx . elif ${CPUTYPE} == "i586" CPUTYPE = pentium . elif ${CPUTYPE} == "opteron-sse3" || ${CPUTYPE} == "athlon64-sse3" || \ - ${CPUTYPE} == "k8-sse3" + ${CPUTYPE} == "k8-sse3" || ${CPUTYPE} == "amdfam10" || \ + ${CPUTYPE} == "btver1" || ${CPUTYPE} == "bdver1" || ${CPUTYPE} == "bdver2" CPUTYPE = prescott . elif ${CPUTYPE} == "opteron" || ${CPUTYPE} == "athlon64" || \ - ${CPUTYPE} == "k8" + ${CPUTYPE} == "k8" CPUTYPE = athlon-mp . elif ${CPUTYPE} == "k7" CPUTYPE = athlon @@ -142,7 +143,15 @@ _CPUCFLAGS = -mcpu=ultrasparc3 # presence of a CPU feature. . if ${MACHINE_CPUARCH} == "i386" -. if ${CPUTYPE} == "opteron-sse3" || ${CPUTYPE} == "athlon64-sse3" +. if ${CPUTYPE} == "bdver1" || ${CPUTYPE} == "bdver2" +MACHINE_CPU = xop avx sse42 sse41 ssse3 sse4a sse3 sse2 sse mmx k6 k5 i586 +MACHINE_CPU += i486 i386 +. elif ${CPUTYPE} == "btver1" +MACHINE_CPU = ssse3 sse4a sse3 sse2 sse mmx k6 k5 i586 i486 i386 +. elif ${CPUTYPE} == "amdfam10" +MACHINE_CPU = athlon-xp athlon k7 3dnow sse4a sse3 sse2 sse mmx k6 k5 i586 +MACHINE_CPU += i486 i386 +. elif ${CPUTYPE} == "opteron-sse3" || ${CPUTYPE} == "athlon64-sse3" MACHINE_CPU = athlon-xp athlon k7 3dnow sse3 sse2 sse mmx k6 k5 i586 i486 i386 . elif ${CPUTYPE} == "opteron" || ${CPUTYPE} == "athlon64" MACHINE_CPU = athlon-xp athlon k7 3dnow sse2 sse mmx k6 k5 i586 i486 i386 @@ -163,11 +172,16 @@ MACHINE_CPU = 3dnow mmx i586 i486 i386 MACHINE_CPU = sse mmx i586 i486 i386 . elif ${CPUTYPE} == "c7" MACHINE_CPU = sse3 sse2 sse i686 mmx i586 i486 i386 +. elif ${CPUTYPE} == "corei7-avx" || ${CPUTYPE} == "core-avx-i" +MACHINE_CPU = avx sse42 sse41 ssse3 sse3 sse2 sse i686 mmx i586 i486 i386 +. elif ${CPUTYPE} == "corei7" +MACHINE_CPU = sse42 sse41 ssse3 sse3 sse2 sse i686 mmx i586 i486 i386 . elif ${CPUTYPE} == "core2" MACHINE_CPU = ssse3 sse3 sse2 sse i686 mmx i586 i486 i386 . elif ${CPUTYPE} == "prescott" MACHINE_CPU = sse3 sse2 sse i686 mmx i586 i486 i386 -. elif ${CPUTYPE} == "pentium4" || ${CPUTYPE} == "pentium4m" || ${CPUTYPE} == "pentium-m" +. elif ${CPUTYPE} == "pentium4" || ${CPUTYPE} == "pentium4m" || \ + ${CPUTYPE} == "pentium-m" MACHINE_CPU = sse2 sse i686 mmx i586 i486 i386 . elif ${CPUTYPE} == "pentium3" || ${CPUTYPE} == "pentium3m" MACHINE_CPU = sse i686 mmx i586 i486 i386 @@ -185,10 +199,22 @@ MACHINE_CPU = i486 i386 MACHINE_CPU = i386 . endif . elif ${MACHINE_CPUARCH} == "amd64" -. if ${CPUTYPE} == "opteron-sse3" || ${CPUTYPE} == "athlon64-sse3" || ${CPUTYPE} == "k8-sse3" +. if ${CPUTYPE} == "bdver1" || ${CPUTYPE} == "bdver2" +MACHINE_CPU = xop avx sse42 sse41 ssse3 sse4a sse3 +. elif ${CPUTYPE} == "btver1" +MACHINE_CPU = ssse3 sse4a sse3 +. elif ${CPUTYPE} == "amdfam10" +MACHINE_CPU = k8 3dnow sse4a sse3 +. elif ${CPUTYPE} == "opteron-sse3" || ${CPUTYPE} == "athlon64-sse3" || \ + ${CPUTYPE} == "k8-sse3" MACHINE_CPU = k8 3dnow sse3 -. elif ${CPUTYPE} == "opteron" || ${CPUTYPE} == "athlon64" || ${CPUTYPE} == "k8" +. elif ${CPUTYPE} == "opteron" || ${CPUTYPE} == "athlon64" || \ + ${CPUTYPE} == "k8" MACHINE_CPU = k8 3dnow +. elif ${CPUTYPE} == "corei7-avx" || ${CPUTYPE} == "core-avx-i" +MACHINE_CPU = avx sse42 sse41 ssse3 sse3 +. elif ${CPUTYPE} == "corei7" +MACHINE_CPU = sse42 sse41 ssse3 sse3 . elif ${CPUTYPE} == "core2" MACHINE_CPU = ssse3 sse3 . elif ${CPUTYPE} == "nocona" --------------080802080106010609000609--