mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-01-21 03:32:21 +00:00
Calls do not need a MovPCtoLR instruction
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@18197 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
b9f26da5dd
commit
b765ff1219
@ -190,19 +190,22 @@ int PPC32CodeEmitter::getMachineOpValue(MachineInstr &MI, MachineOperand &MO) {
|
||||
rv = MO.getImmedValue();
|
||||
} else if (MO.isGlobalAddress()) {
|
||||
unsigned Reloc = 0;
|
||||
int Offset = 0;
|
||||
if (MI.getOpcode() == PPC::CALLpcrel)
|
||||
Reloc = PPC::reloc_pcrel_bx;
|
||||
else if (MI.getOpcode() == PPC::LOADHiAddr) {
|
||||
assert(MovePCtoLROffset && "MovePCtoLR not seen yet?");
|
||||
Reloc = PPC::reloc_absolute_loadhi;
|
||||
Offset = -((intptr_t)MovePCtoLROffset+4);
|
||||
} else if (MI.getOpcode() == PPC::LA) {
|
||||
assert(MovePCtoLROffset && "MovePCtoLR not seen yet?");
|
||||
Reloc = PPC::reloc_absolute_la;
|
||||
Offset = -((intptr_t)MovePCtoLROffset+4);
|
||||
} else {
|
||||
assert(0 && "Unknown instruction for relocation!");
|
||||
}
|
||||
assert(MovePCtoLROffset && "MovePCtoLR not seen yet?");
|
||||
MCE.addRelocation(MachineRelocation(MCE.getCurrentPCOffset(),
|
||||
Reloc, MO.getGlobal(),
|
||||
-((intptr_t)MovePCtoLROffset+4)));
|
||||
Reloc, MO.getGlobal(), Offset));
|
||||
} else if (MO.isMachineBasicBlock()) {
|
||||
const BasicBlock *BB = MO.getMachineBasicBlock()->getBasicBlock();
|
||||
unsigned* CurrPC = (unsigned*)(intptr_t)MCE.getCurrentPCValue();
|
||||
|
Loading…
x
Reference in New Issue
Block a user