i965: Allow commuting the operands of ADDC for const propagation.
authorMatt Turner <mattst88@gmail.com>
Thu, 28 Nov 2013 00:14:14 +0000 (16:14 -0800)
committerMatt Turner <mattst88@gmail.com>
Thu, 5 Dec 2013 04:05:42 +0000 (20:05 -0800)
Reviewed-by: Eric Anholt <eric@anholt.net>
src/mesa/drivers/dri/i965/brw_fs_copy_propagation.cpp
src/mesa/drivers/dri/i965/brw_vec4_copy_propagation.cpp

index a1720cdd1a0946e8e0c2d4720c44a4cec4fcf7ad..fc47d22a1827436bf742ca7a5ec06c199ce795f1 100644 (file)
@@ -348,7 +348,6 @@ fs_visitor::try_constant_propagate(fs_inst *inst, acp_entry *entry)
       case BRW_OPCODE_ASR:
       case BRW_OPCODE_SHL:
       case BRW_OPCODE_SHR:
-      case BRW_OPCODE_ADDC:
       case BRW_OPCODE_SUBB:
          if (i == 1) {
             inst->src[i] = entry->src;
@@ -362,6 +361,7 @@ fs_visitor::try_constant_propagate(fs_inst *inst, acp_entry *entry)
       case BRW_OPCODE_OR:
       case BRW_OPCODE_AND:
       case BRW_OPCODE_XOR:
+      case BRW_OPCODE_ADDC:
          if (i == 1) {
             inst->src[i] = entry->src;
             progress = true;
index c9c739080ca63669d70c28e328f5f1e18755c129..c8feff84d5676c545d621aa8f0102e0f024dd882 100644 (file)
@@ -99,7 +99,6 @@ try_constant_propagation(vec4_instruction *inst, int arg, src_reg *values[4])
    case BRW_OPCODE_ASR:
    case BRW_OPCODE_SHL:
    case BRW_OPCODE_SHR:
-   case BRW_OPCODE_ADDC:
    case BRW_OPCODE_SUBB:
       if (arg == 1) {
          inst->src[arg] = value;
@@ -113,6 +112,7 @@ try_constant_propagation(vec4_instruction *inst, int arg, src_reg *values[4])
    case BRW_OPCODE_OR:
    case BRW_OPCODE_AND:
    case BRW_OPCODE_XOR:
+   case BRW_OPCODE_ADDC:
       if (arg == 1) {
         inst->src[arg] = value;
         return true;