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

Side by Side Diff: src/IceInstX8632.h

Issue 649463002: Handle "Mov" which is mov, movss, movsd, and used for nacl.read.tp. (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: fixups Created 6 years, 2 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/IceGlobalContext.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 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
51 OperandX8632 &operator=(const OperandX8632 &) = delete; 51 OperandX8632 &operator=(const OperandX8632 &) = delete;
52 }; 52 };
53 53
54 // OperandX8632Mem represents the m32 addressing mode, with optional 54 // OperandX8632Mem represents the m32 addressing mode, with optional
55 // base and index registers, a constant offset, and a fixed shift 55 // base and index registers, a constant offset, and a fixed shift
56 // value for the index register. 56 // value for the index register.
57 class OperandX8632Mem : public OperandX8632 { 57 class OperandX8632Mem : public OperandX8632 {
58 public: 58 public:
59 enum SegmentRegisters { 59 enum SegmentRegisters {
60 DefaultSegment = -1, 60 DefaultSegment = -1,
61 #define X(val, name) val, 61 #define X(val, name, prefix) val,
62 SEG_REGX8632_TABLE 62 SEG_REGX8632_TABLE
63 #undef X 63 #undef X
64 SegReg_NUM 64 SegReg_NUM
65 }; 65 };
66 static OperandX8632Mem *create(Cfg *Func, Type Ty, Variable *Base, 66 static OperandX8632Mem *create(Cfg *Func, Type Ty, Variable *Base,
67 Constant *Offset, Variable *Index = NULL, 67 Constant *Offset, Variable *Index = NULL,
68 uint16_t Shift = 0, 68 uint16_t Shift = 0,
69 SegmentRegisters SegmentReg = DefaultSegment) { 69 SegmentRegisters SegmentReg = DefaultSegment) {
70 return new (Func->allocate<OperandX8632Mem>()) 70 return new (Func->allocate<OperandX8632Mem>())
71 OperandX8632Mem(Func, Ty, Base, Offset, Index, Shift, SegmentReg); 71 OperandX8632Mem(Func, Ty, Base, Offset, Index, Shift, SegmentReg);
72 } 72 }
73 Variable *getBase() const { return Base; } 73 Variable *getBase() const { return Base; }
74 Constant *getOffset() const { return Offset; } 74 Constant *getOffset() const { return Offset; }
75 Variable *getIndex() const { return Index; } 75 Variable *getIndex() const { return Index; }
76 uint16_t getShift() const { return Shift; } 76 uint16_t getShift() const { return Shift; }
77 SegmentRegisters getSegmentRegister() const { return SegmentReg; } 77 SegmentRegisters getSegmentRegister() const { return SegmentReg; }
78 void emitSegmentOverride(x86::AssemblerX86 *Asm) const;
78 x86::Address toAsmAddress(Assembler *Asm) const; 79 x86::Address toAsmAddress(Assembler *Asm) const;
79 void emit(const Cfg *Func) const override; 80 void emit(const Cfg *Func) const override;
80 using OperandX8632::dump; 81 using OperandX8632::dump;
81 void dump(const Cfg *Func, Ostream &Str) const override; 82 void dump(const Cfg *Func, Ostream &Str) const override;
82 83
83 static bool classof(const Operand *Operand) { 84 static bool classof(const Operand *Operand) {
84 return Operand->getKind() == static_cast<OperandKind>(kMem); 85 return Operand->getKind() == static_cast<OperandKind>(kMem);
85 } 86 }
86 87
87 private: 88 private:
(...skipping 17 matching lines...) Expand all
105 // accesses through the VariableSplit. 106 // accesses through the VariableSplit.
106 class VariableSplit : public OperandX8632 { 107 class VariableSplit : public OperandX8632 {
107 public: 108 public:
108 enum Portion { 109 enum Portion {
109 Low, 110 Low,
110 High 111 High
111 }; 112 };
112 static VariableSplit *create(Cfg *Func, Variable *Var, Portion Part) { 113 static VariableSplit *create(Cfg *Func, Variable *Var, Portion Part) {
113 return new (Func->allocate<VariableSplit>()) VariableSplit(Func, Var, Part); 114 return new (Func->allocate<VariableSplit>()) VariableSplit(Func, Var, Part);
114 } 115 }
116 int32_t getOffset() const { return Part == High ? 4 : 0; }
117
118 x86::Address toAsmAddress(const Cfg *Func) const;
115 void emit(const Cfg *Func) const override; 119 void emit(const Cfg *Func) const override;
116 using OperandX8632::dump; 120 using OperandX8632::dump;
117 void dump(const Cfg *Func, Ostream &Str) const override; 121 void dump(const Cfg *Func, Ostream &Str) const override;
118 122
119 static bool classof(const Operand *Operand) { 123 static bool classof(const Operand *Operand) {
120 return Operand->getKind() == static_cast<OperandKind>(kSplit); 124 return Operand->getKind() == static_cast<OperandKind>(kSplit);
121 } 125 }
122 126
123 private: 127 private:
124 VariableSplit(Cfg *Func, Variable *Var, Portion Part) 128 VariableSplit(Cfg *Func, Variable *Var, Portion Part)
(...skipping 703 matching lines...) Expand 10 before | Expand all | Expand 10 after
828 public: 832 public:
829 static InstX8632Movlike *create(Cfg *Func, Variable *Dest, Operand *Source) { 833 static InstX8632Movlike *create(Cfg *Func, Variable *Dest, Operand *Source) {
830 return new (Func->allocate<InstX8632Movlike>()) 834 return new (Func->allocate<InstX8632Movlike>())
831 InstX8632Movlike(Func, Dest, Source); 835 InstX8632Movlike(Func, Dest, Source);
832 } 836 }
833 bool isRedundantAssign() const override { 837 bool isRedundantAssign() const override {
834 return checkForRedundantAssign(getDest(), getSrc(0)); 838 return checkForRedundantAssign(getDest(), getSrc(0));
835 } 839 }
836 bool isSimpleAssign() const override { return true; } 840 bool isSimpleAssign() const override { return true; }
837 void emit(const Cfg *Func) const override; 841 void emit(const Cfg *Func) const override;
838 void emitIAS(const Cfg *Func) const override { emit(Func); } 842 void emitIAS(const Cfg *Func) const override;
839 void dump(const Cfg *Func) const override { 843 void dump(const Cfg *Func) const override {
840 Ostream &Str = Func->getContext()->getStrDump(); 844 Ostream &Str = Func->getContext()->getStrDump();
841 Str << Opcode << "." << getDest()->getType() << " "; 845 Str << Opcode << "." << getDest()->getType() << " ";
842 dumpDest(Func); 846 dumpDest(Func);
843 Str << ", "; 847 Str << ", ";
844 dumpSources(Func); 848 dumpSources(Func);
845 } 849 }
846 static bool classof(const Inst *Inst) { return isClassof(Inst, K); } 850 static bool classof(const Inst *Inst) { return isClassof(Inst, K); }
847 851
848 private: 852 private:
(...skipping 663 matching lines...) Expand 10 before | Expand all | Expand 10 after
1512 template <> void InstX8632Psub::emit(const Cfg *Func) const; 1516 template <> void InstX8632Psub::emit(const Cfg *Func) const;
1513 template <> void InstX8632Sqrtss::emit(const Cfg *Func) const; 1517 template <> void InstX8632Sqrtss::emit(const Cfg *Func) const;
1514 template <> void InstX8632Subss::emit(const Cfg *Func) const; 1518 template <> void InstX8632Subss::emit(const Cfg *Func) const;
1515 1519
1516 template <> void InstX8632Blendvps::emitIAS(const Cfg *Func) const; 1520 template <> void InstX8632Blendvps::emitIAS(const Cfg *Func) const;
1517 template <> void InstX8632Div::emitIAS(const Cfg *Func) const; 1521 template <> void InstX8632Div::emitIAS(const Cfg *Func) const;
1518 template <> void InstX8632Idiv::emitIAS(const Cfg *Func) const; 1522 template <> void InstX8632Idiv::emitIAS(const Cfg *Func) const;
1519 template <> void InstX8632Imul::emitIAS(const Cfg *Func) const; 1523 template <> void InstX8632Imul::emitIAS(const Cfg *Func) const;
1520 template <> void InstX8632Cbwdq::emitIAS(const Cfg *Func) const; 1524 template <> void InstX8632Cbwdq::emitIAS(const Cfg *Func) const;
1521 template <> void InstX8632Movd::emitIAS(const Cfg *Func) const; 1525 template <> void InstX8632Movd::emitIAS(const Cfg *Func) const;
1522 template <> void InstX8632Movp::emitIAS(const Cfg *Func) const;
1523 template <> void InstX8632Movq::emitIAS(const Cfg *Func) const;
1524 template <> void InstX8632MovssRegs::emitIAS(const Cfg *Func) const; 1526 template <> void InstX8632MovssRegs::emitIAS(const Cfg *Func) const;
1525 template <> void InstX8632Pblendvb::emitIAS(const Cfg *Func) const; 1527 template <> void InstX8632Pblendvb::emitIAS(const Cfg *Func) const;
1526 template <> void InstX8632Pmull::emitIAS(const Cfg *Func) const; 1528 template <> void InstX8632Pmull::emitIAS(const Cfg *Func) const;
1527 1529
1528 } // end of namespace Ice 1530 } // end of namespace Ice
1529 1531
1530 #endif // SUBZERO_SRC_ICEINSTX8632_H 1532 #endif // SUBZERO_SRC_ICEINSTX8632_H
OLDNEW
« no previous file with comments | « src/IceGlobalContext.cpp ('k') | src/IceInstX8632.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698