Source file src/cmd/compile/internal/ssarewrite/rewriteriscv64/rewriteRISCV64.go

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

View as plain text