summaryrefslogtreecommitdiffstats
path: root/mp3lib
diff options
context:
space:
mode:
authornickols_k <nickols_k@b3059339-0415-0410-9bf9-f77b7e298cf2>2001-05-09 07:54:56 +0000
committernickols_k <nickols_k@b3059339-0415-0410-9bf9-f77b7e298cf2>2001-05-09 07:54:56 +0000
commit0870efee9418c1782a539e63b66e43137f65bac7 (patch)
tree94aa4cb228132e5c43e77c8b32582e87fa93a7b4 /mp3lib
parente3ca3ab054c80a3c950d61922f96b53064f79fcd (diff)
downloadmpv-0870efee9418c1782a539e63b66e43137f65bac7.tar.bz2
mpv-0870efee9418c1782a539e63b66e43137f65bac7.tar.xz
K7 3dnow-dsp detection
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@735 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'mp3lib')
-rw-r--r--mp3lib/d_cpu.s27
1 files changed, 16 insertions, 11 deletions
diff --git a/mp3lib/d_cpu.s b/mp3lib/d_cpu.s
index 34ca9730c3..1ddbd73a51 100644
--- a/mp3lib/d_cpu.s
+++ b/mp3lib/d_cpu.s
@@ -1,7 +1,7 @@
/ ---------------------------------------------------------------------------
-/ Cpu function detect by Pontscho/fresh!mindworkz
-/ (c) 2000 - 2000
+/ Cpu function detect by Pontscho/fresh!mindworkz (c) 2000 - 2000
+/ 3dnow-dsp detection by Nick Kurshev (C) 2001
/ ---------------------------------------------------------------------------
.text
@@ -62,7 +62,9 @@ exit:
/ ---------------------------------------------------------------------------
/ in C: unsigned long a3dnow( void );
-/ return: 0 if this processor not requiment 3dnow! else above 1.
+/ return: 0 if this processor does not support 3dnow!
+/ 1 otherwise
+/ 2 if this cpu supports 3dnow-dsp extension
/ ---------------------------------------------------------------------------
a3dnow:
pushl %ebx
@@ -71,21 +73,24 @@ a3dnow:
call ipentium
- shrl $1,%eax
- jnc no_3dnow
+ testl %eax,%eax
+ jz exit2
movl $0x80000000,%eax
cpuid
cmpl $0x80000000,%eax
- jbe no_3dnow
+ jbe exit2
movl $0x80000001,%eax
cpuid
- testl $0x80000000,%edx
- jz no_3dnow
- movl $1,%eax
- jmp exit2
-no_3dnow:
xorl %eax,%eax
+ testl $0x80000000,%edx
+ jz exit2
+/// eax=1 - K6 3DNow!
+ inc %eax
+ testl $0x40000000,%edx
+ jz exit2
+/// eax=2 - K7 3DNowEx!
+ inc %eax
exit2:
popl %ecx