| 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 1817 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1828 _mov(T, Src0, Traits::RegisterSet::Reg_eax); | 1828 _mov(T, Src0, Traits::RegisterSet::Reg_eax); |
| 1829 Src1 = legalize(Src1, Legal_Reg | Legal_Mem); | 1829 Src1 = legalize(Src1, Legal_Reg | Legal_Mem); |
| 1830 } else { | 1830 } else { |
| 1831 _mov(T, Src0); | 1831 _mov(T, Src0); |
| 1832 } | 1832 } |
| 1833 _imul(T, Src1); | 1833 _imul(T, Src1); |
| 1834 _mov(Dest, T); | 1834 _mov(Dest, T); |
| 1835 break; | 1835 break; |
| 1836 case InstArithmetic::Shl: | 1836 case InstArithmetic::Shl: |
| 1837 _mov(T, Src0); | 1837 _mov(T, Src0); |
| 1838 if (!llvm::isa<Constant>(Src1)) | 1838 if (!llvm::isa<ConstantInteger32>(Src1)) |
| 1839 Src1 = legalizeToReg(Src1, Traits::RegisterSet::Reg_ecx); | 1839 Src1 = legalizeToReg(Src1, Traits::RegisterSet::Reg_ecx); |
| 1840 _shl(T, Src1); | 1840 _shl(T, Src1); |
| 1841 _mov(Dest, T); | 1841 _mov(Dest, T); |
| 1842 break; | 1842 break; |
| 1843 case InstArithmetic::Lshr: | 1843 case InstArithmetic::Lshr: |
| 1844 _mov(T, Src0); | 1844 _mov(T, Src0); |
| 1845 if (!llvm::isa<Constant>(Src1)) | 1845 if (!llvm::isa<ConstantInteger32>(Src1)) |
| 1846 Src1 = legalizeToReg(Src1, Traits::RegisterSet::Reg_ecx); | 1846 Src1 = legalizeToReg(Src1, Traits::RegisterSet::Reg_ecx); |
| 1847 _shr(T, Src1); | 1847 _shr(T, Src1); |
| 1848 _mov(Dest, T); | 1848 _mov(Dest, T); |
| 1849 break; | 1849 break; |
| 1850 case InstArithmetic::Ashr: | 1850 case InstArithmetic::Ashr: |
| 1851 _mov(T, Src0); | 1851 _mov(T, Src0); |
| 1852 if (!llvm::isa<Constant>(Src1)) | 1852 if (!llvm::isa<ConstantInteger32>(Src1)) |
| 1853 Src1 = legalizeToReg(Src1, Traits::RegisterSet::Reg_ecx); | 1853 Src1 = legalizeToReg(Src1, Traits::RegisterSet::Reg_ecx); |
| 1854 _sar(T, Src1); | 1854 _sar(T, Src1); |
| 1855 _mov(Dest, T); | 1855 _mov(Dest, T); |
| 1856 break; | 1856 break; |
| 1857 case InstArithmetic::Udiv: | 1857 case InstArithmetic::Udiv: |
| 1858 // div and idiv are the few arithmetic operators that do not allow | 1858 // div and idiv are the few arithmetic operators that do not allow |
| 1859 // immediates as the operand. | 1859 // immediates as the operand. |
| 1860 Src1 = legalize(Src1, Legal_Reg | Legal_Mem); | 1860 Src1 = legalize(Src1, Legal_Reg | Legal_Mem); |
| 1861 if (isByteSizedArithType(Dest->getType())) { | 1861 if (isByteSizedArithType(Dest->getType())) { |
| 1862 // For 8-bit unsigned division we need to zero-extend al into ah. A mov | 1862 // For 8-bit unsigned division we need to zero-extend al into ah. A mov |
| (...skipping 3609 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5472 } | 5472 } |
| 5473 // the offset is not eligible for blinding or pooling, return the original | 5473 // the offset is not eligible for blinding or pooling, return the original |
| 5474 // mem operand | 5474 // mem operand |
| 5475 return MemOperand; | 5475 return MemOperand; |
| 5476 } | 5476 } |
| 5477 | 5477 |
| 5478 } // end of namespace X86Internal | 5478 } // end of namespace X86Internal |
| 5479 } // end of namespace Ice | 5479 } // end of namespace Ice |
| 5480 | 5480 |
| 5481 #endif // SUBZERO_SRC_ICETARGETLOWERINGX86BASEIMPL_H | 5481 #endif // SUBZERO_SRC_ICETARGETLOWERINGX86BASEIMPL_H |
| OLD | NEW |