[MPlayer-dev-eng] [PATCH] two independent patches for configure

Xidorn Quan quanxunzhen at gmail.com
Tue Oct 9 16:54:05 CEST 2012


Hi,

Two independent patches for configure are attached.

The first patch adds more cpu type detection. It can now recongize
atom, corei7, and corei7-avx. References:
http://en.gentoo-wiki.com/wiki/Safe_Cflags/Intel
http://software.intel.com/en-us/comment/1137881
http://www.acsu.buffalo.edu/~charngda/x86cpu.html

The second patch moves some code which dependent on information of cc
down so that it can work properly.

Regards,
Xidorn Quan
-------------- next part --------------
Index: configure
===================================================================
--- configure	(revision 35235)
+++ configure	(working copy)
@@ -1976,7 +1976,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
@@ -2076,6 +2078,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
@@ -2187,7 +2192,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.
@@ -2222,6 +2237,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
-------------- next part --------------
Index: configure
===================================================================
--- configure	(revision 35235)
+++ configure	(working copy)
@@ -1581,9 +1581,6 @@
 
 if darwin; then
   extra_cflags="-mdynamic-no-pic $extra_cflags"
-  if test "$(basename $_cc)" != "clang" ; then
-    extra_cflags="-falign-loops=16 -shared-libgcc $extra_cflags"
-  fi
   _timer=timer-darwin.c
 fi
 
@@ -1729,6 +1726,10 @@
 fi # icc
 test "$cc_fail" = yes && die "unsupported compiler version"
 
+if darwin && test "$cc_vendor" != "clang" ; then
+  extra_cflags="-falign-loops=16 -shared-libgcc $extra_cflags"
+fi
+
 echocheck "working compiler"
 cflag_check "" || die "Compiler is not functioning correctly. Check your installation and custom CFLAGS $CFLAGS ."
 echo "yes"


More information about the MPlayer-dev-eng mailing list