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

Unified Diff: test/mjsunit/wasm/asm-wasm-u32.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, 9 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « test/mjsunit/wasm/asm-wasm-i32.js ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/mjsunit/wasm/asm-wasm-u32.js
diff --git a/test/mjsunit/wasm/asm-wasm-u32.js b/test/mjsunit/wasm/asm-wasm-u32.js
index 946f05b6c0a5dcf5e767c6ebb76baea3f1523e85..806c99bcec1620b30e11b0dc7bbee212acbc8056 100644
--- a/test/mjsunit/wasm/asm-wasm-u32.js
+++ b/test/mjsunit/wasm/asm-wasm-u32.js
@@ -43,13 +43,13 @@ const imul = Math.imul;
function u32_add(a, b) {
a = a | 0;
b = b | 0;
- return +((a >>> 0) + (b >>> 0));
+ return +(((a >>> 0) + (b >>> 0)) >>> 0);
}
function u32_sub(a, b) {
a = a | 0;
b = b | 0;
- return +((a >>> 0) - (b >>> 0));
+ return +(((a >>> 0) - (b >>> 0)) >>> 0);
}
function u32_mul(a, b) {
@@ -61,13 +61,13 @@ function u32_mul(a, b) {
function u32_div(a, b) {
a = a | 0;
b = b | 0;
- return ((a >>> 0) / (b >>> 0)) | 0;
+ return +(((a >>> 0) / (b >>> 0)) >>> 0);
}
function u32_mod(a, b) {
a = a | 0;
b = b | 0;
- return ((a >>> 0) % (b >>> 0)) | 0;
+ return +(((a >>> 0) % (b >>> 0)) >>> 0);
}
function u32_and(a, b) {
@@ -188,11 +188,10 @@ var inputs = [
];
var funcs = [
-// TODO(bradnelson): u32_add,
-// TODO(bradnelson): u32_sub,
-// TODO(titzer): u32_mul requires Math.imul
-// TODO(titzer): u32_div by zero is incorrect
-// TODO(titzer): u32_mod by zero is incorrect
+ u32_add,
+ u32_sub,
+ u32_div,
+ u32_mod,
// TODO(titzer): u32_mul crashes turbofan in asm.js mode
u32_and,
u32_or,
« no previous file with comments | « test/mjsunit/wasm/asm-wasm-i32.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698