i965/fs: Add is_null() method to fs_reg.

Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
This commit is contained in:
Matt Turner 2013-10-22 12:32:23 -07:00
parent 8dfc9f038e
commit f768f998e0
2 changed files with 9 additions and 0 deletions

View 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
{

View 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);