diff options
author | Matt Turner <mattst88@gmail.com> | 2014-05-15 16:56:13 -0700 |
---|---|---|
committer | Matt Turner <mattst88@gmail.com> | 2014-05-24 23:03:22 -0700 |
commit | 9976294e867785ea480f52178a3d3dc67ac72d32 (patch) | |
tree | c24ea147fb901057dddb440de53700e3244dc0b5 /src/mesa/drivers/dri/i965/brw_eu_compact.c | |
parent | 2afdd2f40b64e34387b89430bf47ab863d6a8e43 (diff) | |
download | external_mesa3d-9976294e867785ea480f52178a3d3dc67ac72d32.zip external_mesa3d-9976294e867785ea480f52178a3d3dc67ac72d32.tar.gz external_mesa3d-9976294e867785ea480f52178a3d3dc67ac72d32.tar.bz2 |
i965: Pass in start_offset to brw_compact_instructions().
Let's us avoid recompacting the SIMD8 instructions when we compact the
SIMD16 program.
Reviewed-by: Eric Anholt <eric@anholt.net>
Diffstat (limited to 'src/mesa/drivers/dri/i965/brw_eu_compact.c')
-rw-r--r-- | src/mesa/drivers/dri/i965/brw_eu_compact.c | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/src/mesa/drivers/dri/i965/brw_eu_compact.c b/src/mesa/drivers/dri/i965/brw_eu_compact.c index c85bc89..c3a2ec3 100644 --- a/src/mesa/drivers/dri/i965/brw_eu_compact.c +++ b/src/mesa/drivers/dri/i965/brw_eu_compact.c @@ -661,18 +661,18 @@ brw_init_compaction_tables(struct brw_context *brw) } void -brw_compact_instructions(struct brw_compile *p) +brw_compact_instructions(struct brw_compile *p, int start_offset) { struct brw_context *brw = p->brw; - void *store = p->store; + void *store = p->store + start_offset / 16; /* For an instruction at byte offset 8*i before compaction, this is the number * of compacted instructions that preceded it. */ - int compacted_counts[p->next_insn_offset / 8]; + int compacted_counts[(p->next_insn_offset - start_offset) / 8]; /* For an instruction at byte offset 8*i after compaction, this is the * 8-byte offset it was at before compaction. */ - int old_ip[p->next_insn_offset / 8]; + int old_ip[(p->next_insn_offset - start_offset) / 8]; if (brw->gen < 6) return; @@ -680,7 +680,7 @@ brw_compact_instructions(struct brw_compile *p) int src_offset; int offset = 0; int compacted_count = 0; - for (src_offset = 0; src_offset < p->nr_insn * 16;) { + for (src_offset = 0; src_offset < p->next_insn_offset - start_offset;) { struct brw_instruction *src = store + src_offset; void *dst = store + offset; @@ -734,8 +734,8 @@ brw_compact_instructions(struct brw_compile *p) } /* Fix up control flow offsets. */ - p->next_insn_offset = offset; - for (offset = 0; offset < p->next_insn_offset;) { + p->next_insn_offset = start_offset + offset; + for (offset = 0; offset < p->next_insn_offset - start_offset;) { struct brw_instruction *insn = store + offset; int this_old_ip = old_ip[offset / 8]; int this_compacted_count = compacted_counts[this_old_ip]; @@ -786,10 +786,10 @@ brw_compact_instructions(struct brw_compile *p) if (0) { fprintf(stderr, "dumping compacted program\n"); - brw_disassemble(brw, p->store, 0, p->next_insn_offset, stderr); + brw_disassemble(brw, store, 0, p->next_insn_offset - start_offset, stderr); int cmp = 0; - for (offset = 0; offset < p->next_insn_offset;) { + for (offset = 0; offset < p->next_insn_offset - start_offset;) { struct brw_instruction *insn = store + offset; if (insn->header.cmpt_control) { |