mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-08-09 11:25:55 +00:00
lower the ARM::CONSTPOOL_ENTRY pseudo op, giving us constant pool entries
like: @ BB#1: .align 2 LCPI1_0: .long L_.str-(LPC0+8) Note that proper indentation of the label :) git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84558 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -1029,16 +1029,16 @@ bool ARMAsmPrinter::PrintAsmMemoryOperand(const MachineInstr *MI,
|
|||||||
void ARMAsmPrinter::printMachineInstruction(const MachineInstr *MI) {
|
void ARMAsmPrinter::printMachineInstruction(const MachineInstr *MI) {
|
||||||
++EmittedInsts;
|
++EmittedInsts;
|
||||||
|
|
||||||
int Opc = MI->getOpcode();
|
|
||||||
if (Opc == ARM::CONSTPOOL_ENTRY)
|
|
||||||
EmitAlignment(2);
|
|
||||||
|
|
||||||
// Call the autogenerated instruction printer routines.
|
// Call the autogenerated instruction printer routines.
|
||||||
processDebugLoc(MI, true);
|
processDebugLoc(MI, true);
|
||||||
|
|
||||||
if (EnableMCInst) {
|
if (EnableMCInst) {
|
||||||
printInstructionThroughMCStreamer(MI);
|
printInstructionThroughMCStreamer(MI);
|
||||||
} else {
|
} else {
|
||||||
|
int Opc = MI->getOpcode();
|
||||||
|
if (Opc == ARM::CONSTPOOL_ENTRY)
|
||||||
|
EmitAlignment(2);
|
||||||
|
|
||||||
printInstruction(MI);
|
printInstruction(MI);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1337,7 +1337,7 @@ void ARMAsmPrinter::printInstructionThroughMCStreamer(const MachineInstr *MI) {
|
|||||||
// Emit the label.
|
// Emit the label.
|
||||||
// FIXME: MOVE TO SHARED PLACE.
|
// FIXME: MOVE TO SHARED PLACE.
|
||||||
SmallString<60> Name;
|
SmallString<60> Name;
|
||||||
int Id = (int)MI->getOperand(2).getImm();
|
unsigned Id = (unsigned)MI->getOperand(2).getImm();
|
||||||
raw_svector_ostream(Name) << MAI->getPrivateGlobalPrefix() << "PC" << Id;
|
raw_svector_ostream(Name) << MAI->getPrivateGlobalPrefix() << "PC" << Id;
|
||||||
OutStreamer.EmitLabel(OutContext.GetOrCreateSymbol(Name.str()));
|
OutStreamer.EmitLabel(OutContext.GetOrCreateSymbol(Name.str()));
|
||||||
|
|
||||||
@@ -1351,6 +1351,27 @@ void ARMAsmPrinter::printInstructionThroughMCStreamer(const MachineInstr *MI) {
|
|||||||
printMCInst(&AddInst);
|
printMCInst(&AddInst);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
case ARM::CONSTPOOL_ENTRY: { // FIXME: Remove asm string from td file.
|
||||||
|
/// CONSTPOOL_ENTRY - This instruction represents a floating constant pool
|
||||||
|
/// in the function. The first operand is the ID# for this instruction, the
|
||||||
|
/// second is the index into the MachineConstantPool that this is, the third
|
||||||
|
/// is the size in bytes of this constant pool entry.
|
||||||
|
unsigned LabelId = (unsigned)MI->getOperand(0).getImm();
|
||||||
|
unsigned CPIdx = (unsigned)MI->getOperand(1).getIndex();
|
||||||
|
|
||||||
|
EmitAlignment(2);
|
||||||
|
|
||||||
|
O << MAI->getPrivateGlobalPrefix() << "CPI" << getFunctionNumber()
|
||||||
|
<< '_' << LabelId << ":\n";
|
||||||
|
|
||||||
|
const MachineConstantPoolEntry &MCPE = MCP->getConstants()[CPIdx];
|
||||||
|
if (MCPE.isMachineConstantPoolEntry())
|
||||||
|
EmitMachineConstantPoolValue(MCPE.Val.MachineCPVal);
|
||||||
|
else
|
||||||
|
EmitGlobalConstant(MCPE.Val.ConstVal);
|
||||||
|
|
||||||
|
return;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
MCInst TmpInst;
|
MCInst TmpInst;
|
||||||
|
@@ -159,6 +159,11 @@ void ARMInstPrinter::printRegisterList(const MCInst *MI, unsigned OpNum) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void ARMInstPrinter::printCPInstOperand(const MCInst *MI, unsigned OpNum,
|
||||||
|
const char *Modifier) {
|
||||||
|
// FIXME: remove this.
|
||||||
|
abort();
|
||||||
|
}
|
||||||
|
|
||||||
void ARMInstPrinter::printPCLabel(const MCInst *MI, unsigned OpNum) {
|
void ARMInstPrinter::printPCLabel(const MCInst *MI, unsigned OpNum) {
|
||||||
// FIXME: remove this.
|
// FIXME: remove this.
|
||||||
|
@@ -73,7 +73,7 @@ public:
|
|||||||
void printSBitModifierOperand(const MCInst *MI, unsigned OpNum) {}
|
void printSBitModifierOperand(const MCInst *MI, unsigned OpNum) {}
|
||||||
void printRegisterList(const MCInst *MI, unsigned OpNum);
|
void printRegisterList(const MCInst *MI, unsigned OpNum);
|
||||||
void printCPInstOperand(const MCInst *MI, unsigned OpNum,
|
void printCPInstOperand(const MCInst *MI, unsigned OpNum,
|
||||||
const char *Modifier) {}
|
const char *Modifier);
|
||||||
void printJTBlockOperand(const MCInst *MI, unsigned OpNum) {}
|
void printJTBlockOperand(const MCInst *MI, unsigned OpNum) {}
|
||||||
void printJT2BlockOperand(const MCInst *MI, unsigned OpNum) {}
|
void printJT2BlockOperand(const MCInst *MI, unsigned OpNum) {}
|
||||||
void printTBAddrMode(const MCInst *MI, unsigned OpNum) {}
|
void printTBAddrMode(const MCInst *MI, unsigned OpNum) {}
|
||||||
|
Reference in New Issue
Block a user