[Mesa-dev] [PATCH 05/20] i965/fs: Handle explicit flag destinations in flags_written()

Matt Turner mattst88 at gmail.com
Thu Jul 6 23:48:15 UTC 2017


The implementations of the ARB_shader_group_vote intrinsics will
explicitly write the flag as the destination register.
---
 src/intel/compiler/brw_fs.cpp | 12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)

diff --git a/src/intel/compiler/brw_fs.cpp b/src/intel/compiler/brw_fs.cpp
index 43b6e34204..97908a4563 100644
--- a/src/intel/compiler/brw_fs.cpp
+++ b/src/intel/compiler/brw_fs.cpp
@@ -890,9 +890,17 @@ fs_inst::flags_written() const
                             opcode != BRW_OPCODE_WHILE)) ||
        opcode == FS_OPCODE_MOV_DISPATCH_TO_FLAGS) {
       return flag_mask(this);
-   } else {
-      return 0;
+   } else if (dst.file == ARF) {
+      if (dst.nr == BRW_ARF_FLAG + 0 && dst.subnr == 0)
+         return 0b0001;
+      if (dst.nr == BRW_ARF_FLAG + 0 && dst.subnr == 1)
+         return 0b0010;
+      if (dst.nr == BRW_ARF_FLAG + 1 && dst.subnr == 0)
+         return 0b0100;
+      if (dst.nr == BRW_ARF_FLAG + 1 && dst.subnr == 1)
+         return 0b1000;
    }
+   return 0;
 }
 
 /**
-- 
2.13.0



More information about the mesa-dev mailing list