[MPlayer-cvslog] r20058 - trunk/cpudetect.c

nplourde subversion at mplayerhq.hu
Thu Oct 5 02:12:04 CEST 2006


Author: nplourde
Date: Thu Oct  5 02:12:04 2006
New Revision: 20058

Modified:
   trunk/cpudetect.c

Log:
Detect sse/2 on intel mac, Valtteri Vuorikoski(vuori at sci.fi)

Modified: trunk/cpudetect.c
==============================================================================
--- trunk/cpudetect.c	(original)
+++ trunk/cpudetect.c	Thu Oct  5 02:12:04 2006
@@ -182,7 +182,7 @@
 #endif
 
 		/* FIXME: Does SSE2 need more OS support, too? */
-#if defined(__linux__) || defined(__FreeBSD__) || defined(__NetBSD__) || defined(__CYGWIN__) || defined(__OpenBSD__) || defined(__DragonFly__)
+#if defined(__linux__) || defined(__FreeBSD__) || defined(__NetBSD__) || defined(__CYGWIN__) || defined(__OpenBSD__) || defined(__DragonFly__) || defined(__APPLE__)
 		if (caps->hasSSE)
 			check_os_katmai_support();
 		if (!caps->hasSSE)
@@ -345,16 +345,23 @@
  * and RedHat patched 2.2 kernels that have broken exception handling
  * support for user space apps that do SSE.
  */
+ 
+#if defined(__FreeBSD__) || defined(__DragonFly__)
+#define SSE_SYSCTL_NAME "hw.instruction_sse"
+#elif defined(__APPLE__)
+#define SSE_SYSCTL_NAME "hw.optional.sse"
+#endif
+
 static void check_os_katmai_support( void )
 {
 #ifdef ARCH_X86_64
    gCpuCaps.hasSSE=1;
    gCpuCaps.hasSSE2=1;
-#elif defined(__FreeBSD__) || defined(__DragonFly__)
+#elif defined(__FreeBSD__) || defined(__DragonFly__) || defined(__APPLE__)
    int has_sse=0, ret;
    size_t len=sizeof(has_sse);
 
-   ret = sysctlbyname("hw.instruction_sse", &has_sse, &len, NULL, 0);
+   ret = sysctlbyname(SSE_SYSCTL_NAME, &has_sse, &len, NULL, 0);
    if (ret || !has_sse)
       gCpuCaps.hasSSE=0;
 



More information about the MPlayer-cvslog mailing list