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 10 matching lines...) Expand all Loading... |
21 #define CHECK_TRAP(x) CHECK_TRAP32(x) | 21 #define CHECK_TRAP(x) CHECK_TRAP32(x) |
22 | 22 |
23 #define asi64(x) static_cast<int64_t>(x) | 23 #define asi64(x) static_cast<int64_t>(x) |
24 | 24 |
25 #define asu64(x) static_cast<uint64_t>(x) | 25 #define asu64(x) static_cast<uint64_t>(x) |
26 | 26 |
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 |
32 #define MIPS_OR_X87 true | 32 #define MIPS true |
33 #else | 33 #else |
34 #define MIPS_OR_X87 false | 34 #define MIPS false |
35 #endif | |
36 | |
37 #if V8_TARGET_ARCH_X87 | |
38 #define X87 true | |
39 #else | |
40 #define X87 false | |
41 #endif | |
42 | |
43 #if V8_TARGET_ARCH_MIPS || V8_TARGET_ARCH_X87 || V8_TARGET_ARCH_ARM | |
44 #define MIPS_OR_ARM_OR_X87 true | |
45 #else | |
46 #define MIPS_OR_ARM_OR_X87 false | |
47 #endif | 35 #endif |
48 | 36 |
49 #define FOREACH_I64_OPERATOR(V) \ | 37 #define FOREACH_I64_OPERATOR(V) \ |
50 V(DepthFirst, true) \ | 38 V(DepthFirst, true) \ |
51 V(I64Phi, true) \ | 39 V(I64Phi, true) \ |
52 V(I64Const, true) \ | 40 V(I64Const, true) \ |
53 V(I64Return, true) \ | 41 V(I64Return, true) \ |
54 V(I64Param, true) \ | 42 V(I64Param, true) \ |
55 V(I64LoadStore, true) \ | 43 V(I64LoadStore, true) \ |
56 V(I64Add, !X87) \ | 44 V(I64Add, true) \ |
57 V(I64Sub, !X87) \ | 45 V(I64Sub, true) \ |
58 V(I64Mul, !MIPS_OR_X87) \ | 46 V(I64Mul, !MIPS) \ |
59 V(I64DivS, true) \ | 47 V(I64DivS, true) \ |
60 V(I64DivU, true) \ | 48 V(I64DivU, true) \ |
61 V(I64RemS, true) \ | 49 V(I64RemS, true) \ |
62 V(I64RemU, true) \ | 50 V(I64RemU, true) \ |
63 V(I64And, true) \ | 51 V(I64And, true) \ |
64 V(I64Ior, true) \ | 52 V(I64Ior, true) \ |
65 V(I64Xor, true) \ | 53 V(I64Xor, true) \ |
66 V(I64Shl, !X87) \ | 54 V(I64Shl, true) \ |
67 V(I64ShrU, !X87) \ | 55 V(I64ShrU, true) \ |
68 V(I64ShrS, !X87) \ | 56 V(I64ShrS, true) \ |
69 V(I64Eq, true) \ | 57 V(I64Eq, true) \ |
70 V(I64Ne, true) \ | 58 V(I64Ne, true) \ |
71 V(I64LtS, true) \ | 59 V(I64LtS, true) \ |
72 V(I64LeS, true) \ | 60 V(I64LeS, true) \ |
73 V(I64LtU, true) \ | 61 V(I64LtU, true) \ |
74 V(I64LeU, true) \ | 62 V(I64LeU, true) \ |
75 V(I64GtS, true) \ | 63 V(I64GtS, true) \ |
76 V(I64GeS, true) \ | 64 V(I64GeS, true) \ |
77 V(I64GtU, true) \ | 65 V(I64GtU, true) \ |
78 V(I64GeU, true) \ | 66 V(I64GeU, true) \ |
79 V(I64Ctz, true) \ | 67 V(I64Ctz, true) \ |
80 V(I64Clz, true) \ | 68 V(I64Clz, true) \ |
81 V(I64Popcnt, !X87) \ | 69 V(I64Popcnt, true) \ |
82 V(I32ConvertI64, true) \ | 70 V(I32ConvertI64, true) \ |
83 V(I64SConvertF32, true) \ | 71 V(I64SConvertF32, true) \ |
84 V(I64SConvertF64, true) \ | 72 V(I64SConvertF64, true) \ |
85 V(I64UConvertF32, true) \ | 73 V(I64UConvertF32, true) \ |
86 V(I64UConvertF64, true) \ | 74 V(I64UConvertF64, true) \ |
87 V(I64SConvertI32, true) \ | 75 V(I64SConvertI32, true) \ |
88 V(I64UConvertI32, true) \ | 76 V(I64UConvertI32, true) \ |
89 V(F32SConvertI64, true) \ | 77 V(F32SConvertI64, true) \ |
90 V(F32UConvertI64, true) \ | 78 V(F32UConvertI64, true) \ |
91 V(F64SConvertI64, true) \ | 79 V(F64SConvertI64, true) \ |
(...skipping 1265 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1357 WasmRunner<int64_t> r(MachineType::Int64(), MachineType::Int64()); | 1345 WasmRunner<int64_t> r(MachineType::Int64(), MachineType::Int64()); |
1358 BUILD(r, WASM_I64_ROL(WASM_GET_LOCAL(0), WASM_GET_LOCAL(1))); | 1346 BUILD(r, WASM_I64_ROL(WASM_GET_LOCAL(0), WASM_GET_LOCAL(1))); |
1359 | 1347 |
1360 FOR_UINT64_INPUTS(i) { | 1348 FOR_UINT64_INPUTS(i) { |
1361 FOR_UINT64_INPUTS(j) { | 1349 FOR_UINT64_INPUTS(j) { |
1362 int64_t expected = bits::RotateLeft64(*i, *j & 0x3f); | 1350 int64_t expected = bits::RotateLeft64(*i, *j & 0x3f); |
1363 CHECK_EQ(expected, r.Call(*i, *j)); | 1351 CHECK_EQ(expected, r.Call(*i, *j)); |
1364 } | 1352 } |
1365 } | 1353 } |
1366 } | 1354 } |
OLD | NEW |