i965: Remove the RCP+RSQ algebraic optimizations
authorJason Ekstrand <jason.ekstrand@intel.com>
Wed, 16 Mar 2016 23:06:10 +0000 (16:06 -0700)
committerJason Ekstrand <jason.ekstrand@intel.com>
Tue, 22 Mar 2016 23:46:15 +0000 (16:46 -0700)
NIR already has this optimization and it can do much better than the little
peephole in the backend.

No shader-db change on Haswell or Broadwell.

Reviewed-by: Matt Turner <mattst88@gmail.com>
src/mesa/drivers/dri/i965/brw_fs.cpp
src/mesa/drivers/dri/i965/brw_vec4.cpp

index eaff9535c2286b859bd490dcd72467dcb76e9c91..1a6a229e4445405dd3569be8760d361d085c281f 100644 (file)
@@ -2274,17 +2274,6 @@ fs_visitor::opt_algebraic()
             progress = true;
          }
          break;
-      case SHADER_OPCODE_RCP: {
-         fs_inst *prev = (fs_inst *)inst->prev;
-         if (prev->opcode == SHADER_OPCODE_SQRT) {
-            if (inst->src[0].equals(prev->dst)) {
-               inst->opcode = SHADER_OPCODE_RSQ;
-               inst->src[0] = prev->src[0];
-               progress = true;
-            }
-         }
-         break;
-      }
       case SHADER_OPCODE_BROADCAST:
          if (is_uniform(inst->src[0])) {
             inst->opcode = BRW_OPCODE_MOV;
index baf72a25c420487156746c6e49a834922eab618b..b9cf3f657a1e7c9a8a2c3a6081e037293c2110e7 100644 (file)
@@ -699,17 +699,6 @@ vec4_visitor::opt_algebraic()
             break;
          }
          break;
-      case SHADER_OPCODE_RCP: {
-         vec4_instruction *prev = (vec4_instruction *)inst->prev;
-         if (prev->opcode == SHADER_OPCODE_SQRT) {
-            if (inst->src[0].equals(src_reg(prev->dst))) {
-               inst->opcode = SHADER_OPCODE_RSQ;
-               inst->src[0] = prev->src[0];
-               progress = true;
-            }
-         }
-         break;
-      }
       case SHADER_OPCODE_BROADCAST:
          if (is_uniform(inst->src[0]) ||
              inst->src[1].is_zero()) {