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

Side by Side Diff: src/compiler/x64/code-generator-x64.cc

Issue 596643003: [x64] three operand imul supports first operand in memory location (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 3 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | src/x64/assembler-x64.h » ('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 2013 the V8 project authors. All rights reserved. 1 // Copyright 2013 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/compiler/code-generator.h" 5 #include "src/compiler/code-generator.h"
6 6
7 #include "src/compiler/code-generator-impl.h" 7 #include "src/compiler/code-generator-impl.h"
8 #include "src/compiler/gap-resolver.h" 8 #include "src/compiler/gap-resolver.h"
9 #include "src/compiler/node-matchers.h" 9 #include "src/compiler/node-matchers.h"
10 #include "src/compiler/node-properties-inl.h" 10 #include "src/compiler/node-properties-inl.h"
(...skipping 257 matching lines...) Expand 10 before | Expand all | Expand 10 after
268 break; 268 break;
269 case kX64Test: 269 case kX64Test:
270 ASSEMBLE_BINOP(testq); 270 ASSEMBLE_BINOP(testq);
271 break; 271 break;
272 case kX64Imul32: 272 case kX64Imul32:
273 if (HasImmediateInput(instr, 1)) { 273 if (HasImmediateInput(instr, 1)) {
274 RegisterOrOperand input = i.InputRegisterOrOperand(0); 274 RegisterOrOperand input = i.InputRegisterOrOperand(0);
275 if (input.type == kRegister) { 275 if (input.type == kRegister) {
276 __ imull(i.OutputRegister(), input.reg, i.InputImmediate(1)); 276 __ imull(i.OutputRegister(), input.reg, i.InputImmediate(1));
277 } else { 277 } else {
278 __ movq(kScratchRegister, input.operand); 278 __ imull(i.OutputRegister(), input.operand, i.InputImmediate(1));
279 __ imull(i.OutputRegister(), kScratchRegister, i.InputImmediate(1));
280 } 279 }
281 } else { 280 } else {
282 RegisterOrOperand input = i.InputRegisterOrOperand(1); 281 RegisterOrOperand input = i.InputRegisterOrOperand(1);
283 if (input.type == kRegister) { 282 if (input.type == kRegister) {
284 __ imull(i.OutputRegister(), input.reg); 283 __ imull(i.OutputRegister(), input.reg);
285 } else { 284 } else {
286 __ imull(i.OutputRegister(), input.operand); 285 __ imull(i.OutputRegister(), input.operand);
287 } 286 }
288 } 287 }
289 break; 288 break;
290 case kX64Imul: 289 case kX64Imul:
291 if (HasImmediateInput(instr, 1)) { 290 if (HasImmediateInput(instr, 1)) {
292 RegisterOrOperand input = i.InputRegisterOrOperand(0); 291 RegisterOrOperand input = i.InputRegisterOrOperand(0);
293 if (input.type == kRegister) { 292 if (input.type == kRegister) {
294 __ imulq(i.OutputRegister(), input.reg, i.InputImmediate(1)); 293 __ imulq(i.OutputRegister(), input.reg, i.InputImmediate(1));
295 } else { 294 } else {
296 __ movq(kScratchRegister, input.operand); 295 __ imulq(i.OutputRegister(), input.operand, i.InputImmediate(1));
297 __ imulq(i.OutputRegister(), kScratchRegister, i.InputImmediate(1));
298 } 296 }
299 } else { 297 } else {
300 RegisterOrOperand input = i.InputRegisterOrOperand(1); 298 RegisterOrOperand input = i.InputRegisterOrOperand(1);
301 if (input.type == kRegister) { 299 if (input.type == kRegister) {
302 __ imulq(i.OutputRegister(), input.reg); 300 __ imulq(i.OutputRegister(), input.reg);
303 } else { 301 } else {
304 __ imulq(i.OutputRegister(), input.operand); 302 __ imulq(i.OutputRegister(), input.operand);
305 } 303 }
306 } 304 }
307 break; 305 break;
(...skipping 681 matching lines...) Expand 10 before | Expand all | Expand 10 after
989 } 987 }
990 988
991 989
992 void CodeGenerator::AddNopForSmiCodeInlining() { __ nop(); } 990 void CodeGenerator::AddNopForSmiCodeInlining() { __ nop(); }
993 991
994 #undef __ 992 #undef __
995 993
996 } // namespace internal 994 } // namespace internal
997 } // namespace compiler 995 } // namespace compiler
998 } // namespace v8 996 } // namespace v8
OLDNEW
« no previous file with comments | « no previous file | src/x64/assembler-x64.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698