From 21f9b1cbe7ce5147272f2a57553a0f3a4a4c1a21 Mon Sep 17 00:00:00 2001 From: Ilia Mirkin Date: Mon, 12 Apr 2021 18:15:04 -0400 Subject: [PATCH] nv50/ir: refine limitation on load/store loading offsets, include atomics Note that shared memory loads can actually do offsets. The restrictions vary by generation, this will be added in a later change. Signed-off-by: Ilia Mirkin Reviewed-by: Karol Herbst Reviewed-by: Pierre Moreau Part-of: --- src/gallium/drivers/nouveau/codegen/nv50_ir_target_nv50.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) 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 9008196..14071f2 100644 --- a/src/gallium/drivers/nouveau/codegen/nv50_ir_target_nv50.cpp +++ b/src/gallium/drivers/nouveau/codegen/nv50_ir_target_nv50.cpp @@ -402,11 +402,12 @@ TargetNV50::insnCanLoadOffset(const Instruction *i, int s, int offset) const if (!i->src(s).isIndirect(0)) return true; offset += i->src(s).get()->reg.data.offset; - if (i->op == OP_LOAD || i->op == OP_STORE) { + if (i->op == OP_LOAD || i->op == OP_STORE || i->op == OP_ATOM) { // There are some restrictions in theory, but in practice they're never - // going to be hit. When we enable shared/global memory, this will - // become more important. - return true; + // going to be hit. However offsets on global/shared memory are just + // plain not supported. + return i->src(s).getFile() != FILE_MEMORY_GLOBAL && + i->src(s).getFile() != FILE_MEMORY_SHARED; } return offset >= 0 && offset <= (int32_t)(127 * i->src(s).get()->reg.size); } -- 2.7.4