summaryrefslogtreecommitdiffstats
path: root/src/compiler/glsl/lower_int64.cpp
diff options
context:
space:
mode:
authorIan Romanick <[email protected]>2016-10-17 17:55:18 -0700
committerIan Romanick <[email protected]>2017-01-20 15:41:23 -0800
commit82c31f3eb957a0089773db47a4aca8bf3eb4a29e (patch)
tree59cb995404757f8e08ba656392da0e276a845930 /src/compiler/glsl/lower_int64.cpp
parent012f2995c307a83212a88ff18e13bf7be006cd77 (diff)
glsl: Add a lowering pass for 64-bit integer division
Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Matt Turner <[email protected]>
Diffstat (limited to 'src/compiler/glsl/lower_int64.cpp')
-rw-r--r--src/compiler/glsl/lower_int64.cpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/compiler/glsl/lower_int64.cpp b/src/compiler/glsl/lower_int64.cpp
index a12eba85c58..a0b5e1809a5 100644
--- a/src/compiler/glsl/lower_int64.cpp
+++ b/src/compiler/glsl/lower_int64.cpp
@@ -368,6 +368,17 @@ lower_64bit_visitor::handle_rvalue(ir_rvalue **rvalue)
}
break;
+ case ir_binop_div:
+ if (lowering(DIV64)) {
+ if (ir->type->base_type == GLSL_TYPE_UINT64) {
+ *rvalue = handle_op(ir, "__builtin_udiv64", generate_ir::udiv64);
+ } else {
+ *rvalue = handle_op(ir, "__builtin_idiv64", generate_ir::idiv64);
+ }
+ this->progress = true;
+ }
+ break;
+
case ir_binop_mul:
if (lowering(MUL64)) {
*rvalue = handle_op(ir, "__builtin_umul64", generate_ir::umul64);