pkgsrc-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[pkgsrc/trunk]: pkgsrc/devel/cpuflags Updated devel/cpuflags to 1.32



details:   https://anonhg.NetBSD.org/pkgsrc/rev/730a8cbd78a3
branches:  trunk
changeset: 552788:730a8cbd78a3
user:      abs <abs%pkgsrc.org@localhost>
date:      Fri Jan 09 12:54:15 2009 +0000

description:
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:

 devel/cpuflags/Makefile          |   4 ++--
 devel/cpuflags/files/subr_NetBSD |  10 +++++++---
 devel/cpuflags/files/subr_x86    |  28 ++++++++++++++++++++--------
 3 files changed, 29 insertions(+), 13 deletions(-)

diffs (96 lines):

diff -r 1d72cf341c91 -r 730a8cbd78a3 devel/cpuflags/Makefile
--- a/devel/cpuflags/Makefile   Fri Jan 09 11:46:34 2009 +0000
+++ b/devel/cpuflags/Makefile   Fri Jan 09 12:54:15 2009 +0000
@@ -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 -r 1d72cf341c91 -r 730a8cbd78a3 devel/cpuflags/files/subr_NetBSD
--- a/devel/cpuflags/files/subr_NetBSD  Fri Jan 09 11:46:34 2009 +0000
+++ b/devel/cpuflags/files/subr_NetBSD  Fri Jan 09 12:54:15 2009 +0000
@@ -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 @@
            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 @@
 
     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 -r 1d72cf341c91 -r 730a8cbd78a3 devel/cpuflags/files/subr_x86
--- a/devel/cpuflags/files/subr_x86     Fri Jan 09 11:46:34 2009 +0000
+++ b/devel/cpuflags/files/subr_x86     Fri Jan 09 12:54:15 2009 +0000
@@ -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 @@
        "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' ;;



Home | Main Index | Thread Index | Old Index