Black Lives Matter. Support the Equal Justice Initiative.

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

Documentation: cmd/compile/internal/ssa

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

View as plain text