[Mesa-dev] [PATCH 4/7] i965/fs: Add reads_flag() and writes_flag() to fs_inst.

Matt Turner mattst88 at gmail.com
Wed Oct 23 06:19:30 CEST 2013


---
v2: Clean up style (Ian) and check for FS_OPCODE_MOV_DISPATCH_TO_FLAGS (Eric).

 src/mesa/drivers/dri/i965/brw_fs.cpp | 12 ++++++++++++
 src/mesa/drivers/dri/i965/brw_fs.h   |  3 +++
 2 files changed, 15 insertions(+)

diff --git a/src/mesa/drivers/dri/i965/brw_fs.cpp b/src/mesa/drivers/dri/i965/brw_fs.cpp
index 77b898b..03765b6 100644
--- a/src/mesa/drivers/dri/i965/brw_fs.cpp
+++ b/src/mesa/drivers/dri/i965/brw_fs.cpp
@@ -730,6 +730,18 @@ fs_inst::regs_read(fs_visitor *v, int arg)
    return 1;
 }
 
+bool
+fs_inst::reads_flag()
+{
+   return predicate;
+}
+
+bool
+fs_inst::writes_flag()
+{
+   return conditional_mod || opcode == FS_OPCODE_MOV_DISPATCH_TO_FLAGS;
+}
+
 /**
  * Returns how many MRFs an FS opcode will write over.
  *
diff --git a/src/mesa/drivers/dri/i965/brw_fs.h b/src/mesa/drivers/dri/i965/brw_fs.h
index 3104717..f241095 100644
--- a/src/mesa/drivers/dri/i965/brw_fs.h
+++ b/src/mesa/drivers/dri/i965/brw_fs.h
@@ -149,6 +149,9 @@ public:
    bool is_partial_write();
    int regs_read(fs_visitor *v, int arg);
 
+   bool reads_flag();
+   bool writes_flag();
+
    fs_reg dst;
    fs_reg src[3];
    bool saturate;
-- 
1.8.3.2



More information about the mesa-dev mailing list