| 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 1163 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1174 Variable *Dest = getDest(); | 1174 Variable *Dest = getDest(); |
| 1175 Type DestTy = Dest->getType(); | 1175 Type DestTy = Dest->getType(); |
| 1176 assert(isScalarIntegerType(DestTy)); | 1176 assert(isScalarIntegerType(DestTy)); |
| 1177 const char *WidthString = getWidthString(DestTy); | 1177 const char *WidthString = getWidthString(DestTy); |
| 1178 Str << "\t" << Opcode << WidthString << getPredicate() << "\t"; | 1178 Str << "\t" << Opcode << WidthString << getPredicate() << "\t"; |
| 1179 getDest()->emit(Func); | 1179 getDest()->emit(Func); |
| 1180 Str << ", "; | 1180 Str << ", "; |
| 1181 getSrc(0)->emit(Func); | 1181 getSrc(0)->emit(Func); |
| 1182 } | 1182 } |
| 1183 | 1183 |
| 1184 template <> void InstARM32Ldrex::emitIAS(const Cfg *Func) const { |
| 1185 assert(getSrcSize() == 1); |
| 1186 assert(getDest()->hasReg()); |
| 1187 Variable *Dest = getDest(); |
| 1188 assert(isScalarIntegerType(Dest->getType())); |
| 1189 auto *Asm = Func->getAssembler<ARM32::AssemblerARM32>(); |
| 1190 Asm->ldrex(Dest, getSrc(0), getPredicate(), Func->getTarget()); |
| 1191 if (Asm->needsTextFixup()) |
| 1192 emitUsingTextFixup(Func); |
| 1193 } |
| 1194 |
| 1184 template <InstARM32::InstKindARM32 K> | 1195 template <InstARM32::InstKindARM32 K> |
| 1185 void InstARM32TwoAddrGPR<K>::emitIAS(const Cfg *Func) const { | 1196 void InstARM32TwoAddrGPR<K>::emitIAS(const Cfg *Func) const { |
| 1186 emitUsingTextFixup(Func); | 1197 emitUsingTextFixup(Func); |
| 1187 } | 1198 } |
| 1188 | 1199 |
| 1189 template <InstARM32::InstKindARM32 K, bool Nws> | 1200 template <InstARM32::InstKindARM32 K, bool Nws> |
| 1190 void InstARM32UnaryopGPR<K, Nws>::emitIAS(const Cfg *Func) const { | 1201 void InstARM32UnaryopGPR<K, Nws>::emitIAS(const Cfg *Func) const { |
| 1191 emitUsingTextFixup(Func); | 1202 emitUsingTextFixup(Func); |
| 1192 } | 1203 } |
| 1193 | 1204 |
| (...skipping 381 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1575 Variable *Dest = getDest(); | 1586 Variable *Dest = getDest(); |
| 1576 Ostream &Str = Func->getContext()->getStrEmit(); | 1587 Ostream &Str = Func->getContext()->getStrEmit(); |
| 1577 static constexpr char Opcode[] = "strex"; | 1588 static constexpr char Opcode[] = "strex"; |
| 1578 const char *WidthString = getWidthString(Ty); | 1589 const char *WidthString = getWidthString(Ty); |
| 1579 Str << "\t" << Opcode << WidthString << getPredicate() << "\t"; | 1590 Str << "\t" << Opcode << WidthString << getPredicate() << "\t"; |
| 1580 Dest->emit(Func); | 1591 Dest->emit(Func); |
| 1581 Str << ", "; | 1592 Str << ", "; |
| 1582 emitSources(Func); | 1593 emitSources(Func); |
| 1583 } | 1594 } |
| 1584 | 1595 |
| 1596 void InstARM32Strex::emitIAS(const Cfg *Func) const { |
| 1597 assert(getSrcSize() == 2); |
| 1598 const Operand *Src0 = getSrc(0); |
| 1599 assert(isScalarIntegerType(Src0->getType())); |
| 1600 auto *Asm = Func->getAssembler<ARM32::AssemblerARM32>(); |
| 1601 Asm->strex(Dest, Src0, getSrc(1), getPredicate(), Func->getTarget()); |
| 1602 if (Asm->needsTextFixup()) |
| 1603 emitUsingTextFixup(Func); |
| 1604 } |
| 1605 |
| 1585 void InstARM32Strex::dump(const Cfg *Func) const { | 1606 void InstARM32Strex::dump(const Cfg *Func) const { |
| 1586 if (!BuildDefs::dump()) | 1607 if (!BuildDefs::dump()) |
| 1587 return; | 1608 return; |
| 1588 Ostream &Str = Func->getContext()->getStrDump(); | 1609 Ostream &Str = Func->getContext()->getStrDump(); |
| 1589 Variable *Dest = getDest(); | 1610 Variable *Dest = getDest(); |
| 1590 Dest->dump(Func); | 1611 Dest->dump(Func); |
| 1591 Str << " = "; | 1612 Str << " = "; |
| 1592 Type Ty = getSrc(0)->getType(); | 1613 Type Ty = getSrc(0)->getType(); |
| 1593 dumpOpcodePred(Str, "strex", Ty); | 1614 dumpOpcodePred(Str, "strex", Ty); |
| 1594 Str << " "; | 1615 Str << " "; |
| (...skipping 440 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2035 template class InstARM32UnaryopFP<InstARM32::Vsqrt>; | 2056 template class InstARM32UnaryopFP<InstARM32::Vsqrt>; |
| 2036 | 2057 |
| 2037 template class InstARM32FourAddrGPR<InstARM32::Mla>; | 2058 template class InstARM32FourAddrGPR<InstARM32::Mla>; |
| 2038 template class InstARM32FourAddrGPR<InstARM32::Mls>; | 2059 template class InstARM32FourAddrGPR<InstARM32::Mls>; |
| 2039 | 2060 |
| 2040 template class InstARM32CmpLike<InstARM32::Cmn>; | 2061 template class InstARM32CmpLike<InstARM32::Cmn>; |
| 2041 template class InstARM32CmpLike<InstARM32::Cmp>; | 2062 template class InstARM32CmpLike<InstARM32::Cmp>; |
| 2042 template class InstARM32CmpLike<InstARM32::Tst>; | 2063 template class InstARM32CmpLike<InstARM32::Tst>; |
| 2043 | 2064 |
| 2044 } // end of namespace Ice | 2065 } // end of namespace Ice |
| OLD | NEW |