| 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 152 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 163 } | 163 } |
| 164 // kExprI32ConvertI64: | 164 // kExprI32ConvertI64: |
| 165 TEST(Run_WasmI32ConvertI64) { | 165 TEST(Run_WasmI32ConvertI64) { |
| 166 FOR_INT64_INPUTS(i) { | 166 FOR_INT64_INPUTS(i) { |
| 167 WasmRunner<int32_t> r; | 167 WasmRunner<int32_t> r; |
| 168 BUILD(r, WASM_I32_CONVERT_I64(WASM_I64V(*i))); | 168 BUILD(r, WASM_I32_CONVERT_I64(WASM_I64V(*i))); |
| 169 CHECK_EQ(static_cast<int32_t>(*i), r.Call()); | 169 CHECK_EQ(static_cast<int32_t>(*i), r.Call()); |
| 170 } | 170 } |
| 171 } | 171 } |
| 172 // kExprI64SConvertI32: | 172 // kExprI64SConvertI32: |
| 173 TEST(Run_WasmI64SConvertI32) { |
| 174 WasmRunner<int64_t> r(MachineType::Int32()); |
| 175 BUILD(r, WASM_I64_SCONVERT_I32(WASM_GET_LOCAL(0))); |
| 176 FOR_INT32_INPUTS(i) { CHECK_EQ(static_cast<int64_t>(*i), r.Call(*i)); } |
| 177 } |
| 178 |
| 173 // kExprI64UConvertI32: | 179 // kExprI64UConvertI32: |
| 180 TEST(Run_WasmI64UConvertI32) { |
| 181 WasmRunner<int64_t> r(MachineType::Uint32()); |
| 182 BUILD(r, WASM_I64_UCONVERT_I32(WASM_GET_LOCAL(0))); |
| 183 FOR_UINT32_INPUTS(i) { CHECK_EQ(static_cast<uint64_t>(*i), r.Call(*i)); } |
| 184 } |
| 174 | 185 |
| 175 // kExprF64ReinterpretI64: | 186 // kExprF64ReinterpretI64: |
| 176 // kExprI64ReinterpretF64: | 187 // kExprI64ReinterpretF64: |
| 177 | 188 |
| 178 // kExprI64Clz: | 189 // kExprI64Clz: |
| 179 // kExprI64Ctz: | 190 // kExprI64Ctz: |
| 180 // kExprI64Popcnt: | 191 // kExprI64Popcnt: |
| 181 | 192 |
| 182 // kExprF32SConvertI64: | 193 // kExprF32SConvertI64: |
| 183 // kExprF32UConvertI64: | 194 // kExprF32UConvertI64: |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 218 WASM_I64V_10(0xbcd1234000000013), WASM_I64V_10(0xbcd1234000000014), | 229 WASM_I64V_10(0xbcd1234000000013), WASM_I64V_10(0xbcd1234000000014), |
| 219 WASM_I64V_10(0xbcd1234000000015), WASM_I64V_10(0xbcd1234000000016), | 230 WASM_I64V_10(0xbcd1234000000015), WASM_I64V_10(0xbcd1234000000016), |
| 220 WASM_I64V_10(0xbcd1234000000017), WASM_I64V_10(0xbcd1234000000018), | 231 WASM_I64V_10(0xbcd1234000000017), WASM_I64V_10(0xbcd1234000000018), |
| 221 WASM_I64V_10(0xbcd1234000000019), WASM_I64V_10(0xbcd123400000001a), | 232 WASM_I64V_10(0xbcd1234000000019), WASM_I64V_10(0xbcd123400000001a), |
| 222 WASM_I64V_10(0xbcd123400000001b), WASM_I64V_10(0xbcd123400000001c), | 233 WASM_I64V_10(0xbcd123400000001b), WASM_I64V_10(0xbcd123400000001c), |
| 223 WASM_I64V_10(0xbcd123400000001d)))); | 234 WASM_I64V_10(0xbcd123400000001d)))); |
| 224 | 235 |
| 225 CHECK_EQ(i + 0xb, r.Call()); | 236 CHECK_EQ(i + 0xb, r.Call()); |
| 226 } | 237 } |
| 227 } | 238 } |
| OLD | NEW |