aboutsummaryrefslogtreecommitdiff
path: root/BinaryEncoding.md
diff options
context:
space:
mode:
authorDan Gohman <sunfish@mozilla.com>2015-06-12 15:30:13 -0700
committerDan Gohman <sunfish@mozilla.com>2015-06-15 08:33:36 -0700
commit18300abb11d88de3f3409d092d384559bca4f05f (patch)
tree71caa333d74c021cc6f620a78f2aed545e15f591 /BinaryEncoding.md
parent204b7b8d399122ef12a5a1376f205195238fd295 (diff)
downloadnanowasm-design-18300abb11d88de3f3409d092d384559bca4f05f.tar.gz
Describe integer operation trapping with a new rule.
The rule is that explicitly signed or unsigned operations trap any time they can't return the actual result, and signed-less operations never trap. There's no behavior change here because this covers exactly the same cases that we already had covered. The beauty of this rule is that it elides trapping for add, sub, and mul for now, which would add too much overhead on today's hardware, while leaving it in place for div and rem, where it isn't as problematic and where we already had it, while simultaneously leaving a nice opening for the possible future addition of explicitly signed and unsigned versions of add, sub, and mul which would trap on overflow (and overflow is signedness-dependent anyway). This requires describing the right shifts as signedless; fortunately there's already a common naming we can use, "logical" and "arithmetic".
Diffstat (limited to 'BinaryEncoding.md')
0 files changed, 0 insertions, 0 deletions