aboutsummaryrefslogtreecommitdiffstats
path: root/src/mesa/drivers
diff options
context:
space:
mode:
authorIago Toral Quiroga <[email protected]>2016-08-25 10:02:45 +0200
committerSamuel Iglesias Gonsálvez <[email protected]>2017-01-03 11:26:51 +0100
commit07cadc306ec161fdf566918175f8d8fc618d9c1b (patch)
tree243f70870179252242fb492fcd11d910496daf89 /src/mesa/drivers
parent4ea3bf8ebb56c8db6e885a77d81502a0b2adca4f (diff)
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 <[email protected]>
Diffstat (limited to 'src/mesa/drivers')
-rw-r--r--src/mesa/drivers/dri/i965/brw_ir_vec4.h12
1 files changed, 12 insertions, 0 deletions
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().
@@ -187,6 +193,12 @@ offset(dst_reg reg, unsigned width, unsigned 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)
{
assert(reg.file != IMM);