mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-12-17 18:31:04 +00:00
with the picbase nonsense starting to be figured out, implement
lowering support for MovePCtoLR[8]. Down to 4 failures again. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@119090 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
142b531e02
commit
749ba48fab
@ -558,6 +558,28 @@ void PPCAsmPrinter::EmitInstruction(const MachineInstr *MI) {
|
|||||||
// Lower multi-instruction pseudo operations.
|
// Lower multi-instruction pseudo operations.
|
||||||
switch (MI->getOpcode()) {
|
switch (MI->getOpcode()) {
|
||||||
default: break;
|
default: break;
|
||||||
|
case PPC::MovePCtoLR:
|
||||||
|
case PPC::MovePCtoLR8: {
|
||||||
|
// Transform %LR = MovePCtoLR
|
||||||
|
// Into this, where the label is the PIC base:
|
||||||
|
// bl L1$pb
|
||||||
|
// L1$pb:
|
||||||
|
MCSymbol *PICBase = MF->getPICBaseSymbol();
|
||||||
|
|
||||||
|
// Emit the 'bl'.
|
||||||
|
TmpInst.setOpcode(PPC::BL_Darwin); // Darwin vs SVR4 doesn't matter here.
|
||||||
|
|
||||||
|
|
||||||
|
// FIXME: We would like an efficient form for this, so we don't have to do
|
||||||
|
// a lot of extra uniquing.
|
||||||
|
TmpInst.addOperand(MCOperand::CreateExpr(MCSymbolRefExpr::
|
||||||
|
Create(PICBase, OutContext)));
|
||||||
|
OutStreamer.EmitInstruction(TmpInst);
|
||||||
|
|
||||||
|
// Emit the label.
|
||||||
|
OutStreamer.EmitLabel(PICBase);
|
||||||
|
return;
|
||||||
|
}
|
||||||
case PPC::LDtoc: {
|
case PPC::LDtoc: {
|
||||||
// Transform %X3 = LDtoc <ga:@min1>, %X2
|
// Transform %X3 = LDtoc <ga:@min1>, %X2
|
||||||
LowerPPCMachineInstrToMCInst(MI, TmpInst, *this);
|
LowerPPCMachineInstrToMCInst(MI, TmpInst, *this);
|
||||||
|
Loading…
Reference in New Issue
Block a user