[Mesa-dev] [PATCH 24/47] glsl: Add a lowering pass for 64-bit float less()
Elie Tournier
tournier.elie at gmail.com
Wed Aug 23 11:07:54 UTC 2017
Signed-off-by: Elie Tournier <elie.tournier at collabora.com>
---
src/compiler/glsl/ir_optimization.h | 1 +
src/compiler/glsl/lower_64bit.cpp | 7 +++++++
src/mesa/state_tracker/st_glsl_to_tgsi.cpp | 3 ++-
3 files changed, 10 insertions(+), 1 deletion(-)
diff --git a/src/compiler/glsl/ir_optimization.h b/src/compiler/glsl/ir_optimization.h
index 271dad77e4..ee8cd92269 100644
--- a/src/compiler/glsl/ir_optimization.h
+++ b/src/compiler/glsl/ir_optimization.h
@@ -66,6 +66,7 @@
#define NEG64 (1U << 5)
#define EQ64 (1U << 6)
#define LE64 (1U << 7)
+#define LT64 (1U << 8)
/**
* \see class lower_packing_builtins_visitor
diff --git a/src/compiler/glsl/lower_64bit.cpp b/src/compiler/glsl/lower_64bit.cpp
index 68ffa8f706..2b6580d293 100644
--- a/src/compiler/glsl/lower_64bit.cpp
+++ b/src/compiler/glsl/lower_64bit.cpp
@@ -452,6 +452,13 @@ lower_64bit_visitor::handle_rvalue(ir_rvalue **rvalue)
}
break;
+ case ir_binop_less:
+ if (lowering(LT64)) {
+ if (ir->operands[0]->type->base_type == GLSL_TYPE_DOUBLE)
+ *rvalue = handle_op(ir, "__builtin_flt64", generate_ir::flt64);
+ }
+ break;
+
case ir_binop_mod:
if (lowering(MOD64)) {
if (ir->type->base_type == GLSL_TYPE_UINT64) {
diff --git a/src/mesa/state_tracker/st_glsl_to_tgsi.cpp b/src/mesa/state_tracker/st_glsl_to_tgsi.cpp
index 78fa1e3a76..59f896a785 100644
--- a/src/mesa/state_tracker/st_glsl_to_tgsi.cpp
+++ b/src/mesa/state_tracker/st_glsl_to_tgsi.cpp
@@ -7062,7 +7062,8 @@ st_link_shader(struct gl_context *ctx, struct gl_shader_program *prog)
NEG64 |
SIGN64 |
EQ64 |
- LE64;
+ LE64 |
+ LT64;
lower_64bit_double_instructions(ir, lower_inst);
}
--
2.14.1
More information about the mesa-dev
mailing list