[llvm-commits] [llvm] r145888 - /llvm/trunk/lib/Target/X86/X86FrameLowering.cpp
Bill Wendling
isanbard at gmail.com
Mon Dec 5 17:26:14 PST 2011
Author: void
Date: Mon Dec 5 19:26:14 2011
New Revision: 145888
URL: http://llvm.org/viewvc/llvm-project?rev=145888&view=rev
Log:
The compact encoding of the registers are 3-bits each. Make sure we shift the
value over that much.
Modified:
llvm/trunk/lib/Target/X86/X86FrameLowering.cpp
Modified: llvm/trunk/lib/Target/X86/X86FrameLowering.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86FrameLowering.cpp?rev=145888&r1=145887&r2=145888&view=diff
==============================================================================
--- llvm/trunk/lib/Target/X86/X86FrameLowering.cpp (original)
+++ llvm/trunk/lib/Target/X86/X86FrameLowering.cpp Mon Dec 5 19:26:14 2011
@@ -385,12 +385,14 @@
};
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 @@
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!");
More information about the llvm-commits
mailing list