diff options
author | Thomas Lively <7121787+tlively@users.noreply.github.com> | 2021-02-01 16:53:01 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-02-01 16:53:01 -0800 |
commit | b5c287567ebcb3cbb1b1acb7f9e717f8b834ea83 (patch) | |
tree | 158cb452f58553cc0244d98c45e9d2b2705c1bbd /src/passes/Print.cpp | |
parent | a4837c095275b465005841616ff10bcd0b0d7996 (diff) | |
download | binaryen-b5c287567ebcb3cbb1b1acb7f9e717f8b834ea83.tar.gz binaryen-b5c287567ebcb3cbb1b1acb7f9e717f8b834ea83.tar.bz2 binaryen-b5c287567ebcb3cbb1b1acb7f9e717f8b834ea83.zip |
Prototype i32x4.widen_i8x16_{s,u} (#3535)
As proposed in https://github.com/WebAssembly/simd/pull/395. Note that the other
instructions in the proposal have not been implemented in LLVM or in V8, so
there is no need to implement them in Binaryen right now either. This PR
introduces a new expression class for the new instructions because they uniquely
take an immediate argument identifying which portion of the input vector to
widen.
Diffstat (limited to 'src/passes/Print.cpp')
-rw-r--r-- | src/passes/Print.cpp | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/src/passes/Print.cpp b/src/passes/Print.cpp index 39c66cc57..74bd5598f 100644 --- a/src/passes/Print.cpp +++ b/src/passes/Print.cpp @@ -671,6 +671,19 @@ struct PrintExpressionContents } o << " " << int(curr->index); } + void visitSIMDWiden(SIMDWiden* curr) { + prepareColor(o); + switch (curr->op) { + case WidenSVecI8x16ToVecI32x4: + o << "i32x4.widen_i8x16_s "; + break; + case WidenUVecI8x16ToVecI32x4: + o << "i32x4.widen_i8x16_u "; + break; + } + restoreNormalColor(o); + o << int(curr->index); + } void visitPrefetch(Prefetch* curr) { prepareColor(o); switch (curr->op) { @@ -2303,6 +2316,13 @@ struct PrintSExpression : public OverriddenVisitor<PrintSExpression> { printFullLine(curr->vec); decIndent(); } + void visitSIMDWiden(SIMDWiden* curr) { + o << '('; + PrintExpressionContents(currFunction, o).visit(curr); + incIndent(); + printFullLine(curr->vec); + decIndent(); + } void visitPrefetch(Prefetch* curr) { o << '('; PrintExpressionContents(currFunction, o).visit(curr); |