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 303 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
314 Sdiv, | 314 Sdiv, |
315 Str, | 315 Str, |
316 Sub, | 316 Sub, |
317 Sxt, | 317 Sxt, |
318 Trap, | 318 Trap, |
319 Tst, | 319 Tst, |
320 Udiv, | 320 Udiv, |
321 Umull, | 321 Umull, |
322 Uxt, | 322 Uxt, |
323 Vadd, | 323 Vadd, |
| 324 Vcmp, |
324 Vcvt, | 325 Vcvt, |
325 Vdiv, | 326 Vdiv, |
326 Vldr, | 327 Vldr, |
327 Vmov, | 328 Vmov, |
| 329 Vmrs, |
328 Vmul, | 330 Vmul, |
329 Vsqrt, | 331 Vsqrt, |
330 Vsub | 332 Vsub |
331 }; | 333 }; |
332 | 334 |
333 static const char *getWidthString(Type Ty); | 335 static const char *getWidthString(Type Ty); |
334 static const char *getVecWidthString(Type Ty); | 336 static const char *getVecWidthString(Type Ty); |
335 static CondARM32::Cond getOppositeCondition(CondARM32::Cond Cond); | 337 static CondARM32::Cond getOppositeCondition(CondARM32::Cond Cond); |
336 | 338 |
337 /// Shared emit routines for common forms of instructions. | 339 /// Shared emit routines for common forms of instructions. |
(...skipping 859 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1197 return getSrcSize() > 1; | 1199 return getSrcSize() > 1; |
1198 } | 1200 } |
1199 | 1201 |
1200 void emitMultiDestSingleSource(const Cfg *Func) const; | 1202 void emitMultiDestSingleSource(const Cfg *Func) const; |
1201 void emitSingleDestMultiSource(const Cfg *Func) const; | 1203 void emitSingleDestMultiSource(const Cfg *Func) const; |
1202 void emitSingleDestSingleSource(const Cfg *Func) const; | 1204 void emitSingleDestSingleSource(const Cfg *Func) const; |
1203 | 1205 |
1204 Variable *Dest1 = nullptr; | 1206 Variable *Dest1 = nullptr; |
1205 }; | 1207 }; |
1206 | 1208 |
| 1209 class InstARM32Vcmp final : public InstARM32Pred { |
| 1210 InstARM32Vcmp() = delete; |
| 1211 InstARM32Vcmp(const InstARM32Vcmp &) = delete; |
| 1212 InstARM32Vcmp &operator=(const InstARM32Vcmp &) = delete; |
| 1213 |
| 1214 public: |
| 1215 static InstARM32Vcmp *create(Cfg *Func, Variable *Src0, Variable *Src1, |
| 1216 CondARM32::Cond Predicate) { |
| 1217 return new (Func->allocate<InstARM32Vcmp>()) |
| 1218 InstARM32Vcmp(Func, Src0, Src1, Predicate); |
| 1219 } |
| 1220 void emit(const Cfg *Func) const override; |
| 1221 void emitIAS(const Cfg *Func) const override; |
| 1222 void dump(const Cfg *Func) const override; |
| 1223 static bool classof(const Inst *Inst) { return isClassof(Inst, Vcmp); } |
| 1224 |
| 1225 private: |
| 1226 InstARM32Vcmp(Cfg *Func, Variable *Src0, Variable *Src1, |
| 1227 CondARM32::Cond Predicate); |
| 1228 }; |
| 1229 |
| 1230 /// Copies the FP Status and Control Register the core flags. |
| 1231 class InstARM32Vmrs final : public InstARM32Pred { |
| 1232 InstARM32Vmrs() = delete; |
| 1233 InstARM32Vmrs(const InstARM32Vmrs &) = delete; |
| 1234 InstARM32Vmrs &operator=(const InstARM32Vmrs &) = delete; |
| 1235 |
| 1236 public: |
| 1237 static InstARM32Vmrs *create(Cfg *Func, CondARM32::Cond Predicate) { |
| 1238 return new (Func->allocate<InstARM32Vmrs>()) InstARM32Vmrs(Func, Predicate); |
| 1239 } |
| 1240 void emit(const Cfg *Func) const override; |
| 1241 void emitIAS(const Cfg *Func) const override; |
| 1242 void dump(const Cfg *Func) const override; |
| 1243 static bool classof(const Inst *Inst) { return isClassof(Inst, Vmrs); } |
| 1244 |
| 1245 private: |
| 1246 InstARM32Vmrs(Cfg *Func, CondARM32::Cond Predicate); |
| 1247 }; |
| 1248 |
1207 // Declare partial template specializations of emit() methods that already have | 1249 // Declare partial template specializations of emit() methods that already have |
1208 // default implementations. Without this, there is the possibility of ODR | 1250 // default implementations. Without this, there is the possibility of ODR |
1209 // violations and link errors. | 1251 // violations and link errors. |
1210 | 1252 |
1211 template <> void InstARM32Ldr::emit(const Cfg *Func) const; | 1253 template <> void InstARM32Ldr::emit(const Cfg *Func) const; |
1212 template <> void InstARM32Mov::emit(const Cfg *Func) const; | 1254 template <> void InstARM32Mov::emit(const Cfg *Func) const; |
1213 template <> void InstARM32Movw::emit(const Cfg *Func) const; | 1255 template <> void InstARM32Movw::emit(const Cfg *Func) const; |
1214 template <> void InstARM32Movt::emit(const Cfg *Func) const; | 1256 template <> void InstARM32Movt::emit(const Cfg *Func) const; |
1215 template <> void InstARM32Vldr::emit(const Cfg *Func) const; | 1257 template <> void InstARM32Vldr::emit(const Cfg *Func) const; |
1216 | 1258 |
1217 } // end of namespace Ice | 1259 } // end of namespace Ice |
1218 | 1260 |
1219 #endif // SUBZERO_SRC_ICEINSTARM32_H | 1261 #endif // SUBZERO_SRC_ICEINSTARM32_H |
OLD | NEW |