From 74a221bcfd8dd8a1badbb44c71c38485d6c05ec2 Mon Sep 17 00:00:00 2001 From: Samuel Pitoiset Date: Thu, 8 Jul 2021 09:09:25 +0200 Subject: [PATCH] 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 Reviewed-by: Rhys Perry Part-of: --- src/amd/compiler/aco_instruction_selection.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/amd/compiler/aco_instruction_selection.cpp b/src/amd/compiler/aco_instruction_selection.cpp index c614277c48d..0001840c09f 100644 --- a/src/amd/compiler/aco_instruction_selection.cpp +++ b/src/amd/compiler/aco_instruction_selection.cpp @@ -6985,8 +6985,10 @@ void visit_shared_atomic(isel_context *ctx, nir_intrinsic_instr *instr) ds.reset(create_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)