summaryrefslogtreecommitdiffstats
path: root/configure
diff options
context:
space:
mode:
authorgpoirier <gpoirier@b3059339-0415-0410-9bf9-f77b7e298cf2>2005-05-27 11:14:22 +0000
committergpoirier <gpoirier@b3059339-0415-0410-9bf9-f77b7e298cf2>2005-05-27 11:14:22 +0000
commit27be573c3ba830142821a169224bf59961fe3235 (patch)
tree2adc75f86972611df1644554c6f149b28faa4881 /configure
parent6349fe66d9f661ff53f101fe5c172cca78ab0372 (diff)
downloadmpv-27be573c3ba830142821a169224bf59961fe3235.tar.bz2
mpv-27be573c3ba830142821a169224bf59961fe3235.tar.xz
Athlon 64 optimization flags, in 32 and 64-bit mode.
Patch by Corey Hickey < bugfood-ml YO fatooh POUM org >, based on Robert Swain's patch <robert POUM swain YO gmail POUM com > git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@15576 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'configure')
-rwxr-xr-xconfigure47
1 files changed, 43 insertions, 4 deletions
diff --git a/configure b/configure
index 9d54b9b85e..492650d760 100755
--- a/configure
+++ b/configure
@@ -950,10 +950,49 @@ EOF
_def_arch='#define ARCH_X86_64 1'
_target_arch='TARGET_ARCH_X86_64 = yes'
iproc='x86_64'
- proc=''
- _march=''
- _mcpu=''
- _optimizing=''
+
+ # athlon64 cpu-type only supported in gcc >= 3.4.0
+ # also, gcc >= 3.4.0 doesn't support -mcpu, we have to use -mtune instead
+ if test "$cc_vendor" = "gnu" && test "$_cc_major" -gt 3 -o "$_cc_major" -eq 3 -a "$_cc_minor" -ge 4 ; then
+ proc=athlon64
+ cpuopt=-mtune
+ else
+ proc=athlon-xp
+ cpuopt=-mcpu
+ fi
+
+
+ echocheck "GCC & CPU optimization abilities"
+cat > $TMPC << EOF
+int main(void) { return 0; }
+EOF
+ # This is a stripped-down version of the i386 fallback.
+ if test "$_runtime_cpudetection" = no ; then
+ if test "$proc" = "k8" -o "$proc" = "opteron" -o "$proc" = "athlon64" -o "$proc" = "athlon-fx" ; then
+ cc_check -march=$proc $cpuopt=$proc || proc=athlon-xp
+ fi
+ # This will fail if gcc version < 3.3, which is ok because earlier
+ # versions don't really support 64-bit on amd64.
+ # Is this a valid assumption? -Corey
+ if test "$proc" = "athlon-xp" || test "$proc" = "athlon-4" ; then
+ cc_check -march=$proc $cpuopt=$proc || proc=error
+ fi
+ if test "$proc" = "error" ; then
+ echores "Your $_cc does not even support \"athlon-xp\" for '-march' and '$cpuopt'."
+ _mcpu=""
+ _march=""
+ fi
+ else
+ _march=""
+ _mcpu=""
+ fi
+
+ _march="-march=$proc"
+ _mcpu="$cpuopt=$proc"
+ _optimizing=""
+
+ echores "$proc"
+
x86_exts_check
;;