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 OpAtomicCompareAndSwap32Variant:
    70  		return rewriteValueLOONG64_OpAtomicCompareAndSwap32Variant(v)
    71  	case OpAtomicCompareAndSwap64:
    72  		v.Op = OpLOONG64LoweredAtomicCas64
    73  		return true
    74  	case OpAtomicCompareAndSwap64Variant:
    75  		v.Op = OpLOONG64LoweredAtomicCas64Variant
    76  		return true
    77  	case OpAtomicExchange32:
    78  		v.Op = OpLOONG64LoweredAtomicExchange32
    79  		return true
    80  	case OpAtomicExchange64:
    81  		v.Op = OpLOONG64LoweredAtomicExchange64
    82  		return true
    83  	case OpAtomicExchange8Variant:
    84  		v.Op = OpLOONG64LoweredAtomicExchange8Variant
    85  		return true
    86  	case OpAtomicLoad32:
    87  		v.Op = OpLOONG64LoweredAtomicLoad32
    88  		return true
    89  	case OpAtomicLoad64:
    90  		v.Op = OpLOONG64LoweredAtomicLoad64
    91  		return true
    92  	case OpAtomicLoad8:
    93  		v.Op = OpLOONG64LoweredAtomicLoad8
    94  		return true
    95  	case OpAtomicLoadPtr:
    96  		v.Op = OpLOONG64LoweredAtomicLoad64
    97  		return true
    98  	case OpAtomicOr32:
    99  		v.Op = OpLOONG64LoweredAtomicOr32
   100  		return true
   101  	case OpAtomicOr32value:
   102  		v.Op = OpLOONG64LoweredAtomicOr32value
   103  		return true
   104  	case OpAtomicOr64value:
   105  		v.Op = OpLOONG64LoweredAtomicOr64value
   106  		return true
   107  	case OpAtomicOr8:
   108  		return rewriteValueLOONG64_OpAtomicOr8(v)
   109  	case OpAtomicStore32:
   110  		v.Op = OpLOONG64LoweredAtomicStore32
   111  		return true
   112  	case OpAtomicStore32Variant:
   113  		v.Op = OpLOONG64LoweredAtomicStore32Variant
   114  		return true
   115  	case OpAtomicStore64:
   116  		v.Op = OpLOONG64LoweredAtomicStore64
   117  		return true
   118  	case OpAtomicStore64Variant:
   119  		v.Op = OpLOONG64LoweredAtomicStore64Variant
   120  		return true
   121  	case OpAtomicStore8:
   122  		v.Op = OpLOONG64LoweredAtomicStore8
   123  		return true
   124  	case OpAtomicStore8Variant:
   125  		v.Op = OpLOONG64LoweredAtomicStore8Variant
   126  		return true
   127  	case OpAtomicStorePtrNoWB:
   128  		v.Op = OpLOONG64LoweredAtomicStore64
   129  		return true
   130  	case OpAvg64u:
   131  		return rewriteValueLOONG64_OpAvg64u(v)
   132  	case OpBitLen16:
   133  		return rewriteValueLOONG64_OpBitLen16(v)
   134  	case OpBitLen32:
   135  		return rewriteValueLOONG64_OpBitLen32(v)
   136  	case OpBitLen64:
   137  		return rewriteValueLOONG64_OpBitLen64(v)
   138  	case OpBitLen8:
   139  		return rewriteValueLOONG64_OpBitLen8(v)
   140  	case OpBitRev16:
   141  		return rewriteValueLOONG64_OpBitRev16(v)
   142  	case OpBitRev32:
   143  		v.Op = OpLOONG64BITREVW
   144  		return true
   145  	case OpBitRev64:
   146  		v.Op = OpLOONG64BITREVV
   147  		return true
   148  	case OpBitRev8:
   149  		v.Op = OpLOONG64BITREV4B
   150  		return true
   151  	case OpBswap16:
   152  		v.Op = OpLOONG64REVB2H
   153  		return true
   154  	case OpBswap32:
   155  		v.Op = OpLOONG64REVB2W
   156  		return true
   157  	case OpBswap64:
   158  		v.Op = OpLOONG64REVBV
   159  		return true
   160  	case OpClosureCall:
   161  		v.Op = OpLOONG64CALLclosure
   162  		return true
   163  	case OpCom16:
   164  		return rewriteValueLOONG64_OpCom16(v)
   165  	case OpCom32:
   166  		return rewriteValueLOONG64_OpCom32(v)
   167  	case OpCom64:
   168  		return rewriteValueLOONG64_OpCom64(v)
   169  	case OpCom8:
   170  		return rewriteValueLOONG64_OpCom8(v)
   171  	case OpCondSelect:
   172  		return rewriteValueLOONG64_OpCondSelect(v)
   173  	case OpConst16:
   174  		return rewriteValueLOONG64_OpConst16(v)
   175  	case OpConst32:
   176  		return rewriteValueLOONG64_OpConst32(v)
   177  	case OpConst32F:
   178  		return rewriteValueLOONG64_OpConst32F(v)
   179  	case OpConst64:
   180  		return rewriteValueLOONG64_OpConst64(v)
   181  	case OpConst64F:
   182  		return rewriteValueLOONG64_OpConst64F(v)
   183  	case OpConst8:
   184  		return rewriteValueLOONG64_OpConst8(v)
   185  	case OpConstBool:
   186  		return rewriteValueLOONG64_OpConstBool(v)
   187  	case OpConstNil:
   188  		return rewriteValueLOONG64_OpConstNil(v)
   189  	case OpCopysign:
   190  		v.Op = OpLOONG64FCOPYSGD
   191  		return true
   192  	case OpCtz16:
   193  		return rewriteValueLOONG64_OpCtz16(v)
   194  	case OpCtz16NonZero:
   195  		v.Op = OpCtz64
   196  		return true
   197  	case OpCtz32:
   198  		v.Op = OpLOONG64CTZW
   199  		return true
   200  	case OpCtz32NonZero:
   201  		v.Op = OpCtz64
   202  		return true
   203  	case OpCtz64:
   204  		v.Op = OpLOONG64CTZV
   205  		return true
   206  	case OpCtz64NonZero:
   207  		v.Op = OpCtz64
   208  		return true
   209  	case OpCtz8:
   210  		return rewriteValueLOONG64_OpCtz8(v)
   211  	case OpCtz8NonZero:
   212  		v.Op = OpCtz64
   213  		return true
   214  	case OpCvt32Fto32:
   215  		v.Op = OpLOONG64TRUNCFW
   216  		return true
   217  	case OpCvt32Fto64:
   218  		v.Op = OpLOONG64TRUNCFV
   219  		return true
   220  	case OpCvt32Fto64F:
   221  		v.Op = OpLOONG64MOVFD
   222  		return true
   223  	case OpCvt32to32F:
   224  		v.Op = OpLOONG64MOVWF
   225  		return true
   226  	case OpCvt32to64F:
   227  		v.Op = OpLOONG64MOVWD
   228  		return true
   229  	case OpCvt64Fto32:
   230  		v.Op = OpLOONG64TRUNCDW
   231  		return true
   232  	case OpCvt64Fto32F:
   233  		v.Op = OpLOONG64MOVDF
   234  		return true
   235  	case OpCvt64Fto64:
   236  		v.Op = OpLOONG64TRUNCDV
   237  		return true
   238  	case OpCvt64to32F:
   239  		v.Op = OpLOONG64MOVVF
   240  		return true
   241  	case OpCvt64to64F:
   242  		v.Op = OpLOONG64MOVVD
   243  		return true
   244  	case OpCvtBoolToUint8:
   245  		v.Op = OpCopy
   246  		return true
   247  	case OpDiv16:
   248  		return rewriteValueLOONG64_OpDiv16(v)
   249  	case OpDiv16u:
   250  		return rewriteValueLOONG64_OpDiv16u(v)
   251  	case OpDiv32:
   252  		return rewriteValueLOONG64_OpDiv32(v)
   253  	case OpDiv32F:
   254  		v.Op = OpLOONG64DIVF
   255  		return true
   256  	case OpDiv32u:
   257  		return rewriteValueLOONG64_OpDiv32u(v)
   258  	case OpDiv64:
   259  		return rewriteValueLOONG64_OpDiv64(v)
   260  	case OpDiv64F:
   261  		v.Op = OpLOONG64DIVD
   262  		return true
   263  	case OpDiv64u:
   264  		v.Op = OpLOONG64DIVVU
   265  		return true
   266  	case OpDiv8:
   267  		return rewriteValueLOONG64_OpDiv8(v)
   268  	case OpDiv8u:
   269  		return rewriteValueLOONG64_OpDiv8u(v)
   270  	case OpEq16:
   271  		return rewriteValueLOONG64_OpEq16(v)
   272  	case OpEq32:
   273  		return rewriteValueLOONG64_OpEq32(v)
   274  	case OpEq32F:
   275  		return rewriteValueLOONG64_OpEq32F(v)
   276  	case OpEq64:
   277  		return rewriteValueLOONG64_OpEq64(v)
   278  	case OpEq64F:
   279  		return rewriteValueLOONG64_OpEq64F(v)
   280  	case OpEq8:
   281  		return rewriteValueLOONG64_OpEq8(v)
   282  	case OpEqB:
   283  		return rewriteValueLOONG64_OpEqB(v)
   284  	case OpEqPtr:
   285  		return rewriteValueLOONG64_OpEqPtr(v)
   286  	case OpFMA:
   287  		v.Op = OpLOONG64FMADDD
   288  		return true
   289  	case OpGetCallerPC:
   290  		v.Op = OpLOONG64LoweredGetCallerPC
   291  		return true
   292  	case OpGetCallerSP:
   293  		v.Op = OpLOONG64LoweredGetCallerSP
   294  		return true
   295  	case OpGetClosurePtr:
   296  		v.Op = OpLOONG64LoweredGetClosurePtr
   297  		return true
   298  	case OpHmul32:
   299  		v.Op = OpLOONG64MULH
   300  		return true
   301  	case OpHmul32u:
   302  		v.Op = OpLOONG64MULHU
   303  		return true
   304  	case OpHmul64:
   305  		v.Op = OpLOONG64MULHV
   306  		return true
   307  	case OpHmul64u:
   308  		v.Op = OpLOONG64MULHVU
   309  		return true
   310  	case OpInterCall:
   311  		v.Op = OpLOONG64CALLinter
   312  		return true
   313  	case OpIsInBounds:
   314  		return rewriteValueLOONG64_OpIsInBounds(v)
   315  	case OpIsNonNil:
   316  		return rewriteValueLOONG64_OpIsNonNil(v)
   317  	case OpIsSliceInBounds:
   318  		return rewriteValueLOONG64_OpIsSliceInBounds(v)
   319  	case OpLOONG64ADDD:
   320  		return rewriteValueLOONG64_OpLOONG64ADDD(v)
   321  	case OpLOONG64ADDF:
   322  		return rewriteValueLOONG64_OpLOONG64ADDF(v)
   323  	case OpLOONG64ADDV:
   324  		return rewriteValueLOONG64_OpLOONG64ADDV(v)
   325  	case OpLOONG64ADDVconst:
   326  		return rewriteValueLOONG64_OpLOONG64ADDVconst(v)
   327  	case OpLOONG64ADDshiftLLV:
   328  		return rewriteValueLOONG64_OpLOONG64ADDshiftLLV(v)
   329  	case OpLOONG64AND:
   330  		return rewriteValueLOONG64_OpLOONG64AND(v)
   331  	case OpLOONG64ANDconst:
   332  		return rewriteValueLOONG64_OpLOONG64ANDconst(v)
   333  	case OpLOONG64DIVV:
   334  		return rewriteValueLOONG64_OpLOONG64DIVV(v)
   335  	case OpLOONG64DIVVU:
   336  		return rewriteValueLOONG64_OpLOONG64DIVVU(v)
   337  	case OpLOONG64LoweredPanicBoundsCR:
   338  		return rewriteValueLOONG64_OpLOONG64LoweredPanicBoundsCR(v)
   339  	case OpLOONG64LoweredPanicBoundsRC:
   340  		return rewriteValueLOONG64_OpLOONG64LoweredPanicBoundsRC(v)
   341  	case OpLOONG64LoweredPanicBoundsRR:
   342  		return rewriteValueLOONG64_OpLOONG64LoweredPanicBoundsRR(v)
   343  	case OpLOONG64MASKEQZ:
   344  		return rewriteValueLOONG64_OpLOONG64MASKEQZ(v)
   345  	case OpLOONG64MASKNEZ:
   346  		return rewriteValueLOONG64_OpLOONG64MASKNEZ(v)
   347  	case OpLOONG64MOVBUload:
   348  		return rewriteValueLOONG64_OpLOONG64MOVBUload(v)
   349  	case OpLOONG64MOVBUloadidx:
   350  		return rewriteValueLOONG64_OpLOONG64MOVBUloadidx(v)
   351  	case OpLOONG64MOVBUreg:
   352  		return rewriteValueLOONG64_OpLOONG64MOVBUreg(v)
   353  	case OpLOONG64MOVBload:
   354  		return rewriteValueLOONG64_OpLOONG64MOVBload(v)
   355  	case OpLOONG64MOVBloadidx:
   356  		return rewriteValueLOONG64_OpLOONG64MOVBloadidx(v)
   357  	case OpLOONG64MOVBreg:
   358  		return rewriteValueLOONG64_OpLOONG64MOVBreg(v)
   359  	case OpLOONG64MOVBstore:
   360  		return rewriteValueLOONG64_OpLOONG64MOVBstore(v)
   361  	case OpLOONG64MOVBstoreidx:
   362  		return rewriteValueLOONG64_OpLOONG64MOVBstoreidx(v)
   363  	case OpLOONG64MOVDF:
   364  		return rewriteValueLOONG64_OpLOONG64MOVDF(v)
   365  	case OpLOONG64MOVDload:
   366  		return rewriteValueLOONG64_OpLOONG64MOVDload(v)
   367  	case OpLOONG64MOVDloadidx:
   368  		return rewriteValueLOONG64_OpLOONG64MOVDloadidx(v)
   369  	case OpLOONG64MOVDstore:
   370  		return rewriteValueLOONG64_OpLOONG64MOVDstore(v)
   371  	case OpLOONG64MOVDstoreidx:
   372  		return rewriteValueLOONG64_OpLOONG64MOVDstoreidx(v)
   373  	case OpLOONG64MOVFload:
   374  		return rewriteValueLOONG64_OpLOONG64MOVFload(v)
   375  	case OpLOONG64MOVFloadidx:
   376  		return rewriteValueLOONG64_OpLOONG64MOVFloadidx(v)
   377  	case OpLOONG64MOVFstore:
   378  		return rewriteValueLOONG64_OpLOONG64MOVFstore(v)
   379  	case OpLOONG64MOVFstoreidx:
   380  		return rewriteValueLOONG64_OpLOONG64MOVFstoreidx(v)
   381  	case OpLOONG64MOVHUload:
   382  		return rewriteValueLOONG64_OpLOONG64MOVHUload(v)
   383  	case OpLOONG64MOVHUloadidx:
   384  		return rewriteValueLOONG64_OpLOONG64MOVHUloadidx(v)
   385  	case OpLOONG64MOVHUreg:
   386  		return rewriteValueLOONG64_OpLOONG64MOVHUreg(v)
   387  	case OpLOONG64MOVHload:
   388  		return rewriteValueLOONG64_OpLOONG64MOVHload(v)
   389  	case OpLOONG64MOVHloadidx:
   390  		return rewriteValueLOONG64_OpLOONG64MOVHloadidx(v)
   391  	case OpLOONG64MOVHreg:
   392  		return rewriteValueLOONG64_OpLOONG64MOVHreg(v)
   393  	case OpLOONG64MOVHstore:
   394  		return rewriteValueLOONG64_OpLOONG64MOVHstore(v)
   395  	case OpLOONG64MOVHstoreidx:
   396  		return rewriteValueLOONG64_OpLOONG64MOVHstoreidx(v)
   397  	case OpLOONG64MOVVload:
   398  		return rewriteValueLOONG64_OpLOONG64MOVVload(v)
   399  	case OpLOONG64MOVVloadidx:
   400  		return rewriteValueLOONG64_OpLOONG64MOVVloadidx(v)
   401  	case OpLOONG64MOVVnop:
   402  		return rewriteValueLOONG64_OpLOONG64MOVVnop(v)
   403  	case OpLOONG64MOVVreg:
   404  		return rewriteValueLOONG64_OpLOONG64MOVVreg(v)
   405  	case OpLOONG64MOVVstore:
   406  		return rewriteValueLOONG64_OpLOONG64MOVVstore(v)
   407  	case OpLOONG64MOVVstoreidx:
   408  		return rewriteValueLOONG64_OpLOONG64MOVVstoreidx(v)
   409  	case OpLOONG64MOVWUload:
   410  		return rewriteValueLOONG64_OpLOONG64MOVWUload(v)
   411  	case OpLOONG64MOVWUloadidx:
   412  		return rewriteValueLOONG64_OpLOONG64MOVWUloadidx(v)
   413  	case OpLOONG64MOVWUreg:
   414  		return rewriteValueLOONG64_OpLOONG64MOVWUreg(v)
   415  	case OpLOONG64MOVWload:
   416  		return rewriteValueLOONG64_OpLOONG64MOVWload(v)
   417  	case OpLOONG64MOVWloadidx:
   418  		return rewriteValueLOONG64_OpLOONG64MOVWloadidx(v)
   419  	case OpLOONG64MOVWreg:
   420  		return rewriteValueLOONG64_OpLOONG64MOVWreg(v)
   421  	case OpLOONG64MOVWstore:
   422  		return rewriteValueLOONG64_OpLOONG64MOVWstore(v)
   423  	case OpLOONG64MOVWstoreidx:
   424  		return rewriteValueLOONG64_OpLOONG64MOVWstoreidx(v)
   425  	case OpLOONG64MULV:
   426  		return rewriteValueLOONG64_OpLOONG64MULV(v)
   427  	case OpLOONG64NEGV:
   428  		return rewriteValueLOONG64_OpLOONG64NEGV(v)
   429  	case OpLOONG64NOR:
   430  		return rewriteValueLOONG64_OpLOONG64NOR(v)
   431  	case OpLOONG64NORconst:
   432  		return rewriteValueLOONG64_OpLOONG64NORconst(v)
   433  	case OpLOONG64OR:
   434  		return rewriteValueLOONG64_OpLOONG64OR(v)
   435  	case OpLOONG64ORN:
   436  		return rewriteValueLOONG64_OpLOONG64ORN(v)
   437  	case OpLOONG64ORconst:
   438  		return rewriteValueLOONG64_OpLOONG64ORconst(v)
   439  	case OpLOONG64REMV:
   440  		return rewriteValueLOONG64_OpLOONG64REMV(v)
   441  	case OpLOONG64REMVU:
   442  		return rewriteValueLOONG64_OpLOONG64REMVU(v)
   443  	case OpLOONG64ROTR:
   444  		return rewriteValueLOONG64_OpLOONG64ROTR(v)
   445  	case OpLOONG64ROTRV:
   446  		return rewriteValueLOONG64_OpLOONG64ROTRV(v)
   447  	case OpLOONG64SGT:
   448  		return rewriteValueLOONG64_OpLOONG64SGT(v)
   449  	case OpLOONG64SGTU:
   450  		return rewriteValueLOONG64_OpLOONG64SGTU(v)
   451  	case OpLOONG64SGTUconst:
   452  		return rewriteValueLOONG64_OpLOONG64SGTUconst(v)
   453  	case OpLOONG64SGTconst:
   454  		return rewriteValueLOONG64_OpLOONG64SGTconst(v)
   455  	case OpLOONG64SLL:
   456  		return rewriteValueLOONG64_OpLOONG64SLL(v)
   457  	case OpLOONG64SLLV:
   458  		return rewriteValueLOONG64_OpLOONG64SLLV(v)
   459  	case OpLOONG64SLLVconst:
   460  		return rewriteValueLOONG64_OpLOONG64SLLVconst(v)
   461  	case OpLOONG64SLLconst:
   462  		return rewriteValueLOONG64_OpLOONG64SLLconst(v)
   463  	case OpLOONG64SRA:
   464  		return rewriteValueLOONG64_OpLOONG64SRA(v)
   465  	case OpLOONG64SRAV:
   466  		return rewriteValueLOONG64_OpLOONG64SRAV(v)
   467  	case OpLOONG64SRAVconst:
   468  		return rewriteValueLOONG64_OpLOONG64SRAVconst(v)
   469  	case OpLOONG64SRL:
   470  		return rewriteValueLOONG64_OpLOONG64SRL(v)
   471  	case OpLOONG64SRLV:
   472  		return rewriteValueLOONG64_OpLOONG64SRLV(v)
   473  	case OpLOONG64SRLVconst:
   474  		return rewriteValueLOONG64_OpLOONG64SRLVconst(v)
   475  	case OpLOONG64SUBD:
   476  		return rewriteValueLOONG64_OpLOONG64SUBD(v)
   477  	case OpLOONG64SUBF:
   478  		return rewriteValueLOONG64_OpLOONG64SUBF(v)
   479  	case OpLOONG64SUBV:
   480  		return rewriteValueLOONG64_OpLOONG64SUBV(v)
   481  	case OpLOONG64SUBVconst:
   482  		return rewriteValueLOONG64_OpLOONG64SUBVconst(v)
   483  	case OpLOONG64XOR:
   484  		return rewriteValueLOONG64_OpLOONG64XOR(v)
   485  	case OpLOONG64XORconst:
   486  		return rewriteValueLOONG64_OpLOONG64XORconst(v)
   487  	case OpLeq16:
   488  		return rewriteValueLOONG64_OpLeq16(v)
   489  	case OpLeq16U:
   490  		return rewriteValueLOONG64_OpLeq16U(v)
   491  	case OpLeq32:
   492  		return rewriteValueLOONG64_OpLeq32(v)
   493  	case OpLeq32F:
   494  		return rewriteValueLOONG64_OpLeq32F(v)
   495  	case OpLeq32U:
   496  		return rewriteValueLOONG64_OpLeq32U(v)
   497  	case OpLeq64:
   498  		return rewriteValueLOONG64_OpLeq64(v)
   499  	case OpLeq64F:
   500  		return rewriteValueLOONG64_OpLeq64F(v)
   501  	case OpLeq64U:
   502  		return rewriteValueLOONG64_OpLeq64U(v)
   503  	case OpLeq8:
   504  		return rewriteValueLOONG64_OpLeq8(v)
   505  	case OpLeq8U:
   506  		return rewriteValueLOONG64_OpLeq8U(v)
   507  	case OpLess16:
   508  		return rewriteValueLOONG64_OpLess16(v)
   509  	case OpLess16U:
   510  		return rewriteValueLOONG64_OpLess16U(v)
   511  	case OpLess32:
   512  		return rewriteValueLOONG64_OpLess32(v)
   513  	case OpLess32F:
   514  		return rewriteValueLOONG64_OpLess32F(v)
   515  	case OpLess32U:
   516  		return rewriteValueLOONG64_OpLess32U(v)
   517  	case OpLess64:
   518  		return rewriteValueLOONG64_OpLess64(v)
   519  	case OpLess64F:
   520  		return rewriteValueLOONG64_OpLess64F(v)
   521  	case OpLess64U:
   522  		return rewriteValueLOONG64_OpLess64U(v)
   523  	case OpLess8:
   524  		return rewriteValueLOONG64_OpLess8(v)
   525  	case OpLess8U:
   526  		return rewriteValueLOONG64_OpLess8U(v)
   527  	case OpLoad:
   528  		return rewriteValueLOONG64_OpLoad(v)
   529  	case OpLocalAddr:
   530  		return rewriteValueLOONG64_OpLocalAddr(v)
   531  	case OpLsh16x16:
   532  		return rewriteValueLOONG64_OpLsh16x16(v)
   533  	case OpLsh16x32:
   534  		return rewriteValueLOONG64_OpLsh16x32(v)
   535  	case OpLsh16x64:
   536  		return rewriteValueLOONG64_OpLsh16x64(v)
   537  	case OpLsh16x8:
   538  		return rewriteValueLOONG64_OpLsh16x8(v)
   539  	case OpLsh32x16:
   540  		return rewriteValueLOONG64_OpLsh32x16(v)
   541  	case OpLsh32x32:
   542  		return rewriteValueLOONG64_OpLsh32x32(v)
   543  	case OpLsh32x64:
   544  		return rewriteValueLOONG64_OpLsh32x64(v)
   545  	case OpLsh32x8:
   546  		return rewriteValueLOONG64_OpLsh32x8(v)
   547  	case OpLsh64x16:
   548  		return rewriteValueLOONG64_OpLsh64x16(v)
   549  	case OpLsh64x32:
   550  		return rewriteValueLOONG64_OpLsh64x32(v)
   551  	case OpLsh64x64:
   552  		return rewriteValueLOONG64_OpLsh64x64(v)
   553  	case OpLsh64x8:
   554  		return rewriteValueLOONG64_OpLsh64x8(v)
   555  	case OpLsh8x16:
   556  		return rewriteValueLOONG64_OpLsh8x16(v)
   557  	case OpLsh8x32:
   558  		return rewriteValueLOONG64_OpLsh8x32(v)
   559  	case OpLsh8x64:
   560  		return rewriteValueLOONG64_OpLsh8x64(v)
   561  	case OpLsh8x8:
   562  		return rewriteValueLOONG64_OpLsh8x8(v)
   563  	case OpMax32F:
   564  		v.Op = OpLOONG64FMAXF
   565  		return true
   566  	case OpMax64F:
   567  		v.Op = OpLOONG64FMAXD
   568  		return true
   569  	case OpMin32F:
   570  		v.Op = OpLOONG64FMINF
   571  		return true
   572  	case OpMin64F:
   573  		v.Op = OpLOONG64FMIND
   574  		return true
   575  	case OpMod16:
   576  		return rewriteValueLOONG64_OpMod16(v)
   577  	case OpMod16u:
   578  		return rewriteValueLOONG64_OpMod16u(v)
   579  	case OpMod32:
   580  		return rewriteValueLOONG64_OpMod32(v)
   581  	case OpMod32u:
   582  		return rewriteValueLOONG64_OpMod32u(v)
   583  	case OpMod64:
   584  		return rewriteValueLOONG64_OpMod64(v)
   585  	case OpMod64u:
   586  		v.Op = OpLOONG64REMVU
   587  		return true
   588  	case OpMod8:
   589  		return rewriteValueLOONG64_OpMod8(v)
   590  	case OpMod8u:
   591  		return rewriteValueLOONG64_OpMod8u(v)
   592  	case OpMove:
   593  		return rewriteValueLOONG64_OpMove(v)
   594  	case OpMul16:
   595  		v.Op = OpLOONG64MULV
   596  		return true
   597  	case OpMul32:
   598  		v.Op = OpLOONG64MULV
   599  		return true
   600  	case OpMul32F:
   601  		v.Op = OpLOONG64MULF
   602  		return true
   603  	case OpMul64:
   604  		v.Op = OpLOONG64MULV
   605  		return true
   606  	case OpMul64F:
   607  		v.Op = OpLOONG64MULD
   608  		return true
   609  	case OpMul8:
   610  		v.Op = OpLOONG64MULV
   611  		return true
   612  	case OpNeg16:
   613  		v.Op = OpLOONG64NEGV
   614  		return true
   615  	case OpNeg32:
   616  		v.Op = OpLOONG64NEGV
   617  		return true
   618  	case OpNeg32F:
   619  		v.Op = OpLOONG64NEGF
   620  		return true
   621  	case OpNeg64:
   622  		v.Op = OpLOONG64NEGV
   623  		return true
   624  	case OpNeg64F:
   625  		v.Op = OpLOONG64NEGD
   626  		return true
   627  	case OpNeg8:
   628  		v.Op = OpLOONG64NEGV
   629  		return true
   630  	case OpNeq16:
   631  		return rewriteValueLOONG64_OpNeq16(v)
   632  	case OpNeq32:
   633  		return rewriteValueLOONG64_OpNeq32(v)
   634  	case OpNeq32F:
   635  		return rewriteValueLOONG64_OpNeq32F(v)
   636  	case OpNeq64:
   637  		return rewriteValueLOONG64_OpNeq64(v)
   638  	case OpNeq64F:
   639  		return rewriteValueLOONG64_OpNeq64F(v)
   640  	case OpNeq8:
   641  		return rewriteValueLOONG64_OpNeq8(v)
   642  	case OpNeqB:
   643  		v.Op = OpLOONG64XOR
   644  		return true
   645  	case OpNeqPtr:
   646  		return rewriteValueLOONG64_OpNeqPtr(v)
   647  	case OpNilCheck:
   648  		v.Op = OpLOONG64LoweredNilCheck
   649  		return true
   650  	case OpNot:
   651  		return rewriteValueLOONG64_OpNot(v)
   652  	case OpOffPtr:
   653  		return rewriteValueLOONG64_OpOffPtr(v)
   654  	case OpOr16:
   655  		v.Op = OpLOONG64OR
   656  		return true
   657  	case OpOr32:
   658  		v.Op = OpLOONG64OR
   659  		return true
   660  	case OpOr64:
   661  		v.Op = OpLOONG64OR
   662  		return true
   663  	case OpOr8:
   664  		v.Op = OpLOONG64OR
   665  		return true
   666  	case OpOrB:
   667  		v.Op = OpLOONG64OR
   668  		return true
   669  	case OpPanicBounds:
   670  		v.Op = OpLOONG64LoweredPanicBoundsRR
   671  		return true
   672  	case OpPopCount16:
   673  		return rewriteValueLOONG64_OpPopCount16(v)
   674  	case OpPopCount32:
   675  		return rewriteValueLOONG64_OpPopCount32(v)
   676  	case OpPopCount64:
   677  		return rewriteValueLOONG64_OpPopCount64(v)
   678  	case OpPrefetchCache:
   679  		return rewriteValueLOONG64_OpPrefetchCache(v)
   680  	case OpPrefetchCacheStreamed:
   681  		return rewriteValueLOONG64_OpPrefetchCacheStreamed(v)
   682  	case OpPubBarrier:
   683  		v.Op = OpLOONG64LoweredPubBarrier
   684  		return true
   685  	case OpRotateLeft16:
   686  		return rewriteValueLOONG64_OpRotateLeft16(v)
   687  	case OpRotateLeft32:
   688  		return rewriteValueLOONG64_OpRotateLeft32(v)
   689  	case OpRotateLeft64:
   690  		return rewriteValueLOONG64_OpRotateLeft64(v)
   691  	case OpRotateLeft8:
   692  		return rewriteValueLOONG64_OpRotateLeft8(v)
   693  	case OpRound32F:
   694  		v.Op = OpLOONG64LoweredRound32F
   695  		return true
   696  	case OpRound64F:
   697  		v.Op = OpLOONG64LoweredRound64F
   698  		return true
   699  	case OpRsh16Ux16:
   700  		return rewriteValueLOONG64_OpRsh16Ux16(v)
   701  	case OpRsh16Ux32:
   702  		return rewriteValueLOONG64_OpRsh16Ux32(v)
   703  	case OpRsh16Ux64:
   704  		return rewriteValueLOONG64_OpRsh16Ux64(v)
   705  	case OpRsh16Ux8:
   706  		return rewriteValueLOONG64_OpRsh16Ux8(v)
   707  	case OpRsh16x16:
   708  		return rewriteValueLOONG64_OpRsh16x16(v)
   709  	case OpRsh16x32:
   710  		return rewriteValueLOONG64_OpRsh16x32(v)
   711  	case OpRsh16x64:
   712  		return rewriteValueLOONG64_OpRsh16x64(v)
   713  	case OpRsh16x8:
   714  		return rewriteValueLOONG64_OpRsh16x8(v)
   715  	case OpRsh32Ux16:
   716  		return rewriteValueLOONG64_OpRsh32Ux16(v)
   717  	case OpRsh32Ux32:
   718  		return rewriteValueLOONG64_OpRsh32Ux32(v)
   719  	case OpRsh32Ux64:
   720  		return rewriteValueLOONG64_OpRsh32Ux64(v)
   721  	case OpRsh32Ux8:
   722  		return rewriteValueLOONG64_OpRsh32Ux8(v)
   723  	case OpRsh32x16:
   724  		return rewriteValueLOONG64_OpRsh32x16(v)
   725  	case OpRsh32x32:
   726  		return rewriteValueLOONG64_OpRsh32x32(v)
   727  	case OpRsh32x64:
   728  		return rewriteValueLOONG64_OpRsh32x64(v)
   729  	case OpRsh32x8:
   730  		return rewriteValueLOONG64_OpRsh32x8(v)
   731  	case OpRsh64Ux16:
   732  		return rewriteValueLOONG64_OpRsh64Ux16(v)
   733  	case OpRsh64Ux32:
   734  		return rewriteValueLOONG64_OpRsh64Ux32(v)
   735  	case OpRsh64Ux64:
   736  		return rewriteValueLOONG64_OpRsh64Ux64(v)
   737  	case OpRsh64Ux8:
   738  		return rewriteValueLOONG64_OpRsh64Ux8(v)
   739  	case OpRsh64x16:
   740  		return rewriteValueLOONG64_OpRsh64x16(v)
   741  	case OpRsh64x32:
   742  		return rewriteValueLOONG64_OpRsh64x32(v)
   743  	case OpRsh64x64:
   744  		return rewriteValueLOONG64_OpRsh64x64(v)
   745  	case OpRsh64x8:
   746  		return rewriteValueLOONG64_OpRsh64x8(v)
   747  	case OpRsh8Ux16:
   748  		return rewriteValueLOONG64_OpRsh8Ux16(v)
   749  	case OpRsh8Ux32:
   750  		return rewriteValueLOONG64_OpRsh8Ux32(v)
   751  	case OpRsh8Ux64:
   752  		return rewriteValueLOONG64_OpRsh8Ux64(v)
   753  	case OpRsh8Ux8:
   754  		return rewriteValueLOONG64_OpRsh8Ux8(v)
   755  	case OpRsh8x16:
   756  		return rewriteValueLOONG64_OpRsh8x16(v)
   757  	case OpRsh8x32:
   758  		return rewriteValueLOONG64_OpRsh8x32(v)
   759  	case OpRsh8x64:
   760  		return rewriteValueLOONG64_OpRsh8x64(v)
   761  	case OpRsh8x8:
   762  		return rewriteValueLOONG64_OpRsh8x8(v)
   763  	case OpSelect0:
   764  		return rewriteValueLOONG64_OpSelect0(v)
   765  	case OpSelect1:
   766  		return rewriteValueLOONG64_OpSelect1(v)
   767  	case OpSelectN:
   768  		return rewriteValueLOONG64_OpSelectN(v)
   769  	case OpSignExt16to32:
   770  		v.Op = OpLOONG64MOVHreg
   771  		return true
   772  	case OpSignExt16to64:
   773  		v.Op = OpLOONG64MOVHreg
   774  		return true
   775  	case OpSignExt32to64:
   776  		v.Op = OpLOONG64MOVWreg
   777  		return true
   778  	case OpSignExt8to16:
   779  		v.Op = OpLOONG64MOVBreg
   780  		return true
   781  	case OpSignExt8to32:
   782  		v.Op = OpLOONG64MOVBreg
   783  		return true
   784  	case OpSignExt8to64:
   785  		v.Op = OpLOONG64MOVBreg
   786  		return true
   787  	case OpSlicemask:
   788  		return rewriteValueLOONG64_OpSlicemask(v)
   789  	case OpSqrt:
   790  		v.Op = OpLOONG64SQRTD
   791  		return true
   792  	case OpSqrt32:
   793  		v.Op = OpLOONG64SQRTF
   794  		return true
   795  	case OpStaticCall:
   796  		v.Op = OpLOONG64CALLstatic
   797  		return true
   798  	case OpStore:
   799  		return rewriteValueLOONG64_OpStore(v)
   800  	case OpSub16:
   801  		v.Op = OpLOONG64SUBV
   802  		return true
   803  	case OpSub32:
   804  		v.Op = OpLOONG64SUBV
   805  		return true
   806  	case OpSub32F:
   807  		v.Op = OpLOONG64SUBF
   808  		return true
   809  	case OpSub64:
   810  		v.Op = OpLOONG64SUBV
   811  		return true
   812  	case OpSub64F:
   813  		v.Op = OpLOONG64SUBD
   814  		return true
   815  	case OpSub8:
   816  		v.Op = OpLOONG64SUBV
   817  		return true
   818  	case OpSubPtr:
   819  		v.Op = OpLOONG64SUBV
   820  		return true
   821  	case OpTailCall:
   822  		v.Op = OpLOONG64CALLtail
   823  		return true
   824  	case OpTailCallInter:
   825  		v.Op = OpLOONG64CALLtailinter
   826  		return true
   827  	case OpTrunc16to8:
   828  		v.Op = OpCopy
   829  		return true
   830  	case OpTrunc32to16:
   831  		v.Op = OpCopy
   832  		return true
   833  	case OpTrunc32to8:
   834  		v.Op = OpCopy
   835  		return true
   836  	case OpTrunc64to16:
   837  		v.Op = OpCopy
   838  		return true
   839  	case OpTrunc64to32:
   840  		v.Op = OpCopy
   841  		return true
   842  	case OpTrunc64to8:
   843  		v.Op = OpCopy
   844  		return true
   845  	case OpWB:
   846  		v.Op = OpLOONG64LoweredWB
   847  		return true
   848  	case OpXor16:
   849  		v.Op = OpLOONG64XOR
   850  		return true
   851  	case OpXor32:
   852  		v.Op = OpLOONG64XOR
   853  		return true
   854  	case OpXor64:
   855  		v.Op = OpLOONG64XOR
   856  		return true
   857  	case OpXor8:
   858  		v.Op = OpLOONG64XOR
   859  		return true
   860  	case OpZero:
   861  		return rewriteValueLOONG64_OpZero(v)
   862  	case OpZeroExt16to32:
   863  		v.Op = OpLOONG64MOVHUreg
   864  		return true
   865  	case OpZeroExt16to64:
   866  		v.Op = OpLOONG64MOVHUreg
   867  		return true
   868  	case OpZeroExt32to64:
   869  		v.Op = OpLOONG64MOVWUreg
   870  		return true
   871  	case OpZeroExt8to16:
   872  		v.Op = OpLOONG64MOVBUreg
   873  		return true
   874  	case OpZeroExt8to32:
   875  		v.Op = OpLOONG64MOVBUreg
   876  		return true
   877  	case OpZeroExt8to64:
   878  		v.Op = OpLOONG64MOVBUreg
   879  		return true
   880  	}
   881  	return false
   882  }
   883  func rewriteValueLOONG64_OpAddr(v *Value) bool {
   884  	v_0 := v.Args[0]
   885  	// match: (Addr {sym} base)
   886  	// result: (MOVVaddr {sym} base)
   887  	for {
   888  		sym := auxToSym(v.Aux)
   889  		base := v_0
   890  		v.reset(OpLOONG64MOVVaddr)
   891  		v.Aux = symToAux(sym)
   892  		v.AddArg(base)
   893  		return true
   894  	}
   895  }
   896  func rewriteValueLOONG64_OpAtomicAnd8(v *Value) bool {
   897  	v_2 := v.Args[2]
   898  	v_1 := v.Args[1]
   899  	v_0 := v.Args[0]
   900  	b := v.Block
   901  	typ := &b.Func.Config.Types
   902  	// match: (AtomicAnd8 ptr val mem)
   903  	// 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)
   904  	for {
   905  		ptr := v_0
   906  		val := v_1
   907  		mem := v_2
   908  		v.reset(OpLOONG64LoweredAtomicAnd32)
   909  		v0 := b.NewValue0(v.Pos, OpLOONG64AND, typ.Uintptr)
   910  		v1 := b.NewValue0(v.Pos, OpLOONG64MOVVconst, typ.UInt64)
   911  		v1.AuxInt = int64ToAuxInt(^3)
   912  		v0.AddArg2(v1, ptr)
   913  		v2 := b.NewValue0(v.Pos, OpLOONG64NORconst, typ.UInt32)
   914  		v2.AuxInt = int64ToAuxInt(0)
   915  		v3 := b.NewValue0(v.Pos, OpLOONG64SLLV, typ.UInt32)
   916  		v4 := b.NewValue0(v.Pos, OpLOONG64XORconst, typ.UInt32)
   917  		v4.AuxInt = int64ToAuxInt(0xff)
   918  		v5 := b.NewValue0(v.Pos, OpZeroExt8to32, typ.UInt32)
   919  		v5.AddArg(val)
   920  		v4.AddArg(v5)
   921  		v6 := b.NewValue0(v.Pos, OpLOONG64SLLVconst, typ.UInt64)
   922  		v6.AuxInt = int64ToAuxInt(3)
   923  		v7 := b.NewValue0(v.Pos, OpLOONG64ANDconst, typ.UInt64)
   924  		v7.AuxInt = int64ToAuxInt(3)
   925  		v7.AddArg(ptr)
   926  		v6.AddArg(v7)
   927  		v3.AddArg2(v4, v6)
   928  		v2.AddArg(v3)
   929  		v.AddArg3(v0, v2, mem)
   930  		return true
   931  	}
   932  }
   933  func rewriteValueLOONG64_OpAtomicCompareAndSwap32(v *Value) bool {
   934  	v_3 := v.Args[3]
   935  	v_2 := v.Args[2]
   936  	v_1 := v.Args[1]
   937  	v_0 := v.Args[0]
   938  	b := v.Block
   939  	typ := &b.Func.Config.Types
   940  	// match: (AtomicCompareAndSwap32 ptr old new mem)
   941  	// result: (LoweredAtomicCas32 ptr (SignExt32to64 old) new mem)
   942  	for {
   943  		ptr := v_0
   944  		old := v_1
   945  		new := v_2
   946  		mem := v_3
   947  		v.reset(OpLOONG64LoweredAtomicCas32)
   948  		v0 := b.NewValue0(v.Pos, OpSignExt32to64, typ.Int64)
   949  		v0.AddArg(old)
   950  		v.AddArg4(ptr, v0, new, mem)
   951  		return true
   952  	}
   953  }
   954  func rewriteValueLOONG64_OpAtomicCompareAndSwap32Variant(v *Value) bool {
   955  	v_3 := v.Args[3]
   956  	v_2 := v.Args[2]
   957  	v_1 := v.Args[1]
   958  	v_0 := v.Args[0]
   959  	b := v.Block
   960  	typ := &b.Func.Config.Types
   961  	// match: (AtomicCompareAndSwap32Variant ptr old new mem)
   962  	// result: (LoweredAtomicCas32Variant ptr (SignExt32to64 old) new mem)
   963  	for {
   964  		ptr := v_0
   965  		old := v_1
   966  		new := v_2
   967  		mem := v_3
   968  		v.reset(OpLOONG64LoweredAtomicCas32Variant)
   969  		v0 := b.NewValue0(v.Pos, OpSignExt32to64, typ.Int64)
   970  		v0.AddArg(old)
   971  		v.AddArg4(ptr, v0, new, mem)
   972  		return true
   973  	}
   974  }
   975  func rewriteValueLOONG64_OpAtomicOr8(v *Value) bool {
   976  	v_2 := v.Args[2]
   977  	v_1 := v.Args[1]
   978  	v_0 := v.Args[0]
   979  	b := v.Block
   980  	typ := &b.Func.Config.Types
   981  	// match: (AtomicOr8 ptr val mem)
   982  	// result: (LoweredAtomicOr32 (AND <typ.Uintptr> (MOVVconst [^3]) ptr) (SLLV <typ.UInt32> (ZeroExt8to32 val) (SLLVconst <typ.UInt64> [3] (ANDconst <typ.UInt64> [3] ptr))) mem)
   983  	for {
   984  		ptr := v_0
   985  		val := v_1
   986  		mem := v_2
   987  		v.reset(OpLOONG64LoweredAtomicOr32)
   988  		v0 := b.NewValue0(v.Pos, OpLOONG64AND, typ.Uintptr)
   989  		v1 := b.NewValue0(v.Pos, OpLOONG64MOVVconst, typ.UInt64)
   990  		v1.AuxInt = int64ToAuxInt(^3)
   991  		v0.AddArg2(v1, ptr)
   992  		v2 := b.NewValue0(v.Pos, OpLOONG64SLLV, typ.UInt32)
   993  		v3 := b.NewValue0(v.Pos, OpZeroExt8to32, typ.UInt32)
   994  		v3.AddArg(val)
   995  		v4 := b.NewValue0(v.Pos, OpLOONG64SLLVconst, typ.UInt64)
   996  		v4.AuxInt = int64ToAuxInt(3)
   997  		v5 := b.NewValue0(v.Pos, OpLOONG64ANDconst, typ.UInt64)
   998  		v5.AuxInt = int64ToAuxInt(3)
   999  		v5.AddArg(ptr)
  1000  		v4.AddArg(v5)
  1001  		v2.AddArg2(v3, v4)
  1002  		v.AddArg3(v0, v2, mem)
  1003  		return true
  1004  	}
  1005  }
  1006  func rewriteValueLOONG64_OpAvg64u(v *Value) bool {
  1007  	v_1 := v.Args[1]
  1008  	v_0 := v.Args[0]
  1009  	b := v.Block
  1010  	// match: (Avg64u <t> x y)
  1011  	// result: (ADDV (SRLVconst <t> (SUBV <t> x y) [1]) y)
  1012  	for {
  1013  		t := v.Type
  1014  		x := v_0
  1015  		y := v_1
  1016  		v.reset(OpLOONG64ADDV)
  1017  		v0 := b.NewValue0(v.Pos, OpLOONG64SRLVconst, t)
  1018  		v0.AuxInt = int64ToAuxInt(1)
  1019  		v1 := b.NewValue0(v.Pos, OpLOONG64SUBV, t)
  1020  		v1.AddArg2(x, y)
  1021  		v0.AddArg(v1)
  1022  		v.AddArg2(v0, y)
  1023  		return true
  1024  	}
  1025  }
  1026  func rewriteValueLOONG64_OpBitLen16(v *Value) bool {
  1027  	v_0 := v.Args[0]
  1028  	b := v.Block
  1029  	typ := &b.Func.Config.Types
  1030  	// match: (BitLen16 x)
  1031  	// result: (BitLen64 (ZeroExt16to64 x))
  1032  	for {
  1033  		x := v_0
  1034  		v.reset(OpBitLen64)
  1035  		v0 := b.NewValue0(v.Pos, OpZeroExt16to64, typ.UInt64)
  1036  		v0.AddArg(x)
  1037  		v.AddArg(v0)
  1038  		return true
  1039  	}
  1040  }
  1041  func rewriteValueLOONG64_OpBitLen32(v *Value) bool {
  1042  	v_0 := v.Args[0]
  1043  	b := v.Block
  1044  	// match: (BitLen32 <t> x)
  1045  	// result: (NEGV <t> (SUBVconst <t> [32] (CLZW <t> x)))
  1046  	for {
  1047  		t := v.Type
  1048  		x := v_0
  1049  		v.reset(OpLOONG64NEGV)
  1050  		v.Type = t
  1051  		v0 := b.NewValue0(v.Pos, OpLOONG64SUBVconst, t)
  1052  		v0.AuxInt = int64ToAuxInt(32)
  1053  		v1 := b.NewValue0(v.Pos, OpLOONG64CLZW, t)
  1054  		v1.AddArg(x)
  1055  		v0.AddArg(v1)
  1056  		v.AddArg(v0)
  1057  		return true
  1058  	}
  1059  }
  1060  func rewriteValueLOONG64_OpBitLen64(v *Value) bool {
  1061  	v_0 := v.Args[0]
  1062  	b := v.Block
  1063  	// match: (BitLen64 <t> x)
  1064  	// result: (NEGV <t> (SUBVconst <t> [64] (CLZV <t> x)))
  1065  	for {
  1066  		t := v.Type
  1067  		x := v_0
  1068  		v.reset(OpLOONG64NEGV)
  1069  		v.Type = t
  1070  		v0 := b.NewValue0(v.Pos, OpLOONG64SUBVconst, t)
  1071  		v0.AuxInt = int64ToAuxInt(64)
  1072  		v1 := b.NewValue0(v.Pos, OpLOONG64CLZV, t)
  1073  		v1.AddArg(x)
  1074  		v0.AddArg(v1)
  1075  		v.AddArg(v0)
  1076  		return true
  1077  	}
  1078  }
  1079  func rewriteValueLOONG64_OpBitLen8(v *Value) bool {
  1080  	v_0 := v.Args[0]
  1081  	b := v.Block
  1082  	typ := &b.Func.Config.Types
  1083  	// match: (BitLen8 x)
  1084  	// result: (BitLen64 (ZeroExt8to64 x))
  1085  	for {
  1086  		x := v_0
  1087  		v.reset(OpBitLen64)
  1088  		v0 := b.NewValue0(v.Pos, OpZeroExt8to64, typ.UInt64)
  1089  		v0.AddArg(x)
  1090  		v.AddArg(v0)
  1091  		return true
  1092  	}
  1093  }
  1094  func rewriteValueLOONG64_OpBitRev16(v *Value) bool {
  1095  	v_0 := v.Args[0]
  1096  	b := v.Block
  1097  	// match: (BitRev16 <t> x)
  1098  	// result: (REVB2H (BITREV4B <t> x))
  1099  	for {
  1100  		t := v.Type
  1101  		x := v_0
  1102  		v.reset(OpLOONG64REVB2H)
  1103  		v0 := b.NewValue0(v.Pos, OpLOONG64BITREV4B, t)
  1104  		v0.AddArg(x)
  1105  		v.AddArg(v0)
  1106  		return true
  1107  	}
  1108  }
  1109  func rewriteValueLOONG64_OpCom16(v *Value) bool {
  1110  	v_0 := v.Args[0]
  1111  	b := v.Block
  1112  	typ := &b.Func.Config.Types
  1113  	// match: (Com16 x)
  1114  	// result: (NOR (MOVVconst [0]) x)
  1115  	for {
  1116  		x := v_0
  1117  		v.reset(OpLOONG64NOR)
  1118  		v0 := b.NewValue0(v.Pos, OpLOONG64MOVVconst, typ.UInt64)
  1119  		v0.AuxInt = int64ToAuxInt(0)
  1120  		v.AddArg2(v0, x)
  1121  		return true
  1122  	}
  1123  }
  1124  func rewriteValueLOONG64_OpCom32(v *Value) bool {
  1125  	v_0 := v.Args[0]
  1126  	b := v.Block
  1127  	typ := &b.Func.Config.Types
  1128  	// match: (Com32 x)
  1129  	// result: (NOR (MOVVconst [0]) x)
  1130  	for {
  1131  		x := v_0
  1132  		v.reset(OpLOONG64NOR)
  1133  		v0 := b.NewValue0(v.Pos, OpLOONG64MOVVconst, typ.UInt64)
  1134  		v0.AuxInt = int64ToAuxInt(0)
  1135  		v.AddArg2(v0, x)
  1136  		return true
  1137  	}
  1138  }
  1139  func rewriteValueLOONG64_OpCom64(v *Value) bool {
  1140  	v_0 := v.Args[0]
  1141  	b := v.Block
  1142  	typ := &b.Func.Config.Types
  1143  	// match: (Com64 x)
  1144  	// result: (NOR (MOVVconst [0]) x)
  1145  	for {
  1146  		x := v_0
  1147  		v.reset(OpLOONG64NOR)
  1148  		v0 := b.NewValue0(v.Pos, OpLOONG64MOVVconst, typ.UInt64)
  1149  		v0.AuxInt = int64ToAuxInt(0)
  1150  		v.AddArg2(v0, x)
  1151  		return true
  1152  	}
  1153  }
  1154  func rewriteValueLOONG64_OpCom8(v *Value) bool {
  1155  	v_0 := v.Args[0]
  1156  	b := v.Block
  1157  	typ := &b.Func.Config.Types
  1158  	// match: (Com8 x)
  1159  	// result: (NOR (MOVVconst [0]) x)
  1160  	for {
  1161  		x := v_0
  1162  		v.reset(OpLOONG64NOR)
  1163  		v0 := b.NewValue0(v.Pos, OpLOONG64MOVVconst, typ.UInt64)
  1164  		v0.AuxInt = int64ToAuxInt(0)
  1165  		v.AddArg2(v0, x)
  1166  		return true
  1167  	}
  1168  }
  1169  func rewriteValueLOONG64_OpCondSelect(v *Value) bool {
  1170  	v_2 := v.Args[2]
  1171  	v_1 := v.Args[1]
  1172  	v_0 := v.Args[0]
  1173  	b := v.Block
  1174  	// match: (CondSelect <t> x y cond)
  1175  	// result: (OR (MASKEQZ <t> x cond) (MASKNEZ <t> y cond))
  1176  	for {
  1177  		t := v.Type
  1178  		x := v_0
  1179  		y := v_1
  1180  		cond := v_2
  1181  		v.reset(OpLOONG64OR)
  1182  		v0 := b.NewValue0(v.Pos, OpLOONG64MASKEQZ, t)
  1183  		v0.AddArg2(x, cond)
  1184  		v1 := b.NewValue0(v.Pos, OpLOONG64MASKNEZ, t)
  1185  		v1.AddArg2(y, cond)
  1186  		v.AddArg2(v0, v1)
  1187  		return true
  1188  	}
  1189  }
  1190  func rewriteValueLOONG64_OpConst16(v *Value) bool {
  1191  	// match: (Const16 [val])
  1192  	// result: (MOVVconst [int64(val)])
  1193  	for {
  1194  		val := auxIntToInt16(v.AuxInt)
  1195  		v.reset(OpLOONG64MOVVconst)
  1196  		v.AuxInt = int64ToAuxInt(int64(val))
  1197  		return true
  1198  	}
  1199  }
  1200  func rewriteValueLOONG64_OpConst32(v *Value) bool {
  1201  	// match: (Const32 [val])
  1202  	// result: (MOVVconst [int64(val)])
  1203  	for {
  1204  		val := auxIntToInt32(v.AuxInt)
  1205  		v.reset(OpLOONG64MOVVconst)
  1206  		v.AuxInt = int64ToAuxInt(int64(val))
  1207  		return true
  1208  	}
  1209  }
  1210  func rewriteValueLOONG64_OpConst32F(v *Value) bool {
  1211  	// match: (Const32F [val])
  1212  	// result: (MOVFconst [float64(val)])
  1213  	for {
  1214  		val := auxIntToFloat32(v.AuxInt)
  1215  		v.reset(OpLOONG64MOVFconst)
  1216  		v.AuxInt = float64ToAuxInt(float64(val))
  1217  		return true
  1218  	}
  1219  }
  1220  func rewriteValueLOONG64_OpConst64(v *Value) bool {
  1221  	// match: (Const64 [val])
  1222  	// result: (MOVVconst [int64(val)])
  1223  	for {
  1224  		val := auxIntToInt64(v.AuxInt)
  1225  		v.reset(OpLOONG64MOVVconst)
  1226  		v.AuxInt = int64ToAuxInt(int64(val))
  1227  		return true
  1228  	}
  1229  }
  1230  func rewriteValueLOONG64_OpConst64F(v *Value) bool {
  1231  	// match: (Const64F [val])
  1232  	// result: (MOVDconst [float64(val)])
  1233  	for {
  1234  		val := auxIntToFloat64(v.AuxInt)
  1235  		v.reset(OpLOONG64MOVDconst)
  1236  		v.AuxInt = float64ToAuxInt(float64(val))
  1237  		return true
  1238  	}
  1239  }
  1240  func rewriteValueLOONG64_OpConst8(v *Value) bool {
  1241  	// match: (Const8 [val])
  1242  	// result: (MOVVconst [int64(val)])
  1243  	for {
  1244  		val := auxIntToInt8(v.AuxInt)
  1245  		v.reset(OpLOONG64MOVVconst)
  1246  		v.AuxInt = int64ToAuxInt(int64(val))
  1247  		return true
  1248  	}
  1249  }
  1250  func rewriteValueLOONG64_OpConstBool(v *Value) bool {
  1251  	// match: (ConstBool [t])
  1252  	// result: (MOVVconst [int64(b2i(t))])
  1253  	for {
  1254  		t := auxIntToBool(v.AuxInt)
  1255  		v.reset(OpLOONG64MOVVconst)
  1256  		v.AuxInt = int64ToAuxInt(int64(b2i(t)))
  1257  		return true
  1258  	}
  1259  }
  1260  func rewriteValueLOONG64_OpConstNil(v *Value) bool {
  1261  	// match: (ConstNil)
  1262  	// result: (MOVVconst [0])
  1263  	for {
  1264  		v.reset(OpLOONG64MOVVconst)
  1265  		v.AuxInt = int64ToAuxInt(0)
  1266  		return true
  1267  	}
  1268  }
  1269  func rewriteValueLOONG64_OpCtz16(v *Value) bool {
  1270  	v_0 := v.Args[0]
  1271  	b := v.Block
  1272  	typ := &b.Func.Config.Types
  1273  	// match: (Ctz16 x)
  1274  	// result: (CTZV (OR <typ.UInt64> x (MOVVconst [1<<16])))
  1275  	for {
  1276  		x := v_0
  1277  		v.reset(OpLOONG64CTZV)
  1278  		v0 := b.NewValue0(v.Pos, OpLOONG64OR, typ.UInt64)
  1279  		v1 := b.NewValue0(v.Pos, OpLOONG64MOVVconst, typ.UInt64)
  1280  		v1.AuxInt = int64ToAuxInt(1 << 16)
  1281  		v0.AddArg2(x, v1)
  1282  		v.AddArg(v0)
  1283  		return true
  1284  	}
  1285  }
  1286  func rewriteValueLOONG64_OpCtz8(v *Value) bool {
  1287  	v_0 := v.Args[0]
  1288  	b := v.Block
  1289  	typ := &b.Func.Config.Types
  1290  	// match: (Ctz8 x)
  1291  	// result: (CTZV (OR <typ.UInt64> x (MOVVconst [1<<8])))
  1292  	for {
  1293  		x := v_0
  1294  		v.reset(OpLOONG64CTZV)
  1295  		v0 := b.NewValue0(v.Pos, OpLOONG64OR, typ.UInt64)
  1296  		v1 := b.NewValue0(v.Pos, OpLOONG64MOVVconst, typ.UInt64)
  1297  		v1.AuxInt = int64ToAuxInt(1 << 8)
  1298  		v0.AddArg2(x, v1)
  1299  		v.AddArg(v0)
  1300  		return true
  1301  	}
  1302  }
  1303  func rewriteValueLOONG64_OpDiv16(v *Value) bool {
  1304  	v_1 := v.Args[1]
  1305  	v_0 := v.Args[0]
  1306  	b := v.Block
  1307  	typ := &b.Func.Config.Types
  1308  	// match: (Div16 x y)
  1309  	// result: (DIVV (SignExt16to64 x) (SignExt16to64 y))
  1310  	for {
  1311  		x := v_0
  1312  		y := v_1
  1313  		v.reset(OpLOONG64DIVV)
  1314  		v0 := b.NewValue0(v.Pos, OpSignExt16to64, typ.Int64)
  1315  		v0.AddArg(x)
  1316  		v1 := b.NewValue0(v.Pos, OpSignExt16to64, typ.Int64)
  1317  		v1.AddArg(y)
  1318  		v.AddArg2(v0, v1)
  1319  		return true
  1320  	}
  1321  }
  1322  func rewriteValueLOONG64_OpDiv16u(v *Value) bool {
  1323  	v_1 := v.Args[1]
  1324  	v_0 := v.Args[0]
  1325  	b := v.Block
  1326  	typ := &b.Func.Config.Types
  1327  	// match: (Div16u x y)
  1328  	// result: (DIVVU (ZeroExt16to64 x) (ZeroExt16to64 y))
  1329  	for {
  1330  		x := v_0
  1331  		y := v_1
  1332  		v.reset(OpLOONG64DIVVU)
  1333  		v0 := b.NewValue0(v.Pos, OpZeroExt16to64, typ.UInt64)
  1334  		v0.AddArg(x)
  1335  		v1 := b.NewValue0(v.Pos, OpZeroExt16to64, typ.UInt64)
  1336  		v1.AddArg(y)
  1337  		v.AddArg2(v0, v1)
  1338  		return true
  1339  	}
  1340  }
  1341  func rewriteValueLOONG64_OpDiv32(v *Value) bool {
  1342  	v_1 := v.Args[1]
  1343  	v_0 := v.Args[0]
  1344  	b := v.Block
  1345  	typ := &b.Func.Config.Types
  1346  	// match: (Div32 x y)
  1347  	// result: (DIVV (SignExt32to64 x) (SignExt32to64 y))
  1348  	for {
  1349  		x := v_0
  1350  		y := v_1
  1351  		v.reset(OpLOONG64DIVV)
  1352  		v0 := b.NewValue0(v.Pos, OpSignExt32to64, typ.Int64)
  1353  		v0.AddArg(x)
  1354  		v1 := b.NewValue0(v.Pos, OpSignExt32to64, typ.Int64)
  1355  		v1.AddArg(y)
  1356  		v.AddArg2(v0, v1)
  1357  		return true
  1358  	}
  1359  }
  1360  func rewriteValueLOONG64_OpDiv32u(v *Value) bool {
  1361  	v_1 := v.Args[1]
  1362  	v_0 := v.Args[0]
  1363  	b := v.Block
  1364  	typ := &b.Func.Config.Types
  1365  	// match: (Div32u x y)
  1366  	// result: (DIVVU (ZeroExt32to64 x) (ZeroExt32to64 y))
  1367  	for {
  1368  		x := v_0
  1369  		y := v_1
  1370  		v.reset(OpLOONG64DIVVU)
  1371  		v0 := b.NewValue0(v.Pos, OpZeroExt32to64, typ.UInt64)
  1372  		v0.AddArg(x)
  1373  		v1 := b.NewValue0(v.Pos, OpZeroExt32to64, typ.UInt64)
  1374  		v1.AddArg(y)
  1375  		v.AddArg2(v0, v1)
  1376  		return true
  1377  	}
  1378  }
  1379  func rewriteValueLOONG64_OpDiv64(v *Value) bool {
  1380  	v_1 := v.Args[1]
  1381  	v_0 := v.Args[0]
  1382  	// match: (Div64 x y)
  1383  	// result: (DIVV x y)
  1384  	for {
  1385  		x := v_0
  1386  		y := v_1
  1387  		v.reset(OpLOONG64DIVV)
  1388  		v.AddArg2(x, y)
  1389  		return true
  1390  	}
  1391  }
  1392  func rewriteValueLOONG64_OpDiv8(v *Value) bool {
  1393  	v_1 := v.Args[1]
  1394  	v_0 := v.Args[0]
  1395  	b := v.Block
  1396  	typ := &b.Func.Config.Types
  1397  	// match: (Div8 x y)
  1398  	// result: (DIVV (SignExt8to64 x) (SignExt8to64 y))
  1399  	for {
  1400  		x := v_0
  1401  		y := v_1
  1402  		v.reset(OpLOONG64DIVV)
  1403  		v0 := b.NewValue0(v.Pos, OpSignExt8to64, typ.Int64)
  1404  		v0.AddArg(x)
  1405  		v1 := b.NewValue0(v.Pos, OpSignExt8to64, typ.Int64)
  1406  		v1.AddArg(y)
  1407  		v.AddArg2(v0, v1)
  1408  		return true
  1409  	}
  1410  }
  1411  func rewriteValueLOONG64_OpDiv8u(v *Value) bool {
  1412  	v_1 := v.Args[1]
  1413  	v_0 := v.Args[0]
  1414  	b := v.Block
  1415  	typ := &b.Func.Config.Types
  1416  	// match: (Div8u x y)
  1417  	// result: (DIVVU (ZeroExt8to64 x) (ZeroExt8to64 y))
  1418  	for {
  1419  		x := v_0
  1420  		y := v_1
  1421  		v.reset(OpLOONG64DIVVU)
  1422  		v0 := b.NewValue0(v.Pos, OpZeroExt8to64, typ.UInt64)
  1423  		v0.AddArg(x)
  1424  		v1 := b.NewValue0(v.Pos, OpZeroExt8to64, typ.UInt64)
  1425  		v1.AddArg(y)
  1426  		v.AddArg2(v0, v1)
  1427  		return true
  1428  	}
  1429  }
  1430  func rewriteValueLOONG64_OpEq16(v *Value) bool {
  1431  	v_1 := v.Args[1]
  1432  	v_0 := v.Args[0]
  1433  	b := v.Block
  1434  	typ := &b.Func.Config.Types
  1435  	// match: (Eq16 x y)
  1436  	// result: (SGTU (MOVVconst [1]) (XOR (ZeroExt16to64 x) (ZeroExt16to64 y)))
  1437  	for {
  1438  		x := v_0
  1439  		y := v_1
  1440  		v.reset(OpLOONG64SGTU)
  1441  		v0 := b.NewValue0(v.Pos, OpLOONG64MOVVconst, typ.UInt64)
  1442  		v0.AuxInt = int64ToAuxInt(1)
  1443  		v1 := b.NewValue0(v.Pos, OpLOONG64XOR, typ.UInt64)
  1444  		v2 := b.NewValue0(v.Pos, OpZeroExt16to64, typ.UInt64)
  1445  		v2.AddArg(x)
  1446  		v3 := b.NewValue0(v.Pos, OpZeroExt16to64, typ.UInt64)
  1447  		v3.AddArg(y)
  1448  		v1.AddArg2(v2, v3)
  1449  		v.AddArg2(v0, v1)
  1450  		return true
  1451  	}
  1452  }
  1453  func rewriteValueLOONG64_OpEq32(v *Value) bool {
  1454  	v_1 := v.Args[1]
  1455  	v_0 := v.Args[0]
  1456  	b := v.Block
  1457  	typ := &b.Func.Config.Types
  1458  	// match: (Eq32 x y)
  1459  	// result: (SGTU (MOVVconst [1]) (XOR (ZeroExt32to64 x) (ZeroExt32to64 y)))
  1460  	for {
  1461  		x := v_0
  1462  		y := v_1
  1463  		v.reset(OpLOONG64SGTU)
  1464  		v0 := b.NewValue0(v.Pos, OpLOONG64MOVVconst, typ.UInt64)
  1465  		v0.AuxInt = int64ToAuxInt(1)
  1466  		v1 := b.NewValue0(v.Pos, OpLOONG64XOR, typ.UInt64)
  1467  		v2 := b.NewValue0(v.Pos, OpZeroExt32to64, typ.UInt64)
  1468  		v2.AddArg(x)
  1469  		v3 := b.NewValue0(v.Pos, OpZeroExt32to64, typ.UInt64)
  1470  		v3.AddArg(y)
  1471  		v1.AddArg2(v2, v3)
  1472  		v.AddArg2(v0, v1)
  1473  		return true
  1474  	}
  1475  }
  1476  func rewriteValueLOONG64_OpEq32F(v *Value) bool {
  1477  	v_1 := v.Args[1]
  1478  	v_0 := v.Args[0]
  1479  	b := v.Block
  1480  	// match: (Eq32F x y)
  1481  	// result: (FPFlagTrue (CMPEQF x y))
  1482  	for {
  1483  		x := v_0
  1484  		y := v_1
  1485  		v.reset(OpLOONG64FPFlagTrue)
  1486  		v0 := b.NewValue0(v.Pos, OpLOONG64CMPEQF, types.TypeFlags)
  1487  		v0.AddArg2(x, y)
  1488  		v.AddArg(v0)
  1489  		return true
  1490  	}
  1491  }
  1492  func rewriteValueLOONG64_OpEq64(v *Value) bool {
  1493  	v_1 := v.Args[1]
  1494  	v_0 := v.Args[0]
  1495  	b := v.Block
  1496  	typ := &b.Func.Config.Types
  1497  	// match: (Eq64 x y)
  1498  	// result: (SGTU (MOVVconst [1]) (XOR x y))
  1499  	for {
  1500  		x := v_0
  1501  		y := v_1
  1502  		v.reset(OpLOONG64SGTU)
  1503  		v0 := b.NewValue0(v.Pos, OpLOONG64MOVVconst, typ.UInt64)
  1504  		v0.AuxInt = int64ToAuxInt(1)
  1505  		v1 := b.NewValue0(v.Pos, OpLOONG64XOR, typ.UInt64)
  1506  		v1.AddArg2(x, y)
  1507  		v.AddArg2(v0, v1)
  1508  		return true
  1509  	}
  1510  }
  1511  func rewriteValueLOONG64_OpEq64F(v *Value) bool {
  1512  	v_1 := v.Args[1]
  1513  	v_0 := v.Args[0]
  1514  	b := v.Block
  1515  	// match: (Eq64F x y)
  1516  	// result: (FPFlagTrue (CMPEQD x y))
  1517  	for {
  1518  		x := v_0
  1519  		y := v_1
  1520  		v.reset(OpLOONG64FPFlagTrue)
  1521  		v0 := b.NewValue0(v.Pos, OpLOONG64CMPEQD, types.TypeFlags)
  1522  		v0.AddArg2(x, y)
  1523  		v.AddArg(v0)
  1524  		return true
  1525  	}
  1526  }
  1527  func rewriteValueLOONG64_OpEq8(v *Value) bool {
  1528  	v_1 := v.Args[1]
  1529  	v_0 := v.Args[0]
  1530  	b := v.Block
  1531  	typ := &b.Func.Config.Types
  1532  	// match: (Eq8 x y)
  1533  	// result: (SGTU (MOVVconst [1]) (XOR (ZeroExt8to64 x) (ZeroExt8to64 y)))
  1534  	for {
  1535  		x := v_0
  1536  		y := v_1
  1537  		v.reset(OpLOONG64SGTU)
  1538  		v0 := b.NewValue0(v.Pos, OpLOONG64MOVVconst, typ.UInt64)
  1539  		v0.AuxInt = int64ToAuxInt(1)
  1540  		v1 := b.NewValue0(v.Pos, OpLOONG64XOR, typ.UInt64)
  1541  		v2 := b.NewValue0(v.Pos, OpZeroExt8to64, typ.UInt64)
  1542  		v2.AddArg(x)
  1543  		v3 := b.NewValue0(v.Pos, OpZeroExt8to64, typ.UInt64)
  1544  		v3.AddArg(y)
  1545  		v1.AddArg2(v2, v3)
  1546  		v.AddArg2(v0, v1)
  1547  		return true
  1548  	}
  1549  }
  1550  func rewriteValueLOONG64_OpEqB(v *Value) bool {
  1551  	v_1 := v.Args[1]
  1552  	v_0 := v.Args[0]
  1553  	b := v.Block
  1554  	typ := &b.Func.Config.Types
  1555  	// match: (EqB x y)
  1556  	// result: (XOR (MOVVconst [1]) (XOR <typ.Bool> x y))
  1557  	for {
  1558  		x := v_0
  1559  		y := v_1
  1560  		v.reset(OpLOONG64XOR)
  1561  		v0 := b.NewValue0(v.Pos, OpLOONG64MOVVconst, typ.UInt64)
  1562  		v0.AuxInt = int64ToAuxInt(1)
  1563  		v1 := b.NewValue0(v.Pos, OpLOONG64XOR, typ.Bool)
  1564  		v1.AddArg2(x, y)
  1565  		v.AddArg2(v0, v1)
  1566  		return true
  1567  	}
  1568  }
  1569  func rewriteValueLOONG64_OpEqPtr(v *Value) bool {
  1570  	v_1 := v.Args[1]
  1571  	v_0 := v.Args[0]
  1572  	b := v.Block
  1573  	typ := &b.Func.Config.Types
  1574  	// match: (EqPtr x y)
  1575  	// result: (SGTU (MOVVconst [1]) (XOR x y))
  1576  	for {
  1577  		x := v_0
  1578  		y := v_1
  1579  		v.reset(OpLOONG64SGTU)
  1580  		v0 := b.NewValue0(v.Pos, OpLOONG64MOVVconst, typ.UInt64)
  1581  		v0.AuxInt = int64ToAuxInt(1)
  1582  		v1 := b.NewValue0(v.Pos, OpLOONG64XOR, typ.UInt64)
  1583  		v1.AddArg2(x, y)
  1584  		v.AddArg2(v0, v1)
  1585  		return true
  1586  	}
  1587  }
  1588  func rewriteValueLOONG64_OpIsInBounds(v *Value) bool {
  1589  	v_1 := v.Args[1]
  1590  	v_0 := v.Args[0]
  1591  	// match: (IsInBounds idx len)
  1592  	// result: (SGTU len idx)
  1593  	for {
  1594  		idx := v_0
  1595  		len := v_1
  1596  		v.reset(OpLOONG64SGTU)
  1597  		v.AddArg2(len, idx)
  1598  		return true
  1599  	}
  1600  }
  1601  func rewriteValueLOONG64_OpIsNonNil(v *Value) bool {
  1602  	v_0 := v.Args[0]
  1603  	b := v.Block
  1604  	typ := &b.Func.Config.Types
  1605  	// match: (IsNonNil ptr)
  1606  	// result: (SGTU ptr (MOVVconst [0]))
  1607  	for {
  1608  		ptr := v_0
  1609  		v.reset(OpLOONG64SGTU)
  1610  		v0 := b.NewValue0(v.Pos, OpLOONG64MOVVconst, typ.UInt64)
  1611  		v0.AuxInt = int64ToAuxInt(0)
  1612  		v.AddArg2(ptr, v0)
  1613  		return true
  1614  	}
  1615  }
  1616  func rewriteValueLOONG64_OpIsSliceInBounds(v *Value) bool {
  1617  	v_1 := v.Args[1]
  1618  	v_0 := v.Args[0]
  1619  	b := v.Block
  1620  	typ := &b.Func.Config.Types
  1621  	// match: (IsSliceInBounds idx len)
  1622  	// result: (XOR (MOVVconst [1]) (SGTU idx len))
  1623  	for {
  1624  		idx := v_0
  1625  		len := v_1
  1626  		v.reset(OpLOONG64XOR)
  1627  		v0 := b.NewValue0(v.Pos, OpLOONG64MOVVconst, typ.UInt64)
  1628  		v0.AuxInt = int64ToAuxInt(1)
  1629  		v1 := b.NewValue0(v.Pos, OpLOONG64SGTU, typ.Bool)
  1630  		v1.AddArg2(idx, len)
  1631  		v.AddArg2(v0, v1)
  1632  		return true
  1633  	}
  1634  }
  1635  func rewriteValueLOONG64_OpLOONG64ADDD(v *Value) bool {
  1636  	v_1 := v.Args[1]
  1637  	v_0 := v.Args[0]
  1638  	// match: (ADDD (MULD x y) z)
  1639  	// cond: z.Block.Func.useFMA(v)
  1640  	// result: (FMADDD x y z)
  1641  	for {
  1642  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
  1643  			if v_0.Op != OpLOONG64MULD {
  1644  				continue
  1645  			}
  1646  			y := v_0.Args[1]
  1647  			x := v_0.Args[0]
  1648  			z := v_1
  1649  			if !(z.Block.Func.useFMA(v)) {
  1650  				continue
  1651  			}
  1652  			v.reset(OpLOONG64FMADDD)
  1653  			v.AddArg3(x, y, z)
  1654  			return true
  1655  		}
  1656  		break
  1657  	}
  1658  	// match: (ADDD z (NEGD (MULD x y)))
  1659  	// cond: z.Block.Func.useFMA(v)
  1660  	// result: (FNMSUBD x y z)
  1661  	for {
  1662  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
  1663  			z := v_0
  1664  			if v_1.Op != OpLOONG64NEGD {
  1665  				continue
  1666  			}
  1667  			v_1_0 := v_1.Args[0]
  1668  			if v_1_0.Op != OpLOONG64MULD {
  1669  				continue
  1670  			}
  1671  			y := v_1_0.Args[1]
  1672  			x := v_1_0.Args[0]
  1673  			if !(z.Block.Func.useFMA(v)) {
  1674  				continue
  1675  			}
  1676  			v.reset(OpLOONG64FNMSUBD)
  1677  			v.AddArg3(x, y, z)
  1678  			return true
  1679  		}
  1680  		break
  1681  	}
  1682  	return false
  1683  }
  1684  func rewriteValueLOONG64_OpLOONG64ADDF(v *Value) bool {
  1685  	v_1 := v.Args[1]
  1686  	v_0 := v.Args[0]
  1687  	// match: (ADDF (MULF x y) z)
  1688  	// cond: z.Block.Func.useFMA(v)
  1689  	// result: (FMADDF x y z)
  1690  	for {
  1691  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
  1692  			if v_0.Op != OpLOONG64MULF {
  1693  				continue
  1694  			}
  1695  			y := v_0.Args[1]
  1696  			x := v_0.Args[0]
  1697  			z := v_1
  1698  			if !(z.Block.Func.useFMA(v)) {
  1699  				continue
  1700  			}
  1701  			v.reset(OpLOONG64FMADDF)
  1702  			v.AddArg3(x, y, z)
  1703  			return true
  1704  		}
  1705  		break
  1706  	}
  1707  	// match: (ADDF z (NEGF (MULF x y)))
  1708  	// cond: z.Block.Func.useFMA(v)
  1709  	// result: (FNMSUBF x y z)
  1710  	for {
  1711  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
  1712  			z := v_0
  1713  			if v_1.Op != OpLOONG64NEGF {
  1714  				continue
  1715  			}
  1716  			v_1_0 := v_1.Args[0]
  1717  			if v_1_0.Op != OpLOONG64MULF {
  1718  				continue
  1719  			}
  1720  			y := v_1_0.Args[1]
  1721  			x := v_1_0.Args[0]
  1722  			if !(z.Block.Func.useFMA(v)) {
  1723  				continue
  1724  			}
  1725  			v.reset(OpLOONG64FNMSUBF)
  1726  			v.AddArg3(x, y, z)
  1727  			return true
  1728  		}
  1729  		break
  1730  	}
  1731  	return false
  1732  }
  1733  func rewriteValueLOONG64_OpLOONG64ADDV(v *Value) bool {
  1734  	v_1 := v.Args[1]
  1735  	v_0 := v.Args[0]
  1736  	b := v.Block
  1737  	typ := &b.Func.Config.Types
  1738  	// match: (ADDV <typ.UInt16> (SRLVconst [8] <typ.UInt16> x) (SLLVconst [8] <typ.UInt16> x))
  1739  	// result: (REVB2H x)
  1740  	for {
  1741  		if v.Type != typ.UInt16 {
  1742  			break
  1743  		}
  1744  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
  1745  			if v_0.Op != OpLOONG64SRLVconst || v_0.Type != typ.UInt16 || auxIntToInt64(v_0.AuxInt) != 8 {
  1746  				continue
  1747  			}
  1748  			x := v_0.Args[0]
  1749  			if v_1.Op != OpLOONG64SLLVconst || v_1.Type != typ.UInt16 || auxIntToInt64(v_1.AuxInt) != 8 || x != v_1.Args[0] {
  1750  				continue
  1751  			}
  1752  			v.reset(OpLOONG64REVB2H)
  1753  			v.AddArg(x)
  1754  			return true
  1755  		}
  1756  		break
  1757  	}
  1758  	// match: (ADDV (SRLconst [8] (ANDconst [c1] x)) (SLLconst [8] (ANDconst [c2] x)))
  1759  	// cond: uint32(c1) == 0xff00ff00 && uint32(c2) == 0x00ff00ff
  1760  	// result: (REVB2H x)
  1761  	for {
  1762  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
  1763  			if v_0.Op != OpLOONG64SRLconst || auxIntToInt64(v_0.AuxInt) != 8 {
  1764  				continue
  1765  			}
  1766  			v_0_0 := v_0.Args[0]
  1767  			if v_0_0.Op != OpLOONG64ANDconst {
  1768  				continue
  1769  			}
  1770  			c1 := auxIntToInt64(v_0_0.AuxInt)
  1771  			x := v_0_0.Args[0]
  1772  			if v_1.Op != OpLOONG64SLLconst || auxIntToInt64(v_1.AuxInt) != 8 {
  1773  				continue
  1774  			}
  1775  			v_1_0 := v_1.Args[0]
  1776  			if v_1_0.Op != OpLOONG64ANDconst {
  1777  				continue
  1778  			}
  1779  			c2 := auxIntToInt64(v_1_0.AuxInt)
  1780  			if x != v_1_0.Args[0] || !(uint32(c1) == 0xff00ff00 && uint32(c2) == 0x00ff00ff) {
  1781  				continue
  1782  			}
  1783  			v.reset(OpLOONG64REVB2H)
  1784  			v.AddArg(x)
  1785  			return true
  1786  		}
  1787  		break
  1788  	}
  1789  	// match: (ADDV (SRLVconst [8] (AND (MOVVconst [c1]) x)) (SLLVconst [8] (AND (MOVVconst [c2]) x)))
  1790  	// cond: uint64(c1) == 0xff00ff00ff00ff00 && uint64(c2) == 0x00ff00ff00ff00ff
  1791  	// result: (REVB4H x)
  1792  	for {
  1793  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
  1794  			if v_0.Op != OpLOONG64SRLVconst || auxIntToInt64(v_0.AuxInt) != 8 {
  1795  				continue
  1796  			}
  1797  			v_0_0 := v_0.Args[0]
  1798  			if v_0_0.Op != OpLOONG64AND {
  1799  				continue
  1800  			}
  1801  			_ = v_0_0.Args[1]
  1802  			v_0_0_0 := v_0_0.Args[0]
  1803  			v_0_0_1 := v_0_0.Args[1]
  1804  			for _i1 := 0; _i1 <= 1; _i1, v_0_0_0, v_0_0_1 = _i1+1, v_0_0_1, v_0_0_0 {
  1805  				if v_0_0_0.Op != OpLOONG64MOVVconst {
  1806  					continue
  1807  				}
  1808  				c1 := auxIntToInt64(v_0_0_0.AuxInt)
  1809  				x := v_0_0_1
  1810  				if v_1.Op != OpLOONG64SLLVconst || auxIntToInt64(v_1.AuxInt) != 8 {
  1811  					continue
  1812  				}
  1813  				v_1_0 := v_1.Args[0]
  1814  				if v_1_0.Op != OpLOONG64AND {
  1815  					continue
  1816  				}
  1817  				_ = v_1_0.Args[1]
  1818  				v_1_0_0 := v_1_0.Args[0]
  1819  				v_1_0_1 := v_1_0.Args[1]
  1820  				for _i2 := 0; _i2 <= 1; _i2, v_1_0_0, v_1_0_1 = _i2+1, v_1_0_1, v_1_0_0 {
  1821  					if v_1_0_0.Op != OpLOONG64MOVVconst {
  1822  						continue
  1823  					}
  1824  					c2 := auxIntToInt64(v_1_0_0.AuxInt)
  1825  					if x != v_1_0_1 || !(uint64(c1) == 0xff00ff00ff00ff00 && uint64(c2) == 0x00ff00ff00ff00ff) {
  1826  						continue
  1827  					}
  1828  					v.reset(OpLOONG64REVB4H)
  1829  					v.AddArg(x)
  1830  					return true
  1831  				}
  1832  			}
  1833  		}
  1834  		break
  1835  	}
  1836  	// match: (ADDV (SRLVconst [8] (AND (MOVVconst [c1]) x)) (SLLVconst [8] (ANDconst [c2] x)))
  1837  	// cond: uint64(c1) == 0xff00ff00 && uint64(c2) == 0x00ff00ff
  1838  	// result: (REVB4H (ANDconst <x.Type> [0xffffffff] x))
  1839  	for {
  1840  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
  1841  			if v_0.Op != OpLOONG64SRLVconst || auxIntToInt64(v_0.AuxInt) != 8 {
  1842  				continue
  1843  			}
  1844  			v_0_0 := v_0.Args[0]
  1845  			if v_0_0.Op != OpLOONG64AND {
  1846  				continue
  1847  			}
  1848  			_ = v_0_0.Args[1]
  1849  			v_0_0_0 := v_0_0.Args[0]
  1850  			v_0_0_1 := v_0_0.Args[1]
  1851  			for _i1 := 0; _i1 <= 1; _i1, v_0_0_0, v_0_0_1 = _i1+1, v_0_0_1, v_0_0_0 {
  1852  				if v_0_0_0.Op != OpLOONG64MOVVconst {
  1853  					continue
  1854  				}
  1855  				c1 := auxIntToInt64(v_0_0_0.AuxInt)
  1856  				x := v_0_0_1
  1857  				if v_1.Op != OpLOONG64SLLVconst || auxIntToInt64(v_1.AuxInt) != 8 {
  1858  					continue
  1859  				}
  1860  				v_1_0 := v_1.Args[0]
  1861  				if v_1_0.Op != OpLOONG64ANDconst {
  1862  					continue
  1863  				}
  1864  				c2 := auxIntToInt64(v_1_0.AuxInt)
  1865  				if x != v_1_0.Args[0] || !(uint64(c1) == 0xff00ff00 && uint64(c2) == 0x00ff00ff) {
  1866  					continue
  1867  				}
  1868  				v.reset(OpLOONG64REVB4H)
  1869  				v0 := b.NewValue0(v.Pos, OpLOONG64ANDconst, x.Type)
  1870  				v0.AuxInt = int64ToAuxInt(0xffffffff)
  1871  				v0.AddArg(x)
  1872  				v.AddArg(v0)
  1873  				return true
  1874  			}
  1875  		}
  1876  		break
  1877  	}
  1878  	// match: (ADDV x (MOVVconst <t> [c]))
  1879  	// cond: is32Bit(c) && !t.IsPtr()
  1880  	// result: (ADDVconst [c] x)
  1881  	for {
  1882  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
  1883  			x := v_0
  1884  			if v_1.Op != OpLOONG64MOVVconst {
  1885  				continue
  1886  			}
  1887  			t := v_1.Type
  1888  			c := auxIntToInt64(v_1.AuxInt)
  1889  			if !(is32Bit(c) && !t.IsPtr()) {
  1890  				continue
  1891  			}
  1892  			v.reset(OpLOONG64ADDVconst)
  1893  			v.AuxInt = int64ToAuxInt(c)
  1894  			v.AddArg(x)
  1895  			return true
  1896  		}
  1897  		break
  1898  	}
  1899  	// match: (ADDV x0 x1:(SLLVconst [c] y))
  1900  	// cond: x1.Uses == 1 && c > 0 && c <= 4
  1901  	// result: (ADDshiftLLV x0 y [c])
  1902  	for {
  1903  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
  1904  			x0 := v_0
  1905  			x1 := v_1
  1906  			if x1.Op != OpLOONG64SLLVconst {
  1907  				continue
  1908  			}
  1909  			c := auxIntToInt64(x1.AuxInt)
  1910  			y := x1.Args[0]
  1911  			if !(x1.Uses == 1 && c > 0 && c <= 4) {
  1912  				continue
  1913  			}
  1914  			v.reset(OpLOONG64ADDshiftLLV)
  1915  			v.AuxInt = int64ToAuxInt(c)
  1916  			v.AddArg2(x0, y)
  1917  			return true
  1918  		}
  1919  		break
  1920  	}
  1921  	// match: (ADDV x (NEGV y))
  1922  	// result: (SUBV x y)
  1923  	for {
  1924  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
  1925  			x := v_0
  1926  			if v_1.Op != OpLOONG64NEGV {
  1927  				continue
  1928  			}
  1929  			y := v_1.Args[0]
  1930  			v.reset(OpLOONG64SUBV)
  1931  			v.AddArg2(x, y)
  1932  			return true
  1933  		}
  1934  		break
  1935  	}
  1936  	return false
  1937  }
  1938  func rewriteValueLOONG64_OpLOONG64ADDVconst(v *Value) bool {
  1939  	v_0 := v.Args[0]
  1940  	// match: (ADDVconst [off1] (MOVVaddr [off2] {sym} ptr))
  1941  	// cond: is32Bit(off1+int64(off2))
  1942  	// result: (MOVVaddr [int32(off1)+int32(off2)] {sym} ptr)
  1943  	for {
  1944  		off1 := auxIntToInt64(v.AuxInt)
  1945  		if v_0.Op != OpLOONG64MOVVaddr {
  1946  			break
  1947  		}
  1948  		off2 := auxIntToInt32(v_0.AuxInt)
  1949  		sym := auxToSym(v_0.Aux)
  1950  		ptr := v_0.Args[0]
  1951  		if !(is32Bit(off1 + int64(off2))) {
  1952  			break
  1953  		}
  1954  		v.reset(OpLOONG64MOVVaddr)
  1955  		v.AuxInt = int32ToAuxInt(int32(off1) + int32(off2))
  1956  		v.Aux = symToAux(sym)
  1957  		v.AddArg(ptr)
  1958  		return true
  1959  	}
  1960  	// match: (ADDVconst [0] x)
  1961  	// result: x
  1962  	for {
  1963  		if auxIntToInt64(v.AuxInt) != 0 {
  1964  			break
  1965  		}
  1966  		x := v_0
  1967  		v.copyOf(x)
  1968  		return true
  1969  	}
  1970  	// match: (ADDVconst [c] (MOVVconst [d]))
  1971  	// result: (MOVVconst [c+d])
  1972  	for {
  1973  		c := auxIntToInt64(v.AuxInt)
  1974  		if v_0.Op != OpLOONG64MOVVconst {
  1975  			break
  1976  		}
  1977  		d := auxIntToInt64(v_0.AuxInt)
  1978  		v.reset(OpLOONG64MOVVconst)
  1979  		v.AuxInt = int64ToAuxInt(c + d)
  1980  		return true
  1981  	}
  1982  	// match: (ADDVconst [c] (ADDVconst [d] x))
  1983  	// cond: is32Bit(c+d)
  1984  	// result: (ADDVconst [c+d] x)
  1985  	for {
  1986  		c := auxIntToInt64(v.AuxInt)
  1987  		if v_0.Op != OpLOONG64ADDVconst {
  1988  			break
  1989  		}
  1990  		d := auxIntToInt64(v_0.AuxInt)
  1991  		x := v_0.Args[0]
  1992  		if !(is32Bit(c + d)) {
  1993  			break
  1994  		}
  1995  		v.reset(OpLOONG64ADDVconst)
  1996  		v.AuxInt = int64ToAuxInt(c + d)
  1997  		v.AddArg(x)
  1998  		return true
  1999  	}
  2000  	// match: (ADDVconst [c] (SUBVconst [d] x))
  2001  	// cond: is32Bit(c-d)
  2002  	// result: (ADDVconst [c-d] x)
  2003  	for {
  2004  		c := auxIntToInt64(v.AuxInt)
  2005  		if v_0.Op != OpLOONG64SUBVconst {
  2006  			break
  2007  		}
  2008  		d := auxIntToInt64(v_0.AuxInt)
  2009  		x := v_0.Args[0]
  2010  		if !(is32Bit(c - d)) {
  2011  			break
  2012  		}
  2013  		v.reset(OpLOONG64ADDVconst)
  2014  		v.AuxInt = int64ToAuxInt(c - d)
  2015  		v.AddArg(x)
  2016  		return true
  2017  	}
  2018  	// match: (ADDVconst [c] x)
  2019  	// cond: is32Bit(c) && c&0xffff == 0 && c != 0
  2020  	// result: (ADDV16const [c] x)
  2021  	for {
  2022  		c := auxIntToInt64(v.AuxInt)
  2023  		x := v_0
  2024  		if !(is32Bit(c) && c&0xffff == 0 && c != 0) {
  2025  			break
  2026  		}
  2027  		v.reset(OpLOONG64ADDV16const)
  2028  		v.AuxInt = int64ToAuxInt(c)
  2029  		v.AddArg(x)
  2030  		return true
  2031  	}
  2032  	return false
  2033  }
  2034  func rewriteValueLOONG64_OpLOONG64ADDshiftLLV(v *Value) bool {
  2035  	v_1 := v.Args[1]
  2036  	v_0 := v.Args[0]
  2037  	// match: (ADDshiftLLV x (MOVVconst [c]) [d])
  2038  	// cond: is12Bit(c<<d)
  2039  	// result: (ADDVconst x [c<<d])
  2040  	for {
  2041  		d := auxIntToInt64(v.AuxInt)
  2042  		x := v_0
  2043  		if v_1.Op != OpLOONG64MOVVconst {
  2044  			break
  2045  		}
  2046  		c := auxIntToInt64(v_1.AuxInt)
  2047  		if !(is12Bit(c << d)) {
  2048  			break
  2049  		}
  2050  		v.reset(OpLOONG64ADDVconst)
  2051  		v.AuxInt = int64ToAuxInt(c << d)
  2052  		v.AddArg(x)
  2053  		return true
  2054  	}
  2055  	return false
  2056  }
  2057  func rewriteValueLOONG64_OpLOONG64AND(v *Value) bool {
  2058  	v_1 := v.Args[1]
  2059  	v_0 := v.Args[0]
  2060  	// match: (AND x (MOVVconst [c]))
  2061  	// cond: is32Bit(c)
  2062  	// result: (ANDconst [c] x)
  2063  	for {
  2064  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
  2065  			x := v_0
  2066  			if v_1.Op != OpLOONG64MOVVconst {
  2067  				continue
  2068  			}
  2069  			c := auxIntToInt64(v_1.AuxInt)
  2070  			if !(is32Bit(c)) {
  2071  				continue
  2072  			}
  2073  			v.reset(OpLOONG64ANDconst)
  2074  			v.AuxInt = int64ToAuxInt(c)
  2075  			v.AddArg(x)
  2076  			return true
  2077  		}
  2078  		break
  2079  	}
  2080  	// match: (AND x x)
  2081  	// result: x
  2082  	for {
  2083  		x := v_0
  2084  		if x != v_1 {
  2085  			break
  2086  		}
  2087  		v.copyOf(x)
  2088  		return true
  2089  	}
  2090  	// match: (AND x (NORconst [0] y))
  2091  	// result: (ANDN x y)
  2092  	for {
  2093  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
  2094  			x := v_0
  2095  			if v_1.Op != OpLOONG64NORconst || auxIntToInt64(v_1.AuxInt) != 0 {
  2096  				continue
  2097  			}
  2098  			y := v_1.Args[0]
  2099  			v.reset(OpLOONG64ANDN)
  2100  			v.AddArg2(x, y)
  2101  			return true
  2102  		}
  2103  		break
  2104  	}
  2105  	return false
  2106  }
  2107  func rewriteValueLOONG64_OpLOONG64ANDconst(v *Value) bool {
  2108  	v_0 := v.Args[0]
  2109  	// match: (ANDconst [0] _)
  2110  	// result: (MOVVconst [0])
  2111  	for {
  2112  		if auxIntToInt64(v.AuxInt) != 0 {
  2113  			break
  2114  		}
  2115  		v.reset(OpLOONG64MOVVconst)
  2116  		v.AuxInt = int64ToAuxInt(0)
  2117  		return true
  2118  	}
  2119  	// match: (ANDconst [-1] x)
  2120  	// result: x
  2121  	for {
  2122  		if auxIntToInt64(v.AuxInt) != -1 {
  2123  			break
  2124  		}
  2125  		x := v_0
  2126  		v.copyOf(x)
  2127  		return true
  2128  	}
  2129  	// match: (ANDconst [c] (MOVVconst [d]))
  2130  	// result: (MOVVconst [c&d])
  2131  	for {
  2132  		c := auxIntToInt64(v.AuxInt)
  2133  		if v_0.Op != OpLOONG64MOVVconst {
  2134  			break
  2135  		}
  2136  		d := auxIntToInt64(v_0.AuxInt)
  2137  		v.reset(OpLOONG64MOVVconst)
  2138  		v.AuxInt = int64ToAuxInt(c & d)
  2139  		return true
  2140  	}
  2141  	// match: (ANDconst [c] (ANDconst [d] x))
  2142  	// result: (ANDconst [c&d] x)
  2143  	for {
  2144  		c := auxIntToInt64(v.AuxInt)
  2145  		if v_0.Op != OpLOONG64ANDconst {
  2146  			break
  2147  		}
  2148  		d := auxIntToInt64(v_0.AuxInt)
  2149  		x := v_0.Args[0]
  2150  		v.reset(OpLOONG64ANDconst)
  2151  		v.AuxInt = int64ToAuxInt(c & d)
  2152  		v.AddArg(x)
  2153  		return true
  2154  	}
  2155  	return false
  2156  }
  2157  func rewriteValueLOONG64_OpLOONG64DIVV(v *Value) bool {
  2158  	v_1 := v.Args[1]
  2159  	v_0 := v.Args[0]
  2160  	// match: (DIVV (MOVVconst [c]) (MOVVconst [d]))
  2161  	// cond: d != 0
  2162  	// result: (MOVVconst [c/d])
  2163  	for {
  2164  		if v_0.Op != OpLOONG64MOVVconst {
  2165  			break
  2166  		}
  2167  		c := auxIntToInt64(v_0.AuxInt)
  2168  		if v_1.Op != OpLOONG64MOVVconst {
  2169  			break
  2170  		}
  2171  		d := auxIntToInt64(v_1.AuxInt)
  2172  		if !(d != 0) {
  2173  			break
  2174  		}
  2175  		v.reset(OpLOONG64MOVVconst)
  2176  		v.AuxInt = int64ToAuxInt(c / d)
  2177  		return true
  2178  	}
  2179  	return false
  2180  }
  2181  func rewriteValueLOONG64_OpLOONG64DIVVU(v *Value) bool {
  2182  	v_1 := v.Args[1]
  2183  	v_0 := v.Args[0]
  2184  	// match: (DIVVU x (MOVVconst [1]))
  2185  	// result: x
  2186  	for {
  2187  		x := v_0
  2188  		if v_1.Op != OpLOONG64MOVVconst || auxIntToInt64(v_1.AuxInt) != 1 {
  2189  			break
  2190  		}
  2191  		v.copyOf(x)
  2192  		return true
  2193  	}
  2194  	// match: (DIVVU x (MOVVconst [c]))
  2195  	// cond: isPowerOfTwo(c)
  2196  	// result: (SRLVconst [log64(c)] x)
  2197  	for {
  2198  		x := v_0
  2199  		if v_1.Op != OpLOONG64MOVVconst {
  2200  			break
  2201  		}
  2202  		c := auxIntToInt64(v_1.AuxInt)
  2203  		if !(isPowerOfTwo(c)) {
  2204  			break
  2205  		}
  2206  		v.reset(OpLOONG64SRLVconst)
  2207  		v.AuxInt = int64ToAuxInt(log64(c))
  2208  		v.AddArg(x)
  2209  		return true
  2210  	}
  2211  	// match: (DIVVU (MOVVconst [c]) (MOVVconst [d]))
  2212  	// cond: d != 0
  2213  	// result: (MOVVconst [int64(uint64(c)/uint64(d))])
  2214  	for {
  2215  		if v_0.Op != OpLOONG64MOVVconst {
  2216  			break
  2217  		}
  2218  		c := auxIntToInt64(v_0.AuxInt)
  2219  		if v_1.Op != OpLOONG64MOVVconst {
  2220  			break
  2221  		}
  2222  		d := auxIntToInt64(v_1.AuxInt)
  2223  		if !(d != 0) {
  2224  			break
  2225  		}
  2226  		v.reset(OpLOONG64MOVVconst)
  2227  		v.AuxInt = int64ToAuxInt(int64(uint64(c) / uint64(d)))
  2228  		return true
  2229  	}
  2230  	return false
  2231  }
  2232  func rewriteValueLOONG64_OpLOONG64LoweredPanicBoundsCR(v *Value) bool {
  2233  	v_1 := v.Args[1]
  2234  	v_0 := v.Args[0]
  2235  	// match: (LoweredPanicBoundsCR [kind] {p} (MOVVconst [c]) mem)
  2236  	// result: (LoweredPanicBoundsCC [kind] {PanicBoundsCC{Cx:p.C, Cy:c}} mem)
  2237  	for {
  2238  		kind := auxIntToInt64(v.AuxInt)
  2239  		p := auxToPanicBoundsC(v.Aux)
  2240  		if v_0.Op != OpLOONG64MOVVconst {
  2241  			break
  2242  		}
  2243  		c := auxIntToInt64(v_0.AuxInt)
  2244  		mem := v_1
  2245  		v.reset(OpLOONG64LoweredPanicBoundsCC)
  2246  		v.AuxInt = int64ToAuxInt(kind)
  2247  		v.Aux = panicBoundsCCToAux(PanicBoundsCC{Cx: p.C, Cy: c})
  2248  		v.AddArg(mem)
  2249  		return true
  2250  	}
  2251  	return false
  2252  }
  2253  func rewriteValueLOONG64_OpLOONG64LoweredPanicBoundsRC(v *Value) bool {
  2254  	v_1 := v.Args[1]
  2255  	v_0 := v.Args[0]
  2256  	// match: (LoweredPanicBoundsRC [kind] {p} (MOVVconst [c]) mem)
  2257  	// result: (LoweredPanicBoundsCC [kind] {PanicBoundsCC{Cx:c, Cy:p.C}} mem)
  2258  	for {
  2259  		kind := auxIntToInt64(v.AuxInt)
  2260  		p := auxToPanicBoundsC(v.Aux)
  2261  		if v_0.Op != OpLOONG64MOVVconst {
  2262  			break
  2263  		}
  2264  		c := auxIntToInt64(v_0.AuxInt)
  2265  		mem := v_1
  2266  		v.reset(OpLOONG64LoweredPanicBoundsCC)
  2267  		v.AuxInt = int64ToAuxInt(kind)
  2268  		v.Aux = panicBoundsCCToAux(PanicBoundsCC{Cx: c, Cy: p.C})
  2269  		v.AddArg(mem)
  2270  		return true
  2271  	}
  2272  	return false
  2273  }
  2274  func rewriteValueLOONG64_OpLOONG64LoweredPanicBoundsRR(v *Value) bool {
  2275  	v_2 := v.Args[2]
  2276  	v_1 := v.Args[1]
  2277  	v_0 := v.Args[0]
  2278  	// match: (LoweredPanicBoundsRR [kind] x (MOVVconst [c]) mem)
  2279  	// result: (LoweredPanicBoundsRC [kind] x {PanicBoundsC{C:c}} mem)
  2280  	for {
  2281  		kind := auxIntToInt64(v.AuxInt)
  2282  		x := v_0
  2283  		if v_1.Op != OpLOONG64MOVVconst {
  2284  			break
  2285  		}
  2286  		c := auxIntToInt64(v_1.AuxInt)
  2287  		mem := v_2
  2288  		v.reset(OpLOONG64LoweredPanicBoundsRC)
  2289  		v.AuxInt = int64ToAuxInt(kind)
  2290  		v.Aux = panicBoundsCToAux(PanicBoundsC{C: c})
  2291  		v.AddArg2(x, mem)
  2292  		return true
  2293  	}
  2294  	// match: (LoweredPanicBoundsRR [kind] (MOVVconst [c]) y mem)
  2295  	// result: (LoweredPanicBoundsCR [kind] {PanicBoundsC{C:c}} y mem)
  2296  	for {
  2297  		kind := auxIntToInt64(v.AuxInt)
  2298  		if v_0.Op != OpLOONG64MOVVconst {
  2299  			break
  2300  		}
  2301  		c := auxIntToInt64(v_0.AuxInt)
  2302  		y := v_1
  2303  		mem := v_2
  2304  		v.reset(OpLOONG64LoweredPanicBoundsCR)
  2305  		v.AuxInt = int64ToAuxInt(kind)
  2306  		v.Aux = panicBoundsCToAux(PanicBoundsC{C: c})
  2307  		v.AddArg2(y, mem)
  2308  		return true
  2309  	}
  2310  	return false
  2311  }
  2312  func rewriteValueLOONG64_OpLOONG64MASKEQZ(v *Value) bool {
  2313  	v_1 := v.Args[1]
  2314  	v_0 := v.Args[0]
  2315  	// match: (MASKEQZ (MOVVconst [0]) cond)
  2316  	// result: (MOVVconst [0])
  2317  	for {
  2318  		if v_0.Op != OpLOONG64MOVVconst || auxIntToInt64(v_0.AuxInt) != 0 {
  2319  			break
  2320  		}
  2321  		v.reset(OpLOONG64MOVVconst)
  2322  		v.AuxInt = int64ToAuxInt(0)
  2323  		return true
  2324  	}
  2325  	// match: (MASKEQZ x (MOVVconst [c]))
  2326  	// cond: c == 0
  2327  	// result: (MOVVconst [0])
  2328  	for {
  2329  		if v_1.Op != OpLOONG64MOVVconst {
  2330  			break
  2331  		}
  2332  		c := auxIntToInt64(v_1.AuxInt)
  2333  		if !(c == 0) {
  2334  			break
  2335  		}
  2336  		v.reset(OpLOONG64MOVVconst)
  2337  		v.AuxInt = int64ToAuxInt(0)
  2338  		return true
  2339  	}
  2340  	// match: (MASKEQZ x (MOVVconst [c]))
  2341  	// cond: c != 0
  2342  	// result: x
  2343  	for {
  2344  		x := v_0
  2345  		if v_1.Op != OpLOONG64MOVVconst {
  2346  			break
  2347  		}
  2348  		c := auxIntToInt64(v_1.AuxInt)
  2349  		if !(c != 0) {
  2350  			break
  2351  		}
  2352  		v.copyOf(x)
  2353  		return true
  2354  	}
  2355  	return false
  2356  }
  2357  func rewriteValueLOONG64_OpLOONG64MASKNEZ(v *Value) bool {
  2358  	v_0 := v.Args[0]
  2359  	// match: (MASKNEZ (MOVVconst [0]) cond)
  2360  	// result: (MOVVconst [0])
  2361  	for {
  2362  		if v_0.Op != OpLOONG64MOVVconst || auxIntToInt64(v_0.AuxInt) != 0 {
  2363  			break
  2364  		}
  2365  		v.reset(OpLOONG64MOVVconst)
  2366  		v.AuxInt = int64ToAuxInt(0)
  2367  		return true
  2368  	}
  2369  	return false
  2370  }
  2371  func rewriteValueLOONG64_OpLOONG64MOVBUload(v *Value) bool {
  2372  	v_1 := v.Args[1]
  2373  	v_0 := v.Args[0]
  2374  	b := v.Block
  2375  	config := b.Func.Config
  2376  	typ := &b.Func.Config.Types
  2377  	// match: (MOVBUload [off] {sym} ptr (MOVBstore [off] {sym} ptr x _))
  2378  	// result: (MOVBUreg x)
  2379  	for {
  2380  		off := auxIntToInt32(v.AuxInt)
  2381  		sym := auxToSym(v.Aux)
  2382  		ptr := v_0
  2383  		if v_1.Op != OpLOONG64MOVBstore || auxIntToInt32(v_1.AuxInt) != off || auxToSym(v_1.Aux) != sym {
  2384  			break
  2385  		}
  2386  		x := v_1.Args[1]
  2387  		if ptr != v_1.Args[0] {
  2388  			break
  2389  		}
  2390  		v.reset(OpLOONG64MOVBUreg)
  2391  		v.AddArg(x)
  2392  		return true
  2393  	}
  2394  	// match: (MOVBUload [off1] {sym} (ADDVconst [off2] ptr) mem)
  2395  	// cond: is32Bit(int64(off1)+off2) && (ptr.Op != OpSB || !config.ctxt.Flag_dynlink)
  2396  	// result: (MOVBUload [off1+int32(off2)] {sym} ptr mem)
  2397  	for {
  2398  		off1 := auxIntToInt32(v.AuxInt)
  2399  		sym := auxToSym(v.Aux)
  2400  		if v_0.Op != OpLOONG64ADDVconst {
  2401  			break
  2402  		}
  2403  		off2 := auxIntToInt64(v_0.AuxInt)
  2404  		ptr := v_0.Args[0]
  2405  		mem := v_1
  2406  		if !(is32Bit(int64(off1)+off2) && (ptr.Op != OpSB || !config.ctxt.Flag_dynlink)) {
  2407  			break
  2408  		}
  2409  		v.reset(OpLOONG64MOVBUload)
  2410  		v.AuxInt = int32ToAuxInt(off1 + int32(off2))
  2411  		v.Aux = symToAux(sym)
  2412  		v.AddArg2(ptr, mem)
  2413  		return true
  2414  	}
  2415  	// match: (MOVBUload [off1] {sym1} (MOVVaddr [off2] {sym2} ptr) mem)
  2416  	// cond: canMergeSym(sym1,sym2) && is32Bit(int64(off1)+int64(off2)) && (ptr.Op != OpSB || !config.ctxt.Flag_dynlink)
  2417  	// result: (MOVBUload [off1+int32(off2)] {mergeSym(sym1,sym2)} ptr mem)
  2418  	for {
  2419  		off1 := auxIntToInt32(v.AuxInt)
  2420  		sym1 := auxToSym(v.Aux)
  2421  		if v_0.Op != OpLOONG64MOVVaddr {
  2422  			break
  2423  		}
  2424  		off2 := auxIntToInt32(v_0.AuxInt)
  2425  		sym2 := auxToSym(v_0.Aux)
  2426  		ptr := v_0.Args[0]
  2427  		mem := v_1
  2428  		if !(canMergeSym(sym1, sym2) && is32Bit(int64(off1)+int64(off2)) && (ptr.Op != OpSB || !config.ctxt.Flag_dynlink)) {
  2429  			break
  2430  		}
  2431  		v.reset(OpLOONG64MOVBUload)
  2432  		v.AuxInt = int32ToAuxInt(off1 + int32(off2))
  2433  		v.Aux = symToAux(mergeSym(sym1, sym2))
  2434  		v.AddArg2(ptr, mem)
  2435  		return true
  2436  	}
  2437  	// match: (MOVBUload [off] {sym} (ADDV ptr idx) mem)
  2438  	// cond: off == 0 && sym == nil
  2439  	// result: (MOVBUloadidx ptr idx mem)
  2440  	for {
  2441  		off := auxIntToInt32(v.AuxInt)
  2442  		sym := auxToSym(v.Aux)
  2443  		if v_0.Op != OpLOONG64ADDV {
  2444  			break
  2445  		}
  2446  		idx := v_0.Args[1]
  2447  		ptr := v_0.Args[0]
  2448  		mem := v_1
  2449  		if !(off == 0 && sym == nil) {
  2450  			break
  2451  		}
  2452  		v.reset(OpLOONG64MOVBUloadidx)
  2453  		v.AddArg3(ptr, idx, mem)
  2454  		return true
  2455  	}
  2456  	// match: (MOVBUload [off] {sym} (ADDshiftLLV [shift] ptr idx) mem)
  2457  	// cond: off == 0 && sym == nil
  2458  	// result: (MOVBUloadidx ptr (SLLVconst <typ.Int64> [shift] idx) mem)
  2459  	for {
  2460  		off := auxIntToInt32(v.AuxInt)
  2461  		sym := auxToSym(v.Aux)
  2462  		if v_0.Op != OpLOONG64ADDshiftLLV {
  2463  			break
  2464  		}
  2465  		shift := auxIntToInt64(v_0.AuxInt)
  2466  		idx := v_0.Args[1]
  2467  		ptr := v_0.Args[0]
  2468  		mem := v_1
  2469  		if !(off == 0 && sym == nil) {
  2470  			break
  2471  		}
  2472  		v.reset(OpLOONG64MOVBUloadidx)
  2473  		v0 := b.NewValue0(v.Pos, OpLOONG64SLLVconst, typ.Int64)
  2474  		v0.AuxInt = int64ToAuxInt(shift)
  2475  		v0.AddArg(idx)
  2476  		v.AddArg3(ptr, v0, mem)
  2477  		return true
  2478  	}
  2479  	// match: (MOVBUload [off] {sym} (SB) _)
  2480  	// cond: symIsRO(sym)
  2481  	// result: (MOVVconst [int64(read8(sym, int64(off)))])
  2482  	for {
  2483  		off := auxIntToInt32(v.AuxInt)
  2484  		sym := auxToSym(v.Aux)
  2485  		if v_0.Op != OpSB || !(symIsRO(sym)) {
  2486  			break
  2487  		}
  2488  		v.reset(OpLOONG64MOVVconst)
  2489  		v.AuxInt = int64ToAuxInt(int64(read8(sym, int64(off))))
  2490  		return true
  2491  	}
  2492  	return false
  2493  }
  2494  func rewriteValueLOONG64_OpLOONG64MOVBUloadidx(v *Value) bool {
  2495  	v_2 := v.Args[2]
  2496  	v_1 := v.Args[1]
  2497  	v_0 := v.Args[0]
  2498  	// match: (MOVBUloadidx ptr (MOVVconst [c]) mem)
  2499  	// cond: is32Bit(c)
  2500  	// result: (MOVBUload [int32(c)] ptr mem)
  2501  	for {
  2502  		ptr := v_0
  2503  		if v_1.Op != OpLOONG64MOVVconst {
  2504  			break
  2505  		}
  2506  		c := auxIntToInt64(v_1.AuxInt)
  2507  		mem := v_2
  2508  		if !(is32Bit(c)) {
  2509  			break
  2510  		}
  2511  		v.reset(OpLOONG64MOVBUload)
  2512  		v.AuxInt = int32ToAuxInt(int32(c))
  2513  		v.AddArg2(ptr, mem)
  2514  		return true
  2515  	}
  2516  	// match: (MOVBUloadidx (MOVVconst [c]) ptr mem)
  2517  	// cond: is32Bit(c)
  2518  	// result: (MOVBUload [int32(c)] ptr mem)
  2519  	for {
  2520  		if v_0.Op != OpLOONG64MOVVconst {
  2521  			break
  2522  		}
  2523  		c := auxIntToInt64(v_0.AuxInt)
  2524  		ptr := v_1
  2525  		mem := v_2
  2526  		if !(is32Bit(c)) {
  2527  			break
  2528  		}
  2529  		v.reset(OpLOONG64MOVBUload)
  2530  		v.AuxInt = int32ToAuxInt(int32(c))
  2531  		v.AddArg2(ptr, mem)
  2532  		return true
  2533  	}
  2534  	return false
  2535  }
  2536  func rewriteValueLOONG64_OpLOONG64MOVBUreg(v *Value) bool {
  2537  	v_0 := v.Args[0]
  2538  	// match: (MOVBUreg (SRLVconst [rc] x))
  2539  	// cond: rc < 8
  2540  	// result: (BSTRPICKV [rc + (7+rc)<<6] x)
  2541  	for {
  2542  		if v_0.Op != OpLOONG64SRLVconst {
  2543  			break
  2544  		}
  2545  		rc := auxIntToInt64(v_0.AuxInt)
  2546  		x := v_0.Args[0]
  2547  		if !(rc < 8) {
  2548  			break
  2549  		}
  2550  		v.reset(OpLOONG64BSTRPICKV)
  2551  		v.AuxInt = int64ToAuxInt(rc + (7+rc)<<6)
  2552  		v.AddArg(x)
  2553  		return true
  2554  	}
  2555  	// match: (MOVBUreg x:(SGT _ _))
  2556  	// result: x
  2557  	for {
  2558  		x := v_0
  2559  		if x.Op != OpLOONG64SGT {
  2560  			break
  2561  		}
  2562  		v.copyOf(x)
  2563  		return true
  2564  	}
  2565  	// match: (MOVBUreg x:(SGTU _ _))
  2566  	// result: x
  2567  	for {
  2568  		x := v_0
  2569  		if x.Op != OpLOONG64SGTU {
  2570  			break
  2571  		}
  2572  		v.copyOf(x)
  2573  		return true
  2574  	}
  2575  	// match: (MOVBUreg x:(XOR (MOVVconst [1]) (SGT _ _)))
  2576  	// result: x
  2577  	for {
  2578  		x := v_0
  2579  		if x.Op != OpLOONG64XOR {
  2580  			break
  2581  		}
  2582  		_ = x.Args[1]
  2583  		x_0 := x.Args[0]
  2584  		x_1 := x.Args[1]
  2585  		for _i0 := 0; _i0 <= 1; _i0, x_0, x_1 = _i0+1, x_1, x_0 {
  2586  			if x_0.Op != OpLOONG64MOVVconst || auxIntToInt64(x_0.AuxInt) != 1 || x_1.Op != OpLOONG64SGT {
  2587  				continue
  2588  			}
  2589  			v.copyOf(x)
  2590  			return true
  2591  		}
  2592  		break
  2593  	}
  2594  	// match: (MOVBUreg x:(XOR (MOVVconst [1]) (SGTU _ _)))
  2595  	// result: x
  2596  	for {
  2597  		x := v_0
  2598  		if x.Op != OpLOONG64XOR {
  2599  			break
  2600  		}
  2601  		_ = x.Args[1]
  2602  		x_0 := x.Args[0]
  2603  		x_1 := x.Args[1]
  2604  		for _i0 := 0; _i0 <= 1; _i0, x_0, x_1 = _i0+1, x_1, x_0 {
  2605  			if x_0.Op != OpLOONG64MOVVconst || auxIntToInt64(x_0.AuxInt) != 1 || x_1.Op != OpLOONG64SGTU {
  2606  				continue
  2607  			}
  2608  			v.copyOf(x)
  2609  			return true
  2610  		}
  2611  		break
  2612  	}
  2613  	// match: (MOVBUreg x:(MOVBUload _ _))
  2614  	// result: (MOVVreg x)
  2615  	for {
  2616  		x := v_0
  2617  		if x.Op != OpLOONG64MOVBUload {
  2618  			break
  2619  		}
  2620  		v.reset(OpLOONG64MOVVreg)
  2621  		v.AddArg(x)
  2622  		return true
  2623  	}
  2624  	// match: (MOVBUreg x:(MOVBUloadidx _ _ _))
  2625  	// result: (MOVVreg x)
  2626  	for {
  2627  		x := v_0
  2628  		if x.Op != OpLOONG64MOVBUloadidx {
  2629  			break
  2630  		}
  2631  		v.reset(OpLOONG64MOVVreg)
  2632  		v.AddArg(x)
  2633  		return true
  2634  	}
  2635  	// match: (MOVBUreg x:(MOVBUreg _))
  2636  	// result: (MOVVreg x)
  2637  	for {
  2638  		x := v_0
  2639  		if x.Op != OpLOONG64MOVBUreg {
  2640  			break
  2641  		}
  2642  		v.reset(OpLOONG64MOVVreg)
  2643  		v.AddArg(x)
  2644  		return true
  2645  	}
  2646  	// match: (MOVBUreg (SLLVconst [lc] x))
  2647  	// cond: lc >= 8
  2648  	// result: (MOVVconst [0])
  2649  	for {
  2650  		if v_0.Op != OpLOONG64SLLVconst {
  2651  			break
  2652  		}
  2653  		lc := auxIntToInt64(v_0.AuxInt)
  2654  		if !(lc >= 8) {
  2655  			break
  2656  		}
  2657  		v.reset(OpLOONG64MOVVconst)
  2658  		v.AuxInt = int64ToAuxInt(0)
  2659  		return true
  2660  	}
  2661  	// match: (MOVBUreg (MOVVconst [c]))
  2662  	// result: (MOVVconst [int64(uint8(c))])
  2663  	for {
  2664  		if v_0.Op != OpLOONG64MOVVconst {
  2665  			break
  2666  		}
  2667  		c := auxIntToInt64(v_0.AuxInt)
  2668  		v.reset(OpLOONG64MOVVconst)
  2669  		v.AuxInt = int64ToAuxInt(int64(uint8(c)))
  2670  		return true
  2671  	}
  2672  	// match: (MOVBUreg (ANDconst [c] x))
  2673  	// result: (ANDconst [c&0xff] x)
  2674  	for {
  2675  		if v_0.Op != OpLOONG64ANDconst {
  2676  			break
  2677  		}
  2678  		c := auxIntToInt64(v_0.AuxInt)
  2679  		x := v_0.Args[0]
  2680  		v.reset(OpLOONG64ANDconst)
  2681  		v.AuxInt = int64ToAuxInt(c & 0xff)
  2682  		v.AddArg(x)
  2683  		return true
  2684  	}
  2685  	// match: (MOVBUreg x:(SRLconst [c] y))
  2686  	// cond: c >= 24
  2687  	// result: x
  2688  	for {
  2689  		x := v_0
  2690  		if x.Op != OpLOONG64SRLconst {
  2691  			break
  2692  		}
  2693  		c := auxIntToInt64(x.AuxInt)
  2694  		if !(c >= 24) {
  2695  			break
  2696  		}
  2697  		v.copyOf(x)
  2698  		return true
  2699  	}
  2700  	// match: (MOVBUreg x:(ANDconst [c] y))
  2701  	// cond: c >= 0 && int64(uint8(c)) == c
  2702  	// result: x
  2703  	for {
  2704  		x := v_0
  2705  		if x.Op != OpLOONG64ANDconst {
  2706  			break
  2707  		}
  2708  		c := auxIntToInt64(x.AuxInt)
  2709  		if !(c >= 0 && int64(uint8(c)) == c) {
  2710  			break
  2711  		}
  2712  		v.copyOf(x)
  2713  		return true
  2714  	}
  2715  	return false
  2716  }
  2717  func rewriteValueLOONG64_OpLOONG64MOVBload(v *Value) bool {
  2718  	v_1 := v.Args[1]
  2719  	v_0 := v.Args[0]
  2720  	b := v.Block
  2721  	config := b.Func.Config
  2722  	typ := &b.Func.Config.Types
  2723  	// match: (MOVBload [off] {sym} ptr (MOVBstore [off] {sym} ptr x _))
  2724  	// result: (MOVBreg x)
  2725  	for {
  2726  		off := auxIntToInt32(v.AuxInt)
  2727  		sym := auxToSym(v.Aux)
  2728  		ptr := v_0
  2729  		if v_1.Op != OpLOONG64MOVBstore || auxIntToInt32(v_1.AuxInt) != off || auxToSym(v_1.Aux) != sym {
  2730  			break
  2731  		}
  2732  		x := v_1.Args[1]
  2733  		if ptr != v_1.Args[0] {
  2734  			break
  2735  		}
  2736  		v.reset(OpLOONG64MOVBreg)
  2737  		v.AddArg(x)
  2738  		return true
  2739  	}
  2740  	// match: (MOVBload [off1] {sym} (ADDVconst [off2] ptr) mem)
  2741  	// cond: is32Bit(int64(off1)+off2) && (ptr.Op != OpSB || !config.ctxt.Flag_dynlink)
  2742  	// result: (MOVBload [off1+int32(off2)] {sym} ptr mem)
  2743  	for {
  2744  		off1 := auxIntToInt32(v.AuxInt)
  2745  		sym := auxToSym(v.Aux)
  2746  		if v_0.Op != OpLOONG64ADDVconst {
  2747  			break
  2748  		}
  2749  		off2 := auxIntToInt64(v_0.AuxInt)
  2750  		ptr := v_0.Args[0]
  2751  		mem := v_1
  2752  		if !(is32Bit(int64(off1)+off2) && (ptr.Op != OpSB || !config.ctxt.Flag_dynlink)) {
  2753  			break
  2754  		}
  2755  		v.reset(OpLOONG64MOVBload)
  2756  		v.AuxInt = int32ToAuxInt(off1 + int32(off2))
  2757  		v.Aux = symToAux(sym)
  2758  		v.AddArg2(ptr, mem)
  2759  		return true
  2760  	}
  2761  	// match: (MOVBload [off1] {sym1} (MOVVaddr [off2] {sym2} ptr) mem)
  2762  	// cond: canMergeSym(sym1,sym2) && is32Bit(int64(off1)+int64(off2)) && (ptr.Op != OpSB || !config.ctxt.Flag_dynlink)
  2763  	// result: (MOVBload [off1+int32(off2)] {mergeSym(sym1,sym2)} ptr mem)
  2764  	for {
  2765  		off1 := auxIntToInt32(v.AuxInt)
  2766  		sym1 := auxToSym(v.Aux)
  2767  		if v_0.Op != OpLOONG64MOVVaddr {
  2768  			break
  2769  		}
  2770  		off2 := auxIntToInt32(v_0.AuxInt)
  2771  		sym2 := auxToSym(v_0.Aux)
  2772  		ptr := v_0.Args[0]
  2773  		mem := v_1
  2774  		if !(canMergeSym(sym1, sym2) && is32Bit(int64(off1)+int64(off2)) && (ptr.Op != OpSB || !config.ctxt.Flag_dynlink)) {
  2775  			break
  2776  		}
  2777  		v.reset(OpLOONG64MOVBload)
  2778  		v.AuxInt = int32ToAuxInt(off1 + int32(off2))
  2779  		v.Aux = symToAux(mergeSym(sym1, sym2))
  2780  		v.AddArg2(ptr, mem)
  2781  		return true
  2782  	}
  2783  	// match: (MOVBload [off] {sym} (ADDV ptr idx) mem)
  2784  	// cond: off == 0 && sym == nil
  2785  	// result: (MOVBloadidx ptr idx mem)
  2786  	for {
  2787  		off := auxIntToInt32(v.AuxInt)
  2788  		sym := auxToSym(v.Aux)
  2789  		if v_0.Op != OpLOONG64ADDV {
  2790  			break
  2791  		}
  2792  		idx := v_0.Args[1]
  2793  		ptr := v_0.Args[0]
  2794  		mem := v_1
  2795  		if !(off == 0 && sym == nil) {
  2796  			break
  2797  		}
  2798  		v.reset(OpLOONG64MOVBloadidx)
  2799  		v.AddArg3(ptr, idx, mem)
  2800  		return true
  2801  	}
  2802  	// match: (MOVBload [off] {sym} (ADDshiftLLV [shift] ptr idx) mem)
  2803  	// cond: off == 0 && sym == nil
  2804  	// result: (MOVBloadidx ptr (SLLVconst <typ.Int64> [shift] idx) mem)
  2805  	for {
  2806  		off := auxIntToInt32(v.AuxInt)
  2807  		sym := auxToSym(v.Aux)
  2808  		if v_0.Op != OpLOONG64ADDshiftLLV {
  2809  			break
  2810  		}
  2811  		shift := auxIntToInt64(v_0.AuxInt)
  2812  		idx := v_0.Args[1]
  2813  		ptr := v_0.Args[0]
  2814  		mem := v_1
  2815  		if !(off == 0 && sym == nil) {
  2816  			break
  2817  		}
  2818  		v.reset(OpLOONG64MOVBloadidx)
  2819  		v0 := b.NewValue0(v.Pos, OpLOONG64SLLVconst, typ.Int64)
  2820  		v0.AuxInt = int64ToAuxInt(shift)
  2821  		v0.AddArg(idx)
  2822  		v.AddArg3(ptr, v0, mem)
  2823  		return true
  2824  	}
  2825  	// match: (MOVBload [off] {sym} (SB) _)
  2826  	// cond: symIsRO(sym)
  2827  	// result: (MOVVconst [int64(int8(read8(sym, int64(off))))])
  2828  	for {
  2829  		off := auxIntToInt32(v.AuxInt)
  2830  		sym := auxToSym(v.Aux)
  2831  		if v_0.Op != OpSB || !(symIsRO(sym)) {
  2832  			break
  2833  		}
  2834  		v.reset(OpLOONG64MOVVconst)
  2835  		v.AuxInt = int64ToAuxInt(int64(int8(read8(sym, int64(off)))))
  2836  		return true
  2837  	}
  2838  	return false
  2839  }
  2840  func rewriteValueLOONG64_OpLOONG64MOVBloadidx(v *Value) bool {
  2841  	v_2 := v.Args[2]
  2842  	v_1 := v.Args[1]
  2843  	v_0 := v.Args[0]
  2844  	// match: (MOVBloadidx ptr (MOVVconst [c]) mem)
  2845  	// cond: is32Bit(c)
  2846  	// result: (MOVBload [int32(c)] ptr mem)
  2847  	for {
  2848  		ptr := v_0
  2849  		if v_1.Op != OpLOONG64MOVVconst {
  2850  			break
  2851  		}
  2852  		c := auxIntToInt64(v_1.AuxInt)
  2853  		mem := v_2
  2854  		if !(is32Bit(c)) {
  2855  			break
  2856  		}
  2857  		v.reset(OpLOONG64MOVBload)
  2858  		v.AuxInt = int32ToAuxInt(int32(c))
  2859  		v.AddArg2(ptr, mem)
  2860  		return true
  2861  	}
  2862  	// match: (MOVBloadidx (MOVVconst [c]) ptr mem)
  2863  	// cond: is32Bit(c)
  2864  	// result: (MOVBload [int32(c)] ptr mem)
  2865  	for {
  2866  		if v_0.Op != OpLOONG64MOVVconst {
  2867  			break
  2868  		}
  2869  		c := auxIntToInt64(v_0.AuxInt)
  2870  		ptr := v_1
  2871  		mem := v_2
  2872  		if !(is32Bit(c)) {
  2873  			break
  2874  		}
  2875  		v.reset(OpLOONG64MOVBload)
  2876  		v.AuxInt = int32ToAuxInt(int32(c))
  2877  		v.AddArg2(ptr, mem)
  2878  		return true
  2879  	}
  2880  	return false
  2881  }
  2882  func rewriteValueLOONG64_OpLOONG64MOVBreg(v *Value) bool {
  2883  	v_0 := v.Args[0]
  2884  	// match: (MOVBreg x:(MOVBload _ _))
  2885  	// result: (MOVVreg x)
  2886  	for {
  2887  		x := v_0
  2888  		if x.Op != OpLOONG64MOVBload {
  2889  			break
  2890  		}
  2891  		v.reset(OpLOONG64MOVVreg)
  2892  		v.AddArg(x)
  2893  		return true
  2894  	}
  2895  	// match: (MOVBreg x:(MOVBloadidx _ _ _))
  2896  	// result: (MOVVreg x)
  2897  	for {
  2898  		x := v_0
  2899  		if x.Op != OpLOONG64MOVBloadidx {
  2900  			break
  2901  		}
  2902  		v.reset(OpLOONG64MOVVreg)
  2903  		v.AddArg(x)
  2904  		return true
  2905  	}
  2906  	// match: (MOVBreg x:(MOVBreg _))
  2907  	// result: (MOVVreg x)
  2908  	for {
  2909  		x := v_0
  2910  		if x.Op != OpLOONG64MOVBreg {
  2911  			break
  2912  		}
  2913  		v.reset(OpLOONG64MOVVreg)
  2914  		v.AddArg(x)
  2915  		return true
  2916  	}
  2917  	// match: (MOVBreg (MOVVconst [c]))
  2918  	// result: (MOVVconst [int64(int8(c))])
  2919  	for {
  2920  		if v_0.Op != OpLOONG64MOVVconst {
  2921  			break
  2922  		}
  2923  		c := auxIntToInt64(v_0.AuxInt)
  2924  		v.reset(OpLOONG64MOVVconst)
  2925  		v.AuxInt = int64ToAuxInt(int64(int8(c)))
  2926  		return true
  2927  	}
  2928  	// match: (MOVBreg x:(ANDconst [c] y))
  2929  	// cond: c >= 0 && int64(int8(c)) == c
  2930  	// result: x
  2931  	for {
  2932  		x := v_0
  2933  		if x.Op != OpLOONG64ANDconst {
  2934  			break
  2935  		}
  2936  		c := auxIntToInt64(x.AuxInt)
  2937  		if !(c >= 0 && int64(int8(c)) == c) {
  2938  			break
  2939  		}
  2940  		v.copyOf(x)
  2941  		return true
  2942  	}
  2943  	return false
  2944  }
  2945  func rewriteValueLOONG64_OpLOONG64MOVBstore(v *Value) bool {
  2946  	v_2 := v.Args[2]
  2947  	v_1 := v.Args[1]
  2948  	v_0 := v.Args[0]
  2949  	b := v.Block
  2950  	config := b.Func.Config
  2951  	typ := &b.Func.Config.Types
  2952  	// match: (MOVBstore [off1] {sym} (ADDVconst [off2] ptr) val mem)
  2953  	// cond: is32Bit(int64(off1)+off2) && (ptr.Op != OpSB || !config.ctxt.Flag_dynlink)
  2954  	// result: (MOVBstore [off1+int32(off2)] {sym} ptr val mem)
  2955  	for {
  2956  		off1 := auxIntToInt32(v.AuxInt)
  2957  		sym := auxToSym(v.Aux)
  2958  		if v_0.Op != OpLOONG64ADDVconst {
  2959  			break
  2960  		}
  2961  		off2 := auxIntToInt64(v_0.AuxInt)
  2962  		ptr := v_0.Args[0]
  2963  		val := v_1
  2964  		mem := v_2
  2965  		if !(is32Bit(int64(off1)+off2) && (ptr.Op != OpSB || !config.ctxt.Flag_dynlink)) {
  2966  			break
  2967  		}
  2968  		v.reset(OpLOONG64MOVBstore)
  2969  		v.AuxInt = int32ToAuxInt(off1 + int32(off2))
  2970  		v.Aux = symToAux(sym)
  2971  		v.AddArg3(ptr, val, mem)
  2972  		return true
  2973  	}
  2974  	// match: (MOVBstore [off1] {sym1} (MOVVaddr [off2] {sym2} ptr) val mem)
  2975  	// cond: canMergeSym(sym1,sym2) && is32Bit(int64(off1)+int64(off2)) && (ptr.Op != OpSB || !config.ctxt.Flag_dynlink)
  2976  	// result: (MOVBstore [off1+int32(off2)] {mergeSym(sym1,sym2)} ptr val mem)
  2977  	for {
  2978  		off1 := auxIntToInt32(v.AuxInt)
  2979  		sym1 := auxToSym(v.Aux)
  2980  		if v_0.Op != OpLOONG64MOVVaddr {
  2981  			break
  2982  		}
  2983  		off2 := auxIntToInt32(v_0.AuxInt)
  2984  		sym2 := auxToSym(v_0.Aux)
  2985  		ptr := v_0.Args[0]
  2986  		val := v_1
  2987  		mem := v_2
  2988  		if !(canMergeSym(sym1, sym2) && is32Bit(int64(off1)+int64(off2)) && (ptr.Op != OpSB || !config.ctxt.Flag_dynlink)) {
  2989  			break
  2990  		}
  2991  		v.reset(OpLOONG64MOVBstore)
  2992  		v.AuxInt = int32ToAuxInt(off1 + int32(off2))
  2993  		v.Aux = symToAux(mergeSym(sym1, sym2))
  2994  		v.AddArg3(ptr, val, mem)
  2995  		return true
  2996  	}
  2997  	// match: (MOVBstore [off] {sym} ptr (MOVBreg x) mem)
  2998  	// result: (MOVBstore [off] {sym} ptr x mem)
  2999  	for {
  3000  		off := auxIntToInt32(v.AuxInt)
  3001  		sym := auxToSym(v.Aux)
  3002  		ptr := v_0
  3003  		if v_1.Op != OpLOONG64MOVBreg {
  3004  			break
  3005  		}
  3006  		x := v_1.Args[0]
  3007  		mem := v_2
  3008  		v.reset(OpLOONG64MOVBstore)
  3009  		v.AuxInt = int32ToAuxInt(off)
  3010  		v.Aux = symToAux(sym)
  3011  		v.AddArg3(ptr, x, mem)
  3012  		return true
  3013  	}
  3014  	// match: (MOVBstore [off] {sym} ptr (MOVBUreg x) mem)
  3015  	// result: (MOVBstore [off] {sym} ptr x mem)
  3016  	for {
  3017  		off := auxIntToInt32(v.AuxInt)
  3018  		sym := auxToSym(v.Aux)
  3019  		ptr := v_0
  3020  		if v_1.Op != OpLOONG64MOVBUreg {
  3021  			break
  3022  		}
  3023  		x := v_1.Args[0]
  3024  		mem := v_2
  3025  		v.reset(OpLOONG64MOVBstore)
  3026  		v.AuxInt = int32ToAuxInt(off)
  3027  		v.Aux = symToAux(sym)
  3028  		v.AddArg3(ptr, x, mem)
  3029  		return true
  3030  	}
  3031  	// match: (MOVBstore [off] {sym} ptr (MOVHreg x) mem)
  3032  	// result: (MOVBstore [off] {sym} ptr x mem)
  3033  	for {
  3034  		off := auxIntToInt32(v.AuxInt)
  3035  		sym := auxToSym(v.Aux)
  3036  		ptr := v_0
  3037  		if v_1.Op != OpLOONG64MOVHreg {
  3038  			break
  3039  		}
  3040  		x := v_1.Args[0]
  3041  		mem := v_2
  3042  		v.reset(OpLOONG64MOVBstore)
  3043  		v.AuxInt = int32ToAuxInt(off)
  3044  		v.Aux = symToAux(sym)
  3045  		v.AddArg3(ptr, x, mem)
  3046  		return true
  3047  	}
  3048  	// match: (MOVBstore [off] {sym} ptr (MOVHUreg x) mem)
  3049  	// result: (MOVBstore [off] {sym} ptr x mem)
  3050  	for {
  3051  		off := auxIntToInt32(v.AuxInt)
  3052  		sym := auxToSym(v.Aux)
  3053  		ptr := v_0
  3054  		if v_1.Op != OpLOONG64MOVHUreg {
  3055  			break
  3056  		}
  3057  		x := v_1.Args[0]
  3058  		mem := v_2
  3059  		v.reset(OpLOONG64MOVBstore)
  3060  		v.AuxInt = int32ToAuxInt(off)
  3061  		v.Aux = symToAux(sym)
  3062  		v.AddArg3(ptr, x, mem)
  3063  		return true
  3064  	}
  3065  	// match: (MOVBstore [off] {sym} ptr (MOVWreg x) mem)
  3066  	// result: (MOVBstore [off] {sym} ptr x mem)
  3067  	for {
  3068  		off := auxIntToInt32(v.AuxInt)
  3069  		sym := auxToSym(v.Aux)
  3070  		ptr := v_0
  3071  		if v_1.Op != OpLOONG64MOVWreg {
  3072  			break
  3073  		}
  3074  		x := v_1.Args[0]
  3075  		mem := v_2
  3076  		v.reset(OpLOONG64MOVBstore)
  3077  		v.AuxInt = int32ToAuxInt(off)
  3078  		v.Aux = symToAux(sym)
  3079  		v.AddArg3(ptr, x, mem)
  3080  		return true
  3081  	}
  3082  	// match: (MOVBstore [off] {sym} ptr (MOVWUreg x) mem)
  3083  	// result: (MOVBstore [off] {sym} ptr x mem)
  3084  	for {
  3085  		off := auxIntToInt32(v.AuxInt)
  3086  		sym := auxToSym(v.Aux)
  3087  		ptr := v_0
  3088  		if v_1.Op != OpLOONG64MOVWUreg {
  3089  			break
  3090  		}
  3091  		x := v_1.Args[0]
  3092  		mem := v_2
  3093  		v.reset(OpLOONG64MOVBstore)
  3094  		v.AuxInt = int32ToAuxInt(off)
  3095  		v.Aux = symToAux(sym)
  3096  		v.AddArg3(ptr, x, mem)
  3097  		return true
  3098  	}
  3099  	// match: (MOVBstore [off] {sym} (ADDV ptr idx) val mem)
  3100  	// cond: off == 0 && sym == nil
  3101  	// result: (MOVBstoreidx ptr idx val mem)
  3102  	for {
  3103  		off := auxIntToInt32(v.AuxInt)
  3104  		sym := auxToSym(v.Aux)
  3105  		if v_0.Op != OpLOONG64ADDV {
  3106  			break
  3107  		}
  3108  		idx := v_0.Args[1]
  3109  		ptr := v_0.Args[0]
  3110  		val := v_1
  3111  		mem := v_2
  3112  		if !(off == 0 && sym == nil) {
  3113  			break
  3114  		}
  3115  		v.reset(OpLOONG64MOVBstoreidx)
  3116  		v.AddArg4(ptr, idx, val, mem)
  3117  		return true
  3118  	}
  3119  	// match: (MOVBstore [off] {sym} (ADDshiftLLV [shift] ptr idx) val mem)
  3120  	// cond: off == 0 && sym == nil
  3121  	// result: (MOVBstoreidx ptr (SLLVconst <typ.Int64> [shift] idx) val mem)
  3122  	for {
  3123  		off := auxIntToInt32(v.AuxInt)
  3124  		sym := auxToSym(v.Aux)
  3125  		if v_0.Op != OpLOONG64ADDshiftLLV {
  3126  			break
  3127  		}
  3128  		shift := auxIntToInt64(v_0.AuxInt)
  3129  		idx := v_0.Args[1]
  3130  		ptr := v_0.Args[0]
  3131  		val := v_1
  3132  		mem := v_2
  3133  		if !(off == 0 && sym == nil) {
  3134  			break
  3135  		}
  3136  		v.reset(OpLOONG64MOVBstoreidx)
  3137  		v0 := b.NewValue0(v.Pos, OpLOONG64SLLVconst, typ.Int64)
  3138  		v0.AuxInt = int64ToAuxInt(shift)
  3139  		v0.AddArg(idx)
  3140  		v.AddArg4(ptr, v0, val, mem)
  3141  		return true
  3142  	}
  3143  	return false
  3144  }
  3145  func rewriteValueLOONG64_OpLOONG64MOVBstoreidx(v *Value) bool {
  3146  	v_3 := v.Args[3]
  3147  	v_2 := v.Args[2]
  3148  	v_1 := v.Args[1]
  3149  	v_0 := v.Args[0]
  3150  	// match: (MOVBstoreidx ptr (MOVVconst [c]) val mem)
  3151  	// cond: is32Bit(c)
  3152  	// result: (MOVBstore [int32(c)] ptr val mem)
  3153  	for {
  3154  		ptr := v_0
  3155  		if v_1.Op != OpLOONG64MOVVconst {
  3156  			break
  3157  		}
  3158  		c := auxIntToInt64(v_1.AuxInt)
  3159  		val := v_2
  3160  		mem := v_3
  3161  		if !(is32Bit(c)) {
  3162  			break
  3163  		}
  3164  		v.reset(OpLOONG64MOVBstore)
  3165  		v.AuxInt = int32ToAuxInt(int32(c))
  3166  		v.AddArg3(ptr, val, mem)
  3167  		return true
  3168  	}
  3169  	// match: (MOVBstoreidx (MOVVconst [c]) idx val mem)
  3170  	// cond: is32Bit(c)
  3171  	// result: (MOVBstore [int32(c)] idx val mem)
  3172  	for {
  3173  		if v_0.Op != OpLOONG64MOVVconst {
  3174  			break
  3175  		}
  3176  		c := auxIntToInt64(v_0.AuxInt)
  3177  		idx := v_1
  3178  		val := v_2
  3179  		mem := v_3
  3180  		if !(is32Bit(c)) {
  3181  			break
  3182  		}
  3183  		v.reset(OpLOONG64MOVBstore)
  3184  		v.AuxInt = int32ToAuxInt(int32(c))
  3185  		v.AddArg3(idx, val, mem)
  3186  		return true
  3187  	}
  3188  	return false
  3189  }
  3190  func rewriteValueLOONG64_OpLOONG64MOVDF(v *Value) bool {
  3191  	v_0 := v.Args[0]
  3192  	// match: (MOVDF (ABSD (MOVFD x)))
  3193  	// result: (ABSF x)
  3194  	for {
  3195  		if v_0.Op != OpLOONG64ABSD {
  3196  			break
  3197  		}
  3198  		v_0_0 := v_0.Args[0]
  3199  		if v_0_0.Op != OpLOONG64MOVFD {
  3200  			break
  3201  		}
  3202  		x := v_0_0.Args[0]
  3203  		v.reset(OpLOONG64ABSF)
  3204  		v.AddArg(x)
  3205  		return true
  3206  	}
  3207  	// match: (MOVDF (SQRTD (MOVFD x)))
  3208  	// result: (SQRTF x)
  3209  	for {
  3210  		if v_0.Op != OpLOONG64SQRTD {
  3211  			break
  3212  		}
  3213  		v_0_0 := v_0.Args[0]
  3214  		if v_0_0.Op != OpLOONG64MOVFD {
  3215  			break
  3216  		}
  3217  		x := v_0_0.Args[0]
  3218  		v.reset(OpLOONG64SQRTF)
  3219  		v.AddArg(x)
  3220  		return true
  3221  	}
  3222  	return false
  3223  }
  3224  func rewriteValueLOONG64_OpLOONG64MOVDload(v *Value) bool {
  3225  	v_1 := v.Args[1]
  3226  	v_0 := v.Args[0]
  3227  	b := v.Block
  3228  	config := b.Func.Config
  3229  	typ := &b.Func.Config.Types
  3230  	// match: (MOVDload [off] {sym} ptr (MOVVstore [off] {sym} ptr val _))
  3231  	// result: (MOVVgpfp val)
  3232  	for {
  3233  		off := auxIntToInt32(v.AuxInt)
  3234  		sym := auxToSym(v.Aux)
  3235  		ptr := v_0
  3236  		if v_1.Op != OpLOONG64MOVVstore || auxIntToInt32(v_1.AuxInt) != off || auxToSym(v_1.Aux) != sym {
  3237  			break
  3238  		}
  3239  		val := v_1.Args[1]
  3240  		if ptr != v_1.Args[0] {
  3241  			break
  3242  		}
  3243  		v.reset(OpLOONG64MOVVgpfp)
  3244  		v.AddArg(val)
  3245  		return true
  3246  	}
  3247  	// match: (MOVDload [off1] {sym} (ADDVconst [off2] ptr) mem)
  3248  	// cond: is32Bit(int64(off1)+off2) && (ptr.Op != OpSB || !config.ctxt.Flag_dynlink)
  3249  	// result: (MOVDload [off1+int32(off2)] {sym} ptr mem)
  3250  	for {
  3251  		off1 := auxIntToInt32(v.AuxInt)
  3252  		sym := auxToSym(v.Aux)
  3253  		if v_0.Op != OpLOONG64ADDVconst {
  3254  			break
  3255  		}
  3256  		off2 := auxIntToInt64(v_0.AuxInt)
  3257  		ptr := v_0.Args[0]
  3258  		mem := v_1
  3259  		if !(is32Bit(int64(off1)+off2) && (ptr.Op != OpSB || !config.ctxt.Flag_dynlink)) {
  3260  			break
  3261  		}
  3262  		v.reset(OpLOONG64MOVDload)
  3263  		v.AuxInt = int32ToAuxInt(off1 + int32(off2))
  3264  		v.Aux = symToAux(sym)
  3265  		v.AddArg2(ptr, mem)
  3266  		return true
  3267  	}
  3268  	// match: (MOVDload [off1] {sym1} (MOVVaddr [off2] {sym2} ptr) mem)
  3269  	// cond: canMergeSym(sym1,sym2) && is32Bit(int64(off1)+int64(off2)) && (ptr.Op != OpSB || !config.ctxt.Flag_dynlink)
  3270  	// result: (MOVDload [off1+int32(off2)] {mergeSym(sym1,sym2)} ptr mem)
  3271  	for {
  3272  		off1 := auxIntToInt32(v.AuxInt)
  3273  		sym1 := auxToSym(v.Aux)
  3274  		if v_0.Op != OpLOONG64MOVVaddr {
  3275  			break
  3276  		}
  3277  		off2 := auxIntToInt32(v_0.AuxInt)
  3278  		sym2 := auxToSym(v_0.Aux)
  3279  		ptr := v_0.Args[0]
  3280  		mem := v_1
  3281  		if !(canMergeSym(sym1, sym2) && is32Bit(int64(off1)+int64(off2)) && (ptr.Op != OpSB || !config.ctxt.Flag_dynlink)) {
  3282  			break
  3283  		}
  3284  		v.reset(OpLOONG64MOVDload)
  3285  		v.AuxInt = int32ToAuxInt(off1 + int32(off2))
  3286  		v.Aux = symToAux(mergeSym(sym1, sym2))
  3287  		v.AddArg2(ptr, mem)
  3288  		return true
  3289  	}
  3290  	// match: (MOVDload [off] {sym} (ADDV ptr idx) mem)
  3291  	// cond: off == 0 && sym == nil
  3292  	// result: (MOVDloadidx ptr idx mem)
  3293  	for {
  3294  		off := auxIntToInt32(v.AuxInt)
  3295  		sym := auxToSym(v.Aux)
  3296  		if v_0.Op != OpLOONG64ADDV {
  3297  			break
  3298  		}
  3299  		idx := v_0.Args[1]
  3300  		ptr := v_0.Args[0]
  3301  		mem := v_1
  3302  		if !(off == 0 && sym == nil) {
  3303  			break
  3304  		}
  3305  		v.reset(OpLOONG64MOVDloadidx)
  3306  		v.AddArg3(ptr, idx, mem)
  3307  		return true
  3308  	}
  3309  	// match: (MOVDload [off] {sym} (ADDshiftLLV [shift] ptr idx) mem)
  3310  	// cond: off == 0 && sym == nil
  3311  	// result: (MOVDloadidx ptr (SLLVconst <typ.Int64> [shift] idx) mem)
  3312  	for {
  3313  		off := auxIntToInt32(v.AuxInt)
  3314  		sym := auxToSym(v.Aux)
  3315  		if v_0.Op != OpLOONG64ADDshiftLLV {
  3316  			break
  3317  		}
  3318  		shift := auxIntToInt64(v_0.AuxInt)
  3319  		idx := v_0.Args[1]
  3320  		ptr := v_0.Args[0]
  3321  		mem := v_1
  3322  		if !(off == 0 && sym == nil) {
  3323  			break
  3324  		}
  3325  		v.reset(OpLOONG64MOVDloadidx)
  3326  		v0 := b.NewValue0(v.Pos, OpLOONG64SLLVconst, typ.Int64)
  3327  		v0.AuxInt = int64ToAuxInt(shift)
  3328  		v0.AddArg(idx)
  3329  		v.AddArg3(ptr, v0, mem)
  3330  		return true
  3331  	}
  3332  	return false
  3333  }
  3334  func rewriteValueLOONG64_OpLOONG64MOVDloadidx(v *Value) bool {
  3335  	v_2 := v.Args[2]
  3336  	v_1 := v.Args[1]
  3337  	v_0 := v.Args[0]
  3338  	// match: (MOVDloadidx ptr (MOVVconst [c]) mem)
  3339  	// cond: is32Bit(c)
  3340  	// result: (MOVDload [int32(c)] ptr mem)
  3341  	for {
  3342  		ptr := v_0
  3343  		if v_1.Op != OpLOONG64MOVVconst {
  3344  			break
  3345  		}
  3346  		c := auxIntToInt64(v_1.AuxInt)
  3347  		mem := v_2
  3348  		if !(is32Bit(c)) {
  3349  			break
  3350  		}
  3351  		v.reset(OpLOONG64MOVDload)
  3352  		v.AuxInt = int32ToAuxInt(int32(c))
  3353  		v.AddArg2(ptr, mem)
  3354  		return true
  3355  	}
  3356  	// match: (MOVDloadidx (MOVVconst [c]) ptr mem)
  3357  	// cond: is32Bit(c)
  3358  	// result: (MOVDload [int32(c)] ptr mem)
  3359  	for {
  3360  		if v_0.Op != OpLOONG64MOVVconst {
  3361  			break
  3362  		}
  3363  		c := auxIntToInt64(v_0.AuxInt)
  3364  		ptr := v_1
  3365  		mem := v_2
  3366  		if !(is32Bit(c)) {
  3367  			break
  3368  		}
  3369  		v.reset(OpLOONG64MOVDload)
  3370  		v.AuxInt = int32ToAuxInt(int32(c))
  3371  		v.AddArg2(ptr, mem)
  3372  		return true
  3373  	}
  3374  	return false
  3375  }
  3376  func rewriteValueLOONG64_OpLOONG64MOVDstore(v *Value) bool {
  3377  	v_2 := v.Args[2]
  3378  	v_1 := v.Args[1]
  3379  	v_0 := v.Args[0]
  3380  	b := v.Block
  3381  	config := b.Func.Config
  3382  	typ := &b.Func.Config.Types
  3383  	// match: (MOVDstore [off] {sym} ptr (MOVVgpfp val) mem)
  3384  	// result: (MOVVstore [off] {sym} ptr val mem)
  3385  	for {
  3386  		off := auxIntToInt32(v.AuxInt)
  3387  		sym := auxToSym(v.Aux)
  3388  		ptr := v_0
  3389  		if v_1.Op != OpLOONG64MOVVgpfp {
  3390  			break
  3391  		}
  3392  		val := v_1.Args[0]
  3393  		mem := v_2
  3394  		v.reset(OpLOONG64MOVVstore)
  3395  		v.AuxInt = int32ToAuxInt(off)
  3396  		v.Aux = symToAux(sym)
  3397  		v.AddArg3(ptr, val, mem)
  3398  		return true
  3399  	}
  3400  	// match: (MOVDstore [off1] {sym} (ADDVconst [off2] ptr) val mem)
  3401  	// cond: is32Bit(int64(off1)+off2) && (ptr.Op != OpSB || !config.ctxt.Flag_dynlink)
  3402  	// result: (MOVDstore [off1+int32(off2)] {sym} ptr val mem)
  3403  	for {
  3404  		off1 := auxIntToInt32(v.AuxInt)
  3405  		sym := auxToSym(v.Aux)
  3406  		if v_0.Op != OpLOONG64ADDVconst {
  3407  			break
  3408  		}
  3409  		off2 := auxIntToInt64(v_0.AuxInt)
  3410  		ptr := v_0.Args[0]
  3411  		val := v_1
  3412  		mem := v_2
  3413  		if !(is32Bit(int64(off1)+off2) && (ptr.Op != OpSB || !config.ctxt.Flag_dynlink)) {
  3414  			break
  3415  		}
  3416  		v.reset(OpLOONG64MOVDstore)
  3417  		v.AuxInt = int32ToAuxInt(off1 + int32(off2))
  3418  		v.Aux = symToAux(sym)
  3419  		v.AddArg3(ptr, val, mem)
  3420  		return true
  3421  	}
  3422  	// match: (MOVDstore [off1] {sym1} (MOVVaddr [off2] {sym2} ptr) val mem)
  3423  	// cond: canMergeSym(sym1,sym2) && is32Bit(int64(off1)+int64(off2)) && (ptr.Op != OpSB || !config.ctxt.Flag_dynlink)
  3424  	// result: (MOVDstore [off1+int32(off2)] {mergeSym(sym1,sym2)} ptr val mem)
  3425  	for {
  3426  		off1 := auxIntToInt32(v.AuxInt)
  3427  		sym1 := auxToSym(v.Aux)
  3428  		if v_0.Op != OpLOONG64MOVVaddr {
  3429  			break
  3430  		}
  3431  		off2 := auxIntToInt32(v_0.AuxInt)
  3432  		sym2 := auxToSym(v_0.Aux)
  3433  		ptr := v_0.Args[0]
  3434  		val := v_1
  3435  		mem := v_2
  3436  		if !(canMergeSym(sym1, sym2) && is32Bit(int64(off1)+int64(off2)) && (ptr.Op != OpSB || !config.ctxt.Flag_dynlink)) {
  3437  			break
  3438  		}
  3439  		v.reset(OpLOONG64MOVDstore)
  3440  		v.AuxInt = int32ToAuxInt(off1 + int32(off2))
  3441  		v.Aux = symToAux(mergeSym(sym1, sym2))
  3442  		v.AddArg3(ptr, val, mem)
  3443  		return true
  3444  	}
  3445  	// match: (MOVDstore [off] {sym} (ADDV ptr idx) val mem)
  3446  	// cond: off == 0 && sym == nil
  3447  	// result: (MOVDstoreidx ptr idx val mem)
  3448  	for {
  3449  		off := auxIntToInt32(v.AuxInt)
  3450  		sym := auxToSym(v.Aux)
  3451  		if v_0.Op != OpLOONG64ADDV {
  3452  			break
  3453  		}
  3454  		idx := v_0.Args[1]
  3455  		ptr := v_0.Args[0]
  3456  		val := v_1
  3457  		mem := v_2
  3458  		if !(off == 0 && sym == nil) {
  3459  			break
  3460  		}
  3461  		v.reset(OpLOONG64MOVDstoreidx)
  3462  		v.AddArg4(ptr, idx, val, mem)
  3463  		return true
  3464  	}
  3465  	// match: (MOVDstore [off] {sym} (ADDshiftLLV [shift] ptr idx) val mem)
  3466  	// cond: off == 0 && sym == nil
  3467  	// result: (MOVDstoreidx ptr (SLLVconst <typ.Int64> [shift] idx) val mem)
  3468  	for {
  3469  		off := auxIntToInt32(v.AuxInt)
  3470  		sym := auxToSym(v.Aux)
  3471  		if v_0.Op != OpLOONG64ADDshiftLLV {
  3472  			break
  3473  		}
  3474  		shift := auxIntToInt64(v_0.AuxInt)
  3475  		idx := v_0.Args[1]
  3476  		ptr := v_0.Args[0]
  3477  		val := v_1
  3478  		mem := v_2
  3479  		if !(off == 0 && sym == nil) {
  3480  			break
  3481  		}
  3482  		v.reset(OpLOONG64MOVDstoreidx)
  3483  		v0 := b.NewValue0(v.Pos, OpLOONG64SLLVconst, typ.Int64)
  3484  		v0.AuxInt = int64ToAuxInt(shift)
  3485  		v0.AddArg(idx)
  3486  		v.AddArg4(ptr, v0, val, mem)
  3487  		return true
  3488  	}
  3489  	return false
  3490  }
  3491  func rewriteValueLOONG64_OpLOONG64MOVDstoreidx(v *Value) bool {
  3492  	v_3 := v.Args[3]
  3493  	v_2 := v.Args[2]
  3494  	v_1 := v.Args[1]
  3495  	v_0 := v.Args[0]
  3496  	// match: (MOVDstoreidx ptr (MOVVconst [c]) val mem)
  3497  	// cond: is32Bit(c)
  3498  	// result: (MOVDstore [int32(c)] ptr val mem)
  3499  	for {
  3500  		ptr := v_0
  3501  		if v_1.Op != OpLOONG64MOVVconst {
  3502  			break
  3503  		}
  3504  		c := auxIntToInt64(v_1.AuxInt)
  3505  		val := v_2
  3506  		mem := v_3
  3507  		if !(is32Bit(c)) {
  3508  			break
  3509  		}
  3510  		v.reset(OpLOONG64MOVDstore)
  3511  		v.AuxInt = int32ToAuxInt(int32(c))
  3512  		v.AddArg3(ptr, val, mem)
  3513  		return true
  3514  	}
  3515  	// match: (MOVDstoreidx (MOVVconst [c]) idx val mem)
  3516  	// cond: is32Bit(c)
  3517  	// result: (MOVDstore [int32(c)] idx val mem)
  3518  	for {
  3519  		if v_0.Op != OpLOONG64MOVVconst {
  3520  			break
  3521  		}
  3522  		c := auxIntToInt64(v_0.AuxInt)
  3523  		idx := v_1
  3524  		val := v_2
  3525  		mem := v_3
  3526  		if !(is32Bit(c)) {
  3527  			break
  3528  		}
  3529  		v.reset(OpLOONG64MOVDstore)
  3530  		v.AuxInt = int32ToAuxInt(int32(c))
  3531  		v.AddArg3(idx, val, mem)
  3532  		return true
  3533  	}
  3534  	return false
  3535  }
  3536  func rewriteValueLOONG64_OpLOONG64MOVFload(v *Value) bool {
  3537  	v_1 := v.Args[1]
  3538  	v_0 := v.Args[0]
  3539  	b := v.Block
  3540  	config := b.Func.Config
  3541  	typ := &b.Func.Config.Types
  3542  	// match: (MOVFload [off] {sym} ptr (MOVWstore [off] {sym} ptr val _))
  3543  	// result: (MOVWgpfp val)
  3544  	for {
  3545  		off := auxIntToInt32(v.AuxInt)
  3546  		sym := auxToSym(v.Aux)
  3547  		ptr := v_0
  3548  		if v_1.Op != OpLOONG64MOVWstore || auxIntToInt32(v_1.AuxInt) != off || auxToSym(v_1.Aux) != sym {
  3549  			break
  3550  		}
  3551  		val := v_1.Args[1]
  3552  		if ptr != v_1.Args[0] {
  3553  			break
  3554  		}
  3555  		v.reset(OpLOONG64MOVWgpfp)
  3556  		v.AddArg(val)
  3557  		return true
  3558  	}
  3559  	// match: (MOVFload [off1] {sym} (ADDVconst [off2] ptr) mem)
  3560  	// cond: is32Bit(int64(off1)+off2) && (ptr.Op != OpSB || !config.ctxt.Flag_dynlink)
  3561  	// result: (MOVFload [off1+int32(off2)] {sym} ptr mem)
  3562  	for {
  3563  		off1 := auxIntToInt32(v.AuxInt)
  3564  		sym := auxToSym(v.Aux)
  3565  		if v_0.Op != OpLOONG64ADDVconst {
  3566  			break
  3567  		}
  3568  		off2 := auxIntToInt64(v_0.AuxInt)
  3569  		ptr := v_0.Args[0]
  3570  		mem := v_1
  3571  		if !(is32Bit(int64(off1)+off2) && (ptr.Op != OpSB || !config.ctxt.Flag_dynlink)) {
  3572  			break
  3573  		}
  3574  		v.reset(OpLOONG64MOVFload)
  3575  		v.AuxInt = int32ToAuxInt(off1 + int32(off2))
  3576  		v.Aux = symToAux(sym)
  3577  		v.AddArg2(ptr, mem)
  3578  		return true
  3579  	}
  3580  	// match: (MOVFload [off1] {sym1} (MOVVaddr [off2] {sym2} ptr) mem)
  3581  	// cond: canMergeSym(sym1,sym2) && is32Bit(int64(off1)+int64(off2)) && (ptr.Op != OpSB || !config.ctxt.Flag_dynlink)
  3582  	// result: (MOVFload [off1+int32(off2)] {mergeSym(sym1,sym2)} ptr mem)
  3583  	for {
  3584  		off1 := auxIntToInt32(v.AuxInt)
  3585  		sym1 := auxToSym(v.Aux)
  3586  		if v_0.Op != OpLOONG64MOVVaddr {
  3587  			break
  3588  		}
  3589  		off2 := auxIntToInt32(v_0.AuxInt)
  3590  		sym2 := auxToSym(v_0.Aux)
  3591  		ptr := v_0.Args[0]
  3592  		mem := v_1
  3593  		if !(canMergeSym(sym1, sym2) && is32Bit(int64(off1)+int64(off2)) && (ptr.Op != OpSB || !config.ctxt.Flag_dynlink)) {
  3594  			break
  3595  		}
  3596  		v.reset(OpLOONG64MOVFload)
  3597  		v.AuxInt = int32ToAuxInt(off1 + int32(off2))
  3598  		v.Aux = symToAux(mergeSym(sym1, sym2))
  3599  		v.AddArg2(ptr, mem)
  3600  		return true
  3601  	}
  3602  	// match: (MOVFload [off] {sym} (ADDV ptr idx) mem)
  3603  	// cond: off == 0 && sym == nil
  3604  	// result: (MOVFloadidx ptr idx mem)
  3605  	for {
  3606  		off := auxIntToInt32(v.AuxInt)
  3607  		sym := auxToSym(v.Aux)
  3608  		if v_0.Op != OpLOONG64ADDV {
  3609  			break
  3610  		}
  3611  		idx := v_0.Args[1]
  3612  		ptr := v_0.Args[0]
  3613  		mem := v_1
  3614  		if !(off == 0 && sym == nil) {
  3615  			break
  3616  		}
  3617  		v.reset(OpLOONG64MOVFloadidx)
  3618  		v.AddArg3(ptr, idx, mem)
  3619  		return true
  3620  	}
  3621  	// match: (MOVFload [off] {sym} (ADDshiftLLV [shift] ptr idx) mem)
  3622  	// cond: off == 0 && sym == nil
  3623  	// result: (MOVFloadidx ptr (SLLVconst <typ.Int64> [shift] idx) mem)
  3624  	for {
  3625  		off := auxIntToInt32(v.AuxInt)
  3626  		sym := auxToSym(v.Aux)
  3627  		if v_0.Op != OpLOONG64ADDshiftLLV {
  3628  			break
  3629  		}
  3630  		shift := auxIntToInt64(v_0.AuxInt)
  3631  		idx := v_0.Args[1]
  3632  		ptr := v_0.Args[0]
  3633  		mem := v_1
  3634  		if !(off == 0 && sym == nil) {
  3635  			break
  3636  		}
  3637  		v.reset(OpLOONG64MOVFloadidx)
  3638  		v0 := b.NewValue0(v.Pos, OpLOONG64SLLVconst, typ.Int64)
  3639  		v0.AuxInt = int64ToAuxInt(shift)
  3640  		v0.AddArg(idx)
  3641  		v.AddArg3(ptr, v0, mem)
  3642  		return true
  3643  	}
  3644  	return false
  3645  }
  3646  func rewriteValueLOONG64_OpLOONG64MOVFloadidx(v *Value) bool {
  3647  	v_2 := v.Args[2]
  3648  	v_1 := v.Args[1]
  3649  	v_0 := v.Args[0]
  3650  	// match: (MOVFloadidx ptr (MOVVconst [c]) mem)
  3651  	// cond: is32Bit(c)
  3652  	// result: (MOVFload [int32(c)] ptr mem)
  3653  	for {
  3654  		ptr := v_0
  3655  		if v_1.Op != OpLOONG64MOVVconst {
  3656  			break
  3657  		}
  3658  		c := auxIntToInt64(v_1.AuxInt)
  3659  		mem := v_2
  3660  		if !(is32Bit(c)) {
  3661  			break
  3662  		}
  3663  		v.reset(OpLOONG64MOVFload)
  3664  		v.AuxInt = int32ToAuxInt(int32(c))
  3665  		v.AddArg2(ptr, mem)
  3666  		return true
  3667  	}
  3668  	// match: (MOVFloadidx (MOVVconst [c]) ptr mem)
  3669  	// cond: is32Bit(c)
  3670  	// result: (MOVFload [int32(c)] ptr mem)
  3671  	for {
  3672  		if v_0.Op != OpLOONG64MOVVconst {
  3673  			break
  3674  		}
  3675  		c := auxIntToInt64(v_0.AuxInt)
  3676  		ptr := v_1
  3677  		mem := v_2
  3678  		if !(is32Bit(c)) {
  3679  			break
  3680  		}
  3681  		v.reset(OpLOONG64MOVFload)
  3682  		v.AuxInt = int32ToAuxInt(int32(c))
  3683  		v.AddArg2(ptr, mem)
  3684  		return true
  3685  	}
  3686  	return false
  3687  }
  3688  func rewriteValueLOONG64_OpLOONG64MOVFstore(v *Value) bool {
  3689  	v_2 := v.Args[2]
  3690  	v_1 := v.Args[1]
  3691  	v_0 := v.Args[0]
  3692  	b := v.Block
  3693  	config := b.Func.Config
  3694  	typ := &b.Func.Config.Types
  3695  	// match: (MOVFstore [off] {sym} ptr (MOVWgpfp val) mem)
  3696  	// result: (MOVWstore [off] {sym} ptr val mem)
  3697  	for {
  3698  		off := auxIntToInt32(v.AuxInt)
  3699  		sym := auxToSym(v.Aux)
  3700  		ptr := v_0
  3701  		if v_1.Op != OpLOONG64MOVWgpfp {
  3702  			break
  3703  		}
  3704  		val := v_1.Args[0]
  3705  		mem := v_2
  3706  		v.reset(OpLOONG64MOVWstore)
  3707  		v.AuxInt = int32ToAuxInt(off)
  3708  		v.Aux = symToAux(sym)
  3709  		v.AddArg3(ptr, val, mem)
  3710  		return true
  3711  	}
  3712  	// match: (MOVFstore [off1] {sym} (ADDVconst [off2] ptr) val mem)
  3713  	// cond: is32Bit(int64(off1)+off2) && (ptr.Op != OpSB || !config.ctxt.Flag_dynlink)
  3714  	// result: (MOVFstore [off1+int32(off2)] {sym} ptr val mem)
  3715  	for {
  3716  		off1 := auxIntToInt32(v.AuxInt)
  3717  		sym := auxToSym(v.Aux)
  3718  		if v_0.Op != OpLOONG64ADDVconst {
  3719  			break
  3720  		}
  3721  		off2 := auxIntToInt64(v_0.AuxInt)
  3722  		ptr := v_0.Args[0]
  3723  		val := v_1
  3724  		mem := v_2
  3725  		if !(is32Bit(int64(off1)+off2) && (ptr.Op != OpSB || !config.ctxt.Flag_dynlink)) {
  3726  			break
  3727  		}
  3728  		v.reset(OpLOONG64MOVFstore)
  3729  		v.AuxInt = int32ToAuxInt(off1 + int32(off2))
  3730  		v.Aux = symToAux(sym)
  3731  		v.AddArg3(ptr, val, mem)
  3732  		return true
  3733  	}
  3734  	// match: (MOVFstore [off1] {sym1} (MOVVaddr [off2] {sym2} ptr) val mem)
  3735  	// cond: canMergeSym(sym1,sym2) && is32Bit(int64(off1)+int64(off2)) && (ptr.Op != OpSB || !config.ctxt.Flag_dynlink)
  3736  	// result: (MOVFstore [off1+int32(off2)] {mergeSym(sym1,sym2)} ptr val mem)
  3737  	for {
  3738  		off1 := auxIntToInt32(v.AuxInt)
  3739  		sym1 := auxToSym(v.Aux)
  3740  		if v_0.Op != OpLOONG64MOVVaddr {
  3741  			break
  3742  		}
  3743  		off2 := auxIntToInt32(v_0.AuxInt)
  3744  		sym2 := auxToSym(v_0.Aux)
  3745  		ptr := v_0.Args[0]
  3746  		val := v_1
  3747  		mem := v_2
  3748  		if !(canMergeSym(sym1, sym2) && is32Bit(int64(off1)+int64(off2)) && (ptr.Op != OpSB || !config.ctxt.Flag_dynlink)) {
  3749  			break
  3750  		}
  3751  		v.reset(OpLOONG64MOVFstore)
  3752  		v.AuxInt = int32ToAuxInt(off1 + int32(off2))
  3753  		v.Aux = symToAux(mergeSym(sym1, sym2))
  3754  		v.AddArg3(ptr, val, mem)
  3755  		return true
  3756  	}
  3757  	// match: (MOVFstore [off] {sym} (ADDV ptr idx) val mem)
  3758  	// cond: off == 0 && sym == nil
  3759  	// result: (MOVFstoreidx ptr idx val mem)
  3760  	for {
  3761  		off := auxIntToInt32(v.AuxInt)
  3762  		sym := auxToSym(v.Aux)
  3763  		if v_0.Op != OpLOONG64ADDV {
  3764  			break
  3765  		}
  3766  		idx := v_0.Args[1]
  3767  		ptr := v_0.Args[0]
  3768  		val := v_1
  3769  		mem := v_2
  3770  		if !(off == 0 && sym == nil) {
  3771  			break
  3772  		}
  3773  		v.reset(OpLOONG64MOVFstoreidx)
  3774  		v.AddArg4(ptr, idx, val, mem)
  3775  		return true
  3776  	}
  3777  	// match: (MOVFstore [off] {sym} (ADDshiftLLV [shift] ptr idx) val mem)
  3778  	// cond: off == 0 && sym == nil
  3779  	// result: (MOVFstoreidx ptr (SLLVconst <typ.Int64> [shift] idx) val mem)
  3780  	for {
  3781  		off := auxIntToInt32(v.AuxInt)
  3782  		sym := auxToSym(v.Aux)
  3783  		if v_0.Op != OpLOONG64ADDshiftLLV {
  3784  			break
  3785  		}
  3786  		shift := auxIntToInt64(v_0.AuxInt)
  3787  		idx := v_0.Args[1]
  3788  		ptr := v_0.Args[0]
  3789  		val := v_1
  3790  		mem := v_2
  3791  		if !(off == 0 && sym == nil) {
  3792  			break
  3793  		}
  3794  		v.reset(OpLOONG64MOVFstoreidx)
  3795  		v0 := b.NewValue0(v.Pos, OpLOONG64SLLVconst, typ.Int64)
  3796  		v0.AuxInt = int64ToAuxInt(shift)
  3797  		v0.AddArg(idx)
  3798  		v.AddArg4(ptr, v0, val, mem)
  3799  		return true
  3800  	}
  3801  	return false
  3802  }
  3803  func rewriteValueLOONG64_OpLOONG64MOVFstoreidx(v *Value) bool {
  3804  	v_3 := v.Args[3]
  3805  	v_2 := v.Args[2]
  3806  	v_1 := v.Args[1]
  3807  	v_0 := v.Args[0]
  3808  	// match: (MOVFstoreidx ptr (MOVVconst [c]) val mem)
  3809  	// cond: is32Bit(c)
  3810  	// result: (MOVFstore [int32(c)] ptr val mem)
  3811  	for {
  3812  		ptr := v_0
  3813  		if v_1.Op != OpLOONG64MOVVconst {
  3814  			break
  3815  		}
  3816  		c := auxIntToInt64(v_1.AuxInt)
  3817  		val := v_2
  3818  		mem := v_3
  3819  		if !(is32Bit(c)) {
  3820  			break
  3821  		}
  3822  		v.reset(OpLOONG64MOVFstore)
  3823  		v.AuxInt = int32ToAuxInt(int32(c))
  3824  		v.AddArg3(ptr, val, mem)
  3825  		return true
  3826  	}
  3827  	// match: (MOVFstoreidx (MOVVconst [c]) idx val mem)
  3828  	// cond: is32Bit(c)
  3829  	// result: (MOVFstore [int32(c)] idx val mem)
  3830  	for {
  3831  		if v_0.Op != OpLOONG64MOVVconst {
  3832  			break
  3833  		}
  3834  		c := auxIntToInt64(v_0.AuxInt)
  3835  		idx := v_1
  3836  		val := v_2
  3837  		mem := v_3
  3838  		if !(is32Bit(c)) {
  3839  			break
  3840  		}
  3841  		v.reset(OpLOONG64MOVFstore)
  3842  		v.AuxInt = int32ToAuxInt(int32(c))
  3843  		v.AddArg3(idx, val, mem)
  3844  		return true
  3845  	}
  3846  	return false
  3847  }
  3848  func rewriteValueLOONG64_OpLOONG64MOVHUload(v *Value) bool {
  3849  	v_1 := v.Args[1]
  3850  	v_0 := v.Args[0]
  3851  	b := v.Block
  3852  	config := b.Func.Config
  3853  	typ := &b.Func.Config.Types
  3854  	// match: (MOVHUload [off] {sym} ptr (MOVHstore [off] {sym} ptr x _))
  3855  	// result: (MOVHUreg x)
  3856  	for {
  3857  		off := auxIntToInt32(v.AuxInt)
  3858  		sym := auxToSym(v.Aux)
  3859  		ptr := v_0
  3860  		if v_1.Op != OpLOONG64MOVHstore || auxIntToInt32(v_1.AuxInt) != off || auxToSym(v_1.Aux) != sym {
  3861  			break
  3862  		}
  3863  		x := v_1.Args[1]
  3864  		if ptr != v_1.Args[0] {
  3865  			break
  3866  		}
  3867  		v.reset(OpLOONG64MOVHUreg)
  3868  		v.AddArg(x)
  3869  		return true
  3870  	}
  3871  	// match: (MOVHUload [off1] {sym} (ADDVconst [off2] ptr) mem)
  3872  	// cond: is32Bit(int64(off1)+off2) && (ptr.Op != OpSB || !config.ctxt.Flag_dynlink)
  3873  	// result: (MOVHUload [off1+int32(off2)] {sym} ptr mem)
  3874  	for {
  3875  		off1 := auxIntToInt32(v.AuxInt)
  3876  		sym := auxToSym(v.Aux)
  3877  		if v_0.Op != OpLOONG64ADDVconst {
  3878  			break
  3879  		}
  3880  		off2 := auxIntToInt64(v_0.AuxInt)
  3881  		ptr := v_0.Args[0]
  3882  		mem := v_1
  3883  		if !(is32Bit(int64(off1)+off2) && (ptr.Op != OpSB || !config.ctxt.Flag_dynlink)) {
  3884  			break
  3885  		}
  3886  		v.reset(OpLOONG64MOVHUload)
  3887  		v.AuxInt = int32ToAuxInt(off1 + int32(off2))
  3888  		v.Aux = symToAux(sym)
  3889  		v.AddArg2(ptr, mem)
  3890  		return true
  3891  	}
  3892  	// match: (MOVHUload [off1] {sym1} (MOVVaddr [off2] {sym2} ptr) mem)
  3893  	// cond: canMergeSym(sym1,sym2) && is32Bit(int64(off1)+int64(off2)) && (ptr.Op != OpSB || !config.ctxt.Flag_dynlink)
  3894  	// result: (MOVHUload [off1+int32(off2)] {mergeSym(sym1,sym2)} ptr mem)
  3895  	for {
  3896  		off1 := auxIntToInt32(v.AuxInt)
  3897  		sym1 := auxToSym(v.Aux)
  3898  		if v_0.Op != OpLOONG64MOVVaddr {
  3899  			break
  3900  		}
  3901  		off2 := auxIntToInt32(v_0.AuxInt)
  3902  		sym2 := auxToSym(v_0.Aux)
  3903  		ptr := v_0.Args[0]
  3904  		mem := v_1
  3905  		if !(canMergeSym(sym1, sym2) && is32Bit(int64(off1)+int64(off2)) && (ptr.Op != OpSB || !config.ctxt.Flag_dynlink)) {
  3906  			break
  3907  		}
  3908  		v.reset(OpLOONG64MOVHUload)
  3909  		v.AuxInt = int32ToAuxInt(off1 + int32(off2))
  3910  		v.Aux = symToAux(mergeSym(sym1, sym2))
  3911  		v.AddArg2(ptr, mem)
  3912  		return true
  3913  	}
  3914  	// match: (MOVHUload [off] {sym} (ADDV ptr idx) mem)
  3915  	// cond: off == 0 && sym == nil
  3916  	// result: (MOVHUloadidx ptr idx mem)
  3917  	for {
  3918  		off := auxIntToInt32(v.AuxInt)
  3919  		sym := auxToSym(v.Aux)
  3920  		if v_0.Op != OpLOONG64ADDV {
  3921  			break
  3922  		}
  3923  		idx := v_0.Args[1]
  3924  		ptr := v_0.Args[0]
  3925  		mem := v_1
  3926  		if !(off == 0 && sym == nil) {
  3927  			break
  3928  		}
  3929  		v.reset(OpLOONG64MOVHUloadidx)
  3930  		v.AddArg3(ptr, idx, mem)
  3931  		return true
  3932  	}
  3933  	// match: (MOVHUload [off] {sym} (ADDshiftLLV [shift] ptr idx) mem)
  3934  	// cond: off == 0 && sym == nil
  3935  	// result: (MOVHUloadidx ptr (SLLVconst <typ.Int64> [shift] idx) mem)
  3936  	for {
  3937  		off := auxIntToInt32(v.AuxInt)
  3938  		sym := auxToSym(v.Aux)
  3939  		if v_0.Op != OpLOONG64ADDshiftLLV {
  3940  			break
  3941  		}
  3942  		shift := auxIntToInt64(v_0.AuxInt)
  3943  		idx := v_0.Args[1]
  3944  		ptr := v_0.Args[0]
  3945  		mem := v_1
  3946  		if !(off == 0 && sym == nil) {
  3947  			break
  3948  		}
  3949  		v.reset(OpLOONG64MOVHUloadidx)
  3950  		v0 := b.NewValue0(v.Pos, OpLOONG64SLLVconst, typ.Int64)
  3951  		v0.AuxInt = int64ToAuxInt(shift)
  3952  		v0.AddArg(idx)
  3953  		v.AddArg3(ptr, v0, mem)
  3954  		return true
  3955  	}
  3956  	// match: (MOVHUload [off] {sym} (SB) _)
  3957  	// cond: symIsRO(sym)
  3958  	// result: (MOVVconst [int64(read16(sym, int64(off), config.ctxt.Arch.ByteOrder))])
  3959  	for {
  3960  		off := auxIntToInt32(v.AuxInt)
  3961  		sym := auxToSym(v.Aux)
  3962  		if v_0.Op != OpSB || !(symIsRO(sym)) {
  3963  			break
  3964  		}
  3965  		v.reset(OpLOONG64MOVVconst)
  3966  		v.AuxInt = int64ToAuxInt(int64(read16(sym, int64(off), config.ctxt.Arch.ByteOrder)))
  3967  		return true
  3968  	}
  3969  	return false
  3970  }
  3971  func rewriteValueLOONG64_OpLOONG64MOVHUloadidx(v *Value) bool {
  3972  	v_2 := v.Args[2]
  3973  	v_1 := v.Args[1]
  3974  	v_0 := v.Args[0]
  3975  	// match: (MOVHUloadidx ptr (MOVVconst [c]) mem)
  3976  	// cond: is32Bit(c)
  3977  	// result: (MOVHUload [int32(c)] ptr mem)
  3978  	for {
  3979  		ptr := v_0
  3980  		if v_1.Op != OpLOONG64MOVVconst {
  3981  			break
  3982  		}
  3983  		c := auxIntToInt64(v_1.AuxInt)
  3984  		mem := v_2
  3985  		if !(is32Bit(c)) {
  3986  			break
  3987  		}
  3988  		v.reset(OpLOONG64MOVHUload)
  3989  		v.AuxInt = int32ToAuxInt(int32(c))
  3990  		v.AddArg2(ptr, mem)
  3991  		return true
  3992  	}
  3993  	// match: (MOVHUloadidx (MOVVconst [c]) ptr mem)
  3994  	// cond: is32Bit(c)
  3995  	// result: (MOVHUload [int32(c)] ptr mem)
  3996  	for {
  3997  		if v_0.Op != OpLOONG64MOVVconst {
  3998  			break
  3999  		}
  4000  		c := auxIntToInt64(v_0.AuxInt)
  4001  		ptr := v_1
  4002  		mem := v_2
  4003  		if !(is32Bit(c)) {
  4004  			break
  4005  		}
  4006  		v.reset(OpLOONG64MOVHUload)
  4007  		v.AuxInt = int32ToAuxInt(int32(c))
  4008  		v.AddArg2(ptr, mem)
  4009  		return true
  4010  	}
  4011  	return false
  4012  }
  4013  func rewriteValueLOONG64_OpLOONG64MOVHUreg(v *Value) bool {
  4014  	v_0 := v.Args[0]
  4015  	// match: (MOVHUreg (SRLVconst [rc] x))
  4016  	// cond: rc < 16
  4017  	// result: (BSTRPICKV [rc + (15+rc)<<6] x)
  4018  	for {
  4019  		if v_0.Op != OpLOONG64SRLVconst {
  4020  			break
  4021  		}
  4022  		rc := auxIntToInt64(v_0.AuxInt)
  4023  		x := v_0.Args[0]
  4024  		if !(rc < 16) {
  4025  			break
  4026  		}
  4027  		v.reset(OpLOONG64BSTRPICKV)
  4028  		v.AuxInt = int64ToAuxInt(rc + (15+rc)<<6)
  4029  		v.AddArg(x)
  4030  		return true
  4031  	}
  4032  	// match: (MOVHUreg x:(MOVBUload _ _))
  4033  	// result: (MOVVreg x)
  4034  	for {
  4035  		x := v_0
  4036  		if x.Op != OpLOONG64MOVBUload {
  4037  			break
  4038  		}
  4039  		v.reset(OpLOONG64MOVVreg)
  4040  		v.AddArg(x)
  4041  		return true
  4042  	}
  4043  	// match: (MOVHUreg x:(MOVHUload _ _))
  4044  	// result: (MOVVreg x)
  4045  	for {
  4046  		x := v_0
  4047  		if x.Op != OpLOONG64MOVHUload {
  4048  			break
  4049  		}
  4050  		v.reset(OpLOONG64MOVVreg)
  4051  		v.AddArg(x)
  4052  		return true
  4053  	}
  4054  	// match: (MOVHUreg x:(MOVBUloadidx _ _ _))
  4055  	// result: (MOVVreg x)
  4056  	for {
  4057  		x := v_0
  4058  		if x.Op != OpLOONG64MOVBUloadidx {
  4059  			break
  4060  		}
  4061  		v.reset(OpLOONG64MOVVreg)
  4062  		v.AddArg(x)
  4063  		return true
  4064  	}
  4065  	// match: (MOVHUreg x:(MOVHUloadidx _ _ _))
  4066  	// result: (MOVVreg x)
  4067  	for {
  4068  		x := v_0
  4069  		if x.Op != OpLOONG64MOVHUloadidx {
  4070  			break
  4071  		}
  4072  		v.reset(OpLOONG64MOVVreg)
  4073  		v.AddArg(x)
  4074  		return true
  4075  	}
  4076  	// match: (MOVHUreg x:(MOVBUreg _))
  4077  	// result: (MOVVreg x)
  4078  	for {
  4079  		x := v_0
  4080  		if x.Op != OpLOONG64MOVBUreg {
  4081  			break
  4082  		}
  4083  		v.reset(OpLOONG64MOVVreg)
  4084  		v.AddArg(x)
  4085  		return true
  4086  	}
  4087  	// match: (MOVHUreg x:(MOVHUreg _))
  4088  	// result: (MOVVreg x)
  4089  	for {
  4090  		x := v_0
  4091  		if x.Op != OpLOONG64MOVHUreg {
  4092  			break
  4093  		}
  4094  		v.reset(OpLOONG64MOVVreg)
  4095  		v.AddArg(x)
  4096  		return true
  4097  	}
  4098  	// match: (MOVHUreg (SLLVconst [lc] x))
  4099  	// cond: lc >= 16
  4100  	// result: (MOVVconst [0])
  4101  	for {
  4102  		if v_0.Op != OpLOONG64SLLVconst {
  4103  			break
  4104  		}
  4105  		lc := auxIntToInt64(v_0.AuxInt)
  4106  		if !(lc >= 16) {
  4107  			break
  4108  		}
  4109  		v.reset(OpLOONG64MOVVconst)
  4110  		v.AuxInt = int64ToAuxInt(0)
  4111  		return true
  4112  	}
  4113  	// match: (MOVHUreg (MOVVconst [c]))
  4114  	// result: (MOVVconst [int64(uint16(c))])
  4115  	for {
  4116  		if v_0.Op != OpLOONG64MOVVconst {
  4117  			break
  4118  		}
  4119  		c := auxIntToInt64(v_0.AuxInt)
  4120  		v.reset(OpLOONG64MOVVconst)
  4121  		v.AuxInt = int64ToAuxInt(int64(uint16(c)))
  4122  		return true
  4123  	}
  4124  	// match: (MOVHUreg x:(SRLconst [c] y))
  4125  	// cond: c >= 16
  4126  	// result: x
  4127  	for {
  4128  		x := v_0
  4129  		if x.Op != OpLOONG64SRLconst {
  4130  			break
  4131  		}
  4132  		c := auxIntToInt64(x.AuxInt)
  4133  		if !(c >= 16) {
  4134  			break
  4135  		}
  4136  		v.copyOf(x)
  4137  		return true
  4138  	}
  4139  	// match: (MOVHUreg x:(ANDconst [c] y))
  4140  	// cond: c >= 0 && int64(uint16(c)) == c
  4141  	// result: x
  4142  	for {
  4143  		x := v_0
  4144  		if x.Op != OpLOONG64ANDconst {
  4145  			break
  4146  		}
  4147  		c := auxIntToInt64(x.AuxInt)
  4148  		if !(c >= 0 && int64(uint16(c)) == c) {
  4149  			break
  4150  		}
  4151  		v.copyOf(x)
  4152  		return true
  4153  	}
  4154  	return false
  4155  }
  4156  func rewriteValueLOONG64_OpLOONG64MOVHload(v *Value) bool {
  4157  	v_1 := v.Args[1]
  4158  	v_0 := v.Args[0]
  4159  	b := v.Block
  4160  	config := b.Func.Config
  4161  	typ := &b.Func.Config.Types
  4162  	// match: (MOVHload [off] {sym} ptr (MOVHstore [off] {sym} ptr x _))
  4163  	// result: (MOVHreg x)
  4164  	for {
  4165  		off := auxIntToInt32(v.AuxInt)
  4166  		sym := auxToSym(v.Aux)
  4167  		ptr := v_0
  4168  		if v_1.Op != OpLOONG64MOVHstore || auxIntToInt32(v_1.AuxInt) != off || auxToSym(v_1.Aux) != sym {
  4169  			break
  4170  		}
  4171  		x := v_1.Args[1]
  4172  		if ptr != v_1.Args[0] {
  4173  			break
  4174  		}
  4175  		v.reset(OpLOONG64MOVHreg)
  4176  		v.AddArg(x)
  4177  		return true
  4178  	}
  4179  	// match: (MOVHload [off1] {sym} (ADDVconst [off2] ptr) mem)
  4180  	// cond: is32Bit(int64(off1)+off2) && (ptr.Op != OpSB || !config.ctxt.Flag_dynlink)
  4181  	// result: (MOVHload [off1+int32(off2)] {sym} ptr mem)
  4182  	for {
  4183  		off1 := auxIntToInt32(v.AuxInt)
  4184  		sym := auxToSym(v.Aux)
  4185  		if v_0.Op != OpLOONG64ADDVconst {
  4186  			break
  4187  		}
  4188  		off2 := auxIntToInt64(v_0.AuxInt)
  4189  		ptr := v_0.Args[0]
  4190  		mem := v_1
  4191  		if !(is32Bit(int64(off1)+off2) && (ptr.Op != OpSB || !config.ctxt.Flag_dynlink)) {
  4192  			break
  4193  		}
  4194  		v.reset(OpLOONG64MOVHload)
  4195  		v.AuxInt = int32ToAuxInt(off1 + int32(off2))
  4196  		v.Aux = symToAux(sym)
  4197  		v.AddArg2(ptr, mem)
  4198  		return true
  4199  	}
  4200  	// match: (MOVHload [off1] {sym1} (MOVVaddr [off2] {sym2} ptr) mem)
  4201  	// cond: canMergeSym(sym1,sym2) && is32Bit(int64(off1)+int64(off2)) && (ptr.Op != OpSB || !config.ctxt.Flag_dynlink)
  4202  	// result: (MOVHload [off1+int32(off2)] {mergeSym(sym1,sym2)} ptr mem)
  4203  	for {
  4204  		off1 := auxIntToInt32(v.AuxInt)
  4205  		sym1 := auxToSym(v.Aux)
  4206  		if v_0.Op != OpLOONG64MOVVaddr {
  4207  			break
  4208  		}
  4209  		off2 := auxIntToInt32(v_0.AuxInt)
  4210  		sym2 := auxToSym(v_0.Aux)
  4211  		ptr := v_0.Args[0]
  4212  		mem := v_1
  4213  		if !(canMergeSym(sym1, sym2) && is32Bit(int64(off1)+int64(off2)) && (ptr.Op != OpSB || !config.ctxt.Flag_dynlink)) {
  4214  			break
  4215  		}
  4216  		v.reset(OpLOONG64MOVHload)
  4217  		v.AuxInt = int32ToAuxInt(off1 + int32(off2))
  4218  		v.Aux = symToAux(mergeSym(sym1, sym2))
  4219  		v.AddArg2(ptr, mem)
  4220  		return true
  4221  	}
  4222  	// match: (MOVHload [off] {sym} (ADDV ptr idx) mem)
  4223  	// cond: off == 0 && sym == nil
  4224  	// result: (MOVHloadidx ptr idx mem)
  4225  	for {
  4226  		off := auxIntToInt32(v.AuxInt)
  4227  		sym := auxToSym(v.Aux)
  4228  		if v_0.Op != OpLOONG64ADDV {
  4229  			break
  4230  		}
  4231  		idx := v_0.Args[1]
  4232  		ptr := v_0.Args[0]
  4233  		mem := v_1
  4234  		if !(off == 0 && sym == nil) {
  4235  			break
  4236  		}
  4237  		v.reset(OpLOONG64MOVHloadidx)
  4238  		v.AddArg3(ptr, idx, mem)
  4239  		return true
  4240  	}
  4241  	// match: (MOVHload [off] {sym} (ADDshiftLLV [shift] ptr idx) mem)
  4242  	// cond: off == 0 && sym == nil
  4243  	// result: (MOVHloadidx ptr (SLLVconst <typ.Int64> [shift] idx) mem)
  4244  	for {
  4245  		off := auxIntToInt32(v.AuxInt)
  4246  		sym := auxToSym(v.Aux)
  4247  		if v_0.Op != OpLOONG64ADDshiftLLV {
  4248  			break
  4249  		}
  4250  		shift := auxIntToInt64(v_0.AuxInt)
  4251  		idx := v_0.Args[1]
  4252  		ptr := v_0.Args[0]
  4253  		mem := v_1
  4254  		if !(off == 0 && sym == nil) {
  4255  			break
  4256  		}
  4257  		v.reset(OpLOONG64MOVHloadidx)
  4258  		v0 := b.NewValue0(v.Pos, OpLOONG64SLLVconst, typ.Int64)
  4259  		v0.AuxInt = int64ToAuxInt(shift)
  4260  		v0.AddArg(idx)
  4261  		v.AddArg3(ptr, v0, mem)
  4262  		return true
  4263  	}
  4264  	// match: (MOVHload [off] {sym} (SB) _)
  4265  	// cond: symIsRO(sym)
  4266  	// result: (MOVVconst [int64(int16(read16(sym, int64(off), config.ctxt.Arch.ByteOrder)))])
  4267  	for {
  4268  		off := auxIntToInt32(v.AuxInt)
  4269  		sym := auxToSym(v.Aux)
  4270  		if v_0.Op != OpSB || !(symIsRO(sym)) {
  4271  			break
  4272  		}
  4273  		v.reset(OpLOONG64MOVVconst)
  4274  		v.AuxInt = int64ToAuxInt(int64(int16(read16(sym, int64(off), config.ctxt.Arch.ByteOrder))))
  4275  		return true
  4276  	}
  4277  	return false
  4278  }
  4279  func rewriteValueLOONG64_OpLOONG64MOVHloadidx(v *Value) bool {
  4280  	v_2 := v.Args[2]
  4281  	v_1 := v.Args[1]
  4282  	v_0 := v.Args[0]
  4283  	// match: (MOVHloadidx ptr (MOVVconst [c]) mem)
  4284  	// cond: is32Bit(c)
  4285  	// result: (MOVHload [int32(c)] ptr mem)
  4286  	for {
  4287  		ptr := v_0
  4288  		if v_1.Op != OpLOONG64MOVVconst {
  4289  			break
  4290  		}
  4291  		c := auxIntToInt64(v_1.AuxInt)
  4292  		mem := v_2
  4293  		if !(is32Bit(c)) {
  4294  			break
  4295  		}
  4296  		v.reset(OpLOONG64MOVHload)
  4297  		v.AuxInt = int32ToAuxInt(int32(c))
  4298  		v.AddArg2(ptr, mem)
  4299  		return true
  4300  	}
  4301  	// match: (MOVHloadidx (MOVVconst [c]) ptr mem)
  4302  	// cond: is32Bit(c)
  4303  	// result: (MOVHload [int32(c)] ptr mem)
  4304  	for {
  4305  		if v_0.Op != OpLOONG64MOVVconst {
  4306  			break
  4307  		}
  4308  		c := auxIntToInt64(v_0.AuxInt)
  4309  		ptr := v_1
  4310  		mem := v_2
  4311  		if !(is32Bit(c)) {
  4312  			break
  4313  		}
  4314  		v.reset(OpLOONG64MOVHload)
  4315  		v.AuxInt = int32ToAuxInt(int32(c))
  4316  		v.AddArg2(ptr, mem)
  4317  		return true
  4318  	}
  4319  	return false
  4320  }
  4321  func rewriteValueLOONG64_OpLOONG64MOVHreg(v *Value) bool {
  4322  	v_0 := v.Args[0]
  4323  	// match: (MOVHreg x:(MOVBload _ _))
  4324  	// result: (MOVVreg x)
  4325  	for {
  4326  		x := v_0
  4327  		if x.Op != OpLOONG64MOVBload {
  4328  			break
  4329  		}
  4330  		v.reset(OpLOONG64MOVVreg)
  4331  		v.AddArg(x)
  4332  		return true
  4333  	}
  4334  	// match: (MOVHreg x:(MOVBUload _ _))
  4335  	// result: (MOVVreg x)
  4336  	for {
  4337  		x := v_0
  4338  		if x.Op != OpLOONG64MOVBUload {
  4339  			break
  4340  		}
  4341  		v.reset(OpLOONG64MOVVreg)
  4342  		v.AddArg(x)
  4343  		return true
  4344  	}
  4345  	// match: (MOVHreg x:(MOVHload _ _))
  4346  	// result: (MOVVreg x)
  4347  	for {
  4348  		x := v_0
  4349  		if x.Op != OpLOONG64MOVHload {
  4350  			break
  4351  		}
  4352  		v.reset(OpLOONG64MOVVreg)
  4353  		v.AddArg(x)
  4354  		return true
  4355  	}
  4356  	// match: (MOVHreg x:(MOVBloadidx _ _ _))
  4357  	// result: (MOVVreg x)
  4358  	for {
  4359  		x := v_0
  4360  		if x.Op != OpLOONG64MOVBloadidx {
  4361  			break
  4362  		}
  4363  		v.reset(OpLOONG64MOVVreg)
  4364  		v.AddArg(x)
  4365  		return true
  4366  	}
  4367  	// match: (MOVHreg x:(MOVBUloadidx _ _ _))
  4368  	// result: (MOVVreg x)
  4369  	for {
  4370  		x := v_0
  4371  		if x.Op != OpLOONG64MOVBUloadidx {
  4372  			break
  4373  		}
  4374  		v.reset(OpLOONG64MOVVreg)
  4375  		v.AddArg(x)
  4376  		return true
  4377  	}
  4378  	// match: (MOVHreg x:(MOVHloadidx _ _ _))
  4379  	// result: (MOVVreg x)
  4380  	for {
  4381  		x := v_0
  4382  		if x.Op != OpLOONG64MOVHloadidx {
  4383  			break
  4384  		}
  4385  		v.reset(OpLOONG64MOVVreg)
  4386  		v.AddArg(x)
  4387  		return true
  4388  	}
  4389  	// match: (MOVHreg x:(MOVBreg _))
  4390  	// result: (MOVVreg x)
  4391  	for {
  4392  		x := v_0
  4393  		if x.Op != OpLOONG64MOVBreg {
  4394  			break
  4395  		}
  4396  		v.reset(OpLOONG64MOVVreg)
  4397  		v.AddArg(x)
  4398  		return true
  4399  	}
  4400  	// match: (MOVHreg x:(MOVBUreg _))
  4401  	// result: (MOVVreg x)
  4402  	for {
  4403  		x := v_0
  4404  		if x.Op != OpLOONG64MOVBUreg {
  4405  			break
  4406  		}
  4407  		v.reset(OpLOONG64MOVVreg)
  4408  		v.AddArg(x)
  4409  		return true
  4410  	}
  4411  	// match: (MOVHreg x:(MOVHreg _))
  4412  	// result: (MOVVreg x)
  4413  	for {
  4414  		x := v_0
  4415  		if x.Op != OpLOONG64MOVHreg {
  4416  			break
  4417  		}
  4418  		v.reset(OpLOONG64MOVVreg)
  4419  		v.AddArg(x)
  4420  		return true
  4421  	}
  4422  	// match: (MOVHreg (MOVVconst [c]))
  4423  	// result: (MOVVconst [int64(int16(c))])
  4424  	for {
  4425  		if v_0.Op != OpLOONG64MOVVconst {
  4426  			break
  4427  		}
  4428  		c := auxIntToInt64(v_0.AuxInt)
  4429  		v.reset(OpLOONG64MOVVconst)
  4430  		v.AuxInt = int64ToAuxInt(int64(int16(c)))
  4431  		return true
  4432  	}
  4433  	// match: (MOVHreg x:(ANDconst [c] y))
  4434  	// cond: c >= 0 && int64(int16(c)) == c
  4435  	// result: x
  4436  	for {
  4437  		x := v_0
  4438  		if x.Op != OpLOONG64ANDconst {
  4439  			break
  4440  		}
  4441  		c := auxIntToInt64(x.AuxInt)
  4442  		if !(c >= 0 && int64(int16(c)) == c) {
  4443  			break
  4444  		}
  4445  		v.copyOf(x)
  4446  		return true
  4447  	}
  4448  	return false
  4449  }
  4450  func rewriteValueLOONG64_OpLOONG64MOVHstore(v *Value) bool {
  4451  	v_2 := v.Args[2]
  4452  	v_1 := v.Args[1]
  4453  	v_0 := v.Args[0]
  4454  	b := v.Block
  4455  	config := b.Func.Config
  4456  	typ := &b.Func.Config.Types
  4457  	// match: (MOVHstore [off1] {sym} (ADDVconst [off2] ptr) val mem)
  4458  	// cond: is32Bit(int64(off1)+off2) && (ptr.Op != OpSB || !config.ctxt.Flag_dynlink)
  4459  	// result: (MOVHstore [off1+int32(off2)] {sym} ptr val mem)
  4460  	for {
  4461  		off1 := auxIntToInt32(v.AuxInt)
  4462  		sym := auxToSym(v.Aux)
  4463  		if v_0.Op != OpLOONG64ADDVconst {
  4464  			break
  4465  		}
  4466  		off2 := auxIntToInt64(v_0.AuxInt)
  4467  		ptr := v_0.Args[0]
  4468  		val := v_1
  4469  		mem := v_2
  4470  		if !(is32Bit(int64(off1)+off2) && (ptr.Op != OpSB || !config.ctxt.Flag_dynlink)) {
  4471  			break
  4472  		}
  4473  		v.reset(OpLOONG64MOVHstore)
  4474  		v.AuxInt = int32ToAuxInt(off1 + int32(off2))
  4475  		v.Aux = symToAux(sym)
  4476  		v.AddArg3(ptr, val, mem)
  4477  		return true
  4478  	}
  4479  	// match: (MOVHstore [off1] {sym1} (MOVVaddr [off2] {sym2} ptr) val mem)
  4480  	// cond: canMergeSym(sym1,sym2) && is32Bit(int64(off1)+int64(off2)) && (ptr.Op != OpSB || !config.ctxt.Flag_dynlink)
  4481  	// result: (MOVHstore [off1+int32(off2)] {mergeSym(sym1,sym2)} ptr val mem)
  4482  	for {
  4483  		off1 := auxIntToInt32(v.AuxInt)
  4484  		sym1 := auxToSym(v.Aux)
  4485  		if v_0.Op != OpLOONG64MOVVaddr {
  4486  			break
  4487  		}
  4488  		off2 := auxIntToInt32(v_0.AuxInt)
  4489  		sym2 := auxToSym(v_0.Aux)
  4490  		ptr := v_0.Args[0]
  4491  		val := v_1
  4492  		mem := v_2
  4493  		if !(canMergeSym(sym1, sym2) && is32Bit(int64(off1)+int64(off2)) && (ptr.Op != OpSB || !config.ctxt.Flag_dynlink)) {
  4494  			break
  4495  		}
  4496  		v.reset(OpLOONG64MOVHstore)
  4497  		v.AuxInt = int32ToAuxInt(off1 + int32(off2))
  4498  		v.Aux = symToAux(mergeSym(sym1, sym2))
  4499  		v.AddArg3(ptr, val, mem)
  4500  		return true
  4501  	}
  4502  	// match: (MOVHstore [off] {sym} ptr (MOVHreg x) mem)
  4503  	// result: (MOVHstore [off] {sym} ptr x mem)
  4504  	for {
  4505  		off := auxIntToInt32(v.AuxInt)
  4506  		sym := auxToSym(v.Aux)
  4507  		ptr := v_0
  4508  		if v_1.Op != OpLOONG64MOVHreg {
  4509  			break
  4510  		}
  4511  		x := v_1.Args[0]
  4512  		mem := v_2
  4513  		v.reset(OpLOONG64MOVHstore)
  4514  		v.AuxInt = int32ToAuxInt(off)
  4515  		v.Aux = symToAux(sym)
  4516  		v.AddArg3(ptr, x, mem)
  4517  		return true
  4518  	}
  4519  	// match: (MOVHstore [off] {sym} ptr (MOVHUreg x) mem)
  4520  	// result: (MOVHstore [off] {sym} ptr x mem)
  4521  	for {
  4522  		off := auxIntToInt32(v.AuxInt)
  4523  		sym := auxToSym(v.Aux)
  4524  		ptr := v_0
  4525  		if v_1.Op != OpLOONG64MOVHUreg {
  4526  			break
  4527  		}
  4528  		x := v_1.Args[0]
  4529  		mem := v_2
  4530  		v.reset(OpLOONG64MOVHstore)
  4531  		v.AuxInt = int32ToAuxInt(off)
  4532  		v.Aux = symToAux(sym)
  4533  		v.AddArg3(ptr, x, mem)
  4534  		return true
  4535  	}
  4536  	// match: (MOVHstore [off] {sym} ptr (MOVWreg x) mem)
  4537  	// result: (MOVHstore [off] {sym} ptr x mem)
  4538  	for {
  4539  		off := auxIntToInt32(v.AuxInt)
  4540  		sym := auxToSym(v.Aux)
  4541  		ptr := v_0
  4542  		if v_1.Op != OpLOONG64MOVWreg {
  4543  			break
  4544  		}
  4545  		x := v_1.Args[0]
  4546  		mem := v_2
  4547  		v.reset(OpLOONG64MOVHstore)
  4548  		v.AuxInt = int32ToAuxInt(off)
  4549  		v.Aux = symToAux(sym)
  4550  		v.AddArg3(ptr, x, mem)
  4551  		return true
  4552  	}
  4553  	// match: (MOVHstore [off] {sym} ptr (MOVWUreg x) mem)
  4554  	// result: (MOVHstore [off] {sym} ptr x mem)
  4555  	for {
  4556  		off := auxIntToInt32(v.AuxInt)
  4557  		sym := auxToSym(v.Aux)
  4558  		ptr := v_0
  4559  		if v_1.Op != OpLOONG64MOVWUreg {
  4560  			break
  4561  		}
  4562  		x := v_1.Args[0]
  4563  		mem := v_2
  4564  		v.reset(OpLOONG64MOVHstore)
  4565  		v.AuxInt = int32ToAuxInt(off)
  4566  		v.Aux = symToAux(sym)
  4567  		v.AddArg3(ptr, x, mem)
  4568  		return true
  4569  	}
  4570  	// match: (MOVHstore [off] {sym} (ADDV ptr idx) val mem)
  4571  	// cond: off == 0 && sym == nil
  4572  	// result: (MOVHstoreidx ptr idx val mem)
  4573  	for {
  4574  		off := auxIntToInt32(v.AuxInt)
  4575  		sym := auxToSym(v.Aux)
  4576  		if v_0.Op != OpLOONG64ADDV {
  4577  			break
  4578  		}
  4579  		idx := v_0.Args[1]
  4580  		ptr := v_0.Args[0]
  4581  		val := v_1
  4582  		mem := v_2
  4583  		if !(off == 0 && sym == nil) {
  4584  			break
  4585  		}
  4586  		v.reset(OpLOONG64MOVHstoreidx)
  4587  		v.AddArg4(ptr, idx, val, mem)
  4588  		return true
  4589  	}
  4590  	// match: (MOVHstore [off] {sym} (ADDshiftLLV [shift] ptr idx) val mem)
  4591  	// cond: off == 0 && sym == nil
  4592  	// result: (MOVHstoreidx ptr (SLLVconst <typ.Int64> [shift] idx) val mem)
  4593  	for {
  4594  		off := auxIntToInt32(v.AuxInt)
  4595  		sym := auxToSym(v.Aux)
  4596  		if v_0.Op != OpLOONG64ADDshiftLLV {
  4597  			break
  4598  		}
  4599  		shift := auxIntToInt64(v_0.AuxInt)
  4600  		idx := v_0.Args[1]
  4601  		ptr := v_0.Args[0]
  4602  		val := v_1
  4603  		mem := v_2
  4604  		if !(off == 0 && sym == nil) {
  4605  			break
  4606  		}
  4607  		v.reset(OpLOONG64MOVHstoreidx)
  4608  		v0 := b.NewValue0(v.Pos, OpLOONG64SLLVconst, typ.Int64)
  4609  		v0.AuxInt = int64ToAuxInt(shift)
  4610  		v0.AddArg(idx)
  4611  		v.AddArg4(ptr, v0, val, mem)
  4612  		return true
  4613  	}
  4614  	return false
  4615  }
  4616  func rewriteValueLOONG64_OpLOONG64MOVHstoreidx(v *Value) bool {
  4617  	v_3 := v.Args[3]
  4618  	v_2 := v.Args[2]
  4619  	v_1 := v.Args[1]
  4620  	v_0 := v.Args[0]
  4621  	// match: (MOVHstoreidx ptr (MOVVconst [c]) val mem)
  4622  	// cond: is32Bit(c)
  4623  	// result: (MOVHstore [int32(c)] ptr val mem)
  4624  	for {
  4625  		ptr := v_0
  4626  		if v_1.Op != OpLOONG64MOVVconst {
  4627  			break
  4628  		}
  4629  		c := auxIntToInt64(v_1.AuxInt)
  4630  		val := v_2
  4631  		mem := v_3
  4632  		if !(is32Bit(c)) {
  4633  			break
  4634  		}
  4635  		v.reset(OpLOONG64MOVHstore)
  4636  		v.AuxInt = int32ToAuxInt(int32(c))
  4637  		v.AddArg3(ptr, val, mem)
  4638  		return true
  4639  	}
  4640  	// match: (MOVHstoreidx (MOVVconst [c]) idx val mem)
  4641  	// cond: is32Bit(c)
  4642  	// result: (MOVHstore [int32(c)] idx val mem)
  4643  	for {
  4644  		if v_0.Op != OpLOONG64MOVVconst {
  4645  			break
  4646  		}
  4647  		c := auxIntToInt64(v_0.AuxInt)
  4648  		idx := v_1
  4649  		val := v_2
  4650  		mem := v_3
  4651  		if !(is32Bit(c)) {
  4652  			break
  4653  		}
  4654  		v.reset(OpLOONG64MOVHstore)
  4655  		v.AuxInt = int32ToAuxInt(int32(c))
  4656  		v.AddArg3(idx, val, mem)
  4657  		return true
  4658  	}
  4659  	return false
  4660  }
  4661  func rewriteValueLOONG64_OpLOONG64MOVVload(v *Value) bool {
  4662  	v_1 := v.Args[1]
  4663  	v_0 := v.Args[0]
  4664  	b := v.Block
  4665  	config := b.Func.Config
  4666  	typ := &b.Func.Config.Types
  4667  	// match: (MOVVload [off] {sym} ptr (MOVDstore [off] {sym} ptr val _))
  4668  	// result: (MOVVfpgp val)
  4669  	for {
  4670  		off := auxIntToInt32(v.AuxInt)
  4671  		sym := auxToSym(v.Aux)
  4672  		ptr := v_0
  4673  		if v_1.Op != OpLOONG64MOVDstore || auxIntToInt32(v_1.AuxInt) != off || auxToSym(v_1.Aux) != sym {
  4674  			break
  4675  		}
  4676  		val := v_1.Args[1]
  4677  		if ptr != v_1.Args[0] {
  4678  			break
  4679  		}
  4680  		v.reset(OpLOONG64MOVVfpgp)
  4681  		v.AddArg(val)
  4682  		return true
  4683  	}
  4684  	// match: (MOVVload [off] {sym} ptr (MOVVstore [off] {sym} ptr x _))
  4685  	// result: (MOVVreg x)
  4686  	for {
  4687  		off := auxIntToInt32(v.AuxInt)
  4688  		sym := auxToSym(v.Aux)
  4689  		ptr := v_0
  4690  		if v_1.Op != OpLOONG64MOVVstore || auxIntToInt32(v_1.AuxInt) != off || auxToSym(v_1.Aux) != sym {
  4691  			break
  4692  		}
  4693  		x := v_1.Args[1]
  4694  		if ptr != v_1.Args[0] {
  4695  			break
  4696  		}
  4697  		v.reset(OpLOONG64MOVVreg)
  4698  		v.AddArg(x)
  4699  		return true
  4700  	}
  4701  	// match: (MOVVload [off1] {sym} (ADDVconst [off2] ptr) mem)
  4702  	// cond: is32Bit(int64(off1)+off2) && (ptr.Op != OpSB || !config.ctxt.Flag_dynlink)
  4703  	// result: (MOVVload [off1+int32(off2)] {sym} ptr mem)
  4704  	for {
  4705  		off1 := auxIntToInt32(v.AuxInt)
  4706  		sym := auxToSym(v.Aux)
  4707  		if v_0.Op != OpLOONG64ADDVconst {
  4708  			break
  4709  		}
  4710  		off2 := auxIntToInt64(v_0.AuxInt)
  4711  		ptr := v_0.Args[0]
  4712  		mem := v_1
  4713  		if !(is32Bit(int64(off1)+off2) && (ptr.Op != OpSB || !config.ctxt.Flag_dynlink)) {
  4714  			break
  4715  		}
  4716  		v.reset(OpLOONG64MOVVload)
  4717  		v.AuxInt = int32ToAuxInt(off1 + int32(off2))
  4718  		v.Aux = symToAux(sym)
  4719  		v.AddArg2(ptr, mem)
  4720  		return true
  4721  	}
  4722  	// match: (MOVVload [off1] {sym1} (MOVVaddr [off2] {sym2} ptr) mem)
  4723  	// cond: canMergeSym(sym1,sym2) && is32Bit(int64(off1)+int64(off2)) && (ptr.Op != OpSB || !config.ctxt.Flag_dynlink)
  4724  	// result: (MOVVload [off1+int32(off2)] {mergeSym(sym1,sym2)} ptr mem)
  4725  	for {
  4726  		off1 := auxIntToInt32(v.AuxInt)
  4727  		sym1 := auxToSym(v.Aux)
  4728  		if v_0.Op != OpLOONG64MOVVaddr {
  4729  			break
  4730  		}
  4731  		off2 := auxIntToInt32(v_0.AuxInt)
  4732  		sym2 := auxToSym(v_0.Aux)
  4733  		ptr := v_0.Args[0]
  4734  		mem := v_1
  4735  		if !(canMergeSym(sym1, sym2) && is32Bit(int64(off1)+int64(off2)) && (ptr.Op != OpSB || !config.ctxt.Flag_dynlink)) {
  4736  			break
  4737  		}
  4738  		v.reset(OpLOONG64MOVVload)
  4739  		v.AuxInt = int32ToAuxInt(off1 + int32(off2))
  4740  		v.Aux = symToAux(mergeSym(sym1, sym2))
  4741  		v.AddArg2(ptr, mem)
  4742  		return true
  4743  	}
  4744  	// match: (MOVVload [off] {sym} (ADDV ptr idx) mem)
  4745  	// cond: off == 0 && sym == nil
  4746  	// result: (MOVVloadidx ptr idx mem)
  4747  	for {
  4748  		off := auxIntToInt32(v.AuxInt)
  4749  		sym := auxToSym(v.Aux)
  4750  		if v_0.Op != OpLOONG64ADDV {
  4751  			break
  4752  		}
  4753  		idx := v_0.Args[1]
  4754  		ptr := v_0.Args[0]
  4755  		mem := v_1
  4756  		if !(off == 0 && sym == nil) {
  4757  			break
  4758  		}
  4759  		v.reset(OpLOONG64MOVVloadidx)
  4760  		v.AddArg3(ptr, idx, mem)
  4761  		return true
  4762  	}
  4763  	// match: (MOVVload [off] {sym} (ADDshiftLLV [shift] ptr idx) mem)
  4764  	// cond: off == 0 && sym == nil
  4765  	// result: (MOVVloadidx ptr (SLLVconst <typ.Int64> [shift] idx) mem)
  4766  	for {
  4767  		off := auxIntToInt32(v.AuxInt)
  4768  		sym := auxToSym(v.Aux)
  4769  		if v_0.Op != OpLOONG64ADDshiftLLV {
  4770  			break
  4771  		}
  4772  		shift := auxIntToInt64(v_0.AuxInt)
  4773  		idx := v_0.Args[1]
  4774  		ptr := v_0.Args[0]
  4775  		mem := v_1
  4776  		if !(off == 0 && sym == nil) {
  4777  			break
  4778  		}
  4779  		v.reset(OpLOONG64MOVVloadidx)
  4780  		v0 := b.NewValue0(v.Pos, OpLOONG64SLLVconst, typ.Int64)
  4781  		v0.AuxInt = int64ToAuxInt(shift)
  4782  		v0.AddArg(idx)
  4783  		v.AddArg3(ptr, v0, mem)
  4784  		return true
  4785  	}
  4786  	// match: (MOVVload [off] {sym} (SB) _)
  4787  	// cond: symIsRO(sym)
  4788  	// result: (MOVVconst [int64(read64(sym, int64(off), config.ctxt.Arch.ByteOrder))])
  4789  	for {
  4790  		off := auxIntToInt32(v.AuxInt)
  4791  		sym := auxToSym(v.Aux)
  4792  		if v_0.Op != OpSB || !(symIsRO(sym)) {
  4793  			break
  4794  		}
  4795  		v.reset(OpLOONG64MOVVconst)
  4796  		v.AuxInt = int64ToAuxInt(int64(read64(sym, int64(off), config.ctxt.Arch.ByteOrder)))
  4797  		return true
  4798  	}
  4799  	return false
  4800  }
  4801  func rewriteValueLOONG64_OpLOONG64MOVVloadidx(v *Value) bool {
  4802  	v_2 := v.Args[2]
  4803  	v_1 := v.Args[1]
  4804  	v_0 := v.Args[0]
  4805  	// match: (MOVVloadidx ptr (MOVVconst [c]) mem)
  4806  	// cond: is32Bit(c)
  4807  	// result: (MOVVload [int32(c)] ptr mem)
  4808  	for {
  4809  		ptr := v_0
  4810  		if v_1.Op != OpLOONG64MOVVconst {
  4811  			break
  4812  		}
  4813  		c := auxIntToInt64(v_1.AuxInt)
  4814  		mem := v_2
  4815  		if !(is32Bit(c)) {
  4816  			break
  4817  		}
  4818  		v.reset(OpLOONG64MOVVload)
  4819  		v.AuxInt = int32ToAuxInt(int32(c))
  4820  		v.AddArg2(ptr, mem)
  4821  		return true
  4822  	}
  4823  	// match: (MOVVloadidx (MOVVconst [c]) ptr mem)
  4824  	// cond: is32Bit(c)
  4825  	// result: (MOVVload [int32(c)] ptr mem)
  4826  	for {
  4827  		if v_0.Op != OpLOONG64MOVVconst {
  4828  			break
  4829  		}
  4830  		c := auxIntToInt64(v_0.AuxInt)
  4831  		ptr := v_1
  4832  		mem := v_2
  4833  		if !(is32Bit(c)) {
  4834  			break
  4835  		}
  4836  		v.reset(OpLOONG64MOVVload)
  4837  		v.AuxInt = int32ToAuxInt(int32(c))
  4838  		v.AddArg2(ptr, mem)
  4839  		return true
  4840  	}
  4841  	return false
  4842  }
  4843  func rewriteValueLOONG64_OpLOONG64MOVVnop(v *Value) bool {
  4844  	v_0 := v.Args[0]
  4845  	// match: (MOVVnop (MOVVconst [c]))
  4846  	// result: (MOVVconst [c])
  4847  	for {
  4848  		if v_0.Op != OpLOONG64MOVVconst {
  4849  			break
  4850  		}
  4851  		c := auxIntToInt64(v_0.AuxInt)
  4852  		v.reset(OpLOONG64MOVVconst)
  4853  		v.AuxInt = int64ToAuxInt(c)
  4854  		return true
  4855  	}
  4856  	return false
  4857  }
  4858  func rewriteValueLOONG64_OpLOONG64MOVVreg(v *Value) bool {
  4859  	v_0 := v.Args[0]
  4860  	// match: (MOVVreg x)
  4861  	// cond: x.Uses == 1
  4862  	// result: (MOVVnop x)
  4863  	for {
  4864  		x := v_0
  4865  		if !(x.Uses == 1) {
  4866  			break
  4867  		}
  4868  		v.reset(OpLOONG64MOVVnop)
  4869  		v.AddArg(x)
  4870  		return true
  4871  	}
  4872  	// match: (MOVVreg (MOVVconst [c]))
  4873  	// result: (MOVVconst [c])
  4874  	for {
  4875  		if v_0.Op != OpLOONG64MOVVconst {
  4876  			break
  4877  		}
  4878  		c := auxIntToInt64(v_0.AuxInt)
  4879  		v.reset(OpLOONG64MOVVconst)
  4880  		v.AuxInt = int64ToAuxInt(c)
  4881  		return true
  4882  	}
  4883  	return false
  4884  }
  4885  func rewriteValueLOONG64_OpLOONG64MOVVstore(v *Value) bool {
  4886  	v_2 := v.Args[2]
  4887  	v_1 := v.Args[1]
  4888  	v_0 := v.Args[0]
  4889  	b := v.Block
  4890  	config := b.Func.Config
  4891  	typ := &b.Func.Config.Types
  4892  	// match: (MOVVstore [off] {sym} ptr (MOVVfpgp val) mem)
  4893  	// result: (MOVDstore [off] {sym} ptr val mem)
  4894  	for {
  4895  		off := auxIntToInt32(v.AuxInt)
  4896  		sym := auxToSym(v.Aux)
  4897  		ptr := v_0
  4898  		if v_1.Op != OpLOONG64MOVVfpgp {
  4899  			break
  4900  		}
  4901  		val := v_1.Args[0]
  4902  		mem := v_2
  4903  		v.reset(OpLOONG64MOVDstore)
  4904  		v.AuxInt = int32ToAuxInt(off)
  4905  		v.Aux = symToAux(sym)
  4906  		v.AddArg3(ptr, val, mem)
  4907  		return true
  4908  	}
  4909  	// match: (MOVVstore [off1] {sym} (ADDVconst [off2] ptr) val mem)
  4910  	// cond: is32Bit(int64(off1)+off2) && (ptr.Op != OpSB || !config.ctxt.Flag_dynlink)
  4911  	// result: (MOVVstore [off1+int32(off2)] {sym} ptr val mem)
  4912  	for {
  4913  		off1 := auxIntToInt32(v.AuxInt)
  4914  		sym := auxToSym(v.Aux)
  4915  		if v_0.Op != OpLOONG64ADDVconst {
  4916  			break
  4917  		}
  4918  		off2 := auxIntToInt64(v_0.AuxInt)
  4919  		ptr := v_0.Args[0]
  4920  		val := v_1
  4921  		mem := v_2
  4922  		if !(is32Bit(int64(off1)+off2) && (ptr.Op != OpSB || !config.ctxt.Flag_dynlink)) {
  4923  			break
  4924  		}
  4925  		v.reset(OpLOONG64MOVVstore)
  4926  		v.AuxInt = int32ToAuxInt(off1 + int32(off2))
  4927  		v.Aux = symToAux(sym)
  4928  		v.AddArg3(ptr, val, mem)
  4929  		return true
  4930  	}
  4931  	// match: (MOVVstore [off1] {sym1} (MOVVaddr [off2] {sym2} ptr) val mem)
  4932  	// cond: canMergeSym(sym1,sym2) && is32Bit(int64(off1)+int64(off2)) && (ptr.Op != OpSB || !config.ctxt.Flag_dynlink)
  4933  	// result: (MOVVstore [off1+int32(off2)] {mergeSym(sym1,sym2)} ptr val mem)
  4934  	for {
  4935  		off1 := auxIntToInt32(v.AuxInt)
  4936  		sym1 := auxToSym(v.Aux)
  4937  		if v_0.Op != OpLOONG64MOVVaddr {
  4938  			break
  4939  		}
  4940  		off2 := auxIntToInt32(v_0.AuxInt)
  4941  		sym2 := auxToSym(v_0.Aux)
  4942  		ptr := v_0.Args[0]
  4943  		val := v_1
  4944  		mem := v_2
  4945  		if !(canMergeSym(sym1, sym2) && is32Bit(int64(off1)+int64(off2)) && (ptr.Op != OpSB || !config.ctxt.Flag_dynlink)) {
  4946  			break
  4947  		}
  4948  		v.reset(OpLOONG64MOVVstore)
  4949  		v.AuxInt = int32ToAuxInt(off1 + int32(off2))
  4950  		v.Aux = symToAux(mergeSym(sym1, sym2))
  4951  		v.AddArg3(ptr, val, mem)
  4952  		return true
  4953  	}
  4954  	// match: (MOVVstore [off] {sym} (ADDV ptr idx) val mem)
  4955  	// cond: off == 0 && sym == nil
  4956  	// result: (MOVVstoreidx ptr idx val mem)
  4957  	for {
  4958  		off := auxIntToInt32(v.AuxInt)
  4959  		sym := auxToSym(v.Aux)
  4960  		if v_0.Op != OpLOONG64ADDV {
  4961  			break
  4962  		}
  4963  		idx := v_0.Args[1]
  4964  		ptr := v_0.Args[0]
  4965  		val := v_1
  4966  		mem := v_2
  4967  		if !(off == 0 && sym == nil) {
  4968  			break
  4969  		}
  4970  		v.reset(OpLOONG64MOVVstoreidx)
  4971  		v.AddArg4(ptr, idx, val, mem)
  4972  		return true
  4973  	}
  4974  	// match: (MOVVstore [off] {sym} (ADDshiftLLV [shift] ptr idx) val mem)
  4975  	// cond: off == 0 && sym == nil
  4976  	// result: (MOVVstoreidx ptr (SLLVconst <typ.Int64> [shift] idx) val mem)
  4977  	for {
  4978  		off := auxIntToInt32(v.AuxInt)
  4979  		sym := auxToSym(v.Aux)
  4980  		if v_0.Op != OpLOONG64ADDshiftLLV {
  4981  			break
  4982  		}
  4983  		shift := auxIntToInt64(v_0.AuxInt)
  4984  		idx := v_0.Args[1]
  4985  		ptr := v_0.Args[0]
  4986  		val := v_1
  4987  		mem := v_2
  4988  		if !(off == 0 && sym == nil) {
  4989  			break
  4990  		}
  4991  		v.reset(OpLOONG64MOVVstoreidx)
  4992  		v0 := b.NewValue0(v.Pos, OpLOONG64SLLVconst, typ.Int64)
  4993  		v0.AuxInt = int64ToAuxInt(shift)
  4994  		v0.AddArg(idx)
  4995  		v.AddArg4(ptr, v0, val, mem)
  4996  		return true
  4997  	}
  4998  	return false
  4999  }
  5000  func rewriteValueLOONG64_OpLOONG64MOVVstoreidx(v *Value) bool {
  5001  	v_3 := v.Args[3]
  5002  	v_2 := v.Args[2]
  5003  	v_1 := v.Args[1]
  5004  	v_0 := v.Args[0]
  5005  	// match: (MOVVstoreidx ptr (MOVVconst [c]) val mem)
  5006  	// cond: is32Bit(c)
  5007  	// result: (MOVVstore [int32(c)] ptr val mem)
  5008  	for {
  5009  		ptr := v_0
  5010  		if v_1.Op != OpLOONG64MOVVconst {
  5011  			break
  5012  		}
  5013  		c := auxIntToInt64(v_1.AuxInt)
  5014  		val := v_2
  5015  		mem := v_3
  5016  		if !(is32Bit(c)) {
  5017  			break
  5018  		}
  5019  		v.reset(OpLOONG64MOVVstore)
  5020  		v.AuxInt = int32ToAuxInt(int32(c))
  5021  		v.AddArg3(ptr, val, mem)
  5022  		return true
  5023  	}
  5024  	// match: (MOVVstoreidx (MOVVconst [c]) idx val mem)
  5025  	// cond: is32Bit(c)
  5026  	// result: (MOVVstore [int32(c)] idx val mem)
  5027  	for {
  5028  		if v_0.Op != OpLOONG64MOVVconst {
  5029  			break
  5030  		}
  5031  		c := auxIntToInt64(v_0.AuxInt)
  5032  		idx := v_1
  5033  		val := v_2
  5034  		mem := v_3
  5035  		if !(is32Bit(c)) {
  5036  			break
  5037  		}
  5038  		v.reset(OpLOONG64MOVVstore)
  5039  		v.AuxInt = int32ToAuxInt(int32(c))
  5040  		v.AddArg3(idx, val, mem)
  5041  		return true
  5042  	}
  5043  	return false
  5044  }
  5045  func rewriteValueLOONG64_OpLOONG64MOVWUload(v *Value) bool {
  5046  	v_1 := v.Args[1]
  5047  	v_0 := v.Args[0]
  5048  	b := v.Block
  5049  	config := b.Func.Config
  5050  	typ := &b.Func.Config.Types
  5051  	// match: (MOVWUload [off] {sym} ptr (MOVFstore [off] {sym} ptr val _))
  5052  	// result: (ZeroExt32to64 (MOVWfpgp <typ.Float32> val))
  5053  	for {
  5054  		off := auxIntToInt32(v.AuxInt)
  5055  		sym := auxToSym(v.Aux)
  5056  		ptr := v_0
  5057  		if v_1.Op != OpLOONG64MOVFstore || auxIntToInt32(v_1.AuxInt) != off || auxToSym(v_1.Aux) != sym {
  5058  			break
  5059  		}
  5060  		val := v_1.Args[1]
  5061  		if ptr != v_1.Args[0] {
  5062  			break
  5063  		}
  5064  		v.reset(OpZeroExt32to64)
  5065  		v0 := b.NewValue0(v_1.Pos, OpLOONG64MOVWfpgp, typ.Float32)
  5066  		v0.AddArg(val)
  5067  		v.AddArg(v0)
  5068  		return true
  5069  	}
  5070  	// match: (MOVWUload [off] {sym} ptr (MOVWstore [off] {sym} ptr x _))
  5071  	// result: (MOVWUreg x)
  5072  	for {
  5073  		off := auxIntToInt32(v.AuxInt)
  5074  		sym := auxToSym(v.Aux)
  5075  		ptr := v_0
  5076  		if v_1.Op != OpLOONG64MOVWstore || auxIntToInt32(v_1.AuxInt) != off || auxToSym(v_1.Aux) != sym {
  5077  			break
  5078  		}
  5079  		x := v_1.Args[1]
  5080  		if ptr != v_1.Args[0] {
  5081  			break
  5082  		}
  5083  		v.reset(OpLOONG64MOVWUreg)
  5084  		v.AddArg(x)
  5085  		return true
  5086  	}
  5087  	// match: (MOVWUload [off1] {sym} (ADDVconst [off2] ptr) mem)
  5088  	// cond: is32Bit(int64(off1)+off2) && (ptr.Op != OpSB || !config.ctxt.Flag_dynlink)
  5089  	// result: (MOVWUload [off1+int32(off2)] {sym} ptr mem)
  5090  	for {
  5091  		off1 := auxIntToInt32(v.AuxInt)
  5092  		sym := auxToSym(v.Aux)
  5093  		if v_0.Op != OpLOONG64ADDVconst {
  5094  			break
  5095  		}
  5096  		off2 := auxIntToInt64(v_0.AuxInt)
  5097  		ptr := v_0.Args[0]
  5098  		mem := v_1
  5099  		if !(is32Bit(int64(off1)+off2) && (ptr.Op != OpSB || !config.ctxt.Flag_dynlink)) {
  5100  			break
  5101  		}
  5102  		v.reset(OpLOONG64MOVWUload)
  5103  		v.AuxInt = int32ToAuxInt(off1 + int32(off2))
  5104  		v.Aux = symToAux(sym)
  5105  		v.AddArg2(ptr, mem)
  5106  		return true
  5107  	}
  5108  	// match: (MOVWUload [off1] {sym1} (MOVVaddr [off2] {sym2} ptr) mem)
  5109  	// cond: canMergeSym(sym1,sym2) && is32Bit(int64(off1)+int64(off2)) && (ptr.Op != OpSB || !config.ctxt.Flag_dynlink)
  5110  	// result: (MOVWUload [off1+int32(off2)] {mergeSym(sym1,sym2)} ptr mem)
  5111  	for {
  5112  		off1 := auxIntToInt32(v.AuxInt)
  5113  		sym1 := auxToSym(v.Aux)
  5114  		if v_0.Op != OpLOONG64MOVVaddr {
  5115  			break
  5116  		}
  5117  		off2 := auxIntToInt32(v_0.AuxInt)
  5118  		sym2 := auxToSym(v_0.Aux)
  5119  		ptr := v_0.Args[0]
  5120  		mem := v_1
  5121  		if !(canMergeSym(sym1, sym2) && is32Bit(int64(off1)+int64(off2)) && (ptr.Op != OpSB || !config.ctxt.Flag_dynlink)) {
  5122  			break
  5123  		}
  5124  		v.reset(OpLOONG64MOVWUload)
  5125  		v.AuxInt = int32ToAuxInt(off1 + int32(off2))
  5126  		v.Aux = symToAux(mergeSym(sym1, sym2))
  5127  		v.AddArg2(ptr, mem)
  5128  		return true
  5129  	}
  5130  	// match: (MOVWUload [off] {sym} (ADDV ptr idx) mem)
  5131  	// cond: off == 0 && sym == nil
  5132  	// result: (MOVWUloadidx ptr idx mem)
  5133  	for {
  5134  		off := auxIntToInt32(v.AuxInt)
  5135  		sym := auxToSym(v.Aux)
  5136  		if v_0.Op != OpLOONG64ADDV {
  5137  			break
  5138  		}
  5139  		idx := v_0.Args[1]
  5140  		ptr := v_0.Args[0]
  5141  		mem := v_1
  5142  		if !(off == 0 && sym == nil) {
  5143  			break
  5144  		}
  5145  		v.reset(OpLOONG64MOVWUloadidx)
  5146  		v.AddArg3(ptr, idx, mem)
  5147  		return true
  5148  	}
  5149  	// match: (MOVWUload [off] {sym} (ADDshiftLLV [shift] ptr idx) mem)
  5150  	// cond: off == 0 && sym == nil
  5151  	// result: (MOVWUloadidx ptr (SLLVconst <typ.Int64> [shift] idx) mem)
  5152  	for {
  5153  		off := auxIntToInt32(v.AuxInt)
  5154  		sym := auxToSym(v.Aux)
  5155  		if v_0.Op != OpLOONG64ADDshiftLLV {
  5156  			break
  5157  		}
  5158  		shift := auxIntToInt64(v_0.AuxInt)
  5159  		idx := v_0.Args[1]
  5160  		ptr := v_0.Args[0]
  5161  		mem := v_1
  5162  		if !(off == 0 && sym == nil) {
  5163  			break
  5164  		}
  5165  		v.reset(OpLOONG64MOVWUloadidx)
  5166  		v0 := b.NewValue0(v.Pos, OpLOONG64SLLVconst, typ.Int64)
  5167  		v0.AuxInt = int64ToAuxInt(shift)
  5168  		v0.AddArg(idx)
  5169  		v.AddArg3(ptr, v0, mem)
  5170  		return true
  5171  	}
  5172  	// match: (MOVWUload [off] {sym} (SB) _)
  5173  	// cond: symIsRO(sym)
  5174  	// result: (MOVVconst [int64(read32(sym, int64(off), config.ctxt.Arch.ByteOrder))])
  5175  	for {
  5176  		off := auxIntToInt32(v.AuxInt)
  5177  		sym := auxToSym(v.Aux)
  5178  		if v_0.Op != OpSB || !(symIsRO(sym)) {
  5179  			break
  5180  		}
  5181  		v.reset(OpLOONG64MOVVconst)
  5182  		v.AuxInt = int64ToAuxInt(int64(read32(sym, int64(off), config.ctxt.Arch.ByteOrder)))
  5183  		return true
  5184  	}
  5185  	return false
  5186  }
  5187  func rewriteValueLOONG64_OpLOONG64MOVWUloadidx(v *Value) bool {
  5188  	v_2 := v.Args[2]
  5189  	v_1 := v.Args[1]
  5190  	v_0 := v.Args[0]
  5191  	// match: (MOVWUloadidx ptr (MOVVconst [c]) mem)
  5192  	// cond: is32Bit(c)
  5193  	// result: (MOVWUload [int32(c)] ptr mem)
  5194  	for {
  5195  		ptr := v_0
  5196  		if v_1.Op != OpLOONG64MOVVconst {
  5197  			break
  5198  		}
  5199  		c := auxIntToInt64(v_1.AuxInt)
  5200  		mem := v_2
  5201  		if !(is32Bit(c)) {
  5202  			break
  5203  		}
  5204  		v.reset(OpLOONG64MOVWUload)
  5205  		v.AuxInt = int32ToAuxInt(int32(c))
  5206  		v.AddArg2(ptr, mem)
  5207  		return true
  5208  	}
  5209  	// match: (MOVWUloadidx (MOVVconst [c]) ptr mem)
  5210  	// cond: is32Bit(c)
  5211  	// result: (MOVWUload [int32(c)] ptr mem)
  5212  	for {
  5213  		if v_0.Op != OpLOONG64MOVVconst {
  5214  			break
  5215  		}
  5216  		c := auxIntToInt64(v_0.AuxInt)
  5217  		ptr := v_1
  5218  		mem := v_2
  5219  		if !(is32Bit(c)) {
  5220  			break
  5221  		}
  5222  		v.reset(OpLOONG64MOVWUload)
  5223  		v.AuxInt = int32ToAuxInt(int32(c))
  5224  		v.AddArg2(ptr, mem)
  5225  		return true
  5226  	}
  5227  	return false
  5228  }
  5229  func rewriteValueLOONG64_OpLOONG64MOVWUreg(v *Value) bool {
  5230  	v_0 := v.Args[0]
  5231  	// match: (MOVWUreg (SRLVconst [rc] x))
  5232  	// cond: rc < 32
  5233  	// result: (BSTRPICKV [rc + (31+rc)<<6] x)
  5234  	for {
  5235  		if v_0.Op != OpLOONG64SRLVconst {
  5236  			break
  5237  		}
  5238  		rc := auxIntToInt64(v_0.AuxInt)
  5239  		x := v_0.Args[0]
  5240  		if !(rc < 32) {
  5241  			break
  5242  		}
  5243  		v.reset(OpLOONG64BSTRPICKV)
  5244  		v.AuxInt = int64ToAuxInt(rc + (31+rc)<<6)
  5245  		v.AddArg(x)
  5246  		return true
  5247  	}
  5248  	// match: (MOVWUreg x:(MOVBUload _ _))
  5249  	// result: (MOVVreg x)
  5250  	for {
  5251  		x := v_0
  5252  		if x.Op != OpLOONG64MOVBUload {
  5253  			break
  5254  		}
  5255  		v.reset(OpLOONG64MOVVreg)
  5256  		v.AddArg(x)
  5257  		return true
  5258  	}
  5259  	// match: (MOVWUreg x:(MOVHUload _ _))
  5260  	// result: (MOVVreg x)
  5261  	for {
  5262  		x := v_0
  5263  		if x.Op != OpLOONG64MOVHUload {
  5264  			break
  5265  		}
  5266  		v.reset(OpLOONG64MOVVreg)
  5267  		v.AddArg(x)
  5268  		return true
  5269  	}
  5270  	// match: (MOVWUreg x:(MOVWUload _ _))
  5271  	// result: (MOVVreg x)
  5272  	for {
  5273  		x := v_0
  5274  		if x.Op != OpLOONG64MOVWUload {
  5275  			break
  5276  		}
  5277  		v.reset(OpLOONG64MOVVreg)
  5278  		v.AddArg(x)
  5279  		return true
  5280  	}
  5281  	// match: (MOVWUreg x:(MOVBUloadidx _ _ _))
  5282  	// result: (MOVVreg x)
  5283  	for {
  5284  		x := v_0
  5285  		if x.Op != OpLOONG64MOVBUloadidx {
  5286  			break
  5287  		}
  5288  		v.reset(OpLOONG64MOVVreg)
  5289  		v.AddArg(x)
  5290  		return true
  5291  	}
  5292  	// match: (MOVWUreg x:(MOVHUloadidx _ _ _))
  5293  	// result: (MOVVreg x)
  5294  	for {
  5295  		x := v_0
  5296  		if x.Op != OpLOONG64MOVHUloadidx {
  5297  			break
  5298  		}
  5299  		v.reset(OpLOONG64MOVVreg)
  5300  		v.AddArg(x)
  5301  		return true
  5302  	}
  5303  	// match: (MOVWUreg x:(MOVWUloadidx _ _ _))
  5304  	// result: (MOVVreg x)
  5305  	for {
  5306  		x := v_0
  5307  		if x.Op != OpLOONG64MOVWUloadidx {
  5308  			break
  5309  		}
  5310  		v.reset(OpLOONG64MOVVreg)
  5311  		v.AddArg(x)
  5312  		return true
  5313  	}
  5314  	// match: (MOVWUreg x:(MOVBUreg _))
  5315  	// result: (MOVVreg x)
  5316  	for {
  5317  		x := v_0
  5318  		if x.Op != OpLOONG64MOVBUreg {
  5319  			break
  5320  		}
  5321  		v.reset(OpLOONG64MOVVreg)
  5322  		v.AddArg(x)
  5323  		return true
  5324  	}
  5325  	// match: (MOVWUreg x:(MOVHUreg _))
  5326  	// result: (MOVVreg x)
  5327  	for {
  5328  		x := v_0
  5329  		if x.Op != OpLOONG64MOVHUreg {
  5330  			break
  5331  		}
  5332  		v.reset(OpLOONG64MOVVreg)
  5333  		v.AddArg(x)
  5334  		return true
  5335  	}
  5336  	// match: (MOVWUreg x:(MOVWUreg _))
  5337  	// result: (MOVVreg x)
  5338  	for {
  5339  		x := v_0
  5340  		if x.Op != OpLOONG64MOVWUreg {
  5341  			break
  5342  		}
  5343  		v.reset(OpLOONG64MOVVreg)
  5344  		v.AddArg(x)
  5345  		return true
  5346  	}
  5347  	// match: (MOVWUreg (SLLVconst [lc] x))
  5348  	// cond: lc >= 32
  5349  	// result: (MOVVconst [0])
  5350  	for {
  5351  		if v_0.Op != OpLOONG64SLLVconst {
  5352  			break
  5353  		}
  5354  		lc := auxIntToInt64(v_0.AuxInt)
  5355  		if !(lc >= 32) {
  5356  			break
  5357  		}
  5358  		v.reset(OpLOONG64MOVVconst)
  5359  		v.AuxInt = int64ToAuxInt(0)
  5360  		return true
  5361  	}
  5362  	// match: (MOVWUreg (MOVVconst [c]))
  5363  	// result: (MOVVconst [int64(uint32(c))])
  5364  	for {
  5365  		if v_0.Op != OpLOONG64MOVVconst {
  5366  			break
  5367  		}
  5368  		c := auxIntToInt64(v_0.AuxInt)
  5369  		v.reset(OpLOONG64MOVVconst)
  5370  		v.AuxInt = int64ToAuxInt(int64(uint32(c)))
  5371  		return true
  5372  	}
  5373  	// match: (MOVWUreg x:(SRLconst [c] y))
  5374  	// result: x
  5375  	for {
  5376  		x := v_0
  5377  		if x.Op != OpLOONG64SRLconst {
  5378  			break
  5379  		}
  5380  		v.copyOf(x)
  5381  		return true
  5382  	}
  5383  	// match: (MOVWUreg x:(ANDconst [c] y))
  5384  	// cond: c >= 0 && int64(uint32(c)) == c
  5385  	// result: x
  5386  	for {
  5387  		x := v_0
  5388  		if x.Op != OpLOONG64ANDconst {
  5389  			break
  5390  		}
  5391  		c := auxIntToInt64(x.AuxInt)
  5392  		if !(c >= 0 && int64(uint32(c)) == c) {
  5393  			break
  5394  		}
  5395  		v.copyOf(x)
  5396  		return true
  5397  	}
  5398  	return false
  5399  }
  5400  func rewriteValueLOONG64_OpLOONG64MOVWload(v *Value) bool {
  5401  	v_1 := v.Args[1]
  5402  	v_0 := v.Args[0]
  5403  	b := v.Block
  5404  	config := b.Func.Config
  5405  	typ := &b.Func.Config.Types
  5406  	// match: (MOVWload [off] {sym} ptr (MOVWstore [off] {sym} ptr x _))
  5407  	// result: (MOVWreg x)
  5408  	for {
  5409  		off := auxIntToInt32(v.AuxInt)
  5410  		sym := auxToSym(v.Aux)
  5411  		ptr := v_0
  5412  		if v_1.Op != OpLOONG64MOVWstore || auxIntToInt32(v_1.AuxInt) != off || auxToSym(v_1.Aux) != sym {
  5413  			break
  5414  		}
  5415  		x := v_1.Args[1]
  5416  		if ptr != v_1.Args[0] {
  5417  			break
  5418  		}
  5419  		v.reset(OpLOONG64MOVWreg)
  5420  		v.AddArg(x)
  5421  		return true
  5422  	}
  5423  	// match: (MOVWload [off1] {sym} (ADDVconst [off2] ptr) mem)
  5424  	// cond: is32Bit(int64(off1)+off2) && (ptr.Op != OpSB || !config.ctxt.Flag_dynlink)
  5425  	// result: (MOVWload [off1+int32(off2)] {sym} ptr mem)
  5426  	for {
  5427  		off1 := auxIntToInt32(v.AuxInt)
  5428  		sym := auxToSym(v.Aux)
  5429  		if v_0.Op != OpLOONG64ADDVconst {
  5430  			break
  5431  		}
  5432  		off2 := auxIntToInt64(v_0.AuxInt)
  5433  		ptr := v_0.Args[0]
  5434  		mem := v_1
  5435  		if !(is32Bit(int64(off1)+off2) && (ptr.Op != OpSB || !config.ctxt.Flag_dynlink)) {
  5436  			break
  5437  		}
  5438  		v.reset(OpLOONG64MOVWload)
  5439  		v.AuxInt = int32ToAuxInt(off1 + int32(off2))
  5440  		v.Aux = symToAux(sym)
  5441  		v.AddArg2(ptr, mem)
  5442  		return true
  5443  	}
  5444  	// match: (MOVWload [off1] {sym1} (MOVVaddr [off2] {sym2} ptr) mem)
  5445  	// cond: canMergeSym(sym1,sym2) && is32Bit(int64(off1)+int64(off2)) && (ptr.Op != OpSB || !config.ctxt.Flag_dynlink)
  5446  	// result: (MOVWload [off1+int32(off2)] {mergeSym(sym1,sym2)} ptr mem)
  5447  	for {
  5448  		off1 := auxIntToInt32(v.AuxInt)
  5449  		sym1 := auxToSym(v.Aux)
  5450  		if v_0.Op != OpLOONG64MOVVaddr {
  5451  			break
  5452  		}
  5453  		off2 := auxIntToInt32(v_0.AuxInt)
  5454  		sym2 := auxToSym(v_0.Aux)
  5455  		ptr := v_0.Args[0]
  5456  		mem := v_1
  5457  		if !(canMergeSym(sym1, sym2) && is32Bit(int64(off1)+int64(off2)) && (ptr.Op != OpSB || !config.ctxt.Flag_dynlink)) {
  5458  			break
  5459  		}
  5460  		v.reset(OpLOONG64MOVWload)
  5461  		v.AuxInt = int32ToAuxInt(off1 + int32(off2))
  5462  		v.Aux = symToAux(mergeSym(sym1, sym2))
  5463  		v.AddArg2(ptr, mem)
  5464  		return true
  5465  	}
  5466  	// match: (MOVWload [off] {sym} (ADDV ptr idx) mem)
  5467  	// cond: off == 0 && sym == nil
  5468  	// result: (MOVWloadidx ptr idx mem)
  5469  	for {
  5470  		off := auxIntToInt32(v.AuxInt)
  5471  		sym := auxToSym(v.Aux)
  5472  		if v_0.Op != OpLOONG64ADDV {
  5473  			break
  5474  		}
  5475  		idx := v_0.Args[1]
  5476  		ptr := v_0.Args[0]
  5477  		mem := v_1
  5478  		if !(off == 0 && sym == nil) {
  5479  			break
  5480  		}
  5481  		v.reset(OpLOONG64MOVWloadidx)
  5482  		v.AddArg3(ptr, idx, mem)
  5483  		return true
  5484  	}
  5485  	// match: (MOVWload [off] {sym} (ADDshiftLLV [shift] ptr idx) mem)
  5486  	// cond: off == 0 && sym == nil
  5487  	// result: (MOVWloadidx ptr (SLLVconst <typ.Int64> [shift] idx) mem)
  5488  	for {
  5489  		off := auxIntToInt32(v.AuxInt)
  5490  		sym := auxToSym(v.Aux)
  5491  		if v_0.Op != OpLOONG64ADDshiftLLV {
  5492  			break
  5493  		}
  5494  		shift := auxIntToInt64(v_0.AuxInt)
  5495  		idx := v_0.Args[1]
  5496  		ptr := v_0.Args[0]
  5497  		mem := v_1
  5498  		if !(off == 0 && sym == nil) {
  5499  			break
  5500  		}
  5501  		v.reset(OpLOONG64MOVWloadidx)
  5502  		v0 := b.NewValue0(v.Pos, OpLOONG64SLLVconst, typ.Int64)
  5503  		v0.AuxInt = int64ToAuxInt(shift)
  5504  		v0.AddArg(idx)
  5505  		v.AddArg3(ptr, v0, mem)
  5506  		return true
  5507  	}
  5508  	// match: (MOVWload [off] {sym} (SB) _)
  5509  	// cond: symIsRO(sym)
  5510  	// result: (MOVVconst [int64(int32(read32(sym, int64(off), config.ctxt.Arch.ByteOrder)))])
  5511  	for {
  5512  		off := auxIntToInt32(v.AuxInt)
  5513  		sym := auxToSym(v.Aux)
  5514  		if v_0.Op != OpSB || !(symIsRO(sym)) {
  5515  			break
  5516  		}
  5517  		v.reset(OpLOONG64MOVVconst)
  5518  		v.AuxInt = int64ToAuxInt(int64(int32(read32(sym, int64(off), config.ctxt.Arch.ByteOrder))))
  5519  		return true
  5520  	}
  5521  	return false
  5522  }
  5523  func rewriteValueLOONG64_OpLOONG64MOVWloadidx(v *Value) bool {
  5524  	v_2 := v.Args[2]
  5525  	v_1 := v.Args[1]
  5526  	v_0 := v.Args[0]
  5527  	// match: (MOVWloadidx ptr (MOVVconst [c]) mem)
  5528  	// cond: is32Bit(c)
  5529  	// result: (MOVWload [int32(c)] ptr mem)
  5530  	for {
  5531  		ptr := v_0
  5532  		if v_1.Op != OpLOONG64MOVVconst {
  5533  			break
  5534  		}
  5535  		c := auxIntToInt64(v_1.AuxInt)
  5536  		mem := v_2
  5537  		if !(is32Bit(c)) {
  5538  			break
  5539  		}
  5540  		v.reset(OpLOONG64MOVWload)
  5541  		v.AuxInt = int32ToAuxInt(int32(c))
  5542  		v.AddArg2(ptr, mem)
  5543  		return true
  5544  	}
  5545  	// match: (MOVWloadidx (MOVVconst [c]) ptr mem)
  5546  	// cond: is32Bit(c)
  5547  	// result: (MOVWload [int32(c)] ptr mem)
  5548  	for {
  5549  		if v_0.Op != OpLOONG64MOVVconst {
  5550  			break
  5551  		}
  5552  		c := auxIntToInt64(v_0.AuxInt)
  5553  		ptr := v_1
  5554  		mem := v_2
  5555  		if !(is32Bit(c)) {
  5556  			break
  5557  		}
  5558  		v.reset(OpLOONG64MOVWload)
  5559  		v.AuxInt = int32ToAuxInt(int32(c))
  5560  		v.AddArg2(ptr, mem)
  5561  		return true
  5562  	}
  5563  	return false
  5564  }
  5565  func rewriteValueLOONG64_OpLOONG64MOVWreg(v *Value) bool {
  5566  	v_0 := v.Args[0]
  5567  	// match: (MOVWreg x:(MOVBload _ _))
  5568  	// result: (MOVVreg x)
  5569  	for {
  5570  		x := v_0
  5571  		if x.Op != OpLOONG64MOVBload {
  5572  			break
  5573  		}
  5574  		v.reset(OpLOONG64MOVVreg)
  5575  		v.AddArg(x)
  5576  		return true
  5577  	}
  5578  	// match: (MOVWreg x:(MOVBUload _ _))
  5579  	// result: (MOVVreg x)
  5580  	for {
  5581  		x := v_0
  5582  		if x.Op != OpLOONG64MOVBUload {
  5583  			break
  5584  		}
  5585  		v.reset(OpLOONG64MOVVreg)
  5586  		v.AddArg(x)
  5587  		return true
  5588  	}
  5589  	// match: (MOVWreg x:(MOVHload _ _))
  5590  	// result: (MOVVreg x)
  5591  	for {
  5592  		x := v_0
  5593  		if x.Op != OpLOONG64MOVHload {
  5594  			break
  5595  		}
  5596  		v.reset(OpLOONG64MOVVreg)
  5597  		v.AddArg(x)
  5598  		return true
  5599  	}
  5600  	// match: (MOVWreg x:(MOVHUload _ _))
  5601  	// result: (MOVVreg x)
  5602  	for {
  5603  		x := v_0
  5604  		if x.Op != OpLOONG64MOVHUload {
  5605  			break
  5606  		}
  5607  		v.reset(OpLOONG64MOVVreg)
  5608  		v.AddArg(x)
  5609  		return true
  5610  	}
  5611  	// match: (MOVWreg x:(MOVWload _ _))
  5612  	// result: (MOVVreg x)
  5613  	for {
  5614  		x := v_0
  5615  		if x.Op != OpLOONG64MOVWload {
  5616  			break
  5617  		}
  5618  		v.reset(OpLOONG64MOVVreg)
  5619  		v.AddArg(x)
  5620  		return true
  5621  	}
  5622  	// match: (MOVWreg x:(MOVBloadidx _ _ _))
  5623  	// result: (MOVVreg x)
  5624  	for {
  5625  		x := v_0
  5626  		if x.Op != OpLOONG64MOVBloadidx {
  5627  			break
  5628  		}
  5629  		v.reset(OpLOONG64MOVVreg)
  5630  		v.AddArg(x)
  5631  		return true
  5632  	}
  5633  	// match: (MOVWreg x:(MOVBUloadidx _ _ _))
  5634  	// result: (MOVVreg x)
  5635  	for {
  5636  		x := v_0
  5637  		if x.Op != OpLOONG64MOVBUloadidx {
  5638  			break
  5639  		}
  5640  		v.reset(OpLOONG64MOVVreg)
  5641  		v.AddArg(x)
  5642  		return true
  5643  	}
  5644  	// match: (MOVWreg x:(MOVHloadidx _ _ _))
  5645  	// result: (MOVVreg x)
  5646  	for {
  5647  		x := v_0
  5648  		if x.Op != OpLOONG64MOVHloadidx {
  5649  			break
  5650  		}
  5651  		v.reset(OpLOONG64MOVVreg)
  5652  		v.AddArg(x)
  5653  		return true
  5654  	}
  5655  	// match: (MOVWreg x:(MOVHUloadidx _ _ _))
  5656  	// result: (MOVVreg x)
  5657  	for {
  5658  		x := v_0
  5659  		if x.Op != OpLOONG64MOVHUloadidx {
  5660  			break
  5661  		}
  5662  		v.reset(OpLOONG64MOVVreg)
  5663  		v.AddArg(x)
  5664  		return true
  5665  	}
  5666  	// match: (MOVWreg x:(MOVWloadidx _ _ _))
  5667  	// result: (MOVVreg x)
  5668  	for {
  5669  		x := v_0
  5670  		if x.Op != OpLOONG64MOVWloadidx {
  5671  			break
  5672  		}
  5673  		v.reset(OpLOONG64MOVVreg)
  5674  		v.AddArg(x)
  5675  		return true
  5676  	}
  5677  	// match: (MOVWreg x:(MOVBreg _))
  5678  	// result: (MOVVreg x)
  5679  	for {
  5680  		x := v_0
  5681  		if x.Op != OpLOONG64MOVBreg {
  5682  			break
  5683  		}
  5684  		v.reset(OpLOONG64MOVVreg)
  5685  		v.AddArg(x)
  5686  		return true
  5687  	}
  5688  	// match: (MOVWreg x:(MOVBUreg _))
  5689  	// result: (MOVVreg x)
  5690  	for {
  5691  		x := v_0
  5692  		if x.Op != OpLOONG64MOVBUreg {
  5693  			break
  5694  		}
  5695  		v.reset(OpLOONG64MOVVreg)
  5696  		v.AddArg(x)
  5697  		return true
  5698  	}
  5699  	// match: (MOVWreg x:(MOVHreg _))
  5700  	// result: (MOVVreg x)
  5701  	for {
  5702  		x := v_0
  5703  		if x.Op != OpLOONG64MOVHreg {
  5704  			break
  5705  		}
  5706  		v.reset(OpLOONG64MOVVreg)
  5707  		v.AddArg(x)
  5708  		return true
  5709  	}
  5710  	// match: (MOVWreg x:(MOVWreg _))
  5711  	// result: (MOVVreg x)
  5712  	for {
  5713  		x := v_0
  5714  		if x.Op != OpLOONG64MOVWreg {
  5715  			break
  5716  		}
  5717  		v.reset(OpLOONG64MOVVreg)
  5718  		v.AddArg(x)
  5719  		return true
  5720  	}
  5721  	// match: (MOVWreg (MOVVconst [c]))
  5722  	// result: (MOVVconst [int64(int32(c))])
  5723  	for {
  5724  		if v_0.Op != OpLOONG64MOVVconst {
  5725  			break
  5726  		}
  5727  		c := auxIntToInt64(v_0.AuxInt)
  5728  		v.reset(OpLOONG64MOVVconst)
  5729  		v.AuxInt = int64ToAuxInt(int64(int32(c)))
  5730  		return true
  5731  	}
  5732  	// match: (MOVWreg x:(ANDconst [c] y))
  5733  	// cond: c >= 0 && int64(int32(c)) == c
  5734  	// result: x
  5735  	for {
  5736  		x := v_0
  5737  		if x.Op != OpLOONG64ANDconst {
  5738  			break
  5739  		}
  5740  		c := auxIntToInt64(x.AuxInt)
  5741  		if !(c >= 0 && int64(int32(c)) == c) {
  5742  			break
  5743  		}
  5744  		v.copyOf(x)
  5745  		return true
  5746  	}
  5747  	return false
  5748  }
  5749  func rewriteValueLOONG64_OpLOONG64MOVWstore(v *Value) bool {
  5750  	v_2 := v.Args[2]
  5751  	v_1 := v.Args[1]
  5752  	v_0 := v.Args[0]
  5753  	b := v.Block
  5754  	config := b.Func.Config
  5755  	typ := &b.Func.Config.Types
  5756  	// match: (MOVWstore [off] {sym} ptr (MOVWfpgp val) mem)
  5757  	// result: (MOVFstore [off] {sym} ptr val mem)
  5758  	for {
  5759  		off := auxIntToInt32(v.AuxInt)
  5760  		sym := auxToSym(v.Aux)
  5761  		ptr := v_0
  5762  		if v_1.Op != OpLOONG64MOVWfpgp {
  5763  			break
  5764  		}
  5765  		val := v_1.Args[0]
  5766  		mem := v_2
  5767  		v.reset(OpLOONG64MOVFstore)
  5768  		v.AuxInt = int32ToAuxInt(off)
  5769  		v.Aux = symToAux(sym)
  5770  		v.AddArg3(ptr, val, mem)
  5771  		return true
  5772  	}
  5773  	// match: (MOVWstore [off1] {sym} (ADDVconst [off2] ptr) val mem)
  5774  	// cond: is32Bit(int64(off1)+off2) && (ptr.Op != OpSB || !config.ctxt.Flag_dynlink)
  5775  	// result: (MOVWstore [off1+int32(off2)] {sym} ptr val mem)
  5776  	for {
  5777  		off1 := auxIntToInt32(v.AuxInt)
  5778  		sym := auxToSym(v.Aux)
  5779  		if v_0.Op != OpLOONG64ADDVconst {
  5780  			break
  5781  		}
  5782  		off2 := auxIntToInt64(v_0.AuxInt)
  5783  		ptr := v_0.Args[0]
  5784  		val := v_1
  5785  		mem := v_2
  5786  		if !(is32Bit(int64(off1)+off2) && (ptr.Op != OpSB || !config.ctxt.Flag_dynlink)) {
  5787  			break
  5788  		}
  5789  		v.reset(OpLOONG64MOVWstore)
  5790  		v.AuxInt = int32ToAuxInt(off1 + int32(off2))
  5791  		v.Aux = symToAux(sym)
  5792  		v.AddArg3(ptr, val, mem)
  5793  		return true
  5794  	}
  5795  	// match: (MOVWstore [off1] {sym1} (MOVVaddr [off2] {sym2} ptr) val mem)
  5796  	// cond: canMergeSym(sym1,sym2) && is32Bit(int64(off1)+int64(off2)) && (ptr.Op != OpSB || !config.ctxt.Flag_dynlink)
  5797  	// result: (MOVWstore [off1+int32(off2)] {mergeSym(sym1,sym2)} ptr val mem)
  5798  	for {
  5799  		off1 := auxIntToInt32(v.AuxInt)
  5800  		sym1 := auxToSym(v.Aux)
  5801  		if v_0.Op != OpLOONG64MOVVaddr {
  5802  			break
  5803  		}
  5804  		off2 := auxIntToInt32(v_0.AuxInt)
  5805  		sym2 := auxToSym(v_0.Aux)
  5806  		ptr := v_0.Args[0]
  5807  		val := v_1
  5808  		mem := v_2
  5809  		if !(canMergeSym(sym1, sym2) && is32Bit(int64(off1)+int64(off2)) && (ptr.Op != OpSB || !config.ctxt.Flag_dynlink)) {
  5810  			break
  5811  		}
  5812  		v.reset(OpLOONG64MOVWstore)
  5813  		v.AuxInt = int32ToAuxInt(off1 + int32(off2))
  5814  		v.Aux = symToAux(mergeSym(sym1, sym2))
  5815  		v.AddArg3(ptr, val, mem)
  5816  		return true
  5817  	}
  5818  	// match: (MOVWstore [off] {sym} ptr (MOVWreg x) mem)
  5819  	// result: (MOVWstore [off] {sym} ptr x mem)
  5820  	for {
  5821  		off := auxIntToInt32(v.AuxInt)
  5822  		sym := auxToSym(v.Aux)
  5823  		ptr := v_0
  5824  		if v_1.Op != OpLOONG64MOVWreg {
  5825  			break
  5826  		}
  5827  		x := v_1.Args[0]
  5828  		mem := v_2
  5829  		v.reset(OpLOONG64MOVWstore)
  5830  		v.AuxInt = int32ToAuxInt(off)
  5831  		v.Aux = symToAux(sym)
  5832  		v.AddArg3(ptr, x, mem)
  5833  		return true
  5834  	}
  5835  	// match: (MOVWstore [off] {sym} ptr (MOVWUreg x) mem)
  5836  	// result: (MOVWstore [off] {sym} ptr x mem)
  5837  	for {
  5838  		off := auxIntToInt32(v.AuxInt)
  5839  		sym := auxToSym(v.Aux)
  5840  		ptr := v_0
  5841  		if v_1.Op != OpLOONG64MOVWUreg {
  5842  			break
  5843  		}
  5844  		x := v_1.Args[0]
  5845  		mem := v_2
  5846  		v.reset(OpLOONG64MOVWstore)
  5847  		v.AuxInt = int32ToAuxInt(off)
  5848  		v.Aux = symToAux(sym)
  5849  		v.AddArg3(ptr, x, mem)
  5850  		return true
  5851  	}
  5852  	// match: (MOVWstore [off] {sym} (ADDV ptr idx) val mem)
  5853  	// cond: off == 0 && sym == nil
  5854  	// result: (MOVWstoreidx ptr idx val mem)
  5855  	for {
  5856  		off := auxIntToInt32(v.AuxInt)
  5857  		sym := auxToSym(v.Aux)
  5858  		if v_0.Op != OpLOONG64ADDV {
  5859  			break
  5860  		}
  5861  		idx := v_0.Args[1]
  5862  		ptr := v_0.Args[0]
  5863  		val := v_1
  5864  		mem := v_2
  5865  		if !(off == 0 && sym == nil) {
  5866  			break
  5867  		}
  5868  		v.reset(OpLOONG64MOVWstoreidx)
  5869  		v.AddArg4(ptr, idx, val, mem)
  5870  		return true
  5871  	}
  5872  	// match: (MOVWstore [off] {sym} (ADDshiftLLV [shift] ptr idx) val mem)
  5873  	// cond: off == 0 && sym == nil
  5874  	// result: (MOVWstoreidx ptr (SLLVconst <typ.Int64> [shift] idx) val mem)
  5875  	for {
  5876  		off := auxIntToInt32(v.AuxInt)
  5877  		sym := auxToSym(v.Aux)
  5878  		if v_0.Op != OpLOONG64ADDshiftLLV {
  5879  			break
  5880  		}
  5881  		shift := auxIntToInt64(v_0.AuxInt)
  5882  		idx := v_0.Args[1]
  5883  		ptr := v_0.Args[0]
  5884  		val := v_1
  5885  		mem := v_2
  5886  		if !(off == 0 && sym == nil) {
  5887  			break
  5888  		}
  5889  		v.reset(OpLOONG64MOVWstoreidx)
  5890  		v0 := b.NewValue0(v.Pos, OpLOONG64SLLVconst, typ.Int64)
  5891  		v0.AuxInt = int64ToAuxInt(shift)
  5892  		v0.AddArg(idx)
  5893  		v.AddArg4(ptr, v0, val, mem)
  5894  		return true
  5895  	}
  5896  	return false
  5897  }
  5898  func rewriteValueLOONG64_OpLOONG64MOVWstoreidx(v *Value) bool {
  5899  	v_3 := v.Args[3]
  5900  	v_2 := v.Args[2]
  5901  	v_1 := v.Args[1]
  5902  	v_0 := v.Args[0]
  5903  	// match: (MOVWstoreidx ptr (MOVVconst [c]) val mem)
  5904  	// cond: is32Bit(c)
  5905  	// result: (MOVWstore [int32(c)] ptr val mem)
  5906  	for {
  5907  		ptr := v_0
  5908  		if v_1.Op != OpLOONG64MOVVconst {
  5909  			break
  5910  		}
  5911  		c := auxIntToInt64(v_1.AuxInt)
  5912  		val := v_2
  5913  		mem := v_3
  5914  		if !(is32Bit(c)) {
  5915  			break
  5916  		}
  5917  		v.reset(OpLOONG64MOVWstore)
  5918  		v.AuxInt = int32ToAuxInt(int32(c))
  5919  		v.AddArg3(ptr, val, mem)
  5920  		return true
  5921  	}
  5922  	// match: (MOVWstoreidx (MOVVconst [c]) idx val mem)
  5923  	// cond: is32Bit(c)
  5924  	// result: (MOVWstore [int32(c)] idx val mem)
  5925  	for {
  5926  		if v_0.Op != OpLOONG64MOVVconst {
  5927  			break
  5928  		}
  5929  		c := auxIntToInt64(v_0.AuxInt)
  5930  		idx := v_1
  5931  		val := v_2
  5932  		mem := v_3
  5933  		if !(is32Bit(c)) {
  5934  			break
  5935  		}
  5936  		v.reset(OpLOONG64MOVWstore)
  5937  		v.AuxInt = int32ToAuxInt(int32(c))
  5938  		v.AddArg3(idx, val, mem)
  5939  		return true
  5940  	}
  5941  	return false
  5942  }
  5943  func rewriteValueLOONG64_OpLOONG64MULV(v *Value) bool {
  5944  	v_1 := v.Args[1]
  5945  	v_0 := v.Args[0]
  5946  	b := v.Block
  5947  	config := b.Func.Config
  5948  	// match: (MULV r:(MOVWUreg x) s:(MOVWUreg y))
  5949  	// cond: r.Uses == 1 && s.Uses == 1
  5950  	// result: (MULWVWU x y)
  5951  	for {
  5952  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
  5953  			r := v_0
  5954  			if r.Op != OpLOONG64MOVWUreg {
  5955  				continue
  5956  			}
  5957  			x := r.Args[0]
  5958  			s := v_1
  5959  			if s.Op != OpLOONG64MOVWUreg {
  5960  				continue
  5961  			}
  5962  			y := s.Args[0]
  5963  			if !(r.Uses == 1 && s.Uses == 1) {
  5964  				continue
  5965  			}
  5966  			v.reset(OpLOONG64MULWVWU)
  5967  			v.AddArg2(x, y)
  5968  			return true
  5969  		}
  5970  		break
  5971  	}
  5972  	// match: (MULV r:(MOVWreg x) s:(MOVWreg y))
  5973  	// cond: r.Uses == 1 && s.Uses == 1
  5974  	// result: (MULWVW x y)
  5975  	for {
  5976  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
  5977  			r := v_0
  5978  			if r.Op != OpLOONG64MOVWreg {
  5979  				continue
  5980  			}
  5981  			x := r.Args[0]
  5982  			s := v_1
  5983  			if s.Op != OpLOONG64MOVWreg {
  5984  				continue
  5985  			}
  5986  			y := s.Args[0]
  5987  			if !(r.Uses == 1 && s.Uses == 1) {
  5988  				continue
  5989  			}
  5990  			v.reset(OpLOONG64MULWVW)
  5991  			v.AddArg2(x, y)
  5992  			return true
  5993  		}
  5994  		break
  5995  	}
  5996  	// match: (MULV _ (MOVVconst [0]))
  5997  	// result: (MOVVconst [0])
  5998  	for {
  5999  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
  6000  			if v_1.Op != OpLOONG64MOVVconst || auxIntToInt64(v_1.AuxInt) != 0 {
  6001  				continue
  6002  			}
  6003  			v.reset(OpLOONG64MOVVconst)
  6004  			v.AuxInt = int64ToAuxInt(0)
  6005  			return true
  6006  		}
  6007  		break
  6008  	}
  6009  	// match: (MULV x (MOVVconst [1]))
  6010  	// result: x
  6011  	for {
  6012  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
  6013  			x := v_0
  6014  			if v_1.Op != OpLOONG64MOVVconst || auxIntToInt64(v_1.AuxInt) != 1 {
  6015  				continue
  6016  			}
  6017  			v.copyOf(x)
  6018  			return true
  6019  		}
  6020  		break
  6021  	}
  6022  	// match: (MULV x (MOVVconst [c]))
  6023  	// cond: canMulStrengthReduce(config, c)
  6024  	// result: {mulStrengthReduce(v, x, c)}
  6025  	for {
  6026  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
  6027  			x := v_0
  6028  			if v_1.Op != OpLOONG64MOVVconst {
  6029  				continue
  6030  			}
  6031  			c := auxIntToInt64(v_1.AuxInt)
  6032  			if !(canMulStrengthReduce(config, c)) {
  6033  				continue
  6034  			}
  6035  			v.copyOf(mulStrengthReduce(v, x, c))
  6036  			return true
  6037  		}
  6038  		break
  6039  	}
  6040  	// match: (MULV (MOVVconst [c]) (MOVVconst [d]))
  6041  	// result: (MOVVconst [c*d])
  6042  	for {
  6043  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
  6044  			if v_0.Op != OpLOONG64MOVVconst {
  6045  				continue
  6046  			}
  6047  			c := auxIntToInt64(v_0.AuxInt)
  6048  			if v_1.Op != OpLOONG64MOVVconst {
  6049  				continue
  6050  			}
  6051  			d := auxIntToInt64(v_1.AuxInt)
  6052  			v.reset(OpLOONG64MOVVconst)
  6053  			v.AuxInt = int64ToAuxInt(c * d)
  6054  			return true
  6055  		}
  6056  		break
  6057  	}
  6058  	return false
  6059  }
  6060  func rewriteValueLOONG64_OpLOONG64NEGV(v *Value) bool {
  6061  	v_0 := v.Args[0]
  6062  	b := v.Block
  6063  	// match: (NEGV (SUBV x y))
  6064  	// result: (SUBV y x)
  6065  	for {
  6066  		if v_0.Op != OpLOONG64SUBV {
  6067  			break
  6068  		}
  6069  		y := v_0.Args[1]
  6070  		x := v_0.Args[0]
  6071  		v.reset(OpLOONG64SUBV)
  6072  		v.AddArg2(y, x)
  6073  		return true
  6074  	}
  6075  	// match: (NEGV <t> s:(ADDVconst [c] (SUBV x y)))
  6076  	// cond: s.Uses == 1 && is12Bit(-c)
  6077  	// result: (ADDVconst [-c] (SUBV <t> y x))
  6078  	for {
  6079  		t := v.Type
  6080  		s := v_0
  6081  		if s.Op != OpLOONG64ADDVconst {
  6082  			break
  6083  		}
  6084  		c := auxIntToInt64(s.AuxInt)
  6085  		s_0 := s.Args[0]
  6086  		if s_0.Op != OpLOONG64SUBV {
  6087  			break
  6088  		}
  6089  		y := s_0.Args[1]
  6090  		x := s_0.Args[0]
  6091  		if !(s.Uses == 1 && is12Bit(-c)) {
  6092  			break
  6093  		}
  6094  		v.reset(OpLOONG64ADDVconst)
  6095  		v.AuxInt = int64ToAuxInt(-c)
  6096  		v0 := b.NewValue0(v.Pos, OpLOONG64SUBV, t)
  6097  		v0.AddArg2(y, x)
  6098  		v.AddArg(v0)
  6099  		return true
  6100  	}
  6101  	// match: (NEGV (NEGV x))
  6102  	// result: x
  6103  	for {
  6104  		if v_0.Op != OpLOONG64NEGV {
  6105  			break
  6106  		}
  6107  		x := v_0.Args[0]
  6108  		v.copyOf(x)
  6109  		return true
  6110  	}
  6111  	// match: (NEGV <t> s:(ADDVconst [c] (NEGV x)))
  6112  	// cond: s.Uses == 1 && is12Bit(-c)
  6113  	// result: (ADDVconst [-c] x)
  6114  	for {
  6115  		s := v_0
  6116  		if s.Op != OpLOONG64ADDVconst {
  6117  			break
  6118  		}
  6119  		c := auxIntToInt64(s.AuxInt)
  6120  		s_0 := s.Args[0]
  6121  		if s_0.Op != OpLOONG64NEGV {
  6122  			break
  6123  		}
  6124  		x := s_0.Args[0]
  6125  		if !(s.Uses == 1 && is12Bit(-c)) {
  6126  			break
  6127  		}
  6128  		v.reset(OpLOONG64ADDVconst)
  6129  		v.AuxInt = int64ToAuxInt(-c)
  6130  		v.AddArg(x)
  6131  		return true
  6132  	}
  6133  	// match: (NEGV (MOVVconst [c]))
  6134  	// result: (MOVVconst [-c])
  6135  	for {
  6136  		if v_0.Op != OpLOONG64MOVVconst {
  6137  			break
  6138  		}
  6139  		c := auxIntToInt64(v_0.AuxInt)
  6140  		v.reset(OpLOONG64MOVVconst)
  6141  		v.AuxInt = int64ToAuxInt(-c)
  6142  		return true
  6143  	}
  6144  	return false
  6145  }
  6146  func rewriteValueLOONG64_OpLOONG64NOR(v *Value) bool {
  6147  	v_1 := v.Args[1]
  6148  	v_0 := v.Args[0]
  6149  	// match: (NOR x (MOVVconst [c]))
  6150  	// cond: is32Bit(c)
  6151  	// result: (NORconst [c] x)
  6152  	for {
  6153  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
  6154  			x := v_0
  6155  			if v_1.Op != OpLOONG64MOVVconst {
  6156  				continue
  6157  			}
  6158  			c := auxIntToInt64(v_1.AuxInt)
  6159  			if !(is32Bit(c)) {
  6160  				continue
  6161  			}
  6162  			v.reset(OpLOONG64NORconst)
  6163  			v.AuxInt = int64ToAuxInt(c)
  6164  			v.AddArg(x)
  6165  			return true
  6166  		}
  6167  		break
  6168  	}
  6169  	return false
  6170  }
  6171  func rewriteValueLOONG64_OpLOONG64NORconst(v *Value) bool {
  6172  	v_0 := v.Args[0]
  6173  	// match: (NORconst [c] (MOVVconst [d]))
  6174  	// result: (MOVVconst [^(c|d)])
  6175  	for {
  6176  		c := auxIntToInt64(v.AuxInt)
  6177  		if v_0.Op != OpLOONG64MOVVconst {
  6178  			break
  6179  		}
  6180  		d := auxIntToInt64(v_0.AuxInt)
  6181  		v.reset(OpLOONG64MOVVconst)
  6182  		v.AuxInt = int64ToAuxInt(^(c | d))
  6183  		return true
  6184  	}
  6185  	return false
  6186  }
  6187  func rewriteValueLOONG64_OpLOONG64OR(v *Value) bool {
  6188  	v_1 := v.Args[1]
  6189  	v_0 := v.Args[0]
  6190  	b := v.Block
  6191  	typ := &b.Func.Config.Types
  6192  	// match: (OR <typ.UInt16> (SRLVconst [8] <typ.UInt16> x) (SLLVconst [8] <typ.UInt16> x))
  6193  	// result: (REVB2H x)
  6194  	for {
  6195  		if v.Type != typ.UInt16 {
  6196  			break
  6197  		}
  6198  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
  6199  			if v_0.Op != OpLOONG64SRLVconst || v_0.Type != typ.UInt16 || auxIntToInt64(v_0.AuxInt) != 8 {
  6200  				continue
  6201  			}
  6202  			x := v_0.Args[0]
  6203  			if v_1.Op != OpLOONG64SLLVconst || v_1.Type != typ.UInt16 || auxIntToInt64(v_1.AuxInt) != 8 || x != v_1.Args[0] {
  6204  				continue
  6205  			}
  6206  			v.reset(OpLOONG64REVB2H)
  6207  			v.AddArg(x)
  6208  			return true
  6209  		}
  6210  		break
  6211  	}
  6212  	// match: (OR (SRLconst [8] (ANDconst [c1] x)) (SLLconst [8] (ANDconst [c2] x)))
  6213  	// cond: uint32(c1) == 0xff00ff00 && uint32(c2) == 0x00ff00ff
  6214  	// result: (REVB2H x)
  6215  	for {
  6216  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
  6217  			if v_0.Op != OpLOONG64SRLconst || auxIntToInt64(v_0.AuxInt) != 8 {
  6218  				continue
  6219  			}
  6220  			v_0_0 := v_0.Args[0]
  6221  			if v_0_0.Op != OpLOONG64ANDconst {
  6222  				continue
  6223  			}
  6224  			c1 := auxIntToInt64(v_0_0.AuxInt)
  6225  			x := v_0_0.Args[0]
  6226  			if v_1.Op != OpLOONG64SLLconst || auxIntToInt64(v_1.AuxInt) != 8 {
  6227  				continue
  6228  			}
  6229  			v_1_0 := v_1.Args[0]
  6230  			if v_1_0.Op != OpLOONG64ANDconst {
  6231  				continue
  6232  			}
  6233  			c2 := auxIntToInt64(v_1_0.AuxInt)
  6234  			if x != v_1_0.Args[0] || !(uint32(c1) == 0xff00ff00 && uint32(c2) == 0x00ff00ff) {
  6235  				continue
  6236  			}
  6237  			v.reset(OpLOONG64REVB2H)
  6238  			v.AddArg(x)
  6239  			return true
  6240  		}
  6241  		break
  6242  	}
  6243  	// match: (OR (SRLVconst [8] (AND (MOVVconst [c1]) x)) (SLLVconst [8] (AND (MOVVconst [c2]) x)))
  6244  	// cond: uint64(c1) == 0xff00ff00ff00ff00 && uint64(c2) == 0x00ff00ff00ff00ff
  6245  	// result: (REVB4H x)
  6246  	for {
  6247  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
  6248  			if v_0.Op != OpLOONG64SRLVconst || auxIntToInt64(v_0.AuxInt) != 8 {
  6249  				continue
  6250  			}
  6251  			v_0_0 := v_0.Args[0]
  6252  			if v_0_0.Op != OpLOONG64AND {
  6253  				continue
  6254  			}
  6255  			_ = v_0_0.Args[1]
  6256  			v_0_0_0 := v_0_0.Args[0]
  6257  			v_0_0_1 := v_0_0.Args[1]
  6258  			for _i1 := 0; _i1 <= 1; _i1, v_0_0_0, v_0_0_1 = _i1+1, v_0_0_1, v_0_0_0 {
  6259  				if v_0_0_0.Op != OpLOONG64MOVVconst {
  6260  					continue
  6261  				}
  6262  				c1 := auxIntToInt64(v_0_0_0.AuxInt)
  6263  				x := v_0_0_1
  6264  				if v_1.Op != OpLOONG64SLLVconst || auxIntToInt64(v_1.AuxInt) != 8 {
  6265  					continue
  6266  				}
  6267  				v_1_0 := v_1.Args[0]
  6268  				if v_1_0.Op != OpLOONG64AND {
  6269  					continue
  6270  				}
  6271  				_ = v_1_0.Args[1]
  6272  				v_1_0_0 := v_1_0.Args[0]
  6273  				v_1_0_1 := v_1_0.Args[1]
  6274  				for _i2 := 0; _i2 <= 1; _i2, v_1_0_0, v_1_0_1 = _i2+1, v_1_0_1, v_1_0_0 {
  6275  					if v_1_0_0.Op != OpLOONG64MOVVconst {
  6276  						continue
  6277  					}
  6278  					c2 := auxIntToInt64(v_1_0_0.AuxInt)
  6279  					if x != v_1_0_1 || !(uint64(c1) == 0xff00ff00ff00ff00 && uint64(c2) == 0x00ff00ff00ff00ff) {
  6280  						continue
  6281  					}
  6282  					v.reset(OpLOONG64REVB4H)
  6283  					v.AddArg(x)
  6284  					return true
  6285  				}
  6286  			}
  6287  		}
  6288  		break
  6289  	}
  6290  	// match: (OR (SRLVconst [8] (AND (MOVVconst [c1]) x)) (SLLVconst [8] (ANDconst [c2] x)))
  6291  	// cond: uint64(c1) == 0xff00ff00 && uint64(c2) == 0x00ff00ff
  6292  	// result: (REVB4H (ANDconst <x.Type> [0xffffffff] x))
  6293  	for {
  6294  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
  6295  			if v_0.Op != OpLOONG64SRLVconst || auxIntToInt64(v_0.AuxInt) != 8 {
  6296  				continue
  6297  			}
  6298  			v_0_0 := v_0.Args[0]
  6299  			if v_0_0.Op != OpLOONG64AND {
  6300  				continue
  6301  			}
  6302  			_ = v_0_0.Args[1]
  6303  			v_0_0_0 := v_0_0.Args[0]
  6304  			v_0_0_1 := v_0_0.Args[1]
  6305  			for _i1 := 0; _i1 <= 1; _i1, v_0_0_0, v_0_0_1 = _i1+1, v_0_0_1, v_0_0_0 {
  6306  				if v_0_0_0.Op != OpLOONG64MOVVconst {
  6307  					continue
  6308  				}
  6309  				c1 := auxIntToInt64(v_0_0_0.AuxInt)
  6310  				x := v_0_0_1
  6311  				if v_1.Op != OpLOONG64SLLVconst || auxIntToInt64(v_1.AuxInt) != 8 {
  6312  					continue
  6313  				}
  6314  				v_1_0 := v_1.Args[0]
  6315  				if v_1_0.Op != OpLOONG64ANDconst {
  6316  					continue
  6317  				}
  6318  				c2 := auxIntToInt64(v_1_0.AuxInt)
  6319  				if x != v_1_0.Args[0] || !(uint64(c1) == 0xff00ff00 && uint64(c2) == 0x00ff00ff) {
  6320  					continue
  6321  				}
  6322  				v.reset(OpLOONG64REVB4H)
  6323  				v0 := b.NewValue0(v.Pos, OpLOONG64ANDconst, x.Type)
  6324  				v0.AuxInt = int64ToAuxInt(0xffffffff)
  6325  				v0.AddArg(x)
  6326  				v.AddArg(v0)
  6327  				return true
  6328  			}
  6329  		}
  6330  		break
  6331  	}
  6332  	// match: (OR x (MOVVconst [c]))
  6333  	// cond: is32Bit(c)
  6334  	// result: (ORconst [c] x)
  6335  	for {
  6336  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
  6337  			x := v_0
  6338  			if v_1.Op != OpLOONG64MOVVconst {
  6339  				continue
  6340  			}
  6341  			c := auxIntToInt64(v_1.AuxInt)
  6342  			if !(is32Bit(c)) {
  6343  				continue
  6344  			}
  6345  			v.reset(OpLOONG64ORconst)
  6346  			v.AuxInt = int64ToAuxInt(c)
  6347  			v.AddArg(x)
  6348  			return true
  6349  		}
  6350  		break
  6351  	}
  6352  	// match: (OR x x)
  6353  	// result: x
  6354  	for {
  6355  		x := v_0
  6356  		if x != v_1 {
  6357  			break
  6358  		}
  6359  		v.copyOf(x)
  6360  		return true
  6361  	}
  6362  	// match: (OR x (NORconst [0] y))
  6363  	// result: (ORN x y)
  6364  	for {
  6365  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
  6366  			x := v_0
  6367  			if v_1.Op != OpLOONG64NORconst || auxIntToInt64(v_1.AuxInt) != 0 {
  6368  				continue
  6369  			}
  6370  			y := v_1.Args[0]
  6371  			v.reset(OpLOONG64ORN)
  6372  			v.AddArg2(x, y)
  6373  			return true
  6374  		}
  6375  		break
  6376  	}
  6377  	return false
  6378  }
  6379  func rewriteValueLOONG64_OpLOONG64ORN(v *Value) bool {
  6380  	v_1 := v.Args[1]
  6381  	v_0 := v.Args[0]
  6382  	// match: (ORN x (MOVVconst [-1]))
  6383  	// result: x
  6384  	for {
  6385  		x := v_0
  6386  		if v_1.Op != OpLOONG64MOVVconst || auxIntToInt64(v_1.AuxInt) != -1 {
  6387  			break
  6388  		}
  6389  		v.copyOf(x)
  6390  		return true
  6391  	}
  6392  	return false
  6393  }
  6394  func rewriteValueLOONG64_OpLOONG64ORconst(v *Value) bool {
  6395  	v_0 := v.Args[0]
  6396  	// match: (ORconst [0] x)
  6397  	// result: x
  6398  	for {
  6399  		if auxIntToInt64(v.AuxInt) != 0 {
  6400  			break
  6401  		}
  6402  		x := v_0
  6403  		v.copyOf(x)
  6404  		return true
  6405  	}
  6406  	// match: (ORconst [-1] _)
  6407  	// result: (MOVVconst [-1])
  6408  	for {
  6409  		if auxIntToInt64(v.AuxInt) != -1 {
  6410  			break
  6411  		}
  6412  		v.reset(OpLOONG64MOVVconst)
  6413  		v.AuxInt = int64ToAuxInt(-1)
  6414  		return true
  6415  	}
  6416  	// match: (ORconst [c] (MOVVconst [d]))
  6417  	// result: (MOVVconst [c|d])
  6418  	for {
  6419  		c := auxIntToInt64(v.AuxInt)
  6420  		if v_0.Op != OpLOONG64MOVVconst {
  6421  			break
  6422  		}
  6423  		d := auxIntToInt64(v_0.AuxInt)
  6424  		v.reset(OpLOONG64MOVVconst)
  6425  		v.AuxInt = int64ToAuxInt(c | d)
  6426  		return true
  6427  	}
  6428  	// match: (ORconst [c] (ORconst [d] x))
  6429  	// cond: is32Bit(c|d)
  6430  	// result: (ORconst [c|d] x)
  6431  	for {
  6432  		c := auxIntToInt64(v.AuxInt)
  6433  		if v_0.Op != OpLOONG64ORconst {
  6434  			break
  6435  		}
  6436  		d := auxIntToInt64(v_0.AuxInt)
  6437  		x := v_0.Args[0]
  6438  		if !(is32Bit(c | d)) {
  6439  			break
  6440  		}
  6441  		v.reset(OpLOONG64ORconst)
  6442  		v.AuxInt = int64ToAuxInt(c | d)
  6443  		v.AddArg(x)
  6444  		return true
  6445  	}
  6446  	return false
  6447  }
  6448  func rewriteValueLOONG64_OpLOONG64REMV(v *Value) bool {
  6449  	v_1 := v.Args[1]
  6450  	v_0 := v.Args[0]
  6451  	// match: (REMV (MOVVconst [c]) (MOVVconst [d]))
  6452  	// cond: d != 0
  6453  	// result: (MOVVconst [c%d])
  6454  	for {
  6455  		if v_0.Op != OpLOONG64MOVVconst {
  6456  			break
  6457  		}
  6458  		c := auxIntToInt64(v_0.AuxInt)
  6459  		if v_1.Op != OpLOONG64MOVVconst {
  6460  			break
  6461  		}
  6462  		d := auxIntToInt64(v_1.AuxInt)
  6463  		if !(d != 0) {
  6464  			break
  6465  		}
  6466  		v.reset(OpLOONG64MOVVconst)
  6467  		v.AuxInt = int64ToAuxInt(c % d)
  6468  		return true
  6469  	}
  6470  	return false
  6471  }
  6472  func rewriteValueLOONG64_OpLOONG64REMVU(v *Value) bool {
  6473  	v_1 := v.Args[1]
  6474  	v_0 := v.Args[0]
  6475  	// match: (REMVU _ (MOVVconst [1]))
  6476  	// result: (MOVVconst [0])
  6477  	for {
  6478  		if v_1.Op != OpLOONG64MOVVconst || auxIntToInt64(v_1.AuxInt) != 1 {
  6479  			break
  6480  		}
  6481  		v.reset(OpLOONG64MOVVconst)
  6482  		v.AuxInt = int64ToAuxInt(0)
  6483  		return true
  6484  	}
  6485  	// match: (REMVU x (MOVVconst [c]))
  6486  	// cond: isPowerOfTwo(c)
  6487  	// result: (ANDconst [c-1] x)
  6488  	for {
  6489  		x := v_0
  6490  		if v_1.Op != OpLOONG64MOVVconst {
  6491  			break
  6492  		}
  6493  		c := auxIntToInt64(v_1.AuxInt)
  6494  		if !(isPowerOfTwo(c)) {
  6495  			break
  6496  		}
  6497  		v.reset(OpLOONG64ANDconst)
  6498  		v.AuxInt = int64ToAuxInt(c - 1)
  6499  		v.AddArg(x)
  6500  		return true
  6501  	}
  6502  	// match: (REMVU (MOVVconst [c]) (MOVVconst [d]))
  6503  	// cond: d != 0
  6504  	// result: (MOVVconst [int64(uint64(c)%uint64(d))])
  6505  	for {
  6506  		if v_0.Op != OpLOONG64MOVVconst {
  6507  			break
  6508  		}
  6509  		c := auxIntToInt64(v_0.AuxInt)
  6510  		if v_1.Op != OpLOONG64MOVVconst {
  6511  			break
  6512  		}
  6513  		d := auxIntToInt64(v_1.AuxInt)
  6514  		if !(d != 0) {
  6515  			break
  6516  		}
  6517  		v.reset(OpLOONG64MOVVconst)
  6518  		v.AuxInt = int64ToAuxInt(int64(uint64(c) % uint64(d)))
  6519  		return true
  6520  	}
  6521  	return false
  6522  }
  6523  func rewriteValueLOONG64_OpLOONG64ROTR(v *Value) bool {
  6524  	v_1 := v.Args[1]
  6525  	v_0 := v.Args[0]
  6526  	// match: (ROTR x (MOVVconst [c]))
  6527  	// result: (ROTRconst x [c&31])
  6528  	for {
  6529  		x := v_0
  6530  		if v_1.Op != OpLOONG64MOVVconst {
  6531  			break
  6532  		}
  6533  		c := auxIntToInt64(v_1.AuxInt)
  6534  		v.reset(OpLOONG64ROTRconst)
  6535  		v.AuxInt = int64ToAuxInt(c & 31)
  6536  		v.AddArg(x)
  6537  		return true
  6538  	}
  6539  	return false
  6540  }
  6541  func rewriteValueLOONG64_OpLOONG64ROTRV(v *Value) bool {
  6542  	v_1 := v.Args[1]
  6543  	v_0 := v.Args[0]
  6544  	// match: (ROTRV x (MOVVconst [c]))
  6545  	// result: (ROTRVconst x [c&63])
  6546  	for {
  6547  		x := v_0
  6548  		if v_1.Op != OpLOONG64MOVVconst {
  6549  			break
  6550  		}
  6551  		c := auxIntToInt64(v_1.AuxInt)
  6552  		v.reset(OpLOONG64ROTRVconst)
  6553  		v.AuxInt = int64ToAuxInt(c & 63)
  6554  		v.AddArg(x)
  6555  		return true
  6556  	}
  6557  	return false
  6558  }
  6559  func rewriteValueLOONG64_OpLOONG64SGT(v *Value) bool {
  6560  	v_1 := v.Args[1]
  6561  	v_0 := v.Args[0]
  6562  	b := v.Block
  6563  	typ := &b.Func.Config.Types
  6564  	// match: (SGT (MOVVconst [c]) (NEGV (SUBVconst [d] x)))
  6565  	// cond: is32Bit(d-c)
  6566  	// result: (SGT x (MOVVconst [d-c]))
  6567  	for {
  6568  		if v_0.Op != OpLOONG64MOVVconst {
  6569  			break
  6570  		}
  6571  		c := auxIntToInt64(v_0.AuxInt)
  6572  		if v_1.Op != OpLOONG64NEGV {
  6573  			break
  6574  		}
  6575  		v_1_0 := v_1.Args[0]
  6576  		if v_1_0.Op != OpLOONG64SUBVconst {
  6577  			break
  6578  		}
  6579  		d := auxIntToInt64(v_1_0.AuxInt)
  6580  		x := v_1_0.Args[0]
  6581  		if !(is32Bit(d - c)) {
  6582  			break
  6583  		}
  6584  		v.reset(OpLOONG64SGT)
  6585  		v0 := b.NewValue0(v.Pos, OpLOONG64MOVVconst, typ.UInt64)
  6586  		v0.AuxInt = int64ToAuxInt(d - c)
  6587  		v.AddArg2(x, v0)
  6588  		return true
  6589  	}
  6590  	// match: (SGT (MOVVconst [c]) x)
  6591  	// cond: is32Bit(c)
  6592  	// result: (SGTconst [c] x)
  6593  	for {
  6594  		if v_0.Op != OpLOONG64MOVVconst {
  6595  			break
  6596  		}
  6597  		c := auxIntToInt64(v_0.AuxInt)
  6598  		x := v_1
  6599  		if !(is32Bit(c)) {
  6600  			break
  6601  		}
  6602  		v.reset(OpLOONG64SGTconst)
  6603  		v.AuxInt = int64ToAuxInt(c)
  6604  		v.AddArg(x)
  6605  		return true
  6606  	}
  6607  	// match: (SGT x x)
  6608  	// result: (MOVVconst [0])
  6609  	for {
  6610  		x := v_0
  6611  		if x != v_1 {
  6612  			break
  6613  		}
  6614  		v.reset(OpLOONG64MOVVconst)
  6615  		v.AuxInt = int64ToAuxInt(0)
  6616  		return true
  6617  	}
  6618  	return false
  6619  }
  6620  func rewriteValueLOONG64_OpLOONG64SGTU(v *Value) bool {
  6621  	v_1 := v.Args[1]
  6622  	v_0 := v.Args[0]
  6623  	// match: (SGTU (MOVVconst [c]) x)
  6624  	// cond: is32Bit(c)
  6625  	// result: (SGTUconst [c] x)
  6626  	for {
  6627  		if v_0.Op != OpLOONG64MOVVconst {
  6628  			break
  6629  		}
  6630  		c := auxIntToInt64(v_0.AuxInt)
  6631  		x := v_1
  6632  		if !(is32Bit(c)) {
  6633  			break
  6634  		}
  6635  		v.reset(OpLOONG64SGTUconst)
  6636  		v.AuxInt = int64ToAuxInt(c)
  6637  		v.AddArg(x)
  6638  		return true
  6639  	}
  6640  	// match: (SGTU x x)
  6641  	// result: (MOVVconst [0])
  6642  	for {
  6643  		x := v_0
  6644  		if x != v_1 {
  6645  			break
  6646  		}
  6647  		v.reset(OpLOONG64MOVVconst)
  6648  		v.AuxInt = int64ToAuxInt(0)
  6649  		return true
  6650  	}
  6651  	return false
  6652  }
  6653  func rewriteValueLOONG64_OpLOONG64SGTUconst(v *Value) bool {
  6654  	v_0 := v.Args[0]
  6655  	// match: (SGTUconst [c] (MOVVconst [d]))
  6656  	// cond: uint64(c)>uint64(d)
  6657  	// result: (MOVVconst [1])
  6658  	for {
  6659  		c := auxIntToInt64(v.AuxInt)
  6660  		if v_0.Op != OpLOONG64MOVVconst {
  6661  			break
  6662  		}
  6663  		d := auxIntToInt64(v_0.AuxInt)
  6664  		if !(uint64(c) > uint64(d)) {
  6665  			break
  6666  		}
  6667  		v.reset(OpLOONG64MOVVconst)
  6668  		v.AuxInt = int64ToAuxInt(1)
  6669  		return true
  6670  	}
  6671  	// match: (SGTUconst [c] (MOVVconst [d]))
  6672  	// cond: uint64(c)<=uint64(d)
  6673  	// result: (MOVVconst [0])
  6674  	for {
  6675  		c := auxIntToInt64(v.AuxInt)
  6676  		if v_0.Op != OpLOONG64MOVVconst {
  6677  			break
  6678  		}
  6679  		d := auxIntToInt64(v_0.AuxInt)
  6680  		if !(uint64(c) <= uint64(d)) {
  6681  			break
  6682  		}
  6683  		v.reset(OpLOONG64MOVVconst)
  6684  		v.AuxInt = int64ToAuxInt(0)
  6685  		return true
  6686  	}
  6687  	// match: (SGTUconst [c] (MOVBUreg _))
  6688  	// cond: 0xff < uint64(c)
  6689  	// result: (MOVVconst [1])
  6690  	for {
  6691  		c := auxIntToInt64(v.AuxInt)
  6692  		if v_0.Op != OpLOONG64MOVBUreg || !(0xff < uint64(c)) {
  6693  			break
  6694  		}
  6695  		v.reset(OpLOONG64MOVVconst)
  6696  		v.AuxInt = int64ToAuxInt(1)
  6697  		return true
  6698  	}
  6699  	// match: (SGTUconst [c] (MOVHUreg _))
  6700  	// cond: 0xffff < uint64(c)
  6701  	// result: (MOVVconst [1])
  6702  	for {
  6703  		c := auxIntToInt64(v.AuxInt)
  6704  		if v_0.Op != OpLOONG64MOVHUreg || !(0xffff < uint64(c)) {
  6705  			break
  6706  		}
  6707  		v.reset(OpLOONG64MOVVconst)
  6708  		v.AuxInt = int64ToAuxInt(1)
  6709  		return true
  6710  	}
  6711  	// match: (SGTUconst [c] (ANDconst [m] _))
  6712  	// cond: uint64(m) < uint64(c)
  6713  	// result: (MOVVconst [1])
  6714  	for {
  6715  		c := auxIntToInt64(v.AuxInt)
  6716  		if v_0.Op != OpLOONG64ANDconst {
  6717  			break
  6718  		}
  6719  		m := auxIntToInt64(v_0.AuxInt)
  6720  		if !(uint64(m) < uint64(c)) {
  6721  			break
  6722  		}
  6723  		v.reset(OpLOONG64MOVVconst)
  6724  		v.AuxInt = int64ToAuxInt(1)
  6725  		return true
  6726  	}
  6727  	// match: (SGTUconst [c] (SRLVconst _ [d]))
  6728  	// cond: 0 < d && d <= 63 && 0xffffffffffffffff>>uint64(d) < uint64(c)
  6729  	// result: (MOVVconst [1])
  6730  	for {
  6731  		c := auxIntToInt64(v.AuxInt)
  6732  		if v_0.Op != OpLOONG64SRLVconst {
  6733  			break
  6734  		}
  6735  		d := auxIntToInt64(v_0.AuxInt)
  6736  		if !(0 < d && d <= 63 && 0xffffffffffffffff>>uint64(d) < uint64(c)) {
  6737  			break
  6738  		}
  6739  		v.reset(OpLOONG64MOVVconst)
  6740  		v.AuxInt = int64ToAuxInt(1)
  6741  		return true
  6742  	}
  6743  	return false
  6744  }
  6745  func rewriteValueLOONG64_OpLOONG64SGTconst(v *Value) bool {
  6746  	v_0 := v.Args[0]
  6747  	// match: (SGTconst [c] (MOVVconst [d]))
  6748  	// cond: c>d
  6749  	// result: (MOVVconst [1])
  6750  	for {
  6751  		c := auxIntToInt64(v.AuxInt)
  6752  		if v_0.Op != OpLOONG64MOVVconst {
  6753  			break
  6754  		}
  6755  		d := auxIntToInt64(v_0.AuxInt)
  6756  		if !(c > d) {
  6757  			break
  6758  		}
  6759  		v.reset(OpLOONG64MOVVconst)
  6760  		v.AuxInt = int64ToAuxInt(1)
  6761  		return true
  6762  	}
  6763  	// match: (SGTconst [c] (MOVVconst [d]))
  6764  	// cond: c<=d
  6765  	// result: (MOVVconst [0])
  6766  	for {
  6767  		c := auxIntToInt64(v.AuxInt)
  6768  		if v_0.Op != OpLOONG64MOVVconst {
  6769  			break
  6770  		}
  6771  		d := auxIntToInt64(v_0.AuxInt)
  6772  		if !(c <= d) {
  6773  			break
  6774  		}
  6775  		v.reset(OpLOONG64MOVVconst)
  6776  		v.AuxInt = int64ToAuxInt(0)
  6777  		return true
  6778  	}
  6779  	// match: (SGTconst [c] (MOVBreg _))
  6780  	// cond: 0x7f < c
  6781  	// result: (MOVVconst [1])
  6782  	for {
  6783  		c := auxIntToInt64(v.AuxInt)
  6784  		if v_0.Op != OpLOONG64MOVBreg || !(0x7f < c) {
  6785  			break
  6786  		}
  6787  		v.reset(OpLOONG64MOVVconst)
  6788  		v.AuxInt = int64ToAuxInt(1)
  6789  		return true
  6790  	}
  6791  	// match: (SGTconst [c] (MOVBreg _))
  6792  	// cond: c <= -0x80
  6793  	// result: (MOVVconst [0])
  6794  	for {
  6795  		c := auxIntToInt64(v.AuxInt)
  6796  		if v_0.Op != OpLOONG64MOVBreg || !(c <= -0x80) {
  6797  			break
  6798  		}
  6799  		v.reset(OpLOONG64MOVVconst)
  6800  		v.AuxInt = int64ToAuxInt(0)
  6801  		return true
  6802  	}
  6803  	// match: (SGTconst [c] (MOVBUreg _))
  6804  	// cond: 0xff < c
  6805  	// result: (MOVVconst [1])
  6806  	for {
  6807  		c := auxIntToInt64(v.AuxInt)
  6808  		if v_0.Op != OpLOONG64MOVBUreg || !(0xff < c) {
  6809  			break
  6810  		}
  6811  		v.reset(OpLOONG64MOVVconst)
  6812  		v.AuxInt = int64ToAuxInt(1)
  6813  		return true
  6814  	}
  6815  	// match: (SGTconst [c] (MOVBUreg _))
  6816  	// cond: c < 0
  6817  	// result: (MOVVconst [0])
  6818  	for {
  6819  		c := auxIntToInt64(v.AuxInt)
  6820  		if v_0.Op != OpLOONG64MOVBUreg || !(c < 0) {
  6821  			break
  6822  		}
  6823  		v.reset(OpLOONG64MOVVconst)
  6824  		v.AuxInt = int64ToAuxInt(0)
  6825  		return true
  6826  	}
  6827  	// match: (SGTconst [c] (MOVHreg _))
  6828  	// cond: 0x7fff < c
  6829  	// result: (MOVVconst [1])
  6830  	for {
  6831  		c := auxIntToInt64(v.AuxInt)
  6832  		if v_0.Op != OpLOONG64MOVHreg || !(0x7fff < c) {
  6833  			break
  6834  		}
  6835  		v.reset(OpLOONG64MOVVconst)
  6836  		v.AuxInt = int64ToAuxInt(1)
  6837  		return true
  6838  	}
  6839  	// match: (SGTconst [c] (MOVHreg _))
  6840  	// cond: c <= -0x8000
  6841  	// result: (MOVVconst [0])
  6842  	for {
  6843  		c := auxIntToInt64(v.AuxInt)
  6844  		if v_0.Op != OpLOONG64MOVHreg || !(c <= -0x8000) {
  6845  			break
  6846  		}
  6847  		v.reset(OpLOONG64MOVVconst)
  6848  		v.AuxInt = int64ToAuxInt(0)
  6849  		return true
  6850  	}
  6851  	// match: (SGTconst [c] (MOVHUreg _))
  6852  	// cond: 0xffff < c
  6853  	// result: (MOVVconst [1])
  6854  	for {
  6855  		c := auxIntToInt64(v.AuxInt)
  6856  		if v_0.Op != OpLOONG64MOVHUreg || !(0xffff < c) {
  6857  			break
  6858  		}
  6859  		v.reset(OpLOONG64MOVVconst)
  6860  		v.AuxInt = int64ToAuxInt(1)
  6861  		return true
  6862  	}
  6863  	// match: (SGTconst [c] (MOVHUreg _))
  6864  	// cond: c < 0
  6865  	// result: (MOVVconst [0])
  6866  	for {
  6867  		c := auxIntToInt64(v.AuxInt)
  6868  		if v_0.Op != OpLOONG64MOVHUreg || !(c < 0) {
  6869  			break
  6870  		}
  6871  		v.reset(OpLOONG64MOVVconst)
  6872  		v.AuxInt = int64ToAuxInt(0)
  6873  		return true
  6874  	}
  6875  	// match: (SGTconst [c] (MOVWUreg _))
  6876  	// cond: c < 0
  6877  	// result: (MOVVconst [0])
  6878  	for {
  6879  		c := auxIntToInt64(v.AuxInt)
  6880  		if v_0.Op != OpLOONG64MOVWUreg || !(c < 0) {
  6881  			break
  6882  		}
  6883  		v.reset(OpLOONG64MOVVconst)
  6884  		v.AuxInt = int64ToAuxInt(0)
  6885  		return true
  6886  	}
  6887  	// match: (SGTconst [c] (ANDconst [m] _))
  6888  	// cond: 0 <= m && m < c
  6889  	// result: (MOVVconst [1])
  6890  	for {
  6891  		c := auxIntToInt64(v.AuxInt)
  6892  		if v_0.Op != OpLOONG64ANDconst {
  6893  			break
  6894  		}
  6895  		m := auxIntToInt64(v_0.AuxInt)
  6896  		if !(0 <= m && m < c) {
  6897  			break
  6898  		}
  6899  		v.reset(OpLOONG64MOVVconst)
  6900  		v.AuxInt = int64ToAuxInt(1)
  6901  		return true
  6902  	}
  6903  	// match: (SGTconst [c] (SRLVconst _ [d]))
  6904  	// cond: 0 <= c && 0 < d && d <= 63 && 0xffffffffffffffff>>uint64(d) < uint64(c)
  6905  	// result: (MOVVconst [1])
  6906  	for {
  6907  		c := auxIntToInt64(v.AuxInt)
  6908  		if v_0.Op != OpLOONG64SRLVconst {
  6909  			break
  6910  		}
  6911  		d := auxIntToInt64(v_0.AuxInt)
  6912  		if !(0 <= c && 0 < d && d <= 63 && 0xffffffffffffffff>>uint64(d) < uint64(c)) {
  6913  			break
  6914  		}
  6915  		v.reset(OpLOONG64MOVVconst)
  6916  		v.AuxInt = int64ToAuxInt(1)
  6917  		return true
  6918  	}
  6919  	return false
  6920  }
  6921  func rewriteValueLOONG64_OpLOONG64SLL(v *Value) bool {
  6922  	v_1 := v.Args[1]
  6923  	v_0 := v.Args[0]
  6924  	// match: (SLL _ (MOVVconst [c]))
  6925  	// cond: uint64(c)>=32
  6926  	// result: (MOVVconst [0])
  6927  	for {
  6928  		if v_1.Op != OpLOONG64MOVVconst {
  6929  			break
  6930  		}
  6931  		c := auxIntToInt64(v_1.AuxInt)
  6932  		if !(uint64(c) >= 32) {
  6933  			break
  6934  		}
  6935  		v.reset(OpLOONG64MOVVconst)
  6936  		v.AuxInt = int64ToAuxInt(0)
  6937  		return true
  6938  	}
  6939  	// match: (SLL x (MOVVconst [c]))
  6940  	// cond: uint64(c) >=0 && uint64(c) <=31
  6941  	// result: (SLLconst x [c])
  6942  	for {
  6943  		x := v_0
  6944  		if v_1.Op != OpLOONG64MOVVconst {
  6945  			break
  6946  		}
  6947  		c := auxIntToInt64(v_1.AuxInt)
  6948  		if !(uint64(c) >= 0 && uint64(c) <= 31) {
  6949  			break
  6950  		}
  6951  		v.reset(OpLOONG64SLLconst)
  6952  		v.AuxInt = int64ToAuxInt(c)
  6953  		v.AddArg(x)
  6954  		return true
  6955  	}
  6956  	// match: (SLL x (ANDconst [31] y))
  6957  	// result: (SLL x y)
  6958  	for {
  6959  		x := v_0
  6960  		if v_1.Op != OpLOONG64ANDconst || auxIntToInt64(v_1.AuxInt) != 31 {
  6961  			break
  6962  		}
  6963  		y := v_1.Args[0]
  6964  		v.reset(OpLOONG64SLL)
  6965  		v.AddArg2(x, y)
  6966  		return true
  6967  	}
  6968  	return false
  6969  }
  6970  func rewriteValueLOONG64_OpLOONG64SLLV(v *Value) bool {
  6971  	v_1 := v.Args[1]
  6972  	v_0 := v.Args[0]
  6973  	// match: (SLLV _ (MOVVconst [c]))
  6974  	// cond: uint64(c)>=64
  6975  	// result: (MOVVconst [0])
  6976  	for {
  6977  		if v_1.Op != OpLOONG64MOVVconst {
  6978  			break
  6979  		}
  6980  		c := auxIntToInt64(v_1.AuxInt)
  6981  		if !(uint64(c) >= 64) {
  6982  			break
  6983  		}
  6984  		v.reset(OpLOONG64MOVVconst)
  6985  		v.AuxInt = int64ToAuxInt(0)
  6986  		return true
  6987  	}
  6988  	// match: (SLLV x (MOVVconst [c]))
  6989  	// result: (SLLVconst x [c])
  6990  	for {
  6991  		x := v_0
  6992  		if v_1.Op != OpLOONG64MOVVconst {
  6993  			break
  6994  		}
  6995  		c := auxIntToInt64(v_1.AuxInt)
  6996  		v.reset(OpLOONG64SLLVconst)
  6997  		v.AuxInt = int64ToAuxInt(c)
  6998  		v.AddArg(x)
  6999  		return true
  7000  	}
  7001  	// match: (SLLV x (ANDconst [63] y))
  7002  	// result: (SLLV x y)
  7003  	for {
  7004  		x := v_0
  7005  		if v_1.Op != OpLOONG64ANDconst || auxIntToInt64(v_1.AuxInt) != 63 {
  7006  			break
  7007  		}
  7008  		y := v_1.Args[0]
  7009  		v.reset(OpLOONG64SLLV)
  7010  		v.AddArg2(x, y)
  7011  		return true
  7012  	}
  7013  	return false
  7014  }
  7015  func rewriteValueLOONG64_OpLOONG64SLLVconst(v *Value) bool {
  7016  	v_0 := v.Args[0]
  7017  	// match: (SLLVconst <t> [c] (ADDV x x))
  7018  	// cond: c < t.Size() * 8 - 1
  7019  	// result: (SLLVconst [c+1] x)
  7020  	for {
  7021  		t := v.Type
  7022  		c := auxIntToInt64(v.AuxInt)
  7023  		if v_0.Op != OpLOONG64ADDV {
  7024  			break
  7025  		}
  7026  		x := v_0.Args[1]
  7027  		if x != v_0.Args[0] || !(c < t.Size()*8-1) {
  7028  			break
  7029  		}
  7030  		v.reset(OpLOONG64SLLVconst)
  7031  		v.AuxInt = int64ToAuxInt(c + 1)
  7032  		v.AddArg(x)
  7033  		return true
  7034  	}
  7035  	// match: (SLLVconst <t> [c] (ADDV x x))
  7036  	// cond: c >= t.Size() * 8 - 1
  7037  	// result: (MOVVconst [0])
  7038  	for {
  7039  		t := v.Type
  7040  		c := auxIntToInt64(v.AuxInt)
  7041  		if v_0.Op != OpLOONG64ADDV {
  7042  			break
  7043  		}
  7044  		x := v_0.Args[1]
  7045  		if x != v_0.Args[0] || !(c >= t.Size()*8-1) {
  7046  			break
  7047  		}
  7048  		v.reset(OpLOONG64MOVVconst)
  7049  		v.AuxInt = int64ToAuxInt(0)
  7050  		return true
  7051  	}
  7052  	// match: (SLLVconst [c] (MOVVconst [d]))
  7053  	// result: (MOVVconst [d<<uint64(c)])
  7054  	for {
  7055  		c := auxIntToInt64(v.AuxInt)
  7056  		if v_0.Op != OpLOONG64MOVVconst {
  7057  			break
  7058  		}
  7059  		d := auxIntToInt64(v_0.AuxInt)
  7060  		v.reset(OpLOONG64MOVVconst)
  7061  		v.AuxInt = int64ToAuxInt(d << uint64(c))
  7062  		return true
  7063  	}
  7064  	return false
  7065  }
  7066  func rewriteValueLOONG64_OpLOONG64SLLconst(v *Value) bool {
  7067  	v_0 := v.Args[0]
  7068  	// match: (SLLconst <t> [c] (ADDV x x))
  7069  	// cond: c < t.Size() * 8 - 1
  7070  	// result: (SLLconst [c+1] x)
  7071  	for {
  7072  		t := v.Type
  7073  		c := auxIntToInt64(v.AuxInt)
  7074  		if v_0.Op != OpLOONG64ADDV {
  7075  			break
  7076  		}
  7077  		x := v_0.Args[1]
  7078  		if x != v_0.Args[0] || !(c < t.Size()*8-1) {
  7079  			break
  7080  		}
  7081  		v.reset(OpLOONG64SLLconst)
  7082  		v.AuxInt = int64ToAuxInt(c + 1)
  7083  		v.AddArg(x)
  7084  		return true
  7085  	}
  7086  	// match: (SLLconst <t> [c] (ADDV x x))
  7087  	// cond: c >= t.Size() * 8 - 1
  7088  	// result: (MOVVconst [0])
  7089  	for {
  7090  		t := v.Type
  7091  		c := auxIntToInt64(v.AuxInt)
  7092  		if v_0.Op != OpLOONG64ADDV {
  7093  			break
  7094  		}
  7095  		x := v_0.Args[1]
  7096  		if x != v_0.Args[0] || !(c >= t.Size()*8-1) {
  7097  			break
  7098  		}
  7099  		v.reset(OpLOONG64MOVVconst)
  7100  		v.AuxInt = int64ToAuxInt(0)
  7101  		return true
  7102  	}
  7103  	return false
  7104  }
  7105  func rewriteValueLOONG64_OpLOONG64SRA(v *Value) bool {
  7106  	v_1 := v.Args[1]
  7107  	v_0 := v.Args[0]
  7108  	// match: (SRA x (MOVVconst [c]))
  7109  	// cond: uint64(c)>=32
  7110  	// result: (SRAconst x [31])
  7111  	for {
  7112  		x := v_0
  7113  		if v_1.Op != OpLOONG64MOVVconst {
  7114  			break
  7115  		}
  7116  		c := auxIntToInt64(v_1.AuxInt)
  7117  		if !(uint64(c) >= 32) {
  7118  			break
  7119  		}
  7120  		v.reset(OpLOONG64SRAconst)
  7121  		v.AuxInt = int64ToAuxInt(31)
  7122  		v.AddArg(x)
  7123  		return true
  7124  	}
  7125  	// match: (SRA x (MOVVconst [c]))
  7126  	// cond: uint64(c) >=0 && uint64(c) <=31
  7127  	// result: (SRAconst x [c])
  7128  	for {
  7129  		x := v_0
  7130  		if v_1.Op != OpLOONG64MOVVconst {
  7131  			break
  7132  		}
  7133  		c := auxIntToInt64(v_1.AuxInt)
  7134  		if !(uint64(c) >= 0 && uint64(c) <= 31) {
  7135  			break
  7136  		}
  7137  		v.reset(OpLOONG64SRAconst)
  7138  		v.AuxInt = int64ToAuxInt(c)
  7139  		v.AddArg(x)
  7140  		return true
  7141  	}
  7142  	// match: (SRA x (ANDconst [31] y))
  7143  	// result: (SRA x y)
  7144  	for {
  7145  		x := v_0
  7146  		if v_1.Op != OpLOONG64ANDconst || auxIntToInt64(v_1.AuxInt) != 31 {
  7147  			break
  7148  		}
  7149  		y := v_1.Args[0]
  7150  		v.reset(OpLOONG64SRA)
  7151  		v.AddArg2(x, y)
  7152  		return true
  7153  	}
  7154  	return false
  7155  }
  7156  func rewriteValueLOONG64_OpLOONG64SRAV(v *Value) bool {
  7157  	v_1 := v.Args[1]
  7158  	v_0 := v.Args[0]
  7159  	// match: (SRAV x (MOVVconst [c]))
  7160  	// cond: uint64(c)>=64
  7161  	// result: (SRAVconst x [63])
  7162  	for {
  7163  		x := v_0
  7164  		if v_1.Op != OpLOONG64MOVVconst {
  7165  			break
  7166  		}
  7167  		c := auxIntToInt64(v_1.AuxInt)
  7168  		if !(uint64(c) >= 64) {
  7169  			break
  7170  		}
  7171  		v.reset(OpLOONG64SRAVconst)
  7172  		v.AuxInt = int64ToAuxInt(63)
  7173  		v.AddArg(x)
  7174  		return true
  7175  	}
  7176  	// match: (SRAV x (MOVVconst [c]))
  7177  	// result: (SRAVconst x [c])
  7178  	for {
  7179  		x := v_0
  7180  		if v_1.Op != OpLOONG64MOVVconst {
  7181  			break
  7182  		}
  7183  		c := auxIntToInt64(v_1.AuxInt)
  7184  		v.reset(OpLOONG64SRAVconst)
  7185  		v.AuxInt = int64ToAuxInt(c)
  7186  		v.AddArg(x)
  7187  		return true
  7188  	}
  7189  	// match: (SRAV x (ANDconst [63] y))
  7190  	// result: (SRAV x y)
  7191  	for {
  7192  		x := v_0
  7193  		if v_1.Op != OpLOONG64ANDconst || auxIntToInt64(v_1.AuxInt) != 63 {
  7194  			break
  7195  		}
  7196  		y := v_1.Args[0]
  7197  		v.reset(OpLOONG64SRAV)
  7198  		v.AddArg2(x, y)
  7199  		return true
  7200  	}
  7201  	return false
  7202  }
  7203  func rewriteValueLOONG64_OpLOONG64SRAVconst(v *Value) bool {
  7204  	v_0 := v.Args[0]
  7205  	b := v.Block
  7206  	// match: (SRAVconst [rc] (MOVWreg y))
  7207  	// cond: rc >= 0 && rc <= 31
  7208  	// result: (SRAconst [int64(rc)] y)
  7209  	for {
  7210  		rc := auxIntToInt64(v.AuxInt)
  7211  		if v_0.Op != OpLOONG64MOVWreg {
  7212  			break
  7213  		}
  7214  		y := v_0.Args[0]
  7215  		if !(rc >= 0 && rc <= 31) {
  7216  			break
  7217  		}
  7218  		v.reset(OpLOONG64SRAconst)
  7219  		v.AuxInt = int64ToAuxInt(int64(rc))
  7220  		v.AddArg(y)
  7221  		return true
  7222  	}
  7223  	// match: (SRAVconst <t> [rc] (MOVBreg y))
  7224  	// cond: rc >= 8
  7225  	// result: (SRAVconst [63] (SLLVconst <t> [56] y))
  7226  	for {
  7227  		t := v.Type
  7228  		rc := auxIntToInt64(v.AuxInt)
  7229  		if v_0.Op != OpLOONG64MOVBreg {
  7230  			break
  7231  		}
  7232  		y := v_0.Args[0]
  7233  		if !(rc >= 8) {
  7234  			break
  7235  		}
  7236  		v.reset(OpLOONG64SRAVconst)
  7237  		v.AuxInt = int64ToAuxInt(63)
  7238  		v0 := b.NewValue0(v.Pos, OpLOONG64SLLVconst, t)
  7239  		v0.AuxInt = int64ToAuxInt(56)
  7240  		v0.AddArg(y)
  7241  		v.AddArg(v0)
  7242  		return true
  7243  	}
  7244  	// match: (SRAVconst <t> [rc] (MOVHreg y))
  7245  	// cond: rc >= 16
  7246  	// result: (SRAVconst [63] (SLLVconst <t> [48] y))
  7247  	for {
  7248  		t := v.Type
  7249  		rc := auxIntToInt64(v.AuxInt)
  7250  		if v_0.Op != OpLOONG64MOVHreg {
  7251  			break
  7252  		}
  7253  		y := v_0.Args[0]
  7254  		if !(rc >= 16) {
  7255  			break
  7256  		}
  7257  		v.reset(OpLOONG64SRAVconst)
  7258  		v.AuxInt = int64ToAuxInt(63)
  7259  		v0 := b.NewValue0(v.Pos, OpLOONG64SLLVconst, t)
  7260  		v0.AuxInt = int64ToAuxInt(48)
  7261  		v0.AddArg(y)
  7262  		v.AddArg(v0)
  7263  		return true
  7264  	}
  7265  	// match: (SRAVconst <t> [rc] (MOVWreg y))
  7266  	// cond: rc >= 32
  7267  	// result: (SRAconst [31] y)
  7268  	for {
  7269  		rc := auxIntToInt64(v.AuxInt)
  7270  		if v_0.Op != OpLOONG64MOVWreg {
  7271  			break
  7272  		}
  7273  		y := v_0.Args[0]
  7274  		if !(rc >= 32) {
  7275  			break
  7276  		}
  7277  		v.reset(OpLOONG64SRAconst)
  7278  		v.AuxInt = int64ToAuxInt(31)
  7279  		v.AddArg(y)
  7280  		return true
  7281  	}
  7282  	// match: (SRAVconst [c] (MOVVconst [d]))
  7283  	// result: (MOVVconst [d>>uint64(c)])
  7284  	for {
  7285  		c := auxIntToInt64(v.AuxInt)
  7286  		if v_0.Op != OpLOONG64MOVVconst {
  7287  			break
  7288  		}
  7289  		d := auxIntToInt64(v_0.AuxInt)
  7290  		v.reset(OpLOONG64MOVVconst)
  7291  		v.AuxInt = int64ToAuxInt(d >> uint64(c))
  7292  		return true
  7293  	}
  7294  	return false
  7295  }
  7296  func rewriteValueLOONG64_OpLOONG64SRL(v *Value) bool {
  7297  	v_1 := v.Args[1]
  7298  	v_0 := v.Args[0]
  7299  	// match: (SRL _ (MOVVconst [c]))
  7300  	// cond: uint64(c)>=32
  7301  	// result: (MOVVconst [0])
  7302  	for {
  7303  		if v_1.Op != OpLOONG64MOVVconst {
  7304  			break
  7305  		}
  7306  		c := auxIntToInt64(v_1.AuxInt)
  7307  		if !(uint64(c) >= 32) {
  7308  			break
  7309  		}
  7310  		v.reset(OpLOONG64MOVVconst)
  7311  		v.AuxInt = int64ToAuxInt(0)
  7312  		return true
  7313  	}
  7314  	// match: (SRL x (MOVVconst [c]))
  7315  	// cond: uint64(c) >=0 && uint64(c) <=31
  7316  	// result: (SRLconst x [c])
  7317  	for {
  7318  		x := v_0
  7319  		if v_1.Op != OpLOONG64MOVVconst {
  7320  			break
  7321  		}
  7322  		c := auxIntToInt64(v_1.AuxInt)
  7323  		if !(uint64(c) >= 0 && uint64(c) <= 31) {
  7324  			break
  7325  		}
  7326  		v.reset(OpLOONG64SRLconst)
  7327  		v.AuxInt = int64ToAuxInt(c)
  7328  		v.AddArg(x)
  7329  		return true
  7330  	}
  7331  	// match: (SRL x (ANDconst [31] y))
  7332  	// result: (SRL x y)
  7333  	for {
  7334  		x := v_0
  7335  		if v_1.Op != OpLOONG64ANDconst || auxIntToInt64(v_1.AuxInt) != 31 {
  7336  			break
  7337  		}
  7338  		y := v_1.Args[0]
  7339  		v.reset(OpLOONG64SRL)
  7340  		v.AddArg2(x, y)
  7341  		return true
  7342  	}
  7343  	return false
  7344  }
  7345  func rewriteValueLOONG64_OpLOONG64SRLV(v *Value) bool {
  7346  	v_1 := v.Args[1]
  7347  	v_0 := v.Args[0]
  7348  	// match: (SRLV _ (MOVVconst [c]))
  7349  	// cond: uint64(c)>=64
  7350  	// result: (MOVVconst [0])
  7351  	for {
  7352  		if v_1.Op != OpLOONG64MOVVconst {
  7353  			break
  7354  		}
  7355  		c := auxIntToInt64(v_1.AuxInt)
  7356  		if !(uint64(c) >= 64) {
  7357  			break
  7358  		}
  7359  		v.reset(OpLOONG64MOVVconst)
  7360  		v.AuxInt = int64ToAuxInt(0)
  7361  		return true
  7362  	}
  7363  	// match: (SRLV x (MOVVconst [c]))
  7364  	// result: (SRLVconst x [c])
  7365  	for {
  7366  		x := v_0
  7367  		if v_1.Op != OpLOONG64MOVVconst {
  7368  			break
  7369  		}
  7370  		c := auxIntToInt64(v_1.AuxInt)
  7371  		v.reset(OpLOONG64SRLVconst)
  7372  		v.AuxInt = int64ToAuxInt(c)
  7373  		v.AddArg(x)
  7374  		return true
  7375  	}
  7376  	// match: (SRLV x (ANDconst [63] y))
  7377  	// result: (SRLV x y)
  7378  	for {
  7379  		x := v_0
  7380  		if v_1.Op != OpLOONG64ANDconst || auxIntToInt64(v_1.AuxInt) != 63 {
  7381  			break
  7382  		}
  7383  		y := v_1.Args[0]
  7384  		v.reset(OpLOONG64SRLV)
  7385  		v.AddArg2(x, y)
  7386  		return true
  7387  	}
  7388  	return false
  7389  }
  7390  func rewriteValueLOONG64_OpLOONG64SRLVconst(v *Value) bool {
  7391  	v_0 := v.Args[0]
  7392  	// match: (SRLVconst [rc] (SLLVconst [lc] x))
  7393  	// cond: lc <= rc
  7394  	// result: (BSTRPICKV [rc-lc + ((64-lc)-1)<<6] x)
  7395  	for {
  7396  		rc := auxIntToInt64(v.AuxInt)
  7397  		if v_0.Op != OpLOONG64SLLVconst {
  7398  			break
  7399  		}
  7400  		lc := auxIntToInt64(v_0.AuxInt)
  7401  		x := v_0.Args[0]
  7402  		if !(lc <= rc) {
  7403  			break
  7404  		}
  7405  		v.reset(OpLOONG64BSTRPICKV)
  7406  		v.AuxInt = int64ToAuxInt(rc - lc + ((64-lc)-1)<<6)
  7407  		v.AddArg(x)
  7408  		return true
  7409  	}
  7410  	// match: (SRLVconst [rc] (MOVWUreg x))
  7411  	// cond: rc < 32
  7412  	// result: (BSTRPICKV [rc + 31<<6] x)
  7413  	for {
  7414  		rc := auxIntToInt64(v.AuxInt)
  7415  		if v_0.Op != OpLOONG64MOVWUreg {
  7416  			break
  7417  		}
  7418  		x := v_0.Args[0]
  7419  		if !(rc < 32) {
  7420  			break
  7421  		}
  7422  		v.reset(OpLOONG64BSTRPICKV)
  7423  		v.AuxInt = int64ToAuxInt(rc + 31<<6)
  7424  		v.AddArg(x)
  7425  		return true
  7426  	}
  7427  	// match: (SRLVconst [rc] (MOVHUreg x))
  7428  	// cond: rc < 16
  7429  	// result: (BSTRPICKV [rc + 15<<6] x)
  7430  	for {
  7431  		rc := auxIntToInt64(v.AuxInt)
  7432  		if v_0.Op != OpLOONG64MOVHUreg {
  7433  			break
  7434  		}
  7435  		x := v_0.Args[0]
  7436  		if !(rc < 16) {
  7437  			break
  7438  		}
  7439  		v.reset(OpLOONG64BSTRPICKV)
  7440  		v.AuxInt = int64ToAuxInt(rc + 15<<6)
  7441  		v.AddArg(x)
  7442  		return true
  7443  	}
  7444  	// match: (SRLVconst [rc] (MOVBUreg x))
  7445  	// cond: rc < 8
  7446  	// result: (BSTRPICKV [rc + 7<<6] x)
  7447  	for {
  7448  		rc := auxIntToInt64(v.AuxInt)
  7449  		if v_0.Op != OpLOONG64MOVBUreg {
  7450  			break
  7451  		}
  7452  		x := v_0.Args[0]
  7453  		if !(rc < 8) {
  7454  			break
  7455  		}
  7456  		v.reset(OpLOONG64BSTRPICKV)
  7457  		v.AuxInt = int64ToAuxInt(rc + 7<<6)
  7458  		v.AddArg(x)
  7459  		return true
  7460  	}
  7461  	// match: (SRLVconst [rc] (MOVWUreg y))
  7462  	// cond: rc >= 0 && rc <= 31
  7463  	// result: (SRLconst [int64(rc)] y)
  7464  	for {
  7465  		rc := auxIntToInt64(v.AuxInt)
  7466  		if v_0.Op != OpLOONG64MOVWUreg {
  7467  			break
  7468  		}
  7469  		y := v_0.Args[0]
  7470  		if !(rc >= 0 && rc <= 31) {
  7471  			break
  7472  		}
  7473  		v.reset(OpLOONG64SRLconst)
  7474  		v.AuxInt = int64ToAuxInt(int64(rc))
  7475  		v.AddArg(y)
  7476  		return true
  7477  	}
  7478  	// match: (SRLVconst [rc] (MOVWUreg x))
  7479  	// cond: rc >= 32
  7480  	// result: (MOVVconst [0])
  7481  	for {
  7482  		rc := auxIntToInt64(v.AuxInt)
  7483  		if v_0.Op != OpLOONG64MOVWUreg {
  7484  			break
  7485  		}
  7486  		if !(rc >= 32) {
  7487  			break
  7488  		}
  7489  		v.reset(OpLOONG64MOVVconst)
  7490  		v.AuxInt = int64ToAuxInt(0)
  7491  		return true
  7492  	}
  7493  	// match: (SRLVconst [rc] (MOVHUreg x))
  7494  	// cond: rc >= 16
  7495  	// result: (MOVVconst [0])
  7496  	for {
  7497  		rc := auxIntToInt64(v.AuxInt)
  7498  		if v_0.Op != OpLOONG64MOVHUreg {
  7499  			break
  7500  		}
  7501  		if !(rc >= 16) {
  7502  			break
  7503  		}
  7504  		v.reset(OpLOONG64MOVVconst)
  7505  		v.AuxInt = int64ToAuxInt(0)
  7506  		return true
  7507  	}
  7508  	// match: (SRLVconst [rc] (MOVBUreg x))
  7509  	// cond: rc >= 8
  7510  	// result: (MOVVconst [0])
  7511  	for {
  7512  		rc := auxIntToInt64(v.AuxInt)
  7513  		if v_0.Op != OpLOONG64MOVBUreg {
  7514  			break
  7515  		}
  7516  		if !(rc >= 8) {
  7517  			break
  7518  		}
  7519  		v.reset(OpLOONG64MOVVconst)
  7520  		v.AuxInt = int64ToAuxInt(0)
  7521  		return true
  7522  	}
  7523  	// match: (SRLVconst [c] (MOVVconst [d]))
  7524  	// result: (MOVVconst [int64(uint64(d)>>uint64(c))])
  7525  	for {
  7526  		c := auxIntToInt64(v.AuxInt)
  7527  		if v_0.Op != OpLOONG64MOVVconst {
  7528  			break
  7529  		}
  7530  		d := auxIntToInt64(v_0.AuxInt)
  7531  		v.reset(OpLOONG64MOVVconst)
  7532  		v.AuxInt = int64ToAuxInt(int64(uint64(d) >> uint64(c)))
  7533  		return true
  7534  	}
  7535  	return false
  7536  }
  7537  func rewriteValueLOONG64_OpLOONG64SUBD(v *Value) bool {
  7538  	v_1 := v.Args[1]
  7539  	v_0 := v.Args[0]
  7540  	// match: (SUBD (MULD x y) z)
  7541  	// cond: z.Block.Func.useFMA(v)
  7542  	// result: (FMSUBD x y z)
  7543  	for {
  7544  		if v_0.Op != OpLOONG64MULD {
  7545  			break
  7546  		}
  7547  		y := v_0.Args[1]
  7548  		x := v_0.Args[0]
  7549  		z := v_1
  7550  		if !(z.Block.Func.useFMA(v)) {
  7551  			break
  7552  		}
  7553  		v.reset(OpLOONG64FMSUBD)
  7554  		v.AddArg3(x, y, z)
  7555  		return true
  7556  	}
  7557  	// match: (SUBD z (MULD x y))
  7558  	// cond: z.Block.Func.useFMA(v)
  7559  	// result: (FNMSUBD x y z)
  7560  	for {
  7561  		z := v_0
  7562  		if v_1.Op != OpLOONG64MULD {
  7563  			break
  7564  		}
  7565  		y := v_1.Args[1]
  7566  		x := v_1.Args[0]
  7567  		if !(z.Block.Func.useFMA(v)) {
  7568  			break
  7569  		}
  7570  		v.reset(OpLOONG64FNMSUBD)
  7571  		v.AddArg3(x, y, z)
  7572  		return true
  7573  	}
  7574  	// match: (SUBD z (NEGD (MULD x y)))
  7575  	// cond: z.Block.Func.useFMA(v)
  7576  	// result: (FMADDD x y z)
  7577  	for {
  7578  		z := v_0
  7579  		if v_1.Op != OpLOONG64NEGD {
  7580  			break
  7581  		}
  7582  		v_1_0 := v_1.Args[0]
  7583  		if v_1_0.Op != OpLOONG64MULD {
  7584  			break
  7585  		}
  7586  		y := v_1_0.Args[1]
  7587  		x := v_1_0.Args[0]
  7588  		if !(z.Block.Func.useFMA(v)) {
  7589  			break
  7590  		}
  7591  		v.reset(OpLOONG64FMADDD)
  7592  		v.AddArg3(x, y, z)
  7593  		return true
  7594  	}
  7595  	// match: (SUBD (NEGD (MULD x y)) z)
  7596  	// cond: z.Block.Func.useFMA(v)
  7597  	// result: (FNMADDD x y z)
  7598  	for {
  7599  		if v_0.Op != OpLOONG64NEGD {
  7600  			break
  7601  		}
  7602  		v_0_0 := v_0.Args[0]
  7603  		if v_0_0.Op != OpLOONG64MULD {
  7604  			break
  7605  		}
  7606  		y := v_0_0.Args[1]
  7607  		x := v_0_0.Args[0]
  7608  		z := v_1
  7609  		if !(z.Block.Func.useFMA(v)) {
  7610  			break
  7611  		}
  7612  		v.reset(OpLOONG64FNMADDD)
  7613  		v.AddArg3(x, y, z)
  7614  		return true
  7615  	}
  7616  	return false
  7617  }
  7618  func rewriteValueLOONG64_OpLOONG64SUBF(v *Value) bool {
  7619  	v_1 := v.Args[1]
  7620  	v_0 := v.Args[0]
  7621  	// match: (SUBF (MULF x y) z)
  7622  	// cond: z.Block.Func.useFMA(v)
  7623  	// result: (FMSUBF x y z)
  7624  	for {
  7625  		if v_0.Op != OpLOONG64MULF {
  7626  			break
  7627  		}
  7628  		y := v_0.Args[1]
  7629  		x := v_0.Args[0]
  7630  		z := v_1
  7631  		if !(z.Block.Func.useFMA(v)) {
  7632  			break
  7633  		}
  7634  		v.reset(OpLOONG64FMSUBF)
  7635  		v.AddArg3(x, y, z)
  7636  		return true
  7637  	}
  7638  	// match: (SUBF z (MULF x y))
  7639  	// cond: z.Block.Func.useFMA(v)
  7640  	// result: (FNMSUBF x y z)
  7641  	for {
  7642  		z := v_0
  7643  		if v_1.Op != OpLOONG64MULF {
  7644  			break
  7645  		}
  7646  		y := v_1.Args[1]
  7647  		x := v_1.Args[0]
  7648  		if !(z.Block.Func.useFMA(v)) {
  7649  			break
  7650  		}
  7651  		v.reset(OpLOONG64FNMSUBF)
  7652  		v.AddArg3(x, y, z)
  7653  		return true
  7654  	}
  7655  	// match: (SUBF z (NEGF (MULF x y)))
  7656  	// cond: z.Block.Func.useFMA(v)
  7657  	// result: (FMADDF x y z)
  7658  	for {
  7659  		z := v_0
  7660  		if v_1.Op != OpLOONG64NEGF {
  7661  			break
  7662  		}
  7663  		v_1_0 := v_1.Args[0]
  7664  		if v_1_0.Op != OpLOONG64MULF {
  7665  			break
  7666  		}
  7667  		y := v_1_0.Args[1]
  7668  		x := v_1_0.Args[0]
  7669  		if !(z.Block.Func.useFMA(v)) {
  7670  			break
  7671  		}
  7672  		v.reset(OpLOONG64FMADDF)
  7673  		v.AddArg3(x, y, z)
  7674  		return true
  7675  	}
  7676  	// match: (SUBF (NEGF (MULF x y)) z)
  7677  	// cond: z.Block.Func.useFMA(v)
  7678  	// result: (FNMADDF x y z)
  7679  	for {
  7680  		if v_0.Op != OpLOONG64NEGF {
  7681  			break
  7682  		}
  7683  		v_0_0 := v_0.Args[0]
  7684  		if v_0_0.Op != OpLOONG64MULF {
  7685  			break
  7686  		}
  7687  		y := v_0_0.Args[1]
  7688  		x := v_0_0.Args[0]
  7689  		z := v_1
  7690  		if !(z.Block.Func.useFMA(v)) {
  7691  			break
  7692  		}
  7693  		v.reset(OpLOONG64FNMADDF)
  7694  		v.AddArg3(x, y, z)
  7695  		return true
  7696  	}
  7697  	return false
  7698  }
  7699  func rewriteValueLOONG64_OpLOONG64SUBV(v *Value) bool {
  7700  	v_1 := v.Args[1]
  7701  	v_0 := v.Args[0]
  7702  	// match: (SUBV x (MOVVconst [c]))
  7703  	// cond: is32Bit(c)
  7704  	// result: (SUBVconst [c] x)
  7705  	for {
  7706  		x := v_0
  7707  		if v_1.Op != OpLOONG64MOVVconst {
  7708  			break
  7709  		}
  7710  		c := auxIntToInt64(v_1.AuxInt)
  7711  		if !(is32Bit(c)) {
  7712  			break
  7713  		}
  7714  		v.reset(OpLOONG64SUBVconst)
  7715  		v.AuxInt = int64ToAuxInt(c)
  7716  		v.AddArg(x)
  7717  		return true
  7718  	}
  7719  	// match: (SUBV x (NEGV y))
  7720  	// result: (ADDV x y)
  7721  	for {
  7722  		x := v_0
  7723  		if v_1.Op != OpLOONG64NEGV {
  7724  			break
  7725  		}
  7726  		y := v_1.Args[0]
  7727  		v.reset(OpLOONG64ADDV)
  7728  		v.AddArg2(x, y)
  7729  		return true
  7730  	}
  7731  	// match: (SUBV x x)
  7732  	// result: (MOVVconst [0])
  7733  	for {
  7734  		x := v_0
  7735  		if x != v_1 {
  7736  			break
  7737  		}
  7738  		v.reset(OpLOONG64MOVVconst)
  7739  		v.AuxInt = int64ToAuxInt(0)
  7740  		return true
  7741  	}
  7742  	// match: (SUBV (MOVVconst [0]) x)
  7743  	// result: (NEGV x)
  7744  	for {
  7745  		if v_0.Op != OpLOONG64MOVVconst || auxIntToInt64(v_0.AuxInt) != 0 {
  7746  			break
  7747  		}
  7748  		x := v_1
  7749  		v.reset(OpLOONG64NEGV)
  7750  		v.AddArg(x)
  7751  		return true
  7752  	}
  7753  	// match: (SUBV (MOVVconst [c]) (NEGV (SUBVconst [d] x)))
  7754  	// result: (ADDVconst [c-d] x)
  7755  	for {
  7756  		if v_0.Op != OpLOONG64MOVVconst {
  7757  			break
  7758  		}
  7759  		c := auxIntToInt64(v_0.AuxInt)
  7760  		if v_1.Op != OpLOONG64NEGV {
  7761  			break
  7762  		}
  7763  		v_1_0 := v_1.Args[0]
  7764  		if v_1_0.Op != OpLOONG64SUBVconst {
  7765  			break
  7766  		}
  7767  		d := auxIntToInt64(v_1_0.AuxInt)
  7768  		x := v_1_0.Args[0]
  7769  		v.reset(OpLOONG64ADDVconst)
  7770  		v.AuxInt = int64ToAuxInt(c - d)
  7771  		v.AddArg(x)
  7772  		return true
  7773  	}
  7774  	return false
  7775  }
  7776  func rewriteValueLOONG64_OpLOONG64SUBVconst(v *Value) bool {
  7777  	v_0 := v.Args[0]
  7778  	// match: (SUBVconst [0] x)
  7779  	// result: x
  7780  	for {
  7781  		if auxIntToInt64(v.AuxInt) != 0 {
  7782  			break
  7783  		}
  7784  		x := v_0
  7785  		v.copyOf(x)
  7786  		return true
  7787  	}
  7788  	// match: (SUBVconst [c] (MOVVconst [d]))
  7789  	// result: (MOVVconst [d-c])
  7790  	for {
  7791  		c := auxIntToInt64(v.AuxInt)
  7792  		if v_0.Op != OpLOONG64MOVVconst {
  7793  			break
  7794  		}
  7795  		d := auxIntToInt64(v_0.AuxInt)
  7796  		v.reset(OpLOONG64MOVVconst)
  7797  		v.AuxInt = int64ToAuxInt(d - c)
  7798  		return true
  7799  	}
  7800  	// match: (SUBVconst [c] (SUBVconst [d] x))
  7801  	// cond: is32Bit(-c-d)
  7802  	// result: (ADDVconst [-c-d] x)
  7803  	for {
  7804  		c := auxIntToInt64(v.AuxInt)
  7805  		if v_0.Op != OpLOONG64SUBVconst {
  7806  			break
  7807  		}
  7808  		d := auxIntToInt64(v_0.AuxInt)
  7809  		x := v_0.Args[0]
  7810  		if !(is32Bit(-c - d)) {
  7811  			break
  7812  		}
  7813  		v.reset(OpLOONG64ADDVconst)
  7814  		v.AuxInt = int64ToAuxInt(-c - d)
  7815  		v.AddArg(x)
  7816  		return true
  7817  	}
  7818  	// match: (SUBVconst [c] (ADDVconst [d] x))
  7819  	// cond: is32Bit(-c+d)
  7820  	// result: (ADDVconst [-c+d] x)
  7821  	for {
  7822  		c := auxIntToInt64(v.AuxInt)
  7823  		if v_0.Op != OpLOONG64ADDVconst {
  7824  			break
  7825  		}
  7826  		d := auxIntToInt64(v_0.AuxInt)
  7827  		x := v_0.Args[0]
  7828  		if !(is32Bit(-c + d)) {
  7829  			break
  7830  		}
  7831  		v.reset(OpLOONG64ADDVconst)
  7832  		v.AuxInt = int64ToAuxInt(-c + d)
  7833  		v.AddArg(x)
  7834  		return true
  7835  	}
  7836  	return false
  7837  }
  7838  func rewriteValueLOONG64_OpLOONG64XOR(v *Value) bool {
  7839  	v_1 := v.Args[1]
  7840  	v_0 := v.Args[0]
  7841  	b := v.Block
  7842  	typ := &b.Func.Config.Types
  7843  	// match: (XOR <typ.UInt16> (SRLVconst [8] <typ.UInt16> x) (SLLVconst [8] <typ.UInt16> x))
  7844  	// result: (REVB2H x)
  7845  	for {
  7846  		if v.Type != typ.UInt16 {
  7847  			break
  7848  		}
  7849  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
  7850  			if v_0.Op != OpLOONG64SRLVconst || v_0.Type != typ.UInt16 || auxIntToInt64(v_0.AuxInt) != 8 {
  7851  				continue
  7852  			}
  7853  			x := v_0.Args[0]
  7854  			if v_1.Op != OpLOONG64SLLVconst || v_1.Type != typ.UInt16 || auxIntToInt64(v_1.AuxInt) != 8 || x != v_1.Args[0] {
  7855  				continue
  7856  			}
  7857  			v.reset(OpLOONG64REVB2H)
  7858  			v.AddArg(x)
  7859  			return true
  7860  		}
  7861  		break
  7862  	}
  7863  	// match: (XOR (SRLconst [8] (ANDconst [c1] x)) (SLLconst [8] (ANDconst [c2] x)))
  7864  	// cond: uint32(c1) == 0xff00ff00 && uint32(c2) == 0x00ff00ff
  7865  	// result: (REVB2H x)
  7866  	for {
  7867  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
  7868  			if v_0.Op != OpLOONG64SRLconst || auxIntToInt64(v_0.AuxInt) != 8 {
  7869  				continue
  7870  			}
  7871  			v_0_0 := v_0.Args[0]
  7872  			if v_0_0.Op != OpLOONG64ANDconst {
  7873  				continue
  7874  			}
  7875  			c1 := auxIntToInt64(v_0_0.AuxInt)
  7876  			x := v_0_0.Args[0]
  7877  			if v_1.Op != OpLOONG64SLLconst || auxIntToInt64(v_1.AuxInt) != 8 {
  7878  				continue
  7879  			}
  7880  			v_1_0 := v_1.Args[0]
  7881  			if v_1_0.Op != OpLOONG64ANDconst {
  7882  				continue
  7883  			}
  7884  			c2 := auxIntToInt64(v_1_0.AuxInt)
  7885  			if x != v_1_0.Args[0] || !(uint32(c1) == 0xff00ff00 && uint32(c2) == 0x00ff00ff) {
  7886  				continue
  7887  			}
  7888  			v.reset(OpLOONG64REVB2H)
  7889  			v.AddArg(x)
  7890  			return true
  7891  		}
  7892  		break
  7893  	}
  7894  	// match: (XOR (SRLVconst [8] (AND (MOVVconst [c1]) x)) (SLLVconst [8] (AND (MOVVconst [c2]) x)))
  7895  	// cond: uint64(c1) == 0xff00ff00ff00ff00 && uint64(c2) == 0x00ff00ff00ff00ff
  7896  	// result: (REVB4H x)
  7897  	for {
  7898  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
  7899  			if v_0.Op != OpLOONG64SRLVconst || auxIntToInt64(v_0.AuxInt) != 8 {
  7900  				continue
  7901  			}
  7902  			v_0_0 := v_0.Args[0]
  7903  			if v_0_0.Op != OpLOONG64AND {
  7904  				continue
  7905  			}
  7906  			_ = v_0_0.Args[1]
  7907  			v_0_0_0 := v_0_0.Args[0]
  7908  			v_0_0_1 := v_0_0.Args[1]
  7909  			for _i1 := 0; _i1 <= 1; _i1, v_0_0_0, v_0_0_1 = _i1+1, v_0_0_1, v_0_0_0 {
  7910  				if v_0_0_0.Op != OpLOONG64MOVVconst {
  7911  					continue
  7912  				}
  7913  				c1 := auxIntToInt64(v_0_0_0.AuxInt)
  7914  				x := v_0_0_1
  7915  				if v_1.Op != OpLOONG64SLLVconst || auxIntToInt64(v_1.AuxInt) != 8 {
  7916  					continue
  7917  				}
  7918  				v_1_0 := v_1.Args[0]
  7919  				if v_1_0.Op != OpLOONG64AND {
  7920  					continue
  7921  				}
  7922  				_ = v_1_0.Args[1]
  7923  				v_1_0_0 := v_1_0.Args[0]
  7924  				v_1_0_1 := v_1_0.Args[1]
  7925  				for _i2 := 0; _i2 <= 1; _i2, v_1_0_0, v_1_0_1 = _i2+1, v_1_0_1, v_1_0_0 {
  7926  					if v_1_0_0.Op != OpLOONG64MOVVconst {
  7927  						continue
  7928  					}
  7929  					c2 := auxIntToInt64(v_1_0_0.AuxInt)
  7930  					if x != v_1_0_1 || !(uint64(c1) == 0xff00ff00ff00ff00 && uint64(c2) == 0x00ff00ff00ff00ff) {
  7931  						continue
  7932  					}
  7933  					v.reset(OpLOONG64REVB4H)
  7934  					v.AddArg(x)
  7935  					return true
  7936  				}
  7937  			}
  7938  		}
  7939  		break
  7940  	}
  7941  	// match: (XOR (SRLVconst [8] (AND (MOVVconst [c1]) x)) (SLLVconst [8] (ANDconst [c2] x)))
  7942  	// cond: uint64(c1) == 0xff00ff00 && uint64(c2) == 0x00ff00ff
  7943  	// result: (REVB4H (ANDconst <x.Type> [0xffffffff] x))
  7944  	for {
  7945  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
  7946  			if v_0.Op != OpLOONG64SRLVconst || auxIntToInt64(v_0.AuxInt) != 8 {
  7947  				continue
  7948  			}
  7949  			v_0_0 := v_0.Args[0]
  7950  			if v_0_0.Op != OpLOONG64AND {
  7951  				continue
  7952  			}
  7953  			_ = v_0_0.Args[1]
  7954  			v_0_0_0 := v_0_0.Args[0]
  7955  			v_0_0_1 := v_0_0.Args[1]
  7956  			for _i1 := 0; _i1 <= 1; _i1, v_0_0_0, v_0_0_1 = _i1+1, v_0_0_1, v_0_0_0 {
  7957  				if v_0_0_0.Op != OpLOONG64MOVVconst {
  7958  					continue
  7959  				}
  7960  				c1 := auxIntToInt64(v_0_0_0.AuxInt)
  7961  				x := v_0_0_1
  7962  				if v_1.Op != OpLOONG64SLLVconst || auxIntToInt64(v_1.AuxInt) != 8 {
  7963  					continue
  7964  				}
  7965  				v_1_0 := v_1.Args[0]
  7966  				if v_1_0.Op != OpLOONG64ANDconst {
  7967  					continue
  7968  				}
  7969  				c2 := auxIntToInt64(v_1_0.AuxInt)
  7970  				if x != v_1_0.Args[0] || !(uint64(c1) == 0xff00ff00 && uint64(c2) == 0x00ff00ff) {
  7971  					continue
  7972  				}
  7973  				v.reset(OpLOONG64REVB4H)
  7974  				v0 := b.NewValue0(v.Pos, OpLOONG64ANDconst, x.Type)
  7975  				v0.AuxInt = int64ToAuxInt(0xffffffff)
  7976  				v0.AddArg(x)
  7977  				v.AddArg(v0)
  7978  				return true
  7979  			}
  7980  		}
  7981  		break
  7982  	}
  7983  	// match: (XOR x (MOVVconst [c]))
  7984  	// cond: is32Bit(c)
  7985  	// result: (XORconst [c] x)
  7986  	for {
  7987  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
  7988  			x := v_0
  7989  			if v_1.Op != OpLOONG64MOVVconst {
  7990  				continue
  7991  			}
  7992  			c := auxIntToInt64(v_1.AuxInt)
  7993  			if !(is32Bit(c)) {
  7994  				continue
  7995  			}
  7996  			v.reset(OpLOONG64XORconst)
  7997  			v.AuxInt = int64ToAuxInt(c)
  7998  			v.AddArg(x)
  7999  			return true
  8000  		}
  8001  		break
  8002  	}
  8003  	// match: (XOR x x)
  8004  	// result: (MOVVconst [0])
  8005  	for {
  8006  		x := v_0
  8007  		if x != v_1 {
  8008  			break
  8009  		}
  8010  		v.reset(OpLOONG64MOVVconst)
  8011  		v.AuxInt = int64ToAuxInt(0)
  8012  		return true
  8013  	}
  8014  	return false
  8015  }
  8016  func rewriteValueLOONG64_OpLOONG64XORconst(v *Value) bool {
  8017  	v_0 := v.Args[0]
  8018  	// match: (XORconst [0] x)
  8019  	// result: x
  8020  	for {
  8021  		if auxIntToInt64(v.AuxInt) != 0 {
  8022  			break
  8023  		}
  8024  		x := v_0
  8025  		v.copyOf(x)
  8026  		return true
  8027  	}
  8028  	// match: (XORconst [-1] x)
  8029  	// result: (NORconst [0] x)
  8030  	for {
  8031  		if auxIntToInt64(v.AuxInt) != -1 {
  8032  			break
  8033  		}
  8034  		x := v_0
  8035  		v.reset(OpLOONG64NORconst)
  8036  		v.AuxInt = int64ToAuxInt(0)
  8037  		v.AddArg(x)
  8038  		return true
  8039  	}
  8040  	// match: (XORconst [c] (MOVVconst [d]))
  8041  	// result: (MOVVconst [c^d])
  8042  	for {
  8043  		c := auxIntToInt64(v.AuxInt)
  8044  		if v_0.Op != OpLOONG64MOVVconst {
  8045  			break
  8046  		}
  8047  		d := auxIntToInt64(v_0.AuxInt)
  8048  		v.reset(OpLOONG64MOVVconst)
  8049  		v.AuxInt = int64ToAuxInt(c ^ d)
  8050  		return true
  8051  	}
  8052  	// match: (XORconst [c] (XORconst [d] x))
  8053  	// cond: is32Bit(c^d)
  8054  	// result: (XORconst [c^d] x)
  8055  	for {
  8056  		c := auxIntToInt64(v.AuxInt)
  8057  		if v_0.Op != OpLOONG64XORconst {
  8058  			break
  8059  		}
  8060  		d := auxIntToInt64(v_0.AuxInt)
  8061  		x := v_0.Args[0]
  8062  		if !(is32Bit(c ^ d)) {
  8063  			break
  8064  		}
  8065  		v.reset(OpLOONG64XORconst)
  8066  		v.AuxInt = int64ToAuxInt(c ^ d)
  8067  		v.AddArg(x)
  8068  		return true
  8069  	}
  8070  	return false
  8071  }
  8072  func rewriteValueLOONG64_OpLeq16(v *Value) bool {
  8073  	v_1 := v.Args[1]
  8074  	v_0 := v.Args[0]
  8075  	b := v.Block
  8076  	typ := &b.Func.Config.Types
  8077  	// match: (Leq16 x y)
  8078  	// result: (XOR (MOVVconst [1]) (SGT (SignExt16to64 x) (SignExt16to64 y)))
  8079  	for {
  8080  		x := v_0
  8081  		y := v_1
  8082  		v.reset(OpLOONG64XOR)
  8083  		v0 := b.NewValue0(v.Pos, OpLOONG64MOVVconst, typ.UInt64)
  8084  		v0.AuxInt = int64ToAuxInt(1)
  8085  		v1 := b.NewValue0(v.Pos, OpLOONG64SGT, typ.Bool)
  8086  		v2 := b.NewValue0(v.Pos, OpSignExt16to64, typ.Int64)
  8087  		v2.AddArg(x)
  8088  		v3 := b.NewValue0(v.Pos, OpSignExt16to64, typ.Int64)
  8089  		v3.AddArg(y)
  8090  		v1.AddArg2(v2, v3)
  8091  		v.AddArg2(v0, v1)
  8092  		return true
  8093  	}
  8094  }
  8095  func rewriteValueLOONG64_OpLeq16U(v *Value) bool {
  8096  	v_1 := v.Args[1]
  8097  	v_0 := v.Args[0]
  8098  	b := v.Block
  8099  	typ := &b.Func.Config.Types
  8100  	// match: (Leq16U x y)
  8101  	// result: (XOR (MOVVconst [1]) (SGTU (ZeroExt16to64 x) (ZeroExt16to64 y)))
  8102  	for {
  8103  		x := v_0
  8104  		y := v_1
  8105  		v.reset(OpLOONG64XOR)
  8106  		v0 := b.NewValue0(v.Pos, OpLOONG64MOVVconst, typ.UInt64)
  8107  		v0.AuxInt = int64ToAuxInt(1)
  8108  		v1 := b.NewValue0(v.Pos, OpLOONG64SGTU, typ.Bool)
  8109  		v2 := b.NewValue0(v.Pos, OpZeroExt16to64, typ.UInt64)
  8110  		v2.AddArg(x)
  8111  		v3 := b.NewValue0(v.Pos, OpZeroExt16to64, typ.UInt64)
  8112  		v3.AddArg(y)
  8113  		v1.AddArg2(v2, v3)
  8114  		v.AddArg2(v0, v1)
  8115  		return true
  8116  	}
  8117  }
  8118  func rewriteValueLOONG64_OpLeq32(v *Value) bool {
  8119  	v_1 := v.Args[1]
  8120  	v_0 := v.Args[0]
  8121  	b := v.Block
  8122  	typ := &b.Func.Config.Types
  8123  	// match: (Leq32 x y)
  8124  	// result: (XOR (MOVVconst [1]) (SGT (SignExt32to64 x) (SignExt32to64 y)))
  8125  	for {
  8126  		x := v_0
  8127  		y := v_1
  8128  		v.reset(OpLOONG64XOR)
  8129  		v0 := b.NewValue0(v.Pos, OpLOONG64MOVVconst, typ.UInt64)
  8130  		v0.AuxInt = int64ToAuxInt(1)
  8131  		v1 := b.NewValue0(v.Pos, OpLOONG64SGT, typ.Bool)
  8132  		v2 := b.NewValue0(v.Pos, OpSignExt32to64, typ.Int64)
  8133  		v2.AddArg(x)
  8134  		v3 := b.NewValue0(v.Pos, OpSignExt32to64, typ.Int64)
  8135  		v3.AddArg(y)
  8136  		v1.AddArg2(v2, v3)
  8137  		v.AddArg2(v0, v1)
  8138  		return true
  8139  	}
  8140  }
  8141  func rewriteValueLOONG64_OpLeq32F(v *Value) bool {
  8142  	v_1 := v.Args[1]
  8143  	v_0 := v.Args[0]
  8144  	b := v.Block
  8145  	// match: (Leq32F x y)
  8146  	// result: (FPFlagTrue (CMPGEF y x))
  8147  	for {
  8148  		x := v_0
  8149  		y := v_1
  8150  		v.reset(OpLOONG64FPFlagTrue)
  8151  		v0 := b.NewValue0(v.Pos, OpLOONG64CMPGEF, types.TypeFlags)
  8152  		v0.AddArg2(y, x)
  8153  		v.AddArg(v0)
  8154  		return true
  8155  	}
  8156  }
  8157  func rewriteValueLOONG64_OpLeq32U(v *Value) bool {
  8158  	v_1 := v.Args[1]
  8159  	v_0 := v.Args[0]
  8160  	b := v.Block
  8161  	typ := &b.Func.Config.Types
  8162  	// match: (Leq32U x y)
  8163  	// result: (XOR (MOVVconst [1]) (SGTU (ZeroExt32to64 x) (ZeroExt32to64 y)))
  8164  	for {
  8165  		x := v_0
  8166  		y := v_1
  8167  		v.reset(OpLOONG64XOR)
  8168  		v0 := b.NewValue0(v.Pos, OpLOONG64MOVVconst, typ.UInt64)
  8169  		v0.AuxInt = int64ToAuxInt(1)
  8170  		v1 := b.NewValue0(v.Pos, OpLOONG64SGTU, typ.Bool)
  8171  		v2 := b.NewValue0(v.Pos, OpZeroExt32to64, typ.UInt64)
  8172  		v2.AddArg(x)
  8173  		v3 := b.NewValue0(v.Pos, OpZeroExt32to64, typ.UInt64)
  8174  		v3.AddArg(y)
  8175  		v1.AddArg2(v2, v3)
  8176  		v.AddArg2(v0, v1)
  8177  		return true
  8178  	}
  8179  }
  8180  func rewriteValueLOONG64_OpLeq64(v *Value) bool {
  8181  	v_1 := v.Args[1]
  8182  	v_0 := v.Args[0]
  8183  	b := v.Block
  8184  	typ := &b.Func.Config.Types
  8185  	// match: (Leq64 x y)
  8186  	// result: (XOR (MOVVconst [1]) (SGT x y))
  8187  	for {
  8188  		x := v_0
  8189  		y := v_1
  8190  		v.reset(OpLOONG64XOR)
  8191  		v0 := b.NewValue0(v.Pos, OpLOONG64MOVVconst, typ.UInt64)
  8192  		v0.AuxInt = int64ToAuxInt(1)
  8193  		v1 := b.NewValue0(v.Pos, OpLOONG64SGT, typ.Bool)
  8194  		v1.AddArg2(x, y)
  8195  		v.AddArg2(v0, v1)
  8196  		return true
  8197  	}
  8198  }
  8199  func rewriteValueLOONG64_OpLeq64F(v *Value) bool {
  8200  	v_1 := v.Args[1]
  8201  	v_0 := v.Args[0]
  8202  	b := v.Block
  8203  	// match: (Leq64F x y)
  8204  	// result: (FPFlagTrue (CMPGED y x))
  8205  	for {
  8206  		x := v_0
  8207  		y := v_1
  8208  		v.reset(OpLOONG64FPFlagTrue)
  8209  		v0 := b.NewValue0(v.Pos, OpLOONG64CMPGED, types.TypeFlags)
  8210  		v0.AddArg2(y, x)
  8211  		v.AddArg(v0)
  8212  		return true
  8213  	}
  8214  }
  8215  func rewriteValueLOONG64_OpLeq64U(v *Value) bool {
  8216  	v_1 := v.Args[1]
  8217  	v_0 := v.Args[0]
  8218  	b := v.Block
  8219  	typ := &b.Func.Config.Types
  8220  	// match: (Leq64U x y)
  8221  	// result: (XOR (MOVVconst [1]) (SGTU x y))
  8222  	for {
  8223  		x := v_0
  8224  		y := v_1
  8225  		v.reset(OpLOONG64XOR)
  8226  		v0 := b.NewValue0(v.Pos, OpLOONG64MOVVconst, typ.UInt64)
  8227  		v0.AuxInt = int64ToAuxInt(1)
  8228  		v1 := b.NewValue0(v.Pos, OpLOONG64SGTU, typ.Bool)
  8229  		v1.AddArg2(x, y)
  8230  		v.AddArg2(v0, v1)
  8231  		return true
  8232  	}
  8233  }
  8234  func rewriteValueLOONG64_OpLeq8(v *Value) bool {
  8235  	v_1 := v.Args[1]
  8236  	v_0 := v.Args[0]
  8237  	b := v.Block
  8238  	typ := &b.Func.Config.Types
  8239  	// match: (Leq8 x y)
  8240  	// result: (XOR (MOVVconst [1]) (SGT (SignExt8to64 x) (SignExt8to64 y)))
  8241  	for {
  8242  		x := v_0
  8243  		y := v_1
  8244  		v.reset(OpLOONG64XOR)
  8245  		v0 := b.NewValue0(v.Pos, OpLOONG64MOVVconst, typ.UInt64)
  8246  		v0.AuxInt = int64ToAuxInt(1)
  8247  		v1 := b.NewValue0(v.Pos, OpLOONG64SGT, typ.Bool)
  8248  		v2 := b.NewValue0(v.Pos, OpSignExt8to64, typ.Int64)
  8249  		v2.AddArg(x)
  8250  		v3 := b.NewValue0(v.Pos, OpSignExt8to64, typ.Int64)
  8251  		v3.AddArg(y)
  8252  		v1.AddArg2(v2, v3)
  8253  		v.AddArg2(v0, v1)
  8254  		return true
  8255  	}
  8256  }
  8257  func rewriteValueLOONG64_OpLeq8U(v *Value) bool {
  8258  	v_1 := v.Args[1]
  8259  	v_0 := v.Args[0]
  8260  	b := v.Block
  8261  	typ := &b.Func.Config.Types
  8262  	// match: (Leq8U x y)
  8263  	// result: (XOR (MOVVconst [1]) (SGTU (ZeroExt8to64 x) (ZeroExt8to64 y)))
  8264  	for {
  8265  		x := v_0
  8266  		y := v_1
  8267  		v.reset(OpLOONG64XOR)
  8268  		v0 := b.NewValue0(v.Pos, OpLOONG64MOVVconst, typ.UInt64)
  8269  		v0.AuxInt = int64ToAuxInt(1)
  8270  		v1 := b.NewValue0(v.Pos, OpLOONG64SGTU, typ.Bool)
  8271  		v2 := b.NewValue0(v.Pos, OpZeroExt8to64, typ.UInt64)
  8272  		v2.AddArg(x)
  8273  		v3 := b.NewValue0(v.Pos, OpZeroExt8to64, typ.UInt64)
  8274  		v3.AddArg(y)
  8275  		v1.AddArg2(v2, v3)
  8276  		v.AddArg2(v0, v1)
  8277  		return true
  8278  	}
  8279  }
  8280  func rewriteValueLOONG64_OpLess16(v *Value) bool {
  8281  	v_1 := v.Args[1]
  8282  	v_0 := v.Args[0]
  8283  	b := v.Block
  8284  	typ := &b.Func.Config.Types
  8285  	// match: (Less16 x y)
  8286  	// result: (SGT (SignExt16to64 y) (SignExt16to64 x))
  8287  	for {
  8288  		x := v_0
  8289  		y := v_1
  8290  		v.reset(OpLOONG64SGT)
  8291  		v0 := b.NewValue0(v.Pos, OpSignExt16to64, typ.Int64)
  8292  		v0.AddArg(y)
  8293  		v1 := b.NewValue0(v.Pos, OpSignExt16to64, typ.Int64)
  8294  		v1.AddArg(x)
  8295  		v.AddArg2(v0, v1)
  8296  		return true
  8297  	}
  8298  }
  8299  func rewriteValueLOONG64_OpLess16U(v *Value) bool {
  8300  	v_1 := v.Args[1]
  8301  	v_0 := v.Args[0]
  8302  	b := v.Block
  8303  	typ := &b.Func.Config.Types
  8304  	// match: (Less16U x y)
  8305  	// result: (SGTU (ZeroExt16to64 y) (ZeroExt16to64 x))
  8306  	for {
  8307  		x := v_0
  8308  		y := v_1
  8309  		v.reset(OpLOONG64SGTU)
  8310  		v0 := b.NewValue0(v.Pos, OpZeroExt16to64, typ.UInt64)
  8311  		v0.AddArg(y)
  8312  		v1 := b.NewValue0(v.Pos, OpZeroExt16to64, typ.UInt64)
  8313  		v1.AddArg(x)
  8314  		v.AddArg2(v0, v1)
  8315  		return true
  8316  	}
  8317  }
  8318  func rewriteValueLOONG64_OpLess32(v *Value) bool {
  8319  	v_1 := v.Args[1]
  8320  	v_0 := v.Args[0]
  8321  	b := v.Block
  8322  	typ := &b.Func.Config.Types
  8323  	// match: (Less32 x y)
  8324  	// result: (SGT (SignExt32to64 y) (SignExt32to64 x))
  8325  	for {
  8326  		x := v_0
  8327  		y := v_1
  8328  		v.reset(OpLOONG64SGT)
  8329  		v0 := b.NewValue0(v.Pos, OpSignExt32to64, typ.Int64)
  8330  		v0.AddArg(y)
  8331  		v1 := b.NewValue0(v.Pos, OpSignExt32to64, typ.Int64)
  8332  		v1.AddArg(x)
  8333  		v.AddArg2(v0, v1)
  8334  		return true
  8335  	}
  8336  }
  8337  func rewriteValueLOONG64_OpLess32F(v *Value) bool {
  8338  	v_1 := v.Args[1]
  8339  	v_0 := v.Args[0]
  8340  	b := v.Block
  8341  	// match: (Less32F x y)
  8342  	// result: (FPFlagTrue (CMPGTF y x))
  8343  	for {
  8344  		x := v_0
  8345  		y := v_1
  8346  		v.reset(OpLOONG64FPFlagTrue)
  8347  		v0 := b.NewValue0(v.Pos, OpLOONG64CMPGTF, types.TypeFlags)
  8348  		v0.AddArg2(y, x)
  8349  		v.AddArg(v0)
  8350  		return true
  8351  	}
  8352  }
  8353  func rewriteValueLOONG64_OpLess32U(v *Value) bool {
  8354  	v_1 := v.Args[1]
  8355  	v_0 := v.Args[0]
  8356  	b := v.Block
  8357  	typ := &b.Func.Config.Types
  8358  	// match: (Less32U x y)
  8359  	// result: (SGTU (ZeroExt32to64 y) (ZeroExt32to64 x))
  8360  	for {
  8361  		x := v_0
  8362  		y := v_1
  8363  		v.reset(OpLOONG64SGTU)
  8364  		v0 := b.NewValue0(v.Pos, OpZeroExt32to64, typ.UInt64)
  8365  		v0.AddArg(y)
  8366  		v1 := b.NewValue0(v.Pos, OpZeroExt32to64, typ.UInt64)
  8367  		v1.AddArg(x)
  8368  		v.AddArg2(v0, v1)
  8369  		return true
  8370  	}
  8371  }
  8372  func rewriteValueLOONG64_OpLess64(v *Value) bool {
  8373  	v_1 := v.Args[1]
  8374  	v_0 := v.Args[0]
  8375  	// match: (Less64 x y)
  8376  	// result: (SGT y x)
  8377  	for {
  8378  		x := v_0
  8379  		y := v_1
  8380  		v.reset(OpLOONG64SGT)
  8381  		v.AddArg2(y, x)
  8382  		return true
  8383  	}
  8384  }
  8385  func rewriteValueLOONG64_OpLess64F(v *Value) bool {
  8386  	v_1 := v.Args[1]
  8387  	v_0 := v.Args[0]
  8388  	b := v.Block
  8389  	// match: (Less64F x y)
  8390  	// result: (FPFlagTrue (CMPGTD y x))
  8391  	for {
  8392  		x := v_0
  8393  		y := v_1
  8394  		v.reset(OpLOONG64FPFlagTrue)
  8395  		v0 := b.NewValue0(v.Pos, OpLOONG64CMPGTD, types.TypeFlags)
  8396  		v0.AddArg2(y, x)
  8397  		v.AddArg(v0)
  8398  		return true
  8399  	}
  8400  }
  8401  func rewriteValueLOONG64_OpLess64U(v *Value) bool {
  8402  	v_1 := v.Args[1]
  8403  	v_0 := v.Args[0]
  8404  	// match: (Less64U x y)
  8405  	// result: (SGTU y x)
  8406  	for {
  8407  		x := v_0
  8408  		y := v_1
  8409  		v.reset(OpLOONG64SGTU)
  8410  		v.AddArg2(y, x)
  8411  		return true
  8412  	}
  8413  }
  8414  func rewriteValueLOONG64_OpLess8(v *Value) bool {
  8415  	v_1 := v.Args[1]
  8416  	v_0 := v.Args[0]
  8417  	b := v.Block
  8418  	typ := &b.Func.Config.Types
  8419  	// match: (Less8 x y)
  8420  	// result: (SGT (SignExt8to64 y) (SignExt8to64 x))
  8421  	for {
  8422  		x := v_0
  8423  		y := v_1
  8424  		v.reset(OpLOONG64SGT)
  8425  		v0 := b.NewValue0(v.Pos, OpSignExt8to64, typ.Int64)
  8426  		v0.AddArg(y)
  8427  		v1 := b.NewValue0(v.Pos, OpSignExt8to64, typ.Int64)
  8428  		v1.AddArg(x)
  8429  		v.AddArg2(v0, v1)
  8430  		return true
  8431  	}
  8432  }
  8433  func rewriteValueLOONG64_OpLess8U(v *Value) bool {
  8434  	v_1 := v.Args[1]
  8435  	v_0 := v.Args[0]
  8436  	b := v.Block
  8437  	typ := &b.Func.Config.Types
  8438  	// match: (Less8U x y)
  8439  	// result: (SGTU (ZeroExt8to64 y) (ZeroExt8to64 x))
  8440  	for {
  8441  		x := v_0
  8442  		y := v_1
  8443  		v.reset(OpLOONG64SGTU)
  8444  		v0 := b.NewValue0(v.Pos, OpZeroExt8to64, typ.UInt64)
  8445  		v0.AddArg(y)
  8446  		v1 := b.NewValue0(v.Pos, OpZeroExt8to64, typ.UInt64)
  8447  		v1.AddArg(x)
  8448  		v.AddArg2(v0, v1)
  8449  		return true
  8450  	}
  8451  }
  8452  func rewriteValueLOONG64_OpLoad(v *Value) bool {
  8453  	v_1 := v.Args[1]
  8454  	v_0 := v.Args[0]
  8455  	// match: (Load <t> ptr mem)
  8456  	// cond: t.IsBoolean()
  8457  	// result: (MOVBUload ptr mem)
  8458  	for {
  8459  		t := v.Type
  8460  		ptr := v_0
  8461  		mem := v_1
  8462  		if !(t.IsBoolean()) {
  8463  			break
  8464  		}
  8465  		v.reset(OpLOONG64MOVBUload)
  8466  		v.AddArg2(ptr, mem)
  8467  		return true
  8468  	}
  8469  	// match: (Load <t> ptr mem)
  8470  	// cond: (is8BitInt(t) && t.IsSigned())
  8471  	// result: (MOVBload ptr mem)
  8472  	for {
  8473  		t := v.Type
  8474  		ptr := v_0
  8475  		mem := v_1
  8476  		if !(is8BitInt(t) && t.IsSigned()) {
  8477  			break
  8478  		}
  8479  		v.reset(OpLOONG64MOVBload)
  8480  		v.AddArg2(ptr, mem)
  8481  		return true
  8482  	}
  8483  	// match: (Load <t> ptr mem)
  8484  	// cond: (is8BitInt(t) && !t.IsSigned())
  8485  	// result: (MOVBUload ptr mem)
  8486  	for {
  8487  		t := v.Type
  8488  		ptr := v_0
  8489  		mem := v_1
  8490  		if !(is8BitInt(t) && !t.IsSigned()) {
  8491  			break
  8492  		}
  8493  		v.reset(OpLOONG64MOVBUload)
  8494  		v.AddArg2(ptr, mem)
  8495  		return true
  8496  	}
  8497  	// match: (Load <t> ptr mem)
  8498  	// cond: (is16BitInt(t) && t.IsSigned())
  8499  	// result: (MOVHload ptr mem)
  8500  	for {
  8501  		t := v.Type
  8502  		ptr := v_0
  8503  		mem := v_1
  8504  		if !(is16BitInt(t) && t.IsSigned()) {
  8505  			break
  8506  		}
  8507  		v.reset(OpLOONG64MOVHload)
  8508  		v.AddArg2(ptr, mem)
  8509  		return true
  8510  	}
  8511  	// match: (Load <t> ptr mem)
  8512  	// cond: (is16BitInt(t) && !t.IsSigned())
  8513  	// result: (MOVHUload ptr mem)
  8514  	for {
  8515  		t := v.Type
  8516  		ptr := v_0
  8517  		mem := v_1
  8518  		if !(is16BitInt(t) && !t.IsSigned()) {
  8519  			break
  8520  		}
  8521  		v.reset(OpLOONG64MOVHUload)
  8522  		v.AddArg2(ptr, mem)
  8523  		return true
  8524  	}
  8525  	// match: (Load <t> ptr mem)
  8526  	// cond: (is32BitInt(t) && t.IsSigned())
  8527  	// result: (MOVWload ptr mem)
  8528  	for {
  8529  		t := v.Type
  8530  		ptr := v_0
  8531  		mem := v_1
  8532  		if !(is32BitInt(t) && t.IsSigned()) {
  8533  			break
  8534  		}
  8535  		v.reset(OpLOONG64MOVWload)
  8536  		v.AddArg2(ptr, mem)
  8537  		return true
  8538  	}
  8539  	// match: (Load <t> ptr mem)
  8540  	// cond: (is32BitInt(t) && !t.IsSigned())
  8541  	// result: (MOVWUload ptr mem)
  8542  	for {
  8543  		t := v.Type
  8544  		ptr := v_0
  8545  		mem := v_1
  8546  		if !(is32BitInt(t) && !t.IsSigned()) {
  8547  			break
  8548  		}
  8549  		v.reset(OpLOONG64MOVWUload)
  8550  		v.AddArg2(ptr, mem)
  8551  		return true
  8552  	}
  8553  	// match: (Load <t> ptr mem)
  8554  	// cond: (is64BitInt(t) || isPtr(t))
  8555  	// result: (MOVVload ptr mem)
  8556  	for {
  8557  		t := v.Type
  8558  		ptr := v_0
  8559  		mem := v_1
  8560  		if !(is64BitInt(t) || isPtr(t)) {
  8561  			break
  8562  		}
  8563  		v.reset(OpLOONG64MOVVload)
  8564  		v.AddArg2(ptr, mem)
  8565  		return true
  8566  	}
  8567  	// match: (Load <t> ptr mem)
  8568  	// cond: is32BitFloat(t)
  8569  	// result: (MOVFload ptr mem)
  8570  	for {
  8571  		t := v.Type
  8572  		ptr := v_0
  8573  		mem := v_1
  8574  		if !(is32BitFloat(t)) {
  8575  			break
  8576  		}
  8577  		v.reset(OpLOONG64MOVFload)
  8578  		v.AddArg2(ptr, mem)
  8579  		return true
  8580  	}
  8581  	// match: (Load <t> ptr mem)
  8582  	// cond: is64BitFloat(t)
  8583  	// result: (MOVDload ptr mem)
  8584  	for {
  8585  		t := v.Type
  8586  		ptr := v_0
  8587  		mem := v_1
  8588  		if !(is64BitFloat(t)) {
  8589  			break
  8590  		}
  8591  		v.reset(OpLOONG64MOVDload)
  8592  		v.AddArg2(ptr, mem)
  8593  		return true
  8594  	}
  8595  	return false
  8596  }
  8597  func rewriteValueLOONG64_OpLocalAddr(v *Value) bool {
  8598  	v_1 := v.Args[1]
  8599  	v_0 := v.Args[0]
  8600  	b := v.Block
  8601  	typ := &b.Func.Config.Types
  8602  	// match: (LocalAddr <t> {sym} base mem)
  8603  	// cond: t.Elem().HasPointers()
  8604  	// result: (MOVVaddr {sym} (SPanchored base mem))
  8605  	for {
  8606  		t := v.Type
  8607  		sym := auxToSym(v.Aux)
  8608  		base := v_0
  8609  		mem := v_1
  8610  		if !(t.Elem().HasPointers()) {
  8611  			break
  8612  		}
  8613  		v.reset(OpLOONG64MOVVaddr)
  8614  		v.Aux = symToAux(sym)
  8615  		v0 := b.NewValue0(v.Pos, OpSPanchored, typ.Uintptr)
  8616  		v0.AddArg2(base, mem)
  8617  		v.AddArg(v0)
  8618  		return true
  8619  	}
  8620  	// match: (LocalAddr <t> {sym} base _)
  8621  	// cond: !t.Elem().HasPointers()
  8622  	// result: (MOVVaddr {sym} base)
  8623  	for {
  8624  		t := v.Type
  8625  		sym := auxToSym(v.Aux)
  8626  		base := v_0
  8627  		if !(!t.Elem().HasPointers()) {
  8628  			break
  8629  		}
  8630  		v.reset(OpLOONG64MOVVaddr)
  8631  		v.Aux = symToAux(sym)
  8632  		v.AddArg(base)
  8633  		return true
  8634  	}
  8635  	return false
  8636  }
  8637  func rewriteValueLOONG64_OpLsh16x16(v *Value) bool {
  8638  	v_1 := v.Args[1]
  8639  	v_0 := v.Args[0]
  8640  	b := v.Block
  8641  	typ := &b.Func.Config.Types
  8642  	// match: (Lsh16x16 x y)
  8643  	// cond: shiftIsBounded(v)
  8644  	// result: (SLLV x y)
  8645  	for {
  8646  		x := v_0
  8647  		y := v_1
  8648  		if !(shiftIsBounded(v)) {
  8649  			break
  8650  		}
  8651  		v.reset(OpLOONG64SLLV)
  8652  		v.AddArg2(x, y)
  8653  		return true
  8654  	}
  8655  	// match: (Lsh16x16 <t> x y)
  8656  	// cond: !shiftIsBounded(v)
  8657  	// result: (MASKEQZ (SLLV <t> x (ZeroExt16to64 y)) (SGTU (MOVVconst <typ.UInt64> [64]) (ZeroExt16to64 y)))
  8658  	for {
  8659  		t := v.Type
  8660  		x := v_0
  8661  		y := v_1
  8662  		if !(!shiftIsBounded(v)) {
  8663  			break
  8664  		}
  8665  		v.reset(OpLOONG64MASKEQZ)
  8666  		v0 := b.NewValue0(v.Pos, OpLOONG64SLLV, t)
  8667  		v1 := b.NewValue0(v.Pos, OpZeroExt16to64, typ.UInt64)
  8668  		v1.AddArg(y)
  8669  		v0.AddArg2(x, v1)
  8670  		v2 := b.NewValue0(v.Pos, OpLOONG64SGTU, typ.Bool)
  8671  		v3 := b.NewValue0(v.Pos, OpLOONG64MOVVconst, typ.UInt64)
  8672  		v3.AuxInt = int64ToAuxInt(64)
  8673  		v2.AddArg2(v3, v1)
  8674  		v.AddArg2(v0, v2)
  8675  		return true
  8676  	}
  8677  	return false
  8678  }
  8679  func rewriteValueLOONG64_OpLsh16x32(v *Value) bool {
  8680  	v_1 := v.Args[1]
  8681  	v_0 := v.Args[0]
  8682  	b := v.Block
  8683  	typ := &b.Func.Config.Types
  8684  	// match: (Lsh16x32 x y)
  8685  	// cond: shiftIsBounded(v)
  8686  	// result: (SLLV x y)
  8687  	for {
  8688  		x := v_0
  8689  		y := v_1
  8690  		if !(shiftIsBounded(v)) {
  8691  			break
  8692  		}
  8693  		v.reset(OpLOONG64SLLV)
  8694  		v.AddArg2(x, y)
  8695  		return true
  8696  	}
  8697  	// match: (Lsh16x32 <t> x y)
  8698  	// cond: !shiftIsBounded(v)
  8699  	// result: (MASKEQZ (SLLV <t> x (ZeroExt32to64 y)) (SGTU (MOVVconst <typ.UInt64> [64]) (ZeroExt32to64 y)))
  8700  	for {
  8701  		t := v.Type
  8702  		x := v_0
  8703  		y := v_1
  8704  		if !(!shiftIsBounded(v)) {
  8705  			break
  8706  		}
  8707  		v.reset(OpLOONG64MASKEQZ)
  8708  		v0 := b.NewValue0(v.Pos, OpLOONG64SLLV, t)
  8709  		v1 := b.NewValue0(v.Pos, OpZeroExt32to64, typ.UInt64)
  8710  		v1.AddArg(y)
  8711  		v0.AddArg2(x, v1)
  8712  		v2 := b.NewValue0(v.Pos, OpLOONG64SGTU, typ.Bool)
  8713  		v3 := b.NewValue0(v.Pos, OpLOONG64MOVVconst, typ.UInt64)
  8714  		v3.AuxInt = int64ToAuxInt(64)
  8715  		v2.AddArg2(v3, v1)
  8716  		v.AddArg2(v0, v2)
  8717  		return true
  8718  	}
  8719  	return false
  8720  }
  8721  func rewriteValueLOONG64_OpLsh16x64(v *Value) bool {
  8722  	v_1 := v.Args[1]
  8723  	v_0 := v.Args[0]
  8724  	b := v.Block
  8725  	typ := &b.Func.Config.Types
  8726  	// match: (Lsh16x64 x y)
  8727  	// cond: shiftIsBounded(v)
  8728  	// result: (SLLV x y)
  8729  	for {
  8730  		x := v_0
  8731  		y := v_1
  8732  		if !(shiftIsBounded(v)) {
  8733  			break
  8734  		}
  8735  		v.reset(OpLOONG64SLLV)
  8736  		v.AddArg2(x, y)
  8737  		return true
  8738  	}
  8739  	// match: (Lsh16x64 <t> x y)
  8740  	// cond: !shiftIsBounded(v)
  8741  	// result: (MASKEQZ (SLLV <t> x y) (SGTU (MOVVconst <typ.UInt64> [64]) y))
  8742  	for {
  8743  		t := v.Type
  8744  		x := v_0
  8745  		y := v_1
  8746  		if !(!shiftIsBounded(v)) {
  8747  			break
  8748  		}
  8749  		v.reset(OpLOONG64MASKEQZ)
  8750  		v0 := b.NewValue0(v.Pos, OpLOONG64SLLV, t)
  8751  		v0.AddArg2(x, y)
  8752  		v1 := b.NewValue0(v.Pos, OpLOONG64SGTU, typ.Bool)
  8753  		v2 := b.NewValue0(v.Pos, OpLOONG64MOVVconst, typ.UInt64)
  8754  		v2.AuxInt = int64ToAuxInt(64)
  8755  		v1.AddArg2(v2, y)
  8756  		v.AddArg2(v0, v1)
  8757  		return true
  8758  	}
  8759  	return false
  8760  }
  8761  func rewriteValueLOONG64_OpLsh16x8(v *Value) bool {
  8762  	v_1 := v.Args[1]
  8763  	v_0 := v.Args[0]
  8764  	b := v.Block
  8765  	typ := &b.Func.Config.Types
  8766  	// match: (Lsh16x8 x y)
  8767  	// cond: shiftIsBounded(v)
  8768  	// result: (SLLV x y)
  8769  	for {
  8770  		x := v_0
  8771  		y := v_1
  8772  		if !(shiftIsBounded(v)) {
  8773  			break
  8774  		}
  8775  		v.reset(OpLOONG64SLLV)
  8776  		v.AddArg2(x, y)
  8777  		return true
  8778  	}
  8779  	// match: (Lsh16x8 <t> x y)
  8780  	// cond: !shiftIsBounded(v)
  8781  	// result: (MASKEQZ (SLLV <t> x (ZeroExt8to64 y)) (SGTU (MOVVconst <typ.UInt64> [64]) (ZeroExt8to64 y)))
  8782  	for {
  8783  		t := v.Type
  8784  		x := v_0
  8785  		y := v_1
  8786  		if !(!shiftIsBounded(v)) {
  8787  			break
  8788  		}
  8789  		v.reset(OpLOONG64MASKEQZ)
  8790  		v0 := b.NewValue0(v.Pos, OpLOONG64SLLV, t)
  8791  		v1 := b.NewValue0(v.Pos, OpZeroExt8to64, typ.UInt64)
  8792  		v1.AddArg(y)
  8793  		v0.AddArg2(x, v1)
  8794  		v2 := b.NewValue0(v.Pos, OpLOONG64SGTU, typ.Bool)
  8795  		v3 := b.NewValue0(v.Pos, OpLOONG64MOVVconst, typ.UInt64)
  8796  		v3.AuxInt = int64ToAuxInt(64)
  8797  		v2.AddArg2(v3, v1)
  8798  		v.AddArg2(v0, v2)
  8799  		return true
  8800  	}
  8801  	return false
  8802  }
  8803  func rewriteValueLOONG64_OpLsh32x16(v *Value) bool {
  8804  	v_1 := v.Args[1]
  8805  	v_0 := v.Args[0]
  8806  	b := v.Block
  8807  	typ := &b.Func.Config.Types
  8808  	// match: (Lsh32x16 x y)
  8809  	// cond: shiftIsBounded(v)
  8810  	// result: (SLL x y)
  8811  	for {
  8812  		x := v_0
  8813  		y := v_1
  8814  		if !(shiftIsBounded(v)) {
  8815  			break
  8816  		}
  8817  		v.reset(OpLOONG64SLL)
  8818  		v.AddArg2(x, y)
  8819  		return true
  8820  	}
  8821  	// match: (Lsh32x16 <t> x y)
  8822  	// cond: !shiftIsBounded(v)
  8823  	// result: (MASKEQZ (SLL <t> x (ZeroExt16to64 y)) (SGTU (MOVVconst <typ.UInt64> [32]) (ZeroExt16to64 y)))
  8824  	for {
  8825  		t := v.Type
  8826  		x := v_0
  8827  		y := v_1
  8828  		if !(!shiftIsBounded(v)) {
  8829  			break
  8830  		}
  8831  		v.reset(OpLOONG64MASKEQZ)
  8832  		v0 := b.NewValue0(v.Pos, OpLOONG64SLL, t)
  8833  		v1 := b.NewValue0(v.Pos, OpZeroExt16to64, typ.UInt64)
  8834  		v1.AddArg(y)
  8835  		v0.AddArg2(x, v1)
  8836  		v2 := b.NewValue0(v.Pos, OpLOONG64SGTU, typ.Bool)
  8837  		v3 := b.NewValue0(v.Pos, OpLOONG64MOVVconst, typ.UInt64)
  8838  		v3.AuxInt = int64ToAuxInt(32)
  8839  		v2.AddArg2(v3, v1)
  8840  		v.AddArg2(v0, v2)
  8841  		return true
  8842  	}
  8843  	return false
  8844  }
  8845  func rewriteValueLOONG64_OpLsh32x32(v *Value) bool {
  8846  	v_1 := v.Args[1]
  8847  	v_0 := v.Args[0]
  8848  	b := v.Block
  8849  	typ := &b.Func.Config.Types
  8850  	// match: (Lsh32x32 x y)
  8851  	// cond: shiftIsBounded(v)
  8852  	// result: (SLL x y)
  8853  	for {
  8854  		x := v_0
  8855  		y := v_1
  8856  		if !(shiftIsBounded(v)) {
  8857  			break
  8858  		}
  8859  		v.reset(OpLOONG64SLL)
  8860  		v.AddArg2(x, y)
  8861  		return true
  8862  	}
  8863  	// match: (Lsh32x32 <t> x y)
  8864  	// cond: !shiftIsBounded(v)
  8865  	// result: (MASKEQZ (SLL <t> x (ZeroExt32to64 y)) (SGTU (MOVVconst <typ.UInt64> [32]) (ZeroExt32to64 y)))
  8866  	for {
  8867  		t := v.Type
  8868  		x := v_0
  8869  		y := v_1
  8870  		if !(!shiftIsBounded(v)) {
  8871  			break
  8872  		}
  8873  		v.reset(OpLOONG64MASKEQZ)
  8874  		v0 := b.NewValue0(v.Pos, OpLOONG64SLL, t)
  8875  		v1 := b.NewValue0(v.Pos, OpZeroExt32to64, typ.UInt64)
  8876  		v1.AddArg(y)
  8877  		v0.AddArg2(x, v1)
  8878  		v2 := b.NewValue0(v.Pos, OpLOONG64SGTU, typ.Bool)
  8879  		v3 := b.NewValue0(v.Pos, OpLOONG64MOVVconst, typ.UInt64)
  8880  		v3.AuxInt = int64ToAuxInt(32)
  8881  		v2.AddArg2(v3, v1)
  8882  		v.AddArg2(v0, v2)
  8883  		return true
  8884  	}
  8885  	return false
  8886  }
  8887  func rewriteValueLOONG64_OpLsh32x64(v *Value) bool {
  8888  	v_1 := v.Args[1]
  8889  	v_0 := v.Args[0]
  8890  	b := v.Block
  8891  	typ := &b.Func.Config.Types
  8892  	// match: (Lsh32x64 x y)
  8893  	// cond: shiftIsBounded(v)
  8894  	// result: (SLL x y)
  8895  	for {
  8896  		x := v_0
  8897  		y := v_1
  8898  		if !(shiftIsBounded(v)) {
  8899  			break
  8900  		}
  8901  		v.reset(OpLOONG64SLL)
  8902  		v.AddArg2(x, y)
  8903  		return true
  8904  	}
  8905  	// match: (Lsh32x64 <t> x y)
  8906  	// cond: !shiftIsBounded(v)
  8907  	// result: (MASKEQZ (SLL <t> x y) (SGTU (MOVVconst <typ.UInt64> [32]) y))
  8908  	for {
  8909  		t := v.Type
  8910  		x := v_0
  8911  		y := v_1
  8912  		if !(!shiftIsBounded(v)) {
  8913  			break
  8914  		}
  8915  		v.reset(OpLOONG64MASKEQZ)
  8916  		v0 := b.NewValue0(v.Pos, OpLOONG64SLL, t)
  8917  		v0.AddArg2(x, y)
  8918  		v1 := b.NewValue0(v.Pos, OpLOONG64SGTU, typ.Bool)
  8919  		v2 := b.NewValue0(v.Pos, OpLOONG64MOVVconst, typ.UInt64)
  8920  		v2.AuxInt = int64ToAuxInt(32)
  8921  		v1.AddArg2(v2, y)
  8922  		v.AddArg2(v0, v1)
  8923  		return true
  8924  	}
  8925  	return false
  8926  }
  8927  func rewriteValueLOONG64_OpLsh32x8(v *Value) bool {
  8928  	v_1 := v.Args[1]
  8929  	v_0 := v.Args[0]
  8930  	b := v.Block
  8931  	typ := &b.Func.Config.Types
  8932  	// match: (Lsh32x8 x y)
  8933  	// cond: shiftIsBounded(v)
  8934  	// result: (SLL x y)
  8935  	for {
  8936  		x := v_0
  8937  		y := v_1
  8938  		if !(shiftIsBounded(v)) {
  8939  			break
  8940  		}
  8941  		v.reset(OpLOONG64SLL)
  8942  		v.AddArg2(x, y)
  8943  		return true
  8944  	}
  8945  	// match: (Lsh32x8 <t> x y)
  8946  	// cond: !shiftIsBounded(v)
  8947  	// result: (MASKEQZ (SLL <t> x (ZeroExt8to64 y)) (SGTU (MOVVconst <typ.UInt64> [32]) (ZeroExt8to64 y)))
  8948  	for {
  8949  		t := v.Type
  8950  		x := v_0
  8951  		y := v_1
  8952  		if !(!shiftIsBounded(v)) {
  8953  			break
  8954  		}
  8955  		v.reset(OpLOONG64MASKEQZ)
  8956  		v0 := b.NewValue0(v.Pos, OpLOONG64SLL, 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(32)
  8963  		v2.AddArg2(v3, v1)
  8964  		v.AddArg2(v0, v2)
  8965  		return true
  8966  	}
  8967  	return false
  8968  }
  8969  func rewriteValueLOONG64_OpLsh64x16(v *Value) bool {
  8970  	v_1 := v.Args[1]
  8971  	v_0 := v.Args[0]
  8972  	b := v.Block
  8973  	typ := &b.Func.Config.Types
  8974  	// match: (Lsh64x16 x y)
  8975  	// cond: shiftIsBounded(v)
  8976  	// result: (SLLV x y)
  8977  	for {
  8978  		x := v_0
  8979  		y := v_1
  8980  		if !(shiftIsBounded(v)) {
  8981  			break
  8982  		}
  8983  		v.reset(OpLOONG64SLLV)
  8984  		v.AddArg2(x, y)
  8985  		return true
  8986  	}
  8987  	// match: (Lsh64x16 <t> x y)
  8988  	// cond: !shiftIsBounded(v)
  8989  	// result: (MASKEQZ (SLLV <t> x (ZeroExt16to64 y)) (SGTU (MOVVconst <typ.UInt64> [64]) (ZeroExt16to64 y)))
  8990  	for {
  8991  		t := v.Type
  8992  		x := v_0
  8993  		y := v_1
  8994  		if !(!shiftIsBounded(v)) {
  8995  			break
  8996  		}
  8997  		v.reset(OpLOONG64MASKEQZ)
  8998  		v0 := b.NewValue0(v.Pos, OpLOONG64SLLV, t)
  8999  		v1 := b.NewValue0(v.Pos, OpZeroExt16to64, typ.UInt64)
  9000  		v1.AddArg(y)
  9001  		v0.AddArg2(x, v1)
  9002  		v2 := b.NewValue0(v.Pos, OpLOONG64SGTU, typ.Bool)
  9003  		v3 := b.NewValue0(v.Pos, OpLOONG64MOVVconst, typ.UInt64)
  9004  		v3.AuxInt = int64ToAuxInt(64)
  9005  		v2.AddArg2(v3, v1)
  9006  		v.AddArg2(v0, v2)
  9007  		return true
  9008  	}
  9009  	return false
  9010  }
  9011  func rewriteValueLOONG64_OpLsh64x32(v *Value) bool {
  9012  	v_1 := v.Args[1]
  9013  	v_0 := v.Args[0]
  9014  	b := v.Block
  9015  	typ := &b.Func.Config.Types
  9016  	// match: (Lsh64x32 x y)
  9017  	// cond: shiftIsBounded(v)
  9018  	// result: (SLLV x y)
  9019  	for {
  9020  		x := v_0
  9021  		y := v_1
  9022  		if !(shiftIsBounded(v)) {
  9023  			break
  9024  		}
  9025  		v.reset(OpLOONG64SLLV)
  9026  		v.AddArg2(x, y)
  9027  		return true
  9028  	}
  9029  	// match: (Lsh64x32 <t> x y)
  9030  	// cond: !shiftIsBounded(v)
  9031  	// result: (MASKEQZ (SLLV <t> x (ZeroExt32to64 y)) (SGTU (MOVVconst <typ.UInt64> [64]) (ZeroExt32to64 y)))
  9032  	for {
  9033  		t := v.Type
  9034  		x := v_0
  9035  		y := v_1
  9036  		if !(!shiftIsBounded(v)) {
  9037  			break
  9038  		}
  9039  		v.reset(OpLOONG64MASKEQZ)
  9040  		v0 := b.NewValue0(v.Pos, OpLOONG64SLLV, t)
  9041  		v1 := b.NewValue0(v.Pos, OpZeroExt32to64, typ.UInt64)
  9042  		v1.AddArg(y)
  9043  		v0.AddArg2(x, v1)
  9044  		v2 := b.NewValue0(v.Pos, OpLOONG64SGTU, typ.Bool)
  9045  		v3 := b.NewValue0(v.Pos, OpLOONG64MOVVconst, typ.UInt64)
  9046  		v3.AuxInt = int64ToAuxInt(64)
  9047  		v2.AddArg2(v3, v1)
  9048  		v.AddArg2(v0, v2)
  9049  		return true
  9050  	}
  9051  	return false
  9052  }
  9053  func rewriteValueLOONG64_OpLsh64x64(v *Value) bool {
  9054  	v_1 := v.Args[1]
  9055  	v_0 := v.Args[0]
  9056  	b := v.Block
  9057  	typ := &b.Func.Config.Types
  9058  	// match: (Lsh64x64 x y)
  9059  	// cond: shiftIsBounded(v)
  9060  	// result: (SLLV x y)
  9061  	for {
  9062  		x := v_0
  9063  		y := v_1
  9064  		if !(shiftIsBounded(v)) {
  9065  			break
  9066  		}
  9067  		v.reset(OpLOONG64SLLV)
  9068  		v.AddArg2(x, y)
  9069  		return true
  9070  	}
  9071  	// match: (Lsh64x64 <t> x y)
  9072  	// cond: !shiftIsBounded(v)
  9073  	// result: (MASKEQZ (SLLV <t> x y) (SGTU (MOVVconst <typ.UInt64> [64]) y))
  9074  	for {
  9075  		t := v.Type
  9076  		x := v_0
  9077  		y := v_1
  9078  		if !(!shiftIsBounded(v)) {
  9079  			break
  9080  		}
  9081  		v.reset(OpLOONG64MASKEQZ)
  9082  		v0 := b.NewValue0(v.Pos, OpLOONG64SLLV, t)
  9083  		v0.AddArg2(x, y)
  9084  		v1 := b.NewValue0(v.Pos, OpLOONG64SGTU, typ.Bool)
  9085  		v2 := b.NewValue0(v.Pos, OpLOONG64MOVVconst, typ.UInt64)
  9086  		v2.AuxInt = int64ToAuxInt(64)
  9087  		v1.AddArg2(v2, y)
  9088  		v.AddArg2(v0, v1)
  9089  		return true
  9090  	}
  9091  	return false
  9092  }
  9093  func rewriteValueLOONG64_OpLsh64x8(v *Value) bool {
  9094  	v_1 := v.Args[1]
  9095  	v_0 := v.Args[0]
  9096  	b := v.Block
  9097  	typ := &b.Func.Config.Types
  9098  	// match: (Lsh64x8 x y)
  9099  	// cond: shiftIsBounded(v)
  9100  	// result: (SLLV x y)
  9101  	for {
  9102  		x := v_0
  9103  		y := v_1
  9104  		if !(shiftIsBounded(v)) {
  9105  			break
  9106  		}
  9107  		v.reset(OpLOONG64SLLV)
  9108  		v.AddArg2(x, y)
  9109  		return true
  9110  	}
  9111  	// match: (Lsh64x8 <t> x y)
  9112  	// cond: !shiftIsBounded(v)
  9113  	// result: (MASKEQZ (SLLV <t> x (ZeroExt8to64 y)) (SGTU (MOVVconst <typ.UInt64> [64]) (ZeroExt8to64 y)))
  9114  	for {
  9115  		t := v.Type
  9116  		x := v_0
  9117  		y := v_1
  9118  		if !(!shiftIsBounded(v)) {
  9119  			break
  9120  		}
  9121  		v.reset(OpLOONG64MASKEQZ)
  9122  		v0 := b.NewValue0(v.Pos, OpLOONG64SLLV, t)
  9123  		v1 := b.NewValue0(v.Pos, OpZeroExt8to64, typ.UInt64)
  9124  		v1.AddArg(y)
  9125  		v0.AddArg2(x, v1)
  9126  		v2 := b.NewValue0(v.Pos, OpLOONG64SGTU, typ.Bool)
  9127  		v3 := b.NewValue0(v.Pos, OpLOONG64MOVVconst, typ.UInt64)
  9128  		v3.AuxInt = int64ToAuxInt(64)
  9129  		v2.AddArg2(v3, v1)
  9130  		v.AddArg2(v0, v2)
  9131  		return true
  9132  	}
  9133  	return false
  9134  }
  9135  func rewriteValueLOONG64_OpLsh8x16(v *Value) bool {
  9136  	v_1 := v.Args[1]
  9137  	v_0 := v.Args[0]
  9138  	b := v.Block
  9139  	typ := &b.Func.Config.Types
  9140  	// match: (Lsh8x16 x y)
  9141  	// cond: shiftIsBounded(v)
  9142  	// result: (SLLV x y)
  9143  	for {
  9144  		x := v_0
  9145  		y := v_1
  9146  		if !(shiftIsBounded(v)) {
  9147  			break
  9148  		}
  9149  		v.reset(OpLOONG64SLLV)
  9150  		v.AddArg2(x, y)
  9151  		return true
  9152  	}
  9153  	// match: (Lsh8x16 <t> x y)
  9154  	// cond: !shiftIsBounded(v)
  9155  	// result: (MASKEQZ (SLLV <t> x (ZeroExt16to64 y)) (SGTU (MOVVconst <typ.UInt64> [64]) (ZeroExt16to64 y)))
  9156  	for {
  9157  		t := v.Type
  9158  		x := v_0
  9159  		y := v_1
  9160  		if !(!shiftIsBounded(v)) {
  9161  			break
  9162  		}
  9163  		v.reset(OpLOONG64MASKEQZ)
  9164  		v0 := b.NewValue0(v.Pos, OpLOONG64SLLV, t)
  9165  		v1 := b.NewValue0(v.Pos, OpZeroExt16to64, typ.UInt64)
  9166  		v1.AddArg(y)
  9167  		v0.AddArg2(x, v1)
  9168  		v2 := b.NewValue0(v.Pos, OpLOONG64SGTU, typ.Bool)
  9169  		v3 := b.NewValue0(v.Pos, OpLOONG64MOVVconst, typ.UInt64)
  9170  		v3.AuxInt = int64ToAuxInt(64)
  9171  		v2.AddArg2(v3, v1)
  9172  		v.AddArg2(v0, v2)
  9173  		return true
  9174  	}
  9175  	return false
  9176  }
  9177  func rewriteValueLOONG64_OpLsh8x32(v *Value) bool {
  9178  	v_1 := v.Args[1]
  9179  	v_0 := v.Args[0]
  9180  	b := v.Block
  9181  	typ := &b.Func.Config.Types
  9182  	// match: (Lsh8x32 x y)
  9183  	// cond: shiftIsBounded(v)
  9184  	// result: (SLLV x y)
  9185  	for {
  9186  		x := v_0
  9187  		y := v_1
  9188  		if !(shiftIsBounded(v)) {
  9189  			break
  9190  		}
  9191  		v.reset(OpLOONG64SLLV)
  9192  		v.AddArg2(x, y)
  9193  		return true
  9194  	}
  9195  	// match: (Lsh8x32 <t> x y)
  9196  	// cond: !shiftIsBounded(v)
  9197  	// result: (MASKEQZ (SLLV <t> x (ZeroExt32to64 y)) (SGTU (MOVVconst <typ.UInt64> [64]) (ZeroExt32to64 y)))
  9198  	for {
  9199  		t := v.Type
  9200  		x := v_0
  9201  		y := v_1
  9202  		if !(!shiftIsBounded(v)) {
  9203  			break
  9204  		}
  9205  		v.reset(OpLOONG64MASKEQZ)
  9206  		v0 := b.NewValue0(v.Pos, OpLOONG64SLLV, t)
  9207  		v1 := b.NewValue0(v.Pos, OpZeroExt32to64, typ.UInt64)
  9208  		v1.AddArg(y)
  9209  		v0.AddArg2(x, v1)
  9210  		v2 := b.NewValue0(v.Pos, OpLOONG64SGTU, typ.Bool)
  9211  		v3 := b.NewValue0(v.Pos, OpLOONG64MOVVconst, typ.UInt64)
  9212  		v3.AuxInt = int64ToAuxInt(64)
  9213  		v2.AddArg2(v3, v1)
  9214  		v.AddArg2(v0, v2)
  9215  		return true
  9216  	}
  9217  	return false
  9218  }
  9219  func rewriteValueLOONG64_OpLsh8x64(v *Value) bool {
  9220  	v_1 := v.Args[1]
  9221  	v_0 := v.Args[0]
  9222  	b := v.Block
  9223  	typ := &b.Func.Config.Types
  9224  	// match: (Lsh8x64 x y)
  9225  	// cond: shiftIsBounded(v)
  9226  	// result: (SLLV x y)
  9227  	for {
  9228  		x := v_0
  9229  		y := v_1
  9230  		if !(shiftIsBounded(v)) {
  9231  			break
  9232  		}
  9233  		v.reset(OpLOONG64SLLV)
  9234  		v.AddArg2(x, y)
  9235  		return true
  9236  	}
  9237  	// match: (Lsh8x64 <t> x y)
  9238  	// cond: !shiftIsBounded(v)
  9239  	// result: (MASKEQZ (SLLV <t> x y) (SGTU (MOVVconst <typ.UInt64> [64]) y))
  9240  	for {
  9241  		t := v.Type
  9242  		x := v_0
  9243  		y := v_1
  9244  		if !(!shiftIsBounded(v)) {
  9245  			break
  9246  		}
  9247  		v.reset(OpLOONG64MASKEQZ)
  9248  		v0 := b.NewValue0(v.Pos, OpLOONG64SLLV, t)
  9249  		v0.AddArg2(x, y)
  9250  		v1 := b.NewValue0(v.Pos, OpLOONG64SGTU, typ.Bool)
  9251  		v2 := b.NewValue0(v.Pos, OpLOONG64MOVVconst, typ.UInt64)
  9252  		v2.AuxInt = int64ToAuxInt(64)
  9253  		v1.AddArg2(v2, y)
  9254  		v.AddArg2(v0, v1)
  9255  		return true
  9256  	}
  9257  	return false
  9258  }
  9259  func rewriteValueLOONG64_OpLsh8x8(v *Value) bool {
  9260  	v_1 := v.Args[1]
  9261  	v_0 := v.Args[0]
  9262  	b := v.Block
  9263  	typ := &b.Func.Config.Types
  9264  	// match: (Lsh8x8 x y)
  9265  	// cond: shiftIsBounded(v)
  9266  	// result: (SLLV x y)
  9267  	for {
  9268  		x := v_0
  9269  		y := v_1
  9270  		if !(shiftIsBounded(v)) {
  9271  			break
  9272  		}
  9273  		v.reset(OpLOONG64SLLV)
  9274  		v.AddArg2(x, y)
  9275  		return true
  9276  	}
  9277  	// match: (Lsh8x8 <t> x y)
  9278  	// cond: !shiftIsBounded(v)
  9279  	// result: (MASKEQZ (SLLV <t> x (ZeroExt8to64 y)) (SGTU (MOVVconst <typ.UInt64> [64]) (ZeroExt8to64 y)))
  9280  	for {
  9281  		t := v.Type
  9282  		x := v_0
  9283  		y := v_1
  9284  		if !(!shiftIsBounded(v)) {
  9285  			break
  9286  		}
  9287  		v.reset(OpLOONG64MASKEQZ)
  9288  		v0 := b.NewValue0(v.Pos, OpLOONG64SLLV, t)
  9289  		v1 := b.NewValue0(v.Pos, OpZeroExt8to64, typ.UInt64)
  9290  		v1.AddArg(y)
  9291  		v0.AddArg2(x, v1)
  9292  		v2 := b.NewValue0(v.Pos, OpLOONG64SGTU, typ.Bool)
  9293  		v3 := b.NewValue0(v.Pos, OpLOONG64MOVVconst, typ.UInt64)
  9294  		v3.AuxInt = int64ToAuxInt(64)
  9295  		v2.AddArg2(v3, v1)
  9296  		v.AddArg2(v0, v2)
  9297  		return true
  9298  	}
  9299  	return false
  9300  }
  9301  func rewriteValueLOONG64_OpMod16(v *Value) bool {
  9302  	v_1 := v.Args[1]
  9303  	v_0 := v.Args[0]
  9304  	b := v.Block
  9305  	typ := &b.Func.Config.Types
  9306  	// match: (Mod16 x y)
  9307  	// result: (REMV (SignExt16to64 x) (SignExt16to64 y))
  9308  	for {
  9309  		x := v_0
  9310  		y := v_1
  9311  		v.reset(OpLOONG64REMV)
  9312  		v0 := b.NewValue0(v.Pos, OpSignExt16to64, typ.Int64)
  9313  		v0.AddArg(x)
  9314  		v1 := b.NewValue0(v.Pos, OpSignExt16to64, typ.Int64)
  9315  		v1.AddArg(y)
  9316  		v.AddArg2(v0, v1)
  9317  		return true
  9318  	}
  9319  }
  9320  func rewriteValueLOONG64_OpMod16u(v *Value) bool {
  9321  	v_1 := v.Args[1]
  9322  	v_0 := v.Args[0]
  9323  	b := v.Block
  9324  	typ := &b.Func.Config.Types
  9325  	// match: (Mod16u x y)
  9326  	// result: (REMVU (ZeroExt16to64 x) (ZeroExt16to64 y))
  9327  	for {
  9328  		x := v_0
  9329  		y := v_1
  9330  		v.reset(OpLOONG64REMVU)
  9331  		v0 := b.NewValue0(v.Pos, OpZeroExt16to64, typ.UInt64)
  9332  		v0.AddArg(x)
  9333  		v1 := b.NewValue0(v.Pos, OpZeroExt16to64, typ.UInt64)
  9334  		v1.AddArg(y)
  9335  		v.AddArg2(v0, v1)
  9336  		return true
  9337  	}
  9338  }
  9339  func rewriteValueLOONG64_OpMod32(v *Value) bool {
  9340  	v_1 := v.Args[1]
  9341  	v_0 := v.Args[0]
  9342  	b := v.Block
  9343  	typ := &b.Func.Config.Types
  9344  	// match: (Mod32 x y)
  9345  	// result: (REMV (SignExt32to64 x) (SignExt32to64 y))
  9346  	for {
  9347  		x := v_0
  9348  		y := v_1
  9349  		v.reset(OpLOONG64REMV)
  9350  		v0 := b.NewValue0(v.Pos, OpSignExt32to64, typ.Int64)
  9351  		v0.AddArg(x)
  9352  		v1 := b.NewValue0(v.Pos, OpSignExt32to64, typ.Int64)
  9353  		v1.AddArg(y)
  9354  		v.AddArg2(v0, v1)
  9355  		return true
  9356  	}
  9357  }
  9358  func rewriteValueLOONG64_OpMod32u(v *Value) bool {
  9359  	v_1 := v.Args[1]
  9360  	v_0 := v.Args[0]
  9361  	b := v.Block
  9362  	typ := &b.Func.Config.Types
  9363  	// match: (Mod32u x y)
  9364  	// result: (REMVU (ZeroExt32to64 x) (ZeroExt32to64 y))
  9365  	for {
  9366  		x := v_0
  9367  		y := v_1
  9368  		v.reset(OpLOONG64REMVU)
  9369  		v0 := b.NewValue0(v.Pos, OpZeroExt32to64, typ.UInt64)
  9370  		v0.AddArg(x)
  9371  		v1 := b.NewValue0(v.Pos, OpZeroExt32to64, typ.UInt64)
  9372  		v1.AddArg(y)
  9373  		v.AddArg2(v0, v1)
  9374  		return true
  9375  	}
  9376  }
  9377  func rewriteValueLOONG64_OpMod64(v *Value) bool {
  9378  	v_1 := v.Args[1]
  9379  	v_0 := v.Args[0]
  9380  	// match: (Mod64 x y)
  9381  	// result: (REMV x y)
  9382  	for {
  9383  		x := v_0
  9384  		y := v_1
  9385  		v.reset(OpLOONG64REMV)
  9386  		v.AddArg2(x, y)
  9387  		return true
  9388  	}
  9389  }
  9390  func rewriteValueLOONG64_OpMod8(v *Value) bool {
  9391  	v_1 := v.Args[1]
  9392  	v_0 := v.Args[0]
  9393  	b := v.Block
  9394  	typ := &b.Func.Config.Types
  9395  	// match: (Mod8 x y)
  9396  	// result: (REMV (SignExt8to64 x) (SignExt8to64 y))
  9397  	for {
  9398  		x := v_0
  9399  		y := v_1
  9400  		v.reset(OpLOONG64REMV)
  9401  		v0 := b.NewValue0(v.Pos, OpSignExt8to64, typ.Int64)
  9402  		v0.AddArg(x)
  9403  		v1 := b.NewValue0(v.Pos, OpSignExt8to64, typ.Int64)
  9404  		v1.AddArg(y)
  9405  		v.AddArg2(v0, v1)
  9406  		return true
  9407  	}
  9408  }
  9409  func rewriteValueLOONG64_OpMod8u(v *Value) bool {
  9410  	v_1 := v.Args[1]
  9411  	v_0 := v.Args[0]
  9412  	b := v.Block
  9413  	typ := &b.Func.Config.Types
  9414  	// match: (Mod8u x y)
  9415  	// result: (REMVU (ZeroExt8to64 x) (ZeroExt8to64 y))
  9416  	for {
  9417  		x := v_0
  9418  		y := v_1
  9419  		v.reset(OpLOONG64REMVU)
  9420  		v0 := b.NewValue0(v.Pos, OpZeroExt8to64, typ.UInt64)
  9421  		v0.AddArg(x)
  9422  		v1 := b.NewValue0(v.Pos, OpZeroExt8to64, typ.UInt64)
  9423  		v1.AddArg(y)
  9424  		v.AddArg2(v0, v1)
  9425  		return true
  9426  	}
  9427  }
  9428  func rewriteValueLOONG64_OpMove(v *Value) bool {
  9429  	v_2 := v.Args[2]
  9430  	v_1 := v.Args[1]
  9431  	v_0 := v.Args[0]
  9432  	b := v.Block
  9433  	typ := &b.Func.Config.Types
  9434  	// match: (Move [0] _ _ mem)
  9435  	// result: mem
  9436  	for {
  9437  		if auxIntToInt64(v.AuxInt) != 0 {
  9438  			break
  9439  		}
  9440  		mem := v_2
  9441  		v.copyOf(mem)
  9442  		return true
  9443  	}
  9444  	// match: (Move [1] dst src mem)
  9445  	// result: (MOVBstore dst (MOVBUload src mem) mem)
  9446  	for {
  9447  		if auxIntToInt64(v.AuxInt) != 1 {
  9448  			break
  9449  		}
  9450  		dst := v_0
  9451  		src := v_1
  9452  		mem := v_2
  9453  		v.reset(OpLOONG64MOVBstore)
  9454  		v0 := b.NewValue0(v.Pos, OpLOONG64MOVBUload, typ.UInt8)
  9455  		v0.AddArg2(src, mem)
  9456  		v.AddArg3(dst, v0, mem)
  9457  		return true
  9458  	}
  9459  	// match: (Move [2] dst src mem)
  9460  	// result: (MOVHstore dst (MOVHUload src mem) mem)
  9461  	for {
  9462  		if auxIntToInt64(v.AuxInt) != 2 {
  9463  			break
  9464  		}
  9465  		dst := v_0
  9466  		src := v_1
  9467  		mem := v_2
  9468  		v.reset(OpLOONG64MOVHstore)
  9469  		v0 := b.NewValue0(v.Pos, OpLOONG64MOVHUload, typ.UInt16)
  9470  		v0.AddArg2(src, mem)
  9471  		v.AddArg3(dst, v0, mem)
  9472  		return true
  9473  	}
  9474  	// match: (Move [3] dst src mem)
  9475  	// result: (MOVBstore [2] dst (MOVBUload [2] src mem) (MOVHstore dst (MOVHUload src mem) mem))
  9476  	for {
  9477  		if auxIntToInt64(v.AuxInt) != 3 {
  9478  			break
  9479  		}
  9480  		dst := v_0
  9481  		src := v_1
  9482  		mem := v_2
  9483  		v.reset(OpLOONG64MOVBstore)
  9484  		v.AuxInt = int32ToAuxInt(2)
  9485  		v0 := b.NewValue0(v.Pos, OpLOONG64MOVBUload, typ.UInt8)
  9486  		v0.AuxInt = int32ToAuxInt(2)
  9487  		v0.AddArg2(src, mem)
  9488  		v1 := b.NewValue0(v.Pos, OpLOONG64MOVHstore, types.TypeMem)
  9489  		v2 := b.NewValue0(v.Pos, OpLOONG64MOVHUload, typ.UInt16)
  9490  		v2.AddArg2(src, mem)
  9491  		v1.AddArg3(dst, v2, mem)
  9492  		v.AddArg3(dst, v0, v1)
  9493  		return true
  9494  	}
  9495  	// match: (Move [4] dst src mem)
  9496  	// result: (MOVWstore dst (MOVWUload src mem) mem)
  9497  	for {
  9498  		if auxIntToInt64(v.AuxInt) != 4 {
  9499  			break
  9500  		}
  9501  		dst := v_0
  9502  		src := v_1
  9503  		mem := v_2
  9504  		v.reset(OpLOONG64MOVWstore)
  9505  		v0 := b.NewValue0(v.Pos, OpLOONG64MOVWUload, typ.UInt32)
  9506  		v0.AddArg2(src, mem)
  9507  		v.AddArg3(dst, v0, mem)
  9508  		return true
  9509  	}
  9510  	// match: (Move [5] dst src mem)
  9511  	// result: (MOVBstore [4] dst (MOVBUload [4] src mem) (MOVWstore dst (MOVWUload src mem) mem))
  9512  	for {
  9513  		if auxIntToInt64(v.AuxInt) != 5 {
  9514  			break
  9515  		}
  9516  		dst := v_0
  9517  		src := v_1
  9518  		mem := v_2
  9519  		v.reset(OpLOONG64MOVBstore)
  9520  		v.AuxInt = int32ToAuxInt(4)
  9521  		v0 := b.NewValue0(v.Pos, OpLOONG64MOVBUload, typ.UInt8)
  9522  		v0.AuxInt = int32ToAuxInt(4)
  9523  		v0.AddArg2(src, mem)
  9524  		v1 := b.NewValue0(v.Pos, OpLOONG64MOVWstore, types.TypeMem)
  9525  		v2 := b.NewValue0(v.Pos, OpLOONG64MOVWUload, typ.UInt32)
  9526  		v2.AddArg2(src, mem)
  9527  		v1.AddArg3(dst, v2, mem)
  9528  		v.AddArg3(dst, v0, v1)
  9529  		return true
  9530  	}
  9531  	// match: (Move [6] dst src mem)
  9532  	// result: (MOVHstore [4] dst (MOVHUload [4] src mem) (MOVWstore dst (MOVWUload src mem) mem))
  9533  	for {
  9534  		if auxIntToInt64(v.AuxInt) != 6 {
  9535  			break
  9536  		}
  9537  		dst := v_0
  9538  		src := v_1
  9539  		mem := v_2
  9540  		v.reset(OpLOONG64MOVHstore)
  9541  		v.AuxInt = int32ToAuxInt(4)
  9542  		v0 := b.NewValue0(v.Pos, OpLOONG64MOVHUload, typ.UInt16)
  9543  		v0.AuxInt = int32ToAuxInt(4)
  9544  		v0.AddArg2(src, mem)
  9545  		v1 := b.NewValue0(v.Pos, OpLOONG64MOVWstore, types.TypeMem)
  9546  		v2 := b.NewValue0(v.Pos, OpLOONG64MOVWUload, typ.UInt32)
  9547  		v2.AddArg2(src, mem)
  9548  		v1.AddArg3(dst, v2, mem)
  9549  		v.AddArg3(dst, v0, v1)
  9550  		return true
  9551  	}
  9552  	// match: (Move [7] dst src mem)
  9553  	// result: (MOVWstore [3] dst (MOVWUload [3] src mem) (MOVWstore dst (MOVWUload src mem) mem))
  9554  	for {
  9555  		if auxIntToInt64(v.AuxInt) != 7 {
  9556  			break
  9557  		}
  9558  		dst := v_0
  9559  		src := v_1
  9560  		mem := v_2
  9561  		v.reset(OpLOONG64MOVWstore)
  9562  		v.AuxInt = int32ToAuxInt(3)
  9563  		v0 := b.NewValue0(v.Pos, OpLOONG64MOVWUload, typ.UInt32)
  9564  		v0.AuxInt = int32ToAuxInt(3)
  9565  		v0.AddArg2(src, mem)
  9566  		v1 := b.NewValue0(v.Pos, OpLOONG64MOVWstore, types.TypeMem)
  9567  		v2 := b.NewValue0(v.Pos, OpLOONG64MOVWUload, typ.UInt32)
  9568  		v2.AddArg2(src, mem)
  9569  		v1.AddArg3(dst, v2, mem)
  9570  		v.AddArg3(dst, v0, v1)
  9571  		return true
  9572  	}
  9573  	// match: (Move [8] dst src mem)
  9574  	// result: (MOVVstore dst (MOVVload src mem) mem)
  9575  	for {
  9576  		if auxIntToInt64(v.AuxInt) != 8 {
  9577  			break
  9578  		}
  9579  		dst := v_0
  9580  		src := v_1
  9581  		mem := v_2
  9582  		v.reset(OpLOONG64MOVVstore)
  9583  		v0 := b.NewValue0(v.Pos, OpLOONG64MOVVload, typ.UInt64)
  9584  		v0.AddArg2(src, mem)
  9585  		v.AddArg3(dst, v0, mem)
  9586  		return true
  9587  	}
  9588  	// match: (Move [9] dst src mem)
  9589  	// result: (MOVBstore [8] dst (MOVBUload [8] src mem) (MOVVstore dst (MOVVload src mem) mem))
  9590  	for {
  9591  		if auxIntToInt64(v.AuxInt) != 9 {
  9592  			break
  9593  		}
  9594  		dst := v_0
  9595  		src := v_1
  9596  		mem := v_2
  9597  		v.reset(OpLOONG64MOVBstore)
  9598  		v.AuxInt = int32ToAuxInt(8)
  9599  		v0 := b.NewValue0(v.Pos, OpLOONG64MOVBUload, typ.UInt8)
  9600  		v0.AuxInt = int32ToAuxInt(8)
  9601  		v0.AddArg2(src, mem)
  9602  		v1 := b.NewValue0(v.Pos, OpLOONG64MOVVstore, types.TypeMem)
  9603  		v2 := b.NewValue0(v.Pos, OpLOONG64MOVVload, typ.UInt64)
  9604  		v2.AddArg2(src, mem)
  9605  		v1.AddArg3(dst, v2, mem)
  9606  		v.AddArg3(dst, v0, v1)
  9607  		return true
  9608  	}
  9609  	// match: (Move [10] dst src mem)
  9610  	// result: (MOVHstore [8] dst (MOVHUload [8] src mem) (MOVVstore dst (MOVVload src mem) mem))
  9611  	for {
  9612  		if auxIntToInt64(v.AuxInt) != 10 {
  9613  			break
  9614  		}
  9615  		dst := v_0
  9616  		src := v_1
  9617  		mem := v_2
  9618  		v.reset(OpLOONG64MOVHstore)
  9619  		v.AuxInt = int32ToAuxInt(8)
  9620  		v0 := b.NewValue0(v.Pos, OpLOONG64MOVHUload, typ.UInt16)
  9621  		v0.AuxInt = int32ToAuxInt(8)
  9622  		v0.AddArg2(src, mem)
  9623  		v1 := b.NewValue0(v.Pos, OpLOONG64MOVVstore, types.TypeMem)
  9624  		v2 := b.NewValue0(v.Pos, OpLOONG64MOVVload, typ.UInt64)
  9625  		v2.AddArg2(src, mem)
  9626  		v1.AddArg3(dst, v2, mem)
  9627  		v.AddArg3(dst, v0, v1)
  9628  		return true
  9629  	}
  9630  	// match: (Move [11] dst src mem)
  9631  	// result: (MOVWstore [7] dst (MOVWload [7] src mem) (MOVVstore dst (MOVVload src mem) mem))
  9632  	for {
  9633  		if auxIntToInt64(v.AuxInt) != 11 {
  9634  			break
  9635  		}
  9636  		dst := v_0
  9637  		src := v_1
  9638  		mem := v_2
  9639  		v.reset(OpLOONG64MOVWstore)
  9640  		v.AuxInt = int32ToAuxInt(7)
  9641  		v0 := b.NewValue0(v.Pos, OpLOONG64MOVWload, typ.Int32)
  9642  		v0.AuxInt = int32ToAuxInt(7)
  9643  		v0.AddArg2(src, mem)
  9644  		v1 := b.NewValue0(v.Pos, OpLOONG64MOVVstore, types.TypeMem)
  9645  		v2 := b.NewValue0(v.Pos, OpLOONG64MOVVload, typ.UInt64)
  9646  		v2.AddArg2(src, mem)
  9647  		v1.AddArg3(dst, v2, mem)
  9648  		v.AddArg3(dst, v0, v1)
  9649  		return true
  9650  	}
  9651  	// match: (Move [12] dst src mem)
  9652  	// result: (MOVWstore [8] dst (MOVWUload [8] src mem) (MOVVstore dst (MOVVload src mem) mem))
  9653  	for {
  9654  		if auxIntToInt64(v.AuxInt) != 12 {
  9655  			break
  9656  		}
  9657  		dst := v_0
  9658  		src := v_1
  9659  		mem := v_2
  9660  		v.reset(OpLOONG64MOVWstore)
  9661  		v.AuxInt = int32ToAuxInt(8)
  9662  		v0 := b.NewValue0(v.Pos, OpLOONG64MOVWUload, typ.UInt32)
  9663  		v0.AuxInt = int32ToAuxInt(8)
  9664  		v0.AddArg2(src, mem)
  9665  		v1 := b.NewValue0(v.Pos, OpLOONG64MOVVstore, types.TypeMem)
  9666  		v2 := b.NewValue0(v.Pos, OpLOONG64MOVVload, typ.UInt64)
  9667  		v2.AddArg2(src, mem)
  9668  		v1.AddArg3(dst, v2, mem)
  9669  		v.AddArg3(dst, v0, v1)
  9670  		return true
  9671  	}
  9672  	// match: (Move [13] dst src mem)
  9673  	// result: (MOVVstore [5] dst (MOVVload [5] src mem) (MOVVstore dst (MOVVload src mem) mem))
  9674  	for {
  9675  		if auxIntToInt64(v.AuxInt) != 13 {
  9676  			break
  9677  		}
  9678  		dst := v_0
  9679  		src := v_1
  9680  		mem := v_2
  9681  		v.reset(OpLOONG64MOVVstore)
  9682  		v.AuxInt = int32ToAuxInt(5)
  9683  		v0 := b.NewValue0(v.Pos, OpLOONG64MOVVload, typ.UInt64)
  9684  		v0.AuxInt = int32ToAuxInt(5)
  9685  		v0.AddArg2(src, mem)
  9686  		v1 := b.NewValue0(v.Pos, OpLOONG64MOVVstore, types.TypeMem)
  9687  		v2 := b.NewValue0(v.Pos, OpLOONG64MOVVload, typ.UInt64)
  9688  		v2.AddArg2(src, mem)
  9689  		v1.AddArg3(dst, v2, mem)
  9690  		v.AddArg3(dst, v0, v1)
  9691  		return true
  9692  	}
  9693  	// match: (Move [14] dst src mem)
  9694  	// result: (MOVVstore [6] dst (MOVVload [6] src mem) (MOVVstore dst (MOVVload src mem) mem))
  9695  	for {
  9696  		if auxIntToInt64(v.AuxInt) != 14 {
  9697  			break
  9698  		}
  9699  		dst := v_0
  9700  		src := v_1
  9701  		mem := v_2
  9702  		v.reset(OpLOONG64MOVVstore)
  9703  		v.AuxInt = int32ToAuxInt(6)
  9704  		v0 := b.NewValue0(v.Pos, OpLOONG64MOVVload, typ.UInt64)
  9705  		v0.AuxInt = int32ToAuxInt(6)
  9706  		v0.AddArg2(src, mem)
  9707  		v1 := b.NewValue0(v.Pos, OpLOONG64MOVVstore, types.TypeMem)
  9708  		v2 := b.NewValue0(v.Pos, OpLOONG64MOVVload, typ.UInt64)
  9709  		v2.AddArg2(src, mem)
  9710  		v1.AddArg3(dst, v2, mem)
  9711  		v.AddArg3(dst, v0, v1)
  9712  		return true
  9713  	}
  9714  	// match: (Move [15] dst src mem)
  9715  	// result: (MOVVstore [7] dst (MOVVload [7] src mem) (MOVVstore dst (MOVVload src mem) mem))
  9716  	for {
  9717  		if auxIntToInt64(v.AuxInt) != 15 {
  9718  			break
  9719  		}
  9720  		dst := v_0
  9721  		src := v_1
  9722  		mem := v_2
  9723  		v.reset(OpLOONG64MOVVstore)
  9724  		v.AuxInt = int32ToAuxInt(7)
  9725  		v0 := b.NewValue0(v.Pos, OpLOONG64MOVVload, typ.UInt64)
  9726  		v0.AuxInt = int32ToAuxInt(7)
  9727  		v0.AddArg2(src, mem)
  9728  		v1 := b.NewValue0(v.Pos, OpLOONG64MOVVstore, types.TypeMem)
  9729  		v2 := b.NewValue0(v.Pos, OpLOONG64MOVVload, typ.UInt64)
  9730  		v2.AddArg2(src, mem)
  9731  		v1.AddArg3(dst, v2, mem)
  9732  		v.AddArg3(dst, v0, v1)
  9733  		return true
  9734  	}
  9735  	// match: (Move [16] dst src mem)
  9736  	// result: (MOVVstore [8] dst (MOVVload [8] src mem) (MOVVstore dst (MOVVload src mem) mem))
  9737  	for {
  9738  		if auxIntToInt64(v.AuxInt) != 16 {
  9739  			break
  9740  		}
  9741  		dst := v_0
  9742  		src := v_1
  9743  		mem := v_2
  9744  		v.reset(OpLOONG64MOVVstore)
  9745  		v.AuxInt = int32ToAuxInt(8)
  9746  		v0 := b.NewValue0(v.Pos, OpLOONG64MOVVload, typ.UInt64)
  9747  		v0.AuxInt = int32ToAuxInt(8)
  9748  		v0.AddArg2(src, mem)
  9749  		v1 := b.NewValue0(v.Pos, OpLOONG64MOVVstore, types.TypeMem)
  9750  		v2 := b.NewValue0(v.Pos, OpLOONG64MOVVload, typ.UInt64)
  9751  		v2.AddArg2(src, mem)
  9752  		v1.AddArg3(dst, v2, mem)
  9753  		v.AddArg3(dst, v0, v1)
  9754  		return true
  9755  	}
  9756  	// match: (Move [s] dst src mem)
  9757  	// cond: s > 16 && s < 192 && logLargeCopy(v, s)
  9758  	// result: (LoweredMove [s] dst src mem)
  9759  	for {
  9760  		s := auxIntToInt64(v.AuxInt)
  9761  		dst := v_0
  9762  		src := v_1
  9763  		mem := v_2
  9764  		if !(s > 16 && s < 192 && logLargeCopy(v, s)) {
  9765  			break
  9766  		}
  9767  		v.reset(OpLOONG64LoweredMove)
  9768  		v.AuxInt = int64ToAuxInt(s)
  9769  		v.AddArg3(dst, src, mem)
  9770  		return true
  9771  	}
  9772  	// match: (Move [s] dst src mem)
  9773  	// cond: s >= 192 && logLargeCopy(v, s)
  9774  	// result: (LoweredMoveLoop [s] dst src mem)
  9775  	for {
  9776  		s := auxIntToInt64(v.AuxInt)
  9777  		dst := v_0
  9778  		src := v_1
  9779  		mem := v_2
  9780  		if !(s >= 192 && logLargeCopy(v, s)) {
  9781  			break
  9782  		}
  9783  		v.reset(OpLOONG64LoweredMoveLoop)
  9784  		v.AuxInt = int64ToAuxInt(s)
  9785  		v.AddArg3(dst, src, mem)
  9786  		return true
  9787  	}
  9788  	return false
  9789  }
  9790  func rewriteValueLOONG64_OpNeq16(v *Value) bool {
  9791  	v_1 := v.Args[1]
  9792  	v_0 := v.Args[0]
  9793  	b := v.Block
  9794  	typ := &b.Func.Config.Types
  9795  	// match: (Neq16 x y)
  9796  	// result: (SGTU (XOR (ZeroExt16to32 x) (ZeroExt16to64 y)) (MOVVconst [0]))
  9797  	for {
  9798  		x := v_0
  9799  		y := v_1
  9800  		v.reset(OpLOONG64SGTU)
  9801  		v0 := b.NewValue0(v.Pos, OpLOONG64XOR, typ.UInt64)
  9802  		v1 := b.NewValue0(v.Pos, OpZeroExt16to32, typ.UInt32)
  9803  		v1.AddArg(x)
  9804  		v2 := b.NewValue0(v.Pos, OpZeroExt16to64, typ.UInt64)
  9805  		v2.AddArg(y)
  9806  		v0.AddArg2(v1, v2)
  9807  		v3 := b.NewValue0(v.Pos, OpLOONG64MOVVconst, typ.UInt64)
  9808  		v3.AuxInt = int64ToAuxInt(0)
  9809  		v.AddArg2(v0, v3)
  9810  		return true
  9811  	}
  9812  }
  9813  func rewriteValueLOONG64_OpNeq32(v *Value) bool {
  9814  	v_1 := v.Args[1]
  9815  	v_0 := v.Args[0]
  9816  	b := v.Block
  9817  	typ := &b.Func.Config.Types
  9818  	// match: (Neq32 x y)
  9819  	// result: (SGTU (XOR (ZeroExt32to64 x) (ZeroExt32to64 y)) (MOVVconst [0]))
  9820  	for {
  9821  		x := v_0
  9822  		y := v_1
  9823  		v.reset(OpLOONG64SGTU)
  9824  		v0 := b.NewValue0(v.Pos, OpLOONG64XOR, typ.UInt64)
  9825  		v1 := b.NewValue0(v.Pos, OpZeroExt32to64, typ.UInt64)
  9826  		v1.AddArg(x)
  9827  		v2 := b.NewValue0(v.Pos, OpZeroExt32to64, typ.UInt64)
  9828  		v2.AddArg(y)
  9829  		v0.AddArg2(v1, v2)
  9830  		v3 := b.NewValue0(v.Pos, OpLOONG64MOVVconst, typ.UInt64)
  9831  		v3.AuxInt = int64ToAuxInt(0)
  9832  		v.AddArg2(v0, v3)
  9833  		return true
  9834  	}
  9835  }
  9836  func rewriteValueLOONG64_OpNeq32F(v *Value) bool {
  9837  	v_1 := v.Args[1]
  9838  	v_0 := v.Args[0]
  9839  	b := v.Block
  9840  	// match: (Neq32F x y)
  9841  	// result: (FPFlagFalse (CMPEQF x y))
  9842  	for {
  9843  		x := v_0
  9844  		y := v_1
  9845  		v.reset(OpLOONG64FPFlagFalse)
  9846  		v0 := b.NewValue0(v.Pos, OpLOONG64CMPEQF, types.TypeFlags)
  9847  		v0.AddArg2(x, y)
  9848  		v.AddArg(v0)
  9849  		return true
  9850  	}
  9851  }
  9852  func rewriteValueLOONG64_OpNeq64(v *Value) bool {
  9853  	v_1 := v.Args[1]
  9854  	v_0 := v.Args[0]
  9855  	b := v.Block
  9856  	typ := &b.Func.Config.Types
  9857  	// match: (Neq64 x y)
  9858  	// result: (SGTU (XOR x y) (MOVVconst [0]))
  9859  	for {
  9860  		x := v_0
  9861  		y := v_1
  9862  		v.reset(OpLOONG64SGTU)
  9863  		v0 := b.NewValue0(v.Pos, OpLOONG64XOR, typ.UInt64)
  9864  		v0.AddArg2(x, y)
  9865  		v1 := b.NewValue0(v.Pos, OpLOONG64MOVVconst, typ.UInt64)
  9866  		v1.AuxInt = int64ToAuxInt(0)
  9867  		v.AddArg2(v0, v1)
  9868  		return true
  9869  	}
  9870  }
  9871  func rewriteValueLOONG64_OpNeq64F(v *Value) bool {
  9872  	v_1 := v.Args[1]
  9873  	v_0 := v.Args[0]
  9874  	b := v.Block
  9875  	// match: (Neq64F x y)
  9876  	// result: (FPFlagFalse (CMPEQD x y))
  9877  	for {
  9878  		x := v_0
  9879  		y := v_1
  9880  		v.reset(OpLOONG64FPFlagFalse)
  9881  		v0 := b.NewValue0(v.Pos, OpLOONG64CMPEQD, types.TypeFlags)
  9882  		v0.AddArg2(x, y)
  9883  		v.AddArg(v0)
  9884  		return true
  9885  	}
  9886  }
  9887  func rewriteValueLOONG64_OpNeq8(v *Value) bool {
  9888  	v_1 := v.Args[1]
  9889  	v_0 := v.Args[0]
  9890  	b := v.Block
  9891  	typ := &b.Func.Config.Types
  9892  	// match: (Neq8 x y)
  9893  	// result: (SGTU (XOR (ZeroExt8to64 x) (ZeroExt8to64 y)) (MOVVconst [0]))
  9894  	for {
  9895  		x := v_0
  9896  		y := v_1
  9897  		v.reset(OpLOONG64SGTU)
  9898  		v0 := b.NewValue0(v.Pos, OpLOONG64XOR, typ.UInt64)
  9899  		v1 := b.NewValue0(v.Pos, OpZeroExt8to64, typ.UInt64)
  9900  		v1.AddArg(x)
  9901  		v2 := b.NewValue0(v.Pos, OpZeroExt8to64, typ.UInt64)
  9902  		v2.AddArg(y)
  9903  		v0.AddArg2(v1, v2)
  9904  		v3 := b.NewValue0(v.Pos, OpLOONG64MOVVconst, typ.UInt64)
  9905  		v3.AuxInt = int64ToAuxInt(0)
  9906  		v.AddArg2(v0, v3)
  9907  		return true
  9908  	}
  9909  }
  9910  func rewriteValueLOONG64_OpNeqPtr(v *Value) bool {
  9911  	v_1 := v.Args[1]
  9912  	v_0 := v.Args[0]
  9913  	b := v.Block
  9914  	typ := &b.Func.Config.Types
  9915  	// match: (NeqPtr x y)
  9916  	// result: (SGTU (XOR x y) (MOVVconst [0]))
  9917  	for {
  9918  		x := v_0
  9919  		y := v_1
  9920  		v.reset(OpLOONG64SGTU)
  9921  		v0 := b.NewValue0(v.Pos, OpLOONG64XOR, typ.UInt64)
  9922  		v0.AddArg2(x, y)
  9923  		v1 := b.NewValue0(v.Pos, OpLOONG64MOVVconst, typ.UInt64)
  9924  		v1.AuxInt = int64ToAuxInt(0)
  9925  		v.AddArg2(v0, v1)
  9926  		return true
  9927  	}
  9928  }
  9929  func rewriteValueLOONG64_OpNot(v *Value) bool {
  9930  	v_0 := v.Args[0]
  9931  	// match: (Not x)
  9932  	// result: (XORconst [1] x)
  9933  	for {
  9934  		x := v_0
  9935  		v.reset(OpLOONG64XORconst)
  9936  		v.AuxInt = int64ToAuxInt(1)
  9937  		v.AddArg(x)
  9938  		return true
  9939  	}
  9940  }
  9941  func rewriteValueLOONG64_OpOffPtr(v *Value) bool {
  9942  	v_0 := v.Args[0]
  9943  	// match: (OffPtr [off] ptr:(SP))
  9944  	// result: (MOVVaddr [int32(off)] ptr)
  9945  	for {
  9946  		off := auxIntToInt64(v.AuxInt)
  9947  		ptr := v_0
  9948  		if ptr.Op != OpSP {
  9949  			break
  9950  		}
  9951  		v.reset(OpLOONG64MOVVaddr)
  9952  		v.AuxInt = int32ToAuxInt(int32(off))
  9953  		v.AddArg(ptr)
  9954  		return true
  9955  	}
  9956  	// match: (OffPtr [off] ptr)
  9957  	// result: (ADDVconst [off] ptr)
  9958  	for {
  9959  		off := auxIntToInt64(v.AuxInt)
  9960  		ptr := v_0
  9961  		v.reset(OpLOONG64ADDVconst)
  9962  		v.AuxInt = int64ToAuxInt(off)
  9963  		v.AddArg(ptr)
  9964  		return true
  9965  	}
  9966  }
  9967  func rewriteValueLOONG64_OpPopCount16(v *Value) bool {
  9968  	v_0 := v.Args[0]
  9969  	b := v.Block
  9970  	typ := &b.Func.Config.Types
  9971  	// match: (PopCount16 <t> x)
  9972  	// result: (MOVWfpgp <t> (VPCNT16 <typ.Float32> (MOVWgpfp <typ.Float32> (ZeroExt16to32 x))))
  9973  	for {
  9974  		t := v.Type
  9975  		x := v_0
  9976  		v.reset(OpLOONG64MOVWfpgp)
  9977  		v.Type = t
  9978  		v0 := b.NewValue0(v.Pos, OpLOONG64VPCNT16, typ.Float32)
  9979  		v1 := b.NewValue0(v.Pos, OpLOONG64MOVWgpfp, typ.Float32)
  9980  		v2 := b.NewValue0(v.Pos, OpZeroExt16to32, typ.UInt32)
  9981  		v2.AddArg(x)
  9982  		v1.AddArg(v2)
  9983  		v0.AddArg(v1)
  9984  		v.AddArg(v0)
  9985  		return true
  9986  	}
  9987  }
  9988  func rewriteValueLOONG64_OpPopCount32(v *Value) bool {
  9989  	v_0 := v.Args[0]
  9990  	b := v.Block
  9991  	typ := &b.Func.Config.Types
  9992  	// match: (PopCount32 <t> x)
  9993  	// result: (MOVWfpgp <t> (VPCNT32 <typ.Float32> (MOVWgpfp <typ.Float32> x)))
  9994  	for {
  9995  		t := v.Type
  9996  		x := v_0
  9997  		v.reset(OpLOONG64MOVWfpgp)
  9998  		v.Type = t
  9999  		v0 := b.NewValue0(v.Pos, OpLOONG64VPCNT32, typ.Float32)
 10000  		v1 := b.NewValue0(v.Pos, OpLOONG64MOVWgpfp, typ.Float32)
 10001  		v1.AddArg(x)
 10002  		v0.AddArg(v1)
 10003  		v.AddArg(v0)
 10004  		return true
 10005  	}
 10006  }
 10007  func rewriteValueLOONG64_OpPopCount64(v *Value) bool {
 10008  	v_0 := v.Args[0]
 10009  	b := v.Block
 10010  	typ := &b.Func.Config.Types
 10011  	// match: (PopCount64 <t> x)
 10012  	// result: (MOVVfpgp <t> (VPCNT64 <typ.Float64> (MOVVgpfp <typ.Float64> x)))
 10013  	for {
 10014  		t := v.Type
 10015  		x := v_0
 10016  		v.reset(OpLOONG64MOVVfpgp)
 10017  		v.Type = t
 10018  		v0 := b.NewValue0(v.Pos, OpLOONG64VPCNT64, typ.Float64)
 10019  		v1 := b.NewValue0(v.Pos, OpLOONG64MOVVgpfp, typ.Float64)
 10020  		v1.AddArg(x)
 10021  		v0.AddArg(v1)
 10022  		v.AddArg(v0)
 10023  		return true
 10024  	}
 10025  }
 10026  func rewriteValueLOONG64_OpPrefetchCache(v *Value) bool {
 10027  	v_1 := v.Args[1]
 10028  	v_0 := v.Args[0]
 10029  	// match: (PrefetchCache addr mem)
 10030  	// result: (PRELD addr mem [0])
 10031  	for {
 10032  		addr := v_0
 10033  		mem := v_1
 10034  		v.reset(OpLOONG64PRELD)
 10035  		v.AuxInt = int64ToAuxInt(0)
 10036  		v.AddArg2(addr, mem)
 10037  		return true
 10038  	}
 10039  }
 10040  func rewriteValueLOONG64_OpPrefetchCacheStreamed(v *Value) bool {
 10041  	v_1 := v.Args[1]
 10042  	v_0 := v.Args[0]
 10043  	// match: (PrefetchCacheStreamed addr mem)
 10044  	// result: (PRELDX addr mem [(((512 << 1) + (1 << 12)) << 5) + 2])
 10045  	for {
 10046  		addr := v_0
 10047  		mem := v_1
 10048  		v.reset(OpLOONG64PRELDX)
 10049  		v.AuxInt = int64ToAuxInt((((512 << 1) + (1 << 12)) << 5) + 2)
 10050  		v.AddArg2(addr, mem)
 10051  		return true
 10052  	}
 10053  }
 10054  func rewriteValueLOONG64_OpRotateLeft16(v *Value) bool {
 10055  	v_1 := v.Args[1]
 10056  	v_0 := v.Args[0]
 10057  	b := v.Block
 10058  	typ := &b.Func.Config.Types
 10059  	// match: (RotateLeft16 <t> x (MOVVconst [c]))
 10060  	// result: (Or16 (Lsh16x64 <t> x (MOVVconst [c&15])) (Rsh16Ux64 <t> x (MOVVconst [-c&15])))
 10061  	for {
 10062  		t := v.Type
 10063  		x := v_0
 10064  		if v_1.Op != OpLOONG64MOVVconst {
 10065  			break
 10066  		}
 10067  		c := auxIntToInt64(v_1.AuxInt)
 10068  		v.reset(OpOr16)
 10069  		v0 := b.NewValue0(v.Pos, OpLsh16x64, t)
 10070  		v1 := b.NewValue0(v.Pos, OpLOONG64MOVVconst, typ.UInt64)
 10071  		v1.AuxInt = int64ToAuxInt(c & 15)
 10072  		v0.AddArg2(x, v1)
 10073  		v2 := b.NewValue0(v.Pos, OpRsh16Ux64, t)
 10074  		v3 := b.NewValue0(v.Pos, OpLOONG64MOVVconst, typ.UInt64)
 10075  		v3.AuxInt = int64ToAuxInt(-c & 15)
 10076  		v2.AddArg2(x, v3)
 10077  		v.AddArg2(v0, v2)
 10078  		return true
 10079  	}
 10080  	// match: (RotateLeft16 <t> x y)
 10081  	// result: (ROTR <t> (OR <typ.UInt32> (ZeroExt16to32 x) (SLLVconst <t> (ZeroExt16to32 x) [16])) (NEGV <typ.Int64> y))
 10082  	for {
 10083  		t := v.Type
 10084  		x := v_0
 10085  		y := v_1
 10086  		v.reset(OpLOONG64ROTR)
 10087  		v.Type = t
 10088  		v0 := b.NewValue0(v.Pos, OpLOONG64OR, typ.UInt32)
 10089  		v1 := b.NewValue0(v.Pos, OpZeroExt16to32, typ.UInt32)
 10090  		v1.AddArg(x)
 10091  		v2 := b.NewValue0(v.Pos, OpLOONG64SLLVconst, t)
 10092  		v2.AuxInt = int64ToAuxInt(16)
 10093  		v2.AddArg(v1)
 10094  		v0.AddArg2(v1, v2)
 10095  		v3 := b.NewValue0(v.Pos, OpLOONG64NEGV, typ.Int64)
 10096  		v3.AddArg(y)
 10097  		v.AddArg2(v0, v3)
 10098  		return true
 10099  	}
 10100  }
 10101  func rewriteValueLOONG64_OpRotateLeft32(v *Value) bool {
 10102  	v_1 := v.Args[1]
 10103  	v_0 := v.Args[0]
 10104  	b := v.Block
 10105  	// match: (RotateLeft32 x y)
 10106  	// result: (ROTR x (NEGV <y.Type> y))
 10107  	for {
 10108  		x := v_0
 10109  		y := v_1
 10110  		v.reset(OpLOONG64ROTR)
 10111  		v0 := b.NewValue0(v.Pos, OpLOONG64NEGV, y.Type)
 10112  		v0.AddArg(y)
 10113  		v.AddArg2(x, v0)
 10114  		return true
 10115  	}
 10116  }
 10117  func rewriteValueLOONG64_OpRotateLeft64(v *Value) bool {
 10118  	v_1 := v.Args[1]
 10119  	v_0 := v.Args[0]
 10120  	b := v.Block
 10121  	// match: (RotateLeft64 x y)
 10122  	// result: (ROTRV x (NEGV <y.Type> y))
 10123  	for {
 10124  		x := v_0
 10125  		y := v_1
 10126  		v.reset(OpLOONG64ROTRV)
 10127  		v0 := b.NewValue0(v.Pos, OpLOONG64NEGV, y.Type)
 10128  		v0.AddArg(y)
 10129  		v.AddArg2(x, v0)
 10130  		return true
 10131  	}
 10132  }
 10133  func rewriteValueLOONG64_OpRotateLeft8(v *Value) bool {
 10134  	v_1 := v.Args[1]
 10135  	v_0 := v.Args[0]
 10136  	b := v.Block
 10137  	typ := &b.Func.Config.Types
 10138  	// match: (RotateLeft8 <t> x (MOVVconst [c]))
 10139  	// result: (Or8 (Lsh8x64 <t> x (MOVVconst [c&7])) (Rsh8Ux64 <t> x (MOVVconst [-c&7])))
 10140  	for {
 10141  		t := v.Type
 10142  		x := v_0
 10143  		if v_1.Op != OpLOONG64MOVVconst {
 10144  			break
 10145  		}
 10146  		c := auxIntToInt64(v_1.AuxInt)
 10147  		v.reset(OpOr8)
 10148  		v0 := b.NewValue0(v.Pos, OpLsh8x64, t)
 10149  		v1 := b.NewValue0(v.Pos, OpLOONG64MOVVconst, typ.UInt64)
 10150  		v1.AuxInt = int64ToAuxInt(c & 7)
 10151  		v0.AddArg2(x, v1)
 10152  		v2 := b.NewValue0(v.Pos, OpRsh8Ux64, t)
 10153  		v3 := b.NewValue0(v.Pos, OpLOONG64MOVVconst, typ.UInt64)
 10154  		v3.AuxInt = int64ToAuxInt(-c & 7)
 10155  		v2.AddArg2(x, v3)
 10156  		v.AddArg2(v0, v2)
 10157  		return true
 10158  	}
 10159  	// match: (RotateLeft8 <t> x y)
 10160  	// result: (OR <t> (SLLV <t> x (ANDconst <typ.Int64> [7] y)) (SRLV <t> (ZeroExt8to64 x) (ANDconst <typ.Int64> [7] (NEGV <typ.Int64> y))))
 10161  	for {
 10162  		t := v.Type
 10163  		x := v_0
 10164  		y := v_1
 10165  		v.reset(OpLOONG64OR)
 10166  		v.Type = t
 10167  		v0 := b.NewValue0(v.Pos, OpLOONG64SLLV, t)
 10168  		v1 := b.NewValue0(v.Pos, OpLOONG64ANDconst, typ.Int64)
 10169  		v1.AuxInt = int64ToAuxInt(7)
 10170  		v1.AddArg(y)
 10171  		v0.AddArg2(x, v1)
 10172  		v2 := b.NewValue0(v.Pos, OpLOONG64SRLV, t)
 10173  		v3 := b.NewValue0(v.Pos, OpZeroExt8to64, typ.UInt64)
 10174  		v3.AddArg(x)
 10175  		v4 := b.NewValue0(v.Pos, OpLOONG64ANDconst, typ.Int64)
 10176  		v4.AuxInt = int64ToAuxInt(7)
 10177  		v5 := b.NewValue0(v.Pos, OpLOONG64NEGV, typ.Int64)
 10178  		v5.AddArg(y)
 10179  		v4.AddArg(v5)
 10180  		v2.AddArg2(v3, v4)
 10181  		v.AddArg2(v0, v2)
 10182  		return true
 10183  	}
 10184  }
 10185  func rewriteValueLOONG64_OpRsh16Ux16(v *Value) bool {
 10186  	v_1 := v.Args[1]
 10187  	v_0 := v.Args[0]
 10188  	b := v.Block
 10189  	typ := &b.Func.Config.Types
 10190  	// match: (Rsh16Ux16 x y)
 10191  	// cond: shiftIsBounded(v)
 10192  	// result: (SRLV (ZeroExt16to64 x) y)
 10193  	for {
 10194  		x := v_0
 10195  		y := v_1
 10196  		if !(shiftIsBounded(v)) {
 10197  			break
 10198  		}
 10199  		v.reset(OpLOONG64SRLV)
 10200  		v0 := b.NewValue0(v.Pos, OpZeroExt16to64, typ.UInt64)
 10201  		v0.AddArg(x)
 10202  		v.AddArg2(v0, y)
 10203  		return true
 10204  	}
 10205  	// match: (Rsh16Ux16 <t> x y)
 10206  	// cond: !shiftIsBounded(v)
 10207  	// result: (MASKEQZ (SRLV <t> (ZeroExt16to64 x) (ZeroExt16to64 y)) (SGTU (MOVVconst <typ.UInt64> [64]) (ZeroExt16to64 y)))
 10208  	for {
 10209  		t := v.Type
 10210  		x := v_0
 10211  		y := v_1
 10212  		if !(!shiftIsBounded(v)) {
 10213  			break
 10214  		}
 10215  		v.reset(OpLOONG64MASKEQZ)
 10216  		v0 := b.NewValue0(v.Pos, OpLOONG64SRLV, t)
 10217  		v1 := b.NewValue0(v.Pos, OpZeroExt16to64, typ.UInt64)
 10218  		v1.AddArg(x)
 10219  		v2 := b.NewValue0(v.Pos, OpZeroExt16to64, typ.UInt64)
 10220  		v2.AddArg(y)
 10221  		v0.AddArg2(v1, v2)
 10222  		v3 := b.NewValue0(v.Pos, OpLOONG64SGTU, typ.Bool)
 10223  		v4 := b.NewValue0(v.Pos, OpLOONG64MOVVconst, typ.UInt64)
 10224  		v4.AuxInt = int64ToAuxInt(64)
 10225  		v3.AddArg2(v4, v2)
 10226  		v.AddArg2(v0, v3)
 10227  		return true
 10228  	}
 10229  	return false
 10230  }
 10231  func rewriteValueLOONG64_OpRsh16Ux32(v *Value) bool {
 10232  	v_1 := v.Args[1]
 10233  	v_0 := v.Args[0]
 10234  	b := v.Block
 10235  	typ := &b.Func.Config.Types
 10236  	// match: (Rsh16Ux32 x y)
 10237  	// cond: shiftIsBounded(v)
 10238  	// result: (SRLV (ZeroExt16to64 x) y)
 10239  	for {
 10240  		x := v_0
 10241  		y := v_1
 10242  		if !(shiftIsBounded(v)) {
 10243  			break
 10244  		}
 10245  		v.reset(OpLOONG64SRLV)
 10246  		v0 := b.NewValue0(v.Pos, OpZeroExt16to64, typ.UInt64)
 10247  		v0.AddArg(x)
 10248  		v.AddArg2(v0, y)
 10249  		return true
 10250  	}
 10251  	// match: (Rsh16Ux32 <t> x y)
 10252  	// cond: !shiftIsBounded(v)
 10253  	// result: (MASKEQZ (SRLV <t> (ZeroExt16to64 x) (ZeroExt32to64 y)) (SGTU (MOVVconst <typ.UInt64> [64]) (ZeroExt32to64 y)))
 10254  	for {
 10255  		t := v.Type
 10256  		x := v_0
 10257  		y := v_1
 10258  		if !(!shiftIsBounded(v)) {
 10259  			break
 10260  		}
 10261  		v.reset(OpLOONG64MASKEQZ)
 10262  		v0 := b.NewValue0(v.Pos, OpLOONG64SRLV, t)
 10263  		v1 := b.NewValue0(v.Pos, OpZeroExt16to64, typ.UInt64)
 10264  		v1.AddArg(x)
 10265  		v2 := b.NewValue0(v.Pos, OpZeroExt32to64, typ.UInt64)
 10266  		v2.AddArg(y)
 10267  		v0.AddArg2(v1, v2)
 10268  		v3 := b.NewValue0(v.Pos, OpLOONG64SGTU, typ.Bool)
 10269  		v4 := b.NewValue0(v.Pos, OpLOONG64MOVVconst, typ.UInt64)
 10270  		v4.AuxInt = int64ToAuxInt(64)
 10271  		v3.AddArg2(v4, v2)
 10272  		v.AddArg2(v0, v3)
 10273  		return true
 10274  	}
 10275  	return false
 10276  }
 10277  func rewriteValueLOONG64_OpRsh16Ux64(v *Value) bool {
 10278  	v_1 := v.Args[1]
 10279  	v_0 := v.Args[0]
 10280  	b := v.Block
 10281  	typ := &b.Func.Config.Types
 10282  	// match: (Rsh16Ux64 x y)
 10283  	// cond: shiftIsBounded(v)
 10284  	// result: (SRLV (ZeroExt16to64 x) y)
 10285  	for {
 10286  		x := v_0
 10287  		y := v_1
 10288  		if !(shiftIsBounded(v)) {
 10289  			break
 10290  		}
 10291  		v.reset(OpLOONG64SRLV)
 10292  		v0 := b.NewValue0(v.Pos, OpZeroExt16to64, typ.UInt64)
 10293  		v0.AddArg(x)
 10294  		v.AddArg2(v0, y)
 10295  		return true
 10296  	}
 10297  	// match: (Rsh16Ux64 <t> x y)
 10298  	// cond: !shiftIsBounded(v)
 10299  	// result: (MASKEQZ (SRLV <t> (ZeroExt16to64 x) y) (SGTU (MOVVconst <typ.UInt64> [64]) y))
 10300  	for {
 10301  		t := v.Type
 10302  		x := v_0
 10303  		y := v_1
 10304  		if !(!shiftIsBounded(v)) {
 10305  			break
 10306  		}
 10307  		v.reset(OpLOONG64MASKEQZ)
 10308  		v0 := b.NewValue0(v.Pos, OpLOONG64SRLV, t)
 10309  		v1 := b.NewValue0(v.Pos, OpZeroExt16to64, typ.UInt64)
 10310  		v1.AddArg(x)
 10311  		v0.AddArg2(v1, y)
 10312  		v2 := b.NewValue0(v.Pos, OpLOONG64SGTU, typ.Bool)
 10313  		v3 := b.NewValue0(v.Pos, OpLOONG64MOVVconst, typ.UInt64)
 10314  		v3.AuxInt = int64ToAuxInt(64)
 10315  		v2.AddArg2(v3, y)
 10316  		v.AddArg2(v0, v2)
 10317  		return true
 10318  	}
 10319  	return false
 10320  }
 10321  func rewriteValueLOONG64_OpRsh16Ux8(v *Value) bool {
 10322  	v_1 := v.Args[1]
 10323  	v_0 := v.Args[0]
 10324  	b := v.Block
 10325  	typ := &b.Func.Config.Types
 10326  	// match: (Rsh16Ux8 x y)
 10327  	// cond: shiftIsBounded(v)
 10328  	// result: (SRLV (ZeroExt16to64 x) y)
 10329  	for {
 10330  		x := v_0
 10331  		y := v_1
 10332  		if !(shiftIsBounded(v)) {
 10333  			break
 10334  		}
 10335  		v.reset(OpLOONG64SRLV)
 10336  		v0 := b.NewValue0(v.Pos, OpZeroExt16to64, typ.UInt64)
 10337  		v0.AddArg(x)
 10338  		v.AddArg2(v0, y)
 10339  		return true
 10340  	}
 10341  	// match: (Rsh16Ux8 <t> x y)
 10342  	// cond: !shiftIsBounded(v)
 10343  	// result: (MASKEQZ (SRLV <t> (ZeroExt16to64 x) (ZeroExt8to64 y)) (SGTU (MOVVconst <typ.UInt64> [64]) (ZeroExt8to64 y)))
 10344  	for {
 10345  		t := v.Type
 10346  		x := v_0
 10347  		y := v_1
 10348  		if !(!shiftIsBounded(v)) {
 10349  			break
 10350  		}
 10351  		v.reset(OpLOONG64MASKEQZ)
 10352  		v0 := b.NewValue0(v.Pos, OpLOONG64SRLV, t)
 10353  		v1 := b.NewValue0(v.Pos, OpZeroExt16to64, typ.UInt64)
 10354  		v1.AddArg(x)
 10355  		v2 := b.NewValue0(v.Pos, OpZeroExt8to64, typ.UInt64)
 10356  		v2.AddArg(y)
 10357  		v0.AddArg2(v1, v2)
 10358  		v3 := b.NewValue0(v.Pos, OpLOONG64SGTU, typ.Bool)
 10359  		v4 := b.NewValue0(v.Pos, OpLOONG64MOVVconst, typ.UInt64)
 10360  		v4.AuxInt = int64ToAuxInt(64)
 10361  		v3.AddArg2(v4, v2)
 10362  		v.AddArg2(v0, v3)
 10363  		return true
 10364  	}
 10365  	return false
 10366  }
 10367  func rewriteValueLOONG64_OpRsh16x16(v *Value) bool {
 10368  	v_1 := v.Args[1]
 10369  	v_0 := v.Args[0]
 10370  	b := v.Block
 10371  	typ := &b.Func.Config.Types
 10372  	// match: (Rsh16x16 x y)
 10373  	// cond: shiftIsBounded(v)
 10374  	// result: (SRAV (SignExt16to64 x) y)
 10375  	for {
 10376  		x := v_0
 10377  		y := v_1
 10378  		if !(shiftIsBounded(v)) {
 10379  			break
 10380  		}
 10381  		v.reset(OpLOONG64SRAV)
 10382  		v0 := b.NewValue0(v.Pos, OpSignExt16to64, typ.Int64)
 10383  		v0.AddArg(x)
 10384  		v.AddArg2(v0, y)
 10385  		return true
 10386  	}
 10387  	// match: (Rsh16x16 <t> x y)
 10388  	// cond: !shiftIsBounded(v)
 10389  	// result: (SRAV (SignExt16to64 x) (OR <t> (NEGV <t> (SGTU (ZeroExt16to64 y) (MOVVconst <typ.UInt64> [63]))) (ZeroExt16to64 y)))
 10390  	for {
 10391  		t := v.Type
 10392  		x := v_0
 10393  		y := v_1
 10394  		if !(!shiftIsBounded(v)) {
 10395  			break
 10396  		}
 10397  		v.reset(OpLOONG64SRAV)
 10398  		v0 := b.NewValue0(v.Pos, OpSignExt16to64, typ.Int64)
 10399  		v0.AddArg(x)
 10400  		v1 := b.NewValue0(v.Pos, OpLOONG64OR, t)
 10401  		v2 := b.NewValue0(v.Pos, OpLOONG64NEGV, t)
 10402  		v3 := b.NewValue0(v.Pos, OpLOONG64SGTU, typ.Bool)
 10403  		v4 := b.NewValue0(v.Pos, OpZeroExt16to64, typ.UInt64)
 10404  		v4.AddArg(y)
 10405  		v5 := b.NewValue0(v.Pos, OpLOONG64MOVVconst, typ.UInt64)
 10406  		v5.AuxInt = int64ToAuxInt(63)
 10407  		v3.AddArg2(v4, v5)
 10408  		v2.AddArg(v3)
 10409  		v1.AddArg2(v2, v4)
 10410  		v.AddArg2(v0, v1)
 10411  		return true
 10412  	}
 10413  	return false
 10414  }
 10415  func rewriteValueLOONG64_OpRsh16x32(v *Value) bool {
 10416  	v_1 := v.Args[1]
 10417  	v_0 := v.Args[0]
 10418  	b := v.Block
 10419  	typ := &b.Func.Config.Types
 10420  	// match: (Rsh16x32 x y)
 10421  	// cond: shiftIsBounded(v)
 10422  	// result: (SRAV (SignExt16to64 x) y)
 10423  	for {
 10424  		x := v_0
 10425  		y := v_1
 10426  		if !(shiftIsBounded(v)) {
 10427  			break
 10428  		}
 10429  		v.reset(OpLOONG64SRAV)
 10430  		v0 := b.NewValue0(v.Pos, OpSignExt16to64, typ.Int64)
 10431  		v0.AddArg(x)
 10432  		v.AddArg2(v0, y)
 10433  		return true
 10434  	}
 10435  	// match: (Rsh16x32 <t> x y)
 10436  	// cond: !shiftIsBounded(v)
 10437  	// result: (SRAV (SignExt16to64 x) (OR <t> (NEGV <t> (SGTU (ZeroExt32to64 y) (MOVVconst <typ.UInt64> [63]))) (ZeroExt32to64 y)))
 10438  	for {
 10439  		t := v.Type
 10440  		x := v_0
 10441  		y := v_1
 10442  		if !(!shiftIsBounded(v)) {
 10443  			break
 10444  		}
 10445  		v.reset(OpLOONG64SRAV)
 10446  		v0 := b.NewValue0(v.Pos, OpSignExt16to64, typ.Int64)
 10447  		v0.AddArg(x)
 10448  		v1 := b.NewValue0(v.Pos, OpLOONG64OR, t)
 10449  		v2 := b.NewValue0(v.Pos, OpLOONG64NEGV, t)
 10450  		v3 := b.NewValue0(v.Pos, OpLOONG64SGTU, typ.Bool)
 10451  		v4 := b.NewValue0(v.Pos, OpZeroExt32to64, typ.UInt64)
 10452  		v4.AddArg(y)
 10453  		v5 := b.NewValue0(v.Pos, OpLOONG64MOVVconst, typ.UInt64)
 10454  		v5.AuxInt = int64ToAuxInt(63)
 10455  		v3.AddArg2(v4, v5)
 10456  		v2.AddArg(v3)
 10457  		v1.AddArg2(v2, v4)
 10458  		v.AddArg2(v0, v1)
 10459  		return true
 10460  	}
 10461  	return false
 10462  }
 10463  func rewriteValueLOONG64_OpRsh16x64(v *Value) bool {
 10464  	v_1 := v.Args[1]
 10465  	v_0 := v.Args[0]
 10466  	b := v.Block
 10467  	typ := &b.Func.Config.Types
 10468  	// match: (Rsh16x64 x y)
 10469  	// cond: shiftIsBounded(v)
 10470  	// result: (SRAV (SignExt16to64 x) y)
 10471  	for {
 10472  		x := v_0
 10473  		y := v_1
 10474  		if !(shiftIsBounded(v)) {
 10475  			break
 10476  		}
 10477  		v.reset(OpLOONG64SRAV)
 10478  		v0 := b.NewValue0(v.Pos, OpSignExt16to64, typ.Int64)
 10479  		v0.AddArg(x)
 10480  		v.AddArg2(v0, y)
 10481  		return true
 10482  	}
 10483  	// match: (Rsh16x64 <t> x y)
 10484  	// cond: !shiftIsBounded(v)
 10485  	// result: (SRAV (SignExt16to64 x) (OR <t> (NEGV <t> (SGTU y (MOVVconst <typ.UInt64> [63]))) y))
 10486  	for {
 10487  		t := v.Type
 10488  		x := v_0
 10489  		y := v_1
 10490  		if !(!shiftIsBounded(v)) {
 10491  			break
 10492  		}
 10493  		v.reset(OpLOONG64SRAV)
 10494  		v0 := b.NewValue0(v.Pos, OpSignExt16to64, typ.Int64)
 10495  		v0.AddArg(x)
 10496  		v1 := b.NewValue0(v.Pos, OpLOONG64OR, t)
 10497  		v2 := b.NewValue0(v.Pos, OpLOONG64NEGV, t)
 10498  		v3 := b.NewValue0(v.Pos, OpLOONG64SGTU, typ.Bool)
 10499  		v4 := b.NewValue0(v.Pos, OpLOONG64MOVVconst, typ.UInt64)
 10500  		v4.AuxInt = int64ToAuxInt(63)
 10501  		v3.AddArg2(y, v4)
 10502  		v2.AddArg(v3)
 10503  		v1.AddArg2(v2, y)
 10504  		v.AddArg2(v0, v1)
 10505  		return true
 10506  	}
 10507  	return false
 10508  }
 10509  func rewriteValueLOONG64_OpRsh16x8(v *Value) bool {
 10510  	v_1 := v.Args[1]
 10511  	v_0 := v.Args[0]
 10512  	b := v.Block
 10513  	typ := &b.Func.Config.Types
 10514  	// match: (Rsh16x8 x y)
 10515  	// cond: shiftIsBounded(v)
 10516  	// result: (SRAV (SignExt16to64 x) y)
 10517  	for {
 10518  		x := v_0
 10519  		y := v_1
 10520  		if !(shiftIsBounded(v)) {
 10521  			break
 10522  		}
 10523  		v.reset(OpLOONG64SRAV)
 10524  		v0 := b.NewValue0(v.Pos, OpSignExt16to64, typ.Int64)
 10525  		v0.AddArg(x)
 10526  		v.AddArg2(v0, y)
 10527  		return true
 10528  	}
 10529  	// match: (Rsh16x8 <t> x y)
 10530  	// cond: !shiftIsBounded(v)
 10531  	// result: (SRAV (SignExt16to64 x) (OR <t> (NEGV <t> (SGTU (ZeroExt8to64 y) (MOVVconst <typ.UInt64> [63]))) (ZeroExt8to64 y)))
 10532  	for {
 10533  		t := v.Type
 10534  		x := v_0
 10535  		y := v_1
 10536  		if !(!shiftIsBounded(v)) {
 10537  			break
 10538  		}
 10539  		v.reset(OpLOONG64SRAV)
 10540  		v0 := b.NewValue0(v.Pos, OpSignExt16to64, typ.Int64)
 10541  		v0.AddArg(x)
 10542  		v1 := b.NewValue0(v.Pos, OpLOONG64OR, t)
 10543  		v2 := b.NewValue0(v.Pos, OpLOONG64NEGV, t)
 10544  		v3 := b.NewValue0(v.Pos, OpLOONG64SGTU, typ.Bool)
 10545  		v4 := b.NewValue0(v.Pos, OpZeroExt8to64, typ.UInt64)
 10546  		v4.AddArg(y)
 10547  		v5 := b.NewValue0(v.Pos, OpLOONG64MOVVconst, typ.UInt64)
 10548  		v5.AuxInt = int64ToAuxInt(63)
 10549  		v3.AddArg2(v4, v5)
 10550  		v2.AddArg(v3)
 10551  		v1.AddArg2(v2, v4)
 10552  		v.AddArg2(v0, v1)
 10553  		return true
 10554  	}
 10555  	return false
 10556  }
 10557  func rewriteValueLOONG64_OpRsh32Ux16(v *Value) bool {
 10558  	v_1 := v.Args[1]
 10559  	v_0 := v.Args[0]
 10560  	b := v.Block
 10561  	typ := &b.Func.Config.Types
 10562  	// match: (Rsh32Ux16 x y)
 10563  	// cond: shiftIsBounded(v)
 10564  	// result: (SRL x y)
 10565  	for {
 10566  		x := v_0
 10567  		y := v_1
 10568  		if !(shiftIsBounded(v)) {
 10569  			break
 10570  		}
 10571  		v.reset(OpLOONG64SRL)
 10572  		v.AddArg2(x, y)
 10573  		return true
 10574  	}
 10575  	// match: (Rsh32Ux16 <t> x y)
 10576  	// cond: !shiftIsBounded(v)
 10577  	// result: (MASKEQZ (SRL <t> x (ZeroExt16to64 y)) (SGTU (MOVVconst <typ.UInt64> [32]) (ZeroExt16to64 y)))
 10578  	for {
 10579  		t := v.Type
 10580  		x := v_0
 10581  		y := v_1
 10582  		if !(!shiftIsBounded(v)) {
 10583  			break
 10584  		}
 10585  		v.reset(OpLOONG64MASKEQZ)
 10586  		v0 := b.NewValue0(v.Pos, OpLOONG64SRL, t)
 10587  		v1 := b.NewValue0(v.Pos, OpZeroExt16to64, typ.UInt64)
 10588  		v1.AddArg(y)
 10589  		v0.AddArg2(x, v1)
 10590  		v2 := b.NewValue0(v.Pos, OpLOONG64SGTU, typ.Bool)
 10591  		v3 := b.NewValue0(v.Pos, OpLOONG64MOVVconst, typ.UInt64)
 10592  		v3.AuxInt = int64ToAuxInt(32)
 10593  		v2.AddArg2(v3, v1)
 10594  		v.AddArg2(v0, v2)
 10595  		return true
 10596  	}
 10597  	return false
 10598  }
 10599  func rewriteValueLOONG64_OpRsh32Ux32(v *Value) bool {
 10600  	v_1 := v.Args[1]
 10601  	v_0 := v.Args[0]
 10602  	b := v.Block
 10603  	typ := &b.Func.Config.Types
 10604  	// match: (Rsh32Ux32 x y)
 10605  	// cond: shiftIsBounded(v)
 10606  	// result: (SRL x y)
 10607  	for {
 10608  		x := v_0
 10609  		y := v_1
 10610  		if !(shiftIsBounded(v)) {
 10611  			break
 10612  		}
 10613  		v.reset(OpLOONG64SRL)
 10614  		v.AddArg2(x, y)
 10615  		return true
 10616  	}
 10617  	// match: (Rsh32Ux32 <t> x y)
 10618  	// cond: !shiftIsBounded(v)
 10619  	// result: (MASKEQZ (SRL <t> x (ZeroExt32to64 y)) (SGTU (MOVVconst <typ.UInt64> [32]) (ZeroExt32to64 y)))
 10620  	for {
 10621  		t := v.Type
 10622  		x := v_0
 10623  		y := v_1
 10624  		if !(!shiftIsBounded(v)) {
 10625  			break
 10626  		}
 10627  		v.reset(OpLOONG64MASKEQZ)
 10628  		v0 := b.NewValue0(v.Pos, OpLOONG64SRL, t)
 10629  		v1 := b.NewValue0(v.Pos, OpZeroExt32to64, typ.UInt64)
 10630  		v1.AddArg(y)
 10631  		v0.AddArg2(x, v1)
 10632  		v2 := b.NewValue0(v.Pos, OpLOONG64SGTU, typ.Bool)
 10633  		v3 := b.NewValue0(v.Pos, OpLOONG64MOVVconst, typ.UInt64)
 10634  		v3.AuxInt = int64ToAuxInt(32)
 10635  		v2.AddArg2(v3, v1)
 10636  		v.AddArg2(v0, v2)
 10637  		return true
 10638  	}
 10639  	return false
 10640  }
 10641  func rewriteValueLOONG64_OpRsh32Ux64(v *Value) bool {
 10642  	v_1 := v.Args[1]
 10643  	v_0 := v.Args[0]
 10644  	b := v.Block
 10645  	typ := &b.Func.Config.Types
 10646  	// match: (Rsh32Ux64 x y)
 10647  	// cond: shiftIsBounded(v)
 10648  	// result: (SRL x y)
 10649  	for {
 10650  		x := v_0
 10651  		y := v_1
 10652  		if !(shiftIsBounded(v)) {
 10653  			break
 10654  		}
 10655  		v.reset(OpLOONG64SRL)
 10656  		v.AddArg2(x, y)
 10657  		return true
 10658  	}
 10659  	// match: (Rsh32Ux64 <t> x y)
 10660  	// cond: !shiftIsBounded(v)
 10661  	// result: (MASKEQZ (SRL <t> x y) (SGTU (MOVVconst <typ.UInt64> [32]) y))
 10662  	for {
 10663  		t := v.Type
 10664  		x := v_0
 10665  		y := v_1
 10666  		if !(!shiftIsBounded(v)) {
 10667  			break
 10668  		}
 10669  		v.reset(OpLOONG64MASKEQZ)
 10670  		v0 := b.NewValue0(v.Pos, OpLOONG64SRL, t)
 10671  		v0.AddArg2(x, y)
 10672  		v1 := b.NewValue0(v.Pos, OpLOONG64SGTU, typ.Bool)
 10673  		v2 := b.NewValue0(v.Pos, OpLOONG64MOVVconst, typ.UInt64)
 10674  		v2.AuxInt = int64ToAuxInt(32)
 10675  		v1.AddArg2(v2, y)
 10676  		v.AddArg2(v0, v1)
 10677  		return true
 10678  	}
 10679  	return false
 10680  }
 10681  func rewriteValueLOONG64_OpRsh32Ux8(v *Value) bool {
 10682  	v_1 := v.Args[1]
 10683  	v_0 := v.Args[0]
 10684  	b := v.Block
 10685  	typ := &b.Func.Config.Types
 10686  	// match: (Rsh32Ux8 x y)
 10687  	// cond: shiftIsBounded(v)
 10688  	// result: (SRL x y)
 10689  	for {
 10690  		x := v_0
 10691  		y := v_1
 10692  		if !(shiftIsBounded(v)) {
 10693  			break
 10694  		}
 10695  		v.reset(OpLOONG64SRL)
 10696  		v.AddArg2(x, y)
 10697  		return true
 10698  	}
 10699  	// match: (Rsh32Ux8 <t> x y)
 10700  	// cond: !shiftIsBounded(v)
 10701  	// result: (MASKEQZ (SRL <t> x (ZeroExt8to64 y)) (SGTU (MOVVconst <typ.UInt64> [32]) (ZeroExt8to64 y)))
 10702  	for {
 10703  		t := v.Type
 10704  		x := v_0
 10705  		y := v_1
 10706  		if !(!shiftIsBounded(v)) {
 10707  			break
 10708  		}
 10709  		v.reset(OpLOONG64MASKEQZ)
 10710  		v0 := b.NewValue0(v.Pos, OpLOONG64SRL, t)
 10711  		v1 := b.NewValue0(v.Pos, OpZeroExt8to64, typ.UInt64)
 10712  		v1.AddArg(y)
 10713  		v0.AddArg2(x, v1)
 10714  		v2 := b.NewValue0(v.Pos, OpLOONG64SGTU, typ.Bool)
 10715  		v3 := b.NewValue0(v.Pos, OpLOONG64MOVVconst, typ.UInt64)
 10716  		v3.AuxInt = int64ToAuxInt(32)
 10717  		v2.AddArg2(v3, v1)
 10718  		v.AddArg2(v0, v2)
 10719  		return true
 10720  	}
 10721  	return false
 10722  }
 10723  func rewriteValueLOONG64_OpRsh32x16(v *Value) bool {
 10724  	v_1 := v.Args[1]
 10725  	v_0 := v.Args[0]
 10726  	b := v.Block
 10727  	typ := &b.Func.Config.Types
 10728  	// match: (Rsh32x16 x y)
 10729  	// cond: shiftIsBounded(v)
 10730  	// result: (SRA x y)
 10731  	for {
 10732  		x := v_0
 10733  		y := v_1
 10734  		if !(shiftIsBounded(v)) {
 10735  			break
 10736  		}
 10737  		v.reset(OpLOONG64SRA)
 10738  		v.AddArg2(x, y)
 10739  		return true
 10740  	}
 10741  	// match: (Rsh32x16 <t> x y)
 10742  	// cond: !shiftIsBounded(v)
 10743  	// result: (SRA x (OR <t> (NEGV <t> (SGTU (ZeroExt16to64 y) (MOVVconst <typ.UInt64> [31]))) (ZeroExt16to64 y)))
 10744  	for {
 10745  		t := v.Type
 10746  		x := v_0
 10747  		y := v_1
 10748  		if !(!shiftIsBounded(v)) {
 10749  			break
 10750  		}
 10751  		v.reset(OpLOONG64SRA)
 10752  		v0 := b.NewValue0(v.Pos, OpLOONG64OR, t)
 10753  		v1 := b.NewValue0(v.Pos, OpLOONG64NEGV, t)
 10754  		v2 := b.NewValue0(v.Pos, OpLOONG64SGTU, typ.Bool)
 10755  		v3 := b.NewValue0(v.Pos, OpZeroExt16to64, typ.UInt64)
 10756  		v3.AddArg(y)
 10757  		v4 := b.NewValue0(v.Pos, OpLOONG64MOVVconst, typ.UInt64)
 10758  		v4.AuxInt = int64ToAuxInt(31)
 10759  		v2.AddArg2(v3, v4)
 10760  		v1.AddArg(v2)
 10761  		v0.AddArg2(v1, v3)
 10762  		v.AddArg2(x, v0)
 10763  		return true
 10764  	}
 10765  	return false
 10766  }
 10767  func rewriteValueLOONG64_OpRsh32x32(v *Value) bool {
 10768  	v_1 := v.Args[1]
 10769  	v_0 := v.Args[0]
 10770  	b := v.Block
 10771  	typ := &b.Func.Config.Types
 10772  	// match: (Rsh32x32 x y)
 10773  	// cond: shiftIsBounded(v)
 10774  	// result: (SRA x y)
 10775  	for {
 10776  		x := v_0
 10777  		y := v_1
 10778  		if !(shiftIsBounded(v)) {
 10779  			break
 10780  		}
 10781  		v.reset(OpLOONG64SRA)
 10782  		v.AddArg2(x, y)
 10783  		return true
 10784  	}
 10785  	// match: (Rsh32x32 <t> x y)
 10786  	// cond: !shiftIsBounded(v)
 10787  	// result: (SRA x (OR <t> (NEGV <t> (SGTU (ZeroExt32to64 y) (MOVVconst <typ.UInt64> [31]))) (ZeroExt32to64 y)))
 10788  	for {
 10789  		t := v.Type
 10790  		x := v_0
 10791  		y := v_1
 10792  		if !(!shiftIsBounded(v)) {
 10793  			break
 10794  		}
 10795  		v.reset(OpLOONG64SRA)
 10796  		v0 := b.NewValue0(v.Pos, OpLOONG64OR, t)
 10797  		v1 := b.NewValue0(v.Pos, OpLOONG64NEGV, t)
 10798  		v2 := b.NewValue0(v.Pos, OpLOONG64SGTU, typ.Bool)
 10799  		v3 := b.NewValue0(v.Pos, OpZeroExt32to64, typ.UInt64)
 10800  		v3.AddArg(y)
 10801  		v4 := b.NewValue0(v.Pos, OpLOONG64MOVVconst, typ.UInt64)
 10802  		v4.AuxInt = int64ToAuxInt(31)
 10803  		v2.AddArg2(v3, v4)
 10804  		v1.AddArg(v2)
 10805  		v0.AddArg2(v1, v3)
 10806  		v.AddArg2(x, v0)
 10807  		return true
 10808  	}
 10809  	return false
 10810  }
 10811  func rewriteValueLOONG64_OpRsh32x64(v *Value) bool {
 10812  	v_1 := v.Args[1]
 10813  	v_0 := v.Args[0]
 10814  	b := v.Block
 10815  	typ := &b.Func.Config.Types
 10816  	// match: (Rsh32x64 x y)
 10817  	// cond: shiftIsBounded(v)
 10818  	// result: (SRA x y)
 10819  	for {
 10820  		x := v_0
 10821  		y := v_1
 10822  		if !(shiftIsBounded(v)) {
 10823  			break
 10824  		}
 10825  		v.reset(OpLOONG64SRA)
 10826  		v.AddArg2(x, y)
 10827  		return true
 10828  	}
 10829  	// match: (Rsh32x64 <t> x y)
 10830  	// cond: !shiftIsBounded(v)
 10831  	// result: (SRA x (OR <t> (NEGV <t> (SGTU y (MOVVconst <typ.UInt64> [31]))) y))
 10832  	for {
 10833  		t := v.Type
 10834  		x := v_0
 10835  		y := v_1
 10836  		if !(!shiftIsBounded(v)) {
 10837  			break
 10838  		}
 10839  		v.reset(OpLOONG64SRA)
 10840  		v0 := b.NewValue0(v.Pos, OpLOONG64OR, t)
 10841  		v1 := b.NewValue0(v.Pos, OpLOONG64NEGV, t)
 10842  		v2 := b.NewValue0(v.Pos, OpLOONG64SGTU, typ.Bool)
 10843  		v3 := b.NewValue0(v.Pos, OpLOONG64MOVVconst, typ.UInt64)
 10844  		v3.AuxInt = int64ToAuxInt(31)
 10845  		v2.AddArg2(y, v3)
 10846  		v1.AddArg(v2)
 10847  		v0.AddArg2(v1, y)
 10848  		v.AddArg2(x, v0)
 10849  		return true
 10850  	}
 10851  	return false
 10852  }
 10853  func rewriteValueLOONG64_OpRsh32x8(v *Value) bool {
 10854  	v_1 := v.Args[1]
 10855  	v_0 := v.Args[0]
 10856  	b := v.Block
 10857  	typ := &b.Func.Config.Types
 10858  	// match: (Rsh32x8 x y)
 10859  	// cond: shiftIsBounded(v)
 10860  	// result: (SRA x y)
 10861  	for {
 10862  		x := v_0
 10863  		y := v_1
 10864  		if !(shiftIsBounded(v)) {
 10865  			break
 10866  		}
 10867  		v.reset(OpLOONG64SRA)
 10868  		v.AddArg2(x, y)
 10869  		return true
 10870  	}
 10871  	// match: (Rsh32x8 <t> x y)
 10872  	// cond: !shiftIsBounded(v)
 10873  	// result: (SRA x (OR <t> (NEGV <t> (SGTU (ZeroExt8to64 y) (MOVVconst <typ.UInt64> [31]))) (ZeroExt8to64 y)))
 10874  	for {
 10875  		t := v.Type
 10876  		x := v_0
 10877  		y := v_1
 10878  		if !(!shiftIsBounded(v)) {
 10879  			break
 10880  		}
 10881  		v.reset(OpLOONG64SRA)
 10882  		v0 := b.NewValue0(v.Pos, OpLOONG64OR, t)
 10883  		v1 := b.NewValue0(v.Pos, OpLOONG64NEGV, t)
 10884  		v2 := b.NewValue0(v.Pos, OpLOONG64SGTU, typ.Bool)
 10885  		v3 := b.NewValue0(v.Pos, OpZeroExt8to64, typ.UInt64)
 10886  		v3.AddArg(y)
 10887  		v4 := b.NewValue0(v.Pos, OpLOONG64MOVVconst, typ.UInt64)
 10888  		v4.AuxInt = int64ToAuxInt(31)
 10889  		v2.AddArg2(v3, v4)
 10890  		v1.AddArg(v2)
 10891  		v0.AddArg2(v1, v3)
 10892  		v.AddArg2(x, v0)
 10893  		return true
 10894  	}
 10895  	return false
 10896  }
 10897  func rewriteValueLOONG64_OpRsh64Ux16(v *Value) bool {
 10898  	v_1 := v.Args[1]
 10899  	v_0 := v.Args[0]
 10900  	b := v.Block
 10901  	typ := &b.Func.Config.Types
 10902  	// match: (Rsh64Ux16 x y)
 10903  	// cond: shiftIsBounded(v)
 10904  	// result: (SRLV x y)
 10905  	for {
 10906  		x := v_0
 10907  		y := v_1
 10908  		if !(shiftIsBounded(v)) {
 10909  			break
 10910  		}
 10911  		v.reset(OpLOONG64SRLV)
 10912  		v.AddArg2(x, y)
 10913  		return true
 10914  	}
 10915  	// match: (Rsh64Ux16 <t> x y)
 10916  	// cond: !shiftIsBounded(v)
 10917  	// result: (MASKEQZ (SRLV <t> x (ZeroExt16to64 y)) (SGTU (MOVVconst <typ.UInt64> [64]) (ZeroExt16to64 y)))
 10918  	for {
 10919  		t := v.Type
 10920  		x := v_0
 10921  		y := v_1
 10922  		if !(!shiftIsBounded(v)) {
 10923  			break
 10924  		}
 10925  		v.reset(OpLOONG64MASKEQZ)
 10926  		v0 := b.NewValue0(v.Pos, OpLOONG64SRLV, t)
 10927  		v1 := b.NewValue0(v.Pos, OpZeroExt16to64, typ.UInt64)
 10928  		v1.AddArg(y)
 10929  		v0.AddArg2(x, v1)
 10930  		v2 := b.NewValue0(v.Pos, OpLOONG64SGTU, typ.Bool)
 10931  		v3 := b.NewValue0(v.Pos, OpLOONG64MOVVconst, typ.UInt64)
 10932  		v3.AuxInt = int64ToAuxInt(64)
 10933  		v2.AddArg2(v3, v1)
 10934  		v.AddArg2(v0, v2)
 10935  		return true
 10936  	}
 10937  	return false
 10938  }
 10939  func rewriteValueLOONG64_OpRsh64Ux32(v *Value) bool {
 10940  	v_1 := v.Args[1]
 10941  	v_0 := v.Args[0]
 10942  	b := v.Block
 10943  	typ := &b.Func.Config.Types
 10944  	// match: (Rsh64Ux32 x y)
 10945  	// cond: shiftIsBounded(v)
 10946  	// result: (SRLV x y)
 10947  	for {
 10948  		x := v_0
 10949  		y := v_1
 10950  		if !(shiftIsBounded(v)) {
 10951  			break
 10952  		}
 10953  		v.reset(OpLOONG64SRLV)
 10954  		v.AddArg2(x, y)
 10955  		return true
 10956  	}
 10957  	// match: (Rsh64Ux32 <t> x y)
 10958  	// cond: !shiftIsBounded(v)
 10959  	// result: (MASKEQZ (SRLV <t> x (ZeroExt32to64 y)) (SGTU (MOVVconst <typ.UInt64> [64]) (ZeroExt32to64 y)))
 10960  	for {
 10961  		t := v.Type
 10962  		x := v_0
 10963  		y := v_1
 10964  		if !(!shiftIsBounded(v)) {
 10965  			break
 10966  		}
 10967  		v.reset(OpLOONG64MASKEQZ)
 10968  		v0 := b.NewValue0(v.Pos, OpLOONG64SRLV, t)
 10969  		v1 := b.NewValue0(v.Pos, OpZeroExt32to64, typ.UInt64)
 10970  		v1.AddArg(y)
 10971  		v0.AddArg2(x, v1)
 10972  		v2 := b.NewValue0(v.Pos, OpLOONG64SGTU, typ.Bool)
 10973  		v3 := b.NewValue0(v.Pos, OpLOONG64MOVVconst, typ.UInt64)
 10974  		v3.AuxInt = int64ToAuxInt(64)
 10975  		v2.AddArg2(v3, v1)
 10976  		v.AddArg2(v0, v2)
 10977  		return true
 10978  	}
 10979  	return false
 10980  }
 10981  func rewriteValueLOONG64_OpRsh64Ux64(v *Value) bool {
 10982  	v_1 := v.Args[1]
 10983  	v_0 := v.Args[0]
 10984  	b := v.Block
 10985  	typ := &b.Func.Config.Types
 10986  	// match: (Rsh64Ux64 x y)
 10987  	// cond: shiftIsBounded(v)
 10988  	// result: (SRLV x y)
 10989  	for {
 10990  		x := v_0
 10991  		y := v_1
 10992  		if !(shiftIsBounded(v)) {
 10993  			break
 10994  		}
 10995  		v.reset(OpLOONG64SRLV)
 10996  		v.AddArg2(x, y)
 10997  		return true
 10998  	}
 10999  	// match: (Rsh64Ux64 <t> x y)
 11000  	// cond: !shiftIsBounded(v)
 11001  	// result: (MASKEQZ (SRLV <t> x y) (SGTU (MOVVconst <typ.UInt64> [64]) y))
 11002  	for {
 11003  		t := v.Type
 11004  		x := v_0
 11005  		y := v_1
 11006  		if !(!shiftIsBounded(v)) {
 11007  			break
 11008  		}
 11009  		v.reset(OpLOONG64MASKEQZ)
 11010  		v0 := b.NewValue0(v.Pos, OpLOONG64SRLV, t)
 11011  		v0.AddArg2(x, y)
 11012  		v1 := b.NewValue0(v.Pos, OpLOONG64SGTU, typ.Bool)
 11013  		v2 := b.NewValue0(v.Pos, OpLOONG64MOVVconst, typ.UInt64)
 11014  		v2.AuxInt = int64ToAuxInt(64)
 11015  		v1.AddArg2(v2, y)
 11016  		v.AddArg2(v0, v1)
 11017  		return true
 11018  	}
 11019  	return false
 11020  }
 11021  func rewriteValueLOONG64_OpRsh64Ux8(v *Value) bool {
 11022  	v_1 := v.Args[1]
 11023  	v_0 := v.Args[0]
 11024  	b := v.Block
 11025  	typ := &b.Func.Config.Types
 11026  	// match: (Rsh64Ux8 x y)
 11027  	// cond: shiftIsBounded(v)
 11028  	// result: (SRLV x y)
 11029  	for {
 11030  		x := v_0
 11031  		y := v_1
 11032  		if !(shiftIsBounded(v)) {
 11033  			break
 11034  		}
 11035  		v.reset(OpLOONG64SRLV)
 11036  		v.AddArg2(x, y)
 11037  		return true
 11038  	}
 11039  	// match: (Rsh64Ux8 <t> x y)
 11040  	// cond: !shiftIsBounded(v)
 11041  	// result: (MASKEQZ (SRLV <t> x (ZeroExt8to64 y)) (SGTU (MOVVconst <typ.UInt64> [64]) (ZeroExt8to64 y)))
 11042  	for {
 11043  		t := v.Type
 11044  		x := v_0
 11045  		y := v_1
 11046  		if !(!shiftIsBounded(v)) {
 11047  			break
 11048  		}
 11049  		v.reset(OpLOONG64MASKEQZ)
 11050  		v0 := b.NewValue0(v.Pos, OpLOONG64SRLV, t)
 11051  		v1 := b.NewValue0(v.Pos, OpZeroExt8to64, typ.UInt64)
 11052  		v1.AddArg(y)
 11053  		v0.AddArg2(x, v1)
 11054  		v2 := b.NewValue0(v.Pos, OpLOONG64SGTU, typ.Bool)
 11055  		v3 := b.NewValue0(v.Pos, OpLOONG64MOVVconst, typ.UInt64)
 11056  		v3.AuxInt = int64ToAuxInt(64)
 11057  		v2.AddArg2(v3, v1)
 11058  		v.AddArg2(v0, v2)
 11059  		return true
 11060  	}
 11061  	return false
 11062  }
 11063  func rewriteValueLOONG64_OpRsh64x16(v *Value) bool {
 11064  	v_1 := v.Args[1]
 11065  	v_0 := v.Args[0]
 11066  	b := v.Block
 11067  	typ := &b.Func.Config.Types
 11068  	// match: (Rsh64x16 x y)
 11069  	// cond: shiftIsBounded(v)
 11070  	// result: (SRAV x y)
 11071  	for {
 11072  		x := v_0
 11073  		y := v_1
 11074  		if !(shiftIsBounded(v)) {
 11075  			break
 11076  		}
 11077  		v.reset(OpLOONG64SRAV)
 11078  		v.AddArg2(x, y)
 11079  		return true
 11080  	}
 11081  	// match: (Rsh64x16 <t> x y)
 11082  	// cond: !shiftIsBounded(v)
 11083  	// result: (SRAV x (OR <t> (NEGV <t> (SGTU (ZeroExt16to64 y) (MOVVconst <typ.UInt64> [63]))) (ZeroExt16to64 y)))
 11084  	for {
 11085  		t := v.Type
 11086  		x := v_0
 11087  		y := v_1
 11088  		if !(!shiftIsBounded(v)) {
 11089  			break
 11090  		}
 11091  		v.reset(OpLOONG64SRAV)
 11092  		v0 := b.NewValue0(v.Pos, OpLOONG64OR, t)
 11093  		v1 := b.NewValue0(v.Pos, OpLOONG64NEGV, t)
 11094  		v2 := b.NewValue0(v.Pos, OpLOONG64SGTU, typ.Bool)
 11095  		v3 := b.NewValue0(v.Pos, OpZeroExt16to64, typ.UInt64)
 11096  		v3.AddArg(y)
 11097  		v4 := b.NewValue0(v.Pos, OpLOONG64MOVVconst, typ.UInt64)
 11098  		v4.AuxInt = int64ToAuxInt(63)
 11099  		v2.AddArg2(v3, v4)
 11100  		v1.AddArg(v2)
 11101  		v0.AddArg2(v1, v3)
 11102  		v.AddArg2(x, v0)
 11103  		return true
 11104  	}
 11105  	return false
 11106  }
 11107  func rewriteValueLOONG64_OpRsh64x32(v *Value) bool {
 11108  	v_1 := v.Args[1]
 11109  	v_0 := v.Args[0]
 11110  	b := v.Block
 11111  	typ := &b.Func.Config.Types
 11112  	// match: (Rsh64x32 x y)
 11113  	// cond: shiftIsBounded(v)
 11114  	// result: (SRAV x y)
 11115  	for {
 11116  		x := v_0
 11117  		y := v_1
 11118  		if !(shiftIsBounded(v)) {
 11119  			break
 11120  		}
 11121  		v.reset(OpLOONG64SRAV)
 11122  		v.AddArg2(x, y)
 11123  		return true
 11124  	}
 11125  	// match: (Rsh64x32 <t> x y)
 11126  	// cond: !shiftIsBounded(v)
 11127  	// result: (SRAV x (OR <t> (NEGV <t> (SGTU (ZeroExt32to64 y) (MOVVconst <typ.UInt64> [63]))) (ZeroExt32to64 y)))
 11128  	for {
 11129  		t := v.Type
 11130  		x := v_0
 11131  		y := v_1
 11132  		if !(!shiftIsBounded(v)) {
 11133  			break
 11134  		}
 11135  		v.reset(OpLOONG64SRAV)
 11136  		v0 := b.NewValue0(v.Pos, OpLOONG64OR, t)
 11137  		v1 := b.NewValue0(v.Pos, OpLOONG64NEGV, t)
 11138  		v2 := b.NewValue0(v.Pos, OpLOONG64SGTU, typ.Bool)
 11139  		v3 := b.NewValue0(v.Pos, OpZeroExt32to64, typ.UInt64)
 11140  		v3.AddArg(y)
 11141  		v4 := b.NewValue0(v.Pos, OpLOONG64MOVVconst, typ.UInt64)
 11142  		v4.AuxInt = int64ToAuxInt(63)
 11143  		v2.AddArg2(v3, v4)
 11144  		v1.AddArg(v2)
 11145  		v0.AddArg2(v1, v3)
 11146  		v.AddArg2(x, v0)
 11147  		return true
 11148  	}
 11149  	return false
 11150  }
 11151  func rewriteValueLOONG64_OpRsh64x64(v *Value) bool {
 11152  	v_1 := v.Args[1]
 11153  	v_0 := v.Args[0]
 11154  	b := v.Block
 11155  	typ := &b.Func.Config.Types
 11156  	// match: (Rsh64x64 x y)
 11157  	// cond: shiftIsBounded(v)
 11158  	// result: (SRAV x y)
 11159  	for {
 11160  		x := v_0
 11161  		y := v_1
 11162  		if !(shiftIsBounded(v)) {
 11163  			break
 11164  		}
 11165  		v.reset(OpLOONG64SRAV)
 11166  		v.AddArg2(x, y)
 11167  		return true
 11168  	}
 11169  	// match: (Rsh64x64 <t> x y)
 11170  	// cond: !shiftIsBounded(v)
 11171  	// result: (SRAV x (OR <t> (NEGV <t> (SGTU y (MOVVconst <typ.UInt64> [63]))) y))
 11172  	for {
 11173  		t := v.Type
 11174  		x := v_0
 11175  		y := v_1
 11176  		if !(!shiftIsBounded(v)) {
 11177  			break
 11178  		}
 11179  		v.reset(OpLOONG64SRAV)
 11180  		v0 := b.NewValue0(v.Pos, OpLOONG64OR, t)
 11181  		v1 := b.NewValue0(v.Pos, OpLOONG64NEGV, t)
 11182  		v2 := b.NewValue0(v.Pos, OpLOONG64SGTU, typ.Bool)
 11183  		v3 := b.NewValue0(v.Pos, OpLOONG64MOVVconst, typ.UInt64)
 11184  		v3.AuxInt = int64ToAuxInt(63)
 11185  		v2.AddArg2(y, v3)
 11186  		v1.AddArg(v2)
 11187  		v0.AddArg2(v1, y)
 11188  		v.AddArg2(x, v0)
 11189  		return true
 11190  	}
 11191  	return false
 11192  }
 11193  func rewriteValueLOONG64_OpRsh64x8(v *Value) bool {
 11194  	v_1 := v.Args[1]
 11195  	v_0 := v.Args[0]
 11196  	b := v.Block
 11197  	typ := &b.Func.Config.Types
 11198  	// match: (Rsh64x8 x y)
 11199  	// cond: shiftIsBounded(v)
 11200  	// result: (SRAV x y)
 11201  	for {
 11202  		x := v_0
 11203  		y := v_1
 11204  		if !(shiftIsBounded(v)) {
 11205  			break
 11206  		}
 11207  		v.reset(OpLOONG64SRAV)
 11208  		v.AddArg2(x, y)
 11209  		return true
 11210  	}
 11211  	// match: (Rsh64x8 <t> x y)
 11212  	// cond: !shiftIsBounded(v)
 11213  	// result: (SRAV x (OR <t> (NEGV <t> (SGTU (ZeroExt8to64 y) (MOVVconst <typ.UInt64> [63]))) (ZeroExt8to64 y)))
 11214  	for {
 11215  		t := v.Type
 11216  		x := v_0
 11217  		y := v_1
 11218  		if !(!shiftIsBounded(v)) {
 11219  			break
 11220  		}
 11221  		v.reset(OpLOONG64SRAV)
 11222  		v0 := b.NewValue0(v.Pos, OpLOONG64OR, t)
 11223  		v1 := b.NewValue0(v.Pos, OpLOONG64NEGV, t)
 11224  		v2 := b.NewValue0(v.Pos, OpLOONG64SGTU, typ.Bool)
 11225  		v3 := b.NewValue0(v.Pos, OpZeroExt8to64, typ.UInt64)
 11226  		v3.AddArg(y)
 11227  		v4 := b.NewValue0(v.Pos, OpLOONG64MOVVconst, typ.UInt64)
 11228  		v4.AuxInt = int64ToAuxInt(63)
 11229  		v2.AddArg2(v3, v4)
 11230  		v1.AddArg(v2)
 11231  		v0.AddArg2(v1, v3)
 11232  		v.AddArg2(x, v0)
 11233  		return true
 11234  	}
 11235  	return false
 11236  }
 11237  func rewriteValueLOONG64_OpRsh8Ux16(v *Value) bool {
 11238  	v_1 := v.Args[1]
 11239  	v_0 := v.Args[0]
 11240  	b := v.Block
 11241  	typ := &b.Func.Config.Types
 11242  	// match: (Rsh8Ux16 x y)
 11243  	// cond: shiftIsBounded(v)
 11244  	// result: (SRLV (ZeroExt8to64 x) y)
 11245  	for {
 11246  		x := v_0
 11247  		y := v_1
 11248  		if !(shiftIsBounded(v)) {
 11249  			break
 11250  		}
 11251  		v.reset(OpLOONG64SRLV)
 11252  		v0 := b.NewValue0(v.Pos, OpZeroExt8to64, typ.UInt64)
 11253  		v0.AddArg(x)
 11254  		v.AddArg2(v0, y)
 11255  		return true
 11256  	}
 11257  	// match: (Rsh8Ux16 <t> x y)
 11258  	// cond: !shiftIsBounded(v)
 11259  	// result: (MASKEQZ (SRLV <t> (ZeroExt8to64 x) (ZeroExt16to64 y)) (SGTU (MOVVconst <typ.UInt64> [64]) (ZeroExt16to64 y)))
 11260  	for {
 11261  		t := v.Type
 11262  		x := v_0
 11263  		y := v_1
 11264  		if !(!shiftIsBounded(v)) {
 11265  			break
 11266  		}
 11267  		v.reset(OpLOONG64MASKEQZ)
 11268  		v0 := b.NewValue0(v.Pos, OpLOONG64SRLV, t)
 11269  		v1 := b.NewValue0(v.Pos, OpZeroExt8to64, typ.UInt64)
 11270  		v1.AddArg(x)
 11271  		v2 := b.NewValue0(v.Pos, OpZeroExt16to64, typ.UInt64)
 11272  		v2.AddArg(y)
 11273  		v0.AddArg2(v1, v2)
 11274  		v3 := b.NewValue0(v.Pos, OpLOONG64SGTU, typ.Bool)
 11275  		v4 := b.NewValue0(v.Pos, OpLOONG64MOVVconst, typ.UInt64)
 11276  		v4.AuxInt = int64ToAuxInt(64)
 11277  		v3.AddArg2(v4, v2)
 11278  		v.AddArg2(v0, v3)
 11279  		return true
 11280  	}
 11281  	return false
 11282  }
 11283  func rewriteValueLOONG64_OpRsh8Ux32(v *Value) bool {
 11284  	v_1 := v.Args[1]
 11285  	v_0 := v.Args[0]
 11286  	b := v.Block
 11287  	typ := &b.Func.Config.Types
 11288  	// match: (Rsh8Ux32 x y)
 11289  	// cond: shiftIsBounded(v)
 11290  	// result: (SRLV (ZeroExt8to64 x) y)
 11291  	for {
 11292  		x := v_0
 11293  		y := v_1
 11294  		if !(shiftIsBounded(v)) {
 11295  			break
 11296  		}
 11297  		v.reset(OpLOONG64SRLV)
 11298  		v0 := b.NewValue0(v.Pos, OpZeroExt8to64, typ.UInt64)
 11299  		v0.AddArg(x)
 11300  		v.AddArg2(v0, y)
 11301  		return true
 11302  	}
 11303  	// match: (Rsh8Ux32 <t> x y)
 11304  	// cond: !shiftIsBounded(v)
 11305  	// result: (MASKEQZ (SRLV <t> (ZeroExt8to64 x) (ZeroExt32to64 y)) (SGTU (MOVVconst <typ.UInt64> [64]) (ZeroExt32to64 y)))
 11306  	for {
 11307  		t := v.Type
 11308  		x := v_0
 11309  		y := v_1
 11310  		if !(!shiftIsBounded(v)) {
 11311  			break
 11312  		}
 11313  		v.reset(OpLOONG64MASKEQZ)
 11314  		v0 := b.NewValue0(v.Pos, OpLOONG64SRLV, t)
 11315  		v1 := b.NewValue0(v.Pos, OpZeroExt8to64, typ.UInt64)
 11316  		v1.AddArg(x)
 11317  		v2 := b.NewValue0(v.Pos, OpZeroExt32to64, typ.UInt64)
 11318  		v2.AddArg(y)
 11319  		v0.AddArg2(v1, v2)
 11320  		v3 := b.NewValue0(v.Pos, OpLOONG64SGTU, typ.Bool)
 11321  		v4 := b.NewValue0(v.Pos, OpLOONG64MOVVconst, typ.UInt64)
 11322  		v4.AuxInt = int64ToAuxInt(64)
 11323  		v3.AddArg2(v4, v2)
 11324  		v.AddArg2(v0, v3)
 11325  		return true
 11326  	}
 11327  	return false
 11328  }
 11329  func rewriteValueLOONG64_OpRsh8Ux64(v *Value) bool {
 11330  	v_1 := v.Args[1]
 11331  	v_0 := v.Args[0]
 11332  	b := v.Block
 11333  	typ := &b.Func.Config.Types
 11334  	// match: (Rsh8Ux64 x y)
 11335  	// cond: shiftIsBounded(v)
 11336  	// result: (SRLV (ZeroExt8to64 x) y)
 11337  	for {
 11338  		x := v_0
 11339  		y := v_1
 11340  		if !(shiftIsBounded(v)) {
 11341  			break
 11342  		}
 11343  		v.reset(OpLOONG64SRLV)
 11344  		v0 := b.NewValue0(v.Pos, OpZeroExt8to64, typ.UInt64)
 11345  		v0.AddArg(x)
 11346  		v.AddArg2(v0, y)
 11347  		return true
 11348  	}
 11349  	// match: (Rsh8Ux64 <t> x y)
 11350  	// cond: !shiftIsBounded(v)
 11351  	// result: (MASKEQZ (SRLV <t> (ZeroExt8to64 x) y) (SGTU (MOVVconst <typ.UInt64> [64]) y))
 11352  	for {
 11353  		t := v.Type
 11354  		x := v_0
 11355  		y := v_1
 11356  		if !(!shiftIsBounded(v)) {
 11357  			break
 11358  		}
 11359  		v.reset(OpLOONG64MASKEQZ)
 11360  		v0 := b.NewValue0(v.Pos, OpLOONG64SRLV, t)
 11361  		v1 := b.NewValue0(v.Pos, OpZeroExt8to64, typ.UInt64)
 11362  		v1.AddArg(x)
 11363  		v0.AddArg2(v1, y)
 11364  		v2 := b.NewValue0(v.Pos, OpLOONG64SGTU, typ.Bool)
 11365  		v3 := b.NewValue0(v.Pos, OpLOONG64MOVVconst, typ.UInt64)
 11366  		v3.AuxInt = int64ToAuxInt(64)
 11367  		v2.AddArg2(v3, y)
 11368  		v.AddArg2(v0, v2)
 11369  		return true
 11370  	}
 11371  	return false
 11372  }
 11373  func rewriteValueLOONG64_OpRsh8Ux8(v *Value) bool {
 11374  	v_1 := v.Args[1]
 11375  	v_0 := v.Args[0]
 11376  	b := v.Block
 11377  	typ := &b.Func.Config.Types
 11378  	// match: (Rsh8Ux8 x y)
 11379  	// cond: shiftIsBounded(v)
 11380  	// result: (SRLV (ZeroExt8to64 x) y)
 11381  	for {
 11382  		x := v_0
 11383  		y := v_1
 11384  		if !(shiftIsBounded(v)) {
 11385  			break
 11386  		}
 11387  		v.reset(OpLOONG64SRLV)
 11388  		v0 := b.NewValue0(v.Pos, OpZeroExt8to64, typ.UInt64)
 11389  		v0.AddArg(x)
 11390  		v.AddArg2(v0, y)
 11391  		return true
 11392  	}
 11393  	// match: (Rsh8Ux8 <t> x y)
 11394  	// cond: !shiftIsBounded(v)
 11395  	// result: (MASKEQZ (SRLV <t> (ZeroExt8to64 x) (ZeroExt8to64 y)) (SGTU (MOVVconst <typ.UInt64> [64]) (ZeroExt8to64 y)))
 11396  	for {
 11397  		t := v.Type
 11398  		x := v_0
 11399  		y := v_1
 11400  		if !(!shiftIsBounded(v)) {
 11401  			break
 11402  		}
 11403  		v.reset(OpLOONG64MASKEQZ)
 11404  		v0 := b.NewValue0(v.Pos, OpLOONG64SRLV, t)
 11405  		v1 := b.NewValue0(v.Pos, OpZeroExt8to64, typ.UInt64)
 11406  		v1.AddArg(x)
 11407  		v2 := b.NewValue0(v.Pos, OpZeroExt8to64, typ.UInt64)
 11408  		v2.AddArg(y)
 11409  		v0.AddArg2(v1, v2)
 11410  		v3 := b.NewValue0(v.Pos, OpLOONG64SGTU, typ.Bool)
 11411  		v4 := b.NewValue0(v.Pos, OpLOONG64MOVVconst, typ.UInt64)
 11412  		v4.AuxInt = int64ToAuxInt(64)
 11413  		v3.AddArg2(v4, v2)
 11414  		v.AddArg2(v0, v3)
 11415  		return true
 11416  	}
 11417  	return false
 11418  }
 11419  func rewriteValueLOONG64_OpRsh8x16(v *Value) bool {
 11420  	v_1 := v.Args[1]
 11421  	v_0 := v.Args[0]
 11422  	b := v.Block
 11423  	typ := &b.Func.Config.Types
 11424  	// match: (Rsh8x16 x y)
 11425  	// cond: shiftIsBounded(v)
 11426  	// result: (SRAV (SignExt8to64 x) y)
 11427  	for {
 11428  		x := v_0
 11429  		y := v_1
 11430  		if !(shiftIsBounded(v)) {
 11431  			break
 11432  		}
 11433  		v.reset(OpLOONG64SRAV)
 11434  		v0 := b.NewValue0(v.Pos, OpSignExt8to64, typ.Int64)
 11435  		v0.AddArg(x)
 11436  		v.AddArg2(v0, y)
 11437  		return true
 11438  	}
 11439  	// match: (Rsh8x16 <t> x y)
 11440  	// cond: !shiftIsBounded(v)
 11441  	// result: (SRAV (SignExt8to64 x) (OR <t> (NEGV <t> (SGTU (ZeroExt16to64 y) (MOVVconst <typ.UInt64> [63]))) (ZeroExt16to64 y)))
 11442  	for {
 11443  		t := v.Type
 11444  		x := v_0
 11445  		y := v_1
 11446  		if !(!shiftIsBounded(v)) {
 11447  			break
 11448  		}
 11449  		v.reset(OpLOONG64SRAV)
 11450  		v0 := b.NewValue0(v.Pos, OpSignExt8to64, typ.Int64)
 11451  		v0.AddArg(x)
 11452  		v1 := b.NewValue0(v.Pos, OpLOONG64OR, t)
 11453  		v2 := b.NewValue0(v.Pos, OpLOONG64NEGV, t)
 11454  		v3 := b.NewValue0(v.Pos, OpLOONG64SGTU, typ.Bool)
 11455  		v4 := b.NewValue0(v.Pos, OpZeroExt16to64, typ.UInt64)
 11456  		v4.AddArg(y)
 11457  		v5 := b.NewValue0(v.Pos, OpLOONG64MOVVconst, typ.UInt64)
 11458  		v5.AuxInt = int64ToAuxInt(63)
 11459  		v3.AddArg2(v4, v5)
 11460  		v2.AddArg(v3)
 11461  		v1.AddArg2(v2, v4)
 11462  		v.AddArg2(v0, v1)
 11463  		return true
 11464  	}
 11465  	return false
 11466  }
 11467  func rewriteValueLOONG64_OpRsh8x32(v *Value) bool {
 11468  	v_1 := v.Args[1]
 11469  	v_0 := v.Args[0]
 11470  	b := v.Block
 11471  	typ := &b.Func.Config.Types
 11472  	// match: (Rsh8x32 x y)
 11473  	// cond: shiftIsBounded(v)
 11474  	// result: (SRAV (SignExt8to64 x) y)
 11475  	for {
 11476  		x := v_0
 11477  		y := v_1
 11478  		if !(shiftIsBounded(v)) {
 11479  			break
 11480  		}
 11481  		v.reset(OpLOONG64SRAV)
 11482  		v0 := b.NewValue0(v.Pos, OpSignExt8to64, typ.Int64)
 11483  		v0.AddArg(x)
 11484  		v.AddArg2(v0, y)
 11485  		return true
 11486  	}
 11487  	// match: (Rsh8x32 <t> x y)
 11488  	// cond: !shiftIsBounded(v)
 11489  	// result: (SRAV (SignExt8to64 x) (OR <t> (NEGV <t> (SGTU (ZeroExt32to64 y) (MOVVconst <typ.UInt64> [63]))) (ZeroExt32to64 y)))
 11490  	for {
 11491  		t := v.Type
 11492  		x := v_0
 11493  		y := v_1
 11494  		if !(!shiftIsBounded(v)) {
 11495  			break
 11496  		}
 11497  		v.reset(OpLOONG64SRAV)
 11498  		v0 := b.NewValue0(v.Pos, OpSignExt8to64, typ.Int64)
 11499  		v0.AddArg(x)
 11500  		v1 := b.NewValue0(v.Pos, OpLOONG64OR, t)
 11501  		v2 := b.NewValue0(v.Pos, OpLOONG64NEGV, t)
 11502  		v3 := b.NewValue0(v.Pos, OpLOONG64SGTU, typ.Bool)
 11503  		v4 := b.NewValue0(v.Pos, OpZeroExt32to64, typ.UInt64)
 11504  		v4.AddArg(y)
 11505  		v5 := b.NewValue0(v.Pos, OpLOONG64MOVVconst, typ.UInt64)
 11506  		v5.AuxInt = int64ToAuxInt(63)
 11507  		v3.AddArg2(v4, v5)
 11508  		v2.AddArg(v3)
 11509  		v1.AddArg2(v2, v4)
 11510  		v.AddArg2(v0, v1)
 11511  		return true
 11512  	}
 11513  	return false
 11514  }
 11515  func rewriteValueLOONG64_OpRsh8x64(v *Value) bool {
 11516  	v_1 := v.Args[1]
 11517  	v_0 := v.Args[0]
 11518  	b := v.Block
 11519  	typ := &b.Func.Config.Types
 11520  	// match: (Rsh8x64 x y)
 11521  	// cond: shiftIsBounded(v)
 11522  	// result: (SRAV (SignExt8to64 x) y)
 11523  	for {
 11524  		x := v_0
 11525  		y := v_1
 11526  		if !(shiftIsBounded(v)) {
 11527  			break
 11528  		}
 11529  		v.reset(OpLOONG64SRAV)
 11530  		v0 := b.NewValue0(v.Pos, OpSignExt8to64, typ.Int64)
 11531  		v0.AddArg(x)
 11532  		v.AddArg2(v0, y)
 11533  		return true
 11534  	}
 11535  	// match: (Rsh8x64 <t> x y)
 11536  	// cond: !shiftIsBounded(v)
 11537  	// result: (SRAV (SignExt8to64 x) (OR <t> (NEGV <t> (SGTU y (MOVVconst <typ.UInt64> [63]))) y))
 11538  	for {
 11539  		t := v.Type
 11540  		x := v_0
 11541  		y := v_1
 11542  		if !(!shiftIsBounded(v)) {
 11543  			break
 11544  		}
 11545  		v.reset(OpLOONG64SRAV)
 11546  		v0 := b.NewValue0(v.Pos, OpSignExt8to64, typ.Int64)
 11547  		v0.AddArg(x)
 11548  		v1 := b.NewValue0(v.Pos, OpLOONG64OR, t)
 11549  		v2 := b.NewValue0(v.Pos, OpLOONG64NEGV, t)
 11550  		v3 := b.NewValue0(v.Pos, OpLOONG64SGTU, typ.Bool)
 11551  		v4 := b.NewValue0(v.Pos, OpLOONG64MOVVconst, typ.UInt64)
 11552  		v4.AuxInt = int64ToAuxInt(63)
 11553  		v3.AddArg2(y, v4)
 11554  		v2.AddArg(v3)
 11555  		v1.AddArg2(v2, y)
 11556  		v.AddArg2(v0, v1)
 11557  		return true
 11558  	}
 11559  	return false
 11560  }
 11561  func rewriteValueLOONG64_OpRsh8x8(v *Value) bool {
 11562  	v_1 := v.Args[1]
 11563  	v_0 := v.Args[0]
 11564  	b := v.Block
 11565  	typ := &b.Func.Config.Types
 11566  	// match: (Rsh8x8 x y)
 11567  	// cond: shiftIsBounded(v)
 11568  	// result: (SRAV (SignExt8to64 x) y)
 11569  	for {
 11570  		x := v_0
 11571  		y := v_1
 11572  		if !(shiftIsBounded(v)) {
 11573  			break
 11574  		}
 11575  		v.reset(OpLOONG64SRAV)
 11576  		v0 := b.NewValue0(v.Pos, OpSignExt8to64, typ.Int64)
 11577  		v0.AddArg(x)
 11578  		v.AddArg2(v0, y)
 11579  		return true
 11580  	}
 11581  	// match: (Rsh8x8 <t> x y)
 11582  	// cond: !shiftIsBounded(v)
 11583  	// result: (SRAV (SignExt8to64 x) (OR <t> (NEGV <t> (SGTU (ZeroExt8to64 y) (MOVVconst <typ.UInt64> [63]))) (ZeroExt8to64 y)))
 11584  	for {
 11585  		t := v.Type
 11586  		x := v_0
 11587  		y := v_1
 11588  		if !(!shiftIsBounded(v)) {
 11589  			break
 11590  		}
 11591  		v.reset(OpLOONG64SRAV)
 11592  		v0 := b.NewValue0(v.Pos, OpSignExt8to64, typ.Int64)
 11593  		v0.AddArg(x)
 11594  		v1 := b.NewValue0(v.Pos, OpLOONG64OR, t)
 11595  		v2 := b.NewValue0(v.Pos, OpLOONG64NEGV, t)
 11596  		v3 := b.NewValue0(v.Pos, OpLOONG64SGTU, typ.Bool)
 11597  		v4 := b.NewValue0(v.Pos, OpZeroExt8to64, typ.UInt64)
 11598  		v4.AddArg(y)
 11599  		v5 := b.NewValue0(v.Pos, OpLOONG64MOVVconst, typ.UInt64)
 11600  		v5.AuxInt = int64ToAuxInt(63)
 11601  		v3.AddArg2(v4, v5)
 11602  		v2.AddArg(v3)
 11603  		v1.AddArg2(v2, v4)
 11604  		v.AddArg2(v0, v1)
 11605  		return true
 11606  	}
 11607  	return false
 11608  }
 11609  func rewriteValueLOONG64_OpSelect0(v *Value) bool {
 11610  	v_0 := v.Args[0]
 11611  	b := v.Block
 11612  	// match: (Select0 (Mul64uhilo x y))
 11613  	// result: (MULHVU x y)
 11614  	for {
 11615  		if v_0.Op != OpMul64uhilo {
 11616  			break
 11617  		}
 11618  		y := v_0.Args[1]
 11619  		x := v_0.Args[0]
 11620  		v.reset(OpLOONG64MULHVU)
 11621  		v.AddArg2(x, y)
 11622  		return true
 11623  	}
 11624  	// match: (Select0 (Mul64uover x y))
 11625  	// result: (MULV x y)
 11626  	for {
 11627  		if v_0.Op != OpMul64uover {
 11628  			break
 11629  		}
 11630  		y := v_0.Args[1]
 11631  		x := v_0.Args[0]
 11632  		v.reset(OpLOONG64MULV)
 11633  		v.AddArg2(x, y)
 11634  		return true
 11635  	}
 11636  	// match: (Select0 <t> (Add64carry x y c))
 11637  	// result: (ADDV (ADDV <t> x y) c)
 11638  	for {
 11639  		t := v.Type
 11640  		if v_0.Op != OpAdd64carry {
 11641  			break
 11642  		}
 11643  		c := v_0.Args[2]
 11644  		x := v_0.Args[0]
 11645  		y := v_0.Args[1]
 11646  		v.reset(OpLOONG64ADDV)
 11647  		v0 := b.NewValue0(v.Pos, OpLOONG64ADDV, t)
 11648  		v0.AddArg2(x, y)
 11649  		v.AddArg2(v0, c)
 11650  		return true
 11651  	}
 11652  	// match: (Select0 <t> (Sub64borrow x y c))
 11653  	// result: (SUBV (SUBV <t> x y) c)
 11654  	for {
 11655  		t := v.Type
 11656  		if v_0.Op != OpSub64borrow {
 11657  			break
 11658  		}
 11659  		c := v_0.Args[2]
 11660  		x := v_0.Args[0]
 11661  		y := v_0.Args[1]
 11662  		v.reset(OpLOONG64SUBV)
 11663  		v0 := b.NewValue0(v.Pos, OpLOONG64SUBV, t)
 11664  		v0.AddArg2(x, y)
 11665  		v.AddArg2(v0, c)
 11666  		return true
 11667  	}
 11668  	return false
 11669  }
 11670  func rewriteValueLOONG64_OpSelect1(v *Value) bool {
 11671  	v_0 := v.Args[0]
 11672  	b := v.Block
 11673  	typ := &b.Func.Config.Types
 11674  	// match: (Select1 (Mul64uhilo x y))
 11675  	// result: (MULV x y)
 11676  	for {
 11677  		if v_0.Op != OpMul64uhilo {
 11678  			break
 11679  		}
 11680  		y := v_0.Args[1]
 11681  		x := v_0.Args[0]
 11682  		v.reset(OpLOONG64MULV)
 11683  		v.AddArg2(x, y)
 11684  		return true
 11685  	}
 11686  	// match: (Select1 (Mul64uover x y))
 11687  	// result: (SGTU <typ.Bool> (MULHVU x y) (MOVVconst <typ.UInt64> [0]))
 11688  	for {
 11689  		if v_0.Op != OpMul64uover {
 11690  			break
 11691  		}
 11692  		y := v_0.Args[1]
 11693  		x := v_0.Args[0]
 11694  		v.reset(OpLOONG64SGTU)
 11695  		v.Type = typ.Bool
 11696  		v0 := b.NewValue0(v.Pos, OpLOONG64MULHVU, typ.UInt64)
 11697  		v0.AddArg2(x, y)
 11698  		v1 := b.NewValue0(v.Pos, OpLOONG64MOVVconst, typ.UInt64)
 11699  		v1.AuxInt = int64ToAuxInt(0)
 11700  		v.AddArg2(v0, v1)
 11701  		return true
 11702  	}
 11703  	// match: (Select1 <t> (Add64carry x y c))
 11704  	// result: (OR (SGTU <t> x s:(ADDV <t> x y)) (SGTU <t> s (ADDV <t> s c)))
 11705  	for {
 11706  		t := v.Type
 11707  		if v_0.Op != OpAdd64carry {
 11708  			break
 11709  		}
 11710  		c := v_0.Args[2]
 11711  		x := v_0.Args[0]
 11712  		y := v_0.Args[1]
 11713  		v.reset(OpLOONG64OR)
 11714  		v0 := b.NewValue0(v.Pos, OpLOONG64SGTU, t)
 11715  		s := b.NewValue0(v.Pos, OpLOONG64ADDV, t)
 11716  		s.AddArg2(x, y)
 11717  		v0.AddArg2(x, s)
 11718  		v2 := b.NewValue0(v.Pos, OpLOONG64SGTU, t)
 11719  		v3 := b.NewValue0(v.Pos, OpLOONG64ADDV, t)
 11720  		v3.AddArg2(s, c)
 11721  		v2.AddArg2(s, v3)
 11722  		v.AddArg2(v0, v2)
 11723  		return true
 11724  	}
 11725  	// match: (Select1 <t> (Sub64borrow x y c))
 11726  	// result: (OR (SGTU <t> s:(SUBV <t> x y) x) (SGTU <t> (SUBV <t> s c) s))
 11727  	for {
 11728  		t := v.Type
 11729  		if v_0.Op != OpSub64borrow {
 11730  			break
 11731  		}
 11732  		c := v_0.Args[2]
 11733  		x := v_0.Args[0]
 11734  		y := v_0.Args[1]
 11735  		v.reset(OpLOONG64OR)
 11736  		v0 := b.NewValue0(v.Pos, OpLOONG64SGTU, t)
 11737  		s := b.NewValue0(v.Pos, OpLOONG64SUBV, t)
 11738  		s.AddArg2(x, y)
 11739  		v0.AddArg2(s, x)
 11740  		v2 := b.NewValue0(v.Pos, OpLOONG64SGTU, t)
 11741  		v3 := b.NewValue0(v.Pos, OpLOONG64SUBV, t)
 11742  		v3.AddArg2(s, c)
 11743  		v2.AddArg2(v3, s)
 11744  		v.AddArg2(v0, v2)
 11745  		return true
 11746  	}
 11747  	return false
 11748  }
 11749  func rewriteValueLOONG64_OpSelectN(v *Value) bool {
 11750  	v_0 := v.Args[0]
 11751  	b := v.Block
 11752  	config := b.Func.Config
 11753  	// match: (SelectN [0] call:(CALLstatic {sym} dst src (MOVVconst [sz]) mem))
 11754  	// cond: sz >= 0 && isSameCall(sym, "runtime.memmove") && call.Uses == 1 && isInlinableMemmove(dst, src, sz, config) && clobber(call)
 11755  	// result: (Move [sz] dst src mem)
 11756  	for {
 11757  		if auxIntToInt64(v.AuxInt) != 0 {
 11758  			break
 11759  		}
 11760  		call := v_0
 11761  		if call.Op != OpLOONG64CALLstatic || len(call.Args) != 4 {
 11762  			break
 11763  		}
 11764  		sym := auxToCall(call.Aux)
 11765  		mem := call.Args[3]
 11766  		dst := call.Args[0]
 11767  		src := call.Args[1]
 11768  		call_2 := call.Args[2]
 11769  		if call_2.Op != OpLOONG64MOVVconst {
 11770  			break
 11771  		}
 11772  		sz := auxIntToInt64(call_2.AuxInt)
 11773  		if !(sz >= 0 && isSameCall(sym, "runtime.memmove") && call.Uses == 1 && isInlinableMemmove(dst, src, sz, config) && clobber(call)) {
 11774  			break
 11775  		}
 11776  		v.reset(OpMove)
 11777  		v.AuxInt = int64ToAuxInt(sz)
 11778  		v.AddArg3(dst, src, mem)
 11779  		return true
 11780  	}
 11781  	return false
 11782  }
 11783  func rewriteValueLOONG64_OpSlicemask(v *Value) bool {
 11784  	v_0 := v.Args[0]
 11785  	b := v.Block
 11786  	// match: (Slicemask <t> x)
 11787  	// result: (SRAVconst (NEGV <t> x) [63])
 11788  	for {
 11789  		t := v.Type
 11790  		x := v_0
 11791  		v.reset(OpLOONG64SRAVconst)
 11792  		v.AuxInt = int64ToAuxInt(63)
 11793  		v0 := b.NewValue0(v.Pos, OpLOONG64NEGV, t)
 11794  		v0.AddArg(x)
 11795  		v.AddArg(v0)
 11796  		return true
 11797  	}
 11798  }
 11799  func rewriteValueLOONG64_OpStore(v *Value) bool {
 11800  	v_2 := v.Args[2]
 11801  	v_1 := v.Args[1]
 11802  	v_0 := v.Args[0]
 11803  	// match: (Store {t} ptr val mem)
 11804  	// cond: t.Size() == 1
 11805  	// result: (MOVBstore ptr val mem)
 11806  	for {
 11807  		t := auxToType(v.Aux)
 11808  		ptr := v_0
 11809  		val := v_1
 11810  		mem := v_2
 11811  		if !(t.Size() == 1) {
 11812  			break
 11813  		}
 11814  		v.reset(OpLOONG64MOVBstore)
 11815  		v.AddArg3(ptr, val, mem)
 11816  		return true
 11817  	}
 11818  	// match: (Store {t} ptr val mem)
 11819  	// cond: t.Size() == 2
 11820  	// result: (MOVHstore ptr val mem)
 11821  	for {
 11822  		t := auxToType(v.Aux)
 11823  		ptr := v_0
 11824  		val := v_1
 11825  		mem := v_2
 11826  		if !(t.Size() == 2) {
 11827  			break
 11828  		}
 11829  		v.reset(OpLOONG64MOVHstore)
 11830  		v.AddArg3(ptr, val, mem)
 11831  		return true
 11832  	}
 11833  	// match: (Store {t} ptr val mem)
 11834  	// cond: t.Size() == 4 && !t.IsFloat()
 11835  	// result: (MOVWstore ptr val mem)
 11836  	for {
 11837  		t := auxToType(v.Aux)
 11838  		ptr := v_0
 11839  		val := v_1
 11840  		mem := v_2
 11841  		if !(t.Size() == 4 && !t.IsFloat()) {
 11842  			break
 11843  		}
 11844  		v.reset(OpLOONG64MOVWstore)
 11845  		v.AddArg3(ptr, val, mem)
 11846  		return true
 11847  	}
 11848  	// match: (Store {t} ptr val mem)
 11849  	// cond: t.Size() == 8 && !t.IsFloat()
 11850  	// result: (MOVVstore ptr val mem)
 11851  	for {
 11852  		t := auxToType(v.Aux)
 11853  		ptr := v_0
 11854  		val := v_1
 11855  		mem := v_2
 11856  		if !(t.Size() == 8 && !t.IsFloat()) {
 11857  			break
 11858  		}
 11859  		v.reset(OpLOONG64MOVVstore)
 11860  		v.AddArg3(ptr, val, mem)
 11861  		return true
 11862  	}
 11863  	// match: (Store {t} ptr val mem)
 11864  	// cond: t.Size() == 4 && t.IsFloat()
 11865  	// result: (MOVFstore ptr val mem)
 11866  	for {
 11867  		t := auxToType(v.Aux)
 11868  		ptr := v_0
 11869  		val := v_1
 11870  		mem := v_2
 11871  		if !(t.Size() == 4 && t.IsFloat()) {
 11872  			break
 11873  		}
 11874  		v.reset(OpLOONG64MOVFstore)
 11875  		v.AddArg3(ptr, val, mem)
 11876  		return true
 11877  	}
 11878  	// match: (Store {t} ptr val mem)
 11879  	// cond: t.Size() == 8 && t.IsFloat()
 11880  	// result: (MOVDstore ptr val mem)
 11881  	for {
 11882  		t := auxToType(v.Aux)
 11883  		ptr := v_0
 11884  		val := v_1
 11885  		mem := v_2
 11886  		if !(t.Size() == 8 && t.IsFloat()) {
 11887  			break
 11888  		}
 11889  		v.reset(OpLOONG64MOVDstore)
 11890  		v.AddArg3(ptr, val, mem)
 11891  		return true
 11892  	}
 11893  	return false
 11894  }
 11895  func rewriteValueLOONG64_OpZero(v *Value) bool {
 11896  	v_1 := v.Args[1]
 11897  	v_0 := v.Args[0]
 11898  	b := v.Block
 11899  	typ := &b.Func.Config.Types
 11900  	// match: (Zero [0] _ mem)
 11901  	// result: mem
 11902  	for {
 11903  		if auxIntToInt64(v.AuxInt) != 0 {
 11904  			break
 11905  		}
 11906  		mem := v_1
 11907  		v.copyOf(mem)
 11908  		return true
 11909  	}
 11910  	// match: (Zero [1] ptr mem)
 11911  	// result: (MOVBstore ptr (MOVVconst [0]) mem)
 11912  	for {
 11913  		if auxIntToInt64(v.AuxInt) != 1 {
 11914  			break
 11915  		}
 11916  		ptr := v_0
 11917  		mem := v_1
 11918  		v.reset(OpLOONG64MOVBstore)
 11919  		v0 := b.NewValue0(v.Pos, OpLOONG64MOVVconst, typ.UInt64)
 11920  		v0.AuxInt = int64ToAuxInt(0)
 11921  		v.AddArg3(ptr, v0, mem)
 11922  		return true
 11923  	}
 11924  	// match: (Zero [2] ptr mem)
 11925  	// result: (MOVHstore ptr (MOVVconst [0]) mem)
 11926  	for {
 11927  		if auxIntToInt64(v.AuxInt) != 2 {
 11928  			break
 11929  		}
 11930  		ptr := v_0
 11931  		mem := v_1
 11932  		v.reset(OpLOONG64MOVHstore)
 11933  		v0 := b.NewValue0(v.Pos, OpLOONG64MOVVconst, typ.UInt64)
 11934  		v0.AuxInt = int64ToAuxInt(0)
 11935  		v.AddArg3(ptr, v0, mem)
 11936  		return true
 11937  	}
 11938  	// match: (Zero [3] ptr mem)
 11939  	// result: (MOVBstore [2] ptr (MOVVconst [0]) (MOVHstore ptr (MOVVconst [0]) mem))
 11940  	for {
 11941  		if auxIntToInt64(v.AuxInt) != 3 {
 11942  			break
 11943  		}
 11944  		ptr := v_0
 11945  		mem := v_1
 11946  		v.reset(OpLOONG64MOVBstore)
 11947  		v.AuxInt = int32ToAuxInt(2)
 11948  		v0 := b.NewValue0(v.Pos, OpLOONG64MOVVconst, typ.UInt64)
 11949  		v0.AuxInt = int64ToAuxInt(0)
 11950  		v1 := b.NewValue0(v.Pos, OpLOONG64MOVHstore, types.TypeMem)
 11951  		v1.AddArg3(ptr, v0, mem)
 11952  		v.AddArg3(ptr, v0, v1)
 11953  		return true
 11954  	}
 11955  	// match: (Zero [4] {t} ptr mem)
 11956  	// result: (MOVWstore ptr (MOVVconst [0]) mem)
 11957  	for {
 11958  		if auxIntToInt64(v.AuxInt) != 4 {
 11959  			break
 11960  		}
 11961  		ptr := v_0
 11962  		mem := v_1
 11963  		v.reset(OpLOONG64MOVWstore)
 11964  		v0 := b.NewValue0(v.Pos, OpLOONG64MOVVconst, typ.UInt64)
 11965  		v0.AuxInt = int64ToAuxInt(0)
 11966  		v.AddArg3(ptr, v0, mem)
 11967  		return true
 11968  	}
 11969  	// match: (Zero [5] ptr mem)
 11970  	// result: (MOVBstore [4] ptr (MOVVconst [0]) (MOVWstore ptr (MOVVconst [0]) mem))
 11971  	for {
 11972  		if auxIntToInt64(v.AuxInt) != 5 {
 11973  			break
 11974  		}
 11975  		ptr := v_0
 11976  		mem := v_1
 11977  		v.reset(OpLOONG64MOVBstore)
 11978  		v.AuxInt = int32ToAuxInt(4)
 11979  		v0 := b.NewValue0(v.Pos, OpLOONG64MOVVconst, typ.UInt64)
 11980  		v0.AuxInt = int64ToAuxInt(0)
 11981  		v1 := b.NewValue0(v.Pos, OpLOONG64MOVWstore, types.TypeMem)
 11982  		v1.AddArg3(ptr, v0, mem)
 11983  		v.AddArg3(ptr, v0, v1)
 11984  		return true
 11985  	}
 11986  	// match: (Zero [6] ptr mem)
 11987  	// result: (MOVHstore [4] ptr (MOVVconst [0]) (MOVWstore ptr (MOVVconst [0]) mem))
 11988  	for {
 11989  		if auxIntToInt64(v.AuxInt) != 6 {
 11990  			break
 11991  		}
 11992  		ptr := v_0
 11993  		mem := v_1
 11994  		v.reset(OpLOONG64MOVHstore)
 11995  		v.AuxInt = int32ToAuxInt(4)
 11996  		v0 := b.NewValue0(v.Pos, OpLOONG64MOVVconst, typ.UInt64)
 11997  		v0.AuxInt = int64ToAuxInt(0)
 11998  		v1 := b.NewValue0(v.Pos, OpLOONG64MOVWstore, types.TypeMem)
 11999  		v1.AddArg3(ptr, v0, mem)
 12000  		v.AddArg3(ptr, v0, v1)
 12001  		return true
 12002  	}
 12003  	// match: (Zero [7] ptr mem)
 12004  	// result: (MOVWstore [3] ptr (MOVVconst [0]) (MOVWstore ptr (MOVVconst [0]) mem))
 12005  	for {
 12006  		if auxIntToInt64(v.AuxInt) != 7 {
 12007  			break
 12008  		}
 12009  		ptr := v_0
 12010  		mem := v_1
 12011  		v.reset(OpLOONG64MOVWstore)
 12012  		v.AuxInt = int32ToAuxInt(3)
 12013  		v0 := b.NewValue0(v.Pos, OpLOONG64MOVVconst, typ.UInt64)
 12014  		v0.AuxInt = int64ToAuxInt(0)
 12015  		v1 := b.NewValue0(v.Pos, OpLOONG64MOVWstore, types.TypeMem)
 12016  		v1.AddArg3(ptr, v0, mem)
 12017  		v.AddArg3(ptr, v0, v1)
 12018  		return true
 12019  	}
 12020  	// match: (Zero [8] {t} ptr mem)
 12021  	// result: (MOVVstore ptr (MOVVconst [0]) mem)
 12022  	for {
 12023  		if auxIntToInt64(v.AuxInt) != 8 {
 12024  			break
 12025  		}
 12026  		ptr := v_0
 12027  		mem := v_1
 12028  		v.reset(OpLOONG64MOVVstore)
 12029  		v0 := b.NewValue0(v.Pos, OpLOONG64MOVVconst, typ.UInt64)
 12030  		v0.AuxInt = int64ToAuxInt(0)
 12031  		v.AddArg3(ptr, v0, mem)
 12032  		return true
 12033  	}
 12034  	// match: (Zero [9] ptr mem)
 12035  	// result: (MOVBstore [8] ptr (MOVVconst [0]) (MOVVstore ptr (MOVVconst [0]) mem))
 12036  	for {
 12037  		if auxIntToInt64(v.AuxInt) != 9 {
 12038  			break
 12039  		}
 12040  		ptr := v_0
 12041  		mem := v_1
 12042  		v.reset(OpLOONG64MOVBstore)
 12043  		v.AuxInt = int32ToAuxInt(8)
 12044  		v0 := b.NewValue0(v.Pos, OpLOONG64MOVVconst, typ.UInt64)
 12045  		v0.AuxInt = int64ToAuxInt(0)
 12046  		v1 := b.NewValue0(v.Pos, OpLOONG64MOVVstore, types.TypeMem)
 12047  		v1.AddArg3(ptr, v0, mem)
 12048  		v.AddArg3(ptr, v0, v1)
 12049  		return true
 12050  	}
 12051  	// match: (Zero [10] ptr mem)
 12052  	// result: (MOVHstore [8] ptr (MOVVconst [0]) (MOVVstore ptr (MOVVconst [0]) mem))
 12053  	for {
 12054  		if auxIntToInt64(v.AuxInt) != 10 {
 12055  			break
 12056  		}
 12057  		ptr := v_0
 12058  		mem := v_1
 12059  		v.reset(OpLOONG64MOVHstore)
 12060  		v.AuxInt = int32ToAuxInt(8)
 12061  		v0 := b.NewValue0(v.Pos, OpLOONG64MOVVconst, typ.UInt64)
 12062  		v0.AuxInt = int64ToAuxInt(0)
 12063  		v1 := b.NewValue0(v.Pos, OpLOONG64MOVVstore, types.TypeMem)
 12064  		v1.AddArg3(ptr, v0, mem)
 12065  		v.AddArg3(ptr, v0, v1)
 12066  		return true
 12067  	}
 12068  	// match: (Zero [11] ptr mem)
 12069  	// result: (MOVWstore [7] ptr (MOVVconst [0]) (MOVVstore ptr (MOVVconst [0]) mem))
 12070  	for {
 12071  		if auxIntToInt64(v.AuxInt) != 11 {
 12072  			break
 12073  		}
 12074  		ptr := v_0
 12075  		mem := v_1
 12076  		v.reset(OpLOONG64MOVWstore)
 12077  		v.AuxInt = int32ToAuxInt(7)
 12078  		v0 := b.NewValue0(v.Pos, OpLOONG64MOVVconst, typ.UInt64)
 12079  		v0.AuxInt = int64ToAuxInt(0)
 12080  		v1 := b.NewValue0(v.Pos, OpLOONG64MOVVstore, types.TypeMem)
 12081  		v1.AddArg3(ptr, v0, mem)
 12082  		v.AddArg3(ptr, v0, v1)
 12083  		return true
 12084  	}
 12085  	// match: (Zero [12] ptr mem)
 12086  	// result: (MOVWstore [8] ptr (MOVVconst [0]) (MOVVstore ptr (MOVVconst [0]) mem))
 12087  	for {
 12088  		if auxIntToInt64(v.AuxInt) != 12 {
 12089  			break
 12090  		}
 12091  		ptr := v_0
 12092  		mem := v_1
 12093  		v.reset(OpLOONG64MOVWstore)
 12094  		v.AuxInt = int32ToAuxInt(8)
 12095  		v0 := b.NewValue0(v.Pos, OpLOONG64MOVVconst, typ.UInt64)
 12096  		v0.AuxInt = int64ToAuxInt(0)
 12097  		v1 := b.NewValue0(v.Pos, OpLOONG64MOVVstore, types.TypeMem)
 12098  		v1.AddArg3(ptr, v0, mem)
 12099  		v.AddArg3(ptr, v0, v1)
 12100  		return true
 12101  	}
 12102  	// match: (Zero [13] ptr mem)
 12103  	// result: (MOVVstore [5] ptr (MOVVconst [0]) (MOVVstore ptr (MOVVconst [0]) mem))
 12104  	for {
 12105  		if auxIntToInt64(v.AuxInt) != 13 {
 12106  			break
 12107  		}
 12108  		ptr := v_0
 12109  		mem := v_1
 12110  		v.reset(OpLOONG64MOVVstore)
 12111  		v.AuxInt = int32ToAuxInt(5)
 12112  		v0 := b.NewValue0(v.Pos, OpLOONG64MOVVconst, typ.UInt64)
 12113  		v0.AuxInt = int64ToAuxInt(0)
 12114  		v1 := b.NewValue0(v.Pos, OpLOONG64MOVVstore, types.TypeMem)
 12115  		v1.AddArg3(ptr, v0, mem)
 12116  		v.AddArg3(ptr, v0, v1)
 12117  		return true
 12118  	}
 12119  	// match: (Zero [14] ptr mem)
 12120  	// result: (MOVVstore [6] ptr (MOVVconst [0]) (MOVVstore ptr (MOVVconst [0]) mem))
 12121  	for {
 12122  		if auxIntToInt64(v.AuxInt) != 14 {
 12123  			break
 12124  		}
 12125  		ptr := v_0
 12126  		mem := v_1
 12127  		v.reset(OpLOONG64MOVVstore)
 12128  		v.AuxInt = int32ToAuxInt(6)
 12129  		v0 := b.NewValue0(v.Pos, OpLOONG64MOVVconst, typ.UInt64)
 12130  		v0.AuxInt = int64ToAuxInt(0)
 12131  		v1 := b.NewValue0(v.Pos, OpLOONG64MOVVstore, types.TypeMem)
 12132  		v1.AddArg3(ptr, v0, mem)
 12133  		v.AddArg3(ptr, v0, v1)
 12134  		return true
 12135  	}
 12136  	// match: (Zero [15] ptr mem)
 12137  	// result: (MOVVstore [7] ptr (MOVVconst [0]) (MOVVstore ptr (MOVVconst [0]) mem))
 12138  	for {
 12139  		if auxIntToInt64(v.AuxInt) != 15 {
 12140  			break
 12141  		}
 12142  		ptr := v_0
 12143  		mem := v_1
 12144  		v.reset(OpLOONG64MOVVstore)
 12145  		v.AuxInt = int32ToAuxInt(7)
 12146  		v0 := b.NewValue0(v.Pos, OpLOONG64MOVVconst, typ.UInt64)
 12147  		v0.AuxInt = int64ToAuxInt(0)
 12148  		v1 := b.NewValue0(v.Pos, OpLOONG64MOVVstore, types.TypeMem)
 12149  		v1.AddArg3(ptr, v0, mem)
 12150  		v.AddArg3(ptr, v0, v1)
 12151  		return true
 12152  	}
 12153  	// match: (Zero [16] ptr mem)
 12154  	// result: (MOVVstore [8] ptr (MOVVconst [0]) (MOVVstore ptr (MOVVconst [0]) mem))
 12155  	for {
 12156  		if auxIntToInt64(v.AuxInt) != 16 {
 12157  			break
 12158  		}
 12159  		ptr := v_0
 12160  		mem := v_1
 12161  		v.reset(OpLOONG64MOVVstore)
 12162  		v.AuxInt = int32ToAuxInt(8)
 12163  		v0 := b.NewValue0(v.Pos, OpLOONG64MOVVconst, typ.UInt64)
 12164  		v0.AuxInt = int64ToAuxInt(0)
 12165  		v1 := b.NewValue0(v.Pos, OpLOONG64MOVVstore, types.TypeMem)
 12166  		v1.AddArg3(ptr, v0, mem)
 12167  		v.AddArg3(ptr, v0, v1)
 12168  		return true
 12169  	}
 12170  	// match: (Zero [s] ptr mem)
 12171  	// cond: s > 16 && s < 192
 12172  	// result: (LoweredZero [s] ptr mem)
 12173  	for {
 12174  		s := auxIntToInt64(v.AuxInt)
 12175  		ptr := v_0
 12176  		mem := v_1
 12177  		if !(s > 16 && s < 192) {
 12178  			break
 12179  		}
 12180  		v.reset(OpLOONG64LoweredZero)
 12181  		v.AuxInt = int64ToAuxInt(s)
 12182  		v.AddArg2(ptr, mem)
 12183  		return true
 12184  	}
 12185  	// match: (Zero [s] ptr mem)
 12186  	// cond: s >= 192
 12187  	// result: (LoweredZeroLoop [s] ptr mem)
 12188  	for {
 12189  		s := auxIntToInt64(v.AuxInt)
 12190  		ptr := v_0
 12191  		mem := v_1
 12192  		if !(s >= 192) {
 12193  			break
 12194  		}
 12195  		v.reset(OpLOONG64LoweredZeroLoop)
 12196  		v.AuxInt = int64ToAuxInt(s)
 12197  		v.AddArg2(ptr, mem)
 12198  		return true
 12199  	}
 12200  	return false
 12201  }
 12202  func rewriteBlockLOONG64(b *Block) bool {
 12203  	typ := &b.Func.Config.Types
 12204  	switch b.Kind {
 12205  	case BlockLOONG64BEQ:
 12206  		// match: (BEQ (MOVVconst [0]) cond yes no)
 12207  		// result: (EQZ cond yes no)
 12208  		for b.Controls[0].Op == OpLOONG64MOVVconst {
 12209  			v_0 := b.Controls[0]
 12210  			if auxIntToInt64(v_0.AuxInt) != 0 {
 12211  				break
 12212  			}
 12213  			cond := b.Controls[1]
 12214  			b.resetWithControl(BlockLOONG64EQZ, cond)
 12215  			return true
 12216  		}
 12217  		// match: (BEQ cond (MOVVconst [0]) yes no)
 12218  		// result: (EQZ cond yes no)
 12219  		for b.Controls[1].Op == OpLOONG64MOVVconst {
 12220  			cond := b.Controls[0]
 12221  			v_1 := b.Controls[1]
 12222  			if auxIntToInt64(v_1.AuxInt) != 0 {
 12223  				break
 12224  			}
 12225  			b.resetWithControl(BlockLOONG64EQZ, cond)
 12226  			return true
 12227  		}
 12228  	case BlockLOONG64BGE:
 12229  		// match: (BGE (MOVVconst [0]) cond yes no)
 12230  		// result: (LEZ cond yes no)
 12231  		for b.Controls[0].Op == OpLOONG64MOVVconst {
 12232  			v_0 := b.Controls[0]
 12233  			if auxIntToInt64(v_0.AuxInt) != 0 {
 12234  				break
 12235  			}
 12236  			cond := b.Controls[1]
 12237  			b.resetWithControl(BlockLOONG64LEZ, cond)
 12238  			return true
 12239  		}
 12240  		// match: (BGE cond (MOVVconst [0]) yes no)
 12241  		// result: (GEZ cond yes no)
 12242  		for b.Controls[1].Op == OpLOONG64MOVVconst {
 12243  			cond := b.Controls[0]
 12244  			v_1 := b.Controls[1]
 12245  			if auxIntToInt64(v_1.AuxInt) != 0 {
 12246  				break
 12247  			}
 12248  			b.resetWithControl(BlockLOONG64GEZ, cond)
 12249  			return true
 12250  		}
 12251  	case BlockLOONG64BGEU:
 12252  		// match: (BGEU (MOVVconst [0]) cond yes no)
 12253  		// result: (EQZ cond yes no)
 12254  		for b.Controls[0].Op == OpLOONG64MOVVconst {
 12255  			v_0 := b.Controls[0]
 12256  			if auxIntToInt64(v_0.AuxInt) != 0 {
 12257  				break
 12258  			}
 12259  			cond := b.Controls[1]
 12260  			b.resetWithControl(BlockLOONG64EQZ, cond)
 12261  			return true
 12262  		}
 12263  	case BlockLOONG64BLT:
 12264  		// match: (BLT (MOVVconst [0]) cond yes no)
 12265  		// result: (GTZ cond yes no)
 12266  		for b.Controls[0].Op == OpLOONG64MOVVconst {
 12267  			v_0 := b.Controls[0]
 12268  			if auxIntToInt64(v_0.AuxInt) != 0 {
 12269  				break
 12270  			}
 12271  			cond := b.Controls[1]
 12272  			b.resetWithControl(BlockLOONG64GTZ, cond)
 12273  			return true
 12274  		}
 12275  		// match: (BLT cond (MOVVconst [0]) yes no)
 12276  		// result: (LTZ cond yes no)
 12277  		for b.Controls[1].Op == OpLOONG64MOVVconst {
 12278  			cond := b.Controls[0]
 12279  			v_1 := b.Controls[1]
 12280  			if auxIntToInt64(v_1.AuxInt) != 0 {
 12281  				break
 12282  			}
 12283  			b.resetWithControl(BlockLOONG64LTZ, cond)
 12284  			return true
 12285  		}
 12286  	case BlockLOONG64BLTU:
 12287  		// match: (BLTU (MOVVconst [0]) cond yes no)
 12288  		// result: (NEZ cond yes no)
 12289  		for b.Controls[0].Op == OpLOONG64MOVVconst {
 12290  			v_0 := b.Controls[0]
 12291  			if auxIntToInt64(v_0.AuxInt) != 0 {
 12292  				break
 12293  			}
 12294  			cond := b.Controls[1]
 12295  			b.resetWithControl(BlockLOONG64NEZ, cond)
 12296  			return true
 12297  		}
 12298  	case BlockLOONG64BNE:
 12299  		// match: (BNE (MOVVconst [0]) cond yes no)
 12300  		// result: (NEZ cond yes no)
 12301  		for b.Controls[0].Op == OpLOONG64MOVVconst {
 12302  			v_0 := b.Controls[0]
 12303  			if auxIntToInt64(v_0.AuxInt) != 0 {
 12304  				break
 12305  			}
 12306  			cond := b.Controls[1]
 12307  			b.resetWithControl(BlockLOONG64NEZ, cond)
 12308  			return true
 12309  		}
 12310  		// match: (BNE cond (MOVVconst [0]) yes no)
 12311  		// result: (NEZ cond yes no)
 12312  		for b.Controls[1].Op == OpLOONG64MOVVconst {
 12313  			cond := b.Controls[0]
 12314  			v_1 := b.Controls[1]
 12315  			if auxIntToInt64(v_1.AuxInt) != 0 {
 12316  				break
 12317  			}
 12318  			b.resetWithControl(BlockLOONG64NEZ, cond)
 12319  			return true
 12320  		}
 12321  	case BlockLOONG64EQZ:
 12322  		// match: (EQZ (FPFlagTrue cmp) yes no)
 12323  		// result: (FPF cmp yes no)
 12324  		for b.Controls[0].Op == OpLOONG64FPFlagTrue {
 12325  			v_0 := b.Controls[0]
 12326  			cmp := v_0.Args[0]
 12327  			b.resetWithControl(BlockLOONG64FPF, cmp)
 12328  			return true
 12329  		}
 12330  		// match: (EQZ (FPFlagFalse cmp) yes no)
 12331  		// result: (FPT cmp yes no)
 12332  		for b.Controls[0].Op == OpLOONG64FPFlagFalse {
 12333  			v_0 := b.Controls[0]
 12334  			cmp := v_0.Args[0]
 12335  			b.resetWithControl(BlockLOONG64FPT, cmp)
 12336  			return true
 12337  		}
 12338  		// match: (EQZ (XORconst [1] cmp:(SGT _ _)) yes no)
 12339  		// result: (NEZ cmp yes no)
 12340  		for b.Controls[0].Op == OpLOONG64XORconst {
 12341  			v_0 := b.Controls[0]
 12342  			if auxIntToInt64(v_0.AuxInt) != 1 {
 12343  				break
 12344  			}
 12345  			cmp := v_0.Args[0]
 12346  			if cmp.Op != OpLOONG64SGT {
 12347  				break
 12348  			}
 12349  			b.resetWithControl(BlockLOONG64NEZ, cmp)
 12350  			return true
 12351  		}
 12352  		// match: (EQZ (XORconst [1] cmp:(SGTU _ _)) yes no)
 12353  		// result: (NEZ cmp yes no)
 12354  		for b.Controls[0].Op == OpLOONG64XORconst {
 12355  			v_0 := b.Controls[0]
 12356  			if auxIntToInt64(v_0.AuxInt) != 1 {
 12357  				break
 12358  			}
 12359  			cmp := v_0.Args[0]
 12360  			if cmp.Op != OpLOONG64SGTU {
 12361  				break
 12362  			}
 12363  			b.resetWithControl(BlockLOONG64NEZ, cmp)
 12364  			return true
 12365  		}
 12366  		// match: (EQZ (XORconst [1] cmp:(SGTconst _)) yes no)
 12367  		// result: (NEZ cmp yes no)
 12368  		for b.Controls[0].Op == OpLOONG64XORconst {
 12369  			v_0 := b.Controls[0]
 12370  			if auxIntToInt64(v_0.AuxInt) != 1 {
 12371  				break
 12372  			}
 12373  			cmp := v_0.Args[0]
 12374  			if cmp.Op != OpLOONG64SGTconst {
 12375  				break
 12376  			}
 12377  			b.resetWithControl(BlockLOONG64NEZ, cmp)
 12378  			return true
 12379  		}
 12380  		// match: (EQZ (XORconst [1] cmp:(SGTUconst _)) yes no)
 12381  		// result: (NEZ cmp yes no)
 12382  		for b.Controls[0].Op == OpLOONG64XORconst {
 12383  			v_0 := b.Controls[0]
 12384  			if auxIntToInt64(v_0.AuxInt) != 1 {
 12385  				break
 12386  			}
 12387  			cmp := v_0.Args[0]
 12388  			if cmp.Op != OpLOONG64SGTUconst {
 12389  				break
 12390  			}
 12391  			b.resetWithControl(BlockLOONG64NEZ, cmp)
 12392  			return true
 12393  		}
 12394  		// match: (EQZ (SGTUconst [1] x) yes no)
 12395  		// result: (NEZ x yes no)
 12396  		for b.Controls[0].Op == OpLOONG64SGTUconst {
 12397  			v_0 := b.Controls[0]
 12398  			if auxIntToInt64(v_0.AuxInt) != 1 {
 12399  				break
 12400  			}
 12401  			x := v_0.Args[0]
 12402  			b.resetWithControl(BlockLOONG64NEZ, x)
 12403  			return true
 12404  		}
 12405  		// match: (EQZ (SGTU x (MOVVconst [0])) yes no)
 12406  		// result: (EQZ x yes no)
 12407  		for b.Controls[0].Op == OpLOONG64SGTU {
 12408  			v_0 := b.Controls[0]
 12409  			_ = v_0.Args[1]
 12410  			x := v_0.Args[0]
 12411  			v_0_1 := v_0.Args[1]
 12412  			if v_0_1.Op != OpLOONG64MOVVconst || auxIntToInt64(v_0_1.AuxInt) != 0 {
 12413  				break
 12414  			}
 12415  			b.resetWithControl(BlockLOONG64EQZ, x)
 12416  			return true
 12417  		}
 12418  		// match: (EQZ (SGTconst [0] x) yes no)
 12419  		// result: (GEZ x yes no)
 12420  		for b.Controls[0].Op == OpLOONG64SGTconst {
 12421  			v_0 := b.Controls[0]
 12422  			if auxIntToInt64(v_0.AuxInt) != 0 {
 12423  				break
 12424  			}
 12425  			x := v_0.Args[0]
 12426  			b.resetWithControl(BlockLOONG64GEZ, x)
 12427  			return true
 12428  		}
 12429  		// match: (EQZ (SGT x (MOVVconst [0])) yes no)
 12430  		// result: (LEZ x yes no)
 12431  		for b.Controls[0].Op == OpLOONG64SGT {
 12432  			v_0 := b.Controls[0]
 12433  			_ = v_0.Args[1]
 12434  			x := v_0.Args[0]
 12435  			v_0_1 := v_0.Args[1]
 12436  			if v_0_1.Op != OpLOONG64MOVVconst || auxIntToInt64(v_0_1.AuxInt) != 0 {
 12437  				break
 12438  			}
 12439  			b.resetWithControl(BlockLOONG64LEZ, x)
 12440  			return true
 12441  		}
 12442  		// match: (EQZ (SGTU (MOVVconst [c]) y) yes no)
 12443  		// cond: c >= -2048 && c <= 2047
 12444  		// result: (EQZ (SGTUconst [c] y) yes no)
 12445  		for b.Controls[0].Op == OpLOONG64SGTU {
 12446  			v_0 := b.Controls[0]
 12447  			y := v_0.Args[1]
 12448  			v_0_0 := v_0.Args[0]
 12449  			if v_0_0.Op != OpLOONG64MOVVconst {
 12450  				break
 12451  			}
 12452  			c := auxIntToInt64(v_0_0.AuxInt)
 12453  			if !(c >= -2048 && c <= 2047) {
 12454  				break
 12455  			}
 12456  			v0 := b.NewValue0(v_0.Pos, OpLOONG64SGTUconst, typ.Bool)
 12457  			v0.AuxInt = int64ToAuxInt(c)
 12458  			v0.AddArg(y)
 12459  			b.resetWithControl(BlockLOONG64EQZ, v0)
 12460  			return true
 12461  		}
 12462  		// match: (EQZ (SUBV x y) yes no)
 12463  		// result: (BEQ x y yes no)
 12464  		for b.Controls[0].Op == OpLOONG64SUBV {
 12465  			v_0 := b.Controls[0]
 12466  			y := v_0.Args[1]
 12467  			x := v_0.Args[0]
 12468  			b.resetWithControl2(BlockLOONG64BEQ, x, y)
 12469  			return true
 12470  		}
 12471  		// match: (EQZ (SGT x y) yes no)
 12472  		// result: (BGE y x yes no)
 12473  		for b.Controls[0].Op == OpLOONG64SGT {
 12474  			v_0 := b.Controls[0]
 12475  			y := v_0.Args[1]
 12476  			x := v_0.Args[0]
 12477  			b.resetWithControl2(BlockLOONG64BGE, y, x)
 12478  			return true
 12479  		}
 12480  		// match: (EQZ (SGTU x y) yes no)
 12481  		// result: (BGEU y x yes no)
 12482  		for b.Controls[0].Op == OpLOONG64SGTU {
 12483  			v_0 := b.Controls[0]
 12484  			y := v_0.Args[1]
 12485  			x := v_0.Args[0]
 12486  			b.resetWithControl2(BlockLOONG64BGEU, y, x)
 12487  			return true
 12488  		}
 12489  		// match: (EQZ (SGTconst [c] y) yes no)
 12490  		// result: (BGE y (MOVVconst [c]) yes no)
 12491  		for b.Controls[0].Op == OpLOONG64SGTconst {
 12492  			v_0 := b.Controls[0]
 12493  			c := auxIntToInt64(v_0.AuxInt)
 12494  			y := v_0.Args[0]
 12495  			v0 := b.NewValue0(b.Pos, OpLOONG64MOVVconst, typ.UInt64)
 12496  			v0.AuxInt = int64ToAuxInt(c)
 12497  			b.resetWithControl2(BlockLOONG64BGE, y, v0)
 12498  			return true
 12499  		}
 12500  		// match: (EQZ (SGTUconst [c] y) yes no)
 12501  		// result: (BGEU y (MOVVconst [c]) yes no)
 12502  		for b.Controls[0].Op == OpLOONG64SGTUconst {
 12503  			v_0 := b.Controls[0]
 12504  			c := auxIntToInt64(v_0.AuxInt)
 12505  			y := v_0.Args[0]
 12506  			v0 := b.NewValue0(b.Pos, OpLOONG64MOVVconst, typ.UInt64)
 12507  			v0.AuxInt = int64ToAuxInt(c)
 12508  			b.resetWithControl2(BlockLOONG64BGEU, y, v0)
 12509  			return true
 12510  		}
 12511  		// match: (EQZ (MOVVconst [0]) yes no)
 12512  		// result: (First yes no)
 12513  		for b.Controls[0].Op == OpLOONG64MOVVconst {
 12514  			v_0 := b.Controls[0]
 12515  			if auxIntToInt64(v_0.AuxInt) != 0 {
 12516  				break
 12517  			}
 12518  			b.Reset(BlockFirst)
 12519  			return true
 12520  		}
 12521  		// match: (EQZ (MOVVconst [c]) yes no)
 12522  		// cond: c != 0
 12523  		// result: (First no yes)
 12524  		for b.Controls[0].Op == OpLOONG64MOVVconst {
 12525  			v_0 := b.Controls[0]
 12526  			c := auxIntToInt64(v_0.AuxInt)
 12527  			if !(c != 0) {
 12528  				break
 12529  			}
 12530  			b.Reset(BlockFirst)
 12531  			b.swapSuccessors()
 12532  			return true
 12533  		}
 12534  		// match: (EQZ (NEGV x) yes no)
 12535  		// result: (EQZ x yes no)
 12536  		for b.Controls[0].Op == OpLOONG64NEGV {
 12537  			v_0 := b.Controls[0]
 12538  			x := v_0.Args[0]
 12539  			b.resetWithControl(BlockLOONG64EQZ, x)
 12540  			return true
 12541  		}
 12542  	case BlockLOONG64GEZ:
 12543  		// match: (GEZ (MOVVconst [c]) yes no)
 12544  		// cond: c >= 0
 12545  		// result: (First yes no)
 12546  		for b.Controls[0].Op == OpLOONG64MOVVconst {
 12547  			v_0 := b.Controls[0]
 12548  			c := auxIntToInt64(v_0.AuxInt)
 12549  			if !(c >= 0) {
 12550  				break
 12551  			}
 12552  			b.Reset(BlockFirst)
 12553  			return true
 12554  		}
 12555  		// match: (GEZ (MOVVconst [c]) yes no)
 12556  		// cond: c < 0
 12557  		// result: (First no yes)
 12558  		for b.Controls[0].Op == OpLOONG64MOVVconst {
 12559  			v_0 := b.Controls[0]
 12560  			c := auxIntToInt64(v_0.AuxInt)
 12561  			if !(c < 0) {
 12562  				break
 12563  			}
 12564  			b.Reset(BlockFirst)
 12565  			b.swapSuccessors()
 12566  			return true
 12567  		}
 12568  	case BlockLOONG64GTZ:
 12569  		// match: (GTZ (MOVVconst [c]) yes no)
 12570  		// cond: c > 0
 12571  		// result: (First yes no)
 12572  		for b.Controls[0].Op == OpLOONG64MOVVconst {
 12573  			v_0 := b.Controls[0]
 12574  			c := auxIntToInt64(v_0.AuxInt)
 12575  			if !(c > 0) {
 12576  				break
 12577  			}
 12578  			b.Reset(BlockFirst)
 12579  			return true
 12580  		}
 12581  		// match: (GTZ (MOVVconst [c]) yes no)
 12582  		// cond: c <= 0
 12583  		// result: (First no yes)
 12584  		for b.Controls[0].Op == OpLOONG64MOVVconst {
 12585  			v_0 := b.Controls[0]
 12586  			c := auxIntToInt64(v_0.AuxInt)
 12587  			if !(c <= 0) {
 12588  				break
 12589  			}
 12590  			b.Reset(BlockFirst)
 12591  			b.swapSuccessors()
 12592  			return true
 12593  		}
 12594  	case BlockIf:
 12595  		// match: (If cond yes no)
 12596  		// result: (NEZ (MOVBUreg <typ.UInt64> cond) yes no)
 12597  		for {
 12598  			cond := b.Controls[0]
 12599  			v0 := b.NewValue0(cond.Pos, OpLOONG64MOVBUreg, typ.UInt64)
 12600  			v0.AddArg(cond)
 12601  			b.resetWithControl(BlockLOONG64NEZ, v0)
 12602  			return true
 12603  		}
 12604  	case BlockJumpTable:
 12605  		// match: (JumpTable idx)
 12606  		// result: (JUMPTABLE {makeJumpTableSym(b)} idx (MOVVaddr <typ.Uintptr> {makeJumpTableSym(b)} (SB)))
 12607  		for {
 12608  			idx := b.Controls[0]
 12609  			v0 := b.NewValue0(b.Pos, OpLOONG64MOVVaddr, typ.Uintptr)
 12610  			v0.Aux = symToAux(makeJumpTableSym(b))
 12611  			v1 := b.NewValue0(b.Pos, OpSB, typ.Uintptr)
 12612  			v0.AddArg(v1)
 12613  			b.resetWithControl2(BlockLOONG64JUMPTABLE, idx, v0)
 12614  			b.Aux = symToAux(makeJumpTableSym(b))
 12615  			return true
 12616  		}
 12617  	case BlockLOONG64LEZ:
 12618  		// match: (LEZ (MOVVconst [c]) yes no)
 12619  		// cond: c <= 0
 12620  		// result: (First yes no)
 12621  		for b.Controls[0].Op == OpLOONG64MOVVconst {
 12622  			v_0 := b.Controls[0]
 12623  			c := auxIntToInt64(v_0.AuxInt)
 12624  			if !(c <= 0) {
 12625  				break
 12626  			}
 12627  			b.Reset(BlockFirst)
 12628  			return true
 12629  		}
 12630  		// match: (LEZ (MOVVconst [c]) yes no)
 12631  		// cond: c > 0
 12632  		// result: (First no yes)
 12633  		for b.Controls[0].Op == OpLOONG64MOVVconst {
 12634  			v_0 := b.Controls[0]
 12635  			c := auxIntToInt64(v_0.AuxInt)
 12636  			if !(c > 0) {
 12637  				break
 12638  			}
 12639  			b.Reset(BlockFirst)
 12640  			b.swapSuccessors()
 12641  			return true
 12642  		}
 12643  	case BlockLOONG64LTZ:
 12644  		// match: (LTZ (MOVVconst [c]) yes no)
 12645  		// cond: c < 0
 12646  		// result: (First yes no)
 12647  		for b.Controls[0].Op == OpLOONG64MOVVconst {
 12648  			v_0 := b.Controls[0]
 12649  			c := auxIntToInt64(v_0.AuxInt)
 12650  			if !(c < 0) {
 12651  				break
 12652  			}
 12653  			b.Reset(BlockFirst)
 12654  			return true
 12655  		}
 12656  		// match: (LTZ (MOVVconst [c]) yes no)
 12657  		// cond: c >= 0
 12658  		// result: (First no yes)
 12659  		for b.Controls[0].Op == OpLOONG64MOVVconst {
 12660  			v_0 := b.Controls[0]
 12661  			c := auxIntToInt64(v_0.AuxInt)
 12662  			if !(c >= 0) {
 12663  				break
 12664  			}
 12665  			b.Reset(BlockFirst)
 12666  			b.swapSuccessors()
 12667  			return true
 12668  		}
 12669  	case BlockLOONG64NEZ:
 12670  		// match: (NEZ (FPFlagTrue cmp) yes no)
 12671  		// result: (FPT cmp yes no)
 12672  		for b.Controls[0].Op == OpLOONG64FPFlagTrue {
 12673  			v_0 := b.Controls[0]
 12674  			cmp := v_0.Args[0]
 12675  			b.resetWithControl(BlockLOONG64FPT, cmp)
 12676  			return true
 12677  		}
 12678  		// match: (NEZ (FPFlagFalse cmp) yes no)
 12679  		// result: (FPF cmp yes no)
 12680  		for b.Controls[0].Op == OpLOONG64FPFlagFalse {
 12681  			v_0 := b.Controls[0]
 12682  			cmp := v_0.Args[0]
 12683  			b.resetWithControl(BlockLOONG64FPF, cmp)
 12684  			return true
 12685  		}
 12686  		// match: (NEZ (XORconst [1] cmp:(SGT _ _)) yes no)
 12687  		// result: (EQZ cmp yes no)
 12688  		for b.Controls[0].Op == OpLOONG64XORconst {
 12689  			v_0 := b.Controls[0]
 12690  			if auxIntToInt64(v_0.AuxInt) != 1 {
 12691  				break
 12692  			}
 12693  			cmp := v_0.Args[0]
 12694  			if cmp.Op != OpLOONG64SGT {
 12695  				break
 12696  			}
 12697  			b.resetWithControl(BlockLOONG64EQZ, cmp)
 12698  			return true
 12699  		}
 12700  		// match: (NEZ (XORconst [1] cmp:(SGTU _ _)) yes no)
 12701  		// result: (EQZ cmp yes no)
 12702  		for b.Controls[0].Op == OpLOONG64XORconst {
 12703  			v_0 := b.Controls[0]
 12704  			if auxIntToInt64(v_0.AuxInt) != 1 {
 12705  				break
 12706  			}
 12707  			cmp := v_0.Args[0]
 12708  			if cmp.Op != OpLOONG64SGTU {
 12709  				break
 12710  			}
 12711  			b.resetWithControl(BlockLOONG64EQZ, cmp)
 12712  			return true
 12713  		}
 12714  		// match: (NEZ (XORconst [1] cmp:(SGTconst _)) yes no)
 12715  		// result: (EQZ cmp yes no)
 12716  		for b.Controls[0].Op == OpLOONG64XORconst {
 12717  			v_0 := b.Controls[0]
 12718  			if auxIntToInt64(v_0.AuxInt) != 1 {
 12719  				break
 12720  			}
 12721  			cmp := v_0.Args[0]
 12722  			if cmp.Op != OpLOONG64SGTconst {
 12723  				break
 12724  			}
 12725  			b.resetWithControl(BlockLOONG64EQZ, cmp)
 12726  			return true
 12727  		}
 12728  		// match: (NEZ (XORconst [1] cmp:(SGTUconst _)) yes no)
 12729  		// result: (EQZ cmp yes no)
 12730  		for b.Controls[0].Op == OpLOONG64XORconst {
 12731  			v_0 := b.Controls[0]
 12732  			if auxIntToInt64(v_0.AuxInt) != 1 {
 12733  				break
 12734  			}
 12735  			cmp := v_0.Args[0]
 12736  			if cmp.Op != OpLOONG64SGTUconst {
 12737  				break
 12738  			}
 12739  			b.resetWithControl(BlockLOONG64EQZ, cmp)
 12740  			return true
 12741  		}
 12742  		// match: (NEZ (SGTUconst [1] x) yes no)
 12743  		// result: (EQZ x yes no)
 12744  		for b.Controls[0].Op == OpLOONG64SGTUconst {
 12745  			v_0 := b.Controls[0]
 12746  			if auxIntToInt64(v_0.AuxInt) != 1 {
 12747  				break
 12748  			}
 12749  			x := v_0.Args[0]
 12750  			b.resetWithControl(BlockLOONG64EQZ, x)
 12751  			return true
 12752  		}
 12753  		// match: (NEZ (SGTU x (MOVVconst [0])) yes no)
 12754  		// result: (NEZ x yes no)
 12755  		for b.Controls[0].Op == OpLOONG64SGTU {
 12756  			v_0 := b.Controls[0]
 12757  			_ = v_0.Args[1]
 12758  			x := v_0.Args[0]
 12759  			v_0_1 := v_0.Args[1]
 12760  			if v_0_1.Op != OpLOONG64MOVVconst || auxIntToInt64(v_0_1.AuxInt) != 0 {
 12761  				break
 12762  			}
 12763  			b.resetWithControl(BlockLOONG64NEZ, x)
 12764  			return true
 12765  		}
 12766  		// match: (NEZ (SGTconst [0] x) yes no)
 12767  		// result: (LTZ x yes no)
 12768  		for b.Controls[0].Op == OpLOONG64SGTconst {
 12769  			v_0 := b.Controls[0]
 12770  			if auxIntToInt64(v_0.AuxInt) != 0 {
 12771  				break
 12772  			}
 12773  			x := v_0.Args[0]
 12774  			b.resetWithControl(BlockLOONG64LTZ, x)
 12775  			return true
 12776  		}
 12777  		// match: (NEZ (SGT x (MOVVconst [0])) yes no)
 12778  		// result: (GTZ x yes no)
 12779  		for b.Controls[0].Op == OpLOONG64SGT {
 12780  			v_0 := b.Controls[0]
 12781  			_ = v_0.Args[1]
 12782  			x := v_0.Args[0]
 12783  			v_0_1 := v_0.Args[1]
 12784  			if v_0_1.Op != OpLOONG64MOVVconst || auxIntToInt64(v_0_1.AuxInt) != 0 {
 12785  				break
 12786  			}
 12787  			b.resetWithControl(BlockLOONG64GTZ, x)
 12788  			return true
 12789  		}
 12790  		// match: (NEZ (SGTU (MOVVconst [c]) y) yes no)
 12791  		// cond: c >= -2048 && c <= 2047
 12792  		// result: (NEZ (SGTUconst [c] y) yes no)
 12793  		for b.Controls[0].Op == OpLOONG64SGTU {
 12794  			v_0 := b.Controls[0]
 12795  			y := v_0.Args[1]
 12796  			v_0_0 := v_0.Args[0]
 12797  			if v_0_0.Op != OpLOONG64MOVVconst {
 12798  				break
 12799  			}
 12800  			c := auxIntToInt64(v_0_0.AuxInt)
 12801  			if !(c >= -2048 && c <= 2047) {
 12802  				break
 12803  			}
 12804  			v0 := b.NewValue0(v_0.Pos, OpLOONG64SGTUconst, typ.Bool)
 12805  			v0.AuxInt = int64ToAuxInt(c)
 12806  			v0.AddArg(y)
 12807  			b.resetWithControl(BlockLOONG64NEZ, v0)
 12808  			return true
 12809  		}
 12810  		// match: (NEZ (SUBV x y) yes no)
 12811  		// result: (BNE x y yes no)
 12812  		for b.Controls[0].Op == OpLOONG64SUBV {
 12813  			v_0 := b.Controls[0]
 12814  			y := v_0.Args[1]
 12815  			x := v_0.Args[0]
 12816  			b.resetWithControl2(BlockLOONG64BNE, x, y)
 12817  			return true
 12818  		}
 12819  		// match: (NEZ (SGT x y) yes no)
 12820  		// result: (BLT y x yes no)
 12821  		for b.Controls[0].Op == OpLOONG64SGT {
 12822  			v_0 := b.Controls[0]
 12823  			y := v_0.Args[1]
 12824  			x := v_0.Args[0]
 12825  			b.resetWithControl2(BlockLOONG64BLT, y, x)
 12826  			return true
 12827  		}
 12828  		// match: (NEZ (SGTU x y) yes no)
 12829  		// result: (BLTU y x yes no)
 12830  		for b.Controls[0].Op == OpLOONG64SGTU {
 12831  			v_0 := b.Controls[0]
 12832  			y := v_0.Args[1]
 12833  			x := v_0.Args[0]
 12834  			b.resetWithControl2(BlockLOONG64BLTU, y, x)
 12835  			return true
 12836  		}
 12837  		// match: (NEZ (SGTconst [c] y) yes no)
 12838  		// result: (BLT y (MOVVconst [c]) yes no)
 12839  		for b.Controls[0].Op == OpLOONG64SGTconst {
 12840  			v_0 := b.Controls[0]
 12841  			c := auxIntToInt64(v_0.AuxInt)
 12842  			y := v_0.Args[0]
 12843  			v0 := b.NewValue0(b.Pos, OpLOONG64MOVVconst, typ.UInt64)
 12844  			v0.AuxInt = int64ToAuxInt(c)
 12845  			b.resetWithControl2(BlockLOONG64BLT, y, v0)
 12846  			return true
 12847  		}
 12848  		// match: (NEZ (SGTUconst [c] y) yes no)
 12849  		// result: (BLTU y (MOVVconst [c]) yes no)
 12850  		for b.Controls[0].Op == OpLOONG64SGTUconst {
 12851  			v_0 := b.Controls[0]
 12852  			c := auxIntToInt64(v_0.AuxInt)
 12853  			y := v_0.Args[0]
 12854  			v0 := b.NewValue0(b.Pos, OpLOONG64MOVVconst, typ.UInt64)
 12855  			v0.AuxInt = int64ToAuxInt(c)
 12856  			b.resetWithControl2(BlockLOONG64BLTU, y, v0)
 12857  			return true
 12858  		}
 12859  		// match: (NEZ (MOVVconst [0]) yes no)
 12860  		// result: (First no yes)
 12861  		for b.Controls[0].Op == OpLOONG64MOVVconst {
 12862  			v_0 := b.Controls[0]
 12863  			if auxIntToInt64(v_0.AuxInt) != 0 {
 12864  				break
 12865  			}
 12866  			b.Reset(BlockFirst)
 12867  			b.swapSuccessors()
 12868  			return true
 12869  		}
 12870  		// match: (NEZ (MOVVconst [c]) yes no)
 12871  		// cond: c != 0
 12872  		// result: (First yes no)
 12873  		for b.Controls[0].Op == OpLOONG64MOVVconst {
 12874  			v_0 := b.Controls[0]
 12875  			c := auxIntToInt64(v_0.AuxInt)
 12876  			if !(c != 0) {
 12877  				break
 12878  			}
 12879  			b.Reset(BlockFirst)
 12880  			return true
 12881  		}
 12882  		// match: (NEZ (NEGV x) yes no)
 12883  		// result: (NEZ x yes no)
 12884  		for b.Controls[0].Op == OpLOONG64NEGV {
 12885  			v_0 := b.Controls[0]
 12886  			x := v_0.Args[0]
 12887  			b.resetWithControl(BlockLOONG64NEZ, x)
 12888  			return true
 12889  		}
 12890  	}
 12891  	return false
 12892  }
 12893  

View as plain text