Mesa (master): intel/compiler: Fixup operands in fs_builder::emit() that takes array

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Fri Apr 17 15:32:59 UTC 2020


Module: Mesa
Branch: master
Commit: f7d620f47d53d9ad513c41730f3a24b9564e5e74
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=f7d620f47d53d9ad513c41730f3a24b9564e5e74

Author: Ian Romanick <ian.d.romanick at intel.com>
Date:   Tue Apr 14 10:30:53 2020 -0700

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 <mattst88 at gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4582>

---

 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));
+         }
       }
 
       /**



More information about the mesa-commit mailing list