And define non-mutating helper functions to retype fixed and normal
regs with a common interface. At some point we may want to get rid of
::fixed_hw_reg completely and have fixed regs use the normal register
data members (e.g. backend_reg::reg to select a fixed GRF number,
src_reg::swizzle to store the swizzle, etc.), I have the feeling that
this is not the last headache we're going to get because of the
multiple ways to represent the same thing and the different register
interface depending on the file a register is stored in...
Reviewed-by: Paul Berry <stereotype441@gmail.com>
fs_reg *reladdr;
};
+static inline fs_reg
+retype(fs_reg reg, unsigned type)
+{
+ reg.fixed_hw_reg.type = reg.type = type;
+ return reg;
+}
+
static inline fs_reg
offset(fs_reg reg, unsigned delta)
{
}
break;
case HW_REG:
+ assert(reg->type == reg->fixed_hw_reg.type);
brw_reg = reg->fixed_hw_reg;
break;
case BAD_FILE:
this->file = HW_REG;
this->fixed_hw_reg = reg;
+ this->type = reg.type;
}
src_reg::src_reg(dst_reg reg)
this->file = HW_REG;
this->fixed_hw_reg = reg;
+ this->type = reg.type;
}
dst_reg::dst_reg(src_reg reg)
src_reg *reladdr;
};
+static inline src_reg
+retype(src_reg reg, unsigned type)
+{
+ reg.fixed_hw_reg.type = reg.type = type;
+ return reg;
+}
+
static inline src_reg
offset(src_reg reg, unsigned delta)
{
src_reg *reladdr;
};
+static inline dst_reg
+retype(dst_reg reg, unsigned type)
+{
+ reg.fixed_hw_reg.type = reg.type = type;
+ return reg;
+}
+
static inline dst_reg
offset(dst_reg reg, unsigned delta)
{
break;
case HW_REG:
+ assert(dst.type == dst.fixed_hw_reg.type);
brw_reg = dst.fixed_hw_reg;
break;
break;
case HW_REG:
+ assert(src[i].type == src[i].fixed_hw_reg.type);
brw_reg = src[i].fixed_hw_reg;
break;