OLD | NEW |
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 16 matching lines...) Expand all Loading... |
27 | 27 |
28 class TargetX8632; | 28 class TargetX8632; |
29 | 29 |
30 // OperandX8632 extends the Operand hierarchy. Its subclasses are | 30 // OperandX8632 extends the Operand hierarchy. Its subclasses are |
31 // OperandX8632Mem and VariableSplit. | 31 // OperandX8632Mem and VariableSplit. |
32 class OperandX8632 : public Operand { | 32 class OperandX8632 : public Operand { |
33 OperandX8632(const OperandX8632 &) = delete; | 33 OperandX8632(const OperandX8632 &) = delete; |
34 OperandX8632 &operator=(const OperandX8632 &) = delete; | 34 OperandX8632 &operator=(const OperandX8632 &) = delete; |
35 | 35 |
36 public: | 36 public: |
37 enum OperandKindX8632 { | 37 enum OperandKindX8632 { k__Start = Operand::kTarget, kMem, kSplit }; |
38 k__Start = Operand::kTarget, | |
39 kMem, | |
40 kSplit | |
41 }; | |
42 using Operand::dump; | 38 using Operand::dump; |
43 void dump(const Cfg *, Ostream &Str) const override { | 39 void dump(const Cfg *, Ostream &Str) const override { |
44 if (ALLOW_DUMP) | 40 if (ALLOW_DUMP) |
45 Str << "<OperandX8632>"; | 41 Str << "<OperandX8632>"; |
46 } | 42 } |
47 | 43 |
48 protected: | 44 protected: |
49 OperandX8632(OperandKindX8632 Kind, Type Ty) | 45 OperandX8632(OperandKindX8632 Kind, Type Ty) |
50 : Operand(static_cast<OperandKind>(Kind), Ty) {} | 46 : Operand(static_cast<OperandKind>(Kind), Ty) {} |
51 ~OperandX8632() override {} | 47 ~OperandX8632() override {} |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
103 // of i32 locations (Low and High). This is needed for some cases | 99 // of i32 locations (Low and High). This is needed for some cases |
104 // of the Bitcast instruction. Since it's not possible for integer | 100 // of the Bitcast instruction. Since it's not possible for integer |
105 // registers to access the XMM registers and vice versa, the | 101 // registers to access the XMM registers and vice versa, the |
106 // lowering forces the f64 to be spilled to the stack and then | 102 // lowering forces the f64 to be spilled to the stack and then |
107 // accesses through the VariableSplit. | 103 // accesses through the VariableSplit. |
108 class VariableSplit : public OperandX8632 { | 104 class VariableSplit : public OperandX8632 { |
109 VariableSplit(const VariableSplit &) = delete; | 105 VariableSplit(const VariableSplit &) = delete; |
110 VariableSplit &operator=(const VariableSplit &) = delete; | 106 VariableSplit &operator=(const VariableSplit &) = delete; |
111 | 107 |
112 public: | 108 public: |
113 enum Portion { | 109 enum Portion { Low, High }; |
114 Low, | |
115 High | |
116 }; | |
117 static VariableSplit *create(Cfg *Func, Variable *Var, Portion Part) { | 110 static VariableSplit *create(Cfg *Func, Variable *Var, Portion Part) { |
118 return new (Func->allocate<VariableSplit>()) VariableSplit(Func, Var, Part); | 111 return new (Func->allocate<VariableSplit>()) VariableSplit(Func, Var, Part); |
119 } | 112 } |
120 int32_t getOffset() const { return Part == High ? 4 : 0; } | 113 int32_t getOffset() const { return Part == High ? 4 : 0; } |
121 | 114 |
122 x86::Address toAsmAddress(const Cfg *Func) const; | 115 x86::Address toAsmAddress(const Cfg *Func) const; |
123 void emit(const Cfg *Func) const override; | 116 void emit(const Cfg *Func) const override; |
124 using OperandX8632::dump; | 117 using OperandX8632::dump; |
125 void dump(const Cfg *Func, Ostream &Str) const override; | 118 void dump(const Cfg *Func, Ostream &Str) const override; |
126 | 119 |
(...skipping 1330 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1457 InstX8632Pop(Cfg *Func, Variable *Dest); | 1450 InstX8632Pop(Cfg *Func, Variable *Dest); |
1458 ~InstX8632Pop() override {} | 1451 ~InstX8632Pop() override {} |
1459 }; | 1452 }; |
1460 | 1453 |
1461 class InstX8632Push : public InstX8632 { | 1454 class InstX8632Push : public InstX8632 { |
1462 InstX8632Push(const InstX8632Push &) = delete; | 1455 InstX8632Push(const InstX8632Push &) = delete; |
1463 InstX8632Push &operator=(const InstX8632Push &) = delete; | 1456 InstX8632Push &operator=(const InstX8632Push &) = delete; |
1464 | 1457 |
1465 public: | 1458 public: |
1466 static InstX8632Push *create(Cfg *Func, Variable *Source) { | 1459 static InstX8632Push *create(Cfg *Func, Variable *Source) { |
1467 return new (Func->allocate<InstX8632Push>()) | 1460 return new (Func->allocate<InstX8632Push>()) InstX8632Push(Func, Source); |
1468 InstX8632Push(Func, Source); | |
1469 } | 1461 } |
1470 void emit(const Cfg *Func) const override; | 1462 void emit(const Cfg *Func) const override; |
1471 void emitIAS(const Cfg *Func) const override; | 1463 void emitIAS(const Cfg *Func) const override; |
1472 void dump(const Cfg *Func) const override; | 1464 void dump(const Cfg *Func) const override; |
1473 static bool classof(const Inst *Inst) { return isClassof(Inst, Push); } | 1465 static bool classof(const Inst *Inst) { return isClassof(Inst, Push); } |
1474 | 1466 |
1475 private: | 1467 private: |
1476 InstX8632Push(Cfg *Func, Variable *Source); | 1468 InstX8632Push(Cfg *Func, Variable *Source); |
1477 ~InstX8632Push() override {} | 1469 ~InstX8632Push() override {} |
1478 }; | 1470 }; |
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1590 template <> void InstX8632Pinsr::emitIAS(const Cfg *Func) const; | 1582 template <> void InstX8632Pinsr::emitIAS(const Cfg *Func) const; |
1591 template <> void InstX8632Movsx::emitIAS(const Cfg *Func) const; | 1583 template <> void InstX8632Movsx::emitIAS(const Cfg *Func) const; |
1592 template <> void InstX8632Movzx::emitIAS(const Cfg *Func) const; | 1584 template <> void InstX8632Movzx::emitIAS(const Cfg *Func) const; |
1593 template <> void InstX8632Pmull::emitIAS(const Cfg *Func) const; | 1585 template <> void InstX8632Pmull::emitIAS(const Cfg *Func) const; |
1594 template <> void InstX8632Pshufd::emitIAS(const Cfg *Func) const; | 1586 template <> void InstX8632Pshufd::emitIAS(const Cfg *Func) const; |
1595 template <> void InstX8632Shufps::emitIAS(const Cfg *Func) const; | 1587 template <> void InstX8632Shufps::emitIAS(const Cfg *Func) const; |
1596 | 1588 |
1597 } // end of namespace Ice | 1589 } // end of namespace Ice |
1598 | 1590 |
1599 #endif // SUBZERO_SRC_ICEINSTX8632_H | 1591 #endif // SUBZERO_SRC_ICEINSTX8632_H |
OLD | NEW |