Mesa (main): ir3: Print multi-mov instructions

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Tue Jun 29 08:25:32 UTC 2021


Module: Mesa
Branch: main
Commit: 78ab6250b50a1e348838eeff475498845a5b198c
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=78ab6250b50a1e348838eeff475498845a5b198c

Author: Connor Abbott <cwabbott0 at gmail.com>
Date:   Thu Apr 22 19:49:07 2021 +0200

ir3: Print multi-mov instructions

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11565>

---

 src/freedreno/ir3/disasm-a3xx.c |  3 +++
 src/freedreno/ir3/ir3_print.c   | 23 +++++++++++++++--------
 2 files changed, 18 insertions(+), 8 deletions(-)

diff --git a/src/freedreno/ir3/disasm-a3xx.c b/src/freedreno/ir3/disasm-a3xx.c
index b0cfa73a4c1..0651fe67c70 100644
--- a/src/freedreno/ir3/disasm-a3xx.c
+++ b/src/freedreno/ir3/disasm-a3xx.c
@@ -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),
diff --git a/src/freedreno/ir3/ir3_print.c b/src/freedreno/ir3/ir3_print.c
index 14fc4ef9a9f..f6ce0c8f39a 100644
--- a/src/freedreno/ir3/ir3_print.c
+++ b/src/freedreno/ir3/ir3_print.c
@@ -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, ", ");



More information about the mesa-commit mailing list