summaryrefslogtreecommitdiff
path: root/src/glsl/nir/nir_opcodes.py
diff options
context:
space:
mode:
authorRob Clark <robclark@freedesktop.org>2015-03-31 15:13:00 -0400
committerRob Clark <robclark@freedesktop.org>2015-04-05 08:56:24 -0400
commit7880bea2fb587871faead78f624920ad5e8b89f7 (patch)
treebccd9bbf4225c496f771bb852b72198788539098 /src/glsl/nir/nir_opcodes.py
parent6829d76e0285f9ed8091990b908d2e7dc37c5218 (diff)
nir: fix typo for f2b/i2b/b2i expressions (v2)
v2: discovered that i2b/b2i are also confused Signed-off-by: Rob Clark <robclark@freedesktop.org> Reviewed-by: Matt Turner <mattst88@gmail.com> Reviewed-by: Connor Abbott <cwabbott0@gmail.com>
Diffstat (limited to 'src/glsl/nir/nir_opcodes.py')
-rw-r--r--src/glsl/nir/nir_opcodes.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/glsl/nir/nir_opcodes.py b/src/glsl/nir/nir_opcodes.py
index 062cd628b8..f96424fa41 100644
--- a/src/glsl/nir/nir_opcodes.py
+++ b/src/glsl/nir/nir_opcodes.py
@@ -161,12 +161,12 @@ unop_convert("f2i", tfloat, tint, "src0") # Float-to-integer conversion.
unop_convert("f2u", tfloat, tunsigned, "src0") # Float-to-unsigned conversion
unop_convert("i2f", tint, tfloat, "src0") # Integer-to-float conversion.
# Float-to-boolean conversion
-unop_convert("f2b", tfloat, tbool, "src0 == 0.0f")
+unop_convert("f2b", tfloat, tbool, "src0 != 0.0f")
# Boolean-to-float conversion
unop_convert("b2f", tbool, tfloat, "src0 ? 1.0f : 0.0f")
# Int-to-boolean conversion
-unop_convert("i2b", tint, tbool, "src0 == 0")
-unop_convert("b2i", tbool, tint, "src0 ? 0 : -1") # Boolean-to-int conversion
+unop_convert("i2b", tint, tbool, "src0 != 0")
+unop_convert("b2i", tbool, tint, "src0 ? 1 : 0") # Boolean-to-int conversion
unop_convert("u2f", tunsigned, tfloat, "src0") #Unsigned-to-float conversion.
unop_reduce("bany", 1, tbool, tbool, "{src}", "{src0} || {src1}", "{src}")