diff options
author | Alon Zakai <alonzakai@gmail.com> | 2013-01-15 13:10:55 -0800 |
---|---|---|
committer | Alon Zakai <alonzakai@gmail.com> | 2013-01-15 13:10:55 -0800 |
commit | c05d19aef2eaeef7743c7ba574e71de786519d1b (patch) | |
tree | 4d1b493bb716c09df0db4b539ca17a9e8619f69b /src/analyzer.js | |
parent | c47f7eba9be951c8e308e66c2541091c6b057af8 (diff) | |
parent | a21017cfe7ca199a6a51511ee65aea63f011446b (diff) |
Merge branch 'incoming'
Diffstat (limited to 'src/analyzer.js')
-rw-r--r-- | src/analyzer.js | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/src/analyzer.js b/src/analyzer.js index 0ad3e017..229bda9f 100644 --- a/src/analyzer.js +++ b/src/analyzer.js @@ -617,8 +617,8 @@ function analyzer(data, sidePass) { for (var i = 0; i < targetElements.length; i++) { if (i > 0) { switch(value.variant) { - case 'eq': ident += '&&'; break; - case 'ne': ident += '||'; break; + case 'eq': ident += '&'; break; + case 'ne': ident += '|'; break; default: throw 'unhandleable illegal icmp: ' + value.variant; } } @@ -654,9 +654,12 @@ function analyzer(data, sidePass) { // We can't statically legalize this, do the operation at runtime TODO: optimize assert(sourceBits == 64, 'TODO: handle nonconstant shifts on != 64 bits'); value.intertype = 'value'; - value.ident = 'Runtime' + (ASM_JS ? '_' : '.') + 'bitshift64(' + sourceElements[0].ident + ', ' + - sourceElements[1].ident + ',"' + value.op + '",' + value.params[1].ident + '$0);' + - 'var ' + value.assignTo + '$0 = ' + makeGetTempDouble(0) + ', ' + value.assignTo + '$1 = ' + makeGetTempDouble(1) + ';'; + value.ident = 'Runtime' + (ASM_JS ? '_' : '.') + 'bitshift64(' + + asmCoercion(sourceElements[0].ident, 'i32') + ',' + + asmCoercion(sourceElements[1].ident, 'i32') + ',' + + Runtime['BITSHIFT64_' + value.op.toUpperCase()] + ',' + + asmCoercion(value.params[1].ident + '$0', 'i32') + ');' + + 'var ' + value.assignTo + '$0 = ' + makeGetTempDouble(0, 'i32') + ', ' + value.assignTo + '$1 = ' + makeGetTempDouble(1, 'i32') + ';'; value.assignTo = null; i++; continue; |