i965/fs: Add a function for getting a component of a 8 or 16-wide register
Signed-off-by: Jason Ekstrand <jason.ekstrand@intel.com> Reviewed-by: Matt Turner <mattst88@gmail.com>
This commit is contained in:
parent
30d718c2fb
commit
65ddf6f404
|
@ -162,6 +162,16 @@ offset(fs_reg reg, unsigned delta)
|
|||
return reg;
|
||||
}
|
||||
|
||||
static inline fs_reg
|
||||
component(fs_reg reg, unsigned idx)
|
||||
{
|
||||
assert(reg.subreg_offset == 0);
|
||||
assert(idx < reg.width);
|
||||
reg.subreg_offset = idx * type_sz(reg.type);
|
||||
reg.width = 1;
|
||||
return reg;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get either of the 8-component halves of a 16-component register.
|
||||
*
|
||||
|
|
Loading…
Reference in New Issue