ac/llvm: add helper ac_build_is_inf_or_nan
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13380>
This commit is contained in:
@@ -4776,3 +4776,13 @@ void ac_build_triangle_strip_indices_to_triangle(struct ac_llvm_context *ctx, LL
|
||||
LLVMBuildSelect(builder, is_odd, index[1], index[2], ""), index[2], "");
|
||||
memcpy(index, out, sizeof(out));
|
||||
}
|
||||
|
||||
LLVMValueRef ac_build_is_inf_or_nan(struct ac_llvm_context *ctx, LLVMValueRef a)
|
||||
{
|
||||
LLVMValueRef args[2] = {
|
||||
a,
|
||||
LLVMConstInt(ctx->i32, S_NAN | Q_NAN | N_INFINITY | P_INFINITY, 0),
|
||||
};
|
||||
return ac_build_intrinsic(ctx, "llvm.amdgcn.class.f32", ctx->i1, args, 2,
|
||||
AC_FUNC_ATTR_READNONE);
|
||||
}
|
||||
|
Reference in New Issue
Block a user