[Mesa-dev] [PATCH 2/4] i965: Fix register types in dump_instructions(), again.
Kenneth Graunke
kenneth at whitecape.org
Tue Mar 11 22:15:45 PDT 2014
In commit e57d77280efcbfd6579a88f071426653287ef833, I fixed this for
destinations in the Vec4 backend, and sources in the scalar backend.
But not both types in both backends.
To prevent this mess from continuing, make the reg_encoding table
static, so only the disassembler can use it.
Signed-off-by: Kenneth Graunke <kenneth at whitecape.org>
---
src/mesa/drivers/dri/i965/brw_context.h | 1 -
src/mesa/drivers/dri/i965/brw_disasm.c | 2 +-
src/mesa/drivers/dri/i965/brw_fs.cpp | 2 +-
src/mesa/drivers/dri/i965/brw_vec4.cpp | 2 +-
4 files changed, 3 insertions(+), 4 deletions(-)
diff --git a/src/mesa/drivers/dri/i965/brw_context.h b/src/mesa/drivers/dri/i965/brw_context.h
index 734d273..4c040a9 100644
--- a/src/mesa/drivers/dri/i965/brw_context.h
+++ b/src/mesa/drivers/dri/i965/brw_context.h
@@ -1860,7 +1860,6 @@ struct opcode_desc {
extern const struct opcode_desc opcode_descs[128];
extern const char * const conditional_modifier[16];
-extern const char * const reg_encoding[8];
void
brw_emit_depthbuffer(struct brw_context *brw);
diff --git a/src/mesa/drivers/dri/i965/brw_disasm.c b/src/mesa/drivers/dri/i965/brw_disasm.c
index d79e750..8cd8a40 100644
--- a/src/mesa/drivers/dri/i965/brw_disasm.c
+++ b/src/mesa/drivers/dri/i965/brw_disasm.c
@@ -244,7 +244,7 @@ static const char * const access_mode[2] = {
[1] = "align16",
};
-const char * const reg_encoding[8] = {
+static const char * const reg_encoding[8] = {
[0] = "UD",
[1] = "D",
[2] = "UW",
diff --git a/src/mesa/drivers/dri/i965/brw_fs.cpp b/src/mesa/drivers/dri/i965/brw_fs.cpp
index 27cf0f6..9081aaf 100644
--- a/src/mesa/drivers/dri/i965/brw_fs.cpp
+++ b/src/mesa/drivers/dri/i965/brw_fs.cpp
@@ -3068,7 +3068,7 @@ fs_visitor::dump_instruction(backend_instruction *be_inst)
fprintf(stderr, "???");
break;
}
- fprintf(stderr, ":%s, ", reg_encoding[inst->dst.type]);
+ fprintf(stderr, ":%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)
diff --git a/src/mesa/drivers/dri/i965/brw_vec4.cpp b/src/mesa/drivers/dri/i965/brw_vec4.cpp
index 87825f1..0245f40 100644
--- a/src/mesa/drivers/dri/i965/brw_vec4.cpp
+++ b/src/mesa/drivers/dri/i965/brw_vec4.cpp
@@ -1269,7 +1269,7 @@ vec4_visitor::dump_instruction(backend_instruction *be_inst)
fprintf(stderr, "|");
if (inst->src[i].file != IMM) {
- fprintf(stderr, ":%s", reg_encoding[inst->src[i].type]);
+ fprintf(stderr, ":%s", brw_reg_type_letters(inst->src[i].type));
}
if (i < 2 && inst->src[i + 1].file != BAD_FILE)
--
1.9.0
More information about the mesa-dev
mailing list