summaryrefslogtreecommitdiffstats
path: root/src/mesa/x86/common_x86.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/mesa/x86/common_x86.c')
-rw-r--r--src/mesa/x86/common_x86.c16
1 files changed, 14 insertions, 2 deletions
diff --git a/src/mesa/x86/common_x86.c b/src/mesa/x86/common_x86.c
index bcffb6a01be..aaef4f8349e 100644
--- a/src/mesa/x86/common_x86.c
+++ b/src/mesa/x86/common_x86.c
@@ -1,4 +1,4 @@
-/* $Id: common_x86.c,v 1.18 2002/06/29 19:48:17 brianp Exp $ */
+/* $Id: common_x86.c,v 1.19 2002/07/11 15:33:02 brianp Exp $ */
/*
* Mesa 3-D graphics library
@@ -38,6 +38,10 @@
#if defined(USE_SSE_ASM) && defined(__linux__)
#include <signal.h>
#endif
+#if defined(USE_SSE_ASM) && defined(__FreeBSD__)
+#include <sys/types.h>
+#include <sys/sysctl.h>
+#endif
#include "context.h"
#include "common_x86_asm.h"
@@ -213,8 +217,16 @@ static void check_os_sse_support( void )
message( "Cannot test OS support for SSE, disabling to be safe.\n" );
_mesa_x86_cpu_features &= ~(X86_FEATURE_XMM);
#endif /* _POSIX_SOURCE && X86_FXSR_MAGIC */
+#elif defined(__FreeBSD__)
+ {
+ int ret, len, enabled;
+ len = sizeof(enabled);
+ ret = sysctlbyname("hw.instruction_sse", &enabled, &len, NULL, 0);
+ if (ret || !enabled)
+ _mesa_x86_cpu_features &= ~(X86_FEATURE_XMM);
+ }
#else
- /* Do nothing on non-Linux platforms for now.
+ /* Do nothing on other platforms for now.
*/
message( "Not testing OS support for SSE, leaving enabled.\n" );
#endif /* __linux__ */