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

Side by Side Diff: src/compiler/mips/instruction-selector-mips.cc

Issue 850733004: MIPS: [turbofan] Improve code generation for unordered comparisons. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Fix switch cases. Created 5 years, 11 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 | « src/compiler/mips/code-generator-mips.cc ('k') | src/compiler/mips64/code-generator-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 2014 the V8 project authors. All rights reserved. 1 // Copyright 2014 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/base/bits.h" 5 #include "src/base/bits.h"
6 #include "src/compiler/instruction-selector-impl.h" 6 #include "src/compiler/instruction-selector-impl.h"
7 #include "src/compiler/node-matchers.h" 7 #include "src/compiler/node-matchers.h"
8 8
9 namespace v8 { 9 namespace v8 {
10 namespace internal { 10 namespace internal {
(...skipping 662 matching lines...) Expand 10 before | Expand all | Expand 10 after
673 case IrOpcode::kInt32LessThanOrEqual: 673 case IrOpcode::kInt32LessThanOrEqual:
674 cont->OverwriteAndNegateIfEqual(kSignedLessThanOrEqual); 674 cont->OverwriteAndNegateIfEqual(kSignedLessThanOrEqual);
675 return VisitWordCompare(selector, value, cont); 675 return VisitWordCompare(selector, value, cont);
676 case IrOpcode::kUint32LessThan: 676 case IrOpcode::kUint32LessThan:
677 cont->OverwriteAndNegateIfEqual(kUnsignedLessThan); 677 cont->OverwriteAndNegateIfEqual(kUnsignedLessThan);
678 return VisitWordCompare(selector, value, cont); 678 return VisitWordCompare(selector, value, cont);
679 case IrOpcode::kUint32LessThanOrEqual: 679 case IrOpcode::kUint32LessThanOrEqual:
680 cont->OverwriteAndNegateIfEqual(kUnsignedLessThanOrEqual); 680 cont->OverwriteAndNegateIfEqual(kUnsignedLessThanOrEqual);
681 return VisitWordCompare(selector, value, cont); 681 return VisitWordCompare(selector, value, cont);
682 case IrOpcode::kFloat64Equal: 682 case IrOpcode::kFloat64Equal:
683 cont->OverwriteAndNegateIfEqual(kUnorderedEqual); 683 cont->OverwriteAndNegateIfEqual(kEqual);
684 return VisitFloat64Compare(selector, value, cont); 684 return VisitFloat64Compare(selector, value, cont);
685 case IrOpcode::kFloat64LessThan: 685 case IrOpcode::kFloat64LessThan:
686 cont->OverwriteAndNegateIfEqual(kUnorderedLessThan); 686 cont->OverwriteAndNegateIfEqual(kUnsignedLessThan);
687 return VisitFloat64Compare(selector, value, cont); 687 return VisitFloat64Compare(selector, value, cont);
688 case IrOpcode::kFloat64LessThanOrEqual: 688 case IrOpcode::kFloat64LessThanOrEqual:
689 cont->OverwriteAndNegateIfEqual(kUnorderedLessThanOrEqual); 689 cont->OverwriteAndNegateIfEqual(kUnsignedLessThanOrEqual);
690 return VisitFloat64Compare(selector, value, cont); 690 return VisitFloat64Compare(selector, value, cont);
691 case IrOpcode::kProjection: 691 case IrOpcode::kProjection:
692 // Check if this is the overflow output projection of an 692 // Check if this is the overflow output projection of an
693 // <Operation>WithOverflow node. 693 // <Operation>WithOverflow node.
694 if (OpParameter<size_t>(value) == 1u) { 694 if (OpParameter<size_t>(value) == 1u) {
695 // We cannot combine the <Operation>WithOverflow with this branch 695 // We cannot combine the <Operation>WithOverflow with this branch
696 // unless the 0th projection (the use of the actual value of the 696 // unless the 0th projection (the use of the actual value of the
697 // <Operation> is either NULL, which means there's no use of the 697 // <Operation> is either NULL, which means there's no use of the
698 // actual value, or was already defined, which means it is scheduled 698 // actual value, or was already defined, which means it is scheduled
699 // *AFTER* this branch). 699 // *AFTER* this branch).
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after
791 if (Node* ovf = node->FindProjection(1)) { 791 if (Node* ovf = node->FindProjection(1)) {
792 FlagsContinuation cont(kOverflow, ovf); 792 FlagsContinuation cont(kOverflow, ovf);
793 return VisitBinop(this, node, kMipsSubOvf, &cont); 793 return VisitBinop(this, node, kMipsSubOvf, &cont);
794 } 794 }
795 FlagsContinuation cont; 795 FlagsContinuation cont;
796 VisitBinop(this, node, kMipsSubOvf, &cont); 796 VisitBinop(this, node, kMipsSubOvf, &cont);
797 } 797 }
798 798
799 799
800 void InstructionSelector::VisitFloat64Equal(Node* node) { 800 void InstructionSelector::VisitFloat64Equal(Node* node) {
801 FlagsContinuation cont(kUnorderedEqual, node); 801 FlagsContinuation cont(kEqual, node);
802 VisitFloat64Compare(this, node, &cont); 802 VisitFloat64Compare(this, node, &cont);
803 } 803 }
804 804
805 805
806 void InstructionSelector::VisitFloat64LessThan(Node* node) { 806 void InstructionSelector::VisitFloat64LessThan(Node* node) {
807 FlagsContinuation cont(kUnorderedLessThan, node); 807 FlagsContinuation cont(kUnsignedLessThan, node);
808 VisitFloat64Compare(this, node, &cont); 808 VisitFloat64Compare(this, node, &cont);
809 } 809 }
810 810
811 811
812 void InstructionSelector::VisitFloat64LessThanOrEqual(Node* node) { 812 void InstructionSelector::VisitFloat64LessThanOrEqual(Node* node) {
813 FlagsContinuation cont(kUnorderedLessThanOrEqual, node); 813 FlagsContinuation cont(kUnsignedLessThanOrEqual, node);
814 VisitFloat64Compare(this, node, &cont); 814 VisitFloat64Compare(this, node, &cont);
815 } 815 }
816 816
817 817
818 // static 818 // static
819 MachineOperatorBuilder::Flags 819 MachineOperatorBuilder::Flags
820 InstructionSelector::SupportedMachineOperatorFlags() { 820 InstructionSelector::SupportedMachineOperatorFlags() {
821 if (IsMipsArchVariant(kMips32r2) || IsMipsArchVariant(kMips32r6)) { 821 if (IsMipsArchVariant(kMips32r2) || IsMipsArchVariant(kMips32r6)) {
822 return MachineOperatorBuilder::kFloat64Floor | 822 return MachineOperatorBuilder::kFloat64Floor |
823 MachineOperatorBuilder::kFloat64Ceil | 823 MachineOperatorBuilder::kFloat64Ceil |
824 MachineOperatorBuilder::kFloat64RoundTruncate; 824 MachineOperatorBuilder::kFloat64RoundTruncate;
825 } 825 }
826 return MachineOperatorBuilder::kNoFlags; 826 return MachineOperatorBuilder::kNoFlags;
827 } 827 }
828 828
829 } // namespace compiler 829 } // namespace compiler
830 } // namespace internal 830 } // namespace internal
831 } // namespace v8 831 } // namespace v8
OLDNEW
« no previous file with comments | « src/compiler/mips/code-generator-mips.cc ('k') | src/compiler/mips64/code-generator-mips64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698