mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-12-28 04:33:05 +00:00
Add support for GlobalAddress's for alkis
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11560 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
9b9b7fc28d
commit
cc0d2f586f
@ -602,7 +602,12 @@ void Emitter::emitInstruction(MachineInstr &MI) {
|
||||
|
||||
if (MI.getNumOperands() == 5) {
|
||||
unsigned Size = sizeOfPtr(Desc);
|
||||
emitConstant(MI.getOperand(4).getImmedValue(), Size);
|
||||
if (MI.getOperand(4).isImmediate())
|
||||
emitConstant(MI.getOperand(4).getImmedValue(), Size);
|
||||
else if (MI.getOperand(4).isGlobalAddress())
|
||||
emitGlobalAddressForPtr(MI.getOperand(4).getGlobal());
|
||||
else
|
||||
assert(0 && "Unknown operand!");
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
@ -100,8 +100,14 @@ static MachineInstr *MakeMRInst(unsigned Opcode, unsigned FrameIndex,
|
||||
|
||||
static MachineInstr *MakeMIInst(unsigned Opcode, unsigned FrameIndex,
|
||||
MachineInstr *MI) {
|
||||
return addFrameReference(BuildMI(Opcode, 5), FrameIndex)
|
||||
.addZImm(MI->getOperand(1).getImmedValue());
|
||||
if (MI->getOperand(1).isImmediate())
|
||||
return addFrameReference(BuildMI(Opcode, 5), FrameIndex)
|
||||
.addZImm(MI->getOperand(1).getImmedValue());
|
||||
else if (MI->getOperand(1).isGlobalAddress())
|
||||
return addFrameReference(BuildMI(Opcode, 5), FrameIndex)
|
||||
.addGlobalAddress(MI->getOperand(1).getGlobal());
|
||||
assert(0 && "Unknown operand for MakeMI!");
|
||||
return 0;
|
||||
}
|
||||
|
||||
static MachineInstr *MakeRMInst(unsigned Opcode, unsigned FrameIndex,
|
||||
|
Loading…
Reference in New Issue
Block a user