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 759 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
770 return Asm->mov(Dest, Src0, getPredicate()); | 770 return Asm->mov(Dest, Src0, getPredicate()); |
771 } else { | 771 } else { |
772 const Type Src0Type = Src0->getType(); | 772 const Type Src0Type = Src0->getType(); |
773 const bool Src0IsVector = isVectorType(Src0Type); | 773 const bool Src0IsVector = isVectorType(Src0Type); |
774 const bool Src0IsScalarFP = isScalarFloatingType(Src0Type); | 774 const bool Src0IsScalarFP = isScalarFloatingType(Src0Type); |
775 const bool CoreVFPMove = isMoveBetweenCoreAndVFPRegisters(Dest, Src0); | 775 const bool CoreVFPMove = isMoveBetweenCoreAndVFPRegisters(Dest, Src0); |
776 if (Src0IsVector || Src0IsScalarFP || CoreVFPMove) | 776 if (Src0IsVector || Src0IsScalarFP || CoreVFPMove) |
777 return Asm->setNeedsTextFixup(); | 777 return Asm->setNeedsTextFixup(); |
778 return Asm->str(Src0, Dest, getPredicate(), Func->getTarget()); | 778 return Asm->str(Src0, Dest, getPredicate(), Func->getTarget()); |
779 } | 779 } |
780 Asm->setNeedsTextFixup(); | |
781 } | 780 } |
782 | 781 |
783 void InstARM32Mov::emit(const Cfg *Func) const { | 782 void InstARM32Mov::emit(const Cfg *Func) const { |
784 if (!BuildDefs::dump()) | 783 if (!BuildDefs::dump()) |
785 return; | 784 return; |
786 assert(!(isMultiDest() && isMultiSource()) && "Invalid vmov type."); | 785 assert(!(isMultiDest() && isMultiSource()) && "Invalid vmov type."); |
787 if (isMultiDest()) { | 786 if (isMultiDest()) { |
788 emitMultiDestSingleSource(Func); | 787 emitMultiDestSingleSource(Func); |
789 return; | 788 return; |
790 } | 789 } |
791 | 790 |
792 if (isMultiSource()) { | 791 if (isMultiSource()) { |
793 emitSingleDestMultiSource(Func); | 792 emitSingleDestMultiSource(Func); |
794 return; | 793 return; |
795 } | 794 } |
796 | 795 |
797 emitSingleDestSingleSource(Func); | 796 emitSingleDestSingleSource(Func); |
798 } | 797 } |
799 | 798 |
800 void InstARM32Mov::emitIAS(const Cfg *Func) const { | 799 void InstARM32Mov::emitIAS(const Cfg *Func) const { |
801 if (!Func->getContext()->getFlags().getAllowUnsafeIas()) | |
802 return emitUsingTextFixup(Func); | |
803 assert(!(isMultiDest() && isMultiSource()) && "Invalid vmov type."); | 800 assert(!(isMultiDest() && isMultiSource()) && "Invalid vmov type."); |
804 auto *Asm = Func->getAssembler<ARM32::AssemblerARM32>(); | 801 auto *Asm = Func->getAssembler<ARM32::AssemblerARM32>(); |
805 if (!(isMultiDest() || isMultiSource())) { | 802 if (!(isMultiDest() || isMultiSource())) |
806 // Must be single source/dest. | 803 // Must be single source/dest. |
807 emitIASSingleDestSingleSource(Func); | 804 emitIASSingleDestSingleSource(Func); |
808 } | 805 else |
| 806 Asm->setNeedsTextFixup(); |
809 if (Asm->needsTextFixup()) | 807 if (Asm->needsTextFixup()) |
810 emitUsingTextFixup(Func); | 808 emitUsingTextFixup(Func); |
811 } | 809 } |
812 | 810 |
813 void InstARM32Mov::dump(const Cfg *Func) const { | 811 void InstARM32Mov::dump(const Cfg *Func) const { |
814 if (!BuildDefs::dump()) | 812 if (!BuildDefs::dump()) |
815 return; | 813 return; |
816 assert(getSrcSize() == 1 || getSrcSize() == 2); | 814 assert(getSrcSize() == 1 || getSrcSize() == 2); |
817 Ostream &Str = Func->getContext()->getStrDump(); | 815 Ostream &Str = Func->getContext()->getStrDump(); |
818 Variable *Dest = getDest(); | 816 Variable *Dest = getDest(); |
(...skipping 948 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1767 template class InstARM32UnaryopGPR<InstARM32::Uxt, true>; | 1765 template class InstARM32UnaryopGPR<InstARM32::Uxt, true>; |
1768 template class InstARM32UnaryopFP<InstARM32::Vsqrt>; | 1766 template class InstARM32UnaryopFP<InstARM32::Vsqrt>; |
1769 | 1767 |
1770 template class InstARM32FourAddrGPR<InstARM32::Mla>; | 1768 template class InstARM32FourAddrGPR<InstARM32::Mla>; |
1771 template class InstARM32FourAddrGPR<InstARM32::Mls>; | 1769 template class InstARM32FourAddrGPR<InstARM32::Mls>; |
1772 | 1770 |
1773 template class InstARM32CmpLike<InstARM32::Cmp>; | 1771 template class InstARM32CmpLike<InstARM32::Cmp>; |
1774 template class InstARM32CmpLike<InstARM32::Tst>; | 1772 template class InstARM32CmpLike<InstARM32::Tst>; |
1775 | 1773 |
1776 } // end of namespace Ice | 1774 } // end of namespace Ice |
OLD | NEW |