summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorConnor Abbott <[email protected]>2015-11-18 12:38:31 +0100
committerSamuel Iglesias Gonsálvez <[email protected]>2016-05-10 11:25:03 +0200
commit7bcc4cccad08043dbe116406ec76d629a1a11e98 (patch)
tree110bb916d44d4d54d9969d072c57a8b3faf43b44 /src
parent2ae409286c159ee517bdec7740161cbb1f8bac9a (diff)
i965: fix is_zero(), is_one() and is_negative_one() for doubles
Reviewed-by: Kenneth Graunke <[email protected]> Reviewed-by: Jordan Justen <[email protected]> Reviewed-by: Francisco Jerez <[email protected]>
Diffstat (limited to 'src')
-rw-r--r--src/mesa/drivers/dri/i965/brw_shader.cpp28
1 files changed, 24 insertions, 4 deletions
diff --git a/src/mesa/drivers/dri/i965/brw_shader.cpp b/src/mesa/drivers/dri/i965/brw_shader.cpp
index 9cf57541cf9..b3c6c58f924 100644
--- a/src/mesa/drivers/dri/i965/brw_shader.cpp
+++ b/src/mesa/drivers/dri/i965/brw_shader.cpp
@@ -666,7 +666,17 @@ backend_reg::is_zero() const
if (file != IMM)
return false;
- return d == 0;
+ switch (type) {
+ case BRW_REGISTER_TYPE_F:
+ return f == 0;
+ case BRW_REGISTER_TYPE_DF:
+ return df == 0;
+ case BRW_REGISTER_TYPE_D:
+ case BRW_REGISTER_TYPE_UD:
+ return d == 0;
+ default:
+ return false;
+ }
}
bool
@@ -675,9 +685,17 @@ backend_reg::is_one() const
if (file != IMM)
return false;
- return type == BRW_REGISTER_TYPE_F
- ? f == 1.0
- : d == 1;
+ switch (type) {
+ case BRW_REGISTER_TYPE_F:
+ return f == 1.0f;
+ case BRW_REGISTER_TYPE_DF:
+ return df == 1.0;
+ case BRW_REGISTER_TYPE_D:
+ case BRW_REGISTER_TYPE_UD:
+ return d == 1;
+ default:
+ return false;
+ }
}
bool
@@ -689,6 +707,8 @@ backend_reg::is_negative_one() const
switch (type) {
case BRW_REGISTER_TYPE_F:
return f == -1.0;
+ case BRW_REGISTER_TYPE_DF:
+ return df == -1.0;
case BRW_REGISTER_TYPE_D:
return d == -1;
default: