i965: Fix MRF register number assertions for compr4.
authorKenneth Graunke <kenneth@whitecape.org>
Mon, 21 Sep 2015 14:42:27 +0000 (07:42 -0700)
committerKenneth Graunke <kenneth@whitecape.org>
Mon, 21 Sep 2015 14:45:14 +0000 (07:45 -0700)
compr4 is represented by setting the high bit on the MRF number.
We need to mask it out before sanity checking the register number.

Fixes ~8000 assert fails on Ironlake and G45.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=92066
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
src/mesa/drivers/dri/i965/brw_eu_emit.c

index 6a4e316b43c13d3c4027e81133a58b9a7203c229..dc699bb63210384bebef1caefa156ed1ab48c06a 100644 (file)
@@ -147,7 +147,7 @@ brw_set_dest(struct brw_codegen *p, brw_inst *inst, struct brw_reg dest)
    const struct brw_device_info *devinfo = p->devinfo;
 
    if (dest.file == BRW_MESSAGE_REGISTER_FILE)
-      assert(dest.nr < BRW_MAX_MRF(devinfo->gen));
+      assert((dest.nr & ~(1 << 7)) < BRW_MAX_MRF(devinfo->gen));
    else if (dest.file != BRW_ARCHITECTURE_REGISTER_FILE)
       assert(dest.nr < 128);
 
@@ -311,7 +311,7 @@ brw_set_src0(struct brw_codegen *p, brw_inst *inst, struct brw_reg reg)
    const struct brw_device_info *devinfo = p->devinfo;
 
    if (reg.file == BRW_MESSAGE_REGISTER_FILE)
-      assert(reg.nr < BRW_MAX_MRF(devinfo->gen));
+      assert((reg.nr & ~(1 << 7)) < BRW_MAX_MRF(devinfo->gen));
    else if (reg.file != BRW_ARCHITECTURE_REGISTER_FILE)
       assert(reg.nr < 128);