gv100/ir: fix atom cas
authorKarol Herbst <kherbst@redhat.com>
Sat, 20 Jun 2020 11:50:57 +0000 (13:50 +0200)
committerKarol Herbst <kherbst@redhat.com>
Sun, 21 Jun 2020 22:55:52 +0000 (00:55 +0200)
Signed-off-by: Karol Herbst <kherbst@redhat.com>
Reviewed-by: Ben Skeggs <bskeggs@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5576>

src/gallium/drivers/nouveau/codegen/nv50_ir_emit_gv100.cpp
src/gallium/drivers/nouveau/codegen/nv50_ir_lowering_nvc0.cpp

index 0fbd47ccf886663a569f0a4b4079c5dee8da206c..9fbea47a8c221c51fee198c72c43b9ea5d8719b5 100644 (file)
@@ -858,6 +858,7 @@ CodeEmitterGV100::emitATOM()
          break;
       }
       emitField(73, 3, dType);
+      emitGPR  (64, insn->src(2));
    }
 
    emitPRED (81);
index f100445e9d0d009e056d81672e22d5ba46c1566a..067f9abaca8f699b22882557aafd7c24f7b25958 100644 (file)
@@ -1727,7 +1727,8 @@ NVC0LoweringPass::handleCasExch(Instruction *cas, bool needCctl)
          cctl->setPredicate(cas->cc, cas->getPredicate());
    }
 
-   if (cas->subOp == NV50_IR_SUBOP_ATOM_CAS) {
+   if (cas->subOp == NV50_IR_SUBOP_ATOM_CAS &&
+       targ->getChipset() < NVISA_GV100_CHIPSET) {
       // CAS is crazy. It's 2nd source is a double reg, and the 3rd source
       // should be set to the high part of the double reg or bad things will
       // happen elsewhere in the universe.