i965: Don't compute-to-MRF in gen6 math instructions.
authorEric Anholt <eric@anholt.net>
Mon, 11 Oct 2010 20:38:38 +0000 (13:38 -0700)
committerEric Anholt <eric@anholt.net>
Mon, 11 Oct 2010 22:26:58 +0000 (15:26 -0700)
src/mesa/drivers/dri/i965/brw_fs.cpp

index 0f1f4fa26ef88d4902673e95b1a9fcaf92eba2d2..0353bb54e7236e919b691e9470fa5f1005a15aad 100644 (file)
@@ -2616,6 +2616,22 @@ fs_visitor::compute_to_mrf()
            if (scan_inst->mlen)
               break;
 
+           if (intel->gen >= 6) {
+              /* gen6 math instructions must have the destination be
+               * GRF, so no compute-to-MRF for them.
+               */
+              if (scan_inst->opcode == FS_OPCODE_RCP ||
+                  scan_inst->opcode == FS_OPCODE_RSQ ||
+                  scan_inst->opcode == FS_OPCODE_SQRT ||
+                  scan_inst->opcode == FS_OPCODE_EXP2 ||
+                  scan_inst->opcode == FS_OPCODE_LOG2 ||
+                  scan_inst->opcode == FS_OPCODE_SIN ||
+                  scan_inst->opcode == FS_OPCODE_COS ||
+                  scan_inst->opcode == FS_OPCODE_POW) {
+                 break;
+              }
+           }
+
            if (scan_inst->dst.reg_offset == inst->src[0].reg_offset) {
               /* Found the creator of our MRF's source value. */
               found = true;