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

     1  // Code generated from _gen/LOONG64.rules using 'go generate'; DO NOT EDIT.
     2  
     3  package ssa
     4  
     5  import "cmd/compile/internal/types"
     6  
     7  func rewriteValueLOONG64(v *Value) bool {
     8  	switch v.Op {
     9  	case OpAbs:
    10  		v.Op = OpLOONG64ABSD
    11  		return true
    12  	case OpAdd16:
    13  		v.Op = OpLOONG64ADDV
    14  		return true
    15  	case OpAdd32:
    16  		v.Op = OpLOONG64ADDV
    17  		return true
    18  	case OpAdd32F:
    19  		v.Op = OpLOONG64ADDF
    20  		return true
    21  	case OpAdd64:
    22  		v.Op = OpLOONG64ADDV
    23  		return true
    24  	case OpAdd64F:
    25  		v.Op = OpLOONG64ADDD
    26  		return true
    27  	case OpAdd8:
    28  		v.Op = OpLOONG64ADDV
    29  		return true
    30  	case OpAddPtr:
    31  		v.Op = OpLOONG64ADDV
    32  		return true
    33  	case OpAddr:
    34  		return rewriteValueLOONG64_OpAddr(v)
    35  	case OpAnd16:
    36  		v.Op = OpLOONG64AND
    37  		return true
    38  	case OpAnd32:
    39  		v.Op = OpLOONG64AND
    40  		return true
    41  	case OpAnd64:
    42  		v.Op = OpLOONG64AND
    43  		return true
    44  	case OpAnd8:
    45  		v.Op = OpLOONG64AND
    46  		return true
    47  	case OpAndB:
    48  		v.Op = OpLOONG64AND
    49  		return true
    50  	case OpAtomicAdd32:
    51  		v.Op = OpLOONG64LoweredAtomicAdd32
    52  		return true
    53  	case OpAtomicAdd64:
    54  		v.Op = OpLOONG64LoweredAtomicAdd64
    55  		return true
    56  	case OpAtomicAnd32:
    57  		v.Op = OpLOONG64LoweredAtomicAnd32
    58  		return true
    59  	case OpAtomicAnd32value:
    60  		v.Op = OpLOONG64LoweredAtomicAnd32value
    61  		return true
    62  	case OpAtomicAnd64value:
    63  		v.Op = OpLOONG64LoweredAtomicAnd64value
    64  		return true
    65  	case OpAtomicAnd8:
    66  		return rewriteValueLOONG64_OpAtomicAnd8(v)
    67  	case OpAtomicCompareAndSwap32:
    68  		return rewriteValueLOONG64_OpAtomicCompareAndSwap32(v)
    69  	case OpAtomicCompareAndSwap64:
    70  		v.Op = OpLOONG64LoweredAtomicCas64
    71  		return true
    72  	case OpAtomicExchange32:
    73  		v.Op = OpLOONG64LoweredAtomicExchange32
    74  		return true
    75  	case OpAtomicExchange64:
    76  		v.Op = OpLOONG64LoweredAtomicExchange64
    77  		return true
    78  	case OpAtomicLoad32:
    79  		v.Op = OpLOONG64LoweredAtomicLoad32
    80  		return true
    81  	case OpAtomicLoad64:
    82  		v.Op = OpLOONG64LoweredAtomicLoad64
    83  		return true
    84  	case OpAtomicLoad8:
    85  		v.Op = OpLOONG64LoweredAtomicLoad8
    86  		return true
    87  	case OpAtomicLoadPtr:
    88  		v.Op = OpLOONG64LoweredAtomicLoad64
    89  		return true
    90  	case OpAtomicOr32:
    91  		v.Op = OpLOONG64LoweredAtomicOr32
    92  		return true
    93  	case OpAtomicOr32value:
    94  		v.Op = OpLOONG64LoweredAtomicOr32value
    95  		return true
    96  	case OpAtomicOr64value:
    97  		v.Op = OpLOONG64LoweredAtomicOr64value
    98  		return true
    99  	case OpAtomicOr8:
   100  		return rewriteValueLOONG64_OpAtomicOr8(v)
   101  	case OpAtomicStore32:
   102  		v.Op = OpLOONG64LoweredAtomicStore32
   103  		return true
   104  	case OpAtomicStore32Variant:
   105  		v.Op = OpLOONG64LoweredAtomicStore32Variant
   106  		return true
   107  	case OpAtomicStore64:
   108  		v.Op = OpLOONG64LoweredAtomicStore64
   109  		return true
   110  	case OpAtomicStore64Variant:
   111  		v.Op = OpLOONG64LoweredAtomicStore64Variant
   112  		return true
   113  	case OpAtomicStore8:
   114  		v.Op = OpLOONG64LoweredAtomicStore8
   115  		return true
   116  	case OpAtomicStore8Variant:
   117  		v.Op = OpLOONG64LoweredAtomicStore8Variant
   118  		return true
   119  	case OpAtomicStorePtrNoWB:
   120  		v.Op = OpLOONG64LoweredAtomicStore64
   121  		return true
   122  	case OpAvg64u:
   123  		return rewriteValueLOONG64_OpAvg64u(v)
   124  	case OpBitLen32:
   125  		return rewriteValueLOONG64_OpBitLen32(v)
   126  	case OpBitLen64:
   127  		return rewriteValueLOONG64_OpBitLen64(v)
   128  	case OpBitRev16:
   129  		return rewriteValueLOONG64_OpBitRev16(v)
   130  	case OpBitRev32:
   131  		v.Op = OpLOONG64BITREVW
   132  		return true
   133  	case OpBitRev64:
   134  		v.Op = OpLOONG64BITREVV
   135  		return true
   136  	case OpBitRev8:
   137  		v.Op = OpLOONG64BITREV4B
   138  		return true
   139  	case OpBswap16:
   140  		v.Op = OpLOONG64REVB2H
   141  		return true
   142  	case OpBswap32:
   143  		v.Op = OpLOONG64REVB2W
   144  		return true
   145  	case OpBswap64:
   146  		v.Op = OpLOONG64REVBV
   147  		return true
   148  	case OpClosureCall:
   149  		v.Op = OpLOONG64CALLclosure
   150  		return true
   151  	case OpCom16:
   152  		return rewriteValueLOONG64_OpCom16(v)
   153  	case OpCom32:
   154  		return rewriteValueLOONG64_OpCom32(v)
   155  	case OpCom64:
   156  		return rewriteValueLOONG64_OpCom64(v)
   157  	case OpCom8:
   158  		return rewriteValueLOONG64_OpCom8(v)
   159  	case OpCondSelect:
   160  		return rewriteValueLOONG64_OpCondSelect(v)
   161  	case OpConst16:
   162  		return rewriteValueLOONG64_OpConst16(v)
   163  	case OpConst32:
   164  		return rewriteValueLOONG64_OpConst32(v)
   165  	case OpConst32F:
   166  		return rewriteValueLOONG64_OpConst32F(v)
   167  	case OpConst64:
   168  		return rewriteValueLOONG64_OpConst64(v)
   169  	case OpConst64F:
   170  		return rewriteValueLOONG64_OpConst64F(v)
   171  	case OpConst8:
   172  		return rewriteValueLOONG64_OpConst8(v)
   173  	case OpConstBool:
   174  		return rewriteValueLOONG64_OpConstBool(v)
   175  	case OpConstNil:
   176  		return rewriteValueLOONG64_OpConstNil(v)
   177  	case OpCopysign:
   178  		v.Op = OpLOONG64FCOPYSGD
   179  		return true
   180  	case OpCtz32:
   181  		v.Op = OpLOONG64CTZW
   182  		return true
   183  	case OpCtz32NonZero:
   184  		v.Op = OpCtz32
   185  		return true
   186  	case OpCtz64:
   187  		v.Op = OpLOONG64CTZV
   188  		return true
   189  	case OpCtz64NonZero:
   190  		v.Op = OpCtz64
   191  		return true
   192  	case OpCvt32Fto32:
   193  		v.Op = OpLOONG64TRUNCFW
   194  		return true
   195  	case OpCvt32Fto64:
   196  		v.Op = OpLOONG64TRUNCFV
   197  		return true
   198  	case OpCvt32Fto64F:
   199  		v.Op = OpLOONG64MOVFD
   200  		return true
   201  	case OpCvt32to32F:
   202  		v.Op = OpLOONG64MOVWF
   203  		return true
   204  	case OpCvt32to64F:
   205  		v.Op = OpLOONG64MOVWD
   206  		return true
   207  	case OpCvt64Fto32:
   208  		v.Op = OpLOONG64TRUNCDW
   209  		return true
   210  	case OpCvt64Fto32F:
   211  		v.Op = OpLOONG64MOVDF
   212  		return true
   213  	case OpCvt64Fto64:
   214  		v.Op = OpLOONG64TRUNCDV
   215  		return true
   216  	case OpCvt64to32F:
   217  		v.Op = OpLOONG64MOVVF
   218  		return true
   219  	case OpCvt64to64F:
   220  		v.Op = OpLOONG64MOVVD
   221  		return true
   222  	case OpCvtBoolToUint8:
   223  		v.Op = OpCopy
   224  		return true
   225  	case OpDiv16:
   226  		return rewriteValueLOONG64_OpDiv16(v)
   227  	case OpDiv16u:
   228  		return rewriteValueLOONG64_OpDiv16u(v)
   229  	case OpDiv32:
   230  		return rewriteValueLOONG64_OpDiv32(v)
   231  	case OpDiv32F:
   232  		v.Op = OpLOONG64DIVF
   233  		return true
   234  	case OpDiv32u:
   235  		return rewriteValueLOONG64_OpDiv32u(v)
   236  	case OpDiv64:
   237  		return rewriteValueLOONG64_OpDiv64(v)
   238  	case OpDiv64F:
   239  		v.Op = OpLOONG64DIVD
   240  		return true
   241  	case OpDiv64u:
   242  		v.Op = OpLOONG64DIVVU
   243  		return true
   244  	case OpDiv8:
   245  		return rewriteValueLOONG64_OpDiv8(v)
   246  	case OpDiv8u:
   247  		return rewriteValueLOONG64_OpDiv8u(v)
   248  	case OpEq16:
   249  		return rewriteValueLOONG64_OpEq16(v)
   250  	case OpEq32:
   251  		return rewriteValueLOONG64_OpEq32(v)
   252  	case OpEq32F:
   253  		return rewriteValueLOONG64_OpEq32F(v)
   254  	case OpEq64:
   255  		return rewriteValueLOONG64_OpEq64(v)
   256  	case OpEq64F:
   257  		return rewriteValueLOONG64_OpEq64F(v)
   258  	case OpEq8:
   259  		return rewriteValueLOONG64_OpEq8(v)
   260  	case OpEqB:
   261  		return rewriteValueLOONG64_OpEqB(v)
   262  	case OpEqPtr:
   263  		return rewriteValueLOONG64_OpEqPtr(v)
   264  	case OpFMA:
   265  		v.Op = OpLOONG64FMADDD
   266  		return true
   267  	case OpGetCallerPC:
   268  		v.Op = OpLOONG64LoweredGetCallerPC
   269  		return true
   270  	case OpGetCallerSP:
   271  		v.Op = OpLOONG64LoweredGetCallerSP
   272  		return true
   273  	case OpGetClosurePtr:
   274  		v.Op = OpLOONG64LoweredGetClosurePtr
   275  		return true
   276  	case OpHmul32:
   277  		return rewriteValueLOONG64_OpHmul32(v)
   278  	case OpHmul32u:
   279  		return rewriteValueLOONG64_OpHmul32u(v)
   280  	case OpHmul64:
   281  		v.Op = OpLOONG64MULHV
   282  		return true
   283  	case OpHmul64u:
   284  		v.Op = OpLOONG64MULHVU
   285  		return true
   286  	case OpInterCall:
   287  		v.Op = OpLOONG64CALLinter
   288  		return true
   289  	case OpIsInBounds:
   290  		return rewriteValueLOONG64_OpIsInBounds(v)
   291  	case OpIsNonNil:
   292  		return rewriteValueLOONG64_OpIsNonNil(v)
   293  	case OpIsSliceInBounds:
   294  		return rewriteValueLOONG64_OpIsSliceInBounds(v)
   295  	case OpLOONG64ADDD:
   296  		return rewriteValueLOONG64_OpLOONG64ADDD(v)
   297  	case OpLOONG64ADDF:
   298  		return rewriteValueLOONG64_OpLOONG64ADDF(v)
   299  	case OpLOONG64ADDV:
   300  		return rewriteValueLOONG64_OpLOONG64ADDV(v)
   301  	case OpLOONG64ADDVconst:
   302  		return rewriteValueLOONG64_OpLOONG64ADDVconst(v)
   303  	case OpLOONG64AND:
   304  		return rewriteValueLOONG64_OpLOONG64AND(v)
   305  	case OpLOONG64ANDconst:
   306  		return rewriteValueLOONG64_OpLOONG64ANDconst(v)
   307  	case OpLOONG64DIVV:
   308  		return rewriteValueLOONG64_OpLOONG64DIVV(v)
   309  	case OpLOONG64DIVVU:
   310  		return rewriteValueLOONG64_OpLOONG64DIVVU(v)
   311  	case OpLOONG64MASKEQZ:
   312  		return rewriteValueLOONG64_OpLOONG64MASKEQZ(v)
   313  	case OpLOONG64MASKNEZ:
   314  		return rewriteValueLOONG64_OpLOONG64MASKNEZ(v)
   315  	case OpLOONG64MOVBUload:
   316  		return rewriteValueLOONG64_OpLOONG64MOVBUload(v)
   317  	case OpLOONG64MOVBUloadidx:
   318  		return rewriteValueLOONG64_OpLOONG64MOVBUloadidx(v)
   319  	case OpLOONG64MOVBUreg:
   320  		return rewriteValueLOONG64_OpLOONG64MOVBUreg(v)
   321  	case OpLOONG64MOVBload:
   322  		return rewriteValueLOONG64_OpLOONG64MOVBload(v)
   323  	case OpLOONG64MOVBloadidx:
   324  		return rewriteValueLOONG64_OpLOONG64MOVBloadidx(v)
   325  	case OpLOONG64MOVBreg:
   326  		return rewriteValueLOONG64_OpLOONG64MOVBreg(v)
   327  	case OpLOONG64MOVBstore:
   328  		return rewriteValueLOONG64_OpLOONG64MOVBstore(v)
   329  	case OpLOONG64MOVBstoreidx:
   330  		return rewriteValueLOONG64_OpLOONG64MOVBstoreidx(v)
   331  	case OpLOONG64MOVBstorezero:
   332  		return rewriteValueLOONG64_OpLOONG64MOVBstorezero(v)
   333  	case OpLOONG64MOVBstorezeroidx:
   334  		return rewriteValueLOONG64_OpLOONG64MOVBstorezeroidx(v)
   335  	case OpLOONG64MOVDload:
   336  		return rewriteValueLOONG64_OpLOONG64MOVDload(v)
   337  	case OpLOONG64MOVDloadidx:
   338  		return rewriteValueLOONG64_OpLOONG64MOVDloadidx(v)
   339  	case OpLOONG64MOVDstore:
   340  		return rewriteValueLOONG64_OpLOONG64MOVDstore(v)
   341  	case OpLOONG64MOVDstoreidx:
   342  		return rewriteValueLOONG64_OpLOONG64MOVDstoreidx(v)
   343  	case OpLOONG64MOVFload:
   344  		return rewriteValueLOONG64_OpLOONG64MOVFload(v)
   345  	case OpLOONG64MOVFloadidx:
   346  		return rewriteValueLOONG64_OpLOONG64MOVFloadidx(v)
   347  	case OpLOONG64MOVFstore:
   348  		return rewriteValueLOONG64_OpLOONG64MOVFstore(v)
   349  	case OpLOONG64MOVFstoreidx:
   350  		return rewriteValueLOONG64_OpLOONG64MOVFstoreidx(v)
   351  	case OpLOONG64MOVHUload:
   352  		return rewriteValueLOONG64_OpLOONG64MOVHUload(v)
   353  	case OpLOONG64MOVHUloadidx:
   354  		return rewriteValueLOONG64_OpLOONG64MOVHUloadidx(v)
   355  	case OpLOONG64MOVHUreg:
   356  		return rewriteValueLOONG64_OpLOONG64MOVHUreg(v)
   357  	case OpLOONG64MOVHload:
   358  		return rewriteValueLOONG64_OpLOONG64MOVHload(v)
   359  	case OpLOONG64MOVHloadidx:
   360  		return rewriteValueLOONG64_OpLOONG64MOVHloadidx(v)
   361  	case OpLOONG64MOVHreg:
   362  		return rewriteValueLOONG64_OpLOONG64MOVHreg(v)
   363  	case OpLOONG64MOVHstore:
   364  		return rewriteValueLOONG64_OpLOONG64MOVHstore(v)
   365  	case OpLOONG64MOVHstoreidx:
   366  		return rewriteValueLOONG64_OpLOONG64MOVHstoreidx(v)
   367  	case OpLOONG64MOVHstorezero:
   368  		return rewriteValueLOONG64_OpLOONG64MOVHstorezero(v)
   369  	case OpLOONG64MOVHstorezeroidx:
   370  		return rewriteValueLOONG64_OpLOONG64MOVHstorezeroidx(v)
   371  	case OpLOONG64MOVVload:
   372  		return rewriteValueLOONG64_OpLOONG64MOVVload(v)
   373  	case OpLOONG64MOVVloadidx:
   374  		return rewriteValueLOONG64_OpLOONG64MOVVloadidx(v)
   375  	case OpLOONG64MOVVnop:
   376  		return rewriteValueLOONG64_OpLOONG64MOVVnop(v)
   377  	case OpLOONG64MOVVreg:
   378  		return rewriteValueLOONG64_OpLOONG64MOVVreg(v)
   379  	case OpLOONG64MOVVstore:
   380  		return rewriteValueLOONG64_OpLOONG64MOVVstore(v)
   381  	case OpLOONG64MOVVstoreidx:
   382  		return rewriteValueLOONG64_OpLOONG64MOVVstoreidx(v)
   383  	case OpLOONG64MOVVstorezero:
   384  		return rewriteValueLOONG64_OpLOONG64MOVVstorezero(v)
   385  	case OpLOONG64MOVVstorezeroidx:
   386  		return rewriteValueLOONG64_OpLOONG64MOVVstorezeroidx(v)
   387  	case OpLOONG64MOVWUload:
   388  		return rewriteValueLOONG64_OpLOONG64MOVWUload(v)
   389  	case OpLOONG64MOVWUloadidx:
   390  		return rewriteValueLOONG64_OpLOONG64MOVWUloadidx(v)
   391  	case OpLOONG64MOVWUreg:
   392  		return rewriteValueLOONG64_OpLOONG64MOVWUreg(v)
   393  	case OpLOONG64MOVWload:
   394  		return rewriteValueLOONG64_OpLOONG64MOVWload(v)
   395  	case OpLOONG64MOVWloadidx:
   396  		return rewriteValueLOONG64_OpLOONG64MOVWloadidx(v)
   397  	case OpLOONG64MOVWreg:
   398  		return rewriteValueLOONG64_OpLOONG64MOVWreg(v)
   399  	case OpLOONG64MOVWstore:
   400  		return rewriteValueLOONG64_OpLOONG64MOVWstore(v)
   401  	case OpLOONG64MOVWstoreidx:
   402  		return rewriteValueLOONG64_OpLOONG64MOVWstoreidx(v)
   403  	case OpLOONG64MOVWstorezero:
   404  		return rewriteValueLOONG64_OpLOONG64MOVWstorezero(v)
   405  	case OpLOONG64MOVWstorezeroidx:
   406  		return rewriteValueLOONG64_OpLOONG64MOVWstorezeroidx(v)
   407  	case OpLOONG64MULV:
   408  		return rewriteValueLOONG64_OpLOONG64MULV(v)
   409  	case OpLOONG64NEGV:
   410  		return rewriteValueLOONG64_OpLOONG64NEGV(v)
   411  	case OpLOONG64NOR:
   412  		return rewriteValueLOONG64_OpLOONG64NOR(v)
   413  	case OpLOONG64NORconst:
   414  		return rewriteValueLOONG64_OpLOONG64NORconst(v)
   415  	case OpLOONG64OR:
   416  		return rewriteValueLOONG64_OpLOONG64OR(v)
   417  	case OpLOONG64ORconst:
   418  		return rewriteValueLOONG64_OpLOONG64ORconst(v)
   419  	case OpLOONG64REMV:
   420  		return rewriteValueLOONG64_OpLOONG64REMV(v)
   421  	case OpLOONG64REMVU:
   422  		return rewriteValueLOONG64_OpLOONG64REMVU(v)
   423  	case OpLOONG64ROTR:
   424  		return rewriteValueLOONG64_OpLOONG64ROTR(v)
   425  	case OpLOONG64ROTRV:
   426  		return rewriteValueLOONG64_OpLOONG64ROTRV(v)
   427  	case OpLOONG64SGT:
   428  		return rewriteValueLOONG64_OpLOONG64SGT(v)
   429  	case OpLOONG64SGTU:
   430  		return rewriteValueLOONG64_OpLOONG64SGTU(v)
   431  	case OpLOONG64SGTUconst:
   432  		return rewriteValueLOONG64_OpLOONG64SGTUconst(v)
   433  	case OpLOONG64SGTconst:
   434  		return rewriteValueLOONG64_OpLOONG64SGTconst(v)
   435  	case OpLOONG64SLLV:
   436  		return rewriteValueLOONG64_OpLOONG64SLLV(v)
   437  	case OpLOONG64SLLVconst:
   438  		return rewriteValueLOONG64_OpLOONG64SLLVconst(v)
   439  	case OpLOONG64SRAV:
   440  		return rewriteValueLOONG64_OpLOONG64SRAV(v)
   441  	case OpLOONG64SRAVconst:
   442  		return rewriteValueLOONG64_OpLOONG64SRAVconst(v)
   443  	case OpLOONG64SRLV:
   444  		return rewriteValueLOONG64_OpLOONG64SRLV(v)
   445  	case OpLOONG64SRLVconst:
   446  		return rewriteValueLOONG64_OpLOONG64SRLVconst(v)
   447  	case OpLOONG64SUBD:
   448  		return rewriteValueLOONG64_OpLOONG64SUBD(v)
   449  	case OpLOONG64SUBF:
   450  		return rewriteValueLOONG64_OpLOONG64SUBF(v)
   451  	case OpLOONG64SUBV:
   452  		return rewriteValueLOONG64_OpLOONG64SUBV(v)
   453  	case OpLOONG64SUBVconst:
   454  		return rewriteValueLOONG64_OpLOONG64SUBVconst(v)
   455  	case OpLOONG64XOR:
   456  		return rewriteValueLOONG64_OpLOONG64XOR(v)
   457  	case OpLOONG64XORconst:
   458  		return rewriteValueLOONG64_OpLOONG64XORconst(v)
   459  	case OpLeq16:
   460  		return rewriteValueLOONG64_OpLeq16(v)
   461  	case OpLeq16U:
   462  		return rewriteValueLOONG64_OpLeq16U(v)
   463  	case OpLeq32:
   464  		return rewriteValueLOONG64_OpLeq32(v)
   465  	case OpLeq32F:
   466  		return rewriteValueLOONG64_OpLeq32F(v)
   467  	case OpLeq32U:
   468  		return rewriteValueLOONG64_OpLeq32U(v)
   469  	case OpLeq64:
   470  		return rewriteValueLOONG64_OpLeq64(v)
   471  	case OpLeq64F:
   472  		return rewriteValueLOONG64_OpLeq64F(v)
   473  	case OpLeq64U:
   474  		return rewriteValueLOONG64_OpLeq64U(v)
   475  	case OpLeq8:
   476  		return rewriteValueLOONG64_OpLeq8(v)
   477  	case OpLeq8U:
   478  		return rewriteValueLOONG64_OpLeq8U(v)
   479  	case OpLess16:
   480  		return rewriteValueLOONG64_OpLess16(v)
   481  	case OpLess16U:
   482  		return rewriteValueLOONG64_OpLess16U(v)
   483  	case OpLess32:
   484  		return rewriteValueLOONG64_OpLess32(v)
   485  	case OpLess32F:
   486  		return rewriteValueLOONG64_OpLess32F(v)
   487  	case OpLess32U:
   488  		return rewriteValueLOONG64_OpLess32U(v)
   489  	case OpLess64:
   490  		return rewriteValueLOONG64_OpLess64(v)
   491  	case OpLess64F:
   492  		return rewriteValueLOONG64_OpLess64F(v)
   493  	case OpLess64U:
   494  		return rewriteValueLOONG64_OpLess64U(v)
   495  	case OpLess8:
   496  		return rewriteValueLOONG64_OpLess8(v)
   497  	case OpLess8U:
   498  		return rewriteValueLOONG64_OpLess8U(v)
   499  	case OpLoad:
   500  		return rewriteValueLOONG64_OpLoad(v)
   501  	case OpLocalAddr:
   502  		return rewriteValueLOONG64_OpLocalAddr(v)
   503  	case OpLsh16x16:
   504  		return rewriteValueLOONG64_OpLsh16x16(v)
   505  	case OpLsh16x32:
   506  		return rewriteValueLOONG64_OpLsh16x32(v)
   507  	case OpLsh16x64:
   508  		return rewriteValueLOONG64_OpLsh16x64(v)
   509  	case OpLsh16x8:
   510  		return rewriteValueLOONG64_OpLsh16x8(v)
   511  	case OpLsh32x16:
   512  		return rewriteValueLOONG64_OpLsh32x16(v)
   513  	case OpLsh32x32:
   514  		return rewriteValueLOONG64_OpLsh32x32(v)
   515  	case OpLsh32x64:
   516  		return rewriteValueLOONG64_OpLsh32x64(v)
   517  	case OpLsh32x8:
   518  		return rewriteValueLOONG64_OpLsh32x8(v)
   519  	case OpLsh64x16:
   520  		return rewriteValueLOONG64_OpLsh64x16(v)
   521  	case OpLsh64x32:
   522  		return rewriteValueLOONG64_OpLsh64x32(v)
   523  	case OpLsh64x64:
   524  		return rewriteValueLOONG64_OpLsh64x64(v)
   525  	case OpLsh64x8:
   526  		return rewriteValueLOONG64_OpLsh64x8(v)
   527  	case OpLsh8x16:
   528  		return rewriteValueLOONG64_OpLsh8x16(v)
   529  	case OpLsh8x32:
   530  		return rewriteValueLOONG64_OpLsh8x32(v)
   531  	case OpLsh8x64:
   532  		return rewriteValueLOONG64_OpLsh8x64(v)
   533  	case OpLsh8x8:
   534  		return rewriteValueLOONG64_OpLsh8x8(v)
   535  	case OpMax32F:
   536  		v.Op = OpLOONG64FMAXF
   537  		return true
   538  	case OpMax64F:
   539  		v.Op = OpLOONG64FMAXD
   540  		return true
   541  	case OpMin32F:
   542  		v.Op = OpLOONG64FMINF
   543  		return true
   544  	case OpMin64F:
   545  		v.Op = OpLOONG64FMIND
   546  		return true
   547  	case OpMod16:
   548  		return rewriteValueLOONG64_OpMod16(v)
   549  	case OpMod16u:
   550  		return rewriteValueLOONG64_OpMod16u(v)
   551  	case OpMod32:
   552  		return rewriteValueLOONG64_OpMod32(v)
   553  	case OpMod32u:
   554  		return rewriteValueLOONG64_OpMod32u(v)
   555  	case OpMod64:
   556  		return rewriteValueLOONG64_OpMod64(v)
   557  	case OpMod64u:
   558  		v.Op = OpLOONG64REMVU
   559  		return true
   560  	case OpMod8:
   561  		return rewriteValueLOONG64_OpMod8(v)
   562  	case OpMod8u:
   563  		return rewriteValueLOONG64_OpMod8u(v)
   564  	case OpMove:
   565  		return rewriteValueLOONG64_OpMove(v)
   566  	case OpMul16:
   567  		v.Op = OpLOONG64MULV
   568  		return true
   569  	case OpMul32:
   570  		v.Op = OpLOONG64MULV
   571  		return true
   572  	case OpMul32F:
   573  		v.Op = OpLOONG64MULF
   574  		return true
   575  	case OpMul64:
   576  		v.Op = OpLOONG64MULV
   577  		return true
   578  	case OpMul64F:
   579  		v.Op = OpLOONG64MULD
   580  		return true
   581  	case OpMul8:
   582  		v.Op = OpLOONG64MULV
   583  		return true
   584  	case OpNeg16:
   585  		v.Op = OpLOONG64NEGV
   586  		return true
   587  	case OpNeg32:
   588  		v.Op = OpLOONG64NEGV
   589  		return true
   590  	case OpNeg32F:
   591  		v.Op = OpLOONG64NEGF
   592  		return true
   593  	case OpNeg64:
   594  		v.Op = OpLOONG64NEGV
   595  		return true
   596  	case OpNeg64F:
   597  		v.Op = OpLOONG64NEGD
   598  		return true
   599  	case OpNeg8:
   600  		v.Op = OpLOONG64NEGV
   601  		return true
   602  	case OpNeq16:
   603  		return rewriteValueLOONG64_OpNeq16(v)
   604  	case OpNeq32:
   605  		return rewriteValueLOONG64_OpNeq32(v)
   606  	case OpNeq32F:
   607  		return rewriteValueLOONG64_OpNeq32F(v)
   608  	case OpNeq64:
   609  		return rewriteValueLOONG64_OpNeq64(v)
   610  	case OpNeq64F:
   611  		return rewriteValueLOONG64_OpNeq64F(v)
   612  	case OpNeq8:
   613  		return rewriteValueLOONG64_OpNeq8(v)
   614  	case OpNeqB:
   615  		v.Op = OpLOONG64XOR
   616  		return true
   617  	case OpNeqPtr:
   618  		return rewriteValueLOONG64_OpNeqPtr(v)
   619  	case OpNilCheck:
   620  		v.Op = OpLOONG64LoweredNilCheck
   621  		return true
   622  	case OpNot:
   623  		return rewriteValueLOONG64_OpNot(v)
   624  	case OpOffPtr:
   625  		return rewriteValueLOONG64_OpOffPtr(v)
   626  	case OpOr16:
   627  		v.Op = OpLOONG64OR
   628  		return true
   629  	case OpOr32:
   630  		v.Op = OpLOONG64OR
   631  		return true
   632  	case OpOr64:
   633  		v.Op = OpLOONG64OR
   634  		return true
   635  	case OpOr8:
   636  		v.Op = OpLOONG64OR
   637  		return true
   638  	case OpOrB:
   639  		v.Op = OpLOONG64OR
   640  		return true
   641  	case OpPanicBounds:
   642  		return rewriteValueLOONG64_OpPanicBounds(v)
   643  	case OpPopCount16:
   644  		return rewriteValueLOONG64_OpPopCount16(v)
   645  	case OpPopCount32:
   646  		return rewriteValueLOONG64_OpPopCount32(v)
   647  	case OpPopCount64:
   648  		return rewriteValueLOONG64_OpPopCount64(v)
   649  	case OpPubBarrier:
   650  		v.Op = OpLOONG64LoweredPubBarrier
   651  		return true
   652  	case OpRotateLeft16:
   653  		return rewriteValueLOONG64_OpRotateLeft16(v)
   654  	case OpRotateLeft32:
   655  		return rewriteValueLOONG64_OpRotateLeft32(v)
   656  	case OpRotateLeft64:
   657  		return rewriteValueLOONG64_OpRotateLeft64(v)
   658  	case OpRotateLeft8:
   659  		return rewriteValueLOONG64_OpRotateLeft8(v)
   660  	case OpRound32F:
   661  		v.Op = OpLOONG64LoweredRound32F
   662  		return true
   663  	case OpRound64F:
   664  		v.Op = OpLOONG64LoweredRound64F
   665  		return true
   666  	case OpRsh16Ux16:
   667  		return rewriteValueLOONG64_OpRsh16Ux16(v)
   668  	case OpRsh16Ux32:
   669  		return rewriteValueLOONG64_OpRsh16Ux32(v)
   670  	case OpRsh16Ux64:
   671  		return rewriteValueLOONG64_OpRsh16Ux64(v)
   672  	case OpRsh16Ux8:
   673  		return rewriteValueLOONG64_OpRsh16Ux8(v)
   674  	case OpRsh16x16:
   675  		return rewriteValueLOONG64_OpRsh16x16(v)
   676  	case OpRsh16x32:
   677  		return rewriteValueLOONG64_OpRsh16x32(v)
   678  	case OpRsh16x64:
   679  		return rewriteValueLOONG64_OpRsh16x64(v)
   680  	case OpRsh16x8:
   681  		return rewriteValueLOONG64_OpRsh16x8(v)
   682  	case OpRsh32Ux16:
   683  		return rewriteValueLOONG64_OpRsh32Ux16(v)
   684  	case OpRsh32Ux32:
   685  		return rewriteValueLOONG64_OpRsh32Ux32(v)
   686  	case OpRsh32Ux64:
   687  		return rewriteValueLOONG64_OpRsh32Ux64(v)
   688  	case OpRsh32Ux8:
   689  		return rewriteValueLOONG64_OpRsh32Ux8(v)
   690  	case OpRsh32x16:
   691  		return rewriteValueLOONG64_OpRsh32x16(v)
   692  	case OpRsh32x32:
   693  		return rewriteValueLOONG64_OpRsh32x32(v)
   694  	case OpRsh32x64:
   695  		return rewriteValueLOONG64_OpRsh32x64(v)
   696  	case OpRsh32x8:
   697  		return rewriteValueLOONG64_OpRsh32x8(v)
   698  	case OpRsh64Ux16:
   699  		return rewriteValueLOONG64_OpRsh64Ux16(v)
   700  	case OpRsh64Ux32:
   701  		return rewriteValueLOONG64_OpRsh64Ux32(v)
   702  	case OpRsh64Ux64:
   703  		return rewriteValueLOONG64_OpRsh64Ux64(v)
   704  	case OpRsh64Ux8:
   705  		return rewriteValueLOONG64_OpRsh64Ux8(v)
   706  	case OpRsh64x16:
   707  		return rewriteValueLOONG64_OpRsh64x16(v)
   708  	case OpRsh64x32:
   709  		return rewriteValueLOONG64_OpRsh64x32(v)
   710  	case OpRsh64x64:
   711  		return rewriteValueLOONG64_OpRsh64x64(v)
   712  	case OpRsh64x8:
   713  		return rewriteValueLOONG64_OpRsh64x8(v)
   714  	case OpRsh8Ux16:
   715  		return rewriteValueLOONG64_OpRsh8Ux16(v)
   716  	case OpRsh8Ux32:
   717  		return rewriteValueLOONG64_OpRsh8Ux32(v)
   718  	case OpRsh8Ux64:
   719  		return rewriteValueLOONG64_OpRsh8Ux64(v)
   720  	case OpRsh8Ux8:
   721  		return rewriteValueLOONG64_OpRsh8Ux8(v)
   722  	case OpRsh8x16:
   723  		return rewriteValueLOONG64_OpRsh8x16(v)
   724  	case OpRsh8x32:
   725  		return rewriteValueLOONG64_OpRsh8x32(v)
   726  	case OpRsh8x64:
   727  		return rewriteValueLOONG64_OpRsh8x64(v)
   728  	case OpRsh8x8:
   729  		return rewriteValueLOONG64_OpRsh8x8(v)
   730  	case OpSelect0:
   731  		return rewriteValueLOONG64_OpSelect0(v)
   732  	case OpSelect1:
   733  		return rewriteValueLOONG64_OpSelect1(v)
   734  	case OpSelectN:
   735  		return rewriteValueLOONG64_OpSelectN(v)
   736  	case OpSignExt16to32:
   737  		v.Op = OpLOONG64MOVHreg
   738  		return true
   739  	case OpSignExt16to64:
   740  		v.Op = OpLOONG64MOVHreg
   741  		return true
   742  	case OpSignExt32to64:
   743  		v.Op = OpLOONG64MOVWreg
   744  		return true
   745  	case OpSignExt8to16:
   746  		v.Op = OpLOONG64MOVBreg
   747  		return true
   748  	case OpSignExt8to32:
   749  		v.Op = OpLOONG64MOVBreg
   750  		return true
   751  	case OpSignExt8to64:
   752  		v.Op = OpLOONG64MOVBreg
   753  		return true
   754  	case OpSlicemask:
   755  		return rewriteValueLOONG64_OpSlicemask(v)
   756  	case OpSqrt:
   757  		v.Op = OpLOONG64SQRTD
   758  		return true
   759  	case OpSqrt32:
   760  		v.Op = OpLOONG64SQRTF
   761  		return true
   762  	case OpStaticCall:
   763  		v.Op = OpLOONG64CALLstatic
   764  		return true
   765  	case OpStore:
   766  		return rewriteValueLOONG64_OpStore(v)
   767  	case OpSub16:
   768  		v.Op = OpLOONG64SUBV
   769  		return true
   770  	case OpSub32:
   771  		v.Op = OpLOONG64SUBV
   772  		return true
   773  	case OpSub32F:
   774  		v.Op = OpLOONG64SUBF
   775  		return true
   776  	case OpSub64:
   777  		v.Op = OpLOONG64SUBV
   778  		return true
   779  	case OpSub64F:
   780  		v.Op = OpLOONG64SUBD
   781  		return true
   782  	case OpSub8:
   783  		v.Op = OpLOONG64SUBV
   784  		return true
   785  	case OpSubPtr:
   786  		v.Op = OpLOONG64SUBV
   787  		return true
   788  	case OpTailCall:
   789  		v.Op = OpLOONG64CALLtail
   790  		return true
   791  	case OpTrunc16to8:
   792  		v.Op = OpCopy
   793  		return true
   794  	case OpTrunc32to16:
   795  		v.Op = OpCopy
   796  		return true
   797  	case OpTrunc32to8:
   798  		v.Op = OpCopy
   799  		return true
   800  	case OpTrunc64to16:
   801  		v.Op = OpCopy
   802  		return true
   803  	case OpTrunc64to32:
   804  		v.Op = OpCopy
   805  		return true
   806  	case OpTrunc64to8:
   807  		v.Op = OpCopy
   808  		return true
   809  	case OpWB:
   810  		v.Op = OpLOONG64LoweredWB
   811  		return true
   812  	case OpXor16:
   813  		v.Op = OpLOONG64XOR
   814  		return true
   815  	case OpXor32:
   816  		v.Op = OpLOONG64XOR
   817  		return true
   818  	case OpXor64:
   819  		v.Op = OpLOONG64XOR
   820  		return true
   821  	case OpXor8:
   822  		v.Op = OpLOONG64XOR
   823  		return true
   824  	case OpZero:
   825  		return rewriteValueLOONG64_OpZero(v)
   826  	case OpZeroExt16to32:
   827  		v.Op = OpLOONG64MOVHUreg
   828  		return true
   829  	case OpZeroExt16to64:
   830  		v.Op = OpLOONG64MOVHUreg
   831  		return true
   832  	case OpZeroExt32to64:
   833  		v.Op = OpLOONG64MOVWUreg
   834  		return true
   835  	case OpZeroExt8to16:
   836  		v.Op = OpLOONG64MOVBUreg
   837  		return true
   838  	case OpZeroExt8to32:
   839  		v.Op = OpLOONG64MOVBUreg
   840  		return true
   841  	case OpZeroExt8to64:
   842  		v.Op = OpLOONG64MOVBUreg
   843  		return true
   844  	}
   845  	return false
   846  }
   847  func rewriteValueLOONG64_OpAddr(v *Value) bool {
   848  	v_0 := v.Args[0]
   849  	// match: (Addr {sym} base)
   850  	// result: (MOVVaddr {sym} base)
   851  	for {
   852  		sym := auxToSym(v.Aux)
   853  		base := v_0
   854  		v.reset(OpLOONG64MOVVaddr)
   855  		v.Aux = symToAux(sym)
   856  		v.AddArg(base)
   857  		return true
   858  	}
   859  }
   860  func rewriteValueLOONG64_OpAtomicAnd8(v *Value) bool {
   861  	v_2 := v.Args[2]
   862  	v_1 := v.Args[1]
   863  	v_0 := v.Args[0]
   864  	b := v.Block
   865  	typ := &b.Func.Config.Types
   866  	// match: (AtomicAnd8 ptr val mem)
   867  	// result: (LoweredAtomicAnd32 (AND <typ.Uintptr> (MOVVconst [^3]) ptr) (NORconst [0] <typ.UInt32> (SLLV <typ.UInt32> (XORconst <typ.UInt32> [0xff] (ZeroExt8to32 val)) (SLLVconst <typ.UInt64> [3] (ANDconst <typ.UInt64> [3] ptr)))) mem)
   868  	for {
   869  		ptr := v_0
   870  		val := v_1
   871  		mem := v_2
   872  		v.reset(OpLOONG64LoweredAtomicAnd32)
   873  		v0 := b.NewValue0(v.Pos, OpLOONG64AND, typ.Uintptr)
   874  		v1 := b.NewValue0(v.Pos, OpLOONG64MOVVconst, typ.UInt64)
   875  		v1.AuxInt = int64ToAuxInt(^3)
   876  		v0.AddArg2(v1, ptr)
   877  		v2 := b.NewValue0(v.Pos, OpLOONG64NORconst, typ.UInt32)
   878  		v2.AuxInt = int64ToAuxInt(0)
   879  		v3 := b.NewValue0(v.Pos, OpLOONG64SLLV, typ.UInt32)
   880  		v4 := b.NewValue0(v.Pos, OpLOONG64XORconst, typ.UInt32)
   881  		v4.AuxInt = int64ToAuxInt(0xff)
   882  		v5 := b.NewValue0(v.Pos, OpZeroExt8to32, typ.UInt32)
   883  		v5.AddArg(val)
   884  		v4.AddArg(v5)
   885  		v6 := b.NewValue0(v.Pos, OpLOONG64SLLVconst, typ.UInt64)
   886  		v6.AuxInt = int64ToAuxInt(3)
   887  		v7 := b.NewValue0(v.Pos, OpLOONG64ANDconst, typ.UInt64)
   888  		v7.AuxInt = int64ToAuxInt(3)
   889  		v7.AddArg(ptr)
   890  		v6.AddArg(v7)
   891  		v3.AddArg2(v4, v6)
   892  		v2.AddArg(v3)
   893  		v.AddArg3(v0, v2, mem)
   894  		return true
   895  	}
   896  }
   897  func rewriteValueLOONG64_OpAtomicCompareAndSwap32(v *Value) bool {
   898  	v_3 := v.Args[3]
   899  	v_2 := v.Args[2]
   900  	v_1 := v.Args[1]
   901  	v_0 := v.Args[0]
   902  	b := v.Block
   903  	typ := &b.Func.Config.Types
   904  	// match: (AtomicCompareAndSwap32 ptr old new mem)
   905  	// result: (LoweredAtomicCas32 ptr (SignExt32to64 old) new mem)
   906  	for {
   907  		ptr := v_0
   908  		old := v_1
   909  		new := v_2
   910  		mem := v_3
   911  		v.reset(OpLOONG64LoweredAtomicCas32)
   912  		v0 := b.NewValue0(v.Pos, OpSignExt32to64, typ.Int64)
   913  		v0.AddArg(old)
   914  		v.AddArg4(ptr, v0, new, mem)
   915  		return true
   916  	}
   917  }
   918  func rewriteValueLOONG64_OpAtomicOr8(v *Value) bool {
   919  	v_2 := v.Args[2]
   920  	v_1 := v.Args[1]
   921  	v_0 := v.Args[0]
   922  	b := v.Block
   923  	typ := &b.Func.Config.Types
   924  	// match: (AtomicOr8 ptr val mem)
   925  	// result: (LoweredAtomicOr32 (AND <typ.Uintptr> (MOVVconst [^3]) ptr) (SLLV <typ.UInt32> (ZeroExt8to32 val) (SLLVconst <typ.UInt64> [3] (ANDconst <typ.UInt64> [3] ptr))) mem)
   926  	for {
   927  		ptr := v_0
   928  		val := v_1
   929  		mem := v_2
   930  		v.reset(OpLOONG64LoweredAtomicOr32)
   931  		v0 := b.NewValue0(v.Pos, OpLOONG64AND, typ.Uintptr)
   932  		v1 := b.NewValue0(v.Pos, OpLOONG64MOVVconst, typ.UInt64)
   933  		v1.AuxInt = int64ToAuxInt(^3)
   934  		v0.AddArg2(v1, ptr)
   935  		v2 := b.NewValue0(v.Pos, OpLOONG64SLLV, typ.UInt32)
   936  		v3 := b.NewValue0(v.Pos, OpZeroExt8to32, typ.UInt32)
   937  		v3.AddArg(val)
   938  		v4 := b.NewValue0(v.Pos, OpLOONG64SLLVconst, typ.UInt64)
   939  		v4.AuxInt = int64ToAuxInt(3)
   940  		v5 := b.NewValue0(v.Pos, OpLOONG64ANDconst, typ.UInt64)
   941  		v5.AuxInt = int64ToAuxInt(3)
   942  		v5.AddArg(ptr)
   943  		v4.AddArg(v5)
   944  		v2.AddArg2(v3, v4)
   945  		v.AddArg3(v0, v2, mem)
   946  		return true
   947  	}
   948  }
   949  func rewriteValueLOONG64_OpAvg64u(v *Value) bool {
   950  	v_1 := v.Args[1]
   951  	v_0 := v.Args[0]
   952  	b := v.Block
   953  	// match: (Avg64u <t> x y)
   954  	// result: (ADDV (SRLVconst <t> (SUBV <t> x y) [1]) y)
   955  	for {
   956  		t := v.Type
   957  		x := v_0
   958  		y := v_1
   959  		v.reset(OpLOONG64ADDV)
   960  		v0 := b.NewValue0(v.Pos, OpLOONG64SRLVconst, t)
   961  		v0.AuxInt = int64ToAuxInt(1)
   962  		v1 := b.NewValue0(v.Pos, OpLOONG64SUBV, t)
   963  		v1.AddArg2(x, y)
   964  		v0.AddArg(v1)
   965  		v.AddArg2(v0, y)
   966  		return true
   967  	}
   968  }
   969  func rewriteValueLOONG64_OpBitLen32(v *Value) bool {
   970  	v_0 := v.Args[0]
   971  	b := v.Block
   972  	// match: (BitLen32 <t> x)
   973  	// result: (NEGV <t> (SUBVconst <t> [32] (CLZW <t> x)))
   974  	for {
   975  		t := v.Type
   976  		x := v_0
   977  		v.reset(OpLOONG64NEGV)
   978  		v.Type = t
   979  		v0 := b.NewValue0(v.Pos, OpLOONG64SUBVconst, t)
   980  		v0.AuxInt = int64ToAuxInt(32)
   981  		v1 := b.NewValue0(v.Pos, OpLOONG64CLZW, t)
   982  		v1.AddArg(x)
   983  		v0.AddArg(v1)
   984  		v.AddArg(v0)
   985  		return true
   986  	}
   987  }
   988  func rewriteValueLOONG64_OpBitLen64(v *Value) bool {
   989  	v_0 := v.Args[0]
   990  	b := v.Block
   991  	// match: (BitLen64 <t> x)
   992  	// result: (NEGV <t> (SUBVconst <t> [64] (CLZV <t> x)))
   993  	for {
   994  		t := v.Type
   995  		x := v_0
   996  		v.reset(OpLOONG64NEGV)
   997  		v.Type = t
   998  		v0 := b.NewValue0(v.Pos, OpLOONG64SUBVconst, t)
   999  		v0.AuxInt = int64ToAuxInt(64)
  1000  		v1 := b.NewValue0(v.Pos, OpLOONG64CLZV, t)
  1001  		v1.AddArg(x)
  1002  		v0.AddArg(v1)
  1003  		v.AddArg(v0)
  1004  		return true
  1005  	}
  1006  }
  1007  func rewriteValueLOONG64_OpBitRev16(v *Value) bool {
  1008  	v_0 := v.Args[0]
  1009  	b := v.Block
  1010  	// match: (BitRev16 <t> x)
  1011  	// result: (REVB2H (BITREV4B <t> x))
  1012  	for {
  1013  		t := v.Type
  1014  		x := v_0
  1015  		v.reset(OpLOONG64REVB2H)
  1016  		v0 := b.NewValue0(v.Pos, OpLOONG64BITREV4B, t)
  1017  		v0.AddArg(x)
  1018  		v.AddArg(v0)
  1019  		return true
  1020  	}
  1021  }
  1022  func rewriteValueLOONG64_OpCom16(v *Value) bool {
  1023  	v_0 := v.Args[0]
  1024  	b := v.Block
  1025  	typ := &b.Func.Config.Types
  1026  	// match: (Com16 x)
  1027  	// result: (NOR (MOVVconst [0]) x)
  1028  	for {
  1029  		x := v_0
  1030  		v.reset(OpLOONG64NOR)
  1031  		v0 := b.NewValue0(v.Pos, OpLOONG64MOVVconst, typ.UInt64)
  1032  		v0.AuxInt = int64ToAuxInt(0)
  1033  		v.AddArg2(v0, x)
  1034  		return true
  1035  	}
  1036  }
  1037  func rewriteValueLOONG64_OpCom32(v *Value) bool {
  1038  	v_0 := v.Args[0]
  1039  	b := v.Block
  1040  	typ := &b.Func.Config.Types
  1041  	// match: (Com32 x)
  1042  	// result: (NOR (MOVVconst [0]) x)
  1043  	for {
  1044  		x := v_0
  1045  		v.reset(OpLOONG64NOR)
  1046  		v0 := b.NewValue0(v.Pos, OpLOONG64MOVVconst, typ.UInt64)
  1047  		v0.AuxInt = int64ToAuxInt(0)
  1048  		v.AddArg2(v0, x)
  1049  		return true
  1050  	}
  1051  }
  1052  func rewriteValueLOONG64_OpCom64(v *Value) bool {
  1053  	v_0 := v.Args[0]
  1054  	b := v.Block
  1055  	typ := &b.Func.Config.Types
  1056  	// match: (Com64 x)
  1057  	// result: (NOR (MOVVconst [0]) x)
  1058  	for {
  1059  		x := v_0
  1060  		v.reset(OpLOONG64NOR)
  1061  		v0 := b.NewValue0(v.Pos, OpLOONG64MOVVconst, typ.UInt64)
  1062  		v0.AuxInt = int64ToAuxInt(0)
  1063  		v.AddArg2(v0, x)
  1064  		return true
  1065  	}
  1066  }
  1067  func rewriteValueLOONG64_OpCom8(v *Value) bool {
  1068  	v_0 := v.Args[0]
  1069  	b := v.Block
  1070  	typ := &b.Func.Config.Types
  1071  	// match: (Com8 x)
  1072  	// result: (NOR (MOVVconst [0]) x)
  1073  	for {
  1074  		x := v_0
  1075  		v.reset(OpLOONG64NOR)
  1076  		v0 := b.NewValue0(v.Pos, OpLOONG64MOVVconst, typ.UInt64)
  1077  		v0.AuxInt = int64ToAuxInt(0)
  1078  		v.AddArg2(v0, x)
  1079  		return true
  1080  	}
  1081  }
  1082  func rewriteValueLOONG64_OpCondSelect(v *Value) bool {
  1083  	v_2 := v.Args[2]
  1084  	v_1 := v.Args[1]
  1085  	v_0 := v.Args[0]
  1086  	b := v.Block
  1087  	// match: (CondSelect <t> x y cond)
  1088  	// result: (OR (MASKEQZ <t> x cond) (MASKNEZ <t> y cond))
  1089  	for {
  1090  		t := v.Type
  1091  		x := v_0
  1092  		y := v_1
  1093  		cond := v_2
  1094  		v.reset(OpLOONG64OR)
  1095  		v0 := b.NewValue0(v.Pos, OpLOONG64MASKEQZ, t)
  1096  		v0.AddArg2(x, cond)
  1097  		v1 := b.NewValue0(v.Pos, OpLOONG64MASKNEZ, t)
  1098  		v1.AddArg2(y, cond)
  1099  		v.AddArg2(v0, v1)
  1100  		return true
  1101  	}
  1102  }
  1103  func rewriteValueLOONG64_OpConst16(v *Value) bool {
  1104  	// match: (Const16 [val])
  1105  	// result: (MOVVconst [int64(val)])
  1106  	for {
  1107  		val := auxIntToInt16(v.AuxInt)
  1108  		v.reset(OpLOONG64MOVVconst)
  1109  		v.AuxInt = int64ToAuxInt(int64(val))
  1110  		return true
  1111  	}
  1112  }
  1113  func rewriteValueLOONG64_OpConst32(v *Value) bool {
  1114  	// match: (Const32 [val])
  1115  	// result: (MOVVconst [int64(val)])
  1116  	for {
  1117  		val := auxIntToInt32(v.AuxInt)
  1118  		v.reset(OpLOONG64MOVVconst)
  1119  		v.AuxInt = int64ToAuxInt(int64(val))
  1120  		return true
  1121  	}
  1122  }
  1123  func rewriteValueLOONG64_OpConst32F(v *Value) bool {
  1124  	// match: (Const32F [val])
  1125  	// result: (MOVFconst [float64(val)])
  1126  	for {
  1127  		val := auxIntToFloat32(v.AuxInt)
  1128  		v.reset(OpLOONG64MOVFconst)
  1129  		v.AuxInt = float64ToAuxInt(float64(val))
  1130  		return true
  1131  	}
  1132  }
  1133  func rewriteValueLOONG64_OpConst64(v *Value) bool {
  1134  	// match: (Const64 [val])
  1135  	// result: (MOVVconst [int64(val)])
  1136  	for {
  1137  		val := auxIntToInt64(v.AuxInt)
  1138  		v.reset(OpLOONG64MOVVconst)
  1139  		v.AuxInt = int64ToAuxInt(int64(val))
  1140  		return true
  1141  	}
  1142  }
  1143  func rewriteValueLOONG64_OpConst64F(v *Value) bool {
  1144  	// match: (Const64F [val])
  1145  	// result: (MOVDconst [float64(val)])
  1146  	for {
  1147  		val := auxIntToFloat64(v.AuxInt)
  1148  		v.reset(OpLOONG64MOVDconst)
  1149  		v.AuxInt = float64ToAuxInt(float64(val))
  1150  		return true
  1151  	}
  1152  }
  1153  func rewriteValueLOONG64_OpConst8(v *Value) bool {
  1154  	// match: (Const8 [val])
  1155  	// result: (MOVVconst [int64(val)])
  1156  	for {
  1157  		val := auxIntToInt8(v.AuxInt)
  1158  		v.reset(OpLOONG64MOVVconst)
  1159  		v.AuxInt = int64ToAuxInt(int64(val))
  1160  		return true
  1161  	}
  1162  }
  1163  func rewriteValueLOONG64_OpConstBool(v *Value) bool {
  1164  	// match: (ConstBool [t])
  1165  	// result: (MOVVconst [int64(b2i(t))])
  1166  	for {
  1167  		t := auxIntToBool(v.AuxInt)
  1168  		v.reset(OpLOONG64MOVVconst)
  1169  		v.AuxInt = int64ToAuxInt(int64(b2i(t)))
  1170  		return true
  1171  	}
  1172  }
  1173  func rewriteValueLOONG64_OpConstNil(v *Value) bool {
  1174  	// match: (ConstNil)
  1175  	// result: (MOVVconst [0])
  1176  	for {
  1177  		v.reset(OpLOONG64MOVVconst)
  1178  		v.AuxInt = int64ToAuxInt(0)
  1179  		return true
  1180  	}
  1181  }
  1182  func rewriteValueLOONG64_OpDiv16(v *Value) bool {
  1183  	v_1 := v.Args[1]
  1184  	v_0 := v.Args[0]
  1185  	b := v.Block
  1186  	typ := &b.Func.Config.Types
  1187  	// match: (Div16 x y)
  1188  	// result: (DIVV (SignExt16to64 x) (SignExt16to64 y))
  1189  	for {
  1190  		x := v_0
  1191  		y := v_1
  1192  		v.reset(OpLOONG64DIVV)
  1193  		v0 := b.NewValue0(v.Pos, OpSignExt16to64, typ.Int64)
  1194  		v0.AddArg(x)
  1195  		v1 := b.NewValue0(v.Pos, OpSignExt16to64, typ.Int64)
  1196  		v1.AddArg(y)
  1197  		v.AddArg2(v0, v1)
  1198  		return true
  1199  	}
  1200  }
  1201  func rewriteValueLOONG64_OpDiv16u(v *Value) bool {
  1202  	v_1 := v.Args[1]
  1203  	v_0 := v.Args[0]
  1204  	b := v.Block
  1205  	typ := &b.Func.Config.Types
  1206  	// match: (Div16u x y)
  1207  	// result: (DIVVU (ZeroExt16to64 x) (ZeroExt16to64 y))
  1208  	for {
  1209  		x := v_0
  1210  		y := v_1
  1211  		v.reset(OpLOONG64DIVVU)
  1212  		v0 := b.NewValue0(v.Pos, OpZeroExt16to64, typ.UInt64)
  1213  		v0.AddArg(x)
  1214  		v1 := b.NewValue0(v.Pos, OpZeroExt16to64, typ.UInt64)
  1215  		v1.AddArg(y)
  1216  		v.AddArg2(v0, v1)
  1217  		return true
  1218  	}
  1219  }
  1220  func rewriteValueLOONG64_OpDiv32(v *Value) bool {
  1221  	v_1 := v.Args[1]
  1222  	v_0 := v.Args[0]
  1223  	b := v.Block
  1224  	typ := &b.Func.Config.Types
  1225  	// match: (Div32 x y)
  1226  	// result: (DIVV (SignExt32to64 x) (SignExt32to64 y))
  1227  	for {
  1228  		x := v_0
  1229  		y := v_1
  1230  		v.reset(OpLOONG64DIVV)
  1231  		v0 := b.NewValue0(v.Pos, OpSignExt32to64, typ.Int64)
  1232  		v0.AddArg(x)
  1233  		v1 := b.NewValue0(v.Pos, OpSignExt32to64, typ.Int64)
  1234  		v1.AddArg(y)
  1235  		v.AddArg2(v0, v1)
  1236  		return true
  1237  	}
  1238  }
  1239  func rewriteValueLOONG64_OpDiv32u(v *Value) bool {
  1240  	v_1 := v.Args[1]
  1241  	v_0 := v.Args[0]
  1242  	b := v.Block
  1243  	typ := &b.Func.Config.Types
  1244  	// match: (Div32u x y)
  1245  	// result: (DIVVU (ZeroExt32to64 x) (ZeroExt32to64 y))
  1246  	for {
  1247  		x := v_0
  1248  		y := v_1
  1249  		v.reset(OpLOONG64DIVVU)
  1250  		v0 := b.NewValue0(v.Pos, OpZeroExt32to64, typ.UInt64)
  1251  		v0.AddArg(x)
  1252  		v1 := b.NewValue0(v.Pos, OpZeroExt32to64, typ.UInt64)
  1253  		v1.AddArg(y)
  1254  		v.AddArg2(v0, v1)
  1255  		return true
  1256  	}
  1257  }
  1258  func rewriteValueLOONG64_OpDiv64(v *Value) bool {
  1259  	v_1 := v.Args[1]
  1260  	v_0 := v.Args[0]
  1261  	// match: (Div64 x y)
  1262  	// result: (DIVV x y)
  1263  	for {
  1264  		x := v_0
  1265  		y := v_1
  1266  		v.reset(OpLOONG64DIVV)
  1267  		v.AddArg2(x, y)
  1268  		return true
  1269  	}
  1270  }
  1271  func rewriteValueLOONG64_OpDiv8(v *Value) bool {
  1272  	v_1 := v.Args[1]
  1273  	v_0 := v.Args[0]
  1274  	b := v.Block
  1275  	typ := &b.Func.Config.Types
  1276  	// match: (Div8 x y)
  1277  	// result: (DIVV (SignExt8to64 x) (SignExt8to64 y))
  1278  	for {
  1279  		x := v_0
  1280  		y := v_1
  1281  		v.reset(OpLOONG64DIVV)
  1282  		v0 := b.NewValue0(v.Pos, OpSignExt8to64, typ.Int64)
  1283  		v0.AddArg(x)
  1284  		v1 := b.NewValue0(v.Pos, OpSignExt8to64, typ.Int64)
  1285  		v1.AddArg(y)
  1286  		v.AddArg2(v0, v1)
  1287  		return true
  1288  	}
  1289  }
  1290  func rewriteValueLOONG64_OpDiv8u(v *Value) bool {
  1291  	v_1 := v.Args[1]
  1292  	v_0 := v.Args[0]
  1293  	b := v.Block
  1294  	typ := &b.Func.Config.Types
  1295  	// match: (Div8u x y)
  1296  	// result: (DIVVU (ZeroExt8to64 x) (ZeroExt8to64 y))
  1297  	for {
  1298  		x := v_0
  1299  		y := v_1
  1300  		v.reset(OpLOONG64DIVVU)
  1301  		v0 := b.NewValue0(v.Pos, OpZeroExt8to64, typ.UInt64)
  1302  		v0.AddArg(x)
  1303  		v1 := b.NewValue0(v.Pos, OpZeroExt8to64, typ.UInt64)
  1304  		v1.AddArg(y)
  1305  		v.AddArg2(v0, v1)
  1306  		return true
  1307  	}
  1308  }
  1309  func rewriteValueLOONG64_OpEq16(v *Value) bool {
  1310  	v_1 := v.Args[1]
  1311  	v_0 := v.Args[0]
  1312  	b := v.Block
  1313  	typ := &b.Func.Config.Types
  1314  	// match: (Eq16 x y)
  1315  	// result: (SGTU (MOVVconst [1]) (XOR (ZeroExt16to64 x) (ZeroExt16to64 y)))
  1316  	for {
  1317  		x := v_0
  1318  		y := v_1
  1319  		v.reset(OpLOONG64SGTU)
  1320  		v0 := b.NewValue0(v.Pos, OpLOONG64MOVVconst, typ.UInt64)
  1321  		v0.AuxInt = int64ToAuxInt(1)
  1322  		v1 := b.NewValue0(v.Pos, OpLOONG64XOR, typ.UInt64)
  1323  		v2 := b.NewValue0(v.Pos, OpZeroExt16to64, typ.UInt64)
  1324  		v2.AddArg(x)
  1325  		v3 := b.NewValue0(v.Pos, OpZeroExt16to64, typ.UInt64)
  1326  		v3.AddArg(y)
  1327  		v1.AddArg2(v2, v3)
  1328  		v.AddArg2(v0, v1)
  1329  		return true
  1330  	}
  1331  }
  1332  func rewriteValueLOONG64_OpEq32(v *Value) bool {
  1333  	v_1 := v.Args[1]
  1334  	v_0 := v.Args[0]
  1335  	b := v.Block
  1336  	typ := &b.Func.Config.Types
  1337  	// match: (Eq32 x y)
  1338  	// result: (SGTU (MOVVconst [1]) (XOR (ZeroExt32to64 x) (ZeroExt32to64 y)))
  1339  	for {
  1340  		x := v_0
  1341  		y := v_1
  1342  		v.reset(OpLOONG64SGTU)
  1343  		v0 := b.NewValue0(v.Pos, OpLOONG64MOVVconst, typ.UInt64)
  1344  		v0.AuxInt = int64ToAuxInt(1)
  1345  		v1 := b.NewValue0(v.Pos, OpLOONG64XOR, typ.UInt64)
  1346  		v2 := b.NewValue0(v.Pos, OpZeroExt32to64, typ.UInt64)
  1347  		v2.AddArg(x)
  1348  		v3 := b.NewValue0(v.Pos, OpZeroExt32to64, typ.UInt64)
  1349  		v3.AddArg(y)
  1350  		v1.AddArg2(v2, v3)
  1351  		v.AddArg2(v0, v1)
  1352  		return true
  1353  	}
  1354  }
  1355  func rewriteValueLOONG64_OpEq32F(v *Value) bool {
  1356  	v_1 := v.Args[1]
  1357  	v_0 := v.Args[0]
  1358  	b := v.Block
  1359  	// match: (Eq32F x y)
  1360  	// result: (FPFlagTrue (CMPEQF x y))
  1361  	for {
  1362  		x := v_0
  1363  		y := v_1
  1364  		v.reset(OpLOONG64FPFlagTrue)
  1365  		v0 := b.NewValue0(v.Pos, OpLOONG64CMPEQF, types.TypeFlags)
  1366  		v0.AddArg2(x, y)
  1367  		v.AddArg(v0)
  1368  		return true
  1369  	}
  1370  }
  1371  func rewriteValueLOONG64_OpEq64(v *Value) bool {
  1372  	v_1 := v.Args[1]
  1373  	v_0 := v.Args[0]
  1374  	b := v.Block
  1375  	typ := &b.Func.Config.Types
  1376  	// match: (Eq64 x y)
  1377  	// result: (SGTU (MOVVconst [1]) (XOR x y))
  1378  	for {
  1379  		x := v_0
  1380  		y := v_1
  1381  		v.reset(OpLOONG64SGTU)
  1382  		v0 := b.NewValue0(v.Pos, OpLOONG64MOVVconst, typ.UInt64)
  1383  		v0.AuxInt = int64ToAuxInt(1)
  1384  		v1 := b.NewValue0(v.Pos, OpLOONG64XOR, typ.UInt64)
  1385  		v1.AddArg2(x, y)
  1386  		v.AddArg2(v0, v1)
  1387  		return true
  1388  	}
  1389  }
  1390  func rewriteValueLOONG64_OpEq64F(v *Value) bool {
  1391  	v_1 := v.Args[1]
  1392  	v_0 := v.Args[0]
  1393  	b := v.Block
  1394  	// match: (Eq64F x y)
  1395  	// result: (FPFlagTrue (CMPEQD x y))
  1396  	for {
  1397  		x := v_0
  1398  		y := v_1
  1399  		v.reset(OpLOONG64FPFlagTrue)
  1400  		v0 := b.NewValue0(v.Pos, OpLOONG64CMPEQD, types.TypeFlags)
  1401  		v0.AddArg2(x, y)
  1402  		v.AddArg(v0)
  1403  		return true
  1404  	}
  1405  }
  1406  func rewriteValueLOONG64_OpEq8(v *Value) bool {
  1407  	v_1 := v.Args[1]
  1408  	v_0 := v.Args[0]
  1409  	b := v.Block
  1410  	typ := &b.Func.Config.Types
  1411  	// match: (Eq8 x y)
  1412  	// result: (SGTU (MOVVconst [1]) (XOR (ZeroExt8to64 x) (ZeroExt8to64 y)))
  1413  	for {
  1414  		x := v_0
  1415  		y := v_1
  1416  		v.reset(OpLOONG64SGTU)
  1417  		v0 := b.NewValue0(v.Pos, OpLOONG64MOVVconst, typ.UInt64)
  1418  		v0.AuxInt = int64ToAuxInt(1)
  1419  		v1 := b.NewValue0(v.Pos, OpLOONG64XOR, typ.UInt64)
  1420  		v2 := b.NewValue0(v.Pos, OpZeroExt8to64, typ.UInt64)
  1421  		v2.AddArg(x)
  1422  		v3 := b.NewValue0(v.Pos, OpZeroExt8to64, typ.UInt64)
  1423  		v3.AddArg(y)
  1424  		v1.AddArg2(v2, v3)
  1425  		v.AddArg2(v0, v1)
  1426  		return true
  1427  	}
  1428  }
  1429  func rewriteValueLOONG64_OpEqB(v *Value) bool {
  1430  	v_1 := v.Args[1]
  1431  	v_0 := v.Args[0]
  1432  	b := v.Block
  1433  	typ := &b.Func.Config.Types
  1434  	// match: (EqB x y)
  1435  	// result: (XOR (MOVVconst [1]) (XOR <typ.Bool> x y))
  1436  	for {
  1437  		x := v_0
  1438  		y := v_1
  1439  		v.reset(OpLOONG64XOR)
  1440  		v0 := b.NewValue0(v.Pos, OpLOONG64MOVVconst, typ.UInt64)
  1441  		v0.AuxInt = int64ToAuxInt(1)
  1442  		v1 := b.NewValue0(v.Pos, OpLOONG64XOR, typ.Bool)
  1443  		v1.AddArg2(x, y)
  1444  		v.AddArg2(v0, v1)
  1445  		return true
  1446  	}
  1447  }
  1448  func rewriteValueLOONG64_OpEqPtr(v *Value) bool {
  1449  	v_1 := v.Args[1]
  1450  	v_0 := v.Args[0]
  1451  	b := v.Block
  1452  	typ := &b.Func.Config.Types
  1453  	// match: (EqPtr x y)
  1454  	// result: (SGTU (MOVVconst [1]) (XOR x y))
  1455  	for {
  1456  		x := v_0
  1457  		y := v_1
  1458  		v.reset(OpLOONG64SGTU)
  1459  		v0 := b.NewValue0(v.Pos, OpLOONG64MOVVconst, typ.UInt64)
  1460  		v0.AuxInt = int64ToAuxInt(1)
  1461  		v1 := b.NewValue0(v.Pos, OpLOONG64XOR, typ.UInt64)
  1462  		v1.AddArg2(x, y)
  1463  		v.AddArg2(v0, v1)
  1464  		return true
  1465  	}
  1466  }
  1467  func rewriteValueLOONG64_OpHmul32(v *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: (Hmul32 x y)
  1473  	// result: (SRAVconst (MULV (SignExt32to64 x) (SignExt32to64 y)) [32])
  1474  	for {
  1475  		x := v_0
  1476  		y := v_1
  1477  		v.reset(OpLOONG64SRAVconst)
  1478  		v.AuxInt = int64ToAuxInt(32)
  1479  		v0 := b.NewValue0(v.Pos, OpLOONG64MULV, typ.Int64)
  1480  		v1 := b.NewValue0(v.Pos, OpSignExt32to64, typ.Int64)
  1481  		v1.AddArg(x)
  1482  		v2 := b.NewValue0(v.Pos, OpSignExt32to64, typ.Int64)
  1483  		v2.AddArg(y)
  1484  		v0.AddArg2(v1, v2)
  1485  		v.AddArg(v0)
  1486  		return true
  1487  	}
  1488  }
  1489  func rewriteValueLOONG64_OpHmul32u(v *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: (Hmul32u x y)
  1495  	// result: (SRLVconst (MULV (ZeroExt32to64 x) (ZeroExt32to64 y)) [32])
  1496  	for {
  1497  		x := v_0
  1498  		y := v_1
  1499  		v.reset(OpLOONG64SRLVconst)
  1500  		v.AuxInt = int64ToAuxInt(32)
  1501  		v0 := b.NewValue0(v.Pos, OpLOONG64MULV, typ.Int64)
  1502  		v1 := b.NewValue0(v.Pos, OpZeroExt32to64, typ.UInt64)
  1503  		v1.AddArg(x)
  1504  		v2 := b.NewValue0(v.Pos, OpZeroExt32to64, typ.UInt64)
  1505  		v2.AddArg(y)
  1506  		v0.AddArg2(v1, v2)
  1507  		v.AddArg(v0)
  1508  		return true
  1509  	}
  1510  }
  1511  func rewriteValueLOONG64_OpIsInBounds(v *Value) bool {
  1512  	v_1 := v.Args[1]
  1513  	v_0 := v.Args[0]
  1514  	// match: (IsInBounds idx len)
  1515  	// result: (SGTU len idx)
  1516  	for {
  1517  		idx := v_0
  1518  		len := v_1
  1519  		v.reset(OpLOONG64SGTU)
  1520  		v.AddArg2(len, idx)
  1521  		return true
  1522  	}
  1523  }
  1524  func rewriteValueLOONG64_OpIsNonNil(v *Value) bool {
  1525  	v_0 := v.Args[0]
  1526  	b := v.Block
  1527  	typ := &b.Func.Config.Types
  1528  	// match: (IsNonNil ptr)
  1529  	// result: (SGTU ptr (MOVVconst [0]))
  1530  	for {
  1531  		ptr := v_0
  1532  		v.reset(OpLOONG64SGTU)
  1533  		v0 := b.NewValue0(v.Pos, OpLOONG64MOVVconst, typ.UInt64)
  1534  		v0.AuxInt = int64ToAuxInt(0)
  1535  		v.AddArg2(ptr, v0)
  1536  		return true
  1537  	}
  1538  }
  1539  func rewriteValueLOONG64_OpIsSliceInBounds(v *Value) bool {
  1540  	v_1 := v.Args[1]
  1541  	v_0 := v.Args[0]
  1542  	b := v.Block
  1543  	typ := &b.Func.Config.Types
  1544  	// match: (IsSliceInBounds idx len)
  1545  	// result: (XOR (MOVVconst [1]) (SGTU idx len))
  1546  	for {
  1547  		idx := v_0
  1548  		len := v_1
  1549  		v.reset(OpLOONG64XOR)
  1550  		v0 := b.NewValue0(v.Pos, OpLOONG64MOVVconst, typ.UInt64)
  1551  		v0.AuxInt = int64ToAuxInt(1)
  1552  		v1 := b.NewValue0(v.Pos, OpLOONG64SGTU, typ.Bool)
  1553  		v1.AddArg2(idx, len)
  1554  		v.AddArg2(v0, v1)
  1555  		return true
  1556  	}
  1557  }
  1558  func rewriteValueLOONG64_OpLOONG64ADDD(v *Value) bool {
  1559  	v_1 := v.Args[1]
  1560  	v_0 := v.Args[0]
  1561  	// match: (ADDD (MULD x y) z)
  1562  	// cond: z.Block.Func.useFMA(v)
  1563  	// result: (FMADDD x y z)
  1564  	for {
  1565  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
  1566  			if v_0.Op != OpLOONG64MULD {
  1567  				continue
  1568  			}
  1569  			y := v_0.Args[1]
  1570  			x := v_0.Args[0]
  1571  			z := v_1
  1572  			if !(z.Block.Func.useFMA(v)) {
  1573  				continue
  1574  			}
  1575  			v.reset(OpLOONG64FMADDD)
  1576  			v.AddArg3(x, y, z)
  1577  			return true
  1578  		}
  1579  		break
  1580  	}
  1581  	// match: (ADDD z (NEGD (MULD x y)))
  1582  	// cond: z.Block.Func.useFMA(v)
  1583  	// result: (FNMSUBD x y z)
  1584  	for {
  1585  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
  1586  			z := v_0
  1587  			if v_1.Op != OpLOONG64NEGD {
  1588  				continue
  1589  			}
  1590  			v_1_0 := v_1.Args[0]
  1591  			if v_1_0.Op != OpLOONG64MULD {
  1592  				continue
  1593  			}
  1594  			y := v_1_0.Args[1]
  1595  			x := v_1_0.Args[0]
  1596  			if !(z.Block.Func.useFMA(v)) {
  1597  				continue
  1598  			}
  1599  			v.reset(OpLOONG64FNMSUBD)
  1600  			v.AddArg3(x, y, z)
  1601  			return true
  1602  		}
  1603  		break
  1604  	}
  1605  	return false
  1606  }
  1607  func rewriteValueLOONG64_OpLOONG64ADDF(v *Value) bool {
  1608  	v_1 := v.Args[1]
  1609  	v_0 := v.Args[0]
  1610  	// match: (ADDF (MULF x y) z)
  1611  	// cond: z.Block.Func.useFMA(v)
  1612  	// result: (FMADDF x y z)
  1613  	for {
  1614  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
  1615  			if v_0.Op != OpLOONG64MULF {
  1616  				continue
  1617  			}
  1618  			y := v_0.Args[1]
  1619  			x := v_0.Args[0]
  1620  			z := v_1
  1621  			if !(z.Block.Func.useFMA(v)) {
  1622  				continue
  1623  			}
  1624  			v.reset(OpLOONG64FMADDF)
  1625  			v.AddArg3(x, y, z)
  1626  			return true
  1627  		}
  1628  		break
  1629  	}
  1630  	// match: (ADDF z (NEGF (MULF x y)))
  1631  	// cond: z.Block.Func.useFMA(v)
  1632  	// result: (FNMSUBF x y z)
  1633  	for {
  1634  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
  1635  			z := v_0
  1636  			if v_1.Op != OpLOONG64NEGF {
  1637  				continue
  1638  			}
  1639  			v_1_0 := v_1.Args[0]
  1640  			if v_1_0.Op != OpLOONG64MULF {
  1641  				continue
  1642  			}
  1643  			y := v_1_0.Args[1]
  1644  			x := v_1_0.Args[0]
  1645  			if !(z.Block.Func.useFMA(v)) {
  1646  				continue
  1647  			}
  1648  			v.reset(OpLOONG64FNMSUBF)
  1649  			v.AddArg3(x, y, z)
  1650  			return true
  1651  		}
  1652  		break
  1653  	}
  1654  	return false
  1655  }
  1656  func rewriteValueLOONG64_OpLOONG64ADDV(v *Value) bool {
  1657  	v_1 := v.Args[1]
  1658  	v_0 := v.Args[0]
  1659  	// match: (ADDV x (MOVVconst <t> [c]))
  1660  	// cond: is32Bit(c) && !t.IsPtr()
  1661  	// result: (ADDVconst [c] x)
  1662  	for {
  1663  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
  1664  			x := v_0
  1665  			if v_1.Op != OpLOONG64MOVVconst {
  1666  				continue
  1667  			}
  1668  			t := v_1.Type
  1669  			c := auxIntToInt64(v_1.AuxInt)
  1670  			if !(is32Bit(c) && !t.IsPtr()) {
  1671  				continue
  1672  			}
  1673  			v.reset(OpLOONG64ADDVconst)
  1674  			v.AuxInt = int64ToAuxInt(c)
  1675  			v.AddArg(x)
  1676  			return true
  1677  		}
  1678  		break
  1679  	}
  1680  	// match: (ADDV x (NEGV y))
  1681  	// result: (SUBV x y)
  1682  	for {
  1683  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
  1684  			x := v_0
  1685  			if v_1.Op != OpLOONG64NEGV {
  1686  				continue
  1687  			}
  1688  			y := v_1.Args[0]
  1689  			v.reset(OpLOONG64SUBV)
  1690  			v.AddArg2(x, y)
  1691  			return true
  1692  		}
  1693  		break
  1694  	}
  1695  	return false
  1696  }
  1697  func rewriteValueLOONG64_OpLOONG64ADDVconst(v *Value) bool {
  1698  	v_0 := v.Args[0]
  1699  	// match: (ADDVconst [off1] (MOVVaddr [off2] {sym} ptr))
  1700  	// cond: is32Bit(off1+int64(off2))
  1701  	// result: (MOVVaddr [int32(off1)+int32(off2)] {sym} ptr)
  1702  	for {
  1703  		off1 := auxIntToInt64(v.AuxInt)
  1704  		if v_0.Op != OpLOONG64MOVVaddr {
  1705  			break
  1706  		}
  1707  		off2 := auxIntToInt32(v_0.AuxInt)
  1708  		sym := auxToSym(v_0.Aux)
  1709  		ptr := v_0.Args[0]
  1710  		if !(is32Bit(off1 + int64(off2))) {
  1711  			break
  1712  		}
  1713  		v.reset(OpLOONG64MOVVaddr)
  1714  		v.AuxInt = int32ToAuxInt(int32(off1) + int32(off2))
  1715  		v.Aux = symToAux(sym)
  1716  		v.AddArg(ptr)
  1717  		return true
  1718  	}
  1719  	// match: (ADDVconst [0] x)
  1720  	// result: x
  1721  	for {
  1722  		if auxIntToInt64(v.AuxInt) != 0 {
  1723  			break
  1724  		}
  1725  		x := v_0
  1726  		v.copyOf(x)
  1727  		return true
  1728  	}
  1729  	// match: (ADDVconst [c] (MOVVconst [d]))
  1730  	// result: (MOVVconst [c+d])
  1731  	for {
  1732  		c := auxIntToInt64(v.AuxInt)
  1733  		if v_0.Op != OpLOONG64MOVVconst {
  1734  			break
  1735  		}
  1736  		d := auxIntToInt64(v_0.AuxInt)
  1737  		v.reset(OpLOONG64MOVVconst)
  1738  		v.AuxInt = int64ToAuxInt(c + d)
  1739  		return true
  1740  	}
  1741  	// match: (ADDVconst [c] (ADDVconst [d] x))
  1742  	// cond: is32Bit(c+d)
  1743  	// result: (ADDVconst [c+d] x)
  1744  	for {
  1745  		c := auxIntToInt64(v.AuxInt)
  1746  		if v_0.Op != OpLOONG64ADDVconst {
  1747  			break
  1748  		}
  1749  		d := auxIntToInt64(v_0.AuxInt)
  1750  		x := v_0.Args[0]
  1751  		if !(is32Bit(c + d)) {
  1752  			break
  1753  		}
  1754  		v.reset(OpLOONG64ADDVconst)
  1755  		v.AuxInt = int64ToAuxInt(c + d)
  1756  		v.AddArg(x)
  1757  		return true
  1758  	}
  1759  	// match: (ADDVconst [c] (SUBVconst [d] x))
  1760  	// cond: is32Bit(c-d)
  1761  	// result: (ADDVconst [c-d] x)
  1762  	for {
  1763  		c := auxIntToInt64(v.AuxInt)
  1764  		if v_0.Op != OpLOONG64SUBVconst {
  1765  			break
  1766  		}
  1767  		d := auxIntToInt64(v_0.AuxInt)
  1768  		x := v_0.Args[0]
  1769  		if !(is32Bit(c - d)) {
  1770  			break
  1771  		}
  1772  		v.reset(OpLOONG64ADDVconst)
  1773  		v.AuxInt = int64ToAuxInt(c - d)
  1774  		v.AddArg(x)
  1775  		return true
  1776  	}
  1777  	return false
  1778  }
  1779  func rewriteValueLOONG64_OpLOONG64AND(v *Value) bool {
  1780  	v_1 := v.Args[1]
  1781  	v_0 := v.Args[0]
  1782  	// match: (AND x (MOVVconst [c]))
  1783  	// cond: is32Bit(c)
  1784  	// result: (ANDconst [c] x)
  1785  	for {
  1786  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
  1787  			x := v_0
  1788  			if v_1.Op != OpLOONG64MOVVconst {
  1789  				continue
  1790  			}
  1791  			c := auxIntToInt64(v_1.AuxInt)
  1792  			if !(is32Bit(c)) {
  1793  				continue
  1794  			}
  1795  			v.reset(OpLOONG64ANDconst)
  1796  			v.AuxInt = int64ToAuxInt(c)
  1797  			v.AddArg(x)
  1798  			return true
  1799  		}
  1800  		break
  1801  	}
  1802  	// match: (AND x x)
  1803  	// result: x
  1804  	for {
  1805  		x := v_0
  1806  		if x != v_1 {
  1807  			break
  1808  		}
  1809  		v.copyOf(x)
  1810  		return true
  1811  	}
  1812  	return false
  1813  }
  1814  func rewriteValueLOONG64_OpLOONG64ANDconst(v *Value) bool {
  1815  	v_0 := v.Args[0]
  1816  	// match: (ANDconst [0] _)
  1817  	// result: (MOVVconst [0])
  1818  	for {
  1819  		if auxIntToInt64(v.AuxInt) != 0 {
  1820  			break
  1821  		}
  1822  		v.reset(OpLOONG64MOVVconst)
  1823  		v.AuxInt = int64ToAuxInt(0)
  1824  		return true
  1825  	}
  1826  	// match: (ANDconst [-1] x)
  1827  	// result: x
  1828  	for {
  1829  		if auxIntToInt64(v.AuxInt) != -1 {
  1830  			break
  1831  		}
  1832  		x := v_0
  1833  		v.copyOf(x)
  1834  		return true
  1835  	}
  1836  	// match: (ANDconst [c] (MOVVconst [d]))
  1837  	// result: (MOVVconst [c&d])
  1838  	for {
  1839  		c := auxIntToInt64(v.AuxInt)
  1840  		if v_0.Op != OpLOONG64MOVVconst {
  1841  			break
  1842  		}
  1843  		d := auxIntToInt64(v_0.AuxInt)
  1844  		v.reset(OpLOONG64MOVVconst)
  1845  		v.AuxInt = int64ToAuxInt(c & d)
  1846  		return true
  1847  	}
  1848  	// match: (ANDconst [c] (ANDconst [d] x))
  1849  	// result: (ANDconst [c&d] x)
  1850  	for {
  1851  		c := auxIntToInt64(v.AuxInt)
  1852  		if v_0.Op != OpLOONG64ANDconst {
  1853  			break
  1854  		}
  1855  		d := auxIntToInt64(v_0.AuxInt)
  1856  		x := v_0.Args[0]
  1857  		v.reset(OpLOONG64ANDconst)
  1858  		v.AuxInt = int64ToAuxInt(c & d)
  1859  		v.AddArg(x)
  1860  		return true
  1861  	}
  1862  	return false
  1863  }
  1864  func rewriteValueLOONG64_OpLOONG64DIVV(v *Value) bool {
  1865  	v_1 := v.Args[1]
  1866  	v_0 := v.Args[0]
  1867  	// match: (DIVV (MOVVconst [c]) (MOVVconst [d]))
  1868  	// cond: d != 0
  1869  	// result: (MOVVconst [c/d])
  1870  	for {
  1871  		if v_0.Op != OpLOONG64MOVVconst {
  1872  			break
  1873  		}
  1874  		c := auxIntToInt64(v_0.AuxInt)
  1875  		if v_1.Op != OpLOONG64MOVVconst {
  1876  			break
  1877  		}
  1878  		d := auxIntToInt64(v_1.AuxInt)
  1879  		if !(d != 0) {
  1880  			break
  1881  		}
  1882  		v.reset(OpLOONG64MOVVconst)
  1883  		v.AuxInt = int64ToAuxInt(c / d)
  1884  		return true
  1885  	}
  1886  	return false
  1887  }
  1888  func rewriteValueLOONG64_OpLOONG64DIVVU(v *Value) bool {
  1889  	v_1 := v.Args[1]
  1890  	v_0 := v.Args[0]
  1891  	// match: (DIVVU x (MOVVconst [1]))
  1892  	// result: x
  1893  	for {
  1894  		x := v_0
  1895  		if v_1.Op != OpLOONG64MOVVconst || auxIntToInt64(v_1.AuxInt) != 1 {
  1896  			break
  1897  		}
  1898  		v.copyOf(x)
  1899  		return true
  1900  	}
  1901  	// match: (DIVVU x (MOVVconst [c]))
  1902  	// cond: isPowerOfTwo(c)
  1903  	// result: (SRLVconst [log64(c)] x)
  1904  	for {
  1905  		x := v_0
  1906  		if v_1.Op != OpLOONG64MOVVconst {
  1907  			break
  1908  		}
  1909  		c := auxIntToInt64(v_1.AuxInt)
  1910  		if !(isPowerOfTwo(c)) {
  1911  			break
  1912  		}
  1913  		v.reset(OpLOONG64SRLVconst)
  1914  		v.AuxInt = int64ToAuxInt(log64(c))
  1915  		v.AddArg(x)
  1916  		return true
  1917  	}
  1918  	// match: (DIVVU (MOVVconst [c]) (MOVVconst [d]))
  1919  	// cond: d != 0
  1920  	// result: (MOVVconst [int64(uint64(c)/uint64(d))])
  1921  	for {
  1922  		if v_0.Op != OpLOONG64MOVVconst {
  1923  			break
  1924  		}
  1925  		c := auxIntToInt64(v_0.AuxInt)
  1926  		if v_1.Op != OpLOONG64MOVVconst {
  1927  			break
  1928  		}
  1929  		d := auxIntToInt64(v_1.AuxInt)
  1930  		if !(d != 0) {
  1931  			break
  1932  		}
  1933  		v.reset(OpLOONG64MOVVconst)
  1934  		v.AuxInt = int64ToAuxInt(int64(uint64(c) / uint64(d)))
  1935  		return true
  1936  	}
  1937  	return false
  1938  }
  1939  func rewriteValueLOONG64_OpLOONG64MASKEQZ(v *Value) bool {
  1940  	v_1 := v.Args[1]
  1941  	v_0 := v.Args[0]
  1942  	// match: (MASKEQZ (MOVVconst [0]) cond)
  1943  	// result: (MOVVconst [0])
  1944  	for {
  1945  		if v_0.Op != OpLOONG64MOVVconst || auxIntToInt64(v_0.AuxInt) != 0 {
  1946  			break
  1947  		}
  1948  		v.reset(OpLOONG64MOVVconst)
  1949  		v.AuxInt = int64ToAuxInt(0)
  1950  		return true
  1951  	}
  1952  	// match: (MASKEQZ x (MOVVconst [c]))
  1953  	// cond: c == 0
  1954  	// result: (MOVVconst [0])
  1955  	for {
  1956  		if v_1.Op != OpLOONG64MOVVconst {
  1957  			break
  1958  		}
  1959  		c := auxIntToInt64(v_1.AuxInt)
  1960  		if !(c == 0) {
  1961  			break
  1962  		}
  1963  		v.reset(OpLOONG64MOVVconst)
  1964  		v.AuxInt = int64ToAuxInt(0)
  1965  		return true
  1966  	}
  1967  	// match: (MASKEQZ x (MOVVconst [c]))
  1968  	// cond: c != 0
  1969  	// result: x
  1970  	for {
  1971  		x := v_0
  1972  		if v_1.Op != OpLOONG64MOVVconst {
  1973  			break
  1974  		}
  1975  		c := auxIntToInt64(v_1.AuxInt)
  1976  		if !(c != 0) {
  1977  			break
  1978  		}
  1979  		v.copyOf(x)
  1980  		return true
  1981  	}
  1982  	return false
  1983  }
  1984  func rewriteValueLOONG64_OpLOONG64MASKNEZ(v *Value) bool {
  1985  	v_0 := v.Args[0]
  1986  	// match: (MASKNEZ (MOVVconst [0]) cond)
  1987  	// result: (MOVVconst [0])
  1988  	for {
  1989  		if v_0.Op != OpLOONG64MOVVconst || auxIntToInt64(v_0.AuxInt) != 0 {
  1990  			break
  1991  		}
  1992  		v.reset(OpLOONG64MOVVconst)
  1993  		v.AuxInt = int64ToAuxInt(0)
  1994  		return true
  1995  	}
  1996  	return false
  1997  }
  1998  func rewriteValueLOONG64_OpLOONG64MOVBUload(v *Value) bool {
  1999  	v_1 := v.Args[1]
  2000  	v_0 := v.Args[0]
  2001  	b := v.Block
  2002  	config := b.Func.Config
  2003  	// match: (MOVBUload [off1] {sym} (ADDVconst [off2] ptr) mem)
  2004  	// cond: is32Bit(int64(off1)+off2) && (ptr.Op != OpSB || !config.ctxt.Flag_dynlink)
  2005  	// result: (MOVBUload [off1+int32(off2)] {sym} ptr mem)
  2006  	for {
  2007  		off1 := auxIntToInt32(v.AuxInt)
  2008  		sym := auxToSym(v.Aux)
  2009  		if v_0.Op != OpLOONG64ADDVconst {
  2010  			break
  2011  		}
  2012  		off2 := auxIntToInt64(v_0.AuxInt)
  2013  		ptr := v_0.Args[0]
  2014  		mem := v_1
  2015  		if !(is32Bit(int64(off1)+off2) && (ptr.Op != OpSB || !config.ctxt.Flag_dynlink)) {
  2016  			break
  2017  		}
  2018  		v.reset(OpLOONG64MOVBUload)
  2019  		v.AuxInt = int32ToAuxInt(off1 + int32(off2))
  2020  		v.Aux = symToAux(sym)
  2021  		v.AddArg2(ptr, mem)
  2022  		return true
  2023  	}
  2024  	// match: (MOVBUload [off1] {sym1} (MOVVaddr [off2] {sym2} ptr) mem)
  2025  	// cond: canMergeSym(sym1,sym2) && is32Bit(int64(off1)+int64(off2)) && (ptr.Op != OpSB || !config.ctxt.Flag_dynlink)
  2026  	// result: (MOVBUload [off1+int32(off2)] {mergeSym(sym1,sym2)} ptr mem)
  2027  	for {
  2028  		off1 := auxIntToInt32(v.AuxInt)
  2029  		sym1 := auxToSym(v.Aux)
  2030  		if v_0.Op != OpLOONG64MOVVaddr {
  2031  			break
  2032  		}
  2033  		off2 := auxIntToInt32(v_0.AuxInt)
  2034  		sym2 := auxToSym(v_0.Aux)
  2035  		ptr := v_0.Args[0]
  2036  		mem := v_1
  2037  		if !(canMergeSym(sym1, sym2) && is32Bit(int64(off1)+int64(off2)) && (ptr.Op != OpSB || !config.ctxt.Flag_dynlink)) {
  2038  			break
  2039  		}
  2040  		v.reset(OpLOONG64MOVBUload)
  2041  		v.AuxInt = int32ToAuxInt(off1 + int32(off2))
  2042  		v.Aux = symToAux(mergeSym(sym1, sym2))
  2043  		v.AddArg2(ptr, mem)
  2044  		return true
  2045  	}
  2046  	// match: (MOVBUload [off] {sym} (ADDV ptr idx) mem)
  2047  	// cond: off == 0 && sym == nil
  2048  	// result: (MOVBUloadidx ptr idx mem)
  2049  	for {
  2050  		off := auxIntToInt32(v.AuxInt)
  2051  		sym := auxToSym(v.Aux)
  2052  		if v_0.Op != OpLOONG64ADDV {
  2053  			break
  2054  		}
  2055  		idx := v_0.Args[1]
  2056  		ptr := v_0.Args[0]
  2057  		mem := v_1
  2058  		if !(off == 0 && sym == nil) {
  2059  			break
  2060  		}
  2061  		v.reset(OpLOONG64MOVBUloadidx)
  2062  		v.AddArg3(ptr, idx, mem)
  2063  		return true
  2064  	}
  2065  	return false
  2066  }
  2067  func rewriteValueLOONG64_OpLOONG64MOVBUloadidx(v *Value) bool {
  2068  	v_2 := v.Args[2]
  2069  	v_1 := v.Args[1]
  2070  	v_0 := v.Args[0]
  2071  	// match: (MOVBUloadidx ptr (MOVVconst [c]) mem)
  2072  	// cond: is32Bit(c)
  2073  	// result: (MOVBUload [int32(c)] ptr mem)
  2074  	for {
  2075  		ptr := v_0
  2076  		if v_1.Op != OpLOONG64MOVVconst {
  2077  			break
  2078  		}
  2079  		c := auxIntToInt64(v_1.AuxInt)
  2080  		mem := v_2
  2081  		if !(is32Bit(c)) {
  2082  			break
  2083  		}
  2084  		v.reset(OpLOONG64MOVBUload)
  2085  		v.AuxInt = int32ToAuxInt(int32(c))
  2086  		v.AddArg2(ptr, mem)
  2087  		return true
  2088  	}
  2089  	// match: (MOVBUloadidx (MOVVconst [c]) ptr mem)
  2090  	// cond: is32Bit(c)
  2091  	// result: (MOVBUload [int32(c)] ptr mem)
  2092  	for {
  2093  		if v_0.Op != OpLOONG64MOVVconst {
  2094  			break
  2095  		}
  2096  		c := auxIntToInt64(v_0.AuxInt)
  2097  		ptr := v_1
  2098  		mem := v_2
  2099  		if !(is32Bit(c)) {
  2100  			break
  2101  		}
  2102  		v.reset(OpLOONG64MOVBUload)
  2103  		v.AuxInt = int32ToAuxInt(int32(c))
  2104  		v.AddArg2(ptr, mem)
  2105  		return true
  2106  	}
  2107  	return false
  2108  }
  2109  func rewriteValueLOONG64_OpLOONG64MOVBUreg(v *Value) bool {
  2110  	v_0 := v.Args[0]
  2111  	// match: (MOVBUreg (SRLVconst [rc] x))
  2112  	// cond: rc < 8
  2113  	// result: (BSTRPICKV [rc + (7+rc)<<6] x)
  2114  	for {
  2115  		if v_0.Op != OpLOONG64SRLVconst {
  2116  			break
  2117  		}
  2118  		rc := auxIntToInt64(v_0.AuxInt)
  2119  		x := v_0.Args[0]
  2120  		if !(rc < 8) {
  2121  			break
  2122  		}
  2123  		v.reset(OpLOONG64BSTRPICKV)
  2124  		v.AuxInt = int64ToAuxInt(rc + (7+rc)<<6)
  2125  		v.AddArg(x)
  2126  		return true
  2127  	}
  2128  	// match: (MOVBUreg x:(SGT _ _))
  2129  	// result: x
  2130  	for {
  2131  		x := v_0
  2132  		if x.Op != OpLOONG64SGT {
  2133  			break
  2134  		}
  2135  		v.copyOf(x)
  2136  		return true
  2137  	}
  2138  	// match: (MOVBUreg x:(SGTU _ _))
  2139  	// result: x
  2140  	for {
  2141  		x := v_0
  2142  		if x.Op != OpLOONG64SGTU {
  2143  			break
  2144  		}
  2145  		v.copyOf(x)
  2146  		return true
  2147  	}
  2148  	// match: (MOVBUreg x:(XOR (MOVVconst [1]) (SGT _ _)))
  2149  	// result: x
  2150  	for {
  2151  		x := v_0
  2152  		if x.Op != OpLOONG64XOR {
  2153  			break
  2154  		}
  2155  		_ = x.Args[1]
  2156  		x_0 := x.Args[0]
  2157  		x_1 := x.Args[1]
  2158  		for _i0 := 0; _i0 <= 1; _i0, x_0, x_1 = _i0+1, x_1, x_0 {
  2159  			if x_0.Op != OpLOONG64MOVVconst || auxIntToInt64(x_0.AuxInt) != 1 || x_1.Op != OpLOONG64SGT {
  2160  				continue
  2161  			}
  2162  			v.copyOf(x)
  2163  			return true
  2164  		}
  2165  		break
  2166  	}
  2167  	// match: (MOVBUreg x:(XOR (MOVVconst [1]) (SGTU _ _)))
  2168  	// result: x
  2169  	for {
  2170  		x := v_0
  2171  		if x.Op != OpLOONG64XOR {
  2172  			break
  2173  		}
  2174  		_ = x.Args[1]
  2175  		x_0 := x.Args[0]
  2176  		x_1 := x.Args[1]
  2177  		for _i0 := 0; _i0 <= 1; _i0, x_0, x_1 = _i0+1, x_1, x_0 {
  2178  			if x_0.Op != OpLOONG64MOVVconst || auxIntToInt64(x_0.AuxInt) != 1 || x_1.Op != OpLOONG64SGTU {
  2179  				continue
  2180  			}
  2181  			v.copyOf(x)
  2182  			return true
  2183  		}
  2184  		break
  2185  	}
  2186  	// match: (MOVBUreg x:(MOVBUload _ _))
  2187  	// result: (MOVVreg x)
  2188  	for {
  2189  		x := v_0
  2190  		if x.Op != OpLOONG64MOVBUload {
  2191  			break
  2192  		}
  2193  		v.reset(OpLOONG64MOVVreg)
  2194  		v.AddArg(x)
  2195  		return true
  2196  	}
  2197  	// match: (MOVBUreg x:(MOVBUreg _))
  2198  	// result: (MOVVreg x)
  2199  	for {
  2200  		x := v_0
  2201  		if x.Op != OpLOONG64MOVBUreg {
  2202  			break
  2203  		}
  2204  		v.reset(OpLOONG64MOVVreg)
  2205  		v.AddArg(x)
  2206  		return true
  2207  	}
  2208  	// match: (MOVBUreg (SLLVconst [lc] x))
  2209  	// cond: lc >= 8
  2210  	// result: (MOVVconst [0])
  2211  	for {
  2212  		if v_0.Op != OpLOONG64SLLVconst {
  2213  			break
  2214  		}
  2215  		lc := auxIntToInt64(v_0.AuxInt)
  2216  		if !(lc >= 8) {
  2217  			break
  2218  		}
  2219  		v.reset(OpLOONG64MOVVconst)
  2220  		v.AuxInt = int64ToAuxInt(0)
  2221  		return true
  2222  	}
  2223  	// match: (MOVBUreg (MOVVconst [c]))
  2224  	// result: (MOVVconst [int64(uint8(c))])
  2225  	for {
  2226  		if v_0.Op != OpLOONG64MOVVconst {
  2227  			break
  2228  		}
  2229  		c := auxIntToInt64(v_0.AuxInt)
  2230  		v.reset(OpLOONG64MOVVconst)
  2231  		v.AuxInt = int64ToAuxInt(int64(uint8(c)))
  2232  		return true
  2233  	}
  2234  	// match: (MOVBUreg (ANDconst [c] x))
  2235  	// result: (ANDconst [c&0xff] x)
  2236  	for {
  2237  		if v_0.Op != OpLOONG64ANDconst {
  2238  			break
  2239  		}
  2240  		c := auxIntToInt64(v_0.AuxInt)
  2241  		x := v_0.Args[0]
  2242  		v.reset(OpLOONG64ANDconst)
  2243  		v.AuxInt = int64ToAuxInt(c & 0xff)
  2244  		v.AddArg(x)
  2245  		return true
  2246  	}
  2247  	return false
  2248  }
  2249  func rewriteValueLOONG64_OpLOONG64MOVBload(v *Value) bool {
  2250  	v_1 := v.Args[1]
  2251  	v_0 := v.Args[0]
  2252  	b := v.Block
  2253  	config := b.Func.Config
  2254  	// match: (MOVBload [off1] {sym} (ADDVconst [off2] ptr) mem)
  2255  	// cond: is32Bit(int64(off1)+off2) && (ptr.Op != OpSB || !config.ctxt.Flag_dynlink)
  2256  	// result: (MOVBload [off1+int32(off2)] {sym} ptr mem)
  2257  	for {
  2258  		off1 := auxIntToInt32(v.AuxInt)
  2259  		sym := auxToSym(v.Aux)
  2260  		if v_0.Op != OpLOONG64ADDVconst {
  2261  			break
  2262  		}
  2263  		off2 := auxIntToInt64(v_0.AuxInt)
  2264  		ptr := v_0.Args[0]
  2265  		mem := v_1
  2266  		if !(is32Bit(int64(off1)+off2) && (ptr.Op != OpSB || !config.ctxt.Flag_dynlink)) {
  2267  			break
  2268  		}
  2269  		v.reset(OpLOONG64MOVBload)
  2270  		v.AuxInt = int32ToAuxInt(off1 + int32(off2))
  2271  		v.Aux = symToAux(sym)
  2272  		v.AddArg2(ptr, mem)
  2273  		return true
  2274  	}
  2275  	// match: (MOVBload [off1] {sym1} (MOVVaddr [off2] {sym2} ptr) mem)
  2276  	// cond: canMergeSym(sym1,sym2) && is32Bit(int64(off1)+int64(off2)) && (ptr.Op != OpSB || !config.ctxt.Flag_dynlink)
  2277  	// result: (MOVBload [off1+int32(off2)] {mergeSym(sym1,sym2)} ptr mem)
  2278  	for {
  2279  		off1 := auxIntToInt32(v.AuxInt)
  2280  		sym1 := auxToSym(v.Aux)
  2281  		if v_0.Op != OpLOONG64MOVVaddr {
  2282  			break
  2283  		}
  2284  		off2 := auxIntToInt32(v_0.AuxInt)
  2285  		sym2 := auxToSym(v_0.Aux)
  2286  		ptr := v_0.Args[0]
  2287  		mem := v_1
  2288  		if !(canMergeSym(sym1, sym2) && is32Bit(int64(off1)+int64(off2)) && (ptr.Op != OpSB || !config.ctxt.Flag_dynlink)) {
  2289  			break
  2290  		}
  2291  		v.reset(OpLOONG64MOVBload)
  2292  		v.AuxInt = int32ToAuxInt(off1 + int32(off2))
  2293  		v.Aux = symToAux(mergeSym(sym1, sym2))
  2294  		v.AddArg2(ptr, mem)
  2295  		return true
  2296  	}
  2297  	// match: (MOVBload [off] {sym} (ADDV ptr idx) mem)
  2298  	// cond: off == 0 && sym == nil
  2299  	// result: (MOVBloadidx ptr idx mem)
  2300  	for {
  2301  		off := auxIntToInt32(v.AuxInt)
  2302  		sym := auxToSym(v.Aux)
  2303  		if v_0.Op != OpLOONG64ADDV {
  2304  			break
  2305  		}
  2306  		idx := v_0.Args[1]
  2307  		ptr := v_0.Args[0]
  2308  		mem := v_1
  2309  		if !(off == 0 && sym == nil) {
  2310  			break
  2311  		}
  2312  		v.reset(OpLOONG64MOVBloadidx)
  2313  		v.AddArg3(ptr, idx, mem)
  2314  		return true
  2315  	}
  2316  	return false
  2317  }
  2318  func rewriteValueLOONG64_OpLOONG64MOVBloadidx(v *Value) bool {
  2319  	v_2 := v.Args[2]
  2320  	v_1 := v.Args[1]
  2321  	v_0 := v.Args[0]
  2322  	// match: (MOVBloadidx ptr (MOVVconst [c]) mem)
  2323  	// cond: is32Bit(c)
  2324  	// result: (MOVBload [int32(c)] ptr mem)
  2325  	for {
  2326  		ptr := v_0
  2327  		if v_1.Op != OpLOONG64MOVVconst {
  2328  			break
  2329  		}
  2330  		c := auxIntToInt64(v_1.AuxInt)
  2331  		mem := v_2
  2332  		if !(is32Bit(c)) {
  2333  			break
  2334  		}
  2335  		v.reset(OpLOONG64MOVBload)
  2336  		v.AuxInt = int32ToAuxInt(int32(c))
  2337  		v.AddArg2(ptr, mem)
  2338  		return true
  2339  	}
  2340  	// match: (MOVBloadidx (MOVVconst [c]) ptr mem)
  2341  	// cond: is32Bit(c)
  2342  	// result: (MOVBload [int32(c)] ptr mem)
  2343  	for {
  2344  		if v_0.Op != OpLOONG64MOVVconst {
  2345  			break
  2346  		}
  2347  		c := auxIntToInt64(v_0.AuxInt)
  2348  		ptr := v_1
  2349  		mem := v_2
  2350  		if !(is32Bit(c)) {
  2351  			break
  2352  		}
  2353  		v.reset(OpLOONG64MOVBload)
  2354  		v.AuxInt = int32ToAuxInt(int32(c))
  2355  		v.AddArg2(ptr, mem)
  2356  		return true
  2357  	}
  2358  	return false
  2359  }
  2360  func rewriteValueLOONG64_OpLOONG64MOVBreg(v *Value) bool {
  2361  	v_0 := v.Args[0]
  2362  	// match: (MOVBreg x:(MOVBload _ _))
  2363  	// result: (MOVVreg x)
  2364  	for {
  2365  		x := v_0
  2366  		if x.Op != OpLOONG64MOVBload {
  2367  			break
  2368  		}
  2369  		v.reset(OpLOONG64MOVVreg)
  2370  		v.AddArg(x)
  2371  		return true
  2372  	}
  2373  	// match: (MOVBreg x:(MOVBreg _))
  2374  	// result: (MOVVreg x)
  2375  	for {
  2376  		x := v_0
  2377  		if x.Op != OpLOONG64MOVBreg {
  2378  			break
  2379  		}
  2380  		v.reset(OpLOONG64MOVVreg)
  2381  		v.AddArg(x)
  2382  		return true
  2383  	}
  2384  	// match: (MOVBreg (MOVVconst [c]))
  2385  	// result: (MOVVconst [int64(int8(c))])
  2386  	for {
  2387  		if v_0.Op != OpLOONG64MOVVconst {
  2388  			break
  2389  		}
  2390  		c := auxIntToInt64(v_0.AuxInt)
  2391  		v.reset(OpLOONG64MOVVconst)
  2392  		v.AuxInt = int64ToAuxInt(int64(int8(c)))
  2393  		return true
  2394  	}
  2395  	return false
  2396  }
  2397  func rewriteValueLOONG64_OpLOONG64MOVBstore(v *Value) bool {
  2398  	v_2 := v.Args[2]
  2399  	v_1 := v.Args[1]
  2400  	v_0 := v.Args[0]
  2401  	b := v.Block
  2402  	config := b.Func.Config
  2403  	// match: (MOVBstore [off1] {sym} (ADDVconst [off2] ptr) val mem)
  2404  	// cond: is32Bit(int64(off1)+off2) && (ptr.Op != OpSB || !config.ctxt.Flag_dynlink)
  2405  	// result: (MOVBstore [off1+int32(off2)] {sym} ptr val mem)
  2406  	for {
  2407  		off1 := auxIntToInt32(v.AuxInt)
  2408  		sym := auxToSym(v.Aux)
  2409  		if v_0.Op != OpLOONG64ADDVconst {
  2410  			break
  2411  		}
  2412  		off2 := auxIntToInt64(v_0.AuxInt)
  2413  		ptr := v_0.Args[0]
  2414  		val := v_1
  2415  		mem := v_2
  2416  		if !(is32Bit(int64(off1)+off2) && (ptr.Op != OpSB || !config.ctxt.Flag_dynlink)) {
  2417  			break
  2418  		}
  2419  		v.reset(OpLOONG64MOVBstore)
  2420  		v.AuxInt = int32ToAuxInt(off1 + int32(off2))
  2421  		v.Aux = symToAux(sym)
  2422  		v.AddArg3(ptr, val, mem)
  2423  		return true
  2424  	}
  2425  	// match: (MOVBstore [off1] {sym1} (MOVVaddr [off2] {sym2} ptr) val mem)
  2426  	// cond: canMergeSym(sym1,sym2) && is32Bit(int64(off1)+int64(off2)) && (ptr.Op != OpSB || !config.ctxt.Flag_dynlink)
  2427  	// result: (MOVBstore [off1+int32(off2)] {mergeSym(sym1,sym2)} ptr val mem)
  2428  	for {
  2429  		off1 := auxIntToInt32(v.AuxInt)
  2430  		sym1 := auxToSym(v.Aux)
  2431  		if v_0.Op != OpLOONG64MOVVaddr {
  2432  			break
  2433  		}
  2434  		off2 := auxIntToInt32(v_0.AuxInt)
  2435  		sym2 := auxToSym(v_0.Aux)
  2436  		ptr := v_0.Args[0]
  2437  		val := v_1
  2438  		mem := v_2
  2439  		if !(canMergeSym(sym1, sym2) && is32Bit(int64(off1)+int64(off2)) && (ptr.Op != OpSB || !config.ctxt.Flag_dynlink)) {
  2440  			break
  2441  		}
  2442  		v.reset(OpLOONG64MOVBstore)
  2443  		v.AuxInt = int32ToAuxInt(off1 + int32(off2))
  2444  		v.Aux = symToAux(mergeSym(sym1, sym2))
  2445  		v.AddArg3(ptr, val, mem)
  2446  		return true
  2447  	}
  2448  	// match: (MOVBstore [off] {sym} ptr (MOVBreg x) mem)
  2449  	// result: (MOVBstore [off] {sym} ptr x mem)
  2450  	for {
  2451  		off := auxIntToInt32(v.AuxInt)
  2452  		sym := auxToSym(v.Aux)
  2453  		ptr := v_0
  2454  		if v_1.Op != OpLOONG64MOVBreg {
  2455  			break
  2456  		}
  2457  		x := v_1.Args[0]
  2458  		mem := v_2
  2459  		v.reset(OpLOONG64MOVBstore)
  2460  		v.AuxInt = int32ToAuxInt(off)
  2461  		v.Aux = symToAux(sym)
  2462  		v.AddArg3(ptr, x, mem)
  2463  		return true
  2464  	}
  2465  	// match: (MOVBstore [off] {sym} ptr (MOVBUreg x) mem)
  2466  	// result: (MOVBstore [off] {sym} ptr x mem)
  2467  	for {
  2468  		off := auxIntToInt32(v.AuxInt)
  2469  		sym := auxToSym(v.Aux)
  2470  		ptr := v_0
  2471  		if v_1.Op != OpLOONG64MOVBUreg {
  2472  			break
  2473  		}
  2474  		x := v_1.Args[0]
  2475  		mem := v_2
  2476  		v.reset(OpLOONG64MOVBstore)
  2477  		v.AuxInt = int32ToAuxInt(off)
  2478  		v.Aux = symToAux(sym)
  2479  		v.AddArg3(ptr, x, mem)
  2480  		return true
  2481  	}
  2482  	// match: (MOVBstore [off] {sym} ptr (MOVHreg x) mem)
  2483  	// result: (MOVBstore [off] {sym} ptr x mem)
  2484  	for {
  2485  		off := auxIntToInt32(v.AuxInt)
  2486  		sym := auxToSym(v.Aux)
  2487  		ptr := v_0
  2488  		if v_1.Op != OpLOONG64MOVHreg {
  2489  			break
  2490  		}
  2491  		x := v_1.Args[0]
  2492  		mem := v_2
  2493  		v.reset(OpLOONG64MOVBstore)
  2494  		v.AuxInt = int32ToAuxInt(off)
  2495  		v.Aux = symToAux(sym)
  2496  		v.AddArg3(ptr, x, mem)
  2497  		return true
  2498  	}
  2499  	// match: (MOVBstore [off] {sym} ptr (MOVHUreg x) mem)
  2500  	// result: (MOVBstore [off] {sym} ptr x mem)
  2501  	for {
  2502  		off := auxIntToInt32(v.AuxInt)
  2503  		sym := auxToSym(v.Aux)
  2504  		ptr := v_0
  2505  		if v_1.Op != OpLOONG64MOVHUreg {
  2506  			break
  2507  		}
  2508  		x := v_1.Args[0]
  2509  		mem := v_2
  2510  		v.reset(OpLOONG64MOVBstore)
  2511  		v.AuxInt = int32ToAuxInt(off)
  2512  		v.Aux = symToAux(sym)
  2513  		v.AddArg3(ptr, x, mem)
  2514  		return true
  2515  	}
  2516  	// match: (MOVBstore [off] {sym} ptr (MOVWreg x) mem)
  2517  	// result: (MOVBstore [off] {sym} ptr x mem)
  2518  	for {
  2519  		off := auxIntToInt32(v.AuxInt)
  2520  		sym := auxToSym(v.Aux)
  2521  		ptr := v_0
  2522  		if v_1.Op != OpLOONG64MOVWreg {
  2523  			break
  2524  		}
  2525  		x := v_1.Args[0]
  2526  		mem := v_2
  2527  		v.reset(OpLOONG64MOVBstore)
  2528  		v.AuxInt = int32ToAuxInt(off)
  2529  		v.Aux = symToAux(sym)
  2530  		v.AddArg3(ptr, x, mem)
  2531  		return true
  2532  	}
  2533  	// match: (MOVBstore [off] {sym} ptr (MOVWUreg x) mem)
  2534  	// result: (MOVBstore [off] {sym} ptr x mem)
  2535  	for {
  2536  		off := auxIntToInt32(v.AuxInt)
  2537  		sym := auxToSym(v.Aux)
  2538  		ptr := v_0
  2539  		if v_1.Op != OpLOONG64MOVWUreg {
  2540  			break
  2541  		}
  2542  		x := v_1.Args[0]
  2543  		mem := v_2
  2544  		v.reset(OpLOONG64MOVBstore)
  2545  		v.AuxInt = int32ToAuxInt(off)
  2546  		v.Aux = symToAux(sym)
  2547  		v.AddArg3(ptr, x, mem)
  2548  		return true
  2549  	}
  2550  	// match: (MOVBstore [off] {sym} ptr (MOVVconst [0]) mem)
  2551  	// result: (MOVBstorezero [off] {sym} ptr mem)
  2552  	for {
  2553  		off := auxIntToInt32(v.AuxInt)
  2554  		sym := auxToSym(v.Aux)
  2555  		ptr := v_0
  2556  		if v_1.Op != OpLOONG64MOVVconst || auxIntToInt64(v_1.AuxInt) != 0 {
  2557  			break
  2558  		}
  2559  		mem := v_2
  2560  		v.reset(OpLOONG64MOVBstorezero)
  2561  		v.AuxInt = int32ToAuxInt(off)
  2562  		v.Aux = symToAux(sym)
  2563  		v.AddArg2(ptr, mem)
  2564  		return true
  2565  	}
  2566  	// match: (MOVBstore [off] {sym} (ADDV ptr idx) val mem)
  2567  	// cond: off == 0 && sym == nil
  2568  	// result: (MOVBstoreidx ptr idx val mem)
  2569  	for {
  2570  		off := auxIntToInt32(v.AuxInt)
  2571  		sym := auxToSym(v.Aux)
  2572  		if v_0.Op != OpLOONG64ADDV {
  2573  			break
  2574  		}
  2575  		idx := v_0.Args[1]
  2576  		ptr := v_0.Args[0]
  2577  		val := v_1
  2578  		mem := v_2
  2579  		if !(off == 0 && sym == nil) {
  2580  			break
  2581  		}
  2582  		v.reset(OpLOONG64MOVBstoreidx)
  2583  		v.AddArg4(ptr, idx, val, mem)
  2584  		return true
  2585  	}
  2586  	return false
  2587  }
  2588  func rewriteValueLOONG64_OpLOONG64MOVBstoreidx(v *Value) bool {
  2589  	v_3 := v.Args[3]
  2590  	v_2 := v.Args[2]
  2591  	v_1 := v.Args[1]
  2592  	v_0 := v.Args[0]
  2593  	// match: (MOVBstoreidx ptr (MOVVconst [c]) val mem)
  2594  	// cond: is32Bit(c)
  2595  	// result: (MOVBstore [int32(c)] ptr val mem)
  2596  	for {
  2597  		ptr := v_0
  2598  		if v_1.Op != OpLOONG64MOVVconst {
  2599  			break
  2600  		}
  2601  		c := auxIntToInt64(v_1.AuxInt)
  2602  		val := v_2
  2603  		mem := v_3
  2604  		if !(is32Bit(c)) {
  2605  			break
  2606  		}
  2607  		v.reset(OpLOONG64MOVBstore)
  2608  		v.AuxInt = int32ToAuxInt(int32(c))
  2609  		v.AddArg3(ptr, val, mem)
  2610  		return true
  2611  	}
  2612  	// match: (MOVBstoreidx (MOVVconst [c]) idx val mem)
  2613  	// cond: is32Bit(c)
  2614  	// result: (MOVBstore [int32(c)] idx val mem)
  2615  	for {
  2616  		if v_0.Op != OpLOONG64MOVVconst {
  2617  			break
  2618  		}
  2619  		c := auxIntToInt64(v_0.AuxInt)
  2620  		idx := v_1
  2621  		val := v_2
  2622  		mem := v_3
  2623  		if !(is32Bit(c)) {
  2624  			break
  2625  		}
  2626  		v.reset(OpLOONG64MOVBstore)
  2627  		v.AuxInt = int32ToAuxInt(int32(c))
  2628  		v.AddArg3(idx, val, mem)
  2629  		return true
  2630  	}
  2631  	// match: (MOVBstoreidx ptr idx (MOVVconst [0]) mem)
  2632  	// result: (MOVBstorezeroidx ptr idx mem)
  2633  	for {
  2634  		ptr := v_0
  2635  		idx := v_1
  2636  		if v_2.Op != OpLOONG64MOVVconst || auxIntToInt64(v_2.AuxInt) != 0 {
  2637  			break
  2638  		}
  2639  		mem := v_3
  2640  		v.reset(OpLOONG64MOVBstorezeroidx)
  2641  		v.AddArg3(ptr, idx, mem)
  2642  		return true
  2643  	}
  2644  	return false
  2645  }
  2646  func rewriteValueLOONG64_OpLOONG64MOVBstorezero(v *Value) bool {
  2647  	v_1 := v.Args[1]
  2648  	v_0 := v.Args[0]
  2649  	b := v.Block
  2650  	config := b.Func.Config
  2651  	// match: (MOVBstorezero [off1] {sym} (ADDVconst [off2] ptr) mem)
  2652  	// cond: is32Bit(int64(off1)+off2) && (ptr.Op != OpSB || !config.ctxt.Flag_dynlink)
  2653  	// result: (MOVBstorezero [off1+int32(off2)] {sym} ptr mem)
  2654  	for {
  2655  		off1 := auxIntToInt32(v.AuxInt)
  2656  		sym := auxToSym(v.Aux)
  2657  		if v_0.Op != OpLOONG64ADDVconst {
  2658  			break
  2659  		}
  2660  		off2 := auxIntToInt64(v_0.AuxInt)
  2661  		ptr := v_0.Args[0]
  2662  		mem := v_1
  2663  		if !(is32Bit(int64(off1)+off2) && (ptr.Op != OpSB || !config.ctxt.Flag_dynlink)) {
  2664  			break
  2665  		}
  2666  		v.reset(OpLOONG64MOVBstorezero)
  2667  		v.AuxInt = int32ToAuxInt(off1 + int32(off2))
  2668  		v.Aux = symToAux(sym)
  2669  		v.AddArg2(ptr, mem)
  2670  		return true
  2671  	}
  2672  	// match: (MOVBstorezero [off1] {sym1} (MOVVaddr [off2] {sym2} ptr) mem)
  2673  	// cond: canMergeSym(sym1,sym2) && is32Bit(int64(off1)+int64(off2)) && (ptr.Op != OpSB || !config.ctxt.Flag_dynlink)
  2674  	// result: (MOVBstorezero [off1+int32(off2)] {mergeSym(sym1,sym2)} ptr mem)
  2675  	for {
  2676  		off1 := auxIntToInt32(v.AuxInt)
  2677  		sym1 := auxToSym(v.Aux)
  2678  		if v_0.Op != OpLOONG64MOVVaddr {
  2679  			break
  2680  		}
  2681  		off2 := auxIntToInt32(v_0.AuxInt)
  2682  		sym2 := auxToSym(v_0.Aux)
  2683  		ptr := v_0.Args[0]
  2684  		mem := v_1
  2685  		if !(canMergeSym(sym1, sym2) && is32Bit(int64(off1)+int64(off2)) && (ptr.Op != OpSB || !config.ctxt.Flag_dynlink)) {
  2686  			break
  2687  		}
  2688  		v.reset(OpLOONG64MOVBstorezero)
  2689  		v.AuxInt = int32ToAuxInt(off1 + int32(off2))
  2690  		v.Aux = symToAux(mergeSym(sym1, sym2))
  2691  		v.AddArg2(ptr, mem)
  2692  		return true
  2693  	}
  2694  	// match: (MOVBstorezero [off] {sym} (ADDV ptr idx) mem)
  2695  	// cond: off == 0 && sym == nil
  2696  	// result: (MOVBstorezeroidx ptr idx mem)
  2697  	for {
  2698  		off := auxIntToInt32(v.AuxInt)
  2699  		sym := auxToSym(v.Aux)
  2700  		if v_0.Op != OpLOONG64ADDV {
  2701  			break
  2702  		}
  2703  		idx := v_0.Args[1]
  2704  		ptr := v_0.Args[0]
  2705  		mem := v_1
  2706  		if !(off == 0 && sym == nil) {
  2707  			break
  2708  		}
  2709  		v.reset(OpLOONG64MOVBstorezeroidx)
  2710  		v.AddArg3(ptr, idx, mem)
  2711  		return true
  2712  	}
  2713  	return false
  2714  }
  2715  func rewriteValueLOONG64_OpLOONG64MOVBstorezeroidx(v *Value) bool {
  2716  	v_2 := v.Args[2]
  2717  	v_1 := v.Args[1]
  2718  	v_0 := v.Args[0]
  2719  	// match: (MOVBstorezeroidx ptr (MOVVconst [c]) mem)
  2720  	// cond: is32Bit(c)
  2721  	// result: (MOVBstorezero [int32(c)] ptr mem)
  2722  	for {
  2723  		ptr := v_0
  2724  		if v_1.Op != OpLOONG64MOVVconst {
  2725  			break
  2726  		}
  2727  		c := auxIntToInt64(v_1.AuxInt)
  2728  		mem := v_2
  2729  		if !(is32Bit(c)) {
  2730  			break
  2731  		}
  2732  		v.reset(OpLOONG64MOVBstorezero)
  2733  		v.AuxInt = int32ToAuxInt(int32(c))
  2734  		v.AddArg2(ptr, mem)
  2735  		return true
  2736  	}
  2737  	// match: (MOVBstorezeroidx (MOVVconst [c]) idx mem)
  2738  	// cond: is32Bit(c)
  2739  	// result: (MOVBstorezero [int32(c)] idx mem)
  2740  	for {
  2741  		if v_0.Op != OpLOONG64MOVVconst {
  2742  			break
  2743  		}
  2744  		c := auxIntToInt64(v_0.AuxInt)
  2745  		idx := v_1
  2746  		mem := v_2
  2747  		if !(is32Bit(c)) {
  2748  			break
  2749  		}
  2750  		v.reset(OpLOONG64MOVBstorezero)
  2751  		v.AuxInt = int32ToAuxInt(int32(c))
  2752  		v.AddArg2(idx, mem)
  2753  		return true
  2754  	}
  2755  	return false
  2756  }
  2757  func rewriteValueLOONG64_OpLOONG64MOVDload(v *Value) bool {
  2758  	v_1 := v.Args[1]
  2759  	v_0 := v.Args[0]
  2760  	b := v.Block
  2761  	config := b.Func.Config
  2762  	// match: (MOVDload [off] {sym} ptr (MOVVstore [off] {sym} ptr val _))
  2763  	// result: (MOVVgpfp val)
  2764  	for {
  2765  		off := auxIntToInt32(v.AuxInt)
  2766  		sym := auxToSym(v.Aux)
  2767  		ptr := v_0
  2768  		if v_1.Op != OpLOONG64MOVVstore || auxIntToInt32(v_1.AuxInt) != off || auxToSym(v_1.Aux) != sym {
  2769  			break
  2770  		}
  2771  		val := v_1.Args[1]
  2772  		if ptr != v_1.Args[0] {
  2773  			break
  2774  		}
  2775  		v.reset(OpLOONG64MOVVgpfp)
  2776  		v.AddArg(val)
  2777  		return true
  2778  	}
  2779  	// match: (MOVDload [off1] {sym} (ADDVconst [off2] ptr) mem)
  2780  	// cond: is32Bit(int64(off1)+off2) && (ptr.Op != OpSB || !config.ctxt.Flag_dynlink)
  2781  	// result: (MOVDload [off1+int32(off2)] {sym} ptr mem)
  2782  	for {
  2783  		off1 := auxIntToInt32(v.AuxInt)
  2784  		sym := auxToSym(v.Aux)
  2785  		if v_0.Op != OpLOONG64ADDVconst {
  2786  			break
  2787  		}
  2788  		off2 := auxIntToInt64(v_0.AuxInt)
  2789  		ptr := v_0.Args[0]
  2790  		mem := v_1
  2791  		if !(is32Bit(int64(off1)+off2) && (ptr.Op != OpSB || !config.ctxt.Flag_dynlink)) {
  2792  			break
  2793  		}
  2794  		v.reset(OpLOONG64MOVDload)
  2795  		v.AuxInt = int32ToAuxInt(off1 + int32(off2))
  2796  		v.Aux = symToAux(sym)
  2797  		v.AddArg2(ptr, mem)
  2798  		return true
  2799  	}
  2800  	// match: (MOVDload [off1] {sym1} (MOVVaddr [off2] {sym2} ptr) mem)
  2801  	// cond: canMergeSym(sym1,sym2) && is32Bit(int64(off1)+int64(off2)) && (ptr.Op != OpSB || !config.ctxt.Flag_dynlink)
  2802  	// result: (MOVDload [off1+int32(off2)] {mergeSym(sym1,sym2)} ptr mem)
  2803  	for {
  2804  		off1 := auxIntToInt32(v.AuxInt)
  2805  		sym1 := auxToSym(v.Aux)
  2806  		if v_0.Op != OpLOONG64MOVVaddr {
  2807  			break
  2808  		}
  2809  		off2 := auxIntToInt32(v_0.AuxInt)
  2810  		sym2 := auxToSym(v_0.Aux)
  2811  		ptr := v_0.Args[0]
  2812  		mem := v_1
  2813  		if !(canMergeSym(sym1, sym2) && is32Bit(int64(off1)+int64(off2)) && (ptr.Op != OpSB || !config.ctxt.Flag_dynlink)) {
  2814  			break
  2815  		}
  2816  		v.reset(OpLOONG64MOVDload)
  2817  		v.AuxInt = int32ToAuxInt(off1 + int32(off2))
  2818  		v.Aux = symToAux(mergeSym(sym1, sym2))
  2819  		v.AddArg2(ptr, mem)
  2820  		return true
  2821  	}
  2822  	// match: (MOVDload [off] {sym} (ADDV ptr idx) mem)
  2823  	// cond: off == 0 && sym == nil
  2824  	// result: (MOVDloadidx ptr idx mem)
  2825  	for {
  2826  		off := auxIntToInt32(v.AuxInt)
  2827  		sym := auxToSym(v.Aux)
  2828  		if v_0.Op != OpLOONG64ADDV {
  2829  			break
  2830  		}
  2831  		idx := v_0.Args[1]
  2832  		ptr := v_0.Args[0]
  2833  		mem := v_1
  2834  		if !(off == 0 && sym == nil) {
  2835  			break
  2836  		}
  2837  		v.reset(OpLOONG64MOVDloadidx)
  2838  		v.AddArg3(ptr, idx, mem)
  2839  		return true
  2840  	}
  2841  	return false
  2842  }
  2843  func rewriteValueLOONG64_OpLOONG64MOVDloadidx(v *Value) bool {
  2844  	v_2 := v.Args[2]
  2845  	v_1 := v.Args[1]
  2846  	v_0 := v.Args[0]
  2847  	// match: (MOVDloadidx ptr (MOVVconst [c]) mem)
  2848  	// cond: is32Bit(c)
  2849  	// result: (MOVDload [int32(c)] ptr mem)
  2850  	for {
  2851  		ptr := v_0
  2852  		if v_1.Op != OpLOONG64MOVVconst {
  2853  			break
  2854  		}
  2855  		c := auxIntToInt64(v_1.AuxInt)
  2856  		mem := v_2
  2857  		if !(is32Bit(c)) {
  2858  			break
  2859  		}
  2860  		v.reset(OpLOONG64MOVDload)
  2861  		v.AuxInt = int32ToAuxInt(int32(c))
  2862  		v.AddArg2(ptr, mem)
  2863  		return true
  2864  	}
  2865  	// match: (MOVDloadidx (MOVVconst [c]) ptr mem)
  2866  	// cond: is32Bit(c)
  2867  	// result: (MOVDload [int32(c)] ptr mem)
  2868  	for {
  2869  		if v_0.Op != OpLOONG64MOVVconst {
  2870  			break
  2871  		}
  2872  		c := auxIntToInt64(v_0.AuxInt)
  2873  		ptr := v_1
  2874  		mem := v_2
  2875  		if !(is32Bit(c)) {
  2876  			break
  2877  		}
  2878  		v.reset(OpLOONG64MOVDload)
  2879  		v.AuxInt = int32ToAuxInt(int32(c))
  2880  		v.AddArg2(ptr, mem)
  2881  		return true
  2882  	}
  2883  	return false
  2884  }
  2885  func rewriteValueLOONG64_OpLOONG64MOVDstore(v *Value) bool {
  2886  	v_2 := v.Args[2]
  2887  	v_1 := v.Args[1]
  2888  	v_0 := v.Args[0]
  2889  	b := v.Block
  2890  	config := b.Func.Config
  2891  	// match: (MOVDstore [off] {sym} ptr (MOVVgpfp val) mem)
  2892  	// result: (MOVVstore [off] {sym} ptr val mem)
  2893  	for {
  2894  		off := auxIntToInt32(v.AuxInt)
  2895  		sym := auxToSym(v.Aux)
  2896  		ptr := v_0
  2897  		if v_1.Op != OpLOONG64MOVVgpfp {
  2898  			break
  2899  		}
  2900  		val := v_1.Args[0]
  2901  		mem := v_2
  2902  		v.reset(OpLOONG64MOVVstore)
  2903  		v.AuxInt = int32ToAuxInt(off)
  2904  		v.Aux = symToAux(sym)
  2905  		v.AddArg3(ptr, val, mem)
  2906  		return true
  2907  	}
  2908  	// match: (MOVDstore [off1] {sym} (ADDVconst [off2] ptr) val mem)
  2909  	// cond: is32Bit(int64(off1)+off2) && (ptr.Op != OpSB || !config.ctxt.Flag_dynlink)
  2910  	// result: (MOVDstore [off1+int32(off2)] {sym} ptr val mem)
  2911  	for {
  2912  		off1 := auxIntToInt32(v.AuxInt)
  2913  		sym := auxToSym(v.Aux)
  2914  		if v_0.Op != OpLOONG64ADDVconst {
  2915  			break
  2916  		}
  2917  		off2 := auxIntToInt64(v_0.AuxInt)
  2918  		ptr := v_0.Args[0]
  2919  		val := v_1
  2920  		mem := v_2
  2921  		if !(is32Bit(int64(off1)+off2) && (ptr.Op != OpSB || !config.ctxt.Flag_dynlink)) {
  2922  			break
  2923  		}
  2924  		v.reset(OpLOONG64MOVDstore)
  2925  		v.AuxInt = int32ToAuxInt(off1 + int32(off2))
  2926  		v.Aux = symToAux(sym)
  2927  		v.AddArg3(ptr, val, mem)
  2928  		return true
  2929  	}
  2930  	// match: (MOVDstore [off1] {sym1} (MOVVaddr [off2] {sym2} ptr) val mem)
  2931  	// cond: canMergeSym(sym1,sym2) && is32Bit(int64(off1)+int64(off2)) && (ptr.Op != OpSB || !config.ctxt.Flag_dynlink)
  2932  	// result: (MOVDstore [off1+int32(off2)] {mergeSym(sym1,sym2)} ptr val mem)
  2933  	for {
  2934  		off1 := auxIntToInt32(v.AuxInt)
  2935  		sym1 := auxToSym(v.Aux)
  2936  		if v_0.Op != OpLOONG64MOVVaddr {
  2937  			break
  2938  		}
  2939  		off2 := auxIntToInt32(v_0.AuxInt)
  2940  		sym2 := auxToSym(v_0.Aux)
  2941  		ptr := v_0.Args[0]
  2942  		val := v_1
  2943  		mem := v_2
  2944  		if !(canMergeSym(sym1, sym2) && is32Bit(int64(off1)+int64(off2)) && (ptr.Op != OpSB || !config.ctxt.Flag_dynlink)) {
  2945  			break
  2946  		}
  2947  		v.reset(OpLOONG64MOVDstore)
  2948  		v.AuxInt = int32ToAuxInt(off1 + int32(off2))
  2949  		v.Aux = symToAux(mergeSym(sym1, sym2))
  2950  		v.AddArg3(ptr, val, mem)
  2951  		return true
  2952  	}
  2953  	// match: (MOVDstore [off] {sym} (ADDV ptr idx) val mem)
  2954  	// cond: off == 0 && sym == nil
  2955  	// result: (MOVDstoreidx ptr idx val mem)
  2956  	for {
  2957  		off := auxIntToInt32(v.AuxInt)
  2958  		sym := auxToSym(v.Aux)
  2959  		if v_0.Op != OpLOONG64ADDV {
  2960  			break
  2961  		}
  2962  		idx := v_0.Args[1]
  2963  		ptr := v_0.Args[0]
  2964  		val := v_1
  2965  		mem := v_2
  2966  		if !(off == 0 && sym == nil) {
  2967  			break
  2968  		}
  2969  		v.reset(OpLOONG64MOVDstoreidx)
  2970  		v.AddArg4(ptr, idx, val, mem)
  2971  		return true
  2972  	}
  2973  	return false
  2974  }
  2975  func rewriteValueLOONG64_OpLOONG64MOVDstoreidx(v *Value) bool {
  2976  	v_3 := v.Args[3]
  2977  	v_2 := v.Args[2]
  2978  	v_1 := v.Args[1]
  2979  	v_0 := v.Args[0]
  2980  	// match: (MOVDstoreidx ptr (MOVVconst [c]) val mem)
  2981  	// cond: is32Bit(c)
  2982  	// result: (MOVDstore [int32(c)] ptr val mem)
  2983  	for {
  2984  		ptr := v_0
  2985  		if v_1.Op != OpLOONG64MOVVconst {
  2986  			break
  2987  		}
  2988  		c := auxIntToInt64(v_1.AuxInt)
  2989  		val := v_2
  2990  		mem := v_3
  2991  		if !(is32Bit(c)) {
  2992  			break
  2993  		}
  2994  		v.reset(OpLOONG64MOVDstore)
  2995  		v.AuxInt = int32ToAuxInt(int32(c))
  2996  		v.AddArg3(ptr, val, mem)
  2997  		return true
  2998  	}
  2999  	// match: (MOVDstoreidx (MOVVconst [c]) idx val mem)
  3000  	// cond: is32Bit(c)
  3001  	// result: (MOVDstore [int32(c)] idx val mem)
  3002  	for {
  3003  		if v_0.Op != OpLOONG64MOVVconst {
  3004  			break
  3005  		}
  3006  		c := auxIntToInt64(v_0.AuxInt)
  3007  		idx := v_1
  3008  		val := v_2
  3009  		mem := v_3
  3010  		if !(is32Bit(c)) {
  3011  			break
  3012  		}
  3013  		v.reset(OpLOONG64MOVDstore)
  3014  		v.AuxInt = int32ToAuxInt(int32(c))
  3015  		v.AddArg3(idx, val, mem)
  3016  		return true
  3017  	}
  3018  	return false
  3019  }
  3020  func rewriteValueLOONG64_OpLOONG64MOVFload(v *Value) bool {
  3021  	v_1 := v.Args[1]
  3022  	v_0 := v.Args[0]
  3023  	b := v.Block
  3024  	config := b.Func.Config
  3025  	// match: (MOVFload [off] {sym} ptr (MOVWstore [off] {sym} ptr val _))
  3026  	// result: (MOVWgpfp val)
  3027  	for {
  3028  		off := auxIntToInt32(v.AuxInt)
  3029  		sym := auxToSym(v.Aux)
  3030  		ptr := v_0
  3031  		if v_1.Op != OpLOONG64MOVWstore || auxIntToInt32(v_1.AuxInt) != off || auxToSym(v_1.Aux) != sym {
  3032  			break
  3033  		}
  3034  		val := v_1.Args[1]
  3035  		if ptr != v_1.Args[0] {
  3036  			break
  3037  		}
  3038  		v.reset(OpLOONG64MOVWgpfp)
  3039  		v.AddArg(val)
  3040  		return true
  3041  	}
  3042  	// match: (MOVFload [off1] {sym} (ADDVconst [off2] ptr) mem)
  3043  	// cond: is32Bit(int64(off1)+off2) && (ptr.Op != OpSB || !config.ctxt.Flag_dynlink)
  3044  	// result: (MOVFload [off1+int32(off2)] {sym} ptr mem)
  3045  	for {
  3046  		off1 := auxIntToInt32(v.AuxInt)
  3047  		sym := auxToSym(v.Aux)
  3048  		if v_0.Op != OpLOONG64ADDVconst {
  3049  			break
  3050  		}
  3051  		off2 := auxIntToInt64(v_0.AuxInt)
  3052  		ptr := v_0.Args[0]
  3053  		mem := v_1
  3054  		if !(is32Bit(int64(off1)+off2) && (ptr.Op != OpSB || !config.ctxt.Flag_dynlink)) {
  3055  			break
  3056  		}
  3057  		v.reset(OpLOONG64MOVFload)
  3058  		v.AuxInt = int32ToAuxInt(off1 + int32(off2))
  3059  		v.Aux = symToAux(sym)
  3060  		v.AddArg2(ptr, mem)
  3061  		return true
  3062  	}
  3063  	// match: (MOVFload [off1] {sym1} (MOVVaddr [off2] {sym2} ptr) mem)
  3064  	// cond: canMergeSym(sym1,sym2) && is32Bit(int64(off1)+int64(off2)) && (ptr.Op != OpSB || !config.ctxt.Flag_dynlink)
  3065  	// result: (MOVFload [off1+int32(off2)] {mergeSym(sym1,sym2)} ptr mem)
  3066  	for {
  3067  		off1 := auxIntToInt32(v.AuxInt)
  3068  		sym1 := auxToSym(v.Aux)
  3069  		if v_0.Op != OpLOONG64MOVVaddr {
  3070  			break
  3071  		}
  3072  		off2 := auxIntToInt32(v_0.AuxInt)
  3073  		sym2 := auxToSym(v_0.Aux)
  3074  		ptr := v_0.Args[0]
  3075  		mem := v_1
  3076  		if !(canMergeSym(sym1, sym2) && is32Bit(int64(off1)+int64(off2)) && (ptr.Op != OpSB || !config.ctxt.Flag_dynlink)) {
  3077  			break
  3078  		}
  3079  		v.reset(OpLOONG64MOVFload)
  3080  		v.AuxInt = int32ToAuxInt(off1 + int32(off2))
  3081  		v.Aux = symToAux(mergeSym(sym1, sym2))
  3082  		v.AddArg2(ptr, mem)
  3083  		return true
  3084  	}
  3085  	// match: (MOVFload [off] {sym} (ADDV ptr idx) mem)
  3086  	// cond: off == 0 && sym == nil
  3087  	// result: (MOVFloadidx ptr idx mem)
  3088  	for {
  3089  		off := auxIntToInt32(v.AuxInt)
  3090  		sym := auxToSym(v.Aux)
  3091  		if v_0.Op != OpLOONG64ADDV {
  3092  			break
  3093  		}
  3094  		idx := v_0.Args[1]
  3095  		ptr := v_0.Args[0]
  3096  		mem := v_1
  3097  		if !(off == 0 && sym == nil) {
  3098  			break
  3099  		}
  3100  		v.reset(OpLOONG64MOVFloadidx)
  3101  		v.AddArg3(ptr, idx, mem)
  3102  		return true
  3103  	}
  3104  	return false
  3105  }
  3106  func rewriteValueLOONG64_OpLOONG64MOVFloadidx(v *Value) bool {
  3107  	v_2 := v.Args[2]
  3108  	v_1 := v.Args[1]
  3109  	v_0 := v.Args[0]
  3110  	// match: (MOVFloadidx ptr (MOVVconst [c]) mem)
  3111  	// cond: is32Bit(c)
  3112  	// result: (MOVFload [int32(c)] ptr mem)
  3113  	for {
  3114  		ptr := v_0
  3115  		if v_1.Op != OpLOONG64MOVVconst {
  3116  			break
  3117  		}
  3118  		c := auxIntToInt64(v_1.AuxInt)
  3119  		mem := v_2
  3120  		if !(is32Bit(c)) {
  3121  			break
  3122  		}
  3123  		v.reset(OpLOONG64MOVFload)
  3124  		v.AuxInt = int32ToAuxInt(int32(c))
  3125  		v.AddArg2(ptr, mem)
  3126  		return true
  3127  	}
  3128  	// match: (MOVFloadidx (MOVVconst [c]) ptr mem)
  3129  	// cond: is32Bit(c)
  3130  	// result: (MOVFload [int32(c)] ptr mem)
  3131  	for {
  3132  		if v_0.Op != OpLOONG64MOVVconst {
  3133  			break
  3134  		}
  3135  		c := auxIntToInt64(v_0.AuxInt)
  3136  		ptr := v_1
  3137  		mem := v_2
  3138  		if !(is32Bit(c)) {
  3139  			break
  3140  		}
  3141  		v.reset(OpLOONG64MOVFload)
  3142  		v.AuxInt = int32ToAuxInt(int32(c))
  3143  		v.AddArg2(ptr, mem)
  3144  		return true
  3145  	}
  3146  	return false
  3147  }
  3148  func rewriteValueLOONG64_OpLOONG64MOVFstore(v *Value) bool {
  3149  	v_2 := v.Args[2]
  3150  	v_1 := v.Args[1]
  3151  	v_0 := v.Args[0]
  3152  	b := v.Block
  3153  	config := b.Func.Config
  3154  	// match: (MOVFstore [off] {sym} ptr (MOVWgpfp val) mem)
  3155  	// result: (MOVWstore [off] {sym} ptr val mem)
  3156  	for {
  3157  		off := auxIntToInt32(v.AuxInt)
  3158  		sym := auxToSym(v.Aux)
  3159  		ptr := v_0
  3160  		if v_1.Op != OpLOONG64MOVWgpfp {
  3161  			break
  3162  		}
  3163  		val := v_1.Args[0]
  3164  		mem := v_2
  3165  		v.reset(OpLOONG64MOVWstore)
  3166  		v.AuxInt = int32ToAuxInt(off)
  3167  		v.Aux = symToAux(sym)
  3168  		v.AddArg3(ptr, val, mem)
  3169  		return true
  3170  	}
  3171  	// match: (MOVFstore [off1] {sym} (ADDVconst [off2] ptr) val mem)
  3172  	// cond: is32Bit(int64(off1)+off2) && (ptr.Op != OpSB || !config.ctxt.Flag_dynlink)
  3173  	// result: (MOVFstore [off1+int32(off2)] {sym} ptr val mem)
  3174  	for {
  3175  		off1 := auxIntToInt32(v.AuxInt)
  3176  		sym := auxToSym(v.Aux)
  3177  		if v_0.Op != OpLOONG64ADDVconst {
  3178  			break
  3179  		}
  3180  		off2 := auxIntToInt64(v_0.AuxInt)
  3181  		ptr := v_0.Args[0]
  3182  		val := v_1
  3183  		mem := v_2
  3184  		if !(is32Bit(int64(off1)+off2) && (ptr.Op != OpSB || !config.ctxt.Flag_dynlink)) {
  3185  			break
  3186  		}
  3187  		v.reset(OpLOONG64MOVFstore)
  3188  		v.AuxInt = int32ToAuxInt(off1 + int32(off2))
  3189  		v.Aux = symToAux(sym)
  3190  		v.AddArg3(ptr, val, mem)
  3191  		return true
  3192  	}
  3193  	// match: (MOVFstore [off1] {sym1} (MOVVaddr [off2] {sym2} ptr) val mem)
  3194  	// cond: canMergeSym(sym1,sym2) && is32Bit(int64(off1)+int64(off2)) && (ptr.Op != OpSB || !config.ctxt.Flag_dynlink)
  3195  	// result: (MOVFstore [off1+int32(off2)] {mergeSym(sym1,sym2)} ptr val mem)
  3196  	for {
  3197  		off1 := auxIntToInt32(v.AuxInt)
  3198  		sym1 := auxToSym(v.Aux)
  3199  		if v_0.Op != OpLOONG64MOVVaddr {
  3200  			break
  3201  		}
  3202  		off2 := auxIntToInt32(v_0.AuxInt)
  3203  		sym2 := auxToSym(v_0.Aux)
  3204  		ptr := v_0.Args[0]
  3205  		val := v_1
  3206  		mem := v_2
  3207  		if !(canMergeSym(sym1, sym2) && is32Bit(int64(off1)+int64(off2)) && (ptr.Op != OpSB || !config.ctxt.Flag_dynlink)) {
  3208  			break
  3209  		}
  3210  		v.reset(OpLOONG64MOVFstore)
  3211  		v.AuxInt = int32ToAuxInt(off1 + int32(off2))
  3212  		v.Aux = symToAux(mergeSym(sym1, sym2))
  3213  		v.AddArg3(ptr, val, mem)
  3214  		return true
  3215  	}
  3216  	// match: (MOVFstore [off] {sym} (ADDV ptr idx) val mem)
  3217  	// cond: off == 0 && sym == nil
  3218  	// result: (MOVFstoreidx ptr idx val mem)
  3219  	for {
  3220  		off := auxIntToInt32(v.AuxInt)
  3221  		sym := auxToSym(v.Aux)
  3222  		if v_0.Op != OpLOONG64ADDV {
  3223  			break
  3224  		}
  3225  		idx := v_0.Args[1]
  3226  		ptr := v_0.Args[0]
  3227  		val := v_1
  3228  		mem := v_2
  3229  		if !(off == 0 && sym == nil) {
  3230  			break
  3231  		}
  3232  		v.reset(OpLOONG64MOVFstoreidx)
  3233  		v.AddArg4(ptr, idx, val, mem)
  3234  		return true
  3235  	}
  3236  	return false
  3237  }
  3238  func rewriteValueLOONG64_OpLOONG64MOVFstoreidx(v *Value) bool {
  3239  	v_3 := v.Args[3]
  3240  	v_2 := v.Args[2]
  3241  	v_1 := v.Args[1]
  3242  	v_0 := v.Args[0]
  3243  	// match: (MOVFstoreidx ptr (MOVVconst [c]) val mem)
  3244  	// cond: is32Bit(c)
  3245  	// result: (MOVFstore [int32(c)] ptr val mem)
  3246  	for {
  3247  		ptr := v_0
  3248  		if v_1.Op != OpLOONG64MOVVconst {
  3249  			break
  3250  		}
  3251  		c := auxIntToInt64(v_1.AuxInt)
  3252  		val := v_2
  3253  		mem := v_3
  3254  		if !(is32Bit(c)) {
  3255  			break
  3256  		}
  3257  		v.reset(OpLOONG64MOVFstore)
  3258  		v.AuxInt = int32ToAuxInt(int32(c))
  3259  		v.AddArg3(ptr, val, mem)
  3260  		return true
  3261  	}
  3262  	// match: (MOVFstoreidx (MOVVconst [c]) idx val mem)
  3263  	// cond: is32Bit(c)
  3264  	// result: (MOVFstore [int32(c)] idx val mem)
  3265  	for {
  3266  		if v_0.Op != OpLOONG64MOVVconst {
  3267  			break
  3268  		}
  3269  		c := auxIntToInt64(v_0.AuxInt)
  3270  		idx := v_1
  3271  		val := v_2
  3272  		mem := v_3
  3273  		if !(is32Bit(c)) {
  3274  			break
  3275  		}
  3276  		v.reset(OpLOONG64MOVFstore)
  3277  		v.AuxInt = int32ToAuxInt(int32(c))
  3278  		v.AddArg3(idx, val, mem)
  3279  		return true
  3280  	}
  3281  	return false
  3282  }
  3283  func rewriteValueLOONG64_OpLOONG64MOVHUload(v *Value) bool {
  3284  	v_1 := v.Args[1]
  3285  	v_0 := v.Args[0]
  3286  	b := v.Block
  3287  	config := b.Func.Config
  3288  	// match: (MOVHUload [off1] {sym} (ADDVconst [off2] ptr) mem)
  3289  	// cond: is32Bit(int64(off1)+off2) && (ptr.Op != OpSB || !config.ctxt.Flag_dynlink)
  3290  	// result: (MOVHUload [off1+int32(off2)] {sym} ptr mem)
  3291  	for {
  3292  		off1 := auxIntToInt32(v.AuxInt)
  3293  		sym := auxToSym(v.Aux)
  3294  		if v_0.Op != OpLOONG64ADDVconst {
  3295  			break
  3296  		}
  3297  		off2 := auxIntToInt64(v_0.AuxInt)
  3298  		ptr := v_0.Args[0]
  3299  		mem := v_1
  3300  		if !(is32Bit(int64(off1)+off2) && (ptr.Op != OpSB || !config.ctxt.Flag_dynlink)) {
  3301  			break
  3302  		}
  3303  		v.reset(OpLOONG64MOVHUload)
  3304  		v.AuxInt = int32ToAuxInt(off1 + int32(off2))
  3305  		v.Aux = symToAux(sym)
  3306  		v.AddArg2(ptr, mem)
  3307  		return true
  3308  	}
  3309  	// match: (MOVHUload [off1] {sym1} (MOVVaddr [off2] {sym2} ptr) mem)
  3310  	// cond: canMergeSym(sym1,sym2) && is32Bit(int64(off1)+int64(off2)) && (ptr.Op != OpSB || !config.ctxt.Flag_dynlink)
  3311  	// result: (MOVHUload [off1+int32(off2)] {mergeSym(sym1,sym2)} ptr mem)
  3312  	for {
  3313  		off1 := auxIntToInt32(v.AuxInt)
  3314  		sym1 := auxToSym(v.Aux)
  3315  		if v_0.Op != OpLOONG64MOVVaddr {
  3316  			break
  3317  		}
  3318  		off2 := auxIntToInt32(v_0.AuxInt)
  3319  		sym2 := auxToSym(v_0.Aux)
  3320  		ptr := v_0.Args[0]
  3321  		mem := v_1
  3322  		if !(canMergeSym(sym1, sym2) && is32Bit(int64(off1)+int64(off2)) && (ptr.Op != OpSB || !config.ctxt.Flag_dynlink)) {
  3323  			break
  3324  		}
  3325  		v.reset(OpLOONG64MOVHUload)
  3326  		v.AuxInt = int32ToAuxInt(off1 + int32(off2))
  3327  		v.Aux = symToAux(mergeSym(sym1, sym2))
  3328  		v.AddArg2(ptr, mem)
  3329  		return true
  3330  	}
  3331  	// match: (MOVHUload [off] {sym} (ADDV ptr idx) mem)
  3332  	// cond: off == 0 && sym == nil
  3333  	// result: (MOVHUloadidx ptr idx mem)
  3334  	for {
  3335  		off := auxIntToInt32(v.AuxInt)
  3336  		sym := auxToSym(v.Aux)
  3337  		if v_0.Op != OpLOONG64ADDV {
  3338  			break
  3339  		}
  3340  		idx := v_0.Args[1]
  3341  		ptr := v_0.Args[0]
  3342  		mem := v_1
  3343  		if !(off == 0 && sym == nil) {
  3344  			break
  3345  		}
  3346  		v.reset(OpLOONG64MOVHUloadidx)
  3347  		v.AddArg3(ptr, idx, mem)
  3348  		return true
  3349  	}
  3350  	return false
  3351  }
  3352  func rewriteValueLOONG64_OpLOONG64MOVHUloadidx(v *Value) bool {
  3353  	v_2 := v.Args[2]
  3354  	v_1 := v.Args[1]
  3355  	v_0 := v.Args[0]
  3356  	// match: (MOVHUloadidx ptr (MOVVconst [c]) mem)
  3357  	// cond: is32Bit(c)
  3358  	// result: (MOVHUload [int32(c)] ptr mem)
  3359  	for {
  3360  		ptr := v_0
  3361  		if v_1.Op != OpLOONG64MOVVconst {
  3362  			break
  3363  		}
  3364  		c := auxIntToInt64(v_1.AuxInt)
  3365  		mem := v_2
  3366  		if !(is32Bit(c)) {
  3367  			break
  3368  		}
  3369  		v.reset(OpLOONG64MOVHUload)
  3370  		v.AuxInt = int32ToAuxInt(int32(c))
  3371  		v.AddArg2(ptr, mem)
  3372  		return true
  3373  	}
  3374  	// match: (MOVHUloadidx (MOVVconst [c]) ptr mem)
  3375  	// cond: is32Bit(c)
  3376  	// result: (MOVHUload [int32(c)] ptr mem)
  3377  	for {
  3378  		if v_0.Op != OpLOONG64MOVVconst {
  3379  			break
  3380  		}
  3381  		c := auxIntToInt64(v_0.AuxInt)
  3382  		ptr := v_1
  3383  		mem := v_2
  3384  		if !(is32Bit(c)) {
  3385  			break
  3386  		}
  3387  		v.reset(OpLOONG64MOVHUload)
  3388  		v.AuxInt = int32ToAuxInt(int32(c))
  3389  		v.AddArg2(ptr, mem)
  3390  		return true
  3391  	}
  3392  	return false
  3393  }
  3394  func rewriteValueLOONG64_OpLOONG64MOVHUreg(v *Value) bool {
  3395  	v_0 := v.Args[0]
  3396  	// match: (MOVHUreg (SRLVconst [rc] x))
  3397  	// cond: rc < 16
  3398  	// result: (BSTRPICKV [rc + (15+rc)<<6] x)
  3399  	for {
  3400  		if v_0.Op != OpLOONG64SRLVconst {
  3401  			break
  3402  		}
  3403  		rc := auxIntToInt64(v_0.AuxInt)
  3404  		x := v_0.Args[0]
  3405  		if !(rc < 16) {
  3406  			break
  3407  		}
  3408  		v.reset(OpLOONG64BSTRPICKV)
  3409  		v.AuxInt = int64ToAuxInt(rc + (15+rc)<<6)
  3410  		v.AddArg(x)
  3411  		return true
  3412  	}
  3413  	// match: (MOVHUreg x:(MOVBUload _ _))
  3414  	// result: (MOVVreg x)
  3415  	for {
  3416  		x := v_0
  3417  		if x.Op != OpLOONG64MOVBUload {
  3418  			break
  3419  		}
  3420  		v.reset(OpLOONG64MOVVreg)
  3421  		v.AddArg(x)
  3422  		return true
  3423  	}
  3424  	// match: (MOVHUreg x:(MOVHUload _ _))
  3425  	// result: (MOVVreg x)
  3426  	for {
  3427  		x := v_0
  3428  		if x.Op != OpLOONG64MOVHUload {
  3429  			break
  3430  		}
  3431  		v.reset(OpLOONG64MOVVreg)
  3432  		v.AddArg(x)
  3433  		return true
  3434  	}
  3435  	// match: (MOVHUreg x:(MOVBUreg _))
  3436  	// result: (MOVVreg x)
  3437  	for {
  3438  		x := v_0
  3439  		if x.Op != OpLOONG64MOVBUreg {
  3440  			break
  3441  		}
  3442  		v.reset(OpLOONG64MOVVreg)
  3443  		v.AddArg(x)
  3444  		return true
  3445  	}
  3446  	// match: (MOVHUreg x:(MOVHUreg _))
  3447  	// result: (MOVVreg x)
  3448  	for {
  3449  		x := v_0
  3450  		if x.Op != OpLOONG64MOVHUreg {
  3451  			break
  3452  		}
  3453  		v.reset(OpLOONG64MOVVreg)
  3454  		v.AddArg(x)
  3455  		return true
  3456  	}
  3457  	// match: (MOVHUreg (SLLVconst [lc] x))
  3458  	// cond: lc >= 16
  3459  	// result: (MOVVconst [0])
  3460  	for {
  3461  		if v_0.Op != OpLOONG64SLLVconst {
  3462  			break
  3463  		}
  3464  		lc := auxIntToInt64(v_0.AuxInt)
  3465  		if !(lc >= 16) {
  3466  			break
  3467  		}
  3468  		v.reset(OpLOONG64MOVVconst)
  3469  		v.AuxInt = int64ToAuxInt(0)
  3470  		return true
  3471  	}
  3472  	// match: (MOVHUreg (MOVVconst [c]))
  3473  	// result: (MOVVconst [int64(uint16(c))])
  3474  	for {
  3475  		if v_0.Op != OpLOONG64MOVVconst {
  3476  			break
  3477  		}
  3478  		c := auxIntToInt64(v_0.AuxInt)
  3479  		v.reset(OpLOONG64MOVVconst)
  3480  		v.AuxInt = int64ToAuxInt(int64(uint16(c)))
  3481  		return true
  3482  	}
  3483  	return false
  3484  }
  3485  func rewriteValueLOONG64_OpLOONG64MOVHload(v *Value) bool {
  3486  	v_1 := v.Args[1]
  3487  	v_0 := v.Args[0]
  3488  	b := v.Block
  3489  	config := b.Func.Config
  3490  	// match: (MOVHload [off1] {sym} (ADDVconst [off2] ptr) mem)
  3491  	// cond: is32Bit(int64(off1)+off2) && (ptr.Op != OpSB || !config.ctxt.Flag_dynlink)
  3492  	// result: (MOVHload [off1+int32(off2)] {sym} ptr mem)
  3493  	for {
  3494  		off1 := auxIntToInt32(v.AuxInt)
  3495  		sym := auxToSym(v.Aux)
  3496  		if v_0.Op != OpLOONG64ADDVconst {
  3497  			break
  3498  		}
  3499  		off2 := auxIntToInt64(v_0.AuxInt)
  3500  		ptr := v_0.Args[0]
  3501  		mem := v_1
  3502  		if !(is32Bit(int64(off1)+off2) && (ptr.Op != OpSB || !config.ctxt.Flag_dynlink)) {
  3503  			break
  3504  		}
  3505  		v.reset(OpLOONG64MOVHload)
  3506  		v.AuxInt = int32ToAuxInt(off1 + int32(off2))
  3507  		v.Aux = symToAux(sym)
  3508  		v.AddArg2(ptr, mem)
  3509  		return true
  3510  	}
  3511  	// match: (MOVHload [off1] {sym1} (MOVVaddr [off2] {sym2} ptr) mem)
  3512  	// cond: canMergeSym(sym1,sym2) && is32Bit(int64(off1)+int64(off2)) && (ptr.Op != OpSB || !config.ctxt.Flag_dynlink)
  3513  	// result: (MOVHload [off1+int32(off2)] {mergeSym(sym1,sym2)} ptr mem)
  3514  	for {
  3515  		off1 := auxIntToInt32(v.AuxInt)
  3516  		sym1 := auxToSym(v.Aux)
  3517  		if v_0.Op != OpLOONG64MOVVaddr {
  3518  			break
  3519  		}
  3520  		off2 := auxIntToInt32(v_0.AuxInt)
  3521  		sym2 := auxToSym(v_0.Aux)
  3522  		ptr := v_0.Args[0]
  3523  		mem := v_1
  3524  		if !(canMergeSym(sym1, sym2) && is32Bit(int64(off1)+int64(off2)) && (ptr.Op != OpSB || !config.ctxt.Flag_dynlink)) {
  3525  			break
  3526  		}
  3527  		v.reset(OpLOONG64MOVHload)
  3528  		v.AuxInt = int32ToAuxInt(off1 + int32(off2))
  3529  		v.Aux = symToAux(mergeSym(sym1, sym2))
  3530  		v.AddArg2(ptr, mem)
  3531  		return true
  3532  	}
  3533  	// match: (MOVHload [off] {sym} (ADDV ptr idx) mem)
  3534  	// cond: off == 0 && sym == nil
  3535  	// result: (MOVHloadidx ptr idx mem)
  3536  	for {
  3537  		off := auxIntToInt32(v.AuxInt)
  3538  		sym := auxToSym(v.Aux)
  3539  		if v_0.Op != OpLOONG64ADDV {
  3540  			break
  3541  		}
  3542  		idx := v_0.Args[1]
  3543  		ptr := v_0.Args[0]
  3544  		mem := v_1
  3545  		if !(off == 0 && sym == nil) {
  3546  			break
  3547  		}
  3548  		v.reset(OpLOONG64MOVHloadidx)
  3549  		v.AddArg3(ptr, idx, mem)
  3550  		return true
  3551  	}
  3552  	return false
  3553  }
  3554  func rewriteValueLOONG64_OpLOONG64MOVHloadidx(v *Value) bool {
  3555  	v_2 := v.Args[2]
  3556  	v_1 := v.Args[1]
  3557  	v_0 := v.Args[0]
  3558  	// match: (MOVHloadidx ptr (MOVVconst [c]) mem)
  3559  	// cond: is32Bit(c)
  3560  	// result: (MOVHload [int32(c)] ptr mem)
  3561  	for {
  3562  		ptr := v_0
  3563  		if v_1.Op != OpLOONG64MOVVconst {
  3564  			break
  3565  		}
  3566  		c := auxIntToInt64(v_1.AuxInt)
  3567  		mem := v_2
  3568  		if !(is32Bit(c)) {
  3569  			break
  3570  		}
  3571  		v.reset(OpLOONG64MOVHload)
  3572  		v.AuxInt = int32ToAuxInt(int32(c))
  3573  		v.AddArg2(ptr, mem)
  3574  		return true
  3575  	}
  3576  	// match: (MOVHloadidx (MOVVconst [c]) ptr mem)
  3577  	// cond: is32Bit(c)
  3578  	// result: (MOVHload [int32(c)] ptr mem)
  3579  	for {
  3580  		if v_0.Op != OpLOONG64MOVVconst {
  3581  			break
  3582  		}
  3583  		c := auxIntToInt64(v_0.AuxInt)
  3584  		ptr := v_1
  3585  		mem := v_2
  3586  		if !(is32Bit(c)) {
  3587  			break
  3588  		}
  3589  		v.reset(OpLOONG64MOVHload)
  3590  		v.AuxInt = int32ToAuxInt(int32(c))
  3591  		v.AddArg2(ptr, mem)
  3592  		return true
  3593  	}
  3594  	return false
  3595  }
  3596  func rewriteValueLOONG64_OpLOONG64MOVHreg(v *Value) bool {
  3597  	v_0 := v.Args[0]
  3598  	// match: (MOVHreg x:(MOVBload _ _))
  3599  	// result: (MOVVreg x)
  3600  	for {
  3601  		x := v_0
  3602  		if x.Op != OpLOONG64MOVBload {
  3603  			break
  3604  		}
  3605  		v.reset(OpLOONG64MOVVreg)
  3606  		v.AddArg(x)
  3607  		return true
  3608  	}
  3609  	// match: (MOVHreg x:(MOVBUload _ _))
  3610  	// result: (MOVVreg x)
  3611  	for {
  3612  		x := v_0
  3613  		if x.Op != OpLOONG64MOVBUload {
  3614  			break
  3615  		}
  3616  		v.reset(OpLOONG64MOVVreg)
  3617  		v.AddArg(x)
  3618  		return true
  3619  	}
  3620  	// match: (MOVHreg x:(MOVHload _ _))
  3621  	// result: (MOVVreg x)
  3622  	for {
  3623  		x := v_0
  3624  		if x.Op != OpLOONG64MOVHload {
  3625  			break
  3626  		}
  3627  		v.reset(OpLOONG64MOVVreg)
  3628  		v.AddArg(x)
  3629  		return true
  3630  	}
  3631  	// match: (MOVHreg x:(MOVBreg _))
  3632  	// result: (MOVVreg x)
  3633  	for {
  3634  		x := v_0
  3635  		if x.Op != OpLOONG64MOVBreg {
  3636  			break
  3637  		}
  3638  		v.reset(OpLOONG64MOVVreg)
  3639  		v.AddArg(x)
  3640  		return true
  3641  	}
  3642  	// match: (MOVHreg x:(MOVBUreg _))
  3643  	// result: (MOVVreg x)
  3644  	for {
  3645  		x := v_0
  3646  		if x.Op != OpLOONG64MOVBUreg {
  3647  			break
  3648  		}
  3649  		v.reset(OpLOONG64MOVVreg)
  3650  		v.AddArg(x)
  3651  		return true
  3652  	}
  3653  	// match: (MOVHreg x:(MOVHreg _))
  3654  	// result: (MOVVreg x)
  3655  	for {
  3656  		x := v_0
  3657  		if x.Op != OpLOONG64MOVHreg {
  3658  			break
  3659  		}
  3660  		v.reset(OpLOONG64MOVVreg)
  3661  		v.AddArg(x)
  3662  		return true
  3663  	}
  3664  	// match: (MOVHreg (MOVVconst [c]))
  3665  	// result: (MOVVconst [int64(int16(c))])
  3666  	for {
  3667  		if v_0.Op != OpLOONG64MOVVconst {
  3668  			break
  3669  		}
  3670  		c := auxIntToInt64(v_0.AuxInt)
  3671  		v.reset(OpLOONG64MOVVconst)
  3672  		v.AuxInt = int64ToAuxInt(int64(int16(c)))
  3673  		return true
  3674  	}
  3675  	return false
  3676  }
  3677  func rewriteValueLOONG64_OpLOONG64MOVHstore(v *Value) bool {
  3678  	v_2 := v.Args[2]
  3679  	v_1 := v.Args[1]
  3680  	v_0 := v.Args[0]
  3681  	b := v.Block
  3682  	config := b.Func.Config
  3683  	// match: (MOVHstore [off1] {sym} (ADDVconst [off2] ptr) val mem)
  3684  	// cond: is32Bit(int64(off1)+off2) && (ptr.Op != OpSB || !config.ctxt.Flag_dynlink)
  3685  	// result: (MOVHstore [off1+int32(off2)] {sym} ptr val mem)
  3686  	for {
  3687  		off1 := auxIntToInt32(v.AuxInt)
  3688  		sym := auxToSym(v.Aux)
  3689  		if v_0.Op != OpLOONG64ADDVconst {
  3690  			break
  3691  		}
  3692  		off2 := auxIntToInt64(v_0.AuxInt)
  3693  		ptr := v_0.Args[0]
  3694  		val := v_1
  3695  		mem := v_2
  3696  		if !(is32Bit(int64(off1)+off2) && (ptr.Op != OpSB || !config.ctxt.Flag_dynlink)) {
  3697  			break
  3698  		}
  3699  		v.reset(OpLOONG64MOVHstore)
  3700  		v.AuxInt = int32ToAuxInt(off1 + int32(off2))
  3701  		v.Aux = symToAux(sym)
  3702  		v.AddArg3(ptr, val, mem)
  3703  		return true
  3704  	}
  3705  	// match: (MOVHstore [off1] {sym1} (MOVVaddr [off2] {sym2} ptr) val mem)
  3706  	// cond: canMergeSym(sym1,sym2) && is32Bit(int64(off1)+int64(off2)) && (ptr.Op != OpSB || !config.ctxt.Flag_dynlink)
  3707  	// result: (MOVHstore [off1+int32(off2)] {mergeSym(sym1,sym2)} ptr val mem)
  3708  	for {
  3709  		off1 := auxIntToInt32(v.AuxInt)
  3710  		sym1 := auxToSym(v.Aux)
  3711  		if v_0.Op != OpLOONG64MOVVaddr {
  3712  			break
  3713  		}
  3714  		off2 := auxIntToInt32(v_0.AuxInt)
  3715  		sym2 := auxToSym(v_0.Aux)
  3716  		ptr := v_0.Args[0]
  3717  		val := v_1
  3718  		mem := v_2
  3719  		if !(canMergeSym(sym1, sym2) && is32Bit(int64(off1)+int64(off2)) && (ptr.Op != OpSB || !config.ctxt.Flag_dynlink)) {
  3720  			break
  3721  		}
  3722  		v.reset(OpLOONG64MOVHstore)
  3723  		v.AuxInt = int32ToAuxInt(off1 + int32(off2))
  3724  		v.Aux = symToAux(mergeSym(sym1, sym2))
  3725  		v.AddArg3(ptr, val, mem)
  3726  		return true
  3727  	}
  3728  	// match: (MOVHstore [off] {sym} ptr (MOVHreg x) mem)
  3729  	// result: (MOVHstore [off] {sym} ptr x mem)
  3730  	for {
  3731  		off := auxIntToInt32(v.AuxInt)
  3732  		sym := auxToSym(v.Aux)
  3733  		ptr := v_0
  3734  		if v_1.Op != OpLOONG64MOVHreg {
  3735  			break
  3736  		}
  3737  		x := v_1.Args[0]
  3738  		mem := v_2
  3739  		v.reset(OpLOONG64MOVHstore)
  3740  		v.AuxInt = int32ToAuxInt(off)
  3741  		v.Aux = symToAux(sym)
  3742  		v.AddArg3(ptr, x, mem)
  3743  		return true
  3744  	}
  3745  	// match: (MOVHstore [off] {sym} ptr (MOVHUreg x) mem)
  3746  	// result: (MOVHstore [off] {sym} ptr x mem)
  3747  	for {
  3748  		off := auxIntToInt32(v.AuxInt)
  3749  		sym := auxToSym(v.Aux)
  3750  		ptr := v_0
  3751  		if v_1.Op != OpLOONG64MOVHUreg {
  3752  			break
  3753  		}
  3754  		x := v_1.Args[0]
  3755  		mem := v_2
  3756  		v.reset(OpLOONG64MOVHstore)
  3757  		v.AuxInt = int32ToAuxInt(off)
  3758  		v.Aux = symToAux(sym)
  3759  		v.AddArg3(ptr, x, mem)
  3760  		return true
  3761  	}
  3762  	// match: (MOVHstore [off] {sym} ptr (MOVWreg x) mem)
  3763  	// result: (MOVHstore [off] {sym} ptr x mem)
  3764  	for {
  3765  		off := auxIntToInt32(v.AuxInt)
  3766  		sym := auxToSym(v.Aux)
  3767  		ptr := v_0
  3768  		if v_1.Op != OpLOONG64MOVWreg {
  3769  			break
  3770  		}
  3771  		x := v_1.Args[0]
  3772  		mem := v_2
  3773  		v.reset(OpLOONG64MOVHstore)
  3774  		v.AuxInt = int32ToAuxInt(off)
  3775  		v.Aux = symToAux(sym)
  3776  		v.AddArg3(ptr, x, mem)
  3777  		return true
  3778  	}
  3779  	// match: (MOVHstore [off] {sym} ptr (MOVWUreg x) mem)
  3780  	// result: (MOVHstore [off] {sym} ptr x mem)
  3781  	for {
  3782  		off := auxIntToInt32(v.AuxInt)
  3783  		sym := auxToSym(v.Aux)
  3784  		ptr := v_0
  3785  		if v_1.Op != OpLOONG64MOVWUreg {
  3786  			break
  3787  		}
  3788  		x := v_1.Args[0]
  3789  		mem := v_2
  3790  		v.reset(OpLOONG64MOVHstore)
  3791  		v.AuxInt = int32ToAuxInt(off)
  3792  		v.Aux = symToAux(sym)
  3793  		v.AddArg3(ptr, x, mem)
  3794  		return true
  3795  	}
  3796  	// match: (MOVHstore [off] {sym} ptr (MOVVconst [0]) mem)
  3797  	// result: (MOVHstorezero [off] {sym} ptr mem)
  3798  	for {
  3799  		off := auxIntToInt32(v.AuxInt)
  3800  		sym := auxToSym(v.Aux)
  3801  		ptr := v_0
  3802  		if v_1.Op != OpLOONG64MOVVconst || auxIntToInt64(v_1.AuxInt) != 0 {
  3803  			break
  3804  		}
  3805  		mem := v_2
  3806  		v.reset(OpLOONG64MOVHstorezero)
  3807  		v.AuxInt = int32ToAuxInt(off)
  3808  		v.Aux = symToAux(sym)
  3809  		v.AddArg2(ptr, mem)
  3810  		return true
  3811  	}
  3812  	// match: (MOVHstore [off] {sym} (ADDV ptr idx) val mem)
  3813  	// cond: off == 0 && sym == nil
  3814  	// result: (MOVHstoreidx ptr idx val mem)
  3815  	for {
  3816  		off := auxIntToInt32(v.AuxInt)
  3817  		sym := auxToSym(v.Aux)
  3818  		if v_0.Op != OpLOONG64ADDV {
  3819  			break
  3820  		}
  3821  		idx := v_0.Args[1]
  3822  		ptr := v_0.Args[0]
  3823  		val := v_1
  3824  		mem := v_2
  3825  		if !(off == 0 && sym == nil) {
  3826  			break
  3827  		}
  3828  		v.reset(OpLOONG64MOVHstoreidx)
  3829  		v.AddArg4(ptr, idx, val, mem)
  3830  		return true
  3831  	}
  3832  	return false
  3833  }
  3834  func rewriteValueLOONG64_OpLOONG64MOVHstoreidx(v *Value) bool {
  3835  	v_3 := v.Args[3]
  3836  	v_2 := v.Args[2]
  3837  	v_1 := v.Args[1]
  3838  	v_0 := v.Args[0]
  3839  	// match: (MOVHstoreidx ptr (MOVVconst [c]) val mem)
  3840  	// cond: is32Bit(c)
  3841  	// result: (MOVHstore [int32(c)] ptr val mem)
  3842  	for {
  3843  		ptr := v_0
  3844  		if v_1.Op != OpLOONG64MOVVconst {
  3845  			break
  3846  		}
  3847  		c := auxIntToInt64(v_1.AuxInt)
  3848  		val := v_2
  3849  		mem := v_3
  3850  		if !(is32Bit(c)) {
  3851  			break
  3852  		}
  3853  		v.reset(OpLOONG64MOVHstore)
  3854  		v.AuxInt = int32ToAuxInt(int32(c))
  3855  		v.AddArg3(ptr, val, mem)
  3856  		return true
  3857  	}
  3858  	// match: (MOVHstoreidx (MOVVconst [c]) idx val mem)
  3859  	// cond: is32Bit(c)
  3860  	// result: (MOVHstore [int32(c)] idx val mem)
  3861  	for {
  3862  		if v_0.Op != OpLOONG64MOVVconst {
  3863  			break
  3864  		}
  3865  		c := auxIntToInt64(v_0.AuxInt)
  3866  		idx := v_1
  3867  		val := v_2
  3868  		mem := v_3
  3869  		if !(is32Bit(c)) {
  3870  			break
  3871  		}
  3872  		v.reset(OpLOONG64MOVHstore)
  3873  		v.AuxInt = int32ToAuxInt(int32(c))
  3874  		v.AddArg3(idx, val, mem)
  3875  		return true
  3876  	}
  3877  	// match: (MOVHstoreidx ptr idx (MOVVconst [0]) mem)
  3878  	// result: (MOVHstorezeroidx ptr idx mem)
  3879  	for {
  3880  		ptr := v_0
  3881  		idx := v_1
  3882  		if v_2.Op != OpLOONG64MOVVconst || auxIntToInt64(v_2.AuxInt) != 0 {
  3883  			break
  3884  		}
  3885  		mem := v_3
  3886  		v.reset(OpLOONG64MOVHstorezeroidx)
  3887  		v.AddArg3(ptr, idx, mem)
  3888  		return true
  3889  	}
  3890  	return false
  3891  }
  3892  func rewriteValueLOONG64_OpLOONG64MOVHstorezero(v *Value) bool {
  3893  	v_1 := v.Args[1]
  3894  	v_0 := v.Args[0]
  3895  	b := v.Block
  3896  	config := b.Func.Config
  3897  	// match: (MOVHstorezero [off1] {sym} (ADDVconst [off2] ptr) mem)
  3898  	// cond: is32Bit(int64(off1)+off2) && (ptr.Op != OpSB || !config.ctxt.Flag_dynlink)
  3899  	// result: (MOVHstorezero [off1+int32(off2)] {sym} ptr mem)
  3900  	for {
  3901  		off1 := auxIntToInt32(v.AuxInt)
  3902  		sym := auxToSym(v.Aux)
  3903  		if v_0.Op != OpLOONG64ADDVconst {
  3904  			break
  3905  		}
  3906  		off2 := auxIntToInt64(v_0.AuxInt)
  3907  		ptr := v_0.Args[0]
  3908  		mem := v_1
  3909  		if !(is32Bit(int64(off1)+off2) && (ptr.Op != OpSB || !config.ctxt.Flag_dynlink)) {
  3910  			break
  3911  		}
  3912  		v.reset(OpLOONG64MOVHstorezero)
  3913  		v.AuxInt = int32ToAuxInt(off1 + int32(off2))
  3914  		v.Aux = symToAux(sym)
  3915  		v.AddArg2(ptr, mem)
  3916  		return true
  3917  	}
  3918  	// match: (MOVHstorezero [off1] {sym1} (MOVVaddr [off2] {sym2} ptr) mem)
  3919  	// cond: canMergeSym(sym1,sym2) && is32Bit(int64(off1)+int64(off2)) && (ptr.Op != OpSB || !config.ctxt.Flag_dynlink)
  3920  	// result: (MOVHstorezero [off1+int32(off2)] {mergeSym(sym1,sym2)} ptr mem)
  3921  	for {
  3922  		off1 := auxIntToInt32(v.AuxInt)
  3923  		sym1 := auxToSym(v.Aux)
  3924  		if v_0.Op != OpLOONG64MOVVaddr {
  3925  			break
  3926  		}
  3927  		off2 := auxIntToInt32(v_0.AuxInt)
  3928  		sym2 := auxToSym(v_0.Aux)
  3929  		ptr := v_0.Args[0]
  3930  		mem := v_1
  3931  		if !(canMergeSym(sym1, sym2) && is32Bit(int64(off1)+int64(off2)) && (ptr.Op != OpSB || !config.ctxt.Flag_dynlink)) {
  3932  			break
  3933  		}
  3934  		v.reset(OpLOONG64MOVHstorezero)
  3935  		v.AuxInt = int32ToAuxInt(off1 + int32(off2))
  3936  		v.Aux = symToAux(mergeSym(sym1, sym2))
  3937  		v.AddArg2(ptr, mem)
  3938  		return true
  3939  	}
  3940  	// match: (MOVHstorezero [off] {sym} (ADDV ptr idx) mem)
  3941  	// cond: off == 0 && sym == nil
  3942  	// result: (MOVHstorezeroidx ptr idx mem)
  3943  	for {
  3944  		off := auxIntToInt32(v.AuxInt)
  3945  		sym := auxToSym(v.Aux)
  3946  		if v_0.Op != OpLOONG64ADDV {
  3947  			break
  3948  		}
  3949  		idx := v_0.Args[1]
  3950  		ptr := v_0.Args[0]
  3951  		mem := v_1
  3952  		if !(off == 0 && sym == nil) {
  3953  			break
  3954  		}
  3955  		v.reset(OpLOONG64MOVHstorezeroidx)
  3956  		v.AddArg3(ptr, idx, mem)
  3957  		return true
  3958  	}
  3959  	return false
  3960  }
  3961  func rewriteValueLOONG64_OpLOONG64MOVHstorezeroidx(v *Value) bool {
  3962  	v_2 := v.Args[2]
  3963  	v_1 := v.Args[1]
  3964  	v_0 := v.Args[0]
  3965  	// match: (MOVHstorezeroidx ptr (MOVVconst [c]) mem)
  3966  	// cond: is32Bit(c)
  3967  	// result: (MOVHstorezero [int32(c)] ptr mem)
  3968  	for {
  3969  		ptr := v_0
  3970  		if v_1.Op != OpLOONG64MOVVconst {
  3971  			break
  3972  		}
  3973  		c := auxIntToInt64(v_1.AuxInt)
  3974  		mem := v_2
  3975  		if !(is32Bit(c)) {
  3976  			break
  3977  		}
  3978  		v.reset(OpLOONG64MOVHstorezero)
  3979  		v.AuxInt = int32ToAuxInt(int32(c))
  3980  		v.AddArg2(ptr, mem)
  3981  		return true
  3982  	}
  3983  	// match: (MOVHstorezeroidx (MOVVconst [c]) idx mem)
  3984  	// cond: is32Bit(c)
  3985  	// result: (MOVHstorezero [int32(c)] idx mem)
  3986  	for {
  3987  		if v_0.Op != OpLOONG64MOVVconst {
  3988  			break
  3989  		}
  3990  		c := auxIntToInt64(v_0.AuxInt)
  3991  		idx := v_1
  3992  		mem := v_2
  3993  		if !(is32Bit(c)) {
  3994  			break
  3995  		}
  3996  		v.reset(OpLOONG64MOVHstorezero)
  3997  		v.AuxInt = int32ToAuxInt(int32(c))
  3998  		v.AddArg2(idx, mem)
  3999  		return true
  4000  	}
  4001  	return false
  4002  }
  4003  func rewriteValueLOONG64_OpLOONG64MOVVload(v *Value) bool {
  4004  	v_1 := v.Args[1]
  4005  	v_0 := v.Args[0]
  4006  	b := v.Block
  4007  	config := b.Func.Config
  4008  	// match: (MOVVload [off] {sym} ptr (MOVDstore [off] {sym} ptr val _))
  4009  	// result: (MOVVfpgp val)
  4010  	for {
  4011  		off := auxIntToInt32(v.AuxInt)
  4012  		sym := auxToSym(v.Aux)
  4013  		ptr := v_0
  4014  		if v_1.Op != OpLOONG64MOVDstore || auxIntToInt32(v_1.AuxInt) != off || auxToSym(v_1.Aux) != sym {
  4015  			break
  4016  		}
  4017  		val := v_1.Args[1]
  4018  		if ptr != v_1.Args[0] {
  4019  			break
  4020  		}
  4021  		v.reset(OpLOONG64MOVVfpgp)
  4022  		v.AddArg(val)
  4023  		return true
  4024  	}
  4025  	// match: (MOVVload [off1] {sym} (ADDVconst [off2] ptr) mem)
  4026  	// cond: is32Bit(int64(off1)+off2) && (ptr.Op != OpSB || !config.ctxt.Flag_dynlink)
  4027  	// result: (MOVVload [off1+int32(off2)] {sym} ptr mem)
  4028  	for {
  4029  		off1 := auxIntToInt32(v.AuxInt)
  4030  		sym := auxToSym(v.Aux)
  4031  		if v_0.Op != OpLOONG64ADDVconst {
  4032  			break
  4033  		}
  4034  		off2 := auxIntToInt64(v_0.AuxInt)
  4035  		ptr := v_0.Args[0]
  4036  		mem := v_1
  4037  		if !(is32Bit(int64(off1)+off2) && (ptr.Op != OpSB || !config.ctxt.Flag_dynlink)) {
  4038  			break
  4039  		}
  4040  		v.reset(OpLOONG64MOVVload)
  4041  		v.AuxInt = int32ToAuxInt(off1 + int32(off2))
  4042  		v.Aux = symToAux(sym)
  4043  		v.AddArg2(ptr, mem)
  4044  		return true
  4045  	}
  4046  	// match: (MOVVload [off1] {sym1} (MOVVaddr [off2] {sym2} ptr) mem)
  4047  	// cond: canMergeSym(sym1,sym2) && is32Bit(int64(off1)+int64(off2)) && (ptr.Op != OpSB || !config.ctxt.Flag_dynlink)
  4048  	// result: (MOVVload [off1+int32(off2)] {mergeSym(sym1,sym2)} ptr mem)
  4049  	for {
  4050  		off1 := auxIntToInt32(v.AuxInt)
  4051  		sym1 := auxToSym(v.Aux)
  4052  		if v_0.Op != OpLOONG64MOVVaddr {
  4053  			break
  4054  		}
  4055  		off2 := auxIntToInt32(v_0.AuxInt)
  4056  		sym2 := auxToSym(v_0.Aux)
  4057  		ptr := v_0.Args[0]
  4058  		mem := v_1
  4059  		if !(canMergeSym(sym1, sym2) && is32Bit(int64(off1)+int64(off2)) && (ptr.Op != OpSB || !config.ctxt.Flag_dynlink)) {
  4060  			break
  4061  		}
  4062  		v.reset(OpLOONG64MOVVload)
  4063  		v.AuxInt = int32ToAuxInt(off1 + int32(off2))
  4064  		v.Aux = symToAux(mergeSym(sym1, sym2))
  4065  		v.AddArg2(ptr, mem)
  4066  		return true
  4067  	}
  4068  	// match: (MOVVload [off] {sym} (ADDV ptr idx) mem)
  4069  	// cond: off == 0 && sym == nil
  4070  	// result: (MOVVloadidx ptr idx mem)
  4071  	for {
  4072  		off := auxIntToInt32(v.AuxInt)
  4073  		sym := auxToSym(v.Aux)
  4074  		if v_0.Op != OpLOONG64ADDV {
  4075  			break
  4076  		}
  4077  		idx := v_0.Args[1]
  4078  		ptr := v_0.Args[0]
  4079  		mem := v_1
  4080  		if !(off == 0 && sym == nil) {
  4081  			break
  4082  		}
  4083  		v.reset(OpLOONG64MOVVloadidx)
  4084  		v.AddArg3(ptr, idx, mem)
  4085  		return true
  4086  	}
  4087  	return false
  4088  }
  4089  func rewriteValueLOONG64_OpLOONG64MOVVloadidx(v *Value) bool {
  4090  	v_2 := v.Args[2]
  4091  	v_1 := v.Args[1]
  4092  	v_0 := v.Args[0]
  4093  	// match: (MOVVloadidx ptr (MOVVconst [c]) mem)
  4094  	// cond: is32Bit(c)
  4095  	// result: (MOVVload [int32(c)] ptr mem)
  4096  	for {
  4097  		ptr := v_0
  4098  		if v_1.Op != OpLOONG64MOVVconst {
  4099  			break
  4100  		}
  4101  		c := auxIntToInt64(v_1.AuxInt)
  4102  		mem := v_2
  4103  		if !(is32Bit(c)) {
  4104  			break
  4105  		}
  4106  		v.reset(OpLOONG64MOVVload)
  4107  		v.AuxInt = int32ToAuxInt(int32(c))
  4108  		v.AddArg2(ptr, mem)
  4109  		return true
  4110  	}
  4111  	// match: (MOVVloadidx (MOVVconst [c]) ptr mem)
  4112  	// cond: is32Bit(c)
  4113  	// result: (MOVVload [int32(c)] ptr mem)
  4114  	for {
  4115  		if v_0.Op != OpLOONG64MOVVconst {
  4116  			break
  4117  		}
  4118  		c := auxIntToInt64(v_0.AuxInt)
  4119  		ptr := v_1
  4120  		mem := v_2
  4121  		if !(is32Bit(c)) {
  4122  			break
  4123  		}
  4124  		v.reset(OpLOONG64MOVVload)
  4125  		v.AuxInt = int32ToAuxInt(int32(c))
  4126  		v.AddArg2(ptr, mem)
  4127  		return true
  4128  	}
  4129  	return false
  4130  }
  4131  func rewriteValueLOONG64_OpLOONG64MOVVnop(v *Value) bool {
  4132  	v_0 := v.Args[0]
  4133  	// match: (MOVVnop (MOVVconst [c]))
  4134  	// result: (MOVVconst [c])
  4135  	for {
  4136  		if v_0.Op != OpLOONG64MOVVconst {
  4137  			break
  4138  		}
  4139  		c := auxIntToInt64(v_0.AuxInt)
  4140  		v.reset(OpLOONG64MOVVconst)
  4141  		v.AuxInt = int64ToAuxInt(c)
  4142  		return true
  4143  	}
  4144  	return false
  4145  }
  4146  func rewriteValueLOONG64_OpLOONG64MOVVreg(v *Value) bool {
  4147  	v_0 := v.Args[0]
  4148  	// match: (MOVVreg x)
  4149  	// cond: x.Uses == 1
  4150  	// result: (MOVVnop x)
  4151  	for {
  4152  		x := v_0
  4153  		if !(x.Uses == 1) {
  4154  			break
  4155  		}
  4156  		v.reset(OpLOONG64MOVVnop)
  4157  		v.AddArg(x)
  4158  		return true
  4159  	}
  4160  	// match: (MOVVreg (MOVVconst [c]))
  4161  	// result: (MOVVconst [c])
  4162  	for {
  4163  		if v_0.Op != OpLOONG64MOVVconst {
  4164  			break
  4165  		}
  4166  		c := auxIntToInt64(v_0.AuxInt)
  4167  		v.reset(OpLOONG64MOVVconst)
  4168  		v.AuxInt = int64ToAuxInt(c)
  4169  		return true
  4170  	}
  4171  	return false
  4172  }
  4173  func rewriteValueLOONG64_OpLOONG64MOVVstore(v *Value) bool {
  4174  	v_2 := v.Args[2]
  4175  	v_1 := v.Args[1]
  4176  	v_0 := v.Args[0]
  4177  	b := v.Block
  4178  	config := b.Func.Config
  4179  	// match: (MOVVstore [off] {sym} ptr (MOVVfpgp val) mem)
  4180  	// result: (MOVDstore [off] {sym} ptr val mem)
  4181  	for {
  4182  		off := auxIntToInt32(v.AuxInt)
  4183  		sym := auxToSym(v.Aux)
  4184  		ptr := v_0
  4185  		if v_1.Op != OpLOONG64MOVVfpgp {
  4186  			break
  4187  		}
  4188  		val := v_1.Args[0]
  4189  		mem := v_2
  4190  		v.reset(OpLOONG64MOVDstore)
  4191  		v.AuxInt = int32ToAuxInt(off)
  4192  		v.Aux = symToAux(sym)
  4193  		v.AddArg3(ptr, val, mem)
  4194  		return true
  4195  	}
  4196  	// match: (MOVVstore [off1] {sym} (ADDVconst [off2] ptr) val mem)
  4197  	// cond: is32Bit(int64(off1)+off2) && (ptr.Op != OpSB || !config.ctxt.Flag_dynlink)
  4198  	// result: (MOVVstore [off1+int32(off2)] {sym} ptr val mem)
  4199  	for {
  4200  		off1 := auxIntToInt32(v.AuxInt)
  4201  		sym := auxToSym(v.Aux)
  4202  		if v_0.Op != OpLOONG64ADDVconst {
  4203  			break
  4204  		}
  4205  		off2 := auxIntToInt64(v_0.AuxInt)
  4206  		ptr := v_0.Args[0]
  4207  		val := v_1
  4208  		mem := v_2
  4209  		if !(is32Bit(int64(off1)+off2) && (ptr.Op != OpSB || !config.ctxt.Flag_dynlink)) {
  4210  			break
  4211  		}
  4212  		v.reset(OpLOONG64MOVVstore)
  4213  		v.AuxInt = int32ToAuxInt(off1 + int32(off2))
  4214  		v.Aux = symToAux(sym)
  4215  		v.AddArg3(ptr, val, mem)
  4216  		return true
  4217  	}
  4218  	// match: (MOVVstore [off1] {sym1} (MOVVaddr [off2] {sym2} ptr) val mem)
  4219  	// cond: canMergeSym(sym1,sym2) && is32Bit(int64(off1)+int64(off2)) && (ptr.Op != OpSB || !config.ctxt.Flag_dynlink)
  4220  	// result: (MOVVstore [off1+int32(off2)] {mergeSym(sym1,sym2)} ptr val mem)
  4221  	for {
  4222  		off1 := auxIntToInt32(v.AuxInt)
  4223  		sym1 := auxToSym(v.Aux)
  4224  		if v_0.Op != OpLOONG64MOVVaddr {
  4225  			break
  4226  		}
  4227  		off2 := auxIntToInt32(v_0.AuxInt)
  4228  		sym2 := auxToSym(v_0.Aux)
  4229  		ptr := v_0.Args[0]
  4230  		val := v_1
  4231  		mem := v_2
  4232  		if !(canMergeSym(sym1, sym2) && is32Bit(int64(off1)+int64(off2)) && (ptr.Op != OpSB || !config.ctxt.Flag_dynlink)) {
  4233  			break
  4234  		}
  4235  		v.reset(OpLOONG64MOVVstore)
  4236  		v.AuxInt = int32ToAuxInt(off1 + int32(off2))
  4237  		v.Aux = symToAux(mergeSym(sym1, sym2))
  4238  		v.AddArg3(ptr, val, mem)
  4239  		return true
  4240  	}
  4241  	// match: (MOVVstore [off] {sym} ptr (MOVVconst [0]) mem)
  4242  	// result: (MOVVstorezero [off] {sym} ptr mem)
  4243  	for {
  4244  		off := auxIntToInt32(v.AuxInt)
  4245  		sym := auxToSym(v.Aux)
  4246  		ptr := v_0
  4247  		if v_1.Op != OpLOONG64MOVVconst || auxIntToInt64(v_1.AuxInt) != 0 {
  4248  			break
  4249  		}
  4250  		mem := v_2
  4251  		v.reset(OpLOONG64MOVVstorezero)
  4252  		v.AuxInt = int32ToAuxInt(off)
  4253  		v.Aux = symToAux(sym)
  4254  		v.AddArg2(ptr, mem)
  4255  		return true
  4256  	}
  4257  	// match: (MOVVstore [off] {sym} (ADDV ptr idx) val mem)
  4258  	// cond: off == 0 && sym == nil
  4259  	// result: (MOVVstoreidx ptr idx val mem)
  4260  	for {
  4261  		off := auxIntToInt32(v.AuxInt)
  4262  		sym := auxToSym(v.Aux)
  4263  		if v_0.Op != OpLOONG64ADDV {
  4264  			break
  4265  		}
  4266  		idx := v_0.Args[1]
  4267  		ptr := v_0.Args[0]
  4268  		val := v_1
  4269  		mem := v_2
  4270  		if !(off == 0 && sym == nil) {
  4271  			break
  4272  		}
  4273  		v.reset(OpLOONG64MOVVstoreidx)
  4274  		v.AddArg4(ptr, idx, val, mem)
  4275  		return true
  4276  	}
  4277  	return false
  4278  }
  4279  func rewriteValueLOONG64_OpLOONG64MOVVstoreidx(v *Value) bool {
  4280  	v_3 := v.Args[3]
  4281  	v_2 := v.Args[2]
  4282  	v_1 := v.Args[1]
  4283  	v_0 := v.Args[0]
  4284  	// match: (MOVVstoreidx ptr (MOVVconst [c]) val mem)
  4285  	// cond: is32Bit(c)
  4286  	// result: (MOVVstore [int32(c)] ptr val mem)
  4287  	for {
  4288  		ptr := v_0
  4289  		if v_1.Op != OpLOONG64MOVVconst {
  4290  			break
  4291  		}
  4292  		c := auxIntToInt64(v_1.AuxInt)
  4293  		val := v_2
  4294  		mem := v_3
  4295  		if !(is32Bit(c)) {
  4296  			break
  4297  		}
  4298  		v.reset(OpLOONG64MOVVstore)
  4299  		v.AuxInt = int32ToAuxInt(int32(c))
  4300  		v.AddArg3(ptr, val, mem)
  4301  		return true
  4302  	}
  4303  	// match: (MOVVstoreidx (MOVVconst [c]) idx val mem)
  4304  	// cond: is32Bit(c)
  4305  	// result: (MOVVstore [int32(c)] idx val mem)
  4306  	for {
  4307  		if v_0.Op != OpLOONG64MOVVconst {
  4308  			break
  4309  		}
  4310  		c := auxIntToInt64(v_0.AuxInt)
  4311  		idx := v_1
  4312  		val := v_2
  4313  		mem := v_3
  4314  		if !(is32Bit(c)) {
  4315  			break
  4316  		}
  4317  		v.reset(OpLOONG64MOVVstore)
  4318  		v.AuxInt = int32ToAuxInt(int32(c))
  4319  		v.AddArg3(idx, val, mem)
  4320  		return true
  4321  	}
  4322  	// match: (MOVVstoreidx ptr idx (MOVVconst [0]) mem)
  4323  	// result: (MOVVstorezeroidx ptr idx mem)
  4324  	for {
  4325  		ptr := v_0
  4326  		idx := v_1
  4327  		if v_2.Op != OpLOONG64MOVVconst || auxIntToInt64(v_2.AuxInt) != 0 {
  4328  			break
  4329  		}
  4330  		mem := v_3
  4331  		v.reset(OpLOONG64MOVVstorezeroidx)
  4332  		v.AddArg3(ptr, idx, mem)
  4333  		return true
  4334  	}
  4335  	return false
  4336  }
  4337  func rewriteValueLOONG64_OpLOONG64MOVVstorezero(v *Value) bool {
  4338  	v_1 := v.Args[1]
  4339  	v_0 := v.Args[0]
  4340  	b := v.Block
  4341  	config := b.Func.Config
  4342  	// match: (MOVVstorezero [off1] {sym} (ADDVconst [off2] ptr) mem)
  4343  	// cond: is32Bit(int64(off1)+off2) && (ptr.Op != OpSB || !config.ctxt.Flag_dynlink)
  4344  	// result: (MOVVstorezero [off1+int32(off2)] {sym} ptr mem)
  4345  	for {
  4346  		off1 := auxIntToInt32(v.AuxInt)
  4347  		sym := auxToSym(v.Aux)
  4348  		if v_0.Op != OpLOONG64ADDVconst {
  4349  			break
  4350  		}
  4351  		off2 := auxIntToInt64(v_0.AuxInt)
  4352  		ptr := v_0.Args[0]
  4353  		mem := v_1
  4354  		if !(is32Bit(int64(off1)+off2) && (ptr.Op != OpSB || !config.ctxt.Flag_dynlink)) {
  4355  			break
  4356  		}
  4357  		v.reset(OpLOONG64MOVVstorezero)
  4358  		v.AuxInt = int32ToAuxInt(off1 + int32(off2))
  4359  		v.Aux = symToAux(sym)
  4360  		v.AddArg2(ptr, mem)
  4361  		return true
  4362  	}
  4363  	// match: (MOVVstorezero [off1] {sym1} (MOVVaddr [off2] {sym2} ptr) mem)
  4364  	// cond: canMergeSym(sym1,sym2) && is32Bit(int64(off1)+int64(off2)) && (ptr.Op != OpSB || !config.ctxt.Flag_dynlink)
  4365  	// result: (MOVVstorezero [off1+int32(off2)] {mergeSym(sym1,sym2)} ptr mem)
  4366  	for {
  4367  		off1 := auxIntToInt32(v.AuxInt)
  4368  		sym1 := auxToSym(v.Aux)
  4369  		if v_0.Op != OpLOONG64MOVVaddr {
  4370  			break
  4371  		}
  4372  		off2 := auxIntToInt32(v_0.AuxInt)
  4373  		sym2 := auxToSym(v_0.Aux)
  4374  		ptr := v_0.Args[0]
  4375  		mem := v_1
  4376  		if !(canMergeSym(sym1, sym2) && is32Bit(int64(off1)+int64(off2)) && (ptr.Op != OpSB || !config.ctxt.Flag_dynlink)) {
  4377  			break
  4378  		}
  4379  		v.reset(OpLOONG64MOVVstorezero)
  4380  		v.AuxInt = int32ToAuxInt(off1 + int32(off2))
  4381  		v.Aux = symToAux(mergeSym(sym1, sym2))
  4382  		v.AddArg2(ptr, mem)
  4383  		return true
  4384  	}
  4385  	// match: (MOVVstorezero [off] {sym} (ADDV ptr idx) mem)
  4386  	// cond: off == 0 && sym == nil
  4387  	// result: (MOVVstorezeroidx ptr idx mem)
  4388  	for {
  4389  		off := auxIntToInt32(v.AuxInt)
  4390  		sym := auxToSym(v.Aux)
  4391  		if v_0.Op != OpLOONG64ADDV {
  4392  			break
  4393  		}
  4394  		idx := v_0.Args[1]
  4395  		ptr := v_0.Args[0]
  4396  		mem := v_1
  4397  		if !(off == 0 && sym == nil) {
  4398  			break
  4399  		}
  4400  		v.reset(OpLOONG64MOVVstorezeroidx)
  4401  		v.AddArg3(ptr, idx, mem)
  4402  		return true
  4403  	}
  4404  	return false
  4405  }
  4406  func rewriteValueLOONG64_OpLOONG64MOVVstorezeroidx(v *Value) bool {
  4407  	v_2 := v.Args[2]
  4408  	v_1 := v.Args[1]
  4409  	v_0 := v.Args[0]
  4410  	// match: (MOVVstorezeroidx ptr (MOVVconst [c]) mem)
  4411  	// cond: is32Bit(c)
  4412  	// result: (MOVVstorezero [int32(c)] ptr mem)
  4413  	for {
  4414  		ptr := v_0
  4415  		if v_1.Op != OpLOONG64MOVVconst {
  4416  			break
  4417  		}
  4418  		c := auxIntToInt64(v_1.AuxInt)
  4419  		mem := v_2
  4420  		if !(is32Bit(c)) {
  4421  			break
  4422  		}
  4423  		v.reset(OpLOONG64MOVVstorezero)
  4424  		v.AuxInt = int32ToAuxInt(int32(c))
  4425  		v.AddArg2(ptr, mem)
  4426  		return true
  4427  	}
  4428  	// match: (MOVVstorezeroidx (MOVVconst [c]) idx mem)
  4429  	// cond: is32Bit(c)
  4430  	// result: (MOVVstorezero [int32(c)] idx mem)
  4431  	for {
  4432  		if v_0.Op != OpLOONG64MOVVconst {
  4433  			break
  4434  		}
  4435  		c := auxIntToInt64(v_0.AuxInt)
  4436  		idx := v_1
  4437  		mem := v_2
  4438  		if !(is32Bit(c)) {
  4439  			break
  4440  		}
  4441  		v.reset(OpLOONG64MOVVstorezero)
  4442  		v.AuxInt = int32ToAuxInt(int32(c))
  4443  		v.AddArg2(idx, mem)
  4444  		return true
  4445  	}
  4446  	return false
  4447  }
  4448  func rewriteValueLOONG64_OpLOONG64MOVWUload(v *Value) bool {
  4449  	v_1 := v.Args[1]
  4450  	v_0 := v.Args[0]
  4451  	b := v.Block
  4452  	config := b.Func.Config
  4453  	typ := &b.Func.Config.Types
  4454  	// match: (MOVWUload [off] {sym} ptr (MOVFstore [off] {sym} ptr val _))
  4455  	// result: (ZeroExt32to64 (MOVWfpgp <typ.Float32> val))
  4456  	for {
  4457  		off := auxIntToInt32(v.AuxInt)
  4458  		sym := auxToSym(v.Aux)
  4459  		ptr := v_0
  4460  		if v_1.Op != OpLOONG64MOVFstore || auxIntToInt32(v_1.AuxInt) != off || auxToSym(v_1.Aux) != sym {
  4461  			break
  4462  		}
  4463  		val := v_1.Args[1]
  4464  		if ptr != v_1.Args[0] {
  4465  			break
  4466  		}
  4467  		v.reset(OpZeroExt32to64)
  4468  		v0 := b.NewValue0(v_1.Pos, OpLOONG64MOVWfpgp, typ.Float32)
  4469  		v0.AddArg(val)
  4470  		v.AddArg(v0)
  4471  		return true
  4472  	}
  4473  	// match: (MOVWUload [off1] {sym} (ADDVconst [off2] ptr) mem)
  4474  	// cond: is32Bit(int64(off1)+off2) && (ptr.Op != OpSB || !config.ctxt.Flag_dynlink)
  4475  	// result: (MOVWUload [off1+int32(off2)] {sym} ptr mem)
  4476  	for {
  4477  		off1 := auxIntToInt32(v.AuxInt)
  4478  		sym := auxToSym(v.Aux)
  4479  		if v_0.Op != OpLOONG64ADDVconst {
  4480  			break
  4481  		}
  4482  		off2 := auxIntToInt64(v_0.AuxInt)
  4483  		ptr := v_0.Args[0]
  4484  		mem := v_1
  4485  		if !(is32Bit(int64(off1)+off2) && (ptr.Op != OpSB || !config.ctxt.Flag_dynlink)) {
  4486  			break
  4487  		}
  4488  		v.reset(OpLOONG64MOVWUload)
  4489  		v.AuxInt = int32ToAuxInt(off1 + int32(off2))
  4490  		v.Aux = symToAux(sym)
  4491  		v.AddArg2(ptr, mem)
  4492  		return true
  4493  	}
  4494  	// match: (MOVWUload [off1] {sym1} (MOVVaddr [off2] {sym2} ptr) mem)
  4495  	// cond: canMergeSym(sym1,sym2) && is32Bit(int64(off1)+int64(off2)) && (ptr.Op != OpSB || !config.ctxt.Flag_dynlink)
  4496  	// result: (MOVWUload [off1+int32(off2)] {mergeSym(sym1,sym2)} ptr mem)
  4497  	for {
  4498  		off1 := auxIntToInt32(v.AuxInt)
  4499  		sym1 := auxToSym(v.Aux)
  4500  		if v_0.Op != OpLOONG64MOVVaddr {
  4501  			break
  4502  		}
  4503  		off2 := auxIntToInt32(v_0.AuxInt)
  4504  		sym2 := auxToSym(v_0.Aux)
  4505  		ptr := v_0.Args[0]
  4506  		mem := v_1
  4507  		if !(canMergeSym(sym1, sym2) && is32Bit(int64(off1)+int64(off2)) && (ptr.Op != OpSB || !config.ctxt.Flag_dynlink)) {
  4508  			break
  4509  		}
  4510  		v.reset(OpLOONG64MOVWUload)
  4511  		v.AuxInt = int32ToAuxInt(off1 + int32(off2))
  4512  		v.Aux = symToAux(mergeSym(sym1, sym2))
  4513  		v.AddArg2(ptr, mem)
  4514  		return true
  4515  	}
  4516  	// match: (MOVWUload [off] {sym} (ADDV ptr idx) mem)
  4517  	// cond: off == 0 && sym == nil
  4518  	// result: (MOVWUloadidx ptr idx mem)
  4519  	for {
  4520  		off := auxIntToInt32(v.AuxInt)
  4521  		sym := auxToSym(v.Aux)
  4522  		if v_0.Op != OpLOONG64ADDV {
  4523  			break
  4524  		}
  4525  		idx := v_0.Args[1]
  4526  		ptr := v_0.Args[0]
  4527  		mem := v_1
  4528  		if !(off == 0 && sym == nil) {
  4529  			break
  4530  		}
  4531  		v.reset(OpLOONG64MOVWUloadidx)
  4532  		v.AddArg3(ptr, idx, mem)
  4533  		return true
  4534  	}
  4535  	return false
  4536  }
  4537  func rewriteValueLOONG64_OpLOONG64MOVWUloadidx(v *Value) bool {
  4538  	v_2 := v.Args[2]
  4539  	v_1 := v.Args[1]
  4540  	v_0 := v.Args[0]
  4541  	// match: (MOVWUloadidx ptr (MOVVconst [c]) mem)
  4542  	// cond: is32Bit(c)
  4543  	// result: (MOVWUload [int32(c)] ptr mem)
  4544  	for {
  4545  		ptr := v_0
  4546  		if v_1.Op != OpLOONG64MOVVconst {
  4547  			break
  4548  		}
  4549  		c := auxIntToInt64(v_1.AuxInt)
  4550  		mem := v_2
  4551  		if !(is32Bit(c)) {
  4552  			break
  4553  		}
  4554  		v.reset(OpLOONG64MOVWUload)
  4555  		v.AuxInt = int32ToAuxInt(int32(c))
  4556  		v.AddArg2(ptr, mem)
  4557  		return true
  4558  	}
  4559  	// match: (MOVWUloadidx (MOVVconst [c]) ptr mem)
  4560  	// cond: is32Bit(c)
  4561  	// result: (MOVWUload [int32(c)] ptr mem)
  4562  	for {
  4563  		if v_0.Op != OpLOONG64MOVVconst {
  4564  			break
  4565  		}
  4566  		c := auxIntToInt64(v_0.AuxInt)
  4567  		ptr := v_1
  4568  		mem := v_2
  4569  		if !(is32Bit(c)) {
  4570  			break
  4571  		}
  4572  		v.reset(OpLOONG64MOVWUload)
  4573  		v.AuxInt = int32ToAuxInt(int32(c))
  4574  		v.AddArg2(ptr, mem)
  4575  		return true
  4576  	}
  4577  	return false
  4578  }
  4579  func rewriteValueLOONG64_OpLOONG64MOVWUreg(v *Value) bool {
  4580  	v_0 := v.Args[0]
  4581  	// match: (MOVWUreg (SRLVconst [rc] x))
  4582  	// cond: rc < 32
  4583  	// result: (BSTRPICKV [rc + (31+rc)<<6] x)
  4584  	for {
  4585  		if v_0.Op != OpLOONG64SRLVconst {
  4586  			break
  4587  		}
  4588  		rc := auxIntToInt64(v_0.AuxInt)
  4589  		x := v_0.Args[0]
  4590  		if !(rc < 32) {
  4591  			break
  4592  		}
  4593  		v.reset(OpLOONG64BSTRPICKV)
  4594  		v.AuxInt = int64ToAuxInt(rc + (31+rc)<<6)
  4595  		v.AddArg(x)
  4596  		return true
  4597  	}
  4598  	// match: (MOVWUreg x:(MOVBUload _ _))
  4599  	// result: (MOVVreg x)
  4600  	for {
  4601  		x := v_0
  4602  		if x.Op != OpLOONG64MOVBUload {
  4603  			break
  4604  		}
  4605  		v.reset(OpLOONG64MOVVreg)
  4606  		v.AddArg(x)
  4607  		return true
  4608  	}
  4609  	// match: (MOVWUreg x:(MOVHUload _ _))
  4610  	// result: (MOVVreg x)
  4611  	for {
  4612  		x := v_0
  4613  		if x.Op != OpLOONG64MOVHUload {
  4614  			break
  4615  		}
  4616  		v.reset(OpLOONG64MOVVreg)
  4617  		v.AddArg(x)
  4618  		return true
  4619  	}
  4620  	// match: (MOVWUreg x:(MOVWUload _ _))
  4621  	// result: (MOVVreg x)
  4622  	for {
  4623  		x := v_0
  4624  		if x.Op != OpLOONG64MOVWUload {
  4625  			break
  4626  		}
  4627  		v.reset(OpLOONG64MOVVreg)
  4628  		v.AddArg(x)
  4629  		return true
  4630  	}
  4631  	// match: (MOVWUreg x:(MOVBUreg _))
  4632  	// result: (MOVVreg x)
  4633  	for {
  4634  		x := v_0
  4635  		if x.Op != OpLOONG64MOVBUreg {
  4636  			break
  4637  		}
  4638  		v.reset(OpLOONG64MOVVreg)
  4639  		v.AddArg(x)
  4640  		return true
  4641  	}
  4642  	// match: (MOVWUreg x:(MOVHUreg _))
  4643  	// result: (MOVVreg x)
  4644  	for {
  4645  		x := v_0
  4646  		if x.Op != OpLOONG64MOVHUreg {
  4647  			break
  4648  		}
  4649  		v.reset(OpLOONG64MOVVreg)
  4650  		v.AddArg(x)
  4651  		return true
  4652  	}
  4653  	// match: (MOVWUreg x:(MOVWUreg _))
  4654  	// result: (MOVVreg x)
  4655  	for {
  4656  		x := v_0
  4657  		if x.Op != OpLOONG64MOVWUreg {
  4658  			break
  4659  		}
  4660  		v.reset(OpLOONG64MOVVreg)
  4661  		v.AddArg(x)
  4662  		return true
  4663  	}
  4664  	// match: (MOVWUreg (SLLVconst [lc] x))
  4665  	// cond: lc >= 32
  4666  	// result: (MOVVconst [0])
  4667  	for {
  4668  		if v_0.Op != OpLOONG64SLLVconst {
  4669  			break
  4670  		}
  4671  		lc := auxIntToInt64(v_0.AuxInt)
  4672  		if !(lc >= 32) {
  4673  			break
  4674  		}
  4675  		v.reset(OpLOONG64MOVVconst)
  4676  		v.AuxInt = int64ToAuxInt(0)
  4677  		return true
  4678  	}
  4679  	// match: (MOVWUreg (MOVVconst [c]))
  4680  	// result: (MOVVconst [int64(uint32(c))])
  4681  	for {
  4682  		if v_0.Op != OpLOONG64MOVVconst {
  4683  			break
  4684  		}
  4685  		c := auxIntToInt64(v_0.AuxInt)
  4686  		v.reset(OpLOONG64MOVVconst)
  4687  		v.AuxInt = int64ToAuxInt(int64(uint32(c)))
  4688  		return true
  4689  	}
  4690  	return false
  4691  }
  4692  func rewriteValueLOONG64_OpLOONG64MOVWload(v *Value) bool {
  4693  	v_1 := v.Args[1]
  4694  	v_0 := v.Args[0]
  4695  	b := v.Block
  4696  	config := b.Func.Config
  4697  	// match: (MOVWload [off1] {sym} (ADDVconst [off2] ptr) mem)
  4698  	// cond: is32Bit(int64(off1)+off2) && (ptr.Op != OpSB || !config.ctxt.Flag_dynlink)
  4699  	// result: (MOVWload [off1+int32(off2)] {sym} ptr mem)
  4700  	for {
  4701  		off1 := auxIntToInt32(v.AuxInt)
  4702  		sym := auxToSym(v.Aux)
  4703  		if v_0.Op != OpLOONG64ADDVconst {
  4704  			break
  4705  		}
  4706  		off2 := auxIntToInt64(v_0.AuxInt)
  4707  		ptr := v_0.Args[0]
  4708  		mem := v_1
  4709  		if !(is32Bit(int64(off1)+off2) && (ptr.Op != OpSB || !config.ctxt.Flag_dynlink)) {
  4710  			break
  4711  		}
  4712  		v.reset(OpLOONG64MOVWload)
  4713  		v.AuxInt = int32ToAuxInt(off1 + int32(off2))
  4714  		v.Aux = symToAux(sym)
  4715  		v.AddArg2(ptr, mem)
  4716  		return true
  4717  	}
  4718  	// match: (MOVWload [off1] {sym1} (MOVVaddr [off2] {sym2} ptr) mem)
  4719  	// cond: canMergeSym(sym1,sym2) && is32Bit(int64(off1)+int64(off2)) && (ptr.Op != OpSB || !config.ctxt.Flag_dynlink)
  4720  	// result: (MOVWload [off1+int32(off2)] {mergeSym(sym1,sym2)} ptr mem)
  4721  	for {
  4722  		off1 := auxIntToInt32(v.AuxInt)
  4723  		sym1 := auxToSym(v.Aux)
  4724  		if v_0.Op != OpLOONG64MOVVaddr {
  4725  			break
  4726  		}
  4727  		off2 := auxIntToInt32(v_0.AuxInt)
  4728  		sym2 := auxToSym(v_0.Aux)
  4729  		ptr := v_0.Args[0]
  4730  		mem := v_1
  4731  		if !(canMergeSym(sym1, sym2) && is32Bit(int64(off1)+int64(off2)) && (ptr.Op != OpSB || !config.ctxt.Flag_dynlink)) {
  4732  			break
  4733  		}
  4734  		v.reset(OpLOONG64MOVWload)
  4735  		v.AuxInt = int32ToAuxInt(off1 + int32(off2))
  4736  		v.Aux = symToAux(mergeSym(sym1, sym2))
  4737  		v.AddArg2(ptr, mem)
  4738  		return true
  4739  	}
  4740  	// match: (MOVWload [off] {sym} (ADDV ptr idx) mem)
  4741  	// cond: off == 0 && sym == nil
  4742  	// result: (MOVWloadidx ptr idx mem)
  4743  	for {
  4744  		off := auxIntToInt32(v.AuxInt)
  4745  		sym := auxToSym(v.Aux)
  4746  		if v_0.Op != OpLOONG64ADDV {
  4747  			break
  4748  		}
  4749  		idx := v_0.Args[1]
  4750  		ptr := v_0.Args[0]
  4751  		mem := v_1
  4752  		if !(off == 0 && sym == nil) {
  4753  			break
  4754  		}
  4755  		v.reset(OpLOONG64MOVWloadidx)
  4756  		v.AddArg3(ptr, idx, mem)
  4757  		return true
  4758  	}
  4759  	return false
  4760  }
  4761  func rewriteValueLOONG64_OpLOONG64MOVWloadidx(v *Value) bool {
  4762  	v_2 := v.Args[2]
  4763  	v_1 := v.Args[1]
  4764  	v_0 := v.Args[0]
  4765  	// match: (MOVWloadidx ptr (MOVVconst [c]) mem)
  4766  	// cond: is32Bit(c)
  4767  	// result: (MOVWload [int32(c)] ptr mem)
  4768  	for {
  4769  		ptr := v_0
  4770  		if v_1.Op != OpLOONG64MOVVconst {
  4771  			break
  4772  		}
  4773  		c := auxIntToInt64(v_1.AuxInt)
  4774  		mem := v_2
  4775  		if !(is32Bit(c)) {
  4776  			break
  4777  		}
  4778  		v.reset(OpLOONG64MOVWload)
  4779  		v.AuxInt = int32ToAuxInt(int32(c))
  4780  		v.AddArg2(ptr, mem)
  4781  		return true
  4782  	}
  4783  	// match: (MOVWloadidx (MOVVconst [c]) ptr mem)
  4784  	// cond: is32Bit(c)
  4785  	// result: (MOVWload [int32(c)] ptr mem)
  4786  	for {
  4787  		if v_0.Op != OpLOONG64MOVVconst {
  4788  			break
  4789  		}
  4790  		c := auxIntToInt64(v_0.AuxInt)
  4791  		ptr := v_1
  4792  		mem := v_2
  4793  		if !(is32Bit(c)) {
  4794  			break
  4795  		}
  4796  		v.reset(OpLOONG64MOVWload)
  4797  		v.AuxInt = int32ToAuxInt(int32(c))
  4798  		v.AddArg2(ptr, mem)
  4799  		return true
  4800  	}
  4801  	return false
  4802  }
  4803  func rewriteValueLOONG64_OpLOONG64MOVWreg(v *Value) bool {
  4804  	v_0 := v.Args[0]
  4805  	// match: (MOVWreg x:(MOVBload _ _))
  4806  	// result: (MOVVreg x)
  4807  	for {
  4808  		x := v_0
  4809  		if x.Op != OpLOONG64MOVBload {
  4810  			break
  4811  		}
  4812  		v.reset(OpLOONG64MOVVreg)
  4813  		v.AddArg(x)
  4814  		return true
  4815  	}
  4816  	// match: (MOVWreg x:(MOVBUload _ _))
  4817  	// result: (MOVVreg x)
  4818  	for {
  4819  		x := v_0
  4820  		if x.Op != OpLOONG64MOVBUload {
  4821  			break
  4822  		}
  4823  		v.reset(OpLOONG64MOVVreg)
  4824  		v.AddArg(x)
  4825  		return true
  4826  	}
  4827  	// match: (MOVWreg x:(MOVHload _ _))
  4828  	// result: (MOVVreg x)
  4829  	for {
  4830  		x := v_0
  4831  		if x.Op != OpLOONG64MOVHload {
  4832  			break
  4833  		}
  4834  		v.reset(OpLOONG64MOVVreg)
  4835  		v.AddArg(x)
  4836  		return true
  4837  	}
  4838  	// match: (MOVWreg x:(MOVHUload _ _))
  4839  	// result: (MOVVreg x)
  4840  	for {
  4841  		x := v_0
  4842  		if x.Op != OpLOONG64MOVHUload {
  4843  			break
  4844  		}
  4845  		v.reset(OpLOONG64MOVVreg)
  4846  		v.AddArg(x)
  4847  		return true
  4848  	}
  4849  	// match: (MOVWreg x:(MOVWload _ _))
  4850  	// result: (MOVVreg x)
  4851  	for {
  4852  		x := v_0
  4853  		if x.Op != OpLOONG64MOVWload {
  4854  			break
  4855  		}
  4856  		v.reset(OpLOONG64MOVVreg)
  4857  		v.AddArg(x)
  4858  		return true
  4859  	}
  4860  	// match: (MOVWreg x:(MOVBreg _))
  4861  	// result: (MOVVreg x)
  4862  	for {
  4863  		x := v_0
  4864  		if x.Op != OpLOONG64MOVBreg {
  4865  			break
  4866  		}
  4867  		v.reset(OpLOONG64MOVVreg)
  4868  		v.AddArg(x)
  4869  		return true
  4870  	}
  4871  	// match: (MOVWreg x:(MOVBUreg _))
  4872  	// result: (MOVVreg x)
  4873  	for {
  4874  		x := v_0
  4875  		if x.Op != OpLOONG64MOVBUreg {
  4876  			break
  4877  		}
  4878  		v.reset(OpLOONG64MOVVreg)
  4879  		v.AddArg(x)
  4880  		return true
  4881  	}
  4882  	// match: (MOVWreg x:(MOVHreg _))
  4883  	// result: (MOVVreg x)
  4884  	for {
  4885  		x := v_0
  4886  		if x.Op != OpLOONG64MOVHreg {
  4887  			break
  4888  		}
  4889  		v.reset(OpLOONG64MOVVreg)
  4890  		v.AddArg(x)
  4891  		return true
  4892  	}
  4893  	// match: (MOVWreg x:(MOVWreg _))
  4894  	// result: (MOVVreg x)
  4895  	for {
  4896  		x := v_0
  4897  		if x.Op != OpLOONG64MOVWreg {
  4898  			break
  4899  		}
  4900  		v.reset(OpLOONG64MOVVreg)
  4901  		v.AddArg(x)
  4902  		return true
  4903  	}
  4904  	// match: (MOVWreg (MOVVconst [c]))
  4905  	// result: (MOVVconst [int64(int32(c))])
  4906  	for {
  4907  		if v_0.Op != OpLOONG64MOVVconst {
  4908  			break
  4909  		}
  4910  		c := auxIntToInt64(v_0.AuxInt)
  4911  		v.reset(OpLOONG64MOVVconst)
  4912  		v.AuxInt = int64ToAuxInt(int64(int32(c)))
  4913  		return true
  4914  	}
  4915  	return false
  4916  }
  4917  func rewriteValueLOONG64_OpLOONG64MOVWstore(v *Value) bool {
  4918  	v_2 := v.Args[2]
  4919  	v_1 := v.Args[1]
  4920  	v_0 := v.Args[0]
  4921  	b := v.Block
  4922  	config := b.Func.Config
  4923  	// match: (MOVWstore [off] {sym} ptr (MOVWfpgp val) mem)
  4924  	// result: (MOVFstore [off] {sym} ptr val mem)
  4925  	for {
  4926  		off := auxIntToInt32(v.AuxInt)
  4927  		sym := auxToSym(v.Aux)
  4928  		ptr := v_0
  4929  		if v_1.Op != OpLOONG64MOVWfpgp {
  4930  			break
  4931  		}
  4932  		val := v_1.Args[0]
  4933  		mem := v_2
  4934  		v.reset(OpLOONG64MOVFstore)
  4935  		v.AuxInt = int32ToAuxInt(off)
  4936  		v.Aux = symToAux(sym)
  4937  		v.AddArg3(ptr, val, mem)
  4938  		return true
  4939  	}
  4940  	// match: (MOVWstore [off1] {sym} (ADDVconst [off2] ptr) val mem)
  4941  	// cond: is32Bit(int64(off1)+off2) && (ptr.Op != OpSB || !config.ctxt.Flag_dynlink)
  4942  	// result: (MOVWstore [off1+int32(off2)] {sym} ptr val mem)
  4943  	for {
  4944  		off1 := auxIntToInt32(v.AuxInt)
  4945  		sym := auxToSym(v.Aux)
  4946  		if v_0.Op != OpLOONG64ADDVconst {
  4947  			break
  4948  		}
  4949  		off2 := auxIntToInt64(v_0.AuxInt)
  4950  		ptr := v_0.Args[0]
  4951  		val := v_1
  4952  		mem := v_2
  4953  		if !(is32Bit(int64(off1)+off2) && (ptr.Op != OpSB || !config.ctxt.Flag_dynlink)) {
  4954  			break
  4955  		}
  4956  		v.reset(OpLOONG64MOVWstore)
  4957  		v.AuxInt = int32ToAuxInt(off1 + int32(off2))
  4958  		v.Aux = symToAux(sym)
  4959  		v.AddArg3(ptr, val, mem)
  4960  		return true
  4961  	}
  4962  	// match: (MOVWstore [off1] {sym1} (MOVVaddr [off2] {sym2} ptr) val mem)
  4963  	// cond: canMergeSym(sym1,sym2) && is32Bit(int64(off1)+int64(off2)) && (ptr.Op != OpSB || !config.ctxt.Flag_dynlink)
  4964  	// result: (MOVWstore [off1+int32(off2)] {mergeSym(sym1,sym2)} ptr val mem)
  4965  	for {
  4966  		off1 := auxIntToInt32(v.AuxInt)
  4967  		sym1 := auxToSym(v.Aux)
  4968  		if v_0.Op != OpLOONG64MOVVaddr {
  4969  			break
  4970  		}
  4971  		off2 := auxIntToInt32(v_0.AuxInt)
  4972  		sym2 := auxToSym(v_0.Aux)
  4973  		ptr := v_0.Args[0]
  4974  		val := v_1
  4975  		mem := v_2
  4976  		if !(canMergeSym(sym1, sym2) && is32Bit(int64(off1)+int64(off2)) && (ptr.Op != OpSB || !config.ctxt.Flag_dynlink)) {
  4977  			break
  4978  		}
  4979  		v.reset(OpLOONG64MOVWstore)
  4980  		v.AuxInt = int32ToAuxInt(off1 + int32(off2))
  4981  		v.Aux = symToAux(mergeSym(sym1, sym2))
  4982  		v.AddArg3(ptr, val, mem)
  4983  		return true
  4984  	}
  4985  	// match: (MOVWstore [off] {sym} ptr (MOVWreg x) mem)
  4986  	// result: (MOVWstore [off] {sym} ptr x mem)
  4987  	for {
  4988  		off := auxIntToInt32(v.AuxInt)
  4989  		sym := auxToSym(v.Aux)
  4990  		ptr := v_0
  4991  		if v_1.Op != OpLOONG64MOVWreg {
  4992  			break
  4993  		}
  4994  		x := v_1.Args[0]
  4995  		mem := v_2
  4996  		v.reset(OpLOONG64MOVWstore)
  4997  		v.AuxInt = int32ToAuxInt(off)
  4998  		v.Aux = symToAux(sym)
  4999  		v.AddArg3(ptr, x, mem)
  5000  		return true
  5001  	}
  5002  	// match: (MOVWstore [off] {sym} ptr (MOVWUreg x) mem)
  5003  	// result: (MOVWstore [off] {sym} ptr x mem)
  5004  	for {
  5005  		off := auxIntToInt32(v.AuxInt)
  5006  		sym := auxToSym(v.Aux)
  5007  		ptr := v_0
  5008  		if v_1.Op != OpLOONG64MOVWUreg {
  5009  			break
  5010  		}
  5011  		x := v_1.Args[0]
  5012  		mem := v_2
  5013  		v.reset(OpLOONG64MOVWstore)
  5014  		v.AuxInt = int32ToAuxInt(off)
  5015  		v.Aux = symToAux(sym)
  5016  		v.AddArg3(ptr, x, mem)
  5017  		return true
  5018  	}
  5019  	// match: (MOVWstore [off] {sym} ptr (MOVVconst [0]) mem)
  5020  	// result: (MOVWstorezero [off] {sym} ptr mem)
  5021  	for {
  5022  		off := auxIntToInt32(v.AuxInt)
  5023  		sym := auxToSym(v.Aux)
  5024  		ptr := v_0
  5025  		if v_1.Op != OpLOONG64MOVVconst || auxIntToInt64(v_1.AuxInt) != 0 {
  5026  			break
  5027  		}
  5028  		mem := v_2
  5029  		v.reset(OpLOONG64MOVWstorezero)
  5030  		v.AuxInt = int32ToAuxInt(off)
  5031  		v.Aux = symToAux(sym)
  5032  		v.AddArg2(ptr, mem)
  5033  		return true
  5034  	}
  5035  	// match: (MOVWstore [off] {sym} (ADDV ptr idx) val mem)
  5036  	// cond: off == 0 && sym == nil
  5037  	// result: (MOVWstoreidx ptr idx val mem)
  5038  	for {
  5039  		off := auxIntToInt32(v.AuxInt)
  5040  		sym := auxToSym(v.Aux)
  5041  		if v_0.Op != OpLOONG64ADDV {
  5042  			break
  5043  		}
  5044  		idx := v_0.Args[1]
  5045  		ptr := v_0.Args[0]
  5046  		val := v_1
  5047  		mem := v_2
  5048  		if !(off == 0 && sym == nil) {
  5049  			break
  5050  		}
  5051  		v.reset(OpLOONG64MOVWstoreidx)
  5052  		v.AddArg4(ptr, idx, val, mem)
  5053  		return true
  5054  	}
  5055  	return false
  5056  }
  5057  func rewriteValueLOONG64_OpLOONG64MOVWstoreidx(v *Value) bool {
  5058  	v_3 := v.Args[3]
  5059  	v_2 := v.Args[2]
  5060  	v_1 := v.Args[1]
  5061  	v_0 := v.Args[0]
  5062  	// match: (MOVWstoreidx ptr (MOVVconst [c]) val mem)
  5063  	// cond: is32Bit(c)
  5064  	// result: (MOVWstore [int32(c)] ptr val mem)
  5065  	for {
  5066  		ptr := v_0
  5067  		if v_1.Op != OpLOONG64MOVVconst {
  5068  			break
  5069  		}
  5070  		c := auxIntToInt64(v_1.AuxInt)
  5071  		val := v_2
  5072  		mem := v_3
  5073  		if !(is32Bit(c)) {
  5074  			break
  5075  		}
  5076  		v.reset(OpLOONG64MOVWstore)
  5077  		v.AuxInt = int32ToAuxInt(int32(c))
  5078  		v.AddArg3(ptr, val, mem)
  5079  		return true
  5080  	}
  5081  	// match: (MOVWstoreidx (MOVVconst [c]) idx val mem)
  5082  	// cond: is32Bit(c)
  5083  	// result: (MOVWstore [int32(c)] idx val mem)
  5084  	for {
  5085  		if v_0.Op != OpLOONG64MOVVconst {
  5086  			break
  5087  		}
  5088  		c := auxIntToInt64(v_0.AuxInt)
  5089  		idx := v_1
  5090  		val := v_2
  5091  		mem := v_3
  5092  		if !(is32Bit(c)) {
  5093  			break
  5094  		}
  5095  		v.reset(OpLOONG64MOVWstore)
  5096  		v.AuxInt = int32ToAuxInt(int32(c))
  5097  		v.AddArg3(idx, val, mem)
  5098  		return true
  5099  	}
  5100  	// match: (MOVWstoreidx ptr idx (MOVVconst [0]) mem)
  5101  	// result: (MOVWstorezeroidx ptr idx mem)
  5102  	for {
  5103  		ptr := v_0
  5104  		idx := v_1
  5105  		if v_2.Op != OpLOONG64MOVVconst || auxIntToInt64(v_2.AuxInt) != 0 {
  5106  			break
  5107  		}
  5108  		mem := v_3
  5109  		v.reset(OpLOONG64MOVWstorezeroidx)
  5110  		v.AddArg3(ptr, idx, mem)
  5111  		return true
  5112  	}
  5113  	return false
  5114  }
  5115  func rewriteValueLOONG64_OpLOONG64MOVWstorezero(v *Value) bool {
  5116  	v_1 := v.Args[1]
  5117  	v_0 := v.Args[0]
  5118  	b := v.Block
  5119  	config := b.Func.Config
  5120  	// match: (MOVWstorezero [off1] {sym} (ADDVconst [off2] ptr) mem)
  5121  	// cond: is32Bit(int64(off1)+off2) && (ptr.Op != OpSB || !config.ctxt.Flag_dynlink)
  5122  	// result: (MOVWstorezero [off1+int32(off2)] {sym} ptr mem)
  5123  	for {
  5124  		off1 := auxIntToInt32(v.AuxInt)
  5125  		sym := auxToSym(v.Aux)
  5126  		if v_0.Op != OpLOONG64ADDVconst {
  5127  			break
  5128  		}
  5129  		off2 := auxIntToInt64(v_0.AuxInt)
  5130  		ptr := v_0.Args[0]
  5131  		mem := v_1
  5132  		if !(is32Bit(int64(off1)+off2) && (ptr.Op != OpSB || !config.ctxt.Flag_dynlink)) {
  5133  			break
  5134  		}
  5135  		v.reset(OpLOONG64MOVWstorezero)
  5136  		v.AuxInt = int32ToAuxInt(off1 + int32(off2))
  5137  		v.Aux = symToAux(sym)
  5138  		v.AddArg2(ptr, mem)
  5139  		return true
  5140  	}
  5141  	// match: (MOVWstorezero [off1] {sym1} (MOVVaddr [off2] {sym2} ptr) mem)
  5142  	// cond: canMergeSym(sym1,sym2) && is32Bit(int64(off1)+int64(off2)) && (ptr.Op != OpSB || !config.ctxt.Flag_dynlink)
  5143  	// result: (MOVWstorezero [off1+int32(off2)] {mergeSym(sym1,sym2)} ptr mem)
  5144  	for {
  5145  		off1 := auxIntToInt32(v.AuxInt)
  5146  		sym1 := auxToSym(v.Aux)
  5147  		if v_0.Op != OpLOONG64MOVVaddr {
  5148  			break
  5149  		}
  5150  		off2 := auxIntToInt32(v_0.AuxInt)
  5151  		sym2 := auxToSym(v_0.Aux)
  5152  		ptr := v_0.Args[0]
  5153  		mem := v_1
  5154  		if !(canMergeSym(sym1, sym2) && is32Bit(int64(off1)+int64(off2)) && (ptr.Op != OpSB || !config.ctxt.Flag_dynlink)) {
  5155  			break
  5156  		}
  5157  		v.reset(OpLOONG64MOVWstorezero)
  5158  		v.AuxInt = int32ToAuxInt(off1 + int32(off2))
  5159  		v.Aux = symToAux(mergeSym(sym1, sym2))
  5160  		v.AddArg2(ptr, mem)
  5161  		return true
  5162  	}
  5163  	// match: (MOVWstorezero [off] {sym} (ADDV ptr idx) mem)
  5164  	// cond: off == 0 && sym == nil
  5165  	// result: (MOVWstorezeroidx ptr idx mem)
  5166  	for {
  5167  		off := auxIntToInt32(v.AuxInt)
  5168  		sym := auxToSym(v.Aux)
  5169  		if v_0.Op != OpLOONG64ADDV {
  5170  			break
  5171  		}
  5172  		idx := v_0.Args[1]
  5173  		ptr := v_0.Args[0]
  5174  		mem := v_1
  5175  		if !(off == 0 && sym == nil) {
  5176  			break
  5177  		}
  5178  		v.reset(OpLOONG64MOVWstorezeroidx)
  5179  		v.AddArg3(ptr, idx, mem)
  5180  		return true
  5181  	}
  5182  	return false
  5183  }
  5184  func rewriteValueLOONG64_OpLOONG64MOVWstorezeroidx(v *Value) bool {
  5185  	v_2 := v.Args[2]
  5186  	v_1 := v.Args[1]
  5187  	v_0 := v.Args[0]
  5188  	// match: (MOVWstorezeroidx ptr (MOVVconst [c]) mem)
  5189  	// cond: is32Bit(c)
  5190  	// result: (MOVWstorezero [int32(c)] ptr mem)
  5191  	for {
  5192  		ptr := v_0
  5193  		if v_1.Op != OpLOONG64MOVVconst {
  5194  			break
  5195  		}
  5196  		c := auxIntToInt64(v_1.AuxInt)
  5197  		mem := v_2
  5198  		if !(is32Bit(c)) {
  5199  			break
  5200  		}
  5201  		v.reset(OpLOONG64MOVWstorezero)
  5202  		v.AuxInt = int32ToAuxInt(int32(c))
  5203  		v.AddArg2(ptr, mem)
  5204  		return true
  5205  	}
  5206  	// match: (MOVWstorezeroidx (MOVVconst [c]) idx mem)
  5207  	// cond: is32Bit(c)
  5208  	// result: (MOVWstorezero [int32(c)] idx mem)
  5209  	for {
  5210  		if v_0.Op != OpLOONG64MOVVconst {
  5211  			break
  5212  		}
  5213  		c := auxIntToInt64(v_0.AuxInt)
  5214  		idx := v_1
  5215  		mem := v_2
  5216  		if !(is32Bit(c)) {
  5217  			break
  5218  		}
  5219  		v.reset(OpLOONG64MOVWstorezero)
  5220  		v.AuxInt = int32ToAuxInt(int32(c))
  5221  		v.AddArg2(idx, mem)
  5222  		return true
  5223  	}
  5224  	return false
  5225  }
  5226  func rewriteValueLOONG64_OpLOONG64MULV(v *Value) bool {
  5227  	v_1 := v.Args[1]
  5228  	v_0 := v.Args[0]
  5229  	// match: (MULV x (MOVVconst [-1]))
  5230  	// result: (NEGV x)
  5231  	for {
  5232  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
  5233  			x := v_0
  5234  			if v_1.Op != OpLOONG64MOVVconst || auxIntToInt64(v_1.AuxInt) != -1 {
  5235  				continue
  5236  			}
  5237  			v.reset(OpLOONG64NEGV)
  5238  			v.AddArg(x)
  5239  			return true
  5240  		}
  5241  		break
  5242  	}
  5243  	// match: (MULV _ (MOVVconst [0]))
  5244  	// result: (MOVVconst [0])
  5245  	for {
  5246  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
  5247  			if v_1.Op != OpLOONG64MOVVconst || auxIntToInt64(v_1.AuxInt) != 0 {
  5248  				continue
  5249  			}
  5250  			v.reset(OpLOONG64MOVVconst)
  5251  			v.AuxInt = int64ToAuxInt(0)
  5252  			return true
  5253  		}
  5254  		break
  5255  	}
  5256  	// match: (MULV x (MOVVconst [1]))
  5257  	// result: x
  5258  	for {
  5259  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
  5260  			x := v_0
  5261  			if v_1.Op != OpLOONG64MOVVconst || auxIntToInt64(v_1.AuxInt) != 1 {
  5262  				continue
  5263  			}
  5264  			v.copyOf(x)
  5265  			return true
  5266  		}
  5267  		break
  5268  	}
  5269  	// match: (MULV x (MOVVconst [c]))
  5270  	// cond: isPowerOfTwo(c)
  5271  	// result: (SLLVconst [log64(c)] x)
  5272  	for {
  5273  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
  5274  			x := v_0
  5275  			if v_1.Op != OpLOONG64MOVVconst {
  5276  				continue
  5277  			}
  5278  			c := auxIntToInt64(v_1.AuxInt)
  5279  			if !(isPowerOfTwo(c)) {
  5280  				continue
  5281  			}
  5282  			v.reset(OpLOONG64SLLVconst)
  5283  			v.AuxInt = int64ToAuxInt(log64(c))
  5284  			v.AddArg(x)
  5285  			return true
  5286  		}
  5287  		break
  5288  	}
  5289  	// match: (MULV (MOVVconst [c]) (MOVVconst [d]))
  5290  	// result: (MOVVconst [c*d])
  5291  	for {
  5292  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
  5293  			if v_0.Op != OpLOONG64MOVVconst {
  5294  				continue
  5295  			}
  5296  			c := auxIntToInt64(v_0.AuxInt)
  5297  			if v_1.Op != OpLOONG64MOVVconst {
  5298  				continue
  5299  			}
  5300  			d := auxIntToInt64(v_1.AuxInt)
  5301  			v.reset(OpLOONG64MOVVconst)
  5302  			v.AuxInt = int64ToAuxInt(c * d)
  5303  			return true
  5304  		}
  5305  		break
  5306  	}
  5307  	return false
  5308  }
  5309  func rewriteValueLOONG64_OpLOONG64NEGV(v *Value) bool {
  5310  	v_0 := v.Args[0]
  5311  	// match: (NEGV (MOVVconst [c]))
  5312  	// result: (MOVVconst [-c])
  5313  	for {
  5314  		if v_0.Op != OpLOONG64MOVVconst {
  5315  			break
  5316  		}
  5317  		c := auxIntToInt64(v_0.AuxInt)
  5318  		v.reset(OpLOONG64MOVVconst)
  5319  		v.AuxInt = int64ToAuxInt(-c)
  5320  		return true
  5321  	}
  5322  	return false
  5323  }
  5324  func rewriteValueLOONG64_OpLOONG64NOR(v *Value) bool {
  5325  	v_1 := v.Args[1]
  5326  	v_0 := v.Args[0]
  5327  	// match: (NOR x (MOVVconst [c]))
  5328  	// cond: is32Bit(c)
  5329  	// result: (NORconst [c] x)
  5330  	for {
  5331  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
  5332  			x := v_0
  5333  			if v_1.Op != OpLOONG64MOVVconst {
  5334  				continue
  5335  			}
  5336  			c := auxIntToInt64(v_1.AuxInt)
  5337  			if !(is32Bit(c)) {
  5338  				continue
  5339  			}
  5340  			v.reset(OpLOONG64NORconst)
  5341  			v.AuxInt = int64ToAuxInt(c)
  5342  			v.AddArg(x)
  5343  			return true
  5344  		}
  5345  		break
  5346  	}
  5347  	return false
  5348  }
  5349  func rewriteValueLOONG64_OpLOONG64NORconst(v *Value) bool {
  5350  	v_0 := v.Args[0]
  5351  	// match: (NORconst [c] (MOVVconst [d]))
  5352  	// result: (MOVVconst [^(c|d)])
  5353  	for {
  5354  		c := auxIntToInt64(v.AuxInt)
  5355  		if v_0.Op != OpLOONG64MOVVconst {
  5356  			break
  5357  		}
  5358  		d := auxIntToInt64(v_0.AuxInt)
  5359  		v.reset(OpLOONG64MOVVconst)
  5360  		v.AuxInt = int64ToAuxInt(^(c | d))
  5361  		return true
  5362  	}
  5363  	return false
  5364  }
  5365  func rewriteValueLOONG64_OpLOONG64OR(v *Value) bool {
  5366  	v_1 := v.Args[1]
  5367  	v_0 := v.Args[0]
  5368  	// match: (OR x (MOVVconst [c]))
  5369  	// cond: is32Bit(c)
  5370  	// result: (ORconst [c] x)
  5371  	for {
  5372  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
  5373  			x := v_0
  5374  			if v_1.Op != OpLOONG64MOVVconst {
  5375  				continue
  5376  			}
  5377  			c := auxIntToInt64(v_1.AuxInt)
  5378  			if !(is32Bit(c)) {
  5379  				continue
  5380  			}
  5381  			v.reset(OpLOONG64ORconst)
  5382  			v.AuxInt = int64ToAuxInt(c)
  5383  			v.AddArg(x)
  5384  			return true
  5385  		}
  5386  		break
  5387  	}
  5388  	// match: (OR x x)
  5389  	// result: x
  5390  	for {
  5391  		x := v_0
  5392  		if x != v_1 {
  5393  			break
  5394  		}
  5395  		v.copyOf(x)
  5396  		return true
  5397  	}
  5398  	return false
  5399  }
  5400  func rewriteValueLOONG64_OpLOONG64ORconst(v *Value) bool {
  5401  	v_0 := v.Args[0]
  5402  	// match: (ORconst [0] x)
  5403  	// result: x
  5404  	for {
  5405  		if auxIntToInt64(v.AuxInt) != 0 {
  5406  			break
  5407  		}
  5408  		x := v_0
  5409  		v.copyOf(x)
  5410  		return true
  5411  	}
  5412  	// match: (ORconst [-1] _)
  5413  	// result: (MOVVconst [-1])
  5414  	for {
  5415  		if auxIntToInt64(v.AuxInt) != -1 {
  5416  			break
  5417  		}
  5418  		v.reset(OpLOONG64MOVVconst)
  5419  		v.AuxInt = int64ToAuxInt(-1)
  5420  		return true
  5421  	}
  5422  	// match: (ORconst [c] (MOVVconst [d]))
  5423  	// result: (MOVVconst [c|d])
  5424  	for {
  5425  		c := auxIntToInt64(v.AuxInt)
  5426  		if v_0.Op != OpLOONG64MOVVconst {
  5427  			break
  5428  		}
  5429  		d := auxIntToInt64(v_0.AuxInt)
  5430  		v.reset(OpLOONG64MOVVconst)
  5431  		v.AuxInt = int64ToAuxInt(c | d)
  5432  		return true
  5433  	}
  5434  	// match: (ORconst [c] (ORconst [d] x))
  5435  	// cond: is32Bit(c|d)
  5436  	// result: (ORconst [c|d] x)
  5437  	for {
  5438  		c := auxIntToInt64(v.AuxInt)
  5439  		if v_0.Op != OpLOONG64ORconst {
  5440  			break
  5441  		}
  5442  		d := auxIntToInt64(v_0.AuxInt)
  5443  		x := v_0.Args[0]
  5444  		if !(is32Bit(c | d)) {
  5445  			break
  5446  		}
  5447  		v.reset(OpLOONG64ORconst)
  5448  		v.AuxInt = int64ToAuxInt(c | d)
  5449  		v.AddArg(x)
  5450  		return true
  5451  	}
  5452  	return false
  5453  }
  5454  func rewriteValueLOONG64_OpLOONG64REMV(v *Value) bool {
  5455  	v_1 := v.Args[1]
  5456  	v_0 := v.Args[0]
  5457  	// match: (REMV (MOVVconst [c]) (MOVVconst [d]))
  5458  	// cond: d != 0
  5459  	// result: (MOVVconst [c%d])
  5460  	for {
  5461  		if v_0.Op != OpLOONG64MOVVconst {
  5462  			break
  5463  		}
  5464  		c := auxIntToInt64(v_0.AuxInt)
  5465  		if v_1.Op != OpLOONG64MOVVconst {
  5466  			break
  5467  		}
  5468  		d := auxIntToInt64(v_1.AuxInt)
  5469  		if !(d != 0) {
  5470  			break
  5471  		}
  5472  		v.reset(OpLOONG64MOVVconst)
  5473  		v.AuxInt = int64ToAuxInt(c % d)
  5474  		return true
  5475  	}
  5476  	return false
  5477  }
  5478  func rewriteValueLOONG64_OpLOONG64REMVU(v *Value) bool {
  5479  	v_1 := v.Args[1]
  5480  	v_0 := v.Args[0]
  5481  	// match: (REMVU _ (MOVVconst [1]))
  5482  	// result: (MOVVconst [0])
  5483  	for {
  5484  		if v_1.Op != OpLOONG64MOVVconst || auxIntToInt64(v_1.AuxInt) != 1 {
  5485  			break
  5486  		}
  5487  		v.reset(OpLOONG64MOVVconst)
  5488  		v.AuxInt = int64ToAuxInt(0)
  5489  		return true
  5490  	}
  5491  	// match: (REMVU x (MOVVconst [c]))
  5492  	// cond: isPowerOfTwo(c)
  5493  	// result: (ANDconst [c-1] x)
  5494  	for {
  5495  		x := v_0
  5496  		if v_1.Op != OpLOONG64MOVVconst {
  5497  			break
  5498  		}
  5499  		c := auxIntToInt64(v_1.AuxInt)
  5500  		if !(isPowerOfTwo(c)) {
  5501  			break
  5502  		}
  5503  		v.reset(OpLOONG64ANDconst)
  5504  		v.AuxInt = int64ToAuxInt(c - 1)
  5505  		v.AddArg(x)
  5506  		return true
  5507  	}
  5508  	// match: (REMVU (MOVVconst [c]) (MOVVconst [d]))
  5509  	// cond: d != 0
  5510  	// result: (MOVVconst [int64(uint64(c)%uint64(d))])
  5511  	for {
  5512  		if v_0.Op != OpLOONG64MOVVconst {
  5513  			break
  5514  		}
  5515  		c := auxIntToInt64(v_0.AuxInt)
  5516  		if v_1.Op != OpLOONG64MOVVconst {
  5517  			break
  5518  		}
  5519  		d := auxIntToInt64(v_1.AuxInt)
  5520  		if !(d != 0) {
  5521  			break
  5522  		}
  5523  		v.reset(OpLOONG64MOVVconst)
  5524  		v.AuxInt = int64ToAuxInt(int64(uint64(c) % uint64(d)))
  5525  		return true
  5526  	}
  5527  	return false
  5528  }
  5529  func rewriteValueLOONG64_OpLOONG64ROTR(v *Value) bool {
  5530  	v_1 := v.Args[1]
  5531  	v_0 := v.Args[0]
  5532  	// match: (ROTR x (MOVVconst [c]))
  5533  	// result: (ROTRconst x [c&31])
  5534  	for {
  5535  		x := v_0
  5536  		if v_1.Op != OpLOONG64MOVVconst {
  5537  			break
  5538  		}
  5539  		c := auxIntToInt64(v_1.AuxInt)
  5540  		v.reset(OpLOONG64ROTRconst)
  5541  		v.AuxInt = int64ToAuxInt(c & 31)
  5542  		v.AddArg(x)
  5543  		return true
  5544  	}
  5545  	return false
  5546  }
  5547  func rewriteValueLOONG64_OpLOONG64ROTRV(v *Value) bool {
  5548  	v_1 := v.Args[1]
  5549  	v_0 := v.Args[0]
  5550  	// match: (ROTRV x (MOVVconst [c]))
  5551  	// result: (ROTRVconst x [c&63])
  5552  	for {
  5553  		x := v_0
  5554  		if v_1.Op != OpLOONG64MOVVconst {
  5555  			break
  5556  		}
  5557  		c := auxIntToInt64(v_1.AuxInt)
  5558  		v.reset(OpLOONG64ROTRVconst)
  5559  		v.AuxInt = int64ToAuxInt(c & 63)
  5560  		v.AddArg(x)
  5561  		return true
  5562  	}
  5563  	return false
  5564  }
  5565  func rewriteValueLOONG64_OpLOONG64SGT(v *Value) bool {
  5566  	v_1 := v.Args[1]
  5567  	v_0 := v.Args[0]
  5568  	b := v.Block
  5569  	typ := &b.Func.Config.Types
  5570  	// match: (SGT (MOVVconst [c]) (NEGV (SUBVconst [d] x)))
  5571  	// cond: is32Bit(d-c)
  5572  	// result: (SGT x (MOVVconst [d-c]))
  5573  	for {
  5574  		if v_0.Op != OpLOONG64MOVVconst {
  5575  			break
  5576  		}
  5577  		c := auxIntToInt64(v_0.AuxInt)
  5578  		if v_1.Op != OpLOONG64NEGV {
  5579  			break
  5580  		}
  5581  		v_1_0 := v_1.Args[0]
  5582  		if v_1_0.Op != OpLOONG64SUBVconst {
  5583  			break
  5584  		}
  5585  		d := auxIntToInt64(v_1_0.AuxInt)
  5586  		x := v_1_0.Args[0]
  5587  		if !(is32Bit(d - c)) {
  5588  			break
  5589  		}
  5590  		v.reset(OpLOONG64SGT)
  5591  		v0 := b.NewValue0(v.Pos, OpLOONG64MOVVconst, typ.UInt64)
  5592  		v0.AuxInt = int64ToAuxInt(d - c)
  5593  		v.AddArg2(x, v0)
  5594  		return true
  5595  	}
  5596  	// match: (SGT (MOVVconst [c]) x)
  5597  	// cond: is32Bit(c)
  5598  	// result: (SGTconst [c] x)
  5599  	for {
  5600  		if v_0.Op != OpLOONG64MOVVconst {
  5601  			break
  5602  		}
  5603  		c := auxIntToInt64(v_0.AuxInt)
  5604  		x := v_1
  5605  		if !(is32Bit(c)) {
  5606  			break
  5607  		}
  5608  		v.reset(OpLOONG64SGTconst)
  5609  		v.AuxInt = int64ToAuxInt(c)
  5610  		v.AddArg(x)
  5611  		return true
  5612  	}
  5613  	// match: (SGT x x)
  5614  	// result: (MOVVconst [0])
  5615  	for {
  5616  		x := v_0
  5617  		if x != v_1 {
  5618  			break
  5619  		}
  5620  		v.reset(OpLOONG64MOVVconst)
  5621  		v.AuxInt = int64ToAuxInt(0)
  5622  		return true
  5623  	}
  5624  	return false
  5625  }
  5626  func rewriteValueLOONG64_OpLOONG64SGTU(v *Value) bool {
  5627  	v_1 := v.Args[1]
  5628  	v_0 := v.Args[0]
  5629  	// match: (SGTU (MOVVconst [c]) x)
  5630  	// cond: is32Bit(c)
  5631  	// result: (SGTUconst [c] x)
  5632  	for {
  5633  		if v_0.Op != OpLOONG64MOVVconst {
  5634  			break
  5635  		}
  5636  		c := auxIntToInt64(v_0.AuxInt)
  5637  		x := v_1
  5638  		if !(is32Bit(c)) {
  5639  			break
  5640  		}
  5641  		v.reset(OpLOONG64SGTUconst)
  5642  		v.AuxInt = int64ToAuxInt(c)
  5643  		v.AddArg(x)
  5644  		return true
  5645  	}
  5646  	// match: (SGTU x x)
  5647  	// result: (MOVVconst [0])
  5648  	for {
  5649  		x := v_0
  5650  		if x != v_1 {
  5651  			break
  5652  		}
  5653  		v.reset(OpLOONG64MOVVconst)
  5654  		v.AuxInt = int64ToAuxInt(0)
  5655  		return true
  5656  	}
  5657  	return false
  5658  }
  5659  func rewriteValueLOONG64_OpLOONG64SGTUconst(v *Value) bool {
  5660  	v_0 := v.Args[0]
  5661  	// match: (SGTUconst [c] (MOVVconst [d]))
  5662  	// cond: uint64(c)>uint64(d)
  5663  	// result: (MOVVconst [1])
  5664  	for {
  5665  		c := auxIntToInt64(v.AuxInt)
  5666  		if v_0.Op != OpLOONG64MOVVconst {
  5667  			break
  5668  		}
  5669  		d := auxIntToInt64(v_0.AuxInt)
  5670  		if !(uint64(c) > uint64(d)) {
  5671  			break
  5672  		}
  5673  		v.reset(OpLOONG64MOVVconst)
  5674  		v.AuxInt = int64ToAuxInt(1)
  5675  		return true
  5676  	}
  5677  	// match: (SGTUconst [c] (MOVVconst [d]))
  5678  	// cond: uint64(c)<=uint64(d)
  5679  	// result: (MOVVconst [0])
  5680  	for {
  5681  		c := auxIntToInt64(v.AuxInt)
  5682  		if v_0.Op != OpLOONG64MOVVconst {
  5683  			break
  5684  		}
  5685  		d := auxIntToInt64(v_0.AuxInt)
  5686  		if !(uint64(c) <= uint64(d)) {
  5687  			break
  5688  		}
  5689  		v.reset(OpLOONG64MOVVconst)
  5690  		v.AuxInt = int64ToAuxInt(0)
  5691  		return true
  5692  	}
  5693  	// match: (SGTUconst [c] (MOVBUreg _))
  5694  	// cond: 0xff < uint64(c)
  5695  	// result: (MOVVconst [1])
  5696  	for {
  5697  		c := auxIntToInt64(v.AuxInt)
  5698  		if v_0.Op != OpLOONG64MOVBUreg || !(0xff < uint64(c)) {
  5699  			break
  5700  		}
  5701  		v.reset(OpLOONG64MOVVconst)
  5702  		v.AuxInt = int64ToAuxInt(1)
  5703  		return true
  5704  	}
  5705  	// match: (SGTUconst [c] (MOVHUreg _))
  5706  	// cond: 0xffff < uint64(c)
  5707  	// result: (MOVVconst [1])
  5708  	for {
  5709  		c := auxIntToInt64(v.AuxInt)
  5710  		if v_0.Op != OpLOONG64MOVHUreg || !(0xffff < uint64(c)) {
  5711  			break
  5712  		}
  5713  		v.reset(OpLOONG64MOVVconst)
  5714  		v.AuxInt = int64ToAuxInt(1)
  5715  		return true
  5716  	}
  5717  	// match: (SGTUconst [c] (ANDconst [m] _))
  5718  	// cond: uint64(m) < uint64(c)
  5719  	// result: (MOVVconst [1])
  5720  	for {
  5721  		c := auxIntToInt64(v.AuxInt)
  5722  		if v_0.Op != OpLOONG64ANDconst {
  5723  			break
  5724  		}
  5725  		m := auxIntToInt64(v_0.AuxInt)
  5726  		if !(uint64(m) < uint64(c)) {
  5727  			break
  5728  		}
  5729  		v.reset(OpLOONG64MOVVconst)
  5730  		v.AuxInt = int64ToAuxInt(1)
  5731  		return true
  5732  	}
  5733  	// match: (SGTUconst [c] (SRLVconst _ [d]))
  5734  	// cond: 0 < d && d <= 63 && 0xffffffffffffffff>>uint64(d) < uint64(c)
  5735  	// result: (MOVVconst [1])
  5736  	for {
  5737  		c := auxIntToInt64(v.AuxInt)
  5738  		if v_0.Op != OpLOONG64SRLVconst {
  5739  			break
  5740  		}
  5741  		d := auxIntToInt64(v_0.AuxInt)
  5742  		if !(0 < d && d <= 63 && 0xffffffffffffffff>>uint64(d) < uint64(c)) {
  5743  			break
  5744  		}
  5745  		v.reset(OpLOONG64MOVVconst)
  5746  		v.AuxInt = int64ToAuxInt(1)
  5747  		return true
  5748  	}
  5749  	return false
  5750  }
  5751  func rewriteValueLOONG64_OpLOONG64SGTconst(v *Value) bool {
  5752  	v_0 := v.Args[0]
  5753  	// match: (SGTconst [c] (MOVVconst [d]))
  5754  	// cond: c>d
  5755  	// result: (MOVVconst [1])
  5756  	for {
  5757  		c := auxIntToInt64(v.AuxInt)
  5758  		if v_0.Op != OpLOONG64MOVVconst {
  5759  			break
  5760  		}
  5761  		d := auxIntToInt64(v_0.AuxInt)
  5762  		if !(c > d) {
  5763  			break
  5764  		}
  5765  		v.reset(OpLOONG64MOVVconst)
  5766  		v.AuxInt = int64ToAuxInt(1)
  5767  		return true
  5768  	}
  5769  	// match: (SGTconst [c] (MOVVconst [d]))
  5770  	// cond: c<=d
  5771  	// result: (MOVVconst [0])
  5772  	for {
  5773  		c := auxIntToInt64(v.AuxInt)
  5774  		if v_0.Op != OpLOONG64MOVVconst {
  5775  			break
  5776  		}
  5777  		d := auxIntToInt64(v_0.AuxInt)
  5778  		if !(c <= d) {
  5779  			break
  5780  		}
  5781  		v.reset(OpLOONG64MOVVconst)
  5782  		v.AuxInt = int64ToAuxInt(0)
  5783  		return true
  5784  	}
  5785  	// match: (SGTconst [c] (MOVBreg _))
  5786  	// cond: 0x7f < c
  5787  	// result: (MOVVconst [1])
  5788  	for {
  5789  		c := auxIntToInt64(v.AuxInt)
  5790  		if v_0.Op != OpLOONG64MOVBreg || !(0x7f < c) {
  5791  			break
  5792  		}
  5793  		v.reset(OpLOONG64MOVVconst)
  5794  		v.AuxInt = int64ToAuxInt(1)
  5795  		return true
  5796  	}
  5797  	// match: (SGTconst [c] (MOVBreg _))
  5798  	// cond: c <= -0x80
  5799  	// result: (MOVVconst [0])
  5800  	for {
  5801  		c := auxIntToInt64(v.AuxInt)
  5802  		if v_0.Op != OpLOONG64MOVBreg || !(c <= -0x80) {
  5803  			break
  5804  		}
  5805  		v.reset(OpLOONG64MOVVconst)
  5806  		v.AuxInt = int64ToAuxInt(0)
  5807  		return true
  5808  	}
  5809  	// match: (SGTconst [c] (MOVBUreg _))
  5810  	// cond: 0xff < c
  5811  	// result: (MOVVconst [1])
  5812  	for {
  5813  		c := auxIntToInt64(v.AuxInt)
  5814  		if v_0.Op != OpLOONG64MOVBUreg || !(0xff < c) {
  5815  			break
  5816  		}
  5817  		v.reset(OpLOONG64MOVVconst)
  5818  		v.AuxInt = int64ToAuxInt(1)
  5819  		return true
  5820  	}
  5821  	// match: (SGTconst [c] (MOVBUreg _))
  5822  	// cond: c < 0
  5823  	// result: (MOVVconst [0])
  5824  	for {
  5825  		c := auxIntToInt64(v.AuxInt)
  5826  		if v_0.Op != OpLOONG64MOVBUreg || !(c < 0) {
  5827  			break
  5828  		}
  5829  		v.reset(OpLOONG64MOVVconst)
  5830  		v.AuxInt = int64ToAuxInt(0)
  5831  		return true
  5832  	}
  5833  	// match: (SGTconst [c] (MOVHreg _))
  5834  	// cond: 0x7fff < c
  5835  	// result: (MOVVconst [1])
  5836  	for {
  5837  		c := auxIntToInt64(v.AuxInt)
  5838  		if v_0.Op != OpLOONG64MOVHreg || !(0x7fff < c) {
  5839  			break
  5840  		}
  5841  		v.reset(OpLOONG64MOVVconst)
  5842  		v.AuxInt = int64ToAuxInt(1)
  5843  		return true
  5844  	}
  5845  	// match: (SGTconst [c] (MOVHreg _))
  5846  	// cond: c <= -0x8000
  5847  	// result: (MOVVconst [0])
  5848  	for {
  5849  		c := auxIntToInt64(v.AuxInt)
  5850  		if v_0.Op != OpLOONG64MOVHreg || !(c <= -0x8000) {
  5851  			break
  5852  		}
  5853  		v.reset(OpLOONG64MOVVconst)
  5854  		v.AuxInt = int64ToAuxInt(0)
  5855  		return true
  5856  	}
  5857  	// match: (SGTconst [c] (MOVHUreg _))
  5858  	// cond: 0xffff < c
  5859  	// result: (MOVVconst [1])
  5860  	for {
  5861  		c := auxIntToInt64(v.AuxInt)
  5862  		if v_0.Op != OpLOONG64MOVHUreg || !(0xffff < c) {
  5863  			break
  5864  		}
  5865  		v.reset(OpLOONG64MOVVconst)
  5866  		v.AuxInt = int64ToAuxInt(1)
  5867  		return true
  5868  	}
  5869  	// match: (SGTconst [c] (MOVHUreg _))
  5870  	// cond: c < 0
  5871  	// result: (MOVVconst [0])
  5872  	for {
  5873  		c := auxIntToInt64(v.AuxInt)
  5874  		if v_0.Op != OpLOONG64MOVHUreg || !(c < 0) {
  5875  			break
  5876  		}
  5877  		v.reset(OpLOONG64MOVVconst)
  5878  		v.AuxInt = int64ToAuxInt(0)
  5879  		return true
  5880  	}
  5881  	// match: (SGTconst [c] (MOVWUreg _))
  5882  	// cond: c < 0
  5883  	// result: (MOVVconst [0])
  5884  	for {
  5885  		c := auxIntToInt64(v.AuxInt)
  5886  		if v_0.Op != OpLOONG64MOVWUreg || !(c < 0) {
  5887  			break
  5888  		}
  5889  		v.reset(OpLOONG64MOVVconst)
  5890  		v.AuxInt = int64ToAuxInt(0)
  5891  		return true
  5892  	}
  5893  	// match: (SGTconst [c] (ANDconst [m] _))
  5894  	// cond: 0 <= m && m < c
  5895  	// result: (MOVVconst [1])
  5896  	for {
  5897  		c := auxIntToInt64(v.AuxInt)
  5898  		if v_0.Op != OpLOONG64ANDconst {
  5899  			break
  5900  		}
  5901  		m := auxIntToInt64(v_0.AuxInt)
  5902  		if !(0 <= m && m < c) {
  5903  			break
  5904  		}
  5905  		v.reset(OpLOONG64MOVVconst)
  5906  		v.AuxInt = int64ToAuxInt(1)
  5907  		return true
  5908  	}
  5909  	// match: (SGTconst [c] (SRLVconst _ [d]))
  5910  	// cond: 0 <= c && 0 < d && d <= 63 && 0xffffffffffffffff>>uint64(d) < uint64(c)
  5911  	// result: (MOVVconst [1])
  5912  	for {
  5913  		c := auxIntToInt64(v.AuxInt)
  5914  		if v_0.Op != OpLOONG64SRLVconst {
  5915  			break
  5916  		}
  5917  		d := auxIntToInt64(v_0.AuxInt)
  5918  		if !(0 <= c && 0 < d && d <= 63 && 0xffffffffffffffff>>uint64(d) < uint64(c)) {
  5919  			break
  5920  		}
  5921  		v.reset(OpLOONG64MOVVconst)
  5922  		v.AuxInt = int64ToAuxInt(1)
  5923  		return true
  5924  	}
  5925  	return false
  5926  }
  5927  func rewriteValueLOONG64_OpLOONG64SLLV(v *Value) bool {
  5928  	v_1 := v.Args[1]
  5929  	v_0 := v.Args[0]
  5930  	// match: (SLLV _ (MOVVconst [c]))
  5931  	// cond: uint64(c)>=64
  5932  	// result: (MOVVconst [0])
  5933  	for {
  5934  		if v_1.Op != OpLOONG64MOVVconst {
  5935  			break
  5936  		}
  5937  		c := auxIntToInt64(v_1.AuxInt)
  5938  		if !(uint64(c) >= 64) {
  5939  			break
  5940  		}
  5941  		v.reset(OpLOONG64MOVVconst)
  5942  		v.AuxInt = int64ToAuxInt(0)
  5943  		return true
  5944  	}
  5945  	// match: (SLLV x (MOVVconst [c]))
  5946  	// result: (SLLVconst x [c])
  5947  	for {
  5948  		x := v_0
  5949  		if v_1.Op != OpLOONG64MOVVconst {
  5950  			break
  5951  		}
  5952  		c := auxIntToInt64(v_1.AuxInt)
  5953  		v.reset(OpLOONG64SLLVconst)
  5954  		v.AuxInt = int64ToAuxInt(c)
  5955  		v.AddArg(x)
  5956  		return true
  5957  	}
  5958  	return false
  5959  }
  5960  func rewriteValueLOONG64_OpLOONG64SLLVconst(v *Value) bool {
  5961  	v_0 := v.Args[0]
  5962  	// match: (SLLVconst [c] (MOVVconst [d]))
  5963  	// result: (MOVVconst [d<<uint64(c)])
  5964  	for {
  5965  		c := auxIntToInt64(v.AuxInt)
  5966  		if v_0.Op != OpLOONG64MOVVconst {
  5967  			break
  5968  		}
  5969  		d := auxIntToInt64(v_0.AuxInt)
  5970  		v.reset(OpLOONG64MOVVconst)
  5971  		v.AuxInt = int64ToAuxInt(d << uint64(c))
  5972  		return true
  5973  	}
  5974  	return false
  5975  }
  5976  func rewriteValueLOONG64_OpLOONG64SRAV(v *Value) bool {
  5977  	v_1 := v.Args[1]
  5978  	v_0 := v.Args[0]
  5979  	// match: (SRAV x (MOVVconst [c]))
  5980  	// cond: uint64(c)>=64
  5981  	// result: (SRAVconst x [63])
  5982  	for {
  5983  		x := v_0
  5984  		if v_1.Op != OpLOONG64MOVVconst {
  5985  			break
  5986  		}
  5987  		c := auxIntToInt64(v_1.AuxInt)
  5988  		if !(uint64(c) >= 64) {
  5989  			break
  5990  		}
  5991  		v.reset(OpLOONG64SRAVconst)
  5992  		v.AuxInt = int64ToAuxInt(63)
  5993  		v.AddArg(x)
  5994  		return true
  5995  	}
  5996  	// match: (SRAV x (MOVVconst [c]))
  5997  	// result: (SRAVconst x [c])
  5998  	for {
  5999  		x := v_0
  6000  		if v_1.Op != OpLOONG64MOVVconst {
  6001  			break
  6002  		}
  6003  		c := auxIntToInt64(v_1.AuxInt)
  6004  		v.reset(OpLOONG64SRAVconst)
  6005  		v.AuxInt = int64ToAuxInt(c)
  6006  		v.AddArg(x)
  6007  		return true
  6008  	}
  6009  	return false
  6010  }
  6011  func rewriteValueLOONG64_OpLOONG64SRAVconst(v *Value) bool {
  6012  	v_0 := v.Args[0]
  6013  	// match: (SRAVconst [c] (MOVVconst [d]))
  6014  	// result: (MOVVconst [d>>uint64(c)])
  6015  	for {
  6016  		c := auxIntToInt64(v.AuxInt)
  6017  		if v_0.Op != OpLOONG64MOVVconst {
  6018  			break
  6019  		}
  6020  		d := auxIntToInt64(v_0.AuxInt)
  6021  		v.reset(OpLOONG64MOVVconst)
  6022  		v.AuxInt = int64ToAuxInt(d >> uint64(c))
  6023  		return true
  6024  	}
  6025  	return false
  6026  }
  6027  func rewriteValueLOONG64_OpLOONG64SRLV(v *Value) bool {
  6028  	v_1 := v.Args[1]
  6029  	v_0 := v.Args[0]
  6030  	// match: (SRLV _ (MOVVconst [c]))
  6031  	// cond: uint64(c)>=64
  6032  	// result: (MOVVconst [0])
  6033  	for {
  6034  		if v_1.Op != OpLOONG64MOVVconst {
  6035  			break
  6036  		}
  6037  		c := auxIntToInt64(v_1.AuxInt)
  6038  		if !(uint64(c) >= 64) {
  6039  			break
  6040  		}
  6041  		v.reset(OpLOONG64MOVVconst)
  6042  		v.AuxInt = int64ToAuxInt(0)
  6043  		return true
  6044  	}
  6045  	// match: (SRLV x (MOVVconst [c]))
  6046  	// result: (SRLVconst x [c])
  6047  	for {
  6048  		x := v_0
  6049  		if v_1.Op != OpLOONG64MOVVconst {
  6050  			break
  6051  		}
  6052  		c := auxIntToInt64(v_1.AuxInt)
  6053  		v.reset(OpLOONG64SRLVconst)
  6054  		v.AuxInt = int64ToAuxInt(c)
  6055  		v.AddArg(x)
  6056  		return true
  6057  	}
  6058  	return false
  6059  }
  6060  func rewriteValueLOONG64_OpLOONG64SRLVconst(v *Value) bool {
  6061  	v_0 := v.Args[0]
  6062  	// match: (SRLVconst [rc] (SLLVconst [lc] x))
  6063  	// cond: lc <= rc
  6064  	// result: (BSTRPICKV [rc-lc + ((64-lc)-1)<<6] x)
  6065  	for {
  6066  		rc := auxIntToInt64(v.AuxInt)
  6067  		if v_0.Op != OpLOONG64SLLVconst {
  6068  			break
  6069  		}
  6070  		lc := auxIntToInt64(v_0.AuxInt)
  6071  		x := v_0.Args[0]
  6072  		if !(lc <= rc) {
  6073  			break
  6074  		}
  6075  		v.reset(OpLOONG64BSTRPICKV)
  6076  		v.AuxInt = int64ToAuxInt(rc - lc + ((64-lc)-1)<<6)
  6077  		v.AddArg(x)
  6078  		return true
  6079  	}
  6080  	// match: (SRLVconst [rc] (MOVWUreg x))
  6081  	// cond: rc < 32
  6082  	// result: (BSTRPICKV [rc + 31<<6] x)
  6083  	for {
  6084  		rc := auxIntToInt64(v.AuxInt)
  6085  		if v_0.Op != OpLOONG64MOVWUreg {
  6086  			break
  6087  		}
  6088  		x := v_0.Args[0]
  6089  		if !(rc < 32) {
  6090  			break
  6091  		}
  6092  		v.reset(OpLOONG64BSTRPICKV)
  6093  		v.AuxInt = int64ToAuxInt(rc + 31<<6)
  6094  		v.AddArg(x)
  6095  		return true
  6096  	}
  6097  	// match: (SRLVconst [rc] (MOVHUreg x))
  6098  	// cond: rc < 16
  6099  	// result: (BSTRPICKV [rc + 15<<6] x)
  6100  	for {
  6101  		rc := auxIntToInt64(v.AuxInt)
  6102  		if v_0.Op != OpLOONG64MOVHUreg {
  6103  			break
  6104  		}
  6105  		x := v_0.Args[0]
  6106  		if !(rc < 16) {
  6107  			break
  6108  		}
  6109  		v.reset(OpLOONG64BSTRPICKV)
  6110  		v.AuxInt = int64ToAuxInt(rc + 15<<6)
  6111  		v.AddArg(x)
  6112  		return true
  6113  	}
  6114  	// match: (SRLVconst [rc] (MOVBUreg x))
  6115  	// cond: rc < 8
  6116  	// result: (BSTRPICKV [rc + 7<<6] x)
  6117  	for {
  6118  		rc := auxIntToInt64(v.AuxInt)
  6119  		if v_0.Op != OpLOONG64MOVBUreg {
  6120  			break
  6121  		}
  6122  		x := v_0.Args[0]
  6123  		if !(rc < 8) {
  6124  			break
  6125  		}
  6126  		v.reset(OpLOONG64BSTRPICKV)
  6127  		v.AuxInt = int64ToAuxInt(rc + 7<<6)
  6128  		v.AddArg(x)
  6129  		return true
  6130  	}
  6131  	// match: (SRLVconst [rc] (MOVWUreg x))
  6132  	// cond: rc >= 32
  6133  	// result: (MOVVconst [0])
  6134  	for {
  6135  		rc := auxIntToInt64(v.AuxInt)
  6136  		if v_0.Op != OpLOONG64MOVWUreg {
  6137  			break
  6138  		}
  6139  		if !(rc >= 32) {
  6140  			break
  6141  		}
  6142  		v.reset(OpLOONG64MOVVconst)
  6143  		v.AuxInt = int64ToAuxInt(0)
  6144  		return true
  6145  	}
  6146  	// match: (SRLVconst [rc] (MOVHUreg x))
  6147  	// cond: rc >= 16
  6148  	// result: (MOVVconst [0])
  6149  	for {
  6150  		rc := auxIntToInt64(v.AuxInt)
  6151  		if v_0.Op != OpLOONG64MOVHUreg {
  6152  			break
  6153  		}
  6154  		if !(rc >= 16) {
  6155  			break
  6156  		}
  6157  		v.reset(OpLOONG64MOVVconst)
  6158  		v.AuxInt = int64ToAuxInt(0)
  6159  		return true
  6160  	}
  6161  	// match: (SRLVconst [rc] (MOVBUreg x))
  6162  	// cond: rc >= 8
  6163  	// result: (MOVVconst [0])
  6164  	for {
  6165  		rc := auxIntToInt64(v.AuxInt)
  6166  		if v_0.Op != OpLOONG64MOVBUreg {
  6167  			break
  6168  		}
  6169  		if !(rc >= 8) {
  6170  			break
  6171  		}
  6172  		v.reset(OpLOONG64MOVVconst)
  6173  		v.AuxInt = int64ToAuxInt(0)
  6174  		return true
  6175  	}
  6176  	// match: (SRLVconst [c] (MOVVconst [d]))
  6177  	// result: (MOVVconst [int64(uint64(d)>>uint64(c))])
  6178  	for {
  6179  		c := auxIntToInt64(v.AuxInt)
  6180  		if v_0.Op != OpLOONG64MOVVconst {
  6181  			break
  6182  		}
  6183  		d := auxIntToInt64(v_0.AuxInt)
  6184  		v.reset(OpLOONG64MOVVconst)
  6185  		v.AuxInt = int64ToAuxInt(int64(uint64(d) >> uint64(c)))
  6186  		return true
  6187  	}
  6188  	return false
  6189  }
  6190  func rewriteValueLOONG64_OpLOONG64SUBD(v *Value) bool {
  6191  	v_1 := v.Args[1]
  6192  	v_0 := v.Args[0]
  6193  	// match: (SUBD (MULD x y) z)
  6194  	// cond: z.Block.Func.useFMA(v)
  6195  	// result: (FMSUBD x y z)
  6196  	for {
  6197  		if v_0.Op != OpLOONG64MULD {
  6198  			break
  6199  		}
  6200  		y := v_0.Args[1]
  6201  		x := v_0.Args[0]
  6202  		z := v_1
  6203  		if !(z.Block.Func.useFMA(v)) {
  6204  			break
  6205  		}
  6206  		v.reset(OpLOONG64FMSUBD)
  6207  		v.AddArg3(x, y, z)
  6208  		return true
  6209  	}
  6210  	// match: (SUBD z (MULD x y))
  6211  	// cond: z.Block.Func.useFMA(v)
  6212  	// result: (FNMSUBD x y z)
  6213  	for {
  6214  		z := v_0
  6215  		if v_1.Op != OpLOONG64MULD {
  6216  			break
  6217  		}
  6218  		y := v_1.Args[1]
  6219  		x := v_1.Args[0]
  6220  		if !(z.Block.Func.useFMA(v)) {
  6221  			break
  6222  		}
  6223  		v.reset(OpLOONG64FNMSUBD)
  6224  		v.AddArg3(x, y, z)
  6225  		return true
  6226  	}
  6227  	// match: (SUBD z (NEGD (MULD x y)))
  6228  	// cond: z.Block.Func.useFMA(v)
  6229  	// result: (FMADDD x y z)
  6230  	for {
  6231  		z := v_0
  6232  		if v_1.Op != OpLOONG64NEGD {
  6233  			break
  6234  		}
  6235  		v_1_0 := v_1.Args[0]
  6236  		if v_1_0.Op != OpLOONG64MULD {
  6237  			break
  6238  		}
  6239  		y := v_1_0.Args[1]
  6240  		x := v_1_0.Args[0]
  6241  		if !(z.Block.Func.useFMA(v)) {
  6242  			break
  6243  		}
  6244  		v.reset(OpLOONG64FMADDD)
  6245  		v.AddArg3(x, y, z)
  6246  		return true
  6247  	}
  6248  	// match: (SUBD (NEGD (MULD x y)) z)
  6249  	// cond: z.Block.Func.useFMA(v)
  6250  	// result: (FNMADDD x y z)
  6251  	for {
  6252  		if v_0.Op != OpLOONG64NEGD {
  6253  			break
  6254  		}
  6255  		v_0_0 := v_0.Args[0]
  6256  		if v_0_0.Op != OpLOONG64MULD {
  6257  			break
  6258  		}
  6259  		y := v_0_0.Args[1]
  6260  		x := v_0_0.Args[0]
  6261  		z := v_1
  6262  		if !(z.Block.Func.useFMA(v)) {
  6263  			break
  6264  		}
  6265  		v.reset(OpLOONG64FNMADDD)
  6266  		v.AddArg3(x, y, z)
  6267  		return true
  6268  	}
  6269  	return false
  6270  }
  6271  func rewriteValueLOONG64_OpLOONG64SUBF(v *Value) bool {
  6272  	v_1 := v.Args[1]
  6273  	v_0 := v.Args[0]
  6274  	// match: (SUBF (MULF x y) z)
  6275  	// cond: z.Block.Func.useFMA(v)
  6276  	// result: (FMSUBF x y z)
  6277  	for {
  6278  		if v_0.Op != OpLOONG64MULF {
  6279  			break
  6280  		}
  6281  		y := v_0.Args[1]
  6282  		x := v_0.Args[0]
  6283  		z := v_1
  6284  		if !(z.Block.Func.useFMA(v)) {
  6285  			break
  6286  		}
  6287  		v.reset(OpLOONG64FMSUBF)
  6288  		v.AddArg3(x, y, z)
  6289  		return true
  6290  	}
  6291  	// match: (SUBF z (MULF x y))
  6292  	// cond: z.Block.Func.useFMA(v)
  6293  	// result: (FNMSUBF x y z)
  6294  	for {
  6295  		z := v_0
  6296  		if v_1.Op != OpLOONG64MULF {
  6297  			break
  6298  		}
  6299  		y := v_1.Args[1]
  6300  		x := v_1.Args[0]
  6301  		if !(z.Block.Func.useFMA(v)) {
  6302  			break
  6303  		}
  6304  		v.reset(OpLOONG64FNMSUBF)
  6305  		v.AddArg3(x, y, z)
  6306  		return true
  6307  	}
  6308  	// match: (SUBF z (NEGF (MULF x y)))
  6309  	// cond: z.Block.Func.useFMA(v)
  6310  	// result: (FMADDF x y z)
  6311  	for {
  6312  		z := v_0
  6313  		if v_1.Op != OpLOONG64NEGF {
  6314  			break
  6315  		}
  6316  		v_1_0 := v_1.Args[0]
  6317  		if v_1_0.Op != OpLOONG64MULF {
  6318  			break
  6319  		}
  6320  		y := v_1_0.Args[1]
  6321  		x := v_1_0.Args[0]
  6322  		if !(z.Block.Func.useFMA(v)) {
  6323  			break
  6324  		}
  6325  		v.reset(OpLOONG64FMADDF)
  6326  		v.AddArg3(x, y, z)
  6327  		return true
  6328  	}
  6329  	// match: (SUBF (NEGF (MULF x y)) z)
  6330  	// cond: z.Block.Func.useFMA(v)
  6331  	// result: (FNMADDF x y z)
  6332  	for {
  6333  		if v_0.Op != OpLOONG64NEGF {
  6334  			break
  6335  		}
  6336  		v_0_0 := v_0.Args[0]
  6337  		if v_0_0.Op != OpLOONG64MULF {
  6338  			break
  6339  		}
  6340  		y := v_0_0.Args[1]
  6341  		x := v_0_0.Args[0]
  6342  		z := v_1
  6343  		if !(z.Block.Func.useFMA(v)) {
  6344  			break
  6345  		}
  6346  		v.reset(OpLOONG64FNMADDF)
  6347  		v.AddArg3(x, y, z)
  6348  		return true
  6349  	}
  6350  	return false
  6351  }
  6352  func rewriteValueLOONG64_OpLOONG64SUBV(v *Value) bool {
  6353  	v_1 := v.Args[1]
  6354  	v_0 := v.Args[0]
  6355  	// match: (SUBV x (MOVVconst [c]))
  6356  	// cond: is32Bit(c)
  6357  	// result: (SUBVconst [c] x)
  6358  	for {
  6359  		x := v_0
  6360  		if v_1.Op != OpLOONG64MOVVconst {
  6361  			break
  6362  		}
  6363  		c := auxIntToInt64(v_1.AuxInt)
  6364  		if !(is32Bit(c)) {
  6365  			break
  6366  		}
  6367  		v.reset(OpLOONG64SUBVconst)
  6368  		v.AuxInt = int64ToAuxInt(c)
  6369  		v.AddArg(x)
  6370  		return true
  6371  	}
  6372  	// match: (SUBV x x)
  6373  	// result: (MOVVconst [0])
  6374  	for {
  6375  		x := v_0
  6376  		if x != v_1 {
  6377  			break
  6378  		}
  6379  		v.reset(OpLOONG64MOVVconst)
  6380  		v.AuxInt = int64ToAuxInt(0)
  6381  		return true
  6382  	}
  6383  	// match: (SUBV (MOVVconst [0]) x)
  6384  	// result: (NEGV x)
  6385  	for {
  6386  		if v_0.Op != OpLOONG64MOVVconst || auxIntToInt64(v_0.AuxInt) != 0 {
  6387  			break
  6388  		}
  6389  		x := v_1
  6390  		v.reset(OpLOONG64NEGV)
  6391  		v.AddArg(x)
  6392  		return true
  6393  	}
  6394  	// match: (SUBV (MOVVconst [c]) (NEGV (SUBVconst [d] x)))
  6395  	// result: (ADDVconst [c-d] x)
  6396  	for {
  6397  		if v_0.Op != OpLOONG64MOVVconst {
  6398  			break
  6399  		}
  6400  		c := auxIntToInt64(v_0.AuxInt)
  6401  		if v_1.Op != OpLOONG64NEGV {
  6402  			break
  6403  		}
  6404  		v_1_0 := v_1.Args[0]
  6405  		if v_1_0.Op != OpLOONG64SUBVconst {
  6406  			break
  6407  		}
  6408  		d := auxIntToInt64(v_1_0.AuxInt)
  6409  		x := v_1_0.Args[0]
  6410  		v.reset(OpLOONG64ADDVconst)
  6411  		v.AuxInt = int64ToAuxInt(c - d)
  6412  		v.AddArg(x)
  6413  		return true
  6414  	}
  6415  	return false
  6416  }
  6417  func rewriteValueLOONG64_OpLOONG64SUBVconst(v *Value) bool {
  6418  	v_0 := v.Args[0]
  6419  	// match: (SUBVconst [0] x)
  6420  	// result: x
  6421  	for {
  6422  		if auxIntToInt64(v.AuxInt) != 0 {
  6423  			break
  6424  		}
  6425  		x := v_0
  6426  		v.copyOf(x)
  6427  		return true
  6428  	}
  6429  	// match: (SUBVconst [c] (MOVVconst [d]))
  6430  	// result: (MOVVconst [d-c])
  6431  	for {
  6432  		c := auxIntToInt64(v.AuxInt)
  6433  		if v_0.Op != OpLOONG64MOVVconst {
  6434  			break
  6435  		}
  6436  		d := auxIntToInt64(v_0.AuxInt)
  6437  		v.reset(OpLOONG64MOVVconst)
  6438  		v.AuxInt = int64ToAuxInt(d - c)
  6439  		return true
  6440  	}
  6441  	// match: (SUBVconst [c] (SUBVconst [d] x))
  6442  	// cond: is32Bit(-c-d)
  6443  	// result: (ADDVconst [-c-d] x)
  6444  	for {
  6445  		c := auxIntToInt64(v.AuxInt)
  6446  		if v_0.Op != OpLOONG64SUBVconst {
  6447  			break
  6448  		}
  6449  		d := auxIntToInt64(v_0.AuxInt)
  6450  		x := v_0.Args[0]
  6451  		if !(is32Bit(-c - d)) {
  6452  			break
  6453  		}
  6454  		v.reset(OpLOONG64ADDVconst)
  6455  		v.AuxInt = int64ToAuxInt(-c - d)
  6456  		v.AddArg(x)
  6457  		return true
  6458  	}
  6459  	// match: (SUBVconst [c] (ADDVconst [d] x))
  6460  	// cond: is32Bit(-c+d)
  6461  	// result: (ADDVconst [-c+d] x)
  6462  	for {
  6463  		c := auxIntToInt64(v.AuxInt)
  6464  		if v_0.Op != OpLOONG64ADDVconst {
  6465  			break
  6466  		}
  6467  		d := auxIntToInt64(v_0.AuxInt)
  6468  		x := v_0.Args[0]
  6469  		if !(is32Bit(-c + d)) {
  6470  			break
  6471  		}
  6472  		v.reset(OpLOONG64ADDVconst)
  6473  		v.AuxInt = int64ToAuxInt(-c + d)
  6474  		v.AddArg(x)
  6475  		return true
  6476  	}
  6477  	return false
  6478  }
  6479  func rewriteValueLOONG64_OpLOONG64XOR(v *Value) bool {
  6480  	v_1 := v.Args[1]
  6481  	v_0 := v.Args[0]
  6482  	// match: (XOR x (MOVVconst [c]))
  6483  	// cond: is32Bit(c)
  6484  	// result: (XORconst [c] x)
  6485  	for {
  6486  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
  6487  			x := v_0
  6488  			if v_1.Op != OpLOONG64MOVVconst {
  6489  				continue
  6490  			}
  6491  			c := auxIntToInt64(v_1.AuxInt)
  6492  			if !(is32Bit(c)) {
  6493  				continue
  6494  			}
  6495  			v.reset(OpLOONG64XORconst)
  6496  			v.AuxInt = int64ToAuxInt(c)
  6497  			v.AddArg(x)
  6498  			return true
  6499  		}
  6500  		break
  6501  	}
  6502  	// match: (XOR x x)
  6503  	// result: (MOVVconst [0])
  6504  	for {
  6505  		x := v_0
  6506  		if x != v_1 {
  6507  			break
  6508  		}
  6509  		v.reset(OpLOONG64MOVVconst)
  6510  		v.AuxInt = int64ToAuxInt(0)
  6511  		return true
  6512  	}
  6513  	return false
  6514  }
  6515  func rewriteValueLOONG64_OpLOONG64XORconst(v *Value) bool {
  6516  	v_0 := v.Args[0]
  6517  	// match: (XORconst [0] x)
  6518  	// result: x
  6519  	for {
  6520  		if auxIntToInt64(v.AuxInt) != 0 {
  6521  			break
  6522  		}
  6523  		x := v_0
  6524  		v.copyOf(x)
  6525  		return true
  6526  	}
  6527  	// match: (XORconst [-1] x)
  6528  	// result: (NORconst [0] x)
  6529  	for {
  6530  		if auxIntToInt64(v.AuxInt) != -1 {
  6531  			break
  6532  		}
  6533  		x := v_0
  6534  		v.reset(OpLOONG64NORconst)
  6535  		v.AuxInt = int64ToAuxInt(0)
  6536  		v.AddArg(x)
  6537  		return true
  6538  	}
  6539  	// match: (XORconst [c] (MOVVconst [d]))
  6540  	// result: (MOVVconst [c^d])
  6541  	for {
  6542  		c := auxIntToInt64(v.AuxInt)
  6543  		if v_0.Op != OpLOONG64MOVVconst {
  6544  			break
  6545  		}
  6546  		d := auxIntToInt64(v_0.AuxInt)
  6547  		v.reset(OpLOONG64MOVVconst)
  6548  		v.AuxInt = int64ToAuxInt(c ^ d)
  6549  		return true
  6550  	}
  6551  	// match: (XORconst [c] (XORconst [d] x))
  6552  	// cond: is32Bit(c^d)
  6553  	// result: (XORconst [c^d] x)
  6554  	for {
  6555  		c := auxIntToInt64(v.AuxInt)
  6556  		if v_0.Op != OpLOONG64XORconst {
  6557  			break
  6558  		}
  6559  		d := auxIntToInt64(v_0.AuxInt)
  6560  		x := v_0.Args[0]
  6561  		if !(is32Bit(c ^ d)) {
  6562  			break
  6563  		}
  6564  		v.reset(OpLOONG64XORconst)
  6565  		v.AuxInt = int64ToAuxInt(c ^ d)
  6566  		v.AddArg(x)
  6567  		return true
  6568  	}
  6569  	return false
  6570  }
  6571  func rewriteValueLOONG64_OpLeq16(v *Value) bool {
  6572  	v_1 := v.Args[1]
  6573  	v_0 := v.Args[0]
  6574  	b := v.Block
  6575  	typ := &b.Func.Config.Types
  6576  	// match: (Leq16 x y)
  6577  	// result: (XOR (MOVVconst [1]) (SGT (SignExt16to64 x) (SignExt16to64 y)))
  6578  	for {
  6579  		x := v_0
  6580  		y := v_1
  6581  		v.reset(OpLOONG64XOR)
  6582  		v0 := b.NewValue0(v.Pos, OpLOONG64MOVVconst, typ.UInt64)
  6583  		v0.AuxInt = int64ToAuxInt(1)
  6584  		v1 := b.NewValue0(v.Pos, OpLOONG64SGT, typ.Bool)
  6585  		v2 := b.NewValue0(v.Pos, OpSignExt16to64, typ.Int64)
  6586  		v2.AddArg(x)
  6587  		v3 := b.NewValue0(v.Pos, OpSignExt16to64, typ.Int64)
  6588  		v3.AddArg(y)
  6589  		v1.AddArg2(v2, v3)
  6590  		v.AddArg2(v0, v1)
  6591  		return true
  6592  	}
  6593  }
  6594  func rewriteValueLOONG64_OpLeq16U(v *Value) bool {
  6595  	v_1 := v.Args[1]
  6596  	v_0 := v.Args[0]
  6597  	b := v.Block
  6598  	typ := &b.Func.Config.Types
  6599  	// match: (Leq16U x y)
  6600  	// result: (XOR (MOVVconst [1]) (SGTU (ZeroExt16to64 x) (ZeroExt16to64 y)))
  6601  	for {
  6602  		x := v_0
  6603  		y := v_1
  6604  		v.reset(OpLOONG64XOR)
  6605  		v0 := b.NewValue0(v.Pos, OpLOONG64MOVVconst, typ.UInt64)
  6606  		v0.AuxInt = int64ToAuxInt(1)
  6607  		v1 := b.NewValue0(v.Pos, OpLOONG64SGTU, typ.Bool)
  6608  		v2 := b.NewValue0(v.Pos, OpZeroExt16to64, typ.UInt64)
  6609  		v2.AddArg(x)
  6610  		v3 := b.NewValue0(v.Pos, OpZeroExt16to64, typ.UInt64)
  6611  		v3.AddArg(y)
  6612  		v1.AddArg2(v2, v3)
  6613  		v.AddArg2(v0, v1)
  6614  		return true
  6615  	}
  6616  }
  6617  func rewriteValueLOONG64_OpLeq32(v *Value) bool {
  6618  	v_1 := v.Args[1]
  6619  	v_0 := v.Args[0]
  6620  	b := v.Block
  6621  	typ := &b.Func.Config.Types
  6622  	// match: (Leq32 x y)
  6623  	// result: (XOR (MOVVconst [1]) (SGT (SignExt32to64 x) (SignExt32to64 y)))
  6624  	for {
  6625  		x := v_0
  6626  		y := v_1
  6627  		v.reset(OpLOONG64XOR)
  6628  		v0 := b.NewValue0(v.Pos, OpLOONG64MOVVconst, typ.UInt64)
  6629  		v0.AuxInt = int64ToAuxInt(1)
  6630  		v1 := b.NewValue0(v.Pos, OpLOONG64SGT, typ.Bool)
  6631  		v2 := b.NewValue0(v.Pos, OpSignExt32to64, typ.Int64)
  6632  		v2.AddArg(x)
  6633  		v3 := b.NewValue0(v.Pos, OpSignExt32to64, typ.Int64)
  6634  		v3.AddArg(y)
  6635  		v1.AddArg2(v2, v3)
  6636  		v.AddArg2(v0, v1)
  6637  		return true
  6638  	}
  6639  }
  6640  func rewriteValueLOONG64_OpLeq32F(v *Value) bool {
  6641  	v_1 := v.Args[1]
  6642  	v_0 := v.Args[0]
  6643  	b := v.Block
  6644  	// match: (Leq32F x y)
  6645  	// result: (FPFlagTrue (CMPGEF y x))
  6646  	for {
  6647  		x := v_0
  6648  		y := v_1
  6649  		v.reset(OpLOONG64FPFlagTrue)
  6650  		v0 := b.NewValue0(v.Pos, OpLOONG64CMPGEF, types.TypeFlags)
  6651  		v0.AddArg2(y, x)
  6652  		v.AddArg(v0)
  6653  		return true
  6654  	}
  6655  }
  6656  func rewriteValueLOONG64_OpLeq32U(v *Value) bool {
  6657  	v_1 := v.Args[1]
  6658  	v_0 := v.Args[0]
  6659  	b := v.Block
  6660  	typ := &b.Func.Config.Types
  6661  	// match: (Leq32U x y)
  6662  	// result: (XOR (MOVVconst [1]) (SGTU (ZeroExt32to64 x) (ZeroExt32to64 y)))
  6663  	for {
  6664  		x := v_0
  6665  		y := v_1
  6666  		v.reset(OpLOONG64XOR)
  6667  		v0 := b.NewValue0(v.Pos, OpLOONG64MOVVconst, typ.UInt64)
  6668  		v0.AuxInt = int64ToAuxInt(1)
  6669  		v1 := b.NewValue0(v.Pos, OpLOONG64SGTU, typ.Bool)
  6670  		v2 := b.NewValue0(v.Pos, OpZeroExt32to64, typ.UInt64)
  6671  		v2.AddArg(x)
  6672  		v3 := b.NewValue0(v.Pos, OpZeroExt32to64, typ.UInt64)
  6673  		v3.AddArg(y)
  6674  		v1.AddArg2(v2, v3)
  6675  		v.AddArg2(v0, v1)
  6676  		return true
  6677  	}
  6678  }
  6679  func rewriteValueLOONG64_OpLeq64(v *Value) bool {
  6680  	v_1 := v.Args[1]
  6681  	v_0 := v.Args[0]
  6682  	b := v.Block
  6683  	typ := &b.Func.Config.Types
  6684  	// match: (Leq64 x y)
  6685  	// result: (XOR (MOVVconst [1]) (SGT x y))
  6686  	for {
  6687  		x := v_0
  6688  		y := v_1
  6689  		v.reset(OpLOONG64XOR)
  6690  		v0 := b.NewValue0(v.Pos, OpLOONG64MOVVconst, typ.UInt64)
  6691  		v0.AuxInt = int64ToAuxInt(1)
  6692  		v1 := b.NewValue0(v.Pos, OpLOONG64SGT, typ.Bool)
  6693  		v1.AddArg2(x, y)
  6694  		v.AddArg2(v0, v1)
  6695  		return true
  6696  	}
  6697  }
  6698  func rewriteValueLOONG64_OpLeq64F(v *Value) bool {
  6699  	v_1 := v.Args[1]
  6700  	v_0 := v.Args[0]
  6701  	b := v.Block
  6702  	// match: (Leq64F x y)
  6703  	// result: (FPFlagTrue (CMPGED y x))
  6704  	for {
  6705  		x := v_0
  6706  		y := v_1
  6707  		v.reset(OpLOONG64FPFlagTrue)
  6708  		v0 := b.NewValue0(v.Pos, OpLOONG64CMPGED, types.TypeFlags)
  6709  		v0.AddArg2(y, x)
  6710  		v.AddArg(v0)
  6711  		return true
  6712  	}
  6713  }
  6714  func rewriteValueLOONG64_OpLeq64U(v *Value) bool {
  6715  	v_1 := v.Args[1]
  6716  	v_0 := v.Args[0]
  6717  	b := v.Block
  6718  	typ := &b.Func.Config.Types
  6719  	// match: (Leq64U x y)
  6720  	// result: (XOR (MOVVconst [1]) (SGTU x y))
  6721  	for {
  6722  		x := v_0
  6723  		y := v_1
  6724  		v.reset(OpLOONG64XOR)
  6725  		v0 := b.NewValue0(v.Pos, OpLOONG64MOVVconst, typ.UInt64)
  6726  		v0.AuxInt = int64ToAuxInt(1)
  6727  		v1 := b.NewValue0(v.Pos, OpLOONG64SGTU, typ.Bool)
  6728  		v1.AddArg2(x, y)
  6729  		v.AddArg2(v0, v1)
  6730  		return true
  6731  	}
  6732  }
  6733  func rewriteValueLOONG64_OpLeq8(v *Value) bool {
  6734  	v_1 := v.Args[1]
  6735  	v_0 := v.Args[0]
  6736  	b := v.Block
  6737  	typ := &b.Func.Config.Types
  6738  	// match: (Leq8 x y)
  6739  	// result: (XOR (MOVVconst [1]) (SGT (SignExt8to64 x) (SignExt8to64 y)))
  6740  	for {
  6741  		x := v_0
  6742  		y := v_1
  6743  		v.reset(OpLOONG64XOR)
  6744  		v0 := b.NewValue0(v.Pos, OpLOONG64MOVVconst, typ.UInt64)
  6745  		v0.AuxInt = int64ToAuxInt(1)
  6746  		v1 := b.NewValue0(v.Pos, OpLOONG64SGT, typ.Bool)
  6747  		v2 := b.NewValue0(v.Pos, OpSignExt8to64, typ.Int64)
  6748  		v2.AddArg(x)
  6749  		v3 := b.NewValue0(v.Pos, OpSignExt8to64, typ.Int64)
  6750  		v3.AddArg(y)
  6751  		v1.AddArg2(v2, v3)
  6752  		v.AddArg2(v0, v1)
  6753  		return true
  6754  	}
  6755  }
  6756  func rewriteValueLOONG64_OpLeq8U(v *Value) bool {
  6757  	v_1 := v.Args[1]
  6758  	v_0 := v.Args[0]
  6759  	b := v.Block
  6760  	typ := &b.Func.Config.Types
  6761  	// match: (Leq8U x y)
  6762  	// result: (XOR (MOVVconst [1]) (SGTU (ZeroExt8to64 x) (ZeroExt8to64 y)))
  6763  	for {
  6764  		x := v_0
  6765  		y := v_1
  6766  		v.reset(OpLOONG64XOR)
  6767  		v0 := b.NewValue0(v.Pos, OpLOONG64MOVVconst, typ.UInt64)
  6768  		v0.AuxInt = int64ToAuxInt(1)
  6769  		v1 := b.NewValue0(v.Pos, OpLOONG64SGTU, typ.Bool)
  6770  		v2 := b.NewValue0(v.Pos, OpZeroExt8to64, typ.UInt64)
  6771  		v2.AddArg(x)
  6772  		v3 := b.NewValue0(v.Pos, OpZeroExt8to64, typ.UInt64)
  6773  		v3.AddArg(y)
  6774  		v1.AddArg2(v2, v3)
  6775  		v.AddArg2(v0, v1)
  6776  		return true
  6777  	}
  6778  }
  6779  func rewriteValueLOONG64_OpLess16(v *Value) bool {
  6780  	v_1 := v.Args[1]
  6781  	v_0 := v.Args[0]
  6782  	b := v.Block
  6783  	typ := &b.Func.Config.Types
  6784  	// match: (Less16 x y)
  6785  	// result: (SGT (SignExt16to64 y) (SignExt16to64 x))
  6786  	for {
  6787  		x := v_0
  6788  		y := v_1
  6789  		v.reset(OpLOONG64SGT)
  6790  		v0 := b.NewValue0(v.Pos, OpSignExt16to64, typ.Int64)
  6791  		v0.AddArg(y)
  6792  		v1 := b.NewValue0(v.Pos, OpSignExt16to64, typ.Int64)
  6793  		v1.AddArg(x)
  6794  		v.AddArg2(v0, v1)
  6795  		return true
  6796  	}
  6797  }
  6798  func rewriteValueLOONG64_OpLess16U(v *Value) bool {
  6799  	v_1 := v.Args[1]
  6800  	v_0 := v.Args[0]
  6801  	b := v.Block
  6802  	typ := &b.Func.Config.Types
  6803  	// match: (Less16U x y)
  6804  	// result: (SGTU (ZeroExt16to64 y) (ZeroExt16to64 x))
  6805  	for {
  6806  		x := v_0
  6807  		y := v_1
  6808  		v.reset(OpLOONG64SGTU)
  6809  		v0 := b.NewValue0(v.Pos, OpZeroExt16to64, typ.UInt64)
  6810  		v0.AddArg(y)
  6811  		v1 := b.NewValue0(v.Pos, OpZeroExt16to64, typ.UInt64)
  6812  		v1.AddArg(x)
  6813  		v.AddArg2(v0, v1)
  6814  		return true
  6815  	}
  6816  }
  6817  func rewriteValueLOONG64_OpLess32(v *Value) bool {
  6818  	v_1 := v.Args[1]
  6819  	v_0 := v.Args[0]
  6820  	b := v.Block
  6821  	typ := &b.Func.Config.Types
  6822  	// match: (Less32 x y)
  6823  	// result: (SGT (SignExt32to64 y) (SignExt32to64 x))
  6824  	for {
  6825  		x := v_0
  6826  		y := v_1
  6827  		v.reset(OpLOONG64SGT)
  6828  		v0 := b.NewValue0(v.Pos, OpSignExt32to64, typ.Int64)
  6829  		v0.AddArg(y)
  6830  		v1 := b.NewValue0(v.Pos, OpSignExt32to64, typ.Int64)
  6831  		v1.AddArg(x)
  6832  		v.AddArg2(v0, v1)
  6833  		return true
  6834  	}
  6835  }
  6836  func rewriteValueLOONG64_OpLess32F(v *Value) bool {
  6837  	v_1 := v.Args[1]
  6838  	v_0 := v.Args[0]
  6839  	b := v.Block
  6840  	// match: (Less32F x y)
  6841  	// result: (FPFlagTrue (CMPGTF y x))
  6842  	for {
  6843  		x := v_0
  6844  		y := v_1
  6845  		v.reset(OpLOONG64FPFlagTrue)
  6846  		v0 := b.NewValue0(v.Pos, OpLOONG64CMPGTF, types.TypeFlags)
  6847  		v0.AddArg2(y, x)
  6848  		v.AddArg(v0)
  6849  		return true
  6850  	}
  6851  }
  6852  func rewriteValueLOONG64_OpLess32U(v *Value) bool {
  6853  	v_1 := v.Args[1]
  6854  	v_0 := v.Args[0]
  6855  	b := v.Block
  6856  	typ := &b.Func.Config.Types
  6857  	// match: (Less32U x y)
  6858  	// result: (SGTU (ZeroExt32to64 y) (ZeroExt32to64 x))
  6859  	for {
  6860  		x := v_0
  6861  		y := v_1
  6862  		v.reset(OpLOONG64SGTU)
  6863  		v0 := b.NewValue0(v.Pos, OpZeroExt32to64, typ.UInt64)
  6864  		v0.AddArg(y)
  6865  		v1 := b.NewValue0(v.Pos, OpZeroExt32to64, typ.UInt64)
  6866  		v1.AddArg(x)
  6867  		v.AddArg2(v0, v1)
  6868  		return true
  6869  	}
  6870  }
  6871  func rewriteValueLOONG64_OpLess64(v *Value) bool {
  6872  	v_1 := v.Args[1]
  6873  	v_0 := v.Args[0]
  6874  	// match: (Less64 x y)
  6875  	// result: (SGT y x)
  6876  	for {
  6877  		x := v_0
  6878  		y := v_1
  6879  		v.reset(OpLOONG64SGT)
  6880  		v.AddArg2(y, x)
  6881  		return true
  6882  	}
  6883  }
  6884  func rewriteValueLOONG64_OpLess64F(v *Value) bool {
  6885  	v_1 := v.Args[1]
  6886  	v_0 := v.Args[0]
  6887  	b := v.Block
  6888  	// match: (Less64F x y)
  6889  	// result: (FPFlagTrue (CMPGTD y x))
  6890  	for {
  6891  		x := v_0
  6892  		y := v_1
  6893  		v.reset(OpLOONG64FPFlagTrue)
  6894  		v0 := b.NewValue0(v.Pos, OpLOONG64CMPGTD, types.TypeFlags)
  6895  		v0.AddArg2(y, x)
  6896  		v.AddArg(v0)
  6897  		return true
  6898  	}
  6899  }
  6900  func rewriteValueLOONG64_OpLess64U(v *Value) bool {
  6901  	v_1 := v.Args[1]
  6902  	v_0 := v.Args[0]
  6903  	// match: (Less64U x y)
  6904  	// result: (SGTU y x)
  6905  	for {
  6906  		x := v_0
  6907  		y := v_1
  6908  		v.reset(OpLOONG64SGTU)
  6909  		v.AddArg2(y, x)
  6910  		return true
  6911  	}
  6912  }
  6913  func rewriteValueLOONG64_OpLess8(v *Value) bool {
  6914  	v_1 := v.Args[1]
  6915  	v_0 := v.Args[0]
  6916  	b := v.Block
  6917  	typ := &b.Func.Config.Types
  6918  	// match: (Less8 x y)
  6919  	// result: (SGT (SignExt8to64 y) (SignExt8to64 x))
  6920  	for {
  6921  		x := v_0
  6922  		y := v_1
  6923  		v.reset(OpLOONG64SGT)
  6924  		v0 := b.NewValue0(v.Pos, OpSignExt8to64, typ.Int64)
  6925  		v0.AddArg(y)
  6926  		v1 := b.NewValue0(v.Pos, OpSignExt8to64, typ.Int64)
  6927  		v1.AddArg(x)
  6928  		v.AddArg2(v0, v1)
  6929  		return true
  6930  	}
  6931  }
  6932  func rewriteValueLOONG64_OpLess8U(v *Value) bool {
  6933  	v_1 := v.Args[1]
  6934  	v_0 := v.Args[0]
  6935  	b := v.Block
  6936  	typ := &b.Func.Config.Types
  6937  	// match: (Less8U x y)
  6938  	// result: (SGTU (ZeroExt8to64 y) (ZeroExt8to64 x))
  6939  	for {
  6940  		x := v_0
  6941  		y := v_1
  6942  		v.reset(OpLOONG64SGTU)
  6943  		v0 := b.NewValue0(v.Pos, OpZeroExt8to64, typ.UInt64)
  6944  		v0.AddArg(y)
  6945  		v1 := b.NewValue0(v.Pos, OpZeroExt8to64, typ.UInt64)
  6946  		v1.AddArg(x)
  6947  		v.AddArg2(v0, v1)
  6948  		return true
  6949  	}
  6950  }
  6951  func rewriteValueLOONG64_OpLoad(v *Value) bool {
  6952  	v_1 := v.Args[1]
  6953  	v_0 := v.Args[0]
  6954  	// match: (Load <t> ptr mem)
  6955  	// cond: t.IsBoolean()
  6956  	// result: (MOVBUload ptr mem)
  6957  	for {
  6958  		t := v.Type
  6959  		ptr := v_0
  6960  		mem := v_1
  6961  		if !(t.IsBoolean()) {
  6962  			break
  6963  		}
  6964  		v.reset(OpLOONG64MOVBUload)
  6965  		v.AddArg2(ptr, mem)
  6966  		return true
  6967  	}
  6968  	// match: (Load <t> ptr mem)
  6969  	// cond: (is8BitInt(t) && t.IsSigned())
  6970  	// result: (MOVBload ptr mem)
  6971  	for {
  6972  		t := v.Type
  6973  		ptr := v_0
  6974  		mem := v_1
  6975  		if !(is8BitInt(t) && t.IsSigned()) {
  6976  			break
  6977  		}
  6978  		v.reset(OpLOONG64MOVBload)
  6979  		v.AddArg2(ptr, mem)
  6980  		return true
  6981  	}
  6982  	// match: (Load <t> ptr mem)
  6983  	// cond: (is8BitInt(t) && !t.IsSigned())
  6984  	// result: (MOVBUload ptr mem)
  6985  	for {
  6986  		t := v.Type
  6987  		ptr := v_0
  6988  		mem := v_1
  6989  		if !(is8BitInt(t) && !t.IsSigned()) {
  6990  			break
  6991  		}
  6992  		v.reset(OpLOONG64MOVBUload)
  6993  		v.AddArg2(ptr, mem)
  6994  		return true
  6995  	}
  6996  	// match: (Load <t> ptr mem)
  6997  	// cond: (is16BitInt(t) && t.IsSigned())
  6998  	// result: (MOVHload ptr mem)
  6999  	for {
  7000  		t := v.Type
  7001  		ptr := v_0
  7002  		mem := v_1
  7003  		if !(is16BitInt(t) && t.IsSigned()) {
  7004  			break
  7005  		}
  7006  		v.reset(OpLOONG64MOVHload)
  7007  		v.AddArg2(ptr, mem)
  7008  		return true
  7009  	}
  7010  	// match: (Load <t> ptr mem)
  7011  	// cond: (is16BitInt(t) && !t.IsSigned())
  7012  	// result: (MOVHUload ptr mem)
  7013  	for {
  7014  		t := v.Type
  7015  		ptr := v_0
  7016  		mem := v_1
  7017  		if !(is16BitInt(t) && !t.IsSigned()) {
  7018  			break
  7019  		}
  7020  		v.reset(OpLOONG64MOVHUload)
  7021  		v.AddArg2(ptr, mem)
  7022  		return true
  7023  	}
  7024  	// match: (Load <t> ptr mem)
  7025  	// cond: (is32BitInt(t) && t.IsSigned())
  7026  	// result: (MOVWload ptr mem)
  7027  	for {
  7028  		t := v.Type
  7029  		ptr := v_0
  7030  		mem := v_1
  7031  		if !(is32BitInt(t) && t.IsSigned()) {
  7032  			break
  7033  		}
  7034  		v.reset(OpLOONG64MOVWload)
  7035  		v.AddArg2(ptr, mem)
  7036  		return true
  7037  	}
  7038  	// match: (Load <t> ptr mem)
  7039  	// cond: (is32BitInt(t) && !t.IsSigned())
  7040  	// result: (MOVWUload ptr mem)
  7041  	for {
  7042  		t := v.Type
  7043  		ptr := v_0
  7044  		mem := v_1
  7045  		if !(is32BitInt(t) && !t.IsSigned()) {
  7046  			break
  7047  		}
  7048  		v.reset(OpLOONG64MOVWUload)
  7049  		v.AddArg2(ptr, mem)
  7050  		return true
  7051  	}
  7052  	// match: (Load <t> ptr mem)
  7053  	// cond: (is64BitInt(t) || isPtr(t))
  7054  	// result: (MOVVload ptr mem)
  7055  	for {
  7056  		t := v.Type
  7057  		ptr := v_0
  7058  		mem := v_1
  7059  		if !(is64BitInt(t) || isPtr(t)) {
  7060  			break
  7061  		}
  7062  		v.reset(OpLOONG64MOVVload)
  7063  		v.AddArg2(ptr, mem)
  7064  		return true
  7065  	}
  7066  	// match: (Load <t> ptr mem)
  7067  	// cond: is32BitFloat(t)
  7068  	// result: (MOVFload ptr mem)
  7069  	for {
  7070  		t := v.Type
  7071  		ptr := v_0
  7072  		mem := v_1
  7073  		if !(is32BitFloat(t)) {
  7074  			break
  7075  		}
  7076  		v.reset(OpLOONG64MOVFload)
  7077  		v.AddArg2(ptr, mem)
  7078  		return true
  7079  	}
  7080  	// match: (Load <t> ptr mem)
  7081  	// cond: is64BitFloat(t)
  7082  	// result: (MOVDload ptr mem)
  7083  	for {
  7084  		t := v.Type
  7085  		ptr := v_0
  7086  		mem := v_1
  7087  		if !(is64BitFloat(t)) {
  7088  			break
  7089  		}
  7090  		v.reset(OpLOONG64MOVDload)
  7091  		v.AddArg2(ptr, mem)
  7092  		return true
  7093  	}
  7094  	return false
  7095  }
  7096  func rewriteValueLOONG64_OpLocalAddr(v *Value) bool {
  7097  	v_1 := v.Args[1]
  7098  	v_0 := v.Args[0]
  7099  	b := v.Block
  7100  	typ := &b.Func.Config.Types
  7101  	// match: (LocalAddr <t> {sym} base mem)
  7102  	// cond: t.Elem().HasPointers()
  7103  	// result: (MOVVaddr {sym} (SPanchored base mem))
  7104  	for {
  7105  		t := v.Type
  7106  		sym := auxToSym(v.Aux)
  7107  		base := v_0
  7108  		mem := v_1
  7109  		if !(t.Elem().HasPointers()) {
  7110  			break
  7111  		}
  7112  		v.reset(OpLOONG64MOVVaddr)
  7113  		v.Aux = symToAux(sym)
  7114  		v0 := b.NewValue0(v.Pos, OpSPanchored, typ.Uintptr)
  7115  		v0.AddArg2(base, mem)
  7116  		v.AddArg(v0)
  7117  		return true
  7118  	}
  7119  	// match: (LocalAddr <t> {sym} base _)
  7120  	// cond: !t.Elem().HasPointers()
  7121  	// result: (MOVVaddr {sym} base)
  7122  	for {
  7123  		t := v.Type
  7124  		sym := auxToSym(v.Aux)
  7125  		base := v_0
  7126  		if !(!t.Elem().HasPointers()) {
  7127  			break
  7128  		}
  7129  		v.reset(OpLOONG64MOVVaddr)
  7130  		v.Aux = symToAux(sym)
  7131  		v.AddArg(base)
  7132  		return true
  7133  	}
  7134  	return false
  7135  }
  7136  func rewriteValueLOONG64_OpLsh16x16(v *Value) bool {
  7137  	v_1 := v.Args[1]
  7138  	v_0 := v.Args[0]
  7139  	b := v.Block
  7140  	typ := &b.Func.Config.Types
  7141  	// match: (Lsh16x16 <t> x y)
  7142  	// result: (MASKEQZ (SLLV <t> x (ZeroExt16to64 y)) (SGTU (MOVVconst <typ.UInt64> [64]) (ZeroExt16to64 y)))
  7143  	for {
  7144  		t := v.Type
  7145  		x := v_0
  7146  		y := v_1
  7147  		v.reset(OpLOONG64MASKEQZ)
  7148  		v0 := b.NewValue0(v.Pos, OpLOONG64SLLV, t)
  7149  		v1 := b.NewValue0(v.Pos, OpZeroExt16to64, typ.UInt64)
  7150  		v1.AddArg(y)
  7151  		v0.AddArg2(x, v1)
  7152  		v2 := b.NewValue0(v.Pos, OpLOONG64SGTU, typ.Bool)
  7153  		v3 := b.NewValue0(v.Pos, OpLOONG64MOVVconst, typ.UInt64)
  7154  		v3.AuxInt = int64ToAuxInt(64)
  7155  		v2.AddArg2(v3, v1)
  7156  		v.AddArg2(v0, v2)
  7157  		return true
  7158  	}
  7159  }
  7160  func rewriteValueLOONG64_OpLsh16x32(v *Value) bool {
  7161  	v_1 := v.Args[1]
  7162  	v_0 := v.Args[0]
  7163  	b := v.Block
  7164  	typ := &b.Func.Config.Types
  7165  	// match: (Lsh16x32 <t> x y)
  7166  	// result: (MASKEQZ (SLLV <t> x (ZeroExt32to64 y)) (SGTU (MOVVconst <typ.UInt64> [64]) (ZeroExt32to64 y)))
  7167  	for {
  7168  		t := v.Type
  7169  		x := v_0
  7170  		y := v_1
  7171  		v.reset(OpLOONG64MASKEQZ)
  7172  		v0 := b.NewValue0(v.Pos, OpLOONG64SLLV, t)
  7173  		v1 := b.NewValue0(v.Pos, OpZeroExt32to64, typ.UInt64)
  7174  		v1.AddArg(y)
  7175  		v0.AddArg2(x, v1)
  7176  		v2 := b.NewValue0(v.Pos, OpLOONG64SGTU, typ.Bool)
  7177  		v3 := b.NewValue0(v.Pos, OpLOONG64MOVVconst, typ.UInt64)
  7178  		v3.AuxInt = int64ToAuxInt(64)
  7179  		v2.AddArg2(v3, v1)
  7180  		v.AddArg2(v0, v2)
  7181  		return true
  7182  	}
  7183  }
  7184  func rewriteValueLOONG64_OpLsh16x64(v *Value) bool {
  7185  	v_1 := v.Args[1]
  7186  	v_0 := v.Args[0]
  7187  	b := v.Block
  7188  	typ := &b.Func.Config.Types
  7189  	// match: (Lsh16x64 <t> x y)
  7190  	// result: (MASKEQZ (SLLV <t> x y) (SGTU (MOVVconst <typ.UInt64> [64]) y))
  7191  	for {
  7192  		t := v.Type
  7193  		x := v_0
  7194  		y := v_1
  7195  		v.reset(OpLOONG64MASKEQZ)
  7196  		v0 := b.NewValue0(v.Pos, OpLOONG64SLLV, t)
  7197  		v0.AddArg2(x, y)
  7198  		v1 := b.NewValue0(v.Pos, OpLOONG64SGTU, typ.Bool)
  7199  		v2 := b.NewValue0(v.Pos, OpLOONG64MOVVconst, typ.UInt64)
  7200  		v2.AuxInt = int64ToAuxInt(64)
  7201  		v1.AddArg2(v2, y)
  7202  		v.AddArg2(v0, v1)
  7203  		return true
  7204  	}
  7205  }
  7206  func rewriteValueLOONG64_OpLsh16x8(v *Value) bool {
  7207  	v_1 := v.Args[1]
  7208  	v_0 := v.Args[0]
  7209  	b := v.Block
  7210  	typ := &b.Func.Config.Types
  7211  	// match: (Lsh16x8 <t> x y)
  7212  	// result: (MASKEQZ (SLLV <t> x (ZeroExt8to64 y)) (SGTU (MOVVconst <typ.UInt64> [64]) (ZeroExt8to64 y)))
  7213  	for {
  7214  		t := v.Type
  7215  		x := v_0
  7216  		y := v_1
  7217  		v.reset(OpLOONG64MASKEQZ)
  7218  		v0 := b.NewValue0(v.Pos, OpLOONG64SLLV, t)
  7219  		v1 := b.NewValue0(v.Pos, OpZeroExt8to64, typ.UInt64)
  7220  		v1.AddArg(y)
  7221  		v0.AddArg2(x, v1)
  7222  		v2 := b.NewValue0(v.Pos, OpLOONG64SGTU, typ.Bool)
  7223  		v3 := b.NewValue0(v.Pos, OpLOONG64MOVVconst, typ.UInt64)
  7224  		v3.AuxInt = int64ToAuxInt(64)
  7225  		v2.AddArg2(v3, v1)
  7226  		v.AddArg2(v0, v2)
  7227  		return true
  7228  	}
  7229  }
  7230  func rewriteValueLOONG64_OpLsh32x16(v *Value) bool {
  7231  	v_1 := v.Args[1]
  7232  	v_0 := v.Args[0]
  7233  	b := v.Block
  7234  	typ := &b.Func.Config.Types
  7235  	// match: (Lsh32x16 <t> x y)
  7236  	// result: (MASKEQZ (SLLV <t> x (ZeroExt16to64 y)) (SGTU (MOVVconst <typ.UInt64> [64]) (ZeroExt16to64 y)))
  7237  	for {
  7238  		t := v.Type
  7239  		x := v_0
  7240  		y := v_1
  7241  		v.reset(OpLOONG64MASKEQZ)
  7242  		v0 := b.NewValue0(v.Pos, OpLOONG64SLLV, t)
  7243  		v1 := b.NewValue0(v.Pos, OpZeroExt16to64, typ.UInt64)
  7244  		v1.AddArg(y)
  7245  		v0.AddArg2(x, v1)
  7246  		v2 := b.NewValue0(v.Pos, OpLOONG64SGTU, typ.Bool)
  7247  		v3 := b.NewValue0(v.Pos, OpLOONG64MOVVconst, typ.UInt64)
  7248  		v3.AuxInt = int64ToAuxInt(64)
  7249  		v2.AddArg2(v3, v1)
  7250  		v.AddArg2(v0, v2)
  7251  		return true
  7252  	}
  7253  }
  7254  func rewriteValueLOONG64_OpLsh32x32(v *Value) bool {
  7255  	v_1 := v.Args[1]
  7256  	v_0 := v.Args[0]
  7257  	b := v.Block
  7258  	typ := &b.Func.Config.Types
  7259  	// match: (Lsh32x32 <t> x y)
  7260  	// result: (MASKEQZ (SLLV <t> x (ZeroExt32to64 y)) (SGTU (MOVVconst <typ.UInt64> [64]) (ZeroExt32to64 y)))
  7261  	for {
  7262  		t := v.Type
  7263  		x := v_0
  7264  		y := v_1
  7265  		v.reset(OpLOONG64MASKEQZ)
  7266  		v0 := b.NewValue0(v.Pos, OpLOONG64SLLV, t)
  7267  		v1 := b.NewValue0(v.Pos, OpZeroExt32to64, typ.UInt64)
  7268  		v1.AddArg(y)
  7269  		v0.AddArg2(x, v1)
  7270  		v2 := b.NewValue0(v.Pos, OpLOONG64SGTU, typ.Bool)
  7271  		v3 := b.NewValue0(v.Pos, OpLOONG64MOVVconst, typ.UInt64)
  7272  		v3.AuxInt = int64ToAuxInt(64)
  7273  		v2.AddArg2(v3, v1)
  7274  		v.AddArg2(v0, v2)
  7275  		return true
  7276  	}
  7277  }
  7278  func rewriteValueLOONG64_OpLsh32x64(v *Value) bool {
  7279  	v_1 := v.Args[1]
  7280  	v_0 := v.Args[0]
  7281  	b := v.Block
  7282  	typ := &b.Func.Config.Types
  7283  	// match: (Lsh32x64 <t> x y)
  7284  	// result: (MASKEQZ (SLLV <t> x y) (SGTU (MOVVconst <typ.UInt64> [64]) y))
  7285  	for {
  7286  		t := v.Type
  7287  		x := v_0
  7288  		y := v_1
  7289  		v.reset(OpLOONG64MASKEQZ)
  7290  		v0 := b.NewValue0(v.Pos, OpLOONG64SLLV, t)
  7291  		v0.AddArg2(x, y)
  7292  		v1 := b.NewValue0(v.Pos, OpLOONG64SGTU, typ.Bool)
  7293  		v2 := b.NewValue0(v.Pos, OpLOONG64MOVVconst, typ.UInt64)
  7294  		v2.AuxInt = int64ToAuxInt(64)
  7295  		v1.AddArg2(v2, y)
  7296  		v.AddArg2(v0, v1)
  7297  		return true
  7298  	}
  7299  }
  7300  func rewriteValueLOONG64_OpLsh32x8(v *Value) bool {
  7301  	v_1 := v.Args[1]
  7302  	v_0 := v.Args[0]
  7303  	b := v.Block
  7304  	typ := &b.Func.Config.Types
  7305  	// match: (Lsh32x8 <t> x y)
  7306  	// result: (MASKEQZ (SLLV <t> x (ZeroExt8to64 y)) (SGTU (MOVVconst <typ.UInt64> [64]) (ZeroExt8to64 y)))
  7307  	for {
  7308  		t := v.Type
  7309  		x := v_0
  7310  		y := v_1
  7311  		v.reset(OpLOONG64MASKEQZ)
  7312  		v0 := b.NewValue0(v.Pos, OpLOONG64SLLV, t)
  7313  		v1 := b.NewValue0(v.Pos, OpZeroExt8to64, typ.UInt64)
  7314  		v1.AddArg(y)
  7315  		v0.AddArg2(x, v1)
  7316  		v2 := b.NewValue0(v.Pos, OpLOONG64SGTU, typ.Bool)
  7317  		v3 := b.NewValue0(v.Pos, OpLOONG64MOVVconst, typ.UInt64)
  7318  		v3.AuxInt = int64ToAuxInt(64)
  7319  		v2.AddArg2(v3, v1)
  7320  		v.AddArg2(v0, v2)
  7321  		return true
  7322  	}
  7323  }
  7324  func rewriteValueLOONG64_OpLsh64x16(v *Value) bool {
  7325  	v_1 := v.Args[1]
  7326  	v_0 := v.Args[0]
  7327  	b := v.Block
  7328  	typ := &b.Func.Config.Types
  7329  	// match: (Lsh64x16 <t> x y)
  7330  	// result: (MASKEQZ (SLLV <t> x (ZeroExt16to64 y)) (SGTU (MOVVconst <typ.UInt64> [64]) (ZeroExt16to64 y)))
  7331  	for {
  7332  		t := v.Type
  7333  		x := v_0
  7334  		y := v_1
  7335  		v.reset(OpLOONG64MASKEQZ)
  7336  		v0 := b.NewValue0(v.Pos, OpLOONG64SLLV, t)
  7337  		v1 := b.NewValue0(v.Pos, OpZeroExt16to64, typ.UInt64)
  7338  		v1.AddArg(y)
  7339  		v0.AddArg2(x, v1)
  7340  		v2 := b.NewValue0(v.Pos, OpLOONG64SGTU, typ.Bool)
  7341  		v3 := b.NewValue0(v.Pos, OpLOONG64MOVVconst, typ.UInt64)
  7342  		v3.AuxInt = int64ToAuxInt(64)
  7343  		v2.AddArg2(v3, v1)
  7344  		v.AddArg2(v0, v2)
  7345  		return true
  7346  	}
  7347  }
  7348  func rewriteValueLOONG64_OpLsh64x32(v *Value) bool {
  7349  	v_1 := v.Args[1]
  7350  	v_0 := v.Args[0]
  7351  	b := v.Block
  7352  	typ := &b.Func.Config.Types
  7353  	// match: (Lsh64x32 <t> x y)
  7354  	// result: (MASKEQZ (SLLV <t> x (ZeroExt32to64 y)) (SGTU (MOVVconst <typ.UInt64> [64]) (ZeroExt32to64 y)))
  7355  	for {
  7356  		t := v.Type
  7357  		x := v_0
  7358  		y := v_1
  7359  		v.reset(OpLOONG64MASKEQZ)
  7360  		v0 := b.NewValue0(v.Pos, OpLOONG64SLLV, t)
  7361  		v1 := b.NewValue0(v.Pos, OpZeroExt32to64, typ.UInt64)
  7362  		v1.AddArg(y)
  7363  		v0.AddArg2(x, v1)
  7364  		v2 := b.NewValue0(v.Pos, OpLOONG64SGTU, typ.Bool)
  7365  		v3 := b.NewValue0(v.Pos, OpLOONG64MOVVconst, typ.UInt64)
  7366  		v3.AuxInt = int64ToAuxInt(64)
  7367  		v2.AddArg2(v3, v1)
  7368  		v.AddArg2(v0, v2)
  7369  		return true
  7370  	}
  7371  }
  7372  func rewriteValueLOONG64_OpLsh64x64(v *Value) bool {
  7373  	v_1 := v.Args[1]
  7374  	v_0 := v.Args[0]
  7375  	b := v.Block
  7376  	typ := &b.Func.Config.Types
  7377  	// match: (Lsh64x64 <t> x y)
  7378  	// result: (MASKEQZ (SLLV <t> x y) (SGTU (MOVVconst <typ.UInt64> [64]) y))
  7379  	for {
  7380  		t := v.Type
  7381  		x := v_0
  7382  		y := v_1
  7383  		v.reset(OpLOONG64MASKEQZ)
  7384  		v0 := b.NewValue0(v.Pos, OpLOONG64SLLV, t)
  7385  		v0.AddArg2(x, y)
  7386  		v1 := b.NewValue0(v.Pos, OpLOONG64SGTU, typ.Bool)
  7387  		v2 := b.NewValue0(v.Pos, OpLOONG64MOVVconst, typ.UInt64)
  7388  		v2.AuxInt = int64ToAuxInt(64)
  7389  		v1.AddArg2(v2, y)
  7390  		v.AddArg2(v0, v1)
  7391  		return true
  7392  	}
  7393  }
  7394  func rewriteValueLOONG64_OpLsh64x8(v *Value) bool {
  7395  	v_1 := v.Args[1]
  7396  	v_0 := v.Args[0]
  7397  	b := v.Block
  7398  	typ := &b.Func.Config.Types
  7399  	// match: (Lsh64x8 <t> x y)
  7400  	// result: (MASKEQZ (SLLV <t> x (ZeroExt8to64 y)) (SGTU (MOVVconst <typ.UInt64> [64]) (ZeroExt8to64 y)))
  7401  	for {
  7402  		t := v.Type
  7403  		x := v_0
  7404  		y := v_1
  7405  		v.reset(OpLOONG64MASKEQZ)
  7406  		v0 := b.NewValue0(v.Pos, OpLOONG64SLLV, t)
  7407  		v1 := b.NewValue0(v.Pos, OpZeroExt8to64, typ.UInt64)
  7408  		v1.AddArg(y)
  7409  		v0.AddArg2(x, v1)
  7410  		v2 := b.NewValue0(v.Pos, OpLOONG64SGTU, typ.Bool)
  7411  		v3 := b.NewValue0(v.Pos, OpLOONG64MOVVconst, typ.UInt64)
  7412  		v3.AuxInt = int64ToAuxInt(64)
  7413  		v2.AddArg2(v3, v1)
  7414  		v.AddArg2(v0, v2)
  7415  		return true
  7416  	}
  7417  }
  7418  func rewriteValueLOONG64_OpLsh8x16(v *Value) bool {
  7419  	v_1 := v.Args[1]
  7420  	v_0 := v.Args[0]
  7421  	b := v.Block
  7422  	typ := &b.Func.Config.Types
  7423  	// match: (Lsh8x16 <t> x y)
  7424  	// result: (MASKEQZ (SLLV <t> x (ZeroExt16to64 y)) (SGTU (MOVVconst <typ.UInt64> [64]) (ZeroExt16to64 y)))
  7425  	for {
  7426  		t := v.Type
  7427  		x := v_0
  7428  		y := v_1
  7429  		v.reset(OpLOONG64MASKEQZ)
  7430  		v0 := b.NewValue0(v.Pos, OpLOONG64SLLV, t)
  7431  		v1 := b.NewValue0(v.Pos, OpZeroExt16to64, typ.UInt64)
  7432  		v1.AddArg(y)
  7433  		v0.AddArg2(x, v1)
  7434  		v2 := b.NewValue0(v.Pos, OpLOONG64SGTU, typ.Bool)
  7435  		v3 := b.NewValue0(v.Pos, OpLOONG64MOVVconst, typ.UInt64)
  7436  		v3.AuxInt = int64ToAuxInt(64)
  7437  		v2.AddArg2(v3, v1)
  7438  		v.AddArg2(v0, v2)
  7439  		return true
  7440  	}
  7441  }
  7442  func rewriteValueLOONG64_OpLsh8x32(v *Value) bool {
  7443  	v_1 := v.Args[1]
  7444  	v_0 := v.Args[0]
  7445  	b := v.Block
  7446  	typ := &b.Func.Config.Types
  7447  	// match: (Lsh8x32 <t> x y)
  7448  	// result: (MASKEQZ (SLLV <t> x (ZeroExt32to64 y)) (SGTU (MOVVconst <typ.UInt64> [64]) (ZeroExt32to64 y)))
  7449  	for {
  7450  		t := v.Type
  7451  		x := v_0
  7452  		y := v_1
  7453  		v.reset(OpLOONG64MASKEQZ)
  7454  		v0 := b.NewValue0(v.Pos, OpLOONG64SLLV, t)
  7455  		v1 := b.NewValue0(v.Pos, OpZeroExt32to64, typ.UInt64)
  7456  		v1.AddArg(y)
  7457  		v0.AddArg2(x, v1)
  7458  		v2 := b.NewValue0(v.Pos, OpLOONG64SGTU, typ.Bool)
  7459  		v3 := b.NewValue0(v.Pos, OpLOONG64MOVVconst, typ.UInt64)
  7460  		v3.AuxInt = int64ToAuxInt(64)
  7461  		v2.AddArg2(v3, v1)
  7462  		v.AddArg2(v0, v2)
  7463  		return true
  7464  	}
  7465  }
  7466  func rewriteValueLOONG64_OpLsh8x64(v *Value) bool {
  7467  	v_1 := v.Args[1]
  7468  	v_0 := v.Args[0]
  7469  	b := v.Block
  7470  	typ := &b.Func.Config.Types
  7471  	// match: (Lsh8x64 <t> x y)
  7472  	// result: (MASKEQZ (SLLV <t> x y) (SGTU (MOVVconst <typ.UInt64> [64]) y))
  7473  	for {
  7474  		t := v.Type
  7475  		x := v_0
  7476  		y := v_1
  7477  		v.reset(OpLOONG64MASKEQZ)
  7478  		v0 := b.NewValue0(v.Pos, OpLOONG64SLLV, t)
  7479  		v0.AddArg2(x, y)
  7480  		v1 := b.NewValue0(v.Pos, OpLOONG64SGTU, typ.Bool)
  7481  		v2 := b.NewValue0(v.Pos, OpLOONG64MOVVconst, typ.UInt64)
  7482  		v2.AuxInt = int64ToAuxInt(64)
  7483  		v1.AddArg2(v2, y)
  7484  		v.AddArg2(v0, v1)
  7485  		return true
  7486  	}
  7487  }
  7488  func rewriteValueLOONG64_OpLsh8x8(v *Value) bool {
  7489  	v_1 := v.Args[1]
  7490  	v_0 := v.Args[0]
  7491  	b := v.Block
  7492  	typ := &b.Func.Config.Types
  7493  	// match: (Lsh8x8 <t> x y)
  7494  	// result: (MASKEQZ (SLLV <t> x (ZeroExt8to64 y)) (SGTU (MOVVconst <typ.UInt64> [64]) (ZeroExt8to64 y)))
  7495  	for {
  7496  		t := v.Type
  7497  		x := v_0
  7498  		y := v_1
  7499  		v.reset(OpLOONG64MASKEQZ)
  7500  		v0 := b.NewValue0(v.Pos, OpLOONG64SLLV, t)
  7501  		v1 := b.NewValue0(v.Pos, OpZeroExt8to64, typ.UInt64)
  7502  		v1.AddArg(y)
  7503  		v0.AddArg2(x, v1)
  7504  		v2 := b.NewValue0(v.Pos, OpLOONG64SGTU, typ.Bool)
  7505  		v3 := b.NewValue0(v.Pos, OpLOONG64MOVVconst, typ.UInt64)
  7506  		v3.AuxInt = int64ToAuxInt(64)
  7507  		v2.AddArg2(v3, v1)
  7508  		v.AddArg2(v0, v2)
  7509  		return true
  7510  	}
  7511  }
  7512  func rewriteValueLOONG64_OpMod16(v *Value) bool {
  7513  	v_1 := v.Args[1]
  7514  	v_0 := v.Args[0]
  7515  	b := v.Block
  7516  	typ := &b.Func.Config.Types
  7517  	// match: (Mod16 x y)
  7518  	// result: (REMV (SignExt16to64 x) (SignExt16to64 y))
  7519  	for {
  7520  		x := v_0
  7521  		y := v_1
  7522  		v.reset(OpLOONG64REMV)
  7523  		v0 := b.NewValue0(v.Pos, OpSignExt16to64, typ.Int64)
  7524  		v0.AddArg(x)
  7525  		v1 := b.NewValue0(v.Pos, OpSignExt16to64, typ.Int64)
  7526  		v1.AddArg(y)
  7527  		v.AddArg2(v0, v1)
  7528  		return true
  7529  	}
  7530  }
  7531  func rewriteValueLOONG64_OpMod16u(v *Value) bool {
  7532  	v_1 := v.Args[1]
  7533  	v_0 := v.Args[0]
  7534  	b := v.Block
  7535  	typ := &b.Func.Config.Types
  7536  	// match: (Mod16u x y)
  7537  	// result: (REMVU (ZeroExt16to64 x) (ZeroExt16to64 y))
  7538  	for {
  7539  		x := v_0
  7540  		y := v_1
  7541  		v.reset(OpLOONG64REMVU)
  7542  		v0 := b.NewValue0(v.Pos, OpZeroExt16to64, typ.UInt64)
  7543  		v0.AddArg(x)
  7544  		v1 := b.NewValue0(v.Pos, OpZeroExt16to64, typ.UInt64)
  7545  		v1.AddArg(y)
  7546  		v.AddArg2(v0, v1)
  7547  		return true
  7548  	}
  7549  }
  7550  func rewriteValueLOONG64_OpMod32(v *Value) bool {
  7551  	v_1 := v.Args[1]
  7552  	v_0 := v.Args[0]
  7553  	b := v.Block
  7554  	typ := &b.Func.Config.Types
  7555  	// match: (Mod32 x y)
  7556  	// result: (REMV (SignExt32to64 x) (SignExt32to64 y))
  7557  	for {
  7558  		x := v_0
  7559  		y := v_1
  7560  		v.reset(OpLOONG64REMV)
  7561  		v0 := b.NewValue0(v.Pos, OpSignExt32to64, typ.Int64)
  7562  		v0.AddArg(x)
  7563  		v1 := b.NewValue0(v.Pos, OpSignExt32to64, typ.Int64)
  7564  		v1.AddArg(y)
  7565  		v.AddArg2(v0, v1)
  7566  		return true
  7567  	}
  7568  }
  7569  func rewriteValueLOONG64_OpMod32u(v *Value) bool {
  7570  	v_1 := v.Args[1]
  7571  	v_0 := v.Args[0]
  7572  	b := v.Block
  7573  	typ := &b.Func.Config.Types
  7574  	// match: (Mod32u x y)
  7575  	// result: (REMVU (ZeroExt32to64 x) (ZeroExt32to64 y))
  7576  	for {
  7577  		x := v_0
  7578  		y := v_1
  7579  		v.reset(OpLOONG64REMVU)
  7580  		v0 := b.NewValue0(v.Pos, OpZeroExt32to64, typ.UInt64)
  7581  		v0.AddArg(x)
  7582  		v1 := b.NewValue0(v.Pos, OpZeroExt32to64, typ.UInt64)
  7583  		v1.AddArg(y)
  7584  		v.AddArg2(v0, v1)
  7585  		return true
  7586  	}
  7587  }
  7588  func rewriteValueLOONG64_OpMod64(v *Value) bool {
  7589  	v_1 := v.Args[1]
  7590  	v_0 := v.Args[0]
  7591  	// match: (Mod64 x y)
  7592  	// result: (REMV x y)
  7593  	for {
  7594  		x := v_0
  7595  		y := v_1
  7596  		v.reset(OpLOONG64REMV)
  7597  		v.AddArg2(x, y)
  7598  		return true
  7599  	}
  7600  }
  7601  func rewriteValueLOONG64_OpMod8(v *Value) bool {
  7602  	v_1 := v.Args[1]
  7603  	v_0 := v.Args[0]
  7604  	b := v.Block
  7605  	typ := &b.Func.Config.Types
  7606  	// match: (Mod8 x y)
  7607  	// result: (REMV (SignExt8to64 x) (SignExt8to64 y))
  7608  	for {
  7609  		x := v_0
  7610  		y := v_1
  7611  		v.reset(OpLOONG64REMV)
  7612  		v0 := b.NewValue0(v.Pos, OpSignExt8to64, typ.Int64)
  7613  		v0.AddArg(x)
  7614  		v1 := b.NewValue0(v.Pos, OpSignExt8to64, typ.Int64)
  7615  		v1.AddArg(y)
  7616  		v.AddArg2(v0, v1)
  7617  		return true
  7618  	}
  7619  }
  7620  func rewriteValueLOONG64_OpMod8u(v *Value) bool {
  7621  	v_1 := v.Args[1]
  7622  	v_0 := v.Args[0]
  7623  	b := v.Block
  7624  	typ := &b.Func.Config.Types
  7625  	// match: (Mod8u x y)
  7626  	// result: (REMVU (ZeroExt8to64 x) (ZeroExt8to64 y))
  7627  	for {
  7628  		x := v_0
  7629  		y := v_1
  7630  		v.reset(OpLOONG64REMVU)
  7631  		v0 := b.NewValue0(v.Pos, OpZeroExt8to64, typ.UInt64)
  7632  		v0.AddArg(x)
  7633  		v1 := b.NewValue0(v.Pos, OpZeroExt8to64, typ.UInt64)
  7634  		v1.AddArg(y)
  7635  		v.AddArg2(v0, v1)
  7636  		return true
  7637  	}
  7638  }
  7639  func rewriteValueLOONG64_OpMove(v *Value) bool {
  7640  	v_2 := v.Args[2]
  7641  	v_1 := v.Args[1]
  7642  	v_0 := v.Args[0]
  7643  	b := v.Block
  7644  	config := b.Func.Config
  7645  	typ := &b.Func.Config.Types
  7646  	// match: (Move [0] _ _ mem)
  7647  	// result: mem
  7648  	for {
  7649  		if auxIntToInt64(v.AuxInt) != 0 {
  7650  			break
  7651  		}
  7652  		mem := v_2
  7653  		v.copyOf(mem)
  7654  		return true
  7655  	}
  7656  	// match: (Move [1] dst src mem)
  7657  	// result: (MOVBstore dst (MOVBUload src mem) mem)
  7658  	for {
  7659  		if auxIntToInt64(v.AuxInt) != 1 {
  7660  			break
  7661  		}
  7662  		dst := v_0
  7663  		src := v_1
  7664  		mem := v_2
  7665  		v.reset(OpLOONG64MOVBstore)
  7666  		v0 := b.NewValue0(v.Pos, OpLOONG64MOVBUload, typ.UInt8)
  7667  		v0.AddArg2(src, mem)
  7668  		v.AddArg3(dst, v0, mem)
  7669  		return true
  7670  	}
  7671  	// match: (Move [2] dst src mem)
  7672  	// result: (MOVHstore dst (MOVHUload src mem) mem)
  7673  	for {
  7674  		if auxIntToInt64(v.AuxInt) != 2 {
  7675  			break
  7676  		}
  7677  		dst := v_0
  7678  		src := v_1
  7679  		mem := v_2
  7680  		v.reset(OpLOONG64MOVHstore)
  7681  		v0 := b.NewValue0(v.Pos, OpLOONG64MOVHUload, typ.UInt16)
  7682  		v0.AddArg2(src, mem)
  7683  		v.AddArg3(dst, v0, mem)
  7684  		return true
  7685  	}
  7686  	// match: (Move [3] dst src mem)
  7687  	// result: (MOVBstore [2] dst (MOVBUload [2] src mem) (MOVHstore dst (MOVHUload src mem) mem))
  7688  	for {
  7689  		if auxIntToInt64(v.AuxInt) != 3 {
  7690  			break
  7691  		}
  7692  		dst := v_0
  7693  		src := v_1
  7694  		mem := v_2
  7695  		v.reset(OpLOONG64MOVBstore)
  7696  		v.AuxInt = int32ToAuxInt(2)
  7697  		v0 := b.NewValue0(v.Pos, OpLOONG64MOVBUload, typ.UInt8)
  7698  		v0.AuxInt = int32ToAuxInt(2)
  7699  		v0.AddArg2(src, mem)
  7700  		v1 := b.NewValue0(v.Pos, OpLOONG64MOVHstore, types.TypeMem)
  7701  		v2 := b.NewValue0(v.Pos, OpLOONG64MOVHUload, typ.UInt16)
  7702  		v2.AddArg2(src, mem)
  7703  		v1.AddArg3(dst, v2, mem)
  7704  		v.AddArg3(dst, v0, v1)
  7705  		return true
  7706  	}
  7707  	// match: (Move [4] dst src mem)
  7708  	// result: (MOVWstore dst (MOVWUload src mem) mem)
  7709  	for {
  7710  		if auxIntToInt64(v.AuxInt) != 4 {
  7711  			break
  7712  		}
  7713  		dst := v_0
  7714  		src := v_1
  7715  		mem := v_2
  7716  		v.reset(OpLOONG64MOVWstore)
  7717  		v0 := b.NewValue0(v.Pos, OpLOONG64MOVWUload, typ.UInt32)
  7718  		v0.AddArg2(src, mem)
  7719  		v.AddArg3(dst, v0, mem)
  7720  		return true
  7721  	}
  7722  	// match: (Move [5] dst src mem)
  7723  	// result: (MOVBstore [4] dst (MOVBUload [4] src mem) (MOVWstore dst (MOVWUload src mem) mem))
  7724  	for {
  7725  		if auxIntToInt64(v.AuxInt) != 5 {
  7726  			break
  7727  		}
  7728  		dst := v_0
  7729  		src := v_1
  7730  		mem := v_2
  7731  		v.reset(OpLOONG64MOVBstore)
  7732  		v.AuxInt = int32ToAuxInt(4)
  7733  		v0 := b.NewValue0(v.Pos, OpLOONG64MOVBUload, typ.UInt8)
  7734  		v0.AuxInt = int32ToAuxInt(4)
  7735  		v0.AddArg2(src, mem)
  7736  		v1 := b.NewValue0(v.Pos, OpLOONG64MOVWstore, types.TypeMem)
  7737  		v2 := b.NewValue0(v.Pos, OpLOONG64MOVWUload, typ.UInt32)
  7738  		v2.AddArg2(src, mem)
  7739  		v1.AddArg3(dst, v2, mem)
  7740  		v.AddArg3(dst, v0, v1)
  7741  		return true
  7742  	}
  7743  	// match: (Move [6] dst src mem)
  7744  	// result: (MOVHstore [4] dst (MOVHUload [4] src mem) (MOVWstore dst (MOVWUload src mem) mem))
  7745  	for {
  7746  		if auxIntToInt64(v.AuxInt) != 6 {
  7747  			break
  7748  		}
  7749  		dst := v_0
  7750  		src := v_1
  7751  		mem := v_2
  7752  		v.reset(OpLOONG64MOVHstore)
  7753  		v.AuxInt = int32ToAuxInt(4)
  7754  		v0 := b.NewValue0(v.Pos, OpLOONG64MOVHUload, typ.UInt16)
  7755  		v0.AuxInt = int32ToAuxInt(4)
  7756  		v0.AddArg2(src, mem)
  7757  		v1 := b.NewValue0(v.Pos, OpLOONG64MOVWstore, types.TypeMem)
  7758  		v2 := b.NewValue0(v.Pos, OpLOONG64MOVWUload, typ.UInt32)
  7759  		v2.AddArg2(src, mem)
  7760  		v1.AddArg3(dst, v2, mem)
  7761  		v.AddArg3(dst, v0, v1)
  7762  		return true
  7763  	}
  7764  	// match: (Move [7] dst src mem)
  7765  	// result: (MOVWstore [3] dst (MOVWUload [3] src mem) (MOVWstore dst (MOVWUload src mem) mem))
  7766  	for {
  7767  		if auxIntToInt64(v.AuxInt) != 7 {
  7768  			break
  7769  		}
  7770  		dst := v_0
  7771  		src := v_1
  7772  		mem := v_2
  7773  		v.reset(OpLOONG64MOVWstore)
  7774  		v.AuxInt = int32ToAuxInt(3)
  7775  		v0 := b.NewValue0(v.Pos, OpLOONG64MOVWUload, typ.UInt32)
  7776  		v0.AuxInt = int32ToAuxInt(3)
  7777  		v0.AddArg2(src, mem)
  7778  		v1 := b.NewValue0(v.Pos, OpLOONG64MOVWstore, types.TypeMem)
  7779  		v2 := b.NewValue0(v.Pos, OpLOONG64MOVWUload, typ.UInt32)
  7780  		v2.AddArg2(src, mem)
  7781  		v1.AddArg3(dst, v2, mem)
  7782  		v.AddArg3(dst, v0, v1)
  7783  		return true
  7784  	}
  7785  	// match: (Move [8] dst src mem)
  7786  	// result: (MOVVstore dst (MOVVload src mem) mem)
  7787  	for {
  7788  		if auxIntToInt64(v.AuxInt) != 8 {
  7789  			break
  7790  		}
  7791  		dst := v_0
  7792  		src := v_1
  7793  		mem := v_2
  7794  		v.reset(OpLOONG64MOVVstore)
  7795  		v0 := b.NewValue0(v.Pos, OpLOONG64MOVVload, typ.UInt64)
  7796  		v0.AddArg2(src, mem)
  7797  		v.AddArg3(dst, v0, mem)
  7798  		return true
  7799  	}
  7800  	// match: (Move [9] dst src mem)
  7801  	// result: (MOVBstore [8] dst (MOVBUload [8] src mem) (MOVVstore dst (MOVVload src mem) mem))
  7802  	for {
  7803  		if auxIntToInt64(v.AuxInt) != 9 {
  7804  			break
  7805  		}
  7806  		dst := v_0
  7807  		src := v_1
  7808  		mem := v_2
  7809  		v.reset(OpLOONG64MOVBstore)
  7810  		v.AuxInt = int32ToAuxInt(8)
  7811  		v0 := b.NewValue0(v.Pos, OpLOONG64MOVBUload, typ.UInt8)
  7812  		v0.AuxInt = int32ToAuxInt(8)
  7813  		v0.AddArg2(src, mem)
  7814  		v1 := b.NewValue0(v.Pos, OpLOONG64MOVVstore, types.TypeMem)
  7815  		v2 := b.NewValue0(v.Pos, OpLOONG64MOVVload, typ.UInt64)
  7816  		v2.AddArg2(src, mem)
  7817  		v1.AddArg3(dst, v2, mem)
  7818  		v.AddArg3(dst, v0, v1)
  7819  		return true
  7820  	}
  7821  	// match: (Move [10] dst src mem)
  7822  	// result: (MOVHstore [8] dst (MOVHUload [8] src mem) (MOVVstore dst (MOVVload src mem) mem))
  7823  	for {
  7824  		if auxIntToInt64(v.AuxInt) != 10 {
  7825  			break
  7826  		}
  7827  		dst := v_0
  7828  		src := v_1
  7829  		mem := v_2
  7830  		v.reset(OpLOONG64MOVHstore)
  7831  		v.AuxInt = int32ToAuxInt(8)
  7832  		v0 := b.NewValue0(v.Pos, OpLOONG64MOVHUload, typ.UInt16)
  7833  		v0.AuxInt = int32ToAuxInt(8)
  7834  		v0.AddArg2(src, mem)
  7835  		v1 := b.NewValue0(v.Pos, OpLOONG64MOVVstore, types.TypeMem)
  7836  		v2 := b.NewValue0(v.Pos, OpLOONG64MOVVload, typ.UInt64)
  7837  		v2.AddArg2(src, mem)
  7838  		v1.AddArg3(dst, v2, mem)
  7839  		v.AddArg3(dst, v0, v1)
  7840  		return true
  7841  	}
  7842  	// match: (Move [11] dst src mem)
  7843  	// result: (MOVWstore [7] dst (MOVWload [7] src mem) (MOVVstore dst (MOVVload src mem) mem))
  7844  	for {
  7845  		if auxIntToInt64(v.AuxInt) != 11 {
  7846  			break
  7847  		}
  7848  		dst := v_0
  7849  		src := v_1
  7850  		mem := v_2
  7851  		v.reset(OpLOONG64MOVWstore)
  7852  		v.AuxInt = int32ToAuxInt(7)
  7853  		v0 := b.NewValue0(v.Pos, OpLOONG64MOVWload, typ.Int32)
  7854  		v0.AuxInt = int32ToAuxInt(7)
  7855  		v0.AddArg2(src, mem)
  7856  		v1 := b.NewValue0(v.Pos, OpLOONG64MOVVstore, types.TypeMem)
  7857  		v2 := b.NewValue0(v.Pos, OpLOONG64MOVVload, typ.UInt64)
  7858  		v2.AddArg2(src, mem)
  7859  		v1.AddArg3(dst, v2, mem)
  7860  		v.AddArg3(dst, v0, v1)
  7861  		return true
  7862  	}
  7863  	// match: (Move [12] dst src mem)
  7864  	// result: (MOVWstore [8] dst (MOVWUload [8] src mem) (MOVVstore dst (MOVVload src mem) mem))
  7865  	for {
  7866  		if auxIntToInt64(v.AuxInt) != 12 {
  7867  			break
  7868  		}
  7869  		dst := v_0
  7870  		src := v_1
  7871  		mem := v_2
  7872  		v.reset(OpLOONG64MOVWstore)
  7873  		v.AuxInt = int32ToAuxInt(8)
  7874  		v0 := b.NewValue0(v.Pos, OpLOONG64MOVWUload, typ.UInt32)
  7875  		v0.AuxInt = int32ToAuxInt(8)
  7876  		v0.AddArg2(src, mem)
  7877  		v1 := b.NewValue0(v.Pos, OpLOONG64MOVVstore, types.TypeMem)
  7878  		v2 := b.NewValue0(v.Pos, OpLOONG64MOVVload, typ.UInt64)
  7879  		v2.AddArg2(src, mem)
  7880  		v1.AddArg3(dst, v2, mem)
  7881  		v.AddArg3(dst, v0, v1)
  7882  		return true
  7883  	}
  7884  	// match: (Move [13] dst src mem)
  7885  	// result: (MOVVstore [5] dst (MOVVload [5] src mem) (MOVVstore dst (MOVVload src mem) mem))
  7886  	for {
  7887  		if auxIntToInt64(v.AuxInt) != 13 {
  7888  			break
  7889  		}
  7890  		dst := v_0
  7891  		src := v_1
  7892  		mem := v_2
  7893  		v.reset(OpLOONG64MOVVstore)
  7894  		v.AuxInt = int32ToAuxInt(5)
  7895  		v0 := b.NewValue0(v.Pos, OpLOONG64MOVVload, typ.UInt64)
  7896  		v0.AuxInt = int32ToAuxInt(5)
  7897  		v0.AddArg2(src, mem)
  7898  		v1 := b.NewValue0(v.Pos, OpLOONG64MOVVstore, types.TypeMem)
  7899  		v2 := b.NewValue0(v.Pos, OpLOONG64MOVVload, typ.UInt64)
  7900  		v2.AddArg2(src, mem)
  7901  		v1.AddArg3(dst, v2, mem)
  7902  		v.AddArg3(dst, v0, v1)
  7903  		return true
  7904  	}
  7905  	// match: (Move [14] dst src mem)
  7906  	// result: (MOVVstore [6] dst (MOVVload [6] src mem) (MOVVstore dst (MOVVload src mem) mem))
  7907  	for {
  7908  		if auxIntToInt64(v.AuxInt) != 14 {
  7909  			break
  7910  		}
  7911  		dst := v_0
  7912  		src := v_1
  7913  		mem := v_2
  7914  		v.reset(OpLOONG64MOVVstore)
  7915  		v.AuxInt = int32ToAuxInt(6)
  7916  		v0 := b.NewValue0(v.Pos, OpLOONG64MOVVload, typ.UInt64)
  7917  		v0.AuxInt = int32ToAuxInt(6)
  7918  		v0.AddArg2(src, mem)
  7919  		v1 := b.NewValue0(v.Pos, OpLOONG64MOVVstore, types.TypeMem)
  7920  		v2 := b.NewValue0(v.Pos, OpLOONG64MOVVload, typ.UInt64)
  7921  		v2.AddArg2(src, mem)
  7922  		v1.AddArg3(dst, v2, mem)
  7923  		v.AddArg3(dst, v0, v1)
  7924  		return true
  7925  	}
  7926  	// match: (Move [15] dst src mem)
  7927  	// result: (MOVVstore [7] dst (MOVVload [7] src mem) (MOVVstore dst (MOVVload src mem) mem))
  7928  	for {
  7929  		if auxIntToInt64(v.AuxInt) != 15 {
  7930  			break
  7931  		}
  7932  		dst := v_0
  7933  		src := v_1
  7934  		mem := v_2
  7935  		v.reset(OpLOONG64MOVVstore)
  7936  		v.AuxInt = int32ToAuxInt(7)
  7937  		v0 := b.NewValue0(v.Pos, OpLOONG64MOVVload, typ.UInt64)
  7938  		v0.AuxInt = int32ToAuxInt(7)
  7939  		v0.AddArg2(src, mem)
  7940  		v1 := b.NewValue0(v.Pos, OpLOONG64MOVVstore, types.TypeMem)
  7941  		v2 := b.NewValue0(v.Pos, OpLOONG64MOVVload, typ.UInt64)
  7942  		v2.AddArg2(src, mem)
  7943  		v1.AddArg3(dst, v2, mem)
  7944  		v.AddArg3(dst, v0, v1)
  7945  		return true
  7946  	}
  7947  	// match: (Move [16] dst src mem)
  7948  	// result: (MOVVstore [8] dst (MOVVload [8] src mem) (MOVVstore dst (MOVVload src mem) mem))
  7949  	for {
  7950  		if auxIntToInt64(v.AuxInt) != 16 {
  7951  			break
  7952  		}
  7953  		dst := v_0
  7954  		src := v_1
  7955  		mem := v_2
  7956  		v.reset(OpLOONG64MOVVstore)
  7957  		v.AuxInt = int32ToAuxInt(8)
  7958  		v0 := b.NewValue0(v.Pos, OpLOONG64MOVVload, typ.UInt64)
  7959  		v0.AuxInt = int32ToAuxInt(8)
  7960  		v0.AddArg2(src, mem)
  7961  		v1 := b.NewValue0(v.Pos, OpLOONG64MOVVstore, types.TypeMem)
  7962  		v2 := b.NewValue0(v.Pos, OpLOONG64MOVVload, typ.UInt64)
  7963  		v2.AddArg2(src, mem)
  7964  		v1.AddArg3(dst, v2, mem)
  7965  		v.AddArg3(dst, v0, v1)
  7966  		return true
  7967  	}
  7968  	// match: (Move [s] dst src mem)
  7969  	// cond: s%8 != 0 && s > 16
  7970  	// result: (Move [s%8] (OffPtr <dst.Type> dst [s-s%8]) (OffPtr <src.Type> src [s-s%8]) (Move [s-s%8] dst src mem))
  7971  	for {
  7972  		s := auxIntToInt64(v.AuxInt)
  7973  		dst := v_0
  7974  		src := v_1
  7975  		mem := v_2
  7976  		if !(s%8 != 0 && s > 16) {
  7977  			break
  7978  		}
  7979  		v.reset(OpMove)
  7980  		v.AuxInt = int64ToAuxInt(s % 8)
  7981  		v0 := b.NewValue0(v.Pos, OpOffPtr, dst.Type)
  7982  		v0.AuxInt = int64ToAuxInt(s - s%8)
  7983  		v0.AddArg(dst)
  7984  		v1 := b.NewValue0(v.Pos, OpOffPtr, src.Type)
  7985  		v1.AuxInt = int64ToAuxInt(s - s%8)
  7986  		v1.AddArg(src)
  7987  		v2 := b.NewValue0(v.Pos, OpMove, types.TypeMem)
  7988  		v2.AuxInt = int64ToAuxInt(s - s%8)
  7989  		v2.AddArg3(dst, src, mem)
  7990  		v.AddArg3(v0, v1, v2)
  7991  		return true
  7992  	}
  7993  	// match: (Move [s] dst src mem)
  7994  	// cond: s%8 == 0 && s > 16 && s <= 8*128 && !config.noDuffDevice && logLargeCopy(v, s)
  7995  	// result: (DUFFCOPY [16 * (128 - s/8)] dst src mem)
  7996  	for {
  7997  		s := auxIntToInt64(v.AuxInt)
  7998  		dst := v_0
  7999  		src := v_1
  8000  		mem := v_2
  8001  		if !(s%8 == 0 && s > 16 && s <= 8*128 && !config.noDuffDevice && logLargeCopy(v, s)) {
  8002  			break
  8003  		}
  8004  		v.reset(OpLOONG64DUFFCOPY)
  8005  		v.AuxInt = int64ToAuxInt(16 * (128 - s/8))
  8006  		v.AddArg3(dst, src, mem)
  8007  		return true
  8008  	}
  8009  	// match: (Move [s] dst src mem)
  8010  	// cond: s%8 == 0 && s > 1024 && logLargeCopy(v, s)
  8011  	// result: (LoweredMove dst src (ADDVconst <src.Type> src [s-8]) mem)
  8012  	for {
  8013  		s := auxIntToInt64(v.AuxInt)
  8014  		dst := v_0
  8015  		src := v_1
  8016  		mem := v_2
  8017  		if !(s%8 == 0 && s > 1024 && logLargeCopy(v, s)) {
  8018  			break
  8019  		}
  8020  		v.reset(OpLOONG64LoweredMove)
  8021  		v0 := b.NewValue0(v.Pos, OpLOONG64ADDVconst, src.Type)
  8022  		v0.AuxInt = int64ToAuxInt(s - 8)
  8023  		v0.AddArg(src)
  8024  		v.AddArg4(dst, src, v0, mem)
  8025  		return true
  8026  	}
  8027  	return false
  8028  }
  8029  func rewriteValueLOONG64_OpNeq16(v *Value) bool {
  8030  	v_1 := v.Args[1]
  8031  	v_0 := v.Args[0]
  8032  	b := v.Block
  8033  	typ := &b.Func.Config.Types
  8034  	// match: (Neq16 x y)
  8035  	// result: (SGTU (XOR (ZeroExt16to32 x) (ZeroExt16to64 y)) (MOVVconst [0]))
  8036  	for {
  8037  		x := v_0
  8038  		y := v_1
  8039  		v.reset(OpLOONG64SGTU)
  8040  		v0 := b.NewValue0(v.Pos, OpLOONG64XOR, typ.UInt64)
  8041  		v1 := b.NewValue0(v.Pos, OpZeroExt16to32, typ.UInt32)
  8042  		v1.AddArg(x)
  8043  		v2 := b.NewValue0(v.Pos, OpZeroExt16to64, typ.UInt64)
  8044  		v2.AddArg(y)
  8045  		v0.AddArg2(v1, v2)
  8046  		v3 := b.NewValue0(v.Pos, OpLOONG64MOVVconst, typ.UInt64)
  8047  		v3.AuxInt = int64ToAuxInt(0)
  8048  		v.AddArg2(v0, v3)
  8049  		return true
  8050  	}
  8051  }
  8052  func rewriteValueLOONG64_OpNeq32(v *Value) bool {
  8053  	v_1 := v.Args[1]
  8054  	v_0 := v.Args[0]
  8055  	b := v.Block
  8056  	typ := &b.Func.Config.Types
  8057  	// match: (Neq32 x y)
  8058  	// result: (SGTU (XOR (ZeroExt32to64 x) (ZeroExt32to64 y)) (MOVVconst [0]))
  8059  	for {
  8060  		x := v_0
  8061  		y := v_1
  8062  		v.reset(OpLOONG64SGTU)
  8063  		v0 := b.NewValue0(v.Pos, OpLOONG64XOR, typ.UInt64)
  8064  		v1 := b.NewValue0(v.Pos, OpZeroExt32to64, typ.UInt64)
  8065  		v1.AddArg(x)
  8066  		v2 := b.NewValue0(v.Pos, OpZeroExt32to64, typ.UInt64)
  8067  		v2.AddArg(y)
  8068  		v0.AddArg2(v1, v2)
  8069  		v3 := b.NewValue0(v.Pos, OpLOONG64MOVVconst, typ.UInt64)
  8070  		v3.AuxInt = int64ToAuxInt(0)
  8071  		v.AddArg2(v0, v3)
  8072  		return true
  8073  	}
  8074  }
  8075  func rewriteValueLOONG64_OpNeq32F(v *Value) bool {
  8076  	v_1 := v.Args[1]
  8077  	v_0 := v.Args[0]
  8078  	b := v.Block
  8079  	// match: (Neq32F x y)
  8080  	// result: (FPFlagFalse (CMPEQF x y))
  8081  	for {
  8082  		x := v_0
  8083  		y := v_1
  8084  		v.reset(OpLOONG64FPFlagFalse)
  8085  		v0 := b.NewValue0(v.Pos, OpLOONG64CMPEQF, types.TypeFlags)
  8086  		v0.AddArg2(x, y)
  8087  		v.AddArg(v0)
  8088  		return true
  8089  	}
  8090  }
  8091  func rewriteValueLOONG64_OpNeq64(v *Value) bool {
  8092  	v_1 := v.Args[1]
  8093  	v_0 := v.Args[0]
  8094  	b := v.Block
  8095  	typ := &b.Func.Config.Types
  8096  	// match: (Neq64 x y)
  8097  	// result: (SGTU (XOR x y) (MOVVconst [0]))
  8098  	for {
  8099  		x := v_0
  8100  		y := v_1
  8101  		v.reset(OpLOONG64SGTU)
  8102  		v0 := b.NewValue0(v.Pos, OpLOONG64XOR, typ.UInt64)
  8103  		v0.AddArg2(x, y)
  8104  		v1 := b.NewValue0(v.Pos, OpLOONG64MOVVconst, typ.UInt64)
  8105  		v1.AuxInt = int64ToAuxInt(0)
  8106  		v.AddArg2(v0, v1)
  8107  		return true
  8108  	}
  8109  }
  8110  func rewriteValueLOONG64_OpNeq64F(v *Value) bool {
  8111  	v_1 := v.Args[1]
  8112  	v_0 := v.Args[0]
  8113  	b := v.Block
  8114  	// match: (Neq64F x y)
  8115  	// result: (FPFlagFalse (CMPEQD x y))
  8116  	for {
  8117  		x := v_0
  8118  		y := v_1
  8119  		v.reset(OpLOONG64FPFlagFalse)
  8120  		v0 := b.NewValue0(v.Pos, OpLOONG64CMPEQD, types.TypeFlags)
  8121  		v0.AddArg2(x, y)
  8122  		v.AddArg(v0)
  8123  		return true
  8124  	}
  8125  }
  8126  func rewriteValueLOONG64_OpNeq8(v *Value) bool {
  8127  	v_1 := v.Args[1]
  8128  	v_0 := v.Args[0]
  8129  	b := v.Block
  8130  	typ := &b.Func.Config.Types
  8131  	// match: (Neq8 x y)
  8132  	// result: (SGTU (XOR (ZeroExt8to64 x) (ZeroExt8to64 y)) (MOVVconst [0]))
  8133  	for {
  8134  		x := v_0
  8135  		y := v_1
  8136  		v.reset(OpLOONG64SGTU)
  8137  		v0 := b.NewValue0(v.Pos, OpLOONG64XOR, typ.UInt64)
  8138  		v1 := b.NewValue0(v.Pos, OpZeroExt8to64, typ.UInt64)
  8139  		v1.AddArg(x)
  8140  		v2 := b.NewValue0(v.Pos, OpZeroExt8to64, typ.UInt64)
  8141  		v2.AddArg(y)
  8142  		v0.AddArg2(v1, v2)
  8143  		v3 := b.NewValue0(v.Pos, OpLOONG64MOVVconst, typ.UInt64)
  8144  		v3.AuxInt = int64ToAuxInt(0)
  8145  		v.AddArg2(v0, v3)
  8146  		return true
  8147  	}
  8148  }
  8149  func rewriteValueLOONG64_OpNeqPtr(v *Value) bool {
  8150  	v_1 := v.Args[1]
  8151  	v_0 := v.Args[0]
  8152  	b := v.Block
  8153  	typ := &b.Func.Config.Types
  8154  	// match: (NeqPtr x y)
  8155  	// result: (SGTU (XOR x y) (MOVVconst [0]))
  8156  	for {
  8157  		x := v_0
  8158  		y := v_1
  8159  		v.reset(OpLOONG64SGTU)
  8160  		v0 := b.NewValue0(v.Pos, OpLOONG64XOR, typ.UInt64)
  8161  		v0.AddArg2(x, y)
  8162  		v1 := b.NewValue0(v.Pos, OpLOONG64MOVVconst, typ.UInt64)
  8163  		v1.AuxInt = int64ToAuxInt(0)
  8164  		v.AddArg2(v0, v1)
  8165  		return true
  8166  	}
  8167  }
  8168  func rewriteValueLOONG64_OpNot(v *Value) bool {
  8169  	v_0 := v.Args[0]
  8170  	// match: (Not x)
  8171  	// result: (XORconst [1] x)
  8172  	for {
  8173  		x := v_0
  8174  		v.reset(OpLOONG64XORconst)
  8175  		v.AuxInt = int64ToAuxInt(1)
  8176  		v.AddArg(x)
  8177  		return true
  8178  	}
  8179  }
  8180  func rewriteValueLOONG64_OpOffPtr(v *Value) bool {
  8181  	v_0 := v.Args[0]
  8182  	// match: (OffPtr [off] ptr:(SP))
  8183  	// result: (MOVVaddr [int32(off)] ptr)
  8184  	for {
  8185  		off := auxIntToInt64(v.AuxInt)
  8186  		ptr := v_0
  8187  		if ptr.Op != OpSP {
  8188  			break
  8189  		}
  8190  		v.reset(OpLOONG64MOVVaddr)
  8191  		v.AuxInt = int32ToAuxInt(int32(off))
  8192  		v.AddArg(ptr)
  8193  		return true
  8194  	}
  8195  	// match: (OffPtr [off] ptr)
  8196  	// result: (ADDVconst [off] ptr)
  8197  	for {
  8198  		off := auxIntToInt64(v.AuxInt)
  8199  		ptr := v_0
  8200  		v.reset(OpLOONG64ADDVconst)
  8201  		v.AuxInt = int64ToAuxInt(off)
  8202  		v.AddArg(ptr)
  8203  		return true
  8204  	}
  8205  }
  8206  func rewriteValueLOONG64_OpPanicBounds(v *Value) bool {
  8207  	v_2 := v.Args[2]
  8208  	v_1 := v.Args[1]
  8209  	v_0 := v.Args[0]
  8210  	// match: (PanicBounds [kind] x y mem)
  8211  	// cond: boundsABI(kind) == 0
  8212  	// result: (LoweredPanicBoundsA [kind] x y mem)
  8213  	for {
  8214  		kind := auxIntToInt64(v.AuxInt)
  8215  		x := v_0
  8216  		y := v_1
  8217  		mem := v_2
  8218  		if !(boundsABI(kind) == 0) {
  8219  			break
  8220  		}
  8221  		v.reset(OpLOONG64LoweredPanicBoundsA)
  8222  		v.AuxInt = int64ToAuxInt(kind)
  8223  		v.AddArg3(x, y, mem)
  8224  		return true
  8225  	}
  8226  	// match: (PanicBounds [kind] x y mem)
  8227  	// cond: boundsABI(kind) == 1
  8228  	// result: (LoweredPanicBoundsB [kind] x y mem)
  8229  	for {
  8230  		kind := auxIntToInt64(v.AuxInt)
  8231  		x := v_0
  8232  		y := v_1
  8233  		mem := v_2
  8234  		if !(boundsABI(kind) == 1) {
  8235  			break
  8236  		}
  8237  		v.reset(OpLOONG64LoweredPanicBoundsB)
  8238  		v.AuxInt = int64ToAuxInt(kind)
  8239  		v.AddArg3(x, y, mem)
  8240  		return true
  8241  	}
  8242  	// match: (PanicBounds [kind] x y mem)
  8243  	// cond: boundsABI(kind) == 2
  8244  	// result: (LoweredPanicBoundsC [kind] x y mem)
  8245  	for {
  8246  		kind := auxIntToInt64(v.AuxInt)
  8247  		x := v_0
  8248  		y := v_1
  8249  		mem := v_2
  8250  		if !(boundsABI(kind) == 2) {
  8251  			break
  8252  		}
  8253  		v.reset(OpLOONG64LoweredPanicBoundsC)
  8254  		v.AuxInt = int64ToAuxInt(kind)
  8255  		v.AddArg3(x, y, mem)
  8256  		return true
  8257  	}
  8258  	return false
  8259  }
  8260  func rewriteValueLOONG64_OpPopCount16(v *Value) bool {
  8261  	v_0 := v.Args[0]
  8262  	b := v.Block
  8263  	typ := &b.Func.Config.Types
  8264  	// match: (PopCount16 <t> x)
  8265  	// result: (MOVWfpgp <t> (VPCNT16 <typ.Float32> (MOVWgpfp <typ.Float32> (ZeroExt16to32 x))))
  8266  	for {
  8267  		t := v.Type
  8268  		x := v_0
  8269  		v.reset(OpLOONG64MOVWfpgp)
  8270  		v.Type = t
  8271  		v0 := b.NewValue0(v.Pos, OpLOONG64VPCNT16, typ.Float32)
  8272  		v1 := b.NewValue0(v.Pos, OpLOONG64MOVWgpfp, typ.Float32)
  8273  		v2 := b.NewValue0(v.Pos, OpZeroExt16to32, typ.UInt32)
  8274  		v2.AddArg(x)
  8275  		v1.AddArg(v2)
  8276  		v0.AddArg(v1)
  8277  		v.AddArg(v0)
  8278  		return true
  8279  	}
  8280  }
  8281  func rewriteValueLOONG64_OpPopCount32(v *Value) bool {
  8282  	v_0 := v.Args[0]
  8283  	b := v.Block
  8284  	typ := &b.Func.Config.Types
  8285  	// match: (PopCount32 <t> x)
  8286  	// result: (MOVWfpgp <t> (VPCNT32 <typ.Float32> (MOVWgpfp <typ.Float32> x)))
  8287  	for {
  8288  		t := v.Type
  8289  		x := v_0
  8290  		v.reset(OpLOONG64MOVWfpgp)
  8291  		v.Type = t
  8292  		v0 := b.NewValue0(v.Pos, OpLOONG64VPCNT32, typ.Float32)
  8293  		v1 := b.NewValue0(v.Pos, OpLOONG64MOVWgpfp, typ.Float32)
  8294  		v1.AddArg(x)
  8295  		v0.AddArg(v1)
  8296  		v.AddArg(v0)
  8297  		return true
  8298  	}
  8299  }
  8300  func rewriteValueLOONG64_OpPopCount64(v *Value) bool {
  8301  	v_0 := v.Args[0]
  8302  	b := v.Block
  8303  	typ := &b.Func.Config.Types
  8304  	// match: (PopCount64 <t> x)
  8305  	// result: (MOVVfpgp <t> (VPCNT64 <typ.Float64> (MOVVgpfp <typ.Float64> x)))
  8306  	for {
  8307  		t := v.Type
  8308  		x := v_0
  8309  		v.reset(OpLOONG64MOVVfpgp)
  8310  		v.Type = t
  8311  		v0 := b.NewValue0(v.Pos, OpLOONG64VPCNT64, typ.Float64)
  8312  		v1 := b.NewValue0(v.Pos, OpLOONG64MOVVgpfp, typ.Float64)
  8313  		v1.AddArg(x)
  8314  		v0.AddArg(v1)
  8315  		v.AddArg(v0)
  8316  		return true
  8317  	}
  8318  }
  8319  func rewriteValueLOONG64_OpRotateLeft16(v *Value) bool {
  8320  	v_1 := v.Args[1]
  8321  	v_0 := v.Args[0]
  8322  	b := v.Block
  8323  	typ := &b.Func.Config.Types
  8324  	// match: (RotateLeft16 <t> x (MOVVconst [c]))
  8325  	// result: (Or16 (Lsh16x64 <t> x (MOVVconst [c&15])) (Rsh16Ux64 <t> x (MOVVconst [-c&15])))
  8326  	for {
  8327  		t := v.Type
  8328  		x := v_0
  8329  		if v_1.Op != OpLOONG64MOVVconst {
  8330  			break
  8331  		}
  8332  		c := auxIntToInt64(v_1.AuxInt)
  8333  		v.reset(OpOr16)
  8334  		v0 := b.NewValue0(v.Pos, OpLsh16x64, t)
  8335  		v1 := b.NewValue0(v.Pos, OpLOONG64MOVVconst, typ.UInt64)
  8336  		v1.AuxInt = int64ToAuxInt(c & 15)
  8337  		v0.AddArg2(x, v1)
  8338  		v2 := b.NewValue0(v.Pos, OpRsh16Ux64, t)
  8339  		v3 := b.NewValue0(v.Pos, OpLOONG64MOVVconst, typ.UInt64)
  8340  		v3.AuxInt = int64ToAuxInt(-c & 15)
  8341  		v2.AddArg2(x, v3)
  8342  		v.AddArg2(v0, v2)
  8343  		return true
  8344  	}
  8345  	// match: (RotateLeft16 <t> x y)
  8346  	// result: (ROTR <t> (OR <typ.UInt32> (ZeroExt16to32 x) (SLLVconst <t> (ZeroExt16to32 x) [16])) (NEGV <typ.Int64> y))
  8347  	for {
  8348  		t := v.Type
  8349  		x := v_0
  8350  		y := v_1
  8351  		v.reset(OpLOONG64ROTR)
  8352  		v.Type = t
  8353  		v0 := b.NewValue0(v.Pos, OpLOONG64OR, typ.UInt32)
  8354  		v1 := b.NewValue0(v.Pos, OpZeroExt16to32, typ.UInt32)
  8355  		v1.AddArg(x)
  8356  		v2 := b.NewValue0(v.Pos, OpLOONG64SLLVconst, t)
  8357  		v2.AuxInt = int64ToAuxInt(16)
  8358  		v2.AddArg(v1)
  8359  		v0.AddArg2(v1, v2)
  8360  		v3 := b.NewValue0(v.Pos, OpLOONG64NEGV, typ.Int64)
  8361  		v3.AddArg(y)
  8362  		v.AddArg2(v0, v3)
  8363  		return true
  8364  	}
  8365  }
  8366  func rewriteValueLOONG64_OpRotateLeft32(v *Value) bool {
  8367  	v_1 := v.Args[1]
  8368  	v_0 := v.Args[0]
  8369  	b := v.Block
  8370  	// match: (RotateLeft32 x y)
  8371  	// result: (ROTR x (NEGV <y.Type> y))
  8372  	for {
  8373  		x := v_0
  8374  		y := v_1
  8375  		v.reset(OpLOONG64ROTR)
  8376  		v0 := b.NewValue0(v.Pos, OpLOONG64NEGV, y.Type)
  8377  		v0.AddArg(y)
  8378  		v.AddArg2(x, v0)
  8379  		return true
  8380  	}
  8381  }
  8382  func rewriteValueLOONG64_OpRotateLeft64(v *Value) bool {
  8383  	v_1 := v.Args[1]
  8384  	v_0 := v.Args[0]
  8385  	b := v.Block
  8386  	// match: (RotateLeft64 x y)
  8387  	// result: (ROTRV x (NEGV <y.Type> y))
  8388  	for {
  8389  		x := v_0
  8390  		y := v_1
  8391  		v.reset(OpLOONG64ROTRV)
  8392  		v0 := b.NewValue0(v.Pos, OpLOONG64NEGV, y.Type)
  8393  		v0.AddArg(y)
  8394  		v.AddArg2(x, v0)
  8395  		return true
  8396  	}
  8397  }
  8398  func rewriteValueLOONG64_OpRotateLeft8(v *Value) bool {
  8399  	v_1 := v.Args[1]
  8400  	v_0 := v.Args[0]
  8401  	b := v.Block
  8402  	typ := &b.Func.Config.Types
  8403  	// match: (RotateLeft8 <t> x (MOVVconst [c]))
  8404  	// result: (Or8 (Lsh8x64 <t> x (MOVVconst [c&7])) (Rsh8Ux64 <t> x (MOVVconst [-c&7])))
  8405  	for {
  8406  		t := v.Type
  8407  		x := v_0
  8408  		if v_1.Op != OpLOONG64MOVVconst {
  8409  			break
  8410  		}
  8411  		c := auxIntToInt64(v_1.AuxInt)
  8412  		v.reset(OpOr8)
  8413  		v0 := b.NewValue0(v.Pos, OpLsh8x64, t)
  8414  		v1 := b.NewValue0(v.Pos, OpLOONG64MOVVconst, typ.UInt64)
  8415  		v1.AuxInt = int64ToAuxInt(c & 7)
  8416  		v0.AddArg2(x, v1)
  8417  		v2 := b.NewValue0(v.Pos, OpRsh8Ux64, t)
  8418  		v3 := b.NewValue0(v.Pos, OpLOONG64MOVVconst, typ.UInt64)
  8419  		v3.AuxInt = int64ToAuxInt(-c & 7)
  8420  		v2.AddArg2(x, v3)
  8421  		v.AddArg2(v0, v2)
  8422  		return true
  8423  	}
  8424  	// match: (RotateLeft8 <t> x y)
  8425  	// result: (OR <t> (SLLV <t> x (ANDconst <typ.Int64> [7] y)) (SRLV <t> (ZeroExt8to64 x) (ANDconst <typ.Int64> [7] (NEGV <typ.Int64> y))))
  8426  	for {
  8427  		t := v.Type
  8428  		x := v_0
  8429  		y := v_1
  8430  		v.reset(OpLOONG64OR)
  8431  		v.Type = t
  8432  		v0 := b.NewValue0(v.Pos, OpLOONG64SLLV, t)
  8433  		v1 := b.NewValue0(v.Pos, OpLOONG64ANDconst, typ.Int64)
  8434  		v1.AuxInt = int64ToAuxInt(7)
  8435  		v1.AddArg(y)
  8436  		v0.AddArg2(x, v1)
  8437  		v2 := b.NewValue0(v.Pos, OpLOONG64SRLV, t)
  8438  		v3 := b.NewValue0(v.Pos, OpZeroExt8to64, typ.UInt64)
  8439  		v3.AddArg(x)
  8440  		v4 := b.NewValue0(v.Pos, OpLOONG64ANDconst, typ.Int64)
  8441  		v4.AuxInt = int64ToAuxInt(7)
  8442  		v5 := b.NewValue0(v.Pos, OpLOONG64NEGV, typ.Int64)
  8443  		v5.AddArg(y)
  8444  		v4.AddArg(v5)
  8445  		v2.AddArg2(v3, v4)
  8446  		v.AddArg2(v0, v2)
  8447  		return true
  8448  	}
  8449  }
  8450  func rewriteValueLOONG64_OpRsh16Ux16(v *Value) bool {
  8451  	v_1 := v.Args[1]
  8452  	v_0 := v.Args[0]
  8453  	b := v.Block
  8454  	typ := &b.Func.Config.Types
  8455  	// match: (Rsh16Ux16 <t> x y)
  8456  	// result: (MASKEQZ (SRLV <t> (ZeroExt16to64 x) (ZeroExt16to64 y)) (SGTU (MOVVconst <typ.UInt64> [64]) (ZeroExt16to64 y)))
  8457  	for {
  8458  		t := v.Type
  8459  		x := v_0
  8460  		y := v_1
  8461  		v.reset(OpLOONG64MASKEQZ)
  8462  		v0 := b.NewValue0(v.Pos, OpLOONG64SRLV, t)
  8463  		v1 := b.NewValue0(v.Pos, OpZeroExt16to64, typ.UInt64)
  8464  		v1.AddArg(x)
  8465  		v2 := b.NewValue0(v.Pos, OpZeroExt16to64, typ.UInt64)
  8466  		v2.AddArg(y)
  8467  		v0.AddArg2(v1, v2)
  8468  		v3 := b.NewValue0(v.Pos, OpLOONG64SGTU, typ.Bool)
  8469  		v4 := b.NewValue0(v.Pos, OpLOONG64MOVVconst, typ.UInt64)
  8470  		v4.AuxInt = int64ToAuxInt(64)
  8471  		v3.AddArg2(v4, v2)
  8472  		v.AddArg2(v0, v3)
  8473  		return true
  8474  	}
  8475  }
  8476  func rewriteValueLOONG64_OpRsh16Ux32(v *Value) bool {
  8477  	v_1 := v.Args[1]
  8478  	v_0 := v.Args[0]
  8479  	b := v.Block
  8480  	typ := &b.Func.Config.Types
  8481  	// match: (Rsh16Ux32 <t> x y)
  8482  	// result: (MASKEQZ (SRLV <t> (ZeroExt16to64 x) (ZeroExt32to64 y)) (SGTU (MOVVconst <typ.UInt64> [64]) (ZeroExt32to64 y)))
  8483  	for {
  8484  		t := v.Type
  8485  		x := v_0
  8486  		y := v_1
  8487  		v.reset(OpLOONG64MASKEQZ)
  8488  		v0 := b.NewValue0(v.Pos, OpLOONG64SRLV, t)
  8489  		v1 := b.NewValue0(v.Pos, OpZeroExt16to64, typ.UInt64)
  8490  		v1.AddArg(x)
  8491  		v2 := b.NewValue0(v.Pos, OpZeroExt32to64, typ.UInt64)
  8492  		v2.AddArg(y)
  8493  		v0.AddArg2(v1, v2)
  8494  		v3 := b.NewValue0(v.Pos, OpLOONG64SGTU, typ.Bool)
  8495  		v4 := b.NewValue0(v.Pos, OpLOONG64MOVVconst, typ.UInt64)
  8496  		v4.AuxInt = int64ToAuxInt(64)
  8497  		v3.AddArg2(v4, v2)
  8498  		v.AddArg2(v0, v3)
  8499  		return true
  8500  	}
  8501  }
  8502  func rewriteValueLOONG64_OpRsh16Ux64(v *Value) bool {
  8503  	v_1 := v.Args[1]
  8504  	v_0 := v.Args[0]
  8505  	b := v.Block
  8506  	typ := &b.Func.Config.Types
  8507  	// match: (Rsh16Ux64 <t> x y)
  8508  	// result: (MASKEQZ (SRLV <t> (ZeroExt16to64 x) y) (SGTU (MOVVconst <typ.UInt64> [64]) y))
  8509  	for {
  8510  		t := v.Type
  8511  		x := v_0
  8512  		y := v_1
  8513  		v.reset(OpLOONG64MASKEQZ)
  8514  		v0 := b.NewValue0(v.Pos, OpLOONG64SRLV, t)
  8515  		v1 := b.NewValue0(v.Pos, OpZeroExt16to64, typ.UInt64)
  8516  		v1.AddArg(x)
  8517  		v0.AddArg2(v1, y)
  8518  		v2 := b.NewValue0(v.Pos, OpLOONG64SGTU, typ.Bool)
  8519  		v3 := b.NewValue0(v.Pos, OpLOONG64MOVVconst, typ.UInt64)
  8520  		v3.AuxInt = int64ToAuxInt(64)
  8521  		v2.AddArg2(v3, y)
  8522  		v.AddArg2(v0, v2)
  8523  		return true
  8524  	}
  8525  }
  8526  func rewriteValueLOONG64_OpRsh16Ux8(v *Value) bool {
  8527  	v_1 := v.Args[1]
  8528  	v_0 := v.Args[0]
  8529  	b := v.Block
  8530  	typ := &b.Func.Config.Types
  8531  	// match: (Rsh16Ux8 <t> x y)
  8532  	// result: (MASKEQZ (SRLV <t> (ZeroExt16to64 x) (ZeroExt8to64 y)) (SGTU (MOVVconst <typ.UInt64> [64]) (ZeroExt8to64 y)))
  8533  	for {
  8534  		t := v.Type
  8535  		x := v_0
  8536  		y := v_1
  8537  		v.reset(OpLOONG64MASKEQZ)
  8538  		v0 := b.NewValue0(v.Pos, OpLOONG64SRLV, t)
  8539  		v1 := b.NewValue0(v.Pos, OpZeroExt16to64, typ.UInt64)
  8540  		v1.AddArg(x)
  8541  		v2 := b.NewValue0(v.Pos, OpZeroExt8to64, typ.UInt64)
  8542  		v2.AddArg(y)
  8543  		v0.AddArg2(v1, v2)
  8544  		v3 := b.NewValue0(v.Pos, OpLOONG64SGTU, typ.Bool)
  8545  		v4 := b.NewValue0(v.Pos, OpLOONG64MOVVconst, typ.UInt64)
  8546  		v4.AuxInt = int64ToAuxInt(64)
  8547  		v3.AddArg2(v4, v2)
  8548  		v.AddArg2(v0, v3)
  8549  		return true
  8550  	}
  8551  }
  8552  func rewriteValueLOONG64_OpRsh16x16(v *Value) bool {
  8553  	v_1 := v.Args[1]
  8554  	v_0 := v.Args[0]
  8555  	b := v.Block
  8556  	typ := &b.Func.Config.Types
  8557  	// match: (Rsh16x16 <t> x y)
  8558  	// result: (SRAV (SignExt16to64 x) (OR <t> (NEGV <t> (SGTU (ZeroExt16to64 y) (MOVVconst <typ.UInt64> [63]))) (ZeroExt16to64 y)))
  8559  	for {
  8560  		t := v.Type
  8561  		x := v_0
  8562  		y := v_1
  8563  		v.reset(OpLOONG64SRAV)
  8564  		v0 := b.NewValue0(v.Pos, OpSignExt16to64, typ.Int64)
  8565  		v0.AddArg(x)
  8566  		v1 := b.NewValue0(v.Pos, OpLOONG64OR, t)
  8567  		v2 := b.NewValue0(v.Pos, OpLOONG64NEGV, t)
  8568  		v3 := b.NewValue0(v.Pos, OpLOONG64SGTU, typ.Bool)
  8569  		v4 := b.NewValue0(v.Pos, OpZeroExt16to64, typ.UInt64)
  8570  		v4.AddArg(y)
  8571  		v5 := b.NewValue0(v.Pos, OpLOONG64MOVVconst, typ.UInt64)
  8572  		v5.AuxInt = int64ToAuxInt(63)
  8573  		v3.AddArg2(v4, v5)
  8574  		v2.AddArg(v3)
  8575  		v1.AddArg2(v2, v4)
  8576  		v.AddArg2(v0, v1)
  8577  		return true
  8578  	}
  8579  }
  8580  func rewriteValueLOONG64_OpRsh16x32(v *Value) bool {
  8581  	v_1 := v.Args[1]
  8582  	v_0 := v.Args[0]
  8583  	b := v.Block
  8584  	typ := &b.Func.Config.Types
  8585  	// match: (Rsh16x32 <t> x y)
  8586  	// result: (SRAV (SignExt16to64 x) (OR <t> (NEGV <t> (SGTU (ZeroExt32to64 y) (MOVVconst <typ.UInt64> [63]))) (ZeroExt32to64 y)))
  8587  	for {
  8588  		t := v.Type
  8589  		x := v_0
  8590  		y := v_1
  8591  		v.reset(OpLOONG64SRAV)
  8592  		v0 := b.NewValue0(v.Pos, OpSignExt16to64, typ.Int64)
  8593  		v0.AddArg(x)
  8594  		v1 := b.NewValue0(v.Pos, OpLOONG64OR, t)
  8595  		v2 := b.NewValue0(v.Pos, OpLOONG64NEGV, t)
  8596  		v3 := b.NewValue0(v.Pos, OpLOONG64SGTU, typ.Bool)
  8597  		v4 := b.NewValue0(v.Pos, OpZeroExt32to64, typ.UInt64)
  8598  		v4.AddArg(y)
  8599  		v5 := b.NewValue0(v.Pos, OpLOONG64MOVVconst, typ.UInt64)
  8600  		v5.AuxInt = int64ToAuxInt(63)
  8601  		v3.AddArg2(v4, v5)
  8602  		v2.AddArg(v3)
  8603  		v1.AddArg2(v2, v4)
  8604  		v.AddArg2(v0, v1)
  8605  		return true
  8606  	}
  8607  }
  8608  func rewriteValueLOONG64_OpRsh16x64(v *Value) bool {
  8609  	v_1 := v.Args[1]
  8610  	v_0 := v.Args[0]
  8611  	b := v.Block
  8612  	typ := &b.Func.Config.Types
  8613  	// match: (Rsh16x64 <t> x y)
  8614  	// result: (SRAV (SignExt16to64 x) (OR <t> (NEGV <t> (SGTU y (MOVVconst <typ.UInt64> [63]))) y))
  8615  	for {
  8616  		t := v.Type
  8617  		x := v_0
  8618  		y := v_1
  8619  		v.reset(OpLOONG64SRAV)
  8620  		v0 := b.NewValue0(v.Pos, OpSignExt16to64, typ.Int64)
  8621  		v0.AddArg(x)
  8622  		v1 := b.NewValue0(v.Pos, OpLOONG64OR, t)
  8623  		v2 := b.NewValue0(v.Pos, OpLOONG64NEGV, t)
  8624  		v3 := b.NewValue0(v.Pos, OpLOONG64SGTU, typ.Bool)
  8625  		v4 := b.NewValue0(v.Pos, OpLOONG64MOVVconst, typ.UInt64)
  8626  		v4.AuxInt = int64ToAuxInt(63)
  8627  		v3.AddArg2(y, v4)
  8628  		v2.AddArg(v3)
  8629  		v1.AddArg2(v2, y)
  8630  		v.AddArg2(v0, v1)
  8631  		return true
  8632  	}
  8633  }
  8634  func rewriteValueLOONG64_OpRsh16x8(v *Value) bool {
  8635  	v_1 := v.Args[1]
  8636  	v_0 := v.Args[0]
  8637  	b := v.Block
  8638  	typ := &b.Func.Config.Types
  8639  	// match: (Rsh16x8 <t> x y)
  8640  	// result: (SRAV (SignExt16to64 x) (OR <t> (NEGV <t> (SGTU (ZeroExt8to64 y) (MOVVconst <typ.UInt64> [63]))) (ZeroExt8to64 y)))
  8641  	for {
  8642  		t := v.Type
  8643  		x := v_0
  8644  		y := v_1
  8645  		v.reset(OpLOONG64SRAV)
  8646  		v0 := b.NewValue0(v.Pos, OpSignExt16to64, typ.Int64)
  8647  		v0.AddArg(x)
  8648  		v1 := b.NewValue0(v.Pos, OpLOONG64OR, t)
  8649  		v2 := b.NewValue0(v.Pos, OpLOONG64NEGV, t)
  8650  		v3 := b.NewValue0(v.Pos, OpLOONG64SGTU, typ.Bool)
  8651  		v4 := b.NewValue0(v.Pos, OpZeroExt8to64, typ.UInt64)
  8652  		v4.AddArg(y)
  8653  		v5 := b.NewValue0(v.Pos, OpLOONG64MOVVconst, typ.UInt64)
  8654  		v5.AuxInt = int64ToAuxInt(63)
  8655  		v3.AddArg2(v4, v5)
  8656  		v2.AddArg(v3)
  8657  		v1.AddArg2(v2, v4)
  8658  		v.AddArg2(v0, v1)
  8659  		return true
  8660  	}
  8661  }
  8662  func rewriteValueLOONG64_OpRsh32Ux16(v *Value) bool {
  8663  	v_1 := v.Args[1]
  8664  	v_0 := v.Args[0]
  8665  	b := v.Block
  8666  	typ := &b.Func.Config.Types
  8667  	// match: (Rsh32Ux16 <t> x y)
  8668  	// result: (MASKEQZ (SRLV <t> (ZeroExt32to64 x) (ZeroExt16to64 y)) (SGTU (MOVVconst <typ.UInt64> [64]) (ZeroExt16to64 y)))
  8669  	for {
  8670  		t := v.Type
  8671  		x := v_0
  8672  		y := v_1
  8673  		v.reset(OpLOONG64MASKEQZ)
  8674  		v0 := b.NewValue0(v.Pos, OpLOONG64SRLV, t)
  8675  		v1 := b.NewValue0(v.Pos, OpZeroExt32to64, typ.UInt64)
  8676  		v1.AddArg(x)
  8677  		v2 := b.NewValue0(v.Pos, OpZeroExt16to64, typ.UInt64)
  8678  		v2.AddArg(y)
  8679  		v0.AddArg2(v1, v2)
  8680  		v3 := b.NewValue0(v.Pos, OpLOONG64SGTU, typ.Bool)
  8681  		v4 := b.NewValue0(v.Pos, OpLOONG64MOVVconst, typ.UInt64)
  8682  		v4.AuxInt = int64ToAuxInt(64)
  8683  		v3.AddArg2(v4, v2)
  8684  		v.AddArg2(v0, v3)
  8685  		return true
  8686  	}
  8687  }
  8688  func rewriteValueLOONG64_OpRsh32Ux32(v *Value) bool {
  8689  	v_1 := v.Args[1]
  8690  	v_0 := v.Args[0]
  8691  	b := v.Block
  8692  	typ := &b.Func.Config.Types
  8693  	// match: (Rsh32Ux32 <t> x y)
  8694  	// result: (MASKEQZ (SRLV <t> (ZeroExt32to64 x) (ZeroExt32to64 y)) (SGTU (MOVVconst <typ.UInt64> [64]) (ZeroExt32to64 y)))
  8695  	for {
  8696  		t := v.Type
  8697  		x := v_0
  8698  		y := v_1
  8699  		v.reset(OpLOONG64MASKEQZ)
  8700  		v0 := b.NewValue0(v.Pos, OpLOONG64SRLV, t)
  8701  		v1 := b.NewValue0(v.Pos, OpZeroExt32to64, typ.UInt64)
  8702  		v1.AddArg(x)
  8703  		v2 := b.NewValue0(v.Pos, OpZeroExt32to64, typ.UInt64)
  8704  		v2.AddArg(y)
  8705  		v0.AddArg2(v1, v2)
  8706  		v3 := b.NewValue0(v.Pos, OpLOONG64SGTU, typ.Bool)
  8707  		v4 := b.NewValue0(v.Pos, OpLOONG64MOVVconst, typ.UInt64)
  8708  		v4.AuxInt = int64ToAuxInt(64)
  8709  		v3.AddArg2(v4, v2)
  8710  		v.AddArg2(v0, v3)
  8711  		return true
  8712  	}
  8713  }
  8714  func rewriteValueLOONG64_OpRsh32Ux64(v *Value) bool {
  8715  	v_1 := v.Args[1]
  8716  	v_0 := v.Args[0]
  8717  	b := v.Block
  8718  	typ := &b.Func.Config.Types
  8719  	// match: (Rsh32Ux64 <t> x y)
  8720  	// result: (MASKEQZ (SRLV <t> (ZeroExt32to64 x) y) (SGTU (MOVVconst <typ.UInt64> [64]) y))
  8721  	for {
  8722  		t := v.Type
  8723  		x := v_0
  8724  		y := v_1
  8725  		v.reset(OpLOONG64MASKEQZ)
  8726  		v0 := b.NewValue0(v.Pos, OpLOONG64SRLV, t)
  8727  		v1 := b.NewValue0(v.Pos, OpZeroExt32to64, typ.UInt64)
  8728  		v1.AddArg(x)
  8729  		v0.AddArg2(v1, y)
  8730  		v2 := b.NewValue0(v.Pos, OpLOONG64SGTU, typ.Bool)
  8731  		v3 := b.NewValue0(v.Pos, OpLOONG64MOVVconst, typ.UInt64)
  8732  		v3.AuxInt = int64ToAuxInt(64)
  8733  		v2.AddArg2(v3, y)
  8734  		v.AddArg2(v0, v2)
  8735  		return true
  8736  	}
  8737  }
  8738  func rewriteValueLOONG64_OpRsh32Ux8(v *Value) bool {
  8739  	v_1 := v.Args[1]
  8740  	v_0 := v.Args[0]
  8741  	b := v.Block
  8742  	typ := &b.Func.Config.Types
  8743  	// match: (Rsh32Ux8 <t> x y)
  8744  	// result: (MASKEQZ (SRLV <t> (ZeroExt32to64 x) (ZeroExt8to64 y)) (SGTU (MOVVconst <typ.UInt64> [64]) (ZeroExt8to64 y)))
  8745  	for {
  8746  		t := v.Type
  8747  		x := v_0
  8748  		y := v_1
  8749  		v.reset(OpLOONG64MASKEQZ)
  8750  		v0 := b.NewValue0(v.Pos, OpLOONG64SRLV, t)
  8751  		v1 := b.NewValue0(v.Pos, OpZeroExt32to64, typ.UInt64)
  8752  		v1.AddArg(x)
  8753  		v2 := b.NewValue0(v.Pos, OpZeroExt8to64, typ.UInt64)
  8754  		v2.AddArg(y)
  8755  		v0.AddArg2(v1, v2)
  8756  		v3 := b.NewValue0(v.Pos, OpLOONG64SGTU, typ.Bool)
  8757  		v4 := b.NewValue0(v.Pos, OpLOONG64MOVVconst, typ.UInt64)
  8758  		v4.AuxInt = int64ToAuxInt(64)
  8759  		v3.AddArg2(v4, v2)
  8760  		v.AddArg2(v0, v3)
  8761  		return true
  8762  	}
  8763  }
  8764  func rewriteValueLOONG64_OpRsh32x16(v *Value) bool {
  8765  	v_1 := v.Args[1]
  8766  	v_0 := v.Args[0]
  8767  	b := v.Block
  8768  	typ := &b.Func.Config.Types
  8769  	// match: (Rsh32x16 <t> x y)
  8770  	// result: (SRAV (SignExt32to64 x) (OR <t> (NEGV <t> (SGTU (ZeroExt16to64 y) (MOVVconst <typ.UInt64> [63]))) (ZeroExt16to64 y)))
  8771  	for {
  8772  		t := v.Type
  8773  		x := v_0
  8774  		y := v_1
  8775  		v.reset(OpLOONG64SRAV)
  8776  		v0 := b.NewValue0(v.Pos, OpSignExt32to64, typ.Int64)
  8777  		v0.AddArg(x)
  8778  		v1 := b.NewValue0(v.Pos, OpLOONG64OR, t)
  8779  		v2 := b.NewValue0(v.Pos, OpLOONG64NEGV, t)
  8780  		v3 := b.NewValue0(v.Pos, OpLOONG64SGTU, typ.Bool)
  8781  		v4 := b.NewValue0(v.Pos, OpZeroExt16to64, typ.UInt64)
  8782  		v4.AddArg(y)
  8783  		v5 := b.NewValue0(v.Pos, OpLOONG64MOVVconst, typ.UInt64)
  8784  		v5.AuxInt = int64ToAuxInt(63)
  8785  		v3.AddArg2(v4, v5)
  8786  		v2.AddArg(v3)
  8787  		v1.AddArg2(v2, v4)
  8788  		v.AddArg2(v0, v1)
  8789  		return true
  8790  	}
  8791  }
  8792  func rewriteValueLOONG64_OpRsh32x32(v *Value) bool {
  8793  	v_1 := v.Args[1]
  8794  	v_0 := v.Args[0]
  8795  	b := v.Block
  8796  	typ := &b.Func.Config.Types
  8797  	// match: (Rsh32x32 <t> x y)
  8798  	// result: (SRAV (SignExt32to64 x) (OR <t> (NEGV <t> (SGTU (ZeroExt32to64 y) (MOVVconst <typ.UInt64> [63]))) (ZeroExt32to64 y)))
  8799  	for {
  8800  		t := v.Type
  8801  		x := v_0
  8802  		y := v_1
  8803  		v.reset(OpLOONG64SRAV)
  8804  		v0 := b.NewValue0(v.Pos, OpSignExt32to64, typ.Int64)
  8805  		v0.AddArg(x)
  8806  		v1 := b.NewValue0(v.Pos, OpLOONG64OR, t)
  8807  		v2 := b.NewValue0(v.Pos, OpLOONG64NEGV, t)
  8808  		v3 := b.NewValue0(v.Pos, OpLOONG64SGTU, typ.Bool)
  8809  		v4 := b.NewValue0(v.Pos, OpZeroExt32to64, typ.UInt64)
  8810  		v4.AddArg(y)
  8811  		v5 := b.NewValue0(v.Pos, OpLOONG64MOVVconst, typ.UInt64)
  8812  		v5.AuxInt = int64ToAuxInt(63)
  8813  		v3.AddArg2(v4, v5)
  8814  		v2.AddArg(v3)
  8815  		v1.AddArg2(v2, v4)
  8816  		v.AddArg2(v0, v1)
  8817  		return true
  8818  	}
  8819  }
  8820  func rewriteValueLOONG64_OpRsh32x64(v *Value) bool {
  8821  	v_1 := v.Args[1]
  8822  	v_0 := v.Args[0]
  8823  	b := v.Block
  8824  	typ := &b.Func.Config.Types
  8825  	// match: (Rsh32x64 <t> x y)
  8826  	// result: (SRAV (SignExt32to64 x) (OR <t> (NEGV <t> (SGTU y (MOVVconst <typ.UInt64> [63]))) y))
  8827  	for {
  8828  		t := v.Type
  8829  		x := v_0
  8830  		y := v_1
  8831  		v.reset(OpLOONG64SRAV)
  8832  		v0 := b.NewValue0(v.Pos, OpSignExt32to64, typ.Int64)
  8833  		v0.AddArg(x)
  8834  		v1 := b.NewValue0(v.Pos, OpLOONG64OR, t)
  8835  		v2 := b.NewValue0(v.Pos, OpLOONG64NEGV, t)
  8836  		v3 := b.NewValue0(v.Pos, OpLOONG64SGTU, typ.Bool)
  8837  		v4 := b.NewValue0(v.Pos, OpLOONG64MOVVconst, typ.UInt64)
  8838  		v4.AuxInt = int64ToAuxInt(63)
  8839  		v3.AddArg2(y, v4)
  8840  		v2.AddArg(v3)
  8841  		v1.AddArg2(v2, y)
  8842  		v.AddArg2(v0, v1)
  8843  		return true
  8844  	}
  8845  }
  8846  func rewriteValueLOONG64_OpRsh32x8(v *Value) bool {
  8847  	v_1 := v.Args[1]
  8848  	v_0 := v.Args[0]
  8849  	b := v.Block
  8850  	typ := &b.Func.Config.Types
  8851  	// match: (Rsh32x8 <t> x y)
  8852  	// result: (SRAV (SignExt32to64 x) (OR <t> (NEGV <t> (SGTU (ZeroExt8to64 y) (MOVVconst <typ.UInt64> [63]))) (ZeroExt8to64 y)))
  8853  	for {
  8854  		t := v.Type
  8855  		x := v_0
  8856  		y := v_1
  8857  		v.reset(OpLOONG64SRAV)
  8858  		v0 := b.NewValue0(v.Pos, OpSignExt32to64, typ.Int64)
  8859  		v0.AddArg(x)
  8860  		v1 := b.NewValue0(v.Pos, OpLOONG64OR, t)
  8861  		v2 := b.NewValue0(v.Pos, OpLOONG64NEGV, t)
  8862  		v3 := b.NewValue0(v.Pos, OpLOONG64SGTU, typ.Bool)
  8863  		v4 := b.NewValue0(v.Pos, OpZeroExt8to64, typ.UInt64)
  8864  		v4.AddArg(y)
  8865  		v5 := b.NewValue0(v.Pos, OpLOONG64MOVVconst, typ.UInt64)
  8866  		v5.AuxInt = int64ToAuxInt(63)
  8867  		v3.AddArg2(v4, v5)
  8868  		v2.AddArg(v3)
  8869  		v1.AddArg2(v2, v4)
  8870  		v.AddArg2(v0, v1)
  8871  		return true
  8872  	}
  8873  }
  8874  func rewriteValueLOONG64_OpRsh64Ux16(v *Value) bool {
  8875  	v_1 := v.Args[1]
  8876  	v_0 := v.Args[0]
  8877  	b := v.Block
  8878  	typ := &b.Func.Config.Types
  8879  	// match: (Rsh64Ux16 <t> x y)
  8880  	// result: (MASKEQZ (SRLV <t> x (ZeroExt16to64 y)) (SGTU (MOVVconst <typ.UInt64> [64]) (ZeroExt16to64 y)))
  8881  	for {
  8882  		t := v.Type
  8883  		x := v_0
  8884  		y := v_1
  8885  		v.reset(OpLOONG64MASKEQZ)
  8886  		v0 := b.NewValue0(v.Pos, OpLOONG64SRLV, t)
  8887  		v1 := b.NewValue0(v.Pos, OpZeroExt16to64, typ.UInt64)
  8888  		v1.AddArg(y)
  8889  		v0.AddArg2(x, v1)
  8890  		v2 := b.NewValue0(v.Pos, OpLOONG64SGTU, typ.Bool)
  8891  		v3 := b.NewValue0(v.Pos, OpLOONG64MOVVconst, typ.UInt64)
  8892  		v3.AuxInt = int64ToAuxInt(64)
  8893  		v2.AddArg2(v3, v1)
  8894  		v.AddArg2(v0, v2)
  8895  		return true
  8896  	}
  8897  }
  8898  func rewriteValueLOONG64_OpRsh64Ux32(v *Value) bool {
  8899  	v_1 := v.Args[1]
  8900  	v_0 := v.Args[0]
  8901  	b := v.Block
  8902  	typ := &b.Func.Config.Types
  8903  	// match: (Rsh64Ux32 <t> x y)
  8904  	// result: (MASKEQZ (SRLV <t> x (ZeroExt32to64 y)) (SGTU (MOVVconst <typ.UInt64> [64]) (ZeroExt32to64 y)))
  8905  	for {
  8906  		t := v.Type
  8907  		x := v_0
  8908  		y := v_1
  8909  		v.reset(OpLOONG64MASKEQZ)
  8910  		v0 := b.NewValue0(v.Pos, OpLOONG64SRLV, t)
  8911  		v1 := b.NewValue0(v.Pos, OpZeroExt32to64, typ.UInt64)
  8912  		v1.AddArg(y)
  8913  		v0.AddArg2(x, v1)
  8914  		v2 := b.NewValue0(v.Pos, OpLOONG64SGTU, typ.Bool)
  8915  		v3 := b.NewValue0(v.Pos, OpLOONG64MOVVconst, typ.UInt64)
  8916  		v3.AuxInt = int64ToAuxInt(64)
  8917  		v2.AddArg2(v3, v1)
  8918  		v.AddArg2(v0, v2)
  8919  		return true
  8920  	}
  8921  }
  8922  func rewriteValueLOONG64_OpRsh64Ux64(v *Value) bool {
  8923  	v_1 := v.Args[1]
  8924  	v_0 := v.Args[0]
  8925  	b := v.Block
  8926  	typ := &b.Func.Config.Types
  8927  	// match: (Rsh64Ux64 <t> x y)
  8928  	// result: (MASKEQZ (SRLV <t> x y) (SGTU (MOVVconst <typ.UInt64> [64]) y))
  8929  	for {
  8930  		t := v.Type
  8931  		x := v_0
  8932  		y := v_1
  8933  		v.reset(OpLOONG64MASKEQZ)
  8934  		v0 := b.NewValue0(v.Pos, OpLOONG64SRLV, t)
  8935  		v0.AddArg2(x, y)
  8936  		v1 := b.NewValue0(v.Pos, OpLOONG64SGTU, typ.Bool)
  8937  		v2 := b.NewValue0(v.Pos, OpLOONG64MOVVconst, typ.UInt64)
  8938  		v2.AuxInt = int64ToAuxInt(64)
  8939  		v1.AddArg2(v2, y)
  8940  		v.AddArg2(v0, v1)
  8941  		return true
  8942  	}
  8943  }
  8944  func rewriteValueLOONG64_OpRsh64Ux8(v *Value) bool {
  8945  	v_1 := v.Args[1]
  8946  	v_0 := v.Args[0]
  8947  	b := v.Block
  8948  	typ := &b.Func.Config.Types
  8949  	// match: (Rsh64Ux8 <t> x y)
  8950  	// result: (MASKEQZ (SRLV <t> x (ZeroExt8to64 y)) (SGTU (MOVVconst <typ.UInt64> [64]) (ZeroExt8to64 y)))
  8951  	for {
  8952  		t := v.Type
  8953  		x := v_0
  8954  		y := v_1
  8955  		v.reset(OpLOONG64MASKEQZ)
  8956  		v0 := b.NewValue0(v.Pos, OpLOONG64SRLV, t)
  8957  		v1 := b.NewValue0(v.Pos, OpZeroExt8to64, typ.UInt64)
  8958  		v1.AddArg(y)
  8959  		v0.AddArg2(x, v1)
  8960  		v2 := b.NewValue0(v.Pos, OpLOONG64SGTU, typ.Bool)
  8961  		v3 := b.NewValue0(v.Pos, OpLOONG64MOVVconst, typ.UInt64)
  8962  		v3.AuxInt = int64ToAuxInt(64)
  8963  		v2.AddArg2(v3, v1)
  8964  		v.AddArg2(v0, v2)
  8965  		return true
  8966  	}
  8967  }
  8968  func rewriteValueLOONG64_OpRsh64x16(v *Value) bool {
  8969  	v_1 := v.Args[1]
  8970  	v_0 := v.Args[0]
  8971  	b := v.Block
  8972  	typ := &b.Func.Config.Types
  8973  	// match: (Rsh64x16 <t> x y)
  8974  	// result: (SRAV x (OR <t> (NEGV <t> (SGTU (ZeroExt16to64 y) (MOVVconst <typ.UInt64> [63]))) (ZeroExt16to64 y)))
  8975  	for {
  8976  		t := v.Type
  8977  		x := v_0
  8978  		y := v_1
  8979  		v.reset(OpLOONG64SRAV)
  8980  		v0 := b.NewValue0(v.Pos, OpLOONG64OR, t)
  8981  		v1 := b.NewValue0(v.Pos, OpLOONG64NEGV, t)
  8982  		v2 := b.NewValue0(v.Pos, OpLOONG64SGTU, typ.Bool)
  8983  		v3 := b.NewValue0(v.Pos, OpZeroExt16to64, typ.UInt64)
  8984  		v3.AddArg(y)
  8985  		v4 := b.NewValue0(v.Pos, OpLOONG64MOVVconst, typ.UInt64)
  8986  		v4.AuxInt = int64ToAuxInt(63)
  8987  		v2.AddArg2(v3, v4)
  8988  		v1.AddArg(v2)
  8989  		v0.AddArg2(v1, v3)
  8990  		v.AddArg2(x, v0)
  8991  		return true
  8992  	}
  8993  }
  8994  func rewriteValueLOONG64_OpRsh64x32(v *Value) bool {
  8995  	v_1 := v.Args[1]
  8996  	v_0 := v.Args[0]
  8997  	b := v.Block
  8998  	typ := &b.Func.Config.Types
  8999  	// match: (Rsh64x32 <t> x y)
  9000  	// result: (SRAV x (OR <t> (NEGV <t> (SGTU (ZeroExt32to64 y) (MOVVconst <typ.UInt64> [63]))) (ZeroExt32to64 y)))
  9001  	for {
  9002  		t := v.Type
  9003  		x := v_0
  9004  		y := v_1
  9005  		v.reset(OpLOONG64SRAV)
  9006  		v0 := b.NewValue0(v.Pos, OpLOONG64OR, t)
  9007  		v1 := b.NewValue0(v.Pos, OpLOONG64NEGV, t)
  9008  		v2 := b.NewValue0(v.Pos, OpLOONG64SGTU, typ.Bool)
  9009  		v3 := b.NewValue0(v.Pos, OpZeroExt32to64, typ.UInt64)
  9010  		v3.AddArg(y)
  9011  		v4 := b.NewValue0(v.Pos, OpLOONG64MOVVconst, typ.UInt64)
  9012  		v4.AuxInt = int64ToAuxInt(63)
  9013  		v2.AddArg2(v3, v4)
  9014  		v1.AddArg(v2)
  9015  		v0.AddArg2(v1, v3)
  9016  		v.AddArg2(x, v0)
  9017  		return true
  9018  	}
  9019  }
  9020  func rewriteValueLOONG64_OpRsh64x64(v *Value) bool {
  9021  	v_1 := v.Args[1]
  9022  	v_0 := v.Args[0]
  9023  	b := v.Block
  9024  	typ := &b.Func.Config.Types
  9025  	// match: (Rsh64x64 <t> x y)
  9026  	// result: (SRAV x (OR <t> (NEGV <t> (SGTU y (MOVVconst <typ.UInt64> [63]))) y))
  9027  	for {
  9028  		t := v.Type
  9029  		x := v_0
  9030  		y := v_1
  9031  		v.reset(OpLOONG64SRAV)
  9032  		v0 := b.NewValue0(v.Pos, OpLOONG64OR, t)
  9033  		v1 := b.NewValue0(v.Pos, OpLOONG64NEGV, t)
  9034  		v2 := b.NewValue0(v.Pos, OpLOONG64SGTU, typ.Bool)
  9035  		v3 := b.NewValue0(v.Pos, OpLOONG64MOVVconst, typ.UInt64)
  9036  		v3.AuxInt = int64ToAuxInt(63)
  9037  		v2.AddArg2(y, v3)
  9038  		v1.AddArg(v2)
  9039  		v0.AddArg2(v1, y)
  9040  		v.AddArg2(x, v0)
  9041  		return true
  9042  	}
  9043  }
  9044  func rewriteValueLOONG64_OpRsh64x8(v *Value) bool {
  9045  	v_1 := v.Args[1]
  9046  	v_0 := v.Args[0]
  9047  	b := v.Block
  9048  	typ := &b.Func.Config.Types
  9049  	// match: (Rsh64x8 <t> x y)
  9050  	// result: (SRAV x (OR <t> (NEGV <t> (SGTU (ZeroExt8to64 y) (MOVVconst <typ.UInt64> [63]))) (ZeroExt8to64 y)))
  9051  	for {
  9052  		t := v.Type
  9053  		x := v_0
  9054  		y := v_1
  9055  		v.reset(OpLOONG64SRAV)
  9056  		v0 := b.NewValue0(v.Pos, OpLOONG64OR, t)
  9057  		v1 := b.NewValue0(v.Pos, OpLOONG64NEGV, t)
  9058  		v2 := b.NewValue0(v.Pos, OpLOONG64SGTU, typ.Bool)
  9059  		v3 := b.NewValue0(v.Pos, OpZeroExt8to64, typ.UInt64)
  9060  		v3.AddArg(y)
  9061  		v4 := b.NewValue0(v.Pos, OpLOONG64MOVVconst, typ.UInt64)
  9062  		v4.AuxInt = int64ToAuxInt(63)
  9063  		v2.AddArg2(v3, v4)
  9064  		v1.AddArg(v2)
  9065  		v0.AddArg2(v1, v3)
  9066  		v.AddArg2(x, v0)
  9067  		return true
  9068  	}
  9069  }
  9070  func rewriteValueLOONG64_OpRsh8Ux16(v *Value) bool {
  9071  	v_1 := v.Args[1]
  9072  	v_0 := v.Args[0]
  9073  	b := v.Block
  9074  	typ := &b.Func.Config.Types
  9075  	// match: (Rsh8Ux16 <t> x y)
  9076  	// result: (MASKEQZ (SRLV <t> (ZeroExt8to64 x) (ZeroExt16to64 y)) (SGTU (MOVVconst <typ.UInt64> [64]) (ZeroExt16to64 y)))
  9077  	for {
  9078  		t := v.Type
  9079  		x := v_0
  9080  		y := v_1
  9081  		v.reset(OpLOONG64MASKEQZ)
  9082  		v0 := b.NewValue0(v.Pos, OpLOONG64SRLV, t)
  9083  		v1 := b.NewValue0(v.Pos, OpZeroExt8to64, typ.UInt64)
  9084  		v1.AddArg(x)
  9085  		v2 := b.NewValue0(v.Pos, OpZeroExt16to64, typ.UInt64)
  9086  		v2.AddArg(y)
  9087  		v0.AddArg2(v1, v2)
  9088  		v3 := b.NewValue0(v.Pos, OpLOONG64SGTU, typ.Bool)
  9089  		v4 := b.NewValue0(v.Pos, OpLOONG64MOVVconst, typ.UInt64)
  9090  		v4.AuxInt = int64ToAuxInt(64)
  9091  		v3.AddArg2(v4, v2)
  9092  		v.AddArg2(v0, v3)
  9093  		return true
  9094  	}
  9095  }
  9096  func rewriteValueLOONG64_OpRsh8Ux32(v *Value) bool {
  9097  	v_1 := v.Args[1]
  9098  	v_0 := v.Args[0]
  9099  	b := v.Block
  9100  	typ := &b.Func.Config.Types
  9101  	// match: (Rsh8Ux32 <t> x y)
  9102  	// result: (MASKEQZ (SRLV <t> (ZeroExt8to64 x) (ZeroExt32to64 y)) (SGTU (MOVVconst <typ.UInt64> [64]) (ZeroExt32to64 y)))
  9103  	for {
  9104  		t := v.Type
  9105  		x := v_0
  9106  		y := v_1
  9107  		v.reset(OpLOONG64MASKEQZ)
  9108  		v0 := b.NewValue0(v.Pos, OpLOONG64SRLV, t)
  9109  		v1 := b.NewValue0(v.Pos, OpZeroExt8to64, typ.UInt64)
  9110  		v1.AddArg(x)
  9111  		v2 := b.NewValue0(v.Pos, OpZeroExt32to64, typ.UInt64)
  9112  		v2.AddArg(y)
  9113  		v0.AddArg2(v1, v2)
  9114  		v3 := b.NewValue0(v.Pos, OpLOONG64SGTU, typ.Bool)
  9115  		v4 := b.NewValue0(v.Pos, OpLOONG64MOVVconst, typ.UInt64)
  9116  		v4.AuxInt = int64ToAuxInt(64)
  9117  		v3.AddArg2(v4, v2)
  9118  		v.AddArg2(v0, v3)
  9119  		return true
  9120  	}
  9121  }
  9122  func rewriteValueLOONG64_OpRsh8Ux64(v *Value) bool {
  9123  	v_1 := v.Args[1]
  9124  	v_0 := v.Args[0]
  9125  	b := v.Block
  9126  	typ := &b.Func.Config.Types
  9127  	// match: (Rsh8Ux64 <t> x y)
  9128  	// result: (MASKEQZ (SRLV <t> (ZeroExt8to64 x) y) (SGTU (MOVVconst <typ.UInt64> [64]) y))
  9129  	for {
  9130  		t := v.Type
  9131  		x := v_0
  9132  		y := v_1
  9133  		v.reset(OpLOONG64MASKEQZ)
  9134  		v0 := b.NewValue0(v.Pos, OpLOONG64SRLV, t)
  9135  		v1 := b.NewValue0(v.Pos, OpZeroExt8to64, typ.UInt64)
  9136  		v1.AddArg(x)
  9137  		v0.AddArg2(v1, y)
  9138  		v2 := b.NewValue0(v.Pos, OpLOONG64SGTU, typ.Bool)
  9139  		v3 := b.NewValue0(v.Pos, OpLOONG64MOVVconst, typ.UInt64)
  9140  		v3.AuxInt = int64ToAuxInt(64)
  9141  		v2.AddArg2(v3, y)
  9142  		v.AddArg2(v0, v2)
  9143  		return true
  9144  	}
  9145  }
  9146  func rewriteValueLOONG64_OpRsh8Ux8(v *Value) bool {
  9147  	v_1 := v.Args[1]
  9148  	v_0 := v.Args[0]
  9149  	b := v.Block
  9150  	typ := &b.Func.Config.Types
  9151  	// match: (Rsh8Ux8 <t> x y)
  9152  	// result: (MASKEQZ (SRLV <t> (ZeroExt8to64 x) (ZeroExt8to64 y)) (SGTU (MOVVconst <typ.UInt64> [64]) (ZeroExt8to64 y)))
  9153  	for {
  9154  		t := v.Type
  9155  		x := v_0
  9156  		y := v_1
  9157  		v.reset(OpLOONG64MASKEQZ)
  9158  		v0 := b.NewValue0(v.Pos, OpLOONG64SRLV, t)
  9159  		v1 := b.NewValue0(v.Pos, OpZeroExt8to64, typ.UInt64)
  9160  		v1.AddArg(x)
  9161  		v2 := b.NewValue0(v.Pos, OpZeroExt8to64, typ.UInt64)
  9162  		v2.AddArg(y)
  9163  		v0.AddArg2(v1, v2)
  9164  		v3 := b.NewValue0(v.Pos, OpLOONG64SGTU, typ.Bool)
  9165  		v4 := b.NewValue0(v.Pos, OpLOONG64MOVVconst, typ.UInt64)
  9166  		v4.AuxInt = int64ToAuxInt(64)
  9167  		v3.AddArg2(v4, v2)
  9168  		v.AddArg2(v0, v3)
  9169  		return true
  9170  	}
  9171  }
  9172  func rewriteValueLOONG64_OpRsh8x16(v *Value) bool {
  9173  	v_1 := v.Args[1]
  9174  	v_0 := v.Args[0]
  9175  	b := v.Block
  9176  	typ := &b.Func.Config.Types
  9177  	// match: (Rsh8x16 <t> x y)
  9178  	// result: (SRAV (SignExt8to64 x) (OR <t> (NEGV <t> (SGTU (ZeroExt16to64 y) (MOVVconst <typ.UInt64> [63]))) (ZeroExt16to64 y)))
  9179  	for {
  9180  		t := v.Type
  9181  		x := v_0
  9182  		y := v_1
  9183  		v.reset(OpLOONG64SRAV)
  9184  		v0 := b.NewValue0(v.Pos, OpSignExt8to64, typ.Int64)
  9185  		v0.AddArg(x)
  9186  		v1 := b.NewValue0(v.Pos, OpLOONG64OR, t)
  9187  		v2 := b.NewValue0(v.Pos, OpLOONG64NEGV, t)
  9188  		v3 := b.NewValue0(v.Pos, OpLOONG64SGTU, typ.Bool)
  9189  		v4 := b.NewValue0(v.Pos, OpZeroExt16to64, typ.UInt64)
  9190  		v4.AddArg(y)
  9191  		v5 := b.NewValue0(v.Pos, OpLOONG64MOVVconst, typ.UInt64)
  9192  		v5.AuxInt = int64ToAuxInt(63)
  9193  		v3.AddArg2(v4, v5)
  9194  		v2.AddArg(v3)
  9195  		v1.AddArg2(v2, v4)
  9196  		v.AddArg2(v0, v1)
  9197  		return true
  9198  	}
  9199  }
  9200  func rewriteValueLOONG64_OpRsh8x32(v *Value) bool {
  9201  	v_1 := v.Args[1]
  9202  	v_0 := v.Args[0]
  9203  	b := v.Block
  9204  	typ := &b.Func.Config.Types
  9205  	// match: (Rsh8x32 <t> x y)
  9206  	// result: (SRAV (SignExt8to64 x) (OR <t> (NEGV <t> (SGTU (ZeroExt32to64 y) (MOVVconst <typ.UInt64> [63]))) (ZeroExt32to64 y)))
  9207  	for {
  9208  		t := v.Type
  9209  		x := v_0
  9210  		y := v_1
  9211  		v.reset(OpLOONG64SRAV)
  9212  		v0 := b.NewValue0(v.Pos, OpSignExt8to64, typ.Int64)
  9213  		v0.AddArg(x)
  9214  		v1 := b.NewValue0(v.Pos, OpLOONG64OR, t)
  9215  		v2 := b.NewValue0(v.Pos, OpLOONG64NEGV, t)
  9216  		v3 := b.NewValue0(v.Pos, OpLOONG64SGTU, typ.Bool)
  9217  		v4 := b.NewValue0(v.Pos, OpZeroExt32to64, typ.UInt64)
  9218  		v4.AddArg(y)
  9219  		v5 := b.NewValue0(v.Pos, OpLOONG64MOVVconst, typ.UInt64)
  9220  		v5.AuxInt = int64ToAuxInt(63)
  9221  		v3.AddArg2(v4, v5)
  9222  		v2.AddArg(v3)
  9223  		v1.AddArg2(v2, v4)
  9224  		v.AddArg2(v0, v1)
  9225  		return true
  9226  	}
  9227  }
  9228  func rewriteValueLOONG64_OpRsh8x64(v *Value) bool {
  9229  	v_1 := v.Args[1]
  9230  	v_0 := v.Args[0]
  9231  	b := v.Block
  9232  	typ := &b.Func.Config.Types
  9233  	// match: (Rsh8x64 <t> x y)
  9234  	// result: (SRAV (SignExt8to64 x) (OR <t> (NEGV <t> (SGTU y (MOVVconst <typ.UInt64> [63]))) y))
  9235  	for {
  9236  		t := v.Type
  9237  		x := v_0
  9238  		y := v_1
  9239  		v.reset(OpLOONG64SRAV)
  9240  		v0 := b.NewValue0(v.Pos, OpSignExt8to64, typ.Int64)
  9241  		v0.AddArg(x)
  9242  		v1 := b.NewValue0(v.Pos, OpLOONG64OR, t)
  9243  		v2 := b.NewValue0(v.Pos, OpLOONG64NEGV, t)
  9244  		v3 := b.NewValue0(v.Pos, OpLOONG64SGTU, typ.Bool)
  9245  		v4 := b.NewValue0(v.Pos, OpLOONG64MOVVconst, typ.UInt64)
  9246  		v4.AuxInt = int64ToAuxInt(63)
  9247  		v3.AddArg2(y, v4)
  9248  		v2.AddArg(v3)
  9249  		v1.AddArg2(v2, y)
  9250  		v.AddArg2(v0, v1)
  9251  		return true
  9252  	}
  9253  }
  9254  func rewriteValueLOONG64_OpRsh8x8(v *Value) bool {
  9255  	v_1 := v.Args[1]
  9256  	v_0 := v.Args[0]
  9257  	b := v.Block
  9258  	typ := &b.Func.Config.Types
  9259  	// match: (Rsh8x8 <t> x y)
  9260  	// result: (SRAV (SignExt8to64 x) (OR <t> (NEGV <t> (SGTU (ZeroExt8to64 y) (MOVVconst <typ.UInt64> [63]))) (ZeroExt8to64 y)))
  9261  	for {
  9262  		t := v.Type
  9263  		x := v_0
  9264  		y := v_1
  9265  		v.reset(OpLOONG64SRAV)
  9266  		v0 := b.NewValue0(v.Pos, OpSignExt8to64, typ.Int64)
  9267  		v0.AddArg(x)
  9268  		v1 := b.NewValue0(v.Pos, OpLOONG64OR, t)
  9269  		v2 := b.NewValue0(v.Pos, OpLOONG64NEGV, t)
  9270  		v3 := b.NewValue0(v.Pos, OpLOONG64SGTU, typ.Bool)
  9271  		v4 := b.NewValue0(v.Pos, OpZeroExt8to64, typ.UInt64)
  9272  		v4.AddArg(y)
  9273  		v5 := b.NewValue0(v.Pos, OpLOONG64MOVVconst, typ.UInt64)
  9274  		v5.AuxInt = int64ToAuxInt(63)
  9275  		v3.AddArg2(v4, v5)
  9276  		v2.AddArg(v3)
  9277  		v1.AddArg2(v2, v4)
  9278  		v.AddArg2(v0, v1)
  9279  		return true
  9280  	}
  9281  }
  9282  func rewriteValueLOONG64_OpSelect0(v *Value) bool {
  9283  	v_0 := v.Args[0]
  9284  	b := v.Block
  9285  	// match: (Select0 (Mul64uhilo x y))
  9286  	// result: (MULHVU x y)
  9287  	for {
  9288  		if v_0.Op != OpMul64uhilo {
  9289  			break
  9290  		}
  9291  		y := v_0.Args[1]
  9292  		x := v_0.Args[0]
  9293  		v.reset(OpLOONG64MULHVU)
  9294  		v.AddArg2(x, y)
  9295  		return true
  9296  	}
  9297  	// match: (Select0 (Mul64uover x y))
  9298  	// result: (MULV x y)
  9299  	for {
  9300  		if v_0.Op != OpMul64uover {
  9301  			break
  9302  		}
  9303  		y := v_0.Args[1]
  9304  		x := v_0.Args[0]
  9305  		v.reset(OpLOONG64MULV)
  9306  		v.AddArg2(x, y)
  9307  		return true
  9308  	}
  9309  	// match: (Select0 <t> (Add64carry x y c))
  9310  	// result: (ADDV (ADDV <t> x y) c)
  9311  	for {
  9312  		t := v.Type
  9313  		if v_0.Op != OpAdd64carry {
  9314  			break
  9315  		}
  9316  		c := v_0.Args[2]
  9317  		x := v_0.Args[0]
  9318  		y := v_0.Args[1]
  9319  		v.reset(OpLOONG64ADDV)
  9320  		v0 := b.NewValue0(v.Pos, OpLOONG64ADDV, t)
  9321  		v0.AddArg2(x, y)
  9322  		v.AddArg2(v0, c)
  9323  		return true
  9324  	}
  9325  	// match: (Select0 <t> (Sub64borrow x y c))
  9326  	// result: (SUBV (SUBV <t> x y) c)
  9327  	for {
  9328  		t := v.Type
  9329  		if v_0.Op != OpSub64borrow {
  9330  			break
  9331  		}
  9332  		c := v_0.Args[2]
  9333  		x := v_0.Args[0]
  9334  		y := v_0.Args[1]
  9335  		v.reset(OpLOONG64SUBV)
  9336  		v0 := b.NewValue0(v.Pos, OpLOONG64SUBV, t)
  9337  		v0.AddArg2(x, y)
  9338  		v.AddArg2(v0, c)
  9339  		return true
  9340  	}
  9341  	return false
  9342  }
  9343  func rewriteValueLOONG64_OpSelect1(v *Value) bool {
  9344  	v_0 := v.Args[0]
  9345  	b := v.Block
  9346  	typ := &b.Func.Config.Types
  9347  	// match: (Select1 (Mul64uhilo x y))
  9348  	// result: (MULV x y)
  9349  	for {
  9350  		if v_0.Op != OpMul64uhilo {
  9351  			break
  9352  		}
  9353  		y := v_0.Args[1]
  9354  		x := v_0.Args[0]
  9355  		v.reset(OpLOONG64MULV)
  9356  		v.AddArg2(x, y)
  9357  		return true
  9358  	}
  9359  	// match: (Select1 (Mul64uover x y))
  9360  	// result: (SGTU <typ.Bool> (MULHVU x y) (MOVVconst <typ.UInt64> [0]))
  9361  	for {
  9362  		if v_0.Op != OpMul64uover {
  9363  			break
  9364  		}
  9365  		y := v_0.Args[1]
  9366  		x := v_0.Args[0]
  9367  		v.reset(OpLOONG64SGTU)
  9368  		v.Type = typ.Bool
  9369  		v0 := b.NewValue0(v.Pos, OpLOONG64MULHVU, typ.UInt64)
  9370  		v0.AddArg2(x, y)
  9371  		v1 := b.NewValue0(v.Pos, OpLOONG64MOVVconst, typ.UInt64)
  9372  		v1.AuxInt = int64ToAuxInt(0)
  9373  		v.AddArg2(v0, v1)
  9374  		return true
  9375  	}
  9376  	// match: (Select1 <t> (Add64carry x y c))
  9377  	// result: (OR (SGTU <t> x s:(ADDV <t> x y)) (SGTU <t> s (ADDV <t> s c)))
  9378  	for {
  9379  		t := v.Type
  9380  		if v_0.Op != OpAdd64carry {
  9381  			break
  9382  		}
  9383  		c := v_0.Args[2]
  9384  		x := v_0.Args[0]
  9385  		y := v_0.Args[1]
  9386  		v.reset(OpLOONG64OR)
  9387  		v0 := b.NewValue0(v.Pos, OpLOONG64SGTU, t)
  9388  		s := b.NewValue0(v.Pos, OpLOONG64ADDV, t)
  9389  		s.AddArg2(x, y)
  9390  		v0.AddArg2(x, s)
  9391  		v2 := b.NewValue0(v.Pos, OpLOONG64SGTU, t)
  9392  		v3 := b.NewValue0(v.Pos, OpLOONG64ADDV, t)
  9393  		v3.AddArg2(s, c)
  9394  		v2.AddArg2(s, v3)
  9395  		v.AddArg2(v0, v2)
  9396  		return true
  9397  	}
  9398  	// match: (Select1 <t> (Sub64borrow x y c))
  9399  	// result: (OR (SGTU <t> s:(SUBV <t> x y) x) (SGTU <t> (SUBV <t> s c) s))
  9400  	for {
  9401  		t := v.Type
  9402  		if v_0.Op != OpSub64borrow {
  9403  			break
  9404  		}
  9405  		c := v_0.Args[2]
  9406  		x := v_0.Args[0]
  9407  		y := v_0.Args[1]
  9408  		v.reset(OpLOONG64OR)
  9409  		v0 := b.NewValue0(v.Pos, OpLOONG64SGTU, t)
  9410  		s := b.NewValue0(v.Pos, OpLOONG64SUBV, t)
  9411  		s.AddArg2(x, y)
  9412  		v0.AddArg2(s, x)
  9413  		v2 := b.NewValue0(v.Pos, OpLOONG64SGTU, t)
  9414  		v3 := b.NewValue0(v.Pos, OpLOONG64SUBV, t)
  9415  		v3.AddArg2(s, c)
  9416  		v2.AddArg2(v3, s)
  9417  		v.AddArg2(v0, v2)
  9418  		return true
  9419  	}
  9420  	return false
  9421  }
  9422  func rewriteValueLOONG64_OpSelectN(v *Value) bool {
  9423  	v_0 := v.Args[0]
  9424  	b := v.Block
  9425  	config := b.Func.Config
  9426  	// match: (SelectN [0] call:(CALLstatic {sym} dst src (MOVVconst [sz]) mem))
  9427  	// cond: sz >= 0 && isSameCall(sym, "runtime.memmove") && call.Uses == 1 && isInlinableMemmove(dst, src, sz, config) && clobber(call)
  9428  	// result: (Move [sz] dst src mem)
  9429  	for {
  9430  		if auxIntToInt64(v.AuxInt) != 0 {
  9431  			break
  9432  		}
  9433  		call := v_0
  9434  		if call.Op != OpLOONG64CALLstatic || len(call.Args) != 4 {
  9435  			break
  9436  		}
  9437  		sym := auxToCall(call.Aux)
  9438  		mem := call.Args[3]
  9439  		dst := call.Args[0]
  9440  		src := call.Args[1]
  9441  		call_2 := call.Args[2]
  9442  		if call_2.Op != OpLOONG64MOVVconst {
  9443  			break
  9444  		}
  9445  		sz := auxIntToInt64(call_2.AuxInt)
  9446  		if !(sz >= 0 && isSameCall(sym, "runtime.memmove") && call.Uses == 1 && isInlinableMemmove(dst, src, sz, config) && clobber(call)) {
  9447  			break
  9448  		}
  9449  		v.reset(OpMove)
  9450  		v.AuxInt = int64ToAuxInt(sz)
  9451  		v.AddArg3(dst, src, mem)
  9452  		return true
  9453  	}
  9454  	return false
  9455  }
  9456  func rewriteValueLOONG64_OpSlicemask(v *Value) bool {
  9457  	v_0 := v.Args[0]
  9458  	b := v.Block
  9459  	// match: (Slicemask <t> x)
  9460  	// result: (SRAVconst (NEGV <t> x) [63])
  9461  	for {
  9462  		t := v.Type
  9463  		x := v_0
  9464  		v.reset(OpLOONG64SRAVconst)
  9465  		v.AuxInt = int64ToAuxInt(63)
  9466  		v0 := b.NewValue0(v.Pos, OpLOONG64NEGV, t)
  9467  		v0.AddArg(x)
  9468  		v.AddArg(v0)
  9469  		return true
  9470  	}
  9471  }
  9472  func rewriteValueLOONG64_OpStore(v *Value) bool {
  9473  	v_2 := v.Args[2]
  9474  	v_1 := v.Args[1]
  9475  	v_0 := v.Args[0]
  9476  	// match: (Store {t} ptr val mem)
  9477  	// cond: t.Size() == 1
  9478  	// result: (MOVBstore ptr val mem)
  9479  	for {
  9480  		t := auxToType(v.Aux)
  9481  		ptr := v_0
  9482  		val := v_1
  9483  		mem := v_2
  9484  		if !(t.Size() == 1) {
  9485  			break
  9486  		}
  9487  		v.reset(OpLOONG64MOVBstore)
  9488  		v.AddArg3(ptr, val, mem)
  9489  		return true
  9490  	}
  9491  	// match: (Store {t} ptr val mem)
  9492  	// cond: t.Size() == 2
  9493  	// result: (MOVHstore ptr val mem)
  9494  	for {
  9495  		t := auxToType(v.Aux)
  9496  		ptr := v_0
  9497  		val := v_1
  9498  		mem := v_2
  9499  		if !(t.Size() == 2) {
  9500  			break
  9501  		}
  9502  		v.reset(OpLOONG64MOVHstore)
  9503  		v.AddArg3(ptr, val, mem)
  9504  		return true
  9505  	}
  9506  	// match: (Store {t} ptr val mem)
  9507  	// cond: t.Size() == 4 && !t.IsFloat()
  9508  	// result: (MOVWstore ptr val mem)
  9509  	for {
  9510  		t := auxToType(v.Aux)
  9511  		ptr := v_0
  9512  		val := v_1
  9513  		mem := v_2
  9514  		if !(t.Size() == 4 && !t.IsFloat()) {
  9515  			break
  9516  		}
  9517  		v.reset(OpLOONG64MOVWstore)
  9518  		v.AddArg3(ptr, val, mem)
  9519  		return true
  9520  	}
  9521  	// match: (Store {t} ptr val mem)
  9522  	// cond: t.Size() == 8 && !t.IsFloat()
  9523  	// result: (MOVVstore ptr val mem)
  9524  	for {
  9525  		t := auxToType(v.Aux)
  9526  		ptr := v_0
  9527  		val := v_1
  9528  		mem := v_2
  9529  		if !(t.Size() == 8 && !t.IsFloat()) {
  9530  			break
  9531  		}
  9532  		v.reset(OpLOONG64MOVVstore)
  9533  		v.AddArg3(ptr, val, mem)
  9534  		return true
  9535  	}
  9536  	// match: (Store {t} ptr val mem)
  9537  	// cond: t.Size() == 4 && t.IsFloat()
  9538  	// result: (MOVFstore ptr val mem)
  9539  	for {
  9540  		t := auxToType(v.Aux)
  9541  		ptr := v_0
  9542  		val := v_1
  9543  		mem := v_2
  9544  		if !(t.Size() == 4 && t.IsFloat()) {
  9545  			break
  9546  		}
  9547  		v.reset(OpLOONG64MOVFstore)
  9548  		v.AddArg3(ptr, val, mem)
  9549  		return true
  9550  	}
  9551  	// match: (Store {t} ptr val mem)
  9552  	// cond: t.Size() == 8 && t.IsFloat()
  9553  	// result: (MOVDstore ptr val mem)
  9554  	for {
  9555  		t := auxToType(v.Aux)
  9556  		ptr := v_0
  9557  		val := v_1
  9558  		mem := v_2
  9559  		if !(t.Size() == 8 && t.IsFloat()) {
  9560  			break
  9561  		}
  9562  		v.reset(OpLOONG64MOVDstore)
  9563  		v.AddArg3(ptr, val, mem)
  9564  		return true
  9565  	}
  9566  	return false
  9567  }
  9568  func rewriteValueLOONG64_OpZero(v *Value) bool {
  9569  	v_1 := v.Args[1]
  9570  	v_0 := v.Args[0]
  9571  	b := v.Block
  9572  	config := b.Func.Config
  9573  	typ := &b.Func.Config.Types
  9574  	// match: (Zero [0] _ mem)
  9575  	// result: mem
  9576  	for {
  9577  		if auxIntToInt64(v.AuxInt) != 0 {
  9578  			break
  9579  		}
  9580  		mem := v_1
  9581  		v.copyOf(mem)
  9582  		return true
  9583  	}
  9584  	// match: (Zero [1] ptr mem)
  9585  	// result: (MOVBstore ptr (MOVVconst [0]) mem)
  9586  	for {
  9587  		if auxIntToInt64(v.AuxInt) != 1 {
  9588  			break
  9589  		}
  9590  		ptr := v_0
  9591  		mem := v_1
  9592  		v.reset(OpLOONG64MOVBstore)
  9593  		v0 := b.NewValue0(v.Pos, OpLOONG64MOVVconst, typ.UInt64)
  9594  		v0.AuxInt = int64ToAuxInt(0)
  9595  		v.AddArg3(ptr, v0, mem)
  9596  		return true
  9597  	}
  9598  	// match: (Zero [2] ptr mem)
  9599  	// result: (MOVHstore ptr (MOVVconst [0]) mem)
  9600  	for {
  9601  		if auxIntToInt64(v.AuxInt) != 2 {
  9602  			break
  9603  		}
  9604  		ptr := v_0
  9605  		mem := v_1
  9606  		v.reset(OpLOONG64MOVHstore)
  9607  		v0 := b.NewValue0(v.Pos, OpLOONG64MOVVconst, typ.UInt64)
  9608  		v0.AuxInt = int64ToAuxInt(0)
  9609  		v.AddArg3(ptr, v0, mem)
  9610  		return true
  9611  	}
  9612  	// match: (Zero [3] ptr mem)
  9613  	// result: (MOVBstore [2] ptr (MOVVconst [0]) (MOVHstore ptr (MOVVconst [0]) mem))
  9614  	for {
  9615  		if auxIntToInt64(v.AuxInt) != 3 {
  9616  			break
  9617  		}
  9618  		ptr := v_0
  9619  		mem := v_1
  9620  		v.reset(OpLOONG64MOVBstore)
  9621  		v.AuxInt = int32ToAuxInt(2)
  9622  		v0 := b.NewValue0(v.Pos, OpLOONG64MOVVconst, typ.UInt64)
  9623  		v0.AuxInt = int64ToAuxInt(0)
  9624  		v1 := b.NewValue0(v.Pos, OpLOONG64MOVHstore, types.TypeMem)
  9625  		v1.AddArg3(ptr, v0, mem)
  9626  		v.AddArg3(ptr, v0, v1)
  9627  		return true
  9628  	}
  9629  	// match: (Zero [4] {t} ptr mem)
  9630  	// result: (MOVWstore ptr (MOVVconst [0]) mem)
  9631  	for {
  9632  		if auxIntToInt64(v.AuxInt) != 4 {
  9633  			break
  9634  		}
  9635  		ptr := v_0
  9636  		mem := v_1
  9637  		v.reset(OpLOONG64MOVWstore)
  9638  		v0 := b.NewValue0(v.Pos, OpLOONG64MOVVconst, typ.UInt64)
  9639  		v0.AuxInt = int64ToAuxInt(0)
  9640  		v.AddArg3(ptr, v0, mem)
  9641  		return true
  9642  	}
  9643  	// match: (Zero [5] ptr mem)
  9644  	// result: (MOVBstore [4] ptr (MOVVconst [0]) (MOVWstore ptr (MOVVconst [0]) mem))
  9645  	for {
  9646  		if auxIntToInt64(v.AuxInt) != 5 {
  9647  			break
  9648  		}
  9649  		ptr := v_0
  9650  		mem := v_1
  9651  		v.reset(OpLOONG64MOVBstore)
  9652  		v.AuxInt = int32ToAuxInt(4)
  9653  		v0 := b.NewValue0(v.Pos, OpLOONG64MOVVconst, typ.UInt64)
  9654  		v0.AuxInt = int64ToAuxInt(0)
  9655  		v1 := b.NewValue0(v.Pos, OpLOONG64MOVWstore, types.TypeMem)
  9656  		v1.AddArg3(ptr, v0, mem)
  9657  		v.AddArg3(ptr, v0, v1)
  9658  		return true
  9659  	}
  9660  	// match: (Zero [6] ptr mem)
  9661  	// result: (MOVHstore [4] ptr (MOVVconst [0]) (MOVWstore ptr (MOVVconst [0]) mem))
  9662  	for {
  9663  		if auxIntToInt64(v.AuxInt) != 6 {
  9664  			break
  9665  		}
  9666  		ptr := v_0
  9667  		mem := v_1
  9668  		v.reset(OpLOONG64MOVHstore)
  9669  		v.AuxInt = int32ToAuxInt(4)
  9670  		v0 := b.NewValue0(v.Pos, OpLOONG64MOVVconst, typ.UInt64)
  9671  		v0.AuxInt = int64ToAuxInt(0)
  9672  		v1 := b.NewValue0(v.Pos, OpLOONG64MOVWstore, types.TypeMem)
  9673  		v1.AddArg3(ptr, v0, mem)
  9674  		v.AddArg3(ptr, v0, v1)
  9675  		return true
  9676  	}
  9677  	// match: (Zero [7] ptr mem)
  9678  	// result: (MOVWstore [3] ptr (MOVVconst [0]) (MOVWstore ptr (MOVVconst [0]) mem))
  9679  	for {
  9680  		if auxIntToInt64(v.AuxInt) != 7 {
  9681  			break
  9682  		}
  9683  		ptr := v_0
  9684  		mem := v_1
  9685  		v.reset(OpLOONG64MOVWstore)
  9686  		v.AuxInt = int32ToAuxInt(3)
  9687  		v0 := b.NewValue0(v.Pos, OpLOONG64MOVVconst, typ.UInt64)
  9688  		v0.AuxInt = int64ToAuxInt(0)
  9689  		v1 := b.NewValue0(v.Pos, OpLOONG64MOVWstore, types.TypeMem)
  9690  		v1.AddArg3(ptr, v0, mem)
  9691  		v.AddArg3(ptr, v0, v1)
  9692  		return true
  9693  	}
  9694  	// match: (Zero [8] {t} ptr mem)
  9695  	// result: (MOVVstore ptr (MOVVconst [0]) mem)
  9696  	for {
  9697  		if auxIntToInt64(v.AuxInt) != 8 {
  9698  			break
  9699  		}
  9700  		ptr := v_0
  9701  		mem := v_1
  9702  		v.reset(OpLOONG64MOVVstore)
  9703  		v0 := b.NewValue0(v.Pos, OpLOONG64MOVVconst, typ.UInt64)
  9704  		v0.AuxInt = int64ToAuxInt(0)
  9705  		v.AddArg3(ptr, v0, mem)
  9706  		return true
  9707  	}
  9708  	// match: (Zero [9] ptr mem)
  9709  	// result: (MOVBstore [8] ptr (MOVVconst [0]) (MOVVstore ptr (MOVVconst [0]) mem))
  9710  	for {
  9711  		if auxIntToInt64(v.AuxInt) != 9 {
  9712  			break
  9713  		}
  9714  		ptr := v_0
  9715  		mem := v_1
  9716  		v.reset(OpLOONG64MOVBstore)
  9717  		v.AuxInt = int32ToAuxInt(8)
  9718  		v0 := b.NewValue0(v.Pos, OpLOONG64MOVVconst, typ.UInt64)
  9719  		v0.AuxInt = int64ToAuxInt(0)
  9720  		v1 := b.NewValue0(v.Pos, OpLOONG64MOVVstore, types.TypeMem)
  9721  		v1.AddArg3(ptr, v0, mem)
  9722  		v.AddArg3(ptr, v0, v1)
  9723  		return true
  9724  	}
  9725  	// match: (Zero [10] ptr mem)
  9726  	// result: (MOVHstore [8] ptr (MOVVconst [0]) (MOVVstore ptr (MOVVconst [0]) mem))
  9727  	for {
  9728  		if auxIntToInt64(v.AuxInt) != 10 {
  9729  			break
  9730  		}
  9731  		ptr := v_0
  9732  		mem := v_1
  9733  		v.reset(OpLOONG64MOVHstore)
  9734  		v.AuxInt = int32ToAuxInt(8)
  9735  		v0 := b.NewValue0(v.Pos, OpLOONG64MOVVconst, typ.UInt64)
  9736  		v0.AuxInt = int64ToAuxInt(0)
  9737  		v1 := b.NewValue0(v.Pos, OpLOONG64MOVVstore, types.TypeMem)
  9738  		v1.AddArg3(ptr, v0, mem)
  9739  		v.AddArg3(ptr, v0, v1)
  9740  		return true
  9741  	}
  9742  	// match: (Zero [11] ptr mem)
  9743  	// result: (MOVWstore [7] ptr (MOVVconst [0]) (MOVVstore ptr (MOVVconst [0]) mem))
  9744  	for {
  9745  		if auxIntToInt64(v.AuxInt) != 11 {
  9746  			break
  9747  		}
  9748  		ptr := v_0
  9749  		mem := v_1
  9750  		v.reset(OpLOONG64MOVWstore)
  9751  		v.AuxInt = int32ToAuxInt(7)
  9752  		v0 := b.NewValue0(v.Pos, OpLOONG64MOVVconst, typ.UInt64)
  9753  		v0.AuxInt = int64ToAuxInt(0)
  9754  		v1 := b.NewValue0(v.Pos, OpLOONG64MOVVstore, types.TypeMem)
  9755  		v1.AddArg3(ptr, v0, mem)
  9756  		v.AddArg3(ptr, v0, v1)
  9757  		return true
  9758  	}
  9759  	// match: (Zero [12] ptr mem)
  9760  	// result: (MOVWstore [8] ptr (MOVVconst [0]) (MOVVstore ptr (MOVVconst [0]) mem))
  9761  	for {
  9762  		if auxIntToInt64(v.AuxInt) != 12 {
  9763  			break
  9764  		}
  9765  		ptr := v_0
  9766  		mem := v_1
  9767  		v.reset(OpLOONG64MOVWstore)
  9768  		v.AuxInt = int32ToAuxInt(8)
  9769  		v0 := b.NewValue0(v.Pos, OpLOONG64MOVVconst, typ.UInt64)
  9770  		v0.AuxInt = int64ToAuxInt(0)
  9771  		v1 := b.NewValue0(v.Pos, OpLOONG64MOVVstore, types.TypeMem)
  9772  		v1.AddArg3(ptr, v0, mem)
  9773  		v.AddArg3(ptr, v0, v1)
  9774  		return true
  9775  	}
  9776  	// match: (Zero [13] ptr mem)
  9777  	// result: (MOVVstore [5] ptr (MOVVconst [0]) (MOVVstore ptr (MOVVconst [0]) mem))
  9778  	for {
  9779  		if auxIntToInt64(v.AuxInt) != 13 {
  9780  			break
  9781  		}
  9782  		ptr := v_0
  9783  		mem := v_1
  9784  		v.reset(OpLOONG64MOVVstore)
  9785  		v.AuxInt = int32ToAuxInt(5)
  9786  		v0 := b.NewValue0(v.Pos, OpLOONG64MOVVconst, typ.UInt64)
  9787  		v0.AuxInt = int64ToAuxInt(0)
  9788  		v1 := b.NewValue0(v.Pos, OpLOONG64MOVVstore, types.TypeMem)
  9789  		v1.AddArg3(ptr, v0, mem)
  9790  		v.AddArg3(ptr, v0, v1)
  9791  		return true
  9792  	}
  9793  	// match: (Zero [14] ptr mem)
  9794  	// result: (MOVVstore [6] ptr (MOVVconst [0]) (MOVVstore ptr (MOVVconst [0]) mem))
  9795  	for {
  9796  		if auxIntToInt64(v.AuxInt) != 14 {
  9797  			break
  9798  		}
  9799  		ptr := v_0
  9800  		mem := v_1
  9801  		v.reset(OpLOONG64MOVVstore)
  9802  		v.AuxInt = int32ToAuxInt(6)
  9803  		v0 := b.NewValue0(v.Pos, OpLOONG64MOVVconst, typ.UInt64)
  9804  		v0.AuxInt = int64ToAuxInt(0)
  9805  		v1 := b.NewValue0(v.Pos, OpLOONG64MOVVstore, types.TypeMem)
  9806  		v1.AddArg3(ptr, v0, mem)
  9807  		v.AddArg3(ptr, v0, v1)
  9808  		return true
  9809  	}
  9810  	// match: (Zero [15] ptr mem)
  9811  	// result: (MOVVstore [7] ptr (MOVVconst [0]) (MOVVstore ptr (MOVVconst [0]) mem))
  9812  	for {
  9813  		if auxIntToInt64(v.AuxInt) != 15 {
  9814  			break
  9815  		}
  9816  		ptr := v_0
  9817  		mem := v_1
  9818  		v.reset(OpLOONG64MOVVstore)
  9819  		v.AuxInt = int32ToAuxInt(7)
  9820  		v0 := b.NewValue0(v.Pos, OpLOONG64MOVVconst, typ.UInt64)
  9821  		v0.AuxInt = int64ToAuxInt(0)
  9822  		v1 := b.NewValue0(v.Pos, OpLOONG64MOVVstore, types.TypeMem)
  9823  		v1.AddArg3(ptr, v0, mem)
  9824  		v.AddArg3(ptr, v0, v1)
  9825  		return true
  9826  	}
  9827  	// match: (Zero [16] ptr mem)
  9828  	// result: (MOVVstore [8] ptr (MOVVconst [0]) (MOVVstore ptr (MOVVconst [0]) mem))
  9829  	for {
  9830  		if auxIntToInt64(v.AuxInt) != 16 {
  9831  			break
  9832  		}
  9833  		ptr := v_0
  9834  		mem := v_1
  9835  		v.reset(OpLOONG64MOVVstore)
  9836  		v.AuxInt = int32ToAuxInt(8)
  9837  		v0 := b.NewValue0(v.Pos, OpLOONG64MOVVconst, typ.UInt64)
  9838  		v0.AuxInt = int64ToAuxInt(0)
  9839  		v1 := b.NewValue0(v.Pos, OpLOONG64MOVVstore, types.TypeMem)
  9840  		v1.AddArg3(ptr, v0, mem)
  9841  		v.AddArg3(ptr, v0, v1)
  9842  		return true
  9843  	}
  9844  	// match: (Zero [s] ptr mem)
  9845  	// cond: s%8 != 0 && s > 16
  9846  	// result: (Zero [s%8] (OffPtr <ptr.Type> ptr [s-s%8]) (Zero [s-s%8] ptr mem))
  9847  	for {
  9848  		s := auxIntToInt64(v.AuxInt)
  9849  		ptr := v_0
  9850  		mem := v_1
  9851  		if !(s%8 != 0 && s > 16) {
  9852  			break
  9853  		}
  9854  		v.reset(OpZero)
  9855  		v.AuxInt = int64ToAuxInt(s % 8)
  9856  		v0 := b.NewValue0(v.Pos, OpOffPtr, ptr.Type)
  9857  		v0.AuxInt = int64ToAuxInt(s - s%8)
  9858  		v0.AddArg(ptr)
  9859  		v1 := b.NewValue0(v.Pos, OpZero, types.TypeMem)
  9860  		v1.AuxInt = int64ToAuxInt(s - s%8)
  9861  		v1.AddArg2(ptr, mem)
  9862  		v.AddArg2(v0, v1)
  9863  		return true
  9864  	}
  9865  	// match: (Zero [s] ptr mem)
  9866  	// cond: s%8 == 0 && s > 16 && s <= 8*128 && !config.noDuffDevice
  9867  	// result: (DUFFZERO [8 * (128 - s/8)] ptr mem)
  9868  	for {
  9869  		s := auxIntToInt64(v.AuxInt)
  9870  		ptr := v_0
  9871  		mem := v_1
  9872  		if !(s%8 == 0 && s > 16 && s <= 8*128 && !config.noDuffDevice) {
  9873  			break
  9874  		}
  9875  		v.reset(OpLOONG64DUFFZERO)
  9876  		v.AuxInt = int64ToAuxInt(8 * (128 - s/8))
  9877  		v.AddArg2(ptr, mem)
  9878  		return true
  9879  	}
  9880  	// match: (Zero [s] ptr mem)
  9881  	// cond: s%8 == 0 && s > 8*128
  9882  	// result: (LoweredZero ptr (ADDVconst <ptr.Type> ptr [s-8]) mem)
  9883  	for {
  9884  		s := auxIntToInt64(v.AuxInt)
  9885  		ptr := v_0
  9886  		mem := v_1
  9887  		if !(s%8 == 0 && s > 8*128) {
  9888  			break
  9889  		}
  9890  		v.reset(OpLOONG64LoweredZero)
  9891  		v0 := b.NewValue0(v.Pos, OpLOONG64ADDVconst, ptr.Type)
  9892  		v0.AuxInt = int64ToAuxInt(s - 8)
  9893  		v0.AddArg(ptr)
  9894  		v.AddArg3(ptr, v0, mem)
  9895  		return true
  9896  	}
  9897  	return false
  9898  }
  9899  func rewriteBlockLOONG64(b *Block) bool {
  9900  	typ := &b.Func.Config.Types
  9901  	switch b.Kind {
  9902  	case BlockLOONG64EQ:
  9903  		// match: (EQ (FPFlagTrue cmp) yes no)
  9904  		// result: (FPF cmp yes no)
  9905  		for b.Controls[0].Op == OpLOONG64FPFlagTrue {
  9906  			v_0 := b.Controls[0]
  9907  			cmp := v_0.Args[0]
  9908  			b.resetWithControl(BlockLOONG64FPF, cmp)
  9909  			return true
  9910  		}
  9911  		// match: (EQ (FPFlagFalse cmp) yes no)
  9912  		// result: (FPT cmp yes no)
  9913  		for b.Controls[0].Op == OpLOONG64FPFlagFalse {
  9914  			v_0 := b.Controls[0]
  9915  			cmp := v_0.Args[0]
  9916  			b.resetWithControl(BlockLOONG64FPT, cmp)
  9917  			return true
  9918  		}
  9919  		// match: (EQ (XORconst [1] cmp:(SGT _ _)) yes no)
  9920  		// result: (NE cmp yes no)
  9921  		for b.Controls[0].Op == OpLOONG64XORconst {
  9922  			v_0 := b.Controls[0]
  9923  			if auxIntToInt64(v_0.AuxInt) != 1 {
  9924  				break
  9925  			}
  9926  			cmp := v_0.Args[0]
  9927  			if cmp.Op != OpLOONG64SGT {
  9928  				break
  9929  			}
  9930  			b.resetWithControl(BlockLOONG64NE, cmp)
  9931  			return true
  9932  		}
  9933  		// match: (EQ (XORconst [1] cmp:(SGTU _ _)) yes no)
  9934  		// result: (NE cmp yes no)
  9935  		for b.Controls[0].Op == OpLOONG64XORconst {
  9936  			v_0 := b.Controls[0]
  9937  			if auxIntToInt64(v_0.AuxInt) != 1 {
  9938  				break
  9939  			}
  9940  			cmp := v_0.Args[0]
  9941  			if cmp.Op != OpLOONG64SGTU {
  9942  				break
  9943  			}
  9944  			b.resetWithControl(BlockLOONG64NE, cmp)
  9945  			return true
  9946  		}
  9947  		// match: (EQ (XORconst [1] cmp:(SGTconst _)) yes no)
  9948  		// result: (NE cmp yes no)
  9949  		for b.Controls[0].Op == OpLOONG64XORconst {
  9950  			v_0 := b.Controls[0]
  9951  			if auxIntToInt64(v_0.AuxInt) != 1 {
  9952  				break
  9953  			}
  9954  			cmp := v_0.Args[0]
  9955  			if cmp.Op != OpLOONG64SGTconst {
  9956  				break
  9957  			}
  9958  			b.resetWithControl(BlockLOONG64NE, cmp)
  9959  			return true
  9960  		}
  9961  		// match: (EQ (XORconst [1] cmp:(SGTUconst _)) yes no)
  9962  		// result: (NE cmp yes no)
  9963  		for b.Controls[0].Op == OpLOONG64XORconst {
  9964  			v_0 := b.Controls[0]
  9965  			if auxIntToInt64(v_0.AuxInt) != 1 {
  9966  				break
  9967  			}
  9968  			cmp := v_0.Args[0]
  9969  			if cmp.Op != OpLOONG64SGTUconst {
  9970  				break
  9971  			}
  9972  			b.resetWithControl(BlockLOONG64NE, cmp)
  9973  			return true
  9974  		}
  9975  		// match: (EQ (SGTUconst [1] x) yes no)
  9976  		// result: (NE x yes no)
  9977  		for b.Controls[0].Op == OpLOONG64SGTUconst {
  9978  			v_0 := b.Controls[0]
  9979  			if auxIntToInt64(v_0.AuxInt) != 1 {
  9980  				break
  9981  			}
  9982  			x := v_0.Args[0]
  9983  			b.resetWithControl(BlockLOONG64NE, x)
  9984  			return true
  9985  		}
  9986  		// match: (EQ (SGTU x (MOVVconst [0])) yes no)
  9987  		// result: (EQ x yes no)
  9988  		for b.Controls[0].Op == OpLOONG64SGTU {
  9989  			v_0 := b.Controls[0]
  9990  			_ = v_0.Args[1]
  9991  			x := v_0.Args[0]
  9992  			v_0_1 := v_0.Args[1]
  9993  			if v_0_1.Op != OpLOONG64MOVVconst || auxIntToInt64(v_0_1.AuxInt) != 0 {
  9994  				break
  9995  			}
  9996  			b.resetWithControl(BlockLOONG64EQ, x)
  9997  			return true
  9998  		}
  9999  		// match: (EQ (SGTconst [0] x) yes no)
 10000  		// result: (GEZ x yes no)
 10001  		for b.Controls[0].Op == OpLOONG64SGTconst {
 10002  			v_0 := b.Controls[0]
 10003  			if auxIntToInt64(v_0.AuxInt) != 0 {
 10004  				break
 10005  			}
 10006  			x := v_0.Args[0]
 10007  			b.resetWithControl(BlockLOONG64GEZ, x)
 10008  			return true
 10009  		}
 10010  		// match: (EQ (SGT x (MOVVconst [0])) yes no)
 10011  		// result: (LEZ x yes no)
 10012  		for b.Controls[0].Op == OpLOONG64SGT {
 10013  			v_0 := b.Controls[0]
 10014  			_ = v_0.Args[1]
 10015  			x := v_0.Args[0]
 10016  			v_0_1 := v_0.Args[1]
 10017  			if v_0_1.Op != OpLOONG64MOVVconst || auxIntToInt64(v_0_1.AuxInt) != 0 {
 10018  				break
 10019  			}
 10020  			b.resetWithControl(BlockLOONG64LEZ, x)
 10021  			return true
 10022  		}
 10023  		// match: (EQ (SGTU (MOVVconst [c]) y) yes no)
 10024  		// cond: c >= -2048 && c <= 2047
 10025  		// result: (EQ (SGTUconst [c] y) yes no)
 10026  		for b.Controls[0].Op == OpLOONG64SGTU {
 10027  			v_0 := b.Controls[0]
 10028  			y := v_0.Args[1]
 10029  			v_0_0 := v_0.Args[0]
 10030  			if v_0_0.Op != OpLOONG64MOVVconst {
 10031  				break
 10032  			}
 10033  			c := auxIntToInt64(v_0_0.AuxInt)
 10034  			if !(c >= -2048 && c <= 2047) {
 10035  				break
 10036  			}
 10037  			v0 := b.NewValue0(v_0.Pos, OpLOONG64SGTUconst, typ.Bool)
 10038  			v0.AuxInt = int64ToAuxInt(c)
 10039  			v0.AddArg(y)
 10040  			b.resetWithControl(BlockLOONG64EQ, v0)
 10041  			return true
 10042  		}
 10043  		// match: (EQ (SUBV x y) yes no)
 10044  		// result: (BEQ x y yes no)
 10045  		for b.Controls[0].Op == OpLOONG64SUBV {
 10046  			v_0 := b.Controls[0]
 10047  			y := v_0.Args[1]
 10048  			x := v_0.Args[0]
 10049  			b.resetWithControl2(BlockLOONG64BEQ, x, y)
 10050  			return true
 10051  		}
 10052  		// match: (EQ (SGT x y) yes no)
 10053  		// result: (BGE y x yes no)
 10054  		for b.Controls[0].Op == OpLOONG64SGT {
 10055  			v_0 := b.Controls[0]
 10056  			y := v_0.Args[1]
 10057  			x := v_0.Args[0]
 10058  			b.resetWithControl2(BlockLOONG64BGE, y, x)
 10059  			return true
 10060  		}
 10061  		// match: (EQ (SGTU x y) yes no)
 10062  		// result: (BGEU y x yes no)
 10063  		for b.Controls[0].Op == OpLOONG64SGTU {
 10064  			v_0 := b.Controls[0]
 10065  			y := v_0.Args[1]
 10066  			x := v_0.Args[0]
 10067  			b.resetWithControl2(BlockLOONG64BGEU, y, x)
 10068  			return true
 10069  		}
 10070  		// match: (EQ (MOVVconst [0]) yes no)
 10071  		// result: (First yes no)
 10072  		for b.Controls[0].Op == OpLOONG64MOVVconst {
 10073  			v_0 := b.Controls[0]
 10074  			if auxIntToInt64(v_0.AuxInt) != 0 {
 10075  				break
 10076  			}
 10077  			b.Reset(BlockFirst)
 10078  			return true
 10079  		}
 10080  		// match: (EQ (MOVVconst [c]) yes no)
 10081  		// cond: c != 0
 10082  		// result: (First no yes)
 10083  		for b.Controls[0].Op == OpLOONG64MOVVconst {
 10084  			v_0 := b.Controls[0]
 10085  			c := auxIntToInt64(v_0.AuxInt)
 10086  			if !(c != 0) {
 10087  				break
 10088  			}
 10089  			b.Reset(BlockFirst)
 10090  			b.swapSuccessors()
 10091  			return true
 10092  		}
 10093  	case BlockLOONG64GEZ:
 10094  		// match: (GEZ (MOVVconst [c]) yes no)
 10095  		// cond: c >= 0
 10096  		// result: (First yes no)
 10097  		for b.Controls[0].Op == OpLOONG64MOVVconst {
 10098  			v_0 := b.Controls[0]
 10099  			c := auxIntToInt64(v_0.AuxInt)
 10100  			if !(c >= 0) {
 10101  				break
 10102  			}
 10103  			b.Reset(BlockFirst)
 10104  			return true
 10105  		}
 10106  		// match: (GEZ (MOVVconst [c]) yes no)
 10107  		// cond: c < 0
 10108  		// result: (First no yes)
 10109  		for b.Controls[0].Op == OpLOONG64MOVVconst {
 10110  			v_0 := b.Controls[0]
 10111  			c := auxIntToInt64(v_0.AuxInt)
 10112  			if !(c < 0) {
 10113  				break
 10114  			}
 10115  			b.Reset(BlockFirst)
 10116  			b.swapSuccessors()
 10117  			return true
 10118  		}
 10119  	case BlockLOONG64GTZ:
 10120  		// match: (GTZ (MOVVconst [c]) yes no)
 10121  		// cond: c > 0
 10122  		// result: (First yes no)
 10123  		for b.Controls[0].Op == OpLOONG64MOVVconst {
 10124  			v_0 := b.Controls[0]
 10125  			c := auxIntToInt64(v_0.AuxInt)
 10126  			if !(c > 0) {
 10127  				break
 10128  			}
 10129  			b.Reset(BlockFirst)
 10130  			return true
 10131  		}
 10132  		// match: (GTZ (MOVVconst [c]) yes no)
 10133  		// cond: c <= 0
 10134  		// result: (First no yes)
 10135  		for b.Controls[0].Op == OpLOONG64MOVVconst {
 10136  			v_0 := b.Controls[0]
 10137  			c := auxIntToInt64(v_0.AuxInt)
 10138  			if !(c <= 0) {
 10139  				break
 10140  			}
 10141  			b.Reset(BlockFirst)
 10142  			b.swapSuccessors()
 10143  			return true
 10144  		}
 10145  	case BlockIf:
 10146  		// match: (If cond yes no)
 10147  		// result: (NE (MOVBUreg <typ.UInt64> cond) yes no)
 10148  		for {
 10149  			cond := b.Controls[0]
 10150  			v0 := b.NewValue0(cond.Pos, OpLOONG64MOVBUreg, typ.UInt64)
 10151  			v0.AddArg(cond)
 10152  			b.resetWithControl(BlockLOONG64NE, v0)
 10153  			return true
 10154  		}
 10155  	case BlockLOONG64LEZ:
 10156  		// match: (LEZ (MOVVconst [c]) yes no)
 10157  		// cond: c <= 0
 10158  		// result: (First yes no)
 10159  		for b.Controls[0].Op == OpLOONG64MOVVconst {
 10160  			v_0 := b.Controls[0]
 10161  			c := auxIntToInt64(v_0.AuxInt)
 10162  			if !(c <= 0) {
 10163  				break
 10164  			}
 10165  			b.Reset(BlockFirst)
 10166  			return true
 10167  		}
 10168  		// match: (LEZ (MOVVconst [c]) yes no)
 10169  		// cond: c > 0
 10170  		// result: (First no yes)
 10171  		for b.Controls[0].Op == OpLOONG64MOVVconst {
 10172  			v_0 := b.Controls[0]
 10173  			c := auxIntToInt64(v_0.AuxInt)
 10174  			if !(c > 0) {
 10175  				break
 10176  			}
 10177  			b.Reset(BlockFirst)
 10178  			b.swapSuccessors()
 10179  			return true
 10180  		}
 10181  	case BlockLOONG64LTZ:
 10182  		// match: (LTZ (MOVVconst [c]) yes no)
 10183  		// cond: c < 0
 10184  		// result: (First yes no)
 10185  		for b.Controls[0].Op == OpLOONG64MOVVconst {
 10186  			v_0 := b.Controls[0]
 10187  			c := auxIntToInt64(v_0.AuxInt)
 10188  			if !(c < 0) {
 10189  				break
 10190  			}
 10191  			b.Reset(BlockFirst)
 10192  			return true
 10193  		}
 10194  		// match: (LTZ (MOVVconst [c]) yes no)
 10195  		// cond: c >= 0
 10196  		// result: (First no yes)
 10197  		for b.Controls[0].Op == OpLOONG64MOVVconst {
 10198  			v_0 := b.Controls[0]
 10199  			c := auxIntToInt64(v_0.AuxInt)
 10200  			if !(c >= 0) {
 10201  				break
 10202  			}
 10203  			b.Reset(BlockFirst)
 10204  			b.swapSuccessors()
 10205  			return true
 10206  		}
 10207  	case BlockLOONG64NE:
 10208  		// match: (NE (FPFlagTrue cmp) yes no)
 10209  		// result: (FPT cmp yes no)
 10210  		for b.Controls[0].Op == OpLOONG64FPFlagTrue {
 10211  			v_0 := b.Controls[0]
 10212  			cmp := v_0.Args[0]
 10213  			b.resetWithControl(BlockLOONG64FPT, cmp)
 10214  			return true
 10215  		}
 10216  		// match: (NE (FPFlagFalse cmp) yes no)
 10217  		// result: (FPF cmp yes no)
 10218  		for b.Controls[0].Op == OpLOONG64FPFlagFalse {
 10219  			v_0 := b.Controls[0]
 10220  			cmp := v_0.Args[0]
 10221  			b.resetWithControl(BlockLOONG64FPF, cmp)
 10222  			return true
 10223  		}
 10224  		// match: (NE (XORconst [1] cmp:(SGT _ _)) yes no)
 10225  		// result: (EQ cmp yes no)
 10226  		for b.Controls[0].Op == OpLOONG64XORconst {
 10227  			v_0 := b.Controls[0]
 10228  			if auxIntToInt64(v_0.AuxInt) != 1 {
 10229  				break
 10230  			}
 10231  			cmp := v_0.Args[0]
 10232  			if cmp.Op != OpLOONG64SGT {
 10233  				break
 10234  			}
 10235  			b.resetWithControl(BlockLOONG64EQ, cmp)
 10236  			return true
 10237  		}
 10238  		// match: (NE (XORconst [1] cmp:(SGTU _ _)) yes no)
 10239  		// result: (EQ cmp yes no)
 10240  		for b.Controls[0].Op == OpLOONG64XORconst {
 10241  			v_0 := b.Controls[0]
 10242  			if auxIntToInt64(v_0.AuxInt) != 1 {
 10243  				break
 10244  			}
 10245  			cmp := v_0.Args[0]
 10246  			if cmp.Op != OpLOONG64SGTU {
 10247  				break
 10248  			}
 10249  			b.resetWithControl(BlockLOONG64EQ, cmp)
 10250  			return true
 10251  		}
 10252  		// match: (NE (XORconst [1] cmp:(SGTconst _)) yes no)
 10253  		// result: (EQ cmp yes no)
 10254  		for b.Controls[0].Op == OpLOONG64XORconst {
 10255  			v_0 := b.Controls[0]
 10256  			if auxIntToInt64(v_0.AuxInt) != 1 {
 10257  				break
 10258  			}
 10259  			cmp := v_0.Args[0]
 10260  			if cmp.Op != OpLOONG64SGTconst {
 10261  				break
 10262  			}
 10263  			b.resetWithControl(BlockLOONG64EQ, cmp)
 10264  			return true
 10265  		}
 10266  		// match: (NE (XORconst [1] cmp:(SGTUconst _)) yes no)
 10267  		// result: (EQ cmp yes no)
 10268  		for b.Controls[0].Op == OpLOONG64XORconst {
 10269  			v_0 := b.Controls[0]
 10270  			if auxIntToInt64(v_0.AuxInt) != 1 {
 10271  				break
 10272  			}
 10273  			cmp := v_0.Args[0]
 10274  			if cmp.Op != OpLOONG64SGTUconst {
 10275  				break
 10276  			}
 10277  			b.resetWithControl(BlockLOONG64EQ, cmp)
 10278  			return true
 10279  		}
 10280  		// match: (NE (SGTUconst [1] x) yes no)
 10281  		// result: (EQ x yes no)
 10282  		for b.Controls[0].Op == OpLOONG64SGTUconst {
 10283  			v_0 := b.Controls[0]
 10284  			if auxIntToInt64(v_0.AuxInt) != 1 {
 10285  				break
 10286  			}
 10287  			x := v_0.Args[0]
 10288  			b.resetWithControl(BlockLOONG64EQ, x)
 10289  			return true
 10290  		}
 10291  		// match: (NE (SGTU x (MOVVconst [0])) yes no)
 10292  		// result: (NE x yes no)
 10293  		for b.Controls[0].Op == OpLOONG64SGTU {
 10294  			v_0 := b.Controls[0]
 10295  			_ = v_0.Args[1]
 10296  			x := v_0.Args[0]
 10297  			v_0_1 := v_0.Args[1]
 10298  			if v_0_1.Op != OpLOONG64MOVVconst || auxIntToInt64(v_0_1.AuxInt) != 0 {
 10299  				break
 10300  			}
 10301  			b.resetWithControl(BlockLOONG64NE, x)
 10302  			return true
 10303  		}
 10304  		// match: (NE (SGTconst [0] x) yes no)
 10305  		// result: (LTZ x yes no)
 10306  		for b.Controls[0].Op == OpLOONG64SGTconst {
 10307  			v_0 := b.Controls[0]
 10308  			if auxIntToInt64(v_0.AuxInt) != 0 {
 10309  				break
 10310  			}
 10311  			x := v_0.Args[0]
 10312  			b.resetWithControl(BlockLOONG64LTZ, x)
 10313  			return true
 10314  		}
 10315  		// match: (NE (SGT x (MOVVconst [0])) yes no)
 10316  		// result: (GTZ x yes no)
 10317  		for b.Controls[0].Op == OpLOONG64SGT {
 10318  			v_0 := b.Controls[0]
 10319  			_ = v_0.Args[1]
 10320  			x := v_0.Args[0]
 10321  			v_0_1 := v_0.Args[1]
 10322  			if v_0_1.Op != OpLOONG64MOVVconst || auxIntToInt64(v_0_1.AuxInt) != 0 {
 10323  				break
 10324  			}
 10325  			b.resetWithControl(BlockLOONG64GTZ, x)
 10326  			return true
 10327  		}
 10328  		// match: (NE (SGTU (MOVVconst [c]) y) yes no)
 10329  		// cond: c >= -2048 && c <= 2047
 10330  		// result: (NE (SGTUconst [c] y) yes no)
 10331  		for b.Controls[0].Op == OpLOONG64SGTU {
 10332  			v_0 := b.Controls[0]
 10333  			y := v_0.Args[1]
 10334  			v_0_0 := v_0.Args[0]
 10335  			if v_0_0.Op != OpLOONG64MOVVconst {
 10336  				break
 10337  			}
 10338  			c := auxIntToInt64(v_0_0.AuxInt)
 10339  			if !(c >= -2048 && c <= 2047) {
 10340  				break
 10341  			}
 10342  			v0 := b.NewValue0(v_0.Pos, OpLOONG64SGTUconst, typ.Bool)
 10343  			v0.AuxInt = int64ToAuxInt(c)
 10344  			v0.AddArg(y)
 10345  			b.resetWithControl(BlockLOONG64NE, v0)
 10346  			return true
 10347  		}
 10348  		// match: (NE (SUBV x y) yes no)
 10349  		// result: (BNE x y yes no)
 10350  		for b.Controls[0].Op == OpLOONG64SUBV {
 10351  			v_0 := b.Controls[0]
 10352  			y := v_0.Args[1]
 10353  			x := v_0.Args[0]
 10354  			b.resetWithControl2(BlockLOONG64BNE, x, y)
 10355  			return true
 10356  		}
 10357  		// match: (NE (SGT x y) yes no)
 10358  		// result: (BLT y x yes no)
 10359  		for b.Controls[0].Op == OpLOONG64SGT {
 10360  			v_0 := b.Controls[0]
 10361  			y := v_0.Args[1]
 10362  			x := v_0.Args[0]
 10363  			b.resetWithControl2(BlockLOONG64BLT, y, x)
 10364  			return true
 10365  		}
 10366  		// match: (NE (SGTU x y) yes no)
 10367  		// result: (BLTU y x yes no)
 10368  		for b.Controls[0].Op == OpLOONG64SGTU {
 10369  			v_0 := b.Controls[0]
 10370  			y := v_0.Args[1]
 10371  			x := v_0.Args[0]
 10372  			b.resetWithControl2(BlockLOONG64BLTU, y, x)
 10373  			return true
 10374  		}
 10375  		// match: (NE (MOVVconst [0]) yes no)
 10376  		// result: (First no yes)
 10377  		for b.Controls[0].Op == OpLOONG64MOVVconst {
 10378  			v_0 := b.Controls[0]
 10379  			if auxIntToInt64(v_0.AuxInt) != 0 {
 10380  				break
 10381  			}
 10382  			b.Reset(BlockFirst)
 10383  			b.swapSuccessors()
 10384  			return true
 10385  		}
 10386  		// match: (NE (MOVVconst [c]) yes no)
 10387  		// cond: c != 0
 10388  		// result: (First yes no)
 10389  		for b.Controls[0].Op == OpLOONG64MOVVconst {
 10390  			v_0 := b.Controls[0]
 10391  			c := auxIntToInt64(v_0.AuxInt)
 10392  			if !(c != 0) {
 10393  				break
 10394  			}
 10395  			b.Reset(BlockFirst)
 10396  			return true
 10397  		}
 10398  	}
 10399  	return false
 10400  }
 10401  

View as plain text