[Mesa-dev] [PATCH 10/15] i965: Allow immediates to be folded into logical and shift instructions.

Matt Turner mattst88 at gmail.com
Thu Aug 22 16:08:30 PDT 2013


These instructions will be used with immediate arguments in the upcoming
frexp and ldexp lowering passes.
---
 src/mesa/drivers/dri/i965/brw_fs_copy_propagation.cpp | 11 +++++++++++
 1 file changed, 11 insertions(+)

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;
-- 
1.8.3.2



More information about the mesa-dev mailing list