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

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

Issue 1064833002: [ia32] Match -0 - x with sign bit flip. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 8 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
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/compiler/instruction-selector-impl.h" 5 #include "src/compiler/instruction-selector-impl.h"
6 #include "src/compiler/node-matchers.h" 6 #include "src/compiler/node-matchers.h"
7 #include "src/compiler/node-properties.h" 7 #include "src/compiler/node-properties.h"
8 8
9 namespace v8 { 9 namespace v8 {
10 namespace internal { 10 namespace internal {
(...skipping 657 matching lines...) Expand 10 before | Expand all | Expand 10 after
668 VisitRROFloat(this, node, kAVXFloat32Add, kSSEFloat32Add); 668 VisitRROFloat(this, node, kAVXFloat32Add, kSSEFloat32Add);
669 } 669 }
670 670
671 671
672 void InstructionSelector::VisitFloat64Add(Node* node) { 672 void InstructionSelector::VisitFloat64Add(Node* node) {
673 VisitRROFloat(this, node, kAVXFloat64Add, kSSEFloat64Add); 673 VisitRROFloat(this, node, kAVXFloat64Add, kSSEFloat64Add);
674 } 674 }
675 675
676 676
677 void InstructionSelector::VisitFloat32Sub(Node* node) { 677 void InstructionSelector::VisitFloat32Sub(Node* node) {
678 IA32OperandGenerator g(this);
679 Float32BinopMatcher m(node);
680 if (m.left().IsMinusZero()) {
681 Emit(kSSEFloat32Neg, g.DefineSameAsFirst(node),
682 g.UseRegister(m.right().node()));
683 return;
684 }
678 VisitRROFloat(this, node, kAVXFloat32Sub, kSSEFloat32Sub); 685 VisitRROFloat(this, node, kAVXFloat32Sub, kSSEFloat32Sub);
679 } 686 }
680 687
681 688
682 void InstructionSelector::VisitFloat64Sub(Node* node) { 689 void InstructionSelector::VisitFloat64Sub(Node* node) {
683 IA32OperandGenerator g(this); 690 IA32OperandGenerator g(this);
684 Float64BinopMatcher m(node); 691 Float64BinopMatcher m(node);
685 if (m.left().IsMinusZero() && m.right().IsFloat64RoundDown() && 692 if (m.left().IsMinusZero()) {
686 CanCover(m.node(), m.right().node())) { 693 if (m.right().IsFloat64RoundDown() &&
687 if (m.right().InputAt(0)->opcode() == IrOpcode::kFloat64Sub && 694 CanCover(m.node(), m.right().node())) {
688 CanCover(m.right().node(), m.right().InputAt(0))) { 695 if (m.right().InputAt(0)->opcode() == IrOpcode::kFloat64Sub &&
689 Float64BinopMatcher mright0(m.right().InputAt(0)); 696 CanCover(m.right().node(), m.right().InputAt(0))) {
690 if (mright0.left().IsMinusZero()) { 697 Float64BinopMatcher mright0(m.right().InputAt(0));
691 Emit(kSSEFloat64Round | MiscField::encode(kRoundUp), 698 if (mright0.left().IsMinusZero()) {
692 g.DefineAsRegister(node), g.UseRegister(mright0.right().node())); 699 Emit(kSSEFloat64Round | MiscField::encode(kRoundUp),
693 return; 700 g.DefineAsRegister(node), g.UseRegister(mright0.right().node()));
701 return;
702 }
694 } 703 }
695 } 704 }
705 Emit(kSSEFloat64Neg, g.DefineSameAsFirst(node),
706 g.UseRegister(m.right().node()));
707 return;
696 } 708 }
697 VisitRROFloat(this, node, kAVXFloat64Sub, kSSEFloat64Sub); 709 VisitRROFloat(this, node, kAVXFloat64Sub, kSSEFloat64Sub);
698 } 710 }
699 711
700 712
701 void InstructionSelector::VisitFloat32Mul(Node* node) { 713 void InstructionSelector::VisitFloat32Mul(Node* node) {
702 VisitRROFloat(this, node, kAVXFloat32Mul, kSSEFloat32Mul); 714 VisitRROFloat(this, node, kAVXFloat32Mul, kSSEFloat32Mul);
703 } 715 }
704 716
705 717
(...skipping 486 matching lines...) Expand 10 before | Expand all | Expand 10 after
1192 if (CpuFeatures::IsSupported(SSE4_1)) { 1204 if (CpuFeatures::IsSupported(SSE4_1)) {
1193 flags |= MachineOperatorBuilder::kFloat64RoundDown | 1205 flags |= MachineOperatorBuilder::kFloat64RoundDown |
1194 MachineOperatorBuilder::kFloat64RoundTruncate; 1206 MachineOperatorBuilder::kFloat64RoundTruncate;
1195 } 1207 }
1196 return flags; 1208 return flags;
1197 } 1209 }
1198 1210
1199 } // namespace compiler 1211 } // namespace compiler
1200 } // namespace internal 1212 } // namespace internal
1201 } // namespace v8 1213 } // namespace v8
OLDNEW
« no previous file with comments | « src/compiler/ia32/instruction-codes-ia32.h ('k') | test/unittests/compiler/ia32/instruction-selector-ia32-unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698