OLD | NEW |
1 //===- subzero/src/IceTargetLoweringX8664.cpp - x86-64 lowering -----------===// | 1 //===- subzero/src/IceTargetLoweringX8664.cpp - x86-64 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 388 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
399 // NeedLea below.) | 399 // NeedLea below.) |
400 if (Shift == 0 && isAssignedToRspOrRbp(Index) && ZeroReg == RebasePtr) { | 400 if (Shift == 0 && isAssignedToRspOrRbp(Index) && ZeroReg == RebasePtr) { |
401 ZeroReg = Index; | 401 ZeroReg = Index; |
402 } else { | 402 } else { |
403 T = Index; | 403 T = Index; |
404 Shift = Mem->getShift(); | 404 Shift = Mem->getShift(); |
405 } | 405 } |
406 } | 406 } |
407 } | 407 } |
408 | 408 |
409 // NeedsLea is a flags indicating whether Mem needs to be materialized to a | 409 // NeedsLea is a flag indicating whether Mem needs to be materialized to a GPR |
410 // GPR prior to being used. A LEA is needed if Mem.Offset is a constant | 410 // prior to being used. A LEA is needed if Mem.Offset is a constant |
411 // relocatable, or if Mem.Offset is negative. In both these cases, the LEA is | 411 // relocatable, or if Mem.Offset is negative. In both these cases, the LEA is |
412 // needed to ensure the sandboxed memory operand will only use the lower | 412 // needed to ensure the sandboxed memory operand will only use the lower |
413 // 32-bits of T+Offset. | 413 // 32-bits of T+Offset. |
414 bool NeedsLea = false; | 414 bool NeedsLea = false; |
415 if (Offset != nullptr) { | 415 if (Offset != nullptr) { |
416 if (const auto *CR = llvm::dyn_cast<ConstantRelocatable>(Offset)) { | 416 if (llvm::isa<ConstantRelocatable>(Offset)) { |
417 NeedsLea = CR->getOffset() < 0; | 417 NeedsLea = true; |
418 } else if (const auto *Imm = llvm::dyn_cast<ConstantInteger32>(Offset)) { | 418 } else if (const auto *Imm = llvm::dyn_cast<ConstantInteger32>(Offset)) { |
419 NeedsLea = Imm->getValue() < 0; | 419 NeedsLea = Imm->getValue() < 0; |
420 } else { | 420 } else { |
421 llvm::report_fatal_error("Unexpected Offset type."); | 421 llvm::report_fatal_error("Unexpected Offset type."); |
422 } | 422 } |
423 } | 423 } |
424 | 424 |
425 RegNumT RegNum, RegNum32; | 425 RegNumT RegNum, RegNum32; |
426 if (T != nullptr) { | 426 if (T != nullptr) { |
427 if (T->hasReg()) { | 427 if (T->hasReg()) { |
(...skipping 382 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
810 #define X(tag, sizeLog2, align, elts, elty, str, rcstr) \ | 810 #define X(tag, sizeLog2, align, elts, elty, str, rcstr) \ |
811 static_assert(_table1_##tag == _table2_##tag, \ | 811 static_assert(_table1_##tag == _table2_##tag, \ |
812 "Inconsistency between ICETYPEX8664_TABLE and ICETYPE_TABLE"); | 812 "Inconsistency between ICETYPEX8664_TABLE and ICETYPE_TABLE"); |
813 ICETYPE_TABLE | 813 ICETYPE_TABLE |
814 #undef X | 814 #undef X |
815 } // end of namespace dummy3 | 815 } // end of namespace dummy3 |
816 } // end of anonymous namespace | 816 } // end of anonymous namespace |
817 | 817 |
818 } // end of namespace X8664 | 818 } // end of namespace X8664 |
819 } // end of namespace Ice | 819 } // end of namespace Ice |
OLD | NEW |