summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMatt Turner <[email protected]>2014-01-09 20:57:36 -0800
committerMatt Turner <[email protected]>2014-01-21 14:20:44 -0800
commitbf0773aeca86669371d99eadb928c6dc92d5840a (patch)
treeda10136457b189ddc480635cb76fec375755bc9e /src
parent8d37e9915a3b21b496269a39f677a80a6e02cb2c (diff)
i965/fs: Optimize LRP with x == y into a MOV.
total instructions in shared programs: 1487331 -> 1485988 (-0.09%) instructions in affected programs: 45638 -> 44295 (-2.94%) GAINED: 7 LOST: 0 Reviewed-by: Jordan Justen <[email protected]>
Diffstat (limited to 'src')
-rw-r--r--src/mesa/drivers/dri/i965/brw_fs.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/mesa/drivers/dri/i965/brw_fs.cpp b/src/mesa/drivers/dri/i965/brw_fs.cpp
index 4a96126bac5..78ddf0d99cf 100644
--- a/src/mesa/drivers/dri/i965/brw_fs.cpp
+++ b/src/mesa/drivers/dri/i965/brw_fs.cpp
@@ -2000,6 +2000,16 @@ fs_visitor::opt_algebraic()
break;
}
break;
+ case BRW_OPCODE_LRP:
+ if (inst->src[1].equals(inst->src[2])) {
+ inst->opcode = BRW_OPCODE_MOV;
+ inst->src[0] = inst->src[1];
+ inst->src[1] = reg_undef;
+ inst->src[2] = reg_undef;
+ progress = true;
+ break;
+ }
+ break;
case BRW_OPCODE_SEL:
if (inst->saturate && inst->src[1].file == IMM) {
switch (inst->conditional_mod) {