[llvm-commits] [llvm] r145954 - /llvm/trunk/lib/Target/X86/X86FrameLowering.cpp
Bill Wendling
isanbard at gmail.com
Tue Dec 6 11:16:17 PST 2011
Author: void
Date: Tue Dec 6 13:16:17 2011
New Revision: 145954
URL: http://llvm.org/viewvc/llvm-project?rev=145954&view=rev
Log:
Check the correct value for small stack sizes. Also modify some comments.
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=145954&r1=145953&r2=145954&view=diff
==============================================================================
--- llvm/trunk/lib/Target/X86/X86FrameLowering.cpp (original)
+++ llvm/trunk/lib/Target/X86/X86FrameLowering.cpp Tue Dec 6 13:16:17 2011
@@ -554,17 +554,17 @@
// Get the encoding of the saved registers when we have a frame pointer.
uint32_t RegEnc = encodeCompactUnwindRegistersWithFrame(SavedRegs, Is64Bit);
- if (RegEnc == ~0U)
- return 0;
+ if (RegEnc == ~0U) return 0;
CompactUnwindEncoding |= 0x01000000;
CompactUnwindEncoding |= (CFAOffset & 0xFF) << 16;
CompactUnwindEncoding |= RegEnc & 0x7FFF;
} else {
- unsigned FullOffset = CFAOffset + StackAdjust;
- if ((FullOffset & 0xFF) == FullOffset) {
- // Frameless stack.
+ if ((CFAOffset & 0xFF) == CFAOffset) {
+ // Frameless stack with a small stack size.
CompactUnwindEncoding |= 0x02000000;
+
+ // Encode the stack size.
CompactUnwindEncoding |= (CFAOffset & 0xFF) << 16;
} else {
if ((CFAOffset & 0x7) != CFAOffset)
@@ -582,6 +582,7 @@
CompactUnwindEncoding |= (CFAOffset & 0x7) << 13;
}
+ // Encode the number of registers saved.
CompactUnwindEncoding |= ((6 - SavedRegIdx) & 0x7) << 10;
// Get the encoding of the saved registers when we don't have a frame
@@ -590,6 +591,8 @@
6 - SavedRegIdx,
Is64Bit);
if (RegEnc == ~0U) return 0;
+
+ // Encode the register encoding.
CompactUnwindEncoding |= RegEnc & 0x3FF;
}
More information about the llvm-commits
mailing list