# HG changeset patch # User upsuper # Date 1351815427 0 # Node ID 777fc6f5cd6fd3630a31a204226ccb6af1ccf37b # Parent 3ca6a7d60396bb9b327415b5fe5d9b6bed0f20f0 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) diff -r 3ca6a7d60396 -r 777fc6f5cd6f configure --- 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