Merge branch '7.8'
[mesa.git] / src / gallium / auxiliary / rtasm / rtasm_cpu.c
index 175245a9f6b053740bb1dd97a2d618c95d1d1188..2e15751e5086d80e5f3e36162f7176bd7edb610a 100644 (file)
  **************************************************************************/
 
 
-#include "pipe/p_debug.h"
+#include "util/u_debug.h"
 #include "rtasm_cpu.h"
 
 
+#if defined(PIPE_ARCH_X86)
 static boolean rtasm_sse_enabled(void)
 {
-   return !debug_get_bool_option("GALLIUM_NOSSE", FALSE);
+   static boolean firsttime = 1;
+   static boolean enabled;
+   
+   /* This gets called quite often at the moment:
+    */
+   if (firsttime) {
+      enabled =  !debug_get_bool_option("GALLIUM_NOSSE", FALSE);
+      firsttime = FALSE;
+   }
+   return enabled;
 }
+#endif
 
 int rtasm_cpu_has_sse(void)
 {
    /* FIXME: actually detect this at run-time */
-#if defined(__i386__) || defined(__386__) || defined(i386)
+#if defined(PIPE_ARCH_X86)
    return rtasm_sse_enabled();
 #else
    return 0;
@@ -48,7 +59,7 @@ int rtasm_cpu_has_sse(void)
 int rtasm_cpu_has_sse2(void) 
 {
    /* FIXME: actually detect this at run-time */
-#if defined(__i386__) || defined(__386__) || defined(i386)
+#if defined(PIPE_ARCH_X86)
    return rtasm_sse_enabled();
 #else
    return 0;