[Mesa-dev] [PATCH] r600g: Report Instructions Group count with R600_DUMP_SHADERS=1

Vincent Lejeune vljn at ovi.com
Wed Feb 13 09:10:32 PST 2013


---
 src/gallium/drivers/r600/r600_asm.c | 7 ++++++-
 src/gallium/drivers/r600/r600_asm.h | 1 +
 2 files changed, 7 insertions(+), 1 deletion(-)

diff --git a/src/gallium/drivers/r600/r600_asm.c b/src/gallium/drivers/r600/r600_asm.c
index 3632aa5..eacdb0c 100644
--- a/src/gallium/drivers/r600/r600_asm.c
+++ b/src/gallium/drivers/r600/r600_asm.c
@@ -812,6 +812,8 @@ static int merge_inst_groups(struct r600_bytecode *bc, struct r600_bytecode_alu
 
 	/* looks like everything worked out right, apply the changes */
 
+	bc->nig --;
+
 	/* undo adding previus literals */
 	bc->cf_last->ndw -= align(prev_nliteral, 2);
 
@@ -1140,6 +1142,9 @@ int r600_bytecode_add_alu_type(struct r600_bytecode *bc,
 	if (nalu->dst.sel >= bc->ngpr) {
 		bc->ngpr = nalu->dst.sel + 1;
 	}
+	if (nalu->last) {
+		bc->nig ++;
+	}
 	LIST_ADDTAIL(&nalu->list, &bc->cf_last->alu);
 	/* each alu use 2 dwords */
 	bc->cf_last->ndw += 2;
@@ -2105,7 +2110,7 @@ void r600_bytecode_dump(struct r600_bytecode *bc)
 		chip = '6';
 		break;
 	}
-	fprintf(stderr, "bytecode %d dw -- %d gprs ---------------------\n", bc->ndw, bc->ngpr);
+	fprintf(stderr, "bytecode %d dw -- %d gprs -- %d ig-------------\n", bc->ndw, bc->ngpr, bc->nig);
 	fprintf(stderr, "     %c\n", chip);
 
 	LIST_FOR_EACH_ENTRY(cf, &bc->cf, list) {
diff --git a/src/gallium/drivers/r600/r600_asm.h b/src/gallium/drivers/r600/r600_asm.h
index 03cd238..1638ca0 100644
--- a/src/gallium/drivers/r600/r600_asm.h
+++ b/src/gallium/drivers/r600/r600_asm.h
@@ -192,6 +192,7 @@ struct r600_bytecode {
 	struct r600_bytecode_cf		*cf_last;
 	unsigned			ndw;
 	unsigned			ncf;
+	unsigned			nig; // Number of Instructions Group
 	unsigned			ngpr;
 	unsigned			nstack;
 	unsigned			nresource;
-- 
1.8.1.2



More information about the mesa-dev mailing list