From: Elie Tournier <tournier.e...@gmail.com>

Handle non 64bit sources (airlied)

Signed-off-by: Elie Tournier <elie.tourn...@collabora.com>
---
 src/compiler/glsl/ir_optimization.h | 3 ++-
 src/compiler/glsl/lower_64bit.cpp   | 7 +++++++
 2 files changed, 9 insertions(+), 1 deletion(-)

diff --git a/src/compiler/glsl/ir_optimization.h 
b/src/compiler/glsl/ir_optimization.h
index e3d573c..a4cb7b2 100644
--- a/src/compiler/glsl/ir_optimization.h
+++ b/src/compiler/glsl/ir_optimization.h
@@ -66,9 +66,10 @@
 #define LT64                      (1U << 7)
 #define ADD64                     (1U << 8)
 #define D2U                       (1U << 9)
+#define U2D                       (1U << 10)
 
 #define LOWER_ALL_DOUBLE_OPS (ABS64 | NEG64 | SIGN64 | EQ64 | LT64 | \
-                              ADD64 | MUL64 | D2U)
+                              ADD64 | MUL64 | D2U | U2D)
 
 /**
  * \see class lower_packing_builtins_visitor
diff --git a/src/compiler/glsl/lower_64bit.cpp 
b/src/compiler/glsl/lower_64bit.cpp
index 1b90830..1e97306 100644
--- a/src/compiler/glsl/lower_64bit.cpp
+++ b/src/compiler/glsl/lower_64bit.cpp
@@ -447,6 +447,13 @@ lower_64bit_visitor::handle_rvalue(ir_rvalue **rvalue)
       }
       break;
 
+   case ir_unop_u2d:
+      if (lowering(U2D)) {
+         if (ir->type->base_type == GLSL_TYPE_DOUBLE)
+            *rvalue = handle_op(ir, "__builtin_uint_to_fp64", 
generate_ir::uint_to_fp64, true);
+      }
+      break;
+
    case ir_binop_add:
       if (lowering(ADD64)) {
          if (ir->type->base_type == GLSL_TYPE_DOUBLE)
-- 
2.9.5

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

Reply via email to