nvc0/ir: GP emit address must end up in $r0
authorChristoph Bumiller <e0425955@student.tuwien.ac.at>
Mon, 17 Oct 2011 21:00:59 +0000 (23:00 +0200)
committerChristoph Bumiller <e0425955@student.tuwien.ac.at>
Fri, 21 Oct 2011 21:00:38 +0000 (23:00 +0200)
src/gallium/drivers/nvc0/codegen/nv50_ir_lowering_nvc0.cpp

index 94cc511111953e65ed16490bf67d1e7f92124fdf..4b448c6900f06c895da76d314374101dcae77c31 100644 (file)
@@ -289,6 +289,10 @@ NVC0LoweringPass::visit(Function *fn)
       // TODO: when we generate actual functions pass this value along somehow
       bld.setPosition(BasicBlock::get(fn->cfg.getRoot()), false);
       gpEmitAddress = bld.loadImm(NULL, 0)->asLValue();
+      if (fn->cfgExit) {
+         bld.setPosition(BasicBlock::get(fn->cfgExit)->getExit(), false);
+         bld.mkMovToReg(0, gpEmitAddress);
+      }
    }
    return true;
 }