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

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: Add comment to 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 348 matching lines...) Expand 10 before | Expand all | Expand 10 after
1357 } 1357 }
1358 1358
1359 void InstARM32Str::emitIAS(const Cfg *Func) const { 1359 void InstARM32Str::emitIAS(const Cfg *Func) const {
1360 assert(getSrcSize() == 2); 1360 assert(getSrcSize() == 2);
1361 Type Ty = getSrc(0)->getType(); 1361 Type Ty = getSrc(0)->getType();
1362 auto *Asm = Func->getAssembler<ARM32::AssemblerARM32>(); 1362 auto *Asm = Func->getAssembler<ARM32::AssemblerARM32>();
1363 if (isVectorType(Ty) || isScalarFloatingType(Ty)) 1363 if (isVectorType(Ty) || isScalarFloatingType(Ty))
1364 // TODO(kschimpf) Handle case. 1364 // TODO(kschimpf) Handle case.
1365 Asm->setNeedsTextFixup(); 1365 Asm->setNeedsTextFixup();
1366 else 1366 else
1367 Asm->str(getSrc(0), getSrc(1), getPredicate()); 1367 Asm->str(getSrc(0), getSrc(1), getPredicate(), Func->getTarget());
1368 if (Asm->needsTextFixup()) 1368 if (Asm->needsTextFixup())
1369 emitUsingTextFixup(Func); 1369 emitUsingTextFixup(Func);
1370 } 1370 }
1371 1371
1372 void InstARM32Str::dump(const Cfg *Func) const { 1372 void InstARM32Str::dump(const Cfg *Func) const {
1373 if (!BuildDefs::dump()) 1373 if (!BuildDefs::dump())
1374 return; 1374 return;
1375 Ostream &Str = Func->getContext()->getStrDump(); 1375 Ostream &Str = Func->getContext()->getStrDump();
1376 Type Ty = getSrc(0)->getType(); 1376 Type Ty = getSrc(0)->getType();
1377 dumpOpcodePred(Str, "str", Ty); 1377 dumpOpcodePred(Str, "str", Ty);
(...skipping 376 matching lines...) Expand 10 before | Expand all | Expand 10 after
1754 template class InstARM32UnaryopGPR<InstARM32::Uxt, true>; 1754 template class InstARM32UnaryopGPR<InstARM32::Uxt, true>;
1755 template class InstARM32UnaryopFP<InstARM32::Vsqrt>; 1755 template class InstARM32UnaryopFP<InstARM32::Vsqrt>;
1756 1756
1757 template class InstARM32FourAddrGPR<InstARM32::Mla>; 1757 template class InstARM32FourAddrGPR<InstARM32::Mla>;
1758 template class InstARM32FourAddrGPR<InstARM32::Mls>; 1758 template class InstARM32FourAddrGPR<InstARM32::Mls>;
1759 1759
1760 template class InstARM32CmpLike<InstARM32::Cmp>; 1760 template class InstARM32CmpLike<InstARM32::Cmp>;
1761 template class InstARM32CmpLike<InstARM32::Tst>; 1761 template class InstARM32CmpLike<InstARM32::Tst>;
1762 1762
1763 } // end of namespace Ice 1763 } // end of namespace Ice
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698