changeset 35242:777fc6f5cd6f

configure: add more cpu type detection Add the following cpu type detection: * atom (both x86 & x86-64) * corei7 (x86-64, Nehalem & Westmere) * corei7-avx (x86-64, Sandy Bridge & Ivy Bridge)
author upsuper
date Fri, 02 Nov 2012 00:17:07 +0000
parents 3ca6a7d60396
children 864301bce9c7
files configure
diffstat 1 files changed, 20 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/configure	Thu Nov 01 22:27:27 2012 +0000
+++ b/configure	Fri Nov 02 00:17:07 2012 +0000
@@ -1973,7 +1973,9 @@
         fi
         ;;
     6) iproc=686
-        if test "$pmodel" -ge 15; then
+        if test "$pmodel" -eq 28 -o "$pmodel" -eq 38 -o "$pmodel" -eq 54; then
+            proc=atom
+        elif test "$pmodel" -ge 15; then
             proc=core2
         elif test "$pmodel" -eq 9 -o "$pmodel" -ge 13; then
             proc=pentium-m
@@ -2073,6 +2075,9 @@
         fi
       fi
     fi
+    if test "$proc" = "atom" ; then
+      cflag_check -march=$proc $cpuopt=$proc || proc=core2
+    fi
     if test "$proc" = "prescott" ; then
       cflag_check -march=$proc $cpuopt=$proc || proc=pentium4
     fi
@@ -2184,7 +2189,17 @@
         ;;
       GenuineIntel)
         case "$pfamily" in
-        6) proc=core2;;
+        6)
+          if test "$pmodel" -eq 28 -o "$pmodel" -eq 38 -o "$pmodel" -eq 54; then
+            proc=atom
+          elif test "$pmodel" -ge 42; then
+            proc=corei7-avx
+          elif test "$pmodel" -ge 26; then
+            proc=corei7
+          else
+            proc=core2
+          fi
+          ;;
         *)
           # 64-bit prescotts exist, but as far as GCC is concerned they
           # have the same capabilities as a nocona.
@@ -2219,6 +2234,9 @@
         cflag_check -march=$proc $cpuopt=$proc || proc=error
       fi
       # --- Intel processors ---
+      if test "$proc" = "atom" || test "$proc" = "corei7-avx" || test "$proc" = "corei7"; then
+        cflag_check -march=$proc $cpuopt=$proc || proc=core2
+      fi
       if test "$proc" = "core2"; then
         cflag_check -march=$proc $cpuopt=$proc || proc=x86-64
       fi