mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-05 00:58:05 +02:00
i965/fs: Fix half() to handle more exotic register files.
horiz_offset() is able to deal with a superset of the register files currently special-cased in half(). Just call horiz_offset() in all cases. Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
This commit is contained in:
parent
8c9601ef7b
commit
298320280f
1 changed files with 4 additions and 21 deletions
|
|
@ -188,31 +188,14 @@ is_uniform(const fs_reg ®)
|
|||
}
|
||||
|
||||
/**
|
||||
* Get either of the 8-component halves of a 16-component register.
|
||||
*
|
||||
* Note: this also works if \c reg represents a SIMD16 pair of registers.
|
||||
* Get the specified 8-component quarter of a register.
|
||||
* XXX - Maybe come up with a less misleading name for this (e.g. quarter())?
|
||||
*/
|
||||
static inline fs_reg
|
||||
half(fs_reg reg, unsigned idx)
|
||||
half(const fs_reg ®, unsigned idx)
|
||||
{
|
||||
assert(idx < 2);
|
||||
|
||||
switch (reg.file) {
|
||||
case BAD_FILE:
|
||||
case UNIFORM:
|
||||
case IMM:
|
||||
return reg;
|
||||
|
||||
case VGRF:
|
||||
case MRF:
|
||||
return horiz_offset(reg, 8 * idx);
|
||||
|
||||
case ARF:
|
||||
case FIXED_GRF:
|
||||
case ATTR:
|
||||
unreachable("Cannot take half of this register type");
|
||||
}
|
||||
return reg;
|
||||
return horiz_offset(reg, 8 * idx);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue