From f7d620f47d53d9ad513c41730f3a24b9564e5e74 Mon Sep 17 00:00:00 2001 From: Ian Romanick Date: Tue, 14 Apr 2020 10:30:53 -0700 Subject: [PATCH] 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: --- src/intel/compiler/brw_fs_builder.h | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) 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)); + } } /** -- 2.30.2