i965/fs: Add is_null() method to fs_reg.
authorMatt Turner <mattst88@gmail.com>
Tue, 22 Oct 2013 19:32:23 +0000 (12:32 -0700)
committerMatt Turner <mattst88@gmail.com>
Thu, 31 Oct 2013 02:49:27 +0000 (19:49 -0700)
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
src/mesa/drivers/dri/i965/brw_fs.cpp
src/mesa/drivers/dri/i965/brw_fs.h

index 5e95d3a4ce78499f62cf63f92d0baa88a1cc3ce2..69340f0bc9f9cab9ba9a43adb198436418e3472d 100644 (file)
@@ -466,6 +466,14 @@ fs_reg::is_one() const
    return type == BRW_REGISTER_TYPE_F ? imm.f == 1.0 : imm.i == 1;
 }
 
+bool
+fs_reg::is_null() const
+{
+   return file == HW_REG &&
+          fixed_hw_reg.file == BRW_ARCHITECTURE_REGISTER_FILE &&
+          fixed_hw_reg.nr == BRW_ARF_NULL;
+}
+
 bool
 fs_reg::is_valid_3src() const
 {
index a3a4dc0f1413d0354295c346d859286a3e030983..c9b0aa1773c5467beb767dcc05fbd5b5b939ed0d 100644 (file)
@@ -77,6 +77,7 @@ public:
    bool equals(const fs_reg &r) const;
    bool is_zero() const;
    bool is_one() const;
+   bool is_null() const;
    bool is_valid_3src() const;
    fs_reg retype(uint32_t type);