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

Unified 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/IceTargetLoweringX86Base.h ('k') | tests_lit/assembler/x86/immediate_encodings.ll » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/IceTargetLoweringX86BaseImpl.h
diff --git a/src/IceTargetLoweringX86BaseImpl.h b/src/IceTargetLoweringX86BaseImpl.h
index 677bc98d42f041e0b5f4eb07496f47e94117ba7f..00c2870e391505f4ab1046d70ed1bff1f9f884b7 100644
--- a/src/IceTargetLoweringX86BaseImpl.h
+++ b/src/IceTargetLoweringX86BaseImpl.h
@@ -1618,11 +1618,17 @@ void TargetX86Base<Machine>::lowerArithmetic(const InstArithmetic *Inst) {
if (isByteSizedArithType(Dest->getType())) {
_mov(T, Src0, Traits::RegisterSet::Reg_eax);
Src1 = legalize(Src1, Legal_Reg | Legal_Mem);
+ _imul(T, Src0 == Src1 ? T : Src1);
+ _mov(Dest, T);
+ } else if (auto *ImmConst = llvm::dyn_cast<ConstantInteger32>(Src1)) {
+ T = makeReg(Dest->getType());
+ _imul_imm(T, Src0, ImmConst);
+ _mov(Dest, T);
} else {
_mov(T, Src0);
+ _imul(T, Src0 == Src1 ? T : Src1);
+ _mov(Dest, T);
}
- _imul(T, Src0 == Src1 ? T : Src1);
- _mov(Dest, T);
break;
case InstArithmetic::Shl:
_mov(T, Src0);
« 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