Source file src/cmd/compile/internal/ssarewrite/rewritemips/rewriteMIPS.go

     1  // Code generated from _gen/MIPS.rules using 'go generate'; DO NOT EDIT.
     2  
     3  package rewritemips
     4  
     5  import "cmd/compile/internal/types"
     6  import "cmd/compile/internal/ssa/block"
     7  import "cmd/compile/internal/ssa/ssaop"
     8  import "cmd/compile/internal/ssa"
     9  
    10  func RewriteValue(v *ssa.Value) bool {
    11  	switch v.Op {
    12  	case ssaop.OpAbs:
    13  		v.Op = ssaop.OpMIPSABSD
    14  		return true
    15  	case ssaop.OpAdd16:
    16  		v.Op = ssaop.OpMIPSADD
    17  		return true
    18  	case ssaop.OpAdd32:
    19  		v.Op = ssaop.OpMIPSADD
    20  		return true
    21  	case ssaop.OpAdd32F:
    22  		v.Op = ssaop.OpMIPSADDF
    23  		return true
    24  	case ssaop.OpAdd32withcarry:
    25  		return rewriteValue_OpAdd32withcarry(v)
    26  	case ssaop.OpAdd64F:
    27  		v.Op = ssaop.OpMIPSADDD
    28  		return true
    29  	case ssaop.OpAdd8:
    30  		v.Op = ssaop.OpMIPSADD
    31  		return true
    32  	case ssaop.OpAddPtr:
    33  		v.Op = ssaop.OpMIPSADD
    34  		return true
    35  	case ssaop.OpAddr:
    36  		return rewriteValue_OpAddr(v)
    37  	case ssaop.OpAnd16:
    38  		v.Op = ssaop.OpMIPSAND
    39  		return true
    40  	case ssaop.OpAnd32:
    41  		v.Op = ssaop.OpMIPSAND
    42  		return true
    43  	case ssaop.OpAnd8:
    44  		v.Op = ssaop.OpMIPSAND
    45  		return true
    46  	case ssaop.OpAndB:
    47  		v.Op = ssaop.OpMIPSAND
    48  		return true
    49  	case ssaop.OpAtomicAdd32:
    50  		v.Op = ssaop.OpMIPSLoweredAtomicAdd
    51  		return true
    52  	case ssaop.OpAtomicAnd32:
    53  		v.Op = ssaop.OpMIPSLoweredAtomicAnd
    54  		return true
    55  	case ssaop.OpAtomicAnd8:
    56  		return rewriteValue_OpAtomicAnd8(v)
    57  	case ssaop.OpAtomicCompareAndSwap32:
    58  		v.Op = ssaop.OpMIPSLoweredAtomicCas
    59  		return true
    60  	case ssaop.OpAtomicExchange32:
    61  		v.Op = ssaop.OpMIPSLoweredAtomicExchange
    62  		return true
    63  	case ssaop.OpAtomicLoad32:
    64  		v.Op = ssaop.OpMIPSLoweredAtomicLoad32
    65  		return true
    66  	case ssaop.OpAtomicLoad8:
    67  		v.Op = ssaop.OpMIPSLoweredAtomicLoad8
    68  		return true
    69  	case ssaop.OpAtomicLoadPtr:
    70  		v.Op = ssaop.OpMIPSLoweredAtomicLoad32
    71  		return true
    72  	case ssaop.OpAtomicOr32:
    73  		v.Op = ssaop.OpMIPSLoweredAtomicOr
    74  		return true
    75  	case ssaop.OpAtomicOr8:
    76  		return rewriteValue_OpAtomicOr8(v)
    77  	case ssaop.OpAtomicStore32:
    78  		v.Op = ssaop.OpMIPSLoweredAtomicStore32
    79  		return true
    80  	case ssaop.OpAtomicStore8:
    81  		v.Op = ssaop.OpMIPSLoweredAtomicStore8
    82  		return true
    83  	case ssaop.OpAtomicStorePtrNoWB:
    84  		v.Op = ssaop.OpMIPSLoweredAtomicStore32
    85  		return true
    86  	case ssaop.OpAvg32u:
    87  		return rewriteValue_OpAvg32u(v)
    88  	case ssaop.OpBitLen16:
    89  		return rewriteValue_OpBitLen16(v)
    90  	case ssaop.OpBitLen32:
    91  		return rewriteValue_OpBitLen32(v)
    92  	case ssaop.OpBitLen8:
    93  		return rewriteValue_OpBitLen8(v)
    94  	case ssaop.OpClosureCall:
    95  		v.Op = ssaop.OpMIPSCALLclosure
    96  		return true
    97  	case ssaop.OpCom16:
    98  		return rewriteValue_OpCom16(v)
    99  	case ssaop.OpCom32:
   100  		return rewriteValue_OpCom32(v)
   101  	case ssaop.OpCom8:
   102  		return rewriteValue_OpCom8(v)
   103  	case ssaop.OpConst16:
   104  		return rewriteValue_OpConst16(v)
   105  	case ssaop.OpConst32:
   106  		return rewriteValue_OpConst32(v)
   107  	case ssaop.OpConst32F:
   108  		v.Op = ssaop.OpMIPSMOVFconst
   109  		return true
   110  	case ssaop.OpConst64F:
   111  		v.Op = ssaop.OpMIPSMOVDconst
   112  		return true
   113  	case ssaop.OpConst8:
   114  		return rewriteValue_OpConst8(v)
   115  	case ssaop.OpConstBool:
   116  		return rewriteValue_OpConstBool(v)
   117  	case ssaop.OpConstNil:
   118  		return rewriteValue_OpConstNil(v)
   119  	case ssaop.OpCtz16:
   120  		return rewriteValue_OpCtz16(v)
   121  	case ssaop.OpCtz16NonZero:
   122  		v.Op = ssaop.OpCtz32
   123  		return true
   124  	case ssaop.OpCtz32:
   125  		return rewriteValue_OpCtz32(v)
   126  	case ssaop.OpCtz32NonZero:
   127  		v.Op = ssaop.OpCtz32
   128  		return true
   129  	case ssaop.OpCtz8:
   130  		return rewriteValue_OpCtz8(v)
   131  	case ssaop.OpCtz8NonZero:
   132  		v.Op = ssaop.OpCtz32
   133  		return true
   134  	case ssaop.OpCvt32Fto32:
   135  		v.Op = ssaop.OpMIPSTRUNCFW
   136  		return true
   137  	case ssaop.OpCvt32Fto64F:
   138  		v.Op = ssaop.OpMIPSMOVFD
   139  		return true
   140  	case ssaop.OpCvt32to32F:
   141  		v.Op = ssaop.OpMIPSMOVWF
   142  		return true
   143  	case ssaop.OpCvt32to64F:
   144  		v.Op = ssaop.OpMIPSMOVWD
   145  		return true
   146  	case ssaop.OpCvt64Fto32:
   147  		v.Op = ssaop.OpMIPSTRUNCDW
   148  		return true
   149  	case ssaop.OpCvt64Fto32F:
   150  		v.Op = ssaop.OpMIPSMOVDF
   151  		return true
   152  	case ssaop.OpCvtBoolToUint8:
   153  		v.Op = ssaop.OpCopy
   154  		return true
   155  	case ssaop.OpDiv16:
   156  		return rewriteValue_OpDiv16(v)
   157  	case ssaop.OpDiv16u:
   158  		return rewriteValue_OpDiv16u(v)
   159  	case ssaop.OpDiv32:
   160  		return rewriteValue_OpDiv32(v)
   161  	case ssaop.OpDiv32F:
   162  		v.Op = ssaop.OpMIPSDIVF
   163  		return true
   164  	case ssaop.OpDiv32u:
   165  		return rewriteValue_OpDiv32u(v)
   166  	case ssaop.OpDiv64F:
   167  		v.Op = ssaop.OpMIPSDIVD
   168  		return true
   169  	case ssaop.OpDiv8:
   170  		return rewriteValue_OpDiv8(v)
   171  	case ssaop.OpDiv8u:
   172  		return rewriteValue_OpDiv8u(v)
   173  	case ssaop.OpEq16:
   174  		return rewriteValue_OpEq16(v)
   175  	case ssaop.OpEq32:
   176  		return rewriteValue_OpEq32(v)
   177  	case ssaop.OpEq32F:
   178  		return rewriteValue_OpEq32F(v)
   179  	case ssaop.OpEq64F:
   180  		return rewriteValue_OpEq64F(v)
   181  	case ssaop.OpEq8:
   182  		return rewriteValue_OpEq8(v)
   183  	case ssaop.OpEqB:
   184  		return rewriteValue_OpEqB(v)
   185  	case ssaop.OpEqPtr:
   186  		return rewriteValue_OpEqPtr(v)
   187  	case ssaop.OpGetCallerPC:
   188  		v.Op = ssaop.OpMIPSLoweredGetCallerPC
   189  		return true
   190  	case ssaop.OpGetCallerSP:
   191  		v.Op = ssaop.OpMIPSLoweredGetCallerSP
   192  		return true
   193  	case ssaop.OpGetClosurePtr:
   194  		v.Op = ssaop.OpMIPSLoweredGetClosurePtr
   195  		return true
   196  	case ssaop.OpHmul32:
   197  		return rewriteValue_OpHmul32(v)
   198  	case ssaop.OpHmul32u:
   199  		return rewriteValue_OpHmul32u(v)
   200  	case ssaop.OpInterCall:
   201  		v.Op = ssaop.OpMIPSCALLinter
   202  		return true
   203  	case ssaop.OpIsInBounds:
   204  		return rewriteValue_OpIsInBounds(v)
   205  	case ssaop.OpIsNonNil:
   206  		return rewriteValue_OpIsNonNil(v)
   207  	case ssaop.OpIsSliceInBounds:
   208  		return rewriteValue_OpIsSliceInBounds(v)
   209  	case ssaop.OpLeq16:
   210  		return rewriteValue_OpLeq16(v)
   211  	case ssaop.OpLeq16U:
   212  		return rewriteValue_OpLeq16U(v)
   213  	case ssaop.OpLeq32:
   214  		return rewriteValue_OpLeq32(v)
   215  	case ssaop.OpLeq32F:
   216  		return rewriteValue_OpLeq32F(v)
   217  	case ssaop.OpLeq32U:
   218  		return rewriteValue_OpLeq32U(v)
   219  	case ssaop.OpLeq64F:
   220  		return rewriteValue_OpLeq64F(v)
   221  	case ssaop.OpLeq8:
   222  		return rewriteValue_OpLeq8(v)
   223  	case ssaop.OpLeq8U:
   224  		return rewriteValue_OpLeq8U(v)
   225  	case ssaop.OpLess16:
   226  		return rewriteValue_OpLess16(v)
   227  	case ssaop.OpLess16U:
   228  		return rewriteValue_OpLess16U(v)
   229  	case ssaop.OpLess32:
   230  		return rewriteValue_OpLess32(v)
   231  	case ssaop.OpLess32F:
   232  		return rewriteValue_OpLess32F(v)
   233  	case ssaop.OpLess32U:
   234  		return rewriteValue_OpLess32U(v)
   235  	case ssaop.OpLess64F:
   236  		return rewriteValue_OpLess64F(v)
   237  	case ssaop.OpLess8:
   238  		return rewriteValue_OpLess8(v)
   239  	case ssaop.OpLess8U:
   240  		return rewriteValue_OpLess8U(v)
   241  	case ssaop.OpLoad:
   242  		return rewriteValue_OpLoad(v)
   243  	case ssaop.OpLocalAddr:
   244  		return rewriteValue_OpLocalAddr(v)
   245  	case ssaop.OpLsh16x16:
   246  		return rewriteValue_OpLsh16x16(v)
   247  	case ssaop.OpLsh16x32:
   248  		return rewriteValue_OpLsh16x32(v)
   249  	case ssaop.OpLsh16x64:
   250  		return rewriteValue_OpLsh16x64(v)
   251  	case ssaop.OpLsh16x8:
   252  		return rewriteValue_OpLsh16x8(v)
   253  	case ssaop.OpLsh32x16:
   254  		return rewriteValue_OpLsh32x16(v)
   255  	case ssaop.OpLsh32x32:
   256  		return rewriteValue_OpLsh32x32(v)
   257  	case ssaop.OpLsh32x64:
   258  		return rewriteValue_OpLsh32x64(v)
   259  	case ssaop.OpLsh32x8:
   260  		return rewriteValue_OpLsh32x8(v)
   261  	case ssaop.OpLsh8x16:
   262  		return rewriteValue_OpLsh8x16(v)
   263  	case ssaop.OpLsh8x32:
   264  		return rewriteValue_OpLsh8x32(v)
   265  	case ssaop.OpLsh8x64:
   266  		return rewriteValue_OpLsh8x64(v)
   267  	case ssaop.OpLsh8x8:
   268  		return rewriteValue_OpLsh8x8(v)
   269  	case ssaop.OpMIPSADD:
   270  		return rewriteValue_OpMIPSADD(v)
   271  	case ssaop.OpMIPSADDconst:
   272  		return rewriteValue_OpMIPSADDconst(v)
   273  	case ssaop.OpMIPSAND:
   274  		return rewriteValue_OpMIPSAND(v)
   275  	case ssaop.OpMIPSANDconst:
   276  		return rewriteValue_OpMIPSANDconst(v)
   277  	case ssaop.OpMIPSCMOVZ:
   278  		return rewriteValue_OpMIPSCMOVZ(v)
   279  	case ssaop.OpMIPSCMOVZzero:
   280  		return rewriteValue_OpMIPSCMOVZzero(v)
   281  	case ssaop.OpMIPSLoweredAtomicAdd:
   282  		return rewriteValue_OpMIPSLoweredAtomicAdd(v)
   283  	case ssaop.OpMIPSLoweredAtomicStore32:
   284  		return rewriteValue_OpMIPSLoweredAtomicStore32(v)
   285  	case ssaop.OpMIPSLoweredPanicBoundsRC:
   286  		return rewriteValue_OpMIPSLoweredPanicBoundsRC(v)
   287  	case ssaop.OpMIPSLoweredPanicBoundsRR:
   288  		return rewriteValue_OpMIPSLoweredPanicBoundsRR(v)
   289  	case ssaop.OpMIPSLoweredPanicExtendRC:
   290  		return rewriteValue_OpMIPSLoweredPanicExtendRC(v)
   291  	case ssaop.OpMIPSLoweredPanicExtendRR:
   292  		return rewriteValue_OpMIPSLoweredPanicExtendRR(v)
   293  	case ssaop.OpMIPSMOVBUload:
   294  		return rewriteValue_OpMIPSMOVBUload(v)
   295  	case ssaop.OpMIPSMOVBUreg:
   296  		return rewriteValue_OpMIPSMOVBUreg(v)
   297  	case ssaop.OpMIPSMOVBload:
   298  		return rewriteValue_OpMIPSMOVBload(v)
   299  	case ssaop.OpMIPSMOVBreg:
   300  		return rewriteValue_OpMIPSMOVBreg(v)
   301  	case ssaop.OpMIPSMOVBstore:
   302  		return rewriteValue_OpMIPSMOVBstore(v)
   303  	case ssaop.OpMIPSMOVBstorezero:
   304  		return rewriteValue_OpMIPSMOVBstorezero(v)
   305  	case ssaop.OpMIPSMOVDload:
   306  		return rewriteValue_OpMIPSMOVDload(v)
   307  	case ssaop.OpMIPSMOVDstore:
   308  		return rewriteValue_OpMIPSMOVDstore(v)
   309  	case ssaop.OpMIPSMOVFload:
   310  		return rewriteValue_OpMIPSMOVFload(v)
   311  	case ssaop.OpMIPSMOVFstore:
   312  		return rewriteValue_OpMIPSMOVFstore(v)
   313  	case ssaop.OpMIPSMOVHUload:
   314  		return rewriteValue_OpMIPSMOVHUload(v)
   315  	case ssaop.OpMIPSMOVHUreg:
   316  		return rewriteValue_OpMIPSMOVHUreg(v)
   317  	case ssaop.OpMIPSMOVHload:
   318  		return rewriteValue_OpMIPSMOVHload(v)
   319  	case ssaop.OpMIPSMOVHreg:
   320  		return rewriteValue_OpMIPSMOVHreg(v)
   321  	case ssaop.OpMIPSMOVHstore:
   322  		return rewriteValue_OpMIPSMOVHstore(v)
   323  	case ssaop.OpMIPSMOVHstorezero:
   324  		return rewriteValue_OpMIPSMOVHstorezero(v)
   325  	case ssaop.OpMIPSMOVWload:
   326  		return rewriteValue_OpMIPSMOVWload(v)
   327  	case ssaop.OpMIPSMOVWnop:
   328  		return rewriteValue_OpMIPSMOVWnop(v)
   329  	case ssaop.OpMIPSMOVWreg:
   330  		return rewriteValue_OpMIPSMOVWreg(v)
   331  	case ssaop.OpMIPSMOVWstore:
   332  		return rewriteValue_OpMIPSMOVWstore(v)
   333  	case ssaop.OpMIPSMOVWstorezero:
   334  		return rewriteValue_OpMIPSMOVWstorezero(v)
   335  	case ssaop.OpMIPSMUL:
   336  		return rewriteValue_OpMIPSMUL(v)
   337  	case ssaop.OpMIPSNEG:
   338  		return rewriteValue_OpMIPSNEG(v)
   339  	case ssaop.OpMIPSOR:
   340  		return rewriteValue_OpMIPSOR(v)
   341  	case ssaop.OpMIPSORconst:
   342  		return rewriteValue_OpMIPSORconst(v)
   343  	case ssaop.OpMIPSSGT:
   344  		return rewriteValue_OpMIPSSGT(v)
   345  	case ssaop.OpMIPSSGTU:
   346  		return rewriteValue_OpMIPSSGTU(v)
   347  	case ssaop.OpMIPSSGTUconst:
   348  		return rewriteValue_OpMIPSSGTUconst(v)
   349  	case ssaop.OpMIPSSGTUzero:
   350  		return rewriteValue_OpMIPSSGTUzero(v)
   351  	case ssaop.OpMIPSSGTconst:
   352  		return rewriteValue_OpMIPSSGTconst(v)
   353  	case ssaop.OpMIPSSGTzero:
   354  		return rewriteValue_OpMIPSSGTzero(v)
   355  	case ssaop.OpMIPSSLL:
   356  		return rewriteValue_OpMIPSSLL(v)
   357  	case ssaop.OpMIPSSLLconst:
   358  		return rewriteValue_OpMIPSSLLconst(v)
   359  	case ssaop.OpMIPSSRA:
   360  		return rewriteValue_OpMIPSSRA(v)
   361  	case ssaop.OpMIPSSRAconst:
   362  		return rewriteValue_OpMIPSSRAconst(v)
   363  	case ssaop.OpMIPSSRL:
   364  		return rewriteValue_OpMIPSSRL(v)
   365  	case ssaop.OpMIPSSRLconst:
   366  		return rewriteValue_OpMIPSSRLconst(v)
   367  	case ssaop.OpMIPSSUB:
   368  		return rewriteValue_OpMIPSSUB(v)
   369  	case ssaop.OpMIPSSUBconst:
   370  		return rewriteValue_OpMIPSSUBconst(v)
   371  	case ssaop.OpMIPSXOR:
   372  		return rewriteValue_OpMIPSXOR(v)
   373  	case ssaop.OpMIPSXORconst:
   374  		return rewriteValue_OpMIPSXORconst(v)
   375  	case ssaop.OpMod16:
   376  		return rewriteValue_OpMod16(v)
   377  	case ssaop.OpMod16u:
   378  		return rewriteValue_OpMod16u(v)
   379  	case ssaop.OpMod32:
   380  		return rewriteValue_OpMod32(v)
   381  	case ssaop.OpMod32u:
   382  		return rewriteValue_OpMod32u(v)
   383  	case ssaop.OpMod8:
   384  		return rewriteValue_OpMod8(v)
   385  	case ssaop.OpMod8u:
   386  		return rewriteValue_OpMod8u(v)
   387  	case ssaop.OpMove:
   388  		return rewriteValue_OpMove(v)
   389  	case ssaop.OpMul16:
   390  		v.Op = ssaop.OpMIPSMUL
   391  		return true
   392  	case ssaop.OpMul32:
   393  		v.Op = ssaop.OpMIPSMUL
   394  		return true
   395  	case ssaop.OpMul32F:
   396  		v.Op = ssaop.OpMIPSMULF
   397  		return true
   398  	case ssaop.OpMul32uhilo:
   399  		v.Op = ssaop.OpMIPSMULTU
   400  		return true
   401  	case ssaop.OpMul64F:
   402  		v.Op = ssaop.OpMIPSMULD
   403  		return true
   404  	case ssaop.OpMul8:
   405  		v.Op = ssaop.OpMIPSMUL
   406  		return true
   407  	case ssaop.OpNeg16:
   408  		v.Op = ssaop.OpMIPSNEG
   409  		return true
   410  	case ssaop.OpNeg32:
   411  		v.Op = ssaop.OpMIPSNEG
   412  		return true
   413  	case ssaop.OpNeg32F:
   414  		v.Op = ssaop.OpMIPSNEGF
   415  		return true
   416  	case ssaop.OpNeg64F:
   417  		v.Op = ssaop.OpMIPSNEGD
   418  		return true
   419  	case ssaop.OpNeg8:
   420  		v.Op = ssaop.OpMIPSNEG
   421  		return true
   422  	case ssaop.OpNeq16:
   423  		return rewriteValue_OpNeq16(v)
   424  	case ssaop.OpNeq32:
   425  		return rewriteValue_OpNeq32(v)
   426  	case ssaop.OpNeq32F:
   427  		return rewriteValue_OpNeq32F(v)
   428  	case ssaop.OpNeq64F:
   429  		return rewriteValue_OpNeq64F(v)
   430  	case ssaop.OpNeq8:
   431  		return rewriteValue_OpNeq8(v)
   432  	case ssaop.OpNeqB:
   433  		v.Op = ssaop.OpMIPSXOR
   434  		return true
   435  	case ssaop.OpNeqPtr:
   436  		return rewriteValue_OpNeqPtr(v)
   437  	case ssaop.OpNilCheck:
   438  		v.Op = ssaop.OpMIPSLoweredNilCheck
   439  		return true
   440  	case ssaop.OpNot:
   441  		return rewriteValue_OpNot(v)
   442  	case ssaop.OpOffPtr:
   443  		return rewriteValue_OpOffPtr(v)
   444  	case ssaop.OpOr16:
   445  		v.Op = ssaop.OpMIPSOR
   446  		return true
   447  	case ssaop.OpOr32:
   448  		v.Op = ssaop.OpMIPSOR
   449  		return true
   450  	case ssaop.OpOr8:
   451  		v.Op = ssaop.OpMIPSOR
   452  		return true
   453  	case ssaop.OpOrB:
   454  		v.Op = ssaop.OpMIPSOR
   455  		return true
   456  	case ssaop.OpPanicBounds:
   457  		v.Op = ssaop.OpMIPSLoweredPanicBoundsRR
   458  		return true
   459  	case ssaop.OpPanicExtend:
   460  		v.Op = ssaop.OpMIPSLoweredPanicExtendRR
   461  		return true
   462  	case ssaop.OpPubBarrier:
   463  		v.Op = ssaop.OpMIPSLoweredPubBarrier
   464  		return true
   465  	case ssaop.OpRotateLeft16:
   466  		return rewriteValue_OpRotateLeft16(v)
   467  	case ssaop.OpRotateLeft32:
   468  		return rewriteValue_OpRotateLeft32(v)
   469  	case ssaop.OpRotateLeft64:
   470  		return rewriteValue_OpRotateLeft64(v)
   471  	case ssaop.OpRotateLeft8:
   472  		return rewriteValue_OpRotateLeft8(v)
   473  	case ssaop.OpRound32F:
   474  		v.Op = ssaop.OpCopy
   475  		return true
   476  	case ssaop.OpRound64F:
   477  		v.Op = ssaop.OpCopy
   478  		return true
   479  	case ssaop.OpRsh16Ux16:
   480  		return rewriteValue_OpRsh16Ux16(v)
   481  	case ssaop.OpRsh16Ux32:
   482  		return rewriteValue_OpRsh16Ux32(v)
   483  	case ssaop.OpRsh16Ux64:
   484  		return rewriteValue_OpRsh16Ux64(v)
   485  	case ssaop.OpRsh16Ux8:
   486  		return rewriteValue_OpRsh16Ux8(v)
   487  	case ssaop.OpRsh16x16:
   488  		return rewriteValue_OpRsh16x16(v)
   489  	case ssaop.OpRsh16x32:
   490  		return rewriteValue_OpRsh16x32(v)
   491  	case ssaop.OpRsh16x64:
   492  		return rewriteValue_OpRsh16x64(v)
   493  	case ssaop.OpRsh16x8:
   494  		return rewriteValue_OpRsh16x8(v)
   495  	case ssaop.OpRsh32Ux16:
   496  		return rewriteValue_OpRsh32Ux16(v)
   497  	case ssaop.OpRsh32Ux32:
   498  		return rewriteValue_OpRsh32Ux32(v)
   499  	case ssaop.OpRsh32Ux64:
   500  		return rewriteValue_OpRsh32Ux64(v)
   501  	case ssaop.OpRsh32Ux8:
   502  		return rewriteValue_OpRsh32Ux8(v)
   503  	case ssaop.OpRsh32x16:
   504  		return rewriteValue_OpRsh32x16(v)
   505  	case ssaop.OpRsh32x32:
   506  		return rewriteValue_OpRsh32x32(v)
   507  	case ssaop.OpRsh32x64:
   508  		return rewriteValue_OpRsh32x64(v)
   509  	case ssaop.OpRsh32x8:
   510  		return rewriteValue_OpRsh32x8(v)
   511  	case ssaop.OpRsh8Ux16:
   512  		return rewriteValue_OpRsh8Ux16(v)
   513  	case ssaop.OpRsh8Ux32:
   514  		return rewriteValue_OpRsh8Ux32(v)
   515  	case ssaop.OpRsh8Ux64:
   516  		return rewriteValue_OpRsh8Ux64(v)
   517  	case ssaop.OpRsh8Ux8:
   518  		return rewriteValue_OpRsh8Ux8(v)
   519  	case ssaop.OpRsh8x16:
   520  		return rewriteValue_OpRsh8x16(v)
   521  	case ssaop.OpRsh8x32:
   522  		return rewriteValue_OpRsh8x32(v)
   523  	case ssaop.OpRsh8x64:
   524  		return rewriteValue_OpRsh8x64(v)
   525  	case ssaop.OpRsh8x8:
   526  		return rewriteValue_OpRsh8x8(v)
   527  	case ssaop.OpSelect0:
   528  		return rewriteValue_OpSelect0(v)
   529  	case ssaop.OpSelect1:
   530  		return rewriteValue_OpSelect1(v)
   531  	case ssaop.OpSignExt16to32:
   532  		v.Op = ssaop.OpMIPSMOVHreg
   533  		return true
   534  	case ssaop.OpSignExt8to16:
   535  		v.Op = ssaop.OpMIPSMOVBreg
   536  		return true
   537  	case ssaop.OpSignExt8to32:
   538  		v.Op = ssaop.OpMIPSMOVBreg
   539  		return true
   540  	case ssaop.OpSignmask:
   541  		return rewriteValue_OpSignmask(v)
   542  	case ssaop.OpSlicemask:
   543  		return rewriteValue_OpSlicemask(v)
   544  	case ssaop.OpSqrt:
   545  		v.Op = ssaop.OpMIPSSQRTD
   546  		return true
   547  	case ssaop.OpSqrt32:
   548  		v.Op = ssaop.OpMIPSSQRTF
   549  		return true
   550  	case ssaop.OpStaticCall:
   551  		v.Op = ssaop.OpMIPSCALLstatic
   552  		return true
   553  	case ssaop.OpStore:
   554  		return rewriteValue_OpStore(v)
   555  	case ssaop.OpSub16:
   556  		v.Op = ssaop.OpMIPSSUB
   557  		return true
   558  	case ssaop.OpSub32:
   559  		v.Op = ssaop.OpMIPSSUB
   560  		return true
   561  	case ssaop.OpSub32F:
   562  		v.Op = ssaop.OpMIPSSUBF
   563  		return true
   564  	case ssaop.OpSub32withcarry:
   565  		return rewriteValue_OpSub32withcarry(v)
   566  	case ssaop.OpSub64F:
   567  		v.Op = ssaop.OpMIPSSUBD
   568  		return true
   569  	case ssaop.OpSub8:
   570  		v.Op = ssaop.OpMIPSSUB
   571  		return true
   572  	case ssaop.OpSubPtr:
   573  		v.Op = ssaop.OpMIPSSUB
   574  		return true
   575  	case ssaop.OpTailCall:
   576  		v.Op = ssaop.OpMIPSCALLtail
   577  		return true
   578  	case ssaop.OpTailCallInter:
   579  		v.Op = ssaop.OpMIPSCALLtailinter
   580  		return true
   581  	case ssaop.OpTrunc16to8:
   582  		v.Op = ssaop.OpCopy
   583  		return true
   584  	case ssaop.OpTrunc32to16:
   585  		v.Op = ssaop.OpCopy
   586  		return true
   587  	case ssaop.OpTrunc32to8:
   588  		v.Op = ssaop.OpCopy
   589  		return true
   590  	case ssaop.OpWB:
   591  		v.Op = ssaop.OpMIPSLoweredWB
   592  		return true
   593  	case ssaop.OpXor16:
   594  		v.Op = ssaop.OpMIPSXOR
   595  		return true
   596  	case ssaop.OpXor32:
   597  		v.Op = ssaop.OpMIPSXOR
   598  		return true
   599  	case ssaop.OpXor8:
   600  		v.Op = ssaop.OpMIPSXOR
   601  		return true
   602  	case ssaop.OpZero:
   603  		return rewriteValue_OpZero(v)
   604  	case ssaop.OpZeroExt16to32:
   605  		v.Op = ssaop.OpMIPSMOVHUreg
   606  		return true
   607  	case ssaop.OpZeroExt8to16:
   608  		v.Op = ssaop.OpMIPSMOVBUreg
   609  		return true
   610  	case ssaop.OpZeroExt8to32:
   611  		v.Op = ssaop.OpMIPSMOVBUreg
   612  		return true
   613  	case ssaop.OpZeromask:
   614  		return rewriteValue_OpZeromask(v)
   615  	}
   616  	return false
   617  }
   618  func rewriteValue_OpAdd32withcarry(v *ssa.Value) bool {
   619  	v_2 := v.Args[2]
   620  	v_1 := v.Args[1]
   621  	v_0 := v.Args[0]
   622  	b := v.Block
   623  	// match: (Add32withcarry <t> x y c)
   624  	// result: (ADD c (ADD <t> x y))
   625  	for {
   626  		t := v.Type
   627  		x := v_0
   628  		y := v_1
   629  		c := v_2
   630  		v.Reset(ssaop.OpMIPSADD)
   631  		v0 := b.NewValue0(v.Pos, ssaop.OpMIPSADD, t)
   632  		v0.AddArg2(x, y)
   633  		v.AddArg2(c, v0)
   634  		return true
   635  	}
   636  }
   637  func rewriteValue_OpAddr(v *ssa.Value) bool {
   638  	v_0 := v.Args[0]
   639  	// match: (Addr {sym} base)
   640  	// result: (MOVWaddr {sym} base)
   641  	for {
   642  		sym := ssa.AuxToSym(v.Aux)
   643  		base := v_0
   644  		v.Reset(ssaop.OpMIPSMOVWaddr)
   645  		v.Aux = ssa.SymToAux(sym)
   646  		v.AddArg(base)
   647  		return true
   648  	}
   649  }
   650  func rewriteValue_OpAtomicAnd8(v *ssa.Value) bool {
   651  	v_2 := v.Args[2]
   652  	v_1 := v.Args[1]
   653  	v_0 := v.Args[0]
   654  	b := v.Block
   655  	config := b.Func.Config
   656  	typ := &b.Func.Config.Types
   657  	// match: (AtomicAnd8 ptr val mem)
   658  	// cond: !config.BigEndian
   659  	// result: (LoweredAtomicAnd (AND <typ.UInt32Ptr> (MOVWconst [^3]) ptr) (OR <typ.UInt32> (SLL <typ.UInt32> (ZeroExt8to32 val) (SLLconst <typ.UInt32> [3] (ANDconst <typ.UInt32> [3] ptr))) (NOR (MOVWconst [0]) <typ.UInt32> (SLL <typ.UInt32> (MOVWconst [0xff]) (SLLconst <typ.UInt32> [3] (ANDconst <typ.UInt32> [3] ptr))))) mem)
   660  	for {
   661  		ptr := v_0
   662  		val := v_1
   663  		mem := v_2
   664  		if !(!config.BigEndian) {
   665  			break
   666  		}
   667  		v.Reset(ssaop.OpMIPSLoweredAtomicAnd)
   668  		v0 := b.NewValue0(v.Pos, ssaop.OpMIPSAND, typ.UInt32Ptr)
   669  		v1 := b.NewValue0(v.Pos, ssaop.OpMIPSMOVWconst, typ.UInt32)
   670  		v1.AuxInt = ssa.Int32ToAuxInt(^3)
   671  		v0.AddArg2(v1, ptr)
   672  		v2 := b.NewValue0(v.Pos, ssaop.OpMIPSOR, typ.UInt32)
   673  		v3 := b.NewValue0(v.Pos, ssaop.OpMIPSSLL, typ.UInt32)
   674  		v4 := b.NewValue0(v.Pos, ssaop.OpZeroExt8to32, typ.UInt32)
   675  		v4.AddArg(val)
   676  		v5 := b.NewValue0(v.Pos, ssaop.OpMIPSSLLconst, typ.UInt32)
   677  		v5.AuxInt = ssa.Int32ToAuxInt(3)
   678  		v6 := b.NewValue0(v.Pos, ssaop.OpMIPSANDconst, typ.UInt32)
   679  		v6.AuxInt = ssa.Int32ToAuxInt(3)
   680  		v6.AddArg(ptr)
   681  		v5.AddArg(v6)
   682  		v3.AddArg2(v4, v5)
   683  		v7 := b.NewValue0(v.Pos, ssaop.OpMIPSNOR, typ.UInt32)
   684  		v8 := b.NewValue0(v.Pos, ssaop.OpMIPSMOVWconst, typ.UInt32)
   685  		v8.AuxInt = ssa.Int32ToAuxInt(0)
   686  		v9 := b.NewValue0(v.Pos, ssaop.OpMIPSSLL, typ.UInt32)
   687  		v10 := b.NewValue0(v.Pos, ssaop.OpMIPSMOVWconst, typ.UInt32)
   688  		v10.AuxInt = ssa.Int32ToAuxInt(0xff)
   689  		v9.AddArg2(v10, v5)
   690  		v7.AddArg2(v8, v9)
   691  		v2.AddArg2(v3, v7)
   692  		v.AddArg3(v0, v2, mem)
   693  		return true
   694  	}
   695  	// match: (AtomicAnd8 ptr val mem)
   696  	// cond: config.BigEndian
   697  	// result: (LoweredAtomicAnd (AND <typ.UInt32Ptr> (MOVWconst [^3]) ptr) (OR <typ.UInt32> (SLL <typ.UInt32> (ZeroExt8to32 val) (SLLconst <typ.UInt32> [3] (ANDconst <typ.UInt32> [3] (XORconst <typ.UInt32> [3] ptr)))) (NOR (MOVWconst [0]) <typ.UInt32> (SLL <typ.UInt32> (MOVWconst [0xff]) (SLLconst <typ.UInt32> [3] (ANDconst <typ.UInt32> [3] (XORconst <typ.UInt32> [3] ptr)))))) mem)
   698  	for {
   699  		ptr := v_0
   700  		val := v_1
   701  		mem := v_2
   702  		if !(config.BigEndian) {
   703  			break
   704  		}
   705  		v.Reset(ssaop.OpMIPSLoweredAtomicAnd)
   706  		v0 := b.NewValue0(v.Pos, ssaop.OpMIPSAND, typ.UInt32Ptr)
   707  		v1 := b.NewValue0(v.Pos, ssaop.OpMIPSMOVWconst, typ.UInt32)
   708  		v1.AuxInt = ssa.Int32ToAuxInt(^3)
   709  		v0.AddArg2(v1, ptr)
   710  		v2 := b.NewValue0(v.Pos, ssaop.OpMIPSOR, typ.UInt32)
   711  		v3 := b.NewValue0(v.Pos, ssaop.OpMIPSSLL, typ.UInt32)
   712  		v4 := b.NewValue0(v.Pos, ssaop.OpZeroExt8to32, typ.UInt32)
   713  		v4.AddArg(val)
   714  		v5 := b.NewValue0(v.Pos, ssaop.OpMIPSSLLconst, typ.UInt32)
   715  		v5.AuxInt = ssa.Int32ToAuxInt(3)
   716  		v6 := b.NewValue0(v.Pos, ssaop.OpMIPSANDconst, typ.UInt32)
   717  		v6.AuxInt = ssa.Int32ToAuxInt(3)
   718  		v7 := b.NewValue0(v.Pos, ssaop.OpMIPSXORconst, typ.UInt32)
   719  		v7.AuxInt = ssa.Int32ToAuxInt(3)
   720  		v7.AddArg(ptr)
   721  		v6.AddArg(v7)
   722  		v5.AddArg(v6)
   723  		v3.AddArg2(v4, v5)
   724  		v8 := b.NewValue0(v.Pos, ssaop.OpMIPSNOR, typ.UInt32)
   725  		v9 := b.NewValue0(v.Pos, ssaop.OpMIPSMOVWconst, typ.UInt32)
   726  		v9.AuxInt = ssa.Int32ToAuxInt(0)
   727  		v10 := b.NewValue0(v.Pos, ssaop.OpMIPSSLL, typ.UInt32)
   728  		v11 := b.NewValue0(v.Pos, ssaop.OpMIPSMOVWconst, typ.UInt32)
   729  		v11.AuxInt = ssa.Int32ToAuxInt(0xff)
   730  		v10.AddArg2(v11, v5)
   731  		v8.AddArg2(v9, v10)
   732  		v2.AddArg2(v3, v8)
   733  		v.AddArg3(v0, v2, mem)
   734  		return true
   735  	}
   736  	return false
   737  }
   738  func rewriteValue_OpAtomicOr8(v *ssa.Value) bool {
   739  	v_2 := v.Args[2]
   740  	v_1 := v.Args[1]
   741  	v_0 := v.Args[0]
   742  	b := v.Block
   743  	config := b.Func.Config
   744  	typ := &b.Func.Config.Types
   745  	// match: (AtomicOr8 ptr val mem)
   746  	// cond: !config.BigEndian
   747  	// result: (LoweredAtomicOr (AND <typ.UInt32Ptr> (MOVWconst [^3]) ptr) (SLL <typ.UInt32> (ZeroExt8to32 val) (SLLconst <typ.UInt32> [3] (ANDconst <typ.UInt32> [3] ptr))) mem)
   748  	for {
   749  		ptr := v_0
   750  		val := v_1
   751  		mem := v_2
   752  		if !(!config.BigEndian) {
   753  			break
   754  		}
   755  		v.Reset(ssaop.OpMIPSLoweredAtomicOr)
   756  		v0 := b.NewValue0(v.Pos, ssaop.OpMIPSAND, typ.UInt32Ptr)
   757  		v1 := b.NewValue0(v.Pos, ssaop.OpMIPSMOVWconst, typ.UInt32)
   758  		v1.AuxInt = ssa.Int32ToAuxInt(^3)
   759  		v0.AddArg2(v1, ptr)
   760  		v2 := b.NewValue0(v.Pos, ssaop.OpMIPSSLL, typ.UInt32)
   761  		v3 := b.NewValue0(v.Pos, ssaop.OpZeroExt8to32, typ.UInt32)
   762  		v3.AddArg(val)
   763  		v4 := b.NewValue0(v.Pos, ssaop.OpMIPSSLLconst, typ.UInt32)
   764  		v4.AuxInt = ssa.Int32ToAuxInt(3)
   765  		v5 := b.NewValue0(v.Pos, ssaop.OpMIPSANDconst, typ.UInt32)
   766  		v5.AuxInt = ssa.Int32ToAuxInt(3)
   767  		v5.AddArg(ptr)
   768  		v4.AddArg(v5)
   769  		v2.AddArg2(v3, v4)
   770  		v.AddArg3(v0, v2, mem)
   771  		return true
   772  	}
   773  	// match: (AtomicOr8 ptr val mem)
   774  	// cond: config.BigEndian
   775  	// result: (LoweredAtomicOr (AND <typ.UInt32Ptr> (MOVWconst [^3]) ptr) (SLL <typ.UInt32> (ZeroExt8to32 val) (SLLconst <typ.UInt32> [3] (ANDconst <typ.UInt32> [3] (XORconst <typ.UInt32> [3] ptr)))) mem)
   776  	for {
   777  		ptr := v_0
   778  		val := v_1
   779  		mem := v_2
   780  		if !(config.BigEndian) {
   781  			break
   782  		}
   783  		v.Reset(ssaop.OpMIPSLoweredAtomicOr)
   784  		v0 := b.NewValue0(v.Pos, ssaop.OpMIPSAND, typ.UInt32Ptr)
   785  		v1 := b.NewValue0(v.Pos, ssaop.OpMIPSMOVWconst, typ.UInt32)
   786  		v1.AuxInt = ssa.Int32ToAuxInt(^3)
   787  		v0.AddArg2(v1, ptr)
   788  		v2 := b.NewValue0(v.Pos, ssaop.OpMIPSSLL, typ.UInt32)
   789  		v3 := b.NewValue0(v.Pos, ssaop.OpZeroExt8to32, typ.UInt32)
   790  		v3.AddArg(val)
   791  		v4 := b.NewValue0(v.Pos, ssaop.OpMIPSSLLconst, typ.UInt32)
   792  		v4.AuxInt = ssa.Int32ToAuxInt(3)
   793  		v5 := b.NewValue0(v.Pos, ssaop.OpMIPSANDconst, typ.UInt32)
   794  		v5.AuxInt = ssa.Int32ToAuxInt(3)
   795  		v6 := b.NewValue0(v.Pos, ssaop.OpMIPSXORconst, typ.UInt32)
   796  		v6.AuxInt = ssa.Int32ToAuxInt(3)
   797  		v6.AddArg(ptr)
   798  		v5.AddArg(v6)
   799  		v4.AddArg(v5)
   800  		v2.AddArg2(v3, v4)
   801  		v.AddArg3(v0, v2, mem)
   802  		return true
   803  	}
   804  	return false
   805  }
   806  func rewriteValue_OpAvg32u(v *ssa.Value) bool {
   807  	v_1 := v.Args[1]
   808  	v_0 := v.Args[0]
   809  	b := v.Block
   810  	// match: (Avg32u <t> x y)
   811  	// result: (ADD (SRLconst <t> (SUB <t> x y) [1]) y)
   812  	for {
   813  		t := v.Type
   814  		x := v_0
   815  		y := v_1
   816  		v.Reset(ssaop.OpMIPSADD)
   817  		v0 := b.NewValue0(v.Pos, ssaop.OpMIPSSRLconst, t)
   818  		v0.AuxInt = ssa.Int32ToAuxInt(1)
   819  		v1 := b.NewValue0(v.Pos, ssaop.OpMIPSSUB, t)
   820  		v1.AddArg2(x, y)
   821  		v0.AddArg(v1)
   822  		v.AddArg2(v0, y)
   823  		return true
   824  	}
   825  }
   826  func rewriteValue_OpBitLen16(v *ssa.Value) bool {
   827  	v_0 := v.Args[0]
   828  	b := v.Block
   829  	typ := &b.Func.Config.Types
   830  	// match: (BitLen16 x)
   831  	// result: (BitLen32 (ZeroExt16to32 x))
   832  	for {
   833  		x := v_0
   834  		v.Reset(ssaop.OpBitLen32)
   835  		v0 := b.NewValue0(v.Pos, ssaop.OpZeroExt16to32, typ.UInt32)
   836  		v0.AddArg(x)
   837  		v.AddArg(v0)
   838  		return true
   839  	}
   840  }
   841  func rewriteValue_OpBitLen32(v *ssa.Value) bool {
   842  	v_0 := v.Args[0]
   843  	b := v.Block
   844  	typ := &b.Func.Config.Types
   845  	// match: (BitLen32 <t> x)
   846  	// result: (SUB (MOVWconst [32]) (CLZ <t> x))
   847  	for {
   848  		t := v.Type
   849  		x := v_0
   850  		v.Reset(ssaop.OpMIPSSUB)
   851  		v0 := b.NewValue0(v.Pos, ssaop.OpMIPSMOVWconst, typ.UInt32)
   852  		v0.AuxInt = ssa.Int32ToAuxInt(32)
   853  		v1 := b.NewValue0(v.Pos, ssaop.OpMIPSCLZ, t)
   854  		v1.AddArg(x)
   855  		v.AddArg2(v0, v1)
   856  		return true
   857  	}
   858  }
   859  func rewriteValue_OpBitLen8(v *ssa.Value) bool {
   860  	v_0 := v.Args[0]
   861  	b := v.Block
   862  	typ := &b.Func.Config.Types
   863  	// match: (BitLen8 x)
   864  	// result: (BitLen32 (ZeroExt8to32 x))
   865  	for {
   866  		x := v_0
   867  		v.Reset(ssaop.OpBitLen32)
   868  		v0 := b.NewValue0(v.Pos, ssaop.OpZeroExt8to32, typ.UInt32)
   869  		v0.AddArg(x)
   870  		v.AddArg(v0)
   871  		return true
   872  	}
   873  }
   874  func rewriteValue_OpCom16(v *ssa.Value) bool {
   875  	v_0 := v.Args[0]
   876  	b := v.Block
   877  	typ := &b.Func.Config.Types
   878  	// match: (Com16 x)
   879  	// result: (NOR (MOVWconst [0]) x)
   880  	for {
   881  		x := v_0
   882  		v.Reset(ssaop.OpMIPSNOR)
   883  		v0 := b.NewValue0(v.Pos, ssaop.OpMIPSMOVWconst, typ.UInt32)
   884  		v0.AuxInt = ssa.Int32ToAuxInt(0)
   885  		v.AddArg2(v0, x)
   886  		return true
   887  	}
   888  }
   889  func rewriteValue_OpCom32(v *ssa.Value) bool {
   890  	v_0 := v.Args[0]
   891  	b := v.Block
   892  	typ := &b.Func.Config.Types
   893  	// match: (Com32 x)
   894  	// result: (NOR (MOVWconst [0]) x)
   895  	for {
   896  		x := v_0
   897  		v.Reset(ssaop.OpMIPSNOR)
   898  		v0 := b.NewValue0(v.Pos, ssaop.OpMIPSMOVWconst, typ.UInt32)
   899  		v0.AuxInt = ssa.Int32ToAuxInt(0)
   900  		v.AddArg2(v0, x)
   901  		return true
   902  	}
   903  }
   904  func rewriteValue_OpCom8(v *ssa.Value) bool {
   905  	v_0 := v.Args[0]
   906  	b := v.Block
   907  	typ := &b.Func.Config.Types
   908  	// match: (Com8 x)
   909  	// result: (NOR (MOVWconst [0]) x)
   910  	for {
   911  		x := v_0
   912  		v.Reset(ssaop.OpMIPSNOR)
   913  		v0 := b.NewValue0(v.Pos, ssaop.OpMIPSMOVWconst, typ.UInt32)
   914  		v0.AuxInt = ssa.Int32ToAuxInt(0)
   915  		v.AddArg2(v0, x)
   916  		return true
   917  	}
   918  }
   919  func rewriteValue_OpConst16(v *ssa.Value) bool {
   920  	// match: (Const16 [val])
   921  	// result: (MOVWconst [int32(val)])
   922  	for {
   923  		val := ssa.AuxIntToInt16(v.AuxInt)
   924  		v.Reset(ssaop.OpMIPSMOVWconst)
   925  		v.AuxInt = ssa.Int32ToAuxInt(int32(val))
   926  		return true
   927  	}
   928  }
   929  func rewriteValue_OpConst32(v *ssa.Value) bool {
   930  	// match: (Const32 [val])
   931  	// result: (MOVWconst [int32(val)])
   932  	for {
   933  		val := ssa.AuxIntToInt32(v.AuxInt)
   934  		v.Reset(ssaop.OpMIPSMOVWconst)
   935  		v.AuxInt = ssa.Int32ToAuxInt(int32(val))
   936  		return true
   937  	}
   938  }
   939  func rewriteValue_OpConst8(v *ssa.Value) bool {
   940  	// match: (Const8 [val])
   941  	// result: (MOVWconst [int32(val)])
   942  	for {
   943  		val := ssa.AuxIntToInt8(v.AuxInt)
   944  		v.Reset(ssaop.OpMIPSMOVWconst)
   945  		v.AuxInt = ssa.Int32ToAuxInt(int32(val))
   946  		return true
   947  	}
   948  }
   949  func rewriteValue_OpConstBool(v *ssa.Value) bool {
   950  	// match: (ConstBool [t])
   951  	// result: (MOVWconst [ssa.B2i32(t)])
   952  	for {
   953  		t := ssa.AuxIntToBool(v.AuxInt)
   954  		v.Reset(ssaop.OpMIPSMOVWconst)
   955  		v.AuxInt = ssa.Int32ToAuxInt(ssa.B2i32(t))
   956  		return true
   957  	}
   958  }
   959  func rewriteValue_OpConstNil(v *ssa.Value) bool {
   960  	// match: (ConstNil)
   961  	// result: (MOVWconst [0])
   962  	for {
   963  		v.Reset(ssaop.OpMIPSMOVWconst)
   964  		v.AuxInt = ssa.Int32ToAuxInt(0)
   965  		return true
   966  	}
   967  }
   968  func rewriteValue_OpCtz16(v *ssa.Value) bool {
   969  	v_0 := v.Args[0]
   970  	b := v.Block
   971  	typ := &b.Func.Config.Types
   972  	// match: (Ctz16 x)
   973  	// result: (Ctz32 (Or32 <typ.UInt32> x (MOVWconst [1<<16])))
   974  	for {
   975  		x := v_0
   976  		v.Reset(ssaop.OpCtz32)
   977  		v0 := b.NewValue0(v.Pos, ssaop.OpOr32, typ.UInt32)
   978  		v1 := b.NewValue0(v.Pos, ssaop.OpMIPSMOVWconst, typ.UInt32)
   979  		v1.AuxInt = ssa.Int32ToAuxInt(1 << 16)
   980  		v0.AddArg2(x, v1)
   981  		v.AddArg(v0)
   982  		return true
   983  	}
   984  }
   985  func rewriteValue_OpCtz32(v *ssa.Value) bool {
   986  	v_0 := v.Args[0]
   987  	b := v.Block
   988  	typ := &b.Func.Config.Types
   989  	// match: (Ctz32 <t> x)
   990  	// result: (SUB (MOVWconst [32]) (CLZ <t> (SUBconst <t> [1] (AND <t> x (NEG <t> x)))))
   991  	for {
   992  		t := v.Type
   993  		x := v_0
   994  		v.Reset(ssaop.OpMIPSSUB)
   995  		v0 := b.NewValue0(v.Pos, ssaop.OpMIPSMOVWconst, typ.UInt32)
   996  		v0.AuxInt = ssa.Int32ToAuxInt(32)
   997  		v1 := b.NewValue0(v.Pos, ssaop.OpMIPSCLZ, t)
   998  		v2 := b.NewValue0(v.Pos, ssaop.OpMIPSSUBconst, t)
   999  		v2.AuxInt = ssa.Int32ToAuxInt(1)
  1000  		v3 := b.NewValue0(v.Pos, ssaop.OpMIPSAND, t)
  1001  		v4 := b.NewValue0(v.Pos, ssaop.OpMIPSNEG, t)
  1002  		v4.AddArg(x)
  1003  		v3.AddArg2(x, v4)
  1004  		v2.AddArg(v3)
  1005  		v1.AddArg(v2)
  1006  		v.AddArg2(v0, v1)
  1007  		return true
  1008  	}
  1009  }
  1010  func rewriteValue_OpCtz8(v *ssa.Value) bool {
  1011  	v_0 := v.Args[0]
  1012  	b := v.Block
  1013  	typ := &b.Func.Config.Types
  1014  	// match: (Ctz8 x)
  1015  	// result: (Ctz32 (Or32 <typ.UInt32> x (MOVWconst [1<<8])))
  1016  	for {
  1017  		x := v_0
  1018  		v.Reset(ssaop.OpCtz32)
  1019  		v0 := b.NewValue0(v.Pos, ssaop.OpOr32, typ.UInt32)
  1020  		v1 := b.NewValue0(v.Pos, ssaop.OpMIPSMOVWconst, typ.UInt32)
  1021  		v1.AuxInt = ssa.Int32ToAuxInt(1 << 8)
  1022  		v0.AddArg2(x, v1)
  1023  		v.AddArg(v0)
  1024  		return true
  1025  	}
  1026  }
  1027  func rewriteValue_OpDiv16(v *ssa.Value) bool {
  1028  	v_1 := v.Args[1]
  1029  	v_0 := v.Args[0]
  1030  	b := v.Block
  1031  	typ := &b.Func.Config.Types
  1032  	// match: (Div16 x y)
  1033  	// result: (Select1 (DIV (SignExt16to32 x) (SignExt16to32 y)))
  1034  	for {
  1035  		x := v_0
  1036  		y := v_1
  1037  		v.Reset(ssaop.OpSelect1)
  1038  		v0 := b.NewValue0(v.Pos, ssaop.OpMIPSDIV, types.NewTuple(typ.Int32, typ.Int32))
  1039  		v1 := b.NewValue0(v.Pos, ssaop.OpSignExt16to32, typ.Int32)
  1040  		v1.AddArg(x)
  1041  		v2 := b.NewValue0(v.Pos, ssaop.OpSignExt16to32, typ.Int32)
  1042  		v2.AddArg(y)
  1043  		v0.AddArg2(v1, v2)
  1044  		v.AddArg(v0)
  1045  		return true
  1046  	}
  1047  }
  1048  func rewriteValue_OpDiv16u(v *ssa.Value) bool {
  1049  	v_1 := v.Args[1]
  1050  	v_0 := v.Args[0]
  1051  	b := v.Block
  1052  	typ := &b.Func.Config.Types
  1053  	// match: (Div16u x y)
  1054  	// result: (Select1 (DIVU (ZeroExt16to32 x) (ZeroExt16to32 y)))
  1055  	for {
  1056  		x := v_0
  1057  		y := v_1
  1058  		v.Reset(ssaop.OpSelect1)
  1059  		v0 := b.NewValue0(v.Pos, ssaop.OpMIPSDIVU, types.NewTuple(typ.UInt32, typ.UInt32))
  1060  		v1 := b.NewValue0(v.Pos, ssaop.OpZeroExt16to32, typ.UInt32)
  1061  		v1.AddArg(x)
  1062  		v2 := b.NewValue0(v.Pos, ssaop.OpZeroExt16to32, typ.UInt32)
  1063  		v2.AddArg(y)
  1064  		v0.AddArg2(v1, v2)
  1065  		v.AddArg(v0)
  1066  		return true
  1067  	}
  1068  }
  1069  func rewriteValue_OpDiv32(v *ssa.Value) bool {
  1070  	v_1 := v.Args[1]
  1071  	v_0 := v.Args[0]
  1072  	b := v.Block
  1073  	typ := &b.Func.Config.Types
  1074  	// match: (Div32 x y)
  1075  	// result: (Select1 (DIV x y))
  1076  	for {
  1077  		x := v_0
  1078  		y := v_1
  1079  		v.Reset(ssaop.OpSelect1)
  1080  		v0 := b.NewValue0(v.Pos, ssaop.OpMIPSDIV, types.NewTuple(typ.Int32, typ.Int32))
  1081  		v0.AddArg2(x, y)
  1082  		v.AddArg(v0)
  1083  		return true
  1084  	}
  1085  }
  1086  func rewriteValue_OpDiv32u(v *ssa.Value) bool {
  1087  	v_1 := v.Args[1]
  1088  	v_0 := v.Args[0]
  1089  	b := v.Block
  1090  	typ := &b.Func.Config.Types
  1091  	// match: (Div32u x y)
  1092  	// result: (Select1 (DIVU x y))
  1093  	for {
  1094  		x := v_0
  1095  		y := v_1
  1096  		v.Reset(ssaop.OpSelect1)
  1097  		v0 := b.NewValue0(v.Pos, ssaop.OpMIPSDIVU, types.NewTuple(typ.UInt32, typ.UInt32))
  1098  		v0.AddArg2(x, y)
  1099  		v.AddArg(v0)
  1100  		return true
  1101  	}
  1102  }
  1103  func rewriteValue_OpDiv8(v *ssa.Value) bool {
  1104  	v_1 := v.Args[1]
  1105  	v_0 := v.Args[0]
  1106  	b := v.Block
  1107  	typ := &b.Func.Config.Types
  1108  	// match: (Div8 x y)
  1109  	// result: (Select1 (DIV (SignExt8to32 x) (SignExt8to32 y)))
  1110  	for {
  1111  		x := v_0
  1112  		y := v_1
  1113  		v.Reset(ssaop.OpSelect1)
  1114  		v0 := b.NewValue0(v.Pos, ssaop.OpMIPSDIV, types.NewTuple(typ.Int32, typ.Int32))
  1115  		v1 := b.NewValue0(v.Pos, ssaop.OpSignExt8to32, typ.Int32)
  1116  		v1.AddArg(x)
  1117  		v2 := b.NewValue0(v.Pos, ssaop.OpSignExt8to32, typ.Int32)
  1118  		v2.AddArg(y)
  1119  		v0.AddArg2(v1, v2)
  1120  		v.AddArg(v0)
  1121  		return true
  1122  	}
  1123  }
  1124  func rewriteValue_OpDiv8u(v *ssa.Value) bool {
  1125  	v_1 := v.Args[1]
  1126  	v_0 := v.Args[0]
  1127  	b := v.Block
  1128  	typ := &b.Func.Config.Types
  1129  	// match: (Div8u x y)
  1130  	// result: (Select1 (DIVU (ZeroExt8to32 x) (ZeroExt8to32 y)))
  1131  	for {
  1132  		x := v_0
  1133  		y := v_1
  1134  		v.Reset(ssaop.OpSelect1)
  1135  		v0 := b.NewValue0(v.Pos, ssaop.OpMIPSDIVU, types.NewTuple(typ.UInt32, typ.UInt32))
  1136  		v1 := b.NewValue0(v.Pos, ssaop.OpZeroExt8to32, typ.UInt32)
  1137  		v1.AddArg(x)
  1138  		v2 := b.NewValue0(v.Pos, ssaop.OpZeroExt8to32, typ.UInt32)
  1139  		v2.AddArg(y)
  1140  		v0.AddArg2(v1, v2)
  1141  		v.AddArg(v0)
  1142  		return true
  1143  	}
  1144  }
  1145  func rewriteValue_OpEq16(v *ssa.Value) bool {
  1146  	v_1 := v.Args[1]
  1147  	v_0 := v.Args[0]
  1148  	b := v.Block
  1149  	typ := &b.Func.Config.Types
  1150  	// match: (Eq16 x y)
  1151  	// result: (SGTUconst [1] (XOR (ZeroExt16to32 x) (ZeroExt16to32 y)))
  1152  	for {
  1153  		x := v_0
  1154  		y := v_1
  1155  		v.Reset(ssaop.OpMIPSSGTUconst)
  1156  		v.AuxInt = ssa.Int32ToAuxInt(1)
  1157  		v0 := b.NewValue0(v.Pos, ssaop.OpMIPSXOR, typ.UInt32)
  1158  		v1 := b.NewValue0(v.Pos, ssaop.OpZeroExt16to32, typ.UInt32)
  1159  		v1.AddArg(x)
  1160  		v2 := b.NewValue0(v.Pos, ssaop.OpZeroExt16to32, typ.UInt32)
  1161  		v2.AddArg(y)
  1162  		v0.AddArg2(v1, v2)
  1163  		v.AddArg(v0)
  1164  		return true
  1165  	}
  1166  }
  1167  func rewriteValue_OpEq32(v *ssa.Value) bool {
  1168  	v_1 := v.Args[1]
  1169  	v_0 := v.Args[0]
  1170  	b := v.Block
  1171  	typ := &b.Func.Config.Types
  1172  	// match: (Eq32 x y)
  1173  	// result: (SGTUconst [1] (XOR x y))
  1174  	for {
  1175  		x := v_0
  1176  		y := v_1
  1177  		v.Reset(ssaop.OpMIPSSGTUconst)
  1178  		v.AuxInt = ssa.Int32ToAuxInt(1)
  1179  		v0 := b.NewValue0(v.Pos, ssaop.OpMIPSXOR, typ.UInt32)
  1180  		v0.AddArg2(x, y)
  1181  		v.AddArg(v0)
  1182  		return true
  1183  	}
  1184  }
  1185  func rewriteValue_OpEq32F(v *ssa.Value) bool {
  1186  	v_1 := v.Args[1]
  1187  	v_0 := v.Args[0]
  1188  	b := v.Block
  1189  	// match: (Eq32F x y)
  1190  	// result: (FPFlagTrue (CMPEQF x y))
  1191  	for {
  1192  		x := v_0
  1193  		y := v_1
  1194  		v.Reset(ssaop.OpMIPSFPFlagTrue)
  1195  		v0 := b.NewValue0(v.Pos, ssaop.OpMIPSCMPEQF, types.TypeFlags)
  1196  		v0.AddArg2(x, y)
  1197  		v.AddArg(v0)
  1198  		return true
  1199  	}
  1200  }
  1201  func rewriteValue_OpEq64F(v *ssa.Value) bool {
  1202  	v_1 := v.Args[1]
  1203  	v_0 := v.Args[0]
  1204  	b := v.Block
  1205  	// match: (Eq64F x y)
  1206  	// result: (FPFlagTrue (CMPEQD x y))
  1207  	for {
  1208  		x := v_0
  1209  		y := v_1
  1210  		v.Reset(ssaop.OpMIPSFPFlagTrue)
  1211  		v0 := b.NewValue0(v.Pos, ssaop.OpMIPSCMPEQD, types.TypeFlags)
  1212  		v0.AddArg2(x, y)
  1213  		v.AddArg(v0)
  1214  		return true
  1215  	}
  1216  }
  1217  func rewriteValue_OpEq8(v *ssa.Value) bool {
  1218  	v_1 := v.Args[1]
  1219  	v_0 := v.Args[0]
  1220  	b := v.Block
  1221  	typ := &b.Func.Config.Types
  1222  	// match: (Eq8 x y)
  1223  	// result: (SGTUconst [1] (XOR (ZeroExt8to32 x) (ZeroExt8to32 y)))
  1224  	for {
  1225  		x := v_0
  1226  		y := v_1
  1227  		v.Reset(ssaop.OpMIPSSGTUconst)
  1228  		v.AuxInt = ssa.Int32ToAuxInt(1)
  1229  		v0 := b.NewValue0(v.Pos, ssaop.OpMIPSXOR, typ.UInt32)
  1230  		v1 := b.NewValue0(v.Pos, ssaop.OpZeroExt8to32, typ.UInt32)
  1231  		v1.AddArg(x)
  1232  		v2 := b.NewValue0(v.Pos, ssaop.OpZeroExt8to32, typ.UInt32)
  1233  		v2.AddArg(y)
  1234  		v0.AddArg2(v1, v2)
  1235  		v.AddArg(v0)
  1236  		return true
  1237  	}
  1238  }
  1239  func rewriteValue_OpEqB(v *ssa.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: (EqB x y)
  1245  	// result: (XORconst [1] (XOR <typ.Bool> x y))
  1246  	for {
  1247  		x := v_0
  1248  		y := v_1
  1249  		v.Reset(ssaop.OpMIPSXORconst)
  1250  		v.AuxInt = ssa.Int32ToAuxInt(1)
  1251  		v0 := b.NewValue0(v.Pos, ssaop.OpMIPSXOR, typ.Bool)
  1252  		v0.AddArg2(x, y)
  1253  		v.AddArg(v0)
  1254  		return true
  1255  	}
  1256  }
  1257  func rewriteValue_OpEqPtr(v *ssa.Value) bool {
  1258  	v_1 := v.Args[1]
  1259  	v_0 := v.Args[0]
  1260  	b := v.Block
  1261  	typ := &b.Func.Config.Types
  1262  	// match: (EqPtr x y)
  1263  	// result: (SGTUconst [1] (XOR x y))
  1264  	for {
  1265  		x := v_0
  1266  		y := v_1
  1267  		v.Reset(ssaop.OpMIPSSGTUconst)
  1268  		v.AuxInt = ssa.Int32ToAuxInt(1)
  1269  		v0 := b.NewValue0(v.Pos, ssaop.OpMIPSXOR, typ.UInt32)
  1270  		v0.AddArg2(x, y)
  1271  		v.AddArg(v0)
  1272  		return true
  1273  	}
  1274  }
  1275  func rewriteValue_OpHmul32(v *ssa.Value) bool {
  1276  	v_1 := v.Args[1]
  1277  	v_0 := v.Args[0]
  1278  	b := v.Block
  1279  	typ := &b.Func.Config.Types
  1280  	// match: (Hmul32 x y)
  1281  	// result: (Select0 (MULT x y))
  1282  	for {
  1283  		x := v_0
  1284  		y := v_1
  1285  		v.Reset(ssaop.OpSelect0)
  1286  		v0 := b.NewValue0(v.Pos, ssaop.OpMIPSMULT, types.NewTuple(typ.Int32, typ.Int32))
  1287  		v0.AddArg2(x, y)
  1288  		v.AddArg(v0)
  1289  		return true
  1290  	}
  1291  }
  1292  func rewriteValue_OpHmul32u(v *ssa.Value) bool {
  1293  	v_1 := v.Args[1]
  1294  	v_0 := v.Args[0]
  1295  	b := v.Block
  1296  	typ := &b.Func.Config.Types
  1297  	// match: (Hmul32u x y)
  1298  	// result: (Select0 (MULTU x y))
  1299  	for {
  1300  		x := v_0
  1301  		y := v_1
  1302  		v.Reset(ssaop.OpSelect0)
  1303  		v0 := b.NewValue0(v.Pos, ssaop.OpMIPSMULTU, types.NewTuple(typ.UInt32, typ.UInt32))
  1304  		v0.AddArg2(x, y)
  1305  		v.AddArg(v0)
  1306  		return true
  1307  	}
  1308  }
  1309  func rewriteValue_OpIsInBounds(v *ssa.Value) bool {
  1310  	v_1 := v.Args[1]
  1311  	v_0 := v.Args[0]
  1312  	// match: (IsInBounds idx len)
  1313  	// result: (SGTU len idx)
  1314  	for {
  1315  		idx := v_0
  1316  		len := v_1
  1317  		v.Reset(ssaop.OpMIPSSGTU)
  1318  		v.AddArg2(len, idx)
  1319  		return true
  1320  	}
  1321  }
  1322  func rewriteValue_OpIsNonNil(v *ssa.Value) bool {
  1323  	v_0 := v.Args[0]
  1324  	b := v.Block
  1325  	typ := &b.Func.Config.Types
  1326  	// match: (IsNonNil ptr)
  1327  	// result: (SGTU ptr (MOVWconst [0]))
  1328  	for {
  1329  		ptr := v_0
  1330  		v.Reset(ssaop.OpMIPSSGTU)
  1331  		v0 := b.NewValue0(v.Pos, ssaop.OpMIPSMOVWconst, typ.UInt32)
  1332  		v0.AuxInt = ssa.Int32ToAuxInt(0)
  1333  		v.AddArg2(ptr, v0)
  1334  		return true
  1335  	}
  1336  }
  1337  func rewriteValue_OpIsSliceInBounds(v *ssa.Value) bool {
  1338  	v_1 := v.Args[1]
  1339  	v_0 := v.Args[0]
  1340  	b := v.Block
  1341  	typ := &b.Func.Config.Types
  1342  	// match: (IsSliceInBounds idx len)
  1343  	// result: (XORconst [1] (SGTU idx len))
  1344  	for {
  1345  		idx := v_0
  1346  		len := v_1
  1347  		v.Reset(ssaop.OpMIPSXORconst)
  1348  		v.AuxInt = ssa.Int32ToAuxInt(1)
  1349  		v0 := b.NewValue0(v.Pos, ssaop.OpMIPSSGTU, typ.Bool)
  1350  		v0.AddArg2(idx, len)
  1351  		v.AddArg(v0)
  1352  		return true
  1353  	}
  1354  }
  1355  func rewriteValue_OpLeq16(v *ssa.Value) bool {
  1356  	v_1 := v.Args[1]
  1357  	v_0 := v.Args[0]
  1358  	b := v.Block
  1359  	typ := &b.Func.Config.Types
  1360  	// match: (Leq16 x y)
  1361  	// result: (XORconst [1] (SGT (SignExt16to32 x) (SignExt16to32 y)))
  1362  	for {
  1363  		x := v_0
  1364  		y := v_1
  1365  		v.Reset(ssaop.OpMIPSXORconst)
  1366  		v.AuxInt = ssa.Int32ToAuxInt(1)
  1367  		v0 := b.NewValue0(v.Pos, ssaop.OpMIPSSGT, typ.Bool)
  1368  		v1 := b.NewValue0(v.Pos, ssaop.OpSignExt16to32, typ.Int32)
  1369  		v1.AddArg(x)
  1370  		v2 := b.NewValue0(v.Pos, ssaop.OpSignExt16to32, typ.Int32)
  1371  		v2.AddArg(y)
  1372  		v0.AddArg2(v1, v2)
  1373  		v.AddArg(v0)
  1374  		return true
  1375  	}
  1376  }
  1377  func rewriteValue_OpLeq16U(v *ssa.Value) bool {
  1378  	v_1 := v.Args[1]
  1379  	v_0 := v.Args[0]
  1380  	b := v.Block
  1381  	typ := &b.Func.Config.Types
  1382  	// match: (Leq16U x y)
  1383  	// result: (XORconst [1] (SGTU (ZeroExt16to32 x) (ZeroExt16to32 y)))
  1384  	for {
  1385  		x := v_0
  1386  		y := v_1
  1387  		v.Reset(ssaop.OpMIPSXORconst)
  1388  		v.AuxInt = ssa.Int32ToAuxInt(1)
  1389  		v0 := b.NewValue0(v.Pos, ssaop.OpMIPSSGTU, typ.Bool)
  1390  		v1 := b.NewValue0(v.Pos, ssaop.OpZeroExt16to32, typ.UInt32)
  1391  		v1.AddArg(x)
  1392  		v2 := b.NewValue0(v.Pos, ssaop.OpZeroExt16to32, typ.UInt32)
  1393  		v2.AddArg(y)
  1394  		v0.AddArg2(v1, v2)
  1395  		v.AddArg(v0)
  1396  		return true
  1397  	}
  1398  }
  1399  func rewriteValue_OpLeq32(v *ssa.Value) bool {
  1400  	v_1 := v.Args[1]
  1401  	v_0 := v.Args[0]
  1402  	b := v.Block
  1403  	typ := &b.Func.Config.Types
  1404  	// match: (Leq32 x y)
  1405  	// result: (XORconst [1] (SGT x y))
  1406  	for {
  1407  		x := v_0
  1408  		y := v_1
  1409  		v.Reset(ssaop.OpMIPSXORconst)
  1410  		v.AuxInt = ssa.Int32ToAuxInt(1)
  1411  		v0 := b.NewValue0(v.Pos, ssaop.OpMIPSSGT, typ.Bool)
  1412  		v0.AddArg2(x, y)
  1413  		v.AddArg(v0)
  1414  		return true
  1415  	}
  1416  }
  1417  func rewriteValue_OpLeq32F(v *ssa.Value) bool {
  1418  	v_1 := v.Args[1]
  1419  	v_0 := v.Args[0]
  1420  	b := v.Block
  1421  	// match: (Leq32F x y)
  1422  	// result: (FPFlagTrue (CMPGEF y x))
  1423  	for {
  1424  		x := v_0
  1425  		y := v_1
  1426  		v.Reset(ssaop.OpMIPSFPFlagTrue)
  1427  		v0 := b.NewValue0(v.Pos, ssaop.OpMIPSCMPGEF, types.TypeFlags)
  1428  		v0.AddArg2(y, x)
  1429  		v.AddArg(v0)
  1430  		return true
  1431  	}
  1432  }
  1433  func rewriteValue_OpLeq32U(v *ssa.Value) bool {
  1434  	v_1 := v.Args[1]
  1435  	v_0 := v.Args[0]
  1436  	b := v.Block
  1437  	typ := &b.Func.Config.Types
  1438  	// match: (Leq32U x y)
  1439  	// result: (XORconst [1] (SGTU x y))
  1440  	for {
  1441  		x := v_0
  1442  		y := v_1
  1443  		v.Reset(ssaop.OpMIPSXORconst)
  1444  		v.AuxInt = ssa.Int32ToAuxInt(1)
  1445  		v0 := b.NewValue0(v.Pos, ssaop.OpMIPSSGTU, typ.Bool)
  1446  		v0.AddArg2(x, y)
  1447  		v.AddArg(v0)
  1448  		return true
  1449  	}
  1450  }
  1451  func rewriteValue_OpLeq64F(v *ssa.Value) bool {
  1452  	v_1 := v.Args[1]
  1453  	v_0 := v.Args[0]
  1454  	b := v.Block
  1455  	// match: (Leq64F x y)
  1456  	// result: (FPFlagTrue (CMPGED y x))
  1457  	for {
  1458  		x := v_0
  1459  		y := v_1
  1460  		v.Reset(ssaop.OpMIPSFPFlagTrue)
  1461  		v0 := b.NewValue0(v.Pos, ssaop.OpMIPSCMPGED, types.TypeFlags)
  1462  		v0.AddArg2(y, x)
  1463  		v.AddArg(v0)
  1464  		return true
  1465  	}
  1466  }
  1467  func rewriteValue_OpLeq8(v *ssa.Value) bool {
  1468  	v_1 := v.Args[1]
  1469  	v_0 := v.Args[0]
  1470  	b := v.Block
  1471  	typ := &b.Func.Config.Types
  1472  	// match: (Leq8 x y)
  1473  	// result: (XORconst [1] (SGT (SignExt8to32 x) (SignExt8to32 y)))
  1474  	for {
  1475  		x := v_0
  1476  		y := v_1
  1477  		v.Reset(ssaop.OpMIPSXORconst)
  1478  		v.AuxInt = ssa.Int32ToAuxInt(1)
  1479  		v0 := b.NewValue0(v.Pos, ssaop.OpMIPSSGT, typ.Bool)
  1480  		v1 := b.NewValue0(v.Pos, ssaop.OpSignExt8to32, typ.Int32)
  1481  		v1.AddArg(x)
  1482  		v2 := b.NewValue0(v.Pos, ssaop.OpSignExt8to32, typ.Int32)
  1483  		v2.AddArg(y)
  1484  		v0.AddArg2(v1, v2)
  1485  		v.AddArg(v0)
  1486  		return true
  1487  	}
  1488  }
  1489  func rewriteValue_OpLeq8U(v *ssa.Value) bool {
  1490  	v_1 := v.Args[1]
  1491  	v_0 := v.Args[0]
  1492  	b := v.Block
  1493  	typ := &b.Func.Config.Types
  1494  	// match: (Leq8U x y)
  1495  	// result: (XORconst [1] (SGTU (ZeroExt8to32 x) (ZeroExt8to32 y)))
  1496  	for {
  1497  		x := v_0
  1498  		y := v_1
  1499  		v.Reset(ssaop.OpMIPSXORconst)
  1500  		v.AuxInt = ssa.Int32ToAuxInt(1)
  1501  		v0 := b.NewValue0(v.Pos, ssaop.OpMIPSSGTU, typ.Bool)
  1502  		v1 := b.NewValue0(v.Pos, ssaop.OpZeroExt8to32, typ.UInt32)
  1503  		v1.AddArg(x)
  1504  		v2 := b.NewValue0(v.Pos, ssaop.OpZeroExt8to32, typ.UInt32)
  1505  		v2.AddArg(y)
  1506  		v0.AddArg2(v1, v2)
  1507  		v.AddArg(v0)
  1508  		return true
  1509  	}
  1510  }
  1511  func rewriteValue_OpLess16(v *ssa.Value) bool {
  1512  	v_1 := v.Args[1]
  1513  	v_0 := v.Args[0]
  1514  	b := v.Block
  1515  	typ := &b.Func.Config.Types
  1516  	// match: (Less16 x y)
  1517  	// result: (SGT (SignExt16to32 y) (SignExt16to32 x))
  1518  	for {
  1519  		x := v_0
  1520  		y := v_1
  1521  		v.Reset(ssaop.OpMIPSSGT)
  1522  		v0 := b.NewValue0(v.Pos, ssaop.OpSignExt16to32, typ.Int32)
  1523  		v0.AddArg(y)
  1524  		v1 := b.NewValue0(v.Pos, ssaop.OpSignExt16to32, typ.Int32)
  1525  		v1.AddArg(x)
  1526  		v.AddArg2(v0, v1)
  1527  		return true
  1528  	}
  1529  }
  1530  func rewriteValue_OpLess16U(v *ssa.Value) bool {
  1531  	v_1 := v.Args[1]
  1532  	v_0 := v.Args[0]
  1533  	b := v.Block
  1534  	typ := &b.Func.Config.Types
  1535  	// match: (Less16U x y)
  1536  	// result: (SGTU (ZeroExt16to32 y) (ZeroExt16to32 x))
  1537  	for {
  1538  		x := v_0
  1539  		y := v_1
  1540  		v.Reset(ssaop.OpMIPSSGTU)
  1541  		v0 := b.NewValue0(v.Pos, ssaop.OpZeroExt16to32, typ.UInt32)
  1542  		v0.AddArg(y)
  1543  		v1 := b.NewValue0(v.Pos, ssaop.OpZeroExt16to32, typ.UInt32)
  1544  		v1.AddArg(x)
  1545  		v.AddArg2(v0, v1)
  1546  		return true
  1547  	}
  1548  }
  1549  func rewriteValue_OpLess32(v *ssa.Value) bool {
  1550  	v_1 := v.Args[1]
  1551  	v_0 := v.Args[0]
  1552  	// match: (Less32 x y)
  1553  	// result: (SGT y x)
  1554  	for {
  1555  		x := v_0
  1556  		y := v_1
  1557  		v.Reset(ssaop.OpMIPSSGT)
  1558  		v.AddArg2(y, x)
  1559  		return true
  1560  	}
  1561  }
  1562  func rewriteValue_OpLess32F(v *ssa.Value) bool {
  1563  	v_1 := v.Args[1]
  1564  	v_0 := v.Args[0]
  1565  	b := v.Block
  1566  	// match: (Less32F x y)
  1567  	// result: (FPFlagTrue (CMPGTF y x))
  1568  	for {
  1569  		x := v_0
  1570  		y := v_1
  1571  		v.Reset(ssaop.OpMIPSFPFlagTrue)
  1572  		v0 := b.NewValue0(v.Pos, ssaop.OpMIPSCMPGTF, types.TypeFlags)
  1573  		v0.AddArg2(y, x)
  1574  		v.AddArg(v0)
  1575  		return true
  1576  	}
  1577  }
  1578  func rewriteValue_OpLess32U(v *ssa.Value) bool {
  1579  	v_1 := v.Args[1]
  1580  	v_0 := v.Args[0]
  1581  	// match: (Less32U x y)
  1582  	// result: (SGTU y x)
  1583  	for {
  1584  		x := v_0
  1585  		y := v_1
  1586  		v.Reset(ssaop.OpMIPSSGTU)
  1587  		v.AddArg2(y, x)
  1588  		return true
  1589  	}
  1590  }
  1591  func rewriteValue_OpLess64F(v *ssa.Value) bool {
  1592  	v_1 := v.Args[1]
  1593  	v_0 := v.Args[0]
  1594  	b := v.Block
  1595  	// match: (Less64F x y)
  1596  	// result: (FPFlagTrue (CMPGTD y x))
  1597  	for {
  1598  		x := v_0
  1599  		y := v_1
  1600  		v.Reset(ssaop.OpMIPSFPFlagTrue)
  1601  		v0 := b.NewValue0(v.Pos, ssaop.OpMIPSCMPGTD, types.TypeFlags)
  1602  		v0.AddArg2(y, x)
  1603  		v.AddArg(v0)
  1604  		return true
  1605  	}
  1606  }
  1607  func rewriteValue_OpLess8(v *ssa.Value) bool {
  1608  	v_1 := v.Args[1]
  1609  	v_0 := v.Args[0]
  1610  	b := v.Block
  1611  	typ := &b.Func.Config.Types
  1612  	// match: (Less8 x y)
  1613  	// result: (SGT (SignExt8to32 y) (SignExt8to32 x))
  1614  	for {
  1615  		x := v_0
  1616  		y := v_1
  1617  		v.Reset(ssaop.OpMIPSSGT)
  1618  		v0 := b.NewValue0(v.Pos, ssaop.OpSignExt8to32, typ.Int32)
  1619  		v0.AddArg(y)
  1620  		v1 := b.NewValue0(v.Pos, ssaop.OpSignExt8to32, typ.Int32)
  1621  		v1.AddArg(x)
  1622  		v.AddArg2(v0, v1)
  1623  		return true
  1624  	}
  1625  }
  1626  func rewriteValue_OpLess8U(v *ssa.Value) bool {
  1627  	v_1 := v.Args[1]
  1628  	v_0 := v.Args[0]
  1629  	b := v.Block
  1630  	typ := &b.Func.Config.Types
  1631  	// match: (Less8U x y)
  1632  	// result: (SGTU (ZeroExt8to32 y) (ZeroExt8to32 x))
  1633  	for {
  1634  		x := v_0
  1635  		y := v_1
  1636  		v.Reset(ssaop.OpMIPSSGTU)
  1637  		v0 := b.NewValue0(v.Pos, ssaop.OpZeroExt8to32, typ.UInt32)
  1638  		v0.AddArg(y)
  1639  		v1 := b.NewValue0(v.Pos, ssaop.OpZeroExt8to32, typ.UInt32)
  1640  		v1.AddArg(x)
  1641  		v.AddArg2(v0, v1)
  1642  		return true
  1643  	}
  1644  }
  1645  func rewriteValue_OpLoad(v *ssa.Value) bool {
  1646  	v_1 := v.Args[1]
  1647  	v_0 := v.Args[0]
  1648  	// match: (Load <t> ptr mem)
  1649  	// cond: t.IsBoolean()
  1650  	// result: (MOVBUload ptr mem)
  1651  	for {
  1652  		t := v.Type
  1653  		ptr := v_0
  1654  		mem := v_1
  1655  		if !(t.IsBoolean()) {
  1656  			break
  1657  		}
  1658  		v.Reset(ssaop.OpMIPSMOVBUload)
  1659  		v.AddArg2(ptr, mem)
  1660  		return true
  1661  	}
  1662  	// match: (Load <t> ptr mem)
  1663  	// cond: (ssa.Is8BitInt(t) && t.IsSigned())
  1664  	// result: (MOVBload ptr mem)
  1665  	for {
  1666  		t := v.Type
  1667  		ptr := v_0
  1668  		mem := v_1
  1669  		if !(ssa.Is8BitInt(t) && t.IsSigned()) {
  1670  			break
  1671  		}
  1672  		v.Reset(ssaop.OpMIPSMOVBload)
  1673  		v.AddArg2(ptr, mem)
  1674  		return true
  1675  	}
  1676  	// match: (Load <t> ptr mem)
  1677  	// cond: (ssa.Is8BitInt(t) && !t.IsSigned())
  1678  	// result: (MOVBUload ptr mem)
  1679  	for {
  1680  		t := v.Type
  1681  		ptr := v_0
  1682  		mem := v_1
  1683  		if !(ssa.Is8BitInt(t) && !t.IsSigned()) {
  1684  			break
  1685  		}
  1686  		v.Reset(ssaop.OpMIPSMOVBUload)
  1687  		v.AddArg2(ptr, mem)
  1688  		return true
  1689  	}
  1690  	// match: (Load <t> ptr mem)
  1691  	// cond: (ssa.Is16BitInt(t) && t.IsSigned())
  1692  	// result: (MOVHload ptr mem)
  1693  	for {
  1694  		t := v.Type
  1695  		ptr := v_0
  1696  		mem := v_1
  1697  		if !(ssa.Is16BitInt(t) && t.IsSigned()) {
  1698  			break
  1699  		}
  1700  		v.Reset(ssaop.OpMIPSMOVHload)
  1701  		v.AddArg2(ptr, mem)
  1702  		return true
  1703  	}
  1704  	// match: (Load <t> ptr mem)
  1705  	// cond: (ssa.Is16BitInt(t) && !t.IsSigned())
  1706  	// result: (MOVHUload ptr mem)
  1707  	for {
  1708  		t := v.Type
  1709  		ptr := v_0
  1710  		mem := v_1
  1711  		if !(ssa.Is16BitInt(t) && !t.IsSigned()) {
  1712  			break
  1713  		}
  1714  		v.Reset(ssaop.OpMIPSMOVHUload)
  1715  		v.AddArg2(ptr, mem)
  1716  		return true
  1717  	}
  1718  	// match: (Load <t> ptr mem)
  1719  	// cond: (ssa.Is32BitInt(t) ||ssa.IsPtr(t))
  1720  	// result: (MOVWload ptr mem)
  1721  	for {
  1722  		t := v.Type
  1723  		ptr := v_0
  1724  		mem := v_1
  1725  		if !(ssa.Is32BitInt(t) || ssa.IsPtr(t)) {
  1726  			break
  1727  		}
  1728  		v.Reset(ssaop.OpMIPSMOVWload)
  1729  		v.AddArg2(ptr, mem)
  1730  		return true
  1731  	}
  1732  	// match: (Load <t> ptr mem)
  1733  	// cond: ssa.Is32BitFloat(t)
  1734  	// result: (MOVFload ptr mem)
  1735  	for {
  1736  		t := v.Type
  1737  		ptr := v_0
  1738  		mem := v_1
  1739  		if !(ssa.Is32BitFloat(t)) {
  1740  			break
  1741  		}
  1742  		v.Reset(ssaop.OpMIPSMOVFload)
  1743  		v.AddArg2(ptr, mem)
  1744  		return true
  1745  	}
  1746  	// match: (Load <t> ptr mem)
  1747  	// cond: ssa.Is64BitFloat(t)
  1748  	// result: (MOVDload ptr mem)
  1749  	for {
  1750  		t := v.Type
  1751  		ptr := v_0
  1752  		mem := v_1
  1753  		if !(ssa.Is64BitFloat(t)) {
  1754  			break
  1755  		}
  1756  		v.Reset(ssaop.OpMIPSMOVDload)
  1757  		v.AddArg2(ptr, mem)
  1758  		return true
  1759  	}
  1760  	return false
  1761  }
  1762  func rewriteValue_OpLocalAddr(v *ssa.Value) bool {
  1763  	v_1 := v.Args[1]
  1764  	v_0 := v.Args[0]
  1765  	b := v.Block
  1766  	typ := &b.Func.Config.Types
  1767  	// match: (LocalAddr <t> {sym} base mem)
  1768  	// cond: t.Elem().HasPointers()
  1769  	// result: (MOVWaddr {sym} (SPanchored base mem))
  1770  	for {
  1771  		t := v.Type
  1772  		sym := ssa.AuxToSym(v.Aux)
  1773  		base := v_0
  1774  		mem := v_1
  1775  		if !(t.Elem().HasPointers()) {
  1776  			break
  1777  		}
  1778  		v.Reset(ssaop.OpMIPSMOVWaddr)
  1779  		v.Aux = ssa.SymToAux(sym)
  1780  		v0 := b.NewValue0(v.Pos, ssaop.OpSPanchored, typ.Uintptr)
  1781  		v0.AddArg2(base, mem)
  1782  		v.AddArg(v0)
  1783  		return true
  1784  	}
  1785  	// match: (LocalAddr <t> {sym} base _)
  1786  	// cond: !t.Elem().HasPointers()
  1787  	// result: (MOVWaddr {sym} base)
  1788  	for {
  1789  		t := v.Type
  1790  		sym := ssa.AuxToSym(v.Aux)
  1791  		base := v_0
  1792  		if !(!t.Elem().HasPointers()) {
  1793  			break
  1794  		}
  1795  		v.Reset(ssaop.OpMIPSMOVWaddr)
  1796  		v.Aux = ssa.SymToAux(sym)
  1797  		v.AddArg(base)
  1798  		return true
  1799  	}
  1800  	return false
  1801  }
  1802  func rewriteValue_OpLsh16x16(v *ssa.Value) bool {
  1803  	v_1 := v.Args[1]
  1804  	v_0 := v.Args[0]
  1805  	b := v.Block
  1806  	typ := &b.Func.Config.Types
  1807  	// match: (Lsh16x16 <t> x y)
  1808  	// result: (CMOVZ (SLL <t> x (ZeroExt16to32 y) ) (MOVWconst [0]) (SGTUconst [32] (ZeroExt16to32 y)))
  1809  	for {
  1810  		t := v.Type
  1811  		x := v_0
  1812  		y := v_1
  1813  		v.Reset(ssaop.OpMIPSCMOVZ)
  1814  		v0 := b.NewValue0(v.Pos, ssaop.OpMIPSSLL, t)
  1815  		v1 := b.NewValue0(v.Pos, ssaop.OpZeroExt16to32, typ.UInt32)
  1816  		v1.AddArg(y)
  1817  		v0.AddArg2(x, v1)
  1818  		v2 := b.NewValue0(v.Pos, ssaop.OpMIPSMOVWconst, typ.UInt32)
  1819  		v2.AuxInt = ssa.Int32ToAuxInt(0)
  1820  		v3 := b.NewValue0(v.Pos, ssaop.OpMIPSSGTUconst, typ.Bool)
  1821  		v3.AuxInt = ssa.Int32ToAuxInt(32)
  1822  		v3.AddArg(v1)
  1823  		v.AddArg3(v0, v2, v3)
  1824  		return true
  1825  	}
  1826  }
  1827  func rewriteValue_OpLsh16x32(v *ssa.Value) bool {
  1828  	v_1 := v.Args[1]
  1829  	v_0 := v.Args[0]
  1830  	b := v.Block
  1831  	typ := &b.Func.Config.Types
  1832  	// match: (Lsh16x32 <t> x y)
  1833  	// result: (CMOVZ (SLL <t> x y) (MOVWconst [0]) (SGTUconst [32] y))
  1834  	for {
  1835  		t := v.Type
  1836  		x := v_0
  1837  		y := v_1
  1838  		v.Reset(ssaop.OpMIPSCMOVZ)
  1839  		v0 := b.NewValue0(v.Pos, ssaop.OpMIPSSLL, t)
  1840  		v0.AddArg2(x, y)
  1841  		v1 := b.NewValue0(v.Pos, ssaop.OpMIPSMOVWconst, typ.UInt32)
  1842  		v1.AuxInt = ssa.Int32ToAuxInt(0)
  1843  		v2 := b.NewValue0(v.Pos, ssaop.OpMIPSSGTUconst, typ.Bool)
  1844  		v2.AuxInt = ssa.Int32ToAuxInt(32)
  1845  		v2.AddArg(y)
  1846  		v.AddArg3(v0, v1, v2)
  1847  		return true
  1848  	}
  1849  }
  1850  func rewriteValue_OpLsh16x64(v *ssa.Value) bool {
  1851  	v_1 := v.Args[1]
  1852  	v_0 := v.Args[0]
  1853  	// match: (Lsh16x64 x (Const64 [c]))
  1854  	// cond: uint32(c) < 16
  1855  	// result: (SLLconst x [int32(c)])
  1856  	for {
  1857  		x := v_0
  1858  		if v_1.Op != ssaop.OpConst64 {
  1859  			break
  1860  		}
  1861  		c := ssa.AuxIntToInt64(v_1.AuxInt)
  1862  		if !(uint32(c) < 16) {
  1863  			break
  1864  		}
  1865  		v.Reset(ssaop.OpMIPSSLLconst)
  1866  		v.AuxInt = ssa.Int32ToAuxInt(int32(c))
  1867  		v.AddArg(x)
  1868  		return true
  1869  	}
  1870  	// match: (Lsh16x64 _ (Const64 [c]))
  1871  	// cond: uint32(c) >= 16
  1872  	// result: (MOVWconst [0])
  1873  	for {
  1874  		if v_1.Op != ssaop.OpConst64 {
  1875  			break
  1876  		}
  1877  		c := ssa.AuxIntToInt64(v_1.AuxInt)
  1878  		if !(uint32(c) >= 16) {
  1879  			break
  1880  		}
  1881  		v.Reset(ssaop.OpMIPSMOVWconst)
  1882  		v.AuxInt = ssa.Int32ToAuxInt(0)
  1883  		return true
  1884  	}
  1885  	return false
  1886  }
  1887  func rewriteValue_OpLsh16x8(v *ssa.Value) bool {
  1888  	v_1 := v.Args[1]
  1889  	v_0 := v.Args[0]
  1890  	b := v.Block
  1891  	typ := &b.Func.Config.Types
  1892  	// match: (Lsh16x8 <t> x y)
  1893  	// result: (CMOVZ (SLL <t> x (ZeroExt8to32 y) ) (MOVWconst [0]) (SGTUconst [32] (ZeroExt8to32 y)))
  1894  	for {
  1895  		t := v.Type
  1896  		x := v_0
  1897  		y := v_1
  1898  		v.Reset(ssaop.OpMIPSCMOVZ)
  1899  		v0 := b.NewValue0(v.Pos, ssaop.OpMIPSSLL, t)
  1900  		v1 := b.NewValue0(v.Pos, ssaop.OpZeroExt8to32, typ.UInt32)
  1901  		v1.AddArg(y)
  1902  		v0.AddArg2(x, v1)
  1903  		v2 := b.NewValue0(v.Pos, ssaop.OpMIPSMOVWconst, typ.UInt32)
  1904  		v2.AuxInt = ssa.Int32ToAuxInt(0)
  1905  		v3 := b.NewValue0(v.Pos, ssaop.OpMIPSSGTUconst, typ.Bool)
  1906  		v3.AuxInt = ssa.Int32ToAuxInt(32)
  1907  		v3.AddArg(v1)
  1908  		v.AddArg3(v0, v2, v3)
  1909  		return true
  1910  	}
  1911  }
  1912  func rewriteValue_OpLsh32x16(v *ssa.Value) bool {
  1913  	v_1 := v.Args[1]
  1914  	v_0 := v.Args[0]
  1915  	b := v.Block
  1916  	typ := &b.Func.Config.Types
  1917  	// match: (Lsh32x16 <t> x y)
  1918  	// result: (CMOVZ (SLL <t> x (ZeroExt16to32 y) ) (MOVWconst [0]) (SGTUconst [32] (ZeroExt16to32 y)))
  1919  	for {
  1920  		t := v.Type
  1921  		x := v_0
  1922  		y := v_1
  1923  		v.Reset(ssaop.OpMIPSCMOVZ)
  1924  		v0 := b.NewValue0(v.Pos, ssaop.OpMIPSSLL, t)
  1925  		v1 := b.NewValue0(v.Pos, ssaop.OpZeroExt16to32, typ.UInt32)
  1926  		v1.AddArg(y)
  1927  		v0.AddArg2(x, v1)
  1928  		v2 := b.NewValue0(v.Pos, ssaop.OpMIPSMOVWconst, typ.UInt32)
  1929  		v2.AuxInt = ssa.Int32ToAuxInt(0)
  1930  		v3 := b.NewValue0(v.Pos, ssaop.OpMIPSSGTUconst, typ.Bool)
  1931  		v3.AuxInt = ssa.Int32ToAuxInt(32)
  1932  		v3.AddArg(v1)
  1933  		v.AddArg3(v0, v2, v3)
  1934  		return true
  1935  	}
  1936  }
  1937  func rewriteValue_OpLsh32x32(v *ssa.Value) bool {
  1938  	v_1 := v.Args[1]
  1939  	v_0 := v.Args[0]
  1940  	b := v.Block
  1941  	typ := &b.Func.Config.Types
  1942  	// match: (Lsh32x32 <t> x y)
  1943  	// result: (CMOVZ (SLL <t> x y) (MOVWconst [0]) (SGTUconst [32] y))
  1944  	for {
  1945  		t := v.Type
  1946  		x := v_0
  1947  		y := v_1
  1948  		v.Reset(ssaop.OpMIPSCMOVZ)
  1949  		v0 := b.NewValue0(v.Pos, ssaop.OpMIPSSLL, t)
  1950  		v0.AddArg2(x, y)
  1951  		v1 := b.NewValue0(v.Pos, ssaop.OpMIPSMOVWconst, typ.UInt32)
  1952  		v1.AuxInt = ssa.Int32ToAuxInt(0)
  1953  		v2 := b.NewValue0(v.Pos, ssaop.OpMIPSSGTUconst, typ.Bool)
  1954  		v2.AuxInt = ssa.Int32ToAuxInt(32)
  1955  		v2.AddArg(y)
  1956  		v.AddArg3(v0, v1, v2)
  1957  		return true
  1958  	}
  1959  }
  1960  func rewriteValue_OpLsh32x64(v *ssa.Value) bool {
  1961  	v_1 := v.Args[1]
  1962  	v_0 := v.Args[0]
  1963  	// match: (Lsh32x64 x (Const64 [c]))
  1964  	// cond: uint32(c) < 32
  1965  	// result: (SLLconst x [int32(c)])
  1966  	for {
  1967  		x := v_0
  1968  		if v_1.Op != ssaop.OpConst64 {
  1969  			break
  1970  		}
  1971  		c := ssa.AuxIntToInt64(v_1.AuxInt)
  1972  		if !(uint32(c) < 32) {
  1973  			break
  1974  		}
  1975  		v.Reset(ssaop.OpMIPSSLLconst)
  1976  		v.AuxInt = ssa.Int32ToAuxInt(int32(c))
  1977  		v.AddArg(x)
  1978  		return true
  1979  	}
  1980  	// match: (Lsh32x64 _ (Const64 [c]))
  1981  	// cond: uint32(c) >= 32
  1982  	// result: (MOVWconst [0])
  1983  	for {
  1984  		if v_1.Op != ssaop.OpConst64 {
  1985  			break
  1986  		}
  1987  		c := ssa.AuxIntToInt64(v_1.AuxInt)
  1988  		if !(uint32(c) >= 32) {
  1989  			break
  1990  		}
  1991  		v.Reset(ssaop.OpMIPSMOVWconst)
  1992  		v.AuxInt = ssa.Int32ToAuxInt(0)
  1993  		return true
  1994  	}
  1995  	return false
  1996  }
  1997  func rewriteValue_OpLsh32x8(v *ssa.Value) bool {
  1998  	v_1 := v.Args[1]
  1999  	v_0 := v.Args[0]
  2000  	b := v.Block
  2001  	typ := &b.Func.Config.Types
  2002  	// match: (Lsh32x8 <t> x y)
  2003  	// result: (CMOVZ (SLL <t> x (ZeroExt8to32 y) ) (MOVWconst [0]) (SGTUconst [32] (ZeroExt8to32 y)))
  2004  	for {
  2005  		t := v.Type
  2006  		x := v_0
  2007  		y := v_1
  2008  		v.Reset(ssaop.OpMIPSCMOVZ)
  2009  		v0 := b.NewValue0(v.Pos, ssaop.OpMIPSSLL, t)
  2010  		v1 := b.NewValue0(v.Pos, ssaop.OpZeroExt8to32, typ.UInt32)
  2011  		v1.AddArg(y)
  2012  		v0.AddArg2(x, v1)
  2013  		v2 := b.NewValue0(v.Pos, ssaop.OpMIPSMOVWconst, typ.UInt32)
  2014  		v2.AuxInt = ssa.Int32ToAuxInt(0)
  2015  		v3 := b.NewValue0(v.Pos, ssaop.OpMIPSSGTUconst, typ.Bool)
  2016  		v3.AuxInt = ssa.Int32ToAuxInt(32)
  2017  		v3.AddArg(v1)
  2018  		v.AddArg3(v0, v2, v3)
  2019  		return true
  2020  	}
  2021  }
  2022  func rewriteValue_OpLsh8x16(v *ssa.Value) bool {
  2023  	v_1 := v.Args[1]
  2024  	v_0 := v.Args[0]
  2025  	b := v.Block
  2026  	typ := &b.Func.Config.Types
  2027  	// match: (Lsh8x16 <t> x y)
  2028  	// result: (CMOVZ (SLL <t> x (ZeroExt16to32 y) ) (MOVWconst [0]) (SGTUconst [32] (ZeroExt16to32 y)))
  2029  	for {
  2030  		t := v.Type
  2031  		x := v_0
  2032  		y := v_1
  2033  		v.Reset(ssaop.OpMIPSCMOVZ)
  2034  		v0 := b.NewValue0(v.Pos, ssaop.OpMIPSSLL, t)
  2035  		v1 := b.NewValue0(v.Pos, ssaop.OpZeroExt16to32, typ.UInt32)
  2036  		v1.AddArg(y)
  2037  		v0.AddArg2(x, v1)
  2038  		v2 := b.NewValue0(v.Pos, ssaop.OpMIPSMOVWconst, typ.UInt32)
  2039  		v2.AuxInt = ssa.Int32ToAuxInt(0)
  2040  		v3 := b.NewValue0(v.Pos, ssaop.OpMIPSSGTUconst, typ.Bool)
  2041  		v3.AuxInt = ssa.Int32ToAuxInt(32)
  2042  		v3.AddArg(v1)
  2043  		v.AddArg3(v0, v2, v3)
  2044  		return true
  2045  	}
  2046  }
  2047  func rewriteValue_OpLsh8x32(v *ssa.Value) bool {
  2048  	v_1 := v.Args[1]
  2049  	v_0 := v.Args[0]
  2050  	b := v.Block
  2051  	typ := &b.Func.Config.Types
  2052  	// match: (Lsh8x32 <t> x y)
  2053  	// result: (CMOVZ (SLL <t> x y) (MOVWconst [0]) (SGTUconst [32] y))
  2054  	for {
  2055  		t := v.Type
  2056  		x := v_0
  2057  		y := v_1
  2058  		v.Reset(ssaop.OpMIPSCMOVZ)
  2059  		v0 := b.NewValue0(v.Pos, ssaop.OpMIPSSLL, t)
  2060  		v0.AddArg2(x, y)
  2061  		v1 := b.NewValue0(v.Pos, ssaop.OpMIPSMOVWconst, typ.UInt32)
  2062  		v1.AuxInt = ssa.Int32ToAuxInt(0)
  2063  		v2 := b.NewValue0(v.Pos, ssaop.OpMIPSSGTUconst, typ.Bool)
  2064  		v2.AuxInt = ssa.Int32ToAuxInt(32)
  2065  		v2.AddArg(y)
  2066  		v.AddArg3(v0, v1, v2)
  2067  		return true
  2068  	}
  2069  }
  2070  func rewriteValue_OpLsh8x64(v *ssa.Value) bool {
  2071  	v_1 := v.Args[1]
  2072  	v_0 := v.Args[0]
  2073  	// match: (Lsh8x64 x (Const64 [c]))
  2074  	// cond: uint32(c) < 8
  2075  	// result: (SLLconst x [int32(c)])
  2076  	for {
  2077  		x := v_0
  2078  		if v_1.Op != ssaop.OpConst64 {
  2079  			break
  2080  		}
  2081  		c := ssa.AuxIntToInt64(v_1.AuxInt)
  2082  		if !(uint32(c) < 8) {
  2083  			break
  2084  		}
  2085  		v.Reset(ssaop.OpMIPSSLLconst)
  2086  		v.AuxInt = ssa.Int32ToAuxInt(int32(c))
  2087  		v.AddArg(x)
  2088  		return true
  2089  	}
  2090  	// match: (Lsh8x64 _ (Const64 [c]))
  2091  	// cond: uint32(c) >= 8
  2092  	// result: (MOVWconst [0])
  2093  	for {
  2094  		if v_1.Op != ssaop.OpConst64 {
  2095  			break
  2096  		}
  2097  		c := ssa.AuxIntToInt64(v_1.AuxInt)
  2098  		if !(uint32(c) >= 8) {
  2099  			break
  2100  		}
  2101  		v.Reset(ssaop.OpMIPSMOVWconst)
  2102  		v.AuxInt = ssa.Int32ToAuxInt(0)
  2103  		return true
  2104  	}
  2105  	return false
  2106  }
  2107  func rewriteValue_OpLsh8x8(v *ssa.Value) bool {
  2108  	v_1 := v.Args[1]
  2109  	v_0 := v.Args[0]
  2110  	b := v.Block
  2111  	typ := &b.Func.Config.Types
  2112  	// match: (Lsh8x8 <t> x y)
  2113  	// result: (CMOVZ (SLL <t> x (ZeroExt8to32 y) ) (MOVWconst [0]) (SGTUconst [32] (ZeroExt8to32 y)))
  2114  	for {
  2115  		t := v.Type
  2116  		x := v_0
  2117  		y := v_1
  2118  		v.Reset(ssaop.OpMIPSCMOVZ)
  2119  		v0 := b.NewValue0(v.Pos, ssaop.OpMIPSSLL, t)
  2120  		v1 := b.NewValue0(v.Pos, ssaop.OpZeroExt8to32, typ.UInt32)
  2121  		v1.AddArg(y)
  2122  		v0.AddArg2(x, v1)
  2123  		v2 := b.NewValue0(v.Pos, ssaop.OpMIPSMOVWconst, typ.UInt32)
  2124  		v2.AuxInt = ssa.Int32ToAuxInt(0)
  2125  		v3 := b.NewValue0(v.Pos, ssaop.OpMIPSSGTUconst, typ.Bool)
  2126  		v3.AuxInt = ssa.Int32ToAuxInt(32)
  2127  		v3.AddArg(v1)
  2128  		v.AddArg3(v0, v2, v3)
  2129  		return true
  2130  	}
  2131  }
  2132  func rewriteValue_OpMIPSADD(v *ssa.Value) bool {
  2133  	v_1 := v.Args[1]
  2134  	v_0 := v.Args[0]
  2135  	// match: (ADD x (MOVWconst <t> [c]))
  2136  	// cond: !t.IsPtr()
  2137  	// result: (ADDconst [c] x)
  2138  	for {
  2139  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
  2140  			x := v_0
  2141  			if v_1.Op != ssaop.OpMIPSMOVWconst {
  2142  				continue
  2143  			}
  2144  			t := v_1.Type
  2145  			c := ssa.AuxIntToInt32(v_1.AuxInt)
  2146  			if !(!t.IsPtr()) {
  2147  				continue
  2148  			}
  2149  			v.Reset(ssaop.OpMIPSADDconst)
  2150  			v.AuxInt = ssa.Int32ToAuxInt(c)
  2151  			v.AddArg(x)
  2152  			return true
  2153  		}
  2154  		break
  2155  	}
  2156  	// match: (ADD x (NEG y))
  2157  	// result: (SUB x y)
  2158  	for {
  2159  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
  2160  			x := v_0
  2161  			if v_1.Op != ssaop.OpMIPSNEG {
  2162  				continue
  2163  			}
  2164  			y := v_1.Args[0]
  2165  			v.Reset(ssaop.OpMIPSSUB)
  2166  			v.AddArg2(x, y)
  2167  			return true
  2168  		}
  2169  		break
  2170  	}
  2171  	return false
  2172  }
  2173  func rewriteValue_OpMIPSADDconst(v *ssa.Value) bool {
  2174  	v_0 := v.Args[0]
  2175  	// match: (ADDconst [off1] (MOVWaddr [off2] {sym} ptr))
  2176  	// result: (MOVWaddr [off1+off2] {sym} ptr)
  2177  	for {
  2178  		off1 := ssa.AuxIntToInt32(v.AuxInt)
  2179  		if v_0.Op != ssaop.OpMIPSMOVWaddr {
  2180  			break
  2181  		}
  2182  		off2 := ssa.AuxIntToInt32(v_0.AuxInt)
  2183  		sym := ssa.AuxToSym(v_0.Aux)
  2184  		ptr := v_0.Args[0]
  2185  		v.Reset(ssaop.OpMIPSMOVWaddr)
  2186  		v.AuxInt = ssa.Int32ToAuxInt(off1 + off2)
  2187  		v.Aux = ssa.SymToAux(sym)
  2188  		v.AddArg(ptr)
  2189  		return true
  2190  	}
  2191  	// match: (ADDconst [0] x)
  2192  	// result: x
  2193  	for {
  2194  		if ssa.AuxIntToInt32(v.AuxInt) != 0 {
  2195  			break
  2196  		}
  2197  		x := v_0
  2198  		v.CopyOf(x)
  2199  		return true
  2200  	}
  2201  	// match: (ADDconst [c] (MOVWconst [d]))
  2202  	// result: (MOVWconst [int32(c+d)])
  2203  	for {
  2204  		c := ssa.AuxIntToInt32(v.AuxInt)
  2205  		if v_0.Op != ssaop.OpMIPSMOVWconst {
  2206  			break
  2207  		}
  2208  		d := ssa.AuxIntToInt32(v_0.AuxInt)
  2209  		v.Reset(ssaop.OpMIPSMOVWconst)
  2210  		v.AuxInt = ssa.Int32ToAuxInt(int32(c + d))
  2211  		return true
  2212  	}
  2213  	// match: (ADDconst [c] (ADDconst [d] x))
  2214  	// result: (ADDconst [c+d] x)
  2215  	for {
  2216  		c := ssa.AuxIntToInt32(v.AuxInt)
  2217  		if v_0.Op != ssaop.OpMIPSADDconst {
  2218  			break
  2219  		}
  2220  		d := ssa.AuxIntToInt32(v_0.AuxInt)
  2221  		x := v_0.Args[0]
  2222  		v.Reset(ssaop.OpMIPSADDconst)
  2223  		v.AuxInt = ssa.Int32ToAuxInt(c + d)
  2224  		v.AddArg(x)
  2225  		return true
  2226  	}
  2227  	// match: (ADDconst [c] (SUBconst [d] x))
  2228  	// result: (ADDconst [c-d] x)
  2229  	for {
  2230  		c := ssa.AuxIntToInt32(v.AuxInt)
  2231  		if v_0.Op != ssaop.OpMIPSSUBconst {
  2232  			break
  2233  		}
  2234  		d := ssa.AuxIntToInt32(v_0.AuxInt)
  2235  		x := v_0.Args[0]
  2236  		v.Reset(ssaop.OpMIPSADDconst)
  2237  		v.AuxInt = ssa.Int32ToAuxInt(c - d)
  2238  		v.AddArg(x)
  2239  		return true
  2240  	}
  2241  	return false
  2242  }
  2243  func rewriteValue_OpMIPSAND(v *ssa.Value) bool {
  2244  	v_1 := v.Args[1]
  2245  	v_0 := v.Args[0]
  2246  	b := v.Block
  2247  	// match: (AND x (MOVWconst [c]))
  2248  	// result: (ANDconst [c] x)
  2249  	for {
  2250  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
  2251  			x := v_0
  2252  			if v_1.Op != ssaop.OpMIPSMOVWconst {
  2253  				continue
  2254  			}
  2255  			c := ssa.AuxIntToInt32(v_1.AuxInt)
  2256  			v.Reset(ssaop.OpMIPSANDconst)
  2257  			v.AuxInt = ssa.Int32ToAuxInt(c)
  2258  			v.AddArg(x)
  2259  			return true
  2260  		}
  2261  		break
  2262  	}
  2263  	// match: (AND x x)
  2264  	// result: x
  2265  	for {
  2266  		x := v_0
  2267  		if x != v_1 {
  2268  			break
  2269  		}
  2270  		v.CopyOf(x)
  2271  		return true
  2272  	}
  2273  	// match: (AND (SGTUconst [1] x) (SGTUconst [1] y))
  2274  	// result: (SGTUconst [1] (OR <x.Type> x y))
  2275  	for {
  2276  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
  2277  			if v_0.Op != ssaop.OpMIPSSGTUconst || ssa.AuxIntToInt32(v_0.AuxInt) != 1 {
  2278  				continue
  2279  			}
  2280  			x := v_0.Args[0]
  2281  			if v_1.Op != ssaop.OpMIPSSGTUconst || ssa.AuxIntToInt32(v_1.AuxInt) != 1 {
  2282  				continue
  2283  			}
  2284  			y := v_1.Args[0]
  2285  			v.Reset(ssaop.OpMIPSSGTUconst)
  2286  			v.AuxInt = ssa.Int32ToAuxInt(1)
  2287  			v0 := b.NewValue0(v.Pos, ssaop.OpMIPSOR, x.Type)
  2288  			v0.AddArg2(x, y)
  2289  			v.AddArg(v0)
  2290  			return true
  2291  		}
  2292  		break
  2293  	}
  2294  	return false
  2295  }
  2296  func rewriteValue_OpMIPSANDconst(v *ssa.Value) bool {
  2297  	v_0 := v.Args[0]
  2298  	// match: (ANDconst [0] _)
  2299  	// result: (MOVWconst [0])
  2300  	for {
  2301  		if ssa.AuxIntToInt32(v.AuxInt) != 0 {
  2302  			break
  2303  		}
  2304  		v.Reset(ssaop.OpMIPSMOVWconst)
  2305  		v.AuxInt = ssa.Int32ToAuxInt(0)
  2306  		return true
  2307  	}
  2308  	// match: (ANDconst [-1] x)
  2309  	// result: x
  2310  	for {
  2311  		if ssa.AuxIntToInt32(v.AuxInt) != -1 {
  2312  			break
  2313  		}
  2314  		x := v_0
  2315  		v.CopyOf(x)
  2316  		return true
  2317  	}
  2318  	// match: (ANDconst [c] (MOVWconst [d]))
  2319  	// result: (MOVWconst [c&d])
  2320  	for {
  2321  		c := ssa.AuxIntToInt32(v.AuxInt)
  2322  		if v_0.Op != ssaop.OpMIPSMOVWconst {
  2323  			break
  2324  		}
  2325  		d := ssa.AuxIntToInt32(v_0.AuxInt)
  2326  		v.Reset(ssaop.OpMIPSMOVWconst)
  2327  		v.AuxInt = ssa.Int32ToAuxInt(c & d)
  2328  		return true
  2329  	}
  2330  	// match: (ANDconst [c] (ANDconst [d] x))
  2331  	// result: (ANDconst [c&d] x)
  2332  	for {
  2333  		c := ssa.AuxIntToInt32(v.AuxInt)
  2334  		if v_0.Op != ssaop.OpMIPSANDconst {
  2335  			break
  2336  		}
  2337  		d := ssa.AuxIntToInt32(v_0.AuxInt)
  2338  		x := v_0.Args[0]
  2339  		v.Reset(ssaop.OpMIPSANDconst)
  2340  		v.AuxInt = ssa.Int32ToAuxInt(c & d)
  2341  		v.AddArg(x)
  2342  		return true
  2343  	}
  2344  	return false
  2345  }
  2346  func rewriteValue_OpMIPSCMOVZ(v *ssa.Value) bool {
  2347  	v_2 := v.Args[2]
  2348  	v_1 := v.Args[1]
  2349  	v_0 := v.Args[0]
  2350  	// match: (CMOVZ _ f (MOVWconst [0]))
  2351  	// result: f
  2352  	for {
  2353  		f := v_1
  2354  		if v_2.Op != ssaop.OpMIPSMOVWconst || ssa.AuxIntToInt32(v_2.AuxInt) != 0 {
  2355  			break
  2356  		}
  2357  		v.CopyOf(f)
  2358  		return true
  2359  	}
  2360  	// match: (CMOVZ a _ (MOVWconst [c]))
  2361  	// cond: c!=0
  2362  	// result: a
  2363  	for {
  2364  		a := v_0
  2365  		if v_2.Op != ssaop.OpMIPSMOVWconst {
  2366  			break
  2367  		}
  2368  		c := ssa.AuxIntToInt32(v_2.AuxInt)
  2369  		if !(c != 0) {
  2370  			break
  2371  		}
  2372  		v.CopyOf(a)
  2373  		return true
  2374  	}
  2375  	// match: (CMOVZ a (MOVWconst [0]) c)
  2376  	// result: (CMOVZzero a c)
  2377  	for {
  2378  		a := v_0
  2379  		if v_1.Op != ssaop.OpMIPSMOVWconst || ssa.AuxIntToInt32(v_1.AuxInt) != 0 {
  2380  			break
  2381  		}
  2382  		c := v_2
  2383  		v.Reset(ssaop.OpMIPSCMOVZzero)
  2384  		v.AddArg2(a, c)
  2385  		return true
  2386  	}
  2387  	return false
  2388  }
  2389  func rewriteValue_OpMIPSCMOVZzero(v *ssa.Value) bool {
  2390  	v_1 := v.Args[1]
  2391  	v_0 := v.Args[0]
  2392  	// match: (CMOVZzero _ (MOVWconst [0]))
  2393  	// result: (MOVWconst [0])
  2394  	for {
  2395  		if v_1.Op != ssaop.OpMIPSMOVWconst || ssa.AuxIntToInt32(v_1.AuxInt) != 0 {
  2396  			break
  2397  		}
  2398  		v.Reset(ssaop.OpMIPSMOVWconst)
  2399  		v.AuxInt = ssa.Int32ToAuxInt(0)
  2400  		return true
  2401  	}
  2402  	// match: (CMOVZzero a (MOVWconst [c]))
  2403  	// cond: c!=0
  2404  	// result: a
  2405  	for {
  2406  		a := v_0
  2407  		if v_1.Op != ssaop.OpMIPSMOVWconst {
  2408  			break
  2409  		}
  2410  		c := ssa.AuxIntToInt32(v_1.AuxInt)
  2411  		if !(c != 0) {
  2412  			break
  2413  		}
  2414  		v.CopyOf(a)
  2415  		return true
  2416  	}
  2417  	return false
  2418  }
  2419  func rewriteValue_OpMIPSLoweredAtomicAdd(v *ssa.Value) bool {
  2420  	v_2 := v.Args[2]
  2421  	v_1 := v.Args[1]
  2422  	v_0 := v.Args[0]
  2423  	// match: (LoweredAtomicAdd ptr (MOVWconst [c]) mem)
  2424  	// cond: ssa.Is16Bit(int64(c))
  2425  	// result: (LoweredAtomicAddconst [c] ptr mem)
  2426  	for {
  2427  		ptr := v_0
  2428  		if v_1.Op != ssaop.OpMIPSMOVWconst {
  2429  			break
  2430  		}
  2431  		c := ssa.AuxIntToInt32(v_1.AuxInt)
  2432  		mem := v_2
  2433  		if !(ssa.Is16Bit(int64(c))) {
  2434  			break
  2435  		}
  2436  		v.Reset(ssaop.OpMIPSLoweredAtomicAddconst)
  2437  		v.AuxInt = ssa.Int32ToAuxInt(c)
  2438  		v.AddArg2(ptr, mem)
  2439  		return true
  2440  	}
  2441  	return false
  2442  }
  2443  func rewriteValue_OpMIPSLoweredAtomicStore32(v *ssa.Value) bool {
  2444  	v_2 := v.Args[2]
  2445  	v_1 := v.Args[1]
  2446  	v_0 := v.Args[0]
  2447  	// match: (LoweredAtomicStore32 ptr (MOVWconst [0]) mem)
  2448  	// result: (LoweredAtomicStorezero ptr mem)
  2449  	for {
  2450  		ptr := v_0
  2451  		if v_1.Op != ssaop.OpMIPSMOVWconst || ssa.AuxIntToInt32(v_1.AuxInt) != 0 {
  2452  			break
  2453  		}
  2454  		mem := v_2
  2455  		v.Reset(ssaop.OpMIPSLoweredAtomicStorezero)
  2456  		v.AddArg2(ptr, mem)
  2457  		return true
  2458  	}
  2459  	return false
  2460  }
  2461  func rewriteValue_OpMIPSLoweredPanicBoundsRC(v *ssa.Value) bool {
  2462  	v_1 := v.Args[1]
  2463  	v_0 := v.Args[0]
  2464  	// match: (LoweredPanicBoundsRC [kind] {p} (MOVWconst [c]) mem)
  2465  	// result: (LoweredPanicBoundsCC [kind] {ssa.PanicBoundsCC{Cx:int64(c), Cy:p.C}} mem)
  2466  	for {
  2467  		kind := ssa.AuxIntToInt64(v.AuxInt)
  2468  		p := ssa.AuxToPanicBoundsC(v.Aux)
  2469  		if v_0.Op != ssaop.OpMIPSMOVWconst {
  2470  			break
  2471  		}
  2472  		c := ssa.AuxIntToInt32(v_0.AuxInt)
  2473  		mem := v_1
  2474  		v.Reset(ssaop.OpMIPSLoweredPanicBoundsCC)
  2475  		v.AuxInt = ssa.Int64ToAuxInt(kind)
  2476  		v.Aux = ssa.PanicBoundsCCToAux(ssa.PanicBoundsCC{Cx: int64(c), Cy: p.C})
  2477  		v.AddArg(mem)
  2478  		return true
  2479  	}
  2480  	return false
  2481  }
  2482  func rewriteValue_OpMIPSLoweredPanicBoundsRR(v *ssa.Value) bool {
  2483  	v_2 := v.Args[2]
  2484  	v_1 := v.Args[1]
  2485  	v_0 := v.Args[0]
  2486  	// match: (LoweredPanicBoundsRR [kind] x (MOVWconst [c]) mem)
  2487  	// result: (LoweredPanicBoundsRC [kind] x {ssa.PanicBoundsC{C:int64(c)}} mem)
  2488  	for {
  2489  		kind := ssa.AuxIntToInt64(v.AuxInt)
  2490  		x := v_0
  2491  		if v_1.Op != ssaop.OpMIPSMOVWconst {
  2492  			break
  2493  		}
  2494  		c := ssa.AuxIntToInt32(v_1.AuxInt)
  2495  		mem := v_2
  2496  		v.Reset(ssaop.OpMIPSLoweredPanicBoundsRC)
  2497  		v.AuxInt = ssa.Int64ToAuxInt(kind)
  2498  		v.Aux = ssa.PanicBoundsCToAux(ssa.PanicBoundsC{C: int64(c)})
  2499  		v.AddArg2(x, mem)
  2500  		return true
  2501  	}
  2502  	// match: (LoweredPanicBoundsRR [kind] (MOVWconst [c]) y mem)
  2503  	// result: (LoweredPanicBoundsCR [kind] {ssa.PanicBoundsC{C:int64(c)}} y mem)
  2504  	for {
  2505  		kind := ssa.AuxIntToInt64(v.AuxInt)
  2506  		if v_0.Op != ssaop.OpMIPSMOVWconst {
  2507  			break
  2508  		}
  2509  		c := ssa.AuxIntToInt32(v_0.AuxInt)
  2510  		y := v_1
  2511  		mem := v_2
  2512  		v.Reset(ssaop.OpMIPSLoweredPanicBoundsCR)
  2513  		v.AuxInt = ssa.Int64ToAuxInt(kind)
  2514  		v.Aux = ssa.PanicBoundsCToAux(ssa.PanicBoundsC{C: int64(c)})
  2515  		v.AddArg2(y, mem)
  2516  		return true
  2517  	}
  2518  	return false
  2519  }
  2520  func rewriteValue_OpMIPSLoweredPanicExtendRC(v *ssa.Value) bool {
  2521  	v_2 := v.Args[2]
  2522  	v_1 := v.Args[1]
  2523  	v_0 := v.Args[0]
  2524  	// match: (LoweredPanicExtendRC [kind] {p} (MOVWconst [hi]) (MOVWconst [lo]) mem)
  2525  	// result: (LoweredPanicBoundsCC [kind] {ssa.PanicBoundsCC{Cx:int64(hi)<<32+int64(uint32(lo)), Cy:p.C}} mem)
  2526  	for {
  2527  		kind := ssa.AuxIntToInt64(v.AuxInt)
  2528  		p := ssa.AuxToPanicBoundsC(v.Aux)
  2529  		if v_0.Op != ssaop.OpMIPSMOVWconst {
  2530  			break
  2531  		}
  2532  		hi := ssa.AuxIntToInt32(v_0.AuxInt)
  2533  		if v_1.Op != ssaop.OpMIPSMOVWconst {
  2534  			break
  2535  		}
  2536  		lo := ssa.AuxIntToInt32(v_1.AuxInt)
  2537  		mem := v_2
  2538  		v.Reset(ssaop.OpMIPSLoweredPanicBoundsCC)
  2539  		v.AuxInt = ssa.Int64ToAuxInt(kind)
  2540  		v.Aux = ssa.PanicBoundsCCToAux(ssa.PanicBoundsCC{Cx: int64(hi)<<32 + int64(uint32(lo)), Cy: p.C})
  2541  		v.AddArg(mem)
  2542  		return true
  2543  	}
  2544  	return false
  2545  }
  2546  func rewriteValue_OpMIPSLoweredPanicExtendRR(v *ssa.Value) bool {
  2547  	v_3 := v.Args[3]
  2548  	v_2 := v.Args[2]
  2549  	v_1 := v.Args[1]
  2550  	v_0 := v.Args[0]
  2551  	// match: (LoweredPanicExtendRR [kind] hi lo (MOVWconst [c]) mem)
  2552  	// result: (LoweredPanicExtendRC [kind] hi lo {ssa.PanicBoundsC{C:int64(c)}} mem)
  2553  	for {
  2554  		kind := ssa.AuxIntToInt64(v.AuxInt)
  2555  		hi := v_0
  2556  		lo := v_1
  2557  		if v_2.Op != ssaop.OpMIPSMOVWconst {
  2558  			break
  2559  		}
  2560  		c := ssa.AuxIntToInt32(v_2.AuxInt)
  2561  		mem := v_3
  2562  		v.Reset(ssaop.OpMIPSLoweredPanicExtendRC)
  2563  		v.AuxInt = ssa.Int64ToAuxInt(kind)
  2564  		v.Aux = ssa.PanicBoundsCToAux(ssa.PanicBoundsC{C: int64(c)})
  2565  		v.AddArg3(hi, lo, mem)
  2566  		return true
  2567  	}
  2568  	// match: (LoweredPanicExtendRR [kind] (MOVWconst [hi]) (MOVWconst [lo]) y mem)
  2569  	// result: (LoweredPanicBoundsCR [kind] {ssa.PanicBoundsC{C:int64(hi)<<32 + int64(uint32(lo))}} y mem)
  2570  	for {
  2571  		kind := ssa.AuxIntToInt64(v.AuxInt)
  2572  		if v_0.Op != ssaop.OpMIPSMOVWconst {
  2573  			break
  2574  		}
  2575  		hi := ssa.AuxIntToInt32(v_0.AuxInt)
  2576  		if v_1.Op != ssaop.OpMIPSMOVWconst {
  2577  			break
  2578  		}
  2579  		lo := ssa.AuxIntToInt32(v_1.AuxInt)
  2580  		y := v_2
  2581  		mem := v_3
  2582  		v.Reset(ssaop.OpMIPSLoweredPanicBoundsCR)
  2583  		v.AuxInt = ssa.Int64ToAuxInt(kind)
  2584  		v.Aux = ssa.PanicBoundsCToAux(ssa.PanicBoundsC{C: int64(hi)<<32 + int64(uint32(lo))})
  2585  		v.AddArg2(y, mem)
  2586  		return true
  2587  	}
  2588  	return false
  2589  }
  2590  func rewriteValue_OpMIPSMOVBUload(v *ssa.Value) bool {
  2591  	v_1 := v.Args[1]
  2592  	v_0 := v.Args[0]
  2593  	// match: (MOVBUload [off] {sym} ptr (MOVBstore [off] {sym} ptr x _))
  2594  	// result: (MOVBUreg x)
  2595  	for {
  2596  		off := ssa.AuxIntToInt32(v.AuxInt)
  2597  		sym := ssa.AuxToSym(v.Aux)
  2598  		ptr := v_0
  2599  		if v_1.Op != ssaop.OpMIPSMOVBstore || ssa.AuxIntToInt32(v_1.AuxInt) != off || ssa.AuxToSym(v_1.Aux) != sym {
  2600  			break
  2601  		}
  2602  		x := v_1.Args[1]
  2603  		if ptr != v_1.Args[0] {
  2604  			break
  2605  		}
  2606  		v.Reset(ssaop.OpMIPSMOVBUreg)
  2607  		v.AddArg(x)
  2608  		return true
  2609  	}
  2610  	// match: (MOVBUload [off1] {sym} x:(ADDconst [off2] ptr) mem)
  2611  	// cond: (ssa.Is16Bit(int64(off1+off2)) || x.Uses == 1)
  2612  	// result: (MOVBUload [off1+off2] {sym} ptr mem)
  2613  	for {
  2614  		off1 := ssa.AuxIntToInt32(v.AuxInt)
  2615  		sym := ssa.AuxToSym(v.Aux)
  2616  		x := v_0
  2617  		if x.Op != ssaop.OpMIPSADDconst {
  2618  			break
  2619  		}
  2620  		off2 := ssa.AuxIntToInt32(x.AuxInt)
  2621  		ptr := x.Args[0]
  2622  		mem := v_1
  2623  		if !(ssa.Is16Bit(int64(off1+off2)) || x.Uses == 1) {
  2624  			break
  2625  		}
  2626  		v.Reset(ssaop.OpMIPSMOVBUload)
  2627  		v.AuxInt = ssa.Int32ToAuxInt(off1 + off2)
  2628  		v.Aux = ssa.SymToAux(sym)
  2629  		v.AddArg2(ptr, mem)
  2630  		return true
  2631  	}
  2632  	// match: (MOVBUload [off1] {sym1} (MOVWaddr [off2] {sym2} ptr) mem)
  2633  	// cond: ssa.CanMergeSym(sym1,sym2)
  2634  	// result: (MOVBUload [off1+off2] {ssa.MergeSym(sym1,sym2)} ptr mem)
  2635  	for {
  2636  		off1 := ssa.AuxIntToInt32(v.AuxInt)
  2637  		sym1 := ssa.AuxToSym(v.Aux)
  2638  		if v_0.Op != ssaop.OpMIPSMOVWaddr {
  2639  			break
  2640  		}
  2641  		off2 := ssa.AuxIntToInt32(v_0.AuxInt)
  2642  		sym2 := ssa.AuxToSym(v_0.Aux)
  2643  		ptr := v_0.Args[0]
  2644  		mem := v_1
  2645  		if !(ssa.CanMergeSym(sym1, sym2)) {
  2646  			break
  2647  		}
  2648  		v.Reset(ssaop.OpMIPSMOVBUload)
  2649  		v.AuxInt = ssa.Int32ToAuxInt(off1 + off2)
  2650  		v.Aux = ssa.SymToAux(ssa.MergeSym(sym1, sym2))
  2651  		v.AddArg2(ptr, mem)
  2652  		return true
  2653  	}
  2654  	// match: (MOVBUload [off] {sym} ptr (MOVBstore [off2] {sym2} ptr2 x _))
  2655  	// cond: sym == sym2 && off == off2 && ssa.IsSamePtr(ptr, ptr2)
  2656  	// result: (MOVBUreg x)
  2657  	for {
  2658  		off := ssa.AuxIntToInt32(v.AuxInt)
  2659  		sym := ssa.AuxToSym(v.Aux)
  2660  		ptr := v_0
  2661  		if v_1.Op != ssaop.OpMIPSMOVBstore {
  2662  			break
  2663  		}
  2664  		off2 := ssa.AuxIntToInt32(v_1.AuxInt)
  2665  		sym2 := ssa.AuxToSym(v_1.Aux)
  2666  		x := v_1.Args[1]
  2667  		ptr2 := v_1.Args[0]
  2668  		if !(sym == sym2 && off == off2 && ssa.IsSamePtr(ptr, ptr2)) {
  2669  			break
  2670  		}
  2671  		v.Reset(ssaop.OpMIPSMOVBUreg)
  2672  		v.AddArg(x)
  2673  		return true
  2674  	}
  2675  	return false
  2676  }
  2677  func rewriteValue_OpMIPSMOVBUreg(v *ssa.Value) bool {
  2678  	v_0 := v.Args[0]
  2679  	b := v.Block
  2680  	// match: (MOVBUreg x:(MOVBUload _ _))
  2681  	// result: (MOVWreg x)
  2682  	for {
  2683  		x := v_0
  2684  		if x.Op != ssaop.OpMIPSMOVBUload {
  2685  			break
  2686  		}
  2687  		v.Reset(ssaop.OpMIPSMOVWreg)
  2688  		v.AddArg(x)
  2689  		return true
  2690  	}
  2691  	// match: (MOVBUreg x:(MOVBUreg _))
  2692  	// result: (MOVWreg x)
  2693  	for {
  2694  		x := v_0
  2695  		if x.Op != ssaop.OpMIPSMOVBUreg {
  2696  			break
  2697  		}
  2698  		v.Reset(ssaop.OpMIPSMOVWreg)
  2699  		v.AddArg(x)
  2700  		return true
  2701  	}
  2702  	// match: (MOVBUreg <t> x:(MOVBload [off] {sym} ptr mem))
  2703  	// cond: x.Uses == 1 && ssa.Clobber(x)
  2704  	// result: @x.Block (MOVBUload <t> [off] {sym} ptr mem)
  2705  	for {
  2706  		t := v.Type
  2707  		x := v_0
  2708  		if x.Op != ssaop.OpMIPSMOVBload {
  2709  			break
  2710  		}
  2711  		off := ssa.AuxIntToInt32(x.AuxInt)
  2712  		sym := ssa.AuxToSym(x.Aux)
  2713  		mem := x.Args[1]
  2714  		ptr := x.Args[0]
  2715  		if !(x.Uses == 1 && ssa.Clobber(x)) {
  2716  			break
  2717  		}
  2718  		b = x.Block
  2719  		v0 := b.NewValue0(x.Pos, ssaop.OpMIPSMOVBUload, t)
  2720  		v.CopyOf(v0)
  2721  		v0.AuxInt = ssa.Int32ToAuxInt(off)
  2722  		v0.Aux = ssa.SymToAux(sym)
  2723  		v0.AddArg2(ptr, mem)
  2724  		return true
  2725  	}
  2726  	// match: (MOVBUreg (ANDconst [c] x))
  2727  	// result: (ANDconst [c&0xff] x)
  2728  	for {
  2729  		if v_0.Op != ssaop.OpMIPSANDconst {
  2730  			break
  2731  		}
  2732  		c := ssa.AuxIntToInt32(v_0.AuxInt)
  2733  		x := v_0.Args[0]
  2734  		v.Reset(ssaop.OpMIPSANDconst)
  2735  		v.AuxInt = ssa.Int32ToAuxInt(c & 0xff)
  2736  		v.AddArg(x)
  2737  		return true
  2738  	}
  2739  	// match: (MOVBUreg (MOVWconst [c]))
  2740  	// result: (MOVWconst [int32(uint8(c))])
  2741  	for {
  2742  		if v_0.Op != ssaop.OpMIPSMOVWconst {
  2743  			break
  2744  		}
  2745  		c := ssa.AuxIntToInt32(v_0.AuxInt)
  2746  		v.Reset(ssaop.OpMIPSMOVWconst)
  2747  		v.AuxInt = ssa.Int32ToAuxInt(int32(uint8(c)))
  2748  		return true
  2749  	}
  2750  	return false
  2751  }
  2752  func rewriteValue_OpMIPSMOVBload(v *ssa.Value) bool {
  2753  	v_1 := v.Args[1]
  2754  	v_0 := v.Args[0]
  2755  	// match: (MOVBload [off] {sym} ptr (MOVBstore [off] {sym} ptr x _))
  2756  	// result: (MOVBreg x)
  2757  	for {
  2758  		off := ssa.AuxIntToInt32(v.AuxInt)
  2759  		sym := ssa.AuxToSym(v.Aux)
  2760  		ptr := v_0
  2761  		if v_1.Op != ssaop.OpMIPSMOVBstore || ssa.AuxIntToInt32(v_1.AuxInt) != off || ssa.AuxToSym(v_1.Aux) != sym {
  2762  			break
  2763  		}
  2764  		x := v_1.Args[1]
  2765  		if ptr != v_1.Args[0] {
  2766  			break
  2767  		}
  2768  		v.Reset(ssaop.OpMIPSMOVBreg)
  2769  		v.AddArg(x)
  2770  		return true
  2771  	}
  2772  	// match: (MOVBload [off1] {sym} x:(ADDconst [off2] ptr) mem)
  2773  	// cond: (ssa.Is16Bit(int64(off1+off2)) || x.Uses == 1)
  2774  	// result: (MOVBload [off1+off2] {sym} ptr mem)
  2775  	for {
  2776  		off1 := ssa.AuxIntToInt32(v.AuxInt)
  2777  		sym := ssa.AuxToSym(v.Aux)
  2778  		x := v_0
  2779  		if x.Op != ssaop.OpMIPSADDconst {
  2780  			break
  2781  		}
  2782  		off2 := ssa.AuxIntToInt32(x.AuxInt)
  2783  		ptr := x.Args[0]
  2784  		mem := v_1
  2785  		if !(ssa.Is16Bit(int64(off1+off2)) || x.Uses == 1) {
  2786  			break
  2787  		}
  2788  		v.Reset(ssaop.OpMIPSMOVBload)
  2789  		v.AuxInt = ssa.Int32ToAuxInt(off1 + off2)
  2790  		v.Aux = ssa.SymToAux(sym)
  2791  		v.AddArg2(ptr, mem)
  2792  		return true
  2793  	}
  2794  	// match: (MOVBload [off1] {sym1} (MOVWaddr [off2] {sym2} ptr) mem)
  2795  	// cond: ssa.CanMergeSym(sym1,sym2)
  2796  	// result: (MOVBload [off1+off2] {ssa.MergeSym(sym1,sym2)} ptr mem)
  2797  	for {
  2798  		off1 := ssa.AuxIntToInt32(v.AuxInt)
  2799  		sym1 := ssa.AuxToSym(v.Aux)
  2800  		if v_0.Op != ssaop.OpMIPSMOVWaddr {
  2801  			break
  2802  		}
  2803  		off2 := ssa.AuxIntToInt32(v_0.AuxInt)
  2804  		sym2 := ssa.AuxToSym(v_0.Aux)
  2805  		ptr := v_0.Args[0]
  2806  		mem := v_1
  2807  		if !(ssa.CanMergeSym(sym1, sym2)) {
  2808  			break
  2809  		}
  2810  		v.Reset(ssaop.OpMIPSMOVBload)
  2811  		v.AuxInt = ssa.Int32ToAuxInt(off1 + off2)
  2812  		v.Aux = ssa.SymToAux(ssa.MergeSym(sym1, sym2))
  2813  		v.AddArg2(ptr, mem)
  2814  		return true
  2815  	}
  2816  	// match: (MOVBload [off] {sym} ptr (MOVBstore [off2] {sym2} ptr2 x _))
  2817  	// cond: sym == sym2 && off == off2 && ssa.IsSamePtr(ptr, ptr2)
  2818  	// result: (MOVBreg x)
  2819  	for {
  2820  		off := ssa.AuxIntToInt32(v.AuxInt)
  2821  		sym := ssa.AuxToSym(v.Aux)
  2822  		ptr := v_0
  2823  		if v_1.Op != ssaop.OpMIPSMOVBstore {
  2824  			break
  2825  		}
  2826  		off2 := ssa.AuxIntToInt32(v_1.AuxInt)
  2827  		sym2 := ssa.AuxToSym(v_1.Aux)
  2828  		x := v_1.Args[1]
  2829  		ptr2 := v_1.Args[0]
  2830  		if !(sym == sym2 && off == off2 && ssa.IsSamePtr(ptr, ptr2)) {
  2831  			break
  2832  		}
  2833  		v.Reset(ssaop.OpMIPSMOVBreg)
  2834  		v.AddArg(x)
  2835  		return true
  2836  	}
  2837  	return false
  2838  }
  2839  func rewriteValue_OpMIPSMOVBreg(v *ssa.Value) bool {
  2840  	v_0 := v.Args[0]
  2841  	b := v.Block
  2842  	// match: (MOVBreg x:(MOVBload _ _))
  2843  	// result: (MOVWreg x)
  2844  	for {
  2845  		x := v_0
  2846  		if x.Op != ssaop.OpMIPSMOVBload {
  2847  			break
  2848  		}
  2849  		v.Reset(ssaop.OpMIPSMOVWreg)
  2850  		v.AddArg(x)
  2851  		return true
  2852  	}
  2853  	// match: (MOVBreg x:(MOVBreg _))
  2854  	// result: (MOVWreg x)
  2855  	for {
  2856  		x := v_0
  2857  		if x.Op != ssaop.OpMIPSMOVBreg {
  2858  			break
  2859  		}
  2860  		v.Reset(ssaop.OpMIPSMOVWreg)
  2861  		v.AddArg(x)
  2862  		return true
  2863  	}
  2864  	// match: (MOVBreg <t> x:(MOVBUload [off] {sym} ptr mem))
  2865  	// cond: x.Uses == 1 && ssa.Clobber(x)
  2866  	// result: @x.Block (MOVBload <t> [off] {sym} ptr mem)
  2867  	for {
  2868  		t := v.Type
  2869  		x := v_0
  2870  		if x.Op != ssaop.OpMIPSMOVBUload {
  2871  			break
  2872  		}
  2873  		off := ssa.AuxIntToInt32(x.AuxInt)
  2874  		sym := ssa.AuxToSym(x.Aux)
  2875  		mem := x.Args[1]
  2876  		ptr := x.Args[0]
  2877  		if !(x.Uses == 1 && ssa.Clobber(x)) {
  2878  			break
  2879  		}
  2880  		b = x.Block
  2881  		v0 := b.NewValue0(x.Pos, ssaop.OpMIPSMOVBload, t)
  2882  		v.CopyOf(v0)
  2883  		v0.AuxInt = ssa.Int32ToAuxInt(off)
  2884  		v0.Aux = ssa.SymToAux(sym)
  2885  		v0.AddArg2(ptr, mem)
  2886  		return true
  2887  	}
  2888  	// match: (MOVBreg (ANDconst [c] x))
  2889  	// cond: c & 0x80 == 0
  2890  	// result: (ANDconst [c&0x7f] x)
  2891  	for {
  2892  		if v_0.Op != ssaop.OpMIPSANDconst {
  2893  			break
  2894  		}
  2895  		c := ssa.AuxIntToInt32(v_0.AuxInt)
  2896  		x := v_0.Args[0]
  2897  		if !(c&0x80 == 0) {
  2898  			break
  2899  		}
  2900  		v.Reset(ssaop.OpMIPSANDconst)
  2901  		v.AuxInt = ssa.Int32ToAuxInt(c & 0x7f)
  2902  		v.AddArg(x)
  2903  		return true
  2904  	}
  2905  	// match: (MOVBreg (MOVWconst [c]))
  2906  	// result: (MOVWconst [int32(int8(c))])
  2907  	for {
  2908  		if v_0.Op != ssaop.OpMIPSMOVWconst {
  2909  			break
  2910  		}
  2911  		c := ssa.AuxIntToInt32(v_0.AuxInt)
  2912  		v.Reset(ssaop.OpMIPSMOVWconst)
  2913  		v.AuxInt = ssa.Int32ToAuxInt(int32(int8(c)))
  2914  		return true
  2915  	}
  2916  	return false
  2917  }
  2918  func rewriteValue_OpMIPSMOVBstore(v *ssa.Value) bool {
  2919  	v_2 := v.Args[2]
  2920  	v_1 := v.Args[1]
  2921  	v_0 := v.Args[0]
  2922  	// match: (MOVBstore [off1] {sym} x:(ADDconst [off2] ptr) val mem)
  2923  	// cond: (ssa.Is16Bit(int64(off1+off2)) || x.Uses == 1)
  2924  	// result: (MOVBstore [off1+off2] {sym} ptr val mem)
  2925  	for {
  2926  		off1 := ssa.AuxIntToInt32(v.AuxInt)
  2927  		sym := ssa.AuxToSym(v.Aux)
  2928  		x := v_0
  2929  		if x.Op != ssaop.OpMIPSADDconst {
  2930  			break
  2931  		}
  2932  		off2 := ssa.AuxIntToInt32(x.AuxInt)
  2933  		ptr := x.Args[0]
  2934  		val := v_1
  2935  		mem := v_2
  2936  		if !(ssa.Is16Bit(int64(off1+off2)) || x.Uses == 1) {
  2937  			break
  2938  		}
  2939  		v.Reset(ssaop.OpMIPSMOVBstore)
  2940  		v.AuxInt = ssa.Int32ToAuxInt(off1 + off2)
  2941  		v.Aux = ssa.SymToAux(sym)
  2942  		v.AddArg3(ptr, val, mem)
  2943  		return true
  2944  	}
  2945  	// match: (MOVBstore [off1] {sym1} (MOVWaddr [off2] {sym2} ptr) val mem)
  2946  	// cond: ssa.CanMergeSym(sym1,sym2)
  2947  	// result: (MOVBstore [off1+off2] {ssa.MergeSym(sym1,sym2)} ptr val mem)
  2948  	for {
  2949  		off1 := ssa.AuxIntToInt32(v.AuxInt)
  2950  		sym1 := ssa.AuxToSym(v.Aux)
  2951  		if v_0.Op != ssaop.OpMIPSMOVWaddr {
  2952  			break
  2953  		}
  2954  		off2 := ssa.AuxIntToInt32(v_0.AuxInt)
  2955  		sym2 := ssa.AuxToSym(v_0.Aux)
  2956  		ptr := v_0.Args[0]
  2957  		val := v_1
  2958  		mem := v_2
  2959  		if !(ssa.CanMergeSym(sym1, sym2)) {
  2960  			break
  2961  		}
  2962  		v.Reset(ssaop.OpMIPSMOVBstore)
  2963  		v.AuxInt = ssa.Int32ToAuxInt(off1 + off2)
  2964  		v.Aux = ssa.SymToAux(ssa.MergeSym(sym1, sym2))
  2965  		v.AddArg3(ptr, val, mem)
  2966  		return true
  2967  	}
  2968  	// match: (MOVBstore [off] {sym} ptr (MOVWconst [0]) mem)
  2969  	// result: (MOVBstorezero [off] {sym} ptr mem)
  2970  	for {
  2971  		off := ssa.AuxIntToInt32(v.AuxInt)
  2972  		sym := ssa.AuxToSym(v.Aux)
  2973  		ptr := v_0
  2974  		if v_1.Op != ssaop.OpMIPSMOVWconst || ssa.AuxIntToInt32(v_1.AuxInt) != 0 {
  2975  			break
  2976  		}
  2977  		mem := v_2
  2978  		v.Reset(ssaop.OpMIPSMOVBstorezero)
  2979  		v.AuxInt = ssa.Int32ToAuxInt(off)
  2980  		v.Aux = ssa.SymToAux(sym)
  2981  		v.AddArg2(ptr, mem)
  2982  		return true
  2983  	}
  2984  	// match: (MOVBstore [off] {sym} ptr (MOVBreg x) mem)
  2985  	// result: (MOVBstore [off] {sym} ptr x mem)
  2986  	for {
  2987  		off := ssa.AuxIntToInt32(v.AuxInt)
  2988  		sym := ssa.AuxToSym(v.Aux)
  2989  		ptr := v_0
  2990  		if v_1.Op != ssaop.OpMIPSMOVBreg {
  2991  			break
  2992  		}
  2993  		x := v_1.Args[0]
  2994  		mem := v_2
  2995  		v.Reset(ssaop.OpMIPSMOVBstore)
  2996  		v.AuxInt = ssa.Int32ToAuxInt(off)
  2997  		v.Aux = ssa.SymToAux(sym)
  2998  		v.AddArg3(ptr, x, mem)
  2999  		return true
  3000  	}
  3001  	// match: (MOVBstore [off] {sym} ptr (MOVBUreg x) mem)
  3002  	// result: (MOVBstore [off] {sym} ptr x mem)
  3003  	for {
  3004  		off := ssa.AuxIntToInt32(v.AuxInt)
  3005  		sym := ssa.AuxToSym(v.Aux)
  3006  		ptr := v_0
  3007  		if v_1.Op != ssaop.OpMIPSMOVBUreg {
  3008  			break
  3009  		}
  3010  		x := v_1.Args[0]
  3011  		mem := v_2
  3012  		v.Reset(ssaop.OpMIPSMOVBstore)
  3013  		v.AuxInt = ssa.Int32ToAuxInt(off)
  3014  		v.Aux = ssa.SymToAux(sym)
  3015  		v.AddArg3(ptr, x, mem)
  3016  		return true
  3017  	}
  3018  	// match: (MOVBstore [off] {sym} ptr (MOVHreg x) mem)
  3019  	// result: (MOVBstore [off] {sym} ptr x mem)
  3020  	for {
  3021  		off := ssa.AuxIntToInt32(v.AuxInt)
  3022  		sym := ssa.AuxToSym(v.Aux)
  3023  		ptr := v_0
  3024  		if v_1.Op != ssaop.OpMIPSMOVHreg {
  3025  			break
  3026  		}
  3027  		x := v_1.Args[0]
  3028  		mem := v_2
  3029  		v.Reset(ssaop.OpMIPSMOVBstore)
  3030  		v.AuxInt = ssa.Int32ToAuxInt(off)
  3031  		v.Aux = ssa.SymToAux(sym)
  3032  		v.AddArg3(ptr, x, mem)
  3033  		return true
  3034  	}
  3035  	// match: (MOVBstore [off] {sym} ptr (MOVHUreg x) mem)
  3036  	// result: (MOVBstore [off] {sym} ptr x mem)
  3037  	for {
  3038  		off := ssa.AuxIntToInt32(v.AuxInt)
  3039  		sym := ssa.AuxToSym(v.Aux)
  3040  		ptr := v_0
  3041  		if v_1.Op != ssaop.OpMIPSMOVHUreg {
  3042  			break
  3043  		}
  3044  		x := v_1.Args[0]
  3045  		mem := v_2
  3046  		v.Reset(ssaop.OpMIPSMOVBstore)
  3047  		v.AuxInt = ssa.Int32ToAuxInt(off)
  3048  		v.Aux = ssa.SymToAux(sym)
  3049  		v.AddArg3(ptr, x, mem)
  3050  		return true
  3051  	}
  3052  	// match: (MOVBstore [off] {sym} ptr (MOVWreg x) mem)
  3053  	// result: (MOVBstore [off] {sym} ptr x mem)
  3054  	for {
  3055  		off := ssa.AuxIntToInt32(v.AuxInt)
  3056  		sym := ssa.AuxToSym(v.Aux)
  3057  		ptr := v_0
  3058  		if v_1.Op != ssaop.OpMIPSMOVWreg {
  3059  			break
  3060  		}
  3061  		x := v_1.Args[0]
  3062  		mem := v_2
  3063  		v.Reset(ssaop.OpMIPSMOVBstore)
  3064  		v.AuxInt = ssa.Int32ToAuxInt(off)
  3065  		v.Aux = ssa.SymToAux(sym)
  3066  		v.AddArg3(ptr, x, mem)
  3067  		return true
  3068  	}
  3069  	return false
  3070  }
  3071  func rewriteValue_OpMIPSMOVBstorezero(v *ssa.Value) bool {
  3072  	v_1 := v.Args[1]
  3073  	v_0 := v.Args[0]
  3074  	// match: (MOVBstorezero [off1] {sym} x:(ADDconst [off2] ptr) mem)
  3075  	// cond: (ssa.Is16Bit(int64(off1+off2)) || x.Uses == 1)
  3076  	// result: (MOVBstorezero [off1+off2] {sym} ptr mem)
  3077  	for {
  3078  		off1 := ssa.AuxIntToInt32(v.AuxInt)
  3079  		sym := ssa.AuxToSym(v.Aux)
  3080  		x := v_0
  3081  		if x.Op != ssaop.OpMIPSADDconst {
  3082  			break
  3083  		}
  3084  		off2 := ssa.AuxIntToInt32(x.AuxInt)
  3085  		ptr := x.Args[0]
  3086  		mem := v_1
  3087  		if !(ssa.Is16Bit(int64(off1+off2)) || x.Uses == 1) {
  3088  			break
  3089  		}
  3090  		v.Reset(ssaop.OpMIPSMOVBstorezero)
  3091  		v.AuxInt = ssa.Int32ToAuxInt(off1 + off2)
  3092  		v.Aux = ssa.SymToAux(sym)
  3093  		v.AddArg2(ptr, mem)
  3094  		return true
  3095  	}
  3096  	// match: (MOVBstorezero [off1] {sym1} (MOVWaddr [off2] {sym2} ptr) mem)
  3097  	// cond: ssa.CanMergeSym(sym1,sym2)
  3098  	// result: (MOVBstorezero [off1+off2] {ssa.MergeSym(sym1,sym2)} ptr mem)
  3099  	for {
  3100  		off1 := ssa.AuxIntToInt32(v.AuxInt)
  3101  		sym1 := ssa.AuxToSym(v.Aux)
  3102  		if v_0.Op != ssaop.OpMIPSMOVWaddr {
  3103  			break
  3104  		}
  3105  		off2 := ssa.AuxIntToInt32(v_0.AuxInt)
  3106  		sym2 := ssa.AuxToSym(v_0.Aux)
  3107  		ptr := v_0.Args[0]
  3108  		mem := v_1
  3109  		if !(ssa.CanMergeSym(sym1, sym2)) {
  3110  			break
  3111  		}
  3112  		v.Reset(ssaop.OpMIPSMOVBstorezero)
  3113  		v.AuxInt = ssa.Int32ToAuxInt(off1 + off2)
  3114  		v.Aux = ssa.SymToAux(ssa.MergeSym(sym1, sym2))
  3115  		v.AddArg2(ptr, mem)
  3116  		return true
  3117  	}
  3118  	return false
  3119  }
  3120  func rewriteValue_OpMIPSMOVDload(v *ssa.Value) bool {
  3121  	v_1 := v.Args[1]
  3122  	v_0 := v.Args[0]
  3123  	// match: (MOVDload [off1] {sym} x:(ADDconst [off2] ptr) mem)
  3124  	// cond: (ssa.Is16Bit(int64(off1+off2)) || x.Uses == 1)
  3125  	// result: (MOVDload [off1+off2] {sym} ptr mem)
  3126  	for {
  3127  		off1 := ssa.AuxIntToInt32(v.AuxInt)
  3128  		sym := ssa.AuxToSym(v.Aux)
  3129  		x := v_0
  3130  		if x.Op != ssaop.OpMIPSADDconst {
  3131  			break
  3132  		}
  3133  		off2 := ssa.AuxIntToInt32(x.AuxInt)
  3134  		ptr := x.Args[0]
  3135  		mem := v_1
  3136  		if !(ssa.Is16Bit(int64(off1+off2)) || x.Uses == 1) {
  3137  			break
  3138  		}
  3139  		v.Reset(ssaop.OpMIPSMOVDload)
  3140  		v.AuxInt = ssa.Int32ToAuxInt(off1 + off2)
  3141  		v.Aux = ssa.SymToAux(sym)
  3142  		v.AddArg2(ptr, mem)
  3143  		return true
  3144  	}
  3145  	// match: (MOVDload [off1] {sym1} (MOVWaddr [off2] {sym2} ptr) mem)
  3146  	// cond: ssa.CanMergeSym(sym1,sym2)
  3147  	// result: (MOVDload [off1+off2] {ssa.MergeSym(sym1,sym2)} ptr mem)
  3148  	for {
  3149  		off1 := ssa.AuxIntToInt32(v.AuxInt)
  3150  		sym1 := ssa.AuxToSym(v.Aux)
  3151  		if v_0.Op != ssaop.OpMIPSMOVWaddr {
  3152  			break
  3153  		}
  3154  		off2 := ssa.AuxIntToInt32(v_0.AuxInt)
  3155  		sym2 := ssa.AuxToSym(v_0.Aux)
  3156  		ptr := v_0.Args[0]
  3157  		mem := v_1
  3158  		if !(ssa.CanMergeSym(sym1, sym2)) {
  3159  			break
  3160  		}
  3161  		v.Reset(ssaop.OpMIPSMOVDload)
  3162  		v.AuxInt = ssa.Int32ToAuxInt(off1 + off2)
  3163  		v.Aux = ssa.SymToAux(ssa.MergeSym(sym1, sym2))
  3164  		v.AddArg2(ptr, mem)
  3165  		return true
  3166  	}
  3167  	// match: (MOVDload [off] {sym} ptr (MOVDstore [off2] {sym2} ptr2 x _))
  3168  	// cond: sym == sym2 && off == off2 && ssa.IsSamePtr(ptr, ptr2)
  3169  	// result: x
  3170  	for {
  3171  		off := ssa.AuxIntToInt32(v.AuxInt)
  3172  		sym := ssa.AuxToSym(v.Aux)
  3173  		ptr := v_0
  3174  		if v_1.Op != ssaop.OpMIPSMOVDstore {
  3175  			break
  3176  		}
  3177  		off2 := ssa.AuxIntToInt32(v_1.AuxInt)
  3178  		sym2 := ssa.AuxToSym(v_1.Aux)
  3179  		x := v_1.Args[1]
  3180  		ptr2 := v_1.Args[0]
  3181  		if !(sym == sym2 && off == off2 && ssa.IsSamePtr(ptr, ptr2)) {
  3182  			break
  3183  		}
  3184  		v.CopyOf(x)
  3185  		return true
  3186  	}
  3187  	return false
  3188  }
  3189  func rewriteValue_OpMIPSMOVDstore(v *ssa.Value) bool {
  3190  	v_2 := v.Args[2]
  3191  	v_1 := v.Args[1]
  3192  	v_0 := v.Args[0]
  3193  	// match: (MOVDstore [off1] {sym} x:(ADDconst [off2] ptr) val mem)
  3194  	// cond: (ssa.Is16Bit(int64(off1+off2)) || x.Uses == 1)
  3195  	// result: (MOVDstore [off1+off2] {sym} ptr val mem)
  3196  	for {
  3197  		off1 := ssa.AuxIntToInt32(v.AuxInt)
  3198  		sym := ssa.AuxToSym(v.Aux)
  3199  		x := v_0
  3200  		if x.Op != ssaop.OpMIPSADDconst {
  3201  			break
  3202  		}
  3203  		off2 := ssa.AuxIntToInt32(x.AuxInt)
  3204  		ptr := x.Args[0]
  3205  		val := v_1
  3206  		mem := v_2
  3207  		if !(ssa.Is16Bit(int64(off1+off2)) || x.Uses == 1) {
  3208  			break
  3209  		}
  3210  		v.Reset(ssaop.OpMIPSMOVDstore)
  3211  		v.AuxInt = ssa.Int32ToAuxInt(off1 + off2)
  3212  		v.Aux = ssa.SymToAux(sym)
  3213  		v.AddArg3(ptr, val, mem)
  3214  		return true
  3215  	}
  3216  	// match: (MOVDstore [off1] {sym1} (MOVWaddr [off2] {sym2} ptr) val mem)
  3217  	// cond: ssa.CanMergeSym(sym1,sym2)
  3218  	// result: (MOVDstore [off1+off2] {ssa.MergeSym(sym1,sym2)} ptr val mem)
  3219  	for {
  3220  		off1 := ssa.AuxIntToInt32(v.AuxInt)
  3221  		sym1 := ssa.AuxToSym(v.Aux)
  3222  		if v_0.Op != ssaop.OpMIPSMOVWaddr {
  3223  			break
  3224  		}
  3225  		off2 := ssa.AuxIntToInt32(v_0.AuxInt)
  3226  		sym2 := ssa.AuxToSym(v_0.Aux)
  3227  		ptr := v_0.Args[0]
  3228  		val := v_1
  3229  		mem := v_2
  3230  		if !(ssa.CanMergeSym(sym1, sym2)) {
  3231  			break
  3232  		}
  3233  		v.Reset(ssaop.OpMIPSMOVDstore)
  3234  		v.AuxInt = ssa.Int32ToAuxInt(off1 + off2)
  3235  		v.Aux = ssa.SymToAux(ssa.MergeSym(sym1, sym2))
  3236  		v.AddArg3(ptr, val, mem)
  3237  		return true
  3238  	}
  3239  	return false
  3240  }
  3241  func rewriteValue_OpMIPSMOVFload(v *ssa.Value) bool {
  3242  	v_1 := v.Args[1]
  3243  	v_0 := v.Args[0]
  3244  	// match: (MOVFload [off] {sym} ptr (MOVWstore [off] {sym} ptr val _))
  3245  	// result: (MOVWgpfp val)
  3246  	for {
  3247  		off := ssa.AuxIntToInt32(v.AuxInt)
  3248  		sym := ssa.AuxToSym(v.Aux)
  3249  		ptr := v_0
  3250  		if v_1.Op != ssaop.OpMIPSMOVWstore || ssa.AuxIntToInt32(v_1.AuxInt) != off || ssa.AuxToSym(v_1.Aux) != sym {
  3251  			break
  3252  		}
  3253  		val := v_1.Args[1]
  3254  		if ptr != v_1.Args[0] {
  3255  			break
  3256  		}
  3257  		v.Reset(ssaop.OpMIPSMOVWgpfp)
  3258  		v.AddArg(val)
  3259  		return true
  3260  	}
  3261  	// match: (MOVFload [off1] {sym} x:(ADDconst [off2] ptr) mem)
  3262  	// cond: (ssa.Is16Bit(int64(off1+off2)) || x.Uses == 1)
  3263  	// result: (MOVFload [off1+off2] {sym} ptr mem)
  3264  	for {
  3265  		off1 := ssa.AuxIntToInt32(v.AuxInt)
  3266  		sym := ssa.AuxToSym(v.Aux)
  3267  		x := v_0
  3268  		if x.Op != ssaop.OpMIPSADDconst {
  3269  			break
  3270  		}
  3271  		off2 := ssa.AuxIntToInt32(x.AuxInt)
  3272  		ptr := x.Args[0]
  3273  		mem := v_1
  3274  		if !(ssa.Is16Bit(int64(off1+off2)) || x.Uses == 1) {
  3275  			break
  3276  		}
  3277  		v.Reset(ssaop.OpMIPSMOVFload)
  3278  		v.AuxInt = ssa.Int32ToAuxInt(off1 + off2)
  3279  		v.Aux = ssa.SymToAux(sym)
  3280  		v.AddArg2(ptr, mem)
  3281  		return true
  3282  	}
  3283  	// match: (MOVFload [off1] {sym1} (MOVWaddr [off2] {sym2} ptr) mem)
  3284  	// cond: ssa.CanMergeSym(sym1,sym2)
  3285  	// result: (MOVFload [off1+off2] {ssa.MergeSym(sym1,sym2)} ptr mem)
  3286  	for {
  3287  		off1 := ssa.AuxIntToInt32(v.AuxInt)
  3288  		sym1 := ssa.AuxToSym(v.Aux)
  3289  		if v_0.Op != ssaop.OpMIPSMOVWaddr {
  3290  			break
  3291  		}
  3292  		off2 := ssa.AuxIntToInt32(v_0.AuxInt)
  3293  		sym2 := ssa.AuxToSym(v_0.Aux)
  3294  		ptr := v_0.Args[0]
  3295  		mem := v_1
  3296  		if !(ssa.CanMergeSym(sym1, sym2)) {
  3297  			break
  3298  		}
  3299  		v.Reset(ssaop.OpMIPSMOVFload)
  3300  		v.AuxInt = ssa.Int32ToAuxInt(off1 + off2)
  3301  		v.Aux = ssa.SymToAux(ssa.MergeSym(sym1, sym2))
  3302  		v.AddArg2(ptr, mem)
  3303  		return true
  3304  	}
  3305  	// match: (MOVFload [off] {sym} ptr (MOVFstore [off2] {sym2} ptr2 x _))
  3306  	// cond: sym == sym2 && off == off2 && ssa.IsSamePtr(ptr, ptr2)
  3307  	// result: x
  3308  	for {
  3309  		off := ssa.AuxIntToInt32(v.AuxInt)
  3310  		sym := ssa.AuxToSym(v.Aux)
  3311  		ptr := v_0
  3312  		if v_1.Op != ssaop.OpMIPSMOVFstore {
  3313  			break
  3314  		}
  3315  		off2 := ssa.AuxIntToInt32(v_1.AuxInt)
  3316  		sym2 := ssa.AuxToSym(v_1.Aux)
  3317  		x := v_1.Args[1]
  3318  		ptr2 := v_1.Args[0]
  3319  		if !(sym == sym2 && off == off2 && ssa.IsSamePtr(ptr, ptr2)) {
  3320  			break
  3321  		}
  3322  		v.CopyOf(x)
  3323  		return true
  3324  	}
  3325  	return false
  3326  }
  3327  func rewriteValue_OpMIPSMOVFstore(v *ssa.Value) bool {
  3328  	v_2 := v.Args[2]
  3329  	v_1 := v.Args[1]
  3330  	v_0 := v.Args[0]
  3331  	// match: (MOVFstore [off] {sym} ptr (MOVWgpfp val) mem)
  3332  	// result: (MOVWstore [off] {sym} ptr val mem)
  3333  	for {
  3334  		off := ssa.AuxIntToInt32(v.AuxInt)
  3335  		sym := ssa.AuxToSym(v.Aux)
  3336  		ptr := v_0
  3337  		if v_1.Op != ssaop.OpMIPSMOVWgpfp {
  3338  			break
  3339  		}
  3340  		val := v_1.Args[0]
  3341  		mem := v_2
  3342  		v.Reset(ssaop.OpMIPSMOVWstore)
  3343  		v.AuxInt = ssa.Int32ToAuxInt(off)
  3344  		v.Aux = ssa.SymToAux(sym)
  3345  		v.AddArg3(ptr, val, mem)
  3346  		return true
  3347  	}
  3348  	// match: (MOVFstore [off1] {sym} x:(ADDconst [off2] ptr) val mem)
  3349  	// cond: (ssa.Is16Bit(int64(off1+off2)) || x.Uses == 1)
  3350  	// result: (MOVFstore [off1+off2] {sym} ptr val mem)
  3351  	for {
  3352  		off1 := ssa.AuxIntToInt32(v.AuxInt)
  3353  		sym := ssa.AuxToSym(v.Aux)
  3354  		x := v_0
  3355  		if x.Op != ssaop.OpMIPSADDconst {
  3356  			break
  3357  		}
  3358  		off2 := ssa.AuxIntToInt32(x.AuxInt)
  3359  		ptr := x.Args[0]
  3360  		val := v_1
  3361  		mem := v_2
  3362  		if !(ssa.Is16Bit(int64(off1+off2)) || x.Uses == 1) {
  3363  			break
  3364  		}
  3365  		v.Reset(ssaop.OpMIPSMOVFstore)
  3366  		v.AuxInt = ssa.Int32ToAuxInt(off1 + off2)
  3367  		v.Aux = ssa.SymToAux(sym)
  3368  		v.AddArg3(ptr, val, mem)
  3369  		return true
  3370  	}
  3371  	// match: (MOVFstore [off1] {sym1} (MOVWaddr [off2] {sym2} ptr) val mem)
  3372  	// cond: ssa.CanMergeSym(sym1,sym2)
  3373  	// result: (MOVFstore [off1+off2] {ssa.MergeSym(sym1,sym2)} ptr val mem)
  3374  	for {
  3375  		off1 := ssa.AuxIntToInt32(v.AuxInt)
  3376  		sym1 := ssa.AuxToSym(v.Aux)
  3377  		if v_0.Op != ssaop.OpMIPSMOVWaddr {
  3378  			break
  3379  		}
  3380  		off2 := ssa.AuxIntToInt32(v_0.AuxInt)
  3381  		sym2 := ssa.AuxToSym(v_0.Aux)
  3382  		ptr := v_0.Args[0]
  3383  		val := v_1
  3384  		mem := v_2
  3385  		if !(ssa.CanMergeSym(sym1, sym2)) {
  3386  			break
  3387  		}
  3388  		v.Reset(ssaop.OpMIPSMOVFstore)
  3389  		v.AuxInt = ssa.Int32ToAuxInt(off1 + off2)
  3390  		v.Aux = ssa.SymToAux(ssa.MergeSym(sym1, sym2))
  3391  		v.AddArg3(ptr, val, mem)
  3392  		return true
  3393  	}
  3394  	return false
  3395  }
  3396  func rewriteValue_OpMIPSMOVHUload(v *ssa.Value) bool {
  3397  	v_1 := v.Args[1]
  3398  	v_0 := v.Args[0]
  3399  	// match: (MOVHUload [off] {sym} ptr (MOVHstore [off] {sym} ptr x _))
  3400  	// result: (MOVHUreg x)
  3401  	for {
  3402  		off := ssa.AuxIntToInt32(v.AuxInt)
  3403  		sym := ssa.AuxToSym(v.Aux)
  3404  		ptr := v_0
  3405  		if v_1.Op != ssaop.OpMIPSMOVHstore || ssa.AuxIntToInt32(v_1.AuxInt) != off || ssa.AuxToSym(v_1.Aux) != sym {
  3406  			break
  3407  		}
  3408  		x := v_1.Args[1]
  3409  		if ptr != v_1.Args[0] {
  3410  			break
  3411  		}
  3412  		v.Reset(ssaop.OpMIPSMOVHUreg)
  3413  		v.AddArg(x)
  3414  		return true
  3415  	}
  3416  	// match: (MOVHUload [off1] {sym} x:(ADDconst [off2] ptr) mem)
  3417  	// cond: (ssa.Is16Bit(int64(off1+off2)) || x.Uses == 1)
  3418  	// result: (MOVHUload [off1+off2] {sym} ptr mem)
  3419  	for {
  3420  		off1 := ssa.AuxIntToInt32(v.AuxInt)
  3421  		sym := ssa.AuxToSym(v.Aux)
  3422  		x := v_0
  3423  		if x.Op != ssaop.OpMIPSADDconst {
  3424  			break
  3425  		}
  3426  		off2 := ssa.AuxIntToInt32(x.AuxInt)
  3427  		ptr := x.Args[0]
  3428  		mem := v_1
  3429  		if !(ssa.Is16Bit(int64(off1+off2)) || x.Uses == 1) {
  3430  			break
  3431  		}
  3432  		v.Reset(ssaop.OpMIPSMOVHUload)
  3433  		v.AuxInt = ssa.Int32ToAuxInt(off1 + off2)
  3434  		v.Aux = ssa.SymToAux(sym)
  3435  		v.AddArg2(ptr, mem)
  3436  		return true
  3437  	}
  3438  	// match: (MOVHUload [off1] {sym1} (MOVWaddr [off2] {sym2} ptr) mem)
  3439  	// cond: ssa.CanMergeSym(sym1,sym2)
  3440  	// result: (MOVHUload [off1+off2] {ssa.MergeSym(sym1,sym2)} ptr mem)
  3441  	for {
  3442  		off1 := ssa.AuxIntToInt32(v.AuxInt)
  3443  		sym1 := ssa.AuxToSym(v.Aux)
  3444  		if v_0.Op != ssaop.OpMIPSMOVWaddr {
  3445  			break
  3446  		}
  3447  		off2 := ssa.AuxIntToInt32(v_0.AuxInt)
  3448  		sym2 := ssa.AuxToSym(v_0.Aux)
  3449  		ptr := v_0.Args[0]
  3450  		mem := v_1
  3451  		if !(ssa.CanMergeSym(sym1, sym2)) {
  3452  			break
  3453  		}
  3454  		v.Reset(ssaop.OpMIPSMOVHUload)
  3455  		v.AuxInt = ssa.Int32ToAuxInt(off1 + off2)
  3456  		v.Aux = ssa.SymToAux(ssa.MergeSym(sym1, sym2))
  3457  		v.AddArg2(ptr, mem)
  3458  		return true
  3459  	}
  3460  	// match: (MOVHUload [off] {sym} ptr (MOVHstore [off2] {sym2} ptr2 x _))
  3461  	// cond: sym == sym2 && off == off2 && ssa.IsSamePtr(ptr, ptr2)
  3462  	// result: (MOVHUreg x)
  3463  	for {
  3464  		off := ssa.AuxIntToInt32(v.AuxInt)
  3465  		sym := ssa.AuxToSym(v.Aux)
  3466  		ptr := v_0
  3467  		if v_1.Op != ssaop.OpMIPSMOVHstore {
  3468  			break
  3469  		}
  3470  		off2 := ssa.AuxIntToInt32(v_1.AuxInt)
  3471  		sym2 := ssa.AuxToSym(v_1.Aux)
  3472  		x := v_1.Args[1]
  3473  		ptr2 := v_1.Args[0]
  3474  		if !(sym == sym2 && off == off2 && ssa.IsSamePtr(ptr, ptr2)) {
  3475  			break
  3476  		}
  3477  		v.Reset(ssaop.OpMIPSMOVHUreg)
  3478  		v.AddArg(x)
  3479  		return true
  3480  	}
  3481  	return false
  3482  }
  3483  func rewriteValue_OpMIPSMOVHUreg(v *ssa.Value) bool {
  3484  	v_0 := v.Args[0]
  3485  	b := v.Block
  3486  	// match: (MOVHUreg x:(MOVBUload _ _))
  3487  	// result: (MOVWreg x)
  3488  	for {
  3489  		x := v_0
  3490  		if x.Op != ssaop.OpMIPSMOVBUload {
  3491  			break
  3492  		}
  3493  		v.Reset(ssaop.OpMIPSMOVWreg)
  3494  		v.AddArg(x)
  3495  		return true
  3496  	}
  3497  	// match: (MOVHUreg x:(MOVHUload _ _))
  3498  	// result: (MOVWreg x)
  3499  	for {
  3500  		x := v_0
  3501  		if x.Op != ssaop.OpMIPSMOVHUload {
  3502  			break
  3503  		}
  3504  		v.Reset(ssaop.OpMIPSMOVWreg)
  3505  		v.AddArg(x)
  3506  		return true
  3507  	}
  3508  	// match: (MOVHUreg x:(MOVBUreg _))
  3509  	// result: (MOVWreg x)
  3510  	for {
  3511  		x := v_0
  3512  		if x.Op != ssaop.OpMIPSMOVBUreg {
  3513  			break
  3514  		}
  3515  		v.Reset(ssaop.OpMIPSMOVWreg)
  3516  		v.AddArg(x)
  3517  		return true
  3518  	}
  3519  	// match: (MOVHUreg x:(MOVHUreg _))
  3520  	// result: (MOVWreg x)
  3521  	for {
  3522  		x := v_0
  3523  		if x.Op != ssaop.OpMIPSMOVHUreg {
  3524  			break
  3525  		}
  3526  		v.Reset(ssaop.OpMIPSMOVWreg)
  3527  		v.AddArg(x)
  3528  		return true
  3529  	}
  3530  	// match: (MOVHUreg <t> x:(MOVHload [off] {sym} ptr mem))
  3531  	// cond: x.Uses == 1 && ssa.Clobber(x)
  3532  	// result: @x.Block (MOVHUload <t> [off] {sym} ptr mem)
  3533  	for {
  3534  		t := v.Type
  3535  		x := v_0
  3536  		if x.Op != ssaop.OpMIPSMOVHload {
  3537  			break
  3538  		}
  3539  		off := ssa.AuxIntToInt32(x.AuxInt)
  3540  		sym := ssa.AuxToSym(x.Aux)
  3541  		mem := x.Args[1]
  3542  		ptr := x.Args[0]
  3543  		if !(x.Uses == 1 && ssa.Clobber(x)) {
  3544  			break
  3545  		}
  3546  		b = x.Block
  3547  		v0 := b.NewValue0(x.Pos, ssaop.OpMIPSMOVHUload, t)
  3548  		v.CopyOf(v0)
  3549  		v0.AuxInt = ssa.Int32ToAuxInt(off)
  3550  		v0.Aux = ssa.SymToAux(sym)
  3551  		v0.AddArg2(ptr, mem)
  3552  		return true
  3553  	}
  3554  	// match: (MOVHUreg (ANDconst [c] x))
  3555  	// result: (ANDconst [c&0xffff] x)
  3556  	for {
  3557  		if v_0.Op != ssaop.OpMIPSANDconst {
  3558  			break
  3559  		}
  3560  		c := ssa.AuxIntToInt32(v_0.AuxInt)
  3561  		x := v_0.Args[0]
  3562  		v.Reset(ssaop.OpMIPSANDconst)
  3563  		v.AuxInt = ssa.Int32ToAuxInt(c & 0xffff)
  3564  		v.AddArg(x)
  3565  		return true
  3566  	}
  3567  	// match: (MOVHUreg (MOVWconst [c]))
  3568  	// result: (MOVWconst [int32(uint16(c))])
  3569  	for {
  3570  		if v_0.Op != ssaop.OpMIPSMOVWconst {
  3571  			break
  3572  		}
  3573  		c := ssa.AuxIntToInt32(v_0.AuxInt)
  3574  		v.Reset(ssaop.OpMIPSMOVWconst)
  3575  		v.AuxInt = ssa.Int32ToAuxInt(int32(uint16(c)))
  3576  		return true
  3577  	}
  3578  	return false
  3579  }
  3580  func rewriteValue_OpMIPSMOVHload(v *ssa.Value) bool {
  3581  	v_1 := v.Args[1]
  3582  	v_0 := v.Args[0]
  3583  	// match: (MOVHload [off] {sym} ptr (MOVHstore [off] {sym} ptr x _))
  3584  	// result: (MOVHreg x)
  3585  	for {
  3586  		off := ssa.AuxIntToInt32(v.AuxInt)
  3587  		sym := ssa.AuxToSym(v.Aux)
  3588  		ptr := v_0
  3589  		if v_1.Op != ssaop.OpMIPSMOVHstore || ssa.AuxIntToInt32(v_1.AuxInt) != off || ssa.AuxToSym(v_1.Aux) != sym {
  3590  			break
  3591  		}
  3592  		x := v_1.Args[1]
  3593  		if ptr != v_1.Args[0] {
  3594  			break
  3595  		}
  3596  		v.Reset(ssaop.OpMIPSMOVHreg)
  3597  		v.AddArg(x)
  3598  		return true
  3599  	}
  3600  	// match: (MOVHload [off1] {sym} x:(ADDconst [off2] ptr) mem)
  3601  	// cond: (ssa.Is16Bit(int64(off1+off2)) || x.Uses == 1)
  3602  	// result: (MOVHload [off1+off2] {sym} ptr mem)
  3603  	for {
  3604  		off1 := ssa.AuxIntToInt32(v.AuxInt)
  3605  		sym := ssa.AuxToSym(v.Aux)
  3606  		x := v_0
  3607  		if x.Op != ssaop.OpMIPSADDconst {
  3608  			break
  3609  		}
  3610  		off2 := ssa.AuxIntToInt32(x.AuxInt)
  3611  		ptr := x.Args[0]
  3612  		mem := v_1
  3613  		if !(ssa.Is16Bit(int64(off1+off2)) || x.Uses == 1) {
  3614  			break
  3615  		}
  3616  		v.Reset(ssaop.OpMIPSMOVHload)
  3617  		v.AuxInt = ssa.Int32ToAuxInt(off1 + off2)
  3618  		v.Aux = ssa.SymToAux(sym)
  3619  		v.AddArg2(ptr, mem)
  3620  		return true
  3621  	}
  3622  	// match: (MOVHload [off1] {sym1} (MOVWaddr [off2] {sym2} ptr) mem)
  3623  	// cond: ssa.CanMergeSym(sym1,sym2)
  3624  	// result: (MOVHload [off1+off2] {ssa.MergeSym(sym1,sym2)} ptr mem)
  3625  	for {
  3626  		off1 := ssa.AuxIntToInt32(v.AuxInt)
  3627  		sym1 := ssa.AuxToSym(v.Aux)
  3628  		if v_0.Op != ssaop.OpMIPSMOVWaddr {
  3629  			break
  3630  		}
  3631  		off2 := ssa.AuxIntToInt32(v_0.AuxInt)
  3632  		sym2 := ssa.AuxToSym(v_0.Aux)
  3633  		ptr := v_0.Args[0]
  3634  		mem := v_1
  3635  		if !(ssa.CanMergeSym(sym1, sym2)) {
  3636  			break
  3637  		}
  3638  		v.Reset(ssaop.OpMIPSMOVHload)
  3639  		v.AuxInt = ssa.Int32ToAuxInt(off1 + off2)
  3640  		v.Aux = ssa.SymToAux(ssa.MergeSym(sym1, sym2))
  3641  		v.AddArg2(ptr, mem)
  3642  		return true
  3643  	}
  3644  	// match: (MOVHload [off] {sym} ptr (MOVHstore [off2] {sym2} ptr2 x _))
  3645  	// cond: sym == sym2 && off == off2 && ssa.IsSamePtr(ptr, ptr2)
  3646  	// result: (MOVHreg x)
  3647  	for {
  3648  		off := ssa.AuxIntToInt32(v.AuxInt)
  3649  		sym := ssa.AuxToSym(v.Aux)
  3650  		ptr := v_0
  3651  		if v_1.Op != ssaop.OpMIPSMOVHstore {
  3652  			break
  3653  		}
  3654  		off2 := ssa.AuxIntToInt32(v_1.AuxInt)
  3655  		sym2 := ssa.AuxToSym(v_1.Aux)
  3656  		x := v_1.Args[1]
  3657  		ptr2 := v_1.Args[0]
  3658  		if !(sym == sym2 && off == off2 && ssa.IsSamePtr(ptr, ptr2)) {
  3659  			break
  3660  		}
  3661  		v.Reset(ssaop.OpMIPSMOVHreg)
  3662  		v.AddArg(x)
  3663  		return true
  3664  	}
  3665  	return false
  3666  }
  3667  func rewriteValue_OpMIPSMOVHreg(v *ssa.Value) bool {
  3668  	v_0 := v.Args[0]
  3669  	b := v.Block
  3670  	// match: (MOVHreg x:(MOVBload _ _))
  3671  	// result: (MOVWreg x)
  3672  	for {
  3673  		x := v_0
  3674  		if x.Op != ssaop.OpMIPSMOVBload {
  3675  			break
  3676  		}
  3677  		v.Reset(ssaop.OpMIPSMOVWreg)
  3678  		v.AddArg(x)
  3679  		return true
  3680  	}
  3681  	// match: (MOVHreg x:(MOVBUload _ _))
  3682  	// result: (MOVWreg x)
  3683  	for {
  3684  		x := v_0
  3685  		if x.Op != ssaop.OpMIPSMOVBUload {
  3686  			break
  3687  		}
  3688  		v.Reset(ssaop.OpMIPSMOVWreg)
  3689  		v.AddArg(x)
  3690  		return true
  3691  	}
  3692  	// match: (MOVHreg x:(MOVHload _ _))
  3693  	// result: (MOVWreg x)
  3694  	for {
  3695  		x := v_0
  3696  		if x.Op != ssaop.OpMIPSMOVHload {
  3697  			break
  3698  		}
  3699  		v.Reset(ssaop.OpMIPSMOVWreg)
  3700  		v.AddArg(x)
  3701  		return true
  3702  	}
  3703  	// match: (MOVHreg x:(MOVBreg _))
  3704  	// result: (MOVWreg x)
  3705  	for {
  3706  		x := v_0
  3707  		if x.Op != ssaop.OpMIPSMOVBreg {
  3708  			break
  3709  		}
  3710  		v.Reset(ssaop.OpMIPSMOVWreg)
  3711  		v.AddArg(x)
  3712  		return true
  3713  	}
  3714  	// match: (MOVHreg x:(MOVBUreg _))
  3715  	// result: (MOVWreg x)
  3716  	for {
  3717  		x := v_0
  3718  		if x.Op != ssaop.OpMIPSMOVBUreg {
  3719  			break
  3720  		}
  3721  		v.Reset(ssaop.OpMIPSMOVWreg)
  3722  		v.AddArg(x)
  3723  		return true
  3724  	}
  3725  	// match: (MOVHreg x:(MOVHreg _))
  3726  	// result: (MOVWreg x)
  3727  	for {
  3728  		x := v_0
  3729  		if x.Op != ssaop.OpMIPSMOVHreg {
  3730  			break
  3731  		}
  3732  		v.Reset(ssaop.OpMIPSMOVWreg)
  3733  		v.AddArg(x)
  3734  		return true
  3735  	}
  3736  	// match: (MOVHreg <t> x:(MOVHUload [off] {sym} ptr mem))
  3737  	// cond: x.Uses == 1 && ssa.Clobber(x)
  3738  	// result: @x.Block (MOVHload <t> [off] {sym} ptr mem)
  3739  	for {
  3740  		t := v.Type
  3741  		x := v_0
  3742  		if x.Op != ssaop.OpMIPSMOVHUload {
  3743  			break
  3744  		}
  3745  		off := ssa.AuxIntToInt32(x.AuxInt)
  3746  		sym := ssa.AuxToSym(x.Aux)
  3747  		mem := x.Args[1]
  3748  		ptr := x.Args[0]
  3749  		if !(x.Uses == 1 && ssa.Clobber(x)) {
  3750  			break
  3751  		}
  3752  		b = x.Block
  3753  		v0 := b.NewValue0(x.Pos, ssaop.OpMIPSMOVHload, t)
  3754  		v.CopyOf(v0)
  3755  		v0.AuxInt = ssa.Int32ToAuxInt(off)
  3756  		v0.Aux = ssa.SymToAux(sym)
  3757  		v0.AddArg2(ptr, mem)
  3758  		return true
  3759  	}
  3760  	// match: (MOVHreg (ANDconst [c] x))
  3761  	// cond: c & 0x8000 == 0
  3762  	// result: (ANDconst [c&0x7fff] x)
  3763  	for {
  3764  		if v_0.Op != ssaop.OpMIPSANDconst {
  3765  			break
  3766  		}
  3767  		c := ssa.AuxIntToInt32(v_0.AuxInt)
  3768  		x := v_0.Args[0]
  3769  		if !(c&0x8000 == 0) {
  3770  			break
  3771  		}
  3772  		v.Reset(ssaop.OpMIPSANDconst)
  3773  		v.AuxInt = ssa.Int32ToAuxInt(c & 0x7fff)
  3774  		v.AddArg(x)
  3775  		return true
  3776  	}
  3777  	// match: (MOVHreg (MOVWconst [c]))
  3778  	// result: (MOVWconst [int32(int16(c))])
  3779  	for {
  3780  		if v_0.Op != ssaop.OpMIPSMOVWconst {
  3781  			break
  3782  		}
  3783  		c := ssa.AuxIntToInt32(v_0.AuxInt)
  3784  		v.Reset(ssaop.OpMIPSMOVWconst)
  3785  		v.AuxInt = ssa.Int32ToAuxInt(int32(int16(c)))
  3786  		return true
  3787  	}
  3788  	return false
  3789  }
  3790  func rewriteValue_OpMIPSMOVHstore(v *ssa.Value) bool {
  3791  	v_2 := v.Args[2]
  3792  	v_1 := v.Args[1]
  3793  	v_0 := v.Args[0]
  3794  	// match: (MOVHstore [off1] {sym} x:(ADDconst [off2] ptr) val mem)
  3795  	// cond: (ssa.Is16Bit(int64(off1+off2)) || x.Uses == 1)
  3796  	// result: (MOVHstore [off1+off2] {sym} ptr val mem)
  3797  	for {
  3798  		off1 := ssa.AuxIntToInt32(v.AuxInt)
  3799  		sym := ssa.AuxToSym(v.Aux)
  3800  		x := v_0
  3801  		if x.Op != ssaop.OpMIPSADDconst {
  3802  			break
  3803  		}
  3804  		off2 := ssa.AuxIntToInt32(x.AuxInt)
  3805  		ptr := x.Args[0]
  3806  		val := v_1
  3807  		mem := v_2
  3808  		if !(ssa.Is16Bit(int64(off1+off2)) || x.Uses == 1) {
  3809  			break
  3810  		}
  3811  		v.Reset(ssaop.OpMIPSMOVHstore)
  3812  		v.AuxInt = ssa.Int32ToAuxInt(off1 + off2)
  3813  		v.Aux = ssa.SymToAux(sym)
  3814  		v.AddArg3(ptr, val, mem)
  3815  		return true
  3816  	}
  3817  	// match: (MOVHstore [off1] {sym1} (MOVWaddr [off2] {sym2} ptr) val mem)
  3818  	// cond: ssa.CanMergeSym(sym1,sym2)
  3819  	// result: (MOVHstore [off1+off2] {ssa.MergeSym(sym1,sym2)} ptr val mem)
  3820  	for {
  3821  		off1 := ssa.AuxIntToInt32(v.AuxInt)
  3822  		sym1 := ssa.AuxToSym(v.Aux)
  3823  		if v_0.Op != ssaop.OpMIPSMOVWaddr {
  3824  			break
  3825  		}
  3826  		off2 := ssa.AuxIntToInt32(v_0.AuxInt)
  3827  		sym2 := ssa.AuxToSym(v_0.Aux)
  3828  		ptr := v_0.Args[0]
  3829  		val := v_1
  3830  		mem := v_2
  3831  		if !(ssa.CanMergeSym(sym1, sym2)) {
  3832  			break
  3833  		}
  3834  		v.Reset(ssaop.OpMIPSMOVHstore)
  3835  		v.AuxInt = ssa.Int32ToAuxInt(off1 + off2)
  3836  		v.Aux = ssa.SymToAux(ssa.MergeSym(sym1, sym2))
  3837  		v.AddArg3(ptr, val, mem)
  3838  		return true
  3839  	}
  3840  	// match: (MOVHstore [off] {sym} ptr (MOVWconst [0]) mem)
  3841  	// result: (MOVHstorezero [off] {sym} ptr mem)
  3842  	for {
  3843  		off := ssa.AuxIntToInt32(v.AuxInt)
  3844  		sym := ssa.AuxToSym(v.Aux)
  3845  		ptr := v_0
  3846  		if v_1.Op != ssaop.OpMIPSMOVWconst || ssa.AuxIntToInt32(v_1.AuxInt) != 0 {
  3847  			break
  3848  		}
  3849  		mem := v_2
  3850  		v.Reset(ssaop.OpMIPSMOVHstorezero)
  3851  		v.AuxInt = ssa.Int32ToAuxInt(off)
  3852  		v.Aux = ssa.SymToAux(sym)
  3853  		v.AddArg2(ptr, mem)
  3854  		return true
  3855  	}
  3856  	// match: (MOVHstore [off] {sym} ptr (MOVHreg x) mem)
  3857  	// result: (MOVHstore [off] {sym} ptr x mem)
  3858  	for {
  3859  		off := ssa.AuxIntToInt32(v.AuxInt)
  3860  		sym := ssa.AuxToSym(v.Aux)
  3861  		ptr := v_0
  3862  		if v_1.Op != ssaop.OpMIPSMOVHreg {
  3863  			break
  3864  		}
  3865  		x := v_1.Args[0]
  3866  		mem := v_2
  3867  		v.Reset(ssaop.OpMIPSMOVHstore)
  3868  		v.AuxInt = ssa.Int32ToAuxInt(off)
  3869  		v.Aux = ssa.SymToAux(sym)
  3870  		v.AddArg3(ptr, x, mem)
  3871  		return true
  3872  	}
  3873  	// match: (MOVHstore [off] {sym} ptr (MOVHUreg x) mem)
  3874  	// result: (MOVHstore [off] {sym} ptr x mem)
  3875  	for {
  3876  		off := ssa.AuxIntToInt32(v.AuxInt)
  3877  		sym := ssa.AuxToSym(v.Aux)
  3878  		ptr := v_0
  3879  		if v_1.Op != ssaop.OpMIPSMOVHUreg {
  3880  			break
  3881  		}
  3882  		x := v_1.Args[0]
  3883  		mem := v_2
  3884  		v.Reset(ssaop.OpMIPSMOVHstore)
  3885  		v.AuxInt = ssa.Int32ToAuxInt(off)
  3886  		v.Aux = ssa.SymToAux(sym)
  3887  		v.AddArg3(ptr, x, mem)
  3888  		return true
  3889  	}
  3890  	// match: (MOVHstore [off] {sym} ptr (MOVWreg x) mem)
  3891  	// result: (MOVHstore [off] {sym} ptr x mem)
  3892  	for {
  3893  		off := ssa.AuxIntToInt32(v.AuxInt)
  3894  		sym := ssa.AuxToSym(v.Aux)
  3895  		ptr := v_0
  3896  		if v_1.Op != ssaop.OpMIPSMOVWreg {
  3897  			break
  3898  		}
  3899  		x := v_1.Args[0]
  3900  		mem := v_2
  3901  		v.Reset(ssaop.OpMIPSMOVHstore)
  3902  		v.AuxInt = ssa.Int32ToAuxInt(off)
  3903  		v.Aux = ssa.SymToAux(sym)
  3904  		v.AddArg3(ptr, x, mem)
  3905  		return true
  3906  	}
  3907  	return false
  3908  }
  3909  func rewriteValue_OpMIPSMOVHstorezero(v *ssa.Value) bool {
  3910  	v_1 := v.Args[1]
  3911  	v_0 := v.Args[0]
  3912  	// match: (MOVHstorezero [off1] {sym} x:(ADDconst [off2] ptr) mem)
  3913  	// cond: (ssa.Is16Bit(int64(off1+off2)) || x.Uses == 1)
  3914  	// result: (MOVHstorezero [off1+off2] {sym} ptr mem)
  3915  	for {
  3916  		off1 := ssa.AuxIntToInt32(v.AuxInt)
  3917  		sym := ssa.AuxToSym(v.Aux)
  3918  		x := v_0
  3919  		if x.Op != ssaop.OpMIPSADDconst {
  3920  			break
  3921  		}
  3922  		off2 := ssa.AuxIntToInt32(x.AuxInt)
  3923  		ptr := x.Args[0]
  3924  		mem := v_1
  3925  		if !(ssa.Is16Bit(int64(off1+off2)) || x.Uses == 1) {
  3926  			break
  3927  		}
  3928  		v.Reset(ssaop.OpMIPSMOVHstorezero)
  3929  		v.AuxInt = ssa.Int32ToAuxInt(off1 + off2)
  3930  		v.Aux = ssa.SymToAux(sym)
  3931  		v.AddArg2(ptr, mem)
  3932  		return true
  3933  	}
  3934  	// match: (MOVHstorezero [off1] {sym1} (MOVWaddr [off2] {sym2} ptr) mem)
  3935  	// cond: ssa.CanMergeSym(sym1,sym2)
  3936  	// result: (MOVHstorezero [off1+off2] {ssa.MergeSym(sym1,sym2)} ptr mem)
  3937  	for {
  3938  		off1 := ssa.AuxIntToInt32(v.AuxInt)
  3939  		sym1 := ssa.AuxToSym(v.Aux)
  3940  		if v_0.Op != ssaop.OpMIPSMOVWaddr {
  3941  			break
  3942  		}
  3943  		off2 := ssa.AuxIntToInt32(v_0.AuxInt)
  3944  		sym2 := ssa.AuxToSym(v_0.Aux)
  3945  		ptr := v_0.Args[0]
  3946  		mem := v_1
  3947  		if !(ssa.CanMergeSym(sym1, sym2)) {
  3948  			break
  3949  		}
  3950  		v.Reset(ssaop.OpMIPSMOVHstorezero)
  3951  		v.AuxInt = ssa.Int32ToAuxInt(off1 + off2)
  3952  		v.Aux = ssa.SymToAux(ssa.MergeSym(sym1, sym2))
  3953  		v.AddArg2(ptr, mem)
  3954  		return true
  3955  	}
  3956  	return false
  3957  }
  3958  func rewriteValue_OpMIPSMOVWload(v *ssa.Value) bool {
  3959  	v_1 := v.Args[1]
  3960  	v_0 := v.Args[0]
  3961  	// match: (MOVWload [off] {sym} ptr (MOVFstore [off] {sym} ptr val _))
  3962  	// result: (MOVWfpgp val)
  3963  	for {
  3964  		off := ssa.AuxIntToInt32(v.AuxInt)
  3965  		sym := ssa.AuxToSym(v.Aux)
  3966  		ptr := v_0
  3967  		if v_1.Op != ssaop.OpMIPSMOVFstore || ssa.AuxIntToInt32(v_1.AuxInt) != off || ssa.AuxToSym(v_1.Aux) != sym {
  3968  			break
  3969  		}
  3970  		val := v_1.Args[1]
  3971  		if ptr != v_1.Args[0] {
  3972  			break
  3973  		}
  3974  		v.Reset(ssaop.OpMIPSMOVWfpgp)
  3975  		v.AddArg(val)
  3976  		return true
  3977  	}
  3978  	// match: (MOVWload [off] {sym} ptr (MOVWstore [off] {sym} ptr x _))
  3979  	// result: (MOVWreg x)
  3980  	for {
  3981  		off := ssa.AuxIntToInt32(v.AuxInt)
  3982  		sym := ssa.AuxToSym(v.Aux)
  3983  		ptr := v_0
  3984  		if v_1.Op != ssaop.OpMIPSMOVWstore || ssa.AuxIntToInt32(v_1.AuxInt) != off || ssa.AuxToSym(v_1.Aux) != sym {
  3985  			break
  3986  		}
  3987  		x := v_1.Args[1]
  3988  		if ptr != v_1.Args[0] {
  3989  			break
  3990  		}
  3991  		v.Reset(ssaop.OpMIPSMOVWreg)
  3992  		v.AddArg(x)
  3993  		return true
  3994  	}
  3995  	// match: (MOVWload [off1] {sym} x:(ADDconst [off2] ptr) mem)
  3996  	// cond: (ssa.Is16Bit(int64(off1+off2)) || x.Uses == 1)
  3997  	// result: (MOVWload [off1+off2] {sym} ptr mem)
  3998  	for {
  3999  		off1 := ssa.AuxIntToInt32(v.AuxInt)
  4000  		sym := ssa.AuxToSym(v.Aux)
  4001  		x := v_0
  4002  		if x.Op != ssaop.OpMIPSADDconst {
  4003  			break
  4004  		}
  4005  		off2 := ssa.AuxIntToInt32(x.AuxInt)
  4006  		ptr := x.Args[0]
  4007  		mem := v_1
  4008  		if !(ssa.Is16Bit(int64(off1+off2)) || x.Uses == 1) {
  4009  			break
  4010  		}
  4011  		v.Reset(ssaop.OpMIPSMOVWload)
  4012  		v.AuxInt = ssa.Int32ToAuxInt(off1 + off2)
  4013  		v.Aux = ssa.SymToAux(sym)
  4014  		v.AddArg2(ptr, mem)
  4015  		return true
  4016  	}
  4017  	// match: (MOVWload [off1] {sym1} (MOVWaddr [off2] {sym2} ptr) mem)
  4018  	// cond: ssa.CanMergeSym(sym1,sym2)
  4019  	// result: (MOVWload [off1+off2] {ssa.MergeSym(sym1,sym2)} ptr mem)
  4020  	for {
  4021  		off1 := ssa.AuxIntToInt32(v.AuxInt)
  4022  		sym1 := ssa.AuxToSym(v.Aux)
  4023  		if v_0.Op != ssaop.OpMIPSMOVWaddr {
  4024  			break
  4025  		}
  4026  		off2 := ssa.AuxIntToInt32(v_0.AuxInt)
  4027  		sym2 := ssa.AuxToSym(v_0.Aux)
  4028  		ptr := v_0.Args[0]
  4029  		mem := v_1
  4030  		if !(ssa.CanMergeSym(sym1, sym2)) {
  4031  			break
  4032  		}
  4033  		v.Reset(ssaop.OpMIPSMOVWload)
  4034  		v.AuxInt = ssa.Int32ToAuxInt(off1 + off2)
  4035  		v.Aux = ssa.SymToAux(ssa.MergeSym(sym1, sym2))
  4036  		v.AddArg2(ptr, mem)
  4037  		return true
  4038  	}
  4039  	// match: (MOVWload [off] {sym} ptr (MOVWstore [off2] {sym2} ptr2 x _))
  4040  	// cond: sym == sym2 && off == off2 && ssa.IsSamePtr(ptr, ptr2)
  4041  	// result: x
  4042  	for {
  4043  		off := ssa.AuxIntToInt32(v.AuxInt)
  4044  		sym := ssa.AuxToSym(v.Aux)
  4045  		ptr := v_0
  4046  		if v_1.Op != ssaop.OpMIPSMOVWstore {
  4047  			break
  4048  		}
  4049  		off2 := ssa.AuxIntToInt32(v_1.AuxInt)
  4050  		sym2 := ssa.AuxToSym(v_1.Aux)
  4051  		x := v_1.Args[1]
  4052  		ptr2 := v_1.Args[0]
  4053  		if !(sym == sym2 && off == off2 && ssa.IsSamePtr(ptr, ptr2)) {
  4054  			break
  4055  		}
  4056  		v.CopyOf(x)
  4057  		return true
  4058  	}
  4059  	return false
  4060  }
  4061  func rewriteValue_OpMIPSMOVWnop(v *ssa.Value) bool {
  4062  	v_0 := v.Args[0]
  4063  	// match: (MOVWnop (MOVWconst [c]))
  4064  	// result: (MOVWconst [c])
  4065  	for {
  4066  		if v_0.Op != ssaop.OpMIPSMOVWconst {
  4067  			break
  4068  		}
  4069  		c := ssa.AuxIntToInt32(v_0.AuxInt)
  4070  		v.Reset(ssaop.OpMIPSMOVWconst)
  4071  		v.AuxInt = ssa.Int32ToAuxInt(c)
  4072  		return true
  4073  	}
  4074  	return false
  4075  }
  4076  func rewriteValue_OpMIPSMOVWreg(v *ssa.Value) bool {
  4077  	v_0 := v.Args[0]
  4078  	// match: (MOVWreg x)
  4079  	// cond: x.Uses == 1
  4080  	// result: (MOVWnop x)
  4081  	for {
  4082  		x := v_0
  4083  		if !(x.Uses == 1) {
  4084  			break
  4085  		}
  4086  		v.Reset(ssaop.OpMIPSMOVWnop)
  4087  		v.AddArg(x)
  4088  		return true
  4089  	}
  4090  	// match: (MOVWreg (MOVWconst [c]))
  4091  	// result: (MOVWconst [c])
  4092  	for {
  4093  		if v_0.Op != ssaop.OpMIPSMOVWconst {
  4094  			break
  4095  		}
  4096  		c := ssa.AuxIntToInt32(v_0.AuxInt)
  4097  		v.Reset(ssaop.OpMIPSMOVWconst)
  4098  		v.AuxInt = ssa.Int32ToAuxInt(c)
  4099  		return true
  4100  	}
  4101  	return false
  4102  }
  4103  func rewriteValue_OpMIPSMOVWstore(v *ssa.Value) bool {
  4104  	v_2 := v.Args[2]
  4105  	v_1 := v.Args[1]
  4106  	v_0 := v.Args[0]
  4107  	// match: (MOVWstore [off] {sym} ptr (MOVWfpgp val) mem)
  4108  	// result: (MOVFstore [off] {sym} ptr val mem)
  4109  	for {
  4110  		off := ssa.AuxIntToInt32(v.AuxInt)
  4111  		sym := ssa.AuxToSym(v.Aux)
  4112  		ptr := v_0
  4113  		if v_1.Op != ssaop.OpMIPSMOVWfpgp {
  4114  			break
  4115  		}
  4116  		val := v_1.Args[0]
  4117  		mem := v_2
  4118  		v.Reset(ssaop.OpMIPSMOVFstore)
  4119  		v.AuxInt = ssa.Int32ToAuxInt(off)
  4120  		v.Aux = ssa.SymToAux(sym)
  4121  		v.AddArg3(ptr, val, mem)
  4122  		return true
  4123  	}
  4124  	// match: (MOVWstore [off1] {sym} x:(ADDconst [off2] ptr) val mem)
  4125  	// cond: (ssa.Is16Bit(int64(off1+off2)) || x.Uses == 1)
  4126  	// result: (MOVWstore [off1+off2] {sym} ptr val mem)
  4127  	for {
  4128  		off1 := ssa.AuxIntToInt32(v.AuxInt)
  4129  		sym := ssa.AuxToSym(v.Aux)
  4130  		x := v_0
  4131  		if x.Op != ssaop.OpMIPSADDconst {
  4132  			break
  4133  		}
  4134  		off2 := ssa.AuxIntToInt32(x.AuxInt)
  4135  		ptr := x.Args[0]
  4136  		val := v_1
  4137  		mem := v_2
  4138  		if !(ssa.Is16Bit(int64(off1+off2)) || x.Uses == 1) {
  4139  			break
  4140  		}
  4141  		v.Reset(ssaop.OpMIPSMOVWstore)
  4142  		v.AuxInt = ssa.Int32ToAuxInt(off1 + off2)
  4143  		v.Aux = ssa.SymToAux(sym)
  4144  		v.AddArg3(ptr, val, mem)
  4145  		return true
  4146  	}
  4147  	// match: (MOVWstore [off1] {sym1} (MOVWaddr [off2] {sym2} ptr) val mem)
  4148  	// cond: ssa.CanMergeSym(sym1,sym2)
  4149  	// result: (MOVWstore [off1+off2] {ssa.MergeSym(sym1,sym2)} ptr val mem)
  4150  	for {
  4151  		off1 := ssa.AuxIntToInt32(v.AuxInt)
  4152  		sym1 := ssa.AuxToSym(v.Aux)
  4153  		if v_0.Op != ssaop.OpMIPSMOVWaddr {
  4154  			break
  4155  		}
  4156  		off2 := ssa.AuxIntToInt32(v_0.AuxInt)
  4157  		sym2 := ssa.AuxToSym(v_0.Aux)
  4158  		ptr := v_0.Args[0]
  4159  		val := v_1
  4160  		mem := v_2
  4161  		if !(ssa.CanMergeSym(sym1, sym2)) {
  4162  			break
  4163  		}
  4164  		v.Reset(ssaop.OpMIPSMOVWstore)
  4165  		v.AuxInt = ssa.Int32ToAuxInt(off1 + off2)
  4166  		v.Aux = ssa.SymToAux(ssa.MergeSym(sym1, sym2))
  4167  		v.AddArg3(ptr, val, mem)
  4168  		return true
  4169  	}
  4170  	// match: (MOVWstore [off] {sym} ptr (MOVWconst [0]) mem)
  4171  	// result: (MOVWstorezero [off] {sym} ptr mem)
  4172  	for {
  4173  		off := ssa.AuxIntToInt32(v.AuxInt)
  4174  		sym := ssa.AuxToSym(v.Aux)
  4175  		ptr := v_0
  4176  		if v_1.Op != ssaop.OpMIPSMOVWconst || ssa.AuxIntToInt32(v_1.AuxInt) != 0 {
  4177  			break
  4178  		}
  4179  		mem := v_2
  4180  		v.Reset(ssaop.OpMIPSMOVWstorezero)
  4181  		v.AuxInt = ssa.Int32ToAuxInt(off)
  4182  		v.Aux = ssa.SymToAux(sym)
  4183  		v.AddArg2(ptr, mem)
  4184  		return true
  4185  	}
  4186  	// match: (MOVWstore [off] {sym} ptr (MOVWreg x) mem)
  4187  	// result: (MOVWstore [off] {sym} ptr x mem)
  4188  	for {
  4189  		off := ssa.AuxIntToInt32(v.AuxInt)
  4190  		sym := ssa.AuxToSym(v.Aux)
  4191  		ptr := v_0
  4192  		if v_1.Op != ssaop.OpMIPSMOVWreg {
  4193  			break
  4194  		}
  4195  		x := v_1.Args[0]
  4196  		mem := v_2
  4197  		v.Reset(ssaop.OpMIPSMOVWstore)
  4198  		v.AuxInt = ssa.Int32ToAuxInt(off)
  4199  		v.Aux = ssa.SymToAux(sym)
  4200  		v.AddArg3(ptr, x, mem)
  4201  		return true
  4202  	}
  4203  	return false
  4204  }
  4205  func rewriteValue_OpMIPSMOVWstorezero(v *ssa.Value) bool {
  4206  	v_1 := v.Args[1]
  4207  	v_0 := v.Args[0]
  4208  	// match: (MOVWstorezero [off1] {sym} x:(ADDconst [off2] ptr) mem)
  4209  	// cond: (ssa.Is16Bit(int64(off1+off2)) || x.Uses == 1)
  4210  	// result: (MOVWstorezero [off1+off2] {sym} ptr mem)
  4211  	for {
  4212  		off1 := ssa.AuxIntToInt32(v.AuxInt)
  4213  		sym := ssa.AuxToSym(v.Aux)
  4214  		x := v_0
  4215  		if x.Op != ssaop.OpMIPSADDconst {
  4216  			break
  4217  		}
  4218  		off2 := ssa.AuxIntToInt32(x.AuxInt)
  4219  		ptr := x.Args[0]
  4220  		mem := v_1
  4221  		if !(ssa.Is16Bit(int64(off1+off2)) || x.Uses == 1) {
  4222  			break
  4223  		}
  4224  		v.Reset(ssaop.OpMIPSMOVWstorezero)
  4225  		v.AuxInt = ssa.Int32ToAuxInt(off1 + off2)
  4226  		v.Aux = ssa.SymToAux(sym)
  4227  		v.AddArg2(ptr, mem)
  4228  		return true
  4229  	}
  4230  	// match: (MOVWstorezero [off1] {sym1} (MOVWaddr [off2] {sym2} ptr) mem)
  4231  	// cond: ssa.CanMergeSym(sym1,sym2)
  4232  	// result: (MOVWstorezero [off1+off2] {ssa.MergeSym(sym1,sym2)} ptr mem)
  4233  	for {
  4234  		off1 := ssa.AuxIntToInt32(v.AuxInt)
  4235  		sym1 := ssa.AuxToSym(v.Aux)
  4236  		if v_0.Op != ssaop.OpMIPSMOVWaddr {
  4237  			break
  4238  		}
  4239  		off2 := ssa.AuxIntToInt32(v_0.AuxInt)
  4240  		sym2 := ssa.AuxToSym(v_0.Aux)
  4241  		ptr := v_0.Args[0]
  4242  		mem := v_1
  4243  		if !(ssa.CanMergeSym(sym1, sym2)) {
  4244  			break
  4245  		}
  4246  		v.Reset(ssaop.OpMIPSMOVWstorezero)
  4247  		v.AuxInt = ssa.Int32ToAuxInt(off1 + off2)
  4248  		v.Aux = ssa.SymToAux(ssa.MergeSym(sym1, sym2))
  4249  		v.AddArg2(ptr, mem)
  4250  		return true
  4251  	}
  4252  	return false
  4253  }
  4254  func rewriteValue_OpMIPSMUL(v *ssa.Value) bool {
  4255  	v_1 := v.Args[1]
  4256  	v_0 := v.Args[0]
  4257  	// match: (MUL (MOVWconst [0]) _ )
  4258  	// result: (MOVWconst [0])
  4259  	for {
  4260  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
  4261  			if v_0.Op != ssaop.OpMIPSMOVWconst || ssa.AuxIntToInt32(v_0.AuxInt) != 0 {
  4262  				continue
  4263  			}
  4264  			v.Reset(ssaop.OpMIPSMOVWconst)
  4265  			v.AuxInt = ssa.Int32ToAuxInt(0)
  4266  			return true
  4267  		}
  4268  		break
  4269  	}
  4270  	// match: (MUL (MOVWconst [1]) x )
  4271  	// result: x
  4272  	for {
  4273  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
  4274  			if v_0.Op != ssaop.OpMIPSMOVWconst || ssa.AuxIntToInt32(v_0.AuxInt) != 1 {
  4275  				continue
  4276  			}
  4277  			x := v_1
  4278  			v.CopyOf(x)
  4279  			return true
  4280  		}
  4281  		break
  4282  	}
  4283  	// match: (MUL (MOVWconst [-1]) x )
  4284  	// result: (NEG x)
  4285  	for {
  4286  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
  4287  			if v_0.Op != ssaop.OpMIPSMOVWconst || ssa.AuxIntToInt32(v_0.AuxInt) != -1 {
  4288  				continue
  4289  			}
  4290  			x := v_1
  4291  			v.Reset(ssaop.OpMIPSNEG)
  4292  			v.AddArg(x)
  4293  			return true
  4294  		}
  4295  		break
  4296  	}
  4297  	// match: (MUL (MOVWconst [c]) x )
  4298  	// cond: ssa.IsPowerOfTwo(uint32(c))
  4299  	// result: (SLLconst [int32(ssa.Log32u(uint32(c)))] x)
  4300  	for {
  4301  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
  4302  			if v_0.Op != ssaop.OpMIPSMOVWconst {
  4303  				continue
  4304  			}
  4305  			c := ssa.AuxIntToInt32(v_0.AuxInt)
  4306  			x := v_1
  4307  			if !(ssa.IsPowerOfTwo(uint32(c))) {
  4308  				continue
  4309  			}
  4310  			v.Reset(ssaop.OpMIPSSLLconst)
  4311  			v.AuxInt = ssa.Int32ToAuxInt(int32(ssa.Log32u(uint32(c))))
  4312  			v.AddArg(x)
  4313  			return true
  4314  		}
  4315  		break
  4316  	}
  4317  	// match: (MUL (MOVWconst [c]) (MOVWconst [d]))
  4318  	// result: (MOVWconst [c*d])
  4319  	for {
  4320  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
  4321  			if v_0.Op != ssaop.OpMIPSMOVWconst {
  4322  				continue
  4323  			}
  4324  			c := ssa.AuxIntToInt32(v_0.AuxInt)
  4325  			if v_1.Op != ssaop.OpMIPSMOVWconst {
  4326  				continue
  4327  			}
  4328  			d := ssa.AuxIntToInt32(v_1.AuxInt)
  4329  			v.Reset(ssaop.OpMIPSMOVWconst)
  4330  			v.AuxInt = ssa.Int32ToAuxInt(c * d)
  4331  			return true
  4332  		}
  4333  		break
  4334  	}
  4335  	return false
  4336  }
  4337  func rewriteValue_OpMIPSNEG(v *ssa.Value) bool {
  4338  	v_0 := v.Args[0]
  4339  	// match: (NEG (SUB x y))
  4340  	// result: (SUB y x)
  4341  	for {
  4342  		if v_0.Op != ssaop.OpMIPSSUB {
  4343  			break
  4344  		}
  4345  		y := v_0.Args[1]
  4346  		x := v_0.Args[0]
  4347  		v.Reset(ssaop.OpMIPSSUB)
  4348  		v.AddArg2(y, x)
  4349  		return true
  4350  	}
  4351  	// match: (NEG (NEG x))
  4352  	// result: x
  4353  	for {
  4354  		if v_0.Op != ssaop.OpMIPSNEG {
  4355  			break
  4356  		}
  4357  		x := v_0.Args[0]
  4358  		v.CopyOf(x)
  4359  		return true
  4360  	}
  4361  	// match: (NEG (MOVWconst [c]))
  4362  	// result: (MOVWconst [-c])
  4363  	for {
  4364  		if v_0.Op != ssaop.OpMIPSMOVWconst {
  4365  			break
  4366  		}
  4367  		c := ssa.AuxIntToInt32(v_0.AuxInt)
  4368  		v.Reset(ssaop.OpMIPSMOVWconst)
  4369  		v.AuxInt = ssa.Int32ToAuxInt(-c)
  4370  		return true
  4371  	}
  4372  	return false
  4373  }
  4374  func rewriteValue_OpMIPSOR(v *ssa.Value) bool {
  4375  	v_1 := v.Args[1]
  4376  	v_0 := v.Args[0]
  4377  	b := v.Block
  4378  	// match: (OR x (MOVWconst [c]))
  4379  	// result: (ORconst [c] x)
  4380  	for {
  4381  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
  4382  			x := v_0
  4383  			if v_1.Op != ssaop.OpMIPSMOVWconst {
  4384  				continue
  4385  			}
  4386  			c := ssa.AuxIntToInt32(v_1.AuxInt)
  4387  			v.Reset(ssaop.OpMIPSORconst)
  4388  			v.AuxInt = ssa.Int32ToAuxInt(c)
  4389  			v.AddArg(x)
  4390  			return true
  4391  		}
  4392  		break
  4393  	}
  4394  	// match: (OR x x)
  4395  	// result: x
  4396  	for {
  4397  		x := v_0
  4398  		if x != v_1 {
  4399  			break
  4400  		}
  4401  		v.CopyOf(x)
  4402  		return true
  4403  	}
  4404  	// match: (OR (SGTUzero x) (SGTUzero y))
  4405  	// result: (SGTUzero (OR <x.Type> x y))
  4406  	for {
  4407  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
  4408  			if v_0.Op != ssaop.OpMIPSSGTUzero {
  4409  				continue
  4410  			}
  4411  			x := v_0.Args[0]
  4412  			if v_1.Op != ssaop.OpMIPSSGTUzero {
  4413  				continue
  4414  			}
  4415  			y := v_1.Args[0]
  4416  			v.Reset(ssaop.OpMIPSSGTUzero)
  4417  			v0 := b.NewValue0(v.Pos, ssaop.OpMIPSOR, x.Type)
  4418  			v0.AddArg2(x, y)
  4419  			v.AddArg(v0)
  4420  			return true
  4421  		}
  4422  		break
  4423  	}
  4424  	return false
  4425  }
  4426  func rewriteValue_OpMIPSORconst(v *ssa.Value) bool {
  4427  	v_0 := v.Args[0]
  4428  	// match: (ORconst [0] x)
  4429  	// result: x
  4430  	for {
  4431  		if ssa.AuxIntToInt32(v.AuxInt) != 0 {
  4432  			break
  4433  		}
  4434  		x := v_0
  4435  		v.CopyOf(x)
  4436  		return true
  4437  	}
  4438  	// match: (ORconst [-1] _)
  4439  	// result: (MOVWconst [-1])
  4440  	for {
  4441  		if ssa.AuxIntToInt32(v.AuxInt) != -1 {
  4442  			break
  4443  		}
  4444  		v.Reset(ssaop.OpMIPSMOVWconst)
  4445  		v.AuxInt = ssa.Int32ToAuxInt(-1)
  4446  		return true
  4447  	}
  4448  	// match: (ORconst [c] (MOVWconst [d]))
  4449  	// result: (MOVWconst [c|d])
  4450  	for {
  4451  		c := ssa.AuxIntToInt32(v.AuxInt)
  4452  		if v_0.Op != ssaop.OpMIPSMOVWconst {
  4453  			break
  4454  		}
  4455  		d := ssa.AuxIntToInt32(v_0.AuxInt)
  4456  		v.Reset(ssaop.OpMIPSMOVWconst)
  4457  		v.AuxInt = ssa.Int32ToAuxInt(c | d)
  4458  		return true
  4459  	}
  4460  	// match: (ORconst [c] (ORconst [d] x))
  4461  	// result: (ORconst [c|d] x)
  4462  	for {
  4463  		c := ssa.AuxIntToInt32(v.AuxInt)
  4464  		if v_0.Op != ssaop.OpMIPSORconst {
  4465  			break
  4466  		}
  4467  		d := ssa.AuxIntToInt32(v_0.AuxInt)
  4468  		x := v_0.Args[0]
  4469  		v.Reset(ssaop.OpMIPSORconst)
  4470  		v.AuxInt = ssa.Int32ToAuxInt(c | d)
  4471  		v.AddArg(x)
  4472  		return true
  4473  	}
  4474  	return false
  4475  }
  4476  func rewriteValue_OpMIPSSGT(v *ssa.Value) bool {
  4477  	v_1 := v.Args[1]
  4478  	v_0 := v.Args[0]
  4479  	// match: (SGT (MOVWconst [c]) x)
  4480  	// result: (SGTconst [c] x)
  4481  	for {
  4482  		if v_0.Op != ssaop.OpMIPSMOVWconst {
  4483  			break
  4484  		}
  4485  		c := ssa.AuxIntToInt32(v_0.AuxInt)
  4486  		x := v_1
  4487  		v.Reset(ssaop.OpMIPSSGTconst)
  4488  		v.AuxInt = ssa.Int32ToAuxInt(c)
  4489  		v.AddArg(x)
  4490  		return true
  4491  	}
  4492  	// match: (SGT x (MOVWconst [0]))
  4493  	// result: (SGTzero x)
  4494  	for {
  4495  		x := v_0
  4496  		if v_1.Op != ssaop.OpMIPSMOVWconst || ssa.AuxIntToInt32(v_1.AuxInt) != 0 {
  4497  			break
  4498  		}
  4499  		v.Reset(ssaop.OpMIPSSGTzero)
  4500  		v.AddArg(x)
  4501  		return true
  4502  	}
  4503  	return false
  4504  }
  4505  func rewriteValue_OpMIPSSGTU(v *ssa.Value) bool {
  4506  	v_1 := v.Args[1]
  4507  	v_0 := v.Args[0]
  4508  	// match: (SGTU (MOVWconst [c]) x)
  4509  	// result: (SGTUconst [c] x)
  4510  	for {
  4511  		if v_0.Op != ssaop.OpMIPSMOVWconst {
  4512  			break
  4513  		}
  4514  		c := ssa.AuxIntToInt32(v_0.AuxInt)
  4515  		x := v_1
  4516  		v.Reset(ssaop.OpMIPSSGTUconst)
  4517  		v.AuxInt = ssa.Int32ToAuxInt(c)
  4518  		v.AddArg(x)
  4519  		return true
  4520  	}
  4521  	// match: (SGTU x (MOVWconst [0]))
  4522  	// result: (SGTUzero x)
  4523  	for {
  4524  		x := v_0
  4525  		if v_1.Op != ssaop.OpMIPSMOVWconst || ssa.AuxIntToInt32(v_1.AuxInt) != 0 {
  4526  			break
  4527  		}
  4528  		v.Reset(ssaop.OpMIPSSGTUzero)
  4529  		v.AddArg(x)
  4530  		return true
  4531  	}
  4532  	return false
  4533  }
  4534  func rewriteValue_OpMIPSSGTUconst(v *ssa.Value) bool {
  4535  	v_0 := v.Args[0]
  4536  	// match: (SGTUconst [c] (MOVWconst [d]))
  4537  	// cond: uint32(c) > uint32(d)
  4538  	// result: (MOVWconst [1])
  4539  	for {
  4540  		c := ssa.AuxIntToInt32(v.AuxInt)
  4541  		if v_0.Op != ssaop.OpMIPSMOVWconst {
  4542  			break
  4543  		}
  4544  		d := ssa.AuxIntToInt32(v_0.AuxInt)
  4545  		if !(uint32(c) > uint32(d)) {
  4546  			break
  4547  		}
  4548  		v.Reset(ssaop.OpMIPSMOVWconst)
  4549  		v.AuxInt = ssa.Int32ToAuxInt(1)
  4550  		return true
  4551  	}
  4552  	// match: (SGTUconst [c] (MOVWconst [d]))
  4553  	// cond: uint32(c) <= uint32(d)
  4554  	// result: (MOVWconst [0])
  4555  	for {
  4556  		c := ssa.AuxIntToInt32(v.AuxInt)
  4557  		if v_0.Op != ssaop.OpMIPSMOVWconst {
  4558  			break
  4559  		}
  4560  		d := ssa.AuxIntToInt32(v_0.AuxInt)
  4561  		if !(uint32(c) <= uint32(d)) {
  4562  			break
  4563  		}
  4564  		v.Reset(ssaop.OpMIPSMOVWconst)
  4565  		v.AuxInt = ssa.Int32ToAuxInt(0)
  4566  		return true
  4567  	}
  4568  	// match: (SGTUconst [c] (MOVBUreg _))
  4569  	// cond: 0xff < uint32(c)
  4570  	// result: (MOVWconst [1])
  4571  	for {
  4572  		c := ssa.AuxIntToInt32(v.AuxInt)
  4573  		if v_0.Op != ssaop.OpMIPSMOVBUreg || !(0xff < uint32(c)) {
  4574  			break
  4575  		}
  4576  		v.Reset(ssaop.OpMIPSMOVWconst)
  4577  		v.AuxInt = ssa.Int32ToAuxInt(1)
  4578  		return true
  4579  	}
  4580  	// match: (SGTUconst [c] (MOVHUreg _))
  4581  	// cond: 0xffff < uint32(c)
  4582  	// result: (MOVWconst [1])
  4583  	for {
  4584  		c := ssa.AuxIntToInt32(v.AuxInt)
  4585  		if v_0.Op != ssaop.OpMIPSMOVHUreg || !(0xffff < uint32(c)) {
  4586  			break
  4587  		}
  4588  		v.Reset(ssaop.OpMIPSMOVWconst)
  4589  		v.AuxInt = ssa.Int32ToAuxInt(1)
  4590  		return true
  4591  	}
  4592  	// match: (SGTUconst [c] (ANDconst [m] _))
  4593  	// cond: uint32(m) < uint32(c)
  4594  	// result: (MOVWconst [1])
  4595  	for {
  4596  		c := ssa.AuxIntToInt32(v.AuxInt)
  4597  		if v_0.Op != ssaop.OpMIPSANDconst {
  4598  			break
  4599  		}
  4600  		m := ssa.AuxIntToInt32(v_0.AuxInt)
  4601  		if !(uint32(m) < uint32(c)) {
  4602  			break
  4603  		}
  4604  		v.Reset(ssaop.OpMIPSMOVWconst)
  4605  		v.AuxInt = ssa.Int32ToAuxInt(1)
  4606  		return true
  4607  	}
  4608  	// match: (SGTUconst [c] (SRLconst _ [d]))
  4609  	// cond: uint32(d) <= 31 && 0xffffffff>>uint32(d) < uint32(c)
  4610  	// result: (MOVWconst [1])
  4611  	for {
  4612  		c := ssa.AuxIntToInt32(v.AuxInt)
  4613  		if v_0.Op != ssaop.OpMIPSSRLconst {
  4614  			break
  4615  		}
  4616  		d := ssa.AuxIntToInt32(v_0.AuxInt)
  4617  		if !(uint32(d) <= 31 && 0xffffffff>>uint32(d) < uint32(c)) {
  4618  			break
  4619  		}
  4620  		v.Reset(ssaop.OpMIPSMOVWconst)
  4621  		v.AuxInt = ssa.Int32ToAuxInt(1)
  4622  		return true
  4623  	}
  4624  	return false
  4625  }
  4626  func rewriteValue_OpMIPSSGTUzero(v *ssa.Value) bool {
  4627  	v_0 := v.Args[0]
  4628  	// match: (SGTUzero (MOVWconst [d]))
  4629  	// cond: d != 0
  4630  	// result: (MOVWconst [1])
  4631  	for {
  4632  		if v_0.Op != ssaop.OpMIPSMOVWconst {
  4633  			break
  4634  		}
  4635  		d := ssa.AuxIntToInt32(v_0.AuxInt)
  4636  		if !(d != 0) {
  4637  			break
  4638  		}
  4639  		v.Reset(ssaop.OpMIPSMOVWconst)
  4640  		v.AuxInt = ssa.Int32ToAuxInt(1)
  4641  		return true
  4642  	}
  4643  	// match: (SGTUzero (MOVWconst [d]))
  4644  	// cond: d == 0
  4645  	// result: (MOVWconst [0])
  4646  	for {
  4647  		if v_0.Op != ssaop.OpMIPSMOVWconst {
  4648  			break
  4649  		}
  4650  		d := ssa.AuxIntToInt32(v_0.AuxInt)
  4651  		if !(d == 0) {
  4652  			break
  4653  		}
  4654  		v.Reset(ssaop.OpMIPSMOVWconst)
  4655  		v.AuxInt = ssa.Int32ToAuxInt(0)
  4656  		return true
  4657  	}
  4658  	return false
  4659  }
  4660  func rewriteValue_OpMIPSSGTconst(v *ssa.Value) bool {
  4661  	v_0 := v.Args[0]
  4662  	// match: (SGTconst [c] (MOVWconst [d]))
  4663  	// cond: c > d
  4664  	// result: (MOVWconst [1])
  4665  	for {
  4666  		c := ssa.AuxIntToInt32(v.AuxInt)
  4667  		if v_0.Op != ssaop.OpMIPSMOVWconst {
  4668  			break
  4669  		}
  4670  		d := ssa.AuxIntToInt32(v_0.AuxInt)
  4671  		if !(c > d) {
  4672  			break
  4673  		}
  4674  		v.Reset(ssaop.OpMIPSMOVWconst)
  4675  		v.AuxInt = ssa.Int32ToAuxInt(1)
  4676  		return true
  4677  	}
  4678  	// match: (SGTconst [c] (MOVWconst [d]))
  4679  	// cond: c <= d
  4680  	// result: (MOVWconst [0])
  4681  	for {
  4682  		c := ssa.AuxIntToInt32(v.AuxInt)
  4683  		if v_0.Op != ssaop.OpMIPSMOVWconst {
  4684  			break
  4685  		}
  4686  		d := ssa.AuxIntToInt32(v_0.AuxInt)
  4687  		if !(c <= d) {
  4688  			break
  4689  		}
  4690  		v.Reset(ssaop.OpMIPSMOVWconst)
  4691  		v.AuxInt = ssa.Int32ToAuxInt(0)
  4692  		return true
  4693  	}
  4694  	// match: (SGTconst [c] (MOVBreg _))
  4695  	// cond: 0x7f < c
  4696  	// result: (MOVWconst [1])
  4697  	for {
  4698  		c := ssa.AuxIntToInt32(v.AuxInt)
  4699  		if v_0.Op != ssaop.OpMIPSMOVBreg || !(0x7f < c) {
  4700  			break
  4701  		}
  4702  		v.Reset(ssaop.OpMIPSMOVWconst)
  4703  		v.AuxInt = ssa.Int32ToAuxInt(1)
  4704  		return true
  4705  	}
  4706  	// match: (SGTconst [c] (MOVBreg _))
  4707  	// cond: c <= -0x80
  4708  	// result: (MOVWconst [0])
  4709  	for {
  4710  		c := ssa.AuxIntToInt32(v.AuxInt)
  4711  		if v_0.Op != ssaop.OpMIPSMOVBreg || !(c <= -0x80) {
  4712  			break
  4713  		}
  4714  		v.Reset(ssaop.OpMIPSMOVWconst)
  4715  		v.AuxInt = ssa.Int32ToAuxInt(0)
  4716  		return true
  4717  	}
  4718  	// match: (SGTconst [c] (MOVBUreg _))
  4719  	// cond: 0xff < c
  4720  	// result: (MOVWconst [1])
  4721  	for {
  4722  		c := ssa.AuxIntToInt32(v.AuxInt)
  4723  		if v_0.Op != ssaop.OpMIPSMOVBUreg || !(0xff < c) {
  4724  			break
  4725  		}
  4726  		v.Reset(ssaop.OpMIPSMOVWconst)
  4727  		v.AuxInt = ssa.Int32ToAuxInt(1)
  4728  		return true
  4729  	}
  4730  	// match: (SGTconst [c] (MOVBUreg _))
  4731  	// cond: c < 0
  4732  	// result: (MOVWconst [0])
  4733  	for {
  4734  		c := ssa.AuxIntToInt32(v.AuxInt)
  4735  		if v_0.Op != ssaop.OpMIPSMOVBUreg || !(c < 0) {
  4736  			break
  4737  		}
  4738  		v.Reset(ssaop.OpMIPSMOVWconst)
  4739  		v.AuxInt = ssa.Int32ToAuxInt(0)
  4740  		return true
  4741  	}
  4742  	// match: (SGTconst [c] (MOVHreg _))
  4743  	// cond: 0x7fff < c
  4744  	// result: (MOVWconst [1])
  4745  	for {
  4746  		c := ssa.AuxIntToInt32(v.AuxInt)
  4747  		if v_0.Op != ssaop.OpMIPSMOVHreg || !(0x7fff < c) {
  4748  			break
  4749  		}
  4750  		v.Reset(ssaop.OpMIPSMOVWconst)
  4751  		v.AuxInt = ssa.Int32ToAuxInt(1)
  4752  		return true
  4753  	}
  4754  	// match: (SGTconst [c] (MOVHreg _))
  4755  	// cond: c <= -0x8000
  4756  	// result: (MOVWconst [0])
  4757  	for {
  4758  		c := ssa.AuxIntToInt32(v.AuxInt)
  4759  		if v_0.Op != ssaop.OpMIPSMOVHreg || !(c <= -0x8000) {
  4760  			break
  4761  		}
  4762  		v.Reset(ssaop.OpMIPSMOVWconst)
  4763  		v.AuxInt = ssa.Int32ToAuxInt(0)
  4764  		return true
  4765  	}
  4766  	// match: (SGTconst [c] (MOVHUreg _))
  4767  	// cond: 0xffff < c
  4768  	// result: (MOVWconst [1])
  4769  	for {
  4770  		c := ssa.AuxIntToInt32(v.AuxInt)
  4771  		if v_0.Op != ssaop.OpMIPSMOVHUreg || !(0xffff < c) {
  4772  			break
  4773  		}
  4774  		v.Reset(ssaop.OpMIPSMOVWconst)
  4775  		v.AuxInt = ssa.Int32ToAuxInt(1)
  4776  		return true
  4777  	}
  4778  	// match: (SGTconst [c] (MOVHUreg _))
  4779  	// cond: c < 0
  4780  	// result: (MOVWconst [0])
  4781  	for {
  4782  		c := ssa.AuxIntToInt32(v.AuxInt)
  4783  		if v_0.Op != ssaop.OpMIPSMOVHUreg || !(c < 0) {
  4784  			break
  4785  		}
  4786  		v.Reset(ssaop.OpMIPSMOVWconst)
  4787  		v.AuxInt = ssa.Int32ToAuxInt(0)
  4788  		return true
  4789  	}
  4790  	// match: (SGTconst [c] (ANDconst [m] _))
  4791  	// cond: 0 <= m && m < c
  4792  	// result: (MOVWconst [1])
  4793  	for {
  4794  		c := ssa.AuxIntToInt32(v.AuxInt)
  4795  		if v_0.Op != ssaop.OpMIPSANDconst {
  4796  			break
  4797  		}
  4798  		m := ssa.AuxIntToInt32(v_0.AuxInt)
  4799  		if !(0 <= m && m < c) {
  4800  			break
  4801  		}
  4802  		v.Reset(ssaop.OpMIPSMOVWconst)
  4803  		v.AuxInt = ssa.Int32ToAuxInt(1)
  4804  		return true
  4805  	}
  4806  	// match: (SGTconst [c] (SRLconst _ [d]))
  4807  	// cond: 0 <= c && uint32(d) <= 31 && 0xffffffff>>uint32(d) < uint32(c)
  4808  	// result: (MOVWconst [1])
  4809  	for {
  4810  		c := ssa.AuxIntToInt32(v.AuxInt)
  4811  		if v_0.Op != ssaop.OpMIPSSRLconst {
  4812  			break
  4813  		}
  4814  		d := ssa.AuxIntToInt32(v_0.AuxInt)
  4815  		if !(0 <= c && uint32(d) <= 31 && 0xffffffff>>uint32(d) < uint32(c)) {
  4816  			break
  4817  		}
  4818  		v.Reset(ssaop.OpMIPSMOVWconst)
  4819  		v.AuxInt = ssa.Int32ToAuxInt(1)
  4820  		return true
  4821  	}
  4822  	return false
  4823  }
  4824  func rewriteValue_OpMIPSSGTzero(v *ssa.Value) bool {
  4825  	v_0 := v.Args[0]
  4826  	// match: (SGTzero (MOVWconst [d]))
  4827  	// cond: d > 0
  4828  	// result: (MOVWconst [1])
  4829  	for {
  4830  		if v_0.Op != ssaop.OpMIPSMOVWconst {
  4831  			break
  4832  		}
  4833  		d := ssa.AuxIntToInt32(v_0.AuxInt)
  4834  		if !(d > 0) {
  4835  			break
  4836  		}
  4837  		v.Reset(ssaop.OpMIPSMOVWconst)
  4838  		v.AuxInt = ssa.Int32ToAuxInt(1)
  4839  		return true
  4840  	}
  4841  	// match: (SGTzero (MOVWconst [d]))
  4842  	// cond: d <= 0
  4843  	// result: (MOVWconst [0])
  4844  	for {
  4845  		if v_0.Op != ssaop.OpMIPSMOVWconst {
  4846  			break
  4847  		}
  4848  		d := ssa.AuxIntToInt32(v_0.AuxInt)
  4849  		if !(d <= 0) {
  4850  			break
  4851  		}
  4852  		v.Reset(ssaop.OpMIPSMOVWconst)
  4853  		v.AuxInt = ssa.Int32ToAuxInt(0)
  4854  		return true
  4855  	}
  4856  	return false
  4857  }
  4858  func rewriteValue_OpMIPSSLL(v *ssa.Value) bool {
  4859  	v_1 := v.Args[1]
  4860  	v_0 := v.Args[0]
  4861  	// match: (SLL x (MOVWconst [c]))
  4862  	// result: (SLLconst x [c&31])
  4863  	for {
  4864  		x := v_0
  4865  		if v_1.Op != ssaop.OpMIPSMOVWconst {
  4866  			break
  4867  		}
  4868  		c := ssa.AuxIntToInt32(v_1.AuxInt)
  4869  		v.Reset(ssaop.OpMIPSSLLconst)
  4870  		v.AuxInt = ssa.Int32ToAuxInt(c & 31)
  4871  		v.AddArg(x)
  4872  		return true
  4873  	}
  4874  	return false
  4875  }
  4876  func rewriteValue_OpMIPSSLLconst(v *ssa.Value) bool {
  4877  	v_0 := v.Args[0]
  4878  	// match: (SLLconst [c] (MOVWconst [d]))
  4879  	// result: (MOVWconst [d<<uint32(c)])
  4880  	for {
  4881  		c := ssa.AuxIntToInt32(v.AuxInt)
  4882  		if v_0.Op != ssaop.OpMIPSMOVWconst {
  4883  			break
  4884  		}
  4885  		d := ssa.AuxIntToInt32(v_0.AuxInt)
  4886  		v.Reset(ssaop.OpMIPSMOVWconst)
  4887  		v.AuxInt = ssa.Int32ToAuxInt(d << uint32(c))
  4888  		return true
  4889  	}
  4890  	return false
  4891  }
  4892  func rewriteValue_OpMIPSSRA(v *ssa.Value) bool {
  4893  	v_1 := v.Args[1]
  4894  	v_0 := v.Args[0]
  4895  	// match: (SRA x (MOVWconst [c]))
  4896  	// result: (SRAconst x [c&31])
  4897  	for {
  4898  		x := v_0
  4899  		if v_1.Op != ssaop.OpMIPSMOVWconst {
  4900  			break
  4901  		}
  4902  		c := ssa.AuxIntToInt32(v_1.AuxInt)
  4903  		v.Reset(ssaop.OpMIPSSRAconst)
  4904  		v.AuxInt = ssa.Int32ToAuxInt(c & 31)
  4905  		v.AddArg(x)
  4906  		return true
  4907  	}
  4908  	return false
  4909  }
  4910  func rewriteValue_OpMIPSSRAconst(v *ssa.Value) bool {
  4911  	v_0 := v.Args[0]
  4912  	// match: (SRAconst [c] (MOVWconst [d]))
  4913  	// result: (MOVWconst [d>>uint32(c)])
  4914  	for {
  4915  		c := ssa.AuxIntToInt32(v.AuxInt)
  4916  		if v_0.Op != ssaop.OpMIPSMOVWconst {
  4917  			break
  4918  		}
  4919  		d := ssa.AuxIntToInt32(v_0.AuxInt)
  4920  		v.Reset(ssaop.OpMIPSMOVWconst)
  4921  		v.AuxInt = ssa.Int32ToAuxInt(d >> uint32(c))
  4922  		return true
  4923  	}
  4924  	return false
  4925  }
  4926  func rewriteValue_OpMIPSSRL(v *ssa.Value) bool {
  4927  	v_1 := v.Args[1]
  4928  	v_0 := v.Args[0]
  4929  	// match: (SRL x (MOVWconst [c]))
  4930  	// result: (SRLconst x [c&31])
  4931  	for {
  4932  		x := v_0
  4933  		if v_1.Op != ssaop.OpMIPSMOVWconst {
  4934  			break
  4935  		}
  4936  		c := ssa.AuxIntToInt32(v_1.AuxInt)
  4937  		v.Reset(ssaop.OpMIPSSRLconst)
  4938  		v.AuxInt = ssa.Int32ToAuxInt(c & 31)
  4939  		v.AddArg(x)
  4940  		return true
  4941  	}
  4942  	return false
  4943  }
  4944  func rewriteValue_OpMIPSSRLconst(v *ssa.Value) bool {
  4945  	v_0 := v.Args[0]
  4946  	// match: (SRLconst [c] (MOVWconst [d]))
  4947  	// result: (MOVWconst [int32(uint32(d)>>uint32(c))])
  4948  	for {
  4949  		c := ssa.AuxIntToInt32(v.AuxInt)
  4950  		if v_0.Op != ssaop.OpMIPSMOVWconst {
  4951  			break
  4952  		}
  4953  		d := ssa.AuxIntToInt32(v_0.AuxInt)
  4954  		v.Reset(ssaop.OpMIPSMOVWconst)
  4955  		v.AuxInt = ssa.Int32ToAuxInt(int32(uint32(d) >> uint32(c)))
  4956  		return true
  4957  	}
  4958  	return false
  4959  }
  4960  func rewriteValue_OpMIPSSUB(v *ssa.Value) bool {
  4961  	v_1 := v.Args[1]
  4962  	v_0 := v.Args[0]
  4963  	// match: (SUB x (MOVWconst [c]))
  4964  	// result: (SUBconst [c] x)
  4965  	for {
  4966  		x := v_0
  4967  		if v_1.Op != ssaop.OpMIPSMOVWconst {
  4968  			break
  4969  		}
  4970  		c := ssa.AuxIntToInt32(v_1.AuxInt)
  4971  		v.Reset(ssaop.OpMIPSSUBconst)
  4972  		v.AuxInt = ssa.Int32ToAuxInt(c)
  4973  		v.AddArg(x)
  4974  		return true
  4975  	}
  4976  	// match: (SUB x (NEG y))
  4977  	// result: (ADD x y)
  4978  	for {
  4979  		x := v_0
  4980  		if v_1.Op != ssaop.OpMIPSNEG {
  4981  			break
  4982  		}
  4983  		y := v_1.Args[0]
  4984  		v.Reset(ssaop.OpMIPSADD)
  4985  		v.AddArg2(x, y)
  4986  		return true
  4987  	}
  4988  	// match: (SUB x x)
  4989  	// result: (MOVWconst [0])
  4990  	for {
  4991  		x := v_0
  4992  		if x != v_1 {
  4993  			break
  4994  		}
  4995  		v.Reset(ssaop.OpMIPSMOVWconst)
  4996  		v.AuxInt = ssa.Int32ToAuxInt(0)
  4997  		return true
  4998  	}
  4999  	// match: (SUB (MOVWconst [0]) x)
  5000  	// result: (NEG x)
  5001  	for {
  5002  		if v_0.Op != ssaop.OpMIPSMOVWconst || ssa.AuxIntToInt32(v_0.AuxInt) != 0 {
  5003  			break
  5004  		}
  5005  		x := v_1
  5006  		v.Reset(ssaop.OpMIPSNEG)
  5007  		v.AddArg(x)
  5008  		return true
  5009  	}
  5010  	return false
  5011  }
  5012  func rewriteValue_OpMIPSSUBconst(v *ssa.Value) bool {
  5013  	v_0 := v.Args[0]
  5014  	// match: (SUBconst [0] x)
  5015  	// result: x
  5016  	for {
  5017  		if ssa.AuxIntToInt32(v.AuxInt) != 0 {
  5018  			break
  5019  		}
  5020  		x := v_0
  5021  		v.CopyOf(x)
  5022  		return true
  5023  	}
  5024  	// match: (SUBconst [c] (MOVWconst [d]))
  5025  	// result: (MOVWconst [d-c])
  5026  	for {
  5027  		c := ssa.AuxIntToInt32(v.AuxInt)
  5028  		if v_0.Op != ssaop.OpMIPSMOVWconst {
  5029  			break
  5030  		}
  5031  		d := ssa.AuxIntToInt32(v_0.AuxInt)
  5032  		v.Reset(ssaop.OpMIPSMOVWconst)
  5033  		v.AuxInt = ssa.Int32ToAuxInt(d - c)
  5034  		return true
  5035  	}
  5036  	// match: (SUBconst [c] (SUBconst [d] x))
  5037  	// result: (ADDconst [-c-d] x)
  5038  	for {
  5039  		c := ssa.AuxIntToInt32(v.AuxInt)
  5040  		if v_0.Op != ssaop.OpMIPSSUBconst {
  5041  			break
  5042  		}
  5043  		d := ssa.AuxIntToInt32(v_0.AuxInt)
  5044  		x := v_0.Args[0]
  5045  		v.Reset(ssaop.OpMIPSADDconst)
  5046  		v.AuxInt = ssa.Int32ToAuxInt(-c - d)
  5047  		v.AddArg(x)
  5048  		return true
  5049  	}
  5050  	// match: (SUBconst [c] (ADDconst [d] x))
  5051  	// result: (ADDconst [-c+d] x)
  5052  	for {
  5053  		c := ssa.AuxIntToInt32(v.AuxInt)
  5054  		if v_0.Op != ssaop.OpMIPSADDconst {
  5055  			break
  5056  		}
  5057  		d := ssa.AuxIntToInt32(v_0.AuxInt)
  5058  		x := v_0.Args[0]
  5059  		v.Reset(ssaop.OpMIPSADDconst)
  5060  		v.AuxInt = ssa.Int32ToAuxInt(-c + d)
  5061  		v.AddArg(x)
  5062  		return true
  5063  	}
  5064  	return false
  5065  }
  5066  func rewriteValue_OpMIPSXOR(v *ssa.Value) bool {
  5067  	v_1 := v.Args[1]
  5068  	v_0 := v.Args[0]
  5069  	// match: (XOR x (MOVWconst [c]))
  5070  	// result: (XORconst [c] x)
  5071  	for {
  5072  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
  5073  			x := v_0
  5074  			if v_1.Op != ssaop.OpMIPSMOVWconst {
  5075  				continue
  5076  			}
  5077  			c := ssa.AuxIntToInt32(v_1.AuxInt)
  5078  			v.Reset(ssaop.OpMIPSXORconst)
  5079  			v.AuxInt = ssa.Int32ToAuxInt(c)
  5080  			v.AddArg(x)
  5081  			return true
  5082  		}
  5083  		break
  5084  	}
  5085  	// match: (XOR x x)
  5086  	// result: (MOVWconst [0])
  5087  	for {
  5088  		x := v_0
  5089  		if x != v_1 {
  5090  			break
  5091  		}
  5092  		v.Reset(ssaop.OpMIPSMOVWconst)
  5093  		v.AuxInt = ssa.Int32ToAuxInt(0)
  5094  		return true
  5095  	}
  5096  	return false
  5097  }
  5098  func rewriteValue_OpMIPSXORconst(v *ssa.Value) bool {
  5099  	v_0 := v.Args[0]
  5100  	// match: (XORconst [0] x)
  5101  	// result: x
  5102  	for {
  5103  		if ssa.AuxIntToInt32(v.AuxInt) != 0 {
  5104  			break
  5105  		}
  5106  		x := v_0
  5107  		v.CopyOf(x)
  5108  		return true
  5109  	}
  5110  	// match: (XORconst [c] (MOVWconst [d]))
  5111  	// result: (MOVWconst [c^d])
  5112  	for {
  5113  		c := ssa.AuxIntToInt32(v.AuxInt)
  5114  		if v_0.Op != ssaop.OpMIPSMOVWconst {
  5115  			break
  5116  		}
  5117  		d := ssa.AuxIntToInt32(v_0.AuxInt)
  5118  		v.Reset(ssaop.OpMIPSMOVWconst)
  5119  		v.AuxInt = ssa.Int32ToAuxInt(c ^ d)
  5120  		return true
  5121  	}
  5122  	// match: (XORconst [c] (XORconst [d] x))
  5123  	// result: (XORconst [c^d] x)
  5124  	for {
  5125  		c := ssa.AuxIntToInt32(v.AuxInt)
  5126  		if v_0.Op != ssaop.OpMIPSXORconst {
  5127  			break
  5128  		}
  5129  		d := ssa.AuxIntToInt32(v_0.AuxInt)
  5130  		x := v_0.Args[0]
  5131  		v.Reset(ssaop.OpMIPSXORconst)
  5132  		v.AuxInt = ssa.Int32ToAuxInt(c ^ d)
  5133  		v.AddArg(x)
  5134  		return true
  5135  	}
  5136  	return false
  5137  }
  5138  func rewriteValue_OpMod16(v *ssa.Value) bool {
  5139  	v_1 := v.Args[1]
  5140  	v_0 := v.Args[0]
  5141  	b := v.Block
  5142  	typ := &b.Func.Config.Types
  5143  	// match: (Mod16 x y)
  5144  	// result: (Select0 (DIV (SignExt16to32 x) (SignExt16to32 y)))
  5145  	for {
  5146  		x := v_0
  5147  		y := v_1
  5148  		v.Reset(ssaop.OpSelect0)
  5149  		v0 := b.NewValue0(v.Pos, ssaop.OpMIPSDIV, types.NewTuple(typ.Int32, typ.Int32))
  5150  		v1 := b.NewValue0(v.Pos, ssaop.OpSignExt16to32, typ.Int32)
  5151  		v1.AddArg(x)
  5152  		v2 := b.NewValue0(v.Pos, ssaop.OpSignExt16to32, typ.Int32)
  5153  		v2.AddArg(y)
  5154  		v0.AddArg2(v1, v2)
  5155  		v.AddArg(v0)
  5156  		return true
  5157  	}
  5158  }
  5159  func rewriteValue_OpMod16u(v *ssa.Value) bool {
  5160  	v_1 := v.Args[1]
  5161  	v_0 := v.Args[0]
  5162  	b := v.Block
  5163  	typ := &b.Func.Config.Types
  5164  	// match: (Mod16u x y)
  5165  	// result: (Select0 (DIVU (ZeroExt16to32 x) (ZeroExt16to32 y)))
  5166  	for {
  5167  		x := v_0
  5168  		y := v_1
  5169  		v.Reset(ssaop.OpSelect0)
  5170  		v0 := b.NewValue0(v.Pos, ssaop.OpMIPSDIVU, types.NewTuple(typ.UInt32, typ.UInt32))
  5171  		v1 := b.NewValue0(v.Pos, ssaop.OpZeroExt16to32, typ.UInt32)
  5172  		v1.AddArg(x)
  5173  		v2 := b.NewValue0(v.Pos, ssaop.OpZeroExt16to32, typ.UInt32)
  5174  		v2.AddArg(y)
  5175  		v0.AddArg2(v1, v2)
  5176  		v.AddArg(v0)
  5177  		return true
  5178  	}
  5179  }
  5180  func rewriteValue_OpMod32(v *ssa.Value) bool {
  5181  	v_1 := v.Args[1]
  5182  	v_0 := v.Args[0]
  5183  	b := v.Block
  5184  	typ := &b.Func.Config.Types
  5185  	// match: (Mod32 x y)
  5186  	// result: (Select0 (DIV x y))
  5187  	for {
  5188  		x := v_0
  5189  		y := v_1
  5190  		v.Reset(ssaop.OpSelect0)
  5191  		v0 := b.NewValue0(v.Pos, ssaop.OpMIPSDIV, types.NewTuple(typ.Int32, typ.Int32))
  5192  		v0.AddArg2(x, y)
  5193  		v.AddArg(v0)
  5194  		return true
  5195  	}
  5196  }
  5197  func rewriteValue_OpMod32u(v *ssa.Value) bool {
  5198  	v_1 := v.Args[1]
  5199  	v_0 := v.Args[0]
  5200  	b := v.Block
  5201  	typ := &b.Func.Config.Types
  5202  	// match: (Mod32u x y)
  5203  	// result: (Select0 (DIVU x y))
  5204  	for {
  5205  		x := v_0
  5206  		y := v_1
  5207  		v.Reset(ssaop.OpSelect0)
  5208  		v0 := b.NewValue0(v.Pos, ssaop.OpMIPSDIVU, types.NewTuple(typ.UInt32, typ.UInt32))
  5209  		v0.AddArg2(x, y)
  5210  		v.AddArg(v0)
  5211  		return true
  5212  	}
  5213  }
  5214  func rewriteValue_OpMod8(v *ssa.Value) bool {
  5215  	v_1 := v.Args[1]
  5216  	v_0 := v.Args[0]
  5217  	b := v.Block
  5218  	typ := &b.Func.Config.Types
  5219  	// match: (Mod8 x y)
  5220  	// result: (Select0 (DIV (SignExt8to32 x) (SignExt8to32 y)))
  5221  	for {
  5222  		x := v_0
  5223  		y := v_1
  5224  		v.Reset(ssaop.OpSelect0)
  5225  		v0 := b.NewValue0(v.Pos, ssaop.OpMIPSDIV, types.NewTuple(typ.Int32, typ.Int32))
  5226  		v1 := b.NewValue0(v.Pos, ssaop.OpSignExt8to32, typ.Int32)
  5227  		v1.AddArg(x)
  5228  		v2 := b.NewValue0(v.Pos, ssaop.OpSignExt8to32, typ.Int32)
  5229  		v2.AddArg(y)
  5230  		v0.AddArg2(v1, v2)
  5231  		v.AddArg(v0)
  5232  		return true
  5233  	}
  5234  }
  5235  func rewriteValue_OpMod8u(v *ssa.Value) bool {
  5236  	v_1 := v.Args[1]
  5237  	v_0 := v.Args[0]
  5238  	b := v.Block
  5239  	typ := &b.Func.Config.Types
  5240  	// match: (Mod8u x y)
  5241  	// result: (Select0 (DIVU (ZeroExt8to32 x) (ZeroExt8to32 y)))
  5242  	for {
  5243  		x := v_0
  5244  		y := v_1
  5245  		v.Reset(ssaop.OpSelect0)
  5246  		v0 := b.NewValue0(v.Pos, ssaop.OpMIPSDIVU, types.NewTuple(typ.UInt32, typ.UInt32))
  5247  		v1 := b.NewValue0(v.Pos, ssaop.OpZeroExt8to32, typ.UInt32)
  5248  		v1.AddArg(x)
  5249  		v2 := b.NewValue0(v.Pos, ssaop.OpZeroExt8to32, typ.UInt32)
  5250  		v2.AddArg(y)
  5251  		v0.AddArg2(v1, v2)
  5252  		v.AddArg(v0)
  5253  		return true
  5254  	}
  5255  }
  5256  func rewriteValue_OpMove(v *ssa.Value) bool {
  5257  	v_2 := v.Args[2]
  5258  	v_1 := v.Args[1]
  5259  	v_0 := v.Args[0]
  5260  	b := v.Block
  5261  	config := b.Func.Config
  5262  	typ := &b.Func.Config.Types
  5263  	// match: (Move [0] _ _ mem)
  5264  	// result: mem
  5265  	for {
  5266  		if ssa.AuxIntToInt64(v.AuxInt) != 0 {
  5267  			break
  5268  		}
  5269  		mem := v_2
  5270  		v.CopyOf(mem)
  5271  		return true
  5272  	}
  5273  	// match: (Move [1] dst src mem)
  5274  	// result: (MOVBstore dst (MOVBUload src mem) mem)
  5275  	for {
  5276  		if ssa.AuxIntToInt64(v.AuxInt) != 1 {
  5277  			break
  5278  		}
  5279  		dst := v_0
  5280  		src := v_1
  5281  		mem := v_2
  5282  		v.Reset(ssaop.OpMIPSMOVBstore)
  5283  		v0 := b.NewValue0(v.Pos, ssaop.OpMIPSMOVBUload, typ.UInt8)
  5284  		v0.AddArg2(src, mem)
  5285  		v.AddArg3(dst, v0, mem)
  5286  		return true
  5287  	}
  5288  	// match: (Move [2] {t} dst src mem)
  5289  	// cond: t.Alignment()%2 == 0
  5290  	// result: (MOVHstore dst (MOVHUload src mem) mem)
  5291  	for {
  5292  		if ssa.AuxIntToInt64(v.AuxInt) != 2 {
  5293  			break
  5294  		}
  5295  		t := ssa.AuxToType(v.Aux)
  5296  		dst := v_0
  5297  		src := v_1
  5298  		mem := v_2
  5299  		if !(t.Alignment()%2 == 0) {
  5300  			break
  5301  		}
  5302  		v.Reset(ssaop.OpMIPSMOVHstore)
  5303  		v0 := b.NewValue0(v.Pos, ssaop.OpMIPSMOVHUload, typ.UInt16)
  5304  		v0.AddArg2(src, mem)
  5305  		v.AddArg3(dst, v0, mem)
  5306  		return true
  5307  	}
  5308  	// match: (Move [2] dst src mem)
  5309  	// result: (MOVBstore [1] dst (MOVBUload [1] src mem) (MOVBstore dst (MOVBUload src mem) mem))
  5310  	for {
  5311  		if ssa.AuxIntToInt64(v.AuxInt) != 2 {
  5312  			break
  5313  		}
  5314  		dst := v_0
  5315  		src := v_1
  5316  		mem := v_2
  5317  		v.Reset(ssaop.OpMIPSMOVBstore)
  5318  		v.AuxInt = ssa.Int32ToAuxInt(1)
  5319  		v0 := b.NewValue0(v.Pos, ssaop.OpMIPSMOVBUload, typ.UInt8)
  5320  		v0.AuxInt = ssa.Int32ToAuxInt(1)
  5321  		v0.AddArg2(src, mem)
  5322  		v1 := b.NewValue0(v.Pos, ssaop.OpMIPSMOVBstore, types.TypeMem)
  5323  		v2 := b.NewValue0(v.Pos, ssaop.OpMIPSMOVBUload, typ.UInt8)
  5324  		v2.AddArg2(src, mem)
  5325  		v1.AddArg3(dst, v2, mem)
  5326  		v.AddArg3(dst, v0, v1)
  5327  		return true
  5328  	}
  5329  	// match: (Move [4] {t} dst src mem)
  5330  	// cond: t.Alignment()%4 == 0
  5331  	// result: (MOVWstore dst (MOVWload src mem) mem)
  5332  	for {
  5333  		if ssa.AuxIntToInt64(v.AuxInt) != 4 {
  5334  			break
  5335  		}
  5336  		t := ssa.AuxToType(v.Aux)
  5337  		dst := v_0
  5338  		src := v_1
  5339  		mem := v_2
  5340  		if !(t.Alignment()%4 == 0) {
  5341  			break
  5342  		}
  5343  		v.Reset(ssaop.OpMIPSMOVWstore)
  5344  		v0 := b.NewValue0(v.Pos, ssaop.OpMIPSMOVWload, typ.UInt32)
  5345  		v0.AddArg2(src, mem)
  5346  		v.AddArg3(dst, v0, mem)
  5347  		return true
  5348  	}
  5349  	// match: (Move [4] {t} dst src mem)
  5350  	// cond: t.Alignment()%2 == 0
  5351  	// result: (MOVHstore [2] dst (MOVHUload [2] src mem) (MOVHstore dst (MOVHUload src mem) mem))
  5352  	for {
  5353  		if ssa.AuxIntToInt64(v.AuxInt) != 4 {
  5354  			break
  5355  		}
  5356  		t := ssa.AuxToType(v.Aux)
  5357  		dst := v_0
  5358  		src := v_1
  5359  		mem := v_2
  5360  		if !(t.Alignment()%2 == 0) {
  5361  			break
  5362  		}
  5363  		v.Reset(ssaop.OpMIPSMOVHstore)
  5364  		v.AuxInt = ssa.Int32ToAuxInt(2)
  5365  		v0 := b.NewValue0(v.Pos, ssaop.OpMIPSMOVHUload, typ.UInt16)
  5366  		v0.AuxInt = ssa.Int32ToAuxInt(2)
  5367  		v0.AddArg2(src, mem)
  5368  		v1 := b.NewValue0(v.Pos, ssaop.OpMIPSMOVHstore, types.TypeMem)
  5369  		v2 := b.NewValue0(v.Pos, ssaop.OpMIPSMOVHUload, typ.UInt16)
  5370  		v2.AddArg2(src, mem)
  5371  		v1.AddArg3(dst, v2, mem)
  5372  		v.AddArg3(dst, v0, v1)
  5373  		return true
  5374  	}
  5375  	// match: (Move [4] dst src mem)
  5376  	// result: (MOVBstore [3] dst (MOVBUload [3] src mem) (MOVBstore [2] dst (MOVBUload [2] src mem) (MOVBstore [1] dst (MOVBUload [1] src mem) (MOVBstore dst (MOVBUload src mem) mem))))
  5377  	for {
  5378  		if ssa.AuxIntToInt64(v.AuxInt) != 4 {
  5379  			break
  5380  		}
  5381  		dst := v_0
  5382  		src := v_1
  5383  		mem := v_2
  5384  		v.Reset(ssaop.OpMIPSMOVBstore)
  5385  		v.AuxInt = ssa.Int32ToAuxInt(3)
  5386  		v0 := b.NewValue0(v.Pos, ssaop.OpMIPSMOVBUload, typ.UInt8)
  5387  		v0.AuxInt = ssa.Int32ToAuxInt(3)
  5388  		v0.AddArg2(src, mem)
  5389  		v1 := b.NewValue0(v.Pos, ssaop.OpMIPSMOVBstore, types.TypeMem)
  5390  		v1.AuxInt = ssa.Int32ToAuxInt(2)
  5391  		v2 := b.NewValue0(v.Pos, ssaop.OpMIPSMOVBUload, typ.UInt8)
  5392  		v2.AuxInt = ssa.Int32ToAuxInt(2)
  5393  		v2.AddArg2(src, mem)
  5394  		v3 := b.NewValue0(v.Pos, ssaop.OpMIPSMOVBstore, types.TypeMem)
  5395  		v3.AuxInt = ssa.Int32ToAuxInt(1)
  5396  		v4 := b.NewValue0(v.Pos, ssaop.OpMIPSMOVBUload, typ.UInt8)
  5397  		v4.AuxInt = ssa.Int32ToAuxInt(1)
  5398  		v4.AddArg2(src, mem)
  5399  		v5 := b.NewValue0(v.Pos, ssaop.OpMIPSMOVBstore, types.TypeMem)
  5400  		v6 := b.NewValue0(v.Pos, ssaop.OpMIPSMOVBUload, typ.UInt8)
  5401  		v6.AddArg2(src, mem)
  5402  		v5.AddArg3(dst, v6, mem)
  5403  		v3.AddArg3(dst, v4, v5)
  5404  		v1.AddArg3(dst, v2, v3)
  5405  		v.AddArg3(dst, v0, v1)
  5406  		return true
  5407  	}
  5408  	// match: (Move [3] dst src mem)
  5409  	// result: (MOVBstore [2] dst (MOVBUload [2] src mem) (MOVBstore [1] dst (MOVBUload [1] src mem) (MOVBstore dst (MOVBUload src mem) mem)))
  5410  	for {
  5411  		if ssa.AuxIntToInt64(v.AuxInt) != 3 {
  5412  			break
  5413  		}
  5414  		dst := v_0
  5415  		src := v_1
  5416  		mem := v_2
  5417  		v.Reset(ssaop.OpMIPSMOVBstore)
  5418  		v.AuxInt = ssa.Int32ToAuxInt(2)
  5419  		v0 := b.NewValue0(v.Pos, ssaop.OpMIPSMOVBUload, typ.UInt8)
  5420  		v0.AuxInt = ssa.Int32ToAuxInt(2)
  5421  		v0.AddArg2(src, mem)
  5422  		v1 := b.NewValue0(v.Pos, ssaop.OpMIPSMOVBstore, types.TypeMem)
  5423  		v1.AuxInt = ssa.Int32ToAuxInt(1)
  5424  		v2 := b.NewValue0(v.Pos, ssaop.OpMIPSMOVBUload, typ.UInt8)
  5425  		v2.AuxInt = ssa.Int32ToAuxInt(1)
  5426  		v2.AddArg2(src, mem)
  5427  		v3 := b.NewValue0(v.Pos, ssaop.OpMIPSMOVBstore, types.TypeMem)
  5428  		v4 := b.NewValue0(v.Pos, ssaop.OpMIPSMOVBUload, typ.UInt8)
  5429  		v4.AddArg2(src, mem)
  5430  		v3.AddArg3(dst, v4, mem)
  5431  		v1.AddArg3(dst, v2, v3)
  5432  		v.AddArg3(dst, v0, v1)
  5433  		return true
  5434  	}
  5435  	// match: (Move [8] {t} dst src mem)
  5436  	// cond: t.Alignment()%4 == 0
  5437  	// result: (MOVWstore [4] dst (MOVWload [4] src mem) (MOVWstore dst (MOVWload src mem) mem))
  5438  	for {
  5439  		if ssa.AuxIntToInt64(v.AuxInt) != 8 {
  5440  			break
  5441  		}
  5442  		t := ssa.AuxToType(v.Aux)
  5443  		dst := v_0
  5444  		src := v_1
  5445  		mem := v_2
  5446  		if !(t.Alignment()%4 == 0) {
  5447  			break
  5448  		}
  5449  		v.Reset(ssaop.OpMIPSMOVWstore)
  5450  		v.AuxInt = ssa.Int32ToAuxInt(4)
  5451  		v0 := b.NewValue0(v.Pos, ssaop.OpMIPSMOVWload, typ.UInt32)
  5452  		v0.AuxInt = ssa.Int32ToAuxInt(4)
  5453  		v0.AddArg2(src, mem)
  5454  		v1 := b.NewValue0(v.Pos, ssaop.OpMIPSMOVWstore, types.TypeMem)
  5455  		v2 := b.NewValue0(v.Pos, ssaop.OpMIPSMOVWload, typ.UInt32)
  5456  		v2.AddArg2(src, mem)
  5457  		v1.AddArg3(dst, v2, mem)
  5458  		v.AddArg3(dst, v0, v1)
  5459  		return true
  5460  	}
  5461  	// match: (Move [8] {t} dst src mem)
  5462  	// cond: t.Alignment()%2 == 0
  5463  	// result: (MOVHstore [6] dst (MOVHload [6] src mem) (MOVHstore [4] dst (MOVHload [4] src mem) (MOVHstore [2] dst (MOVHload [2] src mem) (MOVHstore dst (MOVHload src mem) mem))))
  5464  	for {
  5465  		if ssa.AuxIntToInt64(v.AuxInt) != 8 {
  5466  			break
  5467  		}
  5468  		t := ssa.AuxToType(v.Aux)
  5469  		dst := v_0
  5470  		src := v_1
  5471  		mem := v_2
  5472  		if !(t.Alignment()%2 == 0) {
  5473  			break
  5474  		}
  5475  		v.Reset(ssaop.OpMIPSMOVHstore)
  5476  		v.AuxInt = ssa.Int32ToAuxInt(6)
  5477  		v0 := b.NewValue0(v.Pos, ssaop.OpMIPSMOVHload, typ.Int16)
  5478  		v0.AuxInt = ssa.Int32ToAuxInt(6)
  5479  		v0.AddArg2(src, mem)
  5480  		v1 := b.NewValue0(v.Pos, ssaop.OpMIPSMOVHstore, types.TypeMem)
  5481  		v1.AuxInt = ssa.Int32ToAuxInt(4)
  5482  		v2 := b.NewValue0(v.Pos, ssaop.OpMIPSMOVHload, typ.Int16)
  5483  		v2.AuxInt = ssa.Int32ToAuxInt(4)
  5484  		v2.AddArg2(src, mem)
  5485  		v3 := b.NewValue0(v.Pos, ssaop.OpMIPSMOVHstore, types.TypeMem)
  5486  		v3.AuxInt = ssa.Int32ToAuxInt(2)
  5487  		v4 := b.NewValue0(v.Pos, ssaop.OpMIPSMOVHload, typ.Int16)
  5488  		v4.AuxInt = ssa.Int32ToAuxInt(2)
  5489  		v4.AddArg2(src, mem)
  5490  		v5 := b.NewValue0(v.Pos, ssaop.OpMIPSMOVHstore, types.TypeMem)
  5491  		v6 := b.NewValue0(v.Pos, ssaop.OpMIPSMOVHload, typ.Int16)
  5492  		v6.AddArg2(src, mem)
  5493  		v5.AddArg3(dst, v6, mem)
  5494  		v3.AddArg3(dst, v4, v5)
  5495  		v1.AddArg3(dst, v2, v3)
  5496  		v.AddArg3(dst, v0, v1)
  5497  		return true
  5498  	}
  5499  	// match: (Move [6] {t} dst src mem)
  5500  	// cond: t.Alignment()%2 == 0
  5501  	// result: (MOVHstore [4] dst (MOVHload [4] src mem) (MOVHstore [2] dst (MOVHload [2] src mem) (MOVHstore dst (MOVHload src mem) mem)))
  5502  	for {
  5503  		if ssa.AuxIntToInt64(v.AuxInt) != 6 {
  5504  			break
  5505  		}
  5506  		t := ssa.AuxToType(v.Aux)
  5507  		dst := v_0
  5508  		src := v_1
  5509  		mem := v_2
  5510  		if !(t.Alignment()%2 == 0) {
  5511  			break
  5512  		}
  5513  		v.Reset(ssaop.OpMIPSMOVHstore)
  5514  		v.AuxInt = ssa.Int32ToAuxInt(4)
  5515  		v0 := b.NewValue0(v.Pos, ssaop.OpMIPSMOVHload, typ.Int16)
  5516  		v0.AuxInt = ssa.Int32ToAuxInt(4)
  5517  		v0.AddArg2(src, mem)
  5518  		v1 := b.NewValue0(v.Pos, ssaop.OpMIPSMOVHstore, types.TypeMem)
  5519  		v1.AuxInt = ssa.Int32ToAuxInt(2)
  5520  		v2 := b.NewValue0(v.Pos, ssaop.OpMIPSMOVHload, typ.Int16)
  5521  		v2.AuxInt = ssa.Int32ToAuxInt(2)
  5522  		v2.AddArg2(src, mem)
  5523  		v3 := b.NewValue0(v.Pos, ssaop.OpMIPSMOVHstore, types.TypeMem)
  5524  		v4 := b.NewValue0(v.Pos, ssaop.OpMIPSMOVHload, typ.Int16)
  5525  		v4.AddArg2(src, mem)
  5526  		v3.AddArg3(dst, v4, mem)
  5527  		v1.AddArg3(dst, v2, v3)
  5528  		v.AddArg3(dst, v0, v1)
  5529  		return true
  5530  	}
  5531  	// match: (Move [12] {t} dst src mem)
  5532  	// cond: t.Alignment()%4 == 0
  5533  	// result: (MOVWstore [8] dst (MOVWload [8] src mem) (MOVWstore [4] dst (MOVWload [4] src mem) (MOVWstore dst (MOVWload src mem) mem)))
  5534  	for {
  5535  		if ssa.AuxIntToInt64(v.AuxInt) != 12 {
  5536  			break
  5537  		}
  5538  		t := ssa.AuxToType(v.Aux)
  5539  		dst := v_0
  5540  		src := v_1
  5541  		mem := v_2
  5542  		if !(t.Alignment()%4 == 0) {
  5543  			break
  5544  		}
  5545  		v.Reset(ssaop.OpMIPSMOVWstore)
  5546  		v.AuxInt = ssa.Int32ToAuxInt(8)
  5547  		v0 := b.NewValue0(v.Pos, ssaop.OpMIPSMOVWload, typ.UInt32)
  5548  		v0.AuxInt = ssa.Int32ToAuxInt(8)
  5549  		v0.AddArg2(src, mem)
  5550  		v1 := b.NewValue0(v.Pos, ssaop.OpMIPSMOVWstore, types.TypeMem)
  5551  		v1.AuxInt = ssa.Int32ToAuxInt(4)
  5552  		v2 := b.NewValue0(v.Pos, ssaop.OpMIPSMOVWload, typ.UInt32)
  5553  		v2.AuxInt = ssa.Int32ToAuxInt(4)
  5554  		v2.AddArg2(src, mem)
  5555  		v3 := b.NewValue0(v.Pos, ssaop.OpMIPSMOVWstore, types.TypeMem)
  5556  		v4 := b.NewValue0(v.Pos, ssaop.OpMIPSMOVWload, typ.UInt32)
  5557  		v4.AddArg2(src, mem)
  5558  		v3.AddArg3(dst, v4, mem)
  5559  		v1.AddArg3(dst, v2, v3)
  5560  		v.AddArg3(dst, v0, v1)
  5561  		return true
  5562  	}
  5563  	// match: (Move [16] {t} dst src mem)
  5564  	// cond: t.Alignment()%4 == 0
  5565  	// result: (MOVWstore [12] dst (MOVWload [12] src mem) (MOVWstore [8] dst (MOVWload [8] src mem) (MOVWstore [4] dst (MOVWload [4] src mem) (MOVWstore dst (MOVWload src mem) mem))))
  5566  	for {
  5567  		if ssa.AuxIntToInt64(v.AuxInt) != 16 {
  5568  			break
  5569  		}
  5570  		t := ssa.AuxToType(v.Aux)
  5571  		dst := v_0
  5572  		src := v_1
  5573  		mem := v_2
  5574  		if !(t.Alignment()%4 == 0) {
  5575  			break
  5576  		}
  5577  		v.Reset(ssaop.OpMIPSMOVWstore)
  5578  		v.AuxInt = ssa.Int32ToAuxInt(12)
  5579  		v0 := b.NewValue0(v.Pos, ssaop.OpMIPSMOVWload, typ.UInt32)
  5580  		v0.AuxInt = ssa.Int32ToAuxInt(12)
  5581  		v0.AddArg2(src, mem)
  5582  		v1 := b.NewValue0(v.Pos, ssaop.OpMIPSMOVWstore, types.TypeMem)
  5583  		v1.AuxInt = ssa.Int32ToAuxInt(8)
  5584  		v2 := b.NewValue0(v.Pos, ssaop.OpMIPSMOVWload, typ.UInt32)
  5585  		v2.AuxInt = ssa.Int32ToAuxInt(8)
  5586  		v2.AddArg2(src, mem)
  5587  		v3 := b.NewValue0(v.Pos, ssaop.OpMIPSMOVWstore, types.TypeMem)
  5588  		v3.AuxInt = ssa.Int32ToAuxInt(4)
  5589  		v4 := b.NewValue0(v.Pos, ssaop.OpMIPSMOVWload, typ.UInt32)
  5590  		v4.AuxInt = ssa.Int32ToAuxInt(4)
  5591  		v4.AddArg2(src, mem)
  5592  		v5 := b.NewValue0(v.Pos, ssaop.OpMIPSMOVWstore, types.TypeMem)
  5593  		v6 := b.NewValue0(v.Pos, ssaop.OpMIPSMOVWload, typ.UInt32)
  5594  		v6.AddArg2(src, mem)
  5595  		v5.AddArg3(dst, v6, mem)
  5596  		v3.AddArg3(dst, v4, v5)
  5597  		v1.AddArg3(dst, v2, v3)
  5598  		v.AddArg3(dst, v0, v1)
  5599  		return true
  5600  	}
  5601  	// match: (Move [s] {t} dst src mem)
  5602  	// cond: (s > 16 && ssa.LogLargeCopyValue(v, s) || t.Alignment()%4 != 0)
  5603  	// result: (LoweredMove [int32(t.Alignment())] dst src (ADDconst <src.Type> src [int32(s-ssa.MoveSize(t.Alignment(), config))]) mem)
  5604  	for {
  5605  		s := ssa.AuxIntToInt64(v.AuxInt)
  5606  		t := ssa.AuxToType(v.Aux)
  5607  		dst := v_0
  5608  		src := v_1
  5609  		mem := v_2
  5610  		if !(s > 16 && ssa.LogLargeCopyValue(v, s) || t.Alignment()%4 != 0) {
  5611  			break
  5612  		}
  5613  		v.Reset(ssaop.OpMIPSLoweredMove)
  5614  		v.AuxInt = ssa.Int32ToAuxInt(int32(t.Alignment()))
  5615  		v0 := b.NewValue0(v.Pos, ssaop.OpMIPSADDconst, src.Type)
  5616  		v0.AuxInt = ssa.Int32ToAuxInt(int32(s - ssa.MoveSize(t.Alignment(), config)))
  5617  		v0.AddArg(src)
  5618  		v.AddArg4(dst, src, v0, mem)
  5619  		return true
  5620  	}
  5621  	return false
  5622  }
  5623  func rewriteValue_OpNeq16(v *ssa.Value) bool {
  5624  	v_1 := v.Args[1]
  5625  	v_0 := v.Args[0]
  5626  	b := v.Block
  5627  	typ := &b.Func.Config.Types
  5628  	// match: (Neq16 x y)
  5629  	// result: (SGTU (XOR (ZeroExt16to32 x) (ZeroExt16to32 y)) (MOVWconst [0]))
  5630  	for {
  5631  		x := v_0
  5632  		y := v_1
  5633  		v.Reset(ssaop.OpMIPSSGTU)
  5634  		v0 := b.NewValue0(v.Pos, ssaop.OpMIPSXOR, typ.UInt32)
  5635  		v1 := b.NewValue0(v.Pos, ssaop.OpZeroExt16to32, typ.UInt32)
  5636  		v1.AddArg(x)
  5637  		v2 := b.NewValue0(v.Pos, ssaop.OpZeroExt16to32, typ.UInt32)
  5638  		v2.AddArg(y)
  5639  		v0.AddArg2(v1, v2)
  5640  		v3 := b.NewValue0(v.Pos, ssaop.OpMIPSMOVWconst, typ.UInt32)
  5641  		v3.AuxInt = ssa.Int32ToAuxInt(0)
  5642  		v.AddArg2(v0, v3)
  5643  		return true
  5644  	}
  5645  }
  5646  func rewriteValue_OpNeq32(v *ssa.Value) bool {
  5647  	v_1 := v.Args[1]
  5648  	v_0 := v.Args[0]
  5649  	b := v.Block
  5650  	typ := &b.Func.Config.Types
  5651  	// match: (Neq32 x y)
  5652  	// result: (SGTU (XOR x y) (MOVWconst [0]))
  5653  	for {
  5654  		x := v_0
  5655  		y := v_1
  5656  		v.Reset(ssaop.OpMIPSSGTU)
  5657  		v0 := b.NewValue0(v.Pos, ssaop.OpMIPSXOR, typ.UInt32)
  5658  		v0.AddArg2(x, y)
  5659  		v1 := b.NewValue0(v.Pos, ssaop.OpMIPSMOVWconst, typ.UInt32)
  5660  		v1.AuxInt = ssa.Int32ToAuxInt(0)
  5661  		v.AddArg2(v0, v1)
  5662  		return true
  5663  	}
  5664  }
  5665  func rewriteValue_OpNeq32F(v *ssa.Value) bool {
  5666  	v_1 := v.Args[1]
  5667  	v_0 := v.Args[0]
  5668  	b := v.Block
  5669  	// match: (Neq32F x y)
  5670  	// result: (FPFlagFalse (CMPEQF x y))
  5671  	for {
  5672  		x := v_0
  5673  		y := v_1
  5674  		v.Reset(ssaop.OpMIPSFPFlagFalse)
  5675  		v0 := b.NewValue0(v.Pos, ssaop.OpMIPSCMPEQF, types.TypeFlags)
  5676  		v0.AddArg2(x, y)
  5677  		v.AddArg(v0)
  5678  		return true
  5679  	}
  5680  }
  5681  func rewriteValue_OpNeq64F(v *ssa.Value) bool {
  5682  	v_1 := v.Args[1]
  5683  	v_0 := v.Args[0]
  5684  	b := v.Block
  5685  	// match: (Neq64F x y)
  5686  	// result: (FPFlagFalse (CMPEQD x y))
  5687  	for {
  5688  		x := v_0
  5689  		y := v_1
  5690  		v.Reset(ssaop.OpMIPSFPFlagFalse)
  5691  		v0 := b.NewValue0(v.Pos, ssaop.OpMIPSCMPEQD, types.TypeFlags)
  5692  		v0.AddArg2(x, y)
  5693  		v.AddArg(v0)
  5694  		return true
  5695  	}
  5696  }
  5697  func rewriteValue_OpNeq8(v *ssa.Value) bool {
  5698  	v_1 := v.Args[1]
  5699  	v_0 := v.Args[0]
  5700  	b := v.Block
  5701  	typ := &b.Func.Config.Types
  5702  	// match: (Neq8 x y)
  5703  	// result: (SGTU (XOR (ZeroExt8to32 x) (ZeroExt8to32 y)) (MOVWconst [0]))
  5704  	for {
  5705  		x := v_0
  5706  		y := v_1
  5707  		v.Reset(ssaop.OpMIPSSGTU)
  5708  		v0 := b.NewValue0(v.Pos, ssaop.OpMIPSXOR, typ.UInt32)
  5709  		v1 := b.NewValue0(v.Pos, ssaop.OpZeroExt8to32, typ.UInt32)
  5710  		v1.AddArg(x)
  5711  		v2 := b.NewValue0(v.Pos, ssaop.OpZeroExt8to32, typ.UInt32)
  5712  		v2.AddArg(y)
  5713  		v0.AddArg2(v1, v2)
  5714  		v3 := b.NewValue0(v.Pos, ssaop.OpMIPSMOVWconst, typ.UInt32)
  5715  		v3.AuxInt = ssa.Int32ToAuxInt(0)
  5716  		v.AddArg2(v0, v3)
  5717  		return true
  5718  	}
  5719  }
  5720  func rewriteValue_OpNeqPtr(v *ssa.Value) bool {
  5721  	v_1 := v.Args[1]
  5722  	v_0 := v.Args[0]
  5723  	b := v.Block
  5724  	typ := &b.Func.Config.Types
  5725  	// match: (NeqPtr x y)
  5726  	// result: (SGTU (XOR x y) (MOVWconst [0]))
  5727  	for {
  5728  		x := v_0
  5729  		y := v_1
  5730  		v.Reset(ssaop.OpMIPSSGTU)
  5731  		v0 := b.NewValue0(v.Pos, ssaop.OpMIPSXOR, typ.UInt32)
  5732  		v0.AddArg2(x, y)
  5733  		v1 := b.NewValue0(v.Pos, ssaop.OpMIPSMOVWconst, typ.UInt32)
  5734  		v1.AuxInt = ssa.Int32ToAuxInt(0)
  5735  		v.AddArg2(v0, v1)
  5736  		return true
  5737  	}
  5738  }
  5739  func rewriteValue_OpNot(v *ssa.Value) bool {
  5740  	v_0 := v.Args[0]
  5741  	// match: (Not x)
  5742  	// result: (XORconst [1] x)
  5743  	for {
  5744  		x := v_0
  5745  		v.Reset(ssaop.OpMIPSXORconst)
  5746  		v.AuxInt = ssa.Int32ToAuxInt(1)
  5747  		v.AddArg(x)
  5748  		return true
  5749  	}
  5750  }
  5751  func rewriteValue_OpOffPtr(v *ssa.Value) bool {
  5752  	v_0 := v.Args[0]
  5753  	// match: (OffPtr [off] ptr:(SP))
  5754  	// result: (MOVWaddr [int32(off)] ptr)
  5755  	for {
  5756  		off := ssa.AuxIntToInt64(v.AuxInt)
  5757  		ptr := v_0
  5758  		if ptr.Op != ssaop.OpSP {
  5759  			break
  5760  		}
  5761  		v.Reset(ssaop.OpMIPSMOVWaddr)
  5762  		v.AuxInt = ssa.Int32ToAuxInt(int32(off))
  5763  		v.AddArg(ptr)
  5764  		return true
  5765  	}
  5766  	// match: (OffPtr [off] ptr)
  5767  	// result: (ADDconst [int32(off)] ptr)
  5768  	for {
  5769  		off := ssa.AuxIntToInt64(v.AuxInt)
  5770  		ptr := v_0
  5771  		v.Reset(ssaop.OpMIPSADDconst)
  5772  		v.AuxInt = ssa.Int32ToAuxInt(int32(off))
  5773  		v.AddArg(ptr)
  5774  		return true
  5775  	}
  5776  }
  5777  func rewriteValue_OpRotateLeft16(v *ssa.Value) bool {
  5778  	v_1 := v.Args[1]
  5779  	v_0 := v.Args[0]
  5780  	b := v.Block
  5781  	typ := &b.Func.Config.Types
  5782  	// match: (RotateLeft16 <t> x (MOVWconst [c]))
  5783  	// result: (Or16 (Lsh16x32 <t> x (MOVWconst [c&15])) (Rsh16Ux32 <t> x (MOVWconst [-c&15])))
  5784  	for {
  5785  		t := v.Type
  5786  		x := v_0
  5787  		if v_1.Op != ssaop.OpMIPSMOVWconst {
  5788  			break
  5789  		}
  5790  		c := ssa.AuxIntToInt32(v_1.AuxInt)
  5791  		v.Reset(ssaop.OpOr16)
  5792  		v0 := b.NewValue0(v.Pos, ssaop.OpLsh16x32, t)
  5793  		v1 := b.NewValue0(v.Pos, ssaop.OpMIPSMOVWconst, typ.UInt32)
  5794  		v1.AuxInt = ssa.Int32ToAuxInt(c & 15)
  5795  		v0.AddArg2(x, v1)
  5796  		v2 := b.NewValue0(v.Pos, ssaop.OpRsh16Ux32, t)
  5797  		v3 := b.NewValue0(v.Pos, ssaop.OpMIPSMOVWconst, typ.UInt32)
  5798  		v3.AuxInt = ssa.Int32ToAuxInt(-c & 15)
  5799  		v2.AddArg2(x, v3)
  5800  		v.AddArg2(v0, v2)
  5801  		return true
  5802  	}
  5803  	return false
  5804  }
  5805  func rewriteValue_OpRotateLeft32(v *ssa.Value) bool {
  5806  	v_1 := v.Args[1]
  5807  	v_0 := v.Args[0]
  5808  	b := v.Block
  5809  	typ := &b.Func.Config.Types
  5810  	// match: (RotateLeft32 <t> x (MOVWconst [c]))
  5811  	// result: (Or32 (Lsh32x32 <t> x (MOVWconst [c&31])) (Rsh32Ux32 <t> x (MOVWconst [-c&31])))
  5812  	for {
  5813  		t := v.Type
  5814  		x := v_0
  5815  		if v_1.Op != ssaop.OpMIPSMOVWconst {
  5816  			break
  5817  		}
  5818  		c := ssa.AuxIntToInt32(v_1.AuxInt)
  5819  		v.Reset(ssaop.OpOr32)
  5820  		v0 := b.NewValue0(v.Pos, ssaop.OpLsh32x32, t)
  5821  		v1 := b.NewValue0(v.Pos, ssaop.OpMIPSMOVWconst, typ.UInt32)
  5822  		v1.AuxInt = ssa.Int32ToAuxInt(c & 31)
  5823  		v0.AddArg2(x, v1)
  5824  		v2 := b.NewValue0(v.Pos, ssaop.OpRsh32Ux32, t)
  5825  		v3 := b.NewValue0(v.Pos, ssaop.OpMIPSMOVWconst, typ.UInt32)
  5826  		v3.AuxInt = ssa.Int32ToAuxInt(-c & 31)
  5827  		v2.AddArg2(x, v3)
  5828  		v.AddArg2(v0, v2)
  5829  		return true
  5830  	}
  5831  	return false
  5832  }
  5833  func rewriteValue_OpRotateLeft64(v *ssa.Value) bool {
  5834  	v_1 := v.Args[1]
  5835  	v_0 := v.Args[0]
  5836  	b := v.Block
  5837  	typ := &b.Func.Config.Types
  5838  	// match: (RotateLeft64 <t> x (MOVWconst [c]))
  5839  	// result: (Or64 (Lsh64x32 <t> x (MOVWconst [c&63])) (Rsh64Ux32 <t> x (MOVWconst [-c&63])))
  5840  	for {
  5841  		t := v.Type
  5842  		x := v_0
  5843  		if v_1.Op != ssaop.OpMIPSMOVWconst {
  5844  			break
  5845  		}
  5846  		c := ssa.AuxIntToInt32(v_1.AuxInt)
  5847  		v.Reset(ssaop.OpOr64)
  5848  		v0 := b.NewValue0(v.Pos, ssaop.OpLsh64x32, t)
  5849  		v1 := b.NewValue0(v.Pos, ssaop.OpMIPSMOVWconst, typ.UInt32)
  5850  		v1.AuxInt = ssa.Int32ToAuxInt(c & 63)
  5851  		v0.AddArg2(x, v1)
  5852  		v2 := b.NewValue0(v.Pos, ssaop.OpRsh64Ux32, t)
  5853  		v3 := b.NewValue0(v.Pos, ssaop.OpMIPSMOVWconst, typ.UInt32)
  5854  		v3.AuxInt = ssa.Int32ToAuxInt(-c & 63)
  5855  		v2.AddArg2(x, v3)
  5856  		v.AddArg2(v0, v2)
  5857  		return true
  5858  	}
  5859  	return false
  5860  }
  5861  func rewriteValue_OpRotateLeft8(v *ssa.Value) bool {
  5862  	v_1 := v.Args[1]
  5863  	v_0 := v.Args[0]
  5864  	b := v.Block
  5865  	typ := &b.Func.Config.Types
  5866  	// match: (RotateLeft8 <t> x (MOVWconst [c]))
  5867  	// result: (Or8 (Lsh8x32 <t> x (MOVWconst [c&7])) (Rsh8Ux32 <t> x (MOVWconst [-c&7])))
  5868  	for {
  5869  		t := v.Type
  5870  		x := v_0
  5871  		if v_1.Op != ssaop.OpMIPSMOVWconst {
  5872  			break
  5873  		}
  5874  		c := ssa.AuxIntToInt32(v_1.AuxInt)
  5875  		v.Reset(ssaop.OpOr8)
  5876  		v0 := b.NewValue0(v.Pos, ssaop.OpLsh8x32, t)
  5877  		v1 := b.NewValue0(v.Pos, ssaop.OpMIPSMOVWconst, typ.UInt32)
  5878  		v1.AuxInt = ssa.Int32ToAuxInt(c & 7)
  5879  		v0.AddArg2(x, v1)
  5880  		v2 := b.NewValue0(v.Pos, ssaop.OpRsh8Ux32, t)
  5881  		v3 := b.NewValue0(v.Pos, ssaop.OpMIPSMOVWconst, typ.UInt32)
  5882  		v3.AuxInt = ssa.Int32ToAuxInt(-c & 7)
  5883  		v2.AddArg2(x, v3)
  5884  		v.AddArg2(v0, v2)
  5885  		return true
  5886  	}
  5887  	return false
  5888  }
  5889  func rewriteValue_OpRsh16Ux16(v *ssa.Value) bool {
  5890  	v_1 := v.Args[1]
  5891  	v_0 := v.Args[0]
  5892  	b := v.Block
  5893  	typ := &b.Func.Config.Types
  5894  	// match: (Rsh16Ux16 <t> x y)
  5895  	// result: (CMOVZ (SRL <t> (ZeroExt16to32 x) (ZeroExt16to32 y) ) (MOVWconst [0]) (SGTUconst [32] (ZeroExt16to32 y)))
  5896  	for {
  5897  		t := v.Type
  5898  		x := v_0
  5899  		y := v_1
  5900  		v.Reset(ssaop.OpMIPSCMOVZ)
  5901  		v0 := b.NewValue0(v.Pos, ssaop.OpMIPSSRL, t)
  5902  		v1 := b.NewValue0(v.Pos, ssaop.OpZeroExt16to32, typ.UInt32)
  5903  		v1.AddArg(x)
  5904  		v2 := b.NewValue0(v.Pos, ssaop.OpZeroExt16to32, typ.UInt32)
  5905  		v2.AddArg(y)
  5906  		v0.AddArg2(v1, v2)
  5907  		v3 := b.NewValue0(v.Pos, ssaop.OpMIPSMOVWconst, typ.UInt32)
  5908  		v3.AuxInt = ssa.Int32ToAuxInt(0)
  5909  		v4 := b.NewValue0(v.Pos, ssaop.OpMIPSSGTUconst, typ.Bool)
  5910  		v4.AuxInt = ssa.Int32ToAuxInt(32)
  5911  		v4.AddArg(v2)
  5912  		v.AddArg3(v0, v3, v4)
  5913  		return true
  5914  	}
  5915  }
  5916  func rewriteValue_OpRsh16Ux32(v *ssa.Value) bool {
  5917  	v_1 := v.Args[1]
  5918  	v_0 := v.Args[0]
  5919  	b := v.Block
  5920  	typ := &b.Func.Config.Types
  5921  	// match: (Rsh16Ux32 <t> x y)
  5922  	// result: (CMOVZ (SRL <t> (ZeroExt16to32 x) y) (MOVWconst [0]) (SGTUconst [32] y))
  5923  	for {
  5924  		t := v.Type
  5925  		x := v_0
  5926  		y := v_1
  5927  		v.Reset(ssaop.OpMIPSCMOVZ)
  5928  		v0 := b.NewValue0(v.Pos, ssaop.OpMIPSSRL, t)
  5929  		v1 := b.NewValue0(v.Pos, ssaop.OpZeroExt16to32, typ.UInt32)
  5930  		v1.AddArg(x)
  5931  		v0.AddArg2(v1, y)
  5932  		v2 := b.NewValue0(v.Pos, ssaop.OpMIPSMOVWconst, typ.UInt32)
  5933  		v2.AuxInt = ssa.Int32ToAuxInt(0)
  5934  		v3 := b.NewValue0(v.Pos, ssaop.OpMIPSSGTUconst, typ.Bool)
  5935  		v3.AuxInt = ssa.Int32ToAuxInt(32)
  5936  		v3.AddArg(y)
  5937  		v.AddArg3(v0, v2, v3)
  5938  		return true
  5939  	}
  5940  }
  5941  func rewriteValue_OpRsh16Ux64(v *ssa.Value) bool {
  5942  	v_1 := v.Args[1]
  5943  	v_0 := v.Args[0]
  5944  	b := v.Block
  5945  	typ := &b.Func.Config.Types
  5946  	// match: (Rsh16Ux64 x (Const64 [c]))
  5947  	// cond: uint32(c) < 16
  5948  	// result: (SRLconst (SLLconst <typ.UInt32> x [16]) [int32(c+16)])
  5949  	for {
  5950  		x := v_0
  5951  		if v_1.Op != ssaop.OpConst64 {
  5952  			break
  5953  		}
  5954  		c := ssa.AuxIntToInt64(v_1.AuxInt)
  5955  		if !(uint32(c) < 16) {
  5956  			break
  5957  		}
  5958  		v.Reset(ssaop.OpMIPSSRLconst)
  5959  		v.AuxInt = ssa.Int32ToAuxInt(int32(c + 16))
  5960  		v0 := b.NewValue0(v.Pos, ssaop.OpMIPSSLLconst, typ.UInt32)
  5961  		v0.AuxInt = ssa.Int32ToAuxInt(16)
  5962  		v0.AddArg(x)
  5963  		v.AddArg(v0)
  5964  		return true
  5965  	}
  5966  	// match: (Rsh16Ux64 _ (Const64 [c]))
  5967  	// cond: uint32(c) >= 16
  5968  	// result: (MOVWconst [0])
  5969  	for {
  5970  		if v_1.Op != ssaop.OpConst64 {
  5971  			break
  5972  		}
  5973  		c := ssa.AuxIntToInt64(v_1.AuxInt)
  5974  		if !(uint32(c) >= 16) {
  5975  			break
  5976  		}
  5977  		v.Reset(ssaop.OpMIPSMOVWconst)
  5978  		v.AuxInt = ssa.Int32ToAuxInt(0)
  5979  		return true
  5980  	}
  5981  	return false
  5982  }
  5983  func rewriteValue_OpRsh16Ux8(v *ssa.Value) bool {
  5984  	v_1 := v.Args[1]
  5985  	v_0 := v.Args[0]
  5986  	b := v.Block
  5987  	typ := &b.Func.Config.Types
  5988  	// match: (Rsh16Ux8 <t> x y)
  5989  	// result: (CMOVZ (SRL <t> (ZeroExt16to32 x) (ZeroExt8to32 y) ) (MOVWconst [0]) (SGTUconst [32] (ZeroExt8to32 y)))
  5990  	for {
  5991  		t := v.Type
  5992  		x := v_0
  5993  		y := v_1
  5994  		v.Reset(ssaop.OpMIPSCMOVZ)
  5995  		v0 := b.NewValue0(v.Pos, ssaop.OpMIPSSRL, t)
  5996  		v1 := b.NewValue0(v.Pos, ssaop.OpZeroExt16to32, typ.UInt32)
  5997  		v1.AddArg(x)
  5998  		v2 := b.NewValue0(v.Pos, ssaop.OpZeroExt8to32, typ.UInt32)
  5999  		v2.AddArg(y)
  6000  		v0.AddArg2(v1, v2)
  6001  		v3 := b.NewValue0(v.Pos, ssaop.OpMIPSMOVWconst, typ.UInt32)
  6002  		v3.AuxInt = ssa.Int32ToAuxInt(0)
  6003  		v4 := b.NewValue0(v.Pos, ssaop.OpMIPSSGTUconst, typ.Bool)
  6004  		v4.AuxInt = ssa.Int32ToAuxInt(32)
  6005  		v4.AddArg(v2)
  6006  		v.AddArg3(v0, v3, v4)
  6007  		return true
  6008  	}
  6009  }
  6010  func rewriteValue_OpRsh16x16(v *ssa.Value) bool {
  6011  	v_1 := v.Args[1]
  6012  	v_0 := v.Args[0]
  6013  	b := v.Block
  6014  	typ := &b.Func.Config.Types
  6015  	// match: (Rsh16x16 x y)
  6016  	// result: (SRA (SignExt16to32 x) ( CMOVZ <typ.UInt32> (ZeroExt16to32 y) (MOVWconst [31]) (SGTUconst [32] (ZeroExt16to32 y))))
  6017  	for {
  6018  		x := v_0
  6019  		y := v_1
  6020  		v.Reset(ssaop.OpMIPSSRA)
  6021  		v0 := b.NewValue0(v.Pos, ssaop.OpSignExt16to32, typ.Int32)
  6022  		v0.AddArg(x)
  6023  		v1 := b.NewValue0(v.Pos, ssaop.OpMIPSCMOVZ, typ.UInt32)
  6024  		v2 := b.NewValue0(v.Pos, ssaop.OpZeroExt16to32, typ.UInt32)
  6025  		v2.AddArg(y)
  6026  		v3 := b.NewValue0(v.Pos, ssaop.OpMIPSMOVWconst, typ.UInt32)
  6027  		v3.AuxInt = ssa.Int32ToAuxInt(31)
  6028  		v4 := b.NewValue0(v.Pos, ssaop.OpMIPSSGTUconst, typ.Bool)
  6029  		v4.AuxInt = ssa.Int32ToAuxInt(32)
  6030  		v4.AddArg(v2)
  6031  		v1.AddArg3(v2, v3, v4)
  6032  		v.AddArg2(v0, v1)
  6033  		return true
  6034  	}
  6035  }
  6036  func rewriteValue_OpRsh16x32(v *ssa.Value) bool {
  6037  	v_1 := v.Args[1]
  6038  	v_0 := v.Args[0]
  6039  	b := v.Block
  6040  	typ := &b.Func.Config.Types
  6041  	// match: (Rsh16x32 x y)
  6042  	// result: (SRA (SignExt16to32 x) ( CMOVZ <typ.UInt32> y (MOVWconst [31]) (SGTUconst [32] y)))
  6043  	for {
  6044  		x := v_0
  6045  		y := v_1
  6046  		v.Reset(ssaop.OpMIPSSRA)
  6047  		v0 := b.NewValue0(v.Pos, ssaop.OpSignExt16to32, typ.Int32)
  6048  		v0.AddArg(x)
  6049  		v1 := b.NewValue0(v.Pos, ssaop.OpMIPSCMOVZ, typ.UInt32)
  6050  		v2 := b.NewValue0(v.Pos, ssaop.OpMIPSMOVWconst, typ.UInt32)
  6051  		v2.AuxInt = ssa.Int32ToAuxInt(31)
  6052  		v3 := b.NewValue0(v.Pos, ssaop.OpMIPSSGTUconst, typ.Bool)
  6053  		v3.AuxInt = ssa.Int32ToAuxInt(32)
  6054  		v3.AddArg(y)
  6055  		v1.AddArg3(y, v2, v3)
  6056  		v.AddArg2(v0, v1)
  6057  		return true
  6058  	}
  6059  }
  6060  func rewriteValue_OpRsh16x64(v *ssa.Value) bool {
  6061  	v_1 := v.Args[1]
  6062  	v_0 := v.Args[0]
  6063  	b := v.Block
  6064  	typ := &b.Func.Config.Types
  6065  	// match: (Rsh16x64 x (Const64 [c]))
  6066  	// cond: uint32(c) < 16
  6067  	// result: (SRAconst (SLLconst <typ.UInt32> x [16]) [int32(c+16)])
  6068  	for {
  6069  		x := v_0
  6070  		if v_1.Op != ssaop.OpConst64 {
  6071  			break
  6072  		}
  6073  		c := ssa.AuxIntToInt64(v_1.AuxInt)
  6074  		if !(uint32(c) < 16) {
  6075  			break
  6076  		}
  6077  		v.Reset(ssaop.OpMIPSSRAconst)
  6078  		v.AuxInt = ssa.Int32ToAuxInt(int32(c + 16))
  6079  		v0 := b.NewValue0(v.Pos, ssaop.OpMIPSSLLconst, typ.UInt32)
  6080  		v0.AuxInt = ssa.Int32ToAuxInt(16)
  6081  		v0.AddArg(x)
  6082  		v.AddArg(v0)
  6083  		return true
  6084  	}
  6085  	// match: (Rsh16x64 x (Const64 [c]))
  6086  	// cond: uint32(c) >= 16
  6087  	// result: (SRAconst (SLLconst <typ.UInt32> x [16]) [31])
  6088  	for {
  6089  		x := v_0
  6090  		if v_1.Op != ssaop.OpConst64 {
  6091  			break
  6092  		}
  6093  		c := ssa.AuxIntToInt64(v_1.AuxInt)
  6094  		if !(uint32(c) >= 16) {
  6095  			break
  6096  		}
  6097  		v.Reset(ssaop.OpMIPSSRAconst)
  6098  		v.AuxInt = ssa.Int32ToAuxInt(31)
  6099  		v0 := b.NewValue0(v.Pos, ssaop.OpMIPSSLLconst, typ.UInt32)
  6100  		v0.AuxInt = ssa.Int32ToAuxInt(16)
  6101  		v0.AddArg(x)
  6102  		v.AddArg(v0)
  6103  		return true
  6104  	}
  6105  	return false
  6106  }
  6107  func rewriteValue_OpRsh16x8(v *ssa.Value) bool {
  6108  	v_1 := v.Args[1]
  6109  	v_0 := v.Args[0]
  6110  	b := v.Block
  6111  	typ := &b.Func.Config.Types
  6112  	// match: (Rsh16x8 x y)
  6113  	// result: (SRA (SignExt16to32 x) ( CMOVZ <typ.UInt32> (ZeroExt8to32 y) (MOVWconst [31]) (SGTUconst [32] (ZeroExt8to32 y))))
  6114  	for {
  6115  		x := v_0
  6116  		y := v_1
  6117  		v.Reset(ssaop.OpMIPSSRA)
  6118  		v0 := b.NewValue0(v.Pos, ssaop.OpSignExt16to32, typ.Int32)
  6119  		v0.AddArg(x)
  6120  		v1 := b.NewValue0(v.Pos, ssaop.OpMIPSCMOVZ, typ.UInt32)
  6121  		v2 := b.NewValue0(v.Pos, ssaop.OpZeroExt8to32, typ.UInt32)
  6122  		v2.AddArg(y)
  6123  		v3 := b.NewValue0(v.Pos, ssaop.OpMIPSMOVWconst, typ.UInt32)
  6124  		v3.AuxInt = ssa.Int32ToAuxInt(31)
  6125  		v4 := b.NewValue0(v.Pos, ssaop.OpMIPSSGTUconst, typ.Bool)
  6126  		v4.AuxInt = ssa.Int32ToAuxInt(32)
  6127  		v4.AddArg(v2)
  6128  		v1.AddArg3(v2, v3, v4)
  6129  		v.AddArg2(v0, v1)
  6130  		return true
  6131  	}
  6132  }
  6133  func rewriteValue_OpRsh32Ux16(v *ssa.Value) bool {
  6134  	v_1 := v.Args[1]
  6135  	v_0 := v.Args[0]
  6136  	b := v.Block
  6137  	typ := &b.Func.Config.Types
  6138  	// match: (Rsh32Ux16 <t> x y)
  6139  	// result: (CMOVZ (SRL <t> x (ZeroExt16to32 y) ) (MOVWconst [0]) (SGTUconst [32] (ZeroExt16to32 y)))
  6140  	for {
  6141  		t := v.Type
  6142  		x := v_0
  6143  		y := v_1
  6144  		v.Reset(ssaop.OpMIPSCMOVZ)
  6145  		v0 := b.NewValue0(v.Pos, ssaop.OpMIPSSRL, t)
  6146  		v1 := b.NewValue0(v.Pos, ssaop.OpZeroExt16to32, typ.UInt32)
  6147  		v1.AddArg(y)
  6148  		v0.AddArg2(x, v1)
  6149  		v2 := b.NewValue0(v.Pos, ssaop.OpMIPSMOVWconst, typ.UInt32)
  6150  		v2.AuxInt = ssa.Int32ToAuxInt(0)
  6151  		v3 := b.NewValue0(v.Pos, ssaop.OpMIPSSGTUconst, typ.Bool)
  6152  		v3.AuxInt = ssa.Int32ToAuxInt(32)
  6153  		v3.AddArg(v1)
  6154  		v.AddArg3(v0, v2, v3)
  6155  		return true
  6156  	}
  6157  }
  6158  func rewriteValue_OpRsh32Ux32(v *ssa.Value) bool {
  6159  	v_1 := v.Args[1]
  6160  	v_0 := v.Args[0]
  6161  	b := v.Block
  6162  	typ := &b.Func.Config.Types
  6163  	// match: (Rsh32Ux32 <t> x y)
  6164  	// result: (CMOVZ (SRL <t> x y) (MOVWconst [0]) (SGTUconst [32] y))
  6165  	for {
  6166  		t := v.Type
  6167  		x := v_0
  6168  		y := v_1
  6169  		v.Reset(ssaop.OpMIPSCMOVZ)
  6170  		v0 := b.NewValue0(v.Pos, ssaop.OpMIPSSRL, t)
  6171  		v0.AddArg2(x, y)
  6172  		v1 := b.NewValue0(v.Pos, ssaop.OpMIPSMOVWconst, typ.UInt32)
  6173  		v1.AuxInt = ssa.Int32ToAuxInt(0)
  6174  		v2 := b.NewValue0(v.Pos, ssaop.OpMIPSSGTUconst, typ.Bool)
  6175  		v2.AuxInt = ssa.Int32ToAuxInt(32)
  6176  		v2.AddArg(y)
  6177  		v.AddArg3(v0, v1, v2)
  6178  		return true
  6179  	}
  6180  }
  6181  func rewriteValue_OpRsh32Ux64(v *ssa.Value) bool {
  6182  	v_1 := v.Args[1]
  6183  	v_0 := v.Args[0]
  6184  	// match: (Rsh32Ux64 x (Const64 [c]))
  6185  	// cond: uint32(c) < 32
  6186  	// result: (SRLconst x [int32(c)])
  6187  	for {
  6188  		x := v_0
  6189  		if v_1.Op != ssaop.OpConst64 {
  6190  			break
  6191  		}
  6192  		c := ssa.AuxIntToInt64(v_1.AuxInt)
  6193  		if !(uint32(c) < 32) {
  6194  			break
  6195  		}
  6196  		v.Reset(ssaop.OpMIPSSRLconst)
  6197  		v.AuxInt = ssa.Int32ToAuxInt(int32(c))
  6198  		v.AddArg(x)
  6199  		return true
  6200  	}
  6201  	// match: (Rsh32Ux64 _ (Const64 [c]))
  6202  	// cond: uint32(c) >= 32
  6203  	// result: (MOVWconst [0])
  6204  	for {
  6205  		if v_1.Op != ssaop.OpConst64 {
  6206  			break
  6207  		}
  6208  		c := ssa.AuxIntToInt64(v_1.AuxInt)
  6209  		if !(uint32(c) >= 32) {
  6210  			break
  6211  		}
  6212  		v.Reset(ssaop.OpMIPSMOVWconst)
  6213  		v.AuxInt = ssa.Int32ToAuxInt(0)
  6214  		return true
  6215  	}
  6216  	return false
  6217  }
  6218  func rewriteValue_OpRsh32Ux8(v *ssa.Value) bool {
  6219  	v_1 := v.Args[1]
  6220  	v_0 := v.Args[0]
  6221  	b := v.Block
  6222  	typ := &b.Func.Config.Types
  6223  	// match: (Rsh32Ux8 <t> x y)
  6224  	// result: (CMOVZ (SRL <t> x (ZeroExt8to32 y) ) (MOVWconst [0]) (SGTUconst [32] (ZeroExt8to32 y)))
  6225  	for {
  6226  		t := v.Type
  6227  		x := v_0
  6228  		y := v_1
  6229  		v.Reset(ssaop.OpMIPSCMOVZ)
  6230  		v0 := b.NewValue0(v.Pos, ssaop.OpMIPSSRL, t)
  6231  		v1 := b.NewValue0(v.Pos, ssaop.OpZeroExt8to32, typ.UInt32)
  6232  		v1.AddArg(y)
  6233  		v0.AddArg2(x, v1)
  6234  		v2 := b.NewValue0(v.Pos, ssaop.OpMIPSMOVWconst, typ.UInt32)
  6235  		v2.AuxInt = ssa.Int32ToAuxInt(0)
  6236  		v3 := b.NewValue0(v.Pos, ssaop.OpMIPSSGTUconst, typ.Bool)
  6237  		v3.AuxInt = ssa.Int32ToAuxInt(32)
  6238  		v3.AddArg(v1)
  6239  		v.AddArg3(v0, v2, v3)
  6240  		return true
  6241  	}
  6242  }
  6243  func rewriteValue_OpRsh32x16(v *ssa.Value) bool {
  6244  	v_1 := v.Args[1]
  6245  	v_0 := v.Args[0]
  6246  	b := v.Block
  6247  	typ := &b.Func.Config.Types
  6248  	// match: (Rsh32x16 x y)
  6249  	// result: (SRA x ( CMOVZ <typ.UInt32> (ZeroExt16to32 y) (MOVWconst [31]) (SGTUconst [32] (ZeroExt16to32 y))))
  6250  	for {
  6251  		x := v_0
  6252  		y := v_1
  6253  		v.Reset(ssaop.OpMIPSSRA)
  6254  		v0 := b.NewValue0(v.Pos, ssaop.OpMIPSCMOVZ, typ.UInt32)
  6255  		v1 := b.NewValue0(v.Pos, ssaop.OpZeroExt16to32, typ.UInt32)
  6256  		v1.AddArg(y)
  6257  		v2 := b.NewValue0(v.Pos, ssaop.OpMIPSMOVWconst, typ.UInt32)
  6258  		v2.AuxInt = ssa.Int32ToAuxInt(31)
  6259  		v3 := b.NewValue0(v.Pos, ssaop.OpMIPSSGTUconst, typ.Bool)
  6260  		v3.AuxInt = ssa.Int32ToAuxInt(32)
  6261  		v3.AddArg(v1)
  6262  		v0.AddArg3(v1, v2, v3)
  6263  		v.AddArg2(x, v0)
  6264  		return true
  6265  	}
  6266  }
  6267  func rewriteValue_OpRsh32x32(v *ssa.Value) bool {
  6268  	v_1 := v.Args[1]
  6269  	v_0 := v.Args[0]
  6270  	b := v.Block
  6271  	typ := &b.Func.Config.Types
  6272  	// match: (Rsh32x32 x y)
  6273  	// result: (SRA x ( CMOVZ <typ.UInt32> y (MOVWconst [31]) (SGTUconst [32] y)))
  6274  	for {
  6275  		x := v_0
  6276  		y := v_1
  6277  		v.Reset(ssaop.OpMIPSSRA)
  6278  		v0 := b.NewValue0(v.Pos, ssaop.OpMIPSCMOVZ, typ.UInt32)
  6279  		v1 := b.NewValue0(v.Pos, ssaop.OpMIPSMOVWconst, typ.UInt32)
  6280  		v1.AuxInt = ssa.Int32ToAuxInt(31)
  6281  		v2 := b.NewValue0(v.Pos, ssaop.OpMIPSSGTUconst, typ.Bool)
  6282  		v2.AuxInt = ssa.Int32ToAuxInt(32)
  6283  		v2.AddArg(y)
  6284  		v0.AddArg3(y, v1, v2)
  6285  		v.AddArg2(x, v0)
  6286  		return true
  6287  	}
  6288  }
  6289  func rewriteValue_OpRsh32x64(v *ssa.Value) bool {
  6290  	v_1 := v.Args[1]
  6291  	v_0 := v.Args[0]
  6292  	// match: (Rsh32x64 x (Const64 [c]))
  6293  	// cond: uint32(c) < 32
  6294  	// result: (SRAconst x [int32(c)])
  6295  	for {
  6296  		x := v_0
  6297  		if v_1.Op != ssaop.OpConst64 {
  6298  			break
  6299  		}
  6300  		c := ssa.AuxIntToInt64(v_1.AuxInt)
  6301  		if !(uint32(c) < 32) {
  6302  			break
  6303  		}
  6304  		v.Reset(ssaop.OpMIPSSRAconst)
  6305  		v.AuxInt = ssa.Int32ToAuxInt(int32(c))
  6306  		v.AddArg(x)
  6307  		return true
  6308  	}
  6309  	// match: (Rsh32x64 x (Const64 [c]))
  6310  	// cond: uint32(c) >= 32
  6311  	// result: (SRAconst x [31])
  6312  	for {
  6313  		x := v_0
  6314  		if v_1.Op != ssaop.OpConst64 {
  6315  			break
  6316  		}
  6317  		c := ssa.AuxIntToInt64(v_1.AuxInt)
  6318  		if !(uint32(c) >= 32) {
  6319  			break
  6320  		}
  6321  		v.Reset(ssaop.OpMIPSSRAconst)
  6322  		v.AuxInt = ssa.Int32ToAuxInt(31)
  6323  		v.AddArg(x)
  6324  		return true
  6325  	}
  6326  	return false
  6327  }
  6328  func rewriteValue_OpRsh32x8(v *ssa.Value) bool {
  6329  	v_1 := v.Args[1]
  6330  	v_0 := v.Args[0]
  6331  	b := v.Block
  6332  	typ := &b.Func.Config.Types
  6333  	// match: (Rsh32x8 x y)
  6334  	// result: (SRA x ( CMOVZ <typ.UInt32> (ZeroExt8to32 y) (MOVWconst [31]) (SGTUconst [32] (ZeroExt8to32 y))))
  6335  	for {
  6336  		x := v_0
  6337  		y := v_1
  6338  		v.Reset(ssaop.OpMIPSSRA)
  6339  		v0 := b.NewValue0(v.Pos, ssaop.OpMIPSCMOVZ, typ.UInt32)
  6340  		v1 := b.NewValue0(v.Pos, ssaop.OpZeroExt8to32, typ.UInt32)
  6341  		v1.AddArg(y)
  6342  		v2 := b.NewValue0(v.Pos, ssaop.OpMIPSMOVWconst, typ.UInt32)
  6343  		v2.AuxInt = ssa.Int32ToAuxInt(31)
  6344  		v3 := b.NewValue0(v.Pos, ssaop.OpMIPSSGTUconst, typ.Bool)
  6345  		v3.AuxInt = ssa.Int32ToAuxInt(32)
  6346  		v3.AddArg(v1)
  6347  		v0.AddArg3(v1, v2, v3)
  6348  		v.AddArg2(x, v0)
  6349  		return true
  6350  	}
  6351  }
  6352  func rewriteValue_OpRsh8Ux16(v *ssa.Value) bool {
  6353  	v_1 := v.Args[1]
  6354  	v_0 := v.Args[0]
  6355  	b := v.Block
  6356  	typ := &b.Func.Config.Types
  6357  	// match: (Rsh8Ux16 <t> x y)
  6358  	// result: (CMOVZ (SRL <t> (ZeroExt8to32 x) (ZeroExt16to32 y) ) (MOVWconst [0]) (SGTUconst [32] (ZeroExt16to32 y)))
  6359  	for {
  6360  		t := v.Type
  6361  		x := v_0
  6362  		y := v_1
  6363  		v.Reset(ssaop.OpMIPSCMOVZ)
  6364  		v0 := b.NewValue0(v.Pos, ssaop.OpMIPSSRL, t)
  6365  		v1 := b.NewValue0(v.Pos, ssaop.OpZeroExt8to32, typ.UInt32)
  6366  		v1.AddArg(x)
  6367  		v2 := b.NewValue0(v.Pos, ssaop.OpZeroExt16to32, typ.UInt32)
  6368  		v2.AddArg(y)
  6369  		v0.AddArg2(v1, v2)
  6370  		v3 := b.NewValue0(v.Pos, ssaop.OpMIPSMOVWconst, typ.UInt32)
  6371  		v3.AuxInt = ssa.Int32ToAuxInt(0)
  6372  		v4 := b.NewValue0(v.Pos, ssaop.OpMIPSSGTUconst, typ.Bool)
  6373  		v4.AuxInt = ssa.Int32ToAuxInt(32)
  6374  		v4.AddArg(v2)
  6375  		v.AddArg3(v0, v3, v4)
  6376  		return true
  6377  	}
  6378  }
  6379  func rewriteValue_OpRsh8Ux32(v *ssa.Value) bool {
  6380  	v_1 := v.Args[1]
  6381  	v_0 := v.Args[0]
  6382  	b := v.Block
  6383  	typ := &b.Func.Config.Types
  6384  	// match: (Rsh8Ux32 <t> x y)
  6385  	// result: (CMOVZ (SRL <t> (ZeroExt8to32 x) y) (MOVWconst [0]) (SGTUconst [32] y))
  6386  	for {
  6387  		t := v.Type
  6388  		x := v_0
  6389  		y := v_1
  6390  		v.Reset(ssaop.OpMIPSCMOVZ)
  6391  		v0 := b.NewValue0(v.Pos, ssaop.OpMIPSSRL, t)
  6392  		v1 := b.NewValue0(v.Pos, ssaop.OpZeroExt8to32, typ.UInt32)
  6393  		v1.AddArg(x)
  6394  		v0.AddArg2(v1, y)
  6395  		v2 := b.NewValue0(v.Pos, ssaop.OpMIPSMOVWconst, typ.UInt32)
  6396  		v2.AuxInt = ssa.Int32ToAuxInt(0)
  6397  		v3 := b.NewValue0(v.Pos, ssaop.OpMIPSSGTUconst, typ.Bool)
  6398  		v3.AuxInt = ssa.Int32ToAuxInt(32)
  6399  		v3.AddArg(y)
  6400  		v.AddArg3(v0, v2, v3)
  6401  		return true
  6402  	}
  6403  }
  6404  func rewriteValue_OpRsh8Ux64(v *ssa.Value) bool {
  6405  	v_1 := v.Args[1]
  6406  	v_0 := v.Args[0]
  6407  	b := v.Block
  6408  	typ := &b.Func.Config.Types
  6409  	// match: (Rsh8Ux64 x (Const64 [c]))
  6410  	// cond: uint32(c) < 8
  6411  	// result: (SRLconst (SLLconst <typ.UInt32> x [24]) [int32(c+24)])
  6412  	for {
  6413  		x := v_0
  6414  		if v_1.Op != ssaop.OpConst64 {
  6415  			break
  6416  		}
  6417  		c := ssa.AuxIntToInt64(v_1.AuxInt)
  6418  		if !(uint32(c) < 8) {
  6419  			break
  6420  		}
  6421  		v.Reset(ssaop.OpMIPSSRLconst)
  6422  		v.AuxInt = ssa.Int32ToAuxInt(int32(c + 24))
  6423  		v0 := b.NewValue0(v.Pos, ssaop.OpMIPSSLLconst, typ.UInt32)
  6424  		v0.AuxInt = ssa.Int32ToAuxInt(24)
  6425  		v0.AddArg(x)
  6426  		v.AddArg(v0)
  6427  		return true
  6428  	}
  6429  	// match: (Rsh8Ux64 _ (Const64 [c]))
  6430  	// cond: uint32(c) >= 8
  6431  	// result: (MOVWconst [0])
  6432  	for {
  6433  		if v_1.Op != ssaop.OpConst64 {
  6434  			break
  6435  		}
  6436  		c := ssa.AuxIntToInt64(v_1.AuxInt)
  6437  		if !(uint32(c) >= 8) {
  6438  			break
  6439  		}
  6440  		v.Reset(ssaop.OpMIPSMOVWconst)
  6441  		v.AuxInt = ssa.Int32ToAuxInt(0)
  6442  		return true
  6443  	}
  6444  	return false
  6445  }
  6446  func rewriteValue_OpRsh8Ux8(v *ssa.Value) bool {
  6447  	v_1 := v.Args[1]
  6448  	v_0 := v.Args[0]
  6449  	b := v.Block
  6450  	typ := &b.Func.Config.Types
  6451  	// match: (Rsh8Ux8 <t> x y)
  6452  	// result: (CMOVZ (SRL <t> (ZeroExt8to32 x) (ZeroExt8to32 y) ) (MOVWconst [0]) (SGTUconst [32] (ZeroExt8to32 y)))
  6453  	for {
  6454  		t := v.Type
  6455  		x := v_0
  6456  		y := v_1
  6457  		v.Reset(ssaop.OpMIPSCMOVZ)
  6458  		v0 := b.NewValue0(v.Pos, ssaop.OpMIPSSRL, t)
  6459  		v1 := b.NewValue0(v.Pos, ssaop.OpZeroExt8to32, typ.UInt32)
  6460  		v1.AddArg(x)
  6461  		v2 := b.NewValue0(v.Pos, ssaop.OpZeroExt8to32, typ.UInt32)
  6462  		v2.AddArg(y)
  6463  		v0.AddArg2(v1, v2)
  6464  		v3 := b.NewValue0(v.Pos, ssaop.OpMIPSMOVWconst, typ.UInt32)
  6465  		v3.AuxInt = ssa.Int32ToAuxInt(0)
  6466  		v4 := b.NewValue0(v.Pos, ssaop.OpMIPSSGTUconst, typ.Bool)
  6467  		v4.AuxInt = ssa.Int32ToAuxInt(32)
  6468  		v4.AddArg(v2)
  6469  		v.AddArg3(v0, v3, v4)
  6470  		return true
  6471  	}
  6472  }
  6473  func rewriteValue_OpRsh8x16(v *ssa.Value) bool {
  6474  	v_1 := v.Args[1]
  6475  	v_0 := v.Args[0]
  6476  	b := v.Block
  6477  	typ := &b.Func.Config.Types
  6478  	// match: (Rsh8x16 x y)
  6479  	// result: (SRA (SignExt16to32 x) ( CMOVZ <typ.UInt32> (ZeroExt16to32 y) (MOVWconst [31]) (SGTUconst [32] (ZeroExt16to32 y))))
  6480  	for {
  6481  		x := v_0
  6482  		y := v_1
  6483  		v.Reset(ssaop.OpMIPSSRA)
  6484  		v0 := b.NewValue0(v.Pos, ssaop.OpSignExt16to32, typ.Int32)
  6485  		v0.AddArg(x)
  6486  		v1 := b.NewValue0(v.Pos, ssaop.OpMIPSCMOVZ, typ.UInt32)
  6487  		v2 := b.NewValue0(v.Pos, ssaop.OpZeroExt16to32, typ.UInt32)
  6488  		v2.AddArg(y)
  6489  		v3 := b.NewValue0(v.Pos, ssaop.OpMIPSMOVWconst, typ.UInt32)
  6490  		v3.AuxInt = ssa.Int32ToAuxInt(31)
  6491  		v4 := b.NewValue0(v.Pos, ssaop.OpMIPSSGTUconst, typ.Bool)
  6492  		v4.AuxInt = ssa.Int32ToAuxInt(32)
  6493  		v4.AddArg(v2)
  6494  		v1.AddArg3(v2, v3, v4)
  6495  		v.AddArg2(v0, v1)
  6496  		return true
  6497  	}
  6498  }
  6499  func rewriteValue_OpRsh8x32(v *ssa.Value) bool {
  6500  	v_1 := v.Args[1]
  6501  	v_0 := v.Args[0]
  6502  	b := v.Block
  6503  	typ := &b.Func.Config.Types
  6504  	// match: (Rsh8x32 x y)
  6505  	// result: (SRA (SignExt16to32 x) ( CMOVZ <typ.UInt32> y (MOVWconst [31]) (SGTUconst [32] y)))
  6506  	for {
  6507  		x := v_0
  6508  		y := v_1
  6509  		v.Reset(ssaop.OpMIPSSRA)
  6510  		v0 := b.NewValue0(v.Pos, ssaop.OpSignExt16to32, typ.Int32)
  6511  		v0.AddArg(x)
  6512  		v1 := b.NewValue0(v.Pos, ssaop.OpMIPSCMOVZ, typ.UInt32)
  6513  		v2 := b.NewValue0(v.Pos, ssaop.OpMIPSMOVWconst, typ.UInt32)
  6514  		v2.AuxInt = ssa.Int32ToAuxInt(31)
  6515  		v3 := b.NewValue0(v.Pos, ssaop.OpMIPSSGTUconst, typ.Bool)
  6516  		v3.AuxInt = ssa.Int32ToAuxInt(32)
  6517  		v3.AddArg(y)
  6518  		v1.AddArg3(y, v2, v3)
  6519  		v.AddArg2(v0, v1)
  6520  		return true
  6521  	}
  6522  }
  6523  func rewriteValue_OpRsh8x64(v *ssa.Value) bool {
  6524  	v_1 := v.Args[1]
  6525  	v_0 := v.Args[0]
  6526  	b := v.Block
  6527  	typ := &b.Func.Config.Types
  6528  	// match: (Rsh8x64 x (Const64 [c]))
  6529  	// cond: uint32(c) < 8
  6530  	// result: (SRAconst (SLLconst <typ.UInt32> x [24]) [int32(c+24)])
  6531  	for {
  6532  		x := v_0
  6533  		if v_1.Op != ssaop.OpConst64 {
  6534  			break
  6535  		}
  6536  		c := ssa.AuxIntToInt64(v_1.AuxInt)
  6537  		if !(uint32(c) < 8) {
  6538  			break
  6539  		}
  6540  		v.Reset(ssaop.OpMIPSSRAconst)
  6541  		v.AuxInt = ssa.Int32ToAuxInt(int32(c + 24))
  6542  		v0 := b.NewValue0(v.Pos, ssaop.OpMIPSSLLconst, typ.UInt32)
  6543  		v0.AuxInt = ssa.Int32ToAuxInt(24)
  6544  		v0.AddArg(x)
  6545  		v.AddArg(v0)
  6546  		return true
  6547  	}
  6548  	// match: (Rsh8x64 x (Const64 [c]))
  6549  	// cond: uint32(c) >= 8
  6550  	// result: (SRAconst (SLLconst <typ.UInt32> x [24]) [31])
  6551  	for {
  6552  		x := v_0
  6553  		if v_1.Op != ssaop.OpConst64 {
  6554  			break
  6555  		}
  6556  		c := ssa.AuxIntToInt64(v_1.AuxInt)
  6557  		if !(uint32(c) >= 8) {
  6558  			break
  6559  		}
  6560  		v.Reset(ssaop.OpMIPSSRAconst)
  6561  		v.AuxInt = ssa.Int32ToAuxInt(31)
  6562  		v0 := b.NewValue0(v.Pos, ssaop.OpMIPSSLLconst, typ.UInt32)
  6563  		v0.AuxInt = ssa.Int32ToAuxInt(24)
  6564  		v0.AddArg(x)
  6565  		v.AddArg(v0)
  6566  		return true
  6567  	}
  6568  	return false
  6569  }
  6570  func rewriteValue_OpRsh8x8(v *ssa.Value) bool {
  6571  	v_1 := v.Args[1]
  6572  	v_0 := v.Args[0]
  6573  	b := v.Block
  6574  	typ := &b.Func.Config.Types
  6575  	// match: (Rsh8x8 x y)
  6576  	// result: (SRA (SignExt16to32 x) ( CMOVZ <typ.UInt32> (ZeroExt8to32 y) (MOVWconst [31]) (SGTUconst [32] (ZeroExt8to32 y))))
  6577  	for {
  6578  		x := v_0
  6579  		y := v_1
  6580  		v.Reset(ssaop.OpMIPSSRA)
  6581  		v0 := b.NewValue0(v.Pos, ssaop.OpSignExt16to32, typ.Int32)
  6582  		v0.AddArg(x)
  6583  		v1 := b.NewValue0(v.Pos, ssaop.OpMIPSCMOVZ, typ.UInt32)
  6584  		v2 := b.NewValue0(v.Pos, ssaop.OpZeroExt8to32, typ.UInt32)
  6585  		v2.AddArg(y)
  6586  		v3 := b.NewValue0(v.Pos, ssaop.OpMIPSMOVWconst, typ.UInt32)
  6587  		v3.AuxInt = ssa.Int32ToAuxInt(31)
  6588  		v4 := b.NewValue0(v.Pos, ssaop.OpMIPSSGTUconst, typ.Bool)
  6589  		v4.AuxInt = ssa.Int32ToAuxInt(32)
  6590  		v4.AddArg(v2)
  6591  		v1.AddArg3(v2, v3, v4)
  6592  		v.AddArg2(v0, v1)
  6593  		return true
  6594  	}
  6595  }
  6596  func rewriteValue_OpSelect0(v *ssa.Value) bool {
  6597  	v_0 := v.Args[0]
  6598  	b := v.Block
  6599  	typ := &b.Func.Config.Types
  6600  	// match: (Select0 (Add32carry <t> x y))
  6601  	// result: (ADD <t.FieldType(0)> x y)
  6602  	for {
  6603  		if v_0.Op != ssaop.OpAdd32carry {
  6604  			break
  6605  		}
  6606  		t := v_0.Type
  6607  		y := v_0.Args[1]
  6608  		x := v_0.Args[0]
  6609  		v.Reset(ssaop.OpMIPSADD)
  6610  		v.Type = t.FieldType(0)
  6611  		v.AddArg2(x, y)
  6612  		return true
  6613  	}
  6614  	// match: (Select0 (Add32carrywithcarry <t> x y c))
  6615  	// result: (ADD <t.FieldType(0)> c (ADD <t.FieldType(0)> x y))
  6616  	for {
  6617  		if v_0.Op != ssaop.OpAdd32carrywithcarry {
  6618  			break
  6619  		}
  6620  		t := v_0.Type
  6621  		c := v_0.Args[2]
  6622  		x := v_0.Args[0]
  6623  		y := v_0.Args[1]
  6624  		v.Reset(ssaop.OpMIPSADD)
  6625  		v.Type = t.FieldType(0)
  6626  		v0 := b.NewValue0(v.Pos, ssaop.OpMIPSADD, t.FieldType(0))
  6627  		v0.AddArg2(x, y)
  6628  		v.AddArg2(c, v0)
  6629  		return true
  6630  	}
  6631  	// match: (Select0 (Sub32carry <t> x y))
  6632  	// result: (SUB <t.FieldType(0)> x y)
  6633  	for {
  6634  		if v_0.Op != ssaop.OpSub32carry {
  6635  			break
  6636  		}
  6637  		t := v_0.Type
  6638  		y := v_0.Args[1]
  6639  		x := v_0.Args[0]
  6640  		v.Reset(ssaop.OpMIPSSUB)
  6641  		v.Type = t.FieldType(0)
  6642  		v.AddArg2(x, y)
  6643  		return true
  6644  	}
  6645  	// match: (Select0 (MULTU (MOVWconst [0]) _ ))
  6646  	// result: (MOVWconst [0])
  6647  	for {
  6648  		if v_0.Op != ssaop.OpMIPSMULTU {
  6649  			break
  6650  		}
  6651  		v_0_0 := v_0.Args[0]
  6652  		v_0_1 := v_0.Args[1]
  6653  		for _i0 := 0; _i0 <= 1; _i0, v_0_0, v_0_1 = _i0+1, v_0_1, v_0_0 {
  6654  			if v_0_0.Op != ssaop.OpMIPSMOVWconst || ssa.AuxIntToInt32(v_0_0.AuxInt) != 0 {
  6655  				continue
  6656  			}
  6657  			v.Reset(ssaop.OpMIPSMOVWconst)
  6658  			v.AuxInt = ssa.Int32ToAuxInt(0)
  6659  			return true
  6660  		}
  6661  		break
  6662  	}
  6663  	// match: (Select0 (MULTU (MOVWconst [1]) _ ))
  6664  	// result: (MOVWconst [0])
  6665  	for {
  6666  		if v_0.Op != ssaop.OpMIPSMULTU {
  6667  			break
  6668  		}
  6669  		v_0_0 := v_0.Args[0]
  6670  		v_0_1 := v_0.Args[1]
  6671  		for _i0 := 0; _i0 <= 1; _i0, v_0_0, v_0_1 = _i0+1, v_0_1, v_0_0 {
  6672  			if v_0_0.Op != ssaop.OpMIPSMOVWconst || ssa.AuxIntToInt32(v_0_0.AuxInt) != 1 {
  6673  				continue
  6674  			}
  6675  			v.Reset(ssaop.OpMIPSMOVWconst)
  6676  			v.AuxInt = ssa.Int32ToAuxInt(0)
  6677  			return true
  6678  		}
  6679  		break
  6680  	}
  6681  	// match: (Select0 (MULTU (MOVWconst [-1]) x ))
  6682  	// result: (CMOVZ (ADDconst <x.Type> [-1] x) (MOVWconst [0]) x)
  6683  	for {
  6684  		if v_0.Op != ssaop.OpMIPSMULTU {
  6685  			break
  6686  		}
  6687  		_ = v_0.Args[1]
  6688  		v_0_0 := v_0.Args[0]
  6689  		v_0_1 := v_0.Args[1]
  6690  		for _i0 := 0; _i0 <= 1; _i0, v_0_0, v_0_1 = _i0+1, v_0_1, v_0_0 {
  6691  			if v_0_0.Op != ssaop.OpMIPSMOVWconst || ssa.AuxIntToInt32(v_0_0.AuxInt) != -1 {
  6692  				continue
  6693  			}
  6694  			x := v_0_1
  6695  			v.Reset(ssaop.OpMIPSCMOVZ)
  6696  			v0 := b.NewValue0(v.Pos, ssaop.OpMIPSADDconst, x.Type)
  6697  			v0.AuxInt = ssa.Int32ToAuxInt(-1)
  6698  			v0.AddArg(x)
  6699  			v1 := b.NewValue0(v.Pos, ssaop.OpMIPSMOVWconst, typ.UInt32)
  6700  			v1.AuxInt = ssa.Int32ToAuxInt(0)
  6701  			v.AddArg3(v0, v1, x)
  6702  			return true
  6703  		}
  6704  		break
  6705  	}
  6706  	// match: (Select0 (MULTU (MOVWconst [c]) x ))
  6707  	// cond: ssa.IsPowerOfTwo(uint32(c))
  6708  	// result: (SRLconst [int32(32-ssa.Log32u(uint32(c)))] x)
  6709  	for {
  6710  		if v_0.Op != ssaop.OpMIPSMULTU {
  6711  			break
  6712  		}
  6713  		_ = v_0.Args[1]
  6714  		v_0_0 := v_0.Args[0]
  6715  		v_0_1 := v_0.Args[1]
  6716  		for _i0 := 0; _i0 <= 1; _i0, v_0_0, v_0_1 = _i0+1, v_0_1, v_0_0 {
  6717  			if v_0_0.Op != ssaop.OpMIPSMOVWconst {
  6718  				continue
  6719  			}
  6720  			c := ssa.AuxIntToInt32(v_0_0.AuxInt)
  6721  			x := v_0_1
  6722  			if !(ssa.IsPowerOfTwo(uint32(c))) {
  6723  				continue
  6724  			}
  6725  			v.Reset(ssaop.OpMIPSSRLconst)
  6726  			v.AuxInt = ssa.Int32ToAuxInt(int32(32 - ssa.Log32u(uint32(c))))
  6727  			v.AddArg(x)
  6728  			return true
  6729  		}
  6730  		break
  6731  	}
  6732  	// match: (Select0 (MULTU (MOVWconst [c]) (MOVWconst [d])))
  6733  	// result: (MOVWconst [int32((int64(uint32(c))*int64(uint32(d)))>>32)])
  6734  	for {
  6735  		if v_0.Op != ssaop.OpMIPSMULTU {
  6736  			break
  6737  		}
  6738  		_ = v_0.Args[1]
  6739  		v_0_0 := v_0.Args[0]
  6740  		v_0_1 := v_0.Args[1]
  6741  		for _i0 := 0; _i0 <= 1; _i0, v_0_0, v_0_1 = _i0+1, v_0_1, v_0_0 {
  6742  			if v_0_0.Op != ssaop.OpMIPSMOVWconst {
  6743  				continue
  6744  			}
  6745  			c := ssa.AuxIntToInt32(v_0_0.AuxInt)
  6746  			if v_0_1.Op != ssaop.OpMIPSMOVWconst {
  6747  				continue
  6748  			}
  6749  			d := ssa.AuxIntToInt32(v_0_1.AuxInt)
  6750  			v.Reset(ssaop.OpMIPSMOVWconst)
  6751  			v.AuxInt = ssa.Int32ToAuxInt(int32((int64(uint32(c)) * int64(uint32(d))) >> 32))
  6752  			return true
  6753  		}
  6754  		break
  6755  	}
  6756  	// match: (Select0 (DIV (MOVWconst [c]) (MOVWconst [d])))
  6757  	// cond: d != 0
  6758  	// result: (MOVWconst [c%d])
  6759  	for {
  6760  		if v_0.Op != ssaop.OpMIPSDIV {
  6761  			break
  6762  		}
  6763  		_ = v_0.Args[1]
  6764  		v_0_0 := v_0.Args[0]
  6765  		if v_0_0.Op != ssaop.OpMIPSMOVWconst {
  6766  			break
  6767  		}
  6768  		c := ssa.AuxIntToInt32(v_0_0.AuxInt)
  6769  		v_0_1 := v_0.Args[1]
  6770  		if v_0_1.Op != ssaop.OpMIPSMOVWconst {
  6771  			break
  6772  		}
  6773  		d := ssa.AuxIntToInt32(v_0_1.AuxInt)
  6774  		if !(d != 0) {
  6775  			break
  6776  		}
  6777  		v.Reset(ssaop.OpMIPSMOVWconst)
  6778  		v.AuxInt = ssa.Int32ToAuxInt(c % d)
  6779  		return true
  6780  	}
  6781  	// match: (Select0 (DIVU (MOVWconst [c]) (MOVWconst [d])))
  6782  	// cond: d != 0
  6783  	// result: (MOVWconst [int32(uint32(c)%uint32(d))])
  6784  	for {
  6785  		if v_0.Op != ssaop.OpMIPSDIVU {
  6786  			break
  6787  		}
  6788  		_ = v_0.Args[1]
  6789  		v_0_0 := v_0.Args[0]
  6790  		if v_0_0.Op != ssaop.OpMIPSMOVWconst {
  6791  			break
  6792  		}
  6793  		c := ssa.AuxIntToInt32(v_0_0.AuxInt)
  6794  		v_0_1 := v_0.Args[1]
  6795  		if v_0_1.Op != ssaop.OpMIPSMOVWconst {
  6796  			break
  6797  		}
  6798  		d := ssa.AuxIntToInt32(v_0_1.AuxInt)
  6799  		if !(d != 0) {
  6800  			break
  6801  		}
  6802  		v.Reset(ssaop.OpMIPSMOVWconst)
  6803  		v.AuxInt = ssa.Int32ToAuxInt(int32(uint32(c) % uint32(d)))
  6804  		return true
  6805  	}
  6806  	return false
  6807  }
  6808  func rewriteValue_OpSelect1(v *ssa.Value) bool {
  6809  	v_0 := v.Args[0]
  6810  	b := v.Block
  6811  	typ := &b.Func.Config.Types
  6812  	// match: (Select1 (Add32carry <t> x y))
  6813  	// result: (SGTU <typ.Bool> x (ADD <t.FieldType(0)> x y))
  6814  	for {
  6815  		if v_0.Op != ssaop.OpAdd32carry {
  6816  			break
  6817  		}
  6818  		t := v_0.Type
  6819  		y := v_0.Args[1]
  6820  		x := v_0.Args[0]
  6821  		v.Reset(ssaop.OpMIPSSGTU)
  6822  		v.Type = typ.Bool
  6823  		v0 := b.NewValue0(v.Pos, ssaop.OpMIPSADD, t.FieldType(0))
  6824  		v0.AddArg2(x, y)
  6825  		v.AddArg2(x, v0)
  6826  		return true
  6827  	}
  6828  	// match: (Select1 (Add32carrywithcarry <t> x y c))
  6829  	// result: (OR <typ.Bool> (SGTU <typ.Bool> x xy:(ADD <t.FieldType(0)> x y)) (SGTU <typ.Bool> xy (ADD <t.FieldType(0)> c xy)))
  6830  	for {
  6831  		if v_0.Op != ssaop.OpAdd32carrywithcarry {
  6832  			break
  6833  		}
  6834  		t := v_0.Type
  6835  		c := v_0.Args[2]
  6836  		x := v_0.Args[0]
  6837  		y := v_0.Args[1]
  6838  		v.Reset(ssaop.OpMIPSOR)
  6839  		v.Type = typ.Bool
  6840  		v0 := b.NewValue0(v.Pos, ssaop.OpMIPSSGTU, typ.Bool)
  6841  		xy := b.NewValue0(v.Pos, ssaop.OpMIPSADD, t.FieldType(0))
  6842  		xy.AddArg2(x, y)
  6843  		v0.AddArg2(x, xy)
  6844  		v2 := b.NewValue0(v.Pos, ssaop.OpMIPSSGTU, typ.Bool)
  6845  		v3 := b.NewValue0(v.Pos, ssaop.OpMIPSADD, t.FieldType(0))
  6846  		v3.AddArg2(c, xy)
  6847  		v2.AddArg2(xy, v3)
  6848  		v.AddArg2(v0, v2)
  6849  		return true
  6850  	}
  6851  	// match: (Select1 (Sub32carry <t> x y))
  6852  	// result: (SGTU <typ.Bool> (SUB <t.FieldType(0)> x y) x)
  6853  	for {
  6854  		if v_0.Op != ssaop.OpSub32carry {
  6855  			break
  6856  		}
  6857  		t := v_0.Type
  6858  		y := v_0.Args[1]
  6859  		x := v_0.Args[0]
  6860  		v.Reset(ssaop.OpMIPSSGTU)
  6861  		v.Type = typ.Bool
  6862  		v0 := b.NewValue0(v.Pos, ssaop.OpMIPSSUB, t.FieldType(0))
  6863  		v0.AddArg2(x, y)
  6864  		v.AddArg2(v0, x)
  6865  		return true
  6866  	}
  6867  	// match: (Select1 (MULTU (MOVWconst [0]) _ ))
  6868  	// result: (MOVWconst [0])
  6869  	for {
  6870  		if v_0.Op != ssaop.OpMIPSMULTU {
  6871  			break
  6872  		}
  6873  		v_0_0 := v_0.Args[0]
  6874  		v_0_1 := v_0.Args[1]
  6875  		for _i0 := 0; _i0 <= 1; _i0, v_0_0, v_0_1 = _i0+1, v_0_1, v_0_0 {
  6876  			if v_0_0.Op != ssaop.OpMIPSMOVWconst || ssa.AuxIntToInt32(v_0_0.AuxInt) != 0 {
  6877  				continue
  6878  			}
  6879  			v.Reset(ssaop.OpMIPSMOVWconst)
  6880  			v.AuxInt = ssa.Int32ToAuxInt(0)
  6881  			return true
  6882  		}
  6883  		break
  6884  	}
  6885  	// match: (Select1 (MULTU (MOVWconst [1]) x ))
  6886  	// result: x
  6887  	for {
  6888  		if v_0.Op != ssaop.OpMIPSMULTU {
  6889  			break
  6890  		}
  6891  		_ = v_0.Args[1]
  6892  		v_0_0 := v_0.Args[0]
  6893  		v_0_1 := v_0.Args[1]
  6894  		for _i0 := 0; _i0 <= 1; _i0, v_0_0, v_0_1 = _i0+1, v_0_1, v_0_0 {
  6895  			if v_0_0.Op != ssaop.OpMIPSMOVWconst || ssa.AuxIntToInt32(v_0_0.AuxInt) != 1 {
  6896  				continue
  6897  			}
  6898  			x := v_0_1
  6899  			v.CopyOf(x)
  6900  			return true
  6901  		}
  6902  		break
  6903  	}
  6904  	// match: (Select1 (MULTU (MOVWconst [-1]) x ))
  6905  	// result: (NEG <x.Type> x)
  6906  	for {
  6907  		if v_0.Op != ssaop.OpMIPSMULTU {
  6908  			break
  6909  		}
  6910  		_ = v_0.Args[1]
  6911  		v_0_0 := v_0.Args[0]
  6912  		v_0_1 := v_0.Args[1]
  6913  		for _i0 := 0; _i0 <= 1; _i0, v_0_0, v_0_1 = _i0+1, v_0_1, v_0_0 {
  6914  			if v_0_0.Op != ssaop.OpMIPSMOVWconst || ssa.AuxIntToInt32(v_0_0.AuxInt) != -1 {
  6915  				continue
  6916  			}
  6917  			x := v_0_1
  6918  			v.Reset(ssaop.OpMIPSNEG)
  6919  			v.Type = x.Type
  6920  			v.AddArg(x)
  6921  			return true
  6922  		}
  6923  		break
  6924  	}
  6925  	// match: (Select1 (MULTU (MOVWconst [c]) x ))
  6926  	// cond: ssa.IsPowerOfTwo(uint32(c))
  6927  	// result: (SLLconst [int32(ssa.Log32u(uint32(c)))] x)
  6928  	for {
  6929  		if v_0.Op != ssaop.OpMIPSMULTU {
  6930  			break
  6931  		}
  6932  		_ = v_0.Args[1]
  6933  		v_0_0 := v_0.Args[0]
  6934  		v_0_1 := v_0.Args[1]
  6935  		for _i0 := 0; _i0 <= 1; _i0, v_0_0, v_0_1 = _i0+1, v_0_1, v_0_0 {
  6936  			if v_0_0.Op != ssaop.OpMIPSMOVWconst {
  6937  				continue
  6938  			}
  6939  			c := ssa.AuxIntToInt32(v_0_0.AuxInt)
  6940  			x := v_0_1
  6941  			if !(ssa.IsPowerOfTwo(uint32(c))) {
  6942  				continue
  6943  			}
  6944  			v.Reset(ssaop.OpMIPSSLLconst)
  6945  			v.AuxInt = ssa.Int32ToAuxInt(int32(ssa.Log32u(uint32(c))))
  6946  			v.AddArg(x)
  6947  			return true
  6948  		}
  6949  		break
  6950  	}
  6951  	// match: (Select1 (MULTU (MOVWconst [c]) (MOVWconst [d])))
  6952  	// result: (MOVWconst [int32(uint32(c)*uint32(d))])
  6953  	for {
  6954  		if v_0.Op != ssaop.OpMIPSMULTU {
  6955  			break
  6956  		}
  6957  		_ = v_0.Args[1]
  6958  		v_0_0 := v_0.Args[0]
  6959  		v_0_1 := v_0.Args[1]
  6960  		for _i0 := 0; _i0 <= 1; _i0, v_0_0, v_0_1 = _i0+1, v_0_1, v_0_0 {
  6961  			if v_0_0.Op != ssaop.OpMIPSMOVWconst {
  6962  				continue
  6963  			}
  6964  			c := ssa.AuxIntToInt32(v_0_0.AuxInt)
  6965  			if v_0_1.Op != ssaop.OpMIPSMOVWconst {
  6966  				continue
  6967  			}
  6968  			d := ssa.AuxIntToInt32(v_0_1.AuxInt)
  6969  			v.Reset(ssaop.OpMIPSMOVWconst)
  6970  			v.AuxInt = ssa.Int32ToAuxInt(int32(uint32(c) * uint32(d)))
  6971  			return true
  6972  		}
  6973  		break
  6974  	}
  6975  	// match: (Select1 (DIV (MOVWconst [c]) (MOVWconst [d])))
  6976  	// cond: d != 0
  6977  	// result: (MOVWconst [c/d])
  6978  	for {
  6979  		if v_0.Op != ssaop.OpMIPSDIV {
  6980  			break
  6981  		}
  6982  		_ = v_0.Args[1]
  6983  		v_0_0 := v_0.Args[0]
  6984  		if v_0_0.Op != ssaop.OpMIPSMOVWconst {
  6985  			break
  6986  		}
  6987  		c := ssa.AuxIntToInt32(v_0_0.AuxInt)
  6988  		v_0_1 := v_0.Args[1]
  6989  		if v_0_1.Op != ssaop.OpMIPSMOVWconst {
  6990  			break
  6991  		}
  6992  		d := ssa.AuxIntToInt32(v_0_1.AuxInt)
  6993  		if !(d != 0) {
  6994  			break
  6995  		}
  6996  		v.Reset(ssaop.OpMIPSMOVWconst)
  6997  		v.AuxInt = ssa.Int32ToAuxInt(c / d)
  6998  		return true
  6999  	}
  7000  	// match: (Select1 (DIVU (MOVWconst [c]) (MOVWconst [d])))
  7001  	// cond: d != 0
  7002  	// result: (MOVWconst [int32(uint32(c)/uint32(d))])
  7003  	for {
  7004  		if v_0.Op != ssaop.OpMIPSDIVU {
  7005  			break
  7006  		}
  7007  		_ = v_0.Args[1]
  7008  		v_0_0 := v_0.Args[0]
  7009  		if v_0_0.Op != ssaop.OpMIPSMOVWconst {
  7010  			break
  7011  		}
  7012  		c := ssa.AuxIntToInt32(v_0_0.AuxInt)
  7013  		v_0_1 := v_0.Args[1]
  7014  		if v_0_1.Op != ssaop.OpMIPSMOVWconst {
  7015  			break
  7016  		}
  7017  		d := ssa.AuxIntToInt32(v_0_1.AuxInt)
  7018  		if !(d != 0) {
  7019  			break
  7020  		}
  7021  		v.Reset(ssaop.OpMIPSMOVWconst)
  7022  		v.AuxInt = ssa.Int32ToAuxInt(int32(uint32(c) / uint32(d)))
  7023  		return true
  7024  	}
  7025  	return false
  7026  }
  7027  func rewriteValue_OpSignmask(v *ssa.Value) bool {
  7028  	v_0 := v.Args[0]
  7029  	// match: (Signmask x)
  7030  	// result: (SRAconst x [31])
  7031  	for {
  7032  		x := v_0
  7033  		v.Reset(ssaop.OpMIPSSRAconst)
  7034  		v.AuxInt = ssa.Int32ToAuxInt(31)
  7035  		v.AddArg(x)
  7036  		return true
  7037  	}
  7038  }
  7039  func rewriteValue_OpSlicemask(v *ssa.Value) bool {
  7040  	v_0 := v.Args[0]
  7041  	b := v.Block
  7042  	// match: (Slicemask <t> x)
  7043  	// result: (SRAconst (NEG <t> x) [31])
  7044  	for {
  7045  		t := v.Type
  7046  		x := v_0
  7047  		v.Reset(ssaop.OpMIPSSRAconst)
  7048  		v.AuxInt = ssa.Int32ToAuxInt(31)
  7049  		v0 := b.NewValue0(v.Pos, ssaop.OpMIPSNEG, t)
  7050  		v0.AddArg(x)
  7051  		v.AddArg(v0)
  7052  		return true
  7053  	}
  7054  }
  7055  func rewriteValue_OpStore(v *ssa.Value) bool {
  7056  	v_2 := v.Args[2]
  7057  	v_1 := v.Args[1]
  7058  	v_0 := v.Args[0]
  7059  	// match: (Store {t} ptr val mem)
  7060  	// cond: t.Size() == 1
  7061  	// result: (MOVBstore ptr val mem)
  7062  	for {
  7063  		t := ssa.AuxToType(v.Aux)
  7064  		ptr := v_0
  7065  		val := v_1
  7066  		mem := v_2
  7067  		if !(t.Size() == 1) {
  7068  			break
  7069  		}
  7070  		v.Reset(ssaop.OpMIPSMOVBstore)
  7071  		v.AddArg3(ptr, val, mem)
  7072  		return true
  7073  	}
  7074  	// match: (Store {t} ptr val mem)
  7075  	// cond: t.Size() == 2
  7076  	// result: (MOVHstore ptr val mem)
  7077  	for {
  7078  		t := ssa.AuxToType(v.Aux)
  7079  		ptr := v_0
  7080  		val := v_1
  7081  		mem := v_2
  7082  		if !(t.Size() == 2) {
  7083  			break
  7084  		}
  7085  		v.Reset(ssaop.OpMIPSMOVHstore)
  7086  		v.AddArg3(ptr, val, mem)
  7087  		return true
  7088  	}
  7089  	// match: (Store {t} ptr val mem)
  7090  	// cond: t.Size() == 4 && !t.IsFloat()
  7091  	// result: (MOVWstore ptr val mem)
  7092  	for {
  7093  		t := ssa.AuxToType(v.Aux)
  7094  		ptr := v_0
  7095  		val := v_1
  7096  		mem := v_2
  7097  		if !(t.Size() == 4 && !t.IsFloat()) {
  7098  			break
  7099  		}
  7100  		v.Reset(ssaop.OpMIPSMOVWstore)
  7101  		v.AddArg3(ptr, val, mem)
  7102  		return true
  7103  	}
  7104  	// match: (Store {t} ptr val mem)
  7105  	// cond: t.Size() == 4 && t.IsFloat()
  7106  	// result: (MOVFstore ptr val mem)
  7107  	for {
  7108  		t := ssa.AuxToType(v.Aux)
  7109  		ptr := v_0
  7110  		val := v_1
  7111  		mem := v_2
  7112  		if !(t.Size() == 4 && t.IsFloat()) {
  7113  			break
  7114  		}
  7115  		v.Reset(ssaop.OpMIPSMOVFstore)
  7116  		v.AddArg3(ptr, val, mem)
  7117  		return true
  7118  	}
  7119  	// match: (Store {t} ptr val mem)
  7120  	// cond: t.Size() == 8 && t.IsFloat()
  7121  	// result: (MOVDstore ptr val mem)
  7122  	for {
  7123  		t := ssa.AuxToType(v.Aux)
  7124  		ptr := v_0
  7125  		val := v_1
  7126  		mem := v_2
  7127  		if !(t.Size() == 8 && t.IsFloat()) {
  7128  			break
  7129  		}
  7130  		v.Reset(ssaop.OpMIPSMOVDstore)
  7131  		v.AddArg3(ptr, val, mem)
  7132  		return true
  7133  	}
  7134  	return false
  7135  }
  7136  func rewriteValue_OpSub32withcarry(v *ssa.Value) bool {
  7137  	v_2 := v.Args[2]
  7138  	v_1 := v.Args[1]
  7139  	v_0 := v.Args[0]
  7140  	b := v.Block
  7141  	// match: (Sub32withcarry <t> x y c)
  7142  	// result: (SUB (SUB <t> x y) c)
  7143  	for {
  7144  		t := v.Type
  7145  		x := v_0
  7146  		y := v_1
  7147  		c := v_2
  7148  		v.Reset(ssaop.OpMIPSSUB)
  7149  		v0 := b.NewValue0(v.Pos, ssaop.OpMIPSSUB, t)
  7150  		v0.AddArg2(x, y)
  7151  		v.AddArg2(v0, c)
  7152  		return true
  7153  	}
  7154  }
  7155  func rewriteValue_OpZero(v *ssa.Value) bool {
  7156  	v_1 := v.Args[1]
  7157  	v_0 := v.Args[0]
  7158  	b := v.Block
  7159  	config := b.Func.Config
  7160  	typ := &b.Func.Config.Types
  7161  	// match: (Zero [0] _ mem)
  7162  	// result: mem
  7163  	for {
  7164  		if ssa.AuxIntToInt64(v.AuxInt) != 0 {
  7165  			break
  7166  		}
  7167  		mem := v_1
  7168  		v.CopyOf(mem)
  7169  		return true
  7170  	}
  7171  	// match: (Zero [1] ptr mem)
  7172  	// result: (MOVBstore ptr (MOVWconst [0]) mem)
  7173  	for {
  7174  		if ssa.AuxIntToInt64(v.AuxInt) != 1 {
  7175  			break
  7176  		}
  7177  		ptr := v_0
  7178  		mem := v_1
  7179  		v.Reset(ssaop.OpMIPSMOVBstore)
  7180  		v0 := b.NewValue0(v.Pos, ssaop.OpMIPSMOVWconst, typ.UInt32)
  7181  		v0.AuxInt = ssa.Int32ToAuxInt(0)
  7182  		v.AddArg3(ptr, v0, mem)
  7183  		return true
  7184  	}
  7185  	// match: (Zero [2] {t} ptr mem)
  7186  	// cond: t.Alignment()%2 == 0
  7187  	// result: (MOVHstore ptr (MOVWconst [0]) mem)
  7188  	for {
  7189  		if ssa.AuxIntToInt64(v.AuxInt) != 2 {
  7190  			break
  7191  		}
  7192  		t := ssa.AuxToType(v.Aux)
  7193  		ptr := v_0
  7194  		mem := v_1
  7195  		if !(t.Alignment()%2 == 0) {
  7196  			break
  7197  		}
  7198  		v.Reset(ssaop.OpMIPSMOVHstore)
  7199  		v0 := b.NewValue0(v.Pos, ssaop.OpMIPSMOVWconst, typ.UInt32)
  7200  		v0.AuxInt = ssa.Int32ToAuxInt(0)
  7201  		v.AddArg3(ptr, v0, mem)
  7202  		return true
  7203  	}
  7204  	// match: (Zero [2] ptr mem)
  7205  	// result: (MOVBstore [1] ptr (MOVWconst [0]) (MOVBstore [0] ptr (MOVWconst [0]) mem))
  7206  	for {
  7207  		if ssa.AuxIntToInt64(v.AuxInt) != 2 {
  7208  			break
  7209  		}
  7210  		ptr := v_0
  7211  		mem := v_1
  7212  		v.Reset(ssaop.OpMIPSMOVBstore)
  7213  		v.AuxInt = ssa.Int32ToAuxInt(1)
  7214  		v0 := b.NewValue0(v.Pos, ssaop.OpMIPSMOVWconst, typ.UInt32)
  7215  		v0.AuxInt = ssa.Int32ToAuxInt(0)
  7216  		v1 := b.NewValue0(v.Pos, ssaop.OpMIPSMOVBstore, types.TypeMem)
  7217  		v1.AuxInt = ssa.Int32ToAuxInt(0)
  7218  		v1.AddArg3(ptr, v0, mem)
  7219  		v.AddArg3(ptr, v0, v1)
  7220  		return true
  7221  	}
  7222  	// match: (Zero [4] {t} ptr mem)
  7223  	// cond: t.Alignment()%4 == 0
  7224  	// result: (MOVWstore ptr (MOVWconst [0]) mem)
  7225  	for {
  7226  		if ssa.AuxIntToInt64(v.AuxInt) != 4 {
  7227  			break
  7228  		}
  7229  		t := ssa.AuxToType(v.Aux)
  7230  		ptr := v_0
  7231  		mem := v_1
  7232  		if !(t.Alignment()%4 == 0) {
  7233  			break
  7234  		}
  7235  		v.Reset(ssaop.OpMIPSMOVWstore)
  7236  		v0 := b.NewValue0(v.Pos, ssaop.OpMIPSMOVWconst, typ.UInt32)
  7237  		v0.AuxInt = ssa.Int32ToAuxInt(0)
  7238  		v.AddArg3(ptr, v0, mem)
  7239  		return true
  7240  	}
  7241  	// match: (Zero [4] {t} ptr mem)
  7242  	// cond: t.Alignment()%2 == 0
  7243  	// result: (MOVHstore [2] ptr (MOVWconst [0]) (MOVHstore [0] ptr (MOVWconst [0]) mem))
  7244  	for {
  7245  		if ssa.AuxIntToInt64(v.AuxInt) != 4 {
  7246  			break
  7247  		}
  7248  		t := ssa.AuxToType(v.Aux)
  7249  		ptr := v_0
  7250  		mem := v_1
  7251  		if !(t.Alignment()%2 == 0) {
  7252  			break
  7253  		}
  7254  		v.Reset(ssaop.OpMIPSMOVHstore)
  7255  		v.AuxInt = ssa.Int32ToAuxInt(2)
  7256  		v0 := b.NewValue0(v.Pos, ssaop.OpMIPSMOVWconst, typ.UInt32)
  7257  		v0.AuxInt = ssa.Int32ToAuxInt(0)
  7258  		v1 := b.NewValue0(v.Pos, ssaop.OpMIPSMOVHstore, types.TypeMem)
  7259  		v1.AuxInt = ssa.Int32ToAuxInt(0)
  7260  		v1.AddArg3(ptr, v0, mem)
  7261  		v.AddArg3(ptr, v0, v1)
  7262  		return true
  7263  	}
  7264  	// match: (Zero [4] ptr mem)
  7265  	// result: (MOVBstore [3] ptr (MOVWconst [0]) (MOVBstore [2] ptr (MOVWconst [0]) (MOVBstore [1] ptr (MOVWconst [0]) (MOVBstore [0] ptr (MOVWconst [0]) mem))))
  7266  	for {
  7267  		if ssa.AuxIntToInt64(v.AuxInt) != 4 {
  7268  			break
  7269  		}
  7270  		ptr := v_0
  7271  		mem := v_1
  7272  		v.Reset(ssaop.OpMIPSMOVBstore)
  7273  		v.AuxInt = ssa.Int32ToAuxInt(3)
  7274  		v0 := b.NewValue0(v.Pos, ssaop.OpMIPSMOVWconst, typ.UInt32)
  7275  		v0.AuxInt = ssa.Int32ToAuxInt(0)
  7276  		v1 := b.NewValue0(v.Pos, ssaop.OpMIPSMOVBstore, types.TypeMem)
  7277  		v1.AuxInt = ssa.Int32ToAuxInt(2)
  7278  		v2 := b.NewValue0(v.Pos, ssaop.OpMIPSMOVBstore, types.TypeMem)
  7279  		v2.AuxInt = ssa.Int32ToAuxInt(1)
  7280  		v3 := b.NewValue0(v.Pos, ssaop.OpMIPSMOVBstore, types.TypeMem)
  7281  		v3.AuxInt = ssa.Int32ToAuxInt(0)
  7282  		v3.AddArg3(ptr, v0, mem)
  7283  		v2.AddArg3(ptr, v0, v3)
  7284  		v1.AddArg3(ptr, v0, v2)
  7285  		v.AddArg3(ptr, v0, v1)
  7286  		return true
  7287  	}
  7288  	// match: (Zero [3] ptr mem)
  7289  	// result: (MOVBstore [2] ptr (MOVWconst [0]) (MOVBstore [1] ptr (MOVWconst [0]) (MOVBstore [0] ptr (MOVWconst [0]) mem)))
  7290  	for {
  7291  		if ssa.AuxIntToInt64(v.AuxInt) != 3 {
  7292  			break
  7293  		}
  7294  		ptr := v_0
  7295  		mem := v_1
  7296  		v.Reset(ssaop.OpMIPSMOVBstore)
  7297  		v.AuxInt = ssa.Int32ToAuxInt(2)
  7298  		v0 := b.NewValue0(v.Pos, ssaop.OpMIPSMOVWconst, typ.UInt32)
  7299  		v0.AuxInt = ssa.Int32ToAuxInt(0)
  7300  		v1 := b.NewValue0(v.Pos, ssaop.OpMIPSMOVBstore, types.TypeMem)
  7301  		v1.AuxInt = ssa.Int32ToAuxInt(1)
  7302  		v2 := b.NewValue0(v.Pos, ssaop.OpMIPSMOVBstore, types.TypeMem)
  7303  		v2.AuxInt = ssa.Int32ToAuxInt(0)
  7304  		v2.AddArg3(ptr, v0, mem)
  7305  		v1.AddArg3(ptr, v0, v2)
  7306  		v.AddArg3(ptr, v0, v1)
  7307  		return true
  7308  	}
  7309  	// match: (Zero [6] {t} ptr mem)
  7310  	// cond: t.Alignment()%2 == 0
  7311  	// result: (MOVHstore [4] ptr (MOVWconst [0]) (MOVHstore [2] ptr (MOVWconst [0]) (MOVHstore [0] ptr (MOVWconst [0]) mem)))
  7312  	for {
  7313  		if ssa.AuxIntToInt64(v.AuxInt) != 6 {
  7314  			break
  7315  		}
  7316  		t := ssa.AuxToType(v.Aux)
  7317  		ptr := v_0
  7318  		mem := v_1
  7319  		if !(t.Alignment()%2 == 0) {
  7320  			break
  7321  		}
  7322  		v.Reset(ssaop.OpMIPSMOVHstore)
  7323  		v.AuxInt = ssa.Int32ToAuxInt(4)
  7324  		v0 := b.NewValue0(v.Pos, ssaop.OpMIPSMOVWconst, typ.UInt32)
  7325  		v0.AuxInt = ssa.Int32ToAuxInt(0)
  7326  		v1 := b.NewValue0(v.Pos, ssaop.OpMIPSMOVHstore, types.TypeMem)
  7327  		v1.AuxInt = ssa.Int32ToAuxInt(2)
  7328  		v2 := b.NewValue0(v.Pos, ssaop.OpMIPSMOVHstore, types.TypeMem)
  7329  		v2.AuxInt = ssa.Int32ToAuxInt(0)
  7330  		v2.AddArg3(ptr, v0, mem)
  7331  		v1.AddArg3(ptr, v0, v2)
  7332  		v.AddArg3(ptr, v0, v1)
  7333  		return true
  7334  	}
  7335  	// match: (Zero [8] {t} ptr mem)
  7336  	// cond: t.Alignment()%4 == 0
  7337  	// result: (MOVWstore [4] ptr (MOVWconst [0]) (MOVWstore [0] ptr (MOVWconst [0]) mem))
  7338  	for {
  7339  		if ssa.AuxIntToInt64(v.AuxInt) != 8 {
  7340  			break
  7341  		}
  7342  		t := ssa.AuxToType(v.Aux)
  7343  		ptr := v_0
  7344  		mem := v_1
  7345  		if !(t.Alignment()%4 == 0) {
  7346  			break
  7347  		}
  7348  		v.Reset(ssaop.OpMIPSMOVWstore)
  7349  		v.AuxInt = ssa.Int32ToAuxInt(4)
  7350  		v0 := b.NewValue0(v.Pos, ssaop.OpMIPSMOVWconst, typ.UInt32)
  7351  		v0.AuxInt = ssa.Int32ToAuxInt(0)
  7352  		v1 := b.NewValue0(v.Pos, ssaop.OpMIPSMOVWstore, types.TypeMem)
  7353  		v1.AuxInt = ssa.Int32ToAuxInt(0)
  7354  		v1.AddArg3(ptr, v0, mem)
  7355  		v.AddArg3(ptr, v0, v1)
  7356  		return true
  7357  	}
  7358  	// match: (Zero [12] {t} ptr mem)
  7359  	// cond: t.Alignment()%4 == 0
  7360  	// result: (MOVWstore [8] ptr (MOVWconst [0]) (MOVWstore [4] ptr (MOVWconst [0]) (MOVWstore [0] ptr (MOVWconst [0]) mem)))
  7361  	for {
  7362  		if ssa.AuxIntToInt64(v.AuxInt) != 12 {
  7363  			break
  7364  		}
  7365  		t := ssa.AuxToType(v.Aux)
  7366  		ptr := v_0
  7367  		mem := v_1
  7368  		if !(t.Alignment()%4 == 0) {
  7369  			break
  7370  		}
  7371  		v.Reset(ssaop.OpMIPSMOVWstore)
  7372  		v.AuxInt = ssa.Int32ToAuxInt(8)
  7373  		v0 := b.NewValue0(v.Pos, ssaop.OpMIPSMOVWconst, typ.UInt32)
  7374  		v0.AuxInt = ssa.Int32ToAuxInt(0)
  7375  		v1 := b.NewValue0(v.Pos, ssaop.OpMIPSMOVWstore, types.TypeMem)
  7376  		v1.AuxInt = ssa.Int32ToAuxInt(4)
  7377  		v2 := b.NewValue0(v.Pos, ssaop.OpMIPSMOVWstore, types.TypeMem)
  7378  		v2.AuxInt = ssa.Int32ToAuxInt(0)
  7379  		v2.AddArg3(ptr, v0, mem)
  7380  		v1.AddArg3(ptr, v0, v2)
  7381  		v.AddArg3(ptr, v0, v1)
  7382  		return true
  7383  	}
  7384  	// match: (Zero [16] {t} ptr mem)
  7385  	// cond: t.Alignment()%4 == 0
  7386  	// result: (MOVWstore [12] ptr (MOVWconst [0]) (MOVWstore [8] ptr (MOVWconst [0]) (MOVWstore [4] ptr (MOVWconst [0]) (MOVWstore [0] ptr (MOVWconst [0]) mem))))
  7387  	for {
  7388  		if ssa.AuxIntToInt64(v.AuxInt) != 16 {
  7389  			break
  7390  		}
  7391  		t := ssa.AuxToType(v.Aux)
  7392  		ptr := v_0
  7393  		mem := v_1
  7394  		if !(t.Alignment()%4 == 0) {
  7395  			break
  7396  		}
  7397  		v.Reset(ssaop.OpMIPSMOVWstore)
  7398  		v.AuxInt = ssa.Int32ToAuxInt(12)
  7399  		v0 := b.NewValue0(v.Pos, ssaop.OpMIPSMOVWconst, typ.UInt32)
  7400  		v0.AuxInt = ssa.Int32ToAuxInt(0)
  7401  		v1 := b.NewValue0(v.Pos, ssaop.OpMIPSMOVWstore, types.TypeMem)
  7402  		v1.AuxInt = ssa.Int32ToAuxInt(8)
  7403  		v2 := b.NewValue0(v.Pos, ssaop.OpMIPSMOVWstore, types.TypeMem)
  7404  		v2.AuxInt = ssa.Int32ToAuxInt(4)
  7405  		v3 := b.NewValue0(v.Pos, ssaop.OpMIPSMOVWstore, types.TypeMem)
  7406  		v3.AuxInt = ssa.Int32ToAuxInt(0)
  7407  		v3.AddArg3(ptr, v0, mem)
  7408  		v2.AddArg3(ptr, v0, v3)
  7409  		v1.AddArg3(ptr, v0, v2)
  7410  		v.AddArg3(ptr, v0, v1)
  7411  		return true
  7412  	}
  7413  	// match: (Zero [s] {t} ptr mem)
  7414  	// cond: (s > 16 || t.Alignment()%4 != 0)
  7415  	// result: (LoweredZero [int32(t.Alignment())] ptr (ADDconst <ptr.Type> ptr [int32(s-ssa.MoveSize(t.Alignment(), config))]) mem)
  7416  	for {
  7417  		s := ssa.AuxIntToInt64(v.AuxInt)
  7418  		t := ssa.AuxToType(v.Aux)
  7419  		ptr := v_0
  7420  		mem := v_1
  7421  		if !(s > 16 || t.Alignment()%4 != 0) {
  7422  			break
  7423  		}
  7424  		v.Reset(ssaop.OpMIPSLoweredZero)
  7425  		v.AuxInt = ssa.Int32ToAuxInt(int32(t.Alignment()))
  7426  		v0 := b.NewValue0(v.Pos, ssaop.OpMIPSADDconst, ptr.Type)
  7427  		v0.AuxInt = ssa.Int32ToAuxInt(int32(s - ssa.MoveSize(t.Alignment(), config)))
  7428  		v0.AddArg(ptr)
  7429  		v.AddArg3(ptr, v0, mem)
  7430  		return true
  7431  	}
  7432  	return false
  7433  }
  7434  func rewriteValue_OpZeromask(v *ssa.Value) bool {
  7435  	v_0 := v.Args[0]
  7436  	b := v.Block
  7437  	typ := &b.Func.Config.Types
  7438  	// match: (Zeromask x)
  7439  	// result: (NEG (SGTU x (MOVWconst [0])))
  7440  	for {
  7441  		x := v_0
  7442  		v.Reset(ssaop.OpMIPSNEG)
  7443  		v0 := b.NewValue0(v.Pos, ssaop.OpMIPSSGTU, typ.Bool)
  7444  		v1 := b.NewValue0(v.Pos, ssaop.OpMIPSMOVWconst, typ.UInt32)
  7445  		v1.AuxInt = ssa.Int32ToAuxInt(0)
  7446  		v0.AddArg2(x, v1)
  7447  		v.AddArg(v0)
  7448  		return true
  7449  	}
  7450  }
  7451  func RewriteBlock(b *ssa.Block) bool {
  7452  	switch b.Kind {
  7453  	case block.BlockMIPSEQ:
  7454  		// match: (EQ (FPFlagTrue cmp) yes no)
  7455  		// result: (FPF cmp yes no)
  7456  		for b.Controls[0].Op == ssaop.OpMIPSFPFlagTrue {
  7457  			v_0 := b.Controls[0]
  7458  			cmp := v_0.Args[0]
  7459  			b.ResetWithControl(block.BlockMIPSFPF, cmp)
  7460  			return true
  7461  		}
  7462  		// match: (EQ (FPFlagFalse cmp) yes no)
  7463  		// result: (FPT cmp yes no)
  7464  		for b.Controls[0].Op == ssaop.OpMIPSFPFlagFalse {
  7465  			v_0 := b.Controls[0]
  7466  			cmp := v_0.Args[0]
  7467  			b.ResetWithControl(block.BlockMIPSFPT, cmp)
  7468  			return true
  7469  		}
  7470  		// match: (EQ (XORconst [1] cmp:(SGT _ _)) yes no)
  7471  		// result: (NE cmp yes no)
  7472  		for b.Controls[0].Op == ssaop.OpMIPSXORconst {
  7473  			v_0 := b.Controls[0]
  7474  			if ssa.AuxIntToInt32(v_0.AuxInt) != 1 {
  7475  				break
  7476  			}
  7477  			cmp := v_0.Args[0]
  7478  			if cmp.Op != ssaop.OpMIPSSGT {
  7479  				break
  7480  			}
  7481  			b.ResetWithControl(block.BlockMIPSNE, cmp)
  7482  			return true
  7483  		}
  7484  		// match: (EQ (XORconst [1] cmp:(SGTU _ _)) yes no)
  7485  		// result: (NE cmp yes no)
  7486  		for b.Controls[0].Op == ssaop.OpMIPSXORconst {
  7487  			v_0 := b.Controls[0]
  7488  			if ssa.AuxIntToInt32(v_0.AuxInt) != 1 {
  7489  				break
  7490  			}
  7491  			cmp := v_0.Args[0]
  7492  			if cmp.Op != ssaop.OpMIPSSGTU {
  7493  				break
  7494  			}
  7495  			b.ResetWithControl(block.BlockMIPSNE, cmp)
  7496  			return true
  7497  		}
  7498  		// match: (EQ (XORconst [1] cmp:(SGTconst _)) yes no)
  7499  		// result: (NE cmp yes no)
  7500  		for b.Controls[0].Op == ssaop.OpMIPSXORconst {
  7501  			v_0 := b.Controls[0]
  7502  			if ssa.AuxIntToInt32(v_0.AuxInt) != 1 {
  7503  				break
  7504  			}
  7505  			cmp := v_0.Args[0]
  7506  			if cmp.Op != ssaop.OpMIPSSGTconst {
  7507  				break
  7508  			}
  7509  			b.ResetWithControl(block.BlockMIPSNE, cmp)
  7510  			return true
  7511  		}
  7512  		// match: (EQ (XORconst [1] cmp:(SGTUconst _)) yes no)
  7513  		// result: (NE cmp yes no)
  7514  		for b.Controls[0].Op == ssaop.OpMIPSXORconst {
  7515  			v_0 := b.Controls[0]
  7516  			if ssa.AuxIntToInt32(v_0.AuxInt) != 1 {
  7517  				break
  7518  			}
  7519  			cmp := v_0.Args[0]
  7520  			if cmp.Op != ssaop.OpMIPSSGTUconst {
  7521  				break
  7522  			}
  7523  			b.ResetWithControl(block.BlockMIPSNE, cmp)
  7524  			return true
  7525  		}
  7526  		// match: (EQ (XORconst [1] cmp:(SGTzero _)) yes no)
  7527  		// result: (NE cmp yes no)
  7528  		for b.Controls[0].Op == ssaop.OpMIPSXORconst {
  7529  			v_0 := b.Controls[0]
  7530  			if ssa.AuxIntToInt32(v_0.AuxInt) != 1 {
  7531  				break
  7532  			}
  7533  			cmp := v_0.Args[0]
  7534  			if cmp.Op != ssaop.OpMIPSSGTzero {
  7535  				break
  7536  			}
  7537  			b.ResetWithControl(block.BlockMIPSNE, cmp)
  7538  			return true
  7539  		}
  7540  		// match: (EQ (XORconst [1] cmp:(SGTUzero _)) yes no)
  7541  		// result: (NE cmp yes no)
  7542  		for b.Controls[0].Op == ssaop.OpMIPSXORconst {
  7543  			v_0 := b.Controls[0]
  7544  			if ssa.AuxIntToInt32(v_0.AuxInt) != 1 {
  7545  				break
  7546  			}
  7547  			cmp := v_0.Args[0]
  7548  			if cmp.Op != ssaop.OpMIPSSGTUzero {
  7549  				break
  7550  			}
  7551  			b.ResetWithControl(block.BlockMIPSNE, cmp)
  7552  			return true
  7553  		}
  7554  		// match: (EQ (SGTUconst [1] x) yes no)
  7555  		// result: (NE x yes no)
  7556  		for b.Controls[0].Op == ssaop.OpMIPSSGTUconst {
  7557  			v_0 := b.Controls[0]
  7558  			if ssa.AuxIntToInt32(v_0.AuxInt) != 1 {
  7559  				break
  7560  			}
  7561  			x := v_0.Args[0]
  7562  			b.ResetWithControl(block.BlockMIPSNE, x)
  7563  			return true
  7564  		}
  7565  		// match: (EQ (SGTUzero x) yes no)
  7566  		// result: (EQ x yes no)
  7567  		for b.Controls[0].Op == ssaop.OpMIPSSGTUzero {
  7568  			v_0 := b.Controls[0]
  7569  			x := v_0.Args[0]
  7570  			b.ResetWithControl(block.BlockMIPSEQ, x)
  7571  			return true
  7572  		}
  7573  		// match: (EQ (SGTconst [0] x) yes no)
  7574  		// result: (GEZ x yes no)
  7575  		for b.Controls[0].Op == ssaop.OpMIPSSGTconst {
  7576  			v_0 := b.Controls[0]
  7577  			if ssa.AuxIntToInt32(v_0.AuxInt) != 0 {
  7578  				break
  7579  			}
  7580  			x := v_0.Args[0]
  7581  			b.ResetWithControl(block.BlockMIPSGEZ, x)
  7582  			return true
  7583  		}
  7584  		// match: (EQ (SGTzero x) yes no)
  7585  		// result: (LEZ x yes no)
  7586  		for b.Controls[0].Op == ssaop.OpMIPSSGTzero {
  7587  			v_0 := b.Controls[0]
  7588  			x := v_0.Args[0]
  7589  			b.ResetWithControl(block.BlockMIPSLEZ, x)
  7590  			return true
  7591  		}
  7592  		// match: (EQ (MOVWconst [0]) yes no)
  7593  		// result: (First yes no)
  7594  		for b.Controls[0].Op == ssaop.OpMIPSMOVWconst {
  7595  			v_0 := b.Controls[0]
  7596  			if ssa.AuxIntToInt32(v_0.AuxInt) != 0 {
  7597  				break
  7598  			}
  7599  			b.Reset(block.BlockFirst)
  7600  			return true
  7601  		}
  7602  		// match: (EQ (MOVWconst [c]) yes no)
  7603  		// cond: c != 0
  7604  		// result: (First no yes)
  7605  		for b.Controls[0].Op == ssaop.OpMIPSMOVWconst {
  7606  			v_0 := b.Controls[0]
  7607  			c := ssa.AuxIntToInt32(v_0.AuxInt)
  7608  			if !(c != 0) {
  7609  				break
  7610  			}
  7611  			b.Reset(block.BlockFirst)
  7612  			b.SwapSuccessors()
  7613  			return true
  7614  		}
  7615  	case block.BlockMIPSGEZ:
  7616  		// match: (GEZ (MOVWconst [c]) yes no)
  7617  		// cond: c >= 0
  7618  		// result: (First yes no)
  7619  		for b.Controls[0].Op == ssaop.OpMIPSMOVWconst {
  7620  			v_0 := b.Controls[0]
  7621  			c := ssa.AuxIntToInt32(v_0.AuxInt)
  7622  			if !(c >= 0) {
  7623  				break
  7624  			}
  7625  			b.Reset(block.BlockFirst)
  7626  			return true
  7627  		}
  7628  		// match: (GEZ (MOVWconst [c]) yes no)
  7629  		// cond: c < 0
  7630  		// result: (First no yes)
  7631  		for b.Controls[0].Op == ssaop.OpMIPSMOVWconst {
  7632  			v_0 := b.Controls[0]
  7633  			c := ssa.AuxIntToInt32(v_0.AuxInt)
  7634  			if !(c < 0) {
  7635  				break
  7636  			}
  7637  			b.Reset(block.BlockFirst)
  7638  			b.SwapSuccessors()
  7639  			return true
  7640  		}
  7641  	case block.BlockMIPSGTZ:
  7642  		// match: (GTZ (MOVWconst [c]) yes no)
  7643  		// cond: c > 0
  7644  		// result: (First yes no)
  7645  		for b.Controls[0].Op == ssaop.OpMIPSMOVWconst {
  7646  			v_0 := b.Controls[0]
  7647  			c := ssa.AuxIntToInt32(v_0.AuxInt)
  7648  			if !(c > 0) {
  7649  				break
  7650  			}
  7651  			b.Reset(block.BlockFirst)
  7652  			return true
  7653  		}
  7654  		// match: (GTZ (MOVWconst [c]) yes no)
  7655  		// cond: c <= 0
  7656  		// result: (First no yes)
  7657  		for b.Controls[0].Op == ssaop.OpMIPSMOVWconst {
  7658  			v_0 := b.Controls[0]
  7659  			c := ssa.AuxIntToInt32(v_0.AuxInt)
  7660  			if !(c <= 0) {
  7661  				break
  7662  			}
  7663  			b.Reset(block.BlockFirst)
  7664  			b.SwapSuccessors()
  7665  			return true
  7666  		}
  7667  	case block.BlockIf:
  7668  		// match: (If cond yes no)
  7669  		// result: (NE cond yes no)
  7670  		for {
  7671  			cond := b.Controls[0]
  7672  			b.ResetWithControl(block.BlockMIPSNE, cond)
  7673  			return true
  7674  		}
  7675  	case block.BlockMIPSLEZ:
  7676  		// match: (LEZ (MOVWconst [c]) yes no)
  7677  		// cond: c <= 0
  7678  		// result: (First yes no)
  7679  		for b.Controls[0].Op == ssaop.OpMIPSMOVWconst {
  7680  			v_0 := b.Controls[0]
  7681  			c := ssa.AuxIntToInt32(v_0.AuxInt)
  7682  			if !(c <= 0) {
  7683  				break
  7684  			}
  7685  			b.Reset(block.BlockFirst)
  7686  			return true
  7687  		}
  7688  		// match: (LEZ (MOVWconst [c]) yes no)
  7689  		// cond: c > 0
  7690  		// result: (First no yes)
  7691  		for b.Controls[0].Op == ssaop.OpMIPSMOVWconst {
  7692  			v_0 := b.Controls[0]
  7693  			c := ssa.AuxIntToInt32(v_0.AuxInt)
  7694  			if !(c > 0) {
  7695  				break
  7696  			}
  7697  			b.Reset(block.BlockFirst)
  7698  			b.SwapSuccessors()
  7699  			return true
  7700  		}
  7701  	case block.BlockMIPSLTZ:
  7702  		// match: (LTZ (MOVWconst [c]) yes no)
  7703  		// cond: c < 0
  7704  		// result: (First yes no)
  7705  		for b.Controls[0].Op == ssaop.OpMIPSMOVWconst {
  7706  			v_0 := b.Controls[0]
  7707  			c := ssa.AuxIntToInt32(v_0.AuxInt)
  7708  			if !(c < 0) {
  7709  				break
  7710  			}
  7711  			b.Reset(block.BlockFirst)
  7712  			return true
  7713  		}
  7714  		// match: (LTZ (MOVWconst [c]) yes no)
  7715  		// cond: c >= 0
  7716  		// result: (First no yes)
  7717  		for b.Controls[0].Op == ssaop.OpMIPSMOVWconst {
  7718  			v_0 := b.Controls[0]
  7719  			c := ssa.AuxIntToInt32(v_0.AuxInt)
  7720  			if !(c >= 0) {
  7721  				break
  7722  			}
  7723  			b.Reset(block.BlockFirst)
  7724  			b.SwapSuccessors()
  7725  			return true
  7726  		}
  7727  	case block.BlockMIPSNE:
  7728  		// match: (NE (FPFlagTrue cmp) yes no)
  7729  		// result: (FPT cmp yes no)
  7730  		for b.Controls[0].Op == ssaop.OpMIPSFPFlagTrue {
  7731  			v_0 := b.Controls[0]
  7732  			cmp := v_0.Args[0]
  7733  			b.ResetWithControl(block.BlockMIPSFPT, cmp)
  7734  			return true
  7735  		}
  7736  		// match: (NE (FPFlagFalse cmp) yes no)
  7737  		// result: (FPF cmp yes no)
  7738  		for b.Controls[0].Op == ssaop.OpMIPSFPFlagFalse {
  7739  			v_0 := b.Controls[0]
  7740  			cmp := v_0.Args[0]
  7741  			b.ResetWithControl(block.BlockMIPSFPF, cmp)
  7742  			return true
  7743  		}
  7744  		// match: (NE (XORconst [1] cmp:(SGT _ _)) yes no)
  7745  		// result: (EQ cmp yes no)
  7746  		for b.Controls[0].Op == ssaop.OpMIPSXORconst {
  7747  			v_0 := b.Controls[0]
  7748  			if ssa.AuxIntToInt32(v_0.AuxInt) != 1 {
  7749  				break
  7750  			}
  7751  			cmp := v_0.Args[0]
  7752  			if cmp.Op != ssaop.OpMIPSSGT {
  7753  				break
  7754  			}
  7755  			b.ResetWithControl(block.BlockMIPSEQ, cmp)
  7756  			return true
  7757  		}
  7758  		// match: (NE (XORconst [1] cmp:(SGTU _ _)) yes no)
  7759  		// result: (EQ cmp yes no)
  7760  		for b.Controls[0].Op == ssaop.OpMIPSXORconst {
  7761  			v_0 := b.Controls[0]
  7762  			if ssa.AuxIntToInt32(v_0.AuxInt) != 1 {
  7763  				break
  7764  			}
  7765  			cmp := v_0.Args[0]
  7766  			if cmp.Op != ssaop.OpMIPSSGTU {
  7767  				break
  7768  			}
  7769  			b.ResetWithControl(block.BlockMIPSEQ, cmp)
  7770  			return true
  7771  		}
  7772  		// match: (NE (XORconst [1] cmp:(SGTconst _)) yes no)
  7773  		// result: (EQ cmp yes no)
  7774  		for b.Controls[0].Op == ssaop.OpMIPSXORconst {
  7775  			v_0 := b.Controls[0]
  7776  			if ssa.AuxIntToInt32(v_0.AuxInt) != 1 {
  7777  				break
  7778  			}
  7779  			cmp := v_0.Args[0]
  7780  			if cmp.Op != ssaop.OpMIPSSGTconst {
  7781  				break
  7782  			}
  7783  			b.ResetWithControl(block.BlockMIPSEQ, cmp)
  7784  			return true
  7785  		}
  7786  		// match: (NE (XORconst [1] cmp:(SGTUconst _)) yes no)
  7787  		// result: (EQ cmp yes no)
  7788  		for b.Controls[0].Op == ssaop.OpMIPSXORconst {
  7789  			v_0 := b.Controls[0]
  7790  			if ssa.AuxIntToInt32(v_0.AuxInt) != 1 {
  7791  				break
  7792  			}
  7793  			cmp := v_0.Args[0]
  7794  			if cmp.Op != ssaop.OpMIPSSGTUconst {
  7795  				break
  7796  			}
  7797  			b.ResetWithControl(block.BlockMIPSEQ, cmp)
  7798  			return true
  7799  		}
  7800  		// match: (NE (XORconst [1] cmp:(SGTzero _)) yes no)
  7801  		// result: (EQ cmp yes no)
  7802  		for b.Controls[0].Op == ssaop.OpMIPSXORconst {
  7803  			v_0 := b.Controls[0]
  7804  			if ssa.AuxIntToInt32(v_0.AuxInt) != 1 {
  7805  				break
  7806  			}
  7807  			cmp := v_0.Args[0]
  7808  			if cmp.Op != ssaop.OpMIPSSGTzero {
  7809  				break
  7810  			}
  7811  			b.ResetWithControl(block.BlockMIPSEQ, cmp)
  7812  			return true
  7813  		}
  7814  		// match: (NE (XORconst [1] cmp:(SGTUzero _)) yes no)
  7815  		// result: (EQ cmp yes no)
  7816  		for b.Controls[0].Op == ssaop.OpMIPSXORconst {
  7817  			v_0 := b.Controls[0]
  7818  			if ssa.AuxIntToInt32(v_0.AuxInt) != 1 {
  7819  				break
  7820  			}
  7821  			cmp := v_0.Args[0]
  7822  			if cmp.Op != ssaop.OpMIPSSGTUzero {
  7823  				break
  7824  			}
  7825  			b.ResetWithControl(block.BlockMIPSEQ, cmp)
  7826  			return true
  7827  		}
  7828  		// match: (NE (SGTUconst [1] x) yes no)
  7829  		// result: (EQ x yes no)
  7830  		for b.Controls[0].Op == ssaop.OpMIPSSGTUconst {
  7831  			v_0 := b.Controls[0]
  7832  			if ssa.AuxIntToInt32(v_0.AuxInt) != 1 {
  7833  				break
  7834  			}
  7835  			x := v_0.Args[0]
  7836  			b.ResetWithControl(block.BlockMIPSEQ, x)
  7837  			return true
  7838  		}
  7839  		// match: (NE (SGTUzero x) yes no)
  7840  		// result: (NE x yes no)
  7841  		for b.Controls[0].Op == ssaop.OpMIPSSGTUzero {
  7842  			v_0 := b.Controls[0]
  7843  			x := v_0.Args[0]
  7844  			b.ResetWithControl(block.BlockMIPSNE, x)
  7845  			return true
  7846  		}
  7847  		// match: (NE (SGTconst [0] x) yes no)
  7848  		// result: (LTZ x yes no)
  7849  		for b.Controls[0].Op == ssaop.OpMIPSSGTconst {
  7850  			v_0 := b.Controls[0]
  7851  			if ssa.AuxIntToInt32(v_0.AuxInt) != 0 {
  7852  				break
  7853  			}
  7854  			x := v_0.Args[0]
  7855  			b.ResetWithControl(block.BlockMIPSLTZ, x)
  7856  			return true
  7857  		}
  7858  		// match: (NE (SGTzero x) yes no)
  7859  		// result: (GTZ x yes no)
  7860  		for b.Controls[0].Op == ssaop.OpMIPSSGTzero {
  7861  			v_0 := b.Controls[0]
  7862  			x := v_0.Args[0]
  7863  			b.ResetWithControl(block.BlockMIPSGTZ, x)
  7864  			return true
  7865  		}
  7866  		// match: (NE (MOVWconst [0]) yes no)
  7867  		// result: (First no yes)
  7868  		for b.Controls[0].Op == ssaop.OpMIPSMOVWconst {
  7869  			v_0 := b.Controls[0]
  7870  			if ssa.AuxIntToInt32(v_0.AuxInt) != 0 {
  7871  				break
  7872  			}
  7873  			b.Reset(block.BlockFirst)
  7874  			b.SwapSuccessors()
  7875  			return true
  7876  		}
  7877  		// match: (NE (MOVWconst [c]) yes no)
  7878  		// cond: c != 0
  7879  		// result: (First yes no)
  7880  		for b.Controls[0].Op == ssaop.OpMIPSMOVWconst {
  7881  			v_0 := b.Controls[0]
  7882  			c := ssa.AuxIntToInt32(v_0.AuxInt)
  7883  			if !(c != 0) {
  7884  				break
  7885  			}
  7886  			b.Reset(block.BlockFirst)
  7887  			return true
  7888  		}
  7889  	}
  7890  	return false
  7891  }
  7892  

View as plain text