OLD | NEW |
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 <algorithm> | 5 #include <algorithm> |
6 | 6 |
7 #include "src/compiler/instruction-selector-impl.h" | 7 #include "src/compiler/instruction-selector-impl.h" |
8 #include "src/compiler/node-matchers.h" | 8 #include "src/compiler/node-matchers.h" |
9 #include "src/compiler/node-properties.h" | 9 #include "src/compiler/node-properties.h" |
10 | 10 |
(...skipping 717 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
728 } | 728 } |
729 | 729 |
730 | 730 |
731 void InstructionSelector::VisitUint32MulHigh(Node* node) { | 731 void InstructionSelector::VisitUint32MulHigh(Node* node) { |
732 VisitMulHigh(this, node, kX64UmulHigh32); | 732 VisitMulHigh(this, node, kX64UmulHigh32); |
733 } | 733 } |
734 | 734 |
735 | 735 |
736 void InstructionSelector::VisitChangeFloat32ToFloat64(Node* node) { | 736 void InstructionSelector::VisitChangeFloat32ToFloat64(Node* node) { |
737 X64OperandGenerator g(this); | 737 X64OperandGenerator g(this); |
738 Emit(kSSECvtss2sd, g.DefineAsRegister(node), g.Use(node->InputAt(0))); | 738 Emit(kSSEFloat32ToFloat64, g.DefineAsRegister(node), g.Use(node->InputAt(0))); |
739 } | 739 } |
740 | 740 |
741 | 741 |
742 void InstructionSelector::VisitChangeInt32ToFloat64(Node* node) { | 742 void InstructionSelector::VisitChangeInt32ToFloat64(Node* node) { |
743 X64OperandGenerator g(this); | 743 X64OperandGenerator g(this); |
744 Emit(kSSEInt32ToFloat64, g.DefineAsRegister(node), g.Use(node->InputAt(0))); | 744 Emit(kSSEInt32ToFloat64, g.DefineAsRegister(node), g.Use(node->InputAt(0))); |
745 } | 745 } |
746 | 746 |
747 | 747 |
748 void InstructionSelector::VisitChangeUint32ToFloat64(Node* node) { | 748 void InstructionSelector::VisitChangeUint32ToFloat64(Node* node) { |
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
801 } | 801 } |
802 default: | 802 default: |
803 break; | 803 break; |
804 } | 804 } |
805 Emit(kX64Movl, g.DefineAsRegister(node), g.Use(value)); | 805 Emit(kX64Movl, g.DefineAsRegister(node), g.Use(value)); |
806 } | 806 } |
807 | 807 |
808 | 808 |
809 void InstructionSelector::VisitTruncateFloat64ToFloat32(Node* node) { | 809 void InstructionSelector::VisitTruncateFloat64ToFloat32(Node* node) { |
810 X64OperandGenerator g(this); | 810 X64OperandGenerator g(this); |
811 Emit(kSSECvtsd2ss, g.DefineAsRegister(node), g.Use(node->InputAt(0))); | 811 Emit(kSSEFloat64ToFloat32, g.DefineAsRegister(node), g.Use(node->InputAt(0))); |
812 } | 812 } |
813 | 813 |
814 | 814 |
815 void InstructionSelector::VisitTruncateInt64ToInt32(Node* node) { | 815 void InstructionSelector::VisitTruncateInt64ToInt32(Node* node) { |
816 X64OperandGenerator g(this); | 816 X64OperandGenerator g(this); |
817 Node* value = node->InputAt(0); | 817 Node* value = node->InputAt(0); |
818 if (CanCover(node, value)) { | 818 if (CanCover(node, value)) { |
819 switch (value->opcode()) { | 819 switch (value->opcode()) { |
820 case IrOpcode::kWord64Sar: | 820 case IrOpcode::kWord64Sar: |
821 case IrOpcode::kWord64Shr: { | 821 case IrOpcode::kWord64Shr: { |
822 Int64BinopMatcher m(value); | 822 Int64BinopMatcher m(value); |
823 if (m.right().Is(32)) { | 823 if (m.right().Is(32)) { |
824 Emit(kX64Shr, g.DefineSameAsFirst(node), | 824 Emit(kX64Shr, g.DefineSameAsFirst(node), |
825 g.UseRegister(m.left().node()), g.TempImmediate(32)); | 825 g.UseRegister(m.left().node()), g.TempImmediate(32)); |
826 return; | 826 return; |
827 } | 827 } |
828 break; | 828 break; |
829 } | 829 } |
830 default: | 830 default: |
831 break; | 831 break; |
832 } | 832 } |
833 } | 833 } |
834 Emit(kX64Movl, g.DefineAsRegister(node), g.Use(value)); | 834 Emit(kX64Movl, g.DefineAsRegister(node), g.Use(value)); |
835 } | 835 } |
836 | 836 |
837 | 837 |
| 838 namespace { |
| 839 |
| 840 void VisitFloatBinop(InstructionSelector* selector, Node* node, |
| 841 ArchOpcode avx_opcode, ArchOpcode sse_opcode) { |
| 842 X64OperandGenerator g(selector); |
| 843 InstructionOperand operand0 = g.UseRegister(node->InputAt(0)); |
| 844 InstructionOperand operand1 = g.Use(node->InputAt(1)); |
| 845 if (selector->IsSupported(AVX)) { |
| 846 selector->Emit(avx_opcode, g.DefineAsRegister(node), operand0, operand1); |
| 847 } else { |
| 848 selector->Emit(sse_opcode, g.DefineSameAsFirst(node), operand0, operand1); |
| 849 } |
| 850 } |
| 851 |
| 852 } // namespace |
| 853 |
| 854 |
| 855 void InstructionSelector::VisitFloat32Add(Node* node) { |
| 856 VisitFloatBinop(this, node, kAVXFloat32Add, kSSEFloat32Add); |
| 857 } |
| 858 |
| 859 |
| 860 void InstructionSelector::VisitFloat32Sub(Node* node) { |
| 861 VisitFloatBinop(this, node, kAVXFloat32Sub, kSSEFloat32Sub); |
| 862 } |
| 863 |
| 864 |
| 865 void InstructionSelector::VisitFloat32Mul(Node* node) { |
| 866 VisitFloatBinop(this, node, kAVXFloat32Mul, kSSEFloat32Mul); |
| 867 } |
| 868 |
| 869 |
| 870 void InstructionSelector::VisitFloat32Div(Node* node) { |
| 871 VisitFloatBinop(this, node, kAVXFloat32Div, kSSEFloat32Div); |
| 872 } |
| 873 |
| 874 |
| 875 void InstructionSelector::VisitFloat32Max(Node* node) { |
| 876 VisitFloatBinop(this, node, kAVXFloat32Max, kSSEFloat32Max); |
| 877 } |
| 878 |
| 879 |
| 880 void InstructionSelector::VisitFloat32Min(Node* node) { |
| 881 VisitFloatBinop(this, node, kAVXFloat32Min, kSSEFloat32Min); |
| 882 } |
| 883 |
| 884 |
| 885 void InstructionSelector::VisitFloat32Sqrt(Node* node) { |
| 886 X64OperandGenerator g(this); |
| 887 Emit(kSSEFloat32Sqrt, g.DefineAsRegister(node), g.Use(node->InputAt(0))); |
| 888 } |
| 889 |
| 890 |
838 void InstructionSelector::VisitFloat64Add(Node* node) { | 891 void InstructionSelector::VisitFloat64Add(Node* node) { |
839 X64OperandGenerator g(this); | 892 VisitFloatBinop(this, node, kAVXFloat64Add, kSSEFloat64Add); |
840 if (IsSupported(AVX)) { | |
841 Emit(kAVXFloat64Add, g.DefineAsRegister(node), | |
842 g.UseRegister(node->InputAt(0)), g.Use(node->InputAt(1))); | |
843 } else { | |
844 Emit(kSSEFloat64Add, g.DefineSameAsFirst(node), | |
845 g.UseRegister(node->InputAt(0)), g.Use(node->InputAt(1))); | |
846 } | |
847 } | 893 } |
848 | 894 |
849 | 895 |
850 void InstructionSelector::VisitFloat64Sub(Node* node) { | 896 void InstructionSelector::VisitFloat64Sub(Node* node) { |
851 X64OperandGenerator g(this); | 897 X64OperandGenerator g(this); |
852 Float64BinopMatcher m(node); | 898 Float64BinopMatcher m(node); |
853 if (m.left().IsMinusZero() && m.right().IsFloat64RoundDown() && | 899 if (m.left().IsMinusZero() && m.right().IsFloat64RoundDown() && |
854 CanCover(m.node(), m.right().node())) { | 900 CanCover(m.node(), m.right().node())) { |
855 if (m.right().InputAt(0)->opcode() == IrOpcode::kFloat64Sub && | 901 if (m.right().InputAt(0)->opcode() == IrOpcode::kFloat64Sub && |
856 CanCover(m.right().node(), m.right().InputAt(0))) { | 902 CanCover(m.right().node(), m.right().InputAt(0))) { |
857 Float64BinopMatcher mright0(m.right().InputAt(0)); | 903 Float64BinopMatcher mright0(m.right().InputAt(0)); |
858 if (mright0.left().IsMinusZero()) { | 904 if (mright0.left().IsMinusZero()) { |
859 Emit(kSSEFloat64Round | MiscField::encode(kRoundUp), | 905 Emit(kSSEFloat64Round | MiscField::encode(kRoundUp), |
860 g.DefineAsRegister(node), g.UseRegister(mright0.right().node())); | 906 g.DefineAsRegister(node), g.UseRegister(mright0.right().node())); |
861 return; | 907 return; |
862 } | 908 } |
863 } | 909 } |
864 } | 910 } |
865 if (IsSupported(AVX)) { | 911 VisitFloatBinop(this, node, kAVXFloat64Sub, kSSEFloat64Sub); |
866 Emit(kAVXFloat64Sub, g.DefineAsRegister(node), | |
867 g.UseRegister(node->InputAt(0)), g.Use(node->InputAt(1))); | |
868 } else { | |
869 Emit(kSSEFloat64Sub, g.DefineSameAsFirst(node), | |
870 g.UseRegister(node->InputAt(0)), g.Use(node->InputAt(1))); | |
871 } | |
872 } | 912 } |
873 | 913 |
874 | 914 |
875 void InstructionSelector::VisitFloat64Mul(Node* node) { | 915 void InstructionSelector::VisitFloat64Mul(Node* node) { |
876 X64OperandGenerator g(this); | 916 VisitFloatBinop(this, node, kAVXFloat64Mul, kSSEFloat64Mul); |
877 if (IsSupported(AVX)) { | |
878 Emit(kAVXFloat64Mul, g.DefineAsRegister(node), | |
879 g.UseRegister(node->InputAt(0)), g.Use(node->InputAt(1))); | |
880 } else { | |
881 Emit(kSSEFloat64Mul, g.DefineSameAsFirst(node), | |
882 g.UseRegister(node->InputAt(0)), g.Use(node->InputAt(1))); | |
883 } | |
884 } | 917 } |
885 | 918 |
886 | 919 |
887 void InstructionSelector::VisitFloat64Div(Node* node) { | 920 void InstructionSelector::VisitFloat64Div(Node* node) { |
888 X64OperandGenerator g(this); | 921 VisitFloatBinop(this, node, kAVXFloat64Div, kSSEFloat64Div); |
889 if (IsSupported(AVX)) { | |
890 Emit(kAVXFloat64Div, g.DefineAsRegister(node), | |
891 g.UseRegister(node->InputAt(0)), g.Use(node->InputAt(1))); | |
892 } else { | |
893 Emit(kSSEFloat64Div, g.DefineSameAsFirst(node), | |
894 g.UseRegister(node->InputAt(0)), g.Use(node->InputAt(1))); | |
895 } | |
896 } | 922 } |
897 | 923 |
898 | 924 |
899 void InstructionSelector::VisitFloat64Mod(Node* node) { | 925 void InstructionSelector::VisitFloat64Mod(Node* node) { |
900 X64OperandGenerator g(this); | 926 X64OperandGenerator g(this); |
901 InstructionOperand temps[] = {g.TempRegister(rax)}; | 927 InstructionOperand temps[] = {g.TempRegister(rax)}; |
902 Emit(kSSEFloat64Mod, g.DefineSameAsFirst(node), | 928 Emit(kSSEFloat64Mod, g.DefineSameAsFirst(node), |
903 g.UseRegister(node->InputAt(0)), g.UseRegister(node->InputAt(1)), 1, | 929 g.UseRegister(node->InputAt(0)), g.UseRegister(node->InputAt(1)), 1, |
904 temps); | 930 temps); |
905 } | 931 } |
906 | 932 |
907 | 933 |
908 void InstructionSelector::VisitFloat64Max(Node* node) { | 934 void InstructionSelector::VisitFloat64Max(Node* node) { |
909 X64OperandGenerator g(this); | 935 VisitFloatBinop(this, node, kAVXFloat64Max, kSSEFloat64Max); |
910 if (IsSupported(AVX)) { | |
911 Emit(kAVXFloat64Max, g.DefineAsRegister(node), | |
912 g.UseRegister(node->InputAt(0)), g.Use(node->InputAt(1))); | |
913 } else { | |
914 Emit(kSSEFloat64Max, g.DefineSameAsFirst(node), | |
915 g.UseRegister(node->InputAt(0)), g.Use(node->InputAt(1))); | |
916 } | |
917 } | 936 } |
918 | 937 |
919 | 938 |
920 void InstructionSelector::VisitFloat64Min(Node* node) { | 939 void InstructionSelector::VisitFloat64Min(Node* node) { |
921 X64OperandGenerator g(this); | 940 VisitFloatBinop(this, node, kAVXFloat64Min, kSSEFloat64Min); |
922 if (IsSupported(AVX)) { | |
923 Emit(kAVXFloat64Min, g.DefineAsRegister(node), | |
924 g.UseRegister(node->InputAt(0)), g.Use(node->InputAt(1))); | |
925 } else { | |
926 Emit(kSSEFloat64Min, g.DefineSameAsFirst(node), | |
927 g.UseRegister(node->InputAt(0)), g.Use(node->InputAt(1))); | |
928 } | |
929 } | 941 } |
930 | 942 |
931 | 943 |
932 void InstructionSelector::VisitFloat64Sqrt(Node* node) { | 944 void InstructionSelector::VisitFloat64Sqrt(Node* node) { |
933 X64OperandGenerator g(this); | 945 X64OperandGenerator g(this); |
934 Emit(kSSEFloat64Sqrt, g.DefineAsRegister(node), g.Use(node->InputAt(0))); | 946 Emit(kSSEFloat64Sqrt, g.DefineAsRegister(node), g.Use(node->InputAt(0))); |
935 } | 947 } |
936 | 948 |
937 | 949 |
938 namespace { | 950 namespace { |
(...skipping 161 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1100 | 1112 |
1101 | 1113 |
1102 // Shared routine for comparison with zero. | 1114 // Shared routine for comparison with zero. |
1103 void VisitCompareZero(InstructionSelector* selector, Node* node, | 1115 void VisitCompareZero(InstructionSelector* selector, Node* node, |
1104 InstructionCode opcode, FlagsContinuation* cont) { | 1116 InstructionCode opcode, FlagsContinuation* cont) { |
1105 X64OperandGenerator g(selector); | 1117 X64OperandGenerator g(selector); |
1106 VisitCompare(selector, opcode, g.Use(node), g.TempImmediate(0), cont); | 1118 VisitCompare(selector, opcode, g.Use(node), g.TempImmediate(0), cont); |
1107 } | 1119 } |
1108 | 1120 |
1109 | 1121 |
| 1122 // Shared routine for multiple float32 compare operations (inputs commuted). |
| 1123 void VisitFloat32Compare(InstructionSelector* selector, Node* node, |
| 1124 FlagsContinuation* cont) { |
| 1125 Node* const left = node->InputAt(0); |
| 1126 Node* const right = node->InputAt(1); |
| 1127 InstructionCode const opcode = |
| 1128 selector->IsSupported(AVX) ? kAVXFloat32Cmp : kSSEFloat32Cmp; |
| 1129 VisitCompare(selector, opcode, right, left, cont, false); |
| 1130 } |
| 1131 |
| 1132 |
1110 // Shared routine for multiple float64 compare operations (inputs commuted). | 1133 // Shared routine for multiple float64 compare operations (inputs commuted). |
1111 void VisitFloat64Compare(InstructionSelector* selector, Node* node, | 1134 void VisitFloat64Compare(InstructionSelector* selector, Node* node, |
1112 FlagsContinuation* cont) { | 1135 FlagsContinuation* cont) { |
1113 Node* const left = node->InputAt(0); | 1136 Node* const left = node->InputAt(0); |
1114 Node* const right = node->InputAt(1); | 1137 Node* const right = node->InputAt(1); |
1115 VisitCompare(selector, kSSEFloat64Cmp, right, left, cont, false); | 1138 InstructionCode const opcode = |
| 1139 selector->IsSupported(AVX) ? kAVXFloat64Cmp : kSSEFloat64Cmp; |
| 1140 VisitCompare(selector, opcode, right, left, cont, false); |
1116 } | 1141 } |
1117 | 1142 |
1118 } // namespace | 1143 } // namespace |
1119 | 1144 |
1120 | 1145 |
1121 void InstructionSelector::VisitBranch(Node* branch, BasicBlock* tbranch, | 1146 void InstructionSelector::VisitBranch(Node* branch, BasicBlock* tbranch, |
1122 BasicBlock* fbranch) { | 1147 BasicBlock* fbranch) { |
1123 X64OperandGenerator g(this); | 1148 X64OperandGenerator g(this); |
1124 Node* user = branch; | 1149 Node* user = branch; |
1125 Node* value = branch->InputAt(0); | 1150 Node* value = branch->InputAt(0); |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1161 return VisitWord64Compare(this, value, &cont); | 1186 return VisitWord64Compare(this, value, &cont); |
1162 case IrOpcode::kInt64LessThan: | 1187 case IrOpcode::kInt64LessThan: |
1163 cont.OverwriteAndNegateIfEqual(kSignedLessThan); | 1188 cont.OverwriteAndNegateIfEqual(kSignedLessThan); |
1164 return VisitWord64Compare(this, value, &cont); | 1189 return VisitWord64Compare(this, value, &cont); |
1165 case IrOpcode::kInt64LessThanOrEqual: | 1190 case IrOpcode::kInt64LessThanOrEqual: |
1166 cont.OverwriteAndNegateIfEqual(kSignedLessThanOrEqual); | 1191 cont.OverwriteAndNegateIfEqual(kSignedLessThanOrEqual); |
1167 return VisitWord64Compare(this, value, &cont); | 1192 return VisitWord64Compare(this, value, &cont); |
1168 case IrOpcode::kUint64LessThan: | 1193 case IrOpcode::kUint64LessThan: |
1169 cont.OverwriteAndNegateIfEqual(kUnsignedLessThan); | 1194 cont.OverwriteAndNegateIfEqual(kUnsignedLessThan); |
1170 return VisitWord64Compare(this, value, &cont); | 1195 return VisitWord64Compare(this, value, &cont); |
| 1196 case IrOpcode::kFloat32Equal: |
| 1197 cont.OverwriteAndNegateIfEqual(kUnorderedEqual); |
| 1198 return VisitFloat32Compare(this, value, &cont); |
| 1199 case IrOpcode::kFloat32LessThan: |
| 1200 cont.OverwriteAndNegateIfEqual(kUnsignedGreaterThan); |
| 1201 return VisitFloat32Compare(this, value, &cont); |
| 1202 case IrOpcode::kFloat32LessThanOrEqual: |
| 1203 cont.OverwriteAndNegateIfEqual(kUnsignedGreaterThanOrEqual); |
| 1204 return VisitFloat32Compare(this, value, &cont); |
1171 case IrOpcode::kFloat64Equal: | 1205 case IrOpcode::kFloat64Equal: |
1172 cont.OverwriteAndNegateIfEqual(kUnorderedEqual); | 1206 cont.OverwriteAndNegateIfEqual(kUnorderedEqual); |
1173 return VisitFloat64Compare(this, value, &cont); | 1207 return VisitFloat64Compare(this, value, &cont); |
1174 case IrOpcode::kFloat64LessThan: | 1208 case IrOpcode::kFloat64LessThan: |
1175 cont.OverwriteAndNegateIfEqual(kUnsignedGreaterThan); | 1209 cont.OverwriteAndNegateIfEqual(kUnsignedGreaterThan); |
1176 return VisitFloat64Compare(this, value, &cont); | 1210 return VisitFloat64Compare(this, value, &cont); |
1177 case IrOpcode::kFloat64LessThanOrEqual: | 1211 case IrOpcode::kFloat64LessThanOrEqual: |
1178 cont.OverwriteAndNegateIfEqual(kUnsignedGreaterThanOrEqual); | 1212 cont.OverwriteAndNegateIfEqual(kUnsignedGreaterThanOrEqual); |
1179 return VisitFloat64Compare(this, value, &cont); | 1213 return VisitFloat64Compare(this, value, &cont); |
1180 case IrOpcode::kProjection: | 1214 case IrOpcode::kProjection: |
(...skipping 197 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1378 VisitWord64Compare(this, node, &cont); | 1412 VisitWord64Compare(this, node, &cont); |
1379 } | 1413 } |
1380 | 1414 |
1381 | 1415 |
1382 void InstructionSelector::VisitUint64LessThan(Node* node) { | 1416 void InstructionSelector::VisitUint64LessThan(Node* node) { |
1383 FlagsContinuation cont(kUnsignedLessThan, node); | 1417 FlagsContinuation cont(kUnsignedLessThan, node); |
1384 VisitWord64Compare(this, node, &cont); | 1418 VisitWord64Compare(this, node, &cont); |
1385 } | 1419 } |
1386 | 1420 |
1387 | 1421 |
| 1422 void InstructionSelector::VisitFloat32Equal(Node* node) { |
| 1423 FlagsContinuation cont(kUnorderedEqual, node); |
| 1424 VisitFloat32Compare(this, node, &cont); |
| 1425 } |
| 1426 |
| 1427 |
| 1428 void InstructionSelector::VisitFloat32LessThan(Node* node) { |
| 1429 FlagsContinuation cont(kUnsignedGreaterThan, node); |
| 1430 VisitFloat32Compare(this, node, &cont); |
| 1431 } |
| 1432 |
| 1433 |
| 1434 void InstructionSelector::VisitFloat32LessThanOrEqual(Node* node) { |
| 1435 FlagsContinuation cont(kUnsignedGreaterThanOrEqual, node); |
| 1436 VisitFloat32Compare(this, node, &cont); |
| 1437 } |
| 1438 |
| 1439 |
1388 void InstructionSelector::VisitFloat64Equal(Node* node) { | 1440 void InstructionSelector::VisitFloat64Equal(Node* node) { |
1389 FlagsContinuation cont(kUnorderedEqual, node); | 1441 FlagsContinuation cont(kUnorderedEqual, node); |
1390 VisitFloat64Compare(this, node, &cont); | 1442 VisitFloat64Compare(this, node, &cont); |
1391 } | 1443 } |
1392 | 1444 |
1393 | 1445 |
1394 void InstructionSelector::VisitFloat64LessThan(Node* node) { | 1446 void InstructionSelector::VisitFloat64LessThan(Node* node) { |
1395 FlagsContinuation cont(kUnsignedGreaterThan, node); | 1447 FlagsContinuation cont(kUnsignedGreaterThan, node); |
1396 VisitFloat64Compare(this, node, &cont); | 1448 VisitFloat64Compare(this, node, &cont); |
1397 } | 1449 } |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1437 Node* right = node->InputAt(1); | 1489 Node* right = node->InputAt(1); |
1438 Emit(kSSEFloat64InsertHighWord32, g.DefineSameAsFirst(node), | 1490 Emit(kSSEFloat64InsertHighWord32, g.DefineSameAsFirst(node), |
1439 g.UseRegister(left), g.Use(right)); | 1491 g.UseRegister(left), g.Use(right)); |
1440 } | 1492 } |
1441 | 1493 |
1442 | 1494 |
1443 // static | 1495 // static |
1444 MachineOperatorBuilder::Flags | 1496 MachineOperatorBuilder::Flags |
1445 InstructionSelector::SupportedMachineOperatorFlags() { | 1497 InstructionSelector::SupportedMachineOperatorFlags() { |
1446 MachineOperatorBuilder::Flags flags = | 1498 MachineOperatorBuilder::Flags flags = |
| 1499 MachineOperatorBuilder::kFloat32Max | |
| 1500 MachineOperatorBuilder::kFloat32Min | |
1447 MachineOperatorBuilder::kFloat64Max | | 1501 MachineOperatorBuilder::kFloat64Max | |
1448 MachineOperatorBuilder::kFloat64Min | | 1502 MachineOperatorBuilder::kFloat64Min | |
1449 MachineOperatorBuilder::kWord32ShiftIsSafe; | 1503 MachineOperatorBuilder::kWord32ShiftIsSafe; |
1450 if (CpuFeatures::IsSupported(SSE4_1)) { | 1504 if (CpuFeatures::IsSupported(SSE4_1)) { |
1451 flags |= MachineOperatorBuilder::kFloat64RoundDown | | 1505 flags |= MachineOperatorBuilder::kFloat64RoundDown | |
1452 MachineOperatorBuilder::kFloat64RoundTruncate; | 1506 MachineOperatorBuilder::kFloat64RoundTruncate; |
1453 } | 1507 } |
1454 return flags; | 1508 return flags; |
1455 } | 1509 } |
1456 | 1510 |
1457 } // namespace compiler | 1511 } // namespace compiler |
1458 } // namespace internal | 1512 } // namespace internal |
1459 } // namespace v8 | 1513 } // namespace v8 |
OLD | NEW |