[Mesa-dev] [PATCH 1/7] i965: Reverse condition ordering to let us support other gens.

Kenneth Graunke kenneth at whitecape.org
Mon Aug 18 14:47:09 PDT 2014


On Monday, August 18, 2014 11:19:47 AM Matt Turner wrote:
> ---
>  src/mesa/drivers/dri/i965/brw_eu_compact.c | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/src/mesa/drivers/dri/i965/brw_eu_compact.c b/src/mesa/drivers/dri/i965/brw_eu_compact.c
> index 625cfbb..25a96e7 100644
> --- a/src/mesa/drivers/dri/i965/brw_eu_compact.c
> +++ b/src/mesa/drivers/dri/i965/brw_eu_compact.c
> @@ -789,14 +789,14 @@ brw_compact_instructions(struct brw_compile *p, int start_offset,
>        case BRW_OPCODE_ELSE:
>        case BRW_OPCODE_ENDIF:
>        case BRW_OPCODE_WHILE:
> -         if (brw->gen == 6) {
> +         if (brw->gen >= 7) {
> +            update_uip_jip(brw, insn, this_old_ip, compacted_counts);
> +         } else if (brw->gen == 6) {
>              int gen6_jump_count = brw_inst_gen6_jump_count(brw, insn);
>              target_old_ip = this_old_ip + gen6_jump_count;
>              target_compacted_count = compacted_counts[target_old_ip];
>              gen6_jump_count -= (target_compacted_count - this_compacted_count);
>              brw_inst_set_gen6_jump_count(brw, insn, gen6_jump_count);
> -         } else {
> -            update_uip_jip(brw, insn, this_old_ip, compacted_counts);
>           }
>           break;
>        }
> 

This isn't necessary - gen >= 8 would've failed the gen == 6 check and hit the else case.  You've just swapped them around for readability...which I like.

Reviewed-by: Kenneth Graunke <kenneth at whitecape.org>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: This is a digitally signed message part.
URL: <http://lists.freedesktop.org/archives/mesa-dev/attachments/20140818/7db123b2/attachment.sig>


More information about the mesa-dev mailing list