From: Ian Romanick Date: Tue, 14 Apr 2020 17:30:53 +0000 (-0700) Subject: intel/compiler: Fixup operands in fs_builder::emit() that takes array X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=f7d620f47d53d9ad513c41730f3a24b9564e5e74;p=mesa.git intel/compiler: Fixup operands in fs_builder::emit() that takes array The versions that take a specific number of operands will do various fixups depending on the platform and the opcode. However, the version that takes an array of sources did not. This makes all version operate similarly. Reviewed-by: Matt Turner Part-of: --- diff --git a/src/intel/compiler/brw_fs_builder.h b/src/intel/compiler/brw_fs_builder.h index 896088cc5b8..430c7d10fc1 100644 --- a/src/intel/compiler/brw_fs_builder.h +++ b/src/intel/compiler/brw_fs_builder.h @@ -344,7 +344,16 @@ namespace brw { emit(enum opcode opcode, const dst_reg &dst, const src_reg srcs[], unsigned n) const { - return emit(instruction(opcode, dispatch_width(), dst, srcs, n)); + /* Use the emit() methods for specific operand counts to ensure that + * opcode-specific operand fixups occur. + */ + if (n == 2) { + return emit(opcode, dst, srcs[0], srcs[1]); + } else if (n == 3) { + return emit(opcode, dst, srcs[0], srcs[1], srcs[2]); + } else { + return emit(instruction(opcode, dispatch_width(), dst, srcs, n)); + } } /**