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); |