mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-11-24 03:33:20 +01:00
Calls do not need a MovPCtoLR instruction
llvm-svn: 18197
This commit is contained in:
parent
9e59b1f3b5
commit
ef7794a7c6
@ -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…
Reference in New Issue
Block a user