Mesa (master): aubinator: Make gen_disasm_disassemble handle split sends

Kenneth Graunke kwg at kemper.freedesktop.org
Tue Sep 13 23:36:03 UTC 2016


Module: Mesa
Branch: master
Commit: 1ab92d80a8771ac7145d06a9b7983eecc0beaba0
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=1ab92d80a8771ac7145d06a9b7983eecc0beaba0

Author: Sirisha Gandikota <Sirisha.Gandikota at intel.com>
Date:   Tue Sep 13 16:19:30 2016 -0700

aubinator: Make gen_disasm_disassemble handle split sends

Skylake adds new SENDS and SENDSC opcodes, which should be
handled in the send-with-EOT check. Make an is_send() helper
that checks if the opcode is SEND/SENDC/SENDS/SENDSC (Ken)

v2: Make is_send() much more crispier, Mix declaration and
code to make the code compact (Ken)

Signed-off-by: Sirisha Gandikota <Sirisha.Gandikota at intel.com>
Reviewed-by: Kenneth Graunke <kenneth at whitecape.org>

---

 src/intel/tools/disasm.c | 19 ++++++++++++-------
 1 file changed, 12 insertions(+), 7 deletions(-)

diff --git a/src/intel/tools/disasm.c b/src/intel/tools/disasm.c
index 7e5a7cb..89c711b 100644
--- a/src/intel/tools/disasm.c
+++ b/src/intel/tools/disasm.c
@@ -35,6 +35,15 @@ struct gen_disasm {
     struct gen_device_info devinfo;
 };
 
+static bool
+is_send(uint32_t opcode)
+{
+   return (opcode == BRW_OPCODE_SEND  ||
+           opcode == BRW_OPCODE_SENDC ||
+           opcode == BRW_OPCODE_SENDS ||
+           opcode == BRW_OPCODE_SENDSC );
+}
+
 void
 gen_disasm_disassemble(struct gen_disasm *disasm, void *assembly, int start,
                        int end, FILE *out)
@@ -74,14 +83,10 @@ gen_disasm_disassemble(struct gen_disasm *disasm, void *assembly, int start,
       brw_disassemble_inst(out, devinfo, insn, compacted);
 
       /* Simplistic, but efficient way to terminate disasm */
-      if (brw_inst_opcode(devinfo, insn) == BRW_OPCODE_SEND ||
-          brw_inst_opcode(devinfo, insn) == BRW_OPCODE_SENDC) {
-         if (brw_inst_eot(devinfo, insn))
-            break;
-      }
-
-      if (brw_inst_opcode(devinfo, insn) == 0)
+      uint32_t opcode = brw_inst_opcode(devinfo, insn);
+      if (opcode == 0 || (is_send(opcode) && brw_inst_eot(devinfo, insn))) {
          break;
+      }
    }
 }
 




More information about the mesa-commit mailing list