nvc0/ir: add missing emission of locked load predicate
authorSamuel Pitoiset <samuel.pitoiset@gmail.com>
Mon, 22 Feb 2016 20:11:33 +0000 (21:11 +0100)
committerSamuel Pitoiset <samuel.pitoiset@gmail.com>
Mon, 22 Feb 2016 20:28:51 +0000 (21:28 +0100)
Like unlocked store on shared memory, locked store can fail and the
second dest which is a predicate must be emitted.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
Cc: mesa-stable@lists.freedesktop.org
src/gallium/drivers/nouveau/codegen/nv50_ir_emit_nvc0.cpp

index e89b129147056b8ecbeb9dab33bf1fe54fca66f5..0068da5cbb7ffb32ce0cc62f92dbd71bbb467867 100644 (file)
@@ -1852,6 +1852,13 @@ CodeEmitterNVC0::emitLOAD(const Instruction *i)
    }
    code[1] = opc;
 
+   if (i->src(0).getFile() == FILE_MEMORY_SHARED) {
+      if (i->subOp == NV50_IR_SUBOP_LOAD_LOCKED) {
+         assert(i->defExists(1));
+         defId(i->def(1), 32 + 18);
+      }
+   }
+
    defId(i->def(0), 14);
 
    setAddressByFile(i->src(0));