diff options
author | Alon Zakai <alonzakai@gmail.com> | 2013-10-17 16:21:23 -0700 |
---|---|---|
committer | Alon Zakai <alonzakai@gmail.com> | 2013-10-18 13:00:49 -0700 |
commit | 0b6d165a18823af90a65d9d24ee3006d372d7964 (patch) | |
tree | 822ee746f89f92b3d6c5b72a155b9663ee620c29 | |
parent | e7176852da4f67f61019a53e4b5b4413fe24394e (diff) |
stubs for insertelement and shufflevector
-rw-r--r-- | src/intertyper.js | 26 | ||||
-rw-r--r-- | src/jsifier.js | 8 |
2 files changed, 34 insertions, 0 deletions
diff --git a/src/intertyper.js b/src/intertyper.js index 41fba007..4c842b18 100644 --- a/src/intertyper.js +++ b/src/intertyper.js @@ -312,6 +312,10 @@ function intertyper(lines, sidePass, baseLineNums) { return va_argHandler(item); if (tokensLength >= 3 && token0Text == 'landingpad') return landingpadHandler(item); + if (token0Text === 'insertelement') + return insertElementHandler(item); + if (token0Text === 'shufflevector') + return shuffleVectorHandler(item); if (token0Text == 'fence') return null; } else if (item.indent === 0) { @@ -752,6 +756,28 @@ function intertyper(lines, sidePass, baseLineNums) { Types.needAnalysis[item.type] = 0; return item; } + function insertElementHandler(item) { + var last = getTokenIndexByText(item.tokens, ';'); + item.intertype = 'insertelement'; + item.type = item.tokens[1].text; // Of the origin aggregate, as well as the result + Types.needAnalysis[item.type] = 0; + item.ident = toNiceIdent(item.tokens[2].text); + var segments = splitTokenList(item.tokens.slice(4, last)); + item.value = parseLLVMSegment(segments[0]); + item.index = parseLLVMSegment(segments[1]); + return item; + } + function shuffleVectorHandler(item) { + var last = getTokenIndexByText(item.tokens, ';'); + item.intertype = 'shufflevector'; + item.type = item.tokens[1].text; // Of the origin aggregate, as well as the result + Types.needAnalysis[item.type] = 0; + item.ident = toNiceIdent(item.tokens[2].text); + var segments = splitTokenList(item.tokens.slice(4, last)); + item.value = parseLLVMSegment(segments[0]); + item.mask = parseLLVMSegment(segments[1]); + return item; + } // 'alloca' function allocaHandler(item) { item.intertype = 'alloca'; diff --git a/src/jsifier.js b/src/jsifier.js index 01f1b27d..0b46a3e6 100644 --- a/src/jsifier.js +++ b/src/jsifier.js @@ -522,6 +522,8 @@ function JSify(data, functionsOnly, givenFunctions) { case 'load': line.JS = loadHandler(line); break; case 'extractvalue': line.JS = extractvalueHandler(line); break; case 'insertvalue': line.JS = insertvalueHandler(line); break; + case 'insertelement': line.JS = insertelementHandler(line); break; + case 'shufflevector': line.JS = shufflevectorHandler(line); break; case 'indirectbr': line.JS = indirectbrHandler(line); break; case 'alloca': line.JS = allocaHandler(line); break; case 'va_arg': line.JS = va_argHandler(line); break; @@ -1342,6 +1344,12 @@ function JSify(data, functionsOnly, givenFunctions) { } return ret + item.ident + '.f' + item.indexes[0][0].text + '=' + finalizeLLVMParameter(item.value) + ', ' + item.ident + ')'; } + function insertelementHandler(item) { + return 'TODO'; + } + function shufflevectorHandler(item) { + return 'TODO'; + } function indirectbrHandler(item) { var phiSets = calcPhiSets(item); var js = makeVarDef('ibr') + '=' + finalizeLLVMParameter(item.value) + ';'; |