diff options
author | Alon Zakai <alonzakai@gmail.com> | 2013-11-14 14:48:54 -0800 |
---|---|---|
committer | Alon Zakai <alonzakai@gmail.com> | 2013-11-14 17:40:44 -0800 |
commit | b397086dab259638aaaddf3520cb6d90d6caae62 (patch) | |
tree | c3767257bfb26a49f88ad4f2f092ef23596e648b | |
parent | 716f22a0cb9e99dc788c3cd9ea24d50e49373ebb (diff) |
ensure a >>> coercion on unsigned comparisons, even if the input is an i29 which would be coerced using an &; fixes asm1.test_sqlite on llvm 3.3
-rw-r--r-- | src/parseTools.js | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/parseTools.js b/src/parseTools.js index c08c9f85..08cf9b60 100644 --- a/src/parseTools.js +++ b/src/parseTools.js @@ -2455,6 +2455,11 @@ function processMathop(item) { // TODO: We sometimes generate false instead of 0, etc., in the *cmps. It seemed slightly faster before, but worth rechecking // Note that with typed arrays, these become 0 when written. So that is a potential difference with non-typed array runs. case 'icmp': { + // unsigned coercions can be (X&Y), which is not a valid asm coercion for comparisons + if (ASM_JS && variant[0] === 'u') { + if (idents[0].indexOf('>>>') < 0) idents[0] = '((' + idents[0] + ')>>>0)'; + if (idents[1].indexOf('>>>') < 0) idents[1] = '((' + idents[1] + ')>>>0)'; + } switch (variant) { case 'uge': case 'sge': return idents[0] + '>=' + idents[1]; case 'ule': case 'sle': return idents[0] + '<=' + idents[1]; |