diff options
Diffstat (limited to 'src/compiler/glsl/glsl_to_nir.cpp')
-rw-r--r-- | src/compiler/glsl/glsl_to_nir.cpp | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/src/compiler/glsl/glsl_to_nir.cpp b/src/compiler/glsl/glsl_to_nir.cpp index 09a4f19f6f2..f7df91d887d 100644 --- a/src/compiler/glsl/glsl_to_nir.cpp +++ b/src/compiler/glsl/glsl_to_nir.cpp @@ -1865,8 +1865,18 @@ nir_visitor::visit(ir_expression *ir) : nir_isub(&b, srcs[0], srcs[1]); break; case ir_binop_mul: - result = type_is_float(out_type) ? nir_fmul(&b, srcs[0], srcs[1]) - : nir_imul(&b, srcs[0], srcs[1]); + if (type_is_float(out_type)) + result = nir_fmul(&b, srcs[0], srcs[1]); + else if (out_type == GLSL_TYPE_INT64 && + (ir->operands[0]->type->base_type == GLSL_TYPE_INT || + ir->operands[1]->type->base_type == GLSL_TYPE_INT)) + result = nir_imul_2x32_64(&b, srcs[0], srcs[1]); + else if (out_type == GLSL_TYPE_UINT64 && + (ir->operands[0]->type->base_type == GLSL_TYPE_UINT || + ir->operands[1]->type->base_type == GLSL_TYPE_UINT)) + result = nir_umul_2x32_64(&b, srcs[0], srcs[1]); + else + result = nir_imul(&b, srcs[0], srcs[1]); break; case ir_binop_div: if (type_is_float(out_type)) |