aboutsummaryrefslogtreecommitdiff
path: root/src/library.js
diff options
context:
space:
mode:
authorAlon Zakai <alonzakai@gmail.com>2012-03-28 18:00:25 -0700
committerAlon Zakai <alonzakai@gmail.com>2012-03-28 18:00:25 -0700
commit2aeafa0df7460b21705971309e8cdc0b48954f0e (patch)
tree259862846566f17e128c6fc8064b18786dfa4aab /src/library.js
parentc4ed137c4537cc0103f8def5ea25f03cbd3b42d6 (diff)
properly implement llvm_uadd|mul_with_overflow_i32
Diffstat (limited to 'src/library.js')
-rw-r--r--src/library.js12
1 files changed, 8 insertions, 4 deletions
diff --git a/src/library.js b/src/library.js
index 0574bb8d..4bbeeee5 100644
--- a/src/library.js
+++ b/src/library.js
@@ -4604,16 +4604,20 @@ LibraryManager.library = {
_ZTIPv: [0],
llvm_uadd_with_overflow_i32: function(x, y) {
+ x = x>>>0;
+ y = y>>>0;
return {
- f0: x+y,
- f1: 0 // We never overflow... for now
+ f0: (x+y)>>>0,
+ f1: x+y > 4294967295
};
},
llvm_umul_with_overflow_i32: function(x, y) {
+ x = x>>>0;
+ y = y>>>0;
return {
- f0: x*y,
- f1: 0 // We never overflow... for now
+ f0: (x*y)>>>0,
+ f1: x*y > 4294967295
};
},