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

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

Issue 1706763002: [turbofan] Emit memory operands for cmp and test on ia32 and x64 when it makes sense. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Update. Created 4 years, 10 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/ia32/instruction-selector-ia32.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/ast/scopes.h" 7 #include "src/ast/scopes.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 511 matching lines...) Expand 10 before | Expand all | Expand 10 after
522 } 522 }
523 break; 523 break;
524 case kIA32And: 524 case kIA32And:
525 if (HasImmediateInput(instr, 1)) { 525 if (HasImmediateInput(instr, 1)) {
526 __ and_(i.InputOperand(0), i.InputImmediate(1)); 526 __ and_(i.InputOperand(0), i.InputImmediate(1));
527 } else { 527 } else {
528 __ and_(i.InputRegister(0), i.InputOperand(1)); 528 __ and_(i.InputRegister(0), i.InputOperand(1));
529 } 529 }
530 break; 530 break;
531 case kIA32Cmp: 531 case kIA32Cmp:
532 if (HasImmediateInput(instr, 1)) { 532 if (AddressingModeField::decode(instr->opcode()) != kMode_None) {
533 __ cmp(i.InputOperand(0), i.InputImmediate(1)); 533 size_t index = 0;
534 Operand operand = i.MemoryOperand(&index);
535 if (HasImmediateInput(instr, index)) {
536 __ cmp(operand, i.InputImmediate(index));
537 } else {
538 __ cmp(operand, i.InputRegister(index));
539 }
534 } else { 540 } else {
535 __ cmp(i.InputRegister(0), i.InputOperand(1)); 541 if (HasImmediateInput(instr, 1)) {
542 __ cmp(i.InputOperand(0), i.InputImmediate(1));
543 } else {
544 __ cmp(i.InputRegister(0), i.InputOperand(1));
545 }
536 } 546 }
537 break; 547 break;
538 case kIA32Test: 548 case kIA32Test:
539 if (HasImmediateInput(instr, 1)) { 549 if (AddressingModeField::decode(instr->opcode()) != kMode_None) {
540 __ test(i.InputOperand(0), i.InputImmediate(1)); 550 size_t index = 0;
551 Operand operand = i.MemoryOperand(&index);
552 if (HasImmediateInput(instr, index)) {
553 __ test(operand, i.InputImmediate(index));
554 } else {
555 __ test(i.InputRegister(index), operand);
556 }
541 } else { 557 } else {
542 __ test(i.InputRegister(0), i.InputOperand(1)); 558 if (HasImmediateInput(instr, 1)) {
559 __ test(i.InputOperand(0), i.InputImmediate(1));
560 } else {
561 __ test(i.InputRegister(0), i.InputOperand(1));
562 }
543 } 563 }
544 break; 564 break;
545 case kIA32Imul: 565 case kIA32Imul:
546 if (HasImmediateInput(instr, 1)) { 566 if (HasImmediateInput(instr, 1)) {
547 __ imul(i.OutputRegister(), i.InputOperand(0), i.InputInt32(1)); 567 __ imul(i.OutputRegister(), i.InputOperand(0), i.InputInt32(1));
548 } else { 568 } else {
549 __ imul(i.OutputRegister(), i.InputOperand(1)); 569 __ imul(i.OutputRegister(), i.InputOperand(1));
550 } 570 }
551 break; 571 break;
552 case kIA32ImulHigh: 572 case kIA32ImulHigh:
(...skipping 1182 matching lines...) Expand 10 before | Expand all | Expand 10 after
1735 int padding_size = last_lazy_deopt_pc_ + space_needed - current_pc; 1755 int padding_size = last_lazy_deopt_pc_ + space_needed - current_pc;
1736 __ Nop(padding_size); 1756 __ Nop(padding_size);
1737 } 1757 }
1738 } 1758 }
1739 1759
1740 #undef __ 1760 #undef __
1741 1761
1742 } // namespace compiler 1762 } // namespace compiler
1743 } // namespace internal 1763 } // namespace internal
1744 } // namespace v8 1764 } // namespace v8
OLDNEW
« no previous file with comments | « no previous file | src/compiler/ia32/instruction-selector-ia32.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698