mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-22 13:08:09 +02:00
i965g: disassemble more than one instruction at a time
This commit is contained in:
parent
203adb8ea6
commit
aa9773d056
6 changed files with 37 additions and 31 deletions
|
|
@ -794,7 +794,9 @@ 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 (FILE *file, struct brw_instruction *inst);
|
||||
int brw_disasm (FILE *file,
|
||||
const struct brw_instruction *inst,
|
||||
unsigned count);
|
||||
|
||||
/*======================================================================
|
||||
* Inline conversion functions. These are better-typed than the
|
||||
|
|
|
|||
|
|
@ -455,7 +455,7 @@ static int reg (FILE *file, GLuint _reg_file, GLuint _reg_nr)
|
|||
return err;
|
||||
}
|
||||
|
||||
static int dest (FILE *file, struct brw_instruction *inst)
|
||||
static int dest (FILE *file, const struct brw_instruction *inst)
|
||||
{
|
||||
int err = 0;
|
||||
|
||||
|
|
@ -621,7 +621,7 @@ static int src_da16 (FILE *file,
|
|||
}
|
||||
|
||||
|
||||
static int imm (FILE *file, GLuint type, struct brw_instruction *inst) {
|
||||
static int imm (FILE *file, GLuint type, const struct brw_instruction *inst) {
|
||||
switch (type) {
|
||||
case BRW_REGISTER_TYPE_UD:
|
||||
format (file, "0x%08xUD", inst->bits3.ud);
|
||||
|
|
@ -650,7 +650,7 @@ static int imm (FILE *file, GLuint type, struct brw_instruction *inst) {
|
|||
return 0;
|
||||
}
|
||||
|
||||
static int src0 (FILE *file, struct brw_instruction *inst)
|
||||
static int src0 (FILE *file, const struct brw_instruction *inst)
|
||||
{
|
||||
if (inst->bits1.da1.src0_reg_file == BRW_IMMEDIATE_VALUE)
|
||||
return imm (file, inst->bits1.da1.src0_reg_type,
|
||||
|
|
@ -710,7 +710,7 @@ static int src0 (FILE *file, struct brw_instruction *inst)
|
|||
}
|
||||
}
|
||||
|
||||
static int src1 (FILE *file, struct brw_instruction *inst)
|
||||
static int src1 (FILE *file, const struct brw_instruction *inst)
|
||||
{
|
||||
if (inst->bits1.da1.src1_reg_file == BRW_IMMEDIATE_VALUE)
|
||||
return imm (file, inst->bits1.da1.src1_reg_type,
|
||||
|
|
@ -770,7 +770,7 @@ static int src1 (FILE *file, struct brw_instruction *inst)
|
|||
}
|
||||
}
|
||||
|
||||
int brw_disasm (FILE *file, struct brw_instruction *inst)
|
||||
static int brw_disasm_insn (FILE *file, const struct brw_instruction *inst)
|
||||
{
|
||||
int err = 0;
|
||||
int space = 0;
|
||||
|
|
@ -900,3 +900,21 @@ int brw_disasm (FILE *file, struct brw_instruction *inst)
|
|||
newline (file);
|
||||
return err;
|
||||
}
|
||||
|
||||
|
||||
int brw_disasm (FILE *file,
|
||||
const struct brw_instruction *inst,
|
||||
unsigned count)
|
||||
{
|
||||
int i, err;
|
||||
|
||||
for (i = 0; i < count; i++) {
|
||||
err = brw_disasm_insn(stderr, &inst[i]);
|
||||
if (err)
|
||||
return err;
|
||||
}
|
||||
|
||||
fprintf(file, "\n");
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1627,8 +1627,6 @@ void brw_vs_emit(struct brw_vs_compile *c)
|
|||
int i;
|
||||
|
||||
debug_printf("vs-native:\n");
|
||||
for (i = 0; i < p->nr_insn; i++)
|
||||
brw_disasm(stderr, &p->store[i]);
|
||||
debug_printf("\n");
|
||||
brw_disasm(stderr, p->store, p->nr_insn);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1512,11 +1512,7 @@ void brw_wm_emit( struct brw_wm_compile *c )
|
|||
}
|
||||
|
||||
if (BRW_DEBUG & DEBUG_WM) {
|
||||
int i;
|
||||
|
||||
debug_printf("wm-native:\n");
|
||||
for (i = 0; i < p->nr_insn; i++)
|
||||
brw_disasm(stderr, &p->store[i]);
|
||||
debug_printf("\n");
|
||||
brw_disasm(stderr, p->store, p->nr_insn);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2003,9 +2003,7 @@ static void brw_wm_emit_branching_shader(struct brw_context *brw, struct brw_wm_
|
|||
|
||||
if (BRW_DEBUG & DEBUG_WM) {
|
||||
debug_printf("wm-native:\n");
|
||||
for (i = 0; i < p->nr_insn; i++)
|
||||
brw_disasm(stderr, &p->store[i]);
|
||||
debug_printf("\n");
|
||||
brw_disasm(stderr, p->store, p->nr_insn);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -47,7 +47,9 @@
|
|||
|
||||
#define MAX_VRAM (128*1024*1024)
|
||||
|
||||
extern int brw_disasm (FILE *file, struct brw_instruction *inst);
|
||||
extern int brw_disasm (FILE *file,
|
||||
const struct brw_instruction *inst,
|
||||
unsigned count );
|
||||
|
||||
struct xlib_brw_buffer
|
||||
{
|
||||
|
|
@ -236,7 +238,11 @@ xlib_brw_bo_subdata(struct brw_winsys_buffer *buffer,
|
|||
brw_dump_cc_unit_state( data );
|
||||
break;
|
||||
case BRW_DATA_GS_WM_PROG:
|
||||
brw_disasm( stderr, data ); /* disassem */
|
||||
case BRW_DATA_GS_SF_PROG:
|
||||
case BRW_DATA_GS_VS_PROG:
|
||||
case BRW_DATA_GS_GS_PROG:
|
||||
case BRW_DATA_GS_CLIP_PROG:
|
||||
brw_disasm( stderr, data, size / sizeof(struct brw_instruction) );
|
||||
break;
|
||||
case BRW_DATA_GS_SAMPLER_DEFAULT_COLOR:
|
||||
brw_dump_sampler_default_color( data );
|
||||
|
|
@ -247,9 +253,6 @@ xlib_brw_bo_subdata(struct brw_winsys_buffer *buffer,
|
|||
case BRW_DATA_GS_WM_UNIT:
|
||||
brw_dump_wm_unit_state( data );
|
||||
break;
|
||||
case BRW_DATA_GS_SF_PROG:
|
||||
brw_disasm( stderr, data ); /* disassem */
|
||||
break;
|
||||
case BRW_DATA_GS_SF_VP:
|
||||
brw_dump_sf_viewport( data );
|
||||
break;
|
||||
|
|
@ -259,24 +262,15 @@ xlib_brw_bo_subdata(struct brw_winsys_buffer *buffer,
|
|||
case BRW_DATA_GS_VS_UNIT:
|
||||
brw_dump_vs_unit_state( data );
|
||||
break;
|
||||
case BRW_DATA_GS_VS_PROG:
|
||||
brw_disasm( stderr, data ); /* disassem */
|
||||
break;
|
||||
case BRW_DATA_GS_GS_UNIT:
|
||||
brw_dump_gs_unit_state( data );
|
||||
break;
|
||||
case BRW_DATA_GS_GS_PROG:
|
||||
brw_disasm( stderr, data ); /* disassem */
|
||||
break;
|
||||
case BRW_DATA_GS_CLIP_VP:
|
||||
brw_dump_clipper_viewport( data );
|
||||
break;
|
||||
case BRW_DATA_GS_CLIP_UNIT:
|
||||
brw_dump_clip_unit_state( data );
|
||||
break;
|
||||
case BRW_DATA_GS_CLIP_PROG:
|
||||
brw_disasm( stderr, data ); /* disassem */
|
||||
break;
|
||||
case BRW_DATA_SS_SURFACE:
|
||||
brw_dump_surface_state( data );
|
||||
break;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue