[Mesa-dev] [PATCH 21/23] i965/disasm: Stop using gen8_disassemble in favor of brw_disassemble.
Kenneth Graunke
kenneth at whitecape.org
Sat Jun 28 21:34:00 PDT 2014
At this point, brw_disassemble can do everything gen8_disassemble can
do - and, thanks to the new brw_inst API, it supports all generations.
Signed-off-by: Kenneth Graunke <kenneth at whitecape.org>
---
src/mesa/drivers/dri/i965/brw_fs_generator.cpp | 3 +--
src/mesa/drivers/dri/i965/brw_vec4_generator.cpp | 3 +--
src/mesa/drivers/dri/i965/gen8_fs_generator.cpp | 3 +--
src/mesa/drivers/dri/i965/gen8_generator.cpp | 22 ----------------------
src/mesa/drivers/dri/i965/gen8_generator.h | 4 ----
src/mesa/drivers/dri/i965/gen8_vec4_generator.cpp | 3 +--
src/mesa/drivers/dri/i965/intel_asm_printer.c | 6 +++---
src/mesa/drivers/dri/i965/intel_asm_printer.h | 6 +-----
8 files changed, 8 insertions(+), 42 deletions(-)
diff --git a/src/mesa/drivers/dri/i965/brw_fs_generator.cpp b/src/mesa/drivers/dri/i965/brw_fs_generator.cpp
index bdac2a2..0f41781 100644
--- a/src/mesa/drivers/dri/i965/brw_fs_generator.cpp
+++ b/src/mesa/drivers/dri/i965/brw_fs_generator.cpp
@@ -1795,8 +1795,7 @@ fs_generator::generate_code(exec_list *instructions)
const struct gl_program *prog = fp ? &fp->Base : NULL;
- dump_assembly(p->store, annotation.ann_count, annotation.ann,
- brw, prog, brw_disassemble);
+ dump_assembly(p->store, annotation.ann_count, annotation.ann, brw, prog);
ralloc_free(annotation.ann);
}
}
diff --git a/src/mesa/drivers/dri/i965/brw_vec4_generator.cpp b/src/mesa/drivers/dri/i965/brw_vec4_generator.cpp
index 5247616..9e0e7bb 100644
--- a/src/mesa/drivers/dri/i965/brw_vec4_generator.cpp
+++ b/src/mesa/drivers/dri/i965/brw_vec4_generator.cpp
@@ -1296,8 +1296,7 @@ vec4_generator::generate_code(exec_list *instructions)
before_size / 16, before_size, after_size,
100.0f * (before_size - after_size) / before_size);
- dump_assembly(p->store, annotation.ann_count, annotation.ann,
- brw, prog, brw_disassemble);
+ dump_assembly(p->store, annotation.ann_count, annotation.ann, brw, prog);
ralloc_free(annotation.ann);
}
}
diff --git a/src/mesa/drivers/dri/i965/gen8_fs_generator.cpp b/src/mesa/drivers/dri/i965/gen8_fs_generator.cpp
index 6d455a3..4725774 100644
--- a/src/mesa/drivers/dri/i965/gen8_fs_generator.cpp
+++ b/src/mesa/drivers/dri/i965/gen8_fs_generator.cpp
@@ -1271,8 +1271,7 @@ gen8_fs_generator::generate_code(exec_list *instructions)
fprintf(stderr, "SIMD%d shader: %d instructions.\n",
dispatch_width, before_size / 16);
- dump_assembly(store, annotation.ann_count, annotation.ann, brw, prog,
- gen8_disassemble);
+ dump_assembly(store, annotation.ann_count, annotation.ann, brw, prog);
ralloc_free(annotation.ann);
}
}
diff --git a/src/mesa/drivers/dri/i965/gen8_generator.cpp b/src/mesa/drivers/dri/i965/gen8_generator.cpp
index 2a9bf83..a41aa7b 100644
--- a/src/mesa/drivers/dri/i965/gen8_generator.cpp
+++ b/src/mesa/drivers/dri/i965/gen8_generator.cpp
@@ -619,25 +619,3 @@ gen8_generator::HALT()
gen8_set_mask_control(inst, BRW_MASK_DISABLE);
return inst;
}
-
-extern "C" void
-gen8_disassemble(struct brw_context *brw, void *assembly,
- int start, int end, FILE *out)
-{
- bool dump_hex = false;
-
- for (int offset = start; offset < end; offset += 16) {
- gen8_instruction *inst = &((gen8_instruction *)assembly)[offset / 16];
- fprintf(stderr, "0x%08x: ", offset);
-
- if (dump_hex) {
- fprintf(stderr, "0x%08x 0x%08x 0x%08x 0x%08x ",
- ((uint32_t *) inst)[3],
- ((uint32_t *) inst)[2],
- ((uint32_t *) inst)[1],
- ((uint32_t *) inst)[0]);
- }
-
- gen8_disassemble_inst(stderr, inst, brw->gen);
- }
-}
diff --git a/src/mesa/drivers/dri/i965/gen8_generator.h b/src/mesa/drivers/dri/i965/gen8_generator.h
index cdb2741..f91044a 100644
--- a/src/mesa/drivers/dri/i965/gen8_generator.h
+++ b/src/mesa/drivers/dri/i965/gen8_generator.h
@@ -194,7 +194,3 @@ protected:
void *mem_ctx;
};
-
-extern "C" void
-gen8_disassemble(struct brw_context *brw, void *assembly,
- int start, int end, FILE *out);
diff --git a/src/mesa/drivers/dri/i965/gen8_vec4_generator.cpp b/src/mesa/drivers/dri/i965/gen8_vec4_generator.cpp
index 82ea45a..da6c897 100644
--- a/src/mesa/drivers/dri/i965/gen8_vec4_generator.cpp
+++ b/src/mesa/drivers/dri/i965/gen8_vec4_generator.cpp
@@ -898,8 +898,7 @@ gen8_vec4_generator::generate_code(exec_list *instructions)
}
fprintf(stderr, "vec4 shader: %d instructions.\n", before_size / 16);
- dump_assembly(store, annotation.ann_count, annotation.ann,
- brw, prog, gen8_disassemble);
+ dump_assembly(store, annotation.ann_count, annotation.ann, brw, prog);
ralloc_free(annotation.ann);
}
}
diff --git a/src/mesa/drivers/dri/i965/intel_asm_printer.c b/src/mesa/drivers/dri/i965/intel_asm_printer.c
index f533e7c..3c2d256 100644
--- a/src/mesa/drivers/dri/i965/intel_asm_printer.c
+++ b/src/mesa/drivers/dri/i965/intel_asm_printer.c
@@ -22,14 +22,14 @@
*/
#include "brw_cfg.h"
+#include "brw_eu.h"
#include "intel_asm_printer.h"
#include "program/prog_print.h"
#include "program/prog_instruction.h"
void
dump_assembly(void *assembly, int num_annotations, struct annotation *annotation,
- struct brw_context *brw, const struct gl_program *prog,
- disassemble_func disassemble)
+ struct brw_context *brw, const struct gl_program *prog)
{
const char *last_annotation_string = NULL;
const void *last_annotation_ir = NULL;
@@ -73,7 +73,7 @@ dump_assembly(void *assembly, int num_annotations, struct annotation *annotation
fprintf(stderr, " %s\n", last_annotation_string);
}
- disassemble(brw, assembly, start_offset, end_offset, stderr);
+ brw_disassemble(brw, assembly, start_offset, end_offset, stderr);
if (annotation[i].block_end) {
fprintf(stderr, " END B%d", annotation[i].block_end->block_num);
diff --git a/src/mesa/drivers/dri/i965/intel_asm_printer.h b/src/mesa/drivers/dri/i965/intel_asm_printer.h
index dfe64d6..50ed21a 100644
--- a/src/mesa/drivers/dri/i965/intel_asm_printer.h
+++ b/src/mesa/drivers/dri/i965/intel_asm_printer.h
@@ -56,13 +56,9 @@ struct annotation_info {
int cur_block;
};
-typedef void (*disassemble_func)(struct brw_context *brw, void *assembly,
- int start, int end, FILE *out);
-
void
dump_assembly(void *assembly, int num_annotations, struct annotation *annotation,
- struct brw_context *brw, const struct gl_program *prog,
- disassemble_func disassemble);
+ struct brw_context *brw, const struct gl_program *prog);
#ifdef __cplusplus
} /* extern "C" */
--
2.0.0
More information about the mesa-dev
mailing list