| OLD | NEW |
| 1 //===- subzero/src/IceTargetLoweringX8632.cpp - x86-32 lowering -----------===// | 1 //===- subzero/src/IceTargetLoweringX8632.cpp - x86-32 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 657 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 668 // t:ecx = pop | 668 // t:ecx = pop |
| 669 // bundle_lock | 669 // bundle_lock |
| 670 // and t, ~31 | 670 // and t, ~31 |
| 671 // jmp *t | 671 // jmp *t |
| 672 // bundle_unlock | 672 // bundle_unlock |
| 673 // FakeUse <original_ret_operand> | 673 // FakeUse <original_ret_operand> |
| 674 Variable *T_ecx = makeReg(IceType_i32, Traits::RegisterSet::Reg_ecx); | 674 Variable *T_ecx = makeReg(IceType_i32, Traits::RegisterSet::Reg_ecx); |
| 675 _pop(T_ecx); | 675 _pop(T_ecx); |
| 676 lowerIndirectJump(T_ecx); | 676 lowerIndirectJump(T_ecx); |
| 677 if (RI->getSrcSize()) { | 677 if (RI->getSrcSize()) { |
| 678 Variable *RetValue = llvm::cast<Variable>(RI->getSrc(0)); | 678 auto *RetValue = llvm::cast<Variable>(RI->getSrc(0)); |
| 679 Context.insert(InstFakeUse::create(Func, RetValue)); | 679 Context.insert(InstFakeUse::create(Func, RetValue)); |
| 680 } | 680 } |
| 681 RI->setDeleted(); | 681 RI->setDeleted(); |
| 682 } | 682 } |
| 683 | 683 |
| 684 void TargetX8632::emitJumpTable(const Cfg *Func, | 684 void TargetX8632::emitJumpTable(const Cfg *Func, |
| 685 const InstJumpTable *JumpTable) const { | 685 const InstJumpTable *JumpTable) const { |
| 686 if (!BuildDefs::dump()) | 686 if (!BuildDefs::dump()) |
| 687 return; | 687 return; |
| 688 Ostream &Str = Ctx->getStrEmit(); | 688 Ostream &Str = Ctx->getStrEmit(); |
| (...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 790 | 790 |
| 791 RandomNumberGenerator RNG(Ctx->getFlags().getRandomSeed(), | 791 RandomNumberGenerator RNG(Ctx->getFlags().getRandomSeed(), |
| 792 RPE_PooledConstantReordering, K); | 792 RPE_PooledConstantReordering, K); |
| 793 RandomShuffle(Pool.begin(), Pool.end(), | 793 RandomShuffle(Pool.begin(), Pool.end(), |
| 794 [&RNG](uint64_t N) { return (uint32_t)RNG.next(N); }); | 794 [&RNG](uint64_t N) { return (uint32_t)RNG.next(N); }); |
| 795 } | 795 } |
| 796 | 796 |
| 797 for (Constant *C : Pool) { | 797 for (Constant *C : Pool) { |
| 798 if (!C->getShouldBePooled()) | 798 if (!C->getShouldBePooled()) |
| 799 continue; | 799 continue; |
| 800 typename T::IceType *Const = llvm::cast<typename T::IceType>(C); | 800 auto *Const = llvm::cast<typename T::IceType>(C); |
| 801 typename T::IceType::PrimType Value = Const->getValue(); | 801 typename T::IceType::PrimType Value = Const->getValue(); |
| 802 // Use memcpy() to copy bits from Value into RawValue in a way that avoids | 802 // Use memcpy() to copy bits from Value into RawValue in a way that avoids |
| 803 // breaking strict-aliasing rules. | 803 // breaking strict-aliasing rules. |
| 804 typename T::PrimitiveIntType RawValue; | 804 typename T::PrimitiveIntType RawValue; |
| 805 memcpy(&RawValue, &Value, sizeof(Value)); | 805 memcpy(&RawValue, &Value, sizeof(Value)); |
| 806 char buf[30]; | 806 char buf[30]; |
| 807 int CharsPrinted = | 807 int CharsPrinted = |
| 808 snprintf(buf, llvm::array_lengthof(buf), T::PrintfString, RawValue); | 808 snprintf(buf, llvm::array_lengthof(buf), T::PrintfString, RawValue); |
| 809 assert(CharsPrinted >= 0 && | 809 assert(CharsPrinted >= 0 && |
| 810 (size_t)CharsPrinted < llvm::array_lengthof(buf)); | 810 (size_t)CharsPrinted < llvm::array_lengthof(buf)); |
| (...skipping 185 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 996 // case the high-level table has extra entries. | 996 // case the high-level table has extra entries. |
| 997 #define X(tag, sizeLog2, align, elts, elty, str) \ | 997 #define X(tag, sizeLog2, align, elts, elty, str) \ |
| 998 static_assert(_table1_##tag == _table2_##tag, \ | 998 static_assert(_table1_##tag == _table2_##tag, \ |
| 999 "Inconsistency between ICETYPEX8632_TABLE and ICETYPE_TABLE"); | 999 "Inconsistency between ICETYPEX8632_TABLE and ICETYPE_TABLE"); |
| 1000 ICETYPE_TABLE | 1000 ICETYPE_TABLE |
| 1001 #undef X | 1001 #undef X |
| 1002 } // end of namespace dummy3 | 1002 } // end of namespace dummy3 |
| 1003 } // end of anonymous namespace | 1003 } // end of anonymous namespace |
| 1004 | 1004 |
| 1005 } // end of namespace Ice | 1005 } // end of namespace Ice |
| OLD | NEW |