summaryrefslogtreecommitdiffstats
path: root/src/mesa/drivers/dri/i965/brw_fs_copy_propagation.cpp
diff options
context:
space:
mode:
authorMatt Turner <mattst88@gmail.com>2013-08-05 15:17:04 -0700
committerMatt Turner <mattst88@gmail.com>2013-09-09 15:01:08 -0700
commit89f5f675ad27bd485d1c1be654ca10c49321957f (patch)
tree402d12f2cb8cc2dfe27698e891d900458625953c /src/mesa/drivers/dri/i965/brw_fs_copy_propagation.cpp
parentd83221c2d33dcad3e5d3f8d8fa6abddea63b8817 (diff)
downloadexternal_mesa3d-89f5f675ad27bd485d1c1be654ca10c49321957f.zip
external_mesa3d-89f5f675ad27bd485d1c1be654ca10c49321957f.tar.gz
external_mesa3d-89f5f675ad27bd485d1c1be654ca10c49321957f.tar.bz2
i965: Allow immediates to be folded into logical and shift instructions.
These instructions will be used with immediate arguments in the upcoming ldexp lowering pass and frexp implementation. v2: Add vec4 support as well. Reviewed-by: Paul Berry <stereotype441@gmail.com>
Diffstat (limited to 'src/mesa/drivers/dri/i965/brw_fs_copy_propagation.cpp')
-rw-r--r--src/mesa/drivers/dri/i965/brw_fs_copy_propagation.cpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/mesa/drivers/dri/i965/brw_fs_copy_propagation.cpp b/src/mesa/drivers/dri/i965/brw_fs_copy_propagation.cpp
index 2780ab6..034ebef 100644
--- a/src/mesa/drivers/dri/i965/brw_fs_copy_propagation.cpp
+++ b/src/mesa/drivers/dri/i965/brw_fs_copy_propagation.cpp
@@ -341,9 +341,20 @@ fs_visitor::try_constant_propagate(fs_inst *inst, acp_entry *entry)
progress = true;
break;
+ case BRW_OPCODE_SHL:
+ case BRW_OPCODE_SHR:
+ if (i == 1) {
+ inst->src[i] = entry->src;
+ progress = true;
+ }
+ break;
+
case BRW_OPCODE_MACH:
case BRW_OPCODE_MUL:
case BRW_OPCODE_ADD:
+ case BRW_OPCODE_OR:
+ case BRW_OPCODE_AND:
+ case BRW_OPCODE_XOR:
if (i == 1) {
inst->src[i] = entry->src;
progress = true;