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);
}
// 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()));
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;
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) {}