diff mp3lib/d_cpu.s @ 1245:03b7e2955a20

Added newest MMX-optimized decore which speedups decoding at least on 13% for any cpu.
author nick
date Fri, 29 Jun 2001 17:55:35 +0000
parents c0131b42214a
children 87a31bbadd9a
line wrap: on
line diff
--- a/mp3lib/d_cpu.s	Fri Jun 29 10:54:41 2001 +0000
+++ b/mp3lib/d_cpu.s	Fri Jun 29 17:55:35 2001 +0000
@@ -9,6 +9,7 @@
 .globl CpuDetect
 .globl ipentium
 .globl a3dnow
+.globl isse
 
 / ---------------------------------------------------------------------------
 /  in C: unsigned long CpuDetect( void );
@@ -45,7 +46,9 @@
 
 / ---------------------------------------------------------------------------
 /  in C: unsigled long ipentium( void );
-/   return: 0 if the processor is not P5 or above else above 1.
+/  return: 0 if this processor i386 or i486
+/          1 otherwise
+/          2 if this cpu supports mmx
 / ---------------------------------------------------------------------------
 ipentium:
         pushl  %ebx
@@ -63,10 +66,15 @@
         jz     no_cpuid
         movl   $1,%eax
         cpuid
-        shrl   $8,%eax
-        cmpl   $5,%eax
-        jb     no_cpuid
-        movl   $1,%eax
+	movl   %eax, %ecx
+	xorl   %eax, %eax
+        shrl   $8,%ecx
+        cmpl   $5,%ecx
+        jb     exit
+        incl   %eax
+	test   $0x00800000, %edx
+	jz     exit
+	incl   %eax
         jmp    exit
 no_cpuid:
         xorl   %eax,%eax
@@ -113,3 +121,33 @@
         popl   %edx
         popl   %ebx
         ret
+
+/ ---------------------------------------------------------------------------
+/  in C: unsigned long isse( void );
+/  return: 0 if this processor does not support sse
+/          1 otherwise
+/          2 if this cpu supports sse2 extension
+/ ---------------------------------------------------------------------------
+isse:
+        pushl  %ebx
+        pushl  %edx
+        pushl  %ecx
+
+        call   ipentium
+        testl  %eax,%eax
+        jz     exit3
+
+        movl   $1,%eax
+        cpuid
+	xorl   %eax, %eax
+        testl  $0x02000000,%edx
+        jz     exit3
+	incl   %eax
+        testl  $0x04000000,%edx
+        jz     exit3
+        incl   %eax
+exit3:
+        popl   %ecx
+        popl   %edx
+        popl   %ebx
+        ret