From 07cadc306ec161fdf566918175f8d8fc618d9c1b Mon Sep 17 00:00:00 2001 From: Iago Toral Quiroga Date: Thu, 25 Aug 2016 10:02:45 +0200 Subject: [PATCH] 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 --- src/mesa/drivers/dri/i965/brw_ir_vec4.h | 12 ++++++++++++ 1 file changed, 12 insertions(+) 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) { -- 2.30.2