radeon/llvm: fix calculation of max register number
authorChristian König <deathsimple@vodafone.de>
Tue, 31 Jul 2012 16:30:45 +0000 (18:30 +0200)
committerChristian König <deathsimple@vodafone.de>
Wed, 1 Aug 2012 09:15:06 +0000 (11:15 +0200)
Signed-off-by: Christian König <deathsimple@vodafone.de>
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
src/gallium/drivers/radeon/SICodeEmitter.cpp

index a7647aa3ec41ad860008fcd2e405602bc69cc43b..9fc4aab136e0fb813b4bb51997f532321d6ee5dd 100644 (file)
@@ -154,7 +154,7 @@ void SICodeEmitter::InitProgramInfo(MachineFunction &MF) {
           assert("!Unknown register class");
         }
         hwReg = RI->getHWRegNum(reg);
-        maxUsed = ((hwReg + 1) * width) - 1;
+        maxUsed = hwReg + width - 1;
         if (isSGPR) {
           MaxSGPR = maxUsed > MaxSGPR ? maxUsed : MaxSGPR;
         } else {