@@ -349,6 +349,9 @@ BinaryenExpressionId BinaryenSIMDTernaryId(void) {
349349BinaryenExpressionId BinaryenSIMDShiftId (void ) {
350350 return Expression::Id::SIMDShiftId;
351351}
352+ BinaryenExpressionId BinaryenSIMDLoadId (void ) {
353+ return Expression::Id::SIMDLoadId;
354+ }
352355BinaryenExpressionId BinaryenMemoryInitId (void ) {
353356 return Expression::Id::MemoryInitId;
354357}
@@ -880,6 +883,10 @@ BinaryenOp BinaryenConvertSVecI64x2ToVecF64x2(void) {
880883BinaryenOp BinaryenConvertUVecI64x2ToVecF64x2 (void ) {
881884 return ConvertUVecI64x2ToVecF64x2;
882885}
886+ BinaryenOp BinaryenLoadSplatVec8x16 (void ) { return LoadSplatVec8x16; }
887+ BinaryenOp BinaryenLoadSplatVec16x8 (void ) { return LoadSplatVec16x8; }
888+ BinaryenOp BinaryenLoadSplatVec32x4 (void ) { return LoadSplatVec32x4; }
889+ BinaryenOp BinaryenLoadSplatVec64x2 (void ) { return LoadSplatVec64x2; }
883890BinaryenOp BinaryenNarrowSVecI16x8ToVecI8x16 (void ) {
884891 return NarrowSVecI16x8ToVecI8x16;
885892}
@@ -1599,6 +1606,20 @@ BinaryenExpressionRef BinaryenSIMDShift(BinaryenModuleRef module,
15991606 }
16001607 return static_cast <Expression*>(ret);
16011608}
1609+ BinaryenExpressionRef BinaryenSIMDLoad (BinaryenModuleRef module ,
1610+ BinaryenOp op,
1611+ uint32_t offset,
1612+ uint32_t align,
1613+ BinaryenExpressionRef ptr) {
1614+ auto * ret =
1615+ Builder (*(Module*)module )
1616+ .makeSIMDLoad (
1617+ SIMDLoadOp (op), Address (offset), Address (align), (Expression*)ptr);
1618+ if (tracing) {
1619+ traceExpression (ret, " BinaryenSIMDLoad" , op, offset, align, ptr);
1620+ }
1621+ return static_cast <Expression*>(ret);
1622+ }
16021623BinaryenExpressionRef BinaryenMemoryInit (BinaryenModuleRef module ,
16031624 uint32_t segment,
16041625 BinaryenExpressionRef dest,
@@ -2767,6 +2788,47 @@ BinaryenExpressionRef BinaryenSIMDShiftGetShift(BinaryenExpressionRef expr) {
27672788 assert (expression->is <SIMDShift>());
27682789 return static_cast <SIMDShift*>(expression)->shift ;
27692790}
2791+ // SIMDLoad
2792+ BinaryenOp BinaryenSIMDLoadGetOp (BinaryenExpressionRef expr) {
2793+ if (tracing) {
2794+ std::cout << " BinaryenSIMDLoadGetOp(expressions[" << expressions[expr]
2795+ << " ])\n " ;
2796+ }
2797+
2798+ auto * expression = (Expression*)expr;
2799+ assert (expression->is <SIMDLoad>());
2800+ return static_cast <SIMDLoad*>(expression)->op ;
2801+ }
2802+ uint32_t BinaryenSIMDLoadGetOffset (BinaryenExpressionRef expr) {
2803+ if (tracing) {
2804+ std::cout << " BinaryenSIMDLoadGetOffset(expressions[" << expressions[expr]
2805+ << " ])\n " ;
2806+ }
2807+
2808+ auto * expression = (Expression*)expr;
2809+ assert (expression->is <SIMDLoad>());
2810+ return static_cast <SIMDLoad*>(expression)->offset ;
2811+ }
2812+ uint32_t BinaryenSIMDLoadGetAlign (BinaryenExpressionRef expr) {
2813+ if (tracing) {
2814+ std::cout << " BinaryenSIMDLoadGetAlign(expressions[" << expressions[expr]
2815+ << " ])\n " ;
2816+ }
2817+
2818+ auto * expression = (Expression*)expr;
2819+ assert (expression->is <SIMDLoad>());
2820+ return static_cast <SIMDLoad*>(expression)->align ;
2821+ }
2822+ BinaryenExpressionRef BinaryenSIMDLoadGetPtr (BinaryenExpressionRef expr) {
2823+ if (tracing) {
2824+ std::cout << " BinaryenSIMDLoadGetPtr(expressions[" << expressions[expr]
2825+ << " ])\n " ;
2826+ }
2827+
2828+ auto * expression = (Expression*)expr;
2829+ assert (expression->is <SIMDLoad>());
2830+ return static_cast <SIMDLoad*>(expression)->ptr ;
2831+ }
27702832// MemoryInit
27712833uint32_t BinaryenMemoryInitGetSegment (BinaryenExpressionRef expr) {
27722834 if (tracing) {
0 commit comments