summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSamuel Iglesias Gonsálvez <siglesias@igalia.com>2017-03-17 11:55:49 +0100
committerFrancisco Jerez <currojerez@riseup.net>2017-04-14 14:56:09 -0700
commitc1fc8fad47f60bda857fc45c4052c5f4effe0d84 (patch)
treee8619aeb0d9998486d4afe03e29c8e1df07e34f8
parent21e8e3a8484241508ac2c250fc4367234fa337df (diff)
i965/vec4: don't do horizontal stride on some register file types
horiz_offset() shouldn't be doing anything for scalar registers, because all channels of any SIMD instructions will end up reading or writing the same component of the register, so shifting the register offset would be wrong. Signed-off-by: Samuel Iglesias Gonsálvez <siglesias@igalia.com> [ Francisco Jerez: Re-implement in terms of is_uniform() for simplicity. Pass argument by const reference. Clarify commit message. ] Reviewed-by: Francisco Jerez <currojerez@riseup.net>
-rw-r--r--src/intel/compiler/brw_ir_vec4.h7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/intel/compiler/brw_ir_vec4.h b/src/intel/compiler/brw_ir_vec4.h
index 56548c3883..a0e6402b0a 100644
--- a/src/intel/compiler/brw_ir_vec4.h
+++ b/src/intel/compiler/brw_ir_vec4.h
@@ -192,9 +192,12 @@ offset(dst_reg reg, unsigned width, unsigned delta)
}
static inline dst_reg
-horiz_offset(dst_reg reg, unsigned delta)
+horiz_offset(const dst_reg &reg, unsigned delta)
{
- return byte_offset(reg, delta * type_sz(reg.type));
+ if (is_uniform(src_reg(reg)))
+ return reg;
+ else
+ return byte_offset(reg, delta * type_sz(reg.type));
}
static inline dst_reg