intel/compiler: skip MAD algebraic optimization for half-float or mixed mode
authorIago Toral Quiroga <itoral@igalia.com>
Tue, 12 Feb 2019 08:34:10 +0000 (09:34 +0100)
committerJuan A. Suarez Romero <jasuarez@igalia.com>
Thu, 18 Apr 2019 09:05:18 +0000 (11:05 +0200)
It is very likely that this optimzation is never useful and we'll probably
just end up removing it, so let's not bother adding more cases to it for
now.

Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
src/intel/compiler/brw_fs.cpp

index 186275b32406510da42fd84561619b17e23316e4..14d10a604139d3e4017024a41e350b5d512dca4a 100644 (file)
@@ -2693,6 +2693,10 @@ fs_visitor::opt_algebraic()
          }
          break;
       case BRW_OPCODE_MAD:
+         if (inst->src[0].type != BRW_REGISTER_TYPE_F ||
+             inst->src[1].type != BRW_REGISTER_TYPE_F ||
+             inst->src[2].type != BRW_REGISTER_TYPE_F)
+            break;
          if (inst->src[1].is_one()) {
             inst->opcode = BRW_OPCODE_ADD;
             inst->src[1] = inst->src[2];