ilo: disassemble TS messages
authorChia-I Wu <olvaffe@gmail.com>
Wed, 5 Nov 2014 05:10:25 +0000 (13:10 +0800)
committerChia-I Wu <olvaffe@gmail.com>
Thu, 6 Nov 2014 02:43:53 +0000 (10:43 +0800)
Signed-off-by: Chia-I Wu <olvaffe@gmail.com>
src/gallium/drivers/ilo/shader/toy_compiler_disasm.c

index 94321afdf38358f015026aa40ce8aded7739567a..c3ad09138a9a256e683acae7864e79aa801cd60c 100644 (file)
@@ -1218,6 +1218,38 @@ disasm_printer_add_mdesc_urb(struct disasm_printer *printer,
          (complete) ? " complete" : "");
 }
 
+static void
+disasm_printer_add_mdesc_spawner(struct disasm_printer *printer,
+                                 const struct disasm_inst *inst,
+                                 uint32_t mdesc)
+{
+   const char *from;
+
+   switch (mdesc & GEN6_MSG_TS_REQUESTER_TYPE__MASK) {
+   case GEN6_MSG_TS_REQUESTER_TYPE_ROOT:  from = "root";    break;
+   case GEN6_MSG_TS_REQUESTER_TYPE_CHILD: from = "child";   break;
+   default:                               from = "BAD";     break;
+   }
+
+   disasm_printer_add(printer, "(%s thread ", from);
+
+   switch (mdesc & GEN6_MSG_TS_OPCODE__MASK) {
+   case GEN6_MSG_TS_OPCODE_DEREF:
+      disasm_printer_add(printer, "%sderef",
+            (mdesc & GEN6_MSG_TS_RESOURCE_SELECT_NO_DEREF) ? "no " : "");
+      break;
+   case GEN6_MSG_TS_OPCODE_SPAWN:
+      disasm_printer_add(printer, "spawn %s)",
+            (mdesc & GEN6_MSG_TS_RESOURCE_SELECT_ROOT) ? "root" : "child");
+      break;
+   default:
+      disasm_printer_add(printer, "BAD");
+      break;
+   }
+
+   disasm_printer_add(printer, ")");
+}
+
 static void
 disasm_printer_add_mdesc_dp_sampler(struct disasm_printer *printer,
                                     const struct disasm_inst *inst,
@@ -1338,6 +1370,9 @@ disasm_printer_add_mdesc(struct disasm_printer *printer,
    case GEN6_SFID_URB:
       disasm_printer_add_mdesc_urb(printer, inst, mdesc);
       break;
+   case GEN6_SFID_SPAWNER:
+      disasm_printer_add_mdesc_spawner(printer, inst, mdesc);
+      break;
    case GEN6_SFID_DP_CC:
    case GEN7_SFID_DP_DC0:
    case GEN7_SFID_PI: