From: Matt Turner Date: Mon, 29 Aug 2016 22:57:41 +0000 (-0700) Subject: i965: Pass start_offset to brw_set_uip_jip(). X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=90eaf01616a8cf7a39dae63a3d5636874fa68fa5;p=mesa.git i965: Pass start_offset to brw_set_uip_jip(). Without this, we would pass over the instructions in the SIMD8 program (which is located earlier in the buffer) when brw_set_uip_jip() is called to handle the SIMD16 program. The assertion about compacted control flow was bogus: halt, cont, break cannot be compacted because they have both JIP and UIP. Instead, we should never see a compacted instruction in this code at all. Reviewed-by: Iago Toral Quiroga --- diff --git a/src/mesa/drivers/dri/i965/brw_eu.h b/src/mesa/drivers/dri/i965/brw_eu.h index aeb1a767b92..2898b2ffc8b 100644 --- a/src/mesa/drivers/dri/i965/brw_eu.h +++ b/src/mesa/drivers/dri/i965/brw_eu.h @@ -526,7 +526,7 @@ void brw_math_invert( struct brw_codegen *p, void brw_set_src1(struct brw_codegen *p, brw_inst *insn, struct brw_reg reg); -void brw_set_uip_jip(struct brw_codegen *p); +void brw_set_uip_jip(struct brw_codegen *p, int start_offset); enum brw_conditional_mod brw_negate_cmod(uint32_t cmod); enum brw_conditional_mod brw_swap_cmod(uint32_t cmod); diff --git a/src/mesa/drivers/dri/i965/brw_eu_emit.c b/src/mesa/drivers/dri/i965/brw_eu_emit.c index 31fe040fe02..6da47f26f72 100644 --- a/src/mesa/drivers/dri/i965/brw_eu_emit.c +++ b/src/mesa/drivers/dri/i965/brw_eu_emit.c @@ -2775,7 +2775,7 @@ brw_find_loop_end(struct brw_codegen *p, int start_offset) * BREAK, CONT, and HALT instructions to their correct locations. */ void -brw_set_uip_jip(struct brw_codegen *p) +brw_set_uip_jip(struct brw_codegen *p, int start_offset) { const struct brw_device_info *devinfo = p->devinfo; int offset; @@ -2786,17 +2786,9 @@ brw_set_uip_jip(struct brw_codegen *p) if (devinfo->gen < 6) return; - for (offset = 0; offset < p->next_insn_offset; - offset = next_offset(devinfo, store, offset)) { + for (offset = start_offset; offset < p->next_insn_offset; offset += 16) { brw_inst *insn = store + offset; - - if (brw_inst_cmpt_control(devinfo, insn)) { - /* Fixups for compacted BREAK/CONTINUE not supported yet. */ - assert(brw_inst_opcode(devinfo, insn) != BRW_OPCODE_BREAK && - brw_inst_opcode(devinfo, insn) != BRW_OPCODE_CONTINUE && - brw_inst_opcode(devinfo, insn) != BRW_OPCODE_HALT); - continue; - } + assert(brw_inst_cmpt_control(devinfo, insn) == 0); int block_end_offset = brw_find_next_block_end(p, offset); switch (brw_inst_opcode(devinfo, insn)) { diff --git a/src/mesa/drivers/dri/i965/brw_fs_generator.cpp b/src/mesa/drivers/dri/i965/brw_fs_generator.cpp index c96e3e9acfe..2f4ba7b5592 100644 --- a/src/mesa/drivers/dri/i965/brw_fs_generator.cpp +++ b/src/mesa/drivers/dri/i965/brw_fs_generator.cpp @@ -2127,7 +2127,7 @@ fs_generator::generate_code(const cfg_t *cfg, int dispatch_width) } } - brw_set_uip_jip(p); + brw_set_uip_jip(p, start_offset); annotation_finalize(&annotation, p->next_insn_offset); #ifndef NDEBUG diff --git a/src/mesa/drivers/dri/i965/brw_vec4_generator.cpp b/src/mesa/drivers/dri/i965/brw_vec4_generator.cpp index b428d3a92e3..9f943839f80 100644 --- a/src/mesa/drivers/dri/i965/brw_vec4_generator.cpp +++ b/src/mesa/drivers/dri/i965/brw_vec4_generator.cpp @@ -2024,7 +2024,7 @@ generate_code(struct brw_codegen *p, } } - brw_set_uip_jip(p); + brw_set_uip_jip(p, 0); annotation_finalize(&annotation, p->next_insn_offset); #ifndef NDEBUG