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

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

Issue 1973493003: [turbofan] Introduce new operators Float32SubPreserveNan and Float64SubPreserveNan for wasm. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 7 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/arm64/instruction-selector-arm64.cc ('k') | src/compiler/instruction-selector.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/adapters.h" 5 #include "src/base/adapters.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 #include "src/compiler/node-properties.h" 8 #include "src/compiler/node-properties.h"
9 9
10 namespace v8 { 10 namespace v8 {
(...skipping 901 matching lines...) Expand 10 before | Expand all | Expand 10 after
912 IA32OperandGenerator g(this); 912 IA32OperandGenerator g(this);
913 Float32BinopMatcher m(node); 913 Float32BinopMatcher m(node);
914 if (m.left().IsMinusZero()) { 914 if (m.left().IsMinusZero()) {
915 VisitFloatUnop(this, node, m.right().node(), kAVXFloat32Neg, 915 VisitFloatUnop(this, node, m.right().node(), kAVXFloat32Neg,
916 kSSEFloat32Neg); 916 kSSEFloat32Neg);
917 return; 917 return;
918 } 918 }
919 VisitRROFloat(this, node, kAVXFloat32Sub, kSSEFloat32Sub); 919 VisitRROFloat(this, node, kAVXFloat32Sub, kSSEFloat32Sub);
920 } 920 }
921 921
922 void InstructionSelector::VisitFloat32SubPreserveNan(Node* node) {
923 VisitRROFloat(this, node, kAVXFloat32Sub, kSSEFloat32Sub);
924 }
922 925
923 void InstructionSelector::VisitFloat64Sub(Node* node) { 926 void InstructionSelector::VisitFloat64Sub(Node* node) {
924 IA32OperandGenerator g(this); 927 IA32OperandGenerator g(this);
925 Float64BinopMatcher m(node); 928 Float64BinopMatcher m(node);
926 if (m.left().IsMinusZero()) { 929 if (m.left().IsMinusZero()) {
927 if (m.right().IsFloat64RoundDown() && 930 if (m.right().IsFloat64RoundDown() &&
928 CanCover(m.node(), m.right().node())) { 931 CanCover(m.node(), m.right().node())) {
929 if (m.right().InputAt(0)->opcode() == IrOpcode::kFloat64Sub && 932 if (m.right().InputAt(0)->opcode() == IrOpcode::kFloat64Sub &&
930 CanCover(m.right().node(), m.right().InputAt(0))) { 933 CanCover(m.right().node(), m.right().InputAt(0))) {
931 Float64BinopMatcher mright0(m.right().InputAt(0)); 934 Float64BinopMatcher mright0(m.right().InputAt(0));
932 if (mright0.left().IsMinusZero()) { 935 if (mright0.left().IsMinusZero()) {
933 Emit(kSSEFloat64Round | MiscField::encode(kRoundUp), 936 Emit(kSSEFloat64Round | MiscField::encode(kRoundUp),
934 g.DefineAsRegister(node), g.UseRegister(mright0.right().node())); 937 g.DefineAsRegister(node), g.UseRegister(mright0.right().node()));
935 return; 938 return;
936 } 939 }
937 } 940 }
938 } 941 }
939 VisitFloatUnop(this, node, m.right().node(), kAVXFloat64Neg, 942 VisitFloatUnop(this, node, m.right().node(), kAVXFloat64Neg,
940 kSSEFloat64Neg); 943 kSSEFloat64Neg);
941 return; 944 return;
942 } 945 }
943 VisitRROFloat(this, node, kAVXFloat64Sub, kSSEFloat64Sub); 946 VisitRROFloat(this, node, kAVXFloat64Sub, kSSEFloat64Sub);
944 } 947 }
945 948
949 void InstructionSelector::VisitFloat64SubPreserveNan(Node* node) {
950 VisitRROFloat(this, node, kAVXFloat64Sub, kSSEFloat64Sub);
951 }
946 952
947 void InstructionSelector::VisitFloat32Mul(Node* node) { 953 void InstructionSelector::VisitFloat32Mul(Node* node) {
948 VisitRROFloat(this, node, kAVXFloat32Mul, kSSEFloat32Mul); 954 VisitRROFloat(this, node, kAVXFloat32Mul, kSSEFloat32Mul);
949 } 955 }
950 956
951 957
952 void InstructionSelector::VisitFloat64Mul(Node* node) { 958 void InstructionSelector::VisitFloat64Mul(Node* node) {
953 VisitRROFloat(this, node, kAVXFloat64Mul, kSSEFloat64Mul); 959 VisitRROFloat(this, node, kAVXFloat64Mul, kSSEFloat64Mul);
954 } 960 }
955 961
(...skipping 725 matching lines...) Expand 10 before | Expand all | Expand 10 after
1681 MachineOperatorBuilder::kFloat64RoundTruncate | 1687 MachineOperatorBuilder::kFloat64RoundTruncate |
1682 MachineOperatorBuilder::kFloat32RoundTiesEven | 1688 MachineOperatorBuilder::kFloat32RoundTiesEven |
1683 MachineOperatorBuilder::kFloat64RoundTiesEven; 1689 MachineOperatorBuilder::kFloat64RoundTiesEven;
1684 } 1690 }
1685 return flags; 1691 return flags;
1686 } 1692 }
1687 1693
1688 } // namespace compiler 1694 } // namespace compiler
1689 } // namespace internal 1695 } // namespace internal
1690 } // namespace v8 1696 } // namespace v8
OLDNEW
« no previous file with comments | « src/compiler/arm64/instruction-selector-arm64.cc ('k') | src/compiler/instruction-selector.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698