diff options
author | Ian Romanick <[email protected]> | 2016-10-18 16:47:14 -0700 |
---|---|---|
committer | Ian Romanick <[email protected]> | 2017-01-20 15:41:23 -0800 |
commit | 7122d851aa7d4bae028df2ade1e91ba2347e8bfe (patch) | |
tree | 7a51d5a3369a689b24dd28041ef548bbc02fe5b8 /src/compiler/glsl/lower_int64.cpp | |
parent | 695b04f7eb24bff108e8d85c476adb5cf9de6f2d (diff) |
glsl: Add a lowering pass for 64-bit integer modulus
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.cpp | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/compiler/glsl/lower_int64.cpp b/src/compiler/glsl/lower_int64.cpp index a0b5e1809a5..0a19ce429e4 100644 --- a/src/compiler/glsl/lower_int64.cpp +++ b/src/compiler/glsl/lower_int64.cpp @@ -379,6 +379,17 @@ lower_64bit_visitor::handle_rvalue(ir_rvalue **rvalue) } break; + case ir_binop_mod: + if (lowering(MOD64)) { + if (ir->type->base_type == GLSL_TYPE_UINT64) { + *rvalue = handle_op(ir, "__builtin_umod64", generate_ir::umod64); + } else { + *rvalue = handle_op(ir, "__builtin_imod64", generate_ir::imod64); + } + this->progress = true; + } + break; + case ir_binop_mul: if (lowering(MUL64)) { *rvalue = handle_op(ir, "__builtin_umul64", generate_ir::umul64); |