[Mesa-dev] [PATCH 14/22] glsl: Add ir_triop_fma to get_range

Thomas Helland thomashelland90 at gmail.com
Sat Jan 3 11:18:19 PST 2015


---
 src/glsl/opt_minmax.cpp | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/src/glsl/opt_minmax.cpp b/src/glsl/opt_minmax.cpp
index cca18e8..8d63d96 100644
--- a/src/glsl/opt_minmax.cpp
+++ b/src/glsl/opt_minmax.cpp
@@ -448,6 +448,15 @@ get_range(ir_rvalue *rval)
 
          return minmax_range(low, NULL);
 
+      case ir_triop_fma:
+         r0 = get_range(expr->operands[0]);
+         r1 = get_range(expr->operands[1]);
+         // Get the range for the first multiply
+         r0 = resolv_mul_range(r0, r1);
+         r1 = get_range(expr->operands[2]);
+         // Get the range of the addition of op0*op1 and op2
+         return resolv_add_range(r0, r1);
+
       default:
          break;
       }
-- 
2.2.1



More information about the mesa-dev mailing list