diff options
Diffstat (limited to 'src/parseTools.js')
-rw-r--r-- | src/parseTools.js | 19 |
1 files changed, 7 insertions, 12 deletions
diff --git a/src/parseTools.js b/src/parseTools.js index 4fb76196..ececf477 100644 --- a/src/parseTools.js +++ b/src/parseTools.js @@ -467,7 +467,7 @@ function parseParamTokens(params) { // handle 'byval' and 'byval align X'. We store the alignment in 'byVal' byVal = QUANTUM_SIZE; segment.splice(1, 1); - if (segment[1] && (segment[1].text === 'nocapture' || segment[1].text === 'readonly')) { + if (segment[1] && (segment[1].text in LLVM.PARAM_IGNORABLES)) { segment.splice(1, 1); } if (segment[1] && segment[1].text === 'align') { @@ -476,7 +476,7 @@ function parseParamTokens(params) { segment.splice(1, 2); } } - if (segment[1] && (segment[1].text === 'nocapture' || segment[1].text === 'readonly')) { + if (segment[1] && (segment[1].text in LLVM.PARAM_IGNORABLES)) { segment.splice(1, 1); } if (segment.length == 1) { @@ -1168,15 +1168,10 @@ function getHeapOffset(offset, type, forceAsm) { var sz = Runtime.getNativeTypeSize(type); var shifts = Math.log(sz)/Math.LN2; offset = '(' + offset + ')'; - if (shifts != 0) { - if (CHECK_HEAP_ALIGN) { - return '((CHECK_ALIGN_' + sz + '(' + offset + '|0)|0)>>' + shifts + ')'; - } else { - return '(' + offset + '>>' + shifts + ')'; - } + if (CHECK_HEAP_ALIGN && shifts > 0) { + return '((CHECK_ALIGN_' + sz + '(' + offset + '|0)|0)>>' + shifts + ')'; } else { - // we need to guard against overflows here, HEAP[U]8 expects a guaranteed int - return isJSVar(offset) ? offset : '(' + offset + '|0)'; + return '(' + offset + '>>' + shifts + ')'; } } @@ -2040,7 +2035,7 @@ function finalizeLLVMParameter(param, noIndexizeFunctions) { } else if (param.intertype == 'mathop') { return processMathop(param); } else if (param.intertype === 'vector') { - return getVectorBaseType(param.type) + '32x4(' + param.idents.join(',') + ')'; + return 'SIMD.' + getVectorBaseType(param.type) + '32x4(' + param.idents.join(',') + ')'; } else { throw 'invalid llvm parameter: ' + param.intertype; } @@ -2705,7 +2700,7 @@ var simdLane = ['x', 'y', 'z', 'w']; function ensureVector(ident, base) { Types.usesSIMD = true; - return ident == 0 ? base + '32x4.splat(0)' : ident; + return ident == 0 ? 'SIMD.' + base + '32x4.splat(0)' : ident; } function ensureValidFFIType(type) { |