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