mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-01-03 11:30:21 +01:00
amd: Implement quad_vote intrinsics
Co-authored-by: Daniel Schürmann <daniel@schuermann.dev> Reviewed-by: Georg Lehmann <dadschoorse@gmail.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/218>
This commit is contained in:
parent
1cfb0ae92c
commit
387e698bde
2 changed files with 25 additions and 0 deletions
|
|
@ -8580,6 +8580,22 @@ visit_intrinsic(isel_context* ctx, nir_intrinsic_instr* instr)
|
|||
set_wqm(ctx);
|
||||
break;
|
||||
}
|
||||
case nir_intrinsic_quad_vote_any: {
|
||||
Temp src = get_ssa_temp(ctx, instr->src[0].ssa);
|
||||
src = bld.sop2(Builder::s_and, bld.def(bld.lm), bld.def(s1, scc), src, Operand(exec, bld.lm));
|
||||
bld.sop1(Builder::s_wqm, Definition(get_ssa_temp(ctx, &instr->def)), bld.def(s1, scc), src);
|
||||
set_wqm(ctx, true);
|
||||
break;
|
||||
}
|
||||
case nir_intrinsic_quad_vote_all: {
|
||||
Temp src = get_ssa_temp(ctx, instr->src[0].ssa);
|
||||
src = bld.sop1(Builder::s_not, bld.def(bld.lm), bld.def(s1, scc), src);
|
||||
src = bld.sop2(Builder::s_and, bld.def(bld.lm), bld.def(s1, scc), src, Operand(exec, bld.lm));
|
||||
src = bld.sop1(Builder::s_wqm, bld.def(bld.lm), bld.def(s1, scc), src);
|
||||
bld.sop1(Builder::s_not, Definition(get_ssa_temp(ctx, &instr->def)), bld.def(s1, scc), src);
|
||||
set_wqm(ctx, true);
|
||||
break;
|
||||
}
|
||||
case nir_intrinsic_reduce:
|
||||
case nir_intrinsic_inclusive_scan:
|
||||
case nir_intrinsic_exclusive_scan: {
|
||||
|
|
|
|||
|
|
@ -3374,6 +3374,15 @@ static bool visit_intrinsic(struct ac_nir_context *ctx, nir_intrinsic_instr *ins
|
|||
result = ac_build_vote_any(&ctx->ac, get_src(ctx, instr->src[0]));
|
||||
break;
|
||||
}
|
||||
case nir_intrinsic_quad_vote_any: {
|
||||
result = ac_build_wqm_vote(&ctx->ac, get_src(ctx, instr->src[0]));
|
||||
break;
|
||||
}
|
||||
case nir_intrinsic_quad_vote_all: {
|
||||
LLVMValueRef src = LLVMBuildNot(ctx->ac.builder, get_src(ctx, instr->src[0]), "");
|
||||
result = LLVMBuildNot(ctx->ac.builder, ac_build_wqm_vote(&ctx->ac, src), "");
|
||||
break;
|
||||
}
|
||||
case nir_intrinsic_shuffle:
|
||||
if (ctx->ac.gfx_level == GFX8 || ctx->ac.gfx_level == GFX9 ||
|
||||
(ctx->ac.gfx_level >= GFX10 && ctx->ac.wave_size == 32)) {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue