Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(168)

Side by Side Diff: src/IceInstARM32.cpp

Issue 1414043015: Fix frame pointer loads/stores in the ARM integrated assembler. (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: Fix column issue in test case. Created 5 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 747 matching lines...) Expand 10 before | Expand all | Expand 10 after
758 if (Dest->hasReg()) { 758 if (Dest->hasReg()) {
759 const Type DestTy = Dest->getType(); 759 const Type DestTy = Dest->getType();
760 const bool DestIsVector = isVectorType(DestTy); 760 const bool DestIsVector = isVectorType(DestTy);
761 const bool DestIsScalarFP = isScalarFloatingType(DestTy); 761 const bool DestIsScalarFP = isScalarFloatingType(DestTy);
762 const bool CoreVFPMove = isMoveBetweenCoreAndVFPRegisters(Dest, Src0); 762 const bool CoreVFPMove = isMoveBetweenCoreAndVFPRegisters(Dest, Src0);
763 if (DestIsVector || DestIsScalarFP || CoreVFPMove) 763 if (DestIsVector || DestIsScalarFP || CoreVFPMove)
764 return Asm->setNeedsTextFixup(); 764 return Asm->setNeedsTextFixup();
765 if (isMemoryAccess(Src0)) { 765 if (isMemoryAccess(Src0)) {
766 // TODO(kschimpf) Figure out how to do ldr on CoreVPFMove? (see 766 // TODO(kschimpf) Figure out how to do ldr on CoreVPFMove? (see
767 // emitSingleDestSingleSource, local variable LoadOpcode). 767 // emitSingleDestSingleSource, local variable LoadOpcode).
768 return Asm->ldr(Dest, Src0, getPredicate()); 768 return Asm->ldr(Dest, Src0, getPredicate(), Func->getTarget());
769 } 769 }
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()); 778 return Asm->str(Src0, Dest, getPredicate(), Func->getTarget());
779 } 779 }
780 Asm->setNeedsTextFixup(); 780 Asm->setNeedsTextFixup();
781 } 781 }
782 782
783 void InstARM32Mov::emit(const Cfg *Func) const { 783 void InstARM32Mov::emit(const Cfg *Func) const {
784 if (!BuildDefs::dump()) 784 if (!BuildDefs::dump())
785 return; 785 return;
786 assert(!(isMultiDest() && isMultiSource()) && "Invalid vmov type."); 786 assert(!(isMultiDest() && isMultiSource()) && "Invalid vmov type.");
787 if (isMultiDest()) { 787 if (isMultiDest()) {
788 emitMultiDestSingleSource(Func); 788 emitMultiDestSingleSource(Func);
(...skipping 199 matching lines...) Expand 10 before | Expand all | Expand 10 after
988 988
989 template <> void InstARM32Ldr::emitIAS(const Cfg *Func) const { 989 template <> void InstARM32Ldr::emitIAS(const Cfg *Func) const {
990 assert(getSrcSize() == 1); 990 assert(getSrcSize() == 1);
991 Variable *Dest = getDest(); 991 Variable *Dest = getDest();
992 Type DestTy = Dest->getType(); 992 Type DestTy = Dest->getType();
993 auto *Asm = Func->getAssembler<ARM32::AssemblerARM32>(); 993 auto *Asm = Func->getAssembler<ARM32::AssemblerARM32>();
994 if (isVectorType(DestTy) || isScalarFloatingType(DestTy)) 994 if (isVectorType(DestTy) || isScalarFloatingType(DestTy))
995 // TODO(kschimpf) Handle case. 995 // TODO(kschimpf) Handle case.
996 Asm->setNeedsTextFixup(); 996 Asm->setNeedsTextFixup();
997 else 997 else
998 Asm->ldr(Dest, getSrc(0), getPredicate()); 998 Asm->ldr(Dest, getSrc(0), getPredicate(), Func->getTarget());
999 if (Asm->needsTextFixup()) 999 if (Asm->needsTextFixup())
1000 emitUsingTextFixup(Func); 1000 emitUsingTextFixup(Func);
1001 } 1001 }
1002 1002
1003 template <> void InstARM32Ldrex::emit(const Cfg *Func) const { 1003 template <> void InstARM32Ldrex::emit(const Cfg *Func) const {
1004 if (!BuildDefs::dump()) 1004 if (!BuildDefs::dump())
1005 return; 1005 return;
1006 Ostream &Str = Func->getContext()->getStrEmit(); 1006 Ostream &Str = Func->getContext()->getStrEmit();
1007 assert(getSrcSize() == 1); 1007 assert(getSrcSize() == 1);
1008 assert(getDest()->hasReg()); 1008 assert(getDest()->hasReg());
(...skipping 296 matching lines...) Expand 10 before | Expand all | Expand 10 after
1305 } 1305 }
1306 1306
1307 void InstARM32Str::emitIAS(const Cfg *Func) const { 1307 void InstARM32Str::emitIAS(const Cfg *Func) const {
1308 assert(getSrcSize() == 2); 1308 assert(getSrcSize() == 2);
1309 Type Ty = getSrc(0)->getType(); 1309 Type Ty = getSrc(0)->getType();
1310 auto *Asm = Func->getAssembler<ARM32::AssemblerARM32>(); 1310 auto *Asm = Func->getAssembler<ARM32::AssemblerARM32>();
1311 if (isVectorType(Ty) || isScalarFloatingType(Ty)) 1311 if (isVectorType(Ty) || isScalarFloatingType(Ty))
1312 // TODO(kschimpf) Handle case. 1312 // TODO(kschimpf) Handle case.
1313 Asm->setNeedsTextFixup(); 1313 Asm->setNeedsTextFixup();
1314 else 1314 else
1315 Asm->str(getSrc(0), getSrc(1), getPredicate()); 1315 Asm->str(getSrc(0), getSrc(1), getPredicate(), Func->getTarget());
1316 if (Asm->needsTextFixup()) 1316 if (Asm->needsTextFixup())
1317 emitUsingTextFixup(Func); 1317 emitUsingTextFixup(Func);
1318 } 1318 }
1319 1319
1320 void InstARM32Str::dump(const Cfg *Func) const { 1320 void InstARM32Str::dump(const Cfg *Func) const {
1321 if (!BuildDefs::dump()) 1321 if (!BuildDefs::dump())
1322 return; 1322 return;
1323 Ostream &Str = Func->getContext()->getStrDump(); 1323 Ostream &Str = Func->getContext()->getStrDump();
1324 Type Ty = getSrc(0)->getType(); 1324 Type Ty = getSrc(0)->getType();
1325 dumpOpcodePred(Str, "str", Ty); 1325 dumpOpcodePred(Str, "str", Ty);
(...skipping 376 matching lines...) Expand 10 before | Expand all | Expand 10 after
1702 template class InstARM32UnaryopGPR<InstARM32::Uxt, true>; 1702 template class InstARM32UnaryopGPR<InstARM32::Uxt, true>;
1703 template class InstARM32UnaryopFP<InstARM32::Vsqrt>; 1703 template class InstARM32UnaryopFP<InstARM32::Vsqrt>;
1704 1704
1705 template class InstARM32FourAddrGPR<InstARM32::Mla>; 1705 template class InstARM32FourAddrGPR<InstARM32::Mla>;
1706 template class InstARM32FourAddrGPR<InstARM32::Mls>; 1706 template class InstARM32FourAddrGPR<InstARM32::Mls>;
1707 1707
1708 template class InstARM32CmpLike<InstARM32::Cmp>; 1708 template class InstARM32CmpLike<InstARM32::Cmp>;
1709 template class InstARM32CmpLike<InstARM32::Tst>; 1709 template class InstARM32CmpLike<InstARM32::Tst>;
1710 1710
1711 } // end of namespace Ice 1711 } // end of namespace Ice
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698