[Mesa-dev] [PATCH] intel/compiler: Replicate 16 bit immediate value correctly

Sagar Ghuge sagar.ghuge at intel.com
Tue Mar 26 22:34:47 UTC 2019


For the W or UW (signed or unsigned word) source types, the 16-bit value
must be replicated in both the low and high words of the 32-bit
immediate value.

Signed-off-by: Sagar Ghuge <sagar.ghuge at intel.com>
---
 src/intel/compiler/brw_fs.cpp | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/src/intel/compiler/brw_fs.cpp b/src/intel/compiler/brw_fs.cpp
index 0c2439d9daf..f8cb91fcf21 100644
--- a/src/intel/compiler/brw_fs.cpp
+++ b/src/intel/compiler/brw_fs.cpp
@@ -4069,6 +4069,9 @@ fs_visitor::lower_integer_multiplication()
             mul->src[1].type = BRW_REGISTER_TYPE_UW;
             mul->src[1].stride *= 2;
 
+            if (mul->src[1].file == IMM)
+               mul->src[1].ud = ((mul->src[1].ud & 0xffff) |
+                                 mul->src[1].ud << 16);
          } else if (devinfo->gen == 7 && !devinfo->is_haswell &&
                     inst->group > 0) {
             /* Among other things the quarter control bits influence which
-- 
2.20.1



More information about the mesa-dev mailing list