- // FIXME: should probably be converted to cout.width and cout.fill
- if (Opcode == PPC32::MovePCtoLR) {
- O << "bcl 20,31,\"L0000" << labelNumber << "$pb\"\n";
- O << "\"L0000" << labelNumber << "$pb\":\n";
+ // 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) {
+ 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) {
+ // FIXME: should probably be converted to cout.width and cout.fill
+ O << "bl \"L0000" << LabelNumber << "$pb\"\n";
+ O << "\"L0000" << LabelNumber << "$pb\":\n";