diff options
-rw-r--r-- | settings.py | 3 | ||||
-rw-r--r-- | src/library.js | 31 |
2 files changed, 31 insertions, 3 deletions
diff --git a/settings.py b/settings.py index 360c9216..1133a656 100644 --- a/settings.py +++ b/settings.py @@ -4,7 +4,7 @@ EMSCRIPTEN_ROOT = os.path.expanduser('~/Dev/emscripten') # this helps projects using emscripten find it -LLVM_ROOT = os.path.expanduser('~/Dev/llvm-3.0/cbuild/bin') +LLVM_ROOT = os.path.expanduser('~/Dev/llvm/cbuild/bin') # See below for notes on which JS engine(s) you need NODE_JS = 'node' @@ -15,6 +15,7 @@ JAVA = 'java' TEMP_DIR = '/tmp' # You will need to modify this on Windows +#CLOSURE_COMPILER = '..' # define this to not use the bundled version ######################################################################################################## diff --git a/src/library.js b/src/library.js index b9c13055..104b0dc4 100644 --- a/src/library.js +++ b/src/library.js @@ -4771,15 +4771,42 @@ LibraryManager.library = { // type_info for void*. _ZTIPv: [0], + llvm_uadd_with_overflow_i8: function(x, y) { + x = x & 0xff; + y = y & 0xff; + return { + f0: (x+y) & 0xff, + f1: x+y > 255 + }; + }, + + llvm_umul_with_overflow_i8: function(x, y) { + x = x & 0xff; + y = y & 0xff; + return { + f0: (x*y) & 0xff, + f1: x*y > 255 + }; + }, + llvm_uadd_with_overflow_i16: function(x, y) { - x = (x>>>0) & 0xffff; - y = (y>>>0) & 0xffff; + x = x & 0xffff; + y = y & 0xffff; return { f0: (x+y) & 0xffff, f1: x+y > 65535 }; }, + llvm_umul_with_overflow_i16: function(x, y) { + x = x & 0xffff; + y = y & 0xffff; + return { + f0: (x*y) & 0xffff, + f1: x*y > 65535 + }; + }, + llvm_uadd_with_overflow_i32: function(x, y) { x = x>>>0; y = y>>>0; |