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 <stdint.h> | 5 #include <stdint.h> |
6 #include <stdlib.h> | 6 #include <stdlib.h> |
7 #include <string.h> | 7 #include <string.h> |
8 | 8 |
9 #include "src/base/bits.h" | 9 #include "src/base/bits.h" |
10 #include "src/wasm/wasm-macro-gen.h" | 10 #include "src/wasm/wasm-macro-gen.h" |
(...skipping 16 matching lines...) Expand all Loading... |
27 #define B2(a, b) kExprBlock, 2, a, b | 27 #define B2(a, b) kExprBlock, 2, a, b |
28 #define B1(a) kExprBlock, 1, a | 28 #define B1(a) kExprBlock, 1, a |
29 | 29 |
30 // Can't bridge macro land with nested macros. | 30 // Can't bridge macro land with nested macros. |
31 #if V8_TARGET_ARCH_MIPS || V8_TARGET_ARCH_X87 | 31 #if V8_TARGET_ARCH_MIPS || V8_TARGET_ARCH_X87 |
32 #define MIPS_OR_X87 true | 32 #define MIPS_OR_X87 true |
33 #else | 33 #else |
34 #define MIPS_OR_X87 false | 34 #define MIPS_OR_X87 false |
35 #endif | 35 #endif |
36 | 36 |
| 37 #if V8_TARGET_ARCH_X87 |
| 38 #define X87 true |
| 39 #else |
| 40 #define X87 false |
| 41 #endif |
| 42 |
37 #if V8_TARGET_ARCH_MIPS || V8_TARGET_ARCH_X87 || V8_TARGET_ARCH_ARM | 43 #if V8_TARGET_ARCH_MIPS || V8_TARGET_ARCH_X87 || V8_TARGET_ARCH_ARM |
38 #define MIPS_OR_ARM_OR_X87 true | 44 #define MIPS_OR_ARM_OR_X87 true |
39 #else | 45 #else |
40 #define MIPS_OR_ARM_OR_X87 false | 46 #define MIPS_OR_ARM_OR_X87 false |
41 #endif | 47 #endif |
42 | 48 |
43 #define FOREACH_I64_OPERATOR(V) \ | 49 #define FOREACH_I64_OPERATOR(V) \ |
44 V(DepthFirst, true) \ | 50 V(DepthFirst, true) \ |
45 V(I64Phi, true) \ | 51 V(I64Phi, true) \ |
46 V(I64Const, true) \ | 52 V(I64Const, true) \ |
47 V(I64Return, true) \ | 53 V(I64Return, true) \ |
48 V(I64Param, true) \ | 54 V(I64Param, true) \ |
49 V(I64LoadStore, true) \ | 55 V(I64LoadStore, true) \ |
50 V(I64Add, !MIPS_OR_X87) \ | 56 V(I64Add, !X87) \ |
51 V(I64Sub, !MIPS_OR_X87) \ | 57 V(I64Sub, !X87) \ |
52 V(I64Mul, !MIPS_OR_X87) \ | 58 V(I64Mul, !MIPS_OR_X87) \ |
53 V(I64DivS, true) \ | 59 V(I64DivS, true) \ |
54 V(I64DivU, true) \ | 60 V(I64DivU, true) \ |
55 V(I64RemS, true) \ | 61 V(I64RemS, true) \ |
56 V(I64RemU, true) \ | 62 V(I64RemU, true) \ |
57 V(I64And, true) \ | 63 V(I64And, true) \ |
58 V(I64Ior, true) \ | 64 V(I64Ior, true) \ |
59 V(I64Xor, true) \ | 65 V(I64Xor, true) \ |
60 V(I64Shl, !MIPS_OR_X87) \ | 66 V(I64Shl, !X87) \ |
61 V(I64ShrU, !MIPS_OR_X87) \ | 67 V(I64ShrU, !X87) \ |
62 V(I64ShrS, !MIPS_OR_X87) \ | 68 V(I64ShrS, !X87) \ |
63 V(I64Eq, true) \ | 69 V(I64Eq, true) \ |
64 V(I64Ne, true) \ | 70 V(I64Ne, true) \ |
65 V(I64LtS, true) \ | 71 V(I64LtS, true) \ |
66 V(I64LeS, true) \ | 72 V(I64LeS, true) \ |
67 V(I64LtU, true) \ | 73 V(I64LtU, true) \ |
68 V(I64LeU, true) \ | 74 V(I64LeU, true) \ |
69 V(I64GtS, true) \ | 75 V(I64GtS, true) \ |
70 V(I64GeS, true) \ | 76 V(I64GeS, true) \ |
71 V(I64GtU, true) \ | 77 V(I64GtU, true) \ |
72 V(I64GeU, true) \ | 78 V(I64GeU, true) \ |
73 V(I64Ctz, true) \ | 79 V(I64Ctz, true) \ |
74 V(I64Clz, true) \ | 80 V(I64Clz, true) \ |
75 V(I64Popcnt, !MIPS_OR_X87) \ | 81 V(I64Popcnt, !X87) \ |
76 V(I32ConvertI64, true) \ | 82 V(I32ConvertI64, true) \ |
77 V(I64SConvertF32, true) \ | 83 V(I64SConvertF32, true) \ |
78 V(I64SConvertF64, true) \ | 84 V(I64SConvertF64, true) \ |
79 V(I64UConvertF32, true) \ | 85 V(I64UConvertF32, true) \ |
80 V(I64UConvertF64, true) \ | 86 V(I64UConvertF64, true) \ |
81 V(I64SConvertI32, true) \ | 87 V(I64SConvertI32, true) \ |
82 V(I64UConvertI32, true) \ | 88 V(I64UConvertI32, true) \ |
83 V(F32SConvertI64, true) \ | 89 V(F32SConvertI64, true) \ |
84 V(F32UConvertI64, true) \ | 90 V(F32UConvertI64, true) \ |
85 V(F64SConvertI64, true) \ | 91 V(F64SConvertI64, true) \ |
(...skipping 1265 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1351 WasmRunner<int64_t> r(MachineType::Int64(), MachineType::Int64()); | 1357 WasmRunner<int64_t> r(MachineType::Int64(), MachineType::Int64()); |
1352 BUILD(r, WASM_I64_ROL(WASM_GET_LOCAL(0), WASM_GET_LOCAL(1))); | 1358 BUILD(r, WASM_I64_ROL(WASM_GET_LOCAL(0), WASM_GET_LOCAL(1))); |
1353 | 1359 |
1354 FOR_UINT64_INPUTS(i) { | 1360 FOR_UINT64_INPUTS(i) { |
1355 FOR_UINT64_INPUTS(j) { | 1361 FOR_UINT64_INPUTS(j) { |
1356 int64_t expected = bits::RotateLeft64(*i, *j & 0x3f); | 1362 int64_t expected = bits::RotateLeft64(*i, *j & 0x3f); |
1357 CHECK_EQ(expected, r.Call(*i, *j)); | 1363 CHECK_EQ(expected, r.Call(*i, *j)); |
1358 } | 1364 } |
1359 } | 1365 } |
1360 } | 1366 } |
OLD | NEW |