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 820 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
831 break; | 831 break; |
832 // kExprF64ReinterpretI64: | 832 // kExprF64ReinterpretI64: |
833 case wasm::kExprF64ReinterpretI64: | 833 case wasm::kExprF64ReinterpretI64: |
834 op = m->BitcastInt64ToFloat64(); | 834 op = m->BitcastInt64ToFloat64(); |
835 break; | 835 break; |
836 // kExprI64ReinterpretF64: | 836 // kExprI64ReinterpretF64: |
837 case wasm::kExprI64ReinterpretF64: | 837 case wasm::kExprI64ReinterpretF64: |
838 op = m->BitcastFloat64ToInt64(); | 838 op = m->BitcastFloat64ToInt64(); |
839 break; | 839 break; |
840 // kExprI64Clz: | 840 // kExprI64Clz: |
| 841 case wasm::kExprI64Clz: |
| 842 op = m->Word64Clz(); |
| 843 break; |
841 // kExprI64Ctz: | 844 // kExprI64Ctz: |
842 // kExprI64Popcnt: | 845 // kExprI64Popcnt: |
843 case wasm::kExprI64Popcnt: { | 846 case wasm::kExprI64Popcnt: { |
844 if (m->Word64Popcnt().IsSupported()) { | 847 if (m->Word64Popcnt().IsSupported()) { |
845 op = m->Word64Popcnt().op(); | 848 op = m->Word64Popcnt().op(); |
846 } else if (m->Is32() && m->Word32Popcnt().IsSupported()) { | 849 } else if (m->Is32() && m->Word32Popcnt().IsSupported()) { |
847 op = m->Word64PopcntPlaceholder(); | 850 op = m->Word64PopcntPlaceholder(); |
848 } else { | 851 } else { |
849 return BuildI64Popcnt(input); | 852 return BuildI64Popcnt(input); |
850 } | 853 } |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
893 case wasm::kExprI64UConvertF32: { | 896 case wasm::kExprI64UConvertF32: { |
894 return BuildI64UConvertF32(input); | 897 return BuildI64UConvertF32(input); |
895 } | 898 } |
896 // kExprI64UConvertF64: | 899 // kExprI64UConvertF64: |
897 case wasm::kExprI64UConvertF64: { | 900 case wasm::kExprI64UConvertF64: { |
898 return BuildI64UConvertF64(input); | 901 return BuildI64UConvertF64(input); |
899 } | 902 } |
900 #if WASM_64 | 903 #if WASM_64 |
901 // Opcodes only supported on 64-bit platforms. | 904 // Opcodes only supported on 64-bit platforms. |
902 // TODO(titzer): query the machine operator builder here instead of #ifdef. | 905 // TODO(titzer): query the machine operator builder here instead of #ifdef. |
903 case wasm::kExprI64Clz: | |
904 op = m->Word64Clz(); | |
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); |
913 return result; | 913 return result; |
914 } else { | 914 } else { |
915 return BuildI64Ctz(input); | 915 return BuildI64Ctz(input); |
(...skipping 1733 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 |