[Mesa-dev] [PATCH 5/6] nv50/ir: optimize SHLADD(a, b, c) to MOV((a << b) + c)

Samuel Pitoiset samuel.pitoiset at gmail.com
Mon Sep 19 22:11:26 UTC 2016


Signed-off-by: Samuel Pitoiset <samuel.pitoiset at gmail.com>
---
 src/gallium/drivers/nouveau/codegen/nv50_ir_peephole.cpp | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/src/gallium/drivers/nouveau/codegen/nv50_ir_peephole.cpp b/src/gallium/drivers/nouveau/codegen/nv50_ir_peephole.cpp
index 1b99ce7..75c448e 100644
--- a/src/gallium/drivers/nouveau/codegen/nv50_ir_peephole.cpp
+++ b/src/gallium/drivers/nouveau/codegen/nv50_ir_peephole.cpp
@@ -778,6 +778,9 @@ ConstantFolding::expr(Instruction *i,
       }
       break;
    }
+   case OP_SHLADD:
+      res.data.u32 = (a->data.u32 << b->data.u32) + c->data.u32;
+      break;
    default:
       return;
    }
-- 
2.10.0



More information about the mesa-dev mailing list