| 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/wasm/wasm-macro-gen.h" | 9 #include "src/wasm/wasm-macro-gen.h" |
| 10 | 10 |
| (...skipping 15 matching lines...) Expand all Loading... |
| 26 #define B2(a, b) kExprBlock, 2, a, b | 26 #define B2(a, b) kExprBlock, 2, a, b |
| 27 #define B1(a) kExprBlock, 1, a | 27 #define B1(a) kExprBlock, 1, a |
| 28 | 28 |
| 29 // Can't bridge macro land with nested macros. | 29 // Can't bridge macro land with nested macros. |
| 30 #if V8_TARGET_ARCH_MIPS || V8_TARGET_ARCH_X87 | 30 #if V8_TARGET_ARCH_MIPS || V8_TARGET_ARCH_X87 |
| 31 #define MIPS_OR_X87 true | 31 #define MIPS_OR_X87 true |
| 32 #else | 32 #else |
| 33 #define MIPS_OR_X87 false | 33 #define MIPS_OR_X87 false |
| 34 #endif | 34 #endif |
| 35 | 35 |
| 36 #if V8_TARGET_ARCH_X87 |
| 37 #define X87 true |
| 38 #else |
| 39 #define X87 false |
| 40 #endif |
| 41 |
| 36 #if V8_TARGET_ARCH_MIPS || V8_TARGET_ARCH_X87 || V8_TARGET_ARCH_ARM | 42 #if V8_TARGET_ARCH_MIPS || V8_TARGET_ARCH_X87 || V8_TARGET_ARCH_ARM |
| 37 #define MIPS_OR_ARM_OR_X87 true | 43 #define MIPS_OR_ARM_OR_X87 true |
| 38 #else | 44 #else |
| 39 #define MIPS_OR_ARM_OR_X87 false | 45 #define MIPS_OR_ARM_OR_X87 false |
| 40 #endif | 46 #endif |
| 41 | 47 |
| 42 #define FOREACH_I64_OPERATOR(V) \ | 48 #define FOREACH_I64_OPERATOR(V) \ |
| 43 V(DepthFirst, true) \ | 49 V(DepthFirst, true) \ |
| 44 V(I64Phi, true) \ | 50 V(I64Phi, true) \ |
| 45 V(I64Const, true) \ | 51 V(I64Const, true) \ |
| 46 V(I64Return, true) \ | 52 V(I64Return, true) \ |
| 47 V(I64Param, true) \ | 53 V(I64Param, true) \ |
| 48 V(I64LoadStore, true) \ | 54 V(I64LoadStore, true) \ |
| 49 V(I64Add, !MIPS_OR_X87) \ | 55 V(I64Add, !X87) \ |
| 50 V(I64Sub, !MIPS_OR_X87) \ | 56 V(I64Sub, !X87) \ |
| 51 V(I64Mul, !MIPS_OR_X87) \ | 57 V(I64Mul, !MIPS_OR_X87) \ |
| 52 V(I64DivS, true) \ | 58 V(I64DivS, true) \ |
| 53 V(I64DivU, true) \ | 59 V(I64DivU, true) \ |
| 54 V(I64RemS, true) \ | 60 V(I64RemS, true) \ |
| 55 V(I64RemU, true) \ | 61 V(I64RemU, true) \ |
| 56 V(I64And, true) \ | 62 V(I64And, true) \ |
| 57 V(I64Ior, true) \ | 63 V(I64Ior, true) \ |
| 58 V(I64Xor, true) \ | 64 V(I64Xor, true) \ |
| 59 V(I64Shl, !MIPS_OR_X87) \ | 65 V(I64Shl, !X87) \ |
| 60 V(I64ShrU, !MIPS_OR_X87) \ | 66 V(I64ShrU, !X87) \ |
| 61 V(I64ShrS, !MIPS_OR_X87) \ | 67 V(I64ShrS, !X87) \ |
| 62 V(I64Eq, true) \ | 68 V(I64Eq, true) \ |
| 63 V(I64Ne, true) \ | 69 V(I64Ne, true) \ |
| 64 V(I64LtS, true) \ | 70 V(I64LtS, true) \ |
| 65 V(I64LeS, true) \ | 71 V(I64LeS, true) \ |
| 66 V(I64LtU, true) \ | 72 V(I64LtU, true) \ |
| 67 V(I64LeU, true) \ | 73 V(I64LeU, true) \ |
| 68 V(I64GtS, true) \ | 74 V(I64GtS, true) \ |
| 69 V(I64GeS, true) \ | 75 V(I64GeS, true) \ |
| 70 V(I64GtU, true) \ | 76 V(I64GtU, true) \ |
| 71 V(I64GeU, true) \ | 77 V(I64GeU, true) \ |
| 72 V(I64Ctz, true) \ | 78 V(I64Ctz, true) \ |
| 73 V(I64Clz, true) \ | 79 V(I64Clz, true) \ |
| 74 V(I64Popcnt, !MIPS_OR_X87) \ | 80 V(I64Popcnt, !X87) \ |
| 75 V(I32ConvertI64, true) \ | 81 V(I32ConvertI64, true) \ |
| 76 V(I64SConvertF32, true) \ | 82 V(I64SConvertF32, true) \ |
| 77 V(I64SConvertF64, true) \ | 83 V(I64SConvertF64, true) \ |
| 78 V(I64UConvertF32, true) \ | 84 V(I64UConvertF32, true) \ |
| 79 V(I64UConvertF64, true) \ | 85 V(I64UConvertF64, true) \ |
| 80 V(I64SConvertI32, true) \ | 86 V(I64SConvertI32, true) \ |
| 81 V(I64UConvertI32, true) \ | 87 V(I64UConvertI32, true) \ |
| 82 V(F32SConvertI64, true) \ | 88 V(F32SConvertI64, true) \ |
| 83 V(F32UConvertI64, true) \ | 89 V(F32UConvertI64, true) \ |
| 84 V(F64SConvertI64, true) \ | 90 V(F64SConvertI64, true) \ |
| (...skipping 1225 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1310 REQUIRE(I64Eq); | 1316 REQUIRE(I64Eq); |
| 1311 | 1317 |
| 1312 WasmRunner<int32_t> r(MachineType::Int64()); | 1318 WasmRunner<int32_t> r(MachineType::Int64()); |
| 1313 BUILD(r, WASM_I64_EQZ(WASM_GET_LOCAL(0))); | 1319 BUILD(r, WASM_I64_EQZ(WASM_GET_LOCAL(0))); |
| 1314 | 1320 |
| 1315 FOR_INT64_INPUTS(i) { | 1321 FOR_INT64_INPUTS(i) { |
| 1316 int32_t result = *i == 0 ? 1 : 0; | 1322 int32_t result = *i == 0 ? 1 : 0; |
| 1317 CHECK_EQ(result, r.Call(*i)); | 1323 CHECK_EQ(result, r.Call(*i)); |
| 1318 } | 1324 } |
| 1319 } | 1325 } |
| OLD | NEW |