/// method to print assembly for each instruction.
///
bool X86IntelAsmPrinter::runOnMachineFunction(MachineFunction &MF) {
- setupMachineFunction(MF);
+ SetupMachineFunction(MF);
O << "\n\n";
// Print out constants referenced by the function
- printConstantPool(MF.getConstantPool());
+ EmitConstantPool(MF.getConstantPool());
// Print out labels for the function.
- O << "\t.text\n";
- emitAlignment(4);
+ SwitchSection("\t.text\n", MF.getFunction());
+ EmitAlignment(4);
O << "\t.globl\t" << CurrentFnName << "\n";
- if (!forCygwin && !forDarwin)
+ if (HasDotTypeDotSizeDirective)
O << "\t.type\t" << CurrentFnName << ", @function\n";
O << CurrentFnName << ":\n";
I != E; ++I) {
// Print a label for the basic block if there are any predecessors.
if (I->pred_begin() != I->pred_end())
- O << ".LBB" << CurrentFnName << "_" << I->getNumber() << ":\t"
+ O << PrivateGlobalPrefix << "BB" << CurrentFnName << "_" << I->getNumber()
+ << ":\t"
<< CommentString << " " << I->getBasicBlock()->getName() << "\n";
for (MachineBasicBlock::const_iterator II = I->begin(), E = I->end();
II != E; ++II) {
return false;
}
+void X86IntelAsmPrinter::printSSECC(const MachineInstr *MI, unsigned Op) {
+ unsigned char value = MI->getOperand(Op).getImmedValue();
+ assert(value <= 7 && "Invalid ssecc argument!");
+ switch (value) {
+ case 0: O << "eq"; break;
+ case 1: O << "lt"; break;
+ case 2: O << "le"; break;
+ case 3: O << "unord"; break;
+ case 4: O << "neq"; break;
+ case 5: O << "nlt"; break;
+ case 6: O << "nle"; break;
+ case 7: O << "ord"; break;
+ }
+}
+
void X86IntelAsmPrinter::printOp(const MachineOperand &MO,
bool elideOffsetKeyword /* = false */) {
const MRegisterInfo &RI = *TM.getRegisterInfo();
return;
case MachineOperand::MO_MachineBasicBlock: {
MachineBasicBlock *MBBOp = MO.getMachineBasicBlock();
- O << ".LBB" << Mang->getValueName(MBBOp->getParent()->getFunction())
+ O << PrivateGlobalPrefix << "BB"
+ << Mang->getValueName(MBBOp->getParent()->getFunction())
<< "_" << MBBOp->getNumber () << "\t# "
<< MBBOp->getBasicBlock ()->getName ();
return;
}
case MachineOperand::MO_PCRelativeDisp:
- std::cerr << "Shouldn't use addPCDisp() when building X86 MachineInstrs";
+ assert(0 && "Shouldn't use addPCDisp() when building X86 MachineInstrs");
abort ();
return;
case MachineOperand::MO_GlobalAddress: {
if (Offset > 0)
O << " + " << Offset;
else if (Offset < 0)
- O << " - " << -Offset;
+ O << Offset;
return;
}
case MachineOperand::MO_ExternalSymbol:
O << "]";
return;
} else if (BaseReg.isConstantPoolIndex()) {
- O << "[.CPI" << CurrentFnName << "_"
+ O << "[" << PrivateGlobalPrefix << "CPI" << getFunctionNumber() << "_"
<< BaseReg.getConstantPoolIndex();
if (IndexReg.getReg()) {