| OLD | NEW |
| 1 //===- subzero/src/IceTargetLoweringX86BaseImpl.h - x86 lowering -*- C++ -*-==// | 1 //===- subzero/src/IceTargetLoweringX86BaseImpl.h - x86 lowering -*- C++ -*-==// |
| 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 1299 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1310 // a.hi = t3 | 1310 // a.hi = t3 |
| 1311 Context.insert(Label); | 1311 Context.insert(Label); |
| 1312 _mov(DestLo, T_2); | 1312 _mov(DestLo, T_2); |
| 1313 _mov(DestHi, T_3); | 1313 _mov(DestHi, T_3); |
| 1314 } | 1314 } |
| 1315 } | 1315 } |
| 1316 | 1316 |
| 1317 template <class Machine> | 1317 template <class Machine> |
| 1318 void TargetX86Base<Machine>::lowerArithmetic(const InstArithmetic *Inst) { | 1318 void TargetX86Base<Machine>::lowerArithmetic(const InstArithmetic *Inst) { |
| 1319 Variable *Dest = Inst->getDest(); | 1319 Variable *Dest = Inst->getDest(); |
| 1320 if (Dest->isRematerializable()) { |
| 1321 Context.insert(InstFakeDef::create(Func, Dest)); |
| 1322 return; |
| 1323 } |
| 1320 Type Ty = Dest->getType(); | 1324 Type Ty = Dest->getType(); |
| 1321 Operand *Src0 = legalize(Inst->getSrc(0)); | 1325 Operand *Src0 = legalize(Inst->getSrc(0)); |
| 1322 Operand *Src1 = legalize(Inst->getSrc(1)); | 1326 Operand *Src1 = legalize(Inst->getSrc(1)); |
| 1323 if (Inst->isCommutative()) { | 1327 if (Inst->isCommutative()) { |
| 1324 uint32_t SwapCount = 0; | 1328 uint32_t SwapCount = 0; |
| 1325 if (!llvm::isa<Variable>(Src0) && llvm::isa<Variable>(Src1)) { | 1329 if (!llvm::isa<Variable>(Src0) && llvm::isa<Variable>(Src1)) { |
| 1326 std::swap(Src0, Src1); | 1330 std::swap(Src0, Src1); |
| 1327 ++SwapCount; | 1331 ++SwapCount; |
| 1328 } | 1332 } |
| 1329 if (llvm::isa<Constant>(Src0) && !llvm::isa<Constant>(Src1)) { | 1333 if (llvm::isa<Constant>(Src0) && !llvm::isa<Constant>(Src1)) { |
| (...skipping 560 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1890 Call->addArg(Src0); | 1894 Call->addArg(Src0); |
| 1891 Call->addArg(Src1); | 1895 Call->addArg(Src1); |
| 1892 return lowerCall(Call); | 1896 return lowerCall(Call); |
| 1893 } | 1897 } |
| 1894 } | 1898 } |
| 1895 } | 1899 } |
| 1896 | 1900 |
| 1897 template <class Machine> | 1901 template <class Machine> |
| 1898 void TargetX86Base<Machine>::lowerAssign(const InstAssign *Inst) { | 1902 void TargetX86Base<Machine>::lowerAssign(const InstAssign *Inst) { |
| 1899 Variable *Dest = Inst->getDest(); | 1903 Variable *Dest = Inst->getDest(); |
| 1904 if (Dest->isRematerializable()) { |
| 1905 Context.insert(InstFakeDef::create(Func, Dest)); |
| 1906 return; |
| 1907 } |
| 1900 Operand *Src0 = Inst->getSrc(0); | 1908 Operand *Src0 = Inst->getSrc(0); |
| 1901 assert(Dest->getType() == Src0->getType()); | 1909 assert(Dest->getType() == Src0->getType()); |
| 1902 if (!Traits::Is64Bit && Dest->getType() == IceType_i64) { | 1910 if (!Traits::Is64Bit && Dest->getType() == IceType_i64) { |
| 1903 Src0 = legalize(Src0); | 1911 Src0 = legalize(Src0); |
| 1904 Operand *Src0Lo = loOperand(Src0); | 1912 Operand *Src0Lo = loOperand(Src0); |
| 1905 Operand *Src0Hi = hiOperand(Src0); | 1913 Operand *Src0Hi = hiOperand(Src0); |
| 1906 Variable *DestLo = llvm::cast<Variable>(loOperand(Dest)); | 1914 Variable *DestLo = llvm::cast<Variable>(loOperand(Dest)); |
| 1907 Variable *DestHi = llvm::cast<Variable>(hiOperand(Dest)); | 1915 Variable *DestHi = llvm::cast<Variable>(hiOperand(Dest)); |
| 1908 Variable *T_Lo = nullptr, *T_Hi = nullptr; | 1916 Variable *T_Lo = nullptr, *T_Hi = nullptr; |
| 1909 _mov(T_Lo, Src0Lo); | 1917 _mov(T_Lo, Src0Lo); |
| (...skipping 4068 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5978 } | 5986 } |
| 5979 // the offset is not eligible for blinding or pooling, return the original | 5987 // the offset is not eligible for blinding or pooling, return the original |
| 5980 // mem operand | 5988 // mem operand |
| 5981 return MemOperand; | 5989 return MemOperand; |
| 5982 } | 5990 } |
| 5983 | 5991 |
| 5984 } // end of namespace X86Internal | 5992 } // end of namespace X86Internal |
| 5985 } // end of namespace Ice | 5993 } // end of namespace Ice |
| 5986 | 5994 |
| 5987 #endif // SUBZERO_SRC_ICETARGETLOWERINGX86BASEIMPL_H | 5995 #endif // SUBZERO_SRC_ICETARGETLOWERINGX86BASEIMPL_H |
| OLD | NEW |