diff options
Diffstat (limited to 'src/mesa')
-rw-r--r-- | src/mesa/drivers/dri/i965/brw_eu.c | 29 | ||||
-rw-r--r-- | src/mesa/drivers/dri/i965/brw_fs.cpp | 2 | ||||
-rw-r--r-- | src/mesa/drivers/dri/i965/brw_reg.h | 1 | ||||
-rw-r--r-- | src/mesa/drivers/dri/i965/brw_vec4.cpp | 2 |
4 files changed, 32 insertions, 2 deletions
diff --git a/src/mesa/drivers/dri/i965/brw_eu.c b/src/mesa/drivers/dri/i965/brw_eu.c index dee91123ff3..bb840291f25 100644 --- a/src/mesa/drivers/dri/i965/brw_eu.c +++ b/src/mesa/drivers/dri/i965/brw_eu.c @@ -36,6 +36,35 @@ #include "glsl/ralloc.h" +/** + * Converts a BRW_REGISTER_TYPE_* enum to a short string (F, UD, and so on). + * + * This is different than reg_encoding from brw_disasm.c in that it operates + * on the abstract enum values, rather than the generation-specific encoding. + */ +const char * +brw_reg_type_letters(unsigned type) +{ + const char *names[] = { + [BRW_REGISTER_TYPE_UD] = "UD", + [BRW_REGISTER_TYPE_D] = "D", + [BRW_REGISTER_TYPE_UW] = "UW", + [BRW_REGISTER_TYPE_W] = "W", + [BRW_REGISTER_TYPE_F] = "F", + [BRW_REGISTER_TYPE_UB] = "UB", + [BRW_REGISTER_TYPE_B] = "B", + [BRW_REGISTER_TYPE_UV] = "UV", + [BRW_REGISTER_TYPE_V] = "V", + [BRW_REGISTER_TYPE_VF] = "VF", + [BRW_REGISTER_TYPE_DF] = "DF", + [BRW_REGISTER_TYPE_HF] = "HF", + [BRW_REGISTER_TYPE_UQ] = "UQ", + [BRW_REGISTER_TYPE_Q] = "Q", + }; + assert(type <= BRW_REGISTER_TYPE_UQ); + return names[type]; +} + /* Returns the corresponding conditional mod for swapping src0 and * src1 in e.g. CMP. */ diff --git a/src/mesa/drivers/dri/i965/brw_fs.cpp b/src/mesa/drivers/dri/i965/brw_fs.cpp index 53388224144..c290c28c47c 100644 --- a/src/mesa/drivers/dri/i965/brw_fs.cpp +++ b/src/mesa/drivers/dri/i965/brw_fs.cpp @@ -3127,7 +3127,7 @@ fs_visitor::dump_instruction(backend_instruction *be_inst) printf("|"); if (inst->src[i].file != IMM) { - printf(":%s", reg_encoding[inst->src[i].type]); + printf(":%s", brw_reg_type_letters(inst->src[i].type)); } if (i < 2 && inst->src[i + 1].file != BAD_FILE) diff --git a/src/mesa/drivers/dri/i965/brw_reg.h b/src/mesa/drivers/dri/i965/brw_reg.h index 9673210666e..978dd3f382b 100644 --- a/src/mesa/drivers/dri/i965/brw_reg.h +++ b/src/mesa/drivers/dri/i965/brw_reg.h @@ -116,6 +116,7 @@ enum brw_reg_type { unsigned brw_reg_type_to_hw_type(const struct brw_context *brw, enum brw_reg_type type, unsigned file); +const char *brw_reg_type_letters(unsigned brw_reg_type); #define REG_SIZE (8*4) diff --git a/src/mesa/drivers/dri/i965/brw_vec4.cpp b/src/mesa/drivers/dri/i965/brw_vec4.cpp index d566ea16246..920508118b4 100644 --- a/src/mesa/drivers/dri/i965/brw_vec4.cpp +++ b/src/mesa/drivers/dri/i965/brw_vec4.cpp @@ -1168,7 +1168,7 @@ vec4_visitor::dump_instruction(backend_instruction *be_inst) if (inst->dst.writemask & 8) printf("w"); } - printf(":%s, ", reg_encoding[inst->dst.type]); + printf(":%s, ", brw_reg_type_letters(inst->dst.type)); for (int i = 0; i < 3 && inst->src[i].file != BAD_FILE; i++) { if (inst->src[i].negate) |