[Mplayer-cvslog] CVS: main/loader win32.c,1.22,1.23

Alex Beregszaszi alex at mplayer.dev.hu
Tue Oct 30 22:49:10 CET 2001


Update of /cvsroot/mplayer/main/loader
In directory mplayer:/var/tmp.root/cvs-serv28367

Modified Files:
	win32.c 
Log Message:
support newly added PF defs (loader/wine/winnt.h)

Index: win32.c
===================================================================
RCS file: /cvsroot/mplayer/main/loader/win32.c,v
retrieving revision 1.22
retrieving revision 1.23
diff -u -r1.22 -r1.23
--- win32.c	23 Oct 2001 00:21:41 -0000	1.22
+++ win32.c	30 Oct 2001 21:48:58 -0000	1.23
@@ -726,6 +726,22 @@
 	cachedsi.dwAllocationGranularity	= 0x10000;
 	cachedsi.wProcessorLevel		= 5; /* pentium */
 	cachedsi.wProcessorRevision		= 0x0101;
+        cachedsi.dwNumberOfProcessors		= 1;
+
+#if 1
+	/* mplayer's way to detect PF's */
+	{
+	    #include "../cpudetect.h"
+	    extern CpuCaps gCpuCaps;
+	    
+	    if (gCpuCaps.hasMMX)
+		PF[PF_MMX_INSTRUCTIONS_AVAILABLE] = TRUE;
+	    if (gCpuCaps.hasSSE)
+		PF[PF_XMMI_INSTRUCTIONS_AVAILABLE] = TRUE;
+	    if (gCpuCaps.has3DNow)
+		PF[PF_AMD3D_INSTRUCTIONS_AVAILABLE] = TRUE;
+	}
+#endif
 	
 #if defined(__FreeBSD__) || defined(__NetBSD__) || defined(__svr4__)
 	do_cpuid(1, regs);
@@ -751,6 +767,10 @@
 	  PF[PF_COMPARE_EXCHANGE_DOUBLE] = TRUE;
 	if (regs[3] & (1 << 23))
           PF[PF_MMX_INSTRUCTIONS_AVAILABLE] = TRUE;
+	if (regs[3] & (1 << 25))
+	  PF[PF_XMMI_INSTRUCTIONS_AVAILABLE] = TRUE;
+	if (regs[3] & (1 << 31))
+	  PF[PF_AMD3D_INSTRUCTIONS_AVAILABLE] = TRUE;
         cachedsi.dwNumberOfProcessors=1;
 #else
 	{
@@ -864,7 +884,12 @@
 				PF[PF_COMPARE_EXCHANGE_DOUBLE] = TRUE;
 			if (strstr(value,"mmx"))
 				PF[PF_MMX_INSTRUCTIONS_AVAILABLE] = TRUE;
-
+			if (strstr(value,"tsc"))
+				PF[PF_RDTSC_INSTRUCTION_AVAILABLE] = TRUE;
+			if (strstr(value,"xmm"))
+				PF[PF_XMMI_INSTRUCTIONS_AVAILABLE] = TRUE;
+			if (strstr(value,"3dnow"))
+				PF[PF_AMD3D_INSTRUCTIONS_AVAILABLE] = TRUE;
 		}
 	}
 	fclose (f);




More information about the MPlayer-cvslog mailing list