i965/fs: Add a negate() function.
authorMatt Turner <mattst88@gmail.com>
Thu, 4 Dec 2014 21:35:25 +0000 (13:35 -0800)
committerMatt Turner <mattst88@gmail.com>
Fri, 5 Dec 2014 17:49:42 +0000 (09:49 -0800)
Reviewed-by: Jason Ekstrand <jason.ekstrand@intel.com>
src/mesa/drivers/dri/i965/brw_fs.h

index b29b6b09bbe0eb6f7253b3529c93b6c70f42b46d..c7bc55cb9293bf8312e5feee7412478eee3fdc1d 100644 (file)
@@ -118,6 +118,14 @@ public:
    uint8_t stride;
 };
 
+static inline fs_reg
+negate(fs_reg reg)
+{
+   assert(reg.file != HW_REG && reg.file != IMM);
+   reg.negate = !reg.negate;
+   return reg;
+}
+
 static inline fs_reg
 retype(fs_reg reg, enum brw_reg_type type)
 {