From c1fc8fad47f60bda857fc45c4052c5f4effe0d84 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Samuel=20Iglesias=20Gons=C3=A1lvez?= Date: Fri, 17 Mar 2017 11:55:49 +0100 Subject: [PATCH] i965/vec4: don't do horizontal stride on some register file types MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit 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 [ Francisco Jerez: Re-implement in terms of is_uniform() for simplicity. Pass argument by const reference. Clarify commit message. ] Reviewed-by: Francisco Jerez --- src/intel/compiler/brw_ir_vec4.h | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/intel/compiler/brw_ir_vec4.h b/src/intel/compiler/brw_ir_vec4.h index 56548c38830..a0e6402b0a4 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 ®, 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 -- 2.30.2