[Mesa-dev] [PATCH v2 2/3] nv50/ir: handle logops with NOT in AlgebraicOpt

Karol Herbst karolherbst at gmail.com
Mon Apr 3 15:58:21 UTC 2017


Signed-off-by: Karol Herbst <karolherbst at gmail.com>
---
 src/gallium/drivers/nouveau/codegen/nv50_ir_peephole.cpp | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/src/gallium/drivers/nouveau/codegen/nv50_ir_peephole.cpp b/src/gallium/drivers/nouveau/codegen/nv50_ir_peephole.cpp
index bd60a84998..0de84fe9fc 100644
--- a/src/gallium/drivers/nouveau/codegen/nv50_ir_peephole.cpp
+++ b/src/gallium/drivers/nouveau/codegen/nv50_ir_peephole.cpp
@@ -1856,6 +1856,12 @@ AlgebraicOpt::handleLOGOP(Instruction *logop)
 
       set0 = cloneForward(func, set0);
       set1 = cloneShallow(func, set1);
+
+      if (logop->src(0).mod == Modifier(NV50_IR_MOD_NOT))
+         set0->asCmp()->setCond = inverseCondCode(set0->asCmp()->setCond);
+      if (logop->src(1).mod == Modifier(NV50_IR_MOD_NOT))
+         set1->asCmp()->setCond = inverseCondCode(set1->asCmp()->setCond);
+
       logop->bb->insertAfter(logop, set1);
       logop->bb->insertAfter(logop, set0);
 
-- 
2.12.2



More information about the mesa-dev mailing list