[Mesa-dev] [PATCH] radeon/llvm: fix calculation of max register number

Christian König deathsimple at vodafone.de
Tue Jul 31 09:40:11 PDT 2012


Signed-off-by: Christian König <deathsimple at vodafone.de>
---
 src/gallium/drivers/radeon/SICodeEmitter.cpp |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/gallium/drivers/radeon/SICodeEmitter.cpp b/src/gallium/drivers/radeon/SICodeEmitter.cpp
index a7647aa..9fc4aab 100644
--- a/src/gallium/drivers/radeon/SICodeEmitter.cpp
+++ b/src/gallium/drivers/radeon/SICodeEmitter.cpp
@@ -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 {
-- 
1.7.9.5



More information about the mesa-dev mailing list