diff options
author | Matt Turner <[email protected]> | 2017-11-15 17:08:42 -0800 |
---|---|---|
committer | Matt Turner <[email protected]> | 2017-11-17 12:14:38 -0800 |
commit | 4f82b17287194ca7d10816f6cfe4712a3e0a03fc (patch) | |
tree | 7e2bb056e5c389643e9338e4359e5aae9ab49f92 /src/intel/compiler/test_eu_validate.cpp | |
parent | f80e97346b0da9fab3d60b46bdcf0a0d702f97c9 (diff) |
i965: Rewrite disassembly annotation code
The old code used an array to store each "instruction group" (the new,
better name than the old overloaded "annotation"), and required a
memmove() to shift elements over in the array when we needed to split a
group so that we could add an error message. This was confusing and
difficult to get right, not the least of which was because the array
has a tail sentinel not included in .ann_count.
Instead use a linked list, a data structure made for efficient
insertion.
Acked-by: Samuel Iglesias Gonsálvez <[email protected]>
Reviewed-by: Kenneth Graunke <[email protected]>
Diffstat (limited to 'src/intel/compiler/test_eu_validate.cpp')
-rw-r--r-- | src/intel/compiler/test_eu_validate.cpp | 17 |
1 files changed, 6 insertions, 11 deletions
diff --git a/src/intel/compiler/test_eu_validate.cpp b/src/intel/compiler/test_eu_validate.cpp index e8b175beea7..b147b6b227e 100644 --- a/src/intel/compiler/test_eu_validate.cpp +++ b/src/intel/compiler/test_eu_validate.cpp @@ -113,25 +113,20 @@ static bool validate(struct brw_codegen *p) { const bool print = getenv("TEST_DEBUG"); - struct annotation_info annotation; - memset(&annotation, 0, sizeof(annotation)); + struct disasm_info disasm = disasm_initialize(p->devinfo, NULL); if (print) { - annotation.mem_ctx = ralloc_context(NULL); - annotation.ann_count = 1; - annotation.ann_size = 2; - annotation.ann = rzalloc_array(annotation.mem_ctx, struct annotation, - annotation.ann_size); - annotation.ann[annotation.ann_count].offset = p->next_insn_offset; + disasm_new_inst_group(&disasm, 0); + disasm_new_inst_group(&disasm, p->next_insn_offset); } bool ret = brw_validate_instructions(p->devinfo, p->store, 0, - p->next_insn_offset, &annotation); + p->next_insn_offset, &disasm); if (print) { - dump_assembly(p->store, annotation.ann_count, annotation.ann, p->devinfo); - ralloc_free(annotation.mem_ctx); + dump_assembly(p->store, &disasm); } + ralloc_free(disasm.mem_ctx); return ret; } |