[Mesa-dev] [PATCH] nv50/ir: fix TargetNVC0::insnCanLoadOffset()

Rhys Perry pendingchaos02 at gmail.com
Mon Jun 11 10:17:55 UTC 2018


Previously, TargetNVC0::insnCanLoadOffset() returned whether the offset
could be set to a specific value. The IndirectPropagation pass expected
it to return whether the offset could be increased.

Signed-off-by: Rhys Perry <pendingchaos02 at gmail.com>
---
 src/gallium/drivers/nouveau/codegen/nv50_ir_target_nvc0.cpp | 1 +
 1 file changed, 1 insertion(+)

diff --git a/src/gallium/drivers/nouveau/codegen/nv50_ir_target_nvc0.cpp b/src/gallium/drivers/nouveau/codegen/nv50_ir_target_nvc0.cpp
index 954aec0a2f..8938d19f6c 100644
--- a/src/gallium/drivers/nouveau/codegen/nv50_ir_target_nvc0.cpp
+++ b/src/gallium/drivers/nouveau/codegen/nv50_ir_target_nvc0.cpp
@@ -415,6 +415,7 @@ bool
 TargetNVC0::insnCanLoadOffset(const Instruction *insn, int s, int offset) const
 {
    const ValueRef& ref = insn->src(s);
+   offset += insn->src(s).get()->reg.data.offset;
    if (ref.getFile() == FILE_MEMORY_CONST &&
        (insn->op != OP_LOAD || insn->subOp != NV50_IR_SUBOP_LDC_IS))
       return offset >= -0x8000 && offset < 0x8000;
-- 
2.14.4



More information about the mesa-dev mailing list