OLD | NEW |
1 //===- subzero/src/IceInstARM32.h - ARM32 machine instructions --*- C++ -*-===// | 1 //===- subzero/src/IceInstARM32.h - ARM32 machine 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 /// \file | 10 /// \file |
(...skipping 1115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1126 bool isRedundantAssign() const override { | 1126 bool isRedundantAssign() const override { |
1127 return !isMultiDest() && !isMultiSource() && | 1127 return !isMultiDest() && !isMultiSource() && |
1128 checkForRedundantAssign(getDest(), getSrc(0)); | 1128 checkForRedundantAssign(getDest(), getSrc(0)); |
1129 } | 1129 } |
1130 bool isSimpleAssign() const override { return true; } | 1130 bool isSimpleAssign() const override { return true; } |
1131 void emit(const Cfg *Func) const override; | 1131 void emit(const Cfg *Func) const override; |
1132 void emitIAS(const Cfg *Func) const override; | 1132 void emitIAS(const Cfg *Func) const override; |
1133 void dump(const Cfg *Func) const override; | 1133 void dump(const Cfg *Func) const override; |
1134 static bool classof(const Inst *Inst) { return isClassof(Inst, Mov); } | 1134 static bool classof(const Inst *Inst) { return isClassof(Inst, Mov); } |
1135 | 1135 |
1136 bool isMultiDest() const { | 1136 bool isMultiDest() const { return DestHi != nullptr; } |
1137 assert(getDest() != nullptr); | 1137 |
1138 return llvm::isa<Variable64On32>(getDest()); | 1138 bool isMultiSource() const { |
| 1139 assert(getSrcSize() == 1 || getSrcSize() == 2); |
| 1140 return getSrcSize() == 2; |
1139 } | 1141 } |
1140 | 1142 |
1141 bool isMultiSource() const { | 1143 Variable *getDestHi() const { return DestHi; } |
1142 assert(getSrcSize() == 1); | |
1143 return llvm::isa<Variable64On32>(getSrc(0)); | |
1144 } | |
1145 | 1144 |
1146 private: | 1145 private: |
1147 InstARM32Mov(Cfg *Func, Variable *Dest, Operand *Src, | 1146 InstARM32Mov(Cfg *Func, Variable *Dest, Operand *Src, |
1148 CondARM32::Cond Predicate) | 1147 CondARM32::Cond Predicate); |
1149 : InstARM32Pred(Func, InstARM32::Mov, 1, Dest, Predicate) { | |
1150 addSource(Src); | |
1151 } | |
1152 | 1148 |
1153 void emitMultiDestSingleSource(const Cfg *Func) const; | 1149 void emitMultiDestSingleSource(const Cfg *Func) const; |
1154 void emitSingleDestMultiSource(const Cfg *Func) const; | 1150 void emitSingleDestMultiSource(const Cfg *Func) const; |
1155 void emitSingleDestSingleSource(const Cfg *Func) const; | 1151 void emitSingleDestSingleSource(const Cfg *Func) const; |
| 1152 |
| 1153 Variable *DestHi = nullptr; |
1156 }; | 1154 }; |
1157 | 1155 |
1158 class InstARM32Vcmp final : public InstARM32Pred { | 1156 class InstARM32Vcmp final : public InstARM32Pred { |
1159 InstARM32Vcmp() = delete; | 1157 InstARM32Vcmp() = delete; |
1160 InstARM32Vcmp(const InstARM32Vcmp &) = delete; | 1158 InstARM32Vcmp(const InstARM32Vcmp &) = delete; |
1161 InstARM32Vcmp &operator=(const InstARM32Vcmp &) = delete; | 1159 InstARM32Vcmp &operator=(const InstARM32Vcmp &) = delete; |
1162 | 1160 |
1163 public: | 1161 public: |
1164 static InstARM32Vcmp *create(Cfg *Func, Variable *Src0, Variable *Src1, | 1162 static InstARM32Vcmp *create(Cfg *Func, Variable *Src0, Variable *Src1, |
1165 CondARM32::Cond Predicate) { | 1163 CondARM32::Cond Predicate) { |
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1219 // default implementations. Without this, there is the possibility of ODR | 1217 // default implementations. Without this, there is the possibility of ODR |
1220 // violations and link errors. | 1218 // violations and link errors. |
1221 | 1219 |
1222 template <> void InstARM32Ldr::emit(const Cfg *Func) const; | 1220 template <> void InstARM32Ldr::emit(const Cfg *Func) const; |
1223 template <> void InstARM32Movw::emit(const Cfg *Func) const; | 1221 template <> void InstARM32Movw::emit(const Cfg *Func) const; |
1224 template <> void InstARM32Movt::emit(const Cfg *Func) const; | 1222 template <> void InstARM32Movt::emit(const Cfg *Func) const; |
1225 | 1223 |
1226 } // end of namespace Ice | 1224 } // end of namespace Ice |
1227 | 1225 |
1228 #endif // SUBZERO_SRC_ICEINSTARM32_H | 1226 #endif // SUBZERO_SRC_ICEINSTARM32_H |
OLD | NEW |