Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(515)

Side by Side Diff: src/IceTargetLoweringX86BaseImpl.h

Issue 1365433004: Use three-address form of imul (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: Reinsert match for square operations, lost by merge. Created 5 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/IceTargetLoweringX86Base.h ('k') | tests_lit/assembler/x86/immediate_encodings.ll » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 1600 matching lines...) Expand 10 before | Expand all | Expand 10 after
1611 case InstArithmetic::Mul: 1611 case InstArithmetic::Mul:
1612 if (auto *C = llvm::dyn_cast<ConstantInteger32>(Src1)) { 1612 if (auto *C = llvm::dyn_cast<ConstantInteger32>(Src1)) {
1613 if (optimizeScalarMul(Dest, Src0, C->getValue())) 1613 if (optimizeScalarMul(Dest, Src0, C->getValue()))
1614 return; 1614 return;
1615 } 1615 }
1616 // The 8-bit version of imul only allows the form "imul r/m8" where T must 1616 // The 8-bit version of imul only allows the form "imul r/m8" where T must
1617 // be in eax. 1617 // be in eax.
1618 if (isByteSizedArithType(Dest->getType())) { 1618 if (isByteSizedArithType(Dest->getType())) {
1619 _mov(T, Src0, Traits::RegisterSet::Reg_eax); 1619 _mov(T, Src0, Traits::RegisterSet::Reg_eax);
1620 Src1 = legalize(Src1, Legal_Reg | Legal_Mem); 1620 Src1 = legalize(Src1, Legal_Reg | Legal_Mem);
1621 _imul(T, Src0 == Src1 ? T : Src1);
1622 _mov(Dest, T);
1623 } else if (auto *ImmConst = llvm::dyn_cast<ConstantInteger32>(Src1)) {
1624 T = makeReg(Dest->getType());
1625 _imul_imm(T, Src0, ImmConst);
1626 _mov(Dest, T);
1621 } else { 1627 } else {
1622 _mov(T, Src0); 1628 _mov(T, Src0);
1629 _imul(T, Src0 == Src1 ? T : Src1);
1630 _mov(Dest, T);
1623 } 1631 }
1624 _imul(T, Src0 == Src1 ? T : Src1);
1625 _mov(Dest, T);
1626 break; 1632 break;
1627 case InstArithmetic::Shl: 1633 case InstArithmetic::Shl:
1628 _mov(T, Src0); 1634 _mov(T, Src0);
1629 if (!llvm::isa<ConstantInteger32>(Src1)) 1635 if (!llvm::isa<ConstantInteger32>(Src1))
1630 Src1 = legalizeToReg(Src1, Traits::RegisterSet::Reg_ecx); 1636 Src1 = legalizeToReg(Src1, Traits::RegisterSet::Reg_ecx);
1631 _shl(T, Src1); 1637 _shl(T, Src1);
1632 _mov(Dest, T); 1638 _mov(Dest, T);
1633 break; 1639 break;
1634 case InstArithmetic::Lshr: 1640 case InstArithmetic::Lshr:
1635 _mov(T, Src0); 1641 _mov(T, Src0);
(...skipping 3860 matching lines...) Expand 10 before | Expand all | Expand 10 after
5496 } 5502 }
5497 // the offset is not eligible for blinding or pooling, return the original 5503 // the offset is not eligible for blinding or pooling, return the original
5498 // mem operand 5504 // mem operand
5499 return MemOperand; 5505 return MemOperand;
5500 } 5506 }
5501 5507
5502 } // end of namespace X86Internal 5508 } // end of namespace X86Internal
5503 } // end of namespace Ice 5509 } // end of namespace Ice
5504 5510
5505 #endif // SUBZERO_SRC_ICETARGETLOWERINGX86BASEIMPL_H 5511 #endif // SUBZERO_SRC_ICETARGETLOWERINGX86BASEIMPL_H
OLDNEW
« no previous file with comments | « src/IceTargetLoweringX86Base.h ('k') | tests_lit/assembler/x86/immediate_encodings.ll » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698