nvir: dont optimize mad with subops to shladd
authorKarol Herbst <kherbst@redhat.com>
Fri, 23 Feb 2018 21:51:05 +0000 (22:51 +0100)
committerKarol Herbst <kherbst@redhat.com>
Sat, 24 Feb 2018 17:48:13 +0000 (18:48 +0100)
Signed-off-by: Karol Herbst <kherbst@redhat.com>
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
src/gallium/drivers/nouveau/codegen/nv50_ir_peephole.cpp

index 0bbf21312fe8992b2513255d0846b6929975ac61..48cf74950df109302efb83dcddeaf7562e6423c2 100644 (file)
@@ -1055,7 +1055,8 @@ ConstantFolding::opnd(Instruction *i, ImmediateValue &imm0, int s)
       } else
       if (s == 1 && !imm0.isNegative() && imm0.isPow2() &&
           !isFloatType(i->dType) &&
-          target->isOpSupported(OP_SHLADD, i->dType)) {
+          target->isOpSupported(OP_SHLADD, i->dType) &&
+          !i->subOp) {
          i->op = OP_SHLADD;
          imm0.applyLog2();
          i->setSrc(1, new_ImmediateValue(prog, imm0.reg.data.u32));