Lines Matching refs:OS
96 void printManglingSuffix(raw_ostream &OS, ImmPredicateSet &ImmPredicates,
99 OS << 'r';
101 OS << 'f';
103 OS << 'i';
106 OS << "_" << ImmPredicates.getPredicate(Code-1).getFnName();
142 void emitImmediatePredicate(raw_ostream &OS, ImmPredicateSet &ImmPredicates) {
151 OS << " &&\n ";
156 OS << "VT == "
161 OS << PredFn.getFnName() << "(imm" << i <<')';
276 void PrintParameters(raw_ostream &OS) const {
279 OS << "unsigned Op" << i << ", bool Op" << i << "IsKill";
281 OS << "uint64_t imm" << i;
283 OS << "ConstantFP *f" << i;
288 OS << ", ";
292 void PrintArguments(raw_ostream &OS,
302 OS << ", ";
304 OS << "Op" << i << ", Op" << i << "IsKill";
307 OS << "imm" << i;
310 OS << "f" << i;
318 void PrintArguments(raw_ostream &OS) const {
321 OS << "Op" << i << ", Op" << i << "IsKill";
323 OS << "imm" << i;
325 OS << "f" << i;
330 OS << ", ";
335 void PrintManglingSuffix(raw_ostream &OS, const std::vector<std::string> &PR,
346 Operands[i].printManglingSuffix(OS, ImmPredicates, StripImmCodes);
350 void PrintManglingSuffix(raw_ostream &OS, ImmPredicateSet &ImmPredicates,
353 Operands[i].printManglingSuffix(OS, ImmPredicates, StripImmCodes);
376 void printImmediatePredicates(raw_ostream &OS);
377 void printFunctionDefinitions(raw_ostream &OS);
563 void FastISelMap::printImmediatePredicates(raw_ostream &OS) {
567 OS << "\n// FastEmit Immediate Predicate functions.\n";
570 OS << "static bool " << I->getFnName() << "(int64_t Imm) {\n";
571 OS << I->getImmediatePredicateCode() << "\n}\n";
574 OS << "\n\n";
578 void FastISelMap::printFunctionDefinitions(raw_ostream &OS) {
590 OS << "// FastEmit functions for " << Opcode << ".\n";
591 OS << "\n";
605 OS << "unsigned FastEmit_"
609 Operands.PrintManglingSuffix(OS, ImmediatePredicates);
610 OS << "(";
611 Operands.PrintParameters(OS);
612 OS << ") {\n";
626 OS << " if (" + PredicateCheck + ") {\n";
627 OS << " ";
633 OS << " BuildMI(*FuncInfo.MBB, FuncInfo.InsertPt, DL, "
638 OS << " return FastEmitInst_";
640 Operands.PrintManglingSuffix(OS, *Memo.PhysRegs,
642 OS << "(" << InstNS << Memo.Name << ", ";
643 OS << InstNS << Memo.RC->getName() << "RegisterClass";
645 OS << ", ";
646 Operands.PrintArguments(OS, *Memo.PhysRegs);
647 OS << ");\n";
649 OS << "extractsubreg(" << getName(RetVT);
650 OS << ", Op0, Op0IsKill, " << Memo.SubRegNo << ");\n";
654 OS << " }\n";
659 OS << " return 0;\n";
660 OS << "}\n";
661 OS << "\n";
665 OS << "unsigned FastEmit_"
668 Operands.PrintManglingSuffix(OS, ImmediatePredicates);
669 OS << "(MVT RetVT";
671 OS << ", ";
672 Operands.PrintParameters(OS);
673 OS << ") {\nswitch (RetVT.SimpleTy) {\n";
677 OS << " case " << getName(RetVT) << ": return FastEmit_"
680 Operands.PrintManglingSuffix(OS, ImmediatePredicates);
681 OS << "(";
682 Operands.PrintArguments(OS);
683 OS << ");\n";
685 OS << " default: return 0;\n}\n}\n\n";
689 OS << "unsigned FastEmit_"
692 Operands.PrintManglingSuffix(OS, ImmediatePredicates);
693 OS << "(MVT RetVT";
695 OS << ", ";
696 Operands.PrintParameters(OS);
697 OS << ") {\n";
699 OS << " if (RetVT.SimpleTy != " << getName(RM.begin()->first)
717 OS << " if (" + PredicateCheck + ") {\n";
718 OS << " ";
724 OS << " BuildMI(*FuncInfo.MBB, FuncInfo.InsertPt, DL, "
729 OS << " return FastEmitInst_";
732 Operands.PrintManglingSuffix(OS, *Memo.PhysRegs,
734 OS << "(" << InstNS << Memo.Name << ", ";
735 OS << InstNS << Memo.RC->getName() << "RegisterClass";
737 OS << ", ";
738 Operands.PrintArguments(OS, *Memo.PhysRegs);
739 OS << ");\n";
741 OS << "extractsubreg(RetVT, Op0, Op0IsKill, ";
742 OS << Memo.SubRegNo;
743 OS << ");\n";
747 OS << " }\n";
752 OS << " return 0;\n";
753 OS << "}\n";
754 OS << "\n";
759 OS << "unsigned FastEmit_"
761 Operands.PrintManglingSuffix(OS, ImmediatePredicates);
762 OS << "(MVT VT, MVT RetVT";
764 OS << ", ";
765 Operands.PrintParameters(OS);
766 OS << ") {\n";
767 OS << " switch (VT.SimpleTy) {\n";
772 OS << " case " << TypeName << ": return FastEmit_"
774 Operands.PrintManglingSuffix(OS, ImmediatePredicates);
775 OS << "(RetVT";
777 OS << ", ";
778 Operands.PrintArguments(OS);
779 OS << ");\n";
781 OS << " default: return 0;\n";
782 OS << " }\n";
783 OS << "}\n";
784 OS << "\n";
787 OS << "// Top-level FastEmit function.\n";
788 OS << "\n";
792 OS << "unsigned FastEmit_";
793 Operands.PrintManglingSuffix(OS, ImmediatePredicates);
794 OS << "(MVT VT, MVT RetVT, unsigned Opcode";
796 OS << ", ";
797 Operands.PrintParameters(OS);
798 OS << ") {\n";
816 OS << " if (";
817 MI->second[i].emitImmediatePredicate(OS, ImmediatePredicates);
818 OS << ")\n if (unsigned Reg = FastEmit_";
819 MI->second[i].PrintManglingSuffix(OS, ImmediatePredicates);
820 OS << "(VT, RetVT, Opcode";
822 OS << ", ";
823 MI->second[i].PrintArguments(OS);
824 OS << "))\n return Reg;\n\n";
831 OS << " switch (Opcode) {\n";
836 OS << " case " << Opcode << ": return FastEmit_"
838 Operands.PrintManglingSuffix(OS, ImmediatePredicates);
839 OS << "(VT, RetVT";
841 OS << ", ";
842 Operands.PrintArguments(OS);
843 OS << ");\n";
845 OS << " default: return 0;\n";
846 OS << " }\n";
847 OS << "}\n";
848 OS << "\n";
854 void FastISelEmitter::run(raw_ostream &OS) {
862 Target.getName() + " target", OS);
866 F.printImmediatePredicates(OS);
867 F.printFunctionDefinitions(OS);