From: Christian König Date: Tue, 31 Jul 2012 16:30:45 +0000 (+0200) Subject: radeon/llvm: fix calculation of max register number X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=6574fe3c4a9e36791cde88dfd73429ba4faf3215;p=mesa.git radeon/llvm: fix calculation of max register number Signed-off-by: Christian König Reviewed-by: Tom Stellard --- diff --git a/src/gallium/drivers/radeon/SICodeEmitter.cpp b/src/gallium/drivers/radeon/SICodeEmitter.cpp index a7647aa3ec4..9fc4aab136e 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 {