From 381cd2d63f4aae29d478e02dda5a978a668168e1 Mon Sep 17 00:00:00 2001 From: Keith Whitwell Date: Fri, 6 Nov 2009 11:21:48 +0000 Subject: [PATCH] i965g: disassemble each instruction as generated --- src/gallium/drivers/i965/brw_context.h | 1 + src/gallium/drivers/i965/brw_debug.h | 2 +- src/gallium/drivers/i965/brw_disasm.c | 2 +- src/gallium/drivers/i965/brw_eu_emit.c | 7 +++++++ src/gallium/drivers/i965/brw_screen.c | 1 + 5 files changed, 11 insertions(+), 2 deletions(-) diff --git a/src/gallium/drivers/i965/brw_context.h b/src/gallium/drivers/i965/brw_context.h index b81dff0aa05..05fc9d45b56 100644 --- a/src/gallium/drivers/i965/brw_context.h +++ b/src/gallium/drivers/i965/brw_context.h @@ -788,6 +788,7 @@ int brw_upload_urb_fence(struct brw_context *brw); int brw_upload_cs_urb_state(struct brw_context *brw); /* brw_disasm.c */ +int brw_disasm_insn (FILE *file, const struct brw_instruction *inst); int brw_disasm (FILE *file, const struct brw_instruction *inst, unsigned count); diff --git a/src/gallium/drivers/i965/brw_debug.h b/src/gallium/drivers/i965/brw_debug.h index ea3c87218be..0deddbf9770 100644 --- a/src/gallium/drivers/i965/brw_debug.h +++ b/src/gallium/drivers/i965/brw_debug.h @@ -16,7 +16,7 @@ #define DEBUG_PIXEL 0x100 #define DEBUG_BUFMGR 0x200 #define DEBUG_MIN_URB 0x400 -#define DEBUG_unused2 0x800 +#define DEBUG_DISASSEM 0x800 #define DEBUG_unused3 0x1000 #define DEBUG_SYNC 0x2000 #define DEBUG_PRIMS 0x4000 diff --git a/src/gallium/drivers/i965/brw_disasm.c b/src/gallium/drivers/i965/brw_disasm.c index df0c7b9a2b8..4100f11d48f 100644 --- a/src/gallium/drivers/i965/brw_disasm.c +++ b/src/gallium/drivers/i965/brw_disasm.c @@ -770,7 +770,7 @@ static int src1 (FILE *file, const struct brw_instruction *inst) } } -static int brw_disasm_insn (FILE *file, const struct brw_instruction *inst) +int brw_disasm_insn (FILE *file, const struct brw_instruction *inst) { int err = 0; int space = 0; diff --git a/src/gallium/drivers/i965/brw_eu_emit.c b/src/gallium/drivers/i965/brw_eu_emit.c index f7fa5203488..7776b4f9655 100644 --- a/src/gallium/drivers/i965/brw_eu_emit.c +++ b/src/gallium/drivers/i965/brw_eu_emit.c @@ -33,6 +33,7 @@ #include "brw_context.h" #include "brw_defines.h" #include "brw_eu.h" +#include "brw_debug.h" @@ -473,6 +474,12 @@ static struct brw_instruction *next_insn( struct brw_compile *p, { struct brw_instruction *insn; + if (0 && (BRW_DEBUG & DEBUG_DISASSEM)) + { + if (p->nr_insn) + brw_disasm_insn(stderr, &p->store[p->nr_insn-1]); + } + assert(p->nr_insn + 1 < BRW_EU_MAX_INSN); insn = &p->store[p->nr_insn++]; diff --git a/src/gallium/drivers/i965/brw_screen.c b/src/gallium/drivers/i965/brw_screen.c index 275ff0959f9..9d8066442be 100644 --- a/src/gallium/drivers/i965/brw_screen.c +++ b/src/gallium/drivers/i965/brw_screen.c @@ -49,6 +49,7 @@ static const struct debug_named_value debug_names[] = { { "pix", DEBUG_PIXEL}, { "buf", DEBUG_BUFMGR}, { "min", DEBUG_MIN_URB}, + { "dis", DEBUG_DISASSEM}, { "sync", DEBUG_SYNC}, { "prim", DEBUG_PRIMS }, { "vert", DEBUG_VERTS }, -- 2.30.2