--- cpuid.asm 2004/07/10 17:42:18 1.6 +++ cpuid.asm 2006/12/06 19:55:07 1.10 @@ -19,7 +19,7 @@ ; * along with this program ; if not, write to the Free Software ; * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA ; * -; * $Id: cpuid.asm,v 1.6 2004/07/10 17:42:18 edgomez Exp $ +; * $Id: cpuid.asm,v 1.10 2006/12/06 19:55:07 Isibaar Exp $ ; * ; ***************************************************************************/ @@ -27,10 +27,19 @@ %macro cglobal 1 %ifdef PREFIX - global _%1 - %define %1 _%1 + %ifdef MARK_FUNCS + global _%1:function %1.endfunc-%1 + %define %1 _%1:function %1.endfunc-%1 + %else + global _%1 + %define %1 _%1 + %endif %else - global %1 + %ifdef MARK_FUNCS + global %1:function %1.endfunc-%1 + %else + global %1 + %endif %endif %endmacro @@ -42,6 +51,7 @@ %define CPUID_MMX 0x00800000 %define CPUID_SSE 0x02000000 %define CPUID_SSE2 0x04000000 +%define CPUID_SSE3 0x00000001 %define EXT_CPUID_3DNOW 0x80000000 %define EXT_CPUID_AMD_3DNOWEXT 0x40000000 @@ -52,6 +62,7 @@ %define XVID_CPU_MMXEXT (1<< 1) %define XVID_CPU_SSE (1<< 2) %define XVID_CPU_SSE2 (1<< 3) +%define XVID_CPU_SSE3 (1<< 8) %define XVID_CPU_3DNOW (1<< 4) %define XVID_CPU_3DNOWEXT (1<< 5) %define XVID_CPU_TSC (1<< 6) @@ -62,9 +73,9 @@ ALIGN 32 %ifdef FORMAT_COFF -SECTION .rodata data +SECTION .rodata %else -SECTION .rodata data align=16 +SECTION .rodata align=16 %endif vendorAMD: @@ -142,6 +153,9 @@ ; SSE2 support? CHECK_FEATURE CPUID_SSE2, XVID_CPU_SSE2, ebp + ; SSE3 support? + CHECK_FEATURE CPUID_SSE3, XVID_CPU_SSE3, ebp + ; extended functions? mov eax, 0x80000000 cpuid @@ -180,6 +194,7 @@ pop ebx ret +.endfunc ; sse/sse2 operating support detection routines ; these will trigger an invalid instruction signal if not supported. @@ -188,6 +203,7 @@ sse_os_trigger: xorps xmm0, xmm0 ret +.endfunc ALIGN 16 @@ -195,6 +211,7 @@ sse2_os_trigger: xorpd xmm0, xmm0 ret +.endfunc ; enter/exit mmx state @@ -203,6 +220,7 @@ emms_mmx: emms ret +.endfunc ; faster enter/exit mmx state ALIGN 16 @@ -210,3 +228,6 @@ emms_3dn: femms ret +.endfunc + +