summaryrefslogtreecommitdiffstats
path: root/llvm/lib
diff options
context:
space:
mode:
authorBill Wendling <isanbard@gmail.com>2011-12-06 01:26:14 +0000
committerBill Wendling <isanbard@gmail.com>2011-12-06 01:26:14 +0000
commitf7cef7ecad1feed74546718ec9a682302056b331 (patch)
tree8835ebd1a56ca883fe1320b2f1034bc67ec2e3f3 /llvm/lib
parenta89c5ac4a66c12306460d04aa09573dfa94e779d (diff)
downloadbcm5719-llvm-f7cef7ecad1feed74546718ec9a682302056b331.tar.gz
bcm5719-llvm-f7cef7ecad1feed74546718ec9a682302056b331.zip
The compact encoding of the registers are 3-bits each. Make sure we shift the
value over that much. llvm-svn: 145888
Diffstat (limited to 'llvm/lib')
-rw-r--r--llvm/lib/Target/X86/X86FrameLowering.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/llvm/lib/Target/X86/X86FrameLowering.cpp b/llvm/lib/Target/X86/X86FrameLowering.cpp
index 27b762af69f..038ca7f34d0 100644
--- a/llvm/lib/Target/X86/X86FrameLowering.cpp
+++ b/llvm/lib/Target/X86/X86FrameLowering.cpp
@@ -385,12 +385,14 @@ static uint32_t encodeCompactUnwindRegistersWithoutFrame(unsigned SavedRegs[6],
};
const unsigned *CURegs = (Is64Bit ? CU64BitRegs : CU32BitRegs);
- uint32_t RenumRegs[6];
for (unsigned i = 6 - RegCount; i < 6; ++i) {
int CUReg = getCompactUnwindRegNum(CURegs, SavedRegs[i]);
if (CUReg == -1) return ~0U;
SavedRegs[i] = CUReg;
+ }
+ uint32_t RenumRegs[6];
+ for (unsigned i = 6 - RegCount; i < 6; ++i) {
unsigned Countless = 0;
for (unsigned j = 6 - RegCount; j < i; ++j)
if (SavedRegs[j] < SavedRegs[i])
@@ -454,7 +456,7 @@ static uint32_t encodeCompactUnwindRegistersWithFrame(unsigned SavedRegs[6],
int CURegNum = getCompactUnwindRegNum(CURegs, Reg);
if (CURegNum == -1)
return ~0U;
- RegEnc |= (CURegNum & 0x7) << (5 - I);
+ RegEnc |= (CURegNum & 0x7) << ((5 - I) * 3);
}
assert((RegEnc & 0x7FFF) == RegEnc && "Invalid compact register encoding!");
OpenPOWER on IntegriCloud