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 <mattst88@gmail.com>
This commit is contained in:
Iago Toral Quiroga 2016-08-25 10:02:45 +02:00 committed by Samuel Iglesias Gonsálvez
parent 4ea3bf8ebb
commit 07cadc306e
1 changed files with 12 additions and 0 deletions

View 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)
{