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  import "cmd/compile/internal/ssa/block"
     7  
     8  func rewriteValueLOONG64(v *Value) bool {
     9  	switch v.Op {
    10  	case OpAbs:
    11  		v.Op = OpLOONG64ABSD
    12  		return true
    13  	case OpAdd16:
    14  		v.Op = OpLOONG64ADDV
    15  		return true
    16  	case OpAdd32:
    17  		v.Op = OpLOONG64ADDV
    18  		return true
    19  	case OpAdd32F:
    20  		v.Op = OpLOONG64ADDF
    21  		return true
    22  	case OpAdd64:
    23  		v.Op = OpLOONG64ADDV
    24  		return true
    25  	case OpAdd64F:
    26  		v.Op = OpLOONG64ADDD
    27  		return true
    28  	case OpAdd8:
    29  		v.Op = OpLOONG64ADDV
    30  		return true
    31  	case OpAddPtr:
    32  		v.Op = OpLOONG64ADDV
    33  		return true
    34  	case OpAddr:
    35  		return rewriteValueLOONG64_OpAddr(v)
    36  	case OpAnd16:
    37  		v.Op = OpLOONG64AND
    38  		return true
    39  	case OpAnd32:
    40  		v.Op = OpLOONG64AND
    41  		return true
    42  	case OpAnd64:
    43  		v.Op = OpLOONG64AND
    44  		return true
    45  	case OpAnd8:
    46  		v.Op = OpLOONG64AND
    47  		return true
    48  	case OpAndB:
    49  		v.Op = OpLOONG64AND
    50  		return true
    51  	case OpAtomicAdd32:
    52  		v.Op = OpLOONG64LoweredAtomicAdd32
    53  		return true
    54  	case OpAtomicAdd64:
    55  		v.Op = OpLOONG64LoweredAtomicAdd64
    56  		return true
    57  	case OpAtomicAnd32:
    58  		v.Op = OpLOONG64LoweredAtomicAnd32
    59  		return true
    60  	case OpAtomicAnd32value:
    61  		v.Op = OpLOONG64LoweredAtomicAnd32value
    62  		return true
    63  	case OpAtomicAnd64value:
    64  		v.Op = OpLOONG64LoweredAtomicAnd64value
    65  		return true
    66  	case OpAtomicAnd8:
    67  		return rewriteValueLOONG64_OpAtomicAnd8(v)
    68  	case OpAtomicCompareAndSwap32:
    69  		return rewriteValueLOONG64_OpAtomicCompareAndSwap32(v)
    70  	case OpAtomicCompareAndSwap32Variant:
    71  		return rewriteValueLOONG64_OpAtomicCompareAndSwap32Variant(v)
    72  	case OpAtomicCompareAndSwap64:
    73  		v.Op = OpLOONG64LoweredAtomicCas64
    74  		return true
    75  	case OpAtomicCompareAndSwap64Variant:
    76  		v.Op = OpLOONG64LoweredAtomicCas64Variant
    77  		return true
    78  	case OpAtomicExchange32:
    79  		v.Op = OpLOONG64LoweredAtomicExchange32
    80  		return true
    81  	case OpAtomicExchange64:
    82  		v.Op = OpLOONG64LoweredAtomicExchange64
    83  		return true
    84  	case OpAtomicExchange8Variant:
    85  		v.Op = OpLOONG64LoweredAtomicExchange8Variant
    86  		return true
    87  	case OpAtomicLoad32:
    88  		v.Op = OpLOONG64LoweredAtomicLoad32
    89  		return true
    90  	case OpAtomicLoad64:
    91  		v.Op = OpLOONG64LoweredAtomicLoad64
    92  		return true
    93  	case OpAtomicLoad8:
    94  		v.Op = OpLOONG64LoweredAtomicLoad8
    95  		return true
    96  	case OpAtomicLoadPtr:
    97  		v.Op = OpLOONG64LoweredAtomicLoad64
    98  		return true
    99  	case OpAtomicOr32:
   100  		v.Op = OpLOONG64LoweredAtomicOr32
   101  		return true
   102  	case OpAtomicOr32value:
   103  		v.Op = OpLOONG64LoweredAtomicOr32value
   104  		return true
   105  	case OpAtomicOr64value:
   106  		v.Op = OpLOONG64LoweredAtomicOr64value
   107  		return true
   108  	case OpAtomicOr8:
   109  		return rewriteValueLOONG64_OpAtomicOr8(v)
   110  	case OpAtomicStore32:
   111  		v.Op = OpLOONG64LoweredAtomicStore32
   112  		return true
   113  	case OpAtomicStore32Variant:
   114  		v.Op = OpLOONG64LoweredAtomicStore32Variant
   115  		return true
   116  	case OpAtomicStore64:
   117  		v.Op = OpLOONG64LoweredAtomicStore64
   118  		return true
   119  	case OpAtomicStore64Variant:
   120  		v.Op = OpLOONG64LoweredAtomicStore64Variant
   121  		return true
   122  	case OpAtomicStore8:
   123  		v.Op = OpLOONG64LoweredAtomicStore8
   124  		return true
   125  	case OpAtomicStore8Variant:
   126  		v.Op = OpLOONG64LoweredAtomicStore8Variant
   127  		return true
   128  	case OpAtomicStorePtrNoWB:
   129  		v.Op = OpLOONG64LoweredAtomicStore64
   130  		return true
   131  	case OpAvg64u:
   132  		return rewriteValueLOONG64_OpAvg64u(v)
   133  	case OpBitLen16:
   134  		return rewriteValueLOONG64_OpBitLen16(v)
   135  	case OpBitLen32:
   136  		return rewriteValueLOONG64_OpBitLen32(v)
   137  	case OpBitLen64:
   138  		return rewriteValueLOONG64_OpBitLen64(v)
   139  	case OpBitLen8:
   140  		return rewriteValueLOONG64_OpBitLen8(v)
   141  	case OpBitRev16:
   142  		return rewriteValueLOONG64_OpBitRev16(v)
   143  	case OpBitRev32:
   144  		v.Op = OpLOONG64BITREVW
   145  		return true
   146  	case OpBitRev64:
   147  		v.Op = OpLOONG64BITREVV
   148  		return true
   149  	case OpBitRev8:
   150  		v.Op = OpLOONG64BITREV4B
   151  		return true
   152  	case OpBswap16:
   153  		v.Op = OpLOONG64REVB2H
   154  		return true
   155  	case OpBswap32:
   156  		v.Op = OpLOONG64REVB2W
   157  		return true
   158  	case OpBswap64:
   159  		v.Op = OpLOONG64REVBV
   160  		return true
   161  	case OpCeil:
   162  		v.Op = OpLOONG64FRINTPD
   163  		return true
   164  	case OpClosureCall:
   165  		v.Op = OpLOONG64CALLclosure
   166  		return true
   167  	case OpCom16:
   168  		return rewriteValueLOONG64_OpCom16(v)
   169  	case OpCom32:
   170  		return rewriteValueLOONG64_OpCom32(v)
   171  	case OpCom64:
   172  		return rewriteValueLOONG64_OpCom64(v)
   173  	case OpCom8:
   174  		return rewriteValueLOONG64_OpCom8(v)
   175  	case OpCondSelect:
   176  		return rewriteValueLOONG64_OpCondSelect(v)
   177  	case OpConst16:
   178  		return rewriteValueLOONG64_OpConst16(v)
   179  	case OpConst32:
   180  		return rewriteValueLOONG64_OpConst32(v)
   181  	case OpConst32F:
   182  		return rewriteValueLOONG64_OpConst32F(v)
   183  	case OpConst64:
   184  		return rewriteValueLOONG64_OpConst64(v)
   185  	case OpConst64F:
   186  		return rewriteValueLOONG64_OpConst64F(v)
   187  	case OpConst8:
   188  		return rewriteValueLOONG64_OpConst8(v)
   189  	case OpConstBool:
   190  		return rewriteValueLOONG64_OpConstBool(v)
   191  	case OpConstNil:
   192  		return rewriteValueLOONG64_OpConstNil(v)
   193  	case OpCopysign:
   194  		v.Op = OpLOONG64FCOPYSGD
   195  		return true
   196  	case OpCtz16:
   197  		return rewriteValueLOONG64_OpCtz16(v)
   198  	case OpCtz16NonZero:
   199  		v.Op = OpCtz64
   200  		return true
   201  	case OpCtz32:
   202  		v.Op = OpLOONG64CTZW
   203  		return true
   204  	case OpCtz32NonZero:
   205  		v.Op = OpCtz64
   206  		return true
   207  	case OpCtz64:
   208  		v.Op = OpLOONG64CTZV
   209  		return true
   210  	case OpCtz64NonZero:
   211  		v.Op = OpCtz64
   212  		return true
   213  	case OpCtz8:
   214  		return rewriteValueLOONG64_OpCtz8(v)
   215  	case OpCtz8NonZero:
   216  		v.Op = OpCtz64
   217  		return true
   218  	case OpCvt32Fto32:
   219  		v.Op = OpLOONG64TRUNCFW
   220  		return true
   221  	case OpCvt32Fto64:
   222  		v.Op = OpLOONG64TRUNCFV
   223  		return true
   224  	case OpCvt32Fto64F:
   225  		v.Op = OpLOONG64MOVFD
   226  		return true
   227  	case OpCvt32to32F:
   228  		v.Op = OpLOONG64MOVWF
   229  		return true
   230  	case OpCvt32to64F:
   231  		v.Op = OpLOONG64MOVWD
   232  		return true
   233  	case OpCvt64Fto32:
   234  		v.Op = OpLOONG64TRUNCDW
   235  		return true
   236  	case OpCvt64Fto32F:
   237  		v.Op = OpLOONG64MOVDF
   238  		return true
   239  	case OpCvt64Fto64:
   240  		v.Op = OpLOONG64TRUNCDV
   241  		return true
   242  	case OpCvt64to32F:
   243  		v.Op = OpLOONG64MOVVF
   244  		return true
   245  	case OpCvt64to64F:
   246  		v.Op = OpLOONG64MOVVD
   247  		return true
   248  	case OpCvtBoolToUint8:
   249  		v.Op = OpCopy
   250  		return true
   251  	case OpDiv16:
   252  		return rewriteValueLOONG64_OpDiv16(v)
   253  	case OpDiv16u:
   254  		return rewriteValueLOONG64_OpDiv16u(v)
   255  	case OpDiv32:
   256  		return rewriteValueLOONG64_OpDiv32(v)
   257  	case OpDiv32F:
   258  		v.Op = OpLOONG64DIVF
   259  		return true
   260  	case OpDiv32u:
   261  		return rewriteValueLOONG64_OpDiv32u(v)
   262  	case OpDiv64:
   263  		return rewriteValueLOONG64_OpDiv64(v)
   264  	case OpDiv64F:
   265  		v.Op = OpLOONG64DIVD
   266  		return true
   267  	case OpDiv64u:
   268  		v.Op = OpLOONG64DIVVU
   269  		return true
   270  	case OpDiv8:
   271  		return rewriteValueLOONG64_OpDiv8(v)
   272  	case OpDiv8u:
   273  		return rewriteValueLOONG64_OpDiv8u(v)
   274  	case OpEq16:
   275  		return rewriteValueLOONG64_OpEq16(v)
   276  	case OpEq32:
   277  		return rewriteValueLOONG64_OpEq32(v)
   278  	case OpEq32F:
   279  		return rewriteValueLOONG64_OpEq32F(v)
   280  	case OpEq64:
   281  		return rewriteValueLOONG64_OpEq64(v)
   282  	case OpEq64F:
   283  		return rewriteValueLOONG64_OpEq64F(v)
   284  	case OpEq8:
   285  		return rewriteValueLOONG64_OpEq8(v)
   286  	case OpEqB:
   287  		return rewriteValueLOONG64_OpEqB(v)
   288  	case OpEqPtr:
   289  		return rewriteValueLOONG64_OpEqPtr(v)
   290  	case OpFMA:
   291  		v.Op = OpLOONG64FMADDD
   292  		return true
   293  	case OpFloor:
   294  		v.Op = OpLOONG64FRINTMD
   295  		return true
   296  	case OpGetCallerPC:
   297  		v.Op = OpLOONG64LoweredGetCallerPC
   298  		return true
   299  	case OpGetCallerSP:
   300  		v.Op = OpLOONG64LoweredGetCallerSP
   301  		return true
   302  	case OpGetClosurePtr:
   303  		v.Op = OpLOONG64LoweredGetClosurePtr
   304  		return true
   305  	case OpHmul32:
   306  		v.Op = OpLOONG64MULH
   307  		return true
   308  	case OpHmul32u:
   309  		v.Op = OpLOONG64MULHU
   310  		return true
   311  	case OpHmul64:
   312  		v.Op = OpLOONG64MULHV
   313  		return true
   314  	case OpHmul64u:
   315  		v.Op = OpLOONG64MULHVU
   316  		return true
   317  	case OpInterCall:
   318  		v.Op = OpLOONG64CALLinter
   319  		return true
   320  	case OpIsInBounds:
   321  		return rewriteValueLOONG64_OpIsInBounds(v)
   322  	case OpIsNonNil:
   323  		return rewriteValueLOONG64_OpIsNonNil(v)
   324  	case OpIsSliceInBounds:
   325  		return rewriteValueLOONG64_OpIsSliceInBounds(v)
   326  	case OpLOONG64ADDD:
   327  		return rewriteValueLOONG64_OpLOONG64ADDD(v)
   328  	case OpLOONG64ADDF:
   329  		return rewriteValueLOONG64_OpLOONG64ADDF(v)
   330  	case OpLOONG64ADDV:
   331  		return rewriteValueLOONG64_OpLOONG64ADDV(v)
   332  	case OpLOONG64ADDVconst:
   333  		return rewriteValueLOONG64_OpLOONG64ADDVconst(v)
   334  	case OpLOONG64ADDshiftLLV:
   335  		return rewriteValueLOONG64_OpLOONG64ADDshiftLLV(v)
   336  	case OpLOONG64AND:
   337  		return rewriteValueLOONG64_OpLOONG64AND(v)
   338  	case OpLOONG64ANDconst:
   339  		return rewriteValueLOONG64_OpLOONG64ANDconst(v)
   340  	case OpLOONG64DIVV:
   341  		return rewriteValueLOONG64_OpLOONG64DIVV(v)
   342  	case OpLOONG64DIVVU:
   343  		return rewriteValueLOONG64_OpLOONG64DIVVU(v)
   344  	case OpLOONG64LoweredPanicBoundsCR:
   345  		return rewriteValueLOONG64_OpLOONG64LoweredPanicBoundsCR(v)
   346  	case OpLOONG64LoweredPanicBoundsRC:
   347  		return rewriteValueLOONG64_OpLOONG64LoweredPanicBoundsRC(v)
   348  	case OpLOONG64LoweredPanicBoundsRR:
   349  		return rewriteValueLOONG64_OpLOONG64LoweredPanicBoundsRR(v)
   350  	case OpLOONG64MASKEQZ:
   351  		return rewriteValueLOONG64_OpLOONG64MASKEQZ(v)
   352  	case OpLOONG64MASKNEZ:
   353  		return rewriteValueLOONG64_OpLOONG64MASKNEZ(v)
   354  	case OpLOONG64MOVBUload:
   355  		return rewriteValueLOONG64_OpLOONG64MOVBUload(v)
   356  	case OpLOONG64MOVBUloadidx:
   357  		return rewriteValueLOONG64_OpLOONG64MOVBUloadidx(v)
   358  	case OpLOONG64MOVBUreg:
   359  		return rewriteValueLOONG64_OpLOONG64MOVBUreg(v)
   360  	case OpLOONG64MOVBload:
   361  		return rewriteValueLOONG64_OpLOONG64MOVBload(v)
   362  	case OpLOONG64MOVBloadidx:
   363  		return rewriteValueLOONG64_OpLOONG64MOVBloadidx(v)
   364  	case OpLOONG64MOVBreg:
   365  		return rewriteValueLOONG64_OpLOONG64MOVBreg(v)
   366  	case OpLOONG64MOVBstore:
   367  		return rewriteValueLOONG64_OpLOONG64MOVBstore(v)
   368  	case OpLOONG64MOVBstoreidx:
   369  		return rewriteValueLOONG64_OpLOONG64MOVBstoreidx(v)
   370  	case OpLOONG64MOVDF:
   371  		return rewriteValueLOONG64_OpLOONG64MOVDF(v)
   372  	case OpLOONG64MOVDload:
   373  		return rewriteValueLOONG64_OpLOONG64MOVDload(v)
   374  	case OpLOONG64MOVDloadidx:
   375  		return rewriteValueLOONG64_OpLOONG64MOVDloadidx(v)
   376  	case OpLOONG64MOVDstore:
   377  		return rewriteValueLOONG64_OpLOONG64MOVDstore(v)
   378  	case OpLOONG64MOVDstoreidx:
   379  		return rewriteValueLOONG64_OpLOONG64MOVDstoreidx(v)
   380  	case OpLOONG64MOVFload:
   381  		return rewriteValueLOONG64_OpLOONG64MOVFload(v)
   382  	case OpLOONG64MOVFloadidx:
   383  		return rewriteValueLOONG64_OpLOONG64MOVFloadidx(v)
   384  	case OpLOONG64MOVFstore:
   385  		return rewriteValueLOONG64_OpLOONG64MOVFstore(v)
   386  	case OpLOONG64MOVFstoreidx:
   387  		return rewriteValueLOONG64_OpLOONG64MOVFstoreidx(v)
   388  	case OpLOONG64MOVHUload:
   389  		return rewriteValueLOONG64_OpLOONG64MOVHUload(v)
   390  	case OpLOONG64MOVHUloadidx:
   391  		return rewriteValueLOONG64_OpLOONG64MOVHUloadidx(v)
   392  	case OpLOONG64MOVHUreg:
   393  		return rewriteValueLOONG64_OpLOONG64MOVHUreg(v)
   394  	case OpLOONG64MOVHload:
   395  		return rewriteValueLOONG64_OpLOONG64MOVHload(v)
   396  	case OpLOONG64MOVHloadidx:
   397  		return rewriteValueLOONG64_OpLOONG64MOVHloadidx(v)
   398  	case OpLOONG64MOVHreg:
   399  		return rewriteValueLOONG64_OpLOONG64MOVHreg(v)
   400  	case OpLOONG64MOVHstore:
   401  		return rewriteValueLOONG64_OpLOONG64MOVHstore(v)
   402  	case OpLOONG64MOVHstoreidx:
   403  		return rewriteValueLOONG64_OpLOONG64MOVHstoreidx(v)
   404  	case OpLOONG64MOVVload:
   405  		return rewriteValueLOONG64_OpLOONG64MOVVload(v)
   406  	case OpLOONG64MOVVloadidx:
   407  		return rewriteValueLOONG64_OpLOONG64MOVVloadidx(v)
   408  	case OpLOONG64MOVVnop:
   409  		return rewriteValueLOONG64_OpLOONG64MOVVnop(v)
   410  	case OpLOONG64MOVVreg:
   411  		return rewriteValueLOONG64_OpLOONG64MOVVreg(v)
   412  	case OpLOONG64MOVVstore:
   413  		return rewriteValueLOONG64_OpLOONG64MOVVstore(v)
   414  	case OpLOONG64MOVVstoreidx:
   415  		return rewriteValueLOONG64_OpLOONG64MOVVstoreidx(v)
   416  	case OpLOONG64MOVWUload:
   417  		return rewriteValueLOONG64_OpLOONG64MOVWUload(v)
   418  	case OpLOONG64MOVWUloadidx:
   419  		return rewriteValueLOONG64_OpLOONG64MOVWUloadidx(v)
   420  	case OpLOONG64MOVWUreg:
   421  		return rewriteValueLOONG64_OpLOONG64MOVWUreg(v)
   422  	case OpLOONG64MOVWload:
   423  		return rewriteValueLOONG64_OpLOONG64MOVWload(v)
   424  	case OpLOONG64MOVWloadidx:
   425  		return rewriteValueLOONG64_OpLOONG64MOVWloadidx(v)
   426  	case OpLOONG64MOVWreg:
   427  		return rewriteValueLOONG64_OpLOONG64MOVWreg(v)
   428  	case OpLOONG64MOVWstore:
   429  		return rewriteValueLOONG64_OpLOONG64MOVWstore(v)
   430  	case OpLOONG64MOVWstoreidx:
   431  		return rewriteValueLOONG64_OpLOONG64MOVWstoreidx(v)
   432  	case OpLOONG64MULV:
   433  		return rewriteValueLOONG64_OpLOONG64MULV(v)
   434  	case OpLOONG64NEGV:
   435  		return rewriteValueLOONG64_OpLOONG64NEGV(v)
   436  	case OpLOONG64NOR:
   437  		return rewriteValueLOONG64_OpLOONG64NOR(v)
   438  	case OpLOONG64NORconst:
   439  		return rewriteValueLOONG64_OpLOONG64NORconst(v)
   440  	case OpLOONG64OR:
   441  		return rewriteValueLOONG64_OpLOONG64OR(v)
   442  	case OpLOONG64ORN:
   443  		return rewriteValueLOONG64_OpLOONG64ORN(v)
   444  	case OpLOONG64ORconst:
   445  		return rewriteValueLOONG64_OpLOONG64ORconst(v)
   446  	case OpLOONG64REMV:
   447  		return rewriteValueLOONG64_OpLOONG64REMV(v)
   448  	case OpLOONG64REMVU:
   449  		return rewriteValueLOONG64_OpLOONG64REMVU(v)
   450  	case OpLOONG64ROTR:
   451  		return rewriteValueLOONG64_OpLOONG64ROTR(v)
   452  	case OpLOONG64ROTRV:
   453  		return rewriteValueLOONG64_OpLOONG64ROTRV(v)
   454  	case OpLOONG64SGT:
   455  		return rewriteValueLOONG64_OpLOONG64SGT(v)
   456  	case OpLOONG64SGTU:
   457  		return rewriteValueLOONG64_OpLOONG64SGTU(v)
   458  	case OpLOONG64SGTUconst:
   459  		return rewriteValueLOONG64_OpLOONG64SGTUconst(v)
   460  	case OpLOONG64SGTconst:
   461  		return rewriteValueLOONG64_OpLOONG64SGTconst(v)
   462  	case OpLOONG64SLL:
   463  		return rewriteValueLOONG64_OpLOONG64SLL(v)
   464  	case OpLOONG64SLLV:
   465  		return rewriteValueLOONG64_OpLOONG64SLLV(v)
   466  	case OpLOONG64SLLVconst:
   467  		return rewriteValueLOONG64_OpLOONG64SLLVconst(v)
   468  	case OpLOONG64SLLconst:
   469  		return rewriteValueLOONG64_OpLOONG64SLLconst(v)
   470  	case OpLOONG64SRA:
   471  		return rewriteValueLOONG64_OpLOONG64SRA(v)
   472  	case OpLOONG64SRAV:
   473  		return rewriteValueLOONG64_OpLOONG64SRAV(v)
   474  	case OpLOONG64SRAVconst:
   475  		return rewriteValueLOONG64_OpLOONG64SRAVconst(v)
   476  	case OpLOONG64SRL:
   477  		return rewriteValueLOONG64_OpLOONG64SRL(v)
   478  	case OpLOONG64SRLV:
   479  		return rewriteValueLOONG64_OpLOONG64SRLV(v)
   480  	case OpLOONG64SRLVconst:
   481  		return rewriteValueLOONG64_OpLOONG64SRLVconst(v)
   482  	case OpLOONG64SUBD:
   483  		return rewriteValueLOONG64_OpLOONG64SUBD(v)
   484  	case OpLOONG64SUBF:
   485  		return rewriteValueLOONG64_OpLOONG64SUBF(v)
   486  	case OpLOONG64SUBV:
   487  		return rewriteValueLOONG64_OpLOONG64SUBV(v)
   488  	case OpLOONG64SUBVconst:
   489  		return rewriteValueLOONG64_OpLOONG64SUBVconst(v)
   490  	case OpLOONG64XOR:
   491  		return rewriteValueLOONG64_OpLOONG64XOR(v)
   492  	case OpLOONG64XORconst:
   493  		return rewriteValueLOONG64_OpLOONG64XORconst(v)
   494  	case OpLeq16:
   495  		return rewriteValueLOONG64_OpLeq16(v)
   496  	case OpLeq16U:
   497  		return rewriteValueLOONG64_OpLeq16U(v)
   498  	case OpLeq32:
   499  		return rewriteValueLOONG64_OpLeq32(v)
   500  	case OpLeq32F:
   501  		return rewriteValueLOONG64_OpLeq32F(v)
   502  	case OpLeq32U:
   503  		return rewriteValueLOONG64_OpLeq32U(v)
   504  	case OpLeq64:
   505  		return rewriteValueLOONG64_OpLeq64(v)
   506  	case OpLeq64F:
   507  		return rewriteValueLOONG64_OpLeq64F(v)
   508  	case OpLeq64U:
   509  		return rewriteValueLOONG64_OpLeq64U(v)
   510  	case OpLeq8:
   511  		return rewriteValueLOONG64_OpLeq8(v)
   512  	case OpLeq8U:
   513  		return rewriteValueLOONG64_OpLeq8U(v)
   514  	case OpLess16:
   515  		return rewriteValueLOONG64_OpLess16(v)
   516  	case OpLess16U:
   517  		return rewriteValueLOONG64_OpLess16U(v)
   518  	case OpLess32:
   519  		return rewriteValueLOONG64_OpLess32(v)
   520  	case OpLess32F:
   521  		return rewriteValueLOONG64_OpLess32F(v)
   522  	case OpLess32U:
   523  		return rewriteValueLOONG64_OpLess32U(v)
   524  	case OpLess64:
   525  		return rewriteValueLOONG64_OpLess64(v)
   526  	case OpLess64F:
   527  		return rewriteValueLOONG64_OpLess64F(v)
   528  	case OpLess64U:
   529  		return rewriteValueLOONG64_OpLess64U(v)
   530  	case OpLess8:
   531  		return rewriteValueLOONG64_OpLess8(v)
   532  	case OpLess8U:
   533  		return rewriteValueLOONG64_OpLess8U(v)
   534  	case OpLoad:
   535  		return rewriteValueLOONG64_OpLoad(v)
   536  	case OpLocalAddr:
   537  		return rewriteValueLOONG64_OpLocalAddr(v)
   538  	case OpLsh16x16:
   539  		return rewriteValueLOONG64_OpLsh16x16(v)
   540  	case OpLsh16x32:
   541  		return rewriteValueLOONG64_OpLsh16x32(v)
   542  	case OpLsh16x64:
   543  		return rewriteValueLOONG64_OpLsh16x64(v)
   544  	case OpLsh16x8:
   545  		return rewriteValueLOONG64_OpLsh16x8(v)
   546  	case OpLsh32x16:
   547  		return rewriteValueLOONG64_OpLsh32x16(v)
   548  	case OpLsh32x32:
   549  		return rewriteValueLOONG64_OpLsh32x32(v)
   550  	case OpLsh32x64:
   551  		return rewriteValueLOONG64_OpLsh32x64(v)
   552  	case OpLsh32x8:
   553  		return rewriteValueLOONG64_OpLsh32x8(v)
   554  	case OpLsh64x16:
   555  		return rewriteValueLOONG64_OpLsh64x16(v)
   556  	case OpLsh64x32:
   557  		return rewriteValueLOONG64_OpLsh64x32(v)
   558  	case OpLsh64x64:
   559  		return rewriteValueLOONG64_OpLsh64x64(v)
   560  	case OpLsh64x8:
   561  		return rewriteValueLOONG64_OpLsh64x8(v)
   562  	case OpLsh8x16:
   563  		return rewriteValueLOONG64_OpLsh8x16(v)
   564  	case OpLsh8x32:
   565  		return rewriteValueLOONG64_OpLsh8x32(v)
   566  	case OpLsh8x64:
   567  		return rewriteValueLOONG64_OpLsh8x64(v)
   568  	case OpLsh8x8:
   569  		return rewriteValueLOONG64_OpLsh8x8(v)
   570  	case OpMax32F:
   571  		v.Op = OpLOONG64FMAXF
   572  		return true
   573  	case OpMax64F:
   574  		v.Op = OpLOONG64FMAXD
   575  		return true
   576  	case OpMin32F:
   577  		v.Op = OpLOONG64FMINF
   578  		return true
   579  	case OpMin64F:
   580  		v.Op = OpLOONG64FMIND
   581  		return true
   582  	case OpMod16:
   583  		return rewriteValueLOONG64_OpMod16(v)
   584  	case OpMod16u:
   585  		return rewriteValueLOONG64_OpMod16u(v)
   586  	case OpMod32:
   587  		return rewriteValueLOONG64_OpMod32(v)
   588  	case OpMod32u:
   589  		return rewriteValueLOONG64_OpMod32u(v)
   590  	case OpMod64:
   591  		return rewriteValueLOONG64_OpMod64(v)
   592  	case OpMod64u:
   593  		v.Op = OpLOONG64REMVU
   594  		return true
   595  	case OpMod8:
   596  		return rewriteValueLOONG64_OpMod8(v)
   597  	case OpMod8u:
   598  		return rewriteValueLOONG64_OpMod8u(v)
   599  	case OpMove:
   600  		return rewriteValueLOONG64_OpMove(v)
   601  	case OpMul16:
   602  		v.Op = OpLOONG64MULV
   603  		return true
   604  	case OpMul32:
   605  		v.Op = OpLOONG64MULV
   606  		return true
   607  	case OpMul32F:
   608  		v.Op = OpLOONG64MULF
   609  		return true
   610  	case OpMul64:
   611  		v.Op = OpLOONG64MULV
   612  		return true
   613  	case OpMul64F:
   614  		v.Op = OpLOONG64MULD
   615  		return true
   616  	case OpMul8:
   617  		v.Op = OpLOONG64MULV
   618  		return true
   619  	case OpNeg16:
   620  		v.Op = OpLOONG64NEGV
   621  		return true
   622  	case OpNeg32:
   623  		v.Op = OpLOONG64NEGV
   624  		return true
   625  	case OpNeg32F:
   626  		v.Op = OpLOONG64NEGF
   627  		return true
   628  	case OpNeg64:
   629  		v.Op = OpLOONG64NEGV
   630  		return true
   631  	case OpNeg64F:
   632  		v.Op = OpLOONG64NEGD
   633  		return true
   634  	case OpNeg8:
   635  		v.Op = OpLOONG64NEGV
   636  		return true
   637  	case OpNeq16:
   638  		return rewriteValueLOONG64_OpNeq16(v)
   639  	case OpNeq32:
   640  		return rewriteValueLOONG64_OpNeq32(v)
   641  	case OpNeq32F:
   642  		return rewriteValueLOONG64_OpNeq32F(v)
   643  	case OpNeq64:
   644  		return rewriteValueLOONG64_OpNeq64(v)
   645  	case OpNeq64F:
   646  		return rewriteValueLOONG64_OpNeq64F(v)
   647  	case OpNeq8:
   648  		return rewriteValueLOONG64_OpNeq8(v)
   649  	case OpNeqB:
   650  		v.Op = OpLOONG64XOR
   651  		return true
   652  	case OpNeqPtr:
   653  		return rewriteValueLOONG64_OpNeqPtr(v)
   654  	case OpNilCheck:
   655  		v.Op = OpLOONG64LoweredNilCheck
   656  		return true
   657  	case OpNot:
   658  		return rewriteValueLOONG64_OpNot(v)
   659  	case OpOffPtr:
   660  		return rewriteValueLOONG64_OpOffPtr(v)
   661  	case OpOr16:
   662  		v.Op = OpLOONG64OR
   663  		return true
   664  	case OpOr32:
   665  		v.Op = OpLOONG64OR
   666  		return true
   667  	case OpOr64:
   668  		v.Op = OpLOONG64OR
   669  		return true
   670  	case OpOr8:
   671  		v.Op = OpLOONG64OR
   672  		return true
   673  	case OpOrB:
   674  		v.Op = OpLOONG64OR
   675  		return true
   676  	case OpPanicBounds:
   677  		v.Op = OpLOONG64LoweredPanicBoundsRR
   678  		return true
   679  	case OpPopCount16:
   680  		return rewriteValueLOONG64_OpPopCount16(v)
   681  	case OpPopCount32:
   682  		return rewriteValueLOONG64_OpPopCount32(v)
   683  	case OpPopCount64:
   684  		return rewriteValueLOONG64_OpPopCount64(v)
   685  	case OpPrefetchCache:
   686  		return rewriteValueLOONG64_OpPrefetchCache(v)
   687  	case OpPrefetchCacheStreamed:
   688  		return rewriteValueLOONG64_OpPrefetchCacheStreamed(v)
   689  	case OpPubBarrier:
   690  		v.Op = OpLOONG64LoweredPubBarrier
   691  		return true
   692  	case OpRotateLeft16:
   693  		return rewriteValueLOONG64_OpRotateLeft16(v)
   694  	case OpRotateLeft32:
   695  		return rewriteValueLOONG64_OpRotateLeft32(v)
   696  	case OpRotateLeft64:
   697  		return rewriteValueLOONG64_OpRotateLeft64(v)
   698  	case OpRotateLeft8:
   699  		return rewriteValueLOONG64_OpRotateLeft8(v)
   700  	case OpRound32F:
   701  		v.Op = OpLOONG64LoweredRound32F
   702  		return true
   703  	case OpRound64F:
   704  		v.Op = OpLOONG64LoweredRound64F
   705  		return true
   706  	case OpRoundToEven:
   707  		v.Op = OpLOONG64FRINTND
   708  		return true
   709  	case OpRsh16Ux16:
   710  		return rewriteValueLOONG64_OpRsh16Ux16(v)
   711  	case OpRsh16Ux32:
   712  		return rewriteValueLOONG64_OpRsh16Ux32(v)
   713  	case OpRsh16Ux64:
   714  		return rewriteValueLOONG64_OpRsh16Ux64(v)
   715  	case OpRsh16Ux8:
   716  		return rewriteValueLOONG64_OpRsh16Ux8(v)
   717  	case OpRsh16x16:
   718  		return rewriteValueLOONG64_OpRsh16x16(v)
   719  	case OpRsh16x32:
   720  		return rewriteValueLOONG64_OpRsh16x32(v)
   721  	case OpRsh16x64:
   722  		return rewriteValueLOONG64_OpRsh16x64(v)
   723  	case OpRsh16x8:
   724  		return rewriteValueLOONG64_OpRsh16x8(v)
   725  	case OpRsh32Ux16:
   726  		return rewriteValueLOONG64_OpRsh32Ux16(v)
   727  	case OpRsh32Ux32:
   728  		return rewriteValueLOONG64_OpRsh32Ux32(v)
   729  	case OpRsh32Ux64:
   730  		return rewriteValueLOONG64_OpRsh32Ux64(v)
   731  	case OpRsh32Ux8:
   732  		return rewriteValueLOONG64_OpRsh32Ux8(v)
   733  	case OpRsh32x16:
   734  		return rewriteValueLOONG64_OpRsh32x16(v)
   735  	case OpRsh32x32:
   736  		return rewriteValueLOONG64_OpRsh32x32(v)
   737  	case OpRsh32x64:
   738  		return rewriteValueLOONG64_OpRsh32x64(v)
   739  	case OpRsh32x8:
   740  		return rewriteValueLOONG64_OpRsh32x8(v)
   741  	case OpRsh64Ux16:
   742  		return rewriteValueLOONG64_OpRsh64Ux16(v)
   743  	case OpRsh64Ux32:
   744  		return rewriteValueLOONG64_OpRsh64Ux32(v)
   745  	case OpRsh64Ux64:
   746  		return rewriteValueLOONG64_OpRsh64Ux64(v)
   747  	case OpRsh64Ux8:
   748  		return rewriteValueLOONG64_OpRsh64Ux8(v)
   749  	case OpRsh64x16:
   750  		return rewriteValueLOONG64_OpRsh64x16(v)
   751  	case OpRsh64x32:
   752  		return rewriteValueLOONG64_OpRsh64x32(v)
   753  	case OpRsh64x64:
   754  		return rewriteValueLOONG64_OpRsh64x64(v)
   755  	case OpRsh64x8:
   756  		return rewriteValueLOONG64_OpRsh64x8(v)
   757  	case OpRsh8Ux16:
   758  		return rewriteValueLOONG64_OpRsh8Ux16(v)
   759  	case OpRsh8Ux32:
   760  		return rewriteValueLOONG64_OpRsh8Ux32(v)
   761  	case OpRsh8Ux64:
   762  		return rewriteValueLOONG64_OpRsh8Ux64(v)
   763  	case OpRsh8Ux8:
   764  		return rewriteValueLOONG64_OpRsh8Ux8(v)
   765  	case OpRsh8x16:
   766  		return rewriteValueLOONG64_OpRsh8x16(v)
   767  	case OpRsh8x32:
   768  		return rewriteValueLOONG64_OpRsh8x32(v)
   769  	case OpRsh8x64:
   770  		return rewriteValueLOONG64_OpRsh8x64(v)
   771  	case OpRsh8x8:
   772  		return rewriteValueLOONG64_OpRsh8x8(v)
   773  	case OpSelect0:
   774  		return rewriteValueLOONG64_OpSelect0(v)
   775  	case OpSelect1:
   776  		return rewriteValueLOONG64_OpSelect1(v)
   777  	case OpSelectN:
   778  		return rewriteValueLOONG64_OpSelectN(v)
   779  	case OpSignExt16to32:
   780  		v.Op = OpLOONG64MOVHreg
   781  		return true
   782  	case OpSignExt16to64:
   783  		v.Op = OpLOONG64MOVHreg
   784  		return true
   785  	case OpSignExt32to64:
   786  		v.Op = OpLOONG64MOVWreg
   787  		return true
   788  	case OpSignExt8to16:
   789  		v.Op = OpLOONG64MOVBreg
   790  		return true
   791  	case OpSignExt8to32:
   792  		v.Op = OpLOONG64MOVBreg
   793  		return true
   794  	case OpSignExt8to64:
   795  		v.Op = OpLOONG64MOVBreg
   796  		return true
   797  	case OpSlicemask:
   798  		return rewriteValueLOONG64_OpSlicemask(v)
   799  	case OpSqrt:
   800  		v.Op = OpLOONG64SQRTD
   801  		return true
   802  	case OpSqrt32:
   803  		v.Op = OpLOONG64SQRTF
   804  		return true
   805  	case OpStaticCall:
   806  		v.Op = OpLOONG64CALLstatic
   807  		return true
   808  	case OpStore:
   809  		return rewriteValueLOONG64_OpStore(v)
   810  	case OpSub16:
   811  		v.Op = OpLOONG64SUBV
   812  		return true
   813  	case OpSub32:
   814  		v.Op = OpLOONG64SUBV
   815  		return true
   816  	case OpSub32F:
   817  		v.Op = OpLOONG64SUBF
   818  		return true
   819  	case OpSub64:
   820  		v.Op = OpLOONG64SUBV
   821  		return true
   822  	case OpSub64F:
   823  		v.Op = OpLOONG64SUBD
   824  		return true
   825  	case OpSub8:
   826  		v.Op = OpLOONG64SUBV
   827  		return true
   828  	case OpSubPtr:
   829  		v.Op = OpLOONG64SUBV
   830  		return true
   831  	case OpTailCall:
   832  		v.Op = OpLOONG64CALLtail
   833  		return true
   834  	case OpTailCallInter:
   835  		v.Op = OpLOONG64CALLtailinter
   836  		return true
   837  	case OpTrunc:
   838  		v.Op = OpLOONG64FRINTZD
   839  		return true
   840  	case OpTrunc16to8:
   841  		v.Op = OpCopy
   842  		return true
   843  	case OpTrunc32to16:
   844  		v.Op = OpCopy
   845  		return true
   846  	case OpTrunc32to8:
   847  		v.Op = OpCopy
   848  		return true
   849  	case OpTrunc64to16:
   850  		v.Op = OpCopy
   851  		return true
   852  	case OpTrunc64to32:
   853  		v.Op = OpCopy
   854  		return true
   855  	case OpTrunc64to8:
   856  		v.Op = OpCopy
   857  		return true
   858  	case OpWB:
   859  		v.Op = OpLOONG64LoweredWB
   860  		return true
   861  	case OpXor16:
   862  		v.Op = OpLOONG64XOR
   863  		return true
   864  	case OpXor32:
   865  		v.Op = OpLOONG64XOR
   866  		return true
   867  	case OpXor64:
   868  		v.Op = OpLOONG64XOR
   869  		return true
   870  	case OpXor8:
   871  		v.Op = OpLOONG64XOR
   872  		return true
   873  	case OpZero:
   874  		return rewriteValueLOONG64_OpZero(v)
   875  	case OpZeroExt16to32:
   876  		v.Op = OpLOONG64MOVHUreg
   877  		return true
   878  	case OpZeroExt16to64:
   879  		v.Op = OpLOONG64MOVHUreg
   880  		return true
   881  	case OpZeroExt32to64:
   882  		v.Op = OpLOONG64MOVWUreg
   883  		return true
   884  	case OpZeroExt8to16:
   885  		v.Op = OpLOONG64MOVBUreg
   886  		return true
   887  	case OpZeroExt8to32:
   888  		v.Op = OpLOONG64MOVBUreg
   889  		return true
   890  	case OpZeroExt8to64:
   891  		v.Op = OpLOONG64MOVBUreg
   892  		return true
   893  	}
   894  	return false
   895  }
   896  func rewriteValueLOONG64_OpAddr(v *Value) bool {
   897  	v_0 := v.Args[0]
   898  	// match: (Addr {sym} base)
   899  	// result: (MOVVaddr {sym} base)
   900  	for {
   901  		sym := auxToSym(v.Aux)
   902  		base := v_0
   903  		v.reset(OpLOONG64MOVVaddr)
   904  		v.Aux = symToAux(sym)
   905  		v.AddArg(base)
   906  		return true
   907  	}
   908  }
   909  func rewriteValueLOONG64_OpAtomicAnd8(v *Value) bool {
   910  	v_2 := v.Args[2]
   911  	v_1 := v.Args[1]
   912  	v_0 := v.Args[0]
   913  	b := v.Block
   914  	typ := &b.Func.Config.Types
   915  	// match: (AtomicAnd8 ptr val mem)
   916  	// 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)
   917  	for {
   918  		ptr := v_0
   919  		val := v_1
   920  		mem := v_2
   921  		v.reset(OpLOONG64LoweredAtomicAnd32)
   922  		v0 := b.NewValue0(v.Pos, OpLOONG64AND, typ.Uintptr)
   923  		v1 := b.NewValue0(v.Pos, OpLOONG64MOVVconst, typ.UInt64)
   924  		v1.AuxInt = int64ToAuxInt(^3)
   925  		v0.AddArg2(v1, ptr)
   926  		v2 := b.NewValue0(v.Pos, OpLOONG64NORconst, typ.UInt32)
   927  		v2.AuxInt = int64ToAuxInt(0)
   928  		v3 := b.NewValue0(v.Pos, OpLOONG64SLLV, typ.UInt32)
   929  		v4 := b.NewValue0(v.Pos, OpLOONG64XORconst, typ.UInt32)
   930  		v4.AuxInt = int64ToAuxInt(0xff)
   931  		v5 := b.NewValue0(v.Pos, OpZeroExt8to32, typ.UInt32)
   932  		v5.AddArg(val)
   933  		v4.AddArg(v5)
   934  		v6 := b.NewValue0(v.Pos, OpLOONG64SLLVconst, typ.UInt64)
   935  		v6.AuxInt = int64ToAuxInt(3)
   936  		v7 := b.NewValue0(v.Pos, OpLOONG64ANDconst, typ.UInt64)
   937  		v7.AuxInt = int64ToAuxInt(3)
   938  		v7.AddArg(ptr)
   939  		v6.AddArg(v7)
   940  		v3.AddArg2(v4, v6)
   941  		v2.AddArg(v3)
   942  		v.AddArg3(v0, v2, mem)
   943  		return true
   944  	}
   945  }
   946  func rewriteValueLOONG64_OpAtomicCompareAndSwap32(v *Value) bool {
   947  	v_3 := v.Args[3]
   948  	v_2 := v.Args[2]
   949  	v_1 := v.Args[1]
   950  	v_0 := v.Args[0]
   951  	b := v.Block
   952  	typ := &b.Func.Config.Types
   953  	// match: (AtomicCompareAndSwap32 ptr old new mem)
   954  	// result: (LoweredAtomicCas32 ptr (SignExt32to64 old) new mem)
   955  	for {
   956  		ptr := v_0
   957  		old := v_1
   958  		new := v_2
   959  		mem := v_3
   960  		v.reset(OpLOONG64LoweredAtomicCas32)
   961  		v0 := b.NewValue0(v.Pos, OpSignExt32to64, typ.Int64)
   962  		v0.AddArg(old)
   963  		v.AddArg4(ptr, v0, new, mem)
   964  		return true
   965  	}
   966  }
   967  func rewriteValueLOONG64_OpAtomicCompareAndSwap32Variant(v *Value) bool {
   968  	v_3 := v.Args[3]
   969  	v_2 := v.Args[2]
   970  	v_1 := v.Args[1]
   971  	v_0 := v.Args[0]
   972  	b := v.Block
   973  	typ := &b.Func.Config.Types
   974  	// match: (AtomicCompareAndSwap32Variant ptr old new mem)
   975  	// result: (LoweredAtomicCas32Variant ptr (SignExt32to64 old) new mem)
   976  	for {
   977  		ptr := v_0
   978  		old := v_1
   979  		new := v_2
   980  		mem := v_3
   981  		v.reset(OpLOONG64LoweredAtomicCas32Variant)
   982  		v0 := b.NewValue0(v.Pos, OpSignExt32to64, typ.Int64)
   983  		v0.AddArg(old)
   984  		v.AddArg4(ptr, v0, new, mem)
   985  		return true
   986  	}
   987  }
   988  func rewriteValueLOONG64_OpAtomicOr8(v *Value) bool {
   989  	v_2 := v.Args[2]
   990  	v_1 := v.Args[1]
   991  	v_0 := v.Args[0]
   992  	b := v.Block
   993  	typ := &b.Func.Config.Types
   994  	// match: (AtomicOr8 ptr val mem)
   995  	// result: (LoweredAtomicOr32 (AND <typ.Uintptr> (MOVVconst [^3]) ptr) (SLLV <typ.UInt32> (ZeroExt8to32 val) (SLLVconst <typ.UInt64> [3] (ANDconst <typ.UInt64> [3] ptr))) mem)
   996  	for {
   997  		ptr := v_0
   998  		val := v_1
   999  		mem := v_2
  1000  		v.reset(OpLOONG64LoweredAtomicOr32)
  1001  		v0 := b.NewValue0(v.Pos, OpLOONG64AND, typ.Uintptr)
  1002  		v1 := b.NewValue0(v.Pos, OpLOONG64MOVVconst, typ.UInt64)
  1003  		v1.AuxInt = int64ToAuxInt(^3)
  1004  		v0.AddArg2(v1, ptr)
  1005  		v2 := b.NewValue0(v.Pos, OpLOONG64SLLV, typ.UInt32)
  1006  		v3 := b.NewValue0(v.Pos, OpZeroExt8to32, typ.UInt32)
  1007  		v3.AddArg(val)
  1008  		v4 := b.NewValue0(v.Pos, OpLOONG64SLLVconst, typ.UInt64)
  1009  		v4.AuxInt = int64ToAuxInt(3)
  1010  		v5 := b.NewValue0(v.Pos, OpLOONG64ANDconst, typ.UInt64)
  1011  		v5.AuxInt = int64ToAuxInt(3)
  1012  		v5.AddArg(ptr)
  1013  		v4.AddArg(v5)
  1014  		v2.AddArg2(v3, v4)
  1015  		v.AddArg3(v0, v2, mem)
  1016  		return true
  1017  	}
  1018  }
  1019  func rewriteValueLOONG64_OpAvg64u(v *Value) bool {
  1020  	v_1 := v.Args[1]
  1021  	v_0 := v.Args[0]
  1022  	b := v.Block
  1023  	// match: (Avg64u <t> x y)
  1024  	// result: (ADDV (SRLVconst <t> (SUBV <t> x y) [1]) y)
  1025  	for {
  1026  		t := v.Type
  1027  		x := v_0
  1028  		y := v_1
  1029  		v.reset(OpLOONG64ADDV)
  1030  		v0 := b.NewValue0(v.Pos, OpLOONG64SRLVconst, t)
  1031  		v0.AuxInt = int64ToAuxInt(1)
  1032  		v1 := b.NewValue0(v.Pos, OpLOONG64SUBV, t)
  1033  		v1.AddArg2(x, y)
  1034  		v0.AddArg(v1)
  1035  		v.AddArg2(v0, y)
  1036  		return true
  1037  	}
  1038  }
  1039  func rewriteValueLOONG64_OpBitLen16(v *Value) bool {
  1040  	v_0 := v.Args[0]
  1041  	b := v.Block
  1042  	typ := &b.Func.Config.Types
  1043  	// match: (BitLen16 x)
  1044  	// result: (BitLen64 (ZeroExt16to64 x))
  1045  	for {
  1046  		x := v_0
  1047  		v.reset(OpBitLen64)
  1048  		v0 := b.NewValue0(v.Pos, OpZeroExt16to64, typ.UInt64)
  1049  		v0.AddArg(x)
  1050  		v.AddArg(v0)
  1051  		return true
  1052  	}
  1053  }
  1054  func rewriteValueLOONG64_OpBitLen32(v *Value) bool {
  1055  	v_0 := v.Args[0]
  1056  	b := v.Block
  1057  	// match: (BitLen32 <t> x)
  1058  	// result: (NEGV <t> (SUBVconst <t> [32] (CLZW <t> x)))
  1059  	for {
  1060  		t := v.Type
  1061  		x := v_0
  1062  		v.reset(OpLOONG64NEGV)
  1063  		v.Type = t
  1064  		v0 := b.NewValue0(v.Pos, OpLOONG64SUBVconst, t)
  1065  		v0.AuxInt = int64ToAuxInt(32)
  1066  		v1 := b.NewValue0(v.Pos, OpLOONG64CLZW, t)
  1067  		v1.AddArg(x)
  1068  		v0.AddArg(v1)
  1069  		v.AddArg(v0)
  1070  		return true
  1071  	}
  1072  }
  1073  func rewriteValueLOONG64_OpBitLen64(v *Value) bool {
  1074  	v_0 := v.Args[0]
  1075  	b := v.Block
  1076  	// match: (BitLen64 <t> x)
  1077  	// result: (NEGV <t> (SUBVconst <t> [64] (CLZV <t> x)))
  1078  	for {
  1079  		t := v.Type
  1080  		x := v_0
  1081  		v.reset(OpLOONG64NEGV)
  1082  		v.Type = t
  1083  		v0 := b.NewValue0(v.Pos, OpLOONG64SUBVconst, t)
  1084  		v0.AuxInt = int64ToAuxInt(64)
  1085  		v1 := b.NewValue0(v.Pos, OpLOONG64CLZV, t)
  1086  		v1.AddArg(x)
  1087  		v0.AddArg(v1)
  1088  		v.AddArg(v0)
  1089  		return true
  1090  	}
  1091  }
  1092  func rewriteValueLOONG64_OpBitLen8(v *Value) bool {
  1093  	v_0 := v.Args[0]
  1094  	b := v.Block
  1095  	typ := &b.Func.Config.Types
  1096  	// match: (BitLen8 x)
  1097  	// result: (BitLen64 (ZeroExt8to64 x))
  1098  	for {
  1099  		x := v_0
  1100  		v.reset(OpBitLen64)
  1101  		v0 := b.NewValue0(v.Pos, OpZeroExt8to64, typ.UInt64)
  1102  		v0.AddArg(x)
  1103  		v.AddArg(v0)
  1104  		return true
  1105  	}
  1106  }
  1107  func rewriteValueLOONG64_OpBitRev16(v *Value) bool {
  1108  	v_0 := v.Args[0]
  1109  	b := v.Block
  1110  	// match: (BitRev16 <t> x)
  1111  	// result: (REVB2H (BITREV4B <t> x))
  1112  	for {
  1113  		t := v.Type
  1114  		x := v_0
  1115  		v.reset(OpLOONG64REVB2H)
  1116  		v0 := b.NewValue0(v.Pos, OpLOONG64BITREV4B, t)
  1117  		v0.AddArg(x)
  1118  		v.AddArg(v0)
  1119  		return true
  1120  	}
  1121  }
  1122  func rewriteValueLOONG64_OpCom16(v *Value) bool {
  1123  	v_0 := v.Args[0]
  1124  	b := v.Block
  1125  	typ := &b.Func.Config.Types
  1126  	// match: (Com16 x)
  1127  	// result: (NOR (MOVVconst [0]) x)
  1128  	for {
  1129  		x := v_0
  1130  		v.reset(OpLOONG64NOR)
  1131  		v0 := b.NewValue0(v.Pos, OpLOONG64MOVVconst, typ.UInt64)
  1132  		v0.AuxInt = int64ToAuxInt(0)
  1133  		v.AddArg2(v0, x)
  1134  		return true
  1135  	}
  1136  }
  1137  func rewriteValueLOONG64_OpCom32(v *Value) bool {
  1138  	v_0 := v.Args[0]
  1139  	b := v.Block
  1140  	typ := &b.Func.Config.Types
  1141  	// match: (Com32 x)
  1142  	// result: (NOR (MOVVconst [0]) x)
  1143  	for {
  1144  		x := v_0
  1145  		v.reset(OpLOONG64NOR)
  1146  		v0 := b.NewValue0(v.Pos, OpLOONG64MOVVconst, typ.UInt64)
  1147  		v0.AuxInt = int64ToAuxInt(0)
  1148  		v.AddArg2(v0, x)
  1149  		return true
  1150  	}
  1151  }
  1152  func rewriteValueLOONG64_OpCom64(v *Value) bool {
  1153  	v_0 := v.Args[0]
  1154  	b := v.Block
  1155  	typ := &b.Func.Config.Types
  1156  	// match: (Com64 x)
  1157  	// result: (NOR (MOVVconst [0]) x)
  1158  	for {
  1159  		x := v_0
  1160  		v.reset(OpLOONG64NOR)
  1161  		v0 := b.NewValue0(v.Pos, OpLOONG64MOVVconst, typ.UInt64)
  1162  		v0.AuxInt = int64ToAuxInt(0)
  1163  		v.AddArg2(v0, x)
  1164  		return true
  1165  	}
  1166  }
  1167  func rewriteValueLOONG64_OpCom8(v *Value) bool {
  1168  	v_0 := v.Args[0]
  1169  	b := v.Block
  1170  	typ := &b.Func.Config.Types
  1171  	// match: (Com8 x)
  1172  	// result: (NOR (MOVVconst [0]) x)
  1173  	for {
  1174  		x := v_0
  1175  		v.reset(OpLOONG64NOR)
  1176  		v0 := b.NewValue0(v.Pos, OpLOONG64MOVVconst, typ.UInt64)
  1177  		v0.AuxInt = int64ToAuxInt(0)
  1178  		v.AddArg2(v0, x)
  1179  		return true
  1180  	}
  1181  }
  1182  func rewriteValueLOONG64_OpCondSelect(v *Value) bool {
  1183  	v_2 := v.Args[2]
  1184  	v_1 := v.Args[1]
  1185  	v_0 := v.Args[0]
  1186  	b := v.Block
  1187  	// match: (CondSelect <t> x y cond)
  1188  	// result: (OR (MASKEQZ <t> x cond) (MASKNEZ <t> y cond))
  1189  	for {
  1190  		t := v.Type
  1191  		x := v_0
  1192  		y := v_1
  1193  		cond := v_2
  1194  		v.reset(OpLOONG64OR)
  1195  		v0 := b.NewValue0(v.Pos, OpLOONG64MASKEQZ, t)
  1196  		v0.AddArg2(x, cond)
  1197  		v1 := b.NewValue0(v.Pos, OpLOONG64MASKNEZ, t)
  1198  		v1.AddArg2(y, cond)
  1199  		v.AddArg2(v0, v1)
  1200  		return true
  1201  	}
  1202  }
  1203  func rewriteValueLOONG64_OpConst16(v *Value) bool {
  1204  	// match: (Const16 [val])
  1205  	// result: (MOVVconst [int64(val)])
  1206  	for {
  1207  		val := auxIntToInt16(v.AuxInt)
  1208  		v.reset(OpLOONG64MOVVconst)
  1209  		v.AuxInt = int64ToAuxInt(int64(val))
  1210  		return true
  1211  	}
  1212  }
  1213  func rewriteValueLOONG64_OpConst32(v *Value) bool {
  1214  	// match: (Const32 [val])
  1215  	// result: (MOVVconst [int64(val)])
  1216  	for {
  1217  		val := auxIntToInt32(v.AuxInt)
  1218  		v.reset(OpLOONG64MOVVconst)
  1219  		v.AuxInt = int64ToAuxInt(int64(val))
  1220  		return true
  1221  	}
  1222  }
  1223  func rewriteValueLOONG64_OpConst32F(v *Value) bool {
  1224  	// match: (Const32F [val])
  1225  	// result: (MOVFconst [float64(val)])
  1226  	for {
  1227  		val := auxIntToFloat32(v.AuxInt)
  1228  		v.reset(OpLOONG64MOVFconst)
  1229  		v.AuxInt = float64ToAuxInt(float64(val))
  1230  		return true
  1231  	}
  1232  }
  1233  func rewriteValueLOONG64_OpConst64(v *Value) bool {
  1234  	// match: (Const64 [val])
  1235  	// result: (MOVVconst [int64(val)])
  1236  	for {
  1237  		val := auxIntToInt64(v.AuxInt)
  1238  		v.reset(OpLOONG64MOVVconst)
  1239  		v.AuxInt = int64ToAuxInt(int64(val))
  1240  		return true
  1241  	}
  1242  }
  1243  func rewriteValueLOONG64_OpConst64F(v *Value) bool {
  1244  	// match: (Const64F [val])
  1245  	// result: (MOVDconst [float64(val)])
  1246  	for {
  1247  		val := auxIntToFloat64(v.AuxInt)
  1248  		v.reset(OpLOONG64MOVDconst)
  1249  		v.AuxInt = float64ToAuxInt(float64(val))
  1250  		return true
  1251  	}
  1252  }
  1253  func rewriteValueLOONG64_OpConst8(v *Value) bool {
  1254  	// match: (Const8 [val])
  1255  	// result: (MOVVconst [int64(val)])
  1256  	for {
  1257  		val := auxIntToInt8(v.AuxInt)
  1258  		v.reset(OpLOONG64MOVVconst)
  1259  		v.AuxInt = int64ToAuxInt(int64(val))
  1260  		return true
  1261  	}
  1262  }
  1263  func rewriteValueLOONG64_OpConstBool(v *Value) bool {
  1264  	// match: (ConstBool [t])
  1265  	// result: (MOVVconst [int64(b2i(t))])
  1266  	for {
  1267  		t := auxIntToBool(v.AuxInt)
  1268  		v.reset(OpLOONG64MOVVconst)
  1269  		v.AuxInt = int64ToAuxInt(int64(b2i(t)))
  1270  		return true
  1271  	}
  1272  }
  1273  func rewriteValueLOONG64_OpConstNil(v *Value) bool {
  1274  	// match: (ConstNil)
  1275  	// result: (MOVVconst [0])
  1276  	for {
  1277  		v.reset(OpLOONG64MOVVconst)
  1278  		v.AuxInt = int64ToAuxInt(0)
  1279  		return true
  1280  	}
  1281  }
  1282  func rewriteValueLOONG64_OpCtz16(v *Value) bool {
  1283  	v_0 := v.Args[0]
  1284  	b := v.Block
  1285  	typ := &b.Func.Config.Types
  1286  	// match: (Ctz16 x)
  1287  	// result: (CTZV (OR <typ.UInt64> x (MOVVconst [1<<16])))
  1288  	for {
  1289  		x := v_0
  1290  		v.reset(OpLOONG64CTZV)
  1291  		v0 := b.NewValue0(v.Pos, OpLOONG64OR, typ.UInt64)
  1292  		v1 := b.NewValue0(v.Pos, OpLOONG64MOVVconst, typ.UInt64)
  1293  		v1.AuxInt = int64ToAuxInt(1 << 16)
  1294  		v0.AddArg2(x, v1)
  1295  		v.AddArg(v0)
  1296  		return true
  1297  	}
  1298  }
  1299  func rewriteValueLOONG64_OpCtz8(v *Value) bool {
  1300  	v_0 := v.Args[0]
  1301  	b := v.Block
  1302  	typ := &b.Func.Config.Types
  1303  	// match: (Ctz8 x)
  1304  	// result: (CTZV (OR <typ.UInt64> x (MOVVconst [1<<8])))
  1305  	for {
  1306  		x := v_0
  1307  		v.reset(OpLOONG64CTZV)
  1308  		v0 := b.NewValue0(v.Pos, OpLOONG64OR, typ.UInt64)
  1309  		v1 := b.NewValue0(v.Pos, OpLOONG64MOVVconst, typ.UInt64)
  1310  		v1.AuxInt = int64ToAuxInt(1 << 8)
  1311  		v0.AddArg2(x, v1)
  1312  		v.AddArg(v0)
  1313  		return true
  1314  	}
  1315  }
  1316  func rewriteValueLOONG64_OpDiv16(v *Value) bool {
  1317  	v_1 := v.Args[1]
  1318  	v_0 := v.Args[0]
  1319  	b := v.Block
  1320  	typ := &b.Func.Config.Types
  1321  	// match: (Div16 x y)
  1322  	// result: (DIVV (SignExt16to64 x) (SignExt16to64 y))
  1323  	for {
  1324  		x := v_0
  1325  		y := v_1
  1326  		v.reset(OpLOONG64DIVV)
  1327  		v0 := b.NewValue0(v.Pos, OpSignExt16to64, typ.Int64)
  1328  		v0.AddArg(x)
  1329  		v1 := b.NewValue0(v.Pos, OpSignExt16to64, typ.Int64)
  1330  		v1.AddArg(y)
  1331  		v.AddArg2(v0, v1)
  1332  		return true
  1333  	}
  1334  }
  1335  func rewriteValueLOONG64_OpDiv16u(v *Value) bool {
  1336  	v_1 := v.Args[1]
  1337  	v_0 := v.Args[0]
  1338  	b := v.Block
  1339  	typ := &b.Func.Config.Types
  1340  	// match: (Div16u x y)
  1341  	// result: (DIVVU (ZeroExt16to64 x) (ZeroExt16to64 y))
  1342  	for {
  1343  		x := v_0
  1344  		y := v_1
  1345  		v.reset(OpLOONG64DIVVU)
  1346  		v0 := b.NewValue0(v.Pos, OpZeroExt16to64, typ.UInt64)
  1347  		v0.AddArg(x)
  1348  		v1 := b.NewValue0(v.Pos, OpZeroExt16to64, typ.UInt64)
  1349  		v1.AddArg(y)
  1350  		v.AddArg2(v0, v1)
  1351  		return true
  1352  	}
  1353  }
  1354  func rewriteValueLOONG64_OpDiv32(v *Value) bool {
  1355  	v_1 := v.Args[1]
  1356  	v_0 := v.Args[0]
  1357  	b := v.Block
  1358  	typ := &b.Func.Config.Types
  1359  	// match: (Div32 x y)
  1360  	// result: (DIVV (SignExt32to64 x) (SignExt32to64 y))
  1361  	for {
  1362  		x := v_0
  1363  		y := v_1
  1364  		v.reset(OpLOONG64DIVV)
  1365  		v0 := b.NewValue0(v.Pos, OpSignExt32to64, typ.Int64)
  1366  		v0.AddArg(x)
  1367  		v1 := b.NewValue0(v.Pos, OpSignExt32to64, typ.Int64)
  1368  		v1.AddArg(y)
  1369  		v.AddArg2(v0, v1)
  1370  		return true
  1371  	}
  1372  }
  1373  func rewriteValueLOONG64_OpDiv32u(v *Value) bool {
  1374  	v_1 := v.Args[1]
  1375  	v_0 := v.Args[0]
  1376  	b := v.Block
  1377  	typ := &b.Func.Config.Types
  1378  	// match: (Div32u x y)
  1379  	// result: (DIVVU (ZeroExt32to64 x) (ZeroExt32to64 y))
  1380  	for {
  1381  		x := v_0
  1382  		y := v_1
  1383  		v.reset(OpLOONG64DIVVU)
  1384  		v0 := b.NewValue0(v.Pos, OpZeroExt32to64, typ.UInt64)
  1385  		v0.AddArg(x)
  1386  		v1 := b.NewValue0(v.Pos, OpZeroExt32to64, typ.UInt64)
  1387  		v1.AddArg(y)
  1388  		v.AddArg2(v0, v1)
  1389  		return true
  1390  	}
  1391  }
  1392  func rewriteValueLOONG64_OpDiv64(v *Value) bool {
  1393  	v_1 := v.Args[1]
  1394  	v_0 := v.Args[0]
  1395  	// match: (Div64 x y)
  1396  	// result: (DIVV x y)
  1397  	for {
  1398  		x := v_0
  1399  		y := v_1
  1400  		v.reset(OpLOONG64DIVV)
  1401  		v.AddArg2(x, y)
  1402  		return true
  1403  	}
  1404  }
  1405  func rewriteValueLOONG64_OpDiv8(v *Value) bool {
  1406  	v_1 := v.Args[1]
  1407  	v_0 := v.Args[0]
  1408  	b := v.Block
  1409  	typ := &b.Func.Config.Types
  1410  	// match: (Div8 x y)
  1411  	// result: (DIVV (SignExt8to64 x) (SignExt8to64 y))
  1412  	for {
  1413  		x := v_0
  1414  		y := v_1
  1415  		v.reset(OpLOONG64DIVV)
  1416  		v0 := b.NewValue0(v.Pos, OpSignExt8to64, typ.Int64)
  1417  		v0.AddArg(x)
  1418  		v1 := b.NewValue0(v.Pos, OpSignExt8to64, typ.Int64)
  1419  		v1.AddArg(y)
  1420  		v.AddArg2(v0, v1)
  1421  		return true
  1422  	}
  1423  }
  1424  func rewriteValueLOONG64_OpDiv8u(v *Value) bool {
  1425  	v_1 := v.Args[1]
  1426  	v_0 := v.Args[0]
  1427  	b := v.Block
  1428  	typ := &b.Func.Config.Types
  1429  	// match: (Div8u x y)
  1430  	// result: (DIVVU (ZeroExt8to64 x) (ZeroExt8to64 y))
  1431  	for {
  1432  		x := v_0
  1433  		y := v_1
  1434  		v.reset(OpLOONG64DIVVU)
  1435  		v0 := b.NewValue0(v.Pos, OpZeroExt8to64, typ.UInt64)
  1436  		v0.AddArg(x)
  1437  		v1 := b.NewValue0(v.Pos, OpZeroExt8to64, typ.UInt64)
  1438  		v1.AddArg(y)
  1439  		v.AddArg2(v0, v1)
  1440  		return true
  1441  	}
  1442  }
  1443  func rewriteValueLOONG64_OpEq16(v *Value) bool {
  1444  	v_1 := v.Args[1]
  1445  	v_0 := v.Args[0]
  1446  	b := v.Block
  1447  	typ := &b.Func.Config.Types
  1448  	// match: (Eq16 x y)
  1449  	// result: (SGTU (MOVVconst [1]) (XOR (ZeroExt16to64 x) (ZeroExt16to64 y)))
  1450  	for {
  1451  		x := v_0
  1452  		y := v_1
  1453  		v.reset(OpLOONG64SGTU)
  1454  		v0 := b.NewValue0(v.Pos, OpLOONG64MOVVconst, typ.UInt64)
  1455  		v0.AuxInt = int64ToAuxInt(1)
  1456  		v1 := b.NewValue0(v.Pos, OpLOONG64XOR, typ.UInt64)
  1457  		v2 := b.NewValue0(v.Pos, OpZeroExt16to64, typ.UInt64)
  1458  		v2.AddArg(x)
  1459  		v3 := b.NewValue0(v.Pos, OpZeroExt16to64, typ.UInt64)
  1460  		v3.AddArg(y)
  1461  		v1.AddArg2(v2, v3)
  1462  		v.AddArg2(v0, v1)
  1463  		return true
  1464  	}
  1465  }
  1466  func rewriteValueLOONG64_OpEq32(v *Value) bool {
  1467  	v_1 := v.Args[1]
  1468  	v_0 := v.Args[0]
  1469  	b := v.Block
  1470  	typ := &b.Func.Config.Types
  1471  	// match: (Eq32 x y)
  1472  	// result: (SGTU (MOVVconst [1]) (XOR (ZeroExt32to64 x) (ZeroExt32to64 y)))
  1473  	for {
  1474  		x := v_0
  1475  		y := v_1
  1476  		v.reset(OpLOONG64SGTU)
  1477  		v0 := b.NewValue0(v.Pos, OpLOONG64MOVVconst, typ.UInt64)
  1478  		v0.AuxInt = int64ToAuxInt(1)
  1479  		v1 := b.NewValue0(v.Pos, OpLOONG64XOR, typ.UInt64)
  1480  		v2 := b.NewValue0(v.Pos, OpZeroExt32to64, typ.UInt64)
  1481  		v2.AddArg(x)
  1482  		v3 := b.NewValue0(v.Pos, OpZeroExt32to64, typ.UInt64)
  1483  		v3.AddArg(y)
  1484  		v1.AddArg2(v2, v3)
  1485  		v.AddArg2(v0, v1)
  1486  		return true
  1487  	}
  1488  }
  1489  func rewriteValueLOONG64_OpEq32F(v *Value) bool {
  1490  	v_1 := v.Args[1]
  1491  	v_0 := v.Args[0]
  1492  	b := v.Block
  1493  	// match: (Eq32F x y)
  1494  	// result: (FPFlagTrue (CMPEQF x y))
  1495  	for {
  1496  		x := v_0
  1497  		y := v_1
  1498  		v.reset(OpLOONG64FPFlagTrue)
  1499  		v0 := b.NewValue0(v.Pos, OpLOONG64CMPEQF, types.TypeFlags)
  1500  		v0.AddArg2(x, y)
  1501  		v.AddArg(v0)
  1502  		return true
  1503  	}
  1504  }
  1505  func rewriteValueLOONG64_OpEq64(v *Value) bool {
  1506  	v_1 := v.Args[1]
  1507  	v_0 := v.Args[0]
  1508  	b := v.Block
  1509  	typ := &b.Func.Config.Types
  1510  	// match: (Eq64 x y)
  1511  	// result: (SGTU (MOVVconst [1]) (XOR x y))
  1512  	for {
  1513  		x := v_0
  1514  		y := v_1
  1515  		v.reset(OpLOONG64SGTU)
  1516  		v0 := b.NewValue0(v.Pos, OpLOONG64MOVVconst, typ.UInt64)
  1517  		v0.AuxInt = int64ToAuxInt(1)
  1518  		v1 := b.NewValue0(v.Pos, OpLOONG64XOR, typ.UInt64)
  1519  		v1.AddArg2(x, y)
  1520  		v.AddArg2(v0, v1)
  1521  		return true
  1522  	}
  1523  }
  1524  func rewriteValueLOONG64_OpEq64F(v *Value) bool {
  1525  	v_1 := v.Args[1]
  1526  	v_0 := v.Args[0]
  1527  	b := v.Block
  1528  	// match: (Eq64F x y)
  1529  	// result: (FPFlagTrue (CMPEQD x y))
  1530  	for {
  1531  		x := v_0
  1532  		y := v_1
  1533  		v.reset(OpLOONG64FPFlagTrue)
  1534  		v0 := b.NewValue0(v.Pos, OpLOONG64CMPEQD, types.TypeFlags)
  1535  		v0.AddArg2(x, y)
  1536  		v.AddArg(v0)
  1537  		return true
  1538  	}
  1539  }
  1540  func rewriteValueLOONG64_OpEq8(v *Value) bool {
  1541  	v_1 := v.Args[1]
  1542  	v_0 := v.Args[0]
  1543  	b := v.Block
  1544  	typ := &b.Func.Config.Types
  1545  	// match: (Eq8 x y)
  1546  	// result: (SGTU (MOVVconst [1]) (XOR (ZeroExt8to64 x) (ZeroExt8to64 y)))
  1547  	for {
  1548  		x := v_0
  1549  		y := v_1
  1550  		v.reset(OpLOONG64SGTU)
  1551  		v0 := b.NewValue0(v.Pos, OpLOONG64MOVVconst, typ.UInt64)
  1552  		v0.AuxInt = int64ToAuxInt(1)
  1553  		v1 := b.NewValue0(v.Pos, OpLOONG64XOR, typ.UInt64)
  1554  		v2 := b.NewValue0(v.Pos, OpZeroExt8to64, typ.UInt64)
  1555  		v2.AddArg(x)
  1556  		v3 := b.NewValue0(v.Pos, OpZeroExt8to64, typ.UInt64)
  1557  		v3.AddArg(y)
  1558  		v1.AddArg2(v2, v3)
  1559  		v.AddArg2(v0, v1)
  1560  		return true
  1561  	}
  1562  }
  1563  func rewriteValueLOONG64_OpEqB(v *Value) bool {
  1564  	v_1 := v.Args[1]
  1565  	v_0 := v.Args[0]
  1566  	b := v.Block
  1567  	typ := &b.Func.Config.Types
  1568  	// match: (EqB x y)
  1569  	// result: (XOR (MOVVconst [1]) (XOR <typ.Bool> x y))
  1570  	for {
  1571  		x := v_0
  1572  		y := v_1
  1573  		v.reset(OpLOONG64XOR)
  1574  		v0 := b.NewValue0(v.Pos, OpLOONG64MOVVconst, typ.UInt64)
  1575  		v0.AuxInt = int64ToAuxInt(1)
  1576  		v1 := b.NewValue0(v.Pos, OpLOONG64XOR, typ.Bool)
  1577  		v1.AddArg2(x, y)
  1578  		v.AddArg2(v0, v1)
  1579  		return true
  1580  	}
  1581  }
  1582  func rewriteValueLOONG64_OpEqPtr(v *Value) bool {
  1583  	v_1 := v.Args[1]
  1584  	v_0 := v.Args[0]
  1585  	b := v.Block
  1586  	typ := &b.Func.Config.Types
  1587  	// match: (EqPtr x y)
  1588  	// result: (SGTU (MOVVconst [1]) (XOR x y))
  1589  	for {
  1590  		x := v_0
  1591  		y := v_1
  1592  		v.reset(OpLOONG64SGTU)
  1593  		v0 := b.NewValue0(v.Pos, OpLOONG64MOVVconst, typ.UInt64)
  1594  		v0.AuxInt = int64ToAuxInt(1)
  1595  		v1 := b.NewValue0(v.Pos, OpLOONG64XOR, typ.UInt64)
  1596  		v1.AddArg2(x, y)
  1597  		v.AddArg2(v0, v1)
  1598  		return true
  1599  	}
  1600  }
  1601  func rewriteValueLOONG64_OpIsInBounds(v *Value) bool {
  1602  	v_1 := v.Args[1]
  1603  	v_0 := v.Args[0]
  1604  	// match: (IsInBounds idx len)
  1605  	// result: (SGTU len idx)
  1606  	for {
  1607  		idx := v_0
  1608  		len := v_1
  1609  		v.reset(OpLOONG64SGTU)
  1610  		v.AddArg2(len, idx)
  1611  		return true
  1612  	}
  1613  }
  1614  func rewriteValueLOONG64_OpIsNonNil(v *Value) bool {
  1615  	v_0 := v.Args[0]
  1616  	b := v.Block
  1617  	typ := &b.Func.Config.Types
  1618  	// match: (IsNonNil ptr)
  1619  	// result: (SGTU ptr (MOVVconst [0]))
  1620  	for {
  1621  		ptr := v_0
  1622  		v.reset(OpLOONG64SGTU)
  1623  		v0 := b.NewValue0(v.Pos, OpLOONG64MOVVconst, typ.UInt64)
  1624  		v0.AuxInt = int64ToAuxInt(0)
  1625  		v.AddArg2(ptr, v0)
  1626  		return true
  1627  	}
  1628  }
  1629  func rewriteValueLOONG64_OpIsSliceInBounds(v *Value) bool {
  1630  	v_1 := v.Args[1]
  1631  	v_0 := v.Args[0]
  1632  	b := v.Block
  1633  	typ := &b.Func.Config.Types
  1634  	// match: (IsSliceInBounds idx len)
  1635  	// result: (XOR (MOVVconst [1]) (SGTU idx len))
  1636  	for {
  1637  		idx := v_0
  1638  		len := v_1
  1639  		v.reset(OpLOONG64XOR)
  1640  		v0 := b.NewValue0(v.Pos, OpLOONG64MOVVconst, typ.UInt64)
  1641  		v0.AuxInt = int64ToAuxInt(1)
  1642  		v1 := b.NewValue0(v.Pos, OpLOONG64SGTU, typ.Bool)
  1643  		v1.AddArg2(idx, len)
  1644  		v.AddArg2(v0, v1)
  1645  		return true
  1646  	}
  1647  }
  1648  func rewriteValueLOONG64_OpLOONG64ADDD(v *Value) bool {
  1649  	v_1 := v.Args[1]
  1650  	v_0 := v.Args[0]
  1651  	// match: (ADDD (MULD x y) z)
  1652  	// cond: z.Block.Func.useFMA(v)
  1653  	// result: (FMADDD x y z)
  1654  	for {
  1655  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
  1656  			if v_0.Op != OpLOONG64MULD {
  1657  				continue
  1658  			}
  1659  			y := v_0.Args[1]
  1660  			x := v_0.Args[0]
  1661  			z := v_1
  1662  			if !(z.Block.Func.useFMA(v)) {
  1663  				continue
  1664  			}
  1665  			v.reset(OpLOONG64FMADDD)
  1666  			v.AddArg3(x, y, z)
  1667  			return true
  1668  		}
  1669  		break
  1670  	}
  1671  	// match: (ADDD z (NEGD (MULD x y)))
  1672  	// cond: z.Block.Func.useFMA(v)
  1673  	// result: (FNMSUBD x y z)
  1674  	for {
  1675  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
  1676  			z := v_0
  1677  			if v_1.Op != OpLOONG64NEGD {
  1678  				continue
  1679  			}
  1680  			v_1_0 := v_1.Args[0]
  1681  			if v_1_0.Op != OpLOONG64MULD {
  1682  				continue
  1683  			}
  1684  			y := v_1_0.Args[1]
  1685  			x := v_1_0.Args[0]
  1686  			if !(z.Block.Func.useFMA(v)) {
  1687  				continue
  1688  			}
  1689  			v.reset(OpLOONG64FNMSUBD)
  1690  			v.AddArg3(x, y, z)
  1691  			return true
  1692  		}
  1693  		break
  1694  	}
  1695  	return false
  1696  }
  1697  func rewriteValueLOONG64_OpLOONG64ADDF(v *Value) bool {
  1698  	v_1 := v.Args[1]
  1699  	v_0 := v.Args[0]
  1700  	// match: (ADDF (MULF x y) z)
  1701  	// cond: z.Block.Func.useFMA(v)
  1702  	// result: (FMADDF x y z)
  1703  	for {
  1704  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
  1705  			if v_0.Op != OpLOONG64MULF {
  1706  				continue
  1707  			}
  1708  			y := v_0.Args[1]
  1709  			x := v_0.Args[0]
  1710  			z := v_1
  1711  			if !(z.Block.Func.useFMA(v)) {
  1712  				continue
  1713  			}
  1714  			v.reset(OpLOONG64FMADDF)
  1715  			v.AddArg3(x, y, z)
  1716  			return true
  1717  		}
  1718  		break
  1719  	}
  1720  	// match: (ADDF z (NEGF (MULF x y)))
  1721  	// cond: z.Block.Func.useFMA(v)
  1722  	// result: (FNMSUBF x y z)
  1723  	for {
  1724  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
  1725  			z := v_0
  1726  			if v_1.Op != OpLOONG64NEGF {
  1727  				continue
  1728  			}
  1729  			v_1_0 := v_1.Args[0]
  1730  			if v_1_0.Op != OpLOONG64MULF {
  1731  				continue
  1732  			}
  1733  			y := v_1_0.Args[1]
  1734  			x := v_1_0.Args[0]
  1735  			if !(z.Block.Func.useFMA(v)) {
  1736  				continue
  1737  			}
  1738  			v.reset(OpLOONG64FNMSUBF)
  1739  			v.AddArg3(x, y, z)
  1740  			return true
  1741  		}
  1742  		break
  1743  	}
  1744  	return false
  1745  }
  1746  func rewriteValueLOONG64_OpLOONG64ADDV(v *Value) bool {
  1747  	v_1 := v.Args[1]
  1748  	v_0 := v.Args[0]
  1749  	b := v.Block
  1750  	typ := &b.Func.Config.Types
  1751  	// match: (ADDV <typ.UInt16> (SRLVconst [8] <typ.UInt16> x) (SLLVconst [8] <typ.UInt16> x))
  1752  	// result: (REVB2H x)
  1753  	for {
  1754  		if v.Type != typ.UInt16 {
  1755  			break
  1756  		}
  1757  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
  1758  			if v_0.Op != OpLOONG64SRLVconst || v_0.Type != typ.UInt16 || auxIntToInt64(v_0.AuxInt) != 8 {
  1759  				continue
  1760  			}
  1761  			x := v_0.Args[0]
  1762  			if v_1.Op != OpLOONG64SLLVconst || v_1.Type != typ.UInt16 || auxIntToInt64(v_1.AuxInt) != 8 || x != v_1.Args[0] {
  1763  				continue
  1764  			}
  1765  			v.reset(OpLOONG64REVB2H)
  1766  			v.AddArg(x)
  1767  			return true
  1768  		}
  1769  		break
  1770  	}
  1771  	// match: (ADDV (SRLconst [8] (ANDconst [c1] x)) (SLLconst [8] (ANDconst [c2] x)))
  1772  	// cond: uint32(c1) == 0xff00ff00 && uint32(c2) == 0x00ff00ff
  1773  	// result: (REVB2H x)
  1774  	for {
  1775  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
  1776  			if v_0.Op != OpLOONG64SRLconst || auxIntToInt64(v_0.AuxInt) != 8 {
  1777  				continue
  1778  			}
  1779  			v_0_0 := v_0.Args[0]
  1780  			if v_0_0.Op != OpLOONG64ANDconst {
  1781  				continue
  1782  			}
  1783  			c1 := auxIntToInt64(v_0_0.AuxInt)
  1784  			x := v_0_0.Args[0]
  1785  			if v_1.Op != OpLOONG64SLLconst || auxIntToInt64(v_1.AuxInt) != 8 {
  1786  				continue
  1787  			}
  1788  			v_1_0 := v_1.Args[0]
  1789  			if v_1_0.Op != OpLOONG64ANDconst {
  1790  				continue
  1791  			}
  1792  			c2 := auxIntToInt64(v_1_0.AuxInt)
  1793  			if x != v_1_0.Args[0] || !(uint32(c1) == 0xff00ff00 && uint32(c2) == 0x00ff00ff) {
  1794  				continue
  1795  			}
  1796  			v.reset(OpLOONG64REVB2H)
  1797  			v.AddArg(x)
  1798  			return true
  1799  		}
  1800  		break
  1801  	}
  1802  	// match: (ADDV (SRLVconst [8] (AND (MOVVconst [c1]) x)) (SLLVconst [8] (AND (MOVVconst [c2]) x)))
  1803  	// cond: uint64(c1) == 0xff00ff00ff00ff00 && uint64(c2) == 0x00ff00ff00ff00ff
  1804  	// result: (REVB4H x)
  1805  	for {
  1806  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
  1807  			if v_0.Op != OpLOONG64SRLVconst || auxIntToInt64(v_0.AuxInt) != 8 {
  1808  				continue
  1809  			}
  1810  			v_0_0 := v_0.Args[0]
  1811  			if v_0_0.Op != OpLOONG64AND {
  1812  				continue
  1813  			}
  1814  			_ = v_0_0.Args[1]
  1815  			v_0_0_0 := v_0_0.Args[0]
  1816  			v_0_0_1 := v_0_0.Args[1]
  1817  			for _i1 := 0; _i1 <= 1; _i1, v_0_0_0, v_0_0_1 = _i1+1, v_0_0_1, v_0_0_0 {
  1818  				if v_0_0_0.Op != OpLOONG64MOVVconst {
  1819  					continue
  1820  				}
  1821  				c1 := auxIntToInt64(v_0_0_0.AuxInt)
  1822  				x := v_0_0_1
  1823  				if v_1.Op != OpLOONG64SLLVconst || auxIntToInt64(v_1.AuxInt) != 8 {
  1824  					continue
  1825  				}
  1826  				v_1_0 := v_1.Args[0]
  1827  				if v_1_0.Op != OpLOONG64AND {
  1828  					continue
  1829  				}
  1830  				_ = v_1_0.Args[1]
  1831  				v_1_0_0 := v_1_0.Args[0]
  1832  				v_1_0_1 := v_1_0.Args[1]
  1833  				for _i2 := 0; _i2 <= 1; _i2, v_1_0_0, v_1_0_1 = _i2+1, v_1_0_1, v_1_0_0 {
  1834  					if v_1_0_0.Op != OpLOONG64MOVVconst {
  1835  						continue
  1836  					}
  1837  					c2 := auxIntToInt64(v_1_0_0.AuxInt)
  1838  					if x != v_1_0_1 || !(uint64(c1) == 0xff00ff00ff00ff00 && uint64(c2) == 0x00ff00ff00ff00ff) {
  1839  						continue
  1840  					}
  1841  					v.reset(OpLOONG64REVB4H)
  1842  					v.AddArg(x)
  1843  					return true
  1844  				}
  1845  			}
  1846  		}
  1847  		break
  1848  	}
  1849  	// match: (ADDV (SRLVconst [8] (AND (MOVVconst [c1]) x)) (SLLVconst [8] (ANDconst [c2] x)))
  1850  	// cond: uint64(c1) == 0xff00ff00 && uint64(c2) == 0x00ff00ff
  1851  	// result: (REVB4H (ANDconst <x.Type> [0xffffffff] x))
  1852  	for {
  1853  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
  1854  			if v_0.Op != OpLOONG64SRLVconst || auxIntToInt64(v_0.AuxInt) != 8 {
  1855  				continue
  1856  			}
  1857  			v_0_0 := v_0.Args[0]
  1858  			if v_0_0.Op != OpLOONG64AND {
  1859  				continue
  1860  			}
  1861  			_ = v_0_0.Args[1]
  1862  			v_0_0_0 := v_0_0.Args[0]
  1863  			v_0_0_1 := v_0_0.Args[1]
  1864  			for _i1 := 0; _i1 <= 1; _i1, v_0_0_0, v_0_0_1 = _i1+1, v_0_0_1, v_0_0_0 {
  1865  				if v_0_0_0.Op != OpLOONG64MOVVconst {
  1866  					continue
  1867  				}
  1868  				c1 := auxIntToInt64(v_0_0_0.AuxInt)
  1869  				x := v_0_0_1
  1870  				if v_1.Op != OpLOONG64SLLVconst || auxIntToInt64(v_1.AuxInt) != 8 {
  1871  					continue
  1872  				}
  1873  				v_1_0 := v_1.Args[0]
  1874  				if v_1_0.Op != OpLOONG64ANDconst {
  1875  					continue
  1876  				}
  1877  				c2 := auxIntToInt64(v_1_0.AuxInt)
  1878  				if x != v_1_0.Args[0] || !(uint64(c1) == 0xff00ff00 && uint64(c2) == 0x00ff00ff) {
  1879  					continue
  1880  				}
  1881  				v.reset(OpLOONG64REVB4H)
  1882  				v0 := b.NewValue0(v.Pos, OpLOONG64ANDconst, x.Type)
  1883  				v0.AuxInt = int64ToAuxInt(0xffffffff)
  1884  				v0.AddArg(x)
  1885  				v.AddArg(v0)
  1886  				return true
  1887  			}
  1888  		}
  1889  		break
  1890  	}
  1891  	// match: (ADDV x (MOVVconst <t> [c]))
  1892  	// cond: is32Bit(c) && !t.IsPtr()
  1893  	// result: (ADDVconst [c] x)
  1894  	for {
  1895  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
  1896  			x := v_0
  1897  			if v_1.Op != OpLOONG64MOVVconst {
  1898  				continue
  1899  			}
  1900  			t := v_1.Type
  1901  			c := auxIntToInt64(v_1.AuxInt)
  1902  			if !(is32Bit(c) && !t.IsPtr()) {
  1903  				continue
  1904  			}
  1905  			v.reset(OpLOONG64ADDVconst)
  1906  			v.AuxInt = int64ToAuxInt(c)
  1907  			v.AddArg(x)
  1908  			return true
  1909  		}
  1910  		break
  1911  	}
  1912  	// match: (ADDV x0 x1:(SLLVconst [c] y))
  1913  	// cond: x1.Uses == 1 && c > 0 && c <= 4
  1914  	// result: (ADDshiftLLV x0 y [c])
  1915  	for {
  1916  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
  1917  			x0 := v_0
  1918  			x1 := v_1
  1919  			if x1.Op != OpLOONG64SLLVconst {
  1920  				continue
  1921  			}
  1922  			c := auxIntToInt64(x1.AuxInt)
  1923  			y := x1.Args[0]
  1924  			if !(x1.Uses == 1 && c > 0 && c <= 4) {
  1925  				continue
  1926  			}
  1927  			v.reset(OpLOONG64ADDshiftLLV)
  1928  			v.AuxInt = int64ToAuxInt(c)
  1929  			v.AddArg2(x0, y)
  1930  			return true
  1931  		}
  1932  		break
  1933  	}
  1934  	// match: (ADDV x (NEGV y))
  1935  	// result: (SUBV x y)
  1936  	for {
  1937  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
  1938  			x := v_0
  1939  			if v_1.Op != OpLOONG64NEGV {
  1940  				continue
  1941  			}
  1942  			y := v_1.Args[0]
  1943  			v.reset(OpLOONG64SUBV)
  1944  			v.AddArg2(x, y)
  1945  			return true
  1946  		}
  1947  		break
  1948  	}
  1949  	return false
  1950  }
  1951  func rewriteValueLOONG64_OpLOONG64ADDVconst(v *Value) bool {
  1952  	v_0 := v.Args[0]
  1953  	// match: (ADDVconst [off1] (MOVVaddr [off2] {sym} ptr))
  1954  	// cond: is32Bit(off1+int64(off2))
  1955  	// result: (MOVVaddr [int32(off1)+int32(off2)] {sym} ptr)
  1956  	for {
  1957  		off1 := auxIntToInt64(v.AuxInt)
  1958  		if v_0.Op != OpLOONG64MOVVaddr {
  1959  			break
  1960  		}
  1961  		off2 := auxIntToInt32(v_0.AuxInt)
  1962  		sym := auxToSym(v_0.Aux)
  1963  		ptr := v_0.Args[0]
  1964  		if !(is32Bit(off1 + int64(off2))) {
  1965  			break
  1966  		}
  1967  		v.reset(OpLOONG64MOVVaddr)
  1968  		v.AuxInt = int32ToAuxInt(int32(off1) + int32(off2))
  1969  		v.Aux = symToAux(sym)
  1970  		v.AddArg(ptr)
  1971  		return true
  1972  	}
  1973  	// match: (ADDVconst [0] x)
  1974  	// result: x
  1975  	for {
  1976  		if auxIntToInt64(v.AuxInt) != 0 {
  1977  			break
  1978  		}
  1979  		x := v_0
  1980  		v.copyOf(x)
  1981  		return true
  1982  	}
  1983  	// match: (ADDVconst [c] (MOVVconst [d]))
  1984  	// result: (MOVVconst [c+d])
  1985  	for {
  1986  		c := auxIntToInt64(v.AuxInt)
  1987  		if v_0.Op != OpLOONG64MOVVconst {
  1988  			break
  1989  		}
  1990  		d := auxIntToInt64(v_0.AuxInt)
  1991  		v.reset(OpLOONG64MOVVconst)
  1992  		v.AuxInt = int64ToAuxInt(c + d)
  1993  		return true
  1994  	}
  1995  	// match: (ADDVconst [c] (ADDVconst [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 != OpLOONG64ADDVconst {
  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] (SUBVconst [d] x))
  2014  	// cond: is32Bit(c-d)
  2015  	// result: (ADDVconst [c-d] x)
  2016  	for {
  2017  		c := auxIntToInt64(v.AuxInt)
  2018  		if v_0.Op != OpLOONG64SUBVconst {
  2019  			break
  2020  		}
  2021  		d := auxIntToInt64(v_0.AuxInt)
  2022  		x := v_0.Args[0]
  2023  		if !(is32Bit(c - d)) {
  2024  			break
  2025  		}
  2026  		v.reset(OpLOONG64ADDVconst)
  2027  		v.AuxInt = int64ToAuxInt(c - d)
  2028  		v.AddArg(x)
  2029  		return true
  2030  	}
  2031  	// match: (ADDVconst [c] x)
  2032  	// cond: is32Bit(c) && c&0xffff == 0 && c != 0
  2033  	// result: (ADDV16const [c] x)
  2034  	for {
  2035  		c := auxIntToInt64(v.AuxInt)
  2036  		x := v_0
  2037  		if !(is32Bit(c) && c&0xffff == 0 && c != 0) {
  2038  			break
  2039  		}
  2040  		v.reset(OpLOONG64ADDV16const)
  2041  		v.AuxInt = int64ToAuxInt(c)
  2042  		v.AddArg(x)
  2043  		return true
  2044  	}
  2045  	return false
  2046  }
  2047  func rewriteValueLOONG64_OpLOONG64ADDshiftLLV(v *Value) bool {
  2048  	v_1 := v.Args[1]
  2049  	v_0 := v.Args[0]
  2050  	// match: (ADDshiftLLV x (MOVVconst [c]) [d])
  2051  	// cond: is12Bit(c<<d)
  2052  	// result: (ADDVconst x [c<<d])
  2053  	for {
  2054  		d := auxIntToInt64(v.AuxInt)
  2055  		x := v_0
  2056  		if v_1.Op != OpLOONG64MOVVconst {
  2057  			break
  2058  		}
  2059  		c := auxIntToInt64(v_1.AuxInt)
  2060  		if !(is12Bit(c << d)) {
  2061  			break
  2062  		}
  2063  		v.reset(OpLOONG64ADDVconst)
  2064  		v.AuxInt = int64ToAuxInt(c << d)
  2065  		v.AddArg(x)
  2066  		return true
  2067  	}
  2068  	return false
  2069  }
  2070  func rewriteValueLOONG64_OpLOONG64AND(v *Value) bool {
  2071  	v_1 := v.Args[1]
  2072  	v_0 := v.Args[0]
  2073  	// match: (AND x (MOVVconst [c]))
  2074  	// cond: is32Bit(c)
  2075  	// result: (ANDconst [c] x)
  2076  	for {
  2077  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
  2078  			x := v_0
  2079  			if v_1.Op != OpLOONG64MOVVconst {
  2080  				continue
  2081  			}
  2082  			c := auxIntToInt64(v_1.AuxInt)
  2083  			if !(is32Bit(c)) {
  2084  				continue
  2085  			}
  2086  			v.reset(OpLOONG64ANDconst)
  2087  			v.AuxInt = int64ToAuxInt(c)
  2088  			v.AddArg(x)
  2089  			return true
  2090  		}
  2091  		break
  2092  	}
  2093  	// match: (AND x x)
  2094  	// result: x
  2095  	for {
  2096  		x := v_0
  2097  		if x != v_1 {
  2098  			break
  2099  		}
  2100  		v.copyOf(x)
  2101  		return true
  2102  	}
  2103  	// match: (AND x (NORconst [0] y))
  2104  	// result: (ANDN x y)
  2105  	for {
  2106  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
  2107  			x := v_0
  2108  			if v_1.Op != OpLOONG64NORconst || auxIntToInt64(v_1.AuxInt) != 0 {
  2109  				continue
  2110  			}
  2111  			y := v_1.Args[0]
  2112  			v.reset(OpLOONG64ANDN)
  2113  			v.AddArg2(x, y)
  2114  			return true
  2115  		}
  2116  		break
  2117  	}
  2118  	return false
  2119  }
  2120  func rewriteValueLOONG64_OpLOONG64ANDconst(v *Value) bool {
  2121  	v_0 := v.Args[0]
  2122  	// match: (ANDconst [0] _)
  2123  	// result: (MOVVconst [0])
  2124  	for {
  2125  		if auxIntToInt64(v.AuxInt) != 0 {
  2126  			break
  2127  		}
  2128  		v.reset(OpLOONG64MOVVconst)
  2129  		v.AuxInt = int64ToAuxInt(0)
  2130  		return true
  2131  	}
  2132  	// match: (ANDconst [-1] x)
  2133  	// result: x
  2134  	for {
  2135  		if auxIntToInt64(v.AuxInt) != -1 {
  2136  			break
  2137  		}
  2138  		x := v_0
  2139  		v.copyOf(x)
  2140  		return true
  2141  	}
  2142  	// match: (ANDconst [c] (MOVVconst [d]))
  2143  	// result: (MOVVconst [c&d])
  2144  	for {
  2145  		c := auxIntToInt64(v.AuxInt)
  2146  		if v_0.Op != OpLOONG64MOVVconst {
  2147  			break
  2148  		}
  2149  		d := auxIntToInt64(v_0.AuxInt)
  2150  		v.reset(OpLOONG64MOVVconst)
  2151  		v.AuxInt = int64ToAuxInt(c & d)
  2152  		return true
  2153  	}
  2154  	// match: (ANDconst [c] (ANDconst [d] x))
  2155  	// result: (ANDconst [c&d] x)
  2156  	for {
  2157  		c := auxIntToInt64(v.AuxInt)
  2158  		if v_0.Op != OpLOONG64ANDconst {
  2159  			break
  2160  		}
  2161  		d := auxIntToInt64(v_0.AuxInt)
  2162  		x := v_0.Args[0]
  2163  		v.reset(OpLOONG64ANDconst)
  2164  		v.AuxInt = int64ToAuxInt(c & d)
  2165  		v.AddArg(x)
  2166  		return true
  2167  	}
  2168  	return false
  2169  }
  2170  func rewriteValueLOONG64_OpLOONG64DIVV(v *Value) bool {
  2171  	v_1 := v.Args[1]
  2172  	v_0 := v.Args[0]
  2173  	// match: (DIVV (MOVVconst [c]) (MOVVconst [d]))
  2174  	// cond: d != 0
  2175  	// result: (MOVVconst [c/d])
  2176  	for {
  2177  		if v_0.Op != OpLOONG64MOVVconst {
  2178  			break
  2179  		}
  2180  		c := auxIntToInt64(v_0.AuxInt)
  2181  		if v_1.Op != OpLOONG64MOVVconst {
  2182  			break
  2183  		}
  2184  		d := auxIntToInt64(v_1.AuxInt)
  2185  		if !(d != 0) {
  2186  			break
  2187  		}
  2188  		v.reset(OpLOONG64MOVVconst)
  2189  		v.AuxInt = int64ToAuxInt(c / d)
  2190  		return true
  2191  	}
  2192  	return false
  2193  }
  2194  func rewriteValueLOONG64_OpLOONG64DIVVU(v *Value) bool {
  2195  	v_1 := v.Args[1]
  2196  	v_0 := v.Args[0]
  2197  	// match: (DIVVU x (MOVVconst [1]))
  2198  	// result: x
  2199  	for {
  2200  		x := v_0
  2201  		if v_1.Op != OpLOONG64MOVVconst || auxIntToInt64(v_1.AuxInt) != 1 {
  2202  			break
  2203  		}
  2204  		v.copyOf(x)
  2205  		return true
  2206  	}
  2207  	// match: (DIVVU x (MOVVconst [c]))
  2208  	// cond: isPowerOfTwo(c)
  2209  	// result: (SRLVconst [log64(c)] x)
  2210  	for {
  2211  		x := v_0
  2212  		if v_1.Op != OpLOONG64MOVVconst {
  2213  			break
  2214  		}
  2215  		c := auxIntToInt64(v_1.AuxInt)
  2216  		if !(isPowerOfTwo(c)) {
  2217  			break
  2218  		}
  2219  		v.reset(OpLOONG64SRLVconst)
  2220  		v.AuxInt = int64ToAuxInt(log64(c))
  2221  		v.AddArg(x)
  2222  		return true
  2223  	}
  2224  	// match: (DIVVU (MOVVconst [c]) (MOVVconst [d]))
  2225  	// cond: d != 0
  2226  	// result: (MOVVconst [int64(uint64(c)/uint64(d))])
  2227  	for {
  2228  		if v_0.Op != OpLOONG64MOVVconst {
  2229  			break
  2230  		}
  2231  		c := auxIntToInt64(v_0.AuxInt)
  2232  		if v_1.Op != OpLOONG64MOVVconst {
  2233  			break
  2234  		}
  2235  		d := auxIntToInt64(v_1.AuxInt)
  2236  		if !(d != 0) {
  2237  			break
  2238  		}
  2239  		v.reset(OpLOONG64MOVVconst)
  2240  		v.AuxInt = int64ToAuxInt(int64(uint64(c) / uint64(d)))
  2241  		return true
  2242  	}
  2243  	return false
  2244  }
  2245  func rewriteValueLOONG64_OpLOONG64LoweredPanicBoundsCR(v *Value) bool {
  2246  	v_1 := v.Args[1]
  2247  	v_0 := v.Args[0]
  2248  	// match: (LoweredPanicBoundsCR [kind] {p} (MOVVconst [c]) mem)
  2249  	// result: (LoweredPanicBoundsCC [kind] {PanicBoundsCC{Cx:p.C, Cy:c}} mem)
  2250  	for {
  2251  		kind := auxIntToInt64(v.AuxInt)
  2252  		p := auxToPanicBoundsC(v.Aux)
  2253  		if v_0.Op != OpLOONG64MOVVconst {
  2254  			break
  2255  		}
  2256  		c := auxIntToInt64(v_0.AuxInt)
  2257  		mem := v_1
  2258  		v.reset(OpLOONG64LoweredPanicBoundsCC)
  2259  		v.AuxInt = int64ToAuxInt(kind)
  2260  		v.Aux = panicBoundsCCToAux(PanicBoundsCC{Cx: p.C, Cy: c})
  2261  		v.AddArg(mem)
  2262  		return true
  2263  	}
  2264  	return false
  2265  }
  2266  func rewriteValueLOONG64_OpLOONG64LoweredPanicBoundsRC(v *Value) bool {
  2267  	v_1 := v.Args[1]
  2268  	v_0 := v.Args[0]
  2269  	// match: (LoweredPanicBoundsRC [kind] {p} (MOVVconst [c]) mem)
  2270  	// result: (LoweredPanicBoundsCC [kind] {PanicBoundsCC{Cx:c, Cy:p.C}} mem)
  2271  	for {
  2272  		kind := auxIntToInt64(v.AuxInt)
  2273  		p := auxToPanicBoundsC(v.Aux)
  2274  		if v_0.Op != OpLOONG64MOVVconst {
  2275  			break
  2276  		}
  2277  		c := auxIntToInt64(v_0.AuxInt)
  2278  		mem := v_1
  2279  		v.reset(OpLOONG64LoweredPanicBoundsCC)
  2280  		v.AuxInt = int64ToAuxInt(kind)
  2281  		v.Aux = panicBoundsCCToAux(PanicBoundsCC{Cx: c, Cy: p.C})
  2282  		v.AddArg(mem)
  2283  		return true
  2284  	}
  2285  	return false
  2286  }
  2287  func rewriteValueLOONG64_OpLOONG64LoweredPanicBoundsRR(v *Value) bool {
  2288  	v_2 := v.Args[2]
  2289  	v_1 := v.Args[1]
  2290  	v_0 := v.Args[0]
  2291  	// match: (LoweredPanicBoundsRR [kind] x (MOVVconst [c]) mem)
  2292  	// result: (LoweredPanicBoundsRC [kind] x {PanicBoundsC{C:c}} mem)
  2293  	for {
  2294  		kind := auxIntToInt64(v.AuxInt)
  2295  		x := v_0
  2296  		if v_1.Op != OpLOONG64MOVVconst {
  2297  			break
  2298  		}
  2299  		c := auxIntToInt64(v_1.AuxInt)
  2300  		mem := v_2
  2301  		v.reset(OpLOONG64LoweredPanicBoundsRC)
  2302  		v.AuxInt = int64ToAuxInt(kind)
  2303  		v.Aux = panicBoundsCToAux(PanicBoundsC{C: c})
  2304  		v.AddArg2(x, mem)
  2305  		return true
  2306  	}
  2307  	// match: (LoweredPanicBoundsRR [kind] (MOVVconst [c]) y mem)
  2308  	// result: (LoweredPanicBoundsCR [kind] {PanicBoundsC{C:c}} y mem)
  2309  	for {
  2310  		kind := auxIntToInt64(v.AuxInt)
  2311  		if v_0.Op != OpLOONG64MOVVconst {
  2312  			break
  2313  		}
  2314  		c := auxIntToInt64(v_0.AuxInt)
  2315  		y := v_1
  2316  		mem := v_2
  2317  		v.reset(OpLOONG64LoweredPanicBoundsCR)
  2318  		v.AuxInt = int64ToAuxInt(kind)
  2319  		v.Aux = panicBoundsCToAux(PanicBoundsC{C: c})
  2320  		v.AddArg2(y, mem)
  2321  		return true
  2322  	}
  2323  	return false
  2324  }
  2325  func rewriteValueLOONG64_OpLOONG64MASKEQZ(v *Value) bool {
  2326  	v_1 := v.Args[1]
  2327  	v_0 := v.Args[0]
  2328  	// match: (MASKEQZ (MOVVconst [0]) cond)
  2329  	// result: (MOVVconst [0])
  2330  	for {
  2331  		if v_0.Op != OpLOONG64MOVVconst || auxIntToInt64(v_0.AuxInt) != 0 {
  2332  			break
  2333  		}
  2334  		v.reset(OpLOONG64MOVVconst)
  2335  		v.AuxInt = int64ToAuxInt(0)
  2336  		return true
  2337  	}
  2338  	// match: (MASKEQZ x (MOVVconst [c]))
  2339  	// cond: c == 0
  2340  	// result: (MOVVconst [0])
  2341  	for {
  2342  		if v_1.Op != OpLOONG64MOVVconst {
  2343  			break
  2344  		}
  2345  		c := auxIntToInt64(v_1.AuxInt)
  2346  		if !(c == 0) {
  2347  			break
  2348  		}
  2349  		v.reset(OpLOONG64MOVVconst)
  2350  		v.AuxInt = int64ToAuxInt(0)
  2351  		return true
  2352  	}
  2353  	// match: (MASKEQZ x (MOVVconst [c]))
  2354  	// cond: c != 0
  2355  	// result: x
  2356  	for {
  2357  		x := v_0
  2358  		if v_1.Op != OpLOONG64MOVVconst {
  2359  			break
  2360  		}
  2361  		c := auxIntToInt64(v_1.AuxInt)
  2362  		if !(c != 0) {
  2363  			break
  2364  		}
  2365  		v.copyOf(x)
  2366  		return true
  2367  	}
  2368  	return false
  2369  }
  2370  func rewriteValueLOONG64_OpLOONG64MASKNEZ(v *Value) bool {
  2371  	v_0 := v.Args[0]
  2372  	// match: (MASKNEZ (MOVVconst [0]) cond)
  2373  	// result: (MOVVconst [0])
  2374  	for {
  2375  		if v_0.Op != OpLOONG64MOVVconst || auxIntToInt64(v_0.AuxInt) != 0 {
  2376  			break
  2377  		}
  2378  		v.reset(OpLOONG64MOVVconst)
  2379  		v.AuxInt = int64ToAuxInt(0)
  2380  		return true
  2381  	}
  2382  	return false
  2383  }
  2384  func rewriteValueLOONG64_OpLOONG64MOVBUload(v *Value) bool {
  2385  	v_1 := v.Args[1]
  2386  	v_0 := v.Args[0]
  2387  	b := v.Block
  2388  	config := b.Func.Config
  2389  	typ := &b.Func.Config.Types
  2390  	// match: (MOVBUload [off] {sym} ptr (MOVBstore [off] {sym} ptr x _))
  2391  	// result: (MOVBUreg x)
  2392  	for {
  2393  		off := auxIntToInt32(v.AuxInt)
  2394  		sym := auxToSym(v.Aux)
  2395  		ptr := v_0
  2396  		if v_1.Op != OpLOONG64MOVBstore || auxIntToInt32(v_1.AuxInt) != off || auxToSym(v_1.Aux) != sym {
  2397  			break
  2398  		}
  2399  		x := v_1.Args[1]
  2400  		if ptr != v_1.Args[0] {
  2401  			break
  2402  		}
  2403  		v.reset(OpLOONG64MOVBUreg)
  2404  		v.AddArg(x)
  2405  		return true
  2406  	}
  2407  	// match: (MOVBUload [off1] {sym} (ADDVconst [off2] ptr) mem)
  2408  	// cond: is32Bit(int64(off1)+off2) && (ptr.Op != OpSB || !config.ctxt.Flag_dynlink)
  2409  	// result: (MOVBUload [off1+int32(off2)] {sym} ptr mem)
  2410  	for {
  2411  		off1 := auxIntToInt32(v.AuxInt)
  2412  		sym := auxToSym(v.Aux)
  2413  		if v_0.Op != OpLOONG64ADDVconst {
  2414  			break
  2415  		}
  2416  		off2 := auxIntToInt64(v_0.AuxInt)
  2417  		ptr := v_0.Args[0]
  2418  		mem := v_1
  2419  		if !(is32Bit(int64(off1)+off2) && (ptr.Op != OpSB || !config.ctxt.Flag_dynlink)) {
  2420  			break
  2421  		}
  2422  		v.reset(OpLOONG64MOVBUload)
  2423  		v.AuxInt = int32ToAuxInt(off1 + int32(off2))
  2424  		v.Aux = symToAux(sym)
  2425  		v.AddArg2(ptr, mem)
  2426  		return true
  2427  	}
  2428  	// match: (MOVBUload [off1] {sym1} (MOVVaddr [off2] {sym2} ptr) mem)
  2429  	// cond: canMergeSym(sym1,sym2) && is32Bit(int64(off1)+int64(off2)) && (ptr.Op != OpSB || !config.ctxt.Flag_dynlink)
  2430  	// result: (MOVBUload [off1+int32(off2)] {mergeSym(sym1,sym2)} ptr mem)
  2431  	for {
  2432  		off1 := auxIntToInt32(v.AuxInt)
  2433  		sym1 := auxToSym(v.Aux)
  2434  		if v_0.Op != OpLOONG64MOVVaddr {
  2435  			break
  2436  		}
  2437  		off2 := auxIntToInt32(v_0.AuxInt)
  2438  		sym2 := auxToSym(v_0.Aux)
  2439  		ptr := v_0.Args[0]
  2440  		mem := v_1
  2441  		if !(canMergeSym(sym1, sym2) && is32Bit(int64(off1)+int64(off2)) && (ptr.Op != OpSB || !config.ctxt.Flag_dynlink)) {
  2442  			break
  2443  		}
  2444  		v.reset(OpLOONG64MOVBUload)
  2445  		v.AuxInt = int32ToAuxInt(off1 + int32(off2))
  2446  		v.Aux = symToAux(mergeSym(sym1, sym2))
  2447  		v.AddArg2(ptr, mem)
  2448  		return true
  2449  	}
  2450  	// match: (MOVBUload [off] {sym} (ADDV ptr idx) mem)
  2451  	// cond: off == 0 && sym == nil
  2452  	// result: (MOVBUloadidx ptr idx mem)
  2453  	for {
  2454  		off := auxIntToInt32(v.AuxInt)
  2455  		sym := auxToSym(v.Aux)
  2456  		if v_0.Op != OpLOONG64ADDV {
  2457  			break
  2458  		}
  2459  		idx := v_0.Args[1]
  2460  		ptr := v_0.Args[0]
  2461  		mem := v_1
  2462  		if !(off == 0 && sym == nil) {
  2463  			break
  2464  		}
  2465  		v.reset(OpLOONG64MOVBUloadidx)
  2466  		v.AddArg3(ptr, idx, mem)
  2467  		return true
  2468  	}
  2469  	// match: (MOVBUload [off] {sym} (ADDshiftLLV [shift] ptr idx) mem)
  2470  	// cond: off == 0 && sym == nil
  2471  	// result: (MOVBUloadidx ptr (SLLVconst <typ.Int64> [shift] idx) mem)
  2472  	for {
  2473  		off := auxIntToInt32(v.AuxInt)
  2474  		sym := auxToSym(v.Aux)
  2475  		if v_0.Op != OpLOONG64ADDshiftLLV {
  2476  			break
  2477  		}
  2478  		shift := auxIntToInt64(v_0.AuxInt)
  2479  		idx := v_0.Args[1]
  2480  		ptr := v_0.Args[0]
  2481  		mem := v_1
  2482  		if !(off == 0 && sym == nil) {
  2483  			break
  2484  		}
  2485  		v.reset(OpLOONG64MOVBUloadidx)
  2486  		v0 := b.NewValue0(v.Pos, OpLOONG64SLLVconst, typ.Int64)
  2487  		v0.AuxInt = int64ToAuxInt(shift)
  2488  		v0.AddArg(idx)
  2489  		v.AddArg3(ptr, v0, mem)
  2490  		return true
  2491  	}
  2492  	// match: (MOVBUload [off] {sym} (SB) _)
  2493  	// cond: symIsRO(sym)
  2494  	// result: (MOVVconst [int64(read8(sym, int64(off)))])
  2495  	for {
  2496  		off := auxIntToInt32(v.AuxInt)
  2497  		sym := auxToSym(v.Aux)
  2498  		if v_0.Op != OpSB || !(symIsRO(sym)) {
  2499  			break
  2500  		}
  2501  		v.reset(OpLOONG64MOVVconst)
  2502  		v.AuxInt = int64ToAuxInt(int64(read8(sym, int64(off))))
  2503  		return true
  2504  	}
  2505  	return false
  2506  }
  2507  func rewriteValueLOONG64_OpLOONG64MOVBUloadidx(v *Value) bool {
  2508  	v_2 := v.Args[2]
  2509  	v_1 := v.Args[1]
  2510  	v_0 := v.Args[0]
  2511  	// match: (MOVBUloadidx ptr (MOVVconst [c]) mem)
  2512  	// cond: is32Bit(c)
  2513  	// result: (MOVBUload [int32(c)] ptr mem)
  2514  	for {
  2515  		ptr := v_0
  2516  		if v_1.Op != OpLOONG64MOVVconst {
  2517  			break
  2518  		}
  2519  		c := auxIntToInt64(v_1.AuxInt)
  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  	// match: (MOVBUloadidx (MOVVconst [c]) ptr mem)
  2530  	// cond: is32Bit(c)
  2531  	// result: (MOVBUload [int32(c)] ptr mem)
  2532  	for {
  2533  		if v_0.Op != OpLOONG64MOVVconst {
  2534  			break
  2535  		}
  2536  		c := auxIntToInt64(v_0.AuxInt)
  2537  		ptr := v_1
  2538  		mem := v_2
  2539  		if !(is32Bit(c)) {
  2540  			break
  2541  		}
  2542  		v.reset(OpLOONG64MOVBUload)
  2543  		v.AuxInt = int32ToAuxInt(int32(c))
  2544  		v.AddArg2(ptr, mem)
  2545  		return true
  2546  	}
  2547  	return false
  2548  }
  2549  func rewriteValueLOONG64_OpLOONG64MOVBUreg(v *Value) bool {
  2550  	v_0 := v.Args[0]
  2551  	// match: (MOVBUreg (SRLVconst [rc] x))
  2552  	// cond: rc < 8
  2553  	// result: (BSTRPICKV [rc + (7+rc)<<6] x)
  2554  	for {
  2555  		if v_0.Op != OpLOONG64SRLVconst {
  2556  			break
  2557  		}
  2558  		rc := auxIntToInt64(v_0.AuxInt)
  2559  		x := v_0.Args[0]
  2560  		if !(rc < 8) {
  2561  			break
  2562  		}
  2563  		v.reset(OpLOONG64BSTRPICKV)
  2564  		v.AuxInt = int64ToAuxInt(rc + (7+rc)<<6)
  2565  		v.AddArg(x)
  2566  		return true
  2567  	}
  2568  	// match: (MOVBUreg x:(SGT _ _))
  2569  	// result: x
  2570  	for {
  2571  		x := v_0
  2572  		if x.Op != OpLOONG64SGT {
  2573  			break
  2574  		}
  2575  		v.copyOf(x)
  2576  		return true
  2577  	}
  2578  	// match: (MOVBUreg x:(SGTU _ _))
  2579  	// result: x
  2580  	for {
  2581  		x := v_0
  2582  		if x.Op != OpLOONG64SGTU {
  2583  			break
  2584  		}
  2585  		v.copyOf(x)
  2586  		return true
  2587  	}
  2588  	// match: (MOVBUreg x:(XOR (MOVVconst [1]) (SGT _ _)))
  2589  	// result: x
  2590  	for {
  2591  		x := v_0
  2592  		if x.Op != OpLOONG64XOR {
  2593  			break
  2594  		}
  2595  		_ = x.Args[1]
  2596  		x_0 := x.Args[0]
  2597  		x_1 := x.Args[1]
  2598  		for _i0 := 0; _i0 <= 1; _i0, x_0, x_1 = _i0+1, x_1, x_0 {
  2599  			if x_0.Op != OpLOONG64MOVVconst || auxIntToInt64(x_0.AuxInt) != 1 || x_1.Op != OpLOONG64SGT {
  2600  				continue
  2601  			}
  2602  			v.copyOf(x)
  2603  			return true
  2604  		}
  2605  		break
  2606  	}
  2607  	// match: (MOVBUreg x:(XOR (MOVVconst [1]) (SGTU _ _)))
  2608  	// result: x
  2609  	for {
  2610  		x := v_0
  2611  		if x.Op != OpLOONG64XOR {
  2612  			break
  2613  		}
  2614  		_ = x.Args[1]
  2615  		x_0 := x.Args[0]
  2616  		x_1 := x.Args[1]
  2617  		for _i0 := 0; _i0 <= 1; _i0, x_0, x_1 = _i0+1, x_1, x_0 {
  2618  			if x_0.Op != OpLOONG64MOVVconst || auxIntToInt64(x_0.AuxInt) != 1 || x_1.Op != OpLOONG64SGTU {
  2619  				continue
  2620  			}
  2621  			v.copyOf(x)
  2622  			return true
  2623  		}
  2624  		break
  2625  	}
  2626  	// match: (MOVBUreg x:(MOVBUload _ _))
  2627  	// result: (MOVVreg x)
  2628  	for {
  2629  		x := v_0
  2630  		if x.Op != OpLOONG64MOVBUload {
  2631  			break
  2632  		}
  2633  		v.reset(OpLOONG64MOVVreg)
  2634  		v.AddArg(x)
  2635  		return true
  2636  	}
  2637  	// match: (MOVBUreg x:(MOVBUloadidx _ _ _))
  2638  	// result: (MOVVreg x)
  2639  	for {
  2640  		x := v_0
  2641  		if x.Op != OpLOONG64MOVBUloadidx {
  2642  			break
  2643  		}
  2644  		v.reset(OpLOONG64MOVVreg)
  2645  		v.AddArg(x)
  2646  		return true
  2647  	}
  2648  	// match: (MOVBUreg x:(MOVBUreg _))
  2649  	// result: (MOVVreg x)
  2650  	for {
  2651  		x := v_0
  2652  		if x.Op != OpLOONG64MOVBUreg {
  2653  			break
  2654  		}
  2655  		v.reset(OpLOONG64MOVVreg)
  2656  		v.AddArg(x)
  2657  		return true
  2658  	}
  2659  	// match: (MOVBUreg (SLLVconst [lc] x))
  2660  	// cond: lc >= 8
  2661  	// result: (MOVVconst [0])
  2662  	for {
  2663  		if v_0.Op != OpLOONG64SLLVconst {
  2664  			break
  2665  		}
  2666  		lc := auxIntToInt64(v_0.AuxInt)
  2667  		if !(lc >= 8) {
  2668  			break
  2669  		}
  2670  		v.reset(OpLOONG64MOVVconst)
  2671  		v.AuxInt = int64ToAuxInt(0)
  2672  		return true
  2673  	}
  2674  	// match: (MOVBUreg (MOVVconst [c]))
  2675  	// result: (MOVVconst [int64(uint8(c))])
  2676  	for {
  2677  		if v_0.Op != OpLOONG64MOVVconst {
  2678  			break
  2679  		}
  2680  		c := auxIntToInt64(v_0.AuxInt)
  2681  		v.reset(OpLOONG64MOVVconst)
  2682  		v.AuxInt = int64ToAuxInt(int64(uint8(c)))
  2683  		return true
  2684  	}
  2685  	// match: (MOVBUreg (ANDconst [c] x))
  2686  	// result: (ANDconst [c&0xff] x)
  2687  	for {
  2688  		if v_0.Op != OpLOONG64ANDconst {
  2689  			break
  2690  		}
  2691  		c := auxIntToInt64(v_0.AuxInt)
  2692  		x := v_0.Args[0]
  2693  		v.reset(OpLOONG64ANDconst)
  2694  		v.AuxInt = int64ToAuxInt(c & 0xff)
  2695  		v.AddArg(x)
  2696  		return true
  2697  	}
  2698  	// match: (MOVBUreg x:(SRLconst [c] y))
  2699  	// cond: c >= 24
  2700  	// result: x
  2701  	for {
  2702  		x := v_0
  2703  		if x.Op != OpLOONG64SRLconst {
  2704  			break
  2705  		}
  2706  		c := auxIntToInt64(x.AuxInt)
  2707  		if !(c >= 24) {
  2708  			break
  2709  		}
  2710  		v.copyOf(x)
  2711  		return true
  2712  	}
  2713  	// match: (MOVBUreg x:(ANDconst [c] y))
  2714  	// cond: c >= 0 && int64(uint8(c)) == c
  2715  	// result: x
  2716  	for {
  2717  		x := v_0
  2718  		if x.Op != OpLOONG64ANDconst {
  2719  			break
  2720  		}
  2721  		c := auxIntToInt64(x.AuxInt)
  2722  		if !(c >= 0 && int64(uint8(c)) == c) {
  2723  			break
  2724  		}
  2725  		v.copyOf(x)
  2726  		return true
  2727  	}
  2728  	return false
  2729  }
  2730  func rewriteValueLOONG64_OpLOONG64MOVBload(v *Value) bool {
  2731  	v_1 := v.Args[1]
  2732  	v_0 := v.Args[0]
  2733  	b := v.Block
  2734  	config := b.Func.Config
  2735  	typ := &b.Func.Config.Types
  2736  	// match: (MOVBload [off] {sym} ptr (MOVBstore [off] {sym} ptr x _))
  2737  	// result: (MOVBreg x)
  2738  	for {
  2739  		off := auxIntToInt32(v.AuxInt)
  2740  		sym := auxToSym(v.Aux)
  2741  		ptr := v_0
  2742  		if v_1.Op != OpLOONG64MOVBstore || auxIntToInt32(v_1.AuxInt) != off || auxToSym(v_1.Aux) != sym {
  2743  			break
  2744  		}
  2745  		x := v_1.Args[1]
  2746  		if ptr != v_1.Args[0] {
  2747  			break
  2748  		}
  2749  		v.reset(OpLOONG64MOVBreg)
  2750  		v.AddArg(x)
  2751  		return true
  2752  	}
  2753  	// match: (MOVBload [off1] {sym} (ADDVconst [off2] ptr) mem)
  2754  	// cond: is32Bit(int64(off1)+off2) && (ptr.Op != OpSB || !config.ctxt.Flag_dynlink)
  2755  	// result: (MOVBload [off1+int32(off2)] {sym} ptr mem)
  2756  	for {
  2757  		off1 := auxIntToInt32(v.AuxInt)
  2758  		sym := auxToSym(v.Aux)
  2759  		if v_0.Op != OpLOONG64ADDVconst {
  2760  			break
  2761  		}
  2762  		off2 := auxIntToInt64(v_0.AuxInt)
  2763  		ptr := v_0.Args[0]
  2764  		mem := v_1
  2765  		if !(is32Bit(int64(off1)+off2) && (ptr.Op != OpSB || !config.ctxt.Flag_dynlink)) {
  2766  			break
  2767  		}
  2768  		v.reset(OpLOONG64MOVBload)
  2769  		v.AuxInt = int32ToAuxInt(off1 + int32(off2))
  2770  		v.Aux = symToAux(sym)
  2771  		v.AddArg2(ptr, mem)
  2772  		return true
  2773  	}
  2774  	// match: (MOVBload [off1] {sym1} (MOVVaddr [off2] {sym2} ptr) mem)
  2775  	// cond: canMergeSym(sym1,sym2) && is32Bit(int64(off1)+int64(off2)) && (ptr.Op != OpSB || !config.ctxt.Flag_dynlink)
  2776  	// result: (MOVBload [off1+int32(off2)] {mergeSym(sym1,sym2)} ptr mem)
  2777  	for {
  2778  		off1 := auxIntToInt32(v.AuxInt)
  2779  		sym1 := auxToSym(v.Aux)
  2780  		if v_0.Op != OpLOONG64MOVVaddr {
  2781  			break
  2782  		}
  2783  		off2 := auxIntToInt32(v_0.AuxInt)
  2784  		sym2 := auxToSym(v_0.Aux)
  2785  		ptr := v_0.Args[0]
  2786  		mem := v_1
  2787  		if !(canMergeSym(sym1, sym2) && is32Bit(int64(off1)+int64(off2)) && (ptr.Op != OpSB || !config.ctxt.Flag_dynlink)) {
  2788  			break
  2789  		}
  2790  		v.reset(OpLOONG64MOVBload)
  2791  		v.AuxInt = int32ToAuxInt(off1 + int32(off2))
  2792  		v.Aux = symToAux(mergeSym(sym1, sym2))
  2793  		v.AddArg2(ptr, mem)
  2794  		return true
  2795  	}
  2796  	// match: (MOVBload [off] {sym} (ADDV ptr idx) mem)
  2797  	// cond: off == 0 && sym == nil
  2798  	// result: (MOVBloadidx ptr idx mem)
  2799  	for {
  2800  		off := auxIntToInt32(v.AuxInt)
  2801  		sym := auxToSym(v.Aux)
  2802  		if v_0.Op != OpLOONG64ADDV {
  2803  			break
  2804  		}
  2805  		idx := v_0.Args[1]
  2806  		ptr := v_0.Args[0]
  2807  		mem := v_1
  2808  		if !(off == 0 && sym == nil) {
  2809  			break
  2810  		}
  2811  		v.reset(OpLOONG64MOVBloadidx)
  2812  		v.AddArg3(ptr, idx, mem)
  2813  		return true
  2814  	}
  2815  	// match: (MOVBload [off] {sym} (ADDshiftLLV [shift] ptr idx) mem)
  2816  	// cond: off == 0 && sym == nil
  2817  	// result: (MOVBloadidx ptr (SLLVconst <typ.Int64> [shift] idx) mem)
  2818  	for {
  2819  		off := auxIntToInt32(v.AuxInt)
  2820  		sym := auxToSym(v.Aux)
  2821  		if v_0.Op != OpLOONG64ADDshiftLLV {
  2822  			break
  2823  		}
  2824  		shift := auxIntToInt64(v_0.AuxInt)
  2825  		idx := v_0.Args[1]
  2826  		ptr := v_0.Args[0]
  2827  		mem := v_1
  2828  		if !(off == 0 && sym == nil) {
  2829  			break
  2830  		}
  2831  		v.reset(OpLOONG64MOVBloadidx)
  2832  		v0 := b.NewValue0(v.Pos, OpLOONG64SLLVconst, typ.Int64)
  2833  		v0.AuxInt = int64ToAuxInt(shift)
  2834  		v0.AddArg(idx)
  2835  		v.AddArg3(ptr, v0, mem)
  2836  		return true
  2837  	}
  2838  	// match: (MOVBload [off] {sym} (SB) _)
  2839  	// cond: symIsRO(sym)
  2840  	// result: (MOVVconst [int64(int8(read8(sym, int64(off))))])
  2841  	for {
  2842  		off := auxIntToInt32(v.AuxInt)
  2843  		sym := auxToSym(v.Aux)
  2844  		if v_0.Op != OpSB || !(symIsRO(sym)) {
  2845  			break
  2846  		}
  2847  		v.reset(OpLOONG64MOVVconst)
  2848  		v.AuxInt = int64ToAuxInt(int64(int8(read8(sym, int64(off)))))
  2849  		return true
  2850  	}
  2851  	return false
  2852  }
  2853  func rewriteValueLOONG64_OpLOONG64MOVBloadidx(v *Value) bool {
  2854  	v_2 := v.Args[2]
  2855  	v_1 := v.Args[1]
  2856  	v_0 := v.Args[0]
  2857  	// match: (MOVBloadidx ptr (MOVVconst [c]) mem)
  2858  	// cond: is32Bit(c)
  2859  	// result: (MOVBload [int32(c)] ptr mem)
  2860  	for {
  2861  		ptr := v_0
  2862  		if v_1.Op != OpLOONG64MOVVconst {
  2863  			break
  2864  		}
  2865  		c := auxIntToInt64(v_1.AuxInt)
  2866  		mem := v_2
  2867  		if !(is32Bit(c)) {
  2868  			break
  2869  		}
  2870  		v.reset(OpLOONG64MOVBload)
  2871  		v.AuxInt = int32ToAuxInt(int32(c))
  2872  		v.AddArg2(ptr, mem)
  2873  		return true
  2874  	}
  2875  	// match: (MOVBloadidx (MOVVconst [c]) ptr mem)
  2876  	// cond: is32Bit(c)
  2877  	// result: (MOVBload [int32(c)] ptr mem)
  2878  	for {
  2879  		if v_0.Op != OpLOONG64MOVVconst {
  2880  			break
  2881  		}
  2882  		c := auxIntToInt64(v_0.AuxInt)
  2883  		ptr := v_1
  2884  		mem := v_2
  2885  		if !(is32Bit(c)) {
  2886  			break
  2887  		}
  2888  		v.reset(OpLOONG64MOVBload)
  2889  		v.AuxInt = int32ToAuxInt(int32(c))
  2890  		v.AddArg2(ptr, mem)
  2891  		return true
  2892  	}
  2893  	return false
  2894  }
  2895  func rewriteValueLOONG64_OpLOONG64MOVBreg(v *Value) bool {
  2896  	v_0 := v.Args[0]
  2897  	// match: (MOVBreg x:(MOVBload _ _))
  2898  	// result: (MOVVreg x)
  2899  	for {
  2900  		x := v_0
  2901  		if x.Op != OpLOONG64MOVBload {
  2902  			break
  2903  		}
  2904  		v.reset(OpLOONG64MOVVreg)
  2905  		v.AddArg(x)
  2906  		return true
  2907  	}
  2908  	// match: (MOVBreg x:(MOVBloadidx _ _ _))
  2909  	// result: (MOVVreg x)
  2910  	for {
  2911  		x := v_0
  2912  		if x.Op != OpLOONG64MOVBloadidx {
  2913  			break
  2914  		}
  2915  		v.reset(OpLOONG64MOVVreg)
  2916  		v.AddArg(x)
  2917  		return true
  2918  	}
  2919  	// match: (MOVBreg x:(MOVBreg _))
  2920  	// result: (MOVVreg x)
  2921  	for {
  2922  		x := v_0
  2923  		if x.Op != OpLOONG64MOVBreg {
  2924  			break
  2925  		}
  2926  		v.reset(OpLOONG64MOVVreg)
  2927  		v.AddArg(x)
  2928  		return true
  2929  	}
  2930  	// match: (MOVBreg (MOVVconst [c]))
  2931  	// result: (MOVVconst [int64(int8(c))])
  2932  	for {
  2933  		if v_0.Op != OpLOONG64MOVVconst {
  2934  			break
  2935  		}
  2936  		c := auxIntToInt64(v_0.AuxInt)
  2937  		v.reset(OpLOONG64MOVVconst)
  2938  		v.AuxInt = int64ToAuxInt(int64(int8(c)))
  2939  		return true
  2940  	}
  2941  	// match: (MOVBreg x:(ANDconst [c] y))
  2942  	// cond: c >= 0 && int64(int8(c)) == c
  2943  	// result: x
  2944  	for {
  2945  		x := v_0
  2946  		if x.Op != OpLOONG64ANDconst {
  2947  			break
  2948  		}
  2949  		c := auxIntToInt64(x.AuxInt)
  2950  		if !(c >= 0 && int64(int8(c)) == c) {
  2951  			break
  2952  		}
  2953  		v.copyOf(x)
  2954  		return true
  2955  	}
  2956  	return false
  2957  }
  2958  func rewriteValueLOONG64_OpLOONG64MOVBstore(v *Value) bool {
  2959  	v_2 := v.Args[2]
  2960  	v_1 := v.Args[1]
  2961  	v_0 := v.Args[0]
  2962  	b := v.Block
  2963  	config := b.Func.Config
  2964  	typ := &b.Func.Config.Types
  2965  	// match: (MOVBstore [off1] {sym} (ADDVconst [off2] ptr) val mem)
  2966  	// cond: is32Bit(int64(off1)+off2) && (ptr.Op != OpSB || !config.ctxt.Flag_dynlink)
  2967  	// result: (MOVBstore [off1+int32(off2)] {sym} ptr val mem)
  2968  	for {
  2969  		off1 := auxIntToInt32(v.AuxInt)
  2970  		sym := auxToSym(v.Aux)
  2971  		if v_0.Op != OpLOONG64ADDVconst {
  2972  			break
  2973  		}
  2974  		off2 := auxIntToInt64(v_0.AuxInt)
  2975  		ptr := v_0.Args[0]
  2976  		val := v_1
  2977  		mem := v_2
  2978  		if !(is32Bit(int64(off1)+off2) && (ptr.Op != OpSB || !config.ctxt.Flag_dynlink)) {
  2979  			break
  2980  		}
  2981  		v.reset(OpLOONG64MOVBstore)
  2982  		v.AuxInt = int32ToAuxInt(off1 + int32(off2))
  2983  		v.Aux = symToAux(sym)
  2984  		v.AddArg3(ptr, val, mem)
  2985  		return true
  2986  	}
  2987  	// match: (MOVBstore [off1] {sym1} (MOVVaddr [off2] {sym2} ptr) val mem)
  2988  	// cond: canMergeSym(sym1,sym2) && is32Bit(int64(off1)+int64(off2)) && (ptr.Op != OpSB || !config.ctxt.Flag_dynlink)
  2989  	// result: (MOVBstore [off1+int32(off2)] {mergeSym(sym1,sym2)} ptr val mem)
  2990  	for {
  2991  		off1 := auxIntToInt32(v.AuxInt)
  2992  		sym1 := auxToSym(v.Aux)
  2993  		if v_0.Op != OpLOONG64MOVVaddr {
  2994  			break
  2995  		}
  2996  		off2 := auxIntToInt32(v_0.AuxInt)
  2997  		sym2 := auxToSym(v_0.Aux)
  2998  		ptr := v_0.Args[0]
  2999  		val := v_1
  3000  		mem := v_2
  3001  		if !(canMergeSym(sym1, sym2) && is32Bit(int64(off1)+int64(off2)) && (ptr.Op != OpSB || !config.ctxt.Flag_dynlink)) {
  3002  			break
  3003  		}
  3004  		v.reset(OpLOONG64MOVBstore)
  3005  		v.AuxInt = int32ToAuxInt(off1 + int32(off2))
  3006  		v.Aux = symToAux(mergeSym(sym1, sym2))
  3007  		v.AddArg3(ptr, val, mem)
  3008  		return true
  3009  	}
  3010  	// match: (MOVBstore [off] {sym} ptr (MOVBreg x) mem)
  3011  	// result: (MOVBstore [off] {sym} ptr x mem)
  3012  	for {
  3013  		off := auxIntToInt32(v.AuxInt)
  3014  		sym := auxToSym(v.Aux)
  3015  		ptr := v_0
  3016  		if v_1.Op != OpLOONG64MOVBreg {
  3017  			break
  3018  		}
  3019  		x := v_1.Args[0]
  3020  		mem := v_2
  3021  		v.reset(OpLOONG64MOVBstore)
  3022  		v.AuxInt = int32ToAuxInt(off)
  3023  		v.Aux = symToAux(sym)
  3024  		v.AddArg3(ptr, x, mem)
  3025  		return true
  3026  	}
  3027  	// match: (MOVBstore [off] {sym} ptr (MOVBUreg x) mem)
  3028  	// result: (MOVBstore [off] {sym} ptr x mem)
  3029  	for {
  3030  		off := auxIntToInt32(v.AuxInt)
  3031  		sym := auxToSym(v.Aux)
  3032  		ptr := v_0
  3033  		if v_1.Op != OpLOONG64MOVBUreg {
  3034  			break
  3035  		}
  3036  		x := v_1.Args[0]
  3037  		mem := v_2
  3038  		v.reset(OpLOONG64MOVBstore)
  3039  		v.AuxInt = int32ToAuxInt(off)
  3040  		v.Aux = symToAux(sym)
  3041  		v.AddArg3(ptr, x, mem)
  3042  		return true
  3043  	}
  3044  	// match: (MOVBstore [off] {sym} ptr (MOVHreg x) mem)
  3045  	// result: (MOVBstore [off] {sym} ptr x mem)
  3046  	for {
  3047  		off := auxIntToInt32(v.AuxInt)
  3048  		sym := auxToSym(v.Aux)
  3049  		ptr := v_0
  3050  		if v_1.Op != OpLOONG64MOVHreg {
  3051  			break
  3052  		}
  3053  		x := v_1.Args[0]
  3054  		mem := v_2
  3055  		v.reset(OpLOONG64MOVBstore)
  3056  		v.AuxInt = int32ToAuxInt(off)
  3057  		v.Aux = symToAux(sym)
  3058  		v.AddArg3(ptr, x, mem)
  3059  		return true
  3060  	}
  3061  	// match: (MOVBstore [off] {sym} ptr (MOVHUreg x) mem)
  3062  	// result: (MOVBstore [off] {sym} ptr x mem)
  3063  	for {
  3064  		off := auxIntToInt32(v.AuxInt)
  3065  		sym := auxToSym(v.Aux)
  3066  		ptr := v_0
  3067  		if v_1.Op != OpLOONG64MOVHUreg {
  3068  			break
  3069  		}
  3070  		x := v_1.Args[0]
  3071  		mem := v_2
  3072  		v.reset(OpLOONG64MOVBstore)
  3073  		v.AuxInt = int32ToAuxInt(off)
  3074  		v.Aux = symToAux(sym)
  3075  		v.AddArg3(ptr, x, mem)
  3076  		return true
  3077  	}
  3078  	// match: (MOVBstore [off] {sym} ptr (MOVWreg x) mem)
  3079  	// result: (MOVBstore [off] {sym} ptr x mem)
  3080  	for {
  3081  		off := auxIntToInt32(v.AuxInt)
  3082  		sym := auxToSym(v.Aux)
  3083  		ptr := v_0
  3084  		if v_1.Op != OpLOONG64MOVWreg {
  3085  			break
  3086  		}
  3087  		x := v_1.Args[0]
  3088  		mem := v_2
  3089  		v.reset(OpLOONG64MOVBstore)
  3090  		v.AuxInt = int32ToAuxInt(off)
  3091  		v.Aux = symToAux(sym)
  3092  		v.AddArg3(ptr, x, mem)
  3093  		return true
  3094  	}
  3095  	// match: (MOVBstore [off] {sym} ptr (MOVWUreg x) mem)
  3096  	// result: (MOVBstore [off] {sym} ptr x mem)
  3097  	for {
  3098  		off := auxIntToInt32(v.AuxInt)
  3099  		sym := auxToSym(v.Aux)
  3100  		ptr := v_0
  3101  		if v_1.Op != OpLOONG64MOVWUreg {
  3102  			break
  3103  		}
  3104  		x := v_1.Args[0]
  3105  		mem := v_2
  3106  		v.reset(OpLOONG64MOVBstore)
  3107  		v.AuxInt = int32ToAuxInt(off)
  3108  		v.Aux = symToAux(sym)
  3109  		v.AddArg3(ptr, x, mem)
  3110  		return true
  3111  	}
  3112  	// match: (MOVBstore [off] {sym} (ADDV ptr idx) val mem)
  3113  	// cond: off == 0 && sym == nil
  3114  	// result: (MOVBstoreidx ptr idx val mem)
  3115  	for {
  3116  		off := auxIntToInt32(v.AuxInt)
  3117  		sym := auxToSym(v.Aux)
  3118  		if v_0.Op != OpLOONG64ADDV {
  3119  			break
  3120  		}
  3121  		idx := v_0.Args[1]
  3122  		ptr := v_0.Args[0]
  3123  		val := v_1
  3124  		mem := v_2
  3125  		if !(off == 0 && sym == nil) {
  3126  			break
  3127  		}
  3128  		v.reset(OpLOONG64MOVBstoreidx)
  3129  		v.AddArg4(ptr, idx, val, mem)
  3130  		return true
  3131  	}
  3132  	// match: (MOVBstore [off] {sym} (ADDshiftLLV [shift] ptr idx) val mem)
  3133  	// cond: off == 0 && sym == nil
  3134  	// result: (MOVBstoreidx ptr (SLLVconst <typ.Int64> [shift] idx) val mem)
  3135  	for {
  3136  		off := auxIntToInt32(v.AuxInt)
  3137  		sym := auxToSym(v.Aux)
  3138  		if v_0.Op != OpLOONG64ADDshiftLLV {
  3139  			break
  3140  		}
  3141  		shift := auxIntToInt64(v_0.AuxInt)
  3142  		idx := v_0.Args[1]
  3143  		ptr := v_0.Args[0]
  3144  		val := v_1
  3145  		mem := v_2
  3146  		if !(off == 0 && sym == nil) {
  3147  			break
  3148  		}
  3149  		v.reset(OpLOONG64MOVBstoreidx)
  3150  		v0 := b.NewValue0(v.Pos, OpLOONG64SLLVconst, typ.Int64)
  3151  		v0.AuxInt = int64ToAuxInt(shift)
  3152  		v0.AddArg(idx)
  3153  		v.AddArg4(ptr, v0, val, mem)
  3154  		return true
  3155  	}
  3156  	return false
  3157  }
  3158  func rewriteValueLOONG64_OpLOONG64MOVBstoreidx(v *Value) bool {
  3159  	v_3 := v.Args[3]
  3160  	v_2 := v.Args[2]
  3161  	v_1 := v.Args[1]
  3162  	v_0 := v.Args[0]
  3163  	// match: (MOVBstoreidx ptr (MOVVconst [c]) val mem)
  3164  	// cond: is32Bit(c)
  3165  	// result: (MOVBstore [int32(c)] ptr val mem)
  3166  	for {
  3167  		ptr := v_0
  3168  		if v_1.Op != OpLOONG64MOVVconst {
  3169  			break
  3170  		}
  3171  		c := auxIntToInt64(v_1.AuxInt)
  3172  		val := v_2
  3173  		mem := v_3
  3174  		if !(is32Bit(c)) {
  3175  			break
  3176  		}
  3177  		v.reset(OpLOONG64MOVBstore)
  3178  		v.AuxInt = int32ToAuxInt(int32(c))
  3179  		v.AddArg3(ptr, val, mem)
  3180  		return true
  3181  	}
  3182  	// match: (MOVBstoreidx (MOVVconst [c]) idx val mem)
  3183  	// cond: is32Bit(c)
  3184  	// result: (MOVBstore [int32(c)] idx val mem)
  3185  	for {
  3186  		if v_0.Op != OpLOONG64MOVVconst {
  3187  			break
  3188  		}
  3189  		c := auxIntToInt64(v_0.AuxInt)
  3190  		idx := v_1
  3191  		val := v_2
  3192  		mem := v_3
  3193  		if !(is32Bit(c)) {
  3194  			break
  3195  		}
  3196  		v.reset(OpLOONG64MOVBstore)
  3197  		v.AuxInt = int32ToAuxInt(int32(c))
  3198  		v.AddArg3(idx, val, mem)
  3199  		return true
  3200  	}
  3201  	return false
  3202  }
  3203  func rewriteValueLOONG64_OpLOONG64MOVDF(v *Value) bool {
  3204  	v_0 := v.Args[0]
  3205  	// match: (MOVDF (ABSD (MOVFD x)))
  3206  	// result: (ABSF x)
  3207  	for {
  3208  		if v_0.Op != OpLOONG64ABSD {
  3209  			break
  3210  		}
  3211  		v_0_0 := v_0.Args[0]
  3212  		if v_0_0.Op != OpLOONG64MOVFD {
  3213  			break
  3214  		}
  3215  		x := v_0_0.Args[0]
  3216  		v.reset(OpLOONG64ABSF)
  3217  		v.AddArg(x)
  3218  		return true
  3219  	}
  3220  	// match: (MOVDF (SQRTD (MOVFD x)))
  3221  	// result: (SQRTF x)
  3222  	for {
  3223  		if v_0.Op != OpLOONG64SQRTD {
  3224  			break
  3225  		}
  3226  		v_0_0 := v_0.Args[0]
  3227  		if v_0_0.Op != OpLOONG64MOVFD {
  3228  			break
  3229  		}
  3230  		x := v_0_0.Args[0]
  3231  		v.reset(OpLOONG64SQRTF)
  3232  		v.AddArg(x)
  3233  		return true
  3234  	}
  3235  	return false
  3236  }
  3237  func rewriteValueLOONG64_OpLOONG64MOVDload(v *Value) bool {
  3238  	v_1 := v.Args[1]
  3239  	v_0 := v.Args[0]
  3240  	b := v.Block
  3241  	config := b.Func.Config
  3242  	typ := &b.Func.Config.Types
  3243  	// match: (MOVDload [off] {sym} ptr (MOVVstore [off] {sym} ptr val _))
  3244  	// result: (MOVVgpfp val)
  3245  	for {
  3246  		off := auxIntToInt32(v.AuxInt)
  3247  		sym := auxToSym(v.Aux)
  3248  		ptr := v_0
  3249  		if v_1.Op != OpLOONG64MOVVstore || auxIntToInt32(v_1.AuxInt) != off || auxToSym(v_1.Aux) != sym {
  3250  			break
  3251  		}
  3252  		val := v_1.Args[1]
  3253  		if ptr != v_1.Args[0] {
  3254  			break
  3255  		}
  3256  		v.reset(OpLOONG64MOVVgpfp)
  3257  		v.AddArg(val)
  3258  		return true
  3259  	}
  3260  	// match: (MOVDload [off1] {sym} (ADDVconst [off2] ptr) mem)
  3261  	// cond: is32Bit(int64(off1)+off2) && (ptr.Op != OpSB || !config.ctxt.Flag_dynlink)
  3262  	// result: (MOVDload [off1+int32(off2)] {sym} ptr mem)
  3263  	for {
  3264  		off1 := auxIntToInt32(v.AuxInt)
  3265  		sym := auxToSym(v.Aux)
  3266  		if v_0.Op != OpLOONG64ADDVconst {
  3267  			break
  3268  		}
  3269  		off2 := auxIntToInt64(v_0.AuxInt)
  3270  		ptr := v_0.Args[0]
  3271  		mem := v_1
  3272  		if !(is32Bit(int64(off1)+off2) && (ptr.Op != OpSB || !config.ctxt.Flag_dynlink)) {
  3273  			break
  3274  		}
  3275  		v.reset(OpLOONG64MOVDload)
  3276  		v.AuxInt = int32ToAuxInt(off1 + int32(off2))
  3277  		v.Aux = symToAux(sym)
  3278  		v.AddArg2(ptr, mem)
  3279  		return true
  3280  	}
  3281  	// match: (MOVDload [off1] {sym1} (MOVVaddr [off2] {sym2} ptr) mem)
  3282  	// cond: canMergeSym(sym1,sym2) && is32Bit(int64(off1)+int64(off2)) && (ptr.Op != OpSB || !config.ctxt.Flag_dynlink)
  3283  	// result: (MOVDload [off1+int32(off2)] {mergeSym(sym1,sym2)} ptr mem)
  3284  	for {
  3285  		off1 := auxIntToInt32(v.AuxInt)
  3286  		sym1 := auxToSym(v.Aux)
  3287  		if v_0.Op != OpLOONG64MOVVaddr {
  3288  			break
  3289  		}
  3290  		off2 := auxIntToInt32(v_0.AuxInt)
  3291  		sym2 := auxToSym(v_0.Aux)
  3292  		ptr := v_0.Args[0]
  3293  		mem := v_1
  3294  		if !(canMergeSym(sym1, sym2) && is32Bit(int64(off1)+int64(off2)) && (ptr.Op != OpSB || !config.ctxt.Flag_dynlink)) {
  3295  			break
  3296  		}
  3297  		v.reset(OpLOONG64MOVDload)
  3298  		v.AuxInt = int32ToAuxInt(off1 + int32(off2))
  3299  		v.Aux = symToAux(mergeSym(sym1, sym2))
  3300  		v.AddArg2(ptr, mem)
  3301  		return true
  3302  	}
  3303  	// match: (MOVDload [off] {sym} (ADDV ptr idx) mem)
  3304  	// cond: off == 0 && sym == nil
  3305  	// result: (MOVDloadidx ptr idx mem)
  3306  	for {
  3307  		off := auxIntToInt32(v.AuxInt)
  3308  		sym := auxToSym(v.Aux)
  3309  		if v_0.Op != OpLOONG64ADDV {
  3310  			break
  3311  		}
  3312  		idx := v_0.Args[1]
  3313  		ptr := v_0.Args[0]
  3314  		mem := v_1
  3315  		if !(off == 0 && sym == nil) {
  3316  			break
  3317  		}
  3318  		v.reset(OpLOONG64MOVDloadidx)
  3319  		v.AddArg3(ptr, idx, mem)
  3320  		return true
  3321  	}
  3322  	// match: (MOVDload [off] {sym} (ADDshiftLLV [shift] ptr idx) mem)
  3323  	// cond: off == 0 && sym == nil
  3324  	// result: (MOVDloadidx ptr (SLLVconst <typ.Int64> [shift] idx) mem)
  3325  	for {
  3326  		off := auxIntToInt32(v.AuxInt)
  3327  		sym := auxToSym(v.Aux)
  3328  		if v_0.Op != OpLOONG64ADDshiftLLV {
  3329  			break
  3330  		}
  3331  		shift := auxIntToInt64(v_0.AuxInt)
  3332  		idx := v_0.Args[1]
  3333  		ptr := v_0.Args[0]
  3334  		mem := v_1
  3335  		if !(off == 0 && sym == nil) {
  3336  			break
  3337  		}
  3338  		v.reset(OpLOONG64MOVDloadidx)
  3339  		v0 := b.NewValue0(v.Pos, OpLOONG64SLLVconst, typ.Int64)
  3340  		v0.AuxInt = int64ToAuxInt(shift)
  3341  		v0.AddArg(idx)
  3342  		v.AddArg3(ptr, v0, mem)
  3343  		return true
  3344  	}
  3345  	return false
  3346  }
  3347  func rewriteValueLOONG64_OpLOONG64MOVDloadidx(v *Value) bool {
  3348  	v_2 := v.Args[2]
  3349  	v_1 := v.Args[1]
  3350  	v_0 := v.Args[0]
  3351  	// match: (MOVDloadidx ptr (MOVVconst [c]) mem)
  3352  	// cond: is32Bit(c)
  3353  	// result: (MOVDload [int32(c)] ptr mem)
  3354  	for {
  3355  		ptr := v_0
  3356  		if v_1.Op != OpLOONG64MOVVconst {
  3357  			break
  3358  		}
  3359  		c := auxIntToInt64(v_1.AuxInt)
  3360  		mem := v_2
  3361  		if !(is32Bit(c)) {
  3362  			break
  3363  		}
  3364  		v.reset(OpLOONG64MOVDload)
  3365  		v.AuxInt = int32ToAuxInt(int32(c))
  3366  		v.AddArg2(ptr, mem)
  3367  		return true
  3368  	}
  3369  	// match: (MOVDloadidx (MOVVconst [c]) ptr mem)
  3370  	// cond: is32Bit(c)
  3371  	// result: (MOVDload [int32(c)] ptr mem)
  3372  	for {
  3373  		if v_0.Op != OpLOONG64MOVVconst {
  3374  			break
  3375  		}
  3376  		c := auxIntToInt64(v_0.AuxInt)
  3377  		ptr := v_1
  3378  		mem := v_2
  3379  		if !(is32Bit(c)) {
  3380  			break
  3381  		}
  3382  		v.reset(OpLOONG64MOVDload)
  3383  		v.AuxInt = int32ToAuxInt(int32(c))
  3384  		v.AddArg2(ptr, mem)
  3385  		return true
  3386  	}
  3387  	return false
  3388  }
  3389  func rewriteValueLOONG64_OpLOONG64MOVDstore(v *Value) bool {
  3390  	v_2 := v.Args[2]
  3391  	v_1 := v.Args[1]
  3392  	v_0 := v.Args[0]
  3393  	b := v.Block
  3394  	config := b.Func.Config
  3395  	typ := &b.Func.Config.Types
  3396  	// match: (MOVDstore [off] {sym} ptr (MOVVgpfp val) mem)
  3397  	// result: (MOVVstore [off] {sym} ptr val mem)
  3398  	for {
  3399  		off := auxIntToInt32(v.AuxInt)
  3400  		sym := auxToSym(v.Aux)
  3401  		ptr := v_0
  3402  		if v_1.Op != OpLOONG64MOVVgpfp {
  3403  			break
  3404  		}
  3405  		val := v_1.Args[0]
  3406  		mem := v_2
  3407  		v.reset(OpLOONG64MOVVstore)
  3408  		v.AuxInt = int32ToAuxInt(off)
  3409  		v.Aux = symToAux(sym)
  3410  		v.AddArg3(ptr, val, mem)
  3411  		return true
  3412  	}
  3413  	// match: (MOVDstore [off1] {sym} (ADDVconst [off2] ptr) val mem)
  3414  	// cond: is32Bit(int64(off1)+off2) && (ptr.Op != OpSB || !config.ctxt.Flag_dynlink)
  3415  	// result: (MOVDstore [off1+int32(off2)] {sym} ptr val mem)
  3416  	for {
  3417  		off1 := auxIntToInt32(v.AuxInt)
  3418  		sym := auxToSym(v.Aux)
  3419  		if v_0.Op != OpLOONG64ADDVconst {
  3420  			break
  3421  		}
  3422  		off2 := auxIntToInt64(v_0.AuxInt)
  3423  		ptr := v_0.Args[0]
  3424  		val := v_1
  3425  		mem := v_2
  3426  		if !(is32Bit(int64(off1)+off2) && (ptr.Op != OpSB || !config.ctxt.Flag_dynlink)) {
  3427  			break
  3428  		}
  3429  		v.reset(OpLOONG64MOVDstore)
  3430  		v.AuxInt = int32ToAuxInt(off1 + int32(off2))
  3431  		v.Aux = symToAux(sym)
  3432  		v.AddArg3(ptr, val, mem)
  3433  		return true
  3434  	}
  3435  	// match: (MOVDstore [off1] {sym1} (MOVVaddr [off2] {sym2} ptr) val mem)
  3436  	// cond: canMergeSym(sym1,sym2) && is32Bit(int64(off1)+int64(off2)) && (ptr.Op != OpSB || !config.ctxt.Flag_dynlink)
  3437  	// result: (MOVDstore [off1+int32(off2)] {mergeSym(sym1,sym2)} ptr val mem)
  3438  	for {
  3439  		off1 := auxIntToInt32(v.AuxInt)
  3440  		sym1 := auxToSym(v.Aux)
  3441  		if v_0.Op != OpLOONG64MOVVaddr {
  3442  			break
  3443  		}
  3444  		off2 := auxIntToInt32(v_0.AuxInt)
  3445  		sym2 := auxToSym(v_0.Aux)
  3446  		ptr := v_0.Args[0]
  3447  		val := v_1
  3448  		mem := v_2
  3449  		if !(canMergeSym(sym1, sym2) && is32Bit(int64(off1)+int64(off2)) && (ptr.Op != OpSB || !config.ctxt.Flag_dynlink)) {
  3450  			break
  3451  		}
  3452  		v.reset(OpLOONG64MOVDstore)
  3453  		v.AuxInt = int32ToAuxInt(off1 + int32(off2))
  3454  		v.Aux = symToAux(mergeSym(sym1, sym2))
  3455  		v.AddArg3(ptr, val, mem)
  3456  		return true
  3457  	}
  3458  	// match: (MOVDstore [off] {sym} (ADDV ptr idx) val mem)
  3459  	// cond: off == 0 && sym == nil
  3460  	// result: (MOVDstoreidx ptr idx val mem)
  3461  	for {
  3462  		off := auxIntToInt32(v.AuxInt)
  3463  		sym := auxToSym(v.Aux)
  3464  		if v_0.Op != OpLOONG64ADDV {
  3465  			break
  3466  		}
  3467  		idx := v_0.Args[1]
  3468  		ptr := v_0.Args[0]
  3469  		val := v_1
  3470  		mem := v_2
  3471  		if !(off == 0 && sym == nil) {
  3472  			break
  3473  		}
  3474  		v.reset(OpLOONG64MOVDstoreidx)
  3475  		v.AddArg4(ptr, idx, val, mem)
  3476  		return true
  3477  	}
  3478  	// match: (MOVDstore [off] {sym} (ADDshiftLLV [shift] ptr idx) val mem)
  3479  	// cond: off == 0 && sym == nil
  3480  	// result: (MOVDstoreidx ptr (SLLVconst <typ.Int64> [shift] idx) val mem)
  3481  	for {
  3482  		off := auxIntToInt32(v.AuxInt)
  3483  		sym := auxToSym(v.Aux)
  3484  		if v_0.Op != OpLOONG64ADDshiftLLV {
  3485  			break
  3486  		}
  3487  		shift := auxIntToInt64(v_0.AuxInt)
  3488  		idx := v_0.Args[1]
  3489  		ptr := v_0.Args[0]
  3490  		val := v_1
  3491  		mem := v_2
  3492  		if !(off == 0 && sym == nil) {
  3493  			break
  3494  		}
  3495  		v.reset(OpLOONG64MOVDstoreidx)
  3496  		v0 := b.NewValue0(v.Pos, OpLOONG64SLLVconst, typ.Int64)
  3497  		v0.AuxInt = int64ToAuxInt(shift)
  3498  		v0.AddArg(idx)
  3499  		v.AddArg4(ptr, v0, val, mem)
  3500  		return true
  3501  	}
  3502  	return false
  3503  }
  3504  func rewriteValueLOONG64_OpLOONG64MOVDstoreidx(v *Value) bool {
  3505  	v_3 := v.Args[3]
  3506  	v_2 := v.Args[2]
  3507  	v_1 := v.Args[1]
  3508  	v_0 := v.Args[0]
  3509  	// match: (MOVDstoreidx ptr (MOVVconst [c]) val mem)
  3510  	// cond: is32Bit(c)
  3511  	// result: (MOVDstore [int32(c)] ptr val mem)
  3512  	for {
  3513  		ptr := v_0
  3514  		if v_1.Op != OpLOONG64MOVVconst {
  3515  			break
  3516  		}
  3517  		c := auxIntToInt64(v_1.AuxInt)
  3518  		val := v_2
  3519  		mem := v_3
  3520  		if !(is32Bit(c)) {
  3521  			break
  3522  		}
  3523  		v.reset(OpLOONG64MOVDstore)
  3524  		v.AuxInt = int32ToAuxInt(int32(c))
  3525  		v.AddArg3(ptr, val, mem)
  3526  		return true
  3527  	}
  3528  	// match: (MOVDstoreidx (MOVVconst [c]) idx val mem)
  3529  	// cond: is32Bit(c)
  3530  	// result: (MOVDstore [int32(c)] idx val mem)
  3531  	for {
  3532  		if v_0.Op != OpLOONG64MOVVconst {
  3533  			break
  3534  		}
  3535  		c := auxIntToInt64(v_0.AuxInt)
  3536  		idx := v_1
  3537  		val := v_2
  3538  		mem := v_3
  3539  		if !(is32Bit(c)) {
  3540  			break
  3541  		}
  3542  		v.reset(OpLOONG64MOVDstore)
  3543  		v.AuxInt = int32ToAuxInt(int32(c))
  3544  		v.AddArg3(idx, val, mem)
  3545  		return true
  3546  	}
  3547  	return false
  3548  }
  3549  func rewriteValueLOONG64_OpLOONG64MOVFload(v *Value) bool {
  3550  	v_1 := v.Args[1]
  3551  	v_0 := v.Args[0]
  3552  	b := v.Block
  3553  	config := b.Func.Config
  3554  	typ := &b.Func.Config.Types
  3555  	// match: (MOVFload [off] {sym} ptr (MOVWstore [off] {sym} ptr val _))
  3556  	// result: (MOVWgpfp val)
  3557  	for {
  3558  		off := auxIntToInt32(v.AuxInt)
  3559  		sym := auxToSym(v.Aux)
  3560  		ptr := v_0
  3561  		if v_1.Op != OpLOONG64MOVWstore || auxIntToInt32(v_1.AuxInt) != off || auxToSym(v_1.Aux) != sym {
  3562  			break
  3563  		}
  3564  		val := v_1.Args[1]
  3565  		if ptr != v_1.Args[0] {
  3566  			break
  3567  		}
  3568  		v.reset(OpLOONG64MOVWgpfp)
  3569  		v.AddArg(val)
  3570  		return true
  3571  	}
  3572  	// match: (MOVFload [off1] {sym} (ADDVconst [off2] ptr) mem)
  3573  	// cond: is32Bit(int64(off1)+off2) && (ptr.Op != OpSB || !config.ctxt.Flag_dynlink)
  3574  	// result: (MOVFload [off1+int32(off2)] {sym} ptr mem)
  3575  	for {
  3576  		off1 := auxIntToInt32(v.AuxInt)
  3577  		sym := auxToSym(v.Aux)
  3578  		if v_0.Op != OpLOONG64ADDVconst {
  3579  			break
  3580  		}
  3581  		off2 := auxIntToInt64(v_0.AuxInt)
  3582  		ptr := v_0.Args[0]
  3583  		mem := v_1
  3584  		if !(is32Bit(int64(off1)+off2) && (ptr.Op != OpSB || !config.ctxt.Flag_dynlink)) {
  3585  			break
  3586  		}
  3587  		v.reset(OpLOONG64MOVFload)
  3588  		v.AuxInt = int32ToAuxInt(off1 + int32(off2))
  3589  		v.Aux = symToAux(sym)
  3590  		v.AddArg2(ptr, mem)
  3591  		return true
  3592  	}
  3593  	// match: (MOVFload [off1] {sym1} (MOVVaddr [off2] {sym2} ptr) mem)
  3594  	// cond: canMergeSym(sym1,sym2) && is32Bit(int64(off1)+int64(off2)) && (ptr.Op != OpSB || !config.ctxt.Flag_dynlink)
  3595  	// result: (MOVFload [off1+int32(off2)] {mergeSym(sym1,sym2)} ptr mem)
  3596  	for {
  3597  		off1 := auxIntToInt32(v.AuxInt)
  3598  		sym1 := auxToSym(v.Aux)
  3599  		if v_0.Op != OpLOONG64MOVVaddr {
  3600  			break
  3601  		}
  3602  		off2 := auxIntToInt32(v_0.AuxInt)
  3603  		sym2 := auxToSym(v_0.Aux)
  3604  		ptr := v_0.Args[0]
  3605  		mem := v_1
  3606  		if !(canMergeSym(sym1, sym2) && is32Bit(int64(off1)+int64(off2)) && (ptr.Op != OpSB || !config.ctxt.Flag_dynlink)) {
  3607  			break
  3608  		}
  3609  		v.reset(OpLOONG64MOVFload)
  3610  		v.AuxInt = int32ToAuxInt(off1 + int32(off2))
  3611  		v.Aux = symToAux(mergeSym(sym1, sym2))
  3612  		v.AddArg2(ptr, mem)
  3613  		return true
  3614  	}
  3615  	// match: (MOVFload [off] {sym} (ADDV ptr idx) mem)
  3616  	// cond: off == 0 && sym == nil
  3617  	// result: (MOVFloadidx ptr idx mem)
  3618  	for {
  3619  		off := auxIntToInt32(v.AuxInt)
  3620  		sym := auxToSym(v.Aux)
  3621  		if v_0.Op != OpLOONG64ADDV {
  3622  			break
  3623  		}
  3624  		idx := v_0.Args[1]
  3625  		ptr := v_0.Args[0]
  3626  		mem := v_1
  3627  		if !(off == 0 && sym == nil) {
  3628  			break
  3629  		}
  3630  		v.reset(OpLOONG64MOVFloadidx)
  3631  		v.AddArg3(ptr, idx, mem)
  3632  		return true
  3633  	}
  3634  	// match: (MOVFload [off] {sym} (ADDshiftLLV [shift] ptr idx) mem)
  3635  	// cond: off == 0 && sym == nil
  3636  	// result: (MOVFloadidx ptr (SLLVconst <typ.Int64> [shift] idx) mem)
  3637  	for {
  3638  		off := auxIntToInt32(v.AuxInt)
  3639  		sym := auxToSym(v.Aux)
  3640  		if v_0.Op != OpLOONG64ADDshiftLLV {
  3641  			break
  3642  		}
  3643  		shift := auxIntToInt64(v_0.AuxInt)
  3644  		idx := v_0.Args[1]
  3645  		ptr := v_0.Args[0]
  3646  		mem := v_1
  3647  		if !(off == 0 && sym == nil) {
  3648  			break
  3649  		}
  3650  		v.reset(OpLOONG64MOVFloadidx)
  3651  		v0 := b.NewValue0(v.Pos, OpLOONG64SLLVconst, typ.Int64)
  3652  		v0.AuxInt = int64ToAuxInt(shift)
  3653  		v0.AddArg(idx)
  3654  		v.AddArg3(ptr, v0, mem)
  3655  		return true
  3656  	}
  3657  	return false
  3658  }
  3659  func rewriteValueLOONG64_OpLOONG64MOVFloadidx(v *Value) bool {
  3660  	v_2 := v.Args[2]
  3661  	v_1 := v.Args[1]
  3662  	v_0 := v.Args[0]
  3663  	// match: (MOVFloadidx ptr (MOVVconst [c]) mem)
  3664  	// cond: is32Bit(c)
  3665  	// result: (MOVFload [int32(c)] ptr mem)
  3666  	for {
  3667  		ptr := v_0
  3668  		if v_1.Op != OpLOONG64MOVVconst {
  3669  			break
  3670  		}
  3671  		c := auxIntToInt64(v_1.AuxInt)
  3672  		mem := v_2
  3673  		if !(is32Bit(c)) {
  3674  			break
  3675  		}
  3676  		v.reset(OpLOONG64MOVFload)
  3677  		v.AuxInt = int32ToAuxInt(int32(c))
  3678  		v.AddArg2(ptr, mem)
  3679  		return true
  3680  	}
  3681  	// match: (MOVFloadidx (MOVVconst [c]) ptr mem)
  3682  	// cond: is32Bit(c)
  3683  	// result: (MOVFload [int32(c)] ptr mem)
  3684  	for {
  3685  		if v_0.Op != OpLOONG64MOVVconst {
  3686  			break
  3687  		}
  3688  		c := auxIntToInt64(v_0.AuxInt)
  3689  		ptr := v_1
  3690  		mem := v_2
  3691  		if !(is32Bit(c)) {
  3692  			break
  3693  		}
  3694  		v.reset(OpLOONG64MOVFload)
  3695  		v.AuxInt = int32ToAuxInt(int32(c))
  3696  		v.AddArg2(ptr, mem)
  3697  		return true
  3698  	}
  3699  	return false
  3700  }
  3701  func rewriteValueLOONG64_OpLOONG64MOVFstore(v *Value) bool {
  3702  	v_2 := v.Args[2]
  3703  	v_1 := v.Args[1]
  3704  	v_0 := v.Args[0]
  3705  	b := v.Block
  3706  	config := b.Func.Config
  3707  	typ := &b.Func.Config.Types
  3708  	// match: (MOVFstore [off] {sym} ptr (MOVWgpfp val) mem)
  3709  	// result: (MOVWstore [off] {sym} ptr val mem)
  3710  	for {
  3711  		off := auxIntToInt32(v.AuxInt)
  3712  		sym := auxToSym(v.Aux)
  3713  		ptr := v_0
  3714  		if v_1.Op != OpLOONG64MOVWgpfp {
  3715  			break
  3716  		}
  3717  		val := v_1.Args[0]
  3718  		mem := v_2
  3719  		v.reset(OpLOONG64MOVWstore)
  3720  		v.AuxInt = int32ToAuxInt(off)
  3721  		v.Aux = symToAux(sym)
  3722  		v.AddArg3(ptr, val, mem)
  3723  		return true
  3724  	}
  3725  	// match: (MOVFstore [off1] {sym} (ADDVconst [off2] ptr) val mem)
  3726  	// cond: is32Bit(int64(off1)+off2) && (ptr.Op != OpSB || !config.ctxt.Flag_dynlink)
  3727  	// result: (MOVFstore [off1+int32(off2)] {sym} ptr val mem)
  3728  	for {
  3729  		off1 := auxIntToInt32(v.AuxInt)
  3730  		sym := auxToSym(v.Aux)
  3731  		if v_0.Op != OpLOONG64ADDVconst {
  3732  			break
  3733  		}
  3734  		off2 := auxIntToInt64(v_0.AuxInt)
  3735  		ptr := v_0.Args[0]
  3736  		val := v_1
  3737  		mem := v_2
  3738  		if !(is32Bit(int64(off1)+off2) && (ptr.Op != OpSB || !config.ctxt.Flag_dynlink)) {
  3739  			break
  3740  		}
  3741  		v.reset(OpLOONG64MOVFstore)
  3742  		v.AuxInt = int32ToAuxInt(off1 + int32(off2))
  3743  		v.Aux = symToAux(sym)
  3744  		v.AddArg3(ptr, val, mem)
  3745  		return true
  3746  	}
  3747  	// match: (MOVFstore [off1] {sym1} (MOVVaddr [off2] {sym2} ptr) val mem)
  3748  	// cond: canMergeSym(sym1,sym2) && is32Bit(int64(off1)+int64(off2)) && (ptr.Op != OpSB || !config.ctxt.Flag_dynlink)
  3749  	// result: (MOVFstore [off1+int32(off2)] {mergeSym(sym1,sym2)} ptr val mem)
  3750  	for {
  3751  		off1 := auxIntToInt32(v.AuxInt)
  3752  		sym1 := auxToSym(v.Aux)
  3753  		if v_0.Op != OpLOONG64MOVVaddr {
  3754  			break
  3755  		}
  3756  		off2 := auxIntToInt32(v_0.AuxInt)
  3757  		sym2 := auxToSym(v_0.Aux)
  3758  		ptr := v_0.Args[0]
  3759  		val := v_1
  3760  		mem := v_2
  3761  		if !(canMergeSym(sym1, sym2) && is32Bit(int64(off1)+int64(off2)) && (ptr.Op != OpSB || !config.ctxt.Flag_dynlink)) {
  3762  			break
  3763  		}
  3764  		v.reset(OpLOONG64MOVFstore)
  3765  		v.AuxInt = int32ToAuxInt(off1 + int32(off2))
  3766  		v.Aux = symToAux(mergeSym(sym1, sym2))
  3767  		v.AddArg3(ptr, val, mem)
  3768  		return true
  3769  	}
  3770  	// match: (MOVFstore [off] {sym} (ADDV ptr idx) val mem)
  3771  	// cond: off == 0 && sym == nil
  3772  	// result: (MOVFstoreidx ptr idx val mem)
  3773  	for {
  3774  		off := auxIntToInt32(v.AuxInt)
  3775  		sym := auxToSym(v.Aux)
  3776  		if v_0.Op != OpLOONG64ADDV {
  3777  			break
  3778  		}
  3779  		idx := v_0.Args[1]
  3780  		ptr := v_0.Args[0]
  3781  		val := v_1
  3782  		mem := v_2
  3783  		if !(off == 0 && sym == nil) {
  3784  			break
  3785  		}
  3786  		v.reset(OpLOONG64MOVFstoreidx)
  3787  		v.AddArg4(ptr, idx, val, mem)
  3788  		return true
  3789  	}
  3790  	// match: (MOVFstore [off] {sym} (ADDshiftLLV [shift] ptr idx) val mem)
  3791  	// cond: off == 0 && sym == nil
  3792  	// result: (MOVFstoreidx ptr (SLLVconst <typ.Int64> [shift] idx) val mem)
  3793  	for {
  3794  		off := auxIntToInt32(v.AuxInt)
  3795  		sym := auxToSym(v.Aux)
  3796  		if v_0.Op != OpLOONG64ADDshiftLLV {
  3797  			break
  3798  		}
  3799  		shift := auxIntToInt64(v_0.AuxInt)
  3800  		idx := v_0.Args[1]
  3801  		ptr := v_0.Args[0]
  3802  		val := v_1
  3803  		mem := v_2
  3804  		if !(off == 0 && sym == nil) {
  3805  			break
  3806  		}
  3807  		v.reset(OpLOONG64MOVFstoreidx)
  3808  		v0 := b.NewValue0(v.Pos, OpLOONG64SLLVconst, typ.Int64)
  3809  		v0.AuxInt = int64ToAuxInt(shift)
  3810  		v0.AddArg(idx)
  3811  		v.AddArg4(ptr, v0, val, mem)
  3812  		return true
  3813  	}
  3814  	return false
  3815  }
  3816  func rewriteValueLOONG64_OpLOONG64MOVFstoreidx(v *Value) bool {
  3817  	v_3 := v.Args[3]
  3818  	v_2 := v.Args[2]
  3819  	v_1 := v.Args[1]
  3820  	v_0 := v.Args[0]
  3821  	// match: (MOVFstoreidx ptr (MOVVconst [c]) val mem)
  3822  	// cond: is32Bit(c)
  3823  	// result: (MOVFstore [int32(c)] ptr val mem)
  3824  	for {
  3825  		ptr := v_0
  3826  		if v_1.Op != OpLOONG64MOVVconst {
  3827  			break
  3828  		}
  3829  		c := auxIntToInt64(v_1.AuxInt)
  3830  		val := v_2
  3831  		mem := v_3
  3832  		if !(is32Bit(c)) {
  3833  			break
  3834  		}
  3835  		v.reset(OpLOONG64MOVFstore)
  3836  		v.AuxInt = int32ToAuxInt(int32(c))
  3837  		v.AddArg3(ptr, val, mem)
  3838  		return true
  3839  	}
  3840  	// match: (MOVFstoreidx (MOVVconst [c]) idx val mem)
  3841  	// cond: is32Bit(c)
  3842  	// result: (MOVFstore [int32(c)] idx val mem)
  3843  	for {
  3844  		if v_0.Op != OpLOONG64MOVVconst {
  3845  			break
  3846  		}
  3847  		c := auxIntToInt64(v_0.AuxInt)
  3848  		idx := v_1
  3849  		val := v_2
  3850  		mem := v_3
  3851  		if !(is32Bit(c)) {
  3852  			break
  3853  		}
  3854  		v.reset(OpLOONG64MOVFstore)
  3855  		v.AuxInt = int32ToAuxInt(int32(c))
  3856  		v.AddArg3(idx, val, mem)
  3857  		return true
  3858  	}
  3859  	return false
  3860  }
  3861  func rewriteValueLOONG64_OpLOONG64MOVHUload(v *Value) bool {
  3862  	v_1 := v.Args[1]
  3863  	v_0 := v.Args[0]
  3864  	b := v.Block
  3865  	config := b.Func.Config
  3866  	typ := &b.Func.Config.Types
  3867  	// match: (MOVHUload [off] {sym} ptr (MOVHstore [off] {sym} ptr x _))
  3868  	// result: (MOVHUreg x)
  3869  	for {
  3870  		off := auxIntToInt32(v.AuxInt)
  3871  		sym := auxToSym(v.Aux)
  3872  		ptr := v_0
  3873  		if v_1.Op != OpLOONG64MOVHstore || auxIntToInt32(v_1.AuxInt) != off || auxToSym(v_1.Aux) != sym {
  3874  			break
  3875  		}
  3876  		x := v_1.Args[1]
  3877  		if ptr != v_1.Args[0] {
  3878  			break
  3879  		}
  3880  		v.reset(OpLOONG64MOVHUreg)
  3881  		v.AddArg(x)
  3882  		return true
  3883  	}
  3884  	// match: (MOVHUload [off1] {sym} (ADDVconst [off2] ptr) mem)
  3885  	// cond: is32Bit(int64(off1)+off2) && (ptr.Op != OpSB || !config.ctxt.Flag_dynlink)
  3886  	// result: (MOVHUload [off1+int32(off2)] {sym} ptr mem)
  3887  	for {
  3888  		off1 := auxIntToInt32(v.AuxInt)
  3889  		sym := auxToSym(v.Aux)
  3890  		if v_0.Op != OpLOONG64ADDVconst {
  3891  			break
  3892  		}
  3893  		off2 := auxIntToInt64(v_0.AuxInt)
  3894  		ptr := v_0.Args[0]
  3895  		mem := v_1
  3896  		if !(is32Bit(int64(off1)+off2) && (ptr.Op != OpSB || !config.ctxt.Flag_dynlink)) {
  3897  			break
  3898  		}
  3899  		v.reset(OpLOONG64MOVHUload)
  3900  		v.AuxInt = int32ToAuxInt(off1 + int32(off2))
  3901  		v.Aux = symToAux(sym)
  3902  		v.AddArg2(ptr, mem)
  3903  		return true
  3904  	}
  3905  	// match: (MOVHUload [off1] {sym1} (MOVVaddr [off2] {sym2} ptr) mem)
  3906  	// cond: canMergeSym(sym1,sym2) && is32Bit(int64(off1)+int64(off2)) && (ptr.Op != OpSB || !config.ctxt.Flag_dynlink)
  3907  	// result: (MOVHUload [off1+int32(off2)] {mergeSym(sym1,sym2)} ptr mem)
  3908  	for {
  3909  		off1 := auxIntToInt32(v.AuxInt)
  3910  		sym1 := auxToSym(v.Aux)
  3911  		if v_0.Op != OpLOONG64MOVVaddr {
  3912  			break
  3913  		}
  3914  		off2 := auxIntToInt32(v_0.AuxInt)
  3915  		sym2 := auxToSym(v_0.Aux)
  3916  		ptr := v_0.Args[0]
  3917  		mem := v_1
  3918  		if !(canMergeSym(sym1, sym2) && is32Bit(int64(off1)+int64(off2)) && (ptr.Op != OpSB || !config.ctxt.Flag_dynlink)) {
  3919  			break
  3920  		}
  3921  		v.reset(OpLOONG64MOVHUload)
  3922  		v.AuxInt = int32ToAuxInt(off1 + int32(off2))
  3923  		v.Aux = symToAux(mergeSym(sym1, sym2))
  3924  		v.AddArg2(ptr, mem)
  3925  		return true
  3926  	}
  3927  	// match: (MOVHUload [off] {sym} (ADDV ptr idx) mem)
  3928  	// cond: off == 0 && sym == nil
  3929  	// result: (MOVHUloadidx ptr idx mem)
  3930  	for {
  3931  		off := auxIntToInt32(v.AuxInt)
  3932  		sym := auxToSym(v.Aux)
  3933  		if v_0.Op != OpLOONG64ADDV {
  3934  			break
  3935  		}
  3936  		idx := v_0.Args[1]
  3937  		ptr := v_0.Args[0]
  3938  		mem := v_1
  3939  		if !(off == 0 && sym == nil) {
  3940  			break
  3941  		}
  3942  		v.reset(OpLOONG64MOVHUloadidx)
  3943  		v.AddArg3(ptr, idx, mem)
  3944  		return true
  3945  	}
  3946  	// match: (MOVHUload [off] {sym} (ADDshiftLLV [shift] ptr idx) mem)
  3947  	// cond: off == 0 && sym == nil
  3948  	// result: (MOVHUloadidx ptr (SLLVconst <typ.Int64> [shift] idx) mem)
  3949  	for {
  3950  		off := auxIntToInt32(v.AuxInt)
  3951  		sym := auxToSym(v.Aux)
  3952  		if v_0.Op != OpLOONG64ADDshiftLLV {
  3953  			break
  3954  		}
  3955  		shift := auxIntToInt64(v_0.AuxInt)
  3956  		idx := v_0.Args[1]
  3957  		ptr := v_0.Args[0]
  3958  		mem := v_1
  3959  		if !(off == 0 && sym == nil) {
  3960  			break
  3961  		}
  3962  		v.reset(OpLOONG64MOVHUloadidx)
  3963  		v0 := b.NewValue0(v.Pos, OpLOONG64SLLVconst, typ.Int64)
  3964  		v0.AuxInt = int64ToAuxInt(shift)
  3965  		v0.AddArg(idx)
  3966  		v.AddArg3(ptr, v0, mem)
  3967  		return true
  3968  	}
  3969  	// match: (MOVHUload [off] {sym} (SB) _)
  3970  	// cond: symIsRO(sym)
  3971  	// result: (MOVVconst [int64(read16(sym, int64(off), config.ctxt.Arch.ByteOrder))])
  3972  	for {
  3973  		off := auxIntToInt32(v.AuxInt)
  3974  		sym := auxToSym(v.Aux)
  3975  		if v_0.Op != OpSB || !(symIsRO(sym)) {
  3976  			break
  3977  		}
  3978  		v.reset(OpLOONG64MOVVconst)
  3979  		v.AuxInt = int64ToAuxInt(int64(read16(sym, int64(off), config.ctxt.Arch.ByteOrder)))
  3980  		return true
  3981  	}
  3982  	return false
  3983  }
  3984  func rewriteValueLOONG64_OpLOONG64MOVHUloadidx(v *Value) bool {
  3985  	v_2 := v.Args[2]
  3986  	v_1 := v.Args[1]
  3987  	v_0 := v.Args[0]
  3988  	// match: (MOVHUloadidx ptr (MOVVconst [c]) mem)
  3989  	// cond: is32Bit(c)
  3990  	// result: (MOVHUload [int32(c)] ptr mem)
  3991  	for {
  3992  		ptr := v_0
  3993  		if v_1.Op != OpLOONG64MOVVconst {
  3994  			break
  3995  		}
  3996  		c := auxIntToInt64(v_1.AuxInt)
  3997  		mem := v_2
  3998  		if !(is32Bit(c)) {
  3999  			break
  4000  		}
  4001  		v.reset(OpLOONG64MOVHUload)
  4002  		v.AuxInt = int32ToAuxInt(int32(c))
  4003  		v.AddArg2(ptr, mem)
  4004  		return true
  4005  	}
  4006  	// match: (MOVHUloadidx (MOVVconst [c]) ptr mem)
  4007  	// cond: is32Bit(c)
  4008  	// result: (MOVHUload [int32(c)] ptr mem)
  4009  	for {
  4010  		if v_0.Op != OpLOONG64MOVVconst {
  4011  			break
  4012  		}
  4013  		c := auxIntToInt64(v_0.AuxInt)
  4014  		ptr := v_1
  4015  		mem := v_2
  4016  		if !(is32Bit(c)) {
  4017  			break
  4018  		}
  4019  		v.reset(OpLOONG64MOVHUload)
  4020  		v.AuxInt = int32ToAuxInt(int32(c))
  4021  		v.AddArg2(ptr, mem)
  4022  		return true
  4023  	}
  4024  	return false
  4025  }
  4026  func rewriteValueLOONG64_OpLOONG64MOVHUreg(v *Value) bool {
  4027  	v_0 := v.Args[0]
  4028  	// match: (MOVHUreg (SRLVconst [rc] x))
  4029  	// cond: rc < 16
  4030  	// result: (BSTRPICKV [rc + (15+rc)<<6] x)
  4031  	for {
  4032  		if v_0.Op != OpLOONG64SRLVconst {
  4033  			break
  4034  		}
  4035  		rc := auxIntToInt64(v_0.AuxInt)
  4036  		x := v_0.Args[0]
  4037  		if !(rc < 16) {
  4038  			break
  4039  		}
  4040  		v.reset(OpLOONG64BSTRPICKV)
  4041  		v.AuxInt = int64ToAuxInt(rc + (15+rc)<<6)
  4042  		v.AddArg(x)
  4043  		return true
  4044  	}
  4045  	// match: (MOVHUreg x:(MOVBUload _ _))
  4046  	// result: (MOVVreg x)
  4047  	for {
  4048  		x := v_0
  4049  		if x.Op != OpLOONG64MOVBUload {
  4050  			break
  4051  		}
  4052  		v.reset(OpLOONG64MOVVreg)
  4053  		v.AddArg(x)
  4054  		return true
  4055  	}
  4056  	// match: (MOVHUreg x:(MOVHUload _ _))
  4057  	// result: (MOVVreg x)
  4058  	for {
  4059  		x := v_0
  4060  		if x.Op != OpLOONG64MOVHUload {
  4061  			break
  4062  		}
  4063  		v.reset(OpLOONG64MOVVreg)
  4064  		v.AddArg(x)
  4065  		return true
  4066  	}
  4067  	// match: (MOVHUreg x:(MOVBUloadidx _ _ _))
  4068  	// result: (MOVVreg x)
  4069  	for {
  4070  		x := v_0
  4071  		if x.Op != OpLOONG64MOVBUloadidx {
  4072  			break
  4073  		}
  4074  		v.reset(OpLOONG64MOVVreg)
  4075  		v.AddArg(x)
  4076  		return true
  4077  	}
  4078  	// match: (MOVHUreg x:(MOVHUloadidx _ _ _))
  4079  	// result: (MOVVreg x)
  4080  	for {
  4081  		x := v_0
  4082  		if x.Op != OpLOONG64MOVHUloadidx {
  4083  			break
  4084  		}
  4085  		v.reset(OpLOONG64MOVVreg)
  4086  		v.AddArg(x)
  4087  		return true
  4088  	}
  4089  	// match: (MOVHUreg x:(MOVBUreg _))
  4090  	// result: (MOVVreg x)
  4091  	for {
  4092  		x := v_0
  4093  		if x.Op != OpLOONG64MOVBUreg {
  4094  			break
  4095  		}
  4096  		v.reset(OpLOONG64MOVVreg)
  4097  		v.AddArg(x)
  4098  		return true
  4099  	}
  4100  	// match: (MOVHUreg x:(MOVHUreg _))
  4101  	// result: (MOVVreg x)
  4102  	for {
  4103  		x := v_0
  4104  		if x.Op != OpLOONG64MOVHUreg {
  4105  			break
  4106  		}
  4107  		v.reset(OpLOONG64MOVVreg)
  4108  		v.AddArg(x)
  4109  		return true
  4110  	}
  4111  	// match: (MOVHUreg (SLLVconst [lc] x))
  4112  	// cond: lc >= 16
  4113  	// result: (MOVVconst [0])
  4114  	for {
  4115  		if v_0.Op != OpLOONG64SLLVconst {
  4116  			break
  4117  		}
  4118  		lc := auxIntToInt64(v_0.AuxInt)
  4119  		if !(lc >= 16) {
  4120  			break
  4121  		}
  4122  		v.reset(OpLOONG64MOVVconst)
  4123  		v.AuxInt = int64ToAuxInt(0)
  4124  		return true
  4125  	}
  4126  	// match: (MOVHUreg (MOVVconst [c]))
  4127  	// result: (MOVVconst [int64(uint16(c))])
  4128  	for {
  4129  		if v_0.Op != OpLOONG64MOVVconst {
  4130  			break
  4131  		}
  4132  		c := auxIntToInt64(v_0.AuxInt)
  4133  		v.reset(OpLOONG64MOVVconst)
  4134  		v.AuxInt = int64ToAuxInt(int64(uint16(c)))
  4135  		return true
  4136  	}
  4137  	// match: (MOVHUreg x:(SRLconst [c] y))
  4138  	// cond: c >= 16
  4139  	// result: x
  4140  	for {
  4141  		x := v_0
  4142  		if x.Op != OpLOONG64SRLconst {
  4143  			break
  4144  		}
  4145  		c := auxIntToInt64(x.AuxInt)
  4146  		if !(c >= 16) {
  4147  			break
  4148  		}
  4149  		v.copyOf(x)
  4150  		return true
  4151  	}
  4152  	// match: (MOVHUreg x:(ANDconst [c] y))
  4153  	// cond: c >= 0 && int64(uint16(c)) == c
  4154  	// result: x
  4155  	for {
  4156  		x := v_0
  4157  		if x.Op != OpLOONG64ANDconst {
  4158  			break
  4159  		}
  4160  		c := auxIntToInt64(x.AuxInt)
  4161  		if !(c >= 0 && int64(uint16(c)) == c) {
  4162  			break
  4163  		}
  4164  		v.copyOf(x)
  4165  		return true
  4166  	}
  4167  	return false
  4168  }
  4169  func rewriteValueLOONG64_OpLOONG64MOVHload(v *Value) bool {
  4170  	v_1 := v.Args[1]
  4171  	v_0 := v.Args[0]
  4172  	b := v.Block
  4173  	config := b.Func.Config
  4174  	typ := &b.Func.Config.Types
  4175  	// match: (MOVHload [off] {sym} ptr (MOVHstore [off] {sym} ptr x _))
  4176  	// result: (MOVHreg x)
  4177  	for {
  4178  		off := auxIntToInt32(v.AuxInt)
  4179  		sym := auxToSym(v.Aux)
  4180  		ptr := v_0
  4181  		if v_1.Op != OpLOONG64MOVHstore || auxIntToInt32(v_1.AuxInt) != off || auxToSym(v_1.Aux) != sym {
  4182  			break
  4183  		}
  4184  		x := v_1.Args[1]
  4185  		if ptr != v_1.Args[0] {
  4186  			break
  4187  		}
  4188  		v.reset(OpLOONG64MOVHreg)
  4189  		v.AddArg(x)
  4190  		return true
  4191  	}
  4192  	// match: (MOVHload [off1] {sym} (ADDVconst [off2] ptr) mem)
  4193  	// cond: is32Bit(int64(off1)+off2) && (ptr.Op != OpSB || !config.ctxt.Flag_dynlink)
  4194  	// result: (MOVHload [off1+int32(off2)] {sym} ptr mem)
  4195  	for {
  4196  		off1 := auxIntToInt32(v.AuxInt)
  4197  		sym := auxToSym(v.Aux)
  4198  		if v_0.Op != OpLOONG64ADDVconst {
  4199  			break
  4200  		}
  4201  		off2 := auxIntToInt64(v_0.AuxInt)
  4202  		ptr := v_0.Args[0]
  4203  		mem := v_1
  4204  		if !(is32Bit(int64(off1)+off2) && (ptr.Op != OpSB || !config.ctxt.Flag_dynlink)) {
  4205  			break
  4206  		}
  4207  		v.reset(OpLOONG64MOVHload)
  4208  		v.AuxInt = int32ToAuxInt(off1 + int32(off2))
  4209  		v.Aux = symToAux(sym)
  4210  		v.AddArg2(ptr, mem)
  4211  		return true
  4212  	}
  4213  	// match: (MOVHload [off1] {sym1} (MOVVaddr [off2] {sym2} ptr) mem)
  4214  	// cond: canMergeSym(sym1,sym2) && is32Bit(int64(off1)+int64(off2)) && (ptr.Op != OpSB || !config.ctxt.Flag_dynlink)
  4215  	// result: (MOVHload [off1+int32(off2)] {mergeSym(sym1,sym2)} ptr mem)
  4216  	for {
  4217  		off1 := auxIntToInt32(v.AuxInt)
  4218  		sym1 := auxToSym(v.Aux)
  4219  		if v_0.Op != OpLOONG64MOVVaddr {
  4220  			break
  4221  		}
  4222  		off2 := auxIntToInt32(v_0.AuxInt)
  4223  		sym2 := auxToSym(v_0.Aux)
  4224  		ptr := v_0.Args[0]
  4225  		mem := v_1
  4226  		if !(canMergeSym(sym1, sym2) && is32Bit(int64(off1)+int64(off2)) && (ptr.Op != OpSB || !config.ctxt.Flag_dynlink)) {
  4227  			break
  4228  		}
  4229  		v.reset(OpLOONG64MOVHload)
  4230  		v.AuxInt = int32ToAuxInt(off1 + int32(off2))
  4231  		v.Aux = symToAux(mergeSym(sym1, sym2))
  4232  		v.AddArg2(ptr, mem)
  4233  		return true
  4234  	}
  4235  	// match: (MOVHload [off] {sym} (ADDV ptr idx) mem)
  4236  	// cond: off == 0 && sym == nil
  4237  	// result: (MOVHloadidx ptr idx mem)
  4238  	for {
  4239  		off := auxIntToInt32(v.AuxInt)
  4240  		sym := auxToSym(v.Aux)
  4241  		if v_0.Op != OpLOONG64ADDV {
  4242  			break
  4243  		}
  4244  		idx := v_0.Args[1]
  4245  		ptr := v_0.Args[0]
  4246  		mem := v_1
  4247  		if !(off == 0 && sym == nil) {
  4248  			break
  4249  		}
  4250  		v.reset(OpLOONG64MOVHloadidx)
  4251  		v.AddArg3(ptr, idx, mem)
  4252  		return true
  4253  	}
  4254  	// match: (MOVHload [off] {sym} (ADDshiftLLV [shift] ptr idx) mem)
  4255  	// cond: off == 0 && sym == nil
  4256  	// result: (MOVHloadidx ptr (SLLVconst <typ.Int64> [shift] idx) mem)
  4257  	for {
  4258  		off := auxIntToInt32(v.AuxInt)
  4259  		sym := auxToSym(v.Aux)
  4260  		if v_0.Op != OpLOONG64ADDshiftLLV {
  4261  			break
  4262  		}
  4263  		shift := auxIntToInt64(v_0.AuxInt)
  4264  		idx := v_0.Args[1]
  4265  		ptr := v_0.Args[0]
  4266  		mem := v_1
  4267  		if !(off == 0 && sym == nil) {
  4268  			break
  4269  		}
  4270  		v.reset(OpLOONG64MOVHloadidx)
  4271  		v0 := b.NewValue0(v.Pos, OpLOONG64SLLVconst, typ.Int64)
  4272  		v0.AuxInt = int64ToAuxInt(shift)
  4273  		v0.AddArg(idx)
  4274  		v.AddArg3(ptr, v0, mem)
  4275  		return true
  4276  	}
  4277  	// match: (MOVHload [off] {sym} (SB) _)
  4278  	// cond: symIsRO(sym)
  4279  	// result: (MOVVconst [int64(int16(read16(sym, int64(off), config.ctxt.Arch.ByteOrder)))])
  4280  	for {
  4281  		off := auxIntToInt32(v.AuxInt)
  4282  		sym := auxToSym(v.Aux)
  4283  		if v_0.Op != OpSB || !(symIsRO(sym)) {
  4284  			break
  4285  		}
  4286  		v.reset(OpLOONG64MOVVconst)
  4287  		v.AuxInt = int64ToAuxInt(int64(int16(read16(sym, int64(off), config.ctxt.Arch.ByteOrder))))
  4288  		return true
  4289  	}
  4290  	return false
  4291  }
  4292  func rewriteValueLOONG64_OpLOONG64MOVHloadidx(v *Value) bool {
  4293  	v_2 := v.Args[2]
  4294  	v_1 := v.Args[1]
  4295  	v_0 := v.Args[0]
  4296  	// match: (MOVHloadidx ptr (MOVVconst [c]) mem)
  4297  	// cond: is32Bit(c)
  4298  	// result: (MOVHload [int32(c)] ptr mem)
  4299  	for {
  4300  		ptr := v_0
  4301  		if v_1.Op != OpLOONG64MOVVconst {
  4302  			break
  4303  		}
  4304  		c := auxIntToInt64(v_1.AuxInt)
  4305  		mem := v_2
  4306  		if !(is32Bit(c)) {
  4307  			break
  4308  		}
  4309  		v.reset(OpLOONG64MOVHload)
  4310  		v.AuxInt = int32ToAuxInt(int32(c))
  4311  		v.AddArg2(ptr, mem)
  4312  		return true
  4313  	}
  4314  	// match: (MOVHloadidx (MOVVconst [c]) ptr mem)
  4315  	// cond: is32Bit(c)
  4316  	// result: (MOVHload [int32(c)] ptr mem)
  4317  	for {
  4318  		if v_0.Op != OpLOONG64MOVVconst {
  4319  			break
  4320  		}
  4321  		c := auxIntToInt64(v_0.AuxInt)
  4322  		ptr := v_1
  4323  		mem := v_2
  4324  		if !(is32Bit(c)) {
  4325  			break
  4326  		}
  4327  		v.reset(OpLOONG64MOVHload)
  4328  		v.AuxInt = int32ToAuxInt(int32(c))
  4329  		v.AddArg2(ptr, mem)
  4330  		return true
  4331  	}
  4332  	return false
  4333  }
  4334  func rewriteValueLOONG64_OpLOONG64MOVHreg(v *Value) bool {
  4335  	v_0 := v.Args[0]
  4336  	// match: (MOVHreg x:(MOVBload _ _))
  4337  	// result: (MOVVreg x)
  4338  	for {
  4339  		x := v_0
  4340  		if x.Op != OpLOONG64MOVBload {
  4341  			break
  4342  		}
  4343  		v.reset(OpLOONG64MOVVreg)
  4344  		v.AddArg(x)
  4345  		return true
  4346  	}
  4347  	// match: (MOVHreg x:(MOVBUload _ _))
  4348  	// result: (MOVVreg x)
  4349  	for {
  4350  		x := v_0
  4351  		if x.Op != OpLOONG64MOVBUload {
  4352  			break
  4353  		}
  4354  		v.reset(OpLOONG64MOVVreg)
  4355  		v.AddArg(x)
  4356  		return true
  4357  	}
  4358  	// match: (MOVHreg x:(MOVHload _ _))
  4359  	// result: (MOVVreg x)
  4360  	for {
  4361  		x := v_0
  4362  		if x.Op != OpLOONG64MOVHload {
  4363  			break
  4364  		}
  4365  		v.reset(OpLOONG64MOVVreg)
  4366  		v.AddArg(x)
  4367  		return true
  4368  	}
  4369  	// match: (MOVHreg x:(MOVBloadidx _ _ _))
  4370  	// result: (MOVVreg x)
  4371  	for {
  4372  		x := v_0
  4373  		if x.Op != OpLOONG64MOVBloadidx {
  4374  			break
  4375  		}
  4376  		v.reset(OpLOONG64MOVVreg)
  4377  		v.AddArg(x)
  4378  		return true
  4379  	}
  4380  	// match: (MOVHreg x:(MOVBUloadidx _ _ _))
  4381  	// result: (MOVVreg x)
  4382  	for {
  4383  		x := v_0
  4384  		if x.Op != OpLOONG64MOVBUloadidx {
  4385  			break
  4386  		}
  4387  		v.reset(OpLOONG64MOVVreg)
  4388  		v.AddArg(x)
  4389  		return true
  4390  	}
  4391  	// match: (MOVHreg x:(MOVHloadidx _ _ _))
  4392  	// result: (MOVVreg x)
  4393  	for {
  4394  		x := v_0
  4395  		if x.Op != OpLOONG64MOVHloadidx {
  4396  			break
  4397  		}
  4398  		v.reset(OpLOONG64MOVVreg)
  4399  		v.AddArg(x)
  4400  		return true
  4401  	}
  4402  	// match: (MOVHreg x:(MOVBreg _))
  4403  	// result: (MOVVreg x)
  4404  	for {
  4405  		x := v_0
  4406  		if x.Op != OpLOONG64MOVBreg {
  4407  			break
  4408  		}
  4409  		v.reset(OpLOONG64MOVVreg)
  4410  		v.AddArg(x)
  4411  		return true
  4412  	}
  4413  	// match: (MOVHreg x:(MOVBUreg _))
  4414  	// result: (MOVVreg x)
  4415  	for {
  4416  		x := v_0
  4417  		if x.Op != OpLOONG64MOVBUreg {
  4418  			break
  4419  		}
  4420  		v.reset(OpLOONG64MOVVreg)
  4421  		v.AddArg(x)
  4422  		return true
  4423  	}
  4424  	// match: (MOVHreg x:(MOVHreg _))
  4425  	// result: (MOVVreg x)
  4426  	for {
  4427  		x := v_0
  4428  		if x.Op != OpLOONG64MOVHreg {
  4429  			break
  4430  		}
  4431  		v.reset(OpLOONG64MOVVreg)
  4432  		v.AddArg(x)
  4433  		return true
  4434  	}
  4435  	// match: (MOVHreg (MOVVconst [c]))
  4436  	// result: (MOVVconst [int64(int16(c))])
  4437  	for {
  4438  		if v_0.Op != OpLOONG64MOVVconst {
  4439  			break
  4440  		}
  4441  		c := auxIntToInt64(v_0.AuxInt)
  4442  		v.reset(OpLOONG64MOVVconst)
  4443  		v.AuxInt = int64ToAuxInt(int64(int16(c)))
  4444  		return true
  4445  	}
  4446  	// match: (MOVHreg x:(ANDconst [c] y))
  4447  	// cond: c >= 0 && int64(int16(c)) == c
  4448  	// result: x
  4449  	for {
  4450  		x := v_0
  4451  		if x.Op != OpLOONG64ANDconst {
  4452  			break
  4453  		}
  4454  		c := auxIntToInt64(x.AuxInt)
  4455  		if !(c >= 0 && int64(int16(c)) == c) {
  4456  			break
  4457  		}
  4458  		v.copyOf(x)
  4459  		return true
  4460  	}
  4461  	return false
  4462  }
  4463  func rewriteValueLOONG64_OpLOONG64MOVHstore(v *Value) bool {
  4464  	v_2 := v.Args[2]
  4465  	v_1 := v.Args[1]
  4466  	v_0 := v.Args[0]
  4467  	b := v.Block
  4468  	config := b.Func.Config
  4469  	typ := &b.Func.Config.Types
  4470  	// match: (MOVHstore [off1] {sym} (ADDVconst [off2] ptr) val mem)
  4471  	// cond: is32Bit(int64(off1)+off2) && (ptr.Op != OpSB || !config.ctxt.Flag_dynlink)
  4472  	// result: (MOVHstore [off1+int32(off2)] {sym} ptr val mem)
  4473  	for {
  4474  		off1 := auxIntToInt32(v.AuxInt)
  4475  		sym := auxToSym(v.Aux)
  4476  		if v_0.Op != OpLOONG64ADDVconst {
  4477  			break
  4478  		}
  4479  		off2 := auxIntToInt64(v_0.AuxInt)
  4480  		ptr := v_0.Args[0]
  4481  		val := v_1
  4482  		mem := v_2
  4483  		if !(is32Bit(int64(off1)+off2) && (ptr.Op != OpSB || !config.ctxt.Flag_dynlink)) {
  4484  			break
  4485  		}
  4486  		v.reset(OpLOONG64MOVHstore)
  4487  		v.AuxInt = int32ToAuxInt(off1 + int32(off2))
  4488  		v.Aux = symToAux(sym)
  4489  		v.AddArg3(ptr, val, mem)
  4490  		return true
  4491  	}
  4492  	// match: (MOVHstore [off1] {sym1} (MOVVaddr [off2] {sym2} ptr) val mem)
  4493  	// cond: canMergeSym(sym1,sym2) && is32Bit(int64(off1)+int64(off2)) && (ptr.Op != OpSB || !config.ctxt.Flag_dynlink)
  4494  	// result: (MOVHstore [off1+int32(off2)] {mergeSym(sym1,sym2)} ptr val mem)
  4495  	for {
  4496  		off1 := auxIntToInt32(v.AuxInt)
  4497  		sym1 := auxToSym(v.Aux)
  4498  		if v_0.Op != OpLOONG64MOVVaddr {
  4499  			break
  4500  		}
  4501  		off2 := auxIntToInt32(v_0.AuxInt)
  4502  		sym2 := auxToSym(v_0.Aux)
  4503  		ptr := v_0.Args[0]
  4504  		val := v_1
  4505  		mem := v_2
  4506  		if !(canMergeSym(sym1, sym2) && is32Bit(int64(off1)+int64(off2)) && (ptr.Op != OpSB || !config.ctxt.Flag_dynlink)) {
  4507  			break
  4508  		}
  4509  		v.reset(OpLOONG64MOVHstore)
  4510  		v.AuxInt = int32ToAuxInt(off1 + int32(off2))
  4511  		v.Aux = symToAux(mergeSym(sym1, sym2))
  4512  		v.AddArg3(ptr, val, mem)
  4513  		return true
  4514  	}
  4515  	// match: (MOVHstore [off] {sym} ptr (MOVHreg x) mem)
  4516  	// result: (MOVHstore [off] {sym} ptr x mem)
  4517  	for {
  4518  		off := auxIntToInt32(v.AuxInt)
  4519  		sym := auxToSym(v.Aux)
  4520  		ptr := v_0
  4521  		if v_1.Op != OpLOONG64MOVHreg {
  4522  			break
  4523  		}
  4524  		x := v_1.Args[0]
  4525  		mem := v_2
  4526  		v.reset(OpLOONG64MOVHstore)
  4527  		v.AuxInt = int32ToAuxInt(off)
  4528  		v.Aux = symToAux(sym)
  4529  		v.AddArg3(ptr, x, mem)
  4530  		return true
  4531  	}
  4532  	// match: (MOVHstore [off] {sym} ptr (MOVHUreg x) mem)
  4533  	// result: (MOVHstore [off] {sym} ptr x mem)
  4534  	for {
  4535  		off := auxIntToInt32(v.AuxInt)
  4536  		sym := auxToSym(v.Aux)
  4537  		ptr := v_0
  4538  		if v_1.Op != OpLOONG64MOVHUreg {
  4539  			break
  4540  		}
  4541  		x := v_1.Args[0]
  4542  		mem := v_2
  4543  		v.reset(OpLOONG64MOVHstore)
  4544  		v.AuxInt = int32ToAuxInt(off)
  4545  		v.Aux = symToAux(sym)
  4546  		v.AddArg3(ptr, x, mem)
  4547  		return true
  4548  	}
  4549  	// match: (MOVHstore [off] {sym} ptr (MOVWreg x) mem)
  4550  	// result: (MOVHstore [off] {sym} ptr x mem)
  4551  	for {
  4552  		off := auxIntToInt32(v.AuxInt)
  4553  		sym := auxToSym(v.Aux)
  4554  		ptr := v_0
  4555  		if v_1.Op != OpLOONG64MOVWreg {
  4556  			break
  4557  		}
  4558  		x := v_1.Args[0]
  4559  		mem := v_2
  4560  		v.reset(OpLOONG64MOVHstore)
  4561  		v.AuxInt = int32ToAuxInt(off)
  4562  		v.Aux = symToAux(sym)
  4563  		v.AddArg3(ptr, x, mem)
  4564  		return true
  4565  	}
  4566  	// match: (MOVHstore [off] {sym} ptr (MOVWUreg x) mem)
  4567  	// result: (MOVHstore [off] {sym} ptr x mem)
  4568  	for {
  4569  		off := auxIntToInt32(v.AuxInt)
  4570  		sym := auxToSym(v.Aux)
  4571  		ptr := v_0
  4572  		if v_1.Op != OpLOONG64MOVWUreg {
  4573  			break
  4574  		}
  4575  		x := v_1.Args[0]
  4576  		mem := v_2
  4577  		v.reset(OpLOONG64MOVHstore)
  4578  		v.AuxInt = int32ToAuxInt(off)
  4579  		v.Aux = symToAux(sym)
  4580  		v.AddArg3(ptr, x, mem)
  4581  		return true
  4582  	}
  4583  	// match: (MOVHstore [off] {sym} (ADDV ptr idx) val mem)
  4584  	// cond: off == 0 && sym == nil
  4585  	// result: (MOVHstoreidx ptr idx val mem)
  4586  	for {
  4587  		off := auxIntToInt32(v.AuxInt)
  4588  		sym := auxToSym(v.Aux)
  4589  		if v_0.Op != OpLOONG64ADDV {
  4590  			break
  4591  		}
  4592  		idx := v_0.Args[1]
  4593  		ptr := v_0.Args[0]
  4594  		val := v_1
  4595  		mem := v_2
  4596  		if !(off == 0 && sym == nil) {
  4597  			break
  4598  		}
  4599  		v.reset(OpLOONG64MOVHstoreidx)
  4600  		v.AddArg4(ptr, idx, val, mem)
  4601  		return true
  4602  	}
  4603  	// match: (MOVHstore [off] {sym} (ADDshiftLLV [shift] ptr idx) val mem)
  4604  	// cond: off == 0 && sym == nil
  4605  	// result: (MOVHstoreidx ptr (SLLVconst <typ.Int64> [shift] idx) val mem)
  4606  	for {
  4607  		off := auxIntToInt32(v.AuxInt)
  4608  		sym := auxToSym(v.Aux)
  4609  		if v_0.Op != OpLOONG64ADDshiftLLV {
  4610  			break
  4611  		}
  4612  		shift := auxIntToInt64(v_0.AuxInt)
  4613  		idx := v_0.Args[1]
  4614  		ptr := v_0.Args[0]
  4615  		val := v_1
  4616  		mem := v_2
  4617  		if !(off == 0 && sym == nil) {
  4618  			break
  4619  		}
  4620  		v.reset(OpLOONG64MOVHstoreidx)
  4621  		v0 := b.NewValue0(v.Pos, OpLOONG64SLLVconst, typ.Int64)
  4622  		v0.AuxInt = int64ToAuxInt(shift)
  4623  		v0.AddArg(idx)
  4624  		v.AddArg4(ptr, v0, val, mem)
  4625  		return true
  4626  	}
  4627  	return false
  4628  }
  4629  func rewriteValueLOONG64_OpLOONG64MOVHstoreidx(v *Value) bool {
  4630  	v_3 := v.Args[3]
  4631  	v_2 := v.Args[2]
  4632  	v_1 := v.Args[1]
  4633  	v_0 := v.Args[0]
  4634  	// match: (MOVHstoreidx ptr (MOVVconst [c]) val mem)
  4635  	// cond: is32Bit(c)
  4636  	// result: (MOVHstore [int32(c)] ptr val mem)
  4637  	for {
  4638  		ptr := v_0
  4639  		if v_1.Op != OpLOONG64MOVVconst {
  4640  			break
  4641  		}
  4642  		c := auxIntToInt64(v_1.AuxInt)
  4643  		val := v_2
  4644  		mem := v_3
  4645  		if !(is32Bit(c)) {
  4646  			break
  4647  		}
  4648  		v.reset(OpLOONG64MOVHstore)
  4649  		v.AuxInt = int32ToAuxInt(int32(c))
  4650  		v.AddArg3(ptr, val, mem)
  4651  		return true
  4652  	}
  4653  	// match: (MOVHstoreidx (MOVVconst [c]) idx val mem)
  4654  	// cond: is32Bit(c)
  4655  	// result: (MOVHstore [int32(c)] idx val mem)
  4656  	for {
  4657  		if v_0.Op != OpLOONG64MOVVconst {
  4658  			break
  4659  		}
  4660  		c := auxIntToInt64(v_0.AuxInt)
  4661  		idx := v_1
  4662  		val := v_2
  4663  		mem := v_3
  4664  		if !(is32Bit(c)) {
  4665  			break
  4666  		}
  4667  		v.reset(OpLOONG64MOVHstore)
  4668  		v.AuxInt = int32ToAuxInt(int32(c))
  4669  		v.AddArg3(idx, val, mem)
  4670  		return true
  4671  	}
  4672  	return false
  4673  }
  4674  func rewriteValueLOONG64_OpLOONG64MOVVload(v *Value) bool {
  4675  	v_1 := v.Args[1]
  4676  	v_0 := v.Args[0]
  4677  	b := v.Block
  4678  	config := b.Func.Config
  4679  	typ := &b.Func.Config.Types
  4680  	// match: (MOVVload [off] {sym} ptr (MOVDstore [off] {sym} ptr val _))
  4681  	// result: (MOVVfpgp val)
  4682  	for {
  4683  		off := auxIntToInt32(v.AuxInt)
  4684  		sym := auxToSym(v.Aux)
  4685  		ptr := v_0
  4686  		if v_1.Op != OpLOONG64MOVDstore || auxIntToInt32(v_1.AuxInt) != off || auxToSym(v_1.Aux) != sym {
  4687  			break
  4688  		}
  4689  		val := v_1.Args[1]
  4690  		if ptr != v_1.Args[0] {
  4691  			break
  4692  		}
  4693  		v.reset(OpLOONG64MOVVfpgp)
  4694  		v.AddArg(val)
  4695  		return true
  4696  	}
  4697  	// match: (MOVVload [off] {sym} ptr (MOVVstore [off] {sym} ptr x _))
  4698  	// result: (MOVVreg x)
  4699  	for {
  4700  		off := auxIntToInt32(v.AuxInt)
  4701  		sym := auxToSym(v.Aux)
  4702  		ptr := v_0
  4703  		if v_1.Op != OpLOONG64MOVVstore || auxIntToInt32(v_1.AuxInt) != off || auxToSym(v_1.Aux) != sym {
  4704  			break
  4705  		}
  4706  		x := v_1.Args[1]
  4707  		if ptr != v_1.Args[0] {
  4708  			break
  4709  		}
  4710  		v.reset(OpLOONG64MOVVreg)
  4711  		v.AddArg(x)
  4712  		return true
  4713  	}
  4714  	// match: (MOVVload [off1] {sym} (ADDVconst [off2] ptr) mem)
  4715  	// cond: is32Bit(int64(off1)+off2) && (ptr.Op != OpSB || !config.ctxt.Flag_dynlink)
  4716  	// result: (MOVVload [off1+int32(off2)] {sym} ptr mem)
  4717  	for {
  4718  		off1 := auxIntToInt32(v.AuxInt)
  4719  		sym := auxToSym(v.Aux)
  4720  		if v_0.Op != OpLOONG64ADDVconst {
  4721  			break
  4722  		}
  4723  		off2 := auxIntToInt64(v_0.AuxInt)
  4724  		ptr := v_0.Args[0]
  4725  		mem := v_1
  4726  		if !(is32Bit(int64(off1)+off2) && (ptr.Op != OpSB || !config.ctxt.Flag_dynlink)) {
  4727  			break
  4728  		}
  4729  		v.reset(OpLOONG64MOVVload)
  4730  		v.AuxInt = int32ToAuxInt(off1 + int32(off2))
  4731  		v.Aux = symToAux(sym)
  4732  		v.AddArg2(ptr, mem)
  4733  		return true
  4734  	}
  4735  	// match: (MOVVload [off1] {sym1} (MOVVaddr [off2] {sym2} ptr) mem)
  4736  	// cond: canMergeSym(sym1,sym2) && is32Bit(int64(off1)+int64(off2)) && (ptr.Op != OpSB || !config.ctxt.Flag_dynlink)
  4737  	// result: (MOVVload [off1+int32(off2)] {mergeSym(sym1,sym2)} ptr mem)
  4738  	for {
  4739  		off1 := auxIntToInt32(v.AuxInt)
  4740  		sym1 := auxToSym(v.Aux)
  4741  		if v_0.Op != OpLOONG64MOVVaddr {
  4742  			break
  4743  		}
  4744  		off2 := auxIntToInt32(v_0.AuxInt)
  4745  		sym2 := auxToSym(v_0.Aux)
  4746  		ptr := v_0.Args[0]
  4747  		mem := v_1
  4748  		if !(canMergeSym(sym1, sym2) && is32Bit(int64(off1)+int64(off2)) && (ptr.Op != OpSB || !config.ctxt.Flag_dynlink)) {
  4749  			break
  4750  		}
  4751  		v.reset(OpLOONG64MOVVload)
  4752  		v.AuxInt = int32ToAuxInt(off1 + int32(off2))
  4753  		v.Aux = symToAux(mergeSym(sym1, sym2))
  4754  		v.AddArg2(ptr, mem)
  4755  		return true
  4756  	}
  4757  	// match: (MOVVload [off] {sym} (ADDV ptr idx) mem)
  4758  	// cond: off == 0 && sym == nil
  4759  	// result: (MOVVloadidx ptr idx mem)
  4760  	for {
  4761  		off := auxIntToInt32(v.AuxInt)
  4762  		sym := auxToSym(v.Aux)
  4763  		if v_0.Op != OpLOONG64ADDV {
  4764  			break
  4765  		}
  4766  		idx := v_0.Args[1]
  4767  		ptr := v_0.Args[0]
  4768  		mem := v_1
  4769  		if !(off == 0 && sym == nil) {
  4770  			break
  4771  		}
  4772  		v.reset(OpLOONG64MOVVloadidx)
  4773  		v.AddArg3(ptr, idx, mem)
  4774  		return true
  4775  	}
  4776  	// match: (MOVVload [off] {sym} (ADDshiftLLV [shift] ptr idx) mem)
  4777  	// cond: off == 0 && sym == nil
  4778  	// result: (MOVVloadidx ptr (SLLVconst <typ.Int64> [shift] idx) mem)
  4779  	for {
  4780  		off := auxIntToInt32(v.AuxInt)
  4781  		sym := auxToSym(v.Aux)
  4782  		if v_0.Op != OpLOONG64ADDshiftLLV {
  4783  			break
  4784  		}
  4785  		shift := auxIntToInt64(v_0.AuxInt)
  4786  		idx := v_0.Args[1]
  4787  		ptr := v_0.Args[0]
  4788  		mem := v_1
  4789  		if !(off == 0 && sym == nil) {
  4790  			break
  4791  		}
  4792  		v.reset(OpLOONG64MOVVloadidx)
  4793  		v0 := b.NewValue0(v.Pos, OpLOONG64SLLVconst, typ.Int64)
  4794  		v0.AuxInt = int64ToAuxInt(shift)
  4795  		v0.AddArg(idx)
  4796  		v.AddArg3(ptr, v0, mem)
  4797  		return true
  4798  	}
  4799  	// match: (MOVVload [off] {sym} (SB) _)
  4800  	// cond: symIsRO(sym)
  4801  	// result: (MOVVconst [int64(read64(sym, int64(off), config.ctxt.Arch.ByteOrder))])
  4802  	for {
  4803  		off := auxIntToInt32(v.AuxInt)
  4804  		sym := auxToSym(v.Aux)
  4805  		if v_0.Op != OpSB || !(symIsRO(sym)) {
  4806  			break
  4807  		}
  4808  		v.reset(OpLOONG64MOVVconst)
  4809  		v.AuxInt = int64ToAuxInt(int64(read64(sym, int64(off), config.ctxt.Arch.ByteOrder)))
  4810  		return true
  4811  	}
  4812  	return false
  4813  }
  4814  func rewriteValueLOONG64_OpLOONG64MOVVloadidx(v *Value) bool {
  4815  	v_2 := v.Args[2]
  4816  	v_1 := v.Args[1]
  4817  	v_0 := v.Args[0]
  4818  	// match: (MOVVloadidx ptr (MOVVconst [c]) mem)
  4819  	// cond: is32Bit(c)
  4820  	// result: (MOVVload [int32(c)] ptr mem)
  4821  	for {
  4822  		ptr := v_0
  4823  		if v_1.Op != OpLOONG64MOVVconst {
  4824  			break
  4825  		}
  4826  		c := auxIntToInt64(v_1.AuxInt)
  4827  		mem := v_2
  4828  		if !(is32Bit(c)) {
  4829  			break
  4830  		}
  4831  		v.reset(OpLOONG64MOVVload)
  4832  		v.AuxInt = int32ToAuxInt(int32(c))
  4833  		v.AddArg2(ptr, mem)
  4834  		return true
  4835  	}
  4836  	// match: (MOVVloadidx (MOVVconst [c]) ptr mem)
  4837  	// cond: is32Bit(c)
  4838  	// result: (MOVVload [int32(c)] ptr mem)
  4839  	for {
  4840  		if v_0.Op != OpLOONG64MOVVconst {
  4841  			break
  4842  		}
  4843  		c := auxIntToInt64(v_0.AuxInt)
  4844  		ptr := v_1
  4845  		mem := v_2
  4846  		if !(is32Bit(c)) {
  4847  			break
  4848  		}
  4849  		v.reset(OpLOONG64MOVVload)
  4850  		v.AuxInt = int32ToAuxInt(int32(c))
  4851  		v.AddArg2(ptr, mem)
  4852  		return true
  4853  	}
  4854  	return false
  4855  }
  4856  func rewriteValueLOONG64_OpLOONG64MOVVnop(v *Value) bool {
  4857  	v_0 := v.Args[0]
  4858  	// match: (MOVVnop (MOVVconst [c]))
  4859  	// result: (MOVVconst [c])
  4860  	for {
  4861  		if v_0.Op != OpLOONG64MOVVconst {
  4862  			break
  4863  		}
  4864  		c := auxIntToInt64(v_0.AuxInt)
  4865  		v.reset(OpLOONG64MOVVconst)
  4866  		v.AuxInt = int64ToAuxInt(c)
  4867  		return true
  4868  	}
  4869  	return false
  4870  }
  4871  func rewriteValueLOONG64_OpLOONG64MOVVreg(v *Value) bool {
  4872  	v_0 := v.Args[0]
  4873  	// match: (MOVVreg x)
  4874  	// cond: x.Uses == 1
  4875  	// result: (MOVVnop x)
  4876  	for {
  4877  		x := v_0
  4878  		if !(x.Uses == 1) {
  4879  			break
  4880  		}
  4881  		v.reset(OpLOONG64MOVVnop)
  4882  		v.AddArg(x)
  4883  		return true
  4884  	}
  4885  	// match: (MOVVreg (MOVVconst [c]))
  4886  	// result: (MOVVconst [c])
  4887  	for {
  4888  		if v_0.Op != OpLOONG64MOVVconst {
  4889  			break
  4890  		}
  4891  		c := auxIntToInt64(v_0.AuxInt)
  4892  		v.reset(OpLOONG64MOVVconst)
  4893  		v.AuxInt = int64ToAuxInt(c)
  4894  		return true
  4895  	}
  4896  	return false
  4897  }
  4898  func rewriteValueLOONG64_OpLOONG64MOVVstore(v *Value) bool {
  4899  	v_2 := v.Args[2]
  4900  	v_1 := v.Args[1]
  4901  	v_0 := v.Args[0]
  4902  	b := v.Block
  4903  	config := b.Func.Config
  4904  	typ := &b.Func.Config.Types
  4905  	// match: (MOVVstore [off] {sym} ptr (MOVVfpgp val) mem)
  4906  	// result: (MOVDstore [off] {sym} ptr val mem)
  4907  	for {
  4908  		off := auxIntToInt32(v.AuxInt)
  4909  		sym := auxToSym(v.Aux)
  4910  		ptr := v_0
  4911  		if v_1.Op != OpLOONG64MOVVfpgp {
  4912  			break
  4913  		}
  4914  		val := v_1.Args[0]
  4915  		mem := v_2
  4916  		v.reset(OpLOONG64MOVDstore)
  4917  		v.AuxInt = int32ToAuxInt(off)
  4918  		v.Aux = symToAux(sym)
  4919  		v.AddArg3(ptr, val, mem)
  4920  		return true
  4921  	}
  4922  	// match: (MOVVstore [off1] {sym} (ADDVconst [off2] ptr) val mem)
  4923  	// cond: is32Bit(int64(off1)+off2) && (ptr.Op != OpSB || !config.ctxt.Flag_dynlink)
  4924  	// result: (MOVVstore [off1+int32(off2)] {sym} ptr val mem)
  4925  	for {
  4926  		off1 := auxIntToInt32(v.AuxInt)
  4927  		sym := auxToSym(v.Aux)
  4928  		if v_0.Op != OpLOONG64ADDVconst {
  4929  			break
  4930  		}
  4931  		off2 := auxIntToInt64(v_0.AuxInt)
  4932  		ptr := v_0.Args[0]
  4933  		val := v_1
  4934  		mem := v_2
  4935  		if !(is32Bit(int64(off1)+off2) && (ptr.Op != OpSB || !config.ctxt.Flag_dynlink)) {
  4936  			break
  4937  		}
  4938  		v.reset(OpLOONG64MOVVstore)
  4939  		v.AuxInt = int32ToAuxInt(off1 + int32(off2))
  4940  		v.Aux = symToAux(sym)
  4941  		v.AddArg3(ptr, val, mem)
  4942  		return true
  4943  	}
  4944  	// match: (MOVVstore [off1] {sym1} (MOVVaddr [off2] {sym2} ptr) val mem)
  4945  	// cond: canMergeSym(sym1,sym2) && is32Bit(int64(off1)+int64(off2)) && (ptr.Op != OpSB || !config.ctxt.Flag_dynlink)
  4946  	// result: (MOVVstore [off1+int32(off2)] {mergeSym(sym1,sym2)} ptr val mem)
  4947  	for {
  4948  		off1 := auxIntToInt32(v.AuxInt)
  4949  		sym1 := auxToSym(v.Aux)
  4950  		if v_0.Op != OpLOONG64MOVVaddr {
  4951  			break
  4952  		}
  4953  		off2 := auxIntToInt32(v_0.AuxInt)
  4954  		sym2 := auxToSym(v_0.Aux)
  4955  		ptr := v_0.Args[0]
  4956  		val := v_1
  4957  		mem := v_2
  4958  		if !(canMergeSym(sym1, sym2) && is32Bit(int64(off1)+int64(off2)) && (ptr.Op != OpSB || !config.ctxt.Flag_dynlink)) {
  4959  			break
  4960  		}
  4961  		v.reset(OpLOONG64MOVVstore)
  4962  		v.AuxInt = int32ToAuxInt(off1 + int32(off2))
  4963  		v.Aux = symToAux(mergeSym(sym1, sym2))
  4964  		v.AddArg3(ptr, val, mem)
  4965  		return true
  4966  	}
  4967  	// match: (MOVVstore [off] {sym} (ADDV ptr idx) val mem)
  4968  	// cond: off == 0 && sym == nil
  4969  	// result: (MOVVstoreidx ptr idx val mem)
  4970  	for {
  4971  		off := auxIntToInt32(v.AuxInt)
  4972  		sym := auxToSym(v.Aux)
  4973  		if v_0.Op != OpLOONG64ADDV {
  4974  			break
  4975  		}
  4976  		idx := v_0.Args[1]
  4977  		ptr := v_0.Args[0]
  4978  		val := v_1
  4979  		mem := v_2
  4980  		if !(off == 0 && sym == nil) {
  4981  			break
  4982  		}
  4983  		v.reset(OpLOONG64MOVVstoreidx)
  4984  		v.AddArg4(ptr, idx, val, mem)
  4985  		return true
  4986  	}
  4987  	// match: (MOVVstore [off] {sym} (ADDshiftLLV [shift] ptr idx) val mem)
  4988  	// cond: off == 0 && sym == nil
  4989  	// result: (MOVVstoreidx ptr (SLLVconst <typ.Int64> [shift] idx) val mem)
  4990  	for {
  4991  		off := auxIntToInt32(v.AuxInt)
  4992  		sym := auxToSym(v.Aux)
  4993  		if v_0.Op != OpLOONG64ADDshiftLLV {
  4994  			break
  4995  		}
  4996  		shift := auxIntToInt64(v_0.AuxInt)
  4997  		idx := v_0.Args[1]
  4998  		ptr := v_0.Args[0]
  4999  		val := v_1
  5000  		mem := v_2
  5001  		if !(off == 0 && sym == nil) {
  5002  			break
  5003  		}
  5004  		v.reset(OpLOONG64MOVVstoreidx)
  5005  		v0 := b.NewValue0(v.Pos, OpLOONG64SLLVconst, typ.Int64)
  5006  		v0.AuxInt = int64ToAuxInt(shift)
  5007  		v0.AddArg(idx)
  5008  		v.AddArg4(ptr, v0, val, mem)
  5009  		return true
  5010  	}
  5011  	return false
  5012  }
  5013  func rewriteValueLOONG64_OpLOONG64MOVVstoreidx(v *Value) bool {
  5014  	v_3 := v.Args[3]
  5015  	v_2 := v.Args[2]
  5016  	v_1 := v.Args[1]
  5017  	v_0 := v.Args[0]
  5018  	// match: (MOVVstoreidx ptr (MOVVconst [c]) val mem)
  5019  	// cond: is32Bit(c)
  5020  	// result: (MOVVstore [int32(c)] ptr val mem)
  5021  	for {
  5022  		ptr := v_0
  5023  		if v_1.Op != OpLOONG64MOVVconst {
  5024  			break
  5025  		}
  5026  		c := auxIntToInt64(v_1.AuxInt)
  5027  		val := v_2
  5028  		mem := v_3
  5029  		if !(is32Bit(c)) {
  5030  			break
  5031  		}
  5032  		v.reset(OpLOONG64MOVVstore)
  5033  		v.AuxInt = int32ToAuxInt(int32(c))
  5034  		v.AddArg3(ptr, val, mem)
  5035  		return true
  5036  	}
  5037  	// match: (MOVVstoreidx (MOVVconst [c]) idx val mem)
  5038  	// cond: is32Bit(c)
  5039  	// result: (MOVVstore [int32(c)] idx val mem)
  5040  	for {
  5041  		if v_0.Op != OpLOONG64MOVVconst {
  5042  			break
  5043  		}
  5044  		c := auxIntToInt64(v_0.AuxInt)
  5045  		idx := v_1
  5046  		val := v_2
  5047  		mem := v_3
  5048  		if !(is32Bit(c)) {
  5049  			break
  5050  		}
  5051  		v.reset(OpLOONG64MOVVstore)
  5052  		v.AuxInt = int32ToAuxInt(int32(c))
  5053  		v.AddArg3(idx, val, mem)
  5054  		return true
  5055  	}
  5056  	return false
  5057  }
  5058  func rewriteValueLOONG64_OpLOONG64MOVWUload(v *Value) bool {
  5059  	v_1 := v.Args[1]
  5060  	v_0 := v.Args[0]
  5061  	b := v.Block
  5062  	config := b.Func.Config
  5063  	typ := &b.Func.Config.Types
  5064  	// match: (MOVWUload [off] {sym} ptr (MOVFstore [off] {sym} ptr val _))
  5065  	// result: (ZeroExt32to64 (MOVWfpgp <typ.Float32> val))
  5066  	for {
  5067  		off := auxIntToInt32(v.AuxInt)
  5068  		sym := auxToSym(v.Aux)
  5069  		ptr := v_0
  5070  		if v_1.Op != OpLOONG64MOVFstore || auxIntToInt32(v_1.AuxInt) != off || auxToSym(v_1.Aux) != sym {
  5071  			break
  5072  		}
  5073  		val := v_1.Args[1]
  5074  		if ptr != v_1.Args[0] {
  5075  			break
  5076  		}
  5077  		v.reset(OpZeroExt32to64)
  5078  		v0 := b.NewValue0(v_1.Pos, OpLOONG64MOVWfpgp, typ.Float32)
  5079  		v0.AddArg(val)
  5080  		v.AddArg(v0)
  5081  		return true
  5082  	}
  5083  	// match: (MOVWUload [off] {sym} ptr (MOVWstore [off] {sym} ptr x _))
  5084  	// result: (MOVWUreg x)
  5085  	for {
  5086  		off := auxIntToInt32(v.AuxInt)
  5087  		sym := auxToSym(v.Aux)
  5088  		ptr := v_0
  5089  		if v_1.Op != OpLOONG64MOVWstore || auxIntToInt32(v_1.AuxInt) != off || auxToSym(v_1.Aux) != sym {
  5090  			break
  5091  		}
  5092  		x := v_1.Args[1]
  5093  		if ptr != v_1.Args[0] {
  5094  			break
  5095  		}
  5096  		v.reset(OpLOONG64MOVWUreg)
  5097  		v.AddArg(x)
  5098  		return true
  5099  	}
  5100  	// match: (MOVWUload [off1] {sym} (ADDVconst [off2] ptr) mem)
  5101  	// cond: is32Bit(int64(off1)+off2) && (ptr.Op != OpSB || !config.ctxt.Flag_dynlink)
  5102  	// result: (MOVWUload [off1+int32(off2)] {sym} ptr mem)
  5103  	for {
  5104  		off1 := auxIntToInt32(v.AuxInt)
  5105  		sym := auxToSym(v.Aux)
  5106  		if v_0.Op != OpLOONG64ADDVconst {
  5107  			break
  5108  		}
  5109  		off2 := auxIntToInt64(v_0.AuxInt)
  5110  		ptr := v_0.Args[0]
  5111  		mem := v_1
  5112  		if !(is32Bit(int64(off1)+off2) && (ptr.Op != OpSB || !config.ctxt.Flag_dynlink)) {
  5113  			break
  5114  		}
  5115  		v.reset(OpLOONG64MOVWUload)
  5116  		v.AuxInt = int32ToAuxInt(off1 + int32(off2))
  5117  		v.Aux = symToAux(sym)
  5118  		v.AddArg2(ptr, mem)
  5119  		return true
  5120  	}
  5121  	// match: (MOVWUload [off1] {sym1} (MOVVaddr [off2] {sym2} ptr) mem)
  5122  	// cond: canMergeSym(sym1,sym2) && is32Bit(int64(off1)+int64(off2)) && (ptr.Op != OpSB || !config.ctxt.Flag_dynlink)
  5123  	// result: (MOVWUload [off1+int32(off2)] {mergeSym(sym1,sym2)} ptr mem)
  5124  	for {
  5125  		off1 := auxIntToInt32(v.AuxInt)
  5126  		sym1 := auxToSym(v.Aux)
  5127  		if v_0.Op != OpLOONG64MOVVaddr {
  5128  			break
  5129  		}
  5130  		off2 := auxIntToInt32(v_0.AuxInt)
  5131  		sym2 := auxToSym(v_0.Aux)
  5132  		ptr := v_0.Args[0]
  5133  		mem := v_1
  5134  		if !(canMergeSym(sym1, sym2) && is32Bit(int64(off1)+int64(off2)) && (ptr.Op != OpSB || !config.ctxt.Flag_dynlink)) {
  5135  			break
  5136  		}
  5137  		v.reset(OpLOONG64MOVWUload)
  5138  		v.AuxInt = int32ToAuxInt(off1 + int32(off2))
  5139  		v.Aux = symToAux(mergeSym(sym1, sym2))
  5140  		v.AddArg2(ptr, mem)
  5141  		return true
  5142  	}
  5143  	// match: (MOVWUload [off] {sym} (ADDV ptr idx) mem)
  5144  	// cond: off == 0 && sym == nil
  5145  	// result: (MOVWUloadidx ptr idx mem)
  5146  	for {
  5147  		off := auxIntToInt32(v.AuxInt)
  5148  		sym := auxToSym(v.Aux)
  5149  		if v_0.Op != OpLOONG64ADDV {
  5150  			break
  5151  		}
  5152  		idx := v_0.Args[1]
  5153  		ptr := v_0.Args[0]
  5154  		mem := v_1
  5155  		if !(off == 0 && sym == nil) {
  5156  			break
  5157  		}
  5158  		v.reset(OpLOONG64MOVWUloadidx)
  5159  		v.AddArg3(ptr, idx, mem)
  5160  		return true
  5161  	}
  5162  	// match: (MOVWUload [off] {sym} (ADDshiftLLV [shift] ptr idx) mem)
  5163  	// cond: off == 0 && sym == nil
  5164  	// result: (MOVWUloadidx ptr (SLLVconst <typ.Int64> [shift] idx) mem)
  5165  	for {
  5166  		off := auxIntToInt32(v.AuxInt)
  5167  		sym := auxToSym(v.Aux)
  5168  		if v_0.Op != OpLOONG64ADDshiftLLV {
  5169  			break
  5170  		}
  5171  		shift := auxIntToInt64(v_0.AuxInt)
  5172  		idx := v_0.Args[1]
  5173  		ptr := v_0.Args[0]
  5174  		mem := v_1
  5175  		if !(off == 0 && sym == nil) {
  5176  			break
  5177  		}
  5178  		v.reset(OpLOONG64MOVWUloadidx)
  5179  		v0 := b.NewValue0(v.Pos, OpLOONG64SLLVconst, typ.Int64)
  5180  		v0.AuxInt = int64ToAuxInt(shift)
  5181  		v0.AddArg(idx)
  5182  		v.AddArg3(ptr, v0, mem)
  5183  		return true
  5184  	}
  5185  	// match: (MOVWUload [off] {sym} (SB) _)
  5186  	// cond: symIsRO(sym)
  5187  	// result: (MOVVconst [int64(read32(sym, int64(off), config.ctxt.Arch.ByteOrder))])
  5188  	for {
  5189  		off := auxIntToInt32(v.AuxInt)
  5190  		sym := auxToSym(v.Aux)
  5191  		if v_0.Op != OpSB || !(symIsRO(sym)) {
  5192  			break
  5193  		}
  5194  		v.reset(OpLOONG64MOVVconst)
  5195  		v.AuxInt = int64ToAuxInt(int64(read32(sym, int64(off), config.ctxt.Arch.ByteOrder)))
  5196  		return true
  5197  	}
  5198  	return false
  5199  }
  5200  func rewriteValueLOONG64_OpLOONG64MOVWUloadidx(v *Value) bool {
  5201  	v_2 := v.Args[2]
  5202  	v_1 := v.Args[1]
  5203  	v_0 := v.Args[0]
  5204  	// match: (MOVWUloadidx ptr (MOVVconst [c]) mem)
  5205  	// cond: is32Bit(c)
  5206  	// result: (MOVWUload [int32(c)] ptr mem)
  5207  	for {
  5208  		ptr := v_0
  5209  		if v_1.Op != OpLOONG64MOVVconst {
  5210  			break
  5211  		}
  5212  		c := auxIntToInt64(v_1.AuxInt)
  5213  		mem := v_2
  5214  		if !(is32Bit(c)) {
  5215  			break
  5216  		}
  5217  		v.reset(OpLOONG64MOVWUload)
  5218  		v.AuxInt = int32ToAuxInt(int32(c))
  5219  		v.AddArg2(ptr, mem)
  5220  		return true
  5221  	}
  5222  	// match: (MOVWUloadidx (MOVVconst [c]) ptr mem)
  5223  	// cond: is32Bit(c)
  5224  	// result: (MOVWUload [int32(c)] ptr mem)
  5225  	for {
  5226  		if v_0.Op != OpLOONG64MOVVconst {
  5227  			break
  5228  		}
  5229  		c := auxIntToInt64(v_0.AuxInt)
  5230  		ptr := v_1
  5231  		mem := v_2
  5232  		if !(is32Bit(c)) {
  5233  			break
  5234  		}
  5235  		v.reset(OpLOONG64MOVWUload)
  5236  		v.AuxInt = int32ToAuxInt(int32(c))
  5237  		v.AddArg2(ptr, mem)
  5238  		return true
  5239  	}
  5240  	return false
  5241  }
  5242  func rewriteValueLOONG64_OpLOONG64MOVWUreg(v *Value) bool {
  5243  	v_0 := v.Args[0]
  5244  	// match: (MOVWUreg (SRLVconst [rc] x))
  5245  	// cond: rc < 32
  5246  	// result: (BSTRPICKV [rc + (31+rc)<<6] x)
  5247  	for {
  5248  		if v_0.Op != OpLOONG64SRLVconst {
  5249  			break
  5250  		}
  5251  		rc := auxIntToInt64(v_0.AuxInt)
  5252  		x := v_0.Args[0]
  5253  		if !(rc < 32) {
  5254  			break
  5255  		}
  5256  		v.reset(OpLOONG64BSTRPICKV)
  5257  		v.AuxInt = int64ToAuxInt(rc + (31+rc)<<6)
  5258  		v.AddArg(x)
  5259  		return true
  5260  	}
  5261  	// match: (MOVWUreg x:(MOVBUload _ _))
  5262  	// result: (MOVVreg x)
  5263  	for {
  5264  		x := v_0
  5265  		if x.Op != OpLOONG64MOVBUload {
  5266  			break
  5267  		}
  5268  		v.reset(OpLOONG64MOVVreg)
  5269  		v.AddArg(x)
  5270  		return true
  5271  	}
  5272  	// match: (MOVWUreg x:(MOVHUload _ _))
  5273  	// result: (MOVVreg x)
  5274  	for {
  5275  		x := v_0
  5276  		if x.Op != OpLOONG64MOVHUload {
  5277  			break
  5278  		}
  5279  		v.reset(OpLOONG64MOVVreg)
  5280  		v.AddArg(x)
  5281  		return true
  5282  	}
  5283  	// match: (MOVWUreg x:(MOVWUload _ _))
  5284  	// result: (MOVVreg x)
  5285  	for {
  5286  		x := v_0
  5287  		if x.Op != OpLOONG64MOVWUload {
  5288  			break
  5289  		}
  5290  		v.reset(OpLOONG64MOVVreg)
  5291  		v.AddArg(x)
  5292  		return true
  5293  	}
  5294  	// match: (MOVWUreg x:(MOVBUloadidx _ _ _))
  5295  	// result: (MOVVreg x)
  5296  	for {
  5297  		x := v_0
  5298  		if x.Op != OpLOONG64MOVBUloadidx {
  5299  			break
  5300  		}
  5301  		v.reset(OpLOONG64MOVVreg)
  5302  		v.AddArg(x)
  5303  		return true
  5304  	}
  5305  	// match: (MOVWUreg x:(MOVHUloadidx _ _ _))
  5306  	// result: (MOVVreg x)
  5307  	for {
  5308  		x := v_0
  5309  		if x.Op != OpLOONG64MOVHUloadidx {
  5310  			break
  5311  		}
  5312  		v.reset(OpLOONG64MOVVreg)
  5313  		v.AddArg(x)
  5314  		return true
  5315  	}
  5316  	// match: (MOVWUreg x:(MOVWUloadidx _ _ _))
  5317  	// result: (MOVVreg x)
  5318  	for {
  5319  		x := v_0
  5320  		if x.Op != OpLOONG64MOVWUloadidx {
  5321  			break
  5322  		}
  5323  		v.reset(OpLOONG64MOVVreg)
  5324  		v.AddArg(x)
  5325  		return true
  5326  	}
  5327  	// match: (MOVWUreg x:(MOVBUreg _))
  5328  	// result: (MOVVreg x)
  5329  	for {
  5330  		x := v_0
  5331  		if x.Op != OpLOONG64MOVBUreg {
  5332  			break
  5333  		}
  5334  		v.reset(OpLOONG64MOVVreg)
  5335  		v.AddArg(x)
  5336  		return true
  5337  	}
  5338  	// match: (MOVWUreg x:(MOVHUreg _))
  5339  	// result: (MOVVreg x)
  5340  	for {
  5341  		x := v_0
  5342  		if x.Op != OpLOONG64MOVHUreg {
  5343  			break
  5344  		}
  5345  		v.reset(OpLOONG64MOVVreg)
  5346  		v.AddArg(x)
  5347  		return true
  5348  	}
  5349  	// match: (MOVWUreg x:(MOVWUreg _))
  5350  	// result: (MOVVreg x)
  5351  	for {
  5352  		x := v_0
  5353  		if x.Op != OpLOONG64MOVWUreg {
  5354  			break
  5355  		}
  5356  		v.reset(OpLOONG64MOVVreg)
  5357  		v.AddArg(x)
  5358  		return true
  5359  	}
  5360  	// match: (MOVWUreg (SLLVconst [lc] x))
  5361  	// cond: lc >= 32
  5362  	// result: (MOVVconst [0])
  5363  	for {
  5364  		if v_0.Op != OpLOONG64SLLVconst {
  5365  			break
  5366  		}
  5367  		lc := auxIntToInt64(v_0.AuxInt)
  5368  		if !(lc >= 32) {
  5369  			break
  5370  		}
  5371  		v.reset(OpLOONG64MOVVconst)
  5372  		v.AuxInt = int64ToAuxInt(0)
  5373  		return true
  5374  	}
  5375  	// match: (MOVWUreg (MOVVconst [c]))
  5376  	// result: (MOVVconst [int64(uint32(c))])
  5377  	for {
  5378  		if v_0.Op != OpLOONG64MOVVconst {
  5379  			break
  5380  		}
  5381  		c := auxIntToInt64(v_0.AuxInt)
  5382  		v.reset(OpLOONG64MOVVconst)
  5383  		v.AuxInt = int64ToAuxInt(int64(uint32(c)))
  5384  		return true
  5385  	}
  5386  	// match: (MOVWUreg x:(SRLconst [c] y))
  5387  	// result: x
  5388  	for {
  5389  		x := v_0
  5390  		if x.Op != OpLOONG64SRLconst {
  5391  			break
  5392  		}
  5393  		v.copyOf(x)
  5394  		return true
  5395  	}
  5396  	// match: (MOVWUreg x:(ANDconst [c] y))
  5397  	// cond: c >= 0 && int64(uint32(c)) == c
  5398  	// result: x
  5399  	for {
  5400  		x := v_0
  5401  		if x.Op != OpLOONG64ANDconst {
  5402  			break
  5403  		}
  5404  		c := auxIntToInt64(x.AuxInt)
  5405  		if !(c >= 0 && int64(uint32(c)) == c) {
  5406  			break
  5407  		}
  5408  		v.copyOf(x)
  5409  		return true
  5410  	}
  5411  	return false
  5412  }
  5413  func rewriteValueLOONG64_OpLOONG64MOVWload(v *Value) bool {
  5414  	v_1 := v.Args[1]
  5415  	v_0 := v.Args[0]
  5416  	b := v.Block
  5417  	config := b.Func.Config
  5418  	typ := &b.Func.Config.Types
  5419  	// match: (MOVWload [off] {sym} ptr (MOVWstore [off] {sym} ptr x _))
  5420  	// result: (MOVWreg x)
  5421  	for {
  5422  		off := auxIntToInt32(v.AuxInt)
  5423  		sym := auxToSym(v.Aux)
  5424  		ptr := v_0
  5425  		if v_1.Op != OpLOONG64MOVWstore || auxIntToInt32(v_1.AuxInt) != off || auxToSym(v_1.Aux) != sym {
  5426  			break
  5427  		}
  5428  		x := v_1.Args[1]
  5429  		if ptr != v_1.Args[0] {
  5430  			break
  5431  		}
  5432  		v.reset(OpLOONG64MOVWreg)
  5433  		v.AddArg(x)
  5434  		return true
  5435  	}
  5436  	// match: (MOVWload [off1] {sym} (ADDVconst [off2] ptr) mem)
  5437  	// cond: is32Bit(int64(off1)+off2) && (ptr.Op != OpSB || !config.ctxt.Flag_dynlink)
  5438  	// result: (MOVWload [off1+int32(off2)] {sym} ptr mem)
  5439  	for {
  5440  		off1 := auxIntToInt32(v.AuxInt)
  5441  		sym := auxToSym(v.Aux)
  5442  		if v_0.Op != OpLOONG64ADDVconst {
  5443  			break
  5444  		}
  5445  		off2 := auxIntToInt64(v_0.AuxInt)
  5446  		ptr := v_0.Args[0]
  5447  		mem := v_1
  5448  		if !(is32Bit(int64(off1)+off2) && (ptr.Op != OpSB || !config.ctxt.Flag_dynlink)) {
  5449  			break
  5450  		}
  5451  		v.reset(OpLOONG64MOVWload)
  5452  		v.AuxInt = int32ToAuxInt(off1 + int32(off2))
  5453  		v.Aux = symToAux(sym)
  5454  		v.AddArg2(ptr, mem)
  5455  		return true
  5456  	}
  5457  	// match: (MOVWload [off1] {sym1} (MOVVaddr [off2] {sym2} ptr) mem)
  5458  	// cond: canMergeSym(sym1,sym2) && is32Bit(int64(off1)+int64(off2)) && (ptr.Op != OpSB || !config.ctxt.Flag_dynlink)
  5459  	// result: (MOVWload [off1+int32(off2)] {mergeSym(sym1,sym2)} ptr mem)
  5460  	for {
  5461  		off1 := auxIntToInt32(v.AuxInt)
  5462  		sym1 := auxToSym(v.Aux)
  5463  		if v_0.Op != OpLOONG64MOVVaddr {
  5464  			break
  5465  		}
  5466  		off2 := auxIntToInt32(v_0.AuxInt)
  5467  		sym2 := auxToSym(v_0.Aux)
  5468  		ptr := v_0.Args[0]
  5469  		mem := v_1
  5470  		if !(canMergeSym(sym1, sym2) && is32Bit(int64(off1)+int64(off2)) && (ptr.Op != OpSB || !config.ctxt.Flag_dynlink)) {
  5471  			break
  5472  		}
  5473  		v.reset(OpLOONG64MOVWload)
  5474  		v.AuxInt = int32ToAuxInt(off1 + int32(off2))
  5475  		v.Aux = symToAux(mergeSym(sym1, sym2))
  5476  		v.AddArg2(ptr, mem)
  5477  		return true
  5478  	}
  5479  	// match: (MOVWload [off] {sym} (ADDV ptr idx) mem)
  5480  	// cond: off == 0 && sym == nil
  5481  	// result: (MOVWloadidx ptr idx mem)
  5482  	for {
  5483  		off := auxIntToInt32(v.AuxInt)
  5484  		sym := auxToSym(v.Aux)
  5485  		if v_0.Op != OpLOONG64ADDV {
  5486  			break
  5487  		}
  5488  		idx := v_0.Args[1]
  5489  		ptr := v_0.Args[0]
  5490  		mem := v_1
  5491  		if !(off == 0 && sym == nil) {
  5492  			break
  5493  		}
  5494  		v.reset(OpLOONG64MOVWloadidx)
  5495  		v.AddArg3(ptr, idx, mem)
  5496  		return true
  5497  	}
  5498  	// match: (MOVWload [off] {sym} (ADDshiftLLV [shift] ptr idx) mem)
  5499  	// cond: off == 0 && sym == nil
  5500  	// result: (MOVWloadidx ptr (SLLVconst <typ.Int64> [shift] idx) mem)
  5501  	for {
  5502  		off := auxIntToInt32(v.AuxInt)
  5503  		sym := auxToSym(v.Aux)
  5504  		if v_0.Op != OpLOONG64ADDshiftLLV {
  5505  			break
  5506  		}
  5507  		shift := auxIntToInt64(v_0.AuxInt)
  5508  		idx := v_0.Args[1]
  5509  		ptr := v_0.Args[0]
  5510  		mem := v_1
  5511  		if !(off == 0 && sym == nil) {
  5512  			break
  5513  		}
  5514  		v.reset(OpLOONG64MOVWloadidx)
  5515  		v0 := b.NewValue0(v.Pos, OpLOONG64SLLVconst, typ.Int64)
  5516  		v0.AuxInt = int64ToAuxInt(shift)
  5517  		v0.AddArg(idx)
  5518  		v.AddArg3(ptr, v0, mem)
  5519  		return true
  5520  	}
  5521  	// match: (MOVWload [off] {sym} (SB) _)
  5522  	// cond: symIsRO(sym)
  5523  	// result: (MOVVconst [int64(int32(read32(sym, int64(off), config.ctxt.Arch.ByteOrder)))])
  5524  	for {
  5525  		off := auxIntToInt32(v.AuxInt)
  5526  		sym := auxToSym(v.Aux)
  5527  		if v_0.Op != OpSB || !(symIsRO(sym)) {
  5528  			break
  5529  		}
  5530  		v.reset(OpLOONG64MOVVconst)
  5531  		v.AuxInt = int64ToAuxInt(int64(int32(read32(sym, int64(off), config.ctxt.Arch.ByteOrder))))
  5532  		return true
  5533  	}
  5534  	return false
  5535  }
  5536  func rewriteValueLOONG64_OpLOONG64MOVWloadidx(v *Value) bool {
  5537  	v_2 := v.Args[2]
  5538  	v_1 := v.Args[1]
  5539  	v_0 := v.Args[0]
  5540  	// match: (MOVWloadidx ptr (MOVVconst [c]) mem)
  5541  	// cond: is32Bit(c)
  5542  	// result: (MOVWload [int32(c)] ptr mem)
  5543  	for {
  5544  		ptr := v_0
  5545  		if v_1.Op != OpLOONG64MOVVconst {
  5546  			break
  5547  		}
  5548  		c := auxIntToInt64(v_1.AuxInt)
  5549  		mem := v_2
  5550  		if !(is32Bit(c)) {
  5551  			break
  5552  		}
  5553  		v.reset(OpLOONG64MOVWload)
  5554  		v.AuxInt = int32ToAuxInt(int32(c))
  5555  		v.AddArg2(ptr, mem)
  5556  		return true
  5557  	}
  5558  	// match: (MOVWloadidx (MOVVconst [c]) ptr mem)
  5559  	// cond: is32Bit(c)
  5560  	// result: (MOVWload [int32(c)] ptr mem)
  5561  	for {
  5562  		if v_0.Op != OpLOONG64MOVVconst {
  5563  			break
  5564  		}
  5565  		c := auxIntToInt64(v_0.AuxInt)
  5566  		ptr := v_1
  5567  		mem := v_2
  5568  		if !(is32Bit(c)) {
  5569  			break
  5570  		}
  5571  		v.reset(OpLOONG64MOVWload)
  5572  		v.AuxInt = int32ToAuxInt(int32(c))
  5573  		v.AddArg2(ptr, mem)
  5574  		return true
  5575  	}
  5576  	return false
  5577  }
  5578  func rewriteValueLOONG64_OpLOONG64MOVWreg(v *Value) bool {
  5579  	v_0 := v.Args[0]
  5580  	// match: (MOVWreg x:(MOVBload _ _))
  5581  	// result: (MOVVreg x)
  5582  	for {
  5583  		x := v_0
  5584  		if x.Op != OpLOONG64MOVBload {
  5585  			break
  5586  		}
  5587  		v.reset(OpLOONG64MOVVreg)
  5588  		v.AddArg(x)
  5589  		return true
  5590  	}
  5591  	// match: (MOVWreg x:(MOVBUload _ _))
  5592  	// result: (MOVVreg x)
  5593  	for {
  5594  		x := v_0
  5595  		if x.Op != OpLOONG64MOVBUload {
  5596  			break
  5597  		}
  5598  		v.reset(OpLOONG64MOVVreg)
  5599  		v.AddArg(x)
  5600  		return true
  5601  	}
  5602  	// match: (MOVWreg x:(MOVHload _ _))
  5603  	// result: (MOVVreg x)
  5604  	for {
  5605  		x := v_0
  5606  		if x.Op != OpLOONG64MOVHload {
  5607  			break
  5608  		}
  5609  		v.reset(OpLOONG64MOVVreg)
  5610  		v.AddArg(x)
  5611  		return true
  5612  	}
  5613  	// match: (MOVWreg x:(MOVHUload _ _))
  5614  	// result: (MOVVreg x)
  5615  	for {
  5616  		x := v_0
  5617  		if x.Op != OpLOONG64MOVHUload {
  5618  			break
  5619  		}
  5620  		v.reset(OpLOONG64MOVVreg)
  5621  		v.AddArg(x)
  5622  		return true
  5623  	}
  5624  	// match: (MOVWreg x:(MOVWload _ _))
  5625  	// result: (MOVVreg x)
  5626  	for {
  5627  		x := v_0
  5628  		if x.Op != OpLOONG64MOVWload {
  5629  			break
  5630  		}
  5631  		v.reset(OpLOONG64MOVVreg)
  5632  		v.AddArg(x)
  5633  		return true
  5634  	}
  5635  	// match: (MOVWreg x:(MOVBloadidx _ _ _))
  5636  	// result: (MOVVreg x)
  5637  	for {
  5638  		x := v_0
  5639  		if x.Op != OpLOONG64MOVBloadidx {
  5640  			break
  5641  		}
  5642  		v.reset(OpLOONG64MOVVreg)
  5643  		v.AddArg(x)
  5644  		return true
  5645  	}
  5646  	// match: (MOVWreg x:(MOVBUloadidx _ _ _))
  5647  	// result: (MOVVreg x)
  5648  	for {
  5649  		x := v_0
  5650  		if x.Op != OpLOONG64MOVBUloadidx {
  5651  			break
  5652  		}
  5653  		v.reset(OpLOONG64MOVVreg)
  5654  		v.AddArg(x)
  5655  		return true
  5656  	}
  5657  	// match: (MOVWreg x:(MOVHloadidx _ _ _))
  5658  	// result: (MOVVreg x)
  5659  	for {
  5660  		x := v_0
  5661  		if x.Op != OpLOONG64MOVHloadidx {
  5662  			break
  5663  		}
  5664  		v.reset(OpLOONG64MOVVreg)
  5665  		v.AddArg(x)
  5666  		return true
  5667  	}
  5668  	// match: (MOVWreg x:(MOVHUloadidx _ _ _))
  5669  	// result: (MOVVreg x)
  5670  	for {
  5671  		x := v_0
  5672  		if x.Op != OpLOONG64MOVHUloadidx {
  5673  			break
  5674  		}
  5675  		v.reset(OpLOONG64MOVVreg)
  5676  		v.AddArg(x)
  5677  		return true
  5678  	}
  5679  	// match: (MOVWreg x:(MOVWloadidx _ _ _))
  5680  	// result: (MOVVreg x)
  5681  	for {
  5682  		x := v_0
  5683  		if x.Op != OpLOONG64MOVWloadidx {
  5684  			break
  5685  		}
  5686  		v.reset(OpLOONG64MOVVreg)
  5687  		v.AddArg(x)
  5688  		return true
  5689  	}
  5690  	// match: (MOVWreg x:(MOVBreg _))
  5691  	// result: (MOVVreg x)
  5692  	for {
  5693  		x := v_0
  5694  		if x.Op != OpLOONG64MOVBreg {
  5695  			break
  5696  		}
  5697  		v.reset(OpLOONG64MOVVreg)
  5698  		v.AddArg(x)
  5699  		return true
  5700  	}
  5701  	// match: (MOVWreg x:(MOVBUreg _))
  5702  	// result: (MOVVreg x)
  5703  	for {
  5704  		x := v_0
  5705  		if x.Op != OpLOONG64MOVBUreg {
  5706  			break
  5707  		}
  5708  		v.reset(OpLOONG64MOVVreg)
  5709  		v.AddArg(x)
  5710  		return true
  5711  	}
  5712  	// match: (MOVWreg x:(MOVHreg _))
  5713  	// result: (MOVVreg x)
  5714  	for {
  5715  		x := v_0
  5716  		if x.Op != OpLOONG64MOVHreg {
  5717  			break
  5718  		}
  5719  		v.reset(OpLOONG64MOVVreg)
  5720  		v.AddArg(x)
  5721  		return true
  5722  	}
  5723  	// match: (MOVWreg x:(MOVWreg _))
  5724  	// result: (MOVVreg x)
  5725  	for {
  5726  		x := v_0
  5727  		if x.Op != OpLOONG64MOVWreg {
  5728  			break
  5729  		}
  5730  		v.reset(OpLOONG64MOVVreg)
  5731  		v.AddArg(x)
  5732  		return true
  5733  	}
  5734  	// match: (MOVWreg (MOVVconst [c]))
  5735  	// result: (MOVVconst [int64(int32(c))])
  5736  	for {
  5737  		if v_0.Op != OpLOONG64MOVVconst {
  5738  			break
  5739  		}
  5740  		c := auxIntToInt64(v_0.AuxInt)
  5741  		v.reset(OpLOONG64MOVVconst)
  5742  		v.AuxInt = int64ToAuxInt(int64(int32(c)))
  5743  		return true
  5744  	}
  5745  	// match: (MOVWreg x:(ANDconst [c] y))
  5746  	// cond: c >= 0 && int64(int32(c)) == c
  5747  	// result: x
  5748  	for {
  5749  		x := v_0
  5750  		if x.Op != OpLOONG64ANDconst {
  5751  			break
  5752  		}
  5753  		c := auxIntToInt64(x.AuxInt)
  5754  		if !(c >= 0 && int64(int32(c)) == c) {
  5755  			break
  5756  		}
  5757  		v.copyOf(x)
  5758  		return true
  5759  	}
  5760  	return false
  5761  }
  5762  func rewriteValueLOONG64_OpLOONG64MOVWstore(v *Value) bool {
  5763  	v_2 := v.Args[2]
  5764  	v_1 := v.Args[1]
  5765  	v_0 := v.Args[0]
  5766  	b := v.Block
  5767  	config := b.Func.Config
  5768  	typ := &b.Func.Config.Types
  5769  	// match: (MOVWstore [off] {sym} ptr (MOVWfpgp val) mem)
  5770  	// result: (MOVFstore [off] {sym} ptr val mem)
  5771  	for {
  5772  		off := auxIntToInt32(v.AuxInt)
  5773  		sym := auxToSym(v.Aux)
  5774  		ptr := v_0
  5775  		if v_1.Op != OpLOONG64MOVWfpgp {
  5776  			break
  5777  		}
  5778  		val := v_1.Args[0]
  5779  		mem := v_2
  5780  		v.reset(OpLOONG64MOVFstore)
  5781  		v.AuxInt = int32ToAuxInt(off)
  5782  		v.Aux = symToAux(sym)
  5783  		v.AddArg3(ptr, val, mem)
  5784  		return true
  5785  	}
  5786  	// match: (MOVWstore [off1] {sym} (ADDVconst [off2] ptr) val mem)
  5787  	// cond: is32Bit(int64(off1)+off2) && (ptr.Op != OpSB || !config.ctxt.Flag_dynlink)
  5788  	// result: (MOVWstore [off1+int32(off2)] {sym} ptr val mem)
  5789  	for {
  5790  		off1 := auxIntToInt32(v.AuxInt)
  5791  		sym := auxToSym(v.Aux)
  5792  		if v_0.Op != OpLOONG64ADDVconst {
  5793  			break
  5794  		}
  5795  		off2 := auxIntToInt64(v_0.AuxInt)
  5796  		ptr := v_0.Args[0]
  5797  		val := v_1
  5798  		mem := v_2
  5799  		if !(is32Bit(int64(off1)+off2) && (ptr.Op != OpSB || !config.ctxt.Flag_dynlink)) {
  5800  			break
  5801  		}
  5802  		v.reset(OpLOONG64MOVWstore)
  5803  		v.AuxInt = int32ToAuxInt(off1 + int32(off2))
  5804  		v.Aux = symToAux(sym)
  5805  		v.AddArg3(ptr, val, mem)
  5806  		return true
  5807  	}
  5808  	// match: (MOVWstore [off1] {sym1} (MOVVaddr [off2] {sym2} ptr) val mem)
  5809  	// cond: canMergeSym(sym1,sym2) && is32Bit(int64(off1)+int64(off2)) && (ptr.Op != OpSB || !config.ctxt.Flag_dynlink)
  5810  	// result: (MOVWstore [off1+int32(off2)] {mergeSym(sym1,sym2)} ptr val mem)
  5811  	for {
  5812  		off1 := auxIntToInt32(v.AuxInt)
  5813  		sym1 := auxToSym(v.Aux)
  5814  		if v_0.Op != OpLOONG64MOVVaddr {
  5815  			break
  5816  		}
  5817  		off2 := auxIntToInt32(v_0.AuxInt)
  5818  		sym2 := auxToSym(v_0.Aux)
  5819  		ptr := v_0.Args[0]
  5820  		val := v_1
  5821  		mem := v_2
  5822  		if !(canMergeSym(sym1, sym2) && is32Bit(int64(off1)+int64(off2)) && (ptr.Op != OpSB || !config.ctxt.Flag_dynlink)) {
  5823  			break
  5824  		}
  5825  		v.reset(OpLOONG64MOVWstore)
  5826  		v.AuxInt = int32ToAuxInt(off1 + int32(off2))
  5827  		v.Aux = symToAux(mergeSym(sym1, sym2))
  5828  		v.AddArg3(ptr, val, mem)
  5829  		return true
  5830  	}
  5831  	// match: (MOVWstore [off] {sym} ptr (MOVWreg x) mem)
  5832  	// result: (MOVWstore [off] {sym} ptr x mem)
  5833  	for {
  5834  		off := auxIntToInt32(v.AuxInt)
  5835  		sym := auxToSym(v.Aux)
  5836  		ptr := v_0
  5837  		if v_1.Op != OpLOONG64MOVWreg {
  5838  			break
  5839  		}
  5840  		x := v_1.Args[0]
  5841  		mem := v_2
  5842  		v.reset(OpLOONG64MOVWstore)
  5843  		v.AuxInt = int32ToAuxInt(off)
  5844  		v.Aux = symToAux(sym)
  5845  		v.AddArg3(ptr, x, mem)
  5846  		return true
  5847  	}
  5848  	// match: (MOVWstore [off] {sym} ptr (MOVWUreg x) mem)
  5849  	// result: (MOVWstore [off] {sym} ptr x mem)
  5850  	for {
  5851  		off := auxIntToInt32(v.AuxInt)
  5852  		sym := auxToSym(v.Aux)
  5853  		ptr := v_0
  5854  		if v_1.Op != OpLOONG64MOVWUreg {
  5855  			break
  5856  		}
  5857  		x := v_1.Args[0]
  5858  		mem := v_2
  5859  		v.reset(OpLOONG64MOVWstore)
  5860  		v.AuxInt = int32ToAuxInt(off)
  5861  		v.Aux = symToAux(sym)
  5862  		v.AddArg3(ptr, x, mem)
  5863  		return true
  5864  	}
  5865  	// match: (MOVWstore [off] {sym} (ADDV ptr idx) val mem)
  5866  	// cond: off == 0 && sym == nil
  5867  	// result: (MOVWstoreidx ptr idx val mem)
  5868  	for {
  5869  		off := auxIntToInt32(v.AuxInt)
  5870  		sym := auxToSym(v.Aux)
  5871  		if v_0.Op != OpLOONG64ADDV {
  5872  			break
  5873  		}
  5874  		idx := v_0.Args[1]
  5875  		ptr := v_0.Args[0]
  5876  		val := v_1
  5877  		mem := v_2
  5878  		if !(off == 0 && sym == nil) {
  5879  			break
  5880  		}
  5881  		v.reset(OpLOONG64MOVWstoreidx)
  5882  		v.AddArg4(ptr, idx, val, mem)
  5883  		return true
  5884  	}
  5885  	// match: (MOVWstore [off] {sym} (ADDshiftLLV [shift] ptr idx) val mem)
  5886  	// cond: off == 0 && sym == nil
  5887  	// result: (MOVWstoreidx ptr (SLLVconst <typ.Int64> [shift] idx) val mem)
  5888  	for {
  5889  		off := auxIntToInt32(v.AuxInt)
  5890  		sym := auxToSym(v.Aux)
  5891  		if v_0.Op != OpLOONG64ADDshiftLLV {
  5892  			break
  5893  		}
  5894  		shift := auxIntToInt64(v_0.AuxInt)
  5895  		idx := v_0.Args[1]
  5896  		ptr := v_0.Args[0]
  5897  		val := v_1
  5898  		mem := v_2
  5899  		if !(off == 0 && sym == nil) {
  5900  			break
  5901  		}
  5902  		v.reset(OpLOONG64MOVWstoreidx)
  5903  		v0 := b.NewValue0(v.Pos, OpLOONG64SLLVconst, typ.Int64)
  5904  		v0.AuxInt = int64ToAuxInt(shift)
  5905  		v0.AddArg(idx)
  5906  		v.AddArg4(ptr, v0, val, mem)
  5907  		return true
  5908  	}
  5909  	return false
  5910  }
  5911  func rewriteValueLOONG64_OpLOONG64MOVWstoreidx(v *Value) bool {
  5912  	v_3 := v.Args[3]
  5913  	v_2 := v.Args[2]
  5914  	v_1 := v.Args[1]
  5915  	v_0 := v.Args[0]
  5916  	// match: (MOVWstoreidx ptr (MOVVconst [c]) val mem)
  5917  	// cond: is32Bit(c)
  5918  	// result: (MOVWstore [int32(c)] ptr val mem)
  5919  	for {
  5920  		ptr := v_0
  5921  		if v_1.Op != OpLOONG64MOVVconst {
  5922  			break
  5923  		}
  5924  		c := auxIntToInt64(v_1.AuxInt)
  5925  		val := v_2
  5926  		mem := v_3
  5927  		if !(is32Bit(c)) {
  5928  			break
  5929  		}
  5930  		v.reset(OpLOONG64MOVWstore)
  5931  		v.AuxInt = int32ToAuxInt(int32(c))
  5932  		v.AddArg3(ptr, val, mem)
  5933  		return true
  5934  	}
  5935  	// match: (MOVWstoreidx (MOVVconst [c]) idx val mem)
  5936  	// cond: is32Bit(c)
  5937  	// result: (MOVWstore [int32(c)] idx val mem)
  5938  	for {
  5939  		if v_0.Op != OpLOONG64MOVVconst {
  5940  			break
  5941  		}
  5942  		c := auxIntToInt64(v_0.AuxInt)
  5943  		idx := v_1
  5944  		val := v_2
  5945  		mem := v_3
  5946  		if !(is32Bit(c)) {
  5947  			break
  5948  		}
  5949  		v.reset(OpLOONG64MOVWstore)
  5950  		v.AuxInt = int32ToAuxInt(int32(c))
  5951  		v.AddArg3(idx, val, mem)
  5952  		return true
  5953  	}
  5954  	return false
  5955  }
  5956  func rewriteValueLOONG64_OpLOONG64MULV(v *Value) bool {
  5957  	v_1 := v.Args[1]
  5958  	v_0 := v.Args[0]
  5959  	b := v.Block
  5960  	config := b.Func.Config
  5961  	// match: (MULV r:(MOVWUreg x) s:(MOVWUreg y))
  5962  	// cond: r.Uses == 1 && s.Uses == 1
  5963  	// result: (MULWVWU x y)
  5964  	for {
  5965  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
  5966  			r := v_0
  5967  			if r.Op != OpLOONG64MOVWUreg {
  5968  				continue
  5969  			}
  5970  			x := r.Args[0]
  5971  			s := v_1
  5972  			if s.Op != OpLOONG64MOVWUreg {
  5973  				continue
  5974  			}
  5975  			y := s.Args[0]
  5976  			if !(r.Uses == 1 && s.Uses == 1) {
  5977  				continue
  5978  			}
  5979  			v.reset(OpLOONG64MULWVWU)
  5980  			v.AddArg2(x, y)
  5981  			return true
  5982  		}
  5983  		break
  5984  	}
  5985  	// match: (MULV r:(MOVWreg x) s:(MOVWreg y))
  5986  	// cond: r.Uses == 1 && s.Uses == 1
  5987  	// result: (MULWVW x y)
  5988  	for {
  5989  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
  5990  			r := v_0
  5991  			if r.Op != OpLOONG64MOVWreg {
  5992  				continue
  5993  			}
  5994  			x := r.Args[0]
  5995  			s := v_1
  5996  			if s.Op != OpLOONG64MOVWreg {
  5997  				continue
  5998  			}
  5999  			y := s.Args[0]
  6000  			if !(r.Uses == 1 && s.Uses == 1) {
  6001  				continue
  6002  			}
  6003  			v.reset(OpLOONG64MULWVW)
  6004  			v.AddArg2(x, y)
  6005  			return true
  6006  		}
  6007  		break
  6008  	}
  6009  	// match: (MULV _ (MOVVconst [0]))
  6010  	// result: (MOVVconst [0])
  6011  	for {
  6012  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
  6013  			if v_1.Op != OpLOONG64MOVVconst || auxIntToInt64(v_1.AuxInt) != 0 {
  6014  				continue
  6015  			}
  6016  			v.reset(OpLOONG64MOVVconst)
  6017  			v.AuxInt = int64ToAuxInt(0)
  6018  			return true
  6019  		}
  6020  		break
  6021  	}
  6022  	// match: (MULV x (MOVVconst [1]))
  6023  	// result: x
  6024  	for {
  6025  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
  6026  			x := v_0
  6027  			if v_1.Op != OpLOONG64MOVVconst || auxIntToInt64(v_1.AuxInt) != 1 {
  6028  				continue
  6029  			}
  6030  			v.copyOf(x)
  6031  			return true
  6032  		}
  6033  		break
  6034  	}
  6035  	// match: (MULV x (MOVVconst [c]))
  6036  	// cond: canMulStrengthReduce(config, c)
  6037  	// result: {mulStrengthReduce(v, x, c)}
  6038  	for {
  6039  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
  6040  			x := v_0
  6041  			if v_1.Op != OpLOONG64MOVVconst {
  6042  				continue
  6043  			}
  6044  			c := auxIntToInt64(v_1.AuxInt)
  6045  			if !(canMulStrengthReduce(config, c)) {
  6046  				continue
  6047  			}
  6048  			v.copyOf(mulStrengthReduce(v, x, c))
  6049  			return true
  6050  		}
  6051  		break
  6052  	}
  6053  	// match: (MULV (MOVVconst [c]) (MOVVconst [d]))
  6054  	// result: (MOVVconst [c*d])
  6055  	for {
  6056  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
  6057  			if v_0.Op != OpLOONG64MOVVconst {
  6058  				continue
  6059  			}
  6060  			c := auxIntToInt64(v_0.AuxInt)
  6061  			if v_1.Op != OpLOONG64MOVVconst {
  6062  				continue
  6063  			}
  6064  			d := auxIntToInt64(v_1.AuxInt)
  6065  			v.reset(OpLOONG64MOVVconst)
  6066  			v.AuxInt = int64ToAuxInt(c * d)
  6067  			return true
  6068  		}
  6069  		break
  6070  	}
  6071  	return false
  6072  }
  6073  func rewriteValueLOONG64_OpLOONG64NEGV(v *Value) bool {
  6074  	v_0 := v.Args[0]
  6075  	b := v.Block
  6076  	// match: (NEGV (SUBV x y))
  6077  	// result: (SUBV y x)
  6078  	for {
  6079  		if v_0.Op != OpLOONG64SUBV {
  6080  			break
  6081  		}
  6082  		y := v_0.Args[1]
  6083  		x := v_0.Args[0]
  6084  		v.reset(OpLOONG64SUBV)
  6085  		v.AddArg2(y, x)
  6086  		return true
  6087  	}
  6088  	// match: (NEGV <t> s:(ADDVconst [c] (SUBV x y)))
  6089  	// cond: s.Uses == 1 && is12Bit(-c)
  6090  	// result: (ADDVconst [-c] (SUBV <t> y x))
  6091  	for {
  6092  		t := v.Type
  6093  		s := v_0
  6094  		if s.Op != OpLOONG64ADDVconst {
  6095  			break
  6096  		}
  6097  		c := auxIntToInt64(s.AuxInt)
  6098  		s_0 := s.Args[0]
  6099  		if s_0.Op != OpLOONG64SUBV {
  6100  			break
  6101  		}
  6102  		y := s_0.Args[1]
  6103  		x := s_0.Args[0]
  6104  		if !(s.Uses == 1 && is12Bit(-c)) {
  6105  			break
  6106  		}
  6107  		v.reset(OpLOONG64ADDVconst)
  6108  		v.AuxInt = int64ToAuxInt(-c)
  6109  		v0 := b.NewValue0(v.Pos, OpLOONG64SUBV, t)
  6110  		v0.AddArg2(y, x)
  6111  		v.AddArg(v0)
  6112  		return true
  6113  	}
  6114  	// match: (NEGV (NEGV x))
  6115  	// result: x
  6116  	for {
  6117  		if v_0.Op != OpLOONG64NEGV {
  6118  			break
  6119  		}
  6120  		x := v_0.Args[0]
  6121  		v.copyOf(x)
  6122  		return true
  6123  	}
  6124  	// match: (NEGV <t> s:(ADDVconst [c] (NEGV x)))
  6125  	// cond: s.Uses == 1 && is12Bit(-c)
  6126  	// result: (ADDVconst [-c] x)
  6127  	for {
  6128  		s := v_0
  6129  		if s.Op != OpLOONG64ADDVconst {
  6130  			break
  6131  		}
  6132  		c := auxIntToInt64(s.AuxInt)
  6133  		s_0 := s.Args[0]
  6134  		if s_0.Op != OpLOONG64NEGV {
  6135  			break
  6136  		}
  6137  		x := s_0.Args[0]
  6138  		if !(s.Uses == 1 && is12Bit(-c)) {
  6139  			break
  6140  		}
  6141  		v.reset(OpLOONG64ADDVconst)
  6142  		v.AuxInt = int64ToAuxInt(-c)
  6143  		v.AddArg(x)
  6144  		return true
  6145  	}
  6146  	// match: (NEGV (MOVVconst [c]))
  6147  	// result: (MOVVconst [-c])
  6148  	for {
  6149  		if v_0.Op != OpLOONG64MOVVconst {
  6150  			break
  6151  		}
  6152  		c := auxIntToInt64(v_0.AuxInt)
  6153  		v.reset(OpLOONG64MOVVconst)
  6154  		v.AuxInt = int64ToAuxInt(-c)
  6155  		return true
  6156  	}
  6157  	return false
  6158  }
  6159  func rewriteValueLOONG64_OpLOONG64NOR(v *Value) bool {
  6160  	v_1 := v.Args[1]
  6161  	v_0 := v.Args[0]
  6162  	// match: (NOR x (MOVVconst [c]))
  6163  	// cond: is32Bit(c)
  6164  	// result: (NORconst [c] x)
  6165  	for {
  6166  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
  6167  			x := v_0
  6168  			if v_1.Op != OpLOONG64MOVVconst {
  6169  				continue
  6170  			}
  6171  			c := auxIntToInt64(v_1.AuxInt)
  6172  			if !(is32Bit(c)) {
  6173  				continue
  6174  			}
  6175  			v.reset(OpLOONG64NORconst)
  6176  			v.AuxInt = int64ToAuxInt(c)
  6177  			v.AddArg(x)
  6178  			return true
  6179  		}
  6180  		break
  6181  	}
  6182  	return false
  6183  }
  6184  func rewriteValueLOONG64_OpLOONG64NORconst(v *Value) bool {
  6185  	v_0 := v.Args[0]
  6186  	// match: (NORconst [c] (MOVVconst [d]))
  6187  	// result: (MOVVconst [^(c|d)])
  6188  	for {
  6189  		c := auxIntToInt64(v.AuxInt)
  6190  		if v_0.Op != OpLOONG64MOVVconst {
  6191  			break
  6192  		}
  6193  		d := auxIntToInt64(v_0.AuxInt)
  6194  		v.reset(OpLOONG64MOVVconst)
  6195  		v.AuxInt = int64ToAuxInt(^(c | d))
  6196  		return true
  6197  	}
  6198  	return false
  6199  }
  6200  func rewriteValueLOONG64_OpLOONG64OR(v *Value) bool {
  6201  	v_1 := v.Args[1]
  6202  	v_0 := v.Args[0]
  6203  	b := v.Block
  6204  	typ := &b.Func.Config.Types
  6205  	// match: (OR <typ.UInt16> (SRLVconst [8] <typ.UInt16> x) (SLLVconst [8] <typ.UInt16> x))
  6206  	// result: (REVB2H x)
  6207  	for {
  6208  		if v.Type != typ.UInt16 {
  6209  			break
  6210  		}
  6211  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
  6212  			if v_0.Op != OpLOONG64SRLVconst || v_0.Type != typ.UInt16 || auxIntToInt64(v_0.AuxInt) != 8 {
  6213  				continue
  6214  			}
  6215  			x := v_0.Args[0]
  6216  			if v_1.Op != OpLOONG64SLLVconst || v_1.Type != typ.UInt16 || auxIntToInt64(v_1.AuxInt) != 8 || x != v_1.Args[0] {
  6217  				continue
  6218  			}
  6219  			v.reset(OpLOONG64REVB2H)
  6220  			v.AddArg(x)
  6221  			return true
  6222  		}
  6223  		break
  6224  	}
  6225  	// match: (OR (SRLconst [8] (ANDconst [c1] x)) (SLLconst [8] (ANDconst [c2] x)))
  6226  	// cond: uint32(c1) == 0xff00ff00 && uint32(c2) == 0x00ff00ff
  6227  	// result: (REVB2H x)
  6228  	for {
  6229  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
  6230  			if v_0.Op != OpLOONG64SRLconst || auxIntToInt64(v_0.AuxInt) != 8 {
  6231  				continue
  6232  			}
  6233  			v_0_0 := v_0.Args[0]
  6234  			if v_0_0.Op != OpLOONG64ANDconst {
  6235  				continue
  6236  			}
  6237  			c1 := auxIntToInt64(v_0_0.AuxInt)
  6238  			x := v_0_0.Args[0]
  6239  			if v_1.Op != OpLOONG64SLLconst || auxIntToInt64(v_1.AuxInt) != 8 {
  6240  				continue
  6241  			}
  6242  			v_1_0 := v_1.Args[0]
  6243  			if v_1_0.Op != OpLOONG64ANDconst {
  6244  				continue
  6245  			}
  6246  			c2 := auxIntToInt64(v_1_0.AuxInt)
  6247  			if x != v_1_0.Args[0] || !(uint32(c1) == 0xff00ff00 && uint32(c2) == 0x00ff00ff) {
  6248  				continue
  6249  			}
  6250  			v.reset(OpLOONG64REVB2H)
  6251  			v.AddArg(x)
  6252  			return true
  6253  		}
  6254  		break
  6255  	}
  6256  	// match: (OR (SRLVconst [8] (AND (MOVVconst [c1]) x)) (SLLVconst [8] (AND (MOVVconst [c2]) x)))
  6257  	// cond: uint64(c1) == 0xff00ff00ff00ff00 && uint64(c2) == 0x00ff00ff00ff00ff
  6258  	// result: (REVB4H x)
  6259  	for {
  6260  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
  6261  			if v_0.Op != OpLOONG64SRLVconst || auxIntToInt64(v_0.AuxInt) != 8 {
  6262  				continue
  6263  			}
  6264  			v_0_0 := v_0.Args[0]
  6265  			if v_0_0.Op != OpLOONG64AND {
  6266  				continue
  6267  			}
  6268  			_ = v_0_0.Args[1]
  6269  			v_0_0_0 := v_0_0.Args[0]
  6270  			v_0_0_1 := v_0_0.Args[1]
  6271  			for _i1 := 0; _i1 <= 1; _i1, v_0_0_0, v_0_0_1 = _i1+1, v_0_0_1, v_0_0_0 {
  6272  				if v_0_0_0.Op != OpLOONG64MOVVconst {
  6273  					continue
  6274  				}
  6275  				c1 := auxIntToInt64(v_0_0_0.AuxInt)
  6276  				x := v_0_0_1
  6277  				if v_1.Op != OpLOONG64SLLVconst || auxIntToInt64(v_1.AuxInt) != 8 {
  6278  					continue
  6279  				}
  6280  				v_1_0 := v_1.Args[0]
  6281  				if v_1_0.Op != OpLOONG64AND {
  6282  					continue
  6283  				}
  6284  				_ = v_1_0.Args[1]
  6285  				v_1_0_0 := v_1_0.Args[0]
  6286  				v_1_0_1 := v_1_0.Args[1]
  6287  				for _i2 := 0; _i2 <= 1; _i2, v_1_0_0, v_1_0_1 = _i2+1, v_1_0_1, v_1_0_0 {
  6288  					if v_1_0_0.Op != OpLOONG64MOVVconst {
  6289  						continue
  6290  					}
  6291  					c2 := auxIntToInt64(v_1_0_0.AuxInt)
  6292  					if x != v_1_0_1 || !(uint64(c1) == 0xff00ff00ff00ff00 && uint64(c2) == 0x00ff00ff00ff00ff) {
  6293  						continue
  6294  					}
  6295  					v.reset(OpLOONG64REVB4H)
  6296  					v.AddArg(x)
  6297  					return true
  6298  				}
  6299  			}
  6300  		}
  6301  		break
  6302  	}
  6303  	// match: (OR (SRLVconst [8] (AND (MOVVconst [c1]) x)) (SLLVconst [8] (ANDconst [c2] x)))
  6304  	// cond: uint64(c1) == 0xff00ff00 && uint64(c2) == 0x00ff00ff
  6305  	// result: (REVB4H (ANDconst <x.Type> [0xffffffff] x))
  6306  	for {
  6307  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
  6308  			if v_0.Op != OpLOONG64SRLVconst || auxIntToInt64(v_0.AuxInt) != 8 {
  6309  				continue
  6310  			}
  6311  			v_0_0 := v_0.Args[0]
  6312  			if v_0_0.Op != OpLOONG64AND {
  6313  				continue
  6314  			}
  6315  			_ = v_0_0.Args[1]
  6316  			v_0_0_0 := v_0_0.Args[0]
  6317  			v_0_0_1 := v_0_0.Args[1]
  6318  			for _i1 := 0; _i1 <= 1; _i1, v_0_0_0, v_0_0_1 = _i1+1, v_0_0_1, v_0_0_0 {
  6319  				if v_0_0_0.Op != OpLOONG64MOVVconst {
  6320  					continue
  6321  				}
  6322  				c1 := auxIntToInt64(v_0_0_0.AuxInt)
  6323  				x := v_0_0_1
  6324  				if v_1.Op != OpLOONG64SLLVconst || auxIntToInt64(v_1.AuxInt) != 8 {
  6325  					continue
  6326  				}
  6327  				v_1_0 := v_1.Args[0]
  6328  				if v_1_0.Op != OpLOONG64ANDconst {
  6329  					continue
  6330  				}
  6331  				c2 := auxIntToInt64(v_1_0.AuxInt)
  6332  				if x != v_1_0.Args[0] || !(uint64(c1) == 0xff00ff00 && uint64(c2) == 0x00ff00ff) {
  6333  					continue
  6334  				}
  6335  				v.reset(OpLOONG64REVB4H)
  6336  				v0 := b.NewValue0(v.Pos, OpLOONG64ANDconst, x.Type)
  6337  				v0.AuxInt = int64ToAuxInt(0xffffffff)
  6338  				v0.AddArg(x)
  6339  				v.AddArg(v0)
  6340  				return true
  6341  			}
  6342  		}
  6343  		break
  6344  	}
  6345  	// match: (OR x (MOVVconst [c]))
  6346  	// cond: is32Bit(c)
  6347  	// result: (ORconst [c] x)
  6348  	for {
  6349  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
  6350  			x := v_0
  6351  			if v_1.Op != OpLOONG64MOVVconst {
  6352  				continue
  6353  			}
  6354  			c := auxIntToInt64(v_1.AuxInt)
  6355  			if !(is32Bit(c)) {
  6356  				continue
  6357  			}
  6358  			v.reset(OpLOONG64ORconst)
  6359  			v.AuxInt = int64ToAuxInt(c)
  6360  			v.AddArg(x)
  6361  			return true
  6362  		}
  6363  		break
  6364  	}
  6365  	// match: (OR x x)
  6366  	// result: x
  6367  	for {
  6368  		x := v_0
  6369  		if x != v_1 {
  6370  			break
  6371  		}
  6372  		v.copyOf(x)
  6373  		return true
  6374  	}
  6375  	// match: (OR x (NORconst [0] y))
  6376  	// result: (ORN x y)
  6377  	for {
  6378  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
  6379  			x := v_0
  6380  			if v_1.Op != OpLOONG64NORconst || auxIntToInt64(v_1.AuxInt) != 0 {
  6381  				continue
  6382  			}
  6383  			y := v_1.Args[0]
  6384  			v.reset(OpLOONG64ORN)
  6385  			v.AddArg2(x, y)
  6386  			return true
  6387  		}
  6388  		break
  6389  	}
  6390  	return false
  6391  }
  6392  func rewriteValueLOONG64_OpLOONG64ORN(v *Value) bool {
  6393  	v_1 := v.Args[1]
  6394  	v_0 := v.Args[0]
  6395  	// match: (ORN x (MOVVconst [-1]))
  6396  	// result: x
  6397  	for {
  6398  		x := v_0
  6399  		if v_1.Op != OpLOONG64MOVVconst || auxIntToInt64(v_1.AuxInt) != -1 {
  6400  			break
  6401  		}
  6402  		v.copyOf(x)
  6403  		return true
  6404  	}
  6405  	return false
  6406  }
  6407  func rewriteValueLOONG64_OpLOONG64ORconst(v *Value) bool {
  6408  	v_0 := v.Args[0]
  6409  	// match: (ORconst [0] x)
  6410  	// result: x
  6411  	for {
  6412  		if auxIntToInt64(v.AuxInt) != 0 {
  6413  			break
  6414  		}
  6415  		x := v_0
  6416  		v.copyOf(x)
  6417  		return true
  6418  	}
  6419  	// match: (ORconst [-1] _)
  6420  	// result: (MOVVconst [-1])
  6421  	for {
  6422  		if auxIntToInt64(v.AuxInt) != -1 {
  6423  			break
  6424  		}
  6425  		v.reset(OpLOONG64MOVVconst)
  6426  		v.AuxInt = int64ToAuxInt(-1)
  6427  		return true
  6428  	}
  6429  	// match: (ORconst [c] (MOVVconst [d]))
  6430  	// result: (MOVVconst [c|d])
  6431  	for {
  6432  		c := auxIntToInt64(v.AuxInt)
  6433  		if v_0.Op != OpLOONG64MOVVconst {
  6434  			break
  6435  		}
  6436  		d := auxIntToInt64(v_0.AuxInt)
  6437  		v.reset(OpLOONG64MOVVconst)
  6438  		v.AuxInt = int64ToAuxInt(c | d)
  6439  		return true
  6440  	}
  6441  	// match: (ORconst [c] (ORconst [d] x))
  6442  	// cond: is32Bit(c|d)
  6443  	// result: (ORconst [c|d] x)
  6444  	for {
  6445  		c := auxIntToInt64(v.AuxInt)
  6446  		if v_0.Op != OpLOONG64ORconst {
  6447  			break
  6448  		}
  6449  		d := auxIntToInt64(v_0.AuxInt)
  6450  		x := v_0.Args[0]
  6451  		if !(is32Bit(c | d)) {
  6452  			break
  6453  		}
  6454  		v.reset(OpLOONG64ORconst)
  6455  		v.AuxInt = int64ToAuxInt(c | d)
  6456  		v.AddArg(x)
  6457  		return true
  6458  	}
  6459  	return false
  6460  }
  6461  func rewriteValueLOONG64_OpLOONG64REMV(v *Value) bool {
  6462  	v_1 := v.Args[1]
  6463  	v_0 := v.Args[0]
  6464  	// match: (REMV (MOVVconst [c]) (MOVVconst [d]))
  6465  	// cond: d != 0
  6466  	// result: (MOVVconst [c%d])
  6467  	for {
  6468  		if v_0.Op != OpLOONG64MOVVconst {
  6469  			break
  6470  		}
  6471  		c := auxIntToInt64(v_0.AuxInt)
  6472  		if v_1.Op != OpLOONG64MOVVconst {
  6473  			break
  6474  		}
  6475  		d := auxIntToInt64(v_1.AuxInt)
  6476  		if !(d != 0) {
  6477  			break
  6478  		}
  6479  		v.reset(OpLOONG64MOVVconst)
  6480  		v.AuxInt = int64ToAuxInt(c % d)
  6481  		return true
  6482  	}
  6483  	return false
  6484  }
  6485  func rewriteValueLOONG64_OpLOONG64REMVU(v *Value) bool {
  6486  	v_1 := v.Args[1]
  6487  	v_0 := v.Args[0]
  6488  	// match: (REMVU _ (MOVVconst [1]))
  6489  	// result: (MOVVconst [0])
  6490  	for {
  6491  		if v_1.Op != OpLOONG64MOVVconst || auxIntToInt64(v_1.AuxInt) != 1 {
  6492  			break
  6493  		}
  6494  		v.reset(OpLOONG64MOVVconst)
  6495  		v.AuxInt = int64ToAuxInt(0)
  6496  		return true
  6497  	}
  6498  	// match: (REMVU x (MOVVconst [c]))
  6499  	// cond: isPowerOfTwo(c)
  6500  	// result: (ANDconst [c-1] x)
  6501  	for {
  6502  		x := v_0
  6503  		if v_1.Op != OpLOONG64MOVVconst {
  6504  			break
  6505  		}
  6506  		c := auxIntToInt64(v_1.AuxInt)
  6507  		if !(isPowerOfTwo(c)) {
  6508  			break
  6509  		}
  6510  		v.reset(OpLOONG64ANDconst)
  6511  		v.AuxInt = int64ToAuxInt(c - 1)
  6512  		v.AddArg(x)
  6513  		return true
  6514  	}
  6515  	// match: (REMVU (MOVVconst [c]) (MOVVconst [d]))
  6516  	// cond: d != 0
  6517  	// result: (MOVVconst [int64(uint64(c)%uint64(d))])
  6518  	for {
  6519  		if v_0.Op != OpLOONG64MOVVconst {
  6520  			break
  6521  		}
  6522  		c := auxIntToInt64(v_0.AuxInt)
  6523  		if v_1.Op != OpLOONG64MOVVconst {
  6524  			break
  6525  		}
  6526  		d := auxIntToInt64(v_1.AuxInt)
  6527  		if !(d != 0) {
  6528  			break
  6529  		}
  6530  		v.reset(OpLOONG64MOVVconst)
  6531  		v.AuxInt = int64ToAuxInt(int64(uint64(c) % uint64(d)))
  6532  		return true
  6533  	}
  6534  	return false
  6535  }
  6536  func rewriteValueLOONG64_OpLOONG64ROTR(v *Value) bool {
  6537  	v_1 := v.Args[1]
  6538  	v_0 := v.Args[0]
  6539  	// match: (ROTR x (MOVVconst [c]))
  6540  	// result: (ROTRconst x [c&31])
  6541  	for {
  6542  		x := v_0
  6543  		if v_1.Op != OpLOONG64MOVVconst {
  6544  			break
  6545  		}
  6546  		c := auxIntToInt64(v_1.AuxInt)
  6547  		v.reset(OpLOONG64ROTRconst)
  6548  		v.AuxInt = int64ToAuxInt(c & 31)
  6549  		v.AddArg(x)
  6550  		return true
  6551  	}
  6552  	return false
  6553  }
  6554  func rewriteValueLOONG64_OpLOONG64ROTRV(v *Value) bool {
  6555  	v_1 := v.Args[1]
  6556  	v_0 := v.Args[0]
  6557  	// match: (ROTRV x (MOVVconst [c]))
  6558  	// result: (ROTRVconst x [c&63])
  6559  	for {
  6560  		x := v_0
  6561  		if v_1.Op != OpLOONG64MOVVconst {
  6562  			break
  6563  		}
  6564  		c := auxIntToInt64(v_1.AuxInt)
  6565  		v.reset(OpLOONG64ROTRVconst)
  6566  		v.AuxInt = int64ToAuxInt(c & 63)
  6567  		v.AddArg(x)
  6568  		return true
  6569  	}
  6570  	return false
  6571  }
  6572  func rewriteValueLOONG64_OpLOONG64SGT(v *Value) bool {
  6573  	v_1 := v.Args[1]
  6574  	v_0 := v.Args[0]
  6575  	b := v.Block
  6576  	typ := &b.Func.Config.Types
  6577  	// match: (SGT (MOVVconst [c]) (NEGV (SUBVconst [d] x)))
  6578  	// cond: is32Bit(d-c)
  6579  	// result: (SGT x (MOVVconst [d-c]))
  6580  	for {
  6581  		if v_0.Op != OpLOONG64MOVVconst {
  6582  			break
  6583  		}
  6584  		c := auxIntToInt64(v_0.AuxInt)
  6585  		if v_1.Op != OpLOONG64NEGV {
  6586  			break
  6587  		}
  6588  		v_1_0 := v_1.Args[0]
  6589  		if v_1_0.Op != OpLOONG64SUBVconst {
  6590  			break
  6591  		}
  6592  		d := auxIntToInt64(v_1_0.AuxInt)
  6593  		x := v_1_0.Args[0]
  6594  		if !(is32Bit(d - c)) {
  6595  			break
  6596  		}
  6597  		v.reset(OpLOONG64SGT)
  6598  		v0 := b.NewValue0(v.Pos, OpLOONG64MOVVconst, typ.UInt64)
  6599  		v0.AuxInt = int64ToAuxInt(d - c)
  6600  		v.AddArg2(x, v0)
  6601  		return true
  6602  	}
  6603  	// match: (SGT (MOVVconst [c]) x)
  6604  	// cond: is32Bit(c)
  6605  	// result: (SGTconst [c] x)
  6606  	for {
  6607  		if v_0.Op != OpLOONG64MOVVconst {
  6608  			break
  6609  		}
  6610  		c := auxIntToInt64(v_0.AuxInt)
  6611  		x := v_1
  6612  		if !(is32Bit(c)) {
  6613  			break
  6614  		}
  6615  		v.reset(OpLOONG64SGTconst)
  6616  		v.AuxInt = int64ToAuxInt(c)
  6617  		v.AddArg(x)
  6618  		return true
  6619  	}
  6620  	// match: (SGT x x)
  6621  	// result: (MOVVconst [0])
  6622  	for {
  6623  		x := v_0
  6624  		if x != v_1 {
  6625  			break
  6626  		}
  6627  		v.reset(OpLOONG64MOVVconst)
  6628  		v.AuxInt = int64ToAuxInt(0)
  6629  		return true
  6630  	}
  6631  	return false
  6632  }
  6633  func rewriteValueLOONG64_OpLOONG64SGTU(v *Value) bool {
  6634  	v_1 := v.Args[1]
  6635  	v_0 := v.Args[0]
  6636  	// match: (SGTU (MOVVconst [c]) x)
  6637  	// cond: is32Bit(c)
  6638  	// result: (SGTUconst [c] x)
  6639  	for {
  6640  		if v_0.Op != OpLOONG64MOVVconst {
  6641  			break
  6642  		}
  6643  		c := auxIntToInt64(v_0.AuxInt)
  6644  		x := v_1
  6645  		if !(is32Bit(c)) {
  6646  			break
  6647  		}
  6648  		v.reset(OpLOONG64SGTUconst)
  6649  		v.AuxInt = int64ToAuxInt(c)
  6650  		v.AddArg(x)
  6651  		return true
  6652  	}
  6653  	// match: (SGTU x x)
  6654  	// result: (MOVVconst [0])
  6655  	for {
  6656  		x := v_0
  6657  		if x != v_1 {
  6658  			break
  6659  		}
  6660  		v.reset(OpLOONG64MOVVconst)
  6661  		v.AuxInt = int64ToAuxInt(0)
  6662  		return true
  6663  	}
  6664  	return false
  6665  }
  6666  func rewriteValueLOONG64_OpLOONG64SGTUconst(v *Value) bool {
  6667  	v_0 := v.Args[0]
  6668  	// match: (SGTUconst [c] (MOVVconst [d]))
  6669  	// cond: uint64(c)>uint64(d)
  6670  	// result: (MOVVconst [1])
  6671  	for {
  6672  		c := auxIntToInt64(v.AuxInt)
  6673  		if v_0.Op != OpLOONG64MOVVconst {
  6674  			break
  6675  		}
  6676  		d := auxIntToInt64(v_0.AuxInt)
  6677  		if !(uint64(c) > uint64(d)) {
  6678  			break
  6679  		}
  6680  		v.reset(OpLOONG64MOVVconst)
  6681  		v.AuxInt = int64ToAuxInt(1)
  6682  		return true
  6683  	}
  6684  	// match: (SGTUconst [c] (MOVVconst [d]))
  6685  	// cond: uint64(c)<=uint64(d)
  6686  	// result: (MOVVconst [0])
  6687  	for {
  6688  		c := auxIntToInt64(v.AuxInt)
  6689  		if v_0.Op != OpLOONG64MOVVconst {
  6690  			break
  6691  		}
  6692  		d := auxIntToInt64(v_0.AuxInt)
  6693  		if !(uint64(c) <= uint64(d)) {
  6694  			break
  6695  		}
  6696  		v.reset(OpLOONG64MOVVconst)
  6697  		v.AuxInt = int64ToAuxInt(0)
  6698  		return true
  6699  	}
  6700  	// match: (SGTUconst [c] (MOVBUreg _))
  6701  	// cond: 0xff < uint64(c)
  6702  	// result: (MOVVconst [1])
  6703  	for {
  6704  		c := auxIntToInt64(v.AuxInt)
  6705  		if v_0.Op != OpLOONG64MOVBUreg || !(0xff < uint64(c)) {
  6706  			break
  6707  		}
  6708  		v.reset(OpLOONG64MOVVconst)
  6709  		v.AuxInt = int64ToAuxInt(1)
  6710  		return true
  6711  	}
  6712  	// match: (SGTUconst [c] (MOVHUreg _))
  6713  	// cond: 0xffff < uint64(c)
  6714  	// result: (MOVVconst [1])
  6715  	for {
  6716  		c := auxIntToInt64(v.AuxInt)
  6717  		if v_0.Op != OpLOONG64MOVHUreg || !(0xffff < uint64(c)) {
  6718  			break
  6719  		}
  6720  		v.reset(OpLOONG64MOVVconst)
  6721  		v.AuxInt = int64ToAuxInt(1)
  6722  		return true
  6723  	}
  6724  	// match: (SGTUconst [c] (ANDconst [m] _))
  6725  	// cond: uint64(m) < uint64(c)
  6726  	// result: (MOVVconst [1])
  6727  	for {
  6728  		c := auxIntToInt64(v.AuxInt)
  6729  		if v_0.Op != OpLOONG64ANDconst {
  6730  			break
  6731  		}
  6732  		m := auxIntToInt64(v_0.AuxInt)
  6733  		if !(uint64(m) < uint64(c)) {
  6734  			break
  6735  		}
  6736  		v.reset(OpLOONG64MOVVconst)
  6737  		v.AuxInt = int64ToAuxInt(1)
  6738  		return true
  6739  	}
  6740  	// match: (SGTUconst [c] (SRLVconst _ [d]))
  6741  	// cond: 0 < d && d <= 63 && 0xffffffffffffffff>>uint64(d) < uint64(c)
  6742  	// result: (MOVVconst [1])
  6743  	for {
  6744  		c := auxIntToInt64(v.AuxInt)
  6745  		if v_0.Op != OpLOONG64SRLVconst {
  6746  			break
  6747  		}
  6748  		d := auxIntToInt64(v_0.AuxInt)
  6749  		if !(0 < d && d <= 63 && 0xffffffffffffffff>>uint64(d) < uint64(c)) {
  6750  			break
  6751  		}
  6752  		v.reset(OpLOONG64MOVVconst)
  6753  		v.AuxInt = int64ToAuxInt(1)
  6754  		return true
  6755  	}
  6756  	return false
  6757  }
  6758  func rewriteValueLOONG64_OpLOONG64SGTconst(v *Value) bool {
  6759  	v_0 := v.Args[0]
  6760  	// match: (SGTconst [c] (MOVVconst [d]))
  6761  	// cond: c>d
  6762  	// result: (MOVVconst [1])
  6763  	for {
  6764  		c := auxIntToInt64(v.AuxInt)
  6765  		if v_0.Op != OpLOONG64MOVVconst {
  6766  			break
  6767  		}
  6768  		d := auxIntToInt64(v_0.AuxInt)
  6769  		if !(c > d) {
  6770  			break
  6771  		}
  6772  		v.reset(OpLOONG64MOVVconst)
  6773  		v.AuxInt = int64ToAuxInt(1)
  6774  		return true
  6775  	}
  6776  	// match: (SGTconst [c] (MOVVconst [d]))
  6777  	// cond: c<=d
  6778  	// result: (MOVVconst [0])
  6779  	for {
  6780  		c := auxIntToInt64(v.AuxInt)
  6781  		if v_0.Op != OpLOONG64MOVVconst {
  6782  			break
  6783  		}
  6784  		d := auxIntToInt64(v_0.AuxInt)
  6785  		if !(c <= d) {
  6786  			break
  6787  		}
  6788  		v.reset(OpLOONG64MOVVconst)
  6789  		v.AuxInt = int64ToAuxInt(0)
  6790  		return true
  6791  	}
  6792  	// match: (SGTconst [c] (MOVBreg _))
  6793  	// cond: 0x7f < c
  6794  	// result: (MOVVconst [1])
  6795  	for {
  6796  		c := auxIntToInt64(v.AuxInt)
  6797  		if v_0.Op != OpLOONG64MOVBreg || !(0x7f < c) {
  6798  			break
  6799  		}
  6800  		v.reset(OpLOONG64MOVVconst)
  6801  		v.AuxInt = int64ToAuxInt(1)
  6802  		return true
  6803  	}
  6804  	// match: (SGTconst [c] (MOVBreg _))
  6805  	// cond: c <= -0x80
  6806  	// result: (MOVVconst [0])
  6807  	for {
  6808  		c := auxIntToInt64(v.AuxInt)
  6809  		if v_0.Op != OpLOONG64MOVBreg || !(c <= -0x80) {
  6810  			break
  6811  		}
  6812  		v.reset(OpLOONG64MOVVconst)
  6813  		v.AuxInt = int64ToAuxInt(0)
  6814  		return true
  6815  	}
  6816  	// match: (SGTconst [c] (MOVBUreg _))
  6817  	// cond: 0xff < c
  6818  	// result: (MOVVconst [1])
  6819  	for {
  6820  		c := auxIntToInt64(v.AuxInt)
  6821  		if v_0.Op != OpLOONG64MOVBUreg || !(0xff < c) {
  6822  			break
  6823  		}
  6824  		v.reset(OpLOONG64MOVVconst)
  6825  		v.AuxInt = int64ToAuxInt(1)
  6826  		return true
  6827  	}
  6828  	// match: (SGTconst [c] (MOVBUreg _))
  6829  	// cond: c < 0
  6830  	// result: (MOVVconst [0])
  6831  	for {
  6832  		c := auxIntToInt64(v.AuxInt)
  6833  		if v_0.Op != OpLOONG64MOVBUreg || !(c < 0) {
  6834  			break
  6835  		}
  6836  		v.reset(OpLOONG64MOVVconst)
  6837  		v.AuxInt = int64ToAuxInt(0)
  6838  		return true
  6839  	}
  6840  	// match: (SGTconst [c] (MOVHreg _))
  6841  	// cond: 0x7fff < c
  6842  	// result: (MOVVconst [1])
  6843  	for {
  6844  		c := auxIntToInt64(v.AuxInt)
  6845  		if v_0.Op != OpLOONG64MOVHreg || !(0x7fff < c) {
  6846  			break
  6847  		}
  6848  		v.reset(OpLOONG64MOVVconst)
  6849  		v.AuxInt = int64ToAuxInt(1)
  6850  		return true
  6851  	}
  6852  	// match: (SGTconst [c] (MOVHreg _))
  6853  	// cond: c <= -0x8000
  6854  	// result: (MOVVconst [0])
  6855  	for {
  6856  		c := auxIntToInt64(v.AuxInt)
  6857  		if v_0.Op != OpLOONG64MOVHreg || !(c <= -0x8000) {
  6858  			break
  6859  		}
  6860  		v.reset(OpLOONG64MOVVconst)
  6861  		v.AuxInt = int64ToAuxInt(0)
  6862  		return true
  6863  	}
  6864  	// match: (SGTconst [c] (MOVHUreg _))
  6865  	// cond: 0xffff < c
  6866  	// result: (MOVVconst [1])
  6867  	for {
  6868  		c := auxIntToInt64(v.AuxInt)
  6869  		if v_0.Op != OpLOONG64MOVHUreg || !(0xffff < c) {
  6870  			break
  6871  		}
  6872  		v.reset(OpLOONG64MOVVconst)
  6873  		v.AuxInt = int64ToAuxInt(1)
  6874  		return true
  6875  	}
  6876  	// match: (SGTconst [c] (MOVHUreg _))
  6877  	// cond: c < 0
  6878  	// result: (MOVVconst [0])
  6879  	for {
  6880  		c := auxIntToInt64(v.AuxInt)
  6881  		if v_0.Op != OpLOONG64MOVHUreg || !(c < 0) {
  6882  			break
  6883  		}
  6884  		v.reset(OpLOONG64MOVVconst)
  6885  		v.AuxInt = int64ToAuxInt(0)
  6886  		return true
  6887  	}
  6888  	// match: (SGTconst [c] (MOVWUreg _))
  6889  	// cond: c < 0
  6890  	// result: (MOVVconst [0])
  6891  	for {
  6892  		c := auxIntToInt64(v.AuxInt)
  6893  		if v_0.Op != OpLOONG64MOVWUreg || !(c < 0) {
  6894  			break
  6895  		}
  6896  		v.reset(OpLOONG64MOVVconst)
  6897  		v.AuxInt = int64ToAuxInt(0)
  6898  		return true
  6899  	}
  6900  	// match: (SGTconst [c] (ANDconst [m] _))
  6901  	// cond: 0 <= m && m < c
  6902  	// result: (MOVVconst [1])
  6903  	for {
  6904  		c := auxIntToInt64(v.AuxInt)
  6905  		if v_0.Op != OpLOONG64ANDconst {
  6906  			break
  6907  		}
  6908  		m := auxIntToInt64(v_0.AuxInt)
  6909  		if !(0 <= m && m < c) {
  6910  			break
  6911  		}
  6912  		v.reset(OpLOONG64MOVVconst)
  6913  		v.AuxInt = int64ToAuxInt(1)
  6914  		return true
  6915  	}
  6916  	// match: (SGTconst [c] (SRLVconst _ [d]))
  6917  	// cond: 0 <= c && 0 < d && d <= 63 && 0xffffffffffffffff>>uint64(d) < uint64(c)
  6918  	// result: (MOVVconst [1])
  6919  	for {
  6920  		c := auxIntToInt64(v.AuxInt)
  6921  		if v_0.Op != OpLOONG64SRLVconst {
  6922  			break
  6923  		}
  6924  		d := auxIntToInt64(v_0.AuxInt)
  6925  		if !(0 <= c && 0 < d && d <= 63 && 0xffffffffffffffff>>uint64(d) < uint64(c)) {
  6926  			break
  6927  		}
  6928  		v.reset(OpLOONG64MOVVconst)
  6929  		v.AuxInt = int64ToAuxInt(1)
  6930  		return true
  6931  	}
  6932  	return false
  6933  }
  6934  func rewriteValueLOONG64_OpLOONG64SLL(v *Value) bool {
  6935  	v_1 := v.Args[1]
  6936  	v_0 := v.Args[0]
  6937  	// match: (SLL _ (MOVVconst [c]))
  6938  	// cond: uint64(c)>=32
  6939  	// result: (MOVVconst [0])
  6940  	for {
  6941  		if v_1.Op != OpLOONG64MOVVconst {
  6942  			break
  6943  		}
  6944  		c := auxIntToInt64(v_1.AuxInt)
  6945  		if !(uint64(c) >= 32) {
  6946  			break
  6947  		}
  6948  		v.reset(OpLOONG64MOVVconst)
  6949  		v.AuxInt = int64ToAuxInt(0)
  6950  		return true
  6951  	}
  6952  	// match: (SLL x (MOVVconst [c]))
  6953  	// cond: uint64(c) >=0 && uint64(c) <=31
  6954  	// result: (SLLconst x [c])
  6955  	for {
  6956  		x := v_0
  6957  		if v_1.Op != OpLOONG64MOVVconst {
  6958  			break
  6959  		}
  6960  		c := auxIntToInt64(v_1.AuxInt)
  6961  		if !(uint64(c) >= 0 && uint64(c) <= 31) {
  6962  			break
  6963  		}
  6964  		v.reset(OpLOONG64SLLconst)
  6965  		v.AuxInt = int64ToAuxInt(c)
  6966  		v.AddArg(x)
  6967  		return true
  6968  	}
  6969  	// match: (SLL x (ANDconst [31] y))
  6970  	// result: (SLL x y)
  6971  	for {
  6972  		x := v_0
  6973  		if v_1.Op != OpLOONG64ANDconst || auxIntToInt64(v_1.AuxInt) != 31 {
  6974  			break
  6975  		}
  6976  		y := v_1.Args[0]
  6977  		v.reset(OpLOONG64SLL)
  6978  		v.AddArg2(x, y)
  6979  		return true
  6980  	}
  6981  	return false
  6982  }
  6983  func rewriteValueLOONG64_OpLOONG64SLLV(v *Value) bool {
  6984  	v_1 := v.Args[1]
  6985  	v_0 := v.Args[0]
  6986  	// match: (SLLV _ (MOVVconst [c]))
  6987  	// cond: uint64(c)>=64
  6988  	// result: (MOVVconst [0])
  6989  	for {
  6990  		if v_1.Op != OpLOONG64MOVVconst {
  6991  			break
  6992  		}
  6993  		c := auxIntToInt64(v_1.AuxInt)
  6994  		if !(uint64(c) >= 64) {
  6995  			break
  6996  		}
  6997  		v.reset(OpLOONG64MOVVconst)
  6998  		v.AuxInt = int64ToAuxInt(0)
  6999  		return true
  7000  	}
  7001  	// match: (SLLV x (MOVVconst [c]))
  7002  	// result: (SLLVconst x [c])
  7003  	for {
  7004  		x := v_0
  7005  		if v_1.Op != OpLOONG64MOVVconst {
  7006  			break
  7007  		}
  7008  		c := auxIntToInt64(v_1.AuxInt)
  7009  		v.reset(OpLOONG64SLLVconst)
  7010  		v.AuxInt = int64ToAuxInt(c)
  7011  		v.AddArg(x)
  7012  		return true
  7013  	}
  7014  	// match: (SLLV x (ANDconst [63] y))
  7015  	// result: (SLLV x y)
  7016  	for {
  7017  		x := v_0
  7018  		if v_1.Op != OpLOONG64ANDconst || auxIntToInt64(v_1.AuxInt) != 63 {
  7019  			break
  7020  		}
  7021  		y := v_1.Args[0]
  7022  		v.reset(OpLOONG64SLLV)
  7023  		v.AddArg2(x, y)
  7024  		return true
  7025  	}
  7026  	return false
  7027  }
  7028  func rewriteValueLOONG64_OpLOONG64SLLVconst(v *Value) bool {
  7029  	v_0 := v.Args[0]
  7030  	// match: (SLLVconst <t> [c] (ADDV x x))
  7031  	// cond: c < t.Size() * 8 - 1
  7032  	// result: (SLLVconst [c+1] x)
  7033  	for {
  7034  		t := v.Type
  7035  		c := auxIntToInt64(v.AuxInt)
  7036  		if v_0.Op != OpLOONG64ADDV {
  7037  			break
  7038  		}
  7039  		x := v_0.Args[1]
  7040  		if x != v_0.Args[0] || !(c < t.Size()*8-1) {
  7041  			break
  7042  		}
  7043  		v.reset(OpLOONG64SLLVconst)
  7044  		v.AuxInt = int64ToAuxInt(c + 1)
  7045  		v.AddArg(x)
  7046  		return true
  7047  	}
  7048  	// match: (SLLVconst <t> [c] (ADDV x x))
  7049  	// cond: c >= t.Size() * 8 - 1
  7050  	// result: (MOVVconst [0])
  7051  	for {
  7052  		t := v.Type
  7053  		c := auxIntToInt64(v.AuxInt)
  7054  		if v_0.Op != OpLOONG64ADDV {
  7055  			break
  7056  		}
  7057  		x := v_0.Args[1]
  7058  		if x != v_0.Args[0] || !(c >= t.Size()*8-1) {
  7059  			break
  7060  		}
  7061  		v.reset(OpLOONG64MOVVconst)
  7062  		v.AuxInt = int64ToAuxInt(0)
  7063  		return true
  7064  	}
  7065  	// match: (SLLVconst [c] (MOVVconst [d]))
  7066  	// result: (MOVVconst [d<<uint64(c)])
  7067  	for {
  7068  		c := auxIntToInt64(v.AuxInt)
  7069  		if v_0.Op != OpLOONG64MOVVconst {
  7070  			break
  7071  		}
  7072  		d := auxIntToInt64(v_0.AuxInt)
  7073  		v.reset(OpLOONG64MOVVconst)
  7074  		v.AuxInt = int64ToAuxInt(d << uint64(c))
  7075  		return true
  7076  	}
  7077  	return false
  7078  }
  7079  func rewriteValueLOONG64_OpLOONG64SLLconst(v *Value) bool {
  7080  	v_0 := v.Args[0]
  7081  	// match: (SLLconst <t> [c] (ADDV x x))
  7082  	// cond: c < t.Size() * 8 - 1
  7083  	// result: (SLLconst [c+1] x)
  7084  	for {
  7085  		t := v.Type
  7086  		c := auxIntToInt64(v.AuxInt)
  7087  		if v_0.Op != OpLOONG64ADDV {
  7088  			break
  7089  		}
  7090  		x := v_0.Args[1]
  7091  		if x != v_0.Args[0] || !(c < t.Size()*8-1) {
  7092  			break
  7093  		}
  7094  		v.reset(OpLOONG64SLLconst)
  7095  		v.AuxInt = int64ToAuxInt(c + 1)
  7096  		v.AddArg(x)
  7097  		return true
  7098  	}
  7099  	// match: (SLLconst <t> [c] (ADDV x x))
  7100  	// cond: c >= t.Size() * 8 - 1
  7101  	// result: (MOVVconst [0])
  7102  	for {
  7103  		t := v.Type
  7104  		c := auxIntToInt64(v.AuxInt)
  7105  		if v_0.Op != OpLOONG64ADDV {
  7106  			break
  7107  		}
  7108  		x := v_0.Args[1]
  7109  		if x != v_0.Args[0] || !(c >= t.Size()*8-1) {
  7110  			break
  7111  		}
  7112  		v.reset(OpLOONG64MOVVconst)
  7113  		v.AuxInt = int64ToAuxInt(0)
  7114  		return true
  7115  	}
  7116  	return false
  7117  }
  7118  func rewriteValueLOONG64_OpLOONG64SRA(v *Value) bool {
  7119  	v_1 := v.Args[1]
  7120  	v_0 := v.Args[0]
  7121  	// match: (SRA x (MOVVconst [c]))
  7122  	// cond: uint64(c)>=32
  7123  	// result: (SRAconst x [31])
  7124  	for {
  7125  		x := v_0
  7126  		if v_1.Op != OpLOONG64MOVVconst {
  7127  			break
  7128  		}
  7129  		c := auxIntToInt64(v_1.AuxInt)
  7130  		if !(uint64(c) >= 32) {
  7131  			break
  7132  		}
  7133  		v.reset(OpLOONG64SRAconst)
  7134  		v.AuxInt = int64ToAuxInt(31)
  7135  		v.AddArg(x)
  7136  		return true
  7137  	}
  7138  	// match: (SRA x (MOVVconst [c]))
  7139  	// cond: uint64(c) >=0 && uint64(c) <=31
  7140  	// result: (SRAconst x [c])
  7141  	for {
  7142  		x := v_0
  7143  		if v_1.Op != OpLOONG64MOVVconst {
  7144  			break
  7145  		}
  7146  		c := auxIntToInt64(v_1.AuxInt)
  7147  		if !(uint64(c) >= 0 && uint64(c) <= 31) {
  7148  			break
  7149  		}
  7150  		v.reset(OpLOONG64SRAconst)
  7151  		v.AuxInt = int64ToAuxInt(c)
  7152  		v.AddArg(x)
  7153  		return true
  7154  	}
  7155  	// match: (SRA x (ANDconst [31] y))
  7156  	// result: (SRA x y)
  7157  	for {
  7158  		x := v_0
  7159  		if v_1.Op != OpLOONG64ANDconst || auxIntToInt64(v_1.AuxInt) != 31 {
  7160  			break
  7161  		}
  7162  		y := v_1.Args[0]
  7163  		v.reset(OpLOONG64SRA)
  7164  		v.AddArg2(x, y)
  7165  		return true
  7166  	}
  7167  	return false
  7168  }
  7169  func rewriteValueLOONG64_OpLOONG64SRAV(v *Value) bool {
  7170  	v_1 := v.Args[1]
  7171  	v_0 := v.Args[0]
  7172  	// match: (SRAV x (MOVVconst [c]))
  7173  	// cond: uint64(c)>=64
  7174  	// result: (SRAVconst x [63])
  7175  	for {
  7176  		x := v_0
  7177  		if v_1.Op != OpLOONG64MOVVconst {
  7178  			break
  7179  		}
  7180  		c := auxIntToInt64(v_1.AuxInt)
  7181  		if !(uint64(c) >= 64) {
  7182  			break
  7183  		}
  7184  		v.reset(OpLOONG64SRAVconst)
  7185  		v.AuxInt = int64ToAuxInt(63)
  7186  		v.AddArg(x)
  7187  		return true
  7188  	}
  7189  	// match: (SRAV x (MOVVconst [c]))
  7190  	// result: (SRAVconst x [c])
  7191  	for {
  7192  		x := v_0
  7193  		if v_1.Op != OpLOONG64MOVVconst {
  7194  			break
  7195  		}
  7196  		c := auxIntToInt64(v_1.AuxInt)
  7197  		v.reset(OpLOONG64SRAVconst)
  7198  		v.AuxInt = int64ToAuxInt(c)
  7199  		v.AddArg(x)
  7200  		return true
  7201  	}
  7202  	// match: (SRAV x (ANDconst [63] y))
  7203  	// result: (SRAV x y)
  7204  	for {
  7205  		x := v_0
  7206  		if v_1.Op != OpLOONG64ANDconst || auxIntToInt64(v_1.AuxInt) != 63 {
  7207  			break
  7208  		}
  7209  		y := v_1.Args[0]
  7210  		v.reset(OpLOONG64SRAV)
  7211  		v.AddArg2(x, y)
  7212  		return true
  7213  	}
  7214  	return false
  7215  }
  7216  func rewriteValueLOONG64_OpLOONG64SRAVconst(v *Value) bool {
  7217  	v_0 := v.Args[0]
  7218  	b := v.Block
  7219  	// match: (SRAVconst [rc] (MOVWreg y))
  7220  	// cond: rc >= 0 && rc <= 31
  7221  	// result: (SRAconst [int64(rc)] y)
  7222  	for {
  7223  		rc := auxIntToInt64(v.AuxInt)
  7224  		if v_0.Op != OpLOONG64MOVWreg {
  7225  			break
  7226  		}
  7227  		y := v_0.Args[0]
  7228  		if !(rc >= 0 && rc <= 31) {
  7229  			break
  7230  		}
  7231  		v.reset(OpLOONG64SRAconst)
  7232  		v.AuxInt = int64ToAuxInt(int64(rc))
  7233  		v.AddArg(y)
  7234  		return true
  7235  	}
  7236  	// match: (SRAVconst <t> [rc] (MOVBreg y))
  7237  	// cond: rc >= 8
  7238  	// result: (SRAVconst [63] (SLLVconst <t> [56] y))
  7239  	for {
  7240  		t := v.Type
  7241  		rc := auxIntToInt64(v.AuxInt)
  7242  		if v_0.Op != OpLOONG64MOVBreg {
  7243  			break
  7244  		}
  7245  		y := v_0.Args[0]
  7246  		if !(rc >= 8) {
  7247  			break
  7248  		}
  7249  		v.reset(OpLOONG64SRAVconst)
  7250  		v.AuxInt = int64ToAuxInt(63)
  7251  		v0 := b.NewValue0(v.Pos, OpLOONG64SLLVconst, t)
  7252  		v0.AuxInt = int64ToAuxInt(56)
  7253  		v0.AddArg(y)
  7254  		v.AddArg(v0)
  7255  		return true
  7256  	}
  7257  	// match: (SRAVconst <t> [rc] (MOVHreg y))
  7258  	// cond: rc >= 16
  7259  	// result: (SRAVconst [63] (SLLVconst <t> [48] y))
  7260  	for {
  7261  		t := v.Type
  7262  		rc := auxIntToInt64(v.AuxInt)
  7263  		if v_0.Op != OpLOONG64MOVHreg {
  7264  			break
  7265  		}
  7266  		y := v_0.Args[0]
  7267  		if !(rc >= 16) {
  7268  			break
  7269  		}
  7270  		v.reset(OpLOONG64SRAVconst)
  7271  		v.AuxInt = int64ToAuxInt(63)
  7272  		v0 := b.NewValue0(v.Pos, OpLOONG64SLLVconst, t)
  7273  		v0.AuxInt = int64ToAuxInt(48)
  7274  		v0.AddArg(y)
  7275  		v.AddArg(v0)
  7276  		return true
  7277  	}
  7278  	// match: (SRAVconst <t> [rc] (MOVWreg y))
  7279  	// cond: rc >= 32
  7280  	// result: (SRAconst [31] y)
  7281  	for {
  7282  		rc := auxIntToInt64(v.AuxInt)
  7283  		if v_0.Op != OpLOONG64MOVWreg {
  7284  			break
  7285  		}
  7286  		y := v_0.Args[0]
  7287  		if !(rc >= 32) {
  7288  			break
  7289  		}
  7290  		v.reset(OpLOONG64SRAconst)
  7291  		v.AuxInt = int64ToAuxInt(31)
  7292  		v.AddArg(y)
  7293  		return true
  7294  	}
  7295  	// match: (SRAVconst [c] (MOVVconst [d]))
  7296  	// result: (MOVVconst [d>>uint64(c)])
  7297  	for {
  7298  		c := auxIntToInt64(v.AuxInt)
  7299  		if v_0.Op != OpLOONG64MOVVconst {
  7300  			break
  7301  		}
  7302  		d := auxIntToInt64(v_0.AuxInt)
  7303  		v.reset(OpLOONG64MOVVconst)
  7304  		v.AuxInt = int64ToAuxInt(d >> uint64(c))
  7305  		return true
  7306  	}
  7307  	return false
  7308  }
  7309  func rewriteValueLOONG64_OpLOONG64SRL(v *Value) bool {
  7310  	v_1 := v.Args[1]
  7311  	v_0 := v.Args[0]
  7312  	// match: (SRL _ (MOVVconst [c]))
  7313  	// cond: uint64(c)>=32
  7314  	// result: (MOVVconst [0])
  7315  	for {
  7316  		if v_1.Op != OpLOONG64MOVVconst {
  7317  			break
  7318  		}
  7319  		c := auxIntToInt64(v_1.AuxInt)
  7320  		if !(uint64(c) >= 32) {
  7321  			break
  7322  		}
  7323  		v.reset(OpLOONG64MOVVconst)
  7324  		v.AuxInt = int64ToAuxInt(0)
  7325  		return true
  7326  	}
  7327  	// match: (SRL x (MOVVconst [c]))
  7328  	// cond: uint64(c) >=0 && uint64(c) <=31
  7329  	// result: (SRLconst x [c])
  7330  	for {
  7331  		x := v_0
  7332  		if v_1.Op != OpLOONG64MOVVconst {
  7333  			break
  7334  		}
  7335  		c := auxIntToInt64(v_1.AuxInt)
  7336  		if !(uint64(c) >= 0 && uint64(c) <= 31) {
  7337  			break
  7338  		}
  7339  		v.reset(OpLOONG64SRLconst)
  7340  		v.AuxInt = int64ToAuxInt(c)
  7341  		v.AddArg(x)
  7342  		return true
  7343  	}
  7344  	// match: (SRL x (ANDconst [31] y))
  7345  	// result: (SRL x y)
  7346  	for {
  7347  		x := v_0
  7348  		if v_1.Op != OpLOONG64ANDconst || auxIntToInt64(v_1.AuxInt) != 31 {
  7349  			break
  7350  		}
  7351  		y := v_1.Args[0]
  7352  		v.reset(OpLOONG64SRL)
  7353  		v.AddArg2(x, y)
  7354  		return true
  7355  	}
  7356  	return false
  7357  }
  7358  func rewriteValueLOONG64_OpLOONG64SRLV(v *Value) bool {
  7359  	v_1 := v.Args[1]
  7360  	v_0 := v.Args[0]
  7361  	// match: (SRLV _ (MOVVconst [c]))
  7362  	// cond: uint64(c)>=64
  7363  	// result: (MOVVconst [0])
  7364  	for {
  7365  		if v_1.Op != OpLOONG64MOVVconst {
  7366  			break
  7367  		}
  7368  		c := auxIntToInt64(v_1.AuxInt)
  7369  		if !(uint64(c) >= 64) {
  7370  			break
  7371  		}
  7372  		v.reset(OpLOONG64MOVVconst)
  7373  		v.AuxInt = int64ToAuxInt(0)
  7374  		return true
  7375  	}
  7376  	// match: (SRLV x (MOVVconst [c]))
  7377  	// result: (SRLVconst x [c])
  7378  	for {
  7379  		x := v_0
  7380  		if v_1.Op != OpLOONG64MOVVconst {
  7381  			break
  7382  		}
  7383  		c := auxIntToInt64(v_1.AuxInt)
  7384  		v.reset(OpLOONG64SRLVconst)
  7385  		v.AuxInt = int64ToAuxInt(c)
  7386  		v.AddArg(x)
  7387  		return true
  7388  	}
  7389  	// match: (SRLV x (ANDconst [63] y))
  7390  	// result: (SRLV x y)
  7391  	for {
  7392  		x := v_0
  7393  		if v_1.Op != OpLOONG64ANDconst || auxIntToInt64(v_1.AuxInt) != 63 {
  7394  			break
  7395  		}
  7396  		y := v_1.Args[0]
  7397  		v.reset(OpLOONG64SRLV)
  7398  		v.AddArg2(x, y)
  7399  		return true
  7400  	}
  7401  	return false
  7402  }
  7403  func rewriteValueLOONG64_OpLOONG64SRLVconst(v *Value) bool {
  7404  	v_0 := v.Args[0]
  7405  	// match: (SRLVconst [rc] (SLLVconst [lc] x))
  7406  	// cond: lc <= rc
  7407  	// result: (BSTRPICKV [rc-lc + ((64-lc)-1)<<6] x)
  7408  	for {
  7409  		rc := auxIntToInt64(v.AuxInt)
  7410  		if v_0.Op != OpLOONG64SLLVconst {
  7411  			break
  7412  		}
  7413  		lc := auxIntToInt64(v_0.AuxInt)
  7414  		x := v_0.Args[0]
  7415  		if !(lc <= rc) {
  7416  			break
  7417  		}
  7418  		v.reset(OpLOONG64BSTRPICKV)
  7419  		v.AuxInt = int64ToAuxInt(rc - lc + ((64-lc)-1)<<6)
  7420  		v.AddArg(x)
  7421  		return true
  7422  	}
  7423  	// match: (SRLVconst [rc] (MOVWUreg x))
  7424  	// cond: rc < 32
  7425  	// result: (BSTRPICKV [rc + 31<<6] x)
  7426  	for {
  7427  		rc := auxIntToInt64(v.AuxInt)
  7428  		if v_0.Op != OpLOONG64MOVWUreg {
  7429  			break
  7430  		}
  7431  		x := v_0.Args[0]
  7432  		if !(rc < 32) {
  7433  			break
  7434  		}
  7435  		v.reset(OpLOONG64BSTRPICKV)
  7436  		v.AuxInt = int64ToAuxInt(rc + 31<<6)
  7437  		v.AddArg(x)
  7438  		return true
  7439  	}
  7440  	// match: (SRLVconst [rc] (MOVHUreg x))
  7441  	// cond: rc < 16
  7442  	// result: (BSTRPICKV [rc + 15<<6] x)
  7443  	for {
  7444  		rc := auxIntToInt64(v.AuxInt)
  7445  		if v_0.Op != OpLOONG64MOVHUreg {
  7446  			break
  7447  		}
  7448  		x := v_0.Args[0]
  7449  		if !(rc < 16) {
  7450  			break
  7451  		}
  7452  		v.reset(OpLOONG64BSTRPICKV)
  7453  		v.AuxInt = int64ToAuxInt(rc + 15<<6)
  7454  		v.AddArg(x)
  7455  		return true
  7456  	}
  7457  	// match: (SRLVconst [rc] (MOVBUreg x))
  7458  	// cond: rc < 8
  7459  	// result: (BSTRPICKV [rc + 7<<6] x)
  7460  	for {
  7461  		rc := auxIntToInt64(v.AuxInt)
  7462  		if v_0.Op != OpLOONG64MOVBUreg {
  7463  			break
  7464  		}
  7465  		x := v_0.Args[0]
  7466  		if !(rc < 8) {
  7467  			break
  7468  		}
  7469  		v.reset(OpLOONG64BSTRPICKV)
  7470  		v.AuxInt = int64ToAuxInt(rc + 7<<6)
  7471  		v.AddArg(x)
  7472  		return true
  7473  	}
  7474  	// match: (SRLVconst [rc] (MOVWUreg y))
  7475  	// cond: rc >= 0 && rc <= 31
  7476  	// result: (SRLconst [int64(rc)] y)
  7477  	for {
  7478  		rc := auxIntToInt64(v.AuxInt)
  7479  		if v_0.Op != OpLOONG64MOVWUreg {
  7480  			break
  7481  		}
  7482  		y := v_0.Args[0]
  7483  		if !(rc >= 0 && rc <= 31) {
  7484  			break
  7485  		}
  7486  		v.reset(OpLOONG64SRLconst)
  7487  		v.AuxInt = int64ToAuxInt(int64(rc))
  7488  		v.AddArg(y)
  7489  		return true
  7490  	}
  7491  	// match: (SRLVconst [rc] (MOVWUreg x))
  7492  	// cond: rc >= 32
  7493  	// result: (MOVVconst [0])
  7494  	for {
  7495  		rc := auxIntToInt64(v.AuxInt)
  7496  		if v_0.Op != OpLOONG64MOVWUreg {
  7497  			break
  7498  		}
  7499  		if !(rc >= 32) {
  7500  			break
  7501  		}
  7502  		v.reset(OpLOONG64MOVVconst)
  7503  		v.AuxInt = int64ToAuxInt(0)
  7504  		return true
  7505  	}
  7506  	// match: (SRLVconst [rc] (MOVHUreg x))
  7507  	// cond: rc >= 16
  7508  	// result: (MOVVconst [0])
  7509  	for {
  7510  		rc := auxIntToInt64(v.AuxInt)
  7511  		if v_0.Op != OpLOONG64MOVHUreg {
  7512  			break
  7513  		}
  7514  		if !(rc >= 16) {
  7515  			break
  7516  		}
  7517  		v.reset(OpLOONG64MOVVconst)
  7518  		v.AuxInt = int64ToAuxInt(0)
  7519  		return true
  7520  	}
  7521  	// match: (SRLVconst [rc] (MOVBUreg x))
  7522  	// cond: rc >= 8
  7523  	// result: (MOVVconst [0])
  7524  	for {
  7525  		rc := auxIntToInt64(v.AuxInt)
  7526  		if v_0.Op != OpLOONG64MOVBUreg {
  7527  			break
  7528  		}
  7529  		if !(rc >= 8) {
  7530  			break
  7531  		}
  7532  		v.reset(OpLOONG64MOVVconst)
  7533  		v.AuxInt = int64ToAuxInt(0)
  7534  		return true
  7535  	}
  7536  	// match: (SRLVconst [c] (MOVVconst [d]))
  7537  	// result: (MOVVconst [int64(uint64(d)>>uint64(c))])
  7538  	for {
  7539  		c := auxIntToInt64(v.AuxInt)
  7540  		if v_0.Op != OpLOONG64MOVVconst {
  7541  			break
  7542  		}
  7543  		d := auxIntToInt64(v_0.AuxInt)
  7544  		v.reset(OpLOONG64MOVVconst)
  7545  		v.AuxInt = int64ToAuxInt(int64(uint64(d) >> uint64(c)))
  7546  		return true
  7547  	}
  7548  	return false
  7549  }
  7550  func rewriteValueLOONG64_OpLOONG64SUBD(v *Value) bool {
  7551  	v_1 := v.Args[1]
  7552  	v_0 := v.Args[0]
  7553  	// match: (SUBD (MULD x y) z)
  7554  	// cond: z.Block.Func.useFMA(v)
  7555  	// result: (FMSUBD x y z)
  7556  	for {
  7557  		if v_0.Op != OpLOONG64MULD {
  7558  			break
  7559  		}
  7560  		y := v_0.Args[1]
  7561  		x := v_0.Args[0]
  7562  		z := v_1
  7563  		if !(z.Block.Func.useFMA(v)) {
  7564  			break
  7565  		}
  7566  		v.reset(OpLOONG64FMSUBD)
  7567  		v.AddArg3(x, y, z)
  7568  		return true
  7569  	}
  7570  	// match: (SUBD z (MULD x y))
  7571  	// cond: z.Block.Func.useFMA(v)
  7572  	// result: (FNMSUBD x y z)
  7573  	for {
  7574  		z := v_0
  7575  		if v_1.Op != OpLOONG64MULD {
  7576  			break
  7577  		}
  7578  		y := v_1.Args[1]
  7579  		x := v_1.Args[0]
  7580  		if !(z.Block.Func.useFMA(v)) {
  7581  			break
  7582  		}
  7583  		v.reset(OpLOONG64FNMSUBD)
  7584  		v.AddArg3(x, y, z)
  7585  		return true
  7586  	}
  7587  	// match: (SUBD z (NEGD (MULD x y)))
  7588  	// cond: z.Block.Func.useFMA(v)
  7589  	// result: (FMADDD x y z)
  7590  	for {
  7591  		z := v_0
  7592  		if v_1.Op != OpLOONG64NEGD {
  7593  			break
  7594  		}
  7595  		v_1_0 := v_1.Args[0]
  7596  		if v_1_0.Op != OpLOONG64MULD {
  7597  			break
  7598  		}
  7599  		y := v_1_0.Args[1]
  7600  		x := v_1_0.Args[0]
  7601  		if !(z.Block.Func.useFMA(v)) {
  7602  			break
  7603  		}
  7604  		v.reset(OpLOONG64FMADDD)
  7605  		v.AddArg3(x, y, z)
  7606  		return true
  7607  	}
  7608  	// match: (SUBD (NEGD (MULD x y)) z)
  7609  	// cond: z.Block.Func.useFMA(v)
  7610  	// result: (FNMADDD x y z)
  7611  	for {
  7612  		if v_0.Op != OpLOONG64NEGD {
  7613  			break
  7614  		}
  7615  		v_0_0 := v_0.Args[0]
  7616  		if v_0_0.Op != OpLOONG64MULD {
  7617  			break
  7618  		}
  7619  		y := v_0_0.Args[1]
  7620  		x := v_0_0.Args[0]
  7621  		z := v_1
  7622  		if !(z.Block.Func.useFMA(v)) {
  7623  			break
  7624  		}
  7625  		v.reset(OpLOONG64FNMADDD)
  7626  		v.AddArg3(x, y, z)
  7627  		return true
  7628  	}
  7629  	return false
  7630  }
  7631  func rewriteValueLOONG64_OpLOONG64SUBF(v *Value) bool {
  7632  	v_1 := v.Args[1]
  7633  	v_0 := v.Args[0]
  7634  	// match: (SUBF (MULF x y) z)
  7635  	// cond: z.Block.Func.useFMA(v)
  7636  	// result: (FMSUBF x y z)
  7637  	for {
  7638  		if v_0.Op != OpLOONG64MULF {
  7639  			break
  7640  		}
  7641  		y := v_0.Args[1]
  7642  		x := v_0.Args[0]
  7643  		z := v_1
  7644  		if !(z.Block.Func.useFMA(v)) {
  7645  			break
  7646  		}
  7647  		v.reset(OpLOONG64FMSUBF)
  7648  		v.AddArg3(x, y, z)
  7649  		return true
  7650  	}
  7651  	// match: (SUBF z (MULF x y))
  7652  	// cond: z.Block.Func.useFMA(v)
  7653  	// result: (FNMSUBF x y z)
  7654  	for {
  7655  		z := v_0
  7656  		if v_1.Op != OpLOONG64MULF {
  7657  			break
  7658  		}
  7659  		y := v_1.Args[1]
  7660  		x := v_1.Args[0]
  7661  		if !(z.Block.Func.useFMA(v)) {
  7662  			break
  7663  		}
  7664  		v.reset(OpLOONG64FNMSUBF)
  7665  		v.AddArg3(x, y, z)
  7666  		return true
  7667  	}
  7668  	// match: (SUBF z (NEGF (MULF x y)))
  7669  	// cond: z.Block.Func.useFMA(v)
  7670  	// result: (FMADDF x y z)
  7671  	for {
  7672  		z := v_0
  7673  		if v_1.Op != OpLOONG64NEGF {
  7674  			break
  7675  		}
  7676  		v_1_0 := v_1.Args[0]
  7677  		if v_1_0.Op != OpLOONG64MULF {
  7678  			break
  7679  		}
  7680  		y := v_1_0.Args[1]
  7681  		x := v_1_0.Args[0]
  7682  		if !(z.Block.Func.useFMA(v)) {
  7683  			break
  7684  		}
  7685  		v.reset(OpLOONG64FMADDF)
  7686  		v.AddArg3(x, y, z)
  7687  		return true
  7688  	}
  7689  	// match: (SUBF (NEGF (MULF x y)) z)
  7690  	// cond: z.Block.Func.useFMA(v)
  7691  	// result: (FNMADDF x y z)
  7692  	for {
  7693  		if v_0.Op != OpLOONG64NEGF {
  7694  			break
  7695  		}
  7696  		v_0_0 := v_0.Args[0]
  7697  		if v_0_0.Op != OpLOONG64MULF {
  7698  			break
  7699  		}
  7700  		y := v_0_0.Args[1]
  7701  		x := v_0_0.Args[0]
  7702  		z := v_1
  7703  		if !(z.Block.Func.useFMA(v)) {
  7704  			break
  7705  		}
  7706  		v.reset(OpLOONG64FNMADDF)
  7707  		v.AddArg3(x, y, z)
  7708  		return true
  7709  	}
  7710  	return false
  7711  }
  7712  func rewriteValueLOONG64_OpLOONG64SUBV(v *Value) bool {
  7713  	v_1 := v.Args[1]
  7714  	v_0 := v.Args[0]
  7715  	// match: (SUBV x (MOVVconst [c]))
  7716  	// cond: is32Bit(c)
  7717  	// result: (SUBVconst [c] x)
  7718  	for {
  7719  		x := v_0
  7720  		if v_1.Op != OpLOONG64MOVVconst {
  7721  			break
  7722  		}
  7723  		c := auxIntToInt64(v_1.AuxInt)
  7724  		if !(is32Bit(c)) {
  7725  			break
  7726  		}
  7727  		v.reset(OpLOONG64SUBVconst)
  7728  		v.AuxInt = int64ToAuxInt(c)
  7729  		v.AddArg(x)
  7730  		return true
  7731  	}
  7732  	// match: (SUBV x (NEGV y))
  7733  	// result: (ADDV x y)
  7734  	for {
  7735  		x := v_0
  7736  		if v_1.Op != OpLOONG64NEGV {
  7737  			break
  7738  		}
  7739  		y := v_1.Args[0]
  7740  		v.reset(OpLOONG64ADDV)
  7741  		v.AddArg2(x, y)
  7742  		return true
  7743  	}
  7744  	// match: (SUBV x x)
  7745  	// result: (MOVVconst [0])
  7746  	for {
  7747  		x := v_0
  7748  		if x != v_1 {
  7749  			break
  7750  		}
  7751  		v.reset(OpLOONG64MOVVconst)
  7752  		v.AuxInt = int64ToAuxInt(0)
  7753  		return true
  7754  	}
  7755  	// match: (SUBV (MOVVconst [0]) x)
  7756  	// result: (NEGV x)
  7757  	for {
  7758  		if v_0.Op != OpLOONG64MOVVconst || auxIntToInt64(v_0.AuxInt) != 0 {
  7759  			break
  7760  		}
  7761  		x := v_1
  7762  		v.reset(OpLOONG64NEGV)
  7763  		v.AddArg(x)
  7764  		return true
  7765  	}
  7766  	// match: (SUBV (MOVVconst [c]) (NEGV (SUBVconst [d] x)))
  7767  	// result: (ADDVconst [c-d] x)
  7768  	for {
  7769  		if v_0.Op != OpLOONG64MOVVconst {
  7770  			break
  7771  		}
  7772  		c := auxIntToInt64(v_0.AuxInt)
  7773  		if v_1.Op != OpLOONG64NEGV {
  7774  			break
  7775  		}
  7776  		v_1_0 := v_1.Args[0]
  7777  		if v_1_0.Op != OpLOONG64SUBVconst {
  7778  			break
  7779  		}
  7780  		d := auxIntToInt64(v_1_0.AuxInt)
  7781  		x := v_1_0.Args[0]
  7782  		v.reset(OpLOONG64ADDVconst)
  7783  		v.AuxInt = int64ToAuxInt(c - d)
  7784  		v.AddArg(x)
  7785  		return true
  7786  	}
  7787  	return false
  7788  }
  7789  func rewriteValueLOONG64_OpLOONG64SUBVconst(v *Value) bool {
  7790  	v_0 := v.Args[0]
  7791  	// match: (SUBVconst [0] x)
  7792  	// result: x
  7793  	for {
  7794  		if auxIntToInt64(v.AuxInt) != 0 {
  7795  			break
  7796  		}
  7797  		x := v_0
  7798  		v.copyOf(x)
  7799  		return true
  7800  	}
  7801  	// match: (SUBVconst [c] (MOVVconst [d]))
  7802  	// result: (MOVVconst [d-c])
  7803  	for {
  7804  		c := auxIntToInt64(v.AuxInt)
  7805  		if v_0.Op != OpLOONG64MOVVconst {
  7806  			break
  7807  		}
  7808  		d := auxIntToInt64(v_0.AuxInt)
  7809  		v.reset(OpLOONG64MOVVconst)
  7810  		v.AuxInt = int64ToAuxInt(d - c)
  7811  		return true
  7812  	}
  7813  	// match: (SUBVconst [c] (SUBVconst [d] x))
  7814  	// cond: is32Bit(-c-d)
  7815  	// result: (ADDVconst [-c-d] x)
  7816  	for {
  7817  		c := auxIntToInt64(v.AuxInt)
  7818  		if v_0.Op != OpLOONG64SUBVconst {
  7819  			break
  7820  		}
  7821  		d := auxIntToInt64(v_0.AuxInt)
  7822  		x := v_0.Args[0]
  7823  		if !(is32Bit(-c - d)) {
  7824  			break
  7825  		}
  7826  		v.reset(OpLOONG64ADDVconst)
  7827  		v.AuxInt = int64ToAuxInt(-c - d)
  7828  		v.AddArg(x)
  7829  		return true
  7830  	}
  7831  	// match: (SUBVconst [c] (ADDVconst [d] x))
  7832  	// cond: is32Bit(-c+d)
  7833  	// result: (ADDVconst [-c+d] x)
  7834  	for {
  7835  		c := auxIntToInt64(v.AuxInt)
  7836  		if v_0.Op != OpLOONG64ADDVconst {
  7837  			break
  7838  		}
  7839  		d := auxIntToInt64(v_0.AuxInt)
  7840  		x := v_0.Args[0]
  7841  		if !(is32Bit(-c + d)) {
  7842  			break
  7843  		}
  7844  		v.reset(OpLOONG64ADDVconst)
  7845  		v.AuxInt = int64ToAuxInt(-c + d)
  7846  		v.AddArg(x)
  7847  		return true
  7848  	}
  7849  	return false
  7850  }
  7851  func rewriteValueLOONG64_OpLOONG64XOR(v *Value) bool {
  7852  	v_1 := v.Args[1]
  7853  	v_0 := v.Args[0]
  7854  	b := v.Block
  7855  	typ := &b.Func.Config.Types
  7856  	// match: (XOR <typ.UInt16> (SRLVconst [8] <typ.UInt16> x) (SLLVconst [8] <typ.UInt16> x))
  7857  	// result: (REVB2H x)
  7858  	for {
  7859  		if v.Type != typ.UInt16 {
  7860  			break
  7861  		}
  7862  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
  7863  			if v_0.Op != OpLOONG64SRLVconst || v_0.Type != typ.UInt16 || auxIntToInt64(v_0.AuxInt) != 8 {
  7864  				continue
  7865  			}
  7866  			x := v_0.Args[0]
  7867  			if v_1.Op != OpLOONG64SLLVconst || v_1.Type != typ.UInt16 || auxIntToInt64(v_1.AuxInt) != 8 || x != v_1.Args[0] {
  7868  				continue
  7869  			}
  7870  			v.reset(OpLOONG64REVB2H)
  7871  			v.AddArg(x)
  7872  			return true
  7873  		}
  7874  		break
  7875  	}
  7876  	// match: (XOR (SRLconst [8] (ANDconst [c1] x)) (SLLconst [8] (ANDconst [c2] x)))
  7877  	// cond: uint32(c1) == 0xff00ff00 && uint32(c2) == 0x00ff00ff
  7878  	// result: (REVB2H x)
  7879  	for {
  7880  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
  7881  			if v_0.Op != OpLOONG64SRLconst || auxIntToInt64(v_0.AuxInt) != 8 {
  7882  				continue
  7883  			}
  7884  			v_0_0 := v_0.Args[0]
  7885  			if v_0_0.Op != OpLOONG64ANDconst {
  7886  				continue
  7887  			}
  7888  			c1 := auxIntToInt64(v_0_0.AuxInt)
  7889  			x := v_0_0.Args[0]
  7890  			if v_1.Op != OpLOONG64SLLconst || auxIntToInt64(v_1.AuxInt) != 8 {
  7891  				continue
  7892  			}
  7893  			v_1_0 := v_1.Args[0]
  7894  			if v_1_0.Op != OpLOONG64ANDconst {
  7895  				continue
  7896  			}
  7897  			c2 := auxIntToInt64(v_1_0.AuxInt)
  7898  			if x != v_1_0.Args[0] || !(uint32(c1) == 0xff00ff00 && uint32(c2) == 0x00ff00ff) {
  7899  				continue
  7900  			}
  7901  			v.reset(OpLOONG64REVB2H)
  7902  			v.AddArg(x)
  7903  			return true
  7904  		}
  7905  		break
  7906  	}
  7907  	// match: (XOR (SRLVconst [8] (AND (MOVVconst [c1]) x)) (SLLVconst [8] (AND (MOVVconst [c2]) x)))
  7908  	// cond: uint64(c1) == 0xff00ff00ff00ff00 && uint64(c2) == 0x00ff00ff00ff00ff
  7909  	// result: (REVB4H x)
  7910  	for {
  7911  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
  7912  			if v_0.Op != OpLOONG64SRLVconst || auxIntToInt64(v_0.AuxInt) != 8 {
  7913  				continue
  7914  			}
  7915  			v_0_0 := v_0.Args[0]
  7916  			if v_0_0.Op != OpLOONG64AND {
  7917  				continue
  7918  			}
  7919  			_ = v_0_0.Args[1]
  7920  			v_0_0_0 := v_0_0.Args[0]
  7921  			v_0_0_1 := v_0_0.Args[1]
  7922  			for _i1 := 0; _i1 <= 1; _i1, v_0_0_0, v_0_0_1 = _i1+1, v_0_0_1, v_0_0_0 {
  7923  				if v_0_0_0.Op != OpLOONG64MOVVconst {
  7924  					continue
  7925  				}
  7926  				c1 := auxIntToInt64(v_0_0_0.AuxInt)
  7927  				x := v_0_0_1
  7928  				if v_1.Op != OpLOONG64SLLVconst || auxIntToInt64(v_1.AuxInt) != 8 {
  7929  					continue
  7930  				}
  7931  				v_1_0 := v_1.Args[0]
  7932  				if v_1_0.Op != OpLOONG64AND {
  7933  					continue
  7934  				}
  7935  				_ = v_1_0.Args[1]
  7936  				v_1_0_0 := v_1_0.Args[0]
  7937  				v_1_0_1 := v_1_0.Args[1]
  7938  				for _i2 := 0; _i2 <= 1; _i2, v_1_0_0, v_1_0_1 = _i2+1, v_1_0_1, v_1_0_0 {
  7939  					if v_1_0_0.Op != OpLOONG64MOVVconst {
  7940  						continue
  7941  					}
  7942  					c2 := auxIntToInt64(v_1_0_0.AuxInt)
  7943  					if x != v_1_0_1 || !(uint64(c1) == 0xff00ff00ff00ff00 && uint64(c2) == 0x00ff00ff00ff00ff) {
  7944  						continue
  7945  					}
  7946  					v.reset(OpLOONG64REVB4H)
  7947  					v.AddArg(x)
  7948  					return true
  7949  				}
  7950  			}
  7951  		}
  7952  		break
  7953  	}
  7954  	// match: (XOR (SRLVconst [8] (AND (MOVVconst [c1]) x)) (SLLVconst [8] (ANDconst [c2] x)))
  7955  	// cond: uint64(c1) == 0xff00ff00 && uint64(c2) == 0x00ff00ff
  7956  	// result: (REVB4H (ANDconst <x.Type> [0xffffffff] x))
  7957  	for {
  7958  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
  7959  			if v_0.Op != OpLOONG64SRLVconst || auxIntToInt64(v_0.AuxInt) != 8 {
  7960  				continue
  7961  			}
  7962  			v_0_0 := v_0.Args[0]
  7963  			if v_0_0.Op != OpLOONG64AND {
  7964  				continue
  7965  			}
  7966  			_ = v_0_0.Args[1]
  7967  			v_0_0_0 := v_0_0.Args[0]
  7968  			v_0_0_1 := v_0_0.Args[1]
  7969  			for _i1 := 0; _i1 <= 1; _i1, v_0_0_0, v_0_0_1 = _i1+1, v_0_0_1, v_0_0_0 {
  7970  				if v_0_0_0.Op != OpLOONG64MOVVconst {
  7971  					continue
  7972  				}
  7973  				c1 := auxIntToInt64(v_0_0_0.AuxInt)
  7974  				x := v_0_0_1
  7975  				if v_1.Op != OpLOONG64SLLVconst || auxIntToInt64(v_1.AuxInt) != 8 {
  7976  					continue
  7977  				}
  7978  				v_1_0 := v_1.Args[0]
  7979  				if v_1_0.Op != OpLOONG64ANDconst {
  7980  					continue
  7981  				}
  7982  				c2 := auxIntToInt64(v_1_0.AuxInt)
  7983  				if x != v_1_0.Args[0] || !(uint64(c1) == 0xff00ff00 && uint64(c2) == 0x00ff00ff) {
  7984  					continue
  7985  				}
  7986  				v.reset(OpLOONG64REVB4H)
  7987  				v0 := b.NewValue0(v.Pos, OpLOONG64ANDconst, x.Type)
  7988  				v0.AuxInt = int64ToAuxInt(0xffffffff)
  7989  				v0.AddArg(x)
  7990  				v.AddArg(v0)
  7991  				return true
  7992  			}
  7993  		}
  7994  		break
  7995  	}
  7996  	// match: (XOR x (MOVVconst [c]))
  7997  	// cond: is32Bit(c)
  7998  	// result: (XORconst [c] x)
  7999  	for {
  8000  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
  8001  			x := v_0
  8002  			if v_1.Op != OpLOONG64MOVVconst {
  8003  				continue
  8004  			}
  8005  			c := auxIntToInt64(v_1.AuxInt)
  8006  			if !(is32Bit(c)) {
  8007  				continue
  8008  			}
  8009  			v.reset(OpLOONG64XORconst)
  8010  			v.AuxInt = int64ToAuxInt(c)
  8011  			v.AddArg(x)
  8012  			return true
  8013  		}
  8014  		break
  8015  	}
  8016  	// match: (XOR x x)
  8017  	// result: (MOVVconst [0])
  8018  	for {
  8019  		x := v_0
  8020  		if x != v_1 {
  8021  			break
  8022  		}
  8023  		v.reset(OpLOONG64MOVVconst)
  8024  		v.AuxInt = int64ToAuxInt(0)
  8025  		return true
  8026  	}
  8027  	return false
  8028  }
  8029  func rewriteValueLOONG64_OpLOONG64XORconst(v *Value) bool {
  8030  	v_0 := v.Args[0]
  8031  	// match: (XORconst [0] x)
  8032  	// result: x
  8033  	for {
  8034  		if auxIntToInt64(v.AuxInt) != 0 {
  8035  			break
  8036  		}
  8037  		x := v_0
  8038  		v.copyOf(x)
  8039  		return true
  8040  	}
  8041  	// match: (XORconst [-1] x)
  8042  	// result: (NORconst [0] x)
  8043  	for {
  8044  		if auxIntToInt64(v.AuxInt) != -1 {
  8045  			break
  8046  		}
  8047  		x := v_0
  8048  		v.reset(OpLOONG64NORconst)
  8049  		v.AuxInt = int64ToAuxInt(0)
  8050  		v.AddArg(x)
  8051  		return true
  8052  	}
  8053  	// match: (XORconst [c] (MOVVconst [d]))
  8054  	// result: (MOVVconst [c^d])
  8055  	for {
  8056  		c := auxIntToInt64(v.AuxInt)
  8057  		if v_0.Op != OpLOONG64MOVVconst {
  8058  			break
  8059  		}
  8060  		d := auxIntToInt64(v_0.AuxInt)
  8061  		v.reset(OpLOONG64MOVVconst)
  8062  		v.AuxInt = int64ToAuxInt(c ^ d)
  8063  		return true
  8064  	}
  8065  	// match: (XORconst [c] (XORconst [d] x))
  8066  	// cond: is32Bit(c^d)
  8067  	// result: (XORconst [c^d] x)
  8068  	for {
  8069  		c := auxIntToInt64(v.AuxInt)
  8070  		if v_0.Op != OpLOONG64XORconst {
  8071  			break
  8072  		}
  8073  		d := auxIntToInt64(v_0.AuxInt)
  8074  		x := v_0.Args[0]
  8075  		if !(is32Bit(c ^ d)) {
  8076  			break
  8077  		}
  8078  		v.reset(OpLOONG64XORconst)
  8079  		v.AuxInt = int64ToAuxInt(c ^ d)
  8080  		v.AddArg(x)
  8081  		return true
  8082  	}
  8083  	return false
  8084  }
  8085  func rewriteValueLOONG64_OpLeq16(v *Value) bool {
  8086  	v_1 := v.Args[1]
  8087  	v_0 := v.Args[0]
  8088  	b := v.Block
  8089  	typ := &b.Func.Config.Types
  8090  	// match: (Leq16 x y)
  8091  	// result: (XOR (MOVVconst [1]) (SGT (SignExt16to64 x) (SignExt16to64 y)))
  8092  	for {
  8093  		x := v_0
  8094  		y := v_1
  8095  		v.reset(OpLOONG64XOR)
  8096  		v0 := b.NewValue0(v.Pos, OpLOONG64MOVVconst, typ.UInt64)
  8097  		v0.AuxInt = int64ToAuxInt(1)
  8098  		v1 := b.NewValue0(v.Pos, OpLOONG64SGT, typ.Bool)
  8099  		v2 := b.NewValue0(v.Pos, OpSignExt16to64, typ.Int64)
  8100  		v2.AddArg(x)
  8101  		v3 := b.NewValue0(v.Pos, OpSignExt16to64, typ.Int64)
  8102  		v3.AddArg(y)
  8103  		v1.AddArg2(v2, v3)
  8104  		v.AddArg2(v0, v1)
  8105  		return true
  8106  	}
  8107  }
  8108  func rewriteValueLOONG64_OpLeq16U(v *Value) bool {
  8109  	v_1 := v.Args[1]
  8110  	v_0 := v.Args[0]
  8111  	b := v.Block
  8112  	typ := &b.Func.Config.Types
  8113  	// match: (Leq16U x y)
  8114  	// result: (XOR (MOVVconst [1]) (SGTU (ZeroExt16to64 x) (ZeroExt16to64 y)))
  8115  	for {
  8116  		x := v_0
  8117  		y := v_1
  8118  		v.reset(OpLOONG64XOR)
  8119  		v0 := b.NewValue0(v.Pos, OpLOONG64MOVVconst, typ.UInt64)
  8120  		v0.AuxInt = int64ToAuxInt(1)
  8121  		v1 := b.NewValue0(v.Pos, OpLOONG64SGTU, typ.Bool)
  8122  		v2 := b.NewValue0(v.Pos, OpZeroExt16to64, typ.UInt64)
  8123  		v2.AddArg(x)
  8124  		v3 := b.NewValue0(v.Pos, OpZeroExt16to64, typ.UInt64)
  8125  		v3.AddArg(y)
  8126  		v1.AddArg2(v2, v3)
  8127  		v.AddArg2(v0, v1)
  8128  		return true
  8129  	}
  8130  }
  8131  func rewriteValueLOONG64_OpLeq32(v *Value) bool {
  8132  	v_1 := v.Args[1]
  8133  	v_0 := v.Args[0]
  8134  	b := v.Block
  8135  	typ := &b.Func.Config.Types
  8136  	// match: (Leq32 x y)
  8137  	// result: (XOR (MOVVconst [1]) (SGT (SignExt32to64 x) (SignExt32to64 y)))
  8138  	for {
  8139  		x := v_0
  8140  		y := v_1
  8141  		v.reset(OpLOONG64XOR)
  8142  		v0 := b.NewValue0(v.Pos, OpLOONG64MOVVconst, typ.UInt64)
  8143  		v0.AuxInt = int64ToAuxInt(1)
  8144  		v1 := b.NewValue0(v.Pos, OpLOONG64SGT, typ.Bool)
  8145  		v2 := b.NewValue0(v.Pos, OpSignExt32to64, typ.Int64)
  8146  		v2.AddArg(x)
  8147  		v3 := b.NewValue0(v.Pos, OpSignExt32to64, typ.Int64)
  8148  		v3.AddArg(y)
  8149  		v1.AddArg2(v2, v3)
  8150  		v.AddArg2(v0, v1)
  8151  		return true
  8152  	}
  8153  }
  8154  func rewriteValueLOONG64_OpLeq32F(v *Value) bool {
  8155  	v_1 := v.Args[1]
  8156  	v_0 := v.Args[0]
  8157  	b := v.Block
  8158  	// match: (Leq32F x y)
  8159  	// result: (FPFlagTrue (CMPGEF y x))
  8160  	for {
  8161  		x := v_0
  8162  		y := v_1
  8163  		v.reset(OpLOONG64FPFlagTrue)
  8164  		v0 := b.NewValue0(v.Pos, OpLOONG64CMPGEF, types.TypeFlags)
  8165  		v0.AddArg2(y, x)
  8166  		v.AddArg(v0)
  8167  		return true
  8168  	}
  8169  }
  8170  func rewriteValueLOONG64_OpLeq32U(v *Value) bool {
  8171  	v_1 := v.Args[1]
  8172  	v_0 := v.Args[0]
  8173  	b := v.Block
  8174  	typ := &b.Func.Config.Types
  8175  	// match: (Leq32U x y)
  8176  	// result: (XOR (MOVVconst [1]) (SGTU (ZeroExt32to64 x) (ZeroExt32to64 y)))
  8177  	for {
  8178  		x := v_0
  8179  		y := v_1
  8180  		v.reset(OpLOONG64XOR)
  8181  		v0 := b.NewValue0(v.Pos, OpLOONG64MOVVconst, typ.UInt64)
  8182  		v0.AuxInt = int64ToAuxInt(1)
  8183  		v1 := b.NewValue0(v.Pos, OpLOONG64SGTU, typ.Bool)
  8184  		v2 := b.NewValue0(v.Pos, OpZeroExt32to64, typ.UInt64)
  8185  		v2.AddArg(x)
  8186  		v3 := b.NewValue0(v.Pos, OpZeroExt32to64, typ.UInt64)
  8187  		v3.AddArg(y)
  8188  		v1.AddArg2(v2, v3)
  8189  		v.AddArg2(v0, v1)
  8190  		return true
  8191  	}
  8192  }
  8193  func rewriteValueLOONG64_OpLeq64(v *Value) bool {
  8194  	v_1 := v.Args[1]
  8195  	v_0 := v.Args[0]
  8196  	b := v.Block
  8197  	typ := &b.Func.Config.Types
  8198  	// match: (Leq64 x y)
  8199  	// result: (XOR (MOVVconst [1]) (SGT x y))
  8200  	for {
  8201  		x := v_0
  8202  		y := v_1
  8203  		v.reset(OpLOONG64XOR)
  8204  		v0 := b.NewValue0(v.Pos, OpLOONG64MOVVconst, typ.UInt64)
  8205  		v0.AuxInt = int64ToAuxInt(1)
  8206  		v1 := b.NewValue0(v.Pos, OpLOONG64SGT, typ.Bool)
  8207  		v1.AddArg2(x, y)
  8208  		v.AddArg2(v0, v1)
  8209  		return true
  8210  	}
  8211  }
  8212  func rewriteValueLOONG64_OpLeq64F(v *Value) bool {
  8213  	v_1 := v.Args[1]
  8214  	v_0 := v.Args[0]
  8215  	b := v.Block
  8216  	// match: (Leq64F x y)
  8217  	// result: (FPFlagTrue (CMPGED y x))
  8218  	for {
  8219  		x := v_0
  8220  		y := v_1
  8221  		v.reset(OpLOONG64FPFlagTrue)
  8222  		v0 := b.NewValue0(v.Pos, OpLOONG64CMPGED, types.TypeFlags)
  8223  		v0.AddArg2(y, x)
  8224  		v.AddArg(v0)
  8225  		return true
  8226  	}
  8227  }
  8228  func rewriteValueLOONG64_OpLeq64U(v *Value) bool {
  8229  	v_1 := v.Args[1]
  8230  	v_0 := v.Args[0]
  8231  	b := v.Block
  8232  	typ := &b.Func.Config.Types
  8233  	// match: (Leq64U x y)
  8234  	// result: (XOR (MOVVconst [1]) (SGTU x y))
  8235  	for {
  8236  		x := v_0
  8237  		y := v_1
  8238  		v.reset(OpLOONG64XOR)
  8239  		v0 := b.NewValue0(v.Pos, OpLOONG64MOVVconst, typ.UInt64)
  8240  		v0.AuxInt = int64ToAuxInt(1)
  8241  		v1 := b.NewValue0(v.Pos, OpLOONG64SGTU, typ.Bool)
  8242  		v1.AddArg2(x, y)
  8243  		v.AddArg2(v0, v1)
  8244  		return true
  8245  	}
  8246  }
  8247  func rewriteValueLOONG64_OpLeq8(v *Value) bool {
  8248  	v_1 := v.Args[1]
  8249  	v_0 := v.Args[0]
  8250  	b := v.Block
  8251  	typ := &b.Func.Config.Types
  8252  	// match: (Leq8 x y)
  8253  	// result: (XOR (MOVVconst [1]) (SGT (SignExt8to64 x) (SignExt8to64 y)))
  8254  	for {
  8255  		x := v_0
  8256  		y := v_1
  8257  		v.reset(OpLOONG64XOR)
  8258  		v0 := b.NewValue0(v.Pos, OpLOONG64MOVVconst, typ.UInt64)
  8259  		v0.AuxInt = int64ToAuxInt(1)
  8260  		v1 := b.NewValue0(v.Pos, OpLOONG64SGT, typ.Bool)
  8261  		v2 := b.NewValue0(v.Pos, OpSignExt8to64, typ.Int64)
  8262  		v2.AddArg(x)
  8263  		v3 := b.NewValue0(v.Pos, OpSignExt8to64, typ.Int64)
  8264  		v3.AddArg(y)
  8265  		v1.AddArg2(v2, v3)
  8266  		v.AddArg2(v0, v1)
  8267  		return true
  8268  	}
  8269  }
  8270  func rewriteValueLOONG64_OpLeq8U(v *Value) bool {
  8271  	v_1 := v.Args[1]
  8272  	v_0 := v.Args[0]
  8273  	b := v.Block
  8274  	typ := &b.Func.Config.Types
  8275  	// match: (Leq8U x y)
  8276  	// result: (XOR (MOVVconst [1]) (SGTU (ZeroExt8to64 x) (ZeroExt8to64 y)))
  8277  	for {
  8278  		x := v_0
  8279  		y := v_1
  8280  		v.reset(OpLOONG64XOR)
  8281  		v0 := b.NewValue0(v.Pos, OpLOONG64MOVVconst, typ.UInt64)
  8282  		v0.AuxInt = int64ToAuxInt(1)
  8283  		v1 := b.NewValue0(v.Pos, OpLOONG64SGTU, typ.Bool)
  8284  		v2 := b.NewValue0(v.Pos, OpZeroExt8to64, typ.UInt64)
  8285  		v2.AddArg(x)
  8286  		v3 := b.NewValue0(v.Pos, OpZeroExt8to64, typ.UInt64)
  8287  		v3.AddArg(y)
  8288  		v1.AddArg2(v2, v3)
  8289  		v.AddArg2(v0, v1)
  8290  		return true
  8291  	}
  8292  }
  8293  func rewriteValueLOONG64_OpLess16(v *Value) bool {
  8294  	v_1 := v.Args[1]
  8295  	v_0 := v.Args[0]
  8296  	b := v.Block
  8297  	typ := &b.Func.Config.Types
  8298  	// match: (Less16 x y)
  8299  	// result: (SGT (SignExt16to64 y) (SignExt16to64 x))
  8300  	for {
  8301  		x := v_0
  8302  		y := v_1
  8303  		v.reset(OpLOONG64SGT)
  8304  		v0 := b.NewValue0(v.Pos, OpSignExt16to64, typ.Int64)
  8305  		v0.AddArg(y)
  8306  		v1 := b.NewValue0(v.Pos, OpSignExt16to64, typ.Int64)
  8307  		v1.AddArg(x)
  8308  		v.AddArg2(v0, v1)
  8309  		return true
  8310  	}
  8311  }
  8312  func rewriteValueLOONG64_OpLess16U(v *Value) bool {
  8313  	v_1 := v.Args[1]
  8314  	v_0 := v.Args[0]
  8315  	b := v.Block
  8316  	typ := &b.Func.Config.Types
  8317  	// match: (Less16U x y)
  8318  	// result: (SGTU (ZeroExt16to64 y) (ZeroExt16to64 x))
  8319  	for {
  8320  		x := v_0
  8321  		y := v_1
  8322  		v.reset(OpLOONG64SGTU)
  8323  		v0 := b.NewValue0(v.Pos, OpZeroExt16to64, typ.UInt64)
  8324  		v0.AddArg(y)
  8325  		v1 := b.NewValue0(v.Pos, OpZeroExt16to64, typ.UInt64)
  8326  		v1.AddArg(x)
  8327  		v.AddArg2(v0, v1)
  8328  		return true
  8329  	}
  8330  }
  8331  func rewriteValueLOONG64_OpLess32(v *Value) bool {
  8332  	v_1 := v.Args[1]
  8333  	v_0 := v.Args[0]
  8334  	b := v.Block
  8335  	typ := &b.Func.Config.Types
  8336  	// match: (Less32 x y)
  8337  	// result: (SGT (SignExt32to64 y) (SignExt32to64 x))
  8338  	for {
  8339  		x := v_0
  8340  		y := v_1
  8341  		v.reset(OpLOONG64SGT)
  8342  		v0 := b.NewValue0(v.Pos, OpSignExt32to64, typ.Int64)
  8343  		v0.AddArg(y)
  8344  		v1 := b.NewValue0(v.Pos, OpSignExt32to64, typ.Int64)
  8345  		v1.AddArg(x)
  8346  		v.AddArg2(v0, v1)
  8347  		return true
  8348  	}
  8349  }
  8350  func rewriteValueLOONG64_OpLess32F(v *Value) bool {
  8351  	v_1 := v.Args[1]
  8352  	v_0 := v.Args[0]
  8353  	b := v.Block
  8354  	// match: (Less32F x y)
  8355  	// result: (FPFlagTrue (CMPGTF y x))
  8356  	for {
  8357  		x := v_0
  8358  		y := v_1
  8359  		v.reset(OpLOONG64FPFlagTrue)
  8360  		v0 := b.NewValue0(v.Pos, OpLOONG64CMPGTF, types.TypeFlags)
  8361  		v0.AddArg2(y, x)
  8362  		v.AddArg(v0)
  8363  		return true
  8364  	}
  8365  }
  8366  func rewriteValueLOONG64_OpLess32U(v *Value) bool {
  8367  	v_1 := v.Args[1]
  8368  	v_0 := v.Args[0]
  8369  	b := v.Block
  8370  	typ := &b.Func.Config.Types
  8371  	// match: (Less32U x y)
  8372  	// result: (SGTU (ZeroExt32to64 y) (ZeroExt32to64 x))
  8373  	for {
  8374  		x := v_0
  8375  		y := v_1
  8376  		v.reset(OpLOONG64SGTU)
  8377  		v0 := b.NewValue0(v.Pos, OpZeroExt32to64, typ.UInt64)
  8378  		v0.AddArg(y)
  8379  		v1 := b.NewValue0(v.Pos, OpZeroExt32to64, typ.UInt64)
  8380  		v1.AddArg(x)
  8381  		v.AddArg2(v0, v1)
  8382  		return true
  8383  	}
  8384  }
  8385  func rewriteValueLOONG64_OpLess64(v *Value) bool {
  8386  	v_1 := v.Args[1]
  8387  	v_0 := v.Args[0]
  8388  	// match: (Less64 x y)
  8389  	// result: (SGT y x)
  8390  	for {
  8391  		x := v_0
  8392  		y := v_1
  8393  		v.reset(OpLOONG64SGT)
  8394  		v.AddArg2(y, x)
  8395  		return true
  8396  	}
  8397  }
  8398  func rewriteValueLOONG64_OpLess64F(v *Value) bool {
  8399  	v_1 := v.Args[1]
  8400  	v_0 := v.Args[0]
  8401  	b := v.Block
  8402  	// match: (Less64F x y)
  8403  	// result: (FPFlagTrue (CMPGTD y x))
  8404  	for {
  8405  		x := v_0
  8406  		y := v_1
  8407  		v.reset(OpLOONG64FPFlagTrue)
  8408  		v0 := b.NewValue0(v.Pos, OpLOONG64CMPGTD, types.TypeFlags)
  8409  		v0.AddArg2(y, x)
  8410  		v.AddArg(v0)
  8411  		return true
  8412  	}
  8413  }
  8414  func rewriteValueLOONG64_OpLess64U(v *Value) bool {
  8415  	v_1 := v.Args[1]
  8416  	v_0 := v.Args[0]
  8417  	// match: (Less64U x y)
  8418  	// result: (SGTU y x)
  8419  	for {
  8420  		x := v_0
  8421  		y := v_1
  8422  		v.reset(OpLOONG64SGTU)
  8423  		v.AddArg2(y, x)
  8424  		return true
  8425  	}
  8426  }
  8427  func rewriteValueLOONG64_OpLess8(v *Value) bool {
  8428  	v_1 := v.Args[1]
  8429  	v_0 := v.Args[0]
  8430  	b := v.Block
  8431  	typ := &b.Func.Config.Types
  8432  	// match: (Less8 x y)
  8433  	// result: (SGT (SignExt8to64 y) (SignExt8to64 x))
  8434  	for {
  8435  		x := v_0
  8436  		y := v_1
  8437  		v.reset(OpLOONG64SGT)
  8438  		v0 := b.NewValue0(v.Pos, OpSignExt8to64, typ.Int64)
  8439  		v0.AddArg(y)
  8440  		v1 := b.NewValue0(v.Pos, OpSignExt8to64, typ.Int64)
  8441  		v1.AddArg(x)
  8442  		v.AddArg2(v0, v1)
  8443  		return true
  8444  	}
  8445  }
  8446  func rewriteValueLOONG64_OpLess8U(v *Value) bool {
  8447  	v_1 := v.Args[1]
  8448  	v_0 := v.Args[0]
  8449  	b := v.Block
  8450  	typ := &b.Func.Config.Types
  8451  	// match: (Less8U x y)
  8452  	// result: (SGTU (ZeroExt8to64 y) (ZeroExt8to64 x))
  8453  	for {
  8454  		x := v_0
  8455  		y := v_1
  8456  		v.reset(OpLOONG64SGTU)
  8457  		v0 := b.NewValue0(v.Pos, OpZeroExt8to64, typ.UInt64)
  8458  		v0.AddArg(y)
  8459  		v1 := b.NewValue0(v.Pos, OpZeroExt8to64, typ.UInt64)
  8460  		v1.AddArg(x)
  8461  		v.AddArg2(v0, v1)
  8462  		return true
  8463  	}
  8464  }
  8465  func rewriteValueLOONG64_OpLoad(v *Value) bool {
  8466  	v_1 := v.Args[1]
  8467  	v_0 := v.Args[0]
  8468  	// match: (Load <t> ptr mem)
  8469  	// cond: t.IsBoolean()
  8470  	// result: (MOVBUload ptr mem)
  8471  	for {
  8472  		t := v.Type
  8473  		ptr := v_0
  8474  		mem := v_1
  8475  		if !(t.IsBoolean()) {
  8476  			break
  8477  		}
  8478  		v.reset(OpLOONG64MOVBUload)
  8479  		v.AddArg2(ptr, mem)
  8480  		return true
  8481  	}
  8482  	// match: (Load <t> ptr mem)
  8483  	// cond: (is8BitInt(t) && t.IsSigned())
  8484  	// result: (MOVBload ptr mem)
  8485  	for {
  8486  		t := v.Type
  8487  		ptr := v_0
  8488  		mem := v_1
  8489  		if !(is8BitInt(t) && t.IsSigned()) {
  8490  			break
  8491  		}
  8492  		v.reset(OpLOONG64MOVBload)
  8493  		v.AddArg2(ptr, mem)
  8494  		return true
  8495  	}
  8496  	// match: (Load <t> ptr mem)
  8497  	// cond: (is8BitInt(t) && !t.IsSigned())
  8498  	// result: (MOVBUload ptr mem)
  8499  	for {
  8500  		t := v.Type
  8501  		ptr := v_0
  8502  		mem := v_1
  8503  		if !(is8BitInt(t) && !t.IsSigned()) {
  8504  			break
  8505  		}
  8506  		v.reset(OpLOONG64MOVBUload)
  8507  		v.AddArg2(ptr, mem)
  8508  		return true
  8509  	}
  8510  	// match: (Load <t> ptr mem)
  8511  	// cond: (is16BitInt(t) && t.IsSigned())
  8512  	// result: (MOVHload ptr mem)
  8513  	for {
  8514  		t := v.Type
  8515  		ptr := v_0
  8516  		mem := v_1
  8517  		if !(is16BitInt(t) && t.IsSigned()) {
  8518  			break
  8519  		}
  8520  		v.reset(OpLOONG64MOVHload)
  8521  		v.AddArg2(ptr, mem)
  8522  		return true
  8523  	}
  8524  	// match: (Load <t> ptr mem)
  8525  	// cond: (is16BitInt(t) && !t.IsSigned())
  8526  	// result: (MOVHUload ptr mem)
  8527  	for {
  8528  		t := v.Type
  8529  		ptr := v_0
  8530  		mem := v_1
  8531  		if !(is16BitInt(t) && !t.IsSigned()) {
  8532  			break
  8533  		}
  8534  		v.reset(OpLOONG64MOVHUload)
  8535  		v.AddArg2(ptr, mem)
  8536  		return true
  8537  	}
  8538  	// match: (Load <t> ptr mem)
  8539  	// cond: (is32BitInt(t) && t.IsSigned())
  8540  	// result: (MOVWload ptr mem)
  8541  	for {
  8542  		t := v.Type
  8543  		ptr := v_0
  8544  		mem := v_1
  8545  		if !(is32BitInt(t) && t.IsSigned()) {
  8546  			break
  8547  		}
  8548  		v.reset(OpLOONG64MOVWload)
  8549  		v.AddArg2(ptr, mem)
  8550  		return true
  8551  	}
  8552  	// match: (Load <t> ptr mem)
  8553  	// cond: (is32BitInt(t) && !t.IsSigned())
  8554  	// result: (MOVWUload ptr mem)
  8555  	for {
  8556  		t := v.Type
  8557  		ptr := v_0
  8558  		mem := v_1
  8559  		if !(is32BitInt(t) && !t.IsSigned()) {
  8560  			break
  8561  		}
  8562  		v.reset(OpLOONG64MOVWUload)
  8563  		v.AddArg2(ptr, mem)
  8564  		return true
  8565  	}
  8566  	// match: (Load <t> ptr mem)
  8567  	// cond: (is64BitInt(t) || isPtr(t))
  8568  	// result: (MOVVload ptr mem)
  8569  	for {
  8570  		t := v.Type
  8571  		ptr := v_0
  8572  		mem := v_1
  8573  		if !(is64BitInt(t) || isPtr(t)) {
  8574  			break
  8575  		}
  8576  		v.reset(OpLOONG64MOVVload)
  8577  		v.AddArg2(ptr, mem)
  8578  		return true
  8579  	}
  8580  	// match: (Load <t> ptr mem)
  8581  	// cond: is32BitFloat(t)
  8582  	// result: (MOVFload ptr mem)
  8583  	for {
  8584  		t := v.Type
  8585  		ptr := v_0
  8586  		mem := v_1
  8587  		if !(is32BitFloat(t)) {
  8588  			break
  8589  		}
  8590  		v.reset(OpLOONG64MOVFload)
  8591  		v.AddArg2(ptr, mem)
  8592  		return true
  8593  	}
  8594  	// match: (Load <t> ptr mem)
  8595  	// cond: is64BitFloat(t)
  8596  	// result: (MOVDload ptr mem)
  8597  	for {
  8598  		t := v.Type
  8599  		ptr := v_0
  8600  		mem := v_1
  8601  		if !(is64BitFloat(t)) {
  8602  			break
  8603  		}
  8604  		v.reset(OpLOONG64MOVDload)
  8605  		v.AddArg2(ptr, mem)
  8606  		return true
  8607  	}
  8608  	return false
  8609  }
  8610  func rewriteValueLOONG64_OpLocalAddr(v *Value) bool {
  8611  	v_1 := v.Args[1]
  8612  	v_0 := v.Args[0]
  8613  	b := v.Block
  8614  	typ := &b.Func.Config.Types
  8615  	// match: (LocalAddr <t> {sym} base mem)
  8616  	// cond: t.Elem().HasPointers()
  8617  	// result: (MOVVaddr {sym} (SPanchored base mem))
  8618  	for {
  8619  		t := v.Type
  8620  		sym := auxToSym(v.Aux)
  8621  		base := v_0
  8622  		mem := v_1
  8623  		if !(t.Elem().HasPointers()) {
  8624  			break
  8625  		}
  8626  		v.reset(OpLOONG64MOVVaddr)
  8627  		v.Aux = symToAux(sym)
  8628  		v0 := b.NewValue0(v.Pos, OpSPanchored, typ.Uintptr)
  8629  		v0.AddArg2(base, mem)
  8630  		v.AddArg(v0)
  8631  		return true
  8632  	}
  8633  	// match: (LocalAddr <t> {sym} base _)
  8634  	// cond: !t.Elem().HasPointers()
  8635  	// result: (MOVVaddr {sym} base)
  8636  	for {
  8637  		t := v.Type
  8638  		sym := auxToSym(v.Aux)
  8639  		base := v_0
  8640  		if !(!t.Elem().HasPointers()) {
  8641  			break
  8642  		}
  8643  		v.reset(OpLOONG64MOVVaddr)
  8644  		v.Aux = symToAux(sym)
  8645  		v.AddArg(base)
  8646  		return true
  8647  	}
  8648  	return false
  8649  }
  8650  func rewriteValueLOONG64_OpLsh16x16(v *Value) bool {
  8651  	v_1 := v.Args[1]
  8652  	v_0 := v.Args[0]
  8653  	b := v.Block
  8654  	typ := &b.Func.Config.Types
  8655  	// match: (Lsh16x16 x y)
  8656  	// cond: shiftIsBounded(v)
  8657  	// result: (SLLV x y)
  8658  	for {
  8659  		x := v_0
  8660  		y := v_1
  8661  		if !(shiftIsBounded(v)) {
  8662  			break
  8663  		}
  8664  		v.reset(OpLOONG64SLLV)
  8665  		v.AddArg2(x, y)
  8666  		return true
  8667  	}
  8668  	// match: (Lsh16x16 <t> x y)
  8669  	// cond: !shiftIsBounded(v)
  8670  	// result: (MASKEQZ (SLLV <t> x (ZeroExt16to64 y)) (SGTU (MOVVconst <typ.UInt64> [64]) (ZeroExt16to64 y)))
  8671  	for {
  8672  		t := v.Type
  8673  		x := v_0
  8674  		y := v_1
  8675  		if !(!shiftIsBounded(v)) {
  8676  			break
  8677  		}
  8678  		v.reset(OpLOONG64MASKEQZ)
  8679  		v0 := b.NewValue0(v.Pos, OpLOONG64SLLV, t)
  8680  		v1 := b.NewValue0(v.Pos, OpZeroExt16to64, typ.UInt64)
  8681  		v1.AddArg(y)
  8682  		v0.AddArg2(x, v1)
  8683  		v2 := b.NewValue0(v.Pos, OpLOONG64SGTU, typ.Bool)
  8684  		v3 := b.NewValue0(v.Pos, OpLOONG64MOVVconst, typ.UInt64)
  8685  		v3.AuxInt = int64ToAuxInt(64)
  8686  		v2.AddArg2(v3, v1)
  8687  		v.AddArg2(v0, v2)
  8688  		return true
  8689  	}
  8690  	return false
  8691  }
  8692  func rewriteValueLOONG64_OpLsh16x32(v *Value) bool {
  8693  	v_1 := v.Args[1]
  8694  	v_0 := v.Args[0]
  8695  	b := v.Block
  8696  	typ := &b.Func.Config.Types
  8697  	// match: (Lsh16x32 x y)
  8698  	// cond: shiftIsBounded(v)
  8699  	// result: (SLLV x y)
  8700  	for {
  8701  		x := v_0
  8702  		y := v_1
  8703  		if !(shiftIsBounded(v)) {
  8704  			break
  8705  		}
  8706  		v.reset(OpLOONG64SLLV)
  8707  		v.AddArg2(x, y)
  8708  		return true
  8709  	}
  8710  	// match: (Lsh16x32 <t> x y)
  8711  	// cond: !shiftIsBounded(v)
  8712  	// result: (MASKEQZ (SLLV <t> x (ZeroExt32to64 y)) (SGTU (MOVVconst <typ.UInt64> [64]) (ZeroExt32to64 y)))
  8713  	for {
  8714  		t := v.Type
  8715  		x := v_0
  8716  		y := v_1
  8717  		if !(!shiftIsBounded(v)) {
  8718  			break
  8719  		}
  8720  		v.reset(OpLOONG64MASKEQZ)
  8721  		v0 := b.NewValue0(v.Pos, OpLOONG64SLLV, t)
  8722  		v1 := b.NewValue0(v.Pos, OpZeroExt32to64, typ.UInt64)
  8723  		v1.AddArg(y)
  8724  		v0.AddArg2(x, v1)
  8725  		v2 := b.NewValue0(v.Pos, OpLOONG64SGTU, typ.Bool)
  8726  		v3 := b.NewValue0(v.Pos, OpLOONG64MOVVconst, typ.UInt64)
  8727  		v3.AuxInt = int64ToAuxInt(64)
  8728  		v2.AddArg2(v3, v1)
  8729  		v.AddArg2(v0, v2)
  8730  		return true
  8731  	}
  8732  	return false
  8733  }
  8734  func rewriteValueLOONG64_OpLsh16x64(v *Value) bool {
  8735  	v_1 := v.Args[1]
  8736  	v_0 := v.Args[0]
  8737  	b := v.Block
  8738  	typ := &b.Func.Config.Types
  8739  	// match: (Lsh16x64 x y)
  8740  	// cond: shiftIsBounded(v)
  8741  	// result: (SLLV x y)
  8742  	for {
  8743  		x := v_0
  8744  		y := v_1
  8745  		if !(shiftIsBounded(v)) {
  8746  			break
  8747  		}
  8748  		v.reset(OpLOONG64SLLV)
  8749  		v.AddArg2(x, y)
  8750  		return true
  8751  	}
  8752  	// match: (Lsh16x64 <t> x y)
  8753  	// cond: !shiftIsBounded(v)
  8754  	// result: (MASKEQZ (SLLV <t> x y) (SGTU (MOVVconst <typ.UInt64> [64]) y))
  8755  	for {
  8756  		t := v.Type
  8757  		x := v_0
  8758  		y := v_1
  8759  		if !(!shiftIsBounded(v)) {
  8760  			break
  8761  		}
  8762  		v.reset(OpLOONG64MASKEQZ)
  8763  		v0 := b.NewValue0(v.Pos, OpLOONG64SLLV, t)
  8764  		v0.AddArg2(x, y)
  8765  		v1 := b.NewValue0(v.Pos, OpLOONG64SGTU, typ.Bool)
  8766  		v2 := b.NewValue0(v.Pos, OpLOONG64MOVVconst, typ.UInt64)
  8767  		v2.AuxInt = int64ToAuxInt(64)
  8768  		v1.AddArg2(v2, y)
  8769  		v.AddArg2(v0, v1)
  8770  		return true
  8771  	}
  8772  	return false
  8773  }
  8774  func rewriteValueLOONG64_OpLsh16x8(v *Value) bool {
  8775  	v_1 := v.Args[1]
  8776  	v_0 := v.Args[0]
  8777  	b := v.Block
  8778  	typ := &b.Func.Config.Types
  8779  	// match: (Lsh16x8 x y)
  8780  	// cond: shiftIsBounded(v)
  8781  	// result: (SLLV x y)
  8782  	for {
  8783  		x := v_0
  8784  		y := v_1
  8785  		if !(shiftIsBounded(v)) {
  8786  			break
  8787  		}
  8788  		v.reset(OpLOONG64SLLV)
  8789  		v.AddArg2(x, y)
  8790  		return true
  8791  	}
  8792  	// match: (Lsh16x8 <t> x y)
  8793  	// cond: !shiftIsBounded(v)
  8794  	// result: (MASKEQZ (SLLV <t> x (ZeroExt8to64 y)) (SGTU (MOVVconst <typ.UInt64> [64]) (ZeroExt8to64 y)))
  8795  	for {
  8796  		t := v.Type
  8797  		x := v_0
  8798  		y := v_1
  8799  		if !(!shiftIsBounded(v)) {
  8800  			break
  8801  		}
  8802  		v.reset(OpLOONG64MASKEQZ)
  8803  		v0 := b.NewValue0(v.Pos, OpLOONG64SLLV, t)
  8804  		v1 := b.NewValue0(v.Pos, OpZeroExt8to64, typ.UInt64)
  8805  		v1.AddArg(y)
  8806  		v0.AddArg2(x, v1)
  8807  		v2 := b.NewValue0(v.Pos, OpLOONG64SGTU, typ.Bool)
  8808  		v3 := b.NewValue0(v.Pos, OpLOONG64MOVVconst, typ.UInt64)
  8809  		v3.AuxInt = int64ToAuxInt(64)
  8810  		v2.AddArg2(v3, v1)
  8811  		v.AddArg2(v0, v2)
  8812  		return true
  8813  	}
  8814  	return false
  8815  }
  8816  func rewriteValueLOONG64_OpLsh32x16(v *Value) bool {
  8817  	v_1 := v.Args[1]
  8818  	v_0 := v.Args[0]
  8819  	b := v.Block
  8820  	typ := &b.Func.Config.Types
  8821  	// match: (Lsh32x16 x y)
  8822  	// cond: shiftIsBounded(v)
  8823  	// result: (SLL x y)
  8824  	for {
  8825  		x := v_0
  8826  		y := v_1
  8827  		if !(shiftIsBounded(v)) {
  8828  			break
  8829  		}
  8830  		v.reset(OpLOONG64SLL)
  8831  		v.AddArg2(x, y)
  8832  		return true
  8833  	}
  8834  	// match: (Lsh32x16 <t> x y)
  8835  	// cond: !shiftIsBounded(v)
  8836  	// result: (MASKEQZ (SLL <t> x (ZeroExt16to64 y)) (SGTU (MOVVconst <typ.UInt64> [32]) (ZeroExt16to64 y)))
  8837  	for {
  8838  		t := v.Type
  8839  		x := v_0
  8840  		y := v_1
  8841  		if !(!shiftIsBounded(v)) {
  8842  			break
  8843  		}
  8844  		v.reset(OpLOONG64MASKEQZ)
  8845  		v0 := b.NewValue0(v.Pos, OpLOONG64SLL, t)
  8846  		v1 := b.NewValue0(v.Pos, OpZeroExt16to64, typ.UInt64)
  8847  		v1.AddArg(y)
  8848  		v0.AddArg2(x, v1)
  8849  		v2 := b.NewValue0(v.Pos, OpLOONG64SGTU, typ.Bool)
  8850  		v3 := b.NewValue0(v.Pos, OpLOONG64MOVVconst, typ.UInt64)
  8851  		v3.AuxInt = int64ToAuxInt(32)
  8852  		v2.AddArg2(v3, v1)
  8853  		v.AddArg2(v0, v2)
  8854  		return true
  8855  	}
  8856  	return false
  8857  }
  8858  func rewriteValueLOONG64_OpLsh32x32(v *Value) bool {
  8859  	v_1 := v.Args[1]
  8860  	v_0 := v.Args[0]
  8861  	b := v.Block
  8862  	typ := &b.Func.Config.Types
  8863  	// match: (Lsh32x32 x y)
  8864  	// cond: shiftIsBounded(v)
  8865  	// result: (SLL x y)
  8866  	for {
  8867  		x := v_0
  8868  		y := v_1
  8869  		if !(shiftIsBounded(v)) {
  8870  			break
  8871  		}
  8872  		v.reset(OpLOONG64SLL)
  8873  		v.AddArg2(x, y)
  8874  		return true
  8875  	}
  8876  	// match: (Lsh32x32 <t> x y)
  8877  	// cond: !shiftIsBounded(v)
  8878  	// result: (MASKEQZ (SLL <t> x (ZeroExt32to64 y)) (SGTU (MOVVconst <typ.UInt64> [32]) (ZeroExt32to64 y)))
  8879  	for {
  8880  		t := v.Type
  8881  		x := v_0
  8882  		y := v_1
  8883  		if !(!shiftIsBounded(v)) {
  8884  			break
  8885  		}
  8886  		v.reset(OpLOONG64MASKEQZ)
  8887  		v0 := b.NewValue0(v.Pos, OpLOONG64SLL, t)
  8888  		v1 := b.NewValue0(v.Pos, OpZeroExt32to64, typ.UInt64)
  8889  		v1.AddArg(y)
  8890  		v0.AddArg2(x, v1)
  8891  		v2 := b.NewValue0(v.Pos, OpLOONG64SGTU, typ.Bool)
  8892  		v3 := b.NewValue0(v.Pos, OpLOONG64MOVVconst, typ.UInt64)
  8893  		v3.AuxInt = int64ToAuxInt(32)
  8894  		v2.AddArg2(v3, v1)
  8895  		v.AddArg2(v0, v2)
  8896  		return true
  8897  	}
  8898  	return false
  8899  }
  8900  func rewriteValueLOONG64_OpLsh32x64(v *Value) bool {
  8901  	v_1 := v.Args[1]
  8902  	v_0 := v.Args[0]
  8903  	b := v.Block
  8904  	typ := &b.Func.Config.Types
  8905  	// match: (Lsh32x64 x y)
  8906  	// cond: shiftIsBounded(v)
  8907  	// result: (SLL x y)
  8908  	for {
  8909  		x := v_0
  8910  		y := v_1
  8911  		if !(shiftIsBounded(v)) {
  8912  			break
  8913  		}
  8914  		v.reset(OpLOONG64SLL)
  8915  		v.AddArg2(x, y)
  8916  		return true
  8917  	}
  8918  	// match: (Lsh32x64 <t> x y)
  8919  	// cond: !shiftIsBounded(v)
  8920  	// result: (MASKEQZ (SLL <t> x y) (SGTU (MOVVconst <typ.UInt64> [32]) y))
  8921  	for {
  8922  		t := v.Type
  8923  		x := v_0
  8924  		y := v_1
  8925  		if !(!shiftIsBounded(v)) {
  8926  			break
  8927  		}
  8928  		v.reset(OpLOONG64MASKEQZ)
  8929  		v0 := b.NewValue0(v.Pos, OpLOONG64SLL, t)
  8930  		v0.AddArg2(x, y)
  8931  		v1 := b.NewValue0(v.Pos, OpLOONG64SGTU, typ.Bool)
  8932  		v2 := b.NewValue0(v.Pos, OpLOONG64MOVVconst, typ.UInt64)
  8933  		v2.AuxInt = int64ToAuxInt(32)
  8934  		v1.AddArg2(v2, y)
  8935  		v.AddArg2(v0, v1)
  8936  		return true
  8937  	}
  8938  	return false
  8939  }
  8940  func rewriteValueLOONG64_OpLsh32x8(v *Value) bool {
  8941  	v_1 := v.Args[1]
  8942  	v_0 := v.Args[0]
  8943  	b := v.Block
  8944  	typ := &b.Func.Config.Types
  8945  	// match: (Lsh32x8 x y)
  8946  	// cond: shiftIsBounded(v)
  8947  	// result: (SLL x y)
  8948  	for {
  8949  		x := v_0
  8950  		y := v_1
  8951  		if !(shiftIsBounded(v)) {
  8952  			break
  8953  		}
  8954  		v.reset(OpLOONG64SLL)
  8955  		v.AddArg2(x, y)
  8956  		return true
  8957  	}
  8958  	// match: (Lsh32x8 <t> x y)
  8959  	// cond: !shiftIsBounded(v)
  8960  	// result: (MASKEQZ (SLL <t> x (ZeroExt8to64 y)) (SGTU (MOVVconst <typ.UInt64> [32]) (ZeroExt8to64 y)))
  8961  	for {
  8962  		t := v.Type
  8963  		x := v_0
  8964  		y := v_1
  8965  		if !(!shiftIsBounded(v)) {
  8966  			break
  8967  		}
  8968  		v.reset(OpLOONG64MASKEQZ)
  8969  		v0 := b.NewValue0(v.Pos, OpLOONG64SLL, t)
  8970  		v1 := b.NewValue0(v.Pos, OpZeroExt8to64, typ.UInt64)
  8971  		v1.AddArg(y)
  8972  		v0.AddArg2(x, v1)
  8973  		v2 := b.NewValue0(v.Pos, OpLOONG64SGTU, typ.Bool)
  8974  		v3 := b.NewValue0(v.Pos, OpLOONG64MOVVconst, typ.UInt64)
  8975  		v3.AuxInt = int64ToAuxInt(32)
  8976  		v2.AddArg2(v3, v1)
  8977  		v.AddArg2(v0, v2)
  8978  		return true
  8979  	}
  8980  	return false
  8981  }
  8982  func rewriteValueLOONG64_OpLsh64x16(v *Value) bool {
  8983  	v_1 := v.Args[1]
  8984  	v_0 := v.Args[0]
  8985  	b := v.Block
  8986  	typ := &b.Func.Config.Types
  8987  	// match: (Lsh64x16 x y)
  8988  	// cond: shiftIsBounded(v)
  8989  	// result: (SLLV x y)
  8990  	for {
  8991  		x := v_0
  8992  		y := v_1
  8993  		if !(shiftIsBounded(v)) {
  8994  			break
  8995  		}
  8996  		v.reset(OpLOONG64SLLV)
  8997  		v.AddArg2(x, y)
  8998  		return true
  8999  	}
  9000  	// match: (Lsh64x16 <t> x y)
  9001  	// cond: !shiftIsBounded(v)
  9002  	// result: (MASKEQZ (SLLV <t> x (ZeroExt16to64 y)) (SGTU (MOVVconst <typ.UInt64> [64]) (ZeroExt16to64 y)))
  9003  	for {
  9004  		t := v.Type
  9005  		x := v_0
  9006  		y := v_1
  9007  		if !(!shiftIsBounded(v)) {
  9008  			break
  9009  		}
  9010  		v.reset(OpLOONG64MASKEQZ)
  9011  		v0 := b.NewValue0(v.Pos, OpLOONG64SLLV, t)
  9012  		v1 := b.NewValue0(v.Pos, OpZeroExt16to64, typ.UInt64)
  9013  		v1.AddArg(y)
  9014  		v0.AddArg2(x, v1)
  9015  		v2 := b.NewValue0(v.Pos, OpLOONG64SGTU, typ.Bool)
  9016  		v3 := b.NewValue0(v.Pos, OpLOONG64MOVVconst, typ.UInt64)
  9017  		v3.AuxInt = int64ToAuxInt(64)
  9018  		v2.AddArg2(v3, v1)
  9019  		v.AddArg2(v0, v2)
  9020  		return true
  9021  	}
  9022  	return false
  9023  }
  9024  func rewriteValueLOONG64_OpLsh64x32(v *Value) bool {
  9025  	v_1 := v.Args[1]
  9026  	v_0 := v.Args[0]
  9027  	b := v.Block
  9028  	typ := &b.Func.Config.Types
  9029  	// match: (Lsh64x32 x y)
  9030  	// cond: shiftIsBounded(v)
  9031  	// result: (SLLV x y)
  9032  	for {
  9033  		x := v_0
  9034  		y := v_1
  9035  		if !(shiftIsBounded(v)) {
  9036  			break
  9037  		}
  9038  		v.reset(OpLOONG64SLLV)
  9039  		v.AddArg2(x, y)
  9040  		return true
  9041  	}
  9042  	// match: (Lsh64x32 <t> x y)
  9043  	// cond: !shiftIsBounded(v)
  9044  	// result: (MASKEQZ (SLLV <t> x (ZeroExt32to64 y)) (SGTU (MOVVconst <typ.UInt64> [64]) (ZeroExt32to64 y)))
  9045  	for {
  9046  		t := v.Type
  9047  		x := v_0
  9048  		y := v_1
  9049  		if !(!shiftIsBounded(v)) {
  9050  			break
  9051  		}
  9052  		v.reset(OpLOONG64MASKEQZ)
  9053  		v0 := b.NewValue0(v.Pos, OpLOONG64SLLV, t)
  9054  		v1 := b.NewValue0(v.Pos, OpZeroExt32to64, typ.UInt64)
  9055  		v1.AddArg(y)
  9056  		v0.AddArg2(x, v1)
  9057  		v2 := b.NewValue0(v.Pos, OpLOONG64SGTU, typ.Bool)
  9058  		v3 := b.NewValue0(v.Pos, OpLOONG64MOVVconst, typ.UInt64)
  9059  		v3.AuxInt = int64ToAuxInt(64)
  9060  		v2.AddArg2(v3, v1)
  9061  		v.AddArg2(v0, v2)
  9062  		return true
  9063  	}
  9064  	return false
  9065  }
  9066  func rewriteValueLOONG64_OpLsh64x64(v *Value) bool {
  9067  	v_1 := v.Args[1]
  9068  	v_0 := v.Args[0]
  9069  	b := v.Block
  9070  	typ := &b.Func.Config.Types
  9071  	// match: (Lsh64x64 x y)
  9072  	// cond: shiftIsBounded(v)
  9073  	// result: (SLLV x y)
  9074  	for {
  9075  		x := v_0
  9076  		y := v_1
  9077  		if !(shiftIsBounded(v)) {
  9078  			break
  9079  		}
  9080  		v.reset(OpLOONG64SLLV)
  9081  		v.AddArg2(x, y)
  9082  		return true
  9083  	}
  9084  	// match: (Lsh64x64 <t> x y)
  9085  	// cond: !shiftIsBounded(v)
  9086  	// result: (MASKEQZ (SLLV <t> x y) (SGTU (MOVVconst <typ.UInt64> [64]) y))
  9087  	for {
  9088  		t := v.Type
  9089  		x := v_0
  9090  		y := v_1
  9091  		if !(!shiftIsBounded(v)) {
  9092  			break
  9093  		}
  9094  		v.reset(OpLOONG64MASKEQZ)
  9095  		v0 := b.NewValue0(v.Pos, OpLOONG64SLLV, t)
  9096  		v0.AddArg2(x, y)
  9097  		v1 := b.NewValue0(v.Pos, OpLOONG64SGTU, typ.Bool)
  9098  		v2 := b.NewValue0(v.Pos, OpLOONG64MOVVconst, typ.UInt64)
  9099  		v2.AuxInt = int64ToAuxInt(64)
  9100  		v1.AddArg2(v2, y)
  9101  		v.AddArg2(v0, v1)
  9102  		return true
  9103  	}
  9104  	return false
  9105  }
  9106  func rewriteValueLOONG64_OpLsh64x8(v *Value) bool {
  9107  	v_1 := v.Args[1]
  9108  	v_0 := v.Args[0]
  9109  	b := v.Block
  9110  	typ := &b.Func.Config.Types
  9111  	// match: (Lsh64x8 x y)
  9112  	// cond: shiftIsBounded(v)
  9113  	// result: (SLLV x y)
  9114  	for {
  9115  		x := v_0
  9116  		y := v_1
  9117  		if !(shiftIsBounded(v)) {
  9118  			break
  9119  		}
  9120  		v.reset(OpLOONG64SLLV)
  9121  		v.AddArg2(x, y)
  9122  		return true
  9123  	}
  9124  	// match: (Lsh64x8 <t> x y)
  9125  	// cond: !shiftIsBounded(v)
  9126  	// result: (MASKEQZ (SLLV <t> x (ZeroExt8to64 y)) (SGTU (MOVVconst <typ.UInt64> [64]) (ZeroExt8to64 y)))
  9127  	for {
  9128  		t := v.Type
  9129  		x := v_0
  9130  		y := v_1
  9131  		if !(!shiftIsBounded(v)) {
  9132  			break
  9133  		}
  9134  		v.reset(OpLOONG64MASKEQZ)
  9135  		v0 := b.NewValue0(v.Pos, OpLOONG64SLLV, t)
  9136  		v1 := b.NewValue0(v.Pos, OpZeroExt8to64, typ.UInt64)
  9137  		v1.AddArg(y)
  9138  		v0.AddArg2(x, v1)
  9139  		v2 := b.NewValue0(v.Pos, OpLOONG64SGTU, typ.Bool)
  9140  		v3 := b.NewValue0(v.Pos, OpLOONG64MOVVconst, typ.UInt64)
  9141  		v3.AuxInt = int64ToAuxInt(64)
  9142  		v2.AddArg2(v3, v1)
  9143  		v.AddArg2(v0, v2)
  9144  		return true
  9145  	}
  9146  	return false
  9147  }
  9148  func rewriteValueLOONG64_OpLsh8x16(v *Value) bool {
  9149  	v_1 := v.Args[1]
  9150  	v_0 := v.Args[0]
  9151  	b := v.Block
  9152  	typ := &b.Func.Config.Types
  9153  	// match: (Lsh8x16 x y)
  9154  	// cond: shiftIsBounded(v)
  9155  	// result: (SLLV x y)
  9156  	for {
  9157  		x := v_0
  9158  		y := v_1
  9159  		if !(shiftIsBounded(v)) {
  9160  			break
  9161  		}
  9162  		v.reset(OpLOONG64SLLV)
  9163  		v.AddArg2(x, y)
  9164  		return true
  9165  	}
  9166  	// match: (Lsh8x16 <t> x y)
  9167  	// cond: !shiftIsBounded(v)
  9168  	// result: (MASKEQZ (SLLV <t> x (ZeroExt16to64 y)) (SGTU (MOVVconst <typ.UInt64> [64]) (ZeroExt16to64 y)))
  9169  	for {
  9170  		t := v.Type
  9171  		x := v_0
  9172  		y := v_1
  9173  		if !(!shiftIsBounded(v)) {
  9174  			break
  9175  		}
  9176  		v.reset(OpLOONG64MASKEQZ)
  9177  		v0 := b.NewValue0(v.Pos, OpLOONG64SLLV, t)
  9178  		v1 := b.NewValue0(v.Pos, OpZeroExt16to64, typ.UInt64)
  9179  		v1.AddArg(y)
  9180  		v0.AddArg2(x, v1)
  9181  		v2 := b.NewValue0(v.Pos, OpLOONG64SGTU, typ.Bool)
  9182  		v3 := b.NewValue0(v.Pos, OpLOONG64MOVVconst, typ.UInt64)
  9183  		v3.AuxInt = int64ToAuxInt(64)
  9184  		v2.AddArg2(v3, v1)
  9185  		v.AddArg2(v0, v2)
  9186  		return true
  9187  	}
  9188  	return false
  9189  }
  9190  func rewriteValueLOONG64_OpLsh8x32(v *Value) bool {
  9191  	v_1 := v.Args[1]
  9192  	v_0 := v.Args[0]
  9193  	b := v.Block
  9194  	typ := &b.Func.Config.Types
  9195  	// match: (Lsh8x32 x y)
  9196  	// cond: shiftIsBounded(v)
  9197  	// result: (SLLV x y)
  9198  	for {
  9199  		x := v_0
  9200  		y := v_1
  9201  		if !(shiftIsBounded(v)) {
  9202  			break
  9203  		}
  9204  		v.reset(OpLOONG64SLLV)
  9205  		v.AddArg2(x, y)
  9206  		return true
  9207  	}
  9208  	// match: (Lsh8x32 <t> x y)
  9209  	// cond: !shiftIsBounded(v)
  9210  	// result: (MASKEQZ (SLLV <t> x (ZeroExt32to64 y)) (SGTU (MOVVconst <typ.UInt64> [64]) (ZeroExt32to64 y)))
  9211  	for {
  9212  		t := v.Type
  9213  		x := v_0
  9214  		y := v_1
  9215  		if !(!shiftIsBounded(v)) {
  9216  			break
  9217  		}
  9218  		v.reset(OpLOONG64MASKEQZ)
  9219  		v0 := b.NewValue0(v.Pos, OpLOONG64SLLV, t)
  9220  		v1 := b.NewValue0(v.Pos, OpZeroExt32to64, typ.UInt64)
  9221  		v1.AddArg(y)
  9222  		v0.AddArg2(x, v1)
  9223  		v2 := b.NewValue0(v.Pos, OpLOONG64SGTU, typ.Bool)
  9224  		v3 := b.NewValue0(v.Pos, OpLOONG64MOVVconst, typ.UInt64)
  9225  		v3.AuxInt = int64ToAuxInt(64)
  9226  		v2.AddArg2(v3, v1)
  9227  		v.AddArg2(v0, v2)
  9228  		return true
  9229  	}
  9230  	return false
  9231  }
  9232  func rewriteValueLOONG64_OpLsh8x64(v *Value) bool {
  9233  	v_1 := v.Args[1]
  9234  	v_0 := v.Args[0]
  9235  	b := v.Block
  9236  	typ := &b.Func.Config.Types
  9237  	// match: (Lsh8x64 x y)
  9238  	// cond: shiftIsBounded(v)
  9239  	// result: (SLLV x y)
  9240  	for {
  9241  		x := v_0
  9242  		y := v_1
  9243  		if !(shiftIsBounded(v)) {
  9244  			break
  9245  		}
  9246  		v.reset(OpLOONG64SLLV)
  9247  		v.AddArg2(x, y)
  9248  		return true
  9249  	}
  9250  	// match: (Lsh8x64 <t> x y)
  9251  	// cond: !shiftIsBounded(v)
  9252  	// result: (MASKEQZ (SLLV <t> x y) (SGTU (MOVVconst <typ.UInt64> [64]) y))
  9253  	for {
  9254  		t := v.Type
  9255  		x := v_0
  9256  		y := v_1
  9257  		if !(!shiftIsBounded(v)) {
  9258  			break
  9259  		}
  9260  		v.reset(OpLOONG64MASKEQZ)
  9261  		v0 := b.NewValue0(v.Pos, OpLOONG64SLLV, t)
  9262  		v0.AddArg2(x, y)
  9263  		v1 := b.NewValue0(v.Pos, OpLOONG64SGTU, typ.Bool)
  9264  		v2 := b.NewValue0(v.Pos, OpLOONG64MOVVconst, typ.UInt64)
  9265  		v2.AuxInt = int64ToAuxInt(64)
  9266  		v1.AddArg2(v2, y)
  9267  		v.AddArg2(v0, v1)
  9268  		return true
  9269  	}
  9270  	return false
  9271  }
  9272  func rewriteValueLOONG64_OpLsh8x8(v *Value) bool {
  9273  	v_1 := v.Args[1]
  9274  	v_0 := v.Args[0]
  9275  	b := v.Block
  9276  	typ := &b.Func.Config.Types
  9277  	// match: (Lsh8x8 x y)
  9278  	// cond: shiftIsBounded(v)
  9279  	// result: (SLLV x y)
  9280  	for {
  9281  		x := v_0
  9282  		y := v_1
  9283  		if !(shiftIsBounded(v)) {
  9284  			break
  9285  		}
  9286  		v.reset(OpLOONG64SLLV)
  9287  		v.AddArg2(x, y)
  9288  		return true
  9289  	}
  9290  	// match: (Lsh8x8 <t> x y)
  9291  	// cond: !shiftIsBounded(v)
  9292  	// result: (MASKEQZ (SLLV <t> x (ZeroExt8to64 y)) (SGTU (MOVVconst <typ.UInt64> [64]) (ZeroExt8to64 y)))
  9293  	for {
  9294  		t := v.Type
  9295  		x := v_0
  9296  		y := v_1
  9297  		if !(!shiftIsBounded(v)) {
  9298  			break
  9299  		}
  9300  		v.reset(OpLOONG64MASKEQZ)
  9301  		v0 := b.NewValue0(v.Pos, OpLOONG64SLLV, t)
  9302  		v1 := b.NewValue0(v.Pos, OpZeroExt8to64, typ.UInt64)
  9303  		v1.AddArg(y)
  9304  		v0.AddArg2(x, v1)
  9305  		v2 := b.NewValue0(v.Pos, OpLOONG64SGTU, typ.Bool)
  9306  		v3 := b.NewValue0(v.Pos, OpLOONG64MOVVconst, typ.UInt64)
  9307  		v3.AuxInt = int64ToAuxInt(64)
  9308  		v2.AddArg2(v3, v1)
  9309  		v.AddArg2(v0, v2)
  9310  		return true
  9311  	}
  9312  	return false
  9313  }
  9314  func rewriteValueLOONG64_OpMod16(v *Value) bool {
  9315  	v_1 := v.Args[1]
  9316  	v_0 := v.Args[0]
  9317  	b := v.Block
  9318  	typ := &b.Func.Config.Types
  9319  	// match: (Mod16 x y)
  9320  	// result: (REMV (SignExt16to64 x) (SignExt16to64 y))
  9321  	for {
  9322  		x := v_0
  9323  		y := v_1
  9324  		v.reset(OpLOONG64REMV)
  9325  		v0 := b.NewValue0(v.Pos, OpSignExt16to64, typ.Int64)
  9326  		v0.AddArg(x)
  9327  		v1 := b.NewValue0(v.Pos, OpSignExt16to64, typ.Int64)
  9328  		v1.AddArg(y)
  9329  		v.AddArg2(v0, v1)
  9330  		return true
  9331  	}
  9332  }
  9333  func rewriteValueLOONG64_OpMod16u(v *Value) bool {
  9334  	v_1 := v.Args[1]
  9335  	v_0 := v.Args[0]
  9336  	b := v.Block
  9337  	typ := &b.Func.Config.Types
  9338  	// match: (Mod16u x y)
  9339  	// result: (REMVU (ZeroExt16to64 x) (ZeroExt16to64 y))
  9340  	for {
  9341  		x := v_0
  9342  		y := v_1
  9343  		v.reset(OpLOONG64REMVU)
  9344  		v0 := b.NewValue0(v.Pos, OpZeroExt16to64, typ.UInt64)
  9345  		v0.AddArg(x)
  9346  		v1 := b.NewValue0(v.Pos, OpZeroExt16to64, typ.UInt64)
  9347  		v1.AddArg(y)
  9348  		v.AddArg2(v0, v1)
  9349  		return true
  9350  	}
  9351  }
  9352  func rewriteValueLOONG64_OpMod32(v *Value) bool {
  9353  	v_1 := v.Args[1]
  9354  	v_0 := v.Args[0]
  9355  	b := v.Block
  9356  	typ := &b.Func.Config.Types
  9357  	// match: (Mod32 x y)
  9358  	// result: (REMV (SignExt32to64 x) (SignExt32to64 y))
  9359  	for {
  9360  		x := v_0
  9361  		y := v_1
  9362  		v.reset(OpLOONG64REMV)
  9363  		v0 := b.NewValue0(v.Pos, OpSignExt32to64, typ.Int64)
  9364  		v0.AddArg(x)
  9365  		v1 := b.NewValue0(v.Pos, OpSignExt32to64, typ.Int64)
  9366  		v1.AddArg(y)
  9367  		v.AddArg2(v0, v1)
  9368  		return true
  9369  	}
  9370  }
  9371  func rewriteValueLOONG64_OpMod32u(v *Value) bool {
  9372  	v_1 := v.Args[1]
  9373  	v_0 := v.Args[0]
  9374  	b := v.Block
  9375  	typ := &b.Func.Config.Types
  9376  	// match: (Mod32u x y)
  9377  	// result: (REMVU (ZeroExt32to64 x) (ZeroExt32to64 y))
  9378  	for {
  9379  		x := v_0
  9380  		y := v_1
  9381  		v.reset(OpLOONG64REMVU)
  9382  		v0 := b.NewValue0(v.Pos, OpZeroExt32to64, typ.UInt64)
  9383  		v0.AddArg(x)
  9384  		v1 := b.NewValue0(v.Pos, OpZeroExt32to64, typ.UInt64)
  9385  		v1.AddArg(y)
  9386  		v.AddArg2(v0, v1)
  9387  		return true
  9388  	}
  9389  }
  9390  func rewriteValueLOONG64_OpMod64(v *Value) bool {
  9391  	v_1 := v.Args[1]
  9392  	v_0 := v.Args[0]
  9393  	// match: (Mod64 x y)
  9394  	// result: (REMV x y)
  9395  	for {
  9396  		x := v_0
  9397  		y := v_1
  9398  		v.reset(OpLOONG64REMV)
  9399  		v.AddArg2(x, y)
  9400  		return true
  9401  	}
  9402  }
  9403  func rewriteValueLOONG64_OpMod8(v *Value) bool {
  9404  	v_1 := v.Args[1]
  9405  	v_0 := v.Args[0]
  9406  	b := v.Block
  9407  	typ := &b.Func.Config.Types
  9408  	// match: (Mod8 x y)
  9409  	// result: (REMV (SignExt8to64 x) (SignExt8to64 y))
  9410  	for {
  9411  		x := v_0
  9412  		y := v_1
  9413  		v.reset(OpLOONG64REMV)
  9414  		v0 := b.NewValue0(v.Pos, OpSignExt8to64, typ.Int64)
  9415  		v0.AddArg(x)
  9416  		v1 := b.NewValue0(v.Pos, OpSignExt8to64, typ.Int64)
  9417  		v1.AddArg(y)
  9418  		v.AddArg2(v0, v1)
  9419  		return true
  9420  	}
  9421  }
  9422  func rewriteValueLOONG64_OpMod8u(v *Value) bool {
  9423  	v_1 := v.Args[1]
  9424  	v_0 := v.Args[0]
  9425  	b := v.Block
  9426  	typ := &b.Func.Config.Types
  9427  	// match: (Mod8u x y)
  9428  	// result: (REMVU (ZeroExt8to64 x) (ZeroExt8to64 y))
  9429  	for {
  9430  		x := v_0
  9431  		y := v_1
  9432  		v.reset(OpLOONG64REMVU)
  9433  		v0 := b.NewValue0(v.Pos, OpZeroExt8to64, typ.UInt64)
  9434  		v0.AddArg(x)
  9435  		v1 := b.NewValue0(v.Pos, OpZeroExt8to64, typ.UInt64)
  9436  		v1.AddArg(y)
  9437  		v.AddArg2(v0, v1)
  9438  		return true
  9439  	}
  9440  }
  9441  func rewriteValueLOONG64_OpMove(v *Value) bool {
  9442  	v_2 := v.Args[2]
  9443  	v_1 := v.Args[1]
  9444  	v_0 := v.Args[0]
  9445  	b := v.Block
  9446  	typ := &b.Func.Config.Types
  9447  	// match: (Move [0] _ _ mem)
  9448  	// result: mem
  9449  	for {
  9450  		if auxIntToInt64(v.AuxInt) != 0 {
  9451  			break
  9452  		}
  9453  		mem := v_2
  9454  		v.copyOf(mem)
  9455  		return true
  9456  	}
  9457  	// match: (Move [1] dst src mem)
  9458  	// result: (MOVBstore dst (MOVBUload src mem) mem)
  9459  	for {
  9460  		if auxIntToInt64(v.AuxInt) != 1 {
  9461  			break
  9462  		}
  9463  		dst := v_0
  9464  		src := v_1
  9465  		mem := v_2
  9466  		v.reset(OpLOONG64MOVBstore)
  9467  		v0 := b.NewValue0(v.Pos, OpLOONG64MOVBUload, typ.UInt8)
  9468  		v0.AddArg2(src, mem)
  9469  		v.AddArg3(dst, v0, mem)
  9470  		return true
  9471  	}
  9472  	// match: (Move [2] dst src mem)
  9473  	// result: (MOVHstore dst (MOVHUload src mem) mem)
  9474  	for {
  9475  		if auxIntToInt64(v.AuxInt) != 2 {
  9476  			break
  9477  		}
  9478  		dst := v_0
  9479  		src := v_1
  9480  		mem := v_2
  9481  		v.reset(OpLOONG64MOVHstore)
  9482  		v0 := b.NewValue0(v.Pos, OpLOONG64MOVHUload, typ.UInt16)
  9483  		v0.AddArg2(src, mem)
  9484  		v.AddArg3(dst, v0, mem)
  9485  		return true
  9486  	}
  9487  	// match: (Move [3] dst src mem)
  9488  	// result: (MOVBstore [2] dst (MOVBUload [2] src mem) (MOVHstore dst (MOVHUload src mem) mem))
  9489  	for {
  9490  		if auxIntToInt64(v.AuxInt) != 3 {
  9491  			break
  9492  		}
  9493  		dst := v_0
  9494  		src := v_1
  9495  		mem := v_2
  9496  		v.reset(OpLOONG64MOVBstore)
  9497  		v.AuxInt = int32ToAuxInt(2)
  9498  		v0 := b.NewValue0(v.Pos, OpLOONG64MOVBUload, typ.UInt8)
  9499  		v0.AuxInt = int32ToAuxInt(2)
  9500  		v0.AddArg2(src, mem)
  9501  		v1 := b.NewValue0(v.Pos, OpLOONG64MOVHstore, types.TypeMem)
  9502  		v2 := b.NewValue0(v.Pos, OpLOONG64MOVHUload, typ.UInt16)
  9503  		v2.AddArg2(src, mem)
  9504  		v1.AddArg3(dst, v2, mem)
  9505  		v.AddArg3(dst, v0, v1)
  9506  		return true
  9507  	}
  9508  	// match: (Move [4] dst src mem)
  9509  	// result: (MOVWstore dst (MOVWUload src mem) mem)
  9510  	for {
  9511  		if auxIntToInt64(v.AuxInt) != 4 {
  9512  			break
  9513  		}
  9514  		dst := v_0
  9515  		src := v_1
  9516  		mem := v_2
  9517  		v.reset(OpLOONG64MOVWstore)
  9518  		v0 := b.NewValue0(v.Pos, OpLOONG64MOVWUload, typ.UInt32)
  9519  		v0.AddArg2(src, mem)
  9520  		v.AddArg3(dst, v0, mem)
  9521  		return true
  9522  	}
  9523  	// match: (Move [5] dst src mem)
  9524  	// result: (MOVBstore [4] dst (MOVBUload [4] src mem) (MOVWstore dst (MOVWUload src mem) mem))
  9525  	for {
  9526  		if auxIntToInt64(v.AuxInt) != 5 {
  9527  			break
  9528  		}
  9529  		dst := v_0
  9530  		src := v_1
  9531  		mem := v_2
  9532  		v.reset(OpLOONG64MOVBstore)
  9533  		v.AuxInt = int32ToAuxInt(4)
  9534  		v0 := b.NewValue0(v.Pos, OpLOONG64MOVBUload, typ.UInt8)
  9535  		v0.AuxInt = int32ToAuxInt(4)
  9536  		v0.AddArg2(src, mem)
  9537  		v1 := b.NewValue0(v.Pos, OpLOONG64MOVWstore, types.TypeMem)
  9538  		v2 := b.NewValue0(v.Pos, OpLOONG64MOVWUload, typ.UInt32)
  9539  		v2.AddArg2(src, mem)
  9540  		v1.AddArg3(dst, v2, mem)
  9541  		v.AddArg3(dst, v0, v1)
  9542  		return true
  9543  	}
  9544  	// match: (Move [6] dst src mem)
  9545  	// result: (MOVHstore [4] dst (MOVHUload [4] src mem) (MOVWstore dst (MOVWUload src mem) mem))
  9546  	for {
  9547  		if auxIntToInt64(v.AuxInt) != 6 {
  9548  			break
  9549  		}
  9550  		dst := v_0
  9551  		src := v_1
  9552  		mem := v_2
  9553  		v.reset(OpLOONG64MOVHstore)
  9554  		v.AuxInt = int32ToAuxInt(4)
  9555  		v0 := b.NewValue0(v.Pos, OpLOONG64MOVHUload, typ.UInt16)
  9556  		v0.AuxInt = int32ToAuxInt(4)
  9557  		v0.AddArg2(src, mem)
  9558  		v1 := b.NewValue0(v.Pos, OpLOONG64MOVWstore, types.TypeMem)
  9559  		v2 := b.NewValue0(v.Pos, OpLOONG64MOVWUload, typ.UInt32)
  9560  		v2.AddArg2(src, mem)
  9561  		v1.AddArg3(dst, v2, mem)
  9562  		v.AddArg3(dst, v0, v1)
  9563  		return true
  9564  	}
  9565  	// match: (Move [7] dst src mem)
  9566  	// result: (MOVWstore [3] dst (MOVWUload [3] src mem) (MOVWstore dst (MOVWUload src mem) mem))
  9567  	for {
  9568  		if auxIntToInt64(v.AuxInt) != 7 {
  9569  			break
  9570  		}
  9571  		dst := v_0
  9572  		src := v_1
  9573  		mem := v_2
  9574  		v.reset(OpLOONG64MOVWstore)
  9575  		v.AuxInt = int32ToAuxInt(3)
  9576  		v0 := b.NewValue0(v.Pos, OpLOONG64MOVWUload, typ.UInt32)
  9577  		v0.AuxInt = int32ToAuxInt(3)
  9578  		v0.AddArg2(src, mem)
  9579  		v1 := b.NewValue0(v.Pos, OpLOONG64MOVWstore, types.TypeMem)
  9580  		v2 := b.NewValue0(v.Pos, OpLOONG64MOVWUload, typ.UInt32)
  9581  		v2.AddArg2(src, mem)
  9582  		v1.AddArg3(dst, v2, mem)
  9583  		v.AddArg3(dst, v0, v1)
  9584  		return true
  9585  	}
  9586  	// match: (Move [8] dst src mem)
  9587  	// result: (MOVVstore dst (MOVVload src mem) mem)
  9588  	for {
  9589  		if auxIntToInt64(v.AuxInt) != 8 {
  9590  			break
  9591  		}
  9592  		dst := v_0
  9593  		src := v_1
  9594  		mem := v_2
  9595  		v.reset(OpLOONG64MOVVstore)
  9596  		v0 := b.NewValue0(v.Pos, OpLOONG64MOVVload, typ.UInt64)
  9597  		v0.AddArg2(src, mem)
  9598  		v.AddArg3(dst, v0, mem)
  9599  		return true
  9600  	}
  9601  	// match: (Move [9] dst src mem)
  9602  	// result: (MOVBstore [8] dst (MOVBUload [8] src mem) (MOVVstore dst (MOVVload src mem) mem))
  9603  	for {
  9604  		if auxIntToInt64(v.AuxInt) != 9 {
  9605  			break
  9606  		}
  9607  		dst := v_0
  9608  		src := v_1
  9609  		mem := v_2
  9610  		v.reset(OpLOONG64MOVBstore)
  9611  		v.AuxInt = int32ToAuxInt(8)
  9612  		v0 := b.NewValue0(v.Pos, OpLOONG64MOVBUload, typ.UInt8)
  9613  		v0.AuxInt = int32ToAuxInt(8)
  9614  		v0.AddArg2(src, mem)
  9615  		v1 := b.NewValue0(v.Pos, OpLOONG64MOVVstore, types.TypeMem)
  9616  		v2 := b.NewValue0(v.Pos, OpLOONG64MOVVload, typ.UInt64)
  9617  		v2.AddArg2(src, mem)
  9618  		v1.AddArg3(dst, v2, mem)
  9619  		v.AddArg3(dst, v0, v1)
  9620  		return true
  9621  	}
  9622  	// match: (Move [10] dst src mem)
  9623  	// result: (MOVHstore [8] dst (MOVHUload [8] src mem) (MOVVstore dst (MOVVload src mem) mem))
  9624  	for {
  9625  		if auxIntToInt64(v.AuxInt) != 10 {
  9626  			break
  9627  		}
  9628  		dst := v_0
  9629  		src := v_1
  9630  		mem := v_2
  9631  		v.reset(OpLOONG64MOVHstore)
  9632  		v.AuxInt = int32ToAuxInt(8)
  9633  		v0 := b.NewValue0(v.Pos, OpLOONG64MOVHUload, typ.UInt16)
  9634  		v0.AuxInt = int32ToAuxInt(8)
  9635  		v0.AddArg2(src, mem)
  9636  		v1 := b.NewValue0(v.Pos, OpLOONG64MOVVstore, types.TypeMem)
  9637  		v2 := b.NewValue0(v.Pos, OpLOONG64MOVVload, typ.UInt64)
  9638  		v2.AddArg2(src, mem)
  9639  		v1.AddArg3(dst, v2, mem)
  9640  		v.AddArg3(dst, v0, v1)
  9641  		return true
  9642  	}
  9643  	// match: (Move [11] dst src mem)
  9644  	// result: (MOVWstore [7] dst (MOVWload [7] src mem) (MOVVstore dst (MOVVload src mem) mem))
  9645  	for {
  9646  		if auxIntToInt64(v.AuxInt) != 11 {
  9647  			break
  9648  		}
  9649  		dst := v_0
  9650  		src := v_1
  9651  		mem := v_2
  9652  		v.reset(OpLOONG64MOVWstore)
  9653  		v.AuxInt = int32ToAuxInt(7)
  9654  		v0 := b.NewValue0(v.Pos, OpLOONG64MOVWload, typ.Int32)
  9655  		v0.AuxInt = int32ToAuxInt(7)
  9656  		v0.AddArg2(src, mem)
  9657  		v1 := b.NewValue0(v.Pos, OpLOONG64MOVVstore, types.TypeMem)
  9658  		v2 := b.NewValue0(v.Pos, OpLOONG64MOVVload, typ.UInt64)
  9659  		v2.AddArg2(src, mem)
  9660  		v1.AddArg3(dst, v2, mem)
  9661  		v.AddArg3(dst, v0, v1)
  9662  		return true
  9663  	}
  9664  	// match: (Move [12] dst src mem)
  9665  	// result: (MOVWstore [8] dst (MOVWUload [8] src mem) (MOVVstore dst (MOVVload src mem) mem))
  9666  	for {
  9667  		if auxIntToInt64(v.AuxInt) != 12 {
  9668  			break
  9669  		}
  9670  		dst := v_0
  9671  		src := v_1
  9672  		mem := v_2
  9673  		v.reset(OpLOONG64MOVWstore)
  9674  		v.AuxInt = int32ToAuxInt(8)
  9675  		v0 := b.NewValue0(v.Pos, OpLOONG64MOVWUload, typ.UInt32)
  9676  		v0.AuxInt = int32ToAuxInt(8)
  9677  		v0.AddArg2(src, mem)
  9678  		v1 := b.NewValue0(v.Pos, OpLOONG64MOVVstore, types.TypeMem)
  9679  		v2 := b.NewValue0(v.Pos, OpLOONG64MOVVload, typ.UInt64)
  9680  		v2.AddArg2(src, mem)
  9681  		v1.AddArg3(dst, v2, mem)
  9682  		v.AddArg3(dst, v0, v1)
  9683  		return true
  9684  	}
  9685  	// match: (Move [13] dst src mem)
  9686  	// result: (MOVVstore [5] dst (MOVVload [5] src mem) (MOVVstore dst (MOVVload src mem) mem))
  9687  	for {
  9688  		if auxIntToInt64(v.AuxInt) != 13 {
  9689  			break
  9690  		}
  9691  		dst := v_0
  9692  		src := v_1
  9693  		mem := v_2
  9694  		v.reset(OpLOONG64MOVVstore)
  9695  		v.AuxInt = int32ToAuxInt(5)
  9696  		v0 := b.NewValue0(v.Pos, OpLOONG64MOVVload, typ.UInt64)
  9697  		v0.AuxInt = int32ToAuxInt(5)
  9698  		v0.AddArg2(src, mem)
  9699  		v1 := b.NewValue0(v.Pos, OpLOONG64MOVVstore, types.TypeMem)
  9700  		v2 := b.NewValue0(v.Pos, OpLOONG64MOVVload, typ.UInt64)
  9701  		v2.AddArg2(src, mem)
  9702  		v1.AddArg3(dst, v2, mem)
  9703  		v.AddArg3(dst, v0, v1)
  9704  		return true
  9705  	}
  9706  	// match: (Move [14] dst src mem)
  9707  	// result: (MOVVstore [6] dst (MOVVload [6] src mem) (MOVVstore dst (MOVVload src mem) mem))
  9708  	for {
  9709  		if auxIntToInt64(v.AuxInt) != 14 {
  9710  			break
  9711  		}
  9712  		dst := v_0
  9713  		src := v_1
  9714  		mem := v_2
  9715  		v.reset(OpLOONG64MOVVstore)
  9716  		v.AuxInt = int32ToAuxInt(6)
  9717  		v0 := b.NewValue0(v.Pos, OpLOONG64MOVVload, typ.UInt64)
  9718  		v0.AuxInt = int32ToAuxInt(6)
  9719  		v0.AddArg2(src, mem)
  9720  		v1 := b.NewValue0(v.Pos, OpLOONG64MOVVstore, types.TypeMem)
  9721  		v2 := b.NewValue0(v.Pos, OpLOONG64MOVVload, typ.UInt64)
  9722  		v2.AddArg2(src, mem)
  9723  		v1.AddArg3(dst, v2, mem)
  9724  		v.AddArg3(dst, v0, v1)
  9725  		return true
  9726  	}
  9727  	// match: (Move [15] dst src mem)
  9728  	// result: (MOVVstore [7] dst (MOVVload [7] src mem) (MOVVstore dst (MOVVload src mem) mem))
  9729  	for {
  9730  		if auxIntToInt64(v.AuxInt) != 15 {
  9731  			break
  9732  		}
  9733  		dst := v_0
  9734  		src := v_1
  9735  		mem := v_2
  9736  		v.reset(OpLOONG64MOVVstore)
  9737  		v.AuxInt = int32ToAuxInt(7)
  9738  		v0 := b.NewValue0(v.Pos, OpLOONG64MOVVload, typ.UInt64)
  9739  		v0.AuxInt = int32ToAuxInt(7)
  9740  		v0.AddArg2(src, mem)
  9741  		v1 := b.NewValue0(v.Pos, OpLOONG64MOVVstore, types.TypeMem)
  9742  		v2 := b.NewValue0(v.Pos, OpLOONG64MOVVload, typ.UInt64)
  9743  		v2.AddArg2(src, mem)
  9744  		v1.AddArg3(dst, v2, mem)
  9745  		v.AddArg3(dst, v0, v1)
  9746  		return true
  9747  	}
  9748  	// match: (Move [16] dst src mem)
  9749  	// result: (MOVVstore [8] dst (MOVVload [8] src mem) (MOVVstore dst (MOVVload src mem) mem))
  9750  	for {
  9751  		if auxIntToInt64(v.AuxInt) != 16 {
  9752  			break
  9753  		}
  9754  		dst := v_0
  9755  		src := v_1
  9756  		mem := v_2
  9757  		v.reset(OpLOONG64MOVVstore)
  9758  		v.AuxInt = int32ToAuxInt(8)
  9759  		v0 := b.NewValue0(v.Pos, OpLOONG64MOVVload, typ.UInt64)
  9760  		v0.AuxInt = int32ToAuxInt(8)
  9761  		v0.AddArg2(src, mem)
  9762  		v1 := b.NewValue0(v.Pos, OpLOONG64MOVVstore, types.TypeMem)
  9763  		v2 := b.NewValue0(v.Pos, OpLOONG64MOVVload, typ.UInt64)
  9764  		v2.AddArg2(src, mem)
  9765  		v1.AddArg3(dst, v2, mem)
  9766  		v.AddArg3(dst, v0, v1)
  9767  		return true
  9768  	}
  9769  	// match: (Move [s] dst src mem)
  9770  	// cond: s > 16 && s < 192 && logLargeCopy(v, s)
  9771  	// result: (LoweredMove [s] dst src mem)
  9772  	for {
  9773  		s := auxIntToInt64(v.AuxInt)
  9774  		dst := v_0
  9775  		src := v_1
  9776  		mem := v_2
  9777  		if !(s > 16 && s < 192 && logLargeCopy(v, s)) {
  9778  			break
  9779  		}
  9780  		v.reset(OpLOONG64LoweredMove)
  9781  		v.AuxInt = int64ToAuxInt(s)
  9782  		v.AddArg3(dst, src, mem)
  9783  		return true
  9784  	}
  9785  	// match: (Move [s] dst src mem)
  9786  	// cond: s >= 192 && logLargeCopy(v, s)
  9787  	// result: (LoweredMoveLoop [s] dst src mem)
  9788  	for {
  9789  		s := auxIntToInt64(v.AuxInt)
  9790  		dst := v_0
  9791  		src := v_1
  9792  		mem := v_2
  9793  		if !(s >= 192 && logLargeCopy(v, s)) {
  9794  			break
  9795  		}
  9796  		v.reset(OpLOONG64LoweredMoveLoop)
  9797  		v.AuxInt = int64ToAuxInt(s)
  9798  		v.AddArg3(dst, src, mem)
  9799  		return true
  9800  	}
  9801  	return false
  9802  }
  9803  func rewriteValueLOONG64_OpNeq16(v *Value) bool {
  9804  	v_1 := v.Args[1]
  9805  	v_0 := v.Args[0]
  9806  	b := v.Block
  9807  	typ := &b.Func.Config.Types
  9808  	// match: (Neq16 x y)
  9809  	// result: (SGTU (XOR (ZeroExt16to32 x) (ZeroExt16to64 y)) (MOVVconst [0]))
  9810  	for {
  9811  		x := v_0
  9812  		y := v_1
  9813  		v.reset(OpLOONG64SGTU)
  9814  		v0 := b.NewValue0(v.Pos, OpLOONG64XOR, typ.UInt64)
  9815  		v1 := b.NewValue0(v.Pos, OpZeroExt16to32, typ.UInt32)
  9816  		v1.AddArg(x)
  9817  		v2 := b.NewValue0(v.Pos, OpZeroExt16to64, typ.UInt64)
  9818  		v2.AddArg(y)
  9819  		v0.AddArg2(v1, v2)
  9820  		v3 := b.NewValue0(v.Pos, OpLOONG64MOVVconst, typ.UInt64)
  9821  		v3.AuxInt = int64ToAuxInt(0)
  9822  		v.AddArg2(v0, v3)
  9823  		return true
  9824  	}
  9825  }
  9826  func rewriteValueLOONG64_OpNeq32(v *Value) bool {
  9827  	v_1 := v.Args[1]
  9828  	v_0 := v.Args[0]
  9829  	b := v.Block
  9830  	typ := &b.Func.Config.Types
  9831  	// match: (Neq32 x y)
  9832  	// result: (SGTU (XOR (ZeroExt32to64 x) (ZeroExt32to64 y)) (MOVVconst [0]))
  9833  	for {
  9834  		x := v_0
  9835  		y := v_1
  9836  		v.reset(OpLOONG64SGTU)
  9837  		v0 := b.NewValue0(v.Pos, OpLOONG64XOR, typ.UInt64)
  9838  		v1 := b.NewValue0(v.Pos, OpZeroExt32to64, typ.UInt64)
  9839  		v1.AddArg(x)
  9840  		v2 := b.NewValue0(v.Pos, OpZeroExt32to64, typ.UInt64)
  9841  		v2.AddArg(y)
  9842  		v0.AddArg2(v1, v2)
  9843  		v3 := b.NewValue0(v.Pos, OpLOONG64MOVVconst, typ.UInt64)
  9844  		v3.AuxInt = int64ToAuxInt(0)
  9845  		v.AddArg2(v0, v3)
  9846  		return true
  9847  	}
  9848  }
  9849  func rewriteValueLOONG64_OpNeq32F(v *Value) bool {
  9850  	v_1 := v.Args[1]
  9851  	v_0 := v.Args[0]
  9852  	b := v.Block
  9853  	// match: (Neq32F x y)
  9854  	// result: (FPFlagFalse (CMPEQF x y))
  9855  	for {
  9856  		x := v_0
  9857  		y := v_1
  9858  		v.reset(OpLOONG64FPFlagFalse)
  9859  		v0 := b.NewValue0(v.Pos, OpLOONG64CMPEQF, types.TypeFlags)
  9860  		v0.AddArg2(x, y)
  9861  		v.AddArg(v0)
  9862  		return true
  9863  	}
  9864  }
  9865  func rewriteValueLOONG64_OpNeq64(v *Value) bool {
  9866  	v_1 := v.Args[1]
  9867  	v_0 := v.Args[0]
  9868  	b := v.Block
  9869  	typ := &b.Func.Config.Types
  9870  	// match: (Neq64 x y)
  9871  	// result: (SGTU (XOR x y) (MOVVconst [0]))
  9872  	for {
  9873  		x := v_0
  9874  		y := v_1
  9875  		v.reset(OpLOONG64SGTU)
  9876  		v0 := b.NewValue0(v.Pos, OpLOONG64XOR, typ.UInt64)
  9877  		v0.AddArg2(x, y)
  9878  		v1 := b.NewValue0(v.Pos, OpLOONG64MOVVconst, typ.UInt64)
  9879  		v1.AuxInt = int64ToAuxInt(0)
  9880  		v.AddArg2(v0, v1)
  9881  		return true
  9882  	}
  9883  }
  9884  func rewriteValueLOONG64_OpNeq64F(v *Value) bool {
  9885  	v_1 := v.Args[1]
  9886  	v_0 := v.Args[0]
  9887  	b := v.Block
  9888  	// match: (Neq64F x y)
  9889  	// result: (FPFlagFalse (CMPEQD x y))
  9890  	for {
  9891  		x := v_0
  9892  		y := v_1
  9893  		v.reset(OpLOONG64FPFlagFalse)
  9894  		v0 := b.NewValue0(v.Pos, OpLOONG64CMPEQD, types.TypeFlags)
  9895  		v0.AddArg2(x, y)
  9896  		v.AddArg(v0)
  9897  		return true
  9898  	}
  9899  }
  9900  func rewriteValueLOONG64_OpNeq8(v *Value) bool {
  9901  	v_1 := v.Args[1]
  9902  	v_0 := v.Args[0]
  9903  	b := v.Block
  9904  	typ := &b.Func.Config.Types
  9905  	// match: (Neq8 x y)
  9906  	// result: (SGTU (XOR (ZeroExt8to64 x) (ZeroExt8to64 y)) (MOVVconst [0]))
  9907  	for {
  9908  		x := v_0
  9909  		y := v_1
  9910  		v.reset(OpLOONG64SGTU)
  9911  		v0 := b.NewValue0(v.Pos, OpLOONG64XOR, typ.UInt64)
  9912  		v1 := b.NewValue0(v.Pos, OpZeroExt8to64, typ.UInt64)
  9913  		v1.AddArg(x)
  9914  		v2 := b.NewValue0(v.Pos, OpZeroExt8to64, typ.UInt64)
  9915  		v2.AddArg(y)
  9916  		v0.AddArg2(v1, v2)
  9917  		v3 := b.NewValue0(v.Pos, OpLOONG64MOVVconst, typ.UInt64)
  9918  		v3.AuxInt = int64ToAuxInt(0)
  9919  		v.AddArg2(v0, v3)
  9920  		return true
  9921  	}
  9922  }
  9923  func rewriteValueLOONG64_OpNeqPtr(v *Value) bool {
  9924  	v_1 := v.Args[1]
  9925  	v_0 := v.Args[0]
  9926  	b := v.Block
  9927  	typ := &b.Func.Config.Types
  9928  	// match: (NeqPtr x y)
  9929  	// result: (SGTU (XOR x y) (MOVVconst [0]))
  9930  	for {
  9931  		x := v_0
  9932  		y := v_1
  9933  		v.reset(OpLOONG64SGTU)
  9934  		v0 := b.NewValue0(v.Pos, OpLOONG64XOR, typ.UInt64)
  9935  		v0.AddArg2(x, y)
  9936  		v1 := b.NewValue0(v.Pos, OpLOONG64MOVVconst, typ.UInt64)
  9937  		v1.AuxInt = int64ToAuxInt(0)
  9938  		v.AddArg2(v0, v1)
  9939  		return true
  9940  	}
  9941  }
  9942  func rewriteValueLOONG64_OpNot(v *Value) bool {
  9943  	v_0 := v.Args[0]
  9944  	// match: (Not x)
  9945  	// result: (XORconst [1] x)
  9946  	for {
  9947  		x := v_0
  9948  		v.reset(OpLOONG64XORconst)
  9949  		v.AuxInt = int64ToAuxInt(1)
  9950  		v.AddArg(x)
  9951  		return true
  9952  	}
  9953  }
  9954  func rewriteValueLOONG64_OpOffPtr(v *Value) bool {
  9955  	v_0 := v.Args[0]
  9956  	// match: (OffPtr [off] ptr:(SP))
  9957  	// result: (MOVVaddr [int32(off)] ptr)
  9958  	for {
  9959  		off := auxIntToInt64(v.AuxInt)
  9960  		ptr := v_0
  9961  		if ptr.Op != OpSP {
  9962  			break
  9963  		}
  9964  		v.reset(OpLOONG64MOVVaddr)
  9965  		v.AuxInt = int32ToAuxInt(int32(off))
  9966  		v.AddArg(ptr)
  9967  		return true
  9968  	}
  9969  	// match: (OffPtr [off] ptr)
  9970  	// result: (ADDVconst [off] ptr)
  9971  	for {
  9972  		off := auxIntToInt64(v.AuxInt)
  9973  		ptr := v_0
  9974  		v.reset(OpLOONG64ADDVconst)
  9975  		v.AuxInt = int64ToAuxInt(off)
  9976  		v.AddArg(ptr)
  9977  		return true
  9978  	}
  9979  }
  9980  func rewriteValueLOONG64_OpPopCount16(v *Value) bool {
  9981  	v_0 := v.Args[0]
  9982  	b := v.Block
  9983  	typ := &b.Func.Config.Types
  9984  	// match: (PopCount16 <t> x)
  9985  	// result: (MOVWfpgp <t> (VPCNT16 <typ.Float32> (MOVWgpfp <typ.Float32> (ZeroExt16to32 x))))
  9986  	for {
  9987  		t := v.Type
  9988  		x := v_0
  9989  		v.reset(OpLOONG64MOVWfpgp)
  9990  		v.Type = t
  9991  		v0 := b.NewValue0(v.Pos, OpLOONG64VPCNT16, typ.Float32)
  9992  		v1 := b.NewValue0(v.Pos, OpLOONG64MOVWgpfp, typ.Float32)
  9993  		v2 := b.NewValue0(v.Pos, OpZeroExt16to32, typ.UInt32)
  9994  		v2.AddArg(x)
  9995  		v1.AddArg(v2)
  9996  		v0.AddArg(v1)
  9997  		v.AddArg(v0)
  9998  		return true
  9999  	}
 10000  }
 10001  func rewriteValueLOONG64_OpPopCount32(v *Value) bool {
 10002  	v_0 := v.Args[0]
 10003  	b := v.Block
 10004  	typ := &b.Func.Config.Types
 10005  	// match: (PopCount32 <t> x)
 10006  	// result: (MOVWfpgp <t> (VPCNT32 <typ.Float32> (MOVWgpfp <typ.Float32> x)))
 10007  	for {
 10008  		t := v.Type
 10009  		x := v_0
 10010  		v.reset(OpLOONG64MOVWfpgp)
 10011  		v.Type = t
 10012  		v0 := b.NewValue0(v.Pos, OpLOONG64VPCNT32, typ.Float32)
 10013  		v1 := b.NewValue0(v.Pos, OpLOONG64MOVWgpfp, typ.Float32)
 10014  		v1.AddArg(x)
 10015  		v0.AddArg(v1)
 10016  		v.AddArg(v0)
 10017  		return true
 10018  	}
 10019  }
 10020  func rewriteValueLOONG64_OpPopCount64(v *Value) bool {
 10021  	v_0 := v.Args[0]
 10022  	b := v.Block
 10023  	typ := &b.Func.Config.Types
 10024  	// match: (PopCount64 <t> x)
 10025  	// result: (MOVVfpgp <t> (VPCNT64 <typ.Float64> (MOVVgpfp <typ.Float64> x)))
 10026  	for {
 10027  		t := v.Type
 10028  		x := v_0
 10029  		v.reset(OpLOONG64MOVVfpgp)
 10030  		v.Type = t
 10031  		v0 := b.NewValue0(v.Pos, OpLOONG64VPCNT64, typ.Float64)
 10032  		v1 := b.NewValue0(v.Pos, OpLOONG64MOVVgpfp, typ.Float64)
 10033  		v1.AddArg(x)
 10034  		v0.AddArg(v1)
 10035  		v.AddArg(v0)
 10036  		return true
 10037  	}
 10038  }
 10039  func rewriteValueLOONG64_OpPrefetchCache(v *Value) bool {
 10040  	v_1 := v.Args[1]
 10041  	v_0 := v.Args[0]
 10042  	// match: (PrefetchCache addr mem)
 10043  	// result: (PRELD addr mem [0])
 10044  	for {
 10045  		addr := v_0
 10046  		mem := v_1
 10047  		v.reset(OpLOONG64PRELD)
 10048  		v.AuxInt = int64ToAuxInt(0)
 10049  		v.AddArg2(addr, mem)
 10050  		return true
 10051  	}
 10052  }
 10053  func rewriteValueLOONG64_OpPrefetchCacheStreamed(v *Value) bool {
 10054  	v_1 := v.Args[1]
 10055  	v_0 := v.Args[0]
 10056  	// match: (PrefetchCacheStreamed addr mem)
 10057  	// result: (PRELDX addr mem [(((512 << 1) + (1 << 12)) << 5) + 2])
 10058  	for {
 10059  		addr := v_0
 10060  		mem := v_1
 10061  		v.reset(OpLOONG64PRELDX)
 10062  		v.AuxInt = int64ToAuxInt((((512 << 1) + (1 << 12)) << 5) + 2)
 10063  		v.AddArg2(addr, mem)
 10064  		return true
 10065  	}
 10066  }
 10067  func rewriteValueLOONG64_OpRotateLeft16(v *Value) bool {
 10068  	v_1 := v.Args[1]
 10069  	v_0 := v.Args[0]
 10070  	b := v.Block
 10071  	typ := &b.Func.Config.Types
 10072  	// match: (RotateLeft16 <t> x (MOVVconst [c]))
 10073  	// result: (Or16 (Lsh16x64 <t> x (MOVVconst [c&15])) (Rsh16Ux64 <t> x (MOVVconst [-c&15])))
 10074  	for {
 10075  		t := v.Type
 10076  		x := v_0
 10077  		if v_1.Op != OpLOONG64MOVVconst {
 10078  			break
 10079  		}
 10080  		c := auxIntToInt64(v_1.AuxInt)
 10081  		v.reset(OpOr16)
 10082  		v0 := b.NewValue0(v.Pos, OpLsh16x64, t)
 10083  		v1 := b.NewValue0(v.Pos, OpLOONG64MOVVconst, typ.UInt64)
 10084  		v1.AuxInt = int64ToAuxInt(c & 15)
 10085  		v0.AddArg2(x, v1)
 10086  		v2 := b.NewValue0(v.Pos, OpRsh16Ux64, t)
 10087  		v3 := b.NewValue0(v.Pos, OpLOONG64MOVVconst, typ.UInt64)
 10088  		v3.AuxInt = int64ToAuxInt(-c & 15)
 10089  		v2.AddArg2(x, v3)
 10090  		v.AddArg2(v0, v2)
 10091  		return true
 10092  	}
 10093  	// match: (RotateLeft16 <t> x y)
 10094  	// result: (ROTR <t> (OR <typ.UInt32> (ZeroExt16to32 x) (SLLVconst <t> (ZeroExt16to32 x) [16])) (NEGV <typ.Int64> y))
 10095  	for {
 10096  		t := v.Type
 10097  		x := v_0
 10098  		y := v_1
 10099  		v.reset(OpLOONG64ROTR)
 10100  		v.Type = t
 10101  		v0 := b.NewValue0(v.Pos, OpLOONG64OR, typ.UInt32)
 10102  		v1 := b.NewValue0(v.Pos, OpZeroExt16to32, typ.UInt32)
 10103  		v1.AddArg(x)
 10104  		v2 := b.NewValue0(v.Pos, OpLOONG64SLLVconst, t)
 10105  		v2.AuxInt = int64ToAuxInt(16)
 10106  		v2.AddArg(v1)
 10107  		v0.AddArg2(v1, v2)
 10108  		v3 := b.NewValue0(v.Pos, OpLOONG64NEGV, typ.Int64)
 10109  		v3.AddArg(y)
 10110  		v.AddArg2(v0, v3)
 10111  		return true
 10112  	}
 10113  }
 10114  func rewriteValueLOONG64_OpRotateLeft32(v *Value) bool {
 10115  	v_1 := v.Args[1]
 10116  	v_0 := v.Args[0]
 10117  	b := v.Block
 10118  	// match: (RotateLeft32 x y)
 10119  	// result: (ROTR x (NEGV <y.Type> y))
 10120  	for {
 10121  		x := v_0
 10122  		y := v_1
 10123  		v.reset(OpLOONG64ROTR)
 10124  		v0 := b.NewValue0(v.Pos, OpLOONG64NEGV, y.Type)
 10125  		v0.AddArg(y)
 10126  		v.AddArg2(x, v0)
 10127  		return true
 10128  	}
 10129  }
 10130  func rewriteValueLOONG64_OpRotateLeft64(v *Value) bool {
 10131  	v_1 := v.Args[1]
 10132  	v_0 := v.Args[0]
 10133  	b := v.Block
 10134  	// match: (RotateLeft64 x y)
 10135  	// result: (ROTRV x (NEGV <y.Type> y))
 10136  	for {
 10137  		x := v_0
 10138  		y := v_1
 10139  		v.reset(OpLOONG64ROTRV)
 10140  		v0 := b.NewValue0(v.Pos, OpLOONG64NEGV, y.Type)
 10141  		v0.AddArg(y)
 10142  		v.AddArg2(x, v0)
 10143  		return true
 10144  	}
 10145  }
 10146  func rewriteValueLOONG64_OpRotateLeft8(v *Value) bool {
 10147  	v_1 := v.Args[1]
 10148  	v_0 := v.Args[0]
 10149  	b := v.Block
 10150  	typ := &b.Func.Config.Types
 10151  	// match: (RotateLeft8 <t> x (MOVVconst [c]))
 10152  	// result: (Or8 (Lsh8x64 <t> x (MOVVconst [c&7])) (Rsh8Ux64 <t> x (MOVVconst [-c&7])))
 10153  	for {
 10154  		t := v.Type
 10155  		x := v_0
 10156  		if v_1.Op != OpLOONG64MOVVconst {
 10157  			break
 10158  		}
 10159  		c := auxIntToInt64(v_1.AuxInt)
 10160  		v.reset(OpOr8)
 10161  		v0 := b.NewValue0(v.Pos, OpLsh8x64, t)
 10162  		v1 := b.NewValue0(v.Pos, OpLOONG64MOVVconst, typ.UInt64)
 10163  		v1.AuxInt = int64ToAuxInt(c & 7)
 10164  		v0.AddArg2(x, v1)
 10165  		v2 := b.NewValue0(v.Pos, OpRsh8Ux64, t)
 10166  		v3 := b.NewValue0(v.Pos, OpLOONG64MOVVconst, typ.UInt64)
 10167  		v3.AuxInt = int64ToAuxInt(-c & 7)
 10168  		v2.AddArg2(x, v3)
 10169  		v.AddArg2(v0, v2)
 10170  		return true
 10171  	}
 10172  	// match: (RotateLeft8 <t> x y)
 10173  	// result: (OR <t> (SLLV <t> x (ANDconst <typ.Int64> [7] y)) (SRLV <t> (ZeroExt8to64 x) (ANDconst <typ.Int64> [7] (NEGV <typ.Int64> y))))
 10174  	for {
 10175  		t := v.Type
 10176  		x := v_0
 10177  		y := v_1
 10178  		v.reset(OpLOONG64OR)
 10179  		v.Type = t
 10180  		v0 := b.NewValue0(v.Pos, OpLOONG64SLLV, t)
 10181  		v1 := b.NewValue0(v.Pos, OpLOONG64ANDconst, typ.Int64)
 10182  		v1.AuxInt = int64ToAuxInt(7)
 10183  		v1.AddArg(y)
 10184  		v0.AddArg2(x, v1)
 10185  		v2 := b.NewValue0(v.Pos, OpLOONG64SRLV, t)
 10186  		v3 := b.NewValue0(v.Pos, OpZeroExt8to64, typ.UInt64)
 10187  		v3.AddArg(x)
 10188  		v4 := b.NewValue0(v.Pos, OpLOONG64ANDconst, typ.Int64)
 10189  		v4.AuxInt = int64ToAuxInt(7)
 10190  		v5 := b.NewValue0(v.Pos, OpLOONG64NEGV, typ.Int64)
 10191  		v5.AddArg(y)
 10192  		v4.AddArg(v5)
 10193  		v2.AddArg2(v3, v4)
 10194  		v.AddArg2(v0, v2)
 10195  		return true
 10196  	}
 10197  }
 10198  func rewriteValueLOONG64_OpRsh16Ux16(v *Value) bool {
 10199  	v_1 := v.Args[1]
 10200  	v_0 := v.Args[0]
 10201  	b := v.Block
 10202  	typ := &b.Func.Config.Types
 10203  	// match: (Rsh16Ux16 x y)
 10204  	// cond: shiftIsBounded(v)
 10205  	// result: (SRLV (ZeroExt16to64 x) y)
 10206  	for {
 10207  		x := v_0
 10208  		y := v_1
 10209  		if !(shiftIsBounded(v)) {
 10210  			break
 10211  		}
 10212  		v.reset(OpLOONG64SRLV)
 10213  		v0 := b.NewValue0(v.Pos, OpZeroExt16to64, typ.UInt64)
 10214  		v0.AddArg(x)
 10215  		v.AddArg2(v0, y)
 10216  		return true
 10217  	}
 10218  	// match: (Rsh16Ux16 <t> x y)
 10219  	// cond: !shiftIsBounded(v)
 10220  	// result: (MASKEQZ (SRLV <t> (ZeroExt16to64 x) (ZeroExt16to64 y)) (SGTU (MOVVconst <typ.UInt64> [64]) (ZeroExt16to64 y)))
 10221  	for {
 10222  		t := v.Type
 10223  		x := v_0
 10224  		y := v_1
 10225  		if !(!shiftIsBounded(v)) {
 10226  			break
 10227  		}
 10228  		v.reset(OpLOONG64MASKEQZ)
 10229  		v0 := b.NewValue0(v.Pos, OpLOONG64SRLV, t)
 10230  		v1 := b.NewValue0(v.Pos, OpZeroExt16to64, typ.UInt64)
 10231  		v1.AddArg(x)
 10232  		v2 := b.NewValue0(v.Pos, OpZeroExt16to64, typ.UInt64)
 10233  		v2.AddArg(y)
 10234  		v0.AddArg2(v1, v2)
 10235  		v3 := b.NewValue0(v.Pos, OpLOONG64SGTU, typ.Bool)
 10236  		v4 := b.NewValue0(v.Pos, OpLOONG64MOVVconst, typ.UInt64)
 10237  		v4.AuxInt = int64ToAuxInt(64)
 10238  		v3.AddArg2(v4, v2)
 10239  		v.AddArg2(v0, v3)
 10240  		return true
 10241  	}
 10242  	return false
 10243  }
 10244  func rewriteValueLOONG64_OpRsh16Ux32(v *Value) bool {
 10245  	v_1 := v.Args[1]
 10246  	v_0 := v.Args[0]
 10247  	b := v.Block
 10248  	typ := &b.Func.Config.Types
 10249  	// match: (Rsh16Ux32 x y)
 10250  	// cond: shiftIsBounded(v)
 10251  	// result: (SRLV (ZeroExt16to64 x) y)
 10252  	for {
 10253  		x := v_0
 10254  		y := v_1
 10255  		if !(shiftIsBounded(v)) {
 10256  			break
 10257  		}
 10258  		v.reset(OpLOONG64SRLV)
 10259  		v0 := b.NewValue0(v.Pos, OpZeroExt16to64, typ.UInt64)
 10260  		v0.AddArg(x)
 10261  		v.AddArg2(v0, y)
 10262  		return true
 10263  	}
 10264  	// match: (Rsh16Ux32 <t> x y)
 10265  	// cond: !shiftIsBounded(v)
 10266  	// result: (MASKEQZ (SRLV <t> (ZeroExt16to64 x) (ZeroExt32to64 y)) (SGTU (MOVVconst <typ.UInt64> [64]) (ZeroExt32to64 y)))
 10267  	for {
 10268  		t := v.Type
 10269  		x := v_0
 10270  		y := v_1
 10271  		if !(!shiftIsBounded(v)) {
 10272  			break
 10273  		}
 10274  		v.reset(OpLOONG64MASKEQZ)
 10275  		v0 := b.NewValue0(v.Pos, OpLOONG64SRLV, t)
 10276  		v1 := b.NewValue0(v.Pos, OpZeroExt16to64, typ.UInt64)
 10277  		v1.AddArg(x)
 10278  		v2 := b.NewValue0(v.Pos, OpZeroExt32to64, typ.UInt64)
 10279  		v2.AddArg(y)
 10280  		v0.AddArg2(v1, v2)
 10281  		v3 := b.NewValue0(v.Pos, OpLOONG64SGTU, typ.Bool)
 10282  		v4 := b.NewValue0(v.Pos, OpLOONG64MOVVconst, typ.UInt64)
 10283  		v4.AuxInt = int64ToAuxInt(64)
 10284  		v3.AddArg2(v4, v2)
 10285  		v.AddArg2(v0, v3)
 10286  		return true
 10287  	}
 10288  	return false
 10289  }
 10290  func rewriteValueLOONG64_OpRsh16Ux64(v *Value) bool {
 10291  	v_1 := v.Args[1]
 10292  	v_0 := v.Args[0]
 10293  	b := v.Block
 10294  	typ := &b.Func.Config.Types
 10295  	// match: (Rsh16Ux64 x y)
 10296  	// cond: shiftIsBounded(v)
 10297  	// result: (SRLV (ZeroExt16to64 x) y)
 10298  	for {
 10299  		x := v_0
 10300  		y := v_1
 10301  		if !(shiftIsBounded(v)) {
 10302  			break
 10303  		}
 10304  		v.reset(OpLOONG64SRLV)
 10305  		v0 := b.NewValue0(v.Pos, OpZeroExt16to64, typ.UInt64)
 10306  		v0.AddArg(x)
 10307  		v.AddArg2(v0, y)
 10308  		return true
 10309  	}
 10310  	// match: (Rsh16Ux64 <t> x y)
 10311  	// cond: !shiftIsBounded(v)
 10312  	// result: (MASKEQZ (SRLV <t> (ZeroExt16to64 x) y) (SGTU (MOVVconst <typ.UInt64> [64]) y))
 10313  	for {
 10314  		t := v.Type
 10315  		x := v_0
 10316  		y := v_1
 10317  		if !(!shiftIsBounded(v)) {
 10318  			break
 10319  		}
 10320  		v.reset(OpLOONG64MASKEQZ)
 10321  		v0 := b.NewValue0(v.Pos, OpLOONG64SRLV, t)
 10322  		v1 := b.NewValue0(v.Pos, OpZeroExt16to64, typ.UInt64)
 10323  		v1.AddArg(x)
 10324  		v0.AddArg2(v1, y)
 10325  		v2 := b.NewValue0(v.Pos, OpLOONG64SGTU, typ.Bool)
 10326  		v3 := b.NewValue0(v.Pos, OpLOONG64MOVVconst, typ.UInt64)
 10327  		v3.AuxInt = int64ToAuxInt(64)
 10328  		v2.AddArg2(v3, y)
 10329  		v.AddArg2(v0, v2)
 10330  		return true
 10331  	}
 10332  	return false
 10333  }
 10334  func rewriteValueLOONG64_OpRsh16Ux8(v *Value) bool {
 10335  	v_1 := v.Args[1]
 10336  	v_0 := v.Args[0]
 10337  	b := v.Block
 10338  	typ := &b.Func.Config.Types
 10339  	// match: (Rsh16Ux8 x y)
 10340  	// cond: shiftIsBounded(v)
 10341  	// result: (SRLV (ZeroExt16to64 x) y)
 10342  	for {
 10343  		x := v_0
 10344  		y := v_1
 10345  		if !(shiftIsBounded(v)) {
 10346  			break
 10347  		}
 10348  		v.reset(OpLOONG64SRLV)
 10349  		v0 := b.NewValue0(v.Pos, OpZeroExt16to64, typ.UInt64)
 10350  		v0.AddArg(x)
 10351  		v.AddArg2(v0, y)
 10352  		return true
 10353  	}
 10354  	// match: (Rsh16Ux8 <t> x y)
 10355  	// cond: !shiftIsBounded(v)
 10356  	// result: (MASKEQZ (SRLV <t> (ZeroExt16to64 x) (ZeroExt8to64 y)) (SGTU (MOVVconst <typ.UInt64> [64]) (ZeroExt8to64 y)))
 10357  	for {
 10358  		t := v.Type
 10359  		x := v_0
 10360  		y := v_1
 10361  		if !(!shiftIsBounded(v)) {
 10362  			break
 10363  		}
 10364  		v.reset(OpLOONG64MASKEQZ)
 10365  		v0 := b.NewValue0(v.Pos, OpLOONG64SRLV, t)
 10366  		v1 := b.NewValue0(v.Pos, OpZeroExt16to64, typ.UInt64)
 10367  		v1.AddArg(x)
 10368  		v2 := b.NewValue0(v.Pos, OpZeroExt8to64, typ.UInt64)
 10369  		v2.AddArg(y)
 10370  		v0.AddArg2(v1, v2)
 10371  		v3 := b.NewValue0(v.Pos, OpLOONG64SGTU, typ.Bool)
 10372  		v4 := b.NewValue0(v.Pos, OpLOONG64MOVVconst, typ.UInt64)
 10373  		v4.AuxInt = int64ToAuxInt(64)
 10374  		v3.AddArg2(v4, v2)
 10375  		v.AddArg2(v0, v3)
 10376  		return true
 10377  	}
 10378  	return false
 10379  }
 10380  func rewriteValueLOONG64_OpRsh16x16(v *Value) bool {
 10381  	v_1 := v.Args[1]
 10382  	v_0 := v.Args[0]
 10383  	b := v.Block
 10384  	typ := &b.Func.Config.Types
 10385  	// match: (Rsh16x16 x y)
 10386  	// cond: shiftIsBounded(v)
 10387  	// result: (SRAV (SignExt16to64 x) y)
 10388  	for {
 10389  		x := v_0
 10390  		y := v_1
 10391  		if !(shiftIsBounded(v)) {
 10392  			break
 10393  		}
 10394  		v.reset(OpLOONG64SRAV)
 10395  		v0 := b.NewValue0(v.Pos, OpSignExt16to64, typ.Int64)
 10396  		v0.AddArg(x)
 10397  		v.AddArg2(v0, y)
 10398  		return true
 10399  	}
 10400  	// match: (Rsh16x16 <t> x y)
 10401  	// cond: !shiftIsBounded(v)
 10402  	// result: (SRAV (SignExt16to64 x) (OR <t> (NEGV <t> (SGTU (ZeroExt16to64 y) (MOVVconst <typ.UInt64> [63]))) (ZeroExt16to64 y)))
 10403  	for {
 10404  		t := v.Type
 10405  		x := v_0
 10406  		y := v_1
 10407  		if !(!shiftIsBounded(v)) {
 10408  			break
 10409  		}
 10410  		v.reset(OpLOONG64SRAV)
 10411  		v0 := b.NewValue0(v.Pos, OpSignExt16to64, typ.Int64)
 10412  		v0.AddArg(x)
 10413  		v1 := b.NewValue0(v.Pos, OpLOONG64OR, t)
 10414  		v2 := b.NewValue0(v.Pos, OpLOONG64NEGV, t)
 10415  		v3 := b.NewValue0(v.Pos, OpLOONG64SGTU, typ.Bool)
 10416  		v4 := b.NewValue0(v.Pos, OpZeroExt16to64, typ.UInt64)
 10417  		v4.AddArg(y)
 10418  		v5 := b.NewValue0(v.Pos, OpLOONG64MOVVconst, typ.UInt64)
 10419  		v5.AuxInt = int64ToAuxInt(63)
 10420  		v3.AddArg2(v4, v5)
 10421  		v2.AddArg(v3)
 10422  		v1.AddArg2(v2, v4)
 10423  		v.AddArg2(v0, v1)
 10424  		return true
 10425  	}
 10426  	return false
 10427  }
 10428  func rewriteValueLOONG64_OpRsh16x32(v *Value) bool {
 10429  	v_1 := v.Args[1]
 10430  	v_0 := v.Args[0]
 10431  	b := v.Block
 10432  	typ := &b.Func.Config.Types
 10433  	// match: (Rsh16x32 x y)
 10434  	// cond: shiftIsBounded(v)
 10435  	// result: (SRAV (SignExt16to64 x) y)
 10436  	for {
 10437  		x := v_0
 10438  		y := v_1
 10439  		if !(shiftIsBounded(v)) {
 10440  			break
 10441  		}
 10442  		v.reset(OpLOONG64SRAV)
 10443  		v0 := b.NewValue0(v.Pos, OpSignExt16to64, typ.Int64)
 10444  		v0.AddArg(x)
 10445  		v.AddArg2(v0, y)
 10446  		return true
 10447  	}
 10448  	// match: (Rsh16x32 <t> x y)
 10449  	// cond: !shiftIsBounded(v)
 10450  	// result: (SRAV (SignExt16to64 x) (OR <t> (NEGV <t> (SGTU (ZeroExt32to64 y) (MOVVconst <typ.UInt64> [63]))) (ZeroExt32to64 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(OpLOONG64SRAV)
 10459  		v0 := b.NewValue0(v.Pos, OpSignExt16to64, typ.Int64)
 10460  		v0.AddArg(x)
 10461  		v1 := b.NewValue0(v.Pos, OpLOONG64OR, t)
 10462  		v2 := b.NewValue0(v.Pos, OpLOONG64NEGV, t)
 10463  		v3 := b.NewValue0(v.Pos, OpLOONG64SGTU, typ.Bool)
 10464  		v4 := b.NewValue0(v.Pos, OpZeroExt32to64, typ.UInt64)
 10465  		v4.AddArg(y)
 10466  		v5 := b.NewValue0(v.Pos, OpLOONG64MOVVconst, typ.UInt64)
 10467  		v5.AuxInt = int64ToAuxInt(63)
 10468  		v3.AddArg2(v4, v5)
 10469  		v2.AddArg(v3)
 10470  		v1.AddArg2(v2, v4)
 10471  		v.AddArg2(v0, v1)
 10472  		return true
 10473  	}
 10474  	return false
 10475  }
 10476  func rewriteValueLOONG64_OpRsh16x64(v *Value) bool {
 10477  	v_1 := v.Args[1]
 10478  	v_0 := v.Args[0]
 10479  	b := v.Block
 10480  	typ := &b.Func.Config.Types
 10481  	// match: (Rsh16x64 x y)
 10482  	// cond: shiftIsBounded(v)
 10483  	// result: (SRAV (SignExt16to64 x) y)
 10484  	for {
 10485  		x := v_0
 10486  		y := v_1
 10487  		if !(shiftIsBounded(v)) {
 10488  			break
 10489  		}
 10490  		v.reset(OpLOONG64SRAV)
 10491  		v0 := b.NewValue0(v.Pos, OpSignExt16to64, typ.Int64)
 10492  		v0.AddArg(x)
 10493  		v.AddArg2(v0, y)
 10494  		return true
 10495  	}
 10496  	// match: (Rsh16x64 <t> x y)
 10497  	// cond: !shiftIsBounded(v)
 10498  	// result: (SRAV (SignExt16to64 x) (OR <t> (NEGV <t> (SGTU y (MOVVconst <typ.UInt64> [63]))) y))
 10499  	for {
 10500  		t := v.Type
 10501  		x := v_0
 10502  		y := v_1
 10503  		if !(!shiftIsBounded(v)) {
 10504  			break
 10505  		}
 10506  		v.reset(OpLOONG64SRAV)
 10507  		v0 := b.NewValue0(v.Pos, OpSignExt16to64, typ.Int64)
 10508  		v0.AddArg(x)
 10509  		v1 := b.NewValue0(v.Pos, OpLOONG64OR, t)
 10510  		v2 := b.NewValue0(v.Pos, OpLOONG64NEGV, t)
 10511  		v3 := b.NewValue0(v.Pos, OpLOONG64SGTU, typ.Bool)
 10512  		v4 := b.NewValue0(v.Pos, OpLOONG64MOVVconst, typ.UInt64)
 10513  		v4.AuxInt = int64ToAuxInt(63)
 10514  		v3.AddArg2(y, v4)
 10515  		v2.AddArg(v3)
 10516  		v1.AddArg2(v2, y)
 10517  		v.AddArg2(v0, v1)
 10518  		return true
 10519  	}
 10520  	return false
 10521  }
 10522  func rewriteValueLOONG64_OpRsh16x8(v *Value) bool {
 10523  	v_1 := v.Args[1]
 10524  	v_0 := v.Args[0]
 10525  	b := v.Block
 10526  	typ := &b.Func.Config.Types
 10527  	// match: (Rsh16x8 x y)
 10528  	// cond: shiftIsBounded(v)
 10529  	// result: (SRAV (SignExt16to64 x) y)
 10530  	for {
 10531  		x := v_0
 10532  		y := v_1
 10533  		if !(shiftIsBounded(v)) {
 10534  			break
 10535  		}
 10536  		v.reset(OpLOONG64SRAV)
 10537  		v0 := b.NewValue0(v.Pos, OpSignExt16to64, typ.Int64)
 10538  		v0.AddArg(x)
 10539  		v.AddArg2(v0, y)
 10540  		return true
 10541  	}
 10542  	// match: (Rsh16x8 <t> x y)
 10543  	// cond: !shiftIsBounded(v)
 10544  	// result: (SRAV (SignExt16to64 x) (OR <t> (NEGV <t> (SGTU (ZeroExt8to64 y) (MOVVconst <typ.UInt64> [63]))) (ZeroExt8to64 y)))
 10545  	for {
 10546  		t := v.Type
 10547  		x := v_0
 10548  		y := v_1
 10549  		if !(!shiftIsBounded(v)) {
 10550  			break
 10551  		}
 10552  		v.reset(OpLOONG64SRAV)
 10553  		v0 := b.NewValue0(v.Pos, OpSignExt16to64, typ.Int64)
 10554  		v0.AddArg(x)
 10555  		v1 := b.NewValue0(v.Pos, OpLOONG64OR, t)
 10556  		v2 := b.NewValue0(v.Pos, OpLOONG64NEGV, t)
 10557  		v3 := b.NewValue0(v.Pos, OpLOONG64SGTU, typ.Bool)
 10558  		v4 := b.NewValue0(v.Pos, OpZeroExt8to64, typ.UInt64)
 10559  		v4.AddArg(y)
 10560  		v5 := b.NewValue0(v.Pos, OpLOONG64MOVVconst, typ.UInt64)
 10561  		v5.AuxInt = int64ToAuxInt(63)
 10562  		v3.AddArg2(v4, v5)
 10563  		v2.AddArg(v3)
 10564  		v1.AddArg2(v2, v4)
 10565  		v.AddArg2(v0, v1)
 10566  		return true
 10567  	}
 10568  	return false
 10569  }
 10570  func rewriteValueLOONG64_OpRsh32Ux16(v *Value) bool {
 10571  	v_1 := v.Args[1]
 10572  	v_0 := v.Args[0]
 10573  	b := v.Block
 10574  	typ := &b.Func.Config.Types
 10575  	// match: (Rsh32Ux16 x y)
 10576  	// cond: shiftIsBounded(v)
 10577  	// result: (SRL x y)
 10578  	for {
 10579  		x := v_0
 10580  		y := v_1
 10581  		if !(shiftIsBounded(v)) {
 10582  			break
 10583  		}
 10584  		v.reset(OpLOONG64SRL)
 10585  		v.AddArg2(x, y)
 10586  		return true
 10587  	}
 10588  	// match: (Rsh32Ux16 <t> x y)
 10589  	// cond: !shiftIsBounded(v)
 10590  	// result: (MASKEQZ (SRL <t> x (ZeroExt16to64 y)) (SGTU (MOVVconst <typ.UInt64> [32]) (ZeroExt16to64 y)))
 10591  	for {
 10592  		t := v.Type
 10593  		x := v_0
 10594  		y := v_1
 10595  		if !(!shiftIsBounded(v)) {
 10596  			break
 10597  		}
 10598  		v.reset(OpLOONG64MASKEQZ)
 10599  		v0 := b.NewValue0(v.Pos, OpLOONG64SRL, t)
 10600  		v1 := b.NewValue0(v.Pos, OpZeroExt16to64, typ.UInt64)
 10601  		v1.AddArg(y)
 10602  		v0.AddArg2(x, v1)
 10603  		v2 := b.NewValue0(v.Pos, OpLOONG64SGTU, typ.Bool)
 10604  		v3 := b.NewValue0(v.Pos, OpLOONG64MOVVconst, typ.UInt64)
 10605  		v3.AuxInt = int64ToAuxInt(32)
 10606  		v2.AddArg2(v3, v1)
 10607  		v.AddArg2(v0, v2)
 10608  		return true
 10609  	}
 10610  	return false
 10611  }
 10612  func rewriteValueLOONG64_OpRsh32Ux32(v *Value) bool {
 10613  	v_1 := v.Args[1]
 10614  	v_0 := v.Args[0]
 10615  	b := v.Block
 10616  	typ := &b.Func.Config.Types
 10617  	// match: (Rsh32Ux32 x y)
 10618  	// cond: shiftIsBounded(v)
 10619  	// result: (SRL x y)
 10620  	for {
 10621  		x := v_0
 10622  		y := v_1
 10623  		if !(shiftIsBounded(v)) {
 10624  			break
 10625  		}
 10626  		v.reset(OpLOONG64SRL)
 10627  		v.AddArg2(x, y)
 10628  		return true
 10629  	}
 10630  	// match: (Rsh32Ux32 <t> x y)
 10631  	// cond: !shiftIsBounded(v)
 10632  	// result: (MASKEQZ (SRL <t> x (ZeroExt32to64 y)) (SGTU (MOVVconst <typ.UInt64> [32]) (ZeroExt32to64 y)))
 10633  	for {
 10634  		t := v.Type
 10635  		x := v_0
 10636  		y := v_1
 10637  		if !(!shiftIsBounded(v)) {
 10638  			break
 10639  		}
 10640  		v.reset(OpLOONG64MASKEQZ)
 10641  		v0 := b.NewValue0(v.Pos, OpLOONG64SRL, t)
 10642  		v1 := b.NewValue0(v.Pos, OpZeroExt32to64, typ.UInt64)
 10643  		v1.AddArg(y)
 10644  		v0.AddArg2(x, v1)
 10645  		v2 := b.NewValue0(v.Pos, OpLOONG64SGTU, typ.Bool)
 10646  		v3 := b.NewValue0(v.Pos, OpLOONG64MOVVconst, typ.UInt64)
 10647  		v3.AuxInt = int64ToAuxInt(32)
 10648  		v2.AddArg2(v3, v1)
 10649  		v.AddArg2(v0, v2)
 10650  		return true
 10651  	}
 10652  	return false
 10653  }
 10654  func rewriteValueLOONG64_OpRsh32Ux64(v *Value) bool {
 10655  	v_1 := v.Args[1]
 10656  	v_0 := v.Args[0]
 10657  	b := v.Block
 10658  	typ := &b.Func.Config.Types
 10659  	// match: (Rsh32Ux64 x y)
 10660  	// cond: shiftIsBounded(v)
 10661  	// result: (SRL x y)
 10662  	for {
 10663  		x := v_0
 10664  		y := v_1
 10665  		if !(shiftIsBounded(v)) {
 10666  			break
 10667  		}
 10668  		v.reset(OpLOONG64SRL)
 10669  		v.AddArg2(x, y)
 10670  		return true
 10671  	}
 10672  	// match: (Rsh32Ux64 <t> x y)
 10673  	// cond: !shiftIsBounded(v)
 10674  	// result: (MASKEQZ (SRL <t> x y) (SGTU (MOVVconst <typ.UInt64> [32]) y))
 10675  	for {
 10676  		t := v.Type
 10677  		x := v_0
 10678  		y := v_1
 10679  		if !(!shiftIsBounded(v)) {
 10680  			break
 10681  		}
 10682  		v.reset(OpLOONG64MASKEQZ)
 10683  		v0 := b.NewValue0(v.Pos, OpLOONG64SRL, t)
 10684  		v0.AddArg2(x, y)
 10685  		v1 := b.NewValue0(v.Pos, OpLOONG64SGTU, typ.Bool)
 10686  		v2 := b.NewValue0(v.Pos, OpLOONG64MOVVconst, typ.UInt64)
 10687  		v2.AuxInt = int64ToAuxInt(32)
 10688  		v1.AddArg2(v2, y)
 10689  		v.AddArg2(v0, v1)
 10690  		return true
 10691  	}
 10692  	return false
 10693  }
 10694  func rewriteValueLOONG64_OpRsh32Ux8(v *Value) bool {
 10695  	v_1 := v.Args[1]
 10696  	v_0 := v.Args[0]
 10697  	b := v.Block
 10698  	typ := &b.Func.Config.Types
 10699  	// match: (Rsh32Ux8 x y)
 10700  	// cond: shiftIsBounded(v)
 10701  	// result: (SRL x y)
 10702  	for {
 10703  		x := v_0
 10704  		y := v_1
 10705  		if !(shiftIsBounded(v)) {
 10706  			break
 10707  		}
 10708  		v.reset(OpLOONG64SRL)
 10709  		v.AddArg2(x, y)
 10710  		return true
 10711  	}
 10712  	// match: (Rsh32Ux8 <t> x y)
 10713  	// cond: !shiftIsBounded(v)
 10714  	// result: (MASKEQZ (SRL <t> x (ZeroExt8to64 y)) (SGTU (MOVVconst <typ.UInt64> [32]) (ZeroExt8to64 y)))
 10715  	for {
 10716  		t := v.Type
 10717  		x := v_0
 10718  		y := v_1
 10719  		if !(!shiftIsBounded(v)) {
 10720  			break
 10721  		}
 10722  		v.reset(OpLOONG64MASKEQZ)
 10723  		v0 := b.NewValue0(v.Pos, OpLOONG64SRL, t)
 10724  		v1 := b.NewValue0(v.Pos, OpZeroExt8to64, typ.UInt64)
 10725  		v1.AddArg(y)
 10726  		v0.AddArg2(x, v1)
 10727  		v2 := b.NewValue0(v.Pos, OpLOONG64SGTU, typ.Bool)
 10728  		v3 := b.NewValue0(v.Pos, OpLOONG64MOVVconst, typ.UInt64)
 10729  		v3.AuxInt = int64ToAuxInt(32)
 10730  		v2.AddArg2(v3, v1)
 10731  		v.AddArg2(v0, v2)
 10732  		return true
 10733  	}
 10734  	return false
 10735  }
 10736  func rewriteValueLOONG64_OpRsh32x16(v *Value) bool {
 10737  	v_1 := v.Args[1]
 10738  	v_0 := v.Args[0]
 10739  	b := v.Block
 10740  	typ := &b.Func.Config.Types
 10741  	// match: (Rsh32x16 x y)
 10742  	// cond: shiftIsBounded(v)
 10743  	// result: (SRA x y)
 10744  	for {
 10745  		x := v_0
 10746  		y := v_1
 10747  		if !(shiftIsBounded(v)) {
 10748  			break
 10749  		}
 10750  		v.reset(OpLOONG64SRA)
 10751  		v.AddArg2(x, y)
 10752  		return true
 10753  	}
 10754  	// match: (Rsh32x16 <t> x y)
 10755  	// cond: !shiftIsBounded(v)
 10756  	// result: (SRA x (OR <t> (NEGV <t> (SGTU (ZeroExt16to64 y) (MOVVconst <typ.UInt64> [31]))) (ZeroExt16to64 y)))
 10757  	for {
 10758  		t := v.Type
 10759  		x := v_0
 10760  		y := v_1
 10761  		if !(!shiftIsBounded(v)) {
 10762  			break
 10763  		}
 10764  		v.reset(OpLOONG64SRA)
 10765  		v0 := b.NewValue0(v.Pos, OpLOONG64OR, t)
 10766  		v1 := b.NewValue0(v.Pos, OpLOONG64NEGV, t)
 10767  		v2 := b.NewValue0(v.Pos, OpLOONG64SGTU, typ.Bool)
 10768  		v3 := b.NewValue0(v.Pos, OpZeroExt16to64, typ.UInt64)
 10769  		v3.AddArg(y)
 10770  		v4 := b.NewValue0(v.Pos, OpLOONG64MOVVconst, typ.UInt64)
 10771  		v4.AuxInt = int64ToAuxInt(31)
 10772  		v2.AddArg2(v3, v4)
 10773  		v1.AddArg(v2)
 10774  		v0.AddArg2(v1, v3)
 10775  		v.AddArg2(x, v0)
 10776  		return true
 10777  	}
 10778  	return false
 10779  }
 10780  func rewriteValueLOONG64_OpRsh32x32(v *Value) bool {
 10781  	v_1 := v.Args[1]
 10782  	v_0 := v.Args[0]
 10783  	b := v.Block
 10784  	typ := &b.Func.Config.Types
 10785  	// match: (Rsh32x32 x y)
 10786  	// cond: shiftIsBounded(v)
 10787  	// result: (SRA x y)
 10788  	for {
 10789  		x := v_0
 10790  		y := v_1
 10791  		if !(shiftIsBounded(v)) {
 10792  			break
 10793  		}
 10794  		v.reset(OpLOONG64SRA)
 10795  		v.AddArg2(x, y)
 10796  		return true
 10797  	}
 10798  	// match: (Rsh32x32 <t> x y)
 10799  	// cond: !shiftIsBounded(v)
 10800  	// result: (SRA x (OR <t> (NEGV <t> (SGTU (ZeroExt32to64 y) (MOVVconst <typ.UInt64> [31]))) (ZeroExt32to64 y)))
 10801  	for {
 10802  		t := v.Type
 10803  		x := v_0
 10804  		y := v_1
 10805  		if !(!shiftIsBounded(v)) {
 10806  			break
 10807  		}
 10808  		v.reset(OpLOONG64SRA)
 10809  		v0 := b.NewValue0(v.Pos, OpLOONG64OR, t)
 10810  		v1 := b.NewValue0(v.Pos, OpLOONG64NEGV, t)
 10811  		v2 := b.NewValue0(v.Pos, OpLOONG64SGTU, typ.Bool)
 10812  		v3 := b.NewValue0(v.Pos, OpZeroExt32to64, typ.UInt64)
 10813  		v3.AddArg(y)
 10814  		v4 := b.NewValue0(v.Pos, OpLOONG64MOVVconst, typ.UInt64)
 10815  		v4.AuxInt = int64ToAuxInt(31)
 10816  		v2.AddArg2(v3, v4)
 10817  		v1.AddArg(v2)
 10818  		v0.AddArg2(v1, v3)
 10819  		v.AddArg2(x, v0)
 10820  		return true
 10821  	}
 10822  	return false
 10823  }
 10824  func rewriteValueLOONG64_OpRsh32x64(v *Value) bool {
 10825  	v_1 := v.Args[1]
 10826  	v_0 := v.Args[0]
 10827  	b := v.Block
 10828  	typ := &b.Func.Config.Types
 10829  	// match: (Rsh32x64 x y)
 10830  	// cond: shiftIsBounded(v)
 10831  	// result: (SRA x y)
 10832  	for {
 10833  		x := v_0
 10834  		y := v_1
 10835  		if !(shiftIsBounded(v)) {
 10836  			break
 10837  		}
 10838  		v.reset(OpLOONG64SRA)
 10839  		v.AddArg2(x, y)
 10840  		return true
 10841  	}
 10842  	// match: (Rsh32x64 <t> x y)
 10843  	// cond: !shiftIsBounded(v)
 10844  	// result: (SRA x (OR <t> (NEGV <t> (SGTU y (MOVVconst <typ.UInt64> [31]))) y))
 10845  	for {
 10846  		t := v.Type
 10847  		x := v_0
 10848  		y := v_1
 10849  		if !(!shiftIsBounded(v)) {
 10850  			break
 10851  		}
 10852  		v.reset(OpLOONG64SRA)
 10853  		v0 := b.NewValue0(v.Pos, OpLOONG64OR, t)
 10854  		v1 := b.NewValue0(v.Pos, OpLOONG64NEGV, t)
 10855  		v2 := b.NewValue0(v.Pos, OpLOONG64SGTU, typ.Bool)
 10856  		v3 := b.NewValue0(v.Pos, OpLOONG64MOVVconst, typ.UInt64)
 10857  		v3.AuxInt = int64ToAuxInt(31)
 10858  		v2.AddArg2(y, v3)
 10859  		v1.AddArg(v2)
 10860  		v0.AddArg2(v1, y)
 10861  		v.AddArg2(x, v0)
 10862  		return true
 10863  	}
 10864  	return false
 10865  }
 10866  func rewriteValueLOONG64_OpRsh32x8(v *Value) bool {
 10867  	v_1 := v.Args[1]
 10868  	v_0 := v.Args[0]
 10869  	b := v.Block
 10870  	typ := &b.Func.Config.Types
 10871  	// match: (Rsh32x8 x y)
 10872  	// cond: shiftIsBounded(v)
 10873  	// result: (SRA x y)
 10874  	for {
 10875  		x := v_0
 10876  		y := v_1
 10877  		if !(shiftIsBounded(v)) {
 10878  			break
 10879  		}
 10880  		v.reset(OpLOONG64SRA)
 10881  		v.AddArg2(x, y)
 10882  		return true
 10883  	}
 10884  	// match: (Rsh32x8 <t> x y)
 10885  	// cond: !shiftIsBounded(v)
 10886  	// result: (SRA x (OR <t> (NEGV <t> (SGTU (ZeroExt8to64 y) (MOVVconst <typ.UInt64> [31]))) (ZeroExt8to64 y)))
 10887  	for {
 10888  		t := v.Type
 10889  		x := v_0
 10890  		y := v_1
 10891  		if !(!shiftIsBounded(v)) {
 10892  			break
 10893  		}
 10894  		v.reset(OpLOONG64SRA)
 10895  		v0 := b.NewValue0(v.Pos, OpLOONG64OR, t)
 10896  		v1 := b.NewValue0(v.Pos, OpLOONG64NEGV, t)
 10897  		v2 := b.NewValue0(v.Pos, OpLOONG64SGTU, typ.Bool)
 10898  		v3 := b.NewValue0(v.Pos, OpZeroExt8to64, typ.UInt64)
 10899  		v3.AddArg(y)
 10900  		v4 := b.NewValue0(v.Pos, OpLOONG64MOVVconst, typ.UInt64)
 10901  		v4.AuxInt = int64ToAuxInt(31)
 10902  		v2.AddArg2(v3, v4)
 10903  		v1.AddArg(v2)
 10904  		v0.AddArg2(v1, v3)
 10905  		v.AddArg2(x, v0)
 10906  		return true
 10907  	}
 10908  	return false
 10909  }
 10910  func rewriteValueLOONG64_OpRsh64Ux16(v *Value) bool {
 10911  	v_1 := v.Args[1]
 10912  	v_0 := v.Args[0]
 10913  	b := v.Block
 10914  	typ := &b.Func.Config.Types
 10915  	// match: (Rsh64Ux16 x y)
 10916  	// cond: shiftIsBounded(v)
 10917  	// result: (SRLV x y)
 10918  	for {
 10919  		x := v_0
 10920  		y := v_1
 10921  		if !(shiftIsBounded(v)) {
 10922  			break
 10923  		}
 10924  		v.reset(OpLOONG64SRLV)
 10925  		v.AddArg2(x, y)
 10926  		return true
 10927  	}
 10928  	// match: (Rsh64Ux16 <t> x y)
 10929  	// cond: !shiftIsBounded(v)
 10930  	// result: (MASKEQZ (SRLV <t> x (ZeroExt16to64 y)) (SGTU (MOVVconst <typ.UInt64> [64]) (ZeroExt16to64 y)))
 10931  	for {
 10932  		t := v.Type
 10933  		x := v_0
 10934  		y := v_1
 10935  		if !(!shiftIsBounded(v)) {
 10936  			break
 10937  		}
 10938  		v.reset(OpLOONG64MASKEQZ)
 10939  		v0 := b.NewValue0(v.Pos, OpLOONG64SRLV, t)
 10940  		v1 := b.NewValue0(v.Pos, OpZeroExt16to64, typ.UInt64)
 10941  		v1.AddArg(y)
 10942  		v0.AddArg2(x, v1)
 10943  		v2 := b.NewValue0(v.Pos, OpLOONG64SGTU, typ.Bool)
 10944  		v3 := b.NewValue0(v.Pos, OpLOONG64MOVVconst, typ.UInt64)
 10945  		v3.AuxInt = int64ToAuxInt(64)
 10946  		v2.AddArg2(v3, v1)
 10947  		v.AddArg2(v0, v2)
 10948  		return true
 10949  	}
 10950  	return false
 10951  }
 10952  func rewriteValueLOONG64_OpRsh64Ux32(v *Value) bool {
 10953  	v_1 := v.Args[1]
 10954  	v_0 := v.Args[0]
 10955  	b := v.Block
 10956  	typ := &b.Func.Config.Types
 10957  	// match: (Rsh64Ux32 x y)
 10958  	// cond: shiftIsBounded(v)
 10959  	// result: (SRLV x y)
 10960  	for {
 10961  		x := v_0
 10962  		y := v_1
 10963  		if !(shiftIsBounded(v)) {
 10964  			break
 10965  		}
 10966  		v.reset(OpLOONG64SRLV)
 10967  		v.AddArg2(x, y)
 10968  		return true
 10969  	}
 10970  	// match: (Rsh64Ux32 <t> x y)
 10971  	// cond: !shiftIsBounded(v)
 10972  	// result: (MASKEQZ (SRLV <t> x (ZeroExt32to64 y)) (SGTU (MOVVconst <typ.UInt64> [64]) (ZeroExt32to64 y)))
 10973  	for {
 10974  		t := v.Type
 10975  		x := v_0
 10976  		y := v_1
 10977  		if !(!shiftIsBounded(v)) {
 10978  			break
 10979  		}
 10980  		v.reset(OpLOONG64MASKEQZ)
 10981  		v0 := b.NewValue0(v.Pos, OpLOONG64SRLV, t)
 10982  		v1 := b.NewValue0(v.Pos, OpZeroExt32to64, typ.UInt64)
 10983  		v1.AddArg(y)
 10984  		v0.AddArg2(x, v1)
 10985  		v2 := b.NewValue0(v.Pos, OpLOONG64SGTU, typ.Bool)
 10986  		v3 := b.NewValue0(v.Pos, OpLOONG64MOVVconst, typ.UInt64)
 10987  		v3.AuxInt = int64ToAuxInt(64)
 10988  		v2.AddArg2(v3, v1)
 10989  		v.AddArg2(v0, v2)
 10990  		return true
 10991  	}
 10992  	return false
 10993  }
 10994  func rewriteValueLOONG64_OpRsh64Ux64(v *Value) bool {
 10995  	v_1 := v.Args[1]
 10996  	v_0 := v.Args[0]
 10997  	b := v.Block
 10998  	typ := &b.Func.Config.Types
 10999  	// match: (Rsh64Ux64 x y)
 11000  	// cond: shiftIsBounded(v)
 11001  	// result: (SRLV x y)
 11002  	for {
 11003  		x := v_0
 11004  		y := v_1
 11005  		if !(shiftIsBounded(v)) {
 11006  			break
 11007  		}
 11008  		v.reset(OpLOONG64SRLV)
 11009  		v.AddArg2(x, y)
 11010  		return true
 11011  	}
 11012  	// match: (Rsh64Ux64 <t> x y)
 11013  	// cond: !shiftIsBounded(v)
 11014  	// result: (MASKEQZ (SRLV <t> x y) (SGTU (MOVVconst <typ.UInt64> [64]) y))
 11015  	for {
 11016  		t := v.Type
 11017  		x := v_0
 11018  		y := v_1
 11019  		if !(!shiftIsBounded(v)) {
 11020  			break
 11021  		}
 11022  		v.reset(OpLOONG64MASKEQZ)
 11023  		v0 := b.NewValue0(v.Pos, OpLOONG64SRLV, t)
 11024  		v0.AddArg2(x, y)
 11025  		v1 := b.NewValue0(v.Pos, OpLOONG64SGTU, typ.Bool)
 11026  		v2 := b.NewValue0(v.Pos, OpLOONG64MOVVconst, typ.UInt64)
 11027  		v2.AuxInt = int64ToAuxInt(64)
 11028  		v1.AddArg2(v2, y)
 11029  		v.AddArg2(v0, v1)
 11030  		return true
 11031  	}
 11032  	return false
 11033  }
 11034  func rewriteValueLOONG64_OpRsh64Ux8(v *Value) bool {
 11035  	v_1 := v.Args[1]
 11036  	v_0 := v.Args[0]
 11037  	b := v.Block
 11038  	typ := &b.Func.Config.Types
 11039  	// match: (Rsh64Ux8 x y)
 11040  	// cond: shiftIsBounded(v)
 11041  	// result: (SRLV x y)
 11042  	for {
 11043  		x := v_0
 11044  		y := v_1
 11045  		if !(shiftIsBounded(v)) {
 11046  			break
 11047  		}
 11048  		v.reset(OpLOONG64SRLV)
 11049  		v.AddArg2(x, y)
 11050  		return true
 11051  	}
 11052  	// match: (Rsh64Ux8 <t> x y)
 11053  	// cond: !shiftIsBounded(v)
 11054  	// result: (MASKEQZ (SRLV <t> x (ZeroExt8to64 y)) (SGTU (MOVVconst <typ.UInt64> [64]) (ZeroExt8to64 y)))
 11055  	for {
 11056  		t := v.Type
 11057  		x := v_0
 11058  		y := v_1
 11059  		if !(!shiftIsBounded(v)) {
 11060  			break
 11061  		}
 11062  		v.reset(OpLOONG64MASKEQZ)
 11063  		v0 := b.NewValue0(v.Pos, OpLOONG64SRLV, t)
 11064  		v1 := b.NewValue0(v.Pos, OpZeroExt8to64, typ.UInt64)
 11065  		v1.AddArg(y)
 11066  		v0.AddArg2(x, v1)
 11067  		v2 := b.NewValue0(v.Pos, OpLOONG64SGTU, typ.Bool)
 11068  		v3 := b.NewValue0(v.Pos, OpLOONG64MOVVconst, typ.UInt64)
 11069  		v3.AuxInt = int64ToAuxInt(64)
 11070  		v2.AddArg2(v3, v1)
 11071  		v.AddArg2(v0, v2)
 11072  		return true
 11073  	}
 11074  	return false
 11075  }
 11076  func rewriteValueLOONG64_OpRsh64x16(v *Value) bool {
 11077  	v_1 := v.Args[1]
 11078  	v_0 := v.Args[0]
 11079  	b := v.Block
 11080  	typ := &b.Func.Config.Types
 11081  	// match: (Rsh64x16 x y)
 11082  	// cond: shiftIsBounded(v)
 11083  	// result: (SRAV x y)
 11084  	for {
 11085  		x := v_0
 11086  		y := v_1
 11087  		if !(shiftIsBounded(v)) {
 11088  			break
 11089  		}
 11090  		v.reset(OpLOONG64SRAV)
 11091  		v.AddArg2(x, y)
 11092  		return true
 11093  	}
 11094  	// match: (Rsh64x16 <t> x y)
 11095  	// cond: !shiftIsBounded(v)
 11096  	// result: (SRAV x (OR <t> (NEGV <t> (SGTU (ZeroExt16to64 y) (MOVVconst <typ.UInt64> [63]))) (ZeroExt16to64 y)))
 11097  	for {
 11098  		t := v.Type
 11099  		x := v_0
 11100  		y := v_1
 11101  		if !(!shiftIsBounded(v)) {
 11102  			break
 11103  		}
 11104  		v.reset(OpLOONG64SRAV)
 11105  		v0 := b.NewValue0(v.Pos, OpLOONG64OR, t)
 11106  		v1 := b.NewValue0(v.Pos, OpLOONG64NEGV, t)
 11107  		v2 := b.NewValue0(v.Pos, OpLOONG64SGTU, typ.Bool)
 11108  		v3 := b.NewValue0(v.Pos, OpZeroExt16to64, typ.UInt64)
 11109  		v3.AddArg(y)
 11110  		v4 := b.NewValue0(v.Pos, OpLOONG64MOVVconst, typ.UInt64)
 11111  		v4.AuxInt = int64ToAuxInt(63)
 11112  		v2.AddArg2(v3, v4)
 11113  		v1.AddArg(v2)
 11114  		v0.AddArg2(v1, v3)
 11115  		v.AddArg2(x, v0)
 11116  		return true
 11117  	}
 11118  	return false
 11119  }
 11120  func rewriteValueLOONG64_OpRsh64x32(v *Value) bool {
 11121  	v_1 := v.Args[1]
 11122  	v_0 := v.Args[0]
 11123  	b := v.Block
 11124  	typ := &b.Func.Config.Types
 11125  	// match: (Rsh64x32 x y)
 11126  	// cond: shiftIsBounded(v)
 11127  	// result: (SRAV x y)
 11128  	for {
 11129  		x := v_0
 11130  		y := v_1
 11131  		if !(shiftIsBounded(v)) {
 11132  			break
 11133  		}
 11134  		v.reset(OpLOONG64SRAV)
 11135  		v.AddArg2(x, y)
 11136  		return true
 11137  	}
 11138  	// match: (Rsh64x32 <t> x y)
 11139  	// cond: !shiftIsBounded(v)
 11140  	// result: (SRAV x (OR <t> (NEGV <t> (SGTU (ZeroExt32to64 y) (MOVVconst <typ.UInt64> [63]))) (ZeroExt32to64 y)))
 11141  	for {
 11142  		t := v.Type
 11143  		x := v_0
 11144  		y := v_1
 11145  		if !(!shiftIsBounded(v)) {
 11146  			break
 11147  		}
 11148  		v.reset(OpLOONG64SRAV)
 11149  		v0 := b.NewValue0(v.Pos, OpLOONG64OR, t)
 11150  		v1 := b.NewValue0(v.Pos, OpLOONG64NEGV, t)
 11151  		v2 := b.NewValue0(v.Pos, OpLOONG64SGTU, typ.Bool)
 11152  		v3 := b.NewValue0(v.Pos, OpZeroExt32to64, typ.UInt64)
 11153  		v3.AddArg(y)
 11154  		v4 := b.NewValue0(v.Pos, OpLOONG64MOVVconst, typ.UInt64)
 11155  		v4.AuxInt = int64ToAuxInt(63)
 11156  		v2.AddArg2(v3, v4)
 11157  		v1.AddArg(v2)
 11158  		v0.AddArg2(v1, v3)
 11159  		v.AddArg2(x, v0)
 11160  		return true
 11161  	}
 11162  	return false
 11163  }
 11164  func rewriteValueLOONG64_OpRsh64x64(v *Value) bool {
 11165  	v_1 := v.Args[1]
 11166  	v_0 := v.Args[0]
 11167  	b := v.Block
 11168  	typ := &b.Func.Config.Types
 11169  	// match: (Rsh64x64 x y)
 11170  	// cond: shiftIsBounded(v)
 11171  	// result: (SRAV x y)
 11172  	for {
 11173  		x := v_0
 11174  		y := v_1
 11175  		if !(shiftIsBounded(v)) {
 11176  			break
 11177  		}
 11178  		v.reset(OpLOONG64SRAV)
 11179  		v.AddArg2(x, y)
 11180  		return true
 11181  	}
 11182  	// match: (Rsh64x64 <t> x y)
 11183  	// cond: !shiftIsBounded(v)
 11184  	// result: (SRAV x (OR <t> (NEGV <t> (SGTU y (MOVVconst <typ.UInt64> [63]))) y))
 11185  	for {
 11186  		t := v.Type
 11187  		x := v_0
 11188  		y := v_1
 11189  		if !(!shiftIsBounded(v)) {
 11190  			break
 11191  		}
 11192  		v.reset(OpLOONG64SRAV)
 11193  		v0 := b.NewValue0(v.Pos, OpLOONG64OR, t)
 11194  		v1 := b.NewValue0(v.Pos, OpLOONG64NEGV, t)
 11195  		v2 := b.NewValue0(v.Pos, OpLOONG64SGTU, typ.Bool)
 11196  		v3 := b.NewValue0(v.Pos, OpLOONG64MOVVconst, typ.UInt64)
 11197  		v3.AuxInt = int64ToAuxInt(63)
 11198  		v2.AddArg2(y, v3)
 11199  		v1.AddArg(v2)
 11200  		v0.AddArg2(v1, y)
 11201  		v.AddArg2(x, v0)
 11202  		return true
 11203  	}
 11204  	return false
 11205  }
 11206  func rewriteValueLOONG64_OpRsh64x8(v *Value) bool {
 11207  	v_1 := v.Args[1]
 11208  	v_0 := v.Args[0]
 11209  	b := v.Block
 11210  	typ := &b.Func.Config.Types
 11211  	// match: (Rsh64x8 x y)
 11212  	// cond: shiftIsBounded(v)
 11213  	// result: (SRAV x y)
 11214  	for {
 11215  		x := v_0
 11216  		y := v_1
 11217  		if !(shiftIsBounded(v)) {
 11218  			break
 11219  		}
 11220  		v.reset(OpLOONG64SRAV)
 11221  		v.AddArg2(x, y)
 11222  		return true
 11223  	}
 11224  	// match: (Rsh64x8 <t> x y)
 11225  	// cond: !shiftIsBounded(v)
 11226  	// result: (SRAV x (OR <t> (NEGV <t> (SGTU (ZeroExt8to64 y) (MOVVconst <typ.UInt64> [63]))) (ZeroExt8to64 y)))
 11227  	for {
 11228  		t := v.Type
 11229  		x := v_0
 11230  		y := v_1
 11231  		if !(!shiftIsBounded(v)) {
 11232  			break
 11233  		}
 11234  		v.reset(OpLOONG64SRAV)
 11235  		v0 := b.NewValue0(v.Pos, OpLOONG64OR, t)
 11236  		v1 := b.NewValue0(v.Pos, OpLOONG64NEGV, t)
 11237  		v2 := b.NewValue0(v.Pos, OpLOONG64SGTU, typ.Bool)
 11238  		v3 := b.NewValue0(v.Pos, OpZeroExt8to64, typ.UInt64)
 11239  		v3.AddArg(y)
 11240  		v4 := b.NewValue0(v.Pos, OpLOONG64MOVVconst, typ.UInt64)
 11241  		v4.AuxInt = int64ToAuxInt(63)
 11242  		v2.AddArg2(v3, v4)
 11243  		v1.AddArg(v2)
 11244  		v0.AddArg2(v1, v3)
 11245  		v.AddArg2(x, v0)
 11246  		return true
 11247  	}
 11248  	return false
 11249  }
 11250  func rewriteValueLOONG64_OpRsh8Ux16(v *Value) bool {
 11251  	v_1 := v.Args[1]
 11252  	v_0 := v.Args[0]
 11253  	b := v.Block
 11254  	typ := &b.Func.Config.Types
 11255  	// match: (Rsh8Ux16 x y)
 11256  	// cond: shiftIsBounded(v)
 11257  	// result: (SRLV (ZeroExt8to64 x) y)
 11258  	for {
 11259  		x := v_0
 11260  		y := v_1
 11261  		if !(shiftIsBounded(v)) {
 11262  			break
 11263  		}
 11264  		v.reset(OpLOONG64SRLV)
 11265  		v0 := b.NewValue0(v.Pos, OpZeroExt8to64, typ.UInt64)
 11266  		v0.AddArg(x)
 11267  		v.AddArg2(v0, y)
 11268  		return true
 11269  	}
 11270  	// match: (Rsh8Ux16 <t> x y)
 11271  	// cond: !shiftIsBounded(v)
 11272  	// result: (MASKEQZ (SRLV <t> (ZeroExt8to64 x) (ZeroExt16to64 y)) (SGTU (MOVVconst <typ.UInt64> [64]) (ZeroExt16to64 y)))
 11273  	for {
 11274  		t := v.Type
 11275  		x := v_0
 11276  		y := v_1
 11277  		if !(!shiftIsBounded(v)) {
 11278  			break
 11279  		}
 11280  		v.reset(OpLOONG64MASKEQZ)
 11281  		v0 := b.NewValue0(v.Pos, OpLOONG64SRLV, t)
 11282  		v1 := b.NewValue0(v.Pos, OpZeroExt8to64, typ.UInt64)
 11283  		v1.AddArg(x)
 11284  		v2 := b.NewValue0(v.Pos, OpZeroExt16to64, typ.UInt64)
 11285  		v2.AddArg(y)
 11286  		v0.AddArg2(v1, v2)
 11287  		v3 := b.NewValue0(v.Pos, OpLOONG64SGTU, typ.Bool)
 11288  		v4 := b.NewValue0(v.Pos, OpLOONG64MOVVconst, typ.UInt64)
 11289  		v4.AuxInt = int64ToAuxInt(64)
 11290  		v3.AddArg2(v4, v2)
 11291  		v.AddArg2(v0, v3)
 11292  		return true
 11293  	}
 11294  	return false
 11295  }
 11296  func rewriteValueLOONG64_OpRsh8Ux32(v *Value) bool {
 11297  	v_1 := v.Args[1]
 11298  	v_0 := v.Args[0]
 11299  	b := v.Block
 11300  	typ := &b.Func.Config.Types
 11301  	// match: (Rsh8Ux32 x y)
 11302  	// cond: shiftIsBounded(v)
 11303  	// result: (SRLV (ZeroExt8to64 x) y)
 11304  	for {
 11305  		x := v_0
 11306  		y := v_1
 11307  		if !(shiftIsBounded(v)) {
 11308  			break
 11309  		}
 11310  		v.reset(OpLOONG64SRLV)
 11311  		v0 := b.NewValue0(v.Pos, OpZeroExt8to64, typ.UInt64)
 11312  		v0.AddArg(x)
 11313  		v.AddArg2(v0, y)
 11314  		return true
 11315  	}
 11316  	// match: (Rsh8Ux32 <t> x y)
 11317  	// cond: !shiftIsBounded(v)
 11318  	// result: (MASKEQZ (SRLV <t> (ZeroExt8to64 x) (ZeroExt32to64 y)) (SGTU (MOVVconst <typ.UInt64> [64]) (ZeroExt32to64 y)))
 11319  	for {
 11320  		t := v.Type
 11321  		x := v_0
 11322  		y := v_1
 11323  		if !(!shiftIsBounded(v)) {
 11324  			break
 11325  		}
 11326  		v.reset(OpLOONG64MASKEQZ)
 11327  		v0 := b.NewValue0(v.Pos, OpLOONG64SRLV, t)
 11328  		v1 := b.NewValue0(v.Pos, OpZeroExt8to64, typ.UInt64)
 11329  		v1.AddArg(x)
 11330  		v2 := b.NewValue0(v.Pos, OpZeroExt32to64, typ.UInt64)
 11331  		v2.AddArg(y)
 11332  		v0.AddArg2(v1, v2)
 11333  		v3 := b.NewValue0(v.Pos, OpLOONG64SGTU, typ.Bool)
 11334  		v4 := b.NewValue0(v.Pos, OpLOONG64MOVVconst, typ.UInt64)
 11335  		v4.AuxInt = int64ToAuxInt(64)
 11336  		v3.AddArg2(v4, v2)
 11337  		v.AddArg2(v0, v3)
 11338  		return true
 11339  	}
 11340  	return false
 11341  }
 11342  func rewriteValueLOONG64_OpRsh8Ux64(v *Value) bool {
 11343  	v_1 := v.Args[1]
 11344  	v_0 := v.Args[0]
 11345  	b := v.Block
 11346  	typ := &b.Func.Config.Types
 11347  	// match: (Rsh8Ux64 x y)
 11348  	// cond: shiftIsBounded(v)
 11349  	// result: (SRLV (ZeroExt8to64 x) y)
 11350  	for {
 11351  		x := v_0
 11352  		y := v_1
 11353  		if !(shiftIsBounded(v)) {
 11354  			break
 11355  		}
 11356  		v.reset(OpLOONG64SRLV)
 11357  		v0 := b.NewValue0(v.Pos, OpZeroExt8to64, typ.UInt64)
 11358  		v0.AddArg(x)
 11359  		v.AddArg2(v0, y)
 11360  		return true
 11361  	}
 11362  	// match: (Rsh8Ux64 <t> x y)
 11363  	// cond: !shiftIsBounded(v)
 11364  	// result: (MASKEQZ (SRLV <t> (ZeroExt8to64 x) y) (SGTU (MOVVconst <typ.UInt64> [64]) y))
 11365  	for {
 11366  		t := v.Type
 11367  		x := v_0
 11368  		y := v_1
 11369  		if !(!shiftIsBounded(v)) {
 11370  			break
 11371  		}
 11372  		v.reset(OpLOONG64MASKEQZ)
 11373  		v0 := b.NewValue0(v.Pos, OpLOONG64SRLV, t)
 11374  		v1 := b.NewValue0(v.Pos, OpZeroExt8to64, typ.UInt64)
 11375  		v1.AddArg(x)
 11376  		v0.AddArg2(v1, y)
 11377  		v2 := b.NewValue0(v.Pos, OpLOONG64SGTU, typ.Bool)
 11378  		v3 := b.NewValue0(v.Pos, OpLOONG64MOVVconst, typ.UInt64)
 11379  		v3.AuxInt = int64ToAuxInt(64)
 11380  		v2.AddArg2(v3, y)
 11381  		v.AddArg2(v0, v2)
 11382  		return true
 11383  	}
 11384  	return false
 11385  }
 11386  func rewriteValueLOONG64_OpRsh8Ux8(v *Value) bool {
 11387  	v_1 := v.Args[1]
 11388  	v_0 := v.Args[0]
 11389  	b := v.Block
 11390  	typ := &b.Func.Config.Types
 11391  	// match: (Rsh8Ux8 x y)
 11392  	// cond: shiftIsBounded(v)
 11393  	// result: (SRLV (ZeroExt8to64 x) y)
 11394  	for {
 11395  		x := v_0
 11396  		y := v_1
 11397  		if !(shiftIsBounded(v)) {
 11398  			break
 11399  		}
 11400  		v.reset(OpLOONG64SRLV)
 11401  		v0 := b.NewValue0(v.Pos, OpZeroExt8to64, typ.UInt64)
 11402  		v0.AddArg(x)
 11403  		v.AddArg2(v0, y)
 11404  		return true
 11405  	}
 11406  	// match: (Rsh8Ux8 <t> x y)
 11407  	// cond: !shiftIsBounded(v)
 11408  	// result: (MASKEQZ (SRLV <t> (ZeroExt8to64 x) (ZeroExt8to64 y)) (SGTU (MOVVconst <typ.UInt64> [64]) (ZeroExt8to64 y)))
 11409  	for {
 11410  		t := v.Type
 11411  		x := v_0
 11412  		y := v_1
 11413  		if !(!shiftIsBounded(v)) {
 11414  			break
 11415  		}
 11416  		v.reset(OpLOONG64MASKEQZ)
 11417  		v0 := b.NewValue0(v.Pos, OpLOONG64SRLV, t)
 11418  		v1 := b.NewValue0(v.Pos, OpZeroExt8to64, typ.UInt64)
 11419  		v1.AddArg(x)
 11420  		v2 := b.NewValue0(v.Pos, OpZeroExt8to64, typ.UInt64)
 11421  		v2.AddArg(y)
 11422  		v0.AddArg2(v1, v2)
 11423  		v3 := b.NewValue0(v.Pos, OpLOONG64SGTU, typ.Bool)
 11424  		v4 := b.NewValue0(v.Pos, OpLOONG64MOVVconst, typ.UInt64)
 11425  		v4.AuxInt = int64ToAuxInt(64)
 11426  		v3.AddArg2(v4, v2)
 11427  		v.AddArg2(v0, v3)
 11428  		return true
 11429  	}
 11430  	return false
 11431  }
 11432  func rewriteValueLOONG64_OpRsh8x16(v *Value) bool {
 11433  	v_1 := v.Args[1]
 11434  	v_0 := v.Args[0]
 11435  	b := v.Block
 11436  	typ := &b.Func.Config.Types
 11437  	// match: (Rsh8x16 x y)
 11438  	// cond: shiftIsBounded(v)
 11439  	// result: (SRAV (SignExt8to64 x) y)
 11440  	for {
 11441  		x := v_0
 11442  		y := v_1
 11443  		if !(shiftIsBounded(v)) {
 11444  			break
 11445  		}
 11446  		v.reset(OpLOONG64SRAV)
 11447  		v0 := b.NewValue0(v.Pos, OpSignExt8to64, typ.Int64)
 11448  		v0.AddArg(x)
 11449  		v.AddArg2(v0, y)
 11450  		return true
 11451  	}
 11452  	// match: (Rsh8x16 <t> x y)
 11453  	// cond: !shiftIsBounded(v)
 11454  	// result: (SRAV (SignExt8to64 x) (OR <t> (NEGV <t> (SGTU (ZeroExt16to64 y) (MOVVconst <typ.UInt64> [63]))) (ZeroExt16to64 y)))
 11455  	for {
 11456  		t := v.Type
 11457  		x := v_0
 11458  		y := v_1
 11459  		if !(!shiftIsBounded(v)) {
 11460  			break
 11461  		}
 11462  		v.reset(OpLOONG64SRAV)
 11463  		v0 := b.NewValue0(v.Pos, OpSignExt8to64, typ.Int64)
 11464  		v0.AddArg(x)
 11465  		v1 := b.NewValue0(v.Pos, OpLOONG64OR, t)
 11466  		v2 := b.NewValue0(v.Pos, OpLOONG64NEGV, t)
 11467  		v3 := b.NewValue0(v.Pos, OpLOONG64SGTU, typ.Bool)
 11468  		v4 := b.NewValue0(v.Pos, OpZeroExt16to64, typ.UInt64)
 11469  		v4.AddArg(y)
 11470  		v5 := b.NewValue0(v.Pos, OpLOONG64MOVVconst, typ.UInt64)
 11471  		v5.AuxInt = int64ToAuxInt(63)
 11472  		v3.AddArg2(v4, v5)
 11473  		v2.AddArg(v3)
 11474  		v1.AddArg2(v2, v4)
 11475  		v.AddArg2(v0, v1)
 11476  		return true
 11477  	}
 11478  	return false
 11479  }
 11480  func rewriteValueLOONG64_OpRsh8x32(v *Value) bool {
 11481  	v_1 := v.Args[1]
 11482  	v_0 := v.Args[0]
 11483  	b := v.Block
 11484  	typ := &b.Func.Config.Types
 11485  	// match: (Rsh8x32 x y)
 11486  	// cond: shiftIsBounded(v)
 11487  	// result: (SRAV (SignExt8to64 x) y)
 11488  	for {
 11489  		x := v_0
 11490  		y := v_1
 11491  		if !(shiftIsBounded(v)) {
 11492  			break
 11493  		}
 11494  		v.reset(OpLOONG64SRAV)
 11495  		v0 := b.NewValue0(v.Pos, OpSignExt8to64, typ.Int64)
 11496  		v0.AddArg(x)
 11497  		v.AddArg2(v0, y)
 11498  		return true
 11499  	}
 11500  	// match: (Rsh8x32 <t> x y)
 11501  	// cond: !shiftIsBounded(v)
 11502  	// result: (SRAV (SignExt8to64 x) (OR <t> (NEGV <t> (SGTU (ZeroExt32to64 y) (MOVVconst <typ.UInt64> [63]))) (ZeroExt32to64 y)))
 11503  	for {
 11504  		t := v.Type
 11505  		x := v_0
 11506  		y := v_1
 11507  		if !(!shiftIsBounded(v)) {
 11508  			break
 11509  		}
 11510  		v.reset(OpLOONG64SRAV)
 11511  		v0 := b.NewValue0(v.Pos, OpSignExt8to64, typ.Int64)
 11512  		v0.AddArg(x)
 11513  		v1 := b.NewValue0(v.Pos, OpLOONG64OR, t)
 11514  		v2 := b.NewValue0(v.Pos, OpLOONG64NEGV, t)
 11515  		v3 := b.NewValue0(v.Pos, OpLOONG64SGTU, typ.Bool)
 11516  		v4 := b.NewValue0(v.Pos, OpZeroExt32to64, typ.UInt64)
 11517  		v4.AddArg(y)
 11518  		v5 := b.NewValue0(v.Pos, OpLOONG64MOVVconst, typ.UInt64)
 11519  		v5.AuxInt = int64ToAuxInt(63)
 11520  		v3.AddArg2(v4, v5)
 11521  		v2.AddArg(v3)
 11522  		v1.AddArg2(v2, v4)
 11523  		v.AddArg2(v0, v1)
 11524  		return true
 11525  	}
 11526  	return false
 11527  }
 11528  func rewriteValueLOONG64_OpRsh8x64(v *Value) bool {
 11529  	v_1 := v.Args[1]
 11530  	v_0 := v.Args[0]
 11531  	b := v.Block
 11532  	typ := &b.Func.Config.Types
 11533  	// match: (Rsh8x64 x y)
 11534  	// cond: shiftIsBounded(v)
 11535  	// result: (SRAV (SignExt8to64 x) y)
 11536  	for {
 11537  		x := v_0
 11538  		y := v_1
 11539  		if !(shiftIsBounded(v)) {
 11540  			break
 11541  		}
 11542  		v.reset(OpLOONG64SRAV)
 11543  		v0 := b.NewValue0(v.Pos, OpSignExt8to64, typ.Int64)
 11544  		v0.AddArg(x)
 11545  		v.AddArg2(v0, y)
 11546  		return true
 11547  	}
 11548  	// match: (Rsh8x64 <t> x y)
 11549  	// cond: !shiftIsBounded(v)
 11550  	// result: (SRAV (SignExt8to64 x) (OR <t> (NEGV <t> (SGTU y (MOVVconst <typ.UInt64> [63]))) y))
 11551  	for {
 11552  		t := v.Type
 11553  		x := v_0
 11554  		y := v_1
 11555  		if !(!shiftIsBounded(v)) {
 11556  			break
 11557  		}
 11558  		v.reset(OpLOONG64SRAV)
 11559  		v0 := b.NewValue0(v.Pos, OpSignExt8to64, typ.Int64)
 11560  		v0.AddArg(x)
 11561  		v1 := b.NewValue0(v.Pos, OpLOONG64OR, t)
 11562  		v2 := b.NewValue0(v.Pos, OpLOONG64NEGV, t)
 11563  		v3 := b.NewValue0(v.Pos, OpLOONG64SGTU, typ.Bool)
 11564  		v4 := b.NewValue0(v.Pos, OpLOONG64MOVVconst, typ.UInt64)
 11565  		v4.AuxInt = int64ToAuxInt(63)
 11566  		v3.AddArg2(y, v4)
 11567  		v2.AddArg(v3)
 11568  		v1.AddArg2(v2, y)
 11569  		v.AddArg2(v0, v1)
 11570  		return true
 11571  	}
 11572  	return false
 11573  }
 11574  func rewriteValueLOONG64_OpRsh8x8(v *Value) bool {
 11575  	v_1 := v.Args[1]
 11576  	v_0 := v.Args[0]
 11577  	b := v.Block
 11578  	typ := &b.Func.Config.Types
 11579  	// match: (Rsh8x8 x y)
 11580  	// cond: shiftIsBounded(v)
 11581  	// result: (SRAV (SignExt8to64 x) y)
 11582  	for {
 11583  		x := v_0
 11584  		y := v_1
 11585  		if !(shiftIsBounded(v)) {
 11586  			break
 11587  		}
 11588  		v.reset(OpLOONG64SRAV)
 11589  		v0 := b.NewValue0(v.Pos, OpSignExt8to64, typ.Int64)
 11590  		v0.AddArg(x)
 11591  		v.AddArg2(v0, y)
 11592  		return true
 11593  	}
 11594  	// match: (Rsh8x8 <t> x y)
 11595  	// cond: !shiftIsBounded(v)
 11596  	// result: (SRAV (SignExt8to64 x) (OR <t> (NEGV <t> (SGTU (ZeroExt8to64 y) (MOVVconst <typ.UInt64> [63]))) (ZeroExt8to64 y)))
 11597  	for {
 11598  		t := v.Type
 11599  		x := v_0
 11600  		y := v_1
 11601  		if !(!shiftIsBounded(v)) {
 11602  			break
 11603  		}
 11604  		v.reset(OpLOONG64SRAV)
 11605  		v0 := b.NewValue0(v.Pos, OpSignExt8to64, typ.Int64)
 11606  		v0.AddArg(x)
 11607  		v1 := b.NewValue0(v.Pos, OpLOONG64OR, t)
 11608  		v2 := b.NewValue0(v.Pos, OpLOONG64NEGV, t)
 11609  		v3 := b.NewValue0(v.Pos, OpLOONG64SGTU, typ.Bool)
 11610  		v4 := b.NewValue0(v.Pos, OpZeroExt8to64, typ.UInt64)
 11611  		v4.AddArg(y)
 11612  		v5 := b.NewValue0(v.Pos, OpLOONG64MOVVconst, typ.UInt64)
 11613  		v5.AuxInt = int64ToAuxInt(63)
 11614  		v3.AddArg2(v4, v5)
 11615  		v2.AddArg(v3)
 11616  		v1.AddArg2(v2, v4)
 11617  		v.AddArg2(v0, v1)
 11618  		return true
 11619  	}
 11620  	return false
 11621  }
 11622  func rewriteValueLOONG64_OpSelect0(v *Value) bool {
 11623  	v_0 := v.Args[0]
 11624  	b := v.Block
 11625  	// match: (Select0 (Mul64uhilo x y))
 11626  	// result: (MULHVU x y)
 11627  	for {
 11628  		if v_0.Op != OpMul64uhilo {
 11629  			break
 11630  		}
 11631  		y := v_0.Args[1]
 11632  		x := v_0.Args[0]
 11633  		v.reset(OpLOONG64MULHVU)
 11634  		v.AddArg2(x, y)
 11635  		return true
 11636  	}
 11637  	// match: (Select0 (Mul64uover x y))
 11638  	// result: (MULV x y)
 11639  	for {
 11640  		if v_0.Op != OpMul64uover {
 11641  			break
 11642  		}
 11643  		y := v_0.Args[1]
 11644  		x := v_0.Args[0]
 11645  		v.reset(OpLOONG64MULV)
 11646  		v.AddArg2(x, y)
 11647  		return true
 11648  	}
 11649  	// match: (Select0 <t> (Add64carry x y c))
 11650  	// result: (ADDV (ADDV <t> x y) c)
 11651  	for {
 11652  		t := v.Type
 11653  		if v_0.Op != OpAdd64carry {
 11654  			break
 11655  		}
 11656  		c := v_0.Args[2]
 11657  		x := v_0.Args[0]
 11658  		y := v_0.Args[1]
 11659  		v.reset(OpLOONG64ADDV)
 11660  		v0 := b.NewValue0(v.Pos, OpLOONG64ADDV, t)
 11661  		v0.AddArg2(x, y)
 11662  		v.AddArg2(v0, c)
 11663  		return true
 11664  	}
 11665  	// match: (Select0 <t> (Sub64borrow x y c))
 11666  	// result: (SUBV (SUBV <t> x y) c)
 11667  	for {
 11668  		t := v.Type
 11669  		if v_0.Op != OpSub64borrow {
 11670  			break
 11671  		}
 11672  		c := v_0.Args[2]
 11673  		x := v_0.Args[0]
 11674  		y := v_0.Args[1]
 11675  		v.reset(OpLOONG64SUBV)
 11676  		v0 := b.NewValue0(v.Pos, OpLOONG64SUBV, t)
 11677  		v0.AddArg2(x, y)
 11678  		v.AddArg2(v0, c)
 11679  		return true
 11680  	}
 11681  	return false
 11682  }
 11683  func rewriteValueLOONG64_OpSelect1(v *Value) bool {
 11684  	v_0 := v.Args[0]
 11685  	b := v.Block
 11686  	typ := &b.Func.Config.Types
 11687  	// match: (Select1 (Mul64uhilo x y))
 11688  	// result: (MULV x y)
 11689  	for {
 11690  		if v_0.Op != OpMul64uhilo {
 11691  			break
 11692  		}
 11693  		y := v_0.Args[1]
 11694  		x := v_0.Args[0]
 11695  		v.reset(OpLOONG64MULV)
 11696  		v.AddArg2(x, y)
 11697  		return true
 11698  	}
 11699  	// match: (Select1 (Mul64uover x y))
 11700  	// result: (SGTU <typ.Bool> (MULHVU x y) (MOVVconst <typ.UInt64> [0]))
 11701  	for {
 11702  		if v_0.Op != OpMul64uover {
 11703  			break
 11704  		}
 11705  		y := v_0.Args[1]
 11706  		x := v_0.Args[0]
 11707  		v.reset(OpLOONG64SGTU)
 11708  		v.Type = typ.Bool
 11709  		v0 := b.NewValue0(v.Pos, OpLOONG64MULHVU, typ.UInt64)
 11710  		v0.AddArg2(x, y)
 11711  		v1 := b.NewValue0(v.Pos, OpLOONG64MOVVconst, typ.UInt64)
 11712  		v1.AuxInt = int64ToAuxInt(0)
 11713  		v.AddArg2(v0, v1)
 11714  		return true
 11715  	}
 11716  	// match: (Select1 <t> (Add64carry x y c))
 11717  	// result: (OR (SGTU <t> x s:(ADDV <t> x y)) (SGTU <t> s (ADDV <t> s c)))
 11718  	for {
 11719  		t := v.Type
 11720  		if v_0.Op != OpAdd64carry {
 11721  			break
 11722  		}
 11723  		c := v_0.Args[2]
 11724  		x := v_0.Args[0]
 11725  		y := v_0.Args[1]
 11726  		v.reset(OpLOONG64OR)
 11727  		v0 := b.NewValue0(v.Pos, OpLOONG64SGTU, t)
 11728  		s := b.NewValue0(v.Pos, OpLOONG64ADDV, t)
 11729  		s.AddArg2(x, y)
 11730  		v0.AddArg2(x, s)
 11731  		v2 := b.NewValue0(v.Pos, OpLOONG64SGTU, t)
 11732  		v3 := b.NewValue0(v.Pos, OpLOONG64ADDV, t)
 11733  		v3.AddArg2(s, c)
 11734  		v2.AddArg2(s, v3)
 11735  		v.AddArg2(v0, v2)
 11736  		return true
 11737  	}
 11738  	// match: (Select1 <t> (Sub64borrow x y c))
 11739  	// result: (OR (SGTU <t> s:(SUBV <t> x y) x) (SGTU <t> (SUBV <t> s c) s))
 11740  	for {
 11741  		t := v.Type
 11742  		if v_0.Op != OpSub64borrow {
 11743  			break
 11744  		}
 11745  		c := v_0.Args[2]
 11746  		x := v_0.Args[0]
 11747  		y := v_0.Args[1]
 11748  		v.reset(OpLOONG64OR)
 11749  		v0 := b.NewValue0(v.Pos, OpLOONG64SGTU, t)
 11750  		s := b.NewValue0(v.Pos, OpLOONG64SUBV, t)
 11751  		s.AddArg2(x, y)
 11752  		v0.AddArg2(s, x)
 11753  		v2 := b.NewValue0(v.Pos, OpLOONG64SGTU, t)
 11754  		v3 := b.NewValue0(v.Pos, OpLOONG64SUBV, t)
 11755  		v3.AddArg2(s, c)
 11756  		v2.AddArg2(v3, s)
 11757  		v.AddArg2(v0, v2)
 11758  		return true
 11759  	}
 11760  	return false
 11761  }
 11762  func rewriteValueLOONG64_OpSelectN(v *Value) bool {
 11763  	v_0 := v.Args[0]
 11764  	b := v.Block
 11765  	config := b.Func.Config
 11766  	// match: (SelectN [0] call:(CALLstatic {sym} dst src (MOVVconst [sz]) mem))
 11767  	// cond: sz >= 0 && isSameCall(sym, "runtime.memmove") && call.Uses == 1 && isInlinableMemmove(dst, src, sz, config) && clobber(call)
 11768  	// result: (Move [sz] dst src mem)
 11769  	for {
 11770  		if auxIntToInt64(v.AuxInt) != 0 {
 11771  			break
 11772  		}
 11773  		call := v_0
 11774  		if call.Op != OpLOONG64CALLstatic || len(call.Args) != 4 {
 11775  			break
 11776  		}
 11777  		sym := auxToCall(call.Aux)
 11778  		mem := call.Args[3]
 11779  		dst := call.Args[0]
 11780  		src := call.Args[1]
 11781  		call_2 := call.Args[2]
 11782  		if call_2.Op != OpLOONG64MOVVconst {
 11783  			break
 11784  		}
 11785  		sz := auxIntToInt64(call_2.AuxInt)
 11786  		if !(sz >= 0 && isSameCall(sym, "runtime.memmove") && call.Uses == 1 && isInlinableMemmove(dst, src, sz, config) && clobber(call)) {
 11787  			break
 11788  		}
 11789  		v.reset(OpMove)
 11790  		v.AuxInt = int64ToAuxInt(sz)
 11791  		v.AddArg3(dst, src, mem)
 11792  		return true
 11793  	}
 11794  	return false
 11795  }
 11796  func rewriteValueLOONG64_OpSlicemask(v *Value) bool {
 11797  	v_0 := v.Args[0]
 11798  	b := v.Block
 11799  	// match: (Slicemask <t> x)
 11800  	// result: (SRAVconst (NEGV <t> x) [63])
 11801  	for {
 11802  		t := v.Type
 11803  		x := v_0
 11804  		v.reset(OpLOONG64SRAVconst)
 11805  		v.AuxInt = int64ToAuxInt(63)
 11806  		v0 := b.NewValue0(v.Pos, OpLOONG64NEGV, t)
 11807  		v0.AddArg(x)
 11808  		v.AddArg(v0)
 11809  		return true
 11810  	}
 11811  }
 11812  func rewriteValueLOONG64_OpStore(v *Value) bool {
 11813  	v_2 := v.Args[2]
 11814  	v_1 := v.Args[1]
 11815  	v_0 := v.Args[0]
 11816  	// match: (Store {t} ptr val mem)
 11817  	// cond: t.Size() == 1
 11818  	// result: (MOVBstore ptr val mem)
 11819  	for {
 11820  		t := auxToType(v.Aux)
 11821  		ptr := v_0
 11822  		val := v_1
 11823  		mem := v_2
 11824  		if !(t.Size() == 1) {
 11825  			break
 11826  		}
 11827  		v.reset(OpLOONG64MOVBstore)
 11828  		v.AddArg3(ptr, val, mem)
 11829  		return true
 11830  	}
 11831  	// match: (Store {t} ptr val mem)
 11832  	// cond: t.Size() == 2
 11833  	// result: (MOVHstore ptr val mem)
 11834  	for {
 11835  		t := auxToType(v.Aux)
 11836  		ptr := v_0
 11837  		val := v_1
 11838  		mem := v_2
 11839  		if !(t.Size() == 2) {
 11840  			break
 11841  		}
 11842  		v.reset(OpLOONG64MOVHstore)
 11843  		v.AddArg3(ptr, val, mem)
 11844  		return true
 11845  	}
 11846  	// match: (Store {t} ptr val mem)
 11847  	// cond: t.Size() == 4 && !t.IsFloat()
 11848  	// result: (MOVWstore ptr val mem)
 11849  	for {
 11850  		t := auxToType(v.Aux)
 11851  		ptr := v_0
 11852  		val := v_1
 11853  		mem := v_2
 11854  		if !(t.Size() == 4 && !t.IsFloat()) {
 11855  			break
 11856  		}
 11857  		v.reset(OpLOONG64MOVWstore)
 11858  		v.AddArg3(ptr, val, mem)
 11859  		return true
 11860  	}
 11861  	// match: (Store {t} ptr val mem)
 11862  	// cond: t.Size() == 8 && !t.IsFloat()
 11863  	// result: (MOVVstore ptr val mem)
 11864  	for {
 11865  		t := auxToType(v.Aux)
 11866  		ptr := v_0
 11867  		val := v_1
 11868  		mem := v_2
 11869  		if !(t.Size() == 8 && !t.IsFloat()) {
 11870  			break
 11871  		}
 11872  		v.reset(OpLOONG64MOVVstore)
 11873  		v.AddArg3(ptr, val, mem)
 11874  		return true
 11875  	}
 11876  	// match: (Store {t} ptr val mem)
 11877  	// cond: t.Size() == 4 && t.IsFloat()
 11878  	// result: (MOVFstore ptr val mem)
 11879  	for {
 11880  		t := auxToType(v.Aux)
 11881  		ptr := v_0
 11882  		val := v_1
 11883  		mem := v_2
 11884  		if !(t.Size() == 4 && t.IsFloat()) {
 11885  			break
 11886  		}
 11887  		v.reset(OpLOONG64MOVFstore)
 11888  		v.AddArg3(ptr, val, mem)
 11889  		return true
 11890  	}
 11891  	// match: (Store {t} ptr val mem)
 11892  	// cond: t.Size() == 8 && t.IsFloat()
 11893  	// result: (MOVDstore ptr val mem)
 11894  	for {
 11895  		t := auxToType(v.Aux)
 11896  		ptr := v_0
 11897  		val := v_1
 11898  		mem := v_2
 11899  		if !(t.Size() == 8 && t.IsFloat()) {
 11900  			break
 11901  		}
 11902  		v.reset(OpLOONG64MOVDstore)
 11903  		v.AddArg3(ptr, val, mem)
 11904  		return true
 11905  	}
 11906  	return false
 11907  }
 11908  func rewriteValueLOONG64_OpZero(v *Value) bool {
 11909  	v_1 := v.Args[1]
 11910  	v_0 := v.Args[0]
 11911  	b := v.Block
 11912  	typ := &b.Func.Config.Types
 11913  	// match: (Zero [0] _ mem)
 11914  	// result: mem
 11915  	for {
 11916  		if auxIntToInt64(v.AuxInt) != 0 {
 11917  			break
 11918  		}
 11919  		mem := v_1
 11920  		v.copyOf(mem)
 11921  		return true
 11922  	}
 11923  	// match: (Zero [1] ptr mem)
 11924  	// result: (MOVBstore ptr (MOVVconst [0]) mem)
 11925  	for {
 11926  		if auxIntToInt64(v.AuxInt) != 1 {
 11927  			break
 11928  		}
 11929  		ptr := v_0
 11930  		mem := v_1
 11931  		v.reset(OpLOONG64MOVBstore)
 11932  		v0 := b.NewValue0(v.Pos, OpLOONG64MOVVconst, typ.UInt64)
 11933  		v0.AuxInt = int64ToAuxInt(0)
 11934  		v.AddArg3(ptr, v0, mem)
 11935  		return true
 11936  	}
 11937  	// match: (Zero [2] ptr mem)
 11938  	// result: (MOVHstore ptr (MOVVconst [0]) mem)
 11939  	for {
 11940  		if auxIntToInt64(v.AuxInt) != 2 {
 11941  			break
 11942  		}
 11943  		ptr := v_0
 11944  		mem := v_1
 11945  		v.reset(OpLOONG64MOVHstore)
 11946  		v0 := b.NewValue0(v.Pos, OpLOONG64MOVVconst, typ.UInt64)
 11947  		v0.AuxInt = int64ToAuxInt(0)
 11948  		v.AddArg3(ptr, v0, mem)
 11949  		return true
 11950  	}
 11951  	// match: (Zero [3] ptr mem)
 11952  	// result: (MOVBstore [2] ptr (MOVVconst [0]) (MOVHstore ptr (MOVVconst [0]) mem))
 11953  	for {
 11954  		if auxIntToInt64(v.AuxInt) != 3 {
 11955  			break
 11956  		}
 11957  		ptr := v_0
 11958  		mem := v_1
 11959  		v.reset(OpLOONG64MOVBstore)
 11960  		v.AuxInt = int32ToAuxInt(2)
 11961  		v0 := b.NewValue0(v.Pos, OpLOONG64MOVVconst, typ.UInt64)
 11962  		v0.AuxInt = int64ToAuxInt(0)
 11963  		v1 := b.NewValue0(v.Pos, OpLOONG64MOVHstore, types.TypeMem)
 11964  		v1.AddArg3(ptr, v0, mem)
 11965  		v.AddArg3(ptr, v0, v1)
 11966  		return true
 11967  	}
 11968  	// match: (Zero [4] {t} ptr mem)
 11969  	// result: (MOVWstore ptr (MOVVconst [0]) mem)
 11970  	for {
 11971  		if auxIntToInt64(v.AuxInt) != 4 {
 11972  			break
 11973  		}
 11974  		ptr := v_0
 11975  		mem := v_1
 11976  		v.reset(OpLOONG64MOVWstore)
 11977  		v0 := b.NewValue0(v.Pos, OpLOONG64MOVVconst, typ.UInt64)
 11978  		v0.AuxInt = int64ToAuxInt(0)
 11979  		v.AddArg3(ptr, v0, mem)
 11980  		return true
 11981  	}
 11982  	// match: (Zero [5] ptr mem)
 11983  	// result: (MOVBstore [4] ptr (MOVVconst [0]) (MOVWstore ptr (MOVVconst [0]) mem))
 11984  	for {
 11985  		if auxIntToInt64(v.AuxInt) != 5 {
 11986  			break
 11987  		}
 11988  		ptr := v_0
 11989  		mem := v_1
 11990  		v.reset(OpLOONG64MOVBstore)
 11991  		v.AuxInt = int32ToAuxInt(4)
 11992  		v0 := b.NewValue0(v.Pos, OpLOONG64MOVVconst, typ.UInt64)
 11993  		v0.AuxInt = int64ToAuxInt(0)
 11994  		v1 := b.NewValue0(v.Pos, OpLOONG64MOVWstore, types.TypeMem)
 11995  		v1.AddArg3(ptr, v0, mem)
 11996  		v.AddArg3(ptr, v0, v1)
 11997  		return true
 11998  	}
 11999  	// match: (Zero [6] ptr mem)
 12000  	// result: (MOVHstore [4] ptr (MOVVconst [0]) (MOVWstore ptr (MOVVconst [0]) mem))
 12001  	for {
 12002  		if auxIntToInt64(v.AuxInt) != 6 {
 12003  			break
 12004  		}
 12005  		ptr := v_0
 12006  		mem := v_1
 12007  		v.reset(OpLOONG64MOVHstore)
 12008  		v.AuxInt = int32ToAuxInt(4)
 12009  		v0 := b.NewValue0(v.Pos, OpLOONG64MOVVconst, typ.UInt64)
 12010  		v0.AuxInt = int64ToAuxInt(0)
 12011  		v1 := b.NewValue0(v.Pos, OpLOONG64MOVWstore, types.TypeMem)
 12012  		v1.AddArg3(ptr, v0, mem)
 12013  		v.AddArg3(ptr, v0, v1)
 12014  		return true
 12015  	}
 12016  	// match: (Zero [7] ptr mem)
 12017  	// result: (MOVWstore [3] ptr (MOVVconst [0]) (MOVWstore ptr (MOVVconst [0]) mem))
 12018  	for {
 12019  		if auxIntToInt64(v.AuxInt) != 7 {
 12020  			break
 12021  		}
 12022  		ptr := v_0
 12023  		mem := v_1
 12024  		v.reset(OpLOONG64MOVWstore)
 12025  		v.AuxInt = int32ToAuxInt(3)
 12026  		v0 := b.NewValue0(v.Pos, OpLOONG64MOVVconst, typ.UInt64)
 12027  		v0.AuxInt = int64ToAuxInt(0)
 12028  		v1 := b.NewValue0(v.Pos, OpLOONG64MOVWstore, types.TypeMem)
 12029  		v1.AddArg3(ptr, v0, mem)
 12030  		v.AddArg3(ptr, v0, v1)
 12031  		return true
 12032  	}
 12033  	// match: (Zero [8] {t} ptr mem)
 12034  	// result: (MOVVstore ptr (MOVVconst [0]) mem)
 12035  	for {
 12036  		if auxIntToInt64(v.AuxInt) != 8 {
 12037  			break
 12038  		}
 12039  		ptr := v_0
 12040  		mem := v_1
 12041  		v.reset(OpLOONG64MOVVstore)
 12042  		v0 := b.NewValue0(v.Pos, OpLOONG64MOVVconst, typ.UInt64)
 12043  		v0.AuxInt = int64ToAuxInt(0)
 12044  		v.AddArg3(ptr, v0, mem)
 12045  		return true
 12046  	}
 12047  	// match: (Zero [9] ptr mem)
 12048  	// result: (MOVBstore [8] ptr (MOVVconst [0]) (MOVVstore ptr (MOVVconst [0]) mem))
 12049  	for {
 12050  		if auxIntToInt64(v.AuxInt) != 9 {
 12051  			break
 12052  		}
 12053  		ptr := v_0
 12054  		mem := v_1
 12055  		v.reset(OpLOONG64MOVBstore)
 12056  		v.AuxInt = int32ToAuxInt(8)
 12057  		v0 := b.NewValue0(v.Pos, OpLOONG64MOVVconst, typ.UInt64)
 12058  		v0.AuxInt = int64ToAuxInt(0)
 12059  		v1 := b.NewValue0(v.Pos, OpLOONG64MOVVstore, types.TypeMem)
 12060  		v1.AddArg3(ptr, v0, mem)
 12061  		v.AddArg3(ptr, v0, v1)
 12062  		return true
 12063  	}
 12064  	// match: (Zero [10] ptr mem)
 12065  	// result: (MOVHstore [8] ptr (MOVVconst [0]) (MOVVstore ptr (MOVVconst [0]) mem))
 12066  	for {
 12067  		if auxIntToInt64(v.AuxInt) != 10 {
 12068  			break
 12069  		}
 12070  		ptr := v_0
 12071  		mem := v_1
 12072  		v.reset(OpLOONG64MOVHstore)
 12073  		v.AuxInt = int32ToAuxInt(8)
 12074  		v0 := b.NewValue0(v.Pos, OpLOONG64MOVVconst, typ.UInt64)
 12075  		v0.AuxInt = int64ToAuxInt(0)
 12076  		v1 := b.NewValue0(v.Pos, OpLOONG64MOVVstore, types.TypeMem)
 12077  		v1.AddArg3(ptr, v0, mem)
 12078  		v.AddArg3(ptr, v0, v1)
 12079  		return true
 12080  	}
 12081  	// match: (Zero [11] ptr mem)
 12082  	// result: (MOVWstore [7] ptr (MOVVconst [0]) (MOVVstore ptr (MOVVconst [0]) mem))
 12083  	for {
 12084  		if auxIntToInt64(v.AuxInt) != 11 {
 12085  			break
 12086  		}
 12087  		ptr := v_0
 12088  		mem := v_1
 12089  		v.reset(OpLOONG64MOVWstore)
 12090  		v.AuxInt = int32ToAuxInt(7)
 12091  		v0 := b.NewValue0(v.Pos, OpLOONG64MOVVconst, typ.UInt64)
 12092  		v0.AuxInt = int64ToAuxInt(0)
 12093  		v1 := b.NewValue0(v.Pos, OpLOONG64MOVVstore, types.TypeMem)
 12094  		v1.AddArg3(ptr, v0, mem)
 12095  		v.AddArg3(ptr, v0, v1)
 12096  		return true
 12097  	}
 12098  	// match: (Zero [12] ptr mem)
 12099  	// result: (MOVWstore [8] ptr (MOVVconst [0]) (MOVVstore ptr (MOVVconst [0]) mem))
 12100  	for {
 12101  		if auxIntToInt64(v.AuxInt) != 12 {
 12102  			break
 12103  		}
 12104  		ptr := v_0
 12105  		mem := v_1
 12106  		v.reset(OpLOONG64MOVWstore)
 12107  		v.AuxInt = int32ToAuxInt(8)
 12108  		v0 := b.NewValue0(v.Pos, OpLOONG64MOVVconst, typ.UInt64)
 12109  		v0.AuxInt = int64ToAuxInt(0)
 12110  		v1 := b.NewValue0(v.Pos, OpLOONG64MOVVstore, types.TypeMem)
 12111  		v1.AddArg3(ptr, v0, mem)
 12112  		v.AddArg3(ptr, v0, v1)
 12113  		return true
 12114  	}
 12115  	// match: (Zero [13] ptr mem)
 12116  	// result: (MOVVstore [5] ptr (MOVVconst [0]) (MOVVstore ptr (MOVVconst [0]) mem))
 12117  	for {
 12118  		if auxIntToInt64(v.AuxInt) != 13 {
 12119  			break
 12120  		}
 12121  		ptr := v_0
 12122  		mem := v_1
 12123  		v.reset(OpLOONG64MOVVstore)
 12124  		v.AuxInt = int32ToAuxInt(5)
 12125  		v0 := b.NewValue0(v.Pos, OpLOONG64MOVVconst, typ.UInt64)
 12126  		v0.AuxInt = int64ToAuxInt(0)
 12127  		v1 := b.NewValue0(v.Pos, OpLOONG64MOVVstore, types.TypeMem)
 12128  		v1.AddArg3(ptr, v0, mem)
 12129  		v.AddArg3(ptr, v0, v1)
 12130  		return true
 12131  	}
 12132  	// match: (Zero [14] ptr mem)
 12133  	// result: (MOVVstore [6] ptr (MOVVconst [0]) (MOVVstore ptr (MOVVconst [0]) mem))
 12134  	for {
 12135  		if auxIntToInt64(v.AuxInt) != 14 {
 12136  			break
 12137  		}
 12138  		ptr := v_0
 12139  		mem := v_1
 12140  		v.reset(OpLOONG64MOVVstore)
 12141  		v.AuxInt = int32ToAuxInt(6)
 12142  		v0 := b.NewValue0(v.Pos, OpLOONG64MOVVconst, typ.UInt64)
 12143  		v0.AuxInt = int64ToAuxInt(0)
 12144  		v1 := b.NewValue0(v.Pos, OpLOONG64MOVVstore, types.TypeMem)
 12145  		v1.AddArg3(ptr, v0, mem)
 12146  		v.AddArg3(ptr, v0, v1)
 12147  		return true
 12148  	}
 12149  	// match: (Zero [15] ptr mem)
 12150  	// result: (MOVVstore [7] ptr (MOVVconst [0]) (MOVVstore ptr (MOVVconst [0]) mem))
 12151  	for {
 12152  		if auxIntToInt64(v.AuxInt) != 15 {
 12153  			break
 12154  		}
 12155  		ptr := v_0
 12156  		mem := v_1
 12157  		v.reset(OpLOONG64MOVVstore)
 12158  		v.AuxInt = int32ToAuxInt(7)
 12159  		v0 := b.NewValue0(v.Pos, OpLOONG64MOVVconst, typ.UInt64)
 12160  		v0.AuxInt = int64ToAuxInt(0)
 12161  		v1 := b.NewValue0(v.Pos, OpLOONG64MOVVstore, types.TypeMem)
 12162  		v1.AddArg3(ptr, v0, mem)
 12163  		v.AddArg3(ptr, v0, v1)
 12164  		return true
 12165  	}
 12166  	// match: (Zero [16] ptr mem)
 12167  	// result: (MOVVstore [8] ptr (MOVVconst [0]) (MOVVstore ptr (MOVVconst [0]) mem))
 12168  	for {
 12169  		if auxIntToInt64(v.AuxInt) != 16 {
 12170  			break
 12171  		}
 12172  		ptr := v_0
 12173  		mem := v_1
 12174  		v.reset(OpLOONG64MOVVstore)
 12175  		v.AuxInt = int32ToAuxInt(8)
 12176  		v0 := b.NewValue0(v.Pos, OpLOONG64MOVVconst, typ.UInt64)
 12177  		v0.AuxInt = int64ToAuxInt(0)
 12178  		v1 := b.NewValue0(v.Pos, OpLOONG64MOVVstore, types.TypeMem)
 12179  		v1.AddArg3(ptr, v0, mem)
 12180  		v.AddArg3(ptr, v0, v1)
 12181  		return true
 12182  	}
 12183  	// match: (Zero [s] ptr mem)
 12184  	// cond: s > 16 && s < 192
 12185  	// result: (LoweredZero [s] ptr mem)
 12186  	for {
 12187  		s := auxIntToInt64(v.AuxInt)
 12188  		ptr := v_0
 12189  		mem := v_1
 12190  		if !(s > 16 && s < 192) {
 12191  			break
 12192  		}
 12193  		v.reset(OpLOONG64LoweredZero)
 12194  		v.AuxInt = int64ToAuxInt(s)
 12195  		v.AddArg2(ptr, mem)
 12196  		return true
 12197  	}
 12198  	// match: (Zero [s] ptr mem)
 12199  	// cond: s >= 192
 12200  	// result: (LoweredZeroLoop [s] ptr mem)
 12201  	for {
 12202  		s := auxIntToInt64(v.AuxInt)
 12203  		ptr := v_0
 12204  		mem := v_1
 12205  		if !(s >= 192) {
 12206  			break
 12207  		}
 12208  		v.reset(OpLOONG64LoweredZeroLoop)
 12209  		v.AuxInt = int64ToAuxInt(s)
 12210  		v.AddArg2(ptr, mem)
 12211  		return true
 12212  	}
 12213  	return false
 12214  }
 12215  func rewriteBlockLOONG64(b *Block) bool {
 12216  	typ := &b.Func.Config.Types
 12217  	switch b.Kind {
 12218  	case block.BlockLOONG64BEQ:
 12219  		// match: (BEQ (MOVVconst [0]) cond yes no)
 12220  		// result: (EQZ cond yes no)
 12221  		for b.Controls[0].Op == OpLOONG64MOVVconst {
 12222  			v_0 := b.Controls[0]
 12223  			if auxIntToInt64(v_0.AuxInt) != 0 {
 12224  				break
 12225  			}
 12226  			cond := b.Controls[1]
 12227  			b.resetWithControl(block.BlockLOONG64EQZ, cond)
 12228  			return true
 12229  		}
 12230  		// match: (BEQ cond (MOVVconst [0]) yes no)
 12231  		// result: (EQZ cond yes no)
 12232  		for b.Controls[1].Op == OpLOONG64MOVVconst {
 12233  			cond := b.Controls[0]
 12234  			v_1 := b.Controls[1]
 12235  			if auxIntToInt64(v_1.AuxInt) != 0 {
 12236  				break
 12237  			}
 12238  			b.resetWithControl(block.BlockLOONG64EQZ, cond)
 12239  			return true
 12240  		}
 12241  	case block.BlockLOONG64BGE:
 12242  		// match: (BGE (MOVVconst [0]) cond yes no)
 12243  		// result: (LEZ cond yes no)
 12244  		for b.Controls[0].Op == OpLOONG64MOVVconst {
 12245  			v_0 := b.Controls[0]
 12246  			if auxIntToInt64(v_0.AuxInt) != 0 {
 12247  				break
 12248  			}
 12249  			cond := b.Controls[1]
 12250  			b.resetWithControl(block.BlockLOONG64LEZ, cond)
 12251  			return true
 12252  		}
 12253  		// match: (BGE cond (MOVVconst [0]) yes no)
 12254  		// result: (GEZ cond yes no)
 12255  		for b.Controls[1].Op == OpLOONG64MOVVconst {
 12256  			cond := b.Controls[0]
 12257  			v_1 := b.Controls[1]
 12258  			if auxIntToInt64(v_1.AuxInt) != 0 {
 12259  				break
 12260  			}
 12261  			b.resetWithControl(block.BlockLOONG64GEZ, cond)
 12262  			return true
 12263  		}
 12264  	case block.BlockLOONG64BGEU:
 12265  		// match: (BGEU (MOVVconst [0]) cond yes no)
 12266  		// result: (EQZ cond yes no)
 12267  		for b.Controls[0].Op == OpLOONG64MOVVconst {
 12268  			v_0 := b.Controls[0]
 12269  			if auxIntToInt64(v_0.AuxInt) != 0 {
 12270  				break
 12271  			}
 12272  			cond := b.Controls[1]
 12273  			b.resetWithControl(block.BlockLOONG64EQZ, cond)
 12274  			return true
 12275  		}
 12276  	case block.BlockLOONG64BLT:
 12277  		// match: (BLT (MOVVconst [0]) cond yes no)
 12278  		// result: (GTZ cond yes no)
 12279  		for b.Controls[0].Op == OpLOONG64MOVVconst {
 12280  			v_0 := b.Controls[0]
 12281  			if auxIntToInt64(v_0.AuxInt) != 0 {
 12282  				break
 12283  			}
 12284  			cond := b.Controls[1]
 12285  			b.resetWithControl(block.BlockLOONG64GTZ, cond)
 12286  			return true
 12287  		}
 12288  		// match: (BLT cond (MOVVconst [0]) yes no)
 12289  		// result: (LTZ cond yes no)
 12290  		for b.Controls[1].Op == OpLOONG64MOVVconst {
 12291  			cond := b.Controls[0]
 12292  			v_1 := b.Controls[1]
 12293  			if auxIntToInt64(v_1.AuxInt) != 0 {
 12294  				break
 12295  			}
 12296  			b.resetWithControl(block.BlockLOONG64LTZ, cond)
 12297  			return true
 12298  		}
 12299  	case block.BlockLOONG64BLTU:
 12300  		// match: (BLTU (MOVVconst [0]) cond yes no)
 12301  		// result: (NEZ cond yes no)
 12302  		for b.Controls[0].Op == OpLOONG64MOVVconst {
 12303  			v_0 := b.Controls[0]
 12304  			if auxIntToInt64(v_0.AuxInt) != 0 {
 12305  				break
 12306  			}
 12307  			cond := b.Controls[1]
 12308  			b.resetWithControl(block.BlockLOONG64NEZ, cond)
 12309  			return true
 12310  		}
 12311  	case block.BlockLOONG64BNE:
 12312  		// match: (BNE (MOVVconst [0]) cond yes no)
 12313  		// result: (NEZ cond yes no)
 12314  		for b.Controls[0].Op == OpLOONG64MOVVconst {
 12315  			v_0 := b.Controls[0]
 12316  			if auxIntToInt64(v_0.AuxInt) != 0 {
 12317  				break
 12318  			}
 12319  			cond := b.Controls[1]
 12320  			b.resetWithControl(block.BlockLOONG64NEZ, cond)
 12321  			return true
 12322  		}
 12323  		// match: (BNE cond (MOVVconst [0]) yes no)
 12324  		// result: (NEZ cond yes no)
 12325  		for b.Controls[1].Op == OpLOONG64MOVVconst {
 12326  			cond := b.Controls[0]
 12327  			v_1 := b.Controls[1]
 12328  			if auxIntToInt64(v_1.AuxInt) != 0 {
 12329  				break
 12330  			}
 12331  			b.resetWithControl(block.BlockLOONG64NEZ, cond)
 12332  			return true
 12333  		}
 12334  	case block.BlockLOONG64EQZ:
 12335  		// match: (EQZ (FPFlagTrue cmp) yes no)
 12336  		// result: (FPF cmp yes no)
 12337  		for b.Controls[0].Op == OpLOONG64FPFlagTrue {
 12338  			v_0 := b.Controls[0]
 12339  			cmp := v_0.Args[0]
 12340  			b.resetWithControl(block.BlockLOONG64FPF, cmp)
 12341  			return true
 12342  		}
 12343  		// match: (EQZ (FPFlagFalse cmp) yes no)
 12344  		// result: (FPT cmp yes no)
 12345  		for b.Controls[0].Op == OpLOONG64FPFlagFalse {
 12346  			v_0 := b.Controls[0]
 12347  			cmp := v_0.Args[0]
 12348  			b.resetWithControl(block.BlockLOONG64FPT, cmp)
 12349  			return true
 12350  		}
 12351  		// match: (EQZ (XORconst [1] cmp:(SGT _ _)) yes no)
 12352  		// result: (NEZ cmp yes no)
 12353  		for b.Controls[0].Op == OpLOONG64XORconst {
 12354  			v_0 := b.Controls[0]
 12355  			if auxIntToInt64(v_0.AuxInt) != 1 {
 12356  				break
 12357  			}
 12358  			cmp := v_0.Args[0]
 12359  			if cmp.Op != OpLOONG64SGT {
 12360  				break
 12361  			}
 12362  			b.resetWithControl(block.BlockLOONG64NEZ, cmp)
 12363  			return true
 12364  		}
 12365  		// match: (EQZ (XORconst [1] cmp:(SGTU _ _)) yes no)
 12366  		// result: (NEZ cmp yes no)
 12367  		for b.Controls[0].Op == OpLOONG64XORconst {
 12368  			v_0 := b.Controls[0]
 12369  			if auxIntToInt64(v_0.AuxInt) != 1 {
 12370  				break
 12371  			}
 12372  			cmp := v_0.Args[0]
 12373  			if cmp.Op != OpLOONG64SGTU {
 12374  				break
 12375  			}
 12376  			b.resetWithControl(block.BlockLOONG64NEZ, cmp)
 12377  			return true
 12378  		}
 12379  		// match: (EQZ (XORconst [1] cmp:(SGTconst _)) yes no)
 12380  		// result: (NEZ cmp yes no)
 12381  		for b.Controls[0].Op == OpLOONG64XORconst {
 12382  			v_0 := b.Controls[0]
 12383  			if auxIntToInt64(v_0.AuxInt) != 1 {
 12384  				break
 12385  			}
 12386  			cmp := v_0.Args[0]
 12387  			if cmp.Op != OpLOONG64SGTconst {
 12388  				break
 12389  			}
 12390  			b.resetWithControl(block.BlockLOONG64NEZ, cmp)
 12391  			return true
 12392  		}
 12393  		// match: (EQZ (XORconst [1] cmp:(SGTUconst _)) yes no)
 12394  		// result: (NEZ cmp yes no)
 12395  		for b.Controls[0].Op == OpLOONG64XORconst {
 12396  			v_0 := b.Controls[0]
 12397  			if auxIntToInt64(v_0.AuxInt) != 1 {
 12398  				break
 12399  			}
 12400  			cmp := v_0.Args[0]
 12401  			if cmp.Op != OpLOONG64SGTUconst {
 12402  				break
 12403  			}
 12404  			b.resetWithControl(block.BlockLOONG64NEZ, cmp)
 12405  			return true
 12406  		}
 12407  		// match: (EQZ (SGTUconst [1] x) yes no)
 12408  		// result: (NEZ x yes no)
 12409  		for b.Controls[0].Op == OpLOONG64SGTUconst {
 12410  			v_0 := b.Controls[0]
 12411  			if auxIntToInt64(v_0.AuxInt) != 1 {
 12412  				break
 12413  			}
 12414  			x := v_0.Args[0]
 12415  			b.resetWithControl(block.BlockLOONG64NEZ, x)
 12416  			return true
 12417  		}
 12418  		// match: (EQZ (SGTU x (MOVVconst [0])) yes no)
 12419  		// result: (EQZ x yes no)
 12420  		for b.Controls[0].Op == OpLOONG64SGTU {
 12421  			v_0 := b.Controls[0]
 12422  			_ = v_0.Args[1]
 12423  			x := v_0.Args[0]
 12424  			v_0_1 := v_0.Args[1]
 12425  			if v_0_1.Op != OpLOONG64MOVVconst || auxIntToInt64(v_0_1.AuxInt) != 0 {
 12426  				break
 12427  			}
 12428  			b.resetWithControl(block.BlockLOONG64EQZ, x)
 12429  			return true
 12430  		}
 12431  		// match: (EQZ (SGTconst [0] x) yes no)
 12432  		// result: (GEZ x yes no)
 12433  		for b.Controls[0].Op == OpLOONG64SGTconst {
 12434  			v_0 := b.Controls[0]
 12435  			if auxIntToInt64(v_0.AuxInt) != 0 {
 12436  				break
 12437  			}
 12438  			x := v_0.Args[0]
 12439  			b.resetWithControl(block.BlockLOONG64GEZ, x)
 12440  			return true
 12441  		}
 12442  		// match: (EQZ (SGT x (MOVVconst [0])) yes no)
 12443  		// result: (LEZ x yes no)
 12444  		for b.Controls[0].Op == OpLOONG64SGT {
 12445  			v_0 := b.Controls[0]
 12446  			_ = v_0.Args[1]
 12447  			x := v_0.Args[0]
 12448  			v_0_1 := v_0.Args[1]
 12449  			if v_0_1.Op != OpLOONG64MOVVconst || auxIntToInt64(v_0_1.AuxInt) != 0 {
 12450  				break
 12451  			}
 12452  			b.resetWithControl(block.BlockLOONG64LEZ, x)
 12453  			return true
 12454  		}
 12455  		// match: (EQZ (SGTU (MOVVconst [c]) y) yes no)
 12456  		// cond: c >= -2048 && c <= 2047
 12457  		// result: (EQZ (SGTUconst [c] y) yes no)
 12458  		for b.Controls[0].Op == OpLOONG64SGTU {
 12459  			v_0 := b.Controls[0]
 12460  			y := v_0.Args[1]
 12461  			v_0_0 := v_0.Args[0]
 12462  			if v_0_0.Op != OpLOONG64MOVVconst {
 12463  				break
 12464  			}
 12465  			c := auxIntToInt64(v_0_0.AuxInt)
 12466  			if !(c >= -2048 && c <= 2047) {
 12467  				break
 12468  			}
 12469  			v0 := b.NewValue0(v_0.Pos, OpLOONG64SGTUconst, typ.Bool)
 12470  			v0.AuxInt = int64ToAuxInt(c)
 12471  			v0.AddArg(y)
 12472  			b.resetWithControl(block.BlockLOONG64EQZ, v0)
 12473  			return true
 12474  		}
 12475  		// match: (EQZ (SUBV x y) yes no)
 12476  		// result: (BEQ x y yes no)
 12477  		for b.Controls[0].Op == OpLOONG64SUBV {
 12478  			v_0 := b.Controls[0]
 12479  			y := v_0.Args[1]
 12480  			x := v_0.Args[0]
 12481  			b.resetWithControl2(block.BlockLOONG64BEQ, x, y)
 12482  			return true
 12483  		}
 12484  		// match: (EQZ (SGT x y) yes no)
 12485  		// result: (BGE y x yes no)
 12486  		for b.Controls[0].Op == OpLOONG64SGT {
 12487  			v_0 := b.Controls[0]
 12488  			y := v_0.Args[1]
 12489  			x := v_0.Args[0]
 12490  			b.resetWithControl2(block.BlockLOONG64BGE, y, x)
 12491  			return true
 12492  		}
 12493  		// match: (EQZ (SGTU x y) yes no)
 12494  		// result: (BGEU y x yes no)
 12495  		for b.Controls[0].Op == OpLOONG64SGTU {
 12496  			v_0 := b.Controls[0]
 12497  			y := v_0.Args[1]
 12498  			x := v_0.Args[0]
 12499  			b.resetWithControl2(block.BlockLOONG64BGEU, y, x)
 12500  			return true
 12501  		}
 12502  		// match: (EQZ (SGTconst [c] y) yes no)
 12503  		// result: (BGE y (MOVVconst [c]) yes no)
 12504  		for b.Controls[0].Op == OpLOONG64SGTconst {
 12505  			v_0 := b.Controls[0]
 12506  			c := auxIntToInt64(v_0.AuxInt)
 12507  			y := v_0.Args[0]
 12508  			v0 := b.NewValue0(b.Pos, OpLOONG64MOVVconst, typ.UInt64)
 12509  			v0.AuxInt = int64ToAuxInt(c)
 12510  			b.resetWithControl2(block.BlockLOONG64BGE, y, v0)
 12511  			return true
 12512  		}
 12513  		// match: (EQZ (SGTUconst [c] y) yes no)
 12514  		// result: (BGEU y (MOVVconst [c]) yes no)
 12515  		for b.Controls[0].Op == OpLOONG64SGTUconst {
 12516  			v_0 := b.Controls[0]
 12517  			c := auxIntToInt64(v_0.AuxInt)
 12518  			y := v_0.Args[0]
 12519  			v0 := b.NewValue0(b.Pos, OpLOONG64MOVVconst, typ.UInt64)
 12520  			v0.AuxInt = int64ToAuxInt(c)
 12521  			b.resetWithControl2(block.BlockLOONG64BGEU, y, v0)
 12522  			return true
 12523  		}
 12524  		// match: (EQZ (MOVVconst [0]) yes no)
 12525  		// result: (First yes no)
 12526  		for b.Controls[0].Op == OpLOONG64MOVVconst {
 12527  			v_0 := b.Controls[0]
 12528  			if auxIntToInt64(v_0.AuxInt) != 0 {
 12529  				break
 12530  			}
 12531  			b.Reset(block.BlockFirst)
 12532  			return true
 12533  		}
 12534  		// match: (EQZ (MOVVconst [c]) yes no)
 12535  		// cond: c != 0
 12536  		// result: (First no yes)
 12537  		for b.Controls[0].Op == OpLOONG64MOVVconst {
 12538  			v_0 := b.Controls[0]
 12539  			c := auxIntToInt64(v_0.AuxInt)
 12540  			if !(c != 0) {
 12541  				break
 12542  			}
 12543  			b.Reset(block.BlockFirst)
 12544  			b.swapSuccessors()
 12545  			return true
 12546  		}
 12547  		// match: (EQZ (NEGV x) yes no)
 12548  		// result: (EQZ x yes no)
 12549  		for b.Controls[0].Op == OpLOONG64NEGV {
 12550  			v_0 := b.Controls[0]
 12551  			x := v_0.Args[0]
 12552  			b.resetWithControl(block.BlockLOONG64EQZ, x)
 12553  			return true
 12554  		}
 12555  	case block.BlockLOONG64GEZ:
 12556  		// match: (GEZ (MOVVconst [c]) yes no)
 12557  		// cond: c >= 0
 12558  		// result: (First yes no)
 12559  		for b.Controls[0].Op == OpLOONG64MOVVconst {
 12560  			v_0 := b.Controls[0]
 12561  			c := auxIntToInt64(v_0.AuxInt)
 12562  			if !(c >= 0) {
 12563  				break
 12564  			}
 12565  			b.Reset(block.BlockFirst)
 12566  			return true
 12567  		}
 12568  		// match: (GEZ (MOVVconst [c]) yes no)
 12569  		// cond: c < 0
 12570  		// result: (First no yes)
 12571  		for b.Controls[0].Op == OpLOONG64MOVVconst {
 12572  			v_0 := b.Controls[0]
 12573  			c := auxIntToInt64(v_0.AuxInt)
 12574  			if !(c < 0) {
 12575  				break
 12576  			}
 12577  			b.Reset(block.BlockFirst)
 12578  			b.swapSuccessors()
 12579  			return true
 12580  		}
 12581  	case block.BlockLOONG64GTZ:
 12582  		// match: (GTZ (MOVVconst [c]) yes no)
 12583  		// cond: c > 0
 12584  		// result: (First yes no)
 12585  		for b.Controls[0].Op == OpLOONG64MOVVconst {
 12586  			v_0 := b.Controls[0]
 12587  			c := auxIntToInt64(v_0.AuxInt)
 12588  			if !(c > 0) {
 12589  				break
 12590  			}
 12591  			b.Reset(block.BlockFirst)
 12592  			return true
 12593  		}
 12594  		// match: (GTZ (MOVVconst [c]) yes no)
 12595  		// cond: c <= 0
 12596  		// result: (First no yes)
 12597  		for b.Controls[0].Op == OpLOONG64MOVVconst {
 12598  			v_0 := b.Controls[0]
 12599  			c := auxIntToInt64(v_0.AuxInt)
 12600  			if !(c <= 0) {
 12601  				break
 12602  			}
 12603  			b.Reset(block.BlockFirst)
 12604  			b.swapSuccessors()
 12605  			return true
 12606  		}
 12607  	case block.BlockIf:
 12608  		// match: (If cond yes no)
 12609  		// result: (NEZ (MOVBUreg <typ.UInt64> cond) yes no)
 12610  		for {
 12611  			cond := b.Controls[0]
 12612  			v0 := b.NewValue0(cond.Pos, OpLOONG64MOVBUreg, typ.UInt64)
 12613  			v0.AddArg(cond)
 12614  			b.resetWithControl(block.BlockLOONG64NEZ, v0)
 12615  			return true
 12616  		}
 12617  	case block.BlockJumpTable:
 12618  		// match: (JumpTable idx)
 12619  		// result: (JUMPTABLE {makeJumpTableSym(b)} idx (MOVVaddr <typ.Uintptr> {makeJumpTableSym(b)} (SB)))
 12620  		for {
 12621  			idx := b.Controls[0]
 12622  			v0 := b.NewValue0(b.Pos, OpLOONG64MOVVaddr, typ.Uintptr)
 12623  			v0.Aux = symToAux(makeJumpTableSym(b))
 12624  			v1 := b.NewValue0(b.Pos, OpSB, typ.Uintptr)
 12625  			v0.AddArg(v1)
 12626  			b.resetWithControl2(block.BlockLOONG64JUMPTABLE, idx, v0)
 12627  			b.Aux = symToAux(makeJumpTableSym(b))
 12628  			return true
 12629  		}
 12630  	case block.BlockLOONG64LEZ:
 12631  		// match: (LEZ (MOVVconst [c]) yes no)
 12632  		// cond: c <= 0
 12633  		// result: (First yes no)
 12634  		for b.Controls[0].Op == OpLOONG64MOVVconst {
 12635  			v_0 := b.Controls[0]
 12636  			c := auxIntToInt64(v_0.AuxInt)
 12637  			if !(c <= 0) {
 12638  				break
 12639  			}
 12640  			b.Reset(block.BlockFirst)
 12641  			return true
 12642  		}
 12643  		// match: (LEZ (MOVVconst [c]) yes no)
 12644  		// cond: c > 0
 12645  		// result: (First no yes)
 12646  		for b.Controls[0].Op == OpLOONG64MOVVconst {
 12647  			v_0 := b.Controls[0]
 12648  			c := auxIntToInt64(v_0.AuxInt)
 12649  			if !(c > 0) {
 12650  				break
 12651  			}
 12652  			b.Reset(block.BlockFirst)
 12653  			b.swapSuccessors()
 12654  			return true
 12655  		}
 12656  	case block.BlockLOONG64LTZ:
 12657  		// match: (LTZ (MOVVconst [c]) yes no)
 12658  		// cond: c < 0
 12659  		// result: (First yes no)
 12660  		for b.Controls[0].Op == OpLOONG64MOVVconst {
 12661  			v_0 := b.Controls[0]
 12662  			c := auxIntToInt64(v_0.AuxInt)
 12663  			if !(c < 0) {
 12664  				break
 12665  			}
 12666  			b.Reset(block.BlockFirst)
 12667  			return true
 12668  		}
 12669  		// match: (LTZ (MOVVconst [c]) yes no)
 12670  		// cond: c >= 0
 12671  		// result: (First no yes)
 12672  		for b.Controls[0].Op == OpLOONG64MOVVconst {
 12673  			v_0 := b.Controls[0]
 12674  			c := auxIntToInt64(v_0.AuxInt)
 12675  			if !(c >= 0) {
 12676  				break
 12677  			}
 12678  			b.Reset(block.BlockFirst)
 12679  			b.swapSuccessors()
 12680  			return true
 12681  		}
 12682  	case block.BlockLOONG64NEZ:
 12683  		// match: (NEZ (FPFlagTrue cmp) yes no)
 12684  		// result: (FPT cmp yes no)
 12685  		for b.Controls[0].Op == OpLOONG64FPFlagTrue {
 12686  			v_0 := b.Controls[0]
 12687  			cmp := v_0.Args[0]
 12688  			b.resetWithControl(block.BlockLOONG64FPT, cmp)
 12689  			return true
 12690  		}
 12691  		// match: (NEZ (FPFlagFalse cmp) yes no)
 12692  		// result: (FPF cmp yes no)
 12693  		for b.Controls[0].Op == OpLOONG64FPFlagFalse {
 12694  			v_0 := b.Controls[0]
 12695  			cmp := v_0.Args[0]
 12696  			b.resetWithControl(block.BlockLOONG64FPF, cmp)
 12697  			return true
 12698  		}
 12699  		// match: (NEZ (XORconst [1] cmp:(SGT _ _)) yes no)
 12700  		// result: (EQZ cmp yes no)
 12701  		for b.Controls[0].Op == OpLOONG64XORconst {
 12702  			v_0 := b.Controls[0]
 12703  			if auxIntToInt64(v_0.AuxInt) != 1 {
 12704  				break
 12705  			}
 12706  			cmp := v_0.Args[0]
 12707  			if cmp.Op != OpLOONG64SGT {
 12708  				break
 12709  			}
 12710  			b.resetWithControl(block.BlockLOONG64EQZ, cmp)
 12711  			return true
 12712  		}
 12713  		// match: (NEZ (XORconst [1] cmp:(SGTU _ _)) yes no)
 12714  		// result: (EQZ cmp yes no)
 12715  		for b.Controls[0].Op == OpLOONG64XORconst {
 12716  			v_0 := b.Controls[0]
 12717  			if auxIntToInt64(v_0.AuxInt) != 1 {
 12718  				break
 12719  			}
 12720  			cmp := v_0.Args[0]
 12721  			if cmp.Op != OpLOONG64SGTU {
 12722  				break
 12723  			}
 12724  			b.resetWithControl(block.BlockLOONG64EQZ, cmp)
 12725  			return true
 12726  		}
 12727  		// match: (NEZ (XORconst [1] cmp:(SGTconst _)) yes no)
 12728  		// result: (EQZ cmp yes no)
 12729  		for b.Controls[0].Op == OpLOONG64XORconst {
 12730  			v_0 := b.Controls[0]
 12731  			if auxIntToInt64(v_0.AuxInt) != 1 {
 12732  				break
 12733  			}
 12734  			cmp := v_0.Args[0]
 12735  			if cmp.Op != OpLOONG64SGTconst {
 12736  				break
 12737  			}
 12738  			b.resetWithControl(block.BlockLOONG64EQZ, cmp)
 12739  			return true
 12740  		}
 12741  		// match: (NEZ (XORconst [1] cmp:(SGTUconst _)) yes no)
 12742  		// result: (EQZ cmp yes no)
 12743  		for b.Controls[0].Op == OpLOONG64XORconst {
 12744  			v_0 := b.Controls[0]
 12745  			if auxIntToInt64(v_0.AuxInt) != 1 {
 12746  				break
 12747  			}
 12748  			cmp := v_0.Args[0]
 12749  			if cmp.Op != OpLOONG64SGTUconst {
 12750  				break
 12751  			}
 12752  			b.resetWithControl(block.BlockLOONG64EQZ, cmp)
 12753  			return true
 12754  		}
 12755  		// match: (NEZ (SGTUconst [1] x) yes no)
 12756  		// result: (EQZ x yes no)
 12757  		for b.Controls[0].Op == OpLOONG64SGTUconst {
 12758  			v_0 := b.Controls[0]
 12759  			if auxIntToInt64(v_0.AuxInt) != 1 {
 12760  				break
 12761  			}
 12762  			x := v_0.Args[0]
 12763  			b.resetWithControl(block.BlockLOONG64EQZ, x)
 12764  			return true
 12765  		}
 12766  		// match: (NEZ (SGTU x (MOVVconst [0])) yes no)
 12767  		// result: (NEZ x yes no)
 12768  		for b.Controls[0].Op == OpLOONG64SGTU {
 12769  			v_0 := b.Controls[0]
 12770  			_ = v_0.Args[1]
 12771  			x := v_0.Args[0]
 12772  			v_0_1 := v_0.Args[1]
 12773  			if v_0_1.Op != OpLOONG64MOVVconst || auxIntToInt64(v_0_1.AuxInt) != 0 {
 12774  				break
 12775  			}
 12776  			b.resetWithControl(block.BlockLOONG64NEZ, x)
 12777  			return true
 12778  		}
 12779  		// match: (NEZ (SGTconst [0] x) yes no)
 12780  		// result: (LTZ x yes no)
 12781  		for b.Controls[0].Op == OpLOONG64SGTconst {
 12782  			v_0 := b.Controls[0]
 12783  			if auxIntToInt64(v_0.AuxInt) != 0 {
 12784  				break
 12785  			}
 12786  			x := v_0.Args[0]
 12787  			b.resetWithControl(block.BlockLOONG64LTZ, x)
 12788  			return true
 12789  		}
 12790  		// match: (NEZ (SGT x (MOVVconst [0])) yes no)
 12791  		// result: (GTZ x yes no)
 12792  		for b.Controls[0].Op == OpLOONG64SGT {
 12793  			v_0 := b.Controls[0]
 12794  			_ = v_0.Args[1]
 12795  			x := v_0.Args[0]
 12796  			v_0_1 := v_0.Args[1]
 12797  			if v_0_1.Op != OpLOONG64MOVVconst || auxIntToInt64(v_0_1.AuxInt) != 0 {
 12798  				break
 12799  			}
 12800  			b.resetWithControl(block.BlockLOONG64GTZ, x)
 12801  			return true
 12802  		}
 12803  		// match: (NEZ (SGTU (MOVVconst [c]) y) yes no)
 12804  		// cond: c >= -2048 && c <= 2047
 12805  		// result: (NEZ (SGTUconst [c] y) yes no)
 12806  		for b.Controls[0].Op == OpLOONG64SGTU {
 12807  			v_0 := b.Controls[0]
 12808  			y := v_0.Args[1]
 12809  			v_0_0 := v_0.Args[0]
 12810  			if v_0_0.Op != OpLOONG64MOVVconst {
 12811  				break
 12812  			}
 12813  			c := auxIntToInt64(v_0_0.AuxInt)
 12814  			if !(c >= -2048 && c <= 2047) {
 12815  				break
 12816  			}
 12817  			v0 := b.NewValue0(v_0.Pos, OpLOONG64SGTUconst, typ.Bool)
 12818  			v0.AuxInt = int64ToAuxInt(c)
 12819  			v0.AddArg(y)
 12820  			b.resetWithControl(block.BlockLOONG64NEZ, v0)
 12821  			return true
 12822  		}
 12823  		// match: (NEZ (SUBV x y) yes no)
 12824  		// result: (BNE x y yes no)
 12825  		for b.Controls[0].Op == OpLOONG64SUBV {
 12826  			v_0 := b.Controls[0]
 12827  			y := v_0.Args[1]
 12828  			x := v_0.Args[0]
 12829  			b.resetWithControl2(block.BlockLOONG64BNE, x, y)
 12830  			return true
 12831  		}
 12832  		// match: (NEZ (SGT x y) yes no)
 12833  		// result: (BLT y x yes no)
 12834  		for b.Controls[0].Op == OpLOONG64SGT {
 12835  			v_0 := b.Controls[0]
 12836  			y := v_0.Args[1]
 12837  			x := v_0.Args[0]
 12838  			b.resetWithControl2(block.BlockLOONG64BLT, y, x)
 12839  			return true
 12840  		}
 12841  		// match: (NEZ (SGTU x y) yes no)
 12842  		// result: (BLTU y x yes no)
 12843  		for b.Controls[0].Op == OpLOONG64SGTU {
 12844  			v_0 := b.Controls[0]
 12845  			y := v_0.Args[1]
 12846  			x := v_0.Args[0]
 12847  			b.resetWithControl2(block.BlockLOONG64BLTU, y, x)
 12848  			return true
 12849  		}
 12850  		// match: (NEZ (SGTconst [c] y) yes no)
 12851  		// result: (BLT y (MOVVconst [c]) yes no)
 12852  		for b.Controls[0].Op == OpLOONG64SGTconst {
 12853  			v_0 := b.Controls[0]
 12854  			c := auxIntToInt64(v_0.AuxInt)
 12855  			y := v_0.Args[0]
 12856  			v0 := b.NewValue0(b.Pos, OpLOONG64MOVVconst, typ.UInt64)
 12857  			v0.AuxInt = int64ToAuxInt(c)
 12858  			b.resetWithControl2(block.BlockLOONG64BLT, y, v0)
 12859  			return true
 12860  		}
 12861  		// match: (NEZ (SGTUconst [c] y) yes no)
 12862  		// result: (BLTU y (MOVVconst [c]) yes no)
 12863  		for b.Controls[0].Op == OpLOONG64SGTUconst {
 12864  			v_0 := b.Controls[0]
 12865  			c := auxIntToInt64(v_0.AuxInt)
 12866  			y := v_0.Args[0]
 12867  			v0 := b.NewValue0(b.Pos, OpLOONG64MOVVconst, typ.UInt64)
 12868  			v0.AuxInt = int64ToAuxInt(c)
 12869  			b.resetWithControl2(block.BlockLOONG64BLTU, y, v0)
 12870  			return true
 12871  		}
 12872  		// match: (NEZ (MOVVconst [0]) yes no)
 12873  		// result: (First no yes)
 12874  		for b.Controls[0].Op == OpLOONG64MOVVconst {
 12875  			v_0 := b.Controls[0]
 12876  			if auxIntToInt64(v_0.AuxInt) != 0 {
 12877  				break
 12878  			}
 12879  			b.Reset(block.BlockFirst)
 12880  			b.swapSuccessors()
 12881  			return true
 12882  		}
 12883  		// match: (NEZ (MOVVconst [c]) yes no)
 12884  		// cond: c != 0
 12885  		// result: (First yes no)
 12886  		for b.Controls[0].Op == OpLOONG64MOVVconst {
 12887  			v_0 := b.Controls[0]
 12888  			c := auxIntToInt64(v_0.AuxInt)
 12889  			if !(c != 0) {
 12890  				break
 12891  			}
 12892  			b.Reset(block.BlockFirst)
 12893  			return true
 12894  		}
 12895  		// match: (NEZ (NEGV x) yes no)
 12896  		// result: (NEZ x yes no)
 12897  		for b.Controls[0].Op == OpLOONG64NEGV {
 12898  			v_0 := b.Controls[0]
 12899  			x := v_0.Args[0]
 12900  			b.resetWithControl(block.BlockLOONG64NEZ, x)
 12901  			return true
 12902  		}
 12903  	}
 12904  	return false
 12905  }
 12906  

View as plain text