Mesa (gallium-0.2): gallium: GALLIUM_NOPPC debug var to disable PPC codegen

Brian Paul brianp at kemper.freedesktop.org
Wed Oct 22 23:31:39 UTC 2008


Module: Mesa
Branch: gallium-0.2
Commit: ae81aeb12868db219cbdc02437c481714cfed3f5
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=ae81aeb12868db219cbdc02437c481714cfed3f5

Author: Brian Paul <brian.paul at tungstengraphics.com>
Date:   Wed Oct 22 16:58:05 2008 -0600

gallium: GALLIUM_NOPPC debug var to disable PPC codegen

---

 src/gallium/auxiliary/tgsi/tgsi_ppc.c |   12 ++++++++++--
 1 files changed, 10 insertions(+), 2 deletions(-)

diff --git a/src/gallium/auxiliary/tgsi/tgsi_ppc.c b/src/gallium/auxiliary/tgsi/tgsi_ppc.c
index edd535a..9d7de41 100644
--- a/src/gallium/auxiliary/tgsi/tgsi_ppc.c
+++ b/src/gallium/auxiliary/tgsi/tgsi_ppc.c
@@ -776,15 +776,21 @@ tgsi_emit_ppc(const struct tgsi_token *tokens,
               float (*immediates)[4],
               boolean do_swizzles )
 {
+   static int use_ppc_asm = -1;
    struct tgsi_parse_context parse;
    /*boolean instruction_phase = FALSE;*/
    unsigned ok = 1;
    uint num_immediates = 0;
    struct gen_context gen;
 
-   util_init_math();
+   if (use_ppc_asm < 0) {
+      /* If GALLIUM_NOPPC is set, don't use PPC codegen */
+      use_ppc_asm = !debug_get_bool_option("GALLIUM_NOPPC", FALSE);
+   }
+   if (!use_ppc_asm)
+      return FALSE;
 
-   tgsi_parse_init( &parse, tokens );
+   util_init_math();
 
    gen.f = func;
    gen.inputs_reg = ppc_reserve_register(func, 3);   /* first function param */
@@ -797,6 +803,8 @@ tgsi_emit_ppc(const struct tgsi_token *tokens,
 
    emit_prologue(func);
 
+   tgsi_parse_init( &parse, tokens );
+
    while (!tgsi_parse_end_of_tokens(&parse) && ok) {
       tgsi_parse_token(&parse);
 




More information about the mesa-commit mailing list