Mesa (master): nv50/ir: clear dnz flag when converting mul/mad to simpler ops

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Sat Jan 16 18:11:05 UTC 2021


Module: Mesa
Branch: master
Commit: 6638b58ccf17ce3a00a8ecbf5f39b5bedef238ed
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=6638b58ccf17ce3a00a8ecbf5f39b5bedef238ed

Author: Ilia Mirkin <imirkin at alum.mit.edu>
Date:   Fri Jan 15 17:01:27 2021 -0500

nv50/ir: clear dnz flag when converting mul/mad to simpler ops

Fixes some assertion failures in the GM107 emitter with the game
'tansei', noticed while debugging gitlab issue 4101.

Signed-off-by: Ilia Mirkin <imirkin at alum.mit.edu>
Reviewed-by: Karol Herbst <kherbst at redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8534>

---

 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 2d32067729d..f5514c6f5fd 100644
--- a/src/gallium/drivers/nouveau/codegen/nv50_ir_peephole.cpp
+++ b/src/gallium/drivers/nouveau/codegen/nv50_ir_peephole.cpp
@@ -1108,6 +1108,7 @@ ConstantFolding::opnd(Instruction *i, ImmediateValue &imm0, int s)
          }
       } else
       if (imm0.isInteger(0)) {
+         i->dnz = 0;
          i->op = OP_MOV;
          i->setSrc(0, new_ImmediateValue(prog, 0u));
          i->src(0).mod = Modifier(0);
@@ -1117,6 +1118,7 @@ ConstantFolding::opnd(Instruction *i, ImmediateValue &imm0, int s)
       if (!i->postFactor && (imm0.isInteger(1) || imm0.isInteger(-1))) {
          if (imm0.isNegative())
             i->src(t).mod = i->src(t).mod ^ Modifier(NV50_IR_MOD_NEG);
+         i->dnz = 0;
          i->op = i->src(t).mod.getOp();
          if (s == 0) {
             i->setSrc(0, i->getSrc(1));
@@ -1157,6 +1159,7 @@ ConstantFolding::opnd(Instruction *i, ImmediateValue &imm0, int s)
          i->src(0).mod = i->src(2).mod;
          i->setSrc(1, NULL);
          i->setSrc(2, NULL);
+         i->dnz = 0;
          i->op = i->src(0).mod.getOp();
          if (i->op != OP_CVT)
             i->src(0).mod = 0;



More information about the mesa-commit mailing list