Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(728)

Side by Side Diff: src/IceInstX8632.h

Issue 681783002: Subzero: Refactor newline emission for Inst::emit(). (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: Created 6 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/IceInst.cpp ('k') | src/IceInstX8632.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 //===- subzero/src/IceInstX8632.h - Low-level x86 instructions --*- C++ -*-===// 1 //===- subzero/src/IceInstX8632.h - Low-level x86 instructions --*- C++ -*-===//
2 // 2 //
3 // The Subzero Code Generator 3 // The Subzero Code Generator
4 // 4 //
5 // This file is distributed under the University of Illinois Open Source 5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details. 6 // License. See LICENSE.TXT for details.
7 // 7 //
8 //===----------------------------------------------------------------------===// 8 //===----------------------------------------------------------------------===//
9 // 9 //
10 // This file declares the InstX8632 and OperandX8632 classes and 10 // This file declares the InstX8632 and OperandX8632 classes and
(...skipping 446 matching lines...) Expand 10 before | Expand all | Expand 10 after
457 public: 457 public:
458 static InstX8632InplaceopGPR *create(Cfg *Func, Operand *SrcDest) { 458 static InstX8632InplaceopGPR *create(Cfg *Func, Operand *SrcDest) {
459 return new (Func->allocate<InstX8632InplaceopGPR>()) 459 return new (Func->allocate<InstX8632InplaceopGPR>())
460 InstX8632InplaceopGPR(Func, SrcDest); 460 InstX8632InplaceopGPR(Func, SrcDest);
461 } 461 }
462 void emit(const Cfg *Func) const override { 462 void emit(const Cfg *Func) const override {
463 Ostream &Str = Func->getContext()->getStrEmit(); 463 Ostream &Str = Func->getContext()->getStrEmit();
464 assert(getSrcSize() == 1); 464 assert(getSrcSize() == 1);
465 Str << "\t" << Opcode << "\t"; 465 Str << "\t" << Opcode << "\t";
466 getSrc(0)->emit(Func); 466 getSrc(0)->emit(Func);
467 Str << "\n";
468 } 467 }
469 void emitIAS(const Cfg *Func) const override { 468 void emitIAS(const Cfg *Func) const override {
470 assert(getSrcSize() == 1); 469 assert(getSrcSize() == 1);
471 const Variable *Var = getDest(); 470 const Variable *Var = getDest();
472 Type Ty = Var->getType(); 471 Type Ty = Var->getType();
473 emitIASOpTyGPR(Func, Ty, Var, Emitter); 472 emitIASOpTyGPR(Func, Ty, Var, Emitter);
474 } 473 }
475 void dump(const Cfg *Func) const override { 474 void dump(const Cfg *Func) const override {
476 Ostream &Str = Func->getContext()->getStrDump(); 475 Ostream &Str = Func->getContext()->getStrDump();
477 dumpDest(Func); 476 dumpDest(Func);
(...skipping 30 matching lines...) Expand all
508 return new (Func->allocate<InstX8632UnaryopGPR>()) 507 return new (Func->allocate<InstX8632UnaryopGPR>())
509 InstX8632UnaryopGPR(Func, Dest, Src); 508 InstX8632UnaryopGPR(Func, Dest, Src);
510 } 509 }
511 void emit(const Cfg *Func) const override { 510 void emit(const Cfg *Func) const override {
512 Ostream &Str = Func->getContext()->getStrEmit(); 511 Ostream &Str = Func->getContext()->getStrEmit();
513 assert(getSrcSize() == 1); 512 assert(getSrcSize() == 1);
514 Str << "\t" << Opcode << "\t"; 513 Str << "\t" << Opcode << "\t";
515 getDest()->emit(Func); 514 getDest()->emit(Func);
516 Str << ", "; 515 Str << ", ";
517 getSrc(0)->emit(Func); 516 getSrc(0)->emit(Func);
518 Str << "\n";
519 } 517 }
520 void emitIAS(const Cfg *Func) const override { 518 void emitIAS(const Cfg *Func) const override {
521 assert(getSrcSize() == 1); 519 assert(getSrcSize() == 1);
522 const Variable *Var = getDest(); 520 const Variable *Var = getDest();
523 Type Ty = Var->getType(); 521 Type Ty = Var->getType();
524 const Operand *Src = getSrc(0); 522 const Operand *Src = getSrc(0);
525 emitIASRegOpTyGPR(Func, Ty, Var, Src, Emitter); 523 emitIASRegOpTyGPR(Func, Ty, Var, Src, Emitter);
526 } 524 }
527 void dump(const Cfg *Func) const override { 525 void dump(const Cfg *Func) const override {
528 Ostream &Str = Func->getContext()->getStrDump(); 526 Ostream &Str = Func->getContext()->getStrDump();
(...skipping 27 matching lines...) Expand all
556 return new (Func->allocate<InstX8632UnaryopXmm>()) 554 return new (Func->allocate<InstX8632UnaryopXmm>())
557 InstX8632UnaryopXmm(Func, Dest, Src); 555 InstX8632UnaryopXmm(Func, Dest, Src);
558 } 556 }
559 void emit(const Cfg *Func) const override { 557 void emit(const Cfg *Func) const override {
560 Ostream &Str = Func->getContext()->getStrEmit(); 558 Ostream &Str = Func->getContext()->getStrEmit();
561 assert(getSrcSize() == 1); 559 assert(getSrcSize() == 1);
562 Str << "\t" << Opcode << "\t"; 560 Str << "\t" << Opcode << "\t";
563 getDest()->emit(Func); 561 getDest()->emit(Func);
564 Str << ", "; 562 Str << ", ";
565 getSrc(0)->emit(Func); 563 getSrc(0)->emit(Func);
566 Str << "\n";
567 } 564 }
568 void emitIAS(const Cfg *Func) const override { 565 void emitIAS(const Cfg *Func) const override {
569 Type Ty = getDest()->getType(); 566 Type Ty = getDest()->getType();
570 assert(getSrcSize() == 1); 567 assert(getSrcSize() == 1);
571 emitIASRegOpTyXMM(Func, Ty, getDest(), getSrc(0), Emitter); 568 emitIASRegOpTyXMM(Func, Ty, getDest(), getSrc(0), Emitter);
572 } 569 }
573 void dump(const Cfg *Func) const override { 570 void dump(const Cfg *Func) const override {
574 Ostream &Str = Func->getContext()->getStrDump(); 571 Ostream &Str = Func->getContext()->getStrDump();
575 dumpDest(Func); 572 dumpDest(Func);
576 Str << " = " << Opcode << "." << getDest()->getType() << " "; 573 Str << " = " << Opcode << "." << getDest()->getType() << " ";
(...skipping 200 matching lines...) Expand 10 before | Expand all | Expand 10 after
777 } 774 }
778 void emit(const Cfg *Func) const override { 775 void emit(const Cfg *Func) const override {
779 Ostream &Str = Func->getContext()->getStrEmit(); 776 Ostream &Str = Func->getContext()->getStrEmit();
780 assert(getSrcSize() == 3); 777 assert(getSrcSize() == 3);
781 Str << "\t" << Opcode << "\t"; 778 Str << "\t" << Opcode << "\t";
782 getDest()->emit(Func); 779 getDest()->emit(Func);
783 Str << ", "; 780 Str << ", ";
784 getSrc(1)->emit(Func); 781 getSrc(1)->emit(Func);
785 Str << ", "; 782 Str << ", ";
786 getSrc(2)->emit(Func); 783 getSrc(2)->emit(Func);
787 Str << "\n";
788 } 784 }
789 void emitIAS(const Cfg *Func) const override; 785 void emitIAS(const Cfg *Func) const override;
790 void dump(const Cfg *Func) const override { 786 void dump(const Cfg *Func) const override {
791 Ostream &Str = Func->getContext()->getStrDump(); 787 Ostream &Str = Func->getContext()->getStrDump();
792 dumpDest(Func); 788 dumpDest(Func);
793 Str << " = " << Opcode << "." << getDest()->getType() << " "; 789 Str << " = " << Opcode << "." << getDest()->getType() << " ";
794 dumpSources(Func); 790 dumpSources(Func);
795 } 791 }
796 static bool classof(const Inst *Inst) { return isClassof(Inst, K); } 792 static bool classof(const Inst *Inst) { return isClassof(Inst, K); }
797 793
(...skipping 22 matching lines...) Expand all
820 } 816 }
821 void emit(const Cfg *Func) const override { 817 void emit(const Cfg *Func) const override {
822 Ostream &Str = Func->getContext()->getStrEmit(); 818 Ostream &Str = Func->getContext()->getStrEmit();
823 assert(getSrcSize() == 2); 819 assert(getSrcSize() == 2);
824 Str << "\t" << Opcode << "\t"; 820 Str << "\t" << Opcode << "\t";
825 getDest()->emit(Func); 821 getDest()->emit(Func);
826 Str << ", "; 822 Str << ", ";
827 getSrc(0)->emit(Func); 823 getSrc(0)->emit(Func);
828 Str << ", "; 824 Str << ", ";
829 getSrc(1)->emit(Func); 825 getSrc(1)->emit(Func);
830 Str << "\n";
831 } 826 }
832 void emitIAS(const Cfg *Func) const override; 827 void emitIAS(const Cfg *Func) const override;
833 void dump(const Cfg *Func) const override { 828 void dump(const Cfg *Func) const override {
834 Ostream &Str = Func->getContext()->getStrDump(); 829 Ostream &Str = Func->getContext()->getStrDump();
835 dumpDest(Func); 830 dumpDest(Func);
836 Str << " = " << Opcode << "." << getDest()->getType() << " "; 831 Str << " = " << Opcode << "." << getDest()->getType() << " ";
837 dumpSources(Func); 832 dumpSources(Func);
838 } 833 }
839 static bool classof(const Inst *Inst) { return isClassof(Inst, K); } 834 static bool classof(const Inst *Inst) { return isClassof(Inst, K); }
840 835
(...skipping 705 matching lines...) Expand 10 before | Expand all | Expand 10 after
1546 template <> void InstX8632Pinsr::emitIAS(const Cfg *Func) const; 1541 template <> void InstX8632Pinsr::emitIAS(const Cfg *Func) const;
1547 template <> void InstX8632Movsx::emitIAS(const Cfg *Func) const; 1542 template <> void InstX8632Movsx::emitIAS(const Cfg *Func) const;
1548 template <> void InstX8632Movzx::emitIAS(const Cfg *Func) const; 1543 template <> void InstX8632Movzx::emitIAS(const Cfg *Func) const;
1549 template <> void InstX8632Pmull::emitIAS(const Cfg *Func) const; 1544 template <> void InstX8632Pmull::emitIAS(const Cfg *Func) const;
1550 template <> void InstX8632Pshufd::emitIAS(const Cfg *Func) const; 1545 template <> void InstX8632Pshufd::emitIAS(const Cfg *Func) const;
1551 template <> void InstX8632Shufps::emitIAS(const Cfg *Func) const; 1546 template <> void InstX8632Shufps::emitIAS(const Cfg *Func) const;
1552 1547
1553 } // end of namespace Ice 1548 } // end of namespace Ice
1554 1549
1555 #endif // SUBZERO_SRC_ICEINSTX8632_H 1550 #endif // SUBZERO_SRC_ICEINSTX8632_H
OLDNEW
« no previous file with comments | « src/IceInst.cpp ('k') | src/IceInstX8632.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698