summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorIlia Mirkin <[email protected]>2015-09-22 19:13:14 -0400
committerIlia Mirkin <[email protected]>2016-01-20 19:37:33 -0500
commit8c2dfe05c5db9946d2d30546920e98bcfb8e3eb9 (patch)
tree59d4c1d64081f2e1cd247a3b2d737c75c3f2a237
parent7d9a97d6beee8878ac57448af8c41b8af3f189b1 (diff)
gk110/ir: add OP_CCTL handling
-rw-r--r--src/gallium/drivers/nouveau/codegen/nv50_ir_emit_gk110.cpp35
1 files changed, 35 insertions, 0 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 8a98c29035f..59041dfacab 100644
--- a/src/gallium/drivers/nouveau/codegen/nv50_ir_emit_gk110.cpp
+++ b/src/gallium/drivers/nouveau/codegen/nv50_ir_emit_gk110.cpp
@@ -76,6 +76,7 @@ private:
void emitSTORE(const Instruction *);
void emitMOV(const Instruction *);
void emitATOM(const Instruction *);
+ void emitCCTL(const Instruction *);
void emitINTERP(const Instruction *);
void emitAFETCH(const Instruction *);
@@ -1714,6 +1715,14 @@ CodeEmitterGK110::emitMOV(const Instruction *i)
}
}
+static inline bool
+uses64bitAddress(const Instruction *ldst)
+{
+ return ldst->src(0).getFile() == FILE_MEMORY_GLOBAL &&
+ ldst->src(0).isIndirect(0) &&
+ ldst->getIndirect(0, 0)->reg.size == 8;
+}
+
void
CodeEmitterGK110::emitATOM(const Instruction *i)
{
@@ -1764,6 +1773,29 @@ CodeEmitterGK110::emitATOM(const Instruction *i)
}
}
+void
+CodeEmitterGK110::emitCCTL(const Instruction *i)
+{
+ int32_t offset = SDATA(i->src(0)).offset;
+
+ code[0] = 0x00000002 | (i->subOp << 2);
+
+ if (i->src(0).getFile() == FILE_MEMORY_GLOBAL) {
+ code[1] = 0x7b000000;
+ } else {
+ code[1] = 0x7c000000;
+ offset &= 0xffffff;
+ }
+ code[0] |= offset << 23;
+ code[1] |= offset >> 9;
+
+ if (uses64bitAddress(i))
+ code[1] |= 1 << 23;
+ srcId(i->src(0).getIndirect(0), 10);
+
+ emitPredicate(i);
+}
+
bool
CodeEmitterGK110::emitInstruction(Instruction *insn)
{
@@ -2001,6 +2033,9 @@ CodeEmitterGK110::emitInstruction(Instruction *insn)
case OP_ATOM:
emitATOM(insn);
break;
+ case OP_CCTL:
+ emitCCTL(insn);
+ break;
case OP_PHI:
case OP_UNION:
case OP_CONSTRAINT: