@@ -331,7 +331,9 @@ export const enum ExpressionId {
331331 ResumeThrow = 102 /* _BinaryenResumeThrowId */ ,
332332 StackSwitch = 103 /* _BinaryenStackSwitchId */ ,
333333 StructWait = 104 /* _BinaryenStructWaitId */ ,
334- StructNotify = 105 /* _BinaryenStructNotifyId */
334+ StructNotify = 105 /* _BinaryenStructNotifyId */ ,
335+ WideIntAddSub = 106 /* _BinaryenWideIntAddSubId */ ,
336+ WideIntMul = 107 /* _BinaryenWideIntMulId */
335337}
336338
337339/** Binaryen external kind constants. */
@@ -1057,7 +1059,7 @@ export const enum BinaryOp {
10571059 /** i16x8.relaxed_q15mulr_s */
10581060 RelaxedQ15MulrI16x8 = 215 /* _BinaryenRelaxedQ15MulrSVecI16x8 */ ,
10591061 /** i16x8.relaxed_dot_i8x16_i7x16_s */
1060- RelaxedDotI8x16I7x16ToI16x8 = 216 /* _BinaryenDotI8x16I7x16SToVecI16x8 */ ,
1062+ RelaxedDotI8x16I7x16ToI16x8 = 216 /* _BinaryenRelaxedDotI8x16I7x16SToVecI16x8 */ ,
10611063
10621064 _last = RelaxedDotI8x16I7x16ToI16x8 ,
10631065
@@ -1258,15 +1260,15 @@ export const enum SIMDTernaryOp {
12581260 /** f64x2.relaxed_nmadd */
12591261 RelaxedNmaddF64x2 = 4 /* _BinaryenRelaxedNmaddVecF64x2 */ ,
12601262 /** i8x16.relaxed_laneselect */
1261- RelaxedLaneselectI8x16 = 5 /* _BinaryenLaneselectI8x16 */ ,
1263+ RelaxedLaneselectI8x16 = 5 /* _BinaryenRelaxedLaneselectI8x16 */ ,
12621264 /** i16x8.relaxed_laneselect */
1263- RelaxedLaneselectI16x8 = 6 /* _BinaryenLaneselectI16x8 */ ,
1265+ RelaxedLaneselectI16x8 = 6 /* _BinaryenRelaxedLaneselectI16x8 */ ,
12641266 /** i32x4.relaxed_laneselect */
1265- RelaxedLaneselectI32x4 = 7 /* _BinaryenLaneselectI32x4 */ ,
1267+ RelaxedLaneselectI32x4 = 7 /* _BinaryenRelaxedLaneselectI32x4 */ ,
12661268 /** i64x2.relaxed_laneselect */
1267- RelaxedLaneselectI64x2 = 8 /* _BinaryenLaneselectI64x2 */ ,
1269+ RelaxedLaneselectI64x2 = 8 /* _BinaryenRelaxedLaneselectI64x2 */ ,
12681270 /** i32x4.relaxed_dot_i8x16_i7x16_add_s */
1269- RelaxedDotI8x16I7x16AddToI32x4 = 9 /* _BinaryenDotI8x16I7x16AddSToVecI32x4 */ ,
1271+ RelaxedDotI8x16I7x16AddToI32x4 = 9 /* _BinaryenRelaxedDotI8x16I7x16AddSToVecI32x4 */ ,
12701272 // FIXME: f16x8 madd/nmadd (= 10, 11) are in wasm.h but not yet exported via C API
12711273}
12721274
@@ -1275,9 +1277,25 @@ export const enum RefAsOp {
12751277 /** ref.as_non_null */
12761278 NonNull = 0 /* _BinaryenRefAsNonNull */ ,
12771279 /** any.convert_extern */
1278- ExternInternalize = 1 /* _BinaryenRefAsAnyConvertExtern */ ,
1280+ AnyConvertExtern = 1 /* _BinaryenRefAsAnyConvertExtern */ ,
12791281 /** extern.convert_any */
1280- ExternExternalize = 2 /* _BinaryenRefAsExternConvertAny */
1282+ ExternConvertAny = 2 /* _BinaryenRefAsExternConvertAny */
1283+ }
1284+
1285+ /** Binaryen wide integer add/sub operation constants. */
1286+ export const enum WideIntAddSubOp {
1287+ /** i64.add128 */
1288+ Add = 0 /* _BinaryenAddInt128 */ ,
1289+ /** i64.sub128 */
1290+ Sub = 1 /* _BinaryenSubInt128 */
1291+ }
1292+
1293+ /** Binaryen wide integer multiply operation constants. */
1294+ export const enum WideIntMulOp {
1295+ /** i64.mul_wide_s */
1296+ SignedI64 = 0 /* _BinaryenMulWideSInt64 */ ,
1297+ /** i64.mul_wide_u */
1298+ UnsignedI64 = 1 /* _BinaryenMulWideUInt64 */
12811299}
12821300
12831301/** Binaryen BrOn operation constants. */
@@ -1511,6 +1529,24 @@ export class Module {
15111529 return binaryen . _BinaryenBinary ( this . ref , op , left , right ) ;
15121530 }
15131531
1532+ wide_int_add_sub (
1533+ op : WideIntAddSubOp ,
1534+ leftLow : ExpressionRef ,
1535+ leftHigh : ExpressionRef ,
1536+ rightLow : ExpressionRef ,
1537+ rightHigh : ExpressionRef
1538+ ) : ExpressionRef {
1539+ return binaryen . _BinaryenWideIntAddSub ( this . ref , op , leftLow , leftHigh , rightLow , rightHigh ) ;
1540+ }
1541+
1542+ wide_int_mul (
1543+ op : WideIntMulOp ,
1544+ left : ExpressionRef ,
1545+ right : ExpressionRef
1546+ ) : ExpressionRef {
1547+ return binaryen . _BinaryenWideIntMul ( this . ref , op , left , right ) ;
1548+ }
1549+
15141550 memory_size ( name : string = CommonNames . DefaultMemory , is64 : bool = false ) : ExpressionRef {
15151551 let cStr = this . allocStringCached ( name ) ;
15161552 return binaryen . _BinaryenMemorySize ( this . ref , cStr , is64 ) ;
@@ -2450,6 +2486,14 @@ export class Module {
24502486 binaryen . _free ( cArr ) ;
24512487 }
24522488
2489+ /** Ensures that an empty function table of the given name exists, to be sized and filled later. */
2490+ ensureFunctionTable ( name : string ) : void {
2491+ let cStr = this . allocStringCached ( name ) ;
2492+ if ( ! binaryen . _BinaryenGetTable ( this . ref , cStr ) ) {
2493+ binaryen . _BinaryenAddTable ( this . ref , cStr , 0 , Module . UNLIMITED_TABLE , TypeRef . Funcref ) ;
2494+ }
2495+ }
2496+
24532497 /* setFunctionTable(
24542498 initial: Index,
24552499 maximum: Index,
0 commit comments