summaryrefslogtreecommitdiffstats
path: root/src/mesa/drivers/dri/i965/brw_ir_fs.h
diff options
context:
space:
mode:
authorFrancisco Jerez <currojerez@riseup.net>2016-05-18 21:54:35 -0700
committerFrancisco Jerez <currojerez@riseup.net>2016-05-27 23:29:04 -0700
commitdf1aec763eb972c69bc5127be102a9f281ce94f6 (patch)
treedd3ece131a76bd47a34d6b70f229f881bcd767a4 /src/mesa/drivers/dri/i965/brw_ir_fs.h
parentece41df247af247fb573ae8ec208d50e895b7aef (diff)
downloadexternal_mesa3d-df1aec763eb972c69bc5127be102a9f281ce94f6.zip
external_mesa3d-df1aec763eb972c69bc5127be102a9f281ce94f6.tar.gz
external_mesa3d-df1aec763eb972c69bc5127be102a9f281ce94f6.tar.bz2
i965/fs: Define methods to calculate the flag subset read or written by an fs_inst.
v2: Codestyle fixes (Jason). Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Diffstat (limited to 'src/mesa/drivers/dri/i965/brw_ir_fs.h')
-rw-r--r--src/mesa/drivers/dri/i965/brw_ir_fs.h25
1 files changed, 23 insertions, 2 deletions
diff --git a/src/mesa/drivers/dri/i965/brw_ir_fs.h b/src/mesa/drivers/dri/i965/brw_ir_fs.h
index 13f4e15..ca4b40a 100644
--- a/src/mesa/drivers/dri/i965/brw_ir_fs.h
+++ b/src/mesa/drivers/dri/i965/brw_ir_fs.h
@@ -276,8 +276,29 @@ public:
bool has_side_effects() const;
bool has_source_and_destination_hazard() const;
- bool reads_flag() const;
- bool writes_flag() const;
+ /**
+ * Return the subset of flag registers read by the instruction as a bitset
+ * with byte granularity.
+ */
+ unsigned flags_read(const brw_device_info *devinfo) const;
+
+ /**
+ * Return the subset of flag registers updated by the instruction (either
+ * partially or fully) as a bitset with byte granularity.
+ */
+ unsigned flags_written() const;
+
+ bool reads_flag() const
+ {
+ /* XXX - Will get rid of this hack shortly. */
+ const brw_device_info devinfo = {};
+ return flags_read(&devinfo);
+ }
+
+ bool writes_flag() const
+ {
+ return flags_written();
+ }
fs_reg dst;
fs_reg *src;