Merge remote branch 'upstream/gallium-0.1' into nouveau-gallium-0.1
[mesa.git] / src / mesa / x86 / rtasm / x86sse.c
index 385fb84c01f8d7eae448ae76f22ff5fbba33440b..5c4bab733128285978668013ef72f7cc41edf6a2 100644 (file)
@@ -1,6 +1,7 @@
+#ifdef USE_X86_ASM
 #if defined(__i386__) || defined(__386__)
 
-#include "imports.h"
+#include "main/imports.h"
 #include "x86sse.h"
 
 #define DISASSEM 0
@@ -14,8 +15,6 @@ static unsigned char *cptr( void (*label)() )
 
 static void do_realloc( struct x86_function *p )
 {
-   _mesa_printf("do_realloc %d %p\n", p->size, p->store);
-
    if (p->size == 0) {
       p->size = 1024;
       p->store = _mesa_exec_malloc(p->size);
@@ -278,11 +277,24 @@ void x86_jmp( struct x86_function *p, unsigned char *label)
    emit_1i(p, label - x86_get_label(p) - 4);
 }
 
+#if 0
+/* This doesn't work once we start reallocating & copying the
+ * generated code on buffer fills, because the call is relative to the
+ * current pc.
+ */
 void x86_call( struct x86_function *p, void (*label)())
 {
    emit_1ub(p, 0xe8);
    emit_1i(p, cptr(label) - x86_get_label(p) - 4);
 }
+#else
+void x86_call( struct x86_function *p, struct x86_reg reg)
+{
+   emit_1ub(p, 0xff);
+   emit_modrm_noreg(p, 2, reg);
+}
+#endif
+
 
 /* michal:
  * Temporary. As I need immediate operands, and dont want to mess with the codegen,
@@ -809,7 +821,7 @@ static void x87_arith_op( struct x86_function *p, struct x86_reg dst, struct x86
         assert(0);
    }
    else if (dst.idx == 0) {
-      assert(arg.file = file_REG32);
+      assert(arg.file == file_REG32);
       emit_1ub(p, 0xd8);
       emit_modrm_noreg(p, argmem_noreg, arg);
    }
@@ -1180,3 +1192,9 @@ void x86sse_dummy( void )
 }
 
 #endif
+
+#else  /* USE_X86_ASM */
+
+int x86sse_c_dummy_var; /* silence warning */
+
+#endif /* USE_X86_ASM */