| 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 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 77 | 77 |
| 78 void InstARM32Pred::dumpOpcodePred(Ostream &Str, const char *Opcode, | 78 void InstARM32Pred::dumpOpcodePred(Ostream &Str, const char *Opcode, |
| 79 Type Ty) const { | 79 Type Ty) const { |
| 80 Str << Opcode << getPredicate() << "." << Ty; | 80 Str << Opcode << getPredicate() << "." << Ty; |
| 81 } | 81 } |
| 82 | 82 |
| 83 CondARM32::Cond InstARM32::getOppositeCondition(CondARM32::Cond Cond) { | 83 CondARM32::Cond InstARM32::getOppositeCondition(CondARM32::Cond Cond) { |
| 84 return InstARM32CondAttributes[Cond].Opposite; | 84 return InstARM32CondAttributes[Cond].Opposite; |
| 85 } | 85 } |
| 86 | 86 |
| 87 void InstARM32::emitUsingTextFixup(const Cfg *Func) const { |
| 88 GlobalContext *Ctx = Func->getContext(); |
| 89 if (!BuildDefs::dump() || !Ctx->getFlags().getAllowHybridAssembly()) |
| 90 UnimplementedError(Ctx->getFlags()); |
| 91 std::string Buffer; |
| 92 llvm::raw_string_ostream StrBuf(Buffer); |
| 93 OstreamLocker L(Ctx); |
| 94 Ostream &OldStr = Ctx->getStrEmit(); |
| 95 Ctx->setStrEmit(StrBuf); |
| 96 emit(Func); |
| 97 Ctx->setStrEmit(OldStr); |
| 98 ARM32::AssemblerARM32 *Asm = Func->getAssembler<ARM32::AssemblerARM32>(); |
| 99 Asm->emitTextInst(StrBuf.str()); |
| 100 } |
| 101 |
| 102 void InstARM32::emitIAS(const Cfg *Func) const { emitUsingTextFixup(Func); } |
| 103 |
| 87 void InstARM32Pred::emitUnaryopGPR(const char *Opcode, | 104 void InstARM32Pred::emitUnaryopGPR(const char *Opcode, |
| 88 const InstARM32Pred *Inst, const Cfg *Func, | 105 const InstARM32Pred *Inst, const Cfg *Func, |
| 89 bool NeedsWidthSuffix) { | 106 bool NeedsWidthSuffix) { |
| 90 Ostream &Str = Func->getContext()->getStrEmit(); | 107 Ostream &Str = Func->getContext()->getStrEmit(); |
| 91 assert(Inst->getSrcSize() == 1); | 108 assert(Inst->getSrcSize() == 1); |
| 92 Type SrcTy = Inst->getSrc(0)->getType(); | 109 Type SrcTy = Inst->getSrc(0)->getType(); |
| 93 Str << "\t" << Opcode; | 110 Str << "\t" << Opcode; |
| 94 if (NeedsWidthSuffix) | 111 if (NeedsWidthSuffix) |
| 95 Str << getWidthString(SrcTy); | 112 Str << getWidthString(SrcTy); |
| 96 Str << Inst->getPredicate() << "\t"; | 113 Str << Inst->getPredicate() << "\t"; |
| (...skipping 216 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 313 } | 330 } |
| 314 if (TargetTrue == OldNode) { | 331 if (TargetTrue == OldNode) { |
| 315 TargetTrue = NewNode; | 332 TargetTrue = NewNode; |
| 316 Found = true; | 333 Found = true; |
| 317 } | 334 } |
| 318 return Found; | 335 return Found; |
| 319 } | 336 } |
| 320 | 337 |
| 321 template <InstARM32::InstKindARM32 K> | 338 template <InstARM32::InstKindARM32 K> |
| 322 void InstARM32ThreeAddrGPR<K>::emitIAS(const Cfg *Func) const { | 339 void InstARM32ThreeAddrGPR<K>::emitIAS(const Cfg *Func) const { |
| 323 (void)Func; | 340 emitUsingTextFixup(Func); |
| 324 UnimplementedError(Func->getContext()->getFlags()); | |
| 325 } | 341 } |
| 326 | 342 |
| 327 template <> | 343 template <> |
| 328 void InstARM32ThreeAddrGPR<InstARM32::Add>::emitIAS(const Cfg *Func) const { | 344 void InstARM32ThreeAddrGPR<InstARM32::Add>::emitIAS(const Cfg *Func) const { |
| 329 ARM32::AssemblerARM32 *Asm = Func->getAssembler<ARM32::AssemblerARM32>(); | 345 ARM32::AssemblerARM32 *Asm = Func->getAssembler<ARM32::AssemblerARM32>(); |
| 330 Asm->add(getDest(), getSrc(0), getSrc(1), SetFlags, getPredicate()); | 346 if (!Asm->add(getDest(), getSrc(0), getSrc(1), SetFlags, getPredicate())) |
| 347 emitUsingTextFixup(Func); |
| 331 } | 348 } |
| 332 | 349 |
| 333 template <> | 350 template <> |
| 334 void InstARM32ThreeAddrGPR<InstARM32::Sub>::emitIAS(const Cfg *Func) const { | 351 void InstARM32ThreeAddrGPR<InstARM32::Sub>::emitIAS(const Cfg *Func) const { |
| 335 ARM32::AssemblerARM32 *Asm = Func->getAssembler<ARM32::AssemblerARM32>(); | 352 ARM32::AssemblerARM32 *Asm = Func->getAssembler<ARM32::AssemblerARM32>(); |
| 336 Asm->sub(getDest(), getSrc(0), getSrc(1), SetFlags, getPredicate()); | 353 if (!Asm->sub(getDest(), getSrc(0), getSrc(1), SetFlags, getPredicate())) |
| 354 emitUsingTextFixup(Func); |
| 337 } | 355 } |
| 338 | 356 |
| 339 InstARM32Call::InstARM32Call(Cfg *Func, Variable *Dest, Operand *CallTarget) | 357 InstARM32Call::InstARM32Call(Cfg *Func, Variable *Dest, Operand *CallTarget) |
| 340 : InstARM32(Func, InstARM32::Call, 1, Dest) { | 358 : InstARM32(Func, InstARM32::Call, 1, Dest) { |
| 341 HasSideEffects = true; | 359 HasSideEffects = true; |
| 342 addSource(CallTarget); | 360 addSource(CallTarget); |
| 343 } | 361 } |
| 344 | 362 |
| 345 InstARM32Label::InstARM32Label(Cfg *Func, TargetARM32 *Target) | 363 InstARM32Label::InstARM32Label(Cfg *Func, TargetARM32 *Target) |
| 346 : InstARM32(Func, InstARM32::Label, 0, nullptr), | 364 : InstARM32(Func, InstARM32::Label, 0, nullptr), |
| (...skipping 256 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 603 const char *NoWidthString = ""; | 621 const char *NoWidthString = ""; |
| 604 const char *WidthString = | 622 const char *WidthString = |
| 605 isVectorType(Src0->getType()) ? ".64" : NoWidthString; | 623 isVectorType(Src0->getType()) ? ".64" : NoWidthString; |
| 606 Str << "\t" << ActualOpcode << getPredicate() << WidthString << "\t"; | 624 Str << "\t" << ActualOpcode << getPredicate() << WidthString << "\t"; |
| 607 Src0->emit(Func); | 625 Src0->emit(Func); |
| 608 Str << ", "; | 626 Str << ", "; |
| 609 Dest->emit(Func); | 627 Dest->emit(Func); |
| 610 } | 628 } |
| 611 } | 629 } |
| 612 | 630 |
| 613 void InstARM32Mov::emitIASSingleDestSingleSource(const Cfg *Func) const { | 631 bool InstARM32Mov::emitIASSingleDestSingleSource(const Cfg *Func) const { |
| 614 ARM32::AssemblerARM32 *Asm = Func->getAssembler<ARM32::AssemblerARM32>(); | 632 ARM32::AssemblerARM32 *Asm = Func->getAssembler<ARM32::AssemblerARM32>(); |
| 615 Variable *Dest = getDest(); | 633 Variable *Dest = getDest(); |
| 616 Operand *Src0 = getSrc(0); | 634 Operand *Src0 = getSrc(0); |
| 617 // Note: Loop is used so that we can short circuit using break. | 635 if (Dest->hasReg()) { |
| 618 do { | 636 const Type DestTy = Dest->getType(); |
| 619 if (Dest->hasReg()) { | 637 const bool DestIsVector = isVectorType(DestTy); |
| 620 const Type DestTy = Dest->getType(); | 638 const bool DestIsScalarFP = isScalarFloatingType(DestTy); |
| 621 const bool DestIsVector = isVectorType(DestTy); | 639 const bool CoreVFPMove = isMoveBetweenCoreAndVFPRegisters(Dest, Src0); |
| 622 const bool DestIsScalarFP = isScalarFloatingType(DestTy); | 640 if (DestIsVector || DestIsScalarFP || CoreVFPMove) |
| 623 const bool CoreVFPMove = isMoveBetweenCoreAndVFPRegisters(Dest, Src0); | 641 return false; |
| 624 if (DestIsVector || DestIsScalarFP || CoreVFPMove) | 642 if (isMemoryAccess(Src0)) { |
| 625 break; | 643 // TODO(kschimpf) Figure out how to do ldr on CoreVPFMove? (see |
| 626 if (isMemoryAccess(Src0)) { | 644 // emitSingleDestSingleSource, local variable LoadOpcode). |
| 627 // TODO(kschimpf) Figure out how to do ldr on CoreVPFMove? (see | 645 return Asm->ldr(Dest, Src0, getPredicate()); |
| 628 // emitSingleDestSingleSource, local variable LoadOpcode). | |
| 629 Asm->ldr(Dest, Src0, getPredicate()); | |
| 630 } else { | |
| 631 Asm->mov(Dest, Src0, getPredicate()); | |
| 632 } | |
| 633 return; | |
| 634 } else { | |
| 635 const Type Src0Type = Src0->getType(); | |
| 636 const bool Src0IsVector = isVectorType(Src0Type); | |
| 637 const bool Src0IsScalarFP = isScalarFloatingType(Src0Type); | |
| 638 const bool CoreVFPMove = isMoveBetweenCoreAndVFPRegisters(Dest, Src0); | |
| 639 if (Src0IsVector || Src0IsScalarFP || CoreVFPMove) | |
| 640 break; | |
| 641 Asm->str(Src0, Dest, getPredicate()); | |
| 642 return; | |
| 643 } | 646 } |
| 644 } while (0); | 647 return Asm->mov(Dest, Src0, getPredicate()); |
| 645 llvm_unreachable("not yet implemented"); | 648 } else { |
| 649 const Type Src0Type = Src0->getType(); |
| 650 const bool Src0IsVector = isVectorType(Src0Type); |
| 651 const bool Src0IsScalarFP = isScalarFloatingType(Src0Type); |
| 652 const bool CoreVFPMove = isMoveBetweenCoreAndVFPRegisters(Dest, Src0); |
| 653 if (Src0IsVector || Src0IsScalarFP || CoreVFPMove) |
| 654 return false; |
| 655 return Asm->str(Src0, Dest, getPredicate()); |
| 656 } |
| 657 return false; |
| 646 } | 658 } |
| 647 | 659 |
| 648 void InstARM32Mov::emit(const Cfg *Func) const { | 660 void InstARM32Mov::emit(const Cfg *Func) const { |
| 649 if (!BuildDefs::dump()) | 661 if (!BuildDefs::dump()) |
| 650 return; | 662 return; |
| 651 assert(!(isMultiDest() && isMultiSource()) && "Invalid vmov type."); | 663 assert(!(isMultiDest() && isMultiSource()) && "Invalid vmov type."); |
| 652 if (isMultiDest()) { | 664 if (isMultiDest()) { |
| 653 emitMultiDestSingleSource(Func); | 665 emitMultiDestSingleSource(Func); |
| 654 return; | 666 return; |
| 655 } | 667 } |
| 656 | 668 |
| 657 if (isMultiSource()) { | 669 if (isMultiSource()) { |
| 658 emitSingleDestMultiSource(Func); | 670 emitSingleDestMultiSource(Func); |
| 659 return; | 671 return; |
| 660 } | 672 } |
| 661 | 673 |
| 662 emitSingleDestSingleSource(Func); | 674 emitSingleDestSingleSource(Func); |
| 663 } | 675 } |
| 664 | 676 |
| 665 void InstARM32Mov::emitIAS(const Cfg *Func) const { | 677 void InstARM32Mov::emitIAS(const Cfg *Func) const { |
| 666 assert(getSrcSize() == 1); | 678 assert(getSrcSize() == 1); |
| 667 (void)Func; | 679 (void)Func; |
| 668 assert(!(isMultiDest() && isMultiSource()) && "Invalid vmov type."); | 680 assert(!(isMultiDest() && isMultiSource()) && "Invalid vmov type."); |
| 669 if (isMultiDest()) | 681 if (!(isMultiDest() || isMultiSource())) { |
| 670 llvm_unreachable("Not yet implemented"); | 682 // Must be single source/dest. |
| 671 if (isMultiSource()) | 683 if (emitIASSingleDestSingleSource(Func)) |
| 672 llvm_unreachable("Not yet implemented"); | 684 return; |
| 673 // Must be single source/dest. | 685 } |
| 674 emitIASSingleDestSingleSource(Func); | 686 emitUsingTextFixup(Func); |
| 675 } | 687 } |
| 676 | 688 |
| 677 void InstARM32Mov::dump(const Cfg *Func) const { | 689 void InstARM32Mov::dump(const Cfg *Func) const { |
| 678 if (!BuildDefs::dump()) | 690 if (!BuildDefs::dump()) |
| 679 return; | 691 return; |
| 680 assert(getSrcSize() == 1 || getSrcSize() == 2); | 692 assert(getSrcSize() == 1 || getSrcSize() == 2); |
| 681 Ostream &Str = Func->getContext()->getStrDump(); | 693 Ostream &Str = Func->getContext()->getStrDump(); |
| 682 Variable *Dest = getDest(); | 694 Variable *Dest = getDest(); |
| 683 Variable *DestHi = getDestHi(); | 695 Variable *DestHi = getDestHi(); |
| 684 Dest->dump(Func); | 696 Dest->dump(Func); |
| (...skipping 23 matching lines...) Expand all Loading... |
| 708 Str << getTargetTrue()->getAsmName(); | 720 Str << getTargetTrue()->getAsmName(); |
| 709 if (getTargetFalse()) { | 721 if (getTargetFalse()) { |
| 710 Str << "\n\t" | 722 Str << "\n\t" |
| 711 << "b" | 723 << "b" |
| 712 << "\t" << getTargetFalse()->getAsmName(); | 724 << "\t" << getTargetFalse()->getAsmName(); |
| 713 } | 725 } |
| 714 } | 726 } |
| 715 } | 727 } |
| 716 } | 728 } |
| 717 | 729 |
| 718 void InstARM32Br::emitIAS(const Cfg *Func) const { | |
| 719 (void)Func; | |
| 720 llvm_unreachable("Not yet implemented"); | |
| 721 } | |
| 722 | |
| 723 void InstARM32Br::dump(const Cfg *Func) const { | 730 void InstARM32Br::dump(const Cfg *Func) const { |
| 724 if (!BuildDefs::dump()) | 731 if (!BuildDefs::dump()) |
| 725 return; | 732 return; |
| 726 Ostream &Str = Func->getContext()->getStrDump(); | 733 Ostream &Str = Func->getContext()->getStrDump(); |
| 727 Str << "br "; | 734 Str << "br "; |
| 728 | 735 |
| 729 if (getPredicate() == CondARM32::AL) { | 736 if (getPredicate() == CondARM32::AL) { |
| 730 Str << "label %" | 737 Str << "label %" |
| 731 << (Label ? Label->getName(Func) : getTargetFalse()->getName()); | 738 << (Label ? Label->getName(Func) : getTargetFalse()->getName()); |
| 732 return; | 739 return; |
| (...skipping 28 matching lines...) Expand all Loading... |
| 761 CallTarget->emitWithoutPrefix(Func->getTarget()); | 768 CallTarget->emitWithoutPrefix(Func->getTarget()); |
| 762 } else { | 769 } else { |
| 763 Str << "\t" | 770 Str << "\t" |
| 764 << "blx" | 771 << "blx" |
| 765 << "\t"; | 772 << "\t"; |
| 766 getCallTarget()->emit(Func); | 773 getCallTarget()->emit(Func); |
| 767 } | 774 } |
| 768 Func->getTarget()->resetStackAdjustment(); | 775 Func->getTarget()->resetStackAdjustment(); |
| 769 } | 776 } |
| 770 | 777 |
| 771 void InstARM32Call::emitIAS(const Cfg *Func) const { | |
| 772 (void)Func; | |
| 773 llvm_unreachable("Not yet implemented"); | |
| 774 } | |
| 775 | |
| 776 void InstARM32Call::dump(const Cfg *Func) const { | 778 void InstARM32Call::dump(const Cfg *Func) const { |
| 777 if (!BuildDefs::dump()) | 779 if (!BuildDefs::dump()) |
| 778 return; | 780 return; |
| 779 Ostream &Str = Func->getContext()->getStrDump(); | 781 Ostream &Str = Func->getContext()->getStrDump(); |
| 780 if (getDest()) { | 782 if (getDest()) { |
| 781 dumpDest(Func); | 783 dumpDest(Func); |
| 782 Str << " = "; | 784 Str << " = "; |
| 783 } | 785 } |
| 784 Str << "call "; | 786 Str << "call "; |
| 785 getCallTarget()->dump(Func); | 787 getCallTarget()->dump(Func); |
| 786 } | 788 } |
| 787 | 789 |
| 788 void InstARM32Label::emit(const Cfg *Func) const { | 790 void InstARM32Label::emit(const Cfg *Func) const { |
| 789 if (!BuildDefs::dump()) | 791 if (!BuildDefs::dump()) |
| 790 return; | 792 return; |
| 791 Ostream &Str = Func->getContext()->getStrEmit(); | 793 Ostream &Str = Func->getContext()->getStrEmit(); |
| 792 Str << getName(Func) << ":"; | 794 Str << getName(Func) << ":"; |
| 793 } | 795 } |
| 794 | 796 |
| 795 void InstARM32Label::emitIAS(const Cfg *Func) const { | |
| 796 (void)Func; | |
| 797 llvm_unreachable("Not yet implemented"); | |
| 798 } | |
| 799 | |
| 800 void InstARM32Label::dump(const Cfg *Func) const { | 797 void InstARM32Label::dump(const Cfg *Func) const { |
| 801 if (!BuildDefs::dump()) | 798 if (!BuildDefs::dump()) |
| 802 return; | 799 return; |
| 803 Ostream &Str = Func->getContext()->getStrDump(); | 800 Ostream &Str = Func->getContext()->getStrDump(); |
| 804 Str << getName(Func) << ":"; | 801 Str << getName(Func) << ":"; |
| 805 } | 802 } |
| 806 | 803 |
| 807 template <> void InstARM32Ldr::emit(const Cfg *Func) const { | 804 template <> void InstARM32Ldr::emit(const Cfg *Func) const { |
| 808 if (!BuildDefs::dump()) | 805 if (!BuildDefs::dump()) |
| 809 return; | 806 return; |
| 810 Ostream &Str = Func->getContext()->getStrEmit(); | 807 Ostream &Str = Func->getContext()->getStrEmit(); |
| 811 assert(getSrcSize() == 1); | 808 assert(getSrcSize() == 1); |
| 812 assert(getDest()->hasReg()); | 809 assert(getDest()->hasReg()); |
| 813 Variable *Dest = getDest(); | 810 Variable *Dest = getDest(); |
| 814 Type DestTy = Dest->getType(); | 811 Type DestTy = Dest->getType(); |
| 815 const bool DestIsVector = isVectorType(DestTy); | 812 const bool DestIsVector = isVectorType(DestTy); |
| 816 const bool DestIsScalarFloat = isScalarFloatingType(DestTy); | 813 const bool DestIsScalarFloat = isScalarFloatingType(DestTy); |
| 817 const char *ActualOpcode = | 814 const char *ActualOpcode = |
| 818 DestIsVector ? "vld1" : (DestIsScalarFloat ? "vldr" : "ldr"); | 815 DestIsVector ? "vld1" : (DestIsScalarFloat ? "vldr" : "ldr"); |
| 819 const char *VectorMarker = DestIsVector ? ".64" : ""; | 816 const char *VectorMarker = DestIsVector ? ".64" : ""; |
| 820 const char *WidthString = DestIsVector ? "" : getWidthString(DestTy); | 817 const char *WidthString = DestIsVector ? "" : getWidthString(DestTy); |
| 821 Str << "\t" << ActualOpcode << WidthString << getPredicate() << VectorMarker | 818 Str << "\t" << ActualOpcode << WidthString << getPredicate() << VectorMarker |
| 822 << "\t"; | 819 << "\t"; |
| 823 getDest()->emit(Func); | 820 getDest()->emit(Func); |
| 824 Str << ", "; | 821 Str << ", "; |
| 825 getSrc(0)->emit(Func); | 822 getSrc(0)->emit(Func); |
| 826 } | 823 } |
| 827 | 824 |
| 828 template <> void InstARM32Ldr::emitIAS(const Cfg *Func) const { | |
| 829 assert(getSrcSize() == 1); | |
| 830 (void)Func; | |
| 831 llvm_unreachable("Not yet implemented"); | |
| 832 } | |
| 833 | |
| 834 template <> void InstARM32Ldrex::emit(const Cfg *Func) const { | 825 template <> void InstARM32Ldrex::emit(const Cfg *Func) const { |
| 835 if (!BuildDefs::dump()) | 826 if (!BuildDefs::dump()) |
| 836 return; | 827 return; |
| 837 Ostream &Str = Func->getContext()->getStrEmit(); | 828 Ostream &Str = Func->getContext()->getStrEmit(); |
| 838 assert(getSrcSize() == 1); | 829 assert(getSrcSize() == 1); |
| 839 assert(getDest()->hasReg()); | 830 assert(getDest()->hasReg()); |
| 840 Variable *Dest = getDest(); | 831 Variable *Dest = getDest(); |
| 841 Type DestTy = Dest->getType(); | 832 Type DestTy = Dest->getType(); |
| 842 assert(isScalarIntegerType(DestTy)); | 833 assert(isScalarIntegerType(DestTy)); |
| 843 const char *WidthString = getWidthString(DestTy); | 834 const char *WidthString = getWidthString(DestTy); |
| 844 Str << "\t" << Opcode << WidthString << getPredicate() << "\t"; | 835 Str << "\t" << Opcode << WidthString << getPredicate() << "\t"; |
| 845 getDest()->emit(Func); | 836 getDest()->emit(Func); |
| 846 Str << ", "; | 837 Str << ", "; |
| 847 getSrc(0)->emit(Func); | 838 getSrc(0)->emit(Func); |
| 848 } | 839 } |
| 849 | 840 |
| 850 template <> void InstARM32Ldrex::emitIAS(const Cfg *Func) const { | 841 template <InstARM32::InstKindARM32 K> |
| 851 assert(getSrcSize() == 1); | 842 void InstARM32TwoAddrGPR<K>::emitIAS(const Cfg *Func) const { |
| 852 (void)Func; | 843 emitUsingTextFixup(Func); |
| 853 llvm_unreachable("Not yet implemented"); | |
| 854 } | 844 } |
| 855 | 845 |
| 856 template <> void InstARM32Movw::emit(const Cfg *Func) const { | 846 template <> void InstARM32Movw::emit(const Cfg *Func) const { |
| 857 if (!BuildDefs::dump()) | 847 if (!BuildDefs::dump()) |
| 858 return; | 848 return; |
| 859 Ostream &Str = Func->getContext()->getStrEmit(); | 849 Ostream &Str = Func->getContext()->getStrEmit(); |
| 860 assert(getSrcSize() == 1); | 850 assert(getSrcSize() == 1); |
| 861 Str << "\t" << Opcode << getPredicate() << "\t"; | 851 Str << "\t" << Opcode << getPredicate() << "\t"; |
| 862 getDest()->emit(Func); | 852 getDest()->emit(Func); |
| 863 Str << ", "; | 853 Str << ", "; |
| (...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 919 if (isScalarIntegerType(Op->getType())) | 909 if (isScalarIntegerType(Op->getType())) |
| 920 continue; | 910 continue; |
| 921 Str << "\t" | 911 Str << "\t" |
| 922 << "vpop" | 912 << "vpop" |
| 923 << "\t{"; | 913 << "\t{"; |
| 924 Op->emit(Func); | 914 Op->emit(Func); |
| 925 Str << "}\n"; | 915 Str << "}\n"; |
| 926 } | 916 } |
| 927 } | 917 } |
| 928 | 918 |
| 929 void InstARM32Pop::emitIAS(const Cfg *Func) const { | |
| 930 (void)Func; | |
| 931 llvm_unreachable("Not yet implemented"); | |
| 932 } | |
| 933 | |
| 934 void InstARM32Pop::dump(const Cfg *Func) const { | 919 void InstARM32Pop::dump(const Cfg *Func) const { |
| 935 if (!BuildDefs::dump()) | 920 if (!BuildDefs::dump()) |
| 936 return; | 921 return; |
| 937 Ostream &Str = Func->getContext()->getStrDump(); | 922 Ostream &Str = Func->getContext()->getStrDump(); |
| 938 Str << "pop" | 923 Str << "pop" |
| 939 << " "; | 924 << " "; |
| 940 for (SizeT I = 0; I < Dests.size(); ++I) { | 925 for (SizeT I = 0; I < Dests.size(); ++I) { |
| 941 if (I > 0) | 926 if (I > 0) |
| 942 Str << ", "; | 927 Str << ", "; |
| 943 Dests[I]->dump(Func); | 928 Dests[I]->dump(Func); |
| 944 } | 929 } |
| 945 } | 930 } |
| 946 | 931 |
| 947 void InstARM32AdjustStack::emit(const Cfg *Func) const { | 932 void InstARM32AdjustStack::emit(const Cfg *Func) const { |
| 948 if (!BuildDefs::dump()) | 933 if (!BuildDefs::dump()) |
| 949 return; | 934 return; |
| 950 Ostream &Str = Func->getContext()->getStrEmit(); | 935 Ostream &Str = Func->getContext()->getStrEmit(); |
| 951 assert(getSrcSize() == 2); | 936 assert(getSrcSize() == 2); |
| 952 Str << "\t" | 937 Str << "\t" |
| 953 << "sub" | 938 << "sub" |
| 954 << "\t"; | 939 << "\t"; |
| 955 getDest()->emit(Func); | 940 getDest()->emit(Func); |
| 956 Str << ", "; | 941 Str << ", "; |
| 957 getSrc(0)->emit(Func); | 942 getSrc(0)->emit(Func); |
| 958 Str << ", "; | 943 Str << ", "; |
| 959 getSrc(1)->emit(Func); | 944 getSrc(1)->emit(Func); |
| 960 Func->getTarget()->updateStackAdjustment(Amount); | 945 Func->getTarget()->updateStackAdjustment(Amount); |
| 961 } | 946 } |
| 962 | 947 |
| 963 void InstARM32AdjustStack::emitIAS(const Cfg *Func) const { | |
| 964 (void)Func; | |
| 965 llvm_unreachable("Not yet implemented"); | |
| 966 Func->getTarget()->updateStackAdjustment(Amount); | |
| 967 } | |
| 968 | |
| 969 void InstARM32AdjustStack::dump(const Cfg *Func) const { | 948 void InstARM32AdjustStack::dump(const Cfg *Func) const { |
| 970 if (!BuildDefs::dump()) | 949 if (!BuildDefs::dump()) |
| 971 return; | 950 return; |
| 972 Ostream &Str = Func->getContext()->getStrDump(); | 951 Ostream &Str = Func->getContext()->getStrDump(); |
| 973 getDest()->dump(Func); | 952 getDest()->dump(Func); |
| 974 Str << " = sub.i32 "; | 953 Str << " = sub.i32 "; |
| 975 getSrc(0)->dump(Func); | 954 getSrc(0)->dump(Func); |
| 976 Str << ", " << Amount << " ; "; | 955 Str << ", " << Amount << " ; "; |
| 977 getSrc(1)->dump(Func); | 956 getSrc(1)->dump(Func); |
| 978 } | 957 } |
| (...skipping 30 matching lines...) Expand all Loading... |
| 1009 if (PrintComma) | 988 if (PrintComma) |
| 1010 Str << ", "; | 989 Str << ", "; |
| 1011 Op->emit(Func); | 990 Op->emit(Func); |
| 1012 PrintComma = true; | 991 PrintComma = true; |
| 1013 } | 992 } |
| 1014 } | 993 } |
| 1015 Str << "}\n"; | 994 Str << "}\n"; |
| 1016 } | 995 } |
| 1017 } | 996 } |
| 1018 | 997 |
| 1019 void InstARM32Push::emitIAS(const Cfg *Func) const { | |
| 1020 (void)Func; | |
| 1021 llvm_unreachable("Not yet implemented"); | |
| 1022 } | |
| 1023 | |
| 1024 void InstARM32Push::dump(const Cfg *Func) const { | 998 void InstARM32Push::dump(const Cfg *Func) const { |
| 1025 if (!BuildDefs::dump()) | 999 if (!BuildDefs::dump()) |
| 1026 return; | 1000 return; |
| 1027 Ostream &Str = Func->getContext()->getStrDump(); | 1001 Ostream &Str = Func->getContext()->getStrDump(); |
| 1028 Str << "push" | 1002 Str << "push" |
| 1029 << " "; | 1003 << " "; |
| 1030 dumpSources(Func); | 1004 dumpSources(Func); |
| 1031 } | 1005 } |
| 1032 | 1006 |
| 1033 void InstARM32Ret::emit(const Cfg *Func) const { | 1007 void InstARM32Ret::emit(const Cfg *Func) const { |
| 1034 if (!BuildDefs::dump()) | 1008 if (!BuildDefs::dump()) |
| 1035 return; | 1009 return; |
| 1036 assert(getSrcSize() > 0); | 1010 assert(getSrcSize() > 0); |
| 1037 Variable *LR = llvm::cast<Variable>(getSrc(0)); | 1011 Variable *LR = llvm::cast<Variable>(getSrc(0)); |
| 1038 assert(LR->hasReg()); | 1012 assert(LR->hasReg()); |
| 1039 assert(LR->getRegNum() == RegARM32::Reg_lr); | 1013 assert(LR->getRegNum() == RegARM32::Reg_lr); |
| 1040 Ostream &Str = Func->getContext()->getStrEmit(); | 1014 Ostream &Str = Func->getContext()->getStrEmit(); |
| 1041 Str << "\t" | 1015 Str << "\t" |
| 1042 << "bx" | 1016 << "bx" |
| 1043 << "\t"; | 1017 << "\t"; |
| 1044 LR->emit(Func); | 1018 LR->emit(Func); |
| 1045 } | 1019 } |
| 1046 | 1020 |
| 1047 void InstARM32Ret::emitIAS(const Cfg *Func) const { | 1021 void InstARM32Ret::emitIAS(const Cfg *Func) const { |
| 1048 ARM32::AssemblerARM32 *Asm = Func->getAssembler<ARM32::AssemblerARM32>(); | 1022 ARM32::AssemblerARM32 *Asm = Func->getAssembler<ARM32::AssemblerARM32>(); |
| 1049 Asm->bx(RegARM32::Encoded_Reg_lr); | 1023 if (!Asm->bx(RegARM32::Encoded_Reg_lr)) |
| 1024 emitUsingTextFixup(Func); |
| 1050 } | 1025 } |
| 1051 | 1026 |
| 1052 void InstARM32Ret::dump(const Cfg *Func) const { | 1027 void InstARM32Ret::dump(const Cfg *Func) const { |
| 1053 if (!BuildDefs::dump()) | 1028 if (!BuildDefs::dump()) |
| 1054 return; | 1029 return; |
| 1055 Ostream &Str = Func->getContext()->getStrDump(); | 1030 Ostream &Str = Func->getContext()->getStrDump(); |
| 1056 Type Ty = (getSrcSize() == 1 ? IceType_void : getSrc(0)->getType()); | 1031 Type Ty = (getSrcSize() == 1 ? IceType_void : getSrc(0)->getType()); |
| 1057 Str << "ret." << Ty << " "; | 1032 Str << "ret." << Ty << " "; |
| 1058 dumpSources(Func); | 1033 dumpSources(Func); |
| 1059 } | 1034 } |
| 1060 | 1035 |
| 1061 void InstARM32Str::emit(const Cfg *Func) const { | 1036 void InstARM32Str::emit(const Cfg *Func) const { |
| 1062 if (!BuildDefs::dump()) | 1037 if (!BuildDefs::dump()) |
| 1063 return; | 1038 return; |
| 1064 Ostream &Str = Func->getContext()->getStrEmit(); | 1039 Ostream &Str = Func->getContext()->getStrEmit(); |
| 1065 assert(getSrcSize() == 2); | 1040 assert(getSrcSize() == 2); |
| 1066 Type Ty = getSrc(0)->getType(); | 1041 Type Ty = getSrc(0)->getType(); |
| 1067 const bool IsVectorStore = isVectorType(Ty); | 1042 const bool IsVectorStore = isVectorType(Ty); |
| 1068 const char *Opcode = | 1043 const char *Opcode = |
| 1069 IsVectorStore ? "vst1" : (isScalarFloatingType(Ty) ? "vstr" : "str"); | 1044 IsVectorStore ? "vst1" : (isScalarFloatingType(Ty) ? "vstr" : "str"); |
| 1070 const char *VecEltWidthString = IsVectorStore ? ".64" : ""; | 1045 const char *VecEltWidthString = IsVectorStore ? ".64" : ""; |
| 1071 Str << "\t" << Opcode << getWidthString(Ty) << getPredicate() | 1046 Str << "\t" << Opcode << getWidthString(Ty) << getPredicate() |
| 1072 << VecEltWidthString << "\t"; | 1047 << VecEltWidthString << "\t"; |
| 1073 getSrc(0)->emit(Func); | 1048 getSrc(0)->emit(Func); |
| 1074 Str << ", "; | 1049 Str << ", "; |
| 1075 getSrc(1)->emit(Func); | 1050 getSrc(1)->emit(Func); |
| 1076 } | 1051 } |
| 1077 | 1052 |
| 1078 void InstARM32Str::emitIAS(const Cfg *Func) const { | |
| 1079 assert(getSrcSize() == 2); | |
| 1080 (void)Func; | |
| 1081 llvm_unreachable("Not yet implemented"); | |
| 1082 } | |
| 1083 | |
| 1084 void InstARM32Str::dump(const Cfg *Func) const { | 1053 void InstARM32Str::dump(const Cfg *Func) const { |
| 1085 if (!BuildDefs::dump()) | 1054 if (!BuildDefs::dump()) |
| 1086 return; | 1055 return; |
| 1087 Ostream &Str = Func->getContext()->getStrDump(); | 1056 Ostream &Str = Func->getContext()->getStrDump(); |
| 1088 Type Ty = getSrc(0)->getType(); | 1057 Type Ty = getSrc(0)->getType(); |
| 1089 dumpOpcodePred(Str, "str", Ty); | 1058 dumpOpcodePred(Str, "str", Ty); |
| 1090 Str << " "; | 1059 Str << " "; |
| 1091 getSrc(1)->dump(Func); | 1060 getSrc(1)->dump(Func); |
| 1092 Str << ", "; | 1061 Str << ", "; |
| 1093 getSrc(0)->dump(Func); | 1062 getSrc(0)->dump(Func); |
| 1094 } | 1063 } |
| 1095 | 1064 |
| 1096 void InstARM32Strex::emit(const Cfg *Func) const { | 1065 void InstARM32Strex::emit(const Cfg *Func) const { |
| 1097 if (!BuildDefs::dump()) | 1066 if (!BuildDefs::dump()) |
| 1098 return; | 1067 return; |
| 1099 assert(getSrcSize() == 2); | 1068 assert(getSrcSize() == 2); |
| 1100 Type Ty = getSrc(0)->getType(); | 1069 Type Ty = getSrc(0)->getType(); |
| 1101 assert(isScalarIntegerType(Ty)); | 1070 assert(isScalarIntegerType(Ty)); |
| 1102 Variable *Dest = getDest(); | 1071 Variable *Dest = getDest(); |
| 1103 Ostream &Str = Func->getContext()->getStrEmit(); | 1072 Ostream &Str = Func->getContext()->getStrEmit(); |
| 1104 static constexpr char Opcode[] = "strex"; | 1073 static constexpr char Opcode[] = "strex"; |
| 1105 const char *WidthString = getWidthString(Ty); | 1074 const char *WidthString = getWidthString(Ty); |
| 1106 Str << "\t" << Opcode << WidthString << getPredicate() << "\t"; | 1075 Str << "\t" << Opcode << WidthString << getPredicate() << "\t"; |
| 1107 Dest->emit(Func); | 1076 Dest->emit(Func); |
| 1108 Str << ", "; | 1077 Str << ", "; |
| 1109 emitSources(Func); | 1078 emitSources(Func); |
| 1110 } | 1079 } |
| 1111 | 1080 |
| 1112 void InstARM32Strex::emitIAS(const Cfg *Func) const { | |
| 1113 assert(getSrcSize() == 2); | |
| 1114 (void)Func; | |
| 1115 llvm_unreachable("Not yet implemented"); | |
| 1116 } | |
| 1117 | |
| 1118 void InstARM32Strex::dump(const Cfg *Func) const { | 1081 void InstARM32Strex::dump(const Cfg *Func) const { |
| 1119 if (!BuildDefs::dump()) | 1082 if (!BuildDefs::dump()) |
| 1120 return; | 1083 return; |
| 1121 Ostream &Str = Func->getContext()->getStrDump(); | 1084 Ostream &Str = Func->getContext()->getStrDump(); |
| 1122 Variable *Dest = getDest(); | 1085 Variable *Dest = getDest(); |
| 1123 Dest->dump(Func); | 1086 Dest->dump(Func); |
| 1124 Str << " = "; | 1087 Str << " = "; |
| 1125 Type Ty = getSrc(0)->getType(); | 1088 Type Ty = getSrc(0)->getType(); |
| 1126 dumpOpcodePred(Str, "strex", Ty); | 1089 dumpOpcodePred(Str, "strex", Ty); |
| 1127 Str << " "; | 1090 Str << " "; |
| 1128 getSrc(1)->dump(Func); | 1091 getSrc(1)->dump(Func); |
| 1129 Str << ", "; | 1092 Str << ", "; |
| 1130 getSrc(0)->dump(Func); | 1093 getSrc(0)->dump(Func); |
| 1131 } | 1094 } |
| 1132 | 1095 |
| 1133 void InstARM32Trap::emit(const Cfg *Func) const { | 1096 void InstARM32Trap::emit(const Cfg *Func) const { |
| 1134 if (!BuildDefs::dump()) | 1097 if (!BuildDefs::dump()) |
| 1135 return; | 1098 return; |
| 1136 Ostream &Str = Func->getContext()->getStrEmit(); | 1099 Ostream &Str = Func->getContext()->getStrEmit(); |
| 1137 assert(getSrcSize() == 0); | 1100 assert(getSrcSize() == 0); |
| 1138 // There isn't a mnemonic for the special NaCl Trap encoding, so dump | 1101 // There isn't a mnemonic for the special NaCl Trap encoding, so dump |
| 1139 // the raw bytes. | 1102 // the raw bytes. |
| 1140 Str << "\t.long 0x"; | 1103 Str << "\t.long 0x"; |
| 1141 ARM32::AssemblerARM32 *Asm = Func->getAssembler<ARM32::AssemblerARM32>(); | 1104 ARM32::AssemblerARM32 *Asm = Func->getAssembler<ARM32::AssemblerARM32>(); |
| 1142 for (uint8_t I : Asm->getNonExecBundlePadding()) { | 1105 for (uint8_t I : Asm->getNonExecBundlePadding()) { |
| 1143 Str.write_hex(I); | 1106 Str.write_hex(I); |
| 1144 } | 1107 } |
| 1145 } | 1108 } |
| 1146 | 1109 |
| 1147 void InstARM32Trap::emitIAS(const Cfg *Func) const { | |
| 1148 assert(getSrcSize() == 0); | |
| 1149 (void)Func; | |
| 1150 llvm_unreachable("Not yet implemented"); | |
| 1151 } | |
| 1152 | |
| 1153 void InstARM32Trap::dump(const Cfg *Func) const { | 1110 void InstARM32Trap::dump(const Cfg *Func) const { |
| 1154 if (!BuildDefs::dump()) | 1111 if (!BuildDefs::dump()) |
| 1155 return; | 1112 return; |
| 1156 Ostream &Str = Func->getContext()->getStrDump(); | 1113 Ostream &Str = Func->getContext()->getStrDump(); |
| 1157 Str << "trap"; | 1114 Str << "trap"; |
| 1158 } | 1115 } |
| 1159 | 1116 |
| 1160 void InstARM32Umull::emit(const Cfg *Func) const { | 1117 void InstARM32Umull::emit(const Cfg *Func) const { |
| 1161 if (!BuildDefs::dump()) | 1118 if (!BuildDefs::dump()) |
| 1162 return; | 1119 return; |
| 1163 Ostream &Str = Func->getContext()->getStrEmit(); | 1120 Ostream &Str = Func->getContext()->getStrEmit(); |
| 1164 assert(getSrcSize() == 2); | 1121 assert(getSrcSize() == 2); |
| 1165 assert(getDest()->hasReg()); | 1122 assert(getDest()->hasReg()); |
| 1166 Str << "\t" | 1123 Str << "\t" |
| 1167 << "umull" << getPredicate() << "\t"; | 1124 << "umull" << getPredicate() << "\t"; |
| 1168 getDest()->emit(Func); | 1125 getDest()->emit(Func); |
| 1169 Str << ", "; | 1126 Str << ", "; |
| 1170 DestHi->emit(Func); | 1127 DestHi->emit(Func); |
| 1171 Str << ", "; | 1128 Str << ", "; |
| 1172 getSrc(0)->emit(Func); | 1129 getSrc(0)->emit(Func); |
| 1173 Str << ", "; | 1130 Str << ", "; |
| 1174 getSrc(1)->emit(Func); | 1131 getSrc(1)->emit(Func); |
| 1175 } | 1132 } |
| 1176 | 1133 |
| 1177 void InstARM32Umull::emitIAS(const Cfg *Func) const { | |
| 1178 assert(getSrcSize() == 2); | |
| 1179 (void)Func; | |
| 1180 llvm_unreachable("Not yet implemented"); | |
| 1181 } | |
| 1182 | |
| 1183 void InstARM32Umull::dump(const Cfg *Func) const { | 1134 void InstARM32Umull::dump(const Cfg *Func) const { |
| 1184 if (!BuildDefs::dump()) | 1135 if (!BuildDefs::dump()) |
| 1185 return; | 1136 return; |
| 1186 Ostream &Str = Func->getContext()->getStrDump(); | 1137 Ostream &Str = Func->getContext()->getStrDump(); |
| 1187 dumpDest(Func); | 1138 dumpDest(Func); |
| 1188 Str << " = "; | 1139 Str << " = "; |
| 1189 dumpOpcodePred(Str, "umull", getDest()->getType()); | 1140 dumpOpcodePred(Str, "umull", getDest()->getType()); |
| 1190 Str << " "; | 1141 Str << " "; |
| 1191 dumpSources(Func); | 1142 dumpSources(Func); |
| 1192 } | 1143 } |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1225 Ostream &Str = Func->getContext()->getStrEmit(); | 1176 Ostream &Str = Func->getContext()->getStrEmit(); |
| 1226 assert(getSrcSize() == 1); | 1177 assert(getSrcSize() == 1); |
| 1227 assert(getDest()->hasReg()); | 1178 assert(getDest()->hasReg()); |
| 1228 Str << "\t" | 1179 Str << "\t" |
| 1229 << "vcvt" << getPredicate() << vcvtVariantSuffix(Variant) << "\t"; | 1180 << "vcvt" << getPredicate() << vcvtVariantSuffix(Variant) << "\t"; |
| 1230 getDest()->emit(Func); | 1181 getDest()->emit(Func); |
| 1231 Str << ", "; | 1182 Str << ", "; |
| 1232 getSrc(0)->emit(Func); | 1183 getSrc(0)->emit(Func); |
| 1233 } | 1184 } |
| 1234 | 1185 |
| 1235 void InstARM32Vcvt::emitIAS(const Cfg *Func) const { | |
| 1236 assert(getSrcSize() == 1); | |
| 1237 (void)Func; | |
| 1238 llvm_unreachable("Not yet implemented"); | |
| 1239 } | |
| 1240 | |
| 1241 void InstARM32Vcvt::dump(const Cfg *Func) const { | 1186 void InstARM32Vcvt::dump(const Cfg *Func) const { |
| 1242 if (!BuildDefs::dump()) | 1187 if (!BuildDefs::dump()) |
| 1243 return; | 1188 return; |
| 1244 Ostream &Str = Func->getContext()->getStrDump(); | 1189 Ostream &Str = Func->getContext()->getStrDump(); |
| 1245 dumpDest(Func); | 1190 dumpDest(Func); |
| 1246 Str << " = " | 1191 Str << " = " |
| 1247 << "vcvt" << getPredicate() << vcvtVariantSuffix(Variant) << " "; | 1192 << "vcvt" << getPredicate() << vcvtVariantSuffix(Variant) << " "; |
| 1248 dumpSources(Func); | 1193 dumpSources(Func); |
| 1249 } | 1194 } |
| 1250 | 1195 |
| 1251 void InstARM32Vcmp::emit(const Cfg *Func) const { | 1196 void InstARM32Vcmp::emit(const Cfg *Func) const { |
| 1252 if (!BuildDefs::dump()) | 1197 if (!BuildDefs::dump()) |
| 1253 return; | 1198 return; |
| 1254 Ostream &Str = Func->getContext()->getStrEmit(); | 1199 Ostream &Str = Func->getContext()->getStrEmit(); |
| 1255 assert(getSrcSize() == 2); | 1200 assert(getSrcSize() == 2); |
| 1256 Str << "\t" | 1201 Str << "\t" |
| 1257 "vcmp" << getPredicate() << getVecWidthString(getSrc(0)->getType()) | 1202 "vcmp" << getPredicate() << getVecWidthString(getSrc(0)->getType()) |
| 1258 << "\t"; | 1203 << "\t"; |
| 1259 getSrc(0)->emit(Func); | 1204 getSrc(0)->emit(Func); |
| 1260 Str << ", "; | 1205 Str << ", "; |
| 1261 getSrc(1)->emit(Func); | 1206 getSrc(1)->emit(Func); |
| 1262 } | 1207 } |
| 1263 | 1208 |
| 1264 void InstARM32Vcmp::emitIAS(const Cfg *Func) const { | |
| 1265 assert(getSrcSize() == 2); | |
| 1266 (void)Func; | |
| 1267 llvm_unreachable("Not yet implemented"); | |
| 1268 } | |
| 1269 | |
| 1270 void InstARM32Vcmp::dump(const Cfg *Func) const { | 1209 void InstARM32Vcmp::dump(const Cfg *Func) const { |
| 1271 if (!BuildDefs::dump()) | 1210 if (!BuildDefs::dump()) |
| 1272 return; | 1211 return; |
| 1273 Ostream &Str = Func->getContext()->getStrDump(); | 1212 Ostream &Str = Func->getContext()->getStrDump(); |
| 1274 Str << "vcmp" << getPredicate() << getVecWidthString(getSrc(0)->getType()); | 1213 Str << "vcmp" << getPredicate() << getVecWidthString(getSrc(0)->getType()); |
| 1275 dumpSources(Func); | 1214 dumpSources(Func); |
| 1276 } | 1215 } |
| 1277 | 1216 |
| 1278 void InstARM32Vmrs::emit(const Cfg *Func) const { | 1217 void InstARM32Vmrs::emit(const Cfg *Func) const { |
| 1279 if (!BuildDefs::dump()) | 1218 if (!BuildDefs::dump()) |
| 1280 return; | 1219 return; |
| 1281 Ostream &Str = Func->getContext()->getStrEmit(); | 1220 Ostream &Str = Func->getContext()->getStrEmit(); |
| 1282 assert(getSrcSize() == 0); | 1221 assert(getSrcSize() == 0); |
| 1283 Str << "\t" | 1222 Str << "\t" |
| 1284 "vmrs" << getPredicate() << "\t" | 1223 "vmrs" << getPredicate() << "\t" |
| 1285 "APSR_nzcv" | 1224 "APSR_nzcv" |
| 1286 ", " | 1225 ", " |
| 1287 "FPSCR"; | 1226 "FPSCR"; |
| 1288 } | 1227 } |
| 1289 | 1228 |
| 1290 void InstARM32Vmrs::emitIAS(const Cfg *Func) const { | |
| 1291 assert(getSrcSize() == 0); | |
| 1292 (void)Func; | |
| 1293 llvm_unreachable("Not yet implemented"); | |
| 1294 } | |
| 1295 | |
| 1296 void InstARM32Vmrs::dump(const Cfg *Func) const { | 1229 void InstARM32Vmrs::dump(const Cfg *Func) const { |
| 1297 if (!BuildDefs::dump()) | 1230 if (!BuildDefs::dump()) |
| 1298 return; | 1231 return; |
| 1299 Ostream &Str = Func->getContext()->getStrDump(); | 1232 Ostream &Str = Func->getContext()->getStrDump(); |
| 1300 Str << "APSR{n,z,v,c} = vmrs" << getPredicate() << "\t" | 1233 Str << "APSR{n,z,v,c} = vmrs" << getPredicate() << "\t" |
| 1301 "FPSCR{n,z,c,v}"; | 1234 "FPSCR{n,z,c,v}"; |
| 1302 } | 1235 } |
| 1303 | 1236 |
| 1304 void InstARM32Vabs::emit(const Cfg *Func) const { | 1237 void InstARM32Vabs::emit(const Cfg *Func) const { |
| 1305 if (!BuildDefs::dump()) | 1238 if (!BuildDefs::dump()) |
| 1306 return; | 1239 return; |
| 1307 Ostream &Str = Func->getContext()->getStrEmit(); | 1240 Ostream &Str = Func->getContext()->getStrEmit(); |
| 1308 assert(getSrcSize() == 1); | 1241 assert(getSrcSize() == 1); |
| 1309 Str << "\t" | 1242 Str << "\t" |
| 1310 "vabs" << getPredicate() << getVecWidthString(getSrc(0)->getType()) | 1243 "vabs" << getPredicate() << getVecWidthString(getSrc(0)->getType()) |
| 1311 << "\t"; | 1244 << "\t"; |
| 1312 getDest()->emit(Func); | 1245 getDest()->emit(Func); |
| 1313 Str << ", "; | 1246 Str << ", "; |
| 1314 getSrc(0)->emit(Func); | 1247 getSrc(0)->emit(Func); |
| 1315 } | 1248 } |
| 1316 | 1249 |
| 1317 void InstARM32Vabs::emitIAS(const Cfg *Func) const { | |
| 1318 assert(getSrcSize() == 1); | |
| 1319 (void)Func; | |
| 1320 llvm_unreachable("Not yet implemented"); | |
| 1321 } | |
| 1322 | |
| 1323 void InstARM32Vabs::dump(const Cfg *Func) const { | 1250 void InstARM32Vabs::dump(const Cfg *Func) const { |
| 1324 if (!BuildDefs::dump()) | 1251 if (!BuildDefs::dump()) |
| 1325 return; | 1252 return; |
| 1326 Ostream &Str = Func->getContext()->getStrDump(); | 1253 Ostream &Str = Func->getContext()->getStrDump(); |
| 1327 dumpDest(Func); | 1254 dumpDest(Func); |
| 1328 Str << " = vabs" << getPredicate() << getVecWidthString(getSrc(0)->getType()); | 1255 Str << " = vabs" << getPredicate() << getVecWidthString(getSrc(0)->getType()); |
| 1329 } | 1256 } |
| 1330 | 1257 |
| 1331 void InstARM32Dmb::emit(const Cfg *Func) const { | 1258 void InstARM32Dmb::emit(const Cfg *Func) const { |
| 1332 if (!BuildDefs::dump()) | 1259 if (!BuildDefs::dump()) |
| 1333 return; | 1260 return; |
| 1334 Ostream &Str = Func->getContext()->getStrEmit(); | 1261 Ostream &Str = Func->getContext()->getStrEmit(); |
| 1335 assert(getSrcSize() == 0); | 1262 assert(getSrcSize() == 0); |
| 1336 Str << "\t" | 1263 Str << "\t" |
| 1337 "dmb" | 1264 "dmb" |
| 1338 "\t" | 1265 "\t" |
| 1339 "sy"; | 1266 "sy"; |
| 1340 } | 1267 } |
| 1341 | 1268 |
| 1342 void InstARM32Dmb::emitIAS(const Cfg *Func) const { | |
| 1343 assert(getSrcSize() == 1); | |
| 1344 (void)Func; | |
| 1345 llvm_unreachable("Not yet implemented"); | |
| 1346 } | |
| 1347 | |
| 1348 void InstARM32Dmb::dump(const Cfg *Func) const { | 1269 void InstARM32Dmb::dump(const Cfg *Func) const { |
| 1349 if (!BuildDefs::dump()) | 1270 if (!BuildDefs::dump()) |
| 1350 return; | 1271 return; |
| 1351 Func->getContext()->getStrDump() << "dmb\tsy"; | 1272 Func->getContext()->getStrDump() << "dmb\tsy"; |
| 1352 } | 1273 } |
| 1353 | 1274 |
| 1354 void OperandARM32Mem::emit(const Cfg *Func) const { | 1275 void OperandARM32Mem::emit(const Cfg *Func) const { |
| 1355 if (!BuildDefs::dump()) | 1276 if (!BuildDefs::dump()) |
| 1356 return; | 1277 return; |
| 1357 Ostream &Str = Func->getContext()->getStrEmit(); | 1278 Ostream &Str = Func->getContext()->getStrEmit(); |
| (...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1479 template class InstARM32ThreeAddrGPR<InstARM32::Eor>; | 1400 template class InstARM32ThreeAddrGPR<InstARM32::Eor>; |
| 1480 template class InstARM32ThreeAddrGPR<InstARM32::Lsl>; | 1401 template class InstARM32ThreeAddrGPR<InstARM32::Lsl>; |
| 1481 template class InstARM32ThreeAddrGPR<InstARM32::Lsr>; | 1402 template class InstARM32ThreeAddrGPR<InstARM32::Lsr>; |
| 1482 template class InstARM32ThreeAddrGPR<InstARM32::Mul>; | 1403 template class InstARM32ThreeAddrGPR<InstARM32::Mul>; |
| 1483 template class InstARM32ThreeAddrGPR<InstARM32::Orr>; | 1404 template class InstARM32ThreeAddrGPR<InstARM32::Orr>; |
| 1484 template class InstARM32ThreeAddrGPR<InstARM32::Rsb>; | 1405 template class InstARM32ThreeAddrGPR<InstARM32::Rsb>; |
| 1485 template class InstARM32ThreeAddrGPR<InstARM32::Sbc>; | 1406 template class InstARM32ThreeAddrGPR<InstARM32::Sbc>; |
| 1486 template class InstARM32ThreeAddrGPR<InstARM32::Sdiv>; | 1407 template class InstARM32ThreeAddrGPR<InstARM32::Sdiv>; |
| 1487 template class InstARM32ThreeAddrGPR<InstARM32::Sub>; | 1408 template class InstARM32ThreeAddrGPR<InstARM32::Sub>; |
| 1488 template class InstARM32ThreeAddrGPR<InstARM32::Udiv>; | 1409 template class InstARM32ThreeAddrGPR<InstARM32::Udiv>; |
| 1410 |
| 1489 template class InstARM32ThreeAddrFP<InstARM32::Vadd>; | 1411 template class InstARM32ThreeAddrFP<InstARM32::Vadd>; |
| 1490 template class InstARM32ThreeAddrFP<InstARM32::Vdiv>; | 1412 template class InstARM32ThreeAddrFP<InstARM32::Vdiv>; |
| 1491 template class InstARM32ThreeAddrFP<InstARM32::Vmul>; | 1413 template class InstARM32ThreeAddrFP<InstARM32::Vmul>; |
| 1492 template class InstARM32ThreeAddrFP<InstARM32::Vsub>; | 1414 template class InstARM32ThreeAddrFP<InstARM32::Vsub>; |
| 1493 | 1415 |
| 1416 template class InstARM32TwoAddrGPR<InstARM32::Movt>; |
| 1417 |
| 1494 } // end of namespace Ice | 1418 } // end of namespace Ice |
| OLD | NEW |