Mesa (master): gk110/ir: add OP_CCTL handling

Ilia Mirkin imirkin at kemper.freedesktop.org
Thu Jan 21 00:49:10 UTC 2016


Module: Mesa
Branch: master
Commit: 8c2dfe05c5db9946d2d30546920e98bcfb8e3eb9
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=8c2dfe05c5db9946d2d30546920e98bcfb8e3eb9

Author: Ilia Mirkin <imirkin at alum.mit.edu>
Date:   Tue Sep 22 19:13:14 2015 -0400

gk110/ir: add OP_CCTL handling

---

 .../drivers/nouveau/codegen/nv50_ir_emit_gk110.cpp | 35 ++++++++++++++++++++++
 1 file changed, 35 insertions(+)

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 8a98c29..59041df 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:




More information about the mesa-commit mailing list