ir3: Print multi-mov instructions
authorConnor Abbott <cwabbott0@gmail.com>
Thu, 22 Apr 2021 17:49:07 +0000 (19:49 +0200)
committerMarge Bot <eric+marge@anholt.net>
Tue, 29 Jun 2021 08:08:12 +0000 (08:08 +0000)
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11565>

src/freedreno/ir3/disasm-a3xx.c
src/freedreno/ir3/ir3_print.c

index b0cfa73..0651fe6 100644 (file)
@@ -188,6 +188,9 @@ static const struct opc_info {
        /* category 1: */
        OPC(1, OPC_MOV,          ),
        OPC(1, OPC_MOVMSK,       movmsk),
+       OPC(1, OPC_SWZ,          swz),
+       OPC(1, OPC_SCT,          sct),
+       OPC(1, OPC_GAT,          gat),
 
        /* category 2: */
        OPC(2, OPC_ADD_F,        add.f),
index 14fc4ef..f6ce0c8 100644 (file)
@@ -109,13 +109,20 @@ static void print_instr_name(struct log_stream *stream, struct ir3_instruction *
                /* shouldn't hit here.. just for debugging: */
                default: mesa_log_stream_printf(stream, "_meta:%d", instr->opc);    break;
                }
-       } else if (instr->opc == OPC_MOV) {
-               if (instr->cat1.src_type == instr->cat1.dst_type)
-                       mesa_log_stream_printf(stream, "mov");
-               else
-                       mesa_log_stream_printf(stream, "cov");
-               mesa_log_stream_printf(stream, ".%s%s", type_name(instr->cat1.src_type),
-                               type_name(instr->cat1.dst_type));
+       } else if (opc_cat(instr->opc) == 1) {
+               if (instr->opc == OPC_MOV) {
+                       if (instr->cat1.src_type == instr->cat1.dst_type)
+                               mesa_log_stream_printf(stream, "mov");
+                       else
+                               mesa_log_stream_printf(stream, "cov");
+               } else {
+                       mesa_log_stream_printf(stream, "%s", disasm_a3xx_instr_name(instr->opc));
+               }
+
+               if (instr->opc != OPC_MOVMSK) {
+                       mesa_log_stream_printf(stream, ".%s%s", type_name(instr->cat1.src_type),
+                                       type_name(instr->cat1.dst_type));
+               }
        } else {
                mesa_log_stream_printf(stream, "%s", disasm_a3xx_instr_name(instr->opc));
                if (instr->flags & IR3_INSTR_3D)
@@ -276,7 +283,7 @@ print_instr(struct log_stream *stream, struct ir3_instruction *instr, int lvl)
        if (!is_flow(instr) || instr->opc == OPC_END || instr->opc == OPC_CHMASK) {
                bool first = true;
                foreach_dst (reg, instr) {
-                       if (dest_regs(instr) == 0)
+                       if (reg->wrmask == 0)
                                continue;
                        if (!first)
                                mesa_log_stream_printf(stream, ", ");