nvir/nvc0: fix legalizing of ld unlock c0[0x10000]
authorKarol Herbst <kherbst@redhat.com>
Mon, 19 Feb 2018 23:45:14 +0000 (00:45 +0100)
committerKarol Herbst <kherbst@redhat.com>
Wed, 21 Feb 2018 10:12:45 +0000 (11:12 +0100)
We have to increase the file index also for 0x10000 not just for values
greater than 0x10000.

Fixes: 37b67db6ae34fb6586d640a7a1b6232f091dd812
Signed-off-by: Karol Herbst <kherbst@redhat.com>
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
src/gallium/drivers/nouveau/codegen/nv50_ir_lowering_nvc0.cpp

index 5e9ffc0d46377ce1f32208101b73cd390320055e..29f674b451407d944a868a50688ff07886e38e3b 100644 (file)
@@ -745,7 +745,7 @@ NVC0LegalizePostRA::visit(BasicBlock *bb)
       } else
       if (i->op == OP_LOAD && i->subOp == NV50_IR_SUBOP_LDC_IS) {
          int offset = i->src(0).get()->reg.data.offset;
-         if (abs(offset) > 0x10000)
+         if (abs(offset) >= 0x10000)
             i->src(0).get()->reg.fileIndex += offset >> 16;
          i->src(0).get()->reg.data.offset = (int)(short)offset;
       } else {