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

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

View as plain text