aco: Add base argument to emit_mbcnt.

Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6699>
This commit is contained in:
Timur Kristóf 2020-09-13 16:33:35 +02:00 committed by Marge Bot
parent f3780e7b8c
commit 26299c87f8

View file

@ -149,14 +149,14 @@ Temp get_ssa_temp(struct isel_context *ctx, nir_ssa_def *def)
return ctx->allocated[def->index];
}
Temp emit_mbcnt(isel_context *ctx, Temp dst, Temp mask = Temp())
Temp emit_mbcnt(isel_context *ctx, Temp dst, Temp mask = Temp(), Operand base = Operand(0u))
{
Builder bld(ctx->program, ctx->block);
assert(mask.id() == 0 || mask.regClass() == bld.lm);
if (ctx->program->wave_size == 32) {
Operand mask_lo = mask.id() ? Operand(mask) : Operand(-1u);
return bld.vop3(aco_opcode::v_mbcnt_lo_u32_b32, Definition(dst), mask_lo, Operand(0u));
return bld.vop3(aco_opcode::v_mbcnt_lo_u32_b32, Definition(dst), mask_lo, base);
}
Operand mask_lo(-1u);
@ -168,7 +168,7 @@ Temp emit_mbcnt(isel_context *ctx, Temp dst, Temp mask = Temp())
mask_hi = Operand(mask_split.def(1).getTemp());
}
Temp mbcnt_lo = bld.vop3(aco_opcode::v_mbcnt_lo_u32_b32, bld.def(v1), mask_lo, Operand(0u));
Temp mbcnt_lo = bld.vop3(aco_opcode::v_mbcnt_lo_u32_b32, bld.def(v1), mask_lo, base);
if (ctx->program->chip_class <= GFX7)
return bld.vop2(aco_opcode::v_mbcnt_hi_u32_b32, Definition(dst), mask_hi, mbcnt_lo);