i965/fs: Don't constant propagate into integer math instructions.
authorMatt Turner <mattst88@gmail.com>
Fri, 24 Apr 2015 20:14:56 +0000 (13:14 -0700)
committerMatt Turner <mattst88@gmail.com>
Fri, 24 Apr 2015 23:25:02 +0000 (16:25 -0700)
Constant combining won't promote non-floats, so this isn't safe.

Fixes regressions since commit 0087cf23e.

src/mesa/drivers/dri/i965/brw_fs_combine_constants.cpp
src/mesa/drivers/dri/i965/brw_fs_copy_propagation.cpp

index a5bacf499907902d065189e75779e0dc4595388f..aa62031df73ed558ce8e49966eef01b3ab3c93c5 100644 (file)
@@ -66,8 +66,6 @@ must_promote_imm(const struct brw_device_info *devinfo, const fs_inst *inst)
 {
    switch (inst->opcode) {
    case SHADER_OPCODE_POW:
-   case SHADER_OPCODE_INT_QUOTIENT:
-   case SHADER_OPCODE_INT_REMAINDER:
       return devinfo->gen < 8;
    case BRW_OPCODE_MAD:
    case BRW_OPCODE_LRP:
index af54debc213930f76364c594d4c281fdf98f40f4..9542d6a20ce83d66d1eab9e71ba88bb34a402f74 100644 (file)
@@ -499,9 +499,13 @@ fs_visitor::try_constant_propagate(fs_inst *inst, acp_entry *entry)
          progress = true;
          break;
 
-      case SHADER_OPCODE_POW:
       case SHADER_OPCODE_INT_QUOTIENT:
       case SHADER_OPCODE_INT_REMAINDER:
+         /* FINISHME: Promote non-float constants and remove this. */
+         if (devinfo->gen < 8)
+            break;
+         /* fallthrough */
+      case SHADER_OPCODE_POW:
          /* Allow constant propagation into src1 regardless of generation, and
           * let constant combining promote the constant on Gen < 8.
           */