| OLD | NEW |
| 1 //===- subzero/src/IceInstARM32.cpp - ARM32 instruction implementation ----===// | 1 //===- subzero/src/IceInstARM32.cpp - ARM32 instruction implementation ----===// |
| 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 1203 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1214 } | 1214 } |
| 1215 | 1215 |
| 1216 template <> void InstARM32Tst::emitIAS(const Cfg *Func) const { | 1216 template <> void InstARM32Tst::emitIAS(const Cfg *Func) const { |
| 1217 assert(getSrcSize() == 2); | 1217 assert(getSrcSize() == 2); |
| 1218 auto *Asm = Func->getAssembler<ARM32::AssemblerARM32>(); | 1218 auto *Asm = Func->getAssembler<ARM32::AssemblerARM32>(); |
| 1219 Asm->tst(getSrc(0), getSrc(1), getPredicate()); | 1219 Asm->tst(getSrc(0), getSrc(1), getPredicate()); |
| 1220 if (Asm->needsTextFixup()) | 1220 if (Asm->needsTextFixup()) |
| 1221 emitUsingTextFixup(Func); | 1221 emitUsingTextFixup(Func); |
| 1222 } | 1222 } |
| 1223 | 1223 |
| 1224 InstARM32Dmb::InstARM32Dmb(Cfg *Func) |
| 1225 : InstARM32Pred(Func, InstARM32::Dmb, 0, nullptr, CondARM32::AL) {} |
| 1226 |
| 1227 InstARM32Nop::InstARM32Nop(Cfg *Func) |
| 1228 : InstARM32Pred(Func, InstARM32::Nop, 0, nullptr, CondARM32::AL) {} |
| 1229 |
| 1224 InstARM32Vcmp::InstARM32Vcmp(Cfg *Func, Variable *Src0, Operand *Src1, | 1230 InstARM32Vcmp::InstARM32Vcmp(Cfg *Func, Variable *Src0, Operand *Src1, |
| 1225 CondARM32::Cond Predicate) | 1231 CondARM32::Cond Predicate) |
| 1226 : InstARM32Pred(Func, InstARM32::Vcmp, 2, nullptr, Predicate) { | 1232 : InstARM32Pred(Func, InstARM32::Vcmp, 2, nullptr, Predicate) { |
| 1227 HasSideEffects = true; | 1233 HasSideEffects = true; |
| 1228 addSource(Src0); | 1234 addSource(Src0); |
| 1229 addSource(Src1); | 1235 addSource(Src1); |
| 1230 } | 1236 } |
| 1231 | 1237 |
| 1232 InstARM32Vmrs::InstARM32Vmrs(Cfg *Func, CondARM32::Cond Predicate) | 1238 InstARM32Vmrs::InstARM32Vmrs(Cfg *Func, CondARM32::Cond Predicate) |
| 1233 : InstARM32Pred(Func, InstARM32::Vmrs, 0, nullptr, Predicate) { | 1239 : InstARM32Pred(Func, InstARM32::Vmrs, 0, nullptr, Predicate) { |
| 1234 HasSideEffects = true; | 1240 HasSideEffects = true; |
| 1235 } | 1241 } |
| 1236 | 1242 |
| 1237 InstARM32Vabs::InstARM32Vabs(Cfg *Func, Variable *Dest, Variable *Src, | 1243 InstARM32Vabs::InstARM32Vabs(Cfg *Func, Variable *Dest, Variable *Src, |
| 1238 CondARM32::Cond Predicate) | 1244 CondARM32::Cond Predicate) |
| 1239 : InstARM32Pred(Func, InstARM32::Vabs, 1, Dest, Predicate) { | 1245 : InstARM32Pred(Func, InstARM32::Vabs, 1, Dest, Predicate) { |
| 1240 addSource(Src); | 1246 addSource(Src); |
| 1241 } | 1247 } |
| 1242 | 1248 |
| 1243 InstARM32Dmb::InstARM32Dmb(Cfg *Func) | |
| 1244 : InstARM32Pred(Func, InstARM32::Dmb, 0, nullptr, CondARM32::AL) {} | |
| 1245 | |
| 1246 // ======================== Dump routines ======================== // | 1249 // ======================== Dump routines ======================== // |
| 1247 | 1250 |
| 1248 // Two-addr ops | 1251 // Two-addr ops |
| 1249 template <> const char *InstARM32Movt::Opcode = "movt"; | 1252 template <> const char *InstARM32Movt::Opcode = "movt"; |
| 1250 // Unary ops | 1253 // Unary ops |
| 1251 template <> const char *InstARM32Movw::Opcode = "movw"; | 1254 template <> const char *InstARM32Movw::Opcode = "movw"; |
| 1252 template <> const char *InstARM32Clz::Opcode = "clz"; | 1255 template <> const char *InstARM32Clz::Opcode = "clz"; |
| 1253 template <> const char *InstARM32Mvn::Opcode = "mvn"; | 1256 template <> const char *InstARM32Mvn::Opcode = "mvn"; |
| 1254 template <> const char *InstARM32Rbit::Opcode = "rbit"; | 1257 template <> const char *InstARM32Rbit::Opcode = "rbit"; |
| 1255 template <> const char *InstARM32Rev::Opcode = "rev"; | 1258 template <> const char *InstARM32Rev::Opcode = "rev"; |
| (...skipping 1184 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2440 emitUsingTextFixup(Func); | 2443 emitUsingTextFixup(Func); |
| 2441 } | 2444 } |
| 2442 | 2445 |
| 2443 void InstARM32Dmb::dump(const Cfg *Func) const { | 2446 void InstARM32Dmb::dump(const Cfg *Func) const { |
| 2444 if (!BuildDefs::dump()) | 2447 if (!BuildDefs::dump()) |
| 2445 return; | 2448 return; |
| 2446 Func->getContext()->getStrDump() << "dmb\t" | 2449 Func->getContext()->getStrDump() << "dmb\t" |
| 2447 "sy"; | 2450 "sy"; |
| 2448 } | 2451 } |
| 2449 | 2452 |
| 2453 void InstARM32Nop::emit(const Cfg *Func) const { |
| 2454 if (!BuildDefs::dump()) |
| 2455 return; |
| 2456 assert(getSrcSize() == 0); |
| 2457 Func->getContext()->getStrEmit() << "\t" |
| 2458 << "nop"; |
| 2459 } |
| 2460 |
| 2461 void InstARM32Nop::emitIAS(const Cfg *Func) const { |
| 2462 assert(getSrcSize() == 0); |
| 2463 Func->getAssembler<ARM32::AssemblerARM32>()->nop(); |
| 2464 } |
| 2465 |
| 2466 void InstARM32Nop::dump(const Cfg *Func) const { |
| 2467 if (!BuildDefs::dump()) |
| 2468 return; |
| 2469 assert(getSrcSize() == 0); |
| 2470 Func->getContext()->getStrDump() << "nop"; |
| 2471 } |
| 2472 |
| 2450 void OperandARM32Mem::emit(const Cfg *Func) const { | 2473 void OperandARM32Mem::emit(const Cfg *Func) const { |
| 2451 if (!BuildDefs::dump()) | 2474 if (!BuildDefs::dump()) |
| 2452 return; | 2475 return; |
| 2453 Ostream &Str = Func->getContext()->getStrEmit(); | 2476 Ostream &Str = Func->getContext()->getStrEmit(); |
| 2454 Str << "["; | 2477 Str << "["; |
| 2455 getBase()->emit(Func); | 2478 getBase()->emit(Func); |
| 2456 switch (getAddrMode()) { | 2479 switch (getAddrMode()) { |
| 2457 case PostIndex: | 2480 case PostIndex: |
| 2458 case NegPostIndex: | 2481 case NegPostIndex: |
| 2459 Str << "]"; | 2482 Str << "]"; |
| (...skipping 230 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2690 | 2713 |
| 2691 template class InstARM32FourAddrGPR<InstARM32::Mla>; | 2714 template class InstARM32FourAddrGPR<InstARM32::Mla>; |
| 2692 template class InstARM32FourAddrGPR<InstARM32::Mls>; | 2715 template class InstARM32FourAddrGPR<InstARM32::Mls>; |
| 2693 | 2716 |
| 2694 template class InstARM32CmpLike<InstARM32::Cmn>; | 2717 template class InstARM32CmpLike<InstARM32::Cmn>; |
| 2695 template class InstARM32CmpLike<InstARM32::Cmp>; | 2718 template class InstARM32CmpLike<InstARM32::Cmp>; |
| 2696 template class InstARM32CmpLike<InstARM32::Tst>; | 2719 template class InstARM32CmpLike<InstARM32::Tst>; |
| 2697 | 2720 |
| 2698 } // end of namespace ARM32 | 2721 } // end of namespace ARM32 |
| 2699 } // end of namespace Ice | 2722 } // end of namespace Ice |
| OLD | NEW |