Chromium Code Reviews| 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 1354 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1365 } | 1365 } |
| 1366 Str << VectorMarker << "\t"; | 1366 Str << VectorMarker << "\t"; |
| 1367 getDest()->emit(Func); | 1367 getDest()->emit(Func); |
| 1368 Str << ", "; | 1368 Str << ", "; |
| 1369 getSrc(0)->emit(Func); | 1369 getSrc(0)->emit(Func); |
| 1370 } | 1370 } |
| 1371 | 1371 |
| 1372 template <> void InstARM32Ldr::emitIAS(const Cfg *Func) const { | 1372 template <> void InstARM32Ldr::emitIAS(const Cfg *Func) const { |
| 1373 assert(getSrcSize() == 1); | 1373 assert(getSrcSize() == 1); |
| 1374 Variable *Dest = getDest(); | 1374 Variable *Dest = getDest(); |
| 1375 Type DestTy = Dest->getType(); | 1375 Type DestTy = Dest->getType(); |
|
Jim Stichnoth
2016/01/22 05:10:30
const, if you feel so inclined...
Karl
2016/01/22 16:24:29
Done.
| |
| 1376 auto *Asm = Func->getAssembler<ARM32::AssemblerARM32>(); | 1376 auto *Asm = Func->getAssembler<ARM32::AssemblerARM32>(); |
| 1377 if (isScalarFloatingType(DestTy)) { | 1377 if (isScalarFloatingType(DestTy)) { |
| 1378 if (DestTy == IceType_f32) | 1378 switch (DestTy) { |
| 1379 default: | |
| 1380 // TODO(kschimpf) Does this happen? | |
|
John
2016/01/22 15:04:28
It does not happen at the moment, but it will once
Karl
2016/01/22 16:24:29
Actually, due to the if above, this shouldn't happ
| |
| 1381 Asm->setNeedsTextFixup(); | |
| 1382 break; | |
| 1383 case IceType_f32: | |
| 1379 Asm->vldrs(Dest, getSrc(0), getPredicate(), Func->getTarget()); | 1384 Asm->vldrs(Dest, getSrc(0), getPredicate(), Func->getTarget()); |
| 1380 else | 1385 break; |
| 1386 case IceType_f64: | |
| 1381 Asm->vldrd(Dest, getSrc(0), getPredicate(), Func->getTarget()); | 1387 Asm->vldrd(Dest, getSrc(0), getPredicate(), Func->getTarget()); |
| 1388 break; | |
| 1389 } | |
| 1382 } else if (isVectorType(DestTy)) | 1390 } else if (isVectorType(DestTy)) |
| 1383 // TODO(kschimpf) Handle case. | 1391 // TODO(kschimpf) Handle case. |
| 1384 Asm->setNeedsTextFixup(); | 1392 Asm->setNeedsTextFixup(); |
| 1385 else | 1393 else |
| 1386 Asm->ldr(Dest, getSrc(0), getPredicate(), Func->getTarget()); | 1394 Asm->ldr(Dest, getSrc(0), getPredicate(), Func->getTarget()); |
| 1387 if (Asm->needsTextFixup()) | 1395 if (Asm->needsTextFixup()) |
| 1388 emitUsingTextFixup(Func); | 1396 emitUsingTextFixup(Func); |
| 1389 } | 1397 } |
| 1390 | 1398 |
| 1391 template <> void InstARM32Ldrex::emit(const Cfg *Func) const { | 1399 template <> void InstARM32Ldrex::emit(const Cfg *Func) const { |
| (...skipping 278 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1670 getSrc(0)->emit(Func); | 1678 getSrc(0)->emit(Func); |
| 1671 Str << ", "; | 1679 Str << ", "; |
| 1672 getSrc(1)->emit(Func); | 1680 getSrc(1)->emit(Func); |
| 1673 } | 1681 } |
| 1674 | 1682 |
| 1675 void InstARM32Str::emitIAS(const Cfg *Func) const { | 1683 void InstARM32Str::emitIAS(const Cfg *Func) const { |
| 1676 assert(getSrcSize() == 2); | 1684 assert(getSrcSize() == 2); |
| 1677 Type Ty = getSrc(0)->getType(); | 1685 Type Ty = getSrc(0)->getType(); |
| 1678 auto *Asm = Func->getAssembler<ARM32::AssemblerARM32>(); | 1686 auto *Asm = Func->getAssembler<ARM32::AssemblerARM32>(); |
| 1679 if (isScalarFloatingType(Ty)) { | 1687 if (isScalarFloatingType(Ty)) { |
| 1680 if (Ty == IceType_f32) | 1688 switch (Ty) { |
| 1689 default: | |
| 1690 // TODO(kschimpf) Does this happen? | |
| 1691 Asm->setNeedsTextFixup(); | |
| 1692 break; | |
| 1693 case IceType_f32: | |
| 1681 Asm->vstrs(getSrc(0), getSrc(1), getPredicate(), Func->getTarget()); | 1694 Asm->vstrs(getSrc(0), getSrc(1), getPredicate(), Func->getTarget()); |
| 1682 else | 1695 break; |
| 1696 case IceType_f64: | |
| 1683 Asm->vstrd(getSrc(0), getSrc(1), getPredicate(), Func->getTarget()); | 1697 Asm->vstrd(getSrc(0), getSrc(1), getPredicate(), Func->getTarget()); |
| 1698 break; | |
| 1699 } | |
| 1684 } else if (isVectorType(Ty)) | 1700 } else if (isVectorType(Ty)) |
| 1685 // TODO(kschimpf) Handle case. | 1701 // TODO(kschimpf) Handle case. |
| 1686 Asm->setNeedsTextFixup(); | 1702 Asm->setNeedsTextFixup(); |
| 1687 else | 1703 else |
| 1688 Asm->str(getSrc(0), getSrc(1), getPredicate(), Func->getTarget()); | 1704 Asm->str(getSrc(0), getSrc(1), getPredicate(), Func->getTarget()); |
| 1689 if (Asm->needsTextFixup()) | 1705 if (Asm->needsTextFixup()) |
| 1690 emitUsingTextFixup(Func); | 1706 emitUsingTextFixup(Func); |
| 1691 } | 1707 } |
| 1692 | 1708 |
| 1693 void InstARM32Str::dump(const Cfg *Func) const { | 1709 void InstARM32Str::dump(const Cfg *Func) const { |
| (...skipping 540 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2234 | 2250 |
| 2235 template class InstARM32FourAddrGPR<InstARM32::Mla>; | 2251 template class InstARM32FourAddrGPR<InstARM32::Mla>; |
| 2236 template class InstARM32FourAddrGPR<InstARM32::Mls>; | 2252 template class InstARM32FourAddrGPR<InstARM32::Mls>; |
| 2237 | 2253 |
| 2238 template class InstARM32CmpLike<InstARM32::Cmn>; | 2254 template class InstARM32CmpLike<InstARM32::Cmn>; |
| 2239 template class InstARM32CmpLike<InstARM32::Cmp>; | 2255 template class InstARM32CmpLike<InstARM32::Cmp>; |
| 2240 template class InstARM32CmpLike<InstARM32::Tst>; | 2256 template class InstARM32CmpLike<InstARM32::Tst>; |
| 2241 | 2257 |
| 2242 } // end of namespace ARM32 | 2258 } // end of namespace ARM32 |
| 2243 } // end of namespace Ice | 2259 } // end of namespace Ice |
| OLD | NEW |