nv50/ir: don't fold immediate into mad if registers are too high
authorIlia Mirkin <imirkin@alum.mit.edu>
Thu, 10 Sep 2015 09:02:26 +0000 (05:02 -0400)
committerIlia Mirkin <imirkin@alum.mit.edu>
Thu, 10 Sep 2015 09:03:24 +0000 (05:03 -0400)
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=91551
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Cc: "11.0" <mesa-stable@lists.freedesktop.org>
src/gallium/drivers/nouveau/codegen/nv50_ir_peephole.cpp

index b01ef4128cd7a9d83c91973352a9df4e271b1cc4..44f74c61304259026bbedb0506c1d79a540470f9 100644 (file)
@@ -2602,6 +2602,10 @@ NV50PostRaConstantFolding::visit(BasicBlock *bb)
              !isFloatType(i->dType))
             break;
 
+         if (i->getDef(0)->reg.data.id >= 64 ||
+             i->getSrc(0)->reg.data.id >= 64)
+            break;
+
          def = i->getSrc(1)->getInsn();
          if (def->op == OP_MOV && def->src(0).getFile() == FILE_IMMEDIATE) {
             vtmp = i->getSrc(1);