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 207 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
218 Inst->getSrc(1)->emit(Func); | 218 Inst->getSrc(1)->emit(Func); |
219 Str << ", "; | 219 Str << ", "; |
220 Inst->getSrc(2)->emit(Func); | 220 Inst->getSrc(2)->emit(Func); |
221 } | 221 } |
222 | 222 |
223 template <InstARM32::InstKindARM32 K> | 223 template <InstARM32::InstKindARM32 K> |
224 void InstARM32FourAddrGPR<K>::emitIAS(const Cfg *Func) const { | 224 void InstARM32FourAddrGPR<K>::emitIAS(const Cfg *Func) const { |
225 emitUsingTextFixup(Func); | 225 emitUsingTextFixup(Func); |
226 } | 226 } |
227 | 227 |
| 228 template <InstARM32::InstKindARM32 K> |
| 229 void InstARM32ThreeAddrFP<K>::emitIAS(const Cfg *Func) const { |
| 230 emitUsingTextFixup(Func); |
| 231 } |
| 232 |
228 template <> void InstARM32Mla::emitIAS(const Cfg *Func) const { | 233 template <> void InstARM32Mla::emitIAS(const Cfg *Func) const { |
229 assert(getSrcSize() == 3); | 234 assert(getSrcSize() == 3); |
230 auto *Asm = Func->getAssembler<ARM32::AssemblerARM32>(); | 235 auto *Asm = Func->getAssembler<ARM32::AssemblerARM32>(); |
231 Asm->mla(getDest(), getSrc(0), getSrc(1), getSrc(2), getPredicate()); | 236 Asm->mla(getDest(), getSrc(0), getSrc(1), getSrc(2), getPredicate()); |
232 if (Asm->needsTextFixup()) | 237 if (Asm->needsTextFixup()) |
233 emitUsingTextFixup(Func); | 238 emitUsingTextFixup(Func); |
234 } | 239 } |
235 | 240 |
236 template <> void InstARM32Mls::emitIAS(const Cfg *Func) const { | 241 template <> void InstARM32Mls::emitIAS(const Cfg *Func) const { |
237 assert(getSrcSize() == 3); | 242 assert(getSrcSize() == 3); |
(...skipping 346 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
584 } | 589 } |
585 | 590 |
586 template <> void InstARM32Udiv::emitIAS(const Cfg *Func) const { | 591 template <> void InstARM32Udiv::emitIAS(const Cfg *Func) const { |
587 assert(!SetFlags); | 592 assert(!SetFlags); |
588 auto *Asm = Func->getAssembler<ARM32::AssemblerARM32>(); | 593 auto *Asm = Func->getAssembler<ARM32::AssemblerARM32>(); |
589 Asm->udiv(getDest(), getSrc(0), getSrc(1), getPredicate()); | 594 Asm->udiv(getDest(), getSrc(0), getSrc(1), getPredicate()); |
590 if (Asm->needsTextFixup()) | 595 if (Asm->needsTextFixup()) |
591 emitUsingTextFixup(Func); | 596 emitUsingTextFixup(Func); |
592 } | 597 } |
593 | 598 |
| 599 template <> void InstARM32Vadd::emitIAS(const Cfg *Func) const { |
| 600 auto *Asm = Func->getAssembler<ARM32::AssemblerARM32>(); |
| 601 const Variable *Dest = getDest(); |
| 602 switch (Dest->getType()) { |
| 603 default: |
| 604 // TODO(kschimpf) Figure if more cases are needed. |
| 605 Asm->setNeedsTextFixup(); |
| 606 break; |
| 607 case IceType_f32: |
| 608 Asm->vadds(getDest(), getSrc(0), getSrc(1), CondARM32::AL); |
| 609 break; |
| 610 case IceType_f64: |
| 611 Asm->vaddd(getDest(), getSrc(0), getSrc(1), CondARM32::AL); |
| 612 break; |
| 613 } |
| 614 if (Asm->needsTextFixup()) |
| 615 emitUsingTextFixup(Func); |
| 616 } |
| 617 |
594 InstARM32Call::InstARM32Call(Cfg *Func, Variable *Dest, Operand *CallTarget) | 618 InstARM32Call::InstARM32Call(Cfg *Func, Variable *Dest, Operand *CallTarget) |
595 : InstARM32(Func, InstARM32::Call, 1, Dest) { | 619 : InstARM32(Func, InstARM32::Call, 1, Dest) { |
596 HasSideEffects = true; | 620 HasSideEffects = true; |
597 addSource(CallTarget); | 621 addSource(CallTarget); |
598 } | 622 } |
599 | 623 |
600 InstARM32Label::InstARM32Label(Cfg *Func, TargetARM32 *Target) | 624 InstARM32Label::InstARM32Label(Cfg *Func, TargetARM32 *Target) |
601 : InstARM32(Func, InstARM32::Label, 0, nullptr), | 625 : InstARM32(Func, InstARM32::Label, 0, nullptr), |
602 Number(Target->makeNextLabelNumber()) {} | 626 Number(Target->makeNextLabelNumber()) {} |
603 | 627 |
(...skipping 1541 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2145 template class InstARM32UnaryopFP<InstARM32::Vsqrt>; | 2169 template class InstARM32UnaryopFP<InstARM32::Vsqrt>; |
2146 | 2170 |
2147 template class InstARM32FourAddrGPR<InstARM32::Mla>; | 2171 template class InstARM32FourAddrGPR<InstARM32::Mla>; |
2148 template class InstARM32FourAddrGPR<InstARM32::Mls>; | 2172 template class InstARM32FourAddrGPR<InstARM32::Mls>; |
2149 | 2173 |
2150 template class InstARM32CmpLike<InstARM32::Cmn>; | 2174 template class InstARM32CmpLike<InstARM32::Cmn>; |
2151 template class InstARM32CmpLike<InstARM32::Cmp>; | 2175 template class InstARM32CmpLike<InstARM32::Cmp>; |
2152 template class InstARM32CmpLike<InstARM32::Tst>; | 2176 template class InstARM32CmpLike<InstARM32::Tst>; |
2153 | 2177 |
2154 } // end of namespace Ice | 2178 } // end of namespace Ice |
OLD | NEW |