From: Iago Toral Quiroga Date: Thu, 25 Aug 2016 08:02:45 +0000 (+0200) Subject: i965/vec4: add a horiz_offset() helper X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=07cadc306ec161fdf566918175f8d8fc618d9c1b;p=mesa.git i965/vec4: add a horiz_offset() helper This will come in handy when we implement a simd lowering pass in a follow-up patch. v2: use byte_offset() Reviewed-by: Matt Turner --- diff --git a/src/mesa/drivers/dri/i965/brw_ir_vec4.h b/src/mesa/drivers/dri/i965/brw_ir_vec4.h index 766cec7e9e1..57fc6be8f89 100644 --- a/src/mesa/drivers/dri/i965/brw_ir_vec4.h +++ b/src/mesa/drivers/dri/i965/brw_ir_vec4.h @@ -111,6 +111,12 @@ offset(src_reg reg, unsigned width, unsigned delta) return byte_offset(reg, num_components * type_sz(reg.type) * delta); } +static inline src_reg +horiz_offset(src_reg reg, unsigned delta) +{ + return byte_offset(reg, delta * type_sz(reg.type)); +} + /** * Reswizzle a given source register. * \sa brw_swizzle(). @@ -186,6 +192,12 @@ offset(dst_reg reg, unsigned width, unsigned delta) return byte_offset(reg, num_components * type_sz(reg.type) * delta); } +static inline dst_reg +horiz_offset(dst_reg reg, unsigned delta) +{ + return byte_offset(reg, delta * type_sz(reg.type)); +} + static inline dst_reg writemask(dst_reg reg, unsigned mask) {