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

Unified Diff: src/IceTargetLoweringX8632.cpp

Issue 339643003: Legalize div/idiv operands to avoid immediates. (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: space Created 6 years, 6 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 | « no previous file | tests_lit/llvm2ice_tests/div_legalization.ll » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/IceTargetLoweringX8632.cpp
diff --git a/src/IceTargetLoweringX8632.cpp b/src/IceTargetLoweringX8632.cpp
index 46a587fe1f139727438baf153e72f350b3945311..2942352a22a821db3d1e90a030cad8c42bd25427 100644
--- a/src/IceTargetLoweringX8632.cpp
+++ b/src/IceTargetLoweringX8632.cpp
@@ -1136,6 +1136,7 @@ void TargetX8632::lowerArithmetic(const InstArithmetic *Inst) {
_mov(Dest, T);
break;
case InstArithmetic::Udiv:
+ Src1 = legalize(Src1, Legal_Reg | Legal_Mem, true);
Jim Stichnoth 2014/06/17 05:35:06 It's hard to wrap my head around the AllowOverlap
jvoung (off chromium) 2014/06/17 16:11:08 Done. Yeah it looks like it will be ignored in thi
if (Dest->getType() == IceType_i8) {
Variable *T_ah = NULL;
Constant *Zero = Ctx->getConstantInt(IceType_i8, 0);
@@ -1152,6 +1153,7 @@ void TargetX8632::lowerArithmetic(const InstArithmetic *Inst) {
}
break;
case InstArithmetic::Sdiv:
+ Src1 = legalize(Src1, Legal_Reg | Legal_Mem, true);
T_edx = makeReg(IceType_i32, Reg_edx);
_mov(T, Src0, Reg_eax);
_cdq(T_edx, T);
@@ -1159,6 +1161,7 @@ void TargetX8632::lowerArithmetic(const InstArithmetic *Inst) {
_mov(Dest, T);
break;
case InstArithmetic::Urem:
+ Src1 = legalize(Src1, Legal_Reg | Legal_Mem, true);
if (Dest->getType() == IceType_i8) {
Variable *T_ah = NULL;
Constant *Zero = Ctx->getConstantInt(IceType_i8, 0);
@@ -1175,6 +1178,7 @@ void TargetX8632::lowerArithmetic(const InstArithmetic *Inst) {
}
break;
case InstArithmetic::Srem:
+ Src1 = legalize(Src1, Legal_Reg | Legal_Mem, true);
T_edx = makeReg(IceType_i32, Reg_edx);
_mov(T, Src0, Reg_eax);
_cdq(T_edx, T);
« no previous file with comments | « no previous file | tests_lit/llvm2ice_tests/div_legalization.ll » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698