aco/gfx11: swap ds_cmpst_* data operands
authorRhys Perry <pendingchaos02@gmail.com>
Wed, 13 Jul 2022 17:42:21 +0000 (18:42 +0100)
committerMarge Bot <emma+marge@anholt.net>
Fri, 30 Sep 2022 20:57:02 +0000 (20:57 +0000)
According to an LLVM comment, these are swapped in GFX11.

No fossil-db changes.

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17710>

src/amd/compiler/aco_instruction_selection.cpp

index a1811b5..7bb24cd 100644 (file)
@@ -7467,6 +7467,8 @@ visit_shared_atomic(isel_context* ctx, nir_intrinsic_instr* instr)
    if (num_operands == 4) {
       Temp data2 = as_vgpr(ctx, get_ssa_temp(ctx, instr->src[2].ssa));
       ds->operands[2] = Operand(data2);
+      if (bld.program->gfx_level >= GFX11)
+         std::swap(ds->operands[1], ds->operands[2]);
    }
    ds->operands[num_operands - 1] = m;
    ds->offset0 = offset;