diff --git a/src/amd/llvm/ac_nir_to_llvm.c b/src/amd/llvm/ac_nir_to_llvm.c index 3b740cf9431..50dd2e0665f 100644 --- a/src/amd/llvm/ac_nir_to_llvm.c +++ b/src/amd/llvm/ac_nir_to_llvm.c @@ -649,6 +649,15 @@ static void visit_alu(struct ac_nir_context *ctx, const nir_alu_instr *instr) result = ac_build_intrinsic(&ctx->ac, name, def_type, src, 2, AC_FUNC_ATTR_READNONE); break; } + case nir_op_usub_sat: + case nir_op_isub_sat: { + char name[64], type[64]; + ac_build_type_name_for_intr(def_type, type, sizeof(type)); + snprintf(name, sizeof(name), "llvm.%csub.sat.%s", + instr->op == nir_op_usub_sat ? 'u' : 's', type); + result = ac_build_intrinsic(&ctx->ac, name, def_type, src, 2, AC_FUNC_ATTR_READNONE); + break; + } case nir_op_fadd: src[0] = ac_to_float(&ctx->ac, src[0]); src[1] = ac_to_float(&ctx->ac, src[1]);