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 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
125 WasmRunner<int32_t> r(MachineType::Int64(), MachineType::Int64()); | 125 WasmRunner<int32_t> r(MachineType::Int64(), MachineType::Int64()); |
126 BUILD(r, WASM_I64_GEU(WASM_GET_LOCAL(0), WASM_GET_LOCAL(1))); | 126 BUILD(r, WASM_I64_GEU(WASM_GET_LOCAL(0), WASM_GET_LOCAL(1))); |
127 FOR_UINT64_INPUTS(i) { | 127 FOR_UINT64_INPUTS(i) { |
128 FOR_UINT64_INPUTS(j) { CHECK_EQ(*i >= *j ? 1 : 0, r.Call(*i, *j)); } | 128 FOR_UINT64_INPUTS(j) { CHECK_EQ(*i >= *j ? 1 : 0, r.Call(*i, *j)); } |
129 } | 129 } |
130 } | 130 } |
131 // kExprI32ConvertI64: | 131 // kExprI32ConvertI64: |
132 TEST(Run_WasmI32ConvertI64) { | 132 TEST(Run_WasmI32ConvertI64) { |
133 FOR_INT64_INPUTS(i) { | 133 FOR_INT64_INPUTS(i) { |
134 WasmRunner<int32_t> r; | 134 WasmRunner<int32_t> r; |
135 BUILD(r, WASM_I32_CONVERT_I64(WASM_I64V(*i))); | 135 BUILD(r, WASM_I32_CONVERT_I64(WASM_I64(*i))); |
136 CHECK_EQ(static_cast<int32_t>(*i), r.Call()); | 136 CHECK_EQ(static_cast<int32_t>(*i), r.Call()); |
137 } | 137 } |
138 } | 138 } |
139 // kExprI64SConvertI32: | 139 // kExprI64SConvertI32: |
140 // kExprI64UConvertI32: | 140 // kExprI64UConvertI32: |
141 | 141 |
142 // kExprF64ReinterpretI64: | 142 // kExprF64ReinterpretI64: |
143 // kExprI64ReinterpretF64: | 143 // kExprI64ReinterpretF64: |
144 | 144 |
145 // kExprI64Clz: | 145 // kExprI64Clz: |
(...skipping 22 matching lines...) Expand all Loading... |
168 if (i == 2 || i == 3) { | 168 if (i == 2 || i == 3) { |
169 continue; | 169 continue; |
170 } else { | 170 } else { |
171 BUILD(t, WASM_GET_LOCAL(i)); | 171 BUILD(t, WASM_GET_LOCAL(i)); |
172 } | 172 } |
173 uint32_t index = t.CompileAndAdd(); | 173 uint32_t index = t.CompileAndAdd(); |
174 | 174 |
175 // Build the calling function. | 175 // Build the calling function. |
176 WasmRunner<int32_t> r; | 176 WasmRunner<int32_t> r; |
177 r.env()->module = &module; | 177 r.env()->module = &module; |
178 BUILD( | 178 BUILD(r, |
179 r, | 179 WASM_I32_CONVERT_I64(WASM_CALL_FUNCTION( |
180 WASM_I32_CONVERT_I64(WASM_CALL_FUNCTION( | 180 index, WASM_I64(0xbcd12340000000b), WASM_I64(0xbcd12340000000c), |
181 index, WASM_I64V_9(0xbcd12340000000b), | 181 WASM_I32(0xd), WASM_I32_CONVERT_I64(WASM_I64(0xbcd12340000000e)), |
182 WASM_I64V_9(0xbcd12340000000c), WASM_I32V_1(0xd), | 182 WASM_I64(0xbcd12340000000f), WASM_I64(0xbcd1234000000010), |
183 WASM_I32_CONVERT_I64(WASM_I64V_9(0xbcd12340000000e)), | 183 WASM_I64(0xbcd1234000000011), WASM_I64(0xbcd1234000000012), |
184 WASM_I64V_9(0xbcd12340000000f), WASM_I64V_10(0xbcd1234000000010), | 184 WASM_I64(0xbcd1234000000013), WASM_I64(0xbcd1234000000014), |
185 WASM_I64V_10(0xbcd1234000000011), WASM_I64V_10(0xbcd1234000000012), | 185 WASM_I64(0xbcd1234000000015), WASM_I64(0xbcd1234000000016), |
186 WASM_I64V_10(0xbcd1234000000013), WASM_I64V_10(0xbcd1234000000014), | 186 WASM_I64(0xbcd1234000000017), WASM_I64(0xbcd1234000000018), |
187 WASM_I64V_10(0xbcd1234000000015), WASM_I64V_10(0xbcd1234000000016), | 187 WASM_I64(0xbcd1234000000019), WASM_I64(0xbcd123400000001a), |
188 WASM_I64V_10(0xbcd1234000000017), WASM_I64V_10(0xbcd1234000000018), | 188 WASM_I64(0xbcd123400000001b), WASM_I64(0xbcd123400000001c), |
189 WASM_I64V_10(0xbcd1234000000019), WASM_I64V_10(0xbcd123400000001a), | 189 WASM_I64(0xbcd123400000001d)))); |
190 WASM_I64V_10(0xbcd123400000001b), WASM_I64V_10(0xbcd123400000001c), | |
191 WASM_I64V_10(0xbcd123400000001d)))); | |
192 | 190 |
193 CHECK_EQ(i + 0xb, r.Call()); | 191 CHECK_EQ(i + 0xb, r.Call()); |
194 } | 192 } |
195 } | 193 } |
OLD | NEW |