diff options
author | Chris Lattner <sabre@nondot.org> | 2006-07-12 21:23:20 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2006-07-12 21:23:20 +0000 |
commit | 3bc8a765a98015e6d55510b6ea6e387cbfd793cd (patch) | |
tree | e7f981a50833b090d85759c868eb85ffcde8eb14 /lib/Target/PowerPC/PPCJITInfo.cpp | |
parent | 3d6721a4a1cf9e9a27d05b268f86b7a9ce663d6f (diff) |
Implement PPC64 relocations types
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@29125 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Target/PowerPC/PPCJITInfo.cpp')
-rw-r--r-- | lib/Target/PowerPC/PPCJITInfo.cpp | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/lib/Target/PowerPC/PPCJITInfo.cpp b/lib/Target/PowerPC/PPCJITInfo.cpp index 98bc4e1fb9..1d4760affa 100644 --- a/lib/Target/PowerPC/PPCJITInfo.cpp +++ b/lib/Target/PowerPC/PPCJITInfo.cpp @@ -207,7 +207,7 @@ void PPCJITInfo::relocate(void *Function, MachineRelocation *MR, case PPC::reloc_absolute_ptr_high: // Pointer relocations. case PPC::reloc_absolute_ptr_low: case PPC::reloc_absolute_high: // high bits of ref -> low 16 of instr - case PPC::reloc_absolute_low: // low bits of ref -> low 16 of instr + case PPC::reloc_absolute_low: { // low bits of ref -> low 16 of instr ResultPtr += MR->getConstantVal(); // If this is a high-part access, get the high-part. @@ -227,6 +227,16 @@ void PPCJITInfo::relocate(void *Function, MachineRelocation *MR, *RelocPos = LowBits | HighBits; // Slam into low 16-bits break; } + case PPC::reloc_absolute_low_ix: { // low bits of ref -> low 14 of instr + ResultPtr += MR->getConstantVal(); + // Do the addition then mask, so the addition does not overflow the 16-bit + // immediate section of the instruction. + unsigned LowBits = (*RelocPos + ResultPtr) & 0xFFFC; + unsigned HighBits = *RelocPos & 0xFFFF0003; + *RelocPos = LowBits | HighBits; // Slam into low 14-bits. + break; + } + } } } |