diff options
author | Bill Wendling <isanbard@gmail.com> | 2011-07-26 08:03:49 +0000 |
---|---|---|
committer | Bill Wendling <isanbard@gmail.com> | 2011-07-26 08:03:49 +0000 |
commit | ee619467831cb66ee5c43fcd194bd9b9ad8f9396 (patch) | |
tree | 0f3c8c0ebd0d8580cb9805dd54bde659388dc2f9 | |
parent | dd7805a24de0c4ba1b96e82b9bb99769f24a0a02 (diff) | |
download | bcm5719-llvm-ee619467831cb66ee5c43fcd194bd9b9ad8f9396.tar.gz bcm5719-llvm-ee619467831cb66ee5c43fcd194bd9b9ad8f9396.zip |
The compact unwinding offsets are divided by 8 on 64-bit machines.
llvm-svn: 136065
-rw-r--r-- | llvm/lib/Target/X86/X86FrameLowering.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/llvm/lib/Target/X86/X86FrameLowering.cpp b/llvm/lib/Target/X86/X86FrameLowering.cpp index cdc83054aa0..d5e9aa6d642 100644 --- a/llvm/lib/Target/X86/X86FrameLowering.cpp +++ b/llvm/lib/Target/X86/X86FrameLowering.cpp @@ -490,6 +490,8 @@ uint32_t X86FrameLowering::getCompactUnwindEncoding(MachineFunction &MF) const { unsigned SubtractInstr = getSUBriOpcode(Is64Bit, -TailCallReturnAddrDelta); unsigned SubtractInstrIdx = (Is64Bit ? 3 : 2); + unsigned StackDivide = (Is64Bit ? 8 : 4); + unsigned InstrOffset = 0; unsigned CFAOffset = 0; unsigned StackAdjust = 0; @@ -536,7 +538,7 @@ uint32_t X86FrameLowering::getCompactUnwindEncoding(MachineFunction &MF) const { // %RSP<def> = SUB64ri8 %RSP, 48 return 0; - StackAdjust = MI.getOperand(2).getImm() / 4; + StackAdjust = MI.getOperand(2).getImm() / StackDivide; SubtractInstrIdx += InstrOffset; ExpectEnd = true; } @@ -544,7 +546,7 @@ uint32_t X86FrameLowering::getCompactUnwindEncoding(MachineFunction &MF) const { // Encode that we are using EBP/RBP as the frame pointer. uint32_t CompactUnwindEncoding = 0; - CFAOffset /= 4; + CFAOffset /= StackDivide; if (HasFP) { if ((CFAOffset & 0xFF) != CFAOffset) // Offset was too big for compact encoding. |