summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBoyan Ding <boyan.j.ding@gmail.com>2017-04-10 22:55:58 +0800
committerAndres Gomez <agomez@igalia.com>2017-04-26 00:10:04 +0300
commita6a42a84cf50392b1010b3afa5a0e1c395dbaebf (patch)
tree532a00b4e8278423b90195259f634acd1d30d5a3
parent12434966ebed20cea322b8a6bd4671c7f42e3e49 (diff)
nvc0/ir: Properly handle a "split form" of predicate destination
GF100's ISA encoding has a weird form of predicate destination where its 3 bits are split across whole the instruction. Use a dedicated setPDSTL function instead of original defId which is incorrect in this case. v2: (Ilia Mirkin) Change API of setPDSTL() to handle cases of no output Fix setting of the highest bit in setPDSTL() Cc: mesa-stable@lists.freedesktop.org Signed-off-by: Boyan Ding <boyan.j.ding@gmail.com> Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu> (cherry picked from commit d941ef38292dd86469a792c8359e0fc8c4fa154c)
-rw-r--r--src/gallium/drivers/nouveau/codegen/nv50_ir_emit_nvc0.cpp15
1 files changed, 13 insertions, 2 deletions
diff --git a/src/gallium/drivers/nouveau/codegen/nv50_ir_emit_nvc0.cpp b/src/gallium/drivers/nouveau/codegen/nv50_ir_emit_nvc0.cpp
index a58335dd8f3..50dbbb49174 100644
--- a/src/gallium/drivers/nouveau/codegen/nv50_ir_emit_nvc0.cpp
+++ b/src/gallium/drivers/nouveau/codegen/nv50_ir_emit_nvc0.cpp
@@ -58,6 +58,7 @@ private:
void setImmediateS8(const ValueRef&);
void setSUConst16(const Instruction *, const int s);
void setSUPred(const Instruction *, const int s);
+ void setPDSTL(const Instruction *, const int d);
void emitCondCode(CondCode cc, int pos);
void emitInterpMode(const Instruction *);
@@ -373,6 +374,16 @@ void CodeEmitterNVC0::setImmediateS8(const ValueRef &ref)
code[0] |= (s8 >> 6) << 8;
}
+void CodeEmitterNVC0::setPDSTL(const Instruction *i, const int d)
+{
+ assert(d < 0 || (i->defExists(d) && i->def(d).getFile() == FILE_PREDICATE));
+
+ uint32_t pred = d >= 0 ? DDATA(i->def(d)).id : 7;
+
+ code[0] |= (pred & 3) << 8;
+ code[1] |= (pred & 4) << (26 - 2);
+}
+
void
CodeEmitterNVC0::emitForm_A(const Instruction *i, uint64_t opc)
{
@@ -1864,7 +1875,7 @@ CodeEmitterNVC0::emitSTORE(const Instruction *i)
if (i->src(0).getFile() == FILE_MEMORY_SHARED &&
i->subOp == NV50_IR_SUBOP_STORE_UNLOCKED) {
assert(i->defExists(0));
- defId(i->def(0), 8);
+ setPDSTL(i, 0);
}
}
@@ -1936,7 +1947,7 @@ CodeEmitterNVC0::emitLOAD(const Instruction *i)
if (p >= 0) {
if (targ->getChipset() >= NVISA_GK104_CHIPSET)
- defId(i->def(p), 8);
+ setPDSTL(i, p);
else
defId(i->def(p), 32 + 18);
}