ac/llvm: Implement usub_sat and isub_sat.
Signed-off-by: Georg Lehmann <dadschoorse@gmail.com> Reviewed-by: Timur Kristóf <timur.kristof@gmail.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13895>
This commit is contained in:
@@ -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]);
|
||||
|
||||
Reference in New Issue
Block a user