nvc0/ir: SHLADD's middle source must be an immediate
authorIlia Mirkin <imirkin@alum.mit.edu>
Sat, 20 May 2017 07:11:12 +0000 (03:11 -0400)
committerIlia Mirkin <imirkin@alum.mit.edu>
Sat, 20 May 2017 07:12:40 +0000 (03:12 -0400)
The instruction encodings only allow for immediates. Don't try to
replace a zero (which is dumb to have in that op in any case) with RZ.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Cc: mesa-stable@lists.freedesktop.org
src/gallium/drivers/nouveau/codegen/nv50_ir_lowering_nvc0.cpp

index 732e1a93b4257ce60512105ce70a1bde725f5de8..64d743708a65da790de574774584a5ba49df81d3 100644 (file)
@@ -642,6 +642,8 @@ NVC0LegalizePostRA::replaceZero(Instruction *i)
    for (int s = 0; i->srcExists(s); ++s) {
       if (s == 2 && i->op == OP_SUCLAMP)
          continue;
+      if (s == 1 && i->op == OP_SHLADD)
+         continue;
       ImmediateValue *imm = i->getSrc(s)->asImm();
       if (imm) {
          if (i->op == OP_SELP && s == 2) {