aboutsummaryrefslogtreecommitdiff
path: root/src/runtime.js
diff options
context:
space:
mode:
authorAlon Zakai <alonzakai@gmail.com>2013-03-14 12:52:50 -0700
committerAlon Zakai <alonzakai@gmail.com>2013-03-14 12:52:50 -0700
commit83db455d3c69971e1d109fdb8f92e91b7ee667d8 (patch)
tree8f255689c0429984a70f8ae06f1564ec110b887b /src/runtime.js
parente28105b8e3767ac6691bd6410a484d0fb0a6437e (diff)
move dynamic 64-bit shifts into asm library calls
Diffstat (limited to 'src/runtime.js')
-rw-r--r--src/runtime.js51
1 files changed, 0 insertions, 51 deletions
diff --git a/src/runtime.js b/src/runtime.js
index d5c0fabc..2a26db28 100644
--- a/src/runtime.js
+++ b/src/runtime.js
@@ -122,57 +122,6 @@ var Runtime = {
INT_TYPES: set('i1', 'i8', 'i16', 'i32', 'i64'),
FLOAT_TYPES: set('float', 'double'),
- // Mirrors processMathop's treatment of constants (which we optimize directly)
- BITSHIFT64_SHL: 0,
- BITSHIFT64_ASHR: 1,
- BITSHIFT64_LSHR: 2,
- bitshift64: function(low, high, op, bits) {
- var ret;
- var ander = Math.pow(2, bits)-1;
- if (bits < 32) {
- switch (op) {
- case Runtime.BITSHIFT64_SHL:
- ret = [low << bits, (high << bits) | ((low&(ander << (32 - bits))) >>> (32 - bits))];
- break;
- case Runtime.BITSHIFT64_ASHR:
- ret = [(((low >>> bits ) | ((high&ander) << (32 - bits))) >> 0) >>> 0, (high >> bits) >>> 0];
- break;
- case Runtime.BITSHIFT64_LSHR:
- ret = [((low >>> bits) | ((high&ander) << (32 - bits))) >>> 0, high >>> bits];
- break;
- }
- } else if (bits == 32) {
- switch (op) {
- case Runtime.BITSHIFT64_SHL:
- ret = [0, low];
- break;
- case Runtime.BITSHIFT64_ASHR:
- ret = [high, (high|0) < 0 ? ander : 0];
- break;
- case Runtime.BITSHIFT64_LSHR:
- ret = [high, 0];
- break;
- }
- } else { // bits > 32
- switch (op) {
- case Runtime.BITSHIFT64_SHL:
- ret = [0, low << (bits - 32)];
- break;
- case Runtime.BITSHIFT64_ASHR:
- ret = [(high >> (bits - 32)) >>> 0, (high|0) < 0 ? ander : 0];
- break;
- case Runtime.BITSHIFT64_LSHR:
- ret = [high >>> (bits - 32) , 0];
- break;
- }
- }
-#if ASSERTIONS
- assert(ret);
-#endif
- HEAP32[tempDoublePtr>>2] = ret[0]; // cannot use utility functions since we are in runtime itself
- HEAP32[tempDoublePtr+4>>2] = ret[1];
- },
-
// Imprecise bitops utilities
or64: function(x, y) {
var l = (x | 0) | (y | 0);