In order to do this, we have to change the signature of the
backend_reg(brw_reg) constructor to take a reference to a brw_reg in
order to avoid unresolvable ambiguity about which constructor is
actually being called in the other modifications in this patch.
As far as I understand it, the rule in C++ is that if multiple
constructors are available for parent classes, the one closest to you in
the class heirarchy is closen, but if one of them didn't take a
reference, that screws things up.
Reviewed-by: Francisco Jerez <currojerez@riseup.net>
struct backend_reg : public brw_reg
{
backend_reg() {}
- backend_reg(struct brw_reg reg) : brw_reg(reg) {}
+ backend_reg(const struct brw_reg ®) : brw_reg(reg) {}
bool equals(const backend_reg &r) const;
}
src_reg::src_reg(const dst_reg ®) :
- backend_reg(static_cast<struct brw_reg>(reg))
+ backend_reg(reg)
{
- this->reg_offset = reg.reg_offset;
this->reladdr = reg.reladdr;
this->swizzle = brw_swizzle_for_mask(reg.writemask);
}
}
dst_reg::dst_reg(const src_reg ®) :
- backend_reg(static_cast<struct brw_reg>(reg))
+ backend_reg(reg)
{
- this->reg_offset = reg.reg_offset;
this->writemask = brw_mask_for_swizzle(reg.swizzle);
this->reladdr = reg.reladdr;
}