**************************************************************************/
+#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
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