From: Matt Turner Date: Wed, 12 Dec 2018 06:04:42 +0000 (-0800) Subject: intel/compiler: Rearrange code to avoid future problems X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=2b801b66686ec893d1335c971724deb5a624c76f;p=mesa.git intel/compiler: Rearrange code to avoid future problems A follow on commit will move nr to the same union as the immediate data, so we should assert these invariants before we overwrite the nr field. Reviewed-by: Kenneth Graunke --- diff --git a/src/intel/compiler/brw_fs_combine_constants.cpp b/src/intel/compiler/brw_fs_combine_constants.cpp index e0c95d379b8..7343f77bb45 100644 --- a/src/intel/compiler/brw_fs_combine_constants.cpp +++ b/src/intel/compiler/brw_fs_combine_constants.cpp @@ -294,13 +294,14 @@ fs_visitor::opt_combine_constants() for (int i = 0; i < table.len; i++) { foreach_list_typed(reg_link, link, link, table.imm[i].uses) { fs_reg *reg = link->reg; + assert((isnan(reg->f) && isnan(table.imm[i].val)) || + fabsf(reg->f) == fabs(table.imm[i].val)); + reg->file = VGRF; - reg->nr = table.imm[i].nr; reg->offset = table.imm[i].subreg_offset; reg->stride = 0; reg->negate = signbit(reg->f) != signbit(table.imm[i].val); - assert((isnan(reg->f) && isnan(table.imm[i].val)) || - fabsf(reg->f) == fabs(table.imm[i].val)); + reg->nr = table.imm[i].nr; } }