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

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

Issue 2418803002: [turbofan]: Micro optimizations to lea[l/q] on ia32/x64 (Closed)
Patch Set: Fix syntax error Created 4 years, 2 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/compiler/x64/code-generator-x64.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 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/compilation-info.h" 7 #include "src/compilation-info.h"
8 #include "src/compiler/code-generator-impl.h" 8 #include "src/compiler/code-generator-impl.h"
9 #include "src/compiler/gap-resolver.h" 9 #include "src/compiler/gap-resolver.h"
10 #include "src/compiler/node-matchers.h" 10 #include "src/compiler/node-matchers.h"
(...skipping 1443 matching lines...) Expand 10 before | Expand all | Expand 10 after
1454 int32_t constant_summand = i.InputInt32(1); 1454 int32_t constant_summand = i.InputInt32(1);
1455 if (constant_summand > 0) { 1455 if (constant_summand > 0) {
1456 __ add(i.OutputRegister(), Immediate(constant_summand)); 1456 __ add(i.OutputRegister(), Immediate(constant_summand));
1457 } else if (constant_summand < 0) { 1457 } else if (constant_summand < 0) {
1458 __ sub(i.OutputRegister(), Immediate(-constant_summand)); 1458 __ sub(i.OutputRegister(), Immediate(-constant_summand));
1459 } 1459 }
1460 } else if (mode == kMode_MR1) { 1460 } else if (mode == kMode_MR1) {
1461 if (i.InputRegister(1).is(i.OutputRegister())) { 1461 if (i.InputRegister(1).is(i.OutputRegister())) {
1462 __ shl(i.OutputRegister(), 1); 1462 __ shl(i.OutputRegister(), 1);
1463 } else { 1463 } else {
1464 __ lea(i.OutputRegister(), i.MemoryOperand()); 1464 __ add(i.OutputRegister(), i.InputRegister(1));
1465 } 1465 }
1466 } else if (mode == kMode_M2) { 1466 } else if (mode == kMode_M2) {
1467 __ shl(i.OutputRegister(), 1); 1467 __ shl(i.OutputRegister(), 1);
1468 } else if (mode == kMode_M4) { 1468 } else if (mode == kMode_M4) {
1469 __ shl(i.OutputRegister(), 2); 1469 __ shl(i.OutputRegister(), 2);
1470 } else if (mode == kMode_M8) { 1470 } else if (mode == kMode_M8) {
1471 __ shl(i.OutputRegister(), 3); 1471 __ shl(i.OutputRegister(), 3);
1472 } else { 1472 } else {
1473 __ lea(i.OutputRegister(), i.MemoryOperand()); 1473 __ lea(i.OutputRegister(), i.MemoryOperand());
1474 } 1474 }
1475 } else if (mode == kMode_MR1 &&
1476 i.InputRegister(1).is(i.OutputRegister())) {
1477 __ add(i.OutputRegister(), i.InputRegister(0));
1475 } else { 1478 } else {
1476 __ lea(i.OutputRegister(), i.MemoryOperand()); 1479 __ lea(i.OutputRegister(), i.MemoryOperand());
1477 } 1480 }
1478 break; 1481 break;
1479 } 1482 }
1480 case kIA32PushFloat32: 1483 case kIA32PushFloat32:
1481 if (instr->InputAt(0)->IsFPRegister()) { 1484 if (instr->InputAt(0)->IsFPRegister()) {
1482 __ sub(esp, Immediate(kFloatSize)); 1485 __ sub(esp, Immediate(kFloatSize));
1483 __ movss(Operand(esp, 0), i.InputDoubleRegister(0)); 1486 __ movss(Operand(esp, 0), i.InputDoubleRegister(0));
1484 frame_access_state()->IncreaseSPDelta(kFloatSize / kPointerSize); 1487 frame_access_state()->IncreaseSPDelta(kFloatSize / kPointerSize);
(...skipping 770 matching lines...) Expand 10 before | Expand all | Expand 10 after
2255 int padding_size = last_lazy_deopt_pc_ + space_needed - current_pc; 2258 int padding_size = last_lazy_deopt_pc_ + space_needed - current_pc;
2256 __ Nop(padding_size); 2259 __ Nop(padding_size);
2257 } 2260 }
2258 } 2261 }
2259 2262
2260 #undef __ 2263 #undef __
2261 2264
2262 } // namespace compiler 2265 } // namespace compiler
2263 } // namespace internal 2266 } // namespace internal
2264 } // namespace v8 2267 } // namespace v8
OLDNEW
« no previous file with comments | « no previous file | src/compiler/x64/code-generator-x64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698