diff options
-rw-r--r-- | src/mesa/drivers/dri/i965/brw_fs.cpp | 5 | ||||
-rw-r--r-- | src/mesa/drivers/dri/i965/brw_shader.cpp | 9 | ||||
-rw-r--r-- | src/mesa/drivers/dri/i965/brw_shader.h | 1 |
3 files changed, 11 insertions, 4 deletions
diff --git a/src/mesa/drivers/dri/i965/brw_fs.cpp b/src/mesa/drivers/dri/i965/brw_fs.cpp index 780be80e6a7..a57f501a37e 100644 --- a/src/mesa/drivers/dri/i965/brw_fs.cpp +++ b/src/mesa/drivers/dri/i965/brw_fs.cpp @@ -487,10 +487,7 @@ fs_inst::equals(fs_inst *inst) const bool fs_inst::overwrites_reg(const fs_reg ®) const { - return (reg.file == dst.file && - reg.reg == dst.reg && - reg.reg_offset >= dst.reg_offset && - reg.reg_offset < dst.reg_offset + regs_written); + return reg.in_range(dst, regs_written); } bool diff --git a/src/mesa/drivers/dri/i965/brw_shader.cpp b/src/mesa/drivers/dri/i965/brw_shader.cpp index 51c965c4e77..0dda9bb823d 100644 --- a/src/mesa/drivers/dri/i965/brw_shader.cpp +++ b/src/mesa/drivers/dri/i965/brw_shader.cpp @@ -769,6 +769,15 @@ backend_reg::is_accumulator() const } bool +backend_reg::in_range(const backend_reg &r, unsigned n) const +{ + return (file == r.file && + reg == r.reg && + reg_offset >= r.reg_offset && + reg_offset < r.reg_offset + n); +} + +bool backend_instruction::is_commutative() const { switch (opcode) { diff --git a/src/mesa/drivers/dri/i965/brw_shader.h b/src/mesa/drivers/dri/i965/brw_shader.h index 944a8701aa3..8a3263e573d 100644 --- a/src/mesa/drivers/dri/i965/brw_shader.h +++ b/src/mesa/drivers/dri/i965/brw_shader.h @@ -54,6 +54,7 @@ struct backend_reg bool is_negative_one() const; bool is_null() const; bool is_accumulator() const; + bool in_range(const backend_reg &r, unsigned n) const; #endif enum register_file file; /**< Register file: GRF, MRF, IMM. */ |