[MPlayer-dev-eng] [PATCH] SSE detection fix for NetBSD/amd64

Björn Sandell biorn at dce.chalmers.se
Fri Jan 7 14:56:37 CET 2005


On Thu, 06 Jan 2005 12:41:23 +0100
Matthias Drochner <M.Drochner at fz-juelich.de> wrote:

> 
> on NetBSD/amd64, SSE(2) support is always present, and the sysctl
> nodes "CPU_SSE" and "CPU_SSE2" do not exist. cpudetect.c does
> not compile.
> The appended patch fixes this. (It might also help for OpenBSD;
> ttbomk the amd64 support code is identical.

Yepp, here's what I am trying to get tested on OpenBSD now:

--- cpudetect.c.orig	Thu Oct 21 13:55:19 2004
+++ cpudetect.c	Thu Jan  6 22:29:31 2005
@@ -182,6 +182,7 @@ void GetCpuCaps( CpuCaps *caps)
 //		caps->hasMMX2 = 0;
 //		caps->hasMMX = 0;
 
+#ifndef ARCH_X86_64
 #ifndef HAVE_MMX
 	if(caps->hasMMX) mp_msg(MSGT_CPUDETECT,MSGL_WARN,"MMX supported but disabled\n");
 	caps->hasMMX=0;
@@ -206,6 +207,7 @@ void GetCpuCaps( CpuCaps *caps)
 	if(caps->has3DNowExt) mp_msg(MSGT_CPUDETECT,MSGL_WARN,"3DNowExt supported but disabled\n");
 	caps->has3DNowExt=0;
 #endif
+#endif
 }
 
 
@@ -329,7 +331,7 @@ static void check_os_katmai_support( voi
       gCpuCaps.hasSSE=0;
 
 #elif defined(__NetBSD__) || defined (__OpenBSD__)
-#if __NetBSD_Version__ >= 105250000 || (defined __OpenBSD__)
+#if __NetBSD_Version__ >= 105250000 || (defined (__OpenBSD__) && ! defined (ARCH_X86_64))
    int has_sse, has_sse2, ret, mib[2];
    size_t varlen;
 
@@ -358,6 +360,9 @@ static void check_os_katmai_support( voi
       gCpuCaps.hasSSE2=1;
       mp_msg(MSGT_CPUDETECT,MSGL_V, "yes!\n" );
    }
+#elif defined (__OpenBSD__) && defined (ARCH_X86_64)
+   gCpuCaps.hasSSE=1;
+   gCpuCaps.hasSSE2=1;
 #else
    gCpuCaps.hasSSE = 0;
    mp_msg(MSGT_CPUDETECT,MSGL_WARN, "No OS support for SSE, disabling to be safe.\n" );


-- 
Björn Sandell           Chalmers University of Technology
IT department    www.ita.chalmers.se   +46 (0)31 772 1000




More information about the MPlayer-dev-eng mailing list