| OLD | NEW |
| 1 //===- subzero/src/IceAssemblerARM32.cpp - Assembler for ARM32 --*- C++ -*-===// | 1 //===- subzero/src/IceAssemblerARM32.cpp - Assembler for ARM32 --*- C++ -*-===// |
| 2 // | 2 // |
| 3 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 3 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file |
| 4 // for details. All rights reserved. Use of this source code is governed by a | 4 // for details. All rights reserved. Use of this source code is governed by a |
| 5 // BSD-style license that can be found in the LICENSE file. | 5 // BSD-style license that can be found in the LICENSE file. |
| 6 // | 6 // |
| 7 // Modified by the Subzero authors. | 7 // Modified by the Subzero authors. |
| 8 // | 8 // |
| 9 //===----------------------------------------------------------------------===// | 9 //===----------------------------------------------------------------------===// |
| 10 // | 10 // |
| (...skipping 278 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 289 const AssemblerARM32::TargetInfo &TInfo) { | 289 const AssemblerARM32::TargetInfo &TInfo) { |
| 290 Value = 0; // Make sure initialized. | 290 Value = 0; // Make sure initialized. |
| 291 if (const auto *Var = llvm::dyn_cast<Variable>(Opnd)) { | 291 if (const auto *Var = llvm::dyn_cast<Variable>(Opnd)) { |
| 292 // Should be a stack variable, with an offset. | 292 // Should be a stack variable, with an offset. |
| 293 if (Var->hasReg()) | 293 if (Var->hasReg()) |
| 294 return CantDecode; | 294 return CantDecode; |
| 295 IOffsetT Offset = Var->getStackOffset(); | 295 IOffsetT Offset = Var->getStackOffset(); |
| 296 if (!Utils::IsAbsoluteUint(12, Offset)) | 296 if (!Utils::IsAbsoluteUint(12, Offset)) |
| 297 return CantDecode; | 297 return CantDecode; |
| 298 int32_t BaseRegNum = Var->getBaseRegNum(); | 298 int32_t BaseRegNum = Var->getBaseRegNum(); |
| 299 if (BaseRegNum == Variable::NoRegister) { | 299 if (BaseRegNum == Variable::NoRegister) |
| 300 BaseRegNum = TInfo.FrameOrStackReg; | 300 BaseRegNum = TInfo.FrameOrStackReg; |
| 301 if (!TInfo.HasFramePointer) | |
| 302 Offset += TInfo.StackAdjustment; | |
| 303 } | |
| 304 Value = decodeImmRegOffset(decodeGPRRegister(BaseRegNum), Offset, | 301 Value = decodeImmRegOffset(decodeGPRRegister(BaseRegNum), Offset, |
| 305 OperandARM32Mem::Offset); | 302 OperandARM32Mem::Offset); |
| 306 return DecodedAsImmRegOffset; | 303 return DecodedAsImmRegOffset; |
| 307 } | 304 } |
| 308 if (const auto *Mem = llvm::dyn_cast<OperandARM32Mem>(Opnd)) { | 305 if (const auto *Mem = llvm::dyn_cast<OperandARM32Mem>(Opnd)) { |
| 309 Variable *Var = Mem->getBase(); | 306 Variable *Var = Mem->getBase(); |
| 310 if (!Var->hasReg()) | 307 if (!Var->hasReg()) |
| 311 return CantDecode; | 308 return CantDecode; |
| 312 IValueT Rn = Var->getRegNum(); | 309 IValueT Rn = Var->getRegNum(); |
| 313 if (Mem->isRegReg()) { | 310 if (Mem->isRegReg()) { |
| (...skipping 1095 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1409 // rr defined (RotationValue) rotate. | 1406 // rr defined (RotationValue) rotate. |
| 1410 constexpr IValueT Opcode = B26 | B25 | B23 | B22 | B21 | B20; | 1407 constexpr IValueT Opcode = B26 | B25 | B23 | B22 | B21 | B20; |
| 1411 emitUxt(Cond, Opcode, Rd, Rn, Rm, Rotation); | 1408 emitUxt(Cond, Opcode, Rd, Rn, Rm, Rotation); |
| 1412 return; | 1409 return; |
| 1413 } | 1410 } |
| 1414 } | 1411 } |
| 1415 } | 1412 } |
| 1416 | 1413 |
| 1417 } // end of namespace ARM32 | 1414 } // end of namespace ARM32 |
| 1418 } // end of namespace Ice | 1415 } // end of namespace Ice |
| OLD | NEW |