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 _ (MOVVconst [0]))
  5870  	// result: (MOVVconst [0])
  5871  	for {
  5872  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
  5873  			if v_1.Op != OpLOONG64MOVVconst || auxIntToInt64(v_1.AuxInt) != 0 {
  5874  				continue
  5875  			}
  5876  			v.reset(OpLOONG64MOVVconst)
  5877  			v.AuxInt = int64ToAuxInt(0)
  5878  			return true
  5879  		}
  5880  		break
  5881  	}
  5882  	// match: (MULV x (MOVVconst [1]))
  5883  	// result: x
  5884  	for {
  5885  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
  5886  			x := v_0
  5887  			if v_1.Op != OpLOONG64MOVVconst || auxIntToInt64(v_1.AuxInt) != 1 {
  5888  				continue
  5889  			}
  5890  			v.copyOf(x)
  5891  			return true
  5892  		}
  5893  		break
  5894  	}
  5895  	// match: (MULV x (MOVVconst [c]))
  5896  	// cond: canMulStrengthReduce(config, c)
  5897  	// result: {mulStrengthReduce(v, x, c)}
  5898  	for {
  5899  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
  5900  			x := v_0
  5901  			if v_1.Op != OpLOONG64MOVVconst {
  5902  				continue
  5903  			}
  5904  			c := auxIntToInt64(v_1.AuxInt)
  5905  			if !(canMulStrengthReduce(config, c)) {
  5906  				continue
  5907  			}
  5908  			v.copyOf(mulStrengthReduce(v, x, c))
  5909  			return true
  5910  		}
  5911  		break
  5912  	}
  5913  	// match: (MULV (MOVVconst [c]) (MOVVconst [d]))
  5914  	// result: (MOVVconst [c*d])
  5915  	for {
  5916  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
  5917  			if v_0.Op != OpLOONG64MOVVconst {
  5918  				continue
  5919  			}
  5920  			c := auxIntToInt64(v_0.AuxInt)
  5921  			if v_1.Op != OpLOONG64MOVVconst {
  5922  				continue
  5923  			}
  5924  			d := auxIntToInt64(v_1.AuxInt)
  5925  			v.reset(OpLOONG64MOVVconst)
  5926  			v.AuxInt = int64ToAuxInt(c * d)
  5927  			return true
  5928  		}
  5929  		break
  5930  	}
  5931  	return false
  5932  }
  5933  func rewriteValueLOONG64_OpLOONG64NEGV(v *Value) bool {
  5934  	v_0 := v.Args[0]
  5935  	b := v.Block
  5936  	// match: (NEGV (SUBV x y))
  5937  	// result: (SUBV y x)
  5938  	for {
  5939  		if v_0.Op != OpLOONG64SUBV {
  5940  			break
  5941  		}
  5942  		y := v_0.Args[1]
  5943  		x := v_0.Args[0]
  5944  		v.reset(OpLOONG64SUBV)
  5945  		v.AddArg2(y, x)
  5946  		return true
  5947  	}
  5948  	// match: (NEGV <t> s:(ADDVconst [c] (SUBV x y)))
  5949  	// cond: s.Uses == 1 && is12Bit(-c)
  5950  	// result: (ADDVconst [-c] (SUBV <t> y x))
  5951  	for {
  5952  		t := v.Type
  5953  		s := v_0
  5954  		if s.Op != OpLOONG64ADDVconst {
  5955  			break
  5956  		}
  5957  		c := auxIntToInt64(s.AuxInt)
  5958  		s_0 := s.Args[0]
  5959  		if s_0.Op != OpLOONG64SUBV {
  5960  			break
  5961  		}
  5962  		y := s_0.Args[1]
  5963  		x := s_0.Args[0]
  5964  		if !(s.Uses == 1 && is12Bit(-c)) {
  5965  			break
  5966  		}
  5967  		v.reset(OpLOONG64ADDVconst)
  5968  		v.AuxInt = int64ToAuxInt(-c)
  5969  		v0 := b.NewValue0(v.Pos, OpLOONG64SUBV, t)
  5970  		v0.AddArg2(y, x)
  5971  		v.AddArg(v0)
  5972  		return true
  5973  	}
  5974  	// match: (NEGV (NEGV x))
  5975  	// result: x
  5976  	for {
  5977  		if v_0.Op != OpLOONG64NEGV {
  5978  			break
  5979  		}
  5980  		x := v_0.Args[0]
  5981  		v.copyOf(x)
  5982  		return true
  5983  	}
  5984  	// match: (NEGV <t> s:(ADDVconst [c] (NEGV x)))
  5985  	// cond: s.Uses == 1 && is12Bit(-c)
  5986  	// result: (ADDVconst [-c] x)
  5987  	for {
  5988  		s := v_0
  5989  		if s.Op != OpLOONG64ADDVconst {
  5990  			break
  5991  		}
  5992  		c := auxIntToInt64(s.AuxInt)
  5993  		s_0 := s.Args[0]
  5994  		if s_0.Op != OpLOONG64NEGV {
  5995  			break
  5996  		}
  5997  		x := s_0.Args[0]
  5998  		if !(s.Uses == 1 && is12Bit(-c)) {
  5999  			break
  6000  		}
  6001  		v.reset(OpLOONG64ADDVconst)
  6002  		v.AuxInt = int64ToAuxInt(-c)
  6003  		v.AddArg(x)
  6004  		return true
  6005  	}
  6006  	// match: (NEGV (MOVVconst [c]))
  6007  	// result: (MOVVconst [-c])
  6008  	for {
  6009  		if v_0.Op != OpLOONG64MOVVconst {
  6010  			break
  6011  		}
  6012  		c := auxIntToInt64(v_0.AuxInt)
  6013  		v.reset(OpLOONG64MOVVconst)
  6014  		v.AuxInt = int64ToAuxInt(-c)
  6015  		return true
  6016  	}
  6017  	return false
  6018  }
  6019  func rewriteValueLOONG64_OpLOONG64NOR(v *Value) bool {
  6020  	v_1 := v.Args[1]
  6021  	v_0 := v.Args[0]
  6022  	// match: (NOR x (MOVVconst [c]))
  6023  	// cond: is32Bit(c)
  6024  	// result: (NORconst [c] x)
  6025  	for {
  6026  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
  6027  			x := v_0
  6028  			if v_1.Op != OpLOONG64MOVVconst {
  6029  				continue
  6030  			}
  6031  			c := auxIntToInt64(v_1.AuxInt)
  6032  			if !(is32Bit(c)) {
  6033  				continue
  6034  			}
  6035  			v.reset(OpLOONG64NORconst)
  6036  			v.AuxInt = int64ToAuxInt(c)
  6037  			v.AddArg(x)
  6038  			return true
  6039  		}
  6040  		break
  6041  	}
  6042  	return false
  6043  }
  6044  func rewriteValueLOONG64_OpLOONG64NORconst(v *Value) bool {
  6045  	v_0 := v.Args[0]
  6046  	// match: (NORconst [c] (MOVVconst [d]))
  6047  	// result: (MOVVconst [^(c|d)])
  6048  	for {
  6049  		c := auxIntToInt64(v.AuxInt)
  6050  		if v_0.Op != OpLOONG64MOVVconst {
  6051  			break
  6052  		}
  6053  		d := auxIntToInt64(v_0.AuxInt)
  6054  		v.reset(OpLOONG64MOVVconst)
  6055  		v.AuxInt = int64ToAuxInt(^(c | d))
  6056  		return true
  6057  	}
  6058  	return false
  6059  }
  6060  func rewriteValueLOONG64_OpLOONG64OR(v *Value) bool {
  6061  	v_1 := v.Args[1]
  6062  	v_0 := v.Args[0]
  6063  	b := v.Block
  6064  	typ := &b.Func.Config.Types
  6065  	// match: (OR <typ.UInt16> (SRLVconst [8] <typ.UInt16> x) (SLLVconst [8] <typ.UInt16> x))
  6066  	// result: (REVB2H x)
  6067  	for {
  6068  		if v.Type != typ.UInt16 {
  6069  			break
  6070  		}
  6071  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
  6072  			if v_0.Op != OpLOONG64SRLVconst || v_0.Type != typ.UInt16 || auxIntToInt64(v_0.AuxInt) != 8 {
  6073  				continue
  6074  			}
  6075  			x := v_0.Args[0]
  6076  			if v_1.Op != OpLOONG64SLLVconst || v_1.Type != typ.UInt16 || auxIntToInt64(v_1.AuxInt) != 8 || x != v_1.Args[0] {
  6077  				continue
  6078  			}
  6079  			v.reset(OpLOONG64REVB2H)
  6080  			v.AddArg(x)
  6081  			return true
  6082  		}
  6083  		break
  6084  	}
  6085  	// match: (OR (SRLconst [8] (ANDconst [c1] x)) (SLLconst [8] (ANDconst [c2] x)))
  6086  	// cond: uint32(c1) == 0xff00ff00 && uint32(c2) == 0x00ff00ff
  6087  	// result: (REVB2H x)
  6088  	for {
  6089  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
  6090  			if v_0.Op != OpLOONG64SRLconst || auxIntToInt64(v_0.AuxInt) != 8 {
  6091  				continue
  6092  			}
  6093  			v_0_0 := v_0.Args[0]
  6094  			if v_0_0.Op != OpLOONG64ANDconst {
  6095  				continue
  6096  			}
  6097  			c1 := auxIntToInt64(v_0_0.AuxInt)
  6098  			x := v_0_0.Args[0]
  6099  			if v_1.Op != OpLOONG64SLLconst || auxIntToInt64(v_1.AuxInt) != 8 {
  6100  				continue
  6101  			}
  6102  			v_1_0 := v_1.Args[0]
  6103  			if v_1_0.Op != OpLOONG64ANDconst {
  6104  				continue
  6105  			}
  6106  			c2 := auxIntToInt64(v_1_0.AuxInt)
  6107  			if x != v_1_0.Args[0] || !(uint32(c1) == 0xff00ff00 && uint32(c2) == 0x00ff00ff) {
  6108  				continue
  6109  			}
  6110  			v.reset(OpLOONG64REVB2H)
  6111  			v.AddArg(x)
  6112  			return true
  6113  		}
  6114  		break
  6115  	}
  6116  	// match: (OR (SRLVconst [8] (AND (MOVVconst [c1]) x)) (SLLVconst [8] (AND (MOVVconst [c2]) x)))
  6117  	// cond: uint64(c1) == 0xff00ff00ff00ff00 && uint64(c2) == 0x00ff00ff00ff00ff
  6118  	// result: (REVB4H x)
  6119  	for {
  6120  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
  6121  			if v_0.Op != OpLOONG64SRLVconst || auxIntToInt64(v_0.AuxInt) != 8 {
  6122  				continue
  6123  			}
  6124  			v_0_0 := v_0.Args[0]
  6125  			if v_0_0.Op != OpLOONG64AND {
  6126  				continue
  6127  			}
  6128  			_ = v_0_0.Args[1]
  6129  			v_0_0_0 := v_0_0.Args[0]
  6130  			v_0_0_1 := v_0_0.Args[1]
  6131  			for _i1 := 0; _i1 <= 1; _i1, v_0_0_0, v_0_0_1 = _i1+1, v_0_0_1, v_0_0_0 {
  6132  				if v_0_0_0.Op != OpLOONG64MOVVconst {
  6133  					continue
  6134  				}
  6135  				c1 := auxIntToInt64(v_0_0_0.AuxInt)
  6136  				x := v_0_0_1
  6137  				if v_1.Op != OpLOONG64SLLVconst || auxIntToInt64(v_1.AuxInt) != 8 {
  6138  					continue
  6139  				}
  6140  				v_1_0 := v_1.Args[0]
  6141  				if v_1_0.Op != OpLOONG64AND {
  6142  					continue
  6143  				}
  6144  				_ = v_1_0.Args[1]
  6145  				v_1_0_0 := v_1_0.Args[0]
  6146  				v_1_0_1 := v_1_0.Args[1]
  6147  				for _i2 := 0; _i2 <= 1; _i2, v_1_0_0, v_1_0_1 = _i2+1, v_1_0_1, v_1_0_0 {
  6148  					if v_1_0_0.Op != OpLOONG64MOVVconst {
  6149  						continue
  6150  					}
  6151  					c2 := auxIntToInt64(v_1_0_0.AuxInt)
  6152  					if x != v_1_0_1 || !(uint64(c1) == 0xff00ff00ff00ff00 && uint64(c2) == 0x00ff00ff00ff00ff) {
  6153  						continue
  6154  					}
  6155  					v.reset(OpLOONG64REVB4H)
  6156  					v.AddArg(x)
  6157  					return true
  6158  				}
  6159  			}
  6160  		}
  6161  		break
  6162  	}
  6163  	// match: (OR (SRLVconst [8] (AND (MOVVconst [c1]) x)) (SLLVconst [8] (ANDconst [c2] x)))
  6164  	// cond: uint64(c1) == 0xff00ff00 && uint64(c2) == 0x00ff00ff
  6165  	// result: (REVB4H (ANDconst <x.Type> [0xffffffff] x))
  6166  	for {
  6167  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
  6168  			if v_0.Op != OpLOONG64SRLVconst || auxIntToInt64(v_0.AuxInt) != 8 {
  6169  				continue
  6170  			}
  6171  			v_0_0 := v_0.Args[0]
  6172  			if v_0_0.Op != OpLOONG64AND {
  6173  				continue
  6174  			}
  6175  			_ = v_0_0.Args[1]
  6176  			v_0_0_0 := v_0_0.Args[0]
  6177  			v_0_0_1 := v_0_0.Args[1]
  6178  			for _i1 := 0; _i1 <= 1; _i1, v_0_0_0, v_0_0_1 = _i1+1, v_0_0_1, v_0_0_0 {
  6179  				if v_0_0_0.Op != OpLOONG64MOVVconst {
  6180  					continue
  6181  				}
  6182  				c1 := auxIntToInt64(v_0_0_0.AuxInt)
  6183  				x := v_0_0_1
  6184  				if v_1.Op != OpLOONG64SLLVconst || auxIntToInt64(v_1.AuxInt) != 8 {
  6185  					continue
  6186  				}
  6187  				v_1_0 := v_1.Args[0]
  6188  				if v_1_0.Op != OpLOONG64ANDconst {
  6189  					continue
  6190  				}
  6191  				c2 := auxIntToInt64(v_1_0.AuxInt)
  6192  				if x != v_1_0.Args[0] || !(uint64(c1) == 0xff00ff00 && uint64(c2) == 0x00ff00ff) {
  6193  					continue
  6194  				}
  6195  				v.reset(OpLOONG64REVB4H)
  6196  				v0 := b.NewValue0(v.Pos, OpLOONG64ANDconst, x.Type)
  6197  				v0.AuxInt = int64ToAuxInt(0xffffffff)
  6198  				v0.AddArg(x)
  6199  				v.AddArg(v0)
  6200  				return true
  6201  			}
  6202  		}
  6203  		break
  6204  	}
  6205  	// match: (OR x (MOVVconst [c]))
  6206  	// cond: is32Bit(c)
  6207  	// result: (ORconst [c] x)
  6208  	for {
  6209  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
  6210  			x := v_0
  6211  			if v_1.Op != OpLOONG64MOVVconst {
  6212  				continue
  6213  			}
  6214  			c := auxIntToInt64(v_1.AuxInt)
  6215  			if !(is32Bit(c)) {
  6216  				continue
  6217  			}
  6218  			v.reset(OpLOONG64ORconst)
  6219  			v.AuxInt = int64ToAuxInt(c)
  6220  			v.AddArg(x)
  6221  			return true
  6222  		}
  6223  		break
  6224  	}
  6225  	// match: (OR x x)
  6226  	// result: x
  6227  	for {
  6228  		x := v_0
  6229  		if x != v_1 {
  6230  			break
  6231  		}
  6232  		v.copyOf(x)
  6233  		return true
  6234  	}
  6235  	// match: (OR x (NORconst [0] y))
  6236  	// result: (ORN x y)
  6237  	for {
  6238  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
  6239  			x := v_0
  6240  			if v_1.Op != OpLOONG64NORconst || auxIntToInt64(v_1.AuxInt) != 0 {
  6241  				continue
  6242  			}
  6243  			y := v_1.Args[0]
  6244  			v.reset(OpLOONG64ORN)
  6245  			v.AddArg2(x, y)
  6246  			return true
  6247  		}
  6248  		break
  6249  	}
  6250  	return false
  6251  }
  6252  func rewriteValueLOONG64_OpLOONG64ORN(v *Value) bool {
  6253  	v_1 := v.Args[1]
  6254  	v_0 := v.Args[0]
  6255  	// match: (ORN x (MOVVconst [-1]))
  6256  	// result: x
  6257  	for {
  6258  		x := v_0
  6259  		if v_1.Op != OpLOONG64MOVVconst || auxIntToInt64(v_1.AuxInt) != -1 {
  6260  			break
  6261  		}
  6262  		v.copyOf(x)
  6263  		return true
  6264  	}
  6265  	return false
  6266  }
  6267  func rewriteValueLOONG64_OpLOONG64ORconst(v *Value) bool {
  6268  	v_0 := v.Args[0]
  6269  	// match: (ORconst [0] x)
  6270  	// result: x
  6271  	for {
  6272  		if auxIntToInt64(v.AuxInt) != 0 {
  6273  			break
  6274  		}
  6275  		x := v_0
  6276  		v.copyOf(x)
  6277  		return true
  6278  	}
  6279  	// match: (ORconst [-1] _)
  6280  	// result: (MOVVconst [-1])
  6281  	for {
  6282  		if auxIntToInt64(v.AuxInt) != -1 {
  6283  			break
  6284  		}
  6285  		v.reset(OpLOONG64MOVVconst)
  6286  		v.AuxInt = int64ToAuxInt(-1)
  6287  		return true
  6288  	}
  6289  	// match: (ORconst [c] (MOVVconst [d]))
  6290  	// result: (MOVVconst [c|d])
  6291  	for {
  6292  		c := auxIntToInt64(v.AuxInt)
  6293  		if v_0.Op != OpLOONG64MOVVconst {
  6294  			break
  6295  		}
  6296  		d := auxIntToInt64(v_0.AuxInt)
  6297  		v.reset(OpLOONG64MOVVconst)
  6298  		v.AuxInt = int64ToAuxInt(c | d)
  6299  		return true
  6300  	}
  6301  	// match: (ORconst [c] (ORconst [d] x))
  6302  	// cond: is32Bit(c|d)
  6303  	// result: (ORconst [c|d] x)
  6304  	for {
  6305  		c := auxIntToInt64(v.AuxInt)
  6306  		if v_0.Op != OpLOONG64ORconst {
  6307  			break
  6308  		}
  6309  		d := auxIntToInt64(v_0.AuxInt)
  6310  		x := v_0.Args[0]
  6311  		if !(is32Bit(c | d)) {
  6312  			break
  6313  		}
  6314  		v.reset(OpLOONG64ORconst)
  6315  		v.AuxInt = int64ToAuxInt(c | d)
  6316  		v.AddArg(x)
  6317  		return true
  6318  	}
  6319  	return false
  6320  }
  6321  func rewriteValueLOONG64_OpLOONG64REMV(v *Value) bool {
  6322  	v_1 := v.Args[1]
  6323  	v_0 := v.Args[0]
  6324  	// match: (REMV (MOVVconst [c]) (MOVVconst [d]))
  6325  	// cond: d != 0
  6326  	// result: (MOVVconst [c%d])
  6327  	for {
  6328  		if v_0.Op != OpLOONG64MOVVconst {
  6329  			break
  6330  		}
  6331  		c := auxIntToInt64(v_0.AuxInt)
  6332  		if v_1.Op != OpLOONG64MOVVconst {
  6333  			break
  6334  		}
  6335  		d := auxIntToInt64(v_1.AuxInt)
  6336  		if !(d != 0) {
  6337  			break
  6338  		}
  6339  		v.reset(OpLOONG64MOVVconst)
  6340  		v.AuxInt = int64ToAuxInt(c % d)
  6341  		return true
  6342  	}
  6343  	return false
  6344  }
  6345  func rewriteValueLOONG64_OpLOONG64REMVU(v *Value) bool {
  6346  	v_1 := v.Args[1]
  6347  	v_0 := v.Args[0]
  6348  	// match: (REMVU _ (MOVVconst [1]))
  6349  	// result: (MOVVconst [0])
  6350  	for {
  6351  		if v_1.Op != OpLOONG64MOVVconst || auxIntToInt64(v_1.AuxInt) != 1 {
  6352  			break
  6353  		}
  6354  		v.reset(OpLOONG64MOVVconst)
  6355  		v.AuxInt = int64ToAuxInt(0)
  6356  		return true
  6357  	}
  6358  	// match: (REMVU x (MOVVconst [c]))
  6359  	// cond: isPowerOfTwo(c)
  6360  	// result: (ANDconst [c-1] x)
  6361  	for {
  6362  		x := v_0
  6363  		if v_1.Op != OpLOONG64MOVVconst {
  6364  			break
  6365  		}
  6366  		c := auxIntToInt64(v_1.AuxInt)
  6367  		if !(isPowerOfTwo(c)) {
  6368  			break
  6369  		}
  6370  		v.reset(OpLOONG64ANDconst)
  6371  		v.AuxInt = int64ToAuxInt(c - 1)
  6372  		v.AddArg(x)
  6373  		return true
  6374  	}
  6375  	// match: (REMVU (MOVVconst [c]) (MOVVconst [d]))
  6376  	// cond: d != 0
  6377  	// result: (MOVVconst [int64(uint64(c)%uint64(d))])
  6378  	for {
  6379  		if v_0.Op != OpLOONG64MOVVconst {
  6380  			break
  6381  		}
  6382  		c := auxIntToInt64(v_0.AuxInt)
  6383  		if v_1.Op != OpLOONG64MOVVconst {
  6384  			break
  6385  		}
  6386  		d := auxIntToInt64(v_1.AuxInt)
  6387  		if !(d != 0) {
  6388  			break
  6389  		}
  6390  		v.reset(OpLOONG64MOVVconst)
  6391  		v.AuxInt = int64ToAuxInt(int64(uint64(c) % uint64(d)))
  6392  		return true
  6393  	}
  6394  	return false
  6395  }
  6396  func rewriteValueLOONG64_OpLOONG64ROTR(v *Value) bool {
  6397  	v_1 := v.Args[1]
  6398  	v_0 := v.Args[0]
  6399  	// match: (ROTR x (MOVVconst [c]))
  6400  	// result: (ROTRconst x [c&31])
  6401  	for {
  6402  		x := v_0
  6403  		if v_1.Op != OpLOONG64MOVVconst {
  6404  			break
  6405  		}
  6406  		c := auxIntToInt64(v_1.AuxInt)
  6407  		v.reset(OpLOONG64ROTRconst)
  6408  		v.AuxInt = int64ToAuxInt(c & 31)
  6409  		v.AddArg(x)
  6410  		return true
  6411  	}
  6412  	return false
  6413  }
  6414  func rewriteValueLOONG64_OpLOONG64ROTRV(v *Value) bool {
  6415  	v_1 := v.Args[1]
  6416  	v_0 := v.Args[0]
  6417  	// match: (ROTRV x (MOVVconst [c]))
  6418  	// result: (ROTRVconst x [c&63])
  6419  	for {
  6420  		x := v_0
  6421  		if v_1.Op != OpLOONG64MOVVconst {
  6422  			break
  6423  		}
  6424  		c := auxIntToInt64(v_1.AuxInt)
  6425  		v.reset(OpLOONG64ROTRVconst)
  6426  		v.AuxInt = int64ToAuxInt(c & 63)
  6427  		v.AddArg(x)
  6428  		return true
  6429  	}
  6430  	return false
  6431  }
  6432  func rewriteValueLOONG64_OpLOONG64SGT(v *Value) bool {
  6433  	v_1 := v.Args[1]
  6434  	v_0 := v.Args[0]
  6435  	b := v.Block
  6436  	typ := &b.Func.Config.Types
  6437  	// match: (SGT (MOVVconst [c]) (NEGV (SUBVconst [d] x)))
  6438  	// cond: is32Bit(d-c)
  6439  	// result: (SGT x (MOVVconst [d-c]))
  6440  	for {
  6441  		if v_0.Op != OpLOONG64MOVVconst {
  6442  			break
  6443  		}
  6444  		c := auxIntToInt64(v_0.AuxInt)
  6445  		if v_1.Op != OpLOONG64NEGV {
  6446  			break
  6447  		}
  6448  		v_1_0 := v_1.Args[0]
  6449  		if v_1_0.Op != OpLOONG64SUBVconst {
  6450  			break
  6451  		}
  6452  		d := auxIntToInt64(v_1_0.AuxInt)
  6453  		x := v_1_0.Args[0]
  6454  		if !(is32Bit(d - c)) {
  6455  			break
  6456  		}
  6457  		v.reset(OpLOONG64SGT)
  6458  		v0 := b.NewValue0(v.Pos, OpLOONG64MOVVconst, typ.UInt64)
  6459  		v0.AuxInt = int64ToAuxInt(d - c)
  6460  		v.AddArg2(x, v0)
  6461  		return true
  6462  	}
  6463  	// match: (SGT (MOVVconst [c]) x)
  6464  	// cond: is32Bit(c)
  6465  	// result: (SGTconst [c] x)
  6466  	for {
  6467  		if v_0.Op != OpLOONG64MOVVconst {
  6468  			break
  6469  		}
  6470  		c := auxIntToInt64(v_0.AuxInt)
  6471  		x := v_1
  6472  		if !(is32Bit(c)) {
  6473  			break
  6474  		}
  6475  		v.reset(OpLOONG64SGTconst)
  6476  		v.AuxInt = int64ToAuxInt(c)
  6477  		v.AddArg(x)
  6478  		return true
  6479  	}
  6480  	// match: (SGT x x)
  6481  	// result: (MOVVconst [0])
  6482  	for {
  6483  		x := v_0
  6484  		if x != v_1 {
  6485  			break
  6486  		}
  6487  		v.reset(OpLOONG64MOVVconst)
  6488  		v.AuxInt = int64ToAuxInt(0)
  6489  		return true
  6490  	}
  6491  	return false
  6492  }
  6493  func rewriteValueLOONG64_OpLOONG64SGTU(v *Value) bool {
  6494  	v_1 := v.Args[1]
  6495  	v_0 := v.Args[0]
  6496  	// match: (SGTU (MOVVconst [c]) x)
  6497  	// cond: is32Bit(c)
  6498  	// result: (SGTUconst [c] x)
  6499  	for {
  6500  		if v_0.Op != OpLOONG64MOVVconst {
  6501  			break
  6502  		}
  6503  		c := auxIntToInt64(v_0.AuxInt)
  6504  		x := v_1
  6505  		if !(is32Bit(c)) {
  6506  			break
  6507  		}
  6508  		v.reset(OpLOONG64SGTUconst)
  6509  		v.AuxInt = int64ToAuxInt(c)
  6510  		v.AddArg(x)
  6511  		return true
  6512  	}
  6513  	// match: (SGTU x x)
  6514  	// result: (MOVVconst [0])
  6515  	for {
  6516  		x := v_0
  6517  		if x != v_1 {
  6518  			break
  6519  		}
  6520  		v.reset(OpLOONG64MOVVconst)
  6521  		v.AuxInt = int64ToAuxInt(0)
  6522  		return true
  6523  	}
  6524  	return false
  6525  }
  6526  func rewriteValueLOONG64_OpLOONG64SGTUconst(v *Value) bool {
  6527  	v_0 := v.Args[0]
  6528  	// match: (SGTUconst [c] (MOVVconst [d]))
  6529  	// cond: uint64(c)>uint64(d)
  6530  	// result: (MOVVconst [1])
  6531  	for {
  6532  		c := auxIntToInt64(v.AuxInt)
  6533  		if v_0.Op != OpLOONG64MOVVconst {
  6534  			break
  6535  		}
  6536  		d := auxIntToInt64(v_0.AuxInt)
  6537  		if !(uint64(c) > uint64(d)) {
  6538  			break
  6539  		}
  6540  		v.reset(OpLOONG64MOVVconst)
  6541  		v.AuxInt = int64ToAuxInt(1)
  6542  		return true
  6543  	}
  6544  	// match: (SGTUconst [c] (MOVVconst [d]))
  6545  	// cond: uint64(c)<=uint64(d)
  6546  	// result: (MOVVconst [0])
  6547  	for {
  6548  		c := auxIntToInt64(v.AuxInt)
  6549  		if v_0.Op != OpLOONG64MOVVconst {
  6550  			break
  6551  		}
  6552  		d := auxIntToInt64(v_0.AuxInt)
  6553  		if !(uint64(c) <= uint64(d)) {
  6554  			break
  6555  		}
  6556  		v.reset(OpLOONG64MOVVconst)
  6557  		v.AuxInt = int64ToAuxInt(0)
  6558  		return true
  6559  	}
  6560  	// match: (SGTUconst [c] (MOVBUreg _))
  6561  	// cond: 0xff < uint64(c)
  6562  	// result: (MOVVconst [1])
  6563  	for {
  6564  		c := auxIntToInt64(v.AuxInt)
  6565  		if v_0.Op != OpLOONG64MOVBUreg || !(0xff < uint64(c)) {
  6566  			break
  6567  		}
  6568  		v.reset(OpLOONG64MOVVconst)
  6569  		v.AuxInt = int64ToAuxInt(1)
  6570  		return true
  6571  	}
  6572  	// match: (SGTUconst [c] (MOVHUreg _))
  6573  	// cond: 0xffff < uint64(c)
  6574  	// result: (MOVVconst [1])
  6575  	for {
  6576  		c := auxIntToInt64(v.AuxInt)
  6577  		if v_0.Op != OpLOONG64MOVHUreg || !(0xffff < uint64(c)) {
  6578  			break
  6579  		}
  6580  		v.reset(OpLOONG64MOVVconst)
  6581  		v.AuxInt = int64ToAuxInt(1)
  6582  		return true
  6583  	}
  6584  	// match: (SGTUconst [c] (ANDconst [m] _))
  6585  	// cond: uint64(m) < uint64(c)
  6586  	// result: (MOVVconst [1])
  6587  	for {
  6588  		c := auxIntToInt64(v.AuxInt)
  6589  		if v_0.Op != OpLOONG64ANDconst {
  6590  			break
  6591  		}
  6592  		m := auxIntToInt64(v_0.AuxInt)
  6593  		if !(uint64(m) < uint64(c)) {
  6594  			break
  6595  		}
  6596  		v.reset(OpLOONG64MOVVconst)
  6597  		v.AuxInt = int64ToAuxInt(1)
  6598  		return true
  6599  	}
  6600  	// match: (SGTUconst [c] (SRLVconst _ [d]))
  6601  	// cond: 0 < d && d <= 63 && 0xffffffffffffffff>>uint64(d) < uint64(c)
  6602  	// result: (MOVVconst [1])
  6603  	for {
  6604  		c := auxIntToInt64(v.AuxInt)
  6605  		if v_0.Op != OpLOONG64SRLVconst {
  6606  			break
  6607  		}
  6608  		d := auxIntToInt64(v_0.AuxInt)
  6609  		if !(0 < d && d <= 63 && 0xffffffffffffffff>>uint64(d) < uint64(c)) {
  6610  			break
  6611  		}
  6612  		v.reset(OpLOONG64MOVVconst)
  6613  		v.AuxInt = int64ToAuxInt(1)
  6614  		return true
  6615  	}
  6616  	return false
  6617  }
  6618  func rewriteValueLOONG64_OpLOONG64SGTconst(v *Value) bool {
  6619  	v_0 := v.Args[0]
  6620  	// match: (SGTconst [c] (MOVVconst [d]))
  6621  	// cond: c>d
  6622  	// result: (MOVVconst [1])
  6623  	for {
  6624  		c := auxIntToInt64(v.AuxInt)
  6625  		if v_0.Op != OpLOONG64MOVVconst {
  6626  			break
  6627  		}
  6628  		d := auxIntToInt64(v_0.AuxInt)
  6629  		if !(c > d) {
  6630  			break
  6631  		}
  6632  		v.reset(OpLOONG64MOVVconst)
  6633  		v.AuxInt = int64ToAuxInt(1)
  6634  		return true
  6635  	}
  6636  	// match: (SGTconst [c] (MOVVconst [d]))
  6637  	// cond: c<=d
  6638  	// result: (MOVVconst [0])
  6639  	for {
  6640  		c := auxIntToInt64(v.AuxInt)
  6641  		if v_0.Op != OpLOONG64MOVVconst {
  6642  			break
  6643  		}
  6644  		d := auxIntToInt64(v_0.AuxInt)
  6645  		if !(c <= d) {
  6646  			break
  6647  		}
  6648  		v.reset(OpLOONG64MOVVconst)
  6649  		v.AuxInt = int64ToAuxInt(0)
  6650  		return true
  6651  	}
  6652  	// match: (SGTconst [c] (MOVBreg _))
  6653  	// cond: 0x7f < c
  6654  	// result: (MOVVconst [1])
  6655  	for {
  6656  		c := auxIntToInt64(v.AuxInt)
  6657  		if v_0.Op != OpLOONG64MOVBreg || !(0x7f < c) {
  6658  			break
  6659  		}
  6660  		v.reset(OpLOONG64MOVVconst)
  6661  		v.AuxInt = int64ToAuxInt(1)
  6662  		return true
  6663  	}
  6664  	// match: (SGTconst [c] (MOVBreg _))
  6665  	// cond: c <= -0x80
  6666  	// result: (MOVVconst [0])
  6667  	for {
  6668  		c := auxIntToInt64(v.AuxInt)
  6669  		if v_0.Op != OpLOONG64MOVBreg || !(c <= -0x80) {
  6670  			break
  6671  		}
  6672  		v.reset(OpLOONG64MOVVconst)
  6673  		v.AuxInt = int64ToAuxInt(0)
  6674  		return true
  6675  	}
  6676  	// match: (SGTconst [c] (MOVBUreg _))
  6677  	// cond: 0xff < c
  6678  	// result: (MOVVconst [1])
  6679  	for {
  6680  		c := auxIntToInt64(v.AuxInt)
  6681  		if v_0.Op != OpLOONG64MOVBUreg || !(0xff < c) {
  6682  			break
  6683  		}
  6684  		v.reset(OpLOONG64MOVVconst)
  6685  		v.AuxInt = int64ToAuxInt(1)
  6686  		return true
  6687  	}
  6688  	// match: (SGTconst [c] (MOVBUreg _))
  6689  	// cond: c < 0
  6690  	// result: (MOVVconst [0])
  6691  	for {
  6692  		c := auxIntToInt64(v.AuxInt)
  6693  		if v_0.Op != OpLOONG64MOVBUreg || !(c < 0) {
  6694  			break
  6695  		}
  6696  		v.reset(OpLOONG64MOVVconst)
  6697  		v.AuxInt = int64ToAuxInt(0)
  6698  		return true
  6699  	}
  6700  	// match: (SGTconst [c] (MOVHreg _))
  6701  	// cond: 0x7fff < c
  6702  	// result: (MOVVconst [1])
  6703  	for {
  6704  		c := auxIntToInt64(v.AuxInt)
  6705  		if v_0.Op != OpLOONG64MOVHreg || !(0x7fff < c) {
  6706  			break
  6707  		}
  6708  		v.reset(OpLOONG64MOVVconst)
  6709  		v.AuxInt = int64ToAuxInt(1)
  6710  		return true
  6711  	}
  6712  	// match: (SGTconst [c] (MOVHreg _))
  6713  	// cond: c <= -0x8000
  6714  	// result: (MOVVconst [0])
  6715  	for {
  6716  		c := auxIntToInt64(v.AuxInt)
  6717  		if v_0.Op != OpLOONG64MOVHreg || !(c <= -0x8000) {
  6718  			break
  6719  		}
  6720  		v.reset(OpLOONG64MOVVconst)
  6721  		v.AuxInt = int64ToAuxInt(0)
  6722  		return true
  6723  	}
  6724  	// match: (SGTconst [c] (MOVHUreg _))
  6725  	// cond: 0xffff < c
  6726  	// result: (MOVVconst [1])
  6727  	for {
  6728  		c := auxIntToInt64(v.AuxInt)
  6729  		if v_0.Op != OpLOONG64MOVHUreg || !(0xffff < c) {
  6730  			break
  6731  		}
  6732  		v.reset(OpLOONG64MOVVconst)
  6733  		v.AuxInt = int64ToAuxInt(1)
  6734  		return true
  6735  	}
  6736  	// match: (SGTconst [c] (MOVHUreg _))
  6737  	// cond: c < 0
  6738  	// result: (MOVVconst [0])
  6739  	for {
  6740  		c := auxIntToInt64(v.AuxInt)
  6741  		if v_0.Op != OpLOONG64MOVHUreg || !(c < 0) {
  6742  			break
  6743  		}
  6744  		v.reset(OpLOONG64MOVVconst)
  6745  		v.AuxInt = int64ToAuxInt(0)
  6746  		return true
  6747  	}
  6748  	// match: (SGTconst [c] (MOVWUreg _))
  6749  	// cond: c < 0
  6750  	// result: (MOVVconst [0])
  6751  	for {
  6752  		c := auxIntToInt64(v.AuxInt)
  6753  		if v_0.Op != OpLOONG64MOVWUreg || !(c < 0) {
  6754  			break
  6755  		}
  6756  		v.reset(OpLOONG64MOVVconst)
  6757  		v.AuxInt = int64ToAuxInt(0)
  6758  		return true
  6759  	}
  6760  	// match: (SGTconst [c] (ANDconst [m] _))
  6761  	// cond: 0 <= m && m < c
  6762  	// result: (MOVVconst [1])
  6763  	for {
  6764  		c := auxIntToInt64(v.AuxInt)
  6765  		if v_0.Op != OpLOONG64ANDconst {
  6766  			break
  6767  		}
  6768  		m := auxIntToInt64(v_0.AuxInt)
  6769  		if !(0 <= m && m < c) {
  6770  			break
  6771  		}
  6772  		v.reset(OpLOONG64MOVVconst)
  6773  		v.AuxInt = int64ToAuxInt(1)
  6774  		return true
  6775  	}
  6776  	// match: (SGTconst [c] (SRLVconst _ [d]))
  6777  	// cond: 0 <= c && 0 < d && d <= 63 && 0xffffffffffffffff>>uint64(d) < uint64(c)
  6778  	// result: (MOVVconst [1])
  6779  	for {
  6780  		c := auxIntToInt64(v.AuxInt)
  6781  		if v_0.Op != OpLOONG64SRLVconst {
  6782  			break
  6783  		}
  6784  		d := auxIntToInt64(v_0.AuxInt)
  6785  		if !(0 <= c && 0 < d && d <= 63 && 0xffffffffffffffff>>uint64(d) < uint64(c)) {
  6786  			break
  6787  		}
  6788  		v.reset(OpLOONG64MOVVconst)
  6789  		v.AuxInt = int64ToAuxInt(1)
  6790  		return true
  6791  	}
  6792  	return false
  6793  }
  6794  func rewriteValueLOONG64_OpLOONG64SLL(v *Value) bool {
  6795  	v_1 := v.Args[1]
  6796  	v_0 := v.Args[0]
  6797  	// match: (SLL _ (MOVVconst [c]))
  6798  	// cond: uint64(c)>=32
  6799  	// result: (MOVVconst [0])
  6800  	for {
  6801  		if v_1.Op != OpLOONG64MOVVconst {
  6802  			break
  6803  		}
  6804  		c := auxIntToInt64(v_1.AuxInt)
  6805  		if !(uint64(c) >= 32) {
  6806  			break
  6807  		}
  6808  		v.reset(OpLOONG64MOVVconst)
  6809  		v.AuxInt = int64ToAuxInt(0)
  6810  		return true
  6811  	}
  6812  	// match: (SLL x (MOVVconst [c]))
  6813  	// cond: uint64(c) >=0 && uint64(c) <=31
  6814  	// result: (SLLconst x [c])
  6815  	for {
  6816  		x := v_0
  6817  		if v_1.Op != OpLOONG64MOVVconst {
  6818  			break
  6819  		}
  6820  		c := auxIntToInt64(v_1.AuxInt)
  6821  		if !(uint64(c) >= 0 && uint64(c) <= 31) {
  6822  			break
  6823  		}
  6824  		v.reset(OpLOONG64SLLconst)
  6825  		v.AuxInt = int64ToAuxInt(c)
  6826  		v.AddArg(x)
  6827  		return true
  6828  	}
  6829  	// match: (SLL x (ANDconst [31] y))
  6830  	// result: (SLL x y)
  6831  	for {
  6832  		x := v_0
  6833  		if v_1.Op != OpLOONG64ANDconst || auxIntToInt64(v_1.AuxInt) != 31 {
  6834  			break
  6835  		}
  6836  		y := v_1.Args[0]
  6837  		v.reset(OpLOONG64SLL)
  6838  		v.AddArg2(x, y)
  6839  		return true
  6840  	}
  6841  	return false
  6842  }
  6843  func rewriteValueLOONG64_OpLOONG64SLLV(v *Value) bool {
  6844  	v_1 := v.Args[1]
  6845  	v_0 := v.Args[0]
  6846  	// match: (SLLV _ (MOVVconst [c]))
  6847  	// cond: uint64(c)>=64
  6848  	// result: (MOVVconst [0])
  6849  	for {
  6850  		if v_1.Op != OpLOONG64MOVVconst {
  6851  			break
  6852  		}
  6853  		c := auxIntToInt64(v_1.AuxInt)
  6854  		if !(uint64(c) >= 64) {
  6855  			break
  6856  		}
  6857  		v.reset(OpLOONG64MOVVconst)
  6858  		v.AuxInt = int64ToAuxInt(0)
  6859  		return true
  6860  	}
  6861  	// match: (SLLV x (MOVVconst [c]))
  6862  	// result: (SLLVconst x [c])
  6863  	for {
  6864  		x := v_0
  6865  		if v_1.Op != OpLOONG64MOVVconst {
  6866  			break
  6867  		}
  6868  		c := auxIntToInt64(v_1.AuxInt)
  6869  		v.reset(OpLOONG64SLLVconst)
  6870  		v.AuxInt = int64ToAuxInt(c)
  6871  		v.AddArg(x)
  6872  		return true
  6873  	}
  6874  	// match: (SLLV x (ANDconst [63] y))
  6875  	// result: (SLLV x y)
  6876  	for {
  6877  		x := v_0
  6878  		if v_1.Op != OpLOONG64ANDconst || auxIntToInt64(v_1.AuxInt) != 63 {
  6879  			break
  6880  		}
  6881  		y := v_1.Args[0]
  6882  		v.reset(OpLOONG64SLLV)
  6883  		v.AddArg2(x, y)
  6884  		return true
  6885  	}
  6886  	return false
  6887  }
  6888  func rewriteValueLOONG64_OpLOONG64SLLVconst(v *Value) bool {
  6889  	v_0 := v.Args[0]
  6890  	// match: (SLLVconst <t> [c] (ADDV x x))
  6891  	// cond: c < t.Size() * 8 - 1
  6892  	// result: (SLLVconst [c+1] x)
  6893  	for {
  6894  		t := v.Type
  6895  		c := auxIntToInt64(v.AuxInt)
  6896  		if v_0.Op != OpLOONG64ADDV {
  6897  			break
  6898  		}
  6899  		x := v_0.Args[1]
  6900  		if x != v_0.Args[0] || !(c < t.Size()*8-1) {
  6901  			break
  6902  		}
  6903  		v.reset(OpLOONG64SLLVconst)
  6904  		v.AuxInt = int64ToAuxInt(c + 1)
  6905  		v.AddArg(x)
  6906  		return true
  6907  	}
  6908  	// match: (SLLVconst <t> [c] (ADDV x x))
  6909  	// cond: c >= t.Size() * 8 - 1
  6910  	// result: (MOVVconst [0])
  6911  	for {
  6912  		t := v.Type
  6913  		c := auxIntToInt64(v.AuxInt)
  6914  		if v_0.Op != OpLOONG64ADDV {
  6915  			break
  6916  		}
  6917  		x := v_0.Args[1]
  6918  		if x != v_0.Args[0] || !(c >= t.Size()*8-1) {
  6919  			break
  6920  		}
  6921  		v.reset(OpLOONG64MOVVconst)
  6922  		v.AuxInt = int64ToAuxInt(0)
  6923  		return true
  6924  	}
  6925  	// match: (SLLVconst [c] (MOVVconst [d]))
  6926  	// result: (MOVVconst [d<<uint64(c)])
  6927  	for {
  6928  		c := auxIntToInt64(v.AuxInt)
  6929  		if v_0.Op != OpLOONG64MOVVconst {
  6930  			break
  6931  		}
  6932  		d := auxIntToInt64(v_0.AuxInt)
  6933  		v.reset(OpLOONG64MOVVconst)
  6934  		v.AuxInt = int64ToAuxInt(d << uint64(c))
  6935  		return true
  6936  	}
  6937  	return false
  6938  }
  6939  func rewriteValueLOONG64_OpLOONG64SLLconst(v *Value) bool {
  6940  	v_0 := v.Args[0]
  6941  	// match: (SLLconst <t> [c] (ADDV x x))
  6942  	// cond: c < t.Size() * 8 - 1
  6943  	// result: (SLLconst [c+1] x)
  6944  	for {
  6945  		t := v.Type
  6946  		c := auxIntToInt64(v.AuxInt)
  6947  		if v_0.Op != OpLOONG64ADDV {
  6948  			break
  6949  		}
  6950  		x := v_0.Args[1]
  6951  		if x != v_0.Args[0] || !(c < t.Size()*8-1) {
  6952  			break
  6953  		}
  6954  		v.reset(OpLOONG64SLLconst)
  6955  		v.AuxInt = int64ToAuxInt(c + 1)
  6956  		v.AddArg(x)
  6957  		return true
  6958  	}
  6959  	// match: (SLLconst <t> [c] (ADDV x x))
  6960  	// cond: c >= t.Size() * 8 - 1
  6961  	// result: (MOVVconst [0])
  6962  	for {
  6963  		t := v.Type
  6964  		c := auxIntToInt64(v.AuxInt)
  6965  		if v_0.Op != OpLOONG64ADDV {
  6966  			break
  6967  		}
  6968  		x := v_0.Args[1]
  6969  		if x != v_0.Args[0] || !(c >= t.Size()*8-1) {
  6970  			break
  6971  		}
  6972  		v.reset(OpLOONG64MOVVconst)
  6973  		v.AuxInt = int64ToAuxInt(0)
  6974  		return true
  6975  	}
  6976  	return false
  6977  }
  6978  func rewriteValueLOONG64_OpLOONG64SRA(v *Value) bool {
  6979  	v_1 := v.Args[1]
  6980  	v_0 := v.Args[0]
  6981  	// match: (SRA x (MOVVconst [c]))
  6982  	// cond: uint64(c)>=32
  6983  	// result: (SRAconst x [31])
  6984  	for {
  6985  		x := v_0
  6986  		if v_1.Op != OpLOONG64MOVVconst {
  6987  			break
  6988  		}
  6989  		c := auxIntToInt64(v_1.AuxInt)
  6990  		if !(uint64(c) >= 32) {
  6991  			break
  6992  		}
  6993  		v.reset(OpLOONG64SRAconst)
  6994  		v.AuxInt = int64ToAuxInt(31)
  6995  		v.AddArg(x)
  6996  		return true
  6997  	}
  6998  	// match: (SRA x (MOVVconst [c]))
  6999  	// cond: uint64(c) >=0 && uint64(c) <=31
  7000  	// result: (SRAconst x [c])
  7001  	for {
  7002  		x := v_0
  7003  		if v_1.Op != OpLOONG64MOVVconst {
  7004  			break
  7005  		}
  7006  		c := auxIntToInt64(v_1.AuxInt)
  7007  		if !(uint64(c) >= 0 && uint64(c) <= 31) {
  7008  			break
  7009  		}
  7010  		v.reset(OpLOONG64SRAconst)
  7011  		v.AuxInt = int64ToAuxInt(c)
  7012  		v.AddArg(x)
  7013  		return true
  7014  	}
  7015  	// match: (SRA x (ANDconst [31] y))
  7016  	// result: (SRA x y)
  7017  	for {
  7018  		x := v_0
  7019  		if v_1.Op != OpLOONG64ANDconst || auxIntToInt64(v_1.AuxInt) != 31 {
  7020  			break
  7021  		}
  7022  		y := v_1.Args[0]
  7023  		v.reset(OpLOONG64SRA)
  7024  		v.AddArg2(x, y)
  7025  		return true
  7026  	}
  7027  	return false
  7028  }
  7029  func rewriteValueLOONG64_OpLOONG64SRAV(v *Value) bool {
  7030  	v_1 := v.Args[1]
  7031  	v_0 := v.Args[0]
  7032  	// match: (SRAV x (MOVVconst [c]))
  7033  	// cond: uint64(c)>=64
  7034  	// result: (SRAVconst x [63])
  7035  	for {
  7036  		x := v_0
  7037  		if v_1.Op != OpLOONG64MOVVconst {
  7038  			break
  7039  		}
  7040  		c := auxIntToInt64(v_1.AuxInt)
  7041  		if !(uint64(c) >= 64) {
  7042  			break
  7043  		}
  7044  		v.reset(OpLOONG64SRAVconst)
  7045  		v.AuxInt = int64ToAuxInt(63)
  7046  		v.AddArg(x)
  7047  		return true
  7048  	}
  7049  	// match: (SRAV x (MOVVconst [c]))
  7050  	// result: (SRAVconst x [c])
  7051  	for {
  7052  		x := v_0
  7053  		if v_1.Op != OpLOONG64MOVVconst {
  7054  			break
  7055  		}
  7056  		c := auxIntToInt64(v_1.AuxInt)
  7057  		v.reset(OpLOONG64SRAVconst)
  7058  		v.AuxInt = int64ToAuxInt(c)
  7059  		v.AddArg(x)
  7060  		return true
  7061  	}
  7062  	// match: (SRAV x (ANDconst [63] y))
  7063  	// result: (SRAV x y)
  7064  	for {
  7065  		x := v_0
  7066  		if v_1.Op != OpLOONG64ANDconst || auxIntToInt64(v_1.AuxInt) != 63 {
  7067  			break
  7068  		}
  7069  		y := v_1.Args[0]
  7070  		v.reset(OpLOONG64SRAV)
  7071  		v.AddArg2(x, y)
  7072  		return true
  7073  	}
  7074  	return false
  7075  }
  7076  func rewriteValueLOONG64_OpLOONG64SRAVconst(v *Value) bool {
  7077  	v_0 := v.Args[0]
  7078  	b := v.Block
  7079  	// match: (SRAVconst [rc] (MOVWreg y))
  7080  	// cond: rc >= 0 && rc <= 31
  7081  	// result: (SRAconst [int64(rc)] y)
  7082  	for {
  7083  		rc := auxIntToInt64(v.AuxInt)
  7084  		if v_0.Op != OpLOONG64MOVWreg {
  7085  			break
  7086  		}
  7087  		y := v_0.Args[0]
  7088  		if !(rc >= 0 && rc <= 31) {
  7089  			break
  7090  		}
  7091  		v.reset(OpLOONG64SRAconst)
  7092  		v.AuxInt = int64ToAuxInt(int64(rc))
  7093  		v.AddArg(y)
  7094  		return true
  7095  	}
  7096  	// match: (SRAVconst <t> [rc] (MOVBreg y))
  7097  	// cond: rc >= 8
  7098  	// result: (SRAVconst [63] (SLLVconst <t> [56] y))
  7099  	for {
  7100  		t := v.Type
  7101  		rc := auxIntToInt64(v.AuxInt)
  7102  		if v_0.Op != OpLOONG64MOVBreg {
  7103  			break
  7104  		}
  7105  		y := v_0.Args[0]
  7106  		if !(rc >= 8) {
  7107  			break
  7108  		}
  7109  		v.reset(OpLOONG64SRAVconst)
  7110  		v.AuxInt = int64ToAuxInt(63)
  7111  		v0 := b.NewValue0(v.Pos, OpLOONG64SLLVconst, t)
  7112  		v0.AuxInt = int64ToAuxInt(56)
  7113  		v0.AddArg(y)
  7114  		v.AddArg(v0)
  7115  		return true
  7116  	}
  7117  	// match: (SRAVconst <t> [rc] (MOVHreg y))
  7118  	// cond: rc >= 16
  7119  	// result: (SRAVconst [63] (SLLVconst <t> [48] y))
  7120  	for {
  7121  		t := v.Type
  7122  		rc := auxIntToInt64(v.AuxInt)
  7123  		if v_0.Op != OpLOONG64MOVHreg {
  7124  			break
  7125  		}
  7126  		y := v_0.Args[0]
  7127  		if !(rc >= 16) {
  7128  			break
  7129  		}
  7130  		v.reset(OpLOONG64SRAVconst)
  7131  		v.AuxInt = int64ToAuxInt(63)
  7132  		v0 := b.NewValue0(v.Pos, OpLOONG64SLLVconst, t)
  7133  		v0.AuxInt = int64ToAuxInt(48)
  7134  		v0.AddArg(y)
  7135  		v.AddArg(v0)
  7136  		return true
  7137  	}
  7138  	// match: (SRAVconst <t> [rc] (MOVWreg y))
  7139  	// cond: rc >= 32
  7140  	// result: (SRAconst [31] y)
  7141  	for {
  7142  		rc := auxIntToInt64(v.AuxInt)
  7143  		if v_0.Op != OpLOONG64MOVWreg {
  7144  			break
  7145  		}
  7146  		y := v_0.Args[0]
  7147  		if !(rc >= 32) {
  7148  			break
  7149  		}
  7150  		v.reset(OpLOONG64SRAconst)
  7151  		v.AuxInt = int64ToAuxInt(31)
  7152  		v.AddArg(y)
  7153  		return true
  7154  	}
  7155  	// match: (SRAVconst [c] (MOVVconst [d]))
  7156  	// result: (MOVVconst [d>>uint64(c)])
  7157  	for {
  7158  		c := auxIntToInt64(v.AuxInt)
  7159  		if v_0.Op != OpLOONG64MOVVconst {
  7160  			break
  7161  		}
  7162  		d := auxIntToInt64(v_0.AuxInt)
  7163  		v.reset(OpLOONG64MOVVconst)
  7164  		v.AuxInt = int64ToAuxInt(d >> uint64(c))
  7165  		return true
  7166  	}
  7167  	return false
  7168  }
  7169  func rewriteValueLOONG64_OpLOONG64SRL(v *Value) bool {
  7170  	v_1 := v.Args[1]
  7171  	v_0 := v.Args[0]
  7172  	// match: (SRL _ (MOVVconst [c]))
  7173  	// cond: uint64(c)>=32
  7174  	// result: (MOVVconst [0])
  7175  	for {
  7176  		if v_1.Op != OpLOONG64MOVVconst {
  7177  			break
  7178  		}
  7179  		c := auxIntToInt64(v_1.AuxInt)
  7180  		if !(uint64(c) >= 32) {
  7181  			break
  7182  		}
  7183  		v.reset(OpLOONG64MOVVconst)
  7184  		v.AuxInt = int64ToAuxInt(0)
  7185  		return true
  7186  	}
  7187  	// match: (SRL x (MOVVconst [c]))
  7188  	// cond: uint64(c) >=0 && uint64(c) <=31
  7189  	// result: (SRLconst x [c])
  7190  	for {
  7191  		x := v_0
  7192  		if v_1.Op != OpLOONG64MOVVconst {
  7193  			break
  7194  		}
  7195  		c := auxIntToInt64(v_1.AuxInt)
  7196  		if !(uint64(c) >= 0 && uint64(c) <= 31) {
  7197  			break
  7198  		}
  7199  		v.reset(OpLOONG64SRLconst)
  7200  		v.AuxInt = int64ToAuxInt(c)
  7201  		v.AddArg(x)
  7202  		return true
  7203  	}
  7204  	// match: (SRL x (ANDconst [31] y))
  7205  	// result: (SRL x y)
  7206  	for {
  7207  		x := v_0
  7208  		if v_1.Op != OpLOONG64ANDconst || auxIntToInt64(v_1.AuxInt) != 31 {
  7209  			break
  7210  		}
  7211  		y := v_1.Args[0]
  7212  		v.reset(OpLOONG64SRL)
  7213  		v.AddArg2(x, y)
  7214  		return true
  7215  	}
  7216  	return false
  7217  }
  7218  func rewriteValueLOONG64_OpLOONG64SRLV(v *Value) bool {
  7219  	v_1 := v.Args[1]
  7220  	v_0 := v.Args[0]
  7221  	// match: (SRLV _ (MOVVconst [c]))
  7222  	// cond: uint64(c)>=64
  7223  	// result: (MOVVconst [0])
  7224  	for {
  7225  		if v_1.Op != OpLOONG64MOVVconst {
  7226  			break
  7227  		}
  7228  		c := auxIntToInt64(v_1.AuxInt)
  7229  		if !(uint64(c) >= 64) {
  7230  			break
  7231  		}
  7232  		v.reset(OpLOONG64MOVVconst)
  7233  		v.AuxInt = int64ToAuxInt(0)
  7234  		return true
  7235  	}
  7236  	// match: (SRLV x (MOVVconst [c]))
  7237  	// result: (SRLVconst x [c])
  7238  	for {
  7239  		x := v_0
  7240  		if v_1.Op != OpLOONG64MOVVconst {
  7241  			break
  7242  		}
  7243  		c := auxIntToInt64(v_1.AuxInt)
  7244  		v.reset(OpLOONG64SRLVconst)
  7245  		v.AuxInt = int64ToAuxInt(c)
  7246  		v.AddArg(x)
  7247  		return true
  7248  	}
  7249  	// match: (SRLV x (ANDconst [63] y))
  7250  	// result: (SRLV x y)
  7251  	for {
  7252  		x := v_0
  7253  		if v_1.Op != OpLOONG64ANDconst || auxIntToInt64(v_1.AuxInt) != 63 {
  7254  			break
  7255  		}
  7256  		y := v_1.Args[0]
  7257  		v.reset(OpLOONG64SRLV)
  7258  		v.AddArg2(x, y)
  7259  		return true
  7260  	}
  7261  	return false
  7262  }
  7263  func rewriteValueLOONG64_OpLOONG64SRLVconst(v *Value) bool {
  7264  	v_0 := v.Args[0]
  7265  	// match: (SRLVconst [rc] (SLLVconst [lc] x))
  7266  	// cond: lc <= rc
  7267  	// result: (BSTRPICKV [rc-lc + ((64-lc)-1)<<6] x)
  7268  	for {
  7269  		rc := auxIntToInt64(v.AuxInt)
  7270  		if v_0.Op != OpLOONG64SLLVconst {
  7271  			break
  7272  		}
  7273  		lc := auxIntToInt64(v_0.AuxInt)
  7274  		x := v_0.Args[0]
  7275  		if !(lc <= rc) {
  7276  			break
  7277  		}
  7278  		v.reset(OpLOONG64BSTRPICKV)
  7279  		v.AuxInt = int64ToAuxInt(rc - lc + ((64-lc)-1)<<6)
  7280  		v.AddArg(x)
  7281  		return true
  7282  	}
  7283  	// match: (SRLVconst [rc] (MOVWUreg x))
  7284  	// cond: rc < 32
  7285  	// result: (BSTRPICKV [rc + 31<<6] x)
  7286  	for {
  7287  		rc := auxIntToInt64(v.AuxInt)
  7288  		if v_0.Op != OpLOONG64MOVWUreg {
  7289  			break
  7290  		}
  7291  		x := v_0.Args[0]
  7292  		if !(rc < 32) {
  7293  			break
  7294  		}
  7295  		v.reset(OpLOONG64BSTRPICKV)
  7296  		v.AuxInt = int64ToAuxInt(rc + 31<<6)
  7297  		v.AddArg(x)
  7298  		return true
  7299  	}
  7300  	// match: (SRLVconst [rc] (MOVHUreg x))
  7301  	// cond: rc < 16
  7302  	// result: (BSTRPICKV [rc + 15<<6] x)
  7303  	for {
  7304  		rc := auxIntToInt64(v.AuxInt)
  7305  		if v_0.Op != OpLOONG64MOVHUreg {
  7306  			break
  7307  		}
  7308  		x := v_0.Args[0]
  7309  		if !(rc < 16) {
  7310  			break
  7311  		}
  7312  		v.reset(OpLOONG64BSTRPICKV)
  7313  		v.AuxInt = int64ToAuxInt(rc + 15<<6)
  7314  		v.AddArg(x)
  7315  		return true
  7316  	}
  7317  	// match: (SRLVconst [rc] (MOVBUreg x))
  7318  	// cond: rc < 8
  7319  	// result: (BSTRPICKV [rc + 7<<6] x)
  7320  	for {
  7321  		rc := auxIntToInt64(v.AuxInt)
  7322  		if v_0.Op != OpLOONG64MOVBUreg {
  7323  			break
  7324  		}
  7325  		x := v_0.Args[0]
  7326  		if !(rc < 8) {
  7327  			break
  7328  		}
  7329  		v.reset(OpLOONG64BSTRPICKV)
  7330  		v.AuxInt = int64ToAuxInt(rc + 7<<6)
  7331  		v.AddArg(x)
  7332  		return true
  7333  	}
  7334  	// match: (SRLVconst [rc] (MOVWUreg y))
  7335  	// cond: rc >= 0 && rc <= 31
  7336  	// result: (SRLconst [int64(rc)] y)
  7337  	for {
  7338  		rc := auxIntToInt64(v.AuxInt)
  7339  		if v_0.Op != OpLOONG64MOVWUreg {
  7340  			break
  7341  		}
  7342  		y := v_0.Args[0]
  7343  		if !(rc >= 0 && rc <= 31) {
  7344  			break
  7345  		}
  7346  		v.reset(OpLOONG64SRLconst)
  7347  		v.AuxInt = int64ToAuxInt(int64(rc))
  7348  		v.AddArg(y)
  7349  		return true
  7350  	}
  7351  	// match: (SRLVconst [rc] (MOVWUreg x))
  7352  	// cond: rc >= 32
  7353  	// result: (MOVVconst [0])
  7354  	for {
  7355  		rc := auxIntToInt64(v.AuxInt)
  7356  		if v_0.Op != OpLOONG64MOVWUreg {
  7357  			break
  7358  		}
  7359  		if !(rc >= 32) {
  7360  			break
  7361  		}
  7362  		v.reset(OpLOONG64MOVVconst)
  7363  		v.AuxInt = int64ToAuxInt(0)
  7364  		return true
  7365  	}
  7366  	// match: (SRLVconst [rc] (MOVHUreg x))
  7367  	// cond: rc >= 16
  7368  	// result: (MOVVconst [0])
  7369  	for {
  7370  		rc := auxIntToInt64(v.AuxInt)
  7371  		if v_0.Op != OpLOONG64MOVHUreg {
  7372  			break
  7373  		}
  7374  		if !(rc >= 16) {
  7375  			break
  7376  		}
  7377  		v.reset(OpLOONG64MOVVconst)
  7378  		v.AuxInt = int64ToAuxInt(0)
  7379  		return true
  7380  	}
  7381  	// match: (SRLVconst [rc] (MOVBUreg x))
  7382  	// cond: rc >= 8
  7383  	// result: (MOVVconst [0])
  7384  	for {
  7385  		rc := auxIntToInt64(v.AuxInt)
  7386  		if v_0.Op != OpLOONG64MOVBUreg {
  7387  			break
  7388  		}
  7389  		if !(rc >= 8) {
  7390  			break
  7391  		}
  7392  		v.reset(OpLOONG64MOVVconst)
  7393  		v.AuxInt = int64ToAuxInt(0)
  7394  		return true
  7395  	}
  7396  	// match: (SRLVconst [c] (MOVVconst [d]))
  7397  	// result: (MOVVconst [int64(uint64(d)>>uint64(c))])
  7398  	for {
  7399  		c := auxIntToInt64(v.AuxInt)
  7400  		if v_0.Op != OpLOONG64MOVVconst {
  7401  			break
  7402  		}
  7403  		d := auxIntToInt64(v_0.AuxInt)
  7404  		v.reset(OpLOONG64MOVVconst)
  7405  		v.AuxInt = int64ToAuxInt(int64(uint64(d) >> uint64(c)))
  7406  		return true
  7407  	}
  7408  	return false
  7409  }
  7410  func rewriteValueLOONG64_OpLOONG64SUBD(v *Value) bool {
  7411  	v_1 := v.Args[1]
  7412  	v_0 := v.Args[0]
  7413  	// match: (SUBD (MULD x y) z)
  7414  	// cond: z.Block.Func.useFMA(v)
  7415  	// result: (FMSUBD x y z)
  7416  	for {
  7417  		if v_0.Op != OpLOONG64MULD {
  7418  			break
  7419  		}
  7420  		y := v_0.Args[1]
  7421  		x := v_0.Args[0]
  7422  		z := v_1
  7423  		if !(z.Block.Func.useFMA(v)) {
  7424  			break
  7425  		}
  7426  		v.reset(OpLOONG64FMSUBD)
  7427  		v.AddArg3(x, y, z)
  7428  		return true
  7429  	}
  7430  	// match: (SUBD z (MULD x y))
  7431  	// cond: z.Block.Func.useFMA(v)
  7432  	// result: (FNMSUBD x y z)
  7433  	for {
  7434  		z := v_0
  7435  		if v_1.Op != OpLOONG64MULD {
  7436  			break
  7437  		}
  7438  		y := v_1.Args[1]
  7439  		x := v_1.Args[0]
  7440  		if !(z.Block.Func.useFMA(v)) {
  7441  			break
  7442  		}
  7443  		v.reset(OpLOONG64FNMSUBD)
  7444  		v.AddArg3(x, y, z)
  7445  		return true
  7446  	}
  7447  	// match: (SUBD z (NEGD (MULD x y)))
  7448  	// cond: z.Block.Func.useFMA(v)
  7449  	// result: (FMADDD x y z)
  7450  	for {
  7451  		z := v_0
  7452  		if v_1.Op != OpLOONG64NEGD {
  7453  			break
  7454  		}
  7455  		v_1_0 := v_1.Args[0]
  7456  		if v_1_0.Op != OpLOONG64MULD {
  7457  			break
  7458  		}
  7459  		y := v_1_0.Args[1]
  7460  		x := v_1_0.Args[0]
  7461  		if !(z.Block.Func.useFMA(v)) {
  7462  			break
  7463  		}
  7464  		v.reset(OpLOONG64FMADDD)
  7465  		v.AddArg3(x, y, z)
  7466  		return true
  7467  	}
  7468  	// match: (SUBD (NEGD (MULD x y)) z)
  7469  	// cond: z.Block.Func.useFMA(v)
  7470  	// result: (FNMADDD x y z)
  7471  	for {
  7472  		if v_0.Op != OpLOONG64NEGD {
  7473  			break
  7474  		}
  7475  		v_0_0 := v_0.Args[0]
  7476  		if v_0_0.Op != OpLOONG64MULD {
  7477  			break
  7478  		}
  7479  		y := v_0_0.Args[1]
  7480  		x := v_0_0.Args[0]
  7481  		z := v_1
  7482  		if !(z.Block.Func.useFMA(v)) {
  7483  			break
  7484  		}
  7485  		v.reset(OpLOONG64FNMADDD)
  7486  		v.AddArg3(x, y, z)
  7487  		return true
  7488  	}
  7489  	return false
  7490  }
  7491  func rewriteValueLOONG64_OpLOONG64SUBF(v *Value) bool {
  7492  	v_1 := v.Args[1]
  7493  	v_0 := v.Args[0]
  7494  	// match: (SUBF (MULF x y) z)
  7495  	// cond: z.Block.Func.useFMA(v)
  7496  	// result: (FMSUBF x y z)
  7497  	for {
  7498  		if v_0.Op != OpLOONG64MULF {
  7499  			break
  7500  		}
  7501  		y := v_0.Args[1]
  7502  		x := v_0.Args[0]
  7503  		z := v_1
  7504  		if !(z.Block.Func.useFMA(v)) {
  7505  			break
  7506  		}
  7507  		v.reset(OpLOONG64FMSUBF)
  7508  		v.AddArg3(x, y, z)
  7509  		return true
  7510  	}
  7511  	// match: (SUBF z (MULF x y))
  7512  	// cond: z.Block.Func.useFMA(v)
  7513  	// result: (FNMSUBF x y z)
  7514  	for {
  7515  		z := v_0
  7516  		if v_1.Op != OpLOONG64MULF {
  7517  			break
  7518  		}
  7519  		y := v_1.Args[1]
  7520  		x := v_1.Args[0]
  7521  		if !(z.Block.Func.useFMA(v)) {
  7522  			break
  7523  		}
  7524  		v.reset(OpLOONG64FNMSUBF)
  7525  		v.AddArg3(x, y, z)
  7526  		return true
  7527  	}
  7528  	// match: (SUBF z (NEGF (MULF x y)))
  7529  	// cond: z.Block.Func.useFMA(v)
  7530  	// result: (FMADDF x y z)
  7531  	for {
  7532  		z := v_0
  7533  		if v_1.Op != OpLOONG64NEGF {
  7534  			break
  7535  		}
  7536  		v_1_0 := v_1.Args[0]
  7537  		if v_1_0.Op != OpLOONG64MULF {
  7538  			break
  7539  		}
  7540  		y := v_1_0.Args[1]
  7541  		x := v_1_0.Args[0]
  7542  		if !(z.Block.Func.useFMA(v)) {
  7543  			break
  7544  		}
  7545  		v.reset(OpLOONG64FMADDF)
  7546  		v.AddArg3(x, y, z)
  7547  		return true
  7548  	}
  7549  	// match: (SUBF (NEGF (MULF x y)) z)
  7550  	// cond: z.Block.Func.useFMA(v)
  7551  	// result: (FNMADDF x y z)
  7552  	for {
  7553  		if v_0.Op != OpLOONG64NEGF {
  7554  			break
  7555  		}
  7556  		v_0_0 := v_0.Args[0]
  7557  		if v_0_0.Op != OpLOONG64MULF {
  7558  			break
  7559  		}
  7560  		y := v_0_0.Args[1]
  7561  		x := v_0_0.Args[0]
  7562  		z := v_1
  7563  		if !(z.Block.Func.useFMA(v)) {
  7564  			break
  7565  		}
  7566  		v.reset(OpLOONG64FNMADDF)
  7567  		v.AddArg3(x, y, z)
  7568  		return true
  7569  	}
  7570  	return false
  7571  }
  7572  func rewriteValueLOONG64_OpLOONG64SUBV(v *Value) bool {
  7573  	v_1 := v.Args[1]
  7574  	v_0 := v.Args[0]
  7575  	// match: (SUBV x (MOVVconst [c]))
  7576  	// cond: is32Bit(c)
  7577  	// result: (SUBVconst [c] x)
  7578  	for {
  7579  		x := v_0
  7580  		if v_1.Op != OpLOONG64MOVVconst {
  7581  			break
  7582  		}
  7583  		c := auxIntToInt64(v_1.AuxInt)
  7584  		if !(is32Bit(c)) {
  7585  			break
  7586  		}
  7587  		v.reset(OpLOONG64SUBVconst)
  7588  		v.AuxInt = int64ToAuxInt(c)
  7589  		v.AddArg(x)
  7590  		return true
  7591  	}
  7592  	// match: (SUBV x (NEGV y))
  7593  	// result: (ADDV x y)
  7594  	for {
  7595  		x := v_0
  7596  		if v_1.Op != OpLOONG64NEGV {
  7597  			break
  7598  		}
  7599  		y := v_1.Args[0]
  7600  		v.reset(OpLOONG64ADDV)
  7601  		v.AddArg2(x, y)
  7602  		return true
  7603  	}
  7604  	// match: (SUBV x x)
  7605  	// result: (MOVVconst [0])
  7606  	for {
  7607  		x := v_0
  7608  		if x != v_1 {
  7609  			break
  7610  		}
  7611  		v.reset(OpLOONG64MOVVconst)
  7612  		v.AuxInt = int64ToAuxInt(0)
  7613  		return true
  7614  	}
  7615  	// match: (SUBV (MOVVconst [0]) x)
  7616  	// result: (NEGV x)
  7617  	for {
  7618  		if v_0.Op != OpLOONG64MOVVconst || auxIntToInt64(v_0.AuxInt) != 0 {
  7619  			break
  7620  		}
  7621  		x := v_1
  7622  		v.reset(OpLOONG64NEGV)
  7623  		v.AddArg(x)
  7624  		return true
  7625  	}
  7626  	// match: (SUBV (MOVVconst [c]) (NEGV (SUBVconst [d] x)))
  7627  	// result: (ADDVconst [c-d] x)
  7628  	for {
  7629  		if v_0.Op != OpLOONG64MOVVconst {
  7630  			break
  7631  		}
  7632  		c := auxIntToInt64(v_0.AuxInt)
  7633  		if v_1.Op != OpLOONG64NEGV {
  7634  			break
  7635  		}
  7636  		v_1_0 := v_1.Args[0]
  7637  		if v_1_0.Op != OpLOONG64SUBVconst {
  7638  			break
  7639  		}
  7640  		d := auxIntToInt64(v_1_0.AuxInt)
  7641  		x := v_1_0.Args[0]
  7642  		v.reset(OpLOONG64ADDVconst)
  7643  		v.AuxInt = int64ToAuxInt(c - d)
  7644  		v.AddArg(x)
  7645  		return true
  7646  	}
  7647  	return false
  7648  }
  7649  func rewriteValueLOONG64_OpLOONG64SUBVconst(v *Value) bool {
  7650  	v_0 := v.Args[0]
  7651  	// match: (SUBVconst [0] x)
  7652  	// result: x
  7653  	for {
  7654  		if auxIntToInt64(v.AuxInt) != 0 {
  7655  			break
  7656  		}
  7657  		x := v_0
  7658  		v.copyOf(x)
  7659  		return true
  7660  	}
  7661  	// match: (SUBVconst [c] (MOVVconst [d]))
  7662  	// result: (MOVVconst [d-c])
  7663  	for {
  7664  		c := auxIntToInt64(v.AuxInt)
  7665  		if v_0.Op != OpLOONG64MOVVconst {
  7666  			break
  7667  		}
  7668  		d := auxIntToInt64(v_0.AuxInt)
  7669  		v.reset(OpLOONG64MOVVconst)
  7670  		v.AuxInt = int64ToAuxInt(d - c)
  7671  		return true
  7672  	}
  7673  	// match: (SUBVconst [c] (SUBVconst [d] x))
  7674  	// cond: is32Bit(-c-d)
  7675  	// result: (ADDVconst [-c-d] x)
  7676  	for {
  7677  		c := auxIntToInt64(v.AuxInt)
  7678  		if v_0.Op != OpLOONG64SUBVconst {
  7679  			break
  7680  		}
  7681  		d := auxIntToInt64(v_0.AuxInt)
  7682  		x := v_0.Args[0]
  7683  		if !(is32Bit(-c - d)) {
  7684  			break
  7685  		}
  7686  		v.reset(OpLOONG64ADDVconst)
  7687  		v.AuxInt = int64ToAuxInt(-c - d)
  7688  		v.AddArg(x)
  7689  		return true
  7690  	}
  7691  	// match: (SUBVconst [c] (ADDVconst [d] x))
  7692  	// cond: is32Bit(-c+d)
  7693  	// result: (ADDVconst [-c+d] x)
  7694  	for {
  7695  		c := auxIntToInt64(v.AuxInt)
  7696  		if v_0.Op != OpLOONG64ADDVconst {
  7697  			break
  7698  		}
  7699  		d := auxIntToInt64(v_0.AuxInt)
  7700  		x := v_0.Args[0]
  7701  		if !(is32Bit(-c + d)) {
  7702  			break
  7703  		}
  7704  		v.reset(OpLOONG64ADDVconst)
  7705  		v.AuxInt = int64ToAuxInt(-c + d)
  7706  		v.AddArg(x)
  7707  		return true
  7708  	}
  7709  	return false
  7710  }
  7711  func rewriteValueLOONG64_OpLOONG64XOR(v *Value) bool {
  7712  	v_1 := v.Args[1]
  7713  	v_0 := v.Args[0]
  7714  	b := v.Block
  7715  	typ := &b.Func.Config.Types
  7716  	// match: (XOR <typ.UInt16> (SRLVconst [8] <typ.UInt16> x) (SLLVconst [8] <typ.UInt16> x))
  7717  	// result: (REVB2H x)
  7718  	for {
  7719  		if v.Type != typ.UInt16 {
  7720  			break
  7721  		}
  7722  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
  7723  			if v_0.Op != OpLOONG64SRLVconst || v_0.Type != typ.UInt16 || auxIntToInt64(v_0.AuxInt) != 8 {
  7724  				continue
  7725  			}
  7726  			x := v_0.Args[0]
  7727  			if v_1.Op != OpLOONG64SLLVconst || v_1.Type != typ.UInt16 || auxIntToInt64(v_1.AuxInt) != 8 || x != v_1.Args[0] {
  7728  				continue
  7729  			}
  7730  			v.reset(OpLOONG64REVB2H)
  7731  			v.AddArg(x)
  7732  			return true
  7733  		}
  7734  		break
  7735  	}
  7736  	// match: (XOR (SRLconst [8] (ANDconst [c1] x)) (SLLconst [8] (ANDconst [c2] x)))
  7737  	// cond: uint32(c1) == 0xff00ff00 && uint32(c2) == 0x00ff00ff
  7738  	// result: (REVB2H x)
  7739  	for {
  7740  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
  7741  			if v_0.Op != OpLOONG64SRLconst || auxIntToInt64(v_0.AuxInt) != 8 {
  7742  				continue
  7743  			}
  7744  			v_0_0 := v_0.Args[0]
  7745  			if v_0_0.Op != OpLOONG64ANDconst {
  7746  				continue
  7747  			}
  7748  			c1 := auxIntToInt64(v_0_0.AuxInt)
  7749  			x := v_0_0.Args[0]
  7750  			if v_1.Op != OpLOONG64SLLconst || auxIntToInt64(v_1.AuxInt) != 8 {
  7751  				continue
  7752  			}
  7753  			v_1_0 := v_1.Args[0]
  7754  			if v_1_0.Op != OpLOONG64ANDconst {
  7755  				continue
  7756  			}
  7757  			c2 := auxIntToInt64(v_1_0.AuxInt)
  7758  			if x != v_1_0.Args[0] || !(uint32(c1) == 0xff00ff00 && uint32(c2) == 0x00ff00ff) {
  7759  				continue
  7760  			}
  7761  			v.reset(OpLOONG64REVB2H)
  7762  			v.AddArg(x)
  7763  			return true
  7764  		}
  7765  		break
  7766  	}
  7767  	// match: (XOR (SRLVconst [8] (AND (MOVVconst [c1]) x)) (SLLVconst [8] (AND (MOVVconst [c2]) x)))
  7768  	// cond: uint64(c1) == 0xff00ff00ff00ff00 && uint64(c2) == 0x00ff00ff00ff00ff
  7769  	// result: (REVB4H x)
  7770  	for {
  7771  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
  7772  			if v_0.Op != OpLOONG64SRLVconst || auxIntToInt64(v_0.AuxInt) != 8 {
  7773  				continue
  7774  			}
  7775  			v_0_0 := v_0.Args[0]
  7776  			if v_0_0.Op != OpLOONG64AND {
  7777  				continue
  7778  			}
  7779  			_ = v_0_0.Args[1]
  7780  			v_0_0_0 := v_0_0.Args[0]
  7781  			v_0_0_1 := v_0_0.Args[1]
  7782  			for _i1 := 0; _i1 <= 1; _i1, v_0_0_0, v_0_0_1 = _i1+1, v_0_0_1, v_0_0_0 {
  7783  				if v_0_0_0.Op != OpLOONG64MOVVconst {
  7784  					continue
  7785  				}
  7786  				c1 := auxIntToInt64(v_0_0_0.AuxInt)
  7787  				x := v_0_0_1
  7788  				if v_1.Op != OpLOONG64SLLVconst || auxIntToInt64(v_1.AuxInt) != 8 {
  7789  					continue
  7790  				}
  7791  				v_1_0 := v_1.Args[0]
  7792  				if v_1_0.Op != OpLOONG64AND {
  7793  					continue
  7794  				}
  7795  				_ = v_1_0.Args[1]
  7796  				v_1_0_0 := v_1_0.Args[0]
  7797  				v_1_0_1 := v_1_0.Args[1]
  7798  				for _i2 := 0; _i2 <= 1; _i2, v_1_0_0, v_1_0_1 = _i2+1, v_1_0_1, v_1_0_0 {
  7799  					if v_1_0_0.Op != OpLOONG64MOVVconst {
  7800  						continue
  7801  					}
  7802  					c2 := auxIntToInt64(v_1_0_0.AuxInt)
  7803  					if x != v_1_0_1 || !(uint64(c1) == 0xff00ff00ff00ff00 && uint64(c2) == 0x00ff00ff00ff00ff) {
  7804  						continue
  7805  					}
  7806  					v.reset(OpLOONG64REVB4H)
  7807  					v.AddArg(x)
  7808  					return true
  7809  				}
  7810  			}
  7811  		}
  7812  		break
  7813  	}
  7814  	// match: (XOR (SRLVconst [8] (AND (MOVVconst [c1]) x)) (SLLVconst [8] (ANDconst [c2] x)))
  7815  	// cond: uint64(c1) == 0xff00ff00 && uint64(c2) == 0x00ff00ff
  7816  	// result: (REVB4H (ANDconst <x.Type> [0xffffffff] x))
  7817  	for {
  7818  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
  7819  			if v_0.Op != OpLOONG64SRLVconst || auxIntToInt64(v_0.AuxInt) != 8 {
  7820  				continue
  7821  			}
  7822  			v_0_0 := v_0.Args[0]
  7823  			if v_0_0.Op != OpLOONG64AND {
  7824  				continue
  7825  			}
  7826  			_ = v_0_0.Args[1]
  7827  			v_0_0_0 := v_0_0.Args[0]
  7828  			v_0_0_1 := v_0_0.Args[1]
  7829  			for _i1 := 0; _i1 <= 1; _i1, v_0_0_0, v_0_0_1 = _i1+1, v_0_0_1, v_0_0_0 {
  7830  				if v_0_0_0.Op != OpLOONG64MOVVconst {
  7831  					continue
  7832  				}
  7833  				c1 := auxIntToInt64(v_0_0_0.AuxInt)
  7834  				x := v_0_0_1
  7835  				if v_1.Op != OpLOONG64SLLVconst || auxIntToInt64(v_1.AuxInt) != 8 {
  7836  					continue
  7837  				}
  7838  				v_1_0 := v_1.Args[0]
  7839  				if v_1_0.Op != OpLOONG64ANDconst {
  7840  					continue
  7841  				}
  7842  				c2 := auxIntToInt64(v_1_0.AuxInt)
  7843  				if x != v_1_0.Args[0] || !(uint64(c1) == 0xff00ff00 && uint64(c2) == 0x00ff00ff) {
  7844  					continue
  7845  				}
  7846  				v.reset(OpLOONG64REVB4H)
  7847  				v0 := b.NewValue0(v.Pos, OpLOONG64ANDconst, x.Type)
  7848  				v0.AuxInt = int64ToAuxInt(0xffffffff)
  7849  				v0.AddArg(x)
  7850  				v.AddArg(v0)
  7851  				return true
  7852  			}
  7853  		}
  7854  		break
  7855  	}
  7856  	// match: (XOR x (MOVVconst [c]))
  7857  	// cond: is32Bit(c)
  7858  	// result: (XORconst [c] x)
  7859  	for {
  7860  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
  7861  			x := v_0
  7862  			if v_1.Op != OpLOONG64MOVVconst {
  7863  				continue
  7864  			}
  7865  			c := auxIntToInt64(v_1.AuxInt)
  7866  			if !(is32Bit(c)) {
  7867  				continue
  7868  			}
  7869  			v.reset(OpLOONG64XORconst)
  7870  			v.AuxInt = int64ToAuxInt(c)
  7871  			v.AddArg(x)
  7872  			return true
  7873  		}
  7874  		break
  7875  	}
  7876  	// match: (XOR x x)
  7877  	// result: (MOVVconst [0])
  7878  	for {
  7879  		x := v_0
  7880  		if x != v_1 {
  7881  			break
  7882  		}
  7883  		v.reset(OpLOONG64MOVVconst)
  7884  		v.AuxInt = int64ToAuxInt(0)
  7885  		return true
  7886  	}
  7887  	return false
  7888  }
  7889  func rewriteValueLOONG64_OpLOONG64XORconst(v *Value) bool {
  7890  	v_0 := v.Args[0]
  7891  	// match: (XORconst [0] x)
  7892  	// result: x
  7893  	for {
  7894  		if auxIntToInt64(v.AuxInt) != 0 {
  7895  			break
  7896  		}
  7897  		x := v_0
  7898  		v.copyOf(x)
  7899  		return true
  7900  	}
  7901  	// match: (XORconst [-1] x)
  7902  	// result: (NORconst [0] x)
  7903  	for {
  7904  		if auxIntToInt64(v.AuxInt) != -1 {
  7905  			break
  7906  		}
  7907  		x := v_0
  7908  		v.reset(OpLOONG64NORconst)
  7909  		v.AuxInt = int64ToAuxInt(0)
  7910  		v.AddArg(x)
  7911  		return true
  7912  	}
  7913  	// match: (XORconst [c] (MOVVconst [d]))
  7914  	// result: (MOVVconst [c^d])
  7915  	for {
  7916  		c := auxIntToInt64(v.AuxInt)
  7917  		if v_0.Op != OpLOONG64MOVVconst {
  7918  			break
  7919  		}
  7920  		d := auxIntToInt64(v_0.AuxInt)
  7921  		v.reset(OpLOONG64MOVVconst)
  7922  		v.AuxInt = int64ToAuxInt(c ^ d)
  7923  		return true
  7924  	}
  7925  	// match: (XORconst [c] (XORconst [d] x))
  7926  	// cond: is32Bit(c^d)
  7927  	// result: (XORconst [c^d] x)
  7928  	for {
  7929  		c := auxIntToInt64(v.AuxInt)
  7930  		if v_0.Op != OpLOONG64XORconst {
  7931  			break
  7932  		}
  7933  		d := auxIntToInt64(v_0.AuxInt)
  7934  		x := v_0.Args[0]
  7935  		if !(is32Bit(c ^ d)) {
  7936  			break
  7937  		}
  7938  		v.reset(OpLOONG64XORconst)
  7939  		v.AuxInt = int64ToAuxInt(c ^ d)
  7940  		v.AddArg(x)
  7941  		return true
  7942  	}
  7943  	return false
  7944  }
  7945  func rewriteValueLOONG64_OpLeq16(v *Value) bool {
  7946  	v_1 := v.Args[1]
  7947  	v_0 := v.Args[0]
  7948  	b := v.Block
  7949  	typ := &b.Func.Config.Types
  7950  	// match: (Leq16 x y)
  7951  	// result: (XOR (MOVVconst [1]) (SGT (SignExt16to64 x) (SignExt16to64 y)))
  7952  	for {
  7953  		x := v_0
  7954  		y := v_1
  7955  		v.reset(OpLOONG64XOR)
  7956  		v0 := b.NewValue0(v.Pos, OpLOONG64MOVVconst, typ.UInt64)
  7957  		v0.AuxInt = int64ToAuxInt(1)
  7958  		v1 := b.NewValue0(v.Pos, OpLOONG64SGT, typ.Bool)
  7959  		v2 := b.NewValue0(v.Pos, OpSignExt16to64, typ.Int64)
  7960  		v2.AddArg(x)
  7961  		v3 := b.NewValue0(v.Pos, OpSignExt16to64, typ.Int64)
  7962  		v3.AddArg(y)
  7963  		v1.AddArg2(v2, v3)
  7964  		v.AddArg2(v0, v1)
  7965  		return true
  7966  	}
  7967  }
  7968  func rewriteValueLOONG64_OpLeq16U(v *Value) bool {
  7969  	v_1 := v.Args[1]
  7970  	v_0 := v.Args[0]
  7971  	b := v.Block
  7972  	typ := &b.Func.Config.Types
  7973  	// match: (Leq16U x y)
  7974  	// result: (XOR (MOVVconst [1]) (SGTU (ZeroExt16to64 x) (ZeroExt16to64 y)))
  7975  	for {
  7976  		x := v_0
  7977  		y := v_1
  7978  		v.reset(OpLOONG64XOR)
  7979  		v0 := b.NewValue0(v.Pos, OpLOONG64MOVVconst, typ.UInt64)
  7980  		v0.AuxInt = int64ToAuxInt(1)
  7981  		v1 := b.NewValue0(v.Pos, OpLOONG64SGTU, typ.Bool)
  7982  		v2 := b.NewValue0(v.Pos, OpZeroExt16to64, typ.UInt64)
  7983  		v2.AddArg(x)
  7984  		v3 := b.NewValue0(v.Pos, OpZeroExt16to64, typ.UInt64)
  7985  		v3.AddArg(y)
  7986  		v1.AddArg2(v2, v3)
  7987  		v.AddArg2(v0, v1)
  7988  		return true
  7989  	}
  7990  }
  7991  func rewriteValueLOONG64_OpLeq32(v *Value) bool {
  7992  	v_1 := v.Args[1]
  7993  	v_0 := v.Args[0]
  7994  	b := v.Block
  7995  	typ := &b.Func.Config.Types
  7996  	// match: (Leq32 x y)
  7997  	// result: (XOR (MOVVconst [1]) (SGT (SignExt32to64 x) (SignExt32to64 y)))
  7998  	for {
  7999  		x := v_0
  8000  		y := v_1
  8001  		v.reset(OpLOONG64XOR)
  8002  		v0 := b.NewValue0(v.Pos, OpLOONG64MOVVconst, typ.UInt64)
  8003  		v0.AuxInt = int64ToAuxInt(1)
  8004  		v1 := b.NewValue0(v.Pos, OpLOONG64SGT, typ.Bool)
  8005  		v2 := b.NewValue0(v.Pos, OpSignExt32to64, typ.Int64)
  8006  		v2.AddArg(x)
  8007  		v3 := b.NewValue0(v.Pos, OpSignExt32to64, typ.Int64)
  8008  		v3.AddArg(y)
  8009  		v1.AddArg2(v2, v3)
  8010  		v.AddArg2(v0, v1)
  8011  		return true
  8012  	}
  8013  }
  8014  func rewriteValueLOONG64_OpLeq32F(v *Value) bool {
  8015  	v_1 := v.Args[1]
  8016  	v_0 := v.Args[0]
  8017  	b := v.Block
  8018  	// match: (Leq32F x y)
  8019  	// result: (FPFlagTrue (CMPGEF y x))
  8020  	for {
  8021  		x := v_0
  8022  		y := v_1
  8023  		v.reset(OpLOONG64FPFlagTrue)
  8024  		v0 := b.NewValue0(v.Pos, OpLOONG64CMPGEF, types.TypeFlags)
  8025  		v0.AddArg2(y, x)
  8026  		v.AddArg(v0)
  8027  		return true
  8028  	}
  8029  }
  8030  func rewriteValueLOONG64_OpLeq32U(v *Value) bool {
  8031  	v_1 := v.Args[1]
  8032  	v_0 := v.Args[0]
  8033  	b := v.Block
  8034  	typ := &b.Func.Config.Types
  8035  	// match: (Leq32U x y)
  8036  	// result: (XOR (MOVVconst [1]) (SGTU (ZeroExt32to64 x) (ZeroExt32to64 y)))
  8037  	for {
  8038  		x := v_0
  8039  		y := v_1
  8040  		v.reset(OpLOONG64XOR)
  8041  		v0 := b.NewValue0(v.Pos, OpLOONG64MOVVconst, typ.UInt64)
  8042  		v0.AuxInt = int64ToAuxInt(1)
  8043  		v1 := b.NewValue0(v.Pos, OpLOONG64SGTU, typ.Bool)
  8044  		v2 := b.NewValue0(v.Pos, OpZeroExt32to64, typ.UInt64)
  8045  		v2.AddArg(x)
  8046  		v3 := b.NewValue0(v.Pos, OpZeroExt32to64, typ.UInt64)
  8047  		v3.AddArg(y)
  8048  		v1.AddArg2(v2, v3)
  8049  		v.AddArg2(v0, v1)
  8050  		return true
  8051  	}
  8052  }
  8053  func rewriteValueLOONG64_OpLeq64(v *Value) bool {
  8054  	v_1 := v.Args[1]
  8055  	v_0 := v.Args[0]
  8056  	b := v.Block
  8057  	typ := &b.Func.Config.Types
  8058  	// match: (Leq64 x y)
  8059  	// result: (XOR (MOVVconst [1]) (SGT x y))
  8060  	for {
  8061  		x := v_0
  8062  		y := v_1
  8063  		v.reset(OpLOONG64XOR)
  8064  		v0 := b.NewValue0(v.Pos, OpLOONG64MOVVconst, typ.UInt64)
  8065  		v0.AuxInt = int64ToAuxInt(1)
  8066  		v1 := b.NewValue0(v.Pos, OpLOONG64SGT, typ.Bool)
  8067  		v1.AddArg2(x, y)
  8068  		v.AddArg2(v0, v1)
  8069  		return true
  8070  	}
  8071  }
  8072  func rewriteValueLOONG64_OpLeq64F(v *Value) bool {
  8073  	v_1 := v.Args[1]
  8074  	v_0 := v.Args[0]
  8075  	b := v.Block
  8076  	// match: (Leq64F x y)
  8077  	// result: (FPFlagTrue (CMPGED y x))
  8078  	for {
  8079  		x := v_0
  8080  		y := v_1
  8081  		v.reset(OpLOONG64FPFlagTrue)
  8082  		v0 := b.NewValue0(v.Pos, OpLOONG64CMPGED, types.TypeFlags)
  8083  		v0.AddArg2(y, x)
  8084  		v.AddArg(v0)
  8085  		return true
  8086  	}
  8087  }
  8088  func rewriteValueLOONG64_OpLeq64U(v *Value) bool {
  8089  	v_1 := v.Args[1]
  8090  	v_0 := v.Args[0]
  8091  	b := v.Block
  8092  	typ := &b.Func.Config.Types
  8093  	// match: (Leq64U x y)
  8094  	// result: (XOR (MOVVconst [1]) (SGTU x y))
  8095  	for {
  8096  		x := v_0
  8097  		y := v_1
  8098  		v.reset(OpLOONG64XOR)
  8099  		v0 := b.NewValue0(v.Pos, OpLOONG64MOVVconst, typ.UInt64)
  8100  		v0.AuxInt = int64ToAuxInt(1)
  8101  		v1 := b.NewValue0(v.Pos, OpLOONG64SGTU, typ.Bool)
  8102  		v1.AddArg2(x, y)
  8103  		v.AddArg2(v0, v1)
  8104  		return true
  8105  	}
  8106  }
  8107  func rewriteValueLOONG64_OpLeq8(v *Value) bool {
  8108  	v_1 := v.Args[1]
  8109  	v_0 := v.Args[0]
  8110  	b := v.Block
  8111  	typ := &b.Func.Config.Types
  8112  	// match: (Leq8 x y)
  8113  	// result: (XOR (MOVVconst [1]) (SGT (SignExt8to64 x) (SignExt8to64 y)))
  8114  	for {
  8115  		x := v_0
  8116  		y := v_1
  8117  		v.reset(OpLOONG64XOR)
  8118  		v0 := b.NewValue0(v.Pos, OpLOONG64MOVVconst, typ.UInt64)
  8119  		v0.AuxInt = int64ToAuxInt(1)
  8120  		v1 := b.NewValue0(v.Pos, OpLOONG64SGT, typ.Bool)
  8121  		v2 := b.NewValue0(v.Pos, OpSignExt8to64, typ.Int64)
  8122  		v2.AddArg(x)
  8123  		v3 := b.NewValue0(v.Pos, OpSignExt8to64, typ.Int64)
  8124  		v3.AddArg(y)
  8125  		v1.AddArg2(v2, v3)
  8126  		v.AddArg2(v0, v1)
  8127  		return true
  8128  	}
  8129  }
  8130  func rewriteValueLOONG64_OpLeq8U(v *Value) bool {
  8131  	v_1 := v.Args[1]
  8132  	v_0 := v.Args[0]
  8133  	b := v.Block
  8134  	typ := &b.Func.Config.Types
  8135  	// match: (Leq8U x y)
  8136  	// result: (XOR (MOVVconst [1]) (SGTU (ZeroExt8to64 x) (ZeroExt8to64 y)))
  8137  	for {
  8138  		x := v_0
  8139  		y := v_1
  8140  		v.reset(OpLOONG64XOR)
  8141  		v0 := b.NewValue0(v.Pos, OpLOONG64MOVVconst, typ.UInt64)
  8142  		v0.AuxInt = int64ToAuxInt(1)
  8143  		v1 := b.NewValue0(v.Pos, OpLOONG64SGTU, typ.Bool)
  8144  		v2 := b.NewValue0(v.Pos, OpZeroExt8to64, typ.UInt64)
  8145  		v2.AddArg(x)
  8146  		v3 := b.NewValue0(v.Pos, OpZeroExt8to64, typ.UInt64)
  8147  		v3.AddArg(y)
  8148  		v1.AddArg2(v2, v3)
  8149  		v.AddArg2(v0, v1)
  8150  		return true
  8151  	}
  8152  }
  8153  func rewriteValueLOONG64_OpLess16(v *Value) bool {
  8154  	v_1 := v.Args[1]
  8155  	v_0 := v.Args[0]
  8156  	b := v.Block
  8157  	typ := &b.Func.Config.Types
  8158  	// match: (Less16 x y)
  8159  	// result: (SGT (SignExt16to64 y) (SignExt16to64 x))
  8160  	for {
  8161  		x := v_0
  8162  		y := v_1
  8163  		v.reset(OpLOONG64SGT)
  8164  		v0 := b.NewValue0(v.Pos, OpSignExt16to64, typ.Int64)
  8165  		v0.AddArg(y)
  8166  		v1 := b.NewValue0(v.Pos, OpSignExt16to64, typ.Int64)
  8167  		v1.AddArg(x)
  8168  		v.AddArg2(v0, v1)
  8169  		return true
  8170  	}
  8171  }
  8172  func rewriteValueLOONG64_OpLess16U(v *Value) bool {
  8173  	v_1 := v.Args[1]
  8174  	v_0 := v.Args[0]
  8175  	b := v.Block
  8176  	typ := &b.Func.Config.Types
  8177  	// match: (Less16U x y)
  8178  	// result: (SGTU (ZeroExt16to64 y) (ZeroExt16to64 x))
  8179  	for {
  8180  		x := v_0
  8181  		y := v_1
  8182  		v.reset(OpLOONG64SGTU)
  8183  		v0 := b.NewValue0(v.Pos, OpZeroExt16to64, typ.UInt64)
  8184  		v0.AddArg(y)
  8185  		v1 := b.NewValue0(v.Pos, OpZeroExt16to64, typ.UInt64)
  8186  		v1.AddArg(x)
  8187  		v.AddArg2(v0, v1)
  8188  		return true
  8189  	}
  8190  }
  8191  func rewriteValueLOONG64_OpLess32(v *Value) bool {
  8192  	v_1 := v.Args[1]
  8193  	v_0 := v.Args[0]
  8194  	b := v.Block
  8195  	typ := &b.Func.Config.Types
  8196  	// match: (Less32 x y)
  8197  	// result: (SGT (SignExt32to64 y) (SignExt32to64 x))
  8198  	for {
  8199  		x := v_0
  8200  		y := v_1
  8201  		v.reset(OpLOONG64SGT)
  8202  		v0 := b.NewValue0(v.Pos, OpSignExt32to64, typ.Int64)
  8203  		v0.AddArg(y)
  8204  		v1 := b.NewValue0(v.Pos, OpSignExt32to64, typ.Int64)
  8205  		v1.AddArg(x)
  8206  		v.AddArg2(v0, v1)
  8207  		return true
  8208  	}
  8209  }
  8210  func rewriteValueLOONG64_OpLess32F(v *Value) bool {
  8211  	v_1 := v.Args[1]
  8212  	v_0 := v.Args[0]
  8213  	b := v.Block
  8214  	// match: (Less32F x y)
  8215  	// result: (FPFlagTrue (CMPGTF y x))
  8216  	for {
  8217  		x := v_0
  8218  		y := v_1
  8219  		v.reset(OpLOONG64FPFlagTrue)
  8220  		v0 := b.NewValue0(v.Pos, OpLOONG64CMPGTF, types.TypeFlags)
  8221  		v0.AddArg2(y, x)
  8222  		v.AddArg(v0)
  8223  		return true
  8224  	}
  8225  }
  8226  func rewriteValueLOONG64_OpLess32U(v *Value) bool {
  8227  	v_1 := v.Args[1]
  8228  	v_0 := v.Args[0]
  8229  	b := v.Block
  8230  	typ := &b.Func.Config.Types
  8231  	// match: (Less32U x y)
  8232  	// result: (SGTU (ZeroExt32to64 y) (ZeroExt32to64 x))
  8233  	for {
  8234  		x := v_0
  8235  		y := v_1
  8236  		v.reset(OpLOONG64SGTU)
  8237  		v0 := b.NewValue0(v.Pos, OpZeroExt32to64, typ.UInt64)
  8238  		v0.AddArg(y)
  8239  		v1 := b.NewValue0(v.Pos, OpZeroExt32to64, typ.UInt64)
  8240  		v1.AddArg(x)
  8241  		v.AddArg2(v0, v1)
  8242  		return true
  8243  	}
  8244  }
  8245  func rewriteValueLOONG64_OpLess64(v *Value) bool {
  8246  	v_1 := v.Args[1]
  8247  	v_0 := v.Args[0]
  8248  	// match: (Less64 x y)
  8249  	// result: (SGT y x)
  8250  	for {
  8251  		x := v_0
  8252  		y := v_1
  8253  		v.reset(OpLOONG64SGT)
  8254  		v.AddArg2(y, x)
  8255  		return true
  8256  	}
  8257  }
  8258  func rewriteValueLOONG64_OpLess64F(v *Value) bool {
  8259  	v_1 := v.Args[1]
  8260  	v_0 := v.Args[0]
  8261  	b := v.Block
  8262  	// match: (Less64F x y)
  8263  	// result: (FPFlagTrue (CMPGTD y x))
  8264  	for {
  8265  		x := v_0
  8266  		y := v_1
  8267  		v.reset(OpLOONG64FPFlagTrue)
  8268  		v0 := b.NewValue0(v.Pos, OpLOONG64CMPGTD, types.TypeFlags)
  8269  		v0.AddArg2(y, x)
  8270  		v.AddArg(v0)
  8271  		return true
  8272  	}
  8273  }
  8274  func rewriteValueLOONG64_OpLess64U(v *Value) bool {
  8275  	v_1 := v.Args[1]
  8276  	v_0 := v.Args[0]
  8277  	// match: (Less64U x y)
  8278  	// result: (SGTU y x)
  8279  	for {
  8280  		x := v_0
  8281  		y := v_1
  8282  		v.reset(OpLOONG64SGTU)
  8283  		v.AddArg2(y, x)
  8284  		return true
  8285  	}
  8286  }
  8287  func rewriteValueLOONG64_OpLess8(v *Value) bool {
  8288  	v_1 := v.Args[1]
  8289  	v_0 := v.Args[0]
  8290  	b := v.Block
  8291  	typ := &b.Func.Config.Types
  8292  	// match: (Less8 x y)
  8293  	// result: (SGT (SignExt8to64 y) (SignExt8to64 x))
  8294  	for {
  8295  		x := v_0
  8296  		y := v_1
  8297  		v.reset(OpLOONG64SGT)
  8298  		v0 := b.NewValue0(v.Pos, OpSignExt8to64, typ.Int64)
  8299  		v0.AddArg(y)
  8300  		v1 := b.NewValue0(v.Pos, OpSignExt8to64, typ.Int64)
  8301  		v1.AddArg(x)
  8302  		v.AddArg2(v0, v1)
  8303  		return true
  8304  	}
  8305  }
  8306  func rewriteValueLOONG64_OpLess8U(v *Value) bool {
  8307  	v_1 := v.Args[1]
  8308  	v_0 := v.Args[0]
  8309  	b := v.Block
  8310  	typ := &b.Func.Config.Types
  8311  	// match: (Less8U x y)
  8312  	// result: (SGTU (ZeroExt8to64 y) (ZeroExt8to64 x))
  8313  	for {
  8314  		x := v_0
  8315  		y := v_1
  8316  		v.reset(OpLOONG64SGTU)
  8317  		v0 := b.NewValue0(v.Pos, OpZeroExt8to64, typ.UInt64)
  8318  		v0.AddArg(y)
  8319  		v1 := b.NewValue0(v.Pos, OpZeroExt8to64, typ.UInt64)
  8320  		v1.AddArg(x)
  8321  		v.AddArg2(v0, v1)
  8322  		return true
  8323  	}
  8324  }
  8325  func rewriteValueLOONG64_OpLoad(v *Value) bool {
  8326  	v_1 := v.Args[1]
  8327  	v_0 := v.Args[0]
  8328  	// match: (Load <t> ptr mem)
  8329  	// cond: t.IsBoolean()
  8330  	// result: (MOVBUload ptr mem)
  8331  	for {
  8332  		t := v.Type
  8333  		ptr := v_0
  8334  		mem := v_1
  8335  		if !(t.IsBoolean()) {
  8336  			break
  8337  		}
  8338  		v.reset(OpLOONG64MOVBUload)
  8339  		v.AddArg2(ptr, mem)
  8340  		return true
  8341  	}
  8342  	// match: (Load <t> ptr mem)
  8343  	// cond: (is8BitInt(t) && t.IsSigned())
  8344  	// result: (MOVBload ptr mem)
  8345  	for {
  8346  		t := v.Type
  8347  		ptr := v_0
  8348  		mem := v_1
  8349  		if !(is8BitInt(t) && t.IsSigned()) {
  8350  			break
  8351  		}
  8352  		v.reset(OpLOONG64MOVBload)
  8353  		v.AddArg2(ptr, mem)
  8354  		return true
  8355  	}
  8356  	// match: (Load <t> ptr mem)
  8357  	// cond: (is8BitInt(t) && !t.IsSigned())
  8358  	// result: (MOVBUload ptr mem)
  8359  	for {
  8360  		t := v.Type
  8361  		ptr := v_0
  8362  		mem := v_1
  8363  		if !(is8BitInt(t) && !t.IsSigned()) {
  8364  			break
  8365  		}
  8366  		v.reset(OpLOONG64MOVBUload)
  8367  		v.AddArg2(ptr, mem)
  8368  		return true
  8369  	}
  8370  	// match: (Load <t> ptr mem)
  8371  	// cond: (is16BitInt(t) && t.IsSigned())
  8372  	// result: (MOVHload ptr mem)
  8373  	for {
  8374  		t := v.Type
  8375  		ptr := v_0
  8376  		mem := v_1
  8377  		if !(is16BitInt(t) && t.IsSigned()) {
  8378  			break
  8379  		}
  8380  		v.reset(OpLOONG64MOVHload)
  8381  		v.AddArg2(ptr, mem)
  8382  		return true
  8383  	}
  8384  	// match: (Load <t> ptr mem)
  8385  	// cond: (is16BitInt(t) && !t.IsSigned())
  8386  	// result: (MOVHUload ptr mem)
  8387  	for {
  8388  		t := v.Type
  8389  		ptr := v_0
  8390  		mem := v_1
  8391  		if !(is16BitInt(t) && !t.IsSigned()) {
  8392  			break
  8393  		}
  8394  		v.reset(OpLOONG64MOVHUload)
  8395  		v.AddArg2(ptr, mem)
  8396  		return true
  8397  	}
  8398  	// match: (Load <t> ptr mem)
  8399  	// cond: (is32BitInt(t) && t.IsSigned())
  8400  	// result: (MOVWload ptr mem)
  8401  	for {
  8402  		t := v.Type
  8403  		ptr := v_0
  8404  		mem := v_1
  8405  		if !(is32BitInt(t) && t.IsSigned()) {
  8406  			break
  8407  		}
  8408  		v.reset(OpLOONG64MOVWload)
  8409  		v.AddArg2(ptr, mem)
  8410  		return true
  8411  	}
  8412  	// match: (Load <t> ptr mem)
  8413  	// cond: (is32BitInt(t) && !t.IsSigned())
  8414  	// result: (MOVWUload ptr mem)
  8415  	for {
  8416  		t := v.Type
  8417  		ptr := v_0
  8418  		mem := v_1
  8419  		if !(is32BitInt(t) && !t.IsSigned()) {
  8420  			break
  8421  		}
  8422  		v.reset(OpLOONG64MOVWUload)
  8423  		v.AddArg2(ptr, mem)
  8424  		return true
  8425  	}
  8426  	// match: (Load <t> ptr mem)
  8427  	// cond: (is64BitInt(t) || isPtr(t))
  8428  	// result: (MOVVload ptr mem)
  8429  	for {
  8430  		t := v.Type
  8431  		ptr := v_0
  8432  		mem := v_1
  8433  		if !(is64BitInt(t) || isPtr(t)) {
  8434  			break
  8435  		}
  8436  		v.reset(OpLOONG64MOVVload)
  8437  		v.AddArg2(ptr, mem)
  8438  		return true
  8439  	}
  8440  	// match: (Load <t> ptr mem)
  8441  	// cond: is32BitFloat(t)
  8442  	// result: (MOVFload ptr mem)
  8443  	for {
  8444  		t := v.Type
  8445  		ptr := v_0
  8446  		mem := v_1
  8447  		if !(is32BitFloat(t)) {
  8448  			break
  8449  		}
  8450  		v.reset(OpLOONG64MOVFload)
  8451  		v.AddArg2(ptr, mem)
  8452  		return true
  8453  	}
  8454  	// match: (Load <t> ptr mem)
  8455  	// cond: is64BitFloat(t)
  8456  	// result: (MOVDload ptr mem)
  8457  	for {
  8458  		t := v.Type
  8459  		ptr := v_0
  8460  		mem := v_1
  8461  		if !(is64BitFloat(t)) {
  8462  			break
  8463  		}
  8464  		v.reset(OpLOONG64MOVDload)
  8465  		v.AddArg2(ptr, mem)
  8466  		return true
  8467  	}
  8468  	return false
  8469  }
  8470  func rewriteValueLOONG64_OpLocalAddr(v *Value) bool {
  8471  	v_1 := v.Args[1]
  8472  	v_0 := v.Args[0]
  8473  	b := v.Block
  8474  	typ := &b.Func.Config.Types
  8475  	// match: (LocalAddr <t> {sym} base mem)
  8476  	// cond: t.Elem().HasPointers()
  8477  	// result: (MOVVaddr {sym} (SPanchored base mem))
  8478  	for {
  8479  		t := v.Type
  8480  		sym := auxToSym(v.Aux)
  8481  		base := v_0
  8482  		mem := v_1
  8483  		if !(t.Elem().HasPointers()) {
  8484  			break
  8485  		}
  8486  		v.reset(OpLOONG64MOVVaddr)
  8487  		v.Aux = symToAux(sym)
  8488  		v0 := b.NewValue0(v.Pos, OpSPanchored, typ.Uintptr)
  8489  		v0.AddArg2(base, mem)
  8490  		v.AddArg(v0)
  8491  		return true
  8492  	}
  8493  	// match: (LocalAddr <t> {sym} base _)
  8494  	// cond: !t.Elem().HasPointers()
  8495  	// result: (MOVVaddr {sym} base)
  8496  	for {
  8497  		t := v.Type
  8498  		sym := auxToSym(v.Aux)
  8499  		base := v_0
  8500  		if !(!t.Elem().HasPointers()) {
  8501  			break
  8502  		}
  8503  		v.reset(OpLOONG64MOVVaddr)
  8504  		v.Aux = symToAux(sym)
  8505  		v.AddArg(base)
  8506  		return true
  8507  	}
  8508  	return false
  8509  }
  8510  func rewriteValueLOONG64_OpLsh16x16(v *Value) bool {
  8511  	v_1 := v.Args[1]
  8512  	v_0 := v.Args[0]
  8513  	b := v.Block
  8514  	typ := &b.Func.Config.Types
  8515  	// match: (Lsh16x16 x y)
  8516  	// cond: shiftIsBounded(v)
  8517  	// result: (SLLV x y)
  8518  	for {
  8519  		x := v_0
  8520  		y := v_1
  8521  		if !(shiftIsBounded(v)) {
  8522  			break
  8523  		}
  8524  		v.reset(OpLOONG64SLLV)
  8525  		v.AddArg2(x, y)
  8526  		return true
  8527  	}
  8528  	// match: (Lsh16x16 <t> x y)
  8529  	// cond: !shiftIsBounded(v)
  8530  	// result: (MASKEQZ (SLLV <t> x (ZeroExt16to64 y)) (SGTU (MOVVconst <typ.UInt64> [64]) (ZeroExt16to64 y)))
  8531  	for {
  8532  		t := v.Type
  8533  		x := v_0
  8534  		y := v_1
  8535  		if !(!shiftIsBounded(v)) {
  8536  			break
  8537  		}
  8538  		v.reset(OpLOONG64MASKEQZ)
  8539  		v0 := b.NewValue0(v.Pos, OpLOONG64SLLV, t)
  8540  		v1 := b.NewValue0(v.Pos, OpZeroExt16to64, typ.UInt64)
  8541  		v1.AddArg(y)
  8542  		v0.AddArg2(x, v1)
  8543  		v2 := b.NewValue0(v.Pos, OpLOONG64SGTU, typ.Bool)
  8544  		v3 := b.NewValue0(v.Pos, OpLOONG64MOVVconst, typ.UInt64)
  8545  		v3.AuxInt = int64ToAuxInt(64)
  8546  		v2.AddArg2(v3, v1)
  8547  		v.AddArg2(v0, v2)
  8548  		return true
  8549  	}
  8550  	return false
  8551  }
  8552  func rewriteValueLOONG64_OpLsh16x32(v *Value) bool {
  8553  	v_1 := v.Args[1]
  8554  	v_0 := v.Args[0]
  8555  	b := v.Block
  8556  	typ := &b.Func.Config.Types
  8557  	// match: (Lsh16x32 x y)
  8558  	// cond: shiftIsBounded(v)
  8559  	// result: (SLLV x y)
  8560  	for {
  8561  		x := v_0
  8562  		y := v_1
  8563  		if !(shiftIsBounded(v)) {
  8564  			break
  8565  		}
  8566  		v.reset(OpLOONG64SLLV)
  8567  		v.AddArg2(x, y)
  8568  		return true
  8569  	}
  8570  	// match: (Lsh16x32 <t> x y)
  8571  	// cond: !shiftIsBounded(v)
  8572  	// result: (MASKEQZ (SLLV <t> x (ZeroExt32to64 y)) (SGTU (MOVVconst <typ.UInt64> [64]) (ZeroExt32to64 y)))
  8573  	for {
  8574  		t := v.Type
  8575  		x := v_0
  8576  		y := v_1
  8577  		if !(!shiftIsBounded(v)) {
  8578  			break
  8579  		}
  8580  		v.reset(OpLOONG64MASKEQZ)
  8581  		v0 := b.NewValue0(v.Pos, OpLOONG64SLLV, t)
  8582  		v1 := b.NewValue0(v.Pos, OpZeroExt32to64, typ.UInt64)
  8583  		v1.AddArg(y)
  8584  		v0.AddArg2(x, v1)
  8585  		v2 := b.NewValue0(v.Pos, OpLOONG64SGTU, typ.Bool)
  8586  		v3 := b.NewValue0(v.Pos, OpLOONG64MOVVconst, typ.UInt64)
  8587  		v3.AuxInt = int64ToAuxInt(64)
  8588  		v2.AddArg2(v3, v1)
  8589  		v.AddArg2(v0, v2)
  8590  		return true
  8591  	}
  8592  	return false
  8593  }
  8594  func rewriteValueLOONG64_OpLsh16x64(v *Value) bool {
  8595  	v_1 := v.Args[1]
  8596  	v_0 := v.Args[0]
  8597  	b := v.Block
  8598  	typ := &b.Func.Config.Types
  8599  	// match: (Lsh16x64 x y)
  8600  	// cond: shiftIsBounded(v)
  8601  	// result: (SLLV x y)
  8602  	for {
  8603  		x := v_0
  8604  		y := v_1
  8605  		if !(shiftIsBounded(v)) {
  8606  			break
  8607  		}
  8608  		v.reset(OpLOONG64SLLV)
  8609  		v.AddArg2(x, y)
  8610  		return true
  8611  	}
  8612  	// match: (Lsh16x64 <t> x y)
  8613  	// cond: !shiftIsBounded(v)
  8614  	// result: (MASKEQZ (SLLV <t> x y) (SGTU (MOVVconst <typ.UInt64> [64]) y))
  8615  	for {
  8616  		t := v.Type
  8617  		x := v_0
  8618  		y := v_1
  8619  		if !(!shiftIsBounded(v)) {
  8620  			break
  8621  		}
  8622  		v.reset(OpLOONG64MASKEQZ)
  8623  		v0 := b.NewValue0(v.Pos, OpLOONG64SLLV, t)
  8624  		v0.AddArg2(x, y)
  8625  		v1 := b.NewValue0(v.Pos, OpLOONG64SGTU, typ.Bool)
  8626  		v2 := b.NewValue0(v.Pos, OpLOONG64MOVVconst, typ.UInt64)
  8627  		v2.AuxInt = int64ToAuxInt(64)
  8628  		v1.AddArg2(v2, y)
  8629  		v.AddArg2(v0, v1)
  8630  		return true
  8631  	}
  8632  	return false
  8633  }
  8634  func rewriteValueLOONG64_OpLsh16x8(v *Value) bool {
  8635  	v_1 := v.Args[1]
  8636  	v_0 := v.Args[0]
  8637  	b := v.Block
  8638  	typ := &b.Func.Config.Types
  8639  	// match: (Lsh16x8 x y)
  8640  	// cond: shiftIsBounded(v)
  8641  	// result: (SLLV x y)
  8642  	for {
  8643  		x := v_0
  8644  		y := v_1
  8645  		if !(shiftIsBounded(v)) {
  8646  			break
  8647  		}
  8648  		v.reset(OpLOONG64SLLV)
  8649  		v.AddArg2(x, y)
  8650  		return true
  8651  	}
  8652  	// match: (Lsh16x8 <t> x y)
  8653  	// cond: !shiftIsBounded(v)
  8654  	// result: (MASKEQZ (SLLV <t> x (ZeroExt8to64 y)) (SGTU (MOVVconst <typ.UInt64> [64]) (ZeroExt8to64 y)))
  8655  	for {
  8656  		t := v.Type
  8657  		x := v_0
  8658  		y := v_1
  8659  		if !(!shiftIsBounded(v)) {
  8660  			break
  8661  		}
  8662  		v.reset(OpLOONG64MASKEQZ)
  8663  		v0 := b.NewValue0(v.Pos, OpLOONG64SLLV, t)
  8664  		v1 := b.NewValue0(v.Pos, OpZeroExt8to64, typ.UInt64)
  8665  		v1.AddArg(y)
  8666  		v0.AddArg2(x, v1)
  8667  		v2 := b.NewValue0(v.Pos, OpLOONG64SGTU, typ.Bool)
  8668  		v3 := b.NewValue0(v.Pos, OpLOONG64MOVVconst, typ.UInt64)
  8669  		v3.AuxInt = int64ToAuxInt(64)
  8670  		v2.AddArg2(v3, v1)
  8671  		v.AddArg2(v0, v2)
  8672  		return true
  8673  	}
  8674  	return false
  8675  }
  8676  func rewriteValueLOONG64_OpLsh32x16(v *Value) bool {
  8677  	v_1 := v.Args[1]
  8678  	v_0 := v.Args[0]
  8679  	b := v.Block
  8680  	typ := &b.Func.Config.Types
  8681  	// match: (Lsh32x16 x y)
  8682  	// cond: shiftIsBounded(v)
  8683  	// result: (SLL x y)
  8684  	for {
  8685  		x := v_0
  8686  		y := v_1
  8687  		if !(shiftIsBounded(v)) {
  8688  			break
  8689  		}
  8690  		v.reset(OpLOONG64SLL)
  8691  		v.AddArg2(x, y)
  8692  		return true
  8693  	}
  8694  	// match: (Lsh32x16 <t> x y)
  8695  	// cond: !shiftIsBounded(v)
  8696  	// result: (MASKEQZ (SLL <t> x (ZeroExt16to64 y)) (SGTU (MOVVconst <typ.UInt64> [32]) (ZeroExt16to64 y)))
  8697  	for {
  8698  		t := v.Type
  8699  		x := v_0
  8700  		y := v_1
  8701  		if !(!shiftIsBounded(v)) {
  8702  			break
  8703  		}
  8704  		v.reset(OpLOONG64MASKEQZ)
  8705  		v0 := b.NewValue0(v.Pos, OpLOONG64SLL, t)
  8706  		v1 := b.NewValue0(v.Pos, OpZeroExt16to64, typ.UInt64)
  8707  		v1.AddArg(y)
  8708  		v0.AddArg2(x, v1)
  8709  		v2 := b.NewValue0(v.Pos, OpLOONG64SGTU, typ.Bool)
  8710  		v3 := b.NewValue0(v.Pos, OpLOONG64MOVVconst, typ.UInt64)
  8711  		v3.AuxInt = int64ToAuxInt(32)
  8712  		v2.AddArg2(v3, v1)
  8713  		v.AddArg2(v0, v2)
  8714  		return true
  8715  	}
  8716  	return false
  8717  }
  8718  func rewriteValueLOONG64_OpLsh32x32(v *Value) bool {
  8719  	v_1 := v.Args[1]
  8720  	v_0 := v.Args[0]
  8721  	b := v.Block
  8722  	typ := &b.Func.Config.Types
  8723  	// match: (Lsh32x32 x y)
  8724  	// cond: shiftIsBounded(v)
  8725  	// result: (SLL x y)
  8726  	for {
  8727  		x := v_0
  8728  		y := v_1
  8729  		if !(shiftIsBounded(v)) {
  8730  			break
  8731  		}
  8732  		v.reset(OpLOONG64SLL)
  8733  		v.AddArg2(x, y)
  8734  		return true
  8735  	}
  8736  	// match: (Lsh32x32 <t> x y)
  8737  	// cond: !shiftIsBounded(v)
  8738  	// result: (MASKEQZ (SLL <t> x (ZeroExt32to64 y)) (SGTU (MOVVconst <typ.UInt64> [32]) (ZeroExt32to64 y)))
  8739  	for {
  8740  		t := v.Type
  8741  		x := v_0
  8742  		y := v_1
  8743  		if !(!shiftIsBounded(v)) {
  8744  			break
  8745  		}
  8746  		v.reset(OpLOONG64MASKEQZ)
  8747  		v0 := b.NewValue0(v.Pos, OpLOONG64SLL, t)
  8748  		v1 := b.NewValue0(v.Pos, OpZeroExt32to64, typ.UInt64)
  8749  		v1.AddArg(y)
  8750  		v0.AddArg2(x, v1)
  8751  		v2 := b.NewValue0(v.Pos, OpLOONG64SGTU, typ.Bool)
  8752  		v3 := b.NewValue0(v.Pos, OpLOONG64MOVVconst, typ.UInt64)
  8753  		v3.AuxInt = int64ToAuxInt(32)
  8754  		v2.AddArg2(v3, v1)
  8755  		v.AddArg2(v0, v2)
  8756  		return true
  8757  	}
  8758  	return false
  8759  }
  8760  func rewriteValueLOONG64_OpLsh32x64(v *Value) bool {
  8761  	v_1 := v.Args[1]
  8762  	v_0 := v.Args[0]
  8763  	b := v.Block
  8764  	typ := &b.Func.Config.Types
  8765  	// match: (Lsh32x64 x y)
  8766  	// cond: shiftIsBounded(v)
  8767  	// result: (SLL x y)
  8768  	for {
  8769  		x := v_0
  8770  		y := v_1
  8771  		if !(shiftIsBounded(v)) {
  8772  			break
  8773  		}
  8774  		v.reset(OpLOONG64SLL)
  8775  		v.AddArg2(x, y)
  8776  		return true
  8777  	}
  8778  	// match: (Lsh32x64 <t> x y)
  8779  	// cond: !shiftIsBounded(v)
  8780  	// result: (MASKEQZ (SLL <t> x y) (SGTU (MOVVconst <typ.UInt64> [32]) y))
  8781  	for {
  8782  		t := v.Type
  8783  		x := v_0
  8784  		y := v_1
  8785  		if !(!shiftIsBounded(v)) {
  8786  			break
  8787  		}
  8788  		v.reset(OpLOONG64MASKEQZ)
  8789  		v0 := b.NewValue0(v.Pos, OpLOONG64SLL, t)
  8790  		v0.AddArg2(x, y)
  8791  		v1 := b.NewValue0(v.Pos, OpLOONG64SGTU, typ.Bool)
  8792  		v2 := b.NewValue0(v.Pos, OpLOONG64MOVVconst, typ.UInt64)
  8793  		v2.AuxInt = int64ToAuxInt(32)
  8794  		v1.AddArg2(v2, y)
  8795  		v.AddArg2(v0, v1)
  8796  		return true
  8797  	}
  8798  	return false
  8799  }
  8800  func rewriteValueLOONG64_OpLsh32x8(v *Value) bool {
  8801  	v_1 := v.Args[1]
  8802  	v_0 := v.Args[0]
  8803  	b := v.Block
  8804  	typ := &b.Func.Config.Types
  8805  	// match: (Lsh32x8 x y)
  8806  	// cond: shiftIsBounded(v)
  8807  	// result: (SLL x y)
  8808  	for {
  8809  		x := v_0
  8810  		y := v_1
  8811  		if !(shiftIsBounded(v)) {
  8812  			break
  8813  		}
  8814  		v.reset(OpLOONG64SLL)
  8815  		v.AddArg2(x, y)
  8816  		return true
  8817  	}
  8818  	// match: (Lsh32x8 <t> x y)
  8819  	// cond: !shiftIsBounded(v)
  8820  	// result: (MASKEQZ (SLL <t> x (ZeroExt8to64 y)) (SGTU (MOVVconst <typ.UInt64> [32]) (ZeroExt8to64 y)))
  8821  	for {
  8822  		t := v.Type
  8823  		x := v_0
  8824  		y := v_1
  8825  		if !(!shiftIsBounded(v)) {
  8826  			break
  8827  		}
  8828  		v.reset(OpLOONG64MASKEQZ)
  8829  		v0 := b.NewValue0(v.Pos, OpLOONG64SLL, t)
  8830  		v1 := b.NewValue0(v.Pos, OpZeroExt8to64, typ.UInt64)
  8831  		v1.AddArg(y)
  8832  		v0.AddArg2(x, v1)
  8833  		v2 := b.NewValue0(v.Pos, OpLOONG64SGTU, typ.Bool)
  8834  		v3 := b.NewValue0(v.Pos, OpLOONG64MOVVconst, typ.UInt64)
  8835  		v3.AuxInt = int64ToAuxInt(32)
  8836  		v2.AddArg2(v3, v1)
  8837  		v.AddArg2(v0, v2)
  8838  		return true
  8839  	}
  8840  	return false
  8841  }
  8842  func rewriteValueLOONG64_OpLsh64x16(v *Value) bool {
  8843  	v_1 := v.Args[1]
  8844  	v_0 := v.Args[0]
  8845  	b := v.Block
  8846  	typ := &b.Func.Config.Types
  8847  	// match: (Lsh64x16 x y)
  8848  	// cond: shiftIsBounded(v)
  8849  	// result: (SLLV x y)
  8850  	for {
  8851  		x := v_0
  8852  		y := v_1
  8853  		if !(shiftIsBounded(v)) {
  8854  			break
  8855  		}
  8856  		v.reset(OpLOONG64SLLV)
  8857  		v.AddArg2(x, y)
  8858  		return true
  8859  	}
  8860  	// match: (Lsh64x16 <t> x y)
  8861  	// cond: !shiftIsBounded(v)
  8862  	// result: (MASKEQZ (SLLV <t> x (ZeroExt16to64 y)) (SGTU (MOVVconst <typ.UInt64> [64]) (ZeroExt16to64 y)))
  8863  	for {
  8864  		t := v.Type
  8865  		x := v_0
  8866  		y := v_1
  8867  		if !(!shiftIsBounded(v)) {
  8868  			break
  8869  		}
  8870  		v.reset(OpLOONG64MASKEQZ)
  8871  		v0 := b.NewValue0(v.Pos, OpLOONG64SLLV, t)
  8872  		v1 := b.NewValue0(v.Pos, OpZeroExt16to64, typ.UInt64)
  8873  		v1.AddArg(y)
  8874  		v0.AddArg2(x, v1)
  8875  		v2 := b.NewValue0(v.Pos, OpLOONG64SGTU, typ.Bool)
  8876  		v3 := b.NewValue0(v.Pos, OpLOONG64MOVVconst, typ.UInt64)
  8877  		v3.AuxInt = int64ToAuxInt(64)
  8878  		v2.AddArg2(v3, v1)
  8879  		v.AddArg2(v0, v2)
  8880  		return true
  8881  	}
  8882  	return false
  8883  }
  8884  func rewriteValueLOONG64_OpLsh64x32(v *Value) bool {
  8885  	v_1 := v.Args[1]
  8886  	v_0 := v.Args[0]
  8887  	b := v.Block
  8888  	typ := &b.Func.Config.Types
  8889  	// match: (Lsh64x32 x y)
  8890  	// cond: shiftIsBounded(v)
  8891  	// result: (SLLV x y)
  8892  	for {
  8893  		x := v_0
  8894  		y := v_1
  8895  		if !(shiftIsBounded(v)) {
  8896  			break
  8897  		}
  8898  		v.reset(OpLOONG64SLLV)
  8899  		v.AddArg2(x, y)
  8900  		return true
  8901  	}
  8902  	// match: (Lsh64x32 <t> x y)
  8903  	// cond: !shiftIsBounded(v)
  8904  	// result: (MASKEQZ (SLLV <t> x (ZeroExt32to64 y)) (SGTU (MOVVconst <typ.UInt64> [64]) (ZeroExt32to64 y)))
  8905  	for {
  8906  		t := v.Type
  8907  		x := v_0
  8908  		y := v_1
  8909  		if !(!shiftIsBounded(v)) {
  8910  			break
  8911  		}
  8912  		v.reset(OpLOONG64MASKEQZ)
  8913  		v0 := b.NewValue0(v.Pos, OpLOONG64SLLV, t)
  8914  		v1 := b.NewValue0(v.Pos, OpZeroExt32to64, typ.UInt64)
  8915  		v1.AddArg(y)
  8916  		v0.AddArg2(x, v1)
  8917  		v2 := b.NewValue0(v.Pos, OpLOONG64SGTU, typ.Bool)
  8918  		v3 := b.NewValue0(v.Pos, OpLOONG64MOVVconst, typ.UInt64)
  8919  		v3.AuxInt = int64ToAuxInt(64)
  8920  		v2.AddArg2(v3, v1)
  8921  		v.AddArg2(v0, v2)
  8922  		return true
  8923  	}
  8924  	return false
  8925  }
  8926  func rewriteValueLOONG64_OpLsh64x64(v *Value) bool {
  8927  	v_1 := v.Args[1]
  8928  	v_0 := v.Args[0]
  8929  	b := v.Block
  8930  	typ := &b.Func.Config.Types
  8931  	// match: (Lsh64x64 x y)
  8932  	// cond: shiftIsBounded(v)
  8933  	// result: (SLLV x y)
  8934  	for {
  8935  		x := v_0
  8936  		y := v_1
  8937  		if !(shiftIsBounded(v)) {
  8938  			break
  8939  		}
  8940  		v.reset(OpLOONG64SLLV)
  8941  		v.AddArg2(x, y)
  8942  		return true
  8943  	}
  8944  	// match: (Lsh64x64 <t> x y)
  8945  	// cond: !shiftIsBounded(v)
  8946  	// result: (MASKEQZ (SLLV <t> x y) (SGTU (MOVVconst <typ.UInt64> [64]) y))
  8947  	for {
  8948  		t := v.Type
  8949  		x := v_0
  8950  		y := v_1
  8951  		if !(!shiftIsBounded(v)) {
  8952  			break
  8953  		}
  8954  		v.reset(OpLOONG64MASKEQZ)
  8955  		v0 := b.NewValue0(v.Pos, OpLOONG64SLLV, t)
  8956  		v0.AddArg2(x, y)
  8957  		v1 := b.NewValue0(v.Pos, OpLOONG64SGTU, typ.Bool)
  8958  		v2 := b.NewValue0(v.Pos, OpLOONG64MOVVconst, typ.UInt64)
  8959  		v2.AuxInt = int64ToAuxInt(64)
  8960  		v1.AddArg2(v2, y)
  8961  		v.AddArg2(v0, v1)
  8962  		return true
  8963  	}
  8964  	return false
  8965  }
  8966  func rewriteValueLOONG64_OpLsh64x8(v *Value) bool {
  8967  	v_1 := v.Args[1]
  8968  	v_0 := v.Args[0]
  8969  	b := v.Block
  8970  	typ := &b.Func.Config.Types
  8971  	// match: (Lsh64x8 x y)
  8972  	// cond: shiftIsBounded(v)
  8973  	// result: (SLLV x y)
  8974  	for {
  8975  		x := v_0
  8976  		y := v_1
  8977  		if !(shiftIsBounded(v)) {
  8978  			break
  8979  		}
  8980  		v.reset(OpLOONG64SLLV)
  8981  		v.AddArg2(x, y)
  8982  		return true
  8983  	}
  8984  	// match: (Lsh64x8 <t> x y)
  8985  	// cond: !shiftIsBounded(v)
  8986  	// result: (MASKEQZ (SLLV <t> x (ZeroExt8to64 y)) (SGTU (MOVVconst <typ.UInt64> [64]) (ZeroExt8to64 y)))
  8987  	for {
  8988  		t := v.Type
  8989  		x := v_0
  8990  		y := v_1
  8991  		if !(!shiftIsBounded(v)) {
  8992  			break
  8993  		}
  8994  		v.reset(OpLOONG64MASKEQZ)
  8995  		v0 := b.NewValue0(v.Pos, OpLOONG64SLLV, t)
  8996  		v1 := b.NewValue0(v.Pos, OpZeroExt8to64, typ.UInt64)
  8997  		v1.AddArg(y)
  8998  		v0.AddArg2(x, v1)
  8999  		v2 := b.NewValue0(v.Pos, OpLOONG64SGTU, typ.Bool)
  9000  		v3 := b.NewValue0(v.Pos, OpLOONG64MOVVconst, typ.UInt64)
  9001  		v3.AuxInt = int64ToAuxInt(64)
  9002  		v2.AddArg2(v3, v1)
  9003  		v.AddArg2(v0, v2)
  9004  		return true
  9005  	}
  9006  	return false
  9007  }
  9008  func rewriteValueLOONG64_OpLsh8x16(v *Value) bool {
  9009  	v_1 := v.Args[1]
  9010  	v_0 := v.Args[0]
  9011  	b := v.Block
  9012  	typ := &b.Func.Config.Types
  9013  	// match: (Lsh8x16 x y)
  9014  	// cond: shiftIsBounded(v)
  9015  	// result: (SLLV x y)
  9016  	for {
  9017  		x := v_0
  9018  		y := v_1
  9019  		if !(shiftIsBounded(v)) {
  9020  			break
  9021  		}
  9022  		v.reset(OpLOONG64SLLV)
  9023  		v.AddArg2(x, y)
  9024  		return true
  9025  	}
  9026  	// match: (Lsh8x16 <t> x y)
  9027  	// cond: !shiftIsBounded(v)
  9028  	// result: (MASKEQZ (SLLV <t> x (ZeroExt16to64 y)) (SGTU (MOVVconst <typ.UInt64> [64]) (ZeroExt16to64 y)))
  9029  	for {
  9030  		t := v.Type
  9031  		x := v_0
  9032  		y := v_1
  9033  		if !(!shiftIsBounded(v)) {
  9034  			break
  9035  		}
  9036  		v.reset(OpLOONG64MASKEQZ)
  9037  		v0 := b.NewValue0(v.Pos, OpLOONG64SLLV, t)
  9038  		v1 := b.NewValue0(v.Pos, OpZeroExt16to64, typ.UInt64)
  9039  		v1.AddArg(y)
  9040  		v0.AddArg2(x, v1)
  9041  		v2 := b.NewValue0(v.Pos, OpLOONG64SGTU, typ.Bool)
  9042  		v3 := b.NewValue0(v.Pos, OpLOONG64MOVVconst, typ.UInt64)
  9043  		v3.AuxInt = int64ToAuxInt(64)
  9044  		v2.AddArg2(v3, v1)
  9045  		v.AddArg2(v0, v2)
  9046  		return true
  9047  	}
  9048  	return false
  9049  }
  9050  func rewriteValueLOONG64_OpLsh8x32(v *Value) bool {
  9051  	v_1 := v.Args[1]
  9052  	v_0 := v.Args[0]
  9053  	b := v.Block
  9054  	typ := &b.Func.Config.Types
  9055  	// match: (Lsh8x32 x y)
  9056  	// cond: shiftIsBounded(v)
  9057  	// result: (SLLV x y)
  9058  	for {
  9059  		x := v_0
  9060  		y := v_1
  9061  		if !(shiftIsBounded(v)) {
  9062  			break
  9063  		}
  9064  		v.reset(OpLOONG64SLLV)
  9065  		v.AddArg2(x, y)
  9066  		return true
  9067  	}
  9068  	// match: (Lsh8x32 <t> x y)
  9069  	// cond: !shiftIsBounded(v)
  9070  	// result: (MASKEQZ (SLLV <t> x (ZeroExt32to64 y)) (SGTU (MOVVconst <typ.UInt64> [64]) (ZeroExt32to64 y)))
  9071  	for {
  9072  		t := v.Type
  9073  		x := v_0
  9074  		y := v_1
  9075  		if !(!shiftIsBounded(v)) {
  9076  			break
  9077  		}
  9078  		v.reset(OpLOONG64MASKEQZ)
  9079  		v0 := b.NewValue0(v.Pos, OpLOONG64SLLV, t)
  9080  		v1 := b.NewValue0(v.Pos, OpZeroExt32to64, typ.UInt64)
  9081  		v1.AddArg(y)
  9082  		v0.AddArg2(x, v1)
  9083  		v2 := b.NewValue0(v.Pos, OpLOONG64SGTU, typ.Bool)
  9084  		v3 := b.NewValue0(v.Pos, OpLOONG64MOVVconst, typ.UInt64)
  9085  		v3.AuxInt = int64ToAuxInt(64)
  9086  		v2.AddArg2(v3, v1)
  9087  		v.AddArg2(v0, v2)
  9088  		return true
  9089  	}
  9090  	return false
  9091  }
  9092  func rewriteValueLOONG64_OpLsh8x64(v *Value) bool {
  9093  	v_1 := v.Args[1]
  9094  	v_0 := v.Args[0]
  9095  	b := v.Block
  9096  	typ := &b.Func.Config.Types
  9097  	// match: (Lsh8x64 x y)
  9098  	// cond: shiftIsBounded(v)
  9099  	// result: (SLLV x y)
  9100  	for {
  9101  		x := v_0
  9102  		y := v_1
  9103  		if !(shiftIsBounded(v)) {
  9104  			break
  9105  		}
  9106  		v.reset(OpLOONG64SLLV)
  9107  		v.AddArg2(x, y)
  9108  		return true
  9109  	}
  9110  	// match: (Lsh8x64 <t> x y)
  9111  	// cond: !shiftIsBounded(v)
  9112  	// result: (MASKEQZ (SLLV <t> x y) (SGTU (MOVVconst <typ.UInt64> [64]) y))
  9113  	for {
  9114  		t := v.Type
  9115  		x := v_0
  9116  		y := v_1
  9117  		if !(!shiftIsBounded(v)) {
  9118  			break
  9119  		}
  9120  		v.reset(OpLOONG64MASKEQZ)
  9121  		v0 := b.NewValue0(v.Pos, OpLOONG64SLLV, t)
  9122  		v0.AddArg2(x, y)
  9123  		v1 := b.NewValue0(v.Pos, OpLOONG64SGTU, typ.Bool)
  9124  		v2 := b.NewValue0(v.Pos, OpLOONG64MOVVconst, typ.UInt64)
  9125  		v2.AuxInt = int64ToAuxInt(64)
  9126  		v1.AddArg2(v2, y)
  9127  		v.AddArg2(v0, v1)
  9128  		return true
  9129  	}
  9130  	return false
  9131  }
  9132  func rewriteValueLOONG64_OpLsh8x8(v *Value) bool {
  9133  	v_1 := v.Args[1]
  9134  	v_0 := v.Args[0]
  9135  	b := v.Block
  9136  	typ := &b.Func.Config.Types
  9137  	// match: (Lsh8x8 x y)
  9138  	// cond: shiftIsBounded(v)
  9139  	// result: (SLLV x y)
  9140  	for {
  9141  		x := v_0
  9142  		y := v_1
  9143  		if !(shiftIsBounded(v)) {
  9144  			break
  9145  		}
  9146  		v.reset(OpLOONG64SLLV)
  9147  		v.AddArg2(x, y)
  9148  		return true
  9149  	}
  9150  	// match: (Lsh8x8 <t> x y)
  9151  	// cond: !shiftIsBounded(v)
  9152  	// result: (MASKEQZ (SLLV <t> x (ZeroExt8to64 y)) (SGTU (MOVVconst <typ.UInt64> [64]) (ZeroExt8to64 y)))
  9153  	for {
  9154  		t := v.Type
  9155  		x := v_0
  9156  		y := v_1
  9157  		if !(!shiftIsBounded(v)) {
  9158  			break
  9159  		}
  9160  		v.reset(OpLOONG64MASKEQZ)
  9161  		v0 := b.NewValue0(v.Pos, OpLOONG64SLLV, t)
  9162  		v1 := b.NewValue0(v.Pos, OpZeroExt8to64, typ.UInt64)
  9163  		v1.AddArg(y)
  9164  		v0.AddArg2(x, v1)
  9165  		v2 := b.NewValue0(v.Pos, OpLOONG64SGTU, typ.Bool)
  9166  		v3 := b.NewValue0(v.Pos, OpLOONG64MOVVconst, typ.UInt64)
  9167  		v3.AuxInt = int64ToAuxInt(64)
  9168  		v2.AddArg2(v3, v1)
  9169  		v.AddArg2(v0, v2)
  9170  		return true
  9171  	}
  9172  	return false
  9173  }
  9174  func rewriteValueLOONG64_OpMod16(v *Value) bool {
  9175  	v_1 := v.Args[1]
  9176  	v_0 := v.Args[0]
  9177  	b := v.Block
  9178  	typ := &b.Func.Config.Types
  9179  	// match: (Mod16 x y)
  9180  	// result: (REMV (SignExt16to64 x) (SignExt16to64 y))
  9181  	for {
  9182  		x := v_0
  9183  		y := v_1
  9184  		v.reset(OpLOONG64REMV)
  9185  		v0 := b.NewValue0(v.Pos, OpSignExt16to64, typ.Int64)
  9186  		v0.AddArg(x)
  9187  		v1 := b.NewValue0(v.Pos, OpSignExt16to64, typ.Int64)
  9188  		v1.AddArg(y)
  9189  		v.AddArg2(v0, v1)
  9190  		return true
  9191  	}
  9192  }
  9193  func rewriteValueLOONG64_OpMod16u(v *Value) bool {
  9194  	v_1 := v.Args[1]
  9195  	v_0 := v.Args[0]
  9196  	b := v.Block
  9197  	typ := &b.Func.Config.Types
  9198  	// match: (Mod16u x y)
  9199  	// result: (REMVU (ZeroExt16to64 x) (ZeroExt16to64 y))
  9200  	for {
  9201  		x := v_0
  9202  		y := v_1
  9203  		v.reset(OpLOONG64REMVU)
  9204  		v0 := b.NewValue0(v.Pos, OpZeroExt16to64, typ.UInt64)
  9205  		v0.AddArg(x)
  9206  		v1 := b.NewValue0(v.Pos, OpZeroExt16to64, typ.UInt64)
  9207  		v1.AddArg(y)
  9208  		v.AddArg2(v0, v1)
  9209  		return true
  9210  	}
  9211  }
  9212  func rewriteValueLOONG64_OpMod32(v *Value) bool {
  9213  	v_1 := v.Args[1]
  9214  	v_0 := v.Args[0]
  9215  	b := v.Block
  9216  	typ := &b.Func.Config.Types
  9217  	// match: (Mod32 x y)
  9218  	// result: (REMV (SignExt32to64 x) (SignExt32to64 y))
  9219  	for {
  9220  		x := v_0
  9221  		y := v_1
  9222  		v.reset(OpLOONG64REMV)
  9223  		v0 := b.NewValue0(v.Pos, OpSignExt32to64, typ.Int64)
  9224  		v0.AddArg(x)
  9225  		v1 := b.NewValue0(v.Pos, OpSignExt32to64, typ.Int64)
  9226  		v1.AddArg(y)
  9227  		v.AddArg2(v0, v1)
  9228  		return true
  9229  	}
  9230  }
  9231  func rewriteValueLOONG64_OpMod32u(v *Value) bool {
  9232  	v_1 := v.Args[1]
  9233  	v_0 := v.Args[0]
  9234  	b := v.Block
  9235  	typ := &b.Func.Config.Types
  9236  	// match: (Mod32u x y)
  9237  	// result: (REMVU (ZeroExt32to64 x) (ZeroExt32to64 y))
  9238  	for {
  9239  		x := v_0
  9240  		y := v_1
  9241  		v.reset(OpLOONG64REMVU)
  9242  		v0 := b.NewValue0(v.Pos, OpZeroExt32to64, typ.UInt64)
  9243  		v0.AddArg(x)
  9244  		v1 := b.NewValue0(v.Pos, OpZeroExt32to64, typ.UInt64)
  9245  		v1.AddArg(y)
  9246  		v.AddArg2(v0, v1)
  9247  		return true
  9248  	}
  9249  }
  9250  func rewriteValueLOONG64_OpMod64(v *Value) bool {
  9251  	v_1 := v.Args[1]
  9252  	v_0 := v.Args[0]
  9253  	// match: (Mod64 x y)
  9254  	// result: (REMV x y)
  9255  	for {
  9256  		x := v_0
  9257  		y := v_1
  9258  		v.reset(OpLOONG64REMV)
  9259  		v.AddArg2(x, y)
  9260  		return true
  9261  	}
  9262  }
  9263  func rewriteValueLOONG64_OpMod8(v *Value) bool {
  9264  	v_1 := v.Args[1]
  9265  	v_0 := v.Args[0]
  9266  	b := v.Block
  9267  	typ := &b.Func.Config.Types
  9268  	// match: (Mod8 x y)
  9269  	// result: (REMV (SignExt8to64 x) (SignExt8to64 y))
  9270  	for {
  9271  		x := v_0
  9272  		y := v_1
  9273  		v.reset(OpLOONG64REMV)
  9274  		v0 := b.NewValue0(v.Pos, OpSignExt8to64, typ.Int64)
  9275  		v0.AddArg(x)
  9276  		v1 := b.NewValue0(v.Pos, OpSignExt8to64, typ.Int64)
  9277  		v1.AddArg(y)
  9278  		v.AddArg2(v0, v1)
  9279  		return true
  9280  	}
  9281  }
  9282  func rewriteValueLOONG64_OpMod8u(v *Value) bool {
  9283  	v_1 := v.Args[1]
  9284  	v_0 := v.Args[0]
  9285  	b := v.Block
  9286  	typ := &b.Func.Config.Types
  9287  	// match: (Mod8u x y)
  9288  	// result: (REMVU (ZeroExt8to64 x) (ZeroExt8to64 y))
  9289  	for {
  9290  		x := v_0
  9291  		y := v_1
  9292  		v.reset(OpLOONG64REMVU)
  9293  		v0 := b.NewValue0(v.Pos, OpZeroExt8to64, typ.UInt64)
  9294  		v0.AddArg(x)
  9295  		v1 := b.NewValue0(v.Pos, OpZeroExt8to64, typ.UInt64)
  9296  		v1.AddArg(y)
  9297  		v.AddArg2(v0, v1)
  9298  		return true
  9299  	}
  9300  }
  9301  func rewriteValueLOONG64_OpMove(v *Value) bool {
  9302  	v_2 := v.Args[2]
  9303  	v_1 := v.Args[1]
  9304  	v_0 := v.Args[0]
  9305  	b := v.Block
  9306  	typ := &b.Func.Config.Types
  9307  	// match: (Move [0] _ _ mem)
  9308  	// result: mem
  9309  	for {
  9310  		if auxIntToInt64(v.AuxInt) != 0 {
  9311  			break
  9312  		}
  9313  		mem := v_2
  9314  		v.copyOf(mem)
  9315  		return true
  9316  	}
  9317  	// match: (Move [1] dst src mem)
  9318  	// result: (MOVBstore dst (MOVBUload src mem) mem)
  9319  	for {
  9320  		if auxIntToInt64(v.AuxInt) != 1 {
  9321  			break
  9322  		}
  9323  		dst := v_0
  9324  		src := v_1
  9325  		mem := v_2
  9326  		v.reset(OpLOONG64MOVBstore)
  9327  		v0 := b.NewValue0(v.Pos, OpLOONG64MOVBUload, typ.UInt8)
  9328  		v0.AddArg2(src, mem)
  9329  		v.AddArg3(dst, v0, mem)
  9330  		return true
  9331  	}
  9332  	// match: (Move [2] dst src mem)
  9333  	// result: (MOVHstore dst (MOVHUload src mem) mem)
  9334  	for {
  9335  		if auxIntToInt64(v.AuxInt) != 2 {
  9336  			break
  9337  		}
  9338  		dst := v_0
  9339  		src := v_1
  9340  		mem := v_2
  9341  		v.reset(OpLOONG64MOVHstore)
  9342  		v0 := b.NewValue0(v.Pos, OpLOONG64MOVHUload, typ.UInt16)
  9343  		v0.AddArg2(src, mem)
  9344  		v.AddArg3(dst, v0, mem)
  9345  		return true
  9346  	}
  9347  	// match: (Move [3] dst src mem)
  9348  	// result: (MOVBstore [2] dst (MOVBUload [2] src mem) (MOVHstore dst (MOVHUload src mem) mem))
  9349  	for {
  9350  		if auxIntToInt64(v.AuxInt) != 3 {
  9351  			break
  9352  		}
  9353  		dst := v_0
  9354  		src := v_1
  9355  		mem := v_2
  9356  		v.reset(OpLOONG64MOVBstore)
  9357  		v.AuxInt = int32ToAuxInt(2)
  9358  		v0 := b.NewValue0(v.Pos, OpLOONG64MOVBUload, typ.UInt8)
  9359  		v0.AuxInt = int32ToAuxInt(2)
  9360  		v0.AddArg2(src, mem)
  9361  		v1 := b.NewValue0(v.Pos, OpLOONG64MOVHstore, types.TypeMem)
  9362  		v2 := b.NewValue0(v.Pos, OpLOONG64MOVHUload, typ.UInt16)
  9363  		v2.AddArg2(src, mem)
  9364  		v1.AddArg3(dst, v2, mem)
  9365  		v.AddArg3(dst, v0, v1)
  9366  		return true
  9367  	}
  9368  	// match: (Move [4] dst src mem)
  9369  	// result: (MOVWstore dst (MOVWUload src mem) mem)
  9370  	for {
  9371  		if auxIntToInt64(v.AuxInt) != 4 {
  9372  			break
  9373  		}
  9374  		dst := v_0
  9375  		src := v_1
  9376  		mem := v_2
  9377  		v.reset(OpLOONG64MOVWstore)
  9378  		v0 := b.NewValue0(v.Pos, OpLOONG64MOVWUload, typ.UInt32)
  9379  		v0.AddArg2(src, mem)
  9380  		v.AddArg3(dst, v0, mem)
  9381  		return true
  9382  	}
  9383  	// match: (Move [5] dst src mem)
  9384  	// result: (MOVBstore [4] dst (MOVBUload [4] src mem) (MOVWstore dst (MOVWUload src mem) mem))
  9385  	for {
  9386  		if auxIntToInt64(v.AuxInt) != 5 {
  9387  			break
  9388  		}
  9389  		dst := v_0
  9390  		src := v_1
  9391  		mem := v_2
  9392  		v.reset(OpLOONG64MOVBstore)
  9393  		v.AuxInt = int32ToAuxInt(4)
  9394  		v0 := b.NewValue0(v.Pos, OpLOONG64MOVBUload, typ.UInt8)
  9395  		v0.AuxInt = int32ToAuxInt(4)
  9396  		v0.AddArg2(src, mem)
  9397  		v1 := b.NewValue0(v.Pos, OpLOONG64MOVWstore, types.TypeMem)
  9398  		v2 := b.NewValue0(v.Pos, OpLOONG64MOVWUload, typ.UInt32)
  9399  		v2.AddArg2(src, mem)
  9400  		v1.AddArg3(dst, v2, mem)
  9401  		v.AddArg3(dst, v0, v1)
  9402  		return true
  9403  	}
  9404  	// match: (Move [6] dst src mem)
  9405  	// result: (MOVHstore [4] dst (MOVHUload [4] src mem) (MOVWstore dst (MOVWUload src mem) mem))
  9406  	for {
  9407  		if auxIntToInt64(v.AuxInt) != 6 {
  9408  			break
  9409  		}
  9410  		dst := v_0
  9411  		src := v_1
  9412  		mem := v_2
  9413  		v.reset(OpLOONG64MOVHstore)
  9414  		v.AuxInt = int32ToAuxInt(4)
  9415  		v0 := b.NewValue0(v.Pos, OpLOONG64MOVHUload, typ.UInt16)
  9416  		v0.AuxInt = int32ToAuxInt(4)
  9417  		v0.AddArg2(src, mem)
  9418  		v1 := b.NewValue0(v.Pos, OpLOONG64MOVWstore, types.TypeMem)
  9419  		v2 := b.NewValue0(v.Pos, OpLOONG64MOVWUload, typ.UInt32)
  9420  		v2.AddArg2(src, mem)
  9421  		v1.AddArg3(dst, v2, mem)
  9422  		v.AddArg3(dst, v0, v1)
  9423  		return true
  9424  	}
  9425  	// match: (Move [7] dst src mem)
  9426  	// result: (MOVWstore [3] dst (MOVWUload [3] src mem) (MOVWstore dst (MOVWUload src mem) mem))
  9427  	for {
  9428  		if auxIntToInt64(v.AuxInt) != 7 {
  9429  			break
  9430  		}
  9431  		dst := v_0
  9432  		src := v_1
  9433  		mem := v_2
  9434  		v.reset(OpLOONG64MOVWstore)
  9435  		v.AuxInt = int32ToAuxInt(3)
  9436  		v0 := b.NewValue0(v.Pos, OpLOONG64MOVWUload, typ.UInt32)
  9437  		v0.AuxInt = int32ToAuxInt(3)
  9438  		v0.AddArg2(src, mem)
  9439  		v1 := b.NewValue0(v.Pos, OpLOONG64MOVWstore, types.TypeMem)
  9440  		v2 := b.NewValue0(v.Pos, OpLOONG64MOVWUload, typ.UInt32)
  9441  		v2.AddArg2(src, mem)
  9442  		v1.AddArg3(dst, v2, mem)
  9443  		v.AddArg3(dst, v0, v1)
  9444  		return true
  9445  	}
  9446  	// match: (Move [8] dst src mem)
  9447  	// result: (MOVVstore dst (MOVVload src mem) mem)
  9448  	for {
  9449  		if auxIntToInt64(v.AuxInt) != 8 {
  9450  			break
  9451  		}
  9452  		dst := v_0
  9453  		src := v_1
  9454  		mem := v_2
  9455  		v.reset(OpLOONG64MOVVstore)
  9456  		v0 := b.NewValue0(v.Pos, OpLOONG64MOVVload, typ.UInt64)
  9457  		v0.AddArg2(src, mem)
  9458  		v.AddArg3(dst, v0, mem)
  9459  		return true
  9460  	}
  9461  	// match: (Move [9] dst src mem)
  9462  	// result: (MOVBstore [8] dst (MOVBUload [8] src mem) (MOVVstore dst (MOVVload src mem) mem))
  9463  	for {
  9464  		if auxIntToInt64(v.AuxInt) != 9 {
  9465  			break
  9466  		}
  9467  		dst := v_0
  9468  		src := v_1
  9469  		mem := v_2
  9470  		v.reset(OpLOONG64MOVBstore)
  9471  		v.AuxInt = int32ToAuxInt(8)
  9472  		v0 := b.NewValue0(v.Pos, OpLOONG64MOVBUload, typ.UInt8)
  9473  		v0.AuxInt = int32ToAuxInt(8)
  9474  		v0.AddArg2(src, mem)
  9475  		v1 := b.NewValue0(v.Pos, OpLOONG64MOVVstore, types.TypeMem)
  9476  		v2 := b.NewValue0(v.Pos, OpLOONG64MOVVload, typ.UInt64)
  9477  		v2.AddArg2(src, mem)
  9478  		v1.AddArg3(dst, v2, mem)
  9479  		v.AddArg3(dst, v0, v1)
  9480  		return true
  9481  	}
  9482  	// match: (Move [10] dst src mem)
  9483  	// result: (MOVHstore [8] dst (MOVHUload [8] src mem) (MOVVstore dst (MOVVload src mem) mem))
  9484  	for {
  9485  		if auxIntToInt64(v.AuxInt) != 10 {
  9486  			break
  9487  		}
  9488  		dst := v_0
  9489  		src := v_1
  9490  		mem := v_2
  9491  		v.reset(OpLOONG64MOVHstore)
  9492  		v.AuxInt = int32ToAuxInt(8)
  9493  		v0 := b.NewValue0(v.Pos, OpLOONG64MOVHUload, typ.UInt16)
  9494  		v0.AuxInt = int32ToAuxInt(8)
  9495  		v0.AddArg2(src, mem)
  9496  		v1 := b.NewValue0(v.Pos, OpLOONG64MOVVstore, types.TypeMem)
  9497  		v2 := b.NewValue0(v.Pos, OpLOONG64MOVVload, typ.UInt64)
  9498  		v2.AddArg2(src, mem)
  9499  		v1.AddArg3(dst, v2, mem)
  9500  		v.AddArg3(dst, v0, v1)
  9501  		return true
  9502  	}
  9503  	// match: (Move [11] dst src mem)
  9504  	// result: (MOVWstore [7] dst (MOVWload [7] src mem) (MOVVstore dst (MOVVload src mem) mem))
  9505  	for {
  9506  		if auxIntToInt64(v.AuxInt) != 11 {
  9507  			break
  9508  		}
  9509  		dst := v_0
  9510  		src := v_1
  9511  		mem := v_2
  9512  		v.reset(OpLOONG64MOVWstore)
  9513  		v.AuxInt = int32ToAuxInt(7)
  9514  		v0 := b.NewValue0(v.Pos, OpLOONG64MOVWload, typ.Int32)
  9515  		v0.AuxInt = int32ToAuxInt(7)
  9516  		v0.AddArg2(src, mem)
  9517  		v1 := b.NewValue0(v.Pos, OpLOONG64MOVVstore, types.TypeMem)
  9518  		v2 := b.NewValue0(v.Pos, OpLOONG64MOVVload, typ.UInt64)
  9519  		v2.AddArg2(src, mem)
  9520  		v1.AddArg3(dst, v2, mem)
  9521  		v.AddArg3(dst, v0, v1)
  9522  		return true
  9523  	}
  9524  	// match: (Move [12] dst src mem)
  9525  	// result: (MOVWstore [8] dst (MOVWUload [8] src mem) (MOVVstore dst (MOVVload src mem) mem))
  9526  	for {
  9527  		if auxIntToInt64(v.AuxInt) != 12 {
  9528  			break
  9529  		}
  9530  		dst := v_0
  9531  		src := v_1
  9532  		mem := v_2
  9533  		v.reset(OpLOONG64MOVWstore)
  9534  		v.AuxInt = int32ToAuxInt(8)
  9535  		v0 := b.NewValue0(v.Pos, OpLOONG64MOVWUload, typ.UInt32)
  9536  		v0.AuxInt = int32ToAuxInt(8)
  9537  		v0.AddArg2(src, mem)
  9538  		v1 := b.NewValue0(v.Pos, OpLOONG64MOVVstore, types.TypeMem)
  9539  		v2 := b.NewValue0(v.Pos, OpLOONG64MOVVload, typ.UInt64)
  9540  		v2.AddArg2(src, mem)
  9541  		v1.AddArg3(dst, v2, mem)
  9542  		v.AddArg3(dst, v0, v1)
  9543  		return true
  9544  	}
  9545  	// match: (Move [13] dst src mem)
  9546  	// result: (MOVVstore [5] dst (MOVVload [5] src mem) (MOVVstore dst (MOVVload src mem) mem))
  9547  	for {
  9548  		if auxIntToInt64(v.AuxInt) != 13 {
  9549  			break
  9550  		}
  9551  		dst := v_0
  9552  		src := v_1
  9553  		mem := v_2
  9554  		v.reset(OpLOONG64MOVVstore)
  9555  		v.AuxInt = int32ToAuxInt(5)
  9556  		v0 := b.NewValue0(v.Pos, OpLOONG64MOVVload, typ.UInt64)
  9557  		v0.AuxInt = int32ToAuxInt(5)
  9558  		v0.AddArg2(src, mem)
  9559  		v1 := b.NewValue0(v.Pos, OpLOONG64MOVVstore, types.TypeMem)
  9560  		v2 := b.NewValue0(v.Pos, OpLOONG64MOVVload, typ.UInt64)
  9561  		v2.AddArg2(src, mem)
  9562  		v1.AddArg3(dst, v2, mem)
  9563  		v.AddArg3(dst, v0, v1)
  9564  		return true
  9565  	}
  9566  	// match: (Move [14] dst src mem)
  9567  	// result: (MOVVstore [6] dst (MOVVload [6] src mem) (MOVVstore dst (MOVVload src mem) mem))
  9568  	for {
  9569  		if auxIntToInt64(v.AuxInt) != 14 {
  9570  			break
  9571  		}
  9572  		dst := v_0
  9573  		src := v_1
  9574  		mem := v_2
  9575  		v.reset(OpLOONG64MOVVstore)
  9576  		v.AuxInt = int32ToAuxInt(6)
  9577  		v0 := b.NewValue0(v.Pos, OpLOONG64MOVVload, typ.UInt64)
  9578  		v0.AuxInt = int32ToAuxInt(6)
  9579  		v0.AddArg2(src, mem)
  9580  		v1 := b.NewValue0(v.Pos, OpLOONG64MOVVstore, types.TypeMem)
  9581  		v2 := b.NewValue0(v.Pos, OpLOONG64MOVVload, typ.UInt64)
  9582  		v2.AddArg2(src, mem)
  9583  		v1.AddArg3(dst, v2, mem)
  9584  		v.AddArg3(dst, v0, v1)
  9585  		return true
  9586  	}
  9587  	// match: (Move [15] dst src mem)
  9588  	// result: (MOVVstore [7] dst (MOVVload [7] src mem) (MOVVstore dst (MOVVload src mem) mem))
  9589  	for {
  9590  		if auxIntToInt64(v.AuxInt) != 15 {
  9591  			break
  9592  		}
  9593  		dst := v_0
  9594  		src := v_1
  9595  		mem := v_2
  9596  		v.reset(OpLOONG64MOVVstore)
  9597  		v.AuxInt = int32ToAuxInt(7)
  9598  		v0 := b.NewValue0(v.Pos, OpLOONG64MOVVload, typ.UInt64)
  9599  		v0.AuxInt = int32ToAuxInt(7)
  9600  		v0.AddArg2(src, mem)
  9601  		v1 := b.NewValue0(v.Pos, OpLOONG64MOVVstore, types.TypeMem)
  9602  		v2 := b.NewValue0(v.Pos, OpLOONG64MOVVload, typ.UInt64)
  9603  		v2.AddArg2(src, mem)
  9604  		v1.AddArg3(dst, v2, mem)
  9605  		v.AddArg3(dst, v0, v1)
  9606  		return true
  9607  	}
  9608  	// match: (Move [16] dst src mem)
  9609  	// result: (MOVVstore [8] dst (MOVVload [8] src mem) (MOVVstore dst (MOVVload src mem) mem))
  9610  	for {
  9611  		if auxIntToInt64(v.AuxInt) != 16 {
  9612  			break
  9613  		}
  9614  		dst := v_0
  9615  		src := v_1
  9616  		mem := v_2
  9617  		v.reset(OpLOONG64MOVVstore)
  9618  		v.AuxInt = int32ToAuxInt(8)
  9619  		v0 := b.NewValue0(v.Pos, OpLOONG64MOVVload, typ.UInt64)
  9620  		v0.AuxInt = int32ToAuxInt(8)
  9621  		v0.AddArg2(src, mem)
  9622  		v1 := b.NewValue0(v.Pos, OpLOONG64MOVVstore, types.TypeMem)
  9623  		v2 := b.NewValue0(v.Pos, OpLOONG64MOVVload, typ.UInt64)
  9624  		v2.AddArg2(src, mem)
  9625  		v1.AddArg3(dst, v2, mem)
  9626  		v.AddArg3(dst, v0, v1)
  9627  		return true
  9628  	}
  9629  	// match: (Move [s] dst src mem)
  9630  	// cond: s > 16 && s < 192 && logLargeCopy(v, s)
  9631  	// result: (LoweredMove [s] dst src mem)
  9632  	for {
  9633  		s := auxIntToInt64(v.AuxInt)
  9634  		dst := v_0
  9635  		src := v_1
  9636  		mem := v_2
  9637  		if !(s > 16 && s < 192 && logLargeCopy(v, s)) {
  9638  			break
  9639  		}
  9640  		v.reset(OpLOONG64LoweredMove)
  9641  		v.AuxInt = int64ToAuxInt(s)
  9642  		v.AddArg3(dst, src, mem)
  9643  		return true
  9644  	}
  9645  	// match: (Move [s] dst src mem)
  9646  	// cond: s >= 192 && logLargeCopy(v, s)
  9647  	// result: (LoweredMoveLoop [s] dst src mem)
  9648  	for {
  9649  		s := auxIntToInt64(v.AuxInt)
  9650  		dst := v_0
  9651  		src := v_1
  9652  		mem := v_2
  9653  		if !(s >= 192 && logLargeCopy(v, s)) {
  9654  			break
  9655  		}
  9656  		v.reset(OpLOONG64LoweredMoveLoop)
  9657  		v.AuxInt = int64ToAuxInt(s)
  9658  		v.AddArg3(dst, src, mem)
  9659  		return true
  9660  	}
  9661  	return false
  9662  }
  9663  func rewriteValueLOONG64_OpNeq16(v *Value) bool {
  9664  	v_1 := v.Args[1]
  9665  	v_0 := v.Args[0]
  9666  	b := v.Block
  9667  	typ := &b.Func.Config.Types
  9668  	// match: (Neq16 x y)
  9669  	// result: (SGTU (XOR (ZeroExt16to32 x) (ZeroExt16to64 y)) (MOVVconst [0]))
  9670  	for {
  9671  		x := v_0
  9672  		y := v_1
  9673  		v.reset(OpLOONG64SGTU)
  9674  		v0 := b.NewValue0(v.Pos, OpLOONG64XOR, typ.UInt64)
  9675  		v1 := b.NewValue0(v.Pos, OpZeroExt16to32, typ.UInt32)
  9676  		v1.AddArg(x)
  9677  		v2 := b.NewValue0(v.Pos, OpZeroExt16to64, typ.UInt64)
  9678  		v2.AddArg(y)
  9679  		v0.AddArg2(v1, v2)
  9680  		v3 := b.NewValue0(v.Pos, OpLOONG64MOVVconst, typ.UInt64)
  9681  		v3.AuxInt = int64ToAuxInt(0)
  9682  		v.AddArg2(v0, v3)
  9683  		return true
  9684  	}
  9685  }
  9686  func rewriteValueLOONG64_OpNeq32(v *Value) bool {
  9687  	v_1 := v.Args[1]
  9688  	v_0 := v.Args[0]
  9689  	b := v.Block
  9690  	typ := &b.Func.Config.Types
  9691  	// match: (Neq32 x y)
  9692  	// result: (SGTU (XOR (ZeroExt32to64 x) (ZeroExt32to64 y)) (MOVVconst [0]))
  9693  	for {
  9694  		x := v_0
  9695  		y := v_1
  9696  		v.reset(OpLOONG64SGTU)
  9697  		v0 := b.NewValue0(v.Pos, OpLOONG64XOR, typ.UInt64)
  9698  		v1 := b.NewValue0(v.Pos, OpZeroExt32to64, typ.UInt64)
  9699  		v1.AddArg(x)
  9700  		v2 := b.NewValue0(v.Pos, OpZeroExt32to64, typ.UInt64)
  9701  		v2.AddArg(y)
  9702  		v0.AddArg2(v1, v2)
  9703  		v3 := b.NewValue0(v.Pos, OpLOONG64MOVVconst, typ.UInt64)
  9704  		v3.AuxInt = int64ToAuxInt(0)
  9705  		v.AddArg2(v0, v3)
  9706  		return true
  9707  	}
  9708  }
  9709  func rewriteValueLOONG64_OpNeq32F(v *Value) bool {
  9710  	v_1 := v.Args[1]
  9711  	v_0 := v.Args[0]
  9712  	b := v.Block
  9713  	// match: (Neq32F x y)
  9714  	// result: (FPFlagFalse (CMPEQF x y))
  9715  	for {
  9716  		x := v_0
  9717  		y := v_1
  9718  		v.reset(OpLOONG64FPFlagFalse)
  9719  		v0 := b.NewValue0(v.Pos, OpLOONG64CMPEQF, types.TypeFlags)
  9720  		v0.AddArg2(x, y)
  9721  		v.AddArg(v0)
  9722  		return true
  9723  	}
  9724  }
  9725  func rewriteValueLOONG64_OpNeq64(v *Value) bool {
  9726  	v_1 := v.Args[1]
  9727  	v_0 := v.Args[0]
  9728  	b := v.Block
  9729  	typ := &b.Func.Config.Types
  9730  	// match: (Neq64 x y)
  9731  	// result: (SGTU (XOR x y) (MOVVconst [0]))
  9732  	for {
  9733  		x := v_0
  9734  		y := v_1
  9735  		v.reset(OpLOONG64SGTU)
  9736  		v0 := b.NewValue0(v.Pos, OpLOONG64XOR, typ.UInt64)
  9737  		v0.AddArg2(x, y)
  9738  		v1 := b.NewValue0(v.Pos, OpLOONG64MOVVconst, typ.UInt64)
  9739  		v1.AuxInt = int64ToAuxInt(0)
  9740  		v.AddArg2(v0, v1)
  9741  		return true
  9742  	}
  9743  }
  9744  func rewriteValueLOONG64_OpNeq64F(v *Value) bool {
  9745  	v_1 := v.Args[1]
  9746  	v_0 := v.Args[0]
  9747  	b := v.Block
  9748  	// match: (Neq64F x y)
  9749  	// result: (FPFlagFalse (CMPEQD x y))
  9750  	for {
  9751  		x := v_0
  9752  		y := v_1
  9753  		v.reset(OpLOONG64FPFlagFalse)
  9754  		v0 := b.NewValue0(v.Pos, OpLOONG64CMPEQD, types.TypeFlags)
  9755  		v0.AddArg2(x, y)
  9756  		v.AddArg(v0)
  9757  		return true
  9758  	}
  9759  }
  9760  func rewriteValueLOONG64_OpNeq8(v *Value) bool {
  9761  	v_1 := v.Args[1]
  9762  	v_0 := v.Args[0]
  9763  	b := v.Block
  9764  	typ := &b.Func.Config.Types
  9765  	// match: (Neq8 x y)
  9766  	// result: (SGTU (XOR (ZeroExt8to64 x) (ZeroExt8to64 y)) (MOVVconst [0]))
  9767  	for {
  9768  		x := v_0
  9769  		y := v_1
  9770  		v.reset(OpLOONG64SGTU)
  9771  		v0 := b.NewValue0(v.Pos, OpLOONG64XOR, typ.UInt64)
  9772  		v1 := b.NewValue0(v.Pos, OpZeroExt8to64, typ.UInt64)
  9773  		v1.AddArg(x)
  9774  		v2 := b.NewValue0(v.Pos, OpZeroExt8to64, typ.UInt64)
  9775  		v2.AddArg(y)
  9776  		v0.AddArg2(v1, v2)
  9777  		v3 := b.NewValue0(v.Pos, OpLOONG64MOVVconst, typ.UInt64)
  9778  		v3.AuxInt = int64ToAuxInt(0)
  9779  		v.AddArg2(v0, v3)
  9780  		return true
  9781  	}
  9782  }
  9783  func rewriteValueLOONG64_OpNeqPtr(v *Value) bool {
  9784  	v_1 := v.Args[1]
  9785  	v_0 := v.Args[0]
  9786  	b := v.Block
  9787  	typ := &b.Func.Config.Types
  9788  	// match: (NeqPtr x y)
  9789  	// result: (SGTU (XOR x y) (MOVVconst [0]))
  9790  	for {
  9791  		x := v_0
  9792  		y := v_1
  9793  		v.reset(OpLOONG64SGTU)
  9794  		v0 := b.NewValue0(v.Pos, OpLOONG64XOR, typ.UInt64)
  9795  		v0.AddArg2(x, y)
  9796  		v1 := b.NewValue0(v.Pos, OpLOONG64MOVVconst, typ.UInt64)
  9797  		v1.AuxInt = int64ToAuxInt(0)
  9798  		v.AddArg2(v0, v1)
  9799  		return true
  9800  	}
  9801  }
  9802  func rewriteValueLOONG64_OpNot(v *Value) bool {
  9803  	v_0 := v.Args[0]
  9804  	// match: (Not x)
  9805  	// result: (XORconst [1] x)
  9806  	for {
  9807  		x := v_0
  9808  		v.reset(OpLOONG64XORconst)
  9809  		v.AuxInt = int64ToAuxInt(1)
  9810  		v.AddArg(x)
  9811  		return true
  9812  	}
  9813  }
  9814  func rewriteValueLOONG64_OpOffPtr(v *Value) bool {
  9815  	v_0 := v.Args[0]
  9816  	// match: (OffPtr [off] ptr:(SP))
  9817  	// result: (MOVVaddr [int32(off)] ptr)
  9818  	for {
  9819  		off := auxIntToInt64(v.AuxInt)
  9820  		ptr := v_0
  9821  		if ptr.Op != OpSP {
  9822  			break
  9823  		}
  9824  		v.reset(OpLOONG64MOVVaddr)
  9825  		v.AuxInt = int32ToAuxInt(int32(off))
  9826  		v.AddArg(ptr)
  9827  		return true
  9828  	}
  9829  	// match: (OffPtr [off] ptr)
  9830  	// result: (ADDVconst [off] ptr)
  9831  	for {
  9832  		off := auxIntToInt64(v.AuxInt)
  9833  		ptr := v_0
  9834  		v.reset(OpLOONG64ADDVconst)
  9835  		v.AuxInt = int64ToAuxInt(off)
  9836  		v.AddArg(ptr)
  9837  		return true
  9838  	}
  9839  }
  9840  func rewriteValueLOONG64_OpPopCount16(v *Value) bool {
  9841  	v_0 := v.Args[0]
  9842  	b := v.Block
  9843  	typ := &b.Func.Config.Types
  9844  	// match: (PopCount16 <t> x)
  9845  	// result: (MOVWfpgp <t> (VPCNT16 <typ.Float32> (MOVWgpfp <typ.Float32> (ZeroExt16to32 x))))
  9846  	for {
  9847  		t := v.Type
  9848  		x := v_0
  9849  		v.reset(OpLOONG64MOVWfpgp)
  9850  		v.Type = t
  9851  		v0 := b.NewValue0(v.Pos, OpLOONG64VPCNT16, typ.Float32)
  9852  		v1 := b.NewValue0(v.Pos, OpLOONG64MOVWgpfp, typ.Float32)
  9853  		v2 := b.NewValue0(v.Pos, OpZeroExt16to32, typ.UInt32)
  9854  		v2.AddArg(x)
  9855  		v1.AddArg(v2)
  9856  		v0.AddArg(v1)
  9857  		v.AddArg(v0)
  9858  		return true
  9859  	}
  9860  }
  9861  func rewriteValueLOONG64_OpPopCount32(v *Value) bool {
  9862  	v_0 := v.Args[0]
  9863  	b := v.Block
  9864  	typ := &b.Func.Config.Types
  9865  	// match: (PopCount32 <t> x)
  9866  	// result: (MOVWfpgp <t> (VPCNT32 <typ.Float32> (MOVWgpfp <typ.Float32> x)))
  9867  	for {
  9868  		t := v.Type
  9869  		x := v_0
  9870  		v.reset(OpLOONG64MOVWfpgp)
  9871  		v.Type = t
  9872  		v0 := b.NewValue0(v.Pos, OpLOONG64VPCNT32, typ.Float32)
  9873  		v1 := b.NewValue0(v.Pos, OpLOONG64MOVWgpfp, typ.Float32)
  9874  		v1.AddArg(x)
  9875  		v0.AddArg(v1)
  9876  		v.AddArg(v0)
  9877  		return true
  9878  	}
  9879  }
  9880  func rewriteValueLOONG64_OpPopCount64(v *Value) bool {
  9881  	v_0 := v.Args[0]
  9882  	b := v.Block
  9883  	typ := &b.Func.Config.Types
  9884  	// match: (PopCount64 <t> x)
  9885  	// result: (MOVVfpgp <t> (VPCNT64 <typ.Float64> (MOVVgpfp <typ.Float64> x)))
  9886  	for {
  9887  		t := v.Type
  9888  		x := v_0
  9889  		v.reset(OpLOONG64MOVVfpgp)
  9890  		v.Type = t
  9891  		v0 := b.NewValue0(v.Pos, OpLOONG64VPCNT64, typ.Float64)
  9892  		v1 := b.NewValue0(v.Pos, OpLOONG64MOVVgpfp, typ.Float64)
  9893  		v1.AddArg(x)
  9894  		v0.AddArg(v1)
  9895  		v.AddArg(v0)
  9896  		return true
  9897  	}
  9898  }
  9899  func rewriteValueLOONG64_OpPrefetchCache(v *Value) bool {
  9900  	v_1 := v.Args[1]
  9901  	v_0 := v.Args[0]
  9902  	// match: (PrefetchCache addr mem)
  9903  	// result: (PRELD addr mem [0])
  9904  	for {
  9905  		addr := v_0
  9906  		mem := v_1
  9907  		v.reset(OpLOONG64PRELD)
  9908  		v.AuxInt = int64ToAuxInt(0)
  9909  		v.AddArg2(addr, mem)
  9910  		return true
  9911  	}
  9912  }
  9913  func rewriteValueLOONG64_OpPrefetchCacheStreamed(v *Value) bool {
  9914  	v_1 := v.Args[1]
  9915  	v_0 := v.Args[0]
  9916  	// match: (PrefetchCacheStreamed addr mem)
  9917  	// result: (PRELDX addr mem [(((512 << 1) + (1 << 12)) << 5) + 2])
  9918  	for {
  9919  		addr := v_0
  9920  		mem := v_1
  9921  		v.reset(OpLOONG64PRELDX)
  9922  		v.AuxInt = int64ToAuxInt((((512 << 1) + (1 << 12)) << 5) + 2)
  9923  		v.AddArg2(addr, mem)
  9924  		return true
  9925  	}
  9926  }
  9927  func rewriteValueLOONG64_OpRotateLeft16(v *Value) bool {
  9928  	v_1 := v.Args[1]
  9929  	v_0 := v.Args[0]
  9930  	b := v.Block
  9931  	typ := &b.Func.Config.Types
  9932  	// match: (RotateLeft16 <t> x (MOVVconst [c]))
  9933  	// result: (Or16 (Lsh16x64 <t> x (MOVVconst [c&15])) (Rsh16Ux64 <t> x (MOVVconst [-c&15])))
  9934  	for {
  9935  		t := v.Type
  9936  		x := v_0
  9937  		if v_1.Op != OpLOONG64MOVVconst {
  9938  			break
  9939  		}
  9940  		c := auxIntToInt64(v_1.AuxInt)
  9941  		v.reset(OpOr16)
  9942  		v0 := b.NewValue0(v.Pos, OpLsh16x64, t)
  9943  		v1 := b.NewValue0(v.Pos, OpLOONG64MOVVconst, typ.UInt64)
  9944  		v1.AuxInt = int64ToAuxInt(c & 15)
  9945  		v0.AddArg2(x, v1)
  9946  		v2 := b.NewValue0(v.Pos, OpRsh16Ux64, t)
  9947  		v3 := b.NewValue0(v.Pos, OpLOONG64MOVVconst, typ.UInt64)
  9948  		v3.AuxInt = int64ToAuxInt(-c & 15)
  9949  		v2.AddArg2(x, v3)
  9950  		v.AddArg2(v0, v2)
  9951  		return true
  9952  	}
  9953  	// match: (RotateLeft16 <t> x y)
  9954  	// result: (ROTR <t> (OR <typ.UInt32> (ZeroExt16to32 x) (SLLVconst <t> (ZeroExt16to32 x) [16])) (NEGV <typ.Int64> y))
  9955  	for {
  9956  		t := v.Type
  9957  		x := v_0
  9958  		y := v_1
  9959  		v.reset(OpLOONG64ROTR)
  9960  		v.Type = t
  9961  		v0 := b.NewValue0(v.Pos, OpLOONG64OR, typ.UInt32)
  9962  		v1 := b.NewValue0(v.Pos, OpZeroExt16to32, typ.UInt32)
  9963  		v1.AddArg(x)
  9964  		v2 := b.NewValue0(v.Pos, OpLOONG64SLLVconst, t)
  9965  		v2.AuxInt = int64ToAuxInt(16)
  9966  		v2.AddArg(v1)
  9967  		v0.AddArg2(v1, v2)
  9968  		v3 := b.NewValue0(v.Pos, OpLOONG64NEGV, typ.Int64)
  9969  		v3.AddArg(y)
  9970  		v.AddArg2(v0, v3)
  9971  		return true
  9972  	}
  9973  }
  9974  func rewriteValueLOONG64_OpRotateLeft32(v *Value) bool {
  9975  	v_1 := v.Args[1]
  9976  	v_0 := v.Args[0]
  9977  	b := v.Block
  9978  	// match: (RotateLeft32 x y)
  9979  	// result: (ROTR x (NEGV <y.Type> y))
  9980  	for {
  9981  		x := v_0
  9982  		y := v_1
  9983  		v.reset(OpLOONG64ROTR)
  9984  		v0 := b.NewValue0(v.Pos, OpLOONG64NEGV, y.Type)
  9985  		v0.AddArg(y)
  9986  		v.AddArg2(x, v0)
  9987  		return true
  9988  	}
  9989  }
  9990  func rewriteValueLOONG64_OpRotateLeft64(v *Value) bool {
  9991  	v_1 := v.Args[1]
  9992  	v_0 := v.Args[0]
  9993  	b := v.Block
  9994  	// match: (RotateLeft64 x y)
  9995  	// result: (ROTRV x (NEGV <y.Type> y))
  9996  	for {
  9997  		x := v_0
  9998  		y := v_1
  9999  		v.reset(OpLOONG64ROTRV)
 10000  		v0 := b.NewValue0(v.Pos, OpLOONG64NEGV, y.Type)
 10001  		v0.AddArg(y)
 10002  		v.AddArg2(x, v0)
 10003  		return true
 10004  	}
 10005  }
 10006  func rewriteValueLOONG64_OpRotateLeft8(v *Value) bool {
 10007  	v_1 := v.Args[1]
 10008  	v_0 := v.Args[0]
 10009  	b := v.Block
 10010  	typ := &b.Func.Config.Types
 10011  	// match: (RotateLeft8 <t> x (MOVVconst [c]))
 10012  	// result: (Or8 (Lsh8x64 <t> x (MOVVconst [c&7])) (Rsh8Ux64 <t> x (MOVVconst [-c&7])))
 10013  	for {
 10014  		t := v.Type
 10015  		x := v_0
 10016  		if v_1.Op != OpLOONG64MOVVconst {
 10017  			break
 10018  		}
 10019  		c := auxIntToInt64(v_1.AuxInt)
 10020  		v.reset(OpOr8)
 10021  		v0 := b.NewValue0(v.Pos, OpLsh8x64, t)
 10022  		v1 := b.NewValue0(v.Pos, OpLOONG64MOVVconst, typ.UInt64)
 10023  		v1.AuxInt = int64ToAuxInt(c & 7)
 10024  		v0.AddArg2(x, v1)
 10025  		v2 := b.NewValue0(v.Pos, OpRsh8Ux64, t)
 10026  		v3 := b.NewValue0(v.Pos, OpLOONG64MOVVconst, typ.UInt64)
 10027  		v3.AuxInt = int64ToAuxInt(-c & 7)
 10028  		v2.AddArg2(x, v3)
 10029  		v.AddArg2(v0, v2)
 10030  		return true
 10031  	}
 10032  	// match: (RotateLeft8 <t> x y)
 10033  	// result: (OR <t> (SLLV <t> x (ANDconst <typ.Int64> [7] y)) (SRLV <t> (ZeroExt8to64 x) (ANDconst <typ.Int64> [7] (NEGV <typ.Int64> y))))
 10034  	for {
 10035  		t := v.Type
 10036  		x := v_0
 10037  		y := v_1
 10038  		v.reset(OpLOONG64OR)
 10039  		v.Type = t
 10040  		v0 := b.NewValue0(v.Pos, OpLOONG64SLLV, t)
 10041  		v1 := b.NewValue0(v.Pos, OpLOONG64ANDconst, typ.Int64)
 10042  		v1.AuxInt = int64ToAuxInt(7)
 10043  		v1.AddArg(y)
 10044  		v0.AddArg2(x, v1)
 10045  		v2 := b.NewValue0(v.Pos, OpLOONG64SRLV, t)
 10046  		v3 := b.NewValue0(v.Pos, OpZeroExt8to64, typ.UInt64)
 10047  		v3.AddArg(x)
 10048  		v4 := b.NewValue0(v.Pos, OpLOONG64ANDconst, typ.Int64)
 10049  		v4.AuxInt = int64ToAuxInt(7)
 10050  		v5 := b.NewValue0(v.Pos, OpLOONG64NEGV, typ.Int64)
 10051  		v5.AddArg(y)
 10052  		v4.AddArg(v5)
 10053  		v2.AddArg2(v3, v4)
 10054  		v.AddArg2(v0, v2)
 10055  		return true
 10056  	}
 10057  }
 10058  func rewriteValueLOONG64_OpRsh16Ux16(v *Value) bool {
 10059  	v_1 := v.Args[1]
 10060  	v_0 := v.Args[0]
 10061  	b := v.Block
 10062  	typ := &b.Func.Config.Types
 10063  	// match: (Rsh16Ux16 x y)
 10064  	// cond: shiftIsBounded(v)
 10065  	// result: (SRLV (ZeroExt16to64 x) y)
 10066  	for {
 10067  		x := v_0
 10068  		y := v_1
 10069  		if !(shiftIsBounded(v)) {
 10070  			break
 10071  		}
 10072  		v.reset(OpLOONG64SRLV)
 10073  		v0 := b.NewValue0(v.Pos, OpZeroExt16to64, typ.UInt64)
 10074  		v0.AddArg(x)
 10075  		v.AddArg2(v0, y)
 10076  		return true
 10077  	}
 10078  	// match: (Rsh16Ux16 <t> x y)
 10079  	// cond: !shiftIsBounded(v)
 10080  	// result: (MASKEQZ (SRLV <t> (ZeroExt16to64 x) (ZeroExt16to64 y)) (SGTU (MOVVconst <typ.UInt64> [64]) (ZeroExt16to64 y)))
 10081  	for {
 10082  		t := v.Type
 10083  		x := v_0
 10084  		y := v_1
 10085  		if !(!shiftIsBounded(v)) {
 10086  			break
 10087  		}
 10088  		v.reset(OpLOONG64MASKEQZ)
 10089  		v0 := b.NewValue0(v.Pos, OpLOONG64SRLV, t)
 10090  		v1 := b.NewValue0(v.Pos, OpZeroExt16to64, typ.UInt64)
 10091  		v1.AddArg(x)
 10092  		v2 := b.NewValue0(v.Pos, OpZeroExt16to64, typ.UInt64)
 10093  		v2.AddArg(y)
 10094  		v0.AddArg2(v1, v2)
 10095  		v3 := b.NewValue0(v.Pos, OpLOONG64SGTU, typ.Bool)
 10096  		v4 := b.NewValue0(v.Pos, OpLOONG64MOVVconst, typ.UInt64)
 10097  		v4.AuxInt = int64ToAuxInt(64)
 10098  		v3.AddArg2(v4, v2)
 10099  		v.AddArg2(v0, v3)
 10100  		return true
 10101  	}
 10102  	return false
 10103  }
 10104  func rewriteValueLOONG64_OpRsh16Ux32(v *Value) bool {
 10105  	v_1 := v.Args[1]
 10106  	v_0 := v.Args[0]
 10107  	b := v.Block
 10108  	typ := &b.Func.Config.Types
 10109  	// match: (Rsh16Ux32 x y)
 10110  	// cond: shiftIsBounded(v)
 10111  	// result: (SRLV (ZeroExt16to64 x) y)
 10112  	for {
 10113  		x := v_0
 10114  		y := v_1
 10115  		if !(shiftIsBounded(v)) {
 10116  			break
 10117  		}
 10118  		v.reset(OpLOONG64SRLV)
 10119  		v0 := b.NewValue0(v.Pos, OpZeroExt16to64, typ.UInt64)
 10120  		v0.AddArg(x)
 10121  		v.AddArg2(v0, y)
 10122  		return true
 10123  	}
 10124  	// match: (Rsh16Ux32 <t> x y)
 10125  	// cond: !shiftIsBounded(v)
 10126  	// result: (MASKEQZ (SRLV <t> (ZeroExt16to64 x) (ZeroExt32to64 y)) (SGTU (MOVVconst <typ.UInt64> [64]) (ZeroExt32to64 y)))
 10127  	for {
 10128  		t := v.Type
 10129  		x := v_0
 10130  		y := v_1
 10131  		if !(!shiftIsBounded(v)) {
 10132  			break
 10133  		}
 10134  		v.reset(OpLOONG64MASKEQZ)
 10135  		v0 := b.NewValue0(v.Pos, OpLOONG64SRLV, t)
 10136  		v1 := b.NewValue0(v.Pos, OpZeroExt16to64, typ.UInt64)
 10137  		v1.AddArg(x)
 10138  		v2 := b.NewValue0(v.Pos, OpZeroExt32to64, typ.UInt64)
 10139  		v2.AddArg(y)
 10140  		v0.AddArg2(v1, v2)
 10141  		v3 := b.NewValue0(v.Pos, OpLOONG64SGTU, typ.Bool)
 10142  		v4 := b.NewValue0(v.Pos, OpLOONG64MOVVconst, typ.UInt64)
 10143  		v4.AuxInt = int64ToAuxInt(64)
 10144  		v3.AddArg2(v4, v2)
 10145  		v.AddArg2(v0, v3)
 10146  		return true
 10147  	}
 10148  	return false
 10149  }
 10150  func rewriteValueLOONG64_OpRsh16Ux64(v *Value) bool {
 10151  	v_1 := v.Args[1]
 10152  	v_0 := v.Args[0]
 10153  	b := v.Block
 10154  	typ := &b.Func.Config.Types
 10155  	// match: (Rsh16Ux64 x y)
 10156  	// cond: shiftIsBounded(v)
 10157  	// result: (SRLV (ZeroExt16to64 x) y)
 10158  	for {
 10159  		x := v_0
 10160  		y := v_1
 10161  		if !(shiftIsBounded(v)) {
 10162  			break
 10163  		}
 10164  		v.reset(OpLOONG64SRLV)
 10165  		v0 := b.NewValue0(v.Pos, OpZeroExt16to64, typ.UInt64)
 10166  		v0.AddArg(x)
 10167  		v.AddArg2(v0, y)
 10168  		return true
 10169  	}
 10170  	// match: (Rsh16Ux64 <t> x y)
 10171  	// cond: !shiftIsBounded(v)
 10172  	// result: (MASKEQZ (SRLV <t> (ZeroExt16to64 x) y) (SGTU (MOVVconst <typ.UInt64> [64]) y))
 10173  	for {
 10174  		t := v.Type
 10175  		x := v_0
 10176  		y := v_1
 10177  		if !(!shiftIsBounded(v)) {
 10178  			break
 10179  		}
 10180  		v.reset(OpLOONG64MASKEQZ)
 10181  		v0 := b.NewValue0(v.Pos, OpLOONG64SRLV, t)
 10182  		v1 := b.NewValue0(v.Pos, OpZeroExt16to64, typ.UInt64)
 10183  		v1.AddArg(x)
 10184  		v0.AddArg2(v1, y)
 10185  		v2 := b.NewValue0(v.Pos, OpLOONG64SGTU, typ.Bool)
 10186  		v3 := b.NewValue0(v.Pos, OpLOONG64MOVVconst, typ.UInt64)
 10187  		v3.AuxInt = int64ToAuxInt(64)
 10188  		v2.AddArg2(v3, y)
 10189  		v.AddArg2(v0, v2)
 10190  		return true
 10191  	}
 10192  	return false
 10193  }
 10194  func rewriteValueLOONG64_OpRsh16Ux8(v *Value) bool {
 10195  	v_1 := v.Args[1]
 10196  	v_0 := v.Args[0]
 10197  	b := v.Block
 10198  	typ := &b.Func.Config.Types
 10199  	// match: (Rsh16Ux8 x y)
 10200  	// cond: shiftIsBounded(v)
 10201  	// result: (SRLV (ZeroExt16to64 x) y)
 10202  	for {
 10203  		x := v_0
 10204  		y := v_1
 10205  		if !(shiftIsBounded(v)) {
 10206  			break
 10207  		}
 10208  		v.reset(OpLOONG64SRLV)
 10209  		v0 := b.NewValue0(v.Pos, OpZeroExt16to64, typ.UInt64)
 10210  		v0.AddArg(x)
 10211  		v.AddArg2(v0, y)
 10212  		return true
 10213  	}
 10214  	// match: (Rsh16Ux8 <t> x y)
 10215  	// cond: !shiftIsBounded(v)
 10216  	// result: (MASKEQZ (SRLV <t> (ZeroExt16to64 x) (ZeroExt8to64 y)) (SGTU (MOVVconst <typ.UInt64> [64]) (ZeroExt8to64 y)))
 10217  	for {
 10218  		t := v.Type
 10219  		x := v_0
 10220  		y := v_1
 10221  		if !(!shiftIsBounded(v)) {
 10222  			break
 10223  		}
 10224  		v.reset(OpLOONG64MASKEQZ)
 10225  		v0 := b.NewValue0(v.Pos, OpLOONG64SRLV, t)
 10226  		v1 := b.NewValue0(v.Pos, OpZeroExt16to64, typ.UInt64)
 10227  		v1.AddArg(x)
 10228  		v2 := b.NewValue0(v.Pos, OpZeroExt8to64, typ.UInt64)
 10229  		v2.AddArg(y)
 10230  		v0.AddArg2(v1, v2)
 10231  		v3 := b.NewValue0(v.Pos, OpLOONG64SGTU, typ.Bool)
 10232  		v4 := b.NewValue0(v.Pos, OpLOONG64MOVVconst, typ.UInt64)
 10233  		v4.AuxInt = int64ToAuxInt(64)
 10234  		v3.AddArg2(v4, v2)
 10235  		v.AddArg2(v0, v3)
 10236  		return true
 10237  	}
 10238  	return false
 10239  }
 10240  func rewriteValueLOONG64_OpRsh16x16(v *Value) bool {
 10241  	v_1 := v.Args[1]
 10242  	v_0 := v.Args[0]
 10243  	b := v.Block
 10244  	typ := &b.Func.Config.Types
 10245  	// match: (Rsh16x16 x y)
 10246  	// cond: shiftIsBounded(v)
 10247  	// result: (SRAV (SignExt16to64 x) y)
 10248  	for {
 10249  		x := v_0
 10250  		y := v_1
 10251  		if !(shiftIsBounded(v)) {
 10252  			break
 10253  		}
 10254  		v.reset(OpLOONG64SRAV)
 10255  		v0 := b.NewValue0(v.Pos, OpSignExt16to64, typ.Int64)
 10256  		v0.AddArg(x)
 10257  		v.AddArg2(v0, y)
 10258  		return true
 10259  	}
 10260  	// match: (Rsh16x16 <t> x y)
 10261  	// cond: !shiftIsBounded(v)
 10262  	// result: (SRAV (SignExt16to64 x) (OR <t> (NEGV <t> (SGTU (ZeroExt16to64 y) (MOVVconst <typ.UInt64> [63]))) (ZeroExt16to64 y)))
 10263  	for {
 10264  		t := v.Type
 10265  		x := v_0
 10266  		y := v_1
 10267  		if !(!shiftIsBounded(v)) {
 10268  			break
 10269  		}
 10270  		v.reset(OpLOONG64SRAV)
 10271  		v0 := b.NewValue0(v.Pos, OpSignExt16to64, typ.Int64)
 10272  		v0.AddArg(x)
 10273  		v1 := b.NewValue0(v.Pos, OpLOONG64OR, t)
 10274  		v2 := b.NewValue0(v.Pos, OpLOONG64NEGV, t)
 10275  		v3 := b.NewValue0(v.Pos, OpLOONG64SGTU, typ.Bool)
 10276  		v4 := b.NewValue0(v.Pos, OpZeroExt16to64, typ.UInt64)
 10277  		v4.AddArg(y)
 10278  		v5 := b.NewValue0(v.Pos, OpLOONG64MOVVconst, typ.UInt64)
 10279  		v5.AuxInt = int64ToAuxInt(63)
 10280  		v3.AddArg2(v4, v5)
 10281  		v2.AddArg(v3)
 10282  		v1.AddArg2(v2, v4)
 10283  		v.AddArg2(v0, v1)
 10284  		return true
 10285  	}
 10286  	return false
 10287  }
 10288  func rewriteValueLOONG64_OpRsh16x32(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: (Rsh16x32 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: (Rsh16x32 <t> x y)
 10309  	// cond: !shiftIsBounded(v)
 10310  	// result: (SRAV (SignExt16to64 x) (OR <t> (NEGV <t> (SGTU (ZeroExt32to64 y) (MOVVconst <typ.UInt64> [63]))) (ZeroExt32to64 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, OpZeroExt32to64, 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_OpRsh16x64(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: (Rsh16x64 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: (Rsh16x64 <t> x y)
 10357  	// cond: !shiftIsBounded(v)
 10358  	// result: (SRAV (SignExt16to64 x) (OR <t> (NEGV <t> (SGTU y (MOVVconst <typ.UInt64> [63]))) 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, OpLOONG64MOVVconst, typ.UInt64)
 10373  		v4.AuxInt = int64ToAuxInt(63)
 10374  		v3.AddArg2(y, v4)
 10375  		v2.AddArg(v3)
 10376  		v1.AddArg2(v2, y)
 10377  		v.AddArg2(v0, v1)
 10378  		return true
 10379  	}
 10380  	return false
 10381  }
 10382  func rewriteValueLOONG64_OpRsh16x8(v *Value) bool {
 10383  	v_1 := v.Args[1]
 10384  	v_0 := v.Args[0]
 10385  	b := v.Block
 10386  	typ := &b.Func.Config.Types
 10387  	// match: (Rsh16x8 x y)
 10388  	// cond: shiftIsBounded(v)
 10389  	// result: (SRAV (SignExt16to64 x) y)
 10390  	for {
 10391  		x := v_0
 10392  		y := v_1
 10393  		if !(shiftIsBounded(v)) {
 10394  			break
 10395  		}
 10396  		v.reset(OpLOONG64SRAV)
 10397  		v0 := b.NewValue0(v.Pos, OpSignExt16to64, typ.Int64)
 10398  		v0.AddArg(x)
 10399  		v.AddArg2(v0, y)
 10400  		return true
 10401  	}
 10402  	// match: (Rsh16x8 <t> x y)
 10403  	// cond: !shiftIsBounded(v)
 10404  	// result: (SRAV (SignExt16to64 x) (OR <t> (NEGV <t> (SGTU (ZeroExt8to64 y) (MOVVconst <typ.UInt64> [63]))) (ZeroExt8to64 y)))
 10405  	for {
 10406  		t := v.Type
 10407  		x := v_0
 10408  		y := v_1
 10409  		if !(!shiftIsBounded(v)) {
 10410  			break
 10411  		}
 10412  		v.reset(OpLOONG64SRAV)
 10413  		v0 := b.NewValue0(v.Pos, OpSignExt16to64, typ.Int64)
 10414  		v0.AddArg(x)
 10415  		v1 := b.NewValue0(v.Pos, OpLOONG64OR, t)
 10416  		v2 := b.NewValue0(v.Pos, OpLOONG64NEGV, t)
 10417  		v3 := b.NewValue0(v.Pos, OpLOONG64SGTU, typ.Bool)
 10418  		v4 := b.NewValue0(v.Pos, OpZeroExt8to64, typ.UInt64)
 10419  		v4.AddArg(y)
 10420  		v5 := b.NewValue0(v.Pos, OpLOONG64MOVVconst, typ.UInt64)
 10421  		v5.AuxInt = int64ToAuxInt(63)
 10422  		v3.AddArg2(v4, v5)
 10423  		v2.AddArg(v3)
 10424  		v1.AddArg2(v2, v4)
 10425  		v.AddArg2(v0, v1)
 10426  		return true
 10427  	}
 10428  	return false
 10429  }
 10430  func rewriteValueLOONG64_OpRsh32Ux16(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: (Rsh32Ux16 x y)
 10436  	// cond: shiftIsBounded(v)
 10437  	// result: (SRL x y)
 10438  	for {
 10439  		x := v_0
 10440  		y := v_1
 10441  		if !(shiftIsBounded(v)) {
 10442  			break
 10443  		}
 10444  		v.reset(OpLOONG64SRL)
 10445  		v.AddArg2(x, y)
 10446  		return true
 10447  	}
 10448  	// match: (Rsh32Ux16 <t> x y)
 10449  	// cond: !shiftIsBounded(v)
 10450  	// result: (MASKEQZ (SRL <t> x (ZeroExt16to64 y)) (SGTU (MOVVconst <typ.UInt64> [32]) (ZeroExt16to64 y)))
 10451  	for {
 10452  		t := v.Type
 10453  		x := v_0
 10454  		y := v_1
 10455  		if !(!shiftIsBounded(v)) {
 10456  			break
 10457  		}
 10458  		v.reset(OpLOONG64MASKEQZ)
 10459  		v0 := b.NewValue0(v.Pos, OpLOONG64SRL, t)
 10460  		v1 := b.NewValue0(v.Pos, OpZeroExt16to64, typ.UInt64)
 10461  		v1.AddArg(y)
 10462  		v0.AddArg2(x, v1)
 10463  		v2 := b.NewValue0(v.Pos, OpLOONG64SGTU, typ.Bool)
 10464  		v3 := b.NewValue0(v.Pos, OpLOONG64MOVVconst, typ.UInt64)
 10465  		v3.AuxInt = int64ToAuxInt(32)
 10466  		v2.AddArg2(v3, v1)
 10467  		v.AddArg2(v0, v2)
 10468  		return true
 10469  	}
 10470  	return false
 10471  }
 10472  func rewriteValueLOONG64_OpRsh32Ux32(v *Value) bool {
 10473  	v_1 := v.Args[1]
 10474  	v_0 := v.Args[0]
 10475  	b := v.Block
 10476  	typ := &b.Func.Config.Types
 10477  	// match: (Rsh32Ux32 x y)
 10478  	// cond: shiftIsBounded(v)
 10479  	// result: (SRL x y)
 10480  	for {
 10481  		x := v_0
 10482  		y := v_1
 10483  		if !(shiftIsBounded(v)) {
 10484  			break
 10485  		}
 10486  		v.reset(OpLOONG64SRL)
 10487  		v.AddArg2(x, y)
 10488  		return true
 10489  	}
 10490  	// match: (Rsh32Ux32 <t> x y)
 10491  	// cond: !shiftIsBounded(v)
 10492  	// result: (MASKEQZ (SRL <t> x (ZeroExt32to64 y)) (SGTU (MOVVconst <typ.UInt64> [32]) (ZeroExt32to64 y)))
 10493  	for {
 10494  		t := v.Type
 10495  		x := v_0
 10496  		y := v_1
 10497  		if !(!shiftIsBounded(v)) {
 10498  			break
 10499  		}
 10500  		v.reset(OpLOONG64MASKEQZ)
 10501  		v0 := b.NewValue0(v.Pos, OpLOONG64SRL, t)
 10502  		v1 := b.NewValue0(v.Pos, OpZeroExt32to64, typ.UInt64)
 10503  		v1.AddArg(y)
 10504  		v0.AddArg2(x, v1)
 10505  		v2 := b.NewValue0(v.Pos, OpLOONG64SGTU, typ.Bool)
 10506  		v3 := b.NewValue0(v.Pos, OpLOONG64MOVVconst, typ.UInt64)
 10507  		v3.AuxInt = int64ToAuxInt(32)
 10508  		v2.AddArg2(v3, v1)
 10509  		v.AddArg2(v0, v2)
 10510  		return true
 10511  	}
 10512  	return false
 10513  }
 10514  func rewriteValueLOONG64_OpRsh32Ux64(v *Value) bool {
 10515  	v_1 := v.Args[1]
 10516  	v_0 := v.Args[0]
 10517  	b := v.Block
 10518  	typ := &b.Func.Config.Types
 10519  	// match: (Rsh32Ux64 x y)
 10520  	// cond: shiftIsBounded(v)
 10521  	// result: (SRL x y)
 10522  	for {
 10523  		x := v_0
 10524  		y := v_1
 10525  		if !(shiftIsBounded(v)) {
 10526  			break
 10527  		}
 10528  		v.reset(OpLOONG64SRL)
 10529  		v.AddArg2(x, y)
 10530  		return true
 10531  	}
 10532  	// match: (Rsh32Ux64 <t> x y)
 10533  	// cond: !shiftIsBounded(v)
 10534  	// result: (MASKEQZ (SRL <t> x y) (SGTU (MOVVconst <typ.UInt64> [32]) y))
 10535  	for {
 10536  		t := v.Type
 10537  		x := v_0
 10538  		y := v_1
 10539  		if !(!shiftIsBounded(v)) {
 10540  			break
 10541  		}
 10542  		v.reset(OpLOONG64MASKEQZ)
 10543  		v0 := b.NewValue0(v.Pos, OpLOONG64SRL, t)
 10544  		v0.AddArg2(x, y)
 10545  		v1 := b.NewValue0(v.Pos, OpLOONG64SGTU, typ.Bool)
 10546  		v2 := b.NewValue0(v.Pos, OpLOONG64MOVVconst, typ.UInt64)
 10547  		v2.AuxInt = int64ToAuxInt(32)
 10548  		v1.AddArg2(v2, y)
 10549  		v.AddArg2(v0, v1)
 10550  		return true
 10551  	}
 10552  	return false
 10553  }
 10554  func rewriteValueLOONG64_OpRsh32Ux8(v *Value) bool {
 10555  	v_1 := v.Args[1]
 10556  	v_0 := v.Args[0]
 10557  	b := v.Block
 10558  	typ := &b.Func.Config.Types
 10559  	// match: (Rsh32Ux8 x y)
 10560  	// cond: shiftIsBounded(v)
 10561  	// result: (SRL x y)
 10562  	for {
 10563  		x := v_0
 10564  		y := v_1
 10565  		if !(shiftIsBounded(v)) {
 10566  			break
 10567  		}
 10568  		v.reset(OpLOONG64SRL)
 10569  		v.AddArg2(x, y)
 10570  		return true
 10571  	}
 10572  	// match: (Rsh32Ux8 <t> x y)
 10573  	// cond: !shiftIsBounded(v)
 10574  	// result: (MASKEQZ (SRL <t> x (ZeroExt8to64 y)) (SGTU (MOVVconst <typ.UInt64> [32]) (ZeroExt8to64 y)))
 10575  	for {
 10576  		t := v.Type
 10577  		x := v_0
 10578  		y := v_1
 10579  		if !(!shiftIsBounded(v)) {
 10580  			break
 10581  		}
 10582  		v.reset(OpLOONG64MASKEQZ)
 10583  		v0 := b.NewValue0(v.Pos, OpLOONG64SRL, t)
 10584  		v1 := b.NewValue0(v.Pos, OpZeroExt8to64, typ.UInt64)
 10585  		v1.AddArg(y)
 10586  		v0.AddArg2(x, v1)
 10587  		v2 := b.NewValue0(v.Pos, OpLOONG64SGTU, typ.Bool)
 10588  		v3 := b.NewValue0(v.Pos, OpLOONG64MOVVconst, typ.UInt64)
 10589  		v3.AuxInt = int64ToAuxInt(32)
 10590  		v2.AddArg2(v3, v1)
 10591  		v.AddArg2(v0, v2)
 10592  		return true
 10593  	}
 10594  	return false
 10595  }
 10596  func rewriteValueLOONG64_OpRsh32x16(v *Value) bool {
 10597  	v_1 := v.Args[1]
 10598  	v_0 := v.Args[0]
 10599  	b := v.Block
 10600  	typ := &b.Func.Config.Types
 10601  	// match: (Rsh32x16 x y)
 10602  	// cond: shiftIsBounded(v)
 10603  	// result: (SRA x y)
 10604  	for {
 10605  		x := v_0
 10606  		y := v_1
 10607  		if !(shiftIsBounded(v)) {
 10608  			break
 10609  		}
 10610  		v.reset(OpLOONG64SRA)
 10611  		v.AddArg2(x, y)
 10612  		return true
 10613  	}
 10614  	// match: (Rsh32x16 <t> x y)
 10615  	// cond: !shiftIsBounded(v)
 10616  	// result: (SRA x (OR <t> (NEGV <t> (SGTU (ZeroExt16to64 y) (MOVVconst <typ.UInt64> [31]))) (ZeroExt16to64 y)))
 10617  	for {
 10618  		t := v.Type
 10619  		x := v_0
 10620  		y := v_1
 10621  		if !(!shiftIsBounded(v)) {
 10622  			break
 10623  		}
 10624  		v.reset(OpLOONG64SRA)
 10625  		v0 := b.NewValue0(v.Pos, OpLOONG64OR, t)
 10626  		v1 := b.NewValue0(v.Pos, OpLOONG64NEGV, t)
 10627  		v2 := b.NewValue0(v.Pos, OpLOONG64SGTU, typ.Bool)
 10628  		v3 := b.NewValue0(v.Pos, OpZeroExt16to64, typ.UInt64)
 10629  		v3.AddArg(y)
 10630  		v4 := b.NewValue0(v.Pos, OpLOONG64MOVVconst, typ.UInt64)
 10631  		v4.AuxInt = int64ToAuxInt(31)
 10632  		v2.AddArg2(v3, v4)
 10633  		v1.AddArg(v2)
 10634  		v0.AddArg2(v1, v3)
 10635  		v.AddArg2(x, v0)
 10636  		return true
 10637  	}
 10638  	return false
 10639  }
 10640  func rewriteValueLOONG64_OpRsh32x32(v *Value) bool {
 10641  	v_1 := v.Args[1]
 10642  	v_0 := v.Args[0]
 10643  	b := v.Block
 10644  	typ := &b.Func.Config.Types
 10645  	// match: (Rsh32x32 x y)
 10646  	// cond: shiftIsBounded(v)
 10647  	// result: (SRA x y)
 10648  	for {
 10649  		x := v_0
 10650  		y := v_1
 10651  		if !(shiftIsBounded(v)) {
 10652  			break
 10653  		}
 10654  		v.reset(OpLOONG64SRA)
 10655  		v.AddArg2(x, y)
 10656  		return true
 10657  	}
 10658  	// match: (Rsh32x32 <t> x y)
 10659  	// cond: !shiftIsBounded(v)
 10660  	// result: (SRA x (OR <t> (NEGV <t> (SGTU (ZeroExt32to64 y) (MOVVconst <typ.UInt64> [31]))) (ZeroExt32to64 y)))
 10661  	for {
 10662  		t := v.Type
 10663  		x := v_0
 10664  		y := v_1
 10665  		if !(!shiftIsBounded(v)) {
 10666  			break
 10667  		}
 10668  		v.reset(OpLOONG64SRA)
 10669  		v0 := b.NewValue0(v.Pos, OpLOONG64OR, t)
 10670  		v1 := b.NewValue0(v.Pos, OpLOONG64NEGV, t)
 10671  		v2 := b.NewValue0(v.Pos, OpLOONG64SGTU, typ.Bool)
 10672  		v3 := b.NewValue0(v.Pos, OpZeroExt32to64, typ.UInt64)
 10673  		v3.AddArg(y)
 10674  		v4 := b.NewValue0(v.Pos, OpLOONG64MOVVconst, typ.UInt64)
 10675  		v4.AuxInt = int64ToAuxInt(31)
 10676  		v2.AddArg2(v3, v4)
 10677  		v1.AddArg(v2)
 10678  		v0.AddArg2(v1, v3)
 10679  		v.AddArg2(x, v0)
 10680  		return true
 10681  	}
 10682  	return false
 10683  }
 10684  func rewriteValueLOONG64_OpRsh32x64(v *Value) bool {
 10685  	v_1 := v.Args[1]
 10686  	v_0 := v.Args[0]
 10687  	b := v.Block
 10688  	typ := &b.Func.Config.Types
 10689  	// match: (Rsh32x64 x y)
 10690  	// cond: shiftIsBounded(v)
 10691  	// result: (SRA x y)
 10692  	for {
 10693  		x := v_0
 10694  		y := v_1
 10695  		if !(shiftIsBounded(v)) {
 10696  			break
 10697  		}
 10698  		v.reset(OpLOONG64SRA)
 10699  		v.AddArg2(x, y)
 10700  		return true
 10701  	}
 10702  	// match: (Rsh32x64 <t> x y)
 10703  	// cond: !shiftIsBounded(v)
 10704  	// result: (SRA x (OR <t> (NEGV <t> (SGTU y (MOVVconst <typ.UInt64> [31]))) y))
 10705  	for {
 10706  		t := v.Type
 10707  		x := v_0
 10708  		y := v_1
 10709  		if !(!shiftIsBounded(v)) {
 10710  			break
 10711  		}
 10712  		v.reset(OpLOONG64SRA)
 10713  		v0 := b.NewValue0(v.Pos, OpLOONG64OR, t)
 10714  		v1 := b.NewValue0(v.Pos, OpLOONG64NEGV, t)
 10715  		v2 := b.NewValue0(v.Pos, OpLOONG64SGTU, typ.Bool)
 10716  		v3 := b.NewValue0(v.Pos, OpLOONG64MOVVconst, typ.UInt64)
 10717  		v3.AuxInt = int64ToAuxInt(31)
 10718  		v2.AddArg2(y, v3)
 10719  		v1.AddArg(v2)
 10720  		v0.AddArg2(v1, y)
 10721  		v.AddArg2(x, v0)
 10722  		return true
 10723  	}
 10724  	return false
 10725  }
 10726  func rewriteValueLOONG64_OpRsh32x8(v *Value) bool {
 10727  	v_1 := v.Args[1]
 10728  	v_0 := v.Args[0]
 10729  	b := v.Block
 10730  	typ := &b.Func.Config.Types
 10731  	// match: (Rsh32x8 x y)
 10732  	// cond: shiftIsBounded(v)
 10733  	// result: (SRA x y)
 10734  	for {
 10735  		x := v_0
 10736  		y := v_1
 10737  		if !(shiftIsBounded(v)) {
 10738  			break
 10739  		}
 10740  		v.reset(OpLOONG64SRA)
 10741  		v.AddArg2(x, y)
 10742  		return true
 10743  	}
 10744  	// match: (Rsh32x8 <t> x y)
 10745  	// cond: !shiftIsBounded(v)
 10746  	// result: (SRA x (OR <t> (NEGV <t> (SGTU (ZeroExt8to64 y) (MOVVconst <typ.UInt64> [31]))) (ZeroExt8to64 y)))
 10747  	for {
 10748  		t := v.Type
 10749  		x := v_0
 10750  		y := v_1
 10751  		if !(!shiftIsBounded(v)) {
 10752  			break
 10753  		}
 10754  		v.reset(OpLOONG64SRA)
 10755  		v0 := b.NewValue0(v.Pos, OpLOONG64OR, t)
 10756  		v1 := b.NewValue0(v.Pos, OpLOONG64NEGV, t)
 10757  		v2 := b.NewValue0(v.Pos, OpLOONG64SGTU, typ.Bool)
 10758  		v3 := b.NewValue0(v.Pos, OpZeroExt8to64, typ.UInt64)
 10759  		v3.AddArg(y)
 10760  		v4 := b.NewValue0(v.Pos, OpLOONG64MOVVconst, typ.UInt64)
 10761  		v4.AuxInt = int64ToAuxInt(31)
 10762  		v2.AddArg2(v3, v4)
 10763  		v1.AddArg(v2)
 10764  		v0.AddArg2(v1, v3)
 10765  		v.AddArg2(x, v0)
 10766  		return true
 10767  	}
 10768  	return false
 10769  }
 10770  func rewriteValueLOONG64_OpRsh64Ux16(v *Value) bool {
 10771  	v_1 := v.Args[1]
 10772  	v_0 := v.Args[0]
 10773  	b := v.Block
 10774  	typ := &b.Func.Config.Types
 10775  	// match: (Rsh64Ux16 x y)
 10776  	// cond: shiftIsBounded(v)
 10777  	// result: (SRLV x y)
 10778  	for {
 10779  		x := v_0
 10780  		y := v_1
 10781  		if !(shiftIsBounded(v)) {
 10782  			break
 10783  		}
 10784  		v.reset(OpLOONG64SRLV)
 10785  		v.AddArg2(x, y)
 10786  		return true
 10787  	}
 10788  	// match: (Rsh64Ux16 <t> x y)
 10789  	// cond: !shiftIsBounded(v)
 10790  	// result: (MASKEQZ (SRLV <t> x (ZeroExt16to64 y)) (SGTU (MOVVconst <typ.UInt64> [64]) (ZeroExt16to64 y)))
 10791  	for {
 10792  		t := v.Type
 10793  		x := v_0
 10794  		y := v_1
 10795  		if !(!shiftIsBounded(v)) {
 10796  			break
 10797  		}
 10798  		v.reset(OpLOONG64MASKEQZ)
 10799  		v0 := b.NewValue0(v.Pos, OpLOONG64SRLV, t)
 10800  		v1 := b.NewValue0(v.Pos, OpZeroExt16to64, typ.UInt64)
 10801  		v1.AddArg(y)
 10802  		v0.AddArg2(x, v1)
 10803  		v2 := b.NewValue0(v.Pos, OpLOONG64SGTU, typ.Bool)
 10804  		v3 := b.NewValue0(v.Pos, OpLOONG64MOVVconst, typ.UInt64)
 10805  		v3.AuxInt = int64ToAuxInt(64)
 10806  		v2.AddArg2(v3, v1)
 10807  		v.AddArg2(v0, v2)
 10808  		return true
 10809  	}
 10810  	return false
 10811  }
 10812  func rewriteValueLOONG64_OpRsh64Ux32(v *Value) bool {
 10813  	v_1 := v.Args[1]
 10814  	v_0 := v.Args[0]
 10815  	b := v.Block
 10816  	typ := &b.Func.Config.Types
 10817  	// match: (Rsh64Ux32 x y)
 10818  	// cond: shiftIsBounded(v)
 10819  	// result: (SRLV x y)
 10820  	for {
 10821  		x := v_0
 10822  		y := v_1
 10823  		if !(shiftIsBounded(v)) {
 10824  			break
 10825  		}
 10826  		v.reset(OpLOONG64SRLV)
 10827  		v.AddArg2(x, y)
 10828  		return true
 10829  	}
 10830  	// match: (Rsh64Ux32 <t> x y)
 10831  	// cond: !shiftIsBounded(v)
 10832  	// result: (MASKEQZ (SRLV <t> x (ZeroExt32to64 y)) (SGTU (MOVVconst <typ.UInt64> [64]) (ZeroExt32to64 y)))
 10833  	for {
 10834  		t := v.Type
 10835  		x := v_0
 10836  		y := v_1
 10837  		if !(!shiftIsBounded(v)) {
 10838  			break
 10839  		}
 10840  		v.reset(OpLOONG64MASKEQZ)
 10841  		v0 := b.NewValue0(v.Pos, OpLOONG64SRLV, t)
 10842  		v1 := b.NewValue0(v.Pos, OpZeroExt32to64, typ.UInt64)
 10843  		v1.AddArg(y)
 10844  		v0.AddArg2(x, v1)
 10845  		v2 := b.NewValue0(v.Pos, OpLOONG64SGTU, typ.Bool)
 10846  		v3 := b.NewValue0(v.Pos, OpLOONG64MOVVconst, typ.UInt64)
 10847  		v3.AuxInt = int64ToAuxInt(64)
 10848  		v2.AddArg2(v3, v1)
 10849  		v.AddArg2(v0, v2)
 10850  		return true
 10851  	}
 10852  	return false
 10853  }
 10854  func rewriteValueLOONG64_OpRsh64Ux64(v *Value) bool {
 10855  	v_1 := v.Args[1]
 10856  	v_0 := v.Args[0]
 10857  	b := v.Block
 10858  	typ := &b.Func.Config.Types
 10859  	// match: (Rsh64Ux64 x y)
 10860  	// cond: shiftIsBounded(v)
 10861  	// result: (SRLV x y)
 10862  	for {
 10863  		x := v_0
 10864  		y := v_1
 10865  		if !(shiftIsBounded(v)) {
 10866  			break
 10867  		}
 10868  		v.reset(OpLOONG64SRLV)
 10869  		v.AddArg2(x, y)
 10870  		return true
 10871  	}
 10872  	// match: (Rsh64Ux64 <t> x y)
 10873  	// cond: !shiftIsBounded(v)
 10874  	// result: (MASKEQZ (SRLV <t> x y) (SGTU (MOVVconst <typ.UInt64> [64]) y))
 10875  	for {
 10876  		t := v.Type
 10877  		x := v_0
 10878  		y := v_1
 10879  		if !(!shiftIsBounded(v)) {
 10880  			break
 10881  		}
 10882  		v.reset(OpLOONG64MASKEQZ)
 10883  		v0 := b.NewValue0(v.Pos, OpLOONG64SRLV, t)
 10884  		v0.AddArg2(x, y)
 10885  		v1 := b.NewValue0(v.Pos, OpLOONG64SGTU, typ.Bool)
 10886  		v2 := b.NewValue0(v.Pos, OpLOONG64MOVVconst, typ.UInt64)
 10887  		v2.AuxInt = int64ToAuxInt(64)
 10888  		v1.AddArg2(v2, y)
 10889  		v.AddArg2(v0, v1)
 10890  		return true
 10891  	}
 10892  	return false
 10893  }
 10894  func rewriteValueLOONG64_OpRsh64Ux8(v *Value) bool {
 10895  	v_1 := v.Args[1]
 10896  	v_0 := v.Args[0]
 10897  	b := v.Block
 10898  	typ := &b.Func.Config.Types
 10899  	// match: (Rsh64Ux8 x y)
 10900  	// cond: shiftIsBounded(v)
 10901  	// result: (SRLV x y)
 10902  	for {
 10903  		x := v_0
 10904  		y := v_1
 10905  		if !(shiftIsBounded(v)) {
 10906  			break
 10907  		}
 10908  		v.reset(OpLOONG64SRLV)
 10909  		v.AddArg2(x, y)
 10910  		return true
 10911  	}
 10912  	// match: (Rsh64Ux8 <t> x y)
 10913  	// cond: !shiftIsBounded(v)
 10914  	// result: (MASKEQZ (SRLV <t> x (ZeroExt8to64 y)) (SGTU (MOVVconst <typ.UInt64> [64]) (ZeroExt8to64 y)))
 10915  	for {
 10916  		t := v.Type
 10917  		x := v_0
 10918  		y := v_1
 10919  		if !(!shiftIsBounded(v)) {
 10920  			break
 10921  		}
 10922  		v.reset(OpLOONG64MASKEQZ)
 10923  		v0 := b.NewValue0(v.Pos, OpLOONG64SRLV, t)
 10924  		v1 := b.NewValue0(v.Pos, OpZeroExt8to64, typ.UInt64)
 10925  		v1.AddArg(y)
 10926  		v0.AddArg2(x, v1)
 10927  		v2 := b.NewValue0(v.Pos, OpLOONG64SGTU, typ.Bool)
 10928  		v3 := b.NewValue0(v.Pos, OpLOONG64MOVVconst, typ.UInt64)
 10929  		v3.AuxInt = int64ToAuxInt(64)
 10930  		v2.AddArg2(v3, v1)
 10931  		v.AddArg2(v0, v2)
 10932  		return true
 10933  	}
 10934  	return false
 10935  }
 10936  func rewriteValueLOONG64_OpRsh64x16(v *Value) bool {
 10937  	v_1 := v.Args[1]
 10938  	v_0 := v.Args[0]
 10939  	b := v.Block
 10940  	typ := &b.Func.Config.Types
 10941  	// match: (Rsh64x16 x y)
 10942  	// cond: shiftIsBounded(v)
 10943  	// result: (SRAV x y)
 10944  	for {
 10945  		x := v_0
 10946  		y := v_1
 10947  		if !(shiftIsBounded(v)) {
 10948  			break
 10949  		}
 10950  		v.reset(OpLOONG64SRAV)
 10951  		v.AddArg2(x, y)
 10952  		return true
 10953  	}
 10954  	// match: (Rsh64x16 <t> x y)
 10955  	// cond: !shiftIsBounded(v)
 10956  	// result: (SRAV x (OR <t> (NEGV <t> (SGTU (ZeroExt16to64 y) (MOVVconst <typ.UInt64> [63]))) (ZeroExt16to64 y)))
 10957  	for {
 10958  		t := v.Type
 10959  		x := v_0
 10960  		y := v_1
 10961  		if !(!shiftIsBounded(v)) {
 10962  			break
 10963  		}
 10964  		v.reset(OpLOONG64SRAV)
 10965  		v0 := b.NewValue0(v.Pos, OpLOONG64OR, t)
 10966  		v1 := b.NewValue0(v.Pos, OpLOONG64NEGV, t)
 10967  		v2 := b.NewValue0(v.Pos, OpLOONG64SGTU, typ.Bool)
 10968  		v3 := b.NewValue0(v.Pos, OpZeroExt16to64, typ.UInt64)
 10969  		v3.AddArg(y)
 10970  		v4 := b.NewValue0(v.Pos, OpLOONG64MOVVconst, typ.UInt64)
 10971  		v4.AuxInt = int64ToAuxInt(63)
 10972  		v2.AddArg2(v3, v4)
 10973  		v1.AddArg(v2)
 10974  		v0.AddArg2(v1, v3)
 10975  		v.AddArg2(x, v0)
 10976  		return true
 10977  	}
 10978  	return false
 10979  }
 10980  func rewriteValueLOONG64_OpRsh64x32(v *Value) bool {
 10981  	v_1 := v.Args[1]
 10982  	v_0 := v.Args[0]
 10983  	b := v.Block
 10984  	typ := &b.Func.Config.Types
 10985  	// match: (Rsh64x32 x y)
 10986  	// cond: shiftIsBounded(v)
 10987  	// result: (SRAV x y)
 10988  	for {
 10989  		x := v_0
 10990  		y := v_1
 10991  		if !(shiftIsBounded(v)) {
 10992  			break
 10993  		}
 10994  		v.reset(OpLOONG64SRAV)
 10995  		v.AddArg2(x, y)
 10996  		return true
 10997  	}
 10998  	// match: (Rsh64x32 <t> x y)
 10999  	// cond: !shiftIsBounded(v)
 11000  	// result: (SRAV x (OR <t> (NEGV <t> (SGTU (ZeroExt32to64 y) (MOVVconst <typ.UInt64> [63]))) (ZeroExt32to64 y)))
 11001  	for {
 11002  		t := v.Type
 11003  		x := v_0
 11004  		y := v_1
 11005  		if !(!shiftIsBounded(v)) {
 11006  			break
 11007  		}
 11008  		v.reset(OpLOONG64SRAV)
 11009  		v0 := b.NewValue0(v.Pos, OpLOONG64OR, t)
 11010  		v1 := b.NewValue0(v.Pos, OpLOONG64NEGV, t)
 11011  		v2 := b.NewValue0(v.Pos, OpLOONG64SGTU, typ.Bool)
 11012  		v3 := b.NewValue0(v.Pos, OpZeroExt32to64, typ.UInt64)
 11013  		v3.AddArg(y)
 11014  		v4 := b.NewValue0(v.Pos, OpLOONG64MOVVconst, typ.UInt64)
 11015  		v4.AuxInt = int64ToAuxInt(63)
 11016  		v2.AddArg2(v3, v4)
 11017  		v1.AddArg(v2)
 11018  		v0.AddArg2(v1, v3)
 11019  		v.AddArg2(x, v0)
 11020  		return true
 11021  	}
 11022  	return false
 11023  }
 11024  func rewriteValueLOONG64_OpRsh64x64(v *Value) bool {
 11025  	v_1 := v.Args[1]
 11026  	v_0 := v.Args[0]
 11027  	b := v.Block
 11028  	typ := &b.Func.Config.Types
 11029  	// match: (Rsh64x64 x y)
 11030  	// cond: shiftIsBounded(v)
 11031  	// result: (SRAV x y)
 11032  	for {
 11033  		x := v_0
 11034  		y := v_1
 11035  		if !(shiftIsBounded(v)) {
 11036  			break
 11037  		}
 11038  		v.reset(OpLOONG64SRAV)
 11039  		v.AddArg2(x, y)
 11040  		return true
 11041  	}
 11042  	// match: (Rsh64x64 <t> x y)
 11043  	// cond: !shiftIsBounded(v)
 11044  	// result: (SRAV x (OR <t> (NEGV <t> (SGTU y (MOVVconst <typ.UInt64> [63]))) y))
 11045  	for {
 11046  		t := v.Type
 11047  		x := v_0
 11048  		y := v_1
 11049  		if !(!shiftIsBounded(v)) {
 11050  			break
 11051  		}
 11052  		v.reset(OpLOONG64SRAV)
 11053  		v0 := b.NewValue0(v.Pos, OpLOONG64OR, t)
 11054  		v1 := b.NewValue0(v.Pos, OpLOONG64NEGV, t)
 11055  		v2 := b.NewValue0(v.Pos, OpLOONG64SGTU, typ.Bool)
 11056  		v3 := b.NewValue0(v.Pos, OpLOONG64MOVVconst, typ.UInt64)
 11057  		v3.AuxInt = int64ToAuxInt(63)
 11058  		v2.AddArg2(y, v3)
 11059  		v1.AddArg(v2)
 11060  		v0.AddArg2(v1, y)
 11061  		v.AddArg2(x, v0)
 11062  		return true
 11063  	}
 11064  	return false
 11065  }
 11066  func rewriteValueLOONG64_OpRsh64x8(v *Value) bool {
 11067  	v_1 := v.Args[1]
 11068  	v_0 := v.Args[0]
 11069  	b := v.Block
 11070  	typ := &b.Func.Config.Types
 11071  	// match: (Rsh64x8 x y)
 11072  	// cond: shiftIsBounded(v)
 11073  	// result: (SRAV x y)
 11074  	for {
 11075  		x := v_0
 11076  		y := v_1
 11077  		if !(shiftIsBounded(v)) {
 11078  			break
 11079  		}
 11080  		v.reset(OpLOONG64SRAV)
 11081  		v.AddArg2(x, y)
 11082  		return true
 11083  	}
 11084  	// match: (Rsh64x8 <t> x y)
 11085  	// cond: !shiftIsBounded(v)
 11086  	// result: (SRAV x (OR <t> (NEGV <t> (SGTU (ZeroExt8to64 y) (MOVVconst <typ.UInt64> [63]))) (ZeroExt8to64 y)))
 11087  	for {
 11088  		t := v.Type
 11089  		x := v_0
 11090  		y := v_1
 11091  		if !(!shiftIsBounded(v)) {
 11092  			break
 11093  		}
 11094  		v.reset(OpLOONG64SRAV)
 11095  		v0 := b.NewValue0(v.Pos, OpLOONG64OR, t)
 11096  		v1 := b.NewValue0(v.Pos, OpLOONG64NEGV, t)
 11097  		v2 := b.NewValue0(v.Pos, OpLOONG64SGTU, typ.Bool)
 11098  		v3 := b.NewValue0(v.Pos, OpZeroExt8to64, typ.UInt64)
 11099  		v3.AddArg(y)
 11100  		v4 := b.NewValue0(v.Pos, OpLOONG64MOVVconst, typ.UInt64)
 11101  		v4.AuxInt = int64ToAuxInt(63)
 11102  		v2.AddArg2(v3, v4)
 11103  		v1.AddArg(v2)
 11104  		v0.AddArg2(v1, v3)
 11105  		v.AddArg2(x, v0)
 11106  		return true
 11107  	}
 11108  	return false
 11109  }
 11110  func rewriteValueLOONG64_OpRsh8Ux16(v *Value) bool {
 11111  	v_1 := v.Args[1]
 11112  	v_0 := v.Args[0]
 11113  	b := v.Block
 11114  	typ := &b.Func.Config.Types
 11115  	// match: (Rsh8Ux16 x y)
 11116  	// cond: shiftIsBounded(v)
 11117  	// result: (SRLV (ZeroExt8to64 x) y)
 11118  	for {
 11119  		x := v_0
 11120  		y := v_1
 11121  		if !(shiftIsBounded(v)) {
 11122  			break
 11123  		}
 11124  		v.reset(OpLOONG64SRLV)
 11125  		v0 := b.NewValue0(v.Pos, OpZeroExt8to64, typ.UInt64)
 11126  		v0.AddArg(x)
 11127  		v.AddArg2(v0, y)
 11128  		return true
 11129  	}
 11130  	// match: (Rsh8Ux16 <t> x y)
 11131  	// cond: !shiftIsBounded(v)
 11132  	// result: (MASKEQZ (SRLV <t> (ZeroExt8to64 x) (ZeroExt16to64 y)) (SGTU (MOVVconst <typ.UInt64> [64]) (ZeroExt16to64 y)))
 11133  	for {
 11134  		t := v.Type
 11135  		x := v_0
 11136  		y := v_1
 11137  		if !(!shiftIsBounded(v)) {
 11138  			break
 11139  		}
 11140  		v.reset(OpLOONG64MASKEQZ)
 11141  		v0 := b.NewValue0(v.Pos, OpLOONG64SRLV, t)
 11142  		v1 := b.NewValue0(v.Pos, OpZeroExt8to64, typ.UInt64)
 11143  		v1.AddArg(x)
 11144  		v2 := b.NewValue0(v.Pos, OpZeroExt16to64, typ.UInt64)
 11145  		v2.AddArg(y)
 11146  		v0.AddArg2(v1, v2)
 11147  		v3 := b.NewValue0(v.Pos, OpLOONG64SGTU, typ.Bool)
 11148  		v4 := b.NewValue0(v.Pos, OpLOONG64MOVVconst, typ.UInt64)
 11149  		v4.AuxInt = int64ToAuxInt(64)
 11150  		v3.AddArg2(v4, v2)
 11151  		v.AddArg2(v0, v3)
 11152  		return true
 11153  	}
 11154  	return false
 11155  }
 11156  func rewriteValueLOONG64_OpRsh8Ux32(v *Value) bool {
 11157  	v_1 := v.Args[1]
 11158  	v_0 := v.Args[0]
 11159  	b := v.Block
 11160  	typ := &b.Func.Config.Types
 11161  	// match: (Rsh8Ux32 x y)
 11162  	// cond: shiftIsBounded(v)
 11163  	// result: (SRLV (ZeroExt8to64 x) y)
 11164  	for {
 11165  		x := v_0
 11166  		y := v_1
 11167  		if !(shiftIsBounded(v)) {
 11168  			break
 11169  		}
 11170  		v.reset(OpLOONG64SRLV)
 11171  		v0 := b.NewValue0(v.Pos, OpZeroExt8to64, typ.UInt64)
 11172  		v0.AddArg(x)
 11173  		v.AddArg2(v0, y)
 11174  		return true
 11175  	}
 11176  	// match: (Rsh8Ux32 <t> x y)
 11177  	// cond: !shiftIsBounded(v)
 11178  	// result: (MASKEQZ (SRLV <t> (ZeroExt8to64 x) (ZeroExt32to64 y)) (SGTU (MOVVconst <typ.UInt64> [64]) (ZeroExt32to64 y)))
 11179  	for {
 11180  		t := v.Type
 11181  		x := v_0
 11182  		y := v_1
 11183  		if !(!shiftIsBounded(v)) {
 11184  			break
 11185  		}
 11186  		v.reset(OpLOONG64MASKEQZ)
 11187  		v0 := b.NewValue0(v.Pos, OpLOONG64SRLV, t)
 11188  		v1 := b.NewValue0(v.Pos, OpZeroExt8to64, typ.UInt64)
 11189  		v1.AddArg(x)
 11190  		v2 := b.NewValue0(v.Pos, OpZeroExt32to64, typ.UInt64)
 11191  		v2.AddArg(y)
 11192  		v0.AddArg2(v1, v2)
 11193  		v3 := b.NewValue0(v.Pos, OpLOONG64SGTU, typ.Bool)
 11194  		v4 := b.NewValue0(v.Pos, OpLOONG64MOVVconst, typ.UInt64)
 11195  		v4.AuxInt = int64ToAuxInt(64)
 11196  		v3.AddArg2(v4, v2)
 11197  		v.AddArg2(v0, v3)
 11198  		return true
 11199  	}
 11200  	return false
 11201  }
 11202  func rewriteValueLOONG64_OpRsh8Ux64(v *Value) bool {
 11203  	v_1 := v.Args[1]
 11204  	v_0 := v.Args[0]
 11205  	b := v.Block
 11206  	typ := &b.Func.Config.Types
 11207  	// match: (Rsh8Ux64 x y)
 11208  	// cond: shiftIsBounded(v)
 11209  	// result: (SRLV (ZeroExt8to64 x) y)
 11210  	for {
 11211  		x := v_0
 11212  		y := v_1
 11213  		if !(shiftIsBounded(v)) {
 11214  			break
 11215  		}
 11216  		v.reset(OpLOONG64SRLV)
 11217  		v0 := b.NewValue0(v.Pos, OpZeroExt8to64, typ.UInt64)
 11218  		v0.AddArg(x)
 11219  		v.AddArg2(v0, y)
 11220  		return true
 11221  	}
 11222  	// match: (Rsh8Ux64 <t> x y)
 11223  	// cond: !shiftIsBounded(v)
 11224  	// result: (MASKEQZ (SRLV <t> (ZeroExt8to64 x) y) (SGTU (MOVVconst <typ.UInt64> [64]) y))
 11225  	for {
 11226  		t := v.Type
 11227  		x := v_0
 11228  		y := v_1
 11229  		if !(!shiftIsBounded(v)) {
 11230  			break
 11231  		}
 11232  		v.reset(OpLOONG64MASKEQZ)
 11233  		v0 := b.NewValue0(v.Pos, OpLOONG64SRLV, t)
 11234  		v1 := b.NewValue0(v.Pos, OpZeroExt8to64, typ.UInt64)
 11235  		v1.AddArg(x)
 11236  		v0.AddArg2(v1, y)
 11237  		v2 := b.NewValue0(v.Pos, OpLOONG64SGTU, typ.Bool)
 11238  		v3 := b.NewValue0(v.Pos, OpLOONG64MOVVconst, typ.UInt64)
 11239  		v3.AuxInt = int64ToAuxInt(64)
 11240  		v2.AddArg2(v3, y)
 11241  		v.AddArg2(v0, v2)
 11242  		return true
 11243  	}
 11244  	return false
 11245  }
 11246  func rewriteValueLOONG64_OpRsh8Ux8(v *Value) bool {
 11247  	v_1 := v.Args[1]
 11248  	v_0 := v.Args[0]
 11249  	b := v.Block
 11250  	typ := &b.Func.Config.Types
 11251  	// match: (Rsh8Ux8 x y)
 11252  	// cond: shiftIsBounded(v)
 11253  	// result: (SRLV (ZeroExt8to64 x) y)
 11254  	for {
 11255  		x := v_0
 11256  		y := v_1
 11257  		if !(shiftIsBounded(v)) {
 11258  			break
 11259  		}
 11260  		v.reset(OpLOONG64SRLV)
 11261  		v0 := b.NewValue0(v.Pos, OpZeroExt8to64, typ.UInt64)
 11262  		v0.AddArg(x)
 11263  		v.AddArg2(v0, y)
 11264  		return true
 11265  	}
 11266  	// match: (Rsh8Ux8 <t> x y)
 11267  	// cond: !shiftIsBounded(v)
 11268  	// result: (MASKEQZ (SRLV <t> (ZeroExt8to64 x) (ZeroExt8to64 y)) (SGTU (MOVVconst <typ.UInt64> [64]) (ZeroExt8to64 y)))
 11269  	for {
 11270  		t := v.Type
 11271  		x := v_0
 11272  		y := v_1
 11273  		if !(!shiftIsBounded(v)) {
 11274  			break
 11275  		}
 11276  		v.reset(OpLOONG64MASKEQZ)
 11277  		v0 := b.NewValue0(v.Pos, OpLOONG64SRLV, t)
 11278  		v1 := b.NewValue0(v.Pos, OpZeroExt8to64, typ.UInt64)
 11279  		v1.AddArg(x)
 11280  		v2 := b.NewValue0(v.Pos, OpZeroExt8to64, typ.UInt64)
 11281  		v2.AddArg(y)
 11282  		v0.AddArg2(v1, v2)
 11283  		v3 := b.NewValue0(v.Pos, OpLOONG64SGTU, typ.Bool)
 11284  		v4 := b.NewValue0(v.Pos, OpLOONG64MOVVconst, typ.UInt64)
 11285  		v4.AuxInt = int64ToAuxInt(64)
 11286  		v3.AddArg2(v4, v2)
 11287  		v.AddArg2(v0, v3)
 11288  		return true
 11289  	}
 11290  	return false
 11291  }
 11292  func rewriteValueLOONG64_OpRsh8x16(v *Value) bool {
 11293  	v_1 := v.Args[1]
 11294  	v_0 := v.Args[0]
 11295  	b := v.Block
 11296  	typ := &b.Func.Config.Types
 11297  	// match: (Rsh8x16 x y)
 11298  	// cond: shiftIsBounded(v)
 11299  	// result: (SRAV (SignExt8to64 x) y)
 11300  	for {
 11301  		x := v_0
 11302  		y := v_1
 11303  		if !(shiftIsBounded(v)) {
 11304  			break
 11305  		}
 11306  		v.reset(OpLOONG64SRAV)
 11307  		v0 := b.NewValue0(v.Pos, OpSignExt8to64, typ.Int64)
 11308  		v0.AddArg(x)
 11309  		v.AddArg2(v0, y)
 11310  		return true
 11311  	}
 11312  	// match: (Rsh8x16 <t> x y)
 11313  	// cond: !shiftIsBounded(v)
 11314  	// result: (SRAV (SignExt8to64 x) (OR <t> (NEGV <t> (SGTU (ZeroExt16to64 y) (MOVVconst <typ.UInt64> [63]))) (ZeroExt16to64 y)))
 11315  	for {
 11316  		t := v.Type
 11317  		x := v_0
 11318  		y := v_1
 11319  		if !(!shiftIsBounded(v)) {
 11320  			break
 11321  		}
 11322  		v.reset(OpLOONG64SRAV)
 11323  		v0 := b.NewValue0(v.Pos, OpSignExt8to64, typ.Int64)
 11324  		v0.AddArg(x)
 11325  		v1 := b.NewValue0(v.Pos, OpLOONG64OR, t)
 11326  		v2 := b.NewValue0(v.Pos, OpLOONG64NEGV, t)
 11327  		v3 := b.NewValue0(v.Pos, OpLOONG64SGTU, typ.Bool)
 11328  		v4 := b.NewValue0(v.Pos, OpZeroExt16to64, typ.UInt64)
 11329  		v4.AddArg(y)
 11330  		v5 := b.NewValue0(v.Pos, OpLOONG64MOVVconst, typ.UInt64)
 11331  		v5.AuxInt = int64ToAuxInt(63)
 11332  		v3.AddArg2(v4, v5)
 11333  		v2.AddArg(v3)
 11334  		v1.AddArg2(v2, v4)
 11335  		v.AddArg2(v0, v1)
 11336  		return true
 11337  	}
 11338  	return false
 11339  }
 11340  func rewriteValueLOONG64_OpRsh8x32(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: (Rsh8x32 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: (Rsh8x32 <t> x y)
 11361  	// cond: !shiftIsBounded(v)
 11362  	// result: (SRAV (SignExt8to64 x) (OR <t> (NEGV <t> (SGTU (ZeroExt32to64 y) (MOVVconst <typ.UInt64> [63]))) (ZeroExt32to64 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, OpZeroExt32to64, 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_OpRsh8x64(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: (Rsh8x64 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: (Rsh8x64 <t> x y)
 11409  	// cond: !shiftIsBounded(v)
 11410  	// result: (SRAV (SignExt8to64 x) (OR <t> (NEGV <t> (SGTU y (MOVVconst <typ.UInt64> [63]))) 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, OpLOONG64MOVVconst, typ.UInt64)
 11425  		v4.AuxInt = int64ToAuxInt(63)
 11426  		v3.AddArg2(y, v4)
 11427  		v2.AddArg(v3)
 11428  		v1.AddArg2(v2, y)
 11429  		v.AddArg2(v0, v1)
 11430  		return true
 11431  	}
 11432  	return false
 11433  }
 11434  func rewriteValueLOONG64_OpRsh8x8(v *Value) bool {
 11435  	v_1 := v.Args[1]
 11436  	v_0 := v.Args[0]
 11437  	b := v.Block
 11438  	typ := &b.Func.Config.Types
 11439  	// match: (Rsh8x8 x y)
 11440  	// cond: shiftIsBounded(v)
 11441  	// result: (SRAV (SignExt8to64 x) y)
 11442  	for {
 11443  		x := v_0
 11444  		y := v_1
 11445  		if !(shiftIsBounded(v)) {
 11446  			break
 11447  		}
 11448  		v.reset(OpLOONG64SRAV)
 11449  		v0 := b.NewValue0(v.Pos, OpSignExt8to64, typ.Int64)
 11450  		v0.AddArg(x)
 11451  		v.AddArg2(v0, y)
 11452  		return true
 11453  	}
 11454  	// match: (Rsh8x8 <t> x y)
 11455  	// cond: !shiftIsBounded(v)
 11456  	// result: (SRAV (SignExt8to64 x) (OR <t> (NEGV <t> (SGTU (ZeroExt8to64 y) (MOVVconst <typ.UInt64> [63]))) (ZeroExt8to64 y)))
 11457  	for {
 11458  		t := v.Type
 11459  		x := v_0
 11460  		y := v_1
 11461  		if !(!shiftIsBounded(v)) {
 11462  			break
 11463  		}
 11464  		v.reset(OpLOONG64SRAV)
 11465  		v0 := b.NewValue0(v.Pos, OpSignExt8to64, typ.Int64)
 11466  		v0.AddArg(x)
 11467  		v1 := b.NewValue0(v.Pos, OpLOONG64OR, t)
 11468  		v2 := b.NewValue0(v.Pos, OpLOONG64NEGV, t)
 11469  		v3 := b.NewValue0(v.Pos, OpLOONG64SGTU, typ.Bool)
 11470  		v4 := b.NewValue0(v.Pos, OpZeroExt8to64, typ.UInt64)
 11471  		v4.AddArg(y)
 11472  		v5 := b.NewValue0(v.Pos, OpLOONG64MOVVconst, typ.UInt64)
 11473  		v5.AuxInt = int64ToAuxInt(63)
 11474  		v3.AddArg2(v4, v5)
 11475  		v2.AddArg(v3)
 11476  		v1.AddArg2(v2, v4)
 11477  		v.AddArg2(v0, v1)
 11478  		return true
 11479  	}
 11480  	return false
 11481  }
 11482  func rewriteValueLOONG64_OpSelect0(v *Value) bool {
 11483  	v_0 := v.Args[0]
 11484  	b := v.Block
 11485  	// match: (Select0 (Mul64uhilo x y))
 11486  	// result: (MULHVU x y)
 11487  	for {
 11488  		if v_0.Op != OpMul64uhilo {
 11489  			break
 11490  		}
 11491  		y := v_0.Args[1]
 11492  		x := v_0.Args[0]
 11493  		v.reset(OpLOONG64MULHVU)
 11494  		v.AddArg2(x, y)
 11495  		return true
 11496  	}
 11497  	// match: (Select0 (Mul64uover x y))
 11498  	// result: (MULV x y)
 11499  	for {
 11500  		if v_0.Op != OpMul64uover {
 11501  			break
 11502  		}
 11503  		y := v_0.Args[1]
 11504  		x := v_0.Args[0]
 11505  		v.reset(OpLOONG64MULV)
 11506  		v.AddArg2(x, y)
 11507  		return true
 11508  	}
 11509  	// match: (Select0 <t> (Add64carry x y c))
 11510  	// result: (ADDV (ADDV <t> x y) c)
 11511  	for {
 11512  		t := v.Type
 11513  		if v_0.Op != OpAdd64carry {
 11514  			break
 11515  		}
 11516  		c := v_0.Args[2]
 11517  		x := v_0.Args[0]
 11518  		y := v_0.Args[1]
 11519  		v.reset(OpLOONG64ADDV)
 11520  		v0 := b.NewValue0(v.Pos, OpLOONG64ADDV, t)
 11521  		v0.AddArg2(x, y)
 11522  		v.AddArg2(v0, c)
 11523  		return true
 11524  	}
 11525  	// match: (Select0 <t> (Sub64borrow x y c))
 11526  	// result: (SUBV (SUBV <t> x y) c)
 11527  	for {
 11528  		t := v.Type
 11529  		if v_0.Op != OpSub64borrow {
 11530  			break
 11531  		}
 11532  		c := v_0.Args[2]
 11533  		x := v_0.Args[0]
 11534  		y := v_0.Args[1]
 11535  		v.reset(OpLOONG64SUBV)
 11536  		v0 := b.NewValue0(v.Pos, OpLOONG64SUBV, t)
 11537  		v0.AddArg2(x, y)
 11538  		v.AddArg2(v0, c)
 11539  		return true
 11540  	}
 11541  	return false
 11542  }
 11543  func rewriteValueLOONG64_OpSelect1(v *Value) bool {
 11544  	v_0 := v.Args[0]
 11545  	b := v.Block
 11546  	typ := &b.Func.Config.Types
 11547  	// match: (Select1 (Mul64uhilo x y))
 11548  	// result: (MULV x y)
 11549  	for {
 11550  		if v_0.Op != OpMul64uhilo {
 11551  			break
 11552  		}
 11553  		y := v_0.Args[1]
 11554  		x := v_0.Args[0]
 11555  		v.reset(OpLOONG64MULV)
 11556  		v.AddArg2(x, y)
 11557  		return true
 11558  	}
 11559  	// match: (Select1 (Mul64uover x y))
 11560  	// result: (SGTU <typ.Bool> (MULHVU x y) (MOVVconst <typ.UInt64> [0]))
 11561  	for {
 11562  		if v_0.Op != OpMul64uover {
 11563  			break
 11564  		}
 11565  		y := v_0.Args[1]
 11566  		x := v_0.Args[0]
 11567  		v.reset(OpLOONG64SGTU)
 11568  		v.Type = typ.Bool
 11569  		v0 := b.NewValue0(v.Pos, OpLOONG64MULHVU, typ.UInt64)
 11570  		v0.AddArg2(x, y)
 11571  		v1 := b.NewValue0(v.Pos, OpLOONG64MOVVconst, typ.UInt64)
 11572  		v1.AuxInt = int64ToAuxInt(0)
 11573  		v.AddArg2(v0, v1)
 11574  		return true
 11575  	}
 11576  	// match: (Select1 <t> (Add64carry x y c))
 11577  	// result: (OR (SGTU <t> x s:(ADDV <t> x y)) (SGTU <t> s (ADDV <t> s c)))
 11578  	for {
 11579  		t := v.Type
 11580  		if v_0.Op != OpAdd64carry {
 11581  			break
 11582  		}
 11583  		c := v_0.Args[2]
 11584  		x := v_0.Args[0]
 11585  		y := v_0.Args[1]
 11586  		v.reset(OpLOONG64OR)
 11587  		v0 := b.NewValue0(v.Pos, OpLOONG64SGTU, t)
 11588  		s := b.NewValue0(v.Pos, OpLOONG64ADDV, t)
 11589  		s.AddArg2(x, y)
 11590  		v0.AddArg2(x, s)
 11591  		v2 := b.NewValue0(v.Pos, OpLOONG64SGTU, t)
 11592  		v3 := b.NewValue0(v.Pos, OpLOONG64ADDV, t)
 11593  		v3.AddArg2(s, c)
 11594  		v2.AddArg2(s, v3)
 11595  		v.AddArg2(v0, v2)
 11596  		return true
 11597  	}
 11598  	// match: (Select1 <t> (Sub64borrow x y c))
 11599  	// result: (OR (SGTU <t> s:(SUBV <t> x y) x) (SGTU <t> (SUBV <t> s c) s))
 11600  	for {
 11601  		t := v.Type
 11602  		if v_0.Op != OpSub64borrow {
 11603  			break
 11604  		}
 11605  		c := v_0.Args[2]
 11606  		x := v_0.Args[0]
 11607  		y := v_0.Args[1]
 11608  		v.reset(OpLOONG64OR)
 11609  		v0 := b.NewValue0(v.Pos, OpLOONG64SGTU, t)
 11610  		s := b.NewValue0(v.Pos, OpLOONG64SUBV, t)
 11611  		s.AddArg2(x, y)
 11612  		v0.AddArg2(s, x)
 11613  		v2 := b.NewValue0(v.Pos, OpLOONG64SGTU, t)
 11614  		v3 := b.NewValue0(v.Pos, OpLOONG64SUBV, t)
 11615  		v3.AddArg2(s, c)
 11616  		v2.AddArg2(v3, s)
 11617  		v.AddArg2(v0, v2)
 11618  		return true
 11619  	}
 11620  	return false
 11621  }
 11622  func rewriteValueLOONG64_OpSelectN(v *Value) bool {
 11623  	v_0 := v.Args[0]
 11624  	b := v.Block
 11625  	config := b.Func.Config
 11626  	// match: (SelectN [0] call:(CALLstatic {sym} dst src (MOVVconst [sz]) mem))
 11627  	// cond: sz >= 0 && isSameCall(sym, "runtime.memmove") && call.Uses == 1 && isInlinableMemmove(dst, src, sz, config) && clobber(call)
 11628  	// result: (Move [sz] dst src mem)
 11629  	for {
 11630  		if auxIntToInt64(v.AuxInt) != 0 {
 11631  			break
 11632  		}
 11633  		call := v_0
 11634  		if call.Op != OpLOONG64CALLstatic || len(call.Args) != 4 {
 11635  			break
 11636  		}
 11637  		sym := auxToCall(call.Aux)
 11638  		mem := call.Args[3]
 11639  		dst := call.Args[0]
 11640  		src := call.Args[1]
 11641  		call_2 := call.Args[2]
 11642  		if call_2.Op != OpLOONG64MOVVconst {
 11643  			break
 11644  		}
 11645  		sz := auxIntToInt64(call_2.AuxInt)
 11646  		if !(sz >= 0 && isSameCall(sym, "runtime.memmove") && call.Uses == 1 && isInlinableMemmove(dst, src, sz, config) && clobber(call)) {
 11647  			break
 11648  		}
 11649  		v.reset(OpMove)
 11650  		v.AuxInt = int64ToAuxInt(sz)
 11651  		v.AddArg3(dst, src, mem)
 11652  		return true
 11653  	}
 11654  	return false
 11655  }
 11656  func rewriteValueLOONG64_OpSlicemask(v *Value) bool {
 11657  	v_0 := v.Args[0]
 11658  	b := v.Block
 11659  	// match: (Slicemask <t> x)
 11660  	// result: (SRAVconst (NEGV <t> x) [63])
 11661  	for {
 11662  		t := v.Type
 11663  		x := v_0
 11664  		v.reset(OpLOONG64SRAVconst)
 11665  		v.AuxInt = int64ToAuxInt(63)
 11666  		v0 := b.NewValue0(v.Pos, OpLOONG64NEGV, t)
 11667  		v0.AddArg(x)
 11668  		v.AddArg(v0)
 11669  		return true
 11670  	}
 11671  }
 11672  func rewriteValueLOONG64_OpStore(v *Value) bool {
 11673  	v_2 := v.Args[2]
 11674  	v_1 := v.Args[1]
 11675  	v_0 := v.Args[0]
 11676  	// match: (Store {t} ptr val mem)
 11677  	// cond: t.Size() == 1
 11678  	// result: (MOVBstore ptr val mem)
 11679  	for {
 11680  		t := auxToType(v.Aux)
 11681  		ptr := v_0
 11682  		val := v_1
 11683  		mem := v_2
 11684  		if !(t.Size() == 1) {
 11685  			break
 11686  		}
 11687  		v.reset(OpLOONG64MOVBstore)
 11688  		v.AddArg3(ptr, val, mem)
 11689  		return true
 11690  	}
 11691  	// match: (Store {t} ptr val mem)
 11692  	// cond: t.Size() == 2
 11693  	// result: (MOVHstore ptr val mem)
 11694  	for {
 11695  		t := auxToType(v.Aux)
 11696  		ptr := v_0
 11697  		val := v_1
 11698  		mem := v_2
 11699  		if !(t.Size() == 2) {
 11700  			break
 11701  		}
 11702  		v.reset(OpLOONG64MOVHstore)
 11703  		v.AddArg3(ptr, val, mem)
 11704  		return true
 11705  	}
 11706  	// match: (Store {t} ptr val mem)
 11707  	// cond: t.Size() == 4 && !t.IsFloat()
 11708  	// result: (MOVWstore ptr val mem)
 11709  	for {
 11710  		t := auxToType(v.Aux)
 11711  		ptr := v_0
 11712  		val := v_1
 11713  		mem := v_2
 11714  		if !(t.Size() == 4 && !t.IsFloat()) {
 11715  			break
 11716  		}
 11717  		v.reset(OpLOONG64MOVWstore)
 11718  		v.AddArg3(ptr, val, mem)
 11719  		return true
 11720  	}
 11721  	// match: (Store {t} ptr val mem)
 11722  	// cond: t.Size() == 8 && !t.IsFloat()
 11723  	// result: (MOVVstore ptr val mem)
 11724  	for {
 11725  		t := auxToType(v.Aux)
 11726  		ptr := v_0
 11727  		val := v_1
 11728  		mem := v_2
 11729  		if !(t.Size() == 8 && !t.IsFloat()) {
 11730  			break
 11731  		}
 11732  		v.reset(OpLOONG64MOVVstore)
 11733  		v.AddArg3(ptr, val, mem)
 11734  		return true
 11735  	}
 11736  	// match: (Store {t} ptr val mem)
 11737  	// cond: t.Size() == 4 && t.IsFloat()
 11738  	// result: (MOVFstore ptr val mem)
 11739  	for {
 11740  		t := auxToType(v.Aux)
 11741  		ptr := v_0
 11742  		val := v_1
 11743  		mem := v_2
 11744  		if !(t.Size() == 4 && t.IsFloat()) {
 11745  			break
 11746  		}
 11747  		v.reset(OpLOONG64MOVFstore)
 11748  		v.AddArg3(ptr, val, mem)
 11749  		return true
 11750  	}
 11751  	// match: (Store {t} ptr val mem)
 11752  	// cond: t.Size() == 8 && t.IsFloat()
 11753  	// result: (MOVDstore ptr val mem)
 11754  	for {
 11755  		t := auxToType(v.Aux)
 11756  		ptr := v_0
 11757  		val := v_1
 11758  		mem := v_2
 11759  		if !(t.Size() == 8 && t.IsFloat()) {
 11760  			break
 11761  		}
 11762  		v.reset(OpLOONG64MOVDstore)
 11763  		v.AddArg3(ptr, val, mem)
 11764  		return true
 11765  	}
 11766  	return false
 11767  }
 11768  func rewriteValueLOONG64_OpZero(v *Value) bool {
 11769  	v_1 := v.Args[1]
 11770  	v_0 := v.Args[0]
 11771  	b := v.Block
 11772  	typ := &b.Func.Config.Types
 11773  	// match: (Zero [0] _ mem)
 11774  	// result: mem
 11775  	for {
 11776  		if auxIntToInt64(v.AuxInt) != 0 {
 11777  			break
 11778  		}
 11779  		mem := v_1
 11780  		v.copyOf(mem)
 11781  		return true
 11782  	}
 11783  	// match: (Zero [1] ptr mem)
 11784  	// result: (MOVBstore ptr (MOVVconst [0]) mem)
 11785  	for {
 11786  		if auxIntToInt64(v.AuxInt) != 1 {
 11787  			break
 11788  		}
 11789  		ptr := v_0
 11790  		mem := v_1
 11791  		v.reset(OpLOONG64MOVBstore)
 11792  		v0 := b.NewValue0(v.Pos, OpLOONG64MOVVconst, typ.UInt64)
 11793  		v0.AuxInt = int64ToAuxInt(0)
 11794  		v.AddArg3(ptr, v0, mem)
 11795  		return true
 11796  	}
 11797  	// match: (Zero [2] ptr mem)
 11798  	// result: (MOVHstore ptr (MOVVconst [0]) mem)
 11799  	for {
 11800  		if auxIntToInt64(v.AuxInt) != 2 {
 11801  			break
 11802  		}
 11803  		ptr := v_0
 11804  		mem := v_1
 11805  		v.reset(OpLOONG64MOVHstore)
 11806  		v0 := b.NewValue0(v.Pos, OpLOONG64MOVVconst, typ.UInt64)
 11807  		v0.AuxInt = int64ToAuxInt(0)
 11808  		v.AddArg3(ptr, v0, mem)
 11809  		return true
 11810  	}
 11811  	// match: (Zero [3] ptr mem)
 11812  	// result: (MOVBstore [2] ptr (MOVVconst [0]) (MOVHstore ptr (MOVVconst [0]) mem))
 11813  	for {
 11814  		if auxIntToInt64(v.AuxInt) != 3 {
 11815  			break
 11816  		}
 11817  		ptr := v_0
 11818  		mem := v_1
 11819  		v.reset(OpLOONG64MOVBstore)
 11820  		v.AuxInt = int32ToAuxInt(2)
 11821  		v0 := b.NewValue0(v.Pos, OpLOONG64MOVVconst, typ.UInt64)
 11822  		v0.AuxInt = int64ToAuxInt(0)
 11823  		v1 := b.NewValue0(v.Pos, OpLOONG64MOVHstore, types.TypeMem)
 11824  		v1.AddArg3(ptr, v0, mem)
 11825  		v.AddArg3(ptr, v0, v1)
 11826  		return true
 11827  	}
 11828  	// match: (Zero [4] {t} ptr mem)
 11829  	// result: (MOVWstore ptr (MOVVconst [0]) mem)
 11830  	for {
 11831  		if auxIntToInt64(v.AuxInt) != 4 {
 11832  			break
 11833  		}
 11834  		ptr := v_0
 11835  		mem := v_1
 11836  		v.reset(OpLOONG64MOVWstore)
 11837  		v0 := b.NewValue0(v.Pos, OpLOONG64MOVVconst, typ.UInt64)
 11838  		v0.AuxInt = int64ToAuxInt(0)
 11839  		v.AddArg3(ptr, v0, mem)
 11840  		return true
 11841  	}
 11842  	// match: (Zero [5] ptr mem)
 11843  	// result: (MOVBstore [4] ptr (MOVVconst [0]) (MOVWstore ptr (MOVVconst [0]) mem))
 11844  	for {
 11845  		if auxIntToInt64(v.AuxInt) != 5 {
 11846  			break
 11847  		}
 11848  		ptr := v_0
 11849  		mem := v_1
 11850  		v.reset(OpLOONG64MOVBstore)
 11851  		v.AuxInt = int32ToAuxInt(4)
 11852  		v0 := b.NewValue0(v.Pos, OpLOONG64MOVVconst, typ.UInt64)
 11853  		v0.AuxInt = int64ToAuxInt(0)
 11854  		v1 := b.NewValue0(v.Pos, OpLOONG64MOVWstore, types.TypeMem)
 11855  		v1.AddArg3(ptr, v0, mem)
 11856  		v.AddArg3(ptr, v0, v1)
 11857  		return true
 11858  	}
 11859  	// match: (Zero [6] ptr mem)
 11860  	// result: (MOVHstore [4] ptr (MOVVconst [0]) (MOVWstore ptr (MOVVconst [0]) mem))
 11861  	for {
 11862  		if auxIntToInt64(v.AuxInt) != 6 {
 11863  			break
 11864  		}
 11865  		ptr := v_0
 11866  		mem := v_1
 11867  		v.reset(OpLOONG64MOVHstore)
 11868  		v.AuxInt = int32ToAuxInt(4)
 11869  		v0 := b.NewValue0(v.Pos, OpLOONG64MOVVconst, typ.UInt64)
 11870  		v0.AuxInt = int64ToAuxInt(0)
 11871  		v1 := b.NewValue0(v.Pos, OpLOONG64MOVWstore, types.TypeMem)
 11872  		v1.AddArg3(ptr, v0, mem)
 11873  		v.AddArg3(ptr, v0, v1)
 11874  		return true
 11875  	}
 11876  	// match: (Zero [7] ptr mem)
 11877  	// result: (MOVWstore [3] ptr (MOVVconst [0]) (MOVWstore ptr (MOVVconst [0]) mem))
 11878  	for {
 11879  		if auxIntToInt64(v.AuxInt) != 7 {
 11880  			break
 11881  		}
 11882  		ptr := v_0
 11883  		mem := v_1
 11884  		v.reset(OpLOONG64MOVWstore)
 11885  		v.AuxInt = int32ToAuxInt(3)
 11886  		v0 := b.NewValue0(v.Pos, OpLOONG64MOVVconst, typ.UInt64)
 11887  		v0.AuxInt = int64ToAuxInt(0)
 11888  		v1 := b.NewValue0(v.Pos, OpLOONG64MOVWstore, types.TypeMem)
 11889  		v1.AddArg3(ptr, v0, mem)
 11890  		v.AddArg3(ptr, v0, v1)
 11891  		return true
 11892  	}
 11893  	// match: (Zero [8] {t} ptr mem)
 11894  	// result: (MOVVstore ptr (MOVVconst [0]) mem)
 11895  	for {
 11896  		if auxIntToInt64(v.AuxInt) != 8 {
 11897  			break
 11898  		}
 11899  		ptr := v_0
 11900  		mem := v_1
 11901  		v.reset(OpLOONG64MOVVstore)
 11902  		v0 := b.NewValue0(v.Pos, OpLOONG64MOVVconst, typ.UInt64)
 11903  		v0.AuxInt = int64ToAuxInt(0)
 11904  		v.AddArg3(ptr, v0, mem)
 11905  		return true
 11906  	}
 11907  	// match: (Zero [9] ptr mem)
 11908  	// result: (MOVBstore [8] ptr (MOVVconst [0]) (MOVVstore ptr (MOVVconst [0]) mem))
 11909  	for {
 11910  		if auxIntToInt64(v.AuxInt) != 9 {
 11911  			break
 11912  		}
 11913  		ptr := v_0
 11914  		mem := v_1
 11915  		v.reset(OpLOONG64MOVBstore)
 11916  		v.AuxInt = int32ToAuxInt(8)
 11917  		v0 := b.NewValue0(v.Pos, OpLOONG64MOVVconst, typ.UInt64)
 11918  		v0.AuxInt = int64ToAuxInt(0)
 11919  		v1 := b.NewValue0(v.Pos, OpLOONG64MOVVstore, types.TypeMem)
 11920  		v1.AddArg3(ptr, v0, mem)
 11921  		v.AddArg3(ptr, v0, v1)
 11922  		return true
 11923  	}
 11924  	// match: (Zero [10] ptr mem)
 11925  	// result: (MOVHstore [8] ptr (MOVVconst [0]) (MOVVstore ptr (MOVVconst [0]) mem))
 11926  	for {
 11927  		if auxIntToInt64(v.AuxInt) != 10 {
 11928  			break
 11929  		}
 11930  		ptr := v_0
 11931  		mem := v_1
 11932  		v.reset(OpLOONG64MOVHstore)
 11933  		v.AuxInt = int32ToAuxInt(8)
 11934  		v0 := b.NewValue0(v.Pos, OpLOONG64MOVVconst, typ.UInt64)
 11935  		v0.AuxInt = int64ToAuxInt(0)
 11936  		v1 := b.NewValue0(v.Pos, OpLOONG64MOVVstore, types.TypeMem)
 11937  		v1.AddArg3(ptr, v0, mem)
 11938  		v.AddArg3(ptr, v0, v1)
 11939  		return true
 11940  	}
 11941  	// match: (Zero [11] ptr mem)
 11942  	// result: (MOVWstore [7] ptr (MOVVconst [0]) (MOVVstore ptr (MOVVconst [0]) mem))
 11943  	for {
 11944  		if auxIntToInt64(v.AuxInt) != 11 {
 11945  			break
 11946  		}
 11947  		ptr := v_0
 11948  		mem := v_1
 11949  		v.reset(OpLOONG64MOVWstore)
 11950  		v.AuxInt = int32ToAuxInt(7)
 11951  		v0 := b.NewValue0(v.Pos, OpLOONG64MOVVconst, typ.UInt64)
 11952  		v0.AuxInt = int64ToAuxInt(0)
 11953  		v1 := b.NewValue0(v.Pos, OpLOONG64MOVVstore, types.TypeMem)
 11954  		v1.AddArg3(ptr, v0, mem)
 11955  		v.AddArg3(ptr, v0, v1)
 11956  		return true
 11957  	}
 11958  	// match: (Zero [12] ptr mem)
 11959  	// result: (MOVWstore [8] ptr (MOVVconst [0]) (MOVVstore ptr (MOVVconst [0]) mem))
 11960  	for {
 11961  		if auxIntToInt64(v.AuxInt) != 12 {
 11962  			break
 11963  		}
 11964  		ptr := v_0
 11965  		mem := v_1
 11966  		v.reset(OpLOONG64MOVWstore)
 11967  		v.AuxInt = int32ToAuxInt(8)
 11968  		v0 := b.NewValue0(v.Pos, OpLOONG64MOVVconst, typ.UInt64)
 11969  		v0.AuxInt = int64ToAuxInt(0)
 11970  		v1 := b.NewValue0(v.Pos, OpLOONG64MOVVstore, types.TypeMem)
 11971  		v1.AddArg3(ptr, v0, mem)
 11972  		v.AddArg3(ptr, v0, v1)
 11973  		return true
 11974  	}
 11975  	// match: (Zero [13] ptr mem)
 11976  	// result: (MOVVstore [5] ptr (MOVVconst [0]) (MOVVstore ptr (MOVVconst [0]) mem))
 11977  	for {
 11978  		if auxIntToInt64(v.AuxInt) != 13 {
 11979  			break
 11980  		}
 11981  		ptr := v_0
 11982  		mem := v_1
 11983  		v.reset(OpLOONG64MOVVstore)
 11984  		v.AuxInt = int32ToAuxInt(5)
 11985  		v0 := b.NewValue0(v.Pos, OpLOONG64MOVVconst, typ.UInt64)
 11986  		v0.AuxInt = int64ToAuxInt(0)
 11987  		v1 := b.NewValue0(v.Pos, OpLOONG64MOVVstore, types.TypeMem)
 11988  		v1.AddArg3(ptr, v0, mem)
 11989  		v.AddArg3(ptr, v0, v1)
 11990  		return true
 11991  	}
 11992  	// match: (Zero [14] ptr mem)
 11993  	// result: (MOVVstore [6] ptr (MOVVconst [0]) (MOVVstore ptr (MOVVconst [0]) mem))
 11994  	for {
 11995  		if auxIntToInt64(v.AuxInt) != 14 {
 11996  			break
 11997  		}
 11998  		ptr := v_0
 11999  		mem := v_1
 12000  		v.reset(OpLOONG64MOVVstore)
 12001  		v.AuxInt = int32ToAuxInt(6)
 12002  		v0 := b.NewValue0(v.Pos, OpLOONG64MOVVconst, typ.UInt64)
 12003  		v0.AuxInt = int64ToAuxInt(0)
 12004  		v1 := b.NewValue0(v.Pos, OpLOONG64MOVVstore, types.TypeMem)
 12005  		v1.AddArg3(ptr, v0, mem)
 12006  		v.AddArg3(ptr, v0, v1)
 12007  		return true
 12008  	}
 12009  	// match: (Zero [15] ptr mem)
 12010  	// result: (MOVVstore [7] ptr (MOVVconst [0]) (MOVVstore ptr (MOVVconst [0]) mem))
 12011  	for {
 12012  		if auxIntToInt64(v.AuxInt) != 15 {
 12013  			break
 12014  		}
 12015  		ptr := v_0
 12016  		mem := v_1
 12017  		v.reset(OpLOONG64MOVVstore)
 12018  		v.AuxInt = int32ToAuxInt(7)
 12019  		v0 := b.NewValue0(v.Pos, OpLOONG64MOVVconst, typ.UInt64)
 12020  		v0.AuxInt = int64ToAuxInt(0)
 12021  		v1 := b.NewValue0(v.Pos, OpLOONG64MOVVstore, types.TypeMem)
 12022  		v1.AddArg3(ptr, v0, mem)
 12023  		v.AddArg3(ptr, v0, v1)
 12024  		return true
 12025  	}
 12026  	// match: (Zero [16] ptr mem)
 12027  	// result: (MOVVstore [8] ptr (MOVVconst [0]) (MOVVstore ptr (MOVVconst [0]) mem))
 12028  	for {
 12029  		if auxIntToInt64(v.AuxInt) != 16 {
 12030  			break
 12031  		}
 12032  		ptr := v_0
 12033  		mem := v_1
 12034  		v.reset(OpLOONG64MOVVstore)
 12035  		v.AuxInt = int32ToAuxInt(8)
 12036  		v0 := b.NewValue0(v.Pos, OpLOONG64MOVVconst, typ.UInt64)
 12037  		v0.AuxInt = int64ToAuxInt(0)
 12038  		v1 := b.NewValue0(v.Pos, OpLOONG64MOVVstore, types.TypeMem)
 12039  		v1.AddArg3(ptr, v0, mem)
 12040  		v.AddArg3(ptr, v0, v1)
 12041  		return true
 12042  	}
 12043  	// match: (Zero [s] ptr mem)
 12044  	// cond: s > 16 && s < 192
 12045  	// result: (LoweredZero [s] ptr mem)
 12046  	for {
 12047  		s := auxIntToInt64(v.AuxInt)
 12048  		ptr := v_0
 12049  		mem := v_1
 12050  		if !(s > 16 && s < 192) {
 12051  			break
 12052  		}
 12053  		v.reset(OpLOONG64LoweredZero)
 12054  		v.AuxInt = int64ToAuxInt(s)
 12055  		v.AddArg2(ptr, mem)
 12056  		return true
 12057  	}
 12058  	// match: (Zero [s] ptr mem)
 12059  	// cond: s >= 192
 12060  	// result: (LoweredZeroLoop [s] ptr mem)
 12061  	for {
 12062  		s := auxIntToInt64(v.AuxInt)
 12063  		ptr := v_0
 12064  		mem := v_1
 12065  		if !(s >= 192) {
 12066  			break
 12067  		}
 12068  		v.reset(OpLOONG64LoweredZeroLoop)
 12069  		v.AuxInt = int64ToAuxInt(s)
 12070  		v.AddArg2(ptr, mem)
 12071  		return true
 12072  	}
 12073  	return false
 12074  }
 12075  func rewriteBlockLOONG64(b *Block) bool {
 12076  	typ := &b.Func.Config.Types
 12077  	switch b.Kind {
 12078  	case BlockLOONG64BEQ:
 12079  		// match: (BEQ (MOVVconst [0]) cond yes no)
 12080  		// result: (EQZ cond yes no)
 12081  		for b.Controls[0].Op == OpLOONG64MOVVconst {
 12082  			v_0 := b.Controls[0]
 12083  			if auxIntToInt64(v_0.AuxInt) != 0 {
 12084  				break
 12085  			}
 12086  			cond := b.Controls[1]
 12087  			b.resetWithControl(BlockLOONG64EQZ, cond)
 12088  			return true
 12089  		}
 12090  		// match: (BEQ cond (MOVVconst [0]) yes no)
 12091  		// result: (EQZ cond yes no)
 12092  		for b.Controls[1].Op == OpLOONG64MOVVconst {
 12093  			cond := b.Controls[0]
 12094  			v_1 := b.Controls[1]
 12095  			if auxIntToInt64(v_1.AuxInt) != 0 {
 12096  				break
 12097  			}
 12098  			b.resetWithControl(BlockLOONG64EQZ, cond)
 12099  			return true
 12100  		}
 12101  	case BlockLOONG64BGE:
 12102  		// match: (BGE (MOVVconst [0]) cond yes no)
 12103  		// result: (LEZ cond yes no)
 12104  		for b.Controls[0].Op == OpLOONG64MOVVconst {
 12105  			v_0 := b.Controls[0]
 12106  			if auxIntToInt64(v_0.AuxInt) != 0 {
 12107  				break
 12108  			}
 12109  			cond := b.Controls[1]
 12110  			b.resetWithControl(BlockLOONG64LEZ, cond)
 12111  			return true
 12112  		}
 12113  		// match: (BGE cond (MOVVconst [0]) yes no)
 12114  		// result: (GEZ cond yes no)
 12115  		for b.Controls[1].Op == OpLOONG64MOVVconst {
 12116  			cond := b.Controls[0]
 12117  			v_1 := b.Controls[1]
 12118  			if auxIntToInt64(v_1.AuxInt) != 0 {
 12119  				break
 12120  			}
 12121  			b.resetWithControl(BlockLOONG64GEZ, cond)
 12122  			return true
 12123  		}
 12124  	case BlockLOONG64BGEU:
 12125  		// match: (BGEU (MOVVconst [0]) cond yes no)
 12126  		// result: (EQZ cond yes no)
 12127  		for b.Controls[0].Op == OpLOONG64MOVVconst {
 12128  			v_0 := b.Controls[0]
 12129  			if auxIntToInt64(v_0.AuxInt) != 0 {
 12130  				break
 12131  			}
 12132  			cond := b.Controls[1]
 12133  			b.resetWithControl(BlockLOONG64EQZ, cond)
 12134  			return true
 12135  		}
 12136  	case BlockLOONG64BLT:
 12137  		// match: (BLT (MOVVconst [0]) cond yes no)
 12138  		// result: (GTZ cond yes no)
 12139  		for b.Controls[0].Op == OpLOONG64MOVVconst {
 12140  			v_0 := b.Controls[0]
 12141  			if auxIntToInt64(v_0.AuxInt) != 0 {
 12142  				break
 12143  			}
 12144  			cond := b.Controls[1]
 12145  			b.resetWithControl(BlockLOONG64GTZ, cond)
 12146  			return true
 12147  		}
 12148  		// match: (BLT cond (MOVVconst [0]) yes no)
 12149  		// result: (LTZ cond yes no)
 12150  		for b.Controls[1].Op == OpLOONG64MOVVconst {
 12151  			cond := b.Controls[0]
 12152  			v_1 := b.Controls[1]
 12153  			if auxIntToInt64(v_1.AuxInt) != 0 {
 12154  				break
 12155  			}
 12156  			b.resetWithControl(BlockLOONG64LTZ, cond)
 12157  			return true
 12158  		}
 12159  	case BlockLOONG64BLTU:
 12160  		// match: (BLTU (MOVVconst [0]) cond yes no)
 12161  		// result: (NEZ cond yes no)
 12162  		for b.Controls[0].Op == OpLOONG64MOVVconst {
 12163  			v_0 := b.Controls[0]
 12164  			if auxIntToInt64(v_0.AuxInt) != 0 {
 12165  				break
 12166  			}
 12167  			cond := b.Controls[1]
 12168  			b.resetWithControl(BlockLOONG64NEZ, cond)
 12169  			return true
 12170  		}
 12171  	case BlockLOONG64BNE:
 12172  		// match: (BNE (MOVVconst [0]) cond yes no)
 12173  		// result: (NEZ cond yes no)
 12174  		for b.Controls[0].Op == OpLOONG64MOVVconst {
 12175  			v_0 := b.Controls[0]
 12176  			if auxIntToInt64(v_0.AuxInt) != 0 {
 12177  				break
 12178  			}
 12179  			cond := b.Controls[1]
 12180  			b.resetWithControl(BlockLOONG64NEZ, cond)
 12181  			return true
 12182  		}
 12183  		// match: (BNE cond (MOVVconst [0]) yes no)
 12184  		// result: (NEZ cond yes no)
 12185  		for b.Controls[1].Op == OpLOONG64MOVVconst {
 12186  			cond := b.Controls[0]
 12187  			v_1 := b.Controls[1]
 12188  			if auxIntToInt64(v_1.AuxInt) != 0 {
 12189  				break
 12190  			}
 12191  			b.resetWithControl(BlockLOONG64NEZ, cond)
 12192  			return true
 12193  		}
 12194  	case BlockLOONG64EQZ:
 12195  		// match: (EQZ (FPFlagTrue cmp) yes no)
 12196  		// result: (FPF cmp yes no)
 12197  		for b.Controls[0].Op == OpLOONG64FPFlagTrue {
 12198  			v_0 := b.Controls[0]
 12199  			cmp := v_0.Args[0]
 12200  			b.resetWithControl(BlockLOONG64FPF, cmp)
 12201  			return true
 12202  		}
 12203  		// match: (EQZ (FPFlagFalse cmp) yes no)
 12204  		// result: (FPT cmp yes no)
 12205  		for b.Controls[0].Op == OpLOONG64FPFlagFalse {
 12206  			v_0 := b.Controls[0]
 12207  			cmp := v_0.Args[0]
 12208  			b.resetWithControl(BlockLOONG64FPT, cmp)
 12209  			return true
 12210  		}
 12211  		// match: (EQZ (XORconst [1] cmp:(SGT _ _)) yes no)
 12212  		// result: (NEZ cmp yes no)
 12213  		for b.Controls[0].Op == OpLOONG64XORconst {
 12214  			v_0 := b.Controls[0]
 12215  			if auxIntToInt64(v_0.AuxInt) != 1 {
 12216  				break
 12217  			}
 12218  			cmp := v_0.Args[0]
 12219  			if cmp.Op != OpLOONG64SGT {
 12220  				break
 12221  			}
 12222  			b.resetWithControl(BlockLOONG64NEZ, cmp)
 12223  			return true
 12224  		}
 12225  		// match: (EQZ (XORconst [1] cmp:(SGTU _ _)) yes no)
 12226  		// result: (NEZ cmp yes no)
 12227  		for b.Controls[0].Op == OpLOONG64XORconst {
 12228  			v_0 := b.Controls[0]
 12229  			if auxIntToInt64(v_0.AuxInt) != 1 {
 12230  				break
 12231  			}
 12232  			cmp := v_0.Args[0]
 12233  			if cmp.Op != OpLOONG64SGTU {
 12234  				break
 12235  			}
 12236  			b.resetWithControl(BlockLOONG64NEZ, cmp)
 12237  			return true
 12238  		}
 12239  		// match: (EQZ (XORconst [1] cmp:(SGTconst _)) yes no)
 12240  		// result: (NEZ cmp yes no)
 12241  		for b.Controls[0].Op == OpLOONG64XORconst {
 12242  			v_0 := b.Controls[0]
 12243  			if auxIntToInt64(v_0.AuxInt) != 1 {
 12244  				break
 12245  			}
 12246  			cmp := v_0.Args[0]
 12247  			if cmp.Op != OpLOONG64SGTconst {
 12248  				break
 12249  			}
 12250  			b.resetWithControl(BlockLOONG64NEZ, cmp)
 12251  			return true
 12252  		}
 12253  		// match: (EQZ (XORconst [1] cmp:(SGTUconst _)) yes no)
 12254  		// result: (NEZ cmp yes no)
 12255  		for b.Controls[0].Op == OpLOONG64XORconst {
 12256  			v_0 := b.Controls[0]
 12257  			if auxIntToInt64(v_0.AuxInt) != 1 {
 12258  				break
 12259  			}
 12260  			cmp := v_0.Args[0]
 12261  			if cmp.Op != OpLOONG64SGTUconst {
 12262  				break
 12263  			}
 12264  			b.resetWithControl(BlockLOONG64NEZ, cmp)
 12265  			return true
 12266  		}
 12267  		// match: (EQZ (SGTUconst [1] x) yes no)
 12268  		// result: (NEZ x yes no)
 12269  		for b.Controls[0].Op == OpLOONG64SGTUconst {
 12270  			v_0 := b.Controls[0]
 12271  			if auxIntToInt64(v_0.AuxInt) != 1 {
 12272  				break
 12273  			}
 12274  			x := v_0.Args[0]
 12275  			b.resetWithControl(BlockLOONG64NEZ, x)
 12276  			return true
 12277  		}
 12278  		// match: (EQZ (SGTU x (MOVVconst [0])) yes no)
 12279  		// result: (EQZ x yes no)
 12280  		for b.Controls[0].Op == OpLOONG64SGTU {
 12281  			v_0 := b.Controls[0]
 12282  			_ = v_0.Args[1]
 12283  			x := v_0.Args[0]
 12284  			v_0_1 := v_0.Args[1]
 12285  			if v_0_1.Op != OpLOONG64MOVVconst || auxIntToInt64(v_0_1.AuxInt) != 0 {
 12286  				break
 12287  			}
 12288  			b.resetWithControl(BlockLOONG64EQZ, x)
 12289  			return true
 12290  		}
 12291  		// match: (EQZ (SGTconst [0] x) yes no)
 12292  		// result: (GEZ x yes no)
 12293  		for b.Controls[0].Op == OpLOONG64SGTconst {
 12294  			v_0 := b.Controls[0]
 12295  			if auxIntToInt64(v_0.AuxInt) != 0 {
 12296  				break
 12297  			}
 12298  			x := v_0.Args[0]
 12299  			b.resetWithControl(BlockLOONG64GEZ, x)
 12300  			return true
 12301  		}
 12302  		// match: (EQZ (SGT x (MOVVconst [0])) yes no)
 12303  		// result: (LEZ x yes no)
 12304  		for b.Controls[0].Op == OpLOONG64SGT {
 12305  			v_0 := b.Controls[0]
 12306  			_ = v_0.Args[1]
 12307  			x := v_0.Args[0]
 12308  			v_0_1 := v_0.Args[1]
 12309  			if v_0_1.Op != OpLOONG64MOVVconst || auxIntToInt64(v_0_1.AuxInt) != 0 {
 12310  				break
 12311  			}
 12312  			b.resetWithControl(BlockLOONG64LEZ, x)
 12313  			return true
 12314  		}
 12315  		// match: (EQZ (SGTU (MOVVconst [c]) y) yes no)
 12316  		// cond: c >= -2048 && c <= 2047
 12317  		// result: (EQZ (SGTUconst [c] y) yes no)
 12318  		for b.Controls[0].Op == OpLOONG64SGTU {
 12319  			v_0 := b.Controls[0]
 12320  			y := v_0.Args[1]
 12321  			v_0_0 := v_0.Args[0]
 12322  			if v_0_0.Op != OpLOONG64MOVVconst {
 12323  				break
 12324  			}
 12325  			c := auxIntToInt64(v_0_0.AuxInt)
 12326  			if !(c >= -2048 && c <= 2047) {
 12327  				break
 12328  			}
 12329  			v0 := b.NewValue0(v_0.Pos, OpLOONG64SGTUconst, typ.Bool)
 12330  			v0.AuxInt = int64ToAuxInt(c)
 12331  			v0.AddArg(y)
 12332  			b.resetWithControl(BlockLOONG64EQZ, v0)
 12333  			return true
 12334  		}
 12335  		// match: (EQZ (SUBV x y) yes no)
 12336  		// result: (BEQ x y yes no)
 12337  		for b.Controls[0].Op == OpLOONG64SUBV {
 12338  			v_0 := b.Controls[0]
 12339  			y := v_0.Args[1]
 12340  			x := v_0.Args[0]
 12341  			b.resetWithControl2(BlockLOONG64BEQ, x, y)
 12342  			return true
 12343  		}
 12344  		// match: (EQZ (SGT x y) yes no)
 12345  		// result: (BGE y x yes no)
 12346  		for b.Controls[0].Op == OpLOONG64SGT {
 12347  			v_0 := b.Controls[0]
 12348  			y := v_0.Args[1]
 12349  			x := v_0.Args[0]
 12350  			b.resetWithControl2(BlockLOONG64BGE, y, x)
 12351  			return true
 12352  		}
 12353  		// match: (EQZ (SGTU x y) yes no)
 12354  		// result: (BGEU y x yes no)
 12355  		for b.Controls[0].Op == OpLOONG64SGTU {
 12356  			v_0 := b.Controls[0]
 12357  			y := v_0.Args[1]
 12358  			x := v_0.Args[0]
 12359  			b.resetWithControl2(BlockLOONG64BGEU, y, x)
 12360  			return true
 12361  		}
 12362  		// match: (EQZ (SGTconst [c] y) yes no)
 12363  		// result: (BGE y (MOVVconst [c]) yes no)
 12364  		for b.Controls[0].Op == OpLOONG64SGTconst {
 12365  			v_0 := b.Controls[0]
 12366  			c := auxIntToInt64(v_0.AuxInt)
 12367  			y := v_0.Args[0]
 12368  			v0 := b.NewValue0(b.Pos, OpLOONG64MOVVconst, typ.UInt64)
 12369  			v0.AuxInt = int64ToAuxInt(c)
 12370  			b.resetWithControl2(BlockLOONG64BGE, y, v0)
 12371  			return true
 12372  		}
 12373  		// match: (EQZ (SGTUconst [c] y) yes no)
 12374  		// result: (BGEU y (MOVVconst [c]) yes no)
 12375  		for b.Controls[0].Op == OpLOONG64SGTUconst {
 12376  			v_0 := b.Controls[0]
 12377  			c := auxIntToInt64(v_0.AuxInt)
 12378  			y := v_0.Args[0]
 12379  			v0 := b.NewValue0(b.Pos, OpLOONG64MOVVconst, typ.UInt64)
 12380  			v0.AuxInt = int64ToAuxInt(c)
 12381  			b.resetWithControl2(BlockLOONG64BGEU, y, v0)
 12382  			return true
 12383  		}
 12384  		// match: (EQZ (MOVVconst [0]) yes no)
 12385  		// result: (First yes no)
 12386  		for b.Controls[0].Op == OpLOONG64MOVVconst {
 12387  			v_0 := b.Controls[0]
 12388  			if auxIntToInt64(v_0.AuxInt) != 0 {
 12389  				break
 12390  			}
 12391  			b.Reset(BlockFirst)
 12392  			return true
 12393  		}
 12394  		// match: (EQZ (MOVVconst [c]) yes no)
 12395  		// cond: c != 0
 12396  		// result: (First no yes)
 12397  		for b.Controls[0].Op == OpLOONG64MOVVconst {
 12398  			v_0 := b.Controls[0]
 12399  			c := auxIntToInt64(v_0.AuxInt)
 12400  			if !(c != 0) {
 12401  				break
 12402  			}
 12403  			b.Reset(BlockFirst)
 12404  			b.swapSuccessors()
 12405  			return true
 12406  		}
 12407  		// match: (EQZ (NEGV x) yes no)
 12408  		// result: (EQZ x yes no)
 12409  		for b.Controls[0].Op == OpLOONG64NEGV {
 12410  			v_0 := b.Controls[0]
 12411  			x := v_0.Args[0]
 12412  			b.resetWithControl(BlockLOONG64EQZ, x)
 12413  			return true
 12414  		}
 12415  	case BlockLOONG64GEZ:
 12416  		// match: (GEZ (MOVVconst [c]) yes no)
 12417  		// cond: c >= 0
 12418  		// result: (First yes no)
 12419  		for b.Controls[0].Op == OpLOONG64MOVVconst {
 12420  			v_0 := b.Controls[0]
 12421  			c := auxIntToInt64(v_0.AuxInt)
 12422  			if !(c >= 0) {
 12423  				break
 12424  			}
 12425  			b.Reset(BlockFirst)
 12426  			return true
 12427  		}
 12428  		// match: (GEZ (MOVVconst [c]) yes no)
 12429  		// cond: c < 0
 12430  		// result: (First no yes)
 12431  		for b.Controls[0].Op == OpLOONG64MOVVconst {
 12432  			v_0 := b.Controls[0]
 12433  			c := auxIntToInt64(v_0.AuxInt)
 12434  			if !(c < 0) {
 12435  				break
 12436  			}
 12437  			b.Reset(BlockFirst)
 12438  			b.swapSuccessors()
 12439  			return true
 12440  		}
 12441  	case BlockLOONG64GTZ:
 12442  		// match: (GTZ (MOVVconst [c]) yes no)
 12443  		// cond: c > 0
 12444  		// result: (First yes no)
 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  			return true
 12453  		}
 12454  		// match: (GTZ (MOVVconst [c]) yes no)
 12455  		// cond: c <= 0
 12456  		// result: (First no yes)
 12457  		for b.Controls[0].Op == OpLOONG64MOVVconst {
 12458  			v_0 := b.Controls[0]
 12459  			c := auxIntToInt64(v_0.AuxInt)
 12460  			if !(c <= 0) {
 12461  				break
 12462  			}
 12463  			b.Reset(BlockFirst)
 12464  			b.swapSuccessors()
 12465  			return true
 12466  		}
 12467  	case BlockIf:
 12468  		// match: (If cond yes no)
 12469  		// result: (NEZ (MOVBUreg <typ.UInt64> cond) yes no)
 12470  		for {
 12471  			cond := b.Controls[0]
 12472  			v0 := b.NewValue0(cond.Pos, OpLOONG64MOVBUreg, typ.UInt64)
 12473  			v0.AddArg(cond)
 12474  			b.resetWithControl(BlockLOONG64NEZ, v0)
 12475  			return true
 12476  		}
 12477  	case BlockJumpTable:
 12478  		// match: (JumpTable idx)
 12479  		// result: (JUMPTABLE {makeJumpTableSym(b)} idx (MOVVaddr <typ.Uintptr> {makeJumpTableSym(b)} (SB)))
 12480  		for {
 12481  			idx := b.Controls[0]
 12482  			v0 := b.NewValue0(b.Pos, OpLOONG64MOVVaddr, typ.Uintptr)
 12483  			v0.Aux = symToAux(makeJumpTableSym(b))
 12484  			v1 := b.NewValue0(b.Pos, OpSB, typ.Uintptr)
 12485  			v0.AddArg(v1)
 12486  			b.resetWithControl2(BlockLOONG64JUMPTABLE, idx, v0)
 12487  			b.Aux = symToAux(makeJumpTableSym(b))
 12488  			return true
 12489  		}
 12490  	case BlockLOONG64LEZ:
 12491  		// match: (LEZ (MOVVconst [c]) yes no)
 12492  		// cond: c <= 0
 12493  		// result: (First yes no)
 12494  		for b.Controls[0].Op == OpLOONG64MOVVconst {
 12495  			v_0 := b.Controls[0]
 12496  			c := auxIntToInt64(v_0.AuxInt)
 12497  			if !(c <= 0) {
 12498  				break
 12499  			}
 12500  			b.Reset(BlockFirst)
 12501  			return true
 12502  		}
 12503  		// match: (LEZ (MOVVconst [c]) yes no)
 12504  		// cond: c > 0
 12505  		// result: (First no yes)
 12506  		for b.Controls[0].Op == OpLOONG64MOVVconst {
 12507  			v_0 := b.Controls[0]
 12508  			c := auxIntToInt64(v_0.AuxInt)
 12509  			if !(c > 0) {
 12510  				break
 12511  			}
 12512  			b.Reset(BlockFirst)
 12513  			b.swapSuccessors()
 12514  			return true
 12515  		}
 12516  	case BlockLOONG64LTZ:
 12517  		// match: (LTZ (MOVVconst [c]) yes no)
 12518  		// cond: c < 0
 12519  		// result: (First yes no)
 12520  		for b.Controls[0].Op == OpLOONG64MOVVconst {
 12521  			v_0 := b.Controls[0]
 12522  			c := auxIntToInt64(v_0.AuxInt)
 12523  			if !(c < 0) {
 12524  				break
 12525  			}
 12526  			b.Reset(BlockFirst)
 12527  			return true
 12528  		}
 12529  		// match: (LTZ (MOVVconst [c]) yes no)
 12530  		// cond: c >= 0
 12531  		// result: (First no yes)
 12532  		for b.Controls[0].Op == OpLOONG64MOVVconst {
 12533  			v_0 := b.Controls[0]
 12534  			c := auxIntToInt64(v_0.AuxInt)
 12535  			if !(c >= 0) {
 12536  				break
 12537  			}
 12538  			b.Reset(BlockFirst)
 12539  			b.swapSuccessors()
 12540  			return true
 12541  		}
 12542  	case BlockLOONG64NEZ:
 12543  		// match: (NEZ (FPFlagTrue cmp) yes no)
 12544  		// result: (FPT cmp yes no)
 12545  		for b.Controls[0].Op == OpLOONG64FPFlagTrue {
 12546  			v_0 := b.Controls[0]
 12547  			cmp := v_0.Args[0]
 12548  			b.resetWithControl(BlockLOONG64FPT, cmp)
 12549  			return true
 12550  		}
 12551  		// match: (NEZ (FPFlagFalse cmp) yes no)
 12552  		// result: (FPF cmp yes no)
 12553  		for b.Controls[0].Op == OpLOONG64FPFlagFalse {
 12554  			v_0 := b.Controls[0]
 12555  			cmp := v_0.Args[0]
 12556  			b.resetWithControl(BlockLOONG64FPF, cmp)
 12557  			return true
 12558  		}
 12559  		// match: (NEZ (XORconst [1] cmp:(SGT _ _)) yes no)
 12560  		// result: (EQZ cmp yes no)
 12561  		for b.Controls[0].Op == OpLOONG64XORconst {
 12562  			v_0 := b.Controls[0]
 12563  			if auxIntToInt64(v_0.AuxInt) != 1 {
 12564  				break
 12565  			}
 12566  			cmp := v_0.Args[0]
 12567  			if cmp.Op != OpLOONG64SGT {
 12568  				break
 12569  			}
 12570  			b.resetWithControl(BlockLOONG64EQZ, cmp)
 12571  			return true
 12572  		}
 12573  		// match: (NEZ (XORconst [1] cmp:(SGTU _ _)) yes no)
 12574  		// result: (EQZ cmp yes no)
 12575  		for b.Controls[0].Op == OpLOONG64XORconst {
 12576  			v_0 := b.Controls[0]
 12577  			if auxIntToInt64(v_0.AuxInt) != 1 {
 12578  				break
 12579  			}
 12580  			cmp := v_0.Args[0]
 12581  			if cmp.Op != OpLOONG64SGTU {
 12582  				break
 12583  			}
 12584  			b.resetWithControl(BlockLOONG64EQZ, cmp)
 12585  			return true
 12586  		}
 12587  		// match: (NEZ (XORconst [1] cmp:(SGTconst _)) yes no)
 12588  		// result: (EQZ cmp yes no)
 12589  		for b.Controls[0].Op == OpLOONG64XORconst {
 12590  			v_0 := b.Controls[0]
 12591  			if auxIntToInt64(v_0.AuxInt) != 1 {
 12592  				break
 12593  			}
 12594  			cmp := v_0.Args[0]
 12595  			if cmp.Op != OpLOONG64SGTconst {
 12596  				break
 12597  			}
 12598  			b.resetWithControl(BlockLOONG64EQZ, cmp)
 12599  			return true
 12600  		}
 12601  		// match: (NEZ (XORconst [1] cmp:(SGTUconst _)) yes no)
 12602  		// result: (EQZ cmp yes no)
 12603  		for b.Controls[0].Op == OpLOONG64XORconst {
 12604  			v_0 := b.Controls[0]
 12605  			if auxIntToInt64(v_0.AuxInt) != 1 {
 12606  				break
 12607  			}
 12608  			cmp := v_0.Args[0]
 12609  			if cmp.Op != OpLOONG64SGTUconst {
 12610  				break
 12611  			}
 12612  			b.resetWithControl(BlockLOONG64EQZ, cmp)
 12613  			return true
 12614  		}
 12615  		// match: (NEZ (SGTUconst [1] x) yes no)
 12616  		// result: (EQZ x yes no)
 12617  		for b.Controls[0].Op == OpLOONG64SGTUconst {
 12618  			v_0 := b.Controls[0]
 12619  			if auxIntToInt64(v_0.AuxInt) != 1 {
 12620  				break
 12621  			}
 12622  			x := v_0.Args[0]
 12623  			b.resetWithControl(BlockLOONG64EQZ, x)
 12624  			return true
 12625  		}
 12626  		// match: (NEZ (SGTU x (MOVVconst [0])) yes no)
 12627  		// result: (NEZ x yes no)
 12628  		for b.Controls[0].Op == OpLOONG64SGTU {
 12629  			v_0 := b.Controls[0]
 12630  			_ = v_0.Args[1]
 12631  			x := v_0.Args[0]
 12632  			v_0_1 := v_0.Args[1]
 12633  			if v_0_1.Op != OpLOONG64MOVVconst || auxIntToInt64(v_0_1.AuxInt) != 0 {
 12634  				break
 12635  			}
 12636  			b.resetWithControl(BlockLOONG64NEZ, x)
 12637  			return true
 12638  		}
 12639  		// match: (NEZ (SGTconst [0] x) yes no)
 12640  		// result: (LTZ x yes no)
 12641  		for b.Controls[0].Op == OpLOONG64SGTconst {
 12642  			v_0 := b.Controls[0]
 12643  			if auxIntToInt64(v_0.AuxInt) != 0 {
 12644  				break
 12645  			}
 12646  			x := v_0.Args[0]
 12647  			b.resetWithControl(BlockLOONG64LTZ, x)
 12648  			return true
 12649  		}
 12650  		// match: (NEZ (SGT x (MOVVconst [0])) yes no)
 12651  		// result: (GTZ x yes no)
 12652  		for b.Controls[0].Op == OpLOONG64SGT {
 12653  			v_0 := b.Controls[0]
 12654  			_ = v_0.Args[1]
 12655  			x := v_0.Args[0]
 12656  			v_0_1 := v_0.Args[1]
 12657  			if v_0_1.Op != OpLOONG64MOVVconst || auxIntToInt64(v_0_1.AuxInt) != 0 {
 12658  				break
 12659  			}
 12660  			b.resetWithControl(BlockLOONG64GTZ, x)
 12661  			return true
 12662  		}
 12663  		// match: (NEZ (SGTU (MOVVconst [c]) y) yes no)
 12664  		// cond: c >= -2048 && c <= 2047
 12665  		// result: (NEZ (SGTUconst [c] y) yes no)
 12666  		for b.Controls[0].Op == OpLOONG64SGTU {
 12667  			v_0 := b.Controls[0]
 12668  			y := v_0.Args[1]
 12669  			v_0_0 := v_0.Args[0]
 12670  			if v_0_0.Op != OpLOONG64MOVVconst {
 12671  				break
 12672  			}
 12673  			c := auxIntToInt64(v_0_0.AuxInt)
 12674  			if !(c >= -2048 && c <= 2047) {
 12675  				break
 12676  			}
 12677  			v0 := b.NewValue0(v_0.Pos, OpLOONG64SGTUconst, typ.Bool)
 12678  			v0.AuxInt = int64ToAuxInt(c)
 12679  			v0.AddArg(y)
 12680  			b.resetWithControl(BlockLOONG64NEZ, v0)
 12681  			return true
 12682  		}
 12683  		// match: (NEZ (SUBV x y) yes no)
 12684  		// result: (BNE x y yes no)
 12685  		for b.Controls[0].Op == OpLOONG64SUBV {
 12686  			v_0 := b.Controls[0]
 12687  			y := v_0.Args[1]
 12688  			x := v_0.Args[0]
 12689  			b.resetWithControl2(BlockLOONG64BNE, x, y)
 12690  			return true
 12691  		}
 12692  		// match: (NEZ (SGT x y) yes no)
 12693  		// result: (BLT y x yes no)
 12694  		for b.Controls[0].Op == OpLOONG64SGT {
 12695  			v_0 := b.Controls[0]
 12696  			y := v_0.Args[1]
 12697  			x := v_0.Args[0]
 12698  			b.resetWithControl2(BlockLOONG64BLT, y, x)
 12699  			return true
 12700  		}
 12701  		// match: (NEZ (SGTU x y) yes no)
 12702  		// result: (BLTU y x yes no)
 12703  		for b.Controls[0].Op == OpLOONG64SGTU {
 12704  			v_0 := b.Controls[0]
 12705  			y := v_0.Args[1]
 12706  			x := v_0.Args[0]
 12707  			b.resetWithControl2(BlockLOONG64BLTU, y, x)
 12708  			return true
 12709  		}
 12710  		// match: (NEZ (SGTconst [c] y) yes no)
 12711  		// result: (BLT y (MOVVconst [c]) yes no)
 12712  		for b.Controls[0].Op == OpLOONG64SGTconst {
 12713  			v_0 := b.Controls[0]
 12714  			c := auxIntToInt64(v_0.AuxInt)
 12715  			y := v_0.Args[0]
 12716  			v0 := b.NewValue0(b.Pos, OpLOONG64MOVVconst, typ.UInt64)
 12717  			v0.AuxInt = int64ToAuxInt(c)
 12718  			b.resetWithControl2(BlockLOONG64BLT, y, v0)
 12719  			return true
 12720  		}
 12721  		// match: (NEZ (SGTUconst [c] y) yes no)
 12722  		// result: (BLTU y (MOVVconst [c]) yes no)
 12723  		for b.Controls[0].Op == OpLOONG64SGTUconst {
 12724  			v_0 := b.Controls[0]
 12725  			c := auxIntToInt64(v_0.AuxInt)
 12726  			y := v_0.Args[0]
 12727  			v0 := b.NewValue0(b.Pos, OpLOONG64MOVVconst, typ.UInt64)
 12728  			v0.AuxInt = int64ToAuxInt(c)
 12729  			b.resetWithControl2(BlockLOONG64BLTU, y, v0)
 12730  			return true
 12731  		}
 12732  		// match: (NEZ (MOVVconst [0]) yes no)
 12733  		// result: (First no yes)
 12734  		for b.Controls[0].Op == OpLOONG64MOVVconst {
 12735  			v_0 := b.Controls[0]
 12736  			if auxIntToInt64(v_0.AuxInt) != 0 {
 12737  				break
 12738  			}
 12739  			b.Reset(BlockFirst)
 12740  			b.swapSuccessors()
 12741  			return true
 12742  		}
 12743  		// match: (NEZ (MOVVconst [c]) yes no)
 12744  		// cond: c != 0
 12745  		// result: (First yes no)
 12746  		for b.Controls[0].Op == OpLOONG64MOVVconst {
 12747  			v_0 := b.Controls[0]
 12748  			c := auxIntToInt64(v_0.AuxInt)
 12749  			if !(c != 0) {
 12750  				break
 12751  			}
 12752  			b.Reset(BlockFirst)
 12753  			return true
 12754  		}
 12755  		// match: (NEZ (NEGV x) yes no)
 12756  		// result: (NEZ x yes no)
 12757  		for b.Controls[0].Op == OpLOONG64NEGV {
 12758  			v_0 := b.Controls[0]
 12759  			x := v_0.Args[0]
 12760  			b.resetWithControl(BlockLOONG64NEZ, x)
 12761  			return true
 12762  		}
 12763  	}
 12764  	return false
 12765  }
 12766  

View as plain text