aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDan Gohman <sunfish@mozilla.com>2015-06-10 18:16:47 -0700
committerDan Gohman <sunfish@mozilla.com>2015-06-10 18:16:47 -0700
commit4e44dc2d06355a61ec2b259e90145dee8cfca549 (patch)
tree29e4445564d3da572a0948d7c1be7b64abdc1acf
parent95b607450bdeeac671e7f0d4eba7cbfacedd21cb (diff)
downloadnanowasm-design-4e44dc2d06355a61ec2b259e90145dee8cfca549.tar.gz
Make INT32_MIN % -1 defined again.
-rw-r--r--AstSemantics.md5
-rw-r--r--Polyfill.md1
2 files changed, 3 insertions, 3 deletions
diff --git a/AstSemantics.md b/AstSemantics.md
index 8e6a9bd..738f8c6 100644
--- a/AstSemantics.md
+++ b/AstSemantics.md
@@ -308,8 +308,9 @@ and 0 representing false.
* Int32Ule - unsigned less than or equal
Division or remainder by zero traps.
-Signed division overflow (`INT32_MIN / -1`) and the corresponding signed
-remainder operation (`INT32_MIN % -1`) trap.
+Signed division overflow (`INT32_MIN / -1`) traps. Signed remainder with a
+non-zero denominator always returns the correct value, even when the
+corresponding division would trap.
Shifts interpret their shift count operand as an unsigned value. When the
shift count is at least the bitwidth of the shift, Shl and Shr return 0,
diff --git a/Polyfill.md b/Polyfill.md
index 5a39bd2..eb96322 100644
--- a/Polyfill.md
+++ b/Polyfill.md
@@ -65,7 +65,6 @@ Some divergences that we've identified as potentially desirable:
standard behavior:
- Division by zero returns zero;
- `INT32_MIN / -1` returns `INT32_MIN`;
- - `INT32_MIN % -1` returns `0`;
- Shift counts are implicitly masked.
* **[Datatype conversions](AstSemantics.md#datatype-conversions-truncations-reinterpretations-promotions-and-demotions)**:
Regardless of WebAssembly behavior, an asm.js polyfill will follow its