X-Git-Url: https://git.libre-soc.org/?a=blobdiff_plain;f=src%2Fgallium%2Fauxiliary%2Frtasm%2Frtasm_cpu.c;h=03bdd472386f00717057f3ffbc7fe43da8dac09c;hb=76d8951fd3adbb91b2f71d461eec0f304619ca0b;hp=eb3359750b4ff57e4aa9e24019a5573eea94442f;hpb=f7922db610d05efee0ee8c5f0dadb69e3939482e;p=mesa.git diff --git a/src/gallium/auxiliary/rtasm/rtasm_cpu.c b/src/gallium/auxiliary/rtasm/rtasm_cpu.c index eb3359750b4..03bdd472386 100644 --- a/src/gallium/auxiliary/rtasm/rtasm_cpu.c +++ b/src/gallium/auxiliary/rtasm/rtasm_cpu.c @@ -26,14 +26,29 @@ **************************************************************************/ +#include "util/u_debug.h" #include "rtasm_cpu.h" +static boolean rtasm_sse_enabled(void) +{ + 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; +} + int rtasm_cpu_has_sse(void) { /* FIXME: actually detect this at run-time */ -#if defined(__i386__) || defined(__386__) - return 1; +#if defined(PIPE_ARCH_X86) + return rtasm_sse_enabled(); #else return 0; #endif @@ -42,8 +57,8 @@ int rtasm_cpu_has_sse(void) int rtasm_cpu_has_sse2(void) { /* FIXME: actually detect this at run-time */ -#if defined(__i386__) || defined(__386__) - return 1; +#if defined(PIPE_ARCH_X86) + return rtasm_sse_enabled(); #else return 0; #endif