| 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 485 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 496 template <> void InstARM32Adc::emitIAS(const Cfg *Func) const { | 496 template <> void InstARM32Adc::emitIAS(const Cfg *Func) const { |
| 497 auto *Asm = Func->getAssembler<ARM32::AssemblerARM32>(); | 497 auto *Asm = Func->getAssembler<ARM32::AssemblerARM32>(); |
| 498 Asm->adc(getDest(), getSrc(0), getSrc(1), SetFlags, getPredicate()); | 498 Asm->adc(getDest(), getSrc(0), getSrc(1), SetFlags, getPredicate()); |
| 499 if (Asm->needsTextFixup()) | 499 if (Asm->needsTextFixup()) |
| 500 emitUsingTextFixup(Func); | 500 emitUsingTextFixup(Func); |
| 501 } | 501 } |
| 502 | 502 |
| 503 template <> void InstARM32Add::emitIAS(const Cfg *Func) const { | 503 template <> void InstARM32Add::emitIAS(const Cfg *Func) const { |
| 504 auto *Asm = Func->getAssembler<ARM32::AssemblerARM32>(); | 504 auto *Asm = Func->getAssembler<ARM32::AssemblerARM32>(); |
| 505 Asm->add(getDest(), getSrc(0), getSrc(1), SetFlags, getPredicate()); | 505 Asm->add(getDest(), getSrc(0), getSrc(1), SetFlags, getPredicate()); |
| 506 if (Asm->needsTextFixup()) | 506 assert(!Asm->needsTextFixup()); |
| 507 emitUsingTextFixup(Func); | |
| 508 } | 507 } |
| 509 | 508 |
| 510 template <> void InstARM32And::emitIAS(const Cfg *Func) const { | 509 template <> void InstARM32And::emitIAS(const Cfg *Func) const { |
| 511 auto *Asm = Func->getAssembler<ARM32::AssemblerARM32>(); | 510 auto *Asm = Func->getAssembler<ARM32::AssemblerARM32>(); |
| 512 Asm->and_(getDest(), getSrc(0), getSrc(1), SetFlags, getPredicate()); | 511 Asm->and_(getDest(), getSrc(0), getSrc(1), SetFlags, getPredicate()); |
| 513 if (Asm->needsTextFixup()) | 512 if (Asm->needsTextFixup()) |
| 514 emitUsingTextFixup(Func); | 513 emitUsingTextFixup(Func); |
| 515 } | 514 } |
| 516 | 515 |
| 517 template <> void InstARM32Bic::emitIAS(const Cfg *Func) const { | 516 template <> void InstARM32Bic::emitIAS(const Cfg *Func) const { |
| (...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 603 assert(!SetFlags); | 602 assert(!SetFlags); |
| 604 auto *Asm = Func->getAssembler<ARM32::AssemblerARM32>(); | 603 auto *Asm = Func->getAssembler<ARM32::AssemblerARM32>(); |
| 605 Asm->udiv(getDest(), getSrc(0), getSrc(1), getPredicate()); | 604 Asm->udiv(getDest(), getSrc(0), getSrc(1), getPredicate()); |
| 606 if (Asm->needsTextFixup()) | 605 if (Asm->needsTextFixup()) |
| 607 emitUsingTextFixup(Func); | 606 emitUsingTextFixup(Func); |
| 608 } | 607 } |
| 609 | 608 |
| 610 template <> void InstARM32Vadd::emitIAS(const Cfg *Func) const { | 609 template <> void InstARM32Vadd::emitIAS(const Cfg *Func) const { |
| 611 auto *Asm = Func->getAssembler<ARM32::AssemblerARM32>(); | 610 auto *Asm = Func->getAssembler<ARM32::AssemblerARM32>(); |
| 612 const Variable *Dest = getDest(); | 611 const Variable *Dest = getDest(); |
| 613 switch (Dest->getType()) { | 612 Type DestTy = Dest->getType(); |
| 614 default: | 613 switch (DestTy) { |
| 615 // TODO(kschimpf) Figure if more cases are needed. | 614 case IceType_void: |
| 616 emitUsingTextFixup(Func); | 615 case IceType_i1: |
| 616 case IceType_i8: |
| 617 case IceType_i16: |
| 618 case IceType_i32: |
| 619 case IceType_i64: |
| 620 case IceType_v4i1: |
| 621 case IceType_v8i1: |
| 622 case IceType_v16i1: |
| 623 case IceType_NUM: |
| 624 llvm::report_fatal_error(std::string("Vadd not defined on type ") + |
| 625 typeString(DestTy)); |
| 626 break; |
| 627 case IceType_v16i8: |
| 628 case IceType_v8i16: |
| 629 case IceType_v4i32: |
| 630 Asm->vaddqi(typeElementType(DestTy), Dest, getSrc(0), getSrc(1)); |
| 631 break; |
| 632 case IceType_v4f32: |
| 633 Asm->vaddqf(Dest, getSrc(0), getSrc(1)); |
| 617 break; | 634 break; |
| 618 case IceType_f32: | 635 case IceType_f32: |
| 619 Asm->vadds(getDest(), getSrc(0), getSrc(1), CondARM32::AL); | 636 Asm->vadds(getDest(), getSrc(0), getSrc(1), CondARM32::AL); |
| 620 assert(!Asm->needsTextFixup()); | |
| 621 break; | 637 break; |
| 622 case IceType_f64: | 638 case IceType_f64: |
| 623 Asm->vaddd(getDest(), getSrc(0), getSrc(1), CondARM32::AL); | 639 Asm->vaddd(getDest(), getSrc(0), getSrc(1), CondARM32::AL); |
| 624 assert(!Asm->needsTextFixup()); | |
| 625 break; | 640 break; |
| 626 } | 641 } |
| 642 assert(!Asm->needsTextFixup()); |
| 627 } | 643 } |
| 628 | 644 |
| 629 template <> void InstARM32Vand::emitIAS(const Cfg *Func) const { | 645 template <> void InstARM32Vand::emitIAS(const Cfg *Func) const { |
| 630 // TODO(kschimpf): add support for these instructions | 646 // TODO(kschimpf): add support for these instructions |
| 631 emitUsingTextFixup(Func); | 647 emitUsingTextFixup(Func); |
| 632 } | 648 } |
| 633 | 649 |
| 634 template <> void InstARM32Vdiv::emitIAS(const Cfg *Func) const { | 650 template <> void InstARM32Vdiv::emitIAS(const Cfg *Func) const { |
| 635 auto *Asm = Func->getAssembler<ARM32::AssemblerARM32>(); | 651 auto *Asm = Func->getAssembler<ARM32::AssemblerARM32>(); |
| 636 const Variable *Dest = getDest(); | 652 const Variable *Dest = getDest(); |
| (...skipping 1823 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2460 | 2476 |
| 2461 template class InstARM32FourAddrGPR<InstARM32::Mla>; | 2477 template class InstARM32FourAddrGPR<InstARM32::Mla>; |
| 2462 template class InstARM32FourAddrGPR<InstARM32::Mls>; | 2478 template class InstARM32FourAddrGPR<InstARM32::Mls>; |
| 2463 | 2479 |
| 2464 template class InstARM32CmpLike<InstARM32::Cmn>; | 2480 template class InstARM32CmpLike<InstARM32::Cmn>; |
| 2465 template class InstARM32CmpLike<InstARM32::Cmp>; | 2481 template class InstARM32CmpLike<InstARM32::Cmp>; |
| 2466 template class InstARM32CmpLike<InstARM32::Tst>; | 2482 template class InstARM32CmpLike<InstARM32::Tst>; |
| 2467 | 2483 |
| 2468 } // end of namespace ARM32 | 2484 } // end of namespace ARM32 |
| 2469 } // end of namespace Ice | 2485 } // end of namespace Ice |
| OLD | NEW |