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

Side by Side Diff: src/IceInst.cpp

Issue 401523003: Lower insertelement and extractelement. (Closed) Base URL: https://gerrit.chromium.org/gerrit/p/native_client/pnacl-subzero.git@master
Patch Set: Rebase 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
« no previous file with comments | « src/IceInst.h ('k') | src/IceInstX8632.h » ('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/IceInst.cpp - High-level instruction implementation ----===// 1 //===- subzero/src/IceInst.cpp - High-level 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 Inst class, primarily the various 10 // This file implements the Inst class, primarily the various
(...skipping 249 matching lines...) Expand 10 before | Expand all | Expand 10 after
260 if (TargetTrue) 260 if (TargetTrue)
261 OutEdges.push_back(TargetTrue); 261 OutEdges.push_back(TargetTrue);
262 return OutEdges; 262 return OutEdges;
263 } 263 }
264 264
265 InstCast::InstCast(Cfg *Func, OpKind CastKind, Variable *Dest, Operand *Source) 265 InstCast::InstCast(Cfg *Func, OpKind CastKind, Variable *Dest, Operand *Source)
266 : Inst(Func, Inst::Cast, 1, Dest), CastKind(CastKind) { 266 : Inst(Func, Inst::Cast, 1, Dest), CastKind(CastKind) {
267 addSource(Source); 267 addSource(Source);
268 } 268 }
269 269
270 InstExtractElement::InstExtractElement(Cfg *Func, Variable *Dest,
271 Operand *Source1, Operand *Source2)
272 : Inst(Func, Inst::ExtractElement, 2, Dest) {
273 addSource(Source1);
274 addSource(Source2);
275 }
276
270 InstFcmp::InstFcmp(Cfg *Func, FCond Condition, Variable *Dest, Operand *Source1, 277 InstFcmp::InstFcmp(Cfg *Func, FCond Condition, Variable *Dest, Operand *Source1,
271 Operand *Source2) 278 Operand *Source2)
272 : Inst(Func, Inst::Fcmp, 2, Dest), Condition(Condition) { 279 : Inst(Func, Inst::Fcmp, 2, Dest), Condition(Condition) {
273 addSource(Source1); 280 addSource(Source1);
274 addSource(Source2); 281 addSource(Source2);
275 } 282 }
276 283
277 InstIcmp::InstIcmp(Cfg *Func, ICond Condition, Variable *Dest, Operand *Source1, 284 InstIcmp::InstIcmp(Cfg *Func, ICond Condition, Variable *Dest, Operand *Source1,
278 Operand *Source2) 285 Operand *Source2)
279 : Inst(Func, Inst::Icmp, 2, Dest), Condition(Condition) { 286 : Inst(Func, Inst::Icmp, 2, Dest), Condition(Condition) {
280 addSource(Source1); 287 addSource(Source1);
281 addSource(Source2); 288 addSource(Source2);
282 } 289 }
283 290
291 InstInsertElement::InstInsertElement(Cfg *Func, Variable *Dest,
292 Operand *Source1, Operand *Source2,
293 Operand *Source3)
294 : Inst(Func, Inst::InsertElement, 3, Dest) {
295 addSource(Source1);
296 addSource(Source2);
297 addSource(Source3);
298 }
299
284 InstLoad::InstLoad(Cfg *Func, Variable *Dest, Operand *SourceAddr) 300 InstLoad::InstLoad(Cfg *Func, Variable *Dest, Operand *SourceAddr)
285 : Inst(Func, Inst::Load, 1, Dest) { 301 : Inst(Func, Inst::Load, 1, Dest) {
286 addSource(SourceAddr); 302 addSource(SourceAddr);
287 } 303 }
288 304
289 InstPhi::InstPhi(Cfg *Func, SizeT MaxSrcs, Variable *Dest) 305 InstPhi::InstPhi(Cfg *Func, SizeT MaxSrcs, Variable *Dest)
290 : Inst(Func, Phi, MaxSrcs, Dest) { 306 : Inst(Func, Phi, MaxSrcs, Dest) {
291 Labels = Func->allocateArrayOf<CfgNode *>(MaxSrcs); 307 Labels = Func->allocateArrayOf<CfgNode *>(MaxSrcs);
292 } 308 }
293 309
(...skipping 285 matching lines...) Expand 10 before | Expand all | Expand 10 after
579 } 595 }
580 596
581 void InstIcmp::dump(const Cfg *Func) const { 597 void InstIcmp::dump(const Cfg *Func) const {
582 Ostream &Str = Func->getContext()->getStrDump(); 598 Ostream &Str = Func->getContext()->getStrDump();
583 dumpDest(Func); 599 dumpDest(Func);
584 Str << " = icmp " << InstIcmpAttributes[getCondition()].DisplayString << " " 600 Str << " = icmp " << InstIcmpAttributes[getCondition()].DisplayString << " "
585 << getSrc(0)->getType() << " "; 601 << getSrc(0)->getType() << " ";
586 dumpSources(Func); 602 dumpSources(Func);
587 } 603 }
588 604
605 void InstExtractElement::dump(const Cfg *Func) const {
606 Ostream &Str = Func->getContext()->getStrDump();
607 dumpDest(Func);
608 Str << " = extractelement ";
609 Str << getSrc(0)->getType() << " ";
610 getSrc(0)->dump(Func);
611 Str << ", ";
612 Str << getSrc(1)->getType() << " ";
613 getSrc(1)->dump(Func);
614 };
615
616 void InstInsertElement::dump(const Cfg *Func) const {
617 Ostream &Str = Func->getContext()->getStrDump();
618 dumpDest(Func);
619 Str << " = insertelement ";
620 Str << getSrc(0)->getType() << " ";
621 getSrc(0)->dump(Func);
622 Str << ", ";
623 Str << getSrc(1)->getType() << " ";
624 getSrc(1)->dump(Func);
625 Str << ", ";
626 Str << getSrc(2)->getType() << " ";
627 getSrc(2)->dump(Func);
628 };
629
589 void InstFcmp::dump(const Cfg *Func) const { 630 void InstFcmp::dump(const Cfg *Func) const {
590 Ostream &Str = Func->getContext()->getStrDump(); 631 Ostream &Str = Func->getContext()->getStrDump();
591 dumpDest(Func); 632 dumpDest(Func);
592 Str << " = fcmp " << InstFcmpAttributes[getCondition()].DisplayString << " " 633 Str << " = fcmp " << InstFcmpAttributes[getCondition()].DisplayString << " "
593 << getSrc(0)->getType() << " "; 634 << getSrc(0)->getType() << " ";
594 dumpSources(Func); 635 dumpSources(Func);
595 } 636 }
596 637
597 void InstLoad::dump(const Cfg *Func) const { 638 void InstLoad::dump(const Cfg *Func) const {
598 Ostream &Str = Func->getContext()->getStrDump(); 639 Ostream &Str = Func->getContext()->getStrDump();
(...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after
718 759
719 void InstTarget::dump(const Cfg *Func) const { 760 void InstTarget::dump(const Cfg *Func) const {
720 Ostream &Str = Func->getContext()->getStrDump(); 761 Ostream &Str = Func->getContext()->getStrDump();
721 Str << "[TARGET] "; 762 Str << "[TARGET] ";
722 Inst::dump(Func); 763 Inst::dump(Func);
723 } 764 }
724 765
725 void InstTarget::dumpExtras(const Cfg *Func) const { Inst::dumpExtras(Func); } 766 void InstTarget::dumpExtras(const Cfg *Func) const { Inst::dumpExtras(Func); }
726 767
727 } // end of namespace Ice 768 } // end of namespace Ice
OLDNEW
« no previous file with comments | « src/IceInst.h ('k') | src/IceInstX8632.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698