summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatt Turner <[email protected]>2013-10-27 19:34:48 -0700
committerMatt Turner <[email protected]>2013-11-01 15:21:07 -0700
commita8f76d829bdcdb5f238ba6206f1b768098745022 (patch)
treeb1257e5f92d61441e30fd8e540f0e6c81e70bd20
parentfd05ede0d05ee896cf07e2f690ddb42567f9f606 (diff)
i965/fs: Optimize OR with identical sources into a MOV.
Helps a lot of Steam games. total instructions in shared programs: 1409360 -> 1409124 (-0.02%) instructions in affected programs: 20842 -> 20606 (-1.13%) Reviewed-by: Eric Anholt <[email protected]> Reviewed-by: Paul Berry <[email protected]>
-rw-r--r--src/mesa/drivers/dri/i965/brw_fs.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/mesa/drivers/dri/i965/brw_fs.cpp b/src/mesa/drivers/dri/i965/brw_fs.cpp
index 236e86c7cc2..2350cd097c5 100644
--- a/src/mesa/drivers/dri/i965/brw_fs.cpp
+++ b/src/mesa/drivers/dri/i965/brw_fs.cpp
@@ -1872,6 +1872,14 @@ fs_visitor::opt_algebraic()
break;
}
break;
+ case BRW_OPCODE_OR:
+ if (inst->src[0].equals(inst->src[1])) {
+ inst->opcode = BRW_OPCODE_MOV;
+ inst->src[1] = reg_undef;
+ progress = true;
+ break;
+ }
+ break;
default:
break;
}