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

Side by Side Diff: src/IceInstARM32.cpp

Issue 1452293003: Add BL (immediate) and BLX (register) to ARM assembler. (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: Fix nits. 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 987 matching lines...) Expand 10 before | Expand all | Expand 10 after
998 CallTarget->emitWithoutPrefix(Func->getTarget()); 998 CallTarget->emitWithoutPrefix(Func->getTarget());
999 } else { 999 } else {
1000 Str << "\t" 1000 Str << "\t"
1001 << "blx" 1001 << "blx"
1002 << "\t"; 1002 << "\t";
1003 getCallTarget()->emit(Func); 1003 getCallTarget()->emit(Func);
1004 } 1004 }
1005 Func->getTarget()->resetStackAdjustment(); 1005 Func->getTarget()->resetStackAdjustment();
1006 } 1006 }
1007 1007
1008 void InstARM32Call::emitIAS(const Cfg *Func) const {
1009 assert(getSrcSize() == 1);
1010 auto *Asm = Func->getAssembler<ARM32::AssemblerARM32>();
1011 if (llvm::isa<ConstantInteger32>(getCallTarget())) {
1012 // This shouldn't happen (typically have to copy the full 32-bits to a
1013 // register and do an indirect jump).
1014 llvm::report_fatal_error("ARM32Call to ConstantInteger32");
1015 } else if (const auto *CallTarget =
1016 llvm::dyn_cast<ConstantRelocatable>(getCallTarget())) {
1017 // Calls only have 24-bits, but the linker should insert veneers to extend
1018 // the range if needed.
1019 Asm->bl(CallTarget);
1020 } else {
1021 Asm->blx(getCallTarget());
1022 }
1023 if (Asm->needsTextFixup())
1024 return emitUsingTextFixup(Func);
1025 Func->getTarget()->resetStackAdjustment();
1026 }
1027
1008 void InstARM32Call::dump(const Cfg *Func) const { 1028 void InstARM32Call::dump(const Cfg *Func) const {
1009 if (!BuildDefs::dump()) 1029 if (!BuildDefs::dump())
1010 return; 1030 return;
1011 Ostream &Str = Func->getContext()->getStrDump(); 1031 Ostream &Str = Func->getContext()->getStrDump();
1012 if (getDest()) { 1032 if (getDest()) {
1013 dumpDest(Func); 1033 dumpDest(Func);
1014 Str << " = "; 1034 Str << " = ";
1015 } 1035 }
1016 Str << "call "; 1036 Str << "call ";
1017 getCallTarget()->dump(Func); 1037 getCallTarget()->dump(Func);
(...skipping 907 matching lines...) Expand 10 before | Expand all | Expand 10 after
1925 template class InstARM32UnaryopFP<InstARM32::Vsqrt>; 1945 template class InstARM32UnaryopFP<InstARM32::Vsqrt>;
1926 1946
1927 template class InstARM32FourAddrGPR<InstARM32::Mla>; 1947 template class InstARM32FourAddrGPR<InstARM32::Mla>;
1928 template class InstARM32FourAddrGPR<InstARM32::Mls>; 1948 template class InstARM32FourAddrGPR<InstARM32::Mls>;
1929 1949
1930 template class InstARM32CmpLike<InstARM32::Cmn>; 1950 template class InstARM32CmpLike<InstARM32::Cmn>;
1931 template class InstARM32CmpLike<InstARM32::Cmp>; 1951 template class InstARM32CmpLike<InstARM32::Cmp>;
1932 template class InstARM32CmpLike<InstARM32::Tst>; 1952 template class InstARM32CmpLike<InstARM32::Tst>;
1933 1953
1934 } // end of namespace Ice 1954 } // end of namespace Ice
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698