OLD | NEW |
1 // Copyright 2015 the V8 project authors. All rights reserved. | 1 // Copyright 2015 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/wasm-compiler.h" | 5 #include "src/compiler/wasm-compiler.h" |
6 | 6 |
7 #include "src/isolate-inl.h" | 7 #include "src/isolate-inl.h" |
8 | 8 |
9 #include "src/base/platform/elapsed-timer.h" | 9 #include "src/base/platform/elapsed-timer.h" |
10 #include "src/base/platform/platform.h" | 10 #include "src/base/platform/platform.h" |
(...skipping 813 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
824 // kExprI64SConvertI32: | 824 // kExprI64SConvertI32: |
825 case wasm::kExprI64SConvertI32: | 825 case wasm::kExprI64SConvertI32: |
826 op = m->ChangeInt32ToInt64(); | 826 op = m->ChangeInt32ToInt64(); |
827 break; | 827 break; |
828 // kExprI64UConvertI32: | 828 // kExprI64UConvertI32: |
829 case wasm::kExprI64UConvertI32: | 829 case wasm::kExprI64UConvertI32: |
830 op = m->ChangeUint32ToUint64(); | 830 op = m->ChangeUint32ToUint64(); |
831 break; | 831 break; |
832 // kExprF64ReinterpretI64: | 832 // kExprF64ReinterpretI64: |
833 // kExprI64ReinterpretF64: | 833 // kExprI64ReinterpretF64: |
| 834 case wasm::kExprI64ReinterpretF64: |
| 835 op = m->BitcastFloat64ToInt64(); |
| 836 break; |
834 // kExprI64Clz: | 837 // kExprI64Clz: |
835 // kExprI64Ctz: | 838 // kExprI64Ctz: |
836 // kExprI64Popcnt: | 839 // kExprI64Popcnt: |
837 case wasm::kExprI64Popcnt: { | 840 case wasm::kExprI64Popcnt: { |
838 if (m->Word64Popcnt().IsSupported()) { | 841 if (m->Word64Popcnt().IsSupported()) { |
839 op = m->Word64Popcnt().op(); | 842 op = m->Word64Popcnt().op(); |
840 } else if (m->Is32() && m->Word32Popcnt().IsSupported()) { | 843 } else if (m->Is32() && m->Word32Popcnt().IsSupported()) { |
841 op = m->Word64PopcntPlaceholder(); | 844 op = m->Word64PopcntPlaceholder(); |
842 } else { | 845 } else { |
843 return BuildI64Popcnt(input); | 846 return BuildI64Popcnt(input); |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
890 // kExprI64UConvertF64: | 893 // kExprI64UConvertF64: |
891 case wasm::kExprI64UConvertF64: { | 894 case wasm::kExprI64UConvertF64: { |
892 return BuildI64UConvertF64(input); | 895 return BuildI64UConvertF64(input); |
893 } | 896 } |
894 #if WASM_64 | 897 #if WASM_64 |
895 // Opcodes only supported on 64-bit platforms. | 898 // Opcodes only supported on 64-bit platforms. |
896 // TODO(titzer): query the machine operator builder here instead of #ifdef. | 899 // TODO(titzer): query the machine operator builder here instead of #ifdef. |
897 case wasm::kExprF64ReinterpretI64: | 900 case wasm::kExprF64ReinterpretI64: |
898 op = m->BitcastInt64ToFloat64(); | 901 op = m->BitcastInt64ToFloat64(); |
899 break; | 902 break; |
900 case wasm::kExprI64ReinterpretF64: | |
901 op = m->BitcastFloat64ToInt64(); | |
902 break; | |
903 case wasm::kExprI64Clz: | 903 case wasm::kExprI64Clz: |
904 op = m->Word64Clz(); | 904 op = m->Word64Clz(); |
905 break; | 905 break; |
906 case wasm::kExprI64Ctz: { | 906 case wasm::kExprI64Ctz: { |
907 if (m->Word64Ctz().IsSupported()) { | 907 if (m->Word64Ctz().IsSupported()) { |
908 op = m->Word64Ctz().op(); | 908 op = m->Word64Ctz().op(); |
909 break; | 909 break; |
910 } else if (m->Word64ReverseBits().IsSupported()) { | 910 } else if (m->Word64ReverseBits().IsSupported()) { |
911 Node* reversed = graph()->NewNode(m->Word64ReverseBits().op(), input); | 911 Node* reversed = graph()->NewNode(m->Word64ReverseBits().op(), input); |
912 Node* result = graph()->NewNode(m->Word64Clz(), reversed); | 912 Node* result = graph()->NewNode(m->Word64Clz(), reversed); |
(...skipping 1736 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2649 static_cast<int>(function.code_end_offset - function.code_start_offset), | 2649 static_cast<int>(function.code_end_offset - function.code_start_offset), |
2650 decode_ms, static_cast<int>(graph.NodeCount()), compile_ms); | 2650 decode_ms, static_cast<int>(graph.NodeCount()), compile_ms); |
2651 } | 2651 } |
2652 return code; | 2652 return code; |
2653 } | 2653 } |
2654 | 2654 |
2655 | 2655 |
2656 } // namespace compiler | 2656 } // namespace compiler |
2657 } // namespace internal | 2657 } // namespace internal |
2658 } // namespace v8 | 2658 } // namespace v8 |
OLD | NEW |