aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlon Zakai <alonzakai@gmail.com>2013-04-24 16:13:18 -0700
committerAlon Zakai <alonzakai@gmail.com>2013-04-24 16:13:18 -0700
commit07dbdeceb6077db05a9d664a7d4c801a2382562a (patch)
tree2e354ddd3fc497efdd13bacf0c2264277dce8f9f
parentdd5f2aa4d74f57184bbf0f947a64a2f6925d0bc4 (diff)
simplify i64Add|Substract coercions
-rw-r--r--src/library.js8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/library.js b/src/library.js
index 5bbf4204..65e1cb8e 100644
--- a/src/library.js
+++ b/src/library.js
@@ -7511,7 +7511,7 @@ LibraryManager.library = {
a = a|0; b = b|0; c = c|0; d = d|0;
var l = 0, h = 0;
l = (a + c)>>>0;
- h = (((b + d)>>>0) + (((l>>>0) < (a>>>0))>>>0))>>>0; // Add carry from low word to high word on overflow.
+ h = (b + d + (((l>>>0) < (a>>>0))|0))>>>0; // Add carry from low word to high word on overflow.
{{{ makeStructuralReturn(['l|0', 'h'], true) }}};
},
llvm_uadd_with_overflow_i64__asm: true,
@@ -7521,8 +7521,8 @@ LibraryManager.library = {
var l = 0, h = 0, overflow = 0;
l = (a + c)>>>0;
h = (b + d)>>>0;
- overflow = ((h>>>0) < (b>>>0))>>>0; // Return whether addition overflowed even the high word.
- h = h + (((l>>>0) < (a>>>0))>>>0)>>>0; // Add carry from low word to high word on overflow.
+ overflow = ((h>>>0) < (b>>>0))|0; // Return whether addition overflowed even the high word.
+ h = (h + (((l>>>0) < (a>>>0))|0))>>>0; // Add carry from low word to high word on overflow.
overflow = overflow | (h == 0); // Check again for overflow.
{{{ makeStructuralReturn(['l|0', 'h', 'overflow'], true) }}};
},
@@ -7534,7 +7534,7 @@ LibraryManager.library = {
var l = 0, h = 0;
l = (a - c)>>>0;
h = (b - d)>>>0;
- h = (((b - d)>>>0) - (((c>>>0) > (a>>>0))>>>0))>>>0; // Borrow one from high word to low word on underflow.
+ h = (b - d - (((c>>>0) > (a>>>0))|0))>>>0; // Borrow one from high word to low word on underflow.
{{{ makeStructuralReturn(['l|0', 'h'], true) }}};
},