From: Ian Romanick <ian.d.roman...@intel.com>

   text    data     bss     dec     hex filename
7529067  273096   28584 7830747  777cdb /tmp/i965_dri-64bit-before.so
7529003  273096   28584 7830683  777c9b /tmp/i965_dri-64bit-after.so

Signed-off-by: Ian Romanick <ian.d.roman...@intel.com>
Reviewed-by: Iago Toral Quiroga <ito...@igalia.com>
---
 src/compiler/glsl/nir_intrinsic_map.py | 20 +++++++++++++-------
 1 file changed, 13 insertions(+), 7 deletions(-)

diff --git a/src/compiler/glsl/nir_intrinsic_map.py 
b/src/compiler/glsl/nir_intrinsic_map.py
index 4d999c1..f6e9241 100644
--- a/src/compiler/glsl/nir_intrinsic_map.py
+++ b/src/compiler/glsl/nir_intrinsic_map.py
@@ -78,22 +78,28 @@ get_intrinsic_opcode(const char *name, const ir_dereference 
*return_deref)
    else
       unreachable("Intrinsic name does not begin with '__intrinsic_'");
 
+   nir_intrinsic_op int_op;
+   nir_intrinsic_op uint_op;
+
     % for (name, ops) in intrinsics:
    if (strcmp(name, "${name[12:]}") == 0) {
         % if ops[1] is None:
       return ${ops[0]};
         % else:
-      assert(return_deref);
-      if (return_deref->type == glsl_type::int_type)
-         return ${ops[0]};
-      else if (return_deref->type == glsl_type::uint_type)
-         return ${ops[1]};
-      else
-         unreachable("Invalid type");
+      int_op = ${ops[0]};
+      uint_op = ${ops[1]};
         % endif
    } else
     % endfor
       unreachable("Unknown intrinsic name");
+
+   assert(return_deref);
+   if (return_deref->type == glsl_type::int_type)
+      return int_op;
+   else if (return_deref->type == glsl_type::uint_type)
+      return uint_op;
+   else
+      unreachable("Invalid type");
 }
 }
 """
-- 
2.5.5

_______________________________________________
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev

Reply via email to