From 6d87c651c90c24d5b670e1d9ba91754846e3b34d Mon Sep 17 00:00:00 2001 From: Iago Toral Quiroga Date: Tue, 12 Feb 2019 09:34:10 +0100 Subject: [PATCH] intel/compiler: skip MAD algebraic optimization for half-float or mixed mode 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 --- src/intel/compiler/brw_fs.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/intel/compiler/brw_fs.cpp b/src/intel/compiler/brw_fs.cpp index 186275b3240..14d10a60413 100644 --- a/src/intel/compiler/brw_fs.cpp +++ b/src/intel/compiler/brw_fs.cpp @@ -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]; -- 2.30.2