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

Side by Side Diff: src/IceInstARM32.cpp

Issue 1516863003: Add various forms of LDREX/STREX to ARM integrated assembler. (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: Update Dart files and fix nits. Created 5 years 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 1156 matching lines...) Expand 10 before | Expand all | Expand 10 after
1167 Variable *Dest = getDest(); 1167 Variable *Dest = getDest();
1168 Type DestTy = Dest->getType(); 1168 Type DestTy = Dest->getType();
1169 assert(isScalarIntegerType(DestTy)); 1169 assert(isScalarIntegerType(DestTy));
1170 const char *WidthString = getWidthString(DestTy); 1170 const char *WidthString = getWidthString(DestTy);
1171 Str << "\t" << Opcode << WidthString << getPredicate() << "\t"; 1171 Str << "\t" << Opcode << WidthString << getPredicate() << "\t";
1172 getDest()->emit(Func); 1172 getDest()->emit(Func);
1173 Str << ", "; 1173 Str << ", ";
1174 getSrc(0)->emit(Func); 1174 getSrc(0)->emit(Func);
1175 } 1175 }
1176 1176
1177 template <> void InstARM32Ldrex::emitIAS(const Cfg *Func) const {
1178 assert(getSrcSize() == 1);
1179 assert(getDest()->hasReg());
1180 Variable *Dest = getDest();
1181 assert(isScalarIntegerType(Dest->getType()));
1182 auto *Asm = Func->getAssembler<ARM32::AssemblerARM32>();
1183 Asm->ldrex(Dest, getSrc(0), getPredicate(), Func->getTarget());
1184 if (Asm->needsTextFixup())
1185 emitUsingTextFixup(Func);
1186 }
1187
1177 template <InstARM32::InstKindARM32 K> 1188 template <InstARM32::InstKindARM32 K>
1178 void InstARM32TwoAddrGPR<K>::emitIAS(const Cfg *Func) const { 1189 void InstARM32TwoAddrGPR<K>::emitIAS(const Cfg *Func) const {
1179 emitUsingTextFixup(Func); 1190 emitUsingTextFixup(Func);
1180 } 1191 }
1181 1192
1182 template <InstARM32::InstKindARM32 K, bool Nws> 1193 template <InstARM32::InstKindARM32 K, bool Nws>
1183 void InstARM32UnaryopGPR<K, Nws>::emitIAS(const Cfg *Func) const { 1194 void InstARM32UnaryopGPR<K, Nws>::emitIAS(const Cfg *Func) const {
1184 emitUsingTextFixup(Func); 1195 emitUsingTextFixup(Func);
1185 } 1196 }
1186 1197
(...skipping 373 matching lines...) Expand 10 before | Expand all | Expand 10 after
1560 Variable *Dest = getDest(); 1571 Variable *Dest = getDest();
1561 Ostream &Str = Func->getContext()->getStrEmit(); 1572 Ostream &Str = Func->getContext()->getStrEmit();
1562 static constexpr char Opcode[] = "strex"; 1573 static constexpr char Opcode[] = "strex";
1563 const char *WidthString = getWidthString(Ty); 1574 const char *WidthString = getWidthString(Ty);
1564 Str << "\t" << Opcode << WidthString << getPredicate() << "\t"; 1575 Str << "\t" << Opcode << WidthString << getPredicate() << "\t";
1565 Dest->emit(Func); 1576 Dest->emit(Func);
1566 Str << ", "; 1577 Str << ", ";
1567 emitSources(Func); 1578 emitSources(Func);
1568 } 1579 }
1569 1580
1581 void InstARM32Strex::emitIAS(const Cfg *Func) const {
1582 assert(getSrcSize() == 2);
1583 const Operand *Src0 = getSrc(0);
1584 assert(isScalarIntegerType(Src0->getType()));
1585 auto *Asm = Func->getAssembler<ARM32::AssemblerARM32>();
1586 Asm->strex(Dest, Src0, getSrc(1), getPredicate(), Func->getTarget());
1587 if (Asm->needsTextFixup())
1588 emitUsingTextFixup(Func);
1589 }
1590
1570 void InstARM32Strex::dump(const Cfg *Func) const { 1591 void InstARM32Strex::dump(const Cfg *Func) const {
1571 if (!BuildDefs::dump()) 1592 if (!BuildDefs::dump())
1572 return; 1593 return;
1573 Ostream &Str = Func->getContext()->getStrDump(); 1594 Ostream &Str = Func->getContext()->getStrDump();
1574 Variable *Dest = getDest(); 1595 Variable *Dest = getDest();
1575 Dest->dump(Func); 1596 Dest->dump(Func);
1576 Str << " = "; 1597 Str << " = ";
1577 Type Ty = getSrc(0)->getType(); 1598 Type Ty = getSrc(0)->getType();
1578 dumpOpcodePred(Str, "strex", Ty); 1599 dumpOpcodePred(Str, "strex", Ty);
1579 Str << " "; 1600 Str << " ";
(...skipping 440 matching lines...) Expand 10 before | Expand all | Expand 10 after
2020 template class InstARM32UnaryopFP<InstARM32::Vsqrt>; 2041 template class InstARM32UnaryopFP<InstARM32::Vsqrt>;
2021 2042
2022 template class InstARM32FourAddrGPR<InstARM32::Mla>; 2043 template class InstARM32FourAddrGPR<InstARM32::Mla>;
2023 template class InstARM32FourAddrGPR<InstARM32::Mls>; 2044 template class InstARM32FourAddrGPR<InstARM32::Mls>;
2024 2045
2025 template class InstARM32CmpLike<InstARM32::Cmn>; 2046 template class InstARM32CmpLike<InstARM32::Cmn>;
2026 template class InstARM32CmpLike<InstARM32::Cmp>; 2047 template class InstARM32CmpLike<InstARM32::Cmp>;
2027 template class InstARM32CmpLike<InstARM32::Tst>; 2048 template class InstARM32CmpLike<InstARM32::Tst>;
2028 2049
2029 } // end of namespace Ice 2050 } // end of namespace Ice
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698