diff options
author | Kenneth Graunke <[email protected]> | 2013-03-06 08:51:44 -0800 |
---|---|---|
committer | Kenneth Graunke <[email protected]> | 2014-06-10 16:38:26 -0700 |
commit | 7b9cf797903a5ea70072a28c0486d3e99ee60645 (patch) | |
tree | 28e012d1108bf18310d08eb33bb3d64ba078755f /src/mesa/drivers/dri | |
parent | 000f4a33c0359ed6b3c11aafa5f0cba1d6d91fea (diff) |
i965: Make src_reg::equals() take a constant reference, not a pointer.
This is more typical C++ style.
Signed-off-by: Kenneth Graunke <[email protected]>
Reviewed-by: Topi Pohjolainen <[email protected]>
Diffstat (limited to 'src/mesa/drivers/dri')
-rw-r--r-- | src/mesa/drivers/dri/i965/brw_vec4.cpp | 22 | ||||
-rw-r--r-- | src/mesa/drivers/dri/i965/brw_vec4.h | 2 | ||||
-rw-r--r-- | src/mesa/drivers/dri/i965/brw_vec4_copy_propagation.cpp | 4 |
3 files changed, 14 insertions, 14 deletions
diff --git a/src/mesa/drivers/dri/i965/brw_vec4.cpp b/src/mesa/drivers/dri/i965/brw_vec4.cpp index fa186b536bf..e816b94e608 100644 --- a/src/mesa/drivers/dri/i965/brw_vec4.cpp +++ b/src/mesa/drivers/dri/i965/brw_vec4.cpp @@ -323,19 +323,19 @@ vec4_visitor::implied_mrf_writes(vec4_instruction *inst) } bool -src_reg::equals(src_reg *r) +src_reg::equals(const src_reg &r) const { - return (file == r->file && - reg == r->reg && - reg_offset == r->reg_offset && - type == r->type && - negate == r->negate && - abs == r->abs && - swizzle == r->swizzle && - !reladdr && !r->reladdr && - memcmp(&fixed_hw_reg, &r->fixed_hw_reg, + return (file == r.file && + reg == r.reg && + reg_offset == r.reg_offset && + type == r.type && + negate == r.negate && + abs == r.abs && + swizzle == r.swizzle && + !reladdr && !r.reladdr && + memcmp(&fixed_hw_reg, &r.fixed_hw_reg, sizeof(fixed_hw_reg)) == 0 && - imm.u == r->imm.u); + imm.u == r.imm.u); } static bool diff --git a/src/mesa/drivers/dri/i965/brw_vec4.h b/src/mesa/drivers/dri/i965/brw_vec4.h index c2bbd68edf6..a3ba9c77647 100644 --- a/src/mesa/drivers/dri/i965/brw_vec4.h +++ b/src/mesa/drivers/dri/i965/brw_vec4.h @@ -126,7 +126,7 @@ public: src_reg(int32_t i); src_reg(struct brw_reg reg); - bool equals(src_reg *r); + bool equals(const src_reg &r) const; bool is_zero() const; bool is_one() const; bool is_accumulator() const; diff --git a/src/mesa/drivers/dri/i965/brw_vec4_copy_propagation.cpp b/src/mesa/drivers/dri/i965/brw_vec4_copy_propagation.cpp index 3242c3a0dd0..abafe47a759 100644 --- a/src/mesa/drivers/dri/i965/brw_vec4_copy_propagation.cpp +++ b/src/mesa/drivers/dri/i965/brw_vec4_copy_propagation.cpp @@ -82,7 +82,7 @@ try_constant_propagation(vec4_instruction *inst, int arg, src_reg *values[4]) */ src_reg value = *values[0]; for (int i = 1; i < 4; i++) { - if (!value.equals(values[i])) + if (!value.equals(*values[i])) return false; } @@ -289,7 +289,7 @@ vec4_visitor::try_copy_propagation(vec4_instruction *inst, int arg, return false; /* Don't report progress if this is a noop. */ - if (value.equals(&inst->src[arg])) + if (value.equals(inst->src[arg])) return false; value.type = inst->src[arg].type; |