[Mesa-dev] [PATCH 2/4] i965: Move reads_flag()/writes_flag() to backend_instruction.
Matt Turner
mattst88 at gmail.com
Mon Sep 28 15:26:39 PDT 2015
---
src/mesa/drivers/dri/i965/brw_fs.cpp | 15 ---------------
src/mesa/drivers/dri/i965/brw_ir_fs.h | 3 ---
src/mesa/drivers/dri/i965/brw_ir_vec4.h | 12 ------------
src/mesa/drivers/dri/i965/brw_shader.h | 13 +++++++++++++
4 files changed, 13 insertions(+), 30 deletions(-)
diff --git a/src/mesa/drivers/dri/i965/brw_fs.cpp b/src/mesa/drivers/dri/i965/brw_fs.cpp
index 49dc7f6..5ca5c26 100644
--- a/src/mesa/drivers/dri/i965/brw_fs.cpp
+++ b/src/mesa/drivers/dri/i965/brw_fs.cpp
@@ -825,21 +825,6 @@ fs_inst::regs_read(int arg) const
}
}
-bool
-fs_inst::reads_flag() const
-{
- return predicate;
-}
-
-bool
-fs_inst::writes_flag() const
-{
- return (conditional_mod && (opcode != BRW_OPCODE_SEL &&
- opcode != BRW_OPCODE_IF &&
- opcode != BRW_OPCODE_WHILE)) ||
- 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_ir_fs.h b/src/mesa/drivers/dri/i965/brw_ir_fs.h
index 97c6f8b..860b5dc 100644
--- a/src/mesa/drivers/dri/i965/brw_ir_fs.h
+++ b/src/mesa/drivers/dri/i965/brw_ir_fs.h
@@ -206,9 +206,6 @@ public:
bool can_do_source_mods(const struct brw_device_info *devinfo);
bool has_side_effects() const;
- bool reads_flag() const;
- bool writes_flag() const;
-
fs_reg dst;
fs_reg *src;
diff --git a/src/mesa/drivers/dri/i965/brw_ir_vec4.h b/src/mesa/drivers/dri/i965/brw_ir_vec4.h
index 96dd633..d598b3c 100644
--- a/src/mesa/drivers/dri/i965/brw_ir_vec4.h
+++ b/src/mesa/drivers/dri/i965/brw_ir_vec4.h
@@ -179,18 +179,6 @@ public:
int swizzle, int swizzle_mask);
void reswizzle(int dst_writemask, int swizzle);
bool can_do_source_mods(const struct brw_device_info *devinfo);
-
- bool reads_flag()
- {
- return predicate || opcode == VS_OPCODE_UNPACK_FLAGS_SIMD4X2;
- }
-
- bool writes_flag()
- {
- return (conditional_mod && (opcode != BRW_OPCODE_SEL &&
- opcode != BRW_OPCODE_IF &&
- opcode != BRW_OPCODE_WHILE));
- }
};
/**
diff --git a/src/mesa/drivers/dri/i965/brw_shader.h b/src/mesa/drivers/dri/i965/brw_shader.h
index ccccf4d..9c4bdee 100644
--- a/src/mesa/drivers/dri/i965/brw_shader.h
+++ b/src/mesa/drivers/dri/i965/brw_shader.h
@@ -172,6 +172,19 @@ struct backend_instruction : public exec_node {
* optimize these out unless you know what you are doing.
*/
bool has_side_effects() const;
+
+ bool reads_flag()
+ {
+ return predicate || opcode == VS_OPCODE_UNPACK_FLAGS_SIMD4X2;
+ }
+
+ bool writes_flag()
+ {
+ return (conditional_mod && (opcode != BRW_OPCODE_SEL &&
+ opcode != BRW_OPCODE_IF &&
+ opcode != BRW_OPCODE_WHILE)) ||
+ opcode == FS_OPCODE_MOV_DISPATCH_TO_FLAGS;
+ }
#else
struct backend_instruction {
struct exec_node link;
--
2.4.9
More information about the mesa-dev
mailing list