nv50/ir: Handle TGSI_OPCODE_CLOCK
authorBoyan Ding <boyan.j.ding@gmail.com>
Tue, 4 Apr 2017 14:44:46 +0000 (22:44 +0800)
committerIlia Mirkin <imirkin@alum.mit.edu>
Sun, 9 Apr 2017 17:03:13 +0000 (13:03 -0400)
Signed-off-by: Boyan Ding <boyan.j.ding@gmail.com>
[imirkin: make zero mov non-fixed]
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
src/gallium/drivers/nouveau/codegen/nv50_ir_from_tgsi.cpp

index 1e2f6111fc40dbfbe0b3c545ef4857b9d120d7ce..3ed7d345c4b306b56b3bdc6949539506ff99050e 100644 (file)
@@ -3404,6 +3404,13 @@ Converter::handleInstruction(const struct tgsi_full_instruction *insn)
          mkCvt(OP_CVT, TYPE_U32, dst0[c], TYPE_U8, val0);
       }
       break;
+   case TGSI_OPCODE_CLOCK:
+      // Stick the 32-bit clock into the high dword of the logical result.
+      if (!tgsi.getDst(0).isMasked(0))
+         mkOp1(OP_MOV, TYPE_U32, dst0[0], zero);
+      if (!tgsi.getDst(0).isMasked(1))
+         mkOp1(OP_RDSV, TYPE_U32, dst0[1], mkSysVal(SV_CLOCK, 0))->fixed = 1;
+      break;
    case TGSI_OPCODE_KILL_IF:
       val0 = new_LValue(func, FILE_PREDICATE);
       mask = 0;