Module: Mesa Branch: master Commit: 7b9cf797903a5ea70072a28c0486d3e99ee60645 URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=7b9cf797903a5ea70072a28c0486d3e99ee60645
Author: Kenneth Graunke <[email protected]> Date: Wed Mar 6 08:51:44 2013 -0800 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]> --- src/mesa/drivers/dri/i965/brw_vec4.cpp | 22 ++++++++++---------- src/mesa/drivers/dri/i965/brw_vec4.h | 2 +- .../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 fa186b5..e816b94 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 c2bbd68..a3ba9c7 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 3242c3a..abafe47 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; _______________________________________________ mesa-commit mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/mesa-commit
