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 1076 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1087 | 1087 |
1088 InstARM32Vabs::InstARM32Vabs(Cfg *Func, Variable *Dest, Variable *Src, | 1088 InstARM32Vabs::InstARM32Vabs(Cfg *Func, Variable *Dest, Variable *Src, |
1089 CondARM32::Cond Predicate) | 1089 CondARM32::Cond Predicate) |
1090 : InstARM32Pred(Func, InstARM32::Vabs, 1, Dest, Predicate) { | 1090 : InstARM32Pred(Func, InstARM32::Vabs, 1, Dest, Predicate) { |
1091 addSource(Src); | 1091 addSource(Src); |
1092 } | 1092 } |
1093 | 1093 |
1094 InstARM32Dmb::InstARM32Dmb(Cfg *Func) | 1094 InstARM32Dmb::InstARM32Dmb(Cfg *Func) |
1095 : InstARM32Pred(Func, InstARM32::Dmb, 0, nullptr, CondARM32::AL) {} | 1095 : InstARM32Pred(Func, InstARM32::Dmb, 0, nullptr, CondARM32::AL) {} |
1096 | 1096 |
1097 InstARM32Nop::InstARM32Nop(Cfg *Func) | |
Jim Stichnoth
2016/02/08 18:17:50
Should nop (and dmb above) be inserted into the li
Karl
2016/02/09 21:10:01
Really? Where do you see sorting? For the most par
| |
1098 : InstARM32Pred(Func, InstARM32::Nop, 0, nullptr, CondARM32::AL) {} | |
1099 | |
1097 // ======================== Dump routines ======================== // | 1100 // ======================== Dump routines ======================== // |
1098 | 1101 |
1099 // Two-addr ops | 1102 // Two-addr ops |
1100 template <> const char *InstARM32Movt::Opcode = "movt"; | 1103 template <> const char *InstARM32Movt::Opcode = "movt"; |
1101 // Unary ops | 1104 // Unary ops |
1102 template <> const char *InstARM32Movw::Opcode = "movw"; | 1105 template <> const char *InstARM32Movw::Opcode = "movw"; |
1103 template <> const char *InstARM32Clz::Opcode = "clz"; | 1106 template <> const char *InstARM32Clz::Opcode = "clz"; |
1104 template <> const char *InstARM32Mvn::Opcode = "mvn"; | 1107 template <> const char *InstARM32Mvn::Opcode = "mvn"; |
1105 template <> const char *InstARM32Rbit::Opcode = "rbit"; | 1108 template <> const char *InstARM32Rbit::Opcode = "rbit"; |
1106 template <> const char *InstARM32Rev::Opcode = "rev"; | 1109 template <> const char *InstARM32Rev::Opcode = "rev"; |
(...skipping 1184 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2291 emitUsingTextFixup(Func); | 2294 emitUsingTextFixup(Func); |
2292 } | 2295 } |
2293 | 2296 |
2294 void InstARM32Dmb::dump(const Cfg *Func) const { | 2297 void InstARM32Dmb::dump(const Cfg *Func) const { |
2295 if (!BuildDefs::dump()) | 2298 if (!BuildDefs::dump()) |
2296 return; | 2299 return; |
2297 Func->getContext()->getStrDump() << "dmb\t" | 2300 Func->getContext()->getStrDump() << "dmb\t" |
2298 "sy"; | 2301 "sy"; |
2299 } | 2302 } |
2300 | 2303 |
2304 void InstARM32Nop::emit(const Cfg *Func) const { | |
2305 if (!BuildDefs::dump()) | |
2306 return; | |
2307 assert(getSrcSize() == 0); | |
2308 Func->getContext()->getStrEmit() << "\t" | |
2309 << "nop"; | |
2310 } | |
2311 | |
2312 void InstARM32Nop::emitIAS(const Cfg *Func) const { | |
2313 assert(getSrcSize() == 0); | |
2314 Func->getAssembler<ARM32::AssemblerARM32>()->nop(); | |
2315 } | |
2316 | |
2317 void InstARM32Nop::dump(const Cfg *Func) const { | |
2318 if (!BuildDefs::dump()) | |
2319 return; | |
2320 assert(getSrcSize() == 0); | |
2321 Func->getContext()->getStrDump() << "\t" | |
Jim Stichnoth
2016/02/08 18:17:50
dump() doesn't usually prepend a tab character.
Karl
2016/02/09 21:10:01
Done.
| |
2322 << "nop"; | |
2323 } | |
2324 | |
2301 void OperandARM32Mem::emit(const Cfg *Func) const { | 2325 void OperandARM32Mem::emit(const Cfg *Func) const { |
2302 if (!BuildDefs::dump()) | 2326 if (!BuildDefs::dump()) |
2303 return; | 2327 return; |
2304 Ostream &Str = Func->getContext()->getStrEmit(); | 2328 Ostream &Str = Func->getContext()->getStrEmit(); |
2305 Str << "["; | 2329 Str << "["; |
2306 getBase()->emit(Func); | 2330 getBase()->emit(Func); |
2307 switch (getAddrMode()) { | 2331 switch (getAddrMode()) { |
2308 case PostIndex: | 2332 case PostIndex: |
2309 case NegPostIndex: | 2333 case NegPostIndex: |
2310 Str << "]"; | 2334 Str << "]"; |
(...skipping 230 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2541 | 2565 |
2542 template class InstARM32FourAddrGPR<InstARM32::Mla>; | 2566 template class InstARM32FourAddrGPR<InstARM32::Mla>; |
2543 template class InstARM32FourAddrGPR<InstARM32::Mls>; | 2567 template class InstARM32FourAddrGPR<InstARM32::Mls>; |
2544 | 2568 |
2545 template class InstARM32CmpLike<InstARM32::Cmn>; | 2569 template class InstARM32CmpLike<InstARM32::Cmn>; |
2546 template class InstARM32CmpLike<InstARM32::Cmp>; | 2570 template class InstARM32CmpLike<InstARM32::Cmp>; |
2547 template class InstARM32CmpLike<InstARM32::Tst>; | 2571 template class InstARM32CmpLike<InstARM32::Tst>; |
2548 | 2572 |
2549 } // end of namespace ARM32 | 2573 } // end of namespace ARM32 |
2550 } // end of namespace Ice | 2574 } // end of namespace Ice |
OLD | NEW |