Source file src/cmd/compile/internal/ssa/rewriteWasm.go

     1  // Code generated from _gen/Wasm.rules using 'go generate'; DO NOT EDIT.
     2  
     3  package ssa
     4  
     5  import "math"
     6  import "cmd/compile/internal/types"
     7  
     8  func rewriteValueWasm(v *Value) bool {
     9  	switch v.Op {
    10  	case OpAbs:
    11  		v.Op = OpWasmF64Abs
    12  		return true
    13  	case OpAdd16:
    14  		v.Op = OpWasmI64Add
    15  		return true
    16  	case OpAdd32:
    17  		v.Op = OpWasmI64Add
    18  		return true
    19  	case OpAdd32F:
    20  		v.Op = OpWasmF32Add
    21  		return true
    22  	case OpAdd64:
    23  		v.Op = OpWasmI64Add
    24  		return true
    25  	case OpAdd64F:
    26  		v.Op = OpWasmF64Add
    27  		return true
    28  	case OpAdd8:
    29  		v.Op = OpWasmI64Add
    30  		return true
    31  	case OpAddPtr:
    32  		v.Op = OpWasmI64Add
    33  		return true
    34  	case OpAddr:
    35  		return rewriteValueWasm_OpAddr(v)
    36  	case OpAnd16:
    37  		v.Op = OpWasmI64And
    38  		return true
    39  	case OpAnd32:
    40  		v.Op = OpWasmI64And
    41  		return true
    42  	case OpAnd64:
    43  		v.Op = OpWasmI64And
    44  		return true
    45  	case OpAnd8:
    46  		v.Op = OpWasmI64And
    47  		return true
    48  	case OpAndB:
    49  		v.Op = OpWasmI64And
    50  		return true
    51  	case OpAvg64u:
    52  		return rewriteValueWasm_OpAvg64u(v)
    53  	case OpBitLen16:
    54  		return rewriteValueWasm_OpBitLen16(v)
    55  	case OpBitLen32:
    56  		return rewriteValueWasm_OpBitLen32(v)
    57  	case OpBitLen64:
    58  		return rewriteValueWasm_OpBitLen64(v)
    59  	case OpBitLen8:
    60  		return rewriteValueWasm_OpBitLen8(v)
    61  	case OpCeil:
    62  		v.Op = OpWasmF64Ceil
    63  		return true
    64  	case OpClosureCall:
    65  		v.Op = OpWasmLoweredClosureCall
    66  		return true
    67  	case OpCom16:
    68  		return rewriteValueWasm_OpCom16(v)
    69  	case OpCom32:
    70  		return rewriteValueWasm_OpCom32(v)
    71  	case OpCom64:
    72  		return rewriteValueWasm_OpCom64(v)
    73  	case OpCom8:
    74  		return rewriteValueWasm_OpCom8(v)
    75  	case OpCondSelect:
    76  		v.Op = OpWasmSelect
    77  		return true
    78  	case OpConst16:
    79  		return rewriteValueWasm_OpConst16(v)
    80  	case OpConst32:
    81  		return rewriteValueWasm_OpConst32(v)
    82  	case OpConst32F:
    83  		v.Op = OpWasmF32Const
    84  		return true
    85  	case OpConst64:
    86  		v.Op = OpWasmI64Const
    87  		return true
    88  	case OpConst64F:
    89  		v.Op = OpWasmF64Const
    90  		return true
    91  	case OpConst8:
    92  		return rewriteValueWasm_OpConst8(v)
    93  	case OpConstBool:
    94  		return rewriteValueWasm_OpConstBool(v)
    95  	case OpConstNil:
    96  		return rewriteValueWasm_OpConstNil(v)
    97  	case OpConvert:
    98  		v.Op = OpWasmLoweredConvert
    99  		return true
   100  	case OpCopysign:
   101  		v.Op = OpWasmF64Copysign
   102  		return true
   103  	case OpCtz16:
   104  		return rewriteValueWasm_OpCtz16(v)
   105  	case OpCtz16NonZero:
   106  		v.Op = OpWasmI64Ctz
   107  		return true
   108  	case OpCtz32:
   109  		return rewriteValueWasm_OpCtz32(v)
   110  	case OpCtz32NonZero:
   111  		v.Op = OpWasmI64Ctz
   112  		return true
   113  	case OpCtz64:
   114  		v.Op = OpWasmI64Ctz
   115  		return true
   116  	case OpCtz64NonZero:
   117  		v.Op = OpWasmI64Ctz
   118  		return true
   119  	case OpCtz8:
   120  		return rewriteValueWasm_OpCtz8(v)
   121  	case OpCtz8NonZero:
   122  		v.Op = OpWasmI64Ctz
   123  		return true
   124  	case OpCvt32Fto32:
   125  		v.Op = OpWasmI64TruncSatF32S
   126  		return true
   127  	case OpCvt32Fto32U:
   128  		v.Op = OpWasmI64TruncSatF32U
   129  		return true
   130  	case OpCvt32Fto64:
   131  		v.Op = OpWasmI64TruncSatF32S
   132  		return true
   133  	case OpCvt32Fto64F:
   134  		v.Op = OpWasmF64PromoteF32
   135  		return true
   136  	case OpCvt32Fto64U:
   137  		v.Op = OpWasmI64TruncSatF32U
   138  		return true
   139  	case OpCvt32Uto32F:
   140  		return rewriteValueWasm_OpCvt32Uto32F(v)
   141  	case OpCvt32Uto64F:
   142  		return rewriteValueWasm_OpCvt32Uto64F(v)
   143  	case OpCvt32to32F:
   144  		return rewriteValueWasm_OpCvt32to32F(v)
   145  	case OpCvt32to64F:
   146  		return rewriteValueWasm_OpCvt32to64F(v)
   147  	case OpCvt64Fto32:
   148  		v.Op = OpWasmI64TruncSatF64S
   149  		return true
   150  	case OpCvt64Fto32F:
   151  		v.Op = OpWasmF32DemoteF64
   152  		return true
   153  	case OpCvt64Fto32U:
   154  		v.Op = OpWasmI64TruncSatF64U
   155  		return true
   156  	case OpCvt64Fto64:
   157  		v.Op = OpWasmI64TruncSatF64S
   158  		return true
   159  	case OpCvt64Fto64U:
   160  		v.Op = OpWasmI64TruncSatF64U
   161  		return true
   162  	case OpCvt64Uto32F:
   163  		v.Op = OpWasmF32ConvertI64U
   164  		return true
   165  	case OpCvt64Uto64F:
   166  		v.Op = OpWasmF64ConvertI64U
   167  		return true
   168  	case OpCvt64to32F:
   169  		v.Op = OpWasmF32ConvertI64S
   170  		return true
   171  	case OpCvt64to64F:
   172  		v.Op = OpWasmF64ConvertI64S
   173  		return true
   174  	case OpCvtBoolToUint8:
   175  		v.Op = OpCopy
   176  		return true
   177  	case OpDiv16:
   178  		return rewriteValueWasm_OpDiv16(v)
   179  	case OpDiv16u:
   180  		return rewriteValueWasm_OpDiv16u(v)
   181  	case OpDiv32:
   182  		return rewriteValueWasm_OpDiv32(v)
   183  	case OpDiv32F:
   184  		v.Op = OpWasmF32Div
   185  		return true
   186  	case OpDiv32u:
   187  		return rewriteValueWasm_OpDiv32u(v)
   188  	case OpDiv64:
   189  		return rewriteValueWasm_OpDiv64(v)
   190  	case OpDiv64F:
   191  		v.Op = OpWasmF64Div
   192  		return true
   193  	case OpDiv64u:
   194  		v.Op = OpWasmI64DivU
   195  		return true
   196  	case OpDiv8:
   197  		return rewriteValueWasm_OpDiv8(v)
   198  	case OpDiv8u:
   199  		return rewriteValueWasm_OpDiv8u(v)
   200  	case OpEq16:
   201  		return rewriteValueWasm_OpEq16(v)
   202  	case OpEq32:
   203  		return rewriteValueWasm_OpEq32(v)
   204  	case OpEq32F:
   205  		v.Op = OpWasmF32Eq
   206  		return true
   207  	case OpEq64:
   208  		v.Op = OpWasmI64Eq
   209  		return true
   210  	case OpEq64F:
   211  		v.Op = OpWasmF64Eq
   212  		return true
   213  	case OpEq8:
   214  		return rewriteValueWasm_OpEq8(v)
   215  	case OpEqB:
   216  		v.Op = OpWasmI64Eq
   217  		return true
   218  	case OpEqPtr:
   219  		v.Op = OpWasmI64Eq
   220  		return true
   221  	case OpFloor:
   222  		v.Op = OpWasmF64Floor
   223  		return true
   224  	case OpGetCallerPC:
   225  		v.Op = OpWasmLoweredGetCallerPC
   226  		return true
   227  	case OpGetCallerSP:
   228  		v.Op = OpWasmLoweredGetCallerSP
   229  		return true
   230  	case OpGetClosurePtr:
   231  		v.Op = OpWasmLoweredGetClosurePtr
   232  		return true
   233  	case OpHmul64:
   234  		return rewriteValueWasm_OpHmul64(v)
   235  	case OpHmul64u:
   236  		return rewriteValueWasm_OpHmul64u(v)
   237  	case OpInterCall:
   238  		v.Op = OpWasmLoweredInterCall
   239  		return true
   240  	case OpIsInBounds:
   241  		v.Op = OpWasmI64LtU
   242  		return true
   243  	case OpIsNonNil:
   244  		return rewriteValueWasm_OpIsNonNil(v)
   245  	case OpIsSliceInBounds:
   246  		v.Op = OpWasmI64LeU
   247  		return true
   248  	case OpLast:
   249  		return rewriteValueWasm_OpLast(v)
   250  	case OpLeq16:
   251  		return rewriteValueWasm_OpLeq16(v)
   252  	case OpLeq16U:
   253  		return rewriteValueWasm_OpLeq16U(v)
   254  	case OpLeq32:
   255  		return rewriteValueWasm_OpLeq32(v)
   256  	case OpLeq32F:
   257  		v.Op = OpWasmF32Le
   258  		return true
   259  	case OpLeq32U:
   260  		return rewriteValueWasm_OpLeq32U(v)
   261  	case OpLeq64:
   262  		v.Op = OpWasmI64LeS
   263  		return true
   264  	case OpLeq64F:
   265  		v.Op = OpWasmF64Le
   266  		return true
   267  	case OpLeq64U:
   268  		v.Op = OpWasmI64LeU
   269  		return true
   270  	case OpLeq8:
   271  		return rewriteValueWasm_OpLeq8(v)
   272  	case OpLeq8U:
   273  		return rewriteValueWasm_OpLeq8U(v)
   274  	case OpLess16:
   275  		return rewriteValueWasm_OpLess16(v)
   276  	case OpLess16U:
   277  		return rewriteValueWasm_OpLess16U(v)
   278  	case OpLess32:
   279  		return rewriteValueWasm_OpLess32(v)
   280  	case OpLess32F:
   281  		v.Op = OpWasmF32Lt
   282  		return true
   283  	case OpLess32U:
   284  		return rewriteValueWasm_OpLess32U(v)
   285  	case OpLess64:
   286  		v.Op = OpWasmI64LtS
   287  		return true
   288  	case OpLess64F:
   289  		v.Op = OpWasmF64Lt
   290  		return true
   291  	case OpLess64U:
   292  		v.Op = OpWasmI64LtU
   293  		return true
   294  	case OpLess8:
   295  		return rewriteValueWasm_OpLess8(v)
   296  	case OpLess8U:
   297  		return rewriteValueWasm_OpLess8U(v)
   298  	case OpLoad:
   299  		return rewriteValueWasm_OpLoad(v)
   300  	case OpLocalAddr:
   301  		return rewriteValueWasm_OpLocalAddr(v)
   302  	case OpLsh16x16:
   303  		return rewriteValueWasm_OpLsh16x16(v)
   304  	case OpLsh16x32:
   305  		return rewriteValueWasm_OpLsh16x32(v)
   306  	case OpLsh16x64:
   307  		v.Op = OpLsh64x64
   308  		return true
   309  	case OpLsh16x8:
   310  		return rewriteValueWasm_OpLsh16x8(v)
   311  	case OpLsh32x16:
   312  		return rewriteValueWasm_OpLsh32x16(v)
   313  	case OpLsh32x32:
   314  		return rewriteValueWasm_OpLsh32x32(v)
   315  	case OpLsh32x64:
   316  		v.Op = OpLsh64x64
   317  		return true
   318  	case OpLsh32x8:
   319  		return rewriteValueWasm_OpLsh32x8(v)
   320  	case OpLsh64x16:
   321  		return rewriteValueWasm_OpLsh64x16(v)
   322  	case OpLsh64x32:
   323  		return rewriteValueWasm_OpLsh64x32(v)
   324  	case OpLsh64x64:
   325  		return rewriteValueWasm_OpLsh64x64(v)
   326  	case OpLsh64x8:
   327  		return rewriteValueWasm_OpLsh64x8(v)
   328  	case OpLsh8x16:
   329  		return rewriteValueWasm_OpLsh8x16(v)
   330  	case OpLsh8x32:
   331  		return rewriteValueWasm_OpLsh8x32(v)
   332  	case OpLsh8x64:
   333  		v.Op = OpLsh64x64
   334  		return true
   335  	case OpLsh8x8:
   336  		return rewriteValueWasm_OpLsh8x8(v)
   337  	case OpMod16:
   338  		return rewriteValueWasm_OpMod16(v)
   339  	case OpMod16u:
   340  		return rewriteValueWasm_OpMod16u(v)
   341  	case OpMod32:
   342  		return rewriteValueWasm_OpMod32(v)
   343  	case OpMod32u:
   344  		return rewriteValueWasm_OpMod32u(v)
   345  	case OpMod64:
   346  		return rewriteValueWasm_OpMod64(v)
   347  	case OpMod64u:
   348  		v.Op = OpWasmI64RemU
   349  		return true
   350  	case OpMod8:
   351  		return rewriteValueWasm_OpMod8(v)
   352  	case OpMod8u:
   353  		return rewriteValueWasm_OpMod8u(v)
   354  	case OpMove:
   355  		return rewriteValueWasm_OpMove(v)
   356  	case OpMul16:
   357  		v.Op = OpWasmI64Mul
   358  		return true
   359  	case OpMul32:
   360  		v.Op = OpWasmI64Mul
   361  		return true
   362  	case OpMul32F:
   363  		v.Op = OpWasmF32Mul
   364  		return true
   365  	case OpMul64:
   366  		v.Op = OpWasmI64Mul
   367  		return true
   368  	case OpMul64F:
   369  		v.Op = OpWasmF64Mul
   370  		return true
   371  	case OpMul8:
   372  		v.Op = OpWasmI64Mul
   373  		return true
   374  	case OpNeg16:
   375  		return rewriteValueWasm_OpNeg16(v)
   376  	case OpNeg32:
   377  		return rewriteValueWasm_OpNeg32(v)
   378  	case OpNeg32F:
   379  		v.Op = OpWasmF32Neg
   380  		return true
   381  	case OpNeg64:
   382  		return rewriteValueWasm_OpNeg64(v)
   383  	case OpNeg64F:
   384  		v.Op = OpWasmF64Neg
   385  		return true
   386  	case OpNeg8:
   387  		return rewriteValueWasm_OpNeg8(v)
   388  	case OpNeq16:
   389  		return rewriteValueWasm_OpNeq16(v)
   390  	case OpNeq32:
   391  		return rewriteValueWasm_OpNeq32(v)
   392  	case OpNeq32F:
   393  		v.Op = OpWasmF32Ne
   394  		return true
   395  	case OpNeq64:
   396  		v.Op = OpWasmI64Ne
   397  		return true
   398  	case OpNeq64F:
   399  		v.Op = OpWasmF64Ne
   400  		return true
   401  	case OpNeq8:
   402  		return rewriteValueWasm_OpNeq8(v)
   403  	case OpNeqB:
   404  		v.Op = OpWasmI64Ne
   405  		return true
   406  	case OpNeqPtr:
   407  		v.Op = OpWasmI64Ne
   408  		return true
   409  	case OpNilCheck:
   410  		v.Op = OpWasmLoweredNilCheck
   411  		return true
   412  	case OpNot:
   413  		v.Op = OpWasmI64Eqz
   414  		return true
   415  	case OpOffPtr:
   416  		v.Op = OpWasmI64AddConst
   417  		return true
   418  	case OpOr16:
   419  		v.Op = OpWasmI64Or
   420  		return true
   421  	case OpOr32:
   422  		v.Op = OpWasmI64Or
   423  		return true
   424  	case OpOr64:
   425  		v.Op = OpWasmI64Or
   426  		return true
   427  	case OpOr8:
   428  		v.Op = OpWasmI64Or
   429  		return true
   430  	case OpOrB:
   431  		v.Op = OpWasmI64Or
   432  		return true
   433  	case OpPopCount16:
   434  		return rewriteValueWasm_OpPopCount16(v)
   435  	case OpPopCount32:
   436  		return rewriteValueWasm_OpPopCount32(v)
   437  	case OpPopCount64:
   438  		v.Op = OpWasmI64Popcnt
   439  		return true
   440  	case OpPopCount8:
   441  		return rewriteValueWasm_OpPopCount8(v)
   442  	case OpRotateLeft16:
   443  		return rewriteValueWasm_OpRotateLeft16(v)
   444  	case OpRotateLeft32:
   445  		v.Op = OpWasmI32Rotl
   446  		return true
   447  	case OpRotateLeft64:
   448  		v.Op = OpWasmI64Rotl
   449  		return true
   450  	case OpRotateLeft8:
   451  		return rewriteValueWasm_OpRotateLeft8(v)
   452  	case OpRound32F:
   453  		v.Op = OpCopy
   454  		return true
   455  	case OpRound64F:
   456  		v.Op = OpCopy
   457  		return true
   458  	case OpRoundToEven:
   459  		v.Op = OpWasmF64Nearest
   460  		return true
   461  	case OpRsh16Ux16:
   462  		return rewriteValueWasm_OpRsh16Ux16(v)
   463  	case OpRsh16Ux32:
   464  		return rewriteValueWasm_OpRsh16Ux32(v)
   465  	case OpRsh16Ux64:
   466  		return rewriteValueWasm_OpRsh16Ux64(v)
   467  	case OpRsh16Ux8:
   468  		return rewriteValueWasm_OpRsh16Ux8(v)
   469  	case OpRsh16x16:
   470  		return rewriteValueWasm_OpRsh16x16(v)
   471  	case OpRsh16x32:
   472  		return rewriteValueWasm_OpRsh16x32(v)
   473  	case OpRsh16x64:
   474  		return rewriteValueWasm_OpRsh16x64(v)
   475  	case OpRsh16x8:
   476  		return rewriteValueWasm_OpRsh16x8(v)
   477  	case OpRsh32Ux16:
   478  		return rewriteValueWasm_OpRsh32Ux16(v)
   479  	case OpRsh32Ux32:
   480  		return rewriteValueWasm_OpRsh32Ux32(v)
   481  	case OpRsh32Ux64:
   482  		return rewriteValueWasm_OpRsh32Ux64(v)
   483  	case OpRsh32Ux8:
   484  		return rewriteValueWasm_OpRsh32Ux8(v)
   485  	case OpRsh32x16:
   486  		return rewriteValueWasm_OpRsh32x16(v)
   487  	case OpRsh32x32:
   488  		return rewriteValueWasm_OpRsh32x32(v)
   489  	case OpRsh32x64:
   490  		return rewriteValueWasm_OpRsh32x64(v)
   491  	case OpRsh32x8:
   492  		return rewriteValueWasm_OpRsh32x8(v)
   493  	case OpRsh64Ux16:
   494  		return rewriteValueWasm_OpRsh64Ux16(v)
   495  	case OpRsh64Ux32:
   496  		return rewriteValueWasm_OpRsh64Ux32(v)
   497  	case OpRsh64Ux64:
   498  		return rewriteValueWasm_OpRsh64Ux64(v)
   499  	case OpRsh64Ux8:
   500  		return rewriteValueWasm_OpRsh64Ux8(v)
   501  	case OpRsh64x16:
   502  		return rewriteValueWasm_OpRsh64x16(v)
   503  	case OpRsh64x32:
   504  		return rewriteValueWasm_OpRsh64x32(v)
   505  	case OpRsh64x64:
   506  		return rewriteValueWasm_OpRsh64x64(v)
   507  	case OpRsh64x8:
   508  		return rewriteValueWasm_OpRsh64x8(v)
   509  	case OpRsh8Ux16:
   510  		return rewriteValueWasm_OpRsh8Ux16(v)
   511  	case OpRsh8Ux32:
   512  		return rewriteValueWasm_OpRsh8Ux32(v)
   513  	case OpRsh8Ux64:
   514  		return rewriteValueWasm_OpRsh8Ux64(v)
   515  	case OpRsh8Ux8:
   516  		return rewriteValueWasm_OpRsh8Ux8(v)
   517  	case OpRsh8x16:
   518  		return rewriteValueWasm_OpRsh8x16(v)
   519  	case OpRsh8x32:
   520  		return rewriteValueWasm_OpRsh8x32(v)
   521  	case OpRsh8x64:
   522  		return rewriteValueWasm_OpRsh8x64(v)
   523  	case OpRsh8x8:
   524  		return rewriteValueWasm_OpRsh8x8(v)
   525  	case OpSelect0:
   526  		return rewriteValueWasm_OpSelect0(v)
   527  	case OpSelect1:
   528  		return rewriteValueWasm_OpSelect1(v)
   529  	case OpSignExt16to32:
   530  		return rewriteValueWasm_OpSignExt16to32(v)
   531  	case OpSignExt16to64:
   532  		return rewriteValueWasm_OpSignExt16to64(v)
   533  	case OpSignExt32to64:
   534  		return rewriteValueWasm_OpSignExt32to64(v)
   535  	case OpSignExt8to16:
   536  		return rewriteValueWasm_OpSignExt8to16(v)
   537  	case OpSignExt8to32:
   538  		return rewriteValueWasm_OpSignExt8to32(v)
   539  	case OpSignExt8to64:
   540  		return rewriteValueWasm_OpSignExt8to64(v)
   541  	case OpSlicemask:
   542  		return rewriteValueWasm_OpSlicemask(v)
   543  	case OpSqrt:
   544  		v.Op = OpWasmF64Sqrt
   545  		return true
   546  	case OpSqrt32:
   547  		v.Op = OpWasmF32Sqrt
   548  		return true
   549  	case OpStaticCall:
   550  		v.Op = OpWasmLoweredStaticCall
   551  		return true
   552  	case OpStore:
   553  		return rewriteValueWasm_OpStore(v)
   554  	case OpSub16:
   555  		v.Op = OpWasmI64Sub
   556  		return true
   557  	case OpSub32:
   558  		v.Op = OpWasmI64Sub
   559  		return true
   560  	case OpSub32F:
   561  		v.Op = OpWasmF32Sub
   562  		return true
   563  	case OpSub64:
   564  		v.Op = OpWasmI64Sub
   565  		return true
   566  	case OpSub64F:
   567  		v.Op = OpWasmF64Sub
   568  		return true
   569  	case OpSub8:
   570  		v.Op = OpWasmI64Sub
   571  		return true
   572  	case OpSubPtr:
   573  		v.Op = OpWasmI64Sub
   574  		return true
   575  	case OpTailCall:
   576  		v.Op = OpWasmLoweredTailCall
   577  		return true
   578  	case OpTrunc:
   579  		v.Op = OpWasmF64Trunc
   580  		return true
   581  	case OpTrunc16to8:
   582  		v.Op = OpCopy
   583  		return true
   584  	case OpTrunc32to16:
   585  		v.Op = OpCopy
   586  		return true
   587  	case OpTrunc32to8:
   588  		v.Op = OpCopy
   589  		return true
   590  	case OpTrunc64to16:
   591  		v.Op = OpCopy
   592  		return true
   593  	case OpTrunc64to32:
   594  		v.Op = OpCopy
   595  		return true
   596  	case OpTrunc64to8:
   597  		v.Op = OpCopy
   598  		return true
   599  	case OpWB:
   600  		v.Op = OpWasmLoweredWB
   601  		return true
   602  	case OpWasmF64Add:
   603  		return rewriteValueWasm_OpWasmF64Add(v)
   604  	case OpWasmF64Mul:
   605  		return rewriteValueWasm_OpWasmF64Mul(v)
   606  	case OpWasmI64Add:
   607  		return rewriteValueWasm_OpWasmI64Add(v)
   608  	case OpWasmI64AddConst:
   609  		return rewriteValueWasm_OpWasmI64AddConst(v)
   610  	case OpWasmI64And:
   611  		return rewriteValueWasm_OpWasmI64And(v)
   612  	case OpWasmI64Eq:
   613  		return rewriteValueWasm_OpWasmI64Eq(v)
   614  	case OpWasmI64Eqz:
   615  		return rewriteValueWasm_OpWasmI64Eqz(v)
   616  	case OpWasmI64LeU:
   617  		return rewriteValueWasm_OpWasmI64LeU(v)
   618  	case OpWasmI64Load:
   619  		return rewriteValueWasm_OpWasmI64Load(v)
   620  	case OpWasmI64Load16S:
   621  		return rewriteValueWasm_OpWasmI64Load16S(v)
   622  	case OpWasmI64Load16U:
   623  		return rewriteValueWasm_OpWasmI64Load16U(v)
   624  	case OpWasmI64Load32S:
   625  		return rewriteValueWasm_OpWasmI64Load32S(v)
   626  	case OpWasmI64Load32U:
   627  		return rewriteValueWasm_OpWasmI64Load32U(v)
   628  	case OpWasmI64Load8S:
   629  		return rewriteValueWasm_OpWasmI64Load8S(v)
   630  	case OpWasmI64Load8U:
   631  		return rewriteValueWasm_OpWasmI64Load8U(v)
   632  	case OpWasmI64LtU:
   633  		return rewriteValueWasm_OpWasmI64LtU(v)
   634  	case OpWasmI64Mul:
   635  		return rewriteValueWasm_OpWasmI64Mul(v)
   636  	case OpWasmI64Ne:
   637  		return rewriteValueWasm_OpWasmI64Ne(v)
   638  	case OpWasmI64Or:
   639  		return rewriteValueWasm_OpWasmI64Or(v)
   640  	case OpWasmI64Shl:
   641  		return rewriteValueWasm_OpWasmI64Shl(v)
   642  	case OpWasmI64ShrS:
   643  		return rewriteValueWasm_OpWasmI64ShrS(v)
   644  	case OpWasmI64ShrU:
   645  		return rewriteValueWasm_OpWasmI64ShrU(v)
   646  	case OpWasmI64Store:
   647  		return rewriteValueWasm_OpWasmI64Store(v)
   648  	case OpWasmI64Store16:
   649  		return rewriteValueWasm_OpWasmI64Store16(v)
   650  	case OpWasmI64Store32:
   651  		return rewriteValueWasm_OpWasmI64Store32(v)
   652  	case OpWasmI64Store8:
   653  		return rewriteValueWasm_OpWasmI64Store8(v)
   654  	case OpWasmI64Xor:
   655  		return rewriteValueWasm_OpWasmI64Xor(v)
   656  	case OpXor16:
   657  		v.Op = OpWasmI64Xor
   658  		return true
   659  	case OpXor32:
   660  		v.Op = OpWasmI64Xor
   661  		return true
   662  	case OpXor64:
   663  		v.Op = OpWasmI64Xor
   664  		return true
   665  	case OpXor8:
   666  		v.Op = OpWasmI64Xor
   667  		return true
   668  	case OpZero:
   669  		return rewriteValueWasm_OpZero(v)
   670  	case OpZeroExt16to32:
   671  		return rewriteValueWasm_OpZeroExt16to32(v)
   672  	case OpZeroExt16to64:
   673  		return rewriteValueWasm_OpZeroExt16to64(v)
   674  	case OpZeroExt32to64:
   675  		return rewriteValueWasm_OpZeroExt32to64(v)
   676  	case OpZeroExt8to16:
   677  		return rewriteValueWasm_OpZeroExt8to16(v)
   678  	case OpZeroExt8to32:
   679  		return rewriteValueWasm_OpZeroExt8to32(v)
   680  	case OpZeroExt8to64:
   681  		return rewriteValueWasm_OpZeroExt8to64(v)
   682  	}
   683  	return false
   684  }
   685  func rewriteValueWasm_OpAddr(v *Value) bool {
   686  	v_0 := v.Args[0]
   687  	// match: (Addr {sym} base)
   688  	// result: (LoweredAddr {sym} [0] base)
   689  	for {
   690  		sym := auxToSym(v.Aux)
   691  		base := v_0
   692  		v.reset(OpWasmLoweredAddr)
   693  		v.AuxInt = int32ToAuxInt(0)
   694  		v.Aux = symToAux(sym)
   695  		v.AddArg(base)
   696  		return true
   697  	}
   698  }
   699  func rewriteValueWasm_OpAvg64u(v *Value) bool {
   700  	v_1 := v.Args[1]
   701  	v_0 := v.Args[0]
   702  	b := v.Block
   703  	typ := &b.Func.Config.Types
   704  	// match: (Avg64u x y)
   705  	// result: (I64Add (I64ShrU (I64Sub x y) (I64Const [1])) y)
   706  	for {
   707  		x := v_0
   708  		y := v_1
   709  		v.reset(OpWasmI64Add)
   710  		v0 := b.NewValue0(v.Pos, OpWasmI64ShrU, typ.Int64)
   711  		v1 := b.NewValue0(v.Pos, OpWasmI64Sub, typ.Int64)
   712  		v1.AddArg2(x, y)
   713  		v2 := b.NewValue0(v.Pos, OpWasmI64Const, typ.Int64)
   714  		v2.AuxInt = int64ToAuxInt(1)
   715  		v0.AddArg2(v1, v2)
   716  		v.AddArg2(v0, y)
   717  		return true
   718  	}
   719  }
   720  func rewriteValueWasm_OpBitLen16(v *Value) bool {
   721  	v_0 := v.Args[0]
   722  	b := v.Block
   723  	typ := &b.Func.Config.Types
   724  	// match: (BitLen16 x)
   725  	// result: (BitLen64 (ZeroExt16to64 x))
   726  	for {
   727  		x := v_0
   728  		v.reset(OpBitLen64)
   729  		v0 := b.NewValue0(v.Pos, OpZeroExt16to64, typ.UInt64)
   730  		v0.AddArg(x)
   731  		v.AddArg(v0)
   732  		return true
   733  	}
   734  }
   735  func rewriteValueWasm_OpBitLen32(v *Value) bool {
   736  	v_0 := v.Args[0]
   737  	b := v.Block
   738  	typ := &b.Func.Config.Types
   739  	// match: (BitLen32 x)
   740  	// result: (BitLen64 (ZeroExt32to64 x))
   741  	for {
   742  		x := v_0
   743  		v.reset(OpBitLen64)
   744  		v0 := b.NewValue0(v.Pos, OpZeroExt32to64, typ.UInt64)
   745  		v0.AddArg(x)
   746  		v.AddArg(v0)
   747  		return true
   748  	}
   749  }
   750  func rewriteValueWasm_OpBitLen64(v *Value) bool {
   751  	v_0 := v.Args[0]
   752  	b := v.Block
   753  	typ := &b.Func.Config.Types
   754  	// match: (BitLen64 x)
   755  	// result: (I64Sub (I64Const [64]) (I64Clz x))
   756  	for {
   757  		x := v_0
   758  		v.reset(OpWasmI64Sub)
   759  		v0 := b.NewValue0(v.Pos, OpWasmI64Const, typ.Int64)
   760  		v0.AuxInt = int64ToAuxInt(64)
   761  		v1 := b.NewValue0(v.Pos, OpWasmI64Clz, typ.Int64)
   762  		v1.AddArg(x)
   763  		v.AddArg2(v0, v1)
   764  		return true
   765  	}
   766  }
   767  func rewriteValueWasm_OpBitLen8(v *Value) bool {
   768  	v_0 := v.Args[0]
   769  	b := v.Block
   770  	typ := &b.Func.Config.Types
   771  	// match: (BitLen8 x)
   772  	// result: (BitLen64 (ZeroExt8to64 x))
   773  	for {
   774  		x := v_0
   775  		v.reset(OpBitLen64)
   776  		v0 := b.NewValue0(v.Pos, OpZeroExt8to64, typ.UInt64)
   777  		v0.AddArg(x)
   778  		v.AddArg(v0)
   779  		return true
   780  	}
   781  }
   782  func rewriteValueWasm_OpCom16(v *Value) bool {
   783  	v_0 := v.Args[0]
   784  	b := v.Block
   785  	typ := &b.Func.Config.Types
   786  	// match: (Com16 x)
   787  	// result: (I64Xor x (I64Const [-1]))
   788  	for {
   789  		x := v_0
   790  		v.reset(OpWasmI64Xor)
   791  		v0 := b.NewValue0(v.Pos, OpWasmI64Const, typ.Int64)
   792  		v0.AuxInt = int64ToAuxInt(-1)
   793  		v.AddArg2(x, v0)
   794  		return true
   795  	}
   796  }
   797  func rewriteValueWasm_OpCom32(v *Value) bool {
   798  	v_0 := v.Args[0]
   799  	b := v.Block
   800  	typ := &b.Func.Config.Types
   801  	// match: (Com32 x)
   802  	// result: (I64Xor x (I64Const [-1]))
   803  	for {
   804  		x := v_0
   805  		v.reset(OpWasmI64Xor)
   806  		v0 := b.NewValue0(v.Pos, OpWasmI64Const, typ.Int64)
   807  		v0.AuxInt = int64ToAuxInt(-1)
   808  		v.AddArg2(x, v0)
   809  		return true
   810  	}
   811  }
   812  func rewriteValueWasm_OpCom64(v *Value) bool {
   813  	v_0 := v.Args[0]
   814  	b := v.Block
   815  	typ := &b.Func.Config.Types
   816  	// match: (Com64 x)
   817  	// result: (I64Xor x (I64Const [-1]))
   818  	for {
   819  		x := v_0
   820  		v.reset(OpWasmI64Xor)
   821  		v0 := b.NewValue0(v.Pos, OpWasmI64Const, typ.Int64)
   822  		v0.AuxInt = int64ToAuxInt(-1)
   823  		v.AddArg2(x, v0)
   824  		return true
   825  	}
   826  }
   827  func rewriteValueWasm_OpCom8(v *Value) bool {
   828  	v_0 := v.Args[0]
   829  	b := v.Block
   830  	typ := &b.Func.Config.Types
   831  	// match: (Com8 x)
   832  	// result: (I64Xor x (I64Const [-1]))
   833  	for {
   834  		x := v_0
   835  		v.reset(OpWasmI64Xor)
   836  		v0 := b.NewValue0(v.Pos, OpWasmI64Const, typ.Int64)
   837  		v0.AuxInt = int64ToAuxInt(-1)
   838  		v.AddArg2(x, v0)
   839  		return true
   840  	}
   841  }
   842  func rewriteValueWasm_OpConst16(v *Value) bool {
   843  	// match: (Const16 [c])
   844  	// result: (I64Const [int64(c)])
   845  	for {
   846  		c := auxIntToInt16(v.AuxInt)
   847  		v.reset(OpWasmI64Const)
   848  		v.AuxInt = int64ToAuxInt(int64(c))
   849  		return true
   850  	}
   851  }
   852  func rewriteValueWasm_OpConst32(v *Value) bool {
   853  	// match: (Const32 [c])
   854  	// result: (I64Const [int64(c)])
   855  	for {
   856  		c := auxIntToInt32(v.AuxInt)
   857  		v.reset(OpWasmI64Const)
   858  		v.AuxInt = int64ToAuxInt(int64(c))
   859  		return true
   860  	}
   861  }
   862  func rewriteValueWasm_OpConst8(v *Value) bool {
   863  	// match: (Const8 [c])
   864  	// result: (I64Const [int64(c)])
   865  	for {
   866  		c := auxIntToInt8(v.AuxInt)
   867  		v.reset(OpWasmI64Const)
   868  		v.AuxInt = int64ToAuxInt(int64(c))
   869  		return true
   870  	}
   871  }
   872  func rewriteValueWasm_OpConstBool(v *Value) bool {
   873  	// match: (ConstBool [c])
   874  	// result: (I64Const [b2i(c)])
   875  	for {
   876  		c := auxIntToBool(v.AuxInt)
   877  		v.reset(OpWasmI64Const)
   878  		v.AuxInt = int64ToAuxInt(b2i(c))
   879  		return true
   880  	}
   881  }
   882  func rewriteValueWasm_OpConstNil(v *Value) bool {
   883  	// match: (ConstNil)
   884  	// result: (I64Const [0])
   885  	for {
   886  		v.reset(OpWasmI64Const)
   887  		v.AuxInt = int64ToAuxInt(0)
   888  		return true
   889  	}
   890  }
   891  func rewriteValueWasm_OpCtz16(v *Value) bool {
   892  	v_0 := v.Args[0]
   893  	b := v.Block
   894  	typ := &b.Func.Config.Types
   895  	// match: (Ctz16 x)
   896  	// result: (I64Ctz (I64Or x (I64Const [0x10000])))
   897  	for {
   898  		x := v_0
   899  		v.reset(OpWasmI64Ctz)
   900  		v0 := b.NewValue0(v.Pos, OpWasmI64Or, typ.Int64)
   901  		v1 := b.NewValue0(v.Pos, OpWasmI64Const, typ.Int64)
   902  		v1.AuxInt = int64ToAuxInt(0x10000)
   903  		v0.AddArg2(x, v1)
   904  		v.AddArg(v0)
   905  		return true
   906  	}
   907  }
   908  func rewriteValueWasm_OpCtz32(v *Value) bool {
   909  	v_0 := v.Args[0]
   910  	b := v.Block
   911  	typ := &b.Func.Config.Types
   912  	// match: (Ctz32 x)
   913  	// result: (I64Ctz (I64Or x (I64Const [0x100000000])))
   914  	for {
   915  		x := v_0
   916  		v.reset(OpWasmI64Ctz)
   917  		v0 := b.NewValue0(v.Pos, OpWasmI64Or, typ.Int64)
   918  		v1 := b.NewValue0(v.Pos, OpWasmI64Const, typ.Int64)
   919  		v1.AuxInt = int64ToAuxInt(0x100000000)
   920  		v0.AddArg2(x, v1)
   921  		v.AddArg(v0)
   922  		return true
   923  	}
   924  }
   925  func rewriteValueWasm_OpCtz8(v *Value) bool {
   926  	v_0 := v.Args[0]
   927  	b := v.Block
   928  	typ := &b.Func.Config.Types
   929  	// match: (Ctz8 x)
   930  	// result: (I64Ctz (I64Or x (I64Const [0x100])))
   931  	for {
   932  		x := v_0
   933  		v.reset(OpWasmI64Ctz)
   934  		v0 := b.NewValue0(v.Pos, OpWasmI64Or, typ.Int64)
   935  		v1 := b.NewValue0(v.Pos, OpWasmI64Const, typ.Int64)
   936  		v1.AuxInt = int64ToAuxInt(0x100)
   937  		v0.AddArg2(x, v1)
   938  		v.AddArg(v0)
   939  		return true
   940  	}
   941  }
   942  func rewriteValueWasm_OpCvt32Uto32F(v *Value) bool {
   943  	v_0 := v.Args[0]
   944  	b := v.Block
   945  	typ := &b.Func.Config.Types
   946  	// match: (Cvt32Uto32F x)
   947  	// result: (F32ConvertI64U (ZeroExt32to64 x))
   948  	for {
   949  		x := v_0
   950  		v.reset(OpWasmF32ConvertI64U)
   951  		v0 := b.NewValue0(v.Pos, OpZeroExt32to64, typ.UInt64)
   952  		v0.AddArg(x)
   953  		v.AddArg(v0)
   954  		return true
   955  	}
   956  }
   957  func rewriteValueWasm_OpCvt32Uto64F(v *Value) bool {
   958  	v_0 := v.Args[0]
   959  	b := v.Block
   960  	typ := &b.Func.Config.Types
   961  	// match: (Cvt32Uto64F x)
   962  	// result: (F64ConvertI64U (ZeroExt32to64 x))
   963  	for {
   964  		x := v_0
   965  		v.reset(OpWasmF64ConvertI64U)
   966  		v0 := b.NewValue0(v.Pos, OpZeroExt32to64, typ.UInt64)
   967  		v0.AddArg(x)
   968  		v.AddArg(v0)
   969  		return true
   970  	}
   971  }
   972  func rewriteValueWasm_OpCvt32to32F(v *Value) bool {
   973  	v_0 := v.Args[0]
   974  	b := v.Block
   975  	typ := &b.Func.Config.Types
   976  	// match: (Cvt32to32F x)
   977  	// result: (F32ConvertI64S (SignExt32to64 x))
   978  	for {
   979  		x := v_0
   980  		v.reset(OpWasmF32ConvertI64S)
   981  		v0 := b.NewValue0(v.Pos, OpSignExt32to64, typ.Int64)
   982  		v0.AddArg(x)
   983  		v.AddArg(v0)
   984  		return true
   985  	}
   986  }
   987  func rewriteValueWasm_OpCvt32to64F(v *Value) bool {
   988  	v_0 := v.Args[0]
   989  	b := v.Block
   990  	typ := &b.Func.Config.Types
   991  	// match: (Cvt32to64F x)
   992  	// result: (F64ConvertI64S (SignExt32to64 x))
   993  	for {
   994  		x := v_0
   995  		v.reset(OpWasmF64ConvertI64S)
   996  		v0 := b.NewValue0(v.Pos, OpSignExt32to64, typ.Int64)
   997  		v0.AddArg(x)
   998  		v.AddArg(v0)
   999  		return true
  1000  	}
  1001  }
  1002  func rewriteValueWasm_OpDiv16(v *Value) bool {
  1003  	v_1 := v.Args[1]
  1004  	v_0 := v.Args[0]
  1005  	b := v.Block
  1006  	typ := &b.Func.Config.Types
  1007  	// match: (Div16 [false] x y)
  1008  	// result: (I64DivS (SignExt16to64 x) (SignExt16to64 y))
  1009  	for {
  1010  		if auxIntToBool(v.AuxInt) != false {
  1011  			break
  1012  		}
  1013  		x := v_0
  1014  		y := v_1
  1015  		v.reset(OpWasmI64DivS)
  1016  		v0 := b.NewValue0(v.Pos, OpSignExt16to64, typ.Int64)
  1017  		v0.AddArg(x)
  1018  		v1 := b.NewValue0(v.Pos, OpSignExt16to64, typ.Int64)
  1019  		v1.AddArg(y)
  1020  		v.AddArg2(v0, v1)
  1021  		return true
  1022  	}
  1023  	return false
  1024  }
  1025  func rewriteValueWasm_OpDiv16u(v *Value) bool {
  1026  	v_1 := v.Args[1]
  1027  	v_0 := v.Args[0]
  1028  	b := v.Block
  1029  	typ := &b.Func.Config.Types
  1030  	// match: (Div16u x y)
  1031  	// result: (I64DivU (ZeroExt16to64 x) (ZeroExt16to64 y))
  1032  	for {
  1033  		x := v_0
  1034  		y := v_1
  1035  		v.reset(OpWasmI64DivU)
  1036  		v0 := b.NewValue0(v.Pos, OpZeroExt16to64, typ.UInt64)
  1037  		v0.AddArg(x)
  1038  		v1 := b.NewValue0(v.Pos, OpZeroExt16to64, typ.UInt64)
  1039  		v1.AddArg(y)
  1040  		v.AddArg2(v0, v1)
  1041  		return true
  1042  	}
  1043  }
  1044  func rewriteValueWasm_OpDiv32(v *Value) bool {
  1045  	v_1 := v.Args[1]
  1046  	v_0 := v.Args[0]
  1047  	b := v.Block
  1048  	typ := &b.Func.Config.Types
  1049  	// match: (Div32 [false] x y)
  1050  	// result: (I64DivS (SignExt32to64 x) (SignExt32to64 y))
  1051  	for {
  1052  		if auxIntToBool(v.AuxInt) != false {
  1053  			break
  1054  		}
  1055  		x := v_0
  1056  		y := v_1
  1057  		v.reset(OpWasmI64DivS)
  1058  		v0 := b.NewValue0(v.Pos, OpSignExt32to64, typ.Int64)
  1059  		v0.AddArg(x)
  1060  		v1 := b.NewValue0(v.Pos, OpSignExt32to64, typ.Int64)
  1061  		v1.AddArg(y)
  1062  		v.AddArg2(v0, v1)
  1063  		return true
  1064  	}
  1065  	return false
  1066  }
  1067  func rewriteValueWasm_OpDiv32u(v *Value) bool {
  1068  	v_1 := v.Args[1]
  1069  	v_0 := v.Args[0]
  1070  	b := v.Block
  1071  	typ := &b.Func.Config.Types
  1072  	// match: (Div32u x y)
  1073  	// result: (I64DivU (ZeroExt32to64 x) (ZeroExt32to64 y))
  1074  	for {
  1075  		x := v_0
  1076  		y := v_1
  1077  		v.reset(OpWasmI64DivU)
  1078  		v0 := b.NewValue0(v.Pos, OpZeroExt32to64, typ.UInt64)
  1079  		v0.AddArg(x)
  1080  		v1 := b.NewValue0(v.Pos, OpZeroExt32to64, typ.UInt64)
  1081  		v1.AddArg(y)
  1082  		v.AddArg2(v0, v1)
  1083  		return true
  1084  	}
  1085  }
  1086  func rewriteValueWasm_OpDiv64(v *Value) bool {
  1087  	v_1 := v.Args[1]
  1088  	v_0 := v.Args[0]
  1089  	// match: (Div64 [false] x y)
  1090  	// result: (I64DivS x y)
  1091  	for {
  1092  		if auxIntToBool(v.AuxInt) != false {
  1093  			break
  1094  		}
  1095  		x := v_0
  1096  		y := v_1
  1097  		v.reset(OpWasmI64DivS)
  1098  		v.AddArg2(x, y)
  1099  		return true
  1100  	}
  1101  	return false
  1102  }
  1103  func rewriteValueWasm_OpDiv8(v *Value) bool {
  1104  	v_1 := v.Args[1]
  1105  	v_0 := v.Args[0]
  1106  	b := v.Block
  1107  	typ := &b.Func.Config.Types
  1108  	// match: (Div8 x y)
  1109  	// result: (I64DivS (SignExt8to64 x) (SignExt8to64 y))
  1110  	for {
  1111  		x := v_0
  1112  		y := v_1
  1113  		v.reset(OpWasmI64DivS)
  1114  		v0 := b.NewValue0(v.Pos, OpSignExt8to64, typ.Int64)
  1115  		v0.AddArg(x)
  1116  		v1 := b.NewValue0(v.Pos, OpSignExt8to64, typ.Int64)
  1117  		v1.AddArg(y)
  1118  		v.AddArg2(v0, v1)
  1119  		return true
  1120  	}
  1121  }
  1122  func rewriteValueWasm_OpDiv8u(v *Value) bool {
  1123  	v_1 := v.Args[1]
  1124  	v_0 := v.Args[0]
  1125  	b := v.Block
  1126  	typ := &b.Func.Config.Types
  1127  	// match: (Div8u x y)
  1128  	// result: (I64DivU (ZeroExt8to64 x) (ZeroExt8to64 y))
  1129  	for {
  1130  		x := v_0
  1131  		y := v_1
  1132  		v.reset(OpWasmI64DivU)
  1133  		v0 := b.NewValue0(v.Pos, OpZeroExt8to64, typ.UInt64)
  1134  		v0.AddArg(x)
  1135  		v1 := b.NewValue0(v.Pos, OpZeroExt8to64, typ.UInt64)
  1136  		v1.AddArg(y)
  1137  		v.AddArg2(v0, v1)
  1138  		return true
  1139  	}
  1140  }
  1141  func rewriteValueWasm_OpEq16(v *Value) bool {
  1142  	v_1 := v.Args[1]
  1143  	v_0 := v.Args[0]
  1144  	b := v.Block
  1145  	typ := &b.Func.Config.Types
  1146  	// match: (Eq16 x y)
  1147  	// result: (I64Eq (ZeroExt16to64 x) (ZeroExt16to64 y))
  1148  	for {
  1149  		x := v_0
  1150  		y := v_1
  1151  		v.reset(OpWasmI64Eq)
  1152  		v0 := b.NewValue0(v.Pos, OpZeroExt16to64, typ.UInt64)
  1153  		v0.AddArg(x)
  1154  		v1 := b.NewValue0(v.Pos, OpZeroExt16to64, typ.UInt64)
  1155  		v1.AddArg(y)
  1156  		v.AddArg2(v0, v1)
  1157  		return true
  1158  	}
  1159  }
  1160  func rewriteValueWasm_OpEq32(v *Value) bool {
  1161  	v_1 := v.Args[1]
  1162  	v_0 := v.Args[0]
  1163  	b := v.Block
  1164  	typ := &b.Func.Config.Types
  1165  	// match: (Eq32 x y)
  1166  	// result: (I64Eq (ZeroExt32to64 x) (ZeroExt32to64 y))
  1167  	for {
  1168  		x := v_0
  1169  		y := v_1
  1170  		v.reset(OpWasmI64Eq)
  1171  		v0 := b.NewValue0(v.Pos, OpZeroExt32to64, typ.UInt64)
  1172  		v0.AddArg(x)
  1173  		v1 := b.NewValue0(v.Pos, OpZeroExt32to64, typ.UInt64)
  1174  		v1.AddArg(y)
  1175  		v.AddArg2(v0, v1)
  1176  		return true
  1177  	}
  1178  }
  1179  func rewriteValueWasm_OpEq8(v *Value) bool {
  1180  	v_1 := v.Args[1]
  1181  	v_0 := v.Args[0]
  1182  	b := v.Block
  1183  	typ := &b.Func.Config.Types
  1184  	// match: (Eq8 x y)
  1185  	// result: (I64Eq (ZeroExt8to64 x) (ZeroExt8to64 y))
  1186  	for {
  1187  		x := v_0
  1188  		y := v_1
  1189  		v.reset(OpWasmI64Eq)
  1190  		v0 := b.NewValue0(v.Pos, OpZeroExt8to64, typ.UInt64)
  1191  		v0.AddArg(x)
  1192  		v1 := b.NewValue0(v.Pos, OpZeroExt8to64, typ.UInt64)
  1193  		v1.AddArg(y)
  1194  		v.AddArg2(v0, v1)
  1195  		return true
  1196  	}
  1197  }
  1198  func rewriteValueWasm_OpHmul64(v *Value) bool {
  1199  	v_1 := v.Args[1]
  1200  	v_0 := v.Args[0]
  1201  	b := v.Block
  1202  	typ := &b.Func.Config.Types
  1203  	// match: (Hmul64 <t> x y)
  1204  	// result: (Last <t> x0: (ZeroExt32to64 x) x1: (I64ShrS x (I64Const [32])) y0: (ZeroExt32to64 y) y1: (I64ShrS y (I64Const [32])) x0y0: (I64Mul x0 y0) tt: (I64Add (I64Mul x1 y0) (I64ShrU x0y0 (I64Const [32]))) w1: (I64Add (I64Mul x0 y1) (ZeroExt32to64 tt)) w2: (I64ShrS tt (I64Const [32])) (I64Add (I64Add (I64Mul x1 y1) w2) (I64ShrS w1 (I64Const [32]))))
  1205  	for {
  1206  		t := v.Type
  1207  		x := v_0
  1208  		y := v_1
  1209  		v.reset(OpLast)
  1210  		v.Type = t
  1211  		x0 := b.NewValue0(v.Pos, OpZeroExt32to64, typ.UInt64)
  1212  		x0.AddArg(x)
  1213  		x1 := b.NewValue0(v.Pos, OpWasmI64ShrS, typ.Int64)
  1214  		v2 := b.NewValue0(v.Pos, OpWasmI64Const, typ.Int64)
  1215  		v2.AuxInt = int64ToAuxInt(32)
  1216  		x1.AddArg2(x, v2)
  1217  		y0 := b.NewValue0(v.Pos, OpZeroExt32to64, typ.UInt64)
  1218  		y0.AddArg(y)
  1219  		y1 := b.NewValue0(v.Pos, OpWasmI64ShrS, typ.Int64)
  1220  		y1.AddArg2(y, v2)
  1221  		x0y0 := b.NewValue0(v.Pos, OpWasmI64Mul, typ.Int64)
  1222  		x0y0.AddArg2(x0, y0)
  1223  		tt := b.NewValue0(v.Pos, OpWasmI64Add, typ.Int64)
  1224  		v7 := b.NewValue0(v.Pos, OpWasmI64Mul, typ.Int64)
  1225  		v7.AddArg2(x1, y0)
  1226  		v8 := b.NewValue0(v.Pos, OpWasmI64ShrU, typ.Int64)
  1227  		v8.AddArg2(x0y0, v2)
  1228  		tt.AddArg2(v7, v8)
  1229  		w1 := b.NewValue0(v.Pos, OpWasmI64Add, typ.Int64)
  1230  		v10 := b.NewValue0(v.Pos, OpWasmI64Mul, typ.Int64)
  1231  		v10.AddArg2(x0, y1)
  1232  		v11 := b.NewValue0(v.Pos, OpZeroExt32to64, typ.UInt64)
  1233  		v11.AddArg(tt)
  1234  		w1.AddArg2(v10, v11)
  1235  		w2 := b.NewValue0(v.Pos, OpWasmI64ShrS, typ.Int64)
  1236  		w2.AddArg2(tt, v2)
  1237  		v13 := b.NewValue0(v.Pos, OpWasmI64Add, typ.Int64)
  1238  		v14 := b.NewValue0(v.Pos, OpWasmI64Add, typ.Int64)
  1239  		v15 := b.NewValue0(v.Pos, OpWasmI64Mul, typ.Int64)
  1240  		v15.AddArg2(x1, y1)
  1241  		v14.AddArg2(v15, w2)
  1242  		v16 := b.NewValue0(v.Pos, OpWasmI64ShrS, typ.Int64)
  1243  		v16.AddArg2(w1, v2)
  1244  		v13.AddArg2(v14, v16)
  1245  		v.AddArgs(x0, x1, y0, y1, x0y0, tt, w1, w2, v13)
  1246  		return true
  1247  	}
  1248  }
  1249  func rewriteValueWasm_OpHmul64u(v *Value) bool {
  1250  	v_1 := v.Args[1]
  1251  	v_0 := v.Args[0]
  1252  	b := v.Block
  1253  	typ := &b.Func.Config.Types
  1254  	// match: (Hmul64u <t> x y)
  1255  	// result: (Last <t> x0: (ZeroExt32to64 x) x1: (I64ShrU x (I64Const [32])) y0: (ZeroExt32to64 y) y1: (I64ShrU y (I64Const [32])) w0: (I64Mul x0 y0) tt: (I64Add (I64Mul x1 y0) (I64ShrU w0 (I64Const [32]))) w1: (I64Add (I64Mul x0 y1) (ZeroExt32to64 tt)) w2: (I64ShrU tt (I64Const [32])) hi: (I64Add (I64Add (I64Mul x1 y1) w2) (I64ShrU w1 (I64Const [32]))))
  1256  	for {
  1257  		t := v.Type
  1258  		x := v_0
  1259  		y := v_1
  1260  		v.reset(OpLast)
  1261  		v.Type = t
  1262  		x0 := b.NewValue0(v.Pos, OpZeroExt32to64, typ.UInt64)
  1263  		x0.AddArg(x)
  1264  		x1 := b.NewValue0(v.Pos, OpWasmI64ShrU, typ.Int64)
  1265  		v2 := b.NewValue0(v.Pos, OpWasmI64Const, typ.Int64)
  1266  		v2.AuxInt = int64ToAuxInt(32)
  1267  		x1.AddArg2(x, v2)
  1268  		y0 := b.NewValue0(v.Pos, OpZeroExt32to64, typ.UInt64)
  1269  		y0.AddArg(y)
  1270  		y1 := b.NewValue0(v.Pos, OpWasmI64ShrU, typ.Int64)
  1271  		y1.AddArg2(y, v2)
  1272  		w0 := b.NewValue0(v.Pos, OpWasmI64Mul, typ.Int64)
  1273  		w0.AddArg2(x0, y0)
  1274  		tt := b.NewValue0(v.Pos, OpWasmI64Add, typ.Int64)
  1275  		v7 := b.NewValue0(v.Pos, OpWasmI64Mul, typ.Int64)
  1276  		v7.AddArg2(x1, y0)
  1277  		v8 := b.NewValue0(v.Pos, OpWasmI64ShrU, typ.Int64)
  1278  		v8.AddArg2(w0, v2)
  1279  		tt.AddArg2(v7, v8)
  1280  		w1 := b.NewValue0(v.Pos, OpWasmI64Add, typ.Int64)
  1281  		v10 := b.NewValue0(v.Pos, OpWasmI64Mul, typ.Int64)
  1282  		v10.AddArg2(x0, y1)
  1283  		v11 := b.NewValue0(v.Pos, OpZeroExt32to64, typ.UInt64)
  1284  		v11.AddArg(tt)
  1285  		w1.AddArg2(v10, v11)
  1286  		w2 := b.NewValue0(v.Pos, OpWasmI64ShrU, typ.Int64)
  1287  		w2.AddArg2(tt, v2)
  1288  		hi := b.NewValue0(v.Pos, OpWasmI64Add, typ.Int64)
  1289  		v14 := b.NewValue0(v.Pos, OpWasmI64Add, typ.Int64)
  1290  		v15 := b.NewValue0(v.Pos, OpWasmI64Mul, typ.Int64)
  1291  		v15.AddArg2(x1, y1)
  1292  		v14.AddArg2(v15, w2)
  1293  		v16 := b.NewValue0(v.Pos, OpWasmI64ShrU, typ.Int64)
  1294  		v16.AddArg2(w1, v2)
  1295  		hi.AddArg2(v14, v16)
  1296  		v.AddArgs(x0, x1, y0, y1, w0, tt, w1, w2, hi)
  1297  		return true
  1298  	}
  1299  }
  1300  func rewriteValueWasm_OpIsNonNil(v *Value) bool {
  1301  	v_0 := v.Args[0]
  1302  	b := v.Block
  1303  	typ := &b.Func.Config.Types
  1304  	// match: (IsNonNil p)
  1305  	// result: (I64Eqz (I64Eqz p))
  1306  	for {
  1307  		p := v_0
  1308  		v.reset(OpWasmI64Eqz)
  1309  		v0 := b.NewValue0(v.Pos, OpWasmI64Eqz, typ.Bool)
  1310  		v0.AddArg(p)
  1311  		v.AddArg(v0)
  1312  		return true
  1313  	}
  1314  }
  1315  func rewriteValueWasm_OpLast(v *Value) bool {
  1316  	// match: (Last ___)
  1317  	// result: v.Args[len(v.Args)-1]
  1318  	for {
  1319  		v.copyOf(v.Args[len(v.Args)-1])
  1320  		return true
  1321  	}
  1322  }
  1323  func rewriteValueWasm_OpLeq16(v *Value) bool {
  1324  	v_1 := v.Args[1]
  1325  	v_0 := v.Args[0]
  1326  	b := v.Block
  1327  	typ := &b.Func.Config.Types
  1328  	// match: (Leq16 x y)
  1329  	// result: (I64LeS (SignExt16to64 x) (SignExt16to64 y))
  1330  	for {
  1331  		x := v_0
  1332  		y := v_1
  1333  		v.reset(OpWasmI64LeS)
  1334  		v0 := b.NewValue0(v.Pos, OpSignExt16to64, typ.Int64)
  1335  		v0.AddArg(x)
  1336  		v1 := b.NewValue0(v.Pos, OpSignExt16to64, typ.Int64)
  1337  		v1.AddArg(y)
  1338  		v.AddArg2(v0, v1)
  1339  		return true
  1340  	}
  1341  }
  1342  func rewriteValueWasm_OpLeq16U(v *Value) bool {
  1343  	v_1 := v.Args[1]
  1344  	v_0 := v.Args[0]
  1345  	b := v.Block
  1346  	typ := &b.Func.Config.Types
  1347  	// match: (Leq16U x y)
  1348  	// result: (I64LeU (ZeroExt16to64 x) (ZeroExt16to64 y))
  1349  	for {
  1350  		x := v_0
  1351  		y := v_1
  1352  		v.reset(OpWasmI64LeU)
  1353  		v0 := b.NewValue0(v.Pos, OpZeroExt16to64, typ.UInt64)
  1354  		v0.AddArg(x)
  1355  		v1 := b.NewValue0(v.Pos, OpZeroExt16to64, typ.UInt64)
  1356  		v1.AddArg(y)
  1357  		v.AddArg2(v0, v1)
  1358  		return true
  1359  	}
  1360  }
  1361  func rewriteValueWasm_OpLeq32(v *Value) bool {
  1362  	v_1 := v.Args[1]
  1363  	v_0 := v.Args[0]
  1364  	b := v.Block
  1365  	typ := &b.Func.Config.Types
  1366  	// match: (Leq32 x y)
  1367  	// result: (I64LeS (SignExt32to64 x) (SignExt32to64 y))
  1368  	for {
  1369  		x := v_0
  1370  		y := v_1
  1371  		v.reset(OpWasmI64LeS)
  1372  		v0 := b.NewValue0(v.Pos, OpSignExt32to64, typ.Int64)
  1373  		v0.AddArg(x)
  1374  		v1 := b.NewValue0(v.Pos, OpSignExt32to64, typ.Int64)
  1375  		v1.AddArg(y)
  1376  		v.AddArg2(v0, v1)
  1377  		return true
  1378  	}
  1379  }
  1380  func rewriteValueWasm_OpLeq32U(v *Value) bool {
  1381  	v_1 := v.Args[1]
  1382  	v_0 := v.Args[0]
  1383  	b := v.Block
  1384  	typ := &b.Func.Config.Types
  1385  	// match: (Leq32U x y)
  1386  	// result: (I64LeU (ZeroExt32to64 x) (ZeroExt32to64 y))
  1387  	for {
  1388  		x := v_0
  1389  		y := v_1
  1390  		v.reset(OpWasmI64LeU)
  1391  		v0 := b.NewValue0(v.Pos, OpZeroExt32to64, typ.UInt64)
  1392  		v0.AddArg(x)
  1393  		v1 := b.NewValue0(v.Pos, OpZeroExt32to64, typ.UInt64)
  1394  		v1.AddArg(y)
  1395  		v.AddArg2(v0, v1)
  1396  		return true
  1397  	}
  1398  }
  1399  func rewriteValueWasm_OpLeq8(v *Value) bool {
  1400  	v_1 := v.Args[1]
  1401  	v_0 := v.Args[0]
  1402  	b := v.Block
  1403  	typ := &b.Func.Config.Types
  1404  	// match: (Leq8 x y)
  1405  	// result: (I64LeS (SignExt8to64 x) (SignExt8to64 y))
  1406  	for {
  1407  		x := v_0
  1408  		y := v_1
  1409  		v.reset(OpWasmI64LeS)
  1410  		v0 := b.NewValue0(v.Pos, OpSignExt8to64, typ.Int64)
  1411  		v0.AddArg(x)
  1412  		v1 := b.NewValue0(v.Pos, OpSignExt8to64, typ.Int64)
  1413  		v1.AddArg(y)
  1414  		v.AddArg2(v0, v1)
  1415  		return true
  1416  	}
  1417  }
  1418  func rewriteValueWasm_OpLeq8U(v *Value) bool {
  1419  	v_1 := v.Args[1]
  1420  	v_0 := v.Args[0]
  1421  	b := v.Block
  1422  	typ := &b.Func.Config.Types
  1423  	// match: (Leq8U x y)
  1424  	// result: (I64LeU (ZeroExt8to64 x) (ZeroExt8to64 y))
  1425  	for {
  1426  		x := v_0
  1427  		y := v_1
  1428  		v.reset(OpWasmI64LeU)
  1429  		v0 := b.NewValue0(v.Pos, OpZeroExt8to64, typ.UInt64)
  1430  		v0.AddArg(x)
  1431  		v1 := b.NewValue0(v.Pos, OpZeroExt8to64, typ.UInt64)
  1432  		v1.AddArg(y)
  1433  		v.AddArg2(v0, v1)
  1434  		return true
  1435  	}
  1436  }
  1437  func rewriteValueWasm_OpLess16(v *Value) bool {
  1438  	v_1 := v.Args[1]
  1439  	v_0 := v.Args[0]
  1440  	b := v.Block
  1441  	typ := &b.Func.Config.Types
  1442  	// match: (Less16 x y)
  1443  	// result: (I64LtS (SignExt16to64 x) (SignExt16to64 y))
  1444  	for {
  1445  		x := v_0
  1446  		y := v_1
  1447  		v.reset(OpWasmI64LtS)
  1448  		v0 := b.NewValue0(v.Pos, OpSignExt16to64, typ.Int64)
  1449  		v0.AddArg(x)
  1450  		v1 := b.NewValue0(v.Pos, OpSignExt16to64, typ.Int64)
  1451  		v1.AddArg(y)
  1452  		v.AddArg2(v0, v1)
  1453  		return true
  1454  	}
  1455  }
  1456  func rewriteValueWasm_OpLess16U(v *Value) bool {
  1457  	v_1 := v.Args[1]
  1458  	v_0 := v.Args[0]
  1459  	b := v.Block
  1460  	typ := &b.Func.Config.Types
  1461  	// match: (Less16U x y)
  1462  	// result: (I64LtU (ZeroExt16to64 x) (ZeroExt16to64 y))
  1463  	for {
  1464  		x := v_0
  1465  		y := v_1
  1466  		v.reset(OpWasmI64LtU)
  1467  		v0 := b.NewValue0(v.Pos, OpZeroExt16to64, typ.UInt64)
  1468  		v0.AddArg(x)
  1469  		v1 := b.NewValue0(v.Pos, OpZeroExt16to64, typ.UInt64)
  1470  		v1.AddArg(y)
  1471  		v.AddArg2(v0, v1)
  1472  		return true
  1473  	}
  1474  }
  1475  func rewriteValueWasm_OpLess32(v *Value) bool {
  1476  	v_1 := v.Args[1]
  1477  	v_0 := v.Args[0]
  1478  	b := v.Block
  1479  	typ := &b.Func.Config.Types
  1480  	// match: (Less32 x y)
  1481  	// result: (I64LtS (SignExt32to64 x) (SignExt32to64 y))
  1482  	for {
  1483  		x := v_0
  1484  		y := v_1
  1485  		v.reset(OpWasmI64LtS)
  1486  		v0 := b.NewValue0(v.Pos, OpSignExt32to64, typ.Int64)
  1487  		v0.AddArg(x)
  1488  		v1 := b.NewValue0(v.Pos, OpSignExt32to64, typ.Int64)
  1489  		v1.AddArg(y)
  1490  		v.AddArg2(v0, v1)
  1491  		return true
  1492  	}
  1493  }
  1494  func rewriteValueWasm_OpLess32U(v *Value) bool {
  1495  	v_1 := v.Args[1]
  1496  	v_0 := v.Args[0]
  1497  	b := v.Block
  1498  	typ := &b.Func.Config.Types
  1499  	// match: (Less32U x y)
  1500  	// result: (I64LtU (ZeroExt32to64 x) (ZeroExt32to64 y))
  1501  	for {
  1502  		x := v_0
  1503  		y := v_1
  1504  		v.reset(OpWasmI64LtU)
  1505  		v0 := b.NewValue0(v.Pos, OpZeroExt32to64, typ.UInt64)
  1506  		v0.AddArg(x)
  1507  		v1 := b.NewValue0(v.Pos, OpZeroExt32to64, typ.UInt64)
  1508  		v1.AddArg(y)
  1509  		v.AddArg2(v0, v1)
  1510  		return true
  1511  	}
  1512  }
  1513  func rewriteValueWasm_OpLess8(v *Value) bool {
  1514  	v_1 := v.Args[1]
  1515  	v_0 := v.Args[0]
  1516  	b := v.Block
  1517  	typ := &b.Func.Config.Types
  1518  	// match: (Less8 x y)
  1519  	// result: (I64LtS (SignExt8to64 x) (SignExt8to64 y))
  1520  	for {
  1521  		x := v_0
  1522  		y := v_1
  1523  		v.reset(OpWasmI64LtS)
  1524  		v0 := b.NewValue0(v.Pos, OpSignExt8to64, typ.Int64)
  1525  		v0.AddArg(x)
  1526  		v1 := b.NewValue0(v.Pos, OpSignExt8to64, typ.Int64)
  1527  		v1.AddArg(y)
  1528  		v.AddArg2(v0, v1)
  1529  		return true
  1530  	}
  1531  }
  1532  func rewriteValueWasm_OpLess8U(v *Value) bool {
  1533  	v_1 := v.Args[1]
  1534  	v_0 := v.Args[0]
  1535  	b := v.Block
  1536  	typ := &b.Func.Config.Types
  1537  	// match: (Less8U x y)
  1538  	// result: (I64LtU (ZeroExt8to64 x) (ZeroExt8to64 y))
  1539  	for {
  1540  		x := v_0
  1541  		y := v_1
  1542  		v.reset(OpWasmI64LtU)
  1543  		v0 := b.NewValue0(v.Pos, OpZeroExt8to64, typ.UInt64)
  1544  		v0.AddArg(x)
  1545  		v1 := b.NewValue0(v.Pos, OpZeroExt8to64, typ.UInt64)
  1546  		v1.AddArg(y)
  1547  		v.AddArg2(v0, v1)
  1548  		return true
  1549  	}
  1550  }
  1551  func rewriteValueWasm_OpLoad(v *Value) bool {
  1552  	v_1 := v.Args[1]
  1553  	v_0 := v.Args[0]
  1554  	// match: (Load <t> ptr mem)
  1555  	// cond: is32BitFloat(t)
  1556  	// result: (F32Load ptr mem)
  1557  	for {
  1558  		t := v.Type
  1559  		ptr := v_0
  1560  		mem := v_1
  1561  		if !(is32BitFloat(t)) {
  1562  			break
  1563  		}
  1564  		v.reset(OpWasmF32Load)
  1565  		v.AddArg2(ptr, mem)
  1566  		return true
  1567  	}
  1568  	// match: (Load <t> ptr mem)
  1569  	// cond: is64BitFloat(t)
  1570  	// result: (F64Load ptr mem)
  1571  	for {
  1572  		t := v.Type
  1573  		ptr := v_0
  1574  		mem := v_1
  1575  		if !(is64BitFloat(t)) {
  1576  			break
  1577  		}
  1578  		v.reset(OpWasmF64Load)
  1579  		v.AddArg2(ptr, mem)
  1580  		return true
  1581  	}
  1582  	// match: (Load <t> ptr mem)
  1583  	// cond: t.Size() == 8
  1584  	// result: (I64Load ptr mem)
  1585  	for {
  1586  		t := v.Type
  1587  		ptr := v_0
  1588  		mem := v_1
  1589  		if !(t.Size() == 8) {
  1590  			break
  1591  		}
  1592  		v.reset(OpWasmI64Load)
  1593  		v.AddArg2(ptr, mem)
  1594  		return true
  1595  	}
  1596  	// match: (Load <t> ptr mem)
  1597  	// cond: t.Size() == 4 && !t.IsSigned()
  1598  	// result: (I64Load32U ptr mem)
  1599  	for {
  1600  		t := v.Type
  1601  		ptr := v_0
  1602  		mem := v_1
  1603  		if !(t.Size() == 4 && !t.IsSigned()) {
  1604  			break
  1605  		}
  1606  		v.reset(OpWasmI64Load32U)
  1607  		v.AddArg2(ptr, mem)
  1608  		return true
  1609  	}
  1610  	// match: (Load <t> ptr mem)
  1611  	// cond: t.Size() == 4 && t.IsSigned()
  1612  	// result: (I64Load32S ptr mem)
  1613  	for {
  1614  		t := v.Type
  1615  		ptr := v_0
  1616  		mem := v_1
  1617  		if !(t.Size() == 4 && t.IsSigned()) {
  1618  			break
  1619  		}
  1620  		v.reset(OpWasmI64Load32S)
  1621  		v.AddArg2(ptr, mem)
  1622  		return true
  1623  	}
  1624  	// match: (Load <t> ptr mem)
  1625  	// cond: t.Size() == 2 && !t.IsSigned()
  1626  	// result: (I64Load16U ptr mem)
  1627  	for {
  1628  		t := v.Type
  1629  		ptr := v_0
  1630  		mem := v_1
  1631  		if !(t.Size() == 2 && !t.IsSigned()) {
  1632  			break
  1633  		}
  1634  		v.reset(OpWasmI64Load16U)
  1635  		v.AddArg2(ptr, mem)
  1636  		return true
  1637  	}
  1638  	// match: (Load <t> ptr mem)
  1639  	// cond: t.Size() == 2 && t.IsSigned()
  1640  	// result: (I64Load16S ptr mem)
  1641  	for {
  1642  		t := v.Type
  1643  		ptr := v_0
  1644  		mem := v_1
  1645  		if !(t.Size() == 2 && t.IsSigned()) {
  1646  			break
  1647  		}
  1648  		v.reset(OpWasmI64Load16S)
  1649  		v.AddArg2(ptr, mem)
  1650  		return true
  1651  	}
  1652  	// match: (Load <t> ptr mem)
  1653  	// cond: t.Size() == 1 && !t.IsSigned()
  1654  	// result: (I64Load8U ptr mem)
  1655  	for {
  1656  		t := v.Type
  1657  		ptr := v_0
  1658  		mem := v_1
  1659  		if !(t.Size() == 1 && !t.IsSigned()) {
  1660  			break
  1661  		}
  1662  		v.reset(OpWasmI64Load8U)
  1663  		v.AddArg2(ptr, mem)
  1664  		return true
  1665  	}
  1666  	// match: (Load <t> ptr mem)
  1667  	// cond: t.Size() == 1 && t.IsSigned()
  1668  	// result: (I64Load8S ptr mem)
  1669  	for {
  1670  		t := v.Type
  1671  		ptr := v_0
  1672  		mem := v_1
  1673  		if !(t.Size() == 1 && t.IsSigned()) {
  1674  			break
  1675  		}
  1676  		v.reset(OpWasmI64Load8S)
  1677  		v.AddArg2(ptr, mem)
  1678  		return true
  1679  	}
  1680  	return false
  1681  }
  1682  func rewriteValueWasm_OpLocalAddr(v *Value) bool {
  1683  	v_1 := v.Args[1]
  1684  	v_0 := v.Args[0]
  1685  	b := v.Block
  1686  	typ := &b.Func.Config.Types
  1687  	// match: (LocalAddr <t> {sym} base mem)
  1688  	// cond: t.Elem().HasPointers()
  1689  	// result: (LoweredAddr {sym} (SPanchored base mem))
  1690  	for {
  1691  		t := v.Type
  1692  		sym := auxToSym(v.Aux)
  1693  		base := v_0
  1694  		mem := v_1
  1695  		if !(t.Elem().HasPointers()) {
  1696  			break
  1697  		}
  1698  		v.reset(OpWasmLoweredAddr)
  1699  		v.Aux = symToAux(sym)
  1700  		v0 := b.NewValue0(v.Pos, OpSPanchored, typ.Uintptr)
  1701  		v0.AddArg2(base, mem)
  1702  		v.AddArg(v0)
  1703  		return true
  1704  	}
  1705  	// match: (LocalAddr <t> {sym} base _)
  1706  	// cond: !t.Elem().HasPointers()
  1707  	// result: (LoweredAddr {sym} base)
  1708  	for {
  1709  		t := v.Type
  1710  		sym := auxToSym(v.Aux)
  1711  		base := v_0
  1712  		if !(!t.Elem().HasPointers()) {
  1713  			break
  1714  		}
  1715  		v.reset(OpWasmLoweredAddr)
  1716  		v.Aux = symToAux(sym)
  1717  		v.AddArg(base)
  1718  		return true
  1719  	}
  1720  	return false
  1721  }
  1722  func rewriteValueWasm_OpLsh16x16(v *Value) bool {
  1723  	v_1 := v.Args[1]
  1724  	v_0 := v.Args[0]
  1725  	b := v.Block
  1726  	typ := &b.Func.Config.Types
  1727  	// match: (Lsh16x16 [c] x y)
  1728  	// result: (Lsh64x64 [c] x (ZeroExt16to64 y))
  1729  	for {
  1730  		c := auxIntToBool(v.AuxInt)
  1731  		x := v_0
  1732  		y := v_1
  1733  		v.reset(OpLsh64x64)
  1734  		v.AuxInt = boolToAuxInt(c)
  1735  		v0 := b.NewValue0(v.Pos, OpZeroExt16to64, typ.UInt64)
  1736  		v0.AddArg(y)
  1737  		v.AddArg2(x, v0)
  1738  		return true
  1739  	}
  1740  }
  1741  func rewriteValueWasm_OpLsh16x32(v *Value) bool {
  1742  	v_1 := v.Args[1]
  1743  	v_0 := v.Args[0]
  1744  	b := v.Block
  1745  	typ := &b.Func.Config.Types
  1746  	// match: (Lsh16x32 [c] x y)
  1747  	// result: (Lsh64x64 [c] x (ZeroExt32to64 y))
  1748  	for {
  1749  		c := auxIntToBool(v.AuxInt)
  1750  		x := v_0
  1751  		y := v_1
  1752  		v.reset(OpLsh64x64)
  1753  		v.AuxInt = boolToAuxInt(c)
  1754  		v0 := b.NewValue0(v.Pos, OpZeroExt32to64, typ.UInt64)
  1755  		v0.AddArg(y)
  1756  		v.AddArg2(x, v0)
  1757  		return true
  1758  	}
  1759  }
  1760  func rewriteValueWasm_OpLsh16x8(v *Value) bool {
  1761  	v_1 := v.Args[1]
  1762  	v_0 := v.Args[0]
  1763  	b := v.Block
  1764  	typ := &b.Func.Config.Types
  1765  	// match: (Lsh16x8 [c] x y)
  1766  	// result: (Lsh64x64 [c] x (ZeroExt8to64 y))
  1767  	for {
  1768  		c := auxIntToBool(v.AuxInt)
  1769  		x := v_0
  1770  		y := v_1
  1771  		v.reset(OpLsh64x64)
  1772  		v.AuxInt = boolToAuxInt(c)
  1773  		v0 := b.NewValue0(v.Pos, OpZeroExt8to64, typ.UInt64)
  1774  		v0.AddArg(y)
  1775  		v.AddArg2(x, v0)
  1776  		return true
  1777  	}
  1778  }
  1779  func rewriteValueWasm_OpLsh32x16(v *Value) bool {
  1780  	v_1 := v.Args[1]
  1781  	v_0 := v.Args[0]
  1782  	b := v.Block
  1783  	typ := &b.Func.Config.Types
  1784  	// match: (Lsh32x16 [c] x y)
  1785  	// result: (Lsh64x64 [c] x (ZeroExt16to64 y))
  1786  	for {
  1787  		c := auxIntToBool(v.AuxInt)
  1788  		x := v_0
  1789  		y := v_1
  1790  		v.reset(OpLsh64x64)
  1791  		v.AuxInt = boolToAuxInt(c)
  1792  		v0 := b.NewValue0(v.Pos, OpZeroExt16to64, typ.UInt64)
  1793  		v0.AddArg(y)
  1794  		v.AddArg2(x, v0)
  1795  		return true
  1796  	}
  1797  }
  1798  func rewriteValueWasm_OpLsh32x32(v *Value) bool {
  1799  	v_1 := v.Args[1]
  1800  	v_0 := v.Args[0]
  1801  	b := v.Block
  1802  	typ := &b.Func.Config.Types
  1803  	// match: (Lsh32x32 [c] x y)
  1804  	// result: (Lsh64x64 [c] x (ZeroExt32to64 y))
  1805  	for {
  1806  		c := auxIntToBool(v.AuxInt)
  1807  		x := v_0
  1808  		y := v_1
  1809  		v.reset(OpLsh64x64)
  1810  		v.AuxInt = boolToAuxInt(c)
  1811  		v0 := b.NewValue0(v.Pos, OpZeroExt32to64, typ.UInt64)
  1812  		v0.AddArg(y)
  1813  		v.AddArg2(x, v0)
  1814  		return true
  1815  	}
  1816  }
  1817  func rewriteValueWasm_OpLsh32x8(v *Value) bool {
  1818  	v_1 := v.Args[1]
  1819  	v_0 := v.Args[0]
  1820  	b := v.Block
  1821  	typ := &b.Func.Config.Types
  1822  	// match: (Lsh32x8 [c] x y)
  1823  	// result: (Lsh64x64 [c] x (ZeroExt8to64 y))
  1824  	for {
  1825  		c := auxIntToBool(v.AuxInt)
  1826  		x := v_0
  1827  		y := v_1
  1828  		v.reset(OpLsh64x64)
  1829  		v.AuxInt = boolToAuxInt(c)
  1830  		v0 := b.NewValue0(v.Pos, OpZeroExt8to64, typ.UInt64)
  1831  		v0.AddArg(y)
  1832  		v.AddArg2(x, v0)
  1833  		return true
  1834  	}
  1835  }
  1836  func rewriteValueWasm_OpLsh64x16(v *Value) bool {
  1837  	v_1 := v.Args[1]
  1838  	v_0 := v.Args[0]
  1839  	b := v.Block
  1840  	typ := &b.Func.Config.Types
  1841  	// match: (Lsh64x16 [c] x y)
  1842  	// result: (Lsh64x64 [c] x (ZeroExt16to64 y))
  1843  	for {
  1844  		c := auxIntToBool(v.AuxInt)
  1845  		x := v_0
  1846  		y := v_1
  1847  		v.reset(OpLsh64x64)
  1848  		v.AuxInt = boolToAuxInt(c)
  1849  		v0 := b.NewValue0(v.Pos, OpZeroExt16to64, typ.UInt64)
  1850  		v0.AddArg(y)
  1851  		v.AddArg2(x, v0)
  1852  		return true
  1853  	}
  1854  }
  1855  func rewriteValueWasm_OpLsh64x32(v *Value) bool {
  1856  	v_1 := v.Args[1]
  1857  	v_0 := v.Args[0]
  1858  	b := v.Block
  1859  	typ := &b.Func.Config.Types
  1860  	// match: (Lsh64x32 [c] x y)
  1861  	// result: (Lsh64x64 [c] x (ZeroExt32to64 y))
  1862  	for {
  1863  		c := auxIntToBool(v.AuxInt)
  1864  		x := v_0
  1865  		y := v_1
  1866  		v.reset(OpLsh64x64)
  1867  		v.AuxInt = boolToAuxInt(c)
  1868  		v0 := b.NewValue0(v.Pos, OpZeroExt32to64, typ.UInt64)
  1869  		v0.AddArg(y)
  1870  		v.AddArg2(x, v0)
  1871  		return true
  1872  	}
  1873  }
  1874  func rewriteValueWasm_OpLsh64x64(v *Value) bool {
  1875  	v_1 := v.Args[1]
  1876  	v_0 := v.Args[0]
  1877  	b := v.Block
  1878  	typ := &b.Func.Config.Types
  1879  	// match: (Lsh64x64 x y)
  1880  	// cond: shiftIsBounded(v)
  1881  	// result: (I64Shl x y)
  1882  	for {
  1883  		x := v_0
  1884  		y := v_1
  1885  		if !(shiftIsBounded(v)) {
  1886  			break
  1887  		}
  1888  		v.reset(OpWasmI64Shl)
  1889  		v.AddArg2(x, y)
  1890  		return true
  1891  	}
  1892  	// match: (Lsh64x64 x (I64Const [c]))
  1893  	// cond: uint64(c) < 64
  1894  	// result: (I64Shl x (I64Const [c]))
  1895  	for {
  1896  		x := v_0
  1897  		if v_1.Op != OpWasmI64Const {
  1898  			break
  1899  		}
  1900  		c := auxIntToInt64(v_1.AuxInt)
  1901  		if !(uint64(c) < 64) {
  1902  			break
  1903  		}
  1904  		v.reset(OpWasmI64Shl)
  1905  		v0 := b.NewValue0(v.Pos, OpWasmI64Const, typ.Int64)
  1906  		v0.AuxInt = int64ToAuxInt(c)
  1907  		v.AddArg2(x, v0)
  1908  		return true
  1909  	}
  1910  	// match: (Lsh64x64 x (I64Const [c]))
  1911  	// cond: uint64(c) >= 64
  1912  	// result: (I64Const [0])
  1913  	for {
  1914  		if v_1.Op != OpWasmI64Const {
  1915  			break
  1916  		}
  1917  		c := auxIntToInt64(v_1.AuxInt)
  1918  		if !(uint64(c) >= 64) {
  1919  			break
  1920  		}
  1921  		v.reset(OpWasmI64Const)
  1922  		v.AuxInt = int64ToAuxInt(0)
  1923  		return true
  1924  	}
  1925  	// match: (Lsh64x64 x y)
  1926  	// result: (Select (I64Shl x y) (I64Const [0]) (I64LtU y (I64Const [64])))
  1927  	for {
  1928  		x := v_0
  1929  		y := v_1
  1930  		v.reset(OpWasmSelect)
  1931  		v0 := b.NewValue0(v.Pos, OpWasmI64Shl, typ.Int64)
  1932  		v0.AddArg2(x, y)
  1933  		v1 := b.NewValue0(v.Pos, OpWasmI64Const, typ.Int64)
  1934  		v1.AuxInt = int64ToAuxInt(0)
  1935  		v2 := b.NewValue0(v.Pos, OpWasmI64LtU, typ.Bool)
  1936  		v3 := b.NewValue0(v.Pos, OpWasmI64Const, typ.Int64)
  1937  		v3.AuxInt = int64ToAuxInt(64)
  1938  		v2.AddArg2(y, v3)
  1939  		v.AddArg3(v0, v1, v2)
  1940  		return true
  1941  	}
  1942  }
  1943  func rewriteValueWasm_OpLsh64x8(v *Value) bool {
  1944  	v_1 := v.Args[1]
  1945  	v_0 := v.Args[0]
  1946  	b := v.Block
  1947  	typ := &b.Func.Config.Types
  1948  	// match: (Lsh64x8 [c] x y)
  1949  	// result: (Lsh64x64 [c] x (ZeroExt8to64 y))
  1950  	for {
  1951  		c := auxIntToBool(v.AuxInt)
  1952  		x := v_0
  1953  		y := v_1
  1954  		v.reset(OpLsh64x64)
  1955  		v.AuxInt = boolToAuxInt(c)
  1956  		v0 := b.NewValue0(v.Pos, OpZeroExt8to64, typ.UInt64)
  1957  		v0.AddArg(y)
  1958  		v.AddArg2(x, v0)
  1959  		return true
  1960  	}
  1961  }
  1962  func rewriteValueWasm_OpLsh8x16(v *Value) bool {
  1963  	v_1 := v.Args[1]
  1964  	v_0 := v.Args[0]
  1965  	b := v.Block
  1966  	typ := &b.Func.Config.Types
  1967  	// match: (Lsh8x16 [c] x y)
  1968  	// result: (Lsh64x64 [c] x (ZeroExt16to64 y))
  1969  	for {
  1970  		c := auxIntToBool(v.AuxInt)
  1971  		x := v_0
  1972  		y := v_1
  1973  		v.reset(OpLsh64x64)
  1974  		v.AuxInt = boolToAuxInt(c)
  1975  		v0 := b.NewValue0(v.Pos, OpZeroExt16to64, typ.UInt64)
  1976  		v0.AddArg(y)
  1977  		v.AddArg2(x, v0)
  1978  		return true
  1979  	}
  1980  }
  1981  func rewriteValueWasm_OpLsh8x32(v *Value) bool {
  1982  	v_1 := v.Args[1]
  1983  	v_0 := v.Args[0]
  1984  	b := v.Block
  1985  	typ := &b.Func.Config.Types
  1986  	// match: (Lsh8x32 [c] x y)
  1987  	// result: (Lsh64x64 [c] x (ZeroExt32to64 y))
  1988  	for {
  1989  		c := auxIntToBool(v.AuxInt)
  1990  		x := v_0
  1991  		y := v_1
  1992  		v.reset(OpLsh64x64)
  1993  		v.AuxInt = boolToAuxInt(c)
  1994  		v0 := b.NewValue0(v.Pos, OpZeroExt32to64, typ.UInt64)
  1995  		v0.AddArg(y)
  1996  		v.AddArg2(x, v0)
  1997  		return true
  1998  	}
  1999  }
  2000  func rewriteValueWasm_OpLsh8x8(v *Value) bool {
  2001  	v_1 := v.Args[1]
  2002  	v_0 := v.Args[0]
  2003  	b := v.Block
  2004  	typ := &b.Func.Config.Types
  2005  	// match: (Lsh8x8 [c] x y)
  2006  	// result: (Lsh64x64 [c] x (ZeroExt8to64 y))
  2007  	for {
  2008  		c := auxIntToBool(v.AuxInt)
  2009  		x := v_0
  2010  		y := v_1
  2011  		v.reset(OpLsh64x64)
  2012  		v.AuxInt = boolToAuxInt(c)
  2013  		v0 := b.NewValue0(v.Pos, OpZeroExt8to64, typ.UInt64)
  2014  		v0.AddArg(y)
  2015  		v.AddArg2(x, v0)
  2016  		return true
  2017  	}
  2018  }
  2019  func rewriteValueWasm_OpMod16(v *Value) bool {
  2020  	v_1 := v.Args[1]
  2021  	v_0 := v.Args[0]
  2022  	b := v.Block
  2023  	typ := &b.Func.Config.Types
  2024  	// match: (Mod16 [false] x y)
  2025  	// result: (I64RemS (SignExt16to64 x) (SignExt16to64 y))
  2026  	for {
  2027  		if auxIntToBool(v.AuxInt) != false {
  2028  			break
  2029  		}
  2030  		x := v_0
  2031  		y := v_1
  2032  		v.reset(OpWasmI64RemS)
  2033  		v0 := b.NewValue0(v.Pos, OpSignExt16to64, typ.Int64)
  2034  		v0.AddArg(x)
  2035  		v1 := b.NewValue0(v.Pos, OpSignExt16to64, typ.Int64)
  2036  		v1.AddArg(y)
  2037  		v.AddArg2(v0, v1)
  2038  		return true
  2039  	}
  2040  	return false
  2041  }
  2042  func rewriteValueWasm_OpMod16u(v *Value) bool {
  2043  	v_1 := v.Args[1]
  2044  	v_0 := v.Args[0]
  2045  	b := v.Block
  2046  	typ := &b.Func.Config.Types
  2047  	// match: (Mod16u x y)
  2048  	// result: (I64RemU (ZeroExt16to64 x) (ZeroExt16to64 y))
  2049  	for {
  2050  		x := v_0
  2051  		y := v_1
  2052  		v.reset(OpWasmI64RemU)
  2053  		v0 := b.NewValue0(v.Pos, OpZeroExt16to64, typ.UInt64)
  2054  		v0.AddArg(x)
  2055  		v1 := b.NewValue0(v.Pos, OpZeroExt16to64, typ.UInt64)
  2056  		v1.AddArg(y)
  2057  		v.AddArg2(v0, v1)
  2058  		return true
  2059  	}
  2060  }
  2061  func rewriteValueWasm_OpMod32(v *Value) bool {
  2062  	v_1 := v.Args[1]
  2063  	v_0 := v.Args[0]
  2064  	b := v.Block
  2065  	typ := &b.Func.Config.Types
  2066  	// match: (Mod32 [false] x y)
  2067  	// result: (I64RemS (SignExt32to64 x) (SignExt32to64 y))
  2068  	for {
  2069  		if auxIntToBool(v.AuxInt) != false {
  2070  			break
  2071  		}
  2072  		x := v_0
  2073  		y := v_1
  2074  		v.reset(OpWasmI64RemS)
  2075  		v0 := b.NewValue0(v.Pos, OpSignExt32to64, typ.Int64)
  2076  		v0.AddArg(x)
  2077  		v1 := b.NewValue0(v.Pos, OpSignExt32to64, typ.Int64)
  2078  		v1.AddArg(y)
  2079  		v.AddArg2(v0, v1)
  2080  		return true
  2081  	}
  2082  	return false
  2083  }
  2084  func rewriteValueWasm_OpMod32u(v *Value) bool {
  2085  	v_1 := v.Args[1]
  2086  	v_0 := v.Args[0]
  2087  	b := v.Block
  2088  	typ := &b.Func.Config.Types
  2089  	// match: (Mod32u x y)
  2090  	// result: (I64RemU (ZeroExt32to64 x) (ZeroExt32to64 y))
  2091  	for {
  2092  		x := v_0
  2093  		y := v_1
  2094  		v.reset(OpWasmI64RemU)
  2095  		v0 := b.NewValue0(v.Pos, OpZeroExt32to64, typ.UInt64)
  2096  		v0.AddArg(x)
  2097  		v1 := b.NewValue0(v.Pos, OpZeroExt32to64, typ.UInt64)
  2098  		v1.AddArg(y)
  2099  		v.AddArg2(v0, v1)
  2100  		return true
  2101  	}
  2102  }
  2103  func rewriteValueWasm_OpMod64(v *Value) bool {
  2104  	v_1 := v.Args[1]
  2105  	v_0 := v.Args[0]
  2106  	// match: (Mod64 [false] x y)
  2107  	// result: (I64RemS x y)
  2108  	for {
  2109  		if auxIntToBool(v.AuxInt) != false {
  2110  			break
  2111  		}
  2112  		x := v_0
  2113  		y := v_1
  2114  		v.reset(OpWasmI64RemS)
  2115  		v.AddArg2(x, y)
  2116  		return true
  2117  	}
  2118  	return false
  2119  }
  2120  func rewriteValueWasm_OpMod8(v *Value) bool {
  2121  	v_1 := v.Args[1]
  2122  	v_0 := v.Args[0]
  2123  	b := v.Block
  2124  	typ := &b.Func.Config.Types
  2125  	// match: (Mod8 x y)
  2126  	// result: (I64RemS (SignExt8to64 x) (SignExt8to64 y))
  2127  	for {
  2128  		x := v_0
  2129  		y := v_1
  2130  		v.reset(OpWasmI64RemS)
  2131  		v0 := b.NewValue0(v.Pos, OpSignExt8to64, typ.Int64)
  2132  		v0.AddArg(x)
  2133  		v1 := b.NewValue0(v.Pos, OpSignExt8to64, typ.Int64)
  2134  		v1.AddArg(y)
  2135  		v.AddArg2(v0, v1)
  2136  		return true
  2137  	}
  2138  }
  2139  func rewriteValueWasm_OpMod8u(v *Value) bool {
  2140  	v_1 := v.Args[1]
  2141  	v_0 := v.Args[0]
  2142  	b := v.Block
  2143  	typ := &b.Func.Config.Types
  2144  	// match: (Mod8u x y)
  2145  	// result: (I64RemU (ZeroExt8to64 x) (ZeroExt8to64 y))
  2146  	for {
  2147  		x := v_0
  2148  		y := v_1
  2149  		v.reset(OpWasmI64RemU)
  2150  		v0 := b.NewValue0(v.Pos, OpZeroExt8to64, typ.UInt64)
  2151  		v0.AddArg(x)
  2152  		v1 := b.NewValue0(v.Pos, OpZeroExt8to64, typ.UInt64)
  2153  		v1.AddArg(y)
  2154  		v.AddArg2(v0, v1)
  2155  		return true
  2156  	}
  2157  }
  2158  func rewriteValueWasm_OpMove(v *Value) bool {
  2159  	v_2 := v.Args[2]
  2160  	v_1 := v.Args[1]
  2161  	v_0 := v.Args[0]
  2162  	b := v.Block
  2163  	typ := &b.Func.Config.Types
  2164  	// match: (Move [0] _ _ mem)
  2165  	// result: mem
  2166  	for {
  2167  		if auxIntToInt64(v.AuxInt) != 0 {
  2168  			break
  2169  		}
  2170  		mem := v_2
  2171  		v.copyOf(mem)
  2172  		return true
  2173  	}
  2174  	// match: (Move [1] dst src mem)
  2175  	// result: (I64Store8 dst (I64Load8U src mem) mem)
  2176  	for {
  2177  		if auxIntToInt64(v.AuxInt) != 1 {
  2178  			break
  2179  		}
  2180  		dst := v_0
  2181  		src := v_1
  2182  		mem := v_2
  2183  		v.reset(OpWasmI64Store8)
  2184  		v0 := b.NewValue0(v.Pos, OpWasmI64Load8U, typ.UInt8)
  2185  		v0.AddArg2(src, mem)
  2186  		v.AddArg3(dst, v0, mem)
  2187  		return true
  2188  	}
  2189  	// match: (Move [2] dst src mem)
  2190  	// result: (I64Store16 dst (I64Load16U src mem) mem)
  2191  	for {
  2192  		if auxIntToInt64(v.AuxInt) != 2 {
  2193  			break
  2194  		}
  2195  		dst := v_0
  2196  		src := v_1
  2197  		mem := v_2
  2198  		v.reset(OpWasmI64Store16)
  2199  		v0 := b.NewValue0(v.Pos, OpWasmI64Load16U, typ.UInt16)
  2200  		v0.AddArg2(src, mem)
  2201  		v.AddArg3(dst, v0, mem)
  2202  		return true
  2203  	}
  2204  	// match: (Move [4] dst src mem)
  2205  	// result: (I64Store32 dst (I64Load32U src mem) mem)
  2206  	for {
  2207  		if auxIntToInt64(v.AuxInt) != 4 {
  2208  			break
  2209  		}
  2210  		dst := v_0
  2211  		src := v_1
  2212  		mem := v_2
  2213  		v.reset(OpWasmI64Store32)
  2214  		v0 := b.NewValue0(v.Pos, OpWasmI64Load32U, typ.UInt32)
  2215  		v0.AddArg2(src, mem)
  2216  		v.AddArg3(dst, v0, mem)
  2217  		return true
  2218  	}
  2219  	// match: (Move [8] dst src mem)
  2220  	// result: (I64Store dst (I64Load src mem) mem)
  2221  	for {
  2222  		if auxIntToInt64(v.AuxInt) != 8 {
  2223  			break
  2224  		}
  2225  		dst := v_0
  2226  		src := v_1
  2227  		mem := v_2
  2228  		v.reset(OpWasmI64Store)
  2229  		v0 := b.NewValue0(v.Pos, OpWasmI64Load, typ.UInt64)
  2230  		v0.AddArg2(src, mem)
  2231  		v.AddArg3(dst, v0, mem)
  2232  		return true
  2233  	}
  2234  	// match: (Move [16] dst src mem)
  2235  	// result: (I64Store [8] dst (I64Load [8] src mem) (I64Store dst (I64Load src mem) mem))
  2236  	for {
  2237  		if auxIntToInt64(v.AuxInt) != 16 {
  2238  			break
  2239  		}
  2240  		dst := v_0
  2241  		src := v_1
  2242  		mem := v_2
  2243  		v.reset(OpWasmI64Store)
  2244  		v.AuxInt = int64ToAuxInt(8)
  2245  		v0 := b.NewValue0(v.Pos, OpWasmI64Load, typ.UInt64)
  2246  		v0.AuxInt = int64ToAuxInt(8)
  2247  		v0.AddArg2(src, mem)
  2248  		v1 := b.NewValue0(v.Pos, OpWasmI64Store, types.TypeMem)
  2249  		v2 := b.NewValue0(v.Pos, OpWasmI64Load, typ.UInt64)
  2250  		v2.AddArg2(src, mem)
  2251  		v1.AddArg3(dst, v2, mem)
  2252  		v.AddArg3(dst, v0, v1)
  2253  		return true
  2254  	}
  2255  	// match: (Move [3] dst src mem)
  2256  	// result: (I64Store8 [2] dst (I64Load8U [2] src mem) (I64Store16 dst (I64Load16U src mem) mem))
  2257  	for {
  2258  		if auxIntToInt64(v.AuxInt) != 3 {
  2259  			break
  2260  		}
  2261  		dst := v_0
  2262  		src := v_1
  2263  		mem := v_2
  2264  		v.reset(OpWasmI64Store8)
  2265  		v.AuxInt = int64ToAuxInt(2)
  2266  		v0 := b.NewValue0(v.Pos, OpWasmI64Load8U, typ.UInt8)
  2267  		v0.AuxInt = int64ToAuxInt(2)
  2268  		v0.AddArg2(src, mem)
  2269  		v1 := b.NewValue0(v.Pos, OpWasmI64Store16, types.TypeMem)
  2270  		v2 := b.NewValue0(v.Pos, OpWasmI64Load16U, typ.UInt16)
  2271  		v2.AddArg2(src, mem)
  2272  		v1.AddArg3(dst, v2, mem)
  2273  		v.AddArg3(dst, v0, v1)
  2274  		return true
  2275  	}
  2276  	// match: (Move [5] dst src mem)
  2277  	// result: (I64Store8 [4] dst (I64Load8U [4] src mem) (I64Store32 dst (I64Load32U src mem) mem))
  2278  	for {
  2279  		if auxIntToInt64(v.AuxInt) != 5 {
  2280  			break
  2281  		}
  2282  		dst := v_0
  2283  		src := v_1
  2284  		mem := v_2
  2285  		v.reset(OpWasmI64Store8)
  2286  		v.AuxInt = int64ToAuxInt(4)
  2287  		v0 := b.NewValue0(v.Pos, OpWasmI64Load8U, typ.UInt8)
  2288  		v0.AuxInt = int64ToAuxInt(4)
  2289  		v0.AddArg2(src, mem)
  2290  		v1 := b.NewValue0(v.Pos, OpWasmI64Store32, types.TypeMem)
  2291  		v2 := b.NewValue0(v.Pos, OpWasmI64Load32U, typ.UInt32)
  2292  		v2.AddArg2(src, mem)
  2293  		v1.AddArg3(dst, v2, mem)
  2294  		v.AddArg3(dst, v0, v1)
  2295  		return true
  2296  	}
  2297  	// match: (Move [6] dst src mem)
  2298  	// result: (I64Store16 [4] dst (I64Load16U [4] src mem) (I64Store32 dst (I64Load32U src mem) mem))
  2299  	for {
  2300  		if auxIntToInt64(v.AuxInt) != 6 {
  2301  			break
  2302  		}
  2303  		dst := v_0
  2304  		src := v_1
  2305  		mem := v_2
  2306  		v.reset(OpWasmI64Store16)
  2307  		v.AuxInt = int64ToAuxInt(4)
  2308  		v0 := b.NewValue0(v.Pos, OpWasmI64Load16U, typ.UInt16)
  2309  		v0.AuxInt = int64ToAuxInt(4)
  2310  		v0.AddArg2(src, mem)
  2311  		v1 := b.NewValue0(v.Pos, OpWasmI64Store32, types.TypeMem)
  2312  		v2 := b.NewValue0(v.Pos, OpWasmI64Load32U, typ.UInt32)
  2313  		v2.AddArg2(src, mem)
  2314  		v1.AddArg3(dst, v2, mem)
  2315  		v.AddArg3(dst, v0, v1)
  2316  		return true
  2317  	}
  2318  	// match: (Move [7] dst src mem)
  2319  	// result: (I64Store32 [3] dst (I64Load32U [3] src mem) (I64Store32 dst (I64Load32U src mem) mem))
  2320  	for {
  2321  		if auxIntToInt64(v.AuxInt) != 7 {
  2322  			break
  2323  		}
  2324  		dst := v_0
  2325  		src := v_1
  2326  		mem := v_2
  2327  		v.reset(OpWasmI64Store32)
  2328  		v.AuxInt = int64ToAuxInt(3)
  2329  		v0 := b.NewValue0(v.Pos, OpWasmI64Load32U, typ.UInt32)
  2330  		v0.AuxInt = int64ToAuxInt(3)
  2331  		v0.AddArg2(src, mem)
  2332  		v1 := b.NewValue0(v.Pos, OpWasmI64Store32, types.TypeMem)
  2333  		v2 := b.NewValue0(v.Pos, OpWasmI64Load32U, typ.UInt32)
  2334  		v2.AddArg2(src, mem)
  2335  		v1.AddArg3(dst, v2, mem)
  2336  		v.AddArg3(dst, v0, v1)
  2337  		return true
  2338  	}
  2339  	// match: (Move [s] dst src mem)
  2340  	// cond: s > 8 && s < 16
  2341  	// result: (I64Store [s-8] dst (I64Load [s-8] src mem) (I64Store dst (I64Load src mem) mem))
  2342  	for {
  2343  		s := auxIntToInt64(v.AuxInt)
  2344  		dst := v_0
  2345  		src := v_1
  2346  		mem := v_2
  2347  		if !(s > 8 && s < 16) {
  2348  			break
  2349  		}
  2350  		v.reset(OpWasmI64Store)
  2351  		v.AuxInt = int64ToAuxInt(s - 8)
  2352  		v0 := b.NewValue0(v.Pos, OpWasmI64Load, typ.UInt64)
  2353  		v0.AuxInt = int64ToAuxInt(s - 8)
  2354  		v0.AddArg2(src, mem)
  2355  		v1 := b.NewValue0(v.Pos, OpWasmI64Store, types.TypeMem)
  2356  		v2 := b.NewValue0(v.Pos, OpWasmI64Load, typ.UInt64)
  2357  		v2.AddArg2(src, mem)
  2358  		v1.AddArg3(dst, v2, mem)
  2359  		v.AddArg3(dst, v0, v1)
  2360  		return true
  2361  	}
  2362  	// match: (Move [s] dst src mem)
  2363  	// cond: logLargeCopy(v, s)
  2364  	// result: (LoweredMove [s] dst src mem)
  2365  	for {
  2366  		s := auxIntToInt64(v.AuxInt)
  2367  		dst := v_0
  2368  		src := v_1
  2369  		mem := v_2
  2370  		if !(logLargeCopy(v, s)) {
  2371  			break
  2372  		}
  2373  		v.reset(OpWasmLoweredMove)
  2374  		v.AuxInt = int64ToAuxInt(s)
  2375  		v.AddArg3(dst, src, mem)
  2376  		return true
  2377  	}
  2378  	return false
  2379  }
  2380  func rewriteValueWasm_OpNeg16(v *Value) bool {
  2381  	v_0 := v.Args[0]
  2382  	b := v.Block
  2383  	typ := &b.Func.Config.Types
  2384  	// match: (Neg16 x)
  2385  	// result: (I64Sub (I64Const [0]) x)
  2386  	for {
  2387  		x := v_0
  2388  		v.reset(OpWasmI64Sub)
  2389  		v0 := b.NewValue0(v.Pos, OpWasmI64Const, typ.Int64)
  2390  		v0.AuxInt = int64ToAuxInt(0)
  2391  		v.AddArg2(v0, x)
  2392  		return true
  2393  	}
  2394  }
  2395  func rewriteValueWasm_OpNeg32(v *Value) bool {
  2396  	v_0 := v.Args[0]
  2397  	b := v.Block
  2398  	typ := &b.Func.Config.Types
  2399  	// match: (Neg32 x)
  2400  	// result: (I64Sub (I64Const [0]) x)
  2401  	for {
  2402  		x := v_0
  2403  		v.reset(OpWasmI64Sub)
  2404  		v0 := b.NewValue0(v.Pos, OpWasmI64Const, typ.Int64)
  2405  		v0.AuxInt = int64ToAuxInt(0)
  2406  		v.AddArg2(v0, x)
  2407  		return true
  2408  	}
  2409  }
  2410  func rewriteValueWasm_OpNeg64(v *Value) bool {
  2411  	v_0 := v.Args[0]
  2412  	b := v.Block
  2413  	typ := &b.Func.Config.Types
  2414  	// match: (Neg64 x)
  2415  	// result: (I64Sub (I64Const [0]) x)
  2416  	for {
  2417  		x := v_0
  2418  		v.reset(OpWasmI64Sub)
  2419  		v0 := b.NewValue0(v.Pos, OpWasmI64Const, typ.Int64)
  2420  		v0.AuxInt = int64ToAuxInt(0)
  2421  		v.AddArg2(v0, x)
  2422  		return true
  2423  	}
  2424  }
  2425  func rewriteValueWasm_OpNeg8(v *Value) bool {
  2426  	v_0 := v.Args[0]
  2427  	b := v.Block
  2428  	typ := &b.Func.Config.Types
  2429  	// match: (Neg8 x)
  2430  	// result: (I64Sub (I64Const [0]) x)
  2431  	for {
  2432  		x := v_0
  2433  		v.reset(OpWasmI64Sub)
  2434  		v0 := b.NewValue0(v.Pos, OpWasmI64Const, typ.Int64)
  2435  		v0.AuxInt = int64ToAuxInt(0)
  2436  		v.AddArg2(v0, x)
  2437  		return true
  2438  	}
  2439  }
  2440  func rewriteValueWasm_OpNeq16(v *Value) bool {
  2441  	v_1 := v.Args[1]
  2442  	v_0 := v.Args[0]
  2443  	b := v.Block
  2444  	typ := &b.Func.Config.Types
  2445  	// match: (Neq16 x y)
  2446  	// result: (I64Ne (ZeroExt16to64 x) (ZeroExt16to64 y))
  2447  	for {
  2448  		x := v_0
  2449  		y := v_1
  2450  		v.reset(OpWasmI64Ne)
  2451  		v0 := b.NewValue0(v.Pos, OpZeroExt16to64, typ.UInt64)
  2452  		v0.AddArg(x)
  2453  		v1 := b.NewValue0(v.Pos, OpZeroExt16to64, typ.UInt64)
  2454  		v1.AddArg(y)
  2455  		v.AddArg2(v0, v1)
  2456  		return true
  2457  	}
  2458  }
  2459  func rewriteValueWasm_OpNeq32(v *Value) bool {
  2460  	v_1 := v.Args[1]
  2461  	v_0 := v.Args[0]
  2462  	b := v.Block
  2463  	typ := &b.Func.Config.Types
  2464  	// match: (Neq32 x y)
  2465  	// result: (I64Ne (ZeroExt32to64 x) (ZeroExt32to64 y))
  2466  	for {
  2467  		x := v_0
  2468  		y := v_1
  2469  		v.reset(OpWasmI64Ne)
  2470  		v0 := b.NewValue0(v.Pos, OpZeroExt32to64, typ.UInt64)
  2471  		v0.AddArg(x)
  2472  		v1 := b.NewValue0(v.Pos, OpZeroExt32to64, typ.UInt64)
  2473  		v1.AddArg(y)
  2474  		v.AddArg2(v0, v1)
  2475  		return true
  2476  	}
  2477  }
  2478  func rewriteValueWasm_OpNeq8(v *Value) bool {
  2479  	v_1 := v.Args[1]
  2480  	v_0 := v.Args[0]
  2481  	b := v.Block
  2482  	typ := &b.Func.Config.Types
  2483  	// match: (Neq8 x y)
  2484  	// result: (I64Ne (ZeroExt8to64 x) (ZeroExt8to64 y))
  2485  	for {
  2486  		x := v_0
  2487  		y := v_1
  2488  		v.reset(OpWasmI64Ne)
  2489  		v0 := b.NewValue0(v.Pos, OpZeroExt8to64, typ.UInt64)
  2490  		v0.AddArg(x)
  2491  		v1 := b.NewValue0(v.Pos, OpZeroExt8to64, typ.UInt64)
  2492  		v1.AddArg(y)
  2493  		v.AddArg2(v0, v1)
  2494  		return true
  2495  	}
  2496  }
  2497  func rewriteValueWasm_OpPopCount16(v *Value) bool {
  2498  	v_0 := v.Args[0]
  2499  	b := v.Block
  2500  	typ := &b.Func.Config.Types
  2501  	// match: (PopCount16 x)
  2502  	// result: (I64Popcnt (ZeroExt16to64 x))
  2503  	for {
  2504  		x := v_0
  2505  		v.reset(OpWasmI64Popcnt)
  2506  		v0 := b.NewValue0(v.Pos, OpZeroExt16to64, typ.UInt64)
  2507  		v0.AddArg(x)
  2508  		v.AddArg(v0)
  2509  		return true
  2510  	}
  2511  }
  2512  func rewriteValueWasm_OpPopCount32(v *Value) bool {
  2513  	v_0 := v.Args[0]
  2514  	b := v.Block
  2515  	typ := &b.Func.Config.Types
  2516  	// match: (PopCount32 x)
  2517  	// result: (I64Popcnt (ZeroExt32to64 x))
  2518  	for {
  2519  		x := v_0
  2520  		v.reset(OpWasmI64Popcnt)
  2521  		v0 := b.NewValue0(v.Pos, OpZeroExt32to64, typ.UInt64)
  2522  		v0.AddArg(x)
  2523  		v.AddArg(v0)
  2524  		return true
  2525  	}
  2526  }
  2527  func rewriteValueWasm_OpPopCount8(v *Value) bool {
  2528  	v_0 := v.Args[0]
  2529  	b := v.Block
  2530  	typ := &b.Func.Config.Types
  2531  	// match: (PopCount8 x)
  2532  	// result: (I64Popcnt (ZeroExt8to64 x))
  2533  	for {
  2534  		x := v_0
  2535  		v.reset(OpWasmI64Popcnt)
  2536  		v0 := b.NewValue0(v.Pos, OpZeroExt8to64, typ.UInt64)
  2537  		v0.AddArg(x)
  2538  		v.AddArg(v0)
  2539  		return true
  2540  	}
  2541  }
  2542  func rewriteValueWasm_OpRotateLeft16(v *Value) bool {
  2543  	v_1 := v.Args[1]
  2544  	v_0 := v.Args[0]
  2545  	b := v.Block
  2546  	typ := &b.Func.Config.Types
  2547  	// match: (RotateLeft16 <t> x (I64Const [c]))
  2548  	// result: (Or16 (Lsh16x64 <t> x (I64Const [c&15])) (Rsh16Ux64 <t> x (I64Const [-c&15])))
  2549  	for {
  2550  		t := v.Type
  2551  		x := v_0
  2552  		if v_1.Op != OpWasmI64Const {
  2553  			break
  2554  		}
  2555  		c := auxIntToInt64(v_1.AuxInt)
  2556  		v.reset(OpOr16)
  2557  		v0 := b.NewValue0(v.Pos, OpLsh16x64, t)
  2558  		v1 := b.NewValue0(v.Pos, OpWasmI64Const, typ.Int64)
  2559  		v1.AuxInt = int64ToAuxInt(c & 15)
  2560  		v0.AddArg2(x, v1)
  2561  		v2 := b.NewValue0(v.Pos, OpRsh16Ux64, t)
  2562  		v3 := b.NewValue0(v.Pos, OpWasmI64Const, typ.Int64)
  2563  		v3.AuxInt = int64ToAuxInt(-c & 15)
  2564  		v2.AddArg2(x, v3)
  2565  		v.AddArg2(v0, v2)
  2566  		return true
  2567  	}
  2568  	return false
  2569  }
  2570  func rewriteValueWasm_OpRotateLeft8(v *Value) bool {
  2571  	v_1 := v.Args[1]
  2572  	v_0 := v.Args[0]
  2573  	b := v.Block
  2574  	typ := &b.Func.Config.Types
  2575  	// match: (RotateLeft8 <t> x (I64Const [c]))
  2576  	// result: (Or8 (Lsh8x64 <t> x (I64Const [c&7])) (Rsh8Ux64 <t> x (I64Const [-c&7])))
  2577  	for {
  2578  		t := v.Type
  2579  		x := v_0
  2580  		if v_1.Op != OpWasmI64Const {
  2581  			break
  2582  		}
  2583  		c := auxIntToInt64(v_1.AuxInt)
  2584  		v.reset(OpOr8)
  2585  		v0 := b.NewValue0(v.Pos, OpLsh8x64, t)
  2586  		v1 := b.NewValue0(v.Pos, OpWasmI64Const, typ.Int64)
  2587  		v1.AuxInt = int64ToAuxInt(c & 7)
  2588  		v0.AddArg2(x, v1)
  2589  		v2 := b.NewValue0(v.Pos, OpRsh8Ux64, t)
  2590  		v3 := b.NewValue0(v.Pos, OpWasmI64Const, typ.Int64)
  2591  		v3.AuxInt = int64ToAuxInt(-c & 7)
  2592  		v2.AddArg2(x, v3)
  2593  		v.AddArg2(v0, v2)
  2594  		return true
  2595  	}
  2596  	return false
  2597  }
  2598  func rewriteValueWasm_OpRsh16Ux16(v *Value) bool {
  2599  	v_1 := v.Args[1]
  2600  	v_0 := v.Args[0]
  2601  	b := v.Block
  2602  	typ := &b.Func.Config.Types
  2603  	// match: (Rsh16Ux16 [c] x y)
  2604  	// result: (Rsh64Ux64 [c] (ZeroExt16to64 x) (ZeroExt16to64 y))
  2605  	for {
  2606  		c := auxIntToBool(v.AuxInt)
  2607  		x := v_0
  2608  		y := v_1
  2609  		v.reset(OpRsh64Ux64)
  2610  		v.AuxInt = boolToAuxInt(c)
  2611  		v0 := b.NewValue0(v.Pos, OpZeroExt16to64, typ.UInt64)
  2612  		v0.AddArg(x)
  2613  		v1 := b.NewValue0(v.Pos, OpZeroExt16to64, typ.UInt64)
  2614  		v1.AddArg(y)
  2615  		v.AddArg2(v0, v1)
  2616  		return true
  2617  	}
  2618  }
  2619  func rewriteValueWasm_OpRsh16Ux32(v *Value) bool {
  2620  	v_1 := v.Args[1]
  2621  	v_0 := v.Args[0]
  2622  	b := v.Block
  2623  	typ := &b.Func.Config.Types
  2624  	// match: (Rsh16Ux32 [c] x y)
  2625  	// result: (Rsh64Ux64 [c] (ZeroExt16to64 x) (ZeroExt32to64 y))
  2626  	for {
  2627  		c := auxIntToBool(v.AuxInt)
  2628  		x := v_0
  2629  		y := v_1
  2630  		v.reset(OpRsh64Ux64)
  2631  		v.AuxInt = boolToAuxInt(c)
  2632  		v0 := b.NewValue0(v.Pos, OpZeroExt16to64, typ.UInt64)
  2633  		v0.AddArg(x)
  2634  		v1 := b.NewValue0(v.Pos, OpZeroExt32to64, typ.UInt64)
  2635  		v1.AddArg(y)
  2636  		v.AddArg2(v0, v1)
  2637  		return true
  2638  	}
  2639  }
  2640  func rewriteValueWasm_OpRsh16Ux64(v *Value) bool {
  2641  	v_1 := v.Args[1]
  2642  	v_0 := v.Args[0]
  2643  	b := v.Block
  2644  	typ := &b.Func.Config.Types
  2645  	// match: (Rsh16Ux64 [c] x y)
  2646  	// result: (Rsh64Ux64 [c] (ZeroExt16to64 x) y)
  2647  	for {
  2648  		c := auxIntToBool(v.AuxInt)
  2649  		x := v_0
  2650  		y := v_1
  2651  		v.reset(OpRsh64Ux64)
  2652  		v.AuxInt = boolToAuxInt(c)
  2653  		v0 := b.NewValue0(v.Pos, OpZeroExt16to64, typ.UInt64)
  2654  		v0.AddArg(x)
  2655  		v.AddArg2(v0, y)
  2656  		return true
  2657  	}
  2658  }
  2659  func rewriteValueWasm_OpRsh16Ux8(v *Value) bool {
  2660  	v_1 := v.Args[1]
  2661  	v_0 := v.Args[0]
  2662  	b := v.Block
  2663  	typ := &b.Func.Config.Types
  2664  	// match: (Rsh16Ux8 [c] x y)
  2665  	// result: (Rsh64Ux64 [c] (ZeroExt16to64 x) (ZeroExt8to64 y))
  2666  	for {
  2667  		c := auxIntToBool(v.AuxInt)
  2668  		x := v_0
  2669  		y := v_1
  2670  		v.reset(OpRsh64Ux64)
  2671  		v.AuxInt = boolToAuxInt(c)
  2672  		v0 := b.NewValue0(v.Pos, OpZeroExt16to64, typ.UInt64)
  2673  		v0.AddArg(x)
  2674  		v1 := b.NewValue0(v.Pos, OpZeroExt8to64, typ.UInt64)
  2675  		v1.AddArg(y)
  2676  		v.AddArg2(v0, v1)
  2677  		return true
  2678  	}
  2679  }
  2680  func rewriteValueWasm_OpRsh16x16(v *Value) bool {
  2681  	v_1 := v.Args[1]
  2682  	v_0 := v.Args[0]
  2683  	b := v.Block
  2684  	typ := &b.Func.Config.Types
  2685  	// match: (Rsh16x16 [c] x y)
  2686  	// result: (Rsh64x64 [c] (SignExt16to64 x) (ZeroExt16to64 y))
  2687  	for {
  2688  		c := auxIntToBool(v.AuxInt)
  2689  		x := v_0
  2690  		y := v_1
  2691  		v.reset(OpRsh64x64)
  2692  		v.AuxInt = boolToAuxInt(c)
  2693  		v0 := b.NewValue0(v.Pos, OpSignExt16to64, typ.Int64)
  2694  		v0.AddArg(x)
  2695  		v1 := b.NewValue0(v.Pos, OpZeroExt16to64, typ.UInt64)
  2696  		v1.AddArg(y)
  2697  		v.AddArg2(v0, v1)
  2698  		return true
  2699  	}
  2700  }
  2701  func rewriteValueWasm_OpRsh16x32(v *Value) bool {
  2702  	v_1 := v.Args[1]
  2703  	v_0 := v.Args[0]
  2704  	b := v.Block
  2705  	typ := &b.Func.Config.Types
  2706  	// match: (Rsh16x32 [c] x y)
  2707  	// result: (Rsh64x64 [c] (SignExt16to64 x) (ZeroExt32to64 y))
  2708  	for {
  2709  		c := auxIntToBool(v.AuxInt)
  2710  		x := v_0
  2711  		y := v_1
  2712  		v.reset(OpRsh64x64)
  2713  		v.AuxInt = boolToAuxInt(c)
  2714  		v0 := b.NewValue0(v.Pos, OpSignExt16to64, typ.Int64)
  2715  		v0.AddArg(x)
  2716  		v1 := b.NewValue0(v.Pos, OpZeroExt32to64, typ.UInt64)
  2717  		v1.AddArg(y)
  2718  		v.AddArg2(v0, v1)
  2719  		return true
  2720  	}
  2721  }
  2722  func rewriteValueWasm_OpRsh16x64(v *Value) bool {
  2723  	v_1 := v.Args[1]
  2724  	v_0 := v.Args[0]
  2725  	b := v.Block
  2726  	typ := &b.Func.Config.Types
  2727  	// match: (Rsh16x64 [c] x y)
  2728  	// result: (Rsh64x64 [c] (SignExt16to64 x) y)
  2729  	for {
  2730  		c := auxIntToBool(v.AuxInt)
  2731  		x := v_0
  2732  		y := v_1
  2733  		v.reset(OpRsh64x64)
  2734  		v.AuxInt = boolToAuxInt(c)
  2735  		v0 := b.NewValue0(v.Pos, OpSignExt16to64, typ.Int64)
  2736  		v0.AddArg(x)
  2737  		v.AddArg2(v0, y)
  2738  		return true
  2739  	}
  2740  }
  2741  func rewriteValueWasm_OpRsh16x8(v *Value) bool {
  2742  	v_1 := v.Args[1]
  2743  	v_0 := v.Args[0]
  2744  	b := v.Block
  2745  	typ := &b.Func.Config.Types
  2746  	// match: (Rsh16x8 [c] x y)
  2747  	// result: (Rsh64x64 [c] (SignExt16to64 x) (ZeroExt8to64 y))
  2748  	for {
  2749  		c := auxIntToBool(v.AuxInt)
  2750  		x := v_0
  2751  		y := v_1
  2752  		v.reset(OpRsh64x64)
  2753  		v.AuxInt = boolToAuxInt(c)
  2754  		v0 := b.NewValue0(v.Pos, OpSignExt16to64, typ.Int64)
  2755  		v0.AddArg(x)
  2756  		v1 := b.NewValue0(v.Pos, OpZeroExt8to64, typ.UInt64)
  2757  		v1.AddArg(y)
  2758  		v.AddArg2(v0, v1)
  2759  		return true
  2760  	}
  2761  }
  2762  func rewriteValueWasm_OpRsh32Ux16(v *Value) bool {
  2763  	v_1 := v.Args[1]
  2764  	v_0 := v.Args[0]
  2765  	b := v.Block
  2766  	typ := &b.Func.Config.Types
  2767  	// match: (Rsh32Ux16 [c] x y)
  2768  	// result: (Rsh64Ux64 [c] (ZeroExt32to64 x) (ZeroExt16to64 y))
  2769  	for {
  2770  		c := auxIntToBool(v.AuxInt)
  2771  		x := v_0
  2772  		y := v_1
  2773  		v.reset(OpRsh64Ux64)
  2774  		v.AuxInt = boolToAuxInt(c)
  2775  		v0 := b.NewValue0(v.Pos, OpZeroExt32to64, typ.UInt64)
  2776  		v0.AddArg(x)
  2777  		v1 := b.NewValue0(v.Pos, OpZeroExt16to64, typ.UInt64)
  2778  		v1.AddArg(y)
  2779  		v.AddArg2(v0, v1)
  2780  		return true
  2781  	}
  2782  }
  2783  func rewriteValueWasm_OpRsh32Ux32(v *Value) bool {
  2784  	v_1 := v.Args[1]
  2785  	v_0 := v.Args[0]
  2786  	b := v.Block
  2787  	typ := &b.Func.Config.Types
  2788  	// match: (Rsh32Ux32 [c] x y)
  2789  	// result: (Rsh64Ux64 [c] (ZeroExt32to64 x) (ZeroExt32to64 y))
  2790  	for {
  2791  		c := auxIntToBool(v.AuxInt)
  2792  		x := v_0
  2793  		y := v_1
  2794  		v.reset(OpRsh64Ux64)
  2795  		v.AuxInt = boolToAuxInt(c)
  2796  		v0 := b.NewValue0(v.Pos, OpZeroExt32to64, typ.UInt64)
  2797  		v0.AddArg(x)
  2798  		v1 := b.NewValue0(v.Pos, OpZeroExt32to64, typ.UInt64)
  2799  		v1.AddArg(y)
  2800  		v.AddArg2(v0, v1)
  2801  		return true
  2802  	}
  2803  }
  2804  func rewriteValueWasm_OpRsh32Ux64(v *Value) bool {
  2805  	v_1 := v.Args[1]
  2806  	v_0 := v.Args[0]
  2807  	b := v.Block
  2808  	typ := &b.Func.Config.Types
  2809  	// match: (Rsh32Ux64 [c] x y)
  2810  	// result: (Rsh64Ux64 [c] (ZeroExt32to64 x) y)
  2811  	for {
  2812  		c := auxIntToBool(v.AuxInt)
  2813  		x := v_0
  2814  		y := v_1
  2815  		v.reset(OpRsh64Ux64)
  2816  		v.AuxInt = boolToAuxInt(c)
  2817  		v0 := b.NewValue0(v.Pos, OpZeroExt32to64, typ.UInt64)
  2818  		v0.AddArg(x)
  2819  		v.AddArg2(v0, y)
  2820  		return true
  2821  	}
  2822  }
  2823  func rewriteValueWasm_OpRsh32Ux8(v *Value) bool {
  2824  	v_1 := v.Args[1]
  2825  	v_0 := v.Args[0]
  2826  	b := v.Block
  2827  	typ := &b.Func.Config.Types
  2828  	// match: (Rsh32Ux8 [c] x y)
  2829  	// result: (Rsh64Ux64 [c] (ZeroExt32to64 x) (ZeroExt8to64 y))
  2830  	for {
  2831  		c := auxIntToBool(v.AuxInt)
  2832  		x := v_0
  2833  		y := v_1
  2834  		v.reset(OpRsh64Ux64)
  2835  		v.AuxInt = boolToAuxInt(c)
  2836  		v0 := b.NewValue0(v.Pos, OpZeroExt32to64, typ.UInt64)
  2837  		v0.AddArg(x)
  2838  		v1 := b.NewValue0(v.Pos, OpZeroExt8to64, typ.UInt64)
  2839  		v1.AddArg(y)
  2840  		v.AddArg2(v0, v1)
  2841  		return true
  2842  	}
  2843  }
  2844  func rewriteValueWasm_OpRsh32x16(v *Value) bool {
  2845  	v_1 := v.Args[1]
  2846  	v_0 := v.Args[0]
  2847  	b := v.Block
  2848  	typ := &b.Func.Config.Types
  2849  	// match: (Rsh32x16 [c] x y)
  2850  	// result: (Rsh64x64 [c] (SignExt32to64 x) (ZeroExt16to64 y))
  2851  	for {
  2852  		c := auxIntToBool(v.AuxInt)
  2853  		x := v_0
  2854  		y := v_1
  2855  		v.reset(OpRsh64x64)
  2856  		v.AuxInt = boolToAuxInt(c)
  2857  		v0 := b.NewValue0(v.Pos, OpSignExt32to64, typ.Int64)
  2858  		v0.AddArg(x)
  2859  		v1 := b.NewValue0(v.Pos, OpZeroExt16to64, typ.UInt64)
  2860  		v1.AddArg(y)
  2861  		v.AddArg2(v0, v1)
  2862  		return true
  2863  	}
  2864  }
  2865  func rewriteValueWasm_OpRsh32x32(v *Value) bool {
  2866  	v_1 := v.Args[1]
  2867  	v_0 := v.Args[0]
  2868  	b := v.Block
  2869  	typ := &b.Func.Config.Types
  2870  	// match: (Rsh32x32 [c] x y)
  2871  	// result: (Rsh64x64 [c] (SignExt32to64 x) (ZeroExt32to64 y))
  2872  	for {
  2873  		c := auxIntToBool(v.AuxInt)
  2874  		x := v_0
  2875  		y := v_1
  2876  		v.reset(OpRsh64x64)
  2877  		v.AuxInt = boolToAuxInt(c)
  2878  		v0 := b.NewValue0(v.Pos, OpSignExt32to64, typ.Int64)
  2879  		v0.AddArg(x)
  2880  		v1 := b.NewValue0(v.Pos, OpZeroExt32to64, typ.UInt64)
  2881  		v1.AddArg(y)
  2882  		v.AddArg2(v0, v1)
  2883  		return true
  2884  	}
  2885  }
  2886  func rewriteValueWasm_OpRsh32x64(v *Value) bool {
  2887  	v_1 := v.Args[1]
  2888  	v_0 := v.Args[0]
  2889  	b := v.Block
  2890  	typ := &b.Func.Config.Types
  2891  	// match: (Rsh32x64 [c] x y)
  2892  	// result: (Rsh64x64 [c] (SignExt32to64 x) y)
  2893  	for {
  2894  		c := auxIntToBool(v.AuxInt)
  2895  		x := v_0
  2896  		y := v_1
  2897  		v.reset(OpRsh64x64)
  2898  		v.AuxInt = boolToAuxInt(c)
  2899  		v0 := b.NewValue0(v.Pos, OpSignExt32to64, typ.Int64)
  2900  		v0.AddArg(x)
  2901  		v.AddArg2(v0, y)
  2902  		return true
  2903  	}
  2904  }
  2905  func rewriteValueWasm_OpRsh32x8(v *Value) bool {
  2906  	v_1 := v.Args[1]
  2907  	v_0 := v.Args[0]
  2908  	b := v.Block
  2909  	typ := &b.Func.Config.Types
  2910  	// match: (Rsh32x8 [c] x y)
  2911  	// result: (Rsh64x64 [c] (SignExt32to64 x) (ZeroExt8to64 y))
  2912  	for {
  2913  		c := auxIntToBool(v.AuxInt)
  2914  		x := v_0
  2915  		y := v_1
  2916  		v.reset(OpRsh64x64)
  2917  		v.AuxInt = boolToAuxInt(c)
  2918  		v0 := b.NewValue0(v.Pos, OpSignExt32to64, typ.Int64)
  2919  		v0.AddArg(x)
  2920  		v1 := b.NewValue0(v.Pos, OpZeroExt8to64, typ.UInt64)
  2921  		v1.AddArg(y)
  2922  		v.AddArg2(v0, v1)
  2923  		return true
  2924  	}
  2925  }
  2926  func rewriteValueWasm_OpRsh64Ux16(v *Value) bool {
  2927  	v_1 := v.Args[1]
  2928  	v_0 := v.Args[0]
  2929  	b := v.Block
  2930  	typ := &b.Func.Config.Types
  2931  	// match: (Rsh64Ux16 [c] x y)
  2932  	// result: (Rsh64Ux64 [c] x (ZeroExt16to64 y))
  2933  	for {
  2934  		c := auxIntToBool(v.AuxInt)
  2935  		x := v_0
  2936  		y := v_1
  2937  		v.reset(OpRsh64Ux64)
  2938  		v.AuxInt = boolToAuxInt(c)
  2939  		v0 := b.NewValue0(v.Pos, OpZeroExt16to64, typ.UInt64)
  2940  		v0.AddArg(y)
  2941  		v.AddArg2(x, v0)
  2942  		return true
  2943  	}
  2944  }
  2945  func rewriteValueWasm_OpRsh64Ux32(v *Value) bool {
  2946  	v_1 := v.Args[1]
  2947  	v_0 := v.Args[0]
  2948  	b := v.Block
  2949  	typ := &b.Func.Config.Types
  2950  	// match: (Rsh64Ux32 [c] x y)
  2951  	// result: (Rsh64Ux64 [c] x (ZeroExt32to64 y))
  2952  	for {
  2953  		c := auxIntToBool(v.AuxInt)
  2954  		x := v_0
  2955  		y := v_1
  2956  		v.reset(OpRsh64Ux64)
  2957  		v.AuxInt = boolToAuxInt(c)
  2958  		v0 := b.NewValue0(v.Pos, OpZeroExt32to64, typ.UInt64)
  2959  		v0.AddArg(y)
  2960  		v.AddArg2(x, v0)
  2961  		return true
  2962  	}
  2963  }
  2964  func rewriteValueWasm_OpRsh64Ux64(v *Value) bool {
  2965  	v_1 := v.Args[1]
  2966  	v_0 := v.Args[0]
  2967  	b := v.Block
  2968  	typ := &b.Func.Config.Types
  2969  	// match: (Rsh64Ux64 x y)
  2970  	// cond: shiftIsBounded(v)
  2971  	// result: (I64ShrU x y)
  2972  	for {
  2973  		x := v_0
  2974  		y := v_1
  2975  		if !(shiftIsBounded(v)) {
  2976  			break
  2977  		}
  2978  		v.reset(OpWasmI64ShrU)
  2979  		v.AddArg2(x, y)
  2980  		return true
  2981  	}
  2982  	// match: (Rsh64Ux64 x (I64Const [c]))
  2983  	// cond: uint64(c) < 64
  2984  	// result: (I64ShrU x (I64Const [c]))
  2985  	for {
  2986  		x := v_0
  2987  		if v_1.Op != OpWasmI64Const {
  2988  			break
  2989  		}
  2990  		c := auxIntToInt64(v_1.AuxInt)
  2991  		if !(uint64(c) < 64) {
  2992  			break
  2993  		}
  2994  		v.reset(OpWasmI64ShrU)
  2995  		v0 := b.NewValue0(v.Pos, OpWasmI64Const, typ.Int64)
  2996  		v0.AuxInt = int64ToAuxInt(c)
  2997  		v.AddArg2(x, v0)
  2998  		return true
  2999  	}
  3000  	// match: (Rsh64Ux64 x (I64Const [c]))
  3001  	// cond: uint64(c) >= 64
  3002  	// result: (I64Const [0])
  3003  	for {
  3004  		if v_1.Op != OpWasmI64Const {
  3005  			break
  3006  		}
  3007  		c := auxIntToInt64(v_1.AuxInt)
  3008  		if !(uint64(c) >= 64) {
  3009  			break
  3010  		}
  3011  		v.reset(OpWasmI64Const)
  3012  		v.AuxInt = int64ToAuxInt(0)
  3013  		return true
  3014  	}
  3015  	// match: (Rsh64Ux64 x y)
  3016  	// result: (Select (I64ShrU x y) (I64Const [0]) (I64LtU y (I64Const [64])))
  3017  	for {
  3018  		x := v_0
  3019  		y := v_1
  3020  		v.reset(OpWasmSelect)
  3021  		v0 := b.NewValue0(v.Pos, OpWasmI64ShrU, typ.Int64)
  3022  		v0.AddArg2(x, y)
  3023  		v1 := b.NewValue0(v.Pos, OpWasmI64Const, typ.Int64)
  3024  		v1.AuxInt = int64ToAuxInt(0)
  3025  		v2 := b.NewValue0(v.Pos, OpWasmI64LtU, typ.Bool)
  3026  		v3 := b.NewValue0(v.Pos, OpWasmI64Const, typ.Int64)
  3027  		v3.AuxInt = int64ToAuxInt(64)
  3028  		v2.AddArg2(y, v3)
  3029  		v.AddArg3(v0, v1, v2)
  3030  		return true
  3031  	}
  3032  }
  3033  func rewriteValueWasm_OpRsh64Ux8(v *Value) bool {
  3034  	v_1 := v.Args[1]
  3035  	v_0 := v.Args[0]
  3036  	b := v.Block
  3037  	typ := &b.Func.Config.Types
  3038  	// match: (Rsh64Ux8 [c] x y)
  3039  	// result: (Rsh64Ux64 [c] x (ZeroExt8to64 y))
  3040  	for {
  3041  		c := auxIntToBool(v.AuxInt)
  3042  		x := v_0
  3043  		y := v_1
  3044  		v.reset(OpRsh64Ux64)
  3045  		v.AuxInt = boolToAuxInt(c)
  3046  		v0 := b.NewValue0(v.Pos, OpZeroExt8to64, typ.UInt64)
  3047  		v0.AddArg(y)
  3048  		v.AddArg2(x, v0)
  3049  		return true
  3050  	}
  3051  }
  3052  func rewriteValueWasm_OpRsh64x16(v *Value) bool {
  3053  	v_1 := v.Args[1]
  3054  	v_0 := v.Args[0]
  3055  	b := v.Block
  3056  	typ := &b.Func.Config.Types
  3057  	// match: (Rsh64x16 [c] x y)
  3058  	// result: (Rsh64x64 [c] x (ZeroExt16to64 y))
  3059  	for {
  3060  		c := auxIntToBool(v.AuxInt)
  3061  		x := v_0
  3062  		y := v_1
  3063  		v.reset(OpRsh64x64)
  3064  		v.AuxInt = boolToAuxInt(c)
  3065  		v0 := b.NewValue0(v.Pos, OpZeroExt16to64, typ.UInt64)
  3066  		v0.AddArg(y)
  3067  		v.AddArg2(x, v0)
  3068  		return true
  3069  	}
  3070  }
  3071  func rewriteValueWasm_OpRsh64x32(v *Value) bool {
  3072  	v_1 := v.Args[1]
  3073  	v_0 := v.Args[0]
  3074  	b := v.Block
  3075  	typ := &b.Func.Config.Types
  3076  	// match: (Rsh64x32 [c] x y)
  3077  	// result: (Rsh64x64 [c] x (ZeroExt32to64 y))
  3078  	for {
  3079  		c := auxIntToBool(v.AuxInt)
  3080  		x := v_0
  3081  		y := v_1
  3082  		v.reset(OpRsh64x64)
  3083  		v.AuxInt = boolToAuxInt(c)
  3084  		v0 := b.NewValue0(v.Pos, OpZeroExt32to64, typ.UInt64)
  3085  		v0.AddArg(y)
  3086  		v.AddArg2(x, v0)
  3087  		return true
  3088  	}
  3089  }
  3090  func rewriteValueWasm_OpRsh64x64(v *Value) bool {
  3091  	v_1 := v.Args[1]
  3092  	v_0 := v.Args[0]
  3093  	b := v.Block
  3094  	typ := &b.Func.Config.Types
  3095  	// match: (Rsh64x64 x y)
  3096  	// cond: shiftIsBounded(v)
  3097  	// result: (I64ShrS x y)
  3098  	for {
  3099  		x := v_0
  3100  		y := v_1
  3101  		if !(shiftIsBounded(v)) {
  3102  			break
  3103  		}
  3104  		v.reset(OpWasmI64ShrS)
  3105  		v.AddArg2(x, y)
  3106  		return true
  3107  	}
  3108  	// match: (Rsh64x64 x (I64Const [c]))
  3109  	// cond: uint64(c) < 64
  3110  	// result: (I64ShrS x (I64Const [c]))
  3111  	for {
  3112  		x := v_0
  3113  		if v_1.Op != OpWasmI64Const {
  3114  			break
  3115  		}
  3116  		c := auxIntToInt64(v_1.AuxInt)
  3117  		if !(uint64(c) < 64) {
  3118  			break
  3119  		}
  3120  		v.reset(OpWasmI64ShrS)
  3121  		v0 := b.NewValue0(v.Pos, OpWasmI64Const, typ.Int64)
  3122  		v0.AuxInt = int64ToAuxInt(c)
  3123  		v.AddArg2(x, v0)
  3124  		return true
  3125  	}
  3126  	// match: (Rsh64x64 x (I64Const [c]))
  3127  	// cond: uint64(c) >= 64
  3128  	// result: (I64ShrS x (I64Const [63]))
  3129  	for {
  3130  		x := v_0
  3131  		if v_1.Op != OpWasmI64Const {
  3132  			break
  3133  		}
  3134  		c := auxIntToInt64(v_1.AuxInt)
  3135  		if !(uint64(c) >= 64) {
  3136  			break
  3137  		}
  3138  		v.reset(OpWasmI64ShrS)
  3139  		v0 := b.NewValue0(v.Pos, OpWasmI64Const, typ.Int64)
  3140  		v0.AuxInt = int64ToAuxInt(63)
  3141  		v.AddArg2(x, v0)
  3142  		return true
  3143  	}
  3144  	// match: (Rsh64x64 x y)
  3145  	// result: (I64ShrS x (Select <typ.Int64> y (I64Const [63]) (I64LtU y (I64Const [64]))))
  3146  	for {
  3147  		x := v_0
  3148  		y := v_1
  3149  		v.reset(OpWasmI64ShrS)
  3150  		v0 := b.NewValue0(v.Pos, OpWasmSelect, typ.Int64)
  3151  		v1 := b.NewValue0(v.Pos, OpWasmI64Const, typ.Int64)
  3152  		v1.AuxInt = int64ToAuxInt(63)
  3153  		v2 := b.NewValue0(v.Pos, OpWasmI64LtU, typ.Bool)
  3154  		v3 := b.NewValue0(v.Pos, OpWasmI64Const, typ.Int64)
  3155  		v3.AuxInt = int64ToAuxInt(64)
  3156  		v2.AddArg2(y, v3)
  3157  		v0.AddArg3(y, v1, v2)
  3158  		v.AddArg2(x, v0)
  3159  		return true
  3160  	}
  3161  }
  3162  func rewriteValueWasm_OpRsh64x8(v *Value) bool {
  3163  	v_1 := v.Args[1]
  3164  	v_0 := v.Args[0]
  3165  	b := v.Block
  3166  	typ := &b.Func.Config.Types
  3167  	// match: (Rsh64x8 [c] x y)
  3168  	// result: (Rsh64x64 [c] x (ZeroExt8to64 y))
  3169  	for {
  3170  		c := auxIntToBool(v.AuxInt)
  3171  		x := v_0
  3172  		y := v_1
  3173  		v.reset(OpRsh64x64)
  3174  		v.AuxInt = boolToAuxInt(c)
  3175  		v0 := b.NewValue0(v.Pos, OpZeroExt8to64, typ.UInt64)
  3176  		v0.AddArg(y)
  3177  		v.AddArg2(x, v0)
  3178  		return true
  3179  	}
  3180  }
  3181  func rewriteValueWasm_OpRsh8Ux16(v *Value) bool {
  3182  	v_1 := v.Args[1]
  3183  	v_0 := v.Args[0]
  3184  	b := v.Block
  3185  	typ := &b.Func.Config.Types
  3186  	// match: (Rsh8Ux16 [c] x y)
  3187  	// result: (Rsh64Ux64 [c] (ZeroExt8to64 x) (ZeroExt16to64 y))
  3188  	for {
  3189  		c := auxIntToBool(v.AuxInt)
  3190  		x := v_0
  3191  		y := v_1
  3192  		v.reset(OpRsh64Ux64)
  3193  		v.AuxInt = boolToAuxInt(c)
  3194  		v0 := b.NewValue0(v.Pos, OpZeroExt8to64, typ.UInt64)
  3195  		v0.AddArg(x)
  3196  		v1 := b.NewValue0(v.Pos, OpZeroExt16to64, typ.UInt64)
  3197  		v1.AddArg(y)
  3198  		v.AddArg2(v0, v1)
  3199  		return true
  3200  	}
  3201  }
  3202  func rewriteValueWasm_OpRsh8Ux32(v *Value) bool {
  3203  	v_1 := v.Args[1]
  3204  	v_0 := v.Args[0]
  3205  	b := v.Block
  3206  	typ := &b.Func.Config.Types
  3207  	// match: (Rsh8Ux32 [c] x y)
  3208  	// result: (Rsh64Ux64 [c] (ZeroExt8to64 x) (ZeroExt32to64 y))
  3209  	for {
  3210  		c := auxIntToBool(v.AuxInt)
  3211  		x := v_0
  3212  		y := v_1
  3213  		v.reset(OpRsh64Ux64)
  3214  		v.AuxInt = boolToAuxInt(c)
  3215  		v0 := b.NewValue0(v.Pos, OpZeroExt8to64, typ.UInt64)
  3216  		v0.AddArg(x)
  3217  		v1 := b.NewValue0(v.Pos, OpZeroExt32to64, typ.UInt64)
  3218  		v1.AddArg(y)
  3219  		v.AddArg2(v0, v1)
  3220  		return true
  3221  	}
  3222  }
  3223  func rewriteValueWasm_OpRsh8Ux64(v *Value) bool {
  3224  	v_1 := v.Args[1]
  3225  	v_0 := v.Args[0]
  3226  	b := v.Block
  3227  	typ := &b.Func.Config.Types
  3228  	// match: (Rsh8Ux64 [c] x y)
  3229  	// result: (Rsh64Ux64 [c] (ZeroExt8to64 x) y)
  3230  	for {
  3231  		c := auxIntToBool(v.AuxInt)
  3232  		x := v_0
  3233  		y := v_1
  3234  		v.reset(OpRsh64Ux64)
  3235  		v.AuxInt = boolToAuxInt(c)
  3236  		v0 := b.NewValue0(v.Pos, OpZeroExt8to64, typ.UInt64)
  3237  		v0.AddArg(x)
  3238  		v.AddArg2(v0, y)
  3239  		return true
  3240  	}
  3241  }
  3242  func rewriteValueWasm_OpRsh8Ux8(v *Value) bool {
  3243  	v_1 := v.Args[1]
  3244  	v_0 := v.Args[0]
  3245  	b := v.Block
  3246  	typ := &b.Func.Config.Types
  3247  	// match: (Rsh8Ux8 [c] x y)
  3248  	// result: (Rsh64Ux64 [c] (ZeroExt8to64 x) (ZeroExt8to64 y))
  3249  	for {
  3250  		c := auxIntToBool(v.AuxInt)
  3251  		x := v_0
  3252  		y := v_1
  3253  		v.reset(OpRsh64Ux64)
  3254  		v.AuxInt = boolToAuxInt(c)
  3255  		v0 := b.NewValue0(v.Pos, OpZeroExt8to64, typ.UInt64)
  3256  		v0.AddArg(x)
  3257  		v1 := b.NewValue0(v.Pos, OpZeroExt8to64, typ.UInt64)
  3258  		v1.AddArg(y)
  3259  		v.AddArg2(v0, v1)
  3260  		return true
  3261  	}
  3262  }
  3263  func rewriteValueWasm_OpRsh8x16(v *Value) bool {
  3264  	v_1 := v.Args[1]
  3265  	v_0 := v.Args[0]
  3266  	b := v.Block
  3267  	typ := &b.Func.Config.Types
  3268  	// match: (Rsh8x16 [c] x y)
  3269  	// result: (Rsh64x64 [c] (SignExt8to64 x) (ZeroExt16to64 y))
  3270  	for {
  3271  		c := auxIntToBool(v.AuxInt)
  3272  		x := v_0
  3273  		y := v_1
  3274  		v.reset(OpRsh64x64)
  3275  		v.AuxInt = boolToAuxInt(c)
  3276  		v0 := b.NewValue0(v.Pos, OpSignExt8to64, typ.Int64)
  3277  		v0.AddArg(x)
  3278  		v1 := b.NewValue0(v.Pos, OpZeroExt16to64, typ.UInt64)
  3279  		v1.AddArg(y)
  3280  		v.AddArg2(v0, v1)
  3281  		return true
  3282  	}
  3283  }
  3284  func rewriteValueWasm_OpRsh8x32(v *Value) bool {
  3285  	v_1 := v.Args[1]
  3286  	v_0 := v.Args[0]
  3287  	b := v.Block
  3288  	typ := &b.Func.Config.Types
  3289  	// match: (Rsh8x32 [c] x y)
  3290  	// result: (Rsh64x64 [c] (SignExt8to64 x) (ZeroExt32to64 y))
  3291  	for {
  3292  		c := auxIntToBool(v.AuxInt)
  3293  		x := v_0
  3294  		y := v_1
  3295  		v.reset(OpRsh64x64)
  3296  		v.AuxInt = boolToAuxInt(c)
  3297  		v0 := b.NewValue0(v.Pos, OpSignExt8to64, typ.Int64)
  3298  		v0.AddArg(x)
  3299  		v1 := b.NewValue0(v.Pos, OpZeroExt32to64, typ.UInt64)
  3300  		v1.AddArg(y)
  3301  		v.AddArg2(v0, v1)
  3302  		return true
  3303  	}
  3304  }
  3305  func rewriteValueWasm_OpRsh8x64(v *Value) bool {
  3306  	v_1 := v.Args[1]
  3307  	v_0 := v.Args[0]
  3308  	b := v.Block
  3309  	typ := &b.Func.Config.Types
  3310  	// match: (Rsh8x64 [c] x y)
  3311  	// result: (Rsh64x64 [c] (SignExt8to64 x) y)
  3312  	for {
  3313  		c := auxIntToBool(v.AuxInt)
  3314  		x := v_0
  3315  		y := v_1
  3316  		v.reset(OpRsh64x64)
  3317  		v.AuxInt = boolToAuxInt(c)
  3318  		v0 := b.NewValue0(v.Pos, OpSignExt8to64, typ.Int64)
  3319  		v0.AddArg(x)
  3320  		v.AddArg2(v0, y)
  3321  		return true
  3322  	}
  3323  }
  3324  func rewriteValueWasm_OpRsh8x8(v *Value) bool {
  3325  	v_1 := v.Args[1]
  3326  	v_0 := v.Args[0]
  3327  	b := v.Block
  3328  	typ := &b.Func.Config.Types
  3329  	// match: (Rsh8x8 [c] x y)
  3330  	// result: (Rsh64x64 [c] (SignExt8to64 x) (ZeroExt8to64 y))
  3331  	for {
  3332  		c := auxIntToBool(v.AuxInt)
  3333  		x := v_0
  3334  		y := v_1
  3335  		v.reset(OpRsh64x64)
  3336  		v.AuxInt = boolToAuxInt(c)
  3337  		v0 := b.NewValue0(v.Pos, OpSignExt8to64, typ.Int64)
  3338  		v0.AddArg(x)
  3339  		v1 := b.NewValue0(v.Pos, OpZeroExt8to64, typ.UInt64)
  3340  		v1.AddArg(y)
  3341  		v.AddArg2(v0, v1)
  3342  		return true
  3343  	}
  3344  }
  3345  func rewriteValueWasm_OpSelect0(v *Value) bool {
  3346  	v_0 := v.Args[0]
  3347  	// match: (Select0 <t> (Mul64uhilo x y))
  3348  	// result: (Hmul64u <t> x y)
  3349  	for {
  3350  		t := v.Type
  3351  		if v_0.Op != OpMul64uhilo {
  3352  			break
  3353  		}
  3354  		y := v_0.Args[1]
  3355  		x := v_0.Args[0]
  3356  		v.reset(OpHmul64u)
  3357  		v.Type = t
  3358  		v.AddArg2(x, y)
  3359  		return true
  3360  	}
  3361  	return false
  3362  }
  3363  func rewriteValueWasm_OpSelect1(v *Value) bool {
  3364  	v_0 := v.Args[0]
  3365  	// match: (Select1 <t> (Mul64uhilo x y))
  3366  	// result: (I64Mul x y)
  3367  	for {
  3368  		if v_0.Op != OpMul64uhilo {
  3369  			break
  3370  		}
  3371  		y := v_0.Args[1]
  3372  		x := v_0.Args[0]
  3373  		v.reset(OpWasmI64Mul)
  3374  		v.AddArg2(x, y)
  3375  		return true
  3376  	}
  3377  	return false
  3378  }
  3379  func rewriteValueWasm_OpSignExt16to32(v *Value) bool {
  3380  	v_0 := v.Args[0]
  3381  	// match: (SignExt16to32 x:(I64Load16S _ _))
  3382  	// result: x
  3383  	for {
  3384  		x := v_0
  3385  		if x.Op != OpWasmI64Load16S {
  3386  			break
  3387  		}
  3388  		v.copyOf(x)
  3389  		return true
  3390  	}
  3391  	// match: (SignExt16to32 x)
  3392  	// result: (I64Extend16S x)
  3393  	for {
  3394  		x := v_0
  3395  		v.reset(OpWasmI64Extend16S)
  3396  		v.AddArg(x)
  3397  		return true
  3398  	}
  3399  }
  3400  func rewriteValueWasm_OpSignExt16to64(v *Value) bool {
  3401  	v_0 := v.Args[0]
  3402  	// match: (SignExt16to64 x:(I64Load16S _ _))
  3403  	// result: x
  3404  	for {
  3405  		x := v_0
  3406  		if x.Op != OpWasmI64Load16S {
  3407  			break
  3408  		}
  3409  		v.copyOf(x)
  3410  		return true
  3411  	}
  3412  	// match: (SignExt16to64 x)
  3413  	// result: (I64Extend16S x)
  3414  	for {
  3415  		x := v_0
  3416  		v.reset(OpWasmI64Extend16S)
  3417  		v.AddArg(x)
  3418  		return true
  3419  	}
  3420  }
  3421  func rewriteValueWasm_OpSignExt32to64(v *Value) bool {
  3422  	v_0 := v.Args[0]
  3423  	// match: (SignExt32to64 x:(I64Load32S _ _))
  3424  	// result: x
  3425  	for {
  3426  		x := v_0
  3427  		if x.Op != OpWasmI64Load32S {
  3428  			break
  3429  		}
  3430  		v.copyOf(x)
  3431  		return true
  3432  	}
  3433  	// match: (SignExt32to64 x)
  3434  	// result: (I64Extend32S x)
  3435  	for {
  3436  		x := v_0
  3437  		v.reset(OpWasmI64Extend32S)
  3438  		v.AddArg(x)
  3439  		return true
  3440  	}
  3441  }
  3442  func rewriteValueWasm_OpSignExt8to16(v *Value) bool {
  3443  	v_0 := v.Args[0]
  3444  	// match: (SignExt8to16 x:(I64Load8S _ _))
  3445  	// result: x
  3446  	for {
  3447  		x := v_0
  3448  		if x.Op != OpWasmI64Load8S {
  3449  			break
  3450  		}
  3451  		v.copyOf(x)
  3452  		return true
  3453  	}
  3454  	// match: (SignExt8to16 x)
  3455  	// result: (I64Extend8S x)
  3456  	for {
  3457  		x := v_0
  3458  		v.reset(OpWasmI64Extend8S)
  3459  		v.AddArg(x)
  3460  		return true
  3461  	}
  3462  }
  3463  func rewriteValueWasm_OpSignExt8to32(v *Value) bool {
  3464  	v_0 := v.Args[0]
  3465  	// match: (SignExt8to32 x:(I64Load8S _ _))
  3466  	// result: x
  3467  	for {
  3468  		x := v_0
  3469  		if x.Op != OpWasmI64Load8S {
  3470  			break
  3471  		}
  3472  		v.copyOf(x)
  3473  		return true
  3474  	}
  3475  	// match: (SignExt8to32 x)
  3476  	// result: (I64Extend8S x)
  3477  	for {
  3478  		x := v_0
  3479  		v.reset(OpWasmI64Extend8S)
  3480  		v.AddArg(x)
  3481  		return true
  3482  	}
  3483  }
  3484  func rewriteValueWasm_OpSignExt8to64(v *Value) bool {
  3485  	v_0 := v.Args[0]
  3486  	// match: (SignExt8to64 x:(I64Load8S _ _))
  3487  	// result: x
  3488  	for {
  3489  		x := v_0
  3490  		if x.Op != OpWasmI64Load8S {
  3491  			break
  3492  		}
  3493  		v.copyOf(x)
  3494  		return true
  3495  	}
  3496  	// match: (SignExt8to64 x)
  3497  	// result: (I64Extend8S x)
  3498  	for {
  3499  		x := v_0
  3500  		v.reset(OpWasmI64Extend8S)
  3501  		v.AddArg(x)
  3502  		return true
  3503  	}
  3504  }
  3505  func rewriteValueWasm_OpSlicemask(v *Value) bool {
  3506  	v_0 := v.Args[0]
  3507  	b := v.Block
  3508  	typ := &b.Func.Config.Types
  3509  	// match: (Slicemask x)
  3510  	// result: (I64ShrS (I64Sub (I64Const [0]) x) (I64Const [63]))
  3511  	for {
  3512  		x := v_0
  3513  		v.reset(OpWasmI64ShrS)
  3514  		v0 := b.NewValue0(v.Pos, OpWasmI64Sub, typ.Int64)
  3515  		v1 := b.NewValue0(v.Pos, OpWasmI64Const, typ.Int64)
  3516  		v1.AuxInt = int64ToAuxInt(0)
  3517  		v0.AddArg2(v1, x)
  3518  		v2 := b.NewValue0(v.Pos, OpWasmI64Const, typ.Int64)
  3519  		v2.AuxInt = int64ToAuxInt(63)
  3520  		v.AddArg2(v0, v2)
  3521  		return true
  3522  	}
  3523  }
  3524  func rewriteValueWasm_OpStore(v *Value) bool {
  3525  	v_2 := v.Args[2]
  3526  	v_1 := v.Args[1]
  3527  	v_0 := v.Args[0]
  3528  	// match: (Store {t} ptr val mem)
  3529  	// cond: is64BitFloat(t)
  3530  	// result: (F64Store ptr val mem)
  3531  	for {
  3532  		t := auxToType(v.Aux)
  3533  		ptr := v_0
  3534  		val := v_1
  3535  		mem := v_2
  3536  		if !(is64BitFloat(t)) {
  3537  			break
  3538  		}
  3539  		v.reset(OpWasmF64Store)
  3540  		v.AddArg3(ptr, val, mem)
  3541  		return true
  3542  	}
  3543  	// match: (Store {t} ptr val mem)
  3544  	// cond: is32BitFloat(t)
  3545  	// result: (F32Store ptr val mem)
  3546  	for {
  3547  		t := auxToType(v.Aux)
  3548  		ptr := v_0
  3549  		val := v_1
  3550  		mem := v_2
  3551  		if !(is32BitFloat(t)) {
  3552  			break
  3553  		}
  3554  		v.reset(OpWasmF32Store)
  3555  		v.AddArg3(ptr, val, mem)
  3556  		return true
  3557  	}
  3558  	// match: (Store {t} ptr val mem)
  3559  	// cond: t.Size() == 8
  3560  	// result: (I64Store ptr val mem)
  3561  	for {
  3562  		t := auxToType(v.Aux)
  3563  		ptr := v_0
  3564  		val := v_1
  3565  		mem := v_2
  3566  		if !(t.Size() == 8) {
  3567  			break
  3568  		}
  3569  		v.reset(OpWasmI64Store)
  3570  		v.AddArg3(ptr, val, mem)
  3571  		return true
  3572  	}
  3573  	// match: (Store {t} ptr val mem)
  3574  	// cond: t.Size() == 4
  3575  	// result: (I64Store32 ptr val mem)
  3576  	for {
  3577  		t := auxToType(v.Aux)
  3578  		ptr := v_0
  3579  		val := v_1
  3580  		mem := v_2
  3581  		if !(t.Size() == 4) {
  3582  			break
  3583  		}
  3584  		v.reset(OpWasmI64Store32)
  3585  		v.AddArg3(ptr, val, mem)
  3586  		return true
  3587  	}
  3588  	// match: (Store {t} ptr val mem)
  3589  	// cond: t.Size() == 2
  3590  	// result: (I64Store16 ptr val mem)
  3591  	for {
  3592  		t := auxToType(v.Aux)
  3593  		ptr := v_0
  3594  		val := v_1
  3595  		mem := v_2
  3596  		if !(t.Size() == 2) {
  3597  			break
  3598  		}
  3599  		v.reset(OpWasmI64Store16)
  3600  		v.AddArg3(ptr, val, mem)
  3601  		return true
  3602  	}
  3603  	// match: (Store {t} ptr val mem)
  3604  	// cond: t.Size() == 1
  3605  	// result: (I64Store8 ptr val mem)
  3606  	for {
  3607  		t := auxToType(v.Aux)
  3608  		ptr := v_0
  3609  		val := v_1
  3610  		mem := v_2
  3611  		if !(t.Size() == 1) {
  3612  			break
  3613  		}
  3614  		v.reset(OpWasmI64Store8)
  3615  		v.AddArg3(ptr, val, mem)
  3616  		return true
  3617  	}
  3618  	return false
  3619  }
  3620  func rewriteValueWasm_OpWasmF64Add(v *Value) bool {
  3621  	v_1 := v.Args[1]
  3622  	v_0 := v.Args[0]
  3623  	b := v.Block
  3624  	typ := &b.Func.Config.Types
  3625  	// match: (F64Add (F64Const [x]) (F64Const [y]))
  3626  	// result: (F64Const [x + y])
  3627  	for {
  3628  		if v_0.Op != OpWasmF64Const {
  3629  			break
  3630  		}
  3631  		x := auxIntToFloat64(v_0.AuxInt)
  3632  		if v_1.Op != OpWasmF64Const {
  3633  			break
  3634  		}
  3635  		y := auxIntToFloat64(v_1.AuxInt)
  3636  		v.reset(OpWasmF64Const)
  3637  		v.AuxInt = float64ToAuxInt(x + y)
  3638  		return true
  3639  	}
  3640  	// match: (F64Add (F64Const [x]) y)
  3641  	// cond: y.Op != OpWasmF64Const
  3642  	// result: (F64Add y (F64Const [x]))
  3643  	for {
  3644  		if v_0.Op != OpWasmF64Const {
  3645  			break
  3646  		}
  3647  		x := auxIntToFloat64(v_0.AuxInt)
  3648  		y := v_1
  3649  		if !(y.Op != OpWasmF64Const) {
  3650  			break
  3651  		}
  3652  		v.reset(OpWasmF64Add)
  3653  		v0 := b.NewValue0(v.Pos, OpWasmF64Const, typ.Float64)
  3654  		v0.AuxInt = float64ToAuxInt(x)
  3655  		v.AddArg2(y, v0)
  3656  		return true
  3657  	}
  3658  	return false
  3659  }
  3660  func rewriteValueWasm_OpWasmF64Mul(v *Value) bool {
  3661  	v_1 := v.Args[1]
  3662  	v_0 := v.Args[0]
  3663  	b := v.Block
  3664  	typ := &b.Func.Config.Types
  3665  	// match: (F64Mul (F64Const [x]) (F64Const [y]))
  3666  	// cond: !math.IsNaN(x * y)
  3667  	// result: (F64Const [x * y])
  3668  	for {
  3669  		if v_0.Op != OpWasmF64Const {
  3670  			break
  3671  		}
  3672  		x := auxIntToFloat64(v_0.AuxInt)
  3673  		if v_1.Op != OpWasmF64Const {
  3674  			break
  3675  		}
  3676  		y := auxIntToFloat64(v_1.AuxInt)
  3677  		if !(!math.IsNaN(x * y)) {
  3678  			break
  3679  		}
  3680  		v.reset(OpWasmF64Const)
  3681  		v.AuxInt = float64ToAuxInt(x * y)
  3682  		return true
  3683  	}
  3684  	// match: (F64Mul (F64Const [x]) y)
  3685  	// cond: y.Op != OpWasmF64Const
  3686  	// result: (F64Mul y (F64Const [x]))
  3687  	for {
  3688  		if v_0.Op != OpWasmF64Const {
  3689  			break
  3690  		}
  3691  		x := auxIntToFloat64(v_0.AuxInt)
  3692  		y := v_1
  3693  		if !(y.Op != OpWasmF64Const) {
  3694  			break
  3695  		}
  3696  		v.reset(OpWasmF64Mul)
  3697  		v0 := b.NewValue0(v.Pos, OpWasmF64Const, typ.Float64)
  3698  		v0.AuxInt = float64ToAuxInt(x)
  3699  		v.AddArg2(y, v0)
  3700  		return true
  3701  	}
  3702  	return false
  3703  }
  3704  func rewriteValueWasm_OpWasmI64Add(v *Value) bool {
  3705  	v_1 := v.Args[1]
  3706  	v_0 := v.Args[0]
  3707  	b := v.Block
  3708  	typ := &b.Func.Config.Types
  3709  	// match: (I64Add (I64Const [x]) (I64Const [y]))
  3710  	// result: (I64Const [x + y])
  3711  	for {
  3712  		if v_0.Op != OpWasmI64Const {
  3713  			break
  3714  		}
  3715  		x := auxIntToInt64(v_0.AuxInt)
  3716  		if v_1.Op != OpWasmI64Const {
  3717  			break
  3718  		}
  3719  		y := auxIntToInt64(v_1.AuxInt)
  3720  		v.reset(OpWasmI64Const)
  3721  		v.AuxInt = int64ToAuxInt(x + y)
  3722  		return true
  3723  	}
  3724  	// match: (I64Add (I64Const [x]) y)
  3725  	// cond: y.Op != OpWasmI64Const
  3726  	// result: (I64Add y (I64Const [x]))
  3727  	for {
  3728  		if v_0.Op != OpWasmI64Const {
  3729  			break
  3730  		}
  3731  		x := auxIntToInt64(v_0.AuxInt)
  3732  		y := v_1
  3733  		if !(y.Op != OpWasmI64Const) {
  3734  			break
  3735  		}
  3736  		v.reset(OpWasmI64Add)
  3737  		v0 := b.NewValue0(v.Pos, OpWasmI64Const, typ.Int64)
  3738  		v0.AuxInt = int64ToAuxInt(x)
  3739  		v.AddArg2(y, v0)
  3740  		return true
  3741  	}
  3742  	// match: (I64Add x (I64Const <t> [y]))
  3743  	// cond: !t.IsPtr()
  3744  	// result: (I64AddConst [y] x)
  3745  	for {
  3746  		x := v_0
  3747  		if v_1.Op != OpWasmI64Const {
  3748  			break
  3749  		}
  3750  		t := v_1.Type
  3751  		y := auxIntToInt64(v_1.AuxInt)
  3752  		if !(!t.IsPtr()) {
  3753  			break
  3754  		}
  3755  		v.reset(OpWasmI64AddConst)
  3756  		v.AuxInt = int64ToAuxInt(y)
  3757  		v.AddArg(x)
  3758  		return true
  3759  	}
  3760  	return false
  3761  }
  3762  func rewriteValueWasm_OpWasmI64AddConst(v *Value) bool {
  3763  	v_0 := v.Args[0]
  3764  	// match: (I64AddConst [0] x)
  3765  	// result: x
  3766  	for {
  3767  		if auxIntToInt64(v.AuxInt) != 0 {
  3768  			break
  3769  		}
  3770  		x := v_0
  3771  		v.copyOf(x)
  3772  		return true
  3773  	}
  3774  	// match: (I64AddConst [off] (LoweredAddr {sym} [off2] base))
  3775  	// cond: isU32Bit(off+int64(off2))
  3776  	// result: (LoweredAddr {sym} [int32(off)+off2] base)
  3777  	for {
  3778  		off := auxIntToInt64(v.AuxInt)
  3779  		if v_0.Op != OpWasmLoweredAddr {
  3780  			break
  3781  		}
  3782  		off2 := auxIntToInt32(v_0.AuxInt)
  3783  		sym := auxToSym(v_0.Aux)
  3784  		base := v_0.Args[0]
  3785  		if !(isU32Bit(off + int64(off2))) {
  3786  			break
  3787  		}
  3788  		v.reset(OpWasmLoweredAddr)
  3789  		v.AuxInt = int32ToAuxInt(int32(off) + off2)
  3790  		v.Aux = symToAux(sym)
  3791  		v.AddArg(base)
  3792  		return true
  3793  	}
  3794  	// match: (I64AddConst [off] x:(SP))
  3795  	// cond: isU32Bit(off)
  3796  	// result: (LoweredAddr [int32(off)] x)
  3797  	for {
  3798  		off := auxIntToInt64(v.AuxInt)
  3799  		x := v_0
  3800  		if x.Op != OpSP || !(isU32Bit(off)) {
  3801  			break
  3802  		}
  3803  		v.reset(OpWasmLoweredAddr)
  3804  		v.AuxInt = int32ToAuxInt(int32(off))
  3805  		v.AddArg(x)
  3806  		return true
  3807  	}
  3808  	return false
  3809  }
  3810  func rewriteValueWasm_OpWasmI64And(v *Value) bool {
  3811  	v_1 := v.Args[1]
  3812  	v_0 := v.Args[0]
  3813  	b := v.Block
  3814  	typ := &b.Func.Config.Types
  3815  	// match: (I64And (I64Const [x]) (I64Const [y]))
  3816  	// result: (I64Const [x & y])
  3817  	for {
  3818  		if v_0.Op != OpWasmI64Const {
  3819  			break
  3820  		}
  3821  		x := auxIntToInt64(v_0.AuxInt)
  3822  		if v_1.Op != OpWasmI64Const {
  3823  			break
  3824  		}
  3825  		y := auxIntToInt64(v_1.AuxInt)
  3826  		v.reset(OpWasmI64Const)
  3827  		v.AuxInt = int64ToAuxInt(x & y)
  3828  		return true
  3829  	}
  3830  	// match: (I64And (I64Const [x]) y)
  3831  	// cond: y.Op != OpWasmI64Const
  3832  	// result: (I64And y (I64Const [x]))
  3833  	for {
  3834  		if v_0.Op != OpWasmI64Const {
  3835  			break
  3836  		}
  3837  		x := auxIntToInt64(v_0.AuxInt)
  3838  		y := v_1
  3839  		if !(y.Op != OpWasmI64Const) {
  3840  			break
  3841  		}
  3842  		v.reset(OpWasmI64And)
  3843  		v0 := b.NewValue0(v.Pos, OpWasmI64Const, typ.Int64)
  3844  		v0.AuxInt = int64ToAuxInt(x)
  3845  		v.AddArg2(y, v0)
  3846  		return true
  3847  	}
  3848  	return false
  3849  }
  3850  func rewriteValueWasm_OpWasmI64Eq(v *Value) bool {
  3851  	v_1 := v.Args[1]
  3852  	v_0 := v.Args[0]
  3853  	b := v.Block
  3854  	typ := &b.Func.Config.Types
  3855  	// match: (I64Eq (I64Const [x]) (I64Const [y]))
  3856  	// cond: x == y
  3857  	// result: (I64Const [1])
  3858  	for {
  3859  		if v_0.Op != OpWasmI64Const {
  3860  			break
  3861  		}
  3862  		x := auxIntToInt64(v_0.AuxInt)
  3863  		if v_1.Op != OpWasmI64Const {
  3864  			break
  3865  		}
  3866  		y := auxIntToInt64(v_1.AuxInt)
  3867  		if !(x == y) {
  3868  			break
  3869  		}
  3870  		v.reset(OpWasmI64Const)
  3871  		v.AuxInt = int64ToAuxInt(1)
  3872  		return true
  3873  	}
  3874  	// match: (I64Eq (I64Const [x]) (I64Const [y]))
  3875  	// cond: x != y
  3876  	// result: (I64Const [0])
  3877  	for {
  3878  		if v_0.Op != OpWasmI64Const {
  3879  			break
  3880  		}
  3881  		x := auxIntToInt64(v_0.AuxInt)
  3882  		if v_1.Op != OpWasmI64Const {
  3883  			break
  3884  		}
  3885  		y := auxIntToInt64(v_1.AuxInt)
  3886  		if !(x != y) {
  3887  			break
  3888  		}
  3889  		v.reset(OpWasmI64Const)
  3890  		v.AuxInt = int64ToAuxInt(0)
  3891  		return true
  3892  	}
  3893  	// match: (I64Eq (I64Const [x]) y)
  3894  	// cond: y.Op != OpWasmI64Const
  3895  	// result: (I64Eq y (I64Const [x]))
  3896  	for {
  3897  		if v_0.Op != OpWasmI64Const {
  3898  			break
  3899  		}
  3900  		x := auxIntToInt64(v_0.AuxInt)
  3901  		y := v_1
  3902  		if !(y.Op != OpWasmI64Const) {
  3903  			break
  3904  		}
  3905  		v.reset(OpWasmI64Eq)
  3906  		v0 := b.NewValue0(v.Pos, OpWasmI64Const, typ.Int64)
  3907  		v0.AuxInt = int64ToAuxInt(x)
  3908  		v.AddArg2(y, v0)
  3909  		return true
  3910  	}
  3911  	// match: (I64Eq x (I64Const [0]))
  3912  	// result: (I64Eqz x)
  3913  	for {
  3914  		x := v_0
  3915  		if v_1.Op != OpWasmI64Const || auxIntToInt64(v_1.AuxInt) != 0 {
  3916  			break
  3917  		}
  3918  		v.reset(OpWasmI64Eqz)
  3919  		v.AddArg(x)
  3920  		return true
  3921  	}
  3922  	return false
  3923  }
  3924  func rewriteValueWasm_OpWasmI64Eqz(v *Value) bool {
  3925  	v_0 := v.Args[0]
  3926  	// match: (I64Eqz (I64Eqz (I64Eqz x)))
  3927  	// result: (I64Eqz x)
  3928  	for {
  3929  		if v_0.Op != OpWasmI64Eqz {
  3930  			break
  3931  		}
  3932  		v_0_0 := v_0.Args[0]
  3933  		if v_0_0.Op != OpWasmI64Eqz {
  3934  			break
  3935  		}
  3936  		x := v_0_0.Args[0]
  3937  		v.reset(OpWasmI64Eqz)
  3938  		v.AddArg(x)
  3939  		return true
  3940  	}
  3941  	return false
  3942  }
  3943  func rewriteValueWasm_OpWasmI64LeU(v *Value) bool {
  3944  	v_1 := v.Args[1]
  3945  	v_0 := v.Args[0]
  3946  	b := v.Block
  3947  	typ := &b.Func.Config.Types
  3948  	// match: (I64LeU x (I64Const [0]))
  3949  	// result: (I64Eqz x)
  3950  	for {
  3951  		x := v_0
  3952  		if v_1.Op != OpWasmI64Const || auxIntToInt64(v_1.AuxInt) != 0 {
  3953  			break
  3954  		}
  3955  		v.reset(OpWasmI64Eqz)
  3956  		v.AddArg(x)
  3957  		return true
  3958  	}
  3959  	// match: (I64LeU (I64Const [1]) x)
  3960  	// result: (I64Eqz (I64Eqz x))
  3961  	for {
  3962  		if v_0.Op != OpWasmI64Const || auxIntToInt64(v_0.AuxInt) != 1 {
  3963  			break
  3964  		}
  3965  		x := v_1
  3966  		v.reset(OpWasmI64Eqz)
  3967  		v0 := b.NewValue0(v.Pos, OpWasmI64Eqz, typ.Bool)
  3968  		v0.AddArg(x)
  3969  		v.AddArg(v0)
  3970  		return true
  3971  	}
  3972  	return false
  3973  }
  3974  func rewriteValueWasm_OpWasmI64Load(v *Value) bool {
  3975  	v_1 := v.Args[1]
  3976  	v_0 := v.Args[0]
  3977  	b := v.Block
  3978  	config := b.Func.Config
  3979  	// match: (I64Load [off] (I64AddConst [off2] ptr) mem)
  3980  	// cond: isU32Bit(off+off2)
  3981  	// result: (I64Load [off+off2] ptr mem)
  3982  	for {
  3983  		off := auxIntToInt64(v.AuxInt)
  3984  		if v_0.Op != OpWasmI64AddConst {
  3985  			break
  3986  		}
  3987  		off2 := auxIntToInt64(v_0.AuxInt)
  3988  		ptr := v_0.Args[0]
  3989  		mem := v_1
  3990  		if !(isU32Bit(off + off2)) {
  3991  			break
  3992  		}
  3993  		v.reset(OpWasmI64Load)
  3994  		v.AuxInt = int64ToAuxInt(off + off2)
  3995  		v.AddArg2(ptr, mem)
  3996  		return true
  3997  	}
  3998  	// match: (I64Load [off] (LoweredAddr {sym} [off2] (SB)) _)
  3999  	// cond: symIsRO(sym) && isU32Bit(off+int64(off2))
  4000  	// result: (I64Const [int64(read64(sym, off+int64(off2), config.ctxt.Arch.ByteOrder))])
  4001  	for {
  4002  		off := auxIntToInt64(v.AuxInt)
  4003  		if v_0.Op != OpWasmLoweredAddr {
  4004  			break
  4005  		}
  4006  		off2 := auxIntToInt32(v_0.AuxInt)
  4007  		sym := auxToSym(v_0.Aux)
  4008  		v_0_0 := v_0.Args[0]
  4009  		if v_0_0.Op != OpSB || !(symIsRO(sym) && isU32Bit(off+int64(off2))) {
  4010  			break
  4011  		}
  4012  		v.reset(OpWasmI64Const)
  4013  		v.AuxInt = int64ToAuxInt(int64(read64(sym, off+int64(off2), config.ctxt.Arch.ByteOrder)))
  4014  		return true
  4015  	}
  4016  	return false
  4017  }
  4018  func rewriteValueWasm_OpWasmI64Load16S(v *Value) bool {
  4019  	v_1 := v.Args[1]
  4020  	v_0 := v.Args[0]
  4021  	b := v.Block
  4022  	config := b.Func.Config
  4023  	// match: (I64Load16S [off] (I64AddConst [off2] ptr) mem)
  4024  	// cond: isU32Bit(off+off2)
  4025  	// result: (I64Load16S [off+off2] ptr mem)
  4026  	for {
  4027  		off := auxIntToInt64(v.AuxInt)
  4028  		if v_0.Op != OpWasmI64AddConst {
  4029  			break
  4030  		}
  4031  		off2 := auxIntToInt64(v_0.AuxInt)
  4032  		ptr := v_0.Args[0]
  4033  		mem := v_1
  4034  		if !(isU32Bit(off + off2)) {
  4035  			break
  4036  		}
  4037  		v.reset(OpWasmI64Load16S)
  4038  		v.AuxInt = int64ToAuxInt(off + off2)
  4039  		v.AddArg2(ptr, mem)
  4040  		return true
  4041  	}
  4042  	// match: (I64Load16S [off] (LoweredAddr {sym} [off2] (SB)) _)
  4043  	// cond: symIsRO(sym) && isU32Bit(off+int64(off2))
  4044  	// result: (I64Const [int64(int16(read16(sym, off+int64(off2), config.ctxt.Arch.ByteOrder)))])
  4045  	for {
  4046  		off := auxIntToInt64(v.AuxInt)
  4047  		if v_0.Op != OpWasmLoweredAddr {
  4048  			break
  4049  		}
  4050  		off2 := auxIntToInt32(v_0.AuxInt)
  4051  		sym := auxToSym(v_0.Aux)
  4052  		v_0_0 := v_0.Args[0]
  4053  		if v_0_0.Op != OpSB || !(symIsRO(sym) && isU32Bit(off+int64(off2))) {
  4054  			break
  4055  		}
  4056  		v.reset(OpWasmI64Const)
  4057  		v.AuxInt = int64ToAuxInt(int64(int16(read16(sym, off+int64(off2), config.ctxt.Arch.ByteOrder))))
  4058  		return true
  4059  	}
  4060  	return false
  4061  }
  4062  func rewriteValueWasm_OpWasmI64Load16U(v *Value) bool {
  4063  	v_1 := v.Args[1]
  4064  	v_0 := v.Args[0]
  4065  	b := v.Block
  4066  	config := b.Func.Config
  4067  	// match: (I64Load16U [off] (I64AddConst [off2] ptr) mem)
  4068  	// cond: isU32Bit(off+off2)
  4069  	// result: (I64Load16U [off+off2] ptr mem)
  4070  	for {
  4071  		off := auxIntToInt64(v.AuxInt)
  4072  		if v_0.Op != OpWasmI64AddConst {
  4073  			break
  4074  		}
  4075  		off2 := auxIntToInt64(v_0.AuxInt)
  4076  		ptr := v_0.Args[0]
  4077  		mem := v_1
  4078  		if !(isU32Bit(off + off2)) {
  4079  			break
  4080  		}
  4081  		v.reset(OpWasmI64Load16U)
  4082  		v.AuxInt = int64ToAuxInt(off + off2)
  4083  		v.AddArg2(ptr, mem)
  4084  		return true
  4085  	}
  4086  	// match: (I64Load16U [off] (LoweredAddr {sym} [off2] (SB)) _)
  4087  	// cond: symIsRO(sym) && isU32Bit(off+int64(off2))
  4088  	// result: (I64Const [int64(read16(sym, off+int64(off2), config.ctxt.Arch.ByteOrder))])
  4089  	for {
  4090  		off := auxIntToInt64(v.AuxInt)
  4091  		if v_0.Op != OpWasmLoweredAddr {
  4092  			break
  4093  		}
  4094  		off2 := auxIntToInt32(v_0.AuxInt)
  4095  		sym := auxToSym(v_0.Aux)
  4096  		v_0_0 := v_0.Args[0]
  4097  		if v_0_0.Op != OpSB || !(symIsRO(sym) && isU32Bit(off+int64(off2))) {
  4098  			break
  4099  		}
  4100  		v.reset(OpWasmI64Const)
  4101  		v.AuxInt = int64ToAuxInt(int64(read16(sym, off+int64(off2), config.ctxt.Arch.ByteOrder)))
  4102  		return true
  4103  	}
  4104  	return false
  4105  }
  4106  func rewriteValueWasm_OpWasmI64Load32S(v *Value) bool {
  4107  	v_1 := v.Args[1]
  4108  	v_0 := v.Args[0]
  4109  	b := v.Block
  4110  	config := b.Func.Config
  4111  	// match: (I64Load32S [off] (I64AddConst [off2] ptr) mem)
  4112  	// cond: isU32Bit(off+off2)
  4113  	// result: (I64Load32S [off+off2] ptr mem)
  4114  	for {
  4115  		off := auxIntToInt64(v.AuxInt)
  4116  		if v_0.Op != OpWasmI64AddConst {
  4117  			break
  4118  		}
  4119  		off2 := auxIntToInt64(v_0.AuxInt)
  4120  		ptr := v_0.Args[0]
  4121  		mem := v_1
  4122  		if !(isU32Bit(off + off2)) {
  4123  			break
  4124  		}
  4125  		v.reset(OpWasmI64Load32S)
  4126  		v.AuxInt = int64ToAuxInt(off + off2)
  4127  		v.AddArg2(ptr, mem)
  4128  		return true
  4129  	}
  4130  	// match: (I64Load32S [off] (LoweredAddr {sym} [off2] (SB)) _)
  4131  	// cond: symIsRO(sym) && isU32Bit(off+int64(off2))
  4132  	// result: (I64Const [int64(int32(read32(sym, off+int64(off2), config.ctxt.Arch.ByteOrder)))])
  4133  	for {
  4134  		off := auxIntToInt64(v.AuxInt)
  4135  		if v_0.Op != OpWasmLoweredAddr {
  4136  			break
  4137  		}
  4138  		off2 := auxIntToInt32(v_0.AuxInt)
  4139  		sym := auxToSym(v_0.Aux)
  4140  		v_0_0 := v_0.Args[0]
  4141  		if v_0_0.Op != OpSB || !(symIsRO(sym) && isU32Bit(off+int64(off2))) {
  4142  			break
  4143  		}
  4144  		v.reset(OpWasmI64Const)
  4145  		v.AuxInt = int64ToAuxInt(int64(int32(read32(sym, off+int64(off2), config.ctxt.Arch.ByteOrder))))
  4146  		return true
  4147  	}
  4148  	return false
  4149  }
  4150  func rewriteValueWasm_OpWasmI64Load32U(v *Value) bool {
  4151  	v_1 := v.Args[1]
  4152  	v_0 := v.Args[0]
  4153  	b := v.Block
  4154  	config := b.Func.Config
  4155  	// match: (I64Load32U [off] (I64AddConst [off2] ptr) mem)
  4156  	// cond: isU32Bit(off+off2)
  4157  	// result: (I64Load32U [off+off2] ptr mem)
  4158  	for {
  4159  		off := auxIntToInt64(v.AuxInt)
  4160  		if v_0.Op != OpWasmI64AddConst {
  4161  			break
  4162  		}
  4163  		off2 := auxIntToInt64(v_0.AuxInt)
  4164  		ptr := v_0.Args[0]
  4165  		mem := v_1
  4166  		if !(isU32Bit(off + off2)) {
  4167  			break
  4168  		}
  4169  		v.reset(OpWasmI64Load32U)
  4170  		v.AuxInt = int64ToAuxInt(off + off2)
  4171  		v.AddArg2(ptr, mem)
  4172  		return true
  4173  	}
  4174  	// match: (I64Load32U [off] (LoweredAddr {sym} [off2] (SB)) _)
  4175  	// cond: symIsRO(sym) && isU32Bit(off+int64(off2))
  4176  	// result: (I64Const [int64(read32(sym, off+int64(off2), config.ctxt.Arch.ByteOrder))])
  4177  	for {
  4178  		off := auxIntToInt64(v.AuxInt)
  4179  		if v_0.Op != OpWasmLoweredAddr {
  4180  			break
  4181  		}
  4182  		off2 := auxIntToInt32(v_0.AuxInt)
  4183  		sym := auxToSym(v_0.Aux)
  4184  		v_0_0 := v_0.Args[0]
  4185  		if v_0_0.Op != OpSB || !(symIsRO(sym) && isU32Bit(off+int64(off2))) {
  4186  			break
  4187  		}
  4188  		v.reset(OpWasmI64Const)
  4189  		v.AuxInt = int64ToAuxInt(int64(read32(sym, off+int64(off2), config.ctxt.Arch.ByteOrder)))
  4190  		return true
  4191  	}
  4192  	return false
  4193  }
  4194  func rewriteValueWasm_OpWasmI64Load8S(v *Value) bool {
  4195  	v_1 := v.Args[1]
  4196  	v_0 := v.Args[0]
  4197  	// match: (I64Load8S [off] (I64AddConst [off2] ptr) mem)
  4198  	// cond: isU32Bit(off+off2)
  4199  	// result: (I64Load8S [off+off2] ptr mem)
  4200  	for {
  4201  		off := auxIntToInt64(v.AuxInt)
  4202  		if v_0.Op != OpWasmI64AddConst {
  4203  			break
  4204  		}
  4205  		off2 := auxIntToInt64(v_0.AuxInt)
  4206  		ptr := v_0.Args[0]
  4207  		mem := v_1
  4208  		if !(isU32Bit(off + off2)) {
  4209  			break
  4210  		}
  4211  		v.reset(OpWasmI64Load8S)
  4212  		v.AuxInt = int64ToAuxInt(off + off2)
  4213  		v.AddArg2(ptr, mem)
  4214  		return true
  4215  	}
  4216  	// match: (I64Load8S [off] (LoweredAddr {sym} [off2] (SB)) _)
  4217  	// cond: symIsRO(sym) && isU32Bit(off+int64(off2))
  4218  	// result: (I64Const [int64(int8(read8(sym, off+int64(off2))))])
  4219  	for {
  4220  		off := auxIntToInt64(v.AuxInt)
  4221  		if v_0.Op != OpWasmLoweredAddr {
  4222  			break
  4223  		}
  4224  		off2 := auxIntToInt32(v_0.AuxInt)
  4225  		sym := auxToSym(v_0.Aux)
  4226  		v_0_0 := v_0.Args[0]
  4227  		if v_0_0.Op != OpSB || !(symIsRO(sym) && isU32Bit(off+int64(off2))) {
  4228  			break
  4229  		}
  4230  		v.reset(OpWasmI64Const)
  4231  		v.AuxInt = int64ToAuxInt(int64(int8(read8(sym, off+int64(off2)))))
  4232  		return true
  4233  	}
  4234  	return false
  4235  }
  4236  func rewriteValueWasm_OpWasmI64Load8U(v *Value) bool {
  4237  	v_1 := v.Args[1]
  4238  	v_0 := v.Args[0]
  4239  	// match: (I64Load8U [off] (I64AddConst [off2] ptr) mem)
  4240  	// cond: isU32Bit(off+off2)
  4241  	// result: (I64Load8U [off+off2] ptr mem)
  4242  	for {
  4243  		off := auxIntToInt64(v.AuxInt)
  4244  		if v_0.Op != OpWasmI64AddConst {
  4245  			break
  4246  		}
  4247  		off2 := auxIntToInt64(v_0.AuxInt)
  4248  		ptr := v_0.Args[0]
  4249  		mem := v_1
  4250  		if !(isU32Bit(off + off2)) {
  4251  			break
  4252  		}
  4253  		v.reset(OpWasmI64Load8U)
  4254  		v.AuxInt = int64ToAuxInt(off + off2)
  4255  		v.AddArg2(ptr, mem)
  4256  		return true
  4257  	}
  4258  	// match: (I64Load8U [off] (LoweredAddr {sym} [off2] (SB)) _)
  4259  	// cond: symIsRO(sym) && isU32Bit(off+int64(off2))
  4260  	// result: (I64Const [int64(read8(sym, off+int64(off2)))])
  4261  	for {
  4262  		off := auxIntToInt64(v.AuxInt)
  4263  		if v_0.Op != OpWasmLoweredAddr {
  4264  			break
  4265  		}
  4266  		off2 := auxIntToInt32(v_0.AuxInt)
  4267  		sym := auxToSym(v_0.Aux)
  4268  		v_0_0 := v_0.Args[0]
  4269  		if v_0_0.Op != OpSB || !(symIsRO(sym) && isU32Bit(off+int64(off2))) {
  4270  			break
  4271  		}
  4272  		v.reset(OpWasmI64Const)
  4273  		v.AuxInt = int64ToAuxInt(int64(read8(sym, off+int64(off2))))
  4274  		return true
  4275  	}
  4276  	return false
  4277  }
  4278  func rewriteValueWasm_OpWasmI64LtU(v *Value) bool {
  4279  	v_1 := v.Args[1]
  4280  	v_0 := v.Args[0]
  4281  	b := v.Block
  4282  	typ := &b.Func.Config.Types
  4283  	// match: (I64LtU (I64Const [0]) x)
  4284  	// result: (I64Eqz (I64Eqz x))
  4285  	for {
  4286  		if v_0.Op != OpWasmI64Const || auxIntToInt64(v_0.AuxInt) != 0 {
  4287  			break
  4288  		}
  4289  		x := v_1
  4290  		v.reset(OpWasmI64Eqz)
  4291  		v0 := b.NewValue0(v.Pos, OpWasmI64Eqz, typ.Bool)
  4292  		v0.AddArg(x)
  4293  		v.AddArg(v0)
  4294  		return true
  4295  	}
  4296  	// match: (I64LtU x (I64Const [1]))
  4297  	// result: (I64Eqz x)
  4298  	for {
  4299  		x := v_0
  4300  		if v_1.Op != OpWasmI64Const || auxIntToInt64(v_1.AuxInt) != 1 {
  4301  			break
  4302  		}
  4303  		v.reset(OpWasmI64Eqz)
  4304  		v.AddArg(x)
  4305  		return true
  4306  	}
  4307  	return false
  4308  }
  4309  func rewriteValueWasm_OpWasmI64Mul(v *Value) bool {
  4310  	v_1 := v.Args[1]
  4311  	v_0 := v.Args[0]
  4312  	b := v.Block
  4313  	typ := &b.Func.Config.Types
  4314  	// match: (I64Mul (I64Const [x]) (I64Const [y]))
  4315  	// result: (I64Const [x * y])
  4316  	for {
  4317  		if v_0.Op != OpWasmI64Const {
  4318  			break
  4319  		}
  4320  		x := auxIntToInt64(v_0.AuxInt)
  4321  		if v_1.Op != OpWasmI64Const {
  4322  			break
  4323  		}
  4324  		y := auxIntToInt64(v_1.AuxInt)
  4325  		v.reset(OpWasmI64Const)
  4326  		v.AuxInt = int64ToAuxInt(x * y)
  4327  		return true
  4328  	}
  4329  	// match: (I64Mul (I64Const [x]) y)
  4330  	// cond: y.Op != OpWasmI64Const
  4331  	// result: (I64Mul y (I64Const [x]))
  4332  	for {
  4333  		if v_0.Op != OpWasmI64Const {
  4334  			break
  4335  		}
  4336  		x := auxIntToInt64(v_0.AuxInt)
  4337  		y := v_1
  4338  		if !(y.Op != OpWasmI64Const) {
  4339  			break
  4340  		}
  4341  		v.reset(OpWasmI64Mul)
  4342  		v0 := b.NewValue0(v.Pos, OpWasmI64Const, typ.Int64)
  4343  		v0.AuxInt = int64ToAuxInt(x)
  4344  		v.AddArg2(y, v0)
  4345  		return true
  4346  	}
  4347  	return false
  4348  }
  4349  func rewriteValueWasm_OpWasmI64Ne(v *Value) bool {
  4350  	v_1 := v.Args[1]
  4351  	v_0 := v.Args[0]
  4352  	b := v.Block
  4353  	typ := &b.Func.Config.Types
  4354  	// match: (I64Ne (I64Const [x]) (I64Const [y]))
  4355  	// cond: x == y
  4356  	// result: (I64Const [0])
  4357  	for {
  4358  		if v_0.Op != OpWasmI64Const {
  4359  			break
  4360  		}
  4361  		x := auxIntToInt64(v_0.AuxInt)
  4362  		if v_1.Op != OpWasmI64Const {
  4363  			break
  4364  		}
  4365  		y := auxIntToInt64(v_1.AuxInt)
  4366  		if !(x == y) {
  4367  			break
  4368  		}
  4369  		v.reset(OpWasmI64Const)
  4370  		v.AuxInt = int64ToAuxInt(0)
  4371  		return true
  4372  	}
  4373  	// match: (I64Ne (I64Const [x]) (I64Const [y]))
  4374  	// cond: x != y
  4375  	// result: (I64Const [1])
  4376  	for {
  4377  		if v_0.Op != OpWasmI64Const {
  4378  			break
  4379  		}
  4380  		x := auxIntToInt64(v_0.AuxInt)
  4381  		if v_1.Op != OpWasmI64Const {
  4382  			break
  4383  		}
  4384  		y := auxIntToInt64(v_1.AuxInt)
  4385  		if !(x != y) {
  4386  			break
  4387  		}
  4388  		v.reset(OpWasmI64Const)
  4389  		v.AuxInt = int64ToAuxInt(1)
  4390  		return true
  4391  	}
  4392  	// match: (I64Ne (I64Const [x]) y)
  4393  	// cond: y.Op != OpWasmI64Const
  4394  	// result: (I64Ne y (I64Const [x]))
  4395  	for {
  4396  		if v_0.Op != OpWasmI64Const {
  4397  			break
  4398  		}
  4399  		x := auxIntToInt64(v_0.AuxInt)
  4400  		y := v_1
  4401  		if !(y.Op != OpWasmI64Const) {
  4402  			break
  4403  		}
  4404  		v.reset(OpWasmI64Ne)
  4405  		v0 := b.NewValue0(v.Pos, OpWasmI64Const, typ.Int64)
  4406  		v0.AuxInt = int64ToAuxInt(x)
  4407  		v.AddArg2(y, v0)
  4408  		return true
  4409  	}
  4410  	// match: (I64Ne x (I64Const [0]))
  4411  	// result: (I64Eqz (I64Eqz x))
  4412  	for {
  4413  		x := v_0
  4414  		if v_1.Op != OpWasmI64Const || auxIntToInt64(v_1.AuxInt) != 0 {
  4415  			break
  4416  		}
  4417  		v.reset(OpWasmI64Eqz)
  4418  		v0 := b.NewValue0(v.Pos, OpWasmI64Eqz, typ.Bool)
  4419  		v0.AddArg(x)
  4420  		v.AddArg(v0)
  4421  		return true
  4422  	}
  4423  	return false
  4424  }
  4425  func rewriteValueWasm_OpWasmI64Or(v *Value) bool {
  4426  	v_1 := v.Args[1]
  4427  	v_0 := v.Args[0]
  4428  	b := v.Block
  4429  	typ := &b.Func.Config.Types
  4430  	// match: (I64Or (I64Const [x]) (I64Const [y]))
  4431  	// result: (I64Const [x | y])
  4432  	for {
  4433  		if v_0.Op != OpWasmI64Const {
  4434  			break
  4435  		}
  4436  		x := auxIntToInt64(v_0.AuxInt)
  4437  		if v_1.Op != OpWasmI64Const {
  4438  			break
  4439  		}
  4440  		y := auxIntToInt64(v_1.AuxInt)
  4441  		v.reset(OpWasmI64Const)
  4442  		v.AuxInt = int64ToAuxInt(x | y)
  4443  		return true
  4444  	}
  4445  	// match: (I64Or (I64Const [x]) y)
  4446  	// cond: y.Op != OpWasmI64Const
  4447  	// result: (I64Or y (I64Const [x]))
  4448  	for {
  4449  		if v_0.Op != OpWasmI64Const {
  4450  			break
  4451  		}
  4452  		x := auxIntToInt64(v_0.AuxInt)
  4453  		y := v_1
  4454  		if !(y.Op != OpWasmI64Const) {
  4455  			break
  4456  		}
  4457  		v.reset(OpWasmI64Or)
  4458  		v0 := b.NewValue0(v.Pos, OpWasmI64Const, typ.Int64)
  4459  		v0.AuxInt = int64ToAuxInt(x)
  4460  		v.AddArg2(y, v0)
  4461  		return true
  4462  	}
  4463  	return false
  4464  }
  4465  func rewriteValueWasm_OpWasmI64Shl(v *Value) bool {
  4466  	v_1 := v.Args[1]
  4467  	v_0 := v.Args[0]
  4468  	// match: (I64Shl (I64Const [x]) (I64Const [y]))
  4469  	// result: (I64Const [x << uint64(y)])
  4470  	for {
  4471  		if v_0.Op != OpWasmI64Const {
  4472  			break
  4473  		}
  4474  		x := auxIntToInt64(v_0.AuxInt)
  4475  		if v_1.Op != OpWasmI64Const {
  4476  			break
  4477  		}
  4478  		y := auxIntToInt64(v_1.AuxInt)
  4479  		v.reset(OpWasmI64Const)
  4480  		v.AuxInt = int64ToAuxInt(x << uint64(y))
  4481  		return true
  4482  	}
  4483  	return false
  4484  }
  4485  func rewriteValueWasm_OpWasmI64ShrS(v *Value) bool {
  4486  	v_1 := v.Args[1]
  4487  	v_0 := v.Args[0]
  4488  	// match: (I64ShrS (I64Const [x]) (I64Const [y]))
  4489  	// result: (I64Const [x >> uint64(y)])
  4490  	for {
  4491  		if v_0.Op != OpWasmI64Const {
  4492  			break
  4493  		}
  4494  		x := auxIntToInt64(v_0.AuxInt)
  4495  		if v_1.Op != OpWasmI64Const {
  4496  			break
  4497  		}
  4498  		y := auxIntToInt64(v_1.AuxInt)
  4499  		v.reset(OpWasmI64Const)
  4500  		v.AuxInt = int64ToAuxInt(x >> uint64(y))
  4501  		return true
  4502  	}
  4503  	return false
  4504  }
  4505  func rewriteValueWasm_OpWasmI64ShrU(v *Value) bool {
  4506  	v_1 := v.Args[1]
  4507  	v_0 := v.Args[0]
  4508  	// match: (I64ShrU (I64Const [x]) (I64Const [y]))
  4509  	// result: (I64Const [int64(uint64(x) >> uint64(y))])
  4510  	for {
  4511  		if v_0.Op != OpWasmI64Const {
  4512  			break
  4513  		}
  4514  		x := auxIntToInt64(v_0.AuxInt)
  4515  		if v_1.Op != OpWasmI64Const {
  4516  			break
  4517  		}
  4518  		y := auxIntToInt64(v_1.AuxInt)
  4519  		v.reset(OpWasmI64Const)
  4520  		v.AuxInt = int64ToAuxInt(int64(uint64(x) >> uint64(y)))
  4521  		return true
  4522  	}
  4523  	return false
  4524  }
  4525  func rewriteValueWasm_OpWasmI64Store(v *Value) bool {
  4526  	v_2 := v.Args[2]
  4527  	v_1 := v.Args[1]
  4528  	v_0 := v.Args[0]
  4529  	// match: (I64Store [off] (I64AddConst [off2] ptr) val mem)
  4530  	// cond: isU32Bit(off+off2)
  4531  	// result: (I64Store [off+off2] ptr val mem)
  4532  	for {
  4533  		off := auxIntToInt64(v.AuxInt)
  4534  		if v_0.Op != OpWasmI64AddConst {
  4535  			break
  4536  		}
  4537  		off2 := auxIntToInt64(v_0.AuxInt)
  4538  		ptr := v_0.Args[0]
  4539  		val := v_1
  4540  		mem := v_2
  4541  		if !(isU32Bit(off + off2)) {
  4542  			break
  4543  		}
  4544  		v.reset(OpWasmI64Store)
  4545  		v.AuxInt = int64ToAuxInt(off + off2)
  4546  		v.AddArg3(ptr, val, mem)
  4547  		return true
  4548  	}
  4549  	return false
  4550  }
  4551  func rewriteValueWasm_OpWasmI64Store16(v *Value) bool {
  4552  	v_2 := v.Args[2]
  4553  	v_1 := v.Args[1]
  4554  	v_0 := v.Args[0]
  4555  	// match: (I64Store16 [off] (I64AddConst [off2] ptr) val mem)
  4556  	// cond: isU32Bit(off+off2)
  4557  	// result: (I64Store16 [off+off2] ptr val mem)
  4558  	for {
  4559  		off := auxIntToInt64(v.AuxInt)
  4560  		if v_0.Op != OpWasmI64AddConst {
  4561  			break
  4562  		}
  4563  		off2 := auxIntToInt64(v_0.AuxInt)
  4564  		ptr := v_0.Args[0]
  4565  		val := v_1
  4566  		mem := v_2
  4567  		if !(isU32Bit(off + off2)) {
  4568  			break
  4569  		}
  4570  		v.reset(OpWasmI64Store16)
  4571  		v.AuxInt = int64ToAuxInt(off + off2)
  4572  		v.AddArg3(ptr, val, mem)
  4573  		return true
  4574  	}
  4575  	return false
  4576  }
  4577  func rewriteValueWasm_OpWasmI64Store32(v *Value) bool {
  4578  	v_2 := v.Args[2]
  4579  	v_1 := v.Args[1]
  4580  	v_0 := v.Args[0]
  4581  	// match: (I64Store32 [off] (I64AddConst [off2] ptr) val mem)
  4582  	// cond: isU32Bit(off+off2)
  4583  	// result: (I64Store32 [off+off2] ptr val mem)
  4584  	for {
  4585  		off := auxIntToInt64(v.AuxInt)
  4586  		if v_0.Op != OpWasmI64AddConst {
  4587  			break
  4588  		}
  4589  		off2 := auxIntToInt64(v_0.AuxInt)
  4590  		ptr := v_0.Args[0]
  4591  		val := v_1
  4592  		mem := v_2
  4593  		if !(isU32Bit(off + off2)) {
  4594  			break
  4595  		}
  4596  		v.reset(OpWasmI64Store32)
  4597  		v.AuxInt = int64ToAuxInt(off + off2)
  4598  		v.AddArg3(ptr, val, mem)
  4599  		return true
  4600  	}
  4601  	return false
  4602  }
  4603  func rewriteValueWasm_OpWasmI64Store8(v *Value) bool {
  4604  	v_2 := v.Args[2]
  4605  	v_1 := v.Args[1]
  4606  	v_0 := v.Args[0]
  4607  	// match: (I64Store8 [off] (I64AddConst [off2] ptr) val mem)
  4608  	// cond: isU32Bit(off+off2)
  4609  	// result: (I64Store8 [off+off2] ptr val mem)
  4610  	for {
  4611  		off := auxIntToInt64(v.AuxInt)
  4612  		if v_0.Op != OpWasmI64AddConst {
  4613  			break
  4614  		}
  4615  		off2 := auxIntToInt64(v_0.AuxInt)
  4616  		ptr := v_0.Args[0]
  4617  		val := v_1
  4618  		mem := v_2
  4619  		if !(isU32Bit(off + off2)) {
  4620  			break
  4621  		}
  4622  		v.reset(OpWasmI64Store8)
  4623  		v.AuxInt = int64ToAuxInt(off + off2)
  4624  		v.AddArg3(ptr, val, mem)
  4625  		return true
  4626  	}
  4627  	return false
  4628  }
  4629  func rewriteValueWasm_OpWasmI64Xor(v *Value) bool {
  4630  	v_1 := v.Args[1]
  4631  	v_0 := v.Args[0]
  4632  	b := v.Block
  4633  	typ := &b.Func.Config.Types
  4634  	// match: (I64Xor (I64Const [x]) (I64Const [y]))
  4635  	// result: (I64Const [x ^ y])
  4636  	for {
  4637  		if v_0.Op != OpWasmI64Const {
  4638  			break
  4639  		}
  4640  		x := auxIntToInt64(v_0.AuxInt)
  4641  		if v_1.Op != OpWasmI64Const {
  4642  			break
  4643  		}
  4644  		y := auxIntToInt64(v_1.AuxInt)
  4645  		v.reset(OpWasmI64Const)
  4646  		v.AuxInt = int64ToAuxInt(x ^ y)
  4647  		return true
  4648  	}
  4649  	// match: (I64Xor (I64Const [x]) y)
  4650  	// cond: y.Op != OpWasmI64Const
  4651  	// result: (I64Xor y (I64Const [x]))
  4652  	for {
  4653  		if v_0.Op != OpWasmI64Const {
  4654  			break
  4655  		}
  4656  		x := auxIntToInt64(v_0.AuxInt)
  4657  		y := v_1
  4658  		if !(y.Op != OpWasmI64Const) {
  4659  			break
  4660  		}
  4661  		v.reset(OpWasmI64Xor)
  4662  		v0 := b.NewValue0(v.Pos, OpWasmI64Const, typ.Int64)
  4663  		v0.AuxInt = int64ToAuxInt(x)
  4664  		v.AddArg2(y, v0)
  4665  		return true
  4666  	}
  4667  	return false
  4668  }
  4669  func rewriteValueWasm_OpZero(v *Value) bool {
  4670  	v_1 := v.Args[1]
  4671  	v_0 := v.Args[0]
  4672  	b := v.Block
  4673  	typ := &b.Func.Config.Types
  4674  	// match: (Zero [0] _ mem)
  4675  	// result: mem
  4676  	for {
  4677  		if auxIntToInt64(v.AuxInt) != 0 {
  4678  			break
  4679  		}
  4680  		mem := v_1
  4681  		v.copyOf(mem)
  4682  		return true
  4683  	}
  4684  	// match: (Zero [1] destptr mem)
  4685  	// result: (I64Store8 destptr (I64Const [0]) mem)
  4686  	for {
  4687  		if auxIntToInt64(v.AuxInt) != 1 {
  4688  			break
  4689  		}
  4690  		destptr := v_0
  4691  		mem := v_1
  4692  		v.reset(OpWasmI64Store8)
  4693  		v0 := b.NewValue0(v.Pos, OpWasmI64Const, typ.Int64)
  4694  		v0.AuxInt = int64ToAuxInt(0)
  4695  		v.AddArg3(destptr, v0, mem)
  4696  		return true
  4697  	}
  4698  	// match: (Zero [2] destptr mem)
  4699  	// result: (I64Store16 destptr (I64Const [0]) mem)
  4700  	for {
  4701  		if auxIntToInt64(v.AuxInt) != 2 {
  4702  			break
  4703  		}
  4704  		destptr := v_0
  4705  		mem := v_1
  4706  		v.reset(OpWasmI64Store16)
  4707  		v0 := b.NewValue0(v.Pos, OpWasmI64Const, typ.Int64)
  4708  		v0.AuxInt = int64ToAuxInt(0)
  4709  		v.AddArg3(destptr, v0, mem)
  4710  		return true
  4711  	}
  4712  	// match: (Zero [4] destptr mem)
  4713  	// result: (I64Store32 destptr (I64Const [0]) mem)
  4714  	for {
  4715  		if auxIntToInt64(v.AuxInt) != 4 {
  4716  			break
  4717  		}
  4718  		destptr := v_0
  4719  		mem := v_1
  4720  		v.reset(OpWasmI64Store32)
  4721  		v0 := b.NewValue0(v.Pos, OpWasmI64Const, typ.Int64)
  4722  		v0.AuxInt = int64ToAuxInt(0)
  4723  		v.AddArg3(destptr, v0, mem)
  4724  		return true
  4725  	}
  4726  	// match: (Zero [8] destptr mem)
  4727  	// result: (I64Store destptr (I64Const [0]) mem)
  4728  	for {
  4729  		if auxIntToInt64(v.AuxInt) != 8 {
  4730  			break
  4731  		}
  4732  		destptr := v_0
  4733  		mem := v_1
  4734  		v.reset(OpWasmI64Store)
  4735  		v0 := b.NewValue0(v.Pos, OpWasmI64Const, typ.Int64)
  4736  		v0.AuxInt = int64ToAuxInt(0)
  4737  		v.AddArg3(destptr, v0, mem)
  4738  		return true
  4739  	}
  4740  	// match: (Zero [3] destptr mem)
  4741  	// result: (I64Store8 [2] destptr (I64Const [0]) (I64Store16 destptr (I64Const [0]) mem))
  4742  	for {
  4743  		if auxIntToInt64(v.AuxInt) != 3 {
  4744  			break
  4745  		}
  4746  		destptr := v_0
  4747  		mem := v_1
  4748  		v.reset(OpWasmI64Store8)
  4749  		v.AuxInt = int64ToAuxInt(2)
  4750  		v0 := b.NewValue0(v.Pos, OpWasmI64Const, typ.Int64)
  4751  		v0.AuxInt = int64ToAuxInt(0)
  4752  		v1 := b.NewValue0(v.Pos, OpWasmI64Store16, types.TypeMem)
  4753  		v1.AddArg3(destptr, v0, mem)
  4754  		v.AddArg3(destptr, v0, v1)
  4755  		return true
  4756  	}
  4757  	// match: (Zero [5] destptr mem)
  4758  	// result: (I64Store8 [4] destptr (I64Const [0]) (I64Store32 destptr (I64Const [0]) mem))
  4759  	for {
  4760  		if auxIntToInt64(v.AuxInt) != 5 {
  4761  			break
  4762  		}
  4763  		destptr := v_0
  4764  		mem := v_1
  4765  		v.reset(OpWasmI64Store8)
  4766  		v.AuxInt = int64ToAuxInt(4)
  4767  		v0 := b.NewValue0(v.Pos, OpWasmI64Const, typ.Int64)
  4768  		v0.AuxInt = int64ToAuxInt(0)
  4769  		v1 := b.NewValue0(v.Pos, OpWasmI64Store32, types.TypeMem)
  4770  		v1.AddArg3(destptr, v0, mem)
  4771  		v.AddArg3(destptr, v0, v1)
  4772  		return true
  4773  	}
  4774  	// match: (Zero [6] destptr mem)
  4775  	// result: (I64Store16 [4] destptr (I64Const [0]) (I64Store32 destptr (I64Const [0]) mem))
  4776  	for {
  4777  		if auxIntToInt64(v.AuxInt) != 6 {
  4778  			break
  4779  		}
  4780  		destptr := v_0
  4781  		mem := v_1
  4782  		v.reset(OpWasmI64Store16)
  4783  		v.AuxInt = int64ToAuxInt(4)
  4784  		v0 := b.NewValue0(v.Pos, OpWasmI64Const, typ.Int64)
  4785  		v0.AuxInt = int64ToAuxInt(0)
  4786  		v1 := b.NewValue0(v.Pos, OpWasmI64Store32, types.TypeMem)
  4787  		v1.AddArg3(destptr, v0, mem)
  4788  		v.AddArg3(destptr, v0, v1)
  4789  		return true
  4790  	}
  4791  	// match: (Zero [7] destptr mem)
  4792  	// result: (I64Store32 [3] destptr (I64Const [0]) (I64Store32 destptr (I64Const [0]) mem))
  4793  	for {
  4794  		if auxIntToInt64(v.AuxInt) != 7 {
  4795  			break
  4796  		}
  4797  		destptr := v_0
  4798  		mem := v_1
  4799  		v.reset(OpWasmI64Store32)
  4800  		v.AuxInt = int64ToAuxInt(3)
  4801  		v0 := b.NewValue0(v.Pos, OpWasmI64Const, typ.Int64)
  4802  		v0.AuxInt = int64ToAuxInt(0)
  4803  		v1 := b.NewValue0(v.Pos, OpWasmI64Store32, types.TypeMem)
  4804  		v1.AddArg3(destptr, v0, mem)
  4805  		v.AddArg3(destptr, v0, v1)
  4806  		return true
  4807  	}
  4808  	// match: (Zero [s] destptr mem)
  4809  	// cond: s%8 != 0 && s > 8 && s < 32
  4810  	// result: (Zero [s-s%8] (OffPtr <destptr.Type> destptr [s%8]) (I64Store destptr (I64Const [0]) mem))
  4811  	for {
  4812  		s := auxIntToInt64(v.AuxInt)
  4813  		destptr := v_0
  4814  		mem := v_1
  4815  		if !(s%8 != 0 && s > 8 && s < 32) {
  4816  			break
  4817  		}
  4818  		v.reset(OpZero)
  4819  		v.AuxInt = int64ToAuxInt(s - s%8)
  4820  		v0 := b.NewValue0(v.Pos, OpOffPtr, destptr.Type)
  4821  		v0.AuxInt = int64ToAuxInt(s % 8)
  4822  		v0.AddArg(destptr)
  4823  		v1 := b.NewValue0(v.Pos, OpWasmI64Store, types.TypeMem)
  4824  		v2 := b.NewValue0(v.Pos, OpWasmI64Const, typ.Int64)
  4825  		v2.AuxInt = int64ToAuxInt(0)
  4826  		v1.AddArg3(destptr, v2, mem)
  4827  		v.AddArg2(v0, v1)
  4828  		return true
  4829  	}
  4830  	// match: (Zero [16] destptr mem)
  4831  	// result: (I64Store [8] destptr (I64Const [0]) (I64Store destptr (I64Const [0]) mem))
  4832  	for {
  4833  		if auxIntToInt64(v.AuxInt) != 16 {
  4834  			break
  4835  		}
  4836  		destptr := v_0
  4837  		mem := v_1
  4838  		v.reset(OpWasmI64Store)
  4839  		v.AuxInt = int64ToAuxInt(8)
  4840  		v0 := b.NewValue0(v.Pos, OpWasmI64Const, typ.Int64)
  4841  		v0.AuxInt = int64ToAuxInt(0)
  4842  		v1 := b.NewValue0(v.Pos, OpWasmI64Store, types.TypeMem)
  4843  		v1.AddArg3(destptr, v0, mem)
  4844  		v.AddArg3(destptr, v0, v1)
  4845  		return true
  4846  	}
  4847  	// match: (Zero [24] destptr mem)
  4848  	// result: (I64Store [16] destptr (I64Const [0]) (I64Store [8] destptr (I64Const [0]) (I64Store destptr (I64Const [0]) mem)))
  4849  	for {
  4850  		if auxIntToInt64(v.AuxInt) != 24 {
  4851  			break
  4852  		}
  4853  		destptr := v_0
  4854  		mem := v_1
  4855  		v.reset(OpWasmI64Store)
  4856  		v.AuxInt = int64ToAuxInt(16)
  4857  		v0 := b.NewValue0(v.Pos, OpWasmI64Const, typ.Int64)
  4858  		v0.AuxInt = int64ToAuxInt(0)
  4859  		v1 := b.NewValue0(v.Pos, OpWasmI64Store, types.TypeMem)
  4860  		v1.AuxInt = int64ToAuxInt(8)
  4861  		v2 := b.NewValue0(v.Pos, OpWasmI64Store, types.TypeMem)
  4862  		v2.AddArg3(destptr, v0, mem)
  4863  		v1.AddArg3(destptr, v0, v2)
  4864  		v.AddArg3(destptr, v0, v1)
  4865  		return true
  4866  	}
  4867  	// match: (Zero [32] destptr mem)
  4868  	// result: (I64Store [24] destptr (I64Const [0]) (I64Store [16] destptr (I64Const [0]) (I64Store [8] destptr (I64Const [0]) (I64Store destptr (I64Const [0]) mem))))
  4869  	for {
  4870  		if auxIntToInt64(v.AuxInt) != 32 {
  4871  			break
  4872  		}
  4873  		destptr := v_0
  4874  		mem := v_1
  4875  		v.reset(OpWasmI64Store)
  4876  		v.AuxInt = int64ToAuxInt(24)
  4877  		v0 := b.NewValue0(v.Pos, OpWasmI64Const, typ.Int64)
  4878  		v0.AuxInt = int64ToAuxInt(0)
  4879  		v1 := b.NewValue0(v.Pos, OpWasmI64Store, types.TypeMem)
  4880  		v1.AuxInt = int64ToAuxInt(16)
  4881  		v2 := b.NewValue0(v.Pos, OpWasmI64Store, types.TypeMem)
  4882  		v2.AuxInt = int64ToAuxInt(8)
  4883  		v3 := b.NewValue0(v.Pos, OpWasmI64Store, types.TypeMem)
  4884  		v3.AddArg3(destptr, v0, mem)
  4885  		v2.AddArg3(destptr, v0, v3)
  4886  		v1.AddArg3(destptr, v0, v2)
  4887  		v.AddArg3(destptr, v0, v1)
  4888  		return true
  4889  	}
  4890  	// match: (Zero [s] destptr mem)
  4891  	// result: (LoweredZero [s] destptr mem)
  4892  	for {
  4893  		s := auxIntToInt64(v.AuxInt)
  4894  		destptr := v_0
  4895  		mem := v_1
  4896  		v.reset(OpWasmLoweredZero)
  4897  		v.AuxInt = int64ToAuxInt(s)
  4898  		v.AddArg2(destptr, mem)
  4899  		return true
  4900  	}
  4901  }
  4902  func rewriteValueWasm_OpZeroExt16to32(v *Value) bool {
  4903  	v_0 := v.Args[0]
  4904  	b := v.Block
  4905  	typ := &b.Func.Config.Types
  4906  	// match: (ZeroExt16to32 x:(I64Load16U _ _))
  4907  	// result: x
  4908  	for {
  4909  		x := v_0
  4910  		if x.Op != OpWasmI64Load16U {
  4911  			break
  4912  		}
  4913  		v.copyOf(x)
  4914  		return true
  4915  	}
  4916  	// match: (ZeroExt16to32 x)
  4917  	// result: (I64And x (I64Const [0xffff]))
  4918  	for {
  4919  		x := v_0
  4920  		v.reset(OpWasmI64And)
  4921  		v0 := b.NewValue0(v.Pos, OpWasmI64Const, typ.Int64)
  4922  		v0.AuxInt = int64ToAuxInt(0xffff)
  4923  		v.AddArg2(x, v0)
  4924  		return true
  4925  	}
  4926  }
  4927  func rewriteValueWasm_OpZeroExt16to64(v *Value) bool {
  4928  	v_0 := v.Args[0]
  4929  	b := v.Block
  4930  	typ := &b.Func.Config.Types
  4931  	// match: (ZeroExt16to64 x:(I64Load16U _ _))
  4932  	// result: x
  4933  	for {
  4934  		x := v_0
  4935  		if x.Op != OpWasmI64Load16U {
  4936  			break
  4937  		}
  4938  		v.copyOf(x)
  4939  		return true
  4940  	}
  4941  	// match: (ZeroExt16to64 x)
  4942  	// result: (I64And x (I64Const [0xffff]))
  4943  	for {
  4944  		x := v_0
  4945  		v.reset(OpWasmI64And)
  4946  		v0 := b.NewValue0(v.Pos, OpWasmI64Const, typ.Int64)
  4947  		v0.AuxInt = int64ToAuxInt(0xffff)
  4948  		v.AddArg2(x, v0)
  4949  		return true
  4950  	}
  4951  }
  4952  func rewriteValueWasm_OpZeroExt32to64(v *Value) bool {
  4953  	v_0 := v.Args[0]
  4954  	b := v.Block
  4955  	typ := &b.Func.Config.Types
  4956  	// match: (ZeroExt32to64 x:(I64Load32U _ _))
  4957  	// result: x
  4958  	for {
  4959  		x := v_0
  4960  		if x.Op != OpWasmI64Load32U {
  4961  			break
  4962  		}
  4963  		v.copyOf(x)
  4964  		return true
  4965  	}
  4966  	// match: (ZeroExt32to64 x)
  4967  	// result: (I64And x (I64Const [0xffffffff]))
  4968  	for {
  4969  		x := v_0
  4970  		v.reset(OpWasmI64And)
  4971  		v0 := b.NewValue0(v.Pos, OpWasmI64Const, typ.Int64)
  4972  		v0.AuxInt = int64ToAuxInt(0xffffffff)
  4973  		v.AddArg2(x, v0)
  4974  		return true
  4975  	}
  4976  }
  4977  func rewriteValueWasm_OpZeroExt8to16(v *Value) bool {
  4978  	v_0 := v.Args[0]
  4979  	b := v.Block
  4980  	typ := &b.Func.Config.Types
  4981  	// match: (ZeroExt8to16 x:(I64Load8U _ _))
  4982  	// result: x
  4983  	for {
  4984  		x := v_0
  4985  		if x.Op != OpWasmI64Load8U {
  4986  			break
  4987  		}
  4988  		v.copyOf(x)
  4989  		return true
  4990  	}
  4991  	// match: (ZeroExt8to16 x)
  4992  	// result: (I64And x (I64Const [0xff]))
  4993  	for {
  4994  		x := v_0
  4995  		v.reset(OpWasmI64And)
  4996  		v0 := b.NewValue0(v.Pos, OpWasmI64Const, typ.Int64)
  4997  		v0.AuxInt = int64ToAuxInt(0xff)
  4998  		v.AddArg2(x, v0)
  4999  		return true
  5000  	}
  5001  }
  5002  func rewriteValueWasm_OpZeroExt8to32(v *Value) bool {
  5003  	v_0 := v.Args[0]
  5004  	b := v.Block
  5005  	typ := &b.Func.Config.Types
  5006  	// match: (ZeroExt8to32 x:(I64Load8U _ _))
  5007  	// result: x
  5008  	for {
  5009  		x := v_0
  5010  		if x.Op != OpWasmI64Load8U {
  5011  			break
  5012  		}
  5013  		v.copyOf(x)
  5014  		return true
  5015  	}
  5016  	// match: (ZeroExt8to32 x)
  5017  	// result: (I64And x (I64Const [0xff]))
  5018  	for {
  5019  		x := v_0
  5020  		v.reset(OpWasmI64And)
  5021  		v0 := b.NewValue0(v.Pos, OpWasmI64Const, typ.Int64)
  5022  		v0.AuxInt = int64ToAuxInt(0xff)
  5023  		v.AddArg2(x, v0)
  5024  		return true
  5025  	}
  5026  }
  5027  func rewriteValueWasm_OpZeroExt8to64(v *Value) bool {
  5028  	v_0 := v.Args[0]
  5029  	b := v.Block
  5030  	typ := &b.Func.Config.Types
  5031  	// match: (ZeroExt8to64 x:(I64Load8U _ _))
  5032  	// result: x
  5033  	for {
  5034  		x := v_0
  5035  		if x.Op != OpWasmI64Load8U {
  5036  			break
  5037  		}
  5038  		v.copyOf(x)
  5039  		return true
  5040  	}
  5041  	// match: (ZeroExt8to64 x)
  5042  	// result: (I64And x (I64Const [0xff]))
  5043  	for {
  5044  		x := v_0
  5045  		v.reset(OpWasmI64And)
  5046  		v0 := b.NewValue0(v.Pos, OpWasmI64Const, typ.Int64)
  5047  		v0.AuxInt = int64ToAuxInt(0xff)
  5048  		v.AddArg2(x, v0)
  5049  		return true
  5050  	}
  5051  }
  5052  func rewriteBlockWasm(b *Block) bool {
  5053  	return false
  5054  }
  5055  

View as plain text