Mesa (master): nv50/ir: "zero" register does not work with g[] memory

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Sat May 1 20:13:55 UTC 2021


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

Author: Ilia Mirkin <imirkin at alum.mit.edu>
Date:   Wed Feb 24 22:17:40 2021 -0500

nv50/ir: "zero" register does not work with g[] memory

Evidence suggests that having it anywhere, even as a regular e.g. atom
argument, causes issues.

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

---

 src/gallium/drivers/nouveau/codegen/nv50_ir_target_nv50.cpp | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/src/gallium/drivers/nouveau/codegen/nv50_ir_target_nv50.cpp b/src/gallium/drivers/nouveau/codegen/nv50_ir_target_nv50.cpp
index 14071f26676..bd04dad5afb 100644
--- a/src/gallium/drivers/nouveau/codegen/nv50_ir_target_nv50.cpp
+++ b/src/gallium/drivers/nouveau/codegen/nv50_ir_target_nv50.cpp
@@ -278,10 +278,14 @@ TargetNV50::insnCanLoad(const Instruction *i, int s,
    DataFile sf = ld->src(0).getFile();
 
    // immediate 0 can be represented by GPR $r63/$r127
+   // this does not work with global memory ld/st/atom
    if (sf == FILE_IMMEDIATE && ld->getSrc(0)->reg.data.u64 == 0)
       return (!i->isPseudo() &&
               !i->asTex() &&
-              i->op != OP_EXPORT && i->op != OP_STORE);
+              i->op != OP_EXPORT &&
+              i->op != OP_STORE &&
+              ((i->op != OP_ATOM && i->op != OP_LOAD) ||
+               i->src(0).getFile() != FILE_MEMORY_GLOBAL));
 
    if (sf == FILE_IMMEDIATE && (i->predSrc >= 0 || i->flagsDef >= 0))
       return false;



More information about the mesa-commit mailing list