summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorFrancisco Jerez <[email protected]>2015-02-05 22:40:07 +0200
committerFrancisco Jerez <[email protected]>2015-02-10 19:09:24 +0200
commit388b136e677e30249e062145b488c2d938c1ef17 (patch)
tree318306652aa2b6cd170d041be8753affd3b444fa /src
parent3df2cb2f863836ec909f5259693c1eeef675a594 (diff)
i965/vec4: Implement equals() method for dst_reg too.
Reviewed-by: Matt Turner <[email protected]>
Diffstat (limited to 'src')
-rw-r--r--src/mesa/drivers/dri/i965/brw_ir_vec4.h2
-rw-r--r--src/mesa/drivers/dri/i965/brw_vec4.cpp16
2 files changed, 18 insertions, 0 deletions
diff --git a/src/mesa/drivers/dri/i965/brw_ir_vec4.h b/src/mesa/drivers/dri/i965/brw_ir_vec4.h
index ae024b328d9..f11a2d21d1e 100644
--- a/src/mesa/drivers/dri/i965/brw_ir_vec4.h
+++ b/src/mesa/drivers/dri/i965/brw_ir_vec4.h
@@ -117,6 +117,8 @@ public:
explicit dst_reg(src_reg reg);
+ bool equals(const dst_reg &r) const;
+
int writemask; /**< Bitfield of WRITEMASK_[XYZW] */
src_reg *reladdr;
diff --git a/src/mesa/drivers/dri/i965/brw_vec4.cpp b/src/mesa/drivers/dri/i965/brw_vec4.cpp
index 622502ef3d9..5ad9da291df 100644
--- a/src/mesa/drivers/dri/i965/brw_vec4.cpp
+++ b/src/mesa/drivers/dri/i965/brw_vec4.cpp
@@ -235,6 +235,22 @@ dst_reg::dst_reg(src_reg reg)
}
bool
+dst_reg::equals(const dst_reg &r) const
+{
+ return (file == r.file &&
+ reg == r.reg &&
+ reg_offset == r.reg_offset &&
+ type == r.type &&
+ negate == r.negate &&
+ abs == r.abs &&
+ writemask == r.writemask &&
+ (reladdr == r.reladdr ||
+ (reladdr && r.reladdr && reladdr->equals(*r.reladdr))) &&
+ memcmp(&fixed_hw_reg, &r.fixed_hw_reg,
+ sizeof(fixed_hw_reg)) == 0);
+}
+
+bool
vec4_instruction::is_send_from_grf()
{
switch (opcode) {