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

Side by Side Diff: src/IceTargetLoweringX8632.cpp

Issue 617593002: Handle imul, pcmpeq, pcmpgt. (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: go ahead and optimize i8 Created 6 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/IceInstX8632.cpp ('k') | src/assembler_ia32.h » ('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/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 1563 matching lines...) Expand 10 before | Expand all | Expand 10 after
1574 _mov(Dest, T); 1574 _mov(Dest, T);
1575 break; 1575 break;
1576 case InstArithmetic::Mul: 1576 case InstArithmetic::Mul:
1577 // TODO: Optimize for llvm::isa<Constant>(Src1) 1577 // TODO: Optimize for llvm::isa<Constant>(Src1)
1578 // TODO: Strength-reduce multiplications by a constant, 1578 // TODO: Strength-reduce multiplications by a constant,
1579 // particularly -1 and powers of 2. Advanced: use lea to 1579 // particularly -1 and powers of 2. Advanced: use lea to
1580 // multiply by 3, 5, 9. 1580 // multiply by 3, 5, 9.
1581 // 1581 //
1582 // The 8-bit version of imul only allows the form "imul r/m8" 1582 // The 8-bit version of imul only allows the form "imul r/m8"
1583 // where T must be in eax. 1583 // where T must be in eax.
1584 if (isByteSizedArithType(Dest->getType())) 1584 if (isByteSizedArithType(Dest->getType())) {
1585 _mov(T, Src0, RegX8632::Reg_eax); 1585 _mov(T, Src0, RegX8632::Reg_eax);
1586 else 1586 Src1 = legalize(Src1, Legal_Reg | Legal_Mem);
Jim Stichnoth 2014/09/30 05:17:07 cool, thanks!
1587 } else {
1587 _mov(T, Src0); 1588 _mov(T, Src0);
1589 }
1588 _imul(T, Src1); 1590 _imul(T, Src1);
1589 _mov(Dest, T); 1591 _mov(Dest, T);
1590 break; 1592 break;
1591 case InstArithmetic::Shl: 1593 case InstArithmetic::Shl:
1592 _mov(T, Src0); 1594 _mov(T, Src0);
1593 if (!llvm::isa<Constant>(Src1)) 1595 if (!llvm::isa<Constant>(Src1))
1594 Src1 = legalizeToVar(Src1, RegX8632::Reg_ecx); 1596 Src1 = legalizeToVar(Src1, RegX8632::Reg_ecx);
1595 _shl(T, Src1); 1597 _shl(T, Src1);
1596 _mov(Dest, T); 1598 _mov(Dest, T);
1597 break; 1599 break;
(...skipping 2958 matching lines...) Expand 10 before | Expand all | Expand 10 after
4556 Str << "\t.align\t" << Align << "\n"; 4558 Str << "\t.align\t" << Align << "\n";
4557 Str << MangledName << ":\n"; 4559 Str << MangledName << ":\n";
4558 for (SizeT i = 0; i < Size; ++i) { 4560 for (SizeT i = 0; i < Size; ++i) {
4559 Str << "\t.byte\t" << (((unsigned)Data[i]) & 0xff) << "\n"; 4561 Str << "\t.byte\t" << (((unsigned)Data[i]) & 0xff) << "\n";
4560 } 4562 }
4561 Str << "\t.size\t" << MangledName << ", " << Size << "\n"; 4563 Str << "\t.size\t" << MangledName << ", " << Size << "\n";
4562 } 4564 }
4563 } 4565 }
4564 4566
4565 } // end of namespace Ice 4567 } // end of namespace Ice
OLDNEW
« no previous file with comments | « src/IceInstX8632.cpp ('k') | src/assembler_ia32.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698