summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMatt Turner <[email protected]>2018-12-11 22:04:42 -0800
committerMatt Turner <[email protected]>2019-01-09 16:42:41 -0800
commit2b801b66686ec893d1335c971724deb5a624c76f (patch)
tree4e12c2f5a9e13358810f6cbd1d320f223dd0a802 /src
parent3b967e172456ccb876974fb17aae39d0c6c743e0 (diff)
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 <[email protected]>
Diffstat (limited to 'src')
-rw-r--r--src/intel/compiler/brw_fs_combine_constants.cpp7
1 files changed, 4 insertions, 3 deletions
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;
}
}