i965/fs: Add reads_flag() and writes_flag() to fs_inst.
authorMatt Turner <mattst88@gmail.com>
Sun, 20 Oct 2013 18:32:01 +0000 (11:32 -0700)
committerMatt Turner <mattst88@gmail.com>
Thu, 31 Oct 2013 02:49:27 +0000 (19:49 -0700)
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
src/mesa/drivers/dri/i965/brw_fs.cpp
src/mesa/drivers/dri/i965/brw_fs.h

index 69340f0bc9f9cab9ba9a43adb198436418e3472d..236e86c7cc21e37d9eb39a292939066bcf7d60eb 100644 (file)
@@ -732,6 +732,19 @@ 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 != BRW_OPCODE_SEL) ||
+          opcode == FS_OPCODE_MOV_DISPATCH_TO_FLAGS;
+}
+
 /**
  * Returns how many MRFs an FS opcode will write over.
  *
index c9b0aa1773c5467beb767dcc05fbd5b5b939ed0d..43e47617c172b588288b0f9011d24b72546518da 100644 (file)
@@ -151,6 +151,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;