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 OpLOONG64MOVDload:
   364  		return rewriteValueLOONG64_OpLOONG64MOVDload(v)
   365  	case OpLOONG64MOVDloadidx:
   366  		return rewriteValueLOONG64_OpLOONG64MOVDloadidx(v)
   367  	case OpLOONG64MOVDstore:
   368  		return rewriteValueLOONG64_OpLOONG64MOVDstore(v)
   369  	case OpLOONG64MOVDstoreidx:
   370  		return rewriteValueLOONG64_OpLOONG64MOVDstoreidx(v)
   371  	case OpLOONG64MOVFload:
   372  		return rewriteValueLOONG64_OpLOONG64MOVFload(v)
   373  	case OpLOONG64MOVFloadidx:
   374  		return rewriteValueLOONG64_OpLOONG64MOVFloadidx(v)
   375  	case OpLOONG64MOVFstore:
   376  		return rewriteValueLOONG64_OpLOONG64MOVFstore(v)
   377  	case OpLOONG64MOVFstoreidx:
   378  		return rewriteValueLOONG64_OpLOONG64MOVFstoreidx(v)
   379  	case OpLOONG64MOVHUload:
   380  		return rewriteValueLOONG64_OpLOONG64MOVHUload(v)
   381  	case OpLOONG64MOVHUloadidx:
   382  		return rewriteValueLOONG64_OpLOONG64MOVHUloadidx(v)
   383  	case OpLOONG64MOVHUreg:
   384  		return rewriteValueLOONG64_OpLOONG64MOVHUreg(v)
   385  	case OpLOONG64MOVHload:
   386  		return rewriteValueLOONG64_OpLOONG64MOVHload(v)
   387  	case OpLOONG64MOVHloadidx:
   388  		return rewriteValueLOONG64_OpLOONG64MOVHloadidx(v)
   389  	case OpLOONG64MOVHreg:
   390  		return rewriteValueLOONG64_OpLOONG64MOVHreg(v)
   391  	case OpLOONG64MOVHstore:
   392  		return rewriteValueLOONG64_OpLOONG64MOVHstore(v)
   393  	case OpLOONG64MOVHstoreidx:
   394  		return rewriteValueLOONG64_OpLOONG64MOVHstoreidx(v)
   395  	case OpLOONG64MOVVload:
   396  		return rewriteValueLOONG64_OpLOONG64MOVVload(v)
   397  	case OpLOONG64MOVVloadidx:
   398  		return rewriteValueLOONG64_OpLOONG64MOVVloadidx(v)
   399  	case OpLOONG64MOVVnop:
   400  		return rewriteValueLOONG64_OpLOONG64MOVVnop(v)
   401  	case OpLOONG64MOVVreg:
   402  		return rewriteValueLOONG64_OpLOONG64MOVVreg(v)
   403  	case OpLOONG64MOVVstore:
   404  		return rewriteValueLOONG64_OpLOONG64MOVVstore(v)
   405  	case OpLOONG64MOVVstoreidx:
   406  		return rewriteValueLOONG64_OpLOONG64MOVVstoreidx(v)
   407  	case OpLOONG64MOVWUload:
   408  		return rewriteValueLOONG64_OpLOONG64MOVWUload(v)
   409  	case OpLOONG64MOVWUloadidx:
   410  		return rewriteValueLOONG64_OpLOONG64MOVWUloadidx(v)
   411  	case OpLOONG64MOVWUreg:
   412  		return rewriteValueLOONG64_OpLOONG64MOVWUreg(v)
   413  	case OpLOONG64MOVWload:
   414  		return rewriteValueLOONG64_OpLOONG64MOVWload(v)
   415  	case OpLOONG64MOVWloadidx:
   416  		return rewriteValueLOONG64_OpLOONG64MOVWloadidx(v)
   417  	case OpLOONG64MOVWreg:
   418  		return rewriteValueLOONG64_OpLOONG64MOVWreg(v)
   419  	case OpLOONG64MOVWstore:
   420  		return rewriteValueLOONG64_OpLOONG64MOVWstore(v)
   421  	case OpLOONG64MOVWstoreidx:
   422  		return rewriteValueLOONG64_OpLOONG64MOVWstoreidx(v)
   423  	case OpLOONG64MULV:
   424  		return rewriteValueLOONG64_OpLOONG64MULV(v)
   425  	case OpLOONG64NEGV:
   426  		return rewriteValueLOONG64_OpLOONG64NEGV(v)
   427  	case OpLOONG64NOR:
   428  		return rewriteValueLOONG64_OpLOONG64NOR(v)
   429  	case OpLOONG64NORconst:
   430  		return rewriteValueLOONG64_OpLOONG64NORconst(v)
   431  	case OpLOONG64OR:
   432  		return rewriteValueLOONG64_OpLOONG64OR(v)
   433  	case OpLOONG64ORN:
   434  		return rewriteValueLOONG64_OpLOONG64ORN(v)
   435  	case OpLOONG64ORconst:
   436  		return rewriteValueLOONG64_OpLOONG64ORconst(v)
   437  	case OpLOONG64REMV:
   438  		return rewriteValueLOONG64_OpLOONG64REMV(v)
   439  	case OpLOONG64REMVU:
   440  		return rewriteValueLOONG64_OpLOONG64REMVU(v)
   441  	case OpLOONG64ROTR:
   442  		return rewriteValueLOONG64_OpLOONG64ROTR(v)
   443  	case OpLOONG64ROTRV:
   444  		return rewriteValueLOONG64_OpLOONG64ROTRV(v)
   445  	case OpLOONG64SGT:
   446  		return rewriteValueLOONG64_OpLOONG64SGT(v)
   447  	case OpLOONG64SGTU:
   448  		return rewriteValueLOONG64_OpLOONG64SGTU(v)
   449  	case OpLOONG64SGTUconst:
   450  		return rewriteValueLOONG64_OpLOONG64SGTUconst(v)
   451  	case OpLOONG64SGTconst:
   452  		return rewriteValueLOONG64_OpLOONG64SGTconst(v)
   453  	case OpLOONG64SLL:
   454  		return rewriteValueLOONG64_OpLOONG64SLL(v)
   455  	case OpLOONG64SLLV:
   456  		return rewriteValueLOONG64_OpLOONG64SLLV(v)
   457  	case OpLOONG64SLLVconst:
   458  		return rewriteValueLOONG64_OpLOONG64SLLVconst(v)
   459  	case OpLOONG64SLLconst:
   460  		return rewriteValueLOONG64_OpLOONG64SLLconst(v)
   461  	case OpLOONG64SRA:
   462  		return rewriteValueLOONG64_OpLOONG64SRA(v)
   463  	case OpLOONG64SRAV:
   464  		return rewriteValueLOONG64_OpLOONG64SRAV(v)
   465  	case OpLOONG64SRAVconst:
   466  		return rewriteValueLOONG64_OpLOONG64SRAVconst(v)
   467  	case OpLOONG64SRL:
   468  		return rewriteValueLOONG64_OpLOONG64SRL(v)
   469  	case OpLOONG64SRLV:
   470  		return rewriteValueLOONG64_OpLOONG64SRLV(v)
   471  	case OpLOONG64SRLVconst:
   472  		return rewriteValueLOONG64_OpLOONG64SRLVconst(v)
   473  	case OpLOONG64SUBD:
   474  		return rewriteValueLOONG64_OpLOONG64SUBD(v)
   475  	case OpLOONG64SUBF:
   476  		return rewriteValueLOONG64_OpLOONG64SUBF(v)
   477  	case OpLOONG64SUBV:
   478  		return rewriteValueLOONG64_OpLOONG64SUBV(v)
   479  	case OpLOONG64SUBVconst:
   480  		return rewriteValueLOONG64_OpLOONG64SUBVconst(v)
   481  	case OpLOONG64XOR:
   482  		return rewriteValueLOONG64_OpLOONG64XOR(v)
   483  	case OpLOONG64XORconst:
   484  		return rewriteValueLOONG64_OpLOONG64XORconst(v)
   485  	case OpLeq16:
   486  		return rewriteValueLOONG64_OpLeq16(v)
   487  	case OpLeq16U:
   488  		return rewriteValueLOONG64_OpLeq16U(v)
   489  	case OpLeq32:
   490  		return rewriteValueLOONG64_OpLeq32(v)
   491  	case OpLeq32F:
   492  		return rewriteValueLOONG64_OpLeq32F(v)
   493  	case OpLeq32U:
   494  		return rewriteValueLOONG64_OpLeq32U(v)
   495  	case OpLeq64:
   496  		return rewriteValueLOONG64_OpLeq64(v)
   497  	case OpLeq64F:
   498  		return rewriteValueLOONG64_OpLeq64F(v)
   499  	case OpLeq64U:
   500  		return rewriteValueLOONG64_OpLeq64U(v)
   501  	case OpLeq8:
   502  		return rewriteValueLOONG64_OpLeq8(v)
   503  	case OpLeq8U:
   504  		return rewriteValueLOONG64_OpLeq8U(v)
   505  	case OpLess16:
   506  		return rewriteValueLOONG64_OpLess16(v)
   507  	case OpLess16U:
   508  		return rewriteValueLOONG64_OpLess16U(v)
   509  	case OpLess32:
   510  		return rewriteValueLOONG64_OpLess32(v)
   511  	case OpLess32F:
   512  		return rewriteValueLOONG64_OpLess32F(v)
   513  	case OpLess32U:
   514  		return rewriteValueLOONG64_OpLess32U(v)
   515  	case OpLess64:
   516  		return rewriteValueLOONG64_OpLess64(v)
   517  	case OpLess64F:
   518  		return rewriteValueLOONG64_OpLess64F(v)
   519  	case OpLess64U:
   520  		return rewriteValueLOONG64_OpLess64U(v)
   521  	case OpLess8:
   522  		return rewriteValueLOONG64_OpLess8(v)
   523  	case OpLess8U:
   524  		return rewriteValueLOONG64_OpLess8U(v)
   525  	case OpLoad:
   526  		return rewriteValueLOONG64_OpLoad(v)
   527  	case OpLocalAddr:
   528  		return rewriteValueLOONG64_OpLocalAddr(v)
   529  	case OpLsh16x16:
   530  		return rewriteValueLOONG64_OpLsh16x16(v)
   531  	case OpLsh16x32:
   532  		return rewriteValueLOONG64_OpLsh16x32(v)
   533  	case OpLsh16x64:
   534  		return rewriteValueLOONG64_OpLsh16x64(v)
   535  	case OpLsh16x8:
   536  		return rewriteValueLOONG64_OpLsh16x8(v)
   537  	case OpLsh32x16:
   538  		return rewriteValueLOONG64_OpLsh32x16(v)
   539  	case OpLsh32x32:
   540  		return rewriteValueLOONG64_OpLsh32x32(v)
   541  	case OpLsh32x64:
   542  		return rewriteValueLOONG64_OpLsh32x64(v)
   543  	case OpLsh32x8:
   544  		return rewriteValueLOONG64_OpLsh32x8(v)
   545  	case OpLsh64x16:
   546  		return rewriteValueLOONG64_OpLsh64x16(v)
   547  	case OpLsh64x32:
   548  		return rewriteValueLOONG64_OpLsh64x32(v)
   549  	case OpLsh64x64:
   550  		return rewriteValueLOONG64_OpLsh64x64(v)
   551  	case OpLsh64x8:
   552  		return rewriteValueLOONG64_OpLsh64x8(v)
   553  	case OpLsh8x16:
   554  		return rewriteValueLOONG64_OpLsh8x16(v)
   555  	case OpLsh8x32:
   556  		return rewriteValueLOONG64_OpLsh8x32(v)
   557  	case OpLsh8x64:
   558  		return rewriteValueLOONG64_OpLsh8x64(v)
   559  	case OpLsh8x8:
   560  		return rewriteValueLOONG64_OpLsh8x8(v)
   561  	case OpMax32F:
   562  		v.Op = OpLOONG64FMAXF
   563  		return true
   564  	case OpMax64F:
   565  		v.Op = OpLOONG64FMAXD
   566  		return true
   567  	case OpMin32F:
   568  		v.Op = OpLOONG64FMINF
   569  		return true
   570  	case OpMin64F:
   571  		v.Op = OpLOONG64FMIND
   572  		return true
   573  	case OpMod16:
   574  		return rewriteValueLOONG64_OpMod16(v)
   575  	case OpMod16u:
   576  		return rewriteValueLOONG64_OpMod16u(v)
   577  	case OpMod32:
   578  		return rewriteValueLOONG64_OpMod32(v)
   579  	case OpMod32u:
   580  		return rewriteValueLOONG64_OpMod32u(v)
   581  	case OpMod64:
   582  		return rewriteValueLOONG64_OpMod64(v)
   583  	case OpMod64u:
   584  		v.Op = OpLOONG64REMVU
   585  		return true
   586  	case OpMod8:
   587  		return rewriteValueLOONG64_OpMod8(v)
   588  	case OpMod8u:
   589  		return rewriteValueLOONG64_OpMod8u(v)
   590  	case OpMove:
   591  		return rewriteValueLOONG64_OpMove(v)
   592  	case OpMul16:
   593  		v.Op = OpLOONG64MULV
   594  		return true
   595  	case OpMul32:
   596  		v.Op = OpLOONG64MULV
   597  		return true
   598  	case OpMul32F:
   599  		v.Op = OpLOONG64MULF
   600  		return true
   601  	case OpMul64:
   602  		v.Op = OpLOONG64MULV
   603  		return true
   604  	case OpMul64F:
   605  		v.Op = OpLOONG64MULD
   606  		return true
   607  	case OpMul8:
   608  		v.Op = OpLOONG64MULV
   609  		return true
   610  	case OpNeg16:
   611  		v.Op = OpLOONG64NEGV
   612  		return true
   613  	case OpNeg32:
   614  		v.Op = OpLOONG64NEGV
   615  		return true
   616  	case OpNeg32F:
   617  		v.Op = OpLOONG64NEGF
   618  		return true
   619  	case OpNeg64:
   620  		v.Op = OpLOONG64NEGV
   621  		return true
   622  	case OpNeg64F:
   623  		v.Op = OpLOONG64NEGD
   624  		return true
   625  	case OpNeg8:
   626  		v.Op = OpLOONG64NEGV
   627  		return true
   628  	case OpNeq16:
   629  		return rewriteValueLOONG64_OpNeq16(v)
   630  	case OpNeq32:
   631  		return rewriteValueLOONG64_OpNeq32(v)
   632  	case OpNeq32F:
   633  		return rewriteValueLOONG64_OpNeq32F(v)
   634  	case OpNeq64:
   635  		return rewriteValueLOONG64_OpNeq64(v)
   636  	case OpNeq64F:
   637  		return rewriteValueLOONG64_OpNeq64F(v)
   638  	case OpNeq8:
   639  		return rewriteValueLOONG64_OpNeq8(v)
   640  	case OpNeqB:
   641  		v.Op = OpLOONG64XOR
   642  		return true
   643  	case OpNeqPtr:
   644  		return rewriteValueLOONG64_OpNeqPtr(v)
   645  	case OpNilCheck:
   646  		v.Op = OpLOONG64LoweredNilCheck
   647  		return true
   648  	case OpNot:
   649  		return rewriteValueLOONG64_OpNot(v)
   650  	case OpOffPtr:
   651  		return rewriteValueLOONG64_OpOffPtr(v)
   652  	case OpOr16:
   653  		v.Op = OpLOONG64OR
   654  		return true
   655  	case OpOr32:
   656  		v.Op = OpLOONG64OR
   657  		return true
   658  	case OpOr64:
   659  		v.Op = OpLOONG64OR
   660  		return true
   661  	case OpOr8:
   662  		v.Op = OpLOONG64OR
   663  		return true
   664  	case OpOrB:
   665  		v.Op = OpLOONG64OR
   666  		return true
   667  	case OpPanicBounds:
   668  		v.Op = OpLOONG64LoweredPanicBoundsRR
   669  		return true
   670  	case OpPopCount16:
   671  		return rewriteValueLOONG64_OpPopCount16(v)
   672  	case OpPopCount32:
   673  		return rewriteValueLOONG64_OpPopCount32(v)
   674  	case OpPopCount64:
   675  		return rewriteValueLOONG64_OpPopCount64(v)
   676  	case OpPrefetchCache:
   677  		return rewriteValueLOONG64_OpPrefetchCache(v)
   678  	case OpPrefetchCacheStreamed:
   679  		return rewriteValueLOONG64_OpPrefetchCacheStreamed(v)
   680  	case OpPubBarrier:
   681  		v.Op = OpLOONG64LoweredPubBarrier
   682  		return true
   683  	case OpRotateLeft16:
   684  		return rewriteValueLOONG64_OpRotateLeft16(v)
   685  	case OpRotateLeft32:
   686  		return rewriteValueLOONG64_OpRotateLeft32(v)
   687  	case OpRotateLeft64:
   688  		return rewriteValueLOONG64_OpRotateLeft64(v)
   689  	case OpRotateLeft8:
   690  		return rewriteValueLOONG64_OpRotateLeft8(v)
   691  	case OpRound32F:
   692  		v.Op = OpLOONG64LoweredRound32F
   693  		return true
   694  	case OpRound64F:
   695  		v.Op = OpLOONG64LoweredRound64F
   696  		return true
   697  	case OpRsh16Ux16:
   698  		return rewriteValueLOONG64_OpRsh16Ux16(v)
   699  	case OpRsh16Ux32:
   700  		return rewriteValueLOONG64_OpRsh16Ux32(v)
   701  	case OpRsh16Ux64:
   702  		return rewriteValueLOONG64_OpRsh16Ux64(v)
   703  	case OpRsh16Ux8:
   704  		return rewriteValueLOONG64_OpRsh16Ux8(v)
   705  	case OpRsh16x16:
   706  		return rewriteValueLOONG64_OpRsh16x16(v)
   707  	case OpRsh16x32:
   708  		return rewriteValueLOONG64_OpRsh16x32(v)
   709  	case OpRsh16x64:
   710  		return rewriteValueLOONG64_OpRsh16x64(v)
   711  	case OpRsh16x8:
   712  		return rewriteValueLOONG64_OpRsh16x8(v)
   713  	case OpRsh32Ux16:
   714  		return rewriteValueLOONG64_OpRsh32Ux16(v)
   715  	case OpRsh32Ux32:
   716  		return rewriteValueLOONG64_OpRsh32Ux32(v)
   717  	case OpRsh32Ux64:
   718  		return rewriteValueLOONG64_OpRsh32Ux64(v)
   719  	case OpRsh32Ux8:
   720  		return rewriteValueLOONG64_OpRsh32Ux8(v)
   721  	case OpRsh32x16:
   722  		return rewriteValueLOONG64_OpRsh32x16(v)
   723  	case OpRsh32x32:
   724  		return rewriteValueLOONG64_OpRsh32x32(v)
   725  	case OpRsh32x64:
   726  		return rewriteValueLOONG64_OpRsh32x64(v)
   727  	case OpRsh32x8:
   728  		return rewriteValueLOONG64_OpRsh32x8(v)
   729  	case OpRsh64Ux16:
   730  		return rewriteValueLOONG64_OpRsh64Ux16(v)
   731  	case OpRsh64Ux32:
   732  		return rewriteValueLOONG64_OpRsh64Ux32(v)
   733  	case OpRsh64Ux64:
   734  		return rewriteValueLOONG64_OpRsh64Ux64(v)
   735  	case OpRsh64Ux8:
   736  		return rewriteValueLOONG64_OpRsh64Ux8(v)
   737  	case OpRsh64x16:
   738  		return rewriteValueLOONG64_OpRsh64x16(v)
   739  	case OpRsh64x32:
   740  		return rewriteValueLOONG64_OpRsh64x32(v)
   741  	case OpRsh64x64:
   742  		return rewriteValueLOONG64_OpRsh64x64(v)
   743  	case OpRsh64x8:
   744  		return rewriteValueLOONG64_OpRsh64x8(v)
   745  	case OpRsh8Ux16:
   746  		return rewriteValueLOONG64_OpRsh8Ux16(v)
   747  	case OpRsh8Ux32:
   748  		return rewriteValueLOONG64_OpRsh8Ux32(v)
   749  	case OpRsh8Ux64:
   750  		return rewriteValueLOONG64_OpRsh8Ux64(v)
   751  	case OpRsh8Ux8:
   752  		return rewriteValueLOONG64_OpRsh8Ux8(v)
   753  	case OpRsh8x16:
   754  		return rewriteValueLOONG64_OpRsh8x16(v)
   755  	case OpRsh8x32:
   756  		return rewriteValueLOONG64_OpRsh8x32(v)
   757  	case OpRsh8x64:
   758  		return rewriteValueLOONG64_OpRsh8x64(v)
   759  	case OpRsh8x8:
   760  		return rewriteValueLOONG64_OpRsh8x8(v)
   761  	case OpSelect0:
   762  		return rewriteValueLOONG64_OpSelect0(v)
   763  	case OpSelect1:
   764  		return rewriteValueLOONG64_OpSelect1(v)
   765  	case OpSelectN:
   766  		return rewriteValueLOONG64_OpSelectN(v)
   767  	case OpSignExt16to32:
   768  		v.Op = OpLOONG64MOVHreg
   769  		return true
   770  	case OpSignExt16to64:
   771  		v.Op = OpLOONG64MOVHreg
   772  		return true
   773  	case OpSignExt32to64:
   774  		v.Op = OpLOONG64MOVWreg
   775  		return true
   776  	case OpSignExt8to16:
   777  		v.Op = OpLOONG64MOVBreg
   778  		return true
   779  	case OpSignExt8to32:
   780  		v.Op = OpLOONG64MOVBreg
   781  		return true
   782  	case OpSignExt8to64:
   783  		v.Op = OpLOONG64MOVBreg
   784  		return true
   785  	case OpSlicemask:
   786  		return rewriteValueLOONG64_OpSlicemask(v)
   787  	case OpSqrt:
   788  		v.Op = OpLOONG64SQRTD
   789  		return true
   790  	case OpSqrt32:
   791  		v.Op = OpLOONG64SQRTF
   792  		return true
   793  	case OpStaticCall:
   794  		v.Op = OpLOONG64CALLstatic
   795  		return true
   796  	case OpStore:
   797  		return rewriteValueLOONG64_OpStore(v)
   798  	case OpSub16:
   799  		v.Op = OpLOONG64SUBV
   800  		return true
   801  	case OpSub32:
   802  		v.Op = OpLOONG64SUBV
   803  		return true
   804  	case OpSub32F:
   805  		v.Op = OpLOONG64SUBF
   806  		return true
   807  	case OpSub64:
   808  		v.Op = OpLOONG64SUBV
   809  		return true
   810  	case OpSub64F:
   811  		v.Op = OpLOONG64SUBD
   812  		return true
   813  	case OpSub8:
   814  		v.Op = OpLOONG64SUBV
   815  		return true
   816  	case OpSubPtr:
   817  		v.Op = OpLOONG64SUBV
   818  		return true
   819  	case OpTailCall:
   820  		v.Op = OpLOONG64CALLtail
   821  		return true
   822  	case OpTrunc16to8:
   823  		v.Op = OpCopy
   824  		return true
   825  	case OpTrunc32to16:
   826  		v.Op = OpCopy
   827  		return true
   828  	case OpTrunc32to8:
   829  		v.Op = OpCopy
   830  		return true
   831  	case OpTrunc64to16:
   832  		v.Op = OpCopy
   833  		return true
   834  	case OpTrunc64to32:
   835  		v.Op = OpCopy
   836  		return true
   837  	case OpTrunc64to8:
   838  		v.Op = OpCopy
   839  		return true
   840  	case OpWB:
   841  		v.Op = OpLOONG64LoweredWB
   842  		return true
   843  	case OpXor16:
   844  		v.Op = OpLOONG64XOR
   845  		return true
   846  	case OpXor32:
   847  		v.Op = OpLOONG64XOR
   848  		return true
   849  	case OpXor64:
   850  		v.Op = OpLOONG64XOR
   851  		return true
   852  	case OpXor8:
   853  		v.Op = OpLOONG64XOR
   854  		return true
   855  	case OpZero:
   856  		return rewriteValueLOONG64_OpZero(v)
   857  	case OpZeroExt16to32:
   858  		v.Op = OpLOONG64MOVHUreg
   859  		return true
   860  	case OpZeroExt16to64:
   861  		v.Op = OpLOONG64MOVHUreg
   862  		return true
   863  	case OpZeroExt32to64:
   864  		v.Op = OpLOONG64MOVWUreg
   865  		return true
   866  	case OpZeroExt8to16:
   867  		v.Op = OpLOONG64MOVBUreg
   868  		return true
   869  	case OpZeroExt8to32:
   870  		v.Op = OpLOONG64MOVBUreg
   871  		return true
   872  	case OpZeroExt8to64:
   873  		v.Op = OpLOONG64MOVBUreg
   874  		return true
   875  	}
   876  	return false
   877  }
   878  func rewriteValueLOONG64_OpAddr(v *Value) bool {
   879  	v_0 := v.Args[0]
   880  	// match: (Addr {sym} base)
   881  	// result: (MOVVaddr {sym} base)
   882  	for {
   883  		sym := auxToSym(v.Aux)
   884  		base := v_0
   885  		v.reset(OpLOONG64MOVVaddr)
   886  		v.Aux = symToAux(sym)
   887  		v.AddArg(base)
   888  		return true
   889  	}
   890  }
   891  func rewriteValueLOONG64_OpAtomicAnd8(v *Value) bool {
   892  	v_2 := v.Args[2]
   893  	v_1 := v.Args[1]
   894  	v_0 := v.Args[0]
   895  	b := v.Block
   896  	typ := &b.Func.Config.Types
   897  	// match: (AtomicAnd8 ptr val mem)
   898  	// 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)
   899  	for {
   900  		ptr := v_0
   901  		val := v_1
   902  		mem := v_2
   903  		v.reset(OpLOONG64LoweredAtomicAnd32)
   904  		v0 := b.NewValue0(v.Pos, OpLOONG64AND, typ.Uintptr)
   905  		v1 := b.NewValue0(v.Pos, OpLOONG64MOVVconst, typ.UInt64)
   906  		v1.AuxInt = int64ToAuxInt(^3)
   907  		v0.AddArg2(v1, ptr)
   908  		v2 := b.NewValue0(v.Pos, OpLOONG64NORconst, typ.UInt32)
   909  		v2.AuxInt = int64ToAuxInt(0)
   910  		v3 := b.NewValue0(v.Pos, OpLOONG64SLLV, typ.UInt32)
   911  		v4 := b.NewValue0(v.Pos, OpLOONG64XORconst, typ.UInt32)
   912  		v4.AuxInt = int64ToAuxInt(0xff)
   913  		v5 := b.NewValue0(v.Pos, OpZeroExt8to32, typ.UInt32)
   914  		v5.AddArg(val)
   915  		v4.AddArg(v5)
   916  		v6 := b.NewValue0(v.Pos, OpLOONG64SLLVconst, typ.UInt64)
   917  		v6.AuxInt = int64ToAuxInt(3)
   918  		v7 := b.NewValue0(v.Pos, OpLOONG64ANDconst, typ.UInt64)
   919  		v7.AuxInt = int64ToAuxInt(3)
   920  		v7.AddArg(ptr)
   921  		v6.AddArg(v7)
   922  		v3.AddArg2(v4, v6)
   923  		v2.AddArg(v3)
   924  		v.AddArg3(v0, v2, mem)
   925  		return true
   926  	}
   927  }
   928  func rewriteValueLOONG64_OpAtomicCompareAndSwap32(v *Value) bool {
   929  	v_3 := v.Args[3]
   930  	v_2 := v.Args[2]
   931  	v_1 := v.Args[1]
   932  	v_0 := v.Args[0]
   933  	b := v.Block
   934  	typ := &b.Func.Config.Types
   935  	// match: (AtomicCompareAndSwap32 ptr old new mem)
   936  	// result: (LoweredAtomicCas32 ptr (SignExt32to64 old) new mem)
   937  	for {
   938  		ptr := v_0
   939  		old := v_1
   940  		new := v_2
   941  		mem := v_3
   942  		v.reset(OpLOONG64LoweredAtomicCas32)
   943  		v0 := b.NewValue0(v.Pos, OpSignExt32to64, typ.Int64)
   944  		v0.AddArg(old)
   945  		v.AddArg4(ptr, v0, new, mem)
   946  		return true
   947  	}
   948  }
   949  func rewriteValueLOONG64_OpAtomicCompareAndSwap32Variant(v *Value) bool {
   950  	v_3 := v.Args[3]
   951  	v_2 := v.Args[2]
   952  	v_1 := v.Args[1]
   953  	v_0 := v.Args[0]
   954  	b := v.Block
   955  	typ := &b.Func.Config.Types
   956  	// match: (AtomicCompareAndSwap32Variant ptr old new mem)
   957  	// result: (LoweredAtomicCas32Variant ptr (SignExt32to64 old) new mem)
   958  	for {
   959  		ptr := v_0
   960  		old := v_1
   961  		new := v_2
   962  		mem := v_3
   963  		v.reset(OpLOONG64LoweredAtomicCas32Variant)
   964  		v0 := b.NewValue0(v.Pos, OpSignExt32to64, typ.Int64)
   965  		v0.AddArg(old)
   966  		v.AddArg4(ptr, v0, new, mem)
   967  		return true
   968  	}
   969  }
   970  func rewriteValueLOONG64_OpAtomicOr8(v *Value) bool {
   971  	v_2 := v.Args[2]
   972  	v_1 := v.Args[1]
   973  	v_0 := v.Args[0]
   974  	b := v.Block
   975  	typ := &b.Func.Config.Types
   976  	// match: (AtomicOr8 ptr val mem)
   977  	// result: (LoweredAtomicOr32 (AND <typ.Uintptr> (MOVVconst [^3]) ptr) (SLLV <typ.UInt32> (ZeroExt8to32 val) (SLLVconst <typ.UInt64> [3] (ANDconst <typ.UInt64> [3] ptr))) mem)
   978  	for {
   979  		ptr := v_0
   980  		val := v_1
   981  		mem := v_2
   982  		v.reset(OpLOONG64LoweredAtomicOr32)
   983  		v0 := b.NewValue0(v.Pos, OpLOONG64AND, typ.Uintptr)
   984  		v1 := b.NewValue0(v.Pos, OpLOONG64MOVVconst, typ.UInt64)
   985  		v1.AuxInt = int64ToAuxInt(^3)
   986  		v0.AddArg2(v1, ptr)
   987  		v2 := b.NewValue0(v.Pos, OpLOONG64SLLV, typ.UInt32)
   988  		v3 := b.NewValue0(v.Pos, OpZeroExt8to32, typ.UInt32)
   989  		v3.AddArg(val)
   990  		v4 := b.NewValue0(v.Pos, OpLOONG64SLLVconst, typ.UInt64)
   991  		v4.AuxInt = int64ToAuxInt(3)
   992  		v5 := b.NewValue0(v.Pos, OpLOONG64ANDconst, typ.UInt64)
   993  		v5.AuxInt = int64ToAuxInt(3)
   994  		v5.AddArg(ptr)
   995  		v4.AddArg(v5)
   996  		v2.AddArg2(v3, v4)
   997  		v.AddArg3(v0, v2, mem)
   998  		return true
   999  	}
  1000  }
  1001  func rewriteValueLOONG64_OpAvg64u(v *Value) bool {
  1002  	v_1 := v.Args[1]
  1003  	v_0 := v.Args[0]
  1004  	b := v.Block
  1005  	// match: (Avg64u <t> x y)
  1006  	// result: (ADDV (SRLVconst <t> (SUBV <t> x y) [1]) y)
  1007  	for {
  1008  		t := v.Type
  1009  		x := v_0
  1010  		y := v_1
  1011  		v.reset(OpLOONG64ADDV)
  1012  		v0 := b.NewValue0(v.Pos, OpLOONG64SRLVconst, t)
  1013  		v0.AuxInt = int64ToAuxInt(1)
  1014  		v1 := b.NewValue0(v.Pos, OpLOONG64SUBV, t)
  1015  		v1.AddArg2(x, y)
  1016  		v0.AddArg(v1)
  1017  		v.AddArg2(v0, y)
  1018  		return true
  1019  	}
  1020  }
  1021  func rewriteValueLOONG64_OpBitLen16(v *Value) bool {
  1022  	v_0 := v.Args[0]
  1023  	b := v.Block
  1024  	typ := &b.Func.Config.Types
  1025  	// match: (BitLen16 x)
  1026  	// result: (BitLen64 (ZeroExt16to64 x))
  1027  	for {
  1028  		x := v_0
  1029  		v.reset(OpBitLen64)
  1030  		v0 := b.NewValue0(v.Pos, OpZeroExt16to64, typ.UInt64)
  1031  		v0.AddArg(x)
  1032  		v.AddArg(v0)
  1033  		return true
  1034  	}
  1035  }
  1036  func rewriteValueLOONG64_OpBitLen32(v *Value) bool {
  1037  	v_0 := v.Args[0]
  1038  	b := v.Block
  1039  	// match: (BitLen32 <t> x)
  1040  	// result: (NEGV <t> (SUBVconst <t> [32] (CLZW <t> x)))
  1041  	for {
  1042  		t := v.Type
  1043  		x := v_0
  1044  		v.reset(OpLOONG64NEGV)
  1045  		v.Type = t
  1046  		v0 := b.NewValue0(v.Pos, OpLOONG64SUBVconst, t)
  1047  		v0.AuxInt = int64ToAuxInt(32)
  1048  		v1 := b.NewValue0(v.Pos, OpLOONG64CLZW, t)
  1049  		v1.AddArg(x)
  1050  		v0.AddArg(v1)
  1051  		v.AddArg(v0)
  1052  		return true
  1053  	}
  1054  }
  1055  func rewriteValueLOONG64_OpBitLen64(v *Value) bool {
  1056  	v_0 := v.Args[0]
  1057  	b := v.Block
  1058  	// match: (BitLen64 <t> x)
  1059  	// result: (NEGV <t> (SUBVconst <t> [64] (CLZV <t> x)))
  1060  	for {
  1061  		t := v.Type
  1062  		x := v_0
  1063  		v.reset(OpLOONG64NEGV)
  1064  		v.Type = t
  1065  		v0 := b.NewValue0(v.Pos, OpLOONG64SUBVconst, t)
  1066  		v0.AuxInt = int64ToAuxInt(64)
  1067  		v1 := b.NewValue0(v.Pos, OpLOONG64CLZV, t)
  1068  		v1.AddArg(x)
  1069  		v0.AddArg(v1)
  1070  		v.AddArg(v0)
  1071  		return true
  1072  	}
  1073  }
  1074  func rewriteValueLOONG64_OpBitLen8(v *Value) bool {
  1075  	v_0 := v.Args[0]
  1076  	b := v.Block
  1077  	typ := &b.Func.Config.Types
  1078  	// match: (BitLen8 x)
  1079  	// result: (BitLen64 (ZeroExt8to64 x))
  1080  	for {
  1081  		x := v_0
  1082  		v.reset(OpBitLen64)
  1083  		v0 := b.NewValue0(v.Pos, OpZeroExt8to64, typ.UInt64)
  1084  		v0.AddArg(x)
  1085  		v.AddArg(v0)
  1086  		return true
  1087  	}
  1088  }
  1089  func rewriteValueLOONG64_OpBitRev16(v *Value) bool {
  1090  	v_0 := v.Args[0]
  1091  	b := v.Block
  1092  	// match: (BitRev16 <t> x)
  1093  	// result: (REVB2H (BITREV4B <t> x))
  1094  	for {
  1095  		t := v.Type
  1096  		x := v_0
  1097  		v.reset(OpLOONG64REVB2H)
  1098  		v0 := b.NewValue0(v.Pos, OpLOONG64BITREV4B, t)
  1099  		v0.AddArg(x)
  1100  		v.AddArg(v0)
  1101  		return true
  1102  	}
  1103  }
  1104  func rewriteValueLOONG64_OpCom16(v *Value) bool {
  1105  	v_0 := v.Args[0]
  1106  	b := v.Block
  1107  	typ := &b.Func.Config.Types
  1108  	// match: (Com16 x)
  1109  	// result: (NOR (MOVVconst [0]) x)
  1110  	for {
  1111  		x := v_0
  1112  		v.reset(OpLOONG64NOR)
  1113  		v0 := b.NewValue0(v.Pos, OpLOONG64MOVVconst, typ.UInt64)
  1114  		v0.AuxInt = int64ToAuxInt(0)
  1115  		v.AddArg2(v0, x)
  1116  		return true
  1117  	}
  1118  }
  1119  func rewriteValueLOONG64_OpCom32(v *Value) bool {
  1120  	v_0 := v.Args[0]
  1121  	b := v.Block
  1122  	typ := &b.Func.Config.Types
  1123  	// match: (Com32 x)
  1124  	// result: (NOR (MOVVconst [0]) x)
  1125  	for {
  1126  		x := v_0
  1127  		v.reset(OpLOONG64NOR)
  1128  		v0 := b.NewValue0(v.Pos, OpLOONG64MOVVconst, typ.UInt64)
  1129  		v0.AuxInt = int64ToAuxInt(0)
  1130  		v.AddArg2(v0, x)
  1131  		return true
  1132  	}
  1133  }
  1134  func rewriteValueLOONG64_OpCom64(v *Value) bool {
  1135  	v_0 := v.Args[0]
  1136  	b := v.Block
  1137  	typ := &b.Func.Config.Types
  1138  	// match: (Com64 x)
  1139  	// result: (NOR (MOVVconst [0]) x)
  1140  	for {
  1141  		x := v_0
  1142  		v.reset(OpLOONG64NOR)
  1143  		v0 := b.NewValue0(v.Pos, OpLOONG64MOVVconst, typ.UInt64)
  1144  		v0.AuxInt = int64ToAuxInt(0)
  1145  		v.AddArg2(v0, x)
  1146  		return true
  1147  	}
  1148  }
  1149  func rewriteValueLOONG64_OpCom8(v *Value) bool {
  1150  	v_0 := v.Args[0]
  1151  	b := v.Block
  1152  	typ := &b.Func.Config.Types
  1153  	// match: (Com8 x)
  1154  	// result: (NOR (MOVVconst [0]) x)
  1155  	for {
  1156  		x := v_0
  1157  		v.reset(OpLOONG64NOR)
  1158  		v0 := b.NewValue0(v.Pos, OpLOONG64MOVVconst, typ.UInt64)
  1159  		v0.AuxInt = int64ToAuxInt(0)
  1160  		v.AddArg2(v0, x)
  1161  		return true
  1162  	}
  1163  }
  1164  func rewriteValueLOONG64_OpCondSelect(v *Value) bool {
  1165  	v_2 := v.Args[2]
  1166  	v_1 := v.Args[1]
  1167  	v_0 := v.Args[0]
  1168  	b := v.Block
  1169  	// match: (CondSelect <t> x y cond)
  1170  	// result: (OR (MASKEQZ <t> x cond) (MASKNEZ <t> y cond))
  1171  	for {
  1172  		t := v.Type
  1173  		x := v_0
  1174  		y := v_1
  1175  		cond := v_2
  1176  		v.reset(OpLOONG64OR)
  1177  		v0 := b.NewValue0(v.Pos, OpLOONG64MASKEQZ, t)
  1178  		v0.AddArg2(x, cond)
  1179  		v1 := b.NewValue0(v.Pos, OpLOONG64MASKNEZ, t)
  1180  		v1.AddArg2(y, cond)
  1181  		v.AddArg2(v0, v1)
  1182  		return true
  1183  	}
  1184  }
  1185  func rewriteValueLOONG64_OpConst16(v *Value) bool {
  1186  	// match: (Const16 [val])
  1187  	// result: (MOVVconst [int64(val)])
  1188  	for {
  1189  		val := auxIntToInt16(v.AuxInt)
  1190  		v.reset(OpLOONG64MOVVconst)
  1191  		v.AuxInt = int64ToAuxInt(int64(val))
  1192  		return true
  1193  	}
  1194  }
  1195  func rewriteValueLOONG64_OpConst32(v *Value) bool {
  1196  	// match: (Const32 [val])
  1197  	// result: (MOVVconst [int64(val)])
  1198  	for {
  1199  		val := auxIntToInt32(v.AuxInt)
  1200  		v.reset(OpLOONG64MOVVconst)
  1201  		v.AuxInt = int64ToAuxInt(int64(val))
  1202  		return true
  1203  	}
  1204  }
  1205  func rewriteValueLOONG64_OpConst32F(v *Value) bool {
  1206  	// match: (Const32F [val])
  1207  	// result: (MOVFconst [float64(val)])
  1208  	for {
  1209  		val := auxIntToFloat32(v.AuxInt)
  1210  		v.reset(OpLOONG64MOVFconst)
  1211  		v.AuxInt = float64ToAuxInt(float64(val))
  1212  		return true
  1213  	}
  1214  }
  1215  func rewriteValueLOONG64_OpConst64(v *Value) bool {
  1216  	// match: (Const64 [val])
  1217  	// result: (MOVVconst [int64(val)])
  1218  	for {
  1219  		val := auxIntToInt64(v.AuxInt)
  1220  		v.reset(OpLOONG64MOVVconst)
  1221  		v.AuxInt = int64ToAuxInt(int64(val))
  1222  		return true
  1223  	}
  1224  }
  1225  func rewriteValueLOONG64_OpConst64F(v *Value) bool {
  1226  	// match: (Const64F [val])
  1227  	// result: (MOVDconst [float64(val)])
  1228  	for {
  1229  		val := auxIntToFloat64(v.AuxInt)
  1230  		v.reset(OpLOONG64MOVDconst)
  1231  		v.AuxInt = float64ToAuxInt(float64(val))
  1232  		return true
  1233  	}
  1234  }
  1235  func rewriteValueLOONG64_OpConst8(v *Value) bool {
  1236  	// match: (Const8 [val])
  1237  	// result: (MOVVconst [int64(val)])
  1238  	for {
  1239  		val := auxIntToInt8(v.AuxInt)
  1240  		v.reset(OpLOONG64MOVVconst)
  1241  		v.AuxInt = int64ToAuxInt(int64(val))
  1242  		return true
  1243  	}
  1244  }
  1245  func rewriteValueLOONG64_OpConstBool(v *Value) bool {
  1246  	// match: (ConstBool [t])
  1247  	// result: (MOVVconst [int64(b2i(t))])
  1248  	for {
  1249  		t := auxIntToBool(v.AuxInt)
  1250  		v.reset(OpLOONG64MOVVconst)
  1251  		v.AuxInt = int64ToAuxInt(int64(b2i(t)))
  1252  		return true
  1253  	}
  1254  }
  1255  func rewriteValueLOONG64_OpConstNil(v *Value) bool {
  1256  	// match: (ConstNil)
  1257  	// result: (MOVVconst [0])
  1258  	for {
  1259  		v.reset(OpLOONG64MOVVconst)
  1260  		v.AuxInt = int64ToAuxInt(0)
  1261  		return true
  1262  	}
  1263  }
  1264  func rewriteValueLOONG64_OpCtz16(v *Value) bool {
  1265  	v_0 := v.Args[0]
  1266  	b := v.Block
  1267  	typ := &b.Func.Config.Types
  1268  	// match: (Ctz16 x)
  1269  	// result: (CTZV (OR <typ.UInt64> x (MOVVconst [1<<16])))
  1270  	for {
  1271  		x := v_0
  1272  		v.reset(OpLOONG64CTZV)
  1273  		v0 := b.NewValue0(v.Pos, OpLOONG64OR, typ.UInt64)
  1274  		v1 := b.NewValue0(v.Pos, OpLOONG64MOVVconst, typ.UInt64)
  1275  		v1.AuxInt = int64ToAuxInt(1 << 16)
  1276  		v0.AddArg2(x, v1)
  1277  		v.AddArg(v0)
  1278  		return true
  1279  	}
  1280  }
  1281  func rewriteValueLOONG64_OpCtz8(v *Value) bool {
  1282  	v_0 := v.Args[0]
  1283  	b := v.Block
  1284  	typ := &b.Func.Config.Types
  1285  	// match: (Ctz8 x)
  1286  	// result: (CTZV (OR <typ.UInt64> x (MOVVconst [1<<8])))
  1287  	for {
  1288  		x := v_0
  1289  		v.reset(OpLOONG64CTZV)
  1290  		v0 := b.NewValue0(v.Pos, OpLOONG64OR, typ.UInt64)
  1291  		v1 := b.NewValue0(v.Pos, OpLOONG64MOVVconst, typ.UInt64)
  1292  		v1.AuxInt = int64ToAuxInt(1 << 8)
  1293  		v0.AddArg2(x, v1)
  1294  		v.AddArg(v0)
  1295  		return true
  1296  	}
  1297  }
  1298  func rewriteValueLOONG64_OpDiv16(v *Value) bool {
  1299  	v_1 := v.Args[1]
  1300  	v_0 := v.Args[0]
  1301  	b := v.Block
  1302  	typ := &b.Func.Config.Types
  1303  	// match: (Div16 x y)
  1304  	// result: (DIVV (SignExt16to64 x) (SignExt16to64 y))
  1305  	for {
  1306  		x := v_0
  1307  		y := v_1
  1308  		v.reset(OpLOONG64DIVV)
  1309  		v0 := b.NewValue0(v.Pos, OpSignExt16to64, typ.Int64)
  1310  		v0.AddArg(x)
  1311  		v1 := b.NewValue0(v.Pos, OpSignExt16to64, typ.Int64)
  1312  		v1.AddArg(y)
  1313  		v.AddArg2(v0, v1)
  1314  		return true
  1315  	}
  1316  }
  1317  func rewriteValueLOONG64_OpDiv16u(v *Value) bool {
  1318  	v_1 := v.Args[1]
  1319  	v_0 := v.Args[0]
  1320  	b := v.Block
  1321  	typ := &b.Func.Config.Types
  1322  	// match: (Div16u x y)
  1323  	// result: (DIVVU (ZeroExt16to64 x) (ZeroExt16to64 y))
  1324  	for {
  1325  		x := v_0
  1326  		y := v_1
  1327  		v.reset(OpLOONG64DIVVU)
  1328  		v0 := b.NewValue0(v.Pos, OpZeroExt16to64, typ.UInt64)
  1329  		v0.AddArg(x)
  1330  		v1 := b.NewValue0(v.Pos, OpZeroExt16to64, typ.UInt64)
  1331  		v1.AddArg(y)
  1332  		v.AddArg2(v0, v1)
  1333  		return true
  1334  	}
  1335  }
  1336  func rewriteValueLOONG64_OpDiv32(v *Value) bool {
  1337  	v_1 := v.Args[1]
  1338  	v_0 := v.Args[0]
  1339  	b := v.Block
  1340  	typ := &b.Func.Config.Types
  1341  	// match: (Div32 x y)
  1342  	// result: (DIVV (SignExt32to64 x) (SignExt32to64 y))
  1343  	for {
  1344  		x := v_0
  1345  		y := v_1
  1346  		v.reset(OpLOONG64DIVV)
  1347  		v0 := b.NewValue0(v.Pos, OpSignExt32to64, typ.Int64)
  1348  		v0.AddArg(x)
  1349  		v1 := b.NewValue0(v.Pos, OpSignExt32to64, typ.Int64)
  1350  		v1.AddArg(y)
  1351  		v.AddArg2(v0, v1)
  1352  		return true
  1353  	}
  1354  }
  1355  func rewriteValueLOONG64_OpDiv32u(v *Value) bool {
  1356  	v_1 := v.Args[1]
  1357  	v_0 := v.Args[0]
  1358  	b := v.Block
  1359  	typ := &b.Func.Config.Types
  1360  	// match: (Div32u x y)
  1361  	// result: (DIVVU (ZeroExt32to64 x) (ZeroExt32to64 y))
  1362  	for {
  1363  		x := v_0
  1364  		y := v_1
  1365  		v.reset(OpLOONG64DIVVU)
  1366  		v0 := b.NewValue0(v.Pos, OpZeroExt32to64, typ.UInt64)
  1367  		v0.AddArg(x)
  1368  		v1 := b.NewValue0(v.Pos, OpZeroExt32to64, typ.UInt64)
  1369  		v1.AddArg(y)
  1370  		v.AddArg2(v0, v1)
  1371  		return true
  1372  	}
  1373  }
  1374  func rewriteValueLOONG64_OpDiv64(v *Value) bool {
  1375  	v_1 := v.Args[1]
  1376  	v_0 := v.Args[0]
  1377  	// match: (Div64 x y)
  1378  	// result: (DIVV x y)
  1379  	for {
  1380  		x := v_0
  1381  		y := v_1
  1382  		v.reset(OpLOONG64DIVV)
  1383  		v.AddArg2(x, y)
  1384  		return true
  1385  	}
  1386  }
  1387  func rewriteValueLOONG64_OpDiv8(v *Value) bool {
  1388  	v_1 := v.Args[1]
  1389  	v_0 := v.Args[0]
  1390  	b := v.Block
  1391  	typ := &b.Func.Config.Types
  1392  	// match: (Div8 x y)
  1393  	// result: (DIVV (SignExt8to64 x) (SignExt8to64 y))
  1394  	for {
  1395  		x := v_0
  1396  		y := v_1
  1397  		v.reset(OpLOONG64DIVV)
  1398  		v0 := b.NewValue0(v.Pos, OpSignExt8to64, typ.Int64)
  1399  		v0.AddArg(x)
  1400  		v1 := b.NewValue0(v.Pos, OpSignExt8to64, typ.Int64)
  1401  		v1.AddArg(y)
  1402  		v.AddArg2(v0, v1)
  1403  		return true
  1404  	}
  1405  }
  1406  func rewriteValueLOONG64_OpDiv8u(v *Value) bool {
  1407  	v_1 := v.Args[1]
  1408  	v_0 := v.Args[0]
  1409  	b := v.Block
  1410  	typ := &b.Func.Config.Types
  1411  	// match: (Div8u x y)
  1412  	// result: (DIVVU (ZeroExt8to64 x) (ZeroExt8to64 y))
  1413  	for {
  1414  		x := v_0
  1415  		y := v_1
  1416  		v.reset(OpLOONG64DIVVU)
  1417  		v0 := b.NewValue0(v.Pos, OpZeroExt8to64, typ.UInt64)
  1418  		v0.AddArg(x)
  1419  		v1 := b.NewValue0(v.Pos, OpZeroExt8to64, typ.UInt64)
  1420  		v1.AddArg(y)
  1421  		v.AddArg2(v0, v1)
  1422  		return true
  1423  	}
  1424  }
  1425  func rewriteValueLOONG64_OpEq16(v *Value) bool {
  1426  	v_1 := v.Args[1]
  1427  	v_0 := v.Args[0]
  1428  	b := v.Block
  1429  	typ := &b.Func.Config.Types
  1430  	// match: (Eq16 x y)
  1431  	// result: (SGTU (MOVVconst [1]) (XOR (ZeroExt16to64 x) (ZeroExt16to64 y)))
  1432  	for {
  1433  		x := v_0
  1434  		y := v_1
  1435  		v.reset(OpLOONG64SGTU)
  1436  		v0 := b.NewValue0(v.Pos, OpLOONG64MOVVconst, typ.UInt64)
  1437  		v0.AuxInt = int64ToAuxInt(1)
  1438  		v1 := b.NewValue0(v.Pos, OpLOONG64XOR, typ.UInt64)
  1439  		v2 := b.NewValue0(v.Pos, OpZeroExt16to64, typ.UInt64)
  1440  		v2.AddArg(x)
  1441  		v3 := b.NewValue0(v.Pos, OpZeroExt16to64, typ.UInt64)
  1442  		v3.AddArg(y)
  1443  		v1.AddArg2(v2, v3)
  1444  		v.AddArg2(v0, v1)
  1445  		return true
  1446  	}
  1447  }
  1448  func rewriteValueLOONG64_OpEq32(v *Value) bool {
  1449  	v_1 := v.Args[1]
  1450  	v_0 := v.Args[0]
  1451  	b := v.Block
  1452  	typ := &b.Func.Config.Types
  1453  	// match: (Eq32 x y)
  1454  	// result: (SGTU (MOVVconst [1]) (XOR (ZeroExt32to64 x) (ZeroExt32to64 y)))
  1455  	for {
  1456  		x := v_0
  1457  		y := v_1
  1458  		v.reset(OpLOONG64SGTU)
  1459  		v0 := b.NewValue0(v.Pos, OpLOONG64MOVVconst, typ.UInt64)
  1460  		v0.AuxInt = int64ToAuxInt(1)
  1461  		v1 := b.NewValue0(v.Pos, OpLOONG64XOR, typ.UInt64)
  1462  		v2 := b.NewValue0(v.Pos, OpZeroExt32to64, typ.UInt64)
  1463  		v2.AddArg(x)
  1464  		v3 := b.NewValue0(v.Pos, OpZeroExt32to64, typ.UInt64)
  1465  		v3.AddArg(y)
  1466  		v1.AddArg2(v2, v3)
  1467  		v.AddArg2(v0, v1)
  1468  		return true
  1469  	}
  1470  }
  1471  func rewriteValueLOONG64_OpEq32F(v *Value) bool {
  1472  	v_1 := v.Args[1]
  1473  	v_0 := v.Args[0]
  1474  	b := v.Block
  1475  	// match: (Eq32F x y)
  1476  	// result: (FPFlagTrue (CMPEQF x y))
  1477  	for {
  1478  		x := v_0
  1479  		y := v_1
  1480  		v.reset(OpLOONG64FPFlagTrue)
  1481  		v0 := b.NewValue0(v.Pos, OpLOONG64CMPEQF, types.TypeFlags)
  1482  		v0.AddArg2(x, y)
  1483  		v.AddArg(v0)
  1484  		return true
  1485  	}
  1486  }
  1487  func rewriteValueLOONG64_OpEq64(v *Value) bool {
  1488  	v_1 := v.Args[1]
  1489  	v_0 := v.Args[0]
  1490  	b := v.Block
  1491  	typ := &b.Func.Config.Types
  1492  	// match: (Eq64 x y)
  1493  	// result: (SGTU (MOVVconst [1]) (XOR x y))
  1494  	for {
  1495  		x := v_0
  1496  		y := v_1
  1497  		v.reset(OpLOONG64SGTU)
  1498  		v0 := b.NewValue0(v.Pos, OpLOONG64MOVVconst, typ.UInt64)
  1499  		v0.AuxInt = int64ToAuxInt(1)
  1500  		v1 := b.NewValue0(v.Pos, OpLOONG64XOR, typ.UInt64)
  1501  		v1.AddArg2(x, y)
  1502  		v.AddArg2(v0, v1)
  1503  		return true
  1504  	}
  1505  }
  1506  func rewriteValueLOONG64_OpEq64F(v *Value) bool {
  1507  	v_1 := v.Args[1]
  1508  	v_0 := v.Args[0]
  1509  	b := v.Block
  1510  	// match: (Eq64F x y)
  1511  	// result: (FPFlagTrue (CMPEQD x y))
  1512  	for {
  1513  		x := v_0
  1514  		y := v_1
  1515  		v.reset(OpLOONG64FPFlagTrue)
  1516  		v0 := b.NewValue0(v.Pos, OpLOONG64CMPEQD, types.TypeFlags)
  1517  		v0.AddArg2(x, y)
  1518  		v.AddArg(v0)
  1519  		return true
  1520  	}
  1521  }
  1522  func rewriteValueLOONG64_OpEq8(v *Value) bool {
  1523  	v_1 := v.Args[1]
  1524  	v_0 := v.Args[0]
  1525  	b := v.Block
  1526  	typ := &b.Func.Config.Types
  1527  	// match: (Eq8 x y)
  1528  	// result: (SGTU (MOVVconst [1]) (XOR (ZeroExt8to64 x) (ZeroExt8to64 y)))
  1529  	for {
  1530  		x := v_0
  1531  		y := v_1
  1532  		v.reset(OpLOONG64SGTU)
  1533  		v0 := b.NewValue0(v.Pos, OpLOONG64MOVVconst, typ.UInt64)
  1534  		v0.AuxInt = int64ToAuxInt(1)
  1535  		v1 := b.NewValue0(v.Pos, OpLOONG64XOR, typ.UInt64)
  1536  		v2 := b.NewValue0(v.Pos, OpZeroExt8to64, typ.UInt64)
  1537  		v2.AddArg(x)
  1538  		v3 := b.NewValue0(v.Pos, OpZeroExt8to64, typ.UInt64)
  1539  		v3.AddArg(y)
  1540  		v1.AddArg2(v2, v3)
  1541  		v.AddArg2(v0, v1)
  1542  		return true
  1543  	}
  1544  }
  1545  func rewriteValueLOONG64_OpEqB(v *Value) bool {
  1546  	v_1 := v.Args[1]
  1547  	v_0 := v.Args[0]
  1548  	b := v.Block
  1549  	typ := &b.Func.Config.Types
  1550  	// match: (EqB x y)
  1551  	// result: (XOR (MOVVconst [1]) (XOR <typ.Bool> x y))
  1552  	for {
  1553  		x := v_0
  1554  		y := v_1
  1555  		v.reset(OpLOONG64XOR)
  1556  		v0 := b.NewValue0(v.Pos, OpLOONG64MOVVconst, typ.UInt64)
  1557  		v0.AuxInt = int64ToAuxInt(1)
  1558  		v1 := b.NewValue0(v.Pos, OpLOONG64XOR, typ.Bool)
  1559  		v1.AddArg2(x, y)
  1560  		v.AddArg2(v0, v1)
  1561  		return true
  1562  	}
  1563  }
  1564  func rewriteValueLOONG64_OpEqPtr(v *Value) bool {
  1565  	v_1 := v.Args[1]
  1566  	v_0 := v.Args[0]
  1567  	b := v.Block
  1568  	typ := &b.Func.Config.Types
  1569  	// match: (EqPtr x y)
  1570  	// result: (SGTU (MOVVconst [1]) (XOR x y))
  1571  	for {
  1572  		x := v_0
  1573  		y := v_1
  1574  		v.reset(OpLOONG64SGTU)
  1575  		v0 := b.NewValue0(v.Pos, OpLOONG64MOVVconst, typ.UInt64)
  1576  		v0.AuxInt = int64ToAuxInt(1)
  1577  		v1 := b.NewValue0(v.Pos, OpLOONG64XOR, typ.UInt64)
  1578  		v1.AddArg2(x, y)
  1579  		v.AddArg2(v0, v1)
  1580  		return true
  1581  	}
  1582  }
  1583  func rewriteValueLOONG64_OpIsInBounds(v *Value) bool {
  1584  	v_1 := v.Args[1]
  1585  	v_0 := v.Args[0]
  1586  	// match: (IsInBounds idx len)
  1587  	// result: (SGTU len idx)
  1588  	for {
  1589  		idx := v_0
  1590  		len := v_1
  1591  		v.reset(OpLOONG64SGTU)
  1592  		v.AddArg2(len, idx)
  1593  		return true
  1594  	}
  1595  }
  1596  func rewriteValueLOONG64_OpIsNonNil(v *Value) bool {
  1597  	v_0 := v.Args[0]
  1598  	b := v.Block
  1599  	typ := &b.Func.Config.Types
  1600  	// match: (IsNonNil ptr)
  1601  	// result: (SGTU ptr (MOVVconst [0]))
  1602  	for {
  1603  		ptr := v_0
  1604  		v.reset(OpLOONG64SGTU)
  1605  		v0 := b.NewValue0(v.Pos, OpLOONG64MOVVconst, typ.UInt64)
  1606  		v0.AuxInt = int64ToAuxInt(0)
  1607  		v.AddArg2(ptr, v0)
  1608  		return true
  1609  	}
  1610  }
  1611  func rewriteValueLOONG64_OpIsSliceInBounds(v *Value) bool {
  1612  	v_1 := v.Args[1]
  1613  	v_0 := v.Args[0]
  1614  	b := v.Block
  1615  	typ := &b.Func.Config.Types
  1616  	// match: (IsSliceInBounds idx len)
  1617  	// result: (XOR (MOVVconst [1]) (SGTU idx len))
  1618  	for {
  1619  		idx := v_0
  1620  		len := v_1
  1621  		v.reset(OpLOONG64XOR)
  1622  		v0 := b.NewValue0(v.Pos, OpLOONG64MOVVconst, typ.UInt64)
  1623  		v0.AuxInt = int64ToAuxInt(1)
  1624  		v1 := b.NewValue0(v.Pos, OpLOONG64SGTU, typ.Bool)
  1625  		v1.AddArg2(idx, len)
  1626  		v.AddArg2(v0, v1)
  1627  		return true
  1628  	}
  1629  }
  1630  func rewriteValueLOONG64_OpLOONG64ADDD(v *Value) bool {
  1631  	v_1 := v.Args[1]
  1632  	v_0 := v.Args[0]
  1633  	// match: (ADDD (MULD x y) z)
  1634  	// cond: z.Block.Func.useFMA(v)
  1635  	// result: (FMADDD x y z)
  1636  	for {
  1637  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
  1638  			if v_0.Op != OpLOONG64MULD {
  1639  				continue
  1640  			}
  1641  			y := v_0.Args[1]
  1642  			x := v_0.Args[0]
  1643  			z := v_1
  1644  			if !(z.Block.Func.useFMA(v)) {
  1645  				continue
  1646  			}
  1647  			v.reset(OpLOONG64FMADDD)
  1648  			v.AddArg3(x, y, z)
  1649  			return true
  1650  		}
  1651  		break
  1652  	}
  1653  	// match: (ADDD z (NEGD (MULD x y)))
  1654  	// cond: z.Block.Func.useFMA(v)
  1655  	// result: (FNMSUBD x y z)
  1656  	for {
  1657  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
  1658  			z := v_0
  1659  			if v_1.Op != OpLOONG64NEGD {
  1660  				continue
  1661  			}
  1662  			v_1_0 := v_1.Args[0]
  1663  			if v_1_0.Op != OpLOONG64MULD {
  1664  				continue
  1665  			}
  1666  			y := v_1_0.Args[1]
  1667  			x := v_1_0.Args[0]
  1668  			if !(z.Block.Func.useFMA(v)) {
  1669  				continue
  1670  			}
  1671  			v.reset(OpLOONG64FNMSUBD)
  1672  			v.AddArg3(x, y, z)
  1673  			return true
  1674  		}
  1675  		break
  1676  	}
  1677  	return false
  1678  }
  1679  func rewriteValueLOONG64_OpLOONG64ADDF(v *Value) bool {
  1680  	v_1 := v.Args[1]
  1681  	v_0 := v.Args[0]
  1682  	// match: (ADDF (MULF x y) z)
  1683  	// cond: z.Block.Func.useFMA(v)
  1684  	// result: (FMADDF x y z)
  1685  	for {
  1686  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
  1687  			if v_0.Op != OpLOONG64MULF {
  1688  				continue
  1689  			}
  1690  			y := v_0.Args[1]
  1691  			x := v_0.Args[0]
  1692  			z := v_1
  1693  			if !(z.Block.Func.useFMA(v)) {
  1694  				continue
  1695  			}
  1696  			v.reset(OpLOONG64FMADDF)
  1697  			v.AddArg3(x, y, z)
  1698  			return true
  1699  		}
  1700  		break
  1701  	}
  1702  	// match: (ADDF z (NEGF (MULF x y)))
  1703  	// cond: z.Block.Func.useFMA(v)
  1704  	// result: (FNMSUBF x y z)
  1705  	for {
  1706  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
  1707  			z := v_0
  1708  			if v_1.Op != OpLOONG64NEGF {
  1709  				continue
  1710  			}
  1711  			v_1_0 := v_1.Args[0]
  1712  			if v_1_0.Op != OpLOONG64MULF {
  1713  				continue
  1714  			}
  1715  			y := v_1_0.Args[1]
  1716  			x := v_1_0.Args[0]
  1717  			if !(z.Block.Func.useFMA(v)) {
  1718  				continue
  1719  			}
  1720  			v.reset(OpLOONG64FNMSUBF)
  1721  			v.AddArg3(x, y, z)
  1722  			return true
  1723  		}
  1724  		break
  1725  	}
  1726  	return false
  1727  }
  1728  func rewriteValueLOONG64_OpLOONG64ADDV(v *Value) bool {
  1729  	v_1 := v.Args[1]
  1730  	v_0 := v.Args[0]
  1731  	b := v.Block
  1732  	typ := &b.Func.Config.Types
  1733  	// match: (ADDV <typ.UInt16> (SRLVconst [8] <typ.UInt16> x) (SLLVconst [8] <typ.UInt16> x))
  1734  	// result: (REVB2H x)
  1735  	for {
  1736  		if v.Type != typ.UInt16 {
  1737  			break
  1738  		}
  1739  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
  1740  			if v_0.Op != OpLOONG64SRLVconst || v_0.Type != typ.UInt16 || auxIntToInt64(v_0.AuxInt) != 8 {
  1741  				continue
  1742  			}
  1743  			x := v_0.Args[0]
  1744  			if v_1.Op != OpLOONG64SLLVconst || v_1.Type != typ.UInt16 || auxIntToInt64(v_1.AuxInt) != 8 || x != v_1.Args[0] {
  1745  				continue
  1746  			}
  1747  			v.reset(OpLOONG64REVB2H)
  1748  			v.AddArg(x)
  1749  			return true
  1750  		}
  1751  		break
  1752  	}
  1753  	// match: (ADDV (SRLconst [8] (ANDconst [c1] x)) (SLLconst [8] (ANDconst [c2] x)))
  1754  	// cond: uint32(c1) == 0xff00ff00 && uint32(c2) == 0x00ff00ff
  1755  	// result: (REVB2H x)
  1756  	for {
  1757  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
  1758  			if v_0.Op != OpLOONG64SRLconst || auxIntToInt64(v_0.AuxInt) != 8 {
  1759  				continue
  1760  			}
  1761  			v_0_0 := v_0.Args[0]
  1762  			if v_0_0.Op != OpLOONG64ANDconst {
  1763  				continue
  1764  			}
  1765  			c1 := auxIntToInt64(v_0_0.AuxInt)
  1766  			x := v_0_0.Args[0]
  1767  			if v_1.Op != OpLOONG64SLLconst || auxIntToInt64(v_1.AuxInt) != 8 {
  1768  				continue
  1769  			}
  1770  			v_1_0 := v_1.Args[0]
  1771  			if v_1_0.Op != OpLOONG64ANDconst {
  1772  				continue
  1773  			}
  1774  			c2 := auxIntToInt64(v_1_0.AuxInt)
  1775  			if x != v_1_0.Args[0] || !(uint32(c1) == 0xff00ff00 && uint32(c2) == 0x00ff00ff) {
  1776  				continue
  1777  			}
  1778  			v.reset(OpLOONG64REVB2H)
  1779  			v.AddArg(x)
  1780  			return true
  1781  		}
  1782  		break
  1783  	}
  1784  	// match: (ADDV (SRLVconst [8] (AND (MOVVconst [c1]) x)) (SLLVconst [8] (AND (MOVVconst [c2]) x)))
  1785  	// cond: uint64(c1) == 0xff00ff00ff00ff00 && uint64(c2) == 0x00ff00ff00ff00ff
  1786  	// result: (REVB4H x)
  1787  	for {
  1788  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
  1789  			if v_0.Op != OpLOONG64SRLVconst || auxIntToInt64(v_0.AuxInt) != 8 {
  1790  				continue
  1791  			}
  1792  			v_0_0 := v_0.Args[0]
  1793  			if v_0_0.Op != OpLOONG64AND {
  1794  				continue
  1795  			}
  1796  			_ = v_0_0.Args[1]
  1797  			v_0_0_0 := v_0_0.Args[0]
  1798  			v_0_0_1 := v_0_0.Args[1]
  1799  			for _i1 := 0; _i1 <= 1; _i1, v_0_0_0, v_0_0_1 = _i1+1, v_0_0_1, v_0_0_0 {
  1800  				if v_0_0_0.Op != OpLOONG64MOVVconst {
  1801  					continue
  1802  				}
  1803  				c1 := auxIntToInt64(v_0_0_0.AuxInt)
  1804  				x := v_0_0_1
  1805  				if v_1.Op != OpLOONG64SLLVconst || auxIntToInt64(v_1.AuxInt) != 8 {
  1806  					continue
  1807  				}
  1808  				v_1_0 := v_1.Args[0]
  1809  				if v_1_0.Op != OpLOONG64AND {
  1810  					continue
  1811  				}
  1812  				_ = v_1_0.Args[1]
  1813  				v_1_0_0 := v_1_0.Args[0]
  1814  				v_1_0_1 := v_1_0.Args[1]
  1815  				for _i2 := 0; _i2 <= 1; _i2, v_1_0_0, v_1_0_1 = _i2+1, v_1_0_1, v_1_0_0 {
  1816  					if v_1_0_0.Op != OpLOONG64MOVVconst {
  1817  						continue
  1818  					}
  1819  					c2 := auxIntToInt64(v_1_0_0.AuxInt)
  1820  					if x != v_1_0_1 || !(uint64(c1) == 0xff00ff00ff00ff00 && uint64(c2) == 0x00ff00ff00ff00ff) {
  1821  						continue
  1822  					}
  1823  					v.reset(OpLOONG64REVB4H)
  1824  					v.AddArg(x)
  1825  					return true
  1826  				}
  1827  			}
  1828  		}
  1829  		break
  1830  	}
  1831  	// match: (ADDV (SRLVconst [8] (AND (MOVVconst [c1]) x)) (SLLVconst [8] (ANDconst [c2] x)))
  1832  	// cond: uint64(c1) == 0xff00ff00 && uint64(c2) == 0x00ff00ff
  1833  	// result: (REVB4H (ANDconst <x.Type> [0xffffffff] x))
  1834  	for {
  1835  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
  1836  			if v_0.Op != OpLOONG64SRLVconst || auxIntToInt64(v_0.AuxInt) != 8 {
  1837  				continue
  1838  			}
  1839  			v_0_0 := v_0.Args[0]
  1840  			if v_0_0.Op != OpLOONG64AND {
  1841  				continue
  1842  			}
  1843  			_ = v_0_0.Args[1]
  1844  			v_0_0_0 := v_0_0.Args[0]
  1845  			v_0_0_1 := v_0_0.Args[1]
  1846  			for _i1 := 0; _i1 <= 1; _i1, v_0_0_0, v_0_0_1 = _i1+1, v_0_0_1, v_0_0_0 {
  1847  				if v_0_0_0.Op != OpLOONG64MOVVconst {
  1848  					continue
  1849  				}
  1850  				c1 := auxIntToInt64(v_0_0_0.AuxInt)
  1851  				x := v_0_0_1
  1852  				if v_1.Op != OpLOONG64SLLVconst || auxIntToInt64(v_1.AuxInt) != 8 {
  1853  					continue
  1854  				}
  1855  				v_1_0 := v_1.Args[0]
  1856  				if v_1_0.Op != OpLOONG64ANDconst {
  1857  					continue
  1858  				}
  1859  				c2 := auxIntToInt64(v_1_0.AuxInt)
  1860  				if x != v_1_0.Args[0] || !(uint64(c1) == 0xff00ff00 && uint64(c2) == 0x00ff00ff) {
  1861  					continue
  1862  				}
  1863  				v.reset(OpLOONG64REVB4H)
  1864  				v0 := b.NewValue0(v.Pos, OpLOONG64ANDconst, x.Type)
  1865  				v0.AuxInt = int64ToAuxInt(0xffffffff)
  1866  				v0.AddArg(x)
  1867  				v.AddArg(v0)
  1868  				return true
  1869  			}
  1870  		}
  1871  		break
  1872  	}
  1873  	// match: (ADDV x (MOVVconst <t> [c]))
  1874  	// cond: is32Bit(c) && !t.IsPtr()
  1875  	// result: (ADDVconst [c] x)
  1876  	for {
  1877  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
  1878  			x := v_0
  1879  			if v_1.Op != OpLOONG64MOVVconst {
  1880  				continue
  1881  			}
  1882  			t := v_1.Type
  1883  			c := auxIntToInt64(v_1.AuxInt)
  1884  			if !(is32Bit(c) && !t.IsPtr()) {
  1885  				continue
  1886  			}
  1887  			v.reset(OpLOONG64ADDVconst)
  1888  			v.AuxInt = int64ToAuxInt(c)
  1889  			v.AddArg(x)
  1890  			return true
  1891  		}
  1892  		break
  1893  	}
  1894  	// match: (ADDV x0 x1:(SLLVconst [c] y))
  1895  	// cond: x1.Uses == 1 && c > 0 && c <= 4
  1896  	// result: (ADDshiftLLV x0 y [c])
  1897  	for {
  1898  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
  1899  			x0 := v_0
  1900  			x1 := v_1
  1901  			if x1.Op != OpLOONG64SLLVconst {
  1902  				continue
  1903  			}
  1904  			c := auxIntToInt64(x1.AuxInt)
  1905  			y := x1.Args[0]
  1906  			if !(x1.Uses == 1 && c > 0 && c <= 4) {
  1907  				continue
  1908  			}
  1909  			v.reset(OpLOONG64ADDshiftLLV)
  1910  			v.AuxInt = int64ToAuxInt(c)
  1911  			v.AddArg2(x0, y)
  1912  			return true
  1913  		}
  1914  		break
  1915  	}
  1916  	// match: (ADDV x (NEGV y))
  1917  	// result: (SUBV x y)
  1918  	for {
  1919  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
  1920  			x := v_0
  1921  			if v_1.Op != OpLOONG64NEGV {
  1922  				continue
  1923  			}
  1924  			y := v_1.Args[0]
  1925  			v.reset(OpLOONG64SUBV)
  1926  			v.AddArg2(x, y)
  1927  			return true
  1928  		}
  1929  		break
  1930  	}
  1931  	return false
  1932  }
  1933  func rewriteValueLOONG64_OpLOONG64ADDVconst(v *Value) bool {
  1934  	v_0 := v.Args[0]
  1935  	// match: (ADDVconst [off1] (MOVVaddr [off2] {sym} ptr))
  1936  	// cond: is32Bit(off1+int64(off2))
  1937  	// result: (MOVVaddr [int32(off1)+int32(off2)] {sym} ptr)
  1938  	for {
  1939  		off1 := auxIntToInt64(v.AuxInt)
  1940  		if v_0.Op != OpLOONG64MOVVaddr {
  1941  			break
  1942  		}
  1943  		off2 := auxIntToInt32(v_0.AuxInt)
  1944  		sym := auxToSym(v_0.Aux)
  1945  		ptr := v_0.Args[0]
  1946  		if !(is32Bit(off1 + int64(off2))) {
  1947  			break
  1948  		}
  1949  		v.reset(OpLOONG64MOVVaddr)
  1950  		v.AuxInt = int32ToAuxInt(int32(off1) + int32(off2))
  1951  		v.Aux = symToAux(sym)
  1952  		v.AddArg(ptr)
  1953  		return true
  1954  	}
  1955  	// match: (ADDVconst [0] x)
  1956  	// result: x
  1957  	for {
  1958  		if auxIntToInt64(v.AuxInt) != 0 {
  1959  			break
  1960  		}
  1961  		x := v_0
  1962  		v.copyOf(x)
  1963  		return true
  1964  	}
  1965  	// match: (ADDVconst [c] (MOVVconst [d]))
  1966  	// result: (MOVVconst [c+d])
  1967  	for {
  1968  		c := auxIntToInt64(v.AuxInt)
  1969  		if v_0.Op != OpLOONG64MOVVconst {
  1970  			break
  1971  		}
  1972  		d := auxIntToInt64(v_0.AuxInt)
  1973  		v.reset(OpLOONG64MOVVconst)
  1974  		v.AuxInt = int64ToAuxInt(c + d)
  1975  		return true
  1976  	}
  1977  	// match: (ADDVconst [c] (ADDVconst [d] x))
  1978  	// cond: is32Bit(c+d)
  1979  	// result: (ADDVconst [c+d] x)
  1980  	for {
  1981  		c := auxIntToInt64(v.AuxInt)
  1982  		if v_0.Op != OpLOONG64ADDVconst {
  1983  			break
  1984  		}
  1985  		d := auxIntToInt64(v_0.AuxInt)
  1986  		x := v_0.Args[0]
  1987  		if !(is32Bit(c + d)) {
  1988  			break
  1989  		}
  1990  		v.reset(OpLOONG64ADDVconst)
  1991  		v.AuxInt = int64ToAuxInt(c + d)
  1992  		v.AddArg(x)
  1993  		return true
  1994  	}
  1995  	// match: (ADDVconst [c] (SUBVconst [d] x))
  1996  	// cond: is32Bit(c-d)
  1997  	// result: (ADDVconst [c-d] x)
  1998  	for {
  1999  		c := auxIntToInt64(v.AuxInt)
  2000  		if v_0.Op != OpLOONG64SUBVconst {
  2001  			break
  2002  		}
  2003  		d := auxIntToInt64(v_0.AuxInt)
  2004  		x := v_0.Args[0]
  2005  		if !(is32Bit(c - d)) {
  2006  			break
  2007  		}
  2008  		v.reset(OpLOONG64ADDVconst)
  2009  		v.AuxInt = int64ToAuxInt(c - d)
  2010  		v.AddArg(x)
  2011  		return true
  2012  	}
  2013  	// match: (ADDVconst [c] x)
  2014  	// cond: is32Bit(c) && c&0xffff == 0 && c != 0
  2015  	// result: (ADDV16const [c] x)
  2016  	for {
  2017  		c := auxIntToInt64(v.AuxInt)
  2018  		x := v_0
  2019  		if !(is32Bit(c) && c&0xffff == 0 && c != 0) {
  2020  			break
  2021  		}
  2022  		v.reset(OpLOONG64ADDV16const)
  2023  		v.AuxInt = int64ToAuxInt(c)
  2024  		v.AddArg(x)
  2025  		return true
  2026  	}
  2027  	return false
  2028  }
  2029  func rewriteValueLOONG64_OpLOONG64ADDshiftLLV(v *Value) bool {
  2030  	v_1 := v.Args[1]
  2031  	v_0 := v.Args[0]
  2032  	// match: (ADDshiftLLV x (MOVVconst [c]) [d])
  2033  	// cond: is12Bit(c<<d)
  2034  	// result: (ADDVconst x [c<<d])
  2035  	for {
  2036  		d := auxIntToInt64(v.AuxInt)
  2037  		x := v_0
  2038  		if v_1.Op != OpLOONG64MOVVconst {
  2039  			break
  2040  		}
  2041  		c := auxIntToInt64(v_1.AuxInt)
  2042  		if !(is12Bit(c << d)) {
  2043  			break
  2044  		}
  2045  		v.reset(OpLOONG64ADDVconst)
  2046  		v.AuxInt = int64ToAuxInt(c << d)
  2047  		v.AddArg(x)
  2048  		return true
  2049  	}
  2050  	return false
  2051  }
  2052  func rewriteValueLOONG64_OpLOONG64AND(v *Value) bool {
  2053  	v_1 := v.Args[1]
  2054  	v_0 := v.Args[0]
  2055  	// match: (AND x (MOVVconst [c]))
  2056  	// cond: is32Bit(c)
  2057  	// result: (ANDconst [c] x)
  2058  	for {
  2059  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
  2060  			x := v_0
  2061  			if v_1.Op != OpLOONG64MOVVconst {
  2062  				continue
  2063  			}
  2064  			c := auxIntToInt64(v_1.AuxInt)
  2065  			if !(is32Bit(c)) {
  2066  				continue
  2067  			}
  2068  			v.reset(OpLOONG64ANDconst)
  2069  			v.AuxInt = int64ToAuxInt(c)
  2070  			v.AddArg(x)
  2071  			return true
  2072  		}
  2073  		break
  2074  	}
  2075  	// match: (AND x x)
  2076  	// result: x
  2077  	for {
  2078  		x := v_0
  2079  		if x != v_1 {
  2080  			break
  2081  		}
  2082  		v.copyOf(x)
  2083  		return true
  2084  	}
  2085  	// match: (AND x (NORconst [0] y))
  2086  	// result: (ANDN x y)
  2087  	for {
  2088  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
  2089  			x := v_0
  2090  			if v_1.Op != OpLOONG64NORconst || auxIntToInt64(v_1.AuxInt) != 0 {
  2091  				continue
  2092  			}
  2093  			y := v_1.Args[0]
  2094  			v.reset(OpLOONG64ANDN)
  2095  			v.AddArg2(x, y)
  2096  			return true
  2097  		}
  2098  		break
  2099  	}
  2100  	return false
  2101  }
  2102  func rewriteValueLOONG64_OpLOONG64ANDconst(v *Value) bool {
  2103  	v_0 := v.Args[0]
  2104  	// match: (ANDconst [0] _)
  2105  	// result: (MOVVconst [0])
  2106  	for {
  2107  		if auxIntToInt64(v.AuxInt) != 0 {
  2108  			break
  2109  		}
  2110  		v.reset(OpLOONG64MOVVconst)
  2111  		v.AuxInt = int64ToAuxInt(0)
  2112  		return true
  2113  	}
  2114  	// match: (ANDconst [-1] x)
  2115  	// result: x
  2116  	for {
  2117  		if auxIntToInt64(v.AuxInt) != -1 {
  2118  			break
  2119  		}
  2120  		x := v_0
  2121  		v.copyOf(x)
  2122  		return true
  2123  	}
  2124  	// match: (ANDconst [c] (MOVVconst [d]))
  2125  	// result: (MOVVconst [c&d])
  2126  	for {
  2127  		c := auxIntToInt64(v.AuxInt)
  2128  		if v_0.Op != OpLOONG64MOVVconst {
  2129  			break
  2130  		}
  2131  		d := auxIntToInt64(v_0.AuxInt)
  2132  		v.reset(OpLOONG64MOVVconst)
  2133  		v.AuxInt = int64ToAuxInt(c & d)
  2134  		return true
  2135  	}
  2136  	// match: (ANDconst [c] (ANDconst [d] x))
  2137  	// result: (ANDconst [c&d] x)
  2138  	for {
  2139  		c := auxIntToInt64(v.AuxInt)
  2140  		if v_0.Op != OpLOONG64ANDconst {
  2141  			break
  2142  		}
  2143  		d := auxIntToInt64(v_0.AuxInt)
  2144  		x := v_0.Args[0]
  2145  		v.reset(OpLOONG64ANDconst)
  2146  		v.AuxInt = int64ToAuxInt(c & d)
  2147  		v.AddArg(x)
  2148  		return true
  2149  	}
  2150  	return false
  2151  }
  2152  func rewriteValueLOONG64_OpLOONG64DIVV(v *Value) bool {
  2153  	v_1 := v.Args[1]
  2154  	v_0 := v.Args[0]
  2155  	// match: (DIVV (MOVVconst [c]) (MOVVconst [d]))
  2156  	// cond: d != 0
  2157  	// result: (MOVVconst [c/d])
  2158  	for {
  2159  		if v_0.Op != OpLOONG64MOVVconst {
  2160  			break
  2161  		}
  2162  		c := auxIntToInt64(v_0.AuxInt)
  2163  		if v_1.Op != OpLOONG64MOVVconst {
  2164  			break
  2165  		}
  2166  		d := auxIntToInt64(v_1.AuxInt)
  2167  		if !(d != 0) {
  2168  			break
  2169  		}
  2170  		v.reset(OpLOONG64MOVVconst)
  2171  		v.AuxInt = int64ToAuxInt(c / d)
  2172  		return true
  2173  	}
  2174  	return false
  2175  }
  2176  func rewriteValueLOONG64_OpLOONG64DIVVU(v *Value) bool {
  2177  	v_1 := v.Args[1]
  2178  	v_0 := v.Args[0]
  2179  	// match: (DIVVU x (MOVVconst [1]))
  2180  	// result: x
  2181  	for {
  2182  		x := v_0
  2183  		if v_1.Op != OpLOONG64MOVVconst || auxIntToInt64(v_1.AuxInt) != 1 {
  2184  			break
  2185  		}
  2186  		v.copyOf(x)
  2187  		return true
  2188  	}
  2189  	// match: (DIVVU x (MOVVconst [c]))
  2190  	// cond: isPowerOfTwo(c)
  2191  	// result: (SRLVconst [log64(c)] x)
  2192  	for {
  2193  		x := v_0
  2194  		if v_1.Op != OpLOONG64MOVVconst {
  2195  			break
  2196  		}
  2197  		c := auxIntToInt64(v_1.AuxInt)
  2198  		if !(isPowerOfTwo(c)) {
  2199  			break
  2200  		}
  2201  		v.reset(OpLOONG64SRLVconst)
  2202  		v.AuxInt = int64ToAuxInt(log64(c))
  2203  		v.AddArg(x)
  2204  		return true
  2205  	}
  2206  	// match: (DIVVU (MOVVconst [c]) (MOVVconst [d]))
  2207  	// cond: d != 0
  2208  	// result: (MOVVconst [int64(uint64(c)/uint64(d))])
  2209  	for {
  2210  		if v_0.Op != OpLOONG64MOVVconst {
  2211  			break
  2212  		}
  2213  		c := auxIntToInt64(v_0.AuxInt)
  2214  		if v_1.Op != OpLOONG64MOVVconst {
  2215  			break
  2216  		}
  2217  		d := auxIntToInt64(v_1.AuxInt)
  2218  		if !(d != 0) {
  2219  			break
  2220  		}
  2221  		v.reset(OpLOONG64MOVVconst)
  2222  		v.AuxInt = int64ToAuxInt(int64(uint64(c) / uint64(d)))
  2223  		return true
  2224  	}
  2225  	return false
  2226  }
  2227  func rewriteValueLOONG64_OpLOONG64LoweredPanicBoundsCR(v *Value) bool {
  2228  	v_1 := v.Args[1]
  2229  	v_0 := v.Args[0]
  2230  	// match: (LoweredPanicBoundsCR [kind] {p} (MOVVconst [c]) mem)
  2231  	// result: (LoweredPanicBoundsCC [kind] {PanicBoundsCC{Cx:p.C, Cy:c}} mem)
  2232  	for {
  2233  		kind := auxIntToInt64(v.AuxInt)
  2234  		p := auxToPanicBoundsC(v.Aux)
  2235  		if v_0.Op != OpLOONG64MOVVconst {
  2236  			break
  2237  		}
  2238  		c := auxIntToInt64(v_0.AuxInt)
  2239  		mem := v_1
  2240  		v.reset(OpLOONG64LoweredPanicBoundsCC)
  2241  		v.AuxInt = int64ToAuxInt(kind)
  2242  		v.Aux = panicBoundsCCToAux(PanicBoundsCC{Cx: p.C, Cy: c})
  2243  		v.AddArg(mem)
  2244  		return true
  2245  	}
  2246  	return false
  2247  }
  2248  func rewriteValueLOONG64_OpLOONG64LoweredPanicBoundsRC(v *Value) bool {
  2249  	v_1 := v.Args[1]
  2250  	v_0 := v.Args[0]
  2251  	// match: (LoweredPanicBoundsRC [kind] {p} (MOVVconst [c]) mem)
  2252  	// result: (LoweredPanicBoundsCC [kind] {PanicBoundsCC{Cx:c, Cy:p.C}} mem)
  2253  	for {
  2254  		kind := auxIntToInt64(v.AuxInt)
  2255  		p := auxToPanicBoundsC(v.Aux)
  2256  		if v_0.Op != OpLOONG64MOVVconst {
  2257  			break
  2258  		}
  2259  		c := auxIntToInt64(v_0.AuxInt)
  2260  		mem := v_1
  2261  		v.reset(OpLOONG64LoweredPanicBoundsCC)
  2262  		v.AuxInt = int64ToAuxInt(kind)
  2263  		v.Aux = panicBoundsCCToAux(PanicBoundsCC{Cx: c, Cy: p.C})
  2264  		v.AddArg(mem)
  2265  		return true
  2266  	}
  2267  	return false
  2268  }
  2269  func rewriteValueLOONG64_OpLOONG64LoweredPanicBoundsRR(v *Value) bool {
  2270  	v_2 := v.Args[2]
  2271  	v_1 := v.Args[1]
  2272  	v_0 := v.Args[0]
  2273  	// match: (LoweredPanicBoundsRR [kind] x (MOVVconst [c]) mem)
  2274  	// result: (LoweredPanicBoundsRC [kind] x {PanicBoundsC{C:c}} mem)
  2275  	for {
  2276  		kind := auxIntToInt64(v.AuxInt)
  2277  		x := v_0
  2278  		if v_1.Op != OpLOONG64MOVVconst {
  2279  			break
  2280  		}
  2281  		c := auxIntToInt64(v_1.AuxInt)
  2282  		mem := v_2
  2283  		v.reset(OpLOONG64LoweredPanicBoundsRC)
  2284  		v.AuxInt = int64ToAuxInt(kind)
  2285  		v.Aux = panicBoundsCToAux(PanicBoundsC{C: c})
  2286  		v.AddArg2(x, mem)
  2287  		return true
  2288  	}
  2289  	// match: (LoweredPanicBoundsRR [kind] (MOVVconst [c]) y mem)
  2290  	// result: (LoweredPanicBoundsCR [kind] {PanicBoundsC{C:c}} y mem)
  2291  	for {
  2292  		kind := auxIntToInt64(v.AuxInt)
  2293  		if v_0.Op != OpLOONG64MOVVconst {
  2294  			break
  2295  		}
  2296  		c := auxIntToInt64(v_0.AuxInt)
  2297  		y := v_1
  2298  		mem := v_2
  2299  		v.reset(OpLOONG64LoweredPanicBoundsCR)
  2300  		v.AuxInt = int64ToAuxInt(kind)
  2301  		v.Aux = panicBoundsCToAux(PanicBoundsC{C: c})
  2302  		v.AddArg2(y, mem)
  2303  		return true
  2304  	}
  2305  	return false
  2306  }
  2307  func rewriteValueLOONG64_OpLOONG64MASKEQZ(v *Value) bool {
  2308  	v_1 := v.Args[1]
  2309  	v_0 := v.Args[0]
  2310  	// match: (MASKEQZ (MOVVconst [0]) cond)
  2311  	// result: (MOVVconst [0])
  2312  	for {
  2313  		if v_0.Op != OpLOONG64MOVVconst || auxIntToInt64(v_0.AuxInt) != 0 {
  2314  			break
  2315  		}
  2316  		v.reset(OpLOONG64MOVVconst)
  2317  		v.AuxInt = int64ToAuxInt(0)
  2318  		return true
  2319  	}
  2320  	// match: (MASKEQZ x (MOVVconst [c]))
  2321  	// cond: c == 0
  2322  	// result: (MOVVconst [0])
  2323  	for {
  2324  		if v_1.Op != OpLOONG64MOVVconst {
  2325  			break
  2326  		}
  2327  		c := auxIntToInt64(v_1.AuxInt)
  2328  		if !(c == 0) {
  2329  			break
  2330  		}
  2331  		v.reset(OpLOONG64MOVVconst)
  2332  		v.AuxInt = int64ToAuxInt(0)
  2333  		return true
  2334  	}
  2335  	// match: (MASKEQZ x (MOVVconst [c]))
  2336  	// cond: c != 0
  2337  	// result: x
  2338  	for {
  2339  		x := v_0
  2340  		if v_1.Op != OpLOONG64MOVVconst {
  2341  			break
  2342  		}
  2343  		c := auxIntToInt64(v_1.AuxInt)
  2344  		if !(c != 0) {
  2345  			break
  2346  		}
  2347  		v.copyOf(x)
  2348  		return true
  2349  	}
  2350  	return false
  2351  }
  2352  func rewriteValueLOONG64_OpLOONG64MASKNEZ(v *Value) bool {
  2353  	v_0 := v.Args[0]
  2354  	// match: (MASKNEZ (MOVVconst [0]) cond)
  2355  	// result: (MOVVconst [0])
  2356  	for {
  2357  		if v_0.Op != OpLOONG64MOVVconst || auxIntToInt64(v_0.AuxInt) != 0 {
  2358  			break
  2359  		}
  2360  		v.reset(OpLOONG64MOVVconst)
  2361  		v.AuxInt = int64ToAuxInt(0)
  2362  		return true
  2363  	}
  2364  	return false
  2365  }
  2366  func rewriteValueLOONG64_OpLOONG64MOVBUload(v *Value) bool {
  2367  	v_1 := v.Args[1]
  2368  	v_0 := v.Args[0]
  2369  	b := v.Block
  2370  	config := b.Func.Config
  2371  	typ := &b.Func.Config.Types
  2372  	// match: (MOVBUload [off] {sym} ptr (MOVBstore [off] {sym} ptr x _))
  2373  	// result: (MOVBUreg x)
  2374  	for {
  2375  		off := auxIntToInt32(v.AuxInt)
  2376  		sym := auxToSym(v.Aux)
  2377  		ptr := v_0
  2378  		if v_1.Op != OpLOONG64MOVBstore || auxIntToInt32(v_1.AuxInt) != off || auxToSym(v_1.Aux) != sym {
  2379  			break
  2380  		}
  2381  		x := v_1.Args[1]
  2382  		if ptr != v_1.Args[0] {
  2383  			break
  2384  		}
  2385  		v.reset(OpLOONG64MOVBUreg)
  2386  		v.AddArg(x)
  2387  		return true
  2388  	}
  2389  	// match: (MOVBUload [off1] {sym} (ADDVconst [off2] ptr) mem)
  2390  	// cond: is32Bit(int64(off1)+off2) && (ptr.Op != OpSB || !config.ctxt.Flag_dynlink)
  2391  	// result: (MOVBUload [off1+int32(off2)] {sym} ptr mem)
  2392  	for {
  2393  		off1 := auxIntToInt32(v.AuxInt)
  2394  		sym := auxToSym(v.Aux)
  2395  		if v_0.Op != OpLOONG64ADDVconst {
  2396  			break
  2397  		}
  2398  		off2 := auxIntToInt64(v_0.AuxInt)
  2399  		ptr := v_0.Args[0]
  2400  		mem := v_1
  2401  		if !(is32Bit(int64(off1)+off2) && (ptr.Op != OpSB || !config.ctxt.Flag_dynlink)) {
  2402  			break
  2403  		}
  2404  		v.reset(OpLOONG64MOVBUload)
  2405  		v.AuxInt = int32ToAuxInt(off1 + int32(off2))
  2406  		v.Aux = symToAux(sym)
  2407  		v.AddArg2(ptr, mem)
  2408  		return true
  2409  	}
  2410  	// match: (MOVBUload [off1] {sym1} (MOVVaddr [off2] {sym2} ptr) mem)
  2411  	// cond: canMergeSym(sym1,sym2) && is32Bit(int64(off1)+int64(off2)) && (ptr.Op != OpSB || !config.ctxt.Flag_dynlink)
  2412  	// result: (MOVBUload [off1+int32(off2)] {mergeSym(sym1,sym2)} ptr mem)
  2413  	for {
  2414  		off1 := auxIntToInt32(v.AuxInt)
  2415  		sym1 := auxToSym(v.Aux)
  2416  		if v_0.Op != OpLOONG64MOVVaddr {
  2417  			break
  2418  		}
  2419  		off2 := auxIntToInt32(v_0.AuxInt)
  2420  		sym2 := auxToSym(v_0.Aux)
  2421  		ptr := v_0.Args[0]
  2422  		mem := v_1
  2423  		if !(canMergeSym(sym1, sym2) && is32Bit(int64(off1)+int64(off2)) && (ptr.Op != OpSB || !config.ctxt.Flag_dynlink)) {
  2424  			break
  2425  		}
  2426  		v.reset(OpLOONG64MOVBUload)
  2427  		v.AuxInt = int32ToAuxInt(off1 + int32(off2))
  2428  		v.Aux = symToAux(mergeSym(sym1, sym2))
  2429  		v.AddArg2(ptr, mem)
  2430  		return true
  2431  	}
  2432  	// match: (MOVBUload [off] {sym} (ADDV ptr idx) mem)
  2433  	// cond: off == 0 && sym == nil
  2434  	// result: (MOVBUloadidx ptr idx mem)
  2435  	for {
  2436  		off := auxIntToInt32(v.AuxInt)
  2437  		sym := auxToSym(v.Aux)
  2438  		if v_0.Op != OpLOONG64ADDV {
  2439  			break
  2440  		}
  2441  		idx := v_0.Args[1]
  2442  		ptr := v_0.Args[0]
  2443  		mem := v_1
  2444  		if !(off == 0 && sym == nil) {
  2445  			break
  2446  		}
  2447  		v.reset(OpLOONG64MOVBUloadidx)
  2448  		v.AddArg3(ptr, idx, mem)
  2449  		return true
  2450  	}
  2451  	// match: (MOVBUload [off] {sym} (ADDshiftLLV [shift] ptr idx) mem)
  2452  	// cond: off == 0 && sym == nil
  2453  	// result: (MOVBUloadidx ptr (SLLVconst <typ.Int64> [shift] idx) mem)
  2454  	for {
  2455  		off := auxIntToInt32(v.AuxInt)
  2456  		sym := auxToSym(v.Aux)
  2457  		if v_0.Op != OpLOONG64ADDshiftLLV {
  2458  			break
  2459  		}
  2460  		shift := auxIntToInt64(v_0.AuxInt)
  2461  		idx := v_0.Args[1]
  2462  		ptr := v_0.Args[0]
  2463  		mem := v_1
  2464  		if !(off == 0 && sym == nil) {
  2465  			break
  2466  		}
  2467  		v.reset(OpLOONG64MOVBUloadidx)
  2468  		v0 := b.NewValue0(v.Pos, OpLOONG64SLLVconst, typ.Int64)
  2469  		v0.AuxInt = int64ToAuxInt(shift)
  2470  		v0.AddArg(idx)
  2471  		v.AddArg3(ptr, v0, mem)
  2472  		return true
  2473  	}
  2474  	// match: (MOVBUload [off] {sym} (SB) _)
  2475  	// cond: symIsRO(sym)
  2476  	// result: (MOVVconst [int64(read8(sym, int64(off)))])
  2477  	for {
  2478  		off := auxIntToInt32(v.AuxInt)
  2479  		sym := auxToSym(v.Aux)
  2480  		if v_0.Op != OpSB || !(symIsRO(sym)) {
  2481  			break
  2482  		}
  2483  		v.reset(OpLOONG64MOVVconst)
  2484  		v.AuxInt = int64ToAuxInt(int64(read8(sym, int64(off))))
  2485  		return true
  2486  	}
  2487  	return false
  2488  }
  2489  func rewriteValueLOONG64_OpLOONG64MOVBUloadidx(v *Value) bool {
  2490  	v_2 := v.Args[2]
  2491  	v_1 := v.Args[1]
  2492  	v_0 := v.Args[0]
  2493  	// match: (MOVBUloadidx ptr (MOVVconst [c]) mem)
  2494  	// cond: is32Bit(c)
  2495  	// result: (MOVBUload [int32(c)] ptr mem)
  2496  	for {
  2497  		ptr := v_0
  2498  		if v_1.Op != OpLOONG64MOVVconst {
  2499  			break
  2500  		}
  2501  		c := auxIntToInt64(v_1.AuxInt)
  2502  		mem := v_2
  2503  		if !(is32Bit(c)) {
  2504  			break
  2505  		}
  2506  		v.reset(OpLOONG64MOVBUload)
  2507  		v.AuxInt = int32ToAuxInt(int32(c))
  2508  		v.AddArg2(ptr, mem)
  2509  		return true
  2510  	}
  2511  	// match: (MOVBUloadidx (MOVVconst [c]) ptr mem)
  2512  	// cond: is32Bit(c)
  2513  	// result: (MOVBUload [int32(c)] ptr mem)
  2514  	for {
  2515  		if v_0.Op != OpLOONG64MOVVconst {
  2516  			break
  2517  		}
  2518  		c := auxIntToInt64(v_0.AuxInt)
  2519  		ptr := v_1
  2520  		mem := v_2
  2521  		if !(is32Bit(c)) {
  2522  			break
  2523  		}
  2524  		v.reset(OpLOONG64MOVBUload)
  2525  		v.AuxInt = int32ToAuxInt(int32(c))
  2526  		v.AddArg2(ptr, mem)
  2527  		return true
  2528  	}
  2529  	return false
  2530  }
  2531  func rewriteValueLOONG64_OpLOONG64MOVBUreg(v *Value) bool {
  2532  	v_0 := v.Args[0]
  2533  	// match: (MOVBUreg (SRLVconst [rc] x))
  2534  	// cond: rc < 8
  2535  	// result: (BSTRPICKV [rc + (7+rc)<<6] x)
  2536  	for {
  2537  		if v_0.Op != OpLOONG64SRLVconst {
  2538  			break
  2539  		}
  2540  		rc := auxIntToInt64(v_0.AuxInt)
  2541  		x := v_0.Args[0]
  2542  		if !(rc < 8) {
  2543  			break
  2544  		}
  2545  		v.reset(OpLOONG64BSTRPICKV)
  2546  		v.AuxInt = int64ToAuxInt(rc + (7+rc)<<6)
  2547  		v.AddArg(x)
  2548  		return true
  2549  	}
  2550  	// match: (MOVBUreg x:(SGT _ _))
  2551  	// result: x
  2552  	for {
  2553  		x := v_0
  2554  		if x.Op != OpLOONG64SGT {
  2555  			break
  2556  		}
  2557  		v.copyOf(x)
  2558  		return true
  2559  	}
  2560  	// match: (MOVBUreg x:(SGTU _ _))
  2561  	// result: x
  2562  	for {
  2563  		x := v_0
  2564  		if x.Op != OpLOONG64SGTU {
  2565  			break
  2566  		}
  2567  		v.copyOf(x)
  2568  		return true
  2569  	}
  2570  	// match: (MOVBUreg x:(XOR (MOVVconst [1]) (SGT _ _)))
  2571  	// result: x
  2572  	for {
  2573  		x := v_0
  2574  		if x.Op != OpLOONG64XOR {
  2575  			break
  2576  		}
  2577  		_ = x.Args[1]
  2578  		x_0 := x.Args[0]
  2579  		x_1 := x.Args[1]
  2580  		for _i0 := 0; _i0 <= 1; _i0, x_0, x_1 = _i0+1, x_1, x_0 {
  2581  			if x_0.Op != OpLOONG64MOVVconst || auxIntToInt64(x_0.AuxInt) != 1 || x_1.Op != OpLOONG64SGT {
  2582  				continue
  2583  			}
  2584  			v.copyOf(x)
  2585  			return true
  2586  		}
  2587  		break
  2588  	}
  2589  	// match: (MOVBUreg x:(XOR (MOVVconst [1]) (SGTU _ _)))
  2590  	// result: x
  2591  	for {
  2592  		x := v_0
  2593  		if x.Op != OpLOONG64XOR {
  2594  			break
  2595  		}
  2596  		_ = x.Args[1]
  2597  		x_0 := x.Args[0]
  2598  		x_1 := x.Args[1]
  2599  		for _i0 := 0; _i0 <= 1; _i0, x_0, x_1 = _i0+1, x_1, x_0 {
  2600  			if x_0.Op != OpLOONG64MOVVconst || auxIntToInt64(x_0.AuxInt) != 1 || x_1.Op != OpLOONG64SGTU {
  2601  				continue
  2602  			}
  2603  			v.copyOf(x)
  2604  			return true
  2605  		}
  2606  		break
  2607  	}
  2608  	// match: (MOVBUreg x:(MOVBUload _ _))
  2609  	// result: (MOVVreg x)
  2610  	for {
  2611  		x := v_0
  2612  		if x.Op != OpLOONG64MOVBUload {
  2613  			break
  2614  		}
  2615  		v.reset(OpLOONG64MOVVreg)
  2616  		v.AddArg(x)
  2617  		return true
  2618  	}
  2619  	// match: (MOVBUreg x:(MOVBUloadidx _ _ _))
  2620  	// result: (MOVVreg x)
  2621  	for {
  2622  		x := v_0
  2623  		if x.Op != OpLOONG64MOVBUloadidx {
  2624  			break
  2625  		}
  2626  		v.reset(OpLOONG64MOVVreg)
  2627  		v.AddArg(x)
  2628  		return true
  2629  	}
  2630  	// match: (MOVBUreg x:(MOVBUreg _))
  2631  	// result: (MOVVreg x)
  2632  	for {
  2633  		x := v_0
  2634  		if x.Op != OpLOONG64MOVBUreg {
  2635  			break
  2636  		}
  2637  		v.reset(OpLOONG64MOVVreg)
  2638  		v.AddArg(x)
  2639  		return true
  2640  	}
  2641  	// match: (MOVBUreg (SLLVconst [lc] x))
  2642  	// cond: lc >= 8
  2643  	// result: (MOVVconst [0])
  2644  	for {
  2645  		if v_0.Op != OpLOONG64SLLVconst {
  2646  			break
  2647  		}
  2648  		lc := auxIntToInt64(v_0.AuxInt)
  2649  		if !(lc >= 8) {
  2650  			break
  2651  		}
  2652  		v.reset(OpLOONG64MOVVconst)
  2653  		v.AuxInt = int64ToAuxInt(0)
  2654  		return true
  2655  	}
  2656  	// match: (MOVBUreg (MOVVconst [c]))
  2657  	// result: (MOVVconst [int64(uint8(c))])
  2658  	for {
  2659  		if v_0.Op != OpLOONG64MOVVconst {
  2660  			break
  2661  		}
  2662  		c := auxIntToInt64(v_0.AuxInt)
  2663  		v.reset(OpLOONG64MOVVconst)
  2664  		v.AuxInt = int64ToAuxInt(int64(uint8(c)))
  2665  		return true
  2666  	}
  2667  	// match: (MOVBUreg (ANDconst [c] x))
  2668  	// result: (ANDconst [c&0xff] x)
  2669  	for {
  2670  		if v_0.Op != OpLOONG64ANDconst {
  2671  			break
  2672  		}
  2673  		c := auxIntToInt64(v_0.AuxInt)
  2674  		x := v_0.Args[0]
  2675  		v.reset(OpLOONG64ANDconst)
  2676  		v.AuxInt = int64ToAuxInt(c & 0xff)
  2677  		v.AddArg(x)
  2678  		return true
  2679  	}
  2680  	// match: (MOVBUreg x:(ANDconst [c] y))
  2681  	// cond: c >= 0 && int64(uint8(c)) == c
  2682  	// result: x
  2683  	for {
  2684  		x := v_0
  2685  		if x.Op != OpLOONG64ANDconst {
  2686  			break
  2687  		}
  2688  		c := auxIntToInt64(x.AuxInt)
  2689  		if !(c >= 0 && int64(uint8(c)) == c) {
  2690  			break
  2691  		}
  2692  		v.copyOf(x)
  2693  		return true
  2694  	}
  2695  	return false
  2696  }
  2697  func rewriteValueLOONG64_OpLOONG64MOVBload(v *Value) bool {
  2698  	v_1 := v.Args[1]
  2699  	v_0 := v.Args[0]
  2700  	b := v.Block
  2701  	config := b.Func.Config
  2702  	typ := &b.Func.Config.Types
  2703  	// match: (MOVBload [off] {sym} ptr (MOVBstore [off] {sym} ptr x _))
  2704  	// result: (MOVBreg x)
  2705  	for {
  2706  		off := auxIntToInt32(v.AuxInt)
  2707  		sym := auxToSym(v.Aux)
  2708  		ptr := v_0
  2709  		if v_1.Op != OpLOONG64MOVBstore || auxIntToInt32(v_1.AuxInt) != off || auxToSym(v_1.Aux) != sym {
  2710  			break
  2711  		}
  2712  		x := v_1.Args[1]
  2713  		if ptr != v_1.Args[0] {
  2714  			break
  2715  		}
  2716  		v.reset(OpLOONG64MOVBreg)
  2717  		v.AddArg(x)
  2718  		return true
  2719  	}
  2720  	// match: (MOVBload [off1] {sym} (ADDVconst [off2] ptr) mem)
  2721  	// cond: is32Bit(int64(off1)+off2) && (ptr.Op != OpSB || !config.ctxt.Flag_dynlink)
  2722  	// result: (MOVBload [off1+int32(off2)] {sym} ptr mem)
  2723  	for {
  2724  		off1 := auxIntToInt32(v.AuxInt)
  2725  		sym := auxToSym(v.Aux)
  2726  		if v_0.Op != OpLOONG64ADDVconst {
  2727  			break
  2728  		}
  2729  		off2 := auxIntToInt64(v_0.AuxInt)
  2730  		ptr := v_0.Args[0]
  2731  		mem := v_1
  2732  		if !(is32Bit(int64(off1)+off2) && (ptr.Op != OpSB || !config.ctxt.Flag_dynlink)) {
  2733  			break
  2734  		}
  2735  		v.reset(OpLOONG64MOVBload)
  2736  		v.AuxInt = int32ToAuxInt(off1 + int32(off2))
  2737  		v.Aux = symToAux(sym)
  2738  		v.AddArg2(ptr, mem)
  2739  		return true
  2740  	}
  2741  	// match: (MOVBload [off1] {sym1} (MOVVaddr [off2] {sym2} ptr) mem)
  2742  	// cond: canMergeSym(sym1,sym2) && is32Bit(int64(off1)+int64(off2)) && (ptr.Op != OpSB || !config.ctxt.Flag_dynlink)
  2743  	// result: (MOVBload [off1+int32(off2)] {mergeSym(sym1,sym2)} ptr mem)
  2744  	for {
  2745  		off1 := auxIntToInt32(v.AuxInt)
  2746  		sym1 := auxToSym(v.Aux)
  2747  		if v_0.Op != OpLOONG64MOVVaddr {
  2748  			break
  2749  		}
  2750  		off2 := auxIntToInt32(v_0.AuxInt)
  2751  		sym2 := auxToSym(v_0.Aux)
  2752  		ptr := v_0.Args[0]
  2753  		mem := v_1
  2754  		if !(canMergeSym(sym1, sym2) && is32Bit(int64(off1)+int64(off2)) && (ptr.Op != OpSB || !config.ctxt.Flag_dynlink)) {
  2755  			break
  2756  		}
  2757  		v.reset(OpLOONG64MOVBload)
  2758  		v.AuxInt = int32ToAuxInt(off1 + int32(off2))
  2759  		v.Aux = symToAux(mergeSym(sym1, sym2))
  2760  		v.AddArg2(ptr, mem)
  2761  		return true
  2762  	}
  2763  	// match: (MOVBload [off] {sym} (ADDV ptr idx) mem)
  2764  	// cond: off == 0 && sym == nil
  2765  	// result: (MOVBloadidx ptr idx mem)
  2766  	for {
  2767  		off := auxIntToInt32(v.AuxInt)
  2768  		sym := auxToSym(v.Aux)
  2769  		if v_0.Op != OpLOONG64ADDV {
  2770  			break
  2771  		}
  2772  		idx := v_0.Args[1]
  2773  		ptr := v_0.Args[0]
  2774  		mem := v_1
  2775  		if !(off == 0 && sym == nil) {
  2776  			break
  2777  		}
  2778  		v.reset(OpLOONG64MOVBloadidx)
  2779  		v.AddArg3(ptr, idx, mem)
  2780  		return true
  2781  	}
  2782  	// match: (MOVBload [off] {sym} (ADDshiftLLV [shift] ptr idx) mem)
  2783  	// cond: off == 0 && sym == nil
  2784  	// result: (MOVBloadidx ptr (SLLVconst <typ.Int64> [shift] idx) mem)
  2785  	for {
  2786  		off := auxIntToInt32(v.AuxInt)
  2787  		sym := auxToSym(v.Aux)
  2788  		if v_0.Op != OpLOONG64ADDshiftLLV {
  2789  			break
  2790  		}
  2791  		shift := auxIntToInt64(v_0.AuxInt)
  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  		v0 := b.NewValue0(v.Pos, OpLOONG64SLLVconst, typ.Int64)
  2800  		v0.AuxInt = int64ToAuxInt(shift)
  2801  		v0.AddArg(idx)
  2802  		v.AddArg3(ptr, v0, mem)
  2803  		return true
  2804  	}
  2805  	// match: (MOVBload [off] {sym} (SB) _)
  2806  	// cond: symIsRO(sym)
  2807  	// result: (MOVVconst [int64(int8(read8(sym, int64(off))))])
  2808  	for {
  2809  		off := auxIntToInt32(v.AuxInt)
  2810  		sym := auxToSym(v.Aux)
  2811  		if v_0.Op != OpSB || !(symIsRO(sym)) {
  2812  			break
  2813  		}
  2814  		v.reset(OpLOONG64MOVVconst)
  2815  		v.AuxInt = int64ToAuxInt(int64(int8(read8(sym, int64(off)))))
  2816  		return true
  2817  	}
  2818  	return false
  2819  }
  2820  func rewriteValueLOONG64_OpLOONG64MOVBloadidx(v *Value) bool {
  2821  	v_2 := v.Args[2]
  2822  	v_1 := v.Args[1]
  2823  	v_0 := v.Args[0]
  2824  	// match: (MOVBloadidx ptr (MOVVconst [c]) mem)
  2825  	// cond: is32Bit(c)
  2826  	// result: (MOVBload [int32(c)] ptr mem)
  2827  	for {
  2828  		ptr := v_0
  2829  		if v_1.Op != OpLOONG64MOVVconst {
  2830  			break
  2831  		}
  2832  		c := auxIntToInt64(v_1.AuxInt)
  2833  		mem := v_2
  2834  		if !(is32Bit(c)) {
  2835  			break
  2836  		}
  2837  		v.reset(OpLOONG64MOVBload)
  2838  		v.AuxInt = int32ToAuxInt(int32(c))
  2839  		v.AddArg2(ptr, mem)
  2840  		return true
  2841  	}
  2842  	// match: (MOVBloadidx (MOVVconst [c]) ptr mem)
  2843  	// cond: is32Bit(c)
  2844  	// result: (MOVBload [int32(c)] ptr mem)
  2845  	for {
  2846  		if v_0.Op != OpLOONG64MOVVconst {
  2847  			break
  2848  		}
  2849  		c := auxIntToInt64(v_0.AuxInt)
  2850  		ptr := v_1
  2851  		mem := v_2
  2852  		if !(is32Bit(c)) {
  2853  			break
  2854  		}
  2855  		v.reset(OpLOONG64MOVBload)
  2856  		v.AuxInt = int32ToAuxInt(int32(c))
  2857  		v.AddArg2(ptr, mem)
  2858  		return true
  2859  	}
  2860  	return false
  2861  }
  2862  func rewriteValueLOONG64_OpLOONG64MOVBreg(v *Value) bool {
  2863  	v_0 := v.Args[0]
  2864  	// match: (MOVBreg x:(MOVBload _ _))
  2865  	// result: (MOVVreg x)
  2866  	for {
  2867  		x := v_0
  2868  		if x.Op != OpLOONG64MOVBload {
  2869  			break
  2870  		}
  2871  		v.reset(OpLOONG64MOVVreg)
  2872  		v.AddArg(x)
  2873  		return true
  2874  	}
  2875  	// match: (MOVBreg x:(MOVBloadidx _ _ _))
  2876  	// result: (MOVVreg x)
  2877  	for {
  2878  		x := v_0
  2879  		if x.Op != OpLOONG64MOVBloadidx {
  2880  			break
  2881  		}
  2882  		v.reset(OpLOONG64MOVVreg)
  2883  		v.AddArg(x)
  2884  		return true
  2885  	}
  2886  	// match: (MOVBreg x:(MOVBreg _))
  2887  	// result: (MOVVreg x)
  2888  	for {
  2889  		x := v_0
  2890  		if x.Op != OpLOONG64MOVBreg {
  2891  			break
  2892  		}
  2893  		v.reset(OpLOONG64MOVVreg)
  2894  		v.AddArg(x)
  2895  		return true
  2896  	}
  2897  	// match: (MOVBreg (MOVVconst [c]))
  2898  	// result: (MOVVconst [int64(int8(c))])
  2899  	for {
  2900  		if v_0.Op != OpLOONG64MOVVconst {
  2901  			break
  2902  		}
  2903  		c := auxIntToInt64(v_0.AuxInt)
  2904  		v.reset(OpLOONG64MOVVconst)
  2905  		v.AuxInt = int64ToAuxInt(int64(int8(c)))
  2906  		return true
  2907  	}
  2908  	// match: (MOVBreg x:(ANDconst [c] y))
  2909  	// cond: c >= 0 && int64(int8(c)) == c
  2910  	// result: x
  2911  	for {
  2912  		x := v_0
  2913  		if x.Op != OpLOONG64ANDconst {
  2914  			break
  2915  		}
  2916  		c := auxIntToInt64(x.AuxInt)
  2917  		if !(c >= 0 && int64(int8(c)) == c) {
  2918  			break
  2919  		}
  2920  		v.copyOf(x)
  2921  		return true
  2922  	}
  2923  	return false
  2924  }
  2925  func rewriteValueLOONG64_OpLOONG64MOVBstore(v *Value) bool {
  2926  	v_2 := v.Args[2]
  2927  	v_1 := v.Args[1]
  2928  	v_0 := v.Args[0]
  2929  	b := v.Block
  2930  	config := b.Func.Config
  2931  	typ := &b.Func.Config.Types
  2932  	// match: (MOVBstore [off1] {sym} (ADDVconst [off2] ptr) val mem)
  2933  	// cond: is32Bit(int64(off1)+off2) && (ptr.Op != OpSB || !config.ctxt.Flag_dynlink)
  2934  	// result: (MOVBstore [off1+int32(off2)] {sym} ptr val mem)
  2935  	for {
  2936  		off1 := auxIntToInt32(v.AuxInt)
  2937  		sym := auxToSym(v.Aux)
  2938  		if v_0.Op != OpLOONG64ADDVconst {
  2939  			break
  2940  		}
  2941  		off2 := auxIntToInt64(v_0.AuxInt)
  2942  		ptr := v_0.Args[0]
  2943  		val := v_1
  2944  		mem := v_2
  2945  		if !(is32Bit(int64(off1)+off2) && (ptr.Op != OpSB || !config.ctxt.Flag_dynlink)) {
  2946  			break
  2947  		}
  2948  		v.reset(OpLOONG64MOVBstore)
  2949  		v.AuxInt = int32ToAuxInt(off1 + int32(off2))
  2950  		v.Aux = symToAux(sym)
  2951  		v.AddArg3(ptr, val, mem)
  2952  		return true
  2953  	}
  2954  	// match: (MOVBstore [off1] {sym1} (MOVVaddr [off2] {sym2} ptr) val mem)
  2955  	// cond: canMergeSym(sym1,sym2) && is32Bit(int64(off1)+int64(off2)) && (ptr.Op != OpSB || !config.ctxt.Flag_dynlink)
  2956  	// result: (MOVBstore [off1+int32(off2)] {mergeSym(sym1,sym2)} ptr val mem)
  2957  	for {
  2958  		off1 := auxIntToInt32(v.AuxInt)
  2959  		sym1 := auxToSym(v.Aux)
  2960  		if v_0.Op != OpLOONG64MOVVaddr {
  2961  			break
  2962  		}
  2963  		off2 := auxIntToInt32(v_0.AuxInt)
  2964  		sym2 := auxToSym(v_0.Aux)
  2965  		ptr := v_0.Args[0]
  2966  		val := v_1
  2967  		mem := v_2
  2968  		if !(canMergeSym(sym1, sym2) && is32Bit(int64(off1)+int64(off2)) && (ptr.Op != OpSB || !config.ctxt.Flag_dynlink)) {
  2969  			break
  2970  		}
  2971  		v.reset(OpLOONG64MOVBstore)
  2972  		v.AuxInt = int32ToAuxInt(off1 + int32(off2))
  2973  		v.Aux = symToAux(mergeSym(sym1, sym2))
  2974  		v.AddArg3(ptr, val, mem)
  2975  		return true
  2976  	}
  2977  	// match: (MOVBstore [off] {sym} ptr (MOVBreg x) mem)
  2978  	// result: (MOVBstore [off] {sym} ptr x mem)
  2979  	for {
  2980  		off := auxIntToInt32(v.AuxInt)
  2981  		sym := auxToSym(v.Aux)
  2982  		ptr := v_0
  2983  		if v_1.Op != OpLOONG64MOVBreg {
  2984  			break
  2985  		}
  2986  		x := v_1.Args[0]
  2987  		mem := v_2
  2988  		v.reset(OpLOONG64MOVBstore)
  2989  		v.AuxInt = int32ToAuxInt(off)
  2990  		v.Aux = symToAux(sym)
  2991  		v.AddArg3(ptr, x, mem)
  2992  		return true
  2993  	}
  2994  	// match: (MOVBstore [off] {sym} ptr (MOVBUreg x) mem)
  2995  	// result: (MOVBstore [off] {sym} ptr x mem)
  2996  	for {
  2997  		off := auxIntToInt32(v.AuxInt)
  2998  		sym := auxToSym(v.Aux)
  2999  		ptr := v_0
  3000  		if v_1.Op != OpLOONG64MOVBUreg {
  3001  			break
  3002  		}
  3003  		x := v_1.Args[0]
  3004  		mem := v_2
  3005  		v.reset(OpLOONG64MOVBstore)
  3006  		v.AuxInt = int32ToAuxInt(off)
  3007  		v.Aux = symToAux(sym)
  3008  		v.AddArg3(ptr, x, mem)
  3009  		return true
  3010  	}
  3011  	// match: (MOVBstore [off] {sym} ptr (MOVHreg x) mem)
  3012  	// result: (MOVBstore [off] {sym} ptr x mem)
  3013  	for {
  3014  		off := auxIntToInt32(v.AuxInt)
  3015  		sym := auxToSym(v.Aux)
  3016  		ptr := v_0
  3017  		if v_1.Op != OpLOONG64MOVHreg {
  3018  			break
  3019  		}
  3020  		x := v_1.Args[0]
  3021  		mem := v_2
  3022  		v.reset(OpLOONG64MOVBstore)
  3023  		v.AuxInt = int32ToAuxInt(off)
  3024  		v.Aux = symToAux(sym)
  3025  		v.AddArg3(ptr, x, mem)
  3026  		return true
  3027  	}
  3028  	// match: (MOVBstore [off] {sym} ptr (MOVHUreg x) mem)
  3029  	// result: (MOVBstore [off] {sym} ptr x mem)
  3030  	for {
  3031  		off := auxIntToInt32(v.AuxInt)
  3032  		sym := auxToSym(v.Aux)
  3033  		ptr := v_0
  3034  		if v_1.Op != OpLOONG64MOVHUreg {
  3035  			break
  3036  		}
  3037  		x := v_1.Args[0]
  3038  		mem := v_2
  3039  		v.reset(OpLOONG64MOVBstore)
  3040  		v.AuxInt = int32ToAuxInt(off)
  3041  		v.Aux = symToAux(sym)
  3042  		v.AddArg3(ptr, x, mem)
  3043  		return true
  3044  	}
  3045  	// match: (MOVBstore [off] {sym} ptr (MOVWreg x) mem)
  3046  	// result: (MOVBstore [off] {sym} ptr x mem)
  3047  	for {
  3048  		off := auxIntToInt32(v.AuxInt)
  3049  		sym := auxToSym(v.Aux)
  3050  		ptr := v_0
  3051  		if v_1.Op != OpLOONG64MOVWreg {
  3052  			break
  3053  		}
  3054  		x := v_1.Args[0]
  3055  		mem := v_2
  3056  		v.reset(OpLOONG64MOVBstore)
  3057  		v.AuxInt = int32ToAuxInt(off)
  3058  		v.Aux = symToAux(sym)
  3059  		v.AddArg3(ptr, x, mem)
  3060  		return true
  3061  	}
  3062  	// match: (MOVBstore [off] {sym} ptr (MOVWUreg x) mem)
  3063  	// result: (MOVBstore [off] {sym} ptr x mem)
  3064  	for {
  3065  		off := auxIntToInt32(v.AuxInt)
  3066  		sym := auxToSym(v.Aux)
  3067  		ptr := v_0
  3068  		if v_1.Op != OpLOONG64MOVWUreg {
  3069  			break
  3070  		}
  3071  		x := v_1.Args[0]
  3072  		mem := v_2
  3073  		v.reset(OpLOONG64MOVBstore)
  3074  		v.AuxInt = int32ToAuxInt(off)
  3075  		v.Aux = symToAux(sym)
  3076  		v.AddArg3(ptr, x, mem)
  3077  		return true
  3078  	}
  3079  	// match: (MOVBstore [off] {sym} (ADDV ptr idx) val mem)
  3080  	// cond: off == 0 && sym == nil
  3081  	// result: (MOVBstoreidx ptr idx val mem)
  3082  	for {
  3083  		off := auxIntToInt32(v.AuxInt)
  3084  		sym := auxToSym(v.Aux)
  3085  		if v_0.Op != OpLOONG64ADDV {
  3086  			break
  3087  		}
  3088  		idx := v_0.Args[1]
  3089  		ptr := v_0.Args[0]
  3090  		val := v_1
  3091  		mem := v_2
  3092  		if !(off == 0 && sym == nil) {
  3093  			break
  3094  		}
  3095  		v.reset(OpLOONG64MOVBstoreidx)
  3096  		v.AddArg4(ptr, idx, val, mem)
  3097  		return true
  3098  	}
  3099  	// match: (MOVBstore [off] {sym} (ADDshiftLLV [shift] ptr idx) val mem)
  3100  	// cond: off == 0 && sym == nil
  3101  	// result: (MOVBstoreidx ptr (SLLVconst <typ.Int64> [shift] idx) val mem)
  3102  	for {
  3103  		off := auxIntToInt32(v.AuxInt)
  3104  		sym := auxToSym(v.Aux)
  3105  		if v_0.Op != OpLOONG64ADDshiftLLV {
  3106  			break
  3107  		}
  3108  		shift := auxIntToInt64(v_0.AuxInt)
  3109  		idx := v_0.Args[1]
  3110  		ptr := v_0.Args[0]
  3111  		val := v_1
  3112  		mem := v_2
  3113  		if !(off == 0 && sym == nil) {
  3114  			break
  3115  		}
  3116  		v.reset(OpLOONG64MOVBstoreidx)
  3117  		v0 := b.NewValue0(v.Pos, OpLOONG64SLLVconst, typ.Int64)
  3118  		v0.AuxInt = int64ToAuxInt(shift)
  3119  		v0.AddArg(idx)
  3120  		v.AddArg4(ptr, v0, val, mem)
  3121  		return true
  3122  	}
  3123  	return false
  3124  }
  3125  func rewriteValueLOONG64_OpLOONG64MOVBstoreidx(v *Value) bool {
  3126  	v_3 := v.Args[3]
  3127  	v_2 := v.Args[2]
  3128  	v_1 := v.Args[1]
  3129  	v_0 := v.Args[0]
  3130  	// match: (MOVBstoreidx ptr (MOVVconst [c]) val mem)
  3131  	// cond: is32Bit(c)
  3132  	// result: (MOVBstore [int32(c)] ptr val mem)
  3133  	for {
  3134  		ptr := v_0
  3135  		if v_1.Op != OpLOONG64MOVVconst {
  3136  			break
  3137  		}
  3138  		c := auxIntToInt64(v_1.AuxInt)
  3139  		val := v_2
  3140  		mem := v_3
  3141  		if !(is32Bit(c)) {
  3142  			break
  3143  		}
  3144  		v.reset(OpLOONG64MOVBstore)
  3145  		v.AuxInt = int32ToAuxInt(int32(c))
  3146  		v.AddArg3(ptr, val, mem)
  3147  		return true
  3148  	}
  3149  	// match: (MOVBstoreidx (MOVVconst [c]) idx val mem)
  3150  	// cond: is32Bit(c)
  3151  	// result: (MOVBstore [int32(c)] idx val mem)
  3152  	for {
  3153  		if v_0.Op != OpLOONG64MOVVconst {
  3154  			break
  3155  		}
  3156  		c := auxIntToInt64(v_0.AuxInt)
  3157  		idx := v_1
  3158  		val := v_2
  3159  		mem := v_3
  3160  		if !(is32Bit(c)) {
  3161  			break
  3162  		}
  3163  		v.reset(OpLOONG64MOVBstore)
  3164  		v.AuxInt = int32ToAuxInt(int32(c))
  3165  		v.AddArg3(idx, val, mem)
  3166  		return true
  3167  	}
  3168  	return false
  3169  }
  3170  func rewriteValueLOONG64_OpLOONG64MOVDload(v *Value) bool {
  3171  	v_1 := v.Args[1]
  3172  	v_0 := v.Args[0]
  3173  	b := v.Block
  3174  	config := b.Func.Config
  3175  	typ := &b.Func.Config.Types
  3176  	// match: (MOVDload [off] {sym} ptr (MOVVstore [off] {sym} ptr val _))
  3177  	// result: (MOVVgpfp val)
  3178  	for {
  3179  		off := auxIntToInt32(v.AuxInt)
  3180  		sym := auxToSym(v.Aux)
  3181  		ptr := v_0
  3182  		if v_1.Op != OpLOONG64MOVVstore || auxIntToInt32(v_1.AuxInt) != off || auxToSym(v_1.Aux) != sym {
  3183  			break
  3184  		}
  3185  		val := v_1.Args[1]
  3186  		if ptr != v_1.Args[0] {
  3187  			break
  3188  		}
  3189  		v.reset(OpLOONG64MOVVgpfp)
  3190  		v.AddArg(val)
  3191  		return true
  3192  	}
  3193  	// match: (MOVDload [off1] {sym} (ADDVconst [off2] ptr) mem)
  3194  	// cond: is32Bit(int64(off1)+off2) && (ptr.Op != OpSB || !config.ctxt.Flag_dynlink)
  3195  	// result: (MOVDload [off1+int32(off2)] {sym} ptr mem)
  3196  	for {
  3197  		off1 := auxIntToInt32(v.AuxInt)
  3198  		sym := auxToSym(v.Aux)
  3199  		if v_0.Op != OpLOONG64ADDVconst {
  3200  			break
  3201  		}
  3202  		off2 := auxIntToInt64(v_0.AuxInt)
  3203  		ptr := v_0.Args[0]
  3204  		mem := v_1
  3205  		if !(is32Bit(int64(off1)+off2) && (ptr.Op != OpSB || !config.ctxt.Flag_dynlink)) {
  3206  			break
  3207  		}
  3208  		v.reset(OpLOONG64MOVDload)
  3209  		v.AuxInt = int32ToAuxInt(off1 + int32(off2))
  3210  		v.Aux = symToAux(sym)
  3211  		v.AddArg2(ptr, mem)
  3212  		return true
  3213  	}
  3214  	// match: (MOVDload [off1] {sym1} (MOVVaddr [off2] {sym2} ptr) mem)
  3215  	// cond: canMergeSym(sym1,sym2) && is32Bit(int64(off1)+int64(off2)) && (ptr.Op != OpSB || !config.ctxt.Flag_dynlink)
  3216  	// result: (MOVDload [off1+int32(off2)] {mergeSym(sym1,sym2)} ptr mem)
  3217  	for {
  3218  		off1 := auxIntToInt32(v.AuxInt)
  3219  		sym1 := auxToSym(v.Aux)
  3220  		if v_0.Op != OpLOONG64MOVVaddr {
  3221  			break
  3222  		}
  3223  		off2 := auxIntToInt32(v_0.AuxInt)
  3224  		sym2 := auxToSym(v_0.Aux)
  3225  		ptr := v_0.Args[0]
  3226  		mem := v_1
  3227  		if !(canMergeSym(sym1, sym2) && is32Bit(int64(off1)+int64(off2)) && (ptr.Op != OpSB || !config.ctxt.Flag_dynlink)) {
  3228  			break
  3229  		}
  3230  		v.reset(OpLOONG64MOVDload)
  3231  		v.AuxInt = int32ToAuxInt(off1 + int32(off2))
  3232  		v.Aux = symToAux(mergeSym(sym1, sym2))
  3233  		v.AddArg2(ptr, mem)
  3234  		return true
  3235  	}
  3236  	// match: (MOVDload [off] {sym} (ADDV ptr idx) mem)
  3237  	// cond: off == 0 && sym == nil
  3238  	// result: (MOVDloadidx ptr idx mem)
  3239  	for {
  3240  		off := auxIntToInt32(v.AuxInt)
  3241  		sym := auxToSym(v.Aux)
  3242  		if v_0.Op != OpLOONG64ADDV {
  3243  			break
  3244  		}
  3245  		idx := v_0.Args[1]
  3246  		ptr := v_0.Args[0]
  3247  		mem := v_1
  3248  		if !(off == 0 && sym == nil) {
  3249  			break
  3250  		}
  3251  		v.reset(OpLOONG64MOVDloadidx)
  3252  		v.AddArg3(ptr, idx, mem)
  3253  		return true
  3254  	}
  3255  	// match: (MOVDload [off] {sym} (ADDshiftLLV [shift] ptr idx) mem)
  3256  	// cond: off == 0 && sym == nil
  3257  	// result: (MOVDloadidx ptr (SLLVconst <typ.Int64> [shift] idx) mem)
  3258  	for {
  3259  		off := auxIntToInt32(v.AuxInt)
  3260  		sym := auxToSym(v.Aux)
  3261  		if v_0.Op != OpLOONG64ADDshiftLLV {
  3262  			break
  3263  		}
  3264  		shift := auxIntToInt64(v_0.AuxInt)
  3265  		idx := v_0.Args[1]
  3266  		ptr := v_0.Args[0]
  3267  		mem := v_1
  3268  		if !(off == 0 && sym == nil) {
  3269  			break
  3270  		}
  3271  		v.reset(OpLOONG64MOVDloadidx)
  3272  		v0 := b.NewValue0(v.Pos, OpLOONG64SLLVconst, typ.Int64)
  3273  		v0.AuxInt = int64ToAuxInt(shift)
  3274  		v0.AddArg(idx)
  3275  		v.AddArg3(ptr, v0, mem)
  3276  		return true
  3277  	}
  3278  	return false
  3279  }
  3280  func rewriteValueLOONG64_OpLOONG64MOVDloadidx(v *Value) bool {
  3281  	v_2 := v.Args[2]
  3282  	v_1 := v.Args[1]
  3283  	v_0 := v.Args[0]
  3284  	// match: (MOVDloadidx ptr (MOVVconst [c]) mem)
  3285  	// cond: is32Bit(c)
  3286  	// result: (MOVDload [int32(c)] ptr mem)
  3287  	for {
  3288  		ptr := v_0
  3289  		if v_1.Op != OpLOONG64MOVVconst {
  3290  			break
  3291  		}
  3292  		c := auxIntToInt64(v_1.AuxInt)
  3293  		mem := v_2
  3294  		if !(is32Bit(c)) {
  3295  			break
  3296  		}
  3297  		v.reset(OpLOONG64MOVDload)
  3298  		v.AuxInt = int32ToAuxInt(int32(c))
  3299  		v.AddArg2(ptr, mem)
  3300  		return true
  3301  	}
  3302  	// match: (MOVDloadidx (MOVVconst [c]) ptr mem)
  3303  	// cond: is32Bit(c)
  3304  	// result: (MOVDload [int32(c)] ptr mem)
  3305  	for {
  3306  		if v_0.Op != OpLOONG64MOVVconst {
  3307  			break
  3308  		}
  3309  		c := auxIntToInt64(v_0.AuxInt)
  3310  		ptr := v_1
  3311  		mem := v_2
  3312  		if !(is32Bit(c)) {
  3313  			break
  3314  		}
  3315  		v.reset(OpLOONG64MOVDload)
  3316  		v.AuxInt = int32ToAuxInt(int32(c))
  3317  		v.AddArg2(ptr, mem)
  3318  		return true
  3319  	}
  3320  	return false
  3321  }
  3322  func rewriteValueLOONG64_OpLOONG64MOVDstore(v *Value) bool {
  3323  	v_2 := v.Args[2]
  3324  	v_1 := v.Args[1]
  3325  	v_0 := v.Args[0]
  3326  	b := v.Block
  3327  	config := b.Func.Config
  3328  	typ := &b.Func.Config.Types
  3329  	// match: (MOVDstore [off] {sym} ptr (MOVVgpfp val) mem)
  3330  	// result: (MOVVstore [off] {sym} ptr val mem)
  3331  	for {
  3332  		off := auxIntToInt32(v.AuxInt)
  3333  		sym := auxToSym(v.Aux)
  3334  		ptr := v_0
  3335  		if v_1.Op != OpLOONG64MOVVgpfp {
  3336  			break
  3337  		}
  3338  		val := v_1.Args[0]
  3339  		mem := v_2
  3340  		v.reset(OpLOONG64MOVVstore)
  3341  		v.AuxInt = int32ToAuxInt(off)
  3342  		v.Aux = symToAux(sym)
  3343  		v.AddArg3(ptr, val, mem)
  3344  		return true
  3345  	}
  3346  	// match: (MOVDstore [off1] {sym} (ADDVconst [off2] ptr) val mem)
  3347  	// cond: is32Bit(int64(off1)+off2) && (ptr.Op != OpSB || !config.ctxt.Flag_dynlink)
  3348  	// result: (MOVDstore [off1+int32(off2)] {sym} ptr val mem)
  3349  	for {
  3350  		off1 := auxIntToInt32(v.AuxInt)
  3351  		sym := auxToSym(v.Aux)
  3352  		if v_0.Op != OpLOONG64ADDVconst {
  3353  			break
  3354  		}
  3355  		off2 := auxIntToInt64(v_0.AuxInt)
  3356  		ptr := v_0.Args[0]
  3357  		val := v_1
  3358  		mem := v_2
  3359  		if !(is32Bit(int64(off1)+off2) && (ptr.Op != OpSB || !config.ctxt.Flag_dynlink)) {
  3360  			break
  3361  		}
  3362  		v.reset(OpLOONG64MOVDstore)
  3363  		v.AuxInt = int32ToAuxInt(off1 + int32(off2))
  3364  		v.Aux = symToAux(sym)
  3365  		v.AddArg3(ptr, val, mem)
  3366  		return true
  3367  	}
  3368  	// match: (MOVDstore [off1] {sym1} (MOVVaddr [off2] {sym2} ptr) val mem)
  3369  	// cond: canMergeSym(sym1,sym2) && is32Bit(int64(off1)+int64(off2)) && (ptr.Op != OpSB || !config.ctxt.Flag_dynlink)
  3370  	// result: (MOVDstore [off1+int32(off2)] {mergeSym(sym1,sym2)} ptr val mem)
  3371  	for {
  3372  		off1 := auxIntToInt32(v.AuxInt)
  3373  		sym1 := auxToSym(v.Aux)
  3374  		if v_0.Op != OpLOONG64MOVVaddr {
  3375  			break
  3376  		}
  3377  		off2 := auxIntToInt32(v_0.AuxInt)
  3378  		sym2 := auxToSym(v_0.Aux)
  3379  		ptr := v_0.Args[0]
  3380  		val := v_1
  3381  		mem := v_2
  3382  		if !(canMergeSym(sym1, sym2) && is32Bit(int64(off1)+int64(off2)) && (ptr.Op != OpSB || !config.ctxt.Flag_dynlink)) {
  3383  			break
  3384  		}
  3385  		v.reset(OpLOONG64MOVDstore)
  3386  		v.AuxInt = int32ToAuxInt(off1 + int32(off2))
  3387  		v.Aux = symToAux(mergeSym(sym1, sym2))
  3388  		v.AddArg3(ptr, val, mem)
  3389  		return true
  3390  	}
  3391  	// match: (MOVDstore [off] {sym} (ADDV ptr idx) val mem)
  3392  	// cond: off == 0 && sym == nil
  3393  	// result: (MOVDstoreidx ptr idx val mem)
  3394  	for {
  3395  		off := auxIntToInt32(v.AuxInt)
  3396  		sym := auxToSym(v.Aux)
  3397  		if v_0.Op != OpLOONG64ADDV {
  3398  			break
  3399  		}
  3400  		idx := v_0.Args[1]
  3401  		ptr := v_0.Args[0]
  3402  		val := v_1
  3403  		mem := v_2
  3404  		if !(off == 0 && sym == nil) {
  3405  			break
  3406  		}
  3407  		v.reset(OpLOONG64MOVDstoreidx)
  3408  		v.AddArg4(ptr, idx, val, mem)
  3409  		return true
  3410  	}
  3411  	// match: (MOVDstore [off] {sym} (ADDshiftLLV [shift] ptr idx) val mem)
  3412  	// cond: off == 0 && sym == nil
  3413  	// result: (MOVDstoreidx ptr (SLLVconst <typ.Int64> [shift] idx) val mem)
  3414  	for {
  3415  		off := auxIntToInt32(v.AuxInt)
  3416  		sym := auxToSym(v.Aux)
  3417  		if v_0.Op != OpLOONG64ADDshiftLLV {
  3418  			break
  3419  		}
  3420  		shift := auxIntToInt64(v_0.AuxInt)
  3421  		idx := v_0.Args[1]
  3422  		ptr := v_0.Args[0]
  3423  		val := v_1
  3424  		mem := v_2
  3425  		if !(off == 0 && sym == nil) {
  3426  			break
  3427  		}
  3428  		v.reset(OpLOONG64MOVDstoreidx)
  3429  		v0 := b.NewValue0(v.Pos, OpLOONG64SLLVconst, typ.Int64)
  3430  		v0.AuxInt = int64ToAuxInt(shift)
  3431  		v0.AddArg(idx)
  3432  		v.AddArg4(ptr, v0, val, mem)
  3433  		return true
  3434  	}
  3435  	return false
  3436  }
  3437  func rewriteValueLOONG64_OpLOONG64MOVDstoreidx(v *Value) bool {
  3438  	v_3 := v.Args[3]
  3439  	v_2 := v.Args[2]
  3440  	v_1 := v.Args[1]
  3441  	v_0 := v.Args[0]
  3442  	// match: (MOVDstoreidx ptr (MOVVconst [c]) val mem)
  3443  	// cond: is32Bit(c)
  3444  	// result: (MOVDstore [int32(c)] ptr val mem)
  3445  	for {
  3446  		ptr := v_0
  3447  		if v_1.Op != OpLOONG64MOVVconst {
  3448  			break
  3449  		}
  3450  		c := auxIntToInt64(v_1.AuxInt)
  3451  		val := v_2
  3452  		mem := v_3
  3453  		if !(is32Bit(c)) {
  3454  			break
  3455  		}
  3456  		v.reset(OpLOONG64MOVDstore)
  3457  		v.AuxInt = int32ToAuxInt(int32(c))
  3458  		v.AddArg3(ptr, val, mem)
  3459  		return true
  3460  	}
  3461  	// match: (MOVDstoreidx (MOVVconst [c]) idx val mem)
  3462  	// cond: is32Bit(c)
  3463  	// result: (MOVDstore [int32(c)] idx val mem)
  3464  	for {
  3465  		if v_0.Op != OpLOONG64MOVVconst {
  3466  			break
  3467  		}
  3468  		c := auxIntToInt64(v_0.AuxInt)
  3469  		idx := v_1
  3470  		val := v_2
  3471  		mem := v_3
  3472  		if !(is32Bit(c)) {
  3473  			break
  3474  		}
  3475  		v.reset(OpLOONG64MOVDstore)
  3476  		v.AuxInt = int32ToAuxInt(int32(c))
  3477  		v.AddArg3(idx, val, mem)
  3478  		return true
  3479  	}
  3480  	return false
  3481  }
  3482  func rewriteValueLOONG64_OpLOONG64MOVFload(v *Value) bool {
  3483  	v_1 := v.Args[1]
  3484  	v_0 := v.Args[0]
  3485  	b := v.Block
  3486  	config := b.Func.Config
  3487  	typ := &b.Func.Config.Types
  3488  	// match: (MOVFload [off] {sym} ptr (MOVWstore [off] {sym} ptr val _))
  3489  	// result: (MOVWgpfp val)
  3490  	for {
  3491  		off := auxIntToInt32(v.AuxInt)
  3492  		sym := auxToSym(v.Aux)
  3493  		ptr := v_0
  3494  		if v_1.Op != OpLOONG64MOVWstore || auxIntToInt32(v_1.AuxInt) != off || auxToSym(v_1.Aux) != sym {
  3495  			break
  3496  		}
  3497  		val := v_1.Args[1]
  3498  		if ptr != v_1.Args[0] {
  3499  			break
  3500  		}
  3501  		v.reset(OpLOONG64MOVWgpfp)
  3502  		v.AddArg(val)
  3503  		return true
  3504  	}
  3505  	// match: (MOVFload [off1] {sym} (ADDVconst [off2] ptr) mem)
  3506  	// cond: is32Bit(int64(off1)+off2) && (ptr.Op != OpSB || !config.ctxt.Flag_dynlink)
  3507  	// result: (MOVFload [off1+int32(off2)] {sym} ptr mem)
  3508  	for {
  3509  		off1 := auxIntToInt32(v.AuxInt)
  3510  		sym := auxToSym(v.Aux)
  3511  		if v_0.Op != OpLOONG64ADDVconst {
  3512  			break
  3513  		}
  3514  		off2 := auxIntToInt64(v_0.AuxInt)
  3515  		ptr := v_0.Args[0]
  3516  		mem := v_1
  3517  		if !(is32Bit(int64(off1)+off2) && (ptr.Op != OpSB || !config.ctxt.Flag_dynlink)) {
  3518  			break
  3519  		}
  3520  		v.reset(OpLOONG64MOVFload)
  3521  		v.AuxInt = int32ToAuxInt(off1 + int32(off2))
  3522  		v.Aux = symToAux(sym)
  3523  		v.AddArg2(ptr, mem)
  3524  		return true
  3525  	}
  3526  	// match: (MOVFload [off1] {sym1} (MOVVaddr [off2] {sym2} ptr) mem)
  3527  	// cond: canMergeSym(sym1,sym2) && is32Bit(int64(off1)+int64(off2)) && (ptr.Op != OpSB || !config.ctxt.Flag_dynlink)
  3528  	// result: (MOVFload [off1+int32(off2)] {mergeSym(sym1,sym2)} ptr mem)
  3529  	for {
  3530  		off1 := auxIntToInt32(v.AuxInt)
  3531  		sym1 := auxToSym(v.Aux)
  3532  		if v_0.Op != OpLOONG64MOVVaddr {
  3533  			break
  3534  		}
  3535  		off2 := auxIntToInt32(v_0.AuxInt)
  3536  		sym2 := auxToSym(v_0.Aux)
  3537  		ptr := v_0.Args[0]
  3538  		mem := v_1
  3539  		if !(canMergeSym(sym1, sym2) && is32Bit(int64(off1)+int64(off2)) && (ptr.Op != OpSB || !config.ctxt.Flag_dynlink)) {
  3540  			break
  3541  		}
  3542  		v.reset(OpLOONG64MOVFload)
  3543  		v.AuxInt = int32ToAuxInt(off1 + int32(off2))
  3544  		v.Aux = symToAux(mergeSym(sym1, sym2))
  3545  		v.AddArg2(ptr, mem)
  3546  		return true
  3547  	}
  3548  	// match: (MOVFload [off] {sym} (ADDV ptr idx) mem)
  3549  	// cond: off == 0 && sym == nil
  3550  	// result: (MOVFloadidx ptr idx mem)
  3551  	for {
  3552  		off := auxIntToInt32(v.AuxInt)
  3553  		sym := auxToSym(v.Aux)
  3554  		if v_0.Op != OpLOONG64ADDV {
  3555  			break
  3556  		}
  3557  		idx := v_0.Args[1]
  3558  		ptr := v_0.Args[0]
  3559  		mem := v_1
  3560  		if !(off == 0 && sym == nil) {
  3561  			break
  3562  		}
  3563  		v.reset(OpLOONG64MOVFloadidx)
  3564  		v.AddArg3(ptr, idx, mem)
  3565  		return true
  3566  	}
  3567  	// match: (MOVFload [off] {sym} (ADDshiftLLV [shift] ptr idx) mem)
  3568  	// cond: off == 0 && sym == nil
  3569  	// result: (MOVFloadidx ptr (SLLVconst <typ.Int64> [shift] idx) mem)
  3570  	for {
  3571  		off := auxIntToInt32(v.AuxInt)
  3572  		sym := auxToSym(v.Aux)
  3573  		if v_0.Op != OpLOONG64ADDshiftLLV {
  3574  			break
  3575  		}
  3576  		shift := auxIntToInt64(v_0.AuxInt)
  3577  		idx := v_0.Args[1]
  3578  		ptr := v_0.Args[0]
  3579  		mem := v_1
  3580  		if !(off == 0 && sym == nil) {
  3581  			break
  3582  		}
  3583  		v.reset(OpLOONG64MOVFloadidx)
  3584  		v0 := b.NewValue0(v.Pos, OpLOONG64SLLVconst, typ.Int64)
  3585  		v0.AuxInt = int64ToAuxInt(shift)
  3586  		v0.AddArg(idx)
  3587  		v.AddArg3(ptr, v0, mem)
  3588  		return true
  3589  	}
  3590  	return false
  3591  }
  3592  func rewriteValueLOONG64_OpLOONG64MOVFloadidx(v *Value) bool {
  3593  	v_2 := v.Args[2]
  3594  	v_1 := v.Args[1]
  3595  	v_0 := v.Args[0]
  3596  	// match: (MOVFloadidx ptr (MOVVconst [c]) mem)
  3597  	// cond: is32Bit(c)
  3598  	// result: (MOVFload [int32(c)] ptr mem)
  3599  	for {
  3600  		ptr := v_0
  3601  		if v_1.Op != OpLOONG64MOVVconst {
  3602  			break
  3603  		}
  3604  		c := auxIntToInt64(v_1.AuxInt)
  3605  		mem := v_2
  3606  		if !(is32Bit(c)) {
  3607  			break
  3608  		}
  3609  		v.reset(OpLOONG64MOVFload)
  3610  		v.AuxInt = int32ToAuxInt(int32(c))
  3611  		v.AddArg2(ptr, mem)
  3612  		return true
  3613  	}
  3614  	// match: (MOVFloadidx (MOVVconst [c]) ptr mem)
  3615  	// cond: is32Bit(c)
  3616  	// result: (MOVFload [int32(c)] ptr mem)
  3617  	for {
  3618  		if v_0.Op != OpLOONG64MOVVconst {
  3619  			break
  3620  		}
  3621  		c := auxIntToInt64(v_0.AuxInt)
  3622  		ptr := v_1
  3623  		mem := v_2
  3624  		if !(is32Bit(c)) {
  3625  			break
  3626  		}
  3627  		v.reset(OpLOONG64MOVFload)
  3628  		v.AuxInt = int32ToAuxInt(int32(c))
  3629  		v.AddArg2(ptr, mem)
  3630  		return true
  3631  	}
  3632  	return false
  3633  }
  3634  func rewriteValueLOONG64_OpLOONG64MOVFstore(v *Value) bool {
  3635  	v_2 := v.Args[2]
  3636  	v_1 := v.Args[1]
  3637  	v_0 := v.Args[0]
  3638  	b := v.Block
  3639  	config := b.Func.Config
  3640  	typ := &b.Func.Config.Types
  3641  	// match: (MOVFstore [off] {sym} ptr (MOVWgpfp val) mem)
  3642  	// result: (MOVWstore [off] {sym} ptr val mem)
  3643  	for {
  3644  		off := auxIntToInt32(v.AuxInt)
  3645  		sym := auxToSym(v.Aux)
  3646  		ptr := v_0
  3647  		if v_1.Op != OpLOONG64MOVWgpfp {
  3648  			break
  3649  		}
  3650  		val := v_1.Args[0]
  3651  		mem := v_2
  3652  		v.reset(OpLOONG64MOVWstore)
  3653  		v.AuxInt = int32ToAuxInt(off)
  3654  		v.Aux = symToAux(sym)
  3655  		v.AddArg3(ptr, val, mem)
  3656  		return true
  3657  	}
  3658  	// match: (MOVFstore [off1] {sym} (ADDVconst [off2] ptr) val mem)
  3659  	// cond: is32Bit(int64(off1)+off2) && (ptr.Op != OpSB || !config.ctxt.Flag_dynlink)
  3660  	// result: (MOVFstore [off1+int32(off2)] {sym} ptr val mem)
  3661  	for {
  3662  		off1 := auxIntToInt32(v.AuxInt)
  3663  		sym := auxToSym(v.Aux)
  3664  		if v_0.Op != OpLOONG64ADDVconst {
  3665  			break
  3666  		}
  3667  		off2 := auxIntToInt64(v_0.AuxInt)
  3668  		ptr := v_0.Args[0]
  3669  		val := v_1
  3670  		mem := v_2
  3671  		if !(is32Bit(int64(off1)+off2) && (ptr.Op != OpSB || !config.ctxt.Flag_dynlink)) {
  3672  			break
  3673  		}
  3674  		v.reset(OpLOONG64MOVFstore)
  3675  		v.AuxInt = int32ToAuxInt(off1 + int32(off2))
  3676  		v.Aux = symToAux(sym)
  3677  		v.AddArg3(ptr, val, mem)
  3678  		return true
  3679  	}
  3680  	// match: (MOVFstore [off1] {sym1} (MOVVaddr [off2] {sym2} ptr) val mem)
  3681  	// cond: canMergeSym(sym1,sym2) && is32Bit(int64(off1)+int64(off2)) && (ptr.Op != OpSB || !config.ctxt.Flag_dynlink)
  3682  	// result: (MOVFstore [off1+int32(off2)] {mergeSym(sym1,sym2)} ptr val mem)
  3683  	for {
  3684  		off1 := auxIntToInt32(v.AuxInt)
  3685  		sym1 := auxToSym(v.Aux)
  3686  		if v_0.Op != OpLOONG64MOVVaddr {
  3687  			break
  3688  		}
  3689  		off2 := auxIntToInt32(v_0.AuxInt)
  3690  		sym2 := auxToSym(v_0.Aux)
  3691  		ptr := v_0.Args[0]
  3692  		val := v_1
  3693  		mem := v_2
  3694  		if !(canMergeSym(sym1, sym2) && is32Bit(int64(off1)+int64(off2)) && (ptr.Op != OpSB || !config.ctxt.Flag_dynlink)) {
  3695  			break
  3696  		}
  3697  		v.reset(OpLOONG64MOVFstore)
  3698  		v.AuxInt = int32ToAuxInt(off1 + int32(off2))
  3699  		v.Aux = symToAux(mergeSym(sym1, sym2))
  3700  		v.AddArg3(ptr, val, mem)
  3701  		return true
  3702  	}
  3703  	// match: (MOVFstore [off] {sym} (ADDV ptr idx) val mem)
  3704  	// cond: off == 0 && sym == nil
  3705  	// result: (MOVFstoreidx ptr idx val mem)
  3706  	for {
  3707  		off := auxIntToInt32(v.AuxInt)
  3708  		sym := auxToSym(v.Aux)
  3709  		if v_0.Op != OpLOONG64ADDV {
  3710  			break
  3711  		}
  3712  		idx := v_0.Args[1]
  3713  		ptr := v_0.Args[0]
  3714  		val := v_1
  3715  		mem := v_2
  3716  		if !(off == 0 && sym == nil) {
  3717  			break
  3718  		}
  3719  		v.reset(OpLOONG64MOVFstoreidx)
  3720  		v.AddArg4(ptr, idx, val, mem)
  3721  		return true
  3722  	}
  3723  	// match: (MOVFstore [off] {sym} (ADDshiftLLV [shift] ptr idx) val mem)
  3724  	// cond: off == 0 && sym == nil
  3725  	// result: (MOVFstoreidx ptr (SLLVconst <typ.Int64> [shift] idx) val mem)
  3726  	for {
  3727  		off := auxIntToInt32(v.AuxInt)
  3728  		sym := auxToSym(v.Aux)
  3729  		if v_0.Op != OpLOONG64ADDshiftLLV {
  3730  			break
  3731  		}
  3732  		shift := auxIntToInt64(v_0.AuxInt)
  3733  		idx := v_0.Args[1]
  3734  		ptr := v_0.Args[0]
  3735  		val := v_1
  3736  		mem := v_2
  3737  		if !(off == 0 && sym == nil) {
  3738  			break
  3739  		}
  3740  		v.reset(OpLOONG64MOVFstoreidx)
  3741  		v0 := b.NewValue0(v.Pos, OpLOONG64SLLVconst, typ.Int64)
  3742  		v0.AuxInt = int64ToAuxInt(shift)
  3743  		v0.AddArg(idx)
  3744  		v.AddArg4(ptr, v0, val, mem)
  3745  		return true
  3746  	}
  3747  	return false
  3748  }
  3749  func rewriteValueLOONG64_OpLOONG64MOVFstoreidx(v *Value) bool {
  3750  	v_3 := v.Args[3]
  3751  	v_2 := v.Args[2]
  3752  	v_1 := v.Args[1]
  3753  	v_0 := v.Args[0]
  3754  	// match: (MOVFstoreidx ptr (MOVVconst [c]) val mem)
  3755  	// cond: is32Bit(c)
  3756  	// result: (MOVFstore [int32(c)] ptr val mem)
  3757  	for {
  3758  		ptr := v_0
  3759  		if v_1.Op != OpLOONG64MOVVconst {
  3760  			break
  3761  		}
  3762  		c := auxIntToInt64(v_1.AuxInt)
  3763  		val := v_2
  3764  		mem := v_3
  3765  		if !(is32Bit(c)) {
  3766  			break
  3767  		}
  3768  		v.reset(OpLOONG64MOVFstore)
  3769  		v.AuxInt = int32ToAuxInt(int32(c))
  3770  		v.AddArg3(ptr, val, mem)
  3771  		return true
  3772  	}
  3773  	// match: (MOVFstoreidx (MOVVconst [c]) idx val mem)
  3774  	// cond: is32Bit(c)
  3775  	// result: (MOVFstore [int32(c)] idx val mem)
  3776  	for {
  3777  		if v_0.Op != OpLOONG64MOVVconst {
  3778  			break
  3779  		}
  3780  		c := auxIntToInt64(v_0.AuxInt)
  3781  		idx := v_1
  3782  		val := v_2
  3783  		mem := v_3
  3784  		if !(is32Bit(c)) {
  3785  			break
  3786  		}
  3787  		v.reset(OpLOONG64MOVFstore)
  3788  		v.AuxInt = int32ToAuxInt(int32(c))
  3789  		v.AddArg3(idx, val, mem)
  3790  		return true
  3791  	}
  3792  	return false
  3793  }
  3794  func rewriteValueLOONG64_OpLOONG64MOVHUload(v *Value) bool {
  3795  	v_1 := v.Args[1]
  3796  	v_0 := v.Args[0]
  3797  	b := v.Block
  3798  	config := b.Func.Config
  3799  	typ := &b.Func.Config.Types
  3800  	// match: (MOVHUload [off] {sym} ptr (MOVHstore [off] {sym} ptr x _))
  3801  	// result: (MOVHUreg x)
  3802  	for {
  3803  		off := auxIntToInt32(v.AuxInt)
  3804  		sym := auxToSym(v.Aux)
  3805  		ptr := v_0
  3806  		if v_1.Op != OpLOONG64MOVHstore || auxIntToInt32(v_1.AuxInt) != off || auxToSym(v_1.Aux) != sym {
  3807  			break
  3808  		}
  3809  		x := v_1.Args[1]
  3810  		if ptr != v_1.Args[0] {
  3811  			break
  3812  		}
  3813  		v.reset(OpLOONG64MOVHUreg)
  3814  		v.AddArg(x)
  3815  		return true
  3816  	}
  3817  	// match: (MOVHUload [off1] {sym} (ADDVconst [off2] ptr) mem)
  3818  	// cond: is32Bit(int64(off1)+off2) && (ptr.Op != OpSB || !config.ctxt.Flag_dynlink)
  3819  	// result: (MOVHUload [off1+int32(off2)] {sym} ptr mem)
  3820  	for {
  3821  		off1 := auxIntToInt32(v.AuxInt)
  3822  		sym := auxToSym(v.Aux)
  3823  		if v_0.Op != OpLOONG64ADDVconst {
  3824  			break
  3825  		}
  3826  		off2 := auxIntToInt64(v_0.AuxInt)
  3827  		ptr := v_0.Args[0]
  3828  		mem := v_1
  3829  		if !(is32Bit(int64(off1)+off2) && (ptr.Op != OpSB || !config.ctxt.Flag_dynlink)) {
  3830  			break
  3831  		}
  3832  		v.reset(OpLOONG64MOVHUload)
  3833  		v.AuxInt = int32ToAuxInt(off1 + int32(off2))
  3834  		v.Aux = symToAux(sym)
  3835  		v.AddArg2(ptr, mem)
  3836  		return true
  3837  	}
  3838  	// match: (MOVHUload [off1] {sym1} (MOVVaddr [off2] {sym2} ptr) mem)
  3839  	// cond: canMergeSym(sym1,sym2) && is32Bit(int64(off1)+int64(off2)) && (ptr.Op != OpSB || !config.ctxt.Flag_dynlink)
  3840  	// result: (MOVHUload [off1+int32(off2)] {mergeSym(sym1,sym2)} ptr mem)
  3841  	for {
  3842  		off1 := auxIntToInt32(v.AuxInt)
  3843  		sym1 := auxToSym(v.Aux)
  3844  		if v_0.Op != OpLOONG64MOVVaddr {
  3845  			break
  3846  		}
  3847  		off2 := auxIntToInt32(v_0.AuxInt)
  3848  		sym2 := auxToSym(v_0.Aux)
  3849  		ptr := v_0.Args[0]
  3850  		mem := v_1
  3851  		if !(canMergeSym(sym1, sym2) && is32Bit(int64(off1)+int64(off2)) && (ptr.Op != OpSB || !config.ctxt.Flag_dynlink)) {
  3852  			break
  3853  		}
  3854  		v.reset(OpLOONG64MOVHUload)
  3855  		v.AuxInt = int32ToAuxInt(off1 + int32(off2))
  3856  		v.Aux = symToAux(mergeSym(sym1, sym2))
  3857  		v.AddArg2(ptr, mem)
  3858  		return true
  3859  	}
  3860  	// match: (MOVHUload [off] {sym} (ADDV ptr idx) mem)
  3861  	// cond: off == 0 && sym == nil
  3862  	// result: (MOVHUloadidx ptr idx mem)
  3863  	for {
  3864  		off := auxIntToInt32(v.AuxInt)
  3865  		sym := auxToSym(v.Aux)
  3866  		if v_0.Op != OpLOONG64ADDV {
  3867  			break
  3868  		}
  3869  		idx := v_0.Args[1]
  3870  		ptr := v_0.Args[0]
  3871  		mem := v_1
  3872  		if !(off == 0 && sym == nil) {
  3873  			break
  3874  		}
  3875  		v.reset(OpLOONG64MOVHUloadidx)
  3876  		v.AddArg3(ptr, idx, mem)
  3877  		return true
  3878  	}
  3879  	// match: (MOVHUload [off] {sym} (ADDshiftLLV [shift] ptr idx) mem)
  3880  	// cond: off == 0 && sym == nil
  3881  	// result: (MOVHUloadidx ptr (SLLVconst <typ.Int64> [shift] idx) mem)
  3882  	for {
  3883  		off := auxIntToInt32(v.AuxInt)
  3884  		sym := auxToSym(v.Aux)
  3885  		if v_0.Op != OpLOONG64ADDshiftLLV {
  3886  			break
  3887  		}
  3888  		shift := auxIntToInt64(v_0.AuxInt)
  3889  		idx := v_0.Args[1]
  3890  		ptr := v_0.Args[0]
  3891  		mem := v_1
  3892  		if !(off == 0 && sym == nil) {
  3893  			break
  3894  		}
  3895  		v.reset(OpLOONG64MOVHUloadidx)
  3896  		v0 := b.NewValue0(v.Pos, OpLOONG64SLLVconst, typ.Int64)
  3897  		v0.AuxInt = int64ToAuxInt(shift)
  3898  		v0.AddArg(idx)
  3899  		v.AddArg3(ptr, v0, mem)
  3900  		return true
  3901  	}
  3902  	// match: (MOVHUload [off] {sym} (SB) _)
  3903  	// cond: symIsRO(sym)
  3904  	// result: (MOVVconst [int64(read16(sym, int64(off), config.ctxt.Arch.ByteOrder))])
  3905  	for {
  3906  		off := auxIntToInt32(v.AuxInt)
  3907  		sym := auxToSym(v.Aux)
  3908  		if v_0.Op != OpSB || !(symIsRO(sym)) {
  3909  			break
  3910  		}
  3911  		v.reset(OpLOONG64MOVVconst)
  3912  		v.AuxInt = int64ToAuxInt(int64(read16(sym, int64(off), config.ctxt.Arch.ByteOrder)))
  3913  		return true
  3914  	}
  3915  	return false
  3916  }
  3917  func rewriteValueLOONG64_OpLOONG64MOVHUloadidx(v *Value) bool {
  3918  	v_2 := v.Args[2]
  3919  	v_1 := v.Args[1]
  3920  	v_0 := v.Args[0]
  3921  	// match: (MOVHUloadidx ptr (MOVVconst [c]) mem)
  3922  	// cond: is32Bit(c)
  3923  	// result: (MOVHUload [int32(c)] ptr mem)
  3924  	for {
  3925  		ptr := v_0
  3926  		if v_1.Op != OpLOONG64MOVVconst {
  3927  			break
  3928  		}
  3929  		c := auxIntToInt64(v_1.AuxInt)
  3930  		mem := v_2
  3931  		if !(is32Bit(c)) {
  3932  			break
  3933  		}
  3934  		v.reset(OpLOONG64MOVHUload)
  3935  		v.AuxInt = int32ToAuxInt(int32(c))
  3936  		v.AddArg2(ptr, mem)
  3937  		return true
  3938  	}
  3939  	// match: (MOVHUloadidx (MOVVconst [c]) ptr mem)
  3940  	// cond: is32Bit(c)
  3941  	// result: (MOVHUload [int32(c)] ptr mem)
  3942  	for {
  3943  		if v_0.Op != OpLOONG64MOVVconst {
  3944  			break
  3945  		}
  3946  		c := auxIntToInt64(v_0.AuxInt)
  3947  		ptr := v_1
  3948  		mem := v_2
  3949  		if !(is32Bit(c)) {
  3950  			break
  3951  		}
  3952  		v.reset(OpLOONG64MOVHUload)
  3953  		v.AuxInt = int32ToAuxInt(int32(c))
  3954  		v.AddArg2(ptr, mem)
  3955  		return true
  3956  	}
  3957  	return false
  3958  }
  3959  func rewriteValueLOONG64_OpLOONG64MOVHUreg(v *Value) bool {
  3960  	v_0 := v.Args[0]
  3961  	// match: (MOVHUreg (SRLVconst [rc] x))
  3962  	// cond: rc < 16
  3963  	// result: (BSTRPICKV [rc + (15+rc)<<6] x)
  3964  	for {
  3965  		if v_0.Op != OpLOONG64SRLVconst {
  3966  			break
  3967  		}
  3968  		rc := auxIntToInt64(v_0.AuxInt)
  3969  		x := v_0.Args[0]
  3970  		if !(rc < 16) {
  3971  			break
  3972  		}
  3973  		v.reset(OpLOONG64BSTRPICKV)
  3974  		v.AuxInt = int64ToAuxInt(rc + (15+rc)<<6)
  3975  		v.AddArg(x)
  3976  		return true
  3977  	}
  3978  	// match: (MOVHUreg x:(MOVBUload _ _))
  3979  	// result: (MOVVreg x)
  3980  	for {
  3981  		x := v_0
  3982  		if x.Op != OpLOONG64MOVBUload {
  3983  			break
  3984  		}
  3985  		v.reset(OpLOONG64MOVVreg)
  3986  		v.AddArg(x)
  3987  		return true
  3988  	}
  3989  	// match: (MOVHUreg x:(MOVHUload _ _))
  3990  	// result: (MOVVreg x)
  3991  	for {
  3992  		x := v_0
  3993  		if x.Op != OpLOONG64MOVHUload {
  3994  			break
  3995  		}
  3996  		v.reset(OpLOONG64MOVVreg)
  3997  		v.AddArg(x)
  3998  		return true
  3999  	}
  4000  	// match: (MOVHUreg x:(MOVBUloadidx _ _ _))
  4001  	// result: (MOVVreg x)
  4002  	for {
  4003  		x := v_0
  4004  		if x.Op != OpLOONG64MOVBUloadidx {
  4005  			break
  4006  		}
  4007  		v.reset(OpLOONG64MOVVreg)
  4008  		v.AddArg(x)
  4009  		return true
  4010  	}
  4011  	// match: (MOVHUreg x:(MOVHUloadidx _ _ _))
  4012  	// result: (MOVVreg x)
  4013  	for {
  4014  		x := v_0
  4015  		if x.Op != OpLOONG64MOVHUloadidx {
  4016  			break
  4017  		}
  4018  		v.reset(OpLOONG64MOVVreg)
  4019  		v.AddArg(x)
  4020  		return true
  4021  	}
  4022  	// match: (MOVHUreg x:(MOVBUreg _))
  4023  	// result: (MOVVreg x)
  4024  	for {
  4025  		x := v_0
  4026  		if x.Op != OpLOONG64MOVBUreg {
  4027  			break
  4028  		}
  4029  		v.reset(OpLOONG64MOVVreg)
  4030  		v.AddArg(x)
  4031  		return true
  4032  	}
  4033  	// match: (MOVHUreg x:(MOVHUreg _))
  4034  	// result: (MOVVreg x)
  4035  	for {
  4036  		x := v_0
  4037  		if x.Op != OpLOONG64MOVHUreg {
  4038  			break
  4039  		}
  4040  		v.reset(OpLOONG64MOVVreg)
  4041  		v.AddArg(x)
  4042  		return true
  4043  	}
  4044  	// match: (MOVHUreg (SLLVconst [lc] x))
  4045  	// cond: lc >= 16
  4046  	// result: (MOVVconst [0])
  4047  	for {
  4048  		if v_0.Op != OpLOONG64SLLVconst {
  4049  			break
  4050  		}
  4051  		lc := auxIntToInt64(v_0.AuxInt)
  4052  		if !(lc >= 16) {
  4053  			break
  4054  		}
  4055  		v.reset(OpLOONG64MOVVconst)
  4056  		v.AuxInt = int64ToAuxInt(0)
  4057  		return true
  4058  	}
  4059  	// match: (MOVHUreg (MOVVconst [c]))
  4060  	// result: (MOVVconst [int64(uint16(c))])
  4061  	for {
  4062  		if v_0.Op != OpLOONG64MOVVconst {
  4063  			break
  4064  		}
  4065  		c := auxIntToInt64(v_0.AuxInt)
  4066  		v.reset(OpLOONG64MOVVconst)
  4067  		v.AuxInt = int64ToAuxInt(int64(uint16(c)))
  4068  		return true
  4069  	}
  4070  	// match: (MOVHUreg x:(ANDconst [c] y))
  4071  	// cond: c >= 0 && int64(uint16(c)) == c
  4072  	// result: x
  4073  	for {
  4074  		x := v_0
  4075  		if x.Op != OpLOONG64ANDconst {
  4076  			break
  4077  		}
  4078  		c := auxIntToInt64(x.AuxInt)
  4079  		if !(c >= 0 && int64(uint16(c)) == c) {
  4080  			break
  4081  		}
  4082  		v.copyOf(x)
  4083  		return true
  4084  	}
  4085  	return false
  4086  }
  4087  func rewriteValueLOONG64_OpLOONG64MOVHload(v *Value) bool {
  4088  	v_1 := v.Args[1]
  4089  	v_0 := v.Args[0]
  4090  	b := v.Block
  4091  	config := b.Func.Config
  4092  	typ := &b.Func.Config.Types
  4093  	// match: (MOVHload [off] {sym} ptr (MOVHstore [off] {sym} ptr x _))
  4094  	// result: (MOVHreg x)
  4095  	for {
  4096  		off := auxIntToInt32(v.AuxInt)
  4097  		sym := auxToSym(v.Aux)
  4098  		ptr := v_0
  4099  		if v_1.Op != OpLOONG64MOVHstore || auxIntToInt32(v_1.AuxInt) != off || auxToSym(v_1.Aux) != sym {
  4100  			break
  4101  		}
  4102  		x := v_1.Args[1]
  4103  		if ptr != v_1.Args[0] {
  4104  			break
  4105  		}
  4106  		v.reset(OpLOONG64MOVHreg)
  4107  		v.AddArg(x)
  4108  		return true
  4109  	}
  4110  	// match: (MOVHload [off1] {sym} (ADDVconst [off2] ptr) mem)
  4111  	// cond: is32Bit(int64(off1)+off2) && (ptr.Op != OpSB || !config.ctxt.Flag_dynlink)
  4112  	// result: (MOVHload [off1+int32(off2)] {sym} ptr mem)
  4113  	for {
  4114  		off1 := auxIntToInt32(v.AuxInt)
  4115  		sym := auxToSym(v.Aux)
  4116  		if v_0.Op != OpLOONG64ADDVconst {
  4117  			break
  4118  		}
  4119  		off2 := auxIntToInt64(v_0.AuxInt)
  4120  		ptr := v_0.Args[0]
  4121  		mem := v_1
  4122  		if !(is32Bit(int64(off1)+off2) && (ptr.Op != OpSB || !config.ctxt.Flag_dynlink)) {
  4123  			break
  4124  		}
  4125  		v.reset(OpLOONG64MOVHload)
  4126  		v.AuxInt = int32ToAuxInt(off1 + int32(off2))
  4127  		v.Aux = symToAux(sym)
  4128  		v.AddArg2(ptr, mem)
  4129  		return true
  4130  	}
  4131  	// match: (MOVHload [off1] {sym1} (MOVVaddr [off2] {sym2} ptr) mem)
  4132  	// cond: canMergeSym(sym1,sym2) && is32Bit(int64(off1)+int64(off2)) && (ptr.Op != OpSB || !config.ctxt.Flag_dynlink)
  4133  	// result: (MOVHload [off1+int32(off2)] {mergeSym(sym1,sym2)} ptr mem)
  4134  	for {
  4135  		off1 := auxIntToInt32(v.AuxInt)
  4136  		sym1 := auxToSym(v.Aux)
  4137  		if v_0.Op != OpLOONG64MOVVaddr {
  4138  			break
  4139  		}
  4140  		off2 := auxIntToInt32(v_0.AuxInt)
  4141  		sym2 := auxToSym(v_0.Aux)
  4142  		ptr := v_0.Args[0]
  4143  		mem := v_1
  4144  		if !(canMergeSym(sym1, sym2) && is32Bit(int64(off1)+int64(off2)) && (ptr.Op != OpSB || !config.ctxt.Flag_dynlink)) {
  4145  			break
  4146  		}
  4147  		v.reset(OpLOONG64MOVHload)
  4148  		v.AuxInt = int32ToAuxInt(off1 + int32(off2))
  4149  		v.Aux = symToAux(mergeSym(sym1, sym2))
  4150  		v.AddArg2(ptr, mem)
  4151  		return true
  4152  	}
  4153  	// match: (MOVHload [off] {sym} (ADDV ptr idx) mem)
  4154  	// cond: off == 0 && sym == nil
  4155  	// result: (MOVHloadidx ptr idx mem)
  4156  	for {
  4157  		off := auxIntToInt32(v.AuxInt)
  4158  		sym := auxToSym(v.Aux)
  4159  		if v_0.Op != OpLOONG64ADDV {
  4160  			break
  4161  		}
  4162  		idx := v_0.Args[1]
  4163  		ptr := v_0.Args[0]
  4164  		mem := v_1
  4165  		if !(off == 0 && sym == nil) {
  4166  			break
  4167  		}
  4168  		v.reset(OpLOONG64MOVHloadidx)
  4169  		v.AddArg3(ptr, idx, mem)
  4170  		return true
  4171  	}
  4172  	// match: (MOVHload [off] {sym} (ADDshiftLLV [shift] ptr idx) mem)
  4173  	// cond: off == 0 && sym == nil
  4174  	// result: (MOVHloadidx ptr (SLLVconst <typ.Int64> [shift] idx) mem)
  4175  	for {
  4176  		off := auxIntToInt32(v.AuxInt)
  4177  		sym := auxToSym(v.Aux)
  4178  		if v_0.Op != OpLOONG64ADDshiftLLV {
  4179  			break
  4180  		}
  4181  		shift := auxIntToInt64(v_0.AuxInt)
  4182  		idx := v_0.Args[1]
  4183  		ptr := v_0.Args[0]
  4184  		mem := v_1
  4185  		if !(off == 0 && sym == nil) {
  4186  			break
  4187  		}
  4188  		v.reset(OpLOONG64MOVHloadidx)
  4189  		v0 := b.NewValue0(v.Pos, OpLOONG64SLLVconst, typ.Int64)
  4190  		v0.AuxInt = int64ToAuxInt(shift)
  4191  		v0.AddArg(idx)
  4192  		v.AddArg3(ptr, v0, mem)
  4193  		return true
  4194  	}
  4195  	// match: (MOVHload [off] {sym} (SB) _)
  4196  	// cond: symIsRO(sym)
  4197  	// result: (MOVVconst [int64(int16(read16(sym, int64(off), config.ctxt.Arch.ByteOrder)))])
  4198  	for {
  4199  		off := auxIntToInt32(v.AuxInt)
  4200  		sym := auxToSym(v.Aux)
  4201  		if v_0.Op != OpSB || !(symIsRO(sym)) {
  4202  			break
  4203  		}
  4204  		v.reset(OpLOONG64MOVVconst)
  4205  		v.AuxInt = int64ToAuxInt(int64(int16(read16(sym, int64(off), config.ctxt.Arch.ByteOrder))))
  4206  		return true
  4207  	}
  4208  	return false
  4209  }
  4210  func rewriteValueLOONG64_OpLOONG64MOVHloadidx(v *Value) bool {
  4211  	v_2 := v.Args[2]
  4212  	v_1 := v.Args[1]
  4213  	v_0 := v.Args[0]
  4214  	// match: (MOVHloadidx ptr (MOVVconst [c]) mem)
  4215  	// cond: is32Bit(c)
  4216  	// result: (MOVHload [int32(c)] ptr mem)
  4217  	for {
  4218  		ptr := v_0
  4219  		if v_1.Op != OpLOONG64MOVVconst {
  4220  			break
  4221  		}
  4222  		c := auxIntToInt64(v_1.AuxInt)
  4223  		mem := v_2
  4224  		if !(is32Bit(c)) {
  4225  			break
  4226  		}
  4227  		v.reset(OpLOONG64MOVHload)
  4228  		v.AuxInt = int32ToAuxInt(int32(c))
  4229  		v.AddArg2(ptr, mem)
  4230  		return true
  4231  	}
  4232  	// match: (MOVHloadidx (MOVVconst [c]) ptr mem)
  4233  	// cond: is32Bit(c)
  4234  	// result: (MOVHload [int32(c)] ptr mem)
  4235  	for {
  4236  		if v_0.Op != OpLOONG64MOVVconst {
  4237  			break
  4238  		}
  4239  		c := auxIntToInt64(v_0.AuxInt)
  4240  		ptr := v_1
  4241  		mem := v_2
  4242  		if !(is32Bit(c)) {
  4243  			break
  4244  		}
  4245  		v.reset(OpLOONG64MOVHload)
  4246  		v.AuxInt = int32ToAuxInt(int32(c))
  4247  		v.AddArg2(ptr, mem)
  4248  		return true
  4249  	}
  4250  	return false
  4251  }
  4252  func rewriteValueLOONG64_OpLOONG64MOVHreg(v *Value) bool {
  4253  	v_0 := v.Args[0]
  4254  	// match: (MOVHreg x:(MOVBload _ _))
  4255  	// result: (MOVVreg x)
  4256  	for {
  4257  		x := v_0
  4258  		if x.Op != OpLOONG64MOVBload {
  4259  			break
  4260  		}
  4261  		v.reset(OpLOONG64MOVVreg)
  4262  		v.AddArg(x)
  4263  		return true
  4264  	}
  4265  	// match: (MOVHreg x:(MOVBUload _ _))
  4266  	// result: (MOVVreg x)
  4267  	for {
  4268  		x := v_0
  4269  		if x.Op != OpLOONG64MOVBUload {
  4270  			break
  4271  		}
  4272  		v.reset(OpLOONG64MOVVreg)
  4273  		v.AddArg(x)
  4274  		return true
  4275  	}
  4276  	// match: (MOVHreg x:(MOVHload _ _))
  4277  	// result: (MOVVreg x)
  4278  	for {
  4279  		x := v_0
  4280  		if x.Op != OpLOONG64MOVHload {
  4281  			break
  4282  		}
  4283  		v.reset(OpLOONG64MOVVreg)
  4284  		v.AddArg(x)
  4285  		return true
  4286  	}
  4287  	// match: (MOVHreg x:(MOVBloadidx _ _ _))
  4288  	// result: (MOVVreg x)
  4289  	for {
  4290  		x := v_0
  4291  		if x.Op != OpLOONG64MOVBloadidx {
  4292  			break
  4293  		}
  4294  		v.reset(OpLOONG64MOVVreg)
  4295  		v.AddArg(x)
  4296  		return true
  4297  	}
  4298  	// match: (MOVHreg x:(MOVBUloadidx _ _ _))
  4299  	// result: (MOVVreg x)
  4300  	for {
  4301  		x := v_0
  4302  		if x.Op != OpLOONG64MOVBUloadidx {
  4303  			break
  4304  		}
  4305  		v.reset(OpLOONG64MOVVreg)
  4306  		v.AddArg(x)
  4307  		return true
  4308  	}
  4309  	// match: (MOVHreg x:(MOVHloadidx _ _ _))
  4310  	// result: (MOVVreg x)
  4311  	for {
  4312  		x := v_0
  4313  		if x.Op != OpLOONG64MOVHloadidx {
  4314  			break
  4315  		}
  4316  		v.reset(OpLOONG64MOVVreg)
  4317  		v.AddArg(x)
  4318  		return true
  4319  	}
  4320  	// match: (MOVHreg x:(MOVBreg _))
  4321  	// result: (MOVVreg x)
  4322  	for {
  4323  		x := v_0
  4324  		if x.Op != OpLOONG64MOVBreg {
  4325  			break
  4326  		}
  4327  		v.reset(OpLOONG64MOVVreg)
  4328  		v.AddArg(x)
  4329  		return true
  4330  	}
  4331  	// match: (MOVHreg x:(MOVBUreg _))
  4332  	// result: (MOVVreg x)
  4333  	for {
  4334  		x := v_0
  4335  		if x.Op != OpLOONG64MOVBUreg {
  4336  			break
  4337  		}
  4338  		v.reset(OpLOONG64MOVVreg)
  4339  		v.AddArg(x)
  4340  		return true
  4341  	}
  4342  	// match: (MOVHreg x:(MOVHreg _))
  4343  	// result: (MOVVreg x)
  4344  	for {
  4345  		x := v_0
  4346  		if x.Op != OpLOONG64MOVHreg {
  4347  			break
  4348  		}
  4349  		v.reset(OpLOONG64MOVVreg)
  4350  		v.AddArg(x)
  4351  		return true
  4352  	}
  4353  	// match: (MOVHreg (MOVVconst [c]))
  4354  	// result: (MOVVconst [int64(int16(c))])
  4355  	for {
  4356  		if v_0.Op != OpLOONG64MOVVconst {
  4357  			break
  4358  		}
  4359  		c := auxIntToInt64(v_0.AuxInt)
  4360  		v.reset(OpLOONG64MOVVconst)
  4361  		v.AuxInt = int64ToAuxInt(int64(int16(c)))
  4362  		return true
  4363  	}
  4364  	// match: (MOVHreg x:(ANDconst [c] y))
  4365  	// cond: c >= 0 && int64(int16(c)) == c
  4366  	// result: x
  4367  	for {
  4368  		x := v_0
  4369  		if x.Op != OpLOONG64ANDconst {
  4370  			break
  4371  		}
  4372  		c := auxIntToInt64(x.AuxInt)
  4373  		if !(c >= 0 && int64(int16(c)) == c) {
  4374  			break
  4375  		}
  4376  		v.copyOf(x)
  4377  		return true
  4378  	}
  4379  	return false
  4380  }
  4381  func rewriteValueLOONG64_OpLOONG64MOVHstore(v *Value) bool {
  4382  	v_2 := v.Args[2]
  4383  	v_1 := v.Args[1]
  4384  	v_0 := v.Args[0]
  4385  	b := v.Block
  4386  	config := b.Func.Config
  4387  	typ := &b.Func.Config.Types
  4388  	// match: (MOVHstore [off1] {sym} (ADDVconst [off2] ptr) val mem)
  4389  	// cond: is32Bit(int64(off1)+off2) && (ptr.Op != OpSB || !config.ctxt.Flag_dynlink)
  4390  	// result: (MOVHstore [off1+int32(off2)] {sym} ptr val mem)
  4391  	for {
  4392  		off1 := auxIntToInt32(v.AuxInt)
  4393  		sym := auxToSym(v.Aux)
  4394  		if v_0.Op != OpLOONG64ADDVconst {
  4395  			break
  4396  		}
  4397  		off2 := auxIntToInt64(v_0.AuxInt)
  4398  		ptr := v_0.Args[0]
  4399  		val := v_1
  4400  		mem := v_2
  4401  		if !(is32Bit(int64(off1)+off2) && (ptr.Op != OpSB || !config.ctxt.Flag_dynlink)) {
  4402  			break
  4403  		}
  4404  		v.reset(OpLOONG64MOVHstore)
  4405  		v.AuxInt = int32ToAuxInt(off1 + int32(off2))
  4406  		v.Aux = symToAux(sym)
  4407  		v.AddArg3(ptr, val, mem)
  4408  		return true
  4409  	}
  4410  	// match: (MOVHstore [off1] {sym1} (MOVVaddr [off2] {sym2} ptr) val mem)
  4411  	// cond: canMergeSym(sym1,sym2) && is32Bit(int64(off1)+int64(off2)) && (ptr.Op != OpSB || !config.ctxt.Flag_dynlink)
  4412  	// result: (MOVHstore [off1+int32(off2)] {mergeSym(sym1,sym2)} ptr val mem)
  4413  	for {
  4414  		off1 := auxIntToInt32(v.AuxInt)
  4415  		sym1 := auxToSym(v.Aux)
  4416  		if v_0.Op != OpLOONG64MOVVaddr {
  4417  			break
  4418  		}
  4419  		off2 := auxIntToInt32(v_0.AuxInt)
  4420  		sym2 := auxToSym(v_0.Aux)
  4421  		ptr := v_0.Args[0]
  4422  		val := v_1
  4423  		mem := v_2
  4424  		if !(canMergeSym(sym1, sym2) && is32Bit(int64(off1)+int64(off2)) && (ptr.Op != OpSB || !config.ctxt.Flag_dynlink)) {
  4425  			break
  4426  		}
  4427  		v.reset(OpLOONG64MOVHstore)
  4428  		v.AuxInt = int32ToAuxInt(off1 + int32(off2))
  4429  		v.Aux = symToAux(mergeSym(sym1, sym2))
  4430  		v.AddArg3(ptr, val, mem)
  4431  		return true
  4432  	}
  4433  	// match: (MOVHstore [off] {sym} ptr (MOVHreg x) mem)
  4434  	// result: (MOVHstore [off] {sym} ptr x mem)
  4435  	for {
  4436  		off := auxIntToInt32(v.AuxInt)
  4437  		sym := auxToSym(v.Aux)
  4438  		ptr := v_0
  4439  		if v_1.Op != OpLOONG64MOVHreg {
  4440  			break
  4441  		}
  4442  		x := v_1.Args[0]
  4443  		mem := v_2
  4444  		v.reset(OpLOONG64MOVHstore)
  4445  		v.AuxInt = int32ToAuxInt(off)
  4446  		v.Aux = symToAux(sym)
  4447  		v.AddArg3(ptr, x, mem)
  4448  		return true
  4449  	}
  4450  	// match: (MOVHstore [off] {sym} ptr (MOVHUreg x) mem)
  4451  	// result: (MOVHstore [off] {sym} ptr x mem)
  4452  	for {
  4453  		off := auxIntToInt32(v.AuxInt)
  4454  		sym := auxToSym(v.Aux)
  4455  		ptr := v_0
  4456  		if v_1.Op != OpLOONG64MOVHUreg {
  4457  			break
  4458  		}
  4459  		x := v_1.Args[0]
  4460  		mem := v_2
  4461  		v.reset(OpLOONG64MOVHstore)
  4462  		v.AuxInt = int32ToAuxInt(off)
  4463  		v.Aux = symToAux(sym)
  4464  		v.AddArg3(ptr, x, mem)
  4465  		return true
  4466  	}
  4467  	// match: (MOVHstore [off] {sym} ptr (MOVWreg x) mem)
  4468  	// result: (MOVHstore [off] {sym} ptr x mem)
  4469  	for {
  4470  		off := auxIntToInt32(v.AuxInt)
  4471  		sym := auxToSym(v.Aux)
  4472  		ptr := v_0
  4473  		if v_1.Op != OpLOONG64MOVWreg {
  4474  			break
  4475  		}
  4476  		x := v_1.Args[0]
  4477  		mem := v_2
  4478  		v.reset(OpLOONG64MOVHstore)
  4479  		v.AuxInt = int32ToAuxInt(off)
  4480  		v.Aux = symToAux(sym)
  4481  		v.AddArg3(ptr, x, mem)
  4482  		return true
  4483  	}
  4484  	// match: (MOVHstore [off] {sym} ptr (MOVWUreg x) mem)
  4485  	// result: (MOVHstore [off] {sym} ptr x mem)
  4486  	for {
  4487  		off := auxIntToInt32(v.AuxInt)
  4488  		sym := auxToSym(v.Aux)
  4489  		ptr := v_0
  4490  		if v_1.Op != OpLOONG64MOVWUreg {
  4491  			break
  4492  		}
  4493  		x := v_1.Args[0]
  4494  		mem := v_2
  4495  		v.reset(OpLOONG64MOVHstore)
  4496  		v.AuxInt = int32ToAuxInt(off)
  4497  		v.Aux = symToAux(sym)
  4498  		v.AddArg3(ptr, x, mem)
  4499  		return true
  4500  	}
  4501  	// match: (MOVHstore [off] {sym} (ADDV ptr idx) val mem)
  4502  	// cond: off == 0 && sym == nil
  4503  	// result: (MOVHstoreidx ptr idx val mem)
  4504  	for {
  4505  		off := auxIntToInt32(v.AuxInt)
  4506  		sym := auxToSym(v.Aux)
  4507  		if v_0.Op != OpLOONG64ADDV {
  4508  			break
  4509  		}
  4510  		idx := v_0.Args[1]
  4511  		ptr := v_0.Args[0]
  4512  		val := v_1
  4513  		mem := v_2
  4514  		if !(off == 0 && sym == nil) {
  4515  			break
  4516  		}
  4517  		v.reset(OpLOONG64MOVHstoreidx)
  4518  		v.AddArg4(ptr, idx, val, mem)
  4519  		return true
  4520  	}
  4521  	// match: (MOVHstore [off] {sym} (ADDshiftLLV [shift] ptr idx) val mem)
  4522  	// cond: off == 0 && sym == nil
  4523  	// result: (MOVHstoreidx ptr (SLLVconst <typ.Int64> [shift] idx) val mem)
  4524  	for {
  4525  		off := auxIntToInt32(v.AuxInt)
  4526  		sym := auxToSym(v.Aux)
  4527  		if v_0.Op != OpLOONG64ADDshiftLLV {
  4528  			break
  4529  		}
  4530  		shift := auxIntToInt64(v_0.AuxInt)
  4531  		idx := v_0.Args[1]
  4532  		ptr := v_0.Args[0]
  4533  		val := v_1
  4534  		mem := v_2
  4535  		if !(off == 0 && sym == nil) {
  4536  			break
  4537  		}
  4538  		v.reset(OpLOONG64MOVHstoreidx)
  4539  		v0 := b.NewValue0(v.Pos, OpLOONG64SLLVconst, typ.Int64)
  4540  		v0.AuxInt = int64ToAuxInt(shift)
  4541  		v0.AddArg(idx)
  4542  		v.AddArg4(ptr, v0, val, mem)
  4543  		return true
  4544  	}
  4545  	return false
  4546  }
  4547  func rewriteValueLOONG64_OpLOONG64MOVHstoreidx(v *Value) bool {
  4548  	v_3 := v.Args[3]
  4549  	v_2 := v.Args[2]
  4550  	v_1 := v.Args[1]
  4551  	v_0 := v.Args[0]
  4552  	// match: (MOVHstoreidx ptr (MOVVconst [c]) val mem)
  4553  	// cond: is32Bit(c)
  4554  	// result: (MOVHstore [int32(c)] ptr val mem)
  4555  	for {
  4556  		ptr := v_0
  4557  		if v_1.Op != OpLOONG64MOVVconst {
  4558  			break
  4559  		}
  4560  		c := auxIntToInt64(v_1.AuxInt)
  4561  		val := v_2
  4562  		mem := v_3
  4563  		if !(is32Bit(c)) {
  4564  			break
  4565  		}
  4566  		v.reset(OpLOONG64MOVHstore)
  4567  		v.AuxInt = int32ToAuxInt(int32(c))
  4568  		v.AddArg3(ptr, val, mem)
  4569  		return true
  4570  	}
  4571  	// match: (MOVHstoreidx (MOVVconst [c]) idx val mem)
  4572  	// cond: is32Bit(c)
  4573  	// result: (MOVHstore [int32(c)] idx val mem)
  4574  	for {
  4575  		if v_0.Op != OpLOONG64MOVVconst {
  4576  			break
  4577  		}
  4578  		c := auxIntToInt64(v_0.AuxInt)
  4579  		idx := v_1
  4580  		val := v_2
  4581  		mem := v_3
  4582  		if !(is32Bit(c)) {
  4583  			break
  4584  		}
  4585  		v.reset(OpLOONG64MOVHstore)
  4586  		v.AuxInt = int32ToAuxInt(int32(c))
  4587  		v.AddArg3(idx, val, mem)
  4588  		return true
  4589  	}
  4590  	return false
  4591  }
  4592  func rewriteValueLOONG64_OpLOONG64MOVVload(v *Value) bool {
  4593  	v_1 := v.Args[1]
  4594  	v_0 := v.Args[0]
  4595  	b := v.Block
  4596  	config := b.Func.Config
  4597  	typ := &b.Func.Config.Types
  4598  	// match: (MOVVload [off] {sym} ptr (MOVDstore [off] {sym} ptr val _))
  4599  	// result: (MOVVfpgp val)
  4600  	for {
  4601  		off := auxIntToInt32(v.AuxInt)
  4602  		sym := auxToSym(v.Aux)
  4603  		ptr := v_0
  4604  		if v_1.Op != OpLOONG64MOVDstore || auxIntToInt32(v_1.AuxInt) != off || auxToSym(v_1.Aux) != sym {
  4605  			break
  4606  		}
  4607  		val := v_1.Args[1]
  4608  		if ptr != v_1.Args[0] {
  4609  			break
  4610  		}
  4611  		v.reset(OpLOONG64MOVVfpgp)
  4612  		v.AddArg(val)
  4613  		return true
  4614  	}
  4615  	// match: (MOVVload [off] {sym} ptr (MOVVstore [off] {sym} ptr x _))
  4616  	// result: (MOVVreg x)
  4617  	for {
  4618  		off := auxIntToInt32(v.AuxInt)
  4619  		sym := auxToSym(v.Aux)
  4620  		ptr := v_0
  4621  		if v_1.Op != OpLOONG64MOVVstore || auxIntToInt32(v_1.AuxInt) != off || auxToSym(v_1.Aux) != sym {
  4622  			break
  4623  		}
  4624  		x := v_1.Args[1]
  4625  		if ptr != v_1.Args[0] {
  4626  			break
  4627  		}
  4628  		v.reset(OpLOONG64MOVVreg)
  4629  		v.AddArg(x)
  4630  		return true
  4631  	}
  4632  	// match: (MOVVload [off1] {sym} (ADDVconst [off2] ptr) mem)
  4633  	// cond: is32Bit(int64(off1)+off2) && (ptr.Op != OpSB || !config.ctxt.Flag_dynlink)
  4634  	// result: (MOVVload [off1+int32(off2)] {sym} ptr mem)
  4635  	for {
  4636  		off1 := auxIntToInt32(v.AuxInt)
  4637  		sym := auxToSym(v.Aux)
  4638  		if v_0.Op != OpLOONG64ADDVconst {
  4639  			break
  4640  		}
  4641  		off2 := auxIntToInt64(v_0.AuxInt)
  4642  		ptr := v_0.Args[0]
  4643  		mem := v_1
  4644  		if !(is32Bit(int64(off1)+off2) && (ptr.Op != OpSB || !config.ctxt.Flag_dynlink)) {
  4645  			break
  4646  		}
  4647  		v.reset(OpLOONG64MOVVload)
  4648  		v.AuxInt = int32ToAuxInt(off1 + int32(off2))
  4649  		v.Aux = symToAux(sym)
  4650  		v.AddArg2(ptr, mem)
  4651  		return true
  4652  	}
  4653  	// match: (MOVVload [off1] {sym1} (MOVVaddr [off2] {sym2} ptr) mem)
  4654  	// cond: canMergeSym(sym1,sym2) && is32Bit(int64(off1)+int64(off2)) && (ptr.Op != OpSB || !config.ctxt.Flag_dynlink)
  4655  	// result: (MOVVload [off1+int32(off2)] {mergeSym(sym1,sym2)} ptr mem)
  4656  	for {
  4657  		off1 := auxIntToInt32(v.AuxInt)
  4658  		sym1 := auxToSym(v.Aux)
  4659  		if v_0.Op != OpLOONG64MOVVaddr {
  4660  			break
  4661  		}
  4662  		off2 := auxIntToInt32(v_0.AuxInt)
  4663  		sym2 := auxToSym(v_0.Aux)
  4664  		ptr := v_0.Args[0]
  4665  		mem := v_1
  4666  		if !(canMergeSym(sym1, sym2) && is32Bit(int64(off1)+int64(off2)) && (ptr.Op != OpSB || !config.ctxt.Flag_dynlink)) {
  4667  			break
  4668  		}
  4669  		v.reset(OpLOONG64MOVVload)
  4670  		v.AuxInt = int32ToAuxInt(off1 + int32(off2))
  4671  		v.Aux = symToAux(mergeSym(sym1, sym2))
  4672  		v.AddArg2(ptr, mem)
  4673  		return true
  4674  	}
  4675  	// match: (MOVVload [off] {sym} (ADDV ptr idx) mem)
  4676  	// cond: off == 0 && sym == nil
  4677  	// result: (MOVVloadidx ptr idx mem)
  4678  	for {
  4679  		off := auxIntToInt32(v.AuxInt)
  4680  		sym := auxToSym(v.Aux)
  4681  		if v_0.Op != OpLOONG64ADDV {
  4682  			break
  4683  		}
  4684  		idx := v_0.Args[1]
  4685  		ptr := v_0.Args[0]
  4686  		mem := v_1
  4687  		if !(off == 0 && sym == nil) {
  4688  			break
  4689  		}
  4690  		v.reset(OpLOONG64MOVVloadidx)
  4691  		v.AddArg3(ptr, idx, mem)
  4692  		return true
  4693  	}
  4694  	// match: (MOVVload [off] {sym} (ADDshiftLLV [shift] ptr idx) mem)
  4695  	// cond: off == 0 && sym == nil
  4696  	// result: (MOVVloadidx ptr (SLLVconst <typ.Int64> [shift] idx) mem)
  4697  	for {
  4698  		off := auxIntToInt32(v.AuxInt)
  4699  		sym := auxToSym(v.Aux)
  4700  		if v_0.Op != OpLOONG64ADDshiftLLV {
  4701  			break
  4702  		}
  4703  		shift := auxIntToInt64(v_0.AuxInt)
  4704  		idx := v_0.Args[1]
  4705  		ptr := v_0.Args[0]
  4706  		mem := v_1
  4707  		if !(off == 0 && sym == nil) {
  4708  			break
  4709  		}
  4710  		v.reset(OpLOONG64MOVVloadidx)
  4711  		v0 := b.NewValue0(v.Pos, OpLOONG64SLLVconst, typ.Int64)
  4712  		v0.AuxInt = int64ToAuxInt(shift)
  4713  		v0.AddArg(idx)
  4714  		v.AddArg3(ptr, v0, mem)
  4715  		return true
  4716  	}
  4717  	// match: (MOVVload [off] {sym} (SB) _)
  4718  	// cond: symIsRO(sym)
  4719  	// result: (MOVVconst [int64(read64(sym, int64(off), config.ctxt.Arch.ByteOrder))])
  4720  	for {
  4721  		off := auxIntToInt32(v.AuxInt)
  4722  		sym := auxToSym(v.Aux)
  4723  		if v_0.Op != OpSB || !(symIsRO(sym)) {
  4724  			break
  4725  		}
  4726  		v.reset(OpLOONG64MOVVconst)
  4727  		v.AuxInt = int64ToAuxInt(int64(read64(sym, int64(off), config.ctxt.Arch.ByteOrder)))
  4728  		return true
  4729  	}
  4730  	return false
  4731  }
  4732  func rewriteValueLOONG64_OpLOONG64MOVVloadidx(v *Value) bool {
  4733  	v_2 := v.Args[2]
  4734  	v_1 := v.Args[1]
  4735  	v_0 := v.Args[0]
  4736  	// match: (MOVVloadidx ptr (MOVVconst [c]) mem)
  4737  	// cond: is32Bit(c)
  4738  	// result: (MOVVload [int32(c)] ptr mem)
  4739  	for {
  4740  		ptr := v_0
  4741  		if v_1.Op != OpLOONG64MOVVconst {
  4742  			break
  4743  		}
  4744  		c := auxIntToInt64(v_1.AuxInt)
  4745  		mem := v_2
  4746  		if !(is32Bit(c)) {
  4747  			break
  4748  		}
  4749  		v.reset(OpLOONG64MOVVload)
  4750  		v.AuxInt = int32ToAuxInt(int32(c))
  4751  		v.AddArg2(ptr, mem)
  4752  		return true
  4753  	}
  4754  	// match: (MOVVloadidx (MOVVconst [c]) ptr mem)
  4755  	// cond: is32Bit(c)
  4756  	// result: (MOVVload [int32(c)] ptr mem)
  4757  	for {
  4758  		if v_0.Op != OpLOONG64MOVVconst {
  4759  			break
  4760  		}
  4761  		c := auxIntToInt64(v_0.AuxInt)
  4762  		ptr := v_1
  4763  		mem := v_2
  4764  		if !(is32Bit(c)) {
  4765  			break
  4766  		}
  4767  		v.reset(OpLOONG64MOVVload)
  4768  		v.AuxInt = int32ToAuxInt(int32(c))
  4769  		v.AddArg2(ptr, mem)
  4770  		return true
  4771  	}
  4772  	return false
  4773  }
  4774  func rewriteValueLOONG64_OpLOONG64MOVVnop(v *Value) bool {
  4775  	v_0 := v.Args[0]
  4776  	// match: (MOVVnop (MOVVconst [c]))
  4777  	// result: (MOVVconst [c])
  4778  	for {
  4779  		if v_0.Op != OpLOONG64MOVVconst {
  4780  			break
  4781  		}
  4782  		c := auxIntToInt64(v_0.AuxInt)
  4783  		v.reset(OpLOONG64MOVVconst)
  4784  		v.AuxInt = int64ToAuxInt(c)
  4785  		return true
  4786  	}
  4787  	return false
  4788  }
  4789  func rewriteValueLOONG64_OpLOONG64MOVVreg(v *Value) bool {
  4790  	v_0 := v.Args[0]
  4791  	// match: (MOVVreg x)
  4792  	// cond: x.Uses == 1
  4793  	// result: (MOVVnop x)
  4794  	for {
  4795  		x := v_0
  4796  		if !(x.Uses == 1) {
  4797  			break
  4798  		}
  4799  		v.reset(OpLOONG64MOVVnop)
  4800  		v.AddArg(x)
  4801  		return true
  4802  	}
  4803  	// match: (MOVVreg (MOVVconst [c]))
  4804  	// result: (MOVVconst [c])
  4805  	for {
  4806  		if v_0.Op != OpLOONG64MOVVconst {
  4807  			break
  4808  		}
  4809  		c := auxIntToInt64(v_0.AuxInt)
  4810  		v.reset(OpLOONG64MOVVconst)
  4811  		v.AuxInt = int64ToAuxInt(c)
  4812  		return true
  4813  	}
  4814  	return false
  4815  }
  4816  func rewriteValueLOONG64_OpLOONG64MOVVstore(v *Value) bool {
  4817  	v_2 := v.Args[2]
  4818  	v_1 := v.Args[1]
  4819  	v_0 := v.Args[0]
  4820  	b := v.Block
  4821  	config := b.Func.Config
  4822  	typ := &b.Func.Config.Types
  4823  	// match: (MOVVstore [off] {sym} ptr (MOVVfpgp val) mem)
  4824  	// result: (MOVDstore [off] {sym} ptr val mem)
  4825  	for {
  4826  		off := auxIntToInt32(v.AuxInt)
  4827  		sym := auxToSym(v.Aux)
  4828  		ptr := v_0
  4829  		if v_1.Op != OpLOONG64MOVVfpgp {
  4830  			break
  4831  		}
  4832  		val := v_1.Args[0]
  4833  		mem := v_2
  4834  		v.reset(OpLOONG64MOVDstore)
  4835  		v.AuxInt = int32ToAuxInt(off)
  4836  		v.Aux = symToAux(sym)
  4837  		v.AddArg3(ptr, val, mem)
  4838  		return true
  4839  	}
  4840  	// match: (MOVVstore [off1] {sym} (ADDVconst [off2] ptr) val mem)
  4841  	// cond: is32Bit(int64(off1)+off2) && (ptr.Op != OpSB || !config.ctxt.Flag_dynlink)
  4842  	// result: (MOVVstore [off1+int32(off2)] {sym} ptr val mem)
  4843  	for {
  4844  		off1 := auxIntToInt32(v.AuxInt)
  4845  		sym := auxToSym(v.Aux)
  4846  		if v_0.Op != OpLOONG64ADDVconst {
  4847  			break
  4848  		}
  4849  		off2 := auxIntToInt64(v_0.AuxInt)
  4850  		ptr := v_0.Args[0]
  4851  		val := v_1
  4852  		mem := v_2
  4853  		if !(is32Bit(int64(off1)+off2) && (ptr.Op != OpSB || !config.ctxt.Flag_dynlink)) {
  4854  			break
  4855  		}
  4856  		v.reset(OpLOONG64MOVVstore)
  4857  		v.AuxInt = int32ToAuxInt(off1 + int32(off2))
  4858  		v.Aux = symToAux(sym)
  4859  		v.AddArg3(ptr, val, mem)
  4860  		return true
  4861  	}
  4862  	// match: (MOVVstore [off1] {sym1} (MOVVaddr [off2] {sym2} ptr) val mem)
  4863  	// cond: canMergeSym(sym1,sym2) && is32Bit(int64(off1)+int64(off2)) && (ptr.Op != OpSB || !config.ctxt.Flag_dynlink)
  4864  	// result: (MOVVstore [off1+int32(off2)] {mergeSym(sym1,sym2)} ptr val mem)
  4865  	for {
  4866  		off1 := auxIntToInt32(v.AuxInt)
  4867  		sym1 := auxToSym(v.Aux)
  4868  		if v_0.Op != OpLOONG64MOVVaddr {
  4869  			break
  4870  		}
  4871  		off2 := auxIntToInt32(v_0.AuxInt)
  4872  		sym2 := auxToSym(v_0.Aux)
  4873  		ptr := v_0.Args[0]
  4874  		val := v_1
  4875  		mem := v_2
  4876  		if !(canMergeSym(sym1, sym2) && is32Bit(int64(off1)+int64(off2)) && (ptr.Op != OpSB || !config.ctxt.Flag_dynlink)) {
  4877  			break
  4878  		}
  4879  		v.reset(OpLOONG64MOVVstore)
  4880  		v.AuxInt = int32ToAuxInt(off1 + int32(off2))
  4881  		v.Aux = symToAux(mergeSym(sym1, sym2))
  4882  		v.AddArg3(ptr, val, mem)
  4883  		return true
  4884  	}
  4885  	// match: (MOVVstore [off] {sym} (ADDV ptr idx) val mem)
  4886  	// cond: off == 0 && sym == nil
  4887  	// result: (MOVVstoreidx ptr idx val mem)
  4888  	for {
  4889  		off := auxIntToInt32(v.AuxInt)
  4890  		sym := auxToSym(v.Aux)
  4891  		if v_0.Op != OpLOONG64ADDV {
  4892  			break
  4893  		}
  4894  		idx := v_0.Args[1]
  4895  		ptr := v_0.Args[0]
  4896  		val := v_1
  4897  		mem := v_2
  4898  		if !(off == 0 && sym == nil) {
  4899  			break
  4900  		}
  4901  		v.reset(OpLOONG64MOVVstoreidx)
  4902  		v.AddArg4(ptr, idx, val, mem)
  4903  		return true
  4904  	}
  4905  	// match: (MOVVstore [off] {sym} (ADDshiftLLV [shift] ptr idx) val mem)
  4906  	// cond: off == 0 && sym == nil
  4907  	// result: (MOVVstoreidx ptr (SLLVconst <typ.Int64> [shift] idx) val mem)
  4908  	for {
  4909  		off := auxIntToInt32(v.AuxInt)
  4910  		sym := auxToSym(v.Aux)
  4911  		if v_0.Op != OpLOONG64ADDshiftLLV {
  4912  			break
  4913  		}
  4914  		shift := auxIntToInt64(v_0.AuxInt)
  4915  		idx := v_0.Args[1]
  4916  		ptr := v_0.Args[0]
  4917  		val := v_1
  4918  		mem := v_2
  4919  		if !(off == 0 && sym == nil) {
  4920  			break
  4921  		}
  4922  		v.reset(OpLOONG64MOVVstoreidx)
  4923  		v0 := b.NewValue0(v.Pos, OpLOONG64SLLVconst, typ.Int64)
  4924  		v0.AuxInt = int64ToAuxInt(shift)
  4925  		v0.AddArg(idx)
  4926  		v.AddArg4(ptr, v0, val, mem)
  4927  		return true
  4928  	}
  4929  	return false
  4930  }
  4931  func rewriteValueLOONG64_OpLOONG64MOVVstoreidx(v *Value) bool {
  4932  	v_3 := v.Args[3]
  4933  	v_2 := v.Args[2]
  4934  	v_1 := v.Args[1]
  4935  	v_0 := v.Args[0]
  4936  	// match: (MOVVstoreidx ptr (MOVVconst [c]) val mem)
  4937  	// cond: is32Bit(c)
  4938  	// result: (MOVVstore [int32(c)] ptr val mem)
  4939  	for {
  4940  		ptr := v_0
  4941  		if v_1.Op != OpLOONG64MOVVconst {
  4942  			break
  4943  		}
  4944  		c := auxIntToInt64(v_1.AuxInt)
  4945  		val := v_2
  4946  		mem := v_3
  4947  		if !(is32Bit(c)) {
  4948  			break
  4949  		}
  4950  		v.reset(OpLOONG64MOVVstore)
  4951  		v.AuxInt = int32ToAuxInt(int32(c))
  4952  		v.AddArg3(ptr, val, mem)
  4953  		return true
  4954  	}
  4955  	// match: (MOVVstoreidx (MOVVconst [c]) idx val mem)
  4956  	// cond: is32Bit(c)
  4957  	// result: (MOVVstore [int32(c)] idx val mem)
  4958  	for {
  4959  		if v_0.Op != OpLOONG64MOVVconst {
  4960  			break
  4961  		}
  4962  		c := auxIntToInt64(v_0.AuxInt)
  4963  		idx := v_1
  4964  		val := v_2
  4965  		mem := v_3
  4966  		if !(is32Bit(c)) {
  4967  			break
  4968  		}
  4969  		v.reset(OpLOONG64MOVVstore)
  4970  		v.AuxInt = int32ToAuxInt(int32(c))
  4971  		v.AddArg3(idx, val, mem)
  4972  		return true
  4973  	}
  4974  	return false
  4975  }
  4976  func rewriteValueLOONG64_OpLOONG64MOVWUload(v *Value) bool {
  4977  	v_1 := v.Args[1]
  4978  	v_0 := v.Args[0]
  4979  	b := v.Block
  4980  	config := b.Func.Config
  4981  	typ := &b.Func.Config.Types
  4982  	// match: (MOVWUload [off] {sym} ptr (MOVFstore [off] {sym} ptr val _))
  4983  	// result: (ZeroExt32to64 (MOVWfpgp <typ.Float32> val))
  4984  	for {
  4985  		off := auxIntToInt32(v.AuxInt)
  4986  		sym := auxToSym(v.Aux)
  4987  		ptr := v_0
  4988  		if v_1.Op != OpLOONG64MOVFstore || auxIntToInt32(v_1.AuxInt) != off || auxToSym(v_1.Aux) != sym {
  4989  			break
  4990  		}
  4991  		val := v_1.Args[1]
  4992  		if ptr != v_1.Args[0] {
  4993  			break
  4994  		}
  4995  		v.reset(OpZeroExt32to64)
  4996  		v0 := b.NewValue0(v_1.Pos, OpLOONG64MOVWfpgp, typ.Float32)
  4997  		v0.AddArg(val)
  4998  		v.AddArg(v0)
  4999  		return true
  5000  	}
  5001  	// match: (MOVWUload [off] {sym} ptr (MOVWstore [off] {sym} ptr x _))
  5002  	// result: (MOVWUreg x)
  5003  	for {
  5004  		off := auxIntToInt32(v.AuxInt)
  5005  		sym := auxToSym(v.Aux)
  5006  		ptr := v_0
  5007  		if v_1.Op != OpLOONG64MOVWstore || auxIntToInt32(v_1.AuxInt) != off || auxToSym(v_1.Aux) != sym {
  5008  			break
  5009  		}
  5010  		x := v_1.Args[1]
  5011  		if ptr != v_1.Args[0] {
  5012  			break
  5013  		}
  5014  		v.reset(OpLOONG64MOVWUreg)
  5015  		v.AddArg(x)
  5016  		return true
  5017  	}
  5018  	// match: (MOVWUload [off1] {sym} (ADDVconst [off2] ptr) mem)
  5019  	// cond: is32Bit(int64(off1)+off2) && (ptr.Op != OpSB || !config.ctxt.Flag_dynlink)
  5020  	// result: (MOVWUload [off1+int32(off2)] {sym} ptr mem)
  5021  	for {
  5022  		off1 := auxIntToInt32(v.AuxInt)
  5023  		sym := auxToSym(v.Aux)
  5024  		if v_0.Op != OpLOONG64ADDVconst {
  5025  			break
  5026  		}
  5027  		off2 := auxIntToInt64(v_0.AuxInt)
  5028  		ptr := v_0.Args[0]
  5029  		mem := v_1
  5030  		if !(is32Bit(int64(off1)+off2) && (ptr.Op != OpSB || !config.ctxt.Flag_dynlink)) {
  5031  			break
  5032  		}
  5033  		v.reset(OpLOONG64MOVWUload)
  5034  		v.AuxInt = int32ToAuxInt(off1 + int32(off2))
  5035  		v.Aux = symToAux(sym)
  5036  		v.AddArg2(ptr, mem)
  5037  		return true
  5038  	}
  5039  	// match: (MOVWUload [off1] {sym1} (MOVVaddr [off2] {sym2} ptr) mem)
  5040  	// cond: canMergeSym(sym1,sym2) && is32Bit(int64(off1)+int64(off2)) && (ptr.Op != OpSB || !config.ctxt.Flag_dynlink)
  5041  	// result: (MOVWUload [off1+int32(off2)] {mergeSym(sym1,sym2)} ptr mem)
  5042  	for {
  5043  		off1 := auxIntToInt32(v.AuxInt)
  5044  		sym1 := auxToSym(v.Aux)
  5045  		if v_0.Op != OpLOONG64MOVVaddr {
  5046  			break
  5047  		}
  5048  		off2 := auxIntToInt32(v_0.AuxInt)
  5049  		sym2 := auxToSym(v_0.Aux)
  5050  		ptr := v_0.Args[0]
  5051  		mem := v_1
  5052  		if !(canMergeSym(sym1, sym2) && is32Bit(int64(off1)+int64(off2)) && (ptr.Op != OpSB || !config.ctxt.Flag_dynlink)) {
  5053  			break
  5054  		}
  5055  		v.reset(OpLOONG64MOVWUload)
  5056  		v.AuxInt = int32ToAuxInt(off1 + int32(off2))
  5057  		v.Aux = symToAux(mergeSym(sym1, sym2))
  5058  		v.AddArg2(ptr, mem)
  5059  		return true
  5060  	}
  5061  	// match: (MOVWUload [off] {sym} (ADDV ptr idx) mem)
  5062  	// cond: off == 0 && sym == nil
  5063  	// result: (MOVWUloadidx ptr idx mem)
  5064  	for {
  5065  		off := auxIntToInt32(v.AuxInt)
  5066  		sym := auxToSym(v.Aux)
  5067  		if v_0.Op != OpLOONG64ADDV {
  5068  			break
  5069  		}
  5070  		idx := v_0.Args[1]
  5071  		ptr := v_0.Args[0]
  5072  		mem := v_1
  5073  		if !(off == 0 && sym == nil) {
  5074  			break
  5075  		}
  5076  		v.reset(OpLOONG64MOVWUloadidx)
  5077  		v.AddArg3(ptr, idx, mem)
  5078  		return true
  5079  	}
  5080  	// match: (MOVWUload [off] {sym} (ADDshiftLLV [shift] ptr idx) mem)
  5081  	// cond: off == 0 && sym == nil
  5082  	// result: (MOVWUloadidx ptr (SLLVconst <typ.Int64> [shift] idx) mem)
  5083  	for {
  5084  		off := auxIntToInt32(v.AuxInt)
  5085  		sym := auxToSym(v.Aux)
  5086  		if v_0.Op != OpLOONG64ADDshiftLLV {
  5087  			break
  5088  		}
  5089  		shift := auxIntToInt64(v_0.AuxInt)
  5090  		idx := v_0.Args[1]
  5091  		ptr := v_0.Args[0]
  5092  		mem := v_1
  5093  		if !(off == 0 && sym == nil) {
  5094  			break
  5095  		}
  5096  		v.reset(OpLOONG64MOVWUloadidx)
  5097  		v0 := b.NewValue0(v.Pos, OpLOONG64SLLVconst, typ.Int64)
  5098  		v0.AuxInt = int64ToAuxInt(shift)
  5099  		v0.AddArg(idx)
  5100  		v.AddArg3(ptr, v0, mem)
  5101  		return true
  5102  	}
  5103  	// match: (MOVWUload [off] {sym} (SB) _)
  5104  	// cond: symIsRO(sym)
  5105  	// result: (MOVVconst [int64(read32(sym, int64(off), config.ctxt.Arch.ByteOrder))])
  5106  	for {
  5107  		off := auxIntToInt32(v.AuxInt)
  5108  		sym := auxToSym(v.Aux)
  5109  		if v_0.Op != OpSB || !(symIsRO(sym)) {
  5110  			break
  5111  		}
  5112  		v.reset(OpLOONG64MOVVconst)
  5113  		v.AuxInt = int64ToAuxInt(int64(read32(sym, int64(off), config.ctxt.Arch.ByteOrder)))
  5114  		return true
  5115  	}
  5116  	return false
  5117  }
  5118  func rewriteValueLOONG64_OpLOONG64MOVWUloadidx(v *Value) bool {
  5119  	v_2 := v.Args[2]
  5120  	v_1 := v.Args[1]
  5121  	v_0 := v.Args[0]
  5122  	// match: (MOVWUloadidx ptr (MOVVconst [c]) mem)
  5123  	// cond: is32Bit(c)
  5124  	// result: (MOVWUload [int32(c)] ptr mem)
  5125  	for {
  5126  		ptr := v_0
  5127  		if v_1.Op != OpLOONG64MOVVconst {
  5128  			break
  5129  		}
  5130  		c := auxIntToInt64(v_1.AuxInt)
  5131  		mem := v_2
  5132  		if !(is32Bit(c)) {
  5133  			break
  5134  		}
  5135  		v.reset(OpLOONG64MOVWUload)
  5136  		v.AuxInt = int32ToAuxInt(int32(c))
  5137  		v.AddArg2(ptr, mem)
  5138  		return true
  5139  	}
  5140  	// match: (MOVWUloadidx (MOVVconst [c]) ptr mem)
  5141  	// cond: is32Bit(c)
  5142  	// result: (MOVWUload [int32(c)] ptr mem)
  5143  	for {
  5144  		if v_0.Op != OpLOONG64MOVVconst {
  5145  			break
  5146  		}
  5147  		c := auxIntToInt64(v_0.AuxInt)
  5148  		ptr := v_1
  5149  		mem := v_2
  5150  		if !(is32Bit(c)) {
  5151  			break
  5152  		}
  5153  		v.reset(OpLOONG64MOVWUload)
  5154  		v.AuxInt = int32ToAuxInt(int32(c))
  5155  		v.AddArg2(ptr, mem)
  5156  		return true
  5157  	}
  5158  	return false
  5159  }
  5160  func rewriteValueLOONG64_OpLOONG64MOVWUreg(v *Value) bool {
  5161  	v_0 := v.Args[0]
  5162  	// match: (MOVWUreg (SRLVconst [rc] x))
  5163  	// cond: rc < 32
  5164  	// result: (BSTRPICKV [rc + (31+rc)<<6] x)
  5165  	for {
  5166  		if v_0.Op != OpLOONG64SRLVconst {
  5167  			break
  5168  		}
  5169  		rc := auxIntToInt64(v_0.AuxInt)
  5170  		x := v_0.Args[0]
  5171  		if !(rc < 32) {
  5172  			break
  5173  		}
  5174  		v.reset(OpLOONG64BSTRPICKV)
  5175  		v.AuxInt = int64ToAuxInt(rc + (31+rc)<<6)
  5176  		v.AddArg(x)
  5177  		return true
  5178  	}
  5179  	// match: (MOVWUreg x:(MOVBUload _ _))
  5180  	// result: (MOVVreg x)
  5181  	for {
  5182  		x := v_0
  5183  		if x.Op != OpLOONG64MOVBUload {
  5184  			break
  5185  		}
  5186  		v.reset(OpLOONG64MOVVreg)
  5187  		v.AddArg(x)
  5188  		return true
  5189  	}
  5190  	// match: (MOVWUreg x:(MOVHUload _ _))
  5191  	// result: (MOVVreg x)
  5192  	for {
  5193  		x := v_0
  5194  		if x.Op != OpLOONG64MOVHUload {
  5195  			break
  5196  		}
  5197  		v.reset(OpLOONG64MOVVreg)
  5198  		v.AddArg(x)
  5199  		return true
  5200  	}
  5201  	// match: (MOVWUreg x:(MOVWUload _ _))
  5202  	// result: (MOVVreg x)
  5203  	for {
  5204  		x := v_0
  5205  		if x.Op != OpLOONG64MOVWUload {
  5206  			break
  5207  		}
  5208  		v.reset(OpLOONG64MOVVreg)
  5209  		v.AddArg(x)
  5210  		return true
  5211  	}
  5212  	// match: (MOVWUreg x:(MOVBUloadidx _ _ _))
  5213  	// result: (MOVVreg x)
  5214  	for {
  5215  		x := v_0
  5216  		if x.Op != OpLOONG64MOVBUloadidx {
  5217  			break
  5218  		}
  5219  		v.reset(OpLOONG64MOVVreg)
  5220  		v.AddArg(x)
  5221  		return true
  5222  	}
  5223  	// match: (MOVWUreg x:(MOVHUloadidx _ _ _))
  5224  	// result: (MOVVreg x)
  5225  	for {
  5226  		x := v_0
  5227  		if x.Op != OpLOONG64MOVHUloadidx {
  5228  			break
  5229  		}
  5230  		v.reset(OpLOONG64MOVVreg)
  5231  		v.AddArg(x)
  5232  		return true
  5233  	}
  5234  	// match: (MOVWUreg x:(MOVWUloadidx _ _ _))
  5235  	// result: (MOVVreg x)
  5236  	for {
  5237  		x := v_0
  5238  		if x.Op != OpLOONG64MOVWUloadidx {
  5239  			break
  5240  		}
  5241  		v.reset(OpLOONG64MOVVreg)
  5242  		v.AddArg(x)
  5243  		return true
  5244  	}
  5245  	// match: (MOVWUreg x:(MOVBUreg _))
  5246  	// result: (MOVVreg x)
  5247  	for {
  5248  		x := v_0
  5249  		if x.Op != OpLOONG64MOVBUreg {
  5250  			break
  5251  		}
  5252  		v.reset(OpLOONG64MOVVreg)
  5253  		v.AddArg(x)
  5254  		return true
  5255  	}
  5256  	// match: (MOVWUreg x:(MOVHUreg _))
  5257  	// result: (MOVVreg x)
  5258  	for {
  5259  		x := v_0
  5260  		if x.Op != OpLOONG64MOVHUreg {
  5261  			break
  5262  		}
  5263  		v.reset(OpLOONG64MOVVreg)
  5264  		v.AddArg(x)
  5265  		return true
  5266  	}
  5267  	// match: (MOVWUreg x:(MOVWUreg _))
  5268  	// result: (MOVVreg x)
  5269  	for {
  5270  		x := v_0
  5271  		if x.Op != OpLOONG64MOVWUreg {
  5272  			break
  5273  		}
  5274  		v.reset(OpLOONG64MOVVreg)
  5275  		v.AddArg(x)
  5276  		return true
  5277  	}
  5278  	// match: (MOVWUreg (SLLVconst [lc] x))
  5279  	// cond: lc >= 32
  5280  	// result: (MOVVconst [0])
  5281  	for {
  5282  		if v_0.Op != OpLOONG64SLLVconst {
  5283  			break
  5284  		}
  5285  		lc := auxIntToInt64(v_0.AuxInt)
  5286  		if !(lc >= 32) {
  5287  			break
  5288  		}
  5289  		v.reset(OpLOONG64MOVVconst)
  5290  		v.AuxInt = int64ToAuxInt(0)
  5291  		return true
  5292  	}
  5293  	// match: (MOVWUreg (MOVVconst [c]))
  5294  	// result: (MOVVconst [int64(uint32(c))])
  5295  	for {
  5296  		if v_0.Op != OpLOONG64MOVVconst {
  5297  			break
  5298  		}
  5299  		c := auxIntToInt64(v_0.AuxInt)
  5300  		v.reset(OpLOONG64MOVVconst)
  5301  		v.AuxInt = int64ToAuxInt(int64(uint32(c)))
  5302  		return true
  5303  	}
  5304  	// match: (MOVWUreg x:(ANDconst [c] y))
  5305  	// cond: c >= 0 && int64(uint32(c)) == c
  5306  	// result: x
  5307  	for {
  5308  		x := v_0
  5309  		if x.Op != OpLOONG64ANDconst {
  5310  			break
  5311  		}
  5312  		c := auxIntToInt64(x.AuxInt)
  5313  		if !(c >= 0 && int64(uint32(c)) == c) {
  5314  			break
  5315  		}
  5316  		v.copyOf(x)
  5317  		return true
  5318  	}
  5319  	return false
  5320  }
  5321  func rewriteValueLOONG64_OpLOONG64MOVWload(v *Value) bool {
  5322  	v_1 := v.Args[1]
  5323  	v_0 := v.Args[0]
  5324  	b := v.Block
  5325  	config := b.Func.Config
  5326  	typ := &b.Func.Config.Types
  5327  	// match: (MOVWload [off] {sym} ptr (MOVWstore [off] {sym} ptr x _))
  5328  	// result: (MOVWreg x)
  5329  	for {
  5330  		off := auxIntToInt32(v.AuxInt)
  5331  		sym := auxToSym(v.Aux)
  5332  		ptr := v_0
  5333  		if v_1.Op != OpLOONG64MOVWstore || auxIntToInt32(v_1.AuxInt) != off || auxToSym(v_1.Aux) != sym {
  5334  			break
  5335  		}
  5336  		x := v_1.Args[1]
  5337  		if ptr != v_1.Args[0] {
  5338  			break
  5339  		}
  5340  		v.reset(OpLOONG64MOVWreg)
  5341  		v.AddArg(x)
  5342  		return true
  5343  	}
  5344  	// match: (MOVWload [off1] {sym} (ADDVconst [off2] ptr) mem)
  5345  	// cond: is32Bit(int64(off1)+off2) && (ptr.Op != OpSB || !config.ctxt.Flag_dynlink)
  5346  	// result: (MOVWload [off1+int32(off2)] {sym} ptr mem)
  5347  	for {
  5348  		off1 := auxIntToInt32(v.AuxInt)
  5349  		sym := auxToSym(v.Aux)
  5350  		if v_0.Op != OpLOONG64ADDVconst {
  5351  			break
  5352  		}
  5353  		off2 := auxIntToInt64(v_0.AuxInt)
  5354  		ptr := v_0.Args[0]
  5355  		mem := v_1
  5356  		if !(is32Bit(int64(off1)+off2) && (ptr.Op != OpSB || !config.ctxt.Flag_dynlink)) {
  5357  			break
  5358  		}
  5359  		v.reset(OpLOONG64MOVWload)
  5360  		v.AuxInt = int32ToAuxInt(off1 + int32(off2))
  5361  		v.Aux = symToAux(sym)
  5362  		v.AddArg2(ptr, mem)
  5363  		return true
  5364  	}
  5365  	// match: (MOVWload [off1] {sym1} (MOVVaddr [off2] {sym2} ptr) mem)
  5366  	// cond: canMergeSym(sym1,sym2) && is32Bit(int64(off1)+int64(off2)) && (ptr.Op != OpSB || !config.ctxt.Flag_dynlink)
  5367  	// result: (MOVWload [off1+int32(off2)] {mergeSym(sym1,sym2)} ptr mem)
  5368  	for {
  5369  		off1 := auxIntToInt32(v.AuxInt)
  5370  		sym1 := auxToSym(v.Aux)
  5371  		if v_0.Op != OpLOONG64MOVVaddr {
  5372  			break
  5373  		}
  5374  		off2 := auxIntToInt32(v_0.AuxInt)
  5375  		sym2 := auxToSym(v_0.Aux)
  5376  		ptr := v_0.Args[0]
  5377  		mem := v_1
  5378  		if !(canMergeSym(sym1, sym2) && is32Bit(int64(off1)+int64(off2)) && (ptr.Op != OpSB || !config.ctxt.Flag_dynlink)) {
  5379  			break
  5380  		}
  5381  		v.reset(OpLOONG64MOVWload)
  5382  		v.AuxInt = int32ToAuxInt(off1 + int32(off2))
  5383  		v.Aux = symToAux(mergeSym(sym1, sym2))
  5384  		v.AddArg2(ptr, mem)
  5385  		return true
  5386  	}
  5387  	// match: (MOVWload [off] {sym} (ADDV ptr idx) mem)
  5388  	// cond: off == 0 && sym == nil
  5389  	// result: (MOVWloadidx ptr idx mem)
  5390  	for {
  5391  		off := auxIntToInt32(v.AuxInt)
  5392  		sym := auxToSym(v.Aux)
  5393  		if v_0.Op != OpLOONG64ADDV {
  5394  			break
  5395  		}
  5396  		idx := v_0.Args[1]
  5397  		ptr := v_0.Args[0]
  5398  		mem := v_1
  5399  		if !(off == 0 && sym == nil) {
  5400  			break
  5401  		}
  5402  		v.reset(OpLOONG64MOVWloadidx)
  5403  		v.AddArg3(ptr, idx, mem)
  5404  		return true
  5405  	}
  5406  	// match: (MOVWload [off] {sym} (ADDshiftLLV [shift] ptr idx) mem)
  5407  	// cond: off == 0 && sym == nil
  5408  	// result: (MOVWloadidx ptr (SLLVconst <typ.Int64> [shift] idx) mem)
  5409  	for {
  5410  		off := auxIntToInt32(v.AuxInt)
  5411  		sym := auxToSym(v.Aux)
  5412  		if v_0.Op != OpLOONG64ADDshiftLLV {
  5413  			break
  5414  		}
  5415  		shift := auxIntToInt64(v_0.AuxInt)
  5416  		idx := v_0.Args[1]
  5417  		ptr := v_0.Args[0]
  5418  		mem := v_1
  5419  		if !(off == 0 && sym == nil) {
  5420  			break
  5421  		}
  5422  		v.reset(OpLOONG64MOVWloadidx)
  5423  		v0 := b.NewValue0(v.Pos, OpLOONG64SLLVconst, typ.Int64)
  5424  		v0.AuxInt = int64ToAuxInt(shift)
  5425  		v0.AddArg(idx)
  5426  		v.AddArg3(ptr, v0, mem)
  5427  		return true
  5428  	}
  5429  	// match: (MOVWload [off] {sym} (SB) _)
  5430  	// cond: symIsRO(sym)
  5431  	// result: (MOVVconst [int64(int32(read32(sym, int64(off), config.ctxt.Arch.ByteOrder)))])
  5432  	for {
  5433  		off := auxIntToInt32(v.AuxInt)
  5434  		sym := auxToSym(v.Aux)
  5435  		if v_0.Op != OpSB || !(symIsRO(sym)) {
  5436  			break
  5437  		}
  5438  		v.reset(OpLOONG64MOVVconst)
  5439  		v.AuxInt = int64ToAuxInt(int64(int32(read32(sym, int64(off), config.ctxt.Arch.ByteOrder))))
  5440  		return true
  5441  	}
  5442  	return false
  5443  }
  5444  func rewriteValueLOONG64_OpLOONG64MOVWloadidx(v *Value) bool {
  5445  	v_2 := v.Args[2]
  5446  	v_1 := v.Args[1]
  5447  	v_0 := v.Args[0]
  5448  	// match: (MOVWloadidx ptr (MOVVconst [c]) mem)
  5449  	// cond: is32Bit(c)
  5450  	// result: (MOVWload [int32(c)] ptr mem)
  5451  	for {
  5452  		ptr := v_0
  5453  		if v_1.Op != OpLOONG64MOVVconst {
  5454  			break
  5455  		}
  5456  		c := auxIntToInt64(v_1.AuxInt)
  5457  		mem := v_2
  5458  		if !(is32Bit(c)) {
  5459  			break
  5460  		}
  5461  		v.reset(OpLOONG64MOVWload)
  5462  		v.AuxInt = int32ToAuxInt(int32(c))
  5463  		v.AddArg2(ptr, mem)
  5464  		return true
  5465  	}
  5466  	// match: (MOVWloadidx (MOVVconst [c]) ptr mem)
  5467  	// cond: is32Bit(c)
  5468  	// result: (MOVWload [int32(c)] ptr mem)
  5469  	for {
  5470  		if v_0.Op != OpLOONG64MOVVconst {
  5471  			break
  5472  		}
  5473  		c := auxIntToInt64(v_0.AuxInt)
  5474  		ptr := v_1
  5475  		mem := v_2
  5476  		if !(is32Bit(c)) {
  5477  			break
  5478  		}
  5479  		v.reset(OpLOONG64MOVWload)
  5480  		v.AuxInt = int32ToAuxInt(int32(c))
  5481  		v.AddArg2(ptr, mem)
  5482  		return true
  5483  	}
  5484  	return false
  5485  }
  5486  func rewriteValueLOONG64_OpLOONG64MOVWreg(v *Value) bool {
  5487  	v_0 := v.Args[0]
  5488  	// match: (MOVWreg x:(MOVBload _ _))
  5489  	// result: (MOVVreg x)
  5490  	for {
  5491  		x := v_0
  5492  		if x.Op != OpLOONG64MOVBload {
  5493  			break
  5494  		}
  5495  		v.reset(OpLOONG64MOVVreg)
  5496  		v.AddArg(x)
  5497  		return true
  5498  	}
  5499  	// match: (MOVWreg x:(MOVBUload _ _))
  5500  	// result: (MOVVreg x)
  5501  	for {
  5502  		x := v_0
  5503  		if x.Op != OpLOONG64MOVBUload {
  5504  			break
  5505  		}
  5506  		v.reset(OpLOONG64MOVVreg)
  5507  		v.AddArg(x)
  5508  		return true
  5509  	}
  5510  	// match: (MOVWreg x:(MOVHload _ _))
  5511  	// result: (MOVVreg x)
  5512  	for {
  5513  		x := v_0
  5514  		if x.Op != OpLOONG64MOVHload {
  5515  			break
  5516  		}
  5517  		v.reset(OpLOONG64MOVVreg)
  5518  		v.AddArg(x)
  5519  		return true
  5520  	}
  5521  	// match: (MOVWreg x:(MOVHUload _ _))
  5522  	// result: (MOVVreg x)
  5523  	for {
  5524  		x := v_0
  5525  		if x.Op != OpLOONG64MOVHUload {
  5526  			break
  5527  		}
  5528  		v.reset(OpLOONG64MOVVreg)
  5529  		v.AddArg(x)
  5530  		return true
  5531  	}
  5532  	// match: (MOVWreg x:(MOVWload _ _))
  5533  	// result: (MOVVreg x)
  5534  	for {
  5535  		x := v_0
  5536  		if x.Op != OpLOONG64MOVWload {
  5537  			break
  5538  		}
  5539  		v.reset(OpLOONG64MOVVreg)
  5540  		v.AddArg(x)
  5541  		return true
  5542  	}
  5543  	// match: (MOVWreg x:(MOVBloadidx _ _ _))
  5544  	// result: (MOVVreg x)
  5545  	for {
  5546  		x := v_0
  5547  		if x.Op != OpLOONG64MOVBloadidx {
  5548  			break
  5549  		}
  5550  		v.reset(OpLOONG64MOVVreg)
  5551  		v.AddArg(x)
  5552  		return true
  5553  	}
  5554  	// match: (MOVWreg x:(MOVBUloadidx _ _ _))
  5555  	// result: (MOVVreg x)
  5556  	for {
  5557  		x := v_0
  5558  		if x.Op != OpLOONG64MOVBUloadidx {
  5559  			break
  5560  		}
  5561  		v.reset(OpLOONG64MOVVreg)
  5562  		v.AddArg(x)
  5563  		return true
  5564  	}
  5565  	// match: (MOVWreg x:(MOVHloadidx _ _ _))
  5566  	// result: (MOVVreg x)
  5567  	for {
  5568  		x := v_0
  5569  		if x.Op != OpLOONG64MOVHloadidx {
  5570  			break
  5571  		}
  5572  		v.reset(OpLOONG64MOVVreg)
  5573  		v.AddArg(x)
  5574  		return true
  5575  	}
  5576  	// match: (MOVWreg x:(MOVHUloadidx _ _ _))
  5577  	// result: (MOVVreg x)
  5578  	for {
  5579  		x := v_0
  5580  		if x.Op != OpLOONG64MOVHUloadidx {
  5581  			break
  5582  		}
  5583  		v.reset(OpLOONG64MOVVreg)
  5584  		v.AddArg(x)
  5585  		return true
  5586  	}
  5587  	// match: (MOVWreg x:(MOVWloadidx _ _ _))
  5588  	// result: (MOVVreg x)
  5589  	for {
  5590  		x := v_0
  5591  		if x.Op != OpLOONG64MOVWloadidx {
  5592  			break
  5593  		}
  5594  		v.reset(OpLOONG64MOVVreg)
  5595  		v.AddArg(x)
  5596  		return true
  5597  	}
  5598  	// match: (MOVWreg x:(MOVBreg _))
  5599  	// result: (MOVVreg x)
  5600  	for {
  5601  		x := v_0
  5602  		if x.Op != OpLOONG64MOVBreg {
  5603  			break
  5604  		}
  5605  		v.reset(OpLOONG64MOVVreg)
  5606  		v.AddArg(x)
  5607  		return true
  5608  	}
  5609  	// match: (MOVWreg x:(MOVBUreg _))
  5610  	// result: (MOVVreg x)
  5611  	for {
  5612  		x := v_0
  5613  		if x.Op != OpLOONG64MOVBUreg {
  5614  			break
  5615  		}
  5616  		v.reset(OpLOONG64MOVVreg)
  5617  		v.AddArg(x)
  5618  		return true
  5619  	}
  5620  	// match: (MOVWreg x:(MOVHreg _))
  5621  	// result: (MOVVreg x)
  5622  	for {
  5623  		x := v_0
  5624  		if x.Op != OpLOONG64MOVHreg {
  5625  			break
  5626  		}
  5627  		v.reset(OpLOONG64MOVVreg)
  5628  		v.AddArg(x)
  5629  		return true
  5630  	}
  5631  	// match: (MOVWreg x:(MOVWreg _))
  5632  	// result: (MOVVreg x)
  5633  	for {
  5634  		x := v_0
  5635  		if x.Op != OpLOONG64MOVWreg {
  5636  			break
  5637  		}
  5638  		v.reset(OpLOONG64MOVVreg)
  5639  		v.AddArg(x)
  5640  		return true
  5641  	}
  5642  	// match: (MOVWreg (MOVVconst [c]))
  5643  	// result: (MOVVconst [int64(int32(c))])
  5644  	for {
  5645  		if v_0.Op != OpLOONG64MOVVconst {
  5646  			break
  5647  		}
  5648  		c := auxIntToInt64(v_0.AuxInt)
  5649  		v.reset(OpLOONG64MOVVconst)
  5650  		v.AuxInt = int64ToAuxInt(int64(int32(c)))
  5651  		return true
  5652  	}
  5653  	// match: (MOVWreg x:(ANDconst [c] y))
  5654  	// cond: c >= 0 && int64(int32(c)) == c
  5655  	// result: x
  5656  	for {
  5657  		x := v_0
  5658  		if x.Op != OpLOONG64ANDconst {
  5659  			break
  5660  		}
  5661  		c := auxIntToInt64(x.AuxInt)
  5662  		if !(c >= 0 && int64(int32(c)) == c) {
  5663  			break
  5664  		}
  5665  		v.copyOf(x)
  5666  		return true
  5667  	}
  5668  	return false
  5669  }
  5670  func rewriteValueLOONG64_OpLOONG64MOVWstore(v *Value) bool {
  5671  	v_2 := v.Args[2]
  5672  	v_1 := v.Args[1]
  5673  	v_0 := v.Args[0]
  5674  	b := v.Block
  5675  	config := b.Func.Config
  5676  	typ := &b.Func.Config.Types
  5677  	// match: (MOVWstore [off] {sym} ptr (MOVWfpgp val) mem)
  5678  	// result: (MOVFstore [off] {sym} ptr val mem)
  5679  	for {
  5680  		off := auxIntToInt32(v.AuxInt)
  5681  		sym := auxToSym(v.Aux)
  5682  		ptr := v_0
  5683  		if v_1.Op != OpLOONG64MOVWfpgp {
  5684  			break
  5685  		}
  5686  		val := v_1.Args[0]
  5687  		mem := v_2
  5688  		v.reset(OpLOONG64MOVFstore)
  5689  		v.AuxInt = int32ToAuxInt(off)
  5690  		v.Aux = symToAux(sym)
  5691  		v.AddArg3(ptr, val, mem)
  5692  		return true
  5693  	}
  5694  	// match: (MOVWstore [off1] {sym} (ADDVconst [off2] ptr) val mem)
  5695  	// cond: is32Bit(int64(off1)+off2) && (ptr.Op != OpSB || !config.ctxt.Flag_dynlink)
  5696  	// result: (MOVWstore [off1+int32(off2)] {sym} ptr val mem)
  5697  	for {
  5698  		off1 := auxIntToInt32(v.AuxInt)
  5699  		sym := auxToSym(v.Aux)
  5700  		if v_0.Op != OpLOONG64ADDVconst {
  5701  			break
  5702  		}
  5703  		off2 := auxIntToInt64(v_0.AuxInt)
  5704  		ptr := v_0.Args[0]
  5705  		val := v_1
  5706  		mem := v_2
  5707  		if !(is32Bit(int64(off1)+off2) && (ptr.Op != OpSB || !config.ctxt.Flag_dynlink)) {
  5708  			break
  5709  		}
  5710  		v.reset(OpLOONG64MOVWstore)
  5711  		v.AuxInt = int32ToAuxInt(off1 + int32(off2))
  5712  		v.Aux = symToAux(sym)
  5713  		v.AddArg3(ptr, val, mem)
  5714  		return true
  5715  	}
  5716  	// match: (MOVWstore [off1] {sym1} (MOVVaddr [off2] {sym2} ptr) val mem)
  5717  	// cond: canMergeSym(sym1,sym2) && is32Bit(int64(off1)+int64(off2)) && (ptr.Op != OpSB || !config.ctxt.Flag_dynlink)
  5718  	// result: (MOVWstore [off1+int32(off2)] {mergeSym(sym1,sym2)} ptr val mem)
  5719  	for {
  5720  		off1 := auxIntToInt32(v.AuxInt)
  5721  		sym1 := auxToSym(v.Aux)
  5722  		if v_0.Op != OpLOONG64MOVVaddr {
  5723  			break
  5724  		}
  5725  		off2 := auxIntToInt32(v_0.AuxInt)
  5726  		sym2 := auxToSym(v_0.Aux)
  5727  		ptr := v_0.Args[0]
  5728  		val := v_1
  5729  		mem := v_2
  5730  		if !(canMergeSym(sym1, sym2) && is32Bit(int64(off1)+int64(off2)) && (ptr.Op != OpSB || !config.ctxt.Flag_dynlink)) {
  5731  			break
  5732  		}
  5733  		v.reset(OpLOONG64MOVWstore)
  5734  		v.AuxInt = int32ToAuxInt(off1 + int32(off2))
  5735  		v.Aux = symToAux(mergeSym(sym1, sym2))
  5736  		v.AddArg3(ptr, val, mem)
  5737  		return true
  5738  	}
  5739  	// match: (MOVWstore [off] {sym} ptr (MOVWreg x) mem)
  5740  	// result: (MOVWstore [off] {sym} ptr x mem)
  5741  	for {
  5742  		off := auxIntToInt32(v.AuxInt)
  5743  		sym := auxToSym(v.Aux)
  5744  		ptr := v_0
  5745  		if v_1.Op != OpLOONG64MOVWreg {
  5746  			break
  5747  		}
  5748  		x := v_1.Args[0]
  5749  		mem := v_2
  5750  		v.reset(OpLOONG64MOVWstore)
  5751  		v.AuxInt = int32ToAuxInt(off)
  5752  		v.Aux = symToAux(sym)
  5753  		v.AddArg3(ptr, x, mem)
  5754  		return true
  5755  	}
  5756  	// match: (MOVWstore [off] {sym} ptr (MOVWUreg x) mem)
  5757  	// result: (MOVWstore [off] {sym} ptr x mem)
  5758  	for {
  5759  		off := auxIntToInt32(v.AuxInt)
  5760  		sym := auxToSym(v.Aux)
  5761  		ptr := v_0
  5762  		if v_1.Op != OpLOONG64MOVWUreg {
  5763  			break
  5764  		}
  5765  		x := v_1.Args[0]
  5766  		mem := v_2
  5767  		v.reset(OpLOONG64MOVWstore)
  5768  		v.AuxInt = int32ToAuxInt(off)
  5769  		v.Aux = symToAux(sym)
  5770  		v.AddArg3(ptr, x, mem)
  5771  		return true
  5772  	}
  5773  	// match: (MOVWstore [off] {sym} (ADDV ptr idx) val mem)
  5774  	// cond: off == 0 && sym == nil
  5775  	// result: (MOVWstoreidx ptr idx val mem)
  5776  	for {
  5777  		off := auxIntToInt32(v.AuxInt)
  5778  		sym := auxToSym(v.Aux)
  5779  		if v_0.Op != OpLOONG64ADDV {
  5780  			break
  5781  		}
  5782  		idx := v_0.Args[1]
  5783  		ptr := v_0.Args[0]
  5784  		val := v_1
  5785  		mem := v_2
  5786  		if !(off == 0 && sym == nil) {
  5787  			break
  5788  		}
  5789  		v.reset(OpLOONG64MOVWstoreidx)
  5790  		v.AddArg4(ptr, idx, val, mem)
  5791  		return true
  5792  	}
  5793  	// match: (MOVWstore [off] {sym} (ADDshiftLLV [shift] ptr idx) val mem)
  5794  	// cond: off == 0 && sym == nil
  5795  	// result: (MOVWstoreidx ptr (SLLVconst <typ.Int64> [shift] idx) val mem)
  5796  	for {
  5797  		off := auxIntToInt32(v.AuxInt)
  5798  		sym := auxToSym(v.Aux)
  5799  		if v_0.Op != OpLOONG64ADDshiftLLV {
  5800  			break
  5801  		}
  5802  		shift := auxIntToInt64(v_0.AuxInt)
  5803  		idx := v_0.Args[1]
  5804  		ptr := v_0.Args[0]
  5805  		val := v_1
  5806  		mem := v_2
  5807  		if !(off == 0 && sym == nil) {
  5808  			break
  5809  		}
  5810  		v.reset(OpLOONG64MOVWstoreidx)
  5811  		v0 := b.NewValue0(v.Pos, OpLOONG64SLLVconst, typ.Int64)
  5812  		v0.AuxInt = int64ToAuxInt(shift)
  5813  		v0.AddArg(idx)
  5814  		v.AddArg4(ptr, v0, val, mem)
  5815  		return true
  5816  	}
  5817  	return false
  5818  }
  5819  func rewriteValueLOONG64_OpLOONG64MOVWstoreidx(v *Value) bool {
  5820  	v_3 := v.Args[3]
  5821  	v_2 := v.Args[2]
  5822  	v_1 := v.Args[1]
  5823  	v_0 := v.Args[0]
  5824  	// match: (MOVWstoreidx ptr (MOVVconst [c]) val mem)
  5825  	// cond: is32Bit(c)
  5826  	// result: (MOVWstore [int32(c)] ptr val mem)
  5827  	for {
  5828  		ptr := v_0
  5829  		if v_1.Op != OpLOONG64MOVVconst {
  5830  			break
  5831  		}
  5832  		c := auxIntToInt64(v_1.AuxInt)
  5833  		val := v_2
  5834  		mem := v_3
  5835  		if !(is32Bit(c)) {
  5836  			break
  5837  		}
  5838  		v.reset(OpLOONG64MOVWstore)
  5839  		v.AuxInt = int32ToAuxInt(int32(c))
  5840  		v.AddArg3(ptr, val, mem)
  5841  		return true
  5842  	}
  5843  	// match: (MOVWstoreidx (MOVVconst [c]) idx val mem)
  5844  	// cond: is32Bit(c)
  5845  	// result: (MOVWstore [int32(c)] idx val mem)
  5846  	for {
  5847  		if v_0.Op != OpLOONG64MOVVconst {
  5848  			break
  5849  		}
  5850  		c := auxIntToInt64(v_0.AuxInt)
  5851  		idx := v_1
  5852  		val := v_2
  5853  		mem := v_3
  5854  		if !(is32Bit(c)) {
  5855  			break
  5856  		}
  5857  		v.reset(OpLOONG64MOVWstore)
  5858  		v.AuxInt = int32ToAuxInt(int32(c))
  5859  		v.AddArg3(idx, val, mem)
  5860  		return true
  5861  	}
  5862  	return false
  5863  }
  5864  func rewriteValueLOONG64_OpLOONG64MULV(v *Value) bool {
  5865  	v_1 := v.Args[1]
  5866  	v_0 := v.Args[0]
  5867  	b := v.Block
  5868  	config := b.Func.Config
  5869  	// match: (MULV r:(MOVWUreg x) s:(MOVWUreg y))
  5870  	// cond: r.Uses == 1 && s.Uses == 1
  5871  	// result: (MULWVWU x y)
  5872  	for {
  5873  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
  5874  			r := v_0
  5875  			if r.Op != OpLOONG64MOVWUreg {
  5876  				continue
  5877  			}
  5878  			x := r.Args[0]
  5879  			s := v_1
  5880  			if s.Op != OpLOONG64MOVWUreg {
  5881  				continue
  5882  			}
  5883  			y := s.Args[0]
  5884  			if !(r.Uses == 1 && s.Uses == 1) {
  5885  				continue
  5886  			}
  5887  			v.reset(OpLOONG64MULWVWU)
  5888  			v.AddArg2(x, y)
  5889  			return true
  5890  		}
  5891  		break
  5892  	}
  5893  	// match: (MULV r:(MOVWreg x) s:(MOVWreg y))
  5894  	// cond: r.Uses == 1 && s.Uses == 1
  5895  	// result: (MULWVW x y)
  5896  	for {
  5897  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
  5898  			r := v_0
  5899  			if r.Op != OpLOONG64MOVWreg {
  5900  				continue
  5901  			}
  5902  			x := r.Args[0]
  5903  			s := v_1
  5904  			if s.Op != OpLOONG64MOVWreg {
  5905  				continue
  5906  			}
  5907  			y := s.Args[0]
  5908  			if !(r.Uses == 1 && s.Uses == 1) {
  5909  				continue
  5910  			}
  5911  			v.reset(OpLOONG64MULWVW)
  5912  			v.AddArg2(x, y)
  5913  			return true
  5914  		}
  5915  		break
  5916  	}
  5917  	// match: (MULV _ (MOVVconst [0]))
  5918  	// result: (MOVVconst [0])
  5919  	for {
  5920  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
  5921  			if v_1.Op != OpLOONG64MOVVconst || auxIntToInt64(v_1.AuxInt) != 0 {
  5922  				continue
  5923  			}
  5924  			v.reset(OpLOONG64MOVVconst)
  5925  			v.AuxInt = int64ToAuxInt(0)
  5926  			return true
  5927  		}
  5928  		break
  5929  	}
  5930  	// match: (MULV x (MOVVconst [1]))
  5931  	// result: x
  5932  	for {
  5933  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
  5934  			x := v_0
  5935  			if v_1.Op != OpLOONG64MOVVconst || auxIntToInt64(v_1.AuxInt) != 1 {
  5936  				continue
  5937  			}
  5938  			v.copyOf(x)
  5939  			return true
  5940  		}
  5941  		break
  5942  	}
  5943  	// match: (MULV x (MOVVconst [c]))
  5944  	// cond: canMulStrengthReduce(config, c)
  5945  	// result: {mulStrengthReduce(v, x, c)}
  5946  	for {
  5947  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
  5948  			x := v_0
  5949  			if v_1.Op != OpLOONG64MOVVconst {
  5950  				continue
  5951  			}
  5952  			c := auxIntToInt64(v_1.AuxInt)
  5953  			if !(canMulStrengthReduce(config, c)) {
  5954  				continue
  5955  			}
  5956  			v.copyOf(mulStrengthReduce(v, x, c))
  5957  			return true
  5958  		}
  5959  		break
  5960  	}
  5961  	// match: (MULV (MOVVconst [c]) (MOVVconst [d]))
  5962  	// result: (MOVVconst [c*d])
  5963  	for {
  5964  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
  5965  			if v_0.Op != OpLOONG64MOVVconst {
  5966  				continue
  5967  			}
  5968  			c := auxIntToInt64(v_0.AuxInt)
  5969  			if v_1.Op != OpLOONG64MOVVconst {
  5970  				continue
  5971  			}
  5972  			d := auxIntToInt64(v_1.AuxInt)
  5973  			v.reset(OpLOONG64MOVVconst)
  5974  			v.AuxInt = int64ToAuxInt(c * d)
  5975  			return true
  5976  		}
  5977  		break
  5978  	}
  5979  	return false
  5980  }
  5981  func rewriteValueLOONG64_OpLOONG64NEGV(v *Value) bool {
  5982  	v_0 := v.Args[0]
  5983  	b := v.Block
  5984  	// match: (NEGV (SUBV x y))
  5985  	// result: (SUBV y x)
  5986  	for {
  5987  		if v_0.Op != OpLOONG64SUBV {
  5988  			break
  5989  		}
  5990  		y := v_0.Args[1]
  5991  		x := v_0.Args[0]
  5992  		v.reset(OpLOONG64SUBV)
  5993  		v.AddArg2(y, x)
  5994  		return true
  5995  	}
  5996  	// match: (NEGV <t> s:(ADDVconst [c] (SUBV x y)))
  5997  	// cond: s.Uses == 1 && is12Bit(-c)
  5998  	// result: (ADDVconst [-c] (SUBV <t> y x))
  5999  	for {
  6000  		t := v.Type
  6001  		s := v_0
  6002  		if s.Op != OpLOONG64ADDVconst {
  6003  			break
  6004  		}
  6005  		c := auxIntToInt64(s.AuxInt)
  6006  		s_0 := s.Args[0]
  6007  		if s_0.Op != OpLOONG64SUBV {
  6008  			break
  6009  		}
  6010  		y := s_0.Args[1]
  6011  		x := s_0.Args[0]
  6012  		if !(s.Uses == 1 && is12Bit(-c)) {
  6013  			break
  6014  		}
  6015  		v.reset(OpLOONG64ADDVconst)
  6016  		v.AuxInt = int64ToAuxInt(-c)
  6017  		v0 := b.NewValue0(v.Pos, OpLOONG64SUBV, t)
  6018  		v0.AddArg2(y, x)
  6019  		v.AddArg(v0)
  6020  		return true
  6021  	}
  6022  	// match: (NEGV (NEGV x))
  6023  	// result: x
  6024  	for {
  6025  		if v_0.Op != OpLOONG64NEGV {
  6026  			break
  6027  		}
  6028  		x := v_0.Args[0]
  6029  		v.copyOf(x)
  6030  		return true
  6031  	}
  6032  	// match: (NEGV <t> s:(ADDVconst [c] (NEGV x)))
  6033  	// cond: s.Uses == 1 && is12Bit(-c)
  6034  	// result: (ADDVconst [-c] x)
  6035  	for {
  6036  		s := v_0
  6037  		if s.Op != OpLOONG64ADDVconst {
  6038  			break
  6039  		}
  6040  		c := auxIntToInt64(s.AuxInt)
  6041  		s_0 := s.Args[0]
  6042  		if s_0.Op != OpLOONG64NEGV {
  6043  			break
  6044  		}
  6045  		x := s_0.Args[0]
  6046  		if !(s.Uses == 1 && is12Bit(-c)) {
  6047  			break
  6048  		}
  6049  		v.reset(OpLOONG64ADDVconst)
  6050  		v.AuxInt = int64ToAuxInt(-c)
  6051  		v.AddArg(x)
  6052  		return true
  6053  	}
  6054  	// match: (NEGV (MOVVconst [c]))
  6055  	// result: (MOVVconst [-c])
  6056  	for {
  6057  		if v_0.Op != OpLOONG64MOVVconst {
  6058  			break
  6059  		}
  6060  		c := auxIntToInt64(v_0.AuxInt)
  6061  		v.reset(OpLOONG64MOVVconst)
  6062  		v.AuxInt = int64ToAuxInt(-c)
  6063  		return true
  6064  	}
  6065  	return false
  6066  }
  6067  func rewriteValueLOONG64_OpLOONG64NOR(v *Value) bool {
  6068  	v_1 := v.Args[1]
  6069  	v_0 := v.Args[0]
  6070  	// match: (NOR x (MOVVconst [c]))
  6071  	// cond: is32Bit(c)
  6072  	// result: (NORconst [c] x)
  6073  	for {
  6074  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
  6075  			x := v_0
  6076  			if v_1.Op != OpLOONG64MOVVconst {
  6077  				continue
  6078  			}
  6079  			c := auxIntToInt64(v_1.AuxInt)
  6080  			if !(is32Bit(c)) {
  6081  				continue
  6082  			}
  6083  			v.reset(OpLOONG64NORconst)
  6084  			v.AuxInt = int64ToAuxInt(c)
  6085  			v.AddArg(x)
  6086  			return true
  6087  		}
  6088  		break
  6089  	}
  6090  	return false
  6091  }
  6092  func rewriteValueLOONG64_OpLOONG64NORconst(v *Value) bool {
  6093  	v_0 := v.Args[0]
  6094  	// match: (NORconst [c] (MOVVconst [d]))
  6095  	// result: (MOVVconst [^(c|d)])
  6096  	for {
  6097  		c := auxIntToInt64(v.AuxInt)
  6098  		if v_0.Op != OpLOONG64MOVVconst {
  6099  			break
  6100  		}
  6101  		d := auxIntToInt64(v_0.AuxInt)
  6102  		v.reset(OpLOONG64MOVVconst)
  6103  		v.AuxInt = int64ToAuxInt(^(c | d))
  6104  		return true
  6105  	}
  6106  	return false
  6107  }
  6108  func rewriteValueLOONG64_OpLOONG64OR(v *Value) bool {
  6109  	v_1 := v.Args[1]
  6110  	v_0 := v.Args[0]
  6111  	b := v.Block
  6112  	typ := &b.Func.Config.Types
  6113  	// match: (OR <typ.UInt16> (SRLVconst [8] <typ.UInt16> x) (SLLVconst [8] <typ.UInt16> x))
  6114  	// result: (REVB2H x)
  6115  	for {
  6116  		if v.Type != typ.UInt16 {
  6117  			break
  6118  		}
  6119  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
  6120  			if v_0.Op != OpLOONG64SRLVconst || v_0.Type != typ.UInt16 || auxIntToInt64(v_0.AuxInt) != 8 {
  6121  				continue
  6122  			}
  6123  			x := v_0.Args[0]
  6124  			if v_1.Op != OpLOONG64SLLVconst || v_1.Type != typ.UInt16 || auxIntToInt64(v_1.AuxInt) != 8 || x != v_1.Args[0] {
  6125  				continue
  6126  			}
  6127  			v.reset(OpLOONG64REVB2H)
  6128  			v.AddArg(x)
  6129  			return true
  6130  		}
  6131  		break
  6132  	}
  6133  	// match: (OR (SRLconst [8] (ANDconst [c1] x)) (SLLconst [8] (ANDconst [c2] x)))
  6134  	// cond: uint32(c1) == 0xff00ff00 && uint32(c2) == 0x00ff00ff
  6135  	// result: (REVB2H x)
  6136  	for {
  6137  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
  6138  			if v_0.Op != OpLOONG64SRLconst || auxIntToInt64(v_0.AuxInt) != 8 {
  6139  				continue
  6140  			}
  6141  			v_0_0 := v_0.Args[0]
  6142  			if v_0_0.Op != OpLOONG64ANDconst {
  6143  				continue
  6144  			}
  6145  			c1 := auxIntToInt64(v_0_0.AuxInt)
  6146  			x := v_0_0.Args[0]
  6147  			if v_1.Op != OpLOONG64SLLconst || auxIntToInt64(v_1.AuxInt) != 8 {
  6148  				continue
  6149  			}
  6150  			v_1_0 := v_1.Args[0]
  6151  			if v_1_0.Op != OpLOONG64ANDconst {
  6152  				continue
  6153  			}
  6154  			c2 := auxIntToInt64(v_1_0.AuxInt)
  6155  			if x != v_1_0.Args[0] || !(uint32(c1) == 0xff00ff00 && uint32(c2) == 0x00ff00ff) {
  6156  				continue
  6157  			}
  6158  			v.reset(OpLOONG64REVB2H)
  6159  			v.AddArg(x)
  6160  			return true
  6161  		}
  6162  		break
  6163  	}
  6164  	// match: (OR (SRLVconst [8] (AND (MOVVconst [c1]) x)) (SLLVconst [8] (AND (MOVVconst [c2]) x)))
  6165  	// cond: uint64(c1) == 0xff00ff00ff00ff00 && uint64(c2) == 0x00ff00ff00ff00ff
  6166  	// result: (REVB4H x)
  6167  	for {
  6168  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
  6169  			if v_0.Op != OpLOONG64SRLVconst || auxIntToInt64(v_0.AuxInt) != 8 {
  6170  				continue
  6171  			}
  6172  			v_0_0 := v_0.Args[0]
  6173  			if v_0_0.Op != OpLOONG64AND {
  6174  				continue
  6175  			}
  6176  			_ = v_0_0.Args[1]
  6177  			v_0_0_0 := v_0_0.Args[0]
  6178  			v_0_0_1 := v_0_0.Args[1]
  6179  			for _i1 := 0; _i1 <= 1; _i1, v_0_0_0, v_0_0_1 = _i1+1, v_0_0_1, v_0_0_0 {
  6180  				if v_0_0_0.Op != OpLOONG64MOVVconst {
  6181  					continue
  6182  				}
  6183  				c1 := auxIntToInt64(v_0_0_0.AuxInt)
  6184  				x := v_0_0_1
  6185  				if v_1.Op != OpLOONG64SLLVconst || auxIntToInt64(v_1.AuxInt) != 8 {
  6186  					continue
  6187  				}
  6188  				v_1_0 := v_1.Args[0]
  6189  				if v_1_0.Op != OpLOONG64AND {
  6190  					continue
  6191  				}
  6192  				_ = v_1_0.Args[1]
  6193  				v_1_0_0 := v_1_0.Args[0]
  6194  				v_1_0_1 := v_1_0.Args[1]
  6195  				for _i2 := 0; _i2 <= 1; _i2, v_1_0_0, v_1_0_1 = _i2+1, v_1_0_1, v_1_0_0 {
  6196  					if v_1_0_0.Op != OpLOONG64MOVVconst {
  6197  						continue
  6198  					}
  6199  					c2 := auxIntToInt64(v_1_0_0.AuxInt)
  6200  					if x != v_1_0_1 || !(uint64(c1) == 0xff00ff00ff00ff00 && uint64(c2) == 0x00ff00ff00ff00ff) {
  6201  						continue
  6202  					}
  6203  					v.reset(OpLOONG64REVB4H)
  6204  					v.AddArg(x)
  6205  					return true
  6206  				}
  6207  			}
  6208  		}
  6209  		break
  6210  	}
  6211  	// match: (OR (SRLVconst [8] (AND (MOVVconst [c1]) x)) (SLLVconst [8] (ANDconst [c2] x)))
  6212  	// cond: uint64(c1) == 0xff00ff00 && uint64(c2) == 0x00ff00ff
  6213  	// result: (REVB4H (ANDconst <x.Type> [0xffffffff] x))
  6214  	for {
  6215  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
  6216  			if v_0.Op != OpLOONG64SRLVconst || auxIntToInt64(v_0.AuxInt) != 8 {
  6217  				continue
  6218  			}
  6219  			v_0_0 := v_0.Args[0]
  6220  			if v_0_0.Op != OpLOONG64AND {
  6221  				continue
  6222  			}
  6223  			_ = v_0_0.Args[1]
  6224  			v_0_0_0 := v_0_0.Args[0]
  6225  			v_0_0_1 := v_0_0.Args[1]
  6226  			for _i1 := 0; _i1 <= 1; _i1, v_0_0_0, v_0_0_1 = _i1+1, v_0_0_1, v_0_0_0 {
  6227  				if v_0_0_0.Op != OpLOONG64MOVVconst {
  6228  					continue
  6229  				}
  6230  				c1 := auxIntToInt64(v_0_0_0.AuxInt)
  6231  				x := v_0_0_1
  6232  				if v_1.Op != OpLOONG64SLLVconst || auxIntToInt64(v_1.AuxInt) != 8 {
  6233  					continue
  6234  				}
  6235  				v_1_0 := v_1.Args[0]
  6236  				if v_1_0.Op != OpLOONG64ANDconst {
  6237  					continue
  6238  				}
  6239  				c2 := auxIntToInt64(v_1_0.AuxInt)
  6240  				if x != v_1_0.Args[0] || !(uint64(c1) == 0xff00ff00 && uint64(c2) == 0x00ff00ff) {
  6241  					continue
  6242  				}
  6243  				v.reset(OpLOONG64REVB4H)
  6244  				v0 := b.NewValue0(v.Pos, OpLOONG64ANDconst, x.Type)
  6245  				v0.AuxInt = int64ToAuxInt(0xffffffff)
  6246  				v0.AddArg(x)
  6247  				v.AddArg(v0)
  6248  				return true
  6249  			}
  6250  		}
  6251  		break
  6252  	}
  6253  	// match: (OR x (MOVVconst [c]))
  6254  	// cond: is32Bit(c)
  6255  	// result: (ORconst [c] x)
  6256  	for {
  6257  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
  6258  			x := v_0
  6259  			if v_1.Op != OpLOONG64MOVVconst {
  6260  				continue
  6261  			}
  6262  			c := auxIntToInt64(v_1.AuxInt)
  6263  			if !(is32Bit(c)) {
  6264  				continue
  6265  			}
  6266  			v.reset(OpLOONG64ORconst)
  6267  			v.AuxInt = int64ToAuxInt(c)
  6268  			v.AddArg(x)
  6269  			return true
  6270  		}
  6271  		break
  6272  	}
  6273  	// match: (OR x x)
  6274  	// result: x
  6275  	for {
  6276  		x := v_0
  6277  		if x != v_1 {
  6278  			break
  6279  		}
  6280  		v.copyOf(x)
  6281  		return true
  6282  	}
  6283  	// match: (OR x (NORconst [0] y))
  6284  	// result: (ORN x y)
  6285  	for {
  6286  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
  6287  			x := v_0
  6288  			if v_1.Op != OpLOONG64NORconst || auxIntToInt64(v_1.AuxInt) != 0 {
  6289  				continue
  6290  			}
  6291  			y := v_1.Args[0]
  6292  			v.reset(OpLOONG64ORN)
  6293  			v.AddArg2(x, y)
  6294  			return true
  6295  		}
  6296  		break
  6297  	}
  6298  	return false
  6299  }
  6300  func rewriteValueLOONG64_OpLOONG64ORN(v *Value) bool {
  6301  	v_1 := v.Args[1]
  6302  	v_0 := v.Args[0]
  6303  	// match: (ORN x (MOVVconst [-1]))
  6304  	// result: x
  6305  	for {
  6306  		x := v_0
  6307  		if v_1.Op != OpLOONG64MOVVconst || auxIntToInt64(v_1.AuxInt) != -1 {
  6308  			break
  6309  		}
  6310  		v.copyOf(x)
  6311  		return true
  6312  	}
  6313  	return false
  6314  }
  6315  func rewriteValueLOONG64_OpLOONG64ORconst(v *Value) bool {
  6316  	v_0 := v.Args[0]
  6317  	// match: (ORconst [0] x)
  6318  	// result: x
  6319  	for {
  6320  		if auxIntToInt64(v.AuxInt) != 0 {
  6321  			break
  6322  		}
  6323  		x := v_0
  6324  		v.copyOf(x)
  6325  		return true
  6326  	}
  6327  	// match: (ORconst [-1] _)
  6328  	// result: (MOVVconst [-1])
  6329  	for {
  6330  		if auxIntToInt64(v.AuxInt) != -1 {
  6331  			break
  6332  		}
  6333  		v.reset(OpLOONG64MOVVconst)
  6334  		v.AuxInt = int64ToAuxInt(-1)
  6335  		return true
  6336  	}
  6337  	// match: (ORconst [c] (MOVVconst [d]))
  6338  	// result: (MOVVconst [c|d])
  6339  	for {
  6340  		c := auxIntToInt64(v.AuxInt)
  6341  		if v_0.Op != OpLOONG64MOVVconst {
  6342  			break
  6343  		}
  6344  		d := auxIntToInt64(v_0.AuxInt)
  6345  		v.reset(OpLOONG64MOVVconst)
  6346  		v.AuxInt = int64ToAuxInt(c | d)
  6347  		return true
  6348  	}
  6349  	// match: (ORconst [c] (ORconst [d] x))
  6350  	// cond: is32Bit(c|d)
  6351  	// result: (ORconst [c|d] x)
  6352  	for {
  6353  		c := auxIntToInt64(v.AuxInt)
  6354  		if v_0.Op != OpLOONG64ORconst {
  6355  			break
  6356  		}
  6357  		d := auxIntToInt64(v_0.AuxInt)
  6358  		x := v_0.Args[0]
  6359  		if !(is32Bit(c | d)) {
  6360  			break
  6361  		}
  6362  		v.reset(OpLOONG64ORconst)
  6363  		v.AuxInt = int64ToAuxInt(c | d)
  6364  		v.AddArg(x)
  6365  		return true
  6366  	}
  6367  	return false
  6368  }
  6369  func rewriteValueLOONG64_OpLOONG64REMV(v *Value) bool {
  6370  	v_1 := v.Args[1]
  6371  	v_0 := v.Args[0]
  6372  	// match: (REMV (MOVVconst [c]) (MOVVconst [d]))
  6373  	// cond: d != 0
  6374  	// result: (MOVVconst [c%d])
  6375  	for {
  6376  		if v_0.Op != OpLOONG64MOVVconst {
  6377  			break
  6378  		}
  6379  		c := auxIntToInt64(v_0.AuxInt)
  6380  		if v_1.Op != OpLOONG64MOVVconst {
  6381  			break
  6382  		}
  6383  		d := auxIntToInt64(v_1.AuxInt)
  6384  		if !(d != 0) {
  6385  			break
  6386  		}
  6387  		v.reset(OpLOONG64MOVVconst)
  6388  		v.AuxInt = int64ToAuxInt(c % d)
  6389  		return true
  6390  	}
  6391  	return false
  6392  }
  6393  func rewriteValueLOONG64_OpLOONG64REMVU(v *Value) bool {
  6394  	v_1 := v.Args[1]
  6395  	v_0 := v.Args[0]
  6396  	// match: (REMVU _ (MOVVconst [1]))
  6397  	// result: (MOVVconst [0])
  6398  	for {
  6399  		if v_1.Op != OpLOONG64MOVVconst || auxIntToInt64(v_1.AuxInt) != 1 {
  6400  			break
  6401  		}
  6402  		v.reset(OpLOONG64MOVVconst)
  6403  		v.AuxInt = int64ToAuxInt(0)
  6404  		return true
  6405  	}
  6406  	// match: (REMVU x (MOVVconst [c]))
  6407  	// cond: isPowerOfTwo(c)
  6408  	// result: (ANDconst [c-1] x)
  6409  	for {
  6410  		x := v_0
  6411  		if v_1.Op != OpLOONG64MOVVconst {
  6412  			break
  6413  		}
  6414  		c := auxIntToInt64(v_1.AuxInt)
  6415  		if !(isPowerOfTwo(c)) {
  6416  			break
  6417  		}
  6418  		v.reset(OpLOONG64ANDconst)
  6419  		v.AuxInt = int64ToAuxInt(c - 1)
  6420  		v.AddArg(x)
  6421  		return true
  6422  	}
  6423  	// match: (REMVU (MOVVconst [c]) (MOVVconst [d]))
  6424  	// cond: d != 0
  6425  	// result: (MOVVconst [int64(uint64(c)%uint64(d))])
  6426  	for {
  6427  		if v_0.Op != OpLOONG64MOVVconst {
  6428  			break
  6429  		}
  6430  		c := auxIntToInt64(v_0.AuxInt)
  6431  		if v_1.Op != OpLOONG64MOVVconst {
  6432  			break
  6433  		}
  6434  		d := auxIntToInt64(v_1.AuxInt)
  6435  		if !(d != 0) {
  6436  			break
  6437  		}
  6438  		v.reset(OpLOONG64MOVVconst)
  6439  		v.AuxInt = int64ToAuxInt(int64(uint64(c) % uint64(d)))
  6440  		return true
  6441  	}
  6442  	return false
  6443  }
  6444  func rewriteValueLOONG64_OpLOONG64ROTR(v *Value) bool {
  6445  	v_1 := v.Args[1]
  6446  	v_0 := v.Args[0]
  6447  	// match: (ROTR x (MOVVconst [c]))
  6448  	// result: (ROTRconst x [c&31])
  6449  	for {
  6450  		x := v_0
  6451  		if v_1.Op != OpLOONG64MOVVconst {
  6452  			break
  6453  		}
  6454  		c := auxIntToInt64(v_1.AuxInt)
  6455  		v.reset(OpLOONG64ROTRconst)
  6456  		v.AuxInt = int64ToAuxInt(c & 31)
  6457  		v.AddArg(x)
  6458  		return true
  6459  	}
  6460  	return false
  6461  }
  6462  func rewriteValueLOONG64_OpLOONG64ROTRV(v *Value) bool {
  6463  	v_1 := v.Args[1]
  6464  	v_0 := v.Args[0]
  6465  	// match: (ROTRV x (MOVVconst [c]))
  6466  	// result: (ROTRVconst x [c&63])
  6467  	for {
  6468  		x := v_0
  6469  		if v_1.Op != OpLOONG64MOVVconst {
  6470  			break
  6471  		}
  6472  		c := auxIntToInt64(v_1.AuxInt)
  6473  		v.reset(OpLOONG64ROTRVconst)
  6474  		v.AuxInt = int64ToAuxInt(c & 63)
  6475  		v.AddArg(x)
  6476  		return true
  6477  	}
  6478  	return false
  6479  }
  6480  func rewriteValueLOONG64_OpLOONG64SGT(v *Value) bool {
  6481  	v_1 := v.Args[1]
  6482  	v_0 := v.Args[0]
  6483  	b := v.Block
  6484  	typ := &b.Func.Config.Types
  6485  	// match: (SGT (MOVVconst [c]) (NEGV (SUBVconst [d] x)))
  6486  	// cond: is32Bit(d-c)
  6487  	// result: (SGT x (MOVVconst [d-c]))
  6488  	for {
  6489  		if v_0.Op != OpLOONG64MOVVconst {
  6490  			break
  6491  		}
  6492  		c := auxIntToInt64(v_0.AuxInt)
  6493  		if v_1.Op != OpLOONG64NEGV {
  6494  			break
  6495  		}
  6496  		v_1_0 := v_1.Args[0]
  6497  		if v_1_0.Op != OpLOONG64SUBVconst {
  6498  			break
  6499  		}
  6500  		d := auxIntToInt64(v_1_0.AuxInt)
  6501  		x := v_1_0.Args[0]
  6502  		if !(is32Bit(d - c)) {
  6503  			break
  6504  		}
  6505  		v.reset(OpLOONG64SGT)
  6506  		v0 := b.NewValue0(v.Pos, OpLOONG64MOVVconst, typ.UInt64)
  6507  		v0.AuxInt = int64ToAuxInt(d - c)
  6508  		v.AddArg2(x, v0)
  6509  		return true
  6510  	}
  6511  	// match: (SGT (MOVVconst [c]) x)
  6512  	// cond: is32Bit(c)
  6513  	// result: (SGTconst [c] x)
  6514  	for {
  6515  		if v_0.Op != OpLOONG64MOVVconst {
  6516  			break
  6517  		}
  6518  		c := auxIntToInt64(v_0.AuxInt)
  6519  		x := v_1
  6520  		if !(is32Bit(c)) {
  6521  			break
  6522  		}
  6523  		v.reset(OpLOONG64SGTconst)
  6524  		v.AuxInt = int64ToAuxInt(c)
  6525  		v.AddArg(x)
  6526  		return true
  6527  	}
  6528  	// match: (SGT x x)
  6529  	// result: (MOVVconst [0])
  6530  	for {
  6531  		x := v_0
  6532  		if x != v_1 {
  6533  			break
  6534  		}
  6535  		v.reset(OpLOONG64MOVVconst)
  6536  		v.AuxInt = int64ToAuxInt(0)
  6537  		return true
  6538  	}
  6539  	return false
  6540  }
  6541  func rewriteValueLOONG64_OpLOONG64SGTU(v *Value) bool {
  6542  	v_1 := v.Args[1]
  6543  	v_0 := v.Args[0]
  6544  	// match: (SGTU (MOVVconst [c]) x)
  6545  	// cond: is32Bit(c)
  6546  	// result: (SGTUconst [c] x)
  6547  	for {
  6548  		if v_0.Op != OpLOONG64MOVVconst {
  6549  			break
  6550  		}
  6551  		c := auxIntToInt64(v_0.AuxInt)
  6552  		x := v_1
  6553  		if !(is32Bit(c)) {
  6554  			break
  6555  		}
  6556  		v.reset(OpLOONG64SGTUconst)
  6557  		v.AuxInt = int64ToAuxInt(c)
  6558  		v.AddArg(x)
  6559  		return true
  6560  	}
  6561  	// match: (SGTU x x)
  6562  	// result: (MOVVconst [0])
  6563  	for {
  6564  		x := v_0
  6565  		if x != v_1 {
  6566  			break
  6567  		}
  6568  		v.reset(OpLOONG64MOVVconst)
  6569  		v.AuxInt = int64ToAuxInt(0)
  6570  		return true
  6571  	}
  6572  	return false
  6573  }
  6574  func rewriteValueLOONG64_OpLOONG64SGTUconst(v *Value) bool {
  6575  	v_0 := v.Args[0]
  6576  	// match: (SGTUconst [c] (MOVVconst [d]))
  6577  	// cond: uint64(c)>uint64(d)
  6578  	// result: (MOVVconst [1])
  6579  	for {
  6580  		c := auxIntToInt64(v.AuxInt)
  6581  		if v_0.Op != OpLOONG64MOVVconst {
  6582  			break
  6583  		}
  6584  		d := auxIntToInt64(v_0.AuxInt)
  6585  		if !(uint64(c) > uint64(d)) {
  6586  			break
  6587  		}
  6588  		v.reset(OpLOONG64MOVVconst)
  6589  		v.AuxInt = int64ToAuxInt(1)
  6590  		return true
  6591  	}
  6592  	// match: (SGTUconst [c] (MOVVconst [d]))
  6593  	// cond: uint64(c)<=uint64(d)
  6594  	// result: (MOVVconst [0])
  6595  	for {
  6596  		c := auxIntToInt64(v.AuxInt)
  6597  		if v_0.Op != OpLOONG64MOVVconst {
  6598  			break
  6599  		}
  6600  		d := auxIntToInt64(v_0.AuxInt)
  6601  		if !(uint64(c) <= uint64(d)) {
  6602  			break
  6603  		}
  6604  		v.reset(OpLOONG64MOVVconst)
  6605  		v.AuxInt = int64ToAuxInt(0)
  6606  		return true
  6607  	}
  6608  	// match: (SGTUconst [c] (MOVBUreg _))
  6609  	// cond: 0xff < uint64(c)
  6610  	// result: (MOVVconst [1])
  6611  	for {
  6612  		c := auxIntToInt64(v.AuxInt)
  6613  		if v_0.Op != OpLOONG64MOVBUreg || !(0xff < uint64(c)) {
  6614  			break
  6615  		}
  6616  		v.reset(OpLOONG64MOVVconst)
  6617  		v.AuxInt = int64ToAuxInt(1)
  6618  		return true
  6619  	}
  6620  	// match: (SGTUconst [c] (MOVHUreg _))
  6621  	// cond: 0xffff < uint64(c)
  6622  	// result: (MOVVconst [1])
  6623  	for {
  6624  		c := auxIntToInt64(v.AuxInt)
  6625  		if v_0.Op != OpLOONG64MOVHUreg || !(0xffff < uint64(c)) {
  6626  			break
  6627  		}
  6628  		v.reset(OpLOONG64MOVVconst)
  6629  		v.AuxInt = int64ToAuxInt(1)
  6630  		return true
  6631  	}
  6632  	// match: (SGTUconst [c] (ANDconst [m] _))
  6633  	// cond: uint64(m) < uint64(c)
  6634  	// result: (MOVVconst [1])
  6635  	for {
  6636  		c := auxIntToInt64(v.AuxInt)
  6637  		if v_0.Op != OpLOONG64ANDconst {
  6638  			break
  6639  		}
  6640  		m := auxIntToInt64(v_0.AuxInt)
  6641  		if !(uint64(m) < uint64(c)) {
  6642  			break
  6643  		}
  6644  		v.reset(OpLOONG64MOVVconst)
  6645  		v.AuxInt = int64ToAuxInt(1)
  6646  		return true
  6647  	}
  6648  	// match: (SGTUconst [c] (SRLVconst _ [d]))
  6649  	// cond: 0 < d && d <= 63 && 0xffffffffffffffff>>uint64(d) < uint64(c)
  6650  	// result: (MOVVconst [1])
  6651  	for {
  6652  		c := auxIntToInt64(v.AuxInt)
  6653  		if v_0.Op != OpLOONG64SRLVconst {
  6654  			break
  6655  		}
  6656  		d := auxIntToInt64(v_0.AuxInt)
  6657  		if !(0 < d && d <= 63 && 0xffffffffffffffff>>uint64(d) < uint64(c)) {
  6658  			break
  6659  		}
  6660  		v.reset(OpLOONG64MOVVconst)
  6661  		v.AuxInt = int64ToAuxInt(1)
  6662  		return true
  6663  	}
  6664  	return false
  6665  }
  6666  func rewriteValueLOONG64_OpLOONG64SGTconst(v *Value) bool {
  6667  	v_0 := v.Args[0]
  6668  	// match: (SGTconst [c] (MOVVconst [d]))
  6669  	// cond: c>d
  6670  	// result: (MOVVconst [1])
  6671  	for {
  6672  		c := auxIntToInt64(v.AuxInt)
  6673  		if v_0.Op != OpLOONG64MOVVconst {
  6674  			break
  6675  		}
  6676  		d := auxIntToInt64(v_0.AuxInt)
  6677  		if !(c > d) {
  6678  			break
  6679  		}
  6680  		v.reset(OpLOONG64MOVVconst)
  6681  		v.AuxInt = int64ToAuxInt(1)
  6682  		return true
  6683  	}
  6684  	// match: (SGTconst [c] (MOVVconst [d]))
  6685  	// cond: c<=d
  6686  	// result: (MOVVconst [0])
  6687  	for {
  6688  		c := auxIntToInt64(v.AuxInt)
  6689  		if v_0.Op != OpLOONG64MOVVconst {
  6690  			break
  6691  		}
  6692  		d := auxIntToInt64(v_0.AuxInt)
  6693  		if !(c <= d) {
  6694  			break
  6695  		}
  6696  		v.reset(OpLOONG64MOVVconst)
  6697  		v.AuxInt = int64ToAuxInt(0)
  6698  		return true
  6699  	}
  6700  	// match: (SGTconst [c] (MOVBreg _))
  6701  	// cond: 0x7f < c
  6702  	// result: (MOVVconst [1])
  6703  	for {
  6704  		c := auxIntToInt64(v.AuxInt)
  6705  		if v_0.Op != OpLOONG64MOVBreg || !(0x7f < c) {
  6706  			break
  6707  		}
  6708  		v.reset(OpLOONG64MOVVconst)
  6709  		v.AuxInt = int64ToAuxInt(1)
  6710  		return true
  6711  	}
  6712  	// match: (SGTconst [c] (MOVBreg _))
  6713  	// cond: c <= -0x80
  6714  	// result: (MOVVconst [0])
  6715  	for {
  6716  		c := auxIntToInt64(v.AuxInt)
  6717  		if v_0.Op != OpLOONG64MOVBreg || !(c <= -0x80) {
  6718  			break
  6719  		}
  6720  		v.reset(OpLOONG64MOVVconst)
  6721  		v.AuxInt = int64ToAuxInt(0)
  6722  		return true
  6723  	}
  6724  	// match: (SGTconst [c] (MOVBUreg _))
  6725  	// cond: 0xff < c
  6726  	// result: (MOVVconst [1])
  6727  	for {
  6728  		c := auxIntToInt64(v.AuxInt)
  6729  		if v_0.Op != OpLOONG64MOVBUreg || !(0xff < c) {
  6730  			break
  6731  		}
  6732  		v.reset(OpLOONG64MOVVconst)
  6733  		v.AuxInt = int64ToAuxInt(1)
  6734  		return true
  6735  	}
  6736  	// match: (SGTconst [c] (MOVBUreg _))
  6737  	// cond: c < 0
  6738  	// result: (MOVVconst [0])
  6739  	for {
  6740  		c := auxIntToInt64(v.AuxInt)
  6741  		if v_0.Op != OpLOONG64MOVBUreg || !(c < 0) {
  6742  			break
  6743  		}
  6744  		v.reset(OpLOONG64MOVVconst)
  6745  		v.AuxInt = int64ToAuxInt(0)
  6746  		return true
  6747  	}
  6748  	// match: (SGTconst [c] (MOVHreg _))
  6749  	// cond: 0x7fff < c
  6750  	// result: (MOVVconst [1])
  6751  	for {
  6752  		c := auxIntToInt64(v.AuxInt)
  6753  		if v_0.Op != OpLOONG64MOVHreg || !(0x7fff < c) {
  6754  			break
  6755  		}
  6756  		v.reset(OpLOONG64MOVVconst)
  6757  		v.AuxInt = int64ToAuxInt(1)
  6758  		return true
  6759  	}
  6760  	// match: (SGTconst [c] (MOVHreg _))
  6761  	// cond: c <= -0x8000
  6762  	// result: (MOVVconst [0])
  6763  	for {
  6764  		c := auxIntToInt64(v.AuxInt)
  6765  		if v_0.Op != OpLOONG64MOVHreg || !(c <= -0x8000) {
  6766  			break
  6767  		}
  6768  		v.reset(OpLOONG64MOVVconst)
  6769  		v.AuxInt = int64ToAuxInt(0)
  6770  		return true
  6771  	}
  6772  	// match: (SGTconst [c] (MOVHUreg _))
  6773  	// cond: 0xffff < c
  6774  	// result: (MOVVconst [1])
  6775  	for {
  6776  		c := auxIntToInt64(v.AuxInt)
  6777  		if v_0.Op != OpLOONG64MOVHUreg || !(0xffff < c) {
  6778  			break
  6779  		}
  6780  		v.reset(OpLOONG64MOVVconst)
  6781  		v.AuxInt = int64ToAuxInt(1)
  6782  		return true
  6783  	}
  6784  	// match: (SGTconst [c] (MOVHUreg _))
  6785  	// cond: c < 0
  6786  	// result: (MOVVconst [0])
  6787  	for {
  6788  		c := auxIntToInt64(v.AuxInt)
  6789  		if v_0.Op != OpLOONG64MOVHUreg || !(c < 0) {
  6790  			break
  6791  		}
  6792  		v.reset(OpLOONG64MOVVconst)
  6793  		v.AuxInt = int64ToAuxInt(0)
  6794  		return true
  6795  	}
  6796  	// match: (SGTconst [c] (MOVWUreg _))
  6797  	// cond: c < 0
  6798  	// result: (MOVVconst [0])
  6799  	for {
  6800  		c := auxIntToInt64(v.AuxInt)
  6801  		if v_0.Op != OpLOONG64MOVWUreg || !(c < 0) {
  6802  			break
  6803  		}
  6804  		v.reset(OpLOONG64MOVVconst)
  6805  		v.AuxInt = int64ToAuxInt(0)
  6806  		return true
  6807  	}
  6808  	// match: (SGTconst [c] (ANDconst [m] _))
  6809  	// cond: 0 <= m && m < c
  6810  	// result: (MOVVconst [1])
  6811  	for {
  6812  		c := auxIntToInt64(v.AuxInt)
  6813  		if v_0.Op != OpLOONG64ANDconst {
  6814  			break
  6815  		}
  6816  		m := auxIntToInt64(v_0.AuxInt)
  6817  		if !(0 <= m && m < c) {
  6818  			break
  6819  		}
  6820  		v.reset(OpLOONG64MOVVconst)
  6821  		v.AuxInt = int64ToAuxInt(1)
  6822  		return true
  6823  	}
  6824  	// match: (SGTconst [c] (SRLVconst _ [d]))
  6825  	// cond: 0 <= c && 0 < d && d <= 63 && 0xffffffffffffffff>>uint64(d) < uint64(c)
  6826  	// result: (MOVVconst [1])
  6827  	for {
  6828  		c := auxIntToInt64(v.AuxInt)
  6829  		if v_0.Op != OpLOONG64SRLVconst {
  6830  			break
  6831  		}
  6832  		d := auxIntToInt64(v_0.AuxInt)
  6833  		if !(0 <= c && 0 < d && d <= 63 && 0xffffffffffffffff>>uint64(d) < uint64(c)) {
  6834  			break
  6835  		}
  6836  		v.reset(OpLOONG64MOVVconst)
  6837  		v.AuxInt = int64ToAuxInt(1)
  6838  		return true
  6839  	}
  6840  	return false
  6841  }
  6842  func rewriteValueLOONG64_OpLOONG64SLL(v *Value) bool {
  6843  	v_1 := v.Args[1]
  6844  	v_0 := v.Args[0]
  6845  	// match: (SLL _ (MOVVconst [c]))
  6846  	// cond: uint64(c)>=32
  6847  	// result: (MOVVconst [0])
  6848  	for {
  6849  		if v_1.Op != OpLOONG64MOVVconst {
  6850  			break
  6851  		}
  6852  		c := auxIntToInt64(v_1.AuxInt)
  6853  		if !(uint64(c) >= 32) {
  6854  			break
  6855  		}
  6856  		v.reset(OpLOONG64MOVVconst)
  6857  		v.AuxInt = int64ToAuxInt(0)
  6858  		return true
  6859  	}
  6860  	// match: (SLL x (MOVVconst [c]))
  6861  	// cond: uint64(c) >=0 && uint64(c) <=31
  6862  	// result: (SLLconst x [c])
  6863  	for {
  6864  		x := v_0
  6865  		if v_1.Op != OpLOONG64MOVVconst {
  6866  			break
  6867  		}
  6868  		c := auxIntToInt64(v_1.AuxInt)
  6869  		if !(uint64(c) >= 0 && uint64(c) <= 31) {
  6870  			break
  6871  		}
  6872  		v.reset(OpLOONG64SLLconst)
  6873  		v.AuxInt = int64ToAuxInt(c)
  6874  		v.AddArg(x)
  6875  		return true
  6876  	}
  6877  	// match: (SLL x (ANDconst [31] y))
  6878  	// result: (SLL x y)
  6879  	for {
  6880  		x := v_0
  6881  		if v_1.Op != OpLOONG64ANDconst || auxIntToInt64(v_1.AuxInt) != 31 {
  6882  			break
  6883  		}
  6884  		y := v_1.Args[0]
  6885  		v.reset(OpLOONG64SLL)
  6886  		v.AddArg2(x, y)
  6887  		return true
  6888  	}
  6889  	return false
  6890  }
  6891  func rewriteValueLOONG64_OpLOONG64SLLV(v *Value) bool {
  6892  	v_1 := v.Args[1]
  6893  	v_0 := v.Args[0]
  6894  	// match: (SLLV _ (MOVVconst [c]))
  6895  	// cond: uint64(c)>=64
  6896  	// result: (MOVVconst [0])
  6897  	for {
  6898  		if v_1.Op != OpLOONG64MOVVconst {
  6899  			break
  6900  		}
  6901  		c := auxIntToInt64(v_1.AuxInt)
  6902  		if !(uint64(c) >= 64) {
  6903  			break
  6904  		}
  6905  		v.reset(OpLOONG64MOVVconst)
  6906  		v.AuxInt = int64ToAuxInt(0)
  6907  		return true
  6908  	}
  6909  	// match: (SLLV x (MOVVconst [c]))
  6910  	// result: (SLLVconst x [c])
  6911  	for {
  6912  		x := v_0
  6913  		if v_1.Op != OpLOONG64MOVVconst {
  6914  			break
  6915  		}
  6916  		c := auxIntToInt64(v_1.AuxInt)
  6917  		v.reset(OpLOONG64SLLVconst)
  6918  		v.AuxInt = int64ToAuxInt(c)
  6919  		v.AddArg(x)
  6920  		return true
  6921  	}
  6922  	// match: (SLLV x (ANDconst [63] y))
  6923  	// result: (SLLV x y)
  6924  	for {
  6925  		x := v_0
  6926  		if v_1.Op != OpLOONG64ANDconst || auxIntToInt64(v_1.AuxInt) != 63 {
  6927  			break
  6928  		}
  6929  		y := v_1.Args[0]
  6930  		v.reset(OpLOONG64SLLV)
  6931  		v.AddArg2(x, y)
  6932  		return true
  6933  	}
  6934  	return false
  6935  }
  6936  func rewriteValueLOONG64_OpLOONG64SLLVconst(v *Value) bool {
  6937  	v_0 := v.Args[0]
  6938  	// match: (SLLVconst <t> [c] (ADDV x x))
  6939  	// cond: c < t.Size() * 8 - 1
  6940  	// result: (SLLVconst [c+1] x)
  6941  	for {
  6942  		t := v.Type
  6943  		c := auxIntToInt64(v.AuxInt)
  6944  		if v_0.Op != OpLOONG64ADDV {
  6945  			break
  6946  		}
  6947  		x := v_0.Args[1]
  6948  		if x != v_0.Args[0] || !(c < t.Size()*8-1) {
  6949  			break
  6950  		}
  6951  		v.reset(OpLOONG64SLLVconst)
  6952  		v.AuxInt = int64ToAuxInt(c + 1)
  6953  		v.AddArg(x)
  6954  		return true
  6955  	}
  6956  	// match: (SLLVconst <t> [c] (ADDV x x))
  6957  	// cond: c >= t.Size() * 8 - 1
  6958  	// result: (MOVVconst [0])
  6959  	for {
  6960  		t := v.Type
  6961  		c := auxIntToInt64(v.AuxInt)
  6962  		if v_0.Op != OpLOONG64ADDV {
  6963  			break
  6964  		}
  6965  		x := v_0.Args[1]
  6966  		if x != v_0.Args[0] || !(c >= t.Size()*8-1) {
  6967  			break
  6968  		}
  6969  		v.reset(OpLOONG64MOVVconst)
  6970  		v.AuxInt = int64ToAuxInt(0)
  6971  		return true
  6972  	}
  6973  	// match: (SLLVconst [c] (MOVVconst [d]))
  6974  	// result: (MOVVconst [d<<uint64(c)])
  6975  	for {
  6976  		c := auxIntToInt64(v.AuxInt)
  6977  		if v_0.Op != OpLOONG64MOVVconst {
  6978  			break
  6979  		}
  6980  		d := auxIntToInt64(v_0.AuxInt)
  6981  		v.reset(OpLOONG64MOVVconst)
  6982  		v.AuxInt = int64ToAuxInt(d << uint64(c))
  6983  		return true
  6984  	}
  6985  	return false
  6986  }
  6987  func rewriteValueLOONG64_OpLOONG64SLLconst(v *Value) bool {
  6988  	v_0 := v.Args[0]
  6989  	// match: (SLLconst <t> [c] (ADDV x x))
  6990  	// cond: c < t.Size() * 8 - 1
  6991  	// result: (SLLconst [c+1] x)
  6992  	for {
  6993  		t := v.Type
  6994  		c := auxIntToInt64(v.AuxInt)
  6995  		if v_0.Op != OpLOONG64ADDV {
  6996  			break
  6997  		}
  6998  		x := v_0.Args[1]
  6999  		if x != v_0.Args[0] || !(c < t.Size()*8-1) {
  7000  			break
  7001  		}
  7002  		v.reset(OpLOONG64SLLconst)
  7003  		v.AuxInt = int64ToAuxInt(c + 1)
  7004  		v.AddArg(x)
  7005  		return true
  7006  	}
  7007  	// match: (SLLconst <t> [c] (ADDV x x))
  7008  	// cond: c >= t.Size() * 8 - 1
  7009  	// result: (MOVVconst [0])
  7010  	for {
  7011  		t := v.Type
  7012  		c := auxIntToInt64(v.AuxInt)
  7013  		if v_0.Op != OpLOONG64ADDV {
  7014  			break
  7015  		}
  7016  		x := v_0.Args[1]
  7017  		if x != v_0.Args[0] || !(c >= t.Size()*8-1) {
  7018  			break
  7019  		}
  7020  		v.reset(OpLOONG64MOVVconst)
  7021  		v.AuxInt = int64ToAuxInt(0)
  7022  		return true
  7023  	}
  7024  	return false
  7025  }
  7026  func rewriteValueLOONG64_OpLOONG64SRA(v *Value) bool {
  7027  	v_1 := v.Args[1]
  7028  	v_0 := v.Args[0]
  7029  	// match: (SRA x (MOVVconst [c]))
  7030  	// cond: uint64(c)>=32
  7031  	// result: (SRAconst x [31])
  7032  	for {
  7033  		x := v_0
  7034  		if v_1.Op != OpLOONG64MOVVconst {
  7035  			break
  7036  		}
  7037  		c := auxIntToInt64(v_1.AuxInt)
  7038  		if !(uint64(c) >= 32) {
  7039  			break
  7040  		}
  7041  		v.reset(OpLOONG64SRAconst)
  7042  		v.AuxInt = int64ToAuxInt(31)
  7043  		v.AddArg(x)
  7044  		return true
  7045  	}
  7046  	// match: (SRA x (MOVVconst [c]))
  7047  	// cond: uint64(c) >=0 && uint64(c) <=31
  7048  	// result: (SRAconst x [c])
  7049  	for {
  7050  		x := v_0
  7051  		if v_1.Op != OpLOONG64MOVVconst {
  7052  			break
  7053  		}
  7054  		c := auxIntToInt64(v_1.AuxInt)
  7055  		if !(uint64(c) >= 0 && uint64(c) <= 31) {
  7056  			break
  7057  		}
  7058  		v.reset(OpLOONG64SRAconst)
  7059  		v.AuxInt = int64ToAuxInt(c)
  7060  		v.AddArg(x)
  7061  		return true
  7062  	}
  7063  	// match: (SRA x (ANDconst [31] y))
  7064  	// result: (SRA x y)
  7065  	for {
  7066  		x := v_0
  7067  		if v_1.Op != OpLOONG64ANDconst || auxIntToInt64(v_1.AuxInt) != 31 {
  7068  			break
  7069  		}
  7070  		y := v_1.Args[0]
  7071  		v.reset(OpLOONG64SRA)
  7072  		v.AddArg2(x, y)
  7073  		return true
  7074  	}
  7075  	return false
  7076  }
  7077  func rewriteValueLOONG64_OpLOONG64SRAV(v *Value) bool {
  7078  	v_1 := v.Args[1]
  7079  	v_0 := v.Args[0]
  7080  	// match: (SRAV x (MOVVconst [c]))
  7081  	// cond: uint64(c)>=64
  7082  	// result: (SRAVconst x [63])
  7083  	for {
  7084  		x := v_0
  7085  		if v_1.Op != OpLOONG64MOVVconst {
  7086  			break
  7087  		}
  7088  		c := auxIntToInt64(v_1.AuxInt)
  7089  		if !(uint64(c) >= 64) {
  7090  			break
  7091  		}
  7092  		v.reset(OpLOONG64SRAVconst)
  7093  		v.AuxInt = int64ToAuxInt(63)
  7094  		v.AddArg(x)
  7095  		return true
  7096  	}
  7097  	// match: (SRAV x (MOVVconst [c]))
  7098  	// result: (SRAVconst x [c])
  7099  	for {
  7100  		x := v_0
  7101  		if v_1.Op != OpLOONG64MOVVconst {
  7102  			break
  7103  		}
  7104  		c := auxIntToInt64(v_1.AuxInt)
  7105  		v.reset(OpLOONG64SRAVconst)
  7106  		v.AuxInt = int64ToAuxInt(c)
  7107  		v.AddArg(x)
  7108  		return true
  7109  	}
  7110  	// match: (SRAV x (ANDconst [63] y))
  7111  	// result: (SRAV x y)
  7112  	for {
  7113  		x := v_0
  7114  		if v_1.Op != OpLOONG64ANDconst || auxIntToInt64(v_1.AuxInt) != 63 {
  7115  			break
  7116  		}
  7117  		y := v_1.Args[0]
  7118  		v.reset(OpLOONG64SRAV)
  7119  		v.AddArg2(x, y)
  7120  		return true
  7121  	}
  7122  	return false
  7123  }
  7124  func rewriteValueLOONG64_OpLOONG64SRAVconst(v *Value) bool {
  7125  	v_0 := v.Args[0]
  7126  	b := v.Block
  7127  	// match: (SRAVconst [rc] (MOVWreg y))
  7128  	// cond: rc >= 0 && rc <= 31
  7129  	// result: (SRAconst [int64(rc)] y)
  7130  	for {
  7131  		rc := auxIntToInt64(v.AuxInt)
  7132  		if v_0.Op != OpLOONG64MOVWreg {
  7133  			break
  7134  		}
  7135  		y := v_0.Args[0]
  7136  		if !(rc >= 0 && rc <= 31) {
  7137  			break
  7138  		}
  7139  		v.reset(OpLOONG64SRAconst)
  7140  		v.AuxInt = int64ToAuxInt(int64(rc))
  7141  		v.AddArg(y)
  7142  		return true
  7143  	}
  7144  	// match: (SRAVconst <t> [rc] (MOVBreg y))
  7145  	// cond: rc >= 8
  7146  	// result: (SRAVconst [63] (SLLVconst <t> [56] y))
  7147  	for {
  7148  		t := v.Type
  7149  		rc := auxIntToInt64(v.AuxInt)
  7150  		if v_0.Op != OpLOONG64MOVBreg {
  7151  			break
  7152  		}
  7153  		y := v_0.Args[0]
  7154  		if !(rc >= 8) {
  7155  			break
  7156  		}
  7157  		v.reset(OpLOONG64SRAVconst)
  7158  		v.AuxInt = int64ToAuxInt(63)
  7159  		v0 := b.NewValue0(v.Pos, OpLOONG64SLLVconst, t)
  7160  		v0.AuxInt = int64ToAuxInt(56)
  7161  		v0.AddArg(y)
  7162  		v.AddArg(v0)
  7163  		return true
  7164  	}
  7165  	// match: (SRAVconst <t> [rc] (MOVHreg y))
  7166  	// cond: rc >= 16
  7167  	// result: (SRAVconst [63] (SLLVconst <t> [48] y))
  7168  	for {
  7169  		t := v.Type
  7170  		rc := auxIntToInt64(v.AuxInt)
  7171  		if v_0.Op != OpLOONG64MOVHreg {
  7172  			break
  7173  		}
  7174  		y := v_0.Args[0]
  7175  		if !(rc >= 16) {
  7176  			break
  7177  		}
  7178  		v.reset(OpLOONG64SRAVconst)
  7179  		v.AuxInt = int64ToAuxInt(63)
  7180  		v0 := b.NewValue0(v.Pos, OpLOONG64SLLVconst, t)
  7181  		v0.AuxInt = int64ToAuxInt(48)
  7182  		v0.AddArg(y)
  7183  		v.AddArg(v0)
  7184  		return true
  7185  	}
  7186  	// match: (SRAVconst <t> [rc] (MOVWreg y))
  7187  	// cond: rc >= 32
  7188  	// result: (SRAconst [31] y)
  7189  	for {
  7190  		rc := auxIntToInt64(v.AuxInt)
  7191  		if v_0.Op != OpLOONG64MOVWreg {
  7192  			break
  7193  		}
  7194  		y := v_0.Args[0]
  7195  		if !(rc >= 32) {
  7196  			break
  7197  		}
  7198  		v.reset(OpLOONG64SRAconst)
  7199  		v.AuxInt = int64ToAuxInt(31)
  7200  		v.AddArg(y)
  7201  		return true
  7202  	}
  7203  	// match: (SRAVconst [c] (MOVVconst [d]))
  7204  	// result: (MOVVconst [d>>uint64(c)])
  7205  	for {
  7206  		c := auxIntToInt64(v.AuxInt)
  7207  		if v_0.Op != OpLOONG64MOVVconst {
  7208  			break
  7209  		}
  7210  		d := auxIntToInt64(v_0.AuxInt)
  7211  		v.reset(OpLOONG64MOVVconst)
  7212  		v.AuxInt = int64ToAuxInt(d >> uint64(c))
  7213  		return true
  7214  	}
  7215  	return false
  7216  }
  7217  func rewriteValueLOONG64_OpLOONG64SRL(v *Value) bool {
  7218  	v_1 := v.Args[1]
  7219  	v_0 := v.Args[0]
  7220  	// match: (SRL _ (MOVVconst [c]))
  7221  	// cond: uint64(c)>=32
  7222  	// result: (MOVVconst [0])
  7223  	for {
  7224  		if v_1.Op != OpLOONG64MOVVconst {
  7225  			break
  7226  		}
  7227  		c := auxIntToInt64(v_1.AuxInt)
  7228  		if !(uint64(c) >= 32) {
  7229  			break
  7230  		}
  7231  		v.reset(OpLOONG64MOVVconst)
  7232  		v.AuxInt = int64ToAuxInt(0)
  7233  		return true
  7234  	}
  7235  	// match: (SRL x (MOVVconst [c]))
  7236  	// cond: uint64(c) >=0 && uint64(c) <=31
  7237  	// result: (SRLconst x [c])
  7238  	for {
  7239  		x := v_0
  7240  		if v_1.Op != OpLOONG64MOVVconst {
  7241  			break
  7242  		}
  7243  		c := auxIntToInt64(v_1.AuxInt)
  7244  		if !(uint64(c) >= 0 && uint64(c) <= 31) {
  7245  			break
  7246  		}
  7247  		v.reset(OpLOONG64SRLconst)
  7248  		v.AuxInt = int64ToAuxInt(c)
  7249  		v.AddArg(x)
  7250  		return true
  7251  	}
  7252  	// match: (SRL x (ANDconst [31] y))
  7253  	// result: (SRL x y)
  7254  	for {
  7255  		x := v_0
  7256  		if v_1.Op != OpLOONG64ANDconst || auxIntToInt64(v_1.AuxInt) != 31 {
  7257  			break
  7258  		}
  7259  		y := v_1.Args[0]
  7260  		v.reset(OpLOONG64SRL)
  7261  		v.AddArg2(x, y)
  7262  		return true
  7263  	}
  7264  	return false
  7265  }
  7266  func rewriteValueLOONG64_OpLOONG64SRLV(v *Value) bool {
  7267  	v_1 := v.Args[1]
  7268  	v_0 := v.Args[0]
  7269  	// match: (SRLV _ (MOVVconst [c]))
  7270  	// cond: uint64(c)>=64
  7271  	// result: (MOVVconst [0])
  7272  	for {
  7273  		if v_1.Op != OpLOONG64MOVVconst {
  7274  			break
  7275  		}
  7276  		c := auxIntToInt64(v_1.AuxInt)
  7277  		if !(uint64(c) >= 64) {
  7278  			break
  7279  		}
  7280  		v.reset(OpLOONG64MOVVconst)
  7281  		v.AuxInt = int64ToAuxInt(0)
  7282  		return true
  7283  	}
  7284  	// match: (SRLV x (MOVVconst [c]))
  7285  	// result: (SRLVconst x [c])
  7286  	for {
  7287  		x := v_0
  7288  		if v_1.Op != OpLOONG64MOVVconst {
  7289  			break
  7290  		}
  7291  		c := auxIntToInt64(v_1.AuxInt)
  7292  		v.reset(OpLOONG64SRLVconst)
  7293  		v.AuxInt = int64ToAuxInt(c)
  7294  		v.AddArg(x)
  7295  		return true
  7296  	}
  7297  	// match: (SRLV x (ANDconst [63] y))
  7298  	// result: (SRLV x y)
  7299  	for {
  7300  		x := v_0
  7301  		if v_1.Op != OpLOONG64ANDconst || auxIntToInt64(v_1.AuxInt) != 63 {
  7302  			break
  7303  		}
  7304  		y := v_1.Args[0]
  7305  		v.reset(OpLOONG64SRLV)
  7306  		v.AddArg2(x, y)
  7307  		return true
  7308  	}
  7309  	return false
  7310  }
  7311  func rewriteValueLOONG64_OpLOONG64SRLVconst(v *Value) bool {
  7312  	v_0 := v.Args[0]
  7313  	// match: (SRLVconst [rc] (SLLVconst [lc] x))
  7314  	// cond: lc <= rc
  7315  	// result: (BSTRPICKV [rc-lc + ((64-lc)-1)<<6] x)
  7316  	for {
  7317  		rc := auxIntToInt64(v.AuxInt)
  7318  		if v_0.Op != OpLOONG64SLLVconst {
  7319  			break
  7320  		}
  7321  		lc := auxIntToInt64(v_0.AuxInt)
  7322  		x := v_0.Args[0]
  7323  		if !(lc <= rc) {
  7324  			break
  7325  		}
  7326  		v.reset(OpLOONG64BSTRPICKV)
  7327  		v.AuxInt = int64ToAuxInt(rc - lc + ((64-lc)-1)<<6)
  7328  		v.AddArg(x)
  7329  		return true
  7330  	}
  7331  	// match: (SRLVconst [rc] (MOVWUreg x))
  7332  	// cond: rc < 32
  7333  	// result: (BSTRPICKV [rc + 31<<6] x)
  7334  	for {
  7335  		rc := auxIntToInt64(v.AuxInt)
  7336  		if v_0.Op != OpLOONG64MOVWUreg {
  7337  			break
  7338  		}
  7339  		x := v_0.Args[0]
  7340  		if !(rc < 32) {
  7341  			break
  7342  		}
  7343  		v.reset(OpLOONG64BSTRPICKV)
  7344  		v.AuxInt = int64ToAuxInt(rc + 31<<6)
  7345  		v.AddArg(x)
  7346  		return true
  7347  	}
  7348  	// match: (SRLVconst [rc] (MOVHUreg x))
  7349  	// cond: rc < 16
  7350  	// result: (BSTRPICKV [rc + 15<<6] x)
  7351  	for {
  7352  		rc := auxIntToInt64(v.AuxInt)
  7353  		if v_0.Op != OpLOONG64MOVHUreg {
  7354  			break
  7355  		}
  7356  		x := v_0.Args[0]
  7357  		if !(rc < 16) {
  7358  			break
  7359  		}
  7360  		v.reset(OpLOONG64BSTRPICKV)
  7361  		v.AuxInt = int64ToAuxInt(rc + 15<<6)
  7362  		v.AddArg(x)
  7363  		return true
  7364  	}
  7365  	// match: (SRLVconst [rc] (MOVBUreg x))
  7366  	// cond: rc < 8
  7367  	// result: (BSTRPICKV [rc + 7<<6] x)
  7368  	for {
  7369  		rc := auxIntToInt64(v.AuxInt)
  7370  		if v_0.Op != OpLOONG64MOVBUreg {
  7371  			break
  7372  		}
  7373  		x := v_0.Args[0]
  7374  		if !(rc < 8) {
  7375  			break
  7376  		}
  7377  		v.reset(OpLOONG64BSTRPICKV)
  7378  		v.AuxInt = int64ToAuxInt(rc + 7<<6)
  7379  		v.AddArg(x)
  7380  		return true
  7381  	}
  7382  	// match: (SRLVconst [rc] (MOVWUreg y))
  7383  	// cond: rc >= 0 && rc <= 31
  7384  	// result: (SRLconst [int64(rc)] y)
  7385  	for {
  7386  		rc := auxIntToInt64(v.AuxInt)
  7387  		if v_0.Op != OpLOONG64MOVWUreg {
  7388  			break
  7389  		}
  7390  		y := v_0.Args[0]
  7391  		if !(rc >= 0 && rc <= 31) {
  7392  			break
  7393  		}
  7394  		v.reset(OpLOONG64SRLconst)
  7395  		v.AuxInt = int64ToAuxInt(int64(rc))
  7396  		v.AddArg(y)
  7397  		return true
  7398  	}
  7399  	// match: (SRLVconst [rc] (MOVWUreg x))
  7400  	// cond: rc >= 32
  7401  	// result: (MOVVconst [0])
  7402  	for {
  7403  		rc := auxIntToInt64(v.AuxInt)
  7404  		if v_0.Op != OpLOONG64MOVWUreg {
  7405  			break
  7406  		}
  7407  		if !(rc >= 32) {
  7408  			break
  7409  		}
  7410  		v.reset(OpLOONG64MOVVconst)
  7411  		v.AuxInt = int64ToAuxInt(0)
  7412  		return true
  7413  	}
  7414  	// match: (SRLVconst [rc] (MOVHUreg x))
  7415  	// cond: rc >= 16
  7416  	// result: (MOVVconst [0])
  7417  	for {
  7418  		rc := auxIntToInt64(v.AuxInt)
  7419  		if v_0.Op != OpLOONG64MOVHUreg {
  7420  			break
  7421  		}
  7422  		if !(rc >= 16) {
  7423  			break
  7424  		}
  7425  		v.reset(OpLOONG64MOVVconst)
  7426  		v.AuxInt = int64ToAuxInt(0)
  7427  		return true
  7428  	}
  7429  	// match: (SRLVconst [rc] (MOVBUreg x))
  7430  	// cond: rc >= 8
  7431  	// result: (MOVVconst [0])
  7432  	for {
  7433  		rc := auxIntToInt64(v.AuxInt)
  7434  		if v_0.Op != OpLOONG64MOVBUreg {
  7435  			break
  7436  		}
  7437  		if !(rc >= 8) {
  7438  			break
  7439  		}
  7440  		v.reset(OpLOONG64MOVVconst)
  7441  		v.AuxInt = int64ToAuxInt(0)
  7442  		return true
  7443  	}
  7444  	// match: (SRLVconst [c] (MOVVconst [d]))
  7445  	// result: (MOVVconst [int64(uint64(d)>>uint64(c))])
  7446  	for {
  7447  		c := auxIntToInt64(v.AuxInt)
  7448  		if v_0.Op != OpLOONG64MOVVconst {
  7449  			break
  7450  		}
  7451  		d := auxIntToInt64(v_0.AuxInt)
  7452  		v.reset(OpLOONG64MOVVconst)
  7453  		v.AuxInt = int64ToAuxInt(int64(uint64(d) >> uint64(c)))
  7454  		return true
  7455  	}
  7456  	return false
  7457  }
  7458  func rewriteValueLOONG64_OpLOONG64SUBD(v *Value) bool {
  7459  	v_1 := v.Args[1]
  7460  	v_0 := v.Args[0]
  7461  	// match: (SUBD (MULD x y) z)
  7462  	// cond: z.Block.Func.useFMA(v)
  7463  	// result: (FMSUBD x y z)
  7464  	for {
  7465  		if v_0.Op != OpLOONG64MULD {
  7466  			break
  7467  		}
  7468  		y := v_0.Args[1]
  7469  		x := v_0.Args[0]
  7470  		z := v_1
  7471  		if !(z.Block.Func.useFMA(v)) {
  7472  			break
  7473  		}
  7474  		v.reset(OpLOONG64FMSUBD)
  7475  		v.AddArg3(x, y, z)
  7476  		return true
  7477  	}
  7478  	// match: (SUBD z (MULD x y))
  7479  	// cond: z.Block.Func.useFMA(v)
  7480  	// result: (FNMSUBD x y z)
  7481  	for {
  7482  		z := v_0
  7483  		if v_1.Op != OpLOONG64MULD {
  7484  			break
  7485  		}
  7486  		y := v_1.Args[1]
  7487  		x := v_1.Args[0]
  7488  		if !(z.Block.Func.useFMA(v)) {
  7489  			break
  7490  		}
  7491  		v.reset(OpLOONG64FNMSUBD)
  7492  		v.AddArg3(x, y, z)
  7493  		return true
  7494  	}
  7495  	// match: (SUBD z (NEGD (MULD x y)))
  7496  	// cond: z.Block.Func.useFMA(v)
  7497  	// result: (FMADDD x y z)
  7498  	for {
  7499  		z := v_0
  7500  		if v_1.Op != OpLOONG64NEGD {
  7501  			break
  7502  		}
  7503  		v_1_0 := v_1.Args[0]
  7504  		if v_1_0.Op != OpLOONG64MULD {
  7505  			break
  7506  		}
  7507  		y := v_1_0.Args[1]
  7508  		x := v_1_0.Args[0]
  7509  		if !(z.Block.Func.useFMA(v)) {
  7510  			break
  7511  		}
  7512  		v.reset(OpLOONG64FMADDD)
  7513  		v.AddArg3(x, y, z)
  7514  		return true
  7515  	}
  7516  	// match: (SUBD (NEGD (MULD x y)) z)
  7517  	// cond: z.Block.Func.useFMA(v)
  7518  	// result: (FNMADDD x y z)
  7519  	for {
  7520  		if v_0.Op != OpLOONG64NEGD {
  7521  			break
  7522  		}
  7523  		v_0_0 := v_0.Args[0]
  7524  		if v_0_0.Op != OpLOONG64MULD {
  7525  			break
  7526  		}
  7527  		y := v_0_0.Args[1]
  7528  		x := v_0_0.Args[0]
  7529  		z := v_1
  7530  		if !(z.Block.Func.useFMA(v)) {
  7531  			break
  7532  		}
  7533  		v.reset(OpLOONG64FNMADDD)
  7534  		v.AddArg3(x, y, z)
  7535  		return true
  7536  	}
  7537  	return false
  7538  }
  7539  func rewriteValueLOONG64_OpLOONG64SUBF(v *Value) bool {
  7540  	v_1 := v.Args[1]
  7541  	v_0 := v.Args[0]
  7542  	// match: (SUBF (MULF x y) z)
  7543  	// cond: z.Block.Func.useFMA(v)
  7544  	// result: (FMSUBF x y z)
  7545  	for {
  7546  		if v_0.Op != OpLOONG64MULF {
  7547  			break
  7548  		}
  7549  		y := v_0.Args[1]
  7550  		x := v_0.Args[0]
  7551  		z := v_1
  7552  		if !(z.Block.Func.useFMA(v)) {
  7553  			break
  7554  		}
  7555  		v.reset(OpLOONG64FMSUBF)
  7556  		v.AddArg3(x, y, z)
  7557  		return true
  7558  	}
  7559  	// match: (SUBF z (MULF x y))
  7560  	// cond: z.Block.Func.useFMA(v)
  7561  	// result: (FNMSUBF x y z)
  7562  	for {
  7563  		z := v_0
  7564  		if v_1.Op != OpLOONG64MULF {
  7565  			break
  7566  		}
  7567  		y := v_1.Args[1]
  7568  		x := v_1.Args[0]
  7569  		if !(z.Block.Func.useFMA(v)) {
  7570  			break
  7571  		}
  7572  		v.reset(OpLOONG64FNMSUBF)
  7573  		v.AddArg3(x, y, z)
  7574  		return true
  7575  	}
  7576  	// match: (SUBF z (NEGF (MULF x y)))
  7577  	// cond: z.Block.Func.useFMA(v)
  7578  	// result: (FMADDF x y z)
  7579  	for {
  7580  		z := v_0
  7581  		if v_1.Op != OpLOONG64NEGF {
  7582  			break
  7583  		}
  7584  		v_1_0 := v_1.Args[0]
  7585  		if v_1_0.Op != OpLOONG64MULF {
  7586  			break
  7587  		}
  7588  		y := v_1_0.Args[1]
  7589  		x := v_1_0.Args[0]
  7590  		if !(z.Block.Func.useFMA(v)) {
  7591  			break
  7592  		}
  7593  		v.reset(OpLOONG64FMADDF)
  7594  		v.AddArg3(x, y, z)
  7595  		return true
  7596  	}
  7597  	// match: (SUBF (NEGF (MULF x y)) z)
  7598  	// cond: z.Block.Func.useFMA(v)
  7599  	// result: (FNMADDF x y z)
  7600  	for {
  7601  		if v_0.Op != OpLOONG64NEGF {
  7602  			break
  7603  		}
  7604  		v_0_0 := v_0.Args[0]
  7605  		if v_0_0.Op != OpLOONG64MULF {
  7606  			break
  7607  		}
  7608  		y := v_0_0.Args[1]
  7609  		x := v_0_0.Args[0]
  7610  		z := v_1
  7611  		if !(z.Block.Func.useFMA(v)) {
  7612  			break
  7613  		}
  7614  		v.reset(OpLOONG64FNMADDF)
  7615  		v.AddArg3(x, y, z)
  7616  		return true
  7617  	}
  7618  	return false
  7619  }
  7620  func rewriteValueLOONG64_OpLOONG64SUBV(v *Value) bool {
  7621  	v_1 := v.Args[1]
  7622  	v_0 := v.Args[0]
  7623  	// match: (SUBV x (MOVVconst [c]))
  7624  	// cond: is32Bit(c)
  7625  	// result: (SUBVconst [c] x)
  7626  	for {
  7627  		x := v_0
  7628  		if v_1.Op != OpLOONG64MOVVconst {
  7629  			break
  7630  		}
  7631  		c := auxIntToInt64(v_1.AuxInt)
  7632  		if !(is32Bit(c)) {
  7633  			break
  7634  		}
  7635  		v.reset(OpLOONG64SUBVconst)
  7636  		v.AuxInt = int64ToAuxInt(c)
  7637  		v.AddArg(x)
  7638  		return true
  7639  	}
  7640  	// match: (SUBV x (NEGV y))
  7641  	// result: (ADDV x y)
  7642  	for {
  7643  		x := v_0
  7644  		if v_1.Op != OpLOONG64NEGV {
  7645  			break
  7646  		}
  7647  		y := v_1.Args[0]
  7648  		v.reset(OpLOONG64ADDV)
  7649  		v.AddArg2(x, y)
  7650  		return true
  7651  	}
  7652  	// match: (SUBV x x)
  7653  	// result: (MOVVconst [0])
  7654  	for {
  7655  		x := v_0
  7656  		if x != v_1 {
  7657  			break
  7658  		}
  7659  		v.reset(OpLOONG64MOVVconst)
  7660  		v.AuxInt = int64ToAuxInt(0)
  7661  		return true
  7662  	}
  7663  	// match: (SUBV (MOVVconst [0]) x)
  7664  	// result: (NEGV x)
  7665  	for {
  7666  		if v_0.Op != OpLOONG64MOVVconst || auxIntToInt64(v_0.AuxInt) != 0 {
  7667  			break
  7668  		}
  7669  		x := v_1
  7670  		v.reset(OpLOONG64NEGV)
  7671  		v.AddArg(x)
  7672  		return true
  7673  	}
  7674  	// match: (SUBV (MOVVconst [c]) (NEGV (SUBVconst [d] x)))
  7675  	// result: (ADDVconst [c-d] x)
  7676  	for {
  7677  		if v_0.Op != OpLOONG64MOVVconst {
  7678  			break
  7679  		}
  7680  		c := auxIntToInt64(v_0.AuxInt)
  7681  		if v_1.Op != OpLOONG64NEGV {
  7682  			break
  7683  		}
  7684  		v_1_0 := v_1.Args[0]
  7685  		if v_1_0.Op != OpLOONG64SUBVconst {
  7686  			break
  7687  		}
  7688  		d := auxIntToInt64(v_1_0.AuxInt)
  7689  		x := v_1_0.Args[0]
  7690  		v.reset(OpLOONG64ADDVconst)
  7691  		v.AuxInt = int64ToAuxInt(c - d)
  7692  		v.AddArg(x)
  7693  		return true
  7694  	}
  7695  	return false
  7696  }
  7697  func rewriteValueLOONG64_OpLOONG64SUBVconst(v *Value) bool {
  7698  	v_0 := v.Args[0]
  7699  	// match: (SUBVconst [0] x)
  7700  	// result: x
  7701  	for {
  7702  		if auxIntToInt64(v.AuxInt) != 0 {
  7703  			break
  7704  		}
  7705  		x := v_0
  7706  		v.copyOf(x)
  7707  		return true
  7708  	}
  7709  	// match: (SUBVconst [c] (MOVVconst [d]))
  7710  	// result: (MOVVconst [d-c])
  7711  	for {
  7712  		c := auxIntToInt64(v.AuxInt)
  7713  		if v_0.Op != OpLOONG64MOVVconst {
  7714  			break
  7715  		}
  7716  		d := auxIntToInt64(v_0.AuxInt)
  7717  		v.reset(OpLOONG64MOVVconst)
  7718  		v.AuxInt = int64ToAuxInt(d - c)
  7719  		return true
  7720  	}
  7721  	// match: (SUBVconst [c] (SUBVconst [d] x))
  7722  	// cond: is32Bit(-c-d)
  7723  	// result: (ADDVconst [-c-d] x)
  7724  	for {
  7725  		c := auxIntToInt64(v.AuxInt)
  7726  		if v_0.Op != OpLOONG64SUBVconst {
  7727  			break
  7728  		}
  7729  		d := auxIntToInt64(v_0.AuxInt)
  7730  		x := v_0.Args[0]
  7731  		if !(is32Bit(-c - d)) {
  7732  			break
  7733  		}
  7734  		v.reset(OpLOONG64ADDVconst)
  7735  		v.AuxInt = int64ToAuxInt(-c - d)
  7736  		v.AddArg(x)
  7737  		return true
  7738  	}
  7739  	// match: (SUBVconst [c] (ADDVconst [d] x))
  7740  	// cond: is32Bit(-c+d)
  7741  	// result: (ADDVconst [-c+d] x)
  7742  	for {
  7743  		c := auxIntToInt64(v.AuxInt)
  7744  		if v_0.Op != OpLOONG64ADDVconst {
  7745  			break
  7746  		}
  7747  		d := auxIntToInt64(v_0.AuxInt)
  7748  		x := v_0.Args[0]
  7749  		if !(is32Bit(-c + d)) {
  7750  			break
  7751  		}
  7752  		v.reset(OpLOONG64ADDVconst)
  7753  		v.AuxInt = int64ToAuxInt(-c + d)
  7754  		v.AddArg(x)
  7755  		return true
  7756  	}
  7757  	return false
  7758  }
  7759  func rewriteValueLOONG64_OpLOONG64XOR(v *Value) bool {
  7760  	v_1 := v.Args[1]
  7761  	v_0 := v.Args[0]
  7762  	b := v.Block
  7763  	typ := &b.Func.Config.Types
  7764  	// match: (XOR <typ.UInt16> (SRLVconst [8] <typ.UInt16> x) (SLLVconst [8] <typ.UInt16> x))
  7765  	// result: (REVB2H x)
  7766  	for {
  7767  		if v.Type != typ.UInt16 {
  7768  			break
  7769  		}
  7770  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
  7771  			if v_0.Op != OpLOONG64SRLVconst || v_0.Type != typ.UInt16 || auxIntToInt64(v_0.AuxInt) != 8 {
  7772  				continue
  7773  			}
  7774  			x := v_0.Args[0]
  7775  			if v_1.Op != OpLOONG64SLLVconst || v_1.Type != typ.UInt16 || auxIntToInt64(v_1.AuxInt) != 8 || x != v_1.Args[0] {
  7776  				continue
  7777  			}
  7778  			v.reset(OpLOONG64REVB2H)
  7779  			v.AddArg(x)
  7780  			return true
  7781  		}
  7782  		break
  7783  	}
  7784  	// match: (XOR (SRLconst [8] (ANDconst [c1] x)) (SLLconst [8] (ANDconst [c2] x)))
  7785  	// cond: uint32(c1) == 0xff00ff00 && uint32(c2) == 0x00ff00ff
  7786  	// result: (REVB2H x)
  7787  	for {
  7788  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
  7789  			if v_0.Op != OpLOONG64SRLconst || auxIntToInt64(v_0.AuxInt) != 8 {
  7790  				continue
  7791  			}
  7792  			v_0_0 := v_0.Args[0]
  7793  			if v_0_0.Op != OpLOONG64ANDconst {
  7794  				continue
  7795  			}
  7796  			c1 := auxIntToInt64(v_0_0.AuxInt)
  7797  			x := v_0_0.Args[0]
  7798  			if v_1.Op != OpLOONG64SLLconst || auxIntToInt64(v_1.AuxInt) != 8 {
  7799  				continue
  7800  			}
  7801  			v_1_0 := v_1.Args[0]
  7802  			if v_1_0.Op != OpLOONG64ANDconst {
  7803  				continue
  7804  			}
  7805  			c2 := auxIntToInt64(v_1_0.AuxInt)
  7806  			if x != v_1_0.Args[0] || !(uint32(c1) == 0xff00ff00 && uint32(c2) == 0x00ff00ff) {
  7807  				continue
  7808  			}
  7809  			v.reset(OpLOONG64REVB2H)
  7810  			v.AddArg(x)
  7811  			return true
  7812  		}
  7813  		break
  7814  	}
  7815  	// match: (XOR (SRLVconst [8] (AND (MOVVconst [c1]) x)) (SLLVconst [8] (AND (MOVVconst [c2]) x)))
  7816  	// cond: uint64(c1) == 0xff00ff00ff00ff00 && uint64(c2) == 0x00ff00ff00ff00ff
  7817  	// result: (REVB4H x)
  7818  	for {
  7819  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
  7820  			if v_0.Op != OpLOONG64SRLVconst || auxIntToInt64(v_0.AuxInt) != 8 {
  7821  				continue
  7822  			}
  7823  			v_0_0 := v_0.Args[0]
  7824  			if v_0_0.Op != OpLOONG64AND {
  7825  				continue
  7826  			}
  7827  			_ = v_0_0.Args[1]
  7828  			v_0_0_0 := v_0_0.Args[0]
  7829  			v_0_0_1 := v_0_0.Args[1]
  7830  			for _i1 := 0; _i1 <= 1; _i1, v_0_0_0, v_0_0_1 = _i1+1, v_0_0_1, v_0_0_0 {
  7831  				if v_0_0_0.Op != OpLOONG64MOVVconst {
  7832  					continue
  7833  				}
  7834  				c1 := auxIntToInt64(v_0_0_0.AuxInt)
  7835  				x := v_0_0_1
  7836  				if v_1.Op != OpLOONG64SLLVconst || auxIntToInt64(v_1.AuxInt) != 8 {
  7837  					continue
  7838  				}
  7839  				v_1_0 := v_1.Args[0]
  7840  				if v_1_0.Op != OpLOONG64AND {
  7841  					continue
  7842  				}
  7843  				_ = v_1_0.Args[1]
  7844  				v_1_0_0 := v_1_0.Args[0]
  7845  				v_1_0_1 := v_1_0.Args[1]
  7846  				for _i2 := 0; _i2 <= 1; _i2, v_1_0_0, v_1_0_1 = _i2+1, v_1_0_1, v_1_0_0 {
  7847  					if v_1_0_0.Op != OpLOONG64MOVVconst {
  7848  						continue
  7849  					}
  7850  					c2 := auxIntToInt64(v_1_0_0.AuxInt)
  7851  					if x != v_1_0_1 || !(uint64(c1) == 0xff00ff00ff00ff00 && uint64(c2) == 0x00ff00ff00ff00ff) {
  7852  						continue
  7853  					}
  7854  					v.reset(OpLOONG64REVB4H)
  7855  					v.AddArg(x)
  7856  					return true
  7857  				}
  7858  			}
  7859  		}
  7860  		break
  7861  	}
  7862  	// match: (XOR (SRLVconst [8] (AND (MOVVconst [c1]) x)) (SLLVconst [8] (ANDconst [c2] x)))
  7863  	// cond: uint64(c1) == 0xff00ff00 && uint64(c2) == 0x00ff00ff
  7864  	// result: (REVB4H (ANDconst <x.Type> [0xffffffff] x))
  7865  	for {
  7866  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
  7867  			if v_0.Op != OpLOONG64SRLVconst || auxIntToInt64(v_0.AuxInt) != 8 {
  7868  				continue
  7869  			}
  7870  			v_0_0 := v_0.Args[0]
  7871  			if v_0_0.Op != OpLOONG64AND {
  7872  				continue
  7873  			}
  7874  			_ = v_0_0.Args[1]
  7875  			v_0_0_0 := v_0_0.Args[0]
  7876  			v_0_0_1 := v_0_0.Args[1]
  7877  			for _i1 := 0; _i1 <= 1; _i1, v_0_0_0, v_0_0_1 = _i1+1, v_0_0_1, v_0_0_0 {
  7878  				if v_0_0_0.Op != OpLOONG64MOVVconst {
  7879  					continue
  7880  				}
  7881  				c1 := auxIntToInt64(v_0_0_0.AuxInt)
  7882  				x := v_0_0_1
  7883  				if v_1.Op != OpLOONG64SLLVconst || auxIntToInt64(v_1.AuxInt) != 8 {
  7884  					continue
  7885  				}
  7886  				v_1_0 := v_1.Args[0]
  7887  				if v_1_0.Op != OpLOONG64ANDconst {
  7888  					continue
  7889  				}
  7890  				c2 := auxIntToInt64(v_1_0.AuxInt)
  7891  				if x != v_1_0.Args[0] || !(uint64(c1) == 0xff00ff00 && uint64(c2) == 0x00ff00ff) {
  7892  					continue
  7893  				}
  7894  				v.reset(OpLOONG64REVB4H)
  7895  				v0 := b.NewValue0(v.Pos, OpLOONG64ANDconst, x.Type)
  7896  				v0.AuxInt = int64ToAuxInt(0xffffffff)
  7897  				v0.AddArg(x)
  7898  				v.AddArg(v0)
  7899  				return true
  7900  			}
  7901  		}
  7902  		break
  7903  	}
  7904  	// match: (XOR x (MOVVconst [c]))
  7905  	// cond: is32Bit(c)
  7906  	// result: (XORconst [c] x)
  7907  	for {
  7908  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
  7909  			x := v_0
  7910  			if v_1.Op != OpLOONG64MOVVconst {
  7911  				continue
  7912  			}
  7913  			c := auxIntToInt64(v_1.AuxInt)
  7914  			if !(is32Bit(c)) {
  7915  				continue
  7916  			}
  7917  			v.reset(OpLOONG64XORconst)
  7918  			v.AuxInt = int64ToAuxInt(c)
  7919  			v.AddArg(x)
  7920  			return true
  7921  		}
  7922  		break
  7923  	}
  7924  	// match: (XOR x x)
  7925  	// result: (MOVVconst [0])
  7926  	for {
  7927  		x := v_0
  7928  		if x != v_1 {
  7929  			break
  7930  		}
  7931  		v.reset(OpLOONG64MOVVconst)
  7932  		v.AuxInt = int64ToAuxInt(0)
  7933  		return true
  7934  	}
  7935  	return false
  7936  }
  7937  func rewriteValueLOONG64_OpLOONG64XORconst(v *Value) bool {
  7938  	v_0 := v.Args[0]
  7939  	// match: (XORconst [0] x)
  7940  	// result: x
  7941  	for {
  7942  		if auxIntToInt64(v.AuxInt) != 0 {
  7943  			break
  7944  		}
  7945  		x := v_0
  7946  		v.copyOf(x)
  7947  		return true
  7948  	}
  7949  	// match: (XORconst [-1] x)
  7950  	// result: (NORconst [0] x)
  7951  	for {
  7952  		if auxIntToInt64(v.AuxInt) != -1 {
  7953  			break
  7954  		}
  7955  		x := v_0
  7956  		v.reset(OpLOONG64NORconst)
  7957  		v.AuxInt = int64ToAuxInt(0)
  7958  		v.AddArg(x)
  7959  		return true
  7960  	}
  7961  	// match: (XORconst [c] (MOVVconst [d]))
  7962  	// result: (MOVVconst [c^d])
  7963  	for {
  7964  		c := auxIntToInt64(v.AuxInt)
  7965  		if v_0.Op != OpLOONG64MOVVconst {
  7966  			break
  7967  		}
  7968  		d := auxIntToInt64(v_0.AuxInt)
  7969  		v.reset(OpLOONG64MOVVconst)
  7970  		v.AuxInt = int64ToAuxInt(c ^ d)
  7971  		return true
  7972  	}
  7973  	// match: (XORconst [c] (XORconst [d] x))
  7974  	// cond: is32Bit(c^d)
  7975  	// result: (XORconst [c^d] x)
  7976  	for {
  7977  		c := auxIntToInt64(v.AuxInt)
  7978  		if v_0.Op != OpLOONG64XORconst {
  7979  			break
  7980  		}
  7981  		d := auxIntToInt64(v_0.AuxInt)
  7982  		x := v_0.Args[0]
  7983  		if !(is32Bit(c ^ d)) {
  7984  			break
  7985  		}
  7986  		v.reset(OpLOONG64XORconst)
  7987  		v.AuxInt = int64ToAuxInt(c ^ d)
  7988  		v.AddArg(x)
  7989  		return true
  7990  	}
  7991  	return false
  7992  }
  7993  func rewriteValueLOONG64_OpLeq16(v *Value) bool {
  7994  	v_1 := v.Args[1]
  7995  	v_0 := v.Args[0]
  7996  	b := v.Block
  7997  	typ := &b.Func.Config.Types
  7998  	// match: (Leq16 x y)
  7999  	// result: (XOR (MOVVconst [1]) (SGT (SignExt16to64 x) (SignExt16to64 y)))
  8000  	for {
  8001  		x := v_0
  8002  		y := v_1
  8003  		v.reset(OpLOONG64XOR)
  8004  		v0 := b.NewValue0(v.Pos, OpLOONG64MOVVconst, typ.UInt64)
  8005  		v0.AuxInt = int64ToAuxInt(1)
  8006  		v1 := b.NewValue0(v.Pos, OpLOONG64SGT, typ.Bool)
  8007  		v2 := b.NewValue0(v.Pos, OpSignExt16to64, typ.Int64)
  8008  		v2.AddArg(x)
  8009  		v3 := b.NewValue0(v.Pos, OpSignExt16to64, typ.Int64)
  8010  		v3.AddArg(y)
  8011  		v1.AddArg2(v2, v3)
  8012  		v.AddArg2(v0, v1)
  8013  		return true
  8014  	}
  8015  }
  8016  func rewriteValueLOONG64_OpLeq16U(v *Value) bool {
  8017  	v_1 := v.Args[1]
  8018  	v_0 := v.Args[0]
  8019  	b := v.Block
  8020  	typ := &b.Func.Config.Types
  8021  	// match: (Leq16U x y)
  8022  	// result: (XOR (MOVVconst [1]) (SGTU (ZeroExt16to64 x) (ZeroExt16to64 y)))
  8023  	for {
  8024  		x := v_0
  8025  		y := v_1
  8026  		v.reset(OpLOONG64XOR)
  8027  		v0 := b.NewValue0(v.Pos, OpLOONG64MOVVconst, typ.UInt64)
  8028  		v0.AuxInt = int64ToAuxInt(1)
  8029  		v1 := b.NewValue0(v.Pos, OpLOONG64SGTU, typ.Bool)
  8030  		v2 := b.NewValue0(v.Pos, OpZeroExt16to64, typ.UInt64)
  8031  		v2.AddArg(x)
  8032  		v3 := b.NewValue0(v.Pos, OpZeroExt16to64, typ.UInt64)
  8033  		v3.AddArg(y)
  8034  		v1.AddArg2(v2, v3)
  8035  		v.AddArg2(v0, v1)
  8036  		return true
  8037  	}
  8038  }
  8039  func rewriteValueLOONG64_OpLeq32(v *Value) bool {
  8040  	v_1 := v.Args[1]
  8041  	v_0 := v.Args[0]
  8042  	b := v.Block
  8043  	typ := &b.Func.Config.Types
  8044  	// match: (Leq32 x y)
  8045  	// result: (XOR (MOVVconst [1]) (SGT (SignExt32to64 x) (SignExt32to64 y)))
  8046  	for {
  8047  		x := v_0
  8048  		y := v_1
  8049  		v.reset(OpLOONG64XOR)
  8050  		v0 := b.NewValue0(v.Pos, OpLOONG64MOVVconst, typ.UInt64)
  8051  		v0.AuxInt = int64ToAuxInt(1)
  8052  		v1 := b.NewValue0(v.Pos, OpLOONG64SGT, typ.Bool)
  8053  		v2 := b.NewValue0(v.Pos, OpSignExt32to64, typ.Int64)
  8054  		v2.AddArg(x)
  8055  		v3 := b.NewValue0(v.Pos, OpSignExt32to64, typ.Int64)
  8056  		v3.AddArg(y)
  8057  		v1.AddArg2(v2, v3)
  8058  		v.AddArg2(v0, v1)
  8059  		return true
  8060  	}
  8061  }
  8062  func rewriteValueLOONG64_OpLeq32F(v *Value) bool {
  8063  	v_1 := v.Args[1]
  8064  	v_0 := v.Args[0]
  8065  	b := v.Block
  8066  	// match: (Leq32F x y)
  8067  	// result: (FPFlagTrue (CMPGEF y x))
  8068  	for {
  8069  		x := v_0
  8070  		y := v_1
  8071  		v.reset(OpLOONG64FPFlagTrue)
  8072  		v0 := b.NewValue0(v.Pos, OpLOONG64CMPGEF, types.TypeFlags)
  8073  		v0.AddArg2(y, x)
  8074  		v.AddArg(v0)
  8075  		return true
  8076  	}
  8077  }
  8078  func rewriteValueLOONG64_OpLeq32U(v *Value) bool {
  8079  	v_1 := v.Args[1]
  8080  	v_0 := v.Args[0]
  8081  	b := v.Block
  8082  	typ := &b.Func.Config.Types
  8083  	// match: (Leq32U x y)
  8084  	// result: (XOR (MOVVconst [1]) (SGTU (ZeroExt32to64 x) (ZeroExt32to64 y)))
  8085  	for {
  8086  		x := v_0
  8087  		y := v_1
  8088  		v.reset(OpLOONG64XOR)
  8089  		v0 := b.NewValue0(v.Pos, OpLOONG64MOVVconst, typ.UInt64)
  8090  		v0.AuxInt = int64ToAuxInt(1)
  8091  		v1 := b.NewValue0(v.Pos, OpLOONG64SGTU, typ.Bool)
  8092  		v2 := b.NewValue0(v.Pos, OpZeroExt32to64, typ.UInt64)
  8093  		v2.AddArg(x)
  8094  		v3 := b.NewValue0(v.Pos, OpZeroExt32to64, typ.UInt64)
  8095  		v3.AddArg(y)
  8096  		v1.AddArg2(v2, v3)
  8097  		v.AddArg2(v0, v1)
  8098  		return true
  8099  	}
  8100  }
  8101  func rewriteValueLOONG64_OpLeq64(v *Value) bool {
  8102  	v_1 := v.Args[1]
  8103  	v_0 := v.Args[0]
  8104  	b := v.Block
  8105  	typ := &b.Func.Config.Types
  8106  	// match: (Leq64 x y)
  8107  	// result: (XOR (MOVVconst [1]) (SGT x y))
  8108  	for {
  8109  		x := v_0
  8110  		y := v_1
  8111  		v.reset(OpLOONG64XOR)
  8112  		v0 := b.NewValue0(v.Pos, OpLOONG64MOVVconst, typ.UInt64)
  8113  		v0.AuxInt = int64ToAuxInt(1)
  8114  		v1 := b.NewValue0(v.Pos, OpLOONG64SGT, typ.Bool)
  8115  		v1.AddArg2(x, y)
  8116  		v.AddArg2(v0, v1)
  8117  		return true
  8118  	}
  8119  }
  8120  func rewriteValueLOONG64_OpLeq64F(v *Value) bool {
  8121  	v_1 := v.Args[1]
  8122  	v_0 := v.Args[0]
  8123  	b := v.Block
  8124  	// match: (Leq64F x y)
  8125  	// result: (FPFlagTrue (CMPGED y x))
  8126  	for {
  8127  		x := v_0
  8128  		y := v_1
  8129  		v.reset(OpLOONG64FPFlagTrue)
  8130  		v0 := b.NewValue0(v.Pos, OpLOONG64CMPGED, types.TypeFlags)
  8131  		v0.AddArg2(y, x)
  8132  		v.AddArg(v0)
  8133  		return true
  8134  	}
  8135  }
  8136  func rewriteValueLOONG64_OpLeq64U(v *Value) bool {
  8137  	v_1 := v.Args[1]
  8138  	v_0 := v.Args[0]
  8139  	b := v.Block
  8140  	typ := &b.Func.Config.Types
  8141  	// match: (Leq64U x y)
  8142  	// result: (XOR (MOVVconst [1]) (SGTU x y))
  8143  	for {
  8144  		x := v_0
  8145  		y := v_1
  8146  		v.reset(OpLOONG64XOR)
  8147  		v0 := b.NewValue0(v.Pos, OpLOONG64MOVVconst, typ.UInt64)
  8148  		v0.AuxInt = int64ToAuxInt(1)
  8149  		v1 := b.NewValue0(v.Pos, OpLOONG64SGTU, typ.Bool)
  8150  		v1.AddArg2(x, y)
  8151  		v.AddArg2(v0, v1)
  8152  		return true
  8153  	}
  8154  }
  8155  func rewriteValueLOONG64_OpLeq8(v *Value) bool {
  8156  	v_1 := v.Args[1]
  8157  	v_0 := v.Args[0]
  8158  	b := v.Block
  8159  	typ := &b.Func.Config.Types
  8160  	// match: (Leq8 x y)
  8161  	// result: (XOR (MOVVconst [1]) (SGT (SignExt8to64 x) (SignExt8to64 y)))
  8162  	for {
  8163  		x := v_0
  8164  		y := v_1
  8165  		v.reset(OpLOONG64XOR)
  8166  		v0 := b.NewValue0(v.Pos, OpLOONG64MOVVconst, typ.UInt64)
  8167  		v0.AuxInt = int64ToAuxInt(1)
  8168  		v1 := b.NewValue0(v.Pos, OpLOONG64SGT, typ.Bool)
  8169  		v2 := b.NewValue0(v.Pos, OpSignExt8to64, typ.Int64)
  8170  		v2.AddArg(x)
  8171  		v3 := b.NewValue0(v.Pos, OpSignExt8to64, typ.Int64)
  8172  		v3.AddArg(y)
  8173  		v1.AddArg2(v2, v3)
  8174  		v.AddArg2(v0, v1)
  8175  		return true
  8176  	}
  8177  }
  8178  func rewriteValueLOONG64_OpLeq8U(v *Value) bool {
  8179  	v_1 := v.Args[1]
  8180  	v_0 := v.Args[0]
  8181  	b := v.Block
  8182  	typ := &b.Func.Config.Types
  8183  	// match: (Leq8U x y)
  8184  	// result: (XOR (MOVVconst [1]) (SGTU (ZeroExt8to64 x) (ZeroExt8to64 y)))
  8185  	for {
  8186  		x := v_0
  8187  		y := v_1
  8188  		v.reset(OpLOONG64XOR)
  8189  		v0 := b.NewValue0(v.Pos, OpLOONG64MOVVconst, typ.UInt64)
  8190  		v0.AuxInt = int64ToAuxInt(1)
  8191  		v1 := b.NewValue0(v.Pos, OpLOONG64SGTU, typ.Bool)
  8192  		v2 := b.NewValue0(v.Pos, OpZeroExt8to64, typ.UInt64)
  8193  		v2.AddArg(x)
  8194  		v3 := b.NewValue0(v.Pos, OpZeroExt8to64, typ.UInt64)
  8195  		v3.AddArg(y)
  8196  		v1.AddArg2(v2, v3)
  8197  		v.AddArg2(v0, v1)
  8198  		return true
  8199  	}
  8200  }
  8201  func rewriteValueLOONG64_OpLess16(v *Value) bool {
  8202  	v_1 := v.Args[1]
  8203  	v_0 := v.Args[0]
  8204  	b := v.Block
  8205  	typ := &b.Func.Config.Types
  8206  	// match: (Less16 x y)
  8207  	// result: (SGT (SignExt16to64 y) (SignExt16to64 x))
  8208  	for {
  8209  		x := v_0
  8210  		y := v_1
  8211  		v.reset(OpLOONG64SGT)
  8212  		v0 := b.NewValue0(v.Pos, OpSignExt16to64, typ.Int64)
  8213  		v0.AddArg(y)
  8214  		v1 := b.NewValue0(v.Pos, OpSignExt16to64, typ.Int64)
  8215  		v1.AddArg(x)
  8216  		v.AddArg2(v0, v1)
  8217  		return true
  8218  	}
  8219  }
  8220  func rewriteValueLOONG64_OpLess16U(v *Value) bool {
  8221  	v_1 := v.Args[1]
  8222  	v_0 := v.Args[0]
  8223  	b := v.Block
  8224  	typ := &b.Func.Config.Types
  8225  	// match: (Less16U x y)
  8226  	// result: (SGTU (ZeroExt16to64 y) (ZeroExt16to64 x))
  8227  	for {
  8228  		x := v_0
  8229  		y := v_1
  8230  		v.reset(OpLOONG64SGTU)
  8231  		v0 := b.NewValue0(v.Pos, OpZeroExt16to64, typ.UInt64)
  8232  		v0.AddArg(y)
  8233  		v1 := b.NewValue0(v.Pos, OpZeroExt16to64, typ.UInt64)
  8234  		v1.AddArg(x)
  8235  		v.AddArg2(v0, v1)
  8236  		return true
  8237  	}
  8238  }
  8239  func rewriteValueLOONG64_OpLess32(v *Value) bool {
  8240  	v_1 := v.Args[1]
  8241  	v_0 := v.Args[0]
  8242  	b := v.Block
  8243  	typ := &b.Func.Config.Types
  8244  	// match: (Less32 x y)
  8245  	// result: (SGT (SignExt32to64 y) (SignExt32to64 x))
  8246  	for {
  8247  		x := v_0
  8248  		y := v_1
  8249  		v.reset(OpLOONG64SGT)
  8250  		v0 := b.NewValue0(v.Pos, OpSignExt32to64, typ.Int64)
  8251  		v0.AddArg(y)
  8252  		v1 := b.NewValue0(v.Pos, OpSignExt32to64, typ.Int64)
  8253  		v1.AddArg(x)
  8254  		v.AddArg2(v0, v1)
  8255  		return true
  8256  	}
  8257  }
  8258  func rewriteValueLOONG64_OpLess32F(v *Value) bool {
  8259  	v_1 := v.Args[1]
  8260  	v_0 := v.Args[0]
  8261  	b := v.Block
  8262  	// match: (Less32F x y)
  8263  	// result: (FPFlagTrue (CMPGTF y x))
  8264  	for {
  8265  		x := v_0
  8266  		y := v_1
  8267  		v.reset(OpLOONG64FPFlagTrue)
  8268  		v0 := b.NewValue0(v.Pos, OpLOONG64CMPGTF, types.TypeFlags)
  8269  		v0.AddArg2(y, x)
  8270  		v.AddArg(v0)
  8271  		return true
  8272  	}
  8273  }
  8274  func rewriteValueLOONG64_OpLess32U(v *Value) bool {
  8275  	v_1 := v.Args[1]
  8276  	v_0 := v.Args[0]
  8277  	b := v.Block
  8278  	typ := &b.Func.Config.Types
  8279  	// match: (Less32U x y)
  8280  	// result: (SGTU (ZeroExt32to64 y) (ZeroExt32to64 x))
  8281  	for {
  8282  		x := v_0
  8283  		y := v_1
  8284  		v.reset(OpLOONG64SGTU)
  8285  		v0 := b.NewValue0(v.Pos, OpZeroExt32to64, typ.UInt64)
  8286  		v0.AddArg(y)
  8287  		v1 := b.NewValue0(v.Pos, OpZeroExt32to64, typ.UInt64)
  8288  		v1.AddArg(x)
  8289  		v.AddArg2(v0, v1)
  8290  		return true
  8291  	}
  8292  }
  8293  func rewriteValueLOONG64_OpLess64(v *Value) bool {
  8294  	v_1 := v.Args[1]
  8295  	v_0 := v.Args[0]
  8296  	// match: (Less64 x y)
  8297  	// result: (SGT y x)
  8298  	for {
  8299  		x := v_0
  8300  		y := v_1
  8301  		v.reset(OpLOONG64SGT)
  8302  		v.AddArg2(y, x)
  8303  		return true
  8304  	}
  8305  }
  8306  func rewriteValueLOONG64_OpLess64F(v *Value) bool {
  8307  	v_1 := v.Args[1]
  8308  	v_0 := v.Args[0]
  8309  	b := v.Block
  8310  	// match: (Less64F x y)
  8311  	// result: (FPFlagTrue (CMPGTD y x))
  8312  	for {
  8313  		x := v_0
  8314  		y := v_1
  8315  		v.reset(OpLOONG64FPFlagTrue)
  8316  		v0 := b.NewValue0(v.Pos, OpLOONG64CMPGTD, types.TypeFlags)
  8317  		v0.AddArg2(y, x)
  8318  		v.AddArg(v0)
  8319  		return true
  8320  	}
  8321  }
  8322  func rewriteValueLOONG64_OpLess64U(v *Value) bool {
  8323  	v_1 := v.Args[1]
  8324  	v_0 := v.Args[0]
  8325  	// match: (Less64U x y)
  8326  	// result: (SGTU y x)
  8327  	for {
  8328  		x := v_0
  8329  		y := v_1
  8330  		v.reset(OpLOONG64SGTU)
  8331  		v.AddArg2(y, x)
  8332  		return true
  8333  	}
  8334  }
  8335  func rewriteValueLOONG64_OpLess8(v *Value) bool {
  8336  	v_1 := v.Args[1]
  8337  	v_0 := v.Args[0]
  8338  	b := v.Block
  8339  	typ := &b.Func.Config.Types
  8340  	// match: (Less8 x y)
  8341  	// result: (SGT (SignExt8to64 y) (SignExt8to64 x))
  8342  	for {
  8343  		x := v_0
  8344  		y := v_1
  8345  		v.reset(OpLOONG64SGT)
  8346  		v0 := b.NewValue0(v.Pos, OpSignExt8to64, typ.Int64)
  8347  		v0.AddArg(y)
  8348  		v1 := b.NewValue0(v.Pos, OpSignExt8to64, typ.Int64)
  8349  		v1.AddArg(x)
  8350  		v.AddArg2(v0, v1)
  8351  		return true
  8352  	}
  8353  }
  8354  func rewriteValueLOONG64_OpLess8U(v *Value) bool {
  8355  	v_1 := v.Args[1]
  8356  	v_0 := v.Args[0]
  8357  	b := v.Block
  8358  	typ := &b.Func.Config.Types
  8359  	// match: (Less8U x y)
  8360  	// result: (SGTU (ZeroExt8to64 y) (ZeroExt8to64 x))
  8361  	for {
  8362  		x := v_0
  8363  		y := v_1
  8364  		v.reset(OpLOONG64SGTU)
  8365  		v0 := b.NewValue0(v.Pos, OpZeroExt8to64, typ.UInt64)
  8366  		v0.AddArg(y)
  8367  		v1 := b.NewValue0(v.Pos, OpZeroExt8to64, typ.UInt64)
  8368  		v1.AddArg(x)
  8369  		v.AddArg2(v0, v1)
  8370  		return true
  8371  	}
  8372  }
  8373  func rewriteValueLOONG64_OpLoad(v *Value) bool {
  8374  	v_1 := v.Args[1]
  8375  	v_0 := v.Args[0]
  8376  	// match: (Load <t> ptr mem)
  8377  	// cond: t.IsBoolean()
  8378  	// result: (MOVBUload ptr mem)
  8379  	for {
  8380  		t := v.Type
  8381  		ptr := v_0
  8382  		mem := v_1
  8383  		if !(t.IsBoolean()) {
  8384  			break
  8385  		}
  8386  		v.reset(OpLOONG64MOVBUload)
  8387  		v.AddArg2(ptr, mem)
  8388  		return true
  8389  	}
  8390  	// match: (Load <t> ptr mem)
  8391  	// cond: (is8BitInt(t) && t.IsSigned())
  8392  	// result: (MOVBload ptr mem)
  8393  	for {
  8394  		t := v.Type
  8395  		ptr := v_0
  8396  		mem := v_1
  8397  		if !(is8BitInt(t) && t.IsSigned()) {
  8398  			break
  8399  		}
  8400  		v.reset(OpLOONG64MOVBload)
  8401  		v.AddArg2(ptr, mem)
  8402  		return true
  8403  	}
  8404  	// match: (Load <t> ptr mem)
  8405  	// cond: (is8BitInt(t) && !t.IsSigned())
  8406  	// result: (MOVBUload ptr mem)
  8407  	for {
  8408  		t := v.Type
  8409  		ptr := v_0
  8410  		mem := v_1
  8411  		if !(is8BitInt(t) && !t.IsSigned()) {
  8412  			break
  8413  		}
  8414  		v.reset(OpLOONG64MOVBUload)
  8415  		v.AddArg2(ptr, mem)
  8416  		return true
  8417  	}
  8418  	// match: (Load <t> ptr mem)
  8419  	// cond: (is16BitInt(t) && t.IsSigned())
  8420  	// result: (MOVHload ptr mem)
  8421  	for {
  8422  		t := v.Type
  8423  		ptr := v_0
  8424  		mem := v_1
  8425  		if !(is16BitInt(t) && t.IsSigned()) {
  8426  			break
  8427  		}
  8428  		v.reset(OpLOONG64MOVHload)
  8429  		v.AddArg2(ptr, mem)
  8430  		return true
  8431  	}
  8432  	// match: (Load <t> ptr mem)
  8433  	// cond: (is16BitInt(t) && !t.IsSigned())
  8434  	// result: (MOVHUload ptr mem)
  8435  	for {
  8436  		t := v.Type
  8437  		ptr := v_0
  8438  		mem := v_1
  8439  		if !(is16BitInt(t) && !t.IsSigned()) {
  8440  			break
  8441  		}
  8442  		v.reset(OpLOONG64MOVHUload)
  8443  		v.AddArg2(ptr, mem)
  8444  		return true
  8445  	}
  8446  	// match: (Load <t> ptr mem)
  8447  	// cond: (is32BitInt(t) && t.IsSigned())
  8448  	// result: (MOVWload ptr mem)
  8449  	for {
  8450  		t := v.Type
  8451  		ptr := v_0
  8452  		mem := v_1
  8453  		if !(is32BitInt(t) && t.IsSigned()) {
  8454  			break
  8455  		}
  8456  		v.reset(OpLOONG64MOVWload)
  8457  		v.AddArg2(ptr, mem)
  8458  		return true
  8459  	}
  8460  	// match: (Load <t> ptr mem)
  8461  	// cond: (is32BitInt(t) && !t.IsSigned())
  8462  	// result: (MOVWUload ptr mem)
  8463  	for {
  8464  		t := v.Type
  8465  		ptr := v_0
  8466  		mem := v_1
  8467  		if !(is32BitInt(t) && !t.IsSigned()) {
  8468  			break
  8469  		}
  8470  		v.reset(OpLOONG64MOVWUload)
  8471  		v.AddArg2(ptr, mem)
  8472  		return true
  8473  	}
  8474  	// match: (Load <t> ptr mem)
  8475  	// cond: (is64BitInt(t) || isPtr(t))
  8476  	// result: (MOVVload ptr mem)
  8477  	for {
  8478  		t := v.Type
  8479  		ptr := v_0
  8480  		mem := v_1
  8481  		if !(is64BitInt(t) || isPtr(t)) {
  8482  			break
  8483  		}
  8484  		v.reset(OpLOONG64MOVVload)
  8485  		v.AddArg2(ptr, mem)
  8486  		return true
  8487  	}
  8488  	// match: (Load <t> ptr mem)
  8489  	// cond: is32BitFloat(t)
  8490  	// result: (MOVFload ptr mem)
  8491  	for {
  8492  		t := v.Type
  8493  		ptr := v_0
  8494  		mem := v_1
  8495  		if !(is32BitFloat(t)) {
  8496  			break
  8497  		}
  8498  		v.reset(OpLOONG64MOVFload)
  8499  		v.AddArg2(ptr, mem)
  8500  		return true
  8501  	}
  8502  	// match: (Load <t> ptr mem)
  8503  	// cond: is64BitFloat(t)
  8504  	// result: (MOVDload ptr mem)
  8505  	for {
  8506  		t := v.Type
  8507  		ptr := v_0
  8508  		mem := v_1
  8509  		if !(is64BitFloat(t)) {
  8510  			break
  8511  		}
  8512  		v.reset(OpLOONG64MOVDload)
  8513  		v.AddArg2(ptr, mem)
  8514  		return true
  8515  	}
  8516  	return false
  8517  }
  8518  func rewriteValueLOONG64_OpLocalAddr(v *Value) bool {
  8519  	v_1 := v.Args[1]
  8520  	v_0 := v.Args[0]
  8521  	b := v.Block
  8522  	typ := &b.Func.Config.Types
  8523  	// match: (LocalAddr <t> {sym} base mem)
  8524  	// cond: t.Elem().HasPointers()
  8525  	// result: (MOVVaddr {sym} (SPanchored base mem))
  8526  	for {
  8527  		t := v.Type
  8528  		sym := auxToSym(v.Aux)
  8529  		base := v_0
  8530  		mem := v_1
  8531  		if !(t.Elem().HasPointers()) {
  8532  			break
  8533  		}
  8534  		v.reset(OpLOONG64MOVVaddr)
  8535  		v.Aux = symToAux(sym)
  8536  		v0 := b.NewValue0(v.Pos, OpSPanchored, typ.Uintptr)
  8537  		v0.AddArg2(base, mem)
  8538  		v.AddArg(v0)
  8539  		return true
  8540  	}
  8541  	// match: (LocalAddr <t> {sym} base _)
  8542  	// cond: !t.Elem().HasPointers()
  8543  	// result: (MOVVaddr {sym} base)
  8544  	for {
  8545  		t := v.Type
  8546  		sym := auxToSym(v.Aux)
  8547  		base := v_0
  8548  		if !(!t.Elem().HasPointers()) {
  8549  			break
  8550  		}
  8551  		v.reset(OpLOONG64MOVVaddr)
  8552  		v.Aux = symToAux(sym)
  8553  		v.AddArg(base)
  8554  		return true
  8555  	}
  8556  	return false
  8557  }
  8558  func rewriteValueLOONG64_OpLsh16x16(v *Value) bool {
  8559  	v_1 := v.Args[1]
  8560  	v_0 := v.Args[0]
  8561  	b := v.Block
  8562  	typ := &b.Func.Config.Types
  8563  	// match: (Lsh16x16 x y)
  8564  	// cond: shiftIsBounded(v)
  8565  	// result: (SLLV x y)
  8566  	for {
  8567  		x := v_0
  8568  		y := v_1
  8569  		if !(shiftIsBounded(v)) {
  8570  			break
  8571  		}
  8572  		v.reset(OpLOONG64SLLV)
  8573  		v.AddArg2(x, y)
  8574  		return true
  8575  	}
  8576  	// match: (Lsh16x16 <t> x y)
  8577  	// cond: !shiftIsBounded(v)
  8578  	// result: (MASKEQZ (SLLV <t> x (ZeroExt16to64 y)) (SGTU (MOVVconst <typ.UInt64> [64]) (ZeroExt16to64 y)))
  8579  	for {
  8580  		t := v.Type
  8581  		x := v_0
  8582  		y := v_1
  8583  		if !(!shiftIsBounded(v)) {
  8584  			break
  8585  		}
  8586  		v.reset(OpLOONG64MASKEQZ)
  8587  		v0 := b.NewValue0(v.Pos, OpLOONG64SLLV, t)
  8588  		v1 := b.NewValue0(v.Pos, OpZeroExt16to64, typ.UInt64)
  8589  		v1.AddArg(y)
  8590  		v0.AddArg2(x, v1)
  8591  		v2 := b.NewValue0(v.Pos, OpLOONG64SGTU, typ.Bool)
  8592  		v3 := b.NewValue0(v.Pos, OpLOONG64MOVVconst, typ.UInt64)
  8593  		v3.AuxInt = int64ToAuxInt(64)
  8594  		v2.AddArg2(v3, v1)
  8595  		v.AddArg2(v0, v2)
  8596  		return true
  8597  	}
  8598  	return false
  8599  }
  8600  func rewriteValueLOONG64_OpLsh16x32(v *Value) bool {
  8601  	v_1 := v.Args[1]
  8602  	v_0 := v.Args[0]
  8603  	b := v.Block
  8604  	typ := &b.Func.Config.Types
  8605  	// match: (Lsh16x32 x y)
  8606  	// cond: shiftIsBounded(v)
  8607  	// result: (SLLV x y)
  8608  	for {
  8609  		x := v_0
  8610  		y := v_1
  8611  		if !(shiftIsBounded(v)) {
  8612  			break
  8613  		}
  8614  		v.reset(OpLOONG64SLLV)
  8615  		v.AddArg2(x, y)
  8616  		return true
  8617  	}
  8618  	// match: (Lsh16x32 <t> x y)
  8619  	// cond: !shiftIsBounded(v)
  8620  	// result: (MASKEQZ (SLLV <t> x (ZeroExt32to64 y)) (SGTU (MOVVconst <typ.UInt64> [64]) (ZeroExt32to64 y)))
  8621  	for {
  8622  		t := v.Type
  8623  		x := v_0
  8624  		y := v_1
  8625  		if !(!shiftIsBounded(v)) {
  8626  			break
  8627  		}
  8628  		v.reset(OpLOONG64MASKEQZ)
  8629  		v0 := b.NewValue0(v.Pos, OpLOONG64SLLV, t)
  8630  		v1 := b.NewValue0(v.Pos, OpZeroExt32to64, typ.UInt64)
  8631  		v1.AddArg(y)
  8632  		v0.AddArg2(x, v1)
  8633  		v2 := b.NewValue0(v.Pos, OpLOONG64SGTU, typ.Bool)
  8634  		v3 := b.NewValue0(v.Pos, OpLOONG64MOVVconst, typ.UInt64)
  8635  		v3.AuxInt = int64ToAuxInt(64)
  8636  		v2.AddArg2(v3, v1)
  8637  		v.AddArg2(v0, v2)
  8638  		return true
  8639  	}
  8640  	return false
  8641  }
  8642  func rewriteValueLOONG64_OpLsh16x64(v *Value) bool {
  8643  	v_1 := v.Args[1]
  8644  	v_0 := v.Args[0]
  8645  	b := v.Block
  8646  	typ := &b.Func.Config.Types
  8647  	// match: (Lsh16x64 x y)
  8648  	// cond: shiftIsBounded(v)
  8649  	// result: (SLLV x y)
  8650  	for {
  8651  		x := v_0
  8652  		y := v_1
  8653  		if !(shiftIsBounded(v)) {
  8654  			break
  8655  		}
  8656  		v.reset(OpLOONG64SLLV)
  8657  		v.AddArg2(x, y)
  8658  		return true
  8659  	}
  8660  	// match: (Lsh16x64 <t> x y)
  8661  	// cond: !shiftIsBounded(v)
  8662  	// result: (MASKEQZ (SLLV <t> x y) (SGTU (MOVVconst <typ.UInt64> [64]) y))
  8663  	for {
  8664  		t := v.Type
  8665  		x := v_0
  8666  		y := v_1
  8667  		if !(!shiftIsBounded(v)) {
  8668  			break
  8669  		}
  8670  		v.reset(OpLOONG64MASKEQZ)
  8671  		v0 := b.NewValue0(v.Pos, OpLOONG64SLLV, t)
  8672  		v0.AddArg2(x, y)
  8673  		v1 := b.NewValue0(v.Pos, OpLOONG64SGTU, typ.Bool)
  8674  		v2 := b.NewValue0(v.Pos, OpLOONG64MOVVconst, typ.UInt64)
  8675  		v2.AuxInt = int64ToAuxInt(64)
  8676  		v1.AddArg2(v2, y)
  8677  		v.AddArg2(v0, v1)
  8678  		return true
  8679  	}
  8680  	return false
  8681  }
  8682  func rewriteValueLOONG64_OpLsh16x8(v *Value) bool {
  8683  	v_1 := v.Args[1]
  8684  	v_0 := v.Args[0]
  8685  	b := v.Block
  8686  	typ := &b.Func.Config.Types
  8687  	// match: (Lsh16x8 x y)
  8688  	// cond: shiftIsBounded(v)
  8689  	// result: (SLLV x y)
  8690  	for {
  8691  		x := v_0
  8692  		y := v_1
  8693  		if !(shiftIsBounded(v)) {
  8694  			break
  8695  		}
  8696  		v.reset(OpLOONG64SLLV)
  8697  		v.AddArg2(x, y)
  8698  		return true
  8699  	}
  8700  	// match: (Lsh16x8 <t> x y)
  8701  	// cond: !shiftIsBounded(v)
  8702  	// result: (MASKEQZ (SLLV <t> x (ZeroExt8to64 y)) (SGTU (MOVVconst <typ.UInt64> [64]) (ZeroExt8to64 y)))
  8703  	for {
  8704  		t := v.Type
  8705  		x := v_0
  8706  		y := v_1
  8707  		if !(!shiftIsBounded(v)) {
  8708  			break
  8709  		}
  8710  		v.reset(OpLOONG64MASKEQZ)
  8711  		v0 := b.NewValue0(v.Pos, OpLOONG64SLLV, t)
  8712  		v1 := b.NewValue0(v.Pos, OpZeroExt8to64, typ.UInt64)
  8713  		v1.AddArg(y)
  8714  		v0.AddArg2(x, v1)
  8715  		v2 := b.NewValue0(v.Pos, OpLOONG64SGTU, typ.Bool)
  8716  		v3 := b.NewValue0(v.Pos, OpLOONG64MOVVconst, typ.UInt64)
  8717  		v3.AuxInt = int64ToAuxInt(64)
  8718  		v2.AddArg2(v3, v1)
  8719  		v.AddArg2(v0, v2)
  8720  		return true
  8721  	}
  8722  	return false
  8723  }
  8724  func rewriteValueLOONG64_OpLsh32x16(v *Value) bool {
  8725  	v_1 := v.Args[1]
  8726  	v_0 := v.Args[0]
  8727  	b := v.Block
  8728  	typ := &b.Func.Config.Types
  8729  	// match: (Lsh32x16 x y)
  8730  	// cond: shiftIsBounded(v)
  8731  	// result: (SLL x y)
  8732  	for {
  8733  		x := v_0
  8734  		y := v_1
  8735  		if !(shiftIsBounded(v)) {
  8736  			break
  8737  		}
  8738  		v.reset(OpLOONG64SLL)
  8739  		v.AddArg2(x, y)
  8740  		return true
  8741  	}
  8742  	// match: (Lsh32x16 <t> x y)
  8743  	// cond: !shiftIsBounded(v)
  8744  	// result: (MASKEQZ (SLL <t> x (ZeroExt16to64 y)) (SGTU (MOVVconst <typ.UInt64> [32]) (ZeroExt16to64 y)))
  8745  	for {
  8746  		t := v.Type
  8747  		x := v_0
  8748  		y := v_1
  8749  		if !(!shiftIsBounded(v)) {
  8750  			break
  8751  		}
  8752  		v.reset(OpLOONG64MASKEQZ)
  8753  		v0 := b.NewValue0(v.Pos, OpLOONG64SLL, t)
  8754  		v1 := b.NewValue0(v.Pos, OpZeroExt16to64, typ.UInt64)
  8755  		v1.AddArg(y)
  8756  		v0.AddArg2(x, v1)
  8757  		v2 := b.NewValue0(v.Pos, OpLOONG64SGTU, typ.Bool)
  8758  		v3 := b.NewValue0(v.Pos, OpLOONG64MOVVconst, typ.UInt64)
  8759  		v3.AuxInt = int64ToAuxInt(32)
  8760  		v2.AddArg2(v3, v1)
  8761  		v.AddArg2(v0, v2)
  8762  		return true
  8763  	}
  8764  	return false
  8765  }
  8766  func rewriteValueLOONG64_OpLsh32x32(v *Value) bool {
  8767  	v_1 := v.Args[1]
  8768  	v_0 := v.Args[0]
  8769  	b := v.Block
  8770  	typ := &b.Func.Config.Types
  8771  	// match: (Lsh32x32 x y)
  8772  	// cond: shiftIsBounded(v)
  8773  	// result: (SLL x y)
  8774  	for {
  8775  		x := v_0
  8776  		y := v_1
  8777  		if !(shiftIsBounded(v)) {
  8778  			break
  8779  		}
  8780  		v.reset(OpLOONG64SLL)
  8781  		v.AddArg2(x, y)
  8782  		return true
  8783  	}
  8784  	// match: (Lsh32x32 <t> x y)
  8785  	// cond: !shiftIsBounded(v)
  8786  	// result: (MASKEQZ (SLL <t> x (ZeroExt32to64 y)) (SGTU (MOVVconst <typ.UInt64> [32]) (ZeroExt32to64 y)))
  8787  	for {
  8788  		t := v.Type
  8789  		x := v_0
  8790  		y := v_1
  8791  		if !(!shiftIsBounded(v)) {
  8792  			break
  8793  		}
  8794  		v.reset(OpLOONG64MASKEQZ)
  8795  		v0 := b.NewValue0(v.Pos, OpLOONG64SLL, t)
  8796  		v1 := b.NewValue0(v.Pos, OpZeroExt32to64, typ.UInt64)
  8797  		v1.AddArg(y)
  8798  		v0.AddArg2(x, v1)
  8799  		v2 := b.NewValue0(v.Pos, OpLOONG64SGTU, typ.Bool)
  8800  		v3 := b.NewValue0(v.Pos, OpLOONG64MOVVconst, typ.UInt64)
  8801  		v3.AuxInt = int64ToAuxInt(32)
  8802  		v2.AddArg2(v3, v1)
  8803  		v.AddArg2(v0, v2)
  8804  		return true
  8805  	}
  8806  	return false
  8807  }
  8808  func rewriteValueLOONG64_OpLsh32x64(v *Value) bool {
  8809  	v_1 := v.Args[1]
  8810  	v_0 := v.Args[0]
  8811  	b := v.Block
  8812  	typ := &b.Func.Config.Types
  8813  	// match: (Lsh32x64 x y)
  8814  	// cond: shiftIsBounded(v)
  8815  	// result: (SLL x y)
  8816  	for {
  8817  		x := v_0
  8818  		y := v_1
  8819  		if !(shiftIsBounded(v)) {
  8820  			break
  8821  		}
  8822  		v.reset(OpLOONG64SLL)
  8823  		v.AddArg2(x, y)
  8824  		return true
  8825  	}
  8826  	// match: (Lsh32x64 <t> x y)
  8827  	// cond: !shiftIsBounded(v)
  8828  	// result: (MASKEQZ (SLL <t> x y) (SGTU (MOVVconst <typ.UInt64> [32]) y))
  8829  	for {
  8830  		t := v.Type
  8831  		x := v_0
  8832  		y := v_1
  8833  		if !(!shiftIsBounded(v)) {
  8834  			break
  8835  		}
  8836  		v.reset(OpLOONG64MASKEQZ)
  8837  		v0 := b.NewValue0(v.Pos, OpLOONG64SLL, t)
  8838  		v0.AddArg2(x, y)
  8839  		v1 := b.NewValue0(v.Pos, OpLOONG64SGTU, typ.Bool)
  8840  		v2 := b.NewValue0(v.Pos, OpLOONG64MOVVconst, typ.UInt64)
  8841  		v2.AuxInt = int64ToAuxInt(32)
  8842  		v1.AddArg2(v2, y)
  8843  		v.AddArg2(v0, v1)
  8844  		return true
  8845  	}
  8846  	return false
  8847  }
  8848  func rewriteValueLOONG64_OpLsh32x8(v *Value) bool {
  8849  	v_1 := v.Args[1]
  8850  	v_0 := v.Args[0]
  8851  	b := v.Block
  8852  	typ := &b.Func.Config.Types
  8853  	// match: (Lsh32x8 x y)
  8854  	// cond: shiftIsBounded(v)
  8855  	// result: (SLL x y)
  8856  	for {
  8857  		x := v_0
  8858  		y := v_1
  8859  		if !(shiftIsBounded(v)) {
  8860  			break
  8861  		}
  8862  		v.reset(OpLOONG64SLL)
  8863  		v.AddArg2(x, y)
  8864  		return true
  8865  	}
  8866  	// match: (Lsh32x8 <t> x y)
  8867  	// cond: !shiftIsBounded(v)
  8868  	// result: (MASKEQZ (SLL <t> x (ZeroExt8to64 y)) (SGTU (MOVVconst <typ.UInt64> [32]) (ZeroExt8to64 y)))
  8869  	for {
  8870  		t := v.Type
  8871  		x := v_0
  8872  		y := v_1
  8873  		if !(!shiftIsBounded(v)) {
  8874  			break
  8875  		}
  8876  		v.reset(OpLOONG64MASKEQZ)
  8877  		v0 := b.NewValue0(v.Pos, OpLOONG64SLL, t)
  8878  		v1 := b.NewValue0(v.Pos, OpZeroExt8to64, typ.UInt64)
  8879  		v1.AddArg(y)
  8880  		v0.AddArg2(x, v1)
  8881  		v2 := b.NewValue0(v.Pos, OpLOONG64SGTU, typ.Bool)
  8882  		v3 := b.NewValue0(v.Pos, OpLOONG64MOVVconst, typ.UInt64)
  8883  		v3.AuxInt = int64ToAuxInt(32)
  8884  		v2.AddArg2(v3, v1)
  8885  		v.AddArg2(v0, v2)
  8886  		return true
  8887  	}
  8888  	return false
  8889  }
  8890  func rewriteValueLOONG64_OpLsh64x16(v *Value) bool {
  8891  	v_1 := v.Args[1]
  8892  	v_0 := v.Args[0]
  8893  	b := v.Block
  8894  	typ := &b.Func.Config.Types
  8895  	// match: (Lsh64x16 x y)
  8896  	// cond: shiftIsBounded(v)
  8897  	// result: (SLLV x y)
  8898  	for {
  8899  		x := v_0
  8900  		y := v_1
  8901  		if !(shiftIsBounded(v)) {
  8902  			break
  8903  		}
  8904  		v.reset(OpLOONG64SLLV)
  8905  		v.AddArg2(x, y)
  8906  		return true
  8907  	}
  8908  	// match: (Lsh64x16 <t> x y)
  8909  	// cond: !shiftIsBounded(v)
  8910  	// result: (MASKEQZ (SLLV <t> x (ZeroExt16to64 y)) (SGTU (MOVVconst <typ.UInt64> [64]) (ZeroExt16to64 y)))
  8911  	for {
  8912  		t := v.Type
  8913  		x := v_0
  8914  		y := v_1
  8915  		if !(!shiftIsBounded(v)) {
  8916  			break
  8917  		}
  8918  		v.reset(OpLOONG64MASKEQZ)
  8919  		v0 := b.NewValue0(v.Pos, OpLOONG64SLLV, t)
  8920  		v1 := b.NewValue0(v.Pos, OpZeroExt16to64, typ.UInt64)
  8921  		v1.AddArg(y)
  8922  		v0.AddArg2(x, v1)
  8923  		v2 := b.NewValue0(v.Pos, OpLOONG64SGTU, typ.Bool)
  8924  		v3 := b.NewValue0(v.Pos, OpLOONG64MOVVconst, typ.UInt64)
  8925  		v3.AuxInt = int64ToAuxInt(64)
  8926  		v2.AddArg2(v3, v1)
  8927  		v.AddArg2(v0, v2)
  8928  		return true
  8929  	}
  8930  	return false
  8931  }
  8932  func rewriteValueLOONG64_OpLsh64x32(v *Value) bool {
  8933  	v_1 := v.Args[1]
  8934  	v_0 := v.Args[0]
  8935  	b := v.Block
  8936  	typ := &b.Func.Config.Types
  8937  	// match: (Lsh64x32 x y)
  8938  	// cond: shiftIsBounded(v)
  8939  	// result: (SLLV x y)
  8940  	for {
  8941  		x := v_0
  8942  		y := v_1
  8943  		if !(shiftIsBounded(v)) {
  8944  			break
  8945  		}
  8946  		v.reset(OpLOONG64SLLV)
  8947  		v.AddArg2(x, y)
  8948  		return true
  8949  	}
  8950  	// match: (Lsh64x32 <t> x y)
  8951  	// cond: !shiftIsBounded(v)
  8952  	// result: (MASKEQZ (SLLV <t> x (ZeroExt32to64 y)) (SGTU (MOVVconst <typ.UInt64> [64]) (ZeroExt32to64 y)))
  8953  	for {
  8954  		t := v.Type
  8955  		x := v_0
  8956  		y := v_1
  8957  		if !(!shiftIsBounded(v)) {
  8958  			break
  8959  		}
  8960  		v.reset(OpLOONG64MASKEQZ)
  8961  		v0 := b.NewValue0(v.Pos, OpLOONG64SLLV, t)
  8962  		v1 := b.NewValue0(v.Pos, OpZeroExt32to64, typ.UInt64)
  8963  		v1.AddArg(y)
  8964  		v0.AddArg2(x, v1)
  8965  		v2 := b.NewValue0(v.Pos, OpLOONG64SGTU, typ.Bool)
  8966  		v3 := b.NewValue0(v.Pos, OpLOONG64MOVVconst, typ.UInt64)
  8967  		v3.AuxInt = int64ToAuxInt(64)
  8968  		v2.AddArg2(v3, v1)
  8969  		v.AddArg2(v0, v2)
  8970  		return true
  8971  	}
  8972  	return false
  8973  }
  8974  func rewriteValueLOONG64_OpLsh64x64(v *Value) bool {
  8975  	v_1 := v.Args[1]
  8976  	v_0 := v.Args[0]
  8977  	b := v.Block
  8978  	typ := &b.Func.Config.Types
  8979  	// match: (Lsh64x64 x y)
  8980  	// cond: shiftIsBounded(v)
  8981  	// result: (SLLV x y)
  8982  	for {
  8983  		x := v_0
  8984  		y := v_1
  8985  		if !(shiftIsBounded(v)) {
  8986  			break
  8987  		}
  8988  		v.reset(OpLOONG64SLLV)
  8989  		v.AddArg2(x, y)
  8990  		return true
  8991  	}
  8992  	// match: (Lsh64x64 <t> x y)
  8993  	// cond: !shiftIsBounded(v)
  8994  	// result: (MASKEQZ (SLLV <t> x y) (SGTU (MOVVconst <typ.UInt64> [64]) y))
  8995  	for {
  8996  		t := v.Type
  8997  		x := v_0
  8998  		y := v_1
  8999  		if !(!shiftIsBounded(v)) {
  9000  			break
  9001  		}
  9002  		v.reset(OpLOONG64MASKEQZ)
  9003  		v0 := b.NewValue0(v.Pos, OpLOONG64SLLV, t)
  9004  		v0.AddArg2(x, y)
  9005  		v1 := b.NewValue0(v.Pos, OpLOONG64SGTU, typ.Bool)
  9006  		v2 := b.NewValue0(v.Pos, OpLOONG64MOVVconst, typ.UInt64)
  9007  		v2.AuxInt = int64ToAuxInt(64)
  9008  		v1.AddArg2(v2, y)
  9009  		v.AddArg2(v0, v1)
  9010  		return true
  9011  	}
  9012  	return false
  9013  }
  9014  func rewriteValueLOONG64_OpLsh64x8(v *Value) bool {
  9015  	v_1 := v.Args[1]
  9016  	v_0 := v.Args[0]
  9017  	b := v.Block
  9018  	typ := &b.Func.Config.Types
  9019  	// match: (Lsh64x8 x y)
  9020  	// cond: shiftIsBounded(v)
  9021  	// result: (SLLV x y)
  9022  	for {
  9023  		x := v_0
  9024  		y := v_1
  9025  		if !(shiftIsBounded(v)) {
  9026  			break
  9027  		}
  9028  		v.reset(OpLOONG64SLLV)
  9029  		v.AddArg2(x, y)
  9030  		return true
  9031  	}
  9032  	// match: (Lsh64x8 <t> x y)
  9033  	// cond: !shiftIsBounded(v)
  9034  	// result: (MASKEQZ (SLLV <t> x (ZeroExt8to64 y)) (SGTU (MOVVconst <typ.UInt64> [64]) (ZeroExt8to64 y)))
  9035  	for {
  9036  		t := v.Type
  9037  		x := v_0
  9038  		y := v_1
  9039  		if !(!shiftIsBounded(v)) {
  9040  			break
  9041  		}
  9042  		v.reset(OpLOONG64MASKEQZ)
  9043  		v0 := b.NewValue0(v.Pos, OpLOONG64SLLV, t)
  9044  		v1 := b.NewValue0(v.Pos, OpZeroExt8to64, typ.UInt64)
  9045  		v1.AddArg(y)
  9046  		v0.AddArg2(x, v1)
  9047  		v2 := b.NewValue0(v.Pos, OpLOONG64SGTU, typ.Bool)
  9048  		v3 := b.NewValue0(v.Pos, OpLOONG64MOVVconst, typ.UInt64)
  9049  		v3.AuxInt = int64ToAuxInt(64)
  9050  		v2.AddArg2(v3, v1)
  9051  		v.AddArg2(v0, v2)
  9052  		return true
  9053  	}
  9054  	return false
  9055  }
  9056  func rewriteValueLOONG64_OpLsh8x16(v *Value) bool {
  9057  	v_1 := v.Args[1]
  9058  	v_0 := v.Args[0]
  9059  	b := v.Block
  9060  	typ := &b.Func.Config.Types
  9061  	// match: (Lsh8x16 x y)
  9062  	// cond: shiftIsBounded(v)
  9063  	// result: (SLLV x y)
  9064  	for {
  9065  		x := v_0
  9066  		y := v_1
  9067  		if !(shiftIsBounded(v)) {
  9068  			break
  9069  		}
  9070  		v.reset(OpLOONG64SLLV)
  9071  		v.AddArg2(x, y)
  9072  		return true
  9073  	}
  9074  	// match: (Lsh8x16 <t> x y)
  9075  	// cond: !shiftIsBounded(v)
  9076  	// result: (MASKEQZ (SLLV <t> x (ZeroExt16to64 y)) (SGTU (MOVVconst <typ.UInt64> [64]) (ZeroExt16to64 y)))
  9077  	for {
  9078  		t := v.Type
  9079  		x := v_0
  9080  		y := v_1
  9081  		if !(!shiftIsBounded(v)) {
  9082  			break
  9083  		}
  9084  		v.reset(OpLOONG64MASKEQZ)
  9085  		v0 := b.NewValue0(v.Pos, OpLOONG64SLLV, t)
  9086  		v1 := b.NewValue0(v.Pos, OpZeroExt16to64, typ.UInt64)
  9087  		v1.AddArg(y)
  9088  		v0.AddArg2(x, v1)
  9089  		v2 := b.NewValue0(v.Pos, OpLOONG64SGTU, typ.Bool)
  9090  		v3 := b.NewValue0(v.Pos, OpLOONG64MOVVconst, typ.UInt64)
  9091  		v3.AuxInt = int64ToAuxInt(64)
  9092  		v2.AddArg2(v3, v1)
  9093  		v.AddArg2(v0, v2)
  9094  		return true
  9095  	}
  9096  	return false
  9097  }
  9098  func rewriteValueLOONG64_OpLsh8x32(v *Value) bool {
  9099  	v_1 := v.Args[1]
  9100  	v_0 := v.Args[0]
  9101  	b := v.Block
  9102  	typ := &b.Func.Config.Types
  9103  	// match: (Lsh8x32 x y)
  9104  	// cond: shiftIsBounded(v)
  9105  	// result: (SLLV x y)
  9106  	for {
  9107  		x := v_0
  9108  		y := v_1
  9109  		if !(shiftIsBounded(v)) {
  9110  			break
  9111  		}
  9112  		v.reset(OpLOONG64SLLV)
  9113  		v.AddArg2(x, y)
  9114  		return true
  9115  	}
  9116  	// match: (Lsh8x32 <t> x y)
  9117  	// cond: !shiftIsBounded(v)
  9118  	// result: (MASKEQZ (SLLV <t> x (ZeroExt32to64 y)) (SGTU (MOVVconst <typ.UInt64> [64]) (ZeroExt32to64 y)))
  9119  	for {
  9120  		t := v.Type
  9121  		x := v_0
  9122  		y := v_1
  9123  		if !(!shiftIsBounded(v)) {
  9124  			break
  9125  		}
  9126  		v.reset(OpLOONG64MASKEQZ)
  9127  		v0 := b.NewValue0(v.Pos, OpLOONG64SLLV, t)
  9128  		v1 := b.NewValue0(v.Pos, OpZeroExt32to64, typ.UInt64)
  9129  		v1.AddArg(y)
  9130  		v0.AddArg2(x, v1)
  9131  		v2 := b.NewValue0(v.Pos, OpLOONG64SGTU, typ.Bool)
  9132  		v3 := b.NewValue0(v.Pos, OpLOONG64MOVVconst, typ.UInt64)
  9133  		v3.AuxInt = int64ToAuxInt(64)
  9134  		v2.AddArg2(v3, v1)
  9135  		v.AddArg2(v0, v2)
  9136  		return true
  9137  	}
  9138  	return false
  9139  }
  9140  func rewriteValueLOONG64_OpLsh8x64(v *Value) bool {
  9141  	v_1 := v.Args[1]
  9142  	v_0 := v.Args[0]
  9143  	b := v.Block
  9144  	typ := &b.Func.Config.Types
  9145  	// match: (Lsh8x64 x y)
  9146  	// cond: shiftIsBounded(v)
  9147  	// result: (SLLV x y)
  9148  	for {
  9149  		x := v_0
  9150  		y := v_1
  9151  		if !(shiftIsBounded(v)) {
  9152  			break
  9153  		}
  9154  		v.reset(OpLOONG64SLLV)
  9155  		v.AddArg2(x, y)
  9156  		return true
  9157  	}
  9158  	// match: (Lsh8x64 <t> x y)
  9159  	// cond: !shiftIsBounded(v)
  9160  	// result: (MASKEQZ (SLLV <t> x y) (SGTU (MOVVconst <typ.UInt64> [64]) y))
  9161  	for {
  9162  		t := v.Type
  9163  		x := v_0
  9164  		y := v_1
  9165  		if !(!shiftIsBounded(v)) {
  9166  			break
  9167  		}
  9168  		v.reset(OpLOONG64MASKEQZ)
  9169  		v0 := b.NewValue0(v.Pos, OpLOONG64SLLV, t)
  9170  		v0.AddArg2(x, y)
  9171  		v1 := b.NewValue0(v.Pos, OpLOONG64SGTU, typ.Bool)
  9172  		v2 := b.NewValue0(v.Pos, OpLOONG64MOVVconst, typ.UInt64)
  9173  		v2.AuxInt = int64ToAuxInt(64)
  9174  		v1.AddArg2(v2, y)
  9175  		v.AddArg2(v0, v1)
  9176  		return true
  9177  	}
  9178  	return false
  9179  }
  9180  func rewriteValueLOONG64_OpLsh8x8(v *Value) bool {
  9181  	v_1 := v.Args[1]
  9182  	v_0 := v.Args[0]
  9183  	b := v.Block
  9184  	typ := &b.Func.Config.Types
  9185  	// match: (Lsh8x8 x y)
  9186  	// cond: shiftIsBounded(v)
  9187  	// result: (SLLV x y)
  9188  	for {
  9189  		x := v_0
  9190  		y := v_1
  9191  		if !(shiftIsBounded(v)) {
  9192  			break
  9193  		}
  9194  		v.reset(OpLOONG64SLLV)
  9195  		v.AddArg2(x, y)
  9196  		return true
  9197  	}
  9198  	// match: (Lsh8x8 <t> x y)
  9199  	// cond: !shiftIsBounded(v)
  9200  	// result: (MASKEQZ (SLLV <t> x (ZeroExt8to64 y)) (SGTU (MOVVconst <typ.UInt64> [64]) (ZeroExt8to64 y)))
  9201  	for {
  9202  		t := v.Type
  9203  		x := v_0
  9204  		y := v_1
  9205  		if !(!shiftIsBounded(v)) {
  9206  			break
  9207  		}
  9208  		v.reset(OpLOONG64MASKEQZ)
  9209  		v0 := b.NewValue0(v.Pos, OpLOONG64SLLV, t)
  9210  		v1 := b.NewValue0(v.Pos, OpZeroExt8to64, typ.UInt64)
  9211  		v1.AddArg(y)
  9212  		v0.AddArg2(x, v1)
  9213  		v2 := b.NewValue0(v.Pos, OpLOONG64SGTU, typ.Bool)
  9214  		v3 := b.NewValue0(v.Pos, OpLOONG64MOVVconst, typ.UInt64)
  9215  		v3.AuxInt = int64ToAuxInt(64)
  9216  		v2.AddArg2(v3, v1)
  9217  		v.AddArg2(v0, v2)
  9218  		return true
  9219  	}
  9220  	return false
  9221  }
  9222  func rewriteValueLOONG64_OpMod16(v *Value) bool {
  9223  	v_1 := v.Args[1]
  9224  	v_0 := v.Args[0]
  9225  	b := v.Block
  9226  	typ := &b.Func.Config.Types
  9227  	// match: (Mod16 x y)
  9228  	// result: (REMV (SignExt16to64 x) (SignExt16to64 y))
  9229  	for {
  9230  		x := v_0
  9231  		y := v_1
  9232  		v.reset(OpLOONG64REMV)
  9233  		v0 := b.NewValue0(v.Pos, OpSignExt16to64, typ.Int64)
  9234  		v0.AddArg(x)
  9235  		v1 := b.NewValue0(v.Pos, OpSignExt16to64, typ.Int64)
  9236  		v1.AddArg(y)
  9237  		v.AddArg2(v0, v1)
  9238  		return true
  9239  	}
  9240  }
  9241  func rewriteValueLOONG64_OpMod16u(v *Value) bool {
  9242  	v_1 := v.Args[1]
  9243  	v_0 := v.Args[0]
  9244  	b := v.Block
  9245  	typ := &b.Func.Config.Types
  9246  	// match: (Mod16u x y)
  9247  	// result: (REMVU (ZeroExt16to64 x) (ZeroExt16to64 y))
  9248  	for {
  9249  		x := v_0
  9250  		y := v_1
  9251  		v.reset(OpLOONG64REMVU)
  9252  		v0 := b.NewValue0(v.Pos, OpZeroExt16to64, typ.UInt64)
  9253  		v0.AddArg(x)
  9254  		v1 := b.NewValue0(v.Pos, OpZeroExt16to64, typ.UInt64)
  9255  		v1.AddArg(y)
  9256  		v.AddArg2(v0, v1)
  9257  		return true
  9258  	}
  9259  }
  9260  func rewriteValueLOONG64_OpMod32(v *Value) bool {
  9261  	v_1 := v.Args[1]
  9262  	v_0 := v.Args[0]
  9263  	b := v.Block
  9264  	typ := &b.Func.Config.Types
  9265  	// match: (Mod32 x y)
  9266  	// result: (REMV (SignExt32to64 x) (SignExt32to64 y))
  9267  	for {
  9268  		x := v_0
  9269  		y := v_1
  9270  		v.reset(OpLOONG64REMV)
  9271  		v0 := b.NewValue0(v.Pos, OpSignExt32to64, typ.Int64)
  9272  		v0.AddArg(x)
  9273  		v1 := b.NewValue0(v.Pos, OpSignExt32to64, typ.Int64)
  9274  		v1.AddArg(y)
  9275  		v.AddArg2(v0, v1)
  9276  		return true
  9277  	}
  9278  }
  9279  func rewriteValueLOONG64_OpMod32u(v *Value) bool {
  9280  	v_1 := v.Args[1]
  9281  	v_0 := v.Args[0]
  9282  	b := v.Block
  9283  	typ := &b.Func.Config.Types
  9284  	// match: (Mod32u x y)
  9285  	// result: (REMVU (ZeroExt32to64 x) (ZeroExt32to64 y))
  9286  	for {
  9287  		x := v_0
  9288  		y := v_1
  9289  		v.reset(OpLOONG64REMVU)
  9290  		v0 := b.NewValue0(v.Pos, OpZeroExt32to64, typ.UInt64)
  9291  		v0.AddArg(x)
  9292  		v1 := b.NewValue0(v.Pos, OpZeroExt32to64, typ.UInt64)
  9293  		v1.AddArg(y)
  9294  		v.AddArg2(v0, v1)
  9295  		return true
  9296  	}
  9297  }
  9298  func rewriteValueLOONG64_OpMod64(v *Value) bool {
  9299  	v_1 := v.Args[1]
  9300  	v_0 := v.Args[0]
  9301  	// match: (Mod64 x y)
  9302  	// result: (REMV x y)
  9303  	for {
  9304  		x := v_0
  9305  		y := v_1
  9306  		v.reset(OpLOONG64REMV)
  9307  		v.AddArg2(x, y)
  9308  		return true
  9309  	}
  9310  }
  9311  func rewriteValueLOONG64_OpMod8(v *Value) bool {
  9312  	v_1 := v.Args[1]
  9313  	v_0 := v.Args[0]
  9314  	b := v.Block
  9315  	typ := &b.Func.Config.Types
  9316  	// match: (Mod8 x y)
  9317  	// result: (REMV (SignExt8to64 x) (SignExt8to64 y))
  9318  	for {
  9319  		x := v_0
  9320  		y := v_1
  9321  		v.reset(OpLOONG64REMV)
  9322  		v0 := b.NewValue0(v.Pos, OpSignExt8to64, typ.Int64)
  9323  		v0.AddArg(x)
  9324  		v1 := b.NewValue0(v.Pos, OpSignExt8to64, typ.Int64)
  9325  		v1.AddArg(y)
  9326  		v.AddArg2(v0, v1)
  9327  		return true
  9328  	}
  9329  }
  9330  func rewriteValueLOONG64_OpMod8u(v *Value) bool {
  9331  	v_1 := v.Args[1]
  9332  	v_0 := v.Args[0]
  9333  	b := v.Block
  9334  	typ := &b.Func.Config.Types
  9335  	// match: (Mod8u x y)
  9336  	// result: (REMVU (ZeroExt8to64 x) (ZeroExt8to64 y))
  9337  	for {
  9338  		x := v_0
  9339  		y := v_1
  9340  		v.reset(OpLOONG64REMVU)
  9341  		v0 := b.NewValue0(v.Pos, OpZeroExt8to64, typ.UInt64)
  9342  		v0.AddArg(x)
  9343  		v1 := b.NewValue0(v.Pos, OpZeroExt8to64, typ.UInt64)
  9344  		v1.AddArg(y)
  9345  		v.AddArg2(v0, v1)
  9346  		return true
  9347  	}
  9348  }
  9349  func rewriteValueLOONG64_OpMove(v *Value) bool {
  9350  	v_2 := v.Args[2]
  9351  	v_1 := v.Args[1]
  9352  	v_0 := v.Args[0]
  9353  	b := v.Block
  9354  	typ := &b.Func.Config.Types
  9355  	// match: (Move [0] _ _ mem)
  9356  	// result: mem
  9357  	for {
  9358  		if auxIntToInt64(v.AuxInt) != 0 {
  9359  			break
  9360  		}
  9361  		mem := v_2
  9362  		v.copyOf(mem)
  9363  		return true
  9364  	}
  9365  	// match: (Move [1] dst src mem)
  9366  	// result: (MOVBstore dst (MOVBUload src mem) mem)
  9367  	for {
  9368  		if auxIntToInt64(v.AuxInt) != 1 {
  9369  			break
  9370  		}
  9371  		dst := v_0
  9372  		src := v_1
  9373  		mem := v_2
  9374  		v.reset(OpLOONG64MOVBstore)
  9375  		v0 := b.NewValue0(v.Pos, OpLOONG64MOVBUload, typ.UInt8)
  9376  		v0.AddArg2(src, mem)
  9377  		v.AddArg3(dst, v0, mem)
  9378  		return true
  9379  	}
  9380  	// match: (Move [2] dst src mem)
  9381  	// result: (MOVHstore dst (MOVHUload src mem) mem)
  9382  	for {
  9383  		if auxIntToInt64(v.AuxInt) != 2 {
  9384  			break
  9385  		}
  9386  		dst := v_0
  9387  		src := v_1
  9388  		mem := v_2
  9389  		v.reset(OpLOONG64MOVHstore)
  9390  		v0 := b.NewValue0(v.Pos, OpLOONG64MOVHUload, typ.UInt16)
  9391  		v0.AddArg2(src, mem)
  9392  		v.AddArg3(dst, v0, mem)
  9393  		return true
  9394  	}
  9395  	// match: (Move [3] dst src mem)
  9396  	// result: (MOVBstore [2] dst (MOVBUload [2] src mem) (MOVHstore dst (MOVHUload src mem) mem))
  9397  	for {
  9398  		if auxIntToInt64(v.AuxInt) != 3 {
  9399  			break
  9400  		}
  9401  		dst := v_0
  9402  		src := v_1
  9403  		mem := v_2
  9404  		v.reset(OpLOONG64MOVBstore)
  9405  		v.AuxInt = int32ToAuxInt(2)
  9406  		v0 := b.NewValue0(v.Pos, OpLOONG64MOVBUload, typ.UInt8)
  9407  		v0.AuxInt = int32ToAuxInt(2)
  9408  		v0.AddArg2(src, mem)
  9409  		v1 := b.NewValue0(v.Pos, OpLOONG64MOVHstore, types.TypeMem)
  9410  		v2 := b.NewValue0(v.Pos, OpLOONG64MOVHUload, typ.UInt16)
  9411  		v2.AddArg2(src, mem)
  9412  		v1.AddArg3(dst, v2, mem)
  9413  		v.AddArg3(dst, v0, v1)
  9414  		return true
  9415  	}
  9416  	// match: (Move [4] dst src mem)
  9417  	// result: (MOVWstore dst (MOVWUload src mem) mem)
  9418  	for {
  9419  		if auxIntToInt64(v.AuxInt) != 4 {
  9420  			break
  9421  		}
  9422  		dst := v_0
  9423  		src := v_1
  9424  		mem := v_2
  9425  		v.reset(OpLOONG64MOVWstore)
  9426  		v0 := b.NewValue0(v.Pos, OpLOONG64MOVWUload, typ.UInt32)
  9427  		v0.AddArg2(src, mem)
  9428  		v.AddArg3(dst, v0, mem)
  9429  		return true
  9430  	}
  9431  	// match: (Move [5] dst src mem)
  9432  	// result: (MOVBstore [4] dst (MOVBUload [4] src mem) (MOVWstore dst (MOVWUload src mem) mem))
  9433  	for {
  9434  		if auxIntToInt64(v.AuxInt) != 5 {
  9435  			break
  9436  		}
  9437  		dst := v_0
  9438  		src := v_1
  9439  		mem := v_2
  9440  		v.reset(OpLOONG64MOVBstore)
  9441  		v.AuxInt = int32ToAuxInt(4)
  9442  		v0 := b.NewValue0(v.Pos, OpLOONG64MOVBUload, typ.UInt8)
  9443  		v0.AuxInt = int32ToAuxInt(4)
  9444  		v0.AddArg2(src, mem)
  9445  		v1 := b.NewValue0(v.Pos, OpLOONG64MOVWstore, types.TypeMem)
  9446  		v2 := b.NewValue0(v.Pos, OpLOONG64MOVWUload, typ.UInt32)
  9447  		v2.AddArg2(src, mem)
  9448  		v1.AddArg3(dst, v2, mem)
  9449  		v.AddArg3(dst, v0, v1)
  9450  		return true
  9451  	}
  9452  	// match: (Move [6] dst src mem)
  9453  	// result: (MOVHstore [4] dst (MOVHUload [4] src mem) (MOVWstore dst (MOVWUload src mem) mem))
  9454  	for {
  9455  		if auxIntToInt64(v.AuxInt) != 6 {
  9456  			break
  9457  		}
  9458  		dst := v_0
  9459  		src := v_1
  9460  		mem := v_2
  9461  		v.reset(OpLOONG64MOVHstore)
  9462  		v.AuxInt = int32ToAuxInt(4)
  9463  		v0 := b.NewValue0(v.Pos, OpLOONG64MOVHUload, typ.UInt16)
  9464  		v0.AuxInt = int32ToAuxInt(4)
  9465  		v0.AddArg2(src, mem)
  9466  		v1 := b.NewValue0(v.Pos, OpLOONG64MOVWstore, types.TypeMem)
  9467  		v2 := b.NewValue0(v.Pos, OpLOONG64MOVWUload, typ.UInt32)
  9468  		v2.AddArg2(src, mem)
  9469  		v1.AddArg3(dst, v2, mem)
  9470  		v.AddArg3(dst, v0, v1)
  9471  		return true
  9472  	}
  9473  	// match: (Move [7] dst src mem)
  9474  	// result: (MOVWstore [3] dst (MOVWUload [3] src mem) (MOVWstore dst (MOVWUload src mem) mem))
  9475  	for {
  9476  		if auxIntToInt64(v.AuxInt) != 7 {
  9477  			break
  9478  		}
  9479  		dst := v_0
  9480  		src := v_1
  9481  		mem := v_2
  9482  		v.reset(OpLOONG64MOVWstore)
  9483  		v.AuxInt = int32ToAuxInt(3)
  9484  		v0 := b.NewValue0(v.Pos, OpLOONG64MOVWUload, typ.UInt32)
  9485  		v0.AuxInt = int32ToAuxInt(3)
  9486  		v0.AddArg2(src, mem)
  9487  		v1 := b.NewValue0(v.Pos, OpLOONG64MOVWstore, types.TypeMem)
  9488  		v2 := b.NewValue0(v.Pos, OpLOONG64MOVWUload, typ.UInt32)
  9489  		v2.AddArg2(src, mem)
  9490  		v1.AddArg3(dst, v2, mem)
  9491  		v.AddArg3(dst, v0, v1)
  9492  		return true
  9493  	}
  9494  	// match: (Move [8] dst src mem)
  9495  	// result: (MOVVstore dst (MOVVload src mem) mem)
  9496  	for {
  9497  		if auxIntToInt64(v.AuxInt) != 8 {
  9498  			break
  9499  		}
  9500  		dst := v_0
  9501  		src := v_1
  9502  		mem := v_2
  9503  		v.reset(OpLOONG64MOVVstore)
  9504  		v0 := b.NewValue0(v.Pos, OpLOONG64MOVVload, typ.UInt64)
  9505  		v0.AddArg2(src, mem)
  9506  		v.AddArg3(dst, v0, mem)
  9507  		return true
  9508  	}
  9509  	// match: (Move [9] dst src mem)
  9510  	// result: (MOVBstore [8] dst (MOVBUload [8] src mem) (MOVVstore dst (MOVVload src mem) mem))
  9511  	for {
  9512  		if auxIntToInt64(v.AuxInt) != 9 {
  9513  			break
  9514  		}
  9515  		dst := v_0
  9516  		src := v_1
  9517  		mem := v_2
  9518  		v.reset(OpLOONG64MOVBstore)
  9519  		v.AuxInt = int32ToAuxInt(8)
  9520  		v0 := b.NewValue0(v.Pos, OpLOONG64MOVBUload, typ.UInt8)
  9521  		v0.AuxInt = int32ToAuxInt(8)
  9522  		v0.AddArg2(src, mem)
  9523  		v1 := b.NewValue0(v.Pos, OpLOONG64MOVVstore, types.TypeMem)
  9524  		v2 := b.NewValue0(v.Pos, OpLOONG64MOVVload, typ.UInt64)
  9525  		v2.AddArg2(src, mem)
  9526  		v1.AddArg3(dst, v2, mem)
  9527  		v.AddArg3(dst, v0, v1)
  9528  		return true
  9529  	}
  9530  	// match: (Move [10] dst src mem)
  9531  	// result: (MOVHstore [8] dst (MOVHUload [8] src mem) (MOVVstore dst (MOVVload src mem) mem))
  9532  	for {
  9533  		if auxIntToInt64(v.AuxInt) != 10 {
  9534  			break
  9535  		}
  9536  		dst := v_0
  9537  		src := v_1
  9538  		mem := v_2
  9539  		v.reset(OpLOONG64MOVHstore)
  9540  		v.AuxInt = int32ToAuxInt(8)
  9541  		v0 := b.NewValue0(v.Pos, OpLOONG64MOVHUload, typ.UInt16)
  9542  		v0.AuxInt = int32ToAuxInt(8)
  9543  		v0.AddArg2(src, mem)
  9544  		v1 := b.NewValue0(v.Pos, OpLOONG64MOVVstore, types.TypeMem)
  9545  		v2 := b.NewValue0(v.Pos, OpLOONG64MOVVload, typ.UInt64)
  9546  		v2.AddArg2(src, mem)
  9547  		v1.AddArg3(dst, v2, mem)
  9548  		v.AddArg3(dst, v0, v1)
  9549  		return true
  9550  	}
  9551  	// match: (Move [11] dst src mem)
  9552  	// result: (MOVWstore [7] dst (MOVWload [7] src mem) (MOVVstore dst (MOVVload src mem) mem))
  9553  	for {
  9554  		if auxIntToInt64(v.AuxInt) != 11 {
  9555  			break
  9556  		}
  9557  		dst := v_0
  9558  		src := v_1
  9559  		mem := v_2
  9560  		v.reset(OpLOONG64MOVWstore)
  9561  		v.AuxInt = int32ToAuxInt(7)
  9562  		v0 := b.NewValue0(v.Pos, OpLOONG64MOVWload, typ.Int32)
  9563  		v0.AuxInt = int32ToAuxInt(7)
  9564  		v0.AddArg2(src, mem)
  9565  		v1 := b.NewValue0(v.Pos, OpLOONG64MOVVstore, types.TypeMem)
  9566  		v2 := b.NewValue0(v.Pos, OpLOONG64MOVVload, typ.UInt64)
  9567  		v2.AddArg2(src, mem)
  9568  		v1.AddArg3(dst, v2, mem)
  9569  		v.AddArg3(dst, v0, v1)
  9570  		return true
  9571  	}
  9572  	// match: (Move [12] dst src mem)
  9573  	// result: (MOVWstore [8] dst (MOVWUload [8] src mem) (MOVVstore dst (MOVVload src mem) mem))
  9574  	for {
  9575  		if auxIntToInt64(v.AuxInt) != 12 {
  9576  			break
  9577  		}
  9578  		dst := v_0
  9579  		src := v_1
  9580  		mem := v_2
  9581  		v.reset(OpLOONG64MOVWstore)
  9582  		v.AuxInt = int32ToAuxInt(8)
  9583  		v0 := b.NewValue0(v.Pos, OpLOONG64MOVWUload, typ.UInt32)
  9584  		v0.AuxInt = int32ToAuxInt(8)
  9585  		v0.AddArg2(src, mem)
  9586  		v1 := b.NewValue0(v.Pos, OpLOONG64MOVVstore, types.TypeMem)
  9587  		v2 := b.NewValue0(v.Pos, OpLOONG64MOVVload, typ.UInt64)
  9588  		v2.AddArg2(src, mem)
  9589  		v1.AddArg3(dst, v2, mem)
  9590  		v.AddArg3(dst, v0, v1)
  9591  		return true
  9592  	}
  9593  	// match: (Move [13] dst src mem)
  9594  	// result: (MOVVstore [5] dst (MOVVload [5] src mem) (MOVVstore dst (MOVVload src mem) mem))
  9595  	for {
  9596  		if auxIntToInt64(v.AuxInt) != 13 {
  9597  			break
  9598  		}
  9599  		dst := v_0
  9600  		src := v_1
  9601  		mem := v_2
  9602  		v.reset(OpLOONG64MOVVstore)
  9603  		v.AuxInt = int32ToAuxInt(5)
  9604  		v0 := b.NewValue0(v.Pos, OpLOONG64MOVVload, typ.UInt64)
  9605  		v0.AuxInt = int32ToAuxInt(5)
  9606  		v0.AddArg2(src, mem)
  9607  		v1 := b.NewValue0(v.Pos, OpLOONG64MOVVstore, types.TypeMem)
  9608  		v2 := b.NewValue0(v.Pos, OpLOONG64MOVVload, typ.UInt64)
  9609  		v2.AddArg2(src, mem)
  9610  		v1.AddArg3(dst, v2, mem)
  9611  		v.AddArg3(dst, v0, v1)
  9612  		return true
  9613  	}
  9614  	// match: (Move [14] dst src mem)
  9615  	// result: (MOVVstore [6] dst (MOVVload [6] src mem) (MOVVstore dst (MOVVload src mem) mem))
  9616  	for {
  9617  		if auxIntToInt64(v.AuxInt) != 14 {
  9618  			break
  9619  		}
  9620  		dst := v_0
  9621  		src := v_1
  9622  		mem := v_2
  9623  		v.reset(OpLOONG64MOVVstore)
  9624  		v.AuxInt = int32ToAuxInt(6)
  9625  		v0 := b.NewValue0(v.Pos, OpLOONG64MOVVload, typ.UInt64)
  9626  		v0.AuxInt = int32ToAuxInt(6)
  9627  		v0.AddArg2(src, mem)
  9628  		v1 := b.NewValue0(v.Pos, OpLOONG64MOVVstore, types.TypeMem)
  9629  		v2 := b.NewValue0(v.Pos, OpLOONG64MOVVload, typ.UInt64)
  9630  		v2.AddArg2(src, mem)
  9631  		v1.AddArg3(dst, v2, mem)
  9632  		v.AddArg3(dst, v0, v1)
  9633  		return true
  9634  	}
  9635  	// match: (Move [15] dst src mem)
  9636  	// result: (MOVVstore [7] dst (MOVVload [7] src mem) (MOVVstore dst (MOVVload src mem) mem))
  9637  	for {
  9638  		if auxIntToInt64(v.AuxInt) != 15 {
  9639  			break
  9640  		}
  9641  		dst := v_0
  9642  		src := v_1
  9643  		mem := v_2
  9644  		v.reset(OpLOONG64MOVVstore)
  9645  		v.AuxInt = int32ToAuxInt(7)
  9646  		v0 := b.NewValue0(v.Pos, OpLOONG64MOVVload, typ.UInt64)
  9647  		v0.AuxInt = int32ToAuxInt(7)
  9648  		v0.AddArg2(src, mem)
  9649  		v1 := b.NewValue0(v.Pos, OpLOONG64MOVVstore, types.TypeMem)
  9650  		v2 := b.NewValue0(v.Pos, OpLOONG64MOVVload, typ.UInt64)
  9651  		v2.AddArg2(src, mem)
  9652  		v1.AddArg3(dst, v2, mem)
  9653  		v.AddArg3(dst, v0, v1)
  9654  		return true
  9655  	}
  9656  	// match: (Move [16] dst src mem)
  9657  	// result: (MOVVstore [8] dst (MOVVload [8] src mem) (MOVVstore dst (MOVVload src mem) mem))
  9658  	for {
  9659  		if auxIntToInt64(v.AuxInt) != 16 {
  9660  			break
  9661  		}
  9662  		dst := v_0
  9663  		src := v_1
  9664  		mem := v_2
  9665  		v.reset(OpLOONG64MOVVstore)
  9666  		v.AuxInt = int32ToAuxInt(8)
  9667  		v0 := b.NewValue0(v.Pos, OpLOONG64MOVVload, typ.UInt64)
  9668  		v0.AuxInt = int32ToAuxInt(8)
  9669  		v0.AddArg2(src, mem)
  9670  		v1 := b.NewValue0(v.Pos, OpLOONG64MOVVstore, types.TypeMem)
  9671  		v2 := b.NewValue0(v.Pos, OpLOONG64MOVVload, typ.UInt64)
  9672  		v2.AddArg2(src, mem)
  9673  		v1.AddArg3(dst, v2, mem)
  9674  		v.AddArg3(dst, v0, v1)
  9675  		return true
  9676  	}
  9677  	// match: (Move [s] dst src mem)
  9678  	// cond: s > 16 && s < 192 && logLargeCopy(v, s)
  9679  	// result: (LoweredMove [s] dst src mem)
  9680  	for {
  9681  		s := auxIntToInt64(v.AuxInt)
  9682  		dst := v_0
  9683  		src := v_1
  9684  		mem := v_2
  9685  		if !(s > 16 && s < 192 && logLargeCopy(v, s)) {
  9686  			break
  9687  		}
  9688  		v.reset(OpLOONG64LoweredMove)
  9689  		v.AuxInt = int64ToAuxInt(s)
  9690  		v.AddArg3(dst, src, mem)
  9691  		return true
  9692  	}
  9693  	// match: (Move [s] dst src mem)
  9694  	// cond: s >= 192 && logLargeCopy(v, s)
  9695  	// result: (LoweredMoveLoop [s] dst src mem)
  9696  	for {
  9697  		s := auxIntToInt64(v.AuxInt)
  9698  		dst := v_0
  9699  		src := v_1
  9700  		mem := v_2
  9701  		if !(s >= 192 && logLargeCopy(v, s)) {
  9702  			break
  9703  		}
  9704  		v.reset(OpLOONG64LoweredMoveLoop)
  9705  		v.AuxInt = int64ToAuxInt(s)
  9706  		v.AddArg3(dst, src, mem)
  9707  		return true
  9708  	}
  9709  	return false
  9710  }
  9711  func rewriteValueLOONG64_OpNeq16(v *Value) bool {
  9712  	v_1 := v.Args[1]
  9713  	v_0 := v.Args[0]
  9714  	b := v.Block
  9715  	typ := &b.Func.Config.Types
  9716  	// match: (Neq16 x y)
  9717  	// result: (SGTU (XOR (ZeroExt16to32 x) (ZeroExt16to64 y)) (MOVVconst [0]))
  9718  	for {
  9719  		x := v_0
  9720  		y := v_1
  9721  		v.reset(OpLOONG64SGTU)
  9722  		v0 := b.NewValue0(v.Pos, OpLOONG64XOR, typ.UInt64)
  9723  		v1 := b.NewValue0(v.Pos, OpZeroExt16to32, typ.UInt32)
  9724  		v1.AddArg(x)
  9725  		v2 := b.NewValue0(v.Pos, OpZeroExt16to64, typ.UInt64)
  9726  		v2.AddArg(y)
  9727  		v0.AddArg2(v1, v2)
  9728  		v3 := b.NewValue0(v.Pos, OpLOONG64MOVVconst, typ.UInt64)
  9729  		v3.AuxInt = int64ToAuxInt(0)
  9730  		v.AddArg2(v0, v3)
  9731  		return true
  9732  	}
  9733  }
  9734  func rewriteValueLOONG64_OpNeq32(v *Value) bool {
  9735  	v_1 := v.Args[1]
  9736  	v_0 := v.Args[0]
  9737  	b := v.Block
  9738  	typ := &b.Func.Config.Types
  9739  	// match: (Neq32 x y)
  9740  	// result: (SGTU (XOR (ZeroExt32to64 x) (ZeroExt32to64 y)) (MOVVconst [0]))
  9741  	for {
  9742  		x := v_0
  9743  		y := v_1
  9744  		v.reset(OpLOONG64SGTU)
  9745  		v0 := b.NewValue0(v.Pos, OpLOONG64XOR, typ.UInt64)
  9746  		v1 := b.NewValue0(v.Pos, OpZeroExt32to64, typ.UInt64)
  9747  		v1.AddArg(x)
  9748  		v2 := b.NewValue0(v.Pos, OpZeroExt32to64, typ.UInt64)
  9749  		v2.AddArg(y)
  9750  		v0.AddArg2(v1, v2)
  9751  		v3 := b.NewValue0(v.Pos, OpLOONG64MOVVconst, typ.UInt64)
  9752  		v3.AuxInt = int64ToAuxInt(0)
  9753  		v.AddArg2(v0, v3)
  9754  		return true
  9755  	}
  9756  }
  9757  func rewriteValueLOONG64_OpNeq32F(v *Value) bool {
  9758  	v_1 := v.Args[1]
  9759  	v_0 := v.Args[0]
  9760  	b := v.Block
  9761  	// match: (Neq32F x y)
  9762  	// result: (FPFlagFalse (CMPEQF x y))
  9763  	for {
  9764  		x := v_0
  9765  		y := v_1
  9766  		v.reset(OpLOONG64FPFlagFalse)
  9767  		v0 := b.NewValue0(v.Pos, OpLOONG64CMPEQF, types.TypeFlags)
  9768  		v0.AddArg2(x, y)
  9769  		v.AddArg(v0)
  9770  		return true
  9771  	}
  9772  }
  9773  func rewriteValueLOONG64_OpNeq64(v *Value) bool {
  9774  	v_1 := v.Args[1]
  9775  	v_0 := v.Args[0]
  9776  	b := v.Block
  9777  	typ := &b.Func.Config.Types
  9778  	// match: (Neq64 x y)
  9779  	// result: (SGTU (XOR x y) (MOVVconst [0]))
  9780  	for {
  9781  		x := v_0
  9782  		y := v_1
  9783  		v.reset(OpLOONG64SGTU)
  9784  		v0 := b.NewValue0(v.Pos, OpLOONG64XOR, typ.UInt64)
  9785  		v0.AddArg2(x, y)
  9786  		v1 := b.NewValue0(v.Pos, OpLOONG64MOVVconst, typ.UInt64)
  9787  		v1.AuxInt = int64ToAuxInt(0)
  9788  		v.AddArg2(v0, v1)
  9789  		return true
  9790  	}
  9791  }
  9792  func rewriteValueLOONG64_OpNeq64F(v *Value) bool {
  9793  	v_1 := v.Args[1]
  9794  	v_0 := v.Args[0]
  9795  	b := v.Block
  9796  	// match: (Neq64F x y)
  9797  	// result: (FPFlagFalse (CMPEQD x y))
  9798  	for {
  9799  		x := v_0
  9800  		y := v_1
  9801  		v.reset(OpLOONG64FPFlagFalse)
  9802  		v0 := b.NewValue0(v.Pos, OpLOONG64CMPEQD, types.TypeFlags)
  9803  		v0.AddArg2(x, y)
  9804  		v.AddArg(v0)
  9805  		return true
  9806  	}
  9807  }
  9808  func rewriteValueLOONG64_OpNeq8(v *Value) bool {
  9809  	v_1 := v.Args[1]
  9810  	v_0 := v.Args[0]
  9811  	b := v.Block
  9812  	typ := &b.Func.Config.Types
  9813  	// match: (Neq8 x y)
  9814  	// result: (SGTU (XOR (ZeroExt8to64 x) (ZeroExt8to64 y)) (MOVVconst [0]))
  9815  	for {
  9816  		x := v_0
  9817  		y := v_1
  9818  		v.reset(OpLOONG64SGTU)
  9819  		v0 := b.NewValue0(v.Pos, OpLOONG64XOR, typ.UInt64)
  9820  		v1 := b.NewValue0(v.Pos, OpZeroExt8to64, typ.UInt64)
  9821  		v1.AddArg(x)
  9822  		v2 := b.NewValue0(v.Pos, OpZeroExt8to64, typ.UInt64)
  9823  		v2.AddArg(y)
  9824  		v0.AddArg2(v1, v2)
  9825  		v3 := b.NewValue0(v.Pos, OpLOONG64MOVVconst, typ.UInt64)
  9826  		v3.AuxInt = int64ToAuxInt(0)
  9827  		v.AddArg2(v0, v3)
  9828  		return true
  9829  	}
  9830  }
  9831  func rewriteValueLOONG64_OpNeqPtr(v *Value) bool {
  9832  	v_1 := v.Args[1]
  9833  	v_0 := v.Args[0]
  9834  	b := v.Block
  9835  	typ := &b.Func.Config.Types
  9836  	// match: (NeqPtr x y)
  9837  	// result: (SGTU (XOR x y) (MOVVconst [0]))
  9838  	for {
  9839  		x := v_0
  9840  		y := v_1
  9841  		v.reset(OpLOONG64SGTU)
  9842  		v0 := b.NewValue0(v.Pos, OpLOONG64XOR, typ.UInt64)
  9843  		v0.AddArg2(x, y)
  9844  		v1 := b.NewValue0(v.Pos, OpLOONG64MOVVconst, typ.UInt64)
  9845  		v1.AuxInt = int64ToAuxInt(0)
  9846  		v.AddArg2(v0, v1)
  9847  		return true
  9848  	}
  9849  }
  9850  func rewriteValueLOONG64_OpNot(v *Value) bool {
  9851  	v_0 := v.Args[0]
  9852  	// match: (Not x)
  9853  	// result: (XORconst [1] x)
  9854  	for {
  9855  		x := v_0
  9856  		v.reset(OpLOONG64XORconst)
  9857  		v.AuxInt = int64ToAuxInt(1)
  9858  		v.AddArg(x)
  9859  		return true
  9860  	}
  9861  }
  9862  func rewriteValueLOONG64_OpOffPtr(v *Value) bool {
  9863  	v_0 := v.Args[0]
  9864  	// match: (OffPtr [off] ptr:(SP))
  9865  	// result: (MOVVaddr [int32(off)] ptr)
  9866  	for {
  9867  		off := auxIntToInt64(v.AuxInt)
  9868  		ptr := v_0
  9869  		if ptr.Op != OpSP {
  9870  			break
  9871  		}
  9872  		v.reset(OpLOONG64MOVVaddr)
  9873  		v.AuxInt = int32ToAuxInt(int32(off))
  9874  		v.AddArg(ptr)
  9875  		return true
  9876  	}
  9877  	// match: (OffPtr [off] ptr)
  9878  	// result: (ADDVconst [off] ptr)
  9879  	for {
  9880  		off := auxIntToInt64(v.AuxInt)
  9881  		ptr := v_0
  9882  		v.reset(OpLOONG64ADDVconst)
  9883  		v.AuxInt = int64ToAuxInt(off)
  9884  		v.AddArg(ptr)
  9885  		return true
  9886  	}
  9887  }
  9888  func rewriteValueLOONG64_OpPopCount16(v *Value) bool {
  9889  	v_0 := v.Args[0]
  9890  	b := v.Block
  9891  	typ := &b.Func.Config.Types
  9892  	// match: (PopCount16 <t> x)
  9893  	// result: (MOVWfpgp <t> (VPCNT16 <typ.Float32> (MOVWgpfp <typ.Float32> (ZeroExt16to32 x))))
  9894  	for {
  9895  		t := v.Type
  9896  		x := v_0
  9897  		v.reset(OpLOONG64MOVWfpgp)
  9898  		v.Type = t
  9899  		v0 := b.NewValue0(v.Pos, OpLOONG64VPCNT16, typ.Float32)
  9900  		v1 := b.NewValue0(v.Pos, OpLOONG64MOVWgpfp, typ.Float32)
  9901  		v2 := b.NewValue0(v.Pos, OpZeroExt16to32, typ.UInt32)
  9902  		v2.AddArg(x)
  9903  		v1.AddArg(v2)
  9904  		v0.AddArg(v1)
  9905  		v.AddArg(v0)
  9906  		return true
  9907  	}
  9908  }
  9909  func rewriteValueLOONG64_OpPopCount32(v *Value) bool {
  9910  	v_0 := v.Args[0]
  9911  	b := v.Block
  9912  	typ := &b.Func.Config.Types
  9913  	// match: (PopCount32 <t> x)
  9914  	// result: (MOVWfpgp <t> (VPCNT32 <typ.Float32> (MOVWgpfp <typ.Float32> x)))
  9915  	for {
  9916  		t := v.Type
  9917  		x := v_0
  9918  		v.reset(OpLOONG64MOVWfpgp)
  9919  		v.Type = t
  9920  		v0 := b.NewValue0(v.Pos, OpLOONG64VPCNT32, typ.Float32)
  9921  		v1 := b.NewValue0(v.Pos, OpLOONG64MOVWgpfp, typ.Float32)
  9922  		v1.AddArg(x)
  9923  		v0.AddArg(v1)
  9924  		v.AddArg(v0)
  9925  		return true
  9926  	}
  9927  }
  9928  func rewriteValueLOONG64_OpPopCount64(v *Value) bool {
  9929  	v_0 := v.Args[0]
  9930  	b := v.Block
  9931  	typ := &b.Func.Config.Types
  9932  	// match: (PopCount64 <t> x)
  9933  	// result: (MOVVfpgp <t> (VPCNT64 <typ.Float64> (MOVVgpfp <typ.Float64> x)))
  9934  	for {
  9935  		t := v.Type
  9936  		x := v_0
  9937  		v.reset(OpLOONG64MOVVfpgp)
  9938  		v.Type = t
  9939  		v0 := b.NewValue0(v.Pos, OpLOONG64VPCNT64, typ.Float64)
  9940  		v1 := b.NewValue0(v.Pos, OpLOONG64MOVVgpfp, typ.Float64)
  9941  		v1.AddArg(x)
  9942  		v0.AddArg(v1)
  9943  		v.AddArg(v0)
  9944  		return true
  9945  	}
  9946  }
  9947  func rewriteValueLOONG64_OpPrefetchCache(v *Value) bool {
  9948  	v_1 := v.Args[1]
  9949  	v_0 := v.Args[0]
  9950  	// match: (PrefetchCache addr mem)
  9951  	// result: (PRELD addr mem [0])
  9952  	for {
  9953  		addr := v_0
  9954  		mem := v_1
  9955  		v.reset(OpLOONG64PRELD)
  9956  		v.AuxInt = int64ToAuxInt(0)
  9957  		v.AddArg2(addr, mem)
  9958  		return true
  9959  	}
  9960  }
  9961  func rewriteValueLOONG64_OpPrefetchCacheStreamed(v *Value) bool {
  9962  	v_1 := v.Args[1]
  9963  	v_0 := v.Args[0]
  9964  	// match: (PrefetchCacheStreamed addr mem)
  9965  	// result: (PRELDX addr mem [(((512 << 1) + (1 << 12)) << 5) + 2])
  9966  	for {
  9967  		addr := v_0
  9968  		mem := v_1
  9969  		v.reset(OpLOONG64PRELDX)
  9970  		v.AuxInt = int64ToAuxInt((((512 << 1) + (1 << 12)) << 5) + 2)
  9971  		v.AddArg2(addr, mem)
  9972  		return true
  9973  	}
  9974  }
  9975  func rewriteValueLOONG64_OpRotateLeft16(v *Value) bool {
  9976  	v_1 := v.Args[1]
  9977  	v_0 := v.Args[0]
  9978  	b := v.Block
  9979  	typ := &b.Func.Config.Types
  9980  	// match: (RotateLeft16 <t> x (MOVVconst [c]))
  9981  	// result: (Or16 (Lsh16x64 <t> x (MOVVconst [c&15])) (Rsh16Ux64 <t> x (MOVVconst [-c&15])))
  9982  	for {
  9983  		t := v.Type
  9984  		x := v_0
  9985  		if v_1.Op != OpLOONG64MOVVconst {
  9986  			break
  9987  		}
  9988  		c := auxIntToInt64(v_1.AuxInt)
  9989  		v.reset(OpOr16)
  9990  		v0 := b.NewValue0(v.Pos, OpLsh16x64, t)
  9991  		v1 := b.NewValue0(v.Pos, OpLOONG64MOVVconst, typ.UInt64)
  9992  		v1.AuxInt = int64ToAuxInt(c & 15)
  9993  		v0.AddArg2(x, v1)
  9994  		v2 := b.NewValue0(v.Pos, OpRsh16Ux64, t)
  9995  		v3 := b.NewValue0(v.Pos, OpLOONG64MOVVconst, typ.UInt64)
  9996  		v3.AuxInt = int64ToAuxInt(-c & 15)
  9997  		v2.AddArg2(x, v3)
  9998  		v.AddArg2(v0, v2)
  9999  		return true
 10000  	}
 10001  	// match: (RotateLeft16 <t> x y)
 10002  	// result: (ROTR <t> (OR <typ.UInt32> (ZeroExt16to32 x) (SLLVconst <t> (ZeroExt16to32 x) [16])) (NEGV <typ.Int64> y))
 10003  	for {
 10004  		t := v.Type
 10005  		x := v_0
 10006  		y := v_1
 10007  		v.reset(OpLOONG64ROTR)
 10008  		v.Type = t
 10009  		v0 := b.NewValue0(v.Pos, OpLOONG64OR, typ.UInt32)
 10010  		v1 := b.NewValue0(v.Pos, OpZeroExt16to32, typ.UInt32)
 10011  		v1.AddArg(x)
 10012  		v2 := b.NewValue0(v.Pos, OpLOONG64SLLVconst, t)
 10013  		v2.AuxInt = int64ToAuxInt(16)
 10014  		v2.AddArg(v1)
 10015  		v0.AddArg2(v1, v2)
 10016  		v3 := b.NewValue0(v.Pos, OpLOONG64NEGV, typ.Int64)
 10017  		v3.AddArg(y)
 10018  		v.AddArg2(v0, v3)
 10019  		return true
 10020  	}
 10021  }
 10022  func rewriteValueLOONG64_OpRotateLeft32(v *Value) bool {
 10023  	v_1 := v.Args[1]
 10024  	v_0 := v.Args[0]
 10025  	b := v.Block
 10026  	// match: (RotateLeft32 x y)
 10027  	// result: (ROTR x (NEGV <y.Type> y))
 10028  	for {
 10029  		x := v_0
 10030  		y := v_1
 10031  		v.reset(OpLOONG64ROTR)
 10032  		v0 := b.NewValue0(v.Pos, OpLOONG64NEGV, y.Type)
 10033  		v0.AddArg(y)
 10034  		v.AddArg2(x, v0)
 10035  		return true
 10036  	}
 10037  }
 10038  func rewriteValueLOONG64_OpRotateLeft64(v *Value) bool {
 10039  	v_1 := v.Args[1]
 10040  	v_0 := v.Args[0]
 10041  	b := v.Block
 10042  	// match: (RotateLeft64 x y)
 10043  	// result: (ROTRV x (NEGV <y.Type> y))
 10044  	for {
 10045  		x := v_0
 10046  		y := v_1
 10047  		v.reset(OpLOONG64ROTRV)
 10048  		v0 := b.NewValue0(v.Pos, OpLOONG64NEGV, y.Type)
 10049  		v0.AddArg(y)
 10050  		v.AddArg2(x, v0)
 10051  		return true
 10052  	}
 10053  }
 10054  func rewriteValueLOONG64_OpRotateLeft8(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: (RotateLeft8 <t> x (MOVVconst [c]))
 10060  	// result: (Or8 (Lsh8x64 <t> x (MOVVconst [c&7])) (Rsh8Ux64 <t> x (MOVVconst [-c&7])))
 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(OpOr8)
 10069  		v0 := b.NewValue0(v.Pos, OpLsh8x64, t)
 10070  		v1 := b.NewValue0(v.Pos, OpLOONG64MOVVconst, typ.UInt64)
 10071  		v1.AuxInt = int64ToAuxInt(c & 7)
 10072  		v0.AddArg2(x, v1)
 10073  		v2 := b.NewValue0(v.Pos, OpRsh8Ux64, t)
 10074  		v3 := b.NewValue0(v.Pos, OpLOONG64MOVVconst, typ.UInt64)
 10075  		v3.AuxInt = int64ToAuxInt(-c & 7)
 10076  		v2.AddArg2(x, v3)
 10077  		v.AddArg2(v0, v2)
 10078  		return true
 10079  	}
 10080  	// match: (RotateLeft8 <t> x y)
 10081  	// result: (OR <t> (SLLV <t> x (ANDconst <typ.Int64> [7] y)) (SRLV <t> (ZeroExt8to64 x) (ANDconst <typ.Int64> [7] (NEGV <typ.Int64> y))))
 10082  	for {
 10083  		t := v.Type
 10084  		x := v_0
 10085  		y := v_1
 10086  		v.reset(OpLOONG64OR)
 10087  		v.Type = t
 10088  		v0 := b.NewValue0(v.Pos, OpLOONG64SLLV, t)
 10089  		v1 := b.NewValue0(v.Pos, OpLOONG64ANDconst, typ.Int64)
 10090  		v1.AuxInt = int64ToAuxInt(7)
 10091  		v1.AddArg(y)
 10092  		v0.AddArg2(x, v1)
 10093  		v2 := b.NewValue0(v.Pos, OpLOONG64SRLV, t)
 10094  		v3 := b.NewValue0(v.Pos, OpZeroExt8to64, typ.UInt64)
 10095  		v3.AddArg(x)
 10096  		v4 := b.NewValue0(v.Pos, OpLOONG64ANDconst, typ.Int64)
 10097  		v4.AuxInt = int64ToAuxInt(7)
 10098  		v5 := b.NewValue0(v.Pos, OpLOONG64NEGV, typ.Int64)
 10099  		v5.AddArg(y)
 10100  		v4.AddArg(v5)
 10101  		v2.AddArg2(v3, v4)
 10102  		v.AddArg2(v0, v2)
 10103  		return true
 10104  	}
 10105  }
 10106  func rewriteValueLOONG64_OpRsh16Ux16(v *Value) bool {
 10107  	v_1 := v.Args[1]
 10108  	v_0 := v.Args[0]
 10109  	b := v.Block
 10110  	typ := &b.Func.Config.Types
 10111  	// match: (Rsh16Ux16 x y)
 10112  	// cond: shiftIsBounded(v)
 10113  	// result: (SRLV (ZeroExt16to64 x) y)
 10114  	for {
 10115  		x := v_0
 10116  		y := v_1
 10117  		if !(shiftIsBounded(v)) {
 10118  			break
 10119  		}
 10120  		v.reset(OpLOONG64SRLV)
 10121  		v0 := b.NewValue0(v.Pos, OpZeroExt16to64, typ.UInt64)
 10122  		v0.AddArg(x)
 10123  		v.AddArg2(v0, y)
 10124  		return true
 10125  	}
 10126  	// match: (Rsh16Ux16 <t> x y)
 10127  	// cond: !shiftIsBounded(v)
 10128  	// result: (MASKEQZ (SRLV <t> (ZeroExt16to64 x) (ZeroExt16to64 y)) (SGTU (MOVVconst <typ.UInt64> [64]) (ZeroExt16to64 y)))
 10129  	for {
 10130  		t := v.Type
 10131  		x := v_0
 10132  		y := v_1
 10133  		if !(!shiftIsBounded(v)) {
 10134  			break
 10135  		}
 10136  		v.reset(OpLOONG64MASKEQZ)
 10137  		v0 := b.NewValue0(v.Pos, OpLOONG64SRLV, t)
 10138  		v1 := b.NewValue0(v.Pos, OpZeroExt16to64, typ.UInt64)
 10139  		v1.AddArg(x)
 10140  		v2 := b.NewValue0(v.Pos, OpZeroExt16to64, typ.UInt64)
 10141  		v2.AddArg(y)
 10142  		v0.AddArg2(v1, v2)
 10143  		v3 := b.NewValue0(v.Pos, OpLOONG64SGTU, typ.Bool)
 10144  		v4 := b.NewValue0(v.Pos, OpLOONG64MOVVconst, typ.UInt64)
 10145  		v4.AuxInt = int64ToAuxInt(64)
 10146  		v3.AddArg2(v4, v2)
 10147  		v.AddArg2(v0, v3)
 10148  		return true
 10149  	}
 10150  	return false
 10151  }
 10152  func rewriteValueLOONG64_OpRsh16Ux32(v *Value) bool {
 10153  	v_1 := v.Args[1]
 10154  	v_0 := v.Args[0]
 10155  	b := v.Block
 10156  	typ := &b.Func.Config.Types
 10157  	// match: (Rsh16Ux32 x y)
 10158  	// cond: shiftIsBounded(v)
 10159  	// result: (SRLV (ZeroExt16to64 x) y)
 10160  	for {
 10161  		x := v_0
 10162  		y := v_1
 10163  		if !(shiftIsBounded(v)) {
 10164  			break
 10165  		}
 10166  		v.reset(OpLOONG64SRLV)
 10167  		v0 := b.NewValue0(v.Pos, OpZeroExt16to64, typ.UInt64)
 10168  		v0.AddArg(x)
 10169  		v.AddArg2(v0, y)
 10170  		return true
 10171  	}
 10172  	// match: (Rsh16Ux32 <t> x y)
 10173  	// cond: !shiftIsBounded(v)
 10174  	// result: (MASKEQZ (SRLV <t> (ZeroExt16to64 x) (ZeroExt32to64 y)) (SGTU (MOVVconst <typ.UInt64> [64]) (ZeroExt32to64 y)))
 10175  	for {
 10176  		t := v.Type
 10177  		x := v_0
 10178  		y := v_1
 10179  		if !(!shiftIsBounded(v)) {
 10180  			break
 10181  		}
 10182  		v.reset(OpLOONG64MASKEQZ)
 10183  		v0 := b.NewValue0(v.Pos, OpLOONG64SRLV, t)
 10184  		v1 := b.NewValue0(v.Pos, OpZeroExt16to64, typ.UInt64)
 10185  		v1.AddArg(x)
 10186  		v2 := b.NewValue0(v.Pos, OpZeroExt32to64, typ.UInt64)
 10187  		v2.AddArg(y)
 10188  		v0.AddArg2(v1, v2)
 10189  		v3 := b.NewValue0(v.Pos, OpLOONG64SGTU, typ.Bool)
 10190  		v4 := b.NewValue0(v.Pos, OpLOONG64MOVVconst, typ.UInt64)
 10191  		v4.AuxInt = int64ToAuxInt(64)
 10192  		v3.AddArg2(v4, v2)
 10193  		v.AddArg2(v0, v3)
 10194  		return true
 10195  	}
 10196  	return false
 10197  }
 10198  func rewriteValueLOONG64_OpRsh16Ux64(v *Value) bool {
 10199  	v_1 := v.Args[1]
 10200  	v_0 := v.Args[0]
 10201  	b := v.Block
 10202  	typ := &b.Func.Config.Types
 10203  	// match: (Rsh16Ux64 x y)
 10204  	// cond: shiftIsBounded(v)
 10205  	// result: (SRLV (ZeroExt16to64 x) y)
 10206  	for {
 10207  		x := v_0
 10208  		y := v_1
 10209  		if !(shiftIsBounded(v)) {
 10210  			break
 10211  		}
 10212  		v.reset(OpLOONG64SRLV)
 10213  		v0 := b.NewValue0(v.Pos, OpZeroExt16to64, typ.UInt64)
 10214  		v0.AddArg(x)
 10215  		v.AddArg2(v0, y)
 10216  		return true
 10217  	}
 10218  	// match: (Rsh16Ux64 <t> x y)
 10219  	// cond: !shiftIsBounded(v)
 10220  	// result: (MASKEQZ (SRLV <t> (ZeroExt16to64 x) y) (SGTU (MOVVconst <typ.UInt64> [64]) y))
 10221  	for {
 10222  		t := v.Type
 10223  		x := v_0
 10224  		y := v_1
 10225  		if !(!shiftIsBounded(v)) {
 10226  			break
 10227  		}
 10228  		v.reset(OpLOONG64MASKEQZ)
 10229  		v0 := b.NewValue0(v.Pos, OpLOONG64SRLV, t)
 10230  		v1 := b.NewValue0(v.Pos, OpZeroExt16to64, typ.UInt64)
 10231  		v1.AddArg(x)
 10232  		v0.AddArg2(v1, y)
 10233  		v2 := b.NewValue0(v.Pos, OpLOONG64SGTU, typ.Bool)
 10234  		v3 := b.NewValue0(v.Pos, OpLOONG64MOVVconst, typ.UInt64)
 10235  		v3.AuxInt = int64ToAuxInt(64)
 10236  		v2.AddArg2(v3, y)
 10237  		v.AddArg2(v0, v2)
 10238  		return true
 10239  	}
 10240  	return false
 10241  }
 10242  func rewriteValueLOONG64_OpRsh16Ux8(v *Value) bool {
 10243  	v_1 := v.Args[1]
 10244  	v_0 := v.Args[0]
 10245  	b := v.Block
 10246  	typ := &b.Func.Config.Types
 10247  	// match: (Rsh16Ux8 x y)
 10248  	// cond: shiftIsBounded(v)
 10249  	// result: (SRLV (ZeroExt16to64 x) y)
 10250  	for {
 10251  		x := v_0
 10252  		y := v_1
 10253  		if !(shiftIsBounded(v)) {
 10254  			break
 10255  		}
 10256  		v.reset(OpLOONG64SRLV)
 10257  		v0 := b.NewValue0(v.Pos, OpZeroExt16to64, typ.UInt64)
 10258  		v0.AddArg(x)
 10259  		v.AddArg2(v0, y)
 10260  		return true
 10261  	}
 10262  	// match: (Rsh16Ux8 <t> x y)
 10263  	// cond: !shiftIsBounded(v)
 10264  	// result: (MASKEQZ (SRLV <t> (ZeroExt16to64 x) (ZeroExt8to64 y)) (SGTU (MOVVconst <typ.UInt64> [64]) (ZeroExt8to64 y)))
 10265  	for {
 10266  		t := v.Type
 10267  		x := v_0
 10268  		y := v_1
 10269  		if !(!shiftIsBounded(v)) {
 10270  			break
 10271  		}
 10272  		v.reset(OpLOONG64MASKEQZ)
 10273  		v0 := b.NewValue0(v.Pos, OpLOONG64SRLV, t)
 10274  		v1 := b.NewValue0(v.Pos, OpZeroExt16to64, typ.UInt64)
 10275  		v1.AddArg(x)
 10276  		v2 := b.NewValue0(v.Pos, OpZeroExt8to64, typ.UInt64)
 10277  		v2.AddArg(y)
 10278  		v0.AddArg2(v1, v2)
 10279  		v3 := b.NewValue0(v.Pos, OpLOONG64SGTU, typ.Bool)
 10280  		v4 := b.NewValue0(v.Pos, OpLOONG64MOVVconst, typ.UInt64)
 10281  		v4.AuxInt = int64ToAuxInt(64)
 10282  		v3.AddArg2(v4, v2)
 10283  		v.AddArg2(v0, v3)
 10284  		return true
 10285  	}
 10286  	return false
 10287  }
 10288  func rewriteValueLOONG64_OpRsh16x16(v *Value) bool {
 10289  	v_1 := v.Args[1]
 10290  	v_0 := v.Args[0]
 10291  	b := v.Block
 10292  	typ := &b.Func.Config.Types
 10293  	// match: (Rsh16x16 x y)
 10294  	// cond: shiftIsBounded(v)
 10295  	// result: (SRAV (SignExt16to64 x) y)
 10296  	for {
 10297  		x := v_0
 10298  		y := v_1
 10299  		if !(shiftIsBounded(v)) {
 10300  			break
 10301  		}
 10302  		v.reset(OpLOONG64SRAV)
 10303  		v0 := b.NewValue0(v.Pos, OpSignExt16to64, typ.Int64)
 10304  		v0.AddArg(x)
 10305  		v.AddArg2(v0, y)
 10306  		return true
 10307  	}
 10308  	// match: (Rsh16x16 <t> x y)
 10309  	// cond: !shiftIsBounded(v)
 10310  	// result: (SRAV (SignExt16to64 x) (OR <t> (NEGV <t> (SGTU (ZeroExt16to64 y) (MOVVconst <typ.UInt64> [63]))) (ZeroExt16to64 y)))
 10311  	for {
 10312  		t := v.Type
 10313  		x := v_0
 10314  		y := v_1
 10315  		if !(!shiftIsBounded(v)) {
 10316  			break
 10317  		}
 10318  		v.reset(OpLOONG64SRAV)
 10319  		v0 := b.NewValue0(v.Pos, OpSignExt16to64, typ.Int64)
 10320  		v0.AddArg(x)
 10321  		v1 := b.NewValue0(v.Pos, OpLOONG64OR, t)
 10322  		v2 := b.NewValue0(v.Pos, OpLOONG64NEGV, t)
 10323  		v3 := b.NewValue0(v.Pos, OpLOONG64SGTU, typ.Bool)
 10324  		v4 := b.NewValue0(v.Pos, OpZeroExt16to64, typ.UInt64)
 10325  		v4.AddArg(y)
 10326  		v5 := b.NewValue0(v.Pos, OpLOONG64MOVVconst, typ.UInt64)
 10327  		v5.AuxInt = int64ToAuxInt(63)
 10328  		v3.AddArg2(v4, v5)
 10329  		v2.AddArg(v3)
 10330  		v1.AddArg2(v2, v4)
 10331  		v.AddArg2(v0, v1)
 10332  		return true
 10333  	}
 10334  	return false
 10335  }
 10336  func rewriteValueLOONG64_OpRsh16x32(v *Value) bool {
 10337  	v_1 := v.Args[1]
 10338  	v_0 := v.Args[0]
 10339  	b := v.Block
 10340  	typ := &b.Func.Config.Types
 10341  	// match: (Rsh16x32 x y)
 10342  	// cond: shiftIsBounded(v)
 10343  	// result: (SRAV (SignExt16to64 x) y)
 10344  	for {
 10345  		x := v_0
 10346  		y := v_1
 10347  		if !(shiftIsBounded(v)) {
 10348  			break
 10349  		}
 10350  		v.reset(OpLOONG64SRAV)
 10351  		v0 := b.NewValue0(v.Pos, OpSignExt16to64, typ.Int64)
 10352  		v0.AddArg(x)
 10353  		v.AddArg2(v0, y)
 10354  		return true
 10355  	}
 10356  	// match: (Rsh16x32 <t> x y)
 10357  	// cond: !shiftIsBounded(v)
 10358  	// result: (SRAV (SignExt16to64 x) (OR <t> (NEGV <t> (SGTU (ZeroExt32to64 y) (MOVVconst <typ.UInt64> [63]))) (ZeroExt32to64 y)))
 10359  	for {
 10360  		t := v.Type
 10361  		x := v_0
 10362  		y := v_1
 10363  		if !(!shiftIsBounded(v)) {
 10364  			break
 10365  		}
 10366  		v.reset(OpLOONG64SRAV)
 10367  		v0 := b.NewValue0(v.Pos, OpSignExt16to64, typ.Int64)
 10368  		v0.AddArg(x)
 10369  		v1 := b.NewValue0(v.Pos, OpLOONG64OR, t)
 10370  		v2 := b.NewValue0(v.Pos, OpLOONG64NEGV, t)
 10371  		v3 := b.NewValue0(v.Pos, OpLOONG64SGTU, typ.Bool)
 10372  		v4 := b.NewValue0(v.Pos, OpZeroExt32to64, typ.UInt64)
 10373  		v4.AddArg(y)
 10374  		v5 := b.NewValue0(v.Pos, OpLOONG64MOVVconst, typ.UInt64)
 10375  		v5.AuxInt = int64ToAuxInt(63)
 10376  		v3.AddArg2(v4, v5)
 10377  		v2.AddArg(v3)
 10378  		v1.AddArg2(v2, v4)
 10379  		v.AddArg2(v0, v1)
 10380  		return true
 10381  	}
 10382  	return false
 10383  }
 10384  func rewriteValueLOONG64_OpRsh16x64(v *Value) bool {
 10385  	v_1 := v.Args[1]
 10386  	v_0 := v.Args[0]
 10387  	b := v.Block
 10388  	typ := &b.Func.Config.Types
 10389  	// match: (Rsh16x64 x y)
 10390  	// cond: shiftIsBounded(v)
 10391  	// result: (SRAV (SignExt16to64 x) y)
 10392  	for {
 10393  		x := v_0
 10394  		y := v_1
 10395  		if !(shiftIsBounded(v)) {
 10396  			break
 10397  		}
 10398  		v.reset(OpLOONG64SRAV)
 10399  		v0 := b.NewValue0(v.Pos, OpSignExt16to64, typ.Int64)
 10400  		v0.AddArg(x)
 10401  		v.AddArg2(v0, y)
 10402  		return true
 10403  	}
 10404  	// match: (Rsh16x64 <t> x y)
 10405  	// cond: !shiftIsBounded(v)
 10406  	// result: (SRAV (SignExt16to64 x) (OR <t> (NEGV <t> (SGTU y (MOVVconst <typ.UInt64> [63]))) y))
 10407  	for {
 10408  		t := v.Type
 10409  		x := v_0
 10410  		y := v_1
 10411  		if !(!shiftIsBounded(v)) {
 10412  			break
 10413  		}
 10414  		v.reset(OpLOONG64SRAV)
 10415  		v0 := b.NewValue0(v.Pos, OpSignExt16to64, typ.Int64)
 10416  		v0.AddArg(x)
 10417  		v1 := b.NewValue0(v.Pos, OpLOONG64OR, t)
 10418  		v2 := b.NewValue0(v.Pos, OpLOONG64NEGV, t)
 10419  		v3 := b.NewValue0(v.Pos, OpLOONG64SGTU, typ.Bool)
 10420  		v4 := b.NewValue0(v.Pos, OpLOONG64MOVVconst, typ.UInt64)
 10421  		v4.AuxInt = int64ToAuxInt(63)
 10422  		v3.AddArg2(y, v4)
 10423  		v2.AddArg(v3)
 10424  		v1.AddArg2(v2, y)
 10425  		v.AddArg2(v0, v1)
 10426  		return true
 10427  	}
 10428  	return false
 10429  }
 10430  func rewriteValueLOONG64_OpRsh16x8(v *Value) bool {
 10431  	v_1 := v.Args[1]
 10432  	v_0 := v.Args[0]
 10433  	b := v.Block
 10434  	typ := &b.Func.Config.Types
 10435  	// match: (Rsh16x8 x y)
 10436  	// cond: shiftIsBounded(v)
 10437  	// result: (SRAV (SignExt16to64 x) y)
 10438  	for {
 10439  		x := v_0
 10440  		y := v_1
 10441  		if !(shiftIsBounded(v)) {
 10442  			break
 10443  		}
 10444  		v.reset(OpLOONG64SRAV)
 10445  		v0 := b.NewValue0(v.Pos, OpSignExt16to64, typ.Int64)
 10446  		v0.AddArg(x)
 10447  		v.AddArg2(v0, y)
 10448  		return true
 10449  	}
 10450  	// match: (Rsh16x8 <t> x y)
 10451  	// cond: !shiftIsBounded(v)
 10452  	// result: (SRAV (SignExt16to64 x) (OR <t> (NEGV <t> (SGTU (ZeroExt8to64 y) (MOVVconst <typ.UInt64> [63]))) (ZeroExt8to64 y)))
 10453  	for {
 10454  		t := v.Type
 10455  		x := v_0
 10456  		y := v_1
 10457  		if !(!shiftIsBounded(v)) {
 10458  			break
 10459  		}
 10460  		v.reset(OpLOONG64SRAV)
 10461  		v0 := b.NewValue0(v.Pos, OpSignExt16to64, typ.Int64)
 10462  		v0.AddArg(x)
 10463  		v1 := b.NewValue0(v.Pos, OpLOONG64OR, t)
 10464  		v2 := b.NewValue0(v.Pos, OpLOONG64NEGV, t)
 10465  		v3 := b.NewValue0(v.Pos, OpLOONG64SGTU, typ.Bool)
 10466  		v4 := b.NewValue0(v.Pos, OpZeroExt8to64, typ.UInt64)
 10467  		v4.AddArg(y)
 10468  		v5 := b.NewValue0(v.Pos, OpLOONG64MOVVconst, typ.UInt64)
 10469  		v5.AuxInt = int64ToAuxInt(63)
 10470  		v3.AddArg2(v4, v5)
 10471  		v2.AddArg(v3)
 10472  		v1.AddArg2(v2, v4)
 10473  		v.AddArg2(v0, v1)
 10474  		return true
 10475  	}
 10476  	return false
 10477  }
 10478  func rewriteValueLOONG64_OpRsh32Ux16(v *Value) bool {
 10479  	v_1 := v.Args[1]
 10480  	v_0 := v.Args[0]
 10481  	b := v.Block
 10482  	typ := &b.Func.Config.Types
 10483  	// match: (Rsh32Ux16 x y)
 10484  	// cond: shiftIsBounded(v)
 10485  	// result: (SRL x y)
 10486  	for {
 10487  		x := v_0
 10488  		y := v_1
 10489  		if !(shiftIsBounded(v)) {
 10490  			break
 10491  		}
 10492  		v.reset(OpLOONG64SRL)
 10493  		v.AddArg2(x, y)
 10494  		return true
 10495  	}
 10496  	// match: (Rsh32Ux16 <t> x y)
 10497  	// cond: !shiftIsBounded(v)
 10498  	// result: (MASKEQZ (SRL <t> x (ZeroExt16to64 y)) (SGTU (MOVVconst <typ.UInt64> [32]) (ZeroExt16to64 y)))
 10499  	for {
 10500  		t := v.Type
 10501  		x := v_0
 10502  		y := v_1
 10503  		if !(!shiftIsBounded(v)) {
 10504  			break
 10505  		}
 10506  		v.reset(OpLOONG64MASKEQZ)
 10507  		v0 := b.NewValue0(v.Pos, OpLOONG64SRL, t)
 10508  		v1 := b.NewValue0(v.Pos, OpZeroExt16to64, typ.UInt64)
 10509  		v1.AddArg(y)
 10510  		v0.AddArg2(x, v1)
 10511  		v2 := b.NewValue0(v.Pos, OpLOONG64SGTU, typ.Bool)
 10512  		v3 := b.NewValue0(v.Pos, OpLOONG64MOVVconst, typ.UInt64)
 10513  		v3.AuxInt = int64ToAuxInt(32)
 10514  		v2.AddArg2(v3, v1)
 10515  		v.AddArg2(v0, v2)
 10516  		return true
 10517  	}
 10518  	return false
 10519  }
 10520  func rewriteValueLOONG64_OpRsh32Ux32(v *Value) bool {
 10521  	v_1 := v.Args[1]
 10522  	v_0 := v.Args[0]
 10523  	b := v.Block
 10524  	typ := &b.Func.Config.Types
 10525  	// match: (Rsh32Ux32 x y)
 10526  	// cond: shiftIsBounded(v)
 10527  	// result: (SRL x y)
 10528  	for {
 10529  		x := v_0
 10530  		y := v_1
 10531  		if !(shiftIsBounded(v)) {
 10532  			break
 10533  		}
 10534  		v.reset(OpLOONG64SRL)
 10535  		v.AddArg2(x, y)
 10536  		return true
 10537  	}
 10538  	// match: (Rsh32Ux32 <t> x y)
 10539  	// cond: !shiftIsBounded(v)
 10540  	// result: (MASKEQZ (SRL <t> x (ZeroExt32to64 y)) (SGTU (MOVVconst <typ.UInt64> [32]) (ZeroExt32to64 y)))
 10541  	for {
 10542  		t := v.Type
 10543  		x := v_0
 10544  		y := v_1
 10545  		if !(!shiftIsBounded(v)) {
 10546  			break
 10547  		}
 10548  		v.reset(OpLOONG64MASKEQZ)
 10549  		v0 := b.NewValue0(v.Pos, OpLOONG64SRL, t)
 10550  		v1 := b.NewValue0(v.Pos, OpZeroExt32to64, typ.UInt64)
 10551  		v1.AddArg(y)
 10552  		v0.AddArg2(x, v1)
 10553  		v2 := b.NewValue0(v.Pos, OpLOONG64SGTU, typ.Bool)
 10554  		v3 := b.NewValue0(v.Pos, OpLOONG64MOVVconst, typ.UInt64)
 10555  		v3.AuxInt = int64ToAuxInt(32)
 10556  		v2.AddArg2(v3, v1)
 10557  		v.AddArg2(v0, v2)
 10558  		return true
 10559  	}
 10560  	return false
 10561  }
 10562  func rewriteValueLOONG64_OpRsh32Ux64(v *Value) bool {
 10563  	v_1 := v.Args[1]
 10564  	v_0 := v.Args[0]
 10565  	b := v.Block
 10566  	typ := &b.Func.Config.Types
 10567  	// match: (Rsh32Ux64 x y)
 10568  	// cond: shiftIsBounded(v)
 10569  	// result: (SRL x y)
 10570  	for {
 10571  		x := v_0
 10572  		y := v_1
 10573  		if !(shiftIsBounded(v)) {
 10574  			break
 10575  		}
 10576  		v.reset(OpLOONG64SRL)
 10577  		v.AddArg2(x, y)
 10578  		return true
 10579  	}
 10580  	// match: (Rsh32Ux64 <t> x y)
 10581  	// cond: !shiftIsBounded(v)
 10582  	// result: (MASKEQZ (SRL <t> x y) (SGTU (MOVVconst <typ.UInt64> [32]) y))
 10583  	for {
 10584  		t := v.Type
 10585  		x := v_0
 10586  		y := v_1
 10587  		if !(!shiftIsBounded(v)) {
 10588  			break
 10589  		}
 10590  		v.reset(OpLOONG64MASKEQZ)
 10591  		v0 := b.NewValue0(v.Pos, OpLOONG64SRL, t)
 10592  		v0.AddArg2(x, y)
 10593  		v1 := b.NewValue0(v.Pos, OpLOONG64SGTU, typ.Bool)
 10594  		v2 := b.NewValue0(v.Pos, OpLOONG64MOVVconst, typ.UInt64)
 10595  		v2.AuxInt = int64ToAuxInt(32)
 10596  		v1.AddArg2(v2, y)
 10597  		v.AddArg2(v0, v1)
 10598  		return true
 10599  	}
 10600  	return false
 10601  }
 10602  func rewriteValueLOONG64_OpRsh32Ux8(v *Value) bool {
 10603  	v_1 := v.Args[1]
 10604  	v_0 := v.Args[0]
 10605  	b := v.Block
 10606  	typ := &b.Func.Config.Types
 10607  	// match: (Rsh32Ux8 x y)
 10608  	// cond: shiftIsBounded(v)
 10609  	// result: (SRL x y)
 10610  	for {
 10611  		x := v_0
 10612  		y := v_1
 10613  		if !(shiftIsBounded(v)) {
 10614  			break
 10615  		}
 10616  		v.reset(OpLOONG64SRL)
 10617  		v.AddArg2(x, y)
 10618  		return true
 10619  	}
 10620  	// match: (Rsh32Ux8 <t> x y)
 10621  	// cond: !shiftIsBounded(v)
 10622  	// result: (MASKEQZ (SRL <t> x (ZeroExt8to64 y)) (SGTU (MOVVconst <typ.UInt64> [32]) (ZeroExt8to64 y)))
 10623  	for {
 10624  		t := v.Type
 10625  		x := v_0
 10626  		y := v_1
 10627  		if !(!shiftIsBounded(v)) {
 10628  			break
 10629  		}
 10630  		v.reset(OpLOONG64MASKEQZ)
 10631  		v0 := b.NewValue0(v.Pos, OpLOONG64SRL, t)
 10632  		v1 := b.NewValue0(v.Pos, OpZeroExt8to64, typ.UInt64)
 10633  		v1.AddArg(y)
 10634  		v0.AddArg2(x, v1)
 10635  		v2 := b.NewValue0(v.Pos, OpLOONG64SGTU, typ.Bool)
 10636  		v3 := b.NewValue0(v.Pos, OpLOONG64MOVVconst, typ.UInt64)
 10637  		v3.AuxInt = int64ToAuxInt(32)
 10638  		v2.AddArg2(v3, v1)
 10639  		v.AddArg2(v0, v2)
 10640  		return true
 10641  	}
 10642  	return false
 10643  }
 10644  func rewriteValueLOONG64_OpRsh32x16(v *Value) bool {
 10645  	v_1 := v.Args[1]
 10646  	v_0 := v.Args[0]
 10647  	b := v.Block
 10648  	typ := &b.Func.Config.Types
 10649  	// match: (Rsh32x16 x y)
 10650  	// cond: shiftIsBounded(v)
 10651  	// result: (SRA x y)
 10652  	for {
 10653  		x := v_0
 10654  		y := v_1
 10655  		if !(shiftIsBounded(v)) {
 10656  			break
 10657  		}
 10658  		v.reset(OpLOONG64SRA)
 10659  		v.AddArg2(x, y)
 10660  		return true
 10661  	}
 10662  	// match: (Rsh32x16 <t> x y)
 10663  	// cond: !shiftIsBounded(v)
 10664  	// result: (SRA x (OR <t> (NEGV <t> (SGTU (ZeroExt16to64 y) (MOVVconst <typ.UInt64> [31]))) (ZeroExt16to64 y)))
 10665  	for {
 10666  		t := v.Type
 10667  		x := v_0
 10668  		y := v_1
 10669  		if !(!shiftIsBounded(v)) {
 10670  			break
 10671  		}
 10672  		v.reset(OpLOONG64SRA)
 10673  		v0 := b.NewValue0(v.Pos, OpLOONG64OR, t)
 10674  		v1 := b.NewValue0(v.Pos, OpLOONG64NEGV, t)
 10675  		v2 := b.NewValue0(v.Pos, OpLOONG64SGTU, typ.Bool)
 10676  		v3 := b.NewValue0(v.Pos, OpZeroExt16to64, typ.UInt64)
 10677  		v3.AddArg(y)
 10678  		v4 := b.NewValue0(v.Pos, OpLOONG64MOVVconst, typ.UInt64)
 10679  		v4.AuxInt = int64ToAuxInt(31)
 10680  		v2.AddArg2(v3, v4)
 10681  		v1.AddArg(v2)
 10682  		v0.AddArg2(v1, v3)
 10683  		v.AddArg2(x, v0)
 10684  		return true
 10685  	}
 10686  	return false
 10687  }
 10688  func rewriteValueLOONG64_OpRsh32x32(v *Value) bool {
 10689  	v_1 := v.Args[1]
 10690  	v_0 := v.Args[0]
 10691  	b := v.Block
 10692  	typ := &b.Func.Config.Types
 10693  	// match: (Rsh32x32 x y)
 10694  	// cond: shiftIsBounded(v)
 10695  	// result: (SRA x y)
 10696  	for {
 10697  		x := v_0
 10698  		y := v_1
 10699  		if !(shiftIsBounded(v)) {
 10700  			break
 10701  		}
 10702  		v.reset(OpLOONG64SRA)
 10703  		v.AddArg2(x, y)
 10704  		return true
 10705  	}
 10706  	// match: (Rsh32x32 <t> x y)
 10707  	// cond: !shiftIsBounded(v)
 10708  	// result: (SRA x (OR <t> (NEGV <t> (SGTU (ZeroExt32to64 y) (MOVVconst <typ.UInt64> [31]))) (ZeroExt32to64 y)))
 10709  	for {
 10710  		t := v.Type
 10711  		x := v_0
 10712  		y := v_1
 10713  		if !(!shiftIsBounded(v)) {
 10714  			break
 10715  		}
 10716  		v.reset(OpLOONG64SRA)
 10717  		v0 := b.NewValue0(v.Pos, OpLOONG64OR, t)
 10718  		v1 := b.NewValue0(v.Pos, OpLOONG64NEGV, t)
 10719  		v2 := b.NewValue0(v.Pos, OpLOONG64SGTU, typ.Bool)
 10720  		v3 := b.NewValue0(v.Pos, OpZeroExt32to64, typ.UInt64)
 10721  		v3.AddArg(y)
 10722  		v4 := b.NewValue0(v.Pos, OpLOONG64MOVVconst, typ.UInt64)
 10723  		v4.AuxInt = int64ToAuxInt(31)
 10724  		v2.AddArg2(v3, v4)
 10725  		v1.AddArg(v2)
 10726  		v0.AddArg2(v1, v3)
 10727  		v.AddArg2(x, v0)
 10728  		return true
 10729  	}
 10730  	return false
 10731  }
 10732  func rewriteValueLOONG64_OpRsh32x64(v *Value) bool {
 10733  	v_1 := v.Args[1]
 10734  	v_0 := v.Args[0]
 10735  	b := v.Block
 10736  	typ := &b.Func.Config.Types
 10737  	// match: (Rsh32x64 x y)
 10738  	// cond: shiftIsBounded(v)
 10739  	// result: (SRA x y)
 10740  	for {
 10741  		x := v_0
 10742  		y := v_1
 10743  		if !(shiftIsBounded(v)) {
 10744  			break
 10745  		}
 10746  		v.reset(OpLOONG64SRA)
 10747  		v.AddArg2(x, y)
 10748  		return true
 10749  	}
 10750  	// match: (Rsh32x64 <t> x y)
 10751  	// cond: !shiftIsBounded(v)
 10752  	// result: (SRA x (OR <t> (NEGV <t> (SGTU y (MOVVconst <typ.UInt64> [31]))) y))
 10753  	for {
 10754  		t := v.Type
 10755  		x := v_0
 10756  		y := v_1
 10757  		if !(!shiftIsBounded(v)) {
 10758  			break
 10759  		}
 10760  		v.reset(OpLOONG64SRA)
 10761  		v0 := b.NewValue0(v.Pos, OpLOONG64OR, t)
 10762  		v1 := b.NewValue0(v.Pos, OpLOONG64NEGV, t)
 10763  		v2 := b.NewValue0(v.Pos, OpLOONG64SGTU, typ.Bool)
 10764  		v3 := b.NewValue0(v.Pos, OpLOONG64MOVVconst, typ.UInt64)
 10765  		v3.AuxInt = int64ToAuxInt(31)
 10766  		v2.AddArg2(y, v3)
 10767  		v1.AddArg(v2)
 10768  		v0.AddArg2(v1, y)
 10769  		v.AddArg2(x, v0)
 10770  		return true
 10771  	}
 10772  	return false
 10773  }
 10774  func rewriteValueLOONG64_OpRsh32x8(v *Value) bool {
 10775  	v_1 := v.Args[1]
 10776  	v_0 := v.Args[0]
 10777  	b := v.Block
 10778  	typ := &b.Func.Config.Types
 10779  	// match: (Rsh32x8 x y)
 10780  	// cond: shiftIsBounded(v)
 10781  	// result: (SRA x y)
 10782  	for {
 10783  		x := v_0
 10784  		y := v_1
 10785  		if !(shiftIsBounded(v)) {
 10786  			break
 10787  		}
 10788  		v.reset(OpLOONG64SRA)
 10789  		v.AddArg2(x, y)
 10790  		return true
 10791  	}
 10792  	// match: (Rsh32x8 <t> x y)
 10793  	// cond: !shiftIsBounded(v)
 10794  	// result: (SRA x (OR <t> (NEGV <t> (SGTU (ZeroExt8to64 y) (MOVVconst <typ.UInt64> [31]))) (ZeroExt8to64 y)))
 10795  	for {
 10796  		t := v.Type
 10797  		x := v_0
 10798  		y := v_1
 10799  		if !(!shiftIsBounded(v)) {
 10800  			break
 10801  		}
 10802  		v.reset(OpLOONG64SRA)
 10803  		v0 := b.NewValue0(v.Pos, OpLOONG64OR, t)
 10804  		v1 := b.NewValue0(v.Pos, OpLOONG64NEGV, t)
 10805  		v2 := b.NewValue0(v.Pos, OpLOONG64SGTU, typ.Bool)
 10806  		v3 := b.NewValue0(v.Pos, OpZeroExt8to64, typ.UInt64)
 10807  		v3.AddArg(y)
 10808  		v4 := b.NewValue0(v.Pos, OpLOONG64MOVVconst, typ.UInt64)
 10809  		v4.AuxInt = int64ToAuxInt(31)
 10810  		v2.AddArg2(v3, v4)
 10811  		v1.AddArg(v2)
 10812  		v0.AddArg2(v1, v3)
 10813  		v.AddArg2(x, v0)
 10814  		return true
 10815  	}
 10816  	return false
 10817  }
 10818  func rewriteValueLOONG64_OpRsh64Ux16(v *Value) bool {
 10819  	v_1 := v.Args[1]
 10820  	v_0 := v.Args[0]
 10821  	b := v.Block
 10822  	typ := &b.Func.Config.Types
 10823  	// match: (Rsh64Ux16 x y)
 10824  	// cond: shiftIsBounded(v)
 10825  	// result: (SRLV x y)
 10826  	for {
 10827  		x := v_0
 10828  		y := v_1
 10829  		if !(shiftIsBounded(v)) {
 10830  			break
 10831  		}
 10832  		v.reset(OpLOONG64SRLV)
 10833  		v.AddArg2(x, y)
 10834  		return true
 10835  	}
 10836  	// match: (Rsh64Ux16 <t> x y)
 10837  	// cond: !shiftIsBounded(v)
 10838  	// result: (MASKEQZ (SRLV <t> x (ZeroExt16to64 y)) (SGTU (MOVVconst <typ.UInt64> [64]) (ZeroExt16to64 y)))
 10839  	for {
 10840  		t := v.Type
 10841  		x := v_0
 10842  		y := v_1
 10843  		if !(!shiftIsBounded(v)) {
 10844  			break
 10845  		}
 10846  		v.reset(OpLOONG64MASKEQZ)
 10847  		v0 := b.NewValue0(v.Pos, OpLOONG64SRLV, t)
 10848  		v1 := b.NewValue0(v.Pos, OpZeroExt16to64, typ.UInt64)
 10849  		v1.AddArg(y)
 10850  		v0.AddArg2(x, v1)
 10851  		v2 := b.NewValue0(v.Pos, OpLOONG64SGTU, typ.Bool)
 10852  		v3 := b.NewValue0(v.Pos, OpLOONG64MOVVconst, typ.UInt64)
 10853  		v3.AuxInt = int64ToAuxInt(64)
 10854  		v2.AddArg2(v3, v1)
 10855  		v.AddArg2(v0, v2)
 10856  		return true
 10857  	}
 10858  	return false
 10859  }
 10860  func rewriteValueLOONG64_OpRsh64Ux32(v *Value) bool {
 10861  	v_1 := v.Args[1]
 10862  	v_0 := v.Args[0]
 10863  	b := v.Block
 10864  	typ := &b.Func.Config.Types
 10865  	// match: (Rsh64Ux32 x y)
 10866  	// cond: shiftIsBounded(v)
 10867  	// result: (SRLV x y)
 10868  	for {
 10869  		x := v_0
 10870  		y := v_1
 10871  		if !(shiftIsBounded(v)) {
 10872  			break
 10873  		}
 10874  		v.reset(OpLOONG64SRLV)
 10875  		v.AddArg2(x, y)
 10876  		return true
 10877  	}
 10878  	// match: (Rsh64Ux32 <t> x y)
 10879  	// cond: !shiftIsBounded(v)
 10880  	// result: (MASKEQZ (SRLV <t> x (ZeroExt32to64 y)) (SGTU (MOVVconst <typ.UInt64> [64]) (ZeroExt32to64 y)))
 10881  	for {
 10882  		t := v.Type
 10883  		x := v_0
 10884  		y := v_1
 10885  		if !(!shiftIsBounded(v)) {
 10886  			break
 10887  		}
 10888  		v.reset(OpLOONG64MASKEQZ)
 10889  		v0 := b.NewValue0(v.Pos, OpLOONG64SRLV, t)
 10890  		v1 := b.NewValue0(v.Pos, OpZeroExt32to64, typ.UInt64)
 10891  		v1.AddArg(y)
 10892  		v0.AddArg2(x, v1)
 10893  		v2 := b.NewValue0(v.Pos, OpLOONG64SGTU, typ.Bool)
 10894  		v3 := b.NewValue0(v.Pos, OpLOONG64MOVVconst, typ.UInt64)
 10895  		v3.AuxInt = int64ToAuxInt(64)
 10896  		v2.AddArg2(v3, v1)
 10897  		v.AddArg2(v0, v2)
 10898  		return true
 10899  	}
 10900  	return false
 10901  }
 10902  func rewriteValueLOONG64_OpRsh64Ux64(v *Value) bool {
 10903  	v_1 := v.Args[1]
 10904  	v_0 := v.Args[0]
 10905  	b := v.Block
 10906  	typ := &b.Func.Config.Types
 10907  	// match: (Rsh64Ux64 x y)
 10908  	// cond: shiftIsBounded(v)
 10909  	// result: (SRLV x y)
 10910  	for {
 10911  		x := v_0
 10912  		y := v_1
 10913  		if !(shiftIsBounded(v)) {
 10914  			break
 10915  		}
 10916  		v.reset(OpLOONG64SRLV)
 10917  		v.AddArg2(x, y)
 10918  		return true
 10919  	}
 10920  	// match: (Rsh64Ux64 <t> x y)
 10921  	// cond: !shiftIsBounded(v)
 10922  	// result: (MASKEQZ (SRLV <t> x y) (SGTU (MOVVconst <typ.UInt64> [64]) y))
 10923  	for {
 10924  		t := v.Type
 10925  		x := v_0
 10926  		y := v_1
 10927  		if !(!shiftIsBounded(v)) {
 10928  			break
 10929  		}
 10930  		v.reset(OpLOONG64MASKEQZ)
 10931  		v0 := b.NewValue0(v.Pos, OpLOONG64SRLV, t)
 10932  		v0.AddArg2(x, y)
 10933  		v1 := b.NewValue0(v.Pos, OpLOONG64SGTU, typ.Bool)
 10934  		v2 := b.NewValue0(v.Pos, OpLOONG64MOVVconst, typ.UInt64)
 10935  		v2.AuxInt = int64ToAuxInt(64)
 10936  		v1.AddArg2(v2, y)
 10937  		v.AddArg2(v0, v1)
 10938  		return true
 10939  	}
 10940  	return false
 10941  }
 10942  func rewriteValueLOONG64_OpRsh64Ux8(v *Value) bool {
 10943  	v_1 := v.Args[1]
 10944  	v_0 := v.Args[0]
 10945  	b := v.Block
 10946  	typ := &b.Func.Config.Types
 10947  	// match: (Rsh64Ux8 x y)
 10948  	// cond: shiftIsBounded(v)
 10949  	// result: (SRLV x y)
 10950  	for {
 10951  		x := v_0
 10952  		y := v_1
 10953  		if !(shiftIsBounded(v)) {
 10954  			break
 10955  		}
 10956  		v.reset(OpLOONG64SRLV)
 10957  		v.AddArg2(x, y)
 10958  		return true
 10959  	}
 10960  	// match: (Rsh64Ux8 <t> x y)
 10961  	// cond: !shiftIsBounded(v)
 10962  	// result: (MASKEQZ (SRLV <t> x (ZeroExt8to64 y)) (SGTU (MOVVconst <typ.UInt64> [64]) (ZeroExt8to64 y)))
 10963  	for {
 10964  		t := v.Type
 10965  		x := v_0
 10966  		y := v_1
 10967  		if !(!shiftIsBounded(v)) {
 10968  			break
 10969  		}
 10970  		v.reset(OpLOONG64MASKEQZ)
 10971  		v0 := b.NewValue0(v.Pos, OpLOONG64SRLV, t)
 10972  		v1 := b.NewValue0(v.Pos, OpZeroExt8to64, typ.UInt64)
 10973  		v1.AddArg(y)
 10974  		v0.AddArg2(x, v1)
 10975  		v2 := b.NewValue0(v.Pos, OpLOONG64SGTU, typ.Bool)
 10976  		v3 := b.NewValue0(v.Pos, OpLOONG64MOVVconst, typ.UInt64)
 10977  		v3.AuxInt = int64ToAuxInt(64)
 10978  		v2.AddArg2(v3, v1)
 10979  		v.AddArg2(v0, v2)
 10980  		return true
 10981  	}
 10982  	return false
 10983  }
 10984  func rewriteValueLOONG64_OpRsh64x16(v *Value) bool {
 10985  	v_1 := v.Args[1]
 10986  	v_0 := v.Args[0]
 10987  	b := v.Block
 10988  	typ := &b.Func.Config.Types
 10989  	// match: (Rsh64x16 x y)
 10990  	// cond: shiftIsBounded(v)
 10991  	// result: (SRAV x y)
 10992  	for {
 10993  		x := v_0
 10994  		y := v_1
 10995  		if !(shiftIsBounded(v)) {
 10996  			break
 10997  		}
 10998  		v.reset(OpLOONG64SRAV)
 10999  		v.AddArg2(x, y)
 11000  		return true
 11001  	}
 11002  	// match: (Rsh64x16 <t> x y)
 11003  	// cond: !shiftIsBounded(v)
 11004  	// result: (SRAV x (OR <t> (NEGV <t> (SGTU (ZeroExt16to64 y) (MOVVconst <typ.UInt64> [63]))) (ZeroExt16to64 y)))
 11005  	for {
 11006  		t := v.Type
 11007  		x := v_0
 11008  		y := v_1
 11009  		if !(!shiftIsBounded(v)) {
 11010  			break
 11011  		}
 11012  		v.reset(OpLOONG64SRAV)
 11013  		v0 := b.NewValue0(v.Pos, OpLOONG64OR, t)
 11014  		v1 := b.NewValue0(v.Pos, OpLOONG64NEGV, t)
 11015  		v2 := b.NewValue0(v.Pos, OpLOONG64SGTU, typ.Bool)
 11016  		v3 := b.NewValue0(v.Pos, OpZeroExt16to64, typ.UInt64)
 11017  		v3.AddArg(y)
 11018  		v4 := b.NewValue0(v.Pos, OpLOONG64MOVVconst, typ.UInt64)
 11019  		v4.AuxInt = int64ToAuxInt(63)
 11020  		v2.AddArg2(v3, v4)
 11021  		v1.AddArg(v2)
 11022  		v0.AddArg2(v1, v3)
 11023  		v.AddArg2(x, v0)
 11024  		return true
 11025  	}
 11026  	return false
 11027  }
 11028  func rewriteValueLOONG64_OpRsh64x32(v *Value) bool {
 11029  	v_1 := v.Args[1]
 11030  	v_0 := v.Args[0]
 11031  	b := v.Block
 11032  	typ := &b.Func.Config.Types
 11033  	// match: (Rsh64x32 x y)
 11034  	// cond: shiftIsBounded(v)
 11035  	// result: (SRAV x y)
 11036  	for {
 11037  		x := v_0
 11038  		y := v_1
 11039  		if !(shiftIsBounded(v)) {
 11040  			break
 11041  		}
 11042  		v.reset(OpLOONG64SRAV)
 11043  		v.AddArg2(x, y)
 11044  		return true
 11045  	}
 11046  	// match: (Rsh64x32 <t> x y)
 11047  	// cond: !shiftIsBounded(v)
 11048  	// result: (SRAV x (OR <t> (NEGV <t> (SGTU (ZeroExt32to64 y) (MOVVconst <typ.UInt64> [63]))) (ZeroExt32to64 y)))
 11049  	for {
 11050  		t := v.Type
 11051  		x := v_0
 11052  		y := v_1
 11053  		if !(!shiftIsBounded(v)) {
 11054  			break
 11055  		}
 11056  		v.reset(OpLOONG64SRAV)
 11057  		v0 := b.NewValue0(v.Pos, OpLOONG64OR, t)
 11058  		v1 := b.NewValue0(v.Pos, OpLOONG64NEGV, t)
 11059  		v2 := b.NewValue0(v.Pos, OpLOONG64SGTU, typ.Bool)
 11060  		v3 := b.NewValue0(v.Pos, OpZeroExt32to64, typ.UInt64)
 11061  		v3.AddArg(y)
 11062  		v4 := b.NewValue0(v.Pos, OpLOONG64MOVVconst, typ.UInt64)
 11063  		v4.AuxInt = int64ToAuxInt(63)
 11064  		v2.AddArg2(v3, v4)
 11065  		v1.AddArg(v2)
 11066  		v0.AddArg2(v1, v3)
 11067  		v.AddArg2(x, v0)
 11068  		return true
 11069  	}
 11070  	return false
 11071  }
 11072  func rewriteValueLOONG64_OpRsh64x64(v *Value) bool {
 11073  	v_1 := v.Args[1]
 11074  	v_0 := v.Args[0]
 11075  	b := v.Block
 11076  	typ := &b.Func.Config.Types
 11077  	// match: (Rsh64x64 x y)
 11078  	// cond: shiftIsBounded(v)
 11079  	// result: (SRAV x y)
 11080  	for {
 11081  		x := v_0
 11082  		y := v_1
 11083  		if !(shiftIsBounded(v)) {
 11084  			break
 11085  		}
 11086  		v.reset(OpLOONG64SRAV)
 11087  		v.AddArg2(x, y)
 11088  		return true
 11089  	}
 11090  	// match: (Rsh64x64 <t> x y)
 11091  	// cond: !shiftIsBounded(v)
 11092  	// result: (SRAV x (OR <t> (NEGV <t> (SGTU y (MOVVconst <typ.UInt64> [63]))) y))
 11093  	for {
 11094  		t := v.Type
 11095  		x := v_0
 11096  		y := v_1
 11097  		if !(!shiftIsBounded(v)) {
 11098  			break
 11099  		}
 11100  		v.reset(OpLOONG64SRAV)
 11101  		v0 := b.NewValue0(v.Pos, OpLOONG64OR, t)
 11102  		v1 := b.NewValue0(v.Pos, OpLOONG64NEGV, t)
 11103  		v2 := b.NewValue0(v.Pos, OpLOONG64SGTU, typ.Bool)
 11104  		v3 := b.NewValue0(v.Pos, OpLOONG64MOVVconst, typ.UInt64)
 11105  		v3.AuxInt = int64ToAuxInt(63)
 11106  		v2.AddArg2(y, v3)
 11107  		v1.AddArg(v2)
 11108  		v0.AddArg2(v1, y)
 11109  		v.AddArg2(x, v0)
 11110  		return true
 11111  	}
 11112  	return false
 11113  }
 11114  func rewriteValueLOONG64_OpRsh64x8(v *Value) bool {
 11115  	v_1 := v.Args[1]
 11116  	v_0 := v.Args[0]
 11117  	b := v.Block
 11118  	typ := &b.Func.Config.Types
 11119  	// match: (Rsh64x8 x y)
 11120  	// cond: shiftIsBounded(v)
 11121  	// result: (SRAV x y)
 11122  	for {
 11123  		x := v_0
 11124  		y := v_1
 11125  		if !(shiftIsBounded(v)) {
 11126  			break
 11127  		}
 11128  		v.reset(OpLOONG64SRAV)
 11129  		v.AddArg2(x, y)
 11130  		return true
 11131  	}
 11132  	// match: (Rsh64x8 <t> x y)
 11133  	// cond: !shiftIsBounded(v)
 11134  	// result: (SRAV x (OR <t> (NEGV <t> (SGTU (ZeroExt8to64 y) (MOVVconst <typ.UInt64> [63]))) (ZeroExt8to64 y)))
 11135  	for {
 11136  		t := v.Type
 11137  		x := v_0
 11138  		y := v_1
 11139  		if !(!shiftIsBounded(v)) {
 11140  			break
 11141  		}
 11142  		v.reset(OpLOONG64SRAV)
 11143  		v0 := b.NewValue0(v.Pos, OpLOONG64OR, t)
 11144  		v1 := b.NewValue0(v.Pos, OpLOONG64NEGV, t)
 11145  		v2 := b.NewValue0(v.Pos, OpLOONG64SGTU, typ.Bool)
 11146  		v3 := b.NewValue0(v.Pos, OpZeroExt8to64, typ.UInt64)
 11147  		v3.AddArg(y)
 11148  		v4 := b.NewValue0(v.Pos, OpLOONG64MOVVconst, typ.UInt64)
 11149  		v4.AuxInt = int64ToAuxInt(63)
 11150  		v2.AddArg2(v3, v4)
 11151  		v1.AddArg(v2)
 11152  		v0.AddArg2(v1, v3)
 11153  		v.AddArg2(x, v0)
 11154  		return true
 11155  	}
 11156  	return false
 11157  }
 11158  func rewriteValueLOONG64_OpRsh8Ux16(v *Value) bool {
 11159  	v_1 := v.Args[1]
 11160  	v_0 := v.Args[0]
 11161  	b := v.Block
 11162  	typ := &b.Func.Config.Types
 11163  	// match: (Rsh8Ux16 x y)
 11164  	// cond: shiftIsBounded(v)
 11165  	// result: (SRLV (ZeroExt8to64 x) y)
 11166  	for {
 11167  		x := v_0
 11168  		y := v_1
 11169  		if !(shiftIsBounded(v)) {
 11170  			break
 11171  		}
 11172  		v.reset(OpLOONG64SRLV)
 11173  		v0 := b.NewValue0(v.Pos, OpZeroExt8to64, typ.UInt64)
 11174  		v0.AddArg(x)
 11175  		v.AddArg2(v0, y)
 11176  		return true
 11177  	}
 11178  	// match: (Rsh8Ux16 <t> x y)
 11179  	// cond: !shiftIsBounded(v)
 11180  	// result: (MASKEQZ (SRLV <t> (ZeroExt8to64 x) (ZeroExt16to64 y)) (SGTU (MOVVconst <typ.UInt64> [64]) (ZeroExt16to64 y)))
 11181  	for {
 11182  		t := v.Type
 11183  		x := v_0
 11184  		y := v_1
 11185  		if !(!shiftIsBounded(v)) {
 11186  			break
 11187  		}
 11188  		v.reset(OpLOONG64MASKEQZ)
 11189  		v0 := b.NewValue0(v.Pos, OpLOONG64SRLV, t)
 11190  		v1 := b.NewValue0(v.Pos, OpZeroExt8to64, typ.UInt64)
 11191  		v1.AddArg(x)
 11192  		v2 := b.NewValue0(v.Pos, OpZeroExt16to64, typ.UInt64)
 11193  		v2.AddArg(y)
 11194  		v0.AddArg2(v1, v2)
 11195  		v3 := b.NewValue0(v.Pos, OpLOONG64SGTU, typ.Bool)
 11196  		v4 := b.NewValue0(v.Pos, OpLOONG64MOVVconst, typ.UInt64)
 11197  		v4.AuxInt = int64ToAuxInt(64)
 11198  		v3.AddArg2(v4, v2)
 11199  		v.AddArg2(v0, v3)
 11200  		return true
 11201  	}
 11202  	return false
 11203  }
 11204  func rewriteValueLOONG64_OpRsh8Ux32(v *Value) bool {
 11205  	v_1 := v.Args[1]
 11206  	v_0 := v.Args[0]
 11207  	b := v.Block
 11208  	typ := &b.Func.Config.Types
 11209  	// match: (Rsh8Ux32 x y)
 11210  	// cond: shiftIsBounded(v)
 11211  	// result: (SRLV (ZeroExt8to64 x) y)
 11212  	for {
 11213  		x := v_0
 11214  		y := v_1
 11215  		if !(shiftIsBounded(v)) {
 11216  			break
 11217  		}
 11218  		v.reset(OpLOONG64SRLV)
 11219  		v0 := b.NewValue0(v.Pos, OpZeroExt8to64, typ.UInt64)
 11220  		v0.AddArg(x)
 11221  		v.AddArg2(v0, y)
 11222  		return true
 11223  	}
 11224  	// match: (Rsh8Ux32 <t> x y)
 11225  	// cond: !shiftIsBounded(v)
 11226  	// result: (MASKEQZ (SRLV <t> (ZeroExt8to64 x) (ZeroExt32to64 y)) (SGTU (MOVVconst <typ.UInt64> [64]) (ZeroExt32to64 y)))
 11227  	for {
 11228  		t := v.Type
 11229  		x := v_0
 11230  		y := v_1
 11231  		if !(!shiftIsBounded(v)) {
 11232  			break
 11233  		}
 11234  		v.reset(OpLOONG64MASKEQZ)
 11235  		v0 := b.NewValue0(v.Pos, OpLOONG64SRLV, t)
 11236  		v1 := b.NewValue0(v.Pos, OpZeroExt8to64, typ.UInt64)
 11237  		v1.AddArg(x)
 11238  		v2 := b.NewValue0(v.Pos, OpZeroExt32to64, typ.UInt64)
 11239  		v2.AddArg(y)
 11240  		v0.AddArg2(v1, v2)
 11241  		v3 := b.NewValue0(v.Pos, OpLOONG64SGTU, typ.Bool)
 11242  		v4 := b.NewValue0(v.Pos, OpLOONG64MOVVconst, typ.UInt64)
 11243  		v4.AuxInt = int64ToAuxInt(64)
 11244  		v3.AddArg2(v4, v2)
 11245  		v.AddArg2(v0, v3)
 11246  		return true
 11247  	}
 11248  	return false
 11249  }
 11250  func rewriteValueLOONG64_OpRsh8Ux64(v *Value) bool {
 11251  	v_1 := v.Args[1]
 11252  	v_0 := v.Args[0]
 11253  	b := v.Block
 11254  	typ := &b.Func.Config.Types
 11255  	// match: (Rsh8Ux64 x y)
 11256  	// cond: shiftIsBounded(v)
 11257  	// result: (SRLV (ZeroExt8to64 x) y)
 11258  	for {
 11259  		x := v_0
 11260  		y := v_1
 11261  		if !(shiftIsBounded(v)) {
 11262  			break
 11263  		}
 11264  		v.reset(OpLOONG64SRLV)
 11265  		v0 := b.NewValue0(v.Pos, OpZeroExt8to64, typ.UInt64)
 11266  		v0.AddArg(x)
 11267  		v.AddArg2(v0, y)
 11268  		return true
 11269  	}
 11270  	// match: (Rsh8Ux64 <t> x y)
 11271  	// cond: !shiftIsBounded(v)
 11272  	// result: (MASKEQZ (SRLV <t> (ZeroExt8to64 x) y) (SGTU (MOVVconst <typ.UInt64> [64]) y))
 11273  	for {
 11274  		t := v.Type
 11275  		x := v_0
 11276  		y := v_1
 11277  		if !(!shiftIsBounded(v)) {
 11278  			break
 11279  		}
 11280  		v.reset(OpLOONG64MASKEQZ)
 11281  		v0 := b.NewValue0(v.Pos, OpLOONG64SRLV, t)
 11282  		v1 := b.NewValue0(v.Pos, OpZeroExt8to64, typ.UInt64)
 11283  		v1.AddArg(x)
 11284  		v0.AddArg2(v1, y)
 11285  		v2 := b.NewValue0(v.Pos, OpLOONG64SGTU, typ.Bool)
 11286  		v3 := b.NewValue0(v.Pos, OpLOONG64MOVVconst, typ.UInt64)
 11287  		v3.AuxInt = int64ToAuxInt(64)
 11288  		v2.AddArg2(v3, y)
 11289  		v.AddArg2(v0, v2)
 11290  		return true
 11291  	}
 11292  	return false
 11293  }
 11294  func rewriteValueLOONG64_OpRsh8Ux8(v *Value) bool {
 11295  	v_1 := v.Args[1]
 11296  	v_0 := v.Args[0]
 11297  	b := v.Block
 11298  	typ := &b.Func.Config.Types
 11299  	// match: (Rsh8Ux8 x y)
 11300  	// cond: shiftIsBounded(v)
 11301  	// result: (SRLV (ZeroExt8to64 x) y)
 11302  	for {
 11303  		x := v_0
 11304  		y := v_1
 11305  		if !(shiftIsBounded(v)) {
 11306  			break
 11307  		}
 11308  		v.reset(OpLOONG64SRLV)
 11309  		v0 := b.NewValue0(v.Pos, OpZeroExt8to64, typ.UInt64)
 11310  		v0.AddArg(x)
 11311  		v.AddArg2(v0, y)
 11312  		return true
 11313  	}
 11314  	// match: (Rsh8Ux8 <t> x y)
 11315  	// cond: !shiftIsBounded(v)
 11316  	// result: (MASKEQZ (SRLV <t> (ZeroExt8to64 x) (ZeroExt8to64 y)) (SGTU (MOVVconst <typ.UInt64> [64]) (ZeroExt8to64 y)))
 11317  	for {
 11318  		t := v.Type
 11319  		x := v_0
 11320  		y := v_1
 11321  		if !(!shiftIsBounded(v)) {
 11322  			break
 11323  		}
 11324  		v.reset(OpLOONG64MASKEQZ)
 11325  		v0 := b.NewValue0(v.Pos, OpLOONG64SRLV, t)
 11326  		v1 := b.NewValue0(v.Pos, OpZeroExt8to64, typ.UInt64)
 11327  		v1.AddArg(x)
 11328  		v2 := b.NewValue0(v.Pos, OpZeroExt8to64, typ.UInt64)
 11329  		v2.AddArg(y)
 11330  		v0.AddArg2(v1, v2)
 11331  		v3 := b.NewValue0(v.Pos, OpLOONG64SGTU, typ.Bool)
 11332  		v4 := b.NewValue0(v.Pos, OpLOONG64MOVVconst, typ.UInt64)
 11333  		v4.AuxInt = int64ToAuxInt(64)
 11334  		v3.AddArg2(v4, v2)
 11335  		v.AddArg2(v0, v3)
 11336  		return true
 11337  	}
 11338  	return false
 11339  }
 11340  func rewriteValueLOONG64_OpRsh8x16(v *Value) bool {
 11341  	v_1 := v.Args[1]
 11342  	v_0 := v.Args[0]
 11343  	b := v.Block
 11344  	typ := &b.Func.Config.Types
 11345  	// match: (Rsh8x16 x y)
 11346  	// cond: shiftIsBounded(v)
 11347  	// result: (SRAV (SignExt8to64 x) y)
 11348  	for {
 11349  		x := v_0
 11350  		y := v_1
 11351  		if !(shiftIsBounded(v)) {
 11352  			break
 11353  		}
 11354  		v.reset(OpLOONG64SRAV)
 11355  		v0 := b.NewValue0(v.Pos, OpSignExt8to64, typ.Int64)
 11356  		v0.AddArg(x)
 11357  		v.AddArg2(v0, y)
 11358  		return true
 11359  	}
 11360  	// match: (Rsh8x16 <t> x y)
 11361  	// cond: !shiftIsBounded(v)
 11362  	// result: (SRAV (SignExt8to64 x) (OR <t> (NEGV <t> (SGTU (ZeroExt16to64 y) (MOVVconst <typ.UInt64> [63]))) (ZeroExt16to64 y)))
 11363  	for {
 11364  		t := v.Type
 11365  		x := v_0
 11366  		y := v_1
 11367  		if !(!shiftIsBounded(v)) {
 11368  			break
 11369  		}
 11370  		v.reset(OpLOONG64SRAV)
 11371  		v0 := b.NewValue0(v.Pos, OpSignExt8to64, typ.Int64)
 11372  		v0.AddArg(x)
 11373  		v1 := b.NewValue0(v.Pos, OpLOONG64OR, t)
 11374  		v2 := b.NewValue0(v.Pos, OpLOONG64NEGV, t)
 11375  		v3 := b.NewValue0(v.Pos, OpLOONG64SGTU, typ.Bool)
 11376  		v4 := b.NewValue0(v.Pos, OpZeroExt16to64, typ.UInt64)
 11377  		v4.AddArg(y)
 11378  		v5 := b.NewValue0(v.Pos, OpLOONG64MOVVconst, typ.UInt64)
 11379  		v5.AuxInt = int64ToAuxInt(63)
 11380  		v3.AddArg2(v4, v5)
 11381  		v2.AddArg(v3)
 11382  		v1.AddArg2(v2, v4)
 11383  		v.AddArg2(v0, v1)
 11384  		return true
 11385  	}
 11386  	return false
 11387  }
 11388  func rewriteValueLOONG64_OpRsh8x32(v *Value) bool {
 11389  	v_1 := v.Args[1]
 11390  	v_0 := v.Args[0]
 11391  	b := v.Block
 11392  	typ := &b.Func.Config.Types
 11393  	// match: (Rsh8x32 x y)
 11394  	// cond: shiftIsBounded(v)
 11395  	// result: (SRAV (SignExt8to64 x) y)
 11396  	for {
 11397  		x := v_0
 11398  		y := v_1
 11399  		if !(shiftIsBounded(v)) {
 11400  			break
 11401  		}
 11402  		v.reset(OpLOONG64SRAV)
 11403  		v0 := b.NewValue0(v.Pos, OpSignExt8to64, typ.Int64)
 11404  		v0.AddArg(x)
 11405  		v.AddArg2(v0, y)
 11406  		return true
 11407  	}
 11408  	// match: (Rsh8x32 <t> x y)
 11409  	// cond: !shiftIsBounded(v)
 11410  	// result: (SRAV (SignExt8to64 x) (OR <t> (NEGV <t> (SGTU (ZeroExt32to64 y) (MOVVconst <typ.UInt64> [63]))) (ZeroExt32to64 y)))
 11411  	for {
 11412  		t := v.Type
 11413  		x := v_0
 11414  		y := v_1
 11415  		if !(!shiftIsBounded(v)) {
 11416  			break
 11417  		}
 11418  		v.reset(OpLOONG64SRAV)
 11419  		v0 := b.NewValue0(v.Pos, OpSignExt8to64, typ.Int64)
 11420  		v0.AddArg(x)
 11421  		v1 := b.NewValue0(v.Pos, OpLOONG64OR, t)
 11422  		v2 := b.NewValue0(v.Pos, OpLOONG64NEGV, t)
 11423  		v3 := b.NewValue0(v.Pos, OpLOONG64SGTU, typ.Bool)
 11424  		v4 := b.NewValue0(v.Pos, OpZeroExt32to64, typ.UInt64)
 11425  		v4.AddArg(y)
 11426  		v5 := b.NewValue0(v.Pos, OpLOONG64MOVVconst, typ.UInt64)
 11427  		v5.AuxInt = int64ToAuxInt(63)
 11428  		v3.AddArg2(v4, v5)
 11429  		v2.AddArg(v3)
 11430  		v1.AddArg2(v2, v4)
 11431  		v.AddArg2(v0, v1)
 11432  		return true
 11433  	}
 11434  	return false
 11435  }
 11436  func rewriteValueLOONG64_OpRsh8x64(v *Value) bool {
 11437  	v_1 := v.Args[1]
 11438  	v_0 := v.Args[0]
 11439  	b := v.Block
 11440  	typ := &b.Func.Config.Types
 11441  	// match: (Rsh8x64 x y)
 11442  	// cond: shiftIsBounded(v)
 11443  	// result: (SRAV (SignExt8to64 x) y)
 11444  	for {
 11445  		x := v_0
 11446  		y := v_1
 11447  		if !(shiftIsBounded(v)) {
 11448  			break
 11449  		}
 11450  		v.reset(OpLOONG64SRAV)
 11451  		v0 := b.NewValue0(v.Pos, OpSignExt8to64, typ.Int64)
 11452  		v0.AddArg(x)
 11453  		v.AddArg2(v0, y)
 11454  		return true
 11455  	}
 11456  	// match: (Rsh8x64 <t> x y)
 11457  	// cond: !shiftIsBounded(v)
 11458  	// result: (SRAV (SignExt8to64 x) (OR <t> (NEGV <t> (SGTU y (MOVVconst <typ.UInt64> [63]))) y))
 11459  	for {
 11460  		t := v.Type
 11461  		x := v_0
 11462  		y := v_1
 11463  		if !(!shiftIsBounded(v)) {
 11464  			break
 11465  		}
 11466  		v.reset(OpLOONG64SRAV)
 11467  		v0 := b.NewValue0(v.Pos, OpSignExt8to64, typ.Int64)
 11468  		v0.AddArg(x)
 11469  		v1 := b.NewValue0(v.Pos, OpLOONG64OR, t)
 11470  		v2 := b.NewValue0(v.Pos, OpLOONG64NEGV, t)
 11471  		v3 := b.NewValue0(v.Pos, OpLOONG64SGTU, typ.Bool)
 11472  		v4 := b.NewValue0(v.Pos, OpLOONG64MOVVconst, typ.UInt64)
 11473  		v4.AuxInt = int64ToAuxInt(63)
 11474  		v3.AddArg2(y, v4)
 11475  		v2.AddArg(v3)
 11476  		v1.AddArg2(v2, y)
 11477  		v.AddArg2(v0, v1)
 11478  		return true
 11479  	}
 11480  	return false
 11481  }
 11482  func rewriteValueLOONG64_OpRsh8x8(v *Value) bool {
 11483  	v_1 := v.Args[1]
 11484  	v_0 := v.Args[0]
 11485  	b := v.Block
 11486  	typ := &b.Func.Config.Types
 11487  	// match: (Rsh8x8 x y)
 11488  	// cond: shiftIsBounded(v)
 11489  	// result: (SRAV (SignExt8to64 x) y)
 11490  	for {
 11491  		x := v_0
 11492  		y := v_1
 11493  		if !(shiftIsBounded(v)) {
 11494  			break
 11495  		}
 11496  		v.reset(OpLOONG64SRAV)
 11497  		v0 := b.NewValue0(v.Pos, OpSignExt8to64, typ.Int64)
 11498  		v0.AddArg(x)
 11499  		v.AddArg2(v0, y)
 11500  		return true
 11501  	}
 11502  	// match: (Rsh8x8 <t> x y)
 11503  	// cond: !shiftIsBounded(v)
 11504  	// result: (SRAV (SignExt8to64 x) (OR <t> (NEGV <t> (SGTU (ZeroExt8to64 y) (MOVVconst <typ.UInt64> [63]))) (ZeroExt8to64 y)))
 11505  	for {
 11506  		t := v.Type
 11507  		x := v_0
 11508  		y := v_1
 11509  		if !(!shiftIsBounded(v)) {
 11510  			break
 11511  		}
 11512  		v.reset(OpLOONG64SRAV)
 11513  		v0 := b.NewValue0(v.Pos, OpSignExt8to64, typ.Int64)
 11514  		v0.AddArg(x)
 11515  		v1 := b.NewValue0(v.Pos, OpLOONG64OR, t)
 11516  		v2 := b.NewValue0(v.Pos, OpLOONG64NEGV, t)
 11517  		v3 := b.NewValue0(v.Pos, OpLOONG64SGTU, typ.Bool)
 11518  		v4 := b.NewValue0(v.Pos, OpZeroExt8to64, typ.UInt64)
 11519  		v4.AddArg(y)
 11520  		v5 := b.NewValue0(v.Pos, OpLOONG64MOVVconst, typ.UInt64)
 11521  		v5.AuxInt = int64ToAuxInt(63)
 11522  		v3.AddArg2(v4, v5)
 11523  		v2.AddArg(v3)
 11524  		v1.AddArg2(v2, v4)
 11525  		v.AddArg2(v0, v1)
 11526  		return true
 11527  	}
 11528  	return false
 11529  }
 11530  func rewriteValueLOONG64_OpSelect0(v *Value) bool {
 11531  	v_0 := v.Args[0]
 11532  	b := v.Block
 11533  	// match: (Select0 (Mul64uhilo x y))
 11534  	// result: (MULHVU x y)
 11535  	for {
 11536  		if v_0.Op != OpMul64uhilo {
 11537  			break
 11538  		}
 11539  		y := v_0.Args[1]
 11540  		x := v_0.Args[0]
 11541  		v.reset(OpLOONG64MULHVU)
 11542  		v.AddArg2(x, y)
 11543  		return true
 11544  	}
 11545  	// match: (Select0 (Mul64uover x y))
 11546  	// result: (MULV x y)
 11547  	for {
 11548  		if v_0.Op != OpMul64uover {
 11549  			break
 11550  		}
 11551  		y := v_0.Args[1]
 11552  		x := v_0.Args[0]
 11553  		v.reset(OpLOONG64MULV)
 11554  		v.AddArg2(x, y)
 11555  		return true
 11556  	}
 11557  	// match: (Select0 <t> (Add64carry x y c))
 11558  	// result: (ADDV (ADDV <t> x y) c)
 11559  	for {
 11560  		t := v.Type
 11561  		if v_0.Op != OpAdd64carry {
 11562  			break
 11563  		}
 11564  		c := v_0.Args[2]
 11565  		x := v_0.Args[0]
 11566  		y := v_0.Args[1]
 11567  		v.reset(OpLOONG64ADDV)
 11568  		v0 := b.NewValue0(v.Pos, OpLOONG64ADDV, t)
 11569  		v0.AddArg2(x, y)
 11570  		v.AddArg2(v0, c)
 11571  		return true
 11572  	}
 11573  	// match: (Select0 <t> (Sub64borrow x y c))
 11574  	// result: (SUBV (SUBV <t> x y) c)
 11575  	for {
 11576  		t := v.Type
 11577  		if v_0.Op != OpSub64borrow {
 11578  			break
 11579  		}
 11580  		c := v_0.Args[2]
 11581  		x := v_0.Args[0]
 11582  		y := v_0.Args[1]
 11583  		v.reset(OpLOONG64SUBV)
 11584  		v0 := b.NewValue0(v.Pos, OpLOONG64SUBV, t)
 11585  		v0.AddArg2(x, y)
 11586  		v.AddArg2(v0, c)
 11587  		return true
 11588  	}
 11589  	return false
 11590  }
 11591  func rewriteValueLOONG64_OpSelect1(v *Value) bool {
 11592  	v_0 := v.Args[0]
 11593  	b := v.Block
 11594  	typ := &b.Func.Config.Types
 11595  	// match: (Select1 (Mul64uhilo x y))
 11596  	// result: (MULV x y)
 11597  	for {
 11598  		if v_0.Op != OpMul64uhilo {
 11599  			break
 11600  		}
 11601  		y := v_0.Args[1]
 11602  		x := v_0.Args[0]
 11603  		v.reset(OpLOONG64MULV)
 11604  		v.AddArg2(x, y)
 11605  		return true
 11606  	}
 11607  	// match: (Select1 (Mul64uover x y))
 11608  	// result: (SGTU <typ.Bool> (MULHVU x y) (MOVVconst <typ.UInt64> [0]))
 11609  	for {
 11610  		if v_0.Op != OpMul64uover {
 11611  			break
 11612  		}
 11613  		y := v_0.Args[1]
 11614  		x := v_0.Args[0]
 11615  		v.reset(OpLOONG64SGTU)
 11616  		v.Type = typ.Bool
 11617  		v0 := b.NewValue0(v.Pos, OpLOONG64MULHVU, typ.UInt64)
 11618  		v0.AddArg2(x, y)
 11619  		v1 := b.NewValue0(v.Pos, OpLOONG64MOVVconst, typ.UInt64)
 11620  		v1.AuxInt = int64ToAuxInt(0)
 11621  		v.AddArg2(v0, v1)
 11622  		return true
 11623  	}
 11624  	// match: (Select1 <t> (Add64carry x y c))
 11625  	// result: (OR (SGTU <t> x s:(ADDV <t> x y)) (SGTU <t> s (ADDV <t> s c)))
 11626  	for {
 11627  		t := v.Type
 11628  		if v_0.Op != OpAdd64carry {
 11629  			break
 11630  		}
 11631  		c := v_0.Args[2]
 11632  		x := v_0.Args[0]
 11633  		y := v_0.Args[1]
 11634  		v.reset(OpLOONG64OR)
 11635  		v0 := b.NewValue0(v.Pos, OpLOONG64SGTU, t)
 11636  		s := b.NewValue0(v.Pos, OpLOONG64ADDV, t)
 11637  		s.AddArg2(x, y)
 11638  		v0.AddArg2(x, s)
 11639  		v2 := b.NewValue0(v.Pos, OpLOONG64SGTU, t)
 11640  		v3 := b.NewValue0(v.Pos, OpLOONG64ADDV, t)
 11641  		v3.AddArg2(s, c)
 11642  		v2.AddArg2(s, v3)
 11643  		v.AddArg2(v0, v2)
 11644  		return true
 11645  	}
 11646  	// match: (Select1 <t> (Sub64borrow x y c))
 11647  	// result: (OR (SGTU <t> s:(SUBV <t> x y) x) (SGTU <t> (SUBV <t> s c) s))
 11648  	for {
 11649  		t := v.Type
 11650  		if v_0.Op != OpSub64borrow {
 11651  			break
 11652  		}
 11653  		c := v_0.Args[2]
 11654  		x := v_0.Args[0]
 11655  		y := v_0.Args[1]
 11656  		v.reset(OpLOONG64OR)
 11657  		v0 := b.NewValue0(v.Pos, OpLOONG64SGTU, t)
 11658  		s := b.NewValue0(v.Pos, OpLOONG64SUBV, t)
 11659  		s.AddArg2(x, y)
 11660  		v0.AddArg2(s, x)
 11661  		v2 := b.NewValue0(v.Pos, OpLOONG64SGTU, t)
 11662  		v3 := b.NewValue0(v.Pos, OpLOONG64SUBV, t)
 11663  		v3.AddArg2(s, c)
 11664  		v2.AddArg2(v3, s)
 11665  		v.AddArg2(v0, v2)
 11666  		return true
 11667  	}
 11668  	return false
 11669  }
 11670  func rewriteValueLOONG64_OpSelectN(v *Value) bool {
 11671  	v_0 := v.Args[0]
 11672  	b := v.Block
 11673  	config := b.Func.Config
 11674  	// match: (SelectN [0] call:(CALLstatic {sym} dst src (MOVVconst [sz]) mem))
 11675  	// cond: sz >= 0 && isSameCall(sym, "runtime.memmove") && call.Uses == 1 && isInlinableMemmove(dst, src, sz, config) && clobber(call)
 11676  	// result: (Move [sz] dst src mem)
 11677  	for {
 11678  		if auxIntToInt64(v.AuxInt) != 0 {
 11679  			break
 11680  		}
 11681  		call := v_0
 11682  		if call.Op != OpLOONG64CALLstatic || len(call.Args) != 4 {
 11683  			break
 11684  		}
 11685  		sym := auxToCall(call.Aux)
 11686  		mem := call.Args[3]
 11687  		dst := call.Args[0]
 11688  		src := call.Args[1]
 11689  		call_2 := call.Args[2]
 11690  		if call_2.Op != OpLOONG64MOVVconst {
 11691  			break
 11692  		}
 11693  		sz := auxIntToInt64(call_2.AuxInt)
 11694  		if !(sz >= 0 && isSameCall(sym, "runtime.memmove") && call.Uses == 1 && isInlinableMemmove(dst, src, sz, config) && clobber(call)) {
 11695  			break
 11696  		}
 11697  		v.reset(OpMove)
 11698  		v.AuxInt = int64ToAuxInt(sz)
 11699  		v.AddArg3(dst, src, mem)
 11700  		return true
 11701  	}
 11702  	return false
 11703  }
 11704  func rewriteValueLOONG64_OpSlicemask(v *Value) bool {
 11705  	v_0 := v.Args[0]
 11706  	b := v.Block
 11707  	// match: (Slicemask <t> x)
 11708  	// result: (SRAVconst (NEGV <t> x) [63])
 11709  	for {
 11710  		t := v.Type
 11711  		x := v_0
 11712  		v.reset(OpLOONG64SRAVconst)
 11713  		v.AuxInt = int64ToAuxInt(63)
 11714  		v0 := b.NewValue0(v.Pos, OpLOONG64NEGV, t)
 11715  		v0.AddArg(x)
 11716  		v.AddArg(v0)
 11717  		return true
 11718  	}
 11719  }
 11720  func rewriteValueLOONG64_OpStore(v *Value) bool {
 11721  	v_2 := v.Args[2]
 11722  	v_1 := v.Args[1]
 11723  	v_0 := v.Args[0]
 11724  	// match: (Store {t} ptr val mem)
 11725  	// cond: t.Size() == 1
 11726  	// result: (MOVBstore ptr val mem)
 11727  	for {
 11728  		t := auxToType(v.Aux)
 11729  		ptr := v_0
 11730  		val := v_1
 11731  		mem := v_2
 11732  		if !(t.Size() == 1) {
 11733  			break
 11734  		}
 11735  		v.reset(OpLOONG64MOVBstore)
 11736  		v.AddArg3(ptr, val, mem)
 11737  		return true
 11738  	}
 11739  	// match: (Store {t} ptr val mem)
 11740  	// cond: t.Size() == 2
 11741  	// result: (MOVHstore ptr val mem)
 11742  	for {
 11743  		t := auxToType(v.Aux)
 11744  		ptr := v_0
 11745  		val := v_1
 11746  		mem := v_2
 11747  		if !(t.Size() == 2) {
 11748  			break
 11749  		}
 11750  		v.reset(OpLOONG64MOVHstore)
 11751  		v.AddArg3(ptr, val, mem)
 11752  		return true
 11753  	}
 11754  	// match: (Store {t} ptr val mem)
 11755  	// cond: t.Size() == 4 && !t.IsFloat()
 11756  	// result: (MOVWstore ptr val mem)
 11757  	for {
 11758  		t := auxToType(v.Aux)
 11759  		ptr := v_0
 11760  		val := v_1
 11761  		mem := v_2
 11762  		if !(t.Size() == 4 && !t.IsFloat()) {
 11763  			break
 11764  		}
 11765  		v.reset(OpLOONG64MOVWstore)
 11766  		v.AddArg3(ptr, val, mem)
 11767  		return true
 11768  	}
 11769  	// match: (Store {t} ptr val mem)
 11770  	// cond: t.Size() == 8 && !t.IsFloat()
 11771  	// result: (MOVVstore ptr val mem)
 11772  	for {
 11773  		t := auxToType(v.Aux)
 11774  		ptr := v_0
 11775  		val := v_1
 11776  		mem := v_2
 11777  		if !(t.Size() == 8 && !t.IsFloat()) {
 11778  			break
 11779  		}
 11780  		v.reset(OpLOONG64MOVVstore)
 11781  		v.AddArg3(ptr, val, mem)
 11782  		return true
 11783  	}
 11784  	// match: (Store {t} ptr val mem)
 11785  	// cond: t.Size() == 4 && t.IsFloat()
 11786  	// result: (MOVFstore ptr val mem)
 11787  	for {
 11788  		t := auxToType(v.Aux)
 11789  		ptr := v_0
 11790  		val := v_1
 11791  		mem := v_2
 11792  		if !(t.Size() == 4 && t.IsFloat()) {
 11793  			break
 11794  		}
 11795  		v.reset(OpLOONG64MOVFstore)
 11796  		v.AddArg3(ptr, val, mem)
 11797  		return true
 11798  	}
 11799  	// match: (Store {t} ptr val mem)
 11800  	// cond: t.Size() == 8 && t.IsFloat()
 11801  	// result: (MOVDstore ptr val mem)
 11802  	for {
 11803  		t := auxToType(v.Aux)
 11804  		ptr := v_0
 11805  		val := v_1
 11806  		mem := v_2
 11807  		if !(t.Size() == 8 && t.IsFloat()) {
 11808  			break
 11809  		}
 11810  		v.reset(OpLOONG64MOVDstore)
 11811  		v.AddArg3(ptr, val, mem)
 11812  		return true
 11813  	}
 11814  	return false
 11815  }
 11816  func rewriteValueLOONG64_OpZero(v *Value) bool {
 11817  	v_1 := v.Args[1]
 11818  	v_0 := v.Args[0]
 11819  	b := v.Block
 11820  	typ := &b.Func.Config.Types
 11821  	// match: (Zero [0] _ mem)
 11822  	// result: mem
 11823  	for {
 11824  		if auxIntToInt64(v.AuxInt) != 0 {
 11825  			break
 11826  		}
 11827  		mem := v_1
 11828  		v.copyOf(mem)
 11829  		return true
 11830  	}
 11831  	// match: (Zero [1] ptr mem)
 11832  	// result: (MOVBstore ptr (MOVVconst [0]) mem)
 11833  	for {
 11834  		if auxIntToInt64(v.AuxInt) != 1 {
 11835  			break
 11836  		}
 11837  		ptr := v_0
 11838  		mem := v_1
 11839  		v.reset(OpLOONG64MOVBstore)
 11840  		v0 := b.NewValue0(v.Pos, OpLOONG64MOVVconst, typ.UInt64)
 11841  		v0.AuxInt = int64ToAuxInt(0)
 11842  		v.AddArg3(ptr, v0, mem)
 11843  		return true
 11844  	}
 11845  	// match: (Zero [2] ptr mem)
 11846  	// result: (MOVHstore ptr (MOVVconst [0]) mem)
 11847  	for {
 11848  		if auxIntToInt64(v.AuxInt) != 2 {
 11849  			break
 11850  		}
 11851  		ptr := v_0
 11852  		mem := v_1
 11853  		v.reset(OpLOONG64MOVHstore)
 11854  		v0 := b.NewValue0(v.Pos, OpLOONG64MOVVconst, typ.UInt64)
 11855  		v0.AuxInt = int64ToAuxInt(0)
 11856  		v.AddArg3(ptr, v0, mem)
 11857  		return true
 11858  	}
 11859  	// match: (Zero [3] ptr mem)
 11860  	// result: (MOVBstore [2] ptr (MOVVconst [0]) (MOVHstore ptr (MOVVconst [0]) mem))
 11861  	for {
 11862  		if auxIntToInt64(v.AuxInt) != 3 {
 11863  			break
 11864  		}
 11865  		ptr := v_0
 11866  		mem := v_1
 11867  		v.reset(OpLOONG64MOVBstore)
 11868  		v.AuxInt = int32ToAuxInt(2)
 11869  		v0 := b.NewValue0(v.Pos, OpLOONG64MOVVconst, typ.UInt64)
 11870  		v0.AuxInt = int64ToAuxInt(0)
 11871  		v1 := b.NewValue0(v.Pos, OpLOONG64MOVHstore, types.TypeMem)
 11872  		v1.AddArg3(ptr, v0, mem)
 11873  		v.AddArg3(ptr, v0, v1)
 11874  		return true
 11875  	}
 11876  	// match: (Zero [4] {t} ptr mem)
 11877  	// result: (MOVWstore ptr (MOVVconst [0]) mem)
 11878  	for {
 11879  		if auxIntToInt64(v.AuxInt) != 4 {
 11880  			break
 11881  		}
 11882  		ptr := v_0
 11883  		mem := v_1
 11884  		v.reset(OpLOONG64MOVWstore)
 11885  		v0 := b.NewValue0(v.Pos, OpLOONG64MOVVconst, typ.UInt64)
 11886  		v0.AuxInt = int64ToAuxInt(0)
 11887  		v.AddArg3(ptr, v0, mem)
 11888  		return true
 11889  	}
 11890  	// match: (Zero [5] ptr mem)
 11891  	// result: (MOVBstore [4] ptr (MOVVconst [0]) (MOVWstore ptr (MOVVconst [0]) mem))
 11892  	for {
 11893  		if auxIntToInt64(v.AuxInt) != 5 {
 11894  			break
 11895  		}
 11896  		ptr := v_0
 11897  		mem := v_1
 11898  		v.reset(OpLOONG64MOVBstore)
 11899  		v.AuxInt = int32ToAuxInt(4)
 11900  		v0 := b.NewValue0(v.Pos, OpLOONG64MOVVconst, typ.UInt64)
 11901  		v0.AuxInt = int64ToAuxInt(0)
 11902  		v1 := b.NewValue0(v.Pos, OpLOONG64MOVWstore, types.TypeMem)
 11903  		v1.AddArg3(ptr, v0, mem)
 11904  		v.AddArg3(ptr, v0, v1)
 11905  		return true
 11906  	}
 11907  	// match: (Zero [6] ptr mem)
 11908  	// result: (MOVHstore [4] ptr (MOVVconst [0]) (MOVWstore ptr (MOVVconst [0]) mem))
 11909  	for {
 11910  		if auxIntToInt64(v.AuxInt) != 6 {
 11911  			break
 11912  		}
 11913  		ptr := v_0
 11914  		mem := v_1
 11915  		v.reset(OpLOONG64MOVHstore)
 11916  		v.AuxInt = int32ToAuxInt(4)
 11917  		v0 := b.NewValue0(v.Pos, OpLOONG64MOVVconst, typ.UInt64)
 11918  		v0.AuxInt = int64ToAuxInt(0)
 11919  		v1 := b.NewValue0(v.Pos, OpLOONG64MOVWstore, types.TypeMem)
 11920  		v1.AddArg3(ptr, v0, mem)
 11921  		v.AddArg3(ptr, v0, v1)
 11922  		return true
 11923  	}
 11924  	// match: (Zero [7] ptr mem)
 11925  	// result: (MOVWstore [3] ptr (MOVVconst [0]) (MOVWstore ptr (MOVVconst [0]) mem))
 11926  	for {
 11927  		if auxIntToInt64(v.AuxInt) != 7 {
 11928  			break
 11929  		}
 11930  		ptr := v_0
 11931  		mem := v_1
 11932  		v.reset(OpLOONG64MOVWstore)
 11933  		v.AuxInt = int32ToAuxInt(3)
 11934  		v0 := b.NewValue0(v.Pos, OpLOONG64MOVVconst, typ.UInt64)
 11935  		v0.AuxInt = int64ToAuxInt(0)
 11936  		v1 := b.NewValue0(v.Pos, OpLOONG64MOVWstore, types.TypeMem)
 11937  		v1.AddArg3(ptr, v0, mem)
 11938  		v.AddArg3(ptr, v0, v1)
 11939  		return true
 11940  	}
 11941  	// match: (Zero [8] {t} ptr mem)
 11942  	// result: (MOVVstore ptr (MOVVconst [0]) mem)
 11943  	for {
 11944  		if auxIntToInt64(v.AuxInt) != 8 {
 11945  			break
 11946  		}
 11947  		ptr := v_0
 11948  		mem := v_1
 11949  		v.reset(OpLOONG64MOVVstore)
 11950  		v0 := b.NewValue0(v.Pos, OpLOONG64MOVVconst, typ.UInt64)
 11951  		v0.AuxInt = int64ToAuxInt(0)
 11952  		v.AddArg3(ptr, v0, mem)
 11953  		return true
 11954  	}
 11955  	// match: (Zero [9] ptr mem)
 11956  	// result: (MOVBstore [8] ptr (MOVVconst [0]) (MOVVstore ptr (MOVVconst [0]) mem))
 11957  	for {
 11958  		if auxIntToInt64(v.AuxInt) != 9 {
 11959  			break
 11960  		}
 11961  		ptr := v_0
 11962  		mem := v_1
 11963  		v.reset(OpLOONG64MOVBstore)
 11964  		v.AuxInt = int32ToAuxInt(8)
 11965  		v0 := b.NewValue0(v.Pos, OpLOONG64MOVVconst, typ.UInt64)
 11966  		v0.AuxInt = int64ToAuxInt(0)
 11967  		v1 := b.NewValue0(v.Pos, OpLOONG64MOVVstore, types.TypeMem)
 11968  		v1.AddArg3(ptr, v0, mem)
 11969  		v.AddArg3(ptr, v0, v1)
 11970  		return true
 11971  	}
 11972  	// match: (Zero [10] ptr mem)
 11973  	// result: (MOVHstore [8] ptr (MOVVconst [0]) (MOVVstore ptr (MOVVconst [0]) mem))
 11974  	for {
 11975  		if auxIntToInt64(v.AuxInt) != 10 {
 11976  			break
 11977  		}
 11978  		ptr := v_0
 11979  		mem := v_1
 11980  		v.reset(OpLOONG64MOVHstore)
 11981  		v.AuxInt = int32ToAuxInt(8)
 11982  		v0 := b.NewValue0(v.Pos, OpLOONG64MOVVconst, typ.UInt64)
 11983  		v0.AuxInt = int64ToAuxInt(0)
 11984  		v1 := b.NewValue0(v.Pos, OpLOONG64MOVVstore, types.TypeMem)
 11985  		v1.AddArg3(ptr, v0, mem)
 11986  		v.AddArg3(ptr, v0, v1)
 11987  		return true
 11988  	}
 11989  	// match: (Zero [11] ptr mem)
 11990  	// result: (MOVWstore [7] ptr (MOVVconst [0]) (MOVVstore ptr (MOVVconst [0]) mem))
 11991  	for {
 11992  		if auxIntToInt64(v.AuxInt) != 11 {
 11993  			break
 11994  		}
 11995  		ptr := v_0
 11996  		mem := v_1
 11997  		v.reset(OpLOONG64MOVWstore)
 11998  		v.AuxInt = int32ToAuxInt(7)
 11999  		v0 := b.NewValue0(v.Pos, OpLOONG64MOVVconst, typ.UInt64)
 12000  		v0.AuxInt = int64ToAuxInt(0)
 12001  		v1 := b.NewValue0(v.Pos, OpLOONG64MOVVstore, types.TypeMem)
 12002  		v1.AddArg3(ptr, v0, mem)
 12003  		v.AddArg3(ptr, v0, v1)
 12004  		return true
 12005  	}
 12006  	// match: (Zero [12] ptr mem)
 12007  	// result: (MOVWstore [8] ptr (MOVVconst [0]) (MOVVstore ptr (MOVVconst [0]) mem))
 12008  	for {
 12009  		if auxIntToInt64(v.AuxInt) != 12 {
 12010  			break
 12011  		}
 12012  		ptr := v_0
 12013  		mem := v_1
 12014  		v.reset(OpLOONG64MOVWstore)
 12015  		v.AuxInt = int32ToAuxInt(8)
 12016  		v0 := b.NewValue0(v.Pos, OpLOONG64MOVVconst, typ.UInt64)
 12017  		v0.AuxInt = int64ToAuxInt(0)
 12018  		v1 := b.NewValue0(v.Pos, OpLOONG64MOVVstore, types.TypeMem)
 12019  		v1.AddArg3(ptr, v0, mem)
 12020  		v.AddArg3(ptr, v0, v1)
 12021  		return true
 12022  	}
 12023  	// match: (Zero [13] ptr mem)
 12024  	// result: (MOVVstore [5] ptr (MOVVconst [0]) (MOVVstore ptr (MOVVconst [0]) mem))
 12025  	for {
 12026  		if auxIntToInt64(v.AuxInt) != 13 {
 12027  			break
 12028  		}
 12029  		ptr := v_0
 12030  		mem := v_1
 12031  		v.reset(OpLOONG64MOVVstore)
 12032  		v.AuxInt = int32ToAuxInt(5)
 12033  		v0 := b.NewValue0(v.Pos, OpLOONG64MOVVconst, typ.UInt64)
 12034  		v0.AuxInt = int64ToAuxInt(0)
 12035  		v1 := b.NewValue0(v.Pos, OpLOONG64MOVVstore, types.TypeMem)
 12036  		v1.AddArg3(ptr, v0, mem)
 12037  		v.AddArg3(ptr, v0, v1)
 12038  		return true
 12039  	}
 12040  	// match: (Zero [14] ptr mem)
 12041  	// result: (MOVVstore [6] ptr (MOVVconst [0]) (MOVVstore ptr (MOVVconst [0]) mem))
 12042  	for {
 12043  		if auxIntToInt64(v.AuxInt) != 14 {
 12044  			break
 12045  		}
 12046  		ptr := v_0
 12047  		mem := v_1
 12048  		v.reset(OpLOONG64MOVVstore)
 12049  		v.AuxInt = int32ToAuxInt(6)
 12050  		v0 := b.NewValue0(v.Pos, OpLOONG64MOVVconst, typ.UInt64)
 12051  		v0.AuxInt = int64ToAuxInt(0)
 12052  		v1 := b.NewValue0(v.Pos, OpLOONG64MOVVstore, types.TypeMem)
 12053  		v1.AddArg3(ptr, v0, mem)
 12054  		v.AddArg3(ptr, v0, v1)
 12055  		return true
 12056  	}
 12057  	// match: (Zero [15] ptr mem)
 12058  	// result: (MOVVstore [7] ptr (MOVVconst [0]) (MOVVstore ptr (MOVVconst [0]) mem))
 12059  	for {
 12060  		if auxIntToInt64(v.AuxInt) != 15 {
 12061  			break
 12062  		}
 12063  		ptr := v_0
 12064  		mem := v_1
 12065  		v.reset(OpLOONG64MOVVstore)
 12066  		v.AuxInt = int32ToAuxInt(7)
 12067  		v0 := b.NewValue0(v.Pos, OpLOONG64MOVVconst, typ.UInt64)
 12068  		v0.AuxInt = int64ToAuxInt(0)
 12069  		v1 := b.NewValue0(v.Pos, OpLOONG64MOVVstore, types.TypeMem)
 12070  		v1.AddArg3(ptr, v0, mem)
 12071  		v.AddArg3(ptr, v0, v1)
 12072  		return true
 12073  	}
 12074  	// match: (Zero [16] ptr mem)
 12075  	// result: (MOVVstore [8] ptr (MOVVconst [0]) (MOVVstore ptr (MOVVconst [0]) mem))
 12076  	for {
 12077  		if auxIntToInt64(v.AuxInt) != 16 {
 12078  			break
 12079  		}
 12080  		ptr := v_0
 12081  		mem := v_1
 12082  		v.reset(OpLOONG64MOVVstore)
 12083  		v.AuxInt = int32ToAuxInt(8)
 12084  		v0 := b.NewValue0(v.Pos, OpLOONG64MOVVconst, typ.UInt64)
 12085  		v0.AuxInt = int64ToAuxInt(0)
 12086  		v1 := b.NewValue0(v.Pos, OpLOONG64MOVVstore, types.TypeMem)
 12087  		v1.AddArg3(ptr, v0, mem)
 12088  		v.AddArg3(ptr, v0, v1)
 12089  		return true
 12090  	}
 12091  	// match: (Zero [s] ptr mem)
 12092  	// cond: s > 16 && s < 192
 12093  	// result: (LoweredZero [s] ptr mem)
 12094  	for {
 12095  		s := auxIntToInt64(v.AuxInt)
 12096  		ptr := v_0
 12097  		mem := v_1
 12098  		if !(s > 16 && s < 192) {
 12099  			break
 12100  		}
 12101  		v.reset(OpLOONG64LoweredZero)
 12102  		v.AuxInt = int64ToAuxInt(s)
 12103  		v.AddArg2(ptr, mem)
 12104  		return true
 12105  	}
 12106  	// match: (Zero [s] ptr mem)
 12107  	// cond: s >= 192
 12108  	// result: (LoweredZeroLoop [s] ptr mem)
 12109  	for {
 12110  		s := auxIntToInt64(v.AuxInt)
 12111  		ptr := v_0
 12112  		mem := v_1
 12113  		if !(s >= 192) {
 12114  			break
 12115  		}
 12116  		v.reset(OpLOONG64LoweredZeroLoop)
 12117  		v.AuxInt = int64ToAuxInt(s)
 12118  		v.AddArg2(ptr, mem)
 12119  		return true
 12120  	}
 12121  	return false
 12122  }
 12123  func rewriteBlockLOONG64(b *Block) bool {
 12124  	typ := &b.Func.Config.Types
 12125  	switch b.Kind {
 12126  	case BlockLOONG64BEQ:
 12127  		// match: (BEQ (MOVVconst [0]) cond yes no)
 12128  		// result: (EQZ cond yes no)
 12129  		for b.Controls[0].Op == OpLOONG64MOVVconst {
 12130  			v_0 := b.Controls[0]
 12131  			if auxIntToInt64(v_0.AuxInt) != 0 {
 12132  				break
 12133  			}
 12134  			cond := b.Controls[1]
 12135  			b.resetWithControl(BlockLOONG64EQZ, cond)
 12136  			return true
 12137  		}
 12138  		// match: (BEQ cond (MOVVconst [0]) yes no)
 12139  		// result: (EQZ cond yes no)
 12140  		for b.Controls[1].Op == OpLOONG64MOVVconst {
 12141  			cond := b.Controls[0]
 12142  			v_1 := b.Controls[1]
 12143  			if auxIntToInt64(v_1.AuxInt) != 0 {
 12144  				break
 12145  			}
 12146  			b.resetWithControl(BlockLOONG64EQZ, cond)
 12147  			return true
 12148  		}
 12149  	case BlockLOONG64BGE:
 12150  		// match: (BGE (MOVVconst [0]) cond yes no)
 12151  		// result: (LEZ cond yes no)
 12152  		for b.Controls[0].Op == OpLOONG64MOVVconst {
 12153  			v_0 := b.Controls[0]
 12154  			if auxIntToInt64(v_0.AuxInt) != 0 {
 12155  				break
 12156  			}
 12157  			cond := b.Controls[1]
 12158  			b.resetWithControl(BlockLOONG64LEZ, cond)
 12159  			return true
 12160  		}
 12161  		// match: (BGE cond (MOVVconst [0]) yes no)
 12162  		// result: (GEZ cond yes no)
 12163  		for b.Controls[1].Op == OpLOONG64MOVVconst {
 12164  			cond := b.Controls[0]
 12165  			v_1 := b.Controls[1]
 12166  			if auxIntToInt64(v_1.AuxInt) != 0 {
 12167  				break
 12168  			}
 12169  			b.resetWithControl(BlockLOONG64GEZ, cond)
 12170  			return true
 12171  		}
 12172  	case BlockLOONG64BGEU:
 12173  		// match: (BGEU (MOVVconst [0]) cond yes no)
 12174  		// result: (EQZ cond yes no)
 12175  		for b.Controls[0].Op == OpLOONG64MOVVconst {
 12176  			v_0 := b.Controls[0]
 12177  			if auxIntToInt64(v_0.AuxInt) != 0 {
 12178  				break
 12179  			}
 12180  			cond := b.Controls[1]
 12181  			b.resetWithControl(BlockLOONG64EQZ, cond)
 12182  			return true
 12183  		}
 12184  	case BlockLOONG64BLT:
 12185  		// match: (BLT (MOVVconst [0]) cond yes no)
 12186  		// result: (GTZ cond yes no)
 12187  		for b.Controls[0].Op == OpLOONG64MOVVconst {
 12188  			v_0 := b.Controls[0]
 12189  			if auxIntToInt64(v_0.AuxInt) != 0 {
 12190  				break
 12191  			}
 12192  			cond := b.Controls[1]
 12193  			b.resetWithControl(BlockLOONG64GTZ, cond)
 12194  			return true
 12195  		}
 12196  		// match: (BLT cond (MOVVconst [0]) yes no)
 12197  		// result: (LTZ cond yes no)
 12198  		for b.Controls[1].Op == OpLOONG64MOVVconst {
 12199  			cond := b.Controls[0]
 12200  			v_1 := b.Controls[1]
 12201  			if auxIntToInt64(v_1.AuxInt) != 0 {
 12202  				break
 12203  			}
 12204  			b.resetWithControl(BlockLOONG64LTZ, cond)
 12205  			return true
 12206  		}
 12207  	case BlockLOONG64BLTU:
 12208  		// match: (BLTU (MOVVconst [0]) cond yes no)
 12209  		// result: (NEZ cond yes no)
 12210  		for b.Controls[0].Op == OpLOONG64MOVVconst {
 12211  			v_0 := b.Controls[0]
 12212  			if auxIntToInt64(v_0.AuxInt) != 0 {
 12213  				break
 12214  			}
 12215  			cond := b.Controls[1]
 12216  			b.resetWithControl(BlockLOONG64NEZ, cond)
 12217  			return true
 12218  		}
 12219  	case BlockLOONG64BNE:
 12220  		// match: (BNE (MOVVconst [0]) cond yes no)
 12221  		// result: (NEZ cond yes no)
 12222  		for b.Controls[0].Op == OpLOONG64MOVVconst {
 12223  			v_0 := b.Controls[0]
 12224  			if auxIntToInt64(v_0.AuxInt) != 0 {
 12225  				break
 12226  			}
 12227  			cond := b.Controls[1]
 12228  			b.resetWithControl(BlockLOONG64NEZ, cond)
 12229  			return true
 12230  		}
 12231  		// match: (BNE cond (MOVVconst [0]) yes no)
 12232  		// result: (NEZ cond yes no)
 12233  		for b.Controls[1].Op == OpLOONG64MOVVconst {
 12234  			cond := b.Controls[0]
 12235  			v_1 := b.Controls[1]
 12236  			if auxIntToInt64(v_1.AuxInt) != 0 {
 12237  				break
 12238  			}
 12239  			b.resetWithControl(BlockLOONG64NEZ, cond)
 12240  			return true
 12241  		}
 12242  	case BlockLOONG64EQZ:
 12243  		// match: (EQZ (FPFlagTrue cmp) yes no)
 12244  		// result: (FPF cmp yes no)
 12245  		for b.Controls[0].Op == OpLOONG64FPFlagTrue {
 12246  			v_0 := b.Controls[0]
 12247  			cmp := v_0.Args[0]
 12248  			b.resetWithControl(BlockLOONG64FPF, cmp)
 12249  			return true
 12250  		}
 12251  		// match: (EQZ (FPFlagFalse cmp) yes no)
 12252  		// result: (FPT cmp yes no)
 12253  		for b.Controls[0].Op == OpLOONG64FPFlagFalse {
 12254  			v_0 := b.Controls[0]
 12255  			cmp := v_0.Args[0]
 12256  			b.resetWithControl(BlockLOONG64FPT, cmp)
 12257  			return true
 12258  		}
 12259  		// match: (EQZ (XORconst [1] cmp:(SGT _ _)) yes no)
 12260  		// result: (NEZ cmp yes no)
 12261  		for b.Controls[0].Op == OpLOONG64XORconst {
 12262  			v_0 := b.Controls[0]
 12263  			if auxIntToInt64(v_0.AuxInt) != 1 {
 12264  				break
 12265  			}
 12266  			cmp := v_0.Args[0]
 12267  			if cmp.Op != OpLOONG64SGT {
 12268  				break
 12269  			}
 12270  			b.resetWithControl(BlockLOONG64NEZ, cmp)
 12271  			return true
 12272  		}
 12273  		// match: (EQZ (XORconst [1] cmp:(SGTU _ _)) yes no)
 12274  		// result: (NEZ cmp yes no)
 12275  		for b.Controls[0].Op == OpLOONG64XORconst {
 12276  			v_0 := b.Controls[0]
 12277  			if auxIntToInt64(v_0.AuxInt) != 1 {
 12278  				break
 12279  			}
 12280  			cmp := v_0.Args[0]
 12281  			if cmp.Op != OpLOONG64SGTU {
 12282  				break
 12283  			}
 12284  			b.resetWithControl(BlockLOONG64NEZ, cmp)
 12285  			return true
 12286  		}
 12287  		// match: (EQZ (XORconst [1] cmp:(SGTconst _)) yes no)
 12288  		// result: (NEZ cmp yes no)
 12289  		for b.Controls[0].Op == OpLOONG64XORconst {
 12290  			v_0 := b.Controls[0]
 12291  			if auxIntToInt64(v_0.AuxInt) != 1 {
 12292  				break
 12293  			}
 12294  			cmp := v_0.Args[0]
 12295  			if cmp.Op != OpLOONG64SGTconst {
 12296  				break
 12297  			}
 12298  			b.resetWithControl(BlockLOONG64NEZ, cmp)
 12299  			return true
 12300  		}
 12301  		// match: (EQZ (XORconst [1] cmp:(SGTUconst _)) yes no)
 12302  		// result: (NEZ cmp yes no)
 12303  		for b.Controls[0].Op == OpLOONG64XORconst {
 12304  			v_0 := b.Controls[0]
 12305  			if auxIntToInt64(v_0.AuxInt) != 1 {
 12306  				break
 12307  			}
 12308  			cmp := v_0.Args[0]
 12309  			if cmp.Op != OpLOONG64SGTUconst {
 12310  				break
 12311  			}
 12312  			b.resetWithControl(BlockLOONG64NEZ, cmp)
 12313  			return true
 12314  		}
 12315  		// match: (EQZ (SGTUconst [1] x) yes no)
 12316  		// result: (NEZ x yes no)
 12317  		for b.Controls[0].Op == OpLOONG64SGTUconst {
 12318  			v_0 := b.Controls[0]
 12319  			if auxIntToInt64(v_0.AuxInt) != 1 {
 12320  				break
 12321  			}
 12322  			x := v_0.Args[0]
 12323  			b.resetWithControl(BlockLOONG64NEZ, x)
 12324  			return true
 12325  		}
 12326  		// match: (EQZ (SGTU x (MOVVconst [0])) yes no)
 12327  		// result: (EQZ x yes no)
 12328  		for b.Controls[0].Op == OpLOONG64SGTU {
 12329  			v_0 := b.Controls[0]
 12330  			_ = v_0.Args[1]
 12331  			x := v_0.Args[0]
 12332  			v_0_1 := v_0.Args[1]
 12333  			if v_0_1.Op != OpLOONG64MOVVconst || auxIntToInt64(v_0_1.AuxInt) != 0 {
 12334  				break
 12335  			}
 12336  			b.resetWithControl(BlockLOONG64EQZ, x)
 12337  			return true
 12338  		}
 12339  		// match: (EQZ (SGTconst [0] x) yes no)
 12340  		// result: (GEZ x yes no)
 12341  		for b.Controls[0].Op == OpLOONG64SGTconst {
 12342  			v_0 := b.Controls[0]
 12343  			if auxIntToInt64(v_0.AuxInt) != 0 {
 12344  				break
 12345  			}
 12346  			x := v_0.Args[0]
 12347  			b.resetWithControl(BlockLOONG64GEZ, x)
 12348  			return true
 12349  		}
 12350  		// match: (EQZ (SGT x (MOVVconst [0])) yes no)
 12351  		// result: (LEZ x yes no)
 12352  		for b.Controls[0].Op == OpLOONG64SGT {
 12353  			v_0 := b.Controls[0]
 12354  			_ = v_0.Args[1]
 12355  			x := v_0.Args[0]
 12356  			v_0_1 := v_0.Args[1]
 12357  			if v_0_1.Op != OpLOONG64MOVVconst || auxIntToInt64(v_0_1.AuxInt) != 0 {
 12358  				break
 12359  			}
 12360  			b.resetWithControl(BlockLOONG64LEZ, x)
 12361  			return true
 12362  		}
 12363  		// match: (EQZ (SGTU (MOVVconst [c]) y) yes no)
 12364  		// cond: c >= -2048 && c <= 2047
 12365  		// result: (EQZ (SGTUconst [c] y) yes no)
 12366  		for b.Controls[0].Op == OpLOONG64SGTU {
 12367  			v_0 := b.Controls[0]
 12368  			y := v_0.Args[1]
 12369  			v_0_0 := v_0.Args[0]
 12370  			if v_0_0.Op != OpLOONG64MOVVconst {
 12371  				break
 12372  			}
 12373  			c := auxIntToInt64(v_0_0.AuxInt)
 12374  			if !(c >= -2048 && c <= 2047) {
 12375  				break
 12376  			}
 12377  			v0 := b.NewValue0(v_0.Pos, OpLOONG64SGTUconst, typ.Bool)
 12378  			v0.AuxInt = int64ToAuxInt(c)
 12379  			v0.AddArg(y)
 12380  			b.resetWithControl(BlockLOONG64EQZ, v0)
 12381  			return true
 12382  		}
 12383  		// match: (EQZ (SUBV x y) yes no)
 12384  		// result: (BEQ x y yes no)
 12385  		for b.Controls[0].Op == OpLOONG64SUBV {
 12386  			v_0 := b.Controls[0]
 12387  			y := v_0.Args[1]
 12388  			x := v_0.Args[0]
 12389  			b.resetWithControl2(BlockLOONG64BEQ, x, y)
 12390  			return true
 12391  		}
 12392  		// match: (EQZ (SGT x y) yes no)
 12393  		// result: (BGE y x yes no)
 12394  		for b.Controls[0].Op == OpLOONG64SGT {
 12395  			v_0 := b.Controls[0]
 12396  			y := v_0.Args[1]
 12397  			x := v_0.Args[0]
 12398  			b.resetWithControl2(BlockLOONG64BGE, y, x)
 12399  			return true
 12400  		}
 12401  		// match: (EQZ (SGTU x y) yes no)
 12402  		// result: (BGEU y x yes no)
 12403  		for b.Controls[0].Op == OpLOONG64SGTU {
 12404  			v_0 := b.Controls[0]
 12405  			y := v_0.Args[1]
 12406  			x := v_0.Args[0]
 12407  			b.resetWithControl2(BlockLOONG64BGEU, y, x)
 12408  			return true
 12409  		}
 12410  		// match: (EQZ (SGTconst [c] y) yes no)
 12411  		// result: (BGE y (MOVVconst [c]) yes no)
 12412  		for b.Controls[0].Op == OpLOONG64SGTconst {
 12413  			v_0 := b.Controls[0]
 12414  			c := auxIntToInt64(v_0.AuxInt)
 12415  			y := v_0.Args[0]
 12416  			v0 := b.NewValue0(b.Pos, OpLOONG64MOVVconst, typ.UInt64)
 12417  			v0.AuxInt = int64ToAuxInt(c)
 12418  			b.resetWithControl2(BlockLOONG64BGE, y, v0)
 12419  			return true
 12420  		}
 12421  		// match: (EQZ (SGTUconst [c] y) yes no)
 12422  		// result: (BGEU y (MOVVconst [c]) yes no)
 12423  		for b.Controls[0].Op == OpLOONG64SGTUconst {
 12424  			v_0 := b.Controls[0]
 12425  			c := auxIntToInt64(v_0.AuxInt)
 12426  			y := v_0.Args[0]
 12427  			v0 := b.NewValue0(b.Pos, OpLOONG64MOVVconst, typ.UInt64)
 12428  			v0.AuxInt = int64ToAuxInt(c)
 12429  			b.resetWithControl2(BlockLOONG64BGEU, y, v0)
 12430  			return true
 12431  		}
 12432  		// match: (EQZ (MOVVconst [0]) yes no)
 12433  		// result: (First yes no)
 12434  		for b.Controls[0].Op == OpLOONG64MOVVconst {
 12435  			v_0 := b.Controls[0]
 12436  			if auxIntToInt64(v_0.AuxInt) != 0 {
 12437  				break
 12438  			}
 12439  			b.Reset(BlockFirst)
 12440  			return true
 12441  		}
 12442  		// match: (EQZ (MOVVconst [c]) yes no)
 12443  		// cond: c != 0
 12444  		// result: (First no yes)
 12445  		for b.Controls[0].Op == OpLOONG64MOVVconst {
 12446  			v_0 := b.Controls[0]
 12447  			c := auxIntToInt64(v_0.AuxInt)
 12448  			if !(c != 0) {
 12449  				break
 12450  			}
 12451  			b.Reset(BlockFirst)
 12452  			b.swapSuccessors()
 12453  			return true
 12454  		}
 12455  		// match: (EQZ (NEGV x) yes no)
 12456  		// result: (EQZ x yes no)
 12457  		for b.Controls[0].Op == OpLOONG64NEGV {
 12458  			v_0 := b.Controls[0]
 12459  			x := v_0.Args[0]
 12460  			b.resetWithControl(BlockLOONG64EQZ, x)
 12461  			return true
 12462  		}
 12463  	case BlockLOONG64GEZ:
 12464  		// match: (GEZ (MOVVconst [c]) yes no)
 12465  		// cond: c >= 0
 12466  		// result: (First yes no)
 12467  		for b.Controls[0].Op == OpLOONG64MOVVconst {
 12468  			v_0 := b.Controls[0]
 12469  			c := auxIntToInt64(v_0.AuxInt)
 12470  			if !(c >= 0) {
 12471  				break
 12472  			}
 12473  			b.Reset(BlockFirst)
 12474  			return true
 12475  		}
 12476  		// match: (GEZ (MOVVconst [c]) yes no)
 12477  		// cond: c < 0
 12478  		// result: (First no yes)
 12479  		for b.Controls[0].Op == OpLOONG64MOVVconst {
 12480  			v_0 := b.Controls[0]
 12481  			c := auxIntToInt64(v_0.AuxInt)
 12482  			if !(c < 0) {
 12483  				break
 12484  			}
 12485  			b.Reset(BlockFirst)
 12486  			b.swapSuccessors()
 12487  			return true
 12488  		}
 12489  	case BlockLOONG64GTZ:
 12490  		// match: (GTZ (MOVVconst [c]) yes no)
 12491  		// cond: c > 0
 12492  		// result: (First yes no)
 12493  		for b.Controls[0].Op == OpLOONG64MOVVconst {
 12494  			v_0 := b.Controls[0]
 12495  			c := auxIntToInt64(v_0.AuxInt)
 12496  			if !(c > 0) {
 12497  				break
 12498  			}
 12499  			b.Reset(BlockFirst)
 12500  			return true
 12501  		}
 12502  		// match: (GTZ (MOVVconst [c]) yes no)
 12503  		// cond: c <= 0
 12504  		// result: (First no yes)
 12505  		for b.Controls[0].Op == OpLOONG64MOVVconst {
 12506  			v_0 := b.Controls[0]
 12507  			c := auxIntToInt64(v_0.AuxInt)
 12508  			if !(c <= 0) {
 12509  				break
 12510  			}
 12511  			b.Reset(BlockFirst)
 12512  			b.swapSuccessors()
 12513  			return true
 12514  		}
 12515  	case BlockIf:
 12516  		// match: (If cond yes no)
 12517  		// result: (NEZ (MOVBUreg <typ.UInt64> cond) yes no)
 12518  		for {
 12519  			cond := b.Controls[0]
 12520  			v0 := b.NewValue0(cond.Pos, OpLOONG64MOVBUreg, typ.UInt64)
 12521  			v0.AddArg(cond)
 12522  			b.resetWithControl(BlockLOONG64NEZ, v0)
 12523  			return true
 12524  		}
 12525  	case BlockJumpTable:
 12526  		// match: (JumpTable idx)
 12527  		// result: (JUMPTABLE {makeJumpTableSym(b)} idx (MOVVaddr <typ.Uintptr> {makeJumpTableSym(b)} (SB)))
 12528  		for {
 12529  			idx := b.Controls[0]
 12530  			v0 := b.NewValue0(b.Pos, OpLOONG64MOVVaddr, typ.Uintptr)
 12531  			v0.Aux = symToAux(makeJumpTableSym(b))
 12532  			v1 := b.NewValue0(b.Pos, OpSB, typ.Uintptr)
 12533  			v0.AddArg(v1)
 12534  			b.resetWithControl2(BlockLOONG64JUMPTABLE, idx, v0)
 12535  			b.Aux = symToAux(makeJumpTableSym(b))
 12536  			return true
 12537  		}
 12538  	case BlockLOONG64LEZ:
 12539  		// match: (LEZ (MOVVconst [c]) yes no)
 12540  		// cond: c <= 0
 12541  		// result: (First yes no)
 12542  		for b.Controls[0].Op == OpLOONG64MOVVconst {
 12543  			v_0 := b.Controls[0]
 12544  			c := auxIntToInt64(v_0.AuxInt)
 12545  			if !(c <= 0) {
 12546  				break
 12547  			}
 12548  			b.Reset(BlockFirst)
 12549  			return true
 12550  		}
 12551  		// match: (LEZ (MOVVconst [c]) yes no)
 12552  		// cond: c > 0
 12553  		// result: (First no yes)
 12554  		for b.Controls[0].Op == OpLOONG64MOVVconst {
 12555  			v_0 := b.Controls[0]
 12556  			c := auxIntToInt64(v_0.AuxInt)
 12557  			if !(c > 0) {
 12558  				break
 12559  			}
 12560  			b.Reset(BlockFirst)
 12561  			b.swapSuccessors()
 12562  			return true
 12563  		}
 12564  	case BlockLOONG64LTZ:
 12565  		// match: (LTZ (MOVVconst [c]) yes no)
 12566  		// cond: c < 0
 12567  		// result: (First yes no)
 12568  		for b.Controls[0].Op == OpLOONG64MOVVconst {
 12569  			v_0 := b.Controls[0]
 12570  			c := auxIntToInt64(v_0.AuxInt)
 12571  			if !(c < 0) {
 12572  				break
 12573  			}
 12574  			b.Reset(BlockFirst)
 12575  			return true
 12576  		}
 12577  		// match: (LTZ (MOVVconst [c]) yes no)
 12578  		// cond: c >= 0
 12579  		// result: (First no yes)
 12580  		for b.Controls[0].Op == OpLOONG64MOVVconst {
 12581  			v_0 := b.Controls[0]
 12582  			c := auxIntToInt64(v_0.AuxInt)
 12583  			if !(c >= 0) {
 12584  				break
 12585  			}
 12586  			b.Reset(BlockFirst)
 12587  			b.swapSuccessors()
 12588  			return true
 12589  		}
 12590  	case BlockLOONG64NEZ:
 12591  		// match: (NEZ (FPFlagTrue cmp) yes no)
 12592  		// result: (FPT cmp yes no)
 12593  		for b.Controls[0].Op == OpLOONG64FPFlagTrue {
 12594  			v_0 := b.Controls[0]
 12595  			cmp := v_0.Args[0]
 12596  			b.resetWithControl(BlockLOONG64FPT, cmp)
 12597  			return true
 12598  		}
 12599  		// match: (NEZ (FPFlagFalse cmp) yes no)
 12600  		// result: (FPF cmp yes no)
 12601  		for b.Controls[0].Op == OpLOONG64FPFlagFalse {
 12602  			v_0 := b.Controls[0]
 12603  			cmp := v_0.Args[0]
 12604  			b.resetWithControl(BlockLOONG64FPF, cmp)
 12605  			return true
 12606  		}
 12607  		// match: (NEZ (XORconst [1] cmp:(SGT _ _)) yes no)
 12608  		// result: (EQZ cmp yes no)
 12609  		for b.Controls[0].Op == OpLOONG64XORconst {
 12610  			v_0 := b.Controls[0]
 12611  			if auxIntToInt64(v_0.AuxInt) != 1 {
 12612  				break
 12613  			}
 12614  			cmp := v_0.Args[0]
 12615  			if cmp.Op != OpLOONG64SGT {
 12616  				break
 12617  			}
 12618  			b.resetWithControl(BlockLOONG64EQZ, cmp)
 12619  			return true
 12620  		}
 12621  		// match: (NEZ (XORconst [1] cmp:(SGTU _ _)) yes no)
 12622  		// result: (EQZ cmp yes no)
 12623  		for b.Controls[0].Op == OpLOONG64XORconst {
 12624  			v_0 := b.Controls[0]
 12625  			if auxIntToInt64(v_0.AuxInt) != 1 {
 12626  				break
 12627  			}
 12628  			cmp := v_0.Args[0]
 12629  			if cmp.Op != OpLOONG64SGTU {
 12630  				break
 12631  			}
 12632  			b.resetWithControl(BlockLOONG64EQZ, cmp)
 12633  			return true
 12634  		}
 12635  		// match: (NEZ (XORconst [1] cmp:(SGTconst _)) yes no)
 12636  		// result: (EQZ cmp yes no)
 12637  		for b.Controls[0].Op == OpLOONG64XORconst {
 12638  			v_0 := b.Controls[0]
 12639  			if auxIntToInt64(v_0.AuxInt) != 1 {
 12640  				break
 12641  			}
 12642  			cmp := v_0.Args[0]
 12643  			if cmp.Op != OpLOONG64SGTconst {
 12644  				break
 12645  			}
 12646  			b.resetWithControl(BlockLOONG64EQZ, cmp)
 12647  			return true
 12648  		}
 12649  		// match: (NEZ (XORconst [1] cmp:(SGTUconst _)) yes no)
 12650  		// result: (EQZ cmp yes no)
 12651  		for b.Controls[0].Op == OpLOONG64XORconst {
 12652  			v_0 := b.Controls[0]
 12653  			if auxIntToInt64(v_0.AuxInt) != 1 {
 12654  				break
 12655  			}
 12656  			cmp := v_0.Args[0]
 12657  			if cmp.Op != OpLOONG64SGTUconst {
 12658  				break
 12659  			}
 12660  			b.resetWithControl(BlockLOONG64EQZ, cmp)
 12661  			return true
 12662  		}
 12663  		// match: (NEZ (SGTUconst [1] x) yes no)
 12664  		// result: (EQZ x yes no)
 12665  		for b.Controls[0].Op == OpLOONG64SGTUconst {
 12666  			v_0 := b.Controls[0]
 12667  			if auxIntToInt64(v_0.AuxInt) != 1 {
 12668  				break
 12669  			}
 12670  			x := v_0.Args[0]
 12671  			b.resetWithControl(BlockLOONG64EQZ, x)
 12672  			return true
 12673  		}
 12674  		// match: (NEZ (SGTU x (MOVVconst [0])) yes no)
 12675  		// result: (NEZ x yes no)
 12676  		for b.Controls[0].Op == OpLOONG64SGTU {
 12677  			v_0 := b.Controls[0]
 12678  			_ = v_0.Args[1]
 12679  			x := v_0.Args[0]
 12680  			v_0_1 := v_0.Args[1]
 12681  			if v_0_1.Op != OpLOONG64MOVVconst || auxIntToInt64(v_0_1.AuxInt) != 0 {
 12682  				break
 12683  			}
 12684  			b.resetWithControl(BlockLOONG64NEZ, x)
 12685  			return true
 12686  		}
 12687  		// match: (NEZ (SGTconst [0] x) yes no)
 12688  		// result: (LTZ x yes no)
 12689  		for b.Controls[0].Op == OpLOONG64SGTconst {
 12690  			v_0 := b.Controls[0]
 12691  			if auxIntToInt64(v_0.AuxInt) != 0 {
 12692  				break
 12693  			}
 12694  			x := v_0.Args[0]
 12695  			b.resetWithControl(BlockLOONG64LTZ, x)
 12696  			return true
 12697  		}
 12698  		// match: (NEZ (SGT x (MOVVconst [0])) yes no)
 12699  		// result: (GTZ x yes no)
 12700  		for b.Controls[0].Op == OpLOONG64SGT {
 12701  			v_0 := b.Controls[0]
 12702  			_ = v_0.Args[1]
 12703  			x := v_0.Args[0]
 12704  			v_0_1 := v_0.Args[1]
 12705  			if v_0_1.Op != OpLOONG64MOVVconst || auxIntToInt64(v_0_1.AuxInt) != 0 {
 12706  				break
 12707  			}
 12708  			b.resetWithControl(BlockLOONG64GTZ, x)
 12709  			return true
 12710  		}
 12711  		// match: (NEZ (SGTU (MOVVconst [c]) y) yes no)
 12712  		// cond: c >= -2048 && c <= 2047
 12713  		// result: (NEZ (SGTUconst [c] y) yes no)
 12714  		for b.Controls[0].Op == OpLOONG64SGTU {
 12715  			v_0 := b.Controls[0]
 12716  			y := v_0.Args[1]
 12717  			v_0_0 := v_0.Args[0]
 12718  			if v_0_0.Op != OpLOONG64MOVVconst {
 12719  				break
 12720  			}
 12721  			c := auxIntToInt64(v_0_0.AuxInt)
 12722  			if !(c >= -2048 && c <= 2047) {
 12723  				break
 12724  			}
 12725  			v0 := b.NewValue0(v_0.Pos, OpLOONG64SGTUconst, typ.Bool)
 12726  			v0.AuxInt = int64ToAuxInt(c)
 12727  			v0.AddArg(y)
 12728  			b.resetWithControl(BlockLOONG64NEZ, v0)
 12729  			return true
 12730  		}
 12731  		// match: (NEZ (SUBV x y) yes no)
 12732  		// result: (BNE x y yes no)
 12733  		for b.Controls[0].Op == OpLOONG64SUBV {
 12734  			v_0 := b.Controls[0]
 12735  			y := v_0.Args[1]
 12736  			x := v_0.Args[0]
 12737  			b.resetWithControl2(BlockLOONG64BNE, x, y)
 12738  			return true
 12739  		}
 12740  		// match: (NEZ (SGT x y) yes no)
 12741  		// result: (BLT y x yes no)
 12742  		for b.Controls[0].Op == OpLOONG64SGT {
 12743  			v_0 := b.Controls[0]
 12744  			y := v_0.Args[1]
 12745  			x := v_0.Args[0]
 12746  			b.resetWithControl2(BlockLOONG64BLT, y, x)
 12747  			return true
 12748  		}
 12749  		// match: (NEZ (SGTU x y) yes no)
 12750  		// result: (BLTU y x yes no)
 12751  		for b.Controls[0].Op == OpLOONG64SGTU {
 12752  			v_0 := b.Controls[0]
 12753  			y := v_0.Args[1]
 12754  			x := v_0.Args[0]
 12755  			b.resetWithControl2(BlockLOONG64BLTU, y, x)
 12756  			return true
 12757  		}
 12758  		// match: (NEZ (SGTconst [c] y) yes no)
 12759  		// result: (BLT y (MOVVconst [c]) yes no)
 12760  		for b.Controls[0].Op == OpLOONG64SGTconst {
 12761  			v_0 := b.Controls[0]
 12762  			c := auxIntToInt64(v_0.AuxInt)
 12763  			y := v_0.Args[0]
 12764  			v0 := b.NewValue0(b.Pos, OpLOONG64MOVVconst, typ.UInt64)
 12765  			v0.AuxInt = int64ToAuxInt(c)
 12766  			b.resetWithControl2(BlockLOONG64BLT, y, v0)
 12767  			return true
 12768  		}
 12769  		// match: (NEZ (SGTUconst [c] y) yes no)
 12770  		// result: (BLTU y (MOVVconst [c]) yes no)
 12771  		for b.Controls[0].Op == OpLOONG64SGTUconst {
 12772  			v_0 := b.Controls[0]
 12773  			c := auxIntToInt64(v_0.AuxInt)
 12774  			y := v_0.Args[0]
 12775  			v0 := b.NewValue0(b.Pos, OpLOONG64MOVVconst, typ.UInt64)
 12776  			v0.AuxInt = int64ToAuxInt(c)
 12777  			b.resetWithControl2(BlockLOONG64BLTU, y, v0)
 12778  			return true
 12779  		}
 12780  		// match: (NEZ (MOVVconst [0]) yes no)
 12781  		// result: (First no yes)
 12782  		for b.Controls[0].Op == OpLOONG64MOVVconst {
 12783  			v_0 := b.Controls[0]
 12784  			if auxIntToInt64(v_0.AuxInt) != 0 {
 12785  				break
 12786  			}
 12787  			b.Reset(BlockFirst)
 12788  			b.swapSuccessors()
 12789  			return true
 12790  		}
 12791  		// match: (NEZ (MOVVconst [c]) yes no)
 12792  		// cond: c != 0
 12793  		// result: (First yes no)
 12794  		for b.Controls[0].Op == OpLOONG64MOVVconst {
 12795  			v_0 := b.Controls[0]
 12796  			c := auxIntToInt64(v_0.AuxInt)
 12797  			if !(c != 0) {
 12798  				break
 12799  			}
 12800  			b.Reset(BlockFirst)
 12801  			return true
 12802  		}
 12803  		// match: (NEZ (NEGV x) yes no)
 12804  		// result: (NEZ x yes no)
 12805  		for b.Controls[0].Op == OpLOONG64NEGV {
 12806  			v_0 := b.Controls[0]
 12807  			x := v_0.Args[0]
 12808  			b.resetWithControl(BlockLOONG64NEZ, x)
 12809  			return true
 12810  		}
 12811  	}
 12812  	return false
 12813  }
 12814  

View as plain text