summaryrefslogtreecommitdiff
path: root/src/gallium/auxiliary/rtasm/rtasm_cpu.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/gallium/auxiliary/rtasm/rtasm_cpu.c')
-rw-r--r--src/gallium/auxiliary/rtasm/rtasm_cpu.c23
1 files changed, 19 insertions, 4 deletions
diff --git a/src/gallium/auxiliary/rtasm/rtasm_cpu.c b/src/gallium/auxiliary/rtasm/rtasm_cpu.c
index eb3359750b..f01e12faa0 100644
--- a/src/gallium/auxiliary/rtasm/rtasm_cpu.c
+++ b/src/gallium/auxiliary/rtasm/rtasm_cpu.c
@@ -26,14 +26,29 @@
**************************************************************************/
+#include "pipe/p_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(__i386__) || defined(__386__) || defined(i386)
+ 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(__i386__) || defined(__386__) || defined(i386)
+ return rtasm_sse_enabled();
#else
return 0;
#endif