[Mesa-dev] [PATCH 5/5] i965/vec4: print predicate control at brw_vec4 dump_instruction

Alejandro PiƱeiro apinheiro at igalia.com
Sat Oct 10 04:24:23 PDT 2015


---

I found this useful while I was using INTEL_DEBUG=optimizer after
changing how the ifs are emitted. And after all, that info is
also included by brw_disasm.c

I assumed that at the vec4_visitor we would not need to handle
pred_ctrl_align1, but Im not totally sure.


 src/mesa/drivers/dri/i965/brw_vec4.cpp | 16 ++++++++++++++--
 1 file changed, 14 insertions(+), 2 deletions(-)

diff --git a/src/mesa/drivers/dri/i965/brw_vec4.cpp b/src/mesa/drivers/dri/i965/brw_vec4.cpp
index 55e381b..eb81523 100644
--- a/src/mesa/drivers/dri/i965/brw_vec4.cpp
+++ b/src/mesa/drivers/dri/i965/brw_vec4.cpp
@@ -1358,9 +1358,21 @@ vec4_visitor::dump_instruction(backend_instruction *be_inst, FILE *file)
    vec4_instruction *inst = (vec4_instruction *)be_inst;
 
    if (inst->predicate) {
-      fprintf(file, "(%cf0.%d) ",
+      static const char *const pred_ctrl_align16[16] = {
+         "",
+         "",
+         ".x",
+         ".y",
+         ".z",
+         ".w",
+         ".any4h",
+         ".all4h",
+      };
+
+      fprintf(file, "(%cf0.%d%s) ",
               inst->predicate_inverse ? '-' : '+',
-              inst->flag_subreg);
+              inst->flag_subreg,
+              pred_ctrl_align16[inst->predicate]);
    }
 
    fprintf(file, "%s", brw_instruction_name(inst->opcode));
-- 
2.1.4



More information about the mesa-dev mailing list