1- declare module binaryen {
1+ declare namespace binaryen {
22
33 type Type = number ;
44 type PackedType = number ;
55 type HeapType = number ;
66
77 const none : Type ;
8+ const auto : Type ;
9+ const unreachable : Type ;
810
911 const i32 : Type ;
1012 const i64 : Type ;
@@ -20,18 +22,10 @@ declare module binaryen {
2022 const structref : Type ;
2123 const arrayref : Type ;
2224 const stringref : Type ;
23-
2425 const nullref : Type ;
2526 const nullexternref : Type ;
2627 const nullfuncref : Type ;
2728
28- const unreachable : Type ;
29- const auto : Type ;
30-
31- const notPacked : PackedType ;
32- const i8 : PackedType ;
33- const i16 : PackedType ;
34-
3529 const ext : HeapType ;
3630 const func : HeapType ;
3731 const any : HeapType ;
@@ -40,10 +34,13 @@ declare module binaryen {
4034 const struct : HeapType ;
4135 const array : HeapType ;
4236 const string : HeapType ;
43- const none : HeapType ;
4437 const noext : HeapType ;
4538 const nofunc : HeapType ;
4639
40+ const i8 : PackedType ;
41+ const i16 : PackedType ;
42+ const notPacked : PackedType ;
43+
4744 function createType ( types : readonly Type [ ] ) : Type ;
4845 function expandType ( type : Type ) : Type [ ] ;
4946 function getTypeFromHeapType ( heapType : HeapType , nullable : boolean ) : Type ;
@@ -70,6 +67,7 @@ declare module binaryen {
7067 AtomicWait ,
7168 AtomicNotify ,
7269 AtomicFence ,
70+ Pause ,
7371 SIMDExtract ,
7472 SIMDReplace ,
7573 SIMDShuffle ,
@@ -101,6 +99,8 @@ declare module binaryen {
10199 TableGrow ,
102100 TableFill ,
103101 TableCopy ,
102+ TableInit ,
103+ ElemDrop ,
104104 Try ,
105105 TryTable ,
106106 Throw ,
@@ -113,31 +113,48 @@ declare module binaryen {
113113 CallRef ,
114114 RefTest ,
115115 RefCast ,
116+ RefGetDesc ,
116117 BrOn ,
117118 StructNew ,
118119 StructGet ,
119120 StructSet ,
121+ StructRMW ,
122+ StructCmpxchg ,
120123 ArrayNew ,
121124 ArrayNewData ,
122125 ArrayNewElem ,
123126 ArrayNewFixed ,
124127 ArrayGet ,
125128 ArraySet ,
129+ ArrayLoad ,
130+ ArrayStore ,
126131 ArrayLen ,
127132 ArrayCopy ,
128133 ArrayFill ,
129134 ArrayInitData ,
130135 ArrayInitElem ,
136+ ArrayRMW ,
137+ ArrayCmpxchg ,
131138 RefAs ,
132139 StringNew ,
133140 StringConst ,
134141 StringMeasure ,
135142 StringEncode ,
136143 StringConcat ,
137144 StringEq ,
145+ StringTest ,
138146 StringWTF16Get ,
139147 StringSliceWTF ,
140- Resume
148+ ContNew ,
149+ ContBind ,
150+ Suspend ,
151+ Resume ,
152+ ResumeThrow ,
153+ StackSwitch ,
154+ StructWait ,
155+ StructNotify ,
156+ WideIntAddSub ,
157+ WideIntMul
141158 }
142159
143160 const InvalidId : ExpressionIds ;
@@ -160,6 +177,7 @@ declare module binaryen {
160177 const AtomicWaitId : ExpressionIds ;
161178 const AtomicNotifyId : ExpressionIds ;
162179 const AtomicFenceId : ExpressionIds ;
180+ const PauseId : ExpressionIds ;
163181 const SIMDExtractId : ExpressionIds ;
164182 const SIMDReplaceId : ExpressionIds ;
165183 const SIMDShuffleId : ExpressionIds ;
@@ -191,6 +209,8 @@ declare module binaryen {
191209 const TableGrowId : ExpressionIds ;
192210 const TableFillId : ExpressionIds ;
193211 const TableCopyId : ExpressionIds ;
212+ const TableInitId : ExpressionIds ;
213+ const ElemDropId : ExpressionIds ;
194214 const TryId : ExpressionIds ;
195215 const TryTableId : ExpressionIds ;
196216 const ThrowId : ExpressionIds ;
@@ -203,31 +223,48 @@ declare module binaryen {
203223 const CallRefId : ExpressionIds ;
204224 const RefTestId : ExpressionIds ;
205225 const RefCastId : ExpressionIds ;
226+ const RefGetDescId : ExpressionIds ;
206227 const BrOnId : ExpressionIds ;
207228 const StructNewId : ExpressionIds ;
208229 const StructGetId : ExpressionIds ;
209230 const StructSetId : ExpressionIds ;
231+ const StructRMWId : ExpressionIds ;
232+ const StructCmpxchgId : ExpressionIds ;
210233 const ArrayNewId : ExpressionIds ;
211234 const ArrayNewDataId : ExpressionIds ;
212235 const ArrayNewElemId : ExpressionIds ;
213236 const ArrayNewFixedId : ExpressionIds ;
214237 const ArrayGetId : ExpressionIds ;
215238 const ArraySetId : ExpressionIds ;
239+ const ArrayLoadId : ExpressionIds ;
240+ const ArrayStoreId : ExpressionIds ;
216241 const ArrayLenId : ExpressionIds ;
217242 const ArrayCopyId : ExpressionIds ;
218243 const ArrayFillId : ExpressionIds ;
219244 const ArrayInitDataId : ExpressionIds ;
220245 const ArrayInitElemId : ExpressionIds ;
246+ const ArrayRMWId : ExpressionIds ;
247+ const ArrayCmpxchgId : ExpressionIds ;
221248 const RefAsId : ExpressionIds ;
222249 const StringNewId : ExpressionIds ;
223250 const StringConstId : ExpressionIds ;
224251 const StringMeasureId : ExpressionIds ;
225252 const StringEncodeId : ExpressionIds ;
226253 const StringConcatId : ExpressionIds ;
227254 const StringEqId : ExpressionIds ;
255+ const StringTestId : ExpressionIds ;
228256 const StringWTF16GetId : ExpressionIds ;
229257 const StringSliceWTFId : ExpressionIds ;
258+ const ContNewId : ExpressionIds ;
259+ const ContBindId : ExpressionIds ;
260+ const SuspendId : ExpressionIds ;
230261 const ResumeId : ExpressionIds ;
262+ const ResumeThrowId : ExpressionIds ;
263+ const StackSwitchId : ExpressionIds ;
264+ const StructWaitId : ExpressionIds ;
265+ const StructNotifyId : ExpressionIds ;
266+ const WideIntAddSubId : ExpressionIds ;
267+ const WideIntMulId : ExpressionIds ;
231268
232269 const enum ExternalKinds {
233270 Function ,
@@ -245,39 +282,41 @@ declare module binaryen {
245282
246283 type MemoryOrder = number ;
247284
248- declare const MemoryOrder : {
285+ const MemoryOrder : {
249286 readonly unordered : MemoryOrder ;
250287 readonly seqcst : MemoryOrder ;
251288 readonly acqrel : MemoryOrder ;
252289 } ;
253290
254291 enum Features {
255- MVP ,
256- Atomics ,
257- MutableGlobals ,
258- NontrappingFPToInt ,
259- SIMD128 ,
260- BulkMemory ,
261- SignExt ,
262- ExceptionHandling ,
263- TailCall ,
264- ReferenceTypes ,
265- Multivalue ,
266- GC ,
267- Memory64 ,
268- RelaxedSIMD ,
269- ExtendedConst ,
270- Strings ,
271- MultiMemory ,
272- StackSwitching ,
273- SharedEverything ,
274- FP16 ,
275- BulkMemoryOpt ,
276- CallIndirectOverlong ,
277- RelaxedAtomics ,
278- Multibyte ,
279- CustomPageSizes ,
280- All
292+ MVP = 0 ,
293+ Atomics = 1 << 0 ,
294+ MutableGlobals = 1 << 1 ,
295+ NontrappingFPToInt = 1 << 2 ,
296+ SIMD128 = 1 << 3 ,
297+ BulkMemory = 1 << 4 ,
298+ SignExt = 1 << 5 ,
299+ ExceptionHandling = 1 << 6 ,
300+ TailCall = 1 << 7 ,
301+ ReferenceTypes = 1 << 8 ,
302+ Multivalue = 1 << 9 ,
303+ GC = 1 << 10 ,
304+ Memory64 = 1 << 11 ,
305+ RelaxedSIMD = 1 << 12 ,
306+ ExtendedConst = 1 << 13 ,
307+ Strings = 1 << 14 ,
308+ MultiMemory = 1 << 15 ,
309+ StackSwitching = 1 << 16 ,
310+ SharedEverything = 1 << 17 ,
311+ FP16 = 1 << 18 ,
312+ BulkMemoryOpt = 1 << 19 ,
313+ CallIndirectOverlong = 1 << 20 ,
314+ // CustomDescriptors = 1 << 21, // TODO: CustomDescriptors has no JS getter.
315+ RelaxedAtomics = 1 << 22 ,
316+ Multibyte = 1 << 24 ,
317+ CustomPageSizes = 1 << 23 ,
318+ WideArithmetic = 1 << 25 ,
319+ All = ( 1 << 26 ) - 1
281320 }
282321
283322 const enum Operations {
@@ -501,11 +540,11 @@ declare module binaryen {
501540 RelaxedNmaddVecF32x4 ,
502541 RelaxedMaddVecF64x2 ,
503542 RelaxedNmaddVecF64x2 ,
504- LaneselectI8x16 ,
505- LaneselectI16x8 ,
506- LaneselectI32x4 ,
507- LaneselectI64x2 ,
508- DotI8x16I7x16AddSToVecI32x4 ,
543+ RelaxedLaneselectI8x16 ,
544+ RelaxedLaneselectI16x8 ,
545+ RelaxedLaneselectI32x4 ,
546+ RelaxedLaneselectI64x2 ,
547+ RelaxedDotI8x16I7x16AddSToVecI32x4 ,
509548 AnyTrueVec128 ,
510549 PopcntVecI8x16 ,
511550 AbsVecI8x16 ,
@@ -674,7 +713,7 @@ declare module binaryen {
674713 RelaxedMinVecF64x2 ,
675714 RelaxedMaxVecF64x2 ,
676715 RelaxedQ15MulrSVecI16x8 ,
677- DotI8x16I7x16SToVecI16x8 ,
716+ RelaxedDotI8x16I7x16SToVecI16x8 ,
678717 RefAsNonNull ,
679718 RefAsExternInternalize ,
680719 RefAsExternExternalize ,
@@ -692,7 +731,11 @@ declare module binaryen {
692731 StringEncodeLossyUTF8Array ,
693732 StringEncodeWTF16Array ,
694733 StringEqEqual ,
695- StringEqCompare
734+ StringEqCompare ,
735+ AddInt128 ,
736+ SubInt128 ,
737+ MulWideSInt64 ,
738+ MulWideUInt64
696739 }
697740
698741 const ClzInt32 : Operations ;
@@ -915,11 +958,11 @@ declare module binaryen {
915958 const RelaxedNmaddVecF32x4 : Operations ;
916959 const RelaxedMaddVecF64x2 : Operations ;
917960 const RelaxedNmaddVecF64x2 : Operations ;
918- const LaneselectI8x16 : Operations ;
919- const LaneselectI16x8 : Operations ;
920- const LaneselectI32x4 : Operations ;
921- const LaneselectI64x2 : Operations ;
922- const DotI8x16I7x16AddSToVecI32x4 : Operations ;
961+ const RelaxedLaneselectI8x16 : Operations ;
962+ const RelaxedLaneselectI16x8 : Operations ;
963+ const RelaxedLaneselectI32x4 : Operations ;
964+ const RelaxedLaneselectI64x2 : Operations ;
965+ const RelaxedDotI8x16I7x16AddSToVecI32x4 : Operations ;
923966 const AnyTrueVec128 : Operations ;
924967 const PopcntVecI8x16 : Operations ;
925968 const AbsVecI8x16 : Operations ;
@@ -1088,10 +1131,12 @@ declare module binaryen {
10881131 const RelaxedMinVecF64x2 : Operations ;
10891132 const RelaxedMaxVecF64x2 : Operations ;
10901133 const RelaxedQ15MulrSVecI16x8 : Operations ;
1091- const DotI8x16I7x16SToVecI16x8 : Operations ;
1134+ const RelaxedDotI8x16I7x16SToVecI16x8 : Operations ;
10921135 const RefAsNonNull : Operations ;
10931136 const RefAsExternInternalize : Operations ;
10941137 const RefAsExternExternalize : Operations ;
1138+ const RefAsAnyConvertExtern : Operations ;
1139+ const RefAsExternConvertAny : Operations ;
10951140 const BrOnNull : Operations ;
10961141 const BrOnNonNull : Operations ;
10971142 const BrOnCast : Operations ;
@@ -1105,6 +1150,10 @@ declare module binaryen {
11051150 const StringEncodeWTF16Array : Operations ;
11061151 const StringEqEqual : Operations ;
11071152 const StringEqCompare : Operations ;
1153+ const AddInt128 : Operations ;
1154+ const SubInt128 : Operations ;
1155+ const MulWideSInt64 : Operations ;
1156+ const MulWideUInt64 : Operations ;
11081157
11091158 const enum ExpressionRunnerFlags {
11101159 Default ,
@@ -1304,6 +1353,10 @@ declare module binaryen {
13041353 extend32_s ( value : ExpressionRef ) : ExpressionRef ;
13051354 extend_s ( value : ExpressionRef ) : ExpressionRef ;
13061355 extend_u ( value : ExpressionRef ) : ExpressionRef ;
1356+ add128 ( leftLow : ExpressionRef , leftHigh : ExpressionRef , rightLow : ExpressionRef , rightHigh : ExpressionRef ) : ExpressionRef ;
1357+ sub128 ( leftLow : ExpressionRef , leftHigh : ExpressionRef , rightLow : ExpressionRef , rightHigh : ExpressionRef ) : ExpressionRef ;
1358+ mul_wide_s ( left : ExpressionRef , right : ExpressionRef ) : ExpressionRef ;
1359+ mul_wide_u ( left : ExpressionRef , right : ExpressionRef ) : ExpressionRef ;
13071360 add ( left : ExpressionRef , right : ExpressionRef ) : ExpressionRef ;
13081361 sub ( left : ExpressionRef , right : ExpressionRef ) : ExpressionRef ;
13091362 mul ( left : ExpressionRef , right : ExpressionRef ) : ExpressionRef ;
0 commit comments