i965/gen7: Relax restrictions on fake MRFs
authorMatt Turner <mattst88@gmail.com>
Mon, 11 Feb 2013 19:06:13 +0000 (11:06 -0800)
committerMatt Turner <mattst88@gmail.com>
Thu, 28 Feb 2013 21:18:59 +0000 (13:18 -0800)
Gen6 has write-only MRF registers, and for ease of implementation we
paritition off 16 general purposes registers to act as MRFs on Gen7.

Knowing that our Gen7 MRFs are actually GRFs, we can do things we can't
do with real MRFs:
   - read from them;
   - return values directly to them from a send instruction; and
   - compute directly to them with math instructions.

Reviewed-by: Eric Anholt <eric@anholt.net>
src/mesa/drivers/dri/i965/brw_eu_emit.c

index f2dcbeb1f26b85bbef42f95866390e267e259af0..cf0a8946efa84c2e606a3e95378f393f5314133d 100644 (file)
@@ -1708,7 +1708,8 @@ void brw_math( struct brw_compile *p,
    if (intel->gen >= 6) {
       struct brw_instruction *insn = next_insn(p, BRW_OPCODE_MATH);
 
-      assert(dest.file == BRW_GENERAL_REGISTER_FILE);
+      assert(dest.file == BRW_GENERAL_REGISTER_FILE ||
+             (intel->gen >= 7 && dest.file == BRW_MESSAGE_REGISTER_FILE));
       assert(src.file == BRW_GENERAL_REGISTER_FILE);
 
       assert(dest.hstride == BRW_HORIZONTAL_STRIDE_1);
@@ -1772,7 +1773,8 @@ void brw_math2(struct brw_compile *p,
    (void) intel;
 
 
-   assert(dest.file == BRW_GENERAL_REGISTER_FILE);
+   assert(dest.file == BRW_GENERAL_REGISTER_FILE ||
+          (intel->gen >= 7 && dest.file == BRW_MESSAGE_REGISTER_FILE));
    assert(src0.file == BRW_GENERAL_REGISTER_FILE);
    assert(src1.file == BRW_GENERAL_REGISTER_FILE);