OLD | NEW |
1 // Copyright 2016 the V8 project authors. All rights reserved. | 1 // Copyright 2016 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 // Flags: --expose-wasm | 5 // Flags: --expose-wasm |
6 | 6 |
7 function WrapInAsmModule(func) { | 7 function WrapInAsmModule(func) { |
8 function MODULE_NAME(stdlib) { | 8 function MODULE_NAME(stdlib) { |
9 "use asm"; | 9 "use asm"; |
10 var imul = stdlib.Math.imul; | 10 var imul = stdlib.Math.imul; |
(...skipping 195 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
206 -2147483646, | 206 -2147483646, |
207 -2147483647, | 207 -2147483647, |
208 -2147483648, | 208 -2147483648, |
209 -2147483649, | 209 -2147483649, |
210 ]; | 210 ]; |
211 | 211 |
212 var funcs = [ | 212 var funcs = [ |
213 i32_add, | 213 i32_add, |
214 i32_sub, | 214 i32_sub, |
215 i32_mul, | 215 i32_mul, |
216 // TODO(titzer): i32_mul requires Math.imul | 216 i32_div, |
217 // TODO(titzer): i32_div divide by zero is incorrect | 217 i32_mod, |
218 // TODO(titzer): i32_mod by zero is incorrect | |
219 i32_and, | 218 i32_and, |
220 i32_or, | 219 i32_or, |
221 i32_xor, | 220 i32_xor, |
222 // TODO(titzer): i32_shl on arm | 221 // TODO(titzer): i32_shl on arm |
223 // TODO(titzer): i32_shr on arm | 222 // TODO(titzer): i32_shr on arm |
224 // TODO(titzer): i32_sar on arm | 223 // TODO(titzer): i32_sar on arm |
225 i32_eq, | 224 i32_eq, |
226 i32_ne, | 225 i32_ne, |
227 i32_lt, | 226 i32_lt, |
228 i32_lteq, | 227 i32_lteq, |
(...skipping 15 matching lines...) Expand all Loading... |
244 for (a of inputs) { | 243 for (a of inputs) { |
245 for (b of inputs) { | 244 for (b of inputs) { |
246 assertEquals(func(a, b), module.main(a, b)); | 245 assertEquals(func(a, b), module.main(a, b)); |
247 } | 246 } |
248 } | 247 } |
249 } | 248 } |
250 }); | 249 }); |
251 } | 250 } |
252 | 251 |
253 })(); | 252 })(); |
OLD | NEW |