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

Unified Diff: src/x64/lithium-codegen-x64.cc

Issue 22964004: Fix a bug in Div when all uses are truncating (Closed) Base URL: https://github.com/v8/v8.git@master
Patch Set: more elegant ARM version Created 7 years, 4 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/ia32/lithium-codegen-ia32.cc ('k') | test/mjsunit/shift-for-integer-div.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/x64/lithium-codegen-x64.cc
diff --git a/src/x64/lithium-codegen-x64.cc b/src/x64/lithium-codegen-x64.cc
index a1f4ad184bfb185073616b4164d556b4ec91ce73..85f025594f9cfb6e7e533ab872a2ed23c51a1ed2 100644
--- a/src/x64/lithium-codegen-x64.cc
+++ b/src/x64/lithium-codegen-x64.cc
@@ -1216,6 +1216,7 @@ void LCodeGen::DoDivI(LDivI* instr) {
__ cmpl(dividend, Immediate(0));
__ j(less, &negative, Label::kNear);
__ sarl(dividend, Immediate(power));
+ if (divisor < 0) __ negl(dividend);
__ jmp(&done, Label::kNear);
__ bind(&negative);
« no previous file with comments | « src/ia32/lithium-codegen-ia32.cc ('k') | test/mjsunit/shift-for-integer-div.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698