[Mesa-dev] [PATCH 22/50] glsl: Add a lowering pass for 64-bit float sign()
Dave Airlie
airlied at gmail.com
Tue Mar 13 04:24:47 UTC 2018
From: Elie Tournier <tournier.elie at gmail.com>
Signed-off-by: Elie Tournier <elie.tournier at collabora.com>
---
src/compiler/glsl/ir_optimization.h | 2 +-
src/compiler/glsl/lower_64bit.cpp | 2 ++
2 files changed, 3 insertions(+), 1 deletion(-)
diff --git a/src/compiler/glsl/ir_optimization.h b/src/compiler/glsl/ir_optimization.h
index 2d9728d..3a406ce 100644
--- a/src/compiler/glsl/ir_optimization.h
+++ b/src/compiler/glsl/ir_optimization.h
@@ -63,7 +63,7 @@
#define ABS64 (1U << 4)
#define NEG64 (1U << 5)
-#define LOWER_ALL_DOUBLE_OPS (ABS64 | NEG64)
+#define LOWER_ALL_DOUBLE_OPS (ABS64 | NEG64 | SIGN64)
/**
* \see class lower_packing_builtins_visitor
*/
diff --git a/src/compiler/glsl/lower_64bit.cpp b/src/compiler/glsl/lower_64bit.cpp
index bc9e477..88df912 100644
--- a/src/compiler/glsl/lower_64bit.cpp
+++ b/src/compiler/glsl/lower_64bit.cpp
@@ -435,6 +435,8 @@ lower_64bit_visitor::handle_rvalue(ir_rvalue **rvalue)
if (lowering(SIGN64)) {
if (ir->type->is_integer_64())
*rvalue = handle_op(ir, "__builtin_sign64", generate_ir::sign64);
+ else if (ir->type->base_type == GLSL_TYPE_DOUBLE)
+ *rvalue = handle_op(ir, "__builtin_fsign64", generate_ir::fsign64);
}
break;
--
2.9.5
More information about the mesa-dev
mailing list