[PATCH] R600/SI: Return the correct index for VGPRs in getHWRegIndex()

Tom Stellard thomas.stellard at amd.com
Fri Mar 28 21:34:28 PDT 2014


The register index is stored in the low 8-bits of the encoding.
---
 lib/Target/R600/SIRegisterInfo.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/Target/R600/SIRegisterInfo.cpp b/lib/Target/R600/SIRegisterInfo.cpp
index a784fa4..6cef195 100644
--- a/lib/Target/R600/SIRegisterInfo.cpp
+++ b/lib/Target/R600/SIRegisterInfo.cpp
@@ -56,7 +56,7 @@ const TargetRegisterClass * SIRegisterInfo::getCFGStructurizerRegClass(
 }
 
 unsigned SIRegisterInfo::getHWRegIndex(unsigned Reg) const {
-  return getEncodingValue(Reg);
+  return getEncodingValue(Reg) & 0xff;
 }
 
 const TargetRegisterClass *SIRegisterInfo::getPhysRegClass(unsigned Reg) const {
-- 
1.8.1.5





More information about the llvm-commits mailing list