diff options
author | arpi_esp <arpi_esp@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2001-02-24 20:28:24 +0000 |
---|---|---|
committer | arpi_esp <arpi_esp@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2001-02-24 20:28:24 +0000 |
commit | d34041569e71fc9bd772354e94dc9d16061072a5 (patch) | |
tree | 8f481cae1c70f32d1756fbe5f39000577b73042d /mp3lib/d_cpu.s | |
parent | e95a95ece09bac96bdfd37322f96c6f57ef79ebc (diff) | |
download | mpv-d34041569e71fc9bd772354e94dc9d16061072a5.tar.bz2 mpv-d34041569e71fc9bd772354e94dc9d16061072a5.tar.xz |
Initial revision
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@2 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'mp3lib/d_cpu.s')
-rw-r--r-- | mp3lib/d_cpu.s | 94 |
1 files changed, 94 insertions, 0 deletions
diff --git a/mp3lib/d_cpu.s b/mp3lib/d_cpu.s new file mode 100644 index 0000000000..34ca9730c3 --- /dev/null +++ b/mp3lib/d_cpu.s @@ -0,0 +1,94 @@ + +/ --------------------------------------------------------------------------- +/ Cpu function detect by Pontscho/fresh!mindworkz +/ (c) 2000 - 2000 +/ --------------------------------------------------------------------------- + +.text + +.globl CpuDetect +.globl ipentium +.globl a3dnow + +/ --------------------------------------------------------------------------- +/ in C: unsigned long CpuDetect( void ); +/ return: cpu ident number. +/ --------------------------------------------------------------------------- +CpuDetect: + pushl %ebx + pushl %ecx + pushl %edx + + movl $1,%eax + cpuid + + popl %edx + popl %ecx + popl %ebx + ret + +/ --------------------------------------------------------------------------- +/ in C: unsigled long ipentium( void ); +/ return: 0 if the processor is not P5 or above else above 1. +/ --------------------------------------------------------------------------- +ipentium: + pushl %ebx + pushl %ecx + pushl %edx + pushfl + popl %eax + movl %eax,%ebx + xorl $0x00200000,%eax + pushl %eax + popfl + pushfl + popl %eax + cmpl %eax,%ebx + jz no_cpuid + movl $1,%eax + cpuid + shrl $8,%eax + cmpl $5,%eax + jb no_cpuid + movl $1,%eax + jmp exit +no_cpuid: + xorl %eax,%eax +exit: + popl %edx + popl %ecx + popl %ebx + ret + +/ --------------------------------------------------------------------------- +/ in C: unsigned long a3dnow( void ); +/ return: 0 if this processor not requiment 3dnow! else above 1. +/ --------------------------------------------------------------------------- +a3dnow: + pushl %ebx + pushl %edx + pushl %ecx + + + call ipentium + shrl $1,%eax + jnc no_3dnow + + movl $0x80000000,%eax + cpuid + cmpl $0x80000000,%eax + jbe no_3dnow + movl $0x80000001,%eax + cpuid + testl $0x80000000,%edx + jz no_3dnow + movl $1,%eax + jmp exit2 +no_3dnow: + xorl %eax,%eax +exit2: + + popl %ecx + popl %edx + popl %ebx + ret |