github.com/bananabytelabs/wazero@v0.0.0-20240105073314-54b22a776da8/internal/wasm/instruction.go (about)

     1  package wasm
     2  
     3  // Opcode is the binary Opcode of an instruction. See also InstructionName
     4  type Opcode = byte
     5  
     6  const (
     7  	// OpcodeUnreachable causes an unconditional trap.
     8  	OpcodeUnreachable Opcode = 0x00
     9  	// OpcodeNop does nothing
    10  	OpcodeNop Opcode = 0x01
    11  	// OpcodeBlock brackets a sequence of instructions. A branch instruction on an if label breaks out to after its
    12  	// OpcodeEnd.
    13  	OpcodeBlock Opcode = 0x02
    14  	// OpcodeLoop brackets a sequence of instructions. A branch instruction on a loop label will jump back to the
    15  	// beginning of its block.
    16  	OpcodeLoop Opcode = 0x03
    17  	// OpcodeIf brackets a sequence of instructions. When the top of the stack evaluates to 1, the block is executed.
    18  	// Zero jumps to the optional OpcodeElse. A branch instruction on an if label breaks out to after its OpcodeEnd.
    19  	OpcodeIf Opcode = 0x04
    20  	// OpcodeElse brackets a sequence of instructions enclosed by an OpcodeIf. A branch instruction on a then label
    21  	// breaks out to after the OpcodeEnd on the enclosing OpcodeIf.
    22  	OpcodeElse Opcode = 0x05
    23  	// OpcodeEnd terminates a control instruction OpcodeBlock, OpcodeLoop or OpcodeIf.
    24  	OpcodeEnd Opcode = 0x0b
    25  
    26  	// OpcodeBr is a stack-polymorphic opcode that performs an unconditional branch. How the stack is modified depends
    27  	// on whether the "br" is enclosed by a loop, and if CoreFeatureMultiValue is enabled.
    28  	//
    29  	// Here are the rules in pseudocode about how the stack is modified based on the "br" operand L (label):
    30  	//	if L is loop: append(L.originalStackWithoutInputs, N-values popped from the stack) where N == L.inputs
    31  	//	else: append(L.originalStackWithoutInputs, N-values popped from the stack) where N == L.results
    32  	//
    33  	// In WebAssembly 1.0 (20191205), N can be zero or one. When CoreFeatureMultiValue is enabled, N can be more than one,
    34  	// depending on the type use of the label L.
    35  	//
    36  	// See https://www.w3.org/TR/2019/REC-wasm-core-1-20191205/#-hrefsyntax-instr-controlmathsfbrl
    37  	OpcodeBr Opcode = 0x0c
    38  
    39  	OpcodeBrIf         Opcode = 0x0d
    40  	OpcodeBrTable      Opcode = 0x0e
    41  	OpcodeReturn       Opcode = 0x0f
    42  	OpcodeCall         Opcode = 0x10
    43  	OpcodeCallIndirect Opcode = 0x11
    44  
    45  	// parametric instructions
    46  
    47  	OpcodeDrop        Opcode = 0x1a
    48  	OpcodeSelect      Opcode = 0x1b
    49  	OpcodeTypedSelect Opcode = 0x1c
    50  
    51  	// variable instructions
    52  
    53  	OpcodeLocalGet  Opcode = 0x20
    54  	OpcodeLocalSet  Opcode = 0x21
    55  	OpcodeLocalTee  Opcode = 0x22
    56  	OpcodeGlobalGet Opcode = 0x23
    57  	OpcodeGlobalSet Opcode = 0x24
    58  
    59  	// Below are toggled with CoreFeatureReferenceTypes
    60  
    61  	OpcodeTableGet Opcode = 0x25
    62  	OpcodeTableSet Opcode = 0x26
    63  
    64  	// memory instructions
    65  
    66  	OpcodeI32Load    Opcode = 0x28
    67  	OpcodeI64Load    Opcode = 0x29
    68  	OpcodeF32Load    Opcode = 0x2a
    69  	OpcodeF64Load    Opcode = 0x2b
    70  	OpcodeI32Load8S  Opcode = 0x2c
    71  	OpcodeI32Load8U  Opcode = 0x2d
    72  	OpcodeI32Load16S Opcode = 0x2e
    73  	OpcodeI32Load16U Opcode = 0x2f
    74  	OpcodeI64Load8S  Opcode = 0x30
    75  	OpcodeI64Load8U  Opcode = 0x31
    76  	OpcodeI64Load16S Opcode = 0x32
    77  	OpcodeI64Load16U Opcode = 0x33
    78  	OpcodeI64Load32S Opcode = 0x34
    79  	OpcodeI64Load32U Opcode = 0x35
    80  	OpcodeI32Store   Opcode = 0x36
    81  	OpcodeI64Store   Opcode = 0x37
    82  	OpcodeF32Store   Opcode = 0x38
    83  	OpcodeF64Store   Opcode = 0x39
    84  	OpcodeI32Store8  Opcode = 0x3a
    85  	OpcodeI32Store16 Opcode = 0x3b
    86  	OpcodeI64Store8  Opcode = 0x3c
    87  	OpcodeI64Store16 Opcode = 0x3d
    88  	OpcodeI64Store32 Opcode = 0x3e
    89  	OpcodeMemorySize Opcode = 0x3f
    90  	OpcodeMemoryGrow Opcode = 0x40
    91  
    92  	// const instructions
    93  
    94  	OpcodeI32Const Opcode = 0x41
    95  	OpcodeI64Const Opcode = 0x42
    96  	OpcodeF32Const Opcode = 0x43
    97  	OpcodeF64Const Opcode = 0x44
    98  
    99  	// numeric instructions
   100  
   101  	OpcodeI32Eqz Opcode = 0x45
   102  	OpcodeI32Eq  Opcode = 0x46
   103  	OpcodeI32Ne  Opcode = 0x47
   104  	OpcodeI32LtS Opcode = 0x48
   105  	OpcodeI32LtU Opcode = 0x49
   106  	OpcodeI32GtS Opcode = 0x4a
   107  	OpcodeI32GtU Opcode = 0x4b
   108  	OpcodeI32LeS Opcode = 0x4c
   109  	OpcodeI32LeU Opcode = 0x4d
   110  	OpcodeI32GeS Opcode = 0x4e
   111  	OpcodeI32GeU Opcode = 0x4f
   112  
   113  	OpcodeI64Eqz Opcode = 0x50
   114  	OpcodeI64Eq  Opcode = 0x51
   115  	OpcodeI64Ne  Opcode = 0x52
   116  	OpcodeI64LtS Opcode = 0x53
   117  	OpcodeI64LtU Opcode = 0x54
   118  	OpcodeI64GtS Opcode = 0x55
   119  	OpcodeI64GtU Opcode = 0x56
   120  	OpcodeI64LeS Opcode = 0x57
   121  	OpcodeI64LeU Opcode = 0x58
   122  	OpcodeI64GeS Opcode = 0x59
   123  	OpcodeI64GeU Opcode = 0x5a
   124  
   125  	OpcodeF32Eq Opcode = 0x5b
   126  	OpcodeF32Ne Opcode = 0x5c
   127  	OpcodeF32Lt Opcode = 0x5d
   128  	OpcodeF32Gt Opcode = 0x5e
   129  	OpcodeF32Le Opcode = 0x5f
   130  	OpcodeF32Ge Opcode = 0x60
   131  
   132  	OpcodeF64Eq Opcode = 0x61
   133  	OpcodeF64Ne Opcode = 0x62
   134  	OpcodeF64Lt Opcode = 0x63
   135  	OpcodeF64Gt Opcode = 0x64
   136  	OpcodeF64Le Opcode = 0x65
   137  	OpcodeF64Ge Opcode = 0x66
   138  
   139  	OpcodeI32Clz    Opcode = 0x67
   140  	OpcodeI32Ctz    Opcode = 0x68
   141  	OpcodeI32Popcnt Opcode = 0x69
   142  	OpcodeI32Add    Opcode = 0x6a
   143  	OpcodeI32Sub    Opcode = 0x6b
   144  	OpcodeI32Mul    Opcode = 0x6c
   145  	OpcodeI32DivS   Opcode = 0x6d
   146  	OpcodeI32DivU   Opcode = 0x6e
   147  	OpcodeI32RemS   Opcode = 0x6f
   148  	OpcodeI32RemU   Opcode = 0x70
   149  	OpcodeI32And    Opcode = 0x71
   150  	OpcodeI32Or     Opcode = 0x72
   151  	OpcodeI32Xor    Opcode = 0x73
   152  	OpcodeI32Shl    Opcode = 0x74
   153  	OpcodeI32ShrS   Opcode = 0x75
   154  	OpcodeI32ShrU   Opcode = 0x76
   155  	OpcodeI32Rotl   Opcode = 0x77
   156  	OpcodeI32Rotr   Opcode = 0x78
   157  
   158  	OpcodeI64Clz    Opcode = 0x79
   159  	OpcodeI64Ctz    Opcode = 0x7a
   160  	OpcodeI64Popcnt Opcode = 0x7b
   161  	OpcodeI64Add    Opcode = 0x7c
   162  	OpcodeI64Sub    Opcode = 0x7d
   163  	OpcodeI64Mul    Opcode = 0x7e
   164  	OpcodeI64DivS   Opcode = 0x7f
   165  	OpcodeI64DivU   Opcode = 0x80
   166  	OpcodeI64RemS   Opcode = 0x81
   167  	OpcodeI64RemU   Opcode = 0x82
   168  	OpcodeI64And    Opcode = 0x83
   169  	OpcodeI64Or     Opcode = 0x84
   170  	OpcodeI64Xor    Opcode = 0x85
   171  	OpcodeI64Shl    Opcode = 0x86
   172  	OpcodeI64ShrS   Opcode = 0x87
   173  	OpcodeI64ShrU   Opcode = 0x88
   174  	OpcodeI64Rotl   Opcode = 0x89
   175  	OpcodeI64Rotr   Opcode = 0x8a
   176  
   177  	OpcodeF32Abs      Opcode = 0x8b
   178  	OpcodeF32Neg      Opcode = 0x8c
   179  	OpcodeF32Ceil     Opcode = 0x8d
   180  	OpcodeF32Floor    Opcode = 0x8e
   181  	OpcodeF32Trunc    Opcode = 0x8f
   182  	OpcodeF32Nearest  Opcode = 0x90
   183  	OpcodeF32Sqrt     Opcode = 0x91
   184  	OpcodeF32Add      Opcode = 0x92
   185  	OpcodeF32Sub      Opcode = 0x93
   186  	OpcodeF32Mul      Opcode = 0x94
   187  	OpcodeF32Div      Opcode = 0x95
   188  	OpcodeF32Min      Opcode = 0x96
   189  	OpcodeF32Max      Opcode = 0x97
   190  	OpcodeF32Copysign Opcode = 0x98
   191  
   192  	OpcodeF64Abs      Opcode = 0x99
   193  	OpcodeF64Neg      Opcode = 0x9a
   194  	OpcodeF64Ceil     Opcode = 0x9b
   195  	OpcodeF64Floor    Opcode = 0x9c
   196  	OpcodeF64Trunc    Opcode = 0x9d
   197  	OpcodeF64Nearest  Opcode = 0x9e
   198  	OpcodeF64Sqrt     Opcode = 0x9f
   199  	OpcodeF64Add      Opcode = 0xa0
   200  	OpcodeF64Sub      Opcode = 0xa1
   201  	OpcodeF64Mul      Opcode = 0xa2
   202  	OpcodeF64Div      Opcode = 0xa3
   203  	OpcodeF64Min      Opcode = 0xa4
   204  	OpcodeF64Max      Opcode = 0xa5
   205  	OpcodeF64Copysign Opcode = 0xa6
   206  
   207  	OpcodeI32WrapI64   Opcode = 0xa7
   208  	OpcodeI32TruncF32S Opcode = 0xa8
   209  	OpcodeI32TruncF32U Opcode = 0xa9
   210  	OpcodeI32TruncF64S Opcode = 0xaa
   211  	OpcodeI32TruncF64U Opcode = 0xab
   212  
   213  	OpcodeI64ExtendI32S Opcode = 0xac
   214  	OpcodeI64ExtendI32U Opcode = 0xad
   215  	OpcodeI64TruncF32S  Opcode = 0xae
   216  	OpcodeI64TruncF32U  Opcode = 0xaf
   217  	OpcodeI64TruncF64S  Opcode = 0xb0
   218  	OpcodeI64TruncF64U  Opcode = 0xb1
   219  
   220  	OpcodeF32ConvertI32S Opcode = 0xb2
   221  	OpcodeF32ConvertI32U Opcode = 0xb3
   222  	OpcodeF32ConvertI64S Opcode = 0xb4
   223  	OpcodeF32ConvertI64U Opcode = 0xb5
   224  	OpcodeF32DemoteF64   Opcode = 0xb6
   225  
   226  	OpcodeF64ConvertI32S Opcode = 0xb7
   227  	OpcodeF64ConvertI32U Opcode = 0xb8
   228  	OpcodeF64ConvertI64S Opcode = 0xb9
   229  	OpcodeF64ConvertI64U Opcode = 0xba
   230  	OpcodeF64PromoteF32  Opcode = 0xbb
   231  
   232  	OpcodeI32ReinterpretF32 Opcode = 0xbc
   233  	OpcodeI64ReinterpretF64 Opcode = 0xbd
   234  	OpcodeF32ReinterpretI32 Opcode = 0xbe
   235  	OpcodeF64ReinterpretI64 Opcode = 0xbf
   236  
   237  	// OpcodeRefNull pushes a null reference value whose type is specified by immediate to this opcode.
   238  	// This is defined in the reference-types proposal, but necessary for CoreFeatureBulkMemoryOperations as well.
   239  	//
   240  	// Currently only supported in the constant expression in element segments.
   241  	OpcodeRefNull = 0xd0
   242  	// OpcodeRefIsNull pops a reference value, and pushes 1 if it is null, 0 otherwise.
   243  	// This is defined in the reference-types proposal, but necessary for CoreFeatureBulkMemoryOperations as well.
   244  	//
   245  	// Currently not supported.
   246  	OpcodeRefIsNull = 0xd1
   247  	// OpcodeRefFunc pushes a funcref value whose index equals the immediate to this opcode.
   248  	// This is defined in the reference-types proposal, but necessary for CoreFeatureBulkMemoryOperations as well.
   249  	//
   250  	// Currently, this is only supported in the constant expression in element segments.
   251  	OpcodeRefFunc = 0xd2
   252  
   253  	// Below are toggled with CoreFeatureSignExtensionOps
   254  
   255  	// OpcodeI32Extend8S extends a signed 8-bit integer to a 32-bit integer.
   256  	// Note: This is dependent on the flag CoreFeatureSignExtensionOps
   257  	OpcodeI32Extend8S Opcode = 0xc0
   258  
   259  	// OpcodeI32Extend16S extends a signed 16-bit integer to a 32-bit integer.
   260  	// Note: This is dependent on the flag CoreFeatureSignExtensionOps
   261  	OpcodeI32Extend16S Opcode = 0xc1
   262  
   263  	// OpcodeI64Extend8S extends a signed 8-bit integer to a 64-bit integer.
   264  	// Note: This is dependent on the flag CoreFeatureSignExtensionOps
   265  	OpcodeI64Extend8S Opcode = 0xc2
   266  
   267  	// OpcodeI64Extend16S extends a signed 16-bit integer to a 64-bit integer.
   268  	// Note: This is dependent on the flag CoreFeatureSignExtensionOps
   269  	OpcodeI64Extend16S Opcode = 0xc3
   270  
   271  	// OpcodeI64Extend32S extends a signed 32-bit integer to a 64-bit integer.
   272  	// Note: This is dependent on the flag CoreFeatureSignExtensionOps
   273  	OpcodeI64Extend32S Opcode = 0xc4
   274  
   275  	// OpcodeMiscPrefix is the prefix of various multi-byte opcodes.
   276  	// Introduced in CoreFeatureNonTrappingFloatToIntConversion, but used in other
   277  	// features, such as CoreFeatureBulkMemoryOperations.
   278  	OpcodeMiscPrefix Opcode = 0xfc
   279  
   280  	// OpcodeVecPrefix is the prefix of all vector isntructions introduced in
   281  	// CoreFeatureSIMD.
   282  	OpcodeVecPrefix Opcode = 0xfd
   283  
   284  	// OpcodeAtomicPrefix is the prefix of all atomic instructions introduced in
   285  	// CoreFeatureThreads.
   286  	OpcodeAtomicPrefix Opcode = 0xfe
   287  )
   288  
   289  // OpcodeMisc represents opcodes of the miscellaneous operations.
   290  // Such an operations has multi-byte encoding which is prefixed by OpcodeMiscPrefix.
   291  type OpcodeMisc = byte
   292  
   293  const (
   294  	// Below are toggled with CoreFeatureNonTrappingFloatToIntConversion.
   295  	// https://github.com/WebAssembly/spec/blob/ce4b6c4d47eb06098cc7ab2e81f24748da822f20/proposals/nontrapping-float-to-int-conversion/Overview.md
   296  
   297  	OpcodeMiscI32TruncSatF32S OpcodeMisc = 0x00
   298  	OpcodeMiscI32TruncSatF32U OpcodeMisc = 0x01
   299  	OpcodeMiscI32TruncSatF64S OpcodeMisc = 0x02
   300  	OpcodeMiscI32TruncSatF64U OpcodeMisc = 0x03
   301  	OpcodeMiscI64TruncSatF32S OpcodeMisc = 0x04
   302  	OpcodeMiscI64TruncSatF32U OpcodeMisc = 0x05
   303  	OpcodeMiscI64TruncSatF64S OpcodeMisc = 0x06
   304  	OpcodeMiscI64TruncSatF64U OpcodeMisc = 0x07
   305  
   306  	// Below are toggled with CoreFeatureBulkMemoryOperations.
   307  	// Opcodes are those new in document/core/appendix/index-instructions.rst (the commit that merged the feature).
   308  	// See https://github.com/WebAssembly/spec/commit/7fa2f20a6df4cf1c114582c8cb60f5bfcdbf1be1
   309  	// See https://www.w3.org/TR/2022/WD-wasm-core-2-20220419/appendix/changes.html#bulk-memory-and-table-instructions
   310  
   311  	OpcodeMiscMemoryInit OpcodeMisc = 0x08
   312  	OpcodeMiscDataDrop   OpcodeMisc = 0x09
   313  	OpcodeMiscMemoryCopy OpcodeMisc = 0x0a
   314  	OpcodeMiscMemoryFill OpcodeMisc = 0x0b
   315  	OpcodeMiscTableInit  OpcodeMisc = 0x0c
   316  	OpcodeMiscElemDrop   OpcodeMisc = 0x0d
   317  	OpcodeMiscTableCopy  OpcodeMisc = 0x0e
   318  
   319  	// Below are toggled with CoreFeatureReferenceTypes
   320  
   321  	OpcodeMiscTableGrow OpcodeMisc = 0x0f
   322  	OpcodeMiscTableSize OpcodeMisc = 0x10
   323  	OpcodeMiscTableFill OpcodeMisc = 0x11
   324  )
   325  
   326  // OpcodeVec represents an opcode of a vector instructions which has
   327  // multi-byte encoding and is prefixed by OpcodeMiscPrefix.
   328  //
   329  // These opcodes are toggled with CoreFeatureSIMD.
   330  type OpcodeVec = byte
   331  
   332  const (
   333  	// Loads and stores.
   334  
   335  	OpcodeVecV128Load        OpcodeVec = 0x00
   336  	OpcodeVecV128Load8x8s    OpcodeVec = 0x01
   337  	OpcodeVecV128Load8x8u    OpcodeVec = 0x02
   338  	OpcodeVecV128Load16x4s   OpcodeVec = 0x03
   339  	OpcodeVecV128Load16x4u   OpcodeVec = 0x04
   340  	OpcodeVecV128Load32x2s   OpcodeVec = 0x05
   341  	OpcodeVecV128Load32x2u   OpcodeVec = 0x06
   342  	OpcodeVecV128Load8Splat  OpcodeVec = 0x07
   343  	OpcodeVecV128Load16Splat OpcodeVec = 0x08
   344  	OpcodeVecV128Load32Splat OpcodeVec = 0x09
   345  	OpcodeVecV128Load64Splat OpcodeVec = 0x0a
   346  
   347  	OpcodeVecV128Load32zero OpcodeVec = 0x5c
   348  	OpcodeVecV128Load64zero OpcodeVec = 0x5d
   349  
   350  	OpcodeVecV128Store       OpcodeVec = 0x0b
   351  	OpcodeVecV128Load8Lane   OpcodeVec = 0x54
   352  	OpcodeVecV128Load16Lane  OpcodeVec = 0x55
   353  	OpcodeVecV128Load32Lane  OpcodeVec = 0x56
   354  	OpcodeVecV128Load64Lane  OpcodeVec = 0x57
   355  	OpcodeVecV128Store8Lane  OpcodeVec = 0x58
   356  	OpcodeVecV128Store16Lane OpcodeVec = 0x59
   357  	OpcodeVecV128Store32Lane OpcodeVec = 0x5a
   358  	OpcodeVecV128Store64Lane OpcodeVec = 0x5b
   359  
   360  	// OpcodeVecV128Const is the vector const instruction.
   361  	OpcodeVecV128Const OpcodeVec = 0x0c
   362  
   363  	// OpcodeVecV128i8x16Shuffle is the vector shuffle instruction.
   364  	OpcodeVecV128i8x16Shuffle OpcodeVec = 0x0d
   365  
   366  	// Extrac and replaces.
   367  
   368  	OpcodeVecI8x16ExtractLaneS OpcodeVec = 0x15
   369  	OpcodeVecI8x16ExtractLaneU OpcodeVec = 0x16
   370  	OpcodeVecI8x16ReplaceLane  OpcodeVec = 0x17
   371  	OpcodeVecI16x8ExtractLaneS OpcodeVec = 0x18
   372  	OpcodeVecI16x8ExtractLaneU OpcodeVec = 0x19
   373  	OpcodeVecI16x8ReplaceLane  OpcodeVec = 0x1a
   374  	OpcodeVecI32x4ExtractLane  OpcodeVec = 0x1b
   375  	OpcodeVecI32x4ReplaceLane  OpcodeVec = 0x1c
   376  	OpcodeVecI64x2ExtractLane  OpcodeVec = 0x1d
   377  	OpcodeVecI64x2ReplaceLane  OpcodeVec = 0x1e
   378  	OpcodeVecF32x4ExtractLane  OpcodeVec = 0x1f
   379  	OpcodeVecF32x4ReplaceLane  OpcodeVec = 0x20
   380  	OpcodeVecF64x2ExtractLane  OpcodeVec = 0x21
   381  	OpcodeVecF64x2ReplaceLane  OpcodeVec = 0x22
   382  
   383  	// Splat and swizzle.
   384  
   385  	OpcodeVecI8x16Swizzle OpcodeVec = 0x0e
   386  	OpcodeVecI8x16Splat   OpcodeVec = 0x0f
   387  	OpcodeVecI16x8Splat   OpcodeVec = 0x10
   388  	OpcodeVecI32x4Splat   OpcodeVec = 0x11
   389  	OpcodeVecI64x2Splat   OpcodeVec = 0x12
   390  	OpcodeVecF32x4Splat   OpcodeVec = 0x13
   391  	OpcodeVecF64x2Splat   OpcodeVec = 0x14
   392  
   393  	// i8 comparisons.
   394  
   395  	OpcodeVecI8x16Eq  OpcodeVec = 0x23
   396  	OpcodeVecI8x16Ne  OpcodeVec = 0x24
   397  	OpcodeVecI8x16LtS OpcodeVec = 0x25
   398  	OpcodeVecI8x16LtU OpcodeVec = 0x26
   399  	OpcodeVecI8x16GtS OpcodeVec = 0x27
   400  	OpcodeVecI8x16GtU OpcodeVec = 0x28
   401  	OpcodeVecI8x16LeS OpcodeVec = 0x29
   402  	OpcodeVecI8x16LeU OpcodeVec = 0x2a
   403  	OpcodeVecI8x16GeS OpcodeVec = 0x2b
   404  	OpcodeVecI8x16GeU OpcodeVec = 0x2c
   405  
   406  	// i16 comparisons.
   407  
   408  	OpcodeVecI16x8Eq  OpcodeVec = 0x2d
   409  	OpcodeVecI16x8Ne  OpcodeVec = 0x2e
   410  	OpcodeVecI16x8LtS OpcodeVec = 0x2f
   411  	OpcodeVecI16x8LtU OpcodeVec = 0x30
   412  	OpcodeVecI16x8GtS OpcodeVec = 0x31
   413  	OpcodeVecI16x8GtU OpcodeVec = 0x32
   414  	OpcodeVecI16x8LeS OpcodeVec = 0x33
   415  	OpcodeVecI16x8LeU OpcodeVec = 0x34
   416  	OpcodeVecI16x8GeS OpcodeVec = 0x35
   417  	OpcodeVecI16x8GeU OpcodeVec = 0x36
   418  
   419  	// i32 comparisons.
   420  
   421  	OpcodeVecI32x4Eq  OpcodeVec = 0x37
   422  	OpcodeVecI32x4Ne  OpcodeVec = 0x38
   423  	OpcodeVecI32x4LtS OpcodeVec = 0x39
   424  	OpcodeVecI32x4LtU OpcodeVec = 0x3a
   425  	OpcodeVecI32x4GtS OpcodeVec = 0x3b
   426  	OpcodeVecI32x4GtU OpcodeVec = 0x3c
   427  	OpcodeVecI32x4LeS OpcodeVec = 0x3d
   428  	OpcodeVecI32x4LeU OpcodeVec = 0x3e
   429  	OpcodeVecI32x4GeS OpcodeVec = 0x3f
   430  	OpcodeVecI32x4GeU OpcodeVec = 0x40
   431  
   432  	// i64 comparisons.
   433  
   434  	OpcodeVecI64x2Eq  OpcodeVec = 0xd6
   435  	OpcodeVecI64x2Ne  OpcodeVec = 0xd7
   436  	OpcodeVecI64x2LtS OpcodeVec = 0xd8
   437  	OpcodeVecI64x2GtS OpcodeVec = 0xd9
   438  	OpcodeVecI64x2LeS OpcodeVec = 0xda
   439  	OpcodeVecI64x2GeS OpcodeVec = 0xdb
   440  
   441  	// f32 comparisons.
   442  
   443  	OpcodeVecF32x4Eq OpcodeVec = 0x41
   444  	OpcodeVecF32x4Ne OpcodeVec = 0x42
   445  	OpcodeVecF32x4Lt OpcodeVec = 0x43
   446  	OpcodeVecF32x4Gt OpcodeVec = 0x44
   447  	OpcodeVecF32x4Le OpcodeVec = 0x45
   448  	OpcodeVecF32x4Ge OpcodeVec = 0x46
   449  
   450  	// f64 comparisons.
   451  
   452  	OpcodeVecF64x2Eq OpcodeVec = 0x47
   453  	OpcodeVecF64x2Ne OpcodeVec = 0x48
   454  	OpcodeVecF64x2Lt OpcodeVec = 0x49
   455  	OpcodeVecF64x2Gt OpcodeVec = 0x4a
   456  	OpcodeVecF64x2Le OpcodeVec = 0x4b
   457  	OpcodeVecF64x2Ge OpcodeVec = 0x4c
   458  
   459  	// v128 logical instructions.
   460  
   461  	OpcodeVecV128Not       OpcodeVec = 0x4d
   462  	OpcodeVecV128And       OpcodeVec = 0x4e
   463  	OpcodeVecV128AndNot    OpcodeVec = 0x4f
   464  	OpcodeVecV128Or        OpcodeVec = 0x50
   465  	OpcodeVecV128Xor       OpcodeVec = 0x51
   466  	OpcodeVecV128Bitselect OpcodeVec = 0x52
   467  	OpcodeVecV128AnyTrue   OpcodeVec = 0x53
   468  
   469  	// i8 misc.
   470  
   471  	OpcodeVecI8x16Abs          OpcodeVec = 0x60
   472  	OpcodeVecI8x16Neg          OpcodeVec = 0x61
   473  	OpcodeVecI8x16Popcnt       OpcodeVec = 0x62
   474  	OpcodeVecI8x16AllTrue      OpcodeVec = 0x63
   475  	OpcodeVecI8x16BitMask      OpcodeVec = 0x64
   476  	OpcodeVecI8x16NarrowI16x8S OpcodeVec = 0x65
   477  	OpcodeVecI8x16NarrowI16x8U OpcodeVec = 0x66
   478  
   479  	OpcodeVecI8x16Shl     OpcodeVec = 0x6b
   480  	OpcodeVecI8x16ShrS    OpcodeVec = 0x6c
   481  	OpcodeVecI8x16ShrU    OpcodeVec = 0x6d
   482  	OpcodeVecI8x16Add     OpcodeVec = 0x6e
   483  	OpcodeVecI8x16AddSatS OpcodeVec = 0x6f
   484  
   485  	OpcodeVecI8x16AddSatU OpcodeVec = 0x70
   486  	OpcodeVecI8x16Sub     OpcodeVec = 0x71
   487  	OpcodeVecI8x16SubSatS OpcodeVec = 0x72
   488  	OpcodeVecI8x16SubSatU OpcodeVec = 0x73
   489  	OpcodeVecI8x16MinS    OpcodeVec = 0x76
   490  	OpcodeVecI8x16MinU    OpcodeVec = 0x77
   491  	OpcodeVecI8x16MaxS    OpcodeVec = 0x78
   492  	OpcodeVecI8x16MaxU    OpcodeVec = 0x79
   493  	OpcodeVecI8x16AvgrU   OpcodeVec = 0x7b
   494  
   495  	// i16 misc.
   496  
   497  	OpcodeVecI16x8ExtaddPairwiseI8x16S OpcodeVec = 0x7c
   498  	OpcodeVecI16x8ExtaddPairwiseI8x16U OpcodeVec = 0x7d
   499  	OpcodeVecI16x8Abs                  OpcodeVec = 0x80
   500  	OpcodeVecI16x8Neg                  OpcodeVec = 0x81
   501  	OpcodeVecI16x8Q15mulrSatS          OpcodeVec = 0x82
   502  	OpcodeVecI16x8AllTrue              OpcodeVec = 0x83
   503  	OpcodeVecI16x8BitMask              OpcodeVec = 0x84
   504  	OpcodeVecI16x8NarrowI32x4S         OpcodeVec = 0x85
   505  	OpcodeVecI16x8NarrowI32x4U         OpcodeVec = 0x86
   506  	OpcodeVecI16x8ExtendLowI8x16S      OpcodeVec = 0x87
   507  	OpcodeVecI16x8ExtendHighI8x16S     OpcodeVec = 0x88
   508  	OpcodeVecI16x8ExtendLowI8x16U      OpcodeVec = 0x89
   509  	OpcodeVecI16x8ExtendHighI8x16U     OpcodeVec = 0x8a
   510  	OpcodeVecI16x8Shl                  OpcodeVec = 0x8b
   511  	OpcodeVecI16x8ShrS                 OpcodeVec = 0x8c
   512  	OpcodeVecI16x8ShrU                 OpcodeVec = 0x8d
   513  	OpcodeVecI16x8Add                  OpcodeVec = 0x8e
   514  	OpcodeVecI16x8AddSatS              OpcodeVec = 0x8f
   515  	OpcodeVecI16x8AddSatU              OpcodeVec = 0x90
   516  	OpcodeVecI16x8Sub                  OpcodeVec = 0x91
   517  	OpcodeVecI16x8SubSatS              OpcodeVec = 0x92
   518  	OpcodeVecI16x8SubSatU              OpcodeVec = 0x93
   519  	OpcodeVecI16x8Mul                  OpcodeVec = 0x95
   520  	OpcodeVecI16x8MinS                 OpcodeVec = 0x96
   521  	OpcodeVecI16x8MinU                 OpcodeVec = 0x97
   522  	OpcodeVecI16x8MaxS                 OpcodeVec = 0x98
   523  	OpcodeVecI16x8MaxU                 OpcodeVec = 0x99
   524  	OpcodeVecI16x8AvgrU                OpcodeVec = 0x9b
   525  	OpcodeVecI16x8ExtMulLowI8x16S      OpcodeVec = 0x9c
   526  	OpcodeVecI16x8ExtMulHighI8x16S     OpcodeVec = 0x9d
   527  	OpcodeVecI16x8ExtMulLowI8x16U      OpcodeVec = 0x9e
   528  	OpcodeVecI16x8ExtMulHighI8x16U     OpcodeVec = 0x9f
   529  
   530  	// i32 misc.
   531  
   532  	OpcodeVecI32x4ExtaddPairwiseI16x8S OpcodeVec = 0x7e
   533  	OpcodeVecI32x4ExtaddPairwiseI16x8U OpcodeVec = 0x7f
   534  	OpcodeVecI32x4Abs                  OpcodeVec = 0xa0
   535  	OpcodeVecI32x4Neg                  OpcodeVec = 0xa1
   536  	OpcodeVecI32x4AllTrue              OpcodeVec = 0xa3
   537  	OpcodeVecI32x4BitMask              OpcodeVec = 0xa4
   538  	OpcodeVecI32x4ExtendLowI16x8S      OpcodeVec = 0xa7
   539  	OpcodeVecI32x4ExtendHighI16x8S     OpcodeVec = 0xa8
   540  	OpcodeVecI32x4ExtendLowI16x8U      OpcodeVec = 0xa9
   541  	OpcodeVecI32x4ExtendHighI16x8U     OpcodeVec = 0xaa
   542  	OpcodeVecI32x4Shl                  OpcodeVec = 0xab
   543  	OpcodeVecI32x4ShrS                 OpcodeVec = 0xac
   544  	OpcodeVecI32x4ShrU                 OpcodeVec = 0xad
   545  	OpcodeVecI32x4Add                  OpcodeVec = 0xae
   546  	OpcodeVecI32x4Sub                  OpcodeVec = 0xb1
   547  	OpcodeVecI32x4Mul                  OpcodeVec = 0xb5
   548  	OpcodeVecI32x4MinS                 OpcodeVec = 0xb6
   549  	OpcodeVecI32x4MinU                 OpcodeVec = 0xb7
   550  	OpcodeVecI32x4MaxS                 OpcodeVec = 0xb8
   551  	OpcodeVecI32x4MaxU                 OpcodeVec = 0xb9
   552  	OpcodeVecI32x4DotI16x8S            OpcodeVec = 0xba
   553  	OpcodeVecI32x4ExtMulLowI16x8S      OpcodeVec = 0xbc
   554  	OpcodeVecI32x4ExtMulHighI16x8S     OpcodeVec = 0xbd
   555  	OpcodeVecI32x4ExtMulLowI16x8U      OpcodeVec = 0xbe
   556  	OpcodeVecI32x4ExtMulHighI16x8U     OpcodeVec = 0xbf
   557  
   558  	// i64 misc.
   559  
   560  	OpcodeVecI64x2Abs              OpcodeVec = 0xc0
   561  	OpcodeVecI64x2Neg              OpcodeVec = 0xc1
   562  	OpcodeVecI64x2AllTrue          OpcodeVec = 0xc3
   563  	OpcodeVecI64x2BitMask          OpcodeVec = 0xc4
   564  	OpcodeVecI64x2ExtendLowI32x4S  OpcodeVec = 0xc7
   565  	OpcodeVecI64x2ExtendHighI32x4S OpcodeVec = 0xc8
   566  	OpcodeVecI64x2ExtendLowI32x4U  OpcodeVec = 0xc9
   567  	OpcodeVecI64x2ExtendHighI32x4U OpcodeVec = 0xca
   568  	OpcodeVecI64x2Shl              OpcodeVec = 0xcb
   569  	OpcodeVecI64x2ShrS             OpcodeVec = 0xcc
   570  	OpcodeVecI64x2ShrU             OpcodeVec = 0xcd
   571  	OpcodeVecI64x2Add              OpcodeVec = 0xce
   572  	OpcodeVecI64x2Sub              OpcodeVec = 0xd1
   573  	OpcodeVecI64x2Mul              OpcodeVec = 0xd5
   574  	OpcodeVecI64x2ExtMulLowI32x4S  OpcodeVec = 0xdc
   575  	OpcodeVecI64x2ExtMulHighI32x4S OpcodeVec = 0xdd
   576  	OpcodeVecI64x2ExtMulLowI32x4U  OpcodeVec = 0xde
   577  	OpcodeVecI64x2ExtMulHighI32x4U OpcodeVec = 0xdf
   578  
   579  	// f32 misc.
   580  
   581  	OpcodeVecF32x4Ceil    OpcodeVec = 0x67
   582  	OpcodeVecF32x4Floor   OpcodeVec = 0x68
   583  	OpcodeVecF32x4Trunc   OpcodeVec = 0x69
   584  	OpcodeVecF32x4Nearest OpcodeVec = 0x6a
   585  	OpcodeVecF32x4Abs     OpcodeVec = 0xe0
   586  	OpcodeVecF32x4Neg     OpcodeVec = 0xe1
   587  	OpcodeVecF32x4Sqrt    OpcodeVec = 0xe3
   588  	OpcodeVecF32x4Add     OpcodeVec = 0xe4
   589  	OpcodeVecF32x4Sub     OpcodeVec = 0xe5
   590  	OpcodeVecF32x4Mul     OpcodeVec = 0xe6
   591  	OpcodeVecF32x4Div     OpcodeVec = 0xe7
   592  	OpcodeVecF32x4Min     OpcodeVec = 0xe8
   593  	OpcodeVecF32x4Max     OpcodeVec = 0xe9
   594  	OpcodeVecF32x4Pmin    OpcodeVec = 0xea
   595  	OpcodeVecF32x4Pmax    OpcodeVec = 0xeb
   596  
   597  	// f64 misc.
   598  
   599  	OpcodeVecF64x2Ceil    OpcodeVec = 0x74
   600  	OpcodeVecF64x2Floor   OpcodeVec = 0x75
   601  	OpcodeVecF64x2Trunc   OpcodeVec = 0x7a
   602  	OpcodeVecF64x2Nearest OpcodeVec = 0x94
   603  	OpcodeVecF64x2Abs     OpcodeVec = 0xec
   604  	OpcodeVecF64x2Neg     OpcodeVec = 0xed
   605  	OpcodeVecF64x2Sqrt    OpcodeVec = 0xef
   606  	OpcodeVecF64x2Add     OpcodeVec = 0xf0
   607  	OpcodeVecF64x2Sub     OpcodeVec = 0xf1
   608  	OpcodeVecF64x2Mul     OpcodeVec = 0xf2
   609  	OpcodeVecF64x2Div     OpcodeVec = 0xf3
   610  	OpcodeVecF64x2Min     OpcodeVec = 0xf4
   611  	OpcodeVecF64x2Max     OpcodeVec = 0xf5
   612  	OpcodeVecF64x2Pmin    OpcodeVec = 0xf6
   613  	OpcodeVecF64x2Pmax    OpcodeVec = 0xf7
   614  
   615  	// conversions.
   616  
   617  	OpcodeVecI32x4TruncSatF32x4S      OpcodeVec = 0xf8
   618  	OpcodeVecI32x4TruncSatF32x4U      OpcodeVec = 0xf9
   619  	OpcodeVecF32x4ConvertI32x4S       OpcodeVec = 0xfa
   620  	OpcodeVecF32x4ConvertI32x4U       OpcodeVec = 0xfb
   621  	OpcodeVecI32x4TruncSatF64x2SZero  OpcodeVec = 0xfc
   622  	OpcodeVecI32x4TruncSatF64x2UZero  OpcodeVec = 0xfd
   623  	OpcodeVecF64x2ConvertLowI32x4S    OpcodeVec = 0xfe
   624  	OpcodeVecF64x2ConvertLowI32x4U    OpcodeVec = 0xff
   625  	OpcodeVecF32x4DemoteF64x2Zero     OpcodeVec = 0x5e
   626  	OpcodeVecF64x2PromoteLowF32x4Zero OpcodeVec = 0x5f
   627  )
   628  
   629  // OpcodeAtomic represents an opcode of atomic instructions which has
   630  // multi-byte encoding and is prefixed by OpcodeAtomicPrefix.
   631  //
   632  // These opcodes are toggled with CoreFeaturesThreads.
   633  type OpcodeAtomic = byte
   634  
   635  const (
   636  	// OpcodeAtomicMemoryNotify represents the instruction memory.atomic.notify.
   637  	OpcodeAtomicMemoryNotify OpcodeAtomic = 0x00
   638  	// OpcodeAtomicMemoryWait32 represents the instruction memory.atomic.wait32.
   639  	OpcodeAtomicMemoryWait32 OpcodeAtomic = 0x01
   640  	// OpcodeAtomicMemoryWait64 represents the instruction memory.atomic.wait64.
   641  	OpcodeAtomicMemoryWait64 OpcodeAtomic = 0x02
   642  	// OpcodeAtomicFence represents the instruction atomic.fence.
   643  	OpcodeAtomicFence OpcodeAtomic = 0x03
   644  
   645  	// OpcodeAtomicI32Load represents the instruction i32.atomic.load.
   646  	OpcodeAtomicI32Load OpcodeAtomic = 0x10
   647  	// OpcodeAtomicI64Load represents the instruction i64.atomic.load.
   648  	OpcodeAtomicI64Load OpcodeAtomic = 0x11
   649  	// OpcodeAtomicI32Load8U represents the instruction i32.atomic.load8_u.
   650  	OpcodeAtomicI32Load8U OpcodeAtomic = 0x12
   651  	// OpcodeAtomicI32Load16U represents the instruction i32.atomic.load16_u.
   652  	OpcodeAtomicI32Load16U OpcodeAtomic = 0x13
   653  	// OpcodeAtomicI64Load8U represents the instruction i64.atomic.load8_u.
   654  	OpcodeAtomicI64Load8U OpcodeAtomic = 0x14
   655  	// OpcodeAtomicI64Load16U represents the instruction i64.atomic.load16_u.
   656  	OpcodeAtomicI64Load16U OpcodeAtomic = 0x15
   657  	// OpcodeAtomicI64Load32U represents the instruction i64.atomic.load32_u.
   658  	OpcodeAtomicI64Load32U OpcodeAtomic = 0x16
   659  	// OpcodeAtomicI32Store represents the instruction i32.atomic.store.
   660  	OpcodeAtomicI32Store OpcodeAtomic = 0x17
   661  	// OpcodeAtomicI64Store represents the instruction i64.atomic.store.
   662  	OpcodeAtomicI64Store OpcodeAtomic = 0x18
   663  	// OpcodeAtomicI32Store8 represents the instruction i32.atomic.store8.
   664  	OpcodeAtomicI32Store8 OpcodeAtomic = 0x19
   665  	// OpcodeAtomicI32Store16 represents the instruction i32.atomic.store16.
   666  	OpcodeAtomicI32Store16 OpcodeAtomic = 0x1a
   667  	// OpcodeAtomicI64Store8 represents the instruction i64.atomic.store8.
   668  	OpcodeAtomicI64Store8 OpcodeAtomic = 0x1b
   669  	// OpcodeAtomicI64Store16 represents the instruction i64.atomic.store16.
   670  	OpcodeAtomicI64Store16 OpcodeAtomic = 0x1c
   671  	// OpcodeAtomicI64Store32 represents the instruction i64.atomic.store32.
   672  	OpcodeAtomicI64Store32 OpcodeAtomic = 0x1d
   673  
   674  	// OpcodeAtomicI32RmwAdd represents the instruction i32.atomic.rmw.add.
   675  	OpcodeAtomicI32RmwAdd OpcodeAtomic = 0x1e
   676  	// OpcodeAtomicI64RmwAdd represents the instruction i64.atomic.rmw.add.
   677  	OpcodeAtomicI64RmwAdd OpcodeAtomic = 0x1f
   678  	// OpcodeAtomicI32Rmw8AddU represents the instruction i32.atomic.rmw8.add_u.
   679  	OpcodeAtomicI32Rmw8AddU OpcodeAtomic = 0x20
   680  	// OpcodeAtomicI32Rmw16AddU represents the instruction i32.atomic.rmw16.add_u.
   681  	OpcodeAtomicI32Rmw16AddU OpcodeAtomic = 0x21
   682  	// OpcodeAtomicI64Rmw8AddU represents the instruction i64.atomic.rmw8.add_u.
   683  	OpcodeAtomicI64Rmw8AddU OpcodeAtomic = 0x22
   684  	// OpcodeAtomicI64Rmw16AddU represents the instruction i64.atomic.rmw16.add_u.
   685  	OpcodeAtomicI64Rmw16AddU OpcodeAtomic = 0x23
   686  	// OpcodeAtomicI64Rmw32AddU represents the instruction i64.atomic.rmw32.add_u.
   687  	OpcodeAtomicI64Rmw32AddU OpcodeAtomic = 0x24
   688  
   689  	// OpcodeAtomicI32RmwSub represents the instruction i32.atomic.rmw.sub.
   690  	OpcodeAtomicI32RmwSub OpcodeAtomic = 0x25
   691  	// OpcodeAtomicI64RmwSub represents the instruction i64.atomic.rmw.sub.
   692  	OpcodeAtomicI64RmwSub OpcodeAtomic = 0x26
   693  	// OpcodeAtomicI32Rmw8SubU represents the instruction i32.atomic.rmw8.sub_u.
   694  	OpcodeAtomicI32Rmw8SubU OpcodeAtomic = 0x27
   695  	// OpcodeAtomicI32Rmw16SubU represents the instruction i32.atomic.rmw16.sub_u.
   696  	OpcodeAtomicI32Rmw16SubU OpcodeAtomic = 0x28
   697  	// OpcodeAtomicI64Rmw8SubU represents the instruction i64.atomic.rmw8.sub_u.
   698  	OpcodeAtomicI64Rmw8SubU OpcodeAtomic = 0x29
   699  	// OpcodeAtomicI64Rmw16SubU represents the instruction i64.atomic.rmw16.sub_u.
   700  	OpcodeAtomicI64Rmw16SubU OpcodeAtomic = 0x2a
   701  	// OpcodeAtomicI64Rmw32SubU represents the instruction i64.atomic.rmw32.sub_u.
   702  	OpcodeAtomicI64Rmw32SubU OpcodeAtomic = 0x2b
   703  
   704  	// OpcodeAtomicI32RmwAnd represents the instruction i32.atomic.rmw.and.
   705  	OpcodeAtomicI32RmwAnd OpcodeAtomic = 0x2c
   706  	// OpcodeAtomicI64RmwAnd represents the instruction i64.atomic.rmw.and.
   707  	OpcodeAtomicI64RmwAnd OpcodeAtomic = 0x2d
   708  	// OpcodeAtomicI32Rmw8AndU represents the instruction i32.atomic.rmw8.and_u.
   709  	OpcodeAtomicI32Rmw8AndU OpcodeAtomic = 0x2e
   710  	// OpcodeAtomicI32Rmw16AndU represents the instruction i32.atomic.rmw16.and_u.
   711  	OpcodeAtomicI32Rmw16AndU OpcodeAtomic = 0x2f
   712  	// OpcodeAtomicI64Rmw8AndU represents the instruction i64.atomic.rmw8.and_u.
   713  	OpcodeAtomicI64Rmw8AndU OpcodeAtomic = 0x30
   714  	// OpcodeAtomicI64Rmw16AndU represents the instruction i64.atomic.rmw16.and_u.
   715  	OpcodeAtomicI64Rmw16AndU OpcodeAtomic = 0x31
   716  	// OpcodeAtomicI64Rmw32AndU represents the instruction i64.atomic.rmw32.and_u.
   717  	OpcodeAtomicI64Rmw32AndU OpcodeAtomic = 0x32
   718  
   719  	// OpcodeAtomicI32RmwOr represents the instruction i32.atomic.rmw.or.
   720  	OpcodeAtomicI32RmwOr OpcodeAtomic = 0x33
   721  	// OpcodeAtomicI64RmwOr represents the instruction i64.atomic.rmw.or.
   722  	OpcodeAtomicI64RmwOr OpcodeAtomic = 0x34
   723  	// OpcodeAtomicI32Rmw8OrU represents the instruction i32.atomic.rmw8.or_u.
   724  	OpcodeAtomicI32Rmw8OrU OpcodeAtomic = 0x35
   725  	// OpcodeAtomicI32Rmw16OrU represents the instruction i32.atomic.rmw16.or_u.
   726  	OpcodeAtomicI32Rmw16OrU OpcodeAtomic = 0x36
   727  	// OpcodeAtomicI64Rmw8OrU represents the instruction i64.atomic.rmw8.or_u.
   728  	OpcodeAtomicI64Rmw8OrU OpcodeAtomic = 0x37
   729  	// OpcodeAtomicI64Rmw16OrU represents the instruction i64.atomic.rmw16.or_u.
   730  	OpcodeAtomicI64Rmw16OrU OpcodeAtomic = 0x38
   731  	// OpcodeAtomicI64Rmw32OrU represents the instruction i64.atomic.rmw32.or_u.
   732  	OpcodeAtomicI64Rmw32OrU OpcodeAtomic = 0x39
   733  
   734  	// OpcodeAtomicI32RmwXor represents the instruction i32.atomic.rmw.xor.
   735  	OpcodeAtomicI32RmwXor OpcodeAtomic = 0x3a
   736  	// OpcodeAtomicI64RmwXor represents the instruction i64.atomic.rmw.xor.
   737  	OpcodeAtomicI64RmwXor OpcodeAtomic = 0x3b
   738  	// OpcodeAtomicI32Rmw8XorU represents the instruction i32.atomic.rmw8.xor_u.
   739  	OpcodeAtomicI32Rmw8XorU OpcodeAtomic = 0x3c
   740  	// OpcodeAtomicI32Rmw16XorU represents the instruction i32.atomic.rmw16.xor_u.
   741  	OpcodeAtomicI32Rmw16XorU OpcodeAtomic = 0x3d
   742  	// OpcodeAtomicI64Rmw8XorU represents the instruction i64.atomic.rmw8.xor_u.
   743  	OpcodeAtomicI64Rmw8XorU OpcodeAtomic = 0x3e
   744  	// OpcodeAtomicI64Rmw16XorU represents the instruction i64.atomic.rmw16.xor_u.
   745  	OpcodeAtomicI64Rmw16XorU OpcodeAtomic = 0x3f
   746  	// OpcodeAtomicI64Rmw32XorU represents the instruction i64.atomic.rmw32.xor_u.
   747  	OpcodeAtomicI64Rmw32XorU OpcodeAtomic = 0x40
   748  
   749  	// OpcodeAtomicI32RmwXchg represents the instruction i32.atomic.rmw.xchg.
   750  	OpcodeAtomicI32RmwXchg OpcodeAtomic = 0x41
   751  	// OpcodeAtomicI64RmwXchg represents the instruction i64.atomic.rmw.xchg.
   752  	OpcodeAtomicI64RmwXchg OpcodeAtomic = 0x42
   753  	// OpcodeAtomicI32Rmw8XchgU represents the instruction i32.atomic.rmw8.xchg_u.
   754  	OpcodeAtomicI32Rmw8XchgU OpcodeAtomic = 0x43
   755  	// OpcodeAtomicI32Rmw16XchgU represents the instruction i32.atomic.rmw16.xchg_u.
   756  	OpcodeAtomicI32Rmw16XchgU OpcodeAtomic = 0x44
   757  	// OpcodeAtomicI64Rmw8XchgU represents the instruction i64.atomic.rmw8.xchg_u.
   758  	OpcodeAtomicI64Rmw8XchgU OpcodeAtomic = 0x45
   759  	// OpcodeAtomicI64Rmw16XchgU represents the instruction i64.atomic.rmw16.xchg_u.
   760  	OpcodeAtomicI64Rmw16XchgU OpcodeAtomic = 0x46
   761  	// OpcodeAtomicI64Rmw32XchgU represents the instruction i64.atomic.rmw32.xchg_u.
   762  	OpcodeAtomicI64Rmw32XchgU OpcodeAtomic = 0x47
   763  
   764  	// OpcodeAtomicI32RmwCmpxchg represents the instruction i32.atomic.rmw.cmpxchg.
   765  	OpcodeAtomicI32RmwCmpxchg OpcodeAtomic = 0x48
   766  	// OpcodeAtomicI64RmwCmpxchg represents the instruction i64.atomic.rmw.cmpxchg.
   767  	OpcodeAtomicI64RmwCmpxchg OpcodeAtomic = 0x49
   768  	// OpcodeAtomicI32Rmw8CmpxchgU represents the instruction i32.atomic.rmw8.cmpxchg_u.
   769  	OpcodeAtomicI32Rmw8CmpxchgU OpcodeAtomic = 0x4a
   770  	// OpcodeAtomicI32Rmw16CmpxchgU represents the instruction i32.atomic.rmw16.cmpxchg_u.
   771  	OpcodeAtomicI32Rmw16CmpxchgU OpcodeAtomic = 0x4b
   772  	// OpcodeAtomicI64Rmw8CmpxchgU represents the instruction i64.atomic.rmw8.cmpxchg_u.
   773  	OpcodeAtomicI64Rmw8CmpxchgU OpcodeAtomic = 0x4c
   774  	// OpcodeAtomicI64Rmw16CmpxchgU represents the instruction i64.atomic.rmw16.cmpxchg_u.
   775  	OpcodeAtomicI64Rmw16CmpxchgU OpcodeAtomic = 0x4d
   776  	// OpcodeAtomicI64Rmw32CmpxchgU represents the instruction i64.atomic.rmw32.cmpxchg_u.
   777  	OpcodeAtomicI64Rmw32CmpxchgU OpcodeAtomic = 0x4e
   778  )
   779  
   780  const (
   781  	OpcodeUnreachableName       = "unreachable"
   782  	OpcodeNopName               = "nop"
   783  	OpcodeBlockName             = "block"
   784  	OpcodeLoopName              = "loop"
   785  	OpcodeIfName                = "if"
   786  	OpcodeElseName              = "else"
   787  	OpcodeEndName               = "end"
   788  	OpcodeBrName                = "br"
   789  	OpcodeBrIfName              = "br_if"
   790  	OpcodeBrTableName           = "br_table"
   791  	OpcodeReturnName            = "return"
   792  	OpcodeCallName              = "call"
   793  	OpcodeCallIndirectName      = "call_indirect"
   794  	OpcodeDropName              = "drop"
   795  	OpcodeSelectName            = "select"
   796  	OpcodeTypedSelectName       = "typed_select"
   797  	OpcodeLocalGetName          = "local.get"
   798  	OpcodeLocalSetName          = "local.set"
   799  	OpcodeLocalTeeName          = "local.tee"
   800  	OpcodeGlobalGetName         = "global.get"
   801  	OpcodeGlobalSetName         = "global.set"
   802  	OpcodeI32LoadName           = "i32.load"
   803  	OpcodeI64LoadName           = "i64.load"
   804  	OpcodeF32LoadName           = "f32.load"
   805  	OpcodeF64LoadName           = "f64.load"
   806  	OpcodeI32Load8SName         = "i32.load8_s"
   807  	OpcodeI32Load8UName         = "i32.load8_u"
   808  	OpcodeI32Load16SName        = "i32.load16_s"
   809  	OpcodeI32Load16UName        = "i32.load16_u"
   810  	OpcodeI64Load8SName         = "i64.load8_s"
   811  	OpcodeI64Load8UName         = "i64.load8_u"
   812  	OpcodeI64Load16SName        = "i64.load16_s"
   813  	OpcodeI64Load16UName        = "i64.load16_u"
   814  	OpcodeI64Load32SName        = "i64.load32_s"
   815  	OpcodeI64Load32UName        = "i64.load32_u"
   816  	OpcodeI32StoreName          = "i32.store"
   817  	OpcodeI64StoreName          = "i64.store"
   818  	OpcodeF32StoreName          = "f32.store"
   819  	OpcodeF64StoreName          = "f64.store"
   820  	OpcodeI32Store8Name         = "i32.store8"
   821  	OpcodeI32Store16Name        = "i32.store16"
   822  	OpcodeI64Store8Name         = "i64.store8"
   823  	OpcodeI64Store16Name        = "i64.store16"
   824  	OpcodeI64Store32Name        = "i64.store32"
   825  	OpcodeMemorySizeName        = "memory.size"
   826  	OpcodeMemoryGrowName        = "memory.grow"
   827  	OpcodeI32ConstName          = "i32.const"
   828  	OpcodeI64ConstName          = "i64.const"
   829  	OpcodeF32ConstName          = "f32.const"
   830  	OpcodeF64ConstName          = "f64.const"
   831  	OpcodeI32EqzName            = "i32.eqz"
   832  	OpcodeI32EqName             = "i32.eq"
   833  	OpcodeI32NeName             = "i32.ne"
   834  	OpcodeI32LtSName            = "i32.lt_s"
   835  	OpcodeI32LtUName            = "i32.lt_u"
   836  	OpcodeI32GtSName            = "i32.gt_s"
   837  	OpcodeI32GtUName            = "i32.gt_u"
   838  	OpcodeI32LeSName            = "i32.le_s"
   839  	OpcodeI32LeUName            = "i32.le_u"
   840  	OpcodeI32GeSName            = "i32.ge_s"
   841  	OpcodeI32GeUName            = "i32.ge_u"
   842  	OpcodeI64EqzName            = "i64.eqz"
   843  	OpcodeI64EqName             = "i64.eq"
   844  	OpcodeI64NeName             = "i64.ne"
   845  	OpcodeI64LtSName            = "i64.lt_s"
   846  	OpcodeI64LtUName            = "i64.lt_u"
   847  	OpcodeI64GtSName            = "i64.gt_s"
   848  	OpcodeI64GtUName            = "i64.gt_u"
   849  	OpcodeI64LeSName            = "i64.le_s"
   850  	OpcodeI64LeUName            = "i64.le_u"
   851  	OpcodeI64GeSName            = "i64.ge_s"
   852  	OpcodeI64GeUName            = "i64.ge_u"
   853  	OpcodeF32EqName             = "f32.eq"
   854  	OpcodeF32NeName             = "f32.ne"
   855  	OpcodeF32LtName             = "f32.lt"
   856  	OpcodeF32GtName             = "f32.gt"
   857  	OpcodeF32LeName             = "f32.le"
   858  	OpcodeF32GeName             = "f32.ge"
   859  	OpcodeF64EqName             = "f64.eq"
   860  	OpcodeF64NeName             = "f64.ne"
   861  	OpcodeF64LtName             = "f64.lt"
   862  	OpcodeF64GtName             = "f64.gt"
   863  	OpcodeF64LeName             = "f64.le"
   864  	OpcodeF64GeName             = "f64.ge"
   865  	OpcodeI32ClzName            = "i32.clz"
   866  	OpcodeI32CtzName            = "i32.ctz"
   867  	OpcodeI32PopcntName         = "i32.popcnt"
   868  	OpcodeI32AddName            = "i32.add"
   869  	OpcodeI32SubName            = "i32.sub"
   870  	OpcodeI32MulName            = "i32.mul"
   871  	OpcodeI32DivSName           = "i32.div_s"
   872  	OpcodeI32DivUName           = "i32.div_u"
   873  	OpcodeI32RemSName           = "i32.rem_s"
   874  	OpcodeI32RemUName           = "i32.rem_u"
   875  	OpcodeI32AndName            = "i32.and"
   876  	OpcodeI32OrName             = "i32.or"
   877  	OpcodeI32XorName            = "i32.xor"
   878  	OpcodeI32ShlName            = "i32.shl"
   879  	OpcodeI32ShrSName           = "i32.shr_s"
   880  	OpcodeI32ShrUName           = "i32.shr_u"
   881  	OpcodeI32RotlName           = "i32.rotl"
   882  	OpcodeI32RotrName           = "i32.rotr"
   883  	OpcodeI64ClzName            = "i64.clz"
   884  	OpcodeI64CtzName            = "i64.ctz"
   885  	OpcodeI64PopcntName         = "i64.popcnt"
   886  	OpcodeI64AddName            = "i64.add"
   887  	OpcodeI64SubName            = "i64.sub"
   888  	OpcodeI64MulName            = "i64.mul"
   889  	OpcodeI64DivSName           = "i64.div_s"
   890  	OpcodeI64DivUName           = "i64.div_u"
   891  	OpcodeI64RemSName           = "i64.rem_s"
   892  	OpcodeI64RemUName           = "i64.rem_u"
   893  	OpcodeI64AndName            = "i64.and"
   894  	OpcodeI64OrName             = "i64.or"
   895  	OpcodeI64XorName            = "i64.xor"
   896  	OpcodeI64ShlName            = "i64.shl"
   897  	OpcodeI64ShrSName           = "i64.shr_s"
   898  	OpcodeI64ShrUName           = "i64.shr_u"
   899  	OpcodeI64RotlName           = "i64.rotl"
   900  	OpcodeI64RotrName           = "i64.rotr"
   901  	OpcodeF32AbsName            = "f32.abs"
   902  	OpcodeF32NegName            = "f32.neg"
   903  	OpcodeF32CeilName           = "f32.ceil"
   904  	OpcodeF32FloorName          = "f32.floor"
   905  	OpcodeF32TruncName          = "f32.trunc"
   906  	OpcodeF32NearestName        = "f32.nearest"
   907  	OpcodeF32SqrtName           = "f32.sqrt"
   908  	OpcodeF32AddName            = "f32.add"
   909  	OpcodeF32SubName            = "f32.sub"
   910  	OpcodeF32MulName            = "f32.mul"
   911  	OpcodeF32DivName            = "f32.div"
   912  	OpcodeF32MinName            = "f32.min"
   913  	OpcodeF32MaxName            = "f32.max"
   914  	OpcodeF32CopysignName       = "f32.copysign"
   915  	OpcodeF64AbsName            = "f64.abs"
   916  	OpcodeF64NegName            = "f64.neg"
   917  	OpcodeF64CeilName           = "f64.ceil"
   918  	OpcodeF64FloorName          = "f64.floor"
   919  	OpcodeF64TruncName          = "f64.trunc"
   920  	OpcodeF64NearestName        = "f64.nearest"
   921  	OpcodeF64SqrtName           = "f64.sqrt"
   922  	OpcodeF64AddName            = "f64.add"
   923  	OpcodeF64SubName            = "f64.sub"
   924  	OpcodeF64MulName            = "f64.mul"
   925  	OpcodeF64DivName            = "f64.div"
   926  	OpcodeF64MinName            = "f64.min"
   927  	OpcodeF64MaxName            = "f64.max"
   928  	OpcodeF64CopysignName       = "f64.copysign"
   929  	OpcodeI32WrapI64Name        = "i32.wrap_i64"
   930  	OpcodeI32TruncF32SName      = "i32.trunc_f32_s"
   931  	OpcodeI32TruncF32UName      = "i32.trunc_f32_u"
   932  	OpcodeI32TruncF64SName      = "i32.trunc_f64_s"
   933  	OpcodeI32TruncF64UName      = "i32.trunc_f64_u"
   934  	OpcodeI64ExtendI32SName     = "i64.extend_i32_s"
   935  	OpcodeI64ExtendI32UName     = "i64.extend_i32_u"
   936  	OpcodeI64TruncF32SName      = "i64.trunc_f32_s"
   937  	OpcodeI64TruncF32UName      = "i64.trunc_f32_u"
   938  	OpcodeI64TruncF64SName      = "i64.trunc_f64_s"
   939  	OpcodeI64TruncF64UName      = "i64.trunc_f64_u"
   940  	OpcodeF32ConvertI32SName    = "f32.convert_i32_s"
   941  	OpcodeF32ConvertI32UName    = "f32.convert_i32_u"
   942  	OpcodeF32ConvertI64SName    = "f32.convert_i64_s"
   943  	OpcodeF32ConvertI64UName    = "f32.convert_i64u"
   944  	OpcodeF32DemoteF64Name      = "f32.demote_f64"
   945  	OpcodeF64ConvertI32SName    = "f64.convert_i32_s"
   946  	OpcodeF64ConvertI32UName    = "f64.convert_i32_u"
   947  	OpcodeF64ConvertI64SName    = "f64.convert_i64_s"
   948  	OpcodeF64ConvertI64UName    = "f64.convert_i64_u"
   949  	OpcodeF64PromoteF32Name     = "f64.promote_f32"
   950  	OpcodeI32ReinterpretF32Name = "i32.reinterpret_f32"
   951  	OpcodeI64ReinterpretF64Name = "i64.reinterpret_f64"
   952  	OpcodeF32ReinterpretI32Name = "f32.reinterpret_i32"
   953  	OpcodeF64ReinterpretI64Name = "f64.reinterpret_i64"
   954  
   955  	OpcodeRefNullName   = "ref.null"
   956  	OpcodeRefIsNullName = "ref.is_null"
   957  	OpcodeRefFuncName   = "ref.func"
   958  
   959  	OpcodeTableGetName = "table.get"
   960  	OpcodeTableSetName = "table.set"
   961  
   962  	// Below are toggled with CoreFeatureSignExtensionOps
   963  
   964  	OpcodeI32Extend8SName  = "i32.extend8_s"
   965  	OpcodeI32Extend16SName = "i32.extend16_s"
   966  	OpcodeI64Extend8SName  = "i64.extend8_s"
   967  	OpcodeI64Extend16SName = "i64.extend16_s"
   968  	OpcodeI64Extend32SName = "i64.extend32_s"
   969  
   970  	OpcodeMiscPrefixName   = "misc_prefix"
   971  	OpcodeVecPrefixName    = "vector_prefix"
   972  	OpcodeAtomicPrefixName = "atomic_prefix"
   973  )
   974  
   975  var instructionNames = [256]string{
   976  	OpcodeUnreachable:       OpcodeUnreachableName,
   977  	OpcodeNop:               OpcodeNopName,
   978  	OpcodeBlock:             OpcodeBlockName,
   979  	OpcodeLoop:              OpcodeLoopName,
   980  	OpcodeIf:                OpcodeIfName,
   981  	OpcodeElse:              OpcodeElseName,
   982  	OpcodeEnd:               OpcodeEndName,
   983  	OpcodeBr:                OpcodeBrName,
   984  	OpcodeBrIf:              OpcodeBrIfName,
   985  	OpcodeBrTable:           OpcodeBrTableName,
   986  	OpcodeReturn:            OpcodeReturnName,
   987  	OpcodeCall:              OpcodeCallName,
   988  	OpcodeCallIndirect:      OpcodeCallIndirectName,
   989  	OpcodeDrop:              OpcodeDropName,
   990  	OpcodeSelect:            OpcodeSelectName,
   991  	OpcodeTypedSelect:       OpcodeTypedSelectName,
   992  	OpcodeLocalGet:          OpcodeLocalGetName,
   993  	OpcodeLocalSet:          OpcodeLocalSetName,
   994  	OpcodeLocalTee:          OpcodeLocalTeeName,
   995  	OpcodeGlobalGet:         OpcodeGlobalGetName,
   996  	OpcodeGlobalSet:         OpcodeGlobalSetName,
   997  	OpcodeI32Load:           OpcodeI32LoadName,
   998  	OpcodeI64Load:           OpcodeI64LoadName,
   999  	OpcodeF32Load:           OpcodeF32LoadName,
  1000  	OpcodeF64Load:           OpcodeF64LoadName,
  1001  	OpcodeI32Load8S:         OpcodeI32Load8SName,
  1002  	OpcodeI32Load8U:         OpcodeI32Load8UName,
  1003  	OpcodeI32Load16S:        OpcodeI32Load16SName,
  1004  	OpcodeI32Load16U:        OpcodeI32Load16UName,
  1005  	OpcodeI64Load8S:         OpcodeI64Load8SName,
  1006  	OpcodeI64Load8U:         OpcodeI64Load8UName,
  1007  	OpcodeI64Load16S:        OpcodeI64Load16SName,
  1008  	OpcodeI64Load16U:        OpcodeI64Load16UName,
  1009  	OpcodeI64Load32S:        OpcodeI64Load32SName,
  1010  	OpcodeI64Load32U:        OpcodeI64Load32UName,
  1011  	OpcodeI32Store:          OpcodeI32StoreName,
  1012  	OpcodeI64Store:          OpcodeI64StoreName,
  1013  	OpcodeF32Store:          OpcodeF32StoreName,
  1014  	OpcodeF64Store:          OpcodeF64StoreName,
  1015  	OpcodeI32Store8:         OpcodeI32Store8Name,
  1016  	OpcodeI32Store16:        OpcodeI32Store16Name,
  1017  	OpcodeI64Store8:         OpcodeI64Store8Name,
  1018  	OpcodeI64Store16:        OpcodeI64Store16Name,
  1019  	OpcodeI64Store32:        OpcodeI64Store32Name,
  1020  	OpcodeMemorySize:        OpcodeMemorySizeName,
  1021  	OpcodeMemoryGrow:        OpcodeMemoryGrowName,
  1022  	OpcodeI32Const:          OpcodeI32ConstName,
  1023  	OpcodeI64Const:          OpcodeI64ConstName,
  1024  	OpcodeF32Const:          OpcodeF32ConstName,
  1025  	OpcodeF64Const:          OpcodeF64ConstName,
  1026  	OpcodeI32Eqz:            OpcodeI32EqzName,
  1027  	OpcodeI32Eq:             OpcodeI32EqName,
  1028  	OpcodeI32Ne:             OpcodeI32NeName,
  1029  	OpcodeI32LtS:            OpcodeI32LtSName,
  1030  	OpcodeI32LtU:            OpcodeI32LtUName,
  1031  	OpcodeI32GtS:            OpcodeI32GtSName,
  1032  	OpcodeI32GtU:            OpcodeI32GtUName,
  1033  	OpcodeI32LeS:            OpcodeI32LeSName,
  1034  	OpcodeI32LeU:            OpcodeI32LeUName,
  1035  	OpcodeI32GeS:            OpcodeI32GeSName,
  1036  	OpcodeI32GeU:            OpcodeI32GeUName,
  1037  	OpcodeI64Eqz:            OpcodeI64EqzName,
  1038  	OpcodeI64Eq:             OpcodeI64EqName,
  1039  	OpcodeI64Ne:             OpcodeI64NeName,
  1040  	OpcodeI64LtS:            OpcodeI64LtSName,
  1041  	OpcodeI64LtU:            OpcodeI64LtUName,
  1042  	OpcodeI64GtS:            OpcodeI64GtSName,
  1043  	OpcodeI64GtU:            OpcodeI64GtUName,
  1044  	OpcodeI64LeS:            OpcodeI64LeSName,
  1045  	OpcodeI64LeU:            OpcodeI64LeUName,
  1046  	OpcodeI64GeS:            OpcodeI64GeSName,
  1047  	OpcodeI64GeU:            OpcodeI64GeUName,
  1048  	OpcodeF32Eq:             OpcodeF32EqName,
  1049  	OpcodeF32Ne:             OpcodeF32NeName,
  1050  	OpcodeF32Lt:             OpcodeF32LtName,
  1051  	OpcodeF32Gt:             OpcodeF32GtName,
  1052  	OpcodeF32Le:             OpcodeF32LeName,
  1053  	OpcodeF32Ge:             OpcodeF32GeName,
  1054  	OpcodeF64Eq:             OpcodeF64EqName,
  1055  	OpcodeF64Ne:             OpcodeF64NeName,
  1056  	OpcodeF64Lt:             OpcodeF64LtName,
  1057  	OpcodeF64Gt:             OpcodeF64GtName,
  1058  	OpcodeF64Le:             OpcodeF64LeName,
  1059  	OpcodeF64Ge:             OpcodeF64GeName,
  1060  	OpcodeI32Clz:            OpcodeI32ClzName,
  1061  	OpcodeI32Ctz:            OpcodeI32CtzName,
  1062  	OpcodeI32Popcnt:         OpcodeI32PopcntName,
  1063  	OpcodeI32Add:            OpcodeI32AddName,
  1064  	OpcodeI32Sub:            OpcodeI32SubName,
  1065  	OpcodeI32Mul:            OpcodeI32MulName,
  1066  	OpcodeI32DivS:           OpcodeI32DivSName,
  1067  	OpcodeI32DivU:           OpcodeI32DivUName,
  1068  	OpcodeI32RemS:           OpcodeI32RemSName,
  1069  	OpcodeI32RemU:           OpcodeI32RemUName,
  1070  	OpcodeI32And:            OpcodeI32AndName,
  1071  	OpcodeI32Or:             OpcodeI32OrName,
  1072  	OpcodeI32Xor:            OpcodeI32XorName,
  1073  	OpcodeI32Shl:            OpcodeI32ShlName,
  1074  	OpcodeI32ShrS:           OpcodeI32ShrSName,
  1075  	OpcodeI32ShrU:           OpcodeI32ShrUName,
  1076  	OpcodeI32Rotl:           OpcodeI32RotlName,
  1077  	OpcodeI32Rotr:           OpcodeI32RotrName,
  1078  	OpcodeI64Clz:            OpcodeI64ClzName,
  1079  	OpcodeI64Ctz:            OpcodeI64CtzName,
  1080  	OpcodeI64Popcnt:         OpcodeI64PopcntName,
  1081  	OpcodeI64Add:            OpcodeI64AddName,
  1082  	OpcodeI64Sub:            OpcodeI64SubName,
  1083  	OpcodeI64Mul:            OpcodeI64MulName,
  1084  	OpcodeI64DivS:           OpcodeI64DivSName,
  1085  	OpcodeI64DivU:           OpcodeI64DivUName,
  1086  	OpcodeI64RemS:           OpcodeI64RemSName,
  1087  	OpcodeI64RemU:           OpcodeI64RemUName,
  1088  	OpcodeI64And:            OpcodeI64AndName,
  1089  	OpcodeI64Or:             OpcodeI64OrName,
  1090  	OpcodeI64Xor:            OpcodeI64XorName,
  1091  	OpcodeI64Shl:            OpcodeI64ShlName,
  1092  	OpcodeI64ShrS:           OpcodeI64ShrSName,
  1093  	OpcodeI64ShrU:           OpcodeI64ShrUName,
  1094  	OpcodeI64Rotl:           OpcodeI64RotlName,
  1095  	OpcodeI64Rotr:           OpcodeI64RotrName,
  1096  	OpcodeF32Abs:            OpcodeF32AbsName,
  1097  	OpcodeF32Neg:            OpcodeF32NegName,
  1098  	OpcodeF32Ceil:           OpcodeF32CeilName,
  1099  	OpcodeF32Floor:          OpcodeF32FloorName,
  1100  	OpcodeF32Trunc:          OpcodeF32TruncName,
  1101  	OpcodeF32Nearest:        OpcodeF32NearestName,
  1102  	OpcodeF32Sqrt:           OpcodeF32SqrtName,
  1103  	OpcodeF32Add:            OpcodeF32AddName,
  1104  	OpcodeF32Sub:            OpcodeF32SubName,
  1105  	OpcodeF32Mul:            OpcodeF32MulName,
  1106  	OpcodeF32Div:            OpcodeF32DivName,
  1107  	OpcodeF32Min:            OpcodeF32MinName,
  1108  	OpcodeF32Max:            OpcodeF32MaxName,
  1109  	OpcodeF32Copysign:       OpcodeF32CopysignName,
  1110  	OpcodeF64Abs:            OpcodeF64AbsName,
  1111  	OpcodeF64Neg:            OpcodeF64NegName,
  1112  	OpcodeF64Ceil:           OpcodeF64CeilName,
  1113  	OpcodeF64Floor:          OpcodeF64FloorName,
  1114  	OpcodeF64Trunc:          OpcodeF64TruncName,
  1115  	OpcodeF64Nearest:        OpcodeF64NearestName,
  1116  	OpcodeF64Sqrt:           OpcodeF64SqrtName,
  1117  	OpcodeF64Add:            OpcodeF64AddName,
  1118  	OpcodeF64Sub:            OpcodeF64SubName,
  1119  	OpcodeF64Mul:            OpcodeF64MulName,
  1120  	OpcodeF64Div:            OpcodeF64DivName,
  1121  	OpcodeF64Min:            OpcodeF64MinName,
  1122  	OpcodeF64Max:            OpcodeF64MaxName,
  1123  	OpcodeF64Copysign:       OpcodeF64CopysignName,
  1124  	OpcodeI32WrapI64:        OpcodeI32WrapI64Name,
  1125  	OpcodeI32TruncF32S:      OpcodeI32TruncF32SName,
  1126  	OpcodeI32TruncF32U:      OpcodeI32TruncF32UName,
  1127  	OpcodeI32TruncF64S:      OpcodeI32TruncF64SName,
  1128  	OpcodeI32TruncF64U:      OpcodeI32TruncF64UName,
  1129  	OpcodeI64ExtendI32S:     OpcodeI64ExtendI32SName,
  1130  	OpcodeI64ExtendI32U:     OpcodeI64ExtendI32UName,
  1131  	OpcodeI64TruncF32S:      OpcodeI64TruncF32SName,
  1132  	OpcodeI64TruncF32U:      OpcodeI64TruncF32UName,
  1133  	OpcodeI64TruncF64S:      OpcodeI64TruncF64SName,
  1134  	OpcodeI64TruncF64U:      OpcodeI64TruncF64UName,
  1135  	OpcodeF32ConvertI32S:    OpcodeF32ConvertI32SName,
  1136  	OpcodeF32ConvertI32U:    OpcodeF32ConvertI32UName,
  1137  	OpcodeF32ConvertI64S:    OpcodeF32ConvertI64SName,
  1138  	OpcodeF32ConvertI64U:    OpcodeF32ConvertI64UName,
  1139  	OpcodeF32DemoteF64:      OpcodeF32DemoteF64Name,
  1140  	OpcodeF64ConvertI32S:    OpcodeF64ConvertI32SName,
  1141  	OpcodeF64ConvertI32U:    OpcodeF64ConvertI32UName,
  1142  	OpcodeF64ConvertI64S:    OpcodeF64ConvertI64SName,
  1143  	OpcodeF64ConvertI64U:    OpcodeF64ConvertI64UName,
  1144  	OpcodeF64PromoteF32:     OpcodeF64PromoteF32Name,
  1145  	OpcodeI32ReinterpretF32: OpcodeI32ReinterpretF32Name,
  1146  	OpcodeI64ReinterpretF64: OpcodeI64ReinterpretF64Name,
  1147  	OpcodeF32ReinterpretI32: OpcodeF32ReinterpretI32Name,
  1148  	OpcodeF64ReinterpretI64: OpcodeF64ReinterpretI64Name,
  1149  
  1150  	OpcodeRefNull:   OpcodeRefNullName,
  1151  	OpcodeRefIsNull: OpcodeRefIsNullName,
  1152  	OpcodeRefFunc:   OpcodeRefFuncName,
  1153  
  1154  	OpcodeTableGet: OpcodeTableGetName,
  1155  	OpcodeTableSet: OpcodeTableSetName,
  1156  
  1157  	// Below are toggled with CoreFeatureSignExtensionOps
  1158  
  1159  	OpcodeI32Extend8S:  OpcodeI32Extend8SName,
  1160  	OpcodeI32Extend16S: OpcodeI32Extend16SName,
  1161  	OpcodeI64Extend8S:  OpcodeI64Extend8SName,
  1162  	OpcodeI64Extend16S: OpcodeI64Extend16SName,
  1163  	OpcodeI64Extend32S: OpcodeI64Extend32SName,
  1164  
  1165  	OpcodeMiscPrefix: OpcodeMiscPrefixName,
  1166  	OpcodeVecPrefix:  OpcodeVecPrefixName,
  1167  }
  1168  
  1169  // InstructionName returns the instruction corresponding to this binary Opcode.
  1170  // See https://www.w3.org/TR/2019/REC-wasm-core-1-20191205/#a7-index-of-instructions
  1171  func InstructionName(oc Opcode) string {
  1172  	return instructionNames[oc]
  1173  }
  1174  
  1175  const (
  1176  	OpcodeI32TruncSatF32SName = "i32.trunc_sat_f32_s"
  1177  	OpcodeI32TruncSatF32UName = "i32.trunc_sat_f32_u"
  1178  	OpcodeI32TruncSatF64SName = "i32.trunc_sat_f64_s"
  1179  	OpcodeI32TruncSatF64UName = "i32.trunc_sat_f64_u"
  1180  	OpcodeI64TruncSatF32SName = "i64.trunc_sat_f32_s"
  1181  	OpcodeI64TruncSatF32UName = "i64.trunc_sat_f32_u"
  1182  	OpcodeI64TruncSatF64SName = "i64.trunc_sat_f64_s"
  1183  	OpcodeI64TruncSatF64UName = "i64.trunc_sat_f64_u"
  1184  
  1185  	OpcodeMemoryInitName = "memory.init"
  1186  	OpcodeDataDropName   = "data.drop"
  1187  	OpcodeMemoryCopyName = "memory.copy"
  1188  	OpcodeMemoryFillName = "memory.fill"
  1189  	OpcodeTableInitName  = "table.init"
  1190  	OpcodeElemDropName   = "elem.drop"
  1191  	OpcodeTableCopyName  = "table.copy"
  1192  	OpcodeTableGrowName  = "table.grow"
  1193  	OpcodeTableSizeName  = "table.size"
  1194  	OpcodeTableFillName  = "table.fill"
  1195  )
  1196  
  1197  var miscInstructionNames = [256]string{
  1198  	OpcodeMiscI32TruncSatF32S: OpcodeI32TruncSatF32SName,
  1199  	OpcodeMiscI32TruncSatF32U: OpcodeI32TruncSatF32UName,
  1200  	OpcodeMiscI32TruncSatF64S: OpcodeI32TruncSatF64SName,
  1201  	OpcodeMiscI32TruncSatF64U: OpcodeI32TruncSatF64UName,
  1202  	OpcodeMiscI64TruncSatF32S: OpcodeI64TruncSatF32SName,
  1203  	OpcodeMiscI64TruncSatF32U: OpcodeI64TruncSatF32UName,
  1204  	OpcodeMiscI64TruncSatF64S: OpcodeI64TruncSatF64SName,
  1205  	OpcodeMiscI64TruncSatF64U: OpcodeI64TruncSatF64UName,
  1206  
  1207  	OpcodeMiscMemoryInit: OpcodeMemoryInitName,
  1208  	OpcodeMiscDataDrop:   OpcodeDataDropName,
  1209  	OpcodeMiscMemoryCopy: OpcodeMemoryCopyName,
  1210  	OpcodeMiscMemoryFill: OpcodeMemoryFillName,
  1211  	OpcodeMiscTableInit:  OpcodeTableInitName,
  1212  	OpcodeMiscElemDrop:   OpcodeElemDropName,
  1213  	OpcodeMiscTableCopy:  OpcodeTableCopyName,
  1214  	OpcodeMiscTableGrow:  OpcodeTableGrowName,
  1215  	OpcodeMiscTableSize:  OpcodeTableSizeName,
  1216  	OpcodeMiscTableFill:  OpcodeTableFillName,
  1217  }
  1218  
  1219  // MiscInstructionName returns the instruction corresponding to this miscellaneous Opcode.
  1220  func MiscInstructionName(oc OpcodeMisc) string {
  1221  	return miscInstructionNames[oc]
  1222  }
  1223  
  1224  const (
  1225  	OpcodeVecV128LoadName                  = "v128.load"
  1226  	OpcodeVecV128Load8x8SName              = "v128.load8x8_s"
  1227  	OpcodeVecV128Load8x8UName              = "v128.load8x8_u"
  1228  	OpcodeVecV128Load16x4SName             = "v128.load16x4_s"
  1229  	OpcodeVecV128Load16x4UName             = "v128.load16x4_u"
  1230  	OpcodeVecV128Load32x2SName             = "v128.load32x2_s"
  1231  	OpcodeVecV128Load32x2UName             = "v128.load32x2_u"
  1232  	OpcodeVecV128Load8SplatName            = "v128.load8_splat"
  1233  	OpcodeVecV128Load16SplatName           = "v128.load16_splat"
  1234  	OpcodeVecV128Load32SplatName           = "v128.load32_splat"
  1235  	OpcodeVecV128Load64SplatName           = "v128.load64_splat"
  1236  	OpcodeVecV128Load32zeroName            = "v128.load32_zero"
  1237  	OpcodeVecV128Load64zeroName            = "v128.load64_zero"
  1238  	OpcodeVecV128StoreName                 = "v128.store"
  1239  	OpcodeVecV128Load8LaneName             = "v128.load8_lane"
  1240  	OpcodeVecV128Load16LaneName            = "v128.load16_lane"
  1241  	OpcodeVecV128Load32LaneName            = "v128.load32_lane"
  1242  	OpcodeVecV128Load64LaneName            = "v128.load64_lane"
  1243  	OpcodeVecV128Store8LaneName            = "v128.store8_lane"
  1244  	OpcodeVecV128Store16LaneName           = "v128.store16_lane"
  1245  	OpcodeVecV128Store32LaneName           = "v128.store32_lane"
  1246  	OpcodeVecV128Store64LaneName           = "v128.store64_lane"
  1247  	OpcodeVecV128ConstName                 = "v128.const"
  1248  	OpcodeVecV128i8x16ShuffleName          = "v128.shuffle"
  1249  	OpcodeVecI8x16ExtractLaneSName         = "i8x16.extract_lane_s"
  1250  	OpcodeVecI8x16ExtractLaneUName         = "i8x16.extract_lane_u"
  1251  	OpcodeVecI8x16ReplaceLaneName          = "i8x16.replace_lane"
  1252  	OpcodeVecI16x8ExtractLaneSName         = "i16x8.extract_lane_s"
  1253  	OpcodeVecI16x8ExtractLaneUName         = "i16x8.extract_lane_u"
  1254  	OpcodeVecI16x8ReplaceLaneName          = "i16x8.replace_lane"
  1255  	OpcodeVecI32x4ExtractLaneName          = "i32x4.extract_lane"
  1256  	OpcodeVecI32x4ReplaceLaneName          = "i32x4.replace_lane"
  1257  	OpcodeVecI64x2ExtractLaneName          = "i64x2.extract_lane"
  1258  	OpcodeVecI64x2ReplaceLaneName          = "i64x2.replace_lane"
  1259  	OpcodeVecF32x4ExtractLaneName          = "f32x4.extract_lane"
  1260  	OpcodeVecF32x4ReplaceLaneName          = "f32x4.replace_lane"
  1261  	OpcodeVecF64x2ExtractLaneName          = "f64x2.extract_lane"
  1262  	OpcodeVecF64x2ReplaceLaneName          = "f64x2.replace_lane"
  1263  	OpcodeVecI8x16SwizzleName              = "i8x16.swizzle"
  1264  	OpcodeVecI8x16SplatName                = "i8x16.splat"
  1265  	OpcodeVecI16x8SplatName                = "i16x8.splat"
  1266  	OpcodeVecI32x4SplatName                = "i32x4.splat"
  1267  	OpcodeVecI64x2SplatName                = "i64x2.splat"
  1268  	OpcodeVecF32x4SplatName                = "f32x4.splat"
  1269  	OpcodeVecF64x2SplatName                = "f64x2.splat"
  1270  	OpcodeVecI8x16EqName                   = "i8x16.eq"
  1271  	OpcodeVecI8x16NeName                   = "i8x16.ne"
  1272  	OpcodeVecI8x16LtSName                  = "i8x16.lt_s"
  1273  	OpcodeVecI8x16LtUName                  = "i8x16.lt_u"
  1274  	OpcodeVecI8x16GtSName                  = "i8x16.gt_s"
  1275  	OpcodeVecI8x16GtUName                  = "i8x16.gt_u"
  1276  	OpcodeVecI8x16LeSName                  = "i8x16.le_s"
  1277  	OpcodeVecI8x16LeUName                  = "i8x16.le_u"
  1278  	OpcodeVecI8x16GeSName                  = "i8x16.ge_s"
  1279  	OpcodeVecI8x16GeUName                  = "i8x16.ge_u"
  1280  	OpcodeVecI16x8EqName                   = "i16x8.eq"
  1281  	OpcodeVecI16x8NeName                   = "i16x8.ne"
  1282  	OpcodeVecI16x8LtSName                  = "i16x8.lt_s"
  1283  	OpcodeVecI16x8LtUName                  = "i16x8.lt_u"
  1284  	OpcodeVecI16x8GtSName                  = "i16x8.gt_s"
  1285  	OpcodeVecI16x8GtUName                  = "i16x8.gt_u"
  1286  	OpcodeVecI16x8LeSName                  = "i16x8.le_s"
  1287  	OpcodeVecI16x8LeUName                  = "i16x8.le_u"
  1288  	OpcodeVecI16x8GeSName                  = "i16x8.ge_s"
  1289  	OpcodeVecI16x8GeUName                  = "i16x8.ge_u"
  1290  	OpcodeVecI32x4EqName                   = "i32x4.eq"
  1291  	OpcodeVecI32x4NeName                   = "i32x4.ne"
  1292  	OpcodeVecI32x4LtSName                  = "i32x4.lt_s"
  1293  	OpcodeVecI32x4LtUName                  = "i32x4.lt_u"
  1294  	OpcodeVecI32x4GtSName                  = "i32x4.gt_s"
  1295  	OpcodeVecI32x4GtUName                  = "i32x4.gt_u"
  1296  	OpcodeVecI32x4LeSName                  = "i32x4.le_s"
  1297  	OpcodeVecI32x4LeUName                  = "i32x4.le_u"
  1298  	OpcodeVecI32x4GeSName                  = "i32x4.ge_s"
  1299  	OpcodeVecI32x4GeUName                  = "i32x4.ge_u"
  1300  	OpcodeVecI64x2EqName                   = "i64x2.eq"
  1301  	OpcodeVecI64x2NeName                   = "i64x2.ne"
  1302  	OpcodeVecI64x2LtSName                  = "i64x2.lt"
  1303  	OpcodeVecI64x2GtSName                  = "i64x2.gt"
  1304  	OpcodeVecI64x2LeSName                  = "i64x2.le"
  1305  	OpcodeVecI64x2GeSName                  = "i64x2.ge"
  1306  	OpcodeVecF32x4EqName                   = "f32x4.eq"
  1307  	OpcodeVecF32x4NeName                   = "f32x4.ne"
  1308  	OpcodeVecF32x4LtName                   = "f32x4.lt"
  1309  	OpcodeVecF32x4GtName                   = "f32x4.gt"
  1310  	OpcodeVecF32x4LeName                   = "f32x4.le"
  1311  	OpcodeVecF32x4GeName                   = "f32x4.ge"
  1312  	OpcodeVecF64x2EqName                   = "f64x2.eq"
  1313  	OpcodeVecF64x2NeName                   = "f64x2.ne"
  1314  	OpcodeVecF64x2LtName                   = "f64x2.lt"
  1315  	OpcodeVecF64x2GtName                   = "f64x2.gt"
  1316  	OpcodeVecF64x2LeName                   = "f64x2.le"
  1317  	OpcodeVecF64x2GeName                   = "f64x2.ge"
  1318  	OpcodeVecV128NotName                   = "v128.not"
  1319  	OpcodeVecV128AndName                   = "v128.and"
  1320  	OpcodeVecV128AndNotName                = "v128.andnot"
  1321  	OpcodeVecV128OrName                    = "v128.or"
  1322  	OpcodeVecV128XorName                   = "v128.xor"
  1323  	OpcodeVecV128BitselectName             = "v128.bitselect"
  1324  	OpcodeVecV128AnyTrueName               = "v128.any_true"
  1325  	OpcodeVecI8x16AbsName                  = "i8x16.abs"
  1326  	OpcodeVecI8x16NegName                  = "i8x16.neg"
  1327  	OpcodeVecI8x16PopcntName               = "i8x16.popcnt"
  1328  	OpcodeVecI8x16AllTrueName              = "i8x16.all_true"
  1329  	OpcodeVecI8x16BitMaskName              = "i8x16.bitmask"
  1330  	OpcodeVecI8x16NarrowI16x8SName         = "i8x16.narrow_i16x8_s"
  1331  	OpcodeVecI8x16NarrowI16x8UName         = "i8x16.narrow_i16x8_u"
  1332  	OpcodeVecI8x16ShlName                  = "i8x16.shl"
  1333  	OpcodeVecI8x16ShrSName                 = "i8x16.shr_s"
  1334  	OpcodeVecI8x16ShrUName                 = "i8x16.shr_u"
  1335  	OpcodeVecI8x16AddName                  = "i8x16.add"
  1336  	OpcodeVecI8x16AddSatSName              = "i8x16.add_sat_s"
  1337  	OpcodeVecI8x16AddSatUName              = "i8x16.add_sat_u"
  1338  	OpcodeVecI8x16SubName                  = "i8x16.sub"
  1339  	OpcodeVecI8x16SubSatSName              = "i8x16.sub_s"
  1340  	OpcodeVecI8x16SubSatUName              = "i8x16.sub_u"
  1341  	OpcodeVecI8x16MinSName                 = "i8x16.min_s"
  1342  	OpcodeVecI8x16MinUName                 = "i8x16.min_u"
  1343  	OpcodeVecI8x16MaxSName                 = "i8x16.max_s"
  1344  	OpcodeVecI8x16MaxUName                 = "i8x16.max_u"
  1345  	OpcodeVecI8x16AvgrUName                = "i8x16.avgr_u"
  1346  	OpcodeVecI16x8ExtaddPairwiseI8x16SName = "i16x8.extadd_pairwise_i8x16_s"
  1347  	OpcodeVecI16x8ExtaddPairwiseI8x16UName = "i16x8.extadd_pairwise_i8x16_u"
  1348  	OpcodeVecI16x8AbsName                  = "i16x8.abs"
  1349  	OpcodeVecI16x8NegName                  = "i16x8.neg"
  1350  	OpcodeVecI16x8Q15mulrSatSName          = "i16x8.q15mulr_sat_s"
  1351  	OpcodeVecI16x8AllTrueName              = "i16x8.all_true"
  1352  	OpcodeVecI16x8BitMaskName              = "i16x8.bitmask"
  1353  	OpcodeVecI16x8NarrowI32x4SName         = "i16x8.narrow_i32x4_s"
  1354  	OpcodeVecI16x8NarrowI32x4UName         = "i16x8.narrow_i32x4_u"
  1355  	OpcodeVecI16x8ExtendLowI8x16SName      = "i16x8.extend_low_i8x16_s"
  1356  	OpcodeVecI16x8ExtendHighI8x16SName     = "i16x8.extend_high_i8x16_s"
  1357  	OpcodeVecI16x8ExtendLowI8x16UName      = "i16x8.extend_low_i8x16_u"
  1358  	OpcodeVecI16x8ExtendHighI8x16UName     = "i16x8.extend_high_i8x16_u"
  1359  	OpcodeVecI16x8ShlName                  = "i16x8.shl"
  1360  	OpcodeVecI16x8ShrSName                 = "i16x8.shr_s"
  1361  	OpcodeVecI16x8ShrUName                 = "i16x8.shr_u"
  1362  	OpcodeVecI16x8AddName                  = "i16x8.add"
  1363  	OpcodeVecI16x8AddSatSName              = "i16x8.add_sat_s"
  1364  	OpcodeVecI16x8AddSatUName              = "i16x8.add_sat_u"
  1365  	OpcodeVecI16x8SubName                  = "i16x8.sub"
  1366  	OpcodeVecI16x8SubSatSName              = "i16x8.sub_sat_s"
  1367  	OpcodeVecI16x8SubSatUName              = "i16x8.sub_sat_u"
  1368  	OpcodeVecI16x8MulName                  = "i16x8.mul"
  1369  	OpcodeVecI16x8MinSName                 = "i16x8.min_s"
  1370  	OpcodeVecI16x8MinUName                 = "i16x8.min_u"
  1371  	OpcodeVecI16x8MaxSName                 = "i16x8.max_s"
  1372  	OpcodeVecI16x8MaxUName                 = "i16x8.max_u"
  1373  	OpcodeVecI16x8AvgrUName                = "i16x8.avgr_u"
  1374  	OpcodeVecI16x8ExtMulLowI8x16SName      = "i16x8.extmul_low_i8x16_s"
  1375  	OpcodeVecI16x8ExtMulHighI8x16SName     = "i16x8.extmul_high_i8x16_s"
  1376  	OpcodeVecI16x8ExtMulLowI8x16UName      = "i16x8.extmul_low_i8x16_u"
  1377  	OpcodeVecI16x8ExtMulHighI8x16UName     = "i16x8.extmul_high_i8x16_u"
  1378  	OpcodeVecI32x4ExtaddPairwiseI16x8SName = "i32x4.extadd_pairwise_i16x8_s"
  1379  	OpcodeVecI32x4ExtaddPairwiseI16x8UName = "i32x4.extadd_pairwise_i16x8_u"
  1380  	OpcodeVecI32x4AbsName                  = "i32x4.abs"
  1381  	OpcodeVecI32x4NegName                  = "i32x4.neg"
  1382  	OpcodeVecI32x4AllTrueName              = "i32x4.all_true"
  1383  	OpcodeVecI32x4BitMaskName              = "i32x4.bitmask"
  1384  	OpcodeVecI32x4ExtendLowI16x8SName      = "i32x4.extend_low_i16x8_s"
  1385  	OpcodeVecI32x4ExtendHighI16x8SName     = "i32x4.extend_high_i16x8_s"
  1386  	OpcodeVecI32x4ExtendLowI16x8UName      = "i32x4.extend_low_i16x8_u"
  1387  	OpcodeVecI32x4ExtendHighI16x8UName     = "i32x4.extend_high_i16x8_u"
  1388  	OpcodeVecI32x4ShlName                  = "i32x4.shl"
  1389  	OpcodeVecI32x4ShrSName                 = "i32x4.shr_s"
  1390  	OpcodeVecI32x4ShrUName                 = "i32x4.shr_u"
  1391  	OpcodeVecI32x4AddName                  = "i32x4.add"
  1392  	OpcodeVecI32x4SubName                  = "i32x4.sub"
  1393  	OpcodeVecI32x4MulName                  = "i32x4.mul"
  1394  	OpcodeVecI32x4MinSName                 = "i32x4.min_s"
  1395  	OpcodeVecI32x4MinUName                 = "i32x4.min_u"
  1396  	OpcodeVecI32x4MaxSName                 = "i32x4.max_s"
  1397  	OpcodeVecI32x4MaxUName                 = "i32x4.max_u"
  1398  	OpcodeVecI32x4DotI16x8SName            = "i32x4.dot_i16x8_s"
  1399  	OpcodeVecI32x4ExtMulLowI16x8SName      = "i32x4.extmul_low_i16x8_s"
  1400  	OpcodeVecI32x4ExtMulHighI16x8SName     = "i32x4.extmul_high_i16x8_s"
  1401  	OpcodeVecI32x4ExtMulLowI16x8UName      = "i32x4.extmul_low_i16x8_u"
  1402  	OpcodeVecI32x4ExtMulHighI16x8UName     = "i32x4.extmul_high_i16x8_u"
  1403  	OpcodeVecI64x2AbsName                  = "i64x2.abs"
  1404  	OpcodeVecI64x2NegName                  = "i64x2.neg"
  1405  	OpcodeVecI64x2AllTrueName              = "i64x2.all_true"
  1406  	OpcodeVecI64x2BitMaskName              = "i64x2.bitmask"
  1407  	OpcodeVecI64x2ExtendLowI32x4SName      = "i64x2.extend_low_i32x4_s"
  1408  	OpcodeVecI64x2ExtendHighI32x4SName     = "i64x2.extend_high_i32x4_s"
  1409  	OpcodeVecI64x2ExtendLowI32x4UName      = "i64x2.extend_low_i32x4_u"
  1410  	OpcodeVecI64x2ExtendHighI32x4UName     = "i64x2.extend_high_i32x4_u"
  1411  	OpcodeVecI64x2ShlName                  = "i64x2.shl"
  1412  	OpcodeVecI64x2ShrSName                 = "i64x2.shr_s"
  1413  	OpcodeVecI64x2ShrUName                 = "i64x2.shr_u"
  1414  	OpcodeVecI64x2AddName                  = "i64x2.add"
  1415  	OpcodeVecI64x2SubName                  = "i64x2.sub"
  1416  	OpcodeVecI64x2MulName                  = "i64x2.mul"
  1417  	OpcodeVecI64x2ExtMulLowI32x4SName      = "i64x2.extmul_low_i32x4_s"
  1418  	OpcodeVecI64x2ExtMulHighI32x4SName     = "i64x2.extmul_high_i32x4_s"
  1419  	OpcodeVecI64x2ExtMulLowI32x4UName      = "i64x2.extmul_low_i32x4_u"
  1420  	OpcodeVecI64x2ExtMulHighI32x4UName     = "i64x2.extmul_high_i32x4_u"
  1421  	OpcodeVecF32x4CeilName                 = "f32x4.ceil"
  1422  	OpcodeVecF32x4FloorName                = "f32x4.floor"
  1423  	OpcodeVecF32x4TruncName                = "f32x4.trunc"
  1424  	OpcodeVecF32x4NearestName              = "f32x4.nearest"
  1425  	OpcodeVecF32x4AbsName                  = "f32x4.abs"
  1426  	OpcodeVecF32x4NegName                  = "f32x4.neg"
  1427  	OpcodeVecF32x4SqrtName                 = "f32x4.sqrt"
  1428  	OpcodeVecF32x4AddName                  = "f32x4.add"
  1429  	OpcodeVecF32x4SubName                  = "f32x4.sub"
  1430  	OpcodeVecF32x4MulName                  = "f32x4.mul"
  1431  	OpcodeVecF32x4DivName                  = "f32x4.div"
  1432  	OpcodeVecF32x4MinName                  = "f32x4.min"
  1433  	OpcodeVecF32x4MaxName                  = "f32x4.max"
  1434  	OpcodeVecF32x4PminName                 = "f32x4.pmin"
  1435  	OpcodeVecF32x4PmaxName                 = "f32x4.pmax"
  1436  	OpcodeVecF64x2CeilName                 = "f64x2.ceil"
  1437  	OpcodeVecF64x2FloorName                = "f64x2.floor"
  1438  	OpcodeVecF64x2TruncName                = "f64x2.trunc"
  1439  	OpcodeVecF64x2NearestName              = "f64x2.nearest"
  1440  	OpcodeVecF64x2AbsName                  = "f64x2.abs"
  1441  	OpcodeVecF64x2NegName                  = "f64x2.neg"
  1442  	OpcodeVecF64x2SqrtName                 = "f64x2.sqrt"
  1443  	OpcodeVecF64x2AddName                  = "f64x2.add"
  1444  	OpcodeVecF64x2SubName                  = "f64x2.sub"
  1445  	OpcodeVecF64x2MulName                  = "f64x2.mul"
  1446  	OpcodeVecF64x2DivName                  = "f64x2.div"
  1447  	OpcodeVecF64x2MinName                  = "f64x2.min"
  1448  	OpcodeVecF64x2MaxName                  = "f64x2.max"
  1449  	OpcodeVecF64x2PminName                 = "f64x2.pmin"
  1450  	OpcodeVecF64x2PmaxName                 = "f64x2.pmax"
  1451  	OpcodeVecI32x4TruncSatF32x4SName       = "i32x4.trunc_sat_f32x4_s"
  1452  	OpcodeVecI32x4TruncSatF32x4UName       = "i32x4.trunc_sat_f32x4_u"
  1453  	OpcodeVecF32x4ConvertI32x4SName        = "f32x4.convert_i32x4_s"
  1454  	OpcodeVecF32x4ConvertI32x4UName        = "f32x4.convert_i32x4_u"
  1455  	OpcodeVecI32x4TruncSatF64x2SZeroName   = "i32x4.trunc_sat_f64x2_s_zero"
  1456  	OpcodeVecI32x4TruncSatF64x2UZeroName   = "i32x4.trunc_sat_f64x2_u_zero"
  1457  	OpcodeVecF64x2ConvertLowI32x4SName     = "f64x2.convert_low_i32x4_s"
  1458  	OpcodeVecF64x2ConvertLowI32x4UName     = "f64x2.convert_low_i32x4_u"
  1459  	OpcodeVecF32x4DemoteF64x2ZeroName      = "f32x4.demote_f64x2_zero"
  1460  	OpcodeVecF64x2PromoteLowF32x4ZeroName  = "f64x2.promote_low_f32x4"
  1461  )
  1462  
  1463  var vectorInstructionName = map[OpcodeVec]string{
  1464  	OpcodeVecV128Load:                  OpcodeVecV128LoadName,
  1465  	OpcodeVecV128Load8x8s:              OpcodeVecV128Load8x8SName,
  1466  	OpcodeVecV128Load8x8u:              OpcodeVecV128Load8x8UName,
  1467  	OpcodeVecV128Load16x4s:             OpcodeVecV128Load16x4SName,
  1468  	OpcodeVecV128Load16x4u:             OpcodeVecV128Load16x4UName,
  1469  	OpcodeVecV128Load32x2s:             OpcodeVecV128Load32x2SName,
  1470  	OpcodeVecV128Load32x2u:             OpcodeVecV128Load32x2UName,
  1471  	OpcodeVecV128Load8Splat:            OpcodeVecV128Load8SplatName,
  1472  	OpcodeVecV128Load16Splat:           OpcodeVecV128Load16SplatName,
  1473  	OpcodeVecV128Load32Splat:           OpcodeVecV128Load32SplatName,
  1474  	OpcodeVecV128Load64Splat:           OpcodeVecV128Load64SplatName,
  1475  	OpcodeVecV128Load32zero:            OpcodeVecV128Load32zeroName,
  1476  	OpcodeVecV128Load64zero:            OpcodeVecV128Load64zeroName,
  1477  	OpcodeVecV128Store:                 OpcodeVecV128StoreName,
  1478  	OpcodeVecV128Load8Lane:             OpcodeVecV128Load8LaneName,
  1479  	OpcodeVecV128Load16Lane:            OpcodeVecV128Load16LaneName,
  1480  	OpcodeVecV128Load32Lane:            OpcodeVecV128Load32LaneName,
  1481  	OpcodeVecV128Load64Lane:            OpcodeVecV128Load64LaneName,
  1482  	OpcodeVecV128Store8Lane:            OpcodeVecV128Store8LaneName,
  1483  	OpcodeVecV128Store16Lane:           OpcodeVecV128Store16LaneName,
  1484  	OpcodeVecV128Store32Lane:           OpcodeVecV128Store32LaneName,
  1485  	OpcodeVecV128Store64Lane:           OpcodeVecV128Store64LaneName,
  1486  	OpcodeVecV128Const:                 OpcodeVecV128ConstName,
  1487  	OpcodeVecV128i8x16Shuffle:          OpcodeVecV128i8x16ShuffleName,
  1488  	OpcodeVecI8x16ExtractLaneS:         OpcodeVecI8x16ExtractLaneSName,
  1489  	OpcodeVecI8x16ExtractLaneU:         OpcodeVecI8x16ExtractLaneUName,
  1490  	OpcodeVecI8x16ReplaceLane:          OpcodeVecI8x16ReplaceLaneName,
  1491  	OpcodeVecI16x8ExtractLaneS:         OpcodeVecI16x8ExtractLaneSName,
  1492  	OpcodeVecI16x8ExtractLaneU:         OpcodeVecI16x8ExtractLaneUName,
  1493  	OpcodeVecI16x8ReplaceLane:          OpcodeVecI16x8ReplaceLaneName,
  1494  	OpcodeVecI32x4ExtractLane:          OpcodeVecI32x4ExtractLaneName,
  1495  	OpcodeVecI32x4ReplaceLane:          OpcodeVecI32x4ReplaceLaneName,
  1496  	OpcodeVecI64x2ExtractLane:          OpcodeVecI64x2ExtractLaneName,
  1497  	OpcodeVecI64x2ReplaceLane:          OpcodeVecI64x2ReplaceLaneName,
  1498  	OpcodeVecF32x4ExtractLane:          OpcodeVecF32x4ExtractLaneName,
  1499  	OpcodeVecF32x4ReplaceLane:          OpcodeVecF32x4ReplaceLaneName,
  1500  	OpcodeVecF64x2ExtractLane:          OpcodeVecF64x2ExtractLaneName,
  1501  	OpcodeVecF64x2ReplaceLane:          OpcodeVecF64x2ReplaceLaneName,
  1502  	OpcodeVecI8x16Swizzle:              OpcodeVecI8x16SwizzleName,
  1503  	OpcodeVecI8x16Splat:                OpcodeVecI8x16SplatName,
  1504  	OpcodeVecI16x8Splat:                OpcodeVecI16x8SplatName,
  1505  	OpcodeVecI32x4Splat:                OpcodeVecI32x4SplatName,
  1506  	OpcodeVecI64x2Splat:                OpcodeVecI64x2SplatName,
  1507  	OpcodeVecF32x4Splat:                OpcodeVecF32x4SplatName,
  1508  	OpcodeVecF64x2Splat:                OpcodeVecF64x2SplatName,
  1509  	OpcodeVecI8x16Eq:                   OpcodeVecI8x16EqName,
  1510  	OpcodeVecI8x16Ne:                   OpcodeVecI8x16NeName,
  1511  	OpcodeVecI8x16LtS:                  OpcodeVecI8x16LtSName,
  1512  	OpcodeVecI8x16LtU:                  OpcodeVecI8x16LtUName,
  1513  	OpcodeVecI8x16GtS:                  OpcodeVecI8x16GtSName,
  1514  	OpcodeVecI8x16GtU:                  OpcodeVecI8x16GtUName,
  1515  	OpcodeVecI8x16LeS:                  OpcodeVecI8x16LeSName,
  1516  	OpcodeVecI8x16LeU:                  OpcodeVecI8x16LeUName,
  1517  	OpcodeVecI8x16GeS:                  OpcodeVecI8x16GeSName,
  1518  	OpcodeVecI8x16GeU:                  OpcodeVecI8x16GeUName,
  1519  	OpcodeVecI16x8Eq:                   OpcodeVecI16x8EqName,
  1520  	OpcodeVecI16x8Ne:                   OpcodeVecI16x8NeName,
  1521  	OpcodeVecI16x8LtS:                  OpcodeVecI16x8LtSName,
  1522  	OpcodeVecI16x8LtU:                  OpcodeVecI16x8LtUName,
  1523  	OpcodeVecI16x8GtS:                  OpcodeVecI16x8GtSName,
  1524  	OpcodeVecI16x8GtU:                  OpcodeVecI16x8GtUName,
  1525  	OpcodeVecI16x8LeS:                  OpcodeVecI16x8LeSName,
  1526  	OpcodeVecI16x8LeU:                  OpcodeVecI16x8LeUName,
  1527  	OpcodeVecI16x8GeS:                  OpcodeVecI16x8GeSName,
  1528  	OpcodeVecI16x8GeU:                  OpcodeVecI16x8GeUName,
  1529  	OpcodeVecI32x4Eq:                   OpcodeVecI32x4EqName,
  1530  	OpcodeVecI32x4Ne:                   OpcodeVecI32x4NeName,
  1531  	OpcodeVecI32x4LtS:                  OpcodeVecI32x4LtSName,
  1532  	OpcodeVecI32x4LtU:                  OpcodeVecI32x4LtUName,
  1533  	OpcodeVecI32x4GtS:                  OpcodeVecI32x4GtSName,
  1534  	OpcodeVecI32x4GtU:                  OpcodeVecI32x4GtUName,
  1535  	OpcodeVecI32x4LeS:                  OpcodeVecI32x4LeSName,
  1536  	OpcodeVecI32x4LeU:                  OpcodeVecI32x4LeUName,
  1537  	OpcodeVecI32x4GeS:                  OpcodeVecI32x4GeSName,
  1538  	OpcodeVecI32x4GeU:                  OpcodeVecI32x4GeUName,
  1539  	OpcodeVecI64x2Eq:                   OpcodeVecI64x2EqName,
  1540  	OpcodeVecI64x2Ne:                   OpcodeVecI64x2NeName,
  1541  	OpcodeVecI64x2LtS:                  OpcodeVecI64x2LtSName,
  1542  	OpcodeVecI64x2GtS:                  OpcodeVecI64x2GtSName,
  1543  	OpcodeVecI64x2LeS:                  OpcodeVecI64x2LeSName,
  1544  	OpcodeVecI64x2GeS:                  OpcodeVecI64x2GeSName,
  1545  	OpcodeVecF32x4Eq:                   OpcodeVecF32x4EqName,
  1546  	OpcodeVecF32x4Ne:                   OpcodeVecF32x4NeName,
  1547  	OpcodeVecF32x4Lt:                   OpcodeVecF32x4LtName,
  1548  	OpcodeVecF32x4Gt:                   OpcodeVecF32x4GtName,
  1549  	OpcodeVecF32x4Le:                   OpcodeVecF32x4LeName,
  1550  	OpcodeVecF32x4Ge:                   OpcodeVecF32x4GeName,
  1551  	OpcodeVecF64x2Eq:                   OpcodeVecF64x2EqName,
  1552  	OpcodeVecF64x2Ne:                   OpcodeVecF64x2NeName,
  1553  	OpcodeVecF64x2Lt:                   OpcodeVecF64x2LtName,
  1554  	OpcodeVecF64x2Gt:                   OpcodeVecF64x2GtName,
  1555  	OpcodeVecF64x2Le:                   OpcodeVecF64x2LeName,
  1556  	OpcodeVecF64x2Ge:                   OpcodeVecF64x2GeName,
  1557  	OpcodeVecV128Not:                   OpcodeVecV128NotName,
  1558  	OpcodeVecV128And:                   OpcodeVecV128AndName,
  1559  	OpcodeVecV128AndNot:                OpcodeVecV128AndNotName,
  1560  	OpcodeVecV128Or:                    OpcodeVecV128OrName,
  1561  	OpcodeVecV128Xor:                   OpcodeVecV128XorName,
  1562  	OpcodeVecV128Bitselect:             OpcodeVecV128BitselectName,
  1563  	OpcodeVecV128AnyTrue:               OpcodeVecV128AnyTrueName,
  1564  	OpcodeVecI8x16Abs:                  OpcodeVecI8x16AbsName,
  1565  	OpcodeVecI8x16Neg:                  OpcodeVecI8x16NegName,
  1566  	OpcodeVecI8x16Popcnt:               OpcodeVecI8x16PopcntName,
  1567  	OpcodeVecI8x16AllTrue:              OpcodeVecI8x16AllTrueName,
  1568  	OpcodeVecI8x16BitMask:              OpcodeVecI8x16BitMaskName,
  1569  	OpcodeVecI8x16NarrowI16x8S:         OpcodeVecI8x16NarrowI16x8SName,
  1570  	OpcodeVecI8x16NarrowI16x8U:         OpcodeVecI8x16NarrowI16x8UName,
  1571  	OpcodeVecI8x16Shl:                  OpcodeVecI8x16ShlName,
  1572  	OpcodeVecI8x16ShrS:                 OpcodeVecI8x16ShrSName,
  1573  	OpcodeVecI8x16ShrU:                 OpcodeVecI8x16ShrUName,
  1574  	OpcodeVecI8x16Add:                  OpcodeVecI8x16AddName,
  1575  	OpcodeVecI8x16AddSatS:              OpcodeVecI8x16AddSatSName,
  1576  	OpcodeVecI8x16AddSatU:              OpcodeVecI8x16AddSatUName,
  1577  	OpcodeVecI8x16Sub:                  OpcodeVecI8x16SubName,
  1578  	OpcodeVecI8x16SubSatS:              OpcodeVecI8x16SubSatSName,
  1579  	OpcodeVecI8x16SubSatU:              OpcodeVecI8x16SubSatUName,
  1580  	OpcodeVecI8x16MinS:                 OpcodeVecI8x16MinSName,
  1581  	OpcodeVecI8x16MinU:                 OpcodeVecI8x16MinUName,
  1582  	OpcodeVecI8x16MaxS:                 OpcodeVecI8x16MaxSName,
  1583  	OpcodeVecI8x16MaxU:                 OpcodeVecI8x16MaxUName,
  1584  	OpcodeVecI8x16AvgrU:                OpcodeVecI8x16AvgrUName,
  1585  	OpcodeVecI16x8ExtaddPairwiseI8x16S: OpcodeVecI16x8ExtaddPairwiseI8x16SName,
  1586  	OpcodeVecI16x8ExtaddPairwiseI8x16U: OpcodeVecI16x8ExtaddPairwiseI8x16UName,
  1587  	OpcodeVecI16x8Abs:                  OpcodeVecI16x8AbsName,
  1588  	OpcodeVecI16x8Neg:                  OpcodeVecI16x8NegName,
  1589  	OpcodeVecI16x8Q15mulrSatS:          OpcodeVecI16x8Q15mulrSatSName,
  1590  	OpcodeVecI16x8AllTrue:              OpcodeVecI16x8AllTrueName,
  1591  	OpcodeVecI16x8BitMask:              OpcodeVecI16x8BitMaskName,
  1592  	OpcodeVecI16x8NarrowI32x4S:         OpcodeVecI16x8NarrowI32x4SName,
  1593  	OpcodeVecI16x8NarrowI32x4U:         OpcodeVecI16x8NarrowI32x4UName,
  1594  	OpcodeVecI16x8ExtendLowI8x16S:      OpcodeVecI16x8ExtendLowI8x16SName,
  1595  	OpcodeVecI16x8ExtendHighI8x16S:     OpcodeVecI16x8ExtendHighI8x16SName,
  1596  	OpcodeVecI16x8ExtendLowI8x16U:      OpcodeVecI16x8ExtendLowI8x16UName,
  1597  	OpcodeVecI16x8ExtendHighI8x16U:     OpcodeVecI16x8ExtendHighI8x16UName,
  1598  	OpcodeVecI16x8Shl:                  OpcodeVecI16x8ShlName,
  1599  	OpcodeVecI16x8ShrS:                 OpcodeVecI16x8ShrSName,
  1600  	OpcodeVecI16x8ShrU:                 OpcodeVecI16x8ShrUName,
  1601  	OpcodeVecI16x8Add:                  OpcodeVecI16x8AddName,
  1602  	OpcodeVecI16x8AddSatS:              OpcodeVecI16x8AddSatSName,
  1603  	OpcodeVecI16x8AddSatU:              OpcodeVecI16x8AddSatUName,
  1604  	OpcodeVecI16x8Sub:                  OpcodeVecI16x8SubName,
  1605  	OpcodeVecI16x8SubSatS:              OpcodeVecI16x8SubSatSName,
  1606  	OpcodeVecI16x8SubSatU:              OpcodeVecI16x8SubSatUName,
  1607  	OpcodeVecI16x8Mul:                  OpcodeVecI16x8MulName,
  1608  	OpcodeVecI16x8MinS:                 OpcodeVecI16x8MinSName,
  1609  	OpcodeVecI16x8MinU:                 OpcodeVecI16x8MinUName,
  1610  	OpcodeVecI16x8MaxS:                 OpcodeVecI16x8MaxSName,
  1611  	OpcodeVecI16x8MaxU:                 OpcodeVecI16x8MaxUName,
  1612  	OpcodeVecI16x8AvgrU:                OpcodeVecI16x8AvgrUName,
  1613  	OpcodeVecI16x8ExtMulLowI8x16S:      OpcodeVecI16x8ExtMulLowI8x16SName,
  1614  	OpcodeVecI16x8ExtMulHighI8x16S:     OpcodeVecI16x8ExtMulHighI8x16SName,
  1615  	OpcodeVecI16x8ExtMulLowI8x16U:      OpcodeVecI16x8ExtMulLowI8x16UName,
  1616  	OpcodeVecI16x8ExtMulHighI8x16U:     OpcodeVecI16x8ExtMulHighI8x16UName,
  1617  	OpcodeVecI32x4ExtaddPairwiseI16x8S: OpcodeVecI32x4ExtaddPairwiseI16x8SName,
  1618  	OpcodeVecI32x4ExtaddPairwiseI16x8U: OpcodeVecI32x4ExtaddPairwiseI16x8UName,
  1619  	OpcodeVecI32x4Abs:                  OpcodeVecI32x4AbsName,
  1620  	OpcodeVecI32x4Neg:                  OpcodeVecI32x4NegName,
  1621  	OpcodeVecI32x4AllTrue:              OpcodeVecI32x4AllTrueName,
  1622  	OpcodeVecI32x4BitMask:              OpcodeVecI32x4BitMaskName,
  1623  	OpcodeVecI32x4ExtendLowI16x8S:      OpcodeVecI32x4ExtendLowI16x8SName,
  1624  	OpcodeVecI32x4ExtendHighI16x8S:     OpcodeVecI32x4ExtendHighI16x8SName,
  1625  	OpcodeVecI32x4ExtendLowI16x8U:      OpcodeVecI32x4ExtendLowI16x8UName,
  1626  	OpcodeVecI32x4ExtendHighI16x8U:     OpcodeVecI32x4ExtendHighI16x8UName,
  1627  	OpcodeVecI32x4Shl:                  OpcodeVecI32x4ShlName,
  1628  	OpcodeVecI32x4ShrS:                 OpcodeVecI32x4ShrSName,
  1629  	OpcodeVecI32x4ShrU:                 OpcodeVecI32x4ShrUName,
  1630  	OpcodeVecI32x4Add:                  OpcodeVecI32x4AddName,
  1631  	OpcodeVecI32x4Sub:                  OpcodeVecI32x4SubName,
  1632  	OpcodeVecI32x4Mul:                  OpcodeVecI32x4MulName,
  1633  	OpcodeVecI32x4MinS:                 OpcodeVecI32x4MinSName,
  1634  	OpcodeVecI32x4MinU:                 OpcodeVecI32x4MinUName,
  1635  	OpcodeVecI32x4MaxS:                 OpcodeVecI32x4MaxSName,
  1636  	OpcodeVecI32x4MaxU:                 OpcodeVecI32x4MaxUName,
  1637  	OpcodeVecI32x4DotI16x8S:            OpcodeVecI32x4DotI16x8SName,
  1638  	OpcodeVecI32x4ExtMulLowI16x8S:      OpcodeVecI32x4ExtMulLowI16x8SName,
  1639  	OpcodeVecI32x4ExtMulHighI16x8S:     OpcodeVecI32x4ExtMulHighI16x8SName,
  1640  	OpcodeVecI32x4ExtMulLowI16x8U:      OpcodeVecI32x4ExtMulLowI16x8UName,
  1641  	OpcodeVecI32x4ExtMulHighI16x8U:     OpcodeVecI32x4ExtMulHighI16x8UName,
  1642  	OpcodeVecI64x2Abs:                  OpcodeVecI64x2AbsName,
  1643  	OpcodeVecI64x2Neg:                  OpcodeVecI64x2NegName,
  1644  	OpcodeVecI64x2AllTrue:              OpcodeVecI64x2AllTrueName,
  1645  	OpcodeVecI64x2BitMask:              OpcodeVecI64x2BitMaskName,
  1646  	OpcodeVecI64x2ExtendLowI32x4S:      OpcodeVecI64x2ExtendLowI32x4SName,
  1647  	OpcodeVecI64x2ExtendHighI32x4S:     OpcodeVecI64x2ExtendHighI32x4SName,
  1648  	OpcodeVecI64x2ExtendLowI32x4U:      OpcodeVecI64x2ExtendLowI32x4UName,
  1649  	OpcodeVecI64x2ExtendHighI32x4U:     OpcodeVecI64x2ExtendHighI32x4UName,
  1650  	OpcodeVecI64x2Shl:                  OpcodeVecI64x2ShlName,
  1651  	OpcodeVecI64x2ShrS:                 OpcodeVecI64x2ShrSName,
  1652  	OpcodeVecI64x2ShrU:                 OpcodeVecI64x2ShrUName,
  1653  	OpcodeVecI64x2Add:                  OpcodeVecI64x2AddName,
  1654  	OpcodeVecI64x2Sub:                  OpcodeVecI64x2SubName,
  1655  	OpcodeVecI64x2Mul:                  OpcodeVecI64x2MulName,
  1656  	OpcodeVecI64x2ExtMulLowI32x4S:      OpcodeVecI64x2ExtMulLowI32x4SName,
  1657  	OpcodeVecI64x2ExtMulHighI32x4S:     OpcodeVecI64x2ExtMulHighI32x4SName,
  1658  	OpcodeVecI64x2ExtMulLowI32x4U:      OpcodeVecI64x2ExtMulLowI32x4UName,
  1659  	OpcodeVecI64x2ExtMulHighI32x4U:     OpcodeVecI64x2ExtMulHighI32x4UName,
  1660  	OpcodeVecF32x4Ceil:                 OpcodeVecF32x4CeilName,
  1661  	OpcodeVecF32x4Floor:                OpcodeVecF32x4FloorName,
  1662  	OpcodeVecF32x4Trunc:                OpcodeVecF32x4TruncName,
  1663  	OpcodeVecF32x4Nearest:              OpcodeVecF32x4NearestName,
  1664  	OpcodeVecF32x4Abs:                  OpcodeVecF32x4AbsName,
  1665  	OpcodeVecF32x4Neg:                  OpcodeVecF32x4NegName,
  1666  	OpcodeVecF32x4Sqrt:                 OpcodeVecF32x4SqrtName,
  1667  	OpcodeVecF32x4Add:                  OpcodeVecF32x4AddName,
  1668  	OpcodeVecF32x4Sub:                  OpcodeVecF32x4SubName,
  1669  	OpcodeVecF32x4Mul:                  OpcodeVecF32x4MulName,
  1670  	OpcodeVecF32x4Div:                  OpcodeVecF32x4DivName,
  1671  	OpcodeVecF32x4Min:                  OpcodeVecF32x4MinName,
  1672  	OpcodeVecF32x4Max:                  OpcodeVecF32x4MaxName,
  1673  	OpcodeVecF32x4Pmin:                 OpcodeVecF32x4PminName,
  1674  	OpcodeVecF32x4Pmax:                 OpcodeVecF32x4PmaxName,
  1675  	OpcodeVecF64x2Ceil:                 OpcodeVecF64x2CeilName,
  1676  	OpcodeVecF64x2Floor:                OpcodeVecF64x2FloorName,
  1677  	OpcodeVecF64x2Trunc:                OpcodeVecF64x2TruncName,
  1678  	OpcodeVecF64x2Nearest:              OpcodeVecF64x2NearestName,
  1679  	OpcodeVecF64x2Abs:                  OpcodeVecF64x2AbsName,
  1680  	OpcodeVecF64x2Neg:                  OpcodeVecF64x2NegName,
  1681  	OpcodeVecF64x2Sqrt:                 OpcodeVecF64x2SqrtName,
  1682  	OpcodeVecF64x2Add:                  OpcodeVecF64x2AddName,
  1683  	OpcodeVecF64x2Sub:                  OpcodeVecF64x2SubName,
  1684  	OpcodeVecF64x2Mul:                  OpcodeVecF64x2MulName,
  1685  	OpcodeVecF64x2Div:                  OpcodeVecF64x2DivName,
  1686  	OpcodeVecF64x2Min:                  OpcodeVecF64x2MinName,
  1687  	OpcodeVecF64x2Max:                  OpcodeVecF64x2MaxName,
  1688  	OpcodeVecF64x2Pmin:                 OpcodeVecF64x2PminName,
  1689  	OpcodeVecF64x2Pmax:                 OpcodeVecF64x2PmaxName,
  1690  	OpcodeVecI32x4TruncSatF32x4S:       OpcodeVecI32x4TruncSatF32x4SName,
  1691  	OpcodeVecI32x4TruncSatF32x4U:       OpcodeVecI32x4TruncSatF32x4UName,
  1692  	OpcodeVecF32x4ConvertI32x4S:        OpcodeVecF32x4ConvertI32x4SName,
  1693  	OpcodeVecF32x4ConvertI32x4U:        OpcodeVecF32x4ConvertI32x4UName,
  1694  	OpcodeVecI32x4TruncSatF64x2SZero:   OpcodeVecI32x4TruncSatF64x2SZeroName,
  1695  	OpcodeVecI32x4TruncSatF64x2UZero:   OpcodeVecI32x4TruncSatF64x2UZeroName,
  1696  	OpcodeVecF64x2ConvertLowI32x4S:     OpcodeVecF64x2ConvertLowI32x4SName,
  1697  	OpcodeVecF64x2ConvertLowI32x4U:     OpcodeVecF64x2ConvertLowI32x4UName,
  1698  	OpcodeVecF32x4DemoteF64x2Zero:      OpcodeVecF32x4DemoteF64x2ZeroName,
  1699  	OpcodeVecF64x2PromoteLowF32x4Zero:  OpcodeVecF64x2PromoteLowF32x4ZeroName,
  1700  }
  1701  
  1702  // VectorInstructionName returns the instruction name corresponding to the vector Opcode.
  1703  func VectorInstructionName(oc OpcodeVec) (ret string) {
  1704  	return vectorInstructionName[oc]
  1705  }
  1706  
  1707  const (
  1708  	OpcodeAtomicMemoryNotifyName = "memory.atomic.notify"
  1709  	OpcodeAtomicMemoryWait32Name = "memory.atomic.wait32"
  1710  	OpcodeAtomicMemoryWait64Name = "memory.atomic.wait64"
  1711  	OpcodeAtomicFenceName        = "atomic.fence"
  1712  
  1713  	OpcodeAtomicI32LoadName    = "i32.atomic.load"
  1714  	OpcodeAtomicI64LoadName    = "i64.atomic.load"
  1715  	OpcodeAtomicI32Load8UName  = "i32.atomic.load8_u"
  1716  	OpcodeAtomicI32Load16UName = "i32.atomic.load16_u"
  1717  	OpcodeAtomicI64Load8UName  = "i64.atomic.load8_u"
  1718  	OpcodeAtomicI64Load16UName = "i64.atomic.load16_u"
  1719  	OpcodeAtomicI64Load32UName = "i64.atomic.load32_u"
  1720  	OpcodeAtomicI32StoreName   = "i32.atomic.store"
  1721  	OpcodeAtomicI64StoreName   = "i64.atomic.store"
  1722  	OpcodeAtomicI32Store8Name  = "i32.atomic.store8"
  1723  	OpcodeAtomicI32Store16Name = "i32.atomic.store16"
  1724  	OpcodeAtomicI64Store8Name  = "i64.atomic.store8"
  1725  	OpcodeAtomicI64Store16Name = "i64.atomic.store16"
  1726  	OpcodeAtomicI64Store32Name = "i64.atomic.store32"
  1727  
  1728  	OpcodeAtomicI32RmwAddName    = "i32.atomic.rmw.add"
  1729  	OpcodeAtomicI64RmwAddName    = "i64.atomic.rmw.add"
  1730  	OpcodeAtomicI32Rmw8AddUName  = "i32.atomic.rmw8.add_u"
  1731  	OpcodeAtomicI32Rmw16AddUName = "i32.atomic.rmw16.add_u"
  1732  	OpcodeAtomicI64Rmw8AddUName  = "i64.atomic.rmw8.add_u"
  1733  	OpcodeAtomicI64Rmw16AddUName = "i64.atomic.rmw16.add_u"
  1734  	OpcodeAtomicI64Rmw32AddUName = "i64.atomic.rmw32.add_u"
  1735  
  1736  	OpcodeAtomicI32RmwSubName    = "i32.atomic.rmw.sub"
  1737  	OpcodeAtomicI64RmwSubName    = "i64.atomic.rmw.sub"
  1738  	OpcodeAtomicI32Rmw8SubUName  = "i32.atomic.rmw8.sub_u"
  1739  	OpcodeAtomicI32Rmw16SubUName = "i32.atomic.rmw16.sub_u"
  1740  	OpcodeAtomicI64Rmw8SubUName  = "i64.atomic.rmw8.sub_u"
  1741  	OpcodeAtomicI64Rmw16SubUName = "i64.atomic.rmw16.sub_u"
  1742  	OpcodeAtomicI64Rmw32SubUName = "i64.atomic.rmw32.sub_u"
  1743  
  1744  	OpcodeAtomicI32RmwAndName    = "i32.atomic.rmw.and"
  1745  	OpcodeAtomicI64RmwAndName    = "i64.atomic.rmw.and"
  1746  	OpcodeAtomicI32Rmw8AndUName  = "i32.atomic.rmw8.and_u"
  1747  	OpcodeAtomicI32Rmw16AndUName = "i32.atomic.rmw16.and_u"
  1748  	OpcodeAtomicI64Rmw8AndUName  = "i64.atomic.rmw8.and_u"
  1749  	OpcodeAtomicI64Rmw16AndUName = "i64.atomic.rmw16.and_u"
  1750  	OpcodeAtomicI64Rmw32AndUName = "i64.atomic.rmw32.and_u"
  1751  
  1752  	OpcodeAtomicI32RmwOrName    = "i32.atomic.rmw.or"
  1753  	OpcodeAtomicI64RmwOrName    = "i64.atomic.rmw.or"
  1754  	OpcodeAtomicI32Rmw8OrUName  = "i32.atomic.rmw8.or_u"
  1755  	OpcodeAtomicI32Rmw16OrUName = "i32.atomic.rmw16.or_u"
  1756  	OpcodeAtomicI64Rmw8OrUName  = "i64.atomic.rmw8.or_u"
  1757  	OpcodeAtomicI64Rmw16OrUName = "i64.atomic.rmw16.or_u"
  1758  	OpcodeAtomicI64Rmw32OrUName = "i64.atomic.rmw32.or_u"
  1759  
  1760  	OpcodeAtomicI32RmwXorName    = "i32.atomic.rmw.xor"
  1761  	OpcodeAtomicI64RmwXorName    = "i64.atomic.rmw.xor"
  1762  	OpcodeAtomicI32Rmw8XorUName  = "i32.atomic.rmw8.xor_u"
  1763  	OpcodeAtomicI32Rmw16XorUName = "i32.atomic.rmw16.xor_u"
  1764  	OpcodeAtomicI64Rmw8XorUName  = "i64.atomic.rmw8.xor_u"
  1765  	OpcodeAtomicI64Rmw16XorUName = "i64.atomic.rmw16.xor_u"
  1766  	OpcodeAtomicI64Rmw32XorUName = "i64.atomic.rmw32.xor_u"
  1767  
  1768  	OpcodeAtomicI32RmwXchgName    = "i32.atomic.rmw.xchg"
  1769  	OpcodeAtomicI64RmwXchgName    = "i64.atomic.rmw.xchg"
  1770  	OpcodeAtomicI32Rmw8XchgUName  = "i32.atomic.rmw8.xchg_u"
  1771  	OpcodeAtomicI32Rmw16XchgUName = "i32.atomic.rmw16.xchg_u"
  1772  	OpcodeAtomicI64Rmw8XchgUName  = "i64.atomic.rmw8.xchg_u"
  1773  	OpcodeAtomicI64Rmw16XchgUName = "i64.atomic.rmw16.xchg_u"
  1774  	OpcodeAtomicI64Rmw32XchgUName = "i64.atomic.rmw32.xchg_u"
  1775  
  1776  	OpcodeAtomicI32RmwCmpxchgName    = "i32.atomic.rmw.cmpxchg"
  1777  	OpcodeAtomicI64RmwCmpxchgName    = "i64.atomic.rmw.cmpxchg"
  1778  	OpcodeAtomicI32Rmw8CmpxchgUName  = "i32.atomic.rmw8.cmpxchg_u"
  1779  	OpcodeAtomicI32Rmw16CmpxchgUName = "i32.atomic.rmw16.cmpxchg_u"
  1780  	OpcodeAtomicI64Rmw8CmpxchgUName  = "i64.atomic.rmw8.cmpxchg_u"
  1781  	OpcodeAtomicI64Rmw16CmpxchgUName = "i64.atomic.rmw16.cmpxchg_u"
  1782  	OpcodeAtomicI64Rmw32CmpxchgUName = "i64.atomic.rmw32.cmpxchg_u"
  1783  )
  1784  
  1785  var atomicInstructionName = map[OpcodeAtomic]string{
  1786  	OpcodeAtomicMemoryNotify: OpcodeAtomicMemoryNotifyName,
  1787  	OpcodeAtomicMemoryWait32: OpcodeAtomicMemoryWait32Name,
  1788  	OpcodeAtomicMemoryWait64: OpcodeAtomicMemoryWait64Name,
  1789  	OpcodeAtomicFence:        OpcodeAtomicFenceName,
  1790  
  1791  	OpcodeAtomicI32Load:    OpcodeAtomicI32LoadName,
  1792  	OpcodeAtomicI64Load:    OpcodeAtomicI64LoadName,
  1793  	OpcodeAtomicI32Load8U:  OpcodeAtomicI32Load8UName,
  1794  	OpcodeAtomicI32Load16U: OpcodeAtomicI32Load16UName,
  1795  	OpcodeAtomicI64Load8U:  OpcodeAtomicI64Load8UName,
  1796  	OpcodeAtomicI64Load16U: OpcodeAtomicI64Load16UName,
  1797  	OpcodeAtomicI64Load32U: OpcodeAtomicI64Load32UName,
  1798  	OpcodeAtomicI32Store:   OpcodeAtomicI32StoreName,
  1799  	OpcodeAtomicI64Store:   OpcodeAtomicI64StoreName,
  1800  	OpcodeAtomicI32Store8:  OpcodeAtomicI32Store8Name,
  1801  	OpcodeAtomicI32Store16: OpcodeAtomicI32Store16Name,
  1802  	OpcodeAtomicI64Store8:  OpcodeAtomicI64Store8Name,
  1803  	OpcodeAtomicI64Store16: OpcodeAtomicI64Store16Name,
  1804  	OpcodeAtomicI64Store32: OpcodeAtomicI64Store32Name,
  1805  
  1806  	OpcodeAtomicI32RmwAdd:    OpcodeAtomicI32RmwAddName,
  1807  	OpcodeAtomicI64RmwAdd:    OpcodeAtomicI64RmwAddName,
  1808  	OpcodeAtomicI32Rmw8AddU:  OpcodeAtomicI32Rmw8AddUName,
  1809  	OpcodeAtomicI32Rmw16AddU: OpcodeAtomicI32Rmw16AddUName,
  1810  	OpcodeAtomicI64Rmw8AddU:  OpcodeAtomicI64Rmw8AddUName,
  1811  	OpcodeAtomicI64Rmw16AddU: OpcodeAtomicI64Rmw16AddUName,
  1812  	OpcodeAtomicI64Rmw32AddU: OpcodeAtomicI64Rmw32AddUName,
  1813  
  1814  	OpcodeAtomicI32RmwSub:    OpcodeAtomicI32RmwSubName,
  1815  	OpcodeAtomicI64RmwSub:    OpcodeAtomicI64RmwSubName,
  1816  	OpcodeAtomicI32Rmw8SubU:  OpcodeAtomicI32Rmw8SubUName,
  1817  	OpcodeAtomicI32Rmw16SubU: OpcodeAtomicI32Rmw16SubUName,
  1818  	OpcodeAtomicI64Rmw8SubU:  OpcodeAtomicI64Rmw8SubUName,
  1819  	OpcodeAtomicI64Rmw16SubU: OpcodeAtomicI64Rmw16SubUName,
  1820  	OpcodeAtomicI64Rmw32SubU: OpcodeAtomicI64Rmw32SubUName,
  1821  
  1822  	OpcodeAtomicI32RmwAnd:    OpcodeAtomicI32RmwAndName,
  1823  	OpcodeAtomicI64RmwAnd:    OpcodeAtomicI64RmwAndName,
  1824  	OpcodeAtomicI32Rmw8AndU:  OpcodeAtomicI32Rmw8AndUName,
  1825  	OpcodeAtomicI32Rmw16AndU: OpcodeAtomicI32Rmw16AndUName,
  1826  	OpcodeAtomicI64Rmw8AndU:  OpcodeAtomicI64Rmw8AndUName,
  1827  	OpcodeAtomicI64Rmw16AndU: OpcodeAtomicI64Rmw16AndUName,
  1828  	OpcodeAtomicI64Rmw32AndU: OpcodeAtomicI64Rmw32AndUName,
  1829  
  1830  	OpcodeAtomicI32RmwOr:    OpcodeAtomicI32RmwOrName,
  1831  	OpcodeAtomicI64RmwOr:    OpcodeAtomicI64RmwOrName,
  1832  	OpcodeAtomicI32Rmw8OrU:  OpcodeAtomicI32Rmw8OrUName,
  1833  	OpcodeAtomicI32Rmw16OrU: OpcodeAtomicI32Rmw16OrUName,
  1834  	OpcodeAtomicI64Rmw8OrU:  OpcodeAtomicI64Rmw8OrUName,
  1835  	OpcodeAtomicI64Rmw16OrU: OpcodeAtomicI64Rmw16OrUName,
  1836  	OpcodeAtomicI64Rmw32OrU: OpcodeAtomicI64Rmw32OrUName,
  1837  
  1838  	OpcodeAtomicI32RmwXor:    OpcodeAtomicI32RmwXorName,
  1839  	OpcodeAtomicI64RmwXor:    OpcodeAtomicI64RmwXorName,
  1840  	OpcodeAtomicI32Rmw8XorU:  OpcodeAtomicI32Rmw8XorUName,
  1841  	OpcodeAtomicI32Rmw16XorU: OpcodeAtomicI32Rmw16XorUName,
  1842  	OpcodeAtomicI64Rmw8XorU:  OpcodeAtomicI64Rmw8XorUName,
  1843  	OpcodeAtomicI64Rmw16XorU: OpcodeAtomicI64Rmw16XorUName,
  1844  	OpcodeAtomicI64Rmw32XorU: OpcodeAtomicI64Rmw32XorUName,
  1845  
  1846  	OpcodeAtomicI32RmwXchg:    OpcodeAtomicI32RmwXchgName,
  1847  	OpcodeAtomicI64RmwXchg:    OpcodeAtomicI64RmwXchgName,
  1848  	OpcodeAtomicI32Rmw8XchgU:  OpcodeAtomicI32Rmw8XchgUName,
  1849  	OpcodeAtomicI32Rmw16XchgU: OpcodeAtomicI32Rmw16XchgUName,
  1850  	OpcodeAtomicI64Rmw8XchgU:  OpcodeAtomicI64Rmw8XchgUName,
  1851  	OpcodeAtomicI64Rmw16XchgU: OpcodeAtomicI64Rmw16XchgUName,
  1852  	OpcodeAtomicI64Rmw32XchgU: OpcodeAtomicI64Rmw32XchgUName,
  1853  
  1854  	OpcodeAtomicI32RmwCmpxchg:    OpcodeAtomicI32RmwCmpxchgName,
  1855  	OpcodeAtomicI64RmwCmpxchg:    OpcodeAtomicI64RmwCmpxchgName,
  1856  	OpcodeAtomicI32Rmw8CmpxchgU:  OpcodeAtomicI32Rmw8CmpxchgUName,
  1857  	OpcodeAtomicI32Rmw16CmpxchgU: OpcodeAtomicI32Rmw16CmpxchgUName,
  1858  	OpcodeAtomicI64Rmw8CmpxchgU:  OpcodeAtomicI64Rmw8CmpxchgUName,
  1859  	OpcodeAtomicI64Rmw16CmpxchgU: OpcodeAtomicI64Rmw16CmpxchgUName,
  1860  	OpcodeAtomicI64Rmw32CmpxchgU: OpcodeAtomicI64Rmw32CmpxchgUName,
  1861  }
  1862  
  1863  // AtomicInstructionName returns the instruction name corresponding to the atomic Opcode.
  1864  func AtomicInstructionName(oc OpcodeAtomic) (ret string) {
  1865  	return atomicInstructionName[oc]
  1866  }