summaryrefslogtreecommitdiffstats
path: root/llvm/lib
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2009-10-19 22:33:05 +0000
committerChris Lattner <sabre@nondot.org>2009-10-19 22:33:05 +0000
commit186c6b08349fe859b616958fe359cd7b43337f81 (patch)
treecd8bb227dae20f8efab1af06f6636df6bccaaec4 /llvm/lib
parente28968828b1c35719bd87c459a74ec6ba98d4e07 (diff)
downloadbcm5719-llvm-186c6b08349fe859b616958fe359cd7b43337f81.tar.gz
bcm5719-llvm-186c6b08349fe859b616958fe359cd7b43337f81.zip
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 :) llvm-svn: 84558
Diffstat (limited to 'llvm/lib')
-rw-r--r--llvm/lib/Target/ARM/AsmPrinter/ARMAsmPrinter.cpp31
-rw-r--r--llvm/lib/Target/ARM/AsmPrinter/ARMInstPrinter.cpp5
-rw-r--r--llvm/lib/Target/ARM/AsmPrinter/ARMInstPrinter.h2
3 files changed, 32 insertions, 6 deletions
diff --git a/llvm/lib/Target/ARM/AsmPrinter/ARMAsmPrinter.cpp b/llvm/lib/Target/ARM/AsmPrinter/ARMAsmPrinter.cpp
index 139477221a4..7e89b9f5e92 100644
--- a/llvm/lib/Target/ARM/AsmPrinter/ARMAsmPrinter.cpp
+++ b/llvm/lib/Target/ARM/AsmPrinter/ARMAsmPrinter.cpp
@@ -1029,16 +1029,16 @@ bool ARMAsmPrinter::PrintAsmMemoryOperand(const MachineInstr *MI,
void ARMAsmPrinter::printMachineInstruction(const MachineInstr *MI) {
++EmittedInsts;
- int Opc = MI->getOpcode();
- if (Opc == ARM::CONSTPOOL_ENTRY)
- EmitAlignment(2);
-
// Call the autogenerated instruction printer routines.
processDebugLoc(MI, true);
if (EnableMCInst) {
printInstructionThroughMCStreamer(MI);
} else {
+ int Opc = MI->getOpcode();
+ if (Opc == ARM::CONSTPOOL_ENTRY)
+ EmitAlignment(2);
+
printInstruction(MI);
}
@@ -1337,7 +1337,7 @@ void ARMAsmPrinter::printInstructionThroughMCStreamer(const MachineInstr *MI) {
// Emit the label.
// FIXME: MOVE TO SHARED PLACE.
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;
OutStreamer.EmitLabel(OutContext.GetOrCreateSymbol(Name.str()));
@@ -1351,6 +1351,27 @@ void ARMAsmPrinter::printInstructionThroughMCStreamer(const MachineInstr *MI) {
printMCInst(&AddInst);
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;
diff --git a/llvm/lib/Target/ARM/AsmPrinter/ARMInstPrinter.cpp b/llvm/lib/Target/ARM/AsmPrinter/ARMInstPrinter.cpp
index 4d9c592e64b..3a500db8479 100644
--- a/llvm/lib/Target/ARM/AsmPrinter/ARMInstPrinter.cpp
+++ b/llvm/lib/Target/ARM/AsmPrinter/ARMInstPrinter.cpp
@@ -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) {
// FIXME: remove this.
diff --git a/llvm/lib/Target/ARM/AsmPrinter/ARMInstPrinter.h b/llvm/lib/Target/ARM/AsmPrinter/ARMInstPrinter.h
index d4f6033152c..41e59e9937c 100644
--- a/llvm/lib/Target/ARM/AsmPrinter/ARMInstPrinter.h
+++ b/llvm/lib/Target/ARM/AsmPrinter/ARMInstPrinter.h
@@ -73,7 +73,7 @@ public:
void printSBitModifierOperand(const MCInst *MI, unsigned OpNum) {}
void printRegisterList(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 printJT2BlockOperand(const MCInst *MI, unsigned OpNum) {}
void printTBAddrMode(const MCInst *MI, unsigned OpNum) {}
OpenPOWER on IntegriCloud