mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-07 04:58:05 +02:00
ac/llvm: Implement uclz.
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:
parent
8671b866bf
commit
83f51212c1
1 changed files with 8 additions and 0 deletions
|
|
@ -1086,6 +1086,14 @@ static void visit_alu(struct ac_nir_context *ctx, const nir_alu_instr *instr)
|
|||
case nir_op_ifind_msb:
|
||||
result = ac_build_imsb(&ctx->ac, src[0], ctx->ac.i32);
|
||||
break;
|
||||
case nir_op_uclz: {
|
||||
LLVMValueRef params[2] = {
|
||||
src[0],
|
||||
ctx->ac.i1false,
|
||||
};
|
||||
result = ac_build_intrinsic(&ctx->ac, "llvm.ctlz.i32", ctx->ac.i32, params, 2, AC_FUNC_ATTR_READNONE);
|
||||
break;
|
||||
}
|
||||
case nir_op_uadd_carry:
|
||||
result = emit_uint_carry(&ctx->ac, "llvm.uadd.with.overflow.i32", src[0], src[1]);
|
||||
break;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue