diff --git a/.pick_status.json b/.pick_status.json index 3583fa2cd12..d5940b1bf3f 100644 --- a/.pick_status.json +++ b/.pick_status.json @@ -1696,7 +1696,7 @@ "description": "aco: fix shared_atomic_comp_swap if the second source isn't a VGPR", "nominated": true, "nomination_type": 0, - "resolution": 0, + "resolution": 1, "main_sha": null, "because_sha": null }, diff --git a/src/amd/compiler/aco_instruction_selection.cpp b/src/amd/compiler/aco_instruction_selection.cpp index 0b3e617831b..9d03633f90f 100644 --- a/src/amd/compiler/aco_instruction_selection.cpp +++ b/src/amd/compiler/aco_instruction_selection.cpp @@ -6882,8 +6882,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)