i965/vec4: Add is_null() method to dst_reg.
authorMatt Turner <mattst88@gmail.com>
Thu, 13 Mar 2014 18:21:36 +0000 (11:21 -0700)
committerMatt Turner <mattst88@gmail.com>
Mon, 24 Mar 2014 18:06:25 +0000 (11:06 -0700)
Reviewed-by: Eric Anholt <eric@anholt.net>
src/mesa/drivers/dri/i965/brw_vec4.cpp
src/mesa/drivers/dri/i965/brw_vec4.h

index 702b182c579994cd1c944274f6de5c8f2a3d2fe7..62c2314fececa6b6c1af821a3bb4eb59bbb5df21 100644 (file)
@@ -212,6 +212,14 @@ dst_reg::dst_reg(src_reg reg)
    this->fixed_hw_reg = reg.fixed_hw_reg;
 }
 
+bool
+dst_reg::is_null() const
+{
+   return file == HW_REG &&
+          fixed_hw_reg.file == BRW_ARCHITECTURE_REGISTER_FILE &&
+          fixed_hw_reg.nr == BRW_ARF_NULL;
+}
+
 bool
 vec4_instruction::is_send_from_grf()
 {
index 5e5ef036a66ef3b1be90c7c5babd27d0e8aadb4f..159a5bdfbbb67ea6ef2002ba04d03e7deef041c3 100644 (file)
@@ -194,6 +194,8 @@ public:
 
    explicit dst_reg(src_reg reg);
 
+   bool is_null() const;
+
    int writemask; /**< Bitfield of WRITEMASK_[XYZW] */
 
    src_reg *reladdr;