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

Unified Diff: src/IceTargetLoweringX86BaseImpl.h

Issue 2158213002: Subzero: Fix lowering for x86 div/rem instructions. (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: Created 4 years, 5 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 | no next file » | 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 435332bbef78b3c474ec461a2d94a0472f73e45d..bcbc3ced817194c64689b8d51b0559c8d517c881 100644
--- a/src/IceTargetLoweringX86BaseImpl.h
+++ b/src/IceTargetLoweringX86BaseImpl.h
@@ -2283,7 +2283,9 @@ void TargetX86Base<TraitsType>::lowerArithmetic(const InstArithmetic *Instr) {
T_edx = makeReg(Ty, Edx);
_mov(T, Src0, Eax);
_mov(T_edx, Ctx->getConstantZero(Ty));
- _div(T, Src1, T_edx);
+ _div(T_edx, Src1, T);
+ Context.insert<InstFakeDef>(T, T_edx);
+ _set_dest_redefined();
_mov(Dest, T);
} break;
case InstArithmetic::Sdiv:
@@ -2343,7 +2345,9 @@ void TargetX86Base<TraitsType>::lowerArithmetic(const InstArithmetic *Instr) {
break;
}
_cbwdq(T_edx, T);
- _idiv(T, Src1, T_edx);
+ _idiv(T_edx, Src1, T);
+ Context.insert<InstFakeDef>(T, T_edx);
John 2016/07/19 03:18:19 can you use the _redefined method here? _redefine
Jim Stichnoth 2016/07/19 13:35:35 Done.
+ _set_dest_redefined();
_mov(Dest, T);
break;
case InstArithmetic::Urem: {
@@ -2373,7 +2377,9 @@ void TargetX86Base<TraitsType>::lowerArithmetic(const InstArithmetic *Instr) {
T_edx = makeReg(Ty, Edx);
_mov(T_edx, Ctx->getConstantZero(Ty));
_mov(T, Src0, Eax);
- _div(T_edx, Src1, T);
+ _div(T, Src1, T_edx);
+ Context.insert<InstFakeDef>(T_edx, T);
+ _set_dest_redefined();
if (Ty == IceType_i8) {
// Register ah must be moved into one of {al,bl,cl,dl} before it can be
// moved into a general 8-bit register.
@@ -2450,7 +2456,9 @@ void TargetX86Base<TraitsType>::lowerArithmetic(const InstArithmetic *Instr) {
T_edx = makeReg(Ty, Edx);
_mov(T, Src0, Eax);
_cbwdq(T_edx, T);
- _idiv(T_edx, Src1, T);
+ _idiv(T, Src1, T_edx);
+ Context.insert<InstFakeDef>(T_edx, T);
+ _set_dest_redefined();
if (Ty == IceType_i8) {
// Register ah must be moved into one of {al,bl,cl,dl} before it can be
// moved into a general 8-bit register.
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698