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

Side by Side Diff: src/IceInst.h

Issue 561883002: Add load and store instructions to Subzero bitcode reader. (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: Fix isses in patch set 2. Created 6 years, 3 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 | « no previous file | src/IceTypes.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.h - High-level instructions ----------*- C++ -*-===// 1 //===- subzero/src/IceInst.h - High-level 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 Inst class and its target-independent 10 // This file declares the Inst class and its target-independent
(...skipping 463 matching lines...) Expand 10 before | Expand all | Expand 10 after
474 Info(Info) {} 474 Info(Info) {}
475 InstIntrinsicCall(const InstIntrinsicCall &) LLVM_DELETED_FUNCTION; 475 InstIntrinsicCall(const InstIntrinsicCall &) LLVM_DELETED_FUNCTION;
476 InstIntrinsicCall &operator=(const InstIntrinsicCall &) LLVM_DELETED_FUNCTION; 476 InstIntrinsicCall &operator=(const InstIntrinsicCall &) LLVM_DELETED_FUNCTION;
477 virtual ~InstIntrinsicCall() {} 477 virtual ~InstIntrinsicCall() {}
478 const Intrinsics::IntrinsicInfo Info; 478 const Intrinsics::IntrinsicInfo Info;
479 }; 479 };
480 480
481 // Load instruction. The source address is captured in getSrc(0). 481 // Load instruction. The source address is captured in getSrc(0).
482 class InstLoad : public Inst { 482 class InstLoad : public Inst {
483 public: 483 public:
484 static InstLoad *create(Cfg *Func, Variable *Dest, Operand *SourceAddr) { 484 static InstLoad *create(Cfg *Func, Variable *Dest, Operand *SourceAddr,
485 uint32_t align = 1) {
486 // TODO(kschimpf) Stop ignoring alignment specification.
487 (void)align;
485 return new (Func->allocateInst<InstLoad>()) 488 return new (Func->allocateInst<InstLoad>())
486 InstLoad(Func, Dest, SourceAddr); 489 InstLoad(Func, Dest, SourceAddr);
487 } 490 }
488 Operand *getSourceAddress() const { return getSrc(0); } 491 Operand *getSourceAddress() const { return getSrc(0); }
489 virtual void dump(const Cfg *Func) const; 492 virtual void dump(const Cfg *Func) const;
490 static bool classof(const Inst *Inst) { return Inst->getKind() == Load; } 493 static bool classof(const Inst *Inst) { return Inst->getKind() == Load; }
491 494
492 private: 495 private:
493 InstLoad(Cfg *Func, Variable *Dest, Operand *SourceAddr); 496 InstLoad(Cfg *Func, Variable *Dest, Operand *SourceAddr);
494 InstLoad(const InstLoad &) LLVM_DELETED_FUNCTION; 497 InstLoad(const InstLoad &) LLVM_DELETED_FUNCTION;
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after
570 Operand *Source2); 573 Operand *Source2);
571 InstSelect(const InstSelect &) LLVM_DELETED_FUNCTION; 574 InstSelect(const InstSelect &) LLVM_DELETED_FUNCTION;
572 InstSelect &operator=(const InstSelect &) LLVM_DELETED_FUNCTION; 575 InstSelect &operator=(const InstSelect &) LLVM_DELETED_FUNCTION;
573 virtual ~InstSelect() {} 576 virtual ~InstSelect() {}
574 }; 577 };
575 578
576 // Store instruction. The address operand is captured, along with the 579 // Store instruction. The address operand is captured, along with the
577 // data operand to be stored into the address. 580 // data operand to be stored into the address.
578 class InstStore : public Inst { 581 class InstStore : public Inst {
579 public: 582 public:
580 static InstStore *create(Cfg *Func, Operand *Data, Operand *Addr) { 583 static InstStore *create(Cfg *Func, Operand *Data, Operand *Addr,
584 uint32_t align = 1) {
585 // TODO(kschimpf) Stop ignoring alignment specification.
586 (void)align;
581 return new (Func->allocateInst<InstStore>()) InstStore(Func, Data, Addr); 587 return new (Func->allocateInst<InstStore>()) InstStore(Func, Data, Addr);
582 } 588 }
583 Operand *getAddr() const { return getSrc(1); } 589 Operand *getAddr() const { return getSrc(1); }
584 Operand *getData() const { return getSrc(0); } 590 Operand *getData() const { return getSrc(0); }
585 virtual void dump(const Cfg *Func) const; 591 virtual void dump(const Cfg *Func) const;
586 static bool classof(const Inst *Inst) { return Inst->getKind() == Store; } 592 static bool classof(const Inst *Inst) { return Inst->getKind() == Store; }
587 593
588 private: 594 private:
589 InstStore(Cfg *Func, Operand *Data, Operand *Addr); 595 InstStore(Cfg *Func, Operand *Data, Operand *Addr);
590 InstStore(const InstStore &) LLVM_DELETED_FUNCTION; 596 InstStore(const InstStore &) LLVM_DELETED_FUNCTION;
(...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after
749 assert(Kind >= Target); 755 assert(Kind >= Target);
750 } 756 }
751 InstTarget(const InstTarget &) LLVM_DELETED_FUNCTION; 757 InstTarget(const InstTarget &) LLVM_DELETED_FUNCTION;
752 InstTarget &operator=(const InstTarget &) LLVM_DELETED_FUNCTION; 758 InstTarget &operator=(const InstTarget &) LLVM_DELETED_FUNCTION;
753 virtual ~InstTarget() {} 759 virtual ~InstTarget() {}
754 }; 760 };
755 761
756 } // end of namespace Ice 762 } // end of namespace Ice
757 763
758 #endif // SUBZERO_SRC_ICEINST_H 764 #endif // SUBZERO_SRC_ICEINST_H
OLDNEW
« no previous file with comments | « no previous file | src/IceTypes.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698