nv50/ir: fix hard-coded TYPE_U32 sized register
authorIlia Mirkin <imirkin@alum.mit.edu>
Thu, 17 Jul 2014 03:20:57 +0000 (23:20 -0400)
committerIlia Mirkin <imirkin@alum.mit.edu>
Thu, 24 Jul 2014 12:26:41 +0000 (08:26 -0400)
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
src/gallium/drivers/nouveau/codegen/nv50_ir_ra.cpp

index 6c83a60823404b729ecf4034d33f092ecdf10131..242af4e073c99414c588733649cdd5c9d8956ba8 100644 (file)
@@ -389,11 +389,12 @@ RegAlloc::PhiMovesPass::visit(BasicBlock *bb)
          pb->insertTail(new_FlowInstruction(func, OP_BRA, bb));
 
       for (phi = bb->getPhi(); phi && phi->op == OP_PHI; phi = phi->next) {
-         mov = new_Instruction(func, OP_MOV, TYPE_U32);
+         LValue *tmp = new_LValue(func, phi->getDef(0)->asLValue());
+         mov = new_Instruction(func, OP_MOV, typeOfSize(tmp->reg.size));
 
          mov->setSrc(0, phi->getSrc(j));
-         mov->setDef(0, new_LValue(func, phi->getDef(0)->asLValue()));
-         phi->setSrc(j, mov->getDef(0));
+         mov->setDef(0, tmp);
+         phi->setSrc(j, tmp);
 
          pb->insertBefore(pb->getExit(), mov);
       }