gallivm: Centralize the cpu caps detection.
authorJosé Fonseca <jfonseca@vmware.com>
Sat, 24 Apr 2010 12:19:10 +0000 (13:19 +0100)
committerJosé Fonseca <jfonseca@vmware.com>
Sat, 24 Apr 2010 12:19:10 +0000 (13:19 +0100)
src/gallium/auxiliary/gallivm/lp_bld_init.c
src/gallium/drivers/llvmpipe/lp_jit.c

index de07c222a39e1ec052e924f3ee39df2ac17bef75..5067d0a164f4cf7b9d3ee5c3483ad59ec6054c58 100644 (file)
@@ -27,6 +27,7 @@
 
 
 #include "pipe/p_compiler.h"
+#include "util/u_cpu_detect.h"
 #include "util/u_debug.h"
 #include "lp_bld_init.h"
 
@@ -62,6 +63,15 @@ lp_build_init(void)
 
    if (!lp_build_target)
       lp_build_target = LLVMGetExecutionEngineTargetData(lp_build_engine);
+
+   util_cpu_detect();
+
+#if 0
+   /* For simulating less capable machines */
+   util_cpu_caps.has_sse3 = 0;
+   util_cpu_caps.has_ssse3 = 0;
+   util_cpu_caps.has_sse4_1 = 0;
+#endif
 }
 
 
index 8690941a507d4ccc5749c32cbb9288c2577811b1..466a2f54fbe29f8ea4e11c9eca599e2c8de55f7f 100644 (file)
@@ -171,15 +171,6 @@ lp_jit_screen_cleanup(struct llvmpipe_screen *screen)
 void
 lp_jit_screen_init(struct llvmpipe_screen *screen)
 {
-   util_cpu_detect();
-
-#if 0
-   /* For simulating less capable machines */
-   util_cpu_caps.has_sse3 = 0;
-   util_cpu_caps.has_ssse3 = 0;
-   util_cpu_caps.has_sse4_1 = 0;
-#endif
-
    lp_build_init();
 
    screen->module = lp_build_module;