i965: Don't copy prop source mods into instructions that can't take them.
authorMatt Turner <mattst88@gmail.com>
Fri, 20 Sep 2013 02:48:22 +0000 (19:48 -0700)
committerMatt Turner <mattst88@gmail.com>
Mon, 14 Oct 2013 18:13:09 +0000 (11:13 -0700)
src/mesa/drivers/dri/i965/brw_fs.cpp
src/mesa/drivers/dri/i965/brw_shader.cpp
src/mesa/drivers/dri/i965/brw_shader.h
src/mesa/drivers/dri/i965/brw_vec4.cpp

index e5d6e4b281e39b92a7dd09d27c15426843db4e52..85995df7869d9493de2289f5d08e9937c6b502a6 100644 (file)
@@ -368,6 +368,9 @@ fs_visitor::can_do_source_mods(fs_inst *inst)
    if (inst->is_send_from_grf())
       return false;
 
+   if (!inst->can_do_source_mods())
+      return false;
+
    return true;
 }
 
index 61c4bf5a5ffd4d064eeec3e742c4a71b272081fa..256f9b21e4ce3cddd740acad19b2665f9a0bc8f6 100644 (file)
@@ -568,6 +568,25 @@ backend_instruction::is_control_flow()
    }
 }
 
+bool
+backend_instruction::can_do_source_mods()
+{
+   switch (opcode) {
+   case BRW_OPCODE_ADDC:
+   case BRW_OPCODE_BFE:
+   case BRW_OPCODE_BFI1:
+   case BRW_OPCODE_BFI2:
+   case BRW_OPCODE_BFREV:
+   case BRW_OPCODE_CBIT:
+   case BRW_OPCODE_FBH:
+   case BRW_OPCODE_FBL:
+   case BRW_OPCODE_SUBB:
+      return false;
+   default:
+      return true;
+   }
+}
+
 void
 backend_visitor::dump_instructions()
 {
index 4dbd38d4a52cd3768bb107fb9c97cc2a6f15241b..21a0ad66c42a3be19adba19add86f39d2689684f 100644 (file)
@@ -44,6 +44,7 @@ public:
    bool is_tex();
    bool is_math();
    bool is_control_flow();
+   bool can_do_source_mods();
 
    enum opcode opcode; /* BRW_OPCODE_* or FS_OPCODE_* */
 
index 149a1a0e16519120ee1b5f941870703f3b000900..bfd01068aba97c3f4d1eba047fca48529cd12eef 100644 (file)
@@ -222,6 +222,9 @@ vec4_visitor::can_do_source_mods(vec4_instruction *inst)
    if (inst->is_send_from_grf())
       return false;
 
+   if (!inst->can_do_source_mods())
+      return false;
+
    return true;
 }