Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Update binaryen's constants #1552

Merged
merged 6 commits into from
Nov 23, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/glue/binaryen.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@ export declare function _BinaryenMemoryFillId(): BinaryenExpressionId;
export declare function _BinaryenRefNullId(): BinaryenExpressionId;
export declare function _BinaryenRefIsNullId(): BinaryenExpressionId;
export declare function _BinaryenRefFuncId(): BinaryenExpressionId;
export declare function _BinaryenRefEqId(): BinaryenExpressionId;
export declare function _BinaryenTryId(): BinaryenExpressionId;
export declare function _BinaryenThrowId(): BinaryenExpressionId;
export declare function _BinaryenRethrowId(): BinaryenExpressionId;
Expand Down
181 changes: 96 additions & 85 deletions src/module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -86,8 +86,8 @@ export enum ExpressionId {
MemoryGrow = 21 /* _BinaryenMemoryGrowId */,
Nop = 22 /* _BinaryenNopId */,
Unreachable = 23 /* _BinaryenUnreachableId */,
AtomicCmpxchg = 25 /* _BinaryenAtomicCmpxchgId */,
AtomicRMW = 24 /* _BinaryenAtomicRMWId */,
AtomicCmpxchg = 25 /* _BinaryenAtomicCmpxchgId */,
AtomicWait = 26 /* _BinaryenAtomicWaitId */,
AtomicNotify = 27 /* _BinaryenAtomicNotifyId */,
AtomicFence = 28 /* _BinaryenAtomicFenceId */,
Expand All @@ -97,20 +97,22 @@ export enum ExpressionId {
SIMDTernary = 32 /* _BinaryenSIMDTernaryId */,
SIMDShift = 33 /* _BinaryenSIMDShiftId */,
SIMDLoad = 34 /* _BinaryenSIMDLoadId */,
MemoryInit = 35 /* _BinaryenMemoryInitId */,
DataDrop = 36 /* _BinaryenDataDropId */,
MemoryCopy = 37 /* _BinaryenMemoryCopyId */,
MemoryFill = 38 /* _BinaryenMemoryFillId */,
Pop = 39 /* _BinaryenPopId */,
RefNull = 40 /* _BinaryenRefNullId */,
RefIsNull = 41 /* _BinaryenRefIsNullId */,
RefFunc = 42 /* _BinaryenRefFuncId */,
Try = 44 /* _BinaryenTryId */,
Throw = 45 /* _BinaryenThrowId */,
Rethrow = 46 /* _BinaryenRethrowId */,
BrOnExn = 47 /* _BinaryenBrOnExnId */,
TupleMake = 48 /* _BinaryenTupleMakeId */,
TupleExtract = 49 /* _BinaryenTupleExtractId */
// SIMDLoadStoreLane = 35,
MemoryInit = 36 /* _BinaryenMemoryInitId */,
dcodeIO marked this conversation as resolved.
Show resolved Hide resolved
DataDrop = 37 /* _BinaryenDataDropId */,
MemoryCopy = 38 /* _BinaryenMemoryCopyId */,
MemoryFill = 39 /* _BinaryenMemoryFillId */,
Pop = 40 /* _BinaryenPopId */,
RefNull = 41 /* _BinaryenRefNullId */,
RefIsNull = 42 /* _BinaryenRefIsNullId */,
RefFunc = 43 /* _BinaryenRefFuncId */,
RefEq = 44 /* _BinaryenRefEqId */,
Try = 45 /* _BinaryenTryId */,
Throw = 46 /* _BinaryenThrowId */,
Rethrow = 47 /* _BinaryenRethrowId */,
BrOnExn = 48 /* _BinaryenBrOnExnId */,
TupleMake = 49 /* _BinaryenTupleMakeId */,
TupleExtract = 50 /* _BinaryenTupleExtractId */
}

export enum UnaryOp {
Expand Down Expand Up @@ -193,48 +195,49 @@ export enum UnaryOp {
AllTrueI8x16 = 70 /* _BinaryenAllTrueVecI8x16 */,
BitmaskI8x16 = 71 /* __BinaryenBitmaskVecI8x16 */,
AbsI16x8 = 72 /* __BinaryenAbsVecI16x8 */,
NegI16x8 = 73 /* _BinaryenNegVecI16x8 */,
AnyTrueI16x8 = 74 /* _BinaryenAnyTrueVecI16x8 */,
AllTrueI16x8 = 75 /* _BinaryenAllTrueVecI16x8 */,
BitmaskI16x8 = 76 /* _BinaryenBitmaskVecI16x8 */,
AbsI32x4 = 77 /* _BinaryenAbsVecI32x4 */,
NegI32x4 = 78 /* _BinaryenNegVecI32x4 */,
AnyTrueI32x4 = 79 /* _BinaryenAnyTrueVecI32x4 */,
AllTrueI32x4 = 80 /* _BinaryenAllTrueVecI32x4 */,
BitmaskI32x4 = 81 /* _BinaryenBitmaskVecI32x4 */,
NegI64x2 = 82 /* _BinaryenNegVecI64x2 */,
AnyTrueI64x2 = 83 /* _BinaryenAnyTrueVecI64x2 */,
AllTrueI64x2 = 84 /* _BinaryenAllTrueVecI64x2 */,
AbsF32x4 = 85 /* _BinaryenAbsVecF32x4 */,
NegF32x4 = 86 /* _BinaryenNegVecF32x4 */,
SqrtF32x4 = 87 /* _BinaryenSqrtVecF32x4 */,
CeilF32x4 = 88 /* _BinaryenCeilVecF32x4 */,
FloorF32x4 = 89 /* _BinaryenFloorVecF32x4 */,
// PopcntVecI8x16
NegI16x8 = 74 /* _BinaryenNegVecI16x8 */,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Another one missing here

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This one is strange. Order should be: https://github.com/WebAssembly/binaryen/blob/68294338a1cc7337e808671e75933b1134d18a90/src/wasm.h#L163-L166

BitmaskVecI8x16
PopcntVecI8x16 // new
AbsVecI16x8
NegVecI16x8

meaning something is off here since the missing one is before AbsVecI16x8, not between AbsVecI16x8 and NegVecI16x8 hmm.

AnyTrueI16x8 = 75 /* _BinaryenAnyTrueVecI16x8 */,
AllTrueI16x8 = 76 /* _BinaryenAllTrueVecI16x8 */,
BitmaskI16x8 = 77 /* _BinaryenBitmaskVecI16x8 */,
AbsI32x4 = 78 /* _BinaryenAbsVecI32x4 */,
NegI32x4 = 79 /* _BinaryenNegVecI32x4 */,
AnyTrueI32x4 = 80 /* _BinaryenAnyTrueVecI32x4 */,
AllTrueI32x4 = 81 /* _BinaryenAllTrueVecI32x4 */,
BitmaskI32x4 = 82 /* _BinaryenBitmaskVecI32x4 */,
NegI64x2 = 83 /* _BinaryenNegVecI64x2 */,
AnyTrueI64x2 = 84 /* _BinaryenAnyTrueVecI64x2 */,
AllTrueI64x2 = 85 /* _BinaryenAllTrueVecI64x2 */,
AbsF32x4 = 86 /* _BinaryenAbsVecF32x4 */,
NegF32x4 = 87 /* _BinaryenNegVecF32x4 */,
SqrtF32x4 = 88 /* _BinaryenSqrtVecF32x4 */,
CeilF32x4 = 89 /* _BinaryenCeilVecF32x4 */,
FloorF32x4 = 90 /* _BinaryenFloorVecF32x4 */,
TruncF32x4 = 90 /* BinaryenTruncVecF32x4 */,
NearestF32x4 = 91 /* BinaryenNearestVecF32x4 */,
AbsF64x2 = 92 /* _BinaryenAbsVecF64x2 */,
NegF64x2 = 93 /* _BinaryenNegVecF64x2 */,
SqrtF64x2 = 94 /* _BinaryenSqrtVecF64x2 */,
CeilF64x2 = 95 /* _BinaryenCeilVecF64x2 */,
FloorF64x2 = 96 /* _BinaryenFloorVecF64x2 */,
AbsF64x2 = 93 /* _BinaryenAbsVecF64x2 */,
NegF64x2 = 94 /* _BinaryenNegVecF64x2 */,
SqrtF64x2 = 95 /* _BinaryenSqrtVecF64x2 */,
CeilF64x2 = 96 /* _BinaryenCeilVecF64x2 */,
FloorF64x2 = 97 /* _BinaryenFloorVecF64x2 */,
TruncF64x2 = 97 /* BinaryenTruncVecF64x2 */,
NearestF64x2 = 98 /* BinaryenNearestVecF64x2 */,
TruncSatF32x4ToI32x4 = 99 /* _BinaryenTruncSatSVecF32x4ToVecI32x4 */,
TruncSatF32x4ToU32x4 = 100 /* _BinaryenTruncSatUVecF32x4ToVecI32x4 */,
TruncSatF64x2ToI64x2 = 101 /* _BinaryenTruncSatSVecF64x2ToVecI64x2 */,
TruncSatF64x2ToU64x2 = 102 /* _BinaryenTruncSatUVecF64x2ToVecI64x2 */,
ConvertI32x4ToF32x4 = 103 /* _BinaryenConvertSVecI32x4ToVecF32x4 */,
ConvertU32x4ToF32x4 = 104 /* _BinaryenConvertUVecI32x4ToVecF32x4 */,
ConvertI64x2ToF64x2 = 105 /* _BinaryenConvertSVecI64x2ToVecF64x2 */,
ConvertU64x2ToF64x2 = 106 /* _BinaryenConvertUVecI64x2ToVecF64x2 */,
WidenLowI8x16ToI16x8 = 107 /* _BinaryenWidenLowSVecI8x16ToVecI16x8 */,
WidenHighI8x16ToI16x8 = 108 /* _BinaryenWidenHighSVecI8x16ToVecI16x8 */,
WidenLowU8x16ToU16x8 = 109 /* _BinaryenWidenLowUVecI8x16ToVecI16x8 */,
WidenHighU8x16ToU16x8 = 110 /* _BinaryenWidenHighUVecI8x16ToVecI16x8 */,
WidenLowI16x8ToI32x4 = 111 /* _BinaryenWidenLowSVecI16x8ToVecI32x4 */,
WidenHighI16x8ToI32x4 = 112 /* _BinaryenWidenHighSVecI16x8ToVecI32x4 */,
WidenLowU16x8ToU32x4 = 113 /* _BinaryenWidenLowUVecI16x8ToVecI32x4 */,
WidenHighU16x8ToU32x4 = 114 /* _BinaryenWidenHighUVecI16x8ToVecI32x4 */
TruncSatF32x4ToI32x4 = 100 /* _BinaryenTruncSatSVecF32x4ToVecI32x4 */,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And here

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TruncSatF32x4ToU32x4 = 101 /* _BinaryenTruncSatUVecF32x4ToVecI32x4 */,
TruncSatF64x2ToI64x2 = 102 /* _BinaryenTruncSatSVecF64x2ToVecI64x2 */,
TruncSatF64x2ToU64x2 = 103 /* _BinaryenTruncSatUVecF64x2ToVecI64x2 */,
ConvertI32x4ToF32x4 = 104 /* _BinaryenConvertSVecI32x4ToVecF32x4 */,
ConvertU32x4ToF32x4 = 105 /* _BinaryenConvertUVecI32x4ToVecF32x4 */,
ConvertI64x2ToF64x2 = 106 /* _BinaryenConvertSVecI64x2ToVecF64x2 */,
ConvertU64x2ToF64x2 = 107 /* _BinaryenConvertUVecI64x2ToVecF64x2 */,
WidenLowI8x16ToI16x8 = 108 /* _BinaryenWidenLowSVecI8x16ToVecI16x8 */,
WidenHighI8x16ToI16x8 = 109 /* _BinaryenWidenHighSVecI8x16ToVecI16x8 */,
WidenLowU8x16ToU16x8 = 110 /* _BinaryenWidenLowUVecI8x16ToVecI16x8 */,
WidenHighU8x16ToU16x8 = 111 /* _BinaryenWidenHighUVecI8x16ToVecI16x8 */,
WidenLowI16x8ToI32x4 = 112 /* _BinaryenWidenLowSVecI16x8ToVecI32x4 */,
WidenHighI16x8ToI32x4 = 113 /* _BinaryenWidenHighSVecI16x8ToVecI32x4 */,
WidenLowU16x8ToU32x4 = 114 /* _BinaryenWidenLowUVecI16x8ToVecI32x4 */,
WidenHighU16x8ToU32x4 = 115 /* _BinaryenWidenHighUVecI16x8ToVecI32x4 */
}

export enum BinaryOp {
Expand Down Expand Up @@ -386,38 +389,46 @@ export enum BinaryOp {
MaxI16x8 = 143 /* _BinaryenMaxSVecI16x8 */,
MaxU16x8 = 144 /* _BinaryenMaxUVecI16x8 */,
AvgrU16x8 = 145 /* _BinaryenAvgrUVecI16x8 */,
AddI32x4 = 146 /* _BinaryenAddVecI32x4 */,
SubI32x4 = 147 /* _BinaryenSubVecI32x4 */,
MulI32x4 = 148 /* _BinaryenMulVecI32x4 */,
MinI32x4 = 149 /* _BinaryenMinSVecI32x4 */,
MinU32x4 = 150 /* _BinaryenMinUVecI32x4 */,
MaxI32x4 = 151 /* _BinaryenMaxSVecI32x4 */,
MaxU32x4 = 152 /* _BinaryenMaxUVecI32x4 */,
DotI16x8 = 153 /* _BinaryenDotSVecI16x8ToVecI32x4 */,
AddI64x2 = 154 /* _BinaryenAddVecI64x2 */,
SubI64x2 = 155 /* _BinaryenSubVecI64x2 */,

AddF32x4 = 157 /* _BinaryenAddVecF32x4 */,
SubF32x4 = 158 /* _BinaryenSubVecF32x4 */,
MulF32x4 = 159 /* _BinaryenMulVecF32x4 */,
DivF32x4 = 160 /* _BinaryenDivVecF32x4 */,
MinF32x4 = 161 /* _BinaryenMinVecF32x4 */,
MaxF32x4 = 162 /* _BinaryenMaxVecF32x4 */,
PminF32x4 = 163 /* _BinaryenPMinVecF32x4 */,
PmaxF32x4 = 164 /* _BinaryenPMaxVecF32x4 */,
AddF64x2 = 165 /* _BinaryenAddVecF64x2 */,
SubF64x2 = 166 /* _BinaryenSubVecF64x2 */,
MulF64x2 = 167 /* _BinaryenMulVecF64x2 */,
DivF64x2 = 168 /* _BinaryenDivVecF64x2 */,
MinF64x2 = 169 /* _BinaryenMinVecF64x2 */,
MaxF64x2 = 170 /* _BinaryenMaxVecF64x2 */,
PminF64x2 = 171 /* _BinaryenPMinVecF64x2 */,
PmaxF64x2 = 172 /* _BinaryenPMaxVecF64x2 */,
NarrowI16x8ToI8x16 = 173 /* _BinaryenNarrowSVecI16x8ToVecI8x16 */,
NarrowU16x8ToU8x16 = 174 /* _BinaryenNarrowUVecI16x8ToVecI8x16 */,
NarrowI32x4ToI16x8 = 175 /* _BinaryenNarrowSVecI32x4ToVecI16x8 */,
NarrowU32x4ToU16x8 = 176 /* _BinaryenNarrowUVecI32x4ToVecI16x8 */,
SwizzleV8x16 = 177 /* _BinaryenSwizzleVec8x16 */
// Q15MulrSatSVecI16x8,
// ExtMulLowSVecI16x8,
// ExtMulHighSVecI16x8,
// ExtMulLowUVecI16x8,
// ExtMulHighUVecI16x8,
AddI32x4 = 151 /* _BinaryenAddVecI32x4 */,
MaxGraey marked this conversation as resolved.
Show resolved Hide resolved
SubI32x4 = 152 /* _BinaryenSubVecI32x4 */,
MulI32x4 = 153 /* _BinaryenMulVecI32x4 */,
MinI32x4 = 154 /* _BinaryenMinSVecI32x4 */,
MinU32x4 = 155 /* _BinaryenMinUVecI32x4 */,
MaxI32x4 = 156 /* _BinaryenMaxSVecI32x4 */,
MaxU32x4 = 157 /* _BinaryenMaxUVecI32x4 */,
DotI16x8 = 158 /* _BinaryenDotSVecI16x8ToVecI32x4 */,
AddI64x2 = 163 /* _BinaryenAddVecI64x2 */,
SubI64x2 = 164 /* _BinaryenSubVecI64x2 */,
// ExtMulLowSVecI64x2
// ExtMulHighSVecI64x2
// ExtMulLowUVecI64x2
// ExtMulHighUVecI64x2
AddF32x4 = 170 /* _BinaryenAddVecF32x4 */,
MaxGraey marked this conversation as resolved.
Show resolved Hide resolved
SubF32x4 = 171 /* _BinaryenSubVecF32x4 */,
MulF32x4 = 172 /* _BinaryenMulVecF32x4 */,
DivF32x4 = 173 /* _BinaryenDivVecF32x4 */,
MinF32x4 = 174 /* _BinaryenMinVecF32x4 */,
MaxF32x4 = 175 /* _BinaryenMaxVecF32x4 */,
PminF32x4 = 176 /* _BinaryenPMinVecF32x4 */,
PmaxF32x4 = 177 /* _BinaryenPMaxVecF32x4 */,
AddF64x2 = 178 /* _BinaryenAddVecF64x2 */,
SubF64x2 = 179 /* _BinaryenSubVecF64x2 */,
MulF64x2 = 180 /* _BinaryenMulVecF64x2 */,
DivF64x2 = 181 /* _BinaryenDivVecF64x2 */,
MinF64x2 = 182 /* _BinaryenMinVecF64x2 */,
MaxF64x2 = 183 /* _BinaryenMaxVecF64x2 */,
PminF64x2 = 184 /* _BinaryenPMinVecF64x2 */,
PmaxF64x2 = 185 /* _BinaryenPMaxVecF64x2 */,
NarrowI16x8ToI8x16 = 186 /* _BinaryenNarrowSVecI16x8ToVecI8x16 */,
NarrowU16x8ToU8x16 = 187 /* _BinaryenNarrowUVecI16x8ToVecI8x16 */,
NarrowI32x4ToI16x8 = 188 /* _BinaryenNarrowSVecI32x4ToVecI16x8 */,
NarrowU32x4ToU16x8 = 189 /* _BinaryenNarrowUVecI32x4ToVecI16x8 */,
SwizzleV8x16 = 190 /* _BinaryenSwizzleVec8x16 */
}

export enum AtomicRMWOp {
Expand Down