$NetBSD: patch-ae,v 1.5 2005/05/31 19:15:11 jmmv Exp $

--- cpudetect.c.orig	2005-01-12 22:56:25.000000000 +0100
+++ cpudetect.c	2005-05-20 20:00:44.000000000 +0200
@@ -20,7 +20,7 @@
 #include <machine/cpu.h>
 #endif
 
-#ifdef __FreeBSD__
+#if defined(__FreeBSD__) || defined(__DragonFly__)
 #include <sys/types.h>
 #include <sys/sysctl.h>
 #endif
@@ -169,7 +169,7 @@
 #endif
 
 		/* FIXME: Does SSE2 need more OS support, too? */
-#if defined(__linux__) || defined(__FreeBSD__) || defined(__NetBSD__) || defined(__CYGWIN__) || defined(__OpenBSD__)
+#if defined(__linux__) || defined(__FreeBSD__) || defined(__NetBSD__) || defined(__CYGWIN__) || defined(__OpenBSD__) || defined(__DragonFly__)
 		if (caps->hasSSE)
 			check_os_katmai_support();
 		if (!caps->hasSSE)
@@ -324,7 +324,7 @@
 #ifdef ARCH_X86_64
    gCpuCaps.hasSSE=1;
    gCpuCaps.hasSSE2=1;
-#elif defined(__FreeBSD__)
+#elif defined(__FreeBSD__) || defined(__DragonFly__)
    int has_sse=0, ret;
    size_t len=sizeof(has_sse);
 
@@ -334,6 +334,10 @@
 
 #elif defined(__NetBSD__) || defined (__OpenBSD__)
 #if __NetBSD_Version__ >= 105250000 || (defined __OpenBSD__)
+#ifdef __x86_64__
+   gCpuCaps.hasSSE=1;
+   gCpuCaps.hasSSE2=1;
+#else
    int has_sse, has_sse2, ret, mib[2];
    size_t varlen;
 
@@ -362,6 +366,7 @@ static void check_os_katmai_support( voi
       gCpuCaps.hasSSE2=1;
       mp_msg(MSGT_CPUDETECT,MSGL_V, "yes!\n" );
    }
+#endif /* x86_64 */
 #else
    gCpuCaps.hasSSE = 0;
    mp_msg(MSGT_CPUDETECT,MSGL_WARN, "No OS support for SSE, disabling to be safe.\n" );
