Browse Source

i965: Add an is_negative_one() method.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
tags/10.6-branchpoint
Matt Turner 10 years ago
parent
commit
e8a6f2ad65
2 changed files with 17 additions and 0 deletions
  1. 16
    0
      src/mesa/drivers/dri/i965/brw_shader.cpp
  2. 1
    0
      src/mesa/drivers/dri/i965/brw_shader.h

+ 16
- 0
src/mesa/drivers/dri/i965/brw_shader.cpp View File

@@ -731,6 +731,22 @@ backend_reg::is_one() const
: fixed_hw_reg.dw1.d == 1;
}

bool
backend_reg::is_negative_one() const
{
if (file != IMM)
return false;

switch (type) {
case BRW_REGISTER_TYPE_F:
return fixed_hw_reg.dw1.f == -1.0;
case BRW_REGISTER_TYPE_D:
return fixed_hw_reg.dw1.d == -1;
default:
return false;
}
}

bool
backend_reg::is_null() const
{

+ 1
- 0
src/mesa/drivers/dri/i965/brw_shader.h View File

@@ -51,6 +51,7 @@ struct backend_reg
#ifdef __cplusplus
bool is_zero() const;
bool is_one() const;
bool is_negative_one() const;
bool is_null() const;
bool is_accumulator() const;
#endif

Loading…
Cancel
Save