[Mesa-dev] [PATCH 21/51] intel/compiler/fs: Use 16-bit null dest with 16-bit math

Topi Pohjolainen topi.pohjolainen at gmail.com
Fri Nov 24 12:26:48 UTC 2017


Even though this doesn't seem to alter anything else than dumping
it is more consistent.

Signed-off-by: Topi Pohjolainen <topi.pohjolainen at intel.com>
---
 src/intel/compiler/brw_fs_generator.cpp | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/src/intel/compiler/brw_fs_generator.cpp b/src/intel/compiler/brw_fs_generator.cpp
index 03fd34c00a..20d018e1fe 100644
--- a/src/intel/compiler/brw_fs_generator.cpp
+++ b/src/intel/compiler/brw_fs_generator.cpp
@@ -1918,8 +1918,13 @@ fs_generator::generate_code(const cfg_t *cfg, int dispatch_width)
 	 if (devinfo->gen >= 6) {
             assert(inst->mlen == 0);
             assert(devinfo->gen >= 7 || inst->exec_size == 8);
+
+            struct brw_reg null_reg = brw_null_reg();
+            if (brw_reg_type_to_size(dst.type) == 2)
+               null_reg = retype(null_reg, BRW_REGISTER_TYPE_HF);
+
             gen6_math(p, dst, brw_math_function(inst->opcode),
-                      src[0], brw_null_reg());
+                      src[0], null_reg);
 	 } else {
             assert(inst->mlen >= 1);
             assert(devinfo->gen == 5 || devinfo->is_g4x || inst->exec_size == 8);
-- 
2.11.0



More information about the mesa-dev mailing list