Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(175)

Side by Side Diff: test/mjsunit/wasm/asm-wasm-i32.js

Issue 1839333002: [wasm] Fix asm.js semantics for divide by zero in WASM translation. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Small code simplifications. Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « test/cctest/wasm/test-run-wasm.cc ('k') | test/mjsunit/wasm/asm-wasm-u32.js » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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 })();
OLDNEW
« no previous file with comments | « test/cctest/wasm/test-run-wasm.cc ('k') | test/mjsunit/wasm/asm-wasm-u32.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698