aco: fix shared_atomic_comp_swap if the second source isn't a VGPR

Only VGPRs are valid with DS instructions.

Cc: 21.1 mesa-stable
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11777>
This commit is contained in:
Samuel Pitoiset
2021-07-08 09:09:25 +02:00
committed by Marge Bot
parent 3ee30d98ff
commit 74a221bcfd
@@ -6985,8 +6985,10 @@ void visit_shared_atomic(isel_context *ctx, nir_intrinsic_instr *instr)
ds.reset(create_instruction<DS_instruction>(op, Format::DS, num_operands, return_previous ? 1 : 0));
ds->operands[0] = Operand(address);
ds->operands[1] = Operand(data);
if (num_operands == 4)
ds->operands[2] = Operand(get_ssa_temp(ctx, instr->src[2].ssa));
if (num_operands == 4) {
Temp data2 = as_vgpr(ctx, get_ssa_temp(ctx, instr->src[2].ssa));
ds->operands[2] = Operand(data2);
}
ds->operands[num_operands - 1] = m;
ds->offset0 = offset;
if (return_previous)