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 1091 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1102 InstX8632Cmpxchg8b &operator=(const InstX8632Cmpxchg8b &) = delete; | 1102 InstX8632Cmpxchg8b &operator=(const InstX8632Cmpxchg8b &) = delete; |
1103 ~InstX8632Cmpxchg8b() override {} | 1103 ~InstX8632Cmpxchg8b() override {} |
1104 }; | 1104 }; |
1105 | 1105 |
1106 // Cvt instruction - wrapper for cvtsX2sY where X and Y are in {s,d,i} | 1106 // Cvt instruction - wrapper for cvtsX2sY where X and Y are in {s,d,i} |
1107 // as appropriate. s=float, d=double, i=int. X and Y are determined | 1107 // as appropriate. s=float, d=double, i=int. X and Y are determined |
1108 // from dest/src types. Sign and zero extension on the integer | 1108 // from dest/src types. Sign and zero extension on the integer |
1109 // operand needs to be done separately. | 1109 // operand needs to be done separately. |
1110 class InstX8632Cvt : public InstX8632 { | 1110 class InstX8632Cvt : public InstX8632 { |
1111 public: | 1111 public: |
| 1112 enum CvtVariant { Si2ss, Tss2si, Float2float, Dq2ps, Tps2dq }; |
1112 static InstX8632Cvt *create(Cfg *Func, Variable *Dest, Operand *Source, | 1113 static InstX8632Cvt *create(Cfg *Func, Variable *Dest, Operand *Source, |
1113 bool Trunc) { | 1114 CvtVariant Variant) { |
1114 return new (Func->allocate<InstX8632Cvt>()) | 1115 return new (Func->allocate<InstX8632Cvt>()) |
1115 InstX8632Cvt(Func, Dest, Source, Trunc); | 1116 InstX8632Cvt(Func, Dest, Source, Variant); |
1116 } | 1117 } |
1117 void emit(const Cfg *Func) const override; | 1118 void emit(const Cfg *Func) const override; |
| 1119 void emitIAS(const Cfg *Func) const override; |
1118 void dump(const Cfg *Func) const override; | 1120 void dump(const Cfg *Func) const override; |
1119 static bool classof(const Inst *Inst) { return isClassof(Inst, Cvt); } | 1121 static bool classof(const Inst *Inst) { return isClassof(Inst, Cvt); } |
| 1122 bool isTruncating() const { return Variant == Tss2si || Variant == Tps2dq; } |
1120 | 1123 |
1121 private: | 1124 private: |
1122 bool Trunc; | 1125 CvtVariant Variant; |
1123 InstX8632Cvt(Cfg *Func, Variable *Dest, Operand *Source, bool Trunc); | 1126 InstX8632Cvt(Cfg *Func, Variable *Dest, Operand *Source, CvtVariant Variant); |
1124 InstX8632Cvt(const InstX8632Cvt &) = delete; | 1127 InstX8632Cvt(const InstX8632Cvt &) = delete; |
1125 InstX8632Cvt &operator=(const InstX8632Cvt &) = delete; | 1128 InstX8632Cvt &operator=(const InstX8632Cvt &) = delete; |
1126 ~InstX8632Cvt() override {} | 1129 ~InstX8632Cvt() override {} |
1127 }; | 1130 }; |
1128 | 1131 |
1129 // cmp - Integer compare instruction. | 1132 // cmp - Integer compare instruction. |
1130 class InstX8632Icmp : public InstX8632 { | 1133 class InstX8632Icmp : public InstX8632 { |
1131 public: | 1134 public: |
1132 static InstX8632Icmp *create(Cfg *Func, Operand *Src1, Operand *Src2) { | 1135 static InstX8632Icmp *create(Cfg *Func, Operand *Src1, Operand *Src2) { |
1133 return new (Func->allocate<InstX8632Icmp>()) | 1136 return new (Func->allocate<InstX8632Icmp>()) |
(...skipping 380 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1514 template <> void InstX8632Cbwdq::emitIAS(const Cfg *Func) const; | 1517 template <> void InstX8632Cbwdq::emitIAS(const Cfg *Func) const; |
1515 template <> void InstX8632Movd::emitIAS(const Cfg *Func) const; | 1518 template <> void InstX8632Movd::emitIAS(const Cfg *Func) const; |
1516 template <> void InstX8632Movp::emitIAS(const Cfg *Func) const; | 1519 template <> void InstX8632Movp::emitIAS(const Cfg *Func) const; |
1517 template <> void InstX8632Movq::emitIAS(const Cfg *Func) const; | 1520 template <> void InstX8632Movq::emitIAS(const Cfg *Func) const; |
1518 template <> void InstX8632MovssRegs::emitIAS(const Cfg *Func) const; | 1521 template <> void InstX8632MovssRegs::emitIAS(const Cfg *Func) const; |
1519 template <> void InstX8632Pmull::emitIAS(const Cfg *Func) const; | 1522 template <> void InstX8632Pmull::emitIAS(const Cfg *Func) const; |
1520 | 1523 |
1521 } // end of namespace Ice | 1524 } // end of namespace Ice |
1522 | 1525 |
1523 #endif // SUBZERO_SRC_ICEINSTX8632_H | 1526 #endif // SUBZERO_SRC_ICEINSTX8632_H |
OLD | NEW |