| OLD | NEW |
| 1 //===- subzero/src/IceTargetLoweringARM32.cpp - ARM32 lowering ------------===// | 1 //===- subzero/src/IceTargetLoweringARM32.cpp - ARM32 lowering ------------===// |
| 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 1697 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1708 } else if (auto *LdrexInstr = llvm::dyn_cast<InstARM32Ldrex>(CurInstr)) { | 1708 } else if (auto *LdrexInstr = llvm::dyn_cast<InstARM32Ldrex>(CurInstr)) { |
| 1709 constexpr bool DisallowOffsetsBecauseLdrex = false; | 1709 constexpr bool DisallowOffsetsBecauseLdrex = false; |
| 1710 if (OperandARM32Mem *LegalMem = Legalizer.legalizeMemOperand( | 1710 if (OperandARM32Mem *LegalMem = Legalizer.legalizeMemOperand( |
| 1711 llvm::cast<OperandARM32Mem>(LdrexInstr->getSrc(0)), | 1711 llvm::cast<OperandARM32Mem>(LdrexInstr->getSrc(0)), |
| 1712 DisallowOffsetsBecauseLdrex)) { | 1712 DisallowOffsetsBecauseLdrex)) { |
| 1713 Sandboxer(this) | 1713 Sandboxer(this) |
| 1714 .ldrex(CurInstr->getDest(), LegalMem, LdrexInstr->getPredicate()); | 1714 .ldrex(CurInstr->getDest(), LegalMem, LdrexInstr->getPredicate()); |
| 1715 CurInstr->setDeleted(); | 1715 CurInstr->setDeleted(); |
| 1716 } | 1716 } |
| 1717 } else if (auto *StrInstr = llvm::dyn_cast<InstARM32Str>(CurInstr)) { | 1717 } else if (auto *StrInstr = llvm::dyn_cast<InstARM32Str>(CurInstr)) { |
| 1718 Sandboxer Bundle(this); | |
| 1719 if (OperandARM32Mem *LegalMem = Legalizer.legalizeMemOperand( | 1718 if (OperandARM32Mem *LegalMem = Legalizer.legalizeMemOperand( |
| 1720 llvm::cast<OperandARM32Mem>(StrInstr->getSrc(1)))) { | 1719 llvm::cast<OperandARM32Mem>(StrInstr->getSrc(1)))) { |
| 1721 Sandboxer(this).str(llvm::cast<Variable>(CurInstr->getSrc(0)), | 1720 Sandboxer(this).str(llvm::cast<Variable>(CurInstr->getSrc(0)), |
| 1722 LegalMem, StrInstr->getPredicate()); | 1721 LegalMem, StrInstr->getPredicate()); |
| 1723 CurInstr->setDeleted(); | 1722 CurInstr->setDeleted(); |
| 1724 } | 1723 } |
| 1725 } else if (auto *StrexInstr = llvm::dyn_cast<InstARM32Strex>(CurInstr)) { | 1724 } else if (auto *StrexInstr = llvm::dyn_cast<InstARM32Strex>(CurInstr)) { |
| 1726 constexpr bool DisallowOffsetsBecauseStrex = false; | 1725 constexpr bool DisallowOffsetsBecauseStrex = false; |
| 1727 if (OperandARM32Mem *LegalMem = Legalizer.legalizeMemOperand( | 1726 if (OperandARM32Mem *LegalMem = Legalizer.legalizeMemOperand( |
| 1728 llvm::cast<OperandARM32Mem>(StrexInstr->getSrc(1)), | 1727 llvm::cast<OperandARM32Mem>(StrexInstr->getSrc(1)), |
| (...skipping 4401 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6130 // peephole style optimizations during or before lowering have access to | 6129 // peephole style optimizations during or before lowering have access to |
| 6131 // this instruction in undeleted form. See for example | 6130 // this instruction in undeleted form. See for example |
| 6132 // tryOptimizedCmpxchgCmpBr(). | 6131 // tryOptimizedCmpxchgCmpBr(). |
| 6133 Iter->second.Instr->setDead(); | 6132 Iter->second.Instr->setDead(); |
| 6134 ++Iter; | 6133 ++Iter; |
| 6135 } | 6134 } |
| 6136 } | 6135 } |
| 6137 | 6136 |
| 6138 TargetARM32::Sandboxer::Sandboxer(TargetARM32 *Target, | 6137 TargetARM32::Sandboxer::Sandboxer(TargetARM32 *Target, |
| 6139 InstBundleLock::Option BundleOption) | 6138 InstBundleLock::Option BundleOption) |
| 6140 : Target(Target) { | 6139 : Bundler(Target, BundleOption), Target(Target) {} |
| 6141 if (Target->NeedSandboxing) { | |
| 6142 Target->_bundle_lock(BundleOption); | |
| 6143 } | |
| 6144 } | |
| 6145 | 6140 |
| 6146 TargetARM32::Sandboxer::~Sandboxer() { | 6141 TargetARM32::Sandboxer::~Sandboxer() {} |
| 6147 if (Target->NeedSandboxing) { | |
| 6148 Target->_bundle_unlock(); | |
| 6149 } | |
| 6150 } | |
| 6151 | 6142 |
| 6152 namespace { | 6143 namespace { |
| 6153 OperandARM32FlexImm *indirectBranchBicMask(Cfg *Func) { | 6144 OperandARM32FlexImm *indirectBranchBicMask(Cfg *Func) { |
| 6154 constexpr uint32_t Imm8 = 0xFC; // 0xC000000F | 6145 constexpr uint32_t Imm8 = 0xFC; // 0xC000000F |
| 6155 constexpr uint32_t RotateAmt = 2; | 6146 constexpr uint32_t RotateAmt = 2; |
| 6156 return OperandARM32FlexImm::create(Func, IceType_i32, Imm8, RotateAmt); | 6147 return OperandARM32FlexImm::create(Func, IceType_i32, Imm8, RotateAmt); |
| 6157 } | 6148 } |
| 6158 | 6149 |
| 6159 OperandARM32FlexImm *memOpBicMask(Cfg *Func) { | 6150 OperandARM32FlexImm *memOpBicMask(Cfg *Func) { |
| 6160 constexpr uint32_t Imm8 = 0x0C; // 0xC0000000 | 6151 constexpr uint32_t Imm8 = 0x0C; // 0xC0000000 |
| (...skipping 288 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6449 // However, for compatibility with current NaCl LLVM, don't claim that. | 6440 // However, for compatibility with current NaCl LLVM, don't claim that. |
| 6450 Str << ".eabi_attribute 14, 3 @ Tag_ABI_PCS_R9_use: Not used\n"; | 6441 Str << ".eabi_attribute 14, 3 @ Tag_ABI_PCS_R9_use: Not used\n"; |
| 6451 } | 6442 } |
| 6452 | 6443 |
| 6453 llvm::SmallBitVector TargetARM32::TypeToRegisterSet[IceType_NUM]; | 6444 llvm::SmallBitVector TargetARM32::TypeToRegisterSet[IceType_NUM]; |
| 6454 llvm::SmallBitVector TargetARM32::RegisterAliases[RegARM32::Reg_NUM]; | 6445 llvm::SmallBitVector TargetARM32::RegisterAliases[RegARM32::Reg_NUM]; |
| 6455 llvm::SmallBitVector TargetARM32::ScratchRegs; | 6446 llvm::SmallBitVector TargetARM32::ScratchRegs; |
| 6456 | 6447 |
| 6457 } // end of namespace ARM32 | 6448 } // end of namespace ARM32 |
| 6458 } // end of namespace Ice | 6449 } // end of namespace Ice |
| OLD | NEW |