diff options
Diffstat (limited to 'src/binaryen-c.cpp')
-rw-r--r-- | src/binaryen-c.cpp | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/src/binaryen-c.cpp b/src/binaryen-c.cpp index c554b0a23..71cd92da4 100644 --- a/src/binaryen-c.cpp +++ b/src/binaryen-c.cpp @@ -1616,6 +1616,15 @@ double BinaryenConstGetValueF64(BinaryenExpressionRef expr) { assert(expression->is<Const>()); return static_cast<Const*>(expression)->value.getf64(); } +void BinaryenConstGetValueV128(BinaryenExpressionRef expr, uint8_t* out) { + if (tracing) { + std::cout << " BinaryenConstGetValueV128(expressions[" << expressions[expr] << "], " << out << ");\n"; + } + + auto* expression = (Expression*)expr; + assert(expression->is<Const>()); + memcpy(out, static_cast<Const*>(expression)->value.getv128().data(), 16); +} // Unary BinaryenOp BinaryenUnaryGetOp(BinaryenExpressionRef expr) { if (tracing) { @@ -1945,7 +1954,7 @@ BinaryenExpressionRef BinaryenSIMDShuffleGetRight(BinaryenExpressionRef expr) { } void BinaryenSIMDShuffleGetMask(BinaryenExpressionRef expr, uint8_t *mask) { if (tracing) { - std::cout << " BinaryenSIMDShuffleGetMask(expressions[" << expressions[expr] << "]);\n"; + std::cout << " BinaryenSIMDShuffleGetMask(expressions[" << expressions[expr] << "], " << mask << ");\n"; } auto* expression = (Expression*)expr; @@ -3067,6 +3076,12 @@ size_t BinaryenSizeofLiteral(void) { return sizeof(Literal); } +// Returns the size of an allocate and write result object. +EMSCRIPTEN_KEEPALIVE +size_t BinaryenSizeofAllocateAndWriteResult(void) { + return sizeof(BinaryenModuleAllocateAndWriteResult); +} + #endif } // extern "C" |