nv50/ir/gk110: implement quadop
authorIlia Mirkin <imirkin@alum.mit.edu>
Wed, 12 Mar 2014 13:33:00 +0000 (09:33 -0400)
committerIlia Mirkin <imirkin@alum.mit.edu>
Tue, 18 Mar 2014 09:56:54 +0000 (05:56 -0400)
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
src/gallium/drivers/nouveau/codegen/nv50_ir_emit_gk110.cpp

index cd39d0ef1ea27ad34c6b6d43f9b3d6b897af3968..54a06b567892f4f7d61266d0064bf8fb7dac2c64 100644 (file)
@@ -1104,7 +1104,17 @@ CodeEmitterGK110::emitTXQ(const TexInstruction *i)
 void
 CodeEmitterGK110::emitQUADOP(const Instruction *i, uint8_t qOp, uint8_t laneMask)
 {
-   emitNOP(i); // TODO
+   code[0] = 0x00000002 | ((qOp & 1) << 31);
+   code[1] = 0x7fc00000 | (qOp >> 1) | (laneMask << 12);
+
+   defId(i->def(0), 2);
+   srcId(i->src(0), 10);
+   srcId(i->srcExists(1) ? i->src(1) : i->src(0), 23);
+
+   if (i->op == OP_QUADOP && progType != Program::TYPE_FRAGMENT)
+      code[1] |= 1 << 9; // dall
+
+   emitPredicate(i);
 }
 
 void