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 // This file implements the TargetLoweringX8632 class, which | 10 // This file implements the TargetLoweringX8632 class, which |
(...skipping 2000 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2011 _mov(T, Src); | 2011 _mov(T, Src); |
2012 _mov(Dest, T); | 2012 _mov(Dest, T); |
2013 return; | 2013 return; |
2014 } | 2014 } |
2015 case Intrinsics::Setjmp: { | 2015 case Intrinsics::Setjmp: { |
2016 InstCall *Call = makeHelperCall("setjmp", Instr->getDest(), 1); | 2016 InstCall *Call = makeHelperCall("setjmp", Instr->getDest(), 1); |
2017 Call->addArg(Instr->getArg(0)); | 2017 Call->addArg(Instr->getArg(0)); |
2018 lowerCall(Call); | 2018 lowerCall(Call); |
2019 return; | 2019 return; |
2020 } | 2020 } |
2021 case Intrinsics::Sqrt: | 2021 case Intrinsics::Sqrt: { |
| 2022 Operand *Src = legalize(Instr->getArg(0)); |
| 2023 Variable *Dest = Instr->getDest(); |
| 2024 Variable *T = makeReg(Dest->getType()); |
| 2025 _sqrtss(T, Src); |
| 2026 _mov(Dest, T); |
| 2027 return; |
| 2028 } |
2022 case Intrinsics::Stacksave: | 2029 case Intrinsics::Stacksave: |
2023 case Intrinsics::Stackrestore: | 2030 case Intrinsics::Stackrestore: |
2024 // TODO(jvoung): fill it in. | 2031 // TODO(jvoung): fill it in. |
2025 Func->setError("Unhandled intrinsic"); | 2032 Func->setError("Unhandled intrinsic"); |
2026 return; | 2033 return; |
2027 case Intrinsics::Trap: | 2034 case Intrinsics::Trap: |
2028 _ud2(); | 2035 _ud2(); |
2029 return; | 2036 return; |
2030 case Intrinsics::UnknownIntrinsic: | 2037 case Intrinsics::UnknownIntrinsic: |
2031 Func->setError("Should not be lowering UnknownIntrinsic"); | 2038 Func->setError("Should not be lowering UnknownIntrinsic"); |
(...skipping 706 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2738 for (SizeT i = 0; i < Size; ++i) { | 2745 for (SizeT i = 0; i < Size; ++i) { |
2739 Str << "\t.byte\t" << (((unsigned)Data[i]) & 0xff) << "\n"; | 2746 Str << "\t.byte\t" << (((unsigned)Data[i]) & 0xff) << "\n"; |
2740 } | 2747 } |
2741 Str << "\t.size\t" << MangledName << ", " << Size << "\n"; | 2748 Str << "\t.size\t" << MangledName << ", " << Size << "\n"; |
2742 } | 2749 } |
2743 Str << "\t" << (IsInternal ? ".local" : ".global") << "\t" << MangledName | 2750 Str << "\t" << (IsInternal ? ".local" : ".global") << "\t" << MangledName |
2744 << "\n"; | 2751 << "\n"; |
2745 } | 2752 } |
2746 | 2753 |
2747 } // end of namespace Ice | 2754 } // end of namespace Ice |
OLD | NEW |