diff options
author | abs <abs@pkgsrc.org> | 2009-01-09 12:54:15 +0000 |
---|---|---|
committer | abs <abs@pkgsrc.org> | 2009-01-09 12:54:15 +0000 |
commit | 9f246fab8be8e236088c632b7f2c1fdb54bffe00 (patch) | |
tree | eae1e582649c822b96cc46a9cd1546a4df20e5bf /devel/cpuflags | |
parent | cb1ac20e13a5f9e7fca55c049cdf149da66b2d73 (diff) | |
download | pkgsrc-9f246fab8be8e236088c632b7f2c1fdb54bffe00.tar.gz |
Updated devel/cpuflags to 1.32
Intel appear to have re-used cpu branding strings between Northwood
and Prescott pentium4s. Thats just... special.
Handle this by explicitly testing for SSE3 support to distinguish between
'-march=prescott' and '-march=pentium4'
Diffstat (limited to 'devel/cpuflags')
-rw-r--r-- | devel/cpuflags/Makefile | 4 | ||||
-rwxr-xr-x | devel/cpuflags/files/subr_NetBSD | 10 | ||||
-rw-r--r-- | devel/cpuflags/files/subr_x86 | 28 |
3 files changed, 29 insertions, 13 deletions
diff --git a/devel/cpuflags/Makefile b/devel/cpuflags/Makefile index 571383713dc..46ae3f4b355 100644 --- a/devel/cpuflags/Makefile +++ b/devel/cpuflags/Makefile @@ -1,6 +1,6 @@ -# $NetBSD: Makefile,v 1.137 2009/01/02 19:30:31 abs Exp $ +# $NetBSD: Makefile,v 1.138 2009/01/09 12:54:15 abs Exp $ -DISTNAME= cpuflags-1.31 +DISTNAME= cpuflags-1.32 CATEGORIES= devel sysutils MASTER_SITES= # empty DISTFILES= # empty diff --git a/devel/cpuflags/files/subr_NetBSD b/devel/cpuflags/files/subr_NetBSD index 7229472f5d7..79035c2eaf0 100755 --- a/devel/cpuflags/files/subr_NetBSD +++ b/devel/cpuflags/files/subr_NetBSD @@ -1,4 +1,4 @@ -# $NetBSD: subr_NetBSD,v 1.9 2009/01/02 19:30:31 abs Exp $ +# $NetBSD: subr_NetBSD,v 1.10 2009/01/09 12:54:15 abs Exp $ AWK=awk SED=sed @@ -55,7 +55,11 @@ extract_x86_cpu_vars() print "cpu_feature_"features[f]"=1"; } /cpu0: family/ { - for (i = 2; i < NF; i = i + 2) { print "cpu_"$i"="($(i+1) + 0) } + for (i = 2; i < NF; i = i + 2) { + f=$(i+1); + sub(/^0/, "", f); + print "cpu_"$i"="f + } } ' } @@ -115,7 +119,7 @@ determine_arch() i386 | x86_64) include subr_x86 # this provides map_x86_brand_string() - ARCH=$(map_x86_brand_string "$cpu_brand") + ARCH=$(map_x86_brand_string) if [ -z "$ARCH" ] ; then case "$cpu_name" in 'AMD Athlon 64 X2 (686-class)'*) ARCH='-march=athlon64' ;; diff --git a/devel/cpuflags/files/subr_x86 b/devel/cpuflags/files/subr_x86 index 6bd49519222..2690772b4ab 100644 --- a/devel/cpuflags/files/subr_x86 +++ b/devel/cpuflags/files/subr_x86 @@ -1,8 +1,10 @@ -# $NetBSD: subr_x86,v 1.8 2008/12/31 14:49:54 abs Exp $ +# $NetBSD: subr_x86,v 1.9 2009/01/09 12:54:15 abs Exp $ # Apparently the only way to reliably determine the architecture of a recent # Intel CPU is to use the cpu brand string - as they reused family and # extended family bitflags... annoying +# Even better, they appear to have reused brand strings between Northwood +# and Prescott pentium4s. Thats just... special. # AMD, in contrast decided to keep things simple: # (thanks to Christoph Egger for this list) @@ -13,8 +15,17 @@ map_x86_brand_string() { - case "$1" in - "AMD-K6(tm)-III Processor"*) echo '-march=k6-3' ;; + case "$cpu_brand" in + "AMD*") + case "$cpu_family-$cpu_model" in + 5-6 | 5-7 ) echo '-march=k6' ;; + 5-8 ) echo '-march=k6-2' ;; + 5-9 ) echo '-march=k6-3' ;; + 6-1 | 6-2 | 6-3 ) echo '-march=athlon' ;; + 6-4 | 6-6 | 6-7 | 6-8 | 6-a ) echo '-march=athlon-4' ;; + esac + ;; + "VIA Nehemiah"*) echo '-march=c3' ;; "Genuine Intel(R) CPU T2400"*) echo '-march=core2' ;; @@ -26,11 +37,12 @@ map_x86_brand_string() "Intel(R) Core(TM)2 CPU "*) echo '-march=core2' ;; "Intel(R) Core(TM)2 Duo CPU "*) echo '-march=core2' ;; "Intel(R) Core(TM)2 Quad CPU"*) echo '-march=core2' ;; - "Intel(R) Pentium(R) 4 CPU 2.00GHz") echo '-march=pentium4' ;; - "Intel(R) Pentium(R) 4 CPU 2.80GHz") echo '-march=pentium4' ;; - "Intel(R) Pentium(R) 4 CPU 3.00GHz") echo '-march=prescott' ;; - "Intel(R) Pentium(R) 4 CPU 3.20GHz") echo '-march=prescott' ;; - "Intel(R) Pentium(R) D CPU "*) echo '-march=prescott' ;; + "Intel(R) Pentium(R) 4 CPU"*) + if [ -n "$cpu_feature_SSE3" ] ; then + echo '-march=prescott' + else + echo '-march=pentium4' + fi ;; "Intel(R) Pentium(R) M processor "*) echo '-march=pentium-m' ;; "Intel(R) Xeon(R) CPU 3040"*) echo '-march=core2' ;; "Intel(R) Xeon(R) CPU 3050"*) echo '-march=core2' ;; |