compiler: add flag for allowing gp regs on stack
authorDavid Schleef <ds@schleef.org>
Sun, 1 Aug 2010 22:22:26 +0000 (15:22 -0700)
committerDavid Schleef <ds@schleef.org>
Sun, 1 Aug 2010 22:22:26 +0000 (15:22 -0700)
orc/orccompiler.c
orc/orcprogram-sse.c
orc/orcprogram.h

index 6f3cfcf..90dadbd 100644 (file)
@@ -108,10 +108,11 @@ orc_compiler_allocate_register (OrcCompiler *compiler, int data_reg)
     }
   }
 
-  /* FIXME on !x86, this is an error */
-  ORC_COMPILER_ERROR (compiler, "register overflow for %s reg",
-      data_reg ? "vector" : "gp");
-  compiler->result = ORC_COMPILE_RESULT_UNKNOWN_COMPILE;
+  if (!compiler->allow_gp_on_stack) {
+    ORC_COMPILER_ERROR (compiler, "register overflow for %s reg",
+        data_reg ? "vector" : "gp");
+    compiler->result = ORC_COMPILE_RESULT_UNKNOWN_COMPILE;
+  }
 
   return 0;
 }
index 67bad8d..a71ab16 100644 (file)
@@ -196,7 +196,7 @@ orc_compiler_sse_init (OrcCompiler *compiler)
 
   compiler->unroll_shift = 1;
   compiler->alloc_loop_counter = TRUE;
-
+  compiler->allow_gp_on_stack = TRUE;
 }
 
 void
index 5161153..1cff1f8 100644 (file)
@@ -403,6 +403,7 @@ struct _OrcCompiler {
   int unroll_shift;
 
   int alloc_loop_counter;
+  int allow_gp_on_stack;
   int loop_counter;
   int size_region;