summaryrefslogtreecommitdiffstats
path: root/src/mesa/drivers/dri/i965/brw_fs.h
diff options
context:
space:
mode:
authorFrancisco Jerez <[email protected]>2014-01-15 22:21:50 +0100
committerFrancisco Jerez <[email protected]>2014-02-12 23:39:24 +0100
commita3a55067bdf608402aeb98d515c52e2436a8f226 (patch)
tree37f07661da63cfd358a590471ae0ee0217566bb8 /src/mesa/drivers/dri/i965/brw_fs.h
parent019bf6ed8dd4843512e9d4924f4702ce36047ad5 (diff)
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 <[email protected]> Reviewed-by: Paul Berry <[email protected]>
Diffstat (limited to 'src/mesa/drivers/dri/i965/brw_fs.h')
-rw-r--r--src/mesa/drivers/dri/i965/brw_fs.h14
1 files changed, 13 insertions, 1 deletions
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 &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));