i965/fs: Emit compressed 3-source instructions on Haswell.
authorMatt Turner <mattst88@gmail.com>
Sat, 16 Nov 2013 20:31:26 +0000 (12:31 -0800)
committerMatt Turner <mattst88@gmail.com>
Wed, 20 Nov 2013 23:04:52 +0000 (15:04 -0800)
For commit 4df56177 Paul discovered that the hardware restriction that
Align16 instructions cannot be compressed was lifted on Haswell. This
has prevented us from emitting compressed three-source instructions.

For added confirmation, the bspec lists a work around called
WaBreakSimd16TernaryInstructionsIntoSimd8 that hasn't been applicable
since very early Haswell silicon.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
src/mesa/drivers/dri/i965/brw_fs_generator.cpp

index cc58ff2598b05e3c3ce94ae4ffd9bd48ae2fb802..a97a016b8b3b16840e91cc5a76cd56539f3b6095 100644 (file)
@@ -1404,7 +1404,7 @@ fs_generator::generate_code(exec_list *instructions)
       case BRW_OPCODE_MAD:
          assert(brw->gen >= 6);
         brw_set_access_mode(p, BRW_ALIGN_16);
-        if (dispatch_width == 16) {
+         if (dispatch_width == 16 && !brw->is_haswell) {
            brw_set_compression_control(p, BRW_COMPRESSION_NONE);
            brw_MAD(p, dst, src[0], src[1], src[2]);
            brw_set_compression_control(p, BRW_COMPRESSION_2NDHALF);
@@ -1419,7 +1419,7 @@ fs_generator::generate_code(exec_list *instructions)
       case BRW_OPCODE_LRP:
          assert(brw->gen >= 6);
         brw_set_access_mode(p, BRW_ALIGN_16);
-        if (dispatch_width == 16) {
+         if (dispatch_width == 16 && !brw->is_haswell) {
            brw_set_compression_control(p, BRW_COMPRESSION_NONE);
            brw_LRP(p, dst, src[0], src[1], src[2]);
            brw_set_compression_control(p, BRW_COMPRESSION_2NDHALF);
@@ -1516,7 +1516,7 @@ fs_generator::generate_code(exec_list *instructions)
       case BRW_OPCODE_BFE:
          assert(brw->gen >= 7);
          brw_set_access_mode(p, BRW_ALIGN_16);
-         if (dispatch_width == 16) {
+         if (dispatch_width == 16 && !brw->is_haswell) {
             brw_set_compression_control(p, BRW_COMPRESSION_NONE);
             brw_BFE(p, dst, src[0], src[1], src[2]);
             brw_set_compression_control(p, BRW_COMPRESSION_2NDHALF);