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 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
47 WasmRunner<int64_t> r(MachineType::Int64(), MachineType::Int64()); | 47 WasmRunner<int64_t> r(MachineType::Int64(), MachineType::Int64()); |
48 BUILD(r, WASM_I64_XOR(WASM_GET_LOCAL(0), WASM_GET_LOCAL(1))); | 48 BUILD(r, WASM_I64_XOR(WASM_GET_LOCAL(0), WASM_GET_LOCAL(1))); |
49 FOR_INT64_INPUTS(i) { | 49 FOR_INT64_INPUTS(i) { |
50 FOR_INT64_INPUTS(j) { CHECK_EQ((*i) ^ (*j), r.Call(*i, *j)); } | 50 FOR_INT64_INPUTS(j) { CHECK_EQ((*i) ^ (*j), r.Call(*i, *j)); } |
51 } | 51 } |
52 } | 52 } |
53 // kExprI64Shl: | 53 // kExprI64Shl: |
54 // kExprI64ShrU: | 54 // kExprI64ShrU: |
55 // kExprI64ShrS: | 55 // kExprI64ShrS: |
56 // kExprI64Eq: | 56 // kExprI64Eq: |
| 57 TEST(Run_WasmI64Eq) { |
| 58 WasmRunner<int32_t> r(MachineType::Int64(), MachineType::Int64()); |
| 59 BUILD(r, WASM_I64_EQ(WASM_GET_LOCAL(0), WASM_GET_LOCAL(1))); |
| 60 FOR_INT64_INPUTS(i) { |
| 61 FOR_INT64_INPUTS(j) { CHECK_EQ(*i == *j ? 1 : 0, r.Call(*i, *j)); } |
| 62 } |
| 63 } |
57 // kExprI64Ne: | 64 // kExprI64Ne: |
58 // kExprI64LtS: | 65 // kExprI64LtS: |
59 // kExprI64LeS: | 66 // kExprI64LeS: |
60 // kExprI64LtU: | 67 // kExprI64LtU: |
61 // kExprI64LeU: | 68 // kExprI64LeU: |
62 // kExprI64GtS: | 69 // kExprI64GtS: |
63 // kExprI64GeS: | 70 // kExprI64GeS: |
64 // kExprI64GtU: | 71 // kExprI64GtU: |
65 // kExprI64GeU: | 72 // kExprI64GeU: |
66 | 73 |
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
120 WASM_I64(0xbcd1234000000013), WASM_I64(0xbcd1234000000014), | 127 WASM_I64(0xbcd1234000000013), WASM_I64(0xbcd1234000000014), |
121 WASM_I64(0xbcd1234000000015), WASM_I64(0xbcd1234000000016), | 128 WASM_I64(0xbcd1234000000015), WASM_I64(0xbcd1234000000016), |
122 WASM_I64(0xbcd1234000000017), WASM_I64(0xbcd1234000000018), | 129 WASM_I64(0xbcd1234000000017), WASM_I64(0xbcd1234000000018), |
123 WASM_I64(0xbcd1234000000019), WASM_I64(0xbcd123400000001a), | 130 WASM_I64(0xbcd1234000000019), WASM_I64(0xbcd123400000001a), |
124 WASM_I64(0xbcd123400000001b), WASM_I64(0xbcd123400000001c), | 131 WASM_I64(0xbcd123400000001b), WASM_I64(0xbcd123400000001c), |
125 WASM_I64(0xbcd123400000001d)))); | 132 WASM_I64(0xbcd123400000001d)))); |
126 | 133 |
127 CHECK_EQ(i + 0xb, r.Call()); | 134 CHECK_EQ(i + 0xb, r.Call()); |
128 } | 135 } |
129 } | 136 } |
OLD | NEW |