diff options
Diffstat (limited to 'src/parseTools.js')
-rw-r--r-- | src/parseTools.js | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/parseTools.js b/src/parseTools.js index 0eb0bac9..41caeaad 100644 --- a/src/parseTools.js +++ b/src/parseTools.js @@ -140,6 +140,11 @@ function getBits(type) { return parseInt(left); } +function isIllegalType(type) { + var bits = getBits(type); + return bits > 0 && (bits >= 64 || !isPowerOfTwo(bits)); +} + function isVoidType(type) { return type == 'void'; } @@ -1465,6 +1470,15 @@ function finalizeLLVMParameter(param, noIndexizeFunctions) { return ret; } +function makeComparison(a, b, type) { + if (!isIllegalType(type)) { + return a + ' == ' + b; + } else { + assert(type == 'i64'); + return a + '$0 == ' + b + '$0 && ' + a + '$1 == ' + b + '$1'; + } +} + function makeSignOp(value, type, op, force, ignore) { if (USE_TYPED_ARRAYS == 2 && type == 'i64') { return value; // these are always assumed to be two 32-bit unsigneds. |