i965/vec4: add a horiz_offset() helper
authorIago Toral Quiroga <itoral@igalia.com>
Thu, 25 Aug 2016 08:02:45 +0000 (10:02 +0200)
committerSamuel Iglesias Gonsálvez <siglesias@igalia.com>
Tue, 3 Jan 2017 10:26:51 +0000 (11:26 +0100)
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 <mattst88@gmail.com>
src/mesa/drivers/dri/i965/brw_ir_vec4.h

index 766cec7e9e1b71e50b3c74c5fa93827ecf157b2c..57fc6be8f8972dd1f28af6d5eea4cf769767a049 100644 (file)
@@ -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)
 {