From 348db055dd06ca3c8ce8f6c71c051e222c31be8d Mon Sep 17 00:00:00 2001 From: Ilia Mirkin Date: Wed, 24 Feb 2021 22:17:40 -0500 Subject: [PATCH] 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 Reviewed-by: Karol Herbst Acked-by: Pierre Moreau Part-of: --- 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;