summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/nouveau/codegen/nv50_ir_emit_gk110.cpp
diff options
context:
space:
mode:
authorIlia Mirkin <imirkin@alum.mit.edu>2016-05-25 22:41:06 -0400
committerIlia Mirkin <imirkin@alum.mit.edu>2016-05-26 21:23:49 -0400
commitdf2881381ac67c42aa8ec9e0ed28f21a1d253785 (patch)
treed09699ff711d1b3118d9e48acb5b286187a26c94 /src/gallium/drivers/nouveau/codegen/nv50_ir_emit_gk110.cpp
parent04ecad97ff7b44bd9afd1bff9108dea199723829 (diff)
downloadexternal_mesa3d-df2881381ac67c42aa8ec9e0ed28f21a1d253785.zip
external_mesa3d-df2881381ac67c42aa8ec9e0ed28f21a1d253785.tar.gz
external_mesa3d-df2881381ac67c42aa8ec9e0ed28f21a1d253785.tar.bz2
nvc0/ir: handle a load's reg result not being used for locked variants
For a load locked, we might not use the first result but the second result is the predicate result of the locking. In that case the load splitting logic doesn't apply (which is designed for splitting 128-bit loads). Instead we take the predicate and move it into the first position (as having a dead result in first def's position upsets all sorts of things including RA). Update the emitters to deal with this as well. Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu> Tested-by: Dave Airlie <airlied@redhat.com> Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Diffstat (limited to 'src/gallium/drivers/nouveau/codegen/nv50_ir_emit_gk110.cpp')
-rw-r--r--src/gallium/drivers/nouveau/codegen/nv50_ir_emit_gk110.cpp20
1 files changed, 17 insertions, 3 deletions
diff --git a/src/gallium/drivers/nouveau/codegen/nv50_ir_emit_gk110.cpp b/src/gallium/drivers/nouveau/codegen/nv50_ir_emit_gk110.cpp
index 6a5981d..27d9b8e 100644
--- a/src/gallium/drivers/nouveau/codegen/nv50_ir_emit_gk110.cpp
+++ b/src/gallium/drivers/nouveau/codegen/nv50_ir_emit_gk110.cpp
@@ -2080,15 +2080,29 @@ CodeEmitterGK110::emitLOAD(const Instruction *i)
code[1] |= offset >> 9;
// Locked store on shared memory can fail.
+ int r = 0, p = -1;
if (i->src(0).getFile() == FILE_MEMORY_SHARED &&
i->subOp == NV50_IR_SUBOP_LOAD_LOCKED) {
- assert(i->defExists(1));
- defId(i->def(1), 32 + 16);
+ if (i->def(0).getFile() == FILE_PREDICATE) { // p, #
+ r = -1;
+ p = 0;
+ } else if (i->defExists(1)) { // r, p
+ p = 1;
+ } else {
+ assert(!"Expected predicate dest for load locked");
+ }
}
emitPredicate(i);
- defId(i->def(0), 2);
+ if (r >= 0)
+ defId(i->def(r), 2);
+ else
+ code[0] |= 255 << 2;
+
+ if (p >= 0)
+ defId(i->def(p), 32 + 16);
+
if (i->getIndirect(0, 0)) {
srcId(i->src(0).getIndirect(0), 10);
if (i->getIndirect(0, 0)->reg.size == 8)