summaryrefslogtreecommitdiffstats
path: root/src/intel/compiler
diff options
context:
space:
mode:
authorJuan A. Suarez Romero <[email protected]>2016-09-23 15:57:39 +0000
committerFrancisco Jerez <[email protected]>2017-04-14 14:56:08 -0700
commita907c91e93cce88ee1929263c455fab541b8c4a3 (patch)
tree3da6efa50b778c94265d7ef7c0f38c9b5320c725 /src/intel/compiler
parent92649a3e6756465b3961cf05910cda93a69c7790 (diff)
i965/vec4: consider subregister offset in live variables
Take into account offset values less than a full register (32 bytes) when getting the var from register. This is required when dealing with an operation that writes half of the register (like one d2x in IVB/BYT, which uses exec_size == 4). v2: - Take in account this offset < 32 in liveness analysis too (Curro) v3: - Change formula in var_from_reg() (Curro) - Remove useless changes (Curro) Signed-off-by: Samuel Iglesias Gonsálvez <[email protected]> Reviewed-by: Francisco Jerez <[email protected]>
Diffstat (limited to 'src/intel/compiler')
-rw-r--r--src/intel/compiler/brw_vec4_live_variables.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/intel/compiler/brw_vec4_live_variables.h b/src/intel/compiler/brw_vec4_live_variables.h
index 2946b98aacc..92f79550fd4 100644
--- a/src/intel/compiler/brw_vec4_live_variables.h
+++ b/src/intel/compiler/brw_vec4_live_variables.h
@@ -91,7 +91,7 @@ var_from_reg(const simple_allocator &alloc, const src_reg &reg,
assert(reg.file == VGRF && reg.nr < alloc.count && c < 4);
const unsigned csize = DIV_ROUND_UP(type_sz(reg.type), 4);
unsigned result =
- 8 * (alloc.offsets[reg.nr] + reg.offset / REG_SIZE) +
+ 8 * alloc.offsets[reg.nr] + reg.offset / 4 +
(BRW_GET_SWZ(reg.swizzle, c) + k / csize * 4) * csize + k % csize;
/* Do not exceed the limit for this register */
assert(result < 8 * (alloc.offsets[reg.nr] + alloc.sizes[reg.nr]));
@@ -105,7 +105,7 @@ var_from_reg(const simple_allocator &alloc, const dst_reg &reg,
assert(reg.file == VGRF && reg.nr < alloc.count && c < 4);
const unsigned csize = DIV_ROUND_UP(type_sz(reg.type), 4);
unsigned result =
- 8 * (alloc.offsets[reg.nr] + reg.offset / REG_SIZE) +
+ 8 * alloc.offsets[reg.nr] + reg.offset / 4 +
(c + k / csize * 4) * csize + k % csize;
/* Do not exceed the limit for this register */
assert(result < 8 * (alloc.offsets[reg.nr] + alloc.sizes[reg.nr]));