GLuint msg_reg_nr)
{
struct intel_context *intel = &p->brw->intel;
- if (intel->gen != 6)
+ if (intel->gen < 6)
return;
if (src->file != BRW_ARCHITECTURE_REGISTER_FILE || src->nr != BRW_ARF_NULL) {
*src = brw_message_reg(msg_reg_nr);
}
+static void
+gen7_convert_mrf_to_grf(struct brw_compile *p, struct brw_reg *reg)
+{
+ struct intel_context *intel = &p->brw->intel;
+ if (intel->gen == 7 && reg->file == BRW_MESSAGE_REGISTER_FILE) {
+ reg->file = BRW_GENERAL_REGISTER_FILE;
+ reg->nr += 111;
+ }
+}
+
static void brw_set_dest(struct brw_compile *p,
struct brw_instruction *insn,
struct brw_reg dest)
{
+ struct intel_context *intel = &p->brw->intel;
+
if (dest.file != BRW_ARCHITECTURE_REGISTER_FILE &&
dest.file != BRW_MESSAGE_REGISTER_FILE)
assert(dest.nr < 128);
+ gen7_convert_mrf_to_grf(p, &dest);
+
insn->bits1.da1.dest_reg_file = dest.file;
insn->bits1.da1.dest_reg_type = dest.type;
insn->bits1.da1.dest_address_mode = dest.address_mode;
if (reg.type != BRW_ARCHITECTURE_REGISTER_FILE)
assert(reg.nr < 128);
+ gen7_convert_mrf_to_grf(p, ®);
+
validate_reg(insn, reg);
insn->bits1.da1.src0_reg_file = reg.file;
assert(reg.nr < 128);
+ gen7_convert_mrf_to_grf(p, ®);
+
validate_reg(insn, reg);
insn->bits1.da1.src1_reg_file = reg.file;