From 18fdfbdc32f204d6728c1ad57a693b1a6ad0aec9 Mon Sep 17 00:00:00 2001 From: Christoph Bumiller Date: Mon, 11 Mar 2013 17:34:05 +0100 Subject: nv50/ir: add CCTL (cache control) op --- .../drivers/nvc0/codegen/nv50_ir_emit_nvc0.cpp | 25 ++++++++++++++++++++++ 1 file changed, 25 insertions(+) (limited to 'src/gallium/drivers/nvc0') diff --git a/src/gallium/drivers/nvc0/codegen/nv50_ir_emit_nvc0.cpp b/src/gallium/drivers/nvc0/codegen/nv50_ir_emit_nvc0.cpp index 64207d71aac..ba2f73be9c2 100644 --- a/src/gallium/drivers/nvc0/codegen/nv50_ir_emit_nvc0.cpp +++ b/src/gallium/drivers/nvc0/codegen/nv50_ir_emit_nvc0.cpp @@ -82,6 +82,7 @@ private: void emitMOV(const Instruction *); void emitATOM(const Instruction *); void emitMEMBAR(const Instruction *); + void emitCCTL(const Instruction *); void emitINTERP(const Instruction *); void emitPFETCH(const Instruction *); @@ -1885,6 +1886,27 @@ CodeEmitterNVC0::emitMEMBAR(const Instruction *i) emitPredicate(i); } +void +CodeEmitterNVC0::emitCCTL(const Instruction *i) +{ + code[0] = 0x00000005 | (i->subOp << 5); + + if (i->src(0).getFile() == FILE_MEMORY_GLOBAL) { + code[1] = 0x98000000; + srcAddr32(i->src(0), 28, 2); + } else { + code[1] = 0xd0000000; + setAddress24(i->src(0)); + } + if (uses64bitAddress(i)) + code[1] |= 1 << 26; + srcId(i->src(0).getIndirect(0), 20); + + emitPredicate(i); + + defId(i, 0, 14); +} + void CodeEmitterNVC0::emitSUCLAMPMode(uint16_t subOp) { @@ -2348,6 +2370,9 @@ CodeEmitterNVC0::emitInstruction(Instruction *insn) case OP_MEMBAR: emitMEMBAR(insn); break; + case OP_CCTL: + emitCCTL(insn); + break; case OP_VSHL: emitVSHL(insn); break; -- cgit v1.2.3