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

Side by Side Diff: src/IceInstX8632.cpp

Issue 372113005: Add support for passing and returning vectors in accordance with the x86 calling convention. (Closed) Base URL: https://gerrit.chromium.org/gerrit/p/native_client/pnacl-subzero.git@master
Patch Set: Created 6 years, 5 months 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
OLDNEW
1 //===- subzero/src/IceInstX8632.cpp - X86-32 instruction implementation ---===// 1 //===- subzero/src/IceInstX8632.cpp - X86-32 instruction implementation ---===//
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 implements the InstX8632 and OperandX8632 classes, 10 // This file implements the InstX8632 and OperandX8632 classes,
(...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after
170 : InstX8632(Func, InstX8632::Mfence, 0, NULL) { 170 : InstX8632(Func, InstX8632::Mfence, 0, NULL) {
171 HasSideEffects = true; 171 HasSideEffects = true;
172 } 172 }
173 173
174 InstX8632Store::InstX8632Store(Cfg *Func, Operand *Value, OperandX8632 *Mem) 174 InstX8632Store::InstX8632Store(Cfg *Func, Operand *Value, OperandX8632 *Mem)
175 : InstX8632(Func, InstX8632::Store, 2, NULL) { 175 : InstX8632(Func, InstX8632::Store, 2, NULL) {
176 addSource(Value); 176 addSource(Value);
177 addSource(Mem); 177 addSource(Mem);
178 } 178 }
179 179
180 InstX8632Storep::InstX8632Storep(Cfg *Func, Operand *Value, OperandX8632 *Mem)
181 : InstX8632(Func, InstX8632::Storep, 2, NULL) {
182 addSource(Value);
183 addSource(Mem);
184 }
185
180 InstX8632Mov::InstX8632Mov(Cfg *Func, Variable *Dest, Operand *Source) 186 InstX8632Mov::InstX8632Mov(Cfg *Func, Variable *Dest, Operand *Source)
181 : InstX8632(Func, InstX8632::Mov, 1, Dest) { 187 : InstX8632(Func, InstX8632::Mov, 1, Dest) {
182 addSource(Source); 188 addSource(Source);
183 } 189 }
184 190
185 InstX8632Movp::InstX8632Movp(Cfg *Func, Variable *Dest, Operand *Source) 191 InstX8632Movp::InstX8632Movp(Cfg *Func, Variable *Dest, Operand *Source)
186 : InstX8632(Func, InstX8632::Movp, 1, Dest) { 192 : InstX8632(Func, InstX8632::Movp, 1, Dest) {
187 addSource(Source); 193 addSource(Source);
188 } 194 }
189 195
(...skipping 457 matching lines...) Expand 10 before | Expand all | Expand 10 after
647 } 653 }
648 654
649 void InstX8632Store::dump(const Cfg *Func) const { 655 void InstX8632Store::dump(const Cfg *Func) const {
650 Ostream &Str = Func->getContext()->getStrDump(); 656 Ostream &Str = Func->getContext()->getStrDump();
651 Str << "mov." << getSrc(0)->getType() << " "; 657 Str << "mov." << getSrc(0)->getType() << " ";
652 getSrc(1)->dump(Func); 658 getSrc(1)->dump(Func);
653 Str << ", "; 659 Str << ", ";
654 getSrc(0)->dump(Func); 660 getSrc(0)->dump(Func);
655 } 661 }
656 662
663 void InstX8632Storep::emit(const Cfg *Func) const {
664 Ostream &Str = Func->getContext()->getStrEmit();
665 assert(getSrcSize() == 2);
666 Str << "\tmovups\t";
667 getSrc(1)->emit(Func);
668 Str << ", ";
669 getSrc(0)->emit(Func);
670 Str << "\n";
671 }
672
673 void InstX8632Storep::dump(const Cfg *Func) const {
674 Ostream &Str = Func->getContext()->getStrDump();
675 Str << "storeq." << getSrc(0)->getType() << " ";
Jim Stichnoth 2014/07/08 18:03:15 storeq? should it be storep?
wala 2014/07/08 22:38:57 Done.
676 getSrc(1)->dump(Func);
677 Str << ", ";
678 getSrc(0)->dump(Func);
679 }
680
657 void InstX8632StoreQ::emit(const Cfg *Func) const { 681 void InstX8632StoreQ::emit(const Cfg *Func) const {
658 Ostream &Str = Func->getContext()->getStrEmit(); 682 Ostream &Str = Func->getContext()->getStrEmit();
659 assert(getSrcSize() == 2); 683 assert(getSrcSize() == 2);
660 assert(getSrc(1)->getType() == IceType_i64 || 684 assert(getSrc(1)->getType() == IceType_i64 ||
661 getSrc(1)->getType() == IceType_f64); 685 getSrc(1)->getType() == IceType_f64);
662 Str << "\tmovq\t"; 686 Str << "\tmovq\t";
663 getSrc(1)->emit(Func); 687 getSrc(1)->emit(Func);
664 Str << ", "; 688 Str << ", ";
665 getSrc(0)->emit(Func); 689 getSrc(0)->emit(Func);
666 Str << "\n"; 690 Str << "\n";
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
722 // operands. 746 // operands.
723 Ostream &Str = Func->getContext()->getStrEmit(); 747 Ostream &Str = Func->getContext()->getStrEmit();
724 assert(getSrcSize() == 1); 748 assert(getSrcSize() == 1);
725 Str << "\tmovups\t"; 749 Str << "\tmovups\t";
726 getDest()->emit(Func); 750 getDest()->emit(Func);
727 Str << ", "; 751 Str << ", ";
728 getSrc(0)->emit(Func); 752 getSrc(0)->emit(Func);
729 Str << "\n"; 753 Str << "\n";
730 } 754 }
731 755
756 void InstX8632Movp::dump(const Cfg *Func) const {
757 Ostream &Str = Func->getContext()->getStrDump();
758 Str << "movups." << getDest()->getType() << " ";
759 dumpDest(Func);
760 Str << ", ";
761 dumpSources(Func);
762 }
763
732 void InstX8632Movq::emit(const Cfg *Func) const { 764 void InstX8632Movq::emit(const Cfg *Func) const {
733 Ostream &Str = Func->getContext()->getStrEmit(); 765 Ostream &Str = Func->getContext()->getStrEmit();
734 assert(getSrcSize() == 1); 766 assert(getSrcSize() == 1);
735 assert(getDest()->getType() == IceType_i64 || 767 assert(getDest()->getType() == IceType_i64 ||
736 getDest()->getType() == IceType_f64); 768 getDest()->getType() == IceType_f64);
737 Str << "\tmovq\t"; 769 Str << "\tmovq\t";
738 getDest()->emit(Func); 770 getDest()->emit(Func);
739 Str << ", "; 771 Str << ", ";
740 getSrc(0)->emit(Func); 772 getSrc(0)->emit(Func);
741 Str << "\n"; 773 Str << "\n";
742 } 774 }
743 775
744 void InstX8632Movp::dump(const Cfg *Func) const {
745 Ostream &Str = Func->getContext()->getStrDump();
746 Str << "movups." << getDest()->getType() << " ";
747 dumpDest(Func);
748 Str << ", ";
749 dumpSources(Func);
750 }
751
752 void InstX8632Movq::dump(const Cfg *Func) const { 776 void InstX8632Movq::dump(const Cfg *Func) const {
753 Ostream &Str = Func->getContext()->getStrDump(); 777 Ostream &Str = Func->getContext()->getStrDump();
754 Str << "movq." << getDest()->getType() << " "; 778 Str << "movq." << getDest()->getType() << " ";
755 dumpDest(Func); 779 dumpDest(Func);
756 Str << ", "; 780 Str << ", ";
757 dumpSources(Func); 781 dumpSources(Func);
758 } 782 }
759 783
760 void InstX8632Movsx::emit(const Cfg *Func) const { 784 void InstX8632Movsx::emit(const Cfg *Func) const {
761 Ostream &Str = Func->getContext()->getStrEmit(); 785 Ostream &Str = Func->getContext()->getStrEmit();
(...skipping 306 matching lines...) Expand 10 before | Expand all | Expand 10 after
1068 default: 1092 default:
1069 Str << "???"; 1093 Str << "???";
1070 break; 1094 break;
1071 } 1095 }
1072 Str << "("; 1096 Str << "(";
1073 Var->dump(Func); 1097 Var->dump(Func);
1074 Str << ")"; 1098 Str << ")";
1075 } 1099 }
1076 1100
1077 } // end of namespace Ice 1101 } // end of namespace Ice
OLDNEW
« no previous file with comments | « src/IceInstX8632.h ('k') | src/IceOperand.h » ('j') | src/IceTargetLoweringX8632.cpp » ('J')

Powered by Google App Engine
This is Rietveld 408576698