Reviewed-by: Matt Turner <mattst88@gmail.com>
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
fixed_hw_reg.nr == BRW_ARF_ACCUMULATOR;
}
+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
{
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. */