From a3a55067bdf608402aeb98d515c52e2436a8f226 Mon Sep 17 00:00:00 2001 From: Francisco Jerez Date: Wed, 15 Jan 2014 22:21:50 +0100 Subject: i965/fs: Remove fs_reg::sechalf. The same effect can be achieved using ::subreg_offset. Remove the less flexible alternative and define a convenience function to keep the fs_reg interface sane. Reviewed-by: Matt Turner Reviewed-by: Paul Berry --- src/mesa/drivers/dri/i965/brw_fs.h | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'src/mesa/drivers/dri/i965/brw_fs.h') diff --git a/src/mesa/drivers/dri/i965/brw_fs.h b/src/mesa/drivers/dri/i965/brw_fs.h index 85d06ff214c..c6f4ffb4a19 100644 --- a/src/mesa/drivers/dri/i965/brw_fs.h +++ b/src/mesa/drivers/dri/i965/brw_fs.h @@ -105,7 +105,6 @@ public: int type; bool negate; bool abs; - bool sechalf; struct brw_reg fixed_hw_reg; /** Smear a channel of the reg to all channels. */ @@ -138,6 +137,19 @@ byte_offset(fs_reg reg, unsigned delta) return 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. + */ +static inline fs_reg +half(const fs_reg ®, unsigned idx) +{ + assert(idx < 2); + assert(idx == 0 || (reg.file != HW_REG && reg.file != IMM)); + return byte_offset(reg, 8 * idx * reg.stride * type_sz(reg.type)); +} + static const fs_reg reg_undef; static const fs_reg reg_null_f(retype(brw_null_reg(), BRW_REGISTER_TYPE_F)); static const fs_reg reg_null_d(retype(brw_null_reg(), BRW_REGISTER_TYPE_D)); -- cgit v1.2.3