Mesa (gallium-0.2): gallium: use tgsi_dump_instruction() instead of ppc_comment()

Brian Paul brianp at kemper.freedesktop.org
Sat Jan 10 22:05:04 UTC 2009


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

Author: Brian Paul <brianp at vmware.com>
Date:   Fri Jan  9 22:03:48 2009 -0700

gallium: use tgsi_dump_instruction() instead of ppc_comment()

---

 src/gallium/auxiliary/tgsi/tgsi_ppc.c |   91 +++------------------------------
 1 files changed, 7 insertions(+), 84 deletions(-)

diff --git a/src/gallium/auxiliary/tgsi/tgsi_ppc.c b/src/gallium/auxiliary/tgsi/tgsi_ppc.c
index 638fe09..1a4db47 100644
--- a/src/gallium/auxiliary/tgsi/tgsi_ppc.c
+++ b/src/gallium/auxiliary/tgsi/tgsi_ppc.c
@@ -578,18 +578,6 @@ emit_scalar_unaryop(struct gen_context *gen, struct tgsi_full_instruction *inst)
    int v0, v1;
    uint chan_index;
 
-   switch (inst->Instruction.Opcode) {
-   case TGSI_OPCODE_RSQ:
-      ppc_comment(gen->f, -4, "RSQ:");
-      break;
-   case TGSI_OPCODE_RCP:
-      ppc_comment(gen->f, -4, "LCP:");
-      break;
-   default:
-      assert(0);
-   }
-
-
    v0 = get_src_vec(gen, inst, 0, CHAN_X);
    v1 = ppc_allocate_vec_register(gen->f);
 
@@ -620,32 +608,6 @@ emit_unaryop(struct gen_context *gen, struct tgsi_full_instruction *inst)
 {
    uint chan_index;
 
-   switch (inst->Instruction.Opcode) {
-   case TGSI_OPCODE_ABS:
-      ppc_comment(gen->f, -4, "ABS:");
-      break;
-   case TGSI_OPCODE_FLOOR:
-      ppc_comment(gen->f, -4, "FLOOR:");
-      break;
-   case TGSI_OPCODE_FRAC:
-      ppc_comment(gen->f, -4, "FRAC:");
-      break;
-   case TGSI_OPCODE_EXPBASE2:
-      ppc_comment(gen->f, -4, "EXPBASE2:");
-      break;
-   case TGSI_OPCODE_LOGBASE2:
-      ppc_comment(gen->f, -4, "LOGBASE2:");
-      break;
-   case TGSI_OPCODE_MOV:
-      ppc_comment(gen->f, -4, "MOV:");
-      break;
-   case TGSI_OPCODE_SWZ:
-      ppc_comment(gen->f, -4, "SWZ:");
-      break;
-   default:
-      assert(0);
-   }
-
    FOR_EACH_DST0_ENABLED_CHANNEL(*inst, chan_index) {
       int v0 = get_src_vec(gen, inst, 0, chan_index);   /* v0 = srcreg[0] */
       int v1 = get_dst_vec(gen, inst, chan_index);
@@ -692,26 +654,6 @@ emit_binop(struct gen_context *gen, struct tgsi_full_instruction *inst)
    int zero_vec = -1;
    uint chan;
 
-   switch (inst->Instruction.Opcode) {
-   case TGSI_OPCODE_ADD:
-      ppc_comment(gen->f, -4, "ADD:");
-      break;
-   case TGSI_OPCODE_SUB:
-      ppc_comment(gen->f, -4, "SUB:");
-      break;
-   case TGSI_OPCODE_MUL:
-      ppc_comment(gen->f, -4, "MUL:");
-      break;
-   case TGSI_OPCODE_MIN:
-      ppc_comment(gen->f, -4, "MIN:");
-      break;
-   case TGSI_OPCODE_MAX:
-      ppc_comment(gen->f, -4, "MAX:");
-      break;
-   default:
-      assert(0);
-   }
-
    if (inst->Instruction.Opcode == TGSI_OPCODE_MUL) {
       zero_vec = ppc_allocate_vec_register(gen->f);
       ppc_vzero(gen->f, zero_vec);
@@ -760,17 +702,6 @@ emit_triop(struct gen_context *gen, struct tgsi_full_instruction *inst)
 {
    uint chan;
 
-   switch (inst->Instruction.Opcode) {
-   case TGSI_OPCODE_MAD:
-      ppc_comment(gen->f, -4, "MAD:");
-      break;
-   case TGSI_OPCODE_LRP:
-      ppc_comment(gen->f, -4, "LRP:");
-      break;
-   default:
-      assert(0);
-   }
-
    FOR_EACH_DST0_ENABLED_CHANNEL(*inst, chan) {
       /* fetch src operands */
       int v0 = get_src_vec(gen, inst, 0, chan);
@@ -861,20 +792,6 @@ emit_dotprod(struct gen_context *gen, struct tgsi_full_instruction *inst)
    int v0, v1, v2;
    uint chan_index;
 
-   switch (inst->Instruction.Opcode) {
-   case TGSI_OPCODE_DP3:
-      ppc_comment(gen->f, -4, "DP3:");
-      break;
-   case TGSI_OPCODE_DP4:
-      ppc_comment(gen->f, -4, "DP4:");
-      break;
-   case TGSI_OPCODE_DPH:
-      ppc_comment(gen->f, -4, "DPH:");
-      break;
-   default:
-      assert(0);
-   }
-
    v2 = ppc_allocate_vec_register(gen->f);
 
    ppc_vzero(gen->f, v2);                  /* v2 = {0, 0, 0, 0} */
@@ -919,7 +836,6 @@ ppc_vec_pow(struct ppc_function *f, int vr, int va, int vb)
    int t_vec = ppc_allocate_vec_register(f);
    int zero_vec = ppc_allocate_vec_register(f);
 
-   ppc_comment(f, -4, "POW:");
    ppc_vzero(f, zero_vec);
 
    ppc_vlogefp(f, t_vec, va);                   /* t = log2(va) */
@@ -1359,6 +1275,7 @@ tgsi_emit_ppc(const struct tgsi_token *tokens,
    unsigned ok = 1;
    uint num_immediates = 0;
    struct gen_context gen;
+   uint ic = 0;
 
    if (use_ppc_asm < 0) {
       /* If GALLIUM_NOPPC is set, don't use PPC codegen */
@@ -1391,6 +1308,12 @@ tgsi_emit_ppc(const struct tgsi_token *tokens,
          break;
 
       case TGSI_TOKEN_TYPE_INSTRUCTION:
+         if (func->print) {
+            _debug_printf("# ");
+            ic++;
+            tgsi_dump_instruction(&parse.FullToken.FullInstruction, ic);
+         }
+
          ok = emit_instruction(&gen, &parse.FullToken.FullInstruction);
 
 	 if (!ok) {




More information about the mesa-commit mailing list