diff options
author | Nate Begeman <natebegeman@mac.com> | 2004-09-02 08:13:00 +0000 |
---|---|---|
committer | Nate Begeman <natebegeman@mac.com> | 2004-09-02 08:13:00 +0000 |
commit | b7a8f2cdaa3db15861c7f06238fcacc4b10b74f3 (patch) | |
tree | 08b3fc874c12588fbe61f2a15b759dee09ebb423 /lib/Target/PowerPC/PPC32AsmPrinter.cpp | |
parent | df8d5e908fe83dafe98a05086956e7b0943af1e0 (diff) |
Convert remaining X-Form and Pseudo instructions over to asm writer
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@16142 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Target/PowerPC/PPC32AsmPrinter.cpp')
-rw-r--r-- | lib/Target/PowerPC/PPC32AsmPrinter.cpp | 46 |
1 files changed, 10 insertions, 36 deletions
diff --git a/lib/Target/PowerPC/PPC32AsmPrinter.cpp b/lib/Target/PowerPC/PPC32AsmPrinter.cpp index b30977b1a1..cadc88a0b9 100644 --- a/lib/Target/PowerPC/PPC32AsmPrinter.cpp +++ b/lib/Target/PowerPC/PPC32AsmPrinter.cpp @@ -102,6 +102,16 @@ namespace { MVT::ValueType VT) { O << (unsigned short)MI->getOperand(OpNo).getImmedValue(); } + void printBranchOperand(const MachineInstr *MI, unsigned OpNo, + MVT::ValueType VT) { + printOp(MI->getOperand(OpNo)); + } + void printPICLabel(const MachineInstr *MI, unsigned OpNo, + MVT::ValueType VT) { + // FIXME: should probably be converted to cout.width and cout.fill + O << "\"L0000" << LabelNumber << "$pb\"\n"; + O << "\"L0000" << LabelNumber << "$pb\":"; + } void printConstantPool(MachineConstantPool *MCP); bool runOnMachineFunction(MachineFunction &F); @@ -293,42 +303,6 @@ void PPC32AsmPrinter::printMachineInstruction(const MachineInstr *MI) { assert(((Desc.TSFlags & PPCII::PPC64) == 0) && "Instruction requires 64 bit support"); - // CALLpcrel and CALLindirect are handled specially here to print only the - // appropriate number of args that the assembler expects. This is because - // may have many arguments appended to record the uses of registers that are - // holding arguments to the called function. - if (Opcode == PPC::COND_BRANCH) { - std::cerr << "Error: untranslated conditional branch psuedo instruction!\n"; - abort(); - } else if (Opcode == PPC::IMPLICIT_DEF) { - --EmittedInsts; // Not an actual machine instruction - O << "; IMPLICIT DEF "; - printOp(MI->getOperand(0)); - O << "\n"; - return; - } else if (Opcode == PPC::CALLpcrel) { - O << TII.getName(Opcode) << " "; - printOp(MI->getOperand(0)); - O << "\n"; - return; - } else if (Opcode == PPC::CALLindirect) { - O << TII.getName(Opcode) << " "; - printImmOp(MI->getOperand(0), ArgType[0]); - O << ", "; - printImmOp(MI->getOperand(1), ArgType[0]); - O << "\n"; - return; - } else if (Opcode == PPC::MovePCtoLR) { - ++EmittedInsts; // Actually two machine instructions - // FIXME: should probably be converted to cout.width and cout.fill - O << "bl \"L0000" << LabelNumber << "$pb\"\n"; - O << "\"L0000" << LabelNumber << "$pb\":\n"; - O << "\tmflr "; - printOp(MI->getOperand(0)); - O << "\n"; - return; - } - O << TII.getName(Opcode) << " "; if (Opcode == PPC::LOADHiAddr) { printOp(MI->getOperand(0)); |