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

Side by Side Diff: src/mips64/lithium-codegen-mips64.cc

Issue 1265603002: MIPS64: Fix the integer division in crankshaft. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 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 unified diff | Download patch
« no previous file with comments | « no previous file | src/mips64/simulator-mips64.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "src/v8.h" 5 #include "src/v8.h"
6 6
7 #include "src/code-factory.h" 7 #include "src/code-factory.h"
8 #include "src/code-stubs.h" 8 #include "src/code-stubs.h"
9 #include "src/cpu-profiler.h" 9 #include "src/cpu-profiler.h"
10 #include "src/hydrogen-osr.h" 10 #include "src/hydrogen-osr.h"
(...skipping 1197 matching lines...) Expand 10 before | Expand all | Expand 10 after
1208 1208
1209 // TODO(svenpanne) Refactor this to avoid code duplication with DoFlooringDivI. 1209 // TODO(svenpanne) Refactor this to avoid code duplication with DoFlooringDivI.
1210 void LCodeGen::DoDivI(LDivI* instr) { 1210 void LCodeGen::DoDivI(LDivI* instr) {
1211 HBinaryOperation* hdiv = instr->hydrogen(); 1211 HBinaryOperation* hdiv = instr->hydrogen();
1212 Register dividend = ToRegister(instr->dividend()); 1212 Register dividend = ToRegister(instr->dividend());
1213 Register divisor = ToRegister(instr->divisor()); 1213 Register divisor = ToRegister(instr->divisor());
1214 const Register result = ToRegister(instr->result()); 1214 const Register result = ToRegister(instr->result());
1215 1215
1216 // On MIPS div is asynchronous - it will run in the background while we 1216 // On MIPS div is asynchronous - it will run in the background while we
1217 // check for special cases. 1217 // check for special cases.
1218 __ Ddiv(result, dividend, divisor); 1218 __ Div(result, dividend, divisor);
1219 1219
1220 // Check for x / 0. 1220 // Check for x / 0.
1221 if (hdiv->CheckFlag(HValue::kCanBeDivByZero)) { 1221 if (hdiv->CheckFlag(HValue::kCanBeDivByZero)) {
1222 DeoptimizeIf(eq, instr, Deoptimizer::kDivisionByZero, divisor, 1222 DeoptimizeIf(eq, instr, Deoptimizer::kDivisionByZero, divisor,
1223 Operand(zero_reg)); 1223 Operand(zero_reg));
1224 } 1224 }
1225 1225
1226 // Check for (0 / -x) that will produce negative zero. 1226 // Check for (0 / -x) that will produce negative zero.
1227 if (hdiv->CheckFlag(HValue::kBailoutOnMinusZero)) { 1227 if (hdiv->CheckFlag(HValue::kBailoutOnMinusZero)) {
1228 Label left_not_zero; 1228 Label left_not_zero;
(...skipping 5013 matching lines...) Expand 10 before | Expand all | Expand 10 after
6242 __ Push(at, ToRegister(instr->function())); 6242 __ Push(at, ToRegister(instr->function()));
6243 CallRuntime(Runtime::kPushBlockContext, 2, instr); 6243 CallRuntime(Runtime::kPushBlockContext, 2, instr);
6244 RecordSafepoint(Safepoint::kNoLazyDeopt); 6244 RecordSafepoint(Safepoint::kNoLazyDeopt);
6245 } 6245 }
6246 6246
6247 6247
6248 #undef __ 6248 #undef __
6249 6249
6250 } // namespace internal 6250 } // namespace internal
6251 } // namespace v8 6251 } // namespace v8
OLDNEW
« no previous file with comments | « no previous file | src/mips64/simulator-mips64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698