Source file src/cmd/compile/internal/ssa/rewriteARM64.go

     1  // Code generated from _gen/ARM64.rules using 'go generate'; DO NOT EDIT.
     2  
     3  package ssa
     4  
     5  import "cmd/compile/internal/types"
     6  
     7  func rewriteValueARM64(v *Value) bool {
     8  	switch v.Op {
     9  	case OpARM64ADCSflags:
    10  		return rewriteValueARM64_OpARM64ADCSflags(v)
    11  	case OpARM64ADD:
    12  		return rewriteValueARM64_OpARM64ADD(v)
    13  	case OpARM64ADDSflags:
    14  		return rewriteValueARM64_OpARM64ADDSflags(v)
    15  	case OpARM64ADDconst:
    16  		return rewriteValueARM64_OpARM64ADDconst(v)
    17  	case OpARM64ADDshiftLL:
    18  		return rewriteValueARM64_OpARM64ADDshiftLL(v)
    19  	case OpARM64ADDshiftRA:
    20  		return rewriteValueARM64_OpARM64ADDshiftRA(v)
    21  	case OpARM64ADDshiftRL:
    22  		return rewriteValueARM64_OpARM64ADDshiftRL(v)
    23  	case OpARM64AND:
    24  		return rewriteValueARM64_OpARM64AND(v)
    25  	case OpARM64ANDconst:
    26  		return rewriteValueARM64_OpARM64ANDconst(v)
    27  	case OpARM64ANDshiftLL:
    28  		return rewriteValueARM64_OpARM64ANDshiftLL(v)
    29  	case OpARM64ANDshiftRA:
    30  		return rewriteValueARM64_OpARM64ANDshiftRA(v)
    31  	case OpARM64ANDshiftRL:
    32  		return rewriteValueARM64_OpARM64ANDshiftRL(v)
    33  	case OpARM64ANDshiftRO:
    34  		return rewriteValueARM64_OpARM64ANDshiftRO(v)
    35  	case OpARM64BIC:
    36  		return rewriteValueARM64_OpARM64BIC(v)
    37  	case OpARM64BICshiftLL:
    38  		return rewriteValueARM64_OpARM64BICshiftLL(v)
    39  	case OpARM64BICshiftRA:
    40  		return rewriteValueARM64_OpARM64BICshiftRA(v)
    41  	case OpARM64BICshiftRL:
    42  		return rewriteValueARM64_OpARM64BICshiftRL(v)
    43  	case OpARM64BICshiftRO:
    44  		return rewriteValueARM64_OpARM64BICshiftRO(v)
    45  	case OpARM64CMN:
    46  		return rewriteValueARM64_OpARM64CMN(v)
    47  	case OpARM64CMNW:
    48  		return rewriteValueARM64_OpARM64CMNW(v)
    49  	case OpARM64CMNWconst:
    50  		return rewriteValueARM64_OpARM64CMNWconst(v)
    51  	case OpARM64CMNconst:
    52  		return rewriteValueARM64_OpARM64CMNconst(v)
    53  	case OpARM64CMNshiftLL:
    54  		return rewriteValueARM64_OpARM64CMNshiftLL(v)
    55  	case OpARM64CMNshiftRA:
    56  		return rewriteValueARM64_OpARM64CMNshiftRA(v)
    57  	case OpARM64CMNshiftRL:
    58  		return rewriteValueARM64_OpARM64CMNshiftRL(v)
    59  	case OpARM64CMP:
    60  		return rewriteValueARM64_OpARM64CMP(v)
    61  	case OpARM64CMPW:
    62  		return rewriteValueARM64_OpARM64CMPW(v)
    63  	case OpARM64CMPWconst:
    64  		return rewriteValueARM64_OpARM64CMPWconst(v)
    65  	case OpARM64CMPconst:
    66  		return rewriteValueARM64_OpARM64CMPconst(v)
    67  	case OpARM64CMPshiftLL:
    68  		return rewriteValueARM64_OpARM64CMPshiftLL(v)
    69  	case OpARM64CMPshiftRA:
    70  		return rewriteValueARM64_OpARM64CMPshiftRA(v)
    71  	case OpARM64CMPshiftRL:
    72  		return rewriteValueARM64_OpARM64CMPshiftRL(v)
    73  	case OpARM64CSEL:
    74  		return rewriteValueARM64_OpARM64CSEL(v)
    75  	case OpARM64CSEL0:
    76  		return rewriteValueARM64_OpARM64CSEL0(v)
    77  	case OpARM64CSETM:
    78  		return rewriteValueARM64_OpARM64CSETM(v)
    79  	case OpARM64CSINC:
    80  		return rewriteValueARM64_OpARM64CSINC(v)
    81  	case OpARM64CSINV:
    82  		return rewriteValueARM64_OpARM64CSINV(v)
    83  	case OpARM64CSNEG:
    84  		return rewriteValueARM64_OpARM64CSNEG(v)
    85  	case OpARM64DIV:
    86  		return rewriteValueARM64_OpARM64DIV(v)
    87  	case OpARM64DIVW:
    88  		return rewriteValueARM64_OpARM64DIVW(v)
    89  	case OpARM64EON:
    90  		return rewriteValueARM64_OpARM64EON(v)
    91  	case OpARM64EONshiftLL:
    92  		return rewriteValueARM64_OpARM64EONshiftLL(v)
    93  	case OpARM64EONshiftRA:
    94  		return rewriteValueARM64_OpARM64EONshiftRA(v)
    95  	case OpARM64EONshiftRL:
    96  		return rewriteValueARM64_OpARM64EONshiftRL(v)
    97  	case OpARM64EONshiftRO:
    98  		return rewriteValueARM64_OpARM64EONshiftRO(v)
    99  	case OpARM64Equal:
   100  		return rewriteValueARM64_OpARM64Equal(v)
   101  	case OpARM64FADDD:
   102  		return rewriteValueARM64_OpARM64FADDD(v)
   103  	case OpARM64FADDS:
   104  		return rewriteValueARM64_OpARM64FADDS(v)
   105  	case OpARM64FCMPD:
   106  		return rewriteValueARM64_OpARM64FCMPD(v)
   107  	case OpARM64FCMPS:
   108  		return rewriteValueARM64_OpARM64FCMPS(v)
   109  	case OpARM64FMOVDfpgp:
   110  		return rewriteValueARM64_OpARM64FMOVDfpgp(v)
   111  	case OpARM64FMOVDgpfp:
   112  		return rewriteValueARM64_OpARM64FMOVDgpfp(v)
   113  	case OpARM64FMOVDload:
   114  		return rewriteValueARM64_OpARM64FMOVDload(v)
   115  	case OpARM64FMOVDloadidx:
   116  		return rewriteValueARM64_OpARM64FMOVDloadidx(v)
   117  	case OpARM64FMOVDloadidx8:
   118  		return rewriteValueARM64_OpARM64FMOVDloadidx8(v)
   119  	case OpARM64FMOVDstore:
   120  		return rewriteValueARM64_OpARM64FMOVDstore(v)
   121  	case OpARM64FMOVDstoreidx:
   122  		return rewriteValueARM64_OpARM64FMOVDstoreidx(v)
   123  	case OpARM64FMOVDstoreidx8:
   124  		return rewriteValueARM64_OpARM64FMOVDstoreidx8(v)
   125  	case OpARM64FMOVSload:
   126  		return rewriteValueARM64_OpARM64FMOVSload(v)
   127  	case OpARM64FMOVSloadidx:
   128  		return rewriteValueARM64_OpARM64FMOVSloadidx(v)
   129  	case OpARM64FMOVSloadidx4:
   130  		return rewriteValueARM64_OpARM64FMOVSloadidx4(v)
   131  	case OpARM64FMOVSstore:
   132  		return rewriteValueARM64_OpARM64FMOVSstore(v)
   133  	case OpARM64FMOVSstoreidx:
   134  		return rewriteValueARM64_OpARM64FMOVSstoreidx(v)
   135  	case OpARM64FMOVSstoreidx4:
   136  		return rewriteValueARM64_OpARM64FMOVSstoreidx4(v)
   137  	case OpARM64FMULD:
   138  		return rewriteValueARM64_OpARM64FMULD(v)
   139  	case OpARM64FMULS:
   140  		return rewriteValueARM64_OpARM64FMULS(v)
   141  	case OpARM64FNEGD:
   142  		return rewriteValueARM64_OpARM64FNEGD(v)
   143  	case OpARM64FNEGS:
   144  		return rewriteValueARM64_OpARM64FNEGS(v)
   145  	case OpARM64FNMULD:
   146  		return rewriteValueARM64_OpARM64FNMULD(v)
   147  	case OpARM64FNMULS:
   148  		return rewriteValueARM64_OpARM64FNMULS(v)
   149  	case OpARM64FSUBD:
   150  		return rewriteValueARM64_OpARM64FSUBD(v)
   151  	case OpARM64FSUBS:
   152  		return rewriteValueARM64_OpARM64FSUBS(v)
   153  	case OpARM64GreaterEqual:
   154  		return rewriteValueARM64_OpARM64GreaterEqual(v)
   155  	case OpARM64GreaterEqualF:
   156  		return rewriteValueARM64_OpARM64GreaterEqualF(v)
   157  	case OpARM64GreaterEqualNoov:
   158  		return rewriteValueARM64_OpARM64GreaterEqualNoov(v)
   159  	case OpARM64GreaterEqualU:
   160  		return rewriteValueARM64_OpARM64GreaterEqualU(v)
   161  	case OpARM64GreaterThan:
   162  		return rewriteValueARM64_OpARM64GreaterThan(v)
   163  	case OpARM64GreaterThanF:
   164  		return rewriteValueARM64_OpARM64GreaterThanF(v)
   165  	case OpARM64GreaterThanU:
   166  		return rewriteValueARM64_OpARM64GreaterThanU(v)
   167  	case OpARM64LDP:
   168  		return rewriteValueARM64_OpARM64LDP(v)
   169  	case OpARM64LessEqual:
   170  		return rewriteValueARM64_OpARM64LessEqual(v)
   171  	case OpARM64LessEqualF:
   172  		return rewriteValueARM64_OpARM64LessEqualF(v)
   173  	case OpARM64LessEqualU:
   174  		return rewriteValueARM64_OpARM64LessEqualU(v)
   175  	case OpARM64LessThan:
   176  		return rewriteValueARM64_OpARM64LessThan(v)
   177  	case OpARM64LessThanF:
   178  		return rewriteValueARM64_OpARM64LessThanF(v)
   179  	case OpARM64LessThanNoov:
   180  		return rewriteValueARM64_OpARM64LessThanNoov(v)
   181  	case OpARM64LessThanU:
   182  		return rewriteValueARM64_OpARM64LessThanU(v)
   183  	case OpARM64MADD:
   184  		return rewriteValueARM64_OpARM64MADD(v)
   185  	case OpARM64MADDW:
   186  		return rewriteValueARM64_OpARM64MADDW(v)
   187  	case OpARM64MNEG:
   188  		return rewriteValueARM64_OpARM64MNEG(v)
   189  	case OpARM64MNEGW:
   190  		return rewriteValueARM64_OpARM64MNEGW(v)
   191  	case OpARM64MOD:
   192  		return rewriteValueARM64_OpARM64MOD(v)
   193  	case OpARM64MODW:
   194  		return rewriteValueARM64_OpARM64MODW(v)
   195  	case OpARM64MOVBUload:
   196  		return rewriteValueARM64_OpARM64MOVBUload(v)
   197  	case OpARM64MOVBUloadidx:
   198  		return rewriteValueARM64_OpARM64MOVBUloadidx(v)
   199  	case OpARM64MOVBUreg:
   200  		return rewriteValueARM64_OpARM64MOVBUreg(v)
   201  	case OpARM64MOVBload:
   202  		return rewriteValueARM64_OpARM64MOVBload(v)
   203  	case OpARM64MOVBloadidx:
   204  		return rewriteValueARM64_OpARM64MOVBloadidx(v)
   205  	case OpARM64MOVBreg:
   206  		return rewriteValueARM64_OpARM64MOVBreg(v)
   207  	case OpARM64MOVBstore:
   208  		return rewriteValueARM64_OpARM64MOVBstore(v)
   209  	case OpARM64MOVBstoreidx:
   210  		return rewriteValueARM64_OpARM64MOVBstoreidx(v)
   211  	case OpARM64MOVDload:
   212  		return rewriteValueARM64_OpARM64MOVDload(v)
   213  	case OpARM64MOVDloadidx:
   214  		return rewriteValueARM64_OpARM64MOVDloadidx(v)
   215  	case OpARM64MOVDloadidx8:
   216  		return rewriteValueARM64_OpARM64MOVDloadidx8(v)
   217  	case OpARM64MOVDnop:
   218  		return rewriteValueARM64_OpARM64MOVDnop(v)
   219  	case OpARM64MOVDreg:
   220  		return rewriteValueARM64_OpARM64MOVDreg(v)
   221  	case OpARM64MOVDstore:
   222  		return rewriteValueARM64_OpARM64MOVDstore(v)
   223  	case OpARM64MOVDstoreidx:
   224  		return rewriteValueARM64_OpARM64MOVDstoreidx(v)
   225  	case OpARM64MOVDstoreidx8:
   226  		return rewriteValueARM64_OpARM64MOVDstoreidx8(v)
   227  	case OpARM64MOVHUload:
   228  		return rewriteValueARM64_OpARM64MOVHUload(v)
   229  	case OpARM64MOVHUloadidx:
   230  		return rewriteValueARM64_OpARM64MOVHUloadidx(v)
   231  	case OpARM64MOVHUloadidx2:
   232  		return rewriteValueARM64_OpARM64MOVHUloadidx2(v)
   233  	case OpARM64MOVHUreg:
   234  		return rewriteValueARM64_OpARM64MOVHUreg(v)
   235  	case OpARM64MOVHload:
   236  		return rewriteValueARM64_OpARM64MOVHload(v)
   237  	case OpARM64MOVHloadidx:
   238  		return rewriteValueARM64_OpARM64MOVHloadidx(v)
   239  	case OpARM64MOVHloadidx2:
   240  		return rewriteValueARM64_OpARM64MOVHloadidx2(v)
   241  	case OpARM64MOVHreg:
   242  		return rewriteValueARM64_OpARM64MOVHreg(v)
   243  	case OpARM64MOVHstore:
   244  		return rewriteValueARM64_OpARM64MOVHstore(v)
   245  	case OpARM64MOVHstoreidx:
   246  		return rewriteValueARM64_OpARM64MOVHstoreidx(v)
   247  	case OpARM64MOVHstoreidx2:
   248  		return rewriteValueARM64_OpARM64MOVHstoreidx2(v)
   249  	case OpARM64MOVWUload:
   250  		return rewriteValueARM64_OpARM64MOVWUload(v)
   251  	case OpARM64MOVWUloadidx:
   252  		return rewriteValueARM64_OpARM64MOVWUloadidx(v)
   253  	case OpARM64MOVWUloadidx4:
   254  		return rewriteValueARM64_OpARM64MOVWUloadidx4(v)
   255  	case OpARM64MOVWUreg:
   256  		return rewriteValueARM64_OpARM64MOVWUreg(v)
   257  	case OpARM64MOVWload:
   258  		return rewriteValueARM64_OpARM64MOVWload(v)
   259  	case OpARM64MOVWloadidx:
   260  		return rewriteValueARM64_OpARM64MOVWloadidx(v)
   261  	case OpARM64MOVWloadidx4:
   262  		return rewriteValueARM64_OpARM64MOVWloadidx4(v)
   263  	case OpARM64MOVWreg:
   264  		return rewriteValueARM64_OpARM64MOVWreg(v)
   265  	case OpARM64MOVWstore:
   266  		return rewriteValueARM64_OpARM64MOVWstore(v)
   267  	case OpARM64MOVWstoreidx:
   268  		return rewriteValueARM64_OpARM64MOVWstoreidx(v)
   269  	case OpARM64MOVWstoreidx4:
   270  		return rewriteValueARM64_OpARM64MOVWstoreidx4(v)
   271  	case OpARM64MSUB:
   272  		return rewriteValueARM64_OpARM64MSUB(v)
   273  	case OpARM64MSUBW:
   274  		return rewriteValueARM64_OpARM64MSUBW(v)
   275  	case OpARM64MUL:
   276  		return rewriteValueARM64_OpARM64MUL(v)
   277  	case OpARM64MULW:
   278  		return rewriteValueARM64_OpARM64MULW(v)
   279  	case OpARM64MVN:
   280  		return rewriteValueARM64_OpARM64MVN(v)
   281  	case OpARM64MVNshiftLL:
   282  		return rewriteValueARM64_OpARM64MVNshiftLL(v)
   283  	case OpARM64MVNshiftRA:
   284  		return rewriteValueARM64_OpARM64MVNshiftRA(v)
   285  	case OpARM64MVNshiftRL:
   286  		return rewriteValueARM64_OpARM64MVNshiftRL(v)
   287  	case OpARM64MVNshiftRO:
   288  		return rewriteValueARM64_OpARM64MVNshiftRO(v)
   289  	case OpARM64NEG:
   290  		return rewriteValueARM64_OpARM64NEG(v)
   291  	case OpARM64NEGshiftLL:
   292  		return rewriteValueARM64_OpARM64NEGshiftLL(v)
   293  	case OpARM64NEGshiftRA:
   294  		return rewriteValueARM64_OpARM64NEGshiftRA(v)
   295  	case OpARM64NEGshiftRL:
   296  		return rewriteValueARM64_OpARM64NEGshiftRL(v)
   297  	case OpARM64NotEqual:
   298  		return rewriteValueARM64_OpARM64NotEqual(v)
   299  	case OpARM64OR:
   300  		return rewriteValueARM64_OpARM64OR(v)
   301  	case OpARM64ORN:
   302  		return rewriteValueARM64_OpARM64ORN(v)
   303  	case OpARM64ORNshiftLL:
   304  		return rewriteValueARM64_OpARM64ORNshiftLL(v)
   305  	case OpARM64ORNshiftRA:
   306  		return rewriteValueARM64_OpARM64ORNshiftRA(v)
   307  	case OpARM64ORNshiftRL:
   308  		return rewriteValueARM64_OpARM64ORNshiftRL(v)
   309  	case OpARM64ORNshiftRO:
   310  		return rewriteValueARM64_OpARM64ORNshiftRO(v)
   311  	case OpARM64ORconst:
   312  		return rewriteValueARM64_OpARM64ORconst(v)
   313  	case OpARM64ORshiftLL:
   314  		return rewriteValueARM64_OpARM64ORshiftLL(v)
   315  	case OpARM64ORshiftRA:
   316  		return rewriteValueARM64_OpARM64ORshiftRA(v)
   317  	case OpARM64ORshiftRL:
   318  		return rewriteValueARM64_OpARM64ORshiftRL(v)
   319  	case OpARM64ORshiftRO:
   320  		return rewriteValueARM64_OpARM64ORshiftRO(v)
   321  	case OpARM64REV:
   322  		return rewriteValueARM64_OpARM64REV(v)
   323  	case OpARM64REVW:
   324  		return rewriteValueARM64_OpARM64REVW(v)
   325  	case OpARM64ROR:
   326  		return rewriteValueARM64_OpARM64ROR(v)
   327  	case OpARM64RORW:
   328  		return rewriteValueARM64_OpARM64RORW(v)
   329  	case OpARM64SBCSflags:
   330  		return rewriteValueARM64_OpARM64SBCSflags(v)
   331  	case OpARM64SBFX:
   332  		return rewriteValueARM64_OpARM64SBFX(v)
   333  	case OpARM64SLL:
   334  		return rewriteValueARM64_OpARM64SLL(v)
   335  	case OpARM64SLLconst:
   336  		return rewriteValueARM64_OpARM64SLLconst(v)
   337  	case OpARM64SRA:
   338  		return rewriteValueARM64_OpARM64SRA(v)
   339  	case OpARM64SRAconst:
   340  		return rewriteValueARM64_OpARM64SRAconst(v)
   341  	case OpARM64SRL:
   342  		return rewriteValueARM64_OpARM64SRL(v)
   343  	case OpARM64SRLconst:
   344  		return rewriteValueARM64_OpARM64SRLconst(v)
   345  	case OpARM64STP:
   346  		return rewriteValueARM64_OpARM64STP(v)
   347  	case OpARM64SUB:
   348  		return rewriteValueARM64_OpARM64SUB(v)
   349  	case OpARM64SUBconst:
   350  		return rewriteValueARM64_OpARM64SUBconst(v)
   351  	case OpARM64SUBshiftLL:
   352  		return rewriteValueARM64_OpARM64SUBshiftLL(v)
   353  	case OpARM64SUBshiftRA:
   354  		return rewriteValueARM64_OpARM64SUBshiftRA(v)
   355  	case OpARM64SUBshiftRL:
   356  		return rewriteValueARM64_OpARM64SUBshiftRL(v)
   357  	case OpARM64TST:
   358  		return rewriteValueARM64_OpARM64TST(v)
   359  	case OpARM64TSTW:
   360  		return rewriteValueARM64_OpARM64TSTW(v)
   361  	case OpARM64TSTWconst:
   362  		return rewriteValueARM64_OpARM64TSTWconst(v)
   363  	case OpARM64TSTconst:
   364  		return rewriteValueARM64_OpARM64TSTconst(v)
   365  	case OpARM64TSTshiftLL:
   366  		return rewriteValueARM64_OpARM64TSTshiftLL(v)
   367  	case OpARM64TSTshiftRA:
   368  		return rewriteValueARM64_OpARM64TSTshiftRA(v)
   369  	case OpARM64TSTshiftRL:
   370  		return rewriteValueARM64_OpARM64TSTshiftRL(v)
   371  	case OpARM64TSTshiftRO:
   372  		return rewriteValueARM64_OpARM64TSTshiftRO(v)
   373  	case OpARM64UBFIZ:
   374  		return rewriteValueARM64_OpARM64UBFIZ(v)
   375  	case OpARM64UBFX:
   376  		return rewriteValueARM64_OpARM64UBFX(v)
   377  	case OpARM64UDIV:
   378  		return rewriteValueARM64_OpARM64UDIV(v)
   379  	case OpARM64UDIVW:
   380  		return rewriteValueARM64_OpARM64UDIVW(v)
   381  	case OpARM64UMOD:
   382  		return rewriteValueARM64_OpARM64UMOD(v)
   383  	case OpARM64UMODW:
   384  		return rewriteValueARM64_OpARM64UMODW(v)
   385  	case OpARM64XOR:
   386  		return rewriteValueARM64_OpARM64XOR(v)
   387  	case OpARM64XORconst:
   388  		return rewriteValueARM64_OpARM64XORconst(v)
   389  	case OpARM64XORshiftLL:
   390  		return rewriteValueARM64_OpARM64XORshiftLL(v)
   391  	case OpARM64XORshiftRA:
   392  		return rewriteValueARM64_OpARM64XORshiftRA(v)
   393  	case OpARM64XORshiftRL:
   394  		return rewriteValueARM64_OpARM64XORshiftRL(v)
   395  	case OpARM64XORshiftRO:
   396  		return rewriteValueARM64_OpARM64XORshiftRO(v)
   397  	case OpAbs:
   398  		v.Op = OpARM64FABSD
   399  		return true
   400  	case OpAdd16:
   401  		v.Op = OpARM64ADD
   402  		return true
   403  	case OpAdd32:
   404  		v.Op = OpARM64ADD
   405  		return true
   406  	case OpAdd32F:
   407  		v.Op = OpARM64FADDS
   408  		return true
   409  	case OpAdd64:
   410  		v.Op = OpARM64ADD
   411  		return true
   412  	case OpAdd64F:
   413  		v.Op = OpARM64FADDD
   414  		return true
   415  	case OpAdd8:
   416  		v.Op = OpARM64ADD
   417  		return true
   418  	case OpAddPtr:
   419  		v.Op = OpARM64ADD
   420  		return true
   421  	case OpAddr:
   422  		return rewriteValueARM64_OpAddr(v)
   423  	case OpAnd16:
   424  		v.Op = OpARM64AND
   425  		return true
   426  	case OpAnd32:
   427  		v.Op = OpARM64AND
   428  		return true
   429  	case OpAnd64:
   430  		v.Op = OpARM64AND
   431  		return true
   432  	case OpAnd8:
   433  		v.Op = OpARM64AND
   434  		return true
   435  	case OpAndB:
   436  		v.Op = OpARM64AND
   437  		return true
   438  	case OpAtomicAdd32:
   439  		v.Op = OpARM64LoweredAtomicAdd32
   440  		return true
   441  	case OpAtomicAdd32Variant:
   442  		v.Op = OpARM64LoweredAtomicAdd32Variant
   443  		return true
   444  	case OpAtomicAdd64:
   445  		v.Op = OpARM64LoweredAtomicAdd64
   446  		return true
   447  	case OpAtomicAdd64Variant:
   448  		v.Op = OpARM64LoweredAtomicAdd64Variant
   449  		return true
   450  	case OpAtomicAnd32value:
   451  		v.Op = OpARM64LoweredAtomicAnd32
   452  		return true
   453  	case OpAtomicAnd32valueVariant:
   454  		v.Op = OpARM64LoweredAtomicAnd32Variant
   455  		return true
   456  	case OpAtomicAnd64value:
   457  		v.Op = OpARM64LoweredAtomicAnd64
   458  		return true
   459  	case OpAtomicAnd64valueVariant:
   460  		v.Op = OpARM64LoweredAtomicAnd64Variant
   461  		return true
   462  	case OpAtomicAnd8value:
   463  		v.Op = OpARM64LoweredAtomicAnd8
   464  		return true
   465  	case OpAtomicAnd8valueVariant:
   466  		v.Op = OpARM64LoweredAtomicAnd8Variant
   467  		return true
   468  	case OpAtomicCompareAndSwap32:
   469  		v.Op = OpARM64LoweredAtomicCas32
   470  		return true
   471  	case OpAtomicCompareAndSwap32Variant:
   472  		v.Op = OpARM64LoweredAtomicCas32Variant
   473  		return true
   474  	case OpAtomicCompareAndSwap64:
   475  		v.Op = OpARM64LoweredAtomicCas64
   476  		return true
   477  	case OpAtomicCompareAndSwap64Variant:
   478  		v.Op = OpARM64LoweredAtomicCas64Variant
   479  		return true
   480  	case OpAtomicExchange32:
   481  		v.Op = OpARM64LoweredAtomicExchange32
   482  		return true
   483  	case OpAtomicExchange32Variant:
   484  		v.Op = OpARM64LoweredAtomicExchange32Variant
   485  		return true
   486  	case OpAtomicExchange64:
   487  		v.Op = OpARM64LoweredAtomicExchange64
   488  		return true
   489  	case OpAtomicExchange64Variant:
   490  		v.Op = OpARM64LoweredAtomicExchange64Variant
   491  		return true
   492  	case OpAtomicExchange8:
   493  		v.Op = OpARM64LoweredAtomicExchange8
   494  		return true
   495  	case OpAtomicExchange8Variant:
   496  		v.Op = OpARM64LoweredAtomicExchange8Variant
   497  		return true
   498  	case OpAtomicLoad32:
   499  		v.Op = OpARM64LDARW
   500  		return true
   501  	case OpAtomicLoad64:
   502  		v.Op = OpARM64LDAR
   503  		return true
   504  	case OpAtomicLoad8:
   505  		v.Op = OpARM64LDARB
   506  		return true
   507  	case OpAtomicLoadPtr:
   508  		v.Op = OpARM64LDAR
   509  		return true
   510  	case OpAtomicOr32value:
   511  		v.Op = OpARM64LoweredAtomicOr32
   512  		return true
   513  	case OpAtomicOr32valueVariant:
   514  		v.Op = OpARM64LoweredAtomicOr32Variant
   515  		return true
   516  	case OpAtomicOr64value:
   517  		v.Op = OpARM64LoweredAtomicOr64
   518  		return true
   519  	case OpAtomicOr64valueVariant:
   520  		v.Op = OpARM64LoweredAtomicOr64Variant
   521  		return true
   522  	case OpAtomicOr8value:
   523  		v.Op = OpARM64LoweredAtomicOr8
   524  		return true
   525  	case OpAtomicOr8valueVariant:
   526  		v.Op = OpARM64LoweredAtomicOr8Variant
   527  		return true
   528  	case OpAtomicStore32:
   529  		v.Op = OpARM64STLRW
   530  		return true
   531  	case OpAtomicStore64:
   532  		v.Op = OpARM64STLR
   533  		return true
   534  	case OpAtomicStore8:
   535  		v.Op = OpARM64STLRB
   536  		return true
   537  	case OpAtomicStorePtrNoWB:
   538  		v.Op = OpARM64STLR
   539  		return true
   540  	case OpAvg64u:
   541  		return rewriteValueARM64_OpAvg64u(v)
   542  	case OpBitLen16:
   543  		return rewriteValueARM64_OpBitLen16(v)
   544  	case OpBitLen32:
   545  		return rewriteValueARM64_OpBitLen32(v)
   546  	case OpBitLen64:
   547  		return rewriteValueARM64_OpBitLen64(v)
   548  	case OpBitLen8:
   549  		return rewriteValueARM64_OpBitLen8(v)
   550  	case OpBitRev16:
   551  		return rewriteValueARM64_OpBitRev16(v)
   552  	case OpBitRev32:
   553  		v.Op = OpARM64RBITW
   554  		return true
   555  	case OpBitRev64:
   556  		v.Op = OpARM64RBIT
   557  		return true
   558  	case OpBitRev8:
   559  		return rewriteValueARM64_OpBitRev8(v)
   560  	case OpBswap16:
   561  		v.Op = OpARM64REV16W
   562  		return true
   563  	case OpBswap32:
   564  		v.Op = OpARM64REVW
   565  		return true
   566  	case OpBswap64:
   567  		v.Op = OpARM64REV
   568  		return true
   569  	case OpCeil:
   570  		v.Op = OpARM64FRINTPD
   571  		return true
   572  	case OpClosureCall:
   573  		v.Op = OpARM64CALLclosure
   574  		return true
   575  	case OpCom16:
   576  		v.Op = OpARM64MVN
   577  		return true
   578  	case OpCom32:
   579  		v.Op = OpARM64MVN
   580  		return true
   581  	case OpCom64:
   582  		v.Op = OpARM64MVN
   583  		return true
   584  	case OpCom8:
   585  		v.Op = OpARM64MVN
   586  		return true
   587  	case OpCondSelect:
   588  		return rewriteValueARM64_OpCondSelect(v)
   589  	case OpConst16:
   590  		return rewriteValueARM64_OpConst16(v)
   591  	case OpConst32:
   592  		return rewriteValueARM64_OpConst32(v)
   593  	case OpConst32F:
   594  		return rewriteValueARM64_OpConst32F(v)
   595  	case OpConst64:
   596  		return rewriteValueARM64_OpConst64(v)
   597  	case OpConst64F:
   598  		return rewriteValueARM64_OpConst64F(v)
   599  	case OpConst8:
   600  		return rewriteValueARM64_OpConst8(v)
   601  	case OpConstBool:
   602  		return rewriteValueARM64_OpConstBool(v)
   603  	case OpConstNil:
   604  		return rewriteValueARM64_OpConstNil(v)
   605  	case OpCtz16:
   606  		return rewriteValueARM64_OpCtz16(v)
   607  	case OpCtz16NonZero:
   608  		v.Op = OpCtz32
   609  		return true
   610  	case OpCtz32:
   611  		return rewriteValueARM64_OpCtz32(v)
   612  	case OpCtz32NonZero:
   613  		v.Op = OpCtz32
   614  		return true
   615  	case OpCtz64:
   616  		return rewriteValueARM64_OpCtz64(v)
   617  	case OpCtz64NonZero:
   618  		v.Op = OpCtz64
   619  		return true
   620  	case OpCtz8:
   621  		return rewriteValueARM64_OpCtz8(v)
   622  	case OpCtz8NonZero:
   623  		v.Op = OpCtz32
   624  		return true
   625  	case OpCvt32Fto32:
   626  		v.Op = OpARM64FCVTZSSW
   627  		return true
   628  	case OpCvt32Fto32U:
   629  		v.Op = OpARM64FCVTZUSW
   630  		return true
   631  	case OpCvt32Fto64:
   632  		v.Op = OpARM64FCVTZSS
   633  		return true
   634  	case OpCvt32Fto64F:
   635  		v.Op = OpARM64FCVTSD
   636  		return true
   637  	case OpCvt32Fto64U:
   638  		v.Op = OpARM64FCVTZUS
   639  		return true
   640  	case OpCvt32Uto32F:
   641  		v.Op = OpARM64UCVTFWS
   642  		return true
   643  	case OpCvt32Uto64F:
   644  		v.Op = OpARM64UCVTFWD
   645  		return true
   646  	case OpCvt32to32F:
   647  		v.Op = OpARM64SCVTFWS
   648  		return true
   649  	case OpCvt32to64F:
   650  		v.Op = OpARM64SCVTFWD
   651  		return true
   652  	case OpCvt64Fto32:
   653  		v.Op = OpARM64FCVTZSDW
   654  		return true
   655  	case OpCvt64Fto32F:
   656  		v.Op = OpARM64FCVTDS
   657  		return true
   658  	case OpCvt64Fto32U:
   659  		v.Op = OpARM64FCVTZUDW
   660  		return true
   661  	case OpCvt64Fto64:
   662  		v.Op = OpARM64FCVTZSD
   663  		return true
   664  	case OpCvt64Fto64U:
   665  		v.Op = OpARM64FCVTZUD
   666  		return true
   667  	case OpCvt64Uto32F:
   668  		v.Op = OpARM64UCVTFS
   669  		return true
   670  	case OpCvt64Uto64F:
   671  		v.Op = OpARM64UCVTFD
   672  		return true
   673  	case OpCvt64to32F:
   674  		v.Op = OpARM64SCVTFS
   675  		return true
   676  	case OpCvt64to64F:
   677  		v.Op = OpARM64SCVTFD
   678  		return true
   679  	case OpCvtBoolToUint8:
   680  		v.Op = OpCopy
   681  		return true
   682  	case OpDiv16:
   683  		return rewriteValueARM64_OpDiv16(v)
   684  	case OpDiv16u:
   685  		return rewriteValueARM64_OpDiv16u(v)
   686  	case OpDiv32:
   687  		return rewriteValueARM64_OpDiv32(v)
   688  	case OpDiv32F:
   689  		v.Op = OpARM64FDIVS
   690  		return true
   691  	case OpDiv32u:
   692  		v.Op = OpARM64UDIVW
   693  		return true
   694  	case OpDiv64:
   695  		return rewriteValueARM64_OpDiv64(v)
   696  	case OpDiv64F:
   697  		v.Op = OpARM64FDIVD
   698  		return true
   699  	case OpDiv64u:
   700  		v.Op = OpARM64UDIV
   701  		return true
   702  	case OpDiv8:
   703  		return rewriteValueARM64_OpDiv8(v)
   704  	case OpDiv8u:
   705  		return rewriteValueARM64_OpDiv8u(v)
   706  	case OpEq16:
   707  		return rewriteValueARM64_OpEq16(v)
   708  	case OpEq32:
   709  		return rewriteValueARM64_OpEq32(v)
   710  	case OpEq32F:
   711  		return rewriteValueARM64_OpEq32F(v)
   712  	case OpEq64:
   713  		return rewriteValueARM64_OpEq64(v)
   714  	case OpEq64F:
   715  		return rewriteValueARM64_OpEq64F(v)
   716  	case OpEq8:
   717  		return rewriteValueARM64_OpEq8(v)
   718  	case OpEqB:
   719  		return rewriteValueARM64_OpEqB(v)
   720  	case OpEqPtr:
   721  		return rewriteValueARM64_OpEqPtr(v)
   722  	case OpFMA:
   723  		return rewriteValueARM64_OpFMA(v)
   724  	case OpFloor:
   725  		v.Op = OpARM64FRINTMD
   726  		return true
   727  	case OpGetCallerPC:
   728  		v.Op = OpARM64LoweredGetCallerPC
   729  		return true
   730  	case OpGetCallerSP:
   731  		v.Op = OpARM64LoweredGetCallerSP
   732  		return true
   733  	case OpGetClosurePtr:
   734  		v.Op = OpARM64LoweredGetClosurePtr
   735  		return true
   736  	case OpHmul32:
   737  		return rewriteValueARM64_OpHmul32(v)
   738  	case OpHmul32u:
   739  		return rewriteValueARM64_OpHmul32u(v)
   740  	case OpHmul64:
   741  		v.Op = OpARM64MULH
   742  		return true
   743  	case OpHmul64u:
   744  		v.Op = OpARM64UMULH
   745  		return true
   746  	case OpInterCall:
   747  		v.Op = OpARM64CALLinter
   748  		return true
   749  	case OpIsInBounds:
   750  		return rewriteValueARM64_OpIsInBounds(v)
   751  	case OpIsNonNil:
   752  		return rewriteValueARM64_OpIsNonNil(v)
   753  	case OpIsSliceInBounds:
   754  		return rewriteValueARM64_OpIsSliceInBounds(v)
   755  	case OpLeq16:
   756  		return rewriteValueARM64_OpLeq16(v)
   757  	case OpLeq16U:
   758  		return rewriteValueARM64_OpLeq16U(v)
   759  	case OpLeq32:
   760  		return rewriteValueARM64_OpLeq32(v)
   761  	case OpLeq32F:
   762  		return rewriteValueARM64_OpLeq32F(v)
   763  	case OpLeq32U:
   764  		return rewriteValueARM64_OpLeq32U(v)
   765  	case OpLeq64:
   766  		return rewriteValueARM64_OpLeq64(v)
   767  	case OpLeq64F:
   768  		return rewriteValueARM64_OpLeq64F(v)
   769  	case OpLeq64U:
   770  		return rewriteValueARM64_OpLeq64U(v)
   771  	case OpLeq8:
   772  		return rewriteValueARM64_OpLeq8(v)
   773  	case OpLeq8U:
   774  		return rewriteValueARM64_OpLeq8U(v)
   775  	case OpLess16:
   776  		return rewriteValueARM64_OpLess16(v)
   777  	case OpLess16U:
   778  		return rewriteValueARM64_OpLess16U(v)
   779  	case OpLess32:
   780  		return rewriteValueARM64_OpLess32(v)
   781  	case OpLess32F:
   782  		return rewriteValueARM64_OpLess32F(v)
   783  	case OpLess32U:
   784  		return rewriteValueARM64_OpLess32U(v)
   785  	case OpLess64:
   786  		return rewriteValueARM64_OpLess64(v)
   787  	case OpLess64F:
   788  		return rewriteValueARM64_OpLess64F(v)
   789  	case OpLess64U:
   790  		return rewriteValueARM64_OpLess64U(v)
   791  	case OpLess8:
   792  		return rewriteValueARM64_OpLess8(v)
   793  	case OpLess8U:
   794  		return rewriteValueARM64_OpLess8U(v)
   795  	case OpLoad:
   796  		return rewriteValueARM64_OpLoad(v)
   797  	case OpLocalAddr:
   798  		return rewriteValueARM64_OpLocalAddr(v)
   799  	case OpLsh16x16:
   800  		return rewriteValueARM64_OpLsh16x16(v)
   801  	case OpLsh16x32:
   802  		return rewriteValueARM64_OpLsh16x32(v)
   803  	case OpLsh16x64:
   804  		return rewriteValueARM64_OpLsh16x64(v)
   805  	case OpLsh16x8:
   806  		return rewriteValueARM64_OpLsh16x8(v)
   807  	case OpLsh32x16:
   808  		return rewriteValueARM64_OpLsh32x16(v)
   809  	case OpLsh32x32:
   810  		return rewriteValueARM64_OpLsh32x32(v)
   811  	case OpLsh32x64:
   812  		return rewriteValueARM64_OpLsh32x64(v)
   813  	case OpLsh32x8:
   814  		return rewriteValueARM64_OpLsh32x8(v)
   815  	case OpLsh64x16:
   816  		return rewriteValueARM64_OpLsh64x16(v)
   817  	case OpLsh64x32:
   818  		return rewriteValueARM64_OpLsh64x32(v)
   819  	case OpLsh64x64:
   820  		return rewriteValueARM64_OpLsh64x64(v)
   821  	case OpLsh64x8:
   822  		return rewriteValueARM64_OpLsh64x8(v)
   823  	case OpLsh8x16:
   824  		return rewriteValueARM64_OpLsh8x16(v)
   825  	case OpLsh8x32:
   826  		return rewriteValueARM64_OpLsh8x32(v)
   827  	case OpLsh8x64:
   828  		return rewriteValueARM64_OpLsh8x64(v)
   829  	case OpLsh8x8:
   830  		return rewriteValueARM64_OpLsh8x8(v)
   831  	case OpMax32F:
   832  		v.Op = OpARM64FMAXS
   833  		return true
   834  	case OpMax64F:
   835  		v.Op = OpARM64FMAXD
   836  		return true
   837  	case OpMin32F:
   838  		v.Op = OpARM64FMINS
   839  		return true
   840  	case OpMin64F:
   841  		v.Op = OpARM64FMIND
   842  		return true
   843  	case OpMod16:
   844  		return rewriteValueARM64_OpMod16(v)
   845  	case OpMod16u:
   846  		return rewriteValueARM64_OpMod16u(v)
   847  	case OpMod32:
   848  		return rewriteValueARM64_OpMod32(v)
   849  	case OpMod32u:
   850  		v.Op = OpARM64UMODW
   851  		return true
   852  	case OpMod64:
   853  		return rewriteValueARM64_OpMod64(v)
   854  	case OpMod64u:
   855  		v.Op = OpARM64UMOD
   856  		return true
   857  	case OpMod8:
   858  		return rewriteValueARM64_OpMod8(v)
   859  	case OpMod8u:
   860  		return rewriteValueARM64_OpMod8u(v)
   861  	case OpMove:
   862  		return rewriteValueARM64_OpMove(v)
   863  	case OpMul16:
   864  		v.Op = OpARM64MULW
   865  		return true
   866  	case OpMul32:
   867  		v.Op = OpARM64MULW
   868  		return true
   869  	case OpMul32F:
   870  		v.Op = OpARM64FMULS
   871  		return true
   872  	case OpMul64:
   873  		v.Op = OpARM64MUL
   874  		return true
   875  	case OpMul64F:
   876  		v.Op = OpARM64FMULD
   877  		return true
   878  	case OpMul8:
   879  		v.Op = OpARM64MULW
   880  		return true
   881  	case OpNeg16:
   882  		v.Op = OpARM64NEG
   883  		return true
   884  	case OpNeg32:
   885  		v.Op = OpARM64NEG
   886  		return true
   887  	case OpNeg32F:
   888  		v.Op = OpARM64FNEGS
   889  		return true
   890  	case OpNeg64:
   891  		v.Op = OpARM64NEG
   892  		return true
   893  	case OpNeg64F:
   894  		v.Op = OpARM64FNEGD
   895  		return true
   896  	case OpNeg8:
   897  		v.Op = OpARM64NEG
   898  		return true
   899  	case OpNeq16:
   900  		return rewriteValueARM64_OpNeq16(v)
   901  	case OpNeq32:
   902  		return rewriteValueARM64_OpNeq32(v)
   903  	case OpNeq32F:
   904  		return rewriteValueARM64_OpNeq32F(v)
   905  	case OpNeq64:
   906  		return rewriteValueARM64_OpNeq64(v)
   907  	case OpNeq64F:
   908  		return rewriteValueARM64_OpNeq64F(v)
   909  	case OpNeq8:
   910  		return rewriteValueARM64_OpNeq8(v)
   911  	case OpNeqB:
   912  		v.Op = OpARM64XOR
   913  		return true
   914  	case OpNeqPtr:
   915  		return rewriteValueARM64_OpNeqPtr(v)
   916  	case OpNilCheck:
   917  		v.Op = OpARM64LoweredNilCheck
   918  		return true
   919  	case OpNot:
   920  		return rewriteValueARM64_OpNot(v)
   921  	case OpOffPtr:
   922  		return rewriteValueARM64_OpOffPtr(v)
   923  	case OpOr16:
   924  		v.Op = OpARM64OR
   925  		return true
   926  	case OpOr32:
   927  		v.Op = OpARM64OR
   928  		return true
   929  	case OpOr64:
   930  		v.Op = OpARM64OR
   931  		return true
   932  	case OpOr8:
   933  		v.Op = OpARM64OR
   934  		return true
   935  	case OpOrB:
   936  		v.Op = OpARM64OR
   937  		return true
   938  	case OpPanicBounds:
   939  		return rewriteValueARM64_OpPanicBounds(v)
   940  	case OpPopCount16:
   941  		return rewriteValueARM64_OpPopCount16(v)
   942  	case OpPopCount32:
   943  		return rewriteValueARM64_OpPopCount32(v)
   944  	case OpPopCount64:
   945  		return rewriteValueARM64_OpPopCount64(v)
   946  	case OpPrefetchCache:
   947  		return rewriteValueARM64_OpPrefetchCache(v)
   948  	case OpPrefetchCacheStreamed:
   949  		return rewriteValueARM64_OpPrefetchCacheStreamed(v)
   950  	case OpPubBarrier:
   951  		return rewriteValueARM64_OpPubBarrier(v)
   952  	case OpRotateLeft16:
   953  		return rewriteValueARM64_OpRotateLeft16(v)
   954  	case OpRotateLeft32:
   955  		return rewriteValueARM64_OpRotateLeft32(v)
   956  	case OpRotateLeft64:
   957  		return rewriteValueARM64_OpRotateLeft64(v)
   958  	case OpRotateLeft8:
   959  		return rewriteValueARM64_OpRotateLeft8(v)
   960  	case OpRound:
   961  		v.Op = OpARM64FRINTAD
   962  		return true
   963  	case OpRound32F:
   964  		v.Op = OpARM64LoweredRound32F
   965  		return true
   966  	case OpRound64F:
   967  		v.Op = OpARM64LoweredRound64F
   968  		return true
   969  	case OpRoundToEven:
   970  		v.Op = OpARM64FRINTND
   971  		return true
   972  	case OpRsh16Ux16:
   973  		return rewriteValueARM64_OpRsh16Ux16(v)
   974  	case OpRsh16Ux32:
   975  		return rewriteValueARM64_OpRsh16Ux32(v)
   976  	case OpRsh16Ux64:
   977  		return rewriteValueARM64_OpRsh16Ux64(v)
   978  	case OpRsh16Ux8:
   979  		return rewriteValueARM64_OpRsh16Ux8(v)
   980  	case OpRsh16x16:
   981  		return rewriteValueARM64_OpRsh16x16(v)
   982  	case OpRsh16x32:
   983  		return rewriteValueARM64_OpRsh16x32(v)
   984  	case OpRsh16x64:
   985  		return rewriteValueARM64_OpRsh16x64(v)
   986  	case OpRsh16x8:
   987  		return rewriteValueARM64_OpRsh16x8(v)
   988  	case OpRsh32Ux16:
   989  		return rewriteValueARM64_OpRsh32Ux16(v)
   990  	case OpRsh32Ux32:
   991  		return rewriteValueARM64_OpRsh32Ux32(v)
   992  	case OpRsh32Ux64:
   993  		return rewriteValueARM64_OpRsh32Ux64(v)
   994  	case OpRsh32Ux8:
   995  		return rewriteValueARM64_OpRsh32Ux8(v)
   996  	case OpRsh32x16:
   997  		return rewriteValueARM64_OpRsh32x16(v)
   998  	case OpRsh32x32:
   999  		return rewriteValueARM64_OpRsh32x32(v)
  1000  	case OpRsh32x64:
  1001  		return rewriteValueARM64_OpRsh32x64(v)
  1002  	case OpRsh32x8:
  1003  		return rewriteValueARM64_OpRsh32x8(v)
  1004  	case OpRsh64Ux16:
  1005  		return rewriteValueARM64_OpRsh64Ux16(v)
  1006  	case OpRsh64Ux32:
  1007  		return rewriteValueARM64_OpRsh64Ux32(v)
  1008  	case OpRsh64Ux64:
  1009  		return rewriteValueARM64_OpRsh64Ux64(v)
  1010  	case OpRsh64Ux8:
  1011  		return rewriteValueARM64_OpRsh64Ux8(v)
  1012  	case OpRsh64x16:
  1013  		return rewriteValueARM64_OpRsh64x16(v)
  1014  	case OpRsh64x32:
  1015  		return rewriteValueARM64_OpRsh64x32(v)
  1016  	case OpRsh64x64:
  1017  		return rewriteValueARM64_OpRsh64x64(v)
  1018  	case OpRsh64x8:
  1019  		return rewriteValueARM64_OpRsh64x8(v)
  1020  	case OpRsh8Ux16:
  1021  		return rewriteValueARM64_OpRsh8Ux16(v)
  1022  	case OpRsh8Ux32:
  1023  		return rewriteValueARM64_OpRsh8Ux32(v)
  1024  	case OpRsh8Ux64:
  1025  		return rewriteValueARM64_OpRsh8Ux64(v)
  1026  	case OpRsh8Ux8:
  1027  		return rewriteValueARM64_OpRsh8Ux8(v)
  1028  	case OpRsh8x16:
  1029  		return rewriteValueARM64_OpRsh8x16(v)
  1030  	case OpRsh8x32:
  1031  		return rewriteValueARM64_OpRsh8x32(v)
  1032  	case OpRsh8x64:
  1033  		return rewriteValueARM64_OpRsh8x64(v)
  1034  	case OpRsh8x8:
  1035  		return rewriteValueARM64_OpRsh8x8(v)
  1036  	case OpSelect0:
  1037  		return rewriteValueARM64_OpSelect0(v)
  1038  	case OpSelect1:
  1039  		return rewriteValueARM64_OpSelect1(v)
  1040  	case OpSelectN:
  1041  		return rewriteValueARM64_OpSelectN(v)
  1042  	case OpSignExt16to32:
  1043  		v.Op = OpARM64MOVHreg
  1044  		return true
  1045  	case OpSignExt16to64:
  1046  		v.Op = OpARM64MOVHreg
  1047  		return true
  1048  	case OpSignExt32to64:
  1049  		v.Op = OpARM64MOVWreg
  1050  		return true
  1051  	case OpSignExt8to16:
  1052  		v.Op = OpARM64MOVBreg
  1053  		return true
  1054  	case OpSignExt8to32:
  1055  		v.Op = OpARM64MOVBreg
  1056  		return true
  1057  	case OpSignExt8to64:
  1058  		v.Op = OpARM64MOVBreg
  1059  		return true
  1060  	case OpSlicemask:
  1061  		return rewriteValueARM64_OpSlicemask(v)
  1062  	case OpSqrt:
  1063  		v.Op = OpARM64FSQRTD
  1064  		return true
  1065  	case OpSqrt32:
  1066  		v.Op = OpARM64FSQRTS
  1067  		return true
  1068  	case OpStaticCall:
  1069  		v.Op = OpARM64CALLstatic
  1070  		return true
  1071  	case OpStore:
  1072  		return rewriteValueARM64_OpStore(v)
  1073  	case OpSub16:
  1074  		v.Op = OpARM64SUB
  1075  		return true
  1076  	case OpSub32:
  1077  		v.Op = OpARM64SUB
  1078  		return true
  1079  	case OpSub32F:
  1080  		v.Op = OpARM64FSUBS
  1081  		return true
  1082  	case OpSub64:
  1083  		v.Op = OpARM64SUB
  1084  		return true
  1085  	case OpSub64F:
  1086  		v.Op = OpARM64FSUBD
  1087  		return true
  1088  	case OpSub8:
  1089  		v.Op = OpARM64SUB
  1090  		return true
  1091  	case OpSubPtr:
  1092  		v.Op = OpARM64SUB
  1093  		return true
  1094  	case OpTailCall:
  1095  		v.Op = OpARM64CALLtail
  1096  		return true
  1097  	case OpTrunc:
  1098  		v.Op = OpARM64FRINTZD
  1099  		return true
  1100  	case OpTrunc16to8:
  1101  		v.Op = OpCopy
  1102  		return true
  1103  	case OpTrunc32to16:
  1104  		v.Op = OpCopy
  1105  		return true
  1106  	case OpTrunc32to8:
  1107  		v.Op = OpCopy
  1108  		return true
  1109  	case OpTrunc64to16:
  1110  		v.Op = OpCopy
  1111  		return true
  1112  	case OpTrunc64to32:
  1113  		v.Op = OpCopy
  1114  		return true
  1115  	case OpTrunc64to8:
  1116  		v.Op = OpCopy
  1117  		return true
  1118  	case OpWB:
  1119  		v.Op = OpARM64LoweredWB
  1120  		return true
  1121  	case OpXor16:
  1122  		v.Op = OpARM64XOR
  1123  		return true
  1124  	case OpXor32:
  1125  		v.Op = OpARM64XOR
  1126  		return true
  1127  	case OpXor64:
  1128  		v.Op = OpARM64XOR
  1129  		return true
  1130  	case OpXor8:
  1131  		v.Op = OpARM64XOR
  1132  		return true
  1133  	case OpZero:
  1134  		return rewriteValueARM64_OpZero(v)
  1135  	case OpZeroExt16to32:
  1136  		v.Op = OpARM64MOVHUreg
  1137  		return true
  1138  	case OpZeroExt16to64:
  1139  		v.Op = OpARM64MOVHUreg
  1140  		return true
  1141  	case OpZeroExt32to64:
  1142  		v.Op = OpARM64MOVWUreg
  1143  		return true
  1144  	case OpZeroExt8to16:
  1145  		v.Op = OpARM64MOVBUreg
  1146  		return true
  1147  	case OpZeroExt8to32:
  1148  		v.Op = OpARM64MOVBUreg
  1149  		return true
  1150  	case OpZeroExt8to64:
  1151  		v.Op = OpARM64MOVBUreg
  1152  		return true
  1153  	}
  1154  	return false
  1155  }
  1156  func rewriteValueARM64_OpARM64ADCSflags(v *Value) bool {
  1157  	v_2 := v.Args[2]
  1158  	v_1 := v.Args[1]
  1159  	v_0 := v.Args[0]
  1160  	b := v.Block
  1161  	typ := &b.Func.Config.Types
  1162  	// match: (ADCSflags x y (Select1 <types.TypeFlags> (ADDSconstflags [-1] (ADCzerocarry <typ.UInt64> c))))
  1163  	// result: (ADCSflags x y c)
  1164  	for {
  1165  		x := v_0
  1166  		y := v_1
  1167  		if v_2.Op != OpSelect1 || v_2.Type != types.TypeFlags {
  1168  			break
  1169  		}
  1170  		v_2_0 := v_2.Args[0]
  1171  		if v_2_0.Op != OpARM64ADDSconstflags || auxIntToInt64(v_2_0.AuxInt) != -1 {
  1172  			break
  1173  		}
  1174  		v_2_0_0 := v_2_0.Args[0]
  1175  		if v_2_0_0.Op != OpARM64ADCzerocarry || v_2_0_0.Type != typ.UInt64 {
  1176  			break
  1177  		}
  1178  		c := v_2_0_0.Args[0]
  1179  		v.reset(OpARM64ADCSflags)
  1180  		v.AddArg3(x, y, c)
  1181  		return true
  1182  	}
  1183  	// match: (ADCSflags x y (Select1 <types.TypeFlags> (ADDSconstflags [-1] (MOVDconst [0]))))
  1184  	// result: (ADDSflags x y)
  1185  	for {
  1186  		x := v_0
  1187  		y := v_1
  1188  		if v_2.Op != OpSelect1 || v_2.Type != types.TypeFlags {
  1189  			break
  1190  		}
  1191  		v_2_0 := v_2.Args[0]
  1192  		if v_2_0.Op != OpARM64ADDSconstflags || auxIntToInt64(v_2_0.AuxInt) != -1 {
  1193  			break
  1194  		}
  1195  		v_2_0_0 := v_2_0.Args[0]
  1196  		if v_2_0_0.Op != OpARM64MOVDconst || auxIntToInt64(v_2_0_0.AuxInt) != 0 {
  1197  			break
  1198  		}
  1199  		v.reset(OpARM64ADDSflags)
  1200  		v.AddArg2(x, y)
  1201  		return true
  1202  	}
  1203  	return false
  1204  }
  1205  func rewriteValueARM64_OpARM64ADD(v *Value) bool {
  1206  	v_1 := v.Args[1]
  1207  	v_0 := v.Args[0]
  1208  	b := v.Block
  1209  	// match: (ADD x (MOVDconst <t> [c]))
  1210  	// cond: !t.IsPtr()
  1211  	// result: (ADDconst [c] x)
  1212  	for {
  1213  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
  1214  			x := v_0
  1215  			if v_1.Op != OpARM64MOVDconst {
  1216  				continue
  1217  			}
  1218  			t := v_1.Type
  1219  			c := auxIntToInt64(v_1.AuxInt)
  1220  			if !(!t.IsPtr()) {
  1221  				continue
  1222  			}
  1223  			v.reset(OpARM64ADDconst)
  1224  			v.AuxInt = int64ToAuxInt(c)
  1225  			v.AddArg(x)
  1226  			return true
  1227  		}
  1228  		break
  1229  	}
  1230  	// match: (ADD a l:(MUL x y))
  1231  	// cond: l.Uses==1 && clobber(l)
  1232  	// result: (MADD a x y)
  1233  	for {
  1234  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
  1235  			a := v_0
  1236  			l := v_1
  1237  			if l.Op != OpARM64MUL {
  1238  				continue
  1239  			}
  1240  			y := l.Args[1]
  1241  			x := l.Args[0]
  1242  			if !(l.Uses == 1 && clobber(l)) {
  1243  				continue
  1244  			}
  1245  			v.reset(OpARM64MADD)
  1246  			v.AddArg3(a, x, y)
  1247  			return true
  1248  		}
  1249  		break
  1250  	}
  1251  	// match: (ADD a l:(MNEG x y))
  1252  	// cond: l.Uses==1 && clobber(l)
  1253  	// result: (MSUB a x y)
  1254  	for {
  1255  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
  1256  			a := v_0
  1257  			l := v_1
  1258  			if l.Op != OpARM64MNEG {
  1259  				continue
  1260  			}
  1261  			y := l.Args[1]
  1262  			x := l.Args[0]
  1263  			if !(l.Uses == 1 && clobber(l)) {
  1264  				continue
  1265  			}
  1266  			v.reset(OpARM64MSUB)
  1267  			v.AddArg3(a, x, y)
  1268  			return true
  1269  		}
  1270  		break
  1271  	}
  1272  	// match: (ADD a l:(MULW x y))
  1273  	// cond: v.Type.Size() <= 4 && l.Uses==1 && clobber(l)
  1274  	// result: (MADDW a x y)
  1275  	for {
  1276  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
  1277  			a := v_0
  1278  			l := v_1
  1279  			if l.Op != OpARM64MULW {
  1280  				continue
  1281  			}
  1282  			y := l.Args[1]
  1283  			x := l.Args[0]
  1284  			if !(v.Type.Size() <= 4 && l.Uses == 1 && clobber(l)) {
  1285  				continue
  1286  			}
  1287  			v.reset(OpARM64MADDW)
  1288  			v.AddArg3(a, x, y)
  1289  			return true
  1290  		}
  1291  		break
  1292  	}
  1293  	// match: (ADD a l:(MNEGW x y))
  1294  	// cond: v.Type.Size() <= 4 && l.Uses==1 && clobber(l)
  1295  	// result: (MSUBW a x y)
  1296  	for {
  1297  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
  1298  			a := v_0
  1299  			l := v_1
  1300  			if l.Op != OpARM64MNEGW {
  1301  				continue
  1302  			}
  1303  			y := l.Args[1]
  1304  			x := l.Args[0]
  1305  			if !(v.Type.Size() <= 4 && l.Uses == 1 && clobber(l)) {
  1306  				continue
  1307  			}
  1308  			v.reset(OpARM64MSUBW)
  1309  			v.AddArg3(a, x, y)
  1310  			return true
  1311  		}
  1312  		break
  1313  	}
  1314  	// match: (ADD <t> a p:(ADDconst [c] m:(MUL _ _)))
  1315  	// cond: p.Uses==1 && m.Uses==1 && !t.IsPtrShaped()
  1316  	// result: (ADDconst [c] (ADD <v.Type> a m))
  1317  	for {
  1318  		t := v.Type
  1319  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
  1320  			a := v_0
  1321  			p := v_1
  1322  			if p.Op != OpARM64ADDconst {
  1323  				continue
  1324  			}
  1325  			c := auxIntToInt64(p.AuxInt)
  1326  			m := p.Args[0]
  1327  			if m.Op != OpARM64MUL || !(p.Uses == 1 && m.Uses == 1 && !t.IsPtrShaped()) {
  1328  				continue
  1329  			}
  1330  			v.reset(OpARM64ADDconst)
  1331  			v.AuxInt = int64ToAuxInt(c)
  1332  			v0 := b.NewValue0(v.Pos, OpARM64ADD, v.Type)
  1333  			v0.AddArg2(a, m)
  1334  			v.AddArg(v0)
  1335  			return true
  1336  		}
  1337  		break
  1338  	}
  1339  	// match: (ADD <t> a p:(ADDconst [c] m:(MULW _ _)))
  1340  	// cond: p.Uses==1 && m.Uses==1 && !t.IsPtrShaped()
  1341  	// result: (ADDconst [c] (ADD <v.Type> a m))
  1342  	for {
  1343  		t := v.Type
  1344  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
  1345  			a := v_0
  1346  			p := v_1
  1347  			if p.Op != OpARM64ADDconst {
  1348  				continue
  1349  			}
  1350  			c := auxIntToInt64(p.AuxInt)
  1351  			m := p.Args[0]
  1352  			if m.Op != OpARM64MULW || !(p.Uses == 1 && m.Uses == 1 && !t.IsPtrShaped()) {
  1353  				continue
  1354  			}
  1355  			v.reset(OpARM64ADDconst)
  1356  			v.AuxInt = int64ToAuxInt(c)
  1357  			v0 := b.NewValue0(v.Pos, OpARM64ADD, v.Type)
  1358  			v0.AddArg2(a, m)
  1359  			v.AddArg(v0)
  1360  			return true
  1361  		}
  1362  		break
  1363  	}
  1364  	// match: (ADD <t> a p:(ADDconst [c] m:(MNEG _ _)))
  1365  	// cond: p.Uses==1 && m.Uses==1 && !t.IsPtrShaped()
  1366  	// result: (ADDconst [c] (ADD <v.Type> a m))
  1367  	for {
  1368  		t := v.Type
  1369  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
  1370  			a := v_0
  1371  			p := v_1
  1372  			if p.Op != OpARM64ADDconst {
  1373  				continue
  1374  			}
  1375  			c := auxIntToInt64(p.AuxInt)
  1376  			m := p.Args[0]
  1377  			if m.Op != OpARM64MNEG || !(p.Uses == 1 && m.Uses == 1 && !t.IsPtrShaped()) {
  1378  				continue
  1379  			}
  1380  			v.reset(OpARM64ADDconst)
  1381  			v.AuxInt = int64ToAuxInt(c)
  1382  			v0 := b.NewValue0(v.Pos, OpARM64ADD, v.Type)
  1383  			v0.AddArg2(a, m)
  1384  			v.AddArg(v0)
  1385  			return true
  1386  		}
  1387  		break
  1388  	}
  1389  	// match: (ADD <t> a p:(ADDconst [c] m:(MNEGW _ _)))
  1390  	// cond: p.Uses==1 && m.Uses==1 && !t.IsPtrShaped()
  1391  	// result: (ADDconst [c] (ADD <v.Type> a m))
  1392  	for {
  1393  		t := v.Type
  1394  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
  1395  			a := v_0
  1396  			p := v_1
  1397  			if p.Op != OpARM64ADDconst {
  1398  				continue
  1399  			}
  1400  			c := auxIntToInt64(p.AuxInt)
  1401  			m := p.Args[0]
  1402  			if m.Op != OpARM64MNEGW || !(p.Uses == 1 && m.Uses == 1 && !t.IsPtrShaped()) {
  1403  				continue
  1404  			}
  1405  			v.reset(OpARM64ADDconst)
  1406  			v.AuxInt = int64ToAuxInt(c)
  1407  			v0 := b.NewValue0(v.Pos, OpARM64ADD, v.Type)
  1408  			v0.AddArg2(a, m)
  1409  			v.AddArg(v0)
  1410  			return true
  1411  		}
  1412  		break
  1413  	}
  1414  	// match: (ADD <t> a p:(SUBconst [c] m:(MUL _ _)))
  1415  	// cond: p.Uses==1 && m.Uses==1 && !t.IsPtrShaped()
  1416  	// result: (SUBconst [c] (ADD <v.Type> a m))
  1417  	for {
  1418  		t := v.Type
  1419  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
  1420  			a := v_0
  1421  			p := v_1
  1422  			if p.Op != OpARM64SUBconst {
  1423  				continue
  1424  			}
  1425  			c := auxIntToInt64(p.AuxInt)
  1426  			m := p.Args[0]
  1427  			if m.Op != OpARM64MUL || !(p.Uses == 1 && m.Uses == 1 && !t.IsPtrShaped()) {
  1428  				continue
  1429  			}
  1430  			v.reset(OpARM64SUBconst)
  1431  			v.AuxInt = int64ToAuxInt(c)
  1432  			v0 := b.NewValue0(v.Pos, OpARM64ADD, v.Type)
  1433  			v0.AddArg2(a, m)
  1434  			v.AddArg(v0)
  1435  			return true
  1436  		}
  1437  		break
  1438  	}
  1439  	// match: (ADD <t> a p:(SUBconst [c] m:(MULW _ _)))
  1440  	// cond: p.Uses==1 && m.Uses==1 && !t.IsPtrShaped()
  1441  	// result: (SUBconst [c] (ADD <v.Type> a m))
  1442  	for {
  1443  		t := v.Type
  1444  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
  1445  			a := v_0
  1446  			p := v_1
  1447  			if p.Op != OpARM64SUBconst {
  1448  				continue
  1449  			}
  1450  			c := auxIntToInt64(p.AuxInt)
  1451  			m := p.Args[0]
  1452  			if m.Op != OpARM64MULW || !(p.Uses == 1 && m.Uses == 1 && !t.IsPtrShaped()) {
  1453  				continue
  1454  			}
  1455  			v.reset(OpARM64SUBconst)
  1456  			v.AuxInt = int64ToAuxInt(c)
  1457  			v0 := b.NewValue0(v.Pos, OpARM64ADD, v.Type)
  1458  			v0.AddArg2(a, m)
  1459  			v.AddArg(v0)
  1460  			return true
  1461  		}
  1462  		break
  1463  	}
  1464  	// match: (ADD <t> a p:(SUBconst [c] m:(MNEG _ _)))
  1465  	// cond: p.Uses==1 && m.Uses==1 && !t.IsPtrShaped()
  1466  	// result: (SUBconst [c] (ADD <v.Type> a m))
  1467  	for {
  1468  		t := v.Type
  1469  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
  1470  			a := v_0
  1471  			p := v_1
  1472  			if p.Op != OpARM64SUBconst {
  1473  				continue
  1474  			}
  1475  			c := auxIntToInt64(p.AuxInt)
  1476  			m := p.Args[0]
  1477  			if m.Op != OpARM64MNEG || !(p.Uses == 1 && m.Uses == 1 && !t.IsPtrShaped()) {
  1478  				continue
  1479  			}
  1480  			v.reset(OpARM64SUBconst)
  1481  			v.AuxInt = int64ToAuxInt(c)
  1482  			v0 := b.NewValue0(v.Pos, OpARM64ADD, v.Type)
  1483  			v0.AddArg2(a, m)
  1484  			v.AddArg(v0)
  1485  			return true
  1486  		}
  1487  		break
  1488  	}
  1489  	// match: (ADD <t> a p:(SUBconst [c] m:(MNEGW _ _)))
  1490  	// cond: p.Uses==1 && m.Uses==1 && !t.IsPtrShaped()
  1491  	// result: (SUBconst [c] (ADD <v.Type> a m))
  1492  	for {
  1493  		t := v.Type
  1494  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
  1495  			a := v_0
  1496  			p := v_1
  1497  			if p.Op != OpARM64SUBconst {
  1498  				continue
  1499  			}
  1500  			c := auxIntToInt64(p.AuxInt)
  1501  			m := p.Args[0]
  1502  			if m.Op != OpARM64MNEGW || !(p.Uses == 1 && m.Uses == 1 && !t.IsPtrShaped()) {
  1503  				continue
  1504  			}
  1505  			v.reset(OpARM64SUBconst)
  1506  			v.AuxInt = int64ToAuxInt(c)
  1507  			v0 := b.NewValue0(v.Pos, OpARM64ADD, v.Type)
  1508  			v0.AddArg2(a, m)
  1509  			v.AddArg(v0)
  1510  			return true
  1511  		}
  1512  		break
  1513  	}
  1514  	// match: (ADD x (NEG y))
  1515  	// result: (SUB x y)
  1516  	for {
  1517  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
  1518  			x := v_0
  1519  			if v_1.Op != OpARM64NEG {
  1520  				continue
  1521  			}
  1522  			y := v_1.Args[0]
  1523  			v.reset(OpARM64SUB)
  1524  			v.AddArg2(x, y)
  1525  			return true
  1526  		}
  1527  		break
  1528  	}
  1529  	// match: (ADD x0 x1:(SLLconst [c] y))
  1530  	// cond: clobberIfDead(x1)
  1531  	// result: (ADDshiftLL x0 y [c])
  1532  	for {
  1533  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
  1534  			x0 := v_0
  1535  			x1 := v_1
  1536  			if x1.Op != OpARM64SLLconst {
  1537  				continue
  1538  			}
  1539  			c := auxIntToInt64(x1.AuxInt)
  1540  			y := x1.Args[0]
  1541  			if !(clobberIfDead(x1)) {
  1542  				continue
  1543  			}
  1544  			v.reset(OpARM64ADDshiftLL)
  1545  			v.AuxInt = int64ToAuxInt(c)
  1546  			v.AddArg2(x0, y)
  1547  			return true
  1548  		}
  1549  		break
  1550  	}
  1551  	// match: (ADD x0 x1:(SRLconst [c] y))
  1552  	// cond: clobberIfDead(x1)
  1553  	// result: (ADDshiftRL x0 y [c])
  1554  	for {
  1555  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
  1556  			x0 := v_0
  1557  			x1 := v_1
  1558  			if x1.Op != OpARM64SRLconst {
  1559  				continue
  1560  			}
  1561  			c := auxIntToInt64(x1.AuxInt)
  1562  			y := x1.Args[0]
  1563  			if !(clobberIfDead(x1)) {
  1564  				continue
  1565  			}
  1566  			v.reset(OpARM64ADDshiftRL)
  1567  			v.AuxInt = int64ToAuxInt(c)
  1568  			v.AddArg2(x0, y)
  1569  			return true
  1570  		}
  1571  		break
  1572  	}
  1573  	// match: (ADD x0 x1:(SRAconst [c] y))
  1574  	// cond: clobberIfDead(x1)
  1575  	// result: (ADDshiftRA x0 y [c])
  1576  	for {
  1577  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
  1578  			x0 := v_0
  1579  			x1 := v_1
  1580  			if x1.Op != OpARM64SRAconst {
  1581  				continue
  1582  			}
  1583  			c := auxIntToInt64(x1.AuxInt)
  1584  			y := x1.Args[0]
  1585  			if !(clobberIfDead(x1)) {
  1586  				continue
  1587  			}
  1588  			v.reset(OpARM64ADDshiftRA)
  1589  			v.AuxInt = int64ToAuxInt(c)
  1590  			v.AddArg2(x0, y)
  1591  			return true
  1592  		}
  1593  		break
  1594  	}
  1595  	return false
  1596  }
  1597  func rewriteValueARM64_OpARM64ADDSflags(v *Value) bool {
  1598  	v_1 := v.Args[1]
  1599  	v_0 := v.Args[0]
  1600  	// match: (ADDSflags x (MOVDconst [c]))
  1601  	// result: (ADDSconstflags [c] x)
  1602  	for {
  1603  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
  1604  			x := v_0
  1605  			if v_1.Op != OpARM64MOVDconst {
  1606  				continue
  1607  			}
  1608  			c := auxIntToInt64(v_1.AuxInt)
  1609  			v.reset(OpARM64ADDSconstflags)
  1610  			v.AuxInt = int64ToAuxInt(c)
  1611  			v.AddArg(x)
  1612  			return true
  1613  		}
  1614  		break
  1615  	}
  1616  	return false
  1617  }
  1618  func rewriteValueARM64_OpARM64ADDconst(v *Value) bool {
  1619  	v_0 := v.Args[0]
  1620  	// match: (ADDconst [off1] (MOVDaddr [off2] {sym} ptr))
  1621  	// cond: is32Bit(off1+int64(off2))
  1622  	// result: (MOVDaddr [int32(off1)+off2] {sym} ptr)
  1623  	for {
  1624  		off1 := auxIntToInt64(v.AuxInt)
  1625  		if v_0.Op != OpARM64MOVDaddr {
  1626  			break
  1627  		}
  1628  		off2 := auxIntToInt32(v_0.AuxInt)
  1629  		sym := auxToSym(v_0.Aux)
  1630  		ptr := v_0.Args[0]
  1631  		if !(is32Bit(off1 + int64(off2))) {
  1632  			break
  1633  		}
  1634  		v.reset(OpARM64MOVDaddr)
  1635  		v.AuxInt = int32ToAuxInt(int32(off1) + off2)
  1636  		v.Aux = symToAux(sym)
  1637  		v.AddArg(ptr)
  1638  		return true
  1639  	}
  1640  	// match: (ADDconst [c] y)
  1641  	// cond: c < 0
  1642  	// result: (SUBconst [-c] y)
  1643  	for {
  1644  		c := auxIntToInt64(v.AuxInt)
  1645  		y := v_0
  1646  		if !(c < 0) {
  1647  			break
  1648  		}
  1649  		v.reset(OpARM64SUBconst)
  1650  		v.AuxInt = int64ToAuxInt(-c)
  1651  		v.AddArg(y)
  1652  		return true
  1653  	}
  1654  	// match: (ADDconst [0] x)
  1655  	// result: x
  1656  	for {
  1657  		if auxIntToInt64(v.AuxInt) != 0 {
  1658  			break
  1659  		}
  1660  		x := v_0
  1661  		v.copyOf(x)
  1662  		return true
  1663  	}
  1664  	// match: (ADDconst [c] (MOVDconst [d]))
  1665  	// result: (MOVDconst [c+d])
  1666  	for {
  1667  		c := auxIntToInt64(v.AuxInt)
  1668  		if v_0.Op != OpARM64MOVDconst {
  1669  			break
  1670  		}
  1671  		d := auxIntToInt64(v_0.AuxInt)
  1672  		v.reset(OpARM64MOVDconst)
  1673  		v.AuxInt = int64ToAuxInt(c + d)
  1674  		return true
  1675  	}
  1676  	// match: (ADDconst [c] (ADDconst [d] x))
  1677  	// result: (ADDconst [c+d] x)
  1678  	for {
  1679  		c := auxIntToInt64(v.AuxInt)
  1680  		if v_0.Op != OpARM64ADDconst {
  1681  			break
  1682  		}
  1683  		d := auxIntToInt64(v_0.AuxInt)
  1684  		x := v_0.Args[0]
  1685  		v.reset(OpARM64ADDconst)
  1686  		v.AuxInt = int64ToAuxInt(c + d)
  1687  		v.AddArg(x)
  1688  		return true
  1689  	}
  1690  	// match: (ADDconst [c] (SUBconst [d] x))
  1691  	// result: (ADDconst [c-d] x)
  1692  	for {
  1693  		c := auxIntToInt64(v.AuxInt)
  1694  		if v_0.Op != OpARM64SUBconst {
  1695  			break
  1696  		}
  1697  		d := auxIntToInt64(v_0.AuxInt)
  1698  		x := v_0.Args[0]
  1699  		v.reset(OpARM64ADDconst)
  1700  		v.AuxInt = int64ToAuxInt(c - d)
  1701  		v.AddArg(x)
  1702  		return true
  1703  	}
  1704  	return false
  1705  }
  1706  func rewriteValueARM64_OpARM64ADDshiftLL(v *Value) bool {
  1707  	v_1 := v.Args[1]
  1708  	v_0 := v.Args[0]
  1709  	b := v.Block
  1710  	typ := &b.Func.Config.Types
  1711  	// match: (ADDshiftLL (MOVDconst [c]) x [d])
  1712  	// result: (ADDconst [c] (SLLconst <x.Type> x [d]))
  1713  	for {
  1714  		d := auxIntToInt64(v.AuxInt)
  1715  		if v_0.Op != OpARM64MOVDconst {
  1716  			break
  1717  		}
  1718  		c := auxIntToInt64(v_0.AuxInt)
  1719  		x := v_1
  1720  		v.reset(OpARM64ADDconst)
  1721  		v.AuxInt = int64ToAuxInt(c)
  1722  		v0 := b.NewValue0(v.Pos, OpARM64SLLconst, x.Type)
  1723  		v0.AuxInt = int64ToAuxInt(d)
  1724  		v0.AddArg(x)
  1725  		v.AddArg(v0)
  1726  		return true
  1727  	}
  1728  	// match: (ADDshiftLL x (MOVDconst [c]) [d])
  1729  	// result: (ADDconst x [int64(uint64(c)<<uint64(d))])
  1730  	for {
  1731  		d := auxIntToInt64(v.AuxInt)
  1732  		x := v_0
  1733  		if v_1.Op != OpARM64MOVDconst {
  1734  			break
  1735  		}
  1736  		c := auxIntToInt64(v_1.AuxInt)
  1737  		v.reset(OpARM64ADDconst)
  1738  		v.AuxInt = int64ToAuxInt(int64(uint64(c) << uint64(d)))
  1739  		v.AddArg(x)
  1740  		return true
  1741  	}
  1742  	// match: (ADDshiftLL <typ.UInt16> [8] (UBFX <typ.UInt16> [armBFAuxInt(8, 8)] x) x)
  1743  	// result: (REV16W x)
  1744  	for {
  1745  		if v.Type != typ.UInt16 || auxIntToInt64(v.AuxInt) != 8 || v_0.Op != OpARM64UBFX || v_0.Type != typ.UInt16 || auxIntToArm64BitField(v_0.AuxInt) != armBFAuxInt(8, 8) {
  1746  			break
  1747  		}
  1748  		x := v_0.Args[0]
  1749  		if x != v_1 {
  1750  			break
  1751  		}
  1752  		v.reset(OpARM64REV16W)
  1753  		v.AddArg(x)
  1754  		return true
  1755  	}
  1756  	// match: (ADDshiftLL [8] (UBFX [armBFAuxInt(8, 24)] (ANDconst [c1] x)) (ANDconst [c2] x))
  1757  	// cond: uint32(c1) == 0xff00ff00 && uint32(c2) == 0x00ff00ff
  1758  	// result: (REV16W x)
  1759  	for {
  1760  		if auxIntToInt64(v.AuxInt) != 8 || v_0.Op != OpARM64UBFX || auxIntToArm64BitField(v_0.AuxInt) != armBFAuxInt(8, 24) {
  1761  			break
  1762  		}
  1763  		v_0_0 := v_0.Args[0]
  1764  		if v_0_0.Op != OpARM64ANDconst {
  1765  			break
  1766  		}
  1767  		c1 := auxIntToInt64(v_0_0.AuxInt)
  1768  		x := v_0_0.Args[0]
  1769  		if v_1.Op != OpARM64ANDconst {
  1770  			break
  1771  		}
  1772  		c2 := auxIntToInt64(v_1.AuxInt)
  1773  		if x != v_1.Args[0] || !(uint32(c1) == 0xff00ff00 && uint32(c2) == 0x00ff00ff) {
  1774  			break
  1775  		}
  1776  		v.reset(OpARM64REV16W)
  1777  		v.AddArg(x)
  1778  		return true
  1779  	}
  1780  	// match: (ADDshiftLL [8] (SRLconst [8] (ANDconst [c1] x)) (ANDconst [c2] x))
  1781  	// cond: (uint64(c1) == 0xff00ff00ff00ff00 && uint64(c2) == 0x00ff00ff00ff00ff)
  1782  	// result: (REV16 x)
  1783  	for {
  1784  		if auxIntToInt64(v.AuxInt) != 8 || v_0.Op != OpARM64SRLconst || auxIntToInt64(v_0.AuxInt) != 8 {
  1785  			break
  1786  		}
  1787  		v_0_0 := v_0.Args[0]
  1788  		if v_0_0.Op != OpARM64ANDconst {
  1789  			break
  1790  		}
  1791  		c1 := auxIntToInt64(v_0_0.AuxInt)
  1792  		x := v_0_0.Args[0]
  1793  		if v_1.Op != OpARM64ANDconst {
  1794  			break
  1795  		}
  1796  		c2 := auxIntToInt64(v_1.AuxInt)
  1797  		if x != v_1.Args[0] || !(uint64(c1) == 0xff00ff00ff00ff00 && uint64(c2) == 0x00ff00ff00ff00ff) {
  1798  			break
  1799  		}
  1800  		v.reset(OpARM64REV16)
  1801  		v.AddArg(x)
  1802  		return true
  1803  	}
  1804  	// match: (ADDshiftLL [8] (SRLconst [8] (ANDconst [c1] x)) (ANDconst [c2] x))
  1805  	// cond: (uint64(c1) == 0xff00ff00 && uint64(c2) == 0x00ff00ff)
  1806  	// result: (REV16 (ANDconst <x.Type> [0xffffffff] x))
  1807  	for {
  1808  		if auxIntToInt64(v.AuxInt) != 8 || v_0.Op != OpARM64SRLconst || auxIntToInt64(v_0.AuxInt) != 8 {
  1809  			break
  1810  		}
  1811  		v_0_0 := v_0.Args[0]
  1812  		if v_0_0.Op != OpARM64ANDconst {
  1813  			break
  1814  		}
  1815  		c1 := auxIntToInt64(v_0_0.AuxInt)
  1816  		x := v_0_0.Args[0]
  1817  		if v_1.Op != OpARM64ANDconst {
  1818  			break
  1819  		}
  1820  		c2 := auxIntToInt64(v_1.AuxInt)
  1821  		if x != v_1.Args[0] || !(uint64(c1) == 0xff00ff00 && uint64(c2) == 0x00ff00ff) {
  1822  			break
  1823  		}
  1824  		v.reset(OpARM64REV16)
  1825  		v0 := b.NewValue0(v.Pos, OpARM64ANDconst, x.Type)
  1826  		v0.AuxInt = int64ToAuxInt(0xffffffff)
  1827  		v0.AddArg(x)
  1828  		v.AddArg(v0)
  1829  		return true
  1830  	}
  1831  	// match: (ADDshiftLL [c] (SRLconst x [64-c]) x2)
  1832  	// result: (EXTRconst [64-c] x2 x)
  1833  	for {
  1834  		c := auxIntToInt64(v.AuxInt)
  1835  		if v_0.Op != OpARM64SRLconst || auxIntToInt64(v_0.AuxInt) != 64-c {
  1836  			break
  1837  		}
  1838  		x := v_0.Args[0]
  1839  		x2 := v_1
  1840  		v.reset(OpARM64EXTRconst)
  1841  		v.AuxInt = int64ToAuxInt(64 - c)
  1842  		v.AddArg2(x2, x)
  1843  		return true
  1844  	}
  1845  	// match: (ADDshiftLL <t> [c] (UBFX [bfc] x) x2)
  1846  	// cond: c < 32 && t.Size() == 4 && bfc == armBFAuxInt(32-c, c)
  1847  	// result: (EXTRWconst [32-c] x2 x)
  1848  	for {
  1849  		t := v.Type
  1850  		c := auxIntToInt64(v.AuxInt)
  1851  		if v_0.Op != OpARM64UBFX {
  1852  			break
  1853  		}
  1854  		bfc := auxIntToArm64BitField(v_0.AuxInt)
  1855  		x := v_0.Args[0]
  1856  		x2 := v_1
  1857  		if !(c < 32 && t.Size() == 4 && bfc == armBFAuxInt(32-c, c)) {
  1858  			break
  1859  		}
  1860  		v.reset(OpARM64EXTRWconst)
  1861  		v.AuxInt = int64ToAuxInt(32 - c)
  1862  		v.AddArg2(x2, x)
  1863  		return true
  1864  	}
  1865  	return false
  1866  }
  1867  func rewriteValueARM64_OpARM64ADDshiftRA(v *Value) bool {
  1868  	v_1 := v.Args[1]
  1869  	v_0 := v.Args[0]
  1870  	b := v.Block
  1871  	// match: (ADDshiftRA (MOVDconst [c]) x [d])
  1872  	// result: (ADDconst [c] (SRAconst <x.Type> x [d]))
  1873  	for {
  1874  		d := auxIntToInt64(v.AuxInt)
  1875  		if v_0.Op != OpARM64MOVDconst {
  1876  			break
  1877  		}
  1878  		c := auxIntToInt64(v_0.AuxInt)
  1879  		x := v_1
  1880  		v.reset(OpARM64ADDconst)
  1881  		v.AuxInt = int64ToAuxInt(c)
  1882  		v0 := b.NewValue0(v.Pos, OpARM64SRAconst, x.Type)
  1883  		v0.AuxInt = int64ToAuxInt(d)
  1884  		v0.AddArg(x)
  1885  		v.AddArg(v0)
  1886  		return true
  1887  	}
  1888  	// match: (ADDshiftRA x (MOVDconst [c]) [d])
  1889  	// result: (ADDconst x [c>>uint64(d)])
  1890  	for {
  1891  		d := auxIntToInt64(v.AuxInt)
  1892  		x := v_0
  1893  		if v_1.Op != OpARM64MOVDconst {
  1894  			break
  1895  		}
  1896  		c := auxIntToInt64(v_1.AuxInt)
  1897  		v.reset(OpARM64ADDconst)
  1898  		v.AuxInt = int64ToAuxInt(c >> uint64(d))
  1899  		v.AddArg(x)
  1900  		return true
  1901  	}
  1902  	return false
  1903  }
  1904  func rewriteValueARM64_OpARM64ADDshiftRL(v *Value) bool {
  1905  	v_1 := v.Args[1]
  1906  	v_0 := v.Args[0]
  1907  	b := v.Block
  1908  	// match: (ADDshiftRL (MOVDconst [c]) x [d])
  1909  	// result: (ADDconst [c] (SRLconst <x.Type> x [d]))
  1910  	for {
  1911  		d := auxIntToInt64(v.AuxInt)
  1912  		if v_0.Op != OpARM64MOVDconst {
  1913  			break
  1914  		}
  1915  		c := auxIntToInt64(v_0.AuxInt)
  1916  		x := v_1
  1917  		v.reset(OpARM64ADDconst)
  1918  		v.AuxInt = int64ToAuxInt(c)
  1919  		v0 := b.NewValue0(v.Pos, OpARM64SRLconst, x.Type)
  1920  		v0.AuxInt = int64ToAuxInt(d)
  1921  		v0.AddArg(x)
  1922  		v.AddArg(v0)
  1923  		return true
  1924  	}
  1925  	// match: (ADDshiftRL x (MOVDconst [c]) [d])
  1926  	// result: (ADDconst x [int64(uint64(c)>>uint64(d))])
  1927  	for {
  1928  		d := auxIntToInt64(v.AuxInt)
  1929  		x := v_0
  1930  		if v_1.Op != OpARM64MOVDconst {
  1931  			break
  1932  		}
  1933  		c := auxIntToInt64(v_1.AuxInt)
  1934  		v.reset(OpARM64ADDconst)
  1935  		v.AuxInt = int64ToAuxInt(int64(uint64(c) >> uint64(d)))
  1936  		v.AddArg(x)
  1937  		return true
  1938  	}
  1939  	return false
  1940  }
  1941  func rewriteValueARM64_OpARM64AND(v *Value) bool {
  1942  	v_1 := v.Args[1]
  1943  	v_0 := v.Args[0]
  1944  	// match: (AND x (MOVDconst [c]))
  1945  	// result: (ANDconst [c] x)
  1946  	for {
  1947  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
  1948  			x := v_0
  1949  			if v_1.Op != OpARM64MOVDconst {
  1950  				continue
  1951  			}
  1952  			c := auxIntToInt64(v_1.AuxInt)
  1953  			v.reset(OpARM64ANDconst)
  1954  			v.AuxInt = int64ToAuxInt(c)
  1955  			v.AddArg(x)
  1956  			return true
  1957  		}
  1958  		break
  1959  	}
  1960  	// match: (AND x x)
  1961  	// result: x
  1962  	for {
  1963  		x := v_0
  1964  		if x != v_1 {
  1965  			break
  1966  		}
  1967  		v.copyOf(x)
  1968  		return true
  1969  	}
  1970  	// match: (AND x (MVN y))
  1971  	// result: (BIC x y)
  1972  	for {
  1973  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
  1974  			x := v_0
  1975  			if v_1.Op != OpARM64MVN {
  1976  				continue
  1977  			}
  1978  			y := v_1.Args[0]
  1979  			v.reset(OpARM64BIC)
  1980  			v.AddArg2(x, y)
  1981  			return true
  1982  		}
  1983  		break
  1984  	}
  1985  	// match: (AND x0 x1:(SLLconst [c] y))
  1986  	// cond: clobberIfDead(x1)
  1987  	// result: (ANDshiftLL x0 y [c])
  1988  	for {
  1989  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
  1990  			x0 := v_0
  1991  			x1 := v_1
  1992  			if x1.Op != OpARM64SLLconst {
  1993  				continue
  1994  			}
  1995  			c := auxIntToInt64(x1.AuxInt)
  1996  			y := x1.Args[0]
  1997  			if !(clobberIfDead(x1)) {
  1998  				continue
  1999  			}
  2000  			v.reset(OpARM64ANDshiftLL)
  2001  			v.AuxInt = int64ToAuxInt(c)
  2002  			v.AddArg2(x0, y)
  2003  			return true
  2004  		}
  2005  		break
  2006  	}
  2007  	// match: (AND x0 x1:(SRLconst [c] y))
  2008  	// cond: clobberIfDead(x1)
  2009  	// result: (ANDshiftRL x0 y [c])
  2010  	for {
  2011  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
  2012  			x0 := v_0
  2013  			x1 := v_1
  2014  			if x1.Op != OpARM64SRLconst {
  2015  				continue
  2016  			}
  2017  			c := auxIntToInt64(x1.AuxInt)
  2018  			y := x1.Args[0]
  2019  			if !(clobberIfDead(x1)) {
  2020  				continue
  2021  			}
  2022  			v.reset(OpARM64ANDshiftRL)
  2023  			v.AuxInt = int64ToAuxInt(c)
  2024  			v.AddArg2(x0, y)
  2025  			return true
  2026  		}
  2027  		break
  2028  	}
  2029  	// match: (AND x0 x1:(SRAconst [c] y))
  2030  	// cond: clobberIfDead(x1)
  2031  	// result: (ANDshiftRA x0 y [c])
  2032  	for {
  2033  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
  2034  			x0 := v_0
  2035  			x1 := v_1
  2036  			if x1.Op != OpARM64SRAconst {
  2037  				continue
  2038  			}
  2039  			c := auxIntToInt64(x1.AuxInt)
  2040  			y := x1.Args[0]
  2041  			if !(clobberIfDead(x1)) {
  2042  				continue
  2043  			}
  2044  			v.reset(OpARM64ANDshiftRA)
  2045  			v.AuxInt = int64ToAuxInt(c)
  2046  			v.AddArg2(x0, y)
  2047  			return true
  2048  		}
  2049  		break
  2050  	}
  2051  	// match: (AND x0 x1:(RORconst [c] y))
  2052  	// cond: clobberIfDead(x1)
  2053  	// result: (ANDshiftRO x0 y [c])
  2054  	for {
  2055  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
  2056  			x0 := v_0
  2057  			x1 := v_1
  2058  			if x1.Op != OpARM64RORconst {
  2059  				continue
  2060  			}
  2061  			c := auxIntToInt64(x1.AuxInt)
  2062  			y := x1.Args[0]
  2063  			if !(clobberIfDead(x1)) {
  2064  				continue
  2065  			}
  2066  			v.reset(OpARM64ANDshiftRO)
  2067  			v.AuxInt = int64ToAuxInt(c)
  2068  			v.AddArg2(x0, y)
  2069  			return true
  2070  		}
  2071  		break
  2072  	}
  2073  	return false
  2074  }
  2075  func rewriteValueARM64_OpARM64ANDconst(v *Value) bool {
  2076  	v_0 := v.Args[0]
  2077  	// match: (ANDconst [0] _)
  2078  	// result: (MOVDconst [0])
  2079  	for {
  2080  		if auxIntToInt64(v.AuxInt) != 0 {
  2081  			break
  2082  		}
  2083  		v.reset(OpARM64MOVDconst)
  2084  		v.AuxInt = int64ToAuxInt(0)
  2085  		return true
  2086  	}
  2087  	// match: (ANDconst [-1] x)
  2088  	// result: x
  2089  	for {
  2090  		if auxIntToInt64(v.AuxInt) != -1 {
  2091  			break
  2092  		}
  2093  		x := v_0
  2094  		v.copyOf(x)
  2095  		return true
  2096  	}
  2097  	// match: (ANDconst [c] (MOVDconst [d]))
  2098  	// result: (MOVDconst [c&d])
  2099  	for {
  2100  		c := auxIntToInt64(v.AuxInt)
  2101  		if v_0.Op != OpARM64MOVDconst {
  2102  			break
  2103  		}
  2104  		d := auxIntToInt64(v_0.AuxInt)
  2105  		v.reset(OpARM64MOVDconst)
  2106  		v.AuxInt = int64ToAuxInt(c & d)
  2107  		return true
  2108  	}
  2109  	// match: (ANDconst [c] (ANDconst [d] x))
  2110  	// result: (ANDconst [c&d] x)
  2111  	for {
  2112  		c := auxIntToInt64(v.AuxInt)
  2113  		if v_0.Op != OpARM64ANDconst {
  2114  			break
  2115  		}
  2116  		d := auxIntToInt64(v_0.AuxInt)
  2117  		x := v_0.Args[0]
  2118  		v.reset(OpARM64ANDconst)
  2119  		v.AuxInt = int64ToAuxInt(c & d)
  2120  		v.AddArg(x)
  2121  		return true
  2122  	}
  2123  	// match: (ANDconst [c] (MOVWUreg x))
  2124  	// result: (ANDconst [c&(1<<32-1)] x)
  2125  	for {
  2126  		c := auxIntToInt64(v.AuxInt)
  2127  		if v_0.Op != OpARM64MOVWUreg {
  2128  			break
  2129  		}
  2130  		x := v_0.Args[0]
  2131  		v.reset(OpARM64ANDconst)
  2132  		v.AuxInt = int64ToAuxInt(c & (1<<32 - 1))
  2133  		v.AddArg(x)
  2134  		return true
  2135  	}
  2136  	// match: (ANDconst [c] (MOVHUreg x))
  2137  	// result: (ANDconst [c&(1<<16-1)] x)
  2138  	for {
  2139  		c := auxIntToInt64(v.AuxInt)
  2140  		if v_0.Op != OpARM64MOVHUreg {
  2141  			break
  2142  		}
  2143  		x := v_0.Args[0]
  2144  		v.reset(OpARM64ANDconst)
  2145  		v.AuxInt = int64ToAuxInt(c & (1<<16 - 1))
  2146  		v.AddArg(x)
  2147  		return true
  2148  	}
  2149  	// match: (ANDconst [c] (MOVBUreg x))
  2150  	// result: (ANDconst [c&(1<<8-1)] x)
  2151  	for {
  2152  		c := auxIntToInt64(v.AuxInt)
  2153  		if v_0.Op != OpARM64MOVBUreg {
  2154  			break
  2155  		}
  2156  		x := v_0.Args[0]
  2157  		v.reset(OpARM64ANDconst)
  2158  		v.AuxInt = int64ToAuxInt(c & (1<<8 - 1))
  2159  		v.AddArg(x)
  2160  		return true
  2161  	}
  2162  	// match: (ANDconst [ac] (SLLconst [sc] x))
  2163  	// cond: isARM64BFMask(sc, ac, sc)
  2164  	// result: (UBFIZ [armBFAuxInt(sc, arm64BFWidth(ac, sc))] x)
  2165  	for {
  2166  		ac := auxIntToInt64(v.AuxInt)
  2167  		if v_0.Op != OpARM64SLLconst {
  2168  			break
  2169  		}
  2170  		sc := auxIntToInt64(v_0.AuxInt)
  2171  		x := v_0.Args[0]
  2172  		if !(isARM64BFMask(sc, ac, sc)) {
  2173  			break
  2174  		}
  2175  		v.reset(OpARM64UBFIZ)
  2176  		v.AuxInt = arm64BitFieldToAuxInt(armBFAuxInt(sc, arm64BFWidth(ac, sc)))
  2177  		v.AddArg(x)
  2178  		return true
  2179  	}
  2180  	// match: (ANDconst [ac] (SRLconst [sc] x))
  2181  	// cond: isARM64BFMask(sc, ac, 0)
  2182  	// result: (UBFX [armBFAuxInt(sc, arm64BFWidth(ac, 0))] x)
  2183  	for {
  2184  		ac := auxIntToInt64(v.AuxInt)
  2185  		if v_0.Op != OpARM64SRLconst {
  2186  			break
  2187  		}
  2188  		sc := auxIntToInt64(v_0.AuxInt)
  2189  		x := v_0.Args[0]
  2190  		if !(isARM64BFMask(sc, ac, 0)) {
  2191  			break
  2192  		}
  2193  		v.reset(OpARM64UBFX)
  2194  		v.AuxInt = arm64BitFieldToAuxInt(armBFAuxInt(sc, arm64BFWidth(ac, 0)))
  2195  		v.AddArg(x)
  2196  		return true
  2197  	}
  2198  	// match: (ANDconst [c] (UBFX [bfc] x))
  2199  	// cond: isARM64BFMask(0, c, 0)
  2200  	// result: (UBFX [armBFAuxInt(bfc.lsb(), min(bfc.width(), arm64BFWidth(c, 0)))] x)
  2201  	for {
  2202  		c := auxIntToInt64(v.AuxInt)
  2203  		if v_0.Op != OpARM64UBFX {
  2204  			break
  2205  		}
  2206  		bfc := auxIntToArm64BitField(v_0.AuxInt)
  2207  		x := v_0.Args[0]
  2208  		if !(isARM64BFMask(0, c, 0)) {
  2209  			break
  2210  		}
  2211  		v.reset(OpARM64UBFX)
  2212  		v.AuxInt = arm64BitFieldToAuxInt(armBFAuxInt(bfc.lsb(), min(bfc.width(), arm64BFWidth(c, 0))))
  2213  		v.AddArg(x)
  2214  		return true
  2215  	}
  2216  	return false
  2217  }
  2218  func rewriteValueARM64_OpARM64ANDshiftLL(v *Value) bool {
  2219  	v_1 := v.Args[1]
  2220  	v_0 := v.Args[0]
  2221  	b := v.Block
  2222  	// match: (ANDshiftLL (MOVDconst [c]) x [d])
  2223  	// result: (ANDconst [c] (SLLconst <x.Type> x [d]))
  2224  	for {
  2225  		d := auxIntToInt64(v.AuxInt)
  2226  		if v_0.Op != OpARM64MOVDconst {
  2227  			break
  2228  		}
  2229  		c := auxIntToInt64(v_0.AuxInt)
  2230  		x := v_1
  2231  		v.reset(OpARM64ANDconst)
  2232  		v.AuxInt = int64ToAuxInt(c)
  2233  		v0 := b.NewValue0(v.Pos, OpARM64SLLconst, x.Type)
  2234  		v0.AuxInt = int64ToAuxInt(d)
  2235  		v0.AddArg(x)
  2236  		v.AddArg(v0)
  2237  		return true
  2238  	}
  2239  	// match: (ANDshiftLL x (MOVDconst [c]) [d])
  2240  	// result: (ANDconst x [int64(uint64(c)<<uint64(d))])
  2241  	for {
  2242  		d := auxIntToInt64(v.AuxInt)
  2243  		x := v_0
  2244  		if v_1.Op != OpARM64MOVDconst {
  2245  			break
  2246  		}
  2247  		c := auxIntToInt64(v_1.AuxInt)
  2248  		v.reset(OpARM64ANDconst)
  2249  		v.AuxInt = int64ToAuxInt(int64(uint64(c) << uint64(d)))
  2250  		v.AddArg(x)
  2251  		return true
  2252  	}
  2253  	// match: (ANDshiftLL y:(SLLconst x [c]) x [c])
  2254  	// result: y
  2255  	for {
  2256  		c := auxIntToInt64(v.AuxInt)
  2257  		y := v_0
  2258  		if y.Op != OpARM64SLLconst || auxIntToInt64(y.AuxInt) != c {
  2259  			break
  2260  		}
  2261  		x := y.Args[0]
  2262  		if x != v_1 {
  2263  			break
  2264  		}
  2265  		v.copyOf(y)
  2266  		return true
  2267  	}
  2268  	return false
  2269  }
  2270  func rewriteValueARM64_OpARM64ANDshiftRA(v *Value) bool {
  2271  	v_1 := v.Args[1]
  2272  	v_0 := v.Args[0]
  2273  	b := v.Block
  2274  	// match: (ANDshiftRA (MOVDconst [c]) x [d])
  2275  	// result: (ANDconst [c] (SRAconst <x.Type> x [d]))
  2276  	for {
  2277  		d := auxIntToInt64(v.AuxInt)
  2278  		if v_0.Op != OpARM64MOVDconst {
  2279  			break
  2280  		}
  2281  		c := auxIntToInt64(v_0.AuxInt)
  2282  		x := v_1
  2283  		v.reset(OpARM64ANDconst)
  2284  		v.AuxInt = int64ToAuxInt(c)
  2285  		v0 := b.NewValue0(v.Pos, OpARM64SRAconst, x.Type)
  2286  		v0.AuxInt = int64ToAuxInt(d)
  2287  		v0.AddArg(x)
  2288  		v.AddArg(v0)
  2289  		return true
  2290  	}
  2291  	// match: (ANDshiftRA x (MOVDconst [c]) [d])
  2292  	// result: (ANDconst x [c>>uint64(d)])
  2293  	for {
  2294  		d := auxIntToInt64(v.AuxInt)
  2295  		x := v_0
  2296  		if v_1.Op != OpARM64MOVDconst {
  2297  			break
  2298  		}
  2299  		c := auxIntToInt64(v_1.AuxInt)
  2300  		v.reset(OpARM64ANDconst)
  2301  		v.AuxInt = int64ToAuxInt(c >> uint64(d))
  2302  		v.AddArg(x)
  2303  		return true
  2304  	}
  2305  	// match: (ANDshiftRA y:(SRAconst x [c]) x [c])
  2306  	// result: y
  2307  	for {
  2308  		c := auxIntToInt64(v.AuxInt)
  2309  		y := v_0
  2310  		if y.Op != OpARM64SRAconst || auxIntToInt64(y.AuxInt) != c {
  2311  			break
  2312  		}
  2313  		x := y.Args[0]
  2314  		if x != v_1 {
  2315  			break
  2316  		}
  2317  		v.copyOf(y)
  2318  		return true
  2319  	}
  2320  	return false
  2321  }
  2322  func rewriteValueARM64_OpARM64ANDshiftRL(v *Value) bool {
  2323  	v_1 := v.Args[1]
  2324  	v_0 := v.Args[0]
  2325  	b := v.Block
  2326  	// match: (ANDshiftRL (MOVDconst [c]) x [d])
  2327  	// result: (ANDconst [c] (SRLconst <x.Type> x [d]))
  2328  	for {
  2329  		d := auxIntToInt64(v.AuxInt)
  2330  		if v_0.Op != OpARM64MOVDconst {
  2331  			break
  2332  		}
  2333  		c := auxIntToInt64(v_0.AuxInt)
  2334  		x := v_1
  2335  		v.reset(OpARM64ANDconst)
  2336  		v.AuxInt = int64ToAuxInt(c)
  2337  		v0 := b.NewValue0(v.Pos, OpARM64SRLconst, x.Type)
  2338  		v0.AuxInt = int64ToAuxInt(d)
  2339  		v0.AddArg(x)
  2340  		v.AddArg(v0)
  2341  		return true
  2342  	}
  2343  	// match: (ANDshiftRL x (MOVDconst [c]) [d])
  2344  	// result: (ANDconst x [int64(uint64(c)>>uint64(d))])
  2345  	for {
  2346  		d := auxIntToInt64(v.AuxInt)
  2347  		x := v_0
  2348  		if v_1.Op != OpARM64MOVDconst {
  2349  			break
  2350  		}
  2351  		c := auxIntToInt64(v_1.AuxInt)
  2352  		v.reset(OpARM64ANDconst)
  2353  		v.AuxInt = int64ToAuxInt(int64(uint64(c) >> uint64(d)))
  2354  		v.AddArg(x)
  2355  		return true
  2356  	}
  2357  	// match: (ANDshiftRL y:(SRLconst x [c]) x [c])
  2358  	// result: y
  2359  	for {
  2360  		c := auxIntToInt64(v.AuxInt)
  2361  		y := v_0
  2362  		if y.Op != OpARM64SRLconst || auxIntToInt64(y.AuxInt) != c {
  2363  			break
  2364  		}
  2365  		x := y.Args[0]
  2366  		if x != v_1 {
  2367  			break
  2368  		}
  2369  		v.copyOf(y)
  2370  		return true
  2371  	}
  2372  	return false
  2373  }
  2374  func rewriteValueARM64_OpARM64ANDshiftRO(v *Value) bool {
  2375  	v_1 := v.Args[1]
  2376  	v_0 := v.Args[0]
  2377  	b := v.Block
  2378  	// match: (ANDshiftRO (MOVDconst [c]) x [d])
  2379  	// result: (ANDconst [c] (RORconst <x.Type> x [d]))
  2380  	for {
  2381  		d := auxIntToInt64(v.AuxInt)
  2382  		if v_0.Op != OpARM64MOVDconst {
  2383  			break
  2384  		}
  2385  		c := auxIntToInt64(v_0.AuxInt)
  2386  		x := v_1
  2387  		v.reset(OpARM64ANDconst)
  2388  		v.AuxInt = int64ToAuxInt(c)
  2389  		v0 := b.NewValue0(v.Pos, OpARM64RORconst, x.Type)
  2390  		v0.AuxInt = int64ToAuxInt(d)
  2391  		v0.AddArg(x)
  2392  		v.AddArg(v0)
  2393  		return true
  2394  	}
  2395  	// match: (ANDshiftRO x (MOVDconst [c]) [d])
  2396  	// result: (ANDconst x [rotateRight64(c, d)])
  2397  	for {
  2398  		d := auxIntToInt64(v.AuxInt)
  2399  		x := v_0
  2400  		if v_1.Op != OpARM64MOVDconst {
  2401  			break
  2402  		}
  2403  		c := auxIntToInt64(v_1.AuxInt)
  2404  		v.reset(OpARM64ANDconst)
  2405  		v.AuxInt = int64ToAuxInt(rotateRight64(c, d))
  2406  		v.AddArg(x)
  2407  		return true
  2408  	}
  2409  	// match: (ANDshiftRO y:(RORconst x [c]) x [c])
  2410  	// result: y
  2411  	for {
  2412  		c := auxIntToInt64(v.AuxInt)
  2413  		y := v_0
  2414  		if y.Op != OpARM64RORconst || auxIntToInt64(y.AuxInt) != c {
  2415  			break
  2416  		}
  2417  		x := y.Args[0]
  2418  		if x != v_1 {
  2419  			break
  2420  		}
  2421  		v.copyOf(y)
  2422  		return true
  2423  	}
  2424  	return false
  2425  }
  2426  func rewriteValueARM64_OpARM64BIC(v *Value) bool {
  2427  	v_1 := v.Args[1]
  2428  	v_0 := v.Args[0]
  2429  	// match: (BIC x (MOVDconst [c]))
  2430  	// result: (ANDconst [^c] x)
  2431  	for {
  2432  		x := v_0
  2433  		if v_1.Op != OpARM64MOVDconst {
  2434  			break
  2435  		}
  2436  		c := auxIntToInt64(v_1.AuxInt)
  2437  		v.reset(OpARM64ANDconst)
  2438  		v.AuxInt = int64ToAuxInt(^c)
  2439  		v.AddArg(x)
  2440  		return true
  2441  	}
  2442  	// match: (BIC x x)
  2443  	// result: (MOVDconst [0])
  2444  	for {
  2445  		x := v_0
  2446  		if x != v_1 {
  2447  			break
  2448  		}
  2449  		v.reset(OpARM64MOVDconst)
  2450  		v.AuxInt = int64ToAuxInt(0)
  2451  		return true
  2452  	}
  2453  	// match: (BIC x0 x1:(SLLconst [c] y))
  2454  	// cond: clobberIfDead(x1)
  2455  	// result: (BICshiftLL x0 y [c])
  2456  	for {
  2457  		x0 := v_0
  2458  		x1 := v_1
  2459  		if x1.Op != OpARM64SLLconst {
  2460  			break
  2461  		}
  2462  		c := auxIntToInt64(x1.AuxInt)
  2463  		y := x1.Args[0]
  2464  		if !(clobberIfDead(x1)) {
  2465  			break
  2466  		}
  2467  		v.reset(OpARM64BICshiftLL)
  2468  		v.AuxInt = int64ToAuxInt(c)
  2469  		v.AddArg2(x0, y)
  2470  		return true
  2471  	}
  2472  	// match: (BIC x0 x1:(SRLconst [c] y))
  2473  	// cond: clobberIfDead(x1)
  2474  	// result: (BICshiftRL x0 y [c])
  2475  	for {
  2476  		x0 := v_0
  2477  		x1 := v_1
  2478  		if x1.Op != OpARM64SRLconst {
  2479  			break
  2480  		}
  2481  		c := auxIntToInt64(x1.AuxInt)
  2482  		y := x1.Args[0]
  2483  		if !(clobberIfDead(x1)) {
  2484  			break
  2485  		}
  2486  		v.reset(OpARM64BICshiftRL)
  2487  		v.AuxInt = int64ToAuxInt(c)
  2488  		v.AddArg2(x0, y)
  2489  		return true
  2490  	}
  2491  	// match: (BIC x0 x1:(SRAconst [c] y))
  2492  	// cond: clobberIfDead(x1)
  2493  	// result: (BICshiftRA x0 y [c])
  2494  	for {
  2495  		x0 := v_0
  2496  		x1 := v_1
  2497  		if x1.Op != OpARM64SRAconst {
  2498  			break
  2499  		}
  2500  		c := auxIntToInt64(x1.AuxInt)
  2501  		y := x1.Args[0]
  2502  		if !(clobberIfDead(x1)) {
  2503  			break
  2504  		}
  2505  		v.reset(OpARM64BICshiftRA)
  2506  		v.AuxInt = int64ToAuxInt(c)
  2507  		v.AddArg2(x0, y)
  2508  		return true
  2509  	}
  2510  	// match: (BIC x0 x1:(RORconst [c] y))
  2511  	// cond: clobberIfDead(x1)
  2512  	// result: (BICshiftRO x0 y [c])
  2513  	for {
  2514  		x0 := v_0
  2515  		x1 := v_1
  2516  		if x1.Op != OpARM64RORconst {
  2517  			break
  2518  		}
  2519  		c := auxIntToInt64(x1.AuxInt)
  2520  		y := x1.Args[0]
  2521  		if !(clobberIfDead(x1)) {
  2522  			break
  2523  		}
  2524  		v.reset(OpARM64BICshiftRO)
  2525  		v.AuxInt = int64ToAuxInt(c)
  2526  		v.AddArg2(x0, y)
  2527  		return true
  2528  	}
  2529  	return false
  2530  }
  2531  func rewriteValueARM64_OpARM64BICshiftLL(v *Value) bool {
  2532  	v_1 := v.Args[1]
  2533  	v_0 := v.Args[0]
  2534  	// match: (BICshiftLL x (MOVDconst [c]) [d])
  2535  	// result: (ANDconst x [^int64(uint64(c)<<uint64(d))])
  2536  	for {
  2537  		d := auxIntToInt64(v.AuxInt)
  2538  		x := v_0
  2539  		if v_1.Op != OpARM64MOVDconst {
  2540  			break
  2541  		}
  2542  		c := auxIntToInt64(v_1.AuxInt)
  2543  		v.reset(OpARM64ANDconst)
  2544  		v.AuxInt = int64ToAuxInt(^int64(uint64(c) << uint64(d)))
  2545  		v.AddArg(x)
  2546  		return true
  2547  	}
  2548  	// match: (BICshiftLL (SLLconst x [c]) x [c])
  2549  	// result: (MOVDconst [0])
  2550  	for {
  2551  		c := auxIntToInt64(v.AuxInt)
  2552  		if v_0.Op != OpARM64SLLconst || auxIntToInt64(v_0.AuxInt) != c {
  2553  			break
  2554  		}
  2555  		x := v_0.Args[0]
  2556  		if x != v_1 {
  2557  			break
  2558  		}
  2559  		v.reset(OpARM64MOVDconst)
  2560  		v.AuxInt = int64ToAuxInt(0)
  2561  		return true
  2562  	}
  2563  	return false
  2564  }
  2565  func rewriteValueARM64_OpARM64BICshiftRA(v *Value) bool {
  2566  	v_1 := v.Args[1]
  2567  	v_0 := v.Args[0]
  2568  	// match: (BICshiftRA x (MOVDconst [c]) [d])
  2569  	// result: (ANDconst x [^(c>>uint64(d))])
  2570  	for {
  2571  		d := auxIntToInt64(v.AuxInt)
  2572  		x := v_0
  2573  		if v_1.Op != OpARM64MOVDconst {
  2574  			break
  2575  		}
  2576  		c := auxIntToInt64(v_1.AuxInt)
  2577  		v.reset(OpARM64ANDconst)
  2578  		v.AuxInt = int64ToAuxInt(^(c >> uint64(d)))
  2579  		v.AddArg(x)
  2580  		return true
  2581  	}
  2582  	// match: (BICshiftRA (SRAconst x [c]) x [c])
  2583  	// result: (MOVDconst [0])
  2584  	for {
  2585  		c := auxIntToInt64(v.AuxInt)
  2586  		if v_0.Op != OpARM64SRAconst || auxIntToInt64(v_0.AuxInt) != c {
  2587  			break
  2588  		}
  2589  		x := v_0.Args[0]
  2590  		if x != v_1 {
  2591  			break
  2592  		}
  2593  		v.reset(OpARM64MOVDconst)
  2594  		v.AuxInt = int64ToAuxInt(0)
  2595  		return true
  2596  	}
  2597  	return false
  2598  }
  2599  func rewriteValueARM64_OpARM64BICshiftRL(v *Value) bool {
  2600  	v_1 := v.Args[1]
  2601  	v_0 := v.Args[0]
  2602  	// match: (BICshiftRL x (MOVDconst [c]) [d])
  2603  	// result: (ANDconst x [^int64(uint64(c)>>uint64(d))])
  2604  	for {
  2605  		d := auxIntToInt64(v.AuxInt)
  2606  		x := v_0
  2607  		if v_1.Op != OpARM64MOVDconst {
  2608  			break
  2609  		}
  2610  		c := auxIntToInt64(v_1.AuxInt)
  2611  		v.reset(OpARM64ANDconst)
  2612  		v.AuxInt = int64ToAuxInt(^int64(uint64(c) >> uint64(d)))
  2613  		v.AddArg(x)
  2614  		return true
  2615  	}
  2616  	// match: (BICshiftRL (SRLconst x [c]) x [c])
  2617  	// result: (MOVDconst [0])
  2618  	for {
  2619  		c := auxIntToInt64(v.AuxInt)
  2620  		if v_0.Op != OpARM64SRLconst || auxIntToInt64(v_0.AuxInt) != c {
  2621  			break
  2622  		}
  2623  		x := v_0.Args[0]
  2624  		if x != v_1 {
  2625  			break
  2626  		}
  2627  		v.reset(OpARM64MOVDconst)
  2628  		v.AuxInt = int64ToAuxInt(0)
  2629  		return true
  2630  	}
  2631  	return false
  2632  }
  2633  func rewriteValueARM64_OpARM64BICshiftRO(v *Value) bool {
  2634  	v_1 := v.Args[1]
  2635  	v_0 := v.Args[0]
  2636  	// match: (BICshiftRO x (MOVDconst [c]) [d])
  2637  	// result: (ANDconst x [^rotateRight64(c, d)])
  2638  	for {
  2639  		d := auxIntToInt64(v.AuxInt)
  2640  		x := v_0
  2641  		if v_1.Op != OpARM64MOVDconst {
  2642  			break
  2643  		}
  2644  		c := auxIntToInt64(v_1.AuxInt)
  2645  		v.reset(OpARM64ANDconst)
  2646  		v.AuxInt = int64ToAuxInt(^rotateRight64(c, d))
  2647  		v.AddArg(x)
  2648  		return true
  2649  	}
  2650  	// match: (BICshiftRO (RORconst x [c]) x [c])
  2651  	// result: (MOVDconst [0])
  2652  	for {
  2653  		c := auxIntToInt64(v.AuxInt)
  2654  		if v_0.Op != OpARM64RORconst || auxIntToInt64(v_0.AuxInt) != c {
  2655  			break
  2656  		}
  2657  		x := v_0.Args[0]
  2658  		if x != v_1 {
  2659  			break
  2660  		}
  2661  		v.reset(OpARM64MOVDconst)
  2662  		v.AuxInt = int64ToAuxInt(0)
  2663  		return true
  2664  	}
  2665  	return false
  2666  }
  2667  func rewriteValueARM64_OpARM64CMN(v *Value) bool {
  2668  	v_1 := v.Args[1]
  2669  	v_0 := v.Args[0]
  2670  	// match: (CMN x (MOVDconst [c]))
  2671  	// result: (CMNconst [c] x)
  2672  	for {
  2673  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
  2674  			x := v_0
  2675  			if v_1.Op != OpARM64MOVDconst {
  2676  				continue
  2677  			}
  2678  			c := auxIntToInt64(v_1.AuxInt)
  2679  			v.reset(OpARM64CMNconst)
  2680  			v.AuxInt = int64ToAuxInt(c)
  2681  			v.AddArg(x)
  2682  			return true
  2683  		}
  2684  		break
  2685  	}
  2686  	// match: (CMN x0 x1:(SLLconst [c] y))
  2687  	// cond: clobberIfDead(x1)
  2688  	// result: (CMNshiftLL x0 y [c])
  2689  	for {
  2690  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
  2691  			x0 := v_0
  2692  			x1 := v_1
  2693  			if x1.Op != OpARM64SLLconst {
  2694  				continue
  2695  			}
  2696  			c := auxIntToInt64(x1.AuxInt)
  2697  			y := x1.Args[0]
  2698  			if !(clobberIfDead(x1)) {
  2699  				continue
  2700  			}
  2701  			v.reset(OpARM64CMNshiftLL)
  2702  			v.AuxInt = int64ToAuxInt(c)
  2703  			v.AddArg2(x0, y)
  2704  			return true
  2705  		}
  2706  		break
  2707  	}
  2708  	// match: (CMN x0 x1:(SRLconst [c] y))
  2709  	// cond: clobberIfDead(x1)
  2710  	// result: (CMNshiftRL x0 y [c])
  2711  	for {
  2712  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
  2713  			x0 := v_0
  2714  			x1 := v_1
  2715  			if x1.Op != OpARM64SRLconst {
  2716  				continue
  2717  			}
  2718  			c := auxIntToInt64(x1.AuxInt)
  2719  			y := x1.Args[0]
  2720  			if !(clobberIfDead(x1)) {
  2721  				continue
  2722  			}
  2723  			v.reset(OpARM64CMNshiftRL)
  2724  			v.AuxInt = int64ToAuxInt(c)
  2725  			v.AddArg2(x0, y)
  2726  			return true
  2727  		}
  2728  		break
  2729  	}
  2730  	// match: (CMN x0 x1:(SRAconst [c] y))
  2731  	// cond: clobberIfDead(x1)
  2732  	// result: (CMNshiftRA x0 y [c])
  2733  	for {
  2734  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
  2735  			x0 := v_0
  2736  			x1 := v_1
  2737  			if x1.Op != OpARM64SRAconst {
  2738  				continue
  2739  			}
  2740  			c := auxIntToInt64(x1.AuxInt)
  2741  			y := x1.Args[0]
  2742  			if !(clobberIfDead(x1)) {
  2743  				continue
  2744  			}
  2745  			v.reset(OpARM64CMNshiftRA)
  2746  			v.AuxInt = int64ToAuxInt(c)
  2747  			v.AddArg2(x0, y)
  2748  			return true
  2749  		}
  2750  		break
  2751  	}
  2752  	return false
  2753  }
  2754  func rewriteValueARM64_OpARM64CMNW(v *Value) bool {
  2755  	v_1 := v.Args[1]
  2756  	v_0 := v.Args[0]
  2757  	// match: (CMNW x (MOVDconst [c]))
  2758  	// result: (CMNWconst [int32(c)] x)
  2759  	for {
  2760  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
  2761  			x := v_0
  2762  			if v_1.Op != OpARM64MOVDconst {
  2763  				continue
  2764  			}
  2765  			c := auxIntToInt64(v_1.AuxInt)
  2766  			v.reset(OpARM64CMNWconst)
  2767  			v.AuxInt = int32ToAuxInt(int32(c))
  2768  			v.AddArg(x)
  2769  			return true
  2770  		}
  2771  		break
  2772  	}
  2773  	return false
  2774  }
  2775  func rewriteValueARM64_OpARM64CMNWconst(v *Value) bool {
  2776  	v_0 := v.Args[0]
  2777  	// match: (CMNWconst [c] y)
  2778  	// cond: c < 0 && c != -1<<31
  2779  	// result: (CMPWconst [-c] y)
  2780  	for {
  2781  		c := auxIntToInt32(v.AuxInt)
  2782  		y := v_0
  2783  		if !(c < 0 && c != -1<<31) {
  2784  			break
  2785  		}
  2786  		v.reset(OpARM64CMPWconst)
  2787  		v.AuxInt = int32ToAuxInt(-c)
  2788  		v.AddArg(y)
  2789  		return true
  2790  	}
  2791  	// match: (CMNWconst (MOVDconst [x]) [y])
  2792  	// result: (FlagConstant [addFlags32(int32(x),y)])
  2793  	for {
  2794  		y := auxIntToInt32(v.AuxInt)
  2795  		if v_0.Op != OpARM64MOVDconst {
  2796  			break
  2797  		}
  2798  		x := auxIntToInt64(v_0.AuxInt)
  2799  		v.reset(OpARM64FlagConstant)
  2800  		v.AuxInt = flagConstantToAuxInt(addFlags32(int32(x), y))
  2801  		return true
  2802  	}
  2803  	return false
  2804  }
  2805  func rewriteValueARM64_OpARM64CMNconst(v *Value) bool {
  2806  	v_0 := v.Args[0]
  2807  	// match: (CMNconst [c] y)
  2808  	// cond: c < 0 && c != -1<<63
  2809  	// result: (CMPconst [-c] y)
  2810  	for {
  2811  		c := auxIntToInt64(v.AuxInt)
  2812  		y := v_0
  2813  		if !(c < 0 && c != -1<<63) {
  2814  			break
  2815  		}
  2816  		v.reset(OpARM64CMPconst)
  2817  		v.AuxInt = int64ToAuxInt(-c)
  2818  		v.AddArg(y)
  2819  		return true
  2820  	}
  2821  	// match: (CMNconst (MOVDconst [x]) [y])
  2822  	// result: (FlagConstant [addFlags64(x,y)])
  2823  	for {
  2824  		y := auxIntToInt64(v.AuxInt)
  2825  		if v_0.Op != OpARM64MOVDconst {
  2826  			break
  2827  		}
  2828  		x := auxIntToInt64(v_0.AuxInt)
  2829  		v.reset(OpARM64FlagConstant)
  2830  		v.AuxInt = flagConstantToAuxInt(addFlags64(x, y))
  2831  		return true
  2832  	}
  2833  	return false
  2834  }
  2835  func rewriteValueARM64_OpARM64CMNshiftLL(v *Value) bool {
  2836  	v_1 := v.Args[1]
  2837  	v_0 := v.Args[0]
  2838  	b := v.Block
  2839  	// match: (CMNshiftLL (MOVDconst [c]) x [d])
  2840  	// result: (CMNconst [c] (SLLconst <x.Type> x [d]))
  2841  	for {
  2842  		d := auxIntToInt64(v.AuxInt)
  2843  		if v_0.Op != OpARM64MOVDconst {
  2844  			break
  2845  		}
  2846  		c := auxIntToInt64(v_0.AuxInt)
  2847  		x := v_1
  2848  		v.reset(OpARM64CMNconst)
  2849  		v.AuxInt = int64ToAuxInt(c)
  2850  		v0 := b.NewValue0(v.Pos, OpARM64SLLconst, x.Type)
  2851  		v0.AuxInt = int64ToAuxInt(d)
  2852  		v0.AddArg(x)
  2853  		v.AddArg(v0)
  2854  		return true
  2855  	}
  2856  	// match: (CMNshiftLL x (MOVDconst [c]) [d])
  2857  	// result: (CMNconst x [int64(uint64(c)<<uint64(d))])
  2858  	for {
  2859  		d := auxIntToInt64(v.AuxInt)
  2860  		x := v_0
  2861  		if v_1.Op != OpARM64MOVDconst {
  2862  			break
  2863  		}
  2864  		c := auxIntToInt64(v_1.AuxInt)
  2865  		v.reset(OpARM64CMNconst)
  2866  		v.AuxInt = int64ToAuxInt(int64(uint64(c) << uint64(d)))
  2867  		v.AddArg(x)
  2868  		return true
  2869  	}
  2870  	return false
  2871  }
  2872  func rewriteValueARM64_OpARM64CMNshiftRA(v *Value) bool {
  2873  	v_1 := v.Args[1]
  2874  	v_0 := v.Args[0]
  2875  	b := v.Block
  2876  	// match: (CMNshiftRA (MOVDconst [c]) x [d])
  2877  	// result: (CMNconst [c] (SRAconst <x.Type> x [d]))
  2878  	for {
  2879  		d := auxIntToInt64(v.AuxInt)
  2880  		if v_0.Op != OpARM64MOVDconst {
  2881  			break
  2882  		}
  2883  		c := auxIntToInt64(v_0.AuxInt)
  2884  		x := v_1
  2885  		v.reset(OpARM64CMNconst)
  2886  		v.AuxInt = int64ToAuxInt(c)
  2887  		v0 := b.NewValue0(v.Pos, OpARM64SRAconst, x.Type)
  2888  		v0.AuxInt = int64ToAuxInt(d)
  2889  		v0.AddArg(x)
  2890  		v.AddArg(v0)
  2891  		return true
  2892  	}
  2893  	// match: (CMNshiftRA x (MOVDconst [c]) [d])
  2894  	// result: (CMNconst x [c>>uint64(d)])
  2895  	for {
  2896  		d := auxIntToInt64(v.AuxInt)
  2897  		x := v_0
  2898  		if v_1.Op != OpARM64MOVDconst {
  2899  			break
  2900  		}
  2901  		c := auxIntToInt64(v_1.AuxInt)
  2902  		v.reset(OpARM64CMNconst)
  2903  		v.AuxInt = int64ToAuxInt(c >> uint64(d))
  2904  		v.AddArg(x)
  2905  		return true
  2906  	}
  2907  	return false
  2908  }
  2909  func rewriteValueARM64_OpARM64CMNshiftRL(v *Value) bool {
  2910  	v_1 := v.Args[1]
  2911  	v_0 := v.Args[0]
  2912  	b := v.Block
  2913  	// match: (CMNshiftRL (MOVDconst [c]) x [d])
  2914  	// result: (CMNconst [c] (SRLconst <x.Type> x [d]))
  2915  	for {
  2916  		d := auxIntToInt64(v.AuxInt)
  2917  		if v_0.Op != OpARM64MOVDconst {
  2918  			break
  2919  		}
  2920  		c := auxIntToInt64(v_0.AuxInt)
  2921  		x := v_1
  2922  		v.reset(OpARM64CMNconst)
  2923  		v.AuxInt = int64ToAuxInt(c)
  2924  		v0 := b.NewValue0(v.Pos, OpARM64SRLconst, x.Type)
  2925  		v0.AuxInt = int64ToAuxInt(d)
  2926  		v0.AddArg(x)
  2927  		v.AddArg(v0)
  2928  		return true
  2929  	}
  2930  	// match: (CMNshiftRL x (MOVDconst [c]) [d])
  2931  	// result: (CMNconst x [int64(uint64(c)>>uint64(d))])
  2932  	for {
  2933  		d := auxIntToInt64(v.AuxInt)
  2934  		x := v_0
  2935  		if v_1.Op != OpARM64MOVDconst {
  2936  			break
  2937  		}
  2938  		c := auxIntToInt64(v_1.AuxInt)
  2939  		v.reset(OpARM64CMNconst)
  2940  		v.AuxInt = int64ToAuxInt(int64(uint64(c) >> uint64(d)))
  2941  		v.AddArg(x)
  2942  		return true
  2943  	}
  2944  	return false
  2945  }
  2946  func rewriteValueARM64_OpARM64CMP(v *Value) bool {
  2947  	v_1 := v.Args[1]
  2948  	v_0 := v.Args[0]
  2949  	b := v.Block
  2950  	// match: (CMP x (MOVDconst [c]))
  2951  	// result: (CMPconst [c] x)
  2952  	for {
  2953  		x := v_0
  2954  		if v_1.Op != OpARM64MOVDconst {
  2955  			break
  2956  		}
  2957  		c := auxIntToInt64(v_1.AuxInt)
  2958  		v.reset(OpARM64CMPconst)
  2959  		v.AuxInt = int64ToAuxInt(c)
  2960  		v.AddArg(x)
  2961  		return true
  2962  	}
  2963  	// match: (CMP (MOVDconst [c]) x)
  2964  	// result: (InvertFlags (CMPconst [c] x))
  2965  	for {
  2966  		if v_0.Op != OpARM64MOVDconst {
  2967  			break
  2968  		}
  2969  		c := auxIntToInt64(v_0.AuxInt)
  2970  		x := v_1
  2971  		v.reset(OpARM64InvertFlags)
  2972  		v0 := b.NewValue0(v.Pos, OpARM64CMPconst, types.TypeFlags)
  2973  		v0.AuxInt = int64ToAuxInt(c)
  2974  		v0.AddArg(x)
  2975  		v.AddArg(v0)
  2976  		return true
  2977  	}
  2978  	// match: (CMP x y)
  2979  	// cond: canonLessThan(x,y)
  2980  	// result: (InvertFlags (CMP y x))
  2981  	for {
  2982  		x := v_0
  2983  		y := v_1
  2984  		if !(canonLessThan(x, y)) {
  2985  			break
  2986  		}
  2987  		v.reset(OpARM64InvertFlags)
  2988  		v0 := b.NewValue0(v.Pos, OpARM64CMP, types.TypeFlags)
  2989  		v0.AddArg2(y, x)
  2990  		v.AddArg(v0)
  2991  		return true
  2992  	}
  2993  	// match: (CMP x0 x1:(SLLconst [c] y))
  2994  	// cond: clobberIfDead(x1)
  2995  	// result: (CMPshiftLL x0 y [c])
  2996  	for {
  2997  		x0 := v_0
  2998  		x1 := v_1
  2999  		if x1.Op != OpARM64SLLconst {
  3000  			break
  3001  		}
  3002  		c := auxIntToInt64(x1.AuxInt)
  3003  		y := x1.Args[0]
  3004  		if !(clobberIfDead(x1)) {
  3005  			break
  3006  		}
  3007  		v.reset(OpARM64CMPshiftLL)
  3008  		v.AuxInt = int64ToAuxInt(c)
  3009  		v.AddArg2(x0, y)
  3010  		return true
  3011  	}
  3012  	// match: (CMP x0:(SLLconst [c] y) x1)
  3013  	// cond: clobberIfDead(x0)
  3014  	// result: (InvertFlags (CMPshiftLL x1 y [c]))
  3015  	for {
  3016  		x0 := v_0
  3017  		if x0.Op != OpARM64SLLconst {
  3018  			break
  3019  		}
  3020  		c := auxIntToInt64(x0.AuxInt)
  3021  		y := x0.Args[0]
  3022  		x1 := v_1
  3023  		if !(clobberIfDead(x0)) {
  3024  			break
  3025  		}
  3026  		v.reset(OpARM64InvertFlags)
  3027  		v0 := b.NewValue0(v.Pos, OpARM64CMPshiftLL, types.TypeFlags)
  3028  		v0.AuxInt = int64ToAuxInt(c)
  3029  		v0.AddArg2(x1, y)
  3030  		v.AddArg(v0)
  3031  		return true
  3032  	}
  3033  	// match: (CMP x0 x1:(SRLconst [c] y))
  3034  	// cond: clobberIfDead(x1)
  3035  	// result: (CMPshiftRL x0 y [c])
  3036  	for {
  3037  		x0 := v_0
  3038  		x1 := v_1
  3039  		if x1.Op != OpARM64SRLconst {
  3040  			break
  3041  		}
  3042  		c := auxIntToInt64(x1.AuxInt)
  3043  		y := x1.Args[0]
  3044  		if !(clobberIfDead(x1)) {
  3045  			break
  3046  		}
  3047  		v.reset(OpARM64CMPshiftRL)
  3048  		v.AuxInt = int64ToAuxInt(c)
  3049  		v.AddArg2(x0, y)
  3050  		return true
  3051  	}
  3052  	// match: (CMP x0:(SRLconst [c] y) x1)
  3053  	// cond: clobberIfDead(x0)
  3054  	// result: (InvertFlags (CMPshiftRL x1 y [c]))
  3055  	for {
  3056  		x0 := v_0
  3057  		if x0.Op != OpARM64SRLconst {
  3058  			break
  3059  		}
  3060  		c := auxIntToInt64(x0.AuxInt)
  3061  		y := x0.Args[0]
  3062  		x1 := v_1
  3063  		if !(clobberIfDead(x0)) {
  3064  			break
  3065  		}
  3066  		v.reset(OpARM64InvertFlags)
  3067  		v0 := b.NewValue0(v.Pos, OpARM64CMPshiftRL, types.TypeFlags)
  3068  		v0.AuxInt = int64ToAuxInt(c)
  3069  		v0.AddArg2(x1, y)
  3070  		v.AddArg(v0)
  3071  		return true
  3072  	}
  3073  	// match: (CMP x0 x1:(SRAconst [c] y))
  3074  	// cond: clobberIfDead(x1)
  3075  	// result: (CMPshiftRA x0 y [c])
  3076  	for {
  3077  		x0 := v_0
  3078  		x1 := v_1
  3079  		if x1.Op != OpARM64SRAconst {
  3080  			break
  3081  		}
  3082  		c := auxIntToInt64(x1.AuxInt)
  3083  		y := x1.Args[0]
  3084  		if !(clobberIfDead(x1)) {
  3085  			break
  3086  		}
  3087  		v.reset(OpARM64CMPshiftRA)
  3088  		v.AuxInt = int64ToAuxInt(c)
  3089  		v.AddArg2(x0, y)
  3090  		return true
  3091  	}
  3092  	// match: (CMP x0:(SRAconst [c] y) x1)
  3093  	// cond: clobberIfDead(x0)
  3094  	// result: (InvertFlags (CMPshiftRA x1 y [c]))
  3095  	for {
  3096  		x0 := v_0
  3097  		if x0.Op != OpARM64SRAconst {
  3098  			break
  3099  		}
  3100  		c := auxIntToInt64(x0.AuxInt)
  3101  		y := x0.Args[0]
  3102  		x1 := v_1
  3103  		if !(clobberIfDead(x0)) {
  3104  			break
  3105  		}
  3106  		v.reset(OpARM64InvertFlags)
  3107  		v0 := b.NewValue0(v.Pos, OpARM64CMPshiftRA, types.TypeFlags)
  3108  		v0.AuxInt = int64ToAuxInt(c)
  3109  		v0.AddArg2(x1, y)
  3110  		v.AddArg(v0)
  3111  		return true
  3112  	}
  3113  	return false
  3114  }
  3115  func rewriteValueARM64_OpARM64CMPW(v *Value) bool {
  3116  	v_1 := v.Args[1]
  3117  	v_0 := v.Args[0]
  3118  	b := v.Block
  3119  	// match: (CMPW x (MOVDconst [c]))
  3120  	// result: (CMPWconst [int32(c)] x)
  3121  	for {
  3122  		x := v_0
  3123  		if v_1.Op != OpARM64MOVDconst {
  3124  			break
  3125  		}
  3126  		c := auxIntToInt64(v_1.AuxInt)
  3127  		v.reset(OpARM64CMPWconst)
  3128  		v.AuxInt = int32ToAuxInt(int32(c))
  3129  		v.AddArg(x)
  3130  		return true
  3131  	}
  3132  	// match: (CMPW (MOVDconst [c]) x)
  3133  	// result: (InvertFlags (CMPWconst [int32(c)] x))
  3134  	for {
  3135  		if v_0.Op != OpARM64MOVDconst {
  3136  			break
  3137  		}
  3138  		c := auxIntToInt64(v_0.AuxInt)
  3139  		x := v_1
  3140  		v.reset(OpARM64InvertFlags)
  3141  		v0 := b.NewValue0(v.Pos, OpARM64CMPWconst, types.TypeFlags)
  3142  		v0.AuxInt = int32ToAuxInt(int32(c))
  3143  		v0.AddArg(x)
  3144  		v.AddArg(v0)
  3145  		return true
  3146  	}
  3147  	// match: (CMPW x y)
  3148  	// cond: canonLessThan(x,y)
  3149  	// result: (InvertFlags (CMPW y x))
  3150  	for {
  3151  		x := v_0
  3152  		y := v_1
  3153  		if !(canonLessThan(x, y)) {
  3154  			break
  3155  		}
  3156  		v.reset(OpARM64InvertFlags)
  3157  		v0 := b.NewValue0(v.Pos, OpARM64CMPW, types.TypeFlags)
  3158  		v0.AddArg2(y, x)
  3159  		v.AddArg(v0)
  3160  		return true
  3161  	}
  3162  	return false
  3163  }
  3164  func rewriteValueARM64_OpARM64CMPWconst(v *Value) bool {
  3165  	v_0 := v.Args[0]
  3166  	// match: (CMPWconst [c] y)
  3167  	// cond: c < 0 && c != -1<<31
  3168  	// result: (CMNWconst [-c] y)
  3169  	for {
  3170  		c := auxIntToInt32(v.AuxInt)
  3171  		y := v_0
  3172  		if !(c < 0 && c != -1<<31) {
  3173  			break
  3174  		}
  3175  		v.reset(OpARM64CMNWconst)
  3176  		v.AuxInt = int32ToAuxInt(-c)
  3177  		v.AddArg(y)
  3178  		return true
  3179  	}
  3180  	// match: (CMPWconst (MOVDconst [x]) [y])
  3181  	// result: (FlagConstant [subFlags32(int32(x),y)])
  3182  	for {
  3183  		y := auxIntToInt32(v.AuxInt)
  3184  		if v_0.Op != OpARM64MOVDconst {
  3185  			break
  3186  		}
  3187  		x := auxIntToInt64(v_0.AuxInt)
  3188  		v.reset(OpARM64FlagConstant)
  3189  		v.AuxInt = flagConstantToAuxInt(subFlags32(int32(x), y))
  3190  		return true
  3191  	}
  3192  	// match: (CMPWconst (MOVBUreg _) [c])
  3193  	// cond: 0xff < c
  3194  	// result: (FlagConstant [subFlags64(0,1)])
  3195  	for {
  3196  		c := auxIntToInt32(v.AuxInt)
  3197  		if v_0.Op != OpARM64MOVBUreg || !(0xff < c) {
  3198  			break
  3199  		}
  3200  		v.reset(OpARM64FlagConstant)
  3201  		v.AuxInt = flagConstantToAuxInt(subFlags64(0, 1))
  3202  		return true
  3203  	}
  3204  	// match: (CMPWconst (MOVHUreg _) [c])
  3205  	// cond: 0xffff < c
  3206  	// result: (FlagConstant [subFlags64(0,1)])
  3207  	for {
  3208  		c := auxIntToInt32(v.AuxInt)
  3209  		if v_0.Op != OpARM64MOVHUreg || !(0xffff < c) {
  3210  			break
  3211  		}
  3212  		v.reset(OpARM64FlagConstant)
  3213  		v.AuxInt = flagConstantToAuxInt(subFlags64(0, 1))
  3214  		return true
  3215  	}
  3216  	return false
  3217  }
  3218  func rewriteValueARM64_OpARM64CMPconst(v *Value) bool {
  3219  	v_0 := v.Args[0]
  3220  	// match: (CMPconst [c] y)
  3221  	// cond: c < 0 && c != -1<<63
  3222  	// result: (CMNconst [-c] y)
  3223  	for {
  3224  		c := auxIntToInt64(v.AuxInt)
  3225  		y := v_0
  3226  		if !(c < 0 && c != -1<<63) {
  3227  			break
  3228  		}
  3229  		v.reset(OpARM64CMNconst)
  3230  		v.AuxInt = int64ToAuxInt(-c)
  3231  		v.AddArg(y)
  3232  		return true
  3233  	}
  3234  	// match: (CMPconst (MOVDconst [x]) [y])
  3235  	// result: (FlagConstant [subFlags64(x,y)])
  3236  	for {
  3237  		y := auxIntToInt64(v.AuxInt)
  3238  		if v_0.Op != OpARM64MOVDconst {
  3239  			break
  3240  		}
  3241  		x := auxIntToInt64(v_0.AuxInt)
  3242  		v.reset(OpARM64FlagConstant)
  3243  		v.AuxInt = flagConstantToAuxInt(subFlags64(x, y))
  3244  		return true
  3245  	}
  3246  	// match: (CMPconst (MOVBUreg _) [c])
  3247  	// cond: 0xff < c
  3248  	// result: (FlagConstant [subFlags64(0,1)])
  3249  	for {
  3250  		c := auxIntToInt64(v.AuxInt)
  3251  		if v_0.Op != OpARM64MOVBUreg || !(0xff < c) {
  3252  			break
  3253  		}
  3254  		v.reset(OpARM64FlagConstant)
  3255  		v.AuxInt = flagConstantToAuxInt(subFlags64(0, 1))
  3256  		return true
  3257  	}
  3258  	// match: (CMPconst (MOVHUreg _) [c])
  3259  	// cond: 0xffff < c
  3260  	// result: (FlagConstant [subFlags64(0,1)])
  3261  	for {
  3262  		c := auxIntToInt64(v.AuxInt)
  3263  		if v_0.Op != OpARM64MOVHUreg || !(0xffff < c) {
  3264  			break
  3265  		}
  3266  		v.reset(OpARM64FlagConstant)
  3267  		v.AuxInt = flagConstantToAuxInt(subFlags64(0, 1))
  3268  		return true
  3269  	}
  3270  	// match: (CMPconst (MOVWUreg _) [c])
  3271  	// cond: 0xffffffff < c
  3272  	// result: (FlagConstant [subFlags64(0,1)])
  3273  	for {
  3274  		c := auxIntToInt64(v.AuxInt)
  3275  		if v_0.Op != OpARM64MOVWUreg || !(0xffffffff < c) {
  3276  			break
  3277  		}
  3278  		v.reset(OpARM64FlagConstant)
  3279  		v.AuxInt = flagConstantToAuxInt(subFlags64(0, 1))
  3280  		return true
  3281  	}
  3282  	// match: (CMPconst (ANDconst _ [m]) [n])
  3283  	// cond: 0 <= m && m < n
  3284  	// result: (FlagConstant [subFlags64(0,1)])
  3285  	for {
  3286  		n := auxIntToInt64(v.AuxInt)
  3287  		if v_0.Op != OpARM64ANDconst {
  3288  			break
  3289  		}
  3290  		m := auxIntToInt64(v_0.AuxInt)
  3291  		if !(0 <= m && m < n) {
  3292  			break
  3293  		}
  3294  		v.reset(OpARM64FlagConstant)
  3295  		v.AuxInt = flagConstantToAuxInt(subFlags64(0, 1))
  3296  		return true
  3297  	}
  3298  	// match: (CMPconst (SRLconst _ [c]) [n])
  3299  	// cond: 0 <= n && 0 < c && c <= 63 && (1<<uint64(64-c)) <= uint64(n)
  3300  	// result: (FlagConstant [subFlags64(0,1)])
  3301  	for {
  3302  		n := auxIntToInt64(v.AuxInt)
  3303  		if v_0.Op != OpARM64SRLconst {
  3304  			break
  3305  		}
  3306  		c := auxIntToInt64(v_0.AuxInt)
  3307  		if !(0 <= n && 0 < c && c <= 63 && (1<<uint64(64-c)) <= uint64(n)) {
  3308  			break
  3309  		}
  3310  		v.reset(OpARM64FlagConstant)
  3311  		v.AuxInt = flagConstantToAuxInt(subFlags64(0, 1))
  3312  		return true
  3313  	}
  3314  	return false
  3315  }
  3316  func rewriteValueARM64_OpARM64CMPshiftLL(v *Value) bool {
  3317  	v_1 := v.Args[1]
  3318  	v_0 := v.Args[0]
  3319  	b := v.Block
  3320  	// match: (CMPshiftLL (MOVDconst [c]) x [d])
  3321  	// result: (InvertFlags (CMPconst [c] (SLLconst <x.Type> x [d])))
  3322  	for {
  3323  		d := auxIntToInt64(v.AuxInt)
  3324  		if v_0.Op != OpARM64MOVDconst {
  3325  			break
  3326  		}
  3327  		c := auxIntToInt64(v_0.AuxInt)
  3328  		x := v_1
  3329  		v.reset(OpARM64InvertFlags)
  3330  		v0 := b.NewValue0(v.Pos, OpARM64CMPconst, types.TypeFlags)
  3331  		v0.AuxInt = int64ToAuxInt(c)
  3332  		v1 := b.NewValue0(v.Pos, OpARM64SLLconst, x.Type)
  3333  		v1.AuxInt = int64ToAuxInt(d)
  3334  		v1.AddArg(x)
  3335  		v0.AddArg(v1)
  3336  		v.AddArg(v0)
  3337  		return true
  3338  	}
  3339  	// match: (CMPshiftLL x (MOVDconst [c]) [d])
  3340  	// result: (CMPconst x [int64(uint64(c)<<uint64(d))])
  3341  	for {
  3342  		d := auxIntToInt64(v.AuxInt)
  3343  		x := v_0
  3344  		if v_1.Op != OpARM64MOVDconst {
  3345  			break
  3346  		}
  3347  		c := auxIntToInt64(v_1.AuxInt)
  3348  		v.reset(OpARM64CMPconst)
  3349  		v.AuxInt = int64ToAuxInt(int64(uint64(c) << uint64(d)))
  3350  		v.AddArg(x)
  3351  		return true
  3352  	}
  3353  	return false
  3354  }
  3355  func rewriteValueARM64_OpARM64CMPshiftRA(v *Value) bool {
  3356  	v_1 := v.Args[1]
  3357  	v_0 := v.Args[0]
  3358  	b := v.Block
  3359  	// match: (CMPshiftRA (MOVDconst [c]) x [d])
  3360  	// result: (InvertFlags (CMPconst [c] (SRAconst <x.Type> x [d])))
  3361  	for {
  3362  		d := auxIntToInt64(v.AuxInt)
  3363  		if v_0.Op != OpARM64MOVDconst {
  3364  			break
  3365  		}
  3366  		c := auxIntToInt64(v_0.AuxInt)
  3367  		x := v_1
  3368  		v.reset(OpARM64InvertFlags)
  3369  		v0 := b.NewValue0(v.Pos, OpARM64CMPconst, types.TypeFlags)
  3370  		v0.AuxInt = int64ToAuxInt(c)
  3371  		v1 := b.NewValue0(v.Pos, OpARM64SRAconst, x.Type)
  3372  		v1.AuxInt = int64ToAuxInt(d)
  3373  		v1.AddArg(x)
  3374  		v0.AddArg(v1)
  3375  		v.AddArg(v0)
  3376  		return true
  3377  	}
  3378  	// match: (CMPshiftRA x (MOVDconst [c]) [d])
  3379  	// result: (CMPconst x [c>>uint64(d)])
  3380  	for {
  3381  		d := auxIntToInt64(v.AuxInt)
  3382  		x := v_0
  3383  		if v_1.Op != OpARM64MOVDconst {
  3384  			break
  3385  		}
  3386  		c := auxIntToInt64(v_1.AuxInt)
  3387  		v.reset(OpARM64CMPconst)
  3388  		v.AuxInt = int64ToAuxInt(c >> uint64(d))
  3389  		v.AddArg(x)
  3390  		return true
  3391  	}
  3392  	return false
  3393  }
  3394  func rewriteValueARM64_OpARM64CMPshiftRL(v *Value) bool {
  3395  	v_1 := v.Args[1]
  3396  	v_0 := v.Args[0]
  3397  	b := v.Block
  3398  	// match: (CMPshiftRL (MOVDconst [c]) x [d])
  3399  	// result: (InvertFlags (CMPconst [c] (SRLconst <x.Type> x [d])))
  3400  	for {
  3401  		d := auxIntToInt64(v.AuxInt)
  3402  		if v_0.Op != OpARM64MOVDconst {
  3403  			break
  3404  		}
  3405  		c := auxIntToInt64(v_0.AuxInt)
  3406  		x := v_1
  3407  		v.reset(OpARM64InvertFlags)
  3408  		v0 := b.NewValue0(v.Pos, OpARM64CMPconst, types.TypeFlags)
  3409  		v0.AuxInt = int64ToAuxInt(c)
  3410  		v1 := b.NewValue0(v.Pos, OpARM64SRLconst, x.Type)
  3411  		v1.AuxInt = int64ToAuxInt(d)
  3412  		v1.AddArg(x)
  3413  		v0.AddArg(v1)
  3414  		v.AddArg(v0)
  3415  		return true
  3416  	}
  3417  	// match: (CMPshiftRL x (MOVDconst [c]) [d])
  3418  	// result: (CMPconst x [int64(uint64(c)>>uint64(d))])
  3419  	for {
  3420  		d := auxIntToInt64(v.AuxInt)
  3421  		x := v_0
  3422  		if v_1.Op != OpARM64MOVDconst {
  3423  			break
  3424  		}
  3425  		c := auxIntToInt64(v_1.AuxInt)
  3426  		v.reset(OpARM64CMPconst)
  3427  		v.AuxInt = int64ToAuxInt(int64(uint64(c) >> uint64(d)))
  3428  		v.AddArg(x)
  3429  		return true
  3430  	}
  3431  	return false
  3432  }
  3433  func rewriteValueARM64_OpARM64CSEL(v *Value) bool {
  3434  	v_2 := v.Args[2]
  3435  	v_1 := v.Args[1]
  3436  	v_0 := v.Args[0]
  3437  	// match: (CSEL [cc] (MOVDconst [-1]) (MOVDconst [0]) flag)
  3438  	// result: (CSETM [cc] flag)
  3439  	for {
  3440  		cc := auxIntToOp(v.AuxInt)
  3441  		if v_0.Op != OpARM64MOVDconst || auxIntToInt64(v_0.AuxInt) != -1 || v_1.Op != OpARM64MOVDconst || auxIntToInt64(v_1.AuxInt) != 0 {
  3442  			break
  3443  		}
  3444  		flag := v_2
  3445  		v.reset(OpARM64CSETM)
  3446  		v.AuxInt = opToAuxInt(cc)
  3447  		v.AddArg(flag)
  3448  		return true
  3449  	}
  3450  	// match: (CSEL [cc] (MOVDconst [0]) (MOVDconst [-1]) flag)
  3451  	// result: (CSETM [arm64Negate(cc)] flag)
  3452  	for {
  3453  		cc := auxIntToOp(v.AuxInt)
  3454  		if v_0.Op != OpARM64MOVDconst || auxIntToInt64(v_0.AuxInt) != 0 || v_1.Op != OpARM64MOVDconst || auxIntToInt64(v_1.AuxInt) != -1 {
  3455  			break
  3456  		}
  3457  		flag := v_2
  3458  		v.reset(OpARM64CSETM)
  3459  		v.AuxInt = opToAuxInt(arm64Negate(cc))
  3460  		v.AddArg(flag)
  3461  		return true
  3462  	}
  3463  	// match: (CSEL [cc] x (MOVDconst [0]) flag)
  3464  	// result: (CSEL0 [cc] x flag)
  3465  	for {
  3466  		cc := auxIntToOp(v.AuxInt)
  3467  		x := v_0
  3468  		if v_1.Op != OpARM64MOVDconst || auxIntToInt64(v_1.AuxInt) != 0 {
  3469  			break
  3470  		}
  3471  		flag := v_2
  3472  		v.reset(OpARM64CSEL0)
  3473  		v.AuxInt = opToAuxInt(cc)
  3474  		v.AddArg2(x, flag)
  3475  		return true
  3476  	}
  3477  	// match: (CSEL [cc] (MOVDconst [0]) y flag)
  3478  	// result: (CSEL0 [arm64Negate(cc)] y flag)
  3479  	for {
  3480  		cc := auxIntToOp(v.AuxInt)
  3481  		if v_0.Op != OpARM64MOVDconst || auxIntToInt64(v_0.AuxInt) != 0 {
  3482  			break
  3483  		}
  3484  		y := v_1
  3485  		flag := v_2
  3486  		v.reset(OpARM64CSEL0)
  3487  		v.AuxInt = opToAuxInt(arm64Negate(cc))
  3488  		v.AddArg2(y, flag)
  3489  		return true
  3490  	}
  3491  	// match: (CSEL [cc] x (ADDconst [1] a) flag)
  3492  	// result: (CSINC [cc] x a flag)
  3493  	for {
  3494  		cc := auxIntToOp(v.AuxInt)
  3495  		x := v_0
  3496  		if v_1.Op != OpARM64ADDconst || auxIntToInt64(v_1.AuxInt) != 1 {
  3497  			break
  3498  		}
  3499  		a := v_1.Args[0]
  3500  		flag := v_2
  3501  		v.reset(OpARM64CSINC)
  3502  		v.AuxInt = opToAuxInt(cc)
  3503  		v.AddArg3(x, a, flag)
  3504  		return true
  3505  	}
  3506  	// match: (CSEL [cc] (ADDconst [1] a) x flag)
  3507  	// result: (CSINC [arm64Negate(cc)] x a flag)
  3508  	for {
  3509  		cc := auxIntToOp(v.AuxInt)
  3510  		if v_0.Op != OpARM64ADDconst || auxIntToInt64(v_0.AuxInt) != 1 {
  3511  			break
  3512  		}
  3513  		a := v_0.Args[0]
  3514  		x := v_1
  3515  		flag := v_2
  3516  		v.reset(OpARM64CSINC)
  3517  		v.AuxInt = opToAuxInt(arm64Negate(cc))
  3518  		v.AddArg3(x, a, flag)
  3519  		return true
  3520  	}
  3521  	// match: (CSEL [cc] x (MVN a) flag)
  3522  	// result: (CSINV [cc] x a flag)
  3523  	for {
  3524  		cc := auxIntToOp(v.AuxInt)
  3525  		x := v_0
  3526  		if v_1.Op != OpARM64MVN {
  3527  			break
  3528  		}
  3529  		a := v_1.Args[0]
  3530  		flag := v_2
  3531  		v.reset(OpARM64CSINV)
  3532  		v.AuxInt = opToAuxInt(cc)
  3533  		v.AddArg3(x, a, flag)
  3534  		return true
  3535  	}
  3536  	// match: (CSEL [cc] (MVN a) x flag)
  3537  	// result: (CSINV [arm64Negate(cc)] x a flag)
  3538  	for {
  3539  		cc := auxIntToOp(v.AuxInt)
  3540  		if v_0.Op != OpARM64MVN {
  3541  			break
  3542  		}
  3543  		a := v_0.Args[0]
  3544  		x := v_1
  3545  		flag := v_2
  3546  		v.reset(OpARM64CSINV)
  3547  		v.AuxInt = opToAuxInt(arm64Negate(cc))
  3548  		v.AddArg3(x, a, flag)
  3549  		return true
  3550  	}
  3551  	// match: (CSEL [cc] x (NEG a) flag)
  3552  	// result: (CSNEG [cc] x a flag)
  3553  	for {
  3554  		cc := auxIntToOp(v.AuxInt)
  3555  		x := v_0
  3556  		if v_1.Op != OpARM64NEG {
  3557  			break
  3558  		}
  3559  		a := v_1.Args[0]
  3560  		flag := v_2
  3561  		v.reset(OpARM64CSNEG)
  3562  		v.AuxInt = opToAuxInt(cc)
  3563  		v.AddArg3(x, a, flag)
  3564  		return true
  3565  	}
  3566  	// match: (CSEL [cc] (NEG a) x flag)
  3567  	// result: (CSNEG [arm64Negate(cc)] x a flag)
  3568  	for {
  3569  		cc := auxIntToOp(v.AuxInt)
  3570  		if v_0.Op != OpARM64NEG {
  3571  			break
  3572  		}
  3573  		a := v_0.Args[0]
  3574  		x := v_1
  3575  		flag := v_2
  3576  		v.reset(OpARM64CSNEG)
  3577  		v.AuxInt = opToAuxInt(arm64Negate(cc))
  3578  		v.AddArg3(x, a, flag)
  3579  		return true
  3580  	}
  3581  	// match: (CSEL [cc] x y (InvertFlags cmp))
  3582  	// result: (CSEL [arm64Invert(cc)] x y cmp)
  3583  	for {
  3584  		cc := auxIntToOp(v.AuxInt)
  3585  		x := v_0
  3586  		y := v_1
  3587  		if v_2.Op != OpARM64InvertFlags {
  3588  			break
  3589  		}
  3590  		cmp := v_2.Args[0]
  3591  		v.reset(OpARM64CSEL)
  3592  		v.AuxInt = opToAuxInt(arm64Invert(cc))
  3593  		v.AddArg3(x, y, cmp)
  3594  		return true
  3595  	}
  3596  	// match: (CSEL [cc] x _ flag)
  3597  	// cond: ccARM64Eval(cc, flag) > 0
  3598  	// result: x
  3599  	for {
  3600  		cc := auxIntToOp(v.AuxInt)
  3601  		x := v_0
  3602  		flag := v_2
  3603  		if !(ccARM64Eval(cc, flag) > 0) {
  3604  			break
  3605  		}
  3606  		v.copyOf(x)
  3607  		return true
  3608  	}
  3609  	// match: (CSEL [cc] _ y flag)
  3610  	// cond: ccARM64Eval(cc, flag) < 0
  3611  	// result: y
  3612  	for {
  3613  		cc := auxIntToOp(v.AuxInt)
  3614  		y := v_1
  3615  		flag := v_2
  3616  		if !(ccARM64Eval(cc, flag) < 0) {
  3617  			break
  3618  		}
  3619  		v.copyOf(y)
  3620  		return true
  3621  	}
  3622  	// match: (CSEL [cc] x y (CMPWconst [0] boolval))
  3623  	// cond: cc == OpARM64NotEqual && flagArg(boolval) != nil
  3624  	// result: (CSEL [boolval.Op] x y flagArg(boolval))
  3625  	for {
  3626  		cc := auxIntToOp(v.AuxInt)
  3627  		x := v_0
  3628  		y := v_1
  3629  		if v_2.Op != OpARM64CMPWconst || auxIntToInt32(v_2.AuxInt) != 0 {
  3630  			break
  3631  		}
  3632  		boolval := v_2.Args[0]
  3633  		if !(cc == OpARM64NotEqual && flagArg(boolval) != nil) {
  3634  			break
  3635  		}
  3636  		v.reset(OpARM64CSEL)
  3637  		v.AuxInt = opToAuxInt(boolval.Op)
  3638  		v.AddArg3(x, y, flagArg(boolval))
  3639  		return true
  3640  	}
  3641  	// match: (CSEL [cc] x y (CMPWconst [0] boolval))
  3642  	// cond: cc == OpARM64Equal && flagArg(boolval) != nil
  3643  	// result: (CSEL [arm64Negate(boolval.Op)] x y flagArg(boolval))
  3644  	for {
  3645  		cc := auxIntToOp(v.AuxInt)
  3646  		x := v_0
  3647  		y := v_1
  3648  		if v_2.Op != OpARM64CMPWconst || auxIntToInt32(v_2.AuxInt) != 0 {
  3649  			break
  3650  		}
  3651  		boolval := v_2.Args[0]
  3652  		if !(cc == OpARM64Equal && flagArg(boolval) != nil) {
  3653  			break
  3654  		}
  3655  		v.reset(OpARM64CSEL)
  3656  		v.AuxInt = opToAuxInt(arm64Negate(boolval.Op))
  3657  		v.AddArg3(x, y, flagArg(boolval))
  3658  		return true
  3659  	}
  3660  	return false
  3661  }
  3662  func rewriteValueARM64_OpARM64CSEL0(v *Value) bool {
  3663  	v_1 := v.Args[1]
  3664  	v_0 := v.Args[0]
  3665  	// match: (CSEL0 [cc] x (InvertFlags cmp))
  3666  	// result: (CSEL0 [arm64Invert(cc)] x cmp)
  3667  	for {
  3668  		cc := auxIntToOp(v.AuxInt)
  3669  		x := v_0
  3670  		if v_1.Op != OpARM64InvertFlags {
  3671  			break
  3672  		}
  3673  		cmp := v_1.Args[0]
  3674  		v.reset(OpARM64CSEL0)
  3675  		v.AuxInt = opToAuxInt(arm64Invert(cc))
  3676  		v.AddArg2(x, cmp)
  3677  		return true
  3678  	}
  3679  	// match: (CSEL0 [cc] x flag)
  3680  	// cond: ccARM64Eval(cc, flag) > 0
  3681  	// result: x
  3682  	for {
  3683  		cc := auxIntToOp(v.AuxInt)
  3684  		x := v_0
  3685  		flag := v_1
  3686  		if !(ccARM64Eval(cc, flag) > 0) {
  3687  			break
  3688  		}
  3689  		v.copyOf(x)
  3690  		return true
  3691  	}
  3692  	// match: (CSEL0 [cc] _ flag)
  3693  	// cond: ccARM64Eval(cc, flag) < 0
  3694  	// result: (MOVDconst [0])
  3695  	for {
  3696  		cc := auxIntToOp(v.AuxInt)
  3697  		flag := v_1
  3698  		if !(ccARM64Eval(cc, flag) < 0) {
  3699  			break
  3700  		}
  3701  		v.reset(OpARM64MOVDconst)
  3702  		v.AuxInt = int64ToAuxInt(0)
  3703  		return true
  3704  	}
  3705  	// match: (CSEL0 [cc] x (CMPWconst [0] boolval))
  3706  	// cond: cc == OpARM64NotEqual && flagArg(boolval) != nil
  3707  	// result: (CSEL0 [boolval.Op] x flagArg(boolval))
  3708  	for {
  3709  		cc := auxIntToOp(v.AuxInt)
  3710  		x := v_0
  3711  		if v_1.Op != OpARM64CMPWconst || auxIntToInt32(v_1.AuxInt) != 0 {
  3712  			break
  3713  		}
  3714  		boolval := v_1.Args[0]
  3715  		if !(cc == OpARM64NotEqual && flagArg(boolval) != nil) {
  3716  			break
  3717  		}
  3718  		v.reset(OpARM64CSEL0)
  3719  		v.AuxInt = opToAuxInt(boolval.Op)
  3720  		v.AddArg2(x, flagArg(boolval))
  3721  		return true
  3722  	}
  3723  	// match: (CSEL0 [cc] x (CMPWconst [0] boolval))
  3724  	// cond: cc == OpARM64Equal && flagArg(boolval) != nil
  3725  	// result: (CSEL0 [arm64Negate(boolval.Op)] x flagArg(boolval))
  3726  	for {
  3727  		cc := auxIntToOp(v.AuxInt)
  3728  		x := v_0
  3729  		if v_1.Op != OpARM64CMPWconst || auxIntToInt32(v_1.AuxInt) != 0 {
  3730  			break
  3731  		}
  3732  		boolval := v_1.Args[0]
  3733  		if !(cc == OpARM64Equal && flagArg(boolval) != nil) {
  3734  			break
  3735  		}
  3736  		v.reset(OpARM64CSEL0)
  3737  		v.AuxInt = opToAuxInt(arm64Negate(boolval.Op))
  3738  		v.AddArg2(x, flagArg(boolval))
  3739  		return true
  3740  	}
  3741  	return false
  3742  }
  3743  func rewriteValueARM64_OpARM64CSETM(v *Value) bool {
  3744  	v_0 := v.Args[0]
  3745  	// match: (CSETM [cc] (InvertFlags cmp))
  3746  	// result: (CSETM [arm64Invert(cc)] cmp)
  3747  	for {
  3748  		cc := auxIntToOp(v.AuxInt)
  3749  		if v_0.Op != OpARM64InvertFlags {
  3750  			break
  3751  		}
  3752  		cmp := v_0.Args[0]
  3753  		v.reset(OpARM64CSETM)
  3754  		v.AuxInt = opToAuxInt(arm64Invert(cc))
  3755  		v.AddArg(cmp)
  3756  		return true
  3757  	}
  3758  	// match: (CSETM [cc] flag)
  3759  	// cond: ccARM64Eval(cc, flag) > 0
  3760  	// result: (MOVDconst [-1])
  3761  	for {
  3762  		cc := auxIntToOp(v.AuxInt)
  3763  		flag := v_0
  3764  		if !(ccARM64Eval(cc, flag) > 0) {
  3765  			break
  3766  		}
  3767  		v.reset(OpARM64MOVDconst)
  3768  		v.AuxInt = int64ToAuxInt(-1)
  3769  		return true
  3770  	}
  3771  	// match: (CSETM [cc] flag)
  3772  	// cond: ccARM64Eval(cc, flag) < 0
  3773  	// result: (MOVDconst [0])
  3774  	for {
  3775  		cc := auxIntToOp(v.AuxInt)
  3776  		flag := v_0
  3777  		if !(ccARM64Eval(cc, flag) < 0) {
  3778  			break
  3779  		}
  3780  		v.reset(OpARM64MOVDconst)
  3781  		v.AuxInt = int64ToAuxInt(0)
  3782  		return true
  3783  	}
  3784  	return false
  3785  }
  3786  func rewriteValueARM64_OpARM64CSINC(v *Value) bool {
  3787  	v_2 := v.Args[2]
  3788  	v_1 := v.Args[1]
  3789  	v_0 := v.Args[0]
  3790  	// match: (CSINC [cc] x y (InvertFlags cmp))
  3791  	// result: (CSINC [arm64Invert(cc)] x y cmp)
  3792  	for {
  3793  		cc := auxIntToOp(v.AuxInt)
  3794  		x := v_0
  3795  		y := v_1
  3796  		if v_2.Op != OpARM64InvertFlags {
  3797  			break
  3798  		}
  3799  		cmp := v_2.Args[0]
  3800  		v.reset(OpARM64CSINC)
  3801  		v.AuxInt = opToAuxInt(arm64Invert(cc))
  3802  		v.AddArg3(x, y, cmp)
  3803  		return true
  3804  	}
  3805  	// match: (CSINC [cc] x _ flag)
  3806  	// cond: ccARM64Eval(cc, flag) > 0
  3807  	// result: x
  3808  	for {
  3809  		cc := auxIntToOp(v.AuxInt)
  3810  		x := v_0
  3811  		flag := v_2
  3812  		if !(ccARM64Eval(cc, flag) > 0) {
  3813  			break
  3814  		}
  3815  		v.copyOf(x)
  3816  		return true
  3817  	}
  3818  	// match: (CSINC [cc] _ y flag)
  3819  	// cond: ccARM64Eval(cc, flag) < 0
  3820  	// result: (ADDconst [1] y)
  3821  	for {
  3822  		cc := auxIntToOp(v.AuxInt)
  3823  		y := v_1
  3824  		flag := v_2
  3825  		if !(ccARM64Eval(cc, flag) < 0) {
  3826  			break
  3827  		}
  3828  		v.reset(OpARM64ADDconst)
  3829  		v.AuxInt = int64ToAuxInt(1)
  3830  		v.AddArg(y)
  3831  		return true
  3832  	}
  3833  	return false
  3834  }
  3835  func rewriteValueARM64_OpARM64CSINV(v *Value) bool {
  3836  	v_2 := v.Args[2]
  3837  	v_1 := v.Args[1]
  3838  	v_0 := v.Args[0]
  3839  	// match: (CSINV [cc] x y (InvertFlags cmp))
  3840  	// result: (CSINV [arm64Invert(cc)] x y cmp)
  3841  	for {
  3842  		cc := auxIntToOp(v.AuxInt)
  3843  		x := v_0
  3844  		y := v_1
  3845  		if v_2.Op != OpARM64InvertFlags {
  3846  			break
  3847  		}
  3848  		cmp := v_2.Args[0]
  3849  		v.reset(OpARM64CSINV)
  3850  		v.AuxInt = opToAuxInt(arm64Invert(cc))
  3851  		v.AddArg3(x, y, cmp)
  3852  		return true
  3853  	}
  3854  	// match: (CSINV [cc] x _ flag)
  3855  	// cond: ccARM64Eval(cc, flag) > 0
  3856  	// result: x
  3857  	for {
  3858  		cc := auxIntToOp(v.AuxInt)
  3859  		x := v_0
  3860  		flag := v_2
  3861  		if !(ccARM64Eval(cc, flag) > 0) {
  3862  			break
  3863  		}
  3864  		v.copyOf(x)
  3865  		return true
  3866  	}
  3867  	// match: (CSINV [cc] _ y flag)
  3868  	// cond: ccARM64Eval(cc, flag) < 0
  3869  	// result: (Not y)
  3870  	for {
  3871  		cc := auxIntToOp(v.AuxInt)
  3872  		y := v_1
  3873  		flag := v_2
  3874  		if !(ccARM64Eval(cc, flag) < 0) {
  3875  			break
  3876  		}
  3877  		v.reset(OpNot)
  3878  		v.AddArg(y)
  3879  		return true
  3880  	}
  3881  	return false
  3882  }
  3883  func rewriteValueARM64_OpARM64CSNEG(v *Value) bool {
  3884  	v_2 := v.Args[2]
  3885  	v_1 := v.Args[1]
  3886  	v_0 := v.Args[0]
  3887  	// match: (CSNEG [cc] x y (InvertFlags cmp))
  3888  	// result: (CSNEG [arm64Invert(cc)] x y cmp)
  3889  	for {
  3890  		cc := auxIntToOp(v.AuxInt)
  3891  		x := v_0
  3892  		y := v_1
  3893  		if v_2.Op != OpARM64InvertFlags {
  3894  			break
  3895  		}
  3896  		cmp := v_2.Args[0]
  3897  		v.reset(OpARM64CSNEG)
  3898  		v.AuxInt = opToAuxInt(arm64Invert(cc))
  3899  		v.AddArg3(x, y, cmp)
  3900  		return true
  3901  	}
  3902  	// match: (CSNEG [cc] x _ flag)
  3903  	// cond: ccARM64Eval(cc, flag) > 0
  3904  	// result: x
  3905  	for {
  3906  		cc := auxIntToOp(v.AuxInt)
  3907  		x := v_0
  3908  		flag := v_2
  3909  		if !(ccARM64Eval(cc, flag) > 0) {
  3910  			break
  3911  		}
  3912  		v.copyOf(x)
  3913  		return true
  3914  	}
  3915  	// match: (CSNEG [cc] _ y flag)
  3916  	// cond: ccARM64Eval(cc, flag) < 0
  3917  	// result: (NEG y)
  3918  	for {
  3919  		cc := auxIntToOp(v.AuxInt)
  3920  		y := v_1
  3921  		flag := v_2
  3922  		if !(ccARM64Eval(cc, flag) < 0) {
  3923  			break
  3924  		}
  3925  		v.reset(OpARM64NEG)
  3926  		v.AddArg(y)
  3927  		return true
  3928  	}
  3929  	return false
  3930  }
  3931  func rewriteValueARM64_OpARM64DIV(v *Value) bool {
  3932  	v_1 := v.Args[1]
  3933  	v_0 := v.Args[0]
  3934  	// match: (DIV (MOVDconst [c]) (MOVDconst [d]))
  3935  	// cond: d != 0
  3936  	// result: (MOVDconst [c/d])
  3937  	for {
  3938  		if v_0.Op != OpARM64MOVDconst {
  3939  			break
  3940  		}
  3941  		c := auxIntToInt64(v_0.AuxInt)
  3942  		if v_1.Op != OpARM64MOVDconst {
  3943  			break
  3944  		}
  3945  		d := auxIntToInt64(v_1.AuxInt)
  3946  		if !(d != 0) {
  3947  			break
  3948  		}
  3949  		v.reset(OpARM64MOVDconst)
  3950  		v.AuxInt = int64ToAuxInt(c / d)
  3951  		return true
  3952  	}
  3953  	return false
  3954  }
  3955  func rewriteValueARM64_OpARM64DIVW(v *Value) bool {
  3956  	v_1 := v.Args[1]
  3957  	v_0 := v.Args[0]
  3958  	// match: (DIVW (MOVDconst [c]) (MOVDconst [d]))
  3959  	// cond: d != 0
  3960  	// result: (MOVDconst [int64(uint32(int32(c)/int32(d)))])
  3961  	for {
  3962  		if v_0.Op != OpARM64MOVDconst {
  3963  			break
  3964  		}
  3965  		c := auxIntToInt64(v_0.AuxInt)
  3966  		if v_1.Op != OpARM64MOVDconst {
  3967  			break
  3968  		}
  3969  		d := auxIntToInt64(v_1.AuxInt)
  3970  		if !(d != 0) {
  3971  			break
  3972  		}
  3973  		v.reset(OpARM64MOVDconst)
  3974  		v.AuxInt = int64ToAuxInt(int64(uint32(int32(c) / int32(d))))
  3975  		return true
  3976  	}
  3977  	return false
  3978  }
  3979  func rewriteValueARM64_OpARM64EON(v *Value) bool {
  3980  	v_1 := v.Args[1]
  3981  	v_0 := v.Args[0]
  3982  	// match: (EON x (MOVDconst [c]))
  3983  	// result: (XORconst [^c] x)
  3984  	for {
  3985  		x := v_0
  3986  		if v_1.Op != OpARM64MOVDconst {
  3987  			break
  3988  		}
  3989  		c := auxIntToInt64(v_1.AuxInt)
  3990  		v.reset(OpARM64XORconst)
  3991  		v.AuxInt = int64ToAuxInt(^c)
  3992  		v.AddArg(x)
  3993  		return true
  3994  	}
  3995  	// match: (EON x x)
  3996  	// result: (MOVDconst [-1])
  3997  	for {
  3998  		x := v_0
  3999  		if x != v_1 {
  4000  			break
  4001  		}
  4002  		v.reset(OpARM64MOVDconst)
  4003  		v.AuxInt = int64ToAuxInt(-1)
  4004  		return true
  4005  	}
  4006  	// match: (EON x0 x1:(SLLconst [c] y))
  4007  	// cond: clobberIfDead(x1)
  4008  	// result: (EONshiftLL x0 y [c])
  4009  	for {
  4010  		x0 := v_0
  4011  		x1 := v_1
  4012  		if x1.Op != OpARM64SLLconst {
  4013  			break
  4014  		}
  4015  		c := auxIntToInt64(x1.AuxInt)
  4016  		y := x1.Args[0]
  4017  		if !(clobberIfDead(x1)) {
  4018  			break
  4019  		}
  4020  		v.reset(OpARM64EONshiftLL)
  4021  		v.AuxInt = int64ToAuxInt(c)
  4022  		v.AddArg2(x0, y)
  4023  		return true
  4024  	}
  4025  	// match: (EON x0 x1:(SRLconst [c] y))
  4026  	// cond: clobberIfDead(x1)
  4027  	// result: (EONshiftRL x0 y [c])
  4028  	for {
  4029  		x0 := v_0
  4030  		x1 := v_1
  4031  		if x1.Op != OpARM64SRLconst {
  4032  			break
  4033  		}
  4034  		c := auxIntToInt64(x1.AuxInt)
  4035  		y := x1.Args[0]
  4036  		if !(clobberIfDead(x1)) {
  4037  			break
  4038  		}
  4039  		v.reset(OpARM64EONshiftRL)
  4040  		v.AuxInt = int64ToAuxInt(c)
  4041  		v.AddArg2(x0, y)
  4042  		return true
  4043  	}
  4044  	// match: (EON x0 x1:(SRAconst [c] y))
  4045  	// cond: clobberIfDead(x1)
  4046  	// result: (EONshiftRA x0 y [c])
  4047  	for {
  4048  		x0 := v_0
  4049  		x1 := v_1
  4050  		if x1.Op != OpARM64SRAconst {
  4051  			break
  4052  		}
  4053  		c := auxIntToInt64(x1.AuxInt)
  4054  		y := x1.Args[0]
  4055  		if !(clobberIfDead(x1)) {
  4056  			break
  4057  		}
  4058  		v.reset(OpARM64EONshiftRA)
  4059  		v.AuxInt = int64ToAuxInt(c)
  4060  		v.AddArg2(x0, y)
  4061  		return true
  4062  	}
  4063  	// match: (EON x0 x1:(RORconst [c] y))
  4064  	// cond: clobberIfDead(x1)
  4065  	// result: (EONshiftRO x0 y [c])
  4066  	for {
  4067  		x0 := v_0
  4068  		x1 := v_1
  4069  		if x1.Op != OpARM64RORconst {
  4070  			break
  4071  		}
  4072  		c := auxIntToInt64(x1.AuxInt)
  4073  		y := x1.Args[0]
  4074  		if !(clobberIfDead(x1)) {
  4075  			break
  4076  		}
  4077  		v.reset(OpARM64EONshiftRO)
  4078  		v.AuxInt = int64ToAuxInt(c)
  4079  		v.AddArg2(x0, y)
  4080  		return true
  4081  	}
  4082  	return false
  4083  }
  4084  func rewriteValueARM64_OpARM64EONshiftLL(v *Value) bool {
  4085  	v_1 := v.Args[1]
  4086  	v_0 := v.Args[0]
  4087  	// match: (EONshiftLL x (MOVDconst [c]) [d])
  4088  	// result: (XORconst x [^int64(uint64(c)<<uint64(d))])
  4089  	for {
  4090  		d := auxIntToInt64(v.AuxInt)
  4091  		x := v_0
  4092  		if v_1.Op != OpARM64MOVDconst {
  4093  			break
  4094  		}
  4095  		c := auxIntToInt64(v_1.AuxInt)
  4096  		v.reset(OpARM64XORconst)
  4097  		v.AuxInt = int64ToAuxInt(^int64(uint64(c) << uint64(d)))
  4098  		v.AddArg(x)
  4099  		return true
  4100  	}
  4101  	// match: (EONshiftLL (SLLconst x [c]) x [c])
  4102  	// result: (MOVDconst [-1])
  4103  	for {
  4104  		c := auxIntToInt64(v.AuxInt)
  4105  		if v_0.Op != OpARM64SLLconst || auxIntToInt64(v_0.AuxInt) != c {
  4106  			break
  4107  		}
  4108  		x := v_0.Args[0]
  4109  		if x != v_1 {
  4110  			break
  4111  		}
  4112  		v.reset(OpARM64MOVDconst)
  4113  		v.AuxInt = int64ToAuxInt(-1)
  4114  		return true
  4115  	}
  4116  	return false
  4117  }
  4118  func rewriteValueARM64_OpARM64EONshiftRA(v *Value) bool {
  4119  	v_1 := v.Args[1]
  4120  	v_0 := v.Args[0]
  4121  	// match: (EONshiftRA x (MOVDconst [c]) [d])
  4122  	// result: (XORconst x [^(c>>uint64(d))])
  4123  	for {
  4124  		d := auxIntToInt64(v.AuxInt)
  4125  		x := v_0
  4126  		if v_1.Op != OpARM64MOVDconst {
  4127  			break
  4128  		}
  4129  		c := auxIntToInt64(v_1.AuxInt)
  4130  		v.reset(OpARM64XORconst)
  4131  		v.AuxInt = int64ToAuxInt(^(c >> uint64(d)))
  4132  		v.AddArg(x)
  4133  		return true
  4134  	}
  4135  	// match: (EONshiftRA (SRAconst x [c]) x [c])
  4136  	// result: (MOVDconst [-1])
  4137  	for {
  4138  		c := auxIntToInt64(v.AuxInt)
  4139  		if v_0.Op != OpARM64SRAconst || auxIntToInt64(v_0.AuxInt) != c {
  4140  			break
  4141  		}
  4142  		x := v_0.Args[0]
  4143  		if x != v_1 {
  4144  			break
  4145  		}
  4146  		v.reset(OpARM64MOVDconst)
  4147  		v.AuxInt = int64ToAuxInt(-1)
  4148  		return true
  4149  	}
  4150  	return false
  4151  }
  4152  func rewriteValueARM64_OpARM64EONshiftRL(v *Value) bool {
  4153  	v_1 := v.Args[1]
  4154  	v_0 := v.Args[0]
  4155  	// match: (EONshiftRL x (MOVDconst [c]) [d])
  4156  	// result: (XORconst x [^int64(uint64(c)>>uint64(d))])
  4157  	for {
  4158  		d := auxIntToInt64(v.AuxInt)
  4159  		x := v_0
  4160  		if v_1.Op != OpARM64MOVDconst {
  4161  			break
  4162  		}
  4163  		c := auxIntToInt64(v_1.AuxInt)
  4164  		v.reset(OpARM64XORconst)
  4165  		v.AuxInt = int64ToAuxInt(^int64(uint64(c) >> uint64(d)))
  4166  		v.AddArg(x)
  4167  		return true
  4168  	}
  4169  	// match: (EONshiftRL (SRLconst x [c]) x [c])
  4170  	// result: (MOVDconst [-1])
  4171  	for {
  4172  		c := auxIntToInt64(v.AuxInt)
  4173  		if v_0.Op != OpARM64SRLconst || auxIntToInt64(v_0.AuxInt) != c {
  4174  			break
  4175  		}
  4176  		x := v_0.Args[0]
  4177  		if x != v_1 {
  4178  			break
  4179  		}
  4180  		v.reset(OpARM64MOVDconst)
  4181  		v.AuxInt = int64ToAuxInt(-1)
  4182  		return true
  4183  	}
  4184  	return false
  4185  }
  4186  func rewriteValueARM64_OpARM64EONshiftRO(v *Value) bool {
  4187  	v_1 := v.Args[1]
  4188  	v_0 := v.Args[0]
  4189  	// match: (EONshiftRO x (MOVDconst [c]) [d])
  4190  	// result: (XORconst x [^rotateRight64(c, d)])
  4191  	for {
  4192  		d := auxIntToInt64(v.AuxInt)
  4193  		x := v_0
  4194  		if v_1.Op != OpARM64MOVDconst {
  4195  			break
  4196  		}
  4197  		c := auxIntToInt64(v_1.AuxInt)
  4198  		v.reset(OpARM64XORconst)
  4199  		v.AuxInt = int64ToAuxInt(^rotateRight64(c, d))
  4200  		v.AddArg(x)
  4201  		return true
  4202  	}
  4203  	// match: (EONshiftRO (RORconst x [c]) x [c])
  4204  	// result: (MOVDconst [-1])
  4205  	for {
  4206  		c := auxIntToInt64(v.AuxInt)
  4207  		if v_0.Op != OpARM64RORconst || auxIntToInt64(v_0.AuxInt) != c {
  4208  			break
  4209  		}
  4210  		x := v_0.Args[0]
  4211  		if x != v_1 {
  4212  			break
  4213  		}
  4214  		v.reset(OpARM64MOVDconst)
  4215  		v.AuxInt = int64ToAuxInt(-1)
  4216  		return true
  4217  	}
  4218  	return false
  4219  }
  4220  func rewriteValueARM64_OpARM64Equal(v *Value) bool {
  4221  	v_0 := v.Args[0]
  4222  	b := v.Block
  4223  	// match: (Equal (CMPconst [0] z:(AND x y)))
  4224  	// cond: z.Uses == 1
  4225  	// result: (Equal (TST x y))
  4226  	for {
  4227  		if v_0.Op != OpARM64CMPconst || auxIntToInt64(v_0.AuxInt) != 0 {
  4228  			break
  4229  		}
  4230  		z := v_0.Args[0]
  4231  		if z.Op != OpARM64AND {
  4232  			break
  4233  		}
  4234  		y := z.Args[1]
  4235  		x := z.Args[0]
  4236  		if !(z.Uses == 1) {
  4237  			break
  4238  		}
  4239  		v.reset(OpARM64Equal)
  4240  		v0 := b.NewValue0(v.Pos, OpARM64TST, types.TypeFlags)
  4241  		v0.AddArg2(x, y)
  4242  		v.AddArg(v0)
  4243  		return true
  4244  	}
  4245  	// match: (Equal (CMPWconst [0] x:(ANDconst [c] y)))
  4246  	// cond: x.Uses == 1
  4247  	// result: (Equal (TSTWconst [int32(c)] y))
  4248  	for {
  4249  		if v_0.Op != OpARM64CMPWconst || auxIntToInt32(v_0.AuxInt) != 0 {
  4250  			break
  4251  		}
  4252  		x := v_0.Args[0]
  4253  		if x.Op != OpARM64ANDconst {
  4254  			break
  4255  		}
  4256  		c := auxIntToInt64(x.AuxInt)
  4257  		y := x.Args[0]
  4258  		if !(x.Uses == 1) {
  4259  			break
  4260  		}
  4261  		v.reset(OpARM64Equal)
  4262  		v0 := b.NewValue0(v.Pos, OpARM64TSTWconst, types.TypeFlags)
  4263  		v0.AuxInt = int32ToAuxInt(int32(c))
  4264  		v0.AddArg(y)
  4265  		v.AddArg(v0)
  4266  		return true
  4267  	}
  4268  	// match: (Equal (CMPWconst [0] z:(AND x y)))
  4269  	// cond: z.Uses == 1
  4270  	// result: (Equal (TSTW x y))
  4271  	for {
  4272  		if v_0.Op != OpARM64CMPWconst || auxIntToInt32(v_0.AuxInt) != 0 {
  4273  			break
  4274  		}
  4275  		z := v_0.Args[0]
  4276  		if z.Op != OpARM64AND {
  4277  			break
  4278  		}
  4279  		y := z.Args[1]
  4280  		x := z.Args[0]
  4281  		if !(z.Uses == 1) {
  4282  			break
  4283  		}
  4284  		v.reset(OpARM64Equal)
  4285  		v0 := b.NewValue0(v.Pos, OpARM64TSTW, types.TypeFlags)
  4286  		v0.AddArg2(x, y)
  4287  		v.AddArg(v0)
  4288  		return true
  4289  	}
  4290  	// match: (Equal (CMPconst [0] x:(ANDconst [c] y)))
  4291  	// cond: x.Uses == 1
  4292  	// result: (Equal (TSTconst [c] y))
  4293  	for {
  4294  		if v_0.Op != OpARM64CMPconst || auxIntToInt64(v_0.AuxInt) != 0 {
  4295  			break
  4296  		}
  4297  		x := v_0.Args[0]
  4298  		if x.Op != OpARM64ANDconst {
  4299  			break
  4300  		}
  4301  		c := auxIntToInt64(x.AuxInt)
  4302  		y := x.Args[0]
  4303  		if !(x.Uses == 1) {
  4304  			break
  4305  		}
  4306  		v.reset(OpARM64Equal)
  4307  		v0 := b.NewValue0(v.Pos, OpARM64TSTconst, types.TypeFlags)
  4308  		v0.AuxInt = int64ToAuxInt(c)
  4309  		v0.AddArg(y)
  4310  		v.AddArg(v0)
  4311  		return true
  4312  	}
  4313  	// match: (Equal (CMP x z:(NEG y)))
  4314  	// cond: z.Uses == 1
  4315  	// result: (Equal (CMN x y))
  4316  	for {
  4317  		if v_0.Op != OpARM64CMP {
  4318  			break
  4319  		}
  4320  		_ = v_0.Args[1]
  4321  		x := v_0.Args[0]
  4322  		z := v_0.Args[1]
  4323  		if z.Op != OpARM64NEG {
  4324  			break
  4325  		}
  4326  		y := z.Args[0]
  4327  		if !(z.Uses == 1) {
  4328  			break
  4329  		}
  4330  		v.reset(OpARM64Equal)
  4331  		v0 := b.NewValue0(v.Pos, OpARM64CMN, types.TypeFlags)
  4332  		v0.AddArg2(x, y)
  4333  		v.AddArg(v0)
  4334  		return true
  4335  	}
  4336  	// match: (Equal (CMPW x z:(NEG y)))
  4337  	// cond: z.Uses == 1
  4338  	// result: (Equal (CMNW x y))
  4339  	for {
  4340  		if v_0.Op != OpARM64CMPW {
  4341  			break
  4342  		}
  4343  		_ = v_0.Args[1]
  4344  		x := v_0.Args[0]
  4345  		z := v_0.Args[1]
  4346  		if z.Op != OpARM64NEG {
  4347  			break
  4348  		}
  4349  		y := z.Args[0]
  4350  		if !(z.Uses == 1) {
  4351  			break
  4352  		}
  4353  		v.reset(OpARM64Equal)
  4354  		v0 := b.NewValue0(v.Pos, OpARM64CMNW, types.TypeFlags)
  4355  		v0.AddArg2(x, y)
  4356  		v.AddArg(v0)
  4357  		return true
  4358  	}
  4359  	// match: (Equal (CMPconst [0] x:(ADDconst [c] y)))
  4360  	// cond: x.Uses == 1
  4361  	// result: (Equal (CMNconst [c] y))
  4362  	for {
  4363  		if v_0.Op != OpARM64CMPconst || auxIntToInt64(v_0.AuxInt) != 0 {
  4364  			break
  4365  		}
  4366  		x := v_0.Args[0]
  4367  		if x.Op != OpARM64ADDconst {
  4368  			break
  4369  		}
  4370  		c := auxIntToInt64(x.AuxInt)
  4371  		y := x.Args[0]
  4372  		if !(x.Uses == 1) {
  4373  			break
  4374  		}
  4375  		v.reset(OpARM64Equal)
  4376  		v0 := b.NewValue0(v.Pos, OpARM64CMNconst, types.TypeFlags)
  4377  		v0.AuxInt = int64ToAuxInt(c)
  4378  		v0.AddArg(y)
  4379  		v.AddArg(v0)
  4380  		return true
  4381  	}
  4382  	// match: (Equal (CMPWconst [0] x:(ADDconst [c] y)))
  4383  	// cond: x.Uses == 1
  4384  	// result: (Equal (CMNWconst [int32(c)] y))
  4385  	for {
  4386  		if v_0.Op != OpARM64CMPWconst || auxIntToInt32(v_0.AuxInt) != 0 {
  4387  			break
  4388  		}
  4389  		x := v_0.Args[0]
  4390  		if x.Op != OpARM64ADDconst {
  4391  			break
  4392  		}
  4393  		c := auxIntToInt64(x.AuxInt)
  4394  		y := x.Args[0]
  4395  		if !(x.Uses == 1) {
  4396  			break
  4397  		}
  4398  		v.reset(OpARM64Equal)
  4399  		v0 := b.NewValue0(v.Pos, OpARM64CMNWconst, types.TypeFlags)
  4400  		v0.AuxInt = int32ToAuxInt(int32(c))
  4401  		v0.AddArg(y)
  4402  		v.AddArg(v0)
  4403  		return true
  4404  	}
  4405  	// match: (Equal (CMPconst [0] z:(ADD x y)))
  4406  	// cond: z.Uses == 1
  4407  	// result: (Equal (CMN x y))
  4408  	for {
  4409  		if v_0.Op != OpARM64CMPconst || auxIntToInt64(v_0.AuxInt) != 0 {
  4410  			break
  4411  		}
  4412  		z := v_0.Args[0]
  4413  		if z.Op != OpARM64ADD {
  4414  			break
  4415  		}
  4416  		y := z.Args[1]
  4417  		x := z.Args[0]
  4418  		if !(z.Uses == 1) {
  4419  			break
  4420  		}
  4421  		v.reset(OpARM64Equal)
  4422  		v0 := b.NewValue0(v.Pos, OpARM64CMN, types.TypeFlags)
  4423  		v0.AddArg2(x, y)
  4424  		v.AddArg(v0)
  4425  		return true
  4426  	}
  4427  	// match: (Equal (CMPWconst [0] z:(ADD x y)))
  4428  	// cond: z.Uses == 1
  4429  	// result: (Equal (CMNW x y))
  4430  	for {
  4431  		if v_0.Op != OpARM64CMPWconst || auxIntToInt32(v_0.AuxInt) != 0 {
  4432  			break
  4433  		}
  4434  		z := v_0.Args[0]
  4435  		if z.Op != OpARM64ADD {
  4436  			break
  4437  		}
  4438  		y := z.Args[1]
  4439  		x := z.Args[0]
  4440  		if !(z.Uses == 1) {
  4441  			break
  4442  		}
  4443  		v.reset(OpARM64Equal)
  4444  		v0 := b.NewValue0(v.Pos, OpARM64CMNW, types.TypeFlags)
  4445  		v0.AddArg2(x, y)
  4446  		v.AddArg(v0)
  4447  		return true
  4448  	}
  4449  	// match: (Equal (CMPconst [0] z:(MADD a x y)))
  4450  	// cond: z.Uses == 1
  4451  	// result: (Equal (CMN a (MUL <x.Type> x y)))
  4452  	for {
  4453  		if v_0.Op != OpARM64CMPconst || auxIntToInt64(v_0.AuxInt) != 0 {
  4454  			break
  4455  		}
  4456  		z := v_0.Args[0]
  4457  		if z.Op != OpARM64MADD {
  4458  			break
  4459  		}
  4460  		y := z.Args[2]
  4461  		a := z.Args[0]
  4462  		x := z.Args[1]
  4463  		if !(z.Uses == 1) {
  4464  			break
  4465  		}
  4466  		v.reset(OpARM64Equal)
  4467  		v0 := b.NewValue0(v.Pos, OpARM64CMN, types.TypeFlags)
  4468  		v1 := b.NewValue0(v.Pos, OpARM64MUL, x.Type)
  4469  		v1.AddArg2(x, y)
  4470  		v0.AddArg2(a, v1)
  4471  		v.AddArg(v0)
  4472  		return true
  4473  	}
  4474  	// match: (Equal (CMPconst [0] z:(MSUB a x y)))
  4475  	// cond: z.Uses == 1
  4476  	// result: (Equal (CMP a (MUL <x.Type> x y)))
  4477  	for {
  4478  		if v_0.Op != OpARM64CMPconst || auxIntToInt64(v_0.AuxInt) != 0 {
  4479  			break
  4480  		}
  4481  		z := v_0.Args[0]
  4482  		if z.Op != OpARM64MSUB {
  4483  			break
  4484  		}
  4485  		y := z.Args[2]
  4486  		a := z.Args[0]
  4487  		x := z.Args[1]
  4488  		if !(z.Uses == 1) {
  4489  			break
  4490  		}
  4491  		v.reset(OpARM64Equal)
  4492  		v0 := b.NewValue0(v.Pos, OpARM64CMP, types.TypeFlags)
  4493  		v1 := b.NewValue0(v.Pos, OpARM64MUL, x.Type)
  4494  		v1.AddArg2(x, y)
  4495  		v0.AddArg2(a, v1)
  4496  		v.AddArg(v0)
  4497  		return true
  4498  	}
  4499  	// match: (Equal (CMPWconst [0] z:(MADDW a x y)))
  4500  	// cond: z.Uses == 1
  4501  	// result: (Equal (CMNW a (MULW <x.Type> x y)))
  4502  	for {
  4503  		if v_0.Op != OpARM64CMPWconst || auxIntToInt32(v_0.AuxInt) != 0 {
  4504  			break
  4505  		}
  4506  		z := v_0.Args[0]
  4507  		if z.Op != OpARM64MADDW {
  4508  			break
  4509  		}
  4510  		y := z.Args[2]
  4511  		a := z.Args[0]
  4512  		x := z.Args[1]
  4513  		if !(z.Uses == 1) {
  4514  			break
  4515  		}
  4516  		v.reset(OpARM64Equal)
  4517  		v0 := b.NewValue0(v.Pos, OpARM64CMNW, types.TypeFlags)
  4518  		v1 := b.NewValue0(v.Pos, OpARM64MULW, x.Type)
  4519  		v1.AddArg2(x, y)
  4520  		v0.AddArg2(a, v1)
  4521  		v.AddArg(v0)
  4522  		return true
  4523  	}
  4524  	// match: (Equal (CMPWconst [0] z:(MSUBW a x y)))
  4525  	// cond: z.Uses == 1
  4526  	// result: (Equal (CMPW a (MULW <x.Type> x y)))
  4527  	for {
  4528  		if v_0.Op != OpARM64CMPWconst || auxIntToInt32(v_0.AuxInt) != 0 {
  4529  			break
  4530  		}
  4531  		z := v_0.Args[0]
  4532  		if z.Op != OpARM64MSUBW {
  4533  			break
  4534  		}
  4535  		y := z.Args[2]
  4536  		a := z.Args[0]
  4537  		x := z.Args[1]
  4538  		if !(z.Uses == 1) {
  4539  			break
  4540  		}
  4541  		v.reset(OpARM64Equal)
  4542  		v0 := b.NewValue0(v.Pos, OpARM64CMPW, types.TypeFlags)
  4543  		v1 := b.NewValue0(v.Pos, OpARM64MULW, x.Type)
  4544  		v1.AddArg2(x, y)
  4545  		v0.AddArg2(a, v1)
  4546  		v.AddArg(v0)
  4547  		return true
  4548  	}
  4549  	// match: (Equal (FlagConstant [fc]))
  4550  	// result: (MOVDconst [b2i(fc.eq())])
  4551  	for {
  4552  		if v_0.Op != OpARM64FlagConstant {
  4553  			break
  4554  		}
  4555  		fc := auxIntToFlagConstant(v_0.AuxInt)
  4556  		v.reset(OpARM64MOVDconst)
  4557  		v.AuxInt = int64ToAuxInt(b2i(fc.eq()))
  4558  		return true
  4559  	}
  4560  	// match: (Equal (InvertFlags x))
  4561  	// result: (Equal x)
  4562  	for {
  4563  		if v_0.Op != OpARM64InvertFlags {
  4564  			break
  4565  		}
  4566  		x := v_0.Args[0]
  4567  		v.reset(OpARM64Equal)
  4568  		v.AddArg(x)
  4569  		return true
  4570  	}
  4571  	return false
  4572  }
  4573  func rewriteValueARM64_OpARM64FADDD(v *Value) bool {
  4574  	v_1 := v.Args[1]
  4575  	v_0 := v.Args[0]
  4576  	// match: (FADDD a (FMULD x y))
  4577  	// cond: a.Block.Func.useFMA(v)
  4578  	// result: (FMADDD a x y)
  4579  	for {
  4580  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
  4581  			a := v_0
  4582  			if v_1.Op != OpARM64FMULD {
  4583  				continue
  4584  			}
  4585  			y := v_1.Args[1]
  4586  			x := v_1.Args[0]
  4587  			if !(a.Block.Func.useFMA(v)) {
  4588  				continue
  4589  			}
  4590  			v.reset(OpARM64FMADDD)
  4591  			v.AddArg3(a, x, y)
  4592  			return true
  4593  		}
  4594  		break
  4595  	}
  4596  	// match: (FADDD a (FNMULD x y))
  4597  	// cond: a.Block.Func.useFMA(v)
  4598  	// result: (FMSUBD a x y)
  4599  	for {
  4600  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
  4601  			a := v_0
  4602  			if v_1.Op != OpARM64FNMULD {
  4603  				continue
  4604  			}
  4605  			y := v_1.Args[1]
  4606  			x := v_1.Args[0]
  4607  			if !(a.Block.Func.useFMA(v)) {
  4608  				continue
  4609  			}
  4610  			v.reset(OpARM64FMSUBD)
  4611  			v.AddArg3(a, x, y)
  4612  			return true
  4613  		}
  4614  		break
  4615  	}
  4616  	return false
  4617  }
  4618  func rewriteValueARM64_OpARM64FADDS(v *Value) bool {
  4619  	v_1 := v.Args[1]
  4620  	v_0 := v.Args[0]
  4621  	// match: (FADDS a (FMULS x y))
  4622  	// cond: a.Block.Func.useFMA(v)
  4623  	// result: (FMADDS a x y)
  4624  	for {
  4625  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
  4626  			a := v_0
  4627  			if v_1.Op != OpARM64FMULS {
  4628  				continue
  4629  			}
  4630  			y := v_1.Args[1]
  4631  			x := v_1.Args[0]
  4632  			if !(a.Block.Func.useFMA(v)) {
  4633  				continue
  4634  			}
  4635  			v.reset(OpARM64FMADDS)
  4636  			v.AddArg3(a, x, y)
  4637  			return true
  4638  		}
  4639  		break
  4640  	}
  4641  	// match: (FADDS a (FNMULS x y))
  4642  	// cond: a.Block.Func.useFMA(v)
  4643  	// result: (FMSUBS a x y)
  4644  	for {
  4645  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
  4646  			a := v_0
  4647  			if v_1.Op != OpARM64FNMULS {
  4648  				continue
  4649  			}
  4650  			y := v_1.Args[1]
  4651  			x := v_1.Args[0]
  4652  			if !(a.Block.Func.useFMA(v)) {
  4653  				continue
  4654  			}
  4655  			v.reset(OpARM64FMSUBS)
  4656  			v.AddArg3(a, x, y)
  4657  			return true
  4658  		}
  4659  		break
  4660  	}
  4661  	return false
  4662  }
  4663  func rewriteValueARM64_OpARM64FCMPD(v *Value) bool {
  4664  	v_1 := v.Args[1]
  4665  	v_0 := v.Args[0]
  4666  	b := v.Block
  4667  	// match: (FCMPD x (FMOVDconst [0]))
  4668  	// result: (FCMPD0 x)
  4669  	for {
  4670  		x := v_0
  4671  		if v_1.Op != OpARM64FMOVDconst || auxIntToFloat64(v_1.AuxInt) != 0 {
  4672  			break
  4673  		}
  4674  		v.reset(OpARM64FCMPD0)
  4675  		v.AddArg(x)
  4676  		return true
  4677  	}
  4678  	// match: (FCMPD (FMOVDconst [0]) x)
  4679  	// result: (InvertFlags (FCMPD0 x))
  4680  	for {
  4681  		if v_0.Op != OpARM64FMOVDconst || auxIntToFloat64(v_0.AuxInt) != 0 {
  4682  			break
  4683  		}
  4684  		x := v_1
  4685  		v.reset(OpARM64InvertFlags)
  4686  		v0 := b.NewValue0(v.Pos, OpARM64FCMPD0, types.TypeFlags)
  4687  		v0.AddArg(x)
  4688  		v.AddArg(v0)
  4689  		return true
  4690  	}
  4691  	return false
  4692  }
  4693  func rewriteValueARM64_OpARM64FCMPS(v *Value) bool {
  4694  	v_1 := v.Args[1]
  4695  	v_0 := v.Args[0]
  4696  	b := v.Block
  4697  	// match: (FCMPS x (FMOVSconst [0]))
  4698  	// result: (FCMPS0 x)
  4699  	for {
  4700  		x := v_0
  4701  		if v_1.Op != OpARM64FMOVSconst || auxIntToFloat64(v_1.AuxInt) != 0 {
  4702  			break
  4703  		}
  4704  		v.reset(OpARM64FCMPS0)
  4705  		v.AddArg(x)
  4706  		return true
  4707  	}
  4708  	// match: (FCMPS (FMOVSconst [0]) x)
  4709  	// result: (InvertFlags (FCMPS0 x))
  4710  	for {
  4711  		if v_0.Op != OpARM64FMOVSconst || auxIntToFloat64(v_0.AuxInt) != 0 {
  4712  			break
  4713  		}
  4714  		x := v_1
  4715  		v.reset(OpARM64InvertFlags)
  4716  		v0 := b.NewValue0(v.Pos, OpARM64FCMPS0, types.TypeFlags)
  4717  		v0.AddArg(x)
  4718  		v.AddArg(v0)
  4719  		return true
  4720  	}
  4721  	return false
  4722  }
  4723  func rewriteValueARM64_OpARM64FMOVDfpgp(v *Value) bool {
  4724  	v_0 := v.Args[0]
  4725  	b := v.Block
  4726  	// match: (FMOVDfpgp <t> (Arg [off] {sym}))
  4727  	// result: @b.Func.Entry (Arg <t> [off] {sym})
  4728  	for {
  4729  		t := v.Type
  4730  		if v_0.Op != OpArg {
  4731  			break
  4732  		}
  4733  		off := auxIntToInt32(v_0.AuxInt)
  4734  		sym := auxToSym(v_0.Aux)
  4735  		b = b.Func.Entry
  4736  		v0 := b.NewValue0(v.Pos, OpArg, t)
  4737  		v.copyOf(v0)
  4738  		v0.AuxInt = int32ToAuxInt(off)
  4739  		v0.Aux = symToAux(sym)
  4740  		return true
  4741  	}
  4742  	return false
  4743  }
  4744  func rewriteValueARM64_OpARM64FMOVDgpfp(v *Value) bool {
  4745  	v_0 := v.Args[0]
  4746  	b := v.Block
  4747  	// match: (FMOVDgpfp <t> (Arg [off] {sym}))
  4748  	// result: @b.Func.Entry (Arg <t> [off] {sym})
  4749  	for {
  4750  		t := v.Type
  4751  		if v_0.Op != OpArg {
  4752  			break
  4753  		}
  4754  		off := auxIntToInt32(v_0.AuxInt)
  4755  		sym := auxToSym(v_0.Aux)
  4756  		b = b.Func.Entry
  4757  		v0 := b.NewValue0(v.Pos, OpArg, t)
  4758  		v.copyOf(v0)
  4759  		v0.AuxInt = int32ToAuxInt(off)
  4760  		v0.Aux = symToAux(sym)
  4761  		return true
  4762  	}
  4763  	return false
  4764  }
  4765  func rewriteValueARM64_OpARM64FMOVDload(v *Value) bool {
  4766  	v_1 := v.Args[1]
  4767  	v_0 := v.Args[0]
  4768  	b := v.Block
  4769  	config := b.Func.Config
  4770  	// match: (FMOVDload [off] {sym} ptr (MOVDstore [off] {sym} ptr val _))
  4771  	// result: (FMOVDgpfp val)
  4772  	for {
  4773  		off := auxIntToInt32(v.AuxInt)
  4774  		sym := auxToSym(v.Aux)
  4775  		ptr := v_0
  4776  		if v_1.Op != OpARM64MOVDstore || auxIntToInt32(v_1.AuxInt) != off || auxToSym(v_1.Aux) != sym {
  4777  			break
  4778  		}
  4779  		val := v_1.Args[1]
  4780  		if ptr != v_1.Args[0] {
  4781  			break
  4782  		}
  4783  		v.reset(OpARM64FMOVDgpfp)
  4784  		v.AddArg(val)
  4785  		return true
  4786  	}
  4787  	// match: (FMOVDload [off1] {sym} (ADDconst [off2] ptr) mem)
  4788  	// cond: is32Bit(int64(off1)+off2) && (ptr.Op != OpSB || !config.ctxt.Flag_dynlink)
  4789  	// result: (FMOVDload [off1+int32(off2)] {sym} ptr mem)
  4790  	for {
  4791  		off1 := auxIntToInt32(v.AuxInt)
  4792  		sym := auxToSym(v.Aux)
  4793  		if v_0.Op != OpARM64ADDconst {
  4794  			break
  4795  		}
  4796  		off2 := auxIntToInt64(v_0.AuxInt)
  4797  		ptr := v_0.Args[0]
  4798  		mem := v_1
  4799  		if !(is32Bit(int64(off1)+off2) && (ptr.Op != OpSB || !config.ctxt.Flag_dynlink)) {
  4800  			break
  4801  		}
  4802  		v.reset(OpARM64FMOVDload)
  4803  		v.AuxInt = int32ToAuxInt(off1 + int32(off2))
  4804  		v.Aux = symToAux(sym)
  4805  		v.AddArg2(ptr, mem)
  4806  		return true
  4807  	}
  4808  	// match: (FMOVDload [off] {sym} (ADD ptr idx) mem)
  4809  	// cond: off == 0 && sym == nil
  4810  	// result: (FMOVDloadidx ptr idx mem)
  4811  	for {
  4812  		off := auxIntToInt32(v.AuxInt)
  4813  		sym := auxToSym(v.Aux)
  4814  		if v_0.Op != OpARM64ADD {
  4815  			break
  4816  		}
  4817  		idx := v_0.Args[1]
  4818  		ptr := v_0.Args[0]
  4819  		mem := v_1
  4820  		if !(off == 0 && sym == nil) {
  4821  			break
  4822  		}
  4823  		v.reset(OpARM64FMOVDloadidx)
  4824  		v.AddArg3(ptr, idx, mem)
  4825  		return true
  4826  	}
  4827  	// match: (FMOVDload [off] {sym} (ADDshiftLL [3] ptr idx) mem)
  4828  	// cond: off == 0 && sym == nil
  4829  	// result: (FMOVDloadidx8 ptr idx mem)
  4830  	for {
  4831  		off := auxIntToInt32(v.AuxInt)
  4832  		sym := auxToSym(v.Aux)
  4833  		if v_0.Op != OpARM64ADDshiftLL || auxIntToInt64(v_0.AuxInt) != 3 {
  4834  			break
  4835  		}
  4836  		idx := v_0.Args[1]
  4837  		ptr := v_0.Args[0]
  4838  		mem := v_1
  4839  		if !(off == 0 && sym == nil) {
  4840  			break
  4841  		}
  4842  		v.reset(OpARM64FMOVDloadidx8)
  4843  		v.AddArg3(ptr, idx, mem)
  4844  		return true
  4845  	}
  4846  	// match: (FMOVDload [off1] {sym1} (MOVDaddr [off2] {sym2} ptr) mem)
  4847  	// cond: canMergeSym(sym1,sym2) && is32Bit(int64(off1)+int64(off2)) && (ptr.Op != OpSB || !config.ctxt.Flag_dynlink)
  4848  	// result: (FMOVDload [off1+off2] {mergeSym(sym1,sym2)} ptr mem)
  4849  	for {
  4850  		off1 := auxIntToInt32(v.AuxInt)
  4851  		sym1 := auxToSym(v.Aux)
  4852  		if v_0.Op != OpARM64MOVDaddr {
  4853  			break
  4854  		}
  4855  		off2 := auxIntToInt32(v_0.AuxInt)
  4856  		sym2 := auxToSym(v_0.Aux)
  4857  		ptr := v_0.Args[0]
  4858  		mem := v_1
  4859  		if !(canMergeSym(sym1, sym2) && is32Bit(int64(off1)+int64(off2)) && (ptr.Op != OpSB || !config.ctxt.Flag_dynlink)) {
  4860  			break
  4861  		}
  4862  		v.reset(OpARM64FMOVDload)
  4863  		v.AuxInt = int32ToAuxInt(off1 + off2)
  4864  		v.Aux = symToAux(mergeSym(sym1, sym2))
  4865  		v.AddArg2(ptr, mem)
  4866  		return true
  4867  	}
  4868  	return false
  4869  }
  4870  func rewriteValueARM64_OpARM64FMOVDloadidx(v *Value) bool {
  4871  	v_2 := v.Args[2]
  4872  	v_1 := v.Args[1]
  4873  	v_0 := v.Args[0]
  4874  	// match: (FMOVDloadidx ptr (MOVDconst [c]) mem)
  4875  	// cond: is32Bit(c)
  4876  	// result: (FMOVDload [int32(c)] ptr mem)
  4877  	for {
  4878  		ptr := v_0
  4879  		if v_1.Op != OpARM64MOVDconst {
  4880  			break
  4881  		}
  4882  		c := auxIntToInt64(v_1.AuxInt)
  4883  		mem := v_2
  4884  		if !(is32Bit(c)) {
  4885  			break
  4886  		}
  4887  		v.reset(OpARM64FMOVDload)
  4888  		v.AuxInt = int32ToAuxInt(int32(c))
  4889  		v.AddArg2(ptr, mem)
  4890  		return true
  4891  	}
  4892  	// match: (FMOVDloadidx (MOVDconst [c]) ptr mem)
  4893  	// cond: is32Bit(c)
  4894  	// result: (FMOVDload [int32(c)] ptr mem)
  4895  	for {
  4896  		if v_0.Op != OpARM64MOVDconst {
  4897  			break
  4898  		}
  4899  		c := auxIntToInt64(v_0.AuxInt)
  4900  		ptr := v_1
  4901  		mem := v_2
  4902  		if !(is32Bit(c)) {
  4903  			break
  4904  		}
  4905  		v.reset(OpARM64FMOVDload)
  4906  		v.AuxInt = int32ToAuxInt(int32(c))
  4907  		v.AddArg2(ptr, mem)
  4908  		return true
  4909  	}
  4910  	// match: (FMOVDloadidx ptr (SLLconst [3] idx) mem)
  4911  	// result: (FMOVDloadidx8 ptr idx mem)
  4912  	for {
  4913  		ptr := v_0
  4914  		if v_1.Op != OpARM64SLLconst || auxIntToInt64(v_1.AuxInt) != 3 {
  4915  			break
  4916  		}
  4917  		idx := v_1.Args[0]
  4918  		mem := v_2
  4919  		v.reset(OpARM64FMOVDloadidx8)
  4920  		v.AddArg3(ptr, idx, mem)
  4921  		return true
  4922  	}
  4923  	// match: (FMOVDloadidx (SLLconst [3] idx) ptr mem)
  4924  	// result: (FMOVDloadidx8 ptr idx mem)
  4925  	for {
  4926  		if v_0.Op != OpARM64SLLconst || auxIntToInt64(v_0.AuxInt) != 3 {
  4927  			break
  4928  		}
  4929  		idx := v_0.Args[0]
  4930  		ptr := v_1
  4931  		mem := v_2
  4932  		v.reset(OpARM64FMOVDloadidx8)
  4933  		v.AddArg3(ptr, idx, mem)
  4934  		return true
  4935  	}
  4936  	return false
  4937  }
  4938  func rewriteValueARM64_OpARM64FMOVDloadidx8(v *Value) bool {
  4939  	v_2 := v.Args[2]
  4940  	v_1 := v.Args[1]
  4941  	v_0 := v.Args[0]
  4942  	// match: (FMOVDloadidx8 ptr (MOVDconst [c]) mem)
  4943  	// cond: is32Bit(c<<3)
  4944  	// result: (FMOVDload ptr [int32(c)<<3] mem)
  4945  	for {
  4946  		ptr := v_0
  4947  		if v_1.Op != OpARM64MOVDconst {
  4948  			break
  4949  		}
  4950  		c := auxIntToInt64(v_1.AuxInt)
  4951  		mem := v_2
  4952  		if !(is32Bit(c << 3)) {
  4953  			break
  4954  		}
  4955  		v.reset(OpARM64FMOVDload)
  4956  		v.AuxInt = int32ToAuxInt(int32(c) << 3)
  4957  		v.AddArg2(ptr, mem)
  4958  		return true
  4959  	}
  4960  	return false
  4961  }
  4962  func rewriteValueARM64_OpARM64FMOVDstore(v *Value) bool {
  4963  	v_2 := v.Args[2]
  4964  	v_1 := v.Args[1]
  4965  	v_0 := v.Args[0]
  4966  	b := v.Block
  4967  	config := b.Func.Config
  4968  	// match: (FMOVDstore [off] {sym} ptr (FMOVDgpfp val) mem)
  4969  	// result: (MOVDstore [off] {sym} ptr val mem)
  4970  	for {
  4971  		off := auxIntToInt32(v.AuxInt)
  4972  		sym := auxToSym(v.Aux)
  4973  		ptr := v_0
  4974  		if v_1.Op != OpARM64FMOVDgpfp {
  4975  			break
  4976  		}
  4977  		val := v_1.Args[0]
  4978  		mem := v_2
  4979  		v.reset(OpARM64MOVDstore)
  4980  		v.AuxInt = int32ToAuxInt(off)
  4981  		v.Aux = symToAux(sym)
  4982  		v.AddArg3(ptr, val, mem)
  4983  		return true
  4984  	}
  4985  	// match: (FMOVDstore [off1] {sym} (ADDconst [off2] ptr) val mem)
  4986  	// cond: is32Bit(int64(off1)+off2) && (ptr.Op != OpSB || !config.ctxt.Flag_dynlink)
  4987  	// result: (FMOVDstore [off1+int32(off2)] {sym} ptr val mem)
  4988  	for {
  4989  		off1 := auxIntToInt32(v.AuxInt)
  4990  		sym := auxToSym(v.Aux)
  4991  		if v_0.Op != OpARM64ADDconst {
  4992  			break
  4993  		}
  4994  		off2 := auxIntToInt64(v_0.AuxInt)
  4995  		ptr := v_0.Args[0]
  4996  		val := v_1
  4997  		mem := v_2
  4998  		if !(is32Bit(int64(off1)+off2) && (ptr.Op != OpSB || !config.ctxt.Flag_dynlink)) {
  4999  			break
  5000  		}
  5001  		v.reset(OpARM64FMOVDstore)
  5002  		v.AuxInt = int32ToAuxInt(off1 + int32(off2))
  5003  		v.Aux = symToAux(sym)
  5004  		v.AddArg3(ptr, val, mem)
  5005  		return true
  5006  	}
  5007  	// match: (FMOVDstore [off] {sym} (ADD ptr idx) val mem)
  5008  	// cond: off == 0 && sym == nil
  5009  	// result: (FMOVDstoreidx ptr idx val mem)
  5010  	for {
  5011  		off := auxIntToInt32(v.AuxInt)
  5012  		sym := auxToSym(v.Aux)
  5013  		if v_0.Op != OpARM64ADD {
  5014  			break
  5015  		}
  5016  		idx := v_0.Args[1]
  5017  		ptr := v_0.Args[0]
  5018  		val := v_1
  5019  		mem := v_2
  5020  		if !(off == 0 && sym == nil) {
  5021  			break
  5022  		}
  5023  		v.reset(OpARM64FMOVDstoreidx)
  5024  		v.AddArg4(ptr, idx, val, mem)
  5025  		return true
  5026  	}
  5027  	// match: (FMOVDstore [off] {sym} (ADDshiftLL [3] ptr idx) val mem)
  5028  	// cond: off == 0 && sym == nil
  5029  	// result: (FMOVDstoreidx8 ptr idx val mem)
  5030  	for {
  5031  		off := auxIntToInt32(v.AuxInt)
  5032  		sym := auxToSym(v.Aux)
  5033  		if v_0.Op != OpARM64ADDshiftLL || auxIntToInt64(v_0.AuxInt) != 3 {
  5034  			break
  5035  		}
  5036  		idx := v_0.Args[1]
  5037  		ptr := v_0.Args[0]
  5038  		val := v_1
  5039  		mem := v_2
  5040  		if !(off == 0 && sym == nil) {
  5041  			break
  5042  		}
  5043  		v.reset(OpARM64FMOVDstoreidx8)
  5044  		v.AddArg4(ptr, idx, val, mem)
  5045  		return true
  5046  	}
  5047  	// match: (FMOVDstore [off1] {sym1} (MOVDaddr [off2] {sym2} ptr) val mem)
  5048  	// cond: canMergeSym(sym1,sym2) && is32Bit(int64(off1)+int64(off2)) && (ptr.Op != OpSB || !config.ctxt.Flag_dynlink)
  5049  	// result: (FMOVDstore [off1+off2] {mergeSym(sym1,sym2)} ptr val mem)
  5050  	for {
  5051  		off1 := auxIntToInt32(v.AuxInt)
  5052  		sym1 := auxToSym(v.Aux)
  5053  		if v_0.Op != OpARM64MOVDaddr {
  5054  			break
  5055  		}
  5056  		off2 := auxIntToInt32(v_0.AuxInt)
  5057  		sym2 := auxToSym(v_0.Aux)
  5058  		ptr := v_0.Args[0]
  5059  		val := v_1
  5060  		mem := v_2
  5061  		if !(canMergeSym(sym1, sym2) && is32Bit(int64(off1)+int64(off2)) && (ptr.Op != OpSB || !config.ctxt.Flag_dynlink)) {
  5062  			break
  5063  		}
  5064  		v.reset(OpARM64FMOVDstore)
  5065  		v.AuxInt = int32ToAuxInt(off1 + off2)
  5066  		v.Aux = symToAux(mergeSym(sym1, sym2))
  5067  		v.AddArg3(ptr, val, mem)
  5068  		return true
  5069  	}
  5070  	return false
  5071  }
  5072  func rewriteValueARM64_OpARM64FMOVDstoreidx(v *Value) bool {
  5073  	v_3 := v.Args[3]
  5074  	v_2 := v.Args[2]
  5075  	v_1 := v.Args[1]
  5076  	v_0 := v.Args[0]
  5077  	// match: (FMOVDstoreidx ptr (MOVDconst [c]) val mem)
  5078  	// cond: is32Bit(c)
  5079  	// result: (FMOVDstore [int32(c)] ptr val mem)
  5080  	for {
  5081  		ptr := v_0
  5082  		if v_1.Op != OpARM64MOVDconst {
  5083  			break
  5084  		}
  5085  		c := auxIntToInt64(v_1.AuxInt)
  5086  		val := v_2
  5087  		mem := v_3
  5088  		if !(is32Bit(c)) {
  5089  			break
  5090  		}
  5091  		v.reset(OpARM64FMOVDstore)
  5092  		v.AuxInt = int32ToAuxInt(int32(c))
  5093  		v.AddArg3(ptr, val, mem)
  5094  		return true
  5095  	}
  5096  	// match: (FMOVDstoreidx (MOVDconst [c]) idx val mem)
  5097  	// cond: is32Bit(c)
  5098  	// result: (FMOVDstore [int32(c)] idx val mem)
  5099  	for {
  5100  		if v_0.Op != OpARM64MOVDconst {
  5101  			break
  5102  		}
  5103  		c := auxIntToInt64(v_0.AuxInt)
  5104  		idx := v_1
  5105  		val := v_2
  5106  		mem := v_3
  5107  		if !(is32Bit(c)) {
  5108  			break
  5109  		}
  5110  		v.reset(OpARM64FMOVDstore)
  5111  		v.AuxInt = int32ToAuxInt(int32(c))
  5112  		v.AddArg3(idx, val, mem)
  5113  		return true
  5114  	}
  5115  	// match: (FMOVDstoreidx ptr (SLLconst [3] idx) val mem)
  5116  	// result: (FMOVDstoreidx8 ptr idx val mem)
  5117  	for {
  5118  		ptr := v_0
  5119  		if v_1.Op != OpARM64SLLconst || auxIntToInt64(v_1.AuxInt) != 3 {
  5120  			break
  5121  		}
  5122  		idx := v_1.Args[0]
  5123  		val := v_2
  5124  		mem := v_3
  5125  		v.reset(OpARM64FMOVDstoreidx8)
  5126  		v.AddArg4(ptr, idx, val, mem)
  5127  		return true
  5128  	}
  5129  	// match: (FMOVDstoreidx (SLLconst [3] idx) ptr val mem)
  5130  	// result: (FMOVDstoreidx8 ptr idx val mem)
  5131  	for {
  5132  		if v_0.Op != OpARM64SLLconst || auxIntToInt64(v_0.AuxInt) != 3 {
  5133  			break
  5134  		}
  5135  		idx := v_0.Args[0]
  5136  		ptr := v_1
  5137  		val := v_2
  5138  		mem := v_3
  5139  		v.reset(OpARM64FMOVDstoreidx8)
  5140  		v.AddArg4(ptr, idx, val, mem)
  5141  		return true
  5142  	}
  5143  	return false
  5144  }
  5145  func rewriteValueARM64_OpARM64FMOVDstoreidx8(v *Value) bool {
  5146  	v_3 := v.Args[3]
  5147  	v_2 := v.Args[2]
  5148  	v_1 := v.Args[1]
  5149  	v_0 := v.Args[0]
  5150  	// match: (FMOVDstoreidx8 ptr (MOVDconst [c]) val mem)
  5151  	// cond: is32Bit(c<<3)
  5152  	// result: (FMOVDstore [int32(c)<<3] ptr val mem)
  5153  	for {
  5154  		ptr := v_0
  5155  		if v_1.Op != OpARM64MOVDconst {
  5156  			break
  5157  		}
  5158  		c := auxIntToInt64(v_1.AuxInt)
  5159  		val := v_2
  5160  		mem := v_3
  5161  		if !(is32Bit(c << 3)) {
  5162  			break
  5163  		}
  5164  		v.reset(OpARM64FMOVDstore)
  5165  		v.AuxInt = int32ToAuxInt(int32(c) << 3)
  5166  		v.AddArg3(ptr, val, mem)
  5167  		return true
  5168  	}
  5169  	return false
  5170  }
  5171  func rewriteValueARM64_OpARM64FMOVSload(v *Value) bool {
  5172  	v_1 := v.Args[1]
  5173  	v_0 := v.Args[0]
  5174  	b := v.Block
  5175  	config := b.Func.Config
  5176  	// match: (FMOVSload [off] {sym} ptr (MOVWstore [off] {sym} ptr val _))
  5177  	// result: (FMOVSgpfp val)
  5178  	for {
  5179  		off := auxIntToInt32(v.AuxInt)
  5180  		sym := auxToSym(v.Aux)
  5181  		ptr := v_0
  5182  		if v_1.Op != OpARM64MOVWstore || auxIntToInt32(v_1.AuxInt) != off || auxToSym(v_1.Aux) != sym {
  5183  			break
  5184  		}
  5185  		val := v_1.Args[1]
  5186  		if ptr != v_1.Args[0] {
  5187  			break
  5188  		}
  5189  		v.reset(OpARM64FMOVSgpfp)
  5190  		v.AddArg(val)
  5191  		return true
  5192  	}
  5193  	// match: (FMOVSload [off1] {sym} (ADDconst [off2] ptr) mem)
  5194  	// cond: is32Bit(int64(off1)+off2) && (ptr.Op != OpSB || !config.ctxt.Flag_dynlink)
  5195  	// result: (FMOVSload [off1+int32(off2)] {sym} ptr mem)
  5196  	for {
  5197  		off1 := auxIntToInt32(v.AuxInt)
  5198  		sym := auxToSym(v.Aux)
  5199  		if v_0.Op != OpARM64ADDconst {
  5200  			break
  5201  		}
  5202  		off2 := auxIntToInt64(v_0.AuxInt)
  5203  		ptr := v_0.Args[0]
  5204  		mem := v_1
  5205  		if !(is32Bit(int64(off1)+off2) && (ptr.Op != OpSB || !config.ctxt.Flag_dynlink)) {
  5206  			break
  5207  		}
  5208  		v.reset(OpARM64FMOVSload)
  5209  		v.AuxInt = int32ToAuxInt(off1 + int32(off2))
  5210  		v.Aux = symToAux(sym)
  5211  		v.AddArg2(ptr, mem)
  5212  		return true
  5213  	}
  5214  	// match: (FMOVSload [off] {sym} (ADD ptr idx) mem)
  5215  	// cond: off == 0 && sym == nil
  5216  	// result: (FMOVSloadidx ptr idx mem)
  5217  	for {
  5218  		off := auxIntToInt32(v.AuxInt)
  5219  		sym := auxToSym(v.Aux)
  5220  		if v_0.Op != OpARM64ADD {
  5221  			break
  5222  		}
  5223  		idx := v_0.Args[1]
  5224  		ptr := v_0.Args[0]
  5225  		mem := v_1
  5226  		if !(off == 0 && sym == nil) {
  5227  			break
  5228  		}
  5229  		v.reset(OpARM64FMOVSloadidx)
  5230  		v.AddArg3(ptr, idx, mem)
  5231  		return true
  5232  	}
  5233  	// match: (FMOVSload [off] {sym} (ADDshiftLL [2] ptr idx) mem)
  5234  	// cond: off == 0 && sym == nil
  5235  	// result: (FMOVSloadidx4 ptr idx mem)
  5236  	for {
  5237  		off := auxIntToInt32(v.AuxInt)
  5238  		sym := auxToSym(v.Aux)
  5239  		if v_0.Op != OpARM64ADDshiftLL || auxIntToInt64(v_0.AuxInt) != 2 {
  5240  			break
  5241  		}
  5242  		idx := v_0.Args[1]
  5243  		ptr := v_0.Args[0]
  5244  		mem := v_1
  5245  		if !(off == 0 && sym == nil) {
  5246  			break
  5247  		}
  5248  		v.reset(OpARM64FMOVSloadidx4)
  5249  		v.AddArg3(ptr, idx, mem)
  5250  		return true
  5251  	}
  5252  	// match: (FMOVSload [off1] {sym1} (MOVDaddr [off2] {sym2} ptr) mem)
  5253  	// cond: canMergeSym(sym1,sym2) && is32Bit(int64(off1)+int64(off2)) && (ptr.Op != OpSB || !config.ctxt.Flag_dynlink)
  5254  	// result: (FMOVSload [off1+off2] {mergeSym(sym1,sym2)} ptr mem)
  5255  	for {
  5256  		off1 := auxIntToInt32(v.AuxInt)
  5257  		sym1 := auxToSym(v.Aux)
  5258  		if v_0.Op != OpARM64MOVDaddr {
  5259  			break
  5260  		}
  5261  		off2 := auxIntToInt32(v_0.AuxInt)
  5262  		sym2 := auxToSym(v_0.Aux)
  5263  		ptr := v_0.Args[0]
  5264  		mem := v_1
  5265  		if !(canMergeSym(sym1, sym2) && is32Bit(int64(off1)+int64(off2)) && (ptr.Op != OpSB || !config.ctxt.Flag_dynlink)) {
  5266  			break
  5267  		}
  5268  		v.reset(OpARM64FMOVSload)
  5269  		v.AuxInt = int32ToAuxInt(off1 + off2)
  5270  		v.Aux = symToAux(mergeSym(sym1, sym2))
  5271  		v.AddArg2(ptr, mem)
  5272  		return true
  5273  	}
  5274  	return false
  5275  }
  5276  func rewriteValueARM64_OpARM64FMOVSloadidx(v *Value) bool {
  5277  	v_2 := v.Args[2]
  5278  	v_1 := v.Args[1]
  5279  	v_0 := v.Args[0]
  5280  	// match: (FMOVSloadidx ptr (MOVDconst [c]) mem)
  5281  	// cond: is32Bit(c)
  5282  	// result: (FMOVSload [int32(c)] ptr mem)
  5283  	for {
  5284  		ptr := v_0
  5285  		if v_1.Op != OpARM64MOVDconst {
  5286  			break
  5287  		}
  5288  		c := auxIntToInt64(v_1.AuxInt)
  5289  		mem := v_2
  5290  		if !(is32Bit(c)) {
  5291  			break
  5292  		}
  5293  		v.reset(OpARM64FMOVSload)
  5294  		v.AuxInt = int32ToAuxInt(int32(c))
  5295  		v.AddArg2(ptr, mem)
  5296  		return true
  5297  	}
  5298  	// match: (FMOVSloadidx (MOVDconst [c]) ptr mem)
  5299  	// cond: is32Bit(c)
  5300  	// result: (FMOVSload [int32(c)] ptr mem)
  5301  	for {
  5302  		if v_0.Op != OpARM64MOVDconst {
  5303  			break
  5304  		}
  5305  		c := auxIntToInt64(v_0.AuxInt)
  5306  		ptr := v_1
  5307  		mem := v_2
  5308  		if !(is32Bit(c)) {
  5309  			break
  5310  		}
  5311  		v.reset(OpARM64FMOVSload)
  5312  		v.AuxInt = int32ToAuxInt(int32(c))
  5313  		v.AddArg2(ptr, mem)
  5314  		return true
  5315  	}
  5316  	// match: (FMOVSloadidx ptr (SLLconst [2] idx) mem)
  5317  	// result: (FMOVSloadidx4 ptr idx mem)
  5318  	for {
  5319  		ptr := v_0
  5320  		if v_1.Op != OpARM64SLLconst || auxIntToInt64(v_1.AuxInt) != 2 {
  5321  			break
  5322  		}
  5323  		idx := v_1.Args[0]
  5324  		mem := v_2
  5325  		v.reset(OpARM64FMOVSloadidx4)
  5326  		v.AddArg3(ptr, idx, mem)
  5327  		return true
  5328  	}
  5329  	// match: (FMOVSloadidx (SLLconst [2] idx) ptr mem)
  5330  	// result: (FMOVSloadidx4 ptr idx mem)
  5331  	for {
  5332  		if v_0.Op != OpARM64SLLconst || auxIntToInt64(v_0.AuxInt) != 2 {
  5333  			break
  5334  		}
  5335  		idx := v_0.Args[0]
  5336  		ptr := v_1
  5337  		mem := v_2
  5338  		v.reset(OpARM64FMOVSloadidx4)
  5339  		v.AddArg3(ptr, idx, mem)
  5340  		return true
  5341  	}
  5342  	return false
  5343  }
  5344  func rewriteValueARM64_OpARM64FMOVSloadidx4(v *Value) bool {
  5345  	v_2 := v.Args[2]
  5346  	v_1 := v.Args[1]
  5347  	v_0 := v.Args[0]
  5348  	// match: (FMOVSloadidx4 ptr (MOVDconst [c]) mem)
  5349  	// cond: is32Bit(c<<2)
  5350  	// result: (FMOVSload ptr [int32(c)<<2] mem)
  5351  	for {
  5352  		ptr := v_0
  5353  		if v_1.Op != OpARM64MOVDconst {
  5354  			break
  5355  		}
  5356  		c := auxIntToInt64(v_1.AuxInt)
  5357  		mem := v_2
  5358  		if !(is32Bit(c << 2)) {
  5359  			break
  5360  		}
  5361  		v.reset(OpARM64FMOVSload)
  5362  		v.AuxInt = int32ToAuxInt(int32(c) << 2)
  5363  		v.AddArg2(ptr, mem)
  5364  		return true
  5365  	}
  5366  	return false
  5367  }
  5368  func rewriteValueARM64_OpARM64FMOVSstore(v *Value) bool {
  5369  	v_2 := v.Args[2]
  5370  	v_1 := v.Args[1]
  5371  	v_0 := v.Args[0]
  5372  	b := v.Block
  5373  	config := b.Func.Config
  5374  	// match: (FMOVSstore [off] {sym} ptr (FMOVSgpfp val) mem)
  5375  	// result: (MOVWstore [off] {sym} ptr val mem)
  5376  	for {
  5377  		off := auxIntToInt32(v.AuxInt)
  5378  		sym := auxToSym(v.Aux)
  5379  		ptr := v_0
  5380  		if v_1.Op != OpARM64FMOVSgpfp {
  5381  			break
  5382  		}
  5383  		val := v_1.Args[0]
  5384  		mem := v_2
  5385  		v.reset(OpARM64MOVWstore)
  5386  		v.AuxInt = int32ToAuxInt(off)
  5387  		v.Aux = symToAux(sym)
  5388  		v.AddArg3(ptr, val, mem)
  5389  		return true
  5390  	}
  5391  	// match: (FMOVSstore [off1] {sym} (ADDconst [off2] ptr) val mem)
  5392  	// cond: is32Bit(int64(off1)+off2) && (ptr.Op != OpSB || !config.ctxt.Flag_dynlink)
  5393  	// result: (FMOVSstore [off1+int32(off2)] {sym} ptr val mem)
  5394  	for {
  5395  		off1 := auxIntToInt32(v.AuxInt)
  5396  		sym := auxToSym(v.Aux)
  5397  		if v_0.Op != OpARM64ADDconst {
  5398  			break
  5399  		}
  5400  		off2 := auxIntToInt64(v_0.AuxInt)
  5401  		ptr := v_0.Args[0]
  5402  		val := v_1
  5403  		mem := v_2
  5404  		if !(is32Bit(int64(off1)+off2) && (ptr.Op != OpSB || !config.ctxt.Flag_dynlink)) {
  5405  			break
  5406  		}
  5407  		v.reset(OpARM64FMOVSstore)
  5408  		v.AuxInt = int32ToAuxInt(off1 + int32(off2))
  5409  		v.Aux = symToAux(sym)
  5410  		v.AddArg3(ptr, val, mem)
  5411  		return true
  5412  	}
  5413  	// match: (FMOVSstore [off] {sym} (ADD ptr idx) val mem)
  5414  	// cond: off == 0 && sym == nil
  5415  	// result: (FMOVSstoreidx ptr idx val mem)
  5416  	for {
  5417  		off := auxIntToInt32(v.AuxInt)
  5418  		sym := auxToSym(v.Aux)
  5419  		if v_0.Op != OpARM64ADD {
  5420  			break
  5421  		}
  5422  		idx := v_0.Args[1]
  5423  		ptr := v_0.Args[0]
  5424  		val := v_1
  5425  		mem := v_2
  5426  		if !(off == 0 && sym == nil) {
  5427  			break
  5428  		}
  5429  		v.reset(OpARM64FMOVSstoreidx)
  5430  		v.AddArg4(ptr, idx, val, mem)
  5431  		return true
  5432  	}
  5433  	// match: (FMOVSstore [off] {sym} (ADDshiftLL [2] ptr idx) val mem)
  5434  	// cond: off == 0 && sym == nil
  5435  	// result: (FMOVSstoreidx4 ptr idx val mem)
  5436  	for {
  5437  		off := auxIntToInt32(v.AuxInt)
  5438  		sym := auxToSym(v.Aux)
  5439  		if v_0.Op != OpARM64ADDshiftLL || auxIntToInt64(v_0.AuxInt) != 2 {
  5440  			break
  5441  		}
  5442  		idx := v_0.Args[1]
  5443  		ptr := v_0.Args[0]
  5444  		val := v_1
  5445  		mem := v_2
  5446  		if !(off == 0 && sym == nil) {
  5447  			break
  5448  		}
  5449  		v.reset(OpARM64FMOVSstoreidx4)
  5450  		v.AddArg4(ptr, idx, val, mem)
  5451  		return true
  5452  	}
  5453  	// match: (FMOVSstore [off1] {sym1} (MOVDaddr [off2] {sym2} ptr) val mem)
  5454  	// cond: canMergeSym(sym1,sym2) && is32Bit(int64(off1)+int64(off2)) && (ptr.Op != OpSB || !config.ctxt.Flag_dynlink)
  5455  	// result: (FMOVSstore [off1+off2] {mergeSym(sym1,sym2)} ptr val mem)
  5456  	for {
  5457  		off1 := auxIntToInt32(v.AuxInt)
  5458  		sym1 := auxToSym(v.Aux)
  5459  		if v_0.Op != OpARM64MOVDaddr {
  5460  			break
  5461  		}
  5462  		off2 := auxIntToInt32(v_0.AuxInt)
  5463  		sym2 := auxToSym(v_0.Aux)
  5464  		ptr := v_0.Args[0]
  5465  		val := v_1
  5466  		mem := v_2
  5467  		if !(canMergeSym(sym1, sym2) && is32Bit(int64(off1)+int64(off2)) && (ptr.Op != OpSB || !config.ctxt.Flag_dynlink)) {
  5468  			break
  5469  		}
  5470  		v.reset(OpARM64FMOVSstore)
  5471  		v.AuxInt = int32ToAuxInt(off1 + off2)
  5472  		v.Aux = symToAux(mergeSym(sym1, sym2))
  5473  		v.AddArg3(ptr, val, mem)
  5474  		return true
  5475  	}
  5476  	return false
  5477  }
  5478  func rewriteValueARM64_OpARM64FMOVSstoreidx(v *Value) bool {
  5479  	v_3 := v.Args[3]
  5480  	v_2 := v.Args[2]
  5481  	v_1 := v.Args[1]
  5482  	v_0 := v.Args[0]
  5483  	// match: (FMOVSstoreidx ptr (MOVDconst [c]) val mem)
  5484  	// cond: is32Bit(c)
  5485  	// result: (FMOVSstore [int32(c)] ptr val mem)
  5486  	for {
  5487  		ptr := v_0
  5488  		if v_1.Op != OpARM64MOVDconst {
  5489  			break
  5490  		}
  5491  		c := auxIntToInt64(v_1.AuxInt)
  5492  		val := v_2
  5493  		mem := v_3
  5494  		if !(is32Bit(c)) {
  5495  			break
  5496  		}
  5497  		v.reset(OpARM64FMOVSstore)
  5498  		v.AuxInt = int32ToAuxInt(int32(c))
  5499  		v.AddArg3(ptr, val, mem)
  5500  		return true
  5501  	}
  5502  	// match: (FMOVSstoreidx (MOVDconst [c]) idx val mem)
  5503  	// cond: is32Bit(c)
  5504  	// result: (FMOVSstore [int32(c)] idx val mem)
  5505  	for {
  5506  		if v_0.Op != OpARM64MOVDconst {
  5507  			break
  5508  		}
  5509  		c := auxIntToInt64(v_0.AuxInt)
  5510  		idx := v_1
  5511  		val := v_2
  5512  		mem := v_3
  5513  		if !(is32Bit(c)) {
  5514  			break
  5515  		}
  5516  		v.reset(OpARM64FMOVSstore)
  5517  		v.AuxInt = int32ToAuxInt(int32(c))
  5518  		v.AddArg3(idx, val, mem)
  5519  		return true
  5520  	}
  5521  	// match: (FMOVSstoreidx ptr (SLLconst [2] idx) val mem)
  5522  	// result: (FMOVSstoreidx4 ptr idx val mem)
  5523  	for {
  5524  		ptr := v_0
  5525  		if v_1.Op != OpARM64SLLconst || auxIntToInt64(v_1.AuxInt) != 2 {
  5526  			break
  5527  		}
  5528  		idx := v_1.Args[0]
  5529  		val := v_2
  5530  		mem := v_3
  5531  		v.reset(OpARM64FMOVSstoreidx4)
  5532  		v.AddArg4(ptr, idx, val, mem)
  5533  		return true
  5534  	}
  5535  	// match: (FMOVSstoreidx (SLLconst [2] idx) ptr val mem)
  5536  	// result: (FMOVSstoreidx4 ptr idx val mem)
  5537  	for {
  5538  		if v_0.Op != OpARM64SLLconst || auxIntToInt64(v_0.AuxInt) != 2 {
  5539  			break
  5540  		}
  5541  		idx := v_0.Args[0]
  5542  		ptr := v_1
  5543  		val := v_2
  5544  		mem := v_3
  5545  		v.reset(OpARM64FMOVSstoreidx4)
  5546  		v.AddArg4(ptr, idx, val, mem)
  5547  		return true
  5548  	}
  5549  	return false
  5550  }
  5551  func rewriteValueARM64_OpARM64FMOVSstoreidx4(v *Value) bool {
  5552  	v_3 := v.Args[3]
  5553  	v_2 := v.Args[2]
  5554  	v_1 := v.Args[1]
  5555  	v_0 := v.Args[0]
  5556  	// match: (FMOVSstoreidx4 ptr (MOVDconst [c]) val mem)
  5557  	// cond: is32Bit(c<<2)
  5558  	// result: (FMOVSstore [int32(c)<<2] ptr val mem)
  5559  	for {
  5560  		ptr := v_0
  5561  		if v_1.Op != OpARM64MOVDconst {
  5562  			break
  5563  		}
  5564  		c := auxIntToInt64(v_1.AuxInt)
  5565  		val := v_2
  5566  		mem := v_3
  5567  		if !(is32Bit(c << 2)) {
  5568  			break
  5569  		}
  5570  		v.reset(OpARM64FMOVSstore)
  5571  		v.AuxInt = int32ToAuxInt(int32(c) << 2)
  5572  		v.AddArg3(ptr, val, mem)
  5573  		return true
  5574  	}
  5575  	return false
  5576  }
  5577  func rewriteValueARM64_OpARM64FMULD(v *Value) bool {
  5578  	v_1 := v.Args[1]
  5579  	v_0 := v.Args[0]
  5580  	// match: (FMULD (FNEGD x) y)
  5581  	// result: (FNMULD x y)
  5582  	for {
  5583  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
  5584  			if v_0.Op != OpARM64FNEGD {
  5585  				continue
  5586  			}
  5587  			x := v_0.Args[0]
  5588  			y := v_1
  5589  			v.reset(OpARM64FNMULD)
  5590  			v.AddArg2(x, y)
  5591  			return true
  5592  		}
  5593  		break
  5594  	}
  5595  	return false
  5596  }
  5597  func rewriteValueARM64_OpARM64FMULS(v *Value) bool {
  5598  	v_1 := v.Args[1]
  5599  	v_0 := v.Args[0]
  5600  	// match: (FMULS (FNEGS x) y)
  5601  	// result: (FNMULS x y)
  5602  	for {
  5603  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
  5604  			if v_0.Op != OpARM64FNEGS {
  5605  				continue
  5606  			}
  5607  			x := v_0.Args[0]
  5608  			y := v_1
  5609  			v.reset(OpARM64FNMULS)
  5610  			v.AddArg2(x, y)
  5611  			return true
  5612  		}
  5613  		break
  5614  	}
  5615  	return false
  5616  }
  5617  func rewriteValueARM64_OpARM64FNEGD(v *Value) bool {
  5618  	v_0 := v.Args[0]
  5619  	// match: (FNEGD (FMULD x y))
  5620  	// result: (FNMULD x y)
  5621  	for {
  5622  		if v_0.Op != OpARM64FMULD {
  5623  			break
  5624  		}
  5625  		y := v_0.Args[1]
  5626  		x := v_0.Args[0]
  5627  		v.reset(OpARM64FNMULD)
  5628  		v.AddArg2(x, y)
  5629  		return true
  5630  	}
  5631  	// match: (FNEGD (FNMULD x y))
  5632  	// result: (FMULD x y)
  5633  	for {
  5634  		if v_0.Op != OpARM64FNMULD {
  5635  			break
  5636  		}
  5637  		y := v_0.Args[1]
  5638  		x := v_0.Args[0]
  5639  		v.reset(OpARM64FMULD)
  5640  		v.AddArg2(x, y)
  5641  		return true
  5642  	}
  5643  	return false
  5644  }
  5645  func rewriteValueARM64_OpARM64FNEGS(v *Value) bool {
  5646  	v_0 := v.Args[0]
  5647  	// match: (FNEGS (FMULS x y))
  5648  	// result: (FNMULS x y)
  5649  	for {
  5650  		if v_0.Op != OpARM64FMULS {
  5651  			break
  5652  		}
  5653  		y := v_0.Args[1]
  5654  		x := v_0.Args[0]
  5655  		v.reset(OpARM64FNMULS)
  5656  		v.AddArg2(x, y)
  5657  		return true
  5658  	}
  5659  	// match: (FNEGS (FNMULS x y))
  5660  	// result: (FMULS x y)
  5661  	for {
  5662  		if v_0.Op != OpARM64FNMULS {
  5663  			break
  5664  		}
  5665  		y := v_0.Args[1]
  5666  		x := v_0.Args[0]
  5667  		v.reset(OpARM64FMULS)
  5668  		v.AddArg2(x, y)
  5669  		return true
  5670  	}
  5671  	return false
  5672  }
  5673  func rewriteValueARM64_OpARM64FNMULD(v *Value) bool {
  5674  	v_1 := v.Args[1]
  5675  	v_0 := v.Args[0]
  5676  	// match: (FNMULD (FNEGD x) y)
  5677  	// result: (FMULD x y)
  5678  	for {
  5679  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
  5680  			if v_0.Op != OpARM64FNEGD {
  5681  				continue
  5682  			}
  5683  			x := v_0.Args[0]
  5684  			y := v_1
  5685  			v.reset(OpARM64FMULD)
  5686  			v.AddArg2(x, y)
  5687  			return true
  5688  		}
  5689  		break
  5690  	}
  5691  	return false
  5692  }
  5693  func rewriteValueARM64_OpARM64FNMULS(v *Value) bool {
  5694  	v_1 := v.Args[1]
  5695  	v_0 := v.Args[0]
  5696  	// match: (FNMULS (FNEGS x) y)
  5697  	// result: (FMULS x y)
  5698  	for {
  5699  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
  5700  			if v_0.Op != OpARM64FNEGS {
  5701  				continue
  5702  			}
  5703  			x := v_0.Args[0]
  5704  			y := v_1
  5705  			v.reset(OpARM64FMULS)
  5706  			v.AddArg2(x, y)
  5707  			return true
  5708  		}
  5709  		break
  5710  	}
  5711  	return false
  5712  }
  5713  func rewriteValueARM64_OpARM64FSUBD(v *Value) bool {
  5714  	v_1 := v.Args[1]
  5715  	v_0 := v.Args[0]
  5716  	// match: (FSUBD a (FMULD x y))
  5717  	// cond: a.Block.Func.useFMA(v)
  5718  	// result: (FMSUBD a x y)
  5719  	for {
  5720  		a := v_0
  5721  		if v_1.Op != OpARM64FMULD {
  5722  			break
  5723  		}
  5724  		y := v_1.Args[1]
  5725  		x := v_1.Args[0]
  5726  		if !(a.Block.Func.useFMA(v)) {
  5727  			break
  5728  		}
  5729  		v.reset(OpARM64FMSUBD)
  5730  		v.AddArg3(a, x, y)
  5731  		return true
  5732  	}
  5733  	// match: (FSUBD (FMULD x y) a)
  5734  	// cond: a.Block.Func.useFMA(v)
  5735  	// result: (FNMSUBD a x y)
  5736  	for {
  5737  		if v_0.Op != OpARM64FMULD {
  5738  			break
  5739  		}
  5740  		y := v_0.Args[1]
  5741  		x := v_0.Args[0]
  5742  		a := v_1
  5743  		if !(a.Block.Func.useFMA(v)) {
  5744  			break
  5745  		}
  5746  		v.reset(OpARM64FNMSUBD)
  5747  		v.AddArg3(a, x, y)
  5748  		return true
  5749  	}
  5750  	// match: (FSUBD a (FNMULD x y))
  5751  	// cond: a.Block.Func.useFMA(v)
  5752  	// result: (FMADDD a x y)
  5753  	for {
  5754  		a := v_0
  5755  		if v_1.Op != OpARM64FNMULD {
  5756  			break
  5757  		}
  5758  		y := v_1.Args[1]
  5759  		x := v_1.Args[0]
  5760  		if !(a.Block.Func.useFMA(v)) {
  5761  			break
  5762  		}
  5763  		v.reset(OpARM64FMADDD)
  5764  		v.AddArg3(a, x, y)
  5765  		return true
  5766  	}
  5767  	// match: (FSUBD (FNMULD x y) a)
  5768  	// cond: a.Block.Func.useFMA(v)
  5769  	// result: (FNMADDD a x y)
  5770  	for {
  5771  		if v_0.Op != OpARM64FNMULD {
  5772  			break
  5773  		}
  5774  		y := v_0.Args[1]
  5775  		x := v_0.Args[0]
  5776  		a := v_1
  5777  		if !(a.Block.Func.useFMA(v)) {
  5778  			break
  5779  		}
  5780  		v.reset(OpARM64FNMADDD)
  5781  		v.AddArg3(a, x, y)
  5782  		return true
  5783  	}
  5784  	return false
  5785  }
  5786  func rewriteValueARM64_OpARM64FSUBS(v *Value) bool {
  5787  	v_1 := v.Args[1]
  5788  	v_0 := v.Args[0]
  5789  	// match: (FSUBS a (FMULS x y))
  5790  	// cond: a.Block.Func.useFMA(v)
  5791  	// result: (FMSUBS a x y)
  5792  	for {
  5793  		a := v_0
  5794  		if v_1.Op != OpARM64FMULS {
  5795  			break
  5796  		}
  5797  		y := v_1.Args[1]
  5798  		x := v_1.Args[0]
  5799  		if !(a.Block.Func.useFMA(v)) {
  5800  			break
  5801  		}
  5802  		v.reset(OpARM64FMSUBS)
  5803  		v.AddArg3(a, x, y)
  5804  		return true
  5805  	}
  5806  	// match: (FSUBS (FMULS x y) a)
  5807  	// cond: a.Block.Func.useFMA(v)
  5808  	// result: (FNMSUBS a x y)
  5809  	for {
  5810  		if v_0.Op != OpARM64FMULS {
  5811  			break
  5812  		}
  5813  		y := v_0.Args[1]
  5814  		x := v_0.Args[0]
  5815  		a := v_1
  5816  		if !(a.Block.Func.useFMA(v)) {
  5817  			break
  5818  		}
  5819  		v.reset(OpARM64FNMSUBS)
  5820  		v.AddArg3(a, x, y)
  5821  		return true
  5822  	}
  5823  	// match: (FSUBS a (FNMULS x y))
  5824  	// cond: a.Block.Func.useFMA(v)
  5825  	// result: (FMADDS a x y)
  5826  	for {
  5827  		a := v_0
  5828  		if v_1.Op != OpARM64FNMULS {
  5829  			break
  5830  		}
  5831  		y := v_1.Args[1]
  5832  		x := v_1.Args[0]
  5833  		if !(a.Block.Func.useFMA(v)) {
  5834  			break
  5835  		}
  5836  		v.reset(OpARM64FMADDS)
  5837  		v.AddArg3(a, x, y)
  5838  		return true
  5839  	}
  5840  	// match: (FSUBS (FNMULS x y) a)
  5841  	// cond: a.Block.Func.useFMA(v)
  5842  	// result: (FNMADDS a x y)
  5843  	for {
  5844  		if v_0.Op != OpARM64FNMULS {
  5845  			break
  5846  		}
  5847  		y := v_0.Args[1]
  5848  		x := v_0.Args[0]
  5849  		a := v_1
  5850  		if !(a.Block.Func.useFMA(v)) {
  5851  			break
  5852  		}
  5853  		v.reset(OpARM64FNMADDS)
  5854  		v.AddArg3(a, x, y)
  5855  		return true
  5856  	}
  5857  	return false
  5858  }
  5859  func rewriteValueARM64_OpARM64GreaterEqual(v *Value) bool {
  5860  	v_0 := v.Args[0]
  5861  	b := v.Block
  5862  	// match: (GreaterEqual (CMPconst [0] z:(AND x y)))
  5863  	// cond: z.Uses == 1
  5864  	// result: (GreaterEqual (TST x y))
  5865  	for {
  5866  		if v_0.Op != OpARM64CMPconst || auxIntToInt64(v_0.AuxInt) != 0 {
  5867  			break
  5868  		}
  5869  		z := v_0.Args[0]
  5870  		if z.Op != OpARM64AND {
  5871  			break
  5872  		}
  5873  		y := z.Args[1]
  5874  		x := z.Args[0]
  5875  		if !(z.Uses == 1) {
  5876  			break
  5877  		}
  5878  		v.reset(OpARM64GreaterEqual)
  5879  		v0 := b.NewValue0(v.Pos, OpARM64TST, types.TypeFlags)
  5880  		v0.AddArg2(x, y)
  5881  		v.AddArg(v0)
  5882  		return true
  5883  	}
  5884  	// match: (GreaterEqual (CMPWconst [0] x:(ANDconst [c] y)))
  5885  	// cond: x.Uses == 1
  5886  	// result: (GreaterEqual (TSTWconst [int32(c)] y))
  5887  	for {
  5888  		if v_0.Op != OpARM64CMPWconst || auxIntToInt32(v_0.AuxInt) != 0 {
  5889  			break
  5890  		}
  5891  		x := v_0.Args[0]
  5892  		if x.Op != OpARM64ANDconst {
  5893  			break
  5894  		}
  5895  		c := auxIntToInt64(x.AuxInt)
  5896  		y := x.Args[0]
  5897  		if !(x.Uses == 1) {
  5898  			break
  5899  		}
  5900  		v.reset(OpARM64GreaterEqual)
  5901  		v0 := b.NewValue0(v.Pos, OpARM64TSTWconst, types.TypeFlags)
  5902  		v0.AuxInt = int32ToAuxInt(int32(c))
  5903  		v0.AddArg(y)
  5904  		v.AddArg(v0)
  5905  		return true
  5906  	}
  5907  	// match: (GreaterEqual (CMPWconst [0] z:(AND x y)))
  5908  	// cond: z.Uses == 1
  5909  	// result: (GreaterEqual (TSTW x y))
  5910  	for {
  5911  		if v_0.Op != OpARM64CMPWconst || auxIntToInt32(v_0.AuxInt) != 0 {
  5912  			break
  5913  		}
  5914  		z := v_0.Args[0]
  5915  		if z.Op != OpARM64AND {
  5916  			break
  5917  		}
  5918  		y := z.Args[1]
  5919  		x := z.Args[0]
  5920  		if !(z.Uses == 1) {
  5921  			break
  5922  		}
  5923  		v.reset(OpARM64GreaterEqual)
  5924  		v0 := b.NewValue0(v.Pos, OpARM64TSTW, types.TypeFlags)
  5925  		v0.AddArg2(x, y)
  5926  		v.AddArg(v0)
  5927  		return true
  5928  	}
  5929  	// match: (GreaterEqual (CMPconst [0] x:(ANDconst [c] y)))
  5930  	// cond: x.Uses == 1
  5931  	// result: (GreaterEqual (TSTconst [c] y))
  5932  	for {
  5933  		if v_0.Op != OpARM64CMPconst || auxIntToInt64(v_0.AuxInt) != 0 {
  5934  			break
  5935  		}
  5936  		x := v_0.Args[0]
  5937  		if x.Op != OpARM64ANDconst {
  5938  			break
  5939  		}
  5940  		c := auxIntToInt64(x.AuxInt)
  5941  		y := x.Args[0]
  5942  		if !(x.Uses == 1) {
  5943  			break
  5944  		}
  5945  		v.reset(OpARM64GreaterEqual)
  5946  		v0 := b.NewValue0(v.Pos, OpARM64TSTconst, types.TypeFlags)
  5947  		v0.AuxInt = int64ToAuxInt(c)
  5948  		v0.AddArg(y)
  5949  		v.AddArg(v0)
  5950  		return true
  5951  	}
  5952  	// match: (GreaterEqual (CMPconst [0] x:(ADDconst [c] y)))
  5953  	// cond: x.Uses == 1
  5954  	// result: (GreaterEqualNoov (CMNconst [c] y))
  5955  	for {
  5956  		if v_0.Op != OpARM64CMPconst || auxIntToInt64(v_0.AuxInt) != 0 {
  5957  			break
  5958  		}
  5959  		x := v_0.Args[0]
  5960  		if x.Op != OpARM64ADDconst {
  5961  			break
  5962  		}
  5963  		c := auxIntToInt64(x.AuxInt)
  5964  		y := x.Args[0]
  5965  		if !(x.Uses == 1) {
  5966  			break
  5967  		}
  5968  		v.reset(OpARM64GreaterEqualNoov)
  5969  		v0 := b.NewValue0(v.Pos, OpARM64CMNconst, types.TypeFlags)
  5970  		v0.AuxInt = int64ToAuxInt(c)
  5971  		v0.AddArg(y)
  5972  		v.AddArg(v0)
  5973  		return true
  5974  	}
  5975  	// match: (GreaterEqual (CMPWconst [0] x:(ADDconst [c] y)))
  5976  	// cond: x.Uses == 1
  5977  	// result: (GreaterEqualNoov (CMNWconst [int32(c)] y))
  5978  	for {
  5979  		if v_0.Op != OpARM64CMPWconst || auxIntToInt32(v_0.AuxInt) != 0 {
  5980  			break
  5981  		}
  5982  		x := v_0.Args[0]
  5983  		if x.Op != OpARM64ADDconst {
  5984  			break
  5985  		}
  5986  		c := auxIntToInt64(x.AuxInt)
  5987  		y := x.Args[0]
  5988  		if !(x.Uses == 1) {
  5989  			break
  5990  		}
  5991  		v.reset(OpARM64GreaterEqualNoov)
  5992  		v0 := b.NewValue0(v.Pos, OpARM64CMNWconst, types.TypeFlags)
  5993  		v0.AuxInt = int32ToAuxInt(int32(c))
  5994  		v0.AddArg(y)
  5995  		v.AddArg(v0)
  5996  		return true
  5997  	}
  5998  	// match: (GreaterEqual (CMPconst [0] z:(ADD x y)))
  5999  	// cond: z.Uses == 1
  6000  	// result: (GreaterEqualNoov (CMN x y))
  6001  	for {
  6002  		if v_0.Op != OpARM64CMPconst || auxIntToInt64(v_0.AuxInt) != 0 {
  6003  			break
  6004  		}
  6005  		z := v_0.Args[0]
  6006  		if z.Op != OpARM64ADD {
  6007  			break
  6008  		}
  6009  		y := z.Args[1]
  6010  		x := z.Args[0]
  6011  		if !(z.Uses == 1) {
  6012  			break
  6013  		}
  6014  		v.reset(OpARM64GreaterEqualNoov)
  6015  		v0 := b.NewValue0(v.Pos, OpARM64CMN, types.TypeFlags)
  6016  		v0.AddArg2(x, y)
  6017  		v.AddArg(v0)
  6018  		return true
  6019  	}
  6020  	// match: (GreaterEqual (CMPWconst [0] z:(ADD x y)))
  6021  	// cond: z.Uses == 1
  6022  	// result: (GreaterEqualNoov (CMNW x y))
  6023  	for {
  6024  		if v_0.Op != OpARM64CMPWconst || auxIntToInt32(v_0.AuxInt) != 0 {
  6025  			break
  6026  		}
  6027  		z := v_0.Args[0]
  6028  		if z.Op != OpARM64ADD {
  6029  			break
  6030  		}
  6031  		y := z.Args[1]
  6032  		x := z.Args[0]
  6033  		if !(z.Uses == 1) {
  6034  			break
  6035  		}
  6036  		v.reset(OpARM64GreaterEqualNoov)
  6037  		v0 := b.NewValue0(v.Pos, OpARM64CMNW, types.TypeFlags)
  6038  		v0.AddArg2(x, y)
  6039  		v.AddArg(v0)
  6040  		return true
  6041  	}
  6042  	// match: (GreaterEqual (CMPconst [0] z:(MADD a x y)))
  6043  	// cond: z.Uses == 1
  6044  	// result: (GreaterEqualNoov (CMN a (MUL <x.Type> x y)))
  6045  	for {
  6046  		if v_0.Op != OpARM64CMPconst || auxIntToInt64(v_0.AuxInt) != 0 {
  6047  			break
  6048  		}
  6049  		z := v_0.Args[0]
  6050  		if z.Op != OpARM64MADD {
  6051  			break
  6052  		}
  6053  		y := z.Args[2]
  6054  		a := z.Args[0]
  6055  		x := z.Args[1]
  6056  		if !(z.Uses == 1) {
  6057  			break
  6058  		}
  6059  		v.reset(OpARM64GreaterEqualNoov)
  6060  		v0 := b.NewValue0(v.Pos, OpARM64CMN, types.TypeFlags)
  6061  		v1 := b.NewValue0(v.Pos, OpARM64MUL, x.Type)
  6062  		v1.AddArg2(x, y)
  6063  		v0.AddArg2(a, v1)
  6064  		v.AddArg(v0)
  6065  		return true
  6066  	}
  6067  	// match: (GreaterEqual (CMPconst [0] z:(MSUB a x y)))
  6068  	// cond: z.Uses == 1
  6069  	// result: (GreaterEqualNoov (CMP a (MUL <x.Type> x y)))
  6070  	for {
  6071  		if v_0.Op != OpARM64CMPconst || auxIntToInt64(v_0.AuxInt) != 0 {
  6072  			break
  6073  		}
  6074  		z := v_0.Args[0]
  6075  		if z.Op != OpARM64MSUB {
  6076  			break
  6077  		}
  6078  		y := z.Args[2]
  6079  		a := z.Args[0]
  6080  		x := z.Args[1]
  6081  		if !(z.Uses == 1) {
  6082  			break
  6083  		}
  6084  		v.reset(OpARM64GreaterEqualNoov)
  6085  		v0 := b.NewValue0(v.Pos, OpARM64CMP, types.TypeFlags)
  6086  		v1 := b.NewValue0(v.Pos, OpARM64MUL, x.Type)
  6087  		v1.AddArg2(x, y)
  6088  		v0.AddArg2(a, v1)
  6089  		v.AddArg(v0)
  6090  		return true
  6091  	}
  6092  	// match: (GreaterEqual (CMPWconst [0] z:(MADDW a x y)))
  6093  	// cond: z.Uses == 1
  6094  	// result: (GreaterEqualNoov (CMNW a (MULW <x.Type> x y)))
  6095  	for {
  6096  		if v_0.Op != OpARM64CMPWconst || auxIntToInt32(v_0.AuxInt) != 0 {
  6097  			break
  6098  		}
  6099  		z := v_0.Args[0]
  6100  		if z.Op != OpARM64MADDW {
  6101  			break
  6102  		}
  6103  		y := z.Args[2]
  6104  		a := z.Args[0]
  6105  		x := z.Args[1]
  6106  		if !(z.Uses == 1) {
  6107  			break
  6108  		}
  6109  		v.reset(OpARM64GreaterEqualNoov)
  6110  		v0 := b.NewValue0(v.Pos, OpARM64CMNW, types.TypeFlags)
  6111  		v1 := b.NewValue0(v.Pos, OpARM64MULW, x.Type)
  6112  		v1.AddArg2(x, y)
  6113  		v0.AddArg2(a, v1)
  6114  		v.AddArg(v0)
  6115  		return true
  6116  	}
  6117  	// match: (GreaterEqual (CMPWconst [0] z:(MSUBW a x y)))
  6118  	// cond: z.Uses == 1
  6119  	// result: (GreaterEqualNoov (CMPW a (MULW <x.Type> x y)))
  6120  	for {
  6121  		if v_0.Op != OpARM64CMPWconst || auxIntToInt32(v_0.AuxInt) != 0 {
  6122  			break
  6123  		}
  6124  		z := v_0.Args[0]
  6125  		if z.Op != OpARM64MSUBW {
  6126  			break
  6127  		}
  6128  		y := z.Args[2]
  6129  		a := z.Args[0]
  6130  		x := z.Args[1]
  6131  		if !(z.Uses == 1) {
  6132  			break
  6133  		}
  6134  		v.reset(OpARM64GreaterEqualNoov)
  6135  		v0 := b.NewValue0(v.Pos, OpARM64CMPW, types.TypeFlags)
  6136  		v1 := b.NewValue0(v.Pos, OpARM64MULW, x.Type)
  6137  		v1.AddArg2(x, y)
  6138  		v0.AddArg2(a, v1)
  6139  		v.AddArg(v0)
  6140  		return true
  6141  	}
  6142  	// match: (GreaterEqual (FlagConstant [fc]))
  6143  	// result: (MOVDconst [b2i(fc.ge())])
  6144  	for {
  6145  		if v_0.Op != OpARM64FlagConstant {
  6146  			break
  6147  		}
  6148  		fc := auxIntToFlagConstant(v_0.AuxInt)
  6149  		v.reset(OpARM64MOVDconst)
  6150  		v.AuxInt = int64ToAuxInt(b2i(fc.ge()))
  6151  		return true
  6152  	}
  6153  	// match: (GreaterEqual (InvertFlags x))
  6154  	// result: (LessEqual x)
  6155  	for {
  6156  		if v_0.Op != OpARM64InvertFlags {
  6157  			break
  6158  		}
  6159  		x := v_0.Args[0]
  6160  		v.reset(OpARM64LessEqual)
  6161  		v.AddArg(x)
  6162  		return true
  6163  	}
  6164  	return false
  6165  }
  6166  func rewriteValueARM64_OpARM64GreaterEqualF(v *Value) bool {
  6167  	v_0 := v.Args[0]
  6168  	// match: (GreaterEqualF (InvertFlags x))
  6169  	// result: (LessEqualF x)
  6170  	for {
  6171  		if v_0.Op != OpARM64InvertFlags {
  6172  			break
  6173  		}
  6174  		x := v_0.Args[0]
  6175  		v.reset(OpARM64LessEqualF)
  6176  		v.AddArg(x)
  6177  		return true
  6178  	}
  6179  	return false
  6180  }
  6181  func rewriteValueARM64_OpARM64GreaterEqualNoov(v *Value) bool {
  6182  	v_0 := v.Args[0]
  6183  	b := v.Block
  6184  	typ := &b.Func.Config.Types
  6185  	// match: (GreaterEqualNoov (FlagConstant [fc]))
  6186  	// result: (MOVDconst [b2i(fc.geNoov())])
  6187  	for {
  6188  		if v_0.Op != OpARM64FlagConstant {
  6189  			break
  6190  		}
  6191  		fc := auxIntToFlagConstant(v_0.AuxInt)
  6192  		v.reset(OpARM64MOVDconst)
  6193  		v.AuxInt = int64ToAuxInt(b2i(fc.geNoov()))
  6194  		return true
  6195  	}
  6196  	// match: (GreaterEqualNoov (InvertFlags x))
  6197  	// result: (CSINC [OpARM64NotEqual] (LessThanNoov <typ.Bool> x) (MOVDconst [0]) x)
  6198  	for {
  6199  		if v_0.Op != OpARM64InvertFlags {
  6200  			break
  6201  		}
  6202  		x := v_0.Args[0]
  6203  		v.reset(OpARM64CSINC)
  6204  		v.AuxInt = opToAuxInt(OpARM64NotEqual)
  6205  		v0 := b.NewValue0(v.Pos, OpARM64LessThanNoov, typ.Bool)
  6206  		v0.AddArg(x)
  6207  		v1 := b.NewValue0(v.Pos, OpARM64MOVDconst, typ.UInt64)
  6208  		v1.AuxInt = int64ToAuxInt(0)
  6209  		v.AddArg3(v0, v1, x)
  6210  		return true
  6211  	}
  6212  	return false
  6213  }
  6214  func rewriteValueARM64_OpARM64GreaterEqualU(v *Value) bool {
  6215  	v_0 := v.Args[0]
  6216  	// match: (GreaterEqualU (FlagConstant [fc]))
  6217  	// result: (MOVDconst [b2i(fc.uge())])
  6218  	for {
  6219  		if v_0.Op != OpARM64FlagConstant {
  6220  			break
  6221  		}
  6222  		fc := auxIntToFlagConstant(v_0.AuxInt)
  6223  		v.reset(OpARM64MOVDconst)
  6224  		v.AuxInt = int64ToAuxInt(b2i(fc.uge()))
  6225  		return true
  6226  	}
  6227  	// match: (GreaterEqualU (InvertFlags x))
  6228  	// result: (LessEqualU x)
  6229  	for {
  6230  		if v_0.Op != OpARM64InvertFlags {
  6231  			break
  6232  		}
  6233  		x := v_0.Args[0]
  6234  		v.reset(OpARM64LessEqualU)
  6235  		v.AddArg(x)
  6236  		return true
  6237  	}
  6238  	return false
  6239  }
  6240  func rewriteValueARM64_OpARM64GreaterThan(v *Value) bool {
  6241  	v_0 := v.Args[0]
  6242  	b := v.Block
  6243  	// match: (GreaterThan (CMPconst [0] z:(AND x y)))
  6244  	// cond: z.Uses == 1
  6245  	// result: (GreaterThan (TST x y))
  6246  	for {
  6247  		if v_0.Op != OpARM64CMPconst || auxIntToInt64(v_0.AuxInt) != 0 {
  6248  			break
  6249  		}
  6250  		z := v_0.Args[0]
  6251  		if z.Op != OpARM64AND {
  6252  			break
  6253  		}
  6254  		y := z.Args[1]
  6255  		x := z.Args[0]
  6256  		if !(z.Uses == 1) {
  6257  			break
  6258  		}
  6259  		v.reset(OpARM64GreaterThan)
  6260  		v0 := b.NewValue0(v.Pos, OpARM64TST, types.TypeFlags)
  6261  		v0.AddArg2(x, y)
  6262  		v.AddArg(v0)
  6263  		return true
  6264  	}
  6265  	// match: (GreaterThan (CMPWconst [0] x:(ANDconst [c] y)))
  6266  	// cond: x.Uses == 1
  6267  	// result: (GreaterThan (TSTWconst [int32(c)] y))
  6268  	for {
  6269  		if v_0.Op != OpARM64CMPWconst || auxIntToInt32(v_0.AuxInt) != 0 {
  6270  			break
  6271  		}
  6272  		x := v_0.Args[0]
  6273  		if x.Op != OpARM64ANDconst {
  6274  			break
  6275  		}
  6276  		c := auxIntToInt64(x.AuxInt)
  6277  		y := x.Args[0]
  6278  		if !(x.Uses == 1) {
  6279  			break
  6280  		}
  6281  		v.reset(OpARM64GreaterThan)
  6282  		v0 := b.NewValue0(v.Pos, OpARM64TSTWconst, types.TypeFlags)
  6283  		v0.AuxInt = int32ToAuxInt(int32(c))
  6284  		v0.AddArg(y)
  6285  		v.AddArg(v0)
  6286  		return true
  6287  	}
  6288  	// match: (GreaterThan (CMPWconst [0] z:(AND x y)))
  6289  	// cond: z.Uses == 1
  6290  	// result: (GreaterThan (TSTW x y))
  6291  	for {
  6292  		if v_0.Op != OpARM64CMPWconst || auxIntToInt32(v_0.AuxInt) != 0 {
  6293  			break
  6294  		}
  6295  		z := v_0.Args[0]
  6296  		if z.Op != OpARM64AND {
  6297  			break
  6298  		}
  6299  		y := z.Args[1]
  6300  		x := z.Args[0]
  6301  		if !(z.Uses == 1) {
  6302  			break
  6303  		}
  6304  		v.reset(OpARM64GreaterThan)
  6305  		v0 := b.NewValue0(v.Pos, OpARM64TSTW, types.TypeFlags)
  6306  		v0.AddArg2(x, y)
  6307  		v.AddArg(v0)
  6308  		return true
  6309  	}
  6310  	// match: (GreaterThan (CMPconst [0] x:(ANDconst [c] y)))
  6311  	// cond: x.Uses == 1
  6312  	// result: (GreaterThan (TSTconst [c] y))
  6313  	for {
  6314  		if v_0.Op != OpARM64CMPconst || auxIntToInt64(v_0.AuxInt) != 0 {
  6315  			break
  6316  		}
  6317  		x := v_0.Args[0]
  6318  		if x.Op != OpARM64ANDconst {
  6319  			break
  6320  		}
  6321  		c := auxIntToInt64(x.AuxInt)
  6322  		y := x.Args[0]
  6323  		if !(x.Uses == 1) {
  6324  			break
  6325  		}
  6326  		v.reset(OpARM64GreaterThan)
  6327  		v0 := b.NewValue0(v.Pos, OpARM64TSTconst, types.TypeFlags)
  6328  		v0.AuxInt = int64ToAuxInt(c)
  6329  		v0.AddArg(y)
  6330  		v.AddArg(v0)
  6331  		return true
  6332  	}
  6333  	// match: (GreaterThan (FlagConstant [fc]))
  6334  	// result: (MOVDconst [b2i(fc.gt())])
  6335  	for {
  6336  		if v_0.Op != OpARM64FlagConstant {
  6337  			break
  6338  		}
  6339  		fc := auxIntToFlagConstant(v_0.AuxInt)
  6340  		v.reset(OpARM64MOVDconst)
  6341  		v.AuxInt = int64ToAuxInt(b2i(fc.gt()))
  6342  		return true
  6343  	}
  6344  	// match: (GreaterThan (InvertFlags x))
  6345  	// result: (LessThan x)
  6346  	for {
  6347  		if v_0.Op != OpARM64InvertFlags {
  6348  			break
  6349  		}
  6350  		x := v_0.Args[0]
  6351  		v.reset(OpARM64LessThan)
  6352  		v.AddArg(x)
  6353  		return true
  6354  	}
  6355  	return false
  6356  }
  6357  func rewriteValueARM64_OpARM64GreaterThanF(v *Value) bool {
  6358  	v_0 := v.Args[0]
  6359  	// match: (GreaterThanF (InvertFlags x))
  6360  	// result: (LessThanF x)
  6361  	for {
  6362  		if v_0.Op != OpARM64InvertFlags {
  6363  			break
  6364  		}
  6365  		x := v_0.Args[0]
  6366  		v.reset(OpARM64LessThanF)
  6367  		v.AddArg(x)
  6368  		return true
  6369  	}
  6370  	return false
  6371  }
  6372  func rewriteValueARM64_OpARM64GreaterThanU(v *Value) bool {
  6373  	v_0 := v.Args[0]
  6374  	// match: (GreaterThanU (FlagConstant [fc]))
  6375  	// result: (MOVDconst [b2i(fc.ugt())])
  6376  	for {
  6377  		if v_0.Op != OpARM64FlagConstant {
  6378  			break
  6379  		}
  6380  		fc := auxIntToFlagConstant(v_0.AuxInt)
  6381  		v.reset(OpARM64MOVDconst)
  6382  		v.AuxInt = int64ToAuxInt(b2i(fc.ugt()))
  6383  		return true
  6384  	}
  6385  	// match: (GreaterThanU (InvertFlags x))
  6386  	// result: (LessThanU x)
  6387  	for {
  6388  		if v_0.Op != OpARM64InvertFlags {
  6389  			break
  6390  		}
  6391  		x := v_0.Args[0]
  6392  		v.reset(OpARM64LessThanU)
  6393  		v.AddArg(x)
  6394  		return true
  6395  	}
  6396  	return false
  6397  }
  6398  func rewriteValueARM64_OpARM64LDP(v *Value) bool {
  6399  	v_1 := v.Args[1]
  6400  	v_0 := v.Args[0]
  6401  	b := v.Block
  6402  	config := b.Func.Config
  6403  	// match: (LDP [off1] {sym} (ADDconst [off2] ptr) mem)
  6404  	// cond: is32Bit(int64(off1)+off2) && (ptr.Op != OpSB || !config.ctxt.Flag_dynlink)
  6405  	// result: (LDP [off1+int32(off2)] {sym} ptr mem)
  6406  	for {
  6407  		off1 := auxIntToInt32(v.AuxInt)
  6408  		sym := auxToSym(v.Aux)
  6409  		if v_0.Op != OpARM64ADDconst {
  6410  			break
  6411  		}
  6412  		off2 := auxIntToInt64(v_0.AuxInt)
  6413  		ptr := v_0.Args[0]
  6414  		mem := v_1
  6415  		if !(is32Bit(int64(off1)+off2) && (ptr.Op != OpSB || !config.ctxt.Flag_dynlink)) {
  6416  			break
  6417  		}
  6418  		v.reset(OpARM64LDP)
  6419  		v.AuxInt = int32ToAuxInt(off1 + int32(off2))
  6420  		v.Aux = symToAux(sym)
  6421  		v.AddArg2(ptr, mem)
  6422  		return true
  6423  	}
  6424  	// match: (LDP [off1] {sym1} (MOVDaddr [off2] {sym2} ptr) mem)
  6425  	// cond: canMergeSym(sym1,sym2) && is32Bit(int64(off1)+int64(off2)) && (ptr.Op != OpSB || !config.ctxt.Flag_dynlink)
  6426  	// result: (LDP [off1+off2] {mergeSym(sym1,sym2)} ptr mem)
  6427  	for {
  6428  		off1 := auxIntToInt32(v.AuxInt)
  6429  		sym1 := auxToSym(v.Aux)
  6430  		if v_0.Op != OpARM64MOVDaddr {
  6431  			break
  6432  		}
  6433  		off2 := auxIntToInt32(v_0.AuxInt)
  6434  		sym2 := auxToSym(v_0.Aux)
  6435  		ptr := v_0.Args[0]
  6436  		mem := v_1
  6437  		if !(canMergeSym(sym1, sym2) && is32Bit(int64(off1)+int64(off2)) && (ptr.Op != OpSB || !config.ctxt.Flag_dynlink)) {
  6438  			break
  6439  		}
  6440  		v.reset(OpARM64LDP)
  6441  		v.AuxInt = int32ToAuxInt(off1 + off2)
  6442  		v.Aux = symToAux(mergeSym(sym1, sym2))
  6443  		v.AddArg2(ptr, mem)
  6444  		return true
  6445  	}
  6446  	return false
  6447  }
  6448  func rewriteValueARM64_OpARM64LessEqual(v *Value) bool {
  6449  	v_0 := v.Args[0]
  6450  	b := v.Block
  6451  	// match: (LessEqual (CMPconst [0] z:(AND x y)))
  6452  	// cond: z.Uses == 1
  6453  	// result: (LessEqual (TST x y))
  6454  	for {
  6455  		if v_0.Op != OpARM64CMPconst || auxIntToInt64(v_0.AuxInt) != 0 {
  6456  			break
  6457  		}
  6458  		z := v_0.Args[0]
  6459  		if z.Op != OpARM64AND {
  6460  			break
  6461  		}
  6462  		y := z.Args[1]
  6463  		x := z.Args[0]
  6464  		if !(z.Uses == 1) {
  6465  			break
  6466  		}
  6467  		v.reset(OpARM64LessEqual)
  6468  		v0 := b.NewValue0(v.Pos, OpARM64TST, types.TypeFlags)
  6469  		v0.AddArg2(x, y)
  6470  		v.AddArg(v0)
  6471  		return true
  6472  	}
  6473  	// match: (LessEqual (CMPWconst [0] x:(ANDconst [c] y)))
  6474  	// cond: x.Uses == 1
  6475  	// result: (LessEqual (TSTWconst [int32(c)] y))
  6476  	for {
  6477  		if v_0.Op != OpARM64CMPWconst || auxIntToInt32(v_0.AuxInt) != 0 {
  6478  			break
  6479  		}
  6480  		x := v_0.Args[0]
  6481  		if x.Op != OpARM64ANDconst {
  6482  			break
  6483  		}
  6484  		c := auxIntToInt64(x.AuxInt)
  6485  		y := x.Args[0]
  6486  		if !(x.Uses == 1) {
  6487  			break
  6488  		}
  6489  		v.reset(OpARM64LessEqual)
  6490  		v0 := b.NewValue0(v.Pos, OpARM64TSTWconst, types.TypeFlags)
  6491  		v0.AuxInt = int32ToAuxInt(int32(c))
  6492  		v0.AddArg(y)
  6493  		v.AddArg(v0)
  6494  		return true
  6495  	}
  6496  	// match: (LessEqual (CMPWconst [0] z:(AND x y)))
  6497  	// cond: z.Uses == 1
  6498  	// result: (LessEqual (TSTW x y))
  6499  	for {
  6500  		if v_0.Op != OpARM64CMPWconst || auxIntToInt32(v_0.AuxInt) != 0 {
  6501  			break
  6502  		}
  6503  		z := v_0.Args[0]
  6504  		if z.Op != OpARM64AND {
  6505  			break
  6506  		}
  6507  		y := z.Args[1]
  6508  		x := z.Args[0]
  6509  		if !(z.Uses == 1) {
  6510  			break
  6511  		}
  6512  		v.reset(OpARM64LessEqual)
  6513  		v0 := b.NewValue0(v.Pos, OpARM64TSTW, types.TypeFlags)
  6514  		v0.AddArg2(x, y)
  6515  		v.AddArg(v0)
  6516  		return true
  6517  	}
  6518  	// match: (LessEqual (CMPconst [0] x:(ANDconst [c] y)))
  6519  	// cond: x.Uses == 1
  6520  	// result: (LessEqual (TSTconst [c] y))
  6521  	for {
  6522  		if v_0.Op != OpARM64CMPconst || auxIntToInt64(v_0.AuxInt) != 0 {
  6523  			break
  6524  		}
  6525  		x := v_0.Args[0]
  6526  		if x.Op != OpARM64ANDconst {
  6527  			break
  6528  		}
  6529  		c := auxIntToInt64(x.AuxInt)
  6530  		y := x.Args[0]
  6531  		if !(x.Uses == 1) {
  6532  			break
  6533  		}
  6534  		v.reset(OpARM64LessEqual)
  6535  		v0 := b.NewValue0(v.Pos, OpARM64TSTconst, types.TypeFlags)
  6536  		v0.AuxInt = int64ToAuxInt(c)
  6537  		v0.AddArg(y)
  6538  		v.AddArg(v0)
  6539  		return true
  6540  	}
  6541  	// match: (LessEqual (FlagConstant [fc]))
  6542  	// result: (MOVDconst [b2i(fc.le())])
  6543  	for {
  6544  		if v_0.Op != OpARM64FlagConstant {
  6545  			break
  6546  		}
  6547  		fc := auxIntToFlagConstant(v_0.AuxInt)
  6548  		v.reset(OpARM64MOVDconst)
  6549  		v.AuxInt = int64ToAuxInt(b2i(fc.le()))
  6550  		return true
  6551  	}
  6552  	// match: (LessEqual (InvertFlags x))
  6553  	// result: (GreaterEqual x)
  6554  	for {
  6555  		if v_0.Op != OpARM64InvertFlags {
  6556  			break
  6557  		}
  6558  		x := v_0.Args[0]
  6559  		v.reset(OpARM64GreaterEqual)
  6560  		v.AddArg(x)
  6561  		return true
  6562  	}
  6563  	return false
  6564  }
  6565  func rewriteValueARM64_OpARM64LessEqualF(v *Value) bool {
  6566  	v_0 := v.Args[0]
  6567  	// match: (LessEqualF (InvertFlags x))
  6568  	// result: (GreaterEqualF x)
  6569  	for {
  6570  		if v_0.Op != OpARM64InvertFlags {
  6571  			break
  6572  		}
  6573  		x := v_0.Args[0]
  6574  		v.reset(OpARM64GreaterEqualF)
  6575  		v.AddArg(x)
  6576  		return true
  6577  	}
  6578  	return false
  6579  }
  6580  func rewriteValueARM64_OpARM64LessEqualU(v *Value) bool {
  6581  	v_0 := v.Args[0]
  6582  	// match: (LessEqualU (FlagConstant [fc]))
  6583  	// result: (MOVDconst [b2i(fc.ule())])
  6584  	for {
  6585  		if v_0.Op != OpARM64FlagConstant {
  6586  			break
  6587  		}
  6588  		fc := auxIntToFlagConstant(v_0.AuxInt)
  6589  		v.reset(OpARM64MOVDconst)
  6590  		v.AuxInt = int64ToAuxInt(b2i(fc.ule()))
  6591  		return true
  6592  	}
  6593  	// match: (LessEqualU (InvertFlags x))
  6594  	// result: (GreaterEqualU x)
  6595  	for {
  6596  		if v_0.Op != OpARM64InvertFlags {
  6597  			break
  6598  		}
  6599  		x := v_0.Args[0]
  6600  		v.reset(OpARM64GreaterEqualU)
  6601  		v.AddArg(x)
  6602  		return true
  6603  	}
  6604  	return false
  6605  }
  6606  func rewriteValueARM64_OpARM64LessThan(v *Value) bool {
  6607  	v_0 := v.Args[0]
  6608  	b := v.Block
  6609  	// match: (LessThan (CMPconst [0] z:(AND x y)))
  6610  	// cond: z.Uses == 1
  6611  	// result: (LessThan (TST x y))
  6612  	for {
  6613  		if v_0.Op != OpARM64CMPconst || auxIntToInt64(v_0.AuxInt) != 0 {
  6614  			break
  6615  		}
  6616  		z := v_0.Args[0]
  6617  		if z.Op != OpARM64AND {
  6618  			break
  6619  		}
  6620  		y := z.Args[1]
  6621  		x := z.Args[0]
  6622  		if !(z.Uses == 1) {
  6623  			break
  6624  		}
  6625  		v.reset(OpARM64LessThan)
  6626  		v0 := b.NewValue0(v.Pos, OpARM64TST, types.TypeFlags)
  6627  		v0.AddArg2(x, y)
  6628  		v.AddArg(v0)
  6629  		return true
  6630  	}
  6631  	// match: (LessThan (CMPWconst [0] x:(ANDconst [c] y)))
  6632  	// cond: x.Uses == 1
  6633  	// result: (LessThan (TSTWconst [int32(c)] y))
  6634  	for {
  6635  		if v_0.Op != OpARM64CMPWconst || auxIntToInt32(v_0.AuxInt) != 0 {
  6636  			break
  6637  		}
  6638  		x := v_0.Args[0]
  6639  		if x.Op != OpARM64ANDconst {
  6640  			break
  6641  		}
  6642  		c := auxIntToInt64(x.AuxInt)
  6643  		y := x.Args[0]
  6644  		if !(x.Uses == 1) {
  6645  			break
  6646  		}
  6647  		v.reset(OpARM64LessThan)
  6648  		v0 := b.NewValue0(v.Pos, OpARM64TSTWconst, types.TypeFlags)
  6649  		v0.AuxInt = int32ToAuxInt(int32(c))
  6650  		v0.AddArg(y)
  6651  		v.AddArg(v0)
  6652  		return true
  6653  	}
  6654  	// match: (LessThan (CMPWconst [0] z:(AND x y)))
  6655  	// cond: z.Uses == 1
  6656  	// result: (LessThan (TSTW x y))
  6657  	for {
  6658  		if v_0.Op != OpARM64CMPWconst || auxIntToInt32(v_0.AuxInt) != 0 {
  6659  			break
  6660  		}
  6661  		z := v_0.Args[0]
  6662  		if z.Op != OpARM64AND {
  6663  			break
  6664  		}
  6665  		y := z.Args[1]
  6666  		x := z.Args[0]
  6667  		if !(z.Uses == 1) {
  6668  			break
  6669  		}
  6670  		v.reset(OpARM64LessThan)
  6671  		v0 := b.NewValue0(v.Pos, OpARM64TSTW, types.TypeFlags)
  6672  		v0.AddArg2(x, y)
  6673  		v.AddArg(v0)
  6674  		return true
  6675  	}
  6676  	// match: (LessThan (CMPconst [0] x:(ANDconst [c] y)))
  6677  	// cond: x.Uses == 1
  6678  	// result: (LessThan (TSTconst [c] y))
  6679  	for {
  6680  		if v_0.Op != OpARM64CMPconst || auxIntToInt64(v_0.AuxInt) != 0 {
  6681  			break
  6682  		}
  6683  		x := v_0.Args[0]
  6684  		if x.Op != OpARM64ANDconst {
  6685  			break
  6686  		}
  6687  		c := auxIntToInt64(x.AuxInt)
  6688  		y := x.Args[0]
  6689  		if !(x.Uses == 1) {
  6690  			break
  6691  		}
  6692  		v.reset(OpARM64LessThan)
  6693  		v0 := b.NewValue0(v.Pos, OpARM64TSTconst, types.TypeFlags)
  6694  		v0.AuxInt = int64ToAuxInt(c)
  6695  		v0.AddArg(y)
  6696  		v.AddArg(v0)
  6697  		return true
  6698  	}
  6699  	// match: (LessThan (CMPconst [0] x:(ADDconst [c] y)))
  6700  	// cond: x.Uses == 1
  6701  	// result: (LessThanNoov (CMNconst [c] y))
  6702  	for {
  6703  		if v_0.Op != OpARM64CMPconst || auxIntToInt64(v_0.AuxInt) != 0 {
  6704  			break
  6705  		}
  6706  		x := v_0.Args[0]
  6707  		if x.Op != OpARM64ADDconst {
  6708  			break
  6709  		}
  6710  		c := auxIntToInt64(x.AuxInt)
  6711  		y := x.Args[0]
  6712  		if !(x.Uses == 1) {
  6713  			break
  6714  		}
  6715  		v.reset(OpARM64LessThanNoov)
  6716  		v0 := b.NewValue0(v.Pos, OpARM64CMNconst, types.TypeFlags)
  6717  		v0.AuxInt = int64ToAuxInt(c)
  6718  		v0.AddArg(y)
  6719  		v.AddArg(v0)
  6720  		return true
  6721  	}
  6722  	// match: (LessThan (CMPWconst [0] x:(ADDconst [c] y)))
  6723  	// cond: x.Uses == 1
  6724  	// result: (LessThanNoov (CMNWconst [int32(c)] y))
  6725  	for {
  6726  		if v_0.Op != OpARM64CMPWconst || auxIntToInt32(v_0.AuxInt) != 0 {
  6727  			break
  6728  		}
  6729  		x := v_0.Args[0]
  6730  		if x.Op != OpARM64ADDconst {
  6731  			break
  6732  		}
  6733  		c := auxIntToInt64(x.AuxInt)
  6734  		y := x.Args[0]
  6735  		if !(x.Uses == 1) {
  6736  			break
  6737  		}
  6738  		v.reset(OpARM64LessThanNoov)
  6739  		v0 := b.NewValue0(v.Pos, OpARM64CMNWconst, types.TypeFlags)
  6740  		v0.AuxInt = int32ToAuxInt(int32(c))
  6741  		v0.AddArg(y)
  6742  		v.AddArg(v0)
  6743  		return true
  6744  	}
  6745  	// match: (LessThan (CMPconst [0] z:(ADD x y)))
  6746  	// cond: z.Uses == 1
  6747  	// result: (LessThanNoov (CMN x y))
  6748  	for {
  6749  		if v_0.Op != OpARM64CMPconst || auxIntToInt64(v_0.AuxInt) != 0 {
  6750  			break
  6751  		}
  6752  		z := v_0.Args[0]
  6753  		if z.Op != OpARM64ADD {
  6754  			break
  6755  		}
  6756  		y := z.Args[1]
  6757  		x := z.Args[0]
  6758  		if !(z.Uses == 1) {
  6759  			break
  6760  		}
  6761  		v.reset(OpARM64LessThanNoov)
  6762  		v0 := b.NewValue0(v.Pos, OpARM64CMN, types.TypeFlags)
  6763  		v0.AddArg2(x, y)
  6764  		v.AddArg(v0)
  6765  		return true
  6766  	}
  6767  	// match: (LessThan (CMPWconst [0] z:(ADD x y)))
  6768  	// cond: z.Uses == 1
  6769  	// result: (LessThanNoov (CMNW x y))
  6770  	for {
  6771  		if v_0.Op != OpARM64CMPWconst || auxIntToInt32(v_0.AuxInt) != 0 {
  6772  			break
  6773  		}
  6774  		z := v_0.Args[0]
  6775  		if z.Op != OpARM64ADD {
  6776  			break
  6777  		}
  6778  		y := z.Args[1]
  6779  		x := z.Args[0]
  6780  		if !(z.Uses == 1) {
  6781  			break
  6782  		}
  6783  		v.reset(OpARM64LessThanNoov)
  6784  		v0 := b.NewValue0(v.Pos, OpARM64CMNW, types.TypeFlags)
  6785  		v0.AddArg2(x, y)
  6786  		v.AddArg(v0)
  6787  		return true
  6788  	}
  6789  	// match: (LessThan (CMPconst [0] z:(MADD a x y)))
  6790  	// cond: z.Uses == 1
  6791  	// result: (LessThanNoov (CMN a (MUL <x.Type> x y)))
  6792  	for {
  6793  		if v_0.Op != OpARM64CMPconst || auxIntToInt64(v_0.AuxInt) != 0 {
  6794  			break
  6795  		}
  6796  		z := v_0.Args[0]
  6797  		if z.Op != OpARM64MADD {
  6798  			break
  6799  		}
  6800  		y := z.Args[2]
  6801  		a := z.Args[0]
  6802  		x := z.Args[1]
  6803  		if !(z.Uses == 1) {
  6804  			break
  6805  		}
  6806  		v.reset(OpARM64LessThanNoov)
  6807  		v0 := b.NewValue0(v.Pos, OpARM64CMN, types.TypeFlags)
  6808  		v1 := b.NewValue0(v.Pos, OpARM64MUL, x.Type)
  6809  		v1.AddArg2(x, y)
  6810  		v0.AddArg2(a, v1)
  6811  		v.AddArg(v0)
  6812  		return true
  6813  	}
  6814  	// match: (LessThan (CMPconst [0] z:(MSUB a x y)))
  6815  	// cond: z.Uses == 1
  6816  	// result: (LessThanNoov (CMP a (MUL <x.Type> x y)))
  6817  	for {
  6818  		if v_0.Op != OpARM64CMPconst || auxIntToInt64(v_0.AuxInt) != 0 {
  6819  			break
  6820  		}
  6821  		z := v_0.Args[0]
  6822  		if z.Op != OpARM64MSUB {
  6823  			break
  6824  		}
  6825  		y := z.Args[2]
  6826  		a := z.Args[0]
  6827  		x := z.Args[1]
  6828  		if !(z.Uses == 1) {
  6829  			break
  6830  		}
  6831  		v.reset(OpARM64LessThanNoov)
  6832  		v0 := b.NewValue0(v.Pos, OpARM64CMP, types.TypeFlags)
  6833  		v1 := b.NewValue0(v.Pos, OpARM64MUL, x.Type)
  6834  		v1.AddArg2(x, y)
  6835  		v0.AddArg2(a, v1)
  6836  		v.AddArg(v0)
  6837  		return true
  6838  	}
  6839  	// match: (LessThan (CMPWconst [0] z:(MADDW a x y)))
  6840  	// cond: z.Uses == 1
  6841  	// result: (LessThanNoov (CMNW a (MULW <x.Type> x y)))
  6842  	for {
  6843  		if v_0.Op != OpARM64CMPWconst || auxIntToInt32(v_0.AuxInt) != 0 {
  6844  			break
  6845  		}
  6846  		z := v_0.Args[0]
  6847  		if z.Op != OpARM64MADDW {
  6848  			break
  6849  		}
  6850  		y := z.Args[2]
  6851  		a := z.Args[0]
  6852  		x := z.Args[1]
  6853  		if !(z.Uses == 1) {
  6854  			break
  6855  		}
  6856  		v.reset(OpARM64LessThanNoov)
  6857  		v0 := b.NewValue0(v.Pos, OpARM64CMNW, types.TypeFlags)
  6858  		v1 := b.NewValue0(v.Pos, OpARM64MULW, x.Type)
  6859  		v1.AddArg2(x, y)
  6860  		v0.AddArg2(a, v1)
  6861  		v.AddArg(v0)
  6862  		return true
  6863  	}
  6864  	// match: (LessThan (CMPWconst [0] z:(MSUBW a x y)))
  6865  	// cond: z.Uses == 1
  6866  	// result: (LessThanNoov (CMPW a (MULW <x.Type> x y)))
  6867  	for {
  6868  		if v_0.Op != OpARM64CMPWconst || auxIntToInt32(v_0.AuxInt) != 0 {
  6869  			break
  6870  		}
  6871  		z := v_0.Args[0]
  6872  		if z.Op != OpARM64MSUBW {
  6873  			break
  6874  		}
  6875  		y := z.Args[2]
  6876  		a := z.Args[0]
  6877  		x := z.Args[1]
  6878  		if !(z.Uses == 1) {
  6879  			break
  6880  		}
  6881  		v.reset(OpARM64LessThanNoov)
  6882  		v0 := b.NewValue0(v.Pos, OpARM64CMPW, types.TypeFlags)
  6883  		v1 := b.NewValue0(v.Pos, OpARM64MULW, x.Type)
  6884  		v1.AddArg2(x, y)
  6885  		v0.AddArg2(a, v1)
  6886  		v.AddArg(v0)
  6887  		return true
  6888  	}
  6889  	// match: (LessThan (FlagConstant [fc]))
  6890  	// result: (MOVDconst [b2i(fc.lt())])
  6891  	for {
  6892  		if v_0.Op != OpARM64FlagConstant {
  6893  			break
  6894  		}
  6895  		fc := auxIntToFlagConstant(v_0.AuxInt)
  6896  		v.reset(OpARM64MOVDconst)
  6897  		v.AuxInt = int64ToAuxInt(b2i(fc.lt()))
  6898  		return true
  6899  	}
  6900  	// match: (LessThan (InvertFlags x))
  6901  	// result: (GreaterThan x)
  6902  	for {
  6903  		if v_0.Op != OpARM64InvertFlags {
  6904  			break
  6905  		}
  6906  		x := v_0.Args[0]
  6907  		v.reset(OpARM64GreaterThan)
  6908  		v.AddArg(x)
  6909  		return true
  6910  	}
  6911  	return false
  6912  }
  6913  func rewriteValueARM64_OpARM64LessThanF(v *Value) bool {
  6914  	v_0 := v.Args[0]
  6915  	// match: (LessThanF (InvertFlags x))
  6916  	// result: (GreaterThanF x)
  6917  	for {
  6918  		if v_0.Op != OpARM64InvertFlags {
  6919  			break
  6920  		}
  6921  		x := v_0.Args[0]
  6922  		v.reset(OpARM64GreaterThanF)
  6923  		v.AddArg(x)
  6924  		return true
  6925  	}
  6926  	return false
  6927  }
  6928  func rewriteValueARM64_OpARM64LessThanNoov(v *Value) bool {
  6929  	v_0 := v.Args[0]
  6930  	b := v.Block
  6931  	typ := &b.Func.Config.Types
  6932  	// match: (LessThanNoov (FlagConstant [fc]))
  6933  	// result: (MOVDconst [b2i(fc.ltNoov())])
  6934  	for {
  6935  		if v_0.Op != OpARM64FlagConstant {
  6936  			break
  6937  		}
  6938  		fc := auxIntToFlagConstant(v_0.AuxInt)
  6939  		v.reset(OpARM64MOVDconst)
  6940  		v.AuxInt = int64ToAuxInt(b2i(fc.ltNoov()))
  6941  		return true
  6942  	}
  6943  	// match: (LessThanNoov (InvertFlags x))
  6944  	// result: (CSEL0 [OpARM64NotEqual] (GreaterEqualNoov <typ.Bool> x) x)
  6945  	for {
  6946  		if v_0.Op != OpARM64InvertFlags {
  6947  			break
  6948  		}
  6949  		x := v_0.Args[0]
  6950  		v.reset(OpARM64CSEL0)
  6951  		v.AuxInt = opToAuxInt(OpARM64NotEqual)
  6952  		v0 := b.NewValue0(v.Pos, OpARM64GreaterEqualNoov, typ.Bool)
  6953  		v0.AddArg(x)
  6954  		v.AddArg2(v0, x)
  6955  		return true
  6956  	}
  6957  	return false
  6958  }
  6959  func rewriteValueARM64_OpARM64LessThanU(v *Value) bool {
  6960  	v_0 := v.Args[0]
  6961  	// match: (LessThanU (FlagConstant [fc]))
  6962  	// result: (MOVDconst [b2i(fc.ult())])
  6963  	for {
  6964  		if v_0.Op != OpARM64FlagConstant {
  6965  			break
  6966  		}
  6967  		fc := auxIntToFlagConstant(v_0.AuxInt)
  6968  		v.reset(OpARM64MOVDconst)
  6969  		v.AuxInt = int64ToAuxInt(b2i(fc.ult()))
  6970  		return true
  6971  	}
  6972  	// match: (LessThanU (InvertFlags x))
  6973  	// result: (GreaterThanU x)
  6974  	for {
  6975  		if v_0.Op != OpARM64InvertFlags {
  6976  			break
  6977  		}
  6978  		x := v_0.Args[0]
  6979  		v.reset(OpARM64GreaterThanU)
  6980  		v.AddArg(x)
  6981  		return true
  6982  	}
  6983  	return false
  6984  }
  6985  func rewriteValueARM64_OpARM64MADD(v *Value) bool {
  6986  	v_2 := v.Args[2]
  6987  	v_1 := v.Args[1]
  6988  	v_0 := v.Args[0]
  6989  	b := v.Block
  6990  	// match: (MADD a x (MOVDconst [-1]))
  6991  	// result: (SUB a x)
  6992  	for {
  6993  		a := v_0
  6994  		x := v_1
  6995  		if v_2.Op != OpARM64MOVDconst || auxIntToInt64(v_2.AuxInt) != -1 {
  6996  			break
  6997  		}
  6998  		v.reset(OpARM64SUB)
  6999  		v.AddArg2(a, x)
  7000  		return true
  7001  	}
  7002  	// match: (MADD a _ (MOVDconst [0]))
  7003  	// result: a
  7004  	for {
  7005  		a := v_0
  7006  		if v_2.Op != OpARM64MOVDconst || auxIntToInt64(v_2.AuxInt) != 0 {
  7007  			break
  7008  		}
  7009  		v.copyOf(a)
  7010  		return true
  7011  	}
  7012  	// match: (MADD a x (MOVDconst [1]))
  7013  	// result: (ADD a x)
  7014  	for {
  7015  		a := v_0
  7016  		x := v_1
  7017  		if v_2.Op != OpARM64MOVDconst || auxIntToInt64(v_2.AuxInt) != 1 {
  7018  			break
  7019  		}
  7020  		v.reset(OpARM64ADD)
  7021  		v.AddArg2(a, x)
  7022  		return true
  7023  	}
  7024  	// match: (MADD a x (MOVDconst [c]))
  7025  	// cond: isPowerOfTwo(c)
  7026  	// result: (ADDshiftLL a x [log64(c)])
  7027  	for {
  7028  		a := v_0
  7029  		x := v_1
  7030  		if v_2.Op != OpARM64MOVDconst {
  7031  			break
  7032  		}
  7033  		c := auxIntToInt64(v_2.AuxInt)
  7034  		if !(isPowerOfTwo(c)) {
  7035  			break
  7036  		}
  7037  		v.reset(OpARM64ADDshiftLL)
  7038  		v.AuxInt = int64ToAuxInt(log64(c))
  7039  		v.AddArg2(a, x)
  7040  		return true
  7041  	}
  7042  	// match: (MADD a x (MOVDconst [c]))
  7043  	// cond: isPowerOfTwo(c-1) && c>=3
  7044  	// result: (ADD a (ADDshiftLL <x.Type> x x [log64(c-1)]))
  7045  	for {
  7046  		a := v_0
  7047  		x := v_1
  7048  		if v_2.Op != OpARM64MOVDconst {
  7049  			break
  7050  		}
  7051  		c := auxIntToInt64(v_2.AuxInt)
  7052  		if !(isPowerOfTwo(c-1) && c >= 3) {
  7053  			break
  7054  		}
  7055  		v.reset(OpARM64ADD)
  7056  		v0 := b.NewValue0(v.Pos, OpARM64ADDshiftLL, x.Type)
  7057  		v0.AuxInt = int64ToAuxInt(log64(c - 1))
  7058  		v0.AddArg2(x, x)
  7059  		v.AddArg2(a, v0)
  7060  		return true
  7061  	}
  7062  	// match: (MADD a x (MOVDconst [c]))
  7063  	// cond: isPowerOfTwo(c+1) && c>=7
  7064  	// result: (SUB a (SUBshiftLL <x.Type> x x [log64(c+1)]))
  7065  	for {
  7066  		a := v_0
  7067  		x := v_1
  7068  		if v_2.Op != OpARM64MOVDconst {
  7069  			break
  7070  		}
  7071  		c := auxIntToInt64(v_2.AuxInt)
  7072  		if !(isPowerOfTwo(c+1) && c >= 7) {
  7073  			break
  7074  		}
  7075  		v.reset(OpARM64SUB)
  7076  		v0 := b.NewValue0(v.Pos, OpARM64SUBshiftLL, x.Type)
  7077  		v0.AuxInt = int64ToAuxInt(log64(c + 1))
  7078  		v0.AddArg2(x, x)
  7079  		v.AddArg2(a, v0)
  7080  		return true
  7081  	}
  7082  	// match: (MADD a x (MOVDconst [c]))
  7083  	// cond: c%3 == 0 && isPowerOfTwo(c/3)
  7084  	// result: (SUBshiftLL a (SUBshiftLL <x.Type> x x [2]) [log64(c/3)])
  7085  	for {
  7086  		a := v_0
  7087  		x := v_1
  7088  		if v_2.Op != OpARM64MOVDconst {
  7089  			break
  7090  		}
  7091  		c := auxIntToInt64(v_2.AuxInt)
  7092  		if !(c%3 == 0 && isPowerOfTwo(c/3)) {
  7093  			break
  7094  		}
  7095  		v.reset(OpARM64SUBshiftLL)
  7096  		v.AuxInt = int64ToAuxInt(log64(c / 3))
  7097  		v0 := b.NewValue0(v.Pos, OpARM64SUBshiftLL, x.Type)
  7098  		v0.AuxInt = int64ToAuxInt(2)
  7099  		v0.AddArg2(x, x)
  7100  		v.AddArg2(a, v0)
  7101  		return true
  7102  	}
  7103  	// match: (MADD a x (MOVDconst [c]))
  7104  	// cond: c%5 == 0 && isPowerOfTwo(c/5)
  7105  	// result: (ADDshiftLL a (ADDshiftLL <x.Type> x x [2]) [log64(c/5)])
  7106  	for {
  7107  		a := v_0
  7108  		x := v_1
  7109  		if v_2.Op != OpARM64MOVDconst {
  7110  			break
  7111  		}
  7112  		c := auxIntToInt64(v_2.AuxInt)
  7113  		if !(c%5 == 0 && isPowerOfTwo(c/5)) {
  7114  			break
  7115  		}
  7116  		v.reset(OpARM64ADDshiftLL)
  7117  		v.AuxInt = int64ToAuxInt(log64(c / 5))
  7118  		v0 := b.NewValue0(v.Pos, OpARM64ADDshiftLL, x.Type)
  7119  		v0.AuxInt = int64ToAuxInt(2)
  7120  		v0.AddArg2(x, x)
  7121  		v.AddArg2(a, v0)
  7122  		return true
  7123  	}
  7124  	// match: (MADD a x (MOVDconst [c]))
  7125  	// cond: c%7 == 0 && isPowerOfTwo(c/7)
  7126  	// result: (SUBshiftLL a (SUBshiftLL <x.Type> x x [3]) [log64(c/7)])
  7127  	for {
  7128  		a := v_0
  7129  		x := v_1
  7130  		if v_2.Op != OpARM64MOVDconst {
  7131  			break
  7132  		}
  7133  		c := auxIntToInt64(v_2.AuxInt)
  7134  		if !(c%7 == 0 && isPowerOfTwo(c/7)) {
  7135  			break
  7136  		}
  7137  		v.reset(OpARM64SUBshiftLL)
  7138  		v.AuxInt = int64ToAuxInt(log64(c / 7))
  7139  		v0 := b.NewValue0(v.Pos, OpARM64SUBshiftLL, x.Type)
  7140  		v0.AuxInt = int64ToAuxInt(3)
  7141  		v0.AddArg2(x, x)
  7142  		v.AddArg2(a, v0)
  7143  		return true
  7144  	}
  7145  	// match: (MADD a x (MOVDconst [c]))
  7146  	// cond: c%9 == 0 && isPowerOfTwo(c/9)
  7147  	// result: (ADDshiftLL a (ADDshiftLL <x.Type> x x [3]) [log64(c/9)])
  7148  	for {
  7149  		a := v_0
  7150  		x := v_1
  7151  		if v_2.Op != OpARM64MOVDconst {
  7152  			break
  7153  		}
  7154  		c := auxIntToInt64(v_2.AuxInt)
  7155  		if !(c%9 == 0 && isPowerOfTwo(c/9)) {
  7156  			break
  7157  		}
  7158  		v.reset(OpARM64ADDshiftLL)
  7159  		v.AuxInt = int64ToAuxInt(log64(c / 9))
  7160  		v0 := b.NewValue0(v.Pos, OpARM64ADDshiftLL, x.Type)
  7161  		v0.AuxInt = int64ToAuxInt(3)
  7162  		v0.AddArg2(x, x)
  7163  		v.AddArg2(a, v0)
  7164  		return true
  7165  	}
  7166  	// match: (MADD a (MOVDconst [-1]) x)
  7167  	// result: (SUB a x)
  7168  	for {
  7169  		a := v_0
  7170  		if v_1.Op != OpARM64MOVDconst || auxIntToInt64(v_1.AuxInt) != -1 {
  7171  			break
  7172  		}
  7173  		x := v_2
  7174  		v.reset(OpARM64SUB)
  7175  		v.AddArg2(a, x)
  7176  		return true
  7177  	}
  7178  	// match: (MADD a (MOVDconst [0]) _)
  7179  	// result: a
  7180  	for {
  7181  		a := v_0
  7182  		if v_1.Op != OpARM64MOVDconst || auxIntToInt64(v_1.AuxInt) != 0 {
  7183  			break
  7184  		}
  7185  		v.copyOf(a)
  7186  		return true
  7187  	}
  7188  	// match: (MADD a (MOVDconst [1]) x)
  7189  	// result: (ADD a x)
  7190  	for {
  7191  		a := v_0
  7192  		if v_1.Op != OpARM64MOVDconst || auxIntToInt64(v_1.AuxInt) != 1 {
  7193  			break
  7194  		}
  7195  		x := v_2
  7196  		v.reset(OpARM64ADD)
  7197  		v.AddArg2(a, x)
  7198  		return true
  7199  	}
  7200  	// match: (MADD a (MOVDconst [c]) x)
  7201  	// cond: isPowerOfTwo(c)
  7202  	// result: (ADDshiftLL a x [log64(c)])
  7203  	for {
  7204  		a := v_0
  7205  		if v_1.Op != OpARM64MOVDconst {
  7206  			break
  7207  		}
  7208  		c := auxIntToInt64(v_1.AuxInt)
  7209  		x := v_2
  7210  		if !(isPowerOfTwo(c)) {
  7211  			break
  7212  		}
  7213  		v.reset(OpARM64ADDshiftLL)
  7214  		v.AuxInt = int64ToAuxInt(log64(c))
  7215  		v.AddArg2(a, x)
  7216  		return true
  7217  	}
  7218  	// match: (MADD a (MOVDconst [c]) x)
  7219  	// cond: isPowerOfTwo(c-1) && c>=3
  7220  	// result: (ADD a (ADDshiftLL <x.Type> x x [log64(c-1)]))
  7221  	for {
  7222  		a := v_0
  7223  		if v_1.Op != OpARM64MOVDconst {
  7224  			break
  7225  		}
  7226  		c := auxIntToInt64(v_1.AuxInt)
  7227  		x := v_2
  7228  		if !(isPowerOfTwo(c-1) && c >= 3) {
  7229  			break
  7230  		}
  7231  		v.reset(OpARM64ADD)
  7232  		v0 := b.NewValue0(v.Pos, OpARM64ADDshiftLL, x.Type)
  7233  		v0.AuxInt = int64ToAuxInt(log64(c - 1))
  7234  		v0.AddArg2(x, x)
  7235  		v.AddArg2(a, v0)
  7236  		return true
  7237  	}
  7238  	// match: (MADD a (MOVDconst [c]) x)
  7239  	// cond: isPowerOfTwo(c+1) && c>=7
  7240  	// result: (SUB a (SUBshiftLL <x.Type> x x [log64(c+1)]))
  7241  	for {
  7242  		a := v_0
  7243  		if v_1.Op != OpARM64MOVDconst {
  7244  			break
  7245  		}
  7246  		c := auxIntToInt64(v_1.AuxInt)
  7247  		x := v_2
  7248  		if !(isPowerOfTwo(c+1) && c >= 7) {
  7249  			break
  7250  		}
  7251  		v.reset(OpARM64SUB)
  7252  		v0 := b.NewValue0(v.Pos, OpARM64SUBshiftLL, x.Type)
  7253  		v0.AuxInt = int64ToAuxInt(log64(c + 1))
  7254  		v0.AddArg2(x, x)
  7255  		v.AddArg2(a, v0)
  7256  		return true
  7257  	}
  7258  	// match: (MADD a (MOVDconst [c]) x)
  7259  	// cond: c%3 == 0 && isPowerOfTwo(c/3)
  7260  	// result: (SUBshiftLL a (SUBshiftLL <x.Type> x x [2]) [log64(c/3)])
  7261  	for {
  7262  		a := v_0
  7263  		if v_1.Op != OpARM64MOVDconst {
  7264  			break
  7265  		}
  7266  		c := auxIntToInt64(v_1.AuxInt)
  7267  		x := v_2
  7268  		if !(c%3 == 0 && isPowerOfTwo(c/3)) {
  7269  			break
  7270  		}
  7271  		v.reset(OpARM64SUBshiftLL)
  7272  		v.AuxInt = int64ToAuxInt(log64(c / 3))
  7273  		v0 := b.NewValue0(v.Pos, OpARM64SUBshiftLL, x.Type)
  7274  		v0.AuxInt = int64ToAuxInt(2)
  7275  		v0.AddArg2(x, x)
  7276  		v.AddArg2(a, v0)
  7277  		return true
  7278  	}
  7279  	// match: (MADD a (MOVDconst [c]) x)
  7280  	// cond: c%5 == 0 && isPowerOfTwo(c/5)
  7281  	// result: (ADDshiftLL a (ADDshiftLL <x.Type> x x [2]) [log64(c/5)])
  7282  	for {
  7283  		a := v_0
  7284  		if v_1.Op != OpARM64MOVDconst {
  7285  			break
  7286  		}
  7287  		c := auxIntToInt64(v_1.AuxInt)
  7288  		x := v_2
  7289  		if !(c%5 == 0 && isPowerOfTwo(c/5)) {
  7290  			break
  7291  		}
  7292  		v.reset(OpARM64ADDshiftLL)
  7293  		v.AuxInt = int64ToAuxInt(log64(c / 5))
  7294  		v0 := b.NewValue0(v.Pos, OpARM64ADDshiftLL, x.Type)
  7295  		v0.AuxInt = int64ToAuxInt(2)
  7296  		v0.AddArg2(x, x)
  7297  		v.AddArg2(a, v0)
  7298  		return true
  7299  	}
  7300  	// match: (MADD a (MOVDconst [c]) x)
  7301  	// cond: c%7 == 0 && isPowerOfTwo(c/7)
  7302  	// result: (SUBshiftLL a (SUBshiftLL <x.Type> x x [3]) [log64(c/7)])
  7303  	for {
  7304  		a := v_0
  7305  		if v_1.Op != OpARM64MOVDconst {
  7306  			break
  7307  		}
  7308  		c := auxIntToInt64(v_1.AuxInt)
  7309  		x := v_2
  7310  		if !(c%7 == 0 && isPowerOfTwo(c/7)) {
  7311  			break
  7312  		}
  7313  		v.reset(OpARM64SUBshiftLL)
  7314  		v.AuxInt = int64ToAuxInt(log64(c / 7))
  7315  		v0 := b.NewValue0(v.Pos, OpARM64SUBshiftLL, x.Type)
  7316  		v0.AuxInt = int64ToAuxInt(3)
  7317  		v0.AddArg2(x, x)
  7318  		v.AddArg2(a, v0)
  7319  		return true
  7320  	}
  7321  	// match: (MADD a (MOVDconst [c]) x)
  7322  	// cond: c%9 == 0 && isPowerOfTwo(c/9)
  7323  	// result: (ADDshiftLL a (ADDshiftLL <x.Type> x x [3]) [log64(c/9)])
  7324  	for {
  7325  		a := v_0
  7326  		if v_1.Op != OpARM64MOVDconst {
  7327  			break
  7328  		}
  7329  		c := auxIntToInt64(v_1.AuxInt)
  7330  		x := v_2
  7331  		if !(c%9 == 0 && isPowerOfTwo(c/9)) {
  7332  			break
  7333  		}
  7334  		v.reset(OpARM64ADDshiftLL)
  7335  		v.AuxInt = int64ToAuxInt(log64(c / 9))
  7336  		v0 := b.NewValue0(v.Pos, OpARM64ADDshiftLL, x.Type)
  7337  		v0.AuxInt = int64ToAuxInt(3)
  7338  		v0.AddArg2(x, x)
  7339  		v.AddArg2(a, v0)
  7340  		return true
  7341  	}
  7342  	// match: (MADD (MOVDconst [c]) x y)
  7343  	// result: (ADDconst [c] (MUL <x.Type> x y))
  7344  	for {
  7345  		if v_0.Op != OpARM64MOVDconst {
  7346  			break
  7347  		}
  7348  		c := auxIntToInt64(v_0.AuxInt)
  7349  		x := v_1
  7350  		y := v_2
  7351  		v.reset(OpARM64ADDconst)
  7352  		v.AuxInt = int64ToAuxInt(c)
  7353  		v0 := b.NewValue0(v.Pos, OpARM64MUL, x.Type)
  7354  		v0.AddArg2(x, y)
  7355  		v.AddArg(v0)
  7356  		return true
  7357  	}
  7358  	// match: (MADD a (MOVDconst [c]) (MOVDconst [d]))
  7359  	// result: (ADDconst [c*d] a)
  7360  	for {
  7361  		a := v_0
  7362  		if v_1.Op != OpARM64MOVDconst {
  7363  			break
  7364  		}
  7365  		c := auxIntToInt64(v_1.AuxInt)
  7366  		if v_2.Op != OpARM64MOVDconst {
  7367  			break
  7368  		}
  7369  		d := auxIntToInt64(v_2.AuxInt)
  7370  		v.reset(OpARM64ADDconst)
  7371  		v.AuxInt = int64ToAuxInt(c * d)
  7372  		v.AddArg(a)
  7373  		return true
  7374  	}
  7375  	return false
  7376  }
  7377  func rewriteValueARM64_OpARM64MADDW(v *Value) bool {
  7378  	v_2 := v.Args[2]
  7379  	v_1 := v.Args[1]
  7380  	v_0 := v.Args[0]
  7381  	b := v.Block
  7382  	// match: (MADDW a x (MOVDconst [c]))
  7383  	// cond: int32(c)==-1
  7384  	// result: (MOVWUreg (SUB <a.Type> a x))
  7385  	for {
  7386  		a := v_0
  7387  		x := v_1
  7388  		if v_2.Op != OpARM64MOVDconst {
  7389  			break
  7390  		}
  7391  		c := auxIntToInt64(v_2.AuxInt)
  7392  		if !(int32(c) == -1) {
  7393  			break
  7394  		}
  7395  		v.reset(OpARM64MOVWUreg)
  7396  		v0 := b.NewValue0(v.Pos, OpARM64SUB, a.Type)
  7397  		v0.AddArg2(a, x)
  7398  		v.AddArg(v0)
  7399  		return true
  7400  	}
  7401  	// match: (MADDW a _ (MOVDconst [c]))
  7402  	// cond: int32(c)==0
  7403  	// result: (MOVWUreg a)
  7404  	for {
  7405  		a := v_0
  7406  		if v_2.Op != OpARM64MOVDconst {
  7407  			break
  7408  		}
  7409  		c := auxIntToInt64(v_2.AuxInt)
  7410  		if !(int32(c) == 0) {
  7411  			break
  7412  		}
  7413  		v.reset(OpARM64MOVWUreg)
  7414  		v.AddArg(a)
  7415  		return true
  7416  	}
  7417  	// match: (MADDW a x (MOVDconst [c]))
  7418  	// cond: int32(c)==1
  7419  	// result: (MOVWUreg (ADD <a.Type> a x))
  7420  	for {
  7421  		a := v_0
  7422  		x := v_1
  7423  		if v_2.Op != OpARM64MOVDconst {
  7424  			break
  7425  		}
  7426  		c := auxIntToInt64(v_2.AuxInt)
  7427  		if !(int32(c) == 1) {
  7428  			break
  7429  		}
  7430  		v.reset(OpARM64MOVWUreg)
  7431  		v0 := b.NewValue0(v.Pos, OpARM64ADD, a.Type)
  7432  		v0.AddArg2(a, x)
  7433  		v.AddArg(v0)
  7434  		return true
  7435  	}
  7436  	// match: (MADDW a x (MOVDconst [c]))
  7437  	// cond: isPowerOfTwo(c)
  7438  	// result: (MOVWUreg (ADDshiftLL <a.Type> a x [log64(c)]))
  7439  	for {
  7440  		a := v_0
  7441  		x := v_1
  7442  		if v_2.Op != OpARM64MOVDconst {
  7443  			break
  7444  		}
  7445  		c := auxIntToInt64(v_2.AuxInt)
  7446  		if !(isPowerOfTwo(c)) {
  7447  			break
  7448  		}
  7449  		v.reset(OpARM64MOVWUreg)
  7450  		v0 := b.NewValue0(v.Pos, OpARM64ADDshiftLL, a.Type)
  7451  		v0.AuxInt = int64ToAuxInt(log64(c))
  7452  		v0.AddArg2(a, x)
  7453  		v.AddArg(v0)
  7454  		return true
  7455  	}
  7456  	// match: (MADDW a x (MOVDconst [c]))
  7457  	// cond: isPowerOfTwo(c-1) && int32(c)>=3
  7458  	// result: (MOVWUreg (ADD <a.Type> a (ADDshiftLL <x.Type> x x [log64(c-1)])))
  7459  	for {
  7460  		a := v_0
  7461  		x := v_1
  7462  		if v_2.Op != OpARM64MOVDconst {
  7463  			break
  7464  		}
  7465  		c := auxIntToInt64(v_2.AuxInt)
  7466  		if !(isPowerOfTwo(c-1) && int32(c) >= 3) {
  7467  			break
  7468  		}
  7469  		v.reset(OpARM64MOVWUreg)
  7470  		v0 := b.NewValue0(v.Pos, OpARM64ADD, a.Type)
  7471  		v1 := b.NewValue0(v.Pos, OpARM64ADDshiftLL, x.Type)
  7472  		v1.AuxInt = int64ToAuxInt(log64(c - 1))
  7473  		v1.AddArg2(x, x)
  7474  		v0.AddArg2(a, v1)
  7475  		v.AddArg(v0)
  7476  		return true
  7477  	}
  7478  	// match: (MADDW a x (MOVDconst [c]))
  7479  	// cond: isPowerOfTwo(c+1) && int32(c)>=7
  7480  	// result: (MOVWUreg (SUB <a.Type> a (SUBshiftLL <x.Type> x x [log64(c+1)])))
  7481  	for {
  7482  		a := v_0
  7483  		x := v_1
  7484  		if v_2.Op != OpARM64MOVDconst {
  7485  			break
  7486  		}
  7487  		c := auxIntToInt64(v_2.AuxInt)
  7488  		if !(isPowerOfTwo(c+1) && int32(c) >= 7) {
  7489  			break
  7490  		}
  7491  		v.reset(OpARM64MOVWUreg)
  7492  		v0 := b.NewValue0(v.Pos, OpARM64SUB, a.Type)
  7493  		v1 := b.NewValue0(v.Pos, OpARM64SUBshiftLL, x.Type)
  7494  		v1.AuxInt = int64ToAuxInt(log64(c + 1))
  7495  		v1.AddArg2(x, x)
  7496  		v0.AddArg2(a, v1)
  7497  		v.AddArg(v0)
  7498  		return true
  7499  	}
  7500  	// match: (MADDW a x (MOVDconst [c]))
  7501  	// cond: c%3 == 0 && isPowerOfTwo(c/3) && is32Bit(c)
  7502  	// result: (MOVWUreg (SUBshiftLL <a.Type> a (SUBshiftLL <x.Type> x x [2]) [log64(c/3)]))
  7503  	for {
  7504  		a := v_0
  7505  		x := v_1
  7506  		if v_2.Op != OpARM64MOVDconst {
  7507  			break
  7508  		}
  7509  		c := auxIntToInt64(v_2.AuxInt)
  7510  		if !(c%3 == 0 && isPowerOfTwo(c/3) && is32Bit(c)) {
  7511  			break
  7512  		}
  7513  		v.reset(OpARM64MOVWUreg)
  7514  		v0 := b.NewValue0(v.Pos, OpARM64SUBshiftLL, a.Type)
  7515  		v0.AuxInt = int64ToAuxInt(log64(c / 3))
  7516  		v1 := b.NewValue0(v.Pos, OpARM64SUBshiftLL, x.Type)
  7517  		v1.AuxInt = int64ToAuxInt(2)
  7518  		v1.AddArg2(x, x)
  7519  		v0.AddArg2(a, v1)
  7520  		v.AddArg(v0)
  7521  		return true
  7522  	}
  7523  	// match: (MADDW a x (MOVDconst [c]))
  7524  	// cond: c%5 == 0 && isPowerOfTwo(c/5) && is32Bit(c)
  7525  	// result: (MOVWUreg (ADDshiftLL <a.Type> a (ADDshiftLL <x.Type> x x [2]) [log64(c/5)]))
  7526  	for {
  7527  		a := v_0
  7528  		x := v_1
  7529  		if v_2.Op != OpARM64MOVDconst {
  7530  			break
  7531  		}
  7532  		c := auxIntToInt64(v_2.AuxInt)
  7533  		if !(c%5 == 0 && isPowerOfTwo(c/5) && is32Bit(c)) {
  7534  			break
  7535  		}
  7536  		v.reset(OpARM64MOVWUreg)
  7537  		v0 := b.NewValue0(v.Pos, OpARM64ADDshiftLL, a.Type)
  7538  		v0.AuxInt = int64ToAuxInt(log64(c / 5))
  7539  		v1 := b.NewValue0(v.Pos, OpARM64ADDshiftLL, x.Type)
  7540  		v1.AuxInt = int64ToAuxInt(2)
  7541  		v1.AddArg2(x, x)
  7542  		v0.AddArg2(a, v1)
  7543  		v.AddArg(v0)
  7544  		return true
  7545  	}
  7546  	// match: (MADDW a x (MOVDconst [c]))
  7547  	// cond: c%7 == 0 && isPowerOfTwo(c/7) && is32Bit(c)
  7548  	// result: (MOVWUreg (SUBshiftLL <a.Type> a (SUBshiftLL <x.Type> x x [3]) [log64(c/7)]))
  7549  	for {
  7550  		a := v_0
  7551  		x := v_1
  7552  		if v_2.Op != OpARM64MOVDconst {
  7553  			break
  7554  		}
  7555  		c := auxIntToInt64(v_2.AuxInt)
  7556  		if !(c%7 == 0 && isPowerOfTwo(c/7) && is32Bit(c)) {
  7557  			break
  7558  		}
  7559  		v.reset(OpARM64MOVWUreg)
  7560  		v0 := b.NewValue0(v.Pos, OpARM64SUBshiftLL, a.Type)
  7561  		v0.AuxInt = int64ToAuxInt(log64(c / 7))
  7562  		v1 := b.NewValue0(v.Pos, OpARM64SUBshiftLL, x.Type)
  7563  		v1.AuxInt = int64ToAuxInt(3)
  7564  		v1.AddArg2(x, x)
  7565  		v0.AddArg2(a, v1)
  7566  		v.AddArg(v0)
  7567  		return true
  7568  	}
  7569  	// match: (MADDW a x (MOVDconst [c]))
  7570  	// cond: c%9 == 0 && isPowerOfTwo(c/9) && is32Bit(c)
  7571  	// result: (MOVWUreg (ADDshiftLL <a.Type> a (ADDshiftLL <x.Type> x x [3]) [log64(c/9)]))
  7572  	for {
  7573  		a := v_0
  7574  		x := v_1
  7575  		if v_2.Op != OpARM64MOVDconst {
  7576  			break
  7577  		}
  7578  		c := auxIntToInt64(v_2.AuxInt)
  7579  		if !(c%9 == 0 && isPowerOfTwo(c/9) && is32Bit(c)) {
  7580  			break
  7581  		}
  7582  		v.reset(OpARM64MOVWUreg)
  7583  		v0 := b.NewValue0(v.Pos, OpARM64ADDshiftLL, a.Type)
  7584  		v0.AuxInt = int64ToAuxInt(log64(c / 9))
  7585  		v1 := b.NewValue0(v.Pos, OpARM64ADDshiftLL, x.Type)
  7586  		v1.AuxInt = int64ToAuxInt(3)
  7587  		v1.AddArg2(x, x)
  7588  		v0.AddArg2(a, v1)
  7589  		v.AddArg(v0)
  7590  		return true
  7591  	}
  7592  	// match: (MADDW a (MOVDconst [c]) x)
  7593  	// cond: int32(c)==-1
  7594  	// result: (MOVWUreg (SUB <a.Type> a x))
  7595  	for {
  7596  		a := v_0
  7597  		if v_1.Op != OpARM64MOVDconst {
  7598  			break
  7599  		}
  7600  		c := auxIntToInt64(v_1.AuxInt)
  7601  		x := v_2
  7602  		if !(int32(c) == -1) {
  7603  			break
  7604  		}
  7605  		v.reset(OpARM64MOVWUreg)
  7606  		v0 := b.NewValue0(v.Pos, OpARM64SUB, a.Type)
  7607  		v0.AddArg2(a, x)
  7608  		v.AddArg(v0)
  7609  		return true
  7610  	}
  7611  	// match: (MADDW a (MOVDconst [c]) _)
  7612  	// cond: int32(c)==0
  7613  	// result: (MOVWUreg a)
  7614  	for {
  7615  		a := v_0
  7616  		if v_1.Op != OpARM64MOVDconst {
  7617  			break
  7618  		}
  7619  		c := auxIntToInt64(v_1.AuxInt)
  7620  		if !(int32(c) == 0) {
  7621  			break
  7622  		}
  7623  		v.reset(OpARM64MOVWUreg)
  7624  		v.AddArg(a)
  7625  		return true
  7626  	}
  7627  	// match: (MADDW a (MOVDconst [c]) x)
  7628  	// cond: int32(c)==1
  7629  	// result: (MOVWUreg (ADD <a.Type> a x))
  7630  	for {
  7631  		a := v_0
  7632  		if v_1.Op != OpARM64MOVDconst {
  7633  			break
  7634  		}
  7635  		c := auxIntToInt64(v_1.AuxInt)
  7636  		x := v_2
  7637  		if !(int32(c) == 1) {
  7638  			break
  7639  		}
  7640  		v.reset(OpARM64MOVWUreg)
  7641  		v0 := b.NewValue0(v.Pos, OpARM64ADD, a.Type)
  7642  		v0.AddArg2(a, x)
  7643  		v.AddArg(v0)
  7644  		return true
  7645  	}
  7646  	// match: (MADDW a (MOVDconst [c]) x)
  7647  	// cond: isPowerOfTwo(c)
  7648  	// result: (MOVWUreg (ADDshiftLL <a.Type> a x [log64(c)]))
  7649  	for {
  7650  		a := v_0
  7651  		if v_1.Op != OpARM64MOVDconst {
  7652  			break
  7653  		}
  7654  		c := auxIntToInt64(v_1.AuxInt)
  7655  		x := v_2
  7656  		if !(isPowerOfTwo(c)) {
  7657  			break
  7658  		}
  7659  		v.reset(OpARM64MOVWUreg)
  7660  		v0 := b.NewValue0(v.Pos, OpARM64ADDshiftLL, a.Type)
  7661  		v0.AuxInt = int64ToAuxInt(log64(c))
  7662  		v0.AddArg2(a, x)
  7663  		v.AddArg(v0)
  7664  		return true
  7665  	}
  7666  	// match: (MADDW a (MOVDconst [c]) x)
  7667  	// cond: isPowerOfTwo(c-1) && int32(c)>=3
  7668  	// result: (MOVWUreg (ADD <a.Type> a (ADDshiftLL <x.Type> x x [log64(c-1)])))
  7669  	for {
  7670  		a := v_0
  7671  		if v_1.Op != OpARM64MOVDconst {
  7672  			break
  7673  		}
  7674  		c := auxIntToInt64(v_1.AuxInt)
  7675  		x := v_2
  7676  		if !(isPowerOfTwo(c-1) && int32(c) >= 3) {
  7677  			break
  7678  		}
  7679  		v.reset(OpARM64MOVWUreg)
  7680  		v0 := b.NewValue0(v.Pos, OpARM64ADD, a.Type)
  7681  		v1 := b.NewValue0(v.Pos, OpARM64ADDshiftLL, x.Type)
  7682  		v1.AuxInt = int64ToAuxInt(log64(c - 1))
  7683  		v1.AddArg2(x, x)
  7684  		v0.AddArg2(a, v1)
  7685  		v.AddArg(v0)
  7686  		return true
  7687  	}
  7688  	// match: (MADDW a (MOVDconst [c]) x)
  7689  	// cond: isPowerOfTwo(c+1) && int32(c)>=7
  7690  	// result: (MOVWUreg (SUB <a.Type> a (SUBshiftLL <x.Type> x x [log64(c+1)])))
  7691  	for {
  7692  		a := v_0
  7693  		if v_1.Op != OpARM64MOVDconst {
  7694  			break
  7695  		}
  7696  		c := auxIntToInt64(v_1.AuxInt)
  7697  		x := v_2
  7698  		if !(isPowerOfTwo(c+1) && int32(c) >= 7) {
  7699  			break
  7700  		}
  7701  		v.reset(OpARM64MOVWUreg)
  7702  		v0 := b.NewValue0(v.Pos, OpARM64SUB, a.Type)
  7703  		v1 := b.NewValue0(v.Pos, OpARM64SUBshiftLL, x.Type)
  7704  		v1.AuxInt = int64ToAuxInt(log64(c + 1))
  7705  		v1.AddArg2(x, x)
  7706  		v0.AddArg2(a, v1)
  7707  		v.AddArg(v0)
  7708  		return true
  7709  	}
  7710  	// match: (MADDW a (MOVDconst [c]) x)
  7711  	// cond: c%3 == 0 && isPowerOfTwo(c/3) && is32Bit(c)
  7712  	// result: (MOVWUreg (SUBshiftLL <a.Type> a (SUBshiftLL <x.Type> x x [2]) [log64(c/3)]))
  7713  	for {
  7714  		a := v_0
  7715  		if v_1.Op != OpARM64MOVDconst {
  7716  			break
  7717  		}
  7718  		c := auxIntToInt64(v_1.AuxInt)
  7719  		x := v_2
  7720  		if !(c%3 == 0 && isPowerOfTwo(c/3) && is32Bit(c)) {
  7721  			break
  7722  		}
  7723  		v.reset(OpARM64MOVWUreg)
  7724  		v0 := b.NewValue0(v.Pos, OpARM64SUBshiftLL, a.Type)
  7725  		v0.AuxInt = int64ToAuxInt(log64(c / 3))
  7726  		v1 := b.NewValue0(v.Pos, OpARM64SUBshiftLL, x.Type)
  7727  		v1.AuxInt = int64ToAuxInt(2)
  7728  		v1.AddArg2(x, x)
  7729  		v0.AddArg2(a, v1)
  7730  		v.AddArg(v0)
  7731  		return true
  7732  	}
  7733  	// match: (MADDW a (MOVDconst [c]) x)
  7734  	// cond: c%5 == 0 && isPowerOfTwo(c/5) && is32Bit(c)
  7735  	// result: (MOVWUreg (ADDshiftLL <a.Type> a (ADDshiftLL <x.Type> x x [2]) [log64(c/5)]))
  7736  	for {
  7737  		a := v_0
  7738  		if v_1.Op != OpARM64MOVDconst {
  7739  			break
  7740  		}
  7741  		c := auxIntToInt64(v_1.AuxInt)
  7742  		x := v_2
  7743  		if !(c%5 == 0 && isPowerOfTwo(c/5) && is32Bit(c)) {
  7744  			break
  7745  		}
  7746  		v.reset(OpARM64MOVWUreg)
  7747  		v0 := b.NewValue0(v.Pos, OpARM64ADDshiftLL, a.Type)
  7748  		v0.AuxInt = int64ToAuxInt(log64(c / 5))
  7749  		v1 := b.NewValue0(v.Pos, OpARM64ADDshiftLL, x.Type)
  7750  		v1.AuxInt = int64ToAuxInt(2)
  7751  		v1.AddArg2(x, x)
  7752  		v0.AddArg2(a, v1)
  7753  		v.AddArg(v0)
  7754  		return true
  7755  	}
  7756  	// match: (MADDW a (MOVDconst [c]) x)
  7757  	// cond: c%7 == 0 && isPowerOfTwo(c/7) && is32Bit(c)
  7758  	// result: (MOVWUreg (SUBshiftLL <a.Type> a (SUBshiftLL <x.Type> x x [3]) [log64(c/7)]))
  7759  	for {
  7760  		a := v_0
  7761  		if v_1.Op != OpARM64MOVDconst {
  7762  			break
  7763  		}
  7764  		c := auxIntToInt64(v_1.AuxInt)
  7765  		x := v_2
  7766  		if !(c%7 == 0 && isPowerOfTwo(c/7) && is32Bit(c)) {
  7767  			break
  7768  		}
  7769  		v.reset(OpARM64MOVWUreg)
  7770  		v0 := b.NewValue0(v.Pos, OpARM64SUBshiftLL, a.Type)
  7771  		v0.AuxInt = int64ToAuxInt(log64(c / 7))
  7772  		v1 := b.NewValue0(v.Pos, OpARM64SUBshiftLL, x.Type)
  7773  		v1.AuxInt = int64ToAuxInt(3)
  7774  		v1.AddArg2(x, x)
  7775  		v0.AddArg2(a, v1)
  7776  		v.AddArg(v0)
  7777  		return true
  7778  	}
  7779  	// match: (MADDW a (MOVDconst [c]) x)
  7780  	// cond: c%9 == 0 && isPowerOfTwo(c/9) && is32Bit(c)
  7781  	// result: (MOVWUreg (ADDshiftLL <a.Type> a (ADDshiftLL <x.Type> x x [3]) [log64(c/9)]))
  7782  	for {
  7783  		a := v_0
  7784  		if v_1.Op != OpARM64MOVDconst {
  7785  			break
  7786  		}
  7787  		c := auxIntToInt64(v_1.AuxInt)
  7788  		x := v_2
  7789  		if !(c%9 == 0 && isPowerOfTwo(c/9) && is32Bit(c)) {
  7790  			break
  7791  		}
  7792  		v.reset(OpARM64MOVWUreg)
  7793  		v0 := b.NewValue0(v.Pos, OpARM64ADDshiftLL, a.Type)
  7794  		v0.AuxInt = int64ToAuxInt(log64(c / 9))
  7795  		v1 := b.NewValue0(v.Pos, OpARM64ADDshiftLL, x.Type)
  7796  		v1.AuxInt = int64ToAuxInt(3)
  7797  		v1.AddArg2(x, x)
  7798  		v0.AddArg2(a, v1)
  7799  		v.AddArg(v0)
  7800  		return true
  7801  	}
  7802  	// match: (MADDW (MOVDconst [c]) x y)
  7803  	// result: (MOVWUreg (ADDconst <x.Type> [c] (MULW <x.Type> x y)))
  7804  	for {
  7805  		if v_0.Op != OpARM64MOVDconst {
  7806  			break
  7807  		}
  7808  		c := auxIntToInt64(v_0.AuxInt)
  7809  		x := v_1
  7810  		y := v_2
  7811  		v.reset(OpARM64MOVWUreg)
  7812  		v0 := b.NewValue0(v.Pos, OpARM64ADDconst, x.Type)
  7813  		v0.AuxInt = int64ToAuxInt(c)
  7814  		v1 := b.NewValue0(v.Pos, OpARM64MULW, x.Type)
  7815  		v1.AddArg2(x, y)
  7816  		v0.AddArg(v1)
  7817  		v.AddArg(v0)
  7818  		return true
  7819  	}
  7820  	// match: (MADDW a (MOVDconst [c]) (MOVDconst [d]))
  7821  	// result: (MOVWUreg (ADDconst <a.Type> [c*d] a))
  7822  	for {
  7823  		a := v_0
  7824  		if v_1.Op != OpARM64MOVDconst {
  7825  			break
  7826  		}
  7827  		c := auxIntToInt64(v_1.AuxInt)
  7828  		if v_2.Op != OpARM64MOVDconst {
  7829  			break
  7830  		}
  7831  		d := auxIntToInt64(v_2.AuxInt)
  7832  		v.reset(OpARM64MOVWUreg)
  7833  		v0 := b.NewValue0(v.Pos, OpARM64ADDconst, a.Type)
  7834  		v0.AuxInt = int64ToAuxInt(c * d)
  7835  		v0.AddArg(a)
  7836  		v.AddArg(v0)
  7837  		return true
  7838  	}
  7839  	return false
  7840  }
  7841  func rewriteValueARM64_OpARM64MNEG(v *Value) bool {
  7842  	v_1 := v.Args[1]
  7843  	v_0 := v.Args[0]
  7844  	b := v.Block
  7845  	// match: (MNEG x (MOVDconst [-1]))
  7846  	// result: x
  7847  	for {
  7848  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
  7849  			x := v_0
  7850  			if v_1.Op != OpARM64MOVDconst || auxIntToInt64(v_1.AuxInt) != -1 {
  7851  				continue
  7852  			}
  7853  			v.copyOf(x)
  7854  			return true
  7855  		}
  7856  		break
  7857  	}
  7858  	// match: (MNEG _ (MOVDconst [0]))
  7859  	// result: (MOVDconst [0])
  7860  	for {
  7861  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
  7862  			if v_1.Op != OpARM64MOVDconst || auxIntToInt64(v_1.AuxInt) != 0 {
  7863  				continue
  7864  			}
  7865  			v.reset(OpARM64MOVDconst)
  7866  			v.AuxInt = int64ToAuxInt(0)
  7867  			return true
  7868  		}
  7869  		break
  7870  	}
  7871  	// match: (MNEG x (MOVDconst [1]))
  7872  	// result: (NEG x)
  7873  	for {
  7874  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
  7875  			x := v_0
  7876  			if v_1.Op != OpARM64MOVDconst || auxIntToInt64(v_1.AuxInt) != 1 {
  7877  				continue
  7878  			}
  7879  			v.reset(OpARM64NEG)
  7880  			v.AddArg(x)
  7881  			return true
  7882  		}
  7883  		break
  7884  	}
  7885  	// match: (MNEG x (MOVDconst [c]))
  7886  	// cond: isPowerOfTwo(c)
  7887  	// result: (NEG (SLLconst <x.Type> [log64(c)] x))
  7888  	for {
  7889  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
  7890  			x := v_0
  7891  			if v_1.Op != OpARM64MOVDconst {
  7892  				continue
  7893  			}
  7894  			c := auxIntToInt64(v_1.AuxInt)
  7895  			if !(isPowerOfTwo(c)) {
  7896  				continue
  7897  			}
  7898  			v.reset(OpARM64NEG)
  7899  			v0 := b.NewValue0(v.Pos, OpARM64SLLconst, x.Type)
  7900  			v0.AuxInt = int64ToAuxInt(log64(c))
  7901  			v0.AddArg(x)
  7902  			v.AddArg(v0)
  7903  			return true
  7904  		}
  7905  		break
  7906  	}
  7907  	// match: (MNEG x (MOVDconst [c]))
  7908  	// cond: isPowerOfTwo(c-1) && c >= 3
  7909  	// result: (NEG (ADDshiftLL <x.Type> x x [log64(c-1)]))
  7910  	for {
  7911  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
  7912  			x := v_0
  7913  			if v_1.Op != OpARM64MOVDconst {
  7914  				continue
  7915  			}
  7916  			c := auxIntToInt64(v_1.AuxInt)
  7917  			if !(isPowerOfTwo(c-1) && c >= 3) {
  7918  				continue
  7919  			}
  7920  			v.reset(OpARM64NEG)
  7921  			v0 := b.NewValue0(v.Pos, OpARM64ADDshiftLL, x.Type)
  7922  			v0.AuxInt = int64ToAuxInt(log64(c - 1))
  7923  			v0.AddArg2(x, x)
  7924  			v.AddArg(v0)
  7925  			return true
  7926  		}
  7927  		break
  7928  	}
  7929  	// match: (MNEG x (MOVDconst [c]))
  7930  	// cond: isPowerOfTwo(c+1) && c >= 7
  7931  	// result: (NEG (ADDshiftLL <x.Type> (NEG <x.Type> x) x [log64(c+1)]))
  7932  	for {
  7933  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
  7934  			x := v_0
  7935  			if v_1.Op != OpARM64MOVDconst {
  7936  				continue
  7937  			}
  7938  			c := auxIntToInt64(v_1.AuxInt)
  7939  			if !(isPowerOfTwo(c+1) && c >= 7) {
  7940  				continue
  7941  			}
  7942  			v.reset(OpARM64NEG)
  7943  			v0 := b.NewValue0(v.Pos, OpARM64ADDshiftLL, x.Type)
  7944  			v0.AuxInt = int64ToAuxInt(log64(c + 1))
  7945  			v1 := b.NewValue0(v.Pos, OpARM64NEG, x.Type)
  7946  			v1.AddArg(x)
  7947  			v0.AddArg2(v1, x)
  7948  			v.AddArg(v0)
  7949  			return true
  7950  		}
  7951  		break
  7952  	}
  7953  	// match: (MNEG x (MOVDconst [c]))
  7954  	// cond: c%3 == 0 && isPowerOfTwo(c/3)
  7955  	// result: (SLLconst <x.Type> [log64(c/3)] (SUBshiftLL <x.Type> x x [2]))
  7956  	for {
  7957  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
  7958  			x := v_0
  7959  			if v_1.Op != OpARM64MOVDconst {
  7960  				continue
  7961  			}
  7962  			c := auxIntToInt64(v_1.AuxInt)
  7963  			if !(c%3 == 0 && isPowerOfTwo(c/3)) {
  7964  				continue
  7965  			}
  7966  			v.reset(OpARM64SLLconst)
  7967  			v.Type = x.Type
  7968  			v.AuxInt = int64ToAuxInt(log64(c / 3))
  7969  			v0 := b.NewValue0(v.Pos, OpARM64SUBshiftLL, x.Type)
  7970  			v0.AuxInt = int64ToAuxInt(2)
  7971  			v0.AddArg2(x, x)
  7972  			v.AddArg(v0)
  7973  			return true
  7974  		}
  7975  		break
  7976  	}
  7977  	// match: (MNEG x (MOVDconst [c]))
  7978  	// cond: c%5 == 0 && isPowerOfTwo(c/5)
  7979  	// result: (NEG (SLLconst <x.Type> [log64(c/5)] (ADDshiftLL <x.Type> x x [2])))
  7980  	for {
  7981  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
  7982  			x := v_0
  7983  			if v_1.Op != OpARM64MOVDconst {
  7984  				continue
  7985  			}
  7986  			c := auxIntToInt64(v_1.AuxInt)
  7987  			if !(c%5 == 0 && isPowerOfTwo(c/5)) {
  7988  				continue
  7989  			}
  7990  			v.reset(OpARM64NEG)
  7991  			v0 := b.NewValue0(v.Pos, OpARM64SLLconst, x.Type)
  7992  			v0.AuxInt = int64ToAuxInt(log64(c / 5))
  7993  			v1 := b.NewValue0(v.Pos, OpARM64ADDshiftLL, x.Type)
  7994  			v1.AuxInt = int64ToAuxInt(2)
  7995  			v1.AddArg2(x, x)
  7996  			v0.AddArg(v1)
  7997  			v.AddArg(v0)
  7998  			return true
  7999  		}
  8000  		break
  8001  	}
  8002  	// match: (MNEG x (MOVDconst [c]))
  8003  	// cond: c%7 == 0 && isPowerOfTwo(c/7)
  8004  	// result: (SLLconst <x.Type> [log64(c/7)] (SUBshiftLL <x.Type> x x [3]))
  8005  	for {
  8006  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
  8007  			x := v_0
  8008  			if v_1.Op != OpARM64MOVDconst {
  8009  				continue
  8010  			}
  8011  			c := auxIntToInt64(v_1.AuxInt)
  8012  			if !(c%7 == 0 && isPowerOfTwo(c/7)) {
  8013  				continue
  8014  			}
  8015  			v.reset(OpARM64SLLconst)
  8016  			v.Type = x.Type
  8017  			v.AuxInt = int64ToAuxInt(log64(c / 7))
  8018  			v0 := b.NewValue0(v.Pos, OpARM64SUBshiftLL, x.Type)
  8019  			v0.AuxInt = int64ToAuxInt(3)
  8020  			v0.AddArg2(x, x)
  8021  			v.AddArg(v0)
  8022  			return true
  8023  		}
  8024  		break
  8025  	}
  8026  	// match: (MNEG x (MOVDconst [c]))
  8027  	// cond: c%9 == 0 && isPowerOfTwo(c/9)
  8028  	// result: (NEG (SLLconst <x.Type> [log64(c/9)] (ADDshiftLL <x.Type> x x [3])))
  8029  	for {
  8030  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
  8031  			x := v_0
  8032  			if v_1.Op != OpARM64MOVDconst {
  8033  				continue
  8034  			}
  8035  			c := auxIntToInt64(v_1.AuxInt)
  8036  			if !(c%9 == 0 && isPowerOfTwo(c/9)) {
  8037  				continue
  8038  			}
  8039  			v.reset(OpARM64NEG)
  8040  			v0 := b.NewValue0(v.Pos, OpARM64SLLconst, x.Type)
  8041  			v0.AuxInt = int64ToAuxInt(log64(c / 9))
  8042  			v1 := b.NewValue0(v.Pos, OpARM64ADDshiftLL, x.Type)
  8043  			v1.AuxInt = int64ToAuxInt(3)
  8044  			v1.AddArg2(x, x)
  8045  			v0.AddArg(v1)
  8046  			v.AddArg(v0)
  8047  			return true
  8048  		}
  8049  		break
  8050  	}
  8051  	// match: (MNEG (MOVDconst [c]) (MOVDconst [d]))
  8052  	// result: (MOVDconst [-c*d])
  8053  	for {
  8054  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
  8055  			if v_0.Op != OpARM64MOVDconst {
  8056  				continue
  8057  			}
  8058  			c := auxIntToInt64(v_0.AuxInt)
  8059  			if v_1.Op != OpARM64MOVDconst {
  8060  				continue
  8061  			}
  8062  			d := auxIntToInt64(v_1.AuxInt)
  8063  			v.reset(OpARM64MOVDconst)
  8064  			v.AuxInt = int64ToAuxInt(-c * d)
  8065  			return true
  8066  		}
  8067  		break
  8068  	}
  8069  	return false
  8070  }
  8071  func rewriteValueARM64_OpARM64MNEGW(v *Value) bool {
  8072  	v_1 := v.Args[1]
  8073  	v_0 := v.Args[0]
  8074  	b := v.Block
  8075  	// match: (MNEGW x (MOVDconst [c]))
  8076  	// cond: int32(c)==-1
  8077  	// result: (MOVWUreg x)
  8078  	for {
  8079  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
  8080  			x := v_0
  8081  			if v_1.Op != OpARM64MOVDconst {
  8082  				continue
  8083  			}
  8084  			c := auxIntToInt64(v_1.AuxInt)
  8085  			if !(int32(c) == -1) {
  8086  				continue
  8087  			}
  8088  			v.reset(OpARM64MOVWUreg)
  8089  			v.AddArg(x)
  8090  			return true
  8091  		}
  8092  		break
  8093  	}
  8094  	// match: (MNEGW _ (MOVDconst [c]))
  8095  	// cond: int32(c)==0
  8096  	// result: (MOVDconst [0])
  8097  	for {
  8098  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
  8099  			if v_1.Op != OpARM64MOVDconst {
  8100  				continue
  8101  			}
  8102  			c := auxIntToInt64(v_1.AuxInt)
  8103  			if !(int32(c) == 0) {
  8104  				continue
  8105  			}
  8106  			v.reset(OpARM64MOVDconst)
  8107  			v.AuxInt = int64ToAuxInt(0)
  8108  			return true
  8109  		}
  8110  		break
  8111  	}
  8112  	// match: (MNEGW x (MOVDconst [c]))
  8113  	// cond: int32(c)==1
  8114  	// result: (MOVWUreg (NEG <x.Type> x))
  8115  	for {
  8116  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
  8117  			x := v_0
  8118  			if v_1.Op != OpARM64MOVDconst {
  8119  				continue
  8120  			}
  8121  			c := auxIntToInt64(v_1.AuxInt)
  8122  			if !(int32(c) == 1) {
  8123  				continue
  8124  			}
  8125  			v.reset(OpARM64MOVWUreg)
  8126  			v0 := b.NewValue0(v.Pos, OpARM64NEG, x.Type)
  8127  			v0.AddArg(x)
  8128  			v.AddArg(v0)
  8129  			return true
  8130  		}
  8131  		break
  8132  	}
  8133  	// match: (MNEGW x (MOVDconst [c]))
  8134  	// cond: isPowerOfTwo(c)
  8135  	// result: (NEG (SLLconst <x.Type> [log64(c)] x))
  8136  	for {
  8137  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
  8138  			x := v_0
  8139  			if v_1.Op != OpARM64MOVDconst {
  8140  				continue
  8141  			}
  8142  			c := auxIntToInt64(v_1.AuxInt)
  8143  			if !(isPowerOfTwo(c)) {
  8144  				continue
  8145  			}
  8146  			v.reset(OpARM64NEG)
  8147  			v0 := b.NewValue0(v.Pos, OpARM64SLLconst, x.Type)
  8148  			v0.AuxInt = int64ToAuxInt(log64(c))
  8149  			v0.AddArg(x)
  8150  			v.AddArg(v0)
  8151  			return true
  8152  		}
  8153  		break
  8154  	}
  8155  	// match: (MNEGW x (MOVDconst [c]))
  8156  	// cond: isPowerOfTwo(c-1) && int32(c) >= 3
  8157  	// result: (MOVWUreg (NEG <x.Type> (ADDshiftLL <x.Type> x x [log64(c-1)])))
  8158  	for {
  8159  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
  8160  			x := v_0
  8161  			if v_1.Op != OpARM64MOVDconst {
  8162  				continue
  8163  			}
  8164  			c := auxIntToInt64(v_1.AuxInt)
  8165  			if !(isPowerOfTwo(c-1) && int32(c) >= 3) {
  8166  				continue
  8167  			}
  8168  			v.reset(OpARM64MOVWUreg)
  8169  			v0 := b.NewValue0(v.Pos, OpARM64NEG, x.Type)
  8170  			v1 := b.NewValue0(v.Pos, OpARM64ADDshiftLL, x.Type)
  8171  			v1.AuxInt = int64ToAuxInt(log64(c - 1))
  8172  			v1.AddArg2(x, x)
  8173  			v0.AddArg(v1)
  8174  			v.AddArg(v0)
  8175  			return true
  8176  		}
  8177  		break
  8178  	}
  8179  	// match: (MNEGW x (MOVDconst [c]))
  8180  	// cond: isPowerOfTwo(c+1) && int32(c) >= 7
  8181  	// result: (MOVWUreg (NEG <x.Type> (ADDshiftLL <x.Type> (NEG <x.Type> x) x [log64(c+1)])))
  8182  	for {
  8183  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
  8184  			x := v_0
  8185  			if v_1.Op != OpARM64MOVDconst {
  8186  				continue
  8187  			}
  8188  			c := auxIntToInt64(v_1.AuxInt)
  8189  			if !(isPowerOfTwo(c+1) && int32(c) >= 7) {
  8190  				continue
  8191  			}
  8192  			v.reset(OpARM64MOVWUreg)
  8193  			v0 := b.NewValue0(v.Pos, OpARM64NEG, x.Type)
  8194  			v1 := b.NewValue0(v.Pos, OpARM64ADDshiftLL, x.Type)
  8195  			v1.AuxInt = int64ToAuxInt(log64(c + 1))
  8196  			v2 := b.NewValue0(v.Pos, OpARM64NEG, x.Type)
  8197  			v2.AddArg(x)
  8198  			v1.AddArg2(v2, x)
  8199  			v0.AddArg(v1)
  8200  			v.AddArg(v0)
  8201  			return true
  8202  		}
  8203  		break
  8204  	}
  8205  	// match: (MNEGW x (MOVDconst [c]))
  8206  	// cond: c%3 == 0 && isPowerOfTwo(c/3) && is32Bit(c)
  8207  	// result: (MOVWUreg (SLLconst <x.Type> [log64(c/3)] (SUBshiftLL <x.Type> x x [2])))
  8208  	for {
  8209  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
  8210  			x := v_0
  8211  			if v_1.Op != OpARM64MOVDconst {
  8212  				continue
  8213  			}
  8214  			c := auxIntToInt64(v_1.AuxInt)
  8215  			if !(c%3 == 0 && isPowerOfTwo(c/3) && is32Bit(c)) {
  8216  				continue
  8217  			}
  8218  			v.reset(OpARM64MOVWUreg)
  8219  			v0 := b.NewValue0(v.Pos, OpARM64SLLconst, x.Type)
  8220  			v0.AuxInt = int64ToAuxInt(log64(c / 3))
  8221  			v1 := b.NewValue0(v.Pos, OpARM64SUBshiftLL, x.Type)
  8222  			v1.AuxInt = int64ToAuxInt(2)
  8223  			v1.AddArg2(x, x)
  8224  			v0.AddArg(v1)
  8225  			v.AddArg(v0)
  8226  			return true
  8227  		}
  8228  		break
  8229  	}
  8230  	// match: (MNEGW x (MOVDconst [c]))
  8231  	// cond: c%5 == 0 && isPowerOfTwo(c/5) && is32Bit(c)
  8232  	// result: (MOVWUreg (NEG <x.Type> (SLLconst <x.Type> [log64(c/5)] (ADDshiftLL <x.Type> x x [2]))))
  8233  	for {
  8234  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
  8235  			x := v_0
  8236  			if v_1.Op != OpARM64MOVDconst {
  8237  				continue
  8238  			}
  8239  			c := auxIntToInt64(v_1.AuxInt)
  8240  			if !(c%5 == 0 && isPowerOfTwo(c/5) && is32Bit(c)) {
  8241  				continue
  8242  			}
  8243  			v.reset(OpARM64MOVWUreg)
  8244  			v0 := b.NewValue0(v.Pos, OpARM64NEG, x.Type)
  8245  			v1 := b.NewValue0(v.Pos, OpARM64SLLconst, x.Type)
  8246  			v1.AuxInt = int64ToAuxInt(log64(c / 5))
  8247  			v2 := b.NewValue0(v.Pos, OpARM64ADDshiftLL, x.Type)
  8248  			v2.AuxInt = int64ToAuxInt(2)
  8249  			v2.AddArg2(x, x)
  8250  			v1.AddArg(v2)
  8251  			v0.AddArg(v1)
  8252  			v.AddArg(v0)
  8253  			return true
  8254  		}
  8255  		break
  8256  	}
  8257  	// match: (MNEGW x (MOVDconst [c]))
  8258  	// cond: c%7 == 0 && isPowerOfTwo(c/7) && is32Bit(c)
  8259  	// result: (MOVWUreg (SLLconst <x.Type> [log64(c/7)] (SUBshiftLL <x.Type> x x [3])))
  8260  	for {
  8261  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
  8262  			x := v_0
  8263  			if v_1.Op != OpARM64MOVDconst {
  8264  				continue
  8265  			}
  8266  			c := auxIntToInt64(v_1.AuxInt)
  8267  			if !(c%7 == 0 && isPowerOfTwo(c/7) && is32Bit(c)) {
  8268  				continue
  8269  			}
  8270  			v.reset(OpARM64MOVWUreg)
  8271  			v0 := b.NewValue0(v.Pos, OpARM64SLLconst, x.Type)
  8272  			v0.AuxInt = int64ToAuxInt(log64(c / 7))
  8273  			v1 := b.NewValue0(v.Pos, OpARM64SUBshiftLL, x.Type)
  8274  			v1.AuxInt = int64ToAuxInt(3)
  8275  			v1.AddArg2(x, x)
  8276  			v0.AddArg(v1)
  8277  			v.AddArg(v0)
  8278  			return true
  8279  		}
  8280  		break
  8281  	}
  8282  	// match: (MNEGW x (MOVDconst [c]))
  8283  	// cond: c%9 == 0 && isPowerOfTwo(c/9) && is32Bit(c)
  8284  	// result: (MOVWUreg (NEG <x.Type> (SLLconst <x.Type> [log64(c/9)] (ADDshiftLL <x.Type> x x [3]))))
  8285  	for {
  8286  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
  8287  			x := v_0
  8288  			if v_1.Op != OpARM64MOVDconst {
  8289  				continue
  8290  			}
  8291  			c := auxIntToInt64(v_1.AuxInt)
  8292  			if !(c%9 == 0 && isPowerOfTwo(c/9) && is32Bit(c)) {
  8293  				continue
  8294  			}
  8295  			v.reset(OpARM64MOVWUreg)
  8296  			v0 := b.NewValue0(v.Pos, OpARM64NEG, x.Type)
  8297  			v1 := b.NewValue0(v.Pos, OpARM64SLLconst, x.Type)
  8298  			v1.AuxInt = int64ToAuxInt(log64(c / 9))
  8299  			v2 := b.NewValue0(v.Pos, OpARM64ADDshiftLL, x.Type)
  8300  			v2.AuxInt = int64ToAuxInt(3)
  8301  			v2.AddArg2(x, x)
  8302  			v1.AddArg(v2)
  8303  			v0.AddArg(v1)
  8304  			v.AddArg(v0)
  8305  			return true
  8306  		}
  8307  		break
  8308  	}
  8309  	// match: (MNEGW (MOVDconst [c]) (MOVDconst [d]))
  8310  	// result: (MOVDconst [int64(uint32(-c*d))])
  8311  	for {
  8312  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
  8313  			if v_0.Op != OpARM64MOVDconst {
  8314  				continue
  8315  			}
  8316  			c := auxIntToInt64(v_0.AuxInt)
  8317  			if v_1.Op != OpARM64MOVDconst {
  8318  				continue
  8319  			}
  8320  			d := auxIntToInt64(v_1.AuxInt)
  8321  			v.reset(OpARM64MOVDconst)
  8322  			v.AuxInt = int64ToAuxInt(int64(uint32(-c * d)))
  8323  			return true
  8324  		}
  8325  		break
  8326  	}
  8327  	return false
  8328  }
  8329  func rewriteValueARM64_OpARM64MOD(v *Value) bool {
  8330  	v_1 := v.Args[1]
  8331  	v_0 := v.Args[0]
  8332  	// match: (MOD (MOVDconst [c]) (MOVDconst [d]))
  8333  	// cond: d != 0
  8334  	// result: (MOVDconst [c%d])
  8335  	for {
  8336  		if v_0.Op != OpARM64MOVDconst {
  8337  			break
  8338  		}
  8339  		c := auxIntToInt64(v_0.AuxInt)
  8340  		if v_1.Op != OpARM64MOVDconst {
  8341  			break
  8342  		}
  8343  		d := auxIntToInt64(v_1.AuxInt)
  8344  		if !(d != 0) {
  8345  			break
  8346  		}
  8347  		v.reset(OpARM64MOVDconst)
  8348  		v.AuxInt = int64ToAuxInt(c % d)
  8349  		return true
  8350  	}
  8351  	return false
  8352  }
  8353  func rewriteValueARM64_OpARM64MODW(v *Value) bool {
  8354  	v_1 := v.Args[1]
  8355  	v_0 := v.Args[0]
  8356  	// match: (MODW (MOVDconst [c]) (MOVDconst [d]))
  8357  	// cond: d != 0
  8358  	// result: (MOVDconst [int64(uint32(int32(c)%int32(d)))])
  8359  	for {
  8360  		if v_0.Op != OpARM64MOVDconst {
  8361  			break
  8362  		}
  8363  		c := auxIntToInt64(v_0.AuxInt)
  8364  		if v_1.Op != OpARM64MOVDconst {
  8365  			break
  8366  		}
  8367  		d := auxIntToInt64(v_1.AuxInt)
  8368  		if !(d != 0) {
  8369  			break
  8370  		}
  8371  		v.reset(OpARM64MOVDconst)
  8372  		v.AuxInt = int64ToAuxInt(int64(uint32(int32(c) % int32(d))))
  8373  		return true
  8374  	}
  8375  	return false
  8376  }
  8377  func rewriteValueARM64_OpARM64MOVBUload(v *Value) bool {
  8378  	v_1 := v.Args[1]
  8379  	v_0 := v.Args[0]
  8380  	b := v.Block
  8381  	config := b.Func.Config
  8382  	// match: (MOVBUload [off1] {sym} (ADDconst [off2] ptr) mem)
  8383  	// cond: is32Bit(int64(off1)+off2) && (ptr.Op != OpSB || !config.ctxt.Flag_dynlink)
  8384  	// result: (MOVBUload [off1+int32(off2)] {sym} ptr mem)
  8385  	for {
  8386  		off1 := auxIntToInt32(v.AuxInt)
  8387  		sym := auxToSym(v.Aux)
  8388  		if v_0.Op != OpARM64ADDconst {
  8389  			break
  8390  		}
  8391  		off2 := auxIntToInt64(v_0.AuxInt)
  8392  		ptr := v_0.Args[0]
  8393  		mem := v_1
  8394  		if !(is32Bit(int64(off1)+off2) && (ptr.Op != OpSB || !config.ctxt.Flag_dynlink)) {
  8395  			break
  8396  		}
  8397  		v.reset(OpARM64MOVBUload)
  8398  		v.AuxInt = int32ToAuxInt(off1 + int32(off2))
  8399  		v.Aux = symToAux(sym)
  8400  		v.AddArg2(ptr, mem)
  8401  		return true
  8402  	}
  8403  	// match: (MOVBUload [off] {sym} (ADD ptr idx) mem)
  8404  	// cond: off == 0 && sym == nil
  8405  	// result: (MOVBUloadidx ptr idx mem)
  8406  	for {
  8407  		off := auxIntToInt32(v.AuxInt)
  8408  		sym := auxToSym(v.Aux)
  8409  		if v_0.Op != OpARM64ADD {
  8410  			break
  8411  		}
  8412  		idx := v_0.Args[1]
  8413  		ptr := v_0.Args[0]
  8414  		mem := v_1
  8415  		if !(off == 0 && sym == nil) {
  8416  			break
  8417  		}
  8418  		v.reset(OpARM64MOVBUloadidx)
  8419  		v.AddArg3(ptr, idx, mem)
  8420  		return true
  8421  	}
  8422  	// match: (MOVBUload [off1] {sym1} (MOVDaddr [off2] {sym2} ptr) mem)
  8423  	// cond: canMergeSym(sym1,sym2) && is32Bit(int64(off1)+int64(off2)) && (ptr.Op != OpSB || !config.ctxt.Flag_dynlink)
  8424  	// result: (MOVBUload [off1+off2] {mergeSym(sym1,sym2)} ptr mem)
  8425  	for {
  8426  		off1 := auxIntToInt32(v.AuxInt)
  8427  		sym1 := auxToSym(v.Aux)
  8428  		if v_0.Op != OpARM64MOVDaddr {
  8429  			break
  8430  		}
  8431  		off2 := auxIntToInt32(v_0.AuxInt)
  8432  		sym2 := auxToSym(v_0.Aux)
  8433  		ptr := v_0.Args[0]
  8434  		mem := v_1
  8435  		if !(canMergeSym(sym1, sym2) && is32Bit(int64(off1)+int64(off2)) && (ptr.Op != OpSB || !config.ctxt.Flag_dynlink)) {
  8436  			break
  8437  		}
  8438  		v.reset(OpARM64MOVBUload)
  8439  		v.AuxInt = int32ToAuxInt(off1 + off2)
  8440  		v.Aux = symToAux(mergeSym(sym1, sym2))
  8441  		v.AddArg2(ptr, mem)
  8442  		return true
  8443  	}
  8444  	// match: (MOVBUload [off] {sym} (SB) _)
  8445  	// cond: symIsRO(sym)
  8446  	// result: (MOVDconst [int64(read8(sym, int64(off)))])
  8447  	for {
  8448  		off := auxIntToInt32(v.AuxInt)
  8449  		sym := auxToSym(v.Aux)
  8450  		if v_0.Op != OpSB || !(symIsRO(sym)) {
  8451  			break
  8452  		}
  8453  		v.reset(OpARM64MOVDconst)
  8454  		v.AuxInt = int64ToAuxInt(int64(read8(sym, int64(off))))
  8455  		return true
  8456  	}
  8457  	return false
  8458  }
  8459  func rewriteValueARM64_OpARM64MOVBUloadidx(v *Value) bool {
  8460  	v_2 := v.Args[2]
  8461  	v_1 := v.Args[1]
  8462  	v_0 := v.Args[0]
  8463  	// match: (MOVBUloadidx ptr (MOVDconst [c]) mem)
  8464  	// cond: is32Bit(c)
  8465  	// result: (MOVBUload [int32(c)] ptr mem)
  8466  	for {
  8467  		ptr := v_0
  8468  		if v_1.Op != OpARM64MOVDconst {
  8469  			break
  8470  		}
  8471  		c := auxIntToInt64(v_1.AuxInt)
  8472  		mem := v_2
  8473  		if !(is32Bit(c)) {
  8474  			break
  8475  		}
  8476  		v.reset(OpARM64MOVBUload)
  8477  		v.AuxInt = int32ToAuxInt(int32(c))
  8478  		v.AddArg2(ptr, mem)
  8479  		return true
  8480  	}
  8481  	// match: (MOVBUloadidx (MOVDconst [c]) ptr mem)
  8482  	// cond: is32Bit(c)
  8483  	// result: (MOVBUload [int32(c)] ptr mem)
  8484  	for {
  8485  		if v_0.Op != OpARM64MOVDconst {
  8486  			break
  8487  		}
  8488  		c := auxIntToInt64(v_0.AuxInt)
  8489  		ptr := v_1
  8490  		mem := v_2
  8491  		if !(is32Bit(c)) {
  8492  			break
  8493  		}
  8494  		v.reset(OpARM64MOVBUload)
  8495  		v.AuxInt = int32ToAuxInt(int32(c))
  8496  		v.AddArg2(ptr, mem)
  8497  		return true
  8498  	}
  8499  	return false
  8500  }
  8501  func rewriteValueARM64_OpARM64MOVBUreg(v *Value) bool {
  8502  	v_0 := v.Args[0]
  8503  	// match: (MOVBUreg (ANDconst [c] x))
  8504  	// result: (ANDconst [c&(1<<8-1)] x)
  8505  	for {
  8506  		if v_0.Op != OpARM64ANDconst {
  8507  			break
  8508  		}
  8509  		c := auxIntToInt64(v_0.AuxInt)
  8510  		x := v_0.Args[0]
  8511  		v.reset(OpARM64ANDconst)
  8512  		v.AuxInt = int64ToAuxInt(c & (1<<8 - 1))
  8513  		v.AddArg(x)
  8514  		return true
  8515  	}
  8516  	// match: (MOVBUreg (MOVDconst [c]))
  8517  	// result: (MOVDconst [int64(uint8(c))])
  8518  	for {
  8519  		if v_0.Op != OpARM64MOVDconst {
  8520  			break
  8521  		}
  8522  		c := auxIntToInt64(v_0.AuxInt)
  8523  		v.reset(OpARM64MOVDconst)
  8524  		v.AuxInt = int64ToAuxInt(int64(uint8(c)))
  8525  		return true
  8526  	}
  8527  	// match: (MOVBUreg x)
  8528  	// cond: v.Type.Size() <= 1
  8529  	// result: x
  8530  	for {
  8531  		x := v_0
  8532  		if !(v.Type.Size() <= 1) {
  8533  			break
  8534  		}
  8535  		v.copyOf(x)
  8536  		return true
  8537  	}
  8538  	// match: (MOVBUreg (SLLconst [lc] x))
  8539  	// cond: lc >= 8
  8540  	// result: (MOVDconst [0])
  8541  	for {
  8542  		if v_0.Op != OpARM64SLLconst {
  8543  			break
  8544  		}
  8545  		lc := auxIntToInt64(v_0.AuxInt)
  8546  		if !(lc >= 8) {
  8547  			break
  8548  		}
  8549  		v.reset(OpARM64MOVDconst)
  8550  		v.AuxInt = int64ToAuxInt(0)
  8551  		return true
  8552  	}
  8553  	// match: (MOVBUreg (SLLconst [lc] x))
  8554  	// cond: lc < 8
  8555  	// result: (UBFIZ [armBFAuxInt(lc, 8-lc)] x)
  8556  	for {
  8557  		if v_0.Op != OpARM64SLLconst {
  8558  			break
  8559  		}
  8560  		lc := auxIntToInt64(v_0.AuxInt)
  8561  		x := v_0.Args[0]
  8562  		if !(lc < 8) {
  8563  			break
  8564  		}
  8565  		v.reset(OpARM64UBFIZ)
  8566  		v.AuxInt = arm64BitFieldToAuxInt(armBFAuxInt(lc, 8-lc))
  8567  		v.AddArg(x)
  8568  		return true
  8569  	}
  8570  	// match: (MOVBUreg (SRLconst [rc] x))
  8571  	// cond: rc < 8
  8572  	// result: (UBFX [armBFAuxInt(rc, 8)] x)
  8573  	for {
  8574  		if v_0.Op != OpARM64SRLconst {
  8575  			break
  8576  		}
  8577  		rc := auxIntToInt64(v_0.AuxInt)
  8578  		x := v_0.Args[0]
  8579  		if !(rc < 8) {
  8580  			break
  8581  		}
  8582  		v.reset(OpARM64UBFX)
  8583  		v.AuxInt = arm64BitFieldToAuxInt(armBFAuxInt(rc, 8))
  8584  		v.AddArg(x)
  8585  		return true
  8586  	}
  8587  	// match: (MOVBUreg (UBFX [bfc] x))
  8588  	// cond: bfc.width() <= 8
  8589  	// result: (UBFX [bfc] x)
  8590  	for {
  8591  		if v_0.Op != OpARM64UBFX {
  8592  			break
  8593  		}
  8594  		bfc := auxIntToArm64BitField(v_0.AuxInt)
  8595  		x := v_0.Args[0]
  8596  		if !(bfc.width() <= 8) {
  8597  			break
  8598  		}
  8599  		v.reset(OpARM64UBFX)
  8600  		v.AuxInt = arm64BitFieldToAuxInt(bfc)
  8601  		v.AddArg(x)
  8602  		return true
  8603  	}
  8604  	return false
  8605  }
  8606  func rewriteValueARM64_OpARM64MOVBload(v *Value) bool {
  8607  	v_1 := v.Args[1]
  8608  	v_0 := v.Args[0]
  8609  	b := v.Block
  8610  	config := b.Func.Config
  8611  	// match: (MOVBload [off1] {sym} (ADDconst [off2] ptr) mem)
  8612  	// cond: is32Bit(int64(off1)+off2) && (ptr.Op != OpSB || !config.ctxt.Flag_dynlink)
  8613  	// result: (MOVBload [off1+int32(off2)] {sym} ptr mem)
  8614  	for {
  8615  		off1 := auxIntToInt32(v.AuxInt)
  8616  		sym := auxToSym(v.Aux)
  8617  		if v_0.Op != OpARM64ADDconst {
  8618  			break
  8619  		}
  8620  		off2 := auxIntToInt64(v_0.AuxInt)
  8621  		ptr := v_0.Args[0]
  8622  		mem := v_1
  8623  		if !(is32Bit(int64(off1)+off2) && (ptr.Op != OpSB || !config.ctxt.Flag_dynlink)) {
  8624  			break
  8625  		}
  8626  		v.reset(OpARM64MOVBload)
  8627  		v.AuxInt = int32ToAuxInt(off1 + int32(off2))
  8628  		v.Aux = symToAux(sym)
  8629  		v.AddArg2(ptr, mem)
  8630  		return true
  8631  	}
  8632  	// match: (MOVBload [off] {sym} (ADD ptr idx) mem)
  8633  	// cond: off == 0 && sym == nil
  8634  	// result: (MOVBloadidx ptr idx mem)
  8635  	for {
  8636  		off := auxIntToInt32(v.AuxInt)
  8637  		sym := auxToSym(v.Aux)
  8638  		if v_0.Op != OpARM64ADD {
  8639  			break
  8640  		}
  8641  		idx := v_0.Args[1]
  8642  		ptr := v_0.Args[0]
  8643  		mem := v_1
  8644  		if !(off == 0 && sym == nil) {
  8645  			break
  8646  		}
  8647  		v.reset(OpARM64MOVBloadidx)
  8648  		v.AddArg3(ptr, idx, mem)
  8649  		return true
  8650  	}
  8651  	// match: (MOVBload [off1] {sym1} (MOVDaddr [off2] {sym2} ptr) mem)
  8652  	// cond: canMergeSym(sym1,sym2) && is32Bit(int64(off1)+int64(off2)) && (ptr.Op != OpSB || !config.ctxt.Flag_dynlink)
  8653  	// result: (MOVBload [off1+off2] {mergeSym(sym1,sym2)} ptr mem)
  8654  	for {
  8655  		off1 := auxIntToInt32(v.AuxInt)
  8656  		sym1 := auxToSym(v.Aux)
  8657  		if v_0.Op != OpARM64MOVDaddr {
  8658  			break
  8659  		}
  8660  		off2 := auxIntToInt32(v_0.AuxInt)
  8661  		sym2 := auxToSym(v_0.Aux)
  8662  		ptr := v_0.Args[0]
  8663  		mem := v_1
  8664  		if !(canMergeSym(sym1, sym2) && is32Bit(int64(off1)+int64(off2)) && (ptr.Op != OpSB || !config.ctxt.Flag_dynlink)) {
  8665  			break
  8666  		}
  8667  		v.reset(OpARM64MOVBload)
  8668  		v.AuxInt = int32ToAuxInt(off1 + off2)
  8669  		v.Aux = symToAux(mergeSym(sym1, sym2))
  8670  		v.AddArg2(ptr, mem)
  8671  		return true
  8672  	}
  8673  	// match: (MOVBload [off] {sym} (SB) _)
  8674  	// cond: symIsRO(sym)
  8675  	// result: (MOVDconst [int64(int8(read8(sym, int64(off))))])
  8676  	for {
  8677  		off := auxIntToInt32(v.AuxInt)
  8678  		sym := auxToSym(v.Aux)
  8679  		if v_0.Op != OpSB || !(symIsRO(sym)) {
  8680  			break
  8681  		}
  8682  		v.reset(OpARM64MOVDconst)
  8683  		v.AuxInt = int64ToAuxInt(int64(int8(read8(sym, int64(off)))))
  8684  		return true
  8685  	}
  8686  	return false
  8687  }
  8688  func rewriteValueARM64_OpARM64MOVBloadidx(v *Value) bool {
  8689  	v_2 := v.Args[2]
  8690  	v_1 := v.Args[1]
  8691  	v_0 := v.Args[0]
  8692  	// match: (MOVBloadidx ptr (MOVDconst [c]) mem)
  8693  	// cond: is32Bit(c)
  8694  	// result: (MOVBload [int32(c)] ptr mem)
  8695  	for {
  8696  		ptr := v_0
  8697  		if v_1.Op != OpARM64MOVDconst {
  8698  			break
  8699  		}
  8700  		c := auxIntToInt64(v_1.AuxInt)
  8701  		mem := v_2
  8702  		if !(is32Bit(c)) {
  8703  			break
  8704  		}
  8705  		v.reset(OpARM64MOVBload)
  8706  		v.AuxInt = int32ToAuxInt(int32(c))
  8707  		v.AddArg2(ptr, mem)
  8708  		return true
  8709  	}
  8710  	// match: (MOVBloadidx (MOVDconst [c]) ptr mem)
  8711  	// cond: is32Bit(c)
  8712  	// result: (MOVBload [int32(c)] ptr mem)
  8713  	for {
  8714  		if v_0.Op != OpARM64MOVDconst {
  8715  			break
  8716  		}
  8717  		c := auxIntToInt64(v_0.AuxInt)
  8718  		ptr := v_1
  8719  		mem := v_2
  8720  		if !(is32Bit(c)) {
  8721  			break
  8722  		}
  8723  		v.reset(OpARM64MOVBload)
  8724  		v.AuxInt = int32ToAuxInt(int32(c))
  8725  		v.AddArg2(ptr, mem)
  8726  		return true
  8727  	}
  8728  	return false
  8729  }
  8730  func rewriteValueARM64_OpARM64MOVBreg(v *Value) bool {
  8731  	v_0 := v.Args[0]
  8732  	// match: (MOVBreg (MOVDconst [c]))
  8733  	// result: (MOVDconst [int64(int8(c))])
  8734  	for {
  8735  		if v_0.Op != OpARM64MOVDconst {
  8736  			break
  8737  		}
  8738  		c := auxIntToInt64(v_0.AuxInt)
  8739  		v.reset(OpARM64MOVDconst)
  8740  		v.AuxInt = int64ToAuxInt(int64(int8(c)))
  8741  		return true
  8742  	}
  8743  	// match: (MOVBreg x)
  8744  	// cond: v.Type.Size() <= 1
  8745  	// result: x
  8746  	for {
  8747  		x := v_0
  8748  		if !(v.Type.Size() <= 1) {
  8749  			break
  8750  		}
  8751  		v.copyOf(x)
  8752  		return true
  8753  	}
  8754  	// match: (MOVBreg <t> (ANDconst x [c]))
  8755  	// cond: uint64(c) & uint64(0xffffffffffffff80) == 0
  8756  	// result: (ANDconst <t> x [c])
  8757  	for {
  8758  		t := v.Type
  8759  		if v_0.Op != OpARM64ANDconst {
  8760  			break
  8761  		}
  8762  		c := auxIntToInt64(v_0.AuxInt)
  8763  		x := v_0.Args[0]
  8764  		if !(uint64(c)&uint64(0xffffffffffffff80) == 0) {
  8765  			break
  8766  		}
  8767  		v.reset(OpARM64ANDconst)
  8768  		v.Type = t
  8769  		v.AuxInt = int64ToAuxInt(c)
  8770  		v.AddArg(x)
  8771  		return true
  8772  	}
  8773  	// match: (MOVBreg (SLLconst [lc] x))
  8774  	// cond: lc < 8
  8775  	// result: (SBFIZ [armBFAuxInt(lc, 8-lc)] x)
  8776  	for {
  8777  		if v_0.Op != OpARM64SLLconst {
  8778  			break
  8779  		}
  8780  		lc := auxIntToInt64(v_0.AuxInt)
  8781  		x := v_0.Args[0]
  8782  		if !(lc < 8) {
  8783  			break
  8784  		}
  8785  		v.reset(OpARM64SBFIZ)
  8786  		v.AuxInt = arm64BitFieldToAuxInt(armBFAuxInt(lc, 8-lc))
  8787  		v.AddArg(x)
  8788  		return true
  8789  	}
  8790  	// match: (MOVBreg (SBFX [bfc] x))
  8791  	// cond: bfc.width() <= 8
  8792  	// result: (SBFX [bfc] x)
  8793  	for {
  8794  		if v_0.Op != OpARM64SBFX {
  8795  			break
  8796  		}
  8797  		bfc := auxIntToArm64BitField(v_0.AuxInt)
  8798  		x := v_0.Args[0]
  8799  		if !(bfc.width() <= 8) {
  8800  			break
  8801  		}
  8802  		v.reset(OpARM64SBFX)
  8803  		v.AuxInt = arm64BitFieldToAuxInt(bfc)
  8804  		v.AddArg(x)
  8805  		return true
  8806  	}
  8807  	return false
  8808  }
  8809  func rewriteValueARM64_OpARM64MOVBstore(v *Value) bool {
  8810  	v_2 := v.Args[2]
  8811  	v_1 := v.Args[1]
  8812  	v_0 := v.Args[0]
  8813  	b := v.Block
  8814  	config := b.Func.Config
  8815  	// match: (MOVBstore [off1] {sym} (ADDconst [off2] ptr) val mem)
  8816  	// cond: is32Bit(int64(off1)+off2) && (ptr.Op != OpSB || !config.ctxt.Flag_dynlink)
  8817  	// result: (MOVBstore [off1+int32(off2)] {sym} ptr val mem)
  8818  	for {
  8819  		off1 := auxIntToInt32(v.AuxInt)
  8820  		sym := auxToSym(v.Aux)
  8821  		if v_0.Op != OpARM64ADDconst {
  8822  			break
  8823  		}
  8824  		off2 := auxIntToInt64(v_0.AuxInt)
  8825  		ptr := v_0.Args[0]
  8826  		val := v_1
  8827  		mem := v_2
  8828  		if !(is32Bit(int64(off1)+off2) && (ptr.Op != OpSB || !config.ctxt.Flag_dynlink)) {
  8829  			break
  8830  		}
  8831  		v.reset(OpARM64MOVBstore)
  8832  		v.AuxInt = int32ToAuxInt(off1 + int32(off2))
  8833  		v.Aux = symToAux(sym)
  8834  		v.AddArg3(ptr, val, mem)
  8835  		return true
  8836  	}
  8837  	// match: (MOVBstore [off] {sym} (ADD ptr idx) val mem)
  8838  	// cond: off == 0 && sym == nil
  8839  	// result: (MOVBstoreidx ptr idx val mem)
  8840  	for {
  8841  		off := auxIntToInt32(v.AuxInt)
  8842  		sym := auxToSym(v.Aux)
  8843  		if v_0.Op != OpARM64ADD {
  8844  			break
  8845  		}
  8846  		idx := v_0.Args[1]
  8847  		ptr := v_0.Args[0]
  8848  		val := v_1
  8849  		mem := v_2
  8850  		if !(off == 0 && sym == nil) {
  8851  			break
  8852  		}
  8853  		v.reset(OpARM64MOVBstoreidx)
  8854  		v.AddArg4(ptr, idx, val, mem)
  8855  		return true
  8856  	}
  8857  	// match: (MOVBstore [off1] {sym1} (MOVDaddr [off2] {sym2} ptr) val mem)
  8858  	// cond: canMergeSym(sym1,sym2) && is32Bit(int64(off1)+int64(off2)) && (ptr.Op != OpSB || !config.ctxt.Flag_dynlink)
  8859  	// result: (MOVBstore [off1+off2] {mergeSym(sym1,sym2)} ptr val mem)
  8860  	for {
  8861  		off1 := auxIntToInt32(v.AuxInt)
  8862  		sym1 := auxToSym(v.Aux)
  8863  		if v_0.Op != OpARM64MOVDaddr {
  8864  			break
  8865  		}
  8866  		off2 := auxIntToInt32(v_0.AuxInt)
  8867  		sym2 := auxToSym(v_0.Aux)
  8868  		ptr := v_0.Args[0]
  8869  		val := v_1
  8870  		mem := v_2
  8871  		if !(canMergeSym(sym1, sym2) && is32Bit(int64(off1)+int64(off2)) && (ptr.Op != OpSB || !config.ctxt.Flag_dynlink)) {
  8872  			break
  8873  		}
  8874  		v.reset(OpARM64MOVBstore)
  8875  		v.AuxInt = int32ToAuxInt(off1 + off2)
  8876  		v.Aux = symToAux(mergeSym(sym1, sym2))
  8877  		v.AddArg3(ptr, val, mem)
  8878  		return true
  8879  	}
  8880  	// match: (MOVBstore [off] {sym} ptr (MOVBreg x) mem)
  8881  	// result: (MOVBstore [off] {sym} ptr x mem)
  8882  	for {
  8883  		off := auxIntToInt32(v.AuxInt)
  8884  		sym := auxToSym(v.Aux)
  8885  		ptr := v_0
  8886  		if v_1.Op != OpARM64MOVBreg {
  8887  			break
  8888  		}
  8889  		x := v_1.Args[0]
  8890  		mem := v_2
  8891  		v.reset(OpARM64MOVBstore)
  8892  		v.AuxInt = int32ToAuxInt(off)
  8893  		v.Aux = symToAux(sym)
  8894  		v.AddArg3(ptr, x, mem)
  8895  		return true
  8896  	}
  8897  	// match: (MOVBstore [off] {sym} ptr (MOVBUreg x) mem)
  8898  	// result: (MOVBstore [off] {sym} ptr x mem)
  8899  	for {
  8900  		off := auxIntToInt32(v.AuxInt)
  8901  		sym := auxToSym(v.Aux)
  8902  		ptr := v_0
  8903  		if v_1.Op != OpARM64MOVBUreg {
  8904  			break
  8905  		}
  8906  		x := v_1.Args[0]
  8907  		mem := v_2
  8908  		v.reset(OpARM64MOVBstore)
  8909  		v.AuxInt = int32ToAuxInt(off)
  8910  		v.Aux = symToAux(sym)
  8911  		v.AddArg3(ptr, x, mem)
  8912  		return true
  8913  	}
  8914  	// match: (MOVBstore [off] {sym} ptr (MOVHreg x) mem)
  8915  	// result: (MOVBstore [off] {sym} ptr x mem)
  8916  	for {
  8917  		off := auxIntToInt32(v.AuxInt)
  8918  		sym := auxToSym(v.Aux)
  8919  		ptr := v_0
  8920  		if v_1.Op != OpARM64MOVHreg {
  8921  			break
  8922  		}
  8923  		x := v_1.Args[0]
  8924  		mem := v_2
  8925  		v.reset(OpARM64MOVBstore)
  8926  		v.AuxInt = int32ToAuxInt(off)
  8927  		v.Aux = symToAux(sym)
  8928  		v.AddArg3(ptr, x, mem)
  8929  		return true
  8930  	}
  8931  	// match: (MOVBstore [off] {sym} ptr (MOVHUreg x) mem)
  8932  	// result: (MOVBstore [off] {sym} ptr x mem)
  8933  	for {
  8934  		off := auxIntToInt32(v.AuxInt)
  8935  		sym := auxToSym(v.Aux)
  8936  		ptr := v_0
  8937  		if v_1.Op != OpARM64MOVHUreg {
  8938  			break
  8939  		}
  8940  		x := v_1.Args[0]
  8941  		mem := v_2
  8942  		v.reset(OpARM64MOVBstore)
  8943  		v.AuxInt = int32ToAuxInt(off)
  8944  		v.Aux = symToAux(sym)
  8945  		v.AddArg3(ptr, x, mem)
  8946  		return true
  8947  	}
  8948  	// match: (MOVBstore [off] {sym} ptr (MOVWreg x) mem)
  8949  	// result: (MOVBstore [off] {sym} ptr x mem)
  8950  	for {
  8951  		off := auxIntToInt32(v.AuxInt)
  8952  		sym := auxToSym(v.Aux)
  8953  		ptr := v_0
  8954  		if v_1.Op != OpARM64MOVWreg {
  8955  			break
  8956  		}
  8957  		x := v_1.Args[0]
  8958  		mem := v_2
  8959  		v.reset(OpARM64MOVBstore)
  8960  		v.AuxInt = int32ToAuxInt(off)
  8961  		v.Aux = symToAux(sym)
  8962  		v.AddArg3(ptr, x, mem)
  8963  		return true
  8964  	}
  8965  	// match: (MOVBstore [off] {sym} ptr (MOVWUreg x) mem)
  8966  	// result: (MOVBstore [off] {sym} ptr x mem)
  8967  	for {
  8968  		off := auxIntToInt32(v.AuxInt)
  8969  		sym := auxToSym(v.Aux)
  8970  		ptr := v_0
  8971  		if v_1.Op != OpARM64MOVWUreg {
  8972  			break
  8973  		}
  8974  		x := v_1.Args[0]
  8975  		mem := v_2
  8976  		v.reset(OpARM64MOVBstore)
  8977  		v.AuxInt = int32ToAuxInt(off)
  8978  		v.Aux = symToAux(sym)
  8979  		v.AddArg3(ptr, x, mem)
  8980  		return true
  8981  	}
  8982  	return false
  8983  }
  8984  func rewriteValueARM64_OpARM64MOVBstoreidx(v *Value) bool {
  8985  	v_3 := v.Args[3]
  8986  	v_2 := v.Args[2]
  8987  	v_1 := v.Args[1]
  8988  	v_0 := v.Args[0]
  8989  	// match: (MOVBstoreidx ptr (MOVDconst [c]) val mem)
  8990  	// cond: is32Bit(c)
  8991  	// result: (MOVBstore [int32(c)] ptr val mem)
  8992  	for {
  8993  		ptr := v_0
  8994  		if v_1.Op != OpARM64MOVDconst {
  8995  			break
  8996  		}
  8997  		c := auxIntToInt64(v_1.AuxInt)
  8998  		val := v_2
  8999  		mem := v_3
  9000  		if !(is32Bit(c)) {
  9001  			break
  9002  		}
  9003  		v.reset(OpARM64MOVBstore)
  9004  		v.AuxInt = int32ToAuxInt(int32(c))
  9005  		v.AddArg3(ptr, val, mem)
  9006  		return true
  9007  	}
  9008  	// match: (MOVBstoreidx (MOVDconst [c]) idx val mem)
  9009  	// cond: is32Bit(c)
  9010  	// result: (MOVBstore [int32(c)] idx val mem)
  9011  	for {
  9012  		if v_0.Op != OpARM64MOVDconst {
  9013  			break
  9014  		}
  9015  		c := auxIntToInt64(v_0.AuxInt)
  9016  		idx := v_1
  9017  		val := v_2
  9018  		mem := v_3
  9019  		if !(is32Bit(c)) {
  9020  			break
  9021  		}
  9022  		v.reset(OpARM64MOVBstore)
  9023  		v.AuxInt = int32ToAuxInt(int32(c))
  9024  		v.AddArg3(idx, val, mem)
  9025  		return true
  9026  	}
  9027  	// match: (MOVBstoreidx ptr idx (MOVBreg x) mem)
  9028  	// result: (MOVBstoreidx ptr idx x mem)
  9029  	for {
  9030  		ptr := v_0
  9031  		idx := v_1
  9032  		if v_2.Op != OpARM64MOVBreg {
  9033  			break
  9034  		}
  9035  		x := v_2.Args[0]
  9036  		mem := v_3
  9037  		v.reset(OpARM64MOVBstoreidx)
  9038  		v.AddArg4(ptr, idx, x, mem)
  9039  		return true
  9040  	}
  9041  	// match: (MOVBstoreidx ptr idx (MOVBUreg x) mem)
  9042  	// result: (MOVBstoreidx ptr idx x mem)
  9043  	for {
  9044  		ptr := v_0
  9045  		idx := v_1
  9046  		if v_2.Op != OpARM64MOVBUreg {
  9047  			break
  9048  		}
  9049  		x := v_2.Args[0]
  9050  		mem := v_3
  9051  		v.reset(OpARM64MOVBstoreidx)
  9052  		v.AddArg4(ptr, idx, x, mem)
  9053  		return true
  9054  	}
  9055  	// match: (MOVBstoreidx ptr idx (MOVHreg x) mem)
  9056  	// result: (MOVBstoreidx ptr idx x mem)
  9057  	for {
  9058  		ptr := v_0
  9059  		idx := v_1
  9060  		if v_2.Op != OpARM64MOVHreg {
  9061  			break
  9062  		}
  9063  		x := v_2.Args[0]
  9064  		mem := v_3
  9065  		v.reset(OpARM64MOVBstoreidx)
  9066  		v.AddArg4(ptr, idx, x, mem)
  9067  		return true
  9068  	}
  9069  	// match: (MOVBstoreidx ptr idx (MOVHUreg x) mem)
  9070  	// result: (MOVBstoreidx ptr idx x mem)
  9071  	for {
  9072  		ptr := v_0
  9073  		idx := v_1
  9074  		if v_2.Op != OpARM64MOVHUreg {
  9075  			break
  9076  		}
  9077  		x := v_2.Args[0]
  9078  		mem := v_3
  9079  		v.reset(OpARM64MOVBstoreidx)
  9080  		v.AddArg4(ptr, idx, x, mem)
  9081  		return true
  9082  	}
  9083  	// match: (MOVBstoreidx ptr idx (MOVWreg x) mem)
  9084  	// result: (MOVBstoreidx ptr idx x mem)
  9085  	for {
  9086  		ptr := v_0
  9087  		idx := v_1
  9088  		if v_2.Op != OpARM64MOVWreg {
  9089  			break
  9090  		}
  9091  		x := v_2.Args[0]
  9092  		mem := v_3
  9093  		v.reset(OpARM64MOVBstoreidx)
  9094  		v.AddArg4(ptr, idx, x, mem)
  9095  		return true
  9096  	}
  9097  	// match: (MOVBstoreidx ptr idx (MOVWUreg x) mem)
  9098  	// result: (MOVBstoreidx ptr idx x mem)
  9099  	for {
  9100  		ptr := v_0
  9101  		idx := v_1
  9102  		if v_2.Op != OpARM64MOVWUreg {
  9103  			break
  9104  		}
  9105  		x := v_2.Args[0]
  9106  		mem := v_3
  9107  		v.reset(OpARM64MOVBstoreidx)
  9108  		v.AddArg4(ptr, idx, x, mem)
  9109  		return true
  9110  	}
  9111  	return false
  9112  }
  9113  func rewriteValueARM64_OpARM64MOVDload(v *Value) bool {
  9114  	v_1 := v.Args[1]
  9115  	v_0 := v.Args[0]
  9116  	b := v.Block
  9117  	config := b.Func.Config
  9118  	// match: (MOVDload [off] {sym} ptr (FMOVDstore [off] {sym} ptr val _))
  9119  	// result: (FMOVDfpgp val)
  9120  	for {
  9121  		off := auxIntToInt32(v.AuxInt)
  9122  		sym := auxToSym(v.Aux)
  9123  		ptr := v_0
  9124  		if v_1.Op != OpARM64FMOVDstore || auxIntToInt32(v_1.AuxInt) != off || auxToSym(v_1.Aux) != sym {
  9125  			break
  9126  		}
  9127  		val := v_1.Args[1]
  9128  		if ptr != v_1.Args[0] {
  9129  			break
  9130  		}
  9131  		v.reset(OpARM64FMOVDfpgp)
  9132  		v.AddArg(val)
  9133  		return true
  9134  	}
  9135  	// match: (MOVDload [off1] {sym} (ADDconst [off2] ptr) mem)
  9136  	// cond: is32Bit(int64(off1)+off2) && (ptr.Op != OpSB || !config.ctxt.Flag_dynlink)
  9137  	// result: (MOVDload [off1+int32(off2)] {sym} ptr mem)
  9138  	for {
  9139  		off1 := auxIntToInt32(v.AuxInt)
  9140  		sym := auxToSym(v.Aux)
  9141  		if v_0.Op != OpARM64ADDconst {
  9142  			break
  9143  		}
  9144  		off2 := auxIntToInt64(v_0.AuxInt)
  9145  		ptr := v_0.Args[0]
  9146  		mem := v_1
  9147  		if !(is32Bit(int64(off1)+off2) && (ptr.Op != OpSB || !config.ctxt.Flag_dynlink)) {
  9148  			break
  9149  		}
  9150  		v.reset(OpARM64MOVDload)
  9151  		v.AuxInt = int32ToAuxInt(off1 + int32(off2))
  9152  		v.Aux = symToAux(sym)
  9153  		v.AddArg2(ptr, mem)
  9154  		return true
  9155  	}
  9156  	// match: (MOVDload [off] {sym} (ADD ptr idx) mem)
  9157  	// cond: off == 0 && sym == nil
  9158  	// result: (MOVDloadidx ptr idx mem)
  9159  	for {
  9160  		off := auxIntToInt32(v.AuxInt)
  9161  		sym := auxToSym(v.Aux)
  9162  		if v_0.Op != OpARM64ADD {
  9163  			break
  9164  		}
  9165  		idx := v_0.Args[1]
  9166  		ptr := v_0.Args[0]
  9167  		mem := v_1
  9168  		if !(off == 0 && sym == nil) {
  9169  			break
  9170  		}
  9171  		v.reset(OpARM64MOVDloadidx)
  9172  		v.AddArg3(ptr, idx, mem)
  9173  		return true
  9174  	}
  9175  	// match: (MOVDload [off] {sym} (ADDshiftLL [3] ptr idx) mem)
  9176  	// cond: off == 0 && sym == nil
  9177  	// result: (MOVDloadidx8 ptr idx mem)
  9178  	for {
  9179  		off := auxIntToInt32(v.AuxInt)
  9180  		sym := auxToSym(v.Aux)
  9181  		if v_0.Op != OpARM64ADDshiftLL || auxIntToInt64(v_0.AuxInt) != 3 {
  9182  			break
  9183  		}
  9184  		idx := v_0.Args[1]
  9185  		ptr := v_0.Args[0]
  9186  		mem := v_1
  9187  		if !(off == 0 && sym == nil) {
  9188  			break
  9189  		}
  9190  		v.reset(OpARM64MOVDloadidx8)
  9191  		v.AddArg3(ptr, idx, mem)
  9192  		return true
  9193  	}
  9194  	// match: (MOVDload [off1] {sym1} (MOVDaddr [off2] {sym2} ptr) mem)
  9195  	// cond: canMergeSym(sym1,sym2) && is32Bit(int64(off1)+int64(off2)) && (ptr.Op != OpSB || !config.ctxt.Flag_dynlink)
  9196  	// result: (MOVDload [off1+off2] {mergeSym(sym1,sym2)} ptr mem)
  9197  	for {
  9198  		off1 := auxIntToInt32(v.AuxInt)
  9199  		sym1 := auxToSym(v.Aux)
  9200  		if v_0.Op != OpARM64MOVDaddr {
  9201  			break
  9202  		}
  9203  		off2 := auxIntToInt32(v_0.AuxInt)
  9204  		sym2 := auxToSym(v_0.Aux)
  9205  		ptr := v_0.Args[0]
  9206  		mem := v_1
  9207  		if !(canMergeSym(sym1, sym2) && is32Bit(int64(off1)+int64(off2)) && (ptr.Op != OpSB || !config.ctxt.Flag_dynlink)) {
  9208  			break
  9209  		}
  9210  		v.reset(OpARM64MOVDload)
  9211  		v.AuxInt = int32ToAuxInt(off1 + off2)
  9212  		v.Aux = symToAux(mergeSym(sym1, sym2))
  9213  		v.AddArg2(ptr, mem)
  9214  		return true
  9215  	}
  9216  	// match: (MOVDload [off] {sym} (SB) _)
  9217  	// cond: symIsRO(sym)
  9218  	// result: (MOVDconst [int64(read64(sym, int64(off), config.ctxt.Arch.ByteOrder))])
  9219  	for {
  9220  		off := auxIntToInt32(v.AuxInt)
  9221  		sym := auxToSym(v.Aux)
  9222  		if v_0.Op != OpSB || !(symIsRO(sym)) {
  9223  			break
  9224  		}
  9225  		v.reset(OpARM64MOVDconst)
  9226  		v.AuxInt = int64ToAuxInt(int64(read64(sym, int64(off), config.ctxt.Arch.ByteOrder)))
  9227  		return true
  9228  	}
  9229  	return false
  9230  }
  9231  func rewriteValueARM64_OpARM64MOVDloadidx(v *Value) bool {
  9232  	v_2 := v.Args[2]
  9233  	v_1 := v.Args[1]
  9234  	v_0 := v.Args[0]
  9235  	// match: (MOVDloadidx ptr (MOVDconst [c]) mem)
  9236  	// cond: is32Bit(c)
  9237  	// result: (MOVDload [int32(c)] ptr mem)
  9238  	for {
  9239  		ptr := v_0
  9240  		if v_1.Op != OpARM64MOVDconst {
  9241  			break
  9242  		}
  9243  		c := auxIntToInt64(v_1.AuxInt)
  9244  		mem := v_2
  9245  		if !(is32Bit(c)) {
  9246  			break
  9247  		}
  9248  		v.reset(OpARM64MOVDload)
  9249  		v.AuxInt = int32ToAuxInt(int32(c))
  9250  		v.AddArg2(ptr, mem)
  9251  		return true
  9252  	}
  9253  	// match: (MOVDloadidx (MOVDconst [c]) ptr mem)
  9254  	// cond: is32Bit(c)
  9255  	// result: (MOVDload [int32(c)] ptr mem)
  9256  	for {
  9257  		if v_0.Op != OpARM64MOVDconst {
  9258  			break
  9259  		}
  9260  		c := auxIntToInt64(v_0.AuxInt)
  9261  		ptr := v_1
  9262  		mem := v_2
  9263  		if !(is32Bit(c)) {
  9264  			break
  9265  		}
  9266  		v.reset(OpARM64MOVDload)
  9267  		v.AuxInt = int32ToAuxInt(int32(c))
  9268  		v.AddArg2(ptr, mem)
  9269  		return true
  9270  	}
  9271  	// match: (MOVDloadidx ptr (SLLconst [3] idx) mem)
  9272  	// result: (MOVDloadidx8 ptr idx mem)
  9273  	for {
  9274  		ptr := v_0
  9275  		if v_1.Op != OpARM64SLLconst || auxIntToInt64(v_1.AuxInt) != 3 {
  9276  			break
  9277  		}
  9278  		idx := v_1.Args[0]
  9279  		mem := v_2
  9280  		v.reset(OpARM64MOVDloadidx8)
  9281  		v.AddArg3(ptr, idx, mem)
  9282  		return true
  9283  	}
  9284  	// match: (MOVDloadidx (SLLconst [3] idx) ptr mem)
  9285  	// result: (MOVDloadidx8 ptr idx mem)
  9286  	for {
  9287  		if v_0.Op != OpARM64SLLconst || auxIntToInt64(v_0.AuxInt) != 3 {
  9288  			break
  9289  		}
  9290  		idx := v_0.Args[0]
  9291  		ptr := v_1
  9292  		mem := v_2
  9293  		v.reset(OpARM64MOVDloadidx8)
  9294  		v.AddArg3(ptr, idx, mem)
  9295  		return true
  9296  	}
  9297  	return false
  9298  }
  9299  func rewriteValueARM64_OpARM64MOVDloadidx8(v *Value) bool {
  9300  	v_2 := v.Args[2]
  9301  	v_1 := v.Args[1]
  9302  	v_0 := v.Args[0]
  9303  	// match: (MOVDloadidx8 ptr (MOVDconst [c]) mem)
  9304  	// cond: is32Bit(c<<3)
  9305  	// result: (MOVDload [int32(c)<<3] ptr mem)
  9306  	for {
  9307  		ptr := v_0
  9308  		if v_1.Op != OpARM64MOVDconst {
  9309  			break
  9310  		}
  9311  		c := auxIntToInt64(v_1.AuxInt)
  9312  		mem := v_2
  9313  		if !(is32Bit(c << 3)) {
  9314  			break
  9315  		}
  9316  		v.reset(OpARM64MOVDload)
  9317  		v.AuxInt = int32ToAuxInt(int32(c) << 3)
  9318  		v.AddArg2(ptr, mem)
  9319  		return true
  9320  	}
  9321  	return false
  9322  }
  9323  func rewriteValueARM64_OpARM64MOVDnop(v *Value) bool {
  9324  	v_0 := v.Args[0]
  9325  	// match: (MOVDnop (MOVDconst [c]))
  9326  	// result: (MOVDconst [c])
  9327  	for {
  9328  		if v_0.Op != OpARM64MOVDconst {
  9329  			break
  9330  		}
  9331  		c := auxIntToInt64(v_0.AuxInt)
  9332  		v.reset(OpARM64MOVDconst)
  9333  		v.AuxInt = int64ToAuxInt(c)
  9334  		return true
  9335  	}
  9336  	return false
  9337  }
  9338  func rewriteValueARM64_OpARM64MOVDreg(v *Value) bool {
  9339  	v_0 := v.Args[0]
  9340  	// match: (MOVDreg x)
  9341  	// cond: x.Uses == 1
  9342  	// result: (MOVDnop x)
  9343  	for {
  9344  		x := v_0
  9345  		if !(x.Uses == 1) {
  9346  			break
  9347  		}
  9348  		v.reset(OpARM64MOVDnop)
  9349  		v.AddArg(x)
  9350  		return true
  9351  	}
  9352  	// match: (MOVDreg (MOVDconst [c]))
  9353  	// result: (MOVDconst [c])
  9354  	for {
  9355  		if v_0.Op != OpARM64MOVDconst {
  9356  			break
  9357  		}
  9358  		c := auxIntToInt64(v_0.AuxInt)
  9359  		v.reset(OpARM64MOVDconst)
  9360  		v.AuxInt = int64ToAuxInt(c)
  9361  		return true
  9362  	}
  9363  	return false
  9364  }
  9365  func rewriteValueARM64_OpARM64MOVDstore(v *Value) bool {
  9366  	v_2 := v.Args[2]
  9367  	v_1 := v.Args[1]
  9368  	v_0 := v.Args[0]
  9369  	b := v.Block
  9370  	config := b.Func.Config
  9371  	// match: (MOVDstore [off] {sym} ptr (FMOVDfpgp val) mem)
  9372  	// result: (FMOVDstore [off] {sym} ptr val mem)
  9373  	for {
  9374  		off := auxIntToInt32(v.AuxInt)
  9375  		sym := auxToSym(v.Aux)
  9376  		ptr := v_0
  9377  		if v_1.Op != OpARM64FMOVDfpgp {
  9378  			break
  9379  		}
  9380  		val := v_1.Args[0]
  9381  		mem := v_2
  9382  		v.reset(OpARM64FMOVDstore)
  9383  		v.AuxInt = int32ToAuxInt(off)
  9384  		v.Aux = symToAux(sym)
  9385  		v.AddArg3(ptr, val, mem)
  9386  		return true
  9387  	}
  9388  	// match: (MOVDstore [off1] {sym} (ADDconst [off2] ptr) val mem)
  9389  	// cond: is32Bit(int64(off1)+off2) && (ptr.Op != OpSB || !config.ctxt.Flag_dynlink)
  9390  	// result: (MOVDstore [off1+int32(off2)] {sym} ptr val mem)
  9391  	for {
  9392  		off1 := auxIntToInt32(v.AuxInt)
  9393  		sym := auxToSym(v.Aux)
  9394  		if v_0.Op != OpARM64ADDconst {
  9395  			break
  9396  		}
  9397  		off2 := auxIntToInt64(v_0.AuxInt)
  9398  		ptr := v_0.Args[0]
  9399  		val := v_1
  9400  		mem := v_2
  9401  		if !(is32Bit(int64(off1)+off2) && (ptr.Op != OpSB || !config.ctxt.Flag_dynlink)) {
  9402  			break
  9403  		}
  9404  		v.reset(OpARM64MOVDstore)
  9405  		v.AuxInt = int32ToAuxInt(off1 + int32(off2))
  9406  		v.Aux = symToAux(sym)
  9407  		v.AddArg3(ptr, val, mem)
  9408  		return true
  9409  	}
  9410  	// match: (MOVDstore [off] {sym} (ADD ptr idx) val mem)
  9411  	// cond: off == 0 && sym == nil
  9412  	// result: (MOVDstoreidx ptr idx val mem)
  9413  	for {
  9414  		off := auxIntToInt32(v.AuxInt)
  9415  		sym := auxToSym(v.Aux)
  9416  		if v_0.Op != OpARM64ADD {
  9417  			break
  9418  		}
  9419  		idx := v_0.Args[1]
  9420  		ptr := v_0.Args[0]
  9421  		val := v_1
  9422  		mem := v_2
  9423  		if !(off == 0 && sym == nil) {
  9424  			break
  9425  		}
  9426  		v.reset(OpARM64MOVDstoreidx)
  9427  		v.AddArg4(ptr, idx, val, mem)
  9428  		return true
  9429  	}
  9430  	// match: (MOVDstore [off] {sym} (ADDshiftLL [3] ptr idx) val mem)
  9431  	// cond: off == 0 && sym == nil
  9432  	// result: (MOVDstoreidx8 ptr idx val mem)
  9433  	for {
  9434  		off := auxIntToInt32(v.AuxInt)
  9435  		sym := auxToSym(v.Aux)
  9436  		if v_0.Op != OpARM64ADDshiftLL || auxIntToInt64(v_0.AuxInt) != 3 {
  9437  			break
  9438  		}
  9439  		idx := v_0.Args[1]
  9440  		ptr := v_0.Args[0]
  9441  		val := v_1
  9442  		mem := v_2
  9443  		if !(off == 0 && sym == nil) {
  9444  			break
  9445  		}
  9446  		v.reset(OpARM64MOVDstoreidx8)
  9447  		v.AddArg4(ptr, idx, val, mem)
  9448  		return true
  9449  	}
  9450  	// match: (MOVDstore [off1] {sym1} (MOVDaddr [off2] {sym2} ptr) val mem)
  9451  	// cond: canMergeSym(sym1,sym2) && is32Bit(int64(off1)+int64(off2)) && (ptr.Op != OpSB || !config.ctxt.Flag_dynlink)
  9452  	// result: (MOVDstore [off1+off2] {mergeSym(sym1,sym2)} ptr val mem)
  9453  	for {
  9454  		off1 := auxIntToInt32(v.AuxInt)
  9455  		sym1 := auxToSym(v.Aux)
  9456  		if v_0.Op != OpARM64MOVDaddr {
  9457  			break
  9458  		}
  9459  		off2 := auxIntToInt32(v_0.AuxInt)
  9460  		sym2 := auxToSym(v_0.Aux)
  9461  		ptr := v_0.Args[0]
  9462  		val := v_1
  9463  		mem := v_2
  9464  		if !(canMergeSym(sym1, sym2) && is32Bit(int64(off1)+int64(off2)) && (ptr.Op != OpSB || !config.ctxt.Flag_dynlink)) {
  9465  			break
  9466  		}
  9467  		v.reset(OpARM64MOVDstore)
  9468  		v.AuxInt = int32ToAuxInt(off1 + off2)
  9469  		v.Aux = symToAux(mergeSym(sym1, sym2))
  9470  		v.AddArg3(ptr, val, mem)
  9471  		return true
  9472  	}
  9473  	return false
  9474  }
  9475  func rewriteValueARM64_OpARM64MOVDstoreidx(v *Value) bool {
  9476  	v_3 := v.Args[3]
  9477  	v_2 := v.Args[2]
  9478  	v_1 := v.Args[1]
  9479  	v_0 := v.Args[0]
  9480  	// match: (MOVDstoreidx ptr (MOVDconst [c]) val mem)
  9481  	// cond: is32Bit(c)
  9482  	// result: (MOVDstore [int32(c)] ptr val mem)
  9483  	for {
  9484  		ptr := v_0
  9485  		if v_1.Op != OpARM64MOVDconst {
  9486  			break
  9487  		}
  9488  		c := auxIntToInt64(v_1.AuxInt)
  9489  		val := v_2
  9490  		mem := v_3
  9491  		if !(is32Bit(c)) {
  9492  			break
  9493  		}
  9494  		v.reset(OpARM64MOVDstore)
  9495  		v.AuxInt = int32ToAuxInt(int32(c))
  9496  		v.AddArg3(ptr, val, mem)
  9497  		return true
  9498  	}
  9499  	// match: (MOVDstoreidx (MOVDconst [c]) idx val mem)
  9500  	// cond: is32Bit(c)
  9501  	// result: (MOVDstore [int32(c)] idx val mem)
  9502  	for {
  9503  		if v_0.Op != OpARM64MOVDconst {
  9504  			break
  9505  		}
  9506  		c := auxIntToInt64(v_0.AuxInt)
  9507  		idx := v_1
  9508  		val := v_2
  9509  		mem := v_3
  9510  		if !(is32Bit(c)) {
  9511  			break
  9512  		}
  9513  		v.reset(OpARM64MOVDstore)
  9514  		v.AuxInt = int32ToAuxInt(int32(c))
  9515  		v.AddArg3(idx, val, mem)
  9516  		return true
  9517  	}
  9518  	// match: (MOVDstoreidx ptr (SLLconst [3] idx) val mem)
  9519  	// result: (MOVDstoreidx8 ptr idx val mem)
  9520  	for {
  9521  		ptr := v_0
  9522  		if v_1.Op != OpARM64SLLconst || auxIntToInt64(v_1.AuxInt) != 3 {
  9523  			break
  9524  		}
  9525  		idx := v_1.Args[0]
  9526  		val := v_2
  9527  		mem := v_3
  9528  		v.reset(OpARM64MOVDstoreidx8)
  9529  		v.AddArg4(ptr, idx, val, mem)
  9530  		return true
  9531  	}
  9532  	// match: (MOVDstoreidx (SLLconst [3] idx) ptr val mem)
  9533  	// result: (MOVDstoreidx8 ptr idx val mem)
  9534  	for {
  9535  		if v_0.Op != OpARM64SLLconst || auxIntToInt64(v_0.AuxInt) != 3 {
  9536  			break
  9537  		}
  9538  		idx := v_0.Args[0]
  9539  		ptr := v_1
  9540  		val := v_2
  9541  		mem := v_3
  9542  		v.reset(OpARM64MOVDstoreidx8)
  9543  		v.AddArg4(ptr, idx, val, mem)
  9544  		return true
  9545  	}
  9546  	return false
  9547  }
  9548  func rewriteValueARM64_OpARM64MOVDstoreidx8(v *Value) bool {
  9549  	v_3 := v.Args[3]
  9550  	v_2 := v.Args[2]
  9551  	v_1 := v.Args[1]
  9552  	v_0 := v.Args[0]
  9553  	// match: (MOVDstoreidx8 ptr (MOVDconst [c]) val mem)
  9554  	// cond: is32Bit(c<<3)
  9555  	// result: (MOVDstore [int32(c)<<3] ptr val mem)
  9556  	for {
  9557  		ptr := v_0
  9558  		if v_1.Op != OpARM64MOVDconst {
  9559  			break
  9560  		}
  9561  		c := auxIntToInt64(v_1.AuxInt)
  9562  		val := v_2
  9563  		mem := v_3
  9564  		if !(is32Bit(c << 3)) {
  9565  			break
  9566  		}
  9567  		v.reset(OpARM64MOVDstore)
  9568  		v.AuxInt = int32ToAuxInt(int32(c) << 3)
  9569  		v.AddArg3(ptr, val, mem)
  9570  		return true
  9571  	}
  9572  	return false
  9573  }
  9574  func rewriteValueARM64_OpARM64MOVHUload(v *Value) bool {
  9575  	v_1 := v.Args[1]
  9576  	v_0 := v.Args[0]
  9577  	b := v.Block
  9578  	config := b.Func.Config
  9579  	// match: (MOVHUload [off1] {sym} (ADDconst [off2] ptr) mem)
  9580  	// cond: is32Bit(int64(off1)+off2) && (ptr.Op != OpSB || !config.ctxt.Flag_dynlink)
  9581  	// result: (MOVHUload [off1+int32(off2)] {sym} ptr mem)
  9582  	for {
  9583  		off1 := auxIntToInt32(v.AuxInt)
  9584  		sym := auxToSym(v.Aux)
  9585  		if v_0.Op != OpARM64ADDconst {
  9586  			break
  9587  		}
  9588  		off2 := auxIntToInt64(v_0.AuxInt)
  9589  		ptr := v_0.Args[0]
  9590  		mem := v_1
  9591  		if !(is32Bit(int64(off1)+off2) && (ptr.Op != OpSB || !config.ctxt.Flag_dynlink)) {
  9592  			break
  9593  		}
  9594  		v.reset(OpARM64MOVHUload)
  9595  		v.AuxInt = int32ToAuxInt(off1 + int32(off2))
  9596  		v.Aux = symToAux(sym)
  9597  		v.AddArg2(ptr, mem)
  9598  		return true
  9599  	}
  9600  	// match: (MOVHUload [off] {sym} (ADD ptr idx) mem)
  9601  	// cond: off == 0 && sym == nil
  9602  	// result: (MOVHUloadidx ptr idx mem)
  9603  	for {
  9604  		off := auxIntToInt32(v.AuxInt)
  9605  		sym := auxToSym(v.Aux)
  9606  		if v_0.Op != OpARM64ADD {
  9607  			break
  9608  		}
  9609  		idx := v_0.Args[1]
  9610  		ptr := v_0.Args[0]
  9611  		mem := v_1
  9612  		if !(off == 0 && sym == nil) {
  9613  			break
  9614  		}
  9615  		v.reset(OpARM64MOVHUloadidx)
  9616  		v.AddArg3(ptr, idx, mem)
  9617  		return true
  9618  	}
  9619  	// match: (MOVHUload [off] {sym} (ADDshiftLL [1] ptr idx) mem)
  9620  	// cond: off == 0 && sym == nil
  9621  	// result: (MOVHUloadidx2 ptr idx mem)
  9622  	for {
  9623  		off := auxIntToInt32(v.AuxInt)
  9624  		sym := auxToSym(v.Aux)
  9625  		if v_0.Op != OpARM64ADDshiftLL || auxIntToInt64(v_0.AuxInt) != 1 {
  9626  			break
  9627  		}
  9628  		idx := v_0.Args[1]
  9629  		ptr := v_0.Args[0]
  9630  		mem := v_1
  9631  		if !(off == 0 && sym == nil) {
  9632  			break
  9633  		}
  9634  		v.reset(OpARM64MOVHUloadidx2)
  9635  		v.AddArg3(ptr, idx, mem)
  9636  		return true
  9637  	}
  9638  	// match: (MOVHUload [off1] {sym1} (MOVDaddr [off2] {sym2} ptr) mem)
  9639  	// cond: canMergeSym(sym1,sym2) && is32Bit(int64(off1)+int64(off2)) && (ptr.Op != OpSB || !config.ctxt.Flag_dynlink)
  9640  	// result: (MOVHUload [off1+off2] {mergeSym(sym1,sym2)} ptr mem)
  9641  	for {
  9642  		off1 := auxIntToInt32(v.AuxInt)
  9643  		sym1 := auxToSym(v.Aux)
  9644  		if v_0.Op != OpARM64MOVDaddr {
  9645  			break
  9646  		}
  9647  		off2 := auxIntToInt32(v_0.AuxInt)
  9648  		sym2 := auxToSym(v_0.Aux)
  9649  		ptr := v_0.Args[0]
  9650  		mem := v_1
  9651  		if !(canMergeSym(sym1, sym2) && is32Bit(int64(off1)+int64(off2)) && (ptr.Op != OpSB || !config.ctxt.Flag_dynlink)) {
  9652  			break
  9653  		}
  9654  		v.reset(OpARM64MOVHUload)
  9655  		v.AuxInt = int32ToAuxInt(off1 + off2)
  9656  		v.Aux = symToAux(mergeSym(sym1, sym2))
  9657  		v.AddArg2(ptr, mem)
  9658  		return true
  9659  	}
  9660  	// match: (MOVHUload [off] {sym} (SB) _)
  9661  	// cond: symIsRO(sym)
  9662  	// result: (MOVDconst [int64(read16(sym, int64(off), config.ctxt.Arch.ByteOrder))])
  9663  	for {
  9664  		off := auxIntToInt32(v.AuxInt)
  9665  		sym := auxToSym(v.Aux)
  9666  		if v_0.Op != OpSB || !(symIsRO(sym)) {
  9667  			break
  9668  		}
  9669  		v.reset(OpARM64MOVDconst)
  9670  		v.AuxInt = int64ToAuxInt(int64(read16(sym, int64(off), config.ctxt.Arch.ByteOrder)))
  9671  		return true
  9672  	}
  9673  	return false
  9674  }
  9675  func rewriteValueARM64_OpARM64MOVHUloadidx(v *Value) bool {
  9676  	v_2 := v.Args[2]
  9677  	v_1 := v.Args[1]
  9678  	v_0 := v.Args[0]
  9679  	// match: (MOVHUloadidx ptr (MOVDconst [c]) mem)
  9680  	// cond: is32Bit(c)
  9681  	// result: (MOVHUload [int32(c)] ptr mem)
  9682  	for {
  9683  		ptr := v_0
  9684  		if v_1.Op != OpARM64MOVDconst {
  9685  			break
  9686  		}
  9687  		c := auxIntToInt64(v_1.AuxInt)
  9688  		mem := v_2
  9689  		if !(is32Bit(c)) {
  9690  			break
  9691  		}
  9692  		v.reset(OpARM64MOVHUload)
  9693  		v.AuxInt = int32ToAuxInt(int32(c))
  9694  		v.AddArg2(ptr, mem)
  9695  		return true
  9696  	}
  9697  	// match: (MOVHUloadidx (MOVDconst [c]) ptr mem)
  9698  	// cond: is32Bit(c)
  9699  	// result: (MOVHUload [int32(c)] ptr mem)
  9700  	for {
  9701  		if v_0.Op != OpARM64MOVDconst {
  9702  			break
  9703  		}
  9704  		c := auxIntToInt64(v_0.AuxInt)
  9705  		ptr := v_1
  9706  		mem := v_2
  9707  		if !(is32Bit(c)) {
  9708  			break
  9709  		}
  9710  		v.reset(OpARM64MOVHUload)
  9711  		v.AuxInt = int32ToAuxInt(int32(c))
  9712  		v.AddArg2(ptr, mem)
  9713  		return true
  9714  	}
  9715  	// match: (MOVHUloadidx ptr (SLLconst [1] idx) mem)
  9716  	// result: (MOVHUloadidx2 ptr idx mem)
  9717  	for {
  9718  		ptr := v_0
  9719  		if v_1.Op != OpARM64SLLconst || auxIntToInt64(v_1.AuxInt) != 1 {
  9720  			break
  9721  		}
  9722  		idx := v_1.Args[0]
  9723  		mem := v_2
  9724  		v.reset(OpARM64MOVHUloadidx2)
  9725  		v.AddArg3(ptr, idx, mem)
  9726  		return true
  9727  	}
  9728  	// match: (MOVHUloadidx ptr (ADD idx idx) mem)
  9729  	// result: (MOVHUloadidx2 ptr idx mem)
  9730  	for {
  9731  		ptr := v_0
  9732  		if v_1.Op != OpARM64ADD {
  9733  			break
  9734  		}
  9735  		idx := v_1.Args[1]
  9736  		if idx != v_1.Args[0] {
  9737  			break
  9738  		}
  9739  		mem := v_2
  9740  		v.reset(OpARM64MOVHUloadidx2)
  9741  		v.AddArg3(ptr, idx, mem)
  9742  		return true
  9743  	}
  9744  	// match: (MOVHUloadidx (ADD idx idx) ptr mem)
  9745  	// result: (MOVHUloadidx2 ptr idx mem)
  9746  	for {
  9747  		if v_0.Op != OpARM64ADD {
  9748  			break
  9749  		}
  9750  		idx := v_0.Args[1]
  9751  		if idx != v_0.Args[0] {
  9752  			break
  9753  		}
  9754  		ptr := v_1
  9755  		mem := v_2
  9756  		v.reset(OpARM64MOVHUloadidx2)
  9757  		v.AddArg3(ptr, idx, mem)
  9758  		return true
  9759  	}
  9760  	return false
  9761  }
  9762  func rewriteValueARM64_OpARM64MOVHUloadidx2(v *Value) bool {
  9763  	v_2 := v.Args[2]
  9764  	v_1 := v.Args[1]
  9765  	v_0 := v.Args[0]
  9766  	// match: (MOVHUloadidx2 ptr (MOVDconst [c]) mem)
  9767  	// cond: is32Bit(c<<1)
  9768  	// result: (MOVHUload [int32(c)<<1] ptr mem)
  9769  	for {
  9770  		ptr := v_0
  9771  		if v_1.Op != OpARM64MOVDconst {
  9772  			break
  9773  		}
  9774  		c := auxIntToInt64(v_1.AuxInt)
  9775  		mem := v_2
  9776  		if !(is32Bit(c << 1)) {
  9777  			break
  9778  		}
  9779  		v.reset(OpARM64MOVHUload)
  9780  		v.AuxInt = int32ToAuxInt(int32(c) << 1)
  9781  		v.AddArg2(ptr, mem)
  9782  		return true
  9783  	}
  9784  	return false
  9785  }
  9786  func rewriteValueARM64_OpARM64MOVHUreg(v *Value) bool {
  9787  	v_0 := v.Args[0]
  9788  	// match: (MOVHUreg (ANDconst [c] x))
  9789  	// result: (ANDconst [c&(1<<16-1)] x)
  9790  	for {
  9791  		if v_0.Op != OpARM64ANDconst {
  9792  			break
  9793  		}
  9794  		c := auxIntToInt64(v_0.AuxInt)
  9795  		x := v_0.Args[0]
  9796  		v.reset(OpARM64ANDconst)
  9797  		v.AuxInt = int64ToAuxInt(c & (1<<16 - 1))
  9798  		v.AddArg(x)
  9799  		return true
  9800  	}
  9801  	// match: (MOVHUreg (MOVDconst [c]))
  9802  	// result: (MOVDconst [int64(uint16(c))])
  9803  	for {
  9804  		if v_0.Op != OpARM64MOVDconst {
  9805  			break
  9806  		}
  9807  		c := auxIntToInt64(v_0.AuxInt)
  9808  		v.reset(OpARM64MOVDconst)
  9809  		v.AuxInt = int64ToAuxInt(int64(uint16(c)))
  9810  		return true
  9811  	}
  9812  	// match: (MOVHUreg x)
  9813  	// cond: v.Type.Size() <= 2
  9814  	// result: x
  9815  	for {
  9816  		x := v_0
  9817  		if !(v.Type.Size() <= 2) {
  9818  			break
  9819  		}
  9820  		v.copyOf(x)
  9821  		return true
  9822  	}
  9823  	// match: (MOVHUreg (SLLconst [lc] x))
  9824  	// cond: lc >= 16
  9825  	// result: (MOVDconst [0])
  9826  	for {
  9827  		if v_0.Op != OpARM64SLLconst {
  9828  			break
  9829  		}
  9830  		lc := auxIntToInt64(v_0.AuxInt)
  9831  		if !(lc >= 16) {
  9832  			break
  9833  		}
  9834  		v.reset(OpARM64MOVDconst)
  9835  		v.AuxInt = int64ToAuxInt(0)
  9836  		return true
  9837  	}
  9838  	// match: (MOVHUreg (SLLconst [lc] x))
  9839  	// cond: lc < 16
  9840  	// result: (UBFIZ [armBFAuxInt(lc, 16-lc)] x)
  9841  	for {
  9842  		if v_0.Op != OpARM64SLLconst {
  9843  			break
  9844  		}
  9845  		lc := auxIntToInt64(v_0.AuxInt)
  9846  		x := v_0.Args[0]
  9847  		if !(lc < 16) {
  9848  			break
  9849  		}
  9850  		v.reset(OpARM64UBFIZ)
  9851  		v.AuxInt = arm64BitFieldToAuxInt(armBFAuxInt(lc, 16-lc))
  9852  		v.AddArg(x)
  9853  		return true
  9854  	}
  9855  	// match: (MOVHUreg (SRLconst [rc] x))
  9856  	// cond: rc < 16
  9857  	// result: (UBFX [armBFAuxInt(rc, 16)] x)
  9858  	for {
  9859  		if v_0.Op != OpARM64SRLconst {
  9860  			break
  9861  		}
  9862  		rc := auxIntToInt64(v_0.AuxInt)
  9863  		x := v_0.Args[0]
  9864  		if !(rc < 16) {
  9865  			break
  9866  		}
  9867  		v.reset(OpARM64UBFX)
  9868  		v.AuxInt = arm64BitFieldToAuxInt(armBFAuxInt(rc, 16))
  9869  		v.AddArg(x)
  9870  		return true
  9871  	}
  9872  	// match: (MOVHUreg (UBFX [bfc] x))
  9873  	// cond: bfc.width() <= 16
  9874  	// result: (UBFX [bfc] x)
  9875  	for {
  9876  		if v_0.Op != OpARM64UBFX {
  9877  			break
  9878  		}
  9879  		bfc := auxIntToArm64BitField(v_0.AuxInt)
  9880  		x := v_0.Args[0]
  9881  		if !(bfc.width() <= 16) {
  9882  			break
  9883  		}
  9884  		v.reset(OpARM64UBFX)
  9885  		v.AuxInt = arm64BitFieldToAuxInt(bfc)
  9886  		v.AddArg(x)
  9887  		return true
  9888  	}
  9889  	return false
  9890  }
  9891  func rewriteValueARM64_OpARM64MOVHload(v *Value) bool {
  9892  	v_1 := v.Args[1]
  9893  	v_0 := v.Args[0]
  9894  	b := v.Block
  9895  	config := b.Func.Config
  9896  	// match: (MOVHload [off1] {sym} (ADDconst [off2] ptr) mem)
  9897  	// cond: is32Bit(int64(off1)+off2) && (ptr.Op != OpSB || !config.ctxt.Flag_dynlink)
  9898  	// result: (MOVHload [off1+int32(off2)] {sym} ptr mem)
  9899  	for {
  9900  		off1 := auxIntToInt32(v.AuxInt)
  9901  		sym := auxToSym(v.Aux)
  9902  		if v_0.Op != OpARM64ADDconst {
  9903  			break
  9904  		}
  9905  		off2 := auxIntToInt64(v_0.AuxInt)
  9906  		ptr := v_0.Args[0]
  9907  		mem := v_1
  9908  		if !(is32Bit(int64(off1)+off2) && (ptr.Op != OpSB || !config.ctxt.Flag_dynlink)) {
  9909  			break
  9910  		}
  9911  		v.reset(OpARM64MOVHload)
  9912  		v.AuxInt = int32ToAuxInt(off1 + int32(off2))
  9913  		v.Aux = symToAux(sym)
  9914  		v.AddArg2(ptr, mem)
  9915  		return true
  9916  	}
  9917  	// match: (MOVHload [off] {sym} (ADD ptr idx) mem)
  9918  	// cond: off == 0 && sym == nil
  9919  	// result: (MOVHloadidx ptr idx mem)
  9920  	for {
  9921  		off := auxIntToInt32(v.AuxInt)
  9922  		sym := auxToSym(v.Aux)
  9923  		if v_0.Op != OpARM64ADD {
  9924  			break
  9925  		}
  9926  		idx := v_0.Args[1]
  9927  		ptr := v_0.Args[0]
  9928  		mem := v_1
  9929  		if !(off == 0 && sym == nil) {
  9930  			break
  9931  		}
  9932  		v.reset(OpARM64MOVHloadidx)
  9933  		v.AddArg3(ptr, idx, mem)
  9934  		return true
  9935  	}
  9936  	// match: (MOVHload [off] {sym} (ADDshiftLL [1] ptr idx) mem)
  9937  	// cond: off == 0 && sym == nil
  9938  	// result: (MOVHloadidx2 ptr idx mem)
  9939  	for {
  9940  		off := auxIntToInt32(v.AuxInt)
  9941  		sym := auxToSym(v.Aux)
  9942  		if v_0.Op != OpARM64ADDshiftLL || auxIntToInt64(v_0.AuxInt) != 1 {
  9943  			break
  9944  		}
  9945  		idx := v_0.Args[1]
  9946  		ptr := v_0.Args[0]
  9947  		mem := v_1
  9948  		if !(off == 0 && sym == nil) {
  9949  			break
  9950  		}
  9951  		v.reset(OpARM64MOVHloadidx2)
  9952  		v.AddArg3(ptr, idx, mem)
  9953  		return true
  9954  	}
  9955  	// match: (MOVHload [off1] {sym1} (MOVDaddr [off2] {sym2} ptr) mem)
  9956  	// cond: canMergeSym(sym1,sym2) && is32Bit(int64(off1)+int64(off2)) && (ptr.Op != OpSB || !config.ctxt.Flag_dynlink)
  9957  	// result: (MOVHload [off1+off2] {mergeSym(sym1,sym2)} ptr mem)
  9958  	for {
  9959  		off1 := auxIntToInt32(v.AuxInt)
  9960  		sym1 := auxToSym(v.Aux)
  9961  		if v_0.Op != OpARM64MOVDaddr {
  9962  			break
  9963  		}
  9964  		off2 := auxIntToInt32(v_0.AuxInt)
  9965  		sym2 := auxToSym(v_0.Aux)
  9966  		ptr := v_0.Args[0]
  9967  		mem := v_1
  9968  		if !(canMergeSym(sym1, sym2) && is32Bit(int64(off1)+int64(off2)) && (ptr.Op != OpSB || !config.ctxt.Flag_dynlink)) {
  9969  			break
  9970  		}
  9971  		v.reset(OpARM64MOVHload)
  9972  		v.AuxInt = int32ToAuxInt(off1 + off2)
  9973  		v.Aux = symToAux(mergeSym(sym1, sym2))
  9974  		v.AddArg2(ptr, mem)
  9975  		return true
  9976  	}
  9977  	// match: (MOVHload [off] {sym} (SB) _)
  9978  	// cond: symIsRO(sym)
  9979  	// result: (MOVDconst [int64(int16(read16(sym, int64(off), config.ctxt.Arch.ByteOrder)))])
  9980  	for {
  9981  		off := auxIntToInt32(v.AuxInt)
  9982  		sym := auxToSym(v.Aux)
  9983  		if v_0.Op != OpSB || !(symIsRO(sym)) {
  9984  			break
  9985  		}
  9986  		v.reset(OpARM64MOVDconst)
  9987  		v.AuxInt = int64ToAuxInt(int64(int16(read16(sym, int64(off), config.ctxt.Arch.ByteOrder))))
  9988  		return true
  9989  	}
  9990  	return false
  9991  }
  9992  func rewriteValueARM64_OpARM64MOVHloadidx(v *Value) bool {
  9993  	v_2 := v.Args[2]
  9994  	v_1 := v.Args[1]
  9995  	v_0 := v.Args[0]
  9996  	// match: (MOVHloadidx ptr (MOVDconst [c]) mem)
  9997  	// cond: is32Bit(c)
  9998  	// result: (MOVHload [int32(c)] ptr mem)
  9999  	for {
 10000  		ptr := v_0
 10001  		if v_1.Op != OpARM64MOVDconst {
 10002  			break
 10003  		}
 10004  		c := auxIntToInt64(v_1.AuxInt)
 10005  		mem := v_2
 10006  		if !(is32Bit(c)) {
 10007  			break
 10008  		}
 10009  		v.reset(OpARM64MOVHload)
 10010  		v.AuxInt = int32ToAuxInt(int32(c))
 10011  		v.AddArg2(ptr, mem)
 10012  		return true
 10013  	}
 10014  	// match: (MOVHloadidx (MOVDconst [c]) ptr mem)
 10015  	// cond: is32Bit(c)
 10016  	// result: (MOVHload [int32(c)] ptr mem)
 10017  	for {
 10018  		if v_0.Op != OpARM64MOVDconst {
 10019  			break
 10020  		}
 10021  		c := auxIntToInt64(v_0.AuxInt)
 10022  		ptr := v_1
 10023  		mem := v_2
 10024  		if !(is32Bit(c)) {
 10025  			break
 10026  		}
 10027  		v.reset(OpARM64MOVHload)
 10028  		v.AuxInt = int32ToAuxInt(int32(c))
 10029  		v.AddArg2(ptr, mem)
 10030  		return true
 10031  	}
 10032  	// match: (MOVHloadidx ptr (SLLconst [1] idx) mem)
 10033  	// result: (MOVHloadidx2 ptr idx mem)
 10034  	for {
 10035  		ptr := v_0
 10036  		if v_1.Op != OpARM64SLLconst || auxIntToInt64(v_1.AuxInt) != 1 {
 10037  			break
 10038  		}
 10039  		idx := v_1.Args[0]
 10040  		mem := v_2
 10041  		v.reset(OpARM64MOVHloadidx2)
 10042  		v.AddArg3(ptr, idx, mem)
 10043  		return true
 10044  	}
 10045  	// match: (MOVHloadidx ptr (ADD idx idx) mem)
 10046  	// result: (MOVHloadidx2 ptr idx mem)
 10047  	for {
 10048  		ptr := v_0
 10049  		if v_1.Op != OpARM64ADD {
 10050  			break
 10051  		}
 10052  		idx := v_1.Args[1]
 10053  		if idx != v_1.Args[0] {
 10054  			break
 10055  		}
 10056  		mem := v_2
 10057  		v.reset(OpARM64MOVHloadidx2)
 10058  		v.AddArg3(ptr, idx, mem)
 10059  		return true
 10060  	}
 10061  	// match: (MOVHloadidx (ADD idx idx) ptr mem)
 10062  	// result: (MOVHloadidx2 ptr idx mem)
 10063  	for {
 10064  		if v_0.Op != OpARM64ADD {
 10065  			break
 10066  		}
 10067  		idx := v_0.Args[1]
 10068  		if idx != v_0.Args[0] {
 10069  			break
 10070  		}
 10071  		ptr := v_1
 10072  		mem := v_2
 10073  		v.reset(OpARM64MOVHloadidx2)
 10074  		v.AddArg3(ptr, idx, mem)
 10075  		return true
 10076  	}
 10077  	return false
 10078  }
 10079  func rewriteValueARM64_OpARM64MOVHloadidx2(v *Value) bool {
 10080  	v_2 := v.Args[2]
 10081  	v_1 := v.Args[1]
 10082  	v_0 := v.Args[0]
 10083  	// match: (MOVHloadidx2 ptr (MOVDconst [c]) mem)
 10084  	// cond: is32Bit(c<<1)
 10085  	// result: (MOVHload [int32(c)<<1] ptr mem)
 10086  	for {
 10087  		ptr := v_0
 10088  		if v_1.Op != OpARM64MOVDconst {
 10089  			break
 10090  		}
 10091  		c := auxIntToInt64(v_1.AuxInt)
 10092  		mem := v_2
 10093  		if !(is32Bit(c << 1)) {
 10094  			break
 10095  		}
 10096  		v.reset(OpARM64MOVHload)
 10097  		v.AuxInt = int32ToAuxInt(int32(c) << 1)
 10098  		v.AddArg2(ptr, mem)
 10099  		return true
 10100  	}
 10101  	return false
 10102  }
 10103  func rewriteValueARM64_OpARM64MOVHreg(v *Value) bool {
 10104  	v_0 := v.Args[0]
 10105  	// match: (MOVHreg (MOVDconst [c]))
 10106  	// result: (MOVDconst [int64(int16(c))])
 10107  	for {
 10108  		if v_0.Op != OpARM64MOVDconst {
 10109  			break
 10110  		}
 10111  		c := auxIntToInt64(v_0.AuxInt)
 10112  		v.reset(OpARM64MOVDconst)
 10113  		v.AuxInt = int64ToAuxInt(int64(int16(c)))
 10114  		return true
 10115  	}
 10116  	// match: (MOVHreg x)
 10117  	// cond: v.Type.Size() <= 2
 10118  	// result: x
 10119  	for {
 10120  		x := v_0
 10121  		if !(v.Type.Size() <= 2) {
 10122  			break
 10123  		}
 10124  		v.copyOf(x)
 10125  		return true
 10126  	}
 10127  	// match: (MOVHreg <t> (ANDconst x [c]))
 10128  	// cond: uint64(c) & uint64(0xffffffffffff8000) == 0
 10129  	// result: (ANDconst <t> x [c])
 10130  	for {
 10131  		t := v.Type
 10132  		if v_0.Op != OpARM64ANDconst {
 10133  			break
 10134  		}
 10135  		c := auxIntToInt64(v_0.AuxInt)
 10136  		x := v_0.Args[0]
 10137  		if !(uint64(c)&uint64(0xffffffffffff8000) == 0) {
 10138  			break
 10139  		}
 10140  		v.reset(OpARM64ANDconst)
 10141  		v.Type = t
 10142  		v.AuxInt = int64ToAuxInt(c)
 10143  		v.AddArg(x)
 10144  		return true
 10145  	}
 10146  	// match: (MOVHreg (SLLconst [lc] x))
 10147  	// cond: lc < 16
 10148  	// result: (SBFIZ [armBFAuxInt(lc, 16-lc)] x)
 10149  	for {
 10150  		if v_0.Op != OpARM64SLLconst {
 10151  			break
 10152  		}
 10153  		lc := auxIntToInt64(v_0.AuxInt)
 10154  		x := v_0.Args[0]
 10155  		if !(lc < 16) {
 10156  			break
 10157  		}
 10158  		v.reset(OpARM64SBFIZ)
 10159  		v.AuxInt = arm64BitFieldToAuxInt(armBFAuxInt(lc, 16-lc))
 10160  		v.AddArg(x)
 10161  		return true
 10162  	}
 10163  	// match: (MOVHreg (SBFX [bfc] x))
 10164  	// cond: bfc.width() <= 16
 10165  	// result: (SBFX [bfc] x)
 10166  	for {
 10167  		if v_0.Op != OpARM64SBFX {
 10168  			break
 10169  		}
 10170  		bfc := auxIntToArm64BitField(v_0.AuxInt)
 10171  		x := v_0.Args[0]
 10172  		if !(bfc.width() <= 16) {
 10173  			break
 10174  		}
 10175  		v.reset(OpARM64SBFX)
 10176  		v.AuxInt = arm64BitFieldToAuxInt(bfc)
 10177  		v.AddArg(x)
 10178  		return true
 10179  	}
 10180  	return false
 10181  }
 10182  func rewriteValueARM64_OpARM64MOVHstore(v *Value) bool {
 10183  	v_2 := v.Args[2]
 10184  	v_1 := v.Args[1]
 10185  	v_0 := v.Args[0]
 10186  	b := v.Block
 10187  	config := b.Func.Config
 10188  	// match: (MOVHstore [off1] {sym} (ADDconst [off2] ptr) val mem)
 10189  	// cond: is32Bit(int64(off1)+off2) && (ptr.Op != OpSB || !config.ctxt.Flag_dynlink)
 10190  	// result: (MOVHstore [off1+int32(off2)] {sym} ptr val mem)
 10191  	for {
 10192  		off1 := auxIntToInt32(v.AuxInt)
 10193  		sym := auxToSym(v.Aux)
 10194  		if v_0.Op != OpARM64ADDconst {
 10195  			break
 10196  		}
 10197  		off2 := auxIntToInt64(v_0.AuxInt)
 10198  		ptr := v_0.Args[0]
 10199  		val := v_1
 10200  		mem := v_2
 10201  		if !(is32Bit(int64(off1)+off2) && (ptr.Op != OpSB || !config.ctxt.Flag_dynlink)) {
 10202  			break
 10203  		}
 10204  		v.reset(OpARM64MOVHstore)
 10205  		v.AuxInt = int32ToAuxInt(off1 + int32(off2))
 10206  		v.Aux = symToAux(sym)
 10207  		v.AddArg3(ptr, val, mem)
 10208  		return true
 10209  	}
 10210  	// match: (MOVHstore [off] {sym} (ADD ptr idx) val mem)
 10211  	// cond: off == 0 && sym == nil
 10212  	// result: (MOVHstoreidx ptr idx val mem)
 10213  	for {
 10214  		off := auxIntToInt32(v.AuxInt)
 10215  		sym := auxToSym(v.Aux)
 10216  		if v_0.Op != OpARM64ADD {
 10217  			break
 10218  		}
 10219  		idx := v_0.Args[1]
 10220  		ptr := v_0.Args[0]
 10221  		val := v_1
 10222  		mem := v_2
 10223  		if !(off == 0 && sym == nil) {
 10224  			break
 10225  		}
 10226  		v.reset(OpARM64MOVHstoreidx)
 10227  		v.AddArg4(ptr, idx, val, mem)
 10228  		return true
 10229  	}
 10230  	// match: (MOVHstore [off] {sym} (ADDshiftLL [1] ptr idx) val mem)
 10231  	// cond: off == 0 && sym == nil
 10232  	// result: (MOVHstoreidx2 ptr idx val mem)
 10233  	for {
 10234  		off := auxIntToInt32(v.AuxInt)
 10235  		sym := auxToSym(v.Aux)
 10236  		if v_0.Op != OpARM64ADDshiftLL || auxIntToInt64(v_0.AuxInt) != 1 {
 10237  			break
 10238  		}
 10239  		idx := v_0.Args[1]
 10240  		ptr := v_0.Args[0]
 10241  		val := v_1
 10242  		mem := v_2
 10243  		if !(off == 0 && sym == nil) {
 10244  			break
 10245  		}
 10246  		v.reset(OpARM64MOVHstoreidx2)
 10247  		v.AddArg4(ptr, idx, val, mem)
 10248  		return true
 10249  	}
 10250  	// match: (MOVHstore [off1] {sym1} (MOVDaddr [off2] {sym2} ptr) val mem)
 10251  	// cond: canMergeSym(sym1,sym2) && is32Bit(int64(off1)+int64(off2)) && (ptr.Op != OpSB || !config.ctxt.Flag_dynlink)
 10252  	// result: (MOVHstore [off1+off2] {mergeSym(sym1,sym2)} ptr val mem)
 10253  	for {
 10254  		off1 := auxIntToInt32(v.AuxInt)
 10255  		sym1 := auxToSym(v.Aux)
 10256  		if v_0.Op != OpARM64MOVDaddr {
 10257  			break
 10258  		}
 10259  		off2 := auxIntToInt32(v_0.AuxInt)
 10260  		sym2 := auxToSym(v_0.Aux)
 10261  		ptr := v_0.Args[0]
 10262  		val := v_1
 10263  		mem := v_2
 10264  		if !(canMergeSym(sym1, sym2) && is32Bit(int64(off1)+int64(off2)) && (ptr.Op != OpSB || !config.ctxt.Flag_dynlink)) {
 10265  			break
 10266  		}
 10267  		v.reset(OpARM64MOVHstore)
 10268  		v.AuxInt = int32ToAuxInt(off1 + off2)
 10269  		v.Aux = symToAux(mergeSym(sym1, sym2))
 10270  		v.AddArg3(ptr, val, mem)
 10271  		return true
 10272  	}
 10273  	// match: (MOVHstore [off] {sym} ptr (MOVHreg x) mem)
 10274  	// result: (MOVHstore [off] {sym} ptr x mem)
 10275  	for {
 10276  		off := auxIntToInt32(v.AuxInt)
 10277  		sym := auxToSym(v.Aux)
 10278  		ptr := v_0
 10279  		if v_1.Op != OpARM64MOVHreg {
 10280  			break
 10281  		}
 10282  		x := v_1.Args[0]
 10283  		mem := v_2
 10284  		v.reset(OpARM64MOVHstore)
 10285  		v.AuxInt = int32ToAuxInt(off)
 10286  		v.Aux = symToAux(sym)
 10287  		v.AddArg3(ptr, x, mem)
 10288  		return true
 10289  	}
 10290  	// match: (MOVHstore [off] {sym} ptr (MOVHUreg x) mem)
 10291  	// result: (MOVHstore [off] {sym} ptr x mem)
 10292  	for {
 10293  		off := auxIntToInt32(v.AuxInt)
 10294  		sym := auxToSym(v.Aux)
 10295  		ptr := v_0
 10296  		if v_1.Op != OpARM64MOVHUreg {
 10297  			break
 10298  		}
 10299  		x := v_1.Args[0]
 10300  		mem := v_2
 10301  		v.reset(OpARM64MOVHstore)
 10302  		v.AuxInt = int32ToAuxInt(off)
 10303  		v.Aux = symToAux(sym)
 10304  		v.AddArg3(ptr, x, mem)
 10305  		return true
 10306  	}
 10307  	// match: (MOVHstore [off] {sym} ptr (MOVWreg x) mem)
 10308  	// result: (MOVHstore [off] {sym} ptr x mem)
 10309  	for {
 10310  		off := auxIntToInt32(v.AuxInt)
 10311  		sym := auxToSym(v.Aux)
 10312  		ptr := v_0
 10313  		if v_1.Op != OpARM64MOVWreg {
 10314  			break
 10315  		}
 10316  		x := v_1.Args[0]
 10317  		mem := v_2
 10318  		v.reset(OpARM64MOVHstore)
 10319  		v.AuxInt = int32ToAuxInt(off)
 10320  		v.Aux = symToAux(sym)
 10321  		v.AddArg3(ptr, x, mem)
 10322  		return true
 10323  	}
 10324  	// match: (MOVHstore [off] {sym} ptr (MOVWUreg x) mem)
 10325  	// result: (MOVHstore [off] {sym} ptr x mem)
 10326  	for {
 10327  		off := auxIntToInt32(v.AuxInt)
 10328  		sym := auxToSym(v.Aux)
 10329  		ptr := v_0
 10330  		if v_1.Op != OpARM64MOVWUreg {
 10331  			break
 10332  		}
 10333  		x := v_1.Args[0]
 10334  		mem := v_2
 10335  		v.reset(OpARM64MOVHstore)
 10336  		v.AuxInt = int32ToAuxInt(off)
 10337  		v.Aux = symToAux(sym)
 10338  		v.AddArg3(ptr, x, mem)
 10339  		return true
 10340  	}
 10341  	return false
 10342  }
 10343  func rewriteValueARM64_OpARM64MOVHstoreidx(v *Value) bool {
 10344  	v_3 := v.Args[3]
 10345  	v_2 := v.Args[2]
 10346  	v_1 := v.Args[1]
 10347  	v_0 := v.Args[0]
 10348  	// match: (MOVHstoreidx ptr (MOVDconst [c]) val mem)
 10349  	// cond: is32Bit(c)
 10350  	// result: (MOVHstore [int32(c)] ptr val mem)
 10351  	for {
 10352  		ptr := v_0
 10353  		if v_1.Op != OpARM64MOVDconst {
 10354  			break
 10355  		}
 10356  		c := auxIntToInt64(v_1.AuxInt)
 10357  		val := v_2
 10358  		mem := v_3
 10359  		if !(is32Bit(c)) {
 10360  			break
 10361  		}
 10362  		v.reset(OpARM64MOVHstore)
 10363  		v.AuxInt = int32ToAuxInt(int32(c))
 10364  		v.AddArg3(ptr, val, mem)
 10365  		return true
 10366  	}
 10367  	// match: (MOVHstoreidx (MOVDconst [c]) idx val mem)
 10368  	// cond: is32Bit(c)
 10369  	// result: (MOVHstore [int32(c)] idx val mem)
 10370  	for {
 10371  		if v_0.Op != OpARM64MOVDconst {
 10372  			break
 10373  		}
 10374  		c := auxIntToInt64(v_0.AuxInt)
 10375  		idx := v_1
 10376  		val := v_2
 10377  		mem := v_3
 10378  		if !(is32Bit(c)) {
 10379  			break
 10380  		}
 10381  		v.reset(OpARM64MOVHstore)
 10382  		v.AuxInt = int32ToAuxInt(int32(c))
 10383  		v.AddArg3(idx, val, mem)
 10384  		return true
 10385  	}
 10386  	// match: (MOVHstoreidx ptr (SLLconst [1] idx) val mem)
 10387  	// result: (MOVHstoreidx2 ptr idx val mem)
 10388  	for {
 10389  		ptr := v_0
 10390  		if v_1.Op != OpARM64SLLconst || auxIntToInt64(v_1.AuxInt) != 1 {
 10391  			break
 10392  		}
 10393  		idx := v_1.Args[0]
 10394  		val := v_2
 10395  		mem := v_3
 10396  		v.reset(OpARM64MOVHstoreidx2)
 10397  		v.AddArg4(ptr, idx, val, mem)
 10398  		return true
 10399  	}
 10400  	// match: (MOVHstoreidx ptr (ADD idx idx) val mem)
 10401  	// result: (MOVHstoreidx2 ptr idx val mem)
 10402  	for {
 10403  		ptr := v_0
 10404  		if v_1.Op != OpARM64ADD {
 10405  			break
 10406  		}
 10407  		idx := v_1.Args[1]
 10408  		if idx != v_1.Args[0] {
 10409  			break
 10410  		}
 10411  		val := v_2
 10412  		mem := v_3
 10413  		v.reset(OpARM64MOVHstoreidx2)
 10414  		v.AddArg4(ptr, idx, val, mem)
 10415  		return true
 10416  	}
 10417  	// match: (MOVHstoreidx (SLLconst [1] idx) ptr val mem)
 10418  	// result: (MOVHstoreidx2 ptr idx val mem)
 10419  	for {
 10420  		if v_0.Op != OpARM64SLLconst || auxIntToInt64(v_0.AuxInt) != 1 {
 10421  			break
 10422  		}
 10423  		idx := v_0.Args[0]
 10424  		ptr := v_1
 10425  		val := v_2
 10426  		mem := v_3
 10427  		v.reset(OpARM64MOVHstoreidx2)
 10428  		v.AddArg4(ptr, idx, val, mem)
 10429  		return true
 10430  	}
 10431  	// match: (MOVHstoreidx (ADD idx idx) ptr val mem)
 10432  	// result: (MOVHstoreidx2 ptr idx val mem)
 10433  	for {
 10434  		if v_0.Op != OpARM64ADD {
 10435  			break
 10436  		}
 10437  		idx := v_0.Args[1]
 10438  		if idx != v_0.Args[0] {
 10439  			break
 10440  		}
 10441  		ptr := v_1
 10442  		val := v_2
 10443  		mem := v_3
 10444  		v.reset(OpARM64MOVHstoreidx2)
 10445  		v.AddArg4(ptr, idx, val, mem)
 10446  		return true
 10447  	}
 10448  	// match: (MOVHstoreidx ptr idx (MOVHreg x) mem)
 10449  	// result: (MOVHstoreidx ptr idx x mem)
 10450  	for {
 10451  		ptr := v_0
 10452  		idx := v_1
 10453  		if v_2.Op != OpARM64MOVHreg {
 10454  			break
 10455  		}
 10456  		x := v_2.Args[0]
 10457  		mem := v_3
 10458  		v.reset(OpARM64MOVHstoreidx)
 10459  		v.AddArg4(ptr, idx, x, mem)
 10460  		return true
 10461  	}
 10462  	// match: (MOVHstoreidx ptr idx (MOVHUreg x) mem)
 10463  	// result: (MOVHstoreidx ptr idx x mem)
 10464  	for {
 10465  		ptr := v_0
 10466  		idx := v_1
 10467  		if v_2.Op != OpARM64MOVHUreg {
 10468  			break
 10469  		}
 10470  		x := v_2.Args[0]
 10471  		mem := v_3
 10472  		v.reset(OpARM64MOVHstoreidx)
 10473  		v.AddArg4(ptr, idx, x, mem)
 10474  		return true
 10475  	}
 10476  	// match: (MOVHstoreidx ptr idx (MOVWreg x) mem)
 10477  	// result: (MOVHstoreidx ptr idx x mem)
 10478  	for {
 10479  		ptr := v_0
 10480  		idx := v_1
 10481  		if v_2.Op != OpARM64MOVWreg {
 10482  			break
 10483  		}
 10484  		x := v_2.Args[0]
 10485  		mem := v_3
 10486  		v.reset(OpARM64MOVHstoreidx)
 10487  		v.AddArg4(ptr, idx, x, mem)
 10488  		return true
 10489  	}
 10490  	// match: (MOVHstoreidx ptr idx (MOVWUreg x) mem)
 10491  	// result: (MOVHstoreidx ptr idx x mem)
 10492  	for {
 10493  		ptr := v_0
 10494  		idx := v_1
 10495  		if v_2.Op != OpARM64MOVWUreg {
 10496  			break
 10497  		}
 10498  		x := v_2.Args[0]
 10499  		mem := v_3
 10500  		v.reset(OpARM64MOVHstoreidx)
 10501  		v.AddArg4(ptr, idx, x, mem)
 10502  		return true
 10503  	}
 10504  	return false
 10505  }
 10506  func rewriteValueARM64_OpARM64MOVHstoreidx2(v *Value) bool {
 10507  	v_3 := v.Args[3]
 10508  	v_2 := v.Args[2]
 10509  	v_1 := v.Args[1]
 10510  	v_0 := v.Args[0]
 10511  	// match: (MOVHstoreidx2 ptr (MOVDconst [c]) val mem)
 10512  	// cond: is32Bit(c<<1)
 10513  	// result: (MOVHstore [int32(c)<<1] ptr val mem)
 10514  	for {
 10515  		ptr := v_0
 10516  		if v_1.Op != OpARM64MOVDconst {
 10517  			break
 10518  		}
 10519  		c := auxIntToInt64(v_1.AuxInt)
 10520  		val := v_2
 10521  		mem := v_3
 10522  		if !(is32Bit(c << 1)) {
 10523  			break
 10524  		}
 10525  		v.reset(OpARM64MOVHstore)
 10526  		v.AuxInt = int32ToAuxInt(int32(c) << 1)
 10527  		v.AddArg3(ptr, val, mem)
 10528  		return true
 10529  	}
 10530  	// match: (MOVHstoreidx2 ptr idx (MOVHreg x) mem)
 10531  	// result: (MOVHstoreidx2 ptr idx x mem)
 10532  	for {
 10533  		ptr := v_0
 10534  		idx := v_1
 10535  		if v_2.Op != OpARM64MOVHreg {
 10536  			break
 10537  		}
 10538  		x := v_2.Args[0]
 10539  		mem := v_3
 10540  		v.reset(OpARM64MOVHstoreidx2)
 10541  		v.AddArg4(ptr, idx, x, mem)
 10542  		return true
 10543  	}
 10544  	// match: (MOVHstoreidx2 ptr idx (MOVHUreg x) mem)
 10545  	// result: (MOVHstoreidx2 ptr idx x mem)
 10546  	for {
 10547  		ptr := v_0
 10548  		idx := v_1
 10549  		if v_2.Op != OpARM64MOVHUreg {
 10550  			break
 10551  		}
 10552  		x := v_2.Args[0]
 10553  		mem := v_3
 10554  		v.reset(OpARM64MOVHstoreidx2)
 10555  		v.AddArg4(ptr, idx, x, mem)
 10556  		return true
 10557  	}
 10558  	// match: (MOVHstoreidx2 ptr idx (MOVWreg x) mem)
 10559  	// result: (MOVHstoreidx2 ptr idx x mem)
 10560  	for {
 10561  		ptr := v_0
 10562  		idx := v_1
 10563  		if v_2.Op != OpARM64MOVWreg {
 10564  			break
 10565  		}
 10566  		x := v_2.Args[0]
 10567  		mem := v_3
 10568  		v.reset(OpARM64MOVHstoreidx2)
 10569  		v.AddArg4(ptr, idx, x, mem)
 10570  		return true
 10571  	}
 10572  	// match: (MOVHstoreidx2 ptr idx (MOVWUreg x) mem)
 10573  	// result: (MOVHstoreidx2 ptr idx x mem)
 10574  	for {
 10575  		ptr := v_0
 10576  		idx := v_1
 10577  		if v_2.Op != OpARM64MOVWUreg {
 10578  			break
 10579  		}
 10580  		x := v_2.Args[0]
 10581  		mem := v_3
 10582  		v.reset(OpARM64MOVHstoreidx2)
 10583  		v.AddArg4(ptr, idx, x, mem)
 10584  		return true
 10585  	}
 10586  	return false
 10587  }
 10588  func rewriteValueARM64_OpARM64MOVWUload(v *Value) bool {
 10589  	v_1 := v.Args[1]
 10590  	v_0 := v.Args[0]
 10591  	b := v.Block
 10592  	config := b.Func.Config
 10593  	// match: (MOVWUload [off] {sym} ptr (FMOVSstore [off] {sym} ptr val _))
 10594  	// result: (FMOVSfpgp val)
 10595  	for {
 10596  		off := auxIntToInt32(v.AuxInt)
 10597  		sym := auxToSym(v.Aux)
 10598  		ptr := v_0
 10599  		if v_1.Op != OpARM64FMOVSstore || auxIntToInt32(v_1.AuxInt) != off || auxToSym(v_1.Aux) != sym {
 10600  			break
 10601  		}
 10602  		val := v_1.Args[1]
 10603  		if ptr != v_1.Args[0] {
 10604  			break
 10605  		}
 10606  		v.reset(OpARM64FMOVSfpgp)
 10607  		v.AddArg(val)
 10608  		return true
 10609  	}
 10610  	// match: (MOVWUload [off1] {sym} (ADDconst [off2] ptr) mem)
 10611  	// cond: is32Bit(int64(off1)+off2) && (ptr.Op != OpSB || !config.ctxt.Flag_dynlink)
 10612  	// result: (MOVWUload [off1+int32(off2)] {sym} ptr mem)
 10613  	for {
 10614  		off1 := auxIntToInt32(v.AuxInt)
 10615  		sym := auxToSym(v.Aux)
 10616  		if v_0.Op != OpARM64ADDconst {
 10617  			break
 10618  		}
 10619  		off2 := auxIntToInt64(v_0.AuxInt)
 10620  		ptr := v_0.Args[0]
 10621  		mem := v_1
 10622  		if !(is32Bit(int64(off1)+off2) && (ptr.Op != OpSB || !config.ctxt.Flag_dynlink)) {
 10623  			break
 10624  		}
 10625  		v.reset(OpARM64MOVWUload)
 10626  		v.AuxInt = int32ToAuxInt(off1 + int32(off2))
 10627  		v.Aux = symToAux(sym)
 10628  		v.AddArg2(ptr, mem)
 10629  		return true
 10630  	}
 10631  	// match: (MOVWUload [off] {sym} (ADD ptr idx) mem)
 10632  	// cond: off == 0 && sym == nil
 10633  	// result: (MOVWUloadidx ptr idx mem)
 10634  	for {
 10635  		off := auxIntToInt32(v.AuxInt)
 10636  		sym := auxToSym(v.Aux)
 10637  		if v_0.Op != OpARM64ADD {
 10638  			break
 10639  		}
 10640  		idx := v_0.Args[1]
 10641  		ptr := v_0.Args[0]
 10642  		mem := v_1
 10643  		if !(off == 0 && sym == nil) {
 10644  			break
 10645  		}
 10646  		v.reset(OpARM64MOVWUloadidx)
 10647  		v.AddArg3(ptr, idx, mem)
 10648  		return true
 10649  	}
 10650  	// match: (MOVWUload [off] {sym} (ADDshiftLL [2] ptr idx) mem)
 10651  	// cond: off == 0 && sym == nil
 10652  	// result: (MOVWUloadidx4 ptr idx mem)
 10653  	for {
 10654  		off := auxIntToInt32(v.AuxInt)
 10655  		sym := auxToSym(v.Aux)
 10656  		if v_0.Op != OpARM64ADDshiftLL || auxIntToInt64(v_0.AuxInt) != 2 {
 10657  			break
 10658  		}
 10659  		idx := v_0.Args[1]
 10660  		ptr := v_0.Args[0]
 10661  		mem := v_1
 10662  		if !(off == 0 && sym == nil) {
 10663  			break
 10664  		}
 10665  		v.reset(OpARM64MOVWUloadidx4)
 10666  		v.AddArg3(ptr, idx, mem)
 10667  		return true
 10668  	}
 10669  	// match: (MOVWUload [off1] {sym1} (MOVDaddr [off2] {sym2} ptr) mem)
 10670  	// cond: canMergeSym(sym1,sym2) && is32Bit(int64(off1)+int64(off2)) && (ptr.Op != OpSB || !config.ctxt.Flag_dynlink)
 10671  	// result: (MOVWUload [off1+off2] {mergeSym(sym1,sym2)} ptr mem)
 10672  	for {
 10673  		off1 := auxIntToInt32(v.AuxInt)
 10674  		sym1 := auxToSym(v.Aux)
 10675  		if v_0.Op != OpARM64MOVDaddr {
 10676  			break
 10677  		}
 10678  		off2 := auxIntToInt32(v_0.AuxInt)
 10679  		sym2 := auxToSym(v_0.Aux)
 10680  		ptr := v_0.Args[0]
 10681  		mem := v_1
 10682  		if !(canMergeSym(sym1, sym2) && is32Bit(int64(off1)+int64(off2)) && (ptr.Op != OpSB || !config.ctxt.Flag_dynlink)) {
 10683  			break
 10684  		}
 10685  		v.reset(OpARM64MOVWUload)
 10686  		v.AuxInt = int32ToAuxInt(off1 + off2)
 10687  		v.Aux = symToAux(mergeSym(sym1, sym2))
 10688  		v.AddArg2(ptr, mem)
 10689  		return true
 10690  	}
 10691  	// match: (MOVWUload [off] {sym} (SB) _)
 10692  	// cond: symIsRO(sym)
 10693  	// result: (MOVDconst [int64(read32(sym, int64(off), config.ctxt.Arch.ByteOrder))])
 10694  	for {
 10695  		off := auxIntToInt32(v.AuxInt)
 10696  		sym := auxToSym(v.Aux)
 10697  		if v_0.Op != OpSB || !(symIsRO(sym)) {
 10698  			break
 10699  		}
 10700  		v.reset(OpARM64MOVDconst)
 10701  		v.AuxInt = int64ToAuxInt(int64(read32(sym, int64(off), config.ctxt.Arch.ByteOrder)))
 10702  		return true
 10703  	}
 10704  	return false
 10705  }
 10706  func rewriteValueARM64_OpARM64MOVWUloadidx(v *Value) bool {
 10707  	v_2 := v.Args[2]
 10708  	v_1 := v.Args[1]
 10709  	v_0 := v.Args[0]
 10710  	// match: (MOVWUloadidx ptr (MOVDconst [c]) mem)
 10711  	// cond: is32Bit(c)
 10712  	// result: (MOVWUload [int32(c)] ptr mem)
 10713  	for {
 10714  		ptr := v_0
 10715  		if v_1.Op != OpARM64MOVDconst {
 10716  			break
 10717  		}
 10718  		c := auxIntToInt64(v_1.AuxInt)
 10719  		mem := v_2
 10720  		if !(is32Bit(c)) {
 10721  			break
 10722  		}
 10723  		v.reset(OpARM64MOVWUload)
 10724  		v.AuxInt = int32ToAuxInt(int32(c))
 10725  		v.AddArg2(ptr, mem)
 10726  		return true
 10727  	}
 10728  	// match: (MOVWUloadidx (MOVDconst [c]) ptr mem)
 10729  	// cond: is32Bit(c)
 10730  	// result: (MOVWUload [int32(c)] ptr mem)
 10731  	for {
 10732  		if v_0.Op != OpARM64MOVDconst {
 10733  			break
 10734  		}
 10735  		c := auxIntToInt64(v_0.AuxInt)
 10736  		ptr := v_1
 10737  		mem := v_2
 10738  		if !(is32Bit(c)) {
 10739  			break
 10740  		}
 10741  		v.reset(OpARM64MOVWUload)
 10742  		v.AuxInt = int32ToAuxInt(int32(c))
 10743  		v.AddArg2(ptr, mem)
 10744  		return true
 10745  	}
 10746  	// match: (MOVWUloadidx ptr (SLLconst [2] idx) mem)
 10747  	// result: (MOVWUloadidx4 ptr idx mem)
 10748  	for {
 10749  		ptr := v_0
 10750  		if v_1.Op != OpARM64SLLconst || auxIntToInt64(v_1.AuxInt) != 2 {
 10751  			break
 10752  		}
 10753  		idx := v_1.Args[0]
 10754  		mem := v_2
 10755  		v.reset(OpARM64MOVWUloadidx4)
 10756  		v.AddArg3(ptr, idx, mem)
 10757  		return true
 10758  	}
 10759  	// match: (MOVWUloadidx (SLLconst [2] idx) ptr mem)
 10760  	// result: (MOVWUloadidx4 ptr idx mem)
 10761  	for {
 10762  		if v_0.Op != OpARM64SLLconst || auxIntToInt64(v_0.AuxInt) != 2 {
 10763  			break
 10764  		}
 10765  		idx := v_0.Args[0]
 10766  		ptr := v_1
 10767  		mem := v_2
 10768  		v.reset(OpARM64MOVWUloadidx4)
 10769  		v.AddArg3(ptr, idx, mem)
 10770  		return true
 10771  	}
 10772  	return false
 10773  }
 10774  func rewriteValueARM64_OpARM64MOVWUloadidx4(v *Value) bool {
 10775  	v_2 := v.Args[2]
 10776  	v_1 := v.Args[1]
 10777  	v_0 := v.Args[0]
 10778  	// match: (MOVWUloadidx4 ptr (MOVDconst [c]) mem)
 10779  	// cond: is32Bit(c<<2)
 10780  	// result: (MOVWUload [int32(c)<<2] ptr mem)
 10781  	for {
 10782  		ptr := v_0
 10783  		if v_1.Op != OpARM64MOVDconst {
 10784  			break
 10785  		}
 10786  		c := auxIntToInt64(v_1.AuxInt)
 10787  		mem := v_2
 10788  		if !(is32Bit(c << 2)) {
 10789  			break
 10790  		}
 10791  		v.reset(OpARM64MOVWUload)
 10792  		v.AuxInt = int32ToAuxInt(int32(c) << 2)
 10793  		v.AddArg2(ptr, mem)
 10794  		return true
 10795  	}
 10796  	return false
 10797  }
 10798  func rewriteValueARM64_OpARM64MOVWUreg(v *Value) bool {
 10799  	v_0 := v.Args[0]
 10800  	// match: (MOVWUreg (ANDconst [c] x))
 10801  	// result: (ANDconst [c&(1<<32-1)] x)
 10802  	for {
 10803  		if v_0.Op != OpARM64ANDconst {
 10804  			break
 10805  		}
 10806  		c := auxIntToInt64(v_0.AuxInt)
 10807  		x := v_0.Args[0]
 10808  		v.reset(OpARM64ANDconst)
 10809  		v.AuxInt = int64ToAuxInt(c & (1<<32 - 1))
 10810  		v.AddArg(x)
 10811  		return true
 10812  	}
 10813  	// match: (MOVWUreg (MOVDconst [c]))
 10814  	// result: (MOVDconst [int64(uint32(c))])
 10815  	for {
 10816  		if v_0.Op != OpARM64MOVDconst {
 10817  			break
 10818  		}
 10819  		c := auxIntToInt64(v_0.AuxInt)
 10820  		v.reset(OpARM64MOVDconst)
 10821  		v.AuxInt = int64ToAuxInt(int64(uint32(c)))
 10822  		return true
 10823  	}
 10824  	// match: (MOVWUreg x)
 10825  	// cond: v.Type.Size() <= 4
 10826  	// result: x
 10827  	for {
 10828  		x := v_0
 10829  		if !(v.Type.Size() <= 4) {
 10830  			break
 10831  		}
 10832  		v.copyOf(x)
 10833  		return true
 10834  	}
 10835  	// match: (MOVWUreg (SLLconst [lc] x))
 10836  	// cond: lc >= 32
 10837  	// result: (MOVDconst [0])
 10838  	for {
 10839  		if v_0.Op != OpARM64SLLconst {
 10840  			break
 10841  		}
 10842  		lc := auxIntToInt64(v_0.AuxInt)
 10843  		if !(lc >= 32) {
 10844  			break
 10845  		}
 10846  		v.reset(OpARM64MOVDconst)
 10847  		v.AuxInt = int64ToAuxInt(0)
 10848  		return true
 10849  	}
 10850  	// match: (MOVWUreg (SLLconst [lc] x))
 10851  	// cond: lc < 32
 10852  	// result: (UBFIZ [armBFAuxInt(lc, 32-lc)] x)
 10853  	for {
 10854  		if v_0.Op != OpARM64SLLconst {
 10855  			break
 10856  		}
 10857  		lc := auxIntToInt64(v_0.AuxInt)
 10858  		x := v_0.Args[0]
 10859  		if !(lc < 32) {
 10860  			break
 10861  		}
 10862  		v.reset(OpARM64UBFIZ)
 10863  		v.AuxInt = arm64BitFieldToAuxInt(armBFAuxInt(lc, 32-lc))
 10864  		v.AddArg(x)
 10865  		return true
 10866  	}
 10867  	// match: (MOVWUreg (SRLconst [rc] x))
 10868  	// cond: rc < 32
 10869  	// result: (UBFX [armBFAuxInt(rc, 32)] x)
 10870  	for {
 10871  		if v_0.Op != OpARM64SRLconst {
 10872  			break
 10873  		}
 10874  		rc := auxIntToInt64(v_0.AuxInt)
 10875  		x := v_0.Args[0]
 10876  		if !(rc < 32) {
 10877  			break
 10878  		}
 10879  		v.reset(OpARM64UBFX)
 10880  		v.AuxInt = arm64BitFieldToAuxInt(armBFAuxInt(rc, 32))
 10881  		v.AddArg(x)
 10882  		return true
 10883  	}
 10884  	// match: (MOVWUreg (UBFX [bfc] x))
 10885  	// cond: bfc.width() <= 32
 10886  	// result: (UBFX [bfc] x)
 10887  	for {
 10888  		if v_0.Op != OpARM64UBFX {
 10889  			break
 10890  		}
 10891  		bfc := auxIntToArm64BitField(v_0.AuxInt)
 10892  		x := v_0.Args[0]
 10893  		if !(bfc.width() <= 32) {
 10894  			break
 10895  		}
 10896  		v.reset(OpARM64UBFX)
 10897  		v.AuxInt = arm64BitFieldToAuxInt(bfc)
 10898  		v.AddArg(x)
 10899  		return true
 10900  	}
 10901  	return false
 10902  }
 10903  func rewriteValueARM64_OpARM64MOVWload(v *Value) bool {
 10904  	v_1 := v.Args[1]
 10905  	v_0 := v.Args[0]
 10906  	b := v.Block
 10907  	config := b.Func.Config
 10908  	// match: (MOVWload [off1] {sym} (ADDconst [off2] ptr) mem)
 10909  	// cond: is32Bit(int64(off1)+off2) && (ptr.Op != OpSB || !config.ctxt.Flag_dynlink)
 10910  	// result: (MOVWload [off1+int32(off2)] {sym} ptr mem)
 10911  	for {
 10912  		off1 := auxIntToInt32(v.AuxInt)
 10913  		sym := auxToSym(v.Aux)
 10914  		if v_0.Op != OpARM64ADDconst {
 10915  			break
 10916  		}
 10917  		off2 := auxIntToInt64(v_0.AuxInt)
 10918  		ptr := v_0.Args[0]
 10919  		mem := v_1
 10920  		if !(is32Bit(int64(off1)+off2) && (ptr.Op != OpSB || !config.ctxt.Flag_dynlink)) {
 10921  			break
 10922  		}
 10923  		v.reset(OpARM64MOVWload)
 10924  		v.AuxInt = int32ToAuxInt(off1 + int32(off2))
 10925  		v.Aux = symToAux(sym)
 10926  		v.AddArg2(ptr, mem)
 10927  		return true
 10928  	}
 10929  	// match: (MOVWload [off] {sym} (ADD ptr idx) mem)
 10930  	// cond: off == 0 && sym == nil
 10931  	// result: (MOVWloadidx ptr idx mem)
 10932  	for {
 10933  		off := auxIntToInt32(v.AuxInt)
 10934  		sym := auxToSym(v.Aux)
 10935  		if v_0.Op != OpARM64ADD {
 10936  			break
 10937  		}
 10938  		idx := v_0.Args[1]
 10939  		ptr := v_0.Args[0]
 10940  		mem := v_1
 10941  		if !(off == 0 && sym == nil) {
 10942  			break
 10943  		}
 10944  		v.reset(OpARM64MOVWloadidx)
 10945  		v.AddArg3(ptr, idx, mem)
 10946  		return true
 10947  	}
 10948  	// match: (MOVWload [off] {sym} (ADDshiftLL [2] ptr idx) mem)
 10949  	// cond: off == 0 && sym == nil
 10950  	// result: (MOVWloadidx4 ptr idx mem)
 10951  	for {
 10952  		off := auxIntToInt32(v.AuxInt)
 10953  		sym := auxToSym(v.Aux)
 10954  		if v_0.Op != OpARM64ADDshiftLL || auxIntToInt64(v_0.AuxInt) != 2 {
 10955  			break
 10956  		}
 10957  		idx := v_0.Args[1]
 10958  		ptr := v_0.Args[0]
 10959  		mem := v_1
 10960  		if !(off == 0 && sym == nil) {
 10961  			break
 10962  		}
 10963  		v.reset(OpARM64MOVWloadidx4)
 10964  		v.AddArg3(ptr, idx, mem)
 10965  		return true
 10966  	}
 10967  	// match: (MOVWload [off1] {sym1} (MOVDaddr [off2] {sym2} ptr) mem)
 10968  	// cond: canMergeSym(sym1,sym2) && is32Bit(int64(off1)+int64(off2)) && (ptr.Op != OpSB || !config.ctxt.Flag_dynlink)
 10969  	// result: (MOVWload [off1+off2] {mergeSym(sym1,sym2)} ptr mem)
 10970  	for {
 10971  		off1 := auxIntToInt32(v.AuxInt)
 10972  		sym1 := auxToSym(v.Aux)
 10973  		if v_0.Op != OpARM64MOVDaddr {
 10974  			break
 10975  		}
 10976  		off2 := auxIntToInt32(v_0.AuxInt)
 10977  		sym2 := auxToSym(v_0.Aux)
 10978  		ptr := v_0.Args[0]
 10979  		mem := v_1
 10980  		if !(canMergeSym(sym1, sym2) && is32Bit(int64(off1)+int64(off2)) && (ptr.Op != OpSB || !config.ctxt.Flag_dynlink)) {
 10981  			break
 10982  		}
 10983  		v.reset(OpARM64MOVWload)
 10984  		v.AuxInt = int32ToAuxInt(off1 + off2)
 10985  		v.Aux = symToAux(mergeSym(sym1, sym2))
 10986  		v.AddArg2(ptr, mem)
 10987  		return true
 10988  	}
 10989  	// match: (MOVWload [off] {sym} (SB) _)
 10990  	// cond: symIsRO(sym)
 10991  	// result: (MOVDconst [int64(int32(read32(sym, int64(off), config.ctxt.Arch.ByteOrder)))])
 10992  	for {
 10993  		off := auxIntToInt32(v.AuxInt)
 10994  		sym := auxToSym(v.Aux)
 10995  		if v_0.Op != OpSB || !(symIsRO(sym)) {
 10996  			break
 10997  		}
 10998  		v.reset(OpARM64MOVDconst)
 10999  		v.AuxInt = int64ToAuxInt(int64(int32(read32(sym, int64(off), config.ctxt.Arch.ByteOrder))))
 11000  		return true
 11001  	}
 11002  	return false
 11003  }
 11004  func rewriteValueARM64_OpARM64MOVWloadidx(v *Value) bool {
 11005  	v_2 := v.Args[2]
 11006  	v_1 := v.Args[1]
 11007  	v_0 := v.Args[0]
 11008  	// match: (MOVWloadidx ptr (MOVDconst [c]) mem)
 11009  	// cond: is32Bit(c)
 11010  	// result: (MOVWload [int32(c)] ptr mem)
 11011  	for {
 11012  		ptr := v_0
 11013  		if v_1.Op != OpARM64MOVDconst {
 11014  			break
 11015  		}
 11016  		c := auxIntToInt64(v_1.AuxInt)
 11017  		mem := v_2
 11018  		if !(is32Bit(c)) {
 11019  			break
 11020  		}
 11021  		v.reset(OpARM64MOVWload)
 11022  		v.AuxInt = int32ToAuxInt(int32(c))
 11023  		v.AddArg2(ptr, mem)
 11024  		return true
 11025  	}
 11026  	// match: (MOVWloadidx (MOVDconst [c]) ptr mem)
 11027  	// cond: is32Bit(c)
 11028  	// result: (MOVWload [int32(c)] ptr mem)
 11029  	for {
 11030  		if v_0.Op != OpARM64MOVDconst {
 11031  			break
 11032  		}
 11033  		c := auxIntToInt64(v_0.AuxInt)
 11034  		ptr := v_1
 11035  		mem := v_2
 11036  		if !(is32Bit(c)) {
 11037  			break
 11038  		}
 11039  		v.reset(OpARM64MOVWload)
 11040  		v.AuxInt = int32ToAuxInt(int32(c))
 11041  		v.AddArg2(ptr, mem)
 11042  		return true
 11043  	}
 11044  	// match: (MOVWloadidx ptr (SLLconst [2] idx) mem)
 11045  	// result: (MOVWloadidx4 ptr idx mem)
 11046  	for {
 11047  		ptr := v_0
 11048  		if v_1.Op != OpARM64SLLconst || auxIntToInt64(v_1.AuxInt) != 2 {
 11049  			break
 11050  		}
 11051  		idx := v_1.Args[0]
 11052  		mem := v_2
 11053  		v.reset(OpARM64MOVWloadidx4)
 11054  		v.AddArg3(ptr, idx, mem)
 11055  		return true
 11056  	}
 11057  	// match: (MOVWloadidx (SLLconst [2] idx) ptr mem)
 11058  	// result: (MOVWloadidx4 ptr idx mem)
 11059  	for {
 11060  		if v_0.Op != OpARM64SLLconst || auxIntToInt64(v_0.AuxInt) != 2 {
 11061  			break
 11062  		}
 11063  		idx := v_0.Args[0]
 11064  		ptr := v_1
 11065  		mem := v_2
 11066  		v.reset(OpARM64MOVWloadidx4)
 11067  		v.AddArg3(ptr, idx, mem)
 11068  		return true
 11069  	}
 11070  	return false
 11071  }
 11072  func rewriteValueARM64_OpARM64MOVWloadidx4(v *Value) bool {
 11073  	v_2 := v.Args[2]
 11074  	v_1 := v.Args[1]
 11075  	v_0 := v.Args[0]
 11076  	// match: (MOVWloadidx4 ptr (MOVDconst [c]) mem)
 11077  	// cond: is32Bit(c<<2)
 11078  	// result: (MOVWload [int32(c)<<2] ptr mem)
 11079  	for {
 11080  		ptr := v_0
 11081  		if v_1.Op != OpARM64MOVDconst {
 11082  			break
 11083  		}
 11084  		c := auxIntToInt64(v_1.AuxInt)
 11085  		mem := v_2
 11086  		if !(is32Bit(c << 2)) {
 11087  			break
 11088  		}
 11089  		v.reset(OpARM64MOVWload)
 11090  		v.AuxInt = int32ToAuxInt(int32(c) << 2)
 11091  		v.AddArg2(ptr, mem)
 11092  		return true
 11093  	}
 11094  	return false
 11095  }
 11096  func rewriteValueARM64_OpARM64MOVWreg(v *Value) bool {
 11097  	v_0 := v.Args[0]
 11098  	// match: (MOVWreg (MOVDconst [c]))
 11099  	// result: (MOVDconst [int64(int32(c))])
 11100  	for {
 11101  		if v_0.Op != OpARM64MOVDconst {
 11102  			break
 11103  		}
 11104  		c := auxIntToInt64(v_0.AuxInt)
 11105  		v.reset(OpARM64MOVDconst)
 11106  		v.AuxInt = int64ToAuxInt(int64(int32(c)))
 11107  		return true
 11108  	}
 11109  	// match: (MOVWreg x)
 11110  	// cond: v.Type.Size() <= 4
 11111  	// result: x
 11112  	for {
 11113  		x := v_0
 11114  		if !(v.Type.Size() <= 4) {
 11115  			break
 11116  		}
 11117  		v.copyOf(x)
 11118  		return true
 11119  	}
 11120  	// match: (MOVWreg <t> (ANDconst x [c]))
 11121  	// cond: uint64(c) & uint64(0xffffffff80000000) == 0
 11122  	// result: (ANDconst <t> x [c])
 11123  	for {
 11124  		t := v.Type
 11125  		if v_0.Op != OpARM64ANDconst {
 11126  			break
 11127  		}
 11128  		c := auxIntToInt64(v_0.AuxInt)
 11129  		x := v_0.Args[0]
 11130  		if !(uint64(c)&uint64(0xffffffff80000000) == 0) {
 11131  			break
 11132  		}
 11133  		v.reset(OpARM64ANDconst)
 11134  		v.Type = t
 11135  		v.AuxInt = int64ToAuxInt(c)
 11136  		v.AddArg(x)
 11137  		return true
 11138  	}
 11139  	// match: (MOVWreg (SLLconst [lc] x))
 11140  	// cond: lc < 32
 11141  	// result: (SBFIZ [armBFAuxInt(lc, 32-lc)] x)
 11142  	for {
 11143  		if v_0.Op != OpARM64SLLconst {
 11144  			break
 11145  		}
 11146  		lc := auxIntToInt64(v_0.AuxInt)
 11147  		x := v_0.Args[0]
 11148  		if !(lc < 32) {
 11149  			break
 11150  		}
 11151  		v.reset(OpARM64SBFIZ)
 11152  		v.AuxInt = arm64BitFieldToAuxInt(armBFAuxInt(lc, 32-lc))
 11153  		v.AddArg(x)
 11154  		return true
 11155  	}
 11156  	// match: (MOVWreg (SBFX [bfc] x))
 11157  	// cond: bfc.width() <= 32
 11158  	// result: (SBFX [bfc] x)
 11159  	for {
 11160  		if v_0.Op != OpARM64SBFX {
 11161  			break
 11162  		}
 11163  		bfc := auxIntToArm64BitField(v_0.AuxInt)
 11164  		x := v_0.Args[0]
 11165  		if !(bfc.width() <= 32) {
 11166  			break
 11167  		}
 11168  		v.reset(OpARM64SBFX)
 11169  		v.AuxInt = arm64BitFieldToAuxInt(bfc)
 11170  		v.AddArg(x)
 11171  		return true
 11172  	}
 11173  	return false
 11174  }
 11175  func rewriteValueARM64_OpARM64MOVWstore(v *Value) bool {
 11176  	v_2 := v.Args[2]
 11177  	v_1 := v.Args[1]
 11178  	v_0 := v.Args[0]
 11179  	b := v.Block
 11180  	config := b.Func.Config
 11181  	// match: (MOVWstore [off] {sym} ptr (FMOVSfpgp val) mem)
 11182  	// result: (FMOVSstore [off] {sym} ptr val mem)
 11183  	for {
 11184  		off := auxIntToInt32(v.AuxInt)
 11185  		sym := auxToSym(v.Aux)
 11186  		ptr := v_0
 11187  		if v_1.Op != OpARM64FMOVSfpgp {
 11188  			break
 11189  		}
 11190  		val := v_1.Args[0]
 11191  		mem := v_2
 11192  		v.reset(OpARM64FMOVSstore)
 11193  		v.AuxInt = int32ToAuxInt(off)
 11194  		v.Aux = symToAux(sym)
 11195  		v.AddArg3(ptr, val, mem)
 11196  		return true
 11197  	}
 11198  	// match: (MOVWstore [off1] {sym} (ADDconst [off2] ptr) val mem)
 11199  	// cond: is32Bit(int64(off1)+off2) && (ptr.Op != OpSB || !config.ctxt.Flag_dynlink)
 11200  	// result: (MOVWstore [off1+int32(off2)] {sym} ptr val mem)
 11201  	for {
 11202  		off1 := auxIntToInt32(v.AuxInt)
 11203  		sym := auxToSym(v.Aux)
 11204  		if v_0.Op != OpARM64ADDconst {
 11205  			break
 11206  		}
 11207  		off2 := auxIntToInt64(v_0.AuxInt)
 11208  		ptr := v_0.Args[0]
 11209  		val := v_1
 11210  		mem := v_2
 11211  		if !(is32Bit(int64(off1)+off2) && (ptr.Op != OpSB || !config.ctxt.Flag_dynlink)) {
 11212  			break
 11213  		}
 11214  		v.reset(OpARM64MOVWstore)
 11215  		v.AuxInt = int32ToAuxInt(off1 + int32(off2))
 11216  		v.Aux = symToAux(sym)
 11217  		v.AddArg3(ptr, val, mem)
 11218  		return true
 11219  	}
 11220  	// match: (MOVWstore [off] {sym} (ADD ptr idx) val mem)
 11221  	// cond: off == 0 && sym == nil
 11222  	// result: (MOVWstoreidx ptr idx val mem)
 11223  	for {
 11224  		off := auxIntToInt32(v.AuxInt)
 11225  		sym := auxToSym(v.Aux)
 11226  		if v_0.Op != OpARM64ADD {
 11227  			break
 11228  		}
 11229  		idx := v_0.Args[1]
 11230  		ptr := v_0.Args[0]
 11231  		val := v_1
 11232  		mem := v_2
 11233  		if !(off == 0 && sym == nil) {
 11234  			break
 11235  		}
 11236  		v.reset(OpARM64MOVWstoreidx)
 11237  		v.AddArg4(ptr, idx, val, mem)
 11238  		return true
 11239  	}
 11240  	// match: (MOVWstore [off] {sym} (ADDshiftLL [2] ptr idx) val mem)
 11241  	// cond: off == 0 && sym == nil
 11242  	// result: (MOVWstoreidx4 ptr idx val mem)
 11243  	for {
 11244  		off := auxIntToInt32(v.AuxInt)
 11245  		sym := auxToSym(v.Aux)
 11246  		if v_0.Op != OpARM64ADDshiftLL || auxIntToInt64(v_0.AuxInt) != 2 {
 11247  			break
 11248  		}
 11249  		idx := v_0.Args[1]
 11250  		ptr := v_0.Args[0]
 11251  		val := v_1
 11252  		mem := v_2
 11253  		if !(off == 0 && sym == nil) {
 11254  			break
 11255  		}
 11256  		v.reset(OpARM64MOVWstoreidx4)
 11257  		v.AddArg4(ptr, idx, val, mem)
 11258  		return true
 11259  	}
 11260  	// match: (MOVWstore [off1] {sym1} (MOVDaddr [off2] {sym2} ptr) val mem)
 11261  	// cond: canMergeSym(sym1,sym2) && is32Bit(int64(off1)+int64(off2)) && (ptr.Op != OpSB || !config.ctxt.Flag_dynlink)
 11262  	// result: (MOVWstore [off1+off2] {mergeSym(sym1,sym2)} ptr val mem)
 11263  	for {
 11264  		off1 := auxIntToInt32(v.AuxInt)
 11265  		sym1 := auxToSym(v.Aux)
 11266  		if v_0.Op != OpARM64MOVDaddr {
 11267  			break
 11268  		}
 11269  		off2 := auxIntToInt32(v_0.AuxInt)
 11270  		sym2 := auxToSym(v_0.Aux)
 11271  		ptr := v_0.Args[0]
 11272  		val := v_1
 11273  		mem := v_2
 11274  		if !(canMergeSym(sym1, sym2) && is32Bit(int64(off1)+int64(off2)) && (ptr.Op != OpSB || !config.ctxt.Flag_dynlink)) {
 11275  			break
 11276  		}
 11277  		v.reset(OpARM64MOVWstore)
 11278  		v.AuxInt = int32ToAuxInt(off1 + off2)
 11279  		v.Aux = symToAux(mergeSym(sym1, sym2))
 11280  		v.AddArg3(ptr, val, mem)
 11281  		return true
 11282  	}
 11283  	// match: (MOVWstore [off] {sym} ptr (MOVWreg x) mem)
 11284  	// result: (MOVWstore [off] {sym} ptr x mem)
 11285  	for {
 11286  		off := auxIntToInt32(v.AuxInt)
 11287  		sym := auxToSym(v.Aux)
 11288  		ptr := v_0
 11289  		if v_1.Op != OpARM64MOVWreg {
 11290  			break
 11291  		}
 11292  		x := v_1.Args[0]
 11293  		mem := v_2
 11294  		v.reset(OpARM64MOVWstore)
 11295  		v.AuxInt = int32ToAuxInt(off)
 11296  		v.Aux = symToAux(sym)
 11297  		v.AddArg3(ptr, x, mem)
 11298  		return true
 11299  	}
 11300  	// match: (MOVWstore [off] {sym} ptr (MOVWUreg x) mem)
 11301  	// result: (MOVWstore [off] {sym} ptr x mem)
 11302  	for {
 11303  		off := auxIntToInt32(v.AuxInt)
 11304  		sym := auxToSym(v.Aux)
 11305  		ptr := v_0
 11306  		if v_1.Op != OpARM64MOVWUreg {
 11307  			break
 11308  		}
 11309  		x := v_1.Args[0]
 11310  		mem := v_2
 11311  		v.reset(OpARM64MOVWstore)
 11312  		v.AuxInt = int32ToAuxInt(off)
 11313  		v.Aux = symToAux(sym)
 11314  		v.AddArg3(ptr, x, mem)
 11315  		return true
 11316  	}
 11317  	return false
 11318  }
 11319  func rewriteValueARM64_OpARM64MOVWstoreidx(v *Value) bool {
 11320  	v_3 := v.Args[3]
 11321  	v_2 := v.Args[2]
 11322  	v_1 := v.Args[1]
 11323  	v_0 := v.Args[0]
 11324  	// match: (MOVWstoreidx ptr (MOVDconst [c]) val mem)
 11325  	// cond: is32Bit(c)
 11326  	// result: (MOVWstore [int32(c)] ptr val mem)
 11327  	for {
 11328  		ptr := v_0
 11329  		if v_1.Op != OpARM64MOVDconst {
 11330  			break
 11331  		}
 11332  		c := auxIntToInt64(v_1.AuxInt)
 11333  		val := v_2
 11334  		mem := v_3
 11335  		if !(is32Bit(c)) {
 11336  			break
 11337  		}
 11338  		v.reset(OpARM64MOVWstore)
 11339  		v.AuxInt = int32ToAuxInt(int32(c))
 11340  		v.AddArg3(ptr, val, mem)
 11341  		return true
 11342  	}
 11343  	// match: (MOVWstoreidx (MOVDconst [c]) idx val mem)
 11344  	// cond: is32Bit(c)
 11345  	// result: (MOVWstore [int32(c)] idx val mem)
 11346  	for {
 11347  		if v_0.Op != OpARM64MOVDconst {
 11348  			break
 11349  		}
 11350  		c := auxIntToInt64(v_0.AuxInt)
 11351  		idx := v_1
 11352  		val := v_2
 11353  		mem := v_3
 11354  		if !(is32Bit(c)) {
 11355  			break
 11356  		}
 11357  		v.reset(OpARM64MOVWstore)
 11358  		v.AuxInt = int32ToAuxInt(int32(c))
 11359  		v.AddArg3(idx, val, mem)
 11360  		return true
 11361  	}
 11362  	// match: (MOVWstoreidx ptr (SLLconst [2] idx) val mem)
 11363  	// result: (MOVWstoreidx4 ptr idx val mem)
 11364  	for {
 11365  		ptr := v_0
 11366  		if v_1.Op != OpARM64SLLconst || auxIntToInt64(v_1.AuxInt) != 2 {
 11367  			break
 11368  		}
 11369  		idx := v_1.Args[0]
 11370  		val := v_2
 11371  		mem := v_3
 11372  		v.reset(OpARM64MOVWstoreidx4)
 11373  		v.AddArg4(ptr, idx, val, mem)
 11374  		return true
 11375  	}
 11376  	// match: (MOVWstoreidx (SLLconst [2] idx) ptr val mem)
 11377  	// result: (MOVWstoreidx4 ptr idx val mem)
 11378  	for {
 11379  		if v_0.Op != OpARM64SLLconst || auxIntToInt64(v_0.AuxInt) != 2 {
 11380  			break
 11381  		}
 11382  		idx := v_0.Args[0]
 11383  		ptr := v_1
 11384  		val := v_2
 11385  		mem := v_3
 11386  		v.reset(OpARM64MOVWstoreidx4)
 11387  		v.AddArg4(ptr, idx, val, mem)
 11388  		return true
 11389  	}
 11390  	// match: (MOVWstoreidx ptr idx (MOVWreg x) mem)
 11391  	// result: (MOVWstoreidx ptr idx x mem)
 11392  	for {
 11393  		ptr := v_0
 11394  		idx := v_1
 11395  		if v_2.Op != OpARM64MOVWreg {
 11396  			break
 11397  		}
 11398  		x := v_2.Args[0]
 11399  		mem := v_3
 11400  		v.reset(OpARM64MOVWstoreidx)
 11401  		v.AddArg4(ptr, idx, x, mem)
 11402  		return true
 11403  	}
 11404  	// match: (MOVWstoreidx ptr idx (MOVWUreg x) mem)
 11405  	// result: (MOVWstoreidx ptr idx x mem)
 11406  	for {
 11407  		ptr := v_0
 11408  		idx := v_1
 11409  		if v_2.Op != OpARM64MOVWUreg {
 11410  			break
 11411  		}
 11412  		x := v_2.Args[0]
 11413  		mem := v_3
 11414  		v.reset(OpARM64MOVWstoreidx)
 11415  		v.AddArg4(ptr, idx, x, mem)
 11416  		return true
 11417  	}
 11418  	return false
 11419  }
 11420  func rewriteValueARM64_OpARM64MOVWstoreidx4(v *Value) bool {
 11421  	v_3 := v.Args[3]
 11422  	v_2 := v.Args[2]
 11423  	v_1 := v.Args[1]
 11424  	v_0 := v.Args[0]
 11425  	// match: (MOVWstoreidx4 ptr (MOVDconst [c]) val mem)
 11426  	// cond: is32Bit(c<<2)
 11427  	// result: (MOVWstore [int32(c)<<2] ptr val mem)
 11428  	for {
 11429  		ptr := v_0
 11430  		if v_1.Op != OpARM64MOVDconst {
 11431  			break
 11432  		}
 11433  		c := auxIntToInt64(v_1.AuxInt)
 11434  		val := v_2
 11435  		mem := v_3
 11436  		if !(is32Bit(c << 2)) {
 11437  			break
 11438  		}
 11439  		v.reset(OpARM64MOVWstore)
 11440  		v.AuxInt = int32ToAuxInt(int32(c) << 2)
 11441  		v.AddArg3(ptr, val, mem)
 11442  		return true
 11443  	}
 11444  	// match: (MOVWstoreidx4 ptr idx (MOVWreg x) mem)
 11445  	// result: (MOVWstoreidx4 ptr idx x mem)
 11446  	for {
 11447  		ptr := v_0
 11448  		idx := v_1
 11449  		if v_2.Op != OpARM64MOVWreg {
 11450  			break
 11451  		}
 11452  		x := v_2.Args[0]
 11453  		mem := v_3
 11454  		v.reset(OpARM64MOVWstoreidx4)
 11455  		v.AddArg4(ptr, idx, x, mem)
 11456  		return true
 11457  	}
 11458  	// match: (MOVWstoreidx4 ptr idx (MOVWUreg x) mem)
 11459  	// result: (MOVWstoreidx4 ptr idx x mem)
 11460  	for {
 11461  		ptr := v_0
 11462  		idx := v_1
 11463  		if v_2.Op != OpARM64MOVWUreg {
 11464  			break
 11465  		}
 11466  		x := v_2.Args[0]
 11467  		mem := v_3
 11468  		v.reset(OpARM64MOVWstoreidx4)
 11469  		v.AddArg4(ptr, idx, x, mem)
 11470  		return true
 11471  	}
 11472  	return false
 11473  }
 11474  func rewriteValueARM64_OpARM64MSUB(v *Value) bool {
 11475  	v_2 := v.Args[2]
 11476  	v_1 := v.Args[1]
 11477  	v_0 := v.Args[0]
 11478  	b := v.Block
 11479  	// match: (MSUB a x (MOVDconst [-1]))
 11480  	// result: (ADD a x)
 11481  	for {
 11482  		a := v_0
 11483  		x := v_1
 11484  		if v_2.Op != OpARM64MOVDconst || auxIntToInt64(v_2.AuxInt) != -1 {
 11485  			break
 11486  		}
 11487  		v.reset(OpARM64ADD)
 11488  		v.AddArg2(a, x)
 11489  		return true
 11490  	}
 11491  	// match: (MSUB a _ (MOVDconst [0]))
 11492  	// result: a
 11493  	for {
 11494  		a := v_0
 11495  		if v_2.Op != OpARM64MOVDconst || auxIntToInt64(v_2.AuxInt) != 0 {
 11496  			break
 11497  		}
 11498  		v.copyOf(a)
 11499  		return true
 11500  	}
 11501  	// match: (MSUB a x (MOVDconst [1]))
 11502  	// result: (SUB a x)
 11503  	for {
 11504  		a := v_0
 11505  		x := v_1
 11506  		if v_2.Op != OpARM64MOVDconst || auxIntToInt64(v_2.AuxInt) != 1 {
 11507  			break
 11508  		}
 11509  		v.reset(OpARM64SUB)
 11510  		v.AddArg2(a, x)
 11511  		return true
 11512  	}
 11513  	// match: (MSUB a x (MOVDconst [c]))
 11514  	// cond: isPowerOfTwo(c)
 11515  	// result: (SUBshiftLL a x [log64(c)])
 11516  	for {
 11517  		a := v_0
 11518  		x := v_1
 11519  		if v_2.Op != OpARM64MOVDconst {
 11520  			break
 11521  		}
 11522  		c := auxIntToInt64(v_2.AuxInt)
 11523  		if !(isPowerOfTwo(c)) {
 11524  			break
 11525  		}
 11526  		v.reset(OpARM64SUBshiftLL)
 11527  		v.AuxInt = int64ToAuxInt(log64(c))
 11528  		v.AddArg2(a, x)
 11529  		return true
 11530  	}
 11531  	// match: (MSUB a x (MOVDconst [c]))
 11532  	// cond: isPowerOfTwo(c-1) && c>=3
 11533  	// result: (SUB a (ADDshiftLL <x.Type> x x [log64(c-1)]))
 11534  	for {
 11535  		a := v_0
 11536  		x := v_1
 11537  		if v_2.Op != OpARM64MOVDconst {
 11538  			break
 11539  		}
 11540  		c := auxIntToInt64(v_2.AuxInt)
 11541  		if !(isPowerOfTwo(c-1) && c >= 3) {
 11542  			break
 11543  		}
 11544  		v.reset(OpARM64SUB)
 11545  		v0 := b.NewValue0(v.Pos, OpARM64ADDshiftLL, x.Type)
 11546  		v0.AuxInt = int64ToAuxInt(log64(c - 1))
 11547  		v0.AddArg2(x, x)
 11548  		v.AddArg2(a, v0)
 11549  		return true
 11550  	}
 11551  	// match: (MSUB a x (MOVDconst [c]))
 11552  	// cond: isPowerOfTwo(c+1) && c>=7
 11553  	// result: (ADD a (SUBshiftLL <x.Type> x x [log64(c+1)]))
 11554  	for {
 11555  		a := v_0
 11556  		x := v_1
 11557  		if v_2.Op != OpARM64MOVDconst {
 11558  			break
 11559  		}
 11560  		c := auxIntToInt64(v_2.AuxInt)
 11561  		if !(isPowerOfTwo(c+1) && c >= 7) {
 11562  			break
 11563  		}
 11564  		v.reset(OpARM64ADD)
 11565  		v0 := b.NewValue0(v.Pos, OpARM64SUBshiftLL, x.Type)
 11566  		v0.AuxInt = int64ToAuxInt(log64(c + 1))
 11567  		v0.AddArg2(x, x)
 11568  		v.AddArg2(a, v0)
 11569  		return true
 11570  	}
 11571  	// match: (MSUB a x (MOVDconst [c]))
 11572  	// cond: c%3 == 0 && isPowerOfTwo(c/3)
 11573  	// result: (ADDshiftLL a (SUBshiftLL <x.Type> x x [2]) [log64(c/3)])
 11574  	for {
 11575  		a := v_0
 11576  		x := v_1
 11577  		if v_2.Op != OpARM64MOVDconst {
 11578  			break
 11579  		}
 11580  		c := auxIntToInt64(v_2.AuxInt)
 11581  		if !(c%3 == 0 && isPowerOfTwo(c/3)) {
 11582  			break
 11583  		}
 11584  		v.reset(OpARM64ADDshiftLL)
 11585  		v.AuxInt = int64ToAuxInt(log64(c / 3))
 11586  		v0 := b.NewValue0(v.Pos, OpARM64SUBshiftLL, x.Type)
 11587  		v0.AuxInt = int64ToAuxInt(2)
 11588  		v0.AddArg2(x, x)
 11589  		v.AddArg2(a, v0)
 11590  		return true
 11591  	}
 11592  	// match: (MSUB a x (MOVDconst [c]))
 11593  	// cond: c%5 == 0 && isPowerOfTwo(c/5)
 11594  	// result: (SUBshiftLL a (ADDshiftLL <x.Type> x x [2]) [log64(c/5)])
 11595  	for {
 11596  		a := v_0
 11597  		x := v_1
 11598  		if v_2.Op != OpARM64MOVDconst {
 11599  			break
 11600  		}
 11601  		c := auxIntToInt64(v_2.AuxInt)
 11602  		if !(c%5 == 0 && isPowerOfTwo(c/5)) {
 11603  			break
 11604  		}
 11605  		v.reset(OpARM64SUBshiftLL)
 11606  		v.AuxInt = int64ToAuxInt(log64(c / 5))
 11607  		v0 := b.NewValue0(v.Pos, OpARM64ADDshiftLL, x.Type)
 11608  		v0.AuxInt = int64ToAuxInt(2)
 11609  		v0.AddArg2(x, x)
 11610  		v.AddArg2(a, v0)
 11611  		return true
 11612  	}
 11613  	// match: (MSUB a x (MOVDconst [c]))
 11614  	// cond: c%7 == 0 && isPowerOfTwo(c/7)
 11615  	// result: (ADDshiftLL a (SUBshiftLL <x.Type> x x [3]) [log64(c/7)])
 11616  	for {
 11617  		a := v_0
 11618  		x := v_1
 11619  		if v_2.Op != OpARM64MOVDconst {
 11620  			break
 11621  		}
 11622  		c := auxIntToInt64(v_2.AuxInt)
 11623  		if !(c%7 == 0 && isPowerOfTwo(c/7)) {
 11624  			break
 11625  		}
 11626  		v.reset(OpARM64ADDshiftLL)
 11627  		v.AuxInt = int64ToAuxInt(log64(c / 7))
 11628  		v0 := b.NewValue0(v.Pos, OpARM64SUBshiftLL, x.Type)
 11629  		v0.AuxInt = int64ToAuxInt(3)
 11630  		v0.AddArg2(x, x)
 11631  		v.AddArg2(a, v0)
 11632  		return true
 11633  	}
 11634  	// match: (MSUB a x (MOVDconst [c]))
 11635  	// cond: c%9 == 0 && isPowerOfTwo(c/9)
 11636  	// result: (SUBshiftLL a (ADDshiftLL <x.Type> x x [3]) [log64(c/9)])
 11637  	for {
 11638  		a := v_0
 11639  		x := v_1
 11640  		if v_2.Op != OpARM64MOVDconst {
 11641  			break
 11642  		}
 11643  		c := auxIntToInt64(v_2.AuxInt)
 11644  		if !(c%9 == 0 && isPowerOfTwo(c/9)) {
 11645  			break
 11646  		}
 11647  		v.reset(OpARM64SUBshiftLL)
 11648  		v.AuxInt = int64ToAuxInt(log64(c / 9))
 11649  		v0 := b.NewValue0(v.Pos, OpARM64ADDshiftLL, x.Type)
 11650  		v0.AuxInt = int64ToAuxInt(3)
 11651  		v0.AddArg2(x, x)
 11652  		v.AddArg2(a, v0)
 11653  		return true
 11654  	}
 11655  	// match: (MSUB a (MOVDconst [-1]) x)
 11656  	// result: (ADD a x)
 11657  	for {
 11658  		a := v_0
 11659  		if v_1.Op != OpARM64MOVDconst || auxIntToInt64(v_1.AuxInt) != -1 {
 11660  			break
 11661  		}
 11662  		x := v_2
 11663  		v.reset(OpARM64ADD)
 11664  		v.AddArg2(a, x)
 11665  		return true
 11666  	}
 11667  	// match: (MSUB a (MOVDconst [0]) _)
 11668  	// result: a
 11669  	for {
 11670  		a := v_0
 11671  		if v_1.Op != OpARM64MOVDconst || auxIntToInt64(v_1.AuxInt) != 0 {
 11672  			break
 11673  		}
 11674  		v.copyOf(a)
 11675  		return true
 11676  	}
 11677  	// match: (MSUB a (MOVDconst [1]) x)
 11678  	// result: (SUB a x)
 11679  	for {
 11680  		a := v_0
 11681  		if v_1.Op != OpARM64MOVDconst || auxIntToInt64(v_1.AuxInt) != 1 {
 11682  			break
 11683  		}
 11684  		x := v_2
 11685  		v.reset(OpARM64SUB)
 11686  		v.AddArg2(a, x)
 11687  		return true
 11688  	}
 11689  	// match: (MSUB a (MOVDconst [c]) x)
 11690  	// cond: isPowerOfTwo(c)
 11691  	// result: (SUBshiftLL a x [log64(c)])
 11692  	for {
 11693  		a := v_0
 11694  		if v_1.Op != OpARM64MOVDconst {
 11695  			break
 11696  		}
 11697  		c := auxIntToInt64(v_1.AuxInt)
 11698  		x := v_2
 11699  		if !(isPowerOfTwo(c)) {
 11700  			break
 11701  		}
 11702  		v.reset(OpARM64SUBshiftLL)
 11703  		v.AuxInt = int64ToAuxInt(log64(c))
 11704  		v.AddArg2(a, x)
 11705  		return true
 11706  	}
 11707  	// match: (MSUB a (MOVDconst [c]) x)
 11708  	// cond: isPowerOfTwo(c-1) && c>=3
 11709  	// result: (SUB a (ADDshiftLL <x.Type> x x [log64(c-1)]))
 11710  	for {
 11711  		a := v_0
 11712  		if v_1.Op != OpARM64MOVDconst {
 11713  			break
 11714  		}
 11715  		c := auxIntToInt64(v_1.AuxInt)
 11716  		x := v_2
 11717  		if !(isPowerOfTwo(c-1) && c >= 3) {
 11718  			break
 11719  		}
 11720  		v.reset(OpARM64SUB)
 11721  		v0 := b.NewValue0(v.Pos, OpARM64ADDshiftLL, x.Type)
 11722  		v0.AuxInt = int64ToAuxInt(log64(c - 1))
 11723  		v0.AddArg2(x, x)
 11724  		v.AddArg2(a, v0)
 11725  		return true
 11726  	}
 11727  	// match: (MSUB a (MOVDconst [c]) x)
 11728  	// cond: isPowerOfTwo(c+1) && c>=7
 11729  	// result: (ADD a (SUBshiftLL <x.Type> x x [log64(c+1)]))
 11730  	for {
 11731  		a := v_0
 11732  		if v_1.Op != OpARM64MOVDconst {
 11733  			break
 11734  		}
 11735  		c := auxIntToInt64(v_1.AuxInt)
 11736  		x := v_2
 11737  		if !(isPowerOfTwo(c+1) && c >= 7) {
 11738  			break
 11739  		}
 11740  		v.reset(OpARM64ADD)
 11741  		v0 := b.NewValue0(v.Pos, OpARM64SUBshiftLL, x.Type)
 11742  		v0.AuxInt = int64ToAuxInt(log64(c + 1))
 11743  		v0.AddArg2(x, x)
 11744  		v.AddArg2(a, v0)
 11745  		return true
 11746  	}
 11747  	// match: (MSUB a (MOVDconst [c]) x)
 11748  	// cond: c%3 == 0 && isPowerOfTwo(c/3)
 11749  	// result: (ADDshiftLL a (SUBshiftLL <x.Type> x x [2]) [log64(c/3)])
 11750  	for {
 11751  		a := v_0
 11752  		if v_1.Op != OpARM64MOVDconst {
 11753  			break
 11754  		}
 11755  		c := auxIntToInt64(v_1.AuxInt)
 11756  		x := v_2
 11757  		if !(c%3 == 0 && isPowerOfTwo(c/3)) {
 11758  			break
 11759  		}
 11760  		v.reset(OpARM64ADDshiftLL)
 11761  		v.AuxInt = int64ToAuxInt(log64(c / 3))
 11762  		v0 := b.NewValue0(v.Pos, OpARM64SUBshiftLL, x.Type)
 11763  		v0.AuxInt = int64ToAuxInt(2)
 11764  		v0.AddArg2(x, x)
 11765  		v.AddArg2(a, v0)
 11766  		return true
 11767  	}
 11768  	// match: (MSUB a (MOVDconst [c]) x)
 11769  	// cond: c%5 == 0 && isPowerOfTwo(c/5)
 11770  	// result: (SUBshiftLL a (ADDshiftLL <x.Type> x x [2]) [log64(c/5)])
 11771  	for {
 11772  		a := v_0
 11773  		if v_1.Op != OpARM64MOVDconst {
 11774  			break
 11775  		}
 11776  		c := auxIntToInt64(v_1.AuxInt)
 11777  		x := v_2
 11778  		if !(c%5 == 0 && isPowerOfTwo(c/5)) {
 11779  			break
 11780  		}
 11781  		v.reset(OpARM64SUBshiftLL)
 11782  		v.AuxInt = int64ToAuxInt(log64(c / 5))
 11783  		v0 := b.NewValue0(v.Pos, OpARM64ADDshiftLL, x.Type)
 11784  		v0.AuxInt = int64ToAuxInt(2)
 11785  		v0.AddArg2(x, x)
 11786  		v.AddArg2(a, v0)
 11787  		return true
 11788  	}
 11789  	// match: (MSUB a (MOVDconst [c]) x)
 11790  	// cond: c%7 == 0 && isPowerOfTwo(c/7)
 11791  	// result: (ADDshiftLL a (SUBshiftLL <x.Type> x x [3]) [log64(c/7)])
 11792  	for {
 11793  		a := v_0
 11794  		if v_1.Op != OpARM64MOVDconst {
 11795  			break
 11796  		}
 11797  		c := auxIntToInt64(v_1.AuxInt)
 11798  		x := v_2
 11799  		if !(c%7 == 0 && isPowerOfTwo(c/7)) {
 11800  			break
 11801  		}
 11802  		v.reset(OpARM64ADDshiftLL)
 11803  		v.AuxInt = int64ToAuxInt(log64(c / 7))
 11804  		v0 := b.NewValue0(v.Pos, OpARM64SUBshiftLL, x.Type)
 11805  		v0.AuxInt = int64ToAuxInt(3)
 11806  		v0.AddArg2(x, x)
 11807  		v.AddArg2(a, v0)
 11808  		return true
 11809  	}
 11810  	// match: (MSUB a (MOVDconst [c]) x)
 11811  	// cond: c%9 == 0 && isPowerOfTwo(c/9)
 11812  	// result: (SUBshiftLL a (ADDshiftLL <x.Type> x x [3]) [log64(c/9)])
 11813  	for {
 11814  		a := v_0
 11815  		if v_1.Op != OpARM64MOVDconst {
 11816  			break
 11817  		}
 11818  		c := auxIntToInt64(v_1.AuxInt)
 11819  		x := v_2
 11820  		if !(c%9 == 0 && isPowerOfTwo(c/9)) {
 11821  			break
 11822  		}
 11823  		v.reset(OpARM64SUBshiftLL)
 11824  		v.AuxInt = int64ToAuxInt(log64(c / 9))
 11825  		v0 := b.NewValue0(v.Pos, OpARM64ADDshiftLL, x.Type)
 11826  		v0.AuxInt = int64ToAuxInt(3)
 11827  		v0.AddArg2(x, x)
 11828  		v.AddArg2(a, v0)
 11829  		return true
 11830  	}
 11831  	// match: (MSUB (MOVDconst [c]) x y)
 11832  	// result: (ADDconst [c] (MNEG <x.Type> x y))
 11833  	for {
 11834  		if v_0.Op != OpARM64MOVDconst {
 11835  			break
 11836  		}
 11837  		c := auxIntToInt64(v_0.AuxInt)
 11838  		x := v_1
 11839  		y := v_2
 11840  		v.reset(OpARM64ADDconst)
 11841  		v.AuxInt = int64ToAuxInt(c)
 11842  		v0 := b.NewValue0(v.Pos, OpARM64MNEG, x.Type)
 11843  		v0.AddArg2(x, y)
 11844  		v.AddArg(v0)
 11845  		return true
 11846  	}
 11847  	// match: (MSUB a (MOVDconst [c]) (MOVDconst [d]))
 11848  	// result: (SUBconst [c*d] a)
 11849  	for {
 11850  		a := v_0
 11851  		if v_1.Op != OpARM64MOVDconst {
 11852  			break
 11853  		}
 11854  		c := auxIntToInt64(v_1.AuxInt)
 11855  		if v_2.Op != OpARM64MOVDconst {
 11856  			break
 11857  		}
 11858  		d := auxIntToInt64(v_2.AuxInt)
 11859  		v.reset(OpARM64SUBconst)
 11860  		v.AuxInt = int64ToAuxInt(c * d)
 11861  		v.AddArg(a)
 11862  		return true
 11863  	}
 11864  	return false
 11865  }
 11866  func rewriteValueARM64_OpARM64MSUBW(v *Value) bool {
 11867  	v_2 := v.Args[2]
 11868  	v_1 := v.Args[1]
 11869  	v_0 := v.Args[0]
 11870  	b := v.Block
 11871  	// match: (MSUBW a x (MOVDconst [c]))
 11872  	// cond: int32(c)==-1
 11873  	// result: (MOVWUreg (ADD <a.Type> a x))
 11874  	for {
 11875  		a := v_0
 11876  		x := v_1
 11877  		if v_2.Op != OpARM64MOVDconst {
 11878  			break
 11879  		}
 11880  		c := auxIntToInt64(v_2.AuxInt)
 11881  		if !(int32(c) == -1) {
 11882  			break
 11883  		}
 11884  		v.reset(OpARM64MOVWUreg)
 11885  		v0 := b.NewValue0(v.Pos, OpARM64ADD, a.Type)
 11886  		v0.AddArg2(a, x)
 11887  		v.AddArg(v0)
 11888  		return true
 11889  	}
 11890  	// match: (MSUBW a _ (MOVDconst [c]))
 11891  	// cond: int32(c)==0
 11892  	// result: (MOVWUreg a)
 11893  	for {
 11894  		a := v_0
 11895  		if v_2.Op != OpARM64MOVDconst {
 11896  			break
 11897  		}
 11898  		c := auxIntToInt64(v_2.AuxInt)
 11899  		if !(int32(c) == 0) {
 11900  			break
 11901  		}
 11902  		v.reset(OpARM64MOVWUreg)
 11903  		v.AddArg(a)
 11904  		return true
 11905  	}
 11906  	// match: (MSUBW a x (MOVDconst [c]))
 11907  	// cond: int32(c)==1
 11908  	// result: (MOVWUreg (SUB <a.Type> a x))
 11909  	for {
 11910  		a := v_0
 11911  		x := v_1
 11912  		if v_2.Op != OpARM64MOVDconst {
 11913  			break
 11914  		}
 11915  		c := auxIntToInt64(v_2.AuxInt)
 11916  		if !(int32(c) == 1) {
 11917  			break
 11918  		}
 11919  		v.reset(OpARM64MOVWUreg)
 11920  		v0 := b.NewValue0(v.Pos, OpARM64SUB, a.Type)
 11921  		v0.AddArg2(a, x)
 11922  		v.AddArg(v0)
 11923  		return true
 11924  	}
 11925  	// match: (MSUBW a x (MOVDconst [c]))
 11926  	// cond: isPowerOfTwo(c)
 11927  	// result: (MOVWUreg (SUBshiftLL <a.Type> a x [log64(c)]))
 11928  	for {
 11929  		a := v_0
 11930  		x := v_1
 11931  		if v_2.Op != OpARM64MOVDconst {
 11932  			break
 11933  		}
 11934  		c := auxIntToInt64(v_2.AuxInt)
 11935  		if !(isPowerOfTwo(c)) {
 11936  			break
 11937  		}
 11938  		v.reset(OpARM64MOVWUreg)
 11939  		v0 := b.NewValue0(v.Pos, OpARM64SUBshiftLL, a.Type)
 11940  		v0.AuxInt = int64ToAuxInt(log64(c))
 11941  		v0.AddArg2(a, x)
 11942  		v.AddArg(v0)
 11943  		return true
 11944  	}
 11945  	// match: (MSUBW a x (MOVDconst [c]))
 11946  	// cond: isPowerOfTwo(c-1) && int32(c)>=3
 11947  	// result: (MOVWUreg (SUB <a.Type> a (ADDshiftLL <x.Type> x x [log64(c-1)])))
 11948  	for {
 11949  		a := v_0
 11950  		x := v_1
 11951  		if v_2.Op != OpARM64MOVDconst {
 11952  			break
 11953  		}
 11954  		c := auxIntToInt64(v_2.AuxInt)
 11955  		if !(isPowerOfTwo(c-1) && int32(c) >= 3) {
 11956  			break
 11957  		}
 11958  		v.reset(OpARM64MOVWUreg)
 11959  		v0 := b.NewValue0(v.Pos, OpARM64SUB, a.Type)
 11960  		v1 := b.NewValue0(v.Pos, OpARM64ADDshiftLL, x.Type)
 11961  		v1.AuxInt = int64ToAuxInt(log64(c - 1))
 11962  		v1.AddArg2(x, x)
 11963  		v0.AddArg2(a, v1)
 11964  		v.AddArg(v0)
 11965  		return true
 11966  	}
 11967  	// match: (MSUBW a x (MOVDconst [c]))
 11968  	// cond: isPowerOfTwo(c+1) && int32(c)>=7
 11969  	// result: (MOVWUreg (ADD <a.Type> a (SUBshiftLL <x.Type> x x [log64(c+1)])))
 11970  	for {
 11971  		a := v_0
 11972  		x := v_1
 11973  		if v_2.Op != OpARM64MOVDconst {
 11974  			break
 11975  		}
 11976  		c := auxIntToInt64(v_2.AuxInt)
 11977  		if !(isPowerOfTwo(c+1) && int32(c) >= 7) {
 11978  			break
 11979  		}
 11980  		v.reset(OpARM64MOVWUreg)
 11981  		v0 := b.NewValue0(v.Pos, OpARM64ADD, a.Type)
 11982  		v1 := b.NewValue0(v.Pos, OpARM64SUBshiftLL, x.Type)
 11983  		v1.AuxInt = int64ToAuxInt(log64(c + 1))
 11984  		v1.AddArg2(x, x)
 11985  		v0.AddArg2(a, v1)
 11986  		v.AddArg(v0)
 11987  		return true
 11988  	}
 11989  	// match: (MSUBW a x (MOVDconst [c]))
 11990  	// cond: c%3 == 0 && isPowerOfTwo(c/3) && is32Bit(c)
 11991  	// result: (MOVWUreg (ADDshiftLL <a.Type> a (SUBshiftLL <x.Type> x x [2]) [log64(c/3)]))
 11992  	for {
 11993  		a := v_0
 11994  		x := v_1
 11995  		if v_2.Op != OpARM64MOVDconst {
 11996  			break
 11997  		}
 11998  		c := auxIntToInt64(v_2.AuxInt)
 11999  		if !(c%3 == 0 && isPowerOfTwo(c/3) && is32Bit(c)) {
 12000  			break
 12001  		}
 12002  		v.reset(OpARM64MOVWUreg)
 12003  		v0 := b.NewValue0(v.Pos, OpARM64ADDshiftLL, a.Type)
 12004  		v0.AuxInt = int64ToAuxInt(log64(c / 3))
 12005  		v1 := b.NewValue0(v.Pos, OpARM64SUBshiftLL, x.Type)
 12006  		v1.AuxInt = int64ToAuxInt(2)
 12007  		v1.AddArg2(x, x)
 12008  		v0.AddArg2(a, v1)
 12009  		v.AddArg(v0)
 12010  		return true
 12011  	}
 12012  	// match: (MSUBW a x (MOVDconst [c]))
 12013  	// cond: c%5 == 0 && isPowerOfTwo(c/5) && is32Bit(c)
 12014  	// result: (MOVWUreg (SUBshiftLL <a.Type> a (ADDshiftLL <x.Type> x x [2]) [log64(c/5)]))
 12015  	for {
 12016  		a := v_0
 12017  		x := v_1
 12018  		if v_2.Op != OpARM64MOVDconst {
 12019  			break
 12020  		}
 12021  		c := auxIntToInt64(v_2.AuxInt)
 12022  		if !(c%5 == 0 && isPowerOfTwo(c/5) && is32Bit(c)) {
 12023  			break
 12024  		}
 12025  		v.reset(OpARM64MOVWUreg)
 12026  		v0 := b.NewValue0(v.Pos, OpARM64SUBshiftLL, a.Type)
 12027  		v0.AuxInt = int64ToAuxInt(log64(c / 5))
 12028  		v1 := b.NewValue0(v.Pos, OpARM64ADDshiftLL, x.Type)
 12029  		v1.AuxInt = int64ToAuxInt(2)
 12030  		v1.AddArg2(x, x)
 12031  		v0.AddArg2(a, v1)
 12032  		v.AddArg(v0)
 12033  		return true
 12034  	}
 12035  	// match: (MSUBW a x (MOVDconst [c]))
 12036  	// cond: c%7 == 0 && isPowerOfTwo(c/7) && is32Bit(c)
 12037  	// result: (MOVWUreg (ADDshiftLL <a.Type> a (SUBshiftLL <x.Type> x x [3]) [log64(c/7)]))
 12038  	for {
 12039  		a := v_0
 12040  		x := v_1
 12041  		if v_2.Op != OpARM64MOVDconst {
 12042  			break
 12043  		}
 12044  		c := auxIntToInt64(v_2.AuxInt)
 12045  		if !(c%7 == 0 && isPowerOfTwo(c/7) && is32Bit(c)) {
 12046  			break
 12047  		}
 12048  		v.reset(OpARM64MOVWUreg)
 12049  		v0 := b.NewValue0(v.Pos, OpARM64ADDshiftLL, a.Type)
 12050  		v0.AuxInt = int64ToAuxInt(log64(c / 7))
 12051  		v1 := b.NewValue0(v.Pos, OpARM64SUBshiftLL, x.Type)
 12052  		v1.AuxInt = int64ToAuxInt(3)
 12053  		v1.AddArg2(x, x)
 12054  		v0.AddArg2(a, v1)
 12055  		v.AddArg(v0)
 12056  		return true
 12057  	}
 12058  	// match: (MSUBW a x (MOVDconst [c]))
 12059  	// cond: c%9 == 0 && isPowerOfTwo(c/9) && is32Bit(c)
 12060  	// result: (MOVWUreg (SUBshiftLL <a.Type> a (ADDshiftLL <x.Type> x x [3]) [log64(c/9)]))
 12061  	for {
 12062  		a := v_0
 12063  		x := v_1
 12064  		if v_2.Op != OpARM64MOVDconst {
 12065  			break
 12066  		}
 12067  		c := auxIntToInt64(v_2.AuxInt)
 12068  		if !(c%9 == 0 && isPowerOfTwo(c/9) && is32Bit(c)) {
 12069  			break
 12070  		}
 12071  		v.reset(OpARM64MOVWUreg)
 12072  		v0 := b.NewValue0(v.Pos, OpARM64SUBshiftLL, a.Type)
 12073  		v0.AuxInt = int64ToAuxInt(log64(c / 9))
 12074  		v1 := b.NewValue0(v.Pos, OpARM64ADDshiftLL, x.Type)
 12075  		v1.AuxInt = int64ToAuxInt(3)
 12076  		v1.AddArg2(x, x)
 12077  		v0.AddArg2(a, v1)
 12078  		v.AddArg(v0)
 12079  		return true
 12080  	}
 12081  	// match: (MSUBW a (MOVDconst [c]) x)
 12082  	// cond: int32(c)==-1
 12083  	// result: (MOVWUreg (ADD <a.Type> a x))
 12084  	for {
 12085  		a := v_0
 12086  		if v_1.Op != OpARM64MOVDconst {
 12087  			break
 12088  		}
 12089  		c := auxIntToInt64(v_1.AuxInt)
 12090  		x := v_2
 12091  		if !(int32(c) == -1) {
 12092  			break
 12093  		}
 12094  		v.reset(OpARM64MOVWUreg)
 12095  		v0 := b.NewValue0(v.Pos, OpARM64ADD, a.Type)
 12096  		v0.AddArg2(a, x)
 12097  		v.AddArg(v0)
 12098  		return true
 12099  	}
 12100  	// match: (MSUBW a (MOVDconst [c]) _)
 12101  	// cond: int32(c)==0
 12102  	// result: (MOVWUreg a)
 12103  	for {
 12104  		a := v_0
 12105  		if v_1.Op != OpARM64MOVDconst {
 12106  			break
 12107  		}
 12108  		c := auxIntToInt64(v_1.AuxInt)
 12109  		if !(int32(c) == 0) {
 12110  			break
 12111  		}
 12112  		v.reset(OpARM64MOVWUreg)
 12113  		v.AddArg(a)
 12114  		return true
 12115  	}
 12116  	// match: (MSUBW a (MOVDconst [c]) x)
 12117  	// cond: int32(c)==1
 12118  	// result: (MOVWUreg (SUB <a.Type> a x))
 12119  	for {
 12120  		a := v_0
 12121  		if v_1.Op != OpARM64MOVDconst {
 12122  			break
 12123  		}
 12124  		c := auxIntToInt64(v_1.AuxInt)
 12125  		x := v_2
 12126  		if !(int32(c) == 1) {
 12127  			break
 12128  		}
 12129  		v.reset(OpARM64MOVWUreg)
 12130  		v0 := b.NewValue0(v.Pos, OpARM64SUB, a.Type)
 12131  		v0.AddArg2(a, x)
 12132  		v.AddArg(v0)
 12133  		return true
 12134  	}
 12135  	// match: (MSUBW a (MOVDconst [c]) x)
 12136  	// cond: isPowerOfTwo(c)
 12137  	// result: (MOVWUreg (SUBshiftLL <a.Type> a x [log64(c)]))
 12138  	for {
 12139  		a := v_0
 12140  		if v_1.Op != OpARM64MOVDconst {
 12141  			break
 12142  		}
 12143  		c := auxIntToInt64(v_1.AuxInt)
 12144  		x := v_2
 12145  		if !(isPowerOfTwo(c)) {
 12146  			break
 12147  		}
 12148  		v.reset(OpARM64MOVWUreg)
 12149  		v0 := b.NewValue0(v.Pos, OpARM64SUBshiftLL, a.Type)
 12150  		v0.AuxInt = int64ToAuxInt(log64(c))
 12151  		v0.AddArg2(a, x)
 12152  		v.AddArg(v0)
 12153  		return true
 12154  	}
 12155  	// match: (MSUBW a (MOVDconst [c]) x)
 12156  	// cond: isPowerOfTwo(c-1) && int32(c)>=3
 12157  	// result: (MOVWUreg (SUB <a.Type> a (ADDshiftLL <x.Type> x x [log64(c-1)])))
 12158  	for {
 12159  		a := v_0
 12160  		if v_1.Op != OpARM64MOVDconst {
 12161  			break
 12162  		}
 12163  		c := auxIntToInt64(v_1.AuxInt)
 12164  		x := v_2
 12165  		if !(isPowerOfTwo(c-1) && int32(c) >= 3) {
 12166  			break
 12167  		}
 12168  		v.reset(OpARM64MOVWUreg)
 12169  		v0 := b.NewValue0(v.Pos, OpARM64SUB, a.Type)
 12170  		v1 := b.NewValue0(v.Pos, OpARM64ADDshiftLL, x.Type)
 12171  		v1.AuxInt = int64ToAuxInt(log64(c - 1))
 12172  		v1.AddArg2(x, x)
 12173  		v0.AddArg2(a, v1)
 12174  		v.AddArg(v0)
 12175  		return true
 12176  	}
 12177  	// match: (MSUBW a (MOVDconst [c]) x)
 12178  	// cond: isPowerOfTwo(c+1) && int32(c)>=7
 12179  	// result: (MOVWUreg (ADD <a.Type> a (SUBshiftLL <x.Type> x x [log64(c+1)])))
 12180  	for {
 12181  		a := v_0
 12182  		if v_1.Op != OpARM64MOVDconst {
 12183  			break
 12184  		}
 12185  		c := auxIntToInt64(v_1.AuxInt)
 12186  		x := v_2
 12187  		if !(isPowerOfTwo(c+1) && int32(c) >= 7) {
 12188  			break
 12189  		}
 12190  		v.reset(OpARM64MOVWUreg)
 12191  		v0 := b.NewValue0(v.Pos, OpARM64ADD, a.Type)
 12192  		v1 := b.NewValue0(v.Pos, OpARM64SUBshiftLL, x.Type)
 12193  		v1.AuxInt = int64ToAuxInt(log64(c + 1))
 12194  		v1.AddArg2(x, x)
 12195  		v0.AddArg2(a, v1)
 12196  		v.AddArg(v0)
 12197  		return true
 12198  	}
 12199  	// match: (MSUBW a (MOVDconst [c]) x)
 12200  	// cond: c%3 == 0 && isPowerOfTwo(c/3) && is32Bit(c)
 12201  	// result: (MOVWUreg (ADDshiftLL <a.Type> a (SUBshiftLL <x.Type> x x [2]) [log64(c/3)]))
 12202  	for {
 12203  		a := v_0
 12204  		if v_1.Op != OpARM64MOVDconst {
 12205  			break
 12206  		}
 12207  		c := auxIntToInt64(v_1.AuxInt)
 12208  		x := v_2
 12209  		if !(c%3 == 0 && isPowerOfTwo(c/3) && is32Bit(c)) {
 12210  			break
 12211  		}
 12212  		v.reset(OpARM64MOVWUreg)
 12213  		v0 := b.NewValue0(v.Pos, OpARM64ADDshiftLL, a.Type)
 12214  		v0.AuxInt = int64ToAuxInt(log64(c / 3))
 12215  		v1 := b.NewValue0(v.Pos, OpARM64SUBshiftLL, x.Type)
 12216  		v1.AuxInt = int64ToAuxInt(2)
 12217  		v1.AddArg2(x, x)
 12218  		v0.AddArg2(a, v1)
 12219  		v.AddArg(v0)
 12220  		return true
 12221  	}
 12222  	// match: (MSUBW a (MOVDconst [c]) x)
 12223  	// cond: c%5 == 0 && isPowerOfTwo(c/5) && is32Bit(c)
 12224  	// result: (MOVWUreg (SUBshiftLL <a.Type> a (ADDshiftLL <x.Type> x x [2]) [log64(c/5)]))
 12225  	for {
 12226  		a := v_0
 12227  		if v_1.Op != OpARM64MOVDconst {
 12228  			break
 12229  		}
 12230  		c := auxIntToInt64(v_1.AuxInt)
 12231  		x := v_2
 12232  		if !(c%5 == 0 && isPowerOfTwo(c/5) && is32Bit(c)) {
 12233  			break
 12234  		}
 12235  		v.reset(OpARM64MOVWUreg)
 12236  		v0 := b.NewValue0(v.Pos, OpARM64SUBshiftLL, a.Type)
 12237  		v0.AuxInt = int64ToAuxInt(log64(c / 5))
 12238  		v1 := b.NewValue0(v.Pos, OpARM64ADDshiftLL, x.Type)
 12239  		v1.AuxInt = int64ToAuxInt(2)
 12240  		v1.AddArg2(x, x)
 12241  		v0.AddArg2(a, v1)
 12242  		v.AddArg(v0)
 12243  		return true
 12244  	}
 12245  	// match: (MSUBW a (MOVDconst [c]) x)
 12246  	// cond: c%7 == 0 && isPowerOfTwo(c/7) && is32Bit(c)
 12247  	// result: (MOVWUreg (ADDshiftLL <a.Type> a (SUBshiftLL <x.Type> x x [3]) [log64(c/7)]))
 12248  	for {
 12249  		a := v_0
 12250  		if v_1.Op != OpARM64MOVDconst {
 12251  			break
 12252  		}
 12253  		c := auxIntToInt64(v_1.AuxInt)
 12254  		x := v_2
 12255  		if !(c%7 == 0 && isPowerOfTwo(c/7) && is32Bit(c)) {
 12256  			break
 12257  		}
 12258  		v.reset(OpARM64MOVWUreg)
 12259  		v0 := b.NewValue0(v.Pos, OpARM64ADDshiftLL, a.Type)
 12260  		v0.AuxInt = int64ToAuxInt(log64(c / 7))
 12261  		v1 := b.NewValue0(v.Pos, OpARM64SUBshiftLL, x.Type)
 12262  		v1.AuxInt = int64ToAuxInt(3)
 12263  		v1.AddArg2(x, x)
 12264  		v0.AddArg2(a, v1)
 12265  		v.AddArg(v0)
 12266  		return true
 12267  	}
 12268  	// match: (MSUBW a (MOVDconst [c]) x)
 12269  	// cond: c%9 == 0 && isPowerOfTwo(c/9) && is32Bit(c)
 12270  	// result: (MOVWUreg (SUBshiftLL <a.Type> a (ADDshiftLL <x.Type> x x [3]) [log64(c/9)]))
 12271  	for {
 12272  		a := v_0
 12273  		if v_1.Op != OpARM64MOVDconst {
 12274  			break
 12275  		}
 12276  		c := auxIntToInt64(v_1.AuxInt)
 12277  		x := v_2
 12278  		if !(c%9 == 0 && isPowerOfTwo(c/9) && is32Bit(c)) {
 12279  			break
 12280  		}
 12281  		v.reset(OpARM64MOVWUreg)
 12282  		v0 := b.NewValue0(v.Pos, OpARM64SUBshiftLL, a.Type)
 12283  		v0.AuxInt = int64ToAuxInt(log64(c / 9))
 12284  		v1 := b.NewValue0(v.Pos, OpARM64ADDshiftLL, x.Type)
 12285  		v1.AuxInt = int64ToAuxInt(3)
 12286  		v1.AddArg2(x, x)
 12287  		v0.AddArg2(a, v1)
 12288  		v.AddArg(v0)
 12289  		return true
 12290  	}
 12291  	// match: (MSUBW (MOVDconst [c]) x y)
 12292  	// result: (MOVWUreg (ADDconst <x.Type> [c] (MNEGW <x.Type> x y)))
 12293  	for {
 12294  		if v_0.Op != OpARM64MOVDconst {
 12295  			break
 12296  		}
 12297  		c := auxIntToInt64(v_0.AuxInt)
 12298  		x := v_1
 12299  		y := v_2
 12300  		v.reset(OpARM64MOVWUreg)
 12301  		v0 := b.NewValue0(v.Pos, OpARM64ADDconst, x.Type)
 12302  		v0.AuxInt = int64ToAuxInt(c)
 12303  		v1 := b.NewValue0(v.Pos, OpARM64MNEGW, x.Type)
 12304  		v1.AddArg2(x, y)
 12305  		v0.AddArg(v1)
 12306  		v.AddArg(v0)
 12307  		return true
 12308  	}
 12309  	// match: (MSUBW a (MOVDconst [c]) (MOVDconst [d]))
 12310  	// result: (MOVWUreg (SUBconst <a.Type> [c*d] a))
 12311  	for {
 12312  		a := v_0
 12313  		if v_1.Op != OpARM64MOVDconst {
 12314  			break
 12315  		}
 12316  		c := auxIntToInt64(v_1.AuxInt)
 12317  		if v_2.Op != OpARM64MOVDconst {
 12318  			break
 12319  		}
 12320  		d := auxIntToInt64(v_2.AuxInt)
 12321  		v.reset(OpARM64MOVWUreg)
 12322  		v0 := b.NewValue0(v.Pos, OpARM64SUBconst, a.Type)
 12323  		v0.AuxInt = int64ToAuxInt(c * d)
 12324  		v0.AddArg(a)
 12325  		v.AddArg(v0)
 12326  		return true
 12327  	}
 12328  	return false
 12329  }
 12330  func rewriteValueARM64_OpARM64MUL(v *Value) bool {
 12331  	v_1 := v.Args[1]
 12332  	v_0 := v.Args[0]
 12333  	b := v.Block
 12334  	config := b.Func.Config
 12335  	// match: (MUL (NEG x) y)
 12336  	// result: (MNEG x y)
 12337  	for {
 12338  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
 12339  			if v_0.Op != OpARM64NEG {
 12340  				continue
 12341  			}
 12342  			x := v_0.Args[0]
 12343  			y := v_1
 12344  			v.reset(OpARM64MNEG)
 12345  			v.AddArg2(x, y)
 12346  			return true
 12347  		}
 12348  		break
 12349  	}
 12350  	// match: (MUL _ (MOVDconst [0]))
 12351  	// result: (MOVDconst [0])
 12352  	for {
 12353  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
 12354  			if v_1.Op != OpARM64MOVDconst || auxIntToInt64(v_1.AuxInt) != 0 {
 12355  				continue
 12356  			}
 12357  			v.reset(OpARM64MOVDconst)
 12358  			v.AuxInt = int64ToAuxInt(0)
 12359  			return true
 12360  		}
 12361  		break
 12362  	}
 12363  	// match: (MUL x (MOVDconst [1]))
 12364  	// result: x
 12365  	for {
 12366  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
 12367  			x := v_0
 12368  			if v_1.Op != OpARM64MOVDconst || auxIntToInt64(v_1.AuxInt) != 1 {
 12369  				continue
 12370  			}
 12371  			v.copyOf(x)
 12372  			return true
 12373  		}
 12374  		break
 12375  	}
 12376  	// match: (MUL x (MOVDconst [c]))
 12377  	// cond: canMulStrengthReduce(config, c)
 12378  	// result: {mulStrengthReduce(v, x, c)}
 12379  	for {
 12380  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
 12381  			x := v_0
 12382  			if v_1.Op != OpARM64MOVDconst {
 12383  				continue
 12384  			}
 12385  			c := auxIntToInt64(v_1.AuxInt)
 12386  			if !(canMulStrengthReduce(config, c)) {
 12387  				continue
 12388  			}
 12389  			v.copyOf(mulStrengthReduce(v, x, c))
 12390  			return true
 12391  		}
 12392  		break
 12393  	}
 12394  	// match: (MUL (MOVDconst [c]) (MOVDconst [d]))
 12395  	// result: (MOVDconst [c*d])
 12396  	for {
 12397  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
 12398  			if v_0.Op != OpARM64MOVDconst {
 12399  				continue
 12400  			}
 12401  			c := auxIntToInt64(v_0.AuxInt)
 12402  			if v_1.Op != OpARM64MOVDconst {
 12403  				continue
 12404  			}
 12405  			d := auxIntToInt64(v_1.AuxInt)
 12406  			v.reset(OpARM64MOVDconst)
 12407  			v.AuxInt = int64ToAuxInt(c * d)
 12408  			return true
 12409  		}
 12410  		break
 12411  	}
 12412  	return false
 12413  }
 12414  func rewriteValueARM64_OpARM64MULW(v *Value) bool {
 12415  	v_1 := v.Args[1]
 12416  	v_0 := v.Args[0]
 12417  	b := v.Block
 12418  	config := b.Func.Config
 12419  	// match: (MULW (NEG x) y)
 12420  	// result: (MNEGW x y)
 12421  	for {
 12422  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
 12423  			if v_0.Op != OpARM64NEG {
 12424  				continue
 12425  			}
 12426  			x := v_0.Args[0]
 12427  			y := v_1
 12428  			v.reset(OpARM64MNEGW)
 12429  			v.AddArg2(x, y)
 12430  			return true
 12431  		}
 12432  		break
 12433  	}
 12434  	// match: (MULW _ (MOVDconst [c]))
 12435  	// cond: int32(c)==0
 12436  	// result: (MOVDconst [0])
 12437  	for {
 12438  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
 12439  			if v_1.Op != OpARM64MOVDconst {
 12440  				continue
 12441  			}
 12442  			c := auxIntToInt64(v_1.AuxInt)
 12443  			if !(int32(c) == 0) {
 12444  				continue
 12445  			}
 12446  			v.reset(OpARM64MOVDconst)
 12447  			v.AuxInt = int64ToAuxInt(0)
 12448  			return true
 12449  		}
 12450  		break
 12451  	}
 12452  	// match: (MULW x (MOVDconst [c]))
 12453  	// cond: int32(c)==1
 12454  	// result: (MOVWUreg x)
 12455  	for {
 12456  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
 12457  			x := v_0
 12458  			if v_1.Op != OpARM64MOVDconst {
 12459  				continue
 12460  			}
 12461  			c := auxIntToInt64(v_1.AuxInt)
 12462  			if !(int32(c) == 1) {
 12463  				continue
 12464  			}
 12465  			v.reset(OpARM64MOVWUreg)
 12466  			v.AddArg(x)
 12467  			return true
 12468  		}
 12469  		break
 12470  	}
 12471  	// match: (MULW x (MOVDconst [c]))
 12472  	// cond: v.Type.Size() <= 4 && canMulStrengthReduce32(config, int32(c))
 12473  	// result: {mulStrengthReduce32(v, x, int32(c))}
 12474  	for {
 12475  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
 12476  			x := v_0
 12477  			if v_1.Op != OpARM64MOVDconst {
 12478  				continue
 12479  			}
 12480  			c := auxIntToInt64(v_1.AuxInt)
 12481  			if !(v.Type.Size() <= 4 && canMulStrengthReduce32(config, int32(c))) {
 12482  				continue
 12483  			}
 12484  			v.copyOf(mulStrengthReduce32(v, x, int32(c)))
 12485  			return true
 12486  		}
 12487  		break
 12488  	}
 12489  	// match: (MULW (MOVDconst [c]) (MOVDconst [d]))
 12490  	// result: (MOVDconst [int64(uint32(c*d))])
 12491  	for {
 12492  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
 12493  			if v_0.Op != OpARM64MOVDconst {
 12494  				continue
 12495  			}
 12496  			c := auxIntToInt64(v_0.AuxInt)
 12497  			if v_1.Op != OpARM64MOVDconst {
 12498  				continue
 12499  			}
 12500  			d := auxIntToInt64(v_1.AuxInt)
 12501  			v.reset(OpARM64MOVDconst)
 12502  			v.AuxInt = int64ToAuxInt(int64(uint32(c * d)))
 12503  			return true
 12504  		}
 12505  		break
 12506  	}
 12507  	return false
 12508  }
 12509  func rewriteValueARM64_OpARM64MVN(v *Value) bool {
 12510  	v_0 := v.Args[0]
 12511  	// match: (MVN (XOR x y))
 12512  	// result: (EON x y)
 12513  	for {
 12514  		if v_0.Op != OpARM64XOR {
 12515  			break
 12516  		}
 12517  		y := v_0.Args[1]
 12518  		x := v_0.Args[0]
 12519  		v.reset(OpARM64EON)
 12520  		v.AddArg2(x, y)
 12521  		return true
 12522  	}
 12523  	// match: (MVN (MOVDconst [c]))
 12524  	// result: (MOVDconst [^c])
 12525  	for {
 12526  		if v_0.Op != OpARM64MOVDconst {
 12527  			break
 12528  		}
 12529  		c := auxIntToInt64(v_0.AuxInt)
 12530  		v.reset(OpARM64MOVDconst)
 12531  		v.AuxInt = int64ToAuxInt(^c)
 12532  		return true
 12533  	}
 12534  	// match: (MVN x:(SLLconst [c] y))
 12535  	// cond: clobberIfDead(x)
 12536  	// result: (MVNshiftLL [c] y)
 12537  	for {
 12538  		x := v_0
 12539  		if x.Op != OpARM64SLLconst {
 12540  			break
 12541  		}
 12542  		c := auxIntToInt64(x.AuxInt)
 12543  		y := x.Args[0]
 12544  		if !(clobberIfDead(x)) {
 12545  			break
 12546  		}
 12547  		v.reset(OpARM64MVNshiftLL)
 12548  		v.AuxInt = int64ToAuxInt(c)
 12549  		v.AddArg(y)
 12550  		return true
 12551  	}
 12552  	// match: (MVN x:(SRLconst [c] y))
 12553  	// cond: clobberIfDead(x)
 12554  	// result: (MVNshiftRL [c] y)
 12555  	for {
 12556  		x := v_0
 12557  		if x.Op != OpARM64SRLconst {
 12558  			break
 12559  		}
 12560  		c := auxIntToInt64(x.AuxInt)
 12561  		y := x.Args[0]
 12562  		if !(clobberIfDead(x)) {
 12563  			break
 12564  		}
 12565  		v.reset(OpARM64MVNshiftRL)
 12566  		v.AuxInt = int64ToAuxInt(c)
 12567  		v.AddArg(y)
 12568  		return true
 12569  	}
 12570  	// match: (MVN x:(SRAconst [c] y))
 12571  	// cond: clobberIfDead(x)
 12572  	// result: (MVNshiftRA [c] y)
 12573  	for {
 12574  		x := v_0
 12575  		if x.Op != OpARM64SRAconst {
 12576  			break
 12577  		}
 12578  		c := auxIntToInt64(x.AuxInt)
 12579  		y := x.Args[0]
 12580  		if !(clobberIfDead(x)) {
 12581  			break
 12582  		}
 12583  		v.reset(OpARM64MVNshiftRA)
 12584  		v.AuxInt = int64ToAuxInt(c)
 12585  		v.AddArg(y)
 12586  		return true
 12587  	}
 12588  	// match: (MVN x:(RORconst [c] y))
 12589  	// cond: clobberIfDead(x)
 12590  	// result: (MVNshiftRO [c] y)
 12591  	for {
 12592  		x := v_0
 12593  		if x.Op != OpARM64RORconst {
 12594  			break
 12595  		}
 12596  		c := auxIntToInt64(x.AuxInt)
 12597  		y := x.Args[0]
 12598  		if !(clobberIfDead(x)) {
 12599  			break
 12600  		}
 12601  		v.reset(OpARM64MVNshiftRO)
 12602  		v.AuxInt = int64ToAuxInt(c)
 12603  		v.AddArg(y)
 12604  		return true
 12605  	}
 12606  	return false
 12607  }
 12608  func rewriteValueARM64_OpARM64MVNshiftLL(v *Value) bool {
 12609  	v_0 := v.Args[0]
 12610  	// match: (MVNshiftLL (MOVDconst [c]) [d])
 12611  	// result: (MOVDconst [^int64(uint64(c)<<uint64(d))])
 12612  	for {
 12613  		d := auxIntToInt64(v.AuxInt)
 12614  		if v_0.Op != OpARM64MOVDconst {
 12615  			break
 12616  		}
 12617  		c := auxIntToInt64(v_0.AuxInt)
 12618  		v.reset(OpARM64MOVDconst)
 12619  		v.AuxInt = int64ToAuxInt(^int64(uint64(c) << uint64(d)))
 12620  		return true
 12621  	}
 12622  	return false
 12623  }
 12624  func rewriteValueARM64_OpARM64MVNshiftRA(v *Value) bool {
 12625  	v_0 := v.Args[0]
 12626  	// match: (MVNshiftRA (MOVDconst [c]) [d])
 12627  	// result: (MOVDconst [^(c>>uint64(d))])
 12628  	for {
 12629  		d := auxIntToInt64(v.AuxInt)
 12630  		if v_0.Op != OpARM64MOVDconst {
 12631  			break
 12632  		}
 12633  		c := auxIntToInt64(v_0.AuxInt)
 12634  		v.reset(OpARM64MOVDconst)
 12635  		v.AuxInt = int64ToAuxInt(^(c >> uint64(d)))
 12636  		return true
 12637  	}
 12638  	return false
 12639  }
 12640  func rewriteValueARM64_OpARM64MVNshiftRL(v *Value) bool {
 12641  	v_0 := v.Args[0]
 12642  	// match: (MVNshiftRL (MOVDconst [c]) [d])
 12643  	// result: (MOVDconst [^int64(uint64(c)>>uint64(d))])
 12644  	for {
 12645  		d := auxIntToInt64(v.AuxInt)
 12646  		if v_0.Op != OpARM64MOVDconst {
 12647  			break
 12648  		}
 12649  		c := auxIntToInt64(v_0.AuxInt)
 12650  		v.reset(OpARM64MOVDconst)
 12651  		v.AuxInt = int64ToAuxInt(^int64(uint64(c) >> uint64(d)))
 12652  		return true
 12653  	}
 12654  	return false
 12655  }
 12656  func rewriteValueARM64_OpARM64MVNshiftRO(v *Value) bool {
 12657  	v_0 := v.Args[0]
 12658  	// match: (MVNshiftRO (MOVDconst [c]) [d])
 12659  	// result: (MOVDconst [^rotateRight64(c, d)])
 12660  	for {
 12661  		d := auxIntToInt64(v.AuxInt)
 12662  		if v_0.Op != OpARM64MOVDconst {
 12663  			break
 12664  		}
 12665  		c := auxIntToInt64(v_0.AuxInt)
 12666  		v.reset(OpARM64MOVDconst)
 12667  		v.AuxInt = int64ToAuxInt(^rotateRight64(c, d))
 12668  		return true
 12669  	}
 12670  	return false
 12671  }
 12672  func rewriteValueARM64_OpARM64NEG(v *Value) bool {
 12673  	v_0 := v.Args[0]
 12674  	// match: (NEG (MUL x y))
 12675  	// result: (MNEG x y)
 12676  	for {
 12677  		if v_0.Op != OpARM64MUL {
 12678  			break
 12679  		}
 12680  		y := v_0.Args[1]
 12681  		x := v_0.Args[0]
 12682  		v.reset(OpARM64MNEG)
 12683  		v.AddArg2(x, y)
 12684  		return true
 12685  	}
 12686  	// match: (NEG (MULW x y))
 12687  	// cond: v.Type.Size() <= 4
 12688  	// result: (MNEGW x y)
 12689  	for {
 12690  		if v_0.Op != OpARM64MULW {
 12691  			break
 12692  		}
 12693  		y := v_0.Args[1]
 12694  		x := v_0.Args[0]
 12695  		if !(v.Type.Size() <= 4) {
 12696  			break
 12697  		}
 12698  		v.reset(OpARM64MNEGW)
 12699  		v.AddArg2(x, y)
 12700  		return true
 12701  	}
 12702  	// match: (NEG (SUB x y))
 12703  	// result: (SUB y x)
 12704  	for {
 12705  		if v_0.Op != OpARM64SUB {
 12706  			break
 12707  		}
 12708  		y := v_0.Args[1]
 12709  		x := v_0.Args[0]
 12710  		v.reset(OpARM64SUB)
 12711  		v.AddArg2(y, x)
 12712  		return true
 12713  	}
 12714  	// match: (NEG (NEG x))
 12715  	// result: x
 12716  	for {
 12717  		if v_0.Op != OpARM64NEG {
 12718  			break
 12719  		}
 12720  		x := v_0.Args[0]
 12721  		v.copyOf(x)
 12722  		return true
 12723  	}
 12724  	// match: (NEG (MOVDconst [c]))
 12725  	// result: (MOVDconst [-c])
 12726  	for {
 12727  		if v_0.Op != OpARM64MOVDconst {
 12728  			break
 12729  		}
 12730  		c := auxIntToInt64(v_0.AuxInt)
 12731  		v.reset(OpARM64MOVDconst)
 12732  		v.AuxInt = int64ToAuxInt(-c)
 12733  		return true
 12734  	}
 12735  	// match: (NEG x:(SLLconst [c] y))
 12736  	// cond: clobberIfDead(x)
 12737  	// result: (NEGshiftLL [c] y)
 12738  	for {
 12739  		x := v_0
 12740  		if x.Op != OpARM64SLLconst {
 12741  			break
 12742  		}
 12743  		c := auxIntToInt64(x.AuxInt)
 12744  		y := x.Args[0]
 12745  		if !(clobberIfDead(x)) {
 12746  			break
 12747  		}
 12748  		v.reset(OpARM64NEGshiftLL)
 12749  		v.AuxInt = int64ToAuxInt(c)
 12750  		v.AddArg(y)
 12751  		return true
 12752  	}
 12753  	// match: (NEG x:(SRLconst [c] y))
 12754  	// cond: clobberIfDead(x)
 12755  	// result: (NEGshiftRL [c] y)
 12756  	for {
 12757  		x := v_0
 12758  		if x.Op != OpARM64SRLconst {
 12759  			break
 12760  		}
 12761  		c := auxIntToInt64(x.AuxInt)
 12762  		y := x.Args[0]
 12763  		if !(clobberIfDead(x)) {
 12764  			break
 12765  		}
 12766  		v.reset(OpARM64NEGshiftRL)
 12767  		v.AuxInt = int64ToAuxInt(c)
 12768  		v.AddArg(y)
 12769  		return true
 12770  	}
 12771  	// match: (NEG x:(SRAconst [c] y))
 12772  	// cond: clobberIfDead(x)
 12773  	// result: (NEGshiftRA [c] y)
 12774  	for {
 12775  		x := v_0
 12776  		if x.Op != OpARM64SRAconst {
 12777  			break
 12778  		}
 12779  		c := auxIntToInt64(x.AuxInt)
 12780  		y := x.Args[0]
 12781  		if !(clobberIfDead(x)) {
 12782  			break
 12783  		}
 12784  		v.reset(OpARM64NEGshiftRA)
 12785  		v.AuxInt = int64ToAuxInt(c)
 12786  		v.AddArg(y)
 12787  		return true
 12788  	}
 12789  	return false
 12790  }
 12791  func rewriteValueARM64_OpARM64NEGshiftLL(v *Value) bool {
 12792  	v_0 := v.Args[0]
 12793  	// match: (NEGshiftLL (MOVDconst [c]) [d])
 12794  	// result: (MOVDconst [-int64(uint64(c)<<uint64(d))])
 12795  	for {
 12796  		d := auxIntToInt64(v.AuxInt)
 12797  		if v_0.Op != OpARM64MOVDconst {
 12798  			break
 12799  		}
 12800  		c := auxIntToInt64(v_0.AuxInt)
 12801  		v.reset(OpARM64MOVDconst)
 12802  		v.AuxInt = int64ToAuxInt(-int64(uint64(c) << uint64(d)))
 12803  		return true
 12804  	}
 12805  	return false
 12806  }
 12807  func rewriteValueARM64_OpARM64NEGshiftRA(v *Value) bool {
 12808  	v_0 := v.Args[0]
 12809  	// match: (NEGshiftRA (MOVDconst [c]) [d])
 12810  	// result: (MOVDconst [-(c>>uint64(d))])
 12811  	for {
 12812  		d := auxIntToInt64(v.AuxInt)
 12813  		if v_0.Op != OpARM64MOVDconst {
 12814  			break
 12815  		}
 12816  		c := auxIntToInt64(v_0.AuxInt)
 12817  		v.reset(OpARM64MOVDconst)
 12818  		v.AuxInt = int64ToAuxInt(-(c >> uint64(d)))
 12819  		return true
 12820  	}
 12821  	return false
 12822  }
 12823  func rewriteValueARM64_OpARM64NEGshiftRL(v *Value) bool {
 12824  	v_0 := v.Args[0]
 12825  	// match: (NEGshiftRL (MOVDconst [c]) [d])
 12826  	// result: (MOVDconst [-int64(uint64(c)>>uint64(d))])
 12827  	for {
 12828  		d := auxIntToInt64(v.AuxInt)
 12829  		if v_0.Op != OpARM64MOVDconst {
 12830  			break
 12831  		}
 12832  		c := auxIntToInt64(v_0.AuxInt)
 12833  		v.reset(OpARM64MOVDconst)
 12834  		v.AuxInt = int64ToAuxInt(-int64(uint64(c) >> uint64(d)))
 12835  		return true
 12836  	}
 12837  	return false
 12838  }
 12839  func rewriteValueARM64_OpARM64NotEqual(v *Value) bool {
 12840  	v_0 := v.Args[0]
 12841  	b := v.Block
 12842  	// match: (NotEqual (CMPconst [0] z:(AND x y)))
 12843  	// cond: z.Uses == 1
 12844  	// result: (NotEqual (TST x y))
 12845  	for {
 12846  		if v_0.Op != OpARM64CMPconst || auxIntToInt64(v_0.AuxInt) != 0 {
 12847  			break
 12848  		}
 12849  		z := v_0.Args[0]
 12850  		if z.Op != OpARM64AND {
 12851  			break
 12852  		}
 12853  		y := z.Args[1]
 12854  		x := z.Args[0]
 12855  		if !(z.Uses == 1) {
 12856  			break
 12857  		}
 12858  		v.reset(OpARM64NotEqual)
 12859  		v0 := b.NewValue0(v.Pos, OpARM64TST, types.TypeFlags)
 12860  		v0.AddArg2(x, y)
 12861  		v.AddArg(v0)
 12862  		return true
 12863  	}
 12864  	// match: (NotEqual (CMPWconst [0] x:(ANDconst [c] y)))
 12865  	// cond: x.Uses == 1
 12866  	// result: (NotEqual (TSTWconst [int32(c)] y))
 12867  	for {
 12868  		if v_0.Op != OpARM64CMPWconst || auxIntToInt32(v_0.AuxInt) != 0 {
 12869  			break
 12870  		}
 12871  		x := v_0.Args[0]
 12872  		if x.Op != OpARM64ANDconst {
 12873  			break
 12874  		}
 12875  		c := auxIntToInt64(x.AuxInt)
 12876  		y := x.Args[0]
 12877  		if !(x.Uses == 1) {
 12878  			break
 12879  		}
 12880  		v.reset(OpARM64NotEqual)
 12881  		v0 := b.NewValue0(v.Pos, OpARM64TSTWconst, types.TypeFlags)
 12882  		v0.AuxInt = int32ToAuxInt(int32(c))
 12883  		v0.AddArg(y)
 12884  		v.AddArg(v0)
 12885  		return true
 12886  	}
 12887  	// match: (NotEqual (CMPWconst [0] z:(AND x y)))
 12888  	// cond: z.Uses == 1
 12889  	// result: (NotEqual (TSTW x y))
 12890  	for {
 12891  		if v_0.Op != OpARM64CMPWconst || auxIntToInt32(v_0.AuxInt) != 0 {
 12892  			break
 12893  		}
 12894  		z := v_0.Args[0]
 12895  		if z.Op != OpARM64AND {
 12896  			break
 12897  		}
 12898  		y := z.Args[1]
 12899  		x := z.Args[0]
 12900  		if !(z.Uses == 1) {
 12901  			break
 12902  		}
 12903  		v.reset(OpARM64NotEqual)
 12904  		v0 := b.NewValue0(v.Pos, OpARM64TSTW, types.TypeFlags)
 12905  		v0.AddArg2(x, y)
 12906  		v.AddArg(v0)
 12907  		return true
 12908  	}
 12909  	// match: (NotEqual (CMPconst [0] x:(ANDconst [c] y)))
 12910  	// cond: x.Uses == 1
 12911  	// result: (NotEqual (TSTconst [c] y))
 12912  	for {
 12913  		if v_0.Op != OpARM64CMPconst || auxIntToInt64(v_0.AuxInt) != 0 {
 12914  			break
 12915  		}
 12916  		x := v_0.Args[0]
 12917  		if x.Op != OpARM64ANDconst {
 12918  			break
 12919  		}
 12920  		c := auxIntToInt64(x.AuxInt)
 12921  		y := x.Args[0]
 12922  		if !(x.Uses == 1) {
 12923  			break
 12924  		}
 12925  		v.reset(OpARM64NotEqual)
 12926  		v0 := b.NewValue0(v.Pos, OpARM64TSTconst, types.TypeFlags)
 12927  		v0.AuxInt = int64ToAuxInt(c)
 12928  		v0.AddArg(y)
 12929  		v.AddArg(v0)
 12930  		return true
 12931  	}
 12932  	// match: (NotEqual (CMP x z:(NEG y)))
 12933  	// cond: z.Uses == 1
 12934  	// result: (NotEqual (CMN x y))
 12935  	for {
 12936  		if v_0.Op != OpARM64CMP {
 12937  			break
 12938  		}
 12939  		_ = v_0.Args[1]
 12940  		x := v_0.Args[0]
 12941  		z := v_0.Args[1]
 12942  		if z.Op != OpARM64NEG {
 12943  			break
 12944  		}
 12945  		y := z.Args[0]
 12946  		if !(z.Uses == 1) {
 12947  			break
 12948  		}
 12949  		v.reset(OpARM64NotEqual)
 12950  		v0 := b.NewValue0(v.Pos, OpARM64CMN, types.TypeFlags)
 12951  		v0.AddArg2(x, y)
 12952  		v.AddArg(v0)
 12953  		return true
 12954  	}
 12955  	// match: (NotEqual (CMPW x z:(NEG y)))
 12956  	// cond: z.Uses == 1
 12957  	// result: (NotEqual (CMNW x y))
 12958  	for {
 12959  		if v_0.Op != OpARM64CMPW {
 12960  			break
 12961  		}
 12962  		_ = v_0.Args[1]
 12963  		x := v_0.Args[0]
 12964  		z := v_0.Args[1]
 12965  		if z.Op != OpARM64NEG {
 12966  			break
 12967  		}
 12968  		y := z.Args[0]
 12969  		if !(z.Uses == 1) {
 12970  			break
 12971  		}
 12972  		v.reset(OpARM64NotEqual)
 12973  		v0 := b.NewValue0(v.Pos, OpARM64CMNW, types.TypeFlags)
 12974  		v0.AddArg2(x, y)
 12975  		v.AddArg(v0)
 12976  		return true
 12977  	}
 12978  	// match: (NotEqual (CMPconst [0] x:(ADDconst [c] y)))
 12979  	// cond: x.Uses == 1
 12980  	// result: (NotEqual (CMNconst [c] y))
 12981  	for {
 12982  		if v_0.Op != OpARM64CMPconst || auxIntToInt64(v_0.AuxInt) != 0 {
 12983  			break
 12984  		}
 12985  		x := v_0.Args[0]
 12986  		if x.Op != OpARM64ADDconst {
 12987  			break
 12988  		}
 12989  		c := auxIntToInt64(x.AuxInt)
 12990  		y := x.Args[0]
 12991  		if !(x.Uses == 1) {
 12992  			break
 12993  		}
 12994  		v.reset(OpARM64NotEqual)
 12995  		v0 := b.NewValue0(v.Pos, OpARM64CMNconst, types.TypeFlags)
 12996  		v0.AuxInt = int64ToAuxInt(c)
 12997  		v0.AddArg(y)
 12998  		v.AddArg(v0)
 12999  		return true
 13000  	}
 13001  	// match: (NotEqual (CMPWconst [0] x:(ADDconst [c] y)))
 13002  	// cond: x.Uses == 1
 13003  	// result: (NotEqual (CMNWconst [int32(c)] y))
 13004  	for {
 13005  		if v_0.Op != OpARM64CMPWconst || auxIntToInt32(v_0.AuxInt) != 0 {
 13006  			break
 13007  		}
 13008  		x := v_0.Args[0]
 13009  		if x.Op != OpARM64ADDconst {
 13010  			break
 13011  		}
 13012  		c := auxIntToInt64(x.AuxInt)
 13013  		y := x.Args[0]
 13014  		if !(x.Uses == 1) {
 13015  			break
 13016  		}
 13017  		v.reset(OpARM64NotEqual)
 13018  		v0 := b.NewValue0(v.Pos, OpARM64CMNWconst, types.TypeFlags)
 13019  		v0.AuxInt = int32ToAuxInt(int32(c))
 13020  		v0.AddArg(y)
 13021  		v.AddArg(v0)
 13022  		return true
 13023  	}
 13024  	// match: (NotEqual (CMPconst [0] z:(ADD x y)))
 13025  	// cond: z.Uses == 1
 13026  	// result: (NotEqual (CMN x y))
 13027  	for {
 13028  		if v_0.Op != OpARM64CMPconst || auxIntToInt64(v_0.AuxInt) != 0 {
 13029  			break
 13030  		}
 13031  		z := v_0.Args[0]
 13032  		if z.Op != OpARM64ADD {
 13033  			break
 13034  		}
 13035  		y := z.Args[1]
 13036  		x := z.Args[0]
 13037  		if !(z.Uses == 1) {
 13038  			break
 13039  		}
 13040  		v.reset(OpARM64NotEqual)
 13041  		v0 := b.NewValue0(v.Pos, OpARM64CMN, types.TypeFlags)
 13042  		v0.AddArg2(x, y)
 13043  		v.AddArg(v0)
 13044  		return true
 13045  	}
 13046  	// match: (NotEqual (CMPWconst [0] z:(ADD x y)))
 13047  	// cond: z.Uses == 1
 13048  	// result: (NotEqual (CMNW x y))
 13049  	for {
 13050  		if v_0.Op != OpARM64CMPWconst || auxIntToInt32(v_0.AuxInt) != 0 {
 13051  			break
 13052  		}
 13053  		z := v_0.Args[0]
 13054  		if z.Op != OpARM64ADD {
 13055  			break
 13056  		}
 13057  		y := z.Args[1]
 13058  		x := z.Args[0]
 13059  		if !(z.Uses == 1) {
 13060  			break
 13061  		}
 13062  		v.reset(OpARM64NotEqual)
 13063  		v0 := b.NewValue0(v.Pos, OpARM64CMNW, types.TypeFlags)
 13064  		v0.AddArg2(x, y)
 13065  		v.AddArg(v0)
 13066  		return true
 13067  	}
 13068  	// match: (NotEqual (CMPconst [0] z:(MADD a x y)))
 13069  	// cond: z.Uses == 1
 13070  	// result: (NotEqual (CMN a (MUL <x.Type> x y)))
 13071  	for {
 13072  		if v_0.Op != OpARM64CMPconst || auxIntToInt64(v_0.AuxInt) != 0 {
 13073  			break
 13074  		}
 13075  		z := v_0.Args[0]
 13076  		if z.Op != OpARM64MADD {
 13077  			break
 13078  		}
 13079  		y := z.Args[2]
 13080  		a := z.Args[0]
 13081  		x := z.Args[1]
 13082  		if !(z.Uses == 1) {
 13083  			break
 13084  		}
 13085  		v.reset(OpARM64NotEqual)
 13086  		v0 := b.NewValue0(v.Pos, OpARM64CMN, types.TypeFlags)
 13087  		v1 := b.NewValue0(v.Pos, OpARM64MUL, x.Type)
 13088  		v1.AddArg2(x, y)
 13089  		v0.AddArg2(a, v1)
 13090  		v.AddArg(v0)
 13091  		return true
 13092  	}
 13093  	// match: (NotEqual (CMPconst [0] z:(MSUB a x y)))
 13094  	// cond: z.Uses == 1
 13095  	// result: (NotEqual (CMP a (MUL <x.Type> x y)))
 13096  	for {
 13097  		if v_0.Op != OpARM64CMPconst || auxIntToInt64(v_0.AuxInt) != 0 {
 13098  			break
 13099  		}
 13100  		z := v_0.Args[0]
 13101  		if z.Op != OpARM64MSUB {
 13102  			break
 13103  		}
 13104  		y := z.Args[2]
 13105  		a := z.Args[0]
 13106  		x := z.Args[1]
 13107  		if !(z.Uses == 1) {
 13108  			break
 13109  		}
 13110  		v.reset(OpARM64NotEqual)
 13111  		v0 := b.NewValue0(v.Pos, OpARM64CMP, types.TypeFlags)
 13112  		v1 := b.NewValue0(v.Pos, OpARM64MUL, x.Type)
 13113  		v1.AddArg2(x, y)
 13114  		v0.AddArg2(a, v1)
 13115  		v.AddArg(v0)
 13116  		return true
 13117  	}
 13118  	// match: (NotEqual (CMPWconst [0] z:(MADDW a x y)))
 13119  	// cond: z.Uses == 1
 13120  	// result: (NotEqual (CMNW a (MULW <x.Type> x y)))
 13121  	for {
 13122  		if v_0.Op != OpARM64CMPWconst || auxIntToInt32(v_0.AuxInt) != 0 {
 13123  			break
 13124  		}
 13125  		z := v_0.Args[0]
 13126  		if z.Op != OpARM64MADDW {
 13127  			break
 13128  		}
 13129  		y := z.Args[2]
 13130  		a := z.Args[0]
 13131  		x := z.Args[1]
 13132  		if !(z.Uses == 1) {
 13133  			break
 13134  		}
 13135  		v.reset(OpARM64NotEqual)
 13136  		v0 := b.NewValue0(v.Pos, OpARM64CMNW, types.TypeFlags)
 13137  		v1 := b.NewValue0(v.Pos, OpARM64MULW, x.Type)
 13138  		v1.AddArg2(x, y)
 13139  		v0.AddArg2(a, v1)
 13140  		v.AddArg(v0)
 13141  		return true
 13142  	}
 13143  	// match: (NotEqual (CMPWconst [0] z:(MSUBW a x y)))
 13144  	// cond: z.Uses == 1
 13145  	// result: (NotEqual (CMPW a (MULW <x.Type> x y)))
 13146  	for {
 13147  		if v_0.Op != OpARM64CMPWconst || auxIntToInt32(v_0.AuxInt) != 0 {
 13148  			break
 13149  		}
 13150  		z := v_0.Args[0]
 13151  		if z.Op != OpARM64MSUBW {
 13152  			break
 13153  		}
 13154  		y := z.Args[2]
 13155  		a := z.Args[0]
 13156  		x := z.Args[1]
 13157  		if !(z.Uses == 1) {
 13158  			break
 13159  		}
 13160  		v.reset(OpARM64NotEqual)
 13161  		v0 := b.NewValue0(v.Pos, OpARM64CMPW, types.TypeFlags)
 13162  		v1 := b.NewValue0(v.Pos, OpARM64MULW, x.Type)
 13163  		v1.AddArg2(x, y)
 13164  		v0.AddArg2(a, v1)
 13165  		v.AddArg(v0)
 13166  		return true
 13167  	}
 13168  	// match: (NotEqual (FlagConstant [fc]))
 13169  	// result: (MOVDconst [b2i(fc.ne())])
 13170  	for {
 13171  		if v_0.Op != OpARM64FlagConstant {
 13172  			break
 13173  		}
 13174  		fc := auxIntToFlagConstant(v_0.AuxInt)
 13175  		v.reset(OpARM64MOVDconst)
 13176  		v.AuxInt = int64ToAuxInt(b2i(fc.ne()))
 13177  		return true
 13178  	}
 13179  	// match: (NotEqual (InvertFlags x))
 13180  	// result: (NotEqual x)
 13181  	for {
 13182  		if v_0.Op != OpARM64InvertFlags {
 13183  			break
 13184  		}
 13185  		x := v_0.Args[0]
 13186  		v.reset(OpARM64NotEqual)
 13187  		v.AddArg(x)
 13188  		return true
 13189  	}
 13190  	return false
 13191  }
 13192  func rewriteValueARM64_OpARM64OR(v *Value) bool {
 13193  	v_1 := v.Args[1]
 13194  	v_0 := v.Args[0]
 13195  	// match: (OR x (MOVDconst [c]))
 13196  	// result: (ORconst [c] x)
 13197  	for {
 13198  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
 13199  			x := v_0
 13200  			if v_1.Op != OpARM64MOVDconst {
 13201  				continue
 13202  			}
 13203  			c := auxIntToInt64(v_1.AuxInt)
 13204  			v.reset(OpARM64ORconst)
 13205  			v.AuxInt = int64ToAuxInt(c)
 13206  			v.AddArg(x)
 13207  			return true
 13208  		}
 13209  		break
 13210  	}
 13211  	// match: (OR x x)
 13212  	// result: x
 13213  	for {
 13214  		x := v_0
 13215  		if x != v_1 {
 13216  			break
 13217  		}
 13218  		v.copyOf(x)
 13219  		return true
 13220  	}
 13221  	// match: (OR x (MVN y))
 13222  	// result: (ORN x y)
 13223  	for {
 13224  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
 13225  			x := v_0
 13226  			if v_1.Op != OpARM64MVN {
 13227  				continue
 13228  			}
 13229  			y := v_1.Args[0]
 13230  			v.reset(OpARM64ORN)
 13231  			v.AddArg2(x, y)
 13232  			return true
 13233  		}
 13234  		break
 13235  	}
 13236  	// match: (OR x0 x1:(SLLconst [c] y))
 13237  	// cond: clobberIfDead(x1)
 13238  	// result: (ORshiftLL x0 y [c])
 13239  	for {
 13240  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
 13241  			x0 := v_0
 13242  			x1 := v_1
 13243  			if x1.Op != OpARM64SLLconst {
 13244  				continue
 13245  			}
 13246  			c := auxIntToInt64(x1.AuxInt)
 13247  			y := x1.Args[0]
 13248  			if !(clobberIfDead(x1)) {
 13249  				continue
 13250  			}
 13251  			v.reset(OpARM64ORshiftLL)
 13252  			v.AuxInt = int64ToAuxInt(c)
 13253  			v.AddArg2(x0, y)
 13254  			return true
 13255  		}
 13256  		break
 13257  	}
 13258  	// match: (OR x0 x1:(SRLconst [c] y))
 13259  	// cond: clobberIfDead(x1)
 13260  	// result: (ORshiftRL x0 y [c])
 13261  	for {
 13262  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
 13263  			x0 := v_0
 13264  			x1 := v_1
 13265  			if x1.Op != OpARM64SRLconst {
 13266  				continue
 13267  			}
 13268  			c := auxIntToInt64(x1.AuxInt)
 13269  			y := x1.Args[0]
 13270  			if !(clobberIfDead(x1)) {
 13271  				continue
 13272  			}
 13273  			v.reset(OpARM64ORshiftRL)
 13274  			v.AuxInt = int64ToAuxInt(c)
 13275  			v.AddArg2(x0, y)
 13276  			return true
 13277  		}
 13278  		break
 13279  	}
 13280  	// match: (OR x0 x1:(SRAconst [c] y))
 13281  	// cond: clobberIfDead(x1)
 13282  	// result: (ORshiftRA x0 y [c])
 13283  	for {
 13284  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
 13285  			x0 := v_0
 13286  			x1 := v_1
 13287  			if x1.Op != OpARM64SRAconst {
 13288  				continue
 13289  			}
 13290  			c := auxIntToInt64(x1.AuxInt)
 13291  			y := x1.Args[0]
 13292  			if !(clobberIfDead(x1)) {
 13293  				continue
 13294  			}
 13295  			v.reset(OpARM64ORshiftRA)
 13296  			v.AuxInt = int64ToAuxInt(c)
 13297  			v.AddArg2(x0, y)
 13298  			return true
 13299  		}
 13300  		break
 13301  	}
 13302  	// match: (OR x0 x1:(RORconst [c] y))
 13303  	// cond: clobberIfDead(x1)
 13304  	// result: (ORshiftRO x0 y [c])
 13305  	for {
 13306  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
 13307  			x0 := v_0
 13308  			x1 := v_1
 13309  			if x1.Op != OpARM64RORconst {
 13310  				continue
 13311  			}
 13312  			c := auxIntToInt64(x1.AuxInt)
 13313  			y := x1.Args[0]
 13314  			if !(clobberIfDead(x1)) {
 13315  				continue
 13316  			}
 13317  			v.reset(OpARM64ORshiftRO)
 13318  			v.AuxInt = int64ToAuxInt(c)
 13319  			v.AddArg2(x0, y)
 13320  			return true
 13321  		}
 13322  		break
 13323  	}
 13324  	// match: (OR (UBFIZ [bfc] x) (ANDconst [ac] y))
 13325  	// cond: ac == ^((1<<uint(bfc.width())-1) << uint(bfc.lsb()))
 13326  	// result: (BFI [bfc] y x)
 13327  	for {
 13328  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
 13329  			if v_0.Op != OpARM64UBFIZ {
 13330  				continue
 13331  			}
 13332  			bfc := auxIntToArm64BitField(v_0.AuxInt)
 13333  			x := v_0.Args[0]
 13334  			if v_1.Op != OpARM64ANDconst {
 13335  				continue
 13336  			}
 13337  			ac := auxIntToInt64(v_1.AuxInt)
 13338  			y := v_1.Args[0]
 13339  			if !(ac == ^((1<<uint(bfc.width()) - 1) << uint(bfc.lsb()))) {
 13340  				continue
 13341  			}
 13342  			v.reset(OpARM64BFI)
 13343  			v.AuxInt = arm64BitFieldToAuxInt(bfc)
 13344  			v.AddArg2(y, x)
 13345  			return true
 13346  		}
 13347  		break
 13348  	}
 13349  	// match: (OR (UBFX [bfc] x) (ANDconst [ac] y))
 13350  	// cond: ac == ^(1<<uint(bfc.width())-1)
 13351  	// result: (BFXIL [bfc] y x)
 13352  	for {
 13353  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
 13354  			if v_0.Op != OpARM64UBFX {
 13355  				continue
 13356  			}
 13357  			bfc := auxIntToArm64BitField(v_0.AuxInt)
 13358  			x := v_0.Args[0]
 13359  			if v_1.Op != OpARM64ANDconst {
 13360  				continue
 13361  			}
 13362  			ac := auxIntToInt64(v_1.AuxInt)
 13363  			y := v_1.Args[0]
 13364  			if !(ac == ^(1<<uint(bfc.width()) - 1)) {
 13365  				continue
 13366  			}
 13367  			v.reset(OpARM64BFXIL)
 13368  			v.AuxInt = arm64BitFieldToAuxInt(bfc)
 13369  			v.AddArg2(y, x)
 13370  			return true
 13371  		}
 13372  		break
 13373  	}
 13374  	return false
 13375  }
 13376  func rewriteValueARM64_OpARM64ORN(v *Value) bool {
 13377  	v_1 := v.Args[1]
 13378  	v_0 := v.Args[0]
 13379  	// match: (ORN x (MOVDconst [c]))
 13380  	// result: (ORconst [^c] x)
 13381  	for {
 13382  		x := v_0
 13383  		if v_1.Op != OpARM64MOVDconst {
 13384  			break
 13385  		}
 13386  		c := auxIntToInt64(v_1.AuxInt)
 13387  		v.reset(OpARM64ORconst)
 13388  		v.AuxInt = int64ToAuxInt(^c)
 13389  		v.AddArg(x)
 13390  		return true
 13391  	}
 13392  	// match: (ORN x x)
 13393  	// result: (MOVDconst [-1])
 13394  	for {
 13395  		x := v_0
 13396  		if x != v_1 {
 13397  			break
 13398  		}
 13399  		v.reset(OpARM64MOVDconst)
 13400  		v.AuxInt = int64ToAuxInt(-1)
 13401  		return true
 13402  	}
 13403  	// match: (ORN x0 x1:(SLLconst [c] y))
 13404  	// cond: clobberIfDead(x1)
 13405  	// result: (ORNshiftLL x0 y [c])
 13406  	for {
 13407  		x0 := v_0
 13408  		x1 := v_1
 13409  		if x1.Op != OpARM64SLLconst {
 13410  			break
 13411  		}
 13412  		c := auxIntToInt64(x1.AuxInt)
 13413  		y := x1.Args[0]
 13414  		if !(clobberIfDead(x1)) {
 13415  			break
 13416  		}
 13417  		v.reset(OpARM64ORNshiftLL)
 13418  		v.AuxInt = int64ToAuxInt(c)
 13419  		v.AddArg2(x0, y)
 13420  		return true
 13421  	}
 13422  	// match: (ORN x0 x1:(SRLconst [c] y))
 13423  	// cond: clobberIfDead(x1)
 13424  	// result: (ORNshiftRL x0 y [c])
 13425  	for {
 13426  		x0 := v_0
 13427  		x1 := v_1
 13428  		if x1.Op != OpARM64SRLconst {
 13429  			break
 13430  		}
 13431  		c := auxIntToInt64(x1.AuxInt)
 13432  		y := x1.Args[0]
 13433  		if !(clobberIfDead(x1)) {
 13434  			break
 13435  		}
 13436  		v.reset(OpARM64ORNshiftRL)
 13437  		v.AuxInt = int64ToAuxInt(c)
 13438  		v.AddArg2(x0, y)
 13439  		return true
 13440  	}
 13441  	// match: (ORN x0 x1:(SRAconst [c] y))
 13442  	// cond: clobberIfDead(x1)
 13443  	// result: (ORNshiftRA x0 y [c])
 13444  	for {
 13445  		x0 := v_0
 13446  		x1 := v_1
 13447  		if x1.Op != OpARM64SRAconst {
 13448  			break
 13449  		}
 13450  		c := auxIntToInt64(x1.AuxInt)
 13451  		y := x1.Args[0]
 13452  		if !(clobberIfDead(x1)) {
 13453  			break
 13454  		}
 13455  		v.reset(OpARM64ORNshiftRA)
 13456  		v.AuxInt = int64ToAuxInt(c)
 13457  		v.AddArg2(x0, y)
 13458  		return true
 13459  	}
 13460  	// match: (ORN x0 x1:(RORconst [c] y))
 13461  	// cond: clobberIfDead(x1)
 13462  	// result: (ORNshiftRO x0 y [c])
 13463  	for {
 13464  		x0 := v_0
 13465  		x1 := v_1
 13466  		if x1.Op != OpARM64RORconst {
 13467  			break
 13468  		}
 13469  		c := auxIntToInt64(x1.AuxInt)
 13470  		y := x1.Args[0]
 13471  		if !(clobberIfDead(x1)) {
 13472  			break
 13473  		}
 13474  		v.reset(OpARM64ORNshiftRO)
 13475  		v.AuxInt = int64ToAuxInt(c)
 13476  		v.AddArg2(x0, y)
 13477  		return true
 13478  	}
 13479  	return false
 13480  }
 13481  func rewriteValueARM64_OpARM64ORNshiftLL(v *Value) bool {
 13482  	v_1 := v.Args[1]
 13483  	v_0 := v.Args[0]
 13484  	// match: (ORNshiftLL x (MOVDconst [c]) [d])
 13485  	// result: (ORconst x [^int64(uint64(c)<<uint64(d))])
 13486  	for {
 13487  		d := auxIntToInt64(v.AuxInt)
 13488  		x := v_0
 13489  		if v_1.Op != OpARM64MOVDconst {
 13490  			break
 13491  		}
 13492  		c := auxIntToInt64(v_1.AuxInt)
 13493  		v.reset(OpARM64ORconst)
 13494  		v.AuxInt = int64ToAuxInt(^int64(uint64(c) << uint64(d)))
 13495  		v.AddArg(x)
 13496  		return true
 13497  	}
 13498  	// match: (ORNshiftLL (SLLconst x [c]) x [c])
 13499  	// result: (MOVDconst [-1])
 13500  	for {
 13501  		c := auxIntToInt64(v.AuxInt)
 13502  		if v_0.Op != OpARM64SLLconst || auxIntToInt64(v_0.AuxInt) != c {
 13503  			break
 13504  		}
 13505  		x := v_0.Args[0]
 13506  		if x != v_1 {
 13507  			break
 13508  		}
 13509  		v.reset(OpARM64MOVDconst)
 13510  		v.AuxInt = int64ToAuxInt(-1)
 13511  		return true
 13512  	}
 13513  	return false
 13514  }
 13515  func rewriteValueARM64_OpARM64ORNshiftRA(v *Value) bool {
 13516  	v_1 := v.Args[1]
 13517  	v_0 := v.Args[0]
 13518  	// match: (ORNshiftRA x (MOVDconst [c]) [d])
 13519  	// result: (ORconst x [^(c>>uint64(d))])
 13520  	for {
 13521  		d := auxIntToInt64(v.AuxInt)
 13522  		x := v_0
 13523  		if v_1.Op != OpARM64MOVDconst {
 13524  			break
 13525  		}
 13526  		c := auxIntToInt64(v_1.AuxInt)
 13527  		v.reset(OpARM64ORconst)
 13528  		v.AuxInt = int64ToAuxInt(^(c >> uint64(d)))
 13529  		v.AddArg(x)
 13530  		return true
 13531  	}
 13532  	// match: (ORNshiftRA (SRAconst x [c]) x [c])
 13533  	// result: (MOVDconst [-1])
 13534  	for {
 13535  		c := auxIntToInt64(v.AuxInt)
 13536  		if v_0.Op != OpARM64SRAconst || auxIntToInt64(v_0.AuxInt) != c {
 13537  			break
 13538  		}
 13539  		x := v_0.Args[0]
 13540  		if x != v_1 {
 13541  			break
 13542  		}
 13543  		v.reset(OpARM64MOVDconst)
 13544  		v.AuxInt = int64ToAuxInt(-1)
 13545  		return true
 13546  	}
 13547  	return false
 13548  }
 13549  func rewriteValueARM64_OpARM64ORNshiftRL(v *Value) bool {
 13550  	v_1 := v.Args[1]
 13551  	v_0 := v.Args[0]
 13552  	// match: (ORNshiftRL x (MOVDconst [c]) [d])
 13553  	// result: (ORconst x [^int64(uint64(c)>>uint64(d))])
 13554  	for {
 13555  		d := auxIntToInt64(v.AuxInt)
 13556  		x := v_0
 13557  		if v_1.Op != OpARM64MOVDconst {
 13558  			break
 13559  		}
 13560  		c := auxIntToInt64(v_1.AuxInt)
 13561  		v.reset(OpARM64ORconst)
 13562  		v.AuxInt = int64ToAuxInt(^int64(uint64(c) >> uint64(d)))
 13563  		v.AddArg(x)
 13564  		return true
 13565  	}
 13566  	// match: (ORNshiftRL (SRLconst x [c]) x [c])
 13567  	// result: (MOVDconst [-1])
 13568  	for {
 13569  		c := auxIntToInt64(v.AuxInt)
 13570  		if v_0.Op != OpARM64SRLconst || auxIntToInt64(v_0.AuxInt) != c {
 13571  			break
 13572  		}
 13573  		x := v_0.Args[0]
 13574  		if x != v_1 {
 13575  			break
 13576  		}
 13577  		v.reset(OpARM64MOVDconst)
 13578  		v.AuxInt = int64ToAuxInt(-1)
 13579  		return true
 13580  	}
 13581  	return false
 13582  }
 13583  func rewriteValueARM64_OpARM64ORNshiftRO(v *Value) bool {
 13584  	v_1 := v.Args[1]
 13585  	v_0 := v.Args[0]
 13586  	// match: (ORNshiftRO x (MOVDconst [c]) [d])
 13587  	// result: (ORconst x [^rotateRight64(c, d)])
 13588  	for {
 13589  		d := auxIntToInt64(v.AuxInt)
 13590  		x := v_0
 13591  		if v_1.Op != OpARM64MOVDconst {
 13592  			break
 13593  		}
 13594  		c := auxIntToInt64(v_1.AuxInt)
 13595  		v.reset(OpARM64ORconst)
 13596  		v.AuxInt = int64ToAuxInt(^rotateRight64(c, d))
 13597  		v.AddArg(x)
 13598  		return true
 13599  	}
 13600  	// match: (ORNshiftRO (RORconst x [c]) x [c])
 13601  	// result: (MOVDconst [-1])
 13602  	for {
 13603  		c := auxIntToInt64(v.AuxInt)
 13604  		if v_0.Op != OpARM64RORconst || auxIntToInt64(v_0.AuxInt) != c {
 13605  			break
 13606  		}
 13607  		x := v_0.Args[0]
 13608  		if x != v_1 {
 13609  			break
 13610  		}
 13611  		v.reset(OpARM64MOVDconst)
 13612  		v.AuxInt = int64ToAuxInt(-1)
 13613  		return true
 13614  	}
 13615  	return false
 13616  }
 13617  func rewriteValueARM64_OpARM64ORconst(v *Value) bool {
 13618  	v_0 := v.Args[0]
 13619  	// match: (ORconst [0] x)
 13620  	// result: x
 13621  	for {
 13622  		if auxIntToInt64(v.AuxInt) != 0 {
 13623  			break
 13624  		}
 13625  		x := v_0
 13626  		v.copyOf(x)
 13627  		return true
 13628  	}
 13629  	// match: (ORconst [-1] _)
 13630  	// result: (MOVDconst [-1])
 13631  	for {
 13632  		if auxIntToInt64(v.AuxInt) != -1 {
 13633  			break
 13634  		}
 13635  		v.reset(OpARM64MOVDconst)
 13636  		v.AuxInt = int64ToAuxInt(-1)
 13637  		return true
 13638  	}
 13639  	// match: (ORconst [c] (MOVDconst [d]))
 13640  	// result: (MOVDconst [c|d])
 13641  	for {
 13642  		c := auxIntToInt64(v.AuxInt)
 13643  		if v_0.Op != OpARM64MOVDconst {
 13644  			break
 13645  		}
 13646  		d := auxIntToInt64(v_0.AuxInt)
 13647  		v.reset(OpARM64MOVDconst)
 13648  		v.AuxInt = int64ToAuxInt(c | d)
 13649  		return true
 13650  	}
 13651  	// match: (ORconst [c] (ORconst [d] x))
 13652  	// result: (ORconst [c|d] x)
 13653  	for {
 13654  		c := auxIntToInt64(v.AuxInt)
 13655  		if v_0.Op != OpARM64ORconst {
 13656  			break
 13657  		}
 13658  		d := auxIntToInt64(v_0.AuxInt)
 13659  		x := v_0.Args[0]
 13660  		v.reset(OpARM64ORconst)
 13661  		v.AuxInt = int64ToAuxInt(c | d)
 13662  		v.AddArg(x)
 13663  		return true
 13664  	}
 13665  	// match: (ORconst [c1] (ANDconst [c2] x))
 13666  	// cond: c2|c1 == ^0
 13667  	// result: (ORconst [c1] x)
 13668  	for {
 13669  		c1 := auxIntToInt64(v.AuxInt)
 13670  		if v_0.Op != OpARM64ANDconst {
 13671  			break
 13672  		}
 13673  		c2 := auxIntToInt64(v_0.AuxInt)
 13674  		x := v_0.Args[0]
 13675  		if !(c2|c1 == ^0) {
 13676  			break
 13677  		}
 13678  		v.reset(OpARM64ORconst)
 13679  		v.AuxInt = int64ToAuxInt(c1)
 13680  		v.AddArg(x)
 13681  		return true
 13682  	}
 13683  	return false
 13684  }
 13685  func rewriteValueARM64_OpARM64ORshiftLL(v *Value) bool {
 13686  	v_1 := v.Args[1]
 13687  	v_0 := v.Args[0]
 13688  	b := v.Block
 13689  	typ := &b.Func.Config.Types
 13690  	// match: (ORshiftLL (MOVDconst [c]) x [d])
 13691  	// result: (ORconst [c] (SLLconst <x.Type> x [d]))
 13692  	for {
 13693  		d := auxIntToInt64(v.AuxInt)
 13694  		if v_0.Op != OpARM64MOVDconst {
 13695  			break
 13696  		}
 13697  		c := auxIntToInt64(v_0.AuxInt)
 13698  		x := v_1
 13699  		v.reset(OpARM64ORconst)
 13700  		v.AuxInt = int64ToAuxInt(c)
 13701  		v0 := b.NewValue0(v.Pos, OpARM64SLLconst, x.Type)
 13702  		v0.AuxInt = int64ToAuxInt(d)
 13703  		v0.AddArg(x)
 13704  		v.AddArg(v0)
 13705  		return true
 13706  	}
 13707  	// match: (ORshiftLL x (MOVDconst [c]) [d])
 13708  	// result: (ORconst x [int64(uint64(c)<<uint64(d))])
 13709  	for {
 13710  		d := auxIntToInt64(v.AuxInt)
 13711  		x := v_0
 13712  		if v_1.Op != OpARM64MOVDconst {
 13713  			break
 13714  		}
 13715  		c := auxIntToInt64(v_1.AuxInt)
 13716  		v.reset(OpARM64ORconst)
 13717  		v.AuxInt = int64ToAuxInt(int64(uint64(c) << uint64(d)))
 13718  		v.AddArg(x)
 13719  		return true
 13720  	}
 13721  	// match: (ORshiftLL y:(SLLconst x [c]) x [c])
 13722  	// result: y
 13723  	for {
 13724  		c := auxIntToInt64(v.AuxInt)
 13725  		y := v_0
 13726  		if y.Op != OpARM64SLLconst || auxIntToInt64(y.AuxInt) != c {
 13727  			break
 13728  		}
 13729  		x := y.Args[0]
 13730  		if x != v_1 {
 13731  			break
 13732  		}
 13733  		v.copyOf(y)
 13734  		return true
 13735  	}
 13736  	// match: (ORshiftLL <typ.UInt16> [8] (UBFX <typ.UInt16> [armBFAuxInt(8, 8)] x) x)
 13737  	// result: (REV16W x)
 13738  	for {
 13739  		if v.Type != typ.UInt16 || auxIntToInt64(v.AuxInt) != 8 || v_0.Op != OpARM64UBFX || v_0.Type != typ.UInt16 || auxIntToArm64BitField(v_0.AuxInt) != armBFAuxInt(8, 8) {
 13740  			break
 13741  		}
 13742  		x := v_0.Args[0]
 13743  		if x != v_1 {
 13744  			break
 13745  		}
 13746  		v.reset(OpARM64REV16W)
 13747  		v.AddArg(x)
 13748  		return true
 13749  	}
 13750  	// match: (ORshiftLL [8] (UBFX [armBFAuxInt(8, 24)] (ANDconst [c1] x)) (ANDconst [c2] x))
 13751  	// cond: uint32(c1) == 0xff00ff00 && uint32(c2) == 0x00ff00ff
 13752  	// result: (REV16W x)
 13753  	for {
 13754  		if auxIntToInt64(v.AuxInt) != 8 || v_0.Op != OpARM64UBFX || auxIntToArm64BitField(v_0.AuxInt) != armBFAuxInt(8, 24) {
 13755  			break
 13756  		}
 13757  		v_0_0 := v_0.Args[0]
 13758  		if v_0_0.Op != OpARM64ANDconst {
 13759  			break
 13760  		}
 13761  		c1 := auxIntToInt64(v_0_0.AuxInt)
 13762  		x := v_0_0.Args[0]
 13763  		if v_1.Op != OpARM64ANDconst {
 13764  			break
 13765  		}
 13766  		c2 := auxIntToInt64(v_1.AuxInt)
 13767  		if x != v_1.Args[0] || !(uint32(c1) == 0xff00ff00 && uint32(c2) == 0x00ff00ff) {
 13768  			break
 13769  		}
 13770  		v.reset(OpARM64REV16W)
 13771  		v.AddArg(x)
 13772  		return true
 13773  	}
 13774  	// match: (ORshiftLL [8] (SRLconst [8] (ANDconst [c1] x)) (ANDconst [c2] x))
 13775  	// cond: (uint64(c1) == 0xff00ff00ff00ff00 && uint64(c2) == 0x00ff00ff00ff00ff)
 13776  	// result: (REV16 x)
 13777  	for {
 13778  		if auxIntToInt64(v.AuxInt) != 8 || v_0.Op != OpARM64SRLconst || auxIntToInt64(v_0.AuxInt) != 8 {
 13779  			break
 13780  		}
 13781  		v_0_0 := v_0.Args[0]
 13782  		if v_0_0.Op != OpARM64ANDconst {
 13783  			break
 13784  		}
 13785  		c1 := auxIntToInt64(v_0_0.AuxInt)
 13786  		x := v_0_0.Args[0]
 13787  		if v_1.Op != OpARM64ANDconst {
 13788  			break
 13789  		}
 13790  		c2 := auxIntToInt64(v_1.AuxInt)
 13791  		if x != v_1.Args[0] || !(uint64(c1) == 0xff00ff00ff00ff00 && uint64(c2) == 0x00ff00ff00ff00ff) {
 13792  			break
 13793  		}
 13794  		v.reset(OpARM64REV16)
 13795  		v.AddArg(x)
 13796  		return true
 13797  	}
 13798  	// match: (ORshiftLL [8] (SRLconst [8] (ANDconst [c1] x)) (ANDconst [c2] x))
 13799  	// cond: (uint64(c1) == 0xff00ff00 && uint64(c2) == 0x00ff00ff)
 13800  	// result: (REV16 (ANDconst <x.Type> [0xffffffff] x))
 13801  	for {
 13802  		if auxIntToInt64(v.AuxInt) != 8 || v_0.Op != OpARM64SRLconst || auxIntToInt64(v_0.AuxInt) != 8 {
 13803  			break
 13804  		}
 13805  		v_0_0 := v_0.Args[0]
 13806  		if v_0_0.Op != OpARM64ANDconst {
 13807  			break
 13808  		}
 13809  		c1 := auxIntToInt64(v_0_0.AuxInt)
 13810  		x := v_0_0.Args[0]
 13811  		if v_1.Op != OpARM64ANDconst {
 13812  			break
 13813  		}
 13814  		c2 := auxIntToInt64(v_1.AuxInt)
 13815  		if x != v_1.Args[0] || !(uint64(c1) == 0xff00ff00 && uint64(c2) == 0x00ff00ff) {
 13816  			break
 13817  		}
 13818  		v.reset(OpARM64REV16)
 13819  		v0 := b.NewValue0(v.Pos, OpARM64ANDconst, x.Type)
 13820  		v0.AuxInt = int64ToAuxInt(0xffffffff)
 13821  		v0.AddArg(x)
 13822  		v.AddArg(v0)
 13823  		return true
 13824  	}
 13825  	// match: ( ORshiftLL [c] (SRLconst x [64-c]) x2)
 13826  	// result: (EXTRconst [64-c] x2 x)
 13827  	for {
 13828  		c := auxIntToInt64(v.AuxInt)
 13829  		if v_0.Op != OpARM64SRLconst || auxIntToInt64(v_0.AuxInt) != 64-c {
 13830  			break
 13831  		}
 13832  		x := v_0.Args[0]
 13833  		x2 := v_1
 13834  		v.reset(OpARM64EXTRconst)
 13835  		v.AuxInt = int64ToAuxInt(64 - c)
 13836  		v.AddArg2(x2, x)
 13837  		return true
 13838  	}
 13839  	// match: ( ORshiftLL <t> [c] (UBFX [bfc] x) x2)
 13840  	// cond: c < 32 && t.Size() == 4 && bfc == armBFAuxInt(32-c, c)
 13841  	// result: (EXTRWconst [32-c] x2 x)
 13842  	for {
 13843  		t := v.Type
 13844  		c := auxIntToInt64(v.AuxInt)
 13845  		if v_0.Op != OpARM64UBFX {
 13846  			break
 13847  		}
 13848  		bfc := auxIntToArm64BitField(v_0.AuxInt)
 13849  		x := v_0.Args[0]
 13850  		x2 := v_1
 13851  		if !(c < 32 && t.Size() == 4 && bfc == armBFAuxInt(32-c, c)) {
 13852  			break
 13853  		}
 13854  		v.reset(OpARM64EXTRWconst)
 13855  		v.AuxInt = int64ToAuxInt(32 - c)
 13856  		v.AddArg2(x2, x)
 13857  		return true
 13858  	}
 13859  	// match: (ORshiftLL [s] (ANDconst [xc] x) (ANDconst [yc] y))
 13860  	// cond: xc == ^(yc << s) && yc & (yc+1) == 0 && yc > 0 && s+log64(yc+1) <= 64
 13861  	// result: (BFI [armBFAuxInt(s, log64(yc+1))] x y)
 13862  	for {
 13863  		s := auxIntToInt64(v.AuxInt)
 13864  		if v_0.Op != OpARM64ANDconst {
 13865  			break
 13866  		}
 13867  		xc := auxIntToInt64(v_0.AuxInt)
 13868  		x := v_0.Args[0]
 13869  		if v_1.Op != OpARM64ANDconst {
 13870  			break
 13871  		}
 13872  		yc := auxIntToInt64(v_1.AuxInt)
 13873  		y := v_1.Args[0]
 13874  		if !(xc == ^(yc<<s) && yc&(yc+1) == 0 && yc > 0 && s+log64(yc+1) <= 64) {
 13875  			break
 13876  		}
 13877  		v.reset(OpARM64BFI)
 13878  		v.AuxInt = arm64BitFieldToAuxInt(armBFAuxInt(s, log64(yc+1)))
 13879  		v.AddArg2(x, y)
 13880  		return true
 13881  	}
 13882  	// match: (ORshiftLL [sc] (UBFX [bfc] x) (SRLconst [sc] y))
 13883  	// cond: sc == bfc.width()
 13884  	// result: (BFXIL [bfc] y x)
 13885  	for {
 13886  		sc := auxIntToInt64(v.AuxInt)
 13887  		if v_0.Op != OpARM64UBFX {
 13888  			break
 13889  		}
 13890  		bfc := auxIntToArm64BitField(v_0.AuxInt)
 13891  		x := v_0.Args[0]
 13892  		if v_1.Op != OpARM64SRLconst || auxIntToInt64(v_1.AuxInt) != sc {
 13893  			break
 13894  		}
 13895  		y := v_1.Args[0]
 13896  		if !(sc == bfc.width()) {
 13897  			break
 13898  		}
 13899  		v.reset(OpARM64BFXIL)
 13900  		v.AuxInt = arm64BitFieldToAuxInt(bfc)
 13901  		v.AddArg2(y, x)
 13902  		return true
 13903  	}
 13904  	return false
 13905  }
 13906  func rewriteValueARM64_OpARM64ORshiftRA(v *Value) bool {
 13907  	v_1 := v.Args[1]
 13908  	v_0 := v.Args[0]
 13909  	b := v.Block
 13910  	// match: (ORshiftRA (MOVDconst [c]) x [d])
 13911  	// result: (ORconst [c] (SRAconst <x.Type> x [d]))
 13912  	for {
 13913  		d := auxIntToInt64(v.AuxInt)
 13914  		if v_0.Op != OpARM64MOVDconst {
 13915  			break
 13916  		}
 13917  		c := auxIntToInt64(v_0.AuxInt)
 13918  		x := v_1
 13919  		v.reset(OpARM64ORconst)
 13920  		v.AuxInt = int64ToAuxInt(c)
 13921  		v0 := b.NewValue0(v.Pos, OpARM64SRAconst, x.Type)
 13922  		v0.AuxInt = int64ToAuxInt(d)
 13923  		v0.AddArg(x)
 13924  		v.AddArg(v0)
 13925  		return true
 13926  	}
 13927  	// match: (ORshiftRA x (MOVDconst [c]) [d])
 13928  	// result: (ORconst x [c>>uint64(d)])
 13929  	for {
 13930  		d := auxIntToInt64(v.AuxInt)
 13931  		x := v_0
 13932  		if v_1.Op != OpARM64MOVDconst {
 13933  			break
 13934  		}
 13935  		c := auxIntToInt64(v_1.AuxInt)
 13936  		v.reset(OpARM64ORconst)
 13937  		v.AuxInt = int64ToAuxInt(c >> uint64(d))
 13938  		v.AddArg(x)
 13939  		return true
 13940  	}
 13941  	// match: (ORshiftRA y:(SRAconst x [c]) x [c])
 13942  	// result: y
 13943  	for {
 13944  		c := auxIntToInt64(v.AuxInt)
 13945  		y := v_0
 13946  		if y.Op != OpARM64SRAconst || auxIntToInt64(y.AuxInt) != c {
 13947  			break
 13948  		}
 13949  		x := y.Args[0]
 13950  		if x != v_1 {
 13951  			break
 13952  		}
 13953  		v.copyOf(y)
 13954  		return true
 13955  	}
 13956  	return false
 13957  }
 13958  func rewriteValueARM64_OpARM64ORshiftRL(v *Value) bool {
 13959  	v_1 := v.Args[1]
 13960  	v_0 := v.Args[0]
 13961  	b := v.Block
 13962  	// match: (ORshiftRL (MOVDconst [c]) x [d])
 13963  	// result: (ORconst [c] (SRLconst <x.Type> x [d]))
 13964  	for {
 13965  		d := auxIntToInt64(v.AuxInt)
 13966  		if v_0.Op != OpARM64MOVDconst {
 13967  			break
 13968  		}
 13969  		c := auxIntToInt64(v_0.AuxInt)
 13970  		x := v_1
 13971  		v.reset(OpARM64ORconst)
 13972  		v.AuxInt = int64ToAuxInt(c)
 13973  		v0 := b.NewValue0(v.Pos, OpARM64SRLconst, x.Type)
 13974  		v0.AuxInt = int64ToAuxInt(d)
 13975  		v0.AddArg(x)
 13976  		v.AddArg(v0)
 13977  		return true
 13978  	}
 13979  	// match: (ORshiftRL x (MOVDconst [c]) [d])
 13980  	// result: (ORconst x [int64(uint64(c)>>uint64(d))])
 13981  	for {
 13982  		d := auxIntToInt64(v.AuxInt)
 13983  		x := v_0
 13984  		if v_1.Op != OpARM64MOVDconst {
 13985  			break
 13986  		}
 13987  		c := auxIntToInt64(v_1.AuxInt)
 13988  		v.reset(OpARM64ORconst)
 13989  		v.AuxInt = int64ToAuxInt(int64(uint64(c) >> uint64(d)))
 13990  		v.AddArg(x)
 13991  		return true
 13992  	}
 13993  	// match: (ORshiftRL y:(SRLconst x [c]) x [c])
 13994  	// result: y
 13995  	for {
 13996  		c := auxIntToInt64(v.AuxInt)
 13997  		y := v_0
 13998  		if y.Op != OpARM64SRLconst || auxIntToInt64(y.AuxInt) != c {
 13999  			break
 14000  		}
 14001  		x := y.Args[0]
 14002  		if x != v_1 {
 14003  			break
 14004  		}
 14005  		v.copyOf(y)
 14006  		return true
 14007  	}
 14008  	// match: (ORshiftRL [rc] (ANDconst [ac] x) (SLLconst [lc] y))
 14009  	// cond: lc > rc && ac == ^((1<<uint(64-lc)-1) << uint64(lc-rc))
 14010  	// result: (BFI [armBFAuxInt(lc-rc, 64-lc)] x y)
 14011  	for {
 14012  		rc := auxIntToInt64(v.AuxInt)
 14013  		if v_0.Op != OpARM64ANDconst {
 14014  			break
 14015  		}
 14016  		ac := auxIntToInt64(v_0.AuxInt)
 14017  		x := v_0.Args[0]
 14018  		if v_1.Op != OpARM64SLLconst {
 14019  			break
 14020  		}
 14021  		lc := auxIntToInt64(v_1.AuxInt)
 14022  		y := v_1.Args[0]
 14023  		if !(lc > rc && ac == ^((1<<uint(64-lc)-1)<<uint64(lc-rc))) {
 14024  			break
 14025  		}
 14026  		v.reset(OpARM64BFI)
 14027  		v.AuxInt = arm64BitFieldToAuxInt(armBFAuxInt(lc-rc, 64-lc))
 14028  		v.AddArg2(x, y)
 14029  		return true
 14030  	}
 14031  	// match: (ORshiftRL [rc] (ANDconst [ac] y) (SLLconst [lc] x))
 14032  	// cond: lc < rc && ac == ^((1<<uint(64-rc)-1))
 14033  	// result: (BFXIL [armBFAuxInt(rc-lc, 64-rc)] y x)
 14034  	for {
 14035  		rc := auxIntToInt64(v.AuxInt)
 14036  		if v_0.Op != OpARM64ANDconst {
 14037  			break
 14038  		}
 14039  		ac := auxIntToInt64(v_0.AuxInt)
 14040  		y := v_0.Args[0]
 14041  		if v_1.Op != OpARM64SLLconst {
 14042  			break
 14043  		}
 14044  		lc := auxIntToInt64(v_1.AuxInt)
 14045  		x := v_1.Args[0]
 14046  		if !(lc < rc && ac == ^(1<<uint(64-rc)-1)) {
 14047  			break
 14048  		}
 14049  		v.reset(OpARM64BFXIL)
 14050  		v.AuxInt = arm64BitFieldToAuxInt(armBFAuxInt(rc-lc, 64-rc))
 14051  		v.AddArg2(y, x)
 14052  		return true
 14053  	}
 14054  	return false
 14055  }
 14056  func rewriteValueARM64_OpARM64ORshiftRO(v *Value) bool {
 14057  	v_1 := v.Args[1]
 14058  	v_0 := v.Args[0]
 14059  	b := v.Block
 14060  	// match: (ORshiftRO (MOVDconst [c]) x [d])
 14061  	// result: (ORconst [c] (RORconst <x.Type> x [d]))
 14062  	for {
 14063  		d := auxIntToInt64(v.AuxInt)
 14064  		if v_0.Op != OpARM64MOVDconst {
 14065  			break
 14066  		}
 14067  		c := auxIntToInt64(v_0.AuxInt)
 14068  		x := v_1
 14069  		v.reset(OpARM64ORconst)
 14070  		v.AuxInt = int64ToAuxInt(c)
 14071  		v0 := b.NewValue0(v.Pos, OpARM64RORconst, x.Type)
 14072  		v0.AuxInt = int64ToAuxInt(d)
 14073  		v0.AddArg(x)
 14074  		v.AddArg(v0)
 14075  		return true
 14076  	}
 14077  	// match: (ORshiftRO x (MOVDconst [c]) [d])
 14078  	// result: (ORconst x [rotateRight64(c, d)])
 14079  	for {
 14080  		d := auxIntToInt64(v.AuxInt)
 14081  		x := v_0
 14082  		if v_1.Op != OpARM64MOVDconst {
 14083  			break
 14084  		}
 14085  		c := auxIntToInt64(v_1.AuxInt)
 14086  		v.reset(OpARM64ORconst)
 14087  		v.AuxInt = int64ToAuxInt(rotateRight64(c, d))
 14088  		v.AddArg(x)
 14089  		return true
 14090  	}
 14091  	// match: (ORshiftRO y:(RORconst x [c]) x [c])
 14092  	// result: y
 14093  	for {
 14094  		c := auxIntToInt64(v.AuxInt)
 14095  		y := v_0
 14096  		if y.Op != OpARM64RORconst || auxIntToInt64(y.AuxInt) != c {
 14097  			break
 14098  		}
 14099  		x := y.Args[0]
 14100  		if x != v_1 {
 14101  			break
 14102  		}
 14103  		v.copyOf(y)
 14104  		return true
 14105  	}
 14106  	return false
 14107  }
 14108  func rewriteValueARM64_OpARM64REV(v *Value) bool {
 14109  	v_0 := v.Args[0]
 14110  	// match: (REV (REV p))
 14111  	// result: p
 14112  	for {
 14113  		if v_0.Op != OpARM64REV {
 14114  			break
 14115  		}
 14116  		p := v_0.Args[0]
 14117  		v.copyOf(p)
 14118  		return true
 14119  	}
 14120  	return false
 14121  }
 14122  func rewriteValueARM64_OpARM64REVW(v *Value) bool {
 14123  	v_0 := v.Args[0]
 14124  	// match: (REVW (REVW p))
 14125  	// result: p
 14126  	for {
 14127  		if v_0.Op != OpARM64REVW {
 14128  			break
 14129  		}
 14130  		p := v_0.Args[0]
 14131  		v.copyOf(p)
 14132  		return true
 14133  	}
 14134  	return false
 14135  }
 14136  func rewriteValueARM64_OpARM64ROR(v *Value) bool {
 14137  	v_1 := v.Args[1]
 14138  	v_0 := v.Args[0]
 14139  	// match: (ROR x (MOVDconst [c]))
 14140  	// result: (RORconst x [c&63])
 14141  	for {
 14142  		x := v_0
 14143  		if v_1.Op != OpARM64MOVDconst {
 14144  			break
 14145  		}
 14146  		c := auxIntToInt64(v_1.AuxInt)
 14147  		v.reset(OpARM64RORconst)
 14148  		v.AuxInt = int64ToAuxInt(c & 63)
 14149  		v.AddArg(x)
 14150  		return true
 14151  	}
 14152  	return false
 14153  }
 14154  func rewriteValueARM64_OpARM64RORW(v *Value) bool {
 14155  	v_1 := v.Args[1]
 14156  	v_0 := v.Args[0]
 14157  	// match: (RORW x (MOVDconst [c]))
 14158  	// result: (RORWconst x [c&31])
 14159  	for {
 14160  		x := v_0
 14161  		if v_1.Op != OpARM64MOVDconst {
 14162  			break
 14163  		}
 14164  		c := auxIntToInt64(v_1.AuxInt)
 14165  		v.reset(OpARM64RORWconst)
 14166  		v.AuxInt = int64ToAuxInt(c & 31)
 14167  		v.AddArg(x)
 14168  		return true
 14169  	}
 14170  	return false
 14171  }
 14172  func rewriteValueARM64_OpARM64SBCSflags(v *Value) bool {
 14173  	v_2 := v.Args[2]
 14174  	v_1 := v.Args[1]
 14175  	v_0 := v.Args[0]
 14176  	b := v.Block
 14177  	typ := &b.Func.Config.Types
 14178  	// match: (SBCSflags x y (Select1 <types.TypeFlags> (NEGSflags (NEG <typ.UInt64> (NGCzerocarry <typ.UInt64> bo)))))
 14179  	// result: (SBCSflags x y bo)
 14180  	for {
 14181  		x := v_0
 14182  		y := v_1
 14183  		if v_2.Op != OpSelect1 || v_2.Type != types.TypeFlags {
 14184  			break
 14185  		}
 14186  		v_2_0 := v_2.Args[0]
 14187  		if v_2_0.Op != OpARM64NEGSflags {
 14188  			break
 14189  		}
 14190  		v_2_0_0 := v_2_0.Args[0]
 14191  		if v_2_0_0.Op != OpARM64NEG || v_2_0_0.Type != typ.UInt64 {
 14192  			break
 14193  		}
 14194  		v_2_0_0_0 := v_2_0_0.Args[0]
 14195  		if v_2_0_0_0.Op != OpARM64NGCzerocarry || v_2_0_0_0.Type != typ.UInt64 {
 14196  			break
 14197  		}
 14198  		bo := v_2_0_0_0.Args[0]
 14199  		v.reset(OpARM64SBCSflags)
 14200  		v.AddArg3(x, y, bo)
 14201  		return true
 14202  	}
 14203  	// match: (SBCSflags x y (Select1 <types.TypeFlags> (NEGSflags (MOVDconst [0]))))
 14204  	// result: (SUBSflags x y)
 14205  	for {
 14206  		x := v_0
 14207  		y := v_1
 14208  		if v_2.Op != OpSelect1 || v_2.Type != types.TypeFlags {
 14209  			break
 14210  		}
 14211  		v_2_0 := v_2.Args[0]
 14212  		if v_2_0.Op != OpARM64NEGSflags {
 14213  			break
 14214  		}
 14215  		v_2_0_0 := v_2_0.Args[0]
 14216  		if v_2_0_0.Op != OpARM64MOVDconst || auxIntToInt64(v_2_0_0.AuxInt) != 0 {
 14217  			break
 14218  		}
 14219  		v.reset(OpARM64SUBSflags)
 14220  		v.AddArg2(x, y)
 14221  		return true
 14222  	}
 14223  	return false
 14224  }
 14225  func rewriteValueARM64_OpARM64SBFX(v *Value) bool {
 14226  	v_0 := v.Args[0]
 14227  	// match: (SBFX [bfc] s:(SLLconst [sc] x))
 14228  	// cond: s.Uses == 1 && sc <= bfc.lsb()
 14229  	// result: (SBFX [armBFAuxInt(bfc.lsb() - sc, bfc.width())] x)
 14230  	for {
 14231  		bfc := auxIntToArm64BitField(v.AuxInt)
 14232  		s := v_0
 14233  		if s.Op != OpARM64SLLconst {
 14234  			break
 14235  		}
 14236  		sc := auxIntToInt64(s.AuxInt)
 14237  		x := s.Args[0]
 14238  		if !(s.Uses == 1 && sc <= bfc.lsb()) {
 14239  			break
 14240  		}
 14241  		v.reset(OpARM64SBFX)
 14242  		v.AuxInt = arm64BitFieldToAuxInt(armBFAuxInt(bfc.lsb()-sc, bfc.width()))
 14243  		v.AddArg(x)
 14244  		return true
 14245  	}
 14246  	// match: (SBFX [bfc] s:(SLLconst [sc] x))
 14247  	// cond: s.Uses == 1 && sc > bfc.lsb()
 14248  	// result: (SBFIZ [armBFAuxInt(sc - bfc.lsb(), bfc.width() - (sc-bfc.lsb()))] x)
 14249  	for {
 14250  		bfc := auxIntToArm64BitField(v.AuxInt)
 14251  		s := v_0
 14252  		if s.Op != OpARM64SLLconst {
 14253  			break
 14254  		}
 14255  		sc := auxIntToInt64(s.AuxInt)
 14256  		x := s.Args[0]
 14257  		if !(s.Uses == 1 && sc > bfc.lsb()) {
 14258  			break
 14259  		}
 14260  		v.reset(OpARM64SBFIZ)
 14261  		v.AuxInt = arm64BitFieldToAuxInt(armBFAuxInt(sc-bfc.lsb(), bfc.width()-(sc-bfc.lsb())))
 14262  		v.AddArg(x)
 14263  		return true
 14264  	}
 14265  	return false
 14266  }
 14267  func rewriteValueARM64_OpARM64SLL(v *Value) bool {
 14268  	v_1 := v.Args[1]
 14269  	v_0 := v.Args[0]
 14270  	// match: (SLL x (MOVDconst [c]))
 14271  	// result: (SLLconst x [c&63])
 14272  	for {
 14273  		x := v_0
 14274  		if v_1.Op != OpARM64MOVDconst {
 14275  			break
 14276  		}
 14277  		c := auxIntToInt64(v_1.AuxInt)
 14278  		v.reset(OpARM64SLLconst)
 14279  		v.AuxInt = int64ToAuxInt(c & 63)
 14280  		v.AddArg(x)
 14281  		return true
 14282  	}
 14283  	// match: (SLL x (ANDconst [63] y))
 14284  	// result: (SLL x y)
 14285  	for {
 14286  		x := v_0
 14287  		if v_1.Op != OpARM64ANDconst || auxIntToInt64(v_1.AuxInt) != 63 {
 14288  			break
 14289  		}
 14290  		y := v_1.Args[0]
 14291  		v.reset(OpARM64SLL)
 14292  		v.AddArg2(x, y)
 14293  		return true
 14294  	}
 14295  	return false
 14296  }
 14297  func rewriteValueARM64_OpARM64SLLconst(v *Value) bool {
 14298  	v_0 := v.Args[0]
 14299  	// match: (SLLconst [c] (MOVDconst [d]))
 14300  	// result: (MOVDconst [d<<uint64(c)])
 14301  	for {
 14302  		c := auxIntToInt64(v.AuxInt)
 14303  		if v_0.Op != OpARM64MOVDconst {
 14304  			break
 14305  		}
 14306  		d := auxIntToInt64(v_0.AuxInt)
 14307  		v.reset(OpARM64MOVDconst)
 14308  		v.AuxInt = int64ToAuxInt(d << uint64(c))
 14309  		return true
 14310  	}
 14311  	// match: (SLLconst [c] (SRLconst [c] x))
 14312  	// cond: 0 < c && c < 64
 14313  	// result: (ANDconst [^(1<<uint(c)-1)] x)
 14314  	for {
 14315  		c := auxIntToInt64(v.AuxInt)
 14316  		if v_0.Op != OpARM64SRLconst || auxIntToInt64(v_0.AuxInt) != c {
 14317  			break
 14318  		}
 14319  		x := v_0.Args[0]
 14320  		if !(0 < c && c < 64) {
 14321  			break
 14322  		}
 14323  		v.reset(OpARM64ANDconst)
 14324  		v.AuxInt = int64ToAuxInt(^(1<<uint(c) - 1))
 14325  		v.AddArg(x)
 14326  		return true
 14327  	}
 14328  	// match: (SLLconst [lc] (MOVWreg x))
 14329  	// result: (SBFIZ [armBFAuxInt(lc, min(32, 64-lc))] x)
 14330  	for {
 14331  		lc := auxIntToInt64(v.AuxInt)
 14332  		if v_0.Op != OpARM64MOVWreg {
 14333  			break
 14334  		}
 14335  		x := v_0.Args[0]
 14336  		v.reset(OpARM64SBFIZ)
 14337  		v.AuxInt = arm64BitFieldToAuxInt(armBFAuxInt(lc, min(32, 64-lc)))
 14338  		v.AddArg(x)
 14339  		return true
 14340  	}
 14341  	// match: (SLLconst [lc] (MOVHreg x))
 14342  	// result: (SBFIZ [armBFAuxInt(lc, min(16, 64-lc))] x)
 14343  	for {
 14344  		lc := auxIntToInt64(v.AuxInt)
 14345  		if v_0.Op != OpARM64MOVHreg {
 14346  			break
 14347  		}
 14348  		x := v_0.Args[0]
 14349  		v.reset(OpARM64SBFIZ)
 14350  		v.AuxInt = arm64BitFieldToAuxInt(armBFAuxInt(lc, min(16, 64-lc)))
 14351  		v.AddArg(x)
 14352  		return true
 14353  	}
 14354  	// match: (SLLconst [lc] (MOVBreg x))
 14355  	// result: (SBFIZ [armBFAuxInt(lc, min(8, 64-lc))] x)
 14356  	for {
 14357  		lc := auxIntToInt64(v.AuxInt)
 14358  		if v_0.Op != OpARM64MOVBreg {
 14359  			break
 14360  		}
 14361  		x := v_0.Args[0]
 14362  		v.reset(OpARM64SBFIZ)
 14363  		v.AuxInt = arm64BitFieldToAuxInt(armBFAuxInt(lc, min(8, 64-lc)))
 14364  		v.AddArg(x)
 14365  		return true
 14366  	}
 14367  	// match: (SLLconst [lc] (MOVWUreg x))
 14368  	// result: (UBFIZ [armBFAuxInt(lc, min(32, 64-lc))] x)
 14369  	for {
 14370  		lc := auxIntToInt64(v.AuxInt)
 14371  		if v_0.Op != OpARM64MOVWUreg {
 14372  			break
 14373  		}
 14374  		x := v_0.Args[0]
 14375  		v.reset(OpARM64UBFIZ)
 14376  		v.AuxInt = arm64BitFieldToAuxInt(armBFAuxInt(lc, min(32, 64-lc)))
 14377  		v.AddArg(x)
 14378  		return true
 14379  	}
 14380  	// match: (SLLconst [lc] (MOVHUreg x))
 14381  	// result: (UBFIZ [armBFAuxInt(lc, min(16, 64-lc))] x)
 14382  	for {
 14383  		lc := auxIntToInt64(v.AuxInt)
 14384  		if v_0.Op != OpARM64MOVHUreg {
 14385  			break
 14386  		}
 14387  		x := v_0.Args[0]
 14388  		v.reset(OpARM64UBFIZ)
 14389  		v.AuxInt = arm64BitFieldToAuxInt(armBFAuxInt(lc, min(16, 64-lc)))
 14390  		v.AddArg(x)
 14391  		return true
 14392  	}
 14393  	// match: (SLLconst [lc] (MOVBUreg x))
 14394  	// result: (UBFIZ [armBFAuxInt(lc, min(8, 64-lc))] x)
 14395  	for {
 14396  		lc := auxIntToInt64(v.AuxInt)
 14397  		if v_0.Op != OpARM64MOVBUreg {
 14398  			break
 14399  		}
 14400  		x := v_0.Args[0]
 14401  		v.reset(OpARM64UBFIZ)
 14402  		v.AuxInt = arm64BitFieldToAuxInt(armBFAuxInt(lc, min(8, 64-lc)))
 14403  		v.AddArg(x)
 14404  		return true
 14405  	}
 14406  	// match: (SLLconst [sc] (ANDconst [ac] x))
 14407  	// cond: isARM64BFMask(sc, ac, 0)
 14408  	// result: (UBFIZ [armBFAuxInt(sc, arm64BFWidth(ac, 0))] x)
 14409  	for {
 14410  		sc := auxIntToInt64(v.AuxInt)
 14411  		if v_0.Op != OpARM64ANDconst {
 14412  			break
 14413  		}
 14414  		ac := auxIntToInt64(v_0.AuxInt)
 14415  		x := v_0.Args[0]
 14416  		if !(isARM64BFMask(sc, ac, 0)) {
 14417  			break
 14418  		}
 14419  		v.reset(OpARM64UBFIZ)
 14420  		v.AuxInt = arm64BitFieldToAuxInt(armBFAuxInt(sc, arm64BFWidth(ac, 0)))
 14421  		v.AddArg(x)
 14422  		return true
 14423  	}
 14424  	// match: (SLLconst [sc] (UBFIZ [bfc] x))
 14425  	// cond: sc+bfc.width()+bfc.lsb() < 64
 14426  	// result: (UBFIZ [armBFAuxInt(bfc.lsb()+sc, bfc.width())] x)
 14427  	for {
 14428  		sc := auxIntToInt64(v.AuxInt)
 14429  		if v_0.Op != OpARM64UBFIZ {
 14430  			break
 14431  		}
 14432  		bfc := auxIntToArm64BitField(v_0.AuxInt)
 14433  		x := v_0.Args[0]
 14434  		if !(sc+bfc.width()+bfc.lsb() < 64) {
 14435  			break
 14436  		}
 14437  		v.reset(OpARM64UBFIZ)
 14438  		v.AuxInt = arm64BitFieldToAuxInt(armBFAuxInt(bfc.lsb()+sc, bfc.width()))
 14439  		v.AddArg(x)
 14440  		return true
 14441  	}
 14442  	return false
 14443  }
 14444  func rewriteValueARM64_OpARM64SRA(v *Value) bool {
 14445  	v_1 := v.Args[1]
 14446  	v_0 := v.Args[0]
 14447  	// match: (SRA x (MOVDconst [c]))
 14448  	// result: (SRAconst x [c&63])
 14449  	for {
 14450  		x := v_0
 14451  		if v_1.Op != OpARM64MOVDconst {
 14452  			break
 14453  		}
 14454  		c := auxIntToInt64(v_1.AuxInt)
 14455  		v.reset(OpARM64SRAconst)
 14456  		v.AuxInt = int64ToAuxInt(c & 63)
 14457  		v.AddArg(x)
 14458  		return true
 14459  	}
 14460  	// match: (SRA x (ANDconst [63] y))
 14461  	// result: (SRA x y)
 14462  	for {
 14463  		x := v_0
 14464  		if v_1.Op != OpARM64ANDconst || auxIntToInt64(v_1.AuxInt) != 63 {
 14465  			break
 14466  		}
 14467  		y := v_1.Args[0]
 14468  		v.reset(OpARM64SRA)
 14469  		v.AddArg2(x, y)
 14470  		return true
 14471  	}
 14472  	return false
 14473  }
 14474  func rewriteValueARM64_OpARM64SRAconst(v *Value) bool {
 14475  	v_0 := v.Args[0]
 14476  	// match: (SRAconst [c] (MOVDconst [d]))
 14477  	// result: (MOVDconst [d>>uint64(c)])
 14478  	for {
 14479  		c := auxIntToInt64(v.AuxInt)
 14480  		if v_0.Op != OpARM64MOVDconst {
 14481  			break
 14482  		}
 14483  		d := auxIntToInt64(v_0.AuxInt)
 14484  		v.reset(OpARM64MOVDconst)
 14485  		v.AuxInt = int64ToAuxInt(d >> uint64(c))
 14486  		return true
 14487  	}
 14488  	// match: (SRAconst [rc] (SLLconst [lc] x))
 14489  	// cond: lc > rc
 14490  	// result: (SBFIZ [armBFAuxInt(lc-rc, 64-lc)] x)
 14491  	for {
 14492  		rc := auxIntToInt64(v.AuxInt)
 14493  		if v_0.Op != OpARM64SLLconst {
 14494  			break
 14495  		}
 14496  		lc := auxIntToInt64(v_0.AuxInt)
 14497  		x := v_0.Args[0]
 14498  		if !(lc > rc) {
 14499  			break
 14500  		}
 14501  		v.reset(OpARM64SBFIZ)
 14502  		v.AuxInt = arm64BitFieldToAuxInt(armBFAuxInt(lc-rc, 64-lc))
 14503  		v.AddArg(x)
 14504  		return true
 14505  	}
 14506  	// match: (SRAconst [rc] (SLLconst [lc] x))
 14507  	// cond: lc <= rc
 14508  	// result: (SBFX [armBFAuxInt(rc-lc, 64-rc)] x)
 14509  	for {
 14510  		rc := auxIntToInt64(v.AuxInt)
 14511  		if v_0.Op != OpARM64SLLconst {
 14512  			break
 14513  		}
 14514  		lc := auxIntToInt64(v_0.AuxInt)
 14515  		x := v_0.Args[0]
 14516  		if !(lc <= rc) {
 14517  			break
 14518  		}
 14519  		v.reset(OpARM64SBFX)
 14520  		v.AuxInt = arm64BitFieldToAuxInt(armBFAuxInt(rc-lc, 64-rc))
 14521  		v.AddArg(x)
 14522  		return true
 14523  	}
 14524  	// match: (SRAconst [rc] (MOVWreg x))
 14525  	// cond: rc < 32
 14526  	// result: (SBFX [armBFAuxInt(rc, 32-rc)] x)
 14527  	for {
 14528  		rc := auxIntToInt64(v.AuxInt)
 14529  		if v_0.Op != OpARM64MOVWreg {
 14530  			break
 14531  		}
 14532  		x := v_0.Args[0]
 14533  		if !(rc < 32) {
 14534  			break
 14535  		}
 14536  		v.reset(OpARM64SBFX)
 14537  		v.AuxInt = arm64BitFieldToAuxInt(armBFAuxInt(rc, 32-rc))
 14538  		v.AddArg(x)
 14539  		return true
 14540  	}
 14541  	// match: (SRAconst [rc] (MOVHreg x))
 14542  	// cond: rc < 16
 14543  	// result: (SBFX [armBFAuxInt(rc, 16-rc)] x)
 14544  	for {
 14545  		rc := auxIntToInt64(v.AuxInt)
 14546  		if v_0.Op != OpARM64MOVHreg {
 14547  			break
 14548  		}
 14549  		x := v_0.Args[0]
 14550  		if !(rc < 16) {
 14551  			break
 14552  		}
 14553  		v.reset(OpARM64SBFX)
 14554  		v.AuxInt = arm64BitFieldToAuxInt(armBFAuxInt(rc, 16-rc))
 14555  		v.AddArg(x)
 14556  		return true
 14557  	}
 14558  	// match: (SRAconst [rc] (MOVBreg x))
 14559  	// cond: rc < 8
 14560  	// result: (SBFX [armBFAuxInt(rc, 8-rc)] x)
 14561  	for {
 14562  		rc := auxIntToInt64(v.AuxInt)
 14563  		if v_0.Op != OpARM64MOVBreg {
 14564  			break
 14565  		}
 14566  		x := v_0.Args[0]
 14567  		if !(rc < 8) {
 14568  			break
 14569  		}
 14570  		v.reset(OpARM64SBFX)
 14571  		v.AuxInt = arm64BitFieldToAuxInt(armBFAuxInt(rc, 8-rc))
 14572  		v.AddArg(x)
 14573  		return true
 14574  	}
 14575  	// match: (SRAconst [sc] (SBFIZ [bfc] x))
 14576  	// cond: sc < bfc.lsb()
 14577  	// result: (SBFIZ [armBFAuxInt(bfc.lsb()-sc, bfc.width())] x)
 14578  	for {
 14579  		sc := auxIntToInt64(v.AuxInt)
 14580  		if v_0.Op != OpARM64SBFIZ {
 14581  			break
 14582  		}
 14583  		bfc := auxIntToArm64BitField(v_0.AuxInt)
 14584  		x := v_0.Args[0]
 14585  		if !(sc < bfc.lsb()) {
 14586  			break
 14587  		}
 14588  		v.reset(OpARM64SBFIZ)
 14589  		v.AuxInt = arm64BitFieldToAuxInt(armBFAuxInt(bfc.lsb()-sc, bfc.width()))
 14590  		v.AddArg(x)
 14591  		return true
 14592  	}
 14593  	// match: (SRAconst [sc] (SBFIZ [bfc] x))
 14594  	// cond: sc >= bfc.lsb() && sc < bfc.lsb()+bfc.width()
 14595  	// result: (SBFX [armBFAuxInt(sc-bfc.lsb(), bfc.lsb()+bfc.width()-sc)] x)
 14596  	for {
 14597  		sc := auxIntToInt64(v.AuxInt)
 14598  		if v_0.Op != OpARM64SBFIZ {
 14599  			break
 14600  		}
 14601  		bfc := auxIntToArm64BitField(v_0.AuxInt)
 14602  		x := v_0.Args[0]
 14603  		if !(sc >= bfc.lsb() && sc < bfc.lsb()+bfc.width()) {
 14604  			break
 14605  		}
 14606  		v.reset(OpARM64SBFX)
 14607  		v.AuxInt = arm64BitFieldToAuxInt(armBFAuxInt(sc-bfc.lsb(), bfc.lsb()+bfc.width()-sc))
 14608  		v.AddArg(x)
 14609  		return true
 14610  	}
 14611  	return false
 14612  }
 14613  func rewriteValueARM64_OpARM64SRL(v *Value) bool {
 14614  	v_1 := v.Args[1]
 14615  	v_0 := v.Args[0]
 14616  	// match: (SRL x (MOVDconst [c]))
 14617  	// result: (SRLconst x [c&63])
 14618  	for {
 14619  		x := v_0
 14620  		if v_1.Op != OpARM64MOVDconst {
 14621  			break
 14622  		}
 14623  		c := auxIntToInt64(v_1.AuxInt)
 14624  		v.reset(OpARM64SRLconst)
 14625  		v.AuxInt = int64ToAuxInt(c & 63)
 14626  		v.AddArg(x)
 14627  		return true
 14628  	}
 14629  	// match: (SRL x (ANDconst [63] y))
 14630  	// result: (SRL x y)
 14631  	for {
 14632  		x := v_0
 14633  		if v_1.Op != OpARM64ANDconst || auxIntToInt64(v_1.AuxInt) != 63 {
 14634  			break
 14635  		}
 14636  		y := v_1.Args[0]
 14637  		v.reset(OpARM64SRL)
 14638  		v.AddArg2(x, y)
 14639  		return true
 14640  	}
 14641  	return false
 14642  }
 14643  func rewriteValueARM64_OpARM64SRLconst(v *Value) bool {
 14644  	v_0 := v.Args[0]
 14645  	// match: (SRLconst [c] (MOVDconst [d]))
 14646  	// result: (MOVDconst [int64(uint64(d)>>uint64(c))])
 14647  	for {
 14648  		c := auxIntToInt64(v.AuxInt)
 14649  		if v_0.Op != OpARM64MOVDconst {
 14650  			break
 14651  		}
 14652  		d := auxIntToInt64(v_0.AuxInt)
 14653  		v.reset(OpARM64MOVDconst)
 14654  		v.AuxInt = int64ToAuxInt(int64(uint64(d) >> uint64(c)))
 14655  		return true
 14656  	}
 14657  	// match: (SRLconst [c] (SLLconst [c] x))
 14658  	// cond: 0 < c && c < 64
 14659  	// result: (ANDconst [1<<uint(64-c)-1] x)
 14660  	for {
 14661  		c := auxIntToInt64(v.AuxInt)
 14662  		if v_0.Op != OpARM64SLLconst || auxIntToInt64(v_0.AuxInt) != c {
 14663  			break
 14664  		}
 14665  		x := v_0.Args[0]
 14666  		if !(0 < c && c < 64) {
 14667  			break
 14668  		}
 14669  		v.reset(OpARM64ANDconst)
 14670  		v.AuxInt = int64ToAuxInt(1<<uint(64-c) - 1)
 14671  		v.AddArg(x)
 14672  		return true
 14673  	}
 14674  	// match: (SRLconst [rc] (MOVWUreg x))
 14675  	// cond: rc >= 32
 14676  	// result: (MOVDconst [0])
 14677  	for {
 14678  		rc := auxIntToInt64(v.AuxInt)
 14679  		if v_0.Op != OpARM64MOVWUreg {
 14680  			break
 14681  		}
 14682  		if !(rc >= 32) {
 14683  			break
 14684  		}
 14685  		v.reset(OpARM64MOVDconst)
 14686  		v.AuxInt = int64ToAuxInt(0)
 14687  		return true
 14688  	}
 14689  	// match: (SRLconst [rc] (MOVHUreg x))
 14690  	// cond: rc >= 16
 14691  	// result: (MOVDconst [0])
 14692  	for {
 14693  		rc := auxIntToInt64(v.AuxInt)
 14694  		if v_0.Op != OpARM64MOVHUreg {
 14695  			break
 14696  		}
 14697  		if !(rc >= 16) {
 14698  			break
 14699  		}
 14700  		v.reset(OpARM64MOVDconst)
 14701  		v.AuxInt = int64ToAuxInt(0)
 14702  		return true
 14703  	}
 14704  	// match: (SRLconst [rc] (MOVBUreg x))
 14705  	// cond: rc >= 8
 14706  	// result: (MOVDconst [0])
 14707  	for {
 14708  		rc := auxIntToInt64(v.AuxInt)
 14709  		if v_0.Op != OpARM64MOVBUreg {
 14710  			break
 14711  		}
 14712  		if !(rc >= 8) {
 14713  			break
 14714  		}
 14715  		v.reset(OpARM64MOVDconst)
 14716  		v.AuxInt = int64ToAuxInt(0)
 14717  		return true
 14718  	}
 14719  	// match: (SRLconst [rc] (SLLconst [lc] x))
 14720  	// cond: lc > rc
 14721  	// result: (UBFIZ [armBFAuxInt(lc-rc, 64-lc)] x)
 14722  	for {
 14723  		rc := auxIntToInt64(v.AuxInt)
 14724  		if v_0.Op != OpARM64SLLconst {
 14725  			break
 14726  		}
 14727  		lc := auxIntToInt64(v_0.AuxInt)
 14728  		x := v_0.Args[0]
 14729  		if !(lc > rc) {
 14730  			break
 14731  		}
 14732  		v.reset(OpARM64UBFIZ)
 14733  		v.AuxInt = arm64BitFieldToAuxInt(armBFAuxInt(lc-rc, 64-lc))
 14734  		v.AddArg(x)
 14735  		return true
 14736  	}
 14737  	// match: (SRLconst [rc] (SLLconst [lc] x))
 14738  	// cond: lc < rc
 14739  	// result: (UBFX [armBFAuxInt(rc-lc, 64-rc)] x)
 14740  	for {
 14741  		rc := auxIntToInt64(v.AuxInt)
 14742  		if v_0.Op != OpARM64SLLconst {
 14743  			break
 14744  		}
 14745  		lc := auxIntToInt64(v_0.AuxInt)
 14746  		x := v_0.Args[0]
 14747  		if !(lc < rc) {
 14748  			break
 14749  		}
 14750  		v.reset(OpARM64UBFX)
 14751  		v.AuxInt = arm64BitFieldToAuxInt(armBFAuxInt(rc-lc, 64-rc))
 14752  		v.AddArg(x)
 14753  		return true
 14754  	}
 14755  	// match: (SRLconst [rc] (MOVWUreg x))
 14756  	// cond: rc < 32
 14757  	// result: (UBFX [armBFAuxInt(rc, 32-rc)] x)
 14758  	for {
 14759  		rc := auxIntToInt64(v.AuxInt)
 14760  		if v_0.Op != OpARM64MOVWUreg {
 14761  			break
 14762  		}
 14763  		x := v_0.Args[0]
 14764  		if !(rc < 32) {
 14765  			break
 14766  		}
 14767  		v.reset(OpARM64UBFX)
 14768  		v.AuxInt = arm64BitFieldToAuxInt(armBFAuxInt(rc, 32-rc))
 14769  		v.AddArg(x)
 14770  		return true
 14771  	}
 14772  	// match: (SRLconst [rc] (MOVHUreg x))
 14773  	// cond: rc < 16
 14774  	// result: (UBFX [armBFAuxInt(rc, 16-rc)] x)
 14775  	for {
 14776  		rc := auxIntToInt64(v.AuxInt)
 14777  		if v_0.Op != OpARM64MOVHUreg {
 14778  			break
 14779  		}
 14780  		x := v_0.Args[0]
 14781  		if !(rc < 16) {
 14782  			break
 14783  		}
 14784  		v.reset(OpARM64UBFX)
 14785  		v.AuxInt = arm64BitFieldToAuxInt(armBFAuxInt(rc, 16-rc))
 14786  		v.AddArg(x)
 14787  		return true
 14788  	}
 14789  	// match: (SRLconst [rc] (MOVBUreg x))
 14790  	// cond: rc < 8
 14791  	// result: (UBFX [armBFAuxInt(rc, 8-rc)] x)
 14792  	for {
 14793  		rc := auxIntToInt64(v.AuxInt)
 14794  		if v_0.Op != OpARM64MOVBUreg {
 14795  			break
 14796  		}
 14797  		x := v_0.Args[0]
 14798  		if !(rc < 8) {
 14799  			break
 14800  		}
 14801  		v.reset(OpARM64UBFX)
 14802  		v.AuxInt = arm64BitFieldToAuxInt(armBFAuxInt(rc, 8-rc))
 14803  		v.AddArg(x)
 14804  		return true
 14805  	}
 14806  	// match: (SRLconst [sc] (ANDconst [ac] x))
 14807  	// cond: isARM64BFMask(sc, ac, sc)
 14808  	// result: (UBFX [armBFAuxInt(sc, arm64BFWidth(ac, sc))] x)
 14809  	for {
 14810  		sc := auxIntToInt64(v.AuxInt)
 14811  		if v_0.Op != OpARM64ANDconst {
 14812  			break
 14813  		}
 14814  		ac := auxIntToInt64(v_0.AuxInt)
 14815  		x := v_0.Args[0]
 14816  		if !(isARM64BFMask(sc, ac, sc)) {
 14817  			break
 14818  		}
 14819  		v.reset(OpARM64UBFX)
 14820  		v.AuxInt = arm64BitFieldToAuxInt(armBFAuxInt(sc, arm64BFWidth(ac, sc)))
 14821  		v.AddArg(x)
 14822  		return true
 14823  	}
 14824  	// match: (SRLconst [sc] (UBFX [bfc] x))
 14825  	// cond: sc < bfc.width()
 14826  	// result: (UBFX [armBFAuxInt(bfc.lsb()+sc, bfc.width()-sc)] x)
 14827  	for {
 14828  		sc := auxIntToInt64(v.AuxInt)
 14829  		if v_0.Op != OpARM64UBFX {
 14830  			break
 14831  		}
 14832  		bfc := auxIntToArm64BitField(v_0.AuxInt)
 14833  		x := v_0.Args[0]
 14834  		if !(sc < bfc.width()) {
 14835  			break
 14836  		}
 14837  		v.reset(OpARM64UBFX)
 14838  		v.AuxInt = arm64BitFieldToAuxInt(armBFAuxInt(bfc.lsb()+sc, bfc.width()-sc))
 14839  		v.AddArg(x)
 14840  		return true
 14841  	}
 14842  	// match: (SRLconst [sc] (UBFIZ [bfc] x))
 14843  	// cond: sc == bfc.lsb()
 14844  	// result: (ANDconst [1<<uint(bfc.width())-1] x)
 14845  	for {
 14846  		sc := auxIntToInt64(v.AuxInt)
 14847  		if v_0.Op != OpARM64UBFIZ {
 14848  			break
 14849  		}
 14850  		bfc := auxIntToArm64BitField(v_0.AuxInt)
 14851  		x := v_0.Args[0]
 14852  		if !(sc == bfc.lsb()) {
 14853  			break
 14854  		}
 14855  		v.reset(OpARM64ANDconst)
 14856  		v.AuxInt = int64ToAuxInt(1<<uint(bfc.width()) - 1)
 14857  		v.AddArg(x)
 14858  		return true
 14859  	}
 14860  	// match: (SRLconst [sc] (UBFIZ [bfc] x))
 14861  	// cond: sc < bfc.lsb()
 14862  	// result: (UBFIZ [armBFAuxInt(bfc.lsb()-sc, bfc.width())] x)
 14863  	for {
 14864  		sc := auxIntToInt64(v.AuxInt)
 14865  		if v_0.Op != OpARM64UBFIZ {
 14866  			break
 14867  		}
 14868  		bfc := auxIntToArm64BitField(v_0.AuxInt)
 14869  		x := v_0.Args[0]
 14870  		if !(sc < bfc.lsb()) {
 14871  			break
 14872  		}
 14873  		v.reset(OpARM64UBFIZ)
 14874  		v.AuxInt = arm64BitFieldToAuxInt(armBFAuxInt(bfc.lsb()-sc, bfc.width()))
 14875  		v.AddArg(x)
 14876  		return true
 14877  	}
 14878  	// match: (SRLconst [sc] (UBFIZ [bfc] x))
 14879  	// cond: sc > bfc.lsb() && sc < bfc.lsb()+bfc.width()
 14880  	// result: (UBFX [armBFAuxInt(sc-bfc.lsb(), bfc.lsb()+bfc.width()-sc)] x)
 14881  	for {
 14882  		sc := auxIntToInt64(v.AuxInt)
 14883  		if v_0.Op != OpARM64UBFIZ {
 14884  			break
 14885  		}
 14886  		bfc := auxIntToArm64BitField(v_0.AuxInt)
 14887  		x := v_0.Args[0]
 14888  		if !(sc > bfc.lsb() && sc < bfc.lsb()+bfc.width()) {
 14889  			break
 14890  		}
 14891  		v.reset(OpARM64UBFX)
 14892  		v.AuxInt = arm64BitFieldToAuxInt(armBFAuxInt(sc-bfc.lsb(), bfc.lsb()+bfc.width()-sc))
 14893  		v.AddArg(x)
 14894  		return true
 14895  	}
 14896  	return false
 14897  }
 14898  func rewriteValueARM64_OpARM64STP(v *Value) bool {
 14899  	v_3 := v.Args[3]
 14900  	v_2 := v.Args[2]
 14901  	v_1 := v.Args[1]
 14902  	v_0 := v.Args[0]
 14903  	b := v.Block
 14904  	config := b.Func.Config
 14905  	// match: (STP [off1] {sym} (ADDconst [off2] ptr) val1 val2 mem)
 14906  	// cond: is32Bit(int64(off1)+off2) && (ptr.Op != OpSB || !config.ctxt.Flag_dynlink)
 14907  	// result: (STP [off1+int32(off2)] {sym} ptr val1 val2 mem)
 14908  	for {
 14909  		off1 := auxIntToInt32(v.AuxInt)
 14910  		sym := auxToSym(v.Aux)
 14911  		if v_0.Op != OpARM64ADDconst {
 14912  			break
 14913  		}
 14914  		off2 := auxIntToInt64(v_0.AuxInt)
 14915  		ptr := v_0.Args[0]
 14916  		val1 := v_1
 14917  		val2 := v_2
 14918  		mem := v_3
 14919  		if !(is32Bit(int64(off1)+off2) && (ptr.Op != OpSB || !config.ctxt.Flag_dynlink)) {
 14920  			break
 14921  		}
 14922  		v.reset(OpARM64STP)
 14923  		v.AuxInt = int32ToAuxInt(off1 + int32(off2))
 14924  		v.Aux = symToAux(sym)
 14925  		v.AddArg4(ptr, val1, val2, mem)
 14926  		return true
 14927  	}
 14928  	// match: (STP [off1] {sym1} (MOVDaddr [off2] {sym2} ptr) val1 val2 mem)
 14929  	// cond: canMergeSym(sym1,sym2) && is32Bit(int64(off1)+int64(off2)) && (ptr.Op != OpSB || !config.ctxt.Flag_dynlink)
 14930  	// result: (STP [off1+off2] {mergeSym(sym1,sym2)} ptr val1 val2 mem)
 14931  	for {
 14932  		off1 := auxIntToInt32(v.AuxInt)
 14933  		sym1 := auxToSym(v.Aux)
 14934  		if v_0.Op != OpARM64MOVDaddr {
 14935  			break
 14936  		}
 14937  		off2 := auxIntToInt32(v_0.AuxInt)
 14938  		sym2 := auxToSym(v_0.Aux)
 14939  		ptr := v_0.Args[0]
 14940  		val1 := v_1
 14941  		val2 := v_2
 14942  		mem := v_3
 14943  		if !(canMergeSym(sym1, sym2) && is32Bit(int64(off1)+int64(off2)) && (ptr.Op != OpSB || !config.ctxt.Flag_dynlink)) {
 14944  			break
 14945  		}
 14946  		v.reset(OpARM64STP)
 14947  		v.AuxInt = int32ToAuxInt(off1 + off2)
 14948  		v.Aux = symToAux(mergeSym(sym1, sym2))
 14949  		v.AddArg4(ptr, val1, val2, mem)
 14950  		return true
 14951  	}
 14952  	return false
 14953  }
 14954  func rewriteValueARM64_OpARM64SUB(v *Value) bool {
 14955  	v_1 := v.Args[1]
 14956  	v_0 := v.Args[0]
 14957  	b := v.Block
 14958  	// match: (SUB x (MOVDconst [c]))
 14959  	// result: (SUBconst [c] x)
 14960  	for {
 14961  		x := v_0
 14962  		if v_1.Op != OpARM64MOVDconst {
 14963  			break
 14964  		}
 14965  		c := auxIntToInt64(v_1.AuxInt)
 14966  		v.reset(OpARM64SUBconst)
 14967  		v.AuxInt = int64ToAuxInt(c)
 14968  		v.AddArg(x)
 14969  		return true
 14970  	}
 14971  	// match: (SUB a l:(MUL x y))
 14972  	// cond: l.Uses==1 && clobber(l)
 14973  	// result: (MSUB a x y)
 14974  	for {
 14975  		a := v_0
 14976  		l := v_1
 14977  		if l.Op != OpARM64MUL {
 14978  			break
 14979  		}
 14980  		y := l.Args[1]
 14981  		x := l.Args[0]
 14982  		if !(l.Uses == 1 && clobber(l)) {
 14983  			break
 14984  		}
 14985  		v.reset(OpARM64MSUB)
 14986  		v.AddArg3(a, x, y)
 14987  		return true
 14988  	}
 14989  	// match: (SUB a l:(MNEG x y))
 14990  	// cond: l.Uses==1 && clobber(l)
 14991  	// result: (MADD a x y)
 14992  	for {
 14993  		a := v_0
 14994  		l := v_1
 14995  		if l.Op != OpARM64MNEG {
 14996  			break
 14997  		}
 14998  		y := l.Args[1]
 14999  		x := l.Args[0]
 15000  		if !(l.Uses == 1 && clobber(l)) {
 15001  			break
 15002  		}
 15003  		v.reset(OpARM64MADD)
 15004  		v.AddArg3(a, x, y)
 15005  		return true
 15006  	}
 15007  	// match: (SUB a l:(MULW x y))
 15008  	// cond: v.Type.Size() <= 4 && l.Uses==1 && clobber(l)
 15009  	// result: (MSUBW a x y)
 15010  	for {
 15011  		a := v_0
 15012  		l := v_1
 15013  		if l.Op != OpARM64MULW {
 15014  			break
 15015  		}
 15016  		y := l.Args[1]
 15017  		x := l.Args[0]
 15018  		if !(v.Type.Size() <= 4 && l.Uses == 1 && clobber(l)) {
 15019  			break
 15020  		}
 15021  		v.reset(OpARM64MSUBW)
 15022  		v.AddArg3(a, x, y)
 15023  		return true
 15024  	}
 15025  	// match: (SUB a l:(MNEGW x y))
 15026  	// cond: v.Type.Size() <= 4 && l.Uses==1 && clobber(l)
 15027  	// result: (MADDW a x y)
 15028  	for {
 15029  		a := v_0
 15030  		l := v_1
 15031  		if l.Op != OpARM64MNEGW {
 15032  			break
 15033  		}
 15034  		y := l.Args[1]
 15035  		x := l.Args[0]
 15036  		if !(v.Type.Size() <= 4 && l.Uses == 1 && clobber(l)) {
 15037  			break
 15038  		}
 15039  		v.reset(OpARM64MADDW)
 15040  		v.AddArg3(a, x, y)
 15041  		return true
 15042  	}
 15043  	// match: (SUB <t> a p:(ADDconst [c] m:(MUL _ _)))
 15044  	// cond: p.Uses==1 && m.Uses==1 && !t.IsPtrShaped()
 15045  	// result: (SUBconst [c] (SUB <v.Type> a m))
 15046  	for {
 15047  		t := v.Type
 15048  		a := v_0
 15049  		p := v_1
 15050  		if p.Op != OpARM64ADDconst {
 15051  			break
 15052  		}
 15053  		c := auxIntToInt64(p.AuxInt)
 15054  		m := p.Args[0]
 15055  		if m.Op != OpARM64MUL || !(p.Uses == 1 && m.Uses == 1 && !t.IsPtrShaped()) {
 15056  			break
 15057  		}
 15058  		v.reset(OpARM64SUBconst)
 15059  		v.AuxInt = int64ToAuxInt(c)
 15060  		v0 := b.NewValue0(v.Pos, OpARM64SUB, v.Type)
 15061  		v0.AddArg2(a, m)
 15062  		v.AddArg(v0)
 15063  		return true
 15064  	}
 15065  	// match: (SUB <t> a p:(ADDconst [c] m:(MULW _ _)))
 15066  	// cond: p.Uses==1 && m.Uses==1 && !t.IsPtrShaped()
 15067  	// result: (SUBconst [c] (SUB <v.Type> a m))
 15068  	for {
 15069  		t := v.Type
 15070  		a := v_0
 15071  		p := v_1
 15072  		if p.Op != OpARM64ADDconst {
 15073  			break
 15074  		}
 15075  		c := auxIntToInt64(p.AuxInt)
 15076  		m := p.Args[0]
 15077  		if m.Op != OpARM64MULW || !(p.Uses == 1 && m.Uses == 1 && !t.IsPtrShaped()) {
 15078  			break
 15079  		}
 15080  		v.reset(OpARM64SUBconst)
 15081  		v.AuxInt = int64ToAuxInt(c)
 15082  		v0 := b.NewValue0(v.Pos, OpARM64SUB, v.Type)
 15083  		v0.AddArg2(a, m)
 15084  		v.AddArg(v0)
 15085  		return true
 15086  	}
 15087  	// match: (SUB <t> a p:(ADDconst [c] m:(MNEG _ _)))
 15088  	// cond: p.Uses==1 && m.Uses==1 && !t.IsPtrShaped()
 15089  	// result: (SUBconst [c] (SUB <v.Type> a m))
 15090  	for {
 15091  		t := v.Type
 15092  		a := v_0
 15093  		p := v_1
 15094  		if p.Op != OpARM64ADDconst {
 15095  			break
 15096  		}
 15097  		c := auxIntToInt64(p.AuxInt)
 15098  		m := p.Args[0]
 15099  		if m.Op != OpARM64MNEG || !(p.Uses == 1 && m.Uses == 1 && !t.IsPtrShaped()) {
 15100  			break
 15101  		}
 15102  		v.reset(OpARM64SUBconst)
 15103  		v.AuxInt = int64ToAuxInt(c)
 15104  		v0 := b.NewValue0(v.Pos, OpARM64SUB, v.Type)
 15105  		v0.AddArg2(a, m)
 15106  		v.AddArg(v0)
 15107  		return true
 15108  	}
 15109  	// match: (SUB <t> a p:(ADDconst [c] m:(MNEGW _ _)))
 15110  	// cond: p.Uses==1 && m.Uses==1 && !t.IsPtrShaped()
 15111  	// result: (SUBconst [c] (SUB <v.Type> a m))
 15112  	for {
 15113  		t := v.Type
 15114  		a := v_0
 15115  		p := v_1
 15116  		if p.Op != OpARM64ADDconst {
 15117  			break
 15118  		}
 15119  		c := auxIntToInt64(p.AuxInt)
 15120  		m := p.Args[0]
 15121  		if m.Op != OpARM64MNEGW || !(p.Uses == 1 && m.Uses == 1 && !t.IsPtrShaped()) {
 15122  			break
 15123  		}
 15124  		v.reset(OpARM64SUBconst)
 15125  		v.AuxInt = int64ToAuxInt(c)
 15126  		v0 := b.NewValue0(v.Pos, OpARM64SUB, v.Type)
 15127  		v0.AddArg2(a, m)
 15128  		v.AddArg(v0)
 15129  		return true
 15130  	}
 15131  	// match: (SUB <t> a p:(SUBconst [c] m:(MUL _ _)))
 15132  	// cond: p.Uses==1 && m.Uses==1 && !t.IsPtrShaped()
 15133  	// result: (ADDconst [c] (SUB <v.Type> a m))
 15134  	for {
 15135  		t := v.Type
 15136  		a := v_0
 15137  		p := v_1
 15138  		if p.Op != OpARM64SUBconst {
 15139  			break
 15140  		}
 15141  		c := auxIntToInt64(p.AuxInt)
 15142  		m := p.Args[0]
 15143  		if m.Op != OpARM64MUL || !(p.Uses == 1 && m.Uses == 1 && !t.IsPtrShaped()) {
 15144  			break
 15145  		}
 15146  		v.reset(OpARM64ADDconst)
 15147  		v.AuxInt = int64ToAuxInt(c)
 15148  		v0 := b.NewValue0(v.Pos, OpARM64SUB, v.Type)
 15149  		v0.AddArg2(a, m)
 15150  		v.AddArg(v0)
 15151  		return true
 15152  	}
 15153  	// match: (SUB <t> a p:(SUBconst [c] m:(MULW _ _)))
 15154  	// cond: p.Uses==1 && m.Uses==1 && !t.IsPtrShaped()
 15155  	// result: (ADDconst [c] (SUB <v.Type> a m))
 15156  	for {
 15157  		t := v.Type
 15158  		a := v_0
 15159  		p := v_1
 15160  		if p.Op != OpARM64SUBconst {
 15161  			break
 15162  		}
 15163  		c := auxIntToInt64(p.AuxInt)
 15164  		m := p.Args[0]
 15165  		if m.Op != OpARM64MULW || !(p.Uses == 1 && m.Uses == 1 && !t.IsPtrShaped()) {
 15166  			break
 15167  		}
 15168  		v.reset(OpARM64ADDconst)
 15169  		v.AuxInt = int64ToAuxInt(c)
 15170  		v0 := b.NewValue0(v.Pos, OpARM64SUB, v.Type)
 15171  		v0.AddArg2(a, m)
 15172  		v.AddArg(v0)
 15173  		return true
 15174  	}
 15175  	// match: (SUB <t> a p:(SUBconst [c] m:(MNEG _ _)))
 15176  	// cond: p.Uses==1 && m.Uses==1 && !t.IsPtrShaped()
 15177  	// result: (ADDconst [c] (SUB <v.Type> a m))
 15178  	for {
 15179  		t := v.Type
 15180  		a := v_0
 15181  		p := v_1
 15182  		if p.Op != OpARM64SUBconst {
 15183  			break
 15184  		}
 15185  		c := auxIntToInt64(p.AuxInt)
 15186  		m := p.Args[0]
 15187  		if m.Op != OpARM64MNEG || !(p.Uses == 1 && m.Uses == 1 && !t.IsPtrShaped()) {
 15188  			break
 15189  		}
 15190  		v.reset(OpARM64ADDconst)
 15191  		v.AuxInt = int64ToAuxInt(c)
 15192  		v0 := b.NewValue0(v.Pos, OpARM64SUB, v.Type)
 15193  		v0.AddArg2(a, m)
 15194  		v.AddArg(v0)
 15195  		return true
 15196  	}
 15197  	// match: (SUB <t> a p:(SUBconst [c] m:(MNEGW _ _)))
 15198  	// cond: p.Uses==1 && m.Uses==1 && !t.IsPtrShaped()
 15199  	// result: (ADDconst [c] (SUB <v.Type> a m))
 15200  	for {
 15201  		t := v.Type
 15202  		a := v_0
 15203  		p := v_1
 15204  		if p.Op != OpARM64SUBconst {
 15205  			break
 15206  		}
 15207  		c := auxIntToInt64(p.AuxInt)
 15208  		m := p.Args[0]
 15209  		if m.Op != OpARM64MNEGW || !(p.Uses == 1 && m.Uses == 1 && !t.IsPtrShaped()) {
 15210  			break
 15211  		}
 15212  		v.reset(OpARM64ADDconst)
 15213  		v.AuxInt = int64ToAuxInt(c)
 15214  		v0 := b.NewValue0(v.Pos, OpARM64SUB, v.Type)
 15215  		v0.AddArg2(a, m)
 15216  		v.AddArg(v0)
 15217  		return true
 15218  	}
 15219  	// match: (SUB x (NEG y))
 15220  	// result: (ADD x y)
 15221  	for {
 15222  		x := v_0
 15223  		if v_1.Op != OpARM64NEG {
 15224  			break
 15225  		}
 15226  		y := v_1.Args[0]
 15227  		v.reset(OpARM64ADD)
 15228  		v.AddArg2(x, y)
 15229  		return true
 15230  	}
 15231  	// match: (SUB x x)
 15232  	// result: (MOVDconst [0])
 15233  	for {
 15234  		x := v_0
 15235  		if x != v_1 {
 15236  			break
 15237  		}
 15238  		v.reset(OpARM64MOVDconst)
 15239  		v.AuxInt = int64ToAuxInt(0)
 15240  		return true
 15241  	}
 15242  	// match: (SUB x (SUB y z))
 15243  	// result: (SUB (ADD <v.Type> x z) y)
 15244  	for {
 15245  		x := v_0
 15246  		if v_1.Op != OpARM64SUB {
 15247  			break
 15248  		}
 15249  		z := v_1.Args[1]
 15250  		y := v_1.Args[0]
 15251  		v.reset(OpARM64SUB)
 15252  		v0 := b.NewValue0(v.Pos, OpARM64ADD, v.Type)
 15253  		v0.AddArg2(x, z)
 15254  		v.AddArg2(v0, y)
 15255  		return true
 15256  	}
 15257  	// match: (SUB (SUB x y) z)
 15258  	// result: (SUB x (ADD <y.Type> y z))
 15259  	for {
 15260  		if v_0.Op != OpARM64SUB {
 15261  			break
 15262  		}
 15263  		y := v_0.Args[1]
 15264  		x := v_0.Args[0]
 15265  		z := v_1
 15266  		v.reset(OpARM64SUB)
 15267  		v0 := b.NewValue0(v.Pos, OpARM64ADD, y.Type)
 15268  		v0.AddArg2(y, z)
 15269  		v.AddArg2(x, v0)
 15270  		return true
 15271  	}
 15272  	// match: (SUB x0 x1:(SLLconst [c] y))
 15273  	// cond: clobberIfDead(x1)
 15274  	// result: (SUBshiftLL x0 y [c])
 15275  	for {
 15276  		x0 := v_0
 15277  		x1 := v_1
 15278  		if x1.Op != OpARM64SLLconst {
 15279  			break
 15280  		}
 15281  		c := auxIntToInt64(x1.AuxInt)
 15282  		y := x1.Args[0]
 15283  		if !(clobberIfDead(x1)) {
 15284  			break
 15285  		}
 15286  		v.reset(OpARM64SUBshiftLL)
 15287  		v.AuxInt = int64ToAuxInt(c)
 15288  		v.AddArg2(x0, y)
 15289  		return true
 15290  	}
 15291  	// match: (SUB x0 x1:(SRLconst [c] y))
 15292  	// cond: clobberIfDead(x1)
 15293  	// result: (SUBshiftRL x0 y [c])
 15294  	for {
 15295  		x0 := v_0
 15296  		x1 := v_1
 15297  		if x1.Op != OpARM64SRLconst {
 15298  			break
 15299  		}
 15300  		c := auxIntToInt64(x1.AuxInt)
 15301  		y := x1.Args[0]
 15302  		if !(clobberIfDead(x1)) {
 15303  			break
 15304  		}
 15305  		v.reset(OpARM64SUBshiftRL)
 15306  		v.AuxInt = int64ToAuxInt(c)
 15307  		v.AddArg2(x0, y)
 15308  		return true
 15309  	}
 15310  	// match: (SUB x0 x1:(SRAconst [c] y))
 15311  	// cond: clobberIfDead(x1)
 15312  	// result: (SUBshiftRA x0 y [c])
 15313  	for {
 15314  		x0 := v_0
 15315  		x1 := v_1
 15316  		if x1.Op != OpARM64SRAconst {
 15317  			break
 15318  		}
 15319  		c := auxIntToInt64(x1.AuxInt)
 15320  		y := x1.Args[0]
 15321  		if !(clobberIfDead(x1)) {
 15322  			break
 15323  		}
 15324  		v.reset(OpARM64SUBshiftRA)
 15325  		v.AuxInt = int64ToAuxInt(c)
 15326  		v.AddArg2(x0, y)
 15327  		return true
 15328  	}
 15329  	return false
 15330  }
 15331  func rewriteValueARM64_OpARM64SUBconst(v *Value) bool {
 15332  	v_0 := v.Args[0]
 15333  	// match: (SUBconst [0] x)
 15334  	// result: x
 15335  	for {
 15336  		if auxIntToInt64(v.AuxInt) != 0 {
 15337  			break
 15338  		}
 15339  		x := v_0
 15340  		v.copyOf(x)
 15341  		return true
 15342  	}
 15343  	// match: (SUBconst [c] (MOVDconst [d]))
 15344  	// result: (MOVDconst [d-c])
 15345  	for {
 15346  		c := auxIntToInt64(v.AuxInt)
 15347  		if v_0.Op != OpARM64MOVDconst {
 15348  			break
 15349  		}
 15350  		d := auxIntToInt64(v_0.AuxInt)
 15351  		v.reset(OpARM64MOVDconst)
 15352  		v.AuxInt = int64ToAuxInt(d - c)
 15353  		return true
 15354  	}
 15355  	// match: (SUBconst [c] (SUBconst [d] x))
 15356  	// result: (ADDconst [-c-d] x)
 15357  	for {
 15358  		c := auxIntToInt64(v.AuxInt)
 15359  		if v_0.Op != OpARM64SUBconst {
 15360  			break
 15361  		}
 15362  		d := auxIntToInt64(v_0.AuxInt)
 15363  		x := v_0.Args[0]
 15364  		v.reset(OpARM64ADDconst)
 15365  		v.AuxInt = int64ToAuxInt(-c - d)
 15366  		v.AddArg(x)
 15367  		return true
 15368  	}
 15369  	// match: (SUBconst [c] (ADDconst [d] x))
 15370  	// result: (ADDconst [-c+d] x)
 15371  	for {
 15372  		c := auxIntToInt64(v.AuxInt)
 15373  		if v_0.Op != OpARM64ADDconst {
 15374  			break
 15375  		}
 15376  		d := auxIntToInt64(v_0.AuxInt)
 15377  		x := v_0.Args[0]
 15378  		v.reset(OpARM64ADDconst)
 15379  		v.AuxInt = int64ToAuxInt(-c + d)
 15380  		v.AddArg(x)
 15381  		return true
 15382  	}
 15383  	return false
 15384  }
 15385  func rewriteValueARM64_OpARM64SUBshiftLL(v *Value) bool {
 15386  	v_1 := v.Args[1]
 15387  	v_0 := v.Args[0]
 15388  	// match: (SUBshiftLL x (MOVDconst [c]) [d])
 15389  	// result: (SUBconst x [int64(uint64(c)<<uint64(d))])
 15390  	for {
 15391  		d := auxIntToInt64(v.AuxInt)
 15392  		x := v_0
 15393  		if v_1.Op != OpARM64MOVDconst {
 15394  			break
 15395  		}
 15396  		c := auxIntToInt64(v_1.AuxInt)
 15397  		v.reset(OpARM64SUBconst)
 15398  		v.AuxInt = int64ToAuxInt(int64(uint64(c) << uint64(d)))
 15399  		v.AddArg(x)
 15400  		return true
 15401  	}
 15402  	// match: (SUBshiftLL (SLLconst x [c]) x [c])
 15403  	// result: (MOVDconst [0])
 15404  	for {
 15405  		c := auxIntToInt64(v.AuxInt)
 15406  		if v_0.Op != OpARM64SLLconst || auxIntToInt64(v_0.AuxInt) != c {
 15407  			break
 15408  		}
 15409  		x := v_0.Args[0]
 15410  		if x != v_1 {
 15411  			break
 15412  		}
 15413  		v.reset(OpARM64MOVDconst)
 15414  		v.AuxInt = int64ToAuxInt(0)
 15415  		return true
 15416  	}
 15417  	return false
 15418  }
 15419  func rewriteValueARM64_OpARM64SUBshiftRA(v *Value) bool {
 15420  	v_1 := v.Args[1]
 15421  	v_0 := v.Args[0]
 15422  	// match: (SUBshiftRA x (MOVDconst [c]) [d])
 15423  	// result: (SUBconst x [c>>uint64(d)])
 15424  	for {
 15425  		d := auxIntToInt64(v.AuxInt)
 15426  		x := v_0
 15427  		if v_1.Op != OpARM64MOVDconst {
 15428  			break
 15429  		}
 15430  		c := auxIntToInt64(v_1.AuxInt)
 15431  		v.reset(OpARM64SUBconst)
 15432  		v.AuxInt = int64ToAuxInt(c >> uint64(d))
 15433  		v.AddArg(x)
 15434  		return true
 15435  	}
 15436  	// match: (SUBshiftRA (SRAconst x [c]) x [c])
 15437  	// result: (MOVDconst [0])
 15438  	for {
 15439  		c := auxIntToInt64(v.AuxInt)
 15440  		if v_0.Op != OpARM64SRAconst || auxIntToInt64(v_0.AuxInt) != c {
 15441  			break
 15442  		}
 15443  		x := v_0.Args[0]
 15444  		if x != v_1 {
 15445  			break
 15446  		}
 15447  		v.reset(OpARM64MOVDconst)
 15448  		v.AuxInt = int64ToAuxInt(0)
 15449  		return true
 15450  	}
 15451  	return false
 15452  }
 15453  func rewriteValueARM64_OpARM64SUBshiftRL(v *Value) bool {
 15454  	v_1 := v.Args[1]
 15455  	v_0 := v.Args[0]
 15456  	// match: (SUBshiftRL x (MOVDconst [c]) [d])
 15457  	// result: (SUBconst x [int64(uint64(c)>>uint64(d))])
 15458  	for {
 15459  		d := auxIntToInt64(v.AuxInt)
 15460  		x := v_0
 15461  		if v_1.Op != OpARM64MOVDconst {
 15462  			break
 15463  		}
 15464  		c := auxIntToInt64(v_1.AuxInt)
 15465  		v.reset(OpARM64SUBconst)
 15466  		v.AuxInt = int64ToAuxInt(int64(uint64(c) >> uint64(d)))
 15467  		v.AddArg(x)
 15468  		return true
 15469  	}
 15470  	// match: (SUBshiftRL (SRLconst x [c]) x [c])
 15471  	// result: (MOVDconst [0])
 15472  	for {
 15473  		c := auxIntToInt64(v.AuxInt)
 15474  		if v_0.Op != OpARM64SRLconst || auxIntToInt64(v_0.AuxInt) != c {
 15475  			break
 15476  		}
 15477  		x := v_0.Args[0]
 15478  		if x != v_1 {
 15479  			break
 15480  		}
 15481  		v.reset(OpARM64MOVDconst)
 15482  		v.AuxInt = int64ToAuxInt(0)
 15483  		return true
 15484  	}
 15485  	return false
 15486  }
 15487  func rewriteValueARM64_OpARM64TST(v *Value) bool {
 15488  	v_1 := v.Args[1]
 15489  	v_0 := v.Args[0]
 15490  	// match: (TST x (MOVDconst [c]))
 15491  	// result: (TSTconst [c] x)
 15492  	for {
 15493  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
 15494  			x := v_0
 15495  			if v_1.Op != OpARM64MOVDconst {
 15496  				continue
 15497  			}
 15498  			c := auxIntToInt64(v_1.AuxInt)
 15499  			v.reset(OpARM64TSTconst)
 15500  			v.AuxInt = int64ToAuxInt(c)
 15501  			v.AddArg(x)
 15502  			return true
 15503  		}
 15504  		break
 15505  	}
 15506  	// match: (TST x0 x1:(SLLconst [c] y))
 15507  	// cond: clobberIfDead(x1)
 15508  	// result: (TSTshiftLL x0 y [c])
 15509  	for {
 15510  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
 15511  			x0 := v_0
 15512  			x1 := v_1
 15513  			if x1.Op != OpARM64SLLconst {
 15514  				continue
 15515  			}
 15516  			c := auxIntToInt64(x1.AuxInt)
 15517  			y := x1.Args[0]
 15518  			if !(clobberIfDead(x1)) {
 15519  				continue
 15520  			}
 15521  			v.reset(OpARM64TSTshiftLL)
 15522  			v.AuxInt = int64ToAuxInt(c)
 15523  			v.AddArg2(x0, y)
 15524  			return true
 15525  		}
 15526  		break
 15527  	}
 15528  	// match: (TST x0 x1:(SRLconst [c] y))
 15529  	// cond: clobberIfDead(x1)
 15530  	// result: (TSTshiftRL x0 y [c])
 15531  	for {
 15532  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
 15533  			x0 := v_0
 15534  			x1 := v_1
 15535  			if x1.Op != OpARM64SRLconst {
 15536  				continue
 15537  			}
 15538  			c := auxIntToInt64(x1.AuxInt)
 15539  			y := x1.Args[0]
 15540  			if !(clobberIfDead(x1)) {
 15541  				continue
 15542  			}
 15543  			v.reset(OpARM64TSTshiftRL)
 15544  			v.AuxInt = int64ToAuxInt(c)
 15545  			v.AddArg2(x0, y)
 15546  			return true
 15547  		}
 15548  		break
 15549  	}
 15550  	// match: (TST x0 x1:(SRAconst [c] y))
 15551  	// cond: clobberIfDead(x1)
 15552  	// result: (TSTshiftRA x0 y [c])
 15553  	for {
 15554  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
 15555  			x0 := v_0
 15556  			x1 := v_1
 15557  			if x1.Op != OpARM64SRAconst {
 15558  				continue
 15559  			}
 15560  			c := auxIntToInt64(x1.AuxInt)
 15561  			y := x1.Args[0]
 15562  			if !(clobberIfDead(x1)) {
 15563  				continue
 15564  			}
 15565  			v.reset(OpARM64TSTshiftRA)
 15566  			v.AuxInt = int64ToAuxInt(c)
 15567  			v.AddArg2(x0, y)
 15568  			return true
 15569  		}
 15570  		break
 15571  	}
 15572  	// match: (TST x0 x1:(RORconst [c] y))
 15573  	// cond: clobberIfDead(x1)
 15574  	// result: (TSTshiftRO x0 y [c])
 15575  	for {
 15576  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
 15577  			x0 := v_0
 15578  			x1 := v_1
 15579  			if x1.Op != OpARM64RORconst {
 15580  				continue
 15581  			}
 15582  			c := auxIntToInt64(x1.AuxInt)
 15583  			y := x1.Args[0]
 15584  			if !(clobberIfDead(x1)) {
 15585  				continue
 15586  			}
 15587  			v.reset(OpARM64TSTshiftRO)
 15588  			v.AuxInt = int64ToAuxInt(c)
 15589  			v.AddArg2(x0, y)
 15590  			return true
 15591  		}
 15592  		break
 15593  	}
 15594  	return false
 15595  }
 15596  func rewriteValueARM64_OpARM64TSTW(v *Value) bool {
 15597  	v_1 := v.Args[1]
 15598  	v_0 := v.Args[0]
 15599  	// match: (TSTW x (MOVDconst [c]))
 15600  	// result: (TSTWconst [int32(c)] x)
 15601  	for {
 15602  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
 15603  			x := v_0
 15604  			if v_1.Op != OpARM64MOVDconst {
 15605  				continue
 15606  			}
 15607  			c := auxIntToInt64(v_1.AuxInt)
 15608  			v.reset(OpARM64TSTWconst)
 15609  			v.AuxInt = int32ToAuxInt(int32(c))
 15610  			v.AddArg(x)
 15611  			return true
 15612  		}
 15613  		break
 15614  	}
 15615  	return false
 15616  }
 15617  func rewriteValueARM64_OpARM64TSTWconst(v *Value) bool {
 15618  	v_0 := v.Args[0]
 15619  	// match: (TSTWconst (MOVDconst [x]) [y])
 15620  	// result: (FlagConstant [logicFlags32(int32(x)&y)])
 15621  	for {
 15622  		y := auxIntToInt32(v.AuxInt)
 15623  		if v_0.Op != OpARM64MOVDconst {
 15624  			break
 15625  		}
 15626  		x := auxIntToInt64(v_0.AuxInt)
 15627  		v.reset(OpARM64FlagConstant)
 15628  		v.AuxInt = flagConstantToAuxInt(logicFlags32(int32(x) & y))
 15629  		return true
 15630  	}
 15631  	return false
 15632  }
 15633  func rewriteValueARM64_OpARM64TSTconst(v *Value) bool {
 15634  	v_0 := v.Args[0]
 15635  	// match: (TSTconst (MOVDconst [x]) [y])
 15636  	// result: (FlagConstant [logicFlags64(x&y)])
 15637  	for {
 15638  		y := auxIntToInt64(v.AuxInt)
 15639  		if v_0.Op != OpARM64MOVDconst {
 15640  			break
 15641  		}
 15642  		x := auxIntToInt64(v_0.AuxInt)
 15643  		v.reset(OpARM64FlagConstant)
 15644  		v.AuxInt = flagConstantToAuxInt(logicFlags64(x & y))
 15645  		return true
 15646  	}
 15647  	return false
 15648  }
 15649  func rewriteValueARM64_OpARM64TSTshiftLL(v *Value) bool {
 15650  	v_1 := v.Args[1]
 15651  	v_0 := v.Args[0]
 15652  	b := v.Block
 15653  	// match: (TSTshiftLL (MOVDconst [c]) x [d])
 15654  	// result: (TSTconst [c] (SLLconst <x.Type> x [d]))
 15655  	for {
 15656  		d := auxIntToInt64(v.AuxInt)
 15657  		if v_0.Op != OpARM64MOVDconst {
 15658  			break
 15659  		}
 15660  		c := auxIntToInt64(v_0.AuxInt)
 15661  		x := v_1
 15662  		v.reset(OpARM64TSTconst)
 15663  		v.AuxInt = int64ToAuxInt(c)
 15664  		v0 := b.NewValue0(v.Pos, OpARM64SLLconst, x.Type)
 15665  		v0.AuxInt = int64ToAuxInt(d)
 15666  		v0.AddArg(x)
 15667  		v.AddArg(v0)
 15668  		return true
 15669  	}
 15670  	// match: (TSTshiftLL x (MOVDconst [c]) [d])
 15671  	// result: (TSTconst x [int64(uint64(c)<<uint64(d))])
 15672  	for {
 15673  		d := auxIntToInt64(v.AuxInt)
 15674  		x := v_0
 15675  		if v_1.Op != OpARM64MOVDconst {
 15676  			break
 15677  		}
 15678  		c := auxIntToInt64(v_1.AuxInt)
 15679  		v.reset(OpARM64TSTconst)
 15680  		v.AuxInt = int64ToAuxInt(int64(uint64(c) << uint64(d)))
 15681  		v.AddArg(x)
 15682  		return true
 15683  	}
 15684  	return false
 15685  }
 15686  func rewriteValueARM64_OpARM64TSTshiftRA(v *Value) bool {
 15687  	v_1 := v.Args[1]
 15688  	v_0 := v.Args[0]
 15689  	b := v.Block
 15690  	// match: (TSTshiftRA (MOVDconst [c]) x [d])
 15691  	// result: (TSTconst [c] (SRAconst <x.Type> x [d]))
 15692  	for {
 15693  		d := auxIntToInt64(v.AuxInt)
 15694  		if v_0.Op != OpARM64MOVDconst {
 15695  			break
 15696  		}
 15697  		c := auxIntToInt64(v_0.AuxInt)
 15698  		x := v_1
 15699  		v.reset(OpARM64TSTconst)
 15700  		v.AuxInt = int64ToAuxInt(c)
 15701  		v0 := b.NewValue0(v.Pos, OpARM64SRAconst, x.Type)
 15702  		v0.AuxInt = int64ToAuxInt(d)
 15703  		v0.AddArg(x)
 15704  		v.AddArg(v0)
 15705  		return true
 15706  	}
 15707  	// match: (TSTshiftRA x (MOVDconst [c]) [d])
 15708  	// result: (TSTconst x [c>>uint64(d)])
 15709  	for {
 15710  		d := auxIntToInt64(v.AuxInt)
 15711  		x := v_0
 15712  		if v_1.Op != OpARM64MOVDconst {
 15713  			break
 15714  		}
 15715  		c := auxIntToInt64(v_1.AuxInt)
 15716  		v.reset(OpARM64TSTconst)
 15717  		v.AuxInt = int64ToAuxInt(c >> uint64(d))
 15718  		v.AddArg(x)
 15719  		return true
 15720  	}
 15721  	return false
 15722  }
 15723  func rewriteValueARM64_OpARM64TSTshiftRL(v *Value) bool {
 15724  	v_1 := v.Args[1]
 15725  	v_0 := v.Args[0]
 15726  	b := v.Block
 15727  	// match: (TSTshiftRL (MOVDconst [c]) x [d])
 15728  	// result: (TSTconst [c] (SRLconst <x.Type> x [d]))
 15729  	for {
 15730  		d := auxIntToInt64(v.AuxInt)
 15731  		if v_0.Op != OpARM64MOVDconst {
 15732  			break
 15733  		}
 15734  		c := auxIntToInt64(v_0.AuxInt)
 15735  		x := v_1
 15736  		v.reset(OpARM64TSTconst)
 15737  		v.AuxInt = int64ToAuxInt(c)
 15738  		v0 := b.NewValue0(v.Pos, OpARM64SRLconst, x.Type)
 15739  		v0.AuxInt = int64ToAuxInt(d)
 15740  		v0.AddArg(x)
 15741  		v.AddArg(v0)
 15742  		return true
 15743  	}
 15744  	// match: (TSTshiftRL x (MOVDconst [c]) [d])
 15745  	// result: (TSTconst x [int64(uint64(c)>>uint64(d))])
 15746  	for {
 15747  		d := auxIntToInt64(v.AuxInt)
 15748  		x := v_0
 15749  		if v_1.Op != OpARM64MOVDconst {
 15750  			break
 15751  		}
 15752  		c := auxIntToInt64(v_1.AuxInt)
 15753  		v.reset(OpARM64TSTconst)
 15754  		v.AuxInt = int64ToAuxInt(int64(uint64(c) >> uint64(d)))
 15755  		v.AddArg(x)
 15756  		return true
 15757  	}
 15758  	return false
 15759  }
 15760  func rewriteValueARM64_OpARM64TSTshiftRO(v *Value) bool {
 15761  	v_1 := v.Args[1]
 15762  	v_0 := v.Args[0]
 15763  	b := v.Block
 15764  	// match: (TSTshiftRO (MOVDconst [c]) x [d])
 15765  	// result: (TSTconst [c] (RORconst <x.Type> x [d]))
 15766  	for {
 15767  		d := auxIntToInt64(v.AuxInt)
 15768  		if v_0.Op != OpARM64MOVDconst {
 15769  			break
 15770  		}
 15771  		c := auxIntToInt64(v_0.AuxInt)
 15772  		x := v_1
 15773  		v.reset(OpARM64TSTconst)
 15774  		v.AuxInt = int64ToAuxInt(c)
 15775  		v0 := b.NewValue0(v.Pos, OpARM64RORconst, x.Type)
 15776  		v0.AuxInt = int64ToAuxInt(d)
 15777  		v0.AddArg(x)
 15778  		v.AddArg(v0)
 15779  		return true
 15780  	}
 15781  	// match: (TSTshiftRO x (MOVDconst [c]) [d])
 15782  	// result: (TSTconst x [rotateRight64(c, d)])
 15783  	for {
 15784  		d := auxIntToInt64(v.AuxInt)
 15785  		x := v_0
 15786  		if v_1.Op != OpARM64MOVDconst {
 15787  			break
 15788  		}
 15789  		c := auxIntToInt64(v_1.AuxInt)
 15790  		v.reset(OpARM64TSTconst)
 15791  		v.AuxInt = int64ToAuxInt(rotateRight64(c, d))
 15792  		v.AddArg(x)
 15793  		return true
 15794  	}
 15795  	return false
 15796  }
 15797  func rewriteValueARM64_OpARM64UBFIZ(v *Value) bool {
 15798  	v_0 := v.Args[0]
 15799  	// match: (UBFIZ [bfc] (SLLconst [sc] x))
 15800  	// cond: sc < bfc.width()
 15801  	// result: (UBFIZ [armBFAuxInt(bfc.lsb()+sc, bfc.width()-sc)] x)
 15802  	for {
 15803  		bfc := auxIntToArm64BitField(v.AuxInt)
 15804  		if v_0.Op != OpARM64SLLconst {
 15805  			break
 15806  		}
 15807  		sc := auxIntToInt64(v_0.AuxInt)
 15808  		x := v_0.Args[0]
 15809  		if !(sc < bfc.width()) {
 15810  			break
 15811  		}
 15812  		v.reset(OpARM64UBFIZ)
 15813  		v.AuxInt = arm64BitFieldToAuxInt(armBFAuxInt(bfc.lsb()+sc, bfc.width()-sc))
 15814  		v.AddArg(x)
 15815  		return true
 15816  	}
 15817  	return false
 15818  }
 15819  func rewriteValueARM64_OpARM64UBFX(v *Value) bool {
 15820  	v_0 := v.Args[0]
 15821  	// match: (UBFX [bfc] (ANDconst [c] x))
 15822  	// cond: isARM64BFMask(0, c, 0) && bfc.lsb() + bfc.width() <= arm64BFWidth(c, 0)
 15823  	// result: (UBFX [bfc] x)
 15824  	for {
 15825  		bfc := auxIntToArm64BitField(v.AuxInt)
 15826  		if v_0.Op != OpARM64ANDconst {
 15827  			break
 15828  		}
 15829  		c := auxIntToInt64(v_0.AuxInt)
 15830  		x := v_0.Args[0]
 15831  		if !(isARM64BFMask(0, c, 0) && bfc.lsb()+bfc.width() <= arm64BFWidth(c, 0)) {
 15832  			break
 15833  		}
 15834  		v.reset(OpARM64UBFX)
 15835  		v.AuxInt = arm64BitFieldToAuxInt(bfc)
 15836  		v.AddArg(x)
 15837  		return true
 15838  	}
 15839  	// match: (UBFX [bfc] e:(MOVWUreg x))
 15840  	// cond: e.Uses == 1 && bfc.lsb() < 32
 15841  	// result: (UBFX [armBFAuxInt(bfc.lsb(), min(bfc.width(), 32-bfc.lsb()))] x)
 15842  	for {
 15843  		bfc := auxIntToArm64BitField(v.AuxInt)
 15844  		e := v_0
 15845  		if e.Op != OpARM64MOVWUreg {
 15846  			break
 15847  		}
 15848  		x := e.Args[0]
 15849  		if !(e.Uses == 1 && bfc.lsb() < 32) {
 15850  			break
 15851  		}
 15852  		v.reset(OpARM64UBFX)
 15853  		v.AuxInt = arm64BitFieldToAuxInt(armBFAuxInt(bfc.lsb(), min(bfc.width(), 32-bfc.lsb())))
 15854  		v.AddArg(x)
 15855  		return true
 15856  	}
 15857  	// match: (UBFX [bfc] e:(MOVHUreg x))
 15858  	// cond: e.Uses == 1 && bfc.lsb() < 16
 15859  	// result: (UBFX [armBFAuxInt(bfc.lsb(), min(bfc.width(), 16-bfc.lsb()))] x)
 15860  	for {
 15861  		bfc := auxIntToArm64BitField(v.AuxInt)
 15862  		e := v_0
 15863  		if e.Op != OpARM64MOVHUreg {
 15864  			break
 15865  		}
 15866  		x := e.Args[0]
 15867  		if !(e.Uses == 1 && bfc.lsb() < 16) {
 15868  			break
 15869  		}
 15870  		v.reset(OpARM64UBFX)
 15871  		v.AuxInt = arm64BitFieldToAuxInt(armBFAuxInt(bfc.lsb(), min(bfc.width(), 16-bfc.lsb())))
 15872  		v.AddArg(x)
 15873  		return true
 15874  	}
 15875  	// match: (UBFX [bfc] e:(MOVBUreg x))
 15876  	// cond: e.Uses == 1 && bfc.lsb() < 8
 15877  	// result: (UBFX [armBFAuxInt(bfc.lsb(), min(bfc.width(), 8-bfc.lsb()))] x)
 15878  	for {
 15879  		bfc := auxIntToArm64BitField(v.AuxInt)
 15880  		e := v_0
 15881  		if e.Op != OpARM64MOVBUreg {
 15882  			break
 15883  		}
 15884  		x := e.Args[0]
 15885  		if !(e.Uses == 1 && bfc.lsb() < 8) {
 15886  			break
 15887  		}
 15888  		v.reset(OpARM64UBFX)
 15889  		v.AuxInt = arm64BitFieldToAuxInt(armBFAuxInt(bfc.lsb(), min(bfc.width(), 8-bfc.lsb())))
 15890  		v.AddArg(x)
 15891  		return true
 15892  	}
 15893  	// match: (UBFX [bfc] (SRLconst [sc] x))
 15894  	// cond: sc+bfc.width()+bfc.lsb() < 64
 15895  	// result: (UBFX [armBFAuxInt(bfc.lsb()+sc, bfc.width())] x)
 15896  	for {
 15897  		bfc := auxIntToArm64BitField(v.AuxInt)
 15898  		if v_0.Op != OpARM64SRLconst {
 15899  			break
 15900  		}
 15901  		sc := auxIntToInt64(v_0.AuxInt)
 15902  		x := v_0.Args[0]
 15903  		if !(sc+bfc.width()+bfc.lsb() < 64) {
 15904  			break
 15905  		}
 15906  		v.reset(OpARM64UBFX)
 15907  		v.AuxInt = arm64BitFieldToAuxInt(armBFAuxInt(bfc.lsb()+sc, bfc.width()))
 15908  		v.AddArg(x)
 15909  		return true
 15910  	}
 15911  	// match: (UBFX [bfc] (SLLconst [sc] x))
 15912  	// cond: sc == bfc.lsb()
 15913  	// result: (ANDconst [1<<uint(bfc.width())-1] x)
 15914  	for {
 15915  		bfc := auxIntToArm64BitField(v.AuxInt)
 15916  		if v_0.Op != OpARM64SLLconst {
 15917  			break
 15918  		}
 15919  		sc := auxIntToInt64(v_0.AuxInt)
 15920  		x := v_0.Args[0]
 15921  		if !(sc == bfc.lsb()) {
 15922  			break
 15923  		}
 15924  		v.reset(OpARM64ANDconst)
 15925  		v.AuxInt = int64ToAuxInt(1<<uint(bfc.width()) - 1)
 15926  		v.AddArg(x)
 15927  		return true
 15928  	}
 15929  	// match: (UBFX [bfc] (SLLconst [sc] x))
 15930  	// cond: sc < bfc.lsb()
 15931  	// result: (UBFX [armBFAuxInt(bfc.lsb()-sc, bfc.width())] x)
 15932  	for {
 15933  		bfc := auxIntToArm64BitField(v.AuxInt)
 15934  		if v_0.Op != OpARM64SLLconst {
 15935  			break
 15936  		}
 15937  		sc := auxIntToInt64(v_0.AuxInt)
 15938  		x := v_0.Args[0]
 15939  		if !(sc < bfc.lsb()) {
 15940  			break
 15941  		}
 15942  		v.reset(OpARM64UBFX)
 15943  		v.AuxInt = arm64BitFieldToAuxInt(armBFAuxInt(bfc.lsb()-sc, bfc.width()))
 15944  		v.AddArg(x)
 15945  		return true
 15946  	}
 15947  	// match: (UBFX [bfc] (SLLconst [sc] x))
 15948  	// cond: sc > bfc.lsb() && sc < bfc.lsb()+bfc.width()
 15949  	// result: (UBFIZ [armBFAuxInt(sc-bfc.lsb(), bfc.lsb()+bfc.width()-sc)] x)
 15950  	for {
 15951  		bfc := auxIntToArm64BitField(v.AuxInt)
 15952  		if v_0.Op != OpARM64SLLconst {
 15953  			break
 15954  		}
 15955  		sc := auxIntToInt64(v_0.AuxInt)
 15956  		x := v_0.Args[0]
 15957  		if !(sc > bfc.lsb() && sc < bfc.lsb()+bfc.width()) {
 15958  			break
 15959  		}
 15960  		v.reset(OpARM64UBFIZ)
 15961  		v.AuxInt = arm64BitFieldToAuxInt(armBFAuxInt(sc-bfc.lsb(), bfc.lsb()+bfc.width()-sc))
 15962  		v.AddArg(x)
 15963  		return true
 15964  	}
 15965  	return false
 15966  }
 15967  func rewriteValueARM64_OpARM64UDIV(v *Value) bool {
 15968  	v_1 := v.Args[1]
 15969  	v_0 := v.Args[0]
 15970  	// match: (UDIV x (MOVDconst [1]))
 15971  	// result: x
 15972  	for {
 15973  		x := v_0
 15974  		if v_1.Op != OpARM64MOVDconst || auxIntToInt64(v_1.AuxInt) != 1 {
 15975  			break
 15976  		}
 15977  		v.copyOf(x)
 15978  		return true
 15979  	}
 15980  	// match: (UDIV x (MOVDconst [c]))
 15981  	// cond: isPowerOfTwo(c)
 15982  	// result: (SRLconst [log64(c)] x)
 15983  	for {
 15984  		x := v_0
 15985  		if v_1.Op != OpARM64MOVDconst {
 15986  			break
 15987  		}
 15988  		c := auxIntToInt64(v_1.AuxInt)
 15989  		if !(isPowerOfTwo(c)) {
 15990  			break
 15991  		}
 15992  		v.reset(OpARM64SRLconst)
 15993  		v.AuxInt = int64ToAuxInt(log64(c))
 15994  		v.AddArg(x)
 15995  		return true
 15996  	}
 15997  	// match: (UDIV (MOVDconst [c]) (MOVDconst [d]))
 15998  	// cond: d != 0
 15999  	// result: (MOVDconst [int64(uint64(c)/uint64(d))])
 16000  	for {
 16001  		if v_0.Op != OpARM64MOVDconst {
 16002  			break
 16003  		}
 16004  		c := auxIntToInt64(v_0.AuxInt)
 16005  		if v_1.Op != OpARM64MOVDconst {
 16006  			break
 16007  		}
 16008  		d := auxIntToInt64(v_1.AuxInt)
 16009  		if !(d != 0) {
 16010  			break
 16011  		}
 16012  		v.reset(OpARM64MOVDconst)
 16013  		v.AuxInt = int64ToAuxInt(int64(uint64(c) / uint64(d)))
 16014  		return true
 16015  	}
 16016  	return false
 16017  }
 16018  func rewriteValueARM64_OpARM64UDIVW(v *Value) bool {
 16019  	v_1 := v.Args[1]
 16020  	v_0 := v.Args[0]
 16021  	b := v.Block
 16022  	// match: (UDIVW x (MOVDconst [c]))
 16023  	// cond: uint32(c)==1
 16024  	// result: (MOVWUreg x)
 16025  	for {
 16026  		x := v_0
 16027  		if v_1.Op != OpARM64MOVDconst {
 16028  			break
 16029  		}
 16030  		c := auxIntToInt64(v_1.AuxInt)
 16031  		if !(uint32(c) == 1) {
 16032  			break
 16033  		}
 16034  		v.reset(OpARM64MOVWUreg)
 16035  		v.AddArg(x)
 16036  		return true
 16037  	}
 16038  	// match: (UDIVW x (MOVDconst [c]))
 16039  	// cond: isPowerOfTwo(c) && is32Bit(c)
 16040  	// result: (SRLconst [log64(c)] (MOVWUreg <v.Type> x))
 16041  	for {
 16042  		x := v_0
 16043  		if v_1.Op != OpARM64MOVDconst {
 16044  			break
 16045  		}
 16046  		c := auxIntToInt64(v_1.AuxInt)
 16047  		if !(isPowerOfTwo(c) && is32Bit(c)) {
 16048  			break
 16049  		}
 16050  		v.reset(OpARM64SRLconst)
 16051  		v.AuxInt = int64ToAuxInt(log64(c))
 16052  		v0 := b.NewValue0(v.Pos, OpARM64MOVWUreg, v.Type)
 16053  		v0.AddArg(x)
 16054  		v.AddArg(v0)
 16055  		return true
 16056  	}
 16057  	// match: (UDIVW (MOVDconst [c]) (MOVDconst [d]))
 16058  	// cond: d != 0
 16059  	// result: (MOVDconst [int64(uint32(c)/uint32(d))])
 16060  	for {
 16061  		if v_0.Op != OpARM64MOVDconst {
 16062  			break
 16063  		}
 16064  		c := auxIntToInt64(v_0.AuxInt)
 16065  		if v_1.Op != OpARM64MOVDconst {
 16066  			break
 16067  		}
 16068  		d := auxIntToInt64(v_1.AuxInt)
 16069  		if !(d != 0) {
 16070  			break
 16071  		}
 16072  		v.reset(OpARM64MOVDconst)
 16073  		v.AuxInt = int64ToAuxInt(int64(uint32(c) / uint32(d)))
 16074  		return true
 16075  	}
 16076  	return false
 16077  }
 16078  func rewriteValueARM64_OpARM64UMOD(v *Value) bool {
 16079  	v_1 := v.Args[1]
 16080  	v_0 := v.Args[0]
 16081  	b := v.Block
 16082  	typ := &b.Func.Config.Types
 16083  	// match: (UMOD <typ.UInt64> x y)
 16084  	// result: (MSUB <typ.UInt64> x y (UDIV <typ.UInt64> x y))
 16085  	for {
 16086  		if v.Type != typ.UInt64 {
 16087  			break
 16088  		}
 16089  		x := v_0
 16090  		y := v_1
 16091  		v.reset(OpARM64MSUB)
 16092  		v.Type = typ.UInt64
 16093  		v0 := b.NewValue0(v.Pos, OpARM64UDIV, typ.UInt64)
 16094  		v0.AddArg2(x, y)
 16095  		v.AddArg3(x, y, v0)
 16096  		return true
 16097  	}
 16098  	// match: (UMOD _ (MOVDconst [1]))
 16099  	// result: (MOVDconst [0])
 16100  	for {
 16101  		if v_1.Op != OpARM64MOVDconst || auxIntToInt64(v_1.AuxInt) != 1 {
 16102  			break
 16103  		}
 16104  		v.reset(OpARM64MOVDconst)
 16105  		v.AuxInt = int64ToAuxInt(0)
 16106  		return true
 16107  	}
 16108  	// match: (UMOD x (MOVDconst [c]))
 16109  	// cond: isPowerOfTwo(c)
 16110  	// result: (ANDconst [c-1] x)
 16111  	for {
 16112  		x := v_0
 16113  		if v_1.Op != OpARM64MOVDconst {
 16114  			break
 16115  		}
 16116  		c := auxIntToInt64(v_1.AuxInt)
 16117  		if !(isPowerOfTwo(c)) {
 16118  			break
 16119  		}
 16120  		v.reset(OpARM64ANDconst)
 16121  		v.AuxInt = int64ToAuxInt(c - 1)
 16122  		v.AddArg(x)
 16123  		return true
 16124  	}
 16125  	// match: (UMOD (MOVDconst [c]) (MOVDconst [d]))
 16126  	// cond: d != 0
 16127  	// result: (MOVDconst [int64(uint64(c)%uint64(d))])
 16128  	for {
 16129  		if v_0.Op != OpARM64MOVDconst {
 16130  			break
 16131  		}
 16132  		c := auxIntToInt64(v_0.AuxInt)
 16133  		if v_1.Op != OpARM64MOVDconst {
 16134  			break
 16135  		}
 16136  		d := auxIntToInt64(v_1.AuxInt)
 16137  		if !(d != 0) {
 16138  			break
 16139  		}
 16140  		v.reset(OpARM64MOVDconst)
 16141  		v.AuxInt = int64ToAuxInt(int64(uint64(c) % uint64(d)))
 16142  		return true
 16143  	}
 16144  	return false
 16145  }
 16146  func rewriteValueARM64_OpARM64UMODW(v *Value) bool {
 16147  	v_1 := v.Args[1]
 16148  	v_0 := v.Args[0]
 16149  	b := v.Block
 16150  	typ := &b.Func.Config.Types
 16151  	// match: (UMODW <typ.UInt32> x y)
 16152  	// result: (MSUBW <typ.UInt32> x y (UDIVW <typ.UInt32> x y))
 16153  	for {
 16154  		if v.Type != typ.UInt32 {
 16155  			break
 16156  		}
 16157  		x := v_0
 16158  		y := v_1
 16159  		v.reset(OpARM64MSUBW)
 16160  		v.Type = typ.UInt32
 16161  		v0 := b.NewValue0(v.Pos, OpARM64UDIVW, typ.UInt32)
 16162  		v0.AddArg2(x, y)
 16163  		v.AddArg3(x, y, v0)
 16164  		return true
 16165  	}
 16166  	// match: (UMODW _ (MOVDconst [c]))
 16167  	// cond: uint32(c)==1
 16168  	// result: (MOVDconst [0])
 16169  	for {
 16170  		if v_1.Op != OpARM64MOVDconst {
 16171  			break
 16172  		}
 16173  		c := auxIntToInt64(v_1.AuxInt)
 16174  		if !(uint32(c) == 1) {
 16175  			break
 16176  		}
 16177  		v.reset(OpARM64MOVDconst)
 16178  		v.AuxInt = int64ToAuxInt(0)
 16179  		return true
 16180  	}
 16181  	// match: (UMODW x (MOVDconst [c]))
 16182  	// cond: isPowerOfTwo(c) && is32Bit(c)
 16183  	// result: (ANDconst [c-1] x)
 16184  	for {
 16185  		x := v_0
 16186  		if v_1.Op != OpARM64MOVDconst {
 16187  			break
 16188  		}
 16189  		c := auxIntToInt64(v_1.AuxInt)
 16190  		if !(isPowerOfTwo(c) && is32Bit(c)) {
 16191  			break
 16192  		}
 16193  		v.reset(OpARM64ANDconst)
 16194  		v.AuxInt = int64ToAuxInt(c - 1)
 16195  		v.AddArg(x)
 16196  		return true
 16197  	}
 16198  	// match: (UMODW (MOVDconst [c]) (MOVDconst [d]))
 16199  	// cond: d != 0
 16200  	// result: (MOVDconst [int64(uint32(c)%uint32(d))])
 16201  	for {
 16202  		if v_0.Op != OpARM64MOVDconst {
 16203  			break
 16204  		}
 16205  		c := auxIntToInt64(v_0.AuxInt)
 16206  		if v_1.Op != OpARM64MOVDconst {
 16207  			break
 16208  		}
 16209  		d := auxIntToInt64(v_1.AuxInt)
 16210  		if !(d != 0) {
 16211  			break
 16212  		}
 16213  		v.reset(OpARM64MOVDconst)
 16214  		v.AuxInt = int64ToAuxInt(int64(uint32(c) % uint32(d)))
 16215  		return true
 16216  	}
 16217  	return false
 16218  }
 16219  func rewriteValueARM64_OpARM64XOR(v *Value) bool {
 16220  	v_1 := v.Args[1]
 16221  	v_0 := v.Args[0]
 16222  	// match: (XOR x (MOVDconst [c]))
 16223  	// result: (XORconst [c] x)
 16224  	for {
 16225  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
 16226  			x := v_0
 16227  			if v_1.Op != OpARM64MOVDconst {
 16228  				continue
 16229  			}
 16230  			c := auxIntToInt64(v_1.AuxInt)
 16231  			v.reset(OpARM64XORconst)
 16232  			v.AuxInt = int64ToAuxInt(c)
 16233  			v.AddArg(x)
 16234  			return true
 16235  		}
 16236  		break
 16237  	}
 16238  	// match: (XOR x x)
 16239  	// result: (MOVDconst [0])
 16240  	for {
 16241  		x := v_0
 16242  		if x != v_1 {
 16243  			break
 16244  		}
 16245  		v.reset(OpARM64MOVDconst)
 16246  		v.AuxInt = int64ToAuxInt(0)
 16247  		return true
 16248  	}
 16249  	// match: (XOR x (MVN y))
 16250  	// result: (EON x y)
 16251  	for {
 16252  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
 16253  			x := v_0
 16254  			if v_1.Op != OpARM64MVN {
 16255  				continue
 16256  			}
 16257  			y := v_1.Args[0]
 16258  			v.reset(OpARM64EON)
 16259  			v.AddArg2(x, y)
 16260  			return true
 16261  		}
 16262  		break
 16263  	}
 16264  	// match: (XOR x0 x1:(SLLconst [c] y))
 16265  	// cond: clobberIfDead(x1)
 16266  	// result: (XORshiftLL x0 y [c])
 16267  	for {
 16268  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
 16269  			x0 := v_0
 16270  			x1 := v_1
 16271  			if x1.Op != OpARM64SLLconst {
 16272  				continue
 16273  			}
 16274  			c := auxIntToInt64(x1.AuxInt)
 16275  			y := x1.Args[0]
 16276  			if !(clobberIfDead(x1)) {
 16277  				continue
 16278  			}
 16279  			v.reset(OpARM64XORshiftLL)
 16280  			v.AuxInt = int64ToAuxInt(c)
 16281  			v.AddArg2(x0, y)
 16282  			return true
 16283  		}
 16284  		break
 16285  	}
 16286  	// match: (XOR x0 x1:(SRLconst [c] y))
 16287  	// cond: clobberIfDead(x1)
 16288  	// result: (XORshiftRL x0 y [c])
 16289  	for {
 16290  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
 16291  			x0 := v_0
 16292  			x1 := v_1
 16293  			if x1.Op != OpARM64SRLconst {
 16294  				continue
 16295  			}
 16296  			c := auxIntToInt64(x1.AuxInt)
 16297  			y := x1.Args[0]
 16298  			if !(clobberIfDead(x1)) {
 16299  				continue
 16300  			}
 16301  			v.reset(OpARM64XORshiftRL)
 16302  			v.AuxInt = int64ToAuxInt(c)
 16303  			v.AddArg2(x0, y)
 16304  			return true
 16305  		}
 16306  		break
 16307  	}
 16308  	// match: (XOR x0 x1:(SRAconst [c] y))
 16309  	// cond: clobberIfDead(x1)
 16310  	// result: (XORshiftRA x0 y [c])
 16311  	for {
 16312  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
 16313  			x0 := v_0
 16314  			x1 := v_1
 16315  			if x1.Op != OpARM64SRAconst {
 16316  				continue
 16317  			}
 16318  			c := auxIntToInt64(x1.AuxInt)
 16319  			y := x1.Args[0]
 16320  			if !(clobberIfDead(x1)) {
 16321  				continue
 16322  			}
 16323  			v.reset(OpARM64XORshiftRA)
 16324  			v.AuxInt = int64ToAuxInt(c)
 16325  			v.AddArg2(x0, y)
 16326  			return true
 16327  		}
 16328  		break
 16329  	}
 16330  	// match: (XOR x0 x1:(RORconst [c] y))
 16331  	// cond: clobberIfDead(x1)
 16332  	// result: (XORshiftRO x0 y [c])
 16333  	for {
 16334  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
 16335  			x0 := v_0
 16336  			x1 := v_1
 16337  			if x1.Op != OpARM64RORconst {
 16338  				continue
 16339  			}
 16340  			c := auxIntToInt64(x1.AuxInt)
 16341  			y := x1.Args[0]
 16342  			if !(clobberIfDead(x1)) {
 16343  				continue
 16344  			}
 16345  			v.reset(OpARM64XORshiftRO)
 16346  			v.AuxInt = int64ToAuxInt(c)
 16347  			v.AddArg2(x0, y)
 16348  			return true
 16349  		}
 16350  		break
 16351  	}
 16352  	return false
 16353  }
 16354  func rewriteValueARM64_OpARM64XORconst(v *Value) bool {
 16355  	v_0 := v.Args[0]
 16356  	// match: (XORconst [0] x)
 16357  	// result: x
 16358  	for {
 16359  		if auxIntToInt64(v.AuxInt) != 0 {
 16360  			break
 16361  		}
 16362  		x := v_0
 16363  		v.copyOf(x)
 16364  		return true
 16365  	}
 16366  	// match: (XORconst [-1] x)
 16367  	// result: (MVN x)
 16368  	for {
 16369  		if auxIntToInt64(v.AuxInt) != -1 {
 16370  			break
 16371  		}
 16372  		x := v_0
 16373  		v.reset(OpARM64MVN)
 16374  		v.AddArg(x)
 16375  		return true
 16376  	}
 16377  	// match: (XORconst [c] (MOVDconst [d]))
 16378  	// result: (MOVDconst [c^d])
 16379  	for {
 16380  		c := auxIntToInt64(v.AuxInt)
 16381  		if v_0.Op != OpARM64MOVDconst {
 16382  			break
 16383  		}
 16384  		d := auxIntToInt64(v_0.AuxInt)
 16385  		v.reset(OpARM64MOVDconst)
 16386  		v.AuxInt = int64ToAuxInt(c ^ d)
 16387  		return true
 16388  	}
 16389  	// match: (XORconst [c] (XORconst [d] x))
 16390  	// result: (XORconst [c^d] x)
 16391  	for {
 16392  		c := auxIntToInt64(v.AuxInt)
 16393  		if v_0.Op != OpARM64XORconst {
 16394  			break
 16395  		}
 16396  		d := auxIntToInt64(v_0.AuxInt)
 16397  		x := v_0.Args[0]
 16398  		v.reset(OpARM64XORconst)
 16399  		v.AuxInt = int64ToAuxInt(c ^ d)
 16400  		v.AddArg(x)
 16401  		return true
 16402  	}
 16403  	return false
 16404  }
 16405  func rewriteValueARM64_OpARM64XORshiftLL(v *Value) bool {
 16406  	v_1 := v.Args[1]
 16407  	v_0 := v.Args[0]
 16408  	b := v.Block
 16409  	typ := &b.Func.Config.Types
 16410  	// match: (XORshiftLL (MOVDconst [c]) x [d])
 16411  	// result: (XORconst [c] (SLLconst <x.Type> x [d]))
 16412  	for {
 16413  		d := auxIntToInt64(v.AuxInt)
 16414  		if v_0.Op != OpARM64MOVDconst {
 16415  			break
 16416  		}
 16417  		c := auxIntToInt64(v_0.AuxInt)
 16418  		x := v_1
 16419  		v.reset(OpARM64XORconst)
 16420  		v.AuxInt = int64ToAuxInt(c)
 16421  		v0 := b.NewValue0(v.Pos, OpARM64SLLconst, x.Type)
 16422  		v0.AuxInt = int64ToAuxInt(d)
 16423  		v0.AddArg(x)
 16424  		v.AddArg(v0)
 16425  		return true
 16426  	}
 16427  	// match: (XORshiftLL x (MOVDconst [c]) [d])
 16428  	// result: (XORconst x [int64(uint64(c)<<uint64(d))])
 16429  	for {
 16430  		d := auxIntToInt64(v.AuxInt)
 16431  		x := v_0
 16432  		if v_1.Op != OpARM64MOVDconst {
 16433  			break
 16434  		}
 16435  		c := auxIntToInt64(v_1.AuxInt)
 16436  		v.reset(OpARM64XORconst)
 16437  		v.AuxInt = int64ToAuxInt(int64(uint64(c) << uint64(d)))
 16438  		v.AddArg(x)
 16439  		return true
 16440  	}
 16441  	// match: (XORshiftLL (SLLconst x [c]) x [c])
 16442  	// result: (MOVDconst [0])
 16443  	for {
 16444  		c := auxIntToInt64(v.AuxInt)
 16445  		if v_0.Op != OpARM64SLLconst || auxIntToInt64(v_0.AuxInt) != c {
 16446  			break
 16447  		}
 16448  		x := v_0.Args[0]
 16449  		if x != v_1 {
 16450  			break
 16451  		}
 16452  		v.reset(OpARM64MOVDconst)
 16453  		v.AuxInt = int64ToAuxInt(0)
 16454  		return true
 16455  	}
 16456  	// match: (XORshiftLL <typ.UInt16> [8] (UBFX <typ.UInt16> [armBFAuxInt(8, 8)] x) x)
 16457  	// result: (REV16W x)
 16458  	for {
 16459  		if v.Type != typ.UInt16 || auxIntToInt64(v.AuxInt) != 8 || v_0.Op != OpARM64UBFX || v_0.Type != typ.UInt16 || auxIntToArm64BitField(v_0.AuxInt) != armBFAuxInt(8, 8) {
 16460  			break
 16461  		}
 16462  		x := v_0.Args[0]
 16463  		if x != v_1 {
 16464  			break
 16465  		}
 16466  		v.reset(OpARM64REV16W)
 16467  		v.AddArg(x)
 16468  		return true
 16469  	}
 16470  	// match: (XORshiftLL [8] (UBFX [armBFAuxInt(8, 24)] (ANDconst [c1] x)) (ANDconst [c2] x))
 16471  	// cond: uint32(c1) == 0xff00ff00 && uint32(c2) == 0x00ff00ff
 16472  	// result: (REV16W x)
 16473  	for {
 16474  		if auxIntToInt64(v.AuxInt) != 8 || v_0.Op != OpARM64UBFX || auxIntToArm64BitField(v_0.AuxInt) != armBFAuxInt(8, 24) {
 16475  			break
 16476  		}
 16477  		v_0_0 := v_0.Args[0]
 16478  		if v_0_0.Op != OpARM64ANDconst {
 16479  			break
 16480  		}
 16481  		c1 := auxIntToInt64(v_0_0.AuxInt)
 16482  		x := v_0_0.Args[0]
 16483  		if v_1.Op != OpARM64ANDconst {
 16484  			break
 16485  		}
 16486  		c2 := auxIntToInt64(v_1.AuxInt)
 16487  		if x != v_1.Args[0] || !(uint32(c1) == 0xff00ff00 && uint32(c2) == 0x00ff00ff) {
 16488  			break
 16489  		}
 16490  		v.reset(OpARM64REV16W)
 16491  		v.AddArg(x)
 16492  		return true
 16493  	}
 16494  	// match: (XORshiftLL [8] (SRLconst [8] (ANDconst [c1] x)) (ANDconst [c2] x))
 16495  	// cond: (uint64(c1) == 0xff00ff00ff00ff00 && uint64(c2) == 0x00ff00ff00ff00ff)
 16496  	// result: (REV16 x)
 16497  	for {
 16498  		if auxIntToInt64(v.AuxInt) != 8 || v_0.Op != OpARM64SRLconst || auxIntToInt64(v_0.AuxInt) != 8 {
 16499  			break
 16500  		}
 16501  		v_0_0 := v_0.Args[0]
 16502  		if v_0_0.Op != OpARM64ANDconst {
 16503  			break
 16504  		}
 16505  		c1 := auxIntToInt64(v_0_0.AuxInt)
 16506  		x := v_0_0.Args[0]
 16507  		if v_1.Op != OpARM64ANDconst {
 16508  			break
 16509  		}
 16510  		c2 := auxIntToInt64(v_1.AuxInt)
 16511  		if x != v_1.Args[0] || !(uint64(c1) == 0xff00ff00ff00ff00 && uint64(c2) == 0x00ff00ff00ff00ff) {
 16512  			break
 16513  		}
 16514  		v.reset(OpARM64REV16)
 16515  		v.AddArg(x)
 16516  		return true
 16517  	}
 16518  	// match: (XORshiftLL [8] (SRLconst [8] (ANDconst [c1] x)) (ANDconst [c2] x))
 16519  	// cond: (uint64(c1) == 0xff00ff00 && uint64(c2) == 0x00ff00ff)
 16520  	// result: (REV16 (ANDconst <x.Type> [0xffffffff] x))
 16521  	for {
 16522  		if auxIntToInt64(v.AuxInt) != 8 || v_0.Op != OpARM64SRLconst || auxIntToInt64(v_0.AuxInt) != 8 {
 16523  			break
 16524  		}
 16525  		v_0_0 := v_0.Args[0]
 16526  		if v_0_0.Op != OpARM64ANDconst {
 16527  			break
 16528  		}
 16529  		c1 := auxIntToInt64(v_0_0.AuxInt)
 16530  		x := v_0_0.Args[0]
 16531  		if v_1.Op != OpARM64ANDconst {
 16532  			break
 16533  		}
 16534  		c2 := auxIntToInt64(v_1.AuxInt)
 16535  		if x != v_1.Args[0] || !(uint64(c1) == 0xff00ff00 && uint64(c2) == 0x00ff00ff) {
 16536  			break
 16537  		}
 16538  		v.reset(OpARM64REV16)
 16539  		v0 := b.NewValue0(v.Pos, OpARM64ANDconst, x.Type)
 16540  		v0.AuxInt = int64ToAuxInt(0xffffffff)
 16541  		v0.AddArg(x)
 16542  		v.AddArg(v0)
 16543  		return true
 16544  	}
 16545  	// match: (XORshiftLL [c] (SRLconst x [64-c]) x2)
 16546  	// result: (EXTRconst [64-c] x2 x)
 16547  	for {
 16548  		c := auxIntToInt64(v.AuxInt)
 16549  		if v_0.Op != OpARM64SRLconst || auxIntToInt64(v_0.AuxInt) != 64-c {
 16550  			break
 16551  		}
 16552  		x := v_0.Args[0]
 16553  		x2 := v_1
 16554  		v.reset(OpARM64EXTRconst)
 16555  		v.AuxInt = int64ToAuxInt(64 - c)
 16556  		v.AddArg2(x2, x)
 16557  		return true
 16558  	}
 16559  	// match: (XORshiftLL <t> [c] (UBFX [bfc] x) x2)
 16560  	// cond: c < 32 && t.Size() == 4 && bfc == armBFAuxInt(32-c, c)
 16561  	// result: (EXTRWconst [32-c] x2 x)
 16562  	for {
 16563  		t := v.Type
 16564  		c := auxIntToInt64(v.AuxInt)
 16565  		if v_0.Op != OpARM64UBFX {
 16566  			break
 16567  		}
 16568  		bfc := auxIntToArm64BitField(v_0.AuxInt)
 16569  		x := v_0.Args[0]
 16570  		x2 := v_1
 16571  		if !(c < 32 && t.Size() == 4 && bfc == armBFAuxInt(32-c, c)) {
 16572  			break
 16573  		}
 16574  		v.reset(OpARM64EXTRWconst)
 16575  		v.AuxInt = int64ToAuxInt(32 - c)
 16576  		v.AddArg2(x2, x)
 16577  		return true
 16578  	}
 16579  	return false
 16580  }
 16581  func rewriteValueARM64_OpARM64XORshiftRA(v *Value) bool {
 16582  	v_1 := v.Args[1]
 16583  	v_0 := v.Args[0]
 16584  	b := v.Block
 16585  	// match: (XORshiftRA (MOVDconst [c]) x [d])
 16586  	// result: (XORconst [c] (SRAconst <x.Type> x [d]))
 16587  	for {
 16588  		d := auxIntToInt64(v.AuxInt)
 16589  		if v_0.Op != OpARM64MOVDconst {
 16590  			break
 16591  		}
 16592  		c := auxIntToInt64(v_0.AuxInt)
 16593  		x := v_1
 16594  		v.reset(OpARM64XORconst)
 16595  		v.AuxInt = int64ToAuxInt(c)
 16596  		v0 := b.NewValue0(v.Pos, OpARM64SRAconst, x.Type)
 16597  		v0.AuxInt = int64ToAuxInt(d)
 16598  		v0.AddArg(x)
 16599  		v.AddArg(v0)
 16600  		return true
 16601  	}
 16602  	// match: (XORshiftRA x (MOVDconst [c]) [d])
 16603  	// result: (XORconst x [c>>uint64(d)])
 16604  	for {
 16605  		d := auxIntToInt64(v.AuxInt)
 16606  		x := v_0
 16607  		if v_1.Op != OpARM64MOVDconst {
 16608  			break
 16609  		}
 16610  		c := auxIntToInt64(v_1.AuxInt)
 16611  		v.reset(OpARM64XORconst)
 16612  		v.AuxInt = int64ToAuxInt(c >> uint64(d))
 16613  		v.AddArg(x)
 16614  		return true
 16615  	}
 16616  	// match: (XORshiftRA (SRAconst x [c]) x [c])
 16617  	// result: (MOVDconst [0])
 16618  	for {
 16619  		c := auxIntToInt64(v.AuxInt)
 16620  		if v_0.Op != OpARM64SRAconst || auxIntToInt64(v_0.AuxInt) != c {
 16621  			break
 16622  		}
 16623  		x := v_0.Args[0]
 16624  		if x != v_1 {
 16625  			break
 16626  		}
 16627  		v.reset(OpARM64MOVDconst)
 16628  		v.AuxInt = int64ToAuxInt(0)
 16629  		return true
 16630  	}
 16631  	return false
 16632  }
 16633  func rewriteValueARM64_OpARM64XORshiftRL(v *Value) bool {
 16634  	v_1 := v.Args[1]
 16635  	v_0 := v.Args[0]
 16636  	b := v.Block
 16637  	// match: (XORshiftRL (MOVDconst [c]) x [d])
 16638  	// result: (XORconst [c] (SRLconst <x.Type> x [d]))
 16639  	for {
 16640  		d := auxIntToInt64(v.AuxInt)
 16641  		if v_0.Op != OpARM64MOVDconst {
 16642  			break
 16643  		}
 16644  		c := auxIntToInt64(v_0.AuxInt)
 16645  		x := v_1
 16646  		v.reset(OpARM64XORconst)
 16647  		v.AuxInt = int64ToAuxInt(c)
 16648  		v0 := b.NewValue0(v.Pos, OpARM64SRLconst, x.Type)
 16649  		v0.AuxInt = int64ToAuxInt(d)
 16650  		v0.AddArg(x)
 16651  		v.AddArg(v0)
 16652  		return true
 16653  	}
 16654  	// match: (XORshiftRL x (MOVDconst [c]) [d])
 16655  	// result: (XORconst x [int64(uint64(c)>>uint64(d))])
 16656  	for {
 16657  		d := auxIntToInt64(v.AuxInt)
 16658  		x := v_0
 16659  		if v_1.Op != OpARM64MOVDconst {
 16660  			break
 16661  		}
 16662  		c := auxIntToInt64(v_1.AuxInt)
 16663  		v.reset(OpARM64XORconst)
 16664  		v.AuxInt = int64ToAuxInt(int64(uint64(c) >> uint64(d)))
 16665  		v.AddArg(x)
 16666  		return true
 16667  	}
 16668  	// match: (XORshiftRL (SRLconst x [c]) x [c])
 16669  	// result: (MOVDconst [0])
 16670  	for {
 16671  		c := auxIntToInt64(v.AuxInt)
 16672  		if v_0.Op != OpARM64SRLconst || auxIntToInt64(v_0.AuxInt) != c {
 16673  			break
 16674  		}
 16675  		x := v_0.Args[0]
 16676  		if x != v_1 {
 16677  			break
 16678  		}
 16679  		v.reset(OpARM64MOVDconst)
 16680  		v.AuxInt = int64ToAuxInt(0)
 16681  		return true
 16682  	}
 16683  	return false
 16684  }
 16685  func rewriteValueARM64_OpARM64XORshiftRO(v *Value) bool {
 16686  	v_1 := v.Args[1]
 16687  	v_0 := v.Args[0]
 16688  	b := v.Block
 16689  	// match: (XORshiftRO (MOVDconst [c]) x [d])
 16690  	// result: (XORconst [c] (RORconst <x.Type> x [d]))
 16691  	for {
 16692  		d := auxIntToInt64(v.AuxInt)
 16693  		if v_0.Op != OpARM64MOVDconst {
 16694  			break
 16695  		}
 16696  		c := auxIntToInt64(v_0.AuxInt)
 16697  		x := v_1
 16698  		v.reset(OpARM64XORconst)
 16699  		v.AuxInt = int64ToAuxInt(c)
 16700  		v0 := b.NewValue0(v.Pos, OpARM64RORconst, x.Type)
 16701  		v0.AuxInt = int64ToAuxInt(d)
 16702  		v0.AddArg(x)
 16703  		v.AddArg(v0)
 16704  		return true
 16705  	}
 16706  	// match: (XORshiftRO x (MOVDconst [c]) [d])
 16707  	// result: (XORconst x [rotateRight64(c, d)])
 16708  	for {
 16709  		d := auxIntToInt64(v.AuxInt)
 16710  		x := v_0
 16711  		if v_1.Op != OpARM64MOVDconst {
 16712  			break
 16713  		}
 16714  		c := auxIntToInt64(v_1.AuxInt)
 16715  		v.reset(OpARM64XORconst)
 16716  		v.AuxInt = int64ToAuxInt(rotateRight64(c, d))
 16717  		v.AddArg(x)
 16718  		return true
 16719  	}
 16720  	// match: (XORshiftRO (RORconst x [c]) x [c])
 16721  	// result: (MOVDconst [0])
 16722  	for {
 16723  		c := auxIntToInt64(v.AuxInt)
 16724  		if v_0.Op != OpARM64RORconst || auxIntToInt64(v_0.AuxInt) != c {
 16725  			break
 16726  		}
 16727  		x := v_0.Args[0]
 16728  		if x != v_1 {
 16729  			break
 16730  		}
 16731  		v.reset(OpARM64MOVDconst)
 16732  		v.AuxInt = int64ToAuxInt(0)
 16733  		return true
 16734  	}
 16735  	return false
 16736  }
 16737  func rewriteValueARM64_OpAddr(v *Value) bool {
 16738  	v_0 := v.Args[0]
 16739  	// match: (Addr {sym} base)
 16740  	// result: (MOVDaddr {sym} base)
 16741  	for {
 16742  		sym := auxToSym(v.Aux)
 16743  		base := v_0
 16744  		v.reset(OpARM64MOVDaddr)
 16745  		v.Aux = symToAux(sym)
 16746  		v.AddArg(base)
 16747  		return true
 16748  	}
 16749  }
 16750  func rewriteValueARM64_OpAvg64u(v *Value) bool {
 16751  	v_1 := v.Args[1]
 16752  	v_0 := v.Args[0]
 16753  	b := v.Block
 16754  	// match: (Avg64u <t> x y)
 16755  	// result: (ADD (SRLconst <t> (SUB <t> x y) [1]) y)
 16756  	for {
 16757  		t := v.Type
 16758  		x := v_0
 16759  		y := v_1
 16760  		v.reset(OpARM64ADD)
 16761  		v0 := b.NewValue0(v.Pos, OpARM64SRLconst, t)
 16762  		v0.AuxInt = int64ToAuxInt(1)
 16763  		v1 := b.NewValue0(v.Pos, OpARM64SUB, t)
 16764  		v1.AddArg2(x, y)
 16765  		v0.AddArg(v1)
 16766  		v.AddArg2(v0, y)
 16767  		return true
 16768  	}
 16769  }
 16770  func rewriteValueARM64_OpBitLen16(v *Value) bool {
 16771  	v_0 := v.Args[0]
 16772  	b := v.Block
 16773  	typ := &b.Func.Config.Types
 16774  	// match: (BitLen16 x)
 16775  	// result: (BitLen64 (ZeroExt16to64 x))
 16776  	for {
 16777  		x := v_0
 16778  		v.reset(OpBitLen64)
 16779  		v0 := b.NewValue0(v.Pos, OpZeroExt16to64, typ.UInt64)
 16780  		v0.AddArg(x)
 16781  		v.AddArg(v0)
 16782  		return true
 16783  	}
 16784  }
 16785  func rewriteValueARM64_OpBitLen32(v *Value) bool {
 16786  	v_0 := v.Args[0]
 16787  	b := v.Block
 16788  	typ := &b.Func.Config.Types
 16789  	// match: (BitLen32 x)
 16790  	// result: (SUB (MOVDconst [32]) (CLZW <typ.Int> x))
 16791  	for {
 16792  		x := v_0
 16793  		v.reset(OpARM64SUB)
 16794  		v0 := b.NewValue0(v.Pos, OpARM64MOVDconst, typ.UInt64)
 16795  		v0.AuxInt = int64ToAuxInt(32)
 16796  		v1 := b.NewValue0(v.Pos, OpARM64CLZW, typ.Int)
 16797  		v1.AddArg(x)
 16798  		v.AddArg2(v0, v1)
 16799  		return true
 16800  	}
 16801  }
 16802  func rewriteValueARM64_OpBitLen64(v *Value) bool {
 16803  	v_0 := v.Args[0]
 16804  	b := v.Block
 16805  	typ := &b.Func.Config.Types
 16806  	// match: (BitLen64 x)
 16807  	// result: (SUB (MOVDconst [64]) (CLZ <typ.Int> x))
 16808  	for {
 16809  		x := v_0
 16810  		v.reset(OpARM64SUB)
 16811  		v0 := b.NewValue0(v.Pos, OpARM64MOVDconst, typ.UInt64)
 16812  		v0.AuxInt = int64ToAuxInt(64)
 16813  		v1 := b.NewValue0(v.Pos, OpARM64CLZ, typ.Int)
 16814  		v1.AddArg(x)
 16815  		v.AddArg2(v0, v1)
 16816  		return true
 16817  	}
 16818  }
 16819  func rewriteValueARM64_OpBitLen8(v *Value) bool {
 16820  	v_0 := v.Args[0]
 16821  	b := v.Block
 16822  	typ := &b.Func.Config.Types
 16823  	// match: (BitLen8 x)
 16824  	// result: (BitLen64 (ZeroExt8to64 x))
 16825  	for {
 16826  		x := v_0
 16827  		v.reset(OpBitLen64)
 16828  		v0 := b.NewValue0(v.Pos, OpZeroExt8to64, typ.UInt64)
 16829  		v0.AddArg(x)
 16830  		v.AddArg(v0)
 16831  		return true
 16832  	}
 16833  }
 16834  func rewriteValueARM64_OpBitRev16(v *Value) bool {
 16835  	v_0 := v.Args[0]
 16836  	b := v.Block
 16837  	typ := &b.Func.Config.Types
 16838  	// match: (BitRev16 x)
 16839  	// result: (SRLconst [48] (RBIT <typ.UInt64> x))
 16840  	for {
 16841  		x := v_0
 16842  		v.reset(OpARM64SRLconst)
 16843  		v.AuxInt = int64ToAuxInt(48)
 16844  		v0 := b.NewValue0(v.Pos, OpARM64RBIT, typ.UInt64)
 16845  		v0.AddArg(x)
 16846  		v.AddArg(v0)
 16847  		return true
 16848  	}
 16849  }
 16850  func rewriteValueARM64_OpBitRev8(v *Value) bool {
 16851  	v_0 := v.Args[0]
 16852  	b := v.Block
 16853  	typ := &b.Func.Config.Types
 16854  	// match: (BitRev8 x)
 16855  	// result: (SRLconst [56] (RBIT <typ.UInt64> x))
 16856  	for {
 16857  		x := v_0
 16858  		v.reset(OpARM64SRLconst)
 16859  		v.AuxInt = int64ToAuxInt(56)
 16860  		v0 := b.NewValue0(v.Pos, OpARM64RBIT, typ.UInt64)
 16861  		v0.AddArg(x)
 16862  		v.AddArg(v0)
 16863  		return true
 16864  	}
 16865  }
 16866  func rewriteValueARM64_OpCondSelect(v *Value) bool {
 16867  	v_2 := v.Args[2]
 16868  	v_1 := v.Args[1]
 16869  	v_0 := v.Args[0]
 16870  	b := v.Block
 16871  	// match: (CondSelect x y boolval)
 16872  	// cond: flagArg(boolval) != nil
 16873  	// result: (CSEL [boolval.Op] x y flagArg(boolval))
 16874  	for {
 16875  		x := v_0
 16876  		y := v_1
 16877  		boolval := v_2
 16878  		if !(flagArg(boolval) != nil) {
 16879  			break
 16880  		}
 16881  		v.reset(OpARM64CSEL)
 16882  		v.AuxInt = opToAuxInt(boolval.Op)
 16883  		v.AddArg3(x, y, flagArg(boolval))
 16884  		return true
 16885  	}
 16886  	// match: (CondSelect x y boolval)
 16887  	// cond: flagArg(boolval) == nil
 16888  	// result: (CSEL [OpARM64NotEqual] x y (TSTWconst [1] boolval))
 16889  	for {
 16890  		x := v_0
 16891  		y := v_1
 16892  		boolval := v_2
 16893  		if !(flagArg(boolval) == nil) {
 16894  			break
 16895  		}
 16896  		v.reset(OpARM64CSEL)
 16897  		v.AuxInt = opToAuxInt(OpARM64NotEqual)
 16898  		v0 := b.NewValue0(v.Pos, OpARM64TSTWconst, types.TypeFlags)
 16899  		v0.AuxInt = int32ToAuxInt(1)
 16900  		v0.AddArg(boolval)
 16901  		v.AddArg3(x, y, v0)
 16902  		return true
 16903  	}
 16904  	return false
 16905  }
 16906  func rewriteValueARM64_OpConst16(v *Value) bool {
 16907  	// match: (Const16 [val])
 16908  	// result: (MOVDconst [int64(val)])
 16909  	for {
 16910  		val := auxIntToInt16(v.AuxInt)
 16911  		v.reset(OpARM64MOVDconst)
 16912  		v.AuxInt = int64ToAuxInt(int64(val))
 16913  		return true
 16914  	}
 16915  }
 16916  func rewriteValueARM64_OpConst32(v *Value) bool {
 16917  	// match: (Const32 [val])
 16918  	// result: (MOVDconst [int64(val)])
 16919  	for {
 16920  		val := auxIntToInt32(v.AuxInt)
 16921  		v.reset(OpARM64MOVDconst)
 16922  		v.AuxInt = int64ToAuxInt(int64(val))
 16923  		return true
 16924  	}
 16925  }
 16926  func rewriteValueARM64_OpConst32F(v *Value) bool {
 16927  	// match: (Const32F [val])
 16928  	// result: (FMOVSconst [float64(val)])
 16929  	for {
 16930  		val := auxIntToFloat32(v.AuxInt)
 16931  		v.reset(OpARM64FMOVSconst)
 16932  		v.AuxInt = float64ToAuxInt(float64(val))
 16933  		return true
 16934  	}
 16935  }
 16936  func rewriteValueARM64_OpConst64(v *Value) bool {
 16937  	// match: (Const64 [val])
 16938  	// result: (MOVDconst [int64(val)])
 16939  	for {
 16940  		val := auxIntToInt64(v.AuxInt)
 16941  		v.reset(OpARM64MOVDconst)
 16942  		v.AuxInt = int64ToAuxInt(int64(val))
 16943  		return true
 16944  	}
 16945  }
 16946  func rewriteValueARM64_OpConst64F(v *Value) bool {
 16947  	// match: (Const64F [val])
 16948  	// result: (FMOVDconst [float64(val)])
 16949  	for {
 16950  		val := auxIntToFloat64(v.AuxInt)
 16951  		v.reset(OpARM64FMOVDconst)
 16952  		v.AuxInt = float64ToAuxInt(float64(val))
 16953  		return true
 16954  	}
 16955  }
 16956  func rewriteValueARM64_OpConst8(v *Value) bool {
 16957  	// match: (Const8 [val])
 16958  	// result: (MOVDconst [int64(val)])
 16959  	for {
 16960  		val := auxIntToInt8(v.AuxInt)
 16961  		v.reset(OpARM64MOVDconst)
 16962  		v.AuxInt = int64ToAuxInt(int64(val))
 16963  		return true
 16964  	}
 16965  }
 16966  func rewriteValueARM64_OpConstBool(v *Value) bool {
 16967  	// match: (ConstBool [t])
 16968  	// result: (MOVDconst [b2i(t)])
 16969  	for {
 16970  		t := auxIntToBool(v.AuxInt)
 16971  		v.reset(OpARM64MOVDconst)
 16972  		v.AuxInt = int64ToAuxInt(b2i(t))
 16973  		return true
 16974  	}
 16975  }
 16976  func rewriteValueARM64_OpConstNil(v *Value) bool {
 16977  	// match: (ConstNil)
 16978  	// result: (MOVDconst [0])
 16979  	for {
 16980  		v.reset(OpARM64MOVDconst)
 16981  		v.AuxInt = int64ToAuxInt(0)
 16982  		return true
 16983  	}
 16984  }
 16985  func rewriteValueARM64_OpCtz16(v *Value) bool {
 16986  	v_0 := v.Args[0]
 16987  	b := v.Block
 16988  	typ := &b.Func.Config.Types
 16989  	// match: (Ctz16 <t> x)
 16990  	// result: (CLZW <t> (RBITW <typ.UInt32> (ORconst <typ.UInt32> [0x10000] x)))
 16991  	for {
 16992  		t := v.Type
 16993  		x := v_0
 16994  		v.reset(OpARM64CLZW)
 16995  		v.Type = t
 16996  		v0 := b.NewValue0(v.Pos, OpARM64RBITW, typ.UInt32)
 16997  		v1 := b.NewValue0(v.Pos, OpARM64ORconst, typ.UInt32)
 16998  		v1.AuxInt = int64ToAuxInt(0x10000)
 16999  		v1.AddArg(x)
 17000  		v0.AddArg(v1)
 17001  		v.AddArg(v0)
 17002  		return true
 17003  	}
 17004  }
 17005  func rewriteValueARM64_OpCtz32(v *Value) bool {
 17006  	v_0 := v.Args[0]
 17007  	b := v.Block
 17008  	// match: (Ctz32 <t> x)
 17009  	// result: (CLZW (RBITW <t> x))
 17010  	for {
 17011  		t := v.Type
 17012  		x := v_0
 17013  		v.reset(OpARM64CLZW)
 17014  		v0 := b.NewValue0(v.Pos, OpARM64RBITW, t)
 17015  		v0.AddArg(x)
 17016  		v.AddArg(v0)
 17017  		return true
 17018  	}
 17019  }
 17020  func rewriteValueARM64_OpCtz64(v *Value) bool {
 17021  	v_0 := v.Args[0]
 17022  	b := v.Block
 17023  	// match: (Ctz64 <t> x)
 17024  	// result: (CLZ (RBIT <t> x))
 17025  	for {
 17026  		t := v.Type
 17027  		x := v_0
 17028  		v.reset(OpARM64CLZ)
 17029  		v0 := b.NewValue0(v.Pos, OpARM64RBIT, t)
 17030  		v0.AddArg(x)
 17031  		v.AddArg(v0)
 17032  		return true
 17033  	}
 17034  }
 17035  func rewriteValueARM64_OpCtz8(v *Value) bool {
 17036  	v_0 := v.Args[0]
 17037  	b := v.Block
 17038  	typ := &b.Func.Config.Types
 17039  	// match: (Ctz8 <t> x)
 17040  	// result: (CLZW <t> (RBITW <typ.UInt32> (ORconst <typ.UInt32> [0x100] x)))
 17041  	for {
 17042  		t := v.Type
 17043  		x := v_0
 17044  		v.reset(OpARM64CLZW)
 17045  		v.Type = t
 17046  		v0 := b.NewValue0(v.Pos, OpARM64RBITW, typ.UInt32)
 17047  		v1 := b.NewValue0(v.Pos, OpARM64ORconst, typ.UInt32)
 17048  		v1.AuxInt = int64ToAuxInt(0x100)
 17049  		v1.AddArg(x)
 17050  		v0.AddArg(v1)
 17051  		v.AddArg(v0)
 17052  		return true
 17053  	}
 17054  }
 17055  func rewriteValueARM64_OpDiv16(v *Value) bool {
 17056  	v_1 := v.Args[1]
 17057  	v_0 := v.Args[0]
 17058  	b := v.Block
 17059  	typ := &b.Func.Config.Types
 17060  	// match: (Div16 [false] x y)
 17061  	// result: (DIVW (SignExt16to32 x) (SignExt16to32 y))
 17062  	for {
 17063  		if auxIntToBool(v.AuxInt) != false {
 17064  			break
 17065  		}
 17066  		x := v_0
 17067  		y := v_1
 17068  		v.reset(OpARM64DIVW)
 17069  		v0 := b.NewValue0(v.Pos, OpSignExt16to32, typ.Int32)
 17070  		v0.AddArg(x)
 17071  		v1 := b.NewValue0(v.Pos, OpSignExt16to32, typ.Int32)
 17072  		v1.AddArg(y)
 17073  		v.AddArg2(v0, v1)
 17074  		return true
 17075  	}
 17076  	return false
 17077  }
 17078  func rewriteValueARM64_OpDiv16u(v *Value) bool {
 17079  	v_1 := v.Args[1]
 17080  	v_0 := v.Args[0]
 17081  	b := v.Block
 17082  	typ := &b.Func.Config.Types
 17083  	// match: (Div16u x y)
 17084  	// result: (UDIVW (ZeroExt16to32 x) (ZeroExt16to32 y))
 17085  	for {
 17086  		x := v_0
 17087  		y := v_1
 17088  		v.reset(OpARM64UDIVW)
 17089  		v0 := b.NewValue0(v.Pos, OpZeroExt16to32, typ.UInt32)
 17090  		v0.AddArg(x)
 17091  		v1 := b.NewValue0(v.Pos, OpZeroExt16to32, typ.UInt32)
 17092  		v1.AddArg(y)
 17093  		v.AddArg2(v0, v1)
 17094  		return true
 17095  	}
 17096  }
 17097  func rewriteValueARM64_OpDiv32(v *Value) bool {
 17098  	v_1 := v.Args[1]
 17099  	v_0 := v.Args[0]
 17100  	// match: (Div32 [false] x y)
 17101  	// result: (DIVW x y)
 17102  	for {
 17103  		if auxIntToBool(v.AuxInt) != false {
 17104  			break
 17105  		}
 17106  		x := v_0
 17107  		y := v_1
 17108  		v.reset(OpARM64DIVW)
 17109  		v.AddArg2(x, y)
 17110  		return true
 17111  	}
 17112  	return false
 17113  }
 17114  func rewriteValueARM64_OpDiv64(v *Value) bool {
 17115  	v_1 := v.Args[1]
 17116  	v_0 := v.Args[0]
 17117  	// match: (Div64 [false] x y)
 17118  	// result: (DIV x y)
 17119  	for {
 17120  		if auxIntToBool(v.AuxInt) != false {
 17121  			break
 17122  		}
 17123  		x := v_0
 17124  		y := v_1
 17125  		v.reset(OpARM64DIV)
 17126  		v.AddArg2(x, y)
 17127  		return true
 17128  	}
 17129  	return false
 17130  }
 17131  func rewriteValueARM64_OpDiv8(v *Value) bool {
 17132  	v_1 := v.Args[1]
 17133  	v_0 := v.Args[0]
 17134  	b := v.Block
 17135  	typ := &b.Func.Config.Types
 17136  	// match: (Div8 x y)
 17137  	// result: (DIVW (SignExt8to32 x) (SignExt8to32 y))
 17138  	for {
 17139  		x := v_0
 17140  		y := v_1
 17141  		v.reset(OpARM64DIVW)
 17142  		v0 := b.NewValue0(v.Pos, OpSignExt8to32, typ.Int32)
 17143  		v0.AddArg(x)
 17144  		v1 := b.NewValue0(v.Pos, OpSignExt8to32, typ.Int32)
 17145  		v1.AddArg(y)
 17146  		v.AddArg2(v0, v1)
 17147  		return true
 17148  	}
 17149  }
 17150  func rewriteValueARM64_OpDiv8u(v *Value) bool {
 17151  	v_1 := v.Args[1]
 17152  	v_0 := v.Args[0]
 17153  	b := v.Block
 17154  	typ := &b.Func.Config.Types
 17155  	// match: (Div8u x y)
 17156  	// result: (UDIVW (ZeroExt8to32 x) (ZeroExt8to32 y))
 17157  	for {
 17158  		x := v_0
 17159  		y := v_1
 17160  		v.reset(OpARM64UDIVW)
 17161  		v0 := b.NewValue0(v.Pos, OpZeroExt8to32, typ.UInt32)
 17162  		v0.AddArg(x)
 17163  		v1 := b.NewValue0(v.Pos, OpZeroExt8to32, typ.UInt32)
 17164  		v1.AddArg(y)
 17165  		v.AddArg2(v0, v1)
 17166  		return true
 17167  	}
 17168  }
 17169  func rewriteValueARM64_OpEq16(v *Value) bool {
 17170  	v_1 := v.Args[1]
 17171  	v_0 := v.Args[0]
 17172  	b := v.Block
 17173  	typ := &b.Func.Config.Types
 17174  	// match: (Eq16 x y)
 17175  	// result: (Equal (CMPW (ZeroExt16to32 x) (ZeroExt16to32 y)))
 17176  	for {
 17177  		x := v_0
 17178  		y := v_1
 17179  		v.reset(OpARM64Equal)
 17180  		v0 := b.NewValue0(v.Pos, OpARM64CMPW, types.TypeFlags)
 17181  		v1 := b.NewValue0(v.Pos, OpZeroExt16to32, typ.UInt32)
 17182  		v1.AddArg(x)
 17183  		v2 := b.NewValue0(v.Pos, OpZeroExt16to32, typ.UInt32)
 17184  		v2.AddArg(y)
 17185  		v0.AddArg2(v1, v2)
 17186  		v.AddArg(v0)
 17187  		return true
 17188  	}
 17189  }
 17190  func rewriteValueARM64_OpEq32(v *Value) bool {
 17191  	v_1 := v.Args[1]
 17192  	v_0 := v.Args[0]
 17193  	b := v.Block
 17194  	// match: (Eq32 x y)
 17195  	// result: (Equal (CMPW x y))
 17196  	for {
 17197  		x := v_0
 17198  		y := v_1
 17199  		v.reset(OpARM64Equal)
 17200  		v0 := b.NewValue0(v.Pos, OpARM64CMPW, types.TypeFlags)
 17201  		v0.AddArg2(x, y)
 17202  		v.AddArg(v0)
 17203  		return true
 17204  	}
 17205  }
 17206  func rewriteValueARM64_OpEq32F(v *Value) bool {
 17207  	v_1 := v.Args[1]
 17208  	v_0 := v.Args[0]
 17209  	b := v.Block
 17210  	// match: (Eq32F x y)
 17211  	// result: (Equal (FCMPS x y))
 17212  	for {
 17213  		x := v_0
 17214  		y := v_1
 17215  		v.reset(OpARM64Equal)
 17216  		v0 := b.NewValue0(v.Pos, OpARM64FCMPS, types.TypeFlags)
 17217  		v0.AddArg2(x, y)
 17218  		v.AddArg(v0)
 17219  		return true
 17220  	}
 17221  }
 17222  func rewriteValueARM64_OpEq64(v *Value) bool {
 17223  	v_1 := v.Args[1]
 17224  	v_0 := v.Args[0]
 17225  	b := v.Block
 17226  	// match: (Eq64 x y)
 17227  	// result: (Equal (CMP x y))
 17228  	for {
 17229  		x := v_0
 17230  		y := v_1
 17231  		v.reset(OpARM64Equal)
 17232  		v0 := b.NewValue0(v.Pos, OpARM64CMP, types.TypeFlags)
 17233  		v0.AddArg2(x, y)
 17234  		v.AddArg(v0)
 17235  		return true
 17236  	}
 17237  }
 17238  func rewriteValueARM64_OpEq64F(v *Value) bool {
 17239  	v_1 := v.Args[1]
 17240  	v_0 := v.Args[0]
 17241  	b := v.Block
 17242  	// match: (Eq64F x y)
 17243  	// result: (Equal (FCMPD x y))
 17244  	for {
 17245  		x := v_0
 17246  		y := v_1
 17247  		v.reset(OpARM64Equal)
 17248  		v0 := b.NewValue0(v.Pos, OpARM64FCMPD, types.TypeFlags)
 17249  		v0.AddArg2(x, y)
 17250  		v.AddArg(v0)
 17251  		return true
 17252  	}
 17253  }
 17254  func rewriteValueARM64_OpEq8(v *Value) bool {
 17255  	v_1 := v.Args[1]
 17256  	v_0 := v.Args[0]
 17257  	b := v.Block
 17258  	typ := &b.Func.Config.Types
 17259  	// match: (Eq8 x y)
 17260  	// result: (Equal (CMPW (ZeroExt8to32 x) (ZeroExt8to32 y)))
 17261  	for {
 17262  		x := v_0
 17263  		y := v_1
 17264  		v.reset(OpARM64Equal)
 17265  		v0 := b.NewValue0(v.Pos, OpARM64CMPW, types.TypeFlags)
 17266  		v1 := b.NewValue0(v.Pos, OpZeroExt8to32, typ.UInt32)
 17267  		v1.AddArg(x)
 17268  		v2 := b.NewValue0(v.Pos, OpZeroExt8to32, typ.UInt32)
 17269  		v2.AddArg(y)
 17270  		v0.AddArg2(v1, v2)
 17271  		v.AddArg(v0)
 17272  		return true
 17273  	}
 17274  }
 17275  func rewriteValueARM64_OpEqB(v *Value) bool {
 17276  	v_1 := v.Args[1]
 17277  	v_0 := v.Args[0]
 17278  	b := v.Block
 17279  	typ := &b.Func.Config.Types
 17280  	// match: (EqB x y)
 17281  	// result: (XOR (MOVDconst [1]) (XOR <typ.Bool> x y))
 17282  	for {
 17283  		x := v_0
 17284  		y := v_1
 17285  		v.reset(OpARM64XOR)
 17286  		v0 := b.NewValue0(v.Pos, OpARM64MOVDconst, typ.UInt64)
 17287  		v0.AuxInt = int64ToAuxInt(1)
 17288  		v1 := b.NewValue0(v.Pos, OpARM64XOR, typ.Bool)
 17289  		v1.AddArg2(x, y)
 17290  		v.AddArg2(v0, v1)
 17291  		return true
 17292  	}
 17293  }
 17294  func rewriteValueARM64_OpEqPtr(v *Value) bool {
 17295  	v_1 := v.Args[1]
 17296  	v_0 := v.Args[0]
 17297  	b := v.Block
 17298  	// match: (EqPtr x y)
 17299  	// result: (Equal (CMP x y))
 17300  	for {
 17301  		x := v_0
 17302  		y := v_1
 17303  		v.reset(OpARM64Equal)
 17304  		v0 := b.NewValue0(v.Pos, OpARM64CMP, types.TypeFlags)
 17305  		v0.AddArg2(x, y)
 17306  		v.AddArg(v0)
 17307  		return true
 17308  	}
 17309  }
 17310  func rewriteValueARM64_OpFMA(v *Value) bool {
 17311  	v_2 := v.Args[2]
 17312  	v_1 := v.Args[1]
 17313  	v_0 := v.Args[0]
 17314  	// match: (FMA x y z)
 17315  	// result: (FMADDD z x y)
 17316  	for {
 17317  		x := v_0
 17318  		y := v_1
 17319  		z := v_2
 17320  		v.reset(OpARM64FMADDD)
 17321  		v.AddArg3(z, x, y)
 17322  		return true
 17323  	}
 17324  }
 17325  func rewriteValueARM64_OpHmul32(v *Value) bool {
 17326  	v_1 := v.Args[1]
 17327  	v_0 := v.Args[0]
 17328  	b := v.Block
 17329  	typ := &b.Func.Config.Types
 17330  	// match: (Hmul32 x y)
 17331  	// result: (SRAconst (MULL <typ.Int64> x y) [32])
 17332  	for {
 17333  		x := v_0
 17334  		y := v_1
 17335  		v.reset(OpARM64SRAconst)
 17336  		v.AuxInt = int64ToAuxInt(32)
 17337  		v0 := b.NewValue0(v.Pos, OpARM64MULL, typ.Int64)
 17338  		v0.AddArg2(x, y)
 17339  		v.AddArg(v0)
 17340  		return true
 17341  	}
 17342  }
 17343  func rewriteValueARM64_OpHmul32u(v *Value) bool {
 17344  	v_1 := v.Args[1]
 17345  	v_0 := v.Args[0]
 17346  	b := v.Block
 17347  	typ := &b.Func.Config.Types
 17348  	// match: (Hmul32u x y)
 17349  	// result: (SRAconst (UMULL <typ.UInt64> x y) [32])
 17350  	for {
 17351  		x := v_0
 17352  		y := v_1
 17353  		v.reset(OpARM64SRAconst)
 17354  		v.AuxInt = int64ToAuxInt(32)
 17355  		v0 := b.NewValue0(v.Pos, OpARM64UMULL, typ.UInt64)
 17356  		v0.AddArg2(x, y)
 17357  		v.AddArg(v0)
 17358  		return true
 17359  	}
 17360  }
 17361  func rewriteValueARM64_OpIsInBounds(v *Value) bool {
 17362  	v_1 := v.Args[1]
 17363  	v_0 := v.Args[0]
 17364  	b := v.Block
 17365  	// match: (IsInBounds idx len)
 17366  	// result: (LessThanU (CMP idx len))
 17367  	for {
 17368  		idx := v_0
 17369  		len := v_1
 17370  		v.reset(OpARM64LessThanU)
 17371  		v0 := b.NewValue0(v.Pos, OpARM64CMP, types.TypeFlags)
 17372  		v0.AddArg2(idx, len)
 17373  		v.AddArg(v0)
 17374  		return true
 17375  	}
 17376  }
 17377  func rewriteValueARM64_OpIsNonNil(v *Value) bool {
 17378  	v_0 := v.Args[0]
 17379  	b := v.Block
 17380  	// match: (IsNonNil ptr)
 17381  	// result: (NotEqual (CMPconst [0] ptr))
 17382  	for {
 17383  		ptr := v_0
 17384  		v.reset(OpARM64NotEqual)
 17385  		v0 := b.NewValue0(v.Pos, OpARM64CMPconst, types.TypeFlags)
 17386  		v0.AuxInt = int64ToAuxInt(0)
 17387  		v0.AddArg(ptr)
 17388  		v.AddArg(v0)
 17389  		return true
 17390  	}
 17391  }
 17392  func rewriteValueARM64_OpIsSliceInBounds(v *Value) bool {
 17393  	v_1 := v.Args[1]
 17394  	v_0 := v.Args[0]
 17395  	b := v.Block
 17396  	// match: (IsSliceInBounds idx len)
 17397  	// result: (LessEqualU (CMP idx len))
 17398  	for {
 17399  		idx := v_0
 17400  		len := v_1
 17401  		v.reset(OpARM64LessEqualU)
 17402  		v0 := b.NewValue0(v.Pos, OpARM64CMP, types.TypeFlags)
 17403  		v0.AddArg2(idx, len)
 17404  		v.AddArg(v0)
 17405  		return true
 17406  	}
 17407  }
 17408  func rewriteValueARM64_OpLeq16(v *Value) bool {
 17409  	v_1 := v.Args[1]
 17410  	v_0 := v.Args[0]
 17411  	b := v.Block
 17412  	typ := &b.Func.Config.Types
 17413  	// match: (Leq16 x y)
 17414  	// result: (LessEqual (CMPW (SignExt16to32 x) (SignExt16to32 y)))
 17415  	for {
 17416  		x := v_0
 17417  		y := v_1
 17418  		v.reset(OpARM64LessEqual)
 17419  		v0 := b.NewValue0(v.Pos, OpARM64CMPW, types.TypeFlags)
 17420  		v1 := b.NewValue0(v.Pos, OpSignExt16to32, typ.Int32)
 17421  		v1.AddArg(x)
 17422  		v2 := b.NewValue0(v.Pos, OpSignExt16to32, typ.Int32)
 17423  		v2.AddArg(y)
 17424  		v0.AddArg2(v1, v2)
 17425  		v.AddArg(v0)
 17426  		return true
 17427  	}
 17428  }
 17429  func rewriteValueARM64_OpLeq16U(v *Value) bool {
 17430  	v_1 := v.Args[1]
 17431  	v_0 := v.Args[0]
 17432  	b := v.Block
 17433  	typ := &b.Func.Config.Types
 17434  	// match: (Leq16U x zero:(MOVDconst [0]))
 17435  	// result: (Eq16 x zero)
 17436  	for {
 17437  		x := v_0
 17438  		zero := v_1
 17439  		if zero.Op != OpARM64MOVDconst || auxIntToInt64(zero.AuxInt) != 0 {
 17440  			break
 17441  		}
 17442  		v.reset(OpEq16)
 17443  		v.AddArg2(x, zero)
 17444  		return true
 17445  	}
 17446  	// match: (Leq16U (MOVDconst [1]) x)
 17447  	// result: (Neq16 (MOVDconst [0]) x)
 17448  	for {
 17449  		if v_0.Op != OpARM64MOVDconst || auxIntToInt64(v_0.AuxInt) != 1 {
 17450  			break
 17451  		}
 17452  		x := v_1
 17453  		v.reset(OpNeq16)
 17454  		v0 := b.NewValue0(v.Pos, OpARM64MOVDconst, typ.UInt64)
 17455  		v0.AuxInt = int64ToAuxInt(0)
 17456  		v.AddArg2(v0, x)
 17457  		return true
 17458  	}
 17459  	// match: (Leq16U x y)
 17460  	// result: (LessEqualU (CMPW (ZeroExt16to32 x) (ZeroExt16to32 y)))
 17461  	for {
 17462  		x := v_0
 17463  		y := v_1
 17464  		v.reset(OpARM64LessEqualU)
 17465  		v0 := b.NewValue0(v.Pos, OpARM64CMPW, types.TypeFlags)
 17466  		v1 := b.NewValue0(v.Pos, OpZeroExt16to32, typ.UInt32)
 17467  		v1.AddArg(x)
 17468  		v2 := b.NewValue0(v.Pos, OpZeroExt16to32, typ.UInt32)
 17469  		v2.AddArg(y)
 17470  		v0.AddArg2(v1, v2)
 17471  		v.AddArg(v0)
 17472  		return true
 17473  	}
 17474  }
 17475  func rewriteValueARM64_OpLeq32(v *Value) bool {
 17476  	v_1 := v.Args[1]
 17477  	v_0 := v.Args[0]
 17478  	b := v.Block
 17479  	// match: (Leq32 x y)
 17480  	// result: (LessEqual (CMPW x y))
 17481  	for {
 17482  		x := v_0
 17483  		y := v_1
 17484  		v.reset(OpARM64LessEqual)
 17485  		v0 := b.NewValue0(v.Pos, OpARM64CMPW, types.TypeFlags)
 17486  		v0.AddArg2(x, y)
 17487  		v.AddArg(v0)
 17488  		return true
 17489  	}
 17490  }
 17491  func rewriteValueARM64_OpLeq32F(v *Value) bool {
 17492  	v_1 := v.Args[1]
 17493  	v_0 := v.Args[0]
 17494  	b := v.Block
 17495  	// match: (Leq32F x y)
 17496  	// result: (LessEqualF (FCMPS x y))
 17497  	for {
 17498  		x := v_0
 17499  		y := v_1
 17500  		v.reset(OpARM64LessEqualF)
 17501  		v0 := b.NewValue0(v.Pos, OpARM64FCMPS, types.TypeFlags)
 17502  		v0.AddArg2(x, y)
 17503  		v.AddArg(v0)
 17504  		return true
 17505  	}
 17506  }
 17507  func rewriteValueARM64_OpLeq32U(v *Value) bool {
 17508  	v_1 := v.Args[1]
 17509  	v_0 := v.Args[0]
 17510  	b := v.Block
 17511  	typ := &b.Func.Config.Types
 17512  	// match: (Leq32U x zero:(MOVDconst [0]))
 17513  	// result: (Eq32 x zero)
 17514  	for {
 17515  		x := v_0
 17516  		zero := v_1
 17517  		if zero.Op != OpARM64MOVDconst || auxIntToInt64(zero.AuxInt) != 0 {
 17518  			break
 17519  		}
 17520  		v.reset(OpEq32)
 17521  		v.AddArg2(x, zero)
 17522  		return true
 17523  	}
 17524  	// match: (Leq32U (MOVDconst [1]) x)
 17525  	// result: (Neq32 (MOVDconst [0]) x)
 17526  	for {
 17527  		if v_0.Op != OpARM64MOVDconst || auxIntToInt64(v_0.AuxInt) != 1 {
 17528  			break
 17529  		}
 17530  		x := v_1
 17531  		v.reset(OpNeq32)
 17532  		v0 := b.NewValue0(v.Pos, OpARM64MOVDconst, typ.UInt64)
 17533  		v0.AuxInt = int64ToAuxInt(0)
 17534  		v.AddArg2(v0, x)
 17535  		return true
 17536  	}
 17537  	// match: (Leq32U x y)
 17538  	// result: (LessEqualU (CMPW x y))
 17539  	for {
 17540  		x := v_0
 17541  		y := v_1
 17542  		v.reset(OpARM64LessEqualU)
 17543  		v0 := b.NewValue0(v.Pos, OpARM64CMPW, types.TypeFlags)
 17544  		v0.AddArg2(x, y)
 17545  		v.AddArg(v0)
 17546  		return true
 17547  	}
 17548  }
 17549  func rewriteValueARM64_OpLeq64(v *Value) bool {
 17550  	v_1 := v.Args[1]
 17551  	v_0 := v.Args[0]
 17552  	b := v.Block
 17553  	// match: (Leq64 x y)
 17554  	// result: (LessEqual (CMP x y))
 17555  	for {
 17556  		x := v_0
 17557  		y := v_1
 17558  		v.reset(OpARM64LessEqual)
 17559  		v0 := b.NewValue0(v.Pos, OpARM64CMP, types.TypeFlags)
 17560  		v0.AddArg2(x, y)
 17561  		v.AddArg(v0)
 17562  		return true
 17563  	}
 17564  }
 17565  func rewriteValueARM64_OpLeq64F(v *Value) bool {
 17566  	v_1 := v.Args[1]
 17567  	v_0 := v.Args[0]
 17568  	b := v.Block
 17569  	// match: (Leq64F x y)
 17570  	// result: (LessEqualF (FCMPD x y))
 17571  	for {
 17572  		x := v_0
 17573  		y := v_1
 17574  		v.reset(OpARM64LessEqualF)
 17575  		v0 := b.NewValue0(v.Pos, OpARM64FCMPD, types.TypeFlags)
 17576  		v0.AddArg2(x, y)
 17577  		v.AddArg(v0)
 17578  		return true
 17579  	}
 17580  }
 17581  func rewriteValueARM64_OpLeq64U(v *Value) bool {
 17582  	v_1 := v.Args[1]
 17583  	v_0 := v.Args[0]
 17584  	b := v.Block
 17585  	typ := &b.Func.Config.Types
 17586  	// match: (Leq64U x zero:(MOVDconst [0]))
 17587  	// result: (Eq64 x zero)
 17588  	for {
 17589  		x := v_0
 17590  		zero := v_1
 17591  		if zero.Op != OpARM64MOVDconst || auxIntToInt64(zero.AuxInt) != 0 {
 17592  			break
 17593  		}
 17594  		v.reset(OpEq64)
 17595  		v.AddArg2(x, zero)
 17596  		return true
 17597  	}
 17598  	// match: (Leq64U (MOVDconst [1]) x)
 17599  	// result: (Neq64 (MOVDconst [0]) x)
 17600  	for {
 17601  		if v_0.Op != OpARM64MOVDconst || auxIntToInt64(v_0.AuxInt) != 1 {
 17602  			break
 17603  		}
 17604  		x := v_1
 17605  		v.reset(OpNeq64)
 17606  		v0 := b.NewValue0(v.Pos, OpARM64MOVDconst, typ.UInt64)
 17607  		v0.AuxInt = int64ToAuxInt(0)
 17608  		v.AddArg2(v0, x)
 17609  		return true
 17610  	}
 17611  	// match: (Leq64U x y)
 17612  	// result: (LessEqualU (CMP x y))
 17613  	for {
 17614  		x := v_0
 17615  		y := v_1
 17616  		v.reset(OpARM64LessEqualU)
 17617  		v0 := b.NewValue0(v.Pos, OpARM64CMP, types.TypeFlags)
 17618  		v0.AddArg2(x, y)
 17619  		v.AddArg(v0)
 17620  		return true
 17621  	}
 17622  }
 17623  func rewriteValueARM64_OpLeq8(v *Value) bool {
 17624  	v_1 := v.Args[1]
 17625  	v_0 := v.Args[0]
 17626  	b := v.Block
 17627  	typ := &b.Func.Config.Types
 17628  	// match: (Leq8 x y)
 17629  	// result: (LessEqual (CMPW (SignExt8to32 x) (SignExt8to32 y)))
 17630  	for {
 17631  		x := v_0
 17632  		y := v_1
 17633  		v.reset(OpARM64LessEqual)
 17634  		v0 := b.NewValue0(v.Pos, OpARM64CMPW, types.TypeFlags)
 17635  		v1 := b.NewValue0(v.Pos, OpSignExt8to32, typ.Int32)
 17636  		v1.AddArg(x)
 17637  		v2 := b.NewValue0(v.Pos, OpSignExt8to32, typ.Int32)
 17638  		v2.AddArg(y)
 17639  		v0.AddArg2(v1, v2)
 17640  		v.AddArg(v0)
 17641  		return true
 17642  	}
 17643  }
 17644  func rewriteValueARM64_OpLeq8U(v *Value) bool {
 17645  	v_1 := v.Args[1]
 17646  	v_0 := v.Args[0]
 17647  	b := v.Block
 17648  	typ := &b.Func.Config.Types
 17649  	// match: (Leq8U x zero:(MOVDconst [0]))
 17650  	// result: (Eq8 x zero)
 17651  	for {
 17652  		x := v_0
 17653  		zero := v_1
 17654  		if zero.Op != OpARM64MOVDconst || auxIntToInt64(zero.AuxInt) != 0 {
 17655  			break
 17656  		}
 17657  		v.reset(OpEq8)
 17658  		v.AddArg2(x, zero)
 17659  		return true
 17660  	}
 17661  	// match: (Leq8U (MOVDconst [1]) x)
 17662  	// result: (Neq8 (MOVDconst [0]) x)
 17663  	for {
 17664  		if v_0.Op != OpARM64MOVDconst || auxIntToInt64(v_0.AuxInt) != 1 {
 17665  			break
 17666  		}
 17667  		x := v_1
 17668  		v.reset(OpNeq8)
 17669  		v0 := b.NewValue0(v.Pos, OpARM64MOVDconst, typ.UInt64)
 17670  		v0.AuxInt = int64ToAuxInt(0)
 17671  		v.AddArg2(v0, x)
 17672  		return true
 17673  	}
 17674  	// match: (Leq8U x y)
 17675  	// result: (LessEqualU (CMPW (ZeroExt8to32 x) (ZeroExt8to32 y)))
 17676  	for {
 17677  		x := v_0
 17678  		y := v_1
 17679  		v.reset(OpARM64LessEqualU)
 17680  		v0 := b.NewValue0(v.Pos, OpARM64CMPW, types.TypeFlags)
 17681  		v1 := b.NewValue0(v.Pos, OpZeroExt8to32, typ.UInt32)
 17682  		v1.AddArg(x)
 17683  		v2 := b.NewValue0(v.Pos, OpZeroExt8to32, typ.UInt32)
 17684  		v2.AddArg(y)
 17685  		v0.AddArg2(v1, v2)
 17686  		v.AddArg(v0)
 17687  		return true
 17688  	}
 17689  }
 17690  func rewriteValueARM64_OpLess16(v *Value) bool {
 17691  	v_1 := v.Args[1]
 17692  	v_0 := v.Args[0]
 17693  	b := v.Block
 17694  	typ := &b.Func.Config.Types
 17695  	// match: (Less16 x y)
 17696  	// result: (LessThan (CMPW (SignExt16to32 x) (SignExt16to32 y)))
 17697  	for {
 17698  		x := v_0
 17699  		y := v_1
 17700  		v.reset(OpARM64LessThan)
 17701  		v0 := b.NewValue0(v.Pos, OpARM64CMPW, types.TypeFlags)
 17702  		v1 := b.NewValue0(v.Pos, OpSignExt16to32, typ.Int32)
 17703  		v1.AddArg(x)
 17704  		v2 := b.NewValue0(v.Pos, OpSignExt16to32, typ.Int32)
 17705  		v2.AddArg(y)
 17706  		v0.AddArg2(v1, v2)
 17707  		v.AddArg(v0)
 17708  		return true
 17709  	}
 17710  }
 17711  func rewriteValueARM64_OpLess16U(v *Value) bool {
 17712  	v_1 := v.Args[1]
 17713  	v_0 := v.Args[0]
 17714  	b := v.Block
 17715  	typ := &b.Func.Config.Types
 17716  	// match: (Less16U zero:(MOVDconst [0]) x)
 17717  	// result: (Neq16 zero x)
 17718  	for {
 17719  		zero := v_0
 17720  		if zero.Op != OpARM64MOVDconst || auxIntToInt64(zero.AuxInt) != 0 {
 17721  			break
 17722  		}
 17723  		x := v_1
 17724  		v.reset(OpNeq16)
 17725  		v.AddArg2(zero, x)
 17726  		return true
 17727  	}
 17728  	// match: (Less16U x (MOVDconst [1]))
 17729  	// result: (Eq16 x (MOVDconst [0]))
 17730  	for {
 17731  		x := v_0
 17732  		if v_1.Op != OpARM64MOVDconst || auxIntToInt64(v_1.AuxInt) != 1 {
 17733  			break
 17734  		}
 17735  		v.reset(OpEq16)
 17736  		v0 := b.NewValue0(v.Pos, OpARM64MOVDconst, typ.UInt64)
 17737  		v0.AuxInt = int64ToAuxInt(0)
 17738  		v.AddArg2(x, v0)
 17739  		return true
 17740  	}
 17741  	// match: (Less16U x y)
 17742  	// result: (LessThanU (CMPW (ZeroExt16to32 x) (ZeroExt16to32 y)))
 17743  	for {
 17744  		x := v_0
 17745  		y := v_1
 17746  		v.reset(OpARM64LessThanU)
 17747  		v0 := b.NewValue0(v.Pos, OpARM64CMPW, types.TypeFlags)
 17748  		v1 := b.NewValue0(v.Pos, OpZeroExt16to32, typ.UInt32)
 17749  		v1.AddArg(x)
 17750  		v2 := b.NewValue0(v.Pos, OpZeroExt16to32, typ.UInt32)
 17751  		v2.AddArg(y)
 17752  		v0.AddArg2(v1, v2)
 17753  		v.AddArg(v0)
 17754  		return true
 17755  	}
 17756  }
 17757  func rewriteValueARM64_OpLess32(v *Value) bool {
 17758  	v_1 := v.Args[1]
 17759  	v_0 := v.Args[0]
 17760  	b := v.Block
 17761  	// match: (Less32 x y)
 17762  	// result: (LessThan (CMPW x y))
 17763  	for {
 17764  		x := v_0
 17765  		y := v_1
 17766  		v.reset(OpARM64LessThan)
 17767  		v0 := b.NewValue0(v.Pos, OpARM64CMPW, types.TypeFlags)
 17768  		v0.AddArg2(x, y)
 17769  		v.AddArg(v0)
 17770  		return true
 17771  	}
 17772  }
 17773  func rewriteValueARM64_OpLess32F(v *Value) bool {
 17774  	v_1 := v.Args[1]
 17775  	v_0 := v.Args[0]
 17776  	b := v.Block
 17777  	// match: (Less32F x y)
 17778  	// result: (LessThanF (FCMPS x y))
 17779  	for {
 17780  		x := v_0
 17781  		y := v_1
 17782  		v.reset(OpARM64LessThanF)
 17783  		v0 := b.NewValue0(v.Pos, OpARM64FCMPS, types.TypeFlags)
 17784  		v0.AddArg2(x, y)
 17785  		v.AddArg(v0)
 17786  		return true
 17787  	}
 17788  }
 17789  func rewriteValueARM64_OpLess32U(v *Value) bool {
 17790  	v_1 := v.Args[1]
 17791  	v_0 := v.Args[0]
 17792  	b := v.Block
 17793  	typ := &b.Func.Config.Types
 17794  	// match: (Less32U zero:(MOVDconst [0]) x)
 17795  	// result: (Neq32 zero x)
 17796  	for {
 17797  		zero := v_0
 17798  		if zero.Op != OpARM64MOVDconst || auxIntToInt64(zero.AuxInt) != 0 {
 17799  			break
 17800  		}
 17801  		x := v_1
 17802  		v.reset(OpNeq32)
 17803  		v.AddArg2(zero, x)
 17804  		return true
 17805  	}
 17806  	// match: (Less32U x (MOVDconst [1]))
 17807  	// result: (Eq32 x (MOVDconst [0]))
 17808  	for {
 17809  		x := v_0
 17810  		if v_1.Op != OpARM64MOVDconst || auxIntToInt64(v_1.AuxInt) != 1 {
 17811  			break
 17812  		}
 17813  		v.reset(OpEq32)
 17814  		v0 := b.NewValue0(v.Pos, OpARM64MOVDconst, typ.UInt64)
 17815  		v0.AuxInt = int64ToAuxInt(0)
 17816  		v.AddArg2(x, v0)
 17817  		return true
 17818  	}
 17819  	// match: (Less32U x y)
 17820  	// result: (LessThanU (CMPW x y))
 17821  	for {
 17822  		x := v_0
 17823  		y := v_1
 17824  		v.reset(OpARM64LessThanU)
 17825  		v0 := b.NewValue0(v.Pos, OpARM64CMPW, types.TypeFlags)
 17826  		v0.AddArg2(x, y)
 17827  		v.AddArg(v0)
 17828  		return true
 17829  	}
 17830  }
 17831  func rewriteValueARM64_OpLess64(v *Value) bool {
 17832  	v_1 := v.Args[1]
 17833  	v_0 := v.Args[0]
 17834  	b := v.Block
 17835  	// match: (Less64 x y)
 17836  	// result: (LessThan (CMP x y))
 17837  	for {
 17838  		x := v_0
 17839  		y := v_1
 17840  		v.reset(OpARM64LessThan)
 17841  		v0 := b.NewValue0(v.Pos, OpARM64CMP, types.TypeFlags)
 17842  		v0.AddArg2(x, y)
 17843  		v.AddArg(v0)
 17844  		return true
 17845  	}
 17846  }
 17847  func rewriteValueARM64_OpLess64F(v *Value) bool {
 17848  	v_1 := v.Args[1]
 17849  	v_0 := v.Args[0]
 17850  	b := v.Block
 17851  	// match: (Less64F x y)
 17852  	// result: (LessThanF (FCMPD x y))
 17853  	for {
 17854  		x := v_0
 17855  		y := v_1
 17856  		v.reset(OpARM64LessThanF)
 17857  		v0 := b.NewValue0(v.Pos, OpARM64FCMPD, types.TypeFlags)
 17858  		v0.AddArg2(x, y)
 17859  		v.AddArg(v0)
 17860  		return true
 17861  	}
 17862  }
 17863  func rewriteValueARM64_OpLess64U(v *Value) bool {
 17864  	v_1 := v.Args[1]
 17865  	v_0 := v.Args[0]
 17866  	b := v.Block
 17867  	typ := &b.Func.Config.Types
 17868  	// match: (Less64U zero:(MOVDconst [0]) x)
 17869  	// result: (Neq64 zero x)
 17870  	for {
 17871  		zero := v_0
 17872  		if zero.Op != OpARM64MOVDconst || auxIntToInt64(zero.AuxInt) != 0 {
 17873  			break
 17874  		}
 17875  		x := v_1
 17876  		v.reset(OpNeq64)
 17877  		v.AddArg2(zero, x)
 17878  		return true
 17879  	}
 17880  	// match: (Less64U x (MOVDconst [1]))
 17881  	// result: (Eq64 x (MOVDconst [0]))
 17882  	for {
 17883  		x := v_0
 17884  		if v_1.Op != OpARM64MOVDconst || auxIntToInt64(v_1.AuxInt) != 1 {
 17885  			break
 17886  		}
 17887  		v.reset(OpEq64)
 17888  		v0 := b.NewValue0(v.Pos, OpARM64MOVDconst, typ.UInt64)
 17889  		v0.AuxInt = int64ToAuxInt(0)
 17890  		v.AddArg2(x, v0)
 17891  		return true
 17892  	}
 17893  	// match: (Less64U x y)
 17894  	// result: (LessThanU (CMP x y))
 17895  	for {
 17896  		x := v_0
 17897  		y := v_1
 17898  		v.reset(OpARM64LessThanU)
 17899  		v0 := b.NewValue0(v.Pos, OpARM64CMP, types.TypeFlags)
 17900  		v0.AddArg2(x, y)
 17901  		v.AddArg(v0)
 17902  		return true
 17903  	}
 17904  }
 17905  func rewriteValueARM64_OpLess8(v *Value) bool {
 17906  	v_1 := v.Args[1]
 17907  	v_0 := v.Args[0]
 17908  	b := v.Block
 17909  	typ := &b.Func.Config.Types
 17910  	// match: (Less8 x y)
 17911  	// result: (LessThan (CMPW (SignExt8to32 x) (SignExt8to32 y)))
 17912  	for {
 17913  		x := v_0
 17914  		y := v_1
 17915  		v.reset(OpARM64LessThan)
 17916  		v0 := b.NewValue0(v.Pos, OpARM64CMPW, types.TypeFlags)
 17917  		v1 := b.NewValue0(v.Pos, OpSignExt8to32, typ.Int32)
 17918  		v1.AddArg(x)
 17919  		v2 := b.NewValue0(v.Pos, OpSignExt8to32, typ.Int32)
 17920  		v2.AddArg(y)
 17921  		v0.AddArg2(v1, v2)
 17922  		v.AddArg(v0)
 17923  		return true
 17924  	}
 17925  }
 17926  func rewriteValueARM64_OpLess8U(v *Value) bool {
 17927  	v_1 := v.Args[1]
 17928  	v_0 := v.Args[0]
 17929  	b := v.Block
 17930  	typ := &b.Func.Config.Types
 17931  	// match: (Less8U zero:(MOVDconst [0]) x)
 17932  	// result: (Neq8 zero x)
 17933  	for {
 17934  		zero := v_0
 17935  		if zero.Op != OpARM64MOVDconst || auxIntToInt64(zero.AuxInt) != 0 {
 17936  			break
 17937  		}
 17938  		x := v_1
 17939  		v.reset(OpNeq8)
 17940  		v.AddArg2(zero, x)
 17941  		return true
 17942  	}
 17943  	// match: (Less8U x (MOVDconst [1]))
 17944  	// result: (Eq8 x (MOVDconst [0]))
 17945  	for {
 17946  		x := v_0
 17947  		if v_1.Op != OpARM64MOVDconst || auxIntToInt64(v_1.AuxInt) != 1 {
 17948  			break
 17949  		}
 17950  		v.reset(OpEq8)
 17951  		v0 := b.NewValue0(v.Pos, OpARM64MOVDconst, typ.UInt64)
 17952  		v0.AuxInt = int64ToAuxInt(0)
 17953  		v.AddArg2(x, v0)
 17954  		return true
 17955  	}
 17956  	// match: (Less8U x y)
 17957  	// result: (LessThanU (CMPW (ZeroExt8to32 x) (ZeroExt8to32 y)))
 17958  	for {
 17959  		x := v_0
 17960  		y := v_1
 17961  		v.reset(OpARM64LessThanU)
 17962  		v0 := b.NewValue0(v.Pos, OpARM64CMPW, types.TypeFlags)
 17963  		v1 := b.NewValue0(v.Pos, OpZeroExt8to32, typ.UInt32)
 17964  		v1.AddArg(x)
 17965  		v2 := b.NewValue0(v.Pos, OpZeroExt8to32, typ.UInt32)
 17966  		v2.AddArg(y)
 17967  		v0.AddArg2(v1, v2)
 17968  		v.AddArg(v0)
 17969  		return true
 17970  	}
 17971  }
 17972  func rewriteValueARM64_OpLoad(v *Value) bool {
 17973  	v_1 := v.Args[1]
 17974  	v_0 := v.Args[0]
 17975  	// match: (Load <t> ptr mem)
 17976  	// cond: t.IsBoolean()
 17977  	// result: (MOVBUload ptr mem)
 17978  	for {
 17979  		t := v.Type
 17980  		ptr := v_0
 17981  		mem := v_1
 17982  		if !(t.IsBoolean()) {
 17983  			break
 17984  		}
 17985  		v.reset(OpARM64MOVBUload)
 17986  		v.AddArg2(ptr, mem)
 17987  		return true
 17988  	}
 17989  	// match: (Load <t> ptr mem)
 17990  	// cond: (is8BitInt(t) && t.IsSigned())
 17991  	// result: (MOVBload ptr mem)
 17992  	for {
 17993  		t := v.Type
 17994  		ptr := v_0
 17995  		mem := v_1
 17996  		if !(is8BitInt(t) && t.IsSigned()) {
 17997  			break
 17998  		}
 17999  		v.reset(OpARM64MOVBload)
 18000  		v.AddArg2(ptr, mem)
 18001  		return true
 18002  	}
 18003  	// match: (Load <t> ptr mem)
 18004  	// cond: (is8BitInt(t) && !t.IsSigned())
 18005  	// result: (MOVBUload ptr mem)
 18006  	for {
 18007  		t := v.Type
 18008  		ptr := v_0
 18009  		mem := v_1
 18010  		if !(is8BitInt(t) && !t.IsSigned()) {
 18011  			break
 18012  		}
 18013  		v.reset(OpARM64MOVBUload)
 18014  		v.AddArg2(ptr, mem)
 18015  		return true
 18016  	}
 18017  	// match: (Load <t> ptr mem)
 18018  	// cond: (is16BitInt(t) && t.IsSigned())
 18019  	// result: (MOVHload ptr mem)
 18020  	for {
 18021  		t := v.Type
 18022  		ptr := v_0
 18023  		mem := v_1
 18024  		if !(is16BitInt(t) && t.IsSigned()) {
 18025  			break
 18026  		}
 18027  		v.reset(OpARM64MOVHload)
 18028  		v.AddArg2(ptr, mem)
 18029  		return true
 18030  	}
 18031  	// match: (Load <t> ptr mem)
 18032  	// cond: (is16BitInt(t) && !t.IsSigned())
 18033  	// result: (MOVHUload ptr mem)
 18034  	for {
 18035  		t := v.Type
 18036  		ptr := v_0
 18037  		mem := v_1
 18038  		if !(is16BitInt(t) && !t.IsSigned()) {
 18039  			break
 18040  		}
 18041  		v.reset(OpARM64MOVHUload)
 18042  		v.AddArg2(ptr, mem)
 18043  		return true
 18044  	}
 18045  	// match: (Load <t> ptr mem)
 18046  	// cond: (is32BitInt(t) && t.IsSigned())
 18047  	// result: (MOVWload ptr mem)
 18048  	for {
 18049  		t := v.Type
 18050  		ptr := v_0
 18051  		mem := v_1
 18052  		if !(is32BitInt(t) && t.IsSigned()) {
 18053  			break
 18054  		}
 18055  		v.reset(OpARM64MOVWload)
 18056  		v.AddArg2(ptr, mem)
 18057  		return true
 18058  	}
 18059  	// match: (Load <t> ptr mem)
 18060  	// cond: (is32BitInt(t) && !t.IsSigned())
 18061  	// result: (MOVWUload ptr mem)
 18062  	for {
 18063  		t := v.Type
 18064  		ptr := v_0
 18065  		mem := v_1
 18066  		if !(is32BitInt(t) && !t.IsSigned()) {
 18067  			break
 18068  		}
 18069  		v.reset(OpARM64MOVWUload)
 18070  		v.AddArg2(ptr, mem)
 18071  		return true
 18072  	}
 18073  	// match: (Load <t> ptr mem)
 18074  	// cond: (is64BitInt(t) || isPtr(t))
 18075  	// result: (MOVDload ptr mem)
 18076  	for {
 18077  		t := v.Type
 18078  		ptr := v_0
 18079  		mem := v_1
 18080  		if !(is64BitInt(t) || isPtr(t)) {
 18081  			break
 18082  		}
 18083  		v.reset(OpARM64MOVDload)
 18084  		v.AddArg2(ptr, mem)
 18085  		return true
 18086  	}
 18087  	// match: (Load <t> ptr mem)
 18088  	// cond: is32BitFloat(t)
 18089  	// result: (FMOVSload ptr mem)
 18090  	for {
 18091  		t := v.Type
 18092  		ptr := v_0
 18093  		mem := v_1
 18094  		if !(is32BitFloat(t)) {
 18095  			break
 18096  		}
 18097  		v.reset(OpARM64FMOVSload)
 18098  		v.AddArg2(ptr, mem)
 18099  		return true
 18100  	}
 18101  	// match: (Load <t> ptr mem)
 18102  	// cond: is64BitFloat(t)
 18103  	// result: (FMOVDload ptr mem)
 18104  	for {
 18105  		t := v.Type
 18106  		ptr := v_0
 18107  		mem := v_1
 18108  		if !(is64BitFloat(t)) {
 18109  			break
 18110  		}
 18111  		v.reset(OpARM64FMOVDload)
 18112  		v.AddArg2(ptr, mem)
 18113  		return true
 18114  	}
 18115  	return false
 18116  }
 18117  func rewriteValueARM64_OpLocalAddr(v *Value) bool {
 18118  	v_1 := v.Args[1]
 18119  	v_0 := v.Args[0]
 18120  	b := v.Block
 18121  	typ := &b.Func.Config.Types
 18122  	// match: (LocalAddr <t> {sym} base mem)
 18123  	// cond: t.Elem().HasPointers()
 18124  	// result: (MOVDaddr {sym} (SPanchored base mem))
 18125  	for {
 18126  		t := v.Type
 18127  		sym := auxToSym(v.Aux)
 18128  		base := v_0
 18129  		mem := v_1
 18130  		if !(t.Elem().HasPointers()) {
 18131  			break
 18132  		}
 18133  		v.reset(OpARM64MOVDaddr)
 18134  		v.Aux = symToAux(sym)
 18135  		v0 := b.NewValue0(v.Pos, OpSPanchored, typ.Uintptr)
 18136  		v0.AddArg2(base, mem)
 18137  		v.AddArg(v0)
 18138  		return true
 18139  	}
 18140  	// match: (LocalAddr <t> {sym} base _)
 18141  	// cond: !t.Elem().HasPointers()
 18142  	// result: (MOVDaddr {sym} base)
 18143  	for {
 18144  		t := v.Type
 18145  		sym := auxToSym(v.Aux)
 18146  		base := v_0
 18147  		if !(!t.Elem().HasPointers()) {
 18148  			break
 18149  		}
 18150  		v.reset(OpARM64MOVDaddr)
 18151  		v.Aux = symToAux(sym)
 18152  		v.AddArg(base)
 18153  		return true
 18154  	}
 18155  	return false
 18156  }
 18157  func rewriteValueARM64_OpLsh16x16(v *Value) bool {
 18158  	v_1 := v.Args[1]
 18159  	v_0 := v.Args[0]
 18160  	b := v.Block
 18161  	typ := &b.Func.Config.Types
 18162  	// match: (Lsh16x16 <t> x y)
 18163  	// cond: shiftIsBounded(v)
 18164  	// result: (SLL <t> x y)
 18165  	for {
 18166  		t := v.Type
 18167  		x := v_0
 18168  		y := v_1
 18169  		if !(shiftIsBounded(v)) {
 18170  			break
 18171  		}
 18172  		v.reset(OpARM64SLL)
 18173  		v.Type = t
 18174  		v.AddArg2(x, y)
 18175  		return true
 18176  	}
 18177  	// match: (Lsh16x16 <t> x y)
 18178  	// cond: !shiftIsBounded(v)
 18179  	// result: (CSEL [OpARM64LessThanU] (SLL <t> x y) (Const64 <t> [0]) (CMPconst [64] (ZeroExt16to64 y)))
 18180  	for {
 18181  		t := v.Type
 18182  		x := v_0
 18183  		y := v_1
 18184  		if !(!shiftIsBounded(v)) {
 18185  			break
 18186  		}
 18187  		v.reset(OpARM64CSEL)
 18188  		v.AuxInt = opToAuxInt(OpARM64LessThanU)
 18189  		v0 := b.NewValue0(v.Pos, OpARM64SLL, t)
 18190  		v0.AddArg2(x, y)
 18191  		v1 := b.NewValue0(v.Pos, OpConst64, t)
 18192  		v1.AuxInt = int64ToAuxInt(0)
 18193  		v2 := b.NewValue0(v.Pos, OpARM64CMPconst, types.TypeFlags)
 18194  		v2.AuxInt = int64ToAuxInt(64)
 18195  		v3 := b.NewValue0(v.Pos, OpZeroExt16to64, typ.UInt64)
 18196  		v3.AddArg(y)
 18197  		v2.AddArg(v3)
 18198  		v.AddArg3(v0, v1, v2)
 18199  		return true
 18200  	}
 18201  	return false
 18202  }
 18203  func rewriteValueARM64_OpLsh16x32(v *Value) bool {
 18204  	v_1 := v.Args[1]
 18205  	v_0 := v.Args[0]
 18206  	b := v.Block
 18207  	typ := &b.Func.Config.Types
 18208  	// match: (Lsh16x32 <t> x y)
 18209  	// cond: shiftIsBounded(v)
 18210  	// result: (SLL <t> x y)
 18211  	for {
 18212  		t := v.Type
 18213  		x := v_0
 18214  		y := v_1
 18215  		if !(shiftIsBounded(v)) {
 18216  			break
 18217  		}
 18218  		v.reset(OpARM64SLL)
 18219  		v.Type = t
 18220  		v.AddArg2(x, y)
 18221  		return true
 18222  	}
 18223  	// match: (Lsh16x32 <t> x y)
 18224  	// cond: !shiftIsBounded(v)
 18225  	// result: (CSEL [OpARM64LessThanU] (SLL <t> x y) (Const64 <t> [0]) (CMPconst [64] (ZeroExt32to64 y)))
 18226  	for {
 18227  		t := v.Type
 18228  		x := v_0
 18229  		y := v_1
 18230  		if !(!shiftIsBounded(v)) {
 18231  			break
 18232  		}
 18233  		v.reset(OpARM64CSEL)
 18234  		v.AuxInt = opToAuxInt(OpARM64LessThanU)
 18235  		v0 := b.NewValue0(v.Pos, OpARM64SLL, t)
 18236  		v0.AddArg2(x, y)
 18237  		v1 := b.NewValue0(v.Pos, OpConst64, t)
 18238  		v1.AuxInt = int64ToAuxInt(0)
 18239  		v2 := b.NewValue0(v.Pos, OpARM64CMPconst, types.TypeFlags)
 18240  		v2.AuxInt = int64ToAuxInt(64)
 18241  		v3 := b.NewValue0(v.Pos, OpZeroExt32to64, typ.UInt64)
 18242  		v3.AddArg(y)
 18243  		v2.AddArg(v3)
 18244  		v.AddArg3(v0, v1, v2)
 18245  		return true
 18246  	}
 18247  	return false
 18248  }
 18249  func rewriteValueARM64_OpLsh16x64(v *Value) bool {
 18250  	v_1 := v.Args[1]
 18251  	v_0 := v.Args[0]
 18252  	b := v.Block
 18253  	// match: (Lsh16x64 <t> x y)
 18254  	// cond: shiftIsBounded(v)
 18255  	// result: (SLL <t> x y)
 18256  	for {
 18257  		t := v.Type
 18258  		x := v_0
 18259  		y := v_1
 18260  		if !(shiftIsBounded(v)) {
 18261  			break
 18262  		}
 18263  		v.reset(OpARM64SLL)
 18264  		v.Type = t
 18265  		v.AddArg2(x, y)
 18266  		return true
 18267  	}
 18268  	// match: (Lsh16x64 <t> x y)
 18269  	// cond: !shiftIsBounded(v)
 18270  	// result: (CSEL [OpARM64LessThanU] (SLL <t> x y) (Const64 <t> [0]) (CMPconst [64] y))
 18271  	for {
 18272  		t := v.Type
 18273  		x := v_0
 18274  		y := v_1
 18275  		if !(!shiftIsBounded(v)) {
 18276  			break
 18277  		}
 18278  		v.reset(OpARM64CSEL)
 18279  		v.AuxInt = opToAuxInt(OpARM64LessThanU)
 18280  		v0 := b.NewValue0(v.Pos, OpARM64SLL, t)
 18281  		v0.AddArg2(x, y)
 18282  		v1 := b.NewValue0(v.Pos, OpConst64, t)
 18283  		v1.AuxInt = int64ToAuxInt(0)
 18284  		v2 := b.NewValue0(v.Pos, OpARM64CMPconst, types.TypeFlags)
 18285  		v2.AuxInt = int64ToAuxInt(64)
 18286  		v2.AddArg(y)
 18287  		v.AddArg3(v0, v1, v2)
 18288  		return true
 18289  	}
 18290  	return false
 18291  }
 18292  func rewriteValueARM64_OpLsh16x8(v *Value) bool {
 18293  	v_1 := v.Args[1]
 18294  	v_0 := v.Args[0]
 18295  	b := v.Block
 18296  	typ := &b.Func.Config.Types
 18297  	// match: (Lsh16x8 <t> x y)
 18298  	// cond: shiftIsBounded(v)
 18299  	// result: (SLL <t> x y)
 18300  	for {
 18301  		t := v.Type
 18302  		x := v_0
 18303  		y := v_1
 18304  		if !(shiftIsBounded(v)) {
 18305  			break
 18306  		}
 18307  		v.reset(OpARM64SLL)
 18308  		v.Type = t
 18309  		v.AddArg2(x, y)
 18310  		return true
 18311  	}
 18312  	// match: (Lsh16x8 <t> x y)
 18313  	// cond: !shiftIsBounded(v)
 18314  	// result: (CSEL [OpARM64LessThanU] (SLL <t> x y) (Const64 <t> [0]) (CMPconst [64] (ZeroExt8to64 y)))
 18315  	for {
 18316  		t := v.Type
 18317  		x := v_0
 18318  		y := v_1
 18319  		if !(!shiftIsBounded(v)) {
 18320  			break
 18321  		}
 18322  		v.reset(OpARM64CSEL)
 18323  		v.AuxInt = opToAuxInt(OpARM64LessThanU)
 18324  		v0 := b.NewValue0(v.Pos, OpARM64SLL, t)
 18325  		v0.AddArg2(x, y)
 18326  		v1 := b.NewValue0(v.Pos, OpConst64, t)
 18327  		v1.AuxInt = int64ToAuxInt(0)
 18328  		v2 := b.NewValue0(v.Pos, OpARM64CMPconst, types.TypeFlags)
 18329  		v2.AuxInt = int64ToAuxInt(64)
 18330  		v3 := b.NewValue0(v.Pos, OpZeroExt8to64, typ.UInt64)
 18331  		v3.AddArg(y)
 18332  		v2.AddArg(v3)
 18333  		v.AddArg3(v0, v1, v2)
 18334  		return true
 18335  	}
 18336  	return false
 18337  }
 18338  func rewriteValueARM64_OpLsh32x16(v *Value) bool {
 18339  	v_1 := v.Args[1]
 18340  	v_0 := v.Args[0]
 18341  	b := v.Block
 18342  	typ := &b.Func.Config.Types
 18343  	// match: (Lsh32x16 <t> x y)
 18344  	// cond: shiftIsBounded(v)
 18345  	// result: (SLL <t> x y)
 18346  	for {
 18347  		t := v.Type
 18348  		x := v_0
 18349  		y := v_1
 18350  		if !(shiftIsBounded(v)) {
 18351  			break
 18352  		}
 18353  		v.reset(OpARM64SLL)
 18354  		v.Type = t
 18355  		v.AddArg2(x, y)
 18356  		return true
 18357  	}
 18358  	// match: (Lsh32x16 <t> x y)
 18359  	// cond: !shiftIsBounded(v)
 18360  	// result: (CSEL [OpARM64LessThanU] (SLL <t> x y) (Const64 <t> [0]) (CMPconst [64] (ZeroExt16to64 y)))
 18361  	for {
 18362  		t := v.Type
 18363  		x := v_0
 18364  		y := v_1
 18365  		if !(!shiftIsBounded(v)) {
 18366  			break
 18367  		}
 18368  		v.reset(OpARM64CSEL)
 18369  		v.AuxInt = opToAuxInt(OpARM64LessThanU)
 18370  		v0 := b.NewValue0(v.Pos, OpARM64SLL, t)
 18371  		v0.AddArg2(x, y)
 18372  		v1 := b.NewValue0(v.Pos, OpConst64, t)
 18373  		v1.AuxInt = int64ToAuxInt(0)
 18374  		v2 := b.NewValue0(v.Pos, OpARM64CMPconst, types.TypeFlags)
 18375  		v2.AuxInt = int64ToAuxInt(64)
 18376  		v3 := b.NewValue0(v.Pos, OpZeroExt16to64, typ.UInt64)
 18377  		v3.AddArg(y)
 18378  		v2.AddArg(v3)
 18379  		v.AddArg3(v0, v1, v2)
 18380  		return true
 18381  	}
 18382  	return false
 18383  }
 18384  func rewriteValueARM64_OpLsh32x32(v *Value) bool {
 18385  	v_1 := v.Args[1]
 18386  	v_0 := v.Args[0]
 18387  	b := v.Block
 18388  	typ := &b.Func.Config.Types
 18389  	// match: (Lsh32x32 <t> x y)
 18390  	// cond: shiftIsBounded(v)
 18391  	// result: (SLL <t> x y)
 18392  	for {
 18393  		t := v.Type
 18394  		x := v_0
 18395  		y := v_1
 18396  		if !(shiftIsBounded(v)) {
 18397  			break
 18398  		}
 18399  		v.reset(OpARM64SLL)
 18400  		v.Type = t
 18401  		v.AddArg2(x, y)
 18402  		return true
 18403  	}
 18404  	// match: (Lsh32x32 <t> x y)
 18405  	// cond: !shiftIsBounded(v)
 18406  	// result: (CSEL [OpARM64LessThanU] (SLL <t> x y) (Const64 <t> [0]) (CMPconst [64] (ZeroExt32to64 y)))
 18407  	for {
 18408  		t := v.Type
 18409  		x := v_0
 18410  		y := v_1
 18411  		if !(!shiftIsBounded(v)) {
 18412  			break
 18413  		}
 18414  		v.reset(OpARM64CSEL)
 18415  		v.AuxInt = opToAuxInt(OpARM64LessThanU)
 18416  		v0 := b.NewValue0(v.Pos, OpARM64SLL, t)
 18417  		v0.AddArg2(x, y)
 18418  		v1 := b.NewValue0(v.Pos, OpConst64, t)
 18419  		v1.AuxInt = int64ToAuxInt(0)
 18420  		v2 := b.NewValue0(v.Pos, OpARM64CMPconst, types.TypeFlags)
 18421  		v2.AuxInt = int64ToAuxInt(64)
 18422  		v3 := b.NewValue0(v.Pos, OpZeroExt32to64, typ.UInt64)
 18423  		v3.AddArg(y)
 18424  		v2.AddArg(v3)
 18425  		v.AddArg3(v0, v1, v2)
 18426  		return true
 18427  	}
 18428  	return false
 18429  }
 18430  func rewriteValueARM64_OpLsh32x64(v *Value) bool {
 18431  	v_1 := v.Args[1]
 18432  	v_0 := v.Args[0]
 18433  	b := v.Block
 18434  	// match: (Lsh32x64 <t> x y)
 18435  	// cond: shiftIsBounded(v)
 18436  	// result: (SLL <t> x y)
 18437  	for {
 18438  		t := v.Type
 18439  		x := v_0
 18440  		y := v_1
 18441  		if !(shiftIsBounded(v)) {
 18442  			break
 18443  		}
 18444  		v.reset(OpARM64SLL)
 18445  		v.Type = t
 18446  		v.AddArg2(x, y)
 18447  		return true
 18448  	}
 18449  	// match: (Lsh32x64 <t> x y)
 18450  	// cond: !shiftIsBounded(v)
 18451  	// result: (CSEL [OpARM64LessThanU] (SLL <t> x y) (Const64 <t> [0]) (CMPconst [64] y))
 18452  	for {
 18453  		t := v.Type
 18454  		x := v_0
 18455  		y := v_1
 18456  		if !(!shiftIsBounded(v)) {
 18457  			break
 18458  		}
 18459  		v.reset(OpARM64CSEL)
 18460  		v.AuxInt = opToAuxInt(OpARM64LessThanU)
 18461  		v0 := b.NewValue0(v.Pos, OpARM64SLL, t)
 18462  		v0.AddArg2(x, y)
 18463  		v1 := b.NewValue0(v.Pos, OpConst64, t)
 18464  		v1.AuxInt = int64ToAuxInt(0)
 18465  		v2 := b.NewValue0(v.Pos, OpARM64CMPconst, types.TypeFlags)
 18466  		v2.AuxInt = int64ToAuxInt(64)
 18467  		v2.AddArg(y)
 18468  		v.AddArg3(v0, v1, v2)
 18469  		return true
 18470  	}
 18471  	return false
 18472  }
 18473  func rewriteValueARM64_OpLsh32x8(v *Value) bool {
 18474  	v_1 := v.Args[1]
 18475  	v_0 := v.Args[0]
 18476  	b := v.Block
 18477  	typ := &b.Func.Config.Types
 18478  	// match: (Lsh32x8 <t> x y)
 18479  	// cond: shiftIsBounded(v)
 18480  	// result: (SLL <t> x y)
 18481  	for {
 18482  		t := v.Type
 18483  		x := v_0
 18484  		y := v_1
 18485  		if !(shiftIsBounded(v)) {
 18486  			break
 18487  		}
 18488  		v.reset(OpARM64SLL)
 18489  		v.Type = t
 18490  		v.AddArg2(x, y)
 18491  		return true
 18492  	}
 18493  	// match: (Lsh32x8 <t> x y)
 18494  	// cond: !shiftIsBounded(v)
 18495  	// result: (CSEL [OpARM64LessThanU] (SLL <t> x y) (Const64 <t> [0]) (CMPconst [64] (ZeroExt8to64 y)))
 18496  	for {
 18497  		t := v.Type
 18498  		x := v_0
 18499  		y := v_1
 18500  		if !(!shiftIsBounded(v)) {
 18501  			break
 18502  		}
 18503  		v.reset(OpARM64CSEL)
 18504  		v.AuxInt = opToAuxInt(OpARM64LessThanU)
 18505  		v0 := b.NewValue0(v.Pos, OpARM64SLL, t)
 18506  		v0.AddArg2(x, y)
 18507  		v1 := b.NewValue0(v.Pos, OpConst64, t)
 18508  		v1.AuxInt = int64ToAuxInt(0)
 18509  		v2 := b.NewValue0(v.Pos, OpARM64CMPconst, types.TypeFlags)
 18510  		v2.AuxInt = int64ToAuxInt(64)
 18511  		v3 := b.NewValue0(v.Pos, OpZeroExt8to64, typ.UInt64)
 18512  		v3.AddArg(y)
 18513  		v2.AddArg(v3)
 18514  		v.AddArg3(v0, v1, v2)
 18515  		return true
 18516  	}
 18517  	return false
 18518  }
 18519  func rewriteValueARM64_OpLsh64x16(v *Value) bool {
 18520  	v_1 := v.Args[1]
 18521  	v_0 := v.Args[0]
 18522  	b := v.Block
 18523  	typ := &b.Func.Config.Types
 18524  	// match: (Lsh64x16 <t> x y)
 18525  	// cond: shiftIsBounded(v)
 18526  	// result: (SLL <t> x y)
 18527  	for {
 18528  		t := v.Type
 18529  		x := v_0
 18530  		y := v_1
 18531  		if !(shiftIsBounded(v)) {
 18532  			break
 18533  		}
 18534  		v.reset(OpARM64SLL)
 18535  		v.Type = t
 18536  		v.AddArg2(x, y)
 18537  		return true
 18538  	}
 18539  	// match: (Lsh64x16 <t> x y)
 18540  	// cond: !shiftIsBounded(v)
 18541  	// result: (CSEL [OpARM64LessThanU] (SLL <t> x y) (Const64 <t> [0]) (CMPconst [64] (ZeroExt16to64 y)))
 18542  	for {
 18543  		t := v.Type
 18544  		x := v_0
 18545  		y := v_1
 18546  		if !(!shiftIsBounded(v)) {
 18547  			break
 18548  		}
 18549  		v.reset(OpARM64CSEL)
 18550  		v.AuxInt = opToAuxInt(OpARM64LessThanU)
 18551  		v0 := b.NewValue0(v.Pos, OpARM64SLL, t)
 18552  		v0.AddArg2(x, y)
 18553  		v1 := b.NewValue0(v.Pos, OpConst64, t)
 18554  		v1.AuxInt = int64ToAuxInt(0)
 18555  		v2 := b.NewValue0(v.Pos, OpARM64CMPconst, types.TypeFlags)
 18556  		v2.AuxInt = int64ToAuxInt(64)
 18557  		v3 := b.NewValue0(v.Pos, OpZeroExt16to64, typ.UInt64)
 18558  		v3.AddArg(y)
 18559  		v2.AddArg(v3)
 18560  		v.AddArg3(v0, v1, v2)
 18561  		return true
 18562  	}
 18563  	return false
 18564  }
 18565  func rewriteValueARM64_OpLsh64x32(v *Value) bool {
 18566  	v_1 := v.Args[1]
 18567  	v_0 := v.Args[0]
 18568  	b := v.Block
 18569  	typ := &b.Func.Config.Types
 18570  	// match: (Lsh64x32 <t> x y)
 18571  	// cond: shiftIsBounded(v)
 18572  	// result: (SLL <t> x y)
 18573  	for {
 18574  		t := v.Type
 18575  		x := v_0
 18576  		y := v_1
 18577  		if !(shiftIsBounded(v)) {
 18578  			break
 18579  		}
 18580  		v.reset(OpARM64SLL)
 18581  		v.Type = t
 18582  		v.AddArg2(x, y)
 18583  		return true
 18584  	}
 18585  	// match: (Lsh64x32 <t> x y)
 18586  	// cond: !shiftIsBounded(v)
 18587  	// result: (CSEL [OpARM64LessThanU] (SLL <t> x y) (Const64 <t> [0]) (CMPconst [64] (ZeroExt32to64 y)))
 18588  	for {
 18589  		t := v.Type
 18590  		x := v_0
 18591  		y := v_1
 18592  		if !(!shiftIsBounded(v)) {
 18593  			break
 18594  		}
 18595  		v.reset(OpARM64CSEL)
 18596  		v.AuxInt = opToAuxInt(OpARM64LessThanU)
 18597  		v0 := b.NewValue0(v.Pos, OpARM64SLL, t)
 18598  		v0.AddArg2(x, y)
 18599  		v1 := b.NewValue0(v.Pos, OpConst64, t)
 18600  		v1.AuxInt = int64ToAuxInt(0)
 18601  		v2 := b.NewValue0(v.Pos, OpARM64CMPconst, types.TypeFlags)
 18602  		v2.AuxInt = int64ToAuxInt(64)
 18603  		v3 := b.NewValue0(v.Pos, OpZeroExt32to64, typ.UInt64)
 18604  		v3.AddArg(y)
 18605  		v2.AddArg(v3)
 18606  		v.AddArg3(v0, v1, v2)
 18607  		return true
 18608  	}
 18609  	return false
 18610  }
 18611  func rewriteValueARM64_OpLsh64x64(v *Value) bool {
 18612  	v_1 := v.Args[1]
 18613  	v_0 := v.Args[0]
 18614  	b := v.Block
 18615  	// match: (Lsh64x64 <t> x y)
 18616  	// cond: shiftIsBounded(v)
 18617  	// result: (SLL <t> x y)
 18618  	for {
 18619  		t := v.Type
 18620  		x := v_0
 18621  		y := v_1
 18622  		if !(shiftIsBounded(v)) {
 18623  			break
 18624  		}
 18625  		v.reset(OpARM64SLL)
 18626  		v.Type = t
 18627  		v.AddArg2(x, y)
 18628  		return true
 18629  	}
 18630  	// match: (Lsh64x64 <t> x y)
 18631  	// cond: !shiftIsBounded(v)
 18632  	// result: (CSEL [OpARM64LessThanU] (SLL <t> x y) (Const64 <t> [0]) (CMPconst [64] y))
 18633  	for {
 18634  		t := v.Type
 18635  		x := v_0
 18636  		y := v_1
 18637  		if !(!shiftIsBounded(v)) {
 18638  			break
 18639  		}
 18640  		v.reset(OpARM64CSEL)
 18641  		v.AuxInt = opToAuxInt(OpARM64LessThanU)
 18642  		v0 := b.NewValue0(v.Pos, OpARM64SLL, t)
 18643  		v0.AddArg2(x, y)
 18644  		v1 := b.NewValue0(v.Pos, OpConst64, t)
 18645  		v1.AuxInt = int64ToAuxInt(0)
 18646  		v2 := b.NewValue0(v.Pos, OpARM64CMPconst, types.TypeFlags)
 18647  		v2.AuxInt = int64ToAuxInt(64)
 18648  		v2.AddArg(y)
 18649  		v.AddArg3(v0, v1, v2)
 18650  		return true
 18651  	}
 18652  	return false
 18653  }
 18654  func rewriteValueARM64_OpLsh64x8(v *Value) bool {
 18655  	v_1 := v.Args[1]
 18656  	v_0 := v.Args[0]
 18657  	b := v.Block
 18658  	typ := &b.Func.Config.Types
 18659  	// match: (Lsh64x8 <t> x y)
 18660  	// cond: shiftIsBounded(v)
 18661  	// result: (SLL <t> x y)
 18662  	for {
 18663  		t := v.Type
 18664  		x := v_0
 18665  		y := v_1
 18666  		if !(shiftIsBounded(v)) {
 18667  			break
 18668  		}
 18669  		v.reset(OpARM64SLL)
 18670  		v.Type = t
 18671  		v.AddArg2(x, y)
 18672  		return true
 18673  	}
 18674  	// match: (Lsh64x8 <t> x y)
 18675  	// cond: !shiftIsBounded(v)
 18676  	// result: (CSEL [OpARM64LessThanU] (SLL <t> x y) (Const64 <t> [0]) (CMPconst [64] (ZeroExt8to64 y)))
 18677  	for {
 18678  		t := v.Type
 18679  		x := v_0
 18680  		y := v_1
 18681  		if !(!shiftIsBounded(v)) {
 18682  			break
 18683  		}
 18684  		v.reset(OpARM64CSEL)
 18685  		v.AuxInt = opToAuxInt(OpARM64LessThanU)
 18686  		v0 := b.NewValue0(v.Pos, OpARM64SLL, t)
 18687  		v0.AddArg2(x, y)
 18688  		v1 := b.NewValue0(v.Pos, OpConst64, t)
 18689  		v1.AuxInt = int64ToAuxInt(0)
 18690  		v2 := b.NewValue0(v.Pos, OpARM64CMPconst, types.TypeFlags)
 18691  		v2.AuxInt = int64ToAuxInt(64)
 18692  		v3 := b.NewValue0(v.Pos, OpZeroExt8to64, typ.UInt64)
 18693  		v3.AddArg(y)
 18694  		v2.AddArg(v3)
 18695  		v.AddArg3(v0, v1, v2)
 18696  		return true
 18697  	}
 18698  	return false
 18699  }
 18700  func rewriteValueARM64_OpLsh8x16(v *Value) bool {
 18701  	v_1 := v.Args[1]
 18702  	v_0 := v.Args[0]
 18703  	b := v.Block
 18704  	typ := &b.Func.Config.Types
 18705  	// match: (Lsh8x16 <t> x y)
 18706  	// cond: shiftIsBounded(v)
 18707  	// result: (SLL <t> x y)
 18708  	for {
 18709  		t := v.Type
 18710  		x := v_0
 18711  		y := v_1
 18712  		if !(shiftIsBounded(v)) {
 18713  			break
 18714  		}
 18715  		v.reset(OpARM64SLL)
 18716  		v.Type = t
 18717  		v.AddArg2(x, y)
 18718  		return true
 18719  	}
 18720  	// match: (Lsh8x16 <t> x y)
 18721  	// cond: !shiftIsBounded(v)
 18722  	// result: (CSEL [OpARM64LessThanU] (SLL <t> x y) (Const64 <t> [0]) (CMPconst [64] (ZeroExt16to64 y)))
 18723  	for {
 18724  		t := v.Type
 18725  		x := v_0
 18726  		y := v_1
 18727  		if !(!shiftIsBounded(v)) {
 18728  			break
 18729  		}
 18730  		v.reset(OpARM64CSEL)
 18731  		v.AuxInt = opToAuxInt(OpARM64LessThanU)
 18732  		v0 := b.NewValue0(v.Pos, OpARM64SLL, t)
 18733  		v0.AddArg2(x, y)
 18734  		v1 := b.NewValue0(v.Pos, OpConst64, t)
 18735  		v1.AuxInt = int64ToAuxInt(0)
 18736  		v2 := b.NewValue0(v.Pos, OpARM64CMPconst, types.TypeFlags)
 18737  		v2.AuxInt = int64ToAuxInt(64)
 18738  		v3 := b.NewValue0(v.Pos, OpZeroExt16to64, typ.UInt64)
 18739  		v3.AddArg(y)
 18740  		v2.AddArg(v3)
 18741  		v.AddArg3(v0, v1, v2)
 18742  		return true
 18743  	}
 18744  	return false
 18745  }
 18746  func rewriteValueARM64_OpLsh8x32(v *Value) bool {
 18747  	v_1 := v.Args[1]
 18748  	v_0 := v.Args[0]
 18749  	b := v.Block
 18750  	typ := &b.Func.Config.Types
 18751  	// match: (Lsh8x32 <t> x y)
 18752  	// cond: shiftIsBounded(v)
 18753  	// result: (SLL <t> x y)
 18754  	for {
 18755  		t := v.Type
 18756  		x := v_0
 18757  		y := v_1
 18758  		if !(shiftIsBounded(v)) {
 18759  			break
 18760  		}
 18761  		v.reset(OpARM64SLL)
 18762  		v.Type = t
 18763  		v.AddArg2(x, y)
 18764  		return true
 18765  	}
 18766  	// match: (Lsh8x32 <t> x y)
 18767  	// cond: !shiftIsBounded(v)
 18768  	// result: (CSEL [OpARM64LessThanU] (SLL <t> x y) (Const64 <t> [0]) (CMPconst [64] (ZeroExt32to64 y)))
 18769  	for {
 18770  		t := v.Type
 18771  		x := v_0
 18772  		y := v_1
 18773  		if !(!shiftIsBounded(v)) {
 18774  			break
 18775  		}
 18776  		v.reset(OpARM64CSEL)
 18777  		v.AuxInt = opToAuxInt(OpARM64LessThanU)
 18778  		v0 := b.NewValue0(v.Pos, OpARM64SLL, t)
 18779  		v0.AddArg2(x, y)
 18780  		v1 := b.NewValue0(v.Pos, OpConst64, t)
 18781  		v1.AuxInt = int64ToAuxInt(0)
 18782  		v2 := b.NewValue0(v.Pos, OpARM64CMPconst, types.TypeFlags)
 18783  		v2.AuxInt = int64ToAuxInt(64)
 18784  		v3 := b.NewValue0(v.Pos, OpZeroExt32to64, typ.UInt64)
 18785  		v3.AddArg(y)
 18786  		v2.AddArg(v3)
 18787  		v.AddArg3(v0, v1, v2)
 18788  		return true
 18789  	}
 18790  	return false
 18791  }
 18792  func rewriteValueARM64_OpLsh8x64(v *Value) bool {
 18793  	v_1 := v.Args[1]
 18794  	v_0 := v.Args[0]
 18795  	b := v.Block
 18796  	// match: (Lsh8x64 <t> x y)
 18797  	// cond: shiftIsBounded(v)
 18798  	// result: (SLL <t> x y)
 18799  	for {
 18800  		t := v.Type
 18801  		x := v_0
 18802  		y := v_1
 18803  		if !(shiftIsBounded(v)) {
 18804  			break
 18805  		}
 18806  		v.reset(OpARM64SLL)
 18807  		v.Type = t
 18808  		v.AddArg2(x, y)
 18809  		return true
 18810  	}
 18811  	// match: (Lsh8x64 <t> x y)
 18812  	// cond: !shiftIsBounded(v)
 18813  	// result: (CSEL [OpARM64LessThanU] (SLL <t> x y) (Const64 <t> [0]) (CMPconst [64] y))
 18814  	for {
 18815  		t := v.Type
 18816  		x := v_0
 18817  		y := v_1
 18818  		if !(!shiftIsBounded(v)) {
 18819  			break
 18820  		}
 18821  		v.reset(OpARM64CSEL)
 18822  		v.AuxInt = opToAuxInt(OpARM64LessThanU)
 18823  		v0 := b.NewValue0(v.Pos, OpARM64SLL, t)
 18824  		v0.AddArg2(x, y)
 18825  		v1 := b.NewValue0(v.Pos, OpConst64, t)
 18826  		v1.AuxInt = int64ToAuxInt(0)
 18827  		v2 := b.NewValue0(v.Pos, OpARM64CMPconst, types.TypeFlags)
 18828  		v2.AuxInt = int64ToAuxInt(64)
 18829  		v2.AddArg(y)
 18830  		v.AddArg3(v0, v1, v2)
 18831  		return true
 18832  	}
 18833  	return false
 18834  }
 18835  func rewriteValueARM64_OpLsh8x8(v *Value) bool {
 18836  	v_1 := v.Args[1]
 18837  	v_0 := v.Args[0]
 18838  	b := v.Block
 18839  	typ := &b.Func.Config.Types
 18840  	// match: (Lsh8x8 <t> x y)
 18841  	// cond: shiftIsBounded(v)
 18842  	// result: (SLL <t> x y)
 18843  	for {
 18844  		t := v.Type
 18845  		x := v_0
 18846  		y := v_1
 18847  		if !(shiftIsBounded(v)) {
 18848  			break
 18849  		}
 18850  		v.reset(OpARM64SLL)
 18851  		v.Type = t
 18852  		v.AddArg2(x, y)
 18853  		return true
 18854  	}
 18855  	// match: (Lsh8x8 <t> x y)
 18856  	// cond: !shiftIsBounded(v)
 18857  	// result: (CSEL [OpARM64LessThanU] (SLL <t> x y) (Const64 <t> [0]) (CMPconst [64] (ZeroExt8to64 y)))
 18858  	for {
 18859  		t := v.Type
 18860  		x := v_0
 18861  		y := v_1
 18862  		if !(!shiftIsBounded(v)) {
 18863  			break
 18864  		}
 18865  		v.reset(OpARM64CSEL)
 18866  		v.AuxInt = opToAuxInt(OpARM64LessThanU)
 18867  		v0 := b.NewValue0(v.Pos, OpARM64SLL, t)
 18868  		v0.AddArg2(x, y)
 18869  		v1 := b.NewValue0(v.Pos, OpConst64, t)
 18870  		v1.AuxInt = int64ToAuxInt(0)
 18871  		v2 := b.NewValue0(v.Pos, OpARM64CMPconst, types.TypeFlags)
 18872  		v2.AuxInt = int64ToAuxInt(64)
 18873  		v3 := b.NewValue0(v.Pos, OpZeroExt8to64, typ.UInt64)
 18874  		v3.AddArg(y)
 18875  		v2.AddArg(v3)
 18876  		v.AddArg3(v0, v1, v2)
 18877  		return true
 18878  	}
 18879  	return false
 18880  }
 18881  func rewriteValueARM64_OpMod16(v *Value) bool {
 18882  	v_1 := v.Args[1]
 18883  	v_0 := v.Args[0]
 18884  	b := v.Block
 18885  	typ := &b.Func.Config.Types
 18886  	// match: (Mod16 x y)
 18887  	// result: (MODW (SignExt16to32 x) (SignExt16to32 y))
 18888  	for {
 18889  		x := v_0
 18890  		y := v_1
 18891  		v.reset(OpARM64MODW)
 18892  		v0 := b.NewValue0(v.Pos, OpSignExt16to32, typ.Int32)
 18893  		v0.AddArg(x)
 18894  		v1 := b.NewValue0(v.Pos, OpSignExt16to32, typ.Int32)
 18895  		v1.AddArg(y)
 18896  		v.AddArg2(v0, v1)
 18897  		return true
 18898  	}
 18899  }
 18900  func rewriteValueARM64_OpMod16u(v *Value) bool {
 18901  	v_1 := v.Args[1]
 18902  	v_0 := v.Args[0]
 18903  	b := v.Block
 18904  	typ := &b.Func.Config.Types
 18905  	// match: (Mod16u x y)
 18906  	// result: (UMODW (ZeroExt16to32 x) (ZeroExt16to32 y))
 18907  	for {
 18908  		x := v_0
 18909  		y := v_1
 18910  		v.reset(OpARM64UMODW)
 18911  		v0 := b.NewValue0(v.Pos, OpZeroExt16to32, typ.UInt32)
 18912  		v0.AddArg(x)
 18913  		v1 := b.NewValue0(v.Pos, OpZeroExt16to32, typ.UInt32)
 18914  		v1.AddArg(y)
 18915  		v.AddArg2(v0, v1)
 18916  		return true
 18917  	}
 18918  }
 18919  func rewriteValueARM64_OpMod32(v *Value) bool {
 18920  	v_1 := v.Args[1]
 18921  	v_0 := v.Args[0]
 18922  	// match: (Mod32 x y)
 18923  	// result: (MODW x y)
 18924  	for {
 18925  		x := v_0
 18926  		y := v_1
 18927  		v.reset(OpARM64MODW)
 18928  		v.AddArg2(x, y)
 18929  		return true
 18930  	}
 18931  }
 18932  func rewriteValueARM64_OpMod64(v *Value) bool {
 18933  	v_1 := v.Args[1]
 18934  	v_0 := v.Args[0]
 18935  	// match: (Mod64 x y)
 18936  	// result: (MOD x y)
 18937  	for {
 18938  		x := v_0
 18939  		y := v_1
 18940  		v.reset(OpARM64MOD)
 18941  		v.AddArg2(x, y)
 18942  		return true
 18943  	}
 18944  }
 18945  func rewriteValueARM64_OpMod8(v *Value) bool {
 18946  	v_1 := v.Args[1]
 18947  	v_0 := v.Args[0]
 18948  	b := v.Block
 18949  	typ := &b.Func.Config.Types
 18950  	// match: (Mod8 x y)
 18951  	// result: (MODW (SignExt8to32 x) (SignExt8to32 y))
 18952  	for {
 18953  		x := v_0
 18954  		y := v_1
 18955  		v.reset(OpARM64MODW)
 18956  		v0 := b.NewValue0(v.Pos, OpSignExt8to32, typ.Int32)
 18957  		v0.AddArg(x)
 18958  		v1 := b.NewValue0(v.Pos, OpSignExt8to32, typ.Int32)
 18959  		v1.AddArg(y)
 18960  		v.AddArg2(v0, v1)
 18961  		return true
 18962  	}
 18963  }
 18964  func rewriteValueARM64_OpMod8u(v *Value) bool {
 18965  	v_1 := v.Args[1]
 18966  	v_0 := v.Args[0]
 18967  	b := v.Block
 18968  	typ := &b.Func.Config.Types
 18969  	// match: (Mod8u x y)
 18970  	// result: (UMODW (ZeroExt8to32 x) (ZeroExt8to32 y))
 18971  	for {
 18972  		x := v_0
 18973  		y := v_1
 18974  		v.reset(OpARM64UMODW)
 18975  		v0 := b.NewValue0(v.Pos, OpZeroExt8to32, typ.UInt32)
 18976  		v0.AddArg(x)
 18977  		v1 := b.NewValue0(v.Pos, OpZeroExt8to32, typ.UInt32)
 18978  		v1.AddArg(y)
 18979  		v.AddArg2(v0, v1)
 18980  		return true
 18981  	}
 18982  }
 18983  func rewriteValueARM64_OpMove(v *Value) bool {
 18984  	v_2 := v.Args[2]
 18985  	v_1 := v.Args[1]
 18986  	v_0 := v.Args[0]
 18987  	b := v.Block
 18988  	typ := &b.Func.Config.Types
 18989  	// match: (Move [0] _ _ mem)
 18990  	// result: mem
 18991  	for {
 18992  		if auxIntToInt64(v.AuxInt) != 0 {
 18993  			break
 18994  		}
 18995  		mem := v_2
 18996  		v.copyOf(mem)
 18997  		return true
 18998  	}
 18999  	// match: (Move [1] dst src mem)
 19000  	// result: (MOVBstore dst (MOVBUload src mem) mem)
 19001  	for {
 19002  		if auxIntToInt64(v.AuxInt) != 1 {
 19003  			break
 19004  		}
 19005  		dst := v_0
 19006  		src := v_1
 19007  		mem := v_2
 19008  		v.reset(OpARM64MOVBstore)
 19009  		v0 := b.NewValue0(v.Pos, OpARM64MOVBUload, typ.UInt8)
 19010  		v0.AddArg2(src, mem)
 19011  		v.AddArg3(dst, v0, mem)
 19012  		return true
 19013  	}
 19014  	// match: (Move [2] dst src mem)
 19015  	// result: (MOVHstore dst (MOVHUload src mem) mem)
 19016  	for {
 19017  		if auxIntToInt64(v.AuxInt) != 2 {
 19018  			break
 19019  		}
 19020  		dst := v_0
 19021  		src := v_1
 19022  		mem := v_2
 19023  		v.reset(OpARM64MOVHstore)
 19024  		v0 := b.NewValue0(v.Pos, OpARM64MOVHUload, typ.UInt16)
 19025  		v0.AddArg2(src, mem)
 19026  		v.AddArg3(dst, v0, mem)
 19027  		return true
 19028  	}
 19029  	// match: (Move [3] dst src mem)
 19030  	// result: (MOVBstore [2] dst (MOVBUload [2] src mem) (MOVHstore dst (MOVHUload src mem) mem))
 19031  	for {
 19032  		if auxIntToInt64(v.AuxInt) != 3 {
 19033  			break
 19034  		}
 19035  		dst := v_0
 19036  		src := v_1
 19037  		mem := v_2
 19038  		v.reset(OpARM64MOVBstore)
 19039  		v.AuxInt = int32ToAuxInt(2)
 19040  		v0 := b.NewValue0(v.Pos, OpARM64MOVBUload, typ.UInt8)
 19041  		v0.AuxInt = int32ToAuxInt(2)
 19042  		v0.AddArg2(src, mem)
 19043  		v1 := b.NewValue0(v.Pos, OpARM64MOVHstore, types.TypeMem)
 19044  		v2 := b.NewValue0(v.Pos, OpARM64MOVHUload, typ.UInt16)
 19045  		v2.AddArg2(src, mem)
 19046  		v1.AddArg3(dst, v2, mem)
 19047  		v.AddArg3(dst, v0, v1)
 19048  		return true
 19049  	}
 19050  	// match: (Move [4] dst src mem)
 19051  	// result: (MOVWstore dst (MOVWUload src mem) mem)
 19052  	for {
 19053  		if auxIntToInt64(v.AuxInt) != 4 {
 19054  			break
 19055  		}
 19056  		dst := v_0
 19057  		src := v_1
 19058  		mem := v_2
 19059  		v.reset(OpARM64MOVWstore)
 19060  		v0 := b.NewValue0(v.Pos, OpARM64MOVWUload, typ.UInt32)
 19061  		v0.AddArg2(src, mem)
 19062  		v.AddArg3(dst, v0, mem)
 19063  		return true
 19064  	}
 19065  	// match: (Move [5] dst src mem)
 19066  	// result: (MOVBstore [4] dst (MOVBUload [4] src mem) (MOVWstore dst (MOVWUload src mem) mem))
 19067  	for {
 19068  		if auxIntToInt64(v.AuxInt) != 5 {
 19069  			break
 19070  		}
 19071  		dst := v_0
 19072  		src := v_1
 19073  		mem := v_2
 19074  		v.reset(OpARM64MOVBstore)
 19075  		v.AuxInt = int32ToAuxInt(4)
 19076  		v0 := b.NewValue0(v.Pos, OpARM64MOVBUload, typ.UInt8)
 19077  		v0.AuxInt = int32ToAuxInt(4)
 19078  		v0.AddArg2(src, mem)
 19079  		v1 := b.NewValue0(v.Pos, OpARM64MOVWstore, types.TypeMem)
 19080  		v2 := b.NewValue0(v.Pos, OpARM64MOVWUload, typ.UInt32)
 19081  		v2.AddArg2(src, mem)
 19082  		v1.AddArg3(dst, v2, mem)
 19083  		v.AddArg3(dst, v0, v1)
 19084  		return true
 19085  	}
 19086  	// match: (Move [6] dst src mem)
 19087  	// result: (MOVHstore [4] dst (MOVHUload [4] src mem) (MOVWstore dst (MOVWUload src mem) mem))
 19088  	for {
 19089  		if auxIntToInt64(v.AuxInt) != 6 {
 19090  			break
 19091  		}
 19092  		dst := v_0
 19093  		src := v_1
 19094  		mem := v_2
 19095  		v.reset(OpARM64MOVHstore)
 19096  		v.AuxInt = int32ToAuxInt(4)
 19097  		v0 := b.NewValue0(v.Pos, OpARM64MOVHUload, typ.UInt16)
 19098  		v0.AuxInt = int32ToAuxInt(4)
 19099  		v0.AddArg2(src, mem)
 19100  		v1 := b.NewValue0(v.Pos, OpARM64MOVWstore, types.TypeMem)
 19101  		v2 := b.NewValue0(v.Pos, OpARM64MOVWUload, typ.UInt32)
 19102  		v2.AddArg2(src, mem)
 19103  		v1.AddArg3(dst, v2, mem)
 19104  		v.AddArg3(dst, v0, v1)
 19105  		return true
 19106  	}
 19107  	// match: (Move [7] dst src mem)
 19108  	// result: (MOVWstore [3] dst (MOVWUload [3] src mem) (MOVWstore dst (MOVWUload src mem) mem))
 19109  	for {
 19110  		if auxIntToInt64(v.AuxInt) != 7 {
 19111  			break
 19112  		}
 19113  		dst := v_0
 19114  		src := v_1
 19115  		mem := v_2
 19116  		v.reset(OpARM64MOVWstore)
 19117  		v.AuxInt = int32ToAuxInt(3)
 19118  		v0 := b.NewValue0(v.Pos, OpARM64MOVWUload, typ.UInt32)
 19119  		v0.AuxInt = int32ToAuxInt(3)
 19120  		v0.AddArg2(src, mem)
 19121  		v1 := b.NewValue0(v.Pos, OpARM64MOVWstore, types.TypeMem)
 19122  		v2 := b.NewValue0(v.Pos, OpARM64MOVWUload, typ.UInt32)
 19123  		v2.AddArg2(src, mem)
 19124  		v1.AddArg3(dst, v2, mem)
 19125  		v.AddArg3(dst, v0, v1)
 19126  		return true
 19127  	}
 19128  	// match: (Move [8] dst src mem)
 19129  	// result: (MOVDstore dst (MOVDload src mem) mem)
 19130  	for {
 19131  		if auxIntToInt64(v.AuxInt) != 8 {
 19132  			break
 19133  		}
 19134  		dst := v_0
 19135  		src := v_1
 19136  		mem := v_2
 19137  		v.reset(OpARM64MOVDstore)
 19138  		v0 := b.NewValue0(v.Pos, OpARM64MOVDload, typ.UInt64)
 19139  		v0.AddArg2(src, mem)
 19140  		v.AddArg3(dst, v0, mem)
 19141  		return true
 19142  	}
 19143  	// match: (Move [9] dst src mem)
 19144  	// result: (MOVBstore [8] dst (MOVBUload [8] src mem) (MOVDstore dst (MOVDload src mem) mem))
 19145  	for {
 19146  		if auxIntToInt64(v.AuxInt) != 9 {
 19147  			break
 19148  		}
 19149  		dst := v_0
 19150  		src := v_1
 19151  		mem := v_2
 19152  		v.reset(OpARM64MOVBstore)
 19153  		v.AuxInt = int32ToAuxInt(8)
 19154  		v0 := b.NewValue0(v.Pos, OpARM64MOVBUload, typ.UInt8)
 19155  		v0.AuxInt = int32ToAuxInt(8)
 19156  		v0.AddArg2(src, mem)
 19157  		v1 := b.NewValue0(v.Pos, OpARM64MOVDstore, types.TypeMem)
 19158  		v2 := b.NewValue0(v.Pos, OpARM64MOVDload, typ.UInt64)
 19159  		v2.AddArg2(src, mem)
 19160  		v1.AddArg3(dst, v2, mem)
 19161  		v.AddArg3(dst, v0, v1)
 19162  		return true
 19163  	}
 19164  	// match: (Move [10] dst src mem)
 19165  	// result: (MOVHstore [8] dst (MOVHUload [8] src mem) (MOVDstore dst (MOVDload src mem) mem))
 19166  	for {
 19167  		if auxIntToInt64(v.AuxInt) != 10 {
 19168  			break
 19169  		}
 19170  		dst := v_0
 19171  		src := v_1
 19172  		mem := v_2
 19173  		v.reset(OpARM64MOVHstore)
 19174  		v.AuxInt = int32ToAuxInt(8)
 19175  		v0 := b.NewValue0(v.Pos, OpARM64MOVHUload, typ.UInt16)
 19176  		v0.AuxInt = int32ToAuxInt(8)
 19177  		v0.AddArg2(src, mem)
 19178  		v1 := b.NewValue0(v.Pos, OpARM64MOVDstore, types.TypeMem)
 19179  		v2 := b.NewValue0(v.Pos, OpARM64MOVDload, typ.UInt64)
 19180  		v2.AddArg2(src, mem)
 19181  		v1.AddArg3(dst, v2, mem)
 19182  		v.AddArg3(dst, v0, v1)
 19183  		return true
 19184  	}
 19185  	// match: (Move [11] dst src mem)
 19186  	// result: (MOVDstore [3] dst (MOVDload [3] src mem) (MOVDstore dst (MOVDload src mem) mem))
 19187  	for {
 19188  		if auxIntToInt64(v.AuxInt) != 11 {
 19189  			break
 19190  		}
 19191  		dst := v_0
 19192  		src := v_1
 19193  		mem := v_2
 19194  		v.reset(OpARM64MOVDstore)
 19195  		v.AuxInt = int32ToAuxInt(3)
 19196  		v0 := b.NewValue0(v.Pos, OpARM64MOVDload, typ.UInt64)
 19197  		v0.AuxInt = int32ToAuxInt(3)
 19198  		v0.AddArg2(src, mem)
 19199  		v1 := b.NewValue0(v.Pos, OpARM64MOVDstore, types.TypeMem)
 19200  		v2 := b.NewValue0(v.Pos, OpARM64MOVDload, typ.UInt64)
 19201  		v2.AddArg2(src, mem)
 19202  		v1.AddArg3(dst, v2, mem)
 19203  		v.AddArg3(dst, v0, v1)
 19204  		return true
 19205  	}
 19206  	// match: (Move [12] dst src mem)
 19207  	// result: (MOVWstore [8] dst (MOVWUload [8] src mem) (MOVDstore dst (MOVDload src mem) mem))
 19208  	for {
 19209  		if auxIntToInt64(v.AuxInt) != 12 {
 19210  			break
 19211  		}
 19212  		dst := v_0
 19213  		src := v_1
 19214  		mem := v_2
 19215  		v.reset(OpARM64MOVWstore)
 19216  		v.AuxInt = int32ToAuxInt(8)
 19217  		v0 := b.NewValue0(v.Pos, OpARM64MOVWUload, typ.UInt32)
 19218  		v0.AuxInt = int32ToAuxInt(8)
 19219  		v0.AddArg2(src, mem)
 19220  		v1 := b.NewValue0(v.Pos, OpARM64MOVDstore, types.TypeMem)
 19221  		v2 := b.NewValue0(v.Pos, OpARM64MOVDload, typ.UInt64)
 19222  		v2.AddArg2(src, mem)
 19223  		v1.AddArg3(dst, v2, mem)
 19224  		v.AddArg3(dst, v0, v1)
 19225  		return true
 19226  	}
 19227  	// match: (Move [13] dst src mem)
 19228  	// result: (MOVDstore [5] dst (MOVDload [5] src mem) (MOVDstore dst (MOVDload src mem) mem))
 19229  	for {
 19230  		if auxIntToInt64(v.AuxInt) != 13 {
 19231  			break
 19232  		}
 19233  		dst := v_0
 19234  		src := v_1
 19235  		mem := v_2
 19236  		v.reset(OpARM64MOVDstore)
 19237  		v.AuxInt = int32ToAuxInt(5)
 19238  		v0 := b.NewValue0(v.Pos, OpARM64MOVDload, typ.UInt64)
 19239  		v0.AuxInt = int32ToAuxInt(5)
 19240  		v0.AddArg2(src, mem)
 19241  		v1 := b.NewValue0(v.Pos, OpARM64MOVDstore, types.TypeMem)
 19242  		v2 := b.NewValue0(v.Pos, OpARM64MOVDload, typ.UInt64)
 19243  		v2.AddArg2(src, mem)
 19244  		v1.AddArg3(dst, v2, mem)
 19245  		v.AddArg3(dst, v0, v1)
 19246  		return true
 19247  	}
 19248  	// match: (Move [14] dst src mem)
 19249  	// result: (MOVDstore [6] dst (MOVDload [6] src mem) (MOVDstore dst (MOVDload src mem) mem))
 19250  	for {
 19251  		if auxIntToInt64(v.AuxInt) != 14 {
 19252  			break
 19253  		}
 19254  		dst := v_0
 19255  		src := v_1
 19256  		mem := v_2
 19257  		v.reset(OpARM64MOVDstore)
 19258  		v.AuxInt = int32ToAuxInt(6)
 19259  		v0 := b.NewValue0(v.Pos, OpARM64MOVDload, typ.UInt64)
 19260  		v0.AuxInt = int32ToAuxInt(6)
 19261  		v0.AddArg2(src, mem)
 19262  		v1 := b.NewValue0(v.Pos, OpARM64MOVDstore, types.TypeMem)
 19263  		v2 := b.NewValue0(v.Pos, OpARM64MOVDload, typ.UInt64)
 19264  		v2.AddArg2(src, mem)
 19265  		v1.AddArg3(dst, v2, mem)
 19266  		v.AddArg3(dst, v0, v1)
 19267  		return true
 19268  	}
 19269  	// match: (Move [15] dst src mem)
 19270  	// result: (MOVDstore [7] dst (MOVDload [7] src mem) (MOVDstore dst (MOVDload src mem) mem))
 19271  	for {
 19272  		if auxIntToInt64(v.AuxInt) != 15 {
 19273  			break
 19274  		}
 19275  		dst := v_0
 19276  		src := v_1
 19277  		mem := v_2
 19278  		v.reset(OpARM64MOVDstore)
 19279  		v.AuxInt = int32ToAuxInt(7)
 19280  		v0 := b.NewValue0(v.Pos, OpARM64MOVDload, typ.UInt64)
 19281  		v0.AuxInt = int32ToAuxInt(7)
 19282  		v0.AddArg2(src, mem)
 19283  		v1 := b.NewValue0(v.Pos, OpARM64MOVDstore, types.TypeMem)
 19284  		v2 := b.NewValue0(v.Pos, OpARM64MOVDload, typ.UInt64)
 19285  		v2.AddArg2(src, mem)
 19286  		v1.AddArg3(dst, v2, mem)
 19287  		v.AddArg3(dst, v0, v1)
 19288  		return true
 19289  	}
 19290  	// match: (Move [16] dst src mem)
 19291  	// result: (STP dst (Select0 <typ.UInt64> (LDP src mem)) (Select1 <typ.UInt64> (LDP src mem)) mem)
 19292  	for {
 19293  		if auxIntToInt64(v.AuxInt) != 16 {
 19294  			break
 19295  		}
 19296  		dst := v_0
 19297  		src := v_1
 19298  		mem := v_2
 19299  		v.reset(OpARM64STP)
 19300  		v0 := b.NewValue0(v.Pos, OpSelect0, typ.UInt64)
 19301  		v1 := b.NewValue0(v.Pos, OpARM64LDP, types.NewTuple(typ.UInt64, typ.UInt64))
 19302  		v1.AddArg2(src, mem)
 19303  		v0.AddArg(v1)
 19304  		v2 := b.NewValue0(v.Pos, OpSelect1, typ.UInt64)
 19305  		v2.AddArg(v1)
 19306  		v.AddArg4(dst, v0, v2, mem)
 19307  		return true
 19308  	}
 19309  	// match: (Move [s] dst src mem)
 19310  	// cond: s > 16 && s <= 24
 19311  	// result: (MOVDstore [int32(s-8)] dst (MOVDload [int32(s-8)] src mem) (STP dst (Select0 <typ.UInt64> (LDP src mem)) (Select1 <typ.UInt64> (LDP src mem)) mem))
 19312  	for {
 19313  		s := auxIntToInt64(v.AuxInt)
 19314  		dst := v_0
 19315  		src := v_1
 19316  		mem := v_2
 19317  		if !(s > 16 && s <= 24) {
 19318  			break
 19319  		}
 19320  		v.reset(OpARM64MOVDstore)
 19321  		v.AuxInt = int32ToAuxInt(int32(s - 8))
 19322  		v0 := b.NewValue0(v.Pos, OpARM64MOVDload, typ.UInt64)
 19323  		v0.AuxInt = int32ToAuxInt(int32(s - 8))
 19324  		v0.AddArg2(src, mem)
 19325  		v1 := b.NewValue0(v.Pos, OpARM64STP, types.TypeMem)
 19326  		v2 := b.NewValue0(v.Pos, OpSelect0, typ.UInt64)
 19327  		v3 := b.NewValue0(v.Pos, OpARM64LDP, types.NewTuple(typ.UInt64, typ.UInt64))
 19328  		v3.AddArg2(src, mem)
 19329  		v2.AddArg(v3)
 19330  		v4 := b.NewValue0(v.Pos, OpSelect1, typ.UInt64)
 19331  		v4.AddArg(v3)
 19332  		v1.AddArg4(dst, v2, v4, mem)
 19333  		v.AddArg3(dst, v0, v1)
 19334  		return true
 19335  	}
 19336  	// match: (Move [s] dst src mem)
 19337  	// cond: s > 24 && s <= 32
 19338  	// result: (STP [int32(s-16)] dst (Select0 <typ.UInt64> (LDP [int32(s-16)] src mem)) (Select1 <typ.UInt64> (LDP [int32(s-16)] src mem)) (STP dst (Select0 <typ.UInt64> (LDP src mem)) (Select1 <typ.UInt64> (LDP src mem)) mem))
 19339  	for {
 19340  		s := auxIntToInt64(v.AuxInt)
 19341  		dst := v_0
 19342  		src := v_1
 19343  		mem := v_2
 19344  		if !(s > 24 && s <= 32) {
 19345  			break
 19346  		}
 19347  		v.reset(OpARM64STP)
 19348  		v.AuxInt = int32ToAuxInt(int32(s - 16))
 19349  		v0 := b.NewValue0(v.Pos, OpSelect0, typ.UInt64)
 19350  		v1 := b.NewValue0(v.Pos, OpARM64LDP, types.NewTuple(typ.UInt64, typ.UInt64))
 19351  		v1.AuxInt = int32ToAuxInt(int32(s - 16))
 19352  		v1.AddArg2(src, mem)
 19353  		v0.AddArg(v1)
 19354  		v2 := b.NewValue0(v.Pos, OpSelect1, typ.UInt64)
 19355  		v2.AddArg(v1)
 19356  		v3 := b.NewValue0(v.Pos, OpARM64STP, types.TypeMem)
 19357  		v4 := b.NewValue0(v.Pos, OpSelect0, typ.UInt64)
 19358  		v5 := b.NewValue0(v.Pos, OpARM64LDP, types.NewTuple(typ.UInt64, typ.UInt64))
 19359  		v5.AddArg2(src, mem)
 19360  		v4.AddArg(v5)
 19361  		v6 := b.NewValue0(v.Pos, OpSelect1, typ.UInt64)
 19362  		v6.AddArg(v5)
 19363  		v3.AddArg4(dst, v4, v6, mem)
 19364  		v.AddArg4(dst, v0, v2, v3)
 19365  		return true
 19366  	}
 19367  	// match: (Move [s] dst src mem)
 19368  	// cond: s > 32 && s <= 40
 19369  	// result: (MOVDstore [int32(s-8)] dst (MOVDload [int32(s-8)] src mem) (STP [16] dst (Select0 <typ.UInt64> (LDP [16] src mem)) (Select1 <typ.UInt64> (LDP [16] src mem)) (STP dst (Select0 <typ.UInt64> (LDP src mem)) (Select1 <typ.UInt64> (LDP src mem)) mem)))
 19370  	for {
 19371  		s := auxIntToInt64(v.AuxInt)
 19372  		dst := v_0
 19373  		src := v_1
 19374  		mem := v_2
 19375  		if !(s > 32 && s <= 40) {
 19376  			break
 19377  		}
 19378  		v.reset(OpARM64MOVDstore)
 19379  		v.AuxInt = int32ToAuxInt(int32(s - 8))
 19380  		v0 := b.NewValue0(v.Pos, OpARM64MOVDload, typ.UInt64)
 19381  		v0.AuxInt = int32ToAuxInt(int32(s - 8))
 19382  		v0.AddArg2(src, mem)
 19383  		v1 := b.NewValue0(v.Pos, OpARM64STP, types.TypeMem)
 19384  		v1.AuxInt = int32ToAuxInt(16)
 19385  		v2 := b.NewValue0(v.Pos, OpSelect0, typ.UInt64)
 19386  		v3 := b.NewValue0(v.Pos, OpARM64LDP, types.NewTuple(typ.UInt64, typ.UInt64))
 19387  		v3.AuxInt = int32ToAuxInt(16)
 19388  		v3.AddArg2(src, mem)
 19389  		v2.AddArg(v3)
 19390  		v4 := b.NewValue0(v.Pos, OpSelect1, typ.UInt64)
 19391  		v4.AddArg(v3)
 19392  		v5 := b.NewValue0(v.Pos, OpARM64STP, types.TypeMem)
 19393  		v6 := b.NewValue0(v.Pos, OpSelect0, typ.UInt64)
 19394  		v7 := b.NewValue0(v.Pos, OpARM64LDP, types.NewTuple(typ.UInt64, typ.UInt64))
 19395  		v7.AddArg2(src, mem)
 19396  		v6.AddArg(v7)
 19397  		v8 := b.NewValue0(v.Pos, OpSelect1, typ.UInt64)
 19398  		v8.AddArg(v7)
 19399  		v5.AddArg4(dst, v6, v8, mem)
 19400  		v1.AddArg4(dst, v2, v4, v5)
 19401  		v.AddArg3(dst, v0, v1)
 19402  		return true
 19403  	}
 19404  	// match: (Move [s] dst src mem)
 19405  	// cond: s > 40 && s <= 48
 19406  	// result: (STP [int32(s-16)] dst (Select0 <typ.UInt64> (LDP [int32(s-16)] src mem)) (Select1 <typ.UInt64> (LDP [int32(s-16)] src mem)) (STP [16] dst (Select0 <typ.UInt64> (LDP [16] src mem)) (Select1 <typ.UInt64> (LDP [16] src mem)) (STP dst (Select0 <typ.UInt64> (LDP src mem)) (Select1 <typ.UInt64> (LDP src mem)) mem)))
 19407  	for {
 19408  		s := auxIntToInt64(v.AuxInt)
 19409  		dst := v_0
 19410  		src := v_1
 19411  		mem := v_2
 19412  		if !(s > 40 && s <= 48) {
 19413  			break
 19414  		}
 19415  		v.reset(OpARM64STP)
 19416  		v.AuxInt = int32ToAuxInt(int32(s - 16))
 19417  		v0 := b.NewValue0(v.Pos, OpSelect0, typ.UInt64)
 19418  		v1 := b.NewValue0(v.Pos, OpARM64LDP, types.NewTuple(typ.UInt64, typ.UInt64))
 19419  		v1.AuxInt = int32ToAuxInt(int32(s - 16))
 19420  		v1.AddArg2(src, mem)
 19421  		v0.AddArg(v1)
 19422  		v2 := b.NewValue0(v.Pos, OpSelect1, typ.UInt64)
 19423  		v2.AddArg(v1)
 19424  		v3 := b.NewValue0(v.Pos, OpARM64STP, types.TypeMem)
 19425  		v3.AuxInt = int32ToAuxInt(16)
 19426  		v4 := b.NewValue0(v.Pos, OpSelect0, typ.UInt64)
 19427  		v5 := b.NewValue0(v.Pos, OpARM64LDP, types.NewTuple(typ.UInt64, typ.UInt64))
 19428  		v5.AuxInt = int32ToAuxInt(16)
 19429  		v5.AddArg2(src, mem)
 19430  		v4.AddArg(v5)
 19431  		v6 := b.NewValue0(v.Pos, OpSelect1, typ.UInt64)
 19432  		v6.AddArg(v5)
 19433  		v7 := b.NewValue0(v.Pos, OpARM64STP, types.TypeMem)
 19434  		v8 := b.NewValue0(v.Pos, OpSelect0, typ.UInt64)
 19435  		v9 := b.NewValue0(v.Pos, OpARM64LDP, types.NewTuple(typ.UInt64, typ.UInt64))
 19436  		v9.AddArg2(src, mem)
 19437  		v8.AddArg(v9)
 19438  		v10 := b.NewValue0(v.Pos, OpSelect1, typ.UInt64)
 19439  		v10.AddArg(v9)
 19440  		v7.AddArg4(dst, v8, v10, mem)
 19441  		v3.AddArg4(dst, v4, v6, v7)
 19442  		v.AddArg4(dst, v0, v2, v3)
 19443  		return true
 19444  	}
 19445  	// match: (Move [s] dst src mem)
 19446  	// cond: s > 48 && s <= 56
 19447  	// result: (MOVDstore [int32(s-8)] dst (MOVDload [int32(s-8)] src mem) (STP [32] dst (Select0 <typ.UInt64> (LDP [32] src mem)) (Select1 <typ.UInt64> (LDP [32] src mem)) (STP [16] dst (Select0 <typ.UInt64> (LDP [16] src mem)) (Select1 <typ.UInt64> (LDP [16] src mem)) (STP dst (Select0 <typ.UInt64> (LDP src mem)) (Select1 <typ.UInt64> (LDP src mem)) mem))))
 19448  	for {
 19449  		s := auxIntToInt64(v.AuxInt)
 19450  		dst := v_0
 19451  		src := v_1
 19452  		mem := v_2
 19453  		if !(s > 48 && s <= 56) {
 19454  			break
 19455  		}
 19456  		v.reset(OpARM64MOVDstore)
 19457  		v.AuxInt = int32ToAuxInt(int32(s - 8))
 19458  		v0 := b.NewValue0(v.Pos, OpARM64MOVDload, typ.UInt64)
 19459  		v0.AuxInt = int32ToAuxInt(int32(s - 8))
 19460  		v0.AddArg2(src, mem)
 19461  		v1 := b.NewValue0(v.Pos, OpARM64STP, types.TypeMem)
 19462  		v1.AuxInt = int32ToAuxInt(32)
 19463  		v2 := b.NewValue0(v.Pos, OpSelect0, typ.UInt64)
 19464  		v3 := b.NewValue0(v.Pos, OpARM64LDP, types.NewTuple(typ.UInt64, typ.UInt64))
 19465  		v3.AuxInt = int32ToAuxInt(32)
 19466  		v3.AddArg2(src, mem)
 19467  		v2.AddArg(v3)
 19468  		v4 := b.NewValue0(v.Pos, OpSelect1, typ.UInt64)
 19469  		v4.AddArg(v3)
 19470  		v5 := b.NewValue0(v.Pos, OpARM64STP, types.TypeMem)
 19471  		v5.AuxInt = int32ToAuxInt(16)
 19472  		v6 := b.NewValue0(v.Pos, OpSelect0, typ.UInt64)
 19473  		v7 := b.NewValue0(v.Pos, OpARM64LDP, types.NewTuple(typ.UInt64, typ.UInt64))
 19474  		v7.AuxInt = int32ToAuxInt(16)
 19475  		v7.AddArg2(src, mem)
 19476  		v6.AddArg(v7)
 19477  		v8 := b.NewValue0(v.Pos, OpSelect1, typ.UInt64)
 19478  		v8.AddArg(v7)
 19479  		v9 := b.NewValue0(v.Pos, OpARM64STP, types.TypeMem)
 19480  		v10 := b.NewValue0(v.Pos, OpSelect0, typ.UInt64)
 19481  		v11 := b.NewValue0(v.Pos, OpARM64LDP, types.NewTuple(typ.UInt64, typ.UInt64))
 19482  		v11.AddArg2(src, mem)
 19483  		v10.AddArg(v11)
 19484  		v12 := b.NewValue0(v.Pos, OpSelect1, typ.UInt64)
 19485  		v12.AddArg(v11)
 19486  		v9.AddArg4(dst, v10, v12, mem)
 19487  		v5.AddArg4(dst, v6, v8, v9)
 19488  		v1.AddArg4(dst, v2, v4, v5)
 19489  		v.AddArg3(dst, v0, v1)
 19490  		return true
 19491  	}
 19492  	// match: (Move [s] dst src mem)
 19493  	// cond: s > 56 && s <= 64
 19494  	// result: (STP [int32(s-16)] dst (Select0 <typ.UInt64> (LDP [int32(s-16)] src mem)) (Select1 <typ.UInt64> (LDP [int32(s-16)] src mem)) (STP [32] dst (Select0 <typ.UInt64> (LDP [32] src mem)) (Select1 <typ.UInt64> (LDP [32] src mem)) (STP [16] dst (Select0 <typ.UInt64> (LDP [16] src mem)) (Select1 <typ.UInt64> (LDP [16] src mem)) (STP dst (Select0 <typ.UInt64> (LDP src mem)) (Select1 <typ.UInt64> (LDP src mem)) mem))))
 19495  	for {
 19496  		s := auxIntToInt64(v.AuxInt)
 19497  		dst := v_0
 19498  		src := v_1
 19499  		mem := v_2
 19500  		if !(s > 56 && s <= 64) {
 19501  			break
 19502  		}
 19503  		v.reset(OpARM64STP)
 19504  		v.AuxInt = int32ToAuxInt(int32(s - 16))
 19505  		v0 := b.NewValue0(v.Pos, OpSelect0, typ.UInt64)
 19506  		v1 := b.NewValue0(v.Pos, OpARM64LDP, types.NewTuple(typ.UInt64, typ.UInt64))
 19507  		v1.AuxInt = int32ToAuxInt(int32(s - 16))
 19508  		v1.AddArg2(src, mem)
 19509  		v0.AddArg(v1)
 19510  		v2 := b.NewValue0(v.Pos, OpSelect1, typ.UInt64)
 19511  		v2.AddArg(v1)
 19512  		v3 := b.NewValue0(v.Pos, OpARM64STP, types.TypeMem)
 19513  		v3.AuxInt = int32ToAuxInt(32)
 19514  		v4 := b.NewValue0(v.Pos, OpSelect0, typ.UInt64)
 19515  		v5 := b.NewValue0(v.Pos, OpARM64LDP, types.NewTuple(typ.UInt64, typ.UInt64))
 19516  		v5.AuxInt = int32ToAuxInt(32)
 19517  		v5.AddArg2(src, mem)
 19518  		v4.AddArg(v5)
 19519  		v6 := b.NewValue0(v.Pos, OpSelect1, typ.UInt64)
 19520  		v6.AddArg(v5)
 19521  		v7 := b.NewValue0(v.Pos, OpARM64STP, types.TypeMem)
 19522  		v7.AuxInt = int32ToAuxInt(16)
 19523  		v8 := b.NewValue0(v.Pos, OpSelect0, typ.UInt64)
 19524  		v9 := b.NewValue0(v.Pos, OpARM64LDP, types.NewTuple(typ.UInt64, typ.UInt64))
 19525  		v9.AuxInt = int32ToAuxInt(16)
 19526  		v9.AddArg2(src, mem)
 19527  		v8.AddArg(v9)
 19528  		v10 := b.NewValue0(v.Pos, OpSelect1, typ.UInt64)
 19529  		v10.AddArg(v9)
 19530  		v11 := b.NewValue0(v.Pos, OpARM64STP, types.TypeMem)
 19531  		v12 := b.NewValue0(v.Pos, OpSelect0, typ.UInt64)
 19532  		v13 := b.NewValue0(v.Pos, OpARM64LDP, types.NewTuple(typ.UInt64, typ.UInt64))
 19533  		v13.AddArg2(src, mem)
 19534  		v12.AddArg(v13)
 19535  		v14 := b.NewValue0(v.Pos, OpSelect1, typ.UInt64)
 19536  		v14.AddArg(v13)
 19537  		v11.AddArg4(dst, v12, v14, mem)
 19538  		v7.AddArg4(dst, v8, v10, v11)
 19539  		v3.AddArg4(dst, v4, v6, v7)
 19540  		v.AddArg4(dst, v0, v2, v3)
 19541  		return true
 19542  	}
 19543  	// match: (Move [s] dst src mem)
 19544  	// cond: s%16 != 0 && s%16 <= 8 && s > 64
 19545  	// result: (Move [8] (OffPtr <dst.Type> dst [s-8]) (OffPtr <src.Type> src [s-8]) (Move [s-s%16] dst src mem))
 19546  	for {
 19547  		s := auxIntToInt64(v.AuxInt)
 19548  		dst := v_0
 19549  		src := v_1
 19550  		mem := v_2
 19551  		if !(s%16 != 0 && s%16 <= 8 && s > 64) {
 19552  			break
 19553  		}
 19554  		v.reset(OpMove)
 19555  		v.AuxInt = int64ToAuxInt(8)
 19556  		v0 := b.NewValue0(v.Pos, OpOffPtr, dst.Type)
 19557  		v0.AuxInt = int64ToAuxInt(s - 8)
 19558  		v0.AddArg(dst)
 19559  		v1 := b.NewValue0(v.Pos, OpOffPtr, src.Type)
 19560  		v1.AuxInt = int64ToAuxInt(s - 8)
 19561  		v1.AddArg(src)
 19562  		v2 := b.NewValue0(v.Pos, OpMove, types.TypeMem)
 19563  		v2.AuxInt = int64ToAuxInt(s - s%16)
 19564  		v2.AddArg3(dst, src, mem)
 19565  		v.AddArg3(v0, v1, v2)
 19566  		return true
 19567  	}
 19568  	// match: (Move [s] dst src mem)
 19569  	// cond: s%16 != 0 && s%16 > 8 && s > 64
 19570  	// result: (Move [16] (OffPtr <dst.Type> dst [s-16]) (OffPtr <src.Type> src [s-16]) (Move [s-s%16] dst src mem))
 19571  	for {
 19572  		s := auxIntToInt64(v.AuxInt)
 19573  		dst := v_0
 19574  		src := v_1
 19575  		mem := v_2
 19576  		if !(s%16 != 0 && s%16 > 8 && s > 64) {
 19577  			break
 19578  		}
 19579  		v.reset(OpMove)
 19580  		v.AuxInt = int64ToAuxInt(16)
 19581  		v0 := b.NewValue0(v.Pos, OpOffPtr, dst.Type)
 19582  		v0.AuxInt = int64ToAuxInt(s - 16)
 19583  		v0.AddArg(dst)
 19584  		v1 := b.NewValue0(v.Pos, OpOffPtr, src.Type)
 19585  		v1.AuxInt = int64ToAuxInt(s - 16)
 19586  		v1.AddArg(src)
 19587  		v2 := b.NewValue0(v.Pos, OpMove, types.TypeMem)
 19588  		v2.AuxInt = int64ToAuxInt(s - s%16)
 19589  		v2.AddArg3(dst, src, mem)
 19590  		v.AddArg3(v0, v1, v2)
 19591  		return true
 19592  	}
 19593  	// match: (Move [s] dst src mem)
 19594  	// cond: s > 64 && s <= 16*64 && s%16 == 0 && logLargeCopy(v, s)
 19595  	// result: (DUFFCOPY [8 * (64 - s/16)] dst src mem)
 19596  	for {
 19597  		s := auxIntToInt64(v.AuxInt)
 19598  		dst := v_0
 19599  		src := v_1
 19600  		mem := v_2
 19601  		if !(s > 64 && s <= 16*64 && s%16 == 0 && logLargeCopy(v, s)) {
 19602  			break
 19603  		}
 19604  		v.reset(OpARM64DUFFCOPY)
 19605  		v.AuxInt = int64ToAuxInt(8 * (64 - s/16))
 19606  		v.AddArg3(dst, src, mem)
 19607  		return true
 19608  	}
 19609  	// match: (Move [s] dst src mem)
 19610  	// cond: s%16 == 0 && s > 16*64 && logLargeCopy(v, s)
 19611  	// result: (LoweredMove dst src (ADDconst <src.Type> src [s-16]) mem)
 19612  	for {
 19613  		s := auxIntToInt64(v.AuxInt)
 19614  		dst := v_0
 19615  		src := v_1
 19616  		mem := v_2
 19617  		if !(s%16 == 0 && s > 16*64 && logLargeCopy(v, s)) {
 19618  			break
 19619  		}
 19620  		v.reset(OpARM64LoweredMove)
 19621  		v0 := b.NewValue0(v.Pos, OpARM64ADDconst, src.Type)
 19622  		v0.AuxInt = int64ToAuxInt(s - 16)
 19623  		v0.AddArg(src)
 19624  		v.AddArg4(dst, src, v0, mem)
 19625  		return true
 19626  	}
 19627  	return false
 19628  }
 19629  func rewriteValueARM64_OpNeq16(v *Value) bool {
 19630  	v_1 := v.Args[1]
 19631  	v_0 := v.Args[0]
 19632  	b := v.Block
 19633  	typ := &b.Func.Config.Types
 19634  	// match: (Neq16 x y)
 19635  	// result: (NotEqual (CMPW (ZeroExt16to32 x) (ZeroExt16to32 y)))
 19636  	for {
 19637  		x := v_0
 19638  		y := v_1
 19639  		v.reset(OpARM64NotEqual)
 19640  		v0 := b.NewValue0(v.Pos, OpARM64CMPW, types.TypeFlags)
 19641  		v1 := b.NewValue0(v.Pos, OpZeroExt16to32, typ.UInt32)
 19642  		v1.AddArg(x)
 19643  		v2 := b.NewValue0(v.Pos, OpZeroExt16to32, typ.UInt32)
 19644  		v2.AddArg(y)
 19645  		v0.AddArg2(v1, v2)
 19646  		v.AddArg(v0)
 19647  		return true
 19648  	}
 19649  }
 19650  func rewriteValueARM64_OpNeq32(v *Value) bool {
 19651  	v_1 := v.Args[1]
 19652  	v_0 := v.Args[0]
 19653  	b := v.Block
 19654  	// match: (Neq32 x y)
 19655  	// result: (NotEqual (CMPW x y))
 19656  	for {
 19657  		x := v_0
 19658  		y := v_1
 19659  		v.reset(OpARM64NotEqual)
 19660  		v0 := b.NewValue0(v.Pos, OpARM64CMPW, types.TypeFlags)
 19661  		v0.AddArg2(x, y)
 19662  		v.AddArg(v0)
 19663  		return true
 19664  	}
 19665  }
 19666  func rewriteValueARM64_OpNeq32F(v *Value) bool {
 19667  	v_1 := v.Args[1]
 19668  	v_0 := v.Args[0]
 19669  	b := v.Block
 19670  	// match: (Neq32F x y)
 19671  	// result: (NotEqual (FCMPS x y))
 19672  	for {
 19673  		x := v_0
 19674  		y := v_1
 19675  		v.reset(OpARM64NotEqual)
 19676  		v0 := b.NewValue0(v.Pos, OpARM64FCMPS, types.TypeFlags)
 19677  		v0.AddArg2(x, y)
 19678  		v.AddArg(v0)
 19679  		return true
 19680  	}
 19681  }
 19682  func rewriteValueARM64_OpNeq64(v *Value) bool {
 19683  	v_1 := v.Args[1]
 19684  	v_0 := v.Args[0]
 19685  	b := v.Block
 19686  	// match: (Neq64 x y)
 19687  	// result: (NotEqual (CMP x y))
 19688  	for {
 19689  		x := v_0
 19690  		y := v_1
 19691  		v.reset(OpARM64NotEqual)
 19692  		v0 := b.NewValue0(v.Pos, OpARM64CMP, types.TypeFlags)
 19693  		v0.AddArg2(x, y)
 19694  		v.AddArg(v0)
 19695  		return true
 19696  	}
 19697  }
 19698  func rewriteValueARM64_OpNeq64F(v *Value) bool {
 19699  	v_1 := v.Args[1]
 19700  	v_0 := v.Args[0]
 19701  	b := v.Block
 19702  	// match: (Neq64F x y)
 19703  	// result: (NotEqual (FCMPD x y))
 19704  	for {
 19705  		x := v_0
 19706  		y := v_1
 19707  		v.reset(OpARM64NotEqual)
 19708  		v0 := b.NewValue0(v.Pos, OpARM64FCMPD, types.TypeFlags)
 19709  		v0.AddArg2(x, y)
 19710  		v.AddArg(v0)
 19711  		return true
 19712  	}
 19713  }
 19714  func rewriteValueARM64_OpNeq8(v *Value) bool {
 19715  	v_1 := v.Args[1]
 19716  	v_0 := v.Args[0]
 19717  	b := v.Block
 19718  	typ := &b.Func.Config.Types
 19719  	// match: (Neq8 x y)
 19720  	// result: (NotEqual (CMPW (ZeroExt8to32 x) (ZeroExt8to32 y)))
 19721  	for {
 19722  		x := v_0
 19723  		y := v_1
 19724  		v.reset(OpARM64NotEqual)
 19725  		v0 := b.NewValue0(v.Pos, OpARM64CMPW, types.TypeFlags)
 19726  		v1 := b.NewValue0(v.Pos, OpZeroExt8to32, typ.UInt32)
 19727  		v1.AddArg(x)
 19728  		v2 := b.NewValue0(v.Pos, OpZeroExt8to32, typ.UInt32)
 19729  		v2.AddArg(y)
 19730  		v0.AddArg2(v1, v2)
 19731  		v.AddArg(v0)
 19732  		return true
 19733  	}
 19734  }
 19735  func rewriteValueARM64_OpNeqPtr(v *Value) bool {
 19736  	v_1 := v.Args[1]
 19737  	v_0 := v.Args[0]
 19738  	b := v.Block
 19739  	// match: (NeqPtr x y)
 19740  	// result: (NotEqual (CMP x y))
 19741  	for {
 19742  		x := v_0
 19743  		y := v_1
 19744  		v.reset(OpARM64NotEqual)
 19745  		v0 := b.NewValue0(v.Pos, OpARM64CMP, types.TypeFlags)
 19746  		v0.AddArg2(x, y)
 19747  		v.AddArg(v0)
 19748  		return true
 19749  	}
 19750  }
 19751  func rewriteValueARM64_OpNot(v *Value) bool {
 19752  	v_0 := v.Args[0]
 19753  	b := v.Block
 19754  	typ := &b.Func.Config.Types
 19755  	// match: (Not x)
 19756  	// result: (XOR (MOVDconst [1]) x)
 19757  	for {
 19758  		x := v_0
 19759  		v.reset(OpARM64XOR)
 19760  		v0 := b.NewValue0(v.Pos, OpARM64MOVDconst, typ.UInt64)
 19761  		v0.AuxInt = int64ToAuxInt(1)
 19762  		v.AddArg2(v0, x)
 19763  		return true
 19764  	}
 19765  }
 19766  func rewriteValueARM64_OpOffPtr(v *Value) bool {
 19767  	v_0 := v.Args[0]
 19768  	// match: (OffPtr [off] ptr:(SP))
 19769  	// cond: is32Bit(off)
 19770  	// result: (MOVDaddr [int32(off)] ptr)
 19771  	for {
 19772  		off := auxIntToInt64(v.AuxInt)
 19773  		ptr := v_0
 19774  		if ptr.Op != OpSP || !(is32Bit(off)) {
 19775  			break
 19776  		}
 19777  		v.reset(OpARM64MOVDaddr)
 19778  		v.AuxInt = int32ToAuxInt(int32(off))
 19779  		v.AddArg(ptr)
 19780  		return true
 19781  	}
 19782  	// match: (OffPtr [off] ptr)
 19783  	// result: (ADDconst [off] ptr)
 19784  	for {
 19785  		off := auxIntToInt64(v.AuxInt)
 19786  		ptr := v_0
 19787  		v.reset(OpARM64ADDconst)
 19788  		v.AuxInt = int64ToAuxInt(off)
 19789  		v.AddArg(ptr)
 19790  		return true
 19791  	}
 19792  }
 19793  func rewriteValueARM64_OpPanicBounds(v *Value) bool {
 19794  	v_2 := v.Args[2]
 19795  	v_1 := v.Args[1]
 19796  	v_0 := v.Args[0]
 19797  	// match: (PanicBounds [kind] x y mem)
 19798  	// cond: boundsABI(kind) == 0
 19799  	// result: (LoweredPanicBoundsA [kind] x y mem)
 19800  	for {
 19801  		kind := auxIntToInt64(v.AuxInt)
 19802  		x := v_0
 19803  		y := v_1
 19804  		mem := v_2
 19805  		if !(boundsABI(kind) == 0) {
 19806  			break
 19807  		}
 19808  		v.reset(OpARM64LoweredPanicBoundsA)
 19809  		v.AuxInt = int64ToAuxInt(kind)
 19810  		v.AddArg3(x, y, mem)
 19811  		return true
 19812  	}
 19813  	// match: (PanicBounds [kind] x y mem)
 19814  	// cond: boundsABI(kind) == 1
 19815  	// result: (LoweredPanicBoundsB [kind] x y mem)
 19816  	for {
 19817  		kind := auxIntToInt64(v.AuxInt)
 19818  		x := v_0
 19819  		y := v_1
 19820  		mem := v_2
 19821  		if !(boundsABI(kind) == 1) {
 19822  			break
 19823  		}
 19824  		v.reset(OpARM64LoweredPanicBoundsB)
 19825  		v.AuxInt = int64ToAuxInt(kind)
 19826  		v.AddArg3(x, y, mem)
 19827  		return true
 19828  	}
 19829  	// match: (PanicBounds [kind] x y mem)
 19830  	// cond: boundsABI(kind) == 2
 19831  	// result: (LoweredPanicBoundsC [kind] x y mem)
 19832  	for {
 19833  		kind := auxIntToInt64(v.AuxInt)
 19834  		x := v_0
 19835  		y := v_1
 19836  		mem := v_2
 19837  		if !(boundsABI(kind) == 2) {
 19838  			break
 19839  		}
 19840  		v.reset(OpARM64LoweredPanicBoundsC)
 19841  		v.AuxInt = int64ToAuxInt(kind)
 19842  		v.AddArg3(x, y, mem)
 19843  		return true
 19844  	}
 19845  	return false
 19846  }
 19847  func rewriteValueARM64_OpPopCount16(v *Value) bool {
 19848  	v_0 := v.Args[0]
 19849  	b := v.Block
 19850  	typ := &b.Func.Config.Types
 19851  	// match: (PopCount16 <t> x)
 19852  	// result: (FMOVDfpgp <t> (VUADDLV <typ.Float64> (VCNT <typ.Float64> (FMOVDgpfp <typ.Float64> (ZeroExt16to64 x)))))
 19853  	for {
 19854  		t := v.Type
 19855  		x := v_0
 19856  		v.reset(OpARM64FMOVDfpgp)
 19857  		v.Type = t
 19858  		v0 := b.NewValue0(v.Pos, OpARM64VUADDLV, typ.Float64)
 19859  		v1 := b.NewValue0(v.Pos, OpARM64VCNT, typ.Float64)
 19860  		v2 := b.NewValue0(v.Pos, OpARM64FMOVDgpfp, typ.Float64)
 19861  		v3 := b.NewValue0(v.Pos, OpZeroExt16to64, typ.UInt64)
 19862  		v3.AddArg(x)
 19863  		v2.AddArg(v3)
 19864  		v1.AddArg(v2)
 19865  		v0.AddArg(v1)
 19866  		v.AddArg(v0)
 19867  		return true
 19868  	}
 19869  }
 19870  func rewriteValueARM64_OpPopCount32(v *Value) bool {
 19871  	v_0 := v.Args[0]
 19872  	b := v.Block
 19873  	typ := &b.Func.Config.Types
 19874  	// match: (PopCount32 <t> x)
 19875  	// result: (FMOVDfpgp <t> (VUADDLV <typ.Float64> (VCNT <typ.Float64> (FMOVDgpfp <typ.Float64> (ZeroExt32to64 x)))))
 19876  	for {
 19877  		t := v.Type
 19878  		x := v_0
 19879  		v.reset(OpARM64FMOVDfpgp)
 19880  		v.Type = t
 19881  		v0 := b.NewValue0(v.Pos, OpARM64VUADDLV, typ.Float64)
 19882  		v1 := b.NewValue0(v.Pos, OpARM64VCNT, typ.Float64)
 19883  		v2 := b.NewValue0(v.Pos, OpARM64FMOVDgpfp, typ.Float64)
 19884  		v3 := b.NewValue0(v.Pos, OpZeroExt32to64, typ.UInt64)
 19885  		v3.AddArg(x)
 19886  		v2.AddArg(v3)
 19887  		v1.AddArg(v2)
 19888  		v0.AddArg(v1)
 19889  		v.AddArg(v0)
 19890  		return true
 19891  	}
 19892  }
 19893  func rewriteValueARM64_OpPopCount64(v *Value) bool {
 19894  	v_0 := v.Args[0]
 19895  	b := v.Block
 19896  	typ := &b.Func.Config.Types
 19897  	// match: (PopCount64 <t> x)
 19898  	// result: (FMOVDfpgp <t> (VUADDLV <typ.Float64> (VCNT <typ.Float64> (FMOVDgpfp <typ.Float64> x))))
 19899  	for {
 19900  		t := v.Type
 19901  		x := v_0
 19902  		v.reset(OpARM64FMOVDfpgp)
 19903  		v.Type = t
 19904  		v0 := b.NewValue0(v.Pos, OpARM64VUADDLV, typ.Float64)
 19905  		v1 := b.NewValue0(v.Pos, OpARM64VCNT, typ.Float64)
 19906  		v2 := b.NewValue0(v.Pos, OpARM64FMOVDgpfp, typ.Float64)
 19907  		v2.AddArg(x)
 19908  		v1.AddArg(v2)
 19909  		v0.AddArg(v1)
 19910  		v.AddArg(v0)
 19911  		return true
 19912  	}
 19913  }
 19914  func rewriteValueARM64_OpPrefetchCache(v *Value) bool {
 19915  	v_1 := v.Args[1]
 19916  	v_0 := v.Args[0]
 19917  	// match: (PrefetchCache addr mem)
 19918  	// result: (PRFM [0] addr mem)
 19919  	for {
 19920  		addr := v_0
 19921  		mem := v_1
 19922  		v.reset(OpARM64PRFM)
 19923  		v.AuxInt = int64ToAuxInt(0)
 19924  		v.AddArg2(addr, mem)
 19925  		return true
 19926  	}
 19927  }
 19928  func rewriteValueARM64_OpPrefetchCacheStreamed(v *Value) bool {
 19929  	v_1 := v.Args[1]
 19930  	v_0 := v.Args[0]
 19931  	// match: (PrefetchCacheStreamed addr mem)
 19932  	// result: (PRFM [1] addr mem)
 19933  	for {
 19934  		addr := v_0
 19935  		mem := v_1
 19936  		v.reset(OpARM64PRFM)
 19937  		v.AuxInt = int64ToAuxInt(1)
 19938  		v.AddArg2(addr, mem)
 19939  		return true
 19940  	}
 19941  }
 19942  func rewriteValueARM64_OpPubBarrier(v *Value) bool {
 19943  	v_0 := v.Args[0]
 19944  	// match: (PubBarrier mem)
 19945  	// result: (DMB [0xe] mem)
 19946  	for {
 19947  		mem := v_0
 19948  		v.reset(OpARM64DMB)
 19949  		v.AuxInt = int64ToAuxInt(0xe)
 19950  		v.AddArg(mem)
 19951  		return true
 19952  	}
 19953  }
 19954  func rewriteValueARM64_OpRotateLeft16(v *Value) bool {
 19955  	v_1 := v.Args[1]
 19956  	v_0 := v.Args[0]
 19957  	b := v.Block
 19958  	typ := &b.Func.Config.Types
 19959  	// match: (RotateLeft16 <t> x (MOVDconst [c]))
 19960  	// result: (Or16 (Lsh16x64 <t> x (MOVDconst [c&15])) (Rsh16Ux64 <t> x (MOVDconst [-c&15])))
 19961  	for {
 19962  		t := v.Type
 19963  		x := v_0
 19964  		if v_1.Op != OpARM64MOVDconst {
 19965  			break
 19966  		}
 19967  		c := auxIntToInt64(v_1.AuxInt)
 19968  		v.reset(OpOr16)
 19969  		v0 := b.NewValue0(v.Pos, OpLsh16x64, t)
 19970  		v1 := b.NewValue0(v.Pos, OpARM64MOVDconst, typ.UInt64)
 19971  		v1.AuxInt = int64ToAuxInt(c & 15)
 19972  		v0.AddArg2(x, v1)
 19973  		v2 := b.NewValue0(v.Pos, OpRsh16Ux64, t)
 19974  		v3 := b.NewValue0(v.Pos, OpARM64MOVDconst, typ.UInt64)
 19975  		v3.AuxInt = int64ToAuxInt(-c & 15)
 19976  		v2.AddArg2(x, v3)
 19977  		v.AddArg2(v0, v2)
 19978  		return true
 19979  	}
 19980  	// match: (RotateLeft16 <t> x y)
 19981  	// result: (RORW <t> (ORshiftLL <typ.UInt32> (ZeroExt16to32 x) (ZeroExt16to32 x) [16]) (NEG <typ.Int64> y))
 19982  	for {
 19983  		t := v.Type
 19984  		x := v_0
 19985  		y := v_1
 19986  		v.reset(OpARM64RORW)
 19987  		v.Type = t
 19988  		v0 := b.NewValue0(v.Pos, OpARM64ORshiftLL, typ.UInt32)
 19989  		v0.AuxInt = int64ToAuxInt(16)
 19990  		v1 := b.NewValue0(v.Pos, OpZeroExt16to32, typ.UInt32)
 19991  		v1.AddArg(x)
 19992  		v0.AddArg2(v1, v1)
 19993  		v2 := b.NewValue0(v.Pos, OpARM64NEG, typ.Int64)
 19994  		v2.AddArg(y)
 19995  		v.AddArg2(v0, v2)
 19996  		return true
 19997  	}
 19998  }
 19999  func rewriteValueARM64_OpRotateLeft32(v *Value) bool {
 20000  	v_1 := v.Args[1]
 20001  	v_0 := v.Args[0]
 20002  	b := v.Block
 20003  	// match: (RotateLeft32 x y)
 20004  	// result: (RORW x (NEG <y.Type> y))
 20005  	for {
 20006  		x := v_0
 20007  		y := v_1
 20008  		v.reset(OpARM64RORW)
 20009  		v0 := b.NewValue0(v.Pos, OpARM64NEG, y.Type)
 20010  		v0.AddArg(y)
 20011  		v.AddArg2(x, v0)
 20012  		return true
 20013  	}
 20014  }
 20015  func rewriteValueARM64_OpRotateLeft64(v *Value) bool {
 20016  	v_1 := v.Args[1]
 20017  	v_0 := v.Args[0]
 20018  	b := v.Block
 20019  	// match: (RotateLeft64 x y)
 20020  	// result: (ROR x (NEG <y.Type> y))
 20021  	for {
 20022  		x := v_0
 20023  		y := v_1
 20024  		v.reset(OpARM64ROR)
 20025  		v0 := b.NewValue0(v.Pos, OpARM64NEG, y.Type)
 20026  		v0.AddArg(y)
 20027  		v.AddArg2(x, v0)
 20028  		return true
 20029  	}
 20030  }
 20031  func rewriteValueARM64_OpRotateLeft8(v *Value) bool {
 20032  	v_1 := v.Args[1]
 20033  	v_0 := v.Args[0]
 20034  	b := v.Block
 20035  	typ := &b.Func.Config.Types
 20036  	// match: (RotateLeft8 <t> x (MOVDconst [c]))
 20037  	// result: (Or8 (Lsh8x64 <t> x (MOVDconst [c&7])) (Rsh8Ux64 <t> x (MOVDconst [-c&7])))
 20038  	for {
 20039  		t := v.Type
 20040  		x := v_0
 20041  		if v_1.Op != OpARM64MOVDconst {
 20042  			break
 20043  		}
 20044  		c := auxIntToInt64(v_1.AuxInt)
 20045  		v.reset(OpOr8)
 20046  		v0 := b.NewValue0(v.Pos, OpLsh8x64, t)
 20047  		v1 := b.NewValue0(v.Pos, OpARM64MOVDconst, typ.UInt64)
 20048  		v1.AuxInt = int64ToAuxInt(c & 7)
 20049  		v0.AddArg2(x, v1)
 20050  		v2 := b.NewValue0(v.Pos, OpRsh8Ux64, t)
 20051  		v3 := b.NewValue0(v.Pos, OpARM64MOVDconst, typ.UInt64)
 20052  		v3.AuxInt = int64ToAuxInt(-c & 7)
 20053  		v2.AddArg2(x, v3)
 20054  		v.AddArg2(v0, v2)
 20055  		return true
 20056  	}
 20057  	// match: (RotateLeft8 <t> x y)
 20058  	// result: (OR <t> (SLL <t> x (ANDconst <typ.Int64> [7] y)) (SRL <t> (ZeroExt8to64 x) (ANDconst <typ.Int64> [7] (NEG <typ.Int64> y))))
 20059  	for {
 20060  		t := v.Type
 20061  		x := v_0
 20062  		y := v_1
 20063  		v.reset(OpARM64OR)
 20064  		v.Type = t
 20065  		v0 := b.NewValue0(v.Pos, OpARM64SLL, t)
 20066  		v1 := b.NewValue0(v.Pos, OpARM64ANDconst, typ.Int64)
 20067  		v1.AuxInt = int64ToAuxInt(7)
 20068  		v1.AddArg(y)
 20069  		v0.AddArg2(x, v1)
 20070  		v2 := b.NewValue0(v.Pos, OpARM64SRL, t)
 20071  		v3 := b.NewValue0(v.Pos, OpZeroExt8to64, typ.UInt64)
 20072  		v3.AddArg(x)
 20073  		v4 := b.NewValue0(v.Pos, OpARM64ANDconst, typ.Int64)
 20074  		v4.AuxInt = int64ToAuxInt(7)
 20075  		v5 := b.NewValue0(v.Pos, OpARM64NEG, typ.Int64)
 20076  		v5.AddArg(y)
 20077  		v4.AddArg(v5)
 20078  		v2.AddArg2(v3, v4)
 20079  		v.AddArg2(v0, v2)
 20080  		return true
 20081  	}
 20082  }
 20083  func rewriteValueARM64_OpRsh16Ux16(v *Value) bool {
 20084  	v_1 := v.Args[1]
 20085  	v_0 := v.Args[0]
 20086  	b := v.Block
 20087  	typ := &b.Func.Config.Types
 20088  	// match: (Rsh16Ux16 <t> x y)
 20089  	// cond: shiftIsBounded(v)
 20090  	// result: (SRL <t> (ZeroExt16to64 x) y)
 20091  	for {
 20092  		t := v.Type
 20093  		x := v_0
 20094  		y := v_1
 20095  		if !(shiftIsBounded(v)) {
 20096  			break
 20097  		}
 20098  		v.reset(OpARM64SRL)
 20099  		v.Type = t
 20100  		v0 := b.NewValue0(v.Pos, OpZeroExt16to64, typ.UInt64)
 20101  		v0.AddArg(x)
 20102  		v.AddArg2(v0, y)
 20103  		return true
 20104  	}
 20105  	// match: (Rsh16Ux16 <t> x y)
 20106  	// cond: !shiftIsBounded(v)
 20107  	// result: (CSEL [OpARM64LessThanU] (SRL <t> (ZeroExt16to64 x) y) (Const64 <t> [0]) (CMPconst [64] (ZeroExt16to64 y)))
 20108  	for {
 20109  		t := v.Type
 20110  		x := v_0
 20111  		y := v_1
 20112  		if !(!shiftIsBounded(v)) {
 20113  			break
 20114  		}
 20115  		v.reset(OpARM64CSEL)
 20116  		v.AuxInt = opToAuxInt(OpARM64LessThanU)
 20117  		v0 := b.NewValue0(v.Pos, OpARM64SRL, t)
 20118  		v1 := b.NewValue0(v.Pos, OpZeroExt16to64, typ.UInt64)
 20119  		v1.AddArg(x)
 20120  		v0.AddArg2(v1, y)
 20121  		v2 := b.NewValue0(v.Pos, OpConst64, t)
 20122  		v2.AuxInt = int64ToAuxInt(0)
 20123  		v3 := b.NewValue0(v.Pos, OpARM64CMPconst, types.TypeFlags)
 20124  		v3.AuxInt = int64ToAuxInt(64)
 20125  		v4 := b.NewValue0(v.Pos, OpZeroExt16to64, typ.UInt64)
 20126  		v4.AddArg(y)
 20127  		v3.AddArg(v4)
 20128  		v.AddArg3(v0, v2, v3)
 20129  		return true
 20130  	}
 20131  	return false
 20132  }
 20133  func rewriteValueARM64_OpRsh16Ux32(v *Value) bool {
 20134  	v_1 := v.Args[1]
 20135  	v_0 := v.Args[0]
 20136  	b := v.Block
 20137  	typ := &b.Func.Config.Types
 20138  	// match: (Rsh16Ux32 <t> x y)
 20139  	// cond: shiftIsBounded(v)
 20140  	// result: (SRL <t> (ZeroExt16to64 x) y)
 20141  	for {
 20142  		t := v.Type
 20143  		x := v_0
 20144  		y := v_1
 20145  		if !(shiftIsBounded(v)) {
 20146  			break
 20147  		}
 20148  		v.reset(OpARM64SRL)
 20149  		v.Type = t
 20150  		v0 := b.NewValue0(v.Pos, OpZeroExt16to64, typ.UInt64)
 20151  		v0.AddArg(x)
 20152  		v.AddArg2(v0, y)
 20153  		return true
 20154  	}
 20155  	// match: (Rsh16Ux32 <t> x y)
 20156  	// cond: !shiftIsBounded(v)
 20157  	// result: (CSEL [OpARM64LessThanU] (SRL <t> (ZeroExt16to64 x) y) (Const64 <t> [0]) (CMPconst [64] (ZeroExt32to64 y)))
 20158  	for {
 20159  		t := v.Type
 20160  		x := v_0
 20161  		y := v_1
 20162  		if !(!shiftIsBounded(v)) {
 20163  			break
 20164  		}
 20165  		v.reset(OpARM64CSEL)
 20166  		v.AuxInt = opToAuxInt(OpARM64LessThanU)
 20167  		v0 := b.NewValue0(v.Pos, OpARM64SRL, t)
 20168  		v1 := b.NewValue0(v.Pos, OpZeroExt16to64, typ.UInt64)
 20169  		v1.AddArg(x)
 20170  		v0.AddArg2(v1, y)
 20171  		v2 := b.NewValue0(v.Pos, OpConst64, t)
 20172  		v2.AuxInt = int64ToAuxInt(0)
 20173  		v3 := b.NewValue0(v.Pos, OpARM64CMPconst, types.TypeFlags)
 20174  		v3.AuxInt = int64ToAuxInt(64)
 20175  		v4 := b.NewValue0(v.Pos, OpZeroExt32to64, typ.UInt64)
 20176  		v4.AddArg(y)
 20177  		v3.AddArg(v4)
 20178  		v.AddArg3(v0, v2, v3)
 20179  		return true
 20180  	}
 20181  	return false
 20182  }
 20183  func rewriteValueARM64_OpRsh16Ux64(v *Value) bool {
 20184  	v_1 := v.Args[1]
 20185  	v_0 := v.Args[0]
 20186  	b := v.Block
 20187  	typ := &b.Func.Config.Types
 20188  	// match: (Rsh16Ux64 <t> x y)
 20189  	// cond: shiftIsBounded(v)
 20190  	// result: (SRL <t> (ZeroExt16to64 x) y)
 20191  	for {
 20192  		t := v.Type
 20193  		x := v_0
 20194  		y := v_1
 20195  		if !(shiftIsBounded(v)) {
 20196  			break
 20197  		}
 20198  		v.reset(OpARM64SRL)
 20199  		v.Type = t
 20200  		v0 := b.NewValue0(v.Pos, OpZeroExt16to64, typ.UInt64)
 20201  		v0.AddArg(x)
 20202  		v.AddArg2(v0, y)
 20203  		return true
 20204  	}
 20205  	// match: (Rsh16Ux64 <t> x y)
 20206  	// cond: !shiftIsBounded(v)
 20207  	// result: (CSEL [OpARM64LessThanU] (SRL <t> (ZeroExt16to64 x) y) (Const64 <t> [0]) (CMPconst [64] y))
 20208  	for {
 20209  		t := v.Type
 20210  		x := v_0
 20211  		y := v_1
 20212  		if !(!shiftIsBounded(v)) {
 20213  			break
 20214  		}
 20215  		v.reset(OpARM64CSEL)
 20216  		v.AuxInt = opToAuxInt(OpARM64LessThanU)
 20217  		v0 := b.NewValue0(v.Pos, OpARM64SRL, t)
 20218  		v1 := b.NewValue0(v.Pos, OpZeroExt16to64, typ.UInt64)
 20219  		v1.AddArg(x)
 20220  		v0.AddArg2(v1, y)
 20221  		v2 := b.NewValue0(v.Pos, OpConst64, t)
 20222  		v2.AuxInt = int64ToAuxInt(0)
 20223  		v3 := b.NewValue0(v.Pos, OpARM64CMPconst, types.TypeFlags)
 20224  		v3.AuxInt = int64ToAuxInt(64)
 20225  		v3.AddArg(y)
 20226  		v.AddArg3(v0, v2, v3)
 20227  		return true
 20228  	}
 20229  	return false
 20230  }
 20231  func rewriteValueARM64_OpRsh16Ux8(v *Value) bool {
 20232  	v_1 := v.Args[1]
 20233  	v_0 := v.Args[0]
 20234  	b := v.Block
 20235  	typ := &b.Func.Config.Types
 20236  	// match: (Rsh16Ux8 <t> x y)
 20237  	// cond: shiftIsBounded(v)
 20238  	// result: (SRL <t> (ZeroExt16to64 x) y)
 20239  	for {
 20240  		t := v.Type
 20241  		x := v_0
 20242  		y := v_1
 20243  		if !(shiftIsBounded(v)) {
 20244  			break
 20245  		}
 20246  		v.reset(OpARM64SRL)
 20247  		v.Type = t
 20248  		v0 := b.NewValue0(v.Pos, OpZeroExt16to64, typ.UInt64)
 20249  		v0.AddArg(x)
 20250  		v.AddArg2(v0, y)
 20251  		return true
 20252  	}
 20253  	// match: (Rsh16Ux8 <t> x y)
 20254  	// cond: !shiftIsBounded(v)
 20255  	// result: (CSEL [OpARM64LessThanU] (SRL <t> (ZeroExt16to64 x) y) (Const64 <t> [0]) (CMPconst [64] (ZeroExt8to64 y)))
 20256  	for {
 20257  		t := v.Type
 20258  		x := v_0
 20259  		y := v_1
 20260  		if !(!shiftIsBounded(v)) {
 20261  			break
 20262  		}
 20263  		v.reset(OpARM64CSEL)
 20264  		v.AuxInt = opToAuxInt(OpARM64LessThanU)
 20265  		v0 := b.NewValue0(v.Pos, OpARM64SRL, t)
 20266  		v1 := b.NewValue0(v.Pos, OpZeroExt16to64, typ.UInt64)
 20267  		v1.AddArg(x)
 20268  		v0.AddArg2(v1, y)
 20269  		v2 := b.NewValue0(v.Pos, OpConst64, t)
 20270  		v2.AuxInt = int64ToAuxInt(0)
 20271  		v3 := b.NewValue0(v.Pos, OpARM64CMPconst, types.TypeFlags)
 20272  		v3.AuxInt = int64ToAuxInt(64)
 20273  		v4 := b.NewValue0(v.Pos, OpZeroExt8to64, typ.UInt64)
 20274  		v4.AddArg(y)
 20275  		v3.AddArg(v4)
 20276  		v.AddArg3(v0, v2, v3)
 20277  		return true
 20278  	}
 20279  	return false
 20280  }
 20281  func rewriteValueARM64_OpRsh16x16(v *Value) bool {
 20282  	v_1 := v.Args[1]
 20283  	v_0 := v.Args[0]
 20284  	b := v.Block
 20285  	typ := &b.Func.Config.Types
 20286  	// match: (Rsh16x16 <t> x y)
 20287  	// cond: shiftIsBounded(v)
 20288  	// result: (SRA <t> (SignExt16to64 x) y)
 20289  	for {
 20290  		t := v.Type
 20291  		x := v_0
 20292  		y := v_1
 20293  		if !(shiftIsBounded(v)) {
 20294  			break
 20295  		}
 20296  		v.reset(OpARM64SRA)
 20297  		v.Type = t
 20298  		v0 := b.NewValue0(v.Pos, OpSignExt16to64, typ.Int64)
 20299  		v0.AddArg(x)
 20300  		v.AddArg2(v0, y)
 20301  		return true
 20302  	}
 20303  	// match: (Rsh16x16 x y)
 20304  	// cond: !shiftIsBounded(v)
 20305  	// result: (SRA (SignExt16to64 x) (CSEL [OpARM64LessThanU] <y.Type> y (Const64 <y.Type> [63]) (CMPconst [64] (ZeroExt16to64 y))))
 20306  	for {
 20307  		x := v_0
 20308  		y := v_1
 20309  		if !(!shiftIsBounded(v)) {
 20310  			break
 20311  		}
 20312  		v.reset(OpARM64SRA)
 20313  		v0 := b.NewValue0(v.Pos, OpSignExt16to64, typ.Int64)
 20314  		v0.AddArg(x)
 20315  		v1 := b.NewValue0(v.Pos, OpARM64CSEL, y.Type)
 20316  		v1.AuxInt = opToAuxInt(OpARM64LessThanU)
 20317  		v2 := b.NewValue0(v.Pos, OpConst64, y.Type)
 20318  		v2.AuxInt = int64ToAuxInt(63)
 20319  		v3 := b.NewValue0(v.Pos, OpARM64CMPconst, types.TypeFlags)
 20320  		v3.AuxInt = int64ToAuxInt(64)
 20321  		v4 := b.NewValue0(v.Pos, OpZeroExt16to64, typ.UInt64)
 20322  		v4.AddArg(y)
 20323  		v3.AddArg(v4)
 20324  		v1.AddArg3(y, v2, v3)
 20325  		v.AddArg2(v0, v1)
 20326  		return true
 20327  	}
 20328  	return false
 20329  }
 20330  func rewriteValueARM64_OpRsh16x32(v *Value) bool {
 20331  	v_1 := v.Args[1]
 20332  	v_0 := v.Args[0]
 20333  	b := v.Block
 20334  	typ := &b.Func.Config.Types
 20335  	// match: (Rsh16x32 <t> x y)
 20336  	// cond: shiftIsBounded(v)
 20337  	// result: (SRA <t> (SignExt16to64 x) y)
 20338  	for {
 20339  		t := v.Type
 20340  		x := v_0
 20341  		y := v_1
 20342  		if !(shiftIsBounded(v)) {
 20343  			break
 20344  		}
 20345  		v.reset(OpARM64SRA)
 20346  		v.Type = t
 20347  		v0 := b.NewValue0(v.Pos, OpSignExt16to64, typ.Int64)
 20348  		v0.AddArg(x)
 20349  		v.AddArg2(v0, y)
 20350  		return true
 20351  	}
 20352  	// match: (Rsh16x32 x y)
 20353  	// cond: !shiftIsBounded(v)
 20354  	// result: (SRA (SignExt16to64 x) (CSEL [OpARM64LessThanU] <y.Type> y (Const64 <y.Type> [63]) (CMPconst [64] (ZeroExt32to64 y))))
 20355  	for {
 20356  		x := v_0
 20357  		y := v_1
 20358  		if !(!shiftIsBounded(v)) {
 20359  			break
 20360  		}
 20361  		v.reset(OpARM64SRA)
 20362  		v0 := b.NewValue0(v.Pos, OpSignExt16to64, typ.Int64)
 20363  		v0.AddArg(x)
 20364  		v1 := b.NewValue0(v.Pos, OpARM64CSEL, y.Type)
 20365  		v1.AuxInt = opToAuxInt(OpARM64LessThanU)
 20366  		v2 := b.NewValue0(v.Pos, OpConst64, y.Type)
 20367  		v2.AuxInt = int64ToAuxInt(63)
 20368  		v3 := b.NewValue0(v.Pos, OpARM64CMPconst, types.TypeFlags)
 20369  		v3.AuxInt = int64ToAuxInt(64)
 20370  		v4 := b.NewValue0(v.Pos, OpZeroExt32to64, typ.UInt64)
 20371  		v4.AddArg(y)
 20372  		v3.AddArg(v4)
 20373  		v1.AddArg3(y, v2, v3)
 20374  		v.AddArg2(v0, v1)
 20375  		return true
 20376  	}
 20377  	return false
 20378  }
 20379  func rewriteValueARM64_OpRsh16x64(v *Value) bool {
 20380  	v_1 := v.Args[1]
 20381  	v_0 := v.Args[0]
 20382  	b := v.Block
 20383  	typ := &b.Func.Config.Types
 20384  	// match: (Rsh16x64 <t> x y)
 20385  	// cond: shiftIsBounded(v)
 20386  	// result: (SRA <t> (SignExt16to64 x) y)
 20387  	for {
 20388  		t := v.Type
 20389  		x := v_0
 20390  		y := v_1
 20391  		if !(shiftIsBounded(v)) {
 20392  			break
 20393  		}
 20394  		v.reset(OpARM64SRA)
 20395  		v.Type = t
 20396  		v0 := b.NewValue0(v.Pos, OpSignExt16to64, typ.Int64)
 20397  		v0.AddArg(x)
 20398  		v.AddArg2(v0, y)
 20399  		return true
 20400  	}
 20401  	// match: (Rsh16x64 x y)
 20402  	// cond: !shiftIsBounded(v)
 20403  	// result: (SRA (SignExt16to64 x) (CSEL [OpARM64LessThanU] <y.Type> y (Const64 <y.Type> [63]) (CMPconst [64] y)))
 20404  	for {
 20405  		x := v_0
 20406  		y := v_1
 20407  		if !(!shiftIsBounded(v)) {
 20408  			break
 20409  		}
 20410  		v.reset(OpARM64SRA)
 20411  		v0 := b.NewValue0(v.Pos, OpSignExt16to64, typ.Int64)
 20412  		v0.AddArg(x)
 20413  		v1 := b.NewValue0(v.Pos, OpARM64CSEL, y.Type)
 20414  		v1.AuxInt = opToAuxInt(OpARM64LessThanU)
 20415  		v2 := b.NewValue0(v.Pos, OpConst64, y.Type)
 20416  		v2.AuxInt = int64ToAuxInt(63)
 20417  		v3 := b.NewValue0(v.Pos, OpARM64CMPconst, types.TypeFlags)
 20418  		v3.AuxInt = int64ToAuxInt(64)
 20419  		v3.AddArg(y)
 20420  		v1.AddArg3(y, v2, v3)
 20421  		v.AddArg2(v0, v1)
 20422  		return true
 20423  	}
 20424  	return false
 20425  }
 20426  func rewriteValueARM64_OpRsh16x8(v *Value) bool {
 20427  	v_1 := v.Args[1]
 20428  	v_0 := v.Args[0]
 20429  	b := v.Block
 20430  	typ := &b.Func.Config.Types
 20431  	// match: (Rsh16x8 <t> x y)
 20432  	// cond: shiftIsBounded(v)
 20433  	// result: (SRA <t> (SignExt16to64 x) y)
 20434  	for {
 20435  		t := v.Type
 20436  		x := v_0
 20437  		y := v_1
 20438  		if !(shiftIsBounded(v)) {
 20439  			break
 20440  		}
 20441  		v.reset(OpARM64SRA)
 20442  		v.Type = t
 20443  		v0 := b.NewValue0(v.Pos, OpSignExt16to64, typ.Int64)
 20444  		v0.AddArg(x)
 20445  		v.AddArg2(v0, y)
 20446  		return true
 20447  	}
 20448  	// match: (Rsh16x8 x y)
 20449  	// cond: !shiftIsBounded(v)
 20450  	// result: (SRA (SignExt16to64 x) (CSEL [OpARM64LessThanU] <y.Type> y (Const64 <y.Type> [63]) (CMPconst [64] (ZeroExt8to64 y))))
 20451  	for {
 20452  		x := v_0
 20453  		y := v_1
 20454  		if !(!shiftIsBounded(v)) {
 20455  			break
 20456  		}
 20457  		v.reset(OpARM64SRA)
 20458  		v0 := b.NewValue0(v.Pos, OpSignExt16to64, typ.Int64)
 20459  		v0.AddArg(x)
 20460  		v1 := b.NewValue0(v.Pos, OpARM64CSEL, y.Type)
 20461  		v1.AuxInt = opToAuxInt(OpARM64LessThanU)
 20462  		v2 := b.NewValue0(v.Pos, OpConst64, y.Type)
 20463  		v2.AuxInt = int64ToAuxInt(63)
 20464  		v3 := b.NewValue0(v.Pos, OpARM64CMPconst, types.TypeFlags)
 20465  		v3.AuxInt = int64ToAuxInt(64)
 20466  		v4 := b.NewValue0(v.Pos, OpZeroExt8to64, typ.UInt64)
 20467  		v4.AddArg(y)
 20468  		v3.AddArg(v4)
 20469  		v1.AddArg3(y, v2, v3)
 20470  		v.AddArg2(v0, v1)
 20471  		return true
 20472  	}
 20473  	return false
 20474  }
 20475  func rewriteValueARM64_OpRsh32Ux16(v *Value) bool {
 20476  	v_1 := v.Args[1]
 20477  	v_0 := v.Args[0]
 20478  	b := v.Block
 20479  	typ := &b.Func.Config.Types
 20480  	// match: (Rsh32Ux16 <t> x y)
 20481  	// cond: shiftIsBounded(v)
 20482  	// result: (SRL <t> (ZeroExt32to64 x) y)
 20483  	for {
 20484  		t := v.Type
 20485  		x := v_0
 20486  		y := v_1
 20487  		if !(shiftIsBounded(v)) {
 20488  			break
 20489  		}
 20490  		v.reset(OpARM64SRL)
 20491  		v.Type = t
 20492  		v0 := b.NewValue0(v.Pos, OpZeroExt32to64, typ.UInt64)
 20493  		v0.AddArg(x)
 20494  		v.AddArg2(v0, y)
 20495  		return true
 20496  	}
 20497  	// match: (Rsh32Ux16 <t> x y)
 20498  	// cond: !shiftIsBounded(v)
 20499  	// result: (CSEL [OpARM64LessThanU] (SRL <t> (ZeroExt32to64 x) y) (Const64 <t> [0]) (CMPconst [64] (ZeroExt16to64 y)))
 20500  	for {
 20501  		t := v.Type
 20502  		x := v_0
 20503  		y := v_1
 20504  		if !(!shiftIsBounded(v)) {
 20505  			break
 20506  		}
 20507  		v.reset(OpARM64CSEL)
 20508  		v.AuxInt = opToAuxInt(OpARM64LessThanU)
 20509  		v0 := b.NewValue0(v.Pos, OpARM64SRL, t)
 20510  		v1 := b.NewValue0(v.Pos, OpZeroExt32to64, typ.UInt64)
 20511  		v1.AddArg(x)
 20512  		v0.AddArg2(v1, y)
 20513  		v2 := b.NewValue0(v.Pos, OpConst64, t)
 20514  		v2.AuxInt = int64ToAuxInt(0)
 20515  		v3 := b.NewValue0(v.Pos, OpARM64CMPconst, types.TypeFlags)
 20516  		v3.AuxInt = int64ToAuxInt(64)
 20517  		v4 := b.NewValue0(v.Pos, OpZeroExt16to64, typ.UInt64)
 20518  		v4.AddArg(y)
 20519  		v3.AddArg(v4)
 20520  		v.AddArg3(v0, v2, v3)
 20521  		return true
 20522  	}
 20523  	return false
 20524  }
 20525  func rewriteValueARM64_OpRsh32Ux32(v *Value) bool {
 20526  	v_1 := v.Args[1]
 20527  	v_0 := v.Args[0]
 20528  	b := v.Block
 20529  	typ := &b.Func.Config.Types
 20530  	// match: (Rsh32Ux32 <t> x y)
 20531  	// cond: shiftIsBounded(v)
 20532  	// result: (SRL <t> (ZeroExt32to64 x) y)
 20533  	for {
 20534  		t := v.Type
 20535  		x := v_0
 20536  		y := v_1
 20537  		if !(shiftIsBounded(v)) {
 20538  			break
 20539  		}
 20540  		v.reset(OpARM64SRL)
 20541  		v.Type = t
 20542  		v0 := b.NewValue0(v.Pos, OpZeroExt32to64, typ.UInt64)
 20543  		v0.AddArg(x)
 20544  		v.AddArg2(v0, y)
 20545  		return true
 20546  	}
 20547  	// match: (Rsh32Ux32 <t> x y)
 20548  	// cond: !shiftIsBounded(v)
 20549  	// result: (CSEL [OpARM64LessThanU] (SRL <t> (ZeroExt32to64 x) y) (Const64 <t> [0]) (CMPconst [64] (ZeroExt32to64 y)))
 20550  	for {
 20551  		t := v.Type
 20552  		x := v_0
 20553  		y := v_1
 20554  		if !(!shiftIsBounded(v)) {
 20555  			break
 20556  		}
 20557  		v.reset(OpARM64CSEL)
 20558  		v.AuxInt = opToAuxInt(OpARM64LessThanU)
 20559  		v0 := b.NewValue0(v.Pos, OpARM64SRL, t)
 20560  		v1 := b.NewValue0(v.Pos, OpZeroExt32to64, typ.UInt64)
 20561  		v1.AddArg(x)
 20562  		v0.AddArg2(v1, y)
 20563  		v2 := b.NewValue0(v.Pos, OpConst64, t)
 20564  		v2.AuxInt = int64ToAuxInt(0)
 20565  		v3 := b.NewValue0(v.Pos, OpARM64CMPconst, types.TypeFlags)
 20566  		v3.AuxInt = int64ToAuxInt(64)
 20567  		v4 := b.NewValue0(v.Pos, OpZeroExt32to64, typ.UInt64)
 20568  		v4.AddArg(y)
 20569  		v3.AddArg(v4)
 20570  		v.AddArg3(v0, v2, v3)
 20571  		return true
 20572  	}
 20573  	return false
 20574  }
 20575  func rewriteValueARM64_OpRsh32Ux64(v *Value) bool {
 20576  	v_1 := v.Args[1]
 20577  	v_0 := v.Args[0]
 20578  	b := v.Block
 20579  	typ := &b.Func.Config.Types
 20580  	// match: (Rsh32Ux64 <t> x y)
 20581  	// cond: shiftIsBounded(v)
 20582  	// result: (SRL <t> (ZeroExt32to64 x) y)
 20583  	for {
 20584  		t := v.Type
 20585  		x := v_0
 20586  		y := v_1
 20587  		if !(shiftIsBounded(v)) {
 20588  			break
 20589  		}
 20590  		v.reset(OpARM64SRL)
 20591  		v.Type = t
 20592  		v0 := b.NewValue0(v.Pos, OpZeroExt32to64, typ.UInt64)
 20593  		v0.AddArg(x)
 20594  		v.AddArg2(v0, y)
 20595  		return true
 20596  	}
 20597  	// match: (Rsh32Ux64 <t> x y)
 20598  	// cond: !shiftIsBounded(v)
 20599  	// result: (CSEL [OpARM64LessThanU] (SRL <t> (ZeroExt32to64 x) y) (Const64 <t> [0]) (CMPconst [64] y))
 20600  	for {
 20601  		t := v.Type
 20602  		x := v_0
 20603  		y := v_1
 20604  		if !(!shiftIsBounded(v)) {
 20605  			break
 20606  		}
 20607  		v.reset(OpARM64CSEL)
 20608  		v.AuxInt = opToAuxInt(OpARM64LessThanU)
 20609  		v0 := b.NewValue0(v.Pos, OpARM64SRL, t)
 20610  		v1 := b.NewValue0(v.Pos, OpZeroExt32to64, typ.UInt64)
 20611  		v1.AddArg(x)
 20612  		v0.AddArg2(v1, y)
 20613  		v2 := b.NewValue0(v.Pos, OpConst64, t)
 20614  		v2.AuxInt = int64ToAuxInt(0)
 20615  		v3 := b.NewValue0(v.Pos, OpARM64CMPconst, types.TypeFlags)
 20616  		v3.AuxInt = int64ToAuxInt(64)
 20617  		v3.AddArg(y)
 20618  		v.AddArg3(v0, v2, v3)
 20619  		return true
 20620  	}
 20621  	return false
 20622  }
 20623  func rewriteValueARM64_OpRsh32Ux8(v *Value) bool {
 20624  	v_1 := v.Args[1]
 20625  	v_0 := v.Args[0]
 20626  	b := v.Block
 20627  	typ := &b.Func.Config.Types
 20628  	// match: (Rsh32Ux8 <t> x y)
 20629  	// cond: shiftIsBounded(v)
 20630  	// result: (SRL <t> (ZeroExt32to64 x) y)
 20631  	for {
 20632  		t := v.Type
 20633  		x := v_0
 20634  		y := v_1
 20635  		if !(shiftIsBounded(v)) {
 20636  			break
 20637  		}
 20638  		v.reset(OpARM64SRL)
 20639  		v.Type = t
 20640  		v0 := b.NewValue0(v.Pos, OpZeroExt32to64, typ.UInt64)
 20641  		v0.AddArg(x)
 20642  		v.AddArg2(v0, y)
 20643  		return true
 20644  	}
 20645  	// match: (Rsh32Ux8 <t> x y)
 20646  	// cond: !shiftIsBounded(v)
 20647  	// result: (CSEL [OpARM64LessThanU] (SRL <t> (ZeroExt32to64 x) y) (Const64 <t> [0]) (CMPconst [64] (ZeroExt8to64 y)))
 20648  	for {
 20649  		t := v.Type
 20650  		x := v_0
 20651  		y := v_1
 20652  		if !(!shiftIsBounded(v)) {
 20653  			break
 20654  		}
 20655  		v.reset(OpARM64CSEL)
 20656  		v.AuxInt = opToAuxInt(OpARM64LessThanU)
 20657  		v0 := b.NewValue0(v.Pos, OpARM64SRL, t)
 20658  		v1 := b.NewValue0(v.Pos, OpZeroExt32to64, typ.UInt64)
 20659  		v1.AddArg(x)
 20660  		v0.AddArg2(v1, y)
 20661  		v2 := b.NewValue0(v.Pos, OpConst64, t)
 20662  		v2.AuxInt = int64ToAuxInt(0)
 20663  		v3 := b.NewValue0(v.Pos, OpARM64CMPconst, types.TypeFlags)
 20664  		v3.AuxInt = int64ToAuxInt(64)
 20665  		v4 := b.NewValue0(v.Pos, OpZeroExt8to64, typ.UInt64)
 20666  		v4.AddArg(y)
 20667  		v3.AddArg(v4)
 20668  		v.AddArg3(v0, v2, v3)
 20669  		return true
 20670  	}
 20671  	return false
 20672  }
 20673  func rewriteValueARM64_OpRsh32x16(v *Value) bool {
 20674  	v_1 := v.Args[1]
 20675  	v_0 := v.Args[0]
 20676  	b := v.Block
 20677  	typ := &b.Func.Config.Types
 20678  	// match: (Rsh32x16 <t> x y)
 20679  	// cond: shiftIsBounded(v)
 20680  	// result: (SRA <t> (SignExt32to64 x) y)
 20681  	for {
 20682  		t := v.Type
 20683  		x := v_0
 20684  		y := v_1
 20685  		if !(shiftIsBounded(v)) {
 20686  			break
 20687  		}
 20688  		v.reset(OpARM64SRA)
 20689  		v.Type = t
 20690  		v0 := b.NewValue0(v.Pos, OpSignExt32to64, typ.Int64)
 20691  		v0.AddArg(x)
 20692  		v.AddArg2(v0, y)
 20693  		return true
 20694  	}
 20695  	// match: (Rsh32x16 x y)
 20696  	// cond: !shiftIsBounded(v)
 20697  	// result: (SRA (SignExt32to64 x) (CSEL [OpARM64LessThanU] <y.Type> y (Const64 <y.Type> [63]) (CMPconst [64] (ZeroExt16to64 y))))
 20698  	for {
 20699  		x := v_0
 20700  		y := v_1
 20701  		if !(!shiftIsBounded(v)) {
 20702  			break
 20703  		}
 20704  		v.reset(OpARM64SRA)
 20705  		v0 := b.NewValue0(v.Pos, OpSignExt32to64, typ.Int64)
 20706  		v0.AddArg(x)
 20707  		v1 := b.NewValue0(v.Pos, OpARM64CSEL, y.Type)
 20708  		v1.AuxInt = opToAuxInt(OpARM64LessThanU)
 20709  		v2 := b.NewValue0(v.Pos, OpConst64, y.Type)
 20710  		v2.AuxInt = int64ToAuxInt(63)
 20711  		v3 := b.NewValue0(v.Pos, OpARM64CMPconst, types.TypeFlags)
 20712  		v3.AuxInt = int64ToAuxInt(64)
 20713  		v4 := b.NewValue0(v.Pos, OpZeroExt16to64, typ.UInt64)
 20714  		v4.AddArg(y)
 20715  		v3.AddArg(v4)
 20716  		v1.AddArg3(y, v2, v3)
 20717  		v.AddArg2(v0, v1)
 20718  		return true
 20719  	}
 20720  	return false
 20721  }
 20722  func rewriteValueARM64_OpRsh32x32(v *Value) bool {
 20723  	v_1 := v.Args[1]
 20724  	v_0 := v.Args[0]
 20725  	b := v.Block
 20726  	typ := &b.Func.Config.Types
 20727  	// match: (Rsh32x32 <t> x y)
 20728  	// cond: shiftIsBounded(v)
 20729  	// result: (SRA <t> (SignExt32to64 x) y)
 20730  	for {
 20731  		t := v.Type
 20732  		x := v_0
 20733  		y := v_1
 20734  		if !(shiftIsBounded(v)) {
 20735  			break
 20736  		}
 20737  		v.reset(OpARM64SRA)
 20738  		v.Type = t
 20739  		v0 := b.NewValue0(v.Pos, OpSignExt32to64, typ.Int64)
 20740  		v0.AddArg(x)
 20741  		v.AddArg2(v0, y)
 20742  		return true
 20743  	}
 20744  	// match: (Rsh32x32 x y)
 20745  	// cond: !shiftIsBounded(v)
 20746  	// result: (SRA (SignExt32to64 x) (CSEL [OpARM64LessThanU] <y.Type> y (Const64 <y.Type> [63]) (CMPconst [64] (ZeroExt32to64 y))))
 20747  	for {
 20748  		x := v_0
 20749  		y := v_1
 20750  		if !(!shiftIsBounded(v)) {
 20751  			break
 20752  		}
 20753  		v.reset(OpARM64SRA)
 20754  		v0 := b.NewValue0(v.Pos, OpSignExt32to64, typ.Int64)
 20755  		v0.AddArg(x)
 20756  		v1 := b.NewValue0(v.Pos, OpARM64CSEL, y.Type)
 20757  		v1.AuxInt = opToAuxInt(OpARM64LessThanU)
 20758  		v2 := b.NewValue0(v.Pos, OpConst64, y.Type)
 20759  		v2.AuxInt = int64ToAuxInt(63)
 20760  		v3 := b.NewValue0(v.Pos, OpARM64CMPconst, types.TypeFlags)
 20761  		v3.AuxInt = int64ToAuxInt(64)
 20762  		v4 := b.NewValue0(v.Pos, OpZeroExt32to64, typ.UInt64)
 20763  		v4.AddArg(y)
 20764  		v3.AddArg(v4)
 20765  		v1.AddArg3(y, v2, v3)
 20766  		v.AddArg2(v0, v1)
 20767  		return true
 20768  	}
 20769  	return false
 20770  }
 20771  func rewriteValueARM64_OpRsh32x64(v *Value) bool {
 20772  	v_1 := v.Args[1]
 20773  	v_0 := v.Args[0]
 20774  	b := v.Block
 20775  	typ := &b.Func.Config.Types
 20776  	// match: (Rsh32x64 <t> x y)
 20777  	// cond: shiftIsBounded(v)
 20778  	// result: (SRA <t> (SignExt32to64 x) y)
 20779  	for {
 20780  		t := v.Type
 20781  		x := v_0
 20782  		y := v_1
 20783  		if !(shiftIsBounded(v)) {
 20784  			break
 20785  		}
 20786  		v.reset(OpARM64SRA)
 20787  		v.Type = t
 20788  		v0 := b.NewValue0(v.Pos, OpSignExt32to64, typ.Int64)
 20789  		v0.AddArg(x)
 20790  		v.AddArg2(v0, y)
 20791  		return true
 20792  	}
 20793  	// match: (Rsh32x64 x y)
 20794  	// cond: !shiftIsBounded(v)
 20795  	// result: (SRA (SignExt32to64 x) (CSEL [OpARM64LessThanU] <y.Type> y (Const64 <y.Type> [63]) (CMPconst [64] y)))
 20796  	for {
 20797  		x := v_0
 20798  		y := v_1
 20799  		if !(!shiftIsBounded(v)) {
 20800  			break
 20801  		}
 20802  		v.reset(OpARM64SRA)
 20803  		v0 := b.NewValue0(v.Pos, OpSignExt32to64, typ.Int64)
 20804  		v0.AddArg(x)
 20805  		v1 := b.NewValue0(v.Pos, OpARM64CSEL, y.Type)
 20806  		v1.AuxInt = opToAuxInt(OpARM64LessThanU)
 20807  		v2 := b.NewValue0(v.Pos, OpConst64, y.Type)
 20808  		v2.AuxInt = int64ToAuxInt(63)
 20809  		v3 := b.NewValue0(v.Pos, OpARM64CMPconst, types.TypeFlags)
 20810  		v3.AuxInt = int64ToAuxInt(64)
 20811  		v3.AddArg(y)
 20812  		v1.AddArg3(y, v2, v3)
 20813  		v.AddArg2(v0, v1)
 20814  		return true
 20815  	}
 20816  	return false
 20817  }
 20818  func rewriteValueARM64_OpRsh32x8(v *Value) bool {
 20819  	v_1 := v.Args[1]
 20820  	v_0 := v.Args[0]
 20821  	b := v.Block
 20822  	typ := &b.Func.Config.Types
 20823  	// match: (Rsh32x8 <t> x y)
 20824  	// cond: shiftIsBounded(v)
 20825  	// result: (SRA <t> (SignExt32to64 x) y)
 20826  	for {
 20827  		t := v.Type
 20828  		x := v_0
 20829  		y := v_1
 20830  		if !(shiftIsBounded(v)) {
 20831  			break
 20832  		}
 20833  		v.reset(OpARM64SRA)
 20834  		v.Type = t
 20835  		v0 := b.NewValue0(v.Pos, OpSignExt32to64, typ.Int64)
 20836  		v0.AddArg(x)
 20837  		v.AddArg2(v0, y)
 20838  		return true
 20839  	}
 20840  	// match: (Rsh32x8 x y)
 20841  	// cond: !shiftIsBounded(v)
 20842  	// result: (SRA (SignExt32to64 x) (CSEL [OpARM64LessThanU] <y.Type> y (Const64 <y.Type> [63]) (CMPconst [64] (ZeroExt8to64 y))))
 20843  	for {
 20844  		x := v_0
 20845  		y := v_1
 20846  		if !(!shiftIsBounded(v)) {
 20847  			break
 20848  		}
 20849  		v.reset(OpARM64SRA)
 20850  		v0 := b.NewValue0(v.Pos, OpSignExt32to64, typ.Int64)
 20851  		v0.AddArg(x)
 20852  		v1 := b.NewValue0(v.Pos, OpARM64CSEL, y.Type)
 20853  		v1.AuxInt = opToAuxInt(OpARM64LessThanU)
 20854  		v2 := b.NewValue0(v.Pos, OpConst64, y.Type)
 20855  		v2.AuxInt = int64ToAuxInt(63)
 20856  		v3 := b.NewValue0(v.Pos, OpARM64CMPconst, types.TypeFlags)
 20857  		v3.AuxInt = int64ToAuxInt(64)
 20858  		v4 := b.NewValue0(v.Pos, OpZeroExt8to64, typ.UInt64)
 20859  		v4.AddArg(y)
 20860  		v3.AddArg(v4)
 20861  		v1.AddArg3(y, v2, v3)
 20862  		v.AddArg2(v0, v1)
 20863  		return true
 20864  	}
 20865  	return false
 20866  }
 20867  func rewriteValueARM64_OpRsh64Ux16(v *Value) bool {
 20868  	v_1 := v.Args[1]
 20869  	v_0 := v.Args[0]
 20870  	b := v.Block
 20871  	typ := &b.Func.Config.Types
 20872  	// match: (Rsh64Ux16 <t> x y)
 20873  	// cond: shiftIsBounded(v)
 20874  	// result: (SRL <t> x y)
 20875  	for {
 20876  		t := v.Type
 20877  		x := v_0
 20878  		y := v_1
 20879  		if !(shiftIsBounded(v)) {
 20880  			break
 20881  		}
 20882  		v.reset(OpARM64SRL)
 20883  		v.Type = t
 20884  		v.AddArg2(x, y)
 20885  		return true
 20886  	}
 20887  	// match: (Rsh64Ux16 <t> x y)
 20888  	// cond: !shiftIsBounded(v)
 20889  	// result: (CSEL [OpARM64LessThanU] (SRL <t> x y) (Const64 <t> [0]) (CMPconst [64] (ZeroExt16to64 y)))
 20890  	for {
 20891  		t := v.Type
 20892  		x := v_0
 20893  		y := v_1
 20894  		if !(!shiftIsBounded(v)) {
 20895  			break
 20896  		}
 20897  		v.reset(OpARM64CSEL)
 20898  		v.AuxInt = opToAuxInt(OpARM64LessThanU)
 20899  		v0 := b.NewValue0(v.Pos, OpARM64SRL, t)
 20900  		v0.AddArg2(x, y)
 20901  		v1 := b.NewValue0(v.Pos, OpConst64, t)
 20902  		v1.AuxInt = int64ToAuxInt(0)
 20903  		v2 := b.NewValue0(v.Pos, OpARM64CMPconst, types.TypeFlags)
 20904  		v2.AuxInt = int64ToAuxInt(64)
 20905  		v3 := b.NewValue0(v.Pos, OpZeroExt16to64, typ.UInt64)
 20906  		v3.AddArg(y)
 20907  		v2.AddArg(v3)
 20908  		v.AddArg3(v0, v1, v2)
 20909  		return true
 20910  	}
 20911  	return false
 20912  }
 20913  func rewriteValueARM64_OpRsh64Ux32(v *Value) bool {
 20914  	v_1 := v.Args[1]
 20915  	v_0 := v.Args[0]
 20916  	b := v.Block
 20917  	typ := &b.Func.Config.Types
 20918  	// match: (Rsh64Ux32 <t> x y)
 20919  	// cond: shiftIsBounded(v)
 20920  	// result: (SRL <t> x y)
 20921  	for {
 20922  		t := v.Type
 20923  		x := v_0
 20924  		y := v_1
 20925  		if !(shiftIsBounded(v)) {
 20926  			break
 20927  		}
 20928  		v.reset(OpARM64SRL)
 20929  		v.Type = t
 20930  		v.AddArg2(x, y)
 20931  		return true
 20932  	}
 20933  	// match: (Rsh64Ux32 <t> x y)
 20934  	// cond: !shiftIsBounded(v)
 20935  	// result: (CSEL [OpARM64LessThanU] (SRL <t> x y) (Const64 <t> [0]) (CMPconst [64] (ZeroExt32to64 y)))
 20936  	for {
 20937  		t := v.Type
 20938  		x := v_0
 20939  		y := v_1
 20940  		if !(!shiftIsBounded(v)) {
 20941  			break
 20942  		}
 20943  		v.reset(OpARM64CSEL)
 20944  		v.AuxInt = opToAuxInt(OpARM64LessThanU)
 20945  		v0 := b.NewValue0(v.Pos, OpARM64SRL, t)
 20946  		v0.AddArg2(x, y)
 20947  		v1 := b.NewValue0(v.Pos, OpConst64, t)
 20948  		v1.AuxInt = int64ToAuxInt(0)
 20949  		v2 := b.NewValue0(v.Pos, OpARM64CMPconst, types.TypeFlags)
 20950  		v2.AuxInt = int64ToAuxInt(64)
 20951  		v3 := b.NewValue0(v.Pos, OpZeroExt32to64, typ.UInt64)
 20952  		v3.AddArg(y)
 20953  		v2.AddArg(v3)
 20954  		v.AddArg3(v0, v1, v2)
 20955  		return true
 20956  	}
 20957  	return false
 20958  }
 20959  func rewriteValueARM64_OpRsh64Ux64(v *Value) bool {
 20960  	v_1 := v.Args[1]
 20961  	v_0 := v.Args[0]
 20962  	b := v.Block
 20963  	// match: (Rsh64Ux64 <t> x y)
 20964  	// cond: shiftIsBounded(v)
 20965  	// result: (SRL <t> x y)
 20966  	for {
 20967  		t := v.Type
 20968  		x := v_0
 20969  		y := v_1
 20970  		if !(shiftIsBounded(v)) {
 20971  			break
 20972  		}
 20973  		v.reset(OpARM64SRL)
 20974  		v.Type = t
 20975  		v.AddArg2(x, y)
 20976  		return true
 20977  	}
 20978  	// match: (Rsh64Ux64 <t> x y)
 20979  	// cond: !shiftIsBounded(v)
 20980  	// result: (CSEL [OpARM64LessThanU] (SRL <t> x y) (Const64 <t> [0]) (CMPconst [64] y))
 20981  	for {
 20982  		t := v.Type
 20983  		x := v_0
 20984  		y := v_1
 20985  		if !(!shiftIsBounded(v)) {
 20986  			break
 20987  		}
 20988  		v.reset(OpARM64CSEL)
 20989  		v.AuxInt = opToAuxInt(OpARM64LessThanU)
 20990  		v0 := b.NewValue0(v.Pos, OpARM64SRL, t)
 20991  		v0.AddArg2(x, y)
 20992  		v1 := b.NewValue0(v.Pos, OpConst64, t)
 20993  		v1.AuxInt = int64ToAuxInt(0)
 20994  		v2 := b.NewValue0(v.Pos, OpARM64CMPconst, types.TypeFlags)
 20995  		v2.AuxInt = int64ToAuxInt(64)
 20996  		v2.AddArg(y)
 20997  		v.AddArg3(v0, v1, v2)
 20998  		return true
 20999  	}
 21000  	return false
 21001  }
 21002  func rewriteValueARM64_OpRsh64Ux8(v *Value) bool {
 21003  	v_1 := v.Args[1]
 21004  	v_0 := v.Args[0]
 21005  	b := v.Block
 21006  	typ := &b.Func.Config.Types
 21007  	// match: (Rsh64Ux8 <t> x y)
 21008  	// cond: shiftIsBounded(v)
 21009  	// result: (SRL <t> x y)
 21010  	for {
 21011  		t := v.Type
 21012  		x := v_0
 21013  		y := v_1
 21014  		if !(shiftIsBounded(v)) {
 21015  			break
 21016  		}
 21017  		v.reset(OpARM64SRL)
 21018  		v.Type = t
 21019  		v.AddArg2(x, y)
 21020  		return true
 21021  	}
 21022  	// match: (Rsh64Ux8 <t> x y)
 21023  	// cond: !shiftIsBounded(v)
 21024  	// result: (CSEL [OpARM64LessThanU] (SRL <t> x y) (Const64 <t> [0]) (CMPconst [64] (ZeroExt8to64 y)))
 21025  	for {
 21026  		t := v.Type
 21027  		x := v_0
 21028  		y := v_1
 21029  		if !(!shiftIsBounded(v)) {
 21030  			break
 21031  		}
 21032  		v.reset(OpARM64CSEL)
 21033  		v.AuxInt = opToAuxInt(OpARM64LessThanU)
 21034  		v0 := b.NewValue0(v.Pos, OpARM64SRL, t)
 21035  		v0.AddArg2(x, y)
 21036  		v1 := b.NewValue0(v.Pos, OpConst64, t)
 21037  		v1.AuxInt = int64ToAuxInt(0)
 21038  		v2 := b.NewValue0(v.Pos, OpARM64CMPconst, types.TypeFlags)
 21039  		v2.AuxInt = int64ToAuxInt(64)
 21040  		v3 := b.NewValue0(v.Pos, OpZeroExt8to64, typ.UInt64)
 21041  		v3.AddArg(y)
 21042  		v2.AddArg(v3)
 21043  		v.AddArg3(v0, v1, v2)
 21044  		return true
 21045  	}
 21046  	return false
 21047  }
 21048  func rewriteValueARM64_OpRsh64x16(v *Value) bool {
 21049  	v_1 := v.Args[1]
 21050  	v_0 := v.Args[0]
 21051  	b := v.Block
 21052  	typ := &b.Func.Config.Types
 21053  	// match: (Rsh64x16 <t> x y)
 21054  	// cond: shiftIsBounded(v)
 21055  	// result: (SRA <t> x y)
 21056  	for {
 21057  		t := v.Type
 21058  		x := v_0
 21059  		y := v_1
 21060  		if !(shiftIsBounded(v)) {
 21061  			break
 21062  		}
 21063  		v.reset(OpARM64SRA)
 21064  		v.Type = t
 21065  		v.AddArg2(x, y)
 21066  		return true
 21067  	}
 21068  	// match: (Rsh64x16 x y)
 21069  	// cond: !shiftIsBounded(v)
 21070  	// result: (SRA x (CSEL [OpARM64LessThanU] <y.Type> y (Const64 <y.Type> [63]) (CMPconst [64] (ZeroExt16to64 y))))
 21071  	for {
 21072  		x := v_0
 21073  		y := v_1
 21074  		if !(!shiftIsBounded(v)) {
 21075  			break
 21076  		}
 21077  		v.reset(OpARM64SRA)
 21078  		v0 := b.NewValue0(v.Pos, OpARM64CSEL, y.Type)
 21079  		v0.AuxInt = opToAuxInt(OpARM64LessThanU)
 21080  		v1 := b.NewValue0(v.Pos, OpConst64, y.Type)
 21081  		v1.AuxInt = int64ToAuxInt(63)
 21082  		v2 := b.NewValue0(v.Pos, OpARM64CMPconst, types.TypeFlags)
 21083  		v2.AuxInt = int64ToAuxInt(64)
 21084  		v3 := b.NewValue0(v.Pos, OpZeroExt16to64, typ.UInt64)
 21085  		v3.AddArg(y)
 21086  		v2.AddArg(v3)
 21087  		v0.AddArg3(y, v1, v2)
 21088  		v.AddArg2(x, v0)
 21089  		return true
 21090  	}
 21091  	return false
 21092  }
 21093  func rewriteValueARM64_OpRsh64x32(v *Value) bool {
 21094  	v_1 := v.Args[1]
 21095  	v_0 := v.Args[0]
 21096  	b := v.Block
 21097  	typ := &b.Func.Config.Types
 21098  	// match: (Rsh64x32 <t> x y)
 21099  	// cond: shiftIsBounded(v)
 21100  	// result: (SRA <t> x y)
 21101  	for {
 21102  		t := v.Type
 21103  		x := v_0
 21104  		y := v_1
 21105  		if !(shiftIsBounded(v)) {
 21106  			break
 21107  		}
 21108  		v.reset(OpARM64SRA)
 21109  		v.Type = t
 21110  		v.AddArg2(x, y)
 21111  		return true
 21112  	}
 21113  	// match: (Rsh64x32 x y)
 21114  	// cond: !shiftIsBounded(v)
 21115  	// result: (SRA x (CSEL [OpARM64LessThanU] <y.Type> y (Const64 <y.Type> [63]) (CMPconst [64] (ZeroExt32to64 y))))
 21116  	for {
 21117  		x := v_0
 21118  		y := v_1
 21119  		if !(!shiftIsBounded(v)) {
 21120  			break
 21121  		}
 21122  		v.reset(OpARM64SRA)
 21123  		v0 := b.NewValue0(v.Pos, OpARM64CSEL, y.Type)
 21124  		v0.AuxInt = opToAuxInt(OpARM64LessThanU)
 21125  		v1 := b.NewValue0(v.Pos, OpConst64, y.Type)
 21126  		v1.AuxInt = int64ToAuxInt(63)
 21127  		v2 := b.NewValue0(v.Pos, OpARM64CMPconst, types.TypeFlags)
 21128  		v2.AuxInt = int64ToAuxInt(64)
 21129  		v3 := b.NewValue0(v.Pos, OpZeroExt32to64, typ.UInt64)
 21130  		v3.AddArg(y)
 21131  		v2.AddArg(v3)
 21132  		v0.AddArg3(y, v1, v2)
 21133  		v.AddArg2(x, v0)
 21134  		return true
 21135  	}
 21136  	return false
 21137  }
 21138  func rewriteValueARM64_OpRsh64x64(v *Value) bool {
 21139  	v_1 := v.Args[1]
 21140  	v_0 := v.Args[0]
 21141  	b := v.Block
 21142  	// match: (Rsh64x64 <t> x y)
 21143  	// cond: shiftIsBounded(v)
 21144  	// result: (SRA <t> x y)
 21145  	for {
 21146  		t := v.Type
 21147  		x := v_0
 21148  		y := v_1
 21149  		if !(shiftIsBounded(v)) {
 21150  			break
 21151  		}
 21152  		v.reset(OpARM64SRA)
 21153  		v.Type = t
 21154  		v.AddArg2(x, y)
 21155  		return true
 21156  	}
 21157  	// match: (Rsh64x64 x y)
 21158  	// cond: !shiftIsBounded(v)
 21159  	// result: (SRA x (CSEL [OpARM64LessThanU] <y.Type> y (Const64 <y.Type> [63]) (CMPconst [64] y)))
 21160  	for {
 21161  		x := v_0
 21162  		y := v_1
 21163  		if !(!shiftIsBounded(v)) {
 21164  			break
 21165  		}
 21166  		v.reset(OpARM64SRA)
 21167  		v0 := b.NewValue0(v.Pos, OpARM64CSEL, y.Type)
 21168  		v0.AuxInt = opToAuxInt(OpARM64LessThanU)
 21169  		v1 := b.NewValue0(v.Pos, OpConst64, y.Type)
 21170  		v1.AuxInt = int64ToAuxInt(63)
 21171  		v2 := b.NewValue0(v.Pos, OpARM64CMPconst, types.TypeFlags)
 21172  		v2.AuxInt = int64ToAuxInt(64)
 21173  		v2.AddArg(y)
 21174  		v0.AddArg3(y, v1, v2)
 21175  		v.AddArg2(x, v0)
 21176  		return true
 21177  	}
 21178  	return false
 21179  }
 21180  func rewriteValueARM64_OpRsh64x8(v *Value) bool {
 21181  	v_1 := v.Args[1]
 21182  	v_0 := v.Args[0]
 21183  	b := v.Block
 21184  	typ := &b.Func.Config.Types
 21185  	// match: (Rsh64x8 <t> x y)
 21186  	// cond: shiftIsBounded(v)
 21187  	// result: (SRA <t> x y)
 21188  	for {
 21189  		t := v.Type
 21190  		x := v_0
 21191  		y := v_1
 21192  		if !(shiftIsBounded(v)) {
 21193  			break
 21194  		}
 21195  		v.reset(OpARM64SRA)
 21196  		v.Type = t
 21197  		v.AddArg2(x, y)
 21198  		return true
 21199  	}
 21200  	// match: (Rsh64x8 x y)
 21201  	// cond: !shiftIsBounded(v)
 21202  	// result: (SRA x (CSEL [OpARM64LessThanU] <y.Type> y (Const64 <y.Type> [63]) (CMPconst [64] (ZeroExt8to64 y))))
 21203  	for {
 21204  		x := v_0
 21205  		y := v_1
 21206  		if !(!shiftIsBounded(v)) {
 21207  			break
 21208  		}
 21209  		v.reset(OpARM64SRA)
 21210  		v0 := b.NewValue0(v.Pos, OpARM64CSEL, y.Type)
 21211  		v0.AuxInt = opToAuxInt(OpARM64LessThanU)
 21212  		v1 := b.NewValue0(v.Pos, OpConst64, y.Type)
 21213  		v1.AuxInt = int64ToAuxInt(63)
 21214  		v2 := b.NewValue0(v.Pos, OpARM64CMPconst, types.TypeFlags)
 21215  		v2.AuxInt = int64ToAuxInt(64)
 21216  		v3 := b.NewValue0(v.Pos, OpZeroExt8to64, typ.UInt64)
 21217  		v3.AddArg(y)
 21218  		v2.AddArg(v3)
 21219  		v0.AddArg3(y, v1, v2)
 21220  		v.AddArg2(x, v0)
 21221  		return true
 21222  	}
 21223  	return false
 21224  }
 21225  func rewriteValueARM64_OpRsh8Ux16(v *Value) bool {
 21226  	v_1 := v.Args[1]
 21227  	v_0 := v.Args[0]
 21228  	b := v.Block
 21229  	typ := &b.Func.Config.Types
 21230  	// match: (Rsh8Ux16 <t> x y)
 21231  	// cond: shiftIsBounded(v)
 21232  	// result: (SRL <t> (ZeroExt8to64 x) y)
 21233  	for {
 21234  		t := v.Type
 21235  		x := v_0
 21236  		y := v_1
 21237  		if !(shiftIsBounded(v)) {
 21238  			break
 21239  		}
 21240  		v.reset(OpARM64SRL)
 21241  		v.Type = t
 21242  		v0 := b.NewValue0(v.Pos, OpZeroExt8to64, typ.UInt64)
 21243  		v0.AddArg(x)
 21244  		v.AddArg2(v0, y)
 21245  		return true
 21246  	}
 21247  	// match: (Rsh8Ux16 <t> x y)
 21248  	// cond: !shiftIsBounded(v)
 21249  	// result: (CSEL [OpARM64LessThanU] (SRL <t> (ZeroExt8to64 x) y) (Const64 <t> [0]) (CMPconst [64] (ZeroExt16to64 y)))
 21250  	for {
 21251  		t := v.Type
 21252  		x := v_0
 21253  		y := v_1
 21254  		if !(!shiftIsBounded(v)) {
 21255  			break
 21256  		}
 21257  		v.reset(OpARM64CSEL)
 21258  		v.AuxInt = opToAuxInt(OpARM64LessThanU)
 21259  		v0 := b.NewValue0(v.Pos, OpARM64SRL, t)
 21260  		v1 := b.NewValue0(v.Pos, OpZeroExt8to64, typ.UInt64)
 21261  		v1.AddArg(x)
 21262  		v0.AddArg2(v1, y)
 21263  		v2 := b.NewValue0(v.Pos, OpConst64, t)
 21264  		v2.AuxInt = int64ToAuxInt(0)
 21265  		v3 := b.NewValue0(v.Pos, OpARM64CMPconst, types.TypeFlags)
 21266  		v3.AuxInt = int64ToAuxInt(64)
 21267  		v4 := b.NewValue0(v.Pos, OpZeroExt16to64, typ.UInt64)
 21268  		v4.AddArg(y)
 21269  		v3.AddArg(v4)
 21270  		v.AddArg3(v0, v2, v3)
 21271  		return true
 21272  	}
 21273  	return false
 21274  }
 21275  func rewriteValueARM64_OpRsh8Ux32(v *Value) bool {
 21276  	v_1 := v.Args[1]
 21277  	v_0 := v.Args[0]
 21278  	b := v.Block
 21279  	typ := &b.Func.Config.Types
 21280  	// match: (Rsh8Ux32 <t> x y)
 21281  	// cond: shiftIsBounded(v)
 21282  	// result: (SRL <t> (ZeroExt8to64 x) y)
 21283  	for {
 21284  		t := v.Type
 21285  		x := v_0
 21286  		y := v_1
 21287  		if !(shiftIsBounded(v)) {
 21288  			break
 21289  		}
 21290  		v.reset(OpARM64SRL)
 21291  		v.Type = t
 21292  		v0 := b.NewValue0(v.Pos, OpZeroExt8to64, typ.UInt64)
 21293  		v0.AddArg(x)
 21294  		v.AddArg2(v0, y)
 21295  		return true
 21296  	}
 21297  	// match: (Rsh8Ux32 <t> x y)
 21298  	// cond: !shiftIsBounded(v)
 21299  	// result: (CSEL [OpARM64LessThanU] (SRL <t> (ZeroExt8to64 x) y) (Const64 <t> [0]) (CMPconst [64] (ZeroExt32to64 y)))
 21300  	for {
 21301  		t := v.Type
 21302  		x := v_0
 21303  		y := v_1
 21304  		if !(!shiftIsBounded(v)) {
 21305  			break
 21306  		}
 21307  		v.reset(OpARM64CSEL)
 21308  		v.AuxInt = opToAuxInt(OpARM64LessThanU)
 21309  		v0 := b.NewValue0(v.Pos, OpARM64SRL, t)
 21310  		v1 := b.NewValue0(v.Pos, OpZeroExt8to64, typ.UInt64)
 21311  		v1.AddArg(x)
 21312  		v0.AddArg2(v1, y)
 21313  		v2 := b.NewValue0(v.Pos, OpConst64, t)
 21314  		v2.AuxInt = int64ToAuxInt(0)
 21315  		v3 := b.NewValue0(v.Pos, OpARM64CMPconst, types.TypeFlags)
 21316  		v3.AuxInt = int64ToAuxInt(64)
 21317  		v4 := b.NewValue0(v.Pos, OpZeroExt32to64, typ.UInt64)
 21318  		v4.AddArg(y)
 21319  		v3.AddArg(v4)
 21320  		v.AddArg3(v0, v2, v3)
 21321  		return true
 21322  	}
 21323  	return false
 21324  }
 21325  func rewriteValueARM64_OpRsh8Ux64(v *Value) bool {
 21326  	v_1 := v.Args[1]
 21327  	v_0 := v.Args[0]
 21328  	b := v.Block
 21329  	typ := &b.Func.Config.Types
 21330  	// match: (Rsh8Ux64 <t> x y)
 21331  	// cond: shiftIsBounded(v)
 21332  	// result: (SRL <t> (ZeroExt8to64 x) y)
 21333  	for {
 21334  		t := v.Type
 21335  		x := v_0
 21336  		y := v_1
 21337  		if !(shiftIsBounded(v)) {
 21338  			break
 21339  		}
 21340  		v.reset(OpARM64SRL)
 21341  		v.Type = t
 21342  		v0 := b.NewValue0(v.Pos, OpZeroExt8to64, typ.UInt64)
 21343  		v0.AddArg(x)
 21344  		v.AddArg2(v0, y)
 21345  		return true
 21346  	}
 21347  	// match: (Rsh8Ux64 <t> x y)
 21348  	// cond: !shiftIsBounded(v)
 21349  	// result: (CSEL [OpARM64LessThanU] (SRL <t> (ZeroExt8to64 x) y) (Const64 <t> [0]) (CMPconst [64] y))
 21350  	for {
 21351  		t := v.Type
 21352  		x := v_0
 21353  		y := v_1
 21354  		if !(!shiftIsBounded(v)) {
 21355  			break
 21356  		}
 21357  		v.reset(OpARM64CSEL)
 21358  		v.AuxInt = opToAuxInt(OpARM64LessThanU)
 21359  		v0 := b.NewValue0(v.Pos, OpARM64SRL, t)
 21360  		v1 := b.NewValue0(v.Pos, OpZeroExt8to64, typ.UInt64)
 21361  		v1.AddArg(x)
 21362  		v0.AddArg2(v1, y)
 21363  		v2 := b.NewValue0(v.Pos, OpConst64, t)
 21364  		v2.AuxInt = int64ToAuxInt(0)
 21365  		v3 := b.NewValue0(v.Pos, OpARM64CMPconst, types.TypeFlags)
 21366  		v3.AuxInt = int64ToAuxInt(64)
 21367  		v3.AddArg(y)
 21368  		v.AddArg3(v0, v2, v3)
 21369  		return true
 21370  	}
 21371  	return false
 21372  }
 21373  func rewriteValueARM64_OpRsh8Ux8(v *Value) bool {
 21374  	v_1 := v.Args[1]
 21375  	v_0 := v.Args[0]
 21376  	b := v.Block
 21377  	typ := &b.Func.Config.Types
 21378  	// match: (Rsh8Ux8 <t> x y)
 21379  	// cond: shiftIsBounded(v)
 21380  	// result: (SRL <t> (ZeroExt8to64 x) y)
 21381  	for {
 21382  		t := v.Type
 21383  		x := v_0
 21384  		y := v_1
 21385  		if !(shiftIsBounded(v)) {
 21386  			break
 21387  		}
 21388  		v.reset(OpARM64SRL)
 21389  		v.Type = t
 21390  		v0 := b.NewValue0(v.Pos, OpZeroExt8to64, typ.UInt64)
 21391  		v0.AddArg(x)
 21392  		v.AddArg2(v0, y)
 21393  		return true
 21394  	}
 21395  	// match: (Rsh8Ux8 <t> x y)
 21396  	// cond: !shiftIsBounded(v)
 21397  	// result: (CSEL [OpARM64LessThanU] (SRL <t> (ZeroExt8to64 x) y) (Const64 <t> [0]) (CMPconst [64] (ZeroExt8to64 y)))
 21398  	for {
 21399  		t := v.Type
 21400  		x := v_0
 21401  		y := v_1
 21402  		if !(!shiftIsBounded(v)) {
 21403  			break
 21404  		}
 21405  		v.reset(OpARM64CSEL)
 21406  		v.AuxInt = opToAuxInt(OpARM64LessThanU)
 21407  		v0 := b.NewValue0(v.Pos, OpARM64SRL, t)
 21408  		v1 := b.NewValue0(v.Pos, OpZeroExt8to64, typ.UInt64)
 21409  		v1.AddArg(x)
 21410  		v0.AddArg2(v1, y)
 21411  		v2 := b.NewValue0(v.Pos, OpConst64, t)
 21412  		v2.AuxInt = int64ToAuxInt(0)
 21413  		v3 := b.NewValue0(v.Pos, OpARM64CMPconst, types.TypeFlags)
 21414  		v3.AuxInt = int64ToAuxInt(64)
 21415  		v4 := b.NewValue0(v.Pos, OpZeroExt8to64, typ.UInt64)
 21416  		v4.AddArg(y)
 21417  		v3.AddArg(v4)
 21418  		v.AddArg3(v0, v2, v3)
 21419  		return true
 21420  	}
 21421  	return false
 21422  }
 21423  func rewriteValueARM64_OpRsh8x16(v *Value) bool {
 21424  	v_1 := v.Args[1]
 21425  	v_0 := v.Args[0]
 21426  	b := v.Block
 21427  	typ := &b.Func.Config.Types
 21428  	// match: (Rsh8x16 <t> x y)
 21429  	// cond: shiftIsBounded(v)
 21430  	// result: (SRA <t> (SignExt8to64 x) y)
 21431  	for {
 21432  		t := v.Type
 21433  		x := v_0
 21434  		y := v_1
 21435  		if !(shiftIsBounded(v)) {
 21436  			break
 21437  		}
 21438  		v.reset(OpARM64SRA)
 21439  		v.Type = t
 21440  		v0 := b.NewValue0(v.Pos, OpSignExt8to64, typ.Int64)
 21441  		v0.AddArg(x)
 21442  		v.AddArg2(v0, y)
 21443  		return true
 21444  	}
 21445  	// match: (Rsh8x16 x y)
 21446  	// cond: !shiftIsBounded(v)
 21447  	// result: (SRA (SignExt8to64 x) (CSEL [OpARM64LessThanU] <y.Type> y (Const64 <y.Type> [63]) (CMPconst [64] (ZeroExt16to64 y))))
 21448  	for {
 21449  		x := v_0
 21450  		y := v_1
 21451  		if !(!shiftIsBounded(v)) {
 21452  			break
 21453  		}
 21454  		v.reset(OpARM64SRA)
 21455  		v0 := b.NewValue0(v.Pos, OpSignExt8to64, typ.Int64)
 21456  		v0.AddArg(x)
 21457  		v1 := b.NewValue0(v.Pos, OpARM64CSEL, y.Type)
 21458  		v1.AuxInt = opToAuxInt(OpARM64LessThanU)
 21459  		v2 := b.NewValue0(v.Pos, OpConst64, y.Type)
 21460  		v2.AuxInt = int64ToAuxInt(63)
 21461  		v3 := b.NewValue0(v.Pos, OpARM64CMPconst, types.TypeFlags)
 21462  		v3.AuxInt = int64ToAuxInt(64)
 21463  		v4 := b.NewValue0(v.Pos, OpZeroExt16to64, typ.UInt64)
 21464  		v4.AddArg(y)
 21465  		v3.AddArg(v4)
 21466  		v1.AddArg3(y, v2, v3)
 21467  		v.AddArg2(v0, v1)
 21468  		return true
 21469  	}
 21470  	return false
 21471  }
 21472  func rewriteValueARM64_OpRsh8x32(v *Value) bool {
 21473  	v_1 := v.Args[1]
 21474  	v_0 := v.Args[0]
 21475  	b := v.Block
 21476  	typ := &b.Func.Config.Types
 21477  	// match: (Rsh8x32 <t> x y)
 21478  	// cond: shiftIsBounded(v)
 21479  	// result: (SRA <t> (SignExt8to64 x) y)
 21480  	for {
 21481  		t := v.Type
 21482  		x := v_0
 21483  		y := v_1
 21484  		if !(shiftIsBounded(v)) {
 21485  			break
 21486  		}
 21487  		v.reset(OpARM64SRA)
 21488  		v.Type = t
 21489  		v0 := b.NewValue0(v.Pos, OpSignExt8to64, typ.Int64)
 21490  		v0.AddArg(x)
 21491  		v.AddArg2(v0, y)
 21492  		return true
 21493  	}
 21494  	// match: (Rsh8x32 x y)
 21495  	// cond: !shiftIsBounded(v)
 21496  	// result: (SRA (SignExt8to64 x) (CSEL [OpARM64LessThanU] <y.Type> y (Const64 <y.Type> [63]) (CMPconst [64] (ZeroExt32to64 y))))
 21497  	for {
 21498  		x := v_0
 21499  		y := v_1
 21500  		if !(!shiftIsBounded(v)) {
 21501  			break
 21502  		}
 21503  		v.reset(OpARM64SRA)
 21504  		v0 := b.NewValue0(v.Pos, OpSignExt8to64, typ.Int64)
 21505  		v0.AddArg(x)
 21506  		v1 := b.NewValue0(v.Pos, OpARM64CSEL, y.Type)
 21507  		v1.AuxInt = opToAuxInt(OpARM64LessThanU)
 21508  		v2 := b.NewValue0(v.Pos, OpConst64, y.Type)
 21509  		v2.AuxInt = int64ToAuxInt(63)
 21510  		v3 := b.NewValue0(v.Pos, OpARM64CMPconst, types.TypeFlags)
 21511  		v3.AuxInt = int64ToAuxInt(64)
 21512  		v4 := b.NewValue0(v.Pos, OpZeroExt32to64, typ.UInt64)
 21513  		v4.AddArg(y)
 21514  		v3.AddArg(v4)
 21515  		v1.AddArg3(y, v2, v3)
 21516  		v.AddArg2(v0, v1)
 21517  		return true
 21518  	}
 21519  	return false
 21520  }
 21521  func rewriteValueARM64_OpRsh8x64(v *Value) bool {
 21522  	v_1 := v.Args[1]
 21523  	v_0 := v.Args[0]
 21524  	b := v.Block
 21525  	typ := &b.Func.Config.Types
 21526  	// match: (Rsh8x64 <t> x y)
 21527  	// cond: shiftIsBounded(v)
 21528  	// result: (SRA <t> (SignExt8to64 x) y)
 21529  	for {
 21530  		t := v.Type
 21531  		x := v_0
 21532  		y := v_1
 21533  		if !(shiftIsBounded(v)) {
 21534  			break
 21535  		}
 21536  		v.reset(OpARM64SRA)
 21537  		v.Type = t
 21538  		v0 := b.NewValue0(v.Pos, OpSignExt8to64, typ.Int64)
 21539  		v0.AddArg(x)
 21540  		v.AddArg2(v0, y)
 21541  		return true
 21542  	}
 21543  	// match: (Rsh8x64 x y)
 21544  	// cond: !shiftIsBounded(v)
 21545  	// result: (SRA (SignExt8to64 x) (CSEL [OpARM64LessThanU] <y.Type> y (Const64 <y.Type> [63]) (CMPconst [64] y)))
 21546  	for {
 21547  		x := v_0
 21548  		y := v_1
 21549  		if !(!shiftIsBounded(v)) {
 21550  			break
 21551  		}
 21552  		v.reset(OpARM64SRA)
 21553  		v0 := b.NewValue0(v.Pos, OpSignExt8to64, typ.Int64)
 21554  		v0.AddArg(x)
 21555  		v1 := b.NewValue0(v.Pos, OpARM64CSEL, y.Type)
 21556  		v1.AuxInt = opToAuxInt(OpARM64LessThanU)
 21557  		v2 := b.NewValue0(v.Pos, OpConst64, y.Type)
 21558  		v2.AuxInt = int64ToAuxInt(63)
 21559  		v3 := b.NewValue0(v.Pos, OpARM64CMPconst, types.TypeFlags)
 21560  		v3.AuxInt = int64ToAuxInt(64)
 21561  		v3.AddArg(y)
 21562  		v1.AddArg3(y, v2, v3)
 21563  		v.AddArg2(v0, v1)
 21564  		return true
 21565  	}
 21566  	return false
 21567  }
 21568  func rewriteValueARM64_OpRsh8x8(v *Value) bool {
 21569  	v_1 := v.Args[1]
 21570  	v_0 := v.Args[0]
 21571  	b := v.Block
 21572  	typ := &b.Func.Config.Types
 21573  	// match: (Rsh8x8 <t> x y)
 21574  	// cond: shiftIsBounded(v)
 21575  	// result: (SRA <t> (SignExt8to64 x) y)
 21576  	for {
 21577  		t := v.Type
 21578  		x := v_0
 21579  		y := v_1
 21580  		if !(shiftIsBounded(v)) {
 21581  			break
 21582  		}
 21583  		v.reset(OpARM64SRA)
 21584  		v.Type = t
 21585  		v0 := b.NewValue0(v.Pos, OpSignExt8to64, typ.Int64)
 21586  		v0.AddArg(x)
 21587  		v.AddArg2(v0, y)
 21588  		return true
 21589  	}
 21590  	// match: (Rsh8x8 x y)
 21591  	// cond: !shiftIsBounded(v)
 21592  	// result: (SRA (SignExt8to64 x) (CSEL [OpARM64LessThanU] <y.Type> y (Const64 <y.Type> [63]) (CMPconst [64] (ZeroExt8to64 y))))
 21593  	for {
 21594  		x := v_0
 21595  		y := v_1
 21596  		if !(!shiftIsBounded(v)) {
 21597  			break
 21598  		}
 21599  		v.reset(OpARM64SRA)
 21600  		v0 := b.NewValue0(v.Pos, OpSignExt8to64, typ.Int64)
 21601  		v0.AddArg(x)
 21602  		v1 := b.NewValue0(v.Pos, OpARM64CSEL, y.Type)
 21603  		v1.AuxInt = opToAuxInt(OpARM64LessThanU)
 21604  		v2 := b.NewValue0(v.Pos, OpConst64, y.Type)
 21605  		v2.AuxInt = int64ToAuxInt(63)
 21606  		v3 := b.NewValue0(v.Pos, OpARM64CMPconst, types.TypeFlags)
 21607  		v3.AuxInt = int64ToAuxInt(64)
 21608  		v4 := b.NewValue0(v.Pos, OpZeroExt8to64, typ.UInt64)
 21609  		v4.AddArg(y)
 21610  		v3.AddArg(v4)
 21611  		v1.AddArg3(y, v2, v3)
 21612  		v.AddArg2(v0, v1)
 21613  		return true
 21614  	}
 21615  	return false
 21616  }
 21617  func rewriteValueARM64_OpSelect0(v *Value) bool {
 21618  	v_0 := v.Args[0]
 21619  	b := v.Block
 21620  	typ := &b.Func.Config.Types
 21621  	// match: (Select0 (Mul64uhilo x y))
 21622  	// result: (UMULH x y)
 21623  	for {
 21624  		if v_0.Op != OpMul64uhilo {
 21625  			break
 21626  		}
 21627  		y := v_0.Args[1]
 21628  		x := v_0.Args[0]
 21629  		v.reset(OpARM64UMULH)
 21630  		v.AddArg2(x, y)
 21631  		return true
 21632  	}
 21633  	// match: (Select0 (Add64carry x y c))
 21634  	// result: (Select0 <typ.UInt64> (ADCSflags x y (Select1 <types.TypeFlags> (ADDSconstflags [-1] c))))
 21635  	for {
 21636  		if v_0.Op != OpAdd64carry {
 21637  			break
 21638  		}
 21639  		c := v_0.Args[2]
 21640  		x := v_0.Args[0]
 21641  		y := v_0.Args[1]
 21642  		v.reset(OpSelect0)
 21643  		v.Type = typ.UInt64
 21644  		v0 := b.NewValue0(v.Pos, OpARM64ADCSflags, types.NewTuple(typ.UInt64, types.TypeFlags))
 21645  		v1 := b.NewValue0(v.Pos, OpSelect1, types.TypeFlags)
 21646  		v2 := b.NewValue0(v.Pos, OpARM64ADDSconstflags, types.NewTuple(typ.UInt64, types.TypeFlags))
 21647  		v2.AuxInt = int64ToAuxInt(-1)
 21648  		v2.AddArg(c)
 21649  		v1.AddArg(v2)
 21650  		v0.AddArg3(x, y, v1)
 21651  		v.AddArg(v0)
 21652  		return true
 21653  	}
 21654  	// match: (Select0 (Sub64borrow x y bo))
 21655  	// result: (Select0 <typ.UInt64> (SBCSflags x y (Select1 <types.TypeFlags> (NEGSflags bo))))
 21656  	for {
 21657  		if v_0.Op != OpSub64borrow {
 21658  			break
 21659  		}
 21660  		bo := v_0.Args[2]
 21661  		x := v_0.Args[0]
 21662  		y := v_0.Args[1]
 21663  		v.reset(OpSelect0)
 21664  		v.Type = typ.UInt64
 21665  		v0 := b.NewValue0(v.Pos, OpARM64SBCSflags, types.NewTuple(typ.UInt64, types.TypeFlags))
 21666  		v1 := b.NewValue0(v.Pos, OpSelect1, types.TypeFlags)
 21667  		v2 := b.NewValue0(v.Pos, OpARM64NEGSflags, types.NewTuple(typ.UInt64, types.TypeFlags))
 21668  		v2.AddArg(bo)
 21669  		v1.AddArg(v2)
 21670  		v0.AddArg3(x, y, v1)
 21671  		v.AddArg(v0)
 21672  		return true
 21673  	}
 21674  	// match: (Select0 (Mul64uover x y))
 21675  	// result: (MUL x y)
 21676  	for {
 21677  		if v_0.Op != OpMul64uover {
 21678  			break
 21679  		}
 21680  		y := v_0.Args[1]
 21681  		x := v_0.Args[0]
 21682  		v.reset(OpARM64MUL)
 21683  		v.AddArg2(x, y)
 21684  		return true
 21685  	}
 21686  	return false
 21687  }
 21688  func rewriteValueARM64_OpSelect1(v *Value) bool {
 21689  	v_0 := v.Args[0]
 21690  	b := v.Block
 21691  	typ := &b.Func.Config.Types
 21692  	// match: (Select1 (Mul64uhilo x y))
 21693  	// result: (MUL x y)
 21694  	for {
 21695  		if v_0.Op != OpMul64uhilo {
 21696  			break
 21697  		}
 21698  		y := v_0.Args[1]
 21699  		x := v_0.Args[0]
 21700  		v.reset(OpARM64MUL)
 21701  		v.AddArg2(x, y)
 21702  		return true
 21703  	}
 21704  	// match: (Select1 (Add64carry x y c))
 21705  	// result: (ADCzerocarry <typ.UInt64> (Select1 <types.TypeFlags> (ADCSflags x y (Select1 <types.TypeFlags> (ADDSconstflags [-1] c)))))
 21706  	for {
 21707  		if v_0.Op != OpAdd64carry {
 21708  			break
 21709  		}
 21710  		c := v_0.Args[2]
 21711  		x := v_0.Args[0]
 21712  		y := v_0.Args[1]
 21713  		v.reset(OpARM64ADCzerocarry)
 21714  		v.Type = typ.UInt64
 21715  		v0 := b.NewValue0(v.Pos, OpSelect1, types.TypeFlags)
 21716  		v1 := b.NewValue0(v.Pos, OpARM64ADCSflags, types.NewTuple(typ.UInt64, types.TypeFlags))
 21717  		v2 := b.NewValue0(v.Pos, OpSelect1, types.TypeFlags)
 21718  		v3 := b.NewValue0(v.Pos, OpARM64ADDSconstflags, types.NewTuple(typ.UInt64, types.TypeFlags))
 21719  		v3.AuxInt = int64ToAuxInt(-1)
 21720  		v3.AddArg(c)
 21721  		v2.AddArg(v3)
 21722  		v1.AddArg3(x, y, v2)
 21723  		v0.AddArg(v1)
 21724  		v.AddArg(v0)
 21725  		return true
 21726  	}
 21727  	// match: (Select1 (Sub64borrow x y bo))
 21728  	// result: (NEG <typ.UInt64> (NGCzerocarry <typ.UInt64> (Select1 <types.TypeFlags> (SBCSflags x y (Select1 <types.TypeFlags> (NEGSflags bo))))))
 21729  	for {
 21730  		if v_0.Op != OpSub64borrow {
 21731  			break
 21732  		}
 21733  		bo := v_0.Args[2]
 21734  		x := v_0.Args[0]
 21735  		y := v_0.Args[1]
 21736  		v.reset(OpARM64NEG)
 21737  		v.Type = typ.UInt64
 21738  		v0 := b.NewValue0(v.Pos, OpARM64NGCzerocarry, typ.UInt64)
 21739  		v1 := b.NewValue0(v.Pos, OpSelect1, types.TypeFlags)
 21740  		v2 := b.NewValue0(v.Pos, OpARM64SBCSflags, types.NewTuple(typ.UInt64, types.TypeFlags))
 21741  		v3 := b.NewValue0(v.Pos, OpSelect1, types.TypeFlags)
 21742  		v4 := b.NewValue0(v.Pos, OpARM64NEGSflags, types.NewTuple(typ.UInt64, types.TypeFlags))
 21743  		v4.AddArg(bo)
 21744  		v3.AddArg(v4)
 21745  		v2.AddArg3(x, y, v3)
 21746  		v1.AddArg(v2)
 21747  		v0.AddArg(v1)
 21748  		v.AddArg(v0)
 21749  		return true
 21750  	}
 21751  	// match: (Select1 (Mul64uover x y))
 21752  	// result: (NotEqual (CMPconst (UMULH <typ.UInt64> x y) [0]))
 21753  	for {
 21754  		if v_0.Op != OpMul64uover {
 21755  			break
 21756  		}
 21757  		y := v_0.Args[1]
 21758  		x := v_0.Args[0]
 21759  		v.reset(OpARM64NotEqual)
 21760  		v0 := b.NewValue0(v.Pos, OpARM64CMPconst, types.TypeFlags)
 21761  		v0.AuxInt = int64ToAuxInt(0)
 21762  		v1 := b.NewValue0(v.Pos, OpARM64UMULH, typ.UInt64)
 21763  		v1.AddArg2(x, y)
 21764  		v0.AddArg(v1)
 21765  		v.AddArg(v0)
 21766  		return true
 21767  	}
 21768  	return false
 21769  }
 21770  func rewriteValueARM64_OpSelectN(v *Value) bool {
 21771  	v_0 := v.Args[0]
 21772  	b := v.Block
 21773  	config := b.Func.Config
 21774  	// match: (SelectN [0] call:(CALLstatic {sym} s1:(MOVDstore _ (MOVDconst [sz]) s2:(MOVDstore _ src s3:(MOVDstore {t} _ dst mem)))))
 21775  	// cond: sz >= 0 && isSameCall(sym, "runtime.memmove") && s1.Uses == 1 && s2.Uses == 1 && s3.Uses == 1 && isInlinableMemmove(dst, src, sz, config) && clobber(s1, s2, s3, call)
 21776  	// result: (Move [sz] dst src mem)
 21777  	for {
 21778  		if auxIntToInt64(v.AuxInt) != 0 {
 21779  			break
 21780  		}
 21781  		call := v_0
 21782  		if call.Op != OpARM64CALLstatic || len(call.Args) != 1 {
 21783  			break
 21784  		}
 21785  		sym := auxToCall(call.Aux)
 21786  		s1 := call.Args[0]
 21787  		if s1.Op != OpARM64MOVDstore {
 21788  			break
 21789  		}
 21790  		_ = s1.Args[2]
 21791  		s1_1 := s1.Args[1]
 21792  		if s1_1.Op != OpARM64MOVDconst {
 21793  			break
 21794  		}
 21795  		sz := auxIntToInt64(s1_1.AuxInt)
 21796  		s2 := s1.Args[2]
 21797  		if s2.Op != OpARM64MOVDstore {
 21798  			break
 21799  		}
 21800  		_ = s2.Args[2]
 21801  		src := s2.Args[1]
 21802  		s3 := s2.Args[2]
 21803  		if s3.Op != OpARM64MOVDstore {
 21804  			break
 21805  		}
 21806  		mem := s3.Args[2]
 21807  		dst := s3.Args[1]
 21808  		if !(sz >= 0 && isSameCall(sym, "runtime.memmove") && s1.Uses == 1 && s2.Uses == 1 && s3.Uses == 1 && isInlinableMemmove(dst, src, sz, config) && clobber(s1, s2, s3, call)) {
 21809  			break
 21810  		}
 21811  		v.reset(OpMove)
 21812  		v.AuxInt = int64ToAuxInt(sz)
 21813  		v.AddArg3(dst, src, mem)
 21814  		return true
 21815  	}
 21816  	// match: (SelectN [0] call:(CALLstatic {sym} dst src (MOVDconst [sz]) mem))
 21817  	// cond: sz >= 0 && isSameCall(sym, "runtime.memmove") && call.Uses == 1 && isInlinableMemmove(dst, src, sz, config) && clobber(call)
 21818  	// result: (Move [sz] dst src mem)
 21819  	for {
 21820  		if auxIntToInt64(v.AuxInt) != 0 {
 21821  			break
 21822  		}
 21823  		call := v_0
 21824  		if call.Op != OpARM64CALLstatic || len(call.Args) != 4 {
 21825  			break
 21826  		}
 21827  		sym := auxToCall(call.Aux)
 21828  		mem := call.Args[3]
 21829  		dst := call.Args[0]
 21830  		src := call.Args[1]
 21831  		call_2 := call.Args[2]
 21832  		if call_2.Op != OpARM64MOVDconst {
 21833  			break
 21834  		}
 21835  		sz := auxIntToInt64(call_2.AuxInt)
 21836  		if !(sz >= 0 && isSameCall(sym, "runtime.memmove") && call.Uses == 1 && isInlinableMemmove(dst, src, sz, config) && clobber(call)) {
 21837  			break
 21838  		}
 21839  		v.reset(OpMove)
 21840  		v.AuxInt = int64ToAuxInt(sz)
 21841  		v.AddArg3(dst, src, mem)
 21842  		return true
 21843  	}
 21844  	return false
 21845  }
 21846  func rewriteValueARM64_OpSlicemask(v *Value) bool {
 21847  	v_0 := v.Args[0]
 21848  	b := v.Block
 21849  	// match: (Slicemask <t> x)
 21850  	// result: (SRAconst (NEG <t> x) [63])
 21851  	for {
 21852  		t := v.Type
 21853  		x := v_0
 21854  		v.reset(OpARM64SRAconst)
 21855  		v.AuxInt = int64ToAuxInt(63)
 21856  		v0 := b.NewValue0(v.Pos, OpARM64NEG, t)
 21857  		v0.AddArg(x)
 21858  		v.AddArg(v0)
 21859  		return true
 21860  	}
 21861  }
 21862  func rewriteValueARM64_OpStore(v *Value) bool {
 21863  	v_2 := v.Args[2]
 21864  	v_1 := v.Args[1]
 21865  	v_0 := v.Args[0]
 21866  	// match: (Store {t} ptr val mem)
 21867  	// cond: t.Size() == 1
 21868  	// result: (MOVBstore ptr val mem)
 21869  	for {
 21870  		t := auxToType(v.Aux)
 21871  		ptr := v_0
 21872  		val := v_1
 21873  		mem := v_2
 21874  		if !(t.Size() == 1) {
 21875  			break
 21876  		}
 21877  		v.reset(OpARM64MOVBstore)
 21878  		v.AddArg3(ptr, val, mem)
 21879  		return true
 21880  	}
 21881  	// match: (Store {t} ptr val mem)
 21882  	// cond: t.Size() == 2
 21883  	// result: (MOVHstore ptr val mem)
 21884  	for {
 21885  		t := auxToType(v.Aux)
 21886  		ptr := v_0
 21887  		val := v_1
 21888  		mem := v_2
 21889  		if !(t.Size() == 2) {
 21890  			break
 21891  		}
 21892  		v.reset(OpARM64MOVHstore)
 21893  		v.AddArg3(ptr, val, mem)
 21894  		return true
 21895  	}
 21896  	// match: (Store {t} ptr val mem)
 21897  	// cond: t.Size() == 4 && !t.IsFloat()
 21898  	// result: (MOVWstore ptr val mem)
 21899  	for {
 21900  		t := auxToType(v.Aux)
 21901  		ptr := v_0
 21902  		val := v_1
 21903  		mem := v_2
 21904  		if !(t.Size() == 4 && !t.IsFloat()) {
 21905  			break
 21906  		}
 21907  		v.reset(OpARM64MOVWstore)
 21908  		v.AddArg3(ptr, val, mem)
 21909  		return true
 21910  	}
 21911  	// match: (Store {t} ptr val mem)
 21912  	// cond: t.Size() == 8 && !t.IsFloat()
 21913  	// result: (MOVDstore ptr val mem)
 21914  	for {
 21915  		t := auxToType(v.Aux)
 21916  		ptr := v_0
 21917  		val := v_1
 21918  		mem := v_2
 21919  		if !(t.Size() == 8 && !t.IsFloat()) {
 21920  			break
 21921  		}
 21922  		v.reset(OpARM64MOVDstore)
 21923  		v.AddArg3(ptr, val, mem)
 21924  		return true
 21925  	}
 21926  	// match: (Store {t} ptr val mem)
 21927  	// cond: t.Size() == 4 && t.IsFloat()
 21928  	// result: (FMOVSstore ptr val mem)
 21929  	for {
 21930  		t := auxToType(v.Aux)
 21931  		ptr := v_0
 21932  		val := v_1
 21933  		mem := v_2
 21934  		if !(t.Size() == 4 && t.IsFloat()) {
 21935  			break
 21936  		}
 21937  		v.reset(OpARM64FMOVSstore)
 21938  		v.AddArg3(ptr, val, mem)
 21939  		return true
 21940  	}
 21941  	// match: (Store {t} ptr val mem)
 21942  	// cond: t.Size() == 8 && t.IsFloat()
 21943  	// result: (FMOVDstore ptr val mem)
 21944  	for {
 21945  		t := auxToType(v.Aux)
 21946  		ptr := v_0
 21947  		val := v_1
 21948  		mem := v_2
 21949  		if !(t.Size() == 8 && t.IsFloat()) {
 21950  			break
 21951  		}
 21952  		v.reset(OpARM64FMOVDstore)
 21953  		v.AddArg3(ptr, val, mem)
 21954  		return true
 21955  	}
 21956  	return false
 21957  }
 21958  func rewriteValueARM64_OpZero(v *Value) bool {
 21959  	v_1 := v.Args[1]
 21960  	v_0 := v.Args[0]
 21961  	b := v.Block
 21962  	typ := &b.Func.Config.Types
 21963  	// match: (Zero [0] _ mem)
 21964  	// result: mem
 21965  	for {
 21966  		if auxIntToInt64(v.AuxInt) != 0 {
 21967  			break
 21968  		}
 21969  		mem := v_1
 21970  		v.copyOf(mem)
 21971  		return true
 21972  	}
 21973  	// match: (Zero [1] ptr mem)
 21974  	// result: (MOVBstore ptr (MOVDconst [0]) mem)
 21975  	for {
 21976  		if auxIntToInt64(v.AuxInt) != 1 {
 21977  			break
 21978  		}
 21979  		ptr := v_0
 21980  		mem := v_1
 21981  		v.reset(OpARM64MOVBstore)
 21982  		v0 := b.NewValue0(v.Pos, OpARM64MOVDconst, typ.UInt64)
 21983  		v0.AuxInt = int64ToAuxInt(0)
 21984  		v.AddArg3(ptr, v0, mem)
 21985  		return true
 21986  	}
 21987  	// match: (Zero [2] ptr mem)
 21988  	// result: (MOVHstore ptr (MOVDconst [0]) mem)
 21989  	for {
 21990  		if auxIntToInt64(v.AuxInt) != 2 {
 21991  			break
 21992  		}
 21993  		ptr := v_0
 21994  		mem := v_1
 21995  		v.reset(OpARM64MOVHstore)
 21996  		v0 := b.NewValue0(v.Pos, OpARM64MOVDconst, typ.UInt64)
 21997  		v0.AuxInt = int64ToAuxInt(0)
 21998  		v.AddArg3(ptr, v0, mem)
 21999  		return true
 22000  	}
 22001  	// match: (Zero [4] ptr mem)
 22002  	// result: (MOVWstore ptr (MOVDconst [0]) mem)
 22003  	for {
 22004  		if auxIntToInt64(v.AuxInt) != 4 {
 22005  			break
 22006  		}
 22007  		ptr := v_0
 22008  		mem := v_1
 22009  		v.reset(OpARM64MOVWstore)
 22010  		v0 := b.NewValue0(v.Pos, OpARM64MOVDconst, typ.UInt64)
 22011  		v0.AuxInt = int64ToAuxInt(0)
 22012  		v.AddArg3(ptr, v0, mem)
 22013  		return true
 22014  	}
 22015  	// match: (Zero [3] ptr mem)
 22016  	// result: (MOVBstore [2] ptr (MOVDconst [0]) (MOVHstore ptr (MOVDconst [0]) mem))
 22017  	for {
 22018  		if auxIntToInt64(v.AuxInt) != 3 {
 22019  			break
 22020  		}
 22021  		ptr := v_0
 22022  		mem := v_1
 22023  		v.reset(OpARM64MOVBstore)
 22024  		v.AuxInt = int32ToAuxInt(2)
 22025  		v0 := b.NewValue0(v.Pos, OpARM64MOVDconst, typ.UInt64)
 22026  		v0.AuxInt = int64ToAuxInt(0)
 22027  		v1 := b.NewValue0(v.Pos, OpARM64MOVHstore, types.TypeMem)
 22028  		v1.AddArg3(ptr, v0, mem)
 22029  		v.AddArg3(ptr, v0, v1)
 22030  		return true
 22031  	}
 22032  	// match: (Zero [5] ptr mem)
 22033  	// result: (MOVBstore [4] ptr (MOVDconst [0]) (MOVWstore ptr (MOVDconst [0]) mem))
 22034  	for {
 22035  		if auxIntToInt64(v.AuxInt) != 5 {
 22036  			break
 22037  		}
 22038  		ptr := v_0
 22039  		mem := v_1
 22040  		v.reset(OpARM64MOVBstore)
 22041  		v.AuxInt = int32ToAuxInt(4)
 22042  		v0 := b.NewValue0(v.Pos, OpARM64MOVDconst, typ.UInt64)
 22043  		v0.AuxInt = int64ToAuxInt(0)
 22044  		v1 := b.NewValue0(v.Pos, OpARM64MOVWstore, types.TypeMem)
 22045  		v1.AddArg3(ptr, v0, mem)
 22046  		v.AddArg3(ptr, v0, v1)
 22047  		return true
 22048  	}
 22049  	// match: (Zero [6] ptr mem)
 22050  	// result: (MOVHstore [4] ptr (MOVDconst [0]) (MOVWstore ptr (MOVDconst [0]) mem))
 22051  	for {
 22052  		if auxIntToInt64(v.AuxInt) != 6 {
 22053  			break
 22054  		}
 22055  		ptr := v_0
 22056  		mem := v_1
 22057  		v.reset(OpARM64MOVHstore)
 22058  		v.AuxInt = int32ToAuxInt(4)
 22059  		v0 := b.NewValue0(v.Pos, OpARM64MOVDconst, typ.UInt64)
 22060  		v0.AuxInt = int64ToAuxInt(0)
 22061  		v1 := b.NewValue0(v.Pos, OpARM64MOVWstore, types.TypeMem)
 22062  		v1.AddArg3(ptr, v0, mem)
 22063  		v.AddArg3(ptr, v0, v1)
 22064  		return true
 22065  	}
 22066  	// match: (Zero [7] ptr mem)
 22067  	// result: (MOVWstore [3] ptr (MOVDconst [0]) (MOVWstore ptr (MOVDconst [0]) mem))
 22068  	for {
 22069  		if auxIntToInt64(v.AuxInt) != 7 {
 22070  			break
 22071  		}
 22072  		ptr := v_0
 22073  		mem := v_1
 22074  		v.reset(OpARM64MOVWstore)
 22075  		v.AuxInt = int32ToAuxInt(3)
 22076  		v0 := b.NewValue0(v.Pos, OpARM64MOVDconst, typ.UInt64)
 22077  		v0.AuxInt = int64ToAuxInt(0)
 22078  		v1 := b.NewValue0(v.Pos, OpARM64MOVWstore, types.TypeMem)
 22079  		v1.AddArg3(ptr, v0, mem)
 22080  		v.AddArg3(ptr, v0, v1)
 22081  		return true
 22082  	}
 22083  	// match: (Zero [8] ptr mem)
 22084  	// result: (MOVDstore ptr (MOVDconst [0]) mem)
 22085  	for {
 22086  		if auxIntToInt64(v.AuxInt) != 8 {
 22087  			break
 22088  		}
 22089  		ptr := v_0
 22090  		mem := v_1
 22091  		v.reset(OpARM64MOVDstore)
 22092  		v0 := b.NewValue0(v.Pos, OpARM64MOVDconst, typ.UInt64)
 22093  		v0.AuxInt = int64ToAuxInt(0)
 22094  		v.AddArg3(ptr, v0, mem)
 22095  		return true
 22096  	}
 22097  	// match: (Zero [9] ptr mem)
 22098  	// result: (MOVBstore [8] ptr (MOVDconst [0]) (MOVDstore ptr (MOVDconst [0]) mem))
 22099  	for {
 22100  		if auxIntToInt64(v.AuxInt) != 9 {
 22101  			break
 22102  		}
 22103  		ptr := v_0
 22104  		mem := v_1
 22105  		v.reset(OpARM64MOVBstore)
 22106  		v.AuxInt = int32ToAuxInt(8)
 22107  		v0 := b.NewValue0(v.Pos, OpARM64MOVDconst, typ.UInt64)
 22108  		v0.AuxInt = int64ToAuxInt(0)
 22109  		v1 := b.NewValue0(v.Pos, OpARM64MOVDstore, types.TypeMem)
 22110  		v1.AddArg3(ptr, v0, mem)
 22111  		v.AddArg3(ptr, v0, v1)
 22112  		return true
 22113  	}
 22114  	// match: (Zero [10] ptr mem)
 22115  	// result: (MOVHstore [8] ptr (MOVDconst [0]) (MOVDstore ptr (MOVDconst [0]) mem))
 22116  	for {
 22117  		if auxIntToInt64(v.AuxInt) != 10 {
 22118  			break
 22119  		}
 22120  		ptr := v_0
 22121  		mem := v_1
 22122  		v.reset(OpARM64MOVHstore)
 22123  		v.AuxInt = int32ToAuxInt(8)
 22124  		v0 := b.NewValue0(v.Pos, OpARM64MOVDconst, typ.UInt64)
 22125  		v0.AuxInt = int64ToAuxInt(0)
 22126  		v1 := b.NewValue0(v.Pos, OpARM64MOVDstore, types.TypeMem)
 22127  		v1.AddArg3(ptr, v0, mem)
 22128  		v.AddArg3(ptr, v0, v1)
 22129  		return true
 22130  	}
 22131  	// match: (Zero [11] ptr mem)
 22132  	// result: (MOVDstore [3] ptr (MOVDconst [0]) (MOVDstore ptr (MOVDconst [0]) mem))
 22133  	for {
 22134  		if auxIntToInt64(v.AuxInt) != 11 {
 22135  			break
 22136  		}
 22137  		ptr := v_0
 22138  		mem := v_1
 22139  		v.reset(OpARM64MOVDstore)
 22140  		v.AuxInt = int32ToAuxInt(3)
 22141  		v0 := b.NewValue0(v.Pos, OpARM64MOVDconst, typ.UInt64)
 22142  		v0.AuxInt = int64ToAuxInt(0)
 22143  		v1 := b.NewValue0(v.Pos, OpARM64MOVDstore, types.TypeMem)
 22144  		v1.AddArg3(ptr, v0, mem)
 22145  		v.AddArg3(ptr, v0, v1)
 22146  		return true
 22147  	}
 22148  	// match: (Zero [12] ptr mem)
 22149  	// result: (MOVWstore [8] ptr (MOVDconst [0]) (MOVDstore ptr (MOVDconst [0]) mem))
 22150  	for {
 22151  		if auxIntToInt64(v.AuxInt) != 12 {
 22152  			break
 22153  		}
 22154  		ptr := v_0
 22155  		mem := v_1
 22156  		v.reset(OpARM64MOVWstore)
 22157  		v.AuxInt = int32ToAuxInt(8)
 22158  		v0 := b.NewValue0(v.Pos, OpARM64MOVDconst, typ.UInt64)
 22159  		v0.AuxInt = int64ToAuxInt(0)
 22160  		v1 := b.NewValue0(v.Pos, OpARM64MOVDstore, types.TypeMem)
 22161  		v1.AddArg3(ptr, v0, mem)
 22162  		v.AddArg3(ptr, v0, v1)
 22163  		return true
 22164  	}
 22165  	// match: (Zero [13] ptr mem)
 22166  	// result: (MOVDstore [5] ptr (MOVDconst [0]) (MOVDstore ptr (MOVDconst [0]) mem))
 22167  	for {
 22168  		if auxIntToInt64(v.AuxInt) != 13 {
 22169  			break
 22170  		}
 22171  		ptr := v_0
 22172  		mem := v_1
 22173  		v.reset(OpARM64MOVDstore)
 22174  		v.AuxInt = int32ToAuxInt(5)
 22175  		v0 := b.NewValue0(v.Pos, OpARM64MOVDconst, typ.UInt64)
 22176  		v0.AuxInt = int64ToAuxInt(0)
 22177  		v1 := b.NewValue0(v.Pos, OpARM64MOVDstore, types.TypeMem)
 22178  		v1.AddArg3(ptr, v0, mem)
 22179  		v.AddArg3(ptr, v0, v1)
 22180  		return true
 22181  	}
 22182  	// match: (Zero [14] ptr mem)
 22183  	// result: (MOVDstore [6] ptr (MOVDconst [0]) (MOVDstore ptr (MOVDconst [0]) mem))
 22184  	for {
 22185  		if auxIntToInt64(v.AuxInt) != 14 {
 22186  			break
 22187  		}
 22188  		ptr := v_0
 22189  		mem := v_1
 22190  		v.reset(OpARM64MOVDstore)
 22191  		v.AuxInt = int32ToAuxInt(6)
 22192  		v0 := b.NewValue0(v.Pos, OpARM64MOVDconst, typ.UInt64)
 22193  		v0.AuxInt = int64ToAuxInt(0)
 22194  		v1 := b.NewValue0(v.Pos, OpARM64MOVDstore, types.TypeMem)
 22195  		v1.AddArg3(ptr, v0, mem)
 22196  		v.AddArg3(ptr, v0, v1)
 22197  		return true
 22198  	}
 22199  	// match: (Zero [15] ptr mem)
 22200  	// result: (MOVDstore [7] ptr (MOVDconst [0]) (MOVDstore ptr (MOVDconst [0]) mem))
 22201  	for {
 22202  		if auxIntToInt64(v.AuxInt) != 15 {
 22203  			break
 22204  		}
 22205  		ptr := v_0
 22206  		mem := v_1
 22207  		v.reset(OpARM64MOVDstore)
 22208  		v.AuxInt = int32ToAuxInt(7)
 22209  		v0 := b.NewValue0(v.Pos, OpARM64MOVDconst, typ.UInt64)
 22210  		v0.AuxInt = int64ToAuxInt(0)
 22211  		v1 := b.NewValue0(v.Pos, OpARM64MOVDstore, types.TypeMem)
 22212  		v1.AddArg3(ptr, v0, mem)
 22213  		v.AddArg3(ptr, v0, v1)
 22214  		return true
 22215  	}
 22216  	// match: (Zero [16] ptr mem)
 22217  	// result: (STP [0] ptr (MOVDconst [0]) (MOVDconst [0]) mem)
 22218  	for {
 22219  		if auxIntToInt64(v.AuxInt) != 16 {
 22220  			break
 22221  		}
 22222  		ptr := v_0
 22223  		mem := v_1
 22224  		v.reset(OpARM64STP)
 22225  		v.AuxInt = int32ToAuxInt(0)
 22226  		v0 := b.NewValue0(v.Pos, OpARM64MOVDconst, typ.UInt64)
 22227  		v0.AuxInt = int64ToAuxInt(0)
 22228  		v.AddArg4(ptr, v0, v0, mem)
 22229  		return true
 22230  	}
 22231  	// match: (Zero [32] ptr mem)
 22232  	// result: (STP [16] ptr (MOVDconst [0]) (MOVDconst [0]) (STP [0] ptr (MOVDconst [0]) (MOVDconst [0]) mem))
 22233  	for {
 22234  		if auxIntToInt64(v.AuxInt) != 32 {
 22235  			break
 22236  		}
 22237  		ptr := v_0
 22238  		mem := v_1
 22239  		v.reset(OpARM64STP)
 22240  		v.AuxInt = int32ToAuxInt(16)
 22241  		v0 := b.NewValue0(v.Pos, OpARM64MOVDconst, typ.UInt64)
 22242  		v0.AuxInt = int64ToAuxInt(0)
 22243  		v1 := b.NewValue0(v.Pos, OpARM64STP, types.TypeMem)
 22244  		v1.AuxInt = int32ToAuxInt(0)
 22245  		v1.AddArg4(ptr, v0, v0, mem)
 22246  		v.AddArg4(ptr, v0, v0, v1)
 22247  		return true
 22248  	}
 22249  	// match: (Zero [48] ptr mem)
 22250  	// result: (STP [32] ptr (MOVDconst [0]) (MOVDconst [0]) (STP [16] ptr (MOVDconst [0]) (MOVDconst [0]) (STP [0] ptr (MOVDconst [0]) (MOVDconst [0]) mem)))
 22251  	for {
 22252  		if auxIntToInt64(v.AuxInt) != 48 {
 22253  			break
 22254  		}
 22255  		ptr := v_0
 22256  		mem := v_1
 22257  		v.reset(OpARM64STP)
 22258  		v.AuxInt = int32ToAuxInt(32)
 22259  		v0 := b.NewValue0(v.Pos, OpARM64MOVDconst, typ.UInt64)
 22260  		v0.AuxInt = int64ToAuxInt(0)
 22261  		v1 := b.NewValue0(v.Pos, OpARM64STP, types.TypeMem)
 22262  		v1.AuxInt = int32ToAuxInt(16)
 22263  		v2 := b.NewValue0(v.Pos, OpARM64STP, types.TypeMem)
 22264  		v2.AuxInt = int32ToAuxInt(0)
 22265  		v2.AddArg4(ptr, v0, v0, mem)
 22266  		v1.AddArg4(ptr, v0, v0, v2)
 22267  		v.AddArg4(ptr, v0, v0, v1)
 22268  		return true
 22269  	}
 22270  	// match: (Zero [64] ptr mem)
 22271  	// result: (STP [48] ptr (MOVDconst [0]) (MOVDconst [0]) (STP [32] ptr (MOVDconst [0]) (MOVDconst [0]) (STP [16] ptr (MOVDconst [0]) (MOVDconst [0]) (STP [0] ptr (MOVDconst [0]) (MOVDconst [0]) mem))))
 22272  	for {
 22273  		if auxIntToInt64(v.AuxInt) != 64 {
 22274  			break
 22275  		}
 22276  		ptr := v_0
 22277  		mem := v_1
 22278  		v.reset(OpARM64STP)
 22279  		v.AuxInt = int32ToAuxInt(48)
 22280  		v0 := b.NewValue0(v.Pos, OpARM64MOVDconst, typ.UInt64)
 22281  		v0.AuxInt = int64ToAuxInt(0)
 22282  		v1 := b.NewValue0(v.Pos, OpARM64STP, types.TypeMem)
 22283  		v1.AuxInt = int32ToAuxInt(32)
 22284  		v2 := b.NewValue0(v.Pos, OpARM64STP, types.TypeMem)
 22285  		v2.AuxInt = int32ToAuxInt(16)
 22286  		v3 := b.NewValue0(v.Pos, OpARM64STP, types.TypeMem)
 22287  		v3.AuxInt = int32ToAuxInt(0)
 22288  		v3.AddArg4(ptr, v0, v0, mem)
 22289  		v2.AddArg4(ptr, v0, v0, v3)
 22290  		v1.AddArg4(ptr, v0, v0, v2)
 22291  		v.AddArg4(ptr, v0, v0, v1)
 22292  		return true
 22293  	}
 22294  	// match: (Zero [s] ptr mem)
 22295  	// cond: s%16 != 0 && s%16 <= 8 && s > 16
 22296  	// result: (Zero [8] (OffPtr <ptr.Type> ptr [s-8]) (Zero [s-s%16] ptr mem))
 22297  	for {
 22298  		s := auxIntToInt64(v.AuxInt)
 22299  		ptr := v_0
 22300  		mem := v_1
 22301  		if !(s%16 != 0 && s%16 <= 8 && s > 16) {
 22302  			break
 22303  		}
 22304  		v.reset(OpZero)
 22305  		v.AuxInt = int64ToAuxInt(8)
 22306  		v0 := b.NewValue0(v.Pos, OpOffPtr, ptr.Type)
 22307  		v0.AuxInt = int64ToAuxInt(s - 8)
 22308  		v0.AddArg(ptr)
 22309  		v1 := b.NewValue0(v.Pos, OpZero, types.TypeMem)
 22310  		v1.AuxInt = int64ToAuxInt(s - s%16)
 22311  		v1.AddArg2(ptr, mem)
 22312  		v.AddArg2(v0, v1)
 22313  		return true
 22314  	}
 22315  	// match: (Zero [s] ptr mem)
 22316  	// cond: s%16 != 0 && s%16 > 8 && s > 16
 22317  	// result: (Zero [16] (OffPtr <ptr.Type> ptr [s-16]) (Zero [s-s%16] ptr mem))
 22318  	for {
 22319  		s := auxIntToInt64(v.AuxInt)
 22320  		ptr := v_0
 22321  		mem := v_1
 22322  		if !(s%16 != 0 && s%16 > 8 && s > 16) {
 22323  			break
 22324  		}
 22325  		v.reset(OpZero)
 22326  		v.AuxInt = int64ToAuxInt(16)
 22327  		v0 := b.NewValue0(v.Pos, OpOffPtr, ptr.Type)
 22328  		v0.AuxInt = int64ToAuxInt(s - 16)
 22329  		v0.AddArg(ptr)
 22330  		v1 := b.NewValue0(v.Pos, OpZero, types.TypeMem)
 22331  		v1.AuxInt = int64ToAuxInt(s - s%16)
 22332  		v1.AddArg2(ptr, mem)
 22333  		v.AddArg2(v0, v1)
 22334  		return true
 22335  	}
 22336  	// match: (Zero [s] ptr mem)
 22337  	// cond: s%16 == 0 && s > 64 && s <= 16*64
 22338  	// result: (DUFFZERO [4 * (64 - s/16)] ptr mem)
 22339  	for {
 22340  		s := auxIntToInt64(v.AuxInt)
 22341  		ptr := v_0
 22342  		mem := v_1
 22343  		if !(s%16 == 0 && s > 64 && s <= 16*64) {
 22344  			break
 22345  		}
 22346  		v.reset(OpARM64DUFFZERO)
 22347  		v.AuxInt = int64ToAuxInt(4 * (64 - s/16))
 22348  		v.AddArg2(ptr, mem)
 22349  		return true
 22350  	}
 22351  	// match: (Zero [s] ptr mem)
 22352  	// cond: s%16 == 0 && s > 16*64
 22353  	// result: (LoweredZero ptr (ADDconst <ptr.Type> [s-16] ptr) mem)
 22354  	for {
 22355  		s := auxIntToInt64(v.AuxInt)
 22356  		ptr := v_0
 22357  		mem := v_1
 22358  		if !(s%16 == 0 && s > 16*64) {
 22359  			break
 22360  		}
 22361  		v.reset(OpARM64LoweredZero)
 22362  		v0 := b.NewValue0(v.Pos, OpARM64ADDconst, ptr.Type)
 22363  		v0.AuxInt = int64ToAuxInt(s - 16)
 22364  		v0.AddArg(ptr)
 22365  		v.AddArg3(ptr, v0, mem)
 22366  		return true
 22367  	}
 22368  	return false
 22369  }
 22370  func rewriteBlockARM64(b *Block) bool {
 22371  	typ := &b.Func.Config.Types
 22372  	switch b.Kind {
 22373  	case BlockARM64EQ:
 22374  		// match: (EQ (CMPconst [0] z:(AND x y)) yes no)
 22375  		// cond: z.Uses == 1
 22376  		// result: (EQ (TST x y) yes no)
 22377  		for b.Controls[0].Op == OpARM64CMPconst {
 22378  			v_0 := b.Controls[0]
 22379  			if auxIntToInt64(v_0.AuxInt) != 0 {
 22380  				break
 22381  			}
 22382  			z := v_0.Args[0]
 22383  			if z.Op != OpARM64AND {
 22384  				break
 22385  			}
 22386  			_ = z.Args[1]
 22387  			z_0 := z.Args[0]
 22388  			z_1 := z.Args[1]
 22389  			for _i0 := 0; _i0 <= 1; _i0, z_0, z_1 = _i0+1, z_1, z_0 {
 22390  				x := z_0
 22391  				y := z_1
 22392  				if !(z.Uses == 1) {
 22393  					continue
 22394  				}
 22395  				v0 := b.NewValue0(v_0.Pos, OpARM64TST, types.TypeFlags)
 22396  				v0.AddArg2(x, y)
 22397  				b.resetWithControl(BlockARM64EQ, v0)
 22398  				return true
 22399  			}
 22400  			break
 22401  		}
 22402  		// match: (EQ (CMPconst [0] x:(ANDconst [c] y)) yes no)
 22403  		// cond: x.Uses == 1
 22404  		// result: (EQ (TSTconst [c] y) yes no)
 22405  		for b.Controls[0].Op == OpARM64CMPconst {
 22406  			v_0 := b.Controls[0]
 22407  			if auxIntToInt64(v_0.AuxInt) != 0 {
 22408  				break
 22409  			}
 22410  			x := v_0.Args[0]
 22411  			if x.Op != OpARM64ANDconst {
 22412  				break
 22413  			}
 22414  			c := auxIntToInt64(x.AuxInt)
 22415  			y := x.Args[0]
 22416  			if !(x.Uses == 1) {
 22417  				break
 22418  			}
 22419  			v0 := b.NewValue0(v_0.Pos, OpARM64TSTconst, types.TypeFlags)
 22420  			v0.AuxInt = int64ToAuxInt(c)
 22421  			v0.AddArg(y)
 22422  			b.resetWithControl(BlockARM64EQ, v0)
 22423  			return true
 22424  		}
 22425  		// match: (EQ (CMPWconst [0] z:(AND x y)) yes no)
 22426  		// cond: z.Uses == 1
 22427  		// result: (EQ (TSTW x y) yes no)
 22428  		for b.Controls[0].Op == OpARM64CMPWconst {
 22429  			v_0 := b.Controls[0]
 22430  			if auxIntToInt32(v_0.AuxInt) != 0 {
 22431  				break
 22432  			}
 22433  			z := v_0.Args[0]
 22434  			if z.Op != OpARM64AND {
 22435  				break
 22436  			}
 22437  			_ = z.Args[1]
 22438  			z_0 := z.Args[0]
 22439  			z_1 := z.Args[1]
 22440  			for _i0 := 0; _i0 <= 1; _i0, z_0, z_1 = _i0+1, z_1, z_0 {
 22441  				x := z_0
 22442  				y := z_1
 22443  				if !(z.Uses == 1) {
 22444  					continue
 22445  				}
 22446  				v0 := b.NewValue0(v_0.Pos, OpARM64TSTW, types.TypeFlags)
 22447  				v0.AddArg2(x, y)
 22448  				b.resetWithControl(BlockARM64EQ, v0)
 22449  				return true
 22450  			}
 22451  			break
 22452  		}
 22453  		// match: (EQ (CMPWconst [0] x:(ANDconst [c] y)) yes no)
 22454  		// cond: x.Uses == 1
 22455  		// result: (EQ (TSTWconst [int32(c)] y) yes no)
 22456  		for b.Controls[0].Op == OpARM64CMPWconst {
 22457  			v_0 := b.Controls[0]
 22458  			if auxIntToInt32(v_0.AuxInt) != 0 {
 22459  				break
 22460  			}
 22461  			x := v_0.Args[0]
 22462  			if x.Op != OpARM64ANDconst {
 22463  				break
 22464  			}
 22465  			c := auxIntToInt64(x.AuxInt)
 22466  			y := x.Args[0]
 22467  			if !(x.Uses == 1) {
 22468  				break
 22469  			}
 22470  			v0 := b.NewValue0(v_0.Pos, OpARM64TSTWconst, types.TypeFlags)
 22471  			v0.AuxInt = int32ToAuxInt(int32(c))
 22472  			v0.AddArg(y)
 22473  			b.resetWithControl(BlockARM64EQ, v0)
 22474  			return true
 22475  		}
 22476  		// match: (EQ (CMPconst [0] x:(ADDconst [c] y)) yes no)
 22477  		// cond: x.Uses == 1
 22478  		// result: (EQ (CMNconst [c] y) yes no)
 22479  		for b.Controls[0].Op == OpARM64CMPconst {
 22480  			v_0 := b.Controls[0]
 22481  			if auxIntToInt64(v_0.AuxInt) != 0 {
 22482  				break
 22483  			}
 22484  			x := v_0.Args[0]
 22485  			if x.Op != OpARM64ADDconst {
 22486  				break
 22487  			}
 22488  			c := auxIntToInt64(x.AuxInt)
 22489  			y := x.Args[0]
 22490  			if !(x.Uses == 1) {
 22491  				break
 22492  			}
 22493  			v0 := b.NewValue0(v_0.Pos, OpARM64CMNconst, types.TypeFlags)
 22494  			v0.AuxInt = int64ToAuxInt(c)
 22495  			v0.AddArg(y)
 22496  			b.resetWithControl(BlockARM64EQ, v0)
 22497  			return true
 22498  		}
 22499  		// match: (EQ (CMPWconst [0] x:(ADDconst [c] y)) yes no)
 22500  		// cond: x.Uses == 1
 22501  		// result: (EQ (CMNWconst [int32(c)] y) yes no)
 22502  		for b.Controls[0].Op == OpARM64CMPWconst {
 22503  			v_0 := b.Controls[0]
 22504  			if auxIntToInt32(v_0.AuxInt) != 0 {
 22505  				break
 22506  			}
 22507  			x := v_0.Args[0]
 22508  			if x.Op != OpARM64ADDconst {
 22509  				break
 22510  			}
 22511  			c := auxIntToInt64(x.AuxInt)
 22512  			y := x.Args[0]
 22513  			if !(x.Uses == 1) {
 22514  				break
 22515  			}
 22516  			v0 := b.NewValue0(v_0.Pos, OpARM64CMNWconst, types.TypeFlags)
 22517  			v0.AuxInt = int32ToAuxInt(int32(c))
 22518  			v0.AddArg(y)
 22519  			b.resetWithControl(BlockARM64EQ, v0)
 22520  			return true
 22521  		}
 22522  		// match: (EQ (CMPconst [0] z:(ADD x y)) yes no)
 22523  		// cond: z.Uses == 1
 22524  		// result: (EQ (CMN x y) yes no)
 22525  		for b.Controls[0].Op == OpARM64CMPconst {
 22526  			v_0 := b.Controls[0]
 22527  			if auxIntToInt64(v_0.AuxInt) != 0 {
 22528  				break
 22529  			}
 22530  			z := v_0.Args[0]
 22531  			if z.Op != OpARM64ADD {
 22532  				break
 22533  			}
 22534  			_ = z.Args[1]
 22535  			z_0 := z.Args[0]
 22536  			z_1 := z.Args[1]
 22537  			for _i0 := 0; _i0 <= 1; _i0, z_0, z_1 = _i0+1, z_1, z_0 {
 22538  				x := z_0
 22539  				y := z_1
 22540  				if !(z.Uses == 1) {
 22541  					continue
 22542  				}
 22543  				v0 := b.NewValue0(v_0.Pos, OpARM64CMN, types.TypeFlags)
 22544  				v0.AddArg2(x, y)
 22545  				b.resetWithControl(BlockARM64EQ, v0)
 22546  				return true
 22547  			}
 22548  			break
 22549  		}
 22550  		// match: (EQ (CMPWconst [0] z:(ADD x y)) yes no)
 22551  		// cond: z.Uses == 1
 22552  		// result: (EQ (CMNW x y) yes no)
 22553  		for b.Controls[0].Op == OpARM64CMPWconst {
 22554  			v_0 := b.Controls[0]
 22555  			if auxIntToInt32(v_0.AuxInt) != 0 {
 22556  				break
 22557  			}
 22558  			z := v_0.Args[0]
 22559  			if z.Op != OpARM64ADD {
 22560  				break
 22561  			}
 22562  			_ = z.Args[1]
 22563  			z_0 := z.Args[0]
 22564  			z_1 := z.Args[1]
 22565  			for _i0 := 0; _i0 <= 1; _i0, z_0, z_1 = _i0+1, z_1, z_0 {
 22566  				x := z_0
 22567  				y := z_1
 22568  				if !(z.Uses == 1) {
 22569  					continue
 22570  				}
 22571  				v0 := b.NewValue0(v_0.Pos, OpARM64CMNW, types.TypeFlags)
 22572  				v0.AddArg2(x, y)
 22573  				b.resetWithControl(BlockARM64EQ, v0)
 22574  				return true
 22575  			}
 22576  			break
 22577  		}
 22578  		// match: (EQ (CMP x z:(NEG y)) yes no)
 22579  		// cond: z.Uses == 1
 22580  		// result: (EQ (CMN x y) yes no)
 22581  		for b.Controls[0].Op == OpARM64CMP {
 22582  			v_0 := b.Controls[0]
 22583  			_ = v_0.Args[1]
 22584  			x := v_0.Args[0]
 22585  			z := v_0.Args[1]
 22586  			if z.Op != OpARM64NEG {
 22587  				break
 22588  			}
 22589  			y := z.Args[0]
 22590  			if !(z.Uses == 1) {
 22591  				break
 22592  			}
 22593  			v0 := b.NewValue0(v_0.Pos, OpARM64CMN, types.TypeFlags)
 22594  			v0.AddArg2(x, y)
 22595  			b.resetWithControl(BlockARM64EQ, v0)
 22596  			return true
 22597  		}
 22598  		// match: (EQ (CMPW x z:(NEG y)) yes no)
 22599  		// cond: z.Uses == 1
 22600  		// result: (EQ (CMNW x y) yes no)
 22601  		for b.Controls[0].Op == OpARM64CMPW {
 22602  			v_0 := b.Controls[0]
 22603  			_ = v_0.Args[1]
 22604  			x := v_0.Args[0]
 22605  			z := v_0.Args[1]
 22606  			if z.Op != OpARM64NEG {
 22607  				break
 22608  			}
 22609  			y := z.Args[0]
 22610  			if !(z.Uses == 1) {
 22611  				break
 22612  			}
 22613  			v0 := b.NewValue0(v_0.Pos, OpARM64CMNW, types.TypeFlags)
 22614  			v0.AddArg2(x, y)
 22615  			b.resetWithControl(BlockARM64EQ, v0)
 22616  			return true
 22617  		}
 22618  		// match: (EQ (CMPconst [0] x) yes no)
 22619  		// result: (Z x yes no)
 22620  		for b.Controls[0].Op == OpARM64CMPconst {
 22621  			v_0 := b.Controls[0]
 22622  			if auxIntToInt64(v_0.AuxInt) != 0 {
 22623  				break
 22624  			}
 22625  			x := v_0.Args[0]
 22626  			b.resetWithControl(BlockARM64Z, x)
 22627  			return true
 22628  		}
 22629  		// match: (EQ (CMPWconst [0] x) yes no)
 22630  		// result: (ZW x yes no)
 22631  		for b.Controls[0].Op == OpARM64CMPWconst {
 22632  			v_0 := b.Controls[0]
 22633  			if auxIntToInt32(v_0.AuxInt) != 0 {
 22634  				break
 22635  			}
 22636  			x := v_0.Args[0]
 22637  			b.resetWithControl(BlockARM64ZW, x)
 22638  			return true
 22639  		}
 22640  		// match: (EQ (CMPconst [0] z:(MADD a x y)) yes no)
 22641  		// cond: z.Uses==1
 22642  		// result: (EQ (CMN a (MUL <x.Type> x y)) yes no)
 22643  		for b.Controls[0].Op == OpARM64CMPconst {
 22644  			v_0 := b.Controls[0]
 22645  			if auxIntToInt64(v_0.AuxInt) != 0 {
 22646  				break
 22647  			}
 22648  			z := v_0.Args[0]
 22649  			if z.Op != OpARM64MADD {
 22650  				break
 22651  			}
 22652  			y := z.Args[2]
 22653  			a := z.Args[0]
 22654  			x := z.Args[1]
 22655  			if !(z.Uses == 1) {
 22656  				break
 22657  			}
 22658  			v0 := b.NewValue0(v_0.Pos, OpARM64CMN, types.TypeFlags)
 22659  			v1 := b.NewValue0(v_0.Pos, OpARM64MUL, x.Type)
 22660  			v1.AddArg2(x, y)
 22661  			v0.AddArg2(a, v1)
 22662  			b.resetWithControl(BlockARM64EQ, v0)
 22663  			return true
 22664  		}
 22665  		// match: (EQ (CMPconst [0] z:(MSUB a x y)) yes no)
 22666  		// cond: z.Uses==1
 22667  		// result: (EQ (CMP a (MUL <x.Type> x y)) yes no)
 22668  		for b.Controls[0].Op == OpARM64CMPconst {
 22669  			v_0 := b.Controls[0]
 22670  			if auxIntToInt64(v_0.AuxInt) != 0 {
 22671  				break
 22672  			}
 22673  			z := v_0.Args[0]
 22674  			if z.Op != OpARM64MSUB {
 22675  				break
 22676  			}
 22677  			y := z.Args[2]
 22678  			a := z.Args[0]
 22679  			x := z.Args[1]
 22680  			if !(z.Uses == 1) {
 22681  				break
 22682  			}
 22683  			v0 := b.NewValue0(v_0.Pos, OpARM64CMP, types.TypeFlags)
 22684  			v1 := b.NewValue0(v_0.Pos, OpARM64MUL, x.Type)
 22685  			v1.AddArg2(x, y)
 22686  			v0.AddArg2(a, v1)
 22687  			b.resetWithControl(BlockARM64EQ, v0)
 22688  			return true
 22689  		}
 22690  		// match: (EQ (CMPWconst [0] z:(MADDW a x y)) yes no)
 22691  		// cond: z.Uses==1
 22692  		// result: (EQ (CMNW a (MULW <x.Type> x y)) yes no)
 22693  		for b.Controls[0].Op == OpARM64CMPWconst {
 22694  			v_0 := b.Controls[0]
 22695  			if auxIntToInt32(v_0.AuxInt) != 0 {
 22696  				break
 22697  			}
 22698  			z := v_0.Args[0]
 22699  			if z.Op != OpARM64MADDW {
 22700  				break
 22701  			}
 22702  			y := z.Args[2]
 22703  			a := z.Args[0]
 22704  			x := z.Args[1]
 22705  			if !(z.Uses == 1) {
 22706  				break
 22707  			}
 22708  			v0 := b.NewValue0(v_0.Pos, OpARM64CMNW, types.TypeFlags)
 22709  			v1 := b.NewValue0(v_0.Pos, OpARM64MULW, x.Type)
 22710  			v1.AddArg2(x, y)
 22711  			v0.AddArg2(a, v1)
 22712  			b.resetWithControl(BlockARM64EQ, v0)
 22713  			return true
 22714  		}
 22715  		// match: (EQ (CMPWconst [0] z:(MSUBW a x y)) yes no)
 22716  		// cond: z.Uses==1
 22717  		// result: (EQ (CMPW a (MULW <x.Type> x y)) yes no)
 22718  		for b.Controls[0].Op == OpARM64CMPWconst {
 22719  			v_0 := b.Controls[0]
 22720  			if auxIntToInt32(v_0.AuxInt) != 0 {
 22721  				break
 22722  			}
 22723  			z := v_0.Args[0]
 22724  			if z.Op != OpARM64MSUBW {
 22725  				break
 22726  			}
 22727  			y := z.Args[2]
 22728  			a := z.Args[0]
 22729  			x := z.Args[1]
 22730  			if !(z.Uses == 1) {
 22731  				break
 22732  			}
 22733  			v0 := b.NewValue0(v_0.Pos, OpARM64CMPW, types.TypeFlags)
 22734  			v1 := b.NewValue0(v_0.Pos, OpARM64MULW, x.Type)
 22735  			v1.AddArg2(x, y)
 22736  			v0.AddArg2(a, v1)
 22737  			b.resetWithControl(BlockARM64EQ, v0)
 22738  			return true
 22739  		}
 22740  		// match: (EQ (TSTconst [c] x) yes no)
 22741  		// cond: oneBit(c)
 22742  		// result: (TBZ [int64(ntz64(c))] x yes no)
 22743  		for b.Controls[0].Op == OpARM64TSTconst {
 22744  			v_0 := b.Controls[0]
 22745  			c := auxIntToInt64(v_0.AuxInt)
 22746  			x := v_0.Args[0]
 22747  			if !(oneBit(c)) {
 22748  				break
 22749  			}
 22750  			b.resetWithControl(BlockARM64TBZ, x)
 22751  			b.AuxInt = int64ToAuxInt(int64(ntz64(c)))
 22752  			return true
 22753  		}
 22754  		// match: (EQ (TSTWconst [c] x) yes no)
 22755  		// cond: oneBit(int64(uint32(c)))
 22756  		// result: (TBZ [int64(ntz64(int64(uint32(c))))] x yes no)
 22757  		for b.Controls[0].Op == OpARM64TSTWconst {
 22758  			v_0 := b.Controls[0]
 22759  			c := auxIntToInt32(v_0.AuxInt)
 22760  			x := v_0.Args[0]
 22761  			if !(oneBit(int64(uint32(c)))) {
 22762  				break
 22763  			}
 22764  			b.resetWithControl(BlockARM64TBZ, x)
 22765  			b.AuxInt = int64ToAuxInt(int64(ntz64(int64(uint32(c)))))
 22766  			return true
 22767  		}
 22768  		// match: (EQ (FlagConstant [fc]) yes no)
 22769  		// cond: fc.eq()
 22770  		// result: (First yes no)
 22771  		for b.Controls[0].Op == OpARM64FlagConstant {
 22772  			v_0 := b.Controls[0]
 22773  			fc := auxIntToFlagConstant(v_0.AuxInt)
 22774  			if !(fc.eq()) {
 22775  				break
 22776  			}
 22777  			b.Reset(BlockFirst)
 22778  			return true
 22779  		}
 22780  		// match: (EQ (FlagConstant [fc]) yes no)
 22781  		// cond: !fc.eq()
 22782  		// result: (First no yes)
 22783  		for b.Controls[0].Op == OpARM64FlagConstant {
 22784  			v_0 := b.Controls[0]
 22785  			fc := auxIntToFlagConstant(v_0.AuxInt)
 22786  			if !(!fc.eq()) {
 22787  				break
 22788  			}
 22789  			b.Reset(BlockFirst)
 22790  			b.swapSuccessors()
 22791  			return true
 22792  		}
 22793  		// match: (EQ (InvertFlags cmp) yes no)
 22794  		// result: (EQ cmp yes no)
 22795  		for b.Controls[0].Op == OpARM64InvertFlags {
 22796  			v_0 := b.Controls[0]
 22797  			cmp := v_0.Args[0]
 22798  			b.resetWithControl(BlockARM64EQ, cmp)
 22799  			return true
 22800  		}
 22801  	case BlockARM64FGE:
 22802  		// match: (FGE (InvertFlags cmp) yes no)
 22803  		// result: (FLE cmp yes no)
 22804  		for b.Controls[0].Op == OpARM64InvertFlags {
 22805  			v_0 := b.Controls[0]
 22806  			cmp := v_0.Args[0]
 22807  			b.resetWithControl(BlockARM64FLE, cmp)
 22808  			return true
 22809  		}
 22810  	case BlockARM64FGT:
 22811  		// match: (FGT (InvertFlags cmp) yes no)
 22812  		// result: (FLT cmp yes no)
 22813  		for b.Controls[0].Op == OpARM64InvertFlags {
 22814  			v_0 := b.Controls[0]
 22815  			cmp := v_0.Args[0]
 22816  			b.resetWithControl(BlockARM64FLT, cmp)
 22817  			return true
 22818  		}
 22819  	case BlockARM64FLE:
 22820  		// match: (FLE (InvertFlags cmp) yes no)
 22821  		// result: (FGE cmp yes no)
 22822  		for b.Controls[0].Op == OpARM64InvertFlags {
 22823  			v_0 := b.Controls[0]
 22824  			cmp := v_0.Args[0]
 22825  			b.resetWithControl(BlockARM64FGE, cmp)
 22826  			return true
 22827  		}
 22828  	case BlockARM64FLT:
 22829  		// match: (FLT (InvertFlags cmp) yes no)
 22830  		// result: (FGT cmp yes no)
 22831  		for b.Controls[0].Op == OpARM64InvertFlags {
 22832  			v_0 := b.Controls[0]
 22833  			cmp := v_0.Args[0]
 22834  			b.resetWithControl(BlockARM64FGT, cmp)
 22835  			return true
 22836  		}
 22837  	case BlockARM64GE:
 22838  		// match: (GE (CMPconst [0] z:(AND x y)) yes no)
 22839  		// cond: z.Uses == 1
 22840  		// result: (GE (TST x y) yes no)
 22841  		for b.Controls[0].Op == OpARM64CMPconst {
 22842  			v_0 := b.Controls[0]
 22843  			if auxIntToInt64(v_0.AuxInt) != 0 {
 22844  				break
 22845  			}
 22846  			z := v_0.Args[0]
 22847  			if z.Op != OpARM64AND {
 22848  				break
 22849  			}
 22850  			_ = z.Args[1]
 22851  			z_0 := z.Args[0]
 22852  			z_1 := z.Args[1]
 22853  			for _i0 := 0; _i0 <= 1; _i0, z_0, z_1 = _i0+1, z_1, z_0 {
 22854  				x := z_0
 22855  				y := z_1
 22856  				if !(z.Uses == 1) {
 22857  					continue
 22858  				}
 22859  				v0 := b.NewValue0(v_0.Pos, OpARM64TST, types.TypeFlags)
 22860  				v0.AddArg2(x, y)
 22861  				b.resetWithControl(BlockARM64GE, v0)
 22862  				return true
 22863  			}
 22864  			break
 22865  		}
 22866  		// match: (GE (CMPconst [0] x:(ANDconst [c] y)) yes no)
 22867  		// cond: x.Uses == 1
 22868  		// result: (GE (TSTconst [c] y) yes no)
 22869  		for b.Controls[0].Op == OpARM64CMPconst {
 22870  			v_0 := b.Controls[0]
 22871  			if auxIntToInt64(v_0.AuxInt) != 0 {
 22872  				break
 22873  			}
 22874  			x := v_0.Args[0]
 22875  			if x.Op != OpARM64ANDconst {
 22876  				break
 22877  			}
 22878  			c := auxIntToInt64(x.AuxInt)
 22879  			y := x.Args[0]
 22880  			if !(x.Uses == 1) {
 22881  				break
 22882  			}
 22883  			v0 := b.NewValue0(v_0.Pos, OpARM64TSTconst, types.TypeFlags)
 22884  			v0.AuxInt = int64ToAuxInt(c)
 22885  			v0.AddArg(y)
 22886  			b.resetWithControl(BlockARM64GE, v0)
 22887  			return true
 22888  		}
 22889  		// match: (GE (CMPWconst [0] z:(AND x y)) yes no)
 22890  		// cond: z.Uses == 1
 22891  		// result: (GE (TSTW x y) yes no)
 22892  		for b.Controls[0].Op == OpARM64CMPWconst {
 22893  			v_0 := b.Controls[0]
 22894  			if auxIntToInt32(v_0.AuxInt) != 0 {
 22895  				break
 22896  			}
 22897  			z := v_0.Args[0]
 22898  			if z.Op != OpARM64AND {
 22899  				break
 22900  			}
 22901  			_ = z.Args[1]
 22902  			z_0 := z.Args[0]
 22903  			z_1 := z.Args[1]
 22904  			for _i0 := 0; _i0 <= 1; _i0, z_0, z_1 = _i0+1, z_1, z_0 {
 22905  				x := z_0
 22906  				y := z_1
 22907  				if !(z.Uses == 1) {
 22908  					continue
 22909  				}
 22910  				v0 := b.NewValue0(v_0.Pos, OpARM64TSTW, types.TypeFlags)
 22911  				v0.AddArg2(x, y)
 22912  				b.resetWithControl(BlockARM64GE, v0)
 22913  				return true
 22914  			}
 22915  			break
 22916  		}
 22917  		// match: (GE (CMPWconst [0] x:(ANDconst [c] y)) yes no)
 22918  		// cond: x.Uses == 1
 22919  		// result: (GE (TSTWconst [int32(c)] y) yes no)
 22920  		for b.Controls[0].Op == OpARM64CMPWconst {
 22921  			v_0 := b.Controls[0]
 22922  			if auxIntToInt32(v_0.AuxInt) != 0 {
 22923  				break
 22924  			}
 22925  			x := v_0.Args[0]
 22926  			if x.Op != OpARM64ANDconst {
 22927  				break
 22928  			}
 22929  			c := auxIntToInt64(x.AuxInt)
 22930  			y := x.Args[0]
 22931  			if !(x.Uses == 1) {
 22932  				break
 22933  			}
 22934  			v0 := b.NewValue0(v_0.Pos, OpARM64TSTWconst, types.TypeFlags)
 22935  			v0.AuxInt = int32ToAuxInt(int32(c))
 22936  			v0.AddArg(y)
 22937  			b.resetWithControl(BlockARM64GE, v0)
 22938  			return true
 22939  		}
 22940  		// match: (GE (CMPconst [0] x:(ADDconst [c] y)) yes no)
 22941  		// cond: x.Uses == 1
 22942  		// result: (GEnoov (CMNconst [c] y) yes no)
 22943  		for b.Controls[0].Op == OpARM64CMPconst {
 22944  			v_0 := b.Controls[0]
 22945  			if auxIntToInt64(v_0.AuxInt) != 0 {
 22946  				break
 22947  			}
 22948  			x := v_0.Args[0]
 22949  			if x.Op != OpARM64ADDconst {
 22950  				break
 22951  			}
 22952  			c := auxIntToInt64(x.AuxInt)
 22953  			y := x.Args[0]
 22954  			if !(x.Uses == 1) {
 22955  				break
 22956  			}
 22957  			v0 := b.NewValue0(v_0.Pos, OpARM64CMNconst, types.TypeFlags)
 22958  			v0.AuxInt = int64ToAuxInt(c)
 22959  			v0.AddArg(y)
 22960  			b.resetWithControl(BlockARM64GEnoov, v0)
 22961  			return true
 22962  		}
 22963  		// match: (GE (CMPWconst [0] x:(ADDconst [c] y)) yes no)
 22964  		// cond: x.Uses == 1
 22965  		// result: (GEnoov (CMNWconst [int32(c)] y) yes no)
 22966  		for b.Controls[0].Op == OpARM64CMPWconst {
 22967  			v_0 := b.Controls[0]
 22968  			if auxIntToInt32(v_0.AuxInt) != 0 {
 22969  				break
 22970  			}
 22971  			x := v_0.Args[0]
 22972  			if x.Op != OpARM64ADDconst {
 22973  				break
 22974  			}
 22975  			c := auxIntToInt64(x.AuxInt)
 22976  			y := x.Args[0]
 22977  			if !(x.Uses == 1) {
 22978  				break
 22979  			}
 22980  			v0 := b.NewValue0(v_0.Pos, OpARM64CMNWconst, types.TypeFlags)
 22981  			v0.AuxInt = int32ToAuxInt(int32(c))
 22982  			v0.AddArg(y)
 22983  			b.resetWithControl(BlockARM64GEnoov, v0)
 22984  			return true
 22985  		}
 22986  		// match: (GE (CMPconst [0] z:(ADD x y)) yes no)
 22987  		// cond: z.Uses == 1
 22988  		// result: (GEnoov (CMN x y) yes no)
 22989  		for b.Controls[0].Op == OpARM64CMPconst {
 22990  			v_0 := b.Controls[0]
 22991  			if auxIntToInt64(v_0.AuxInt) != 0 {
 22992  				break
 22993  			}
 22994  			z := v_0.Args[0]
 22995  			if z.Op != OpARM64ADD {
 22996  				break
 22997  			}
 22998  			_ = z.Args[1]
 22999  			z_0 := z.Args[0]
 23000  			z_1 := z.Args[1]
 23001  			for _i0 := 0; _i0 <= 1; _i0, z_0, z_1 = _i0+1, z_1, z_0 {
 23002  				x := z_0
 23003  				y := z_1
 23004  				if !(z.Uses == 1) {
 23005  					continue
 23006  				}
 23007  				v0 := b.NewValue0(v_0.Pos, OpARM64CMN, types.TypeFlags)
 23008  				v0.AddArg2(x, y)
 23009  				b.resetWithControl(BlockARM64GEnoov, v0)
 23010  				return true
 23011  			}
 23012  			break
 23013  		}
 23014  		// match: (GE (CMPWconst [0] z:(ADD x y)) yes no)
 23015  		// cond: z.Uses == 1
 23016  		// result: (GEnoov (CMNW x y) yes no)
 23017  		for b.Controls[0].Op == OpARM64CMPWconst {
 23018  			v_0 := b.Controls[0]
 23019  			if auxIntToInt32(v_0.AuxInt) != 0 {
 23020  				break
 23021  			}
 23022  			z := v_0.Args[0]
 23023  			if z.Op != OpARM64ADD {
 23024  				break
 23025  			}
 23026  			_ = z.Args[1]
 23027  			z_0 := z.Args[0]
 23028  			z_1 := z.Args[1]
 23029  			for _i0 := 0; _i0 <= 1; _i0, z_0, z_1 = _i0+1, z_1, z_0 {
 23030  				x := z_0
 23031  				y := z_1
 23032  				if !(z.Uses == 1) {
 23033  					continue
 23034  				}
 23035  				v0 := b.NewValue0(v_0.Pos, OpARM64CMNW, types.TypeFlags)
 23036  				v0.AddArg2(x, y)
 23037  				b.resetWithControl(BlockARM64GEnoov, v0)
 23038  				return true
 23039  			}
 23040  			break
 23041  		}
 23042  		// match: (GE (CMPconst [0] z:(MADD a x y)) yes no)
 23043  		// cond: z.Uses==1
 23044  		// result: (GEnoov (CMN a (MUL <x.Type> x y)) yes no)
 23045  		for b.Controls[0].Op == OpARM64CMPconst {
 23046  			v_0 := b.Controls[0]
 23047  			if auxIntToInt64(v_0.AuxInt) != 0 {
 23048  				break
 23049  			}
 23050  			z := v_0.Args[0]
 23051  			if z.Op != OpARM64MADD {
 23052  				break
 23053  			}
 23054  			y := z.Args[2]
 23055  			a := z.Args[0]
 23056  			x := z.Args[1]
 23057  			if !(z.Uses == 1) {
 23058  				break
 23059  			}
 23060  			v0 := b.NewValue0(v_0.Pos, OpARM64CMN, types.TypeFlags)
 23061  			v1 := b.NewValue0(v_0.Pos, OpARM64MUL, x.Type)
 23062  			v1.AddArg2(x, y)
 23063  			v0.AddArg2(a, v1)
 23064  			b.resetWithControl(BlockARM64GEnoov, v0)
 23065  			return true
 23066  		}
 23067  		// match: (GE (CMPconst [0] z:(MSUB a x y)) yes no)
 23068  		// cond: z.Uses==1
 23069  		// result: (GEnoov (CMP a (MUL <x.Type> x y)) yes no)
 23070  		for b.Controls[0].Op == OpARM64CMPconst {
 23071  			v_0 := b.Controls[0]
 23072  			if auxIntToInt64(v_0.AuxInt) != 0 {
 23073  				break
 23074  			}
 23075  			z := v_0.Args[0]
 23076  			if z.Op != OpARM64MSUB {
 23077  				break
 23078  			}
 23079  			y := z.Args[2]
 23080  			a := z.Args[0]
 23081  			x := z.Args[1]
 23082  			if !(z.Uses == 1) {
 23083  				break
 23084  			}
 23085  			v0 := b.NewValue0(v_0.Pos, OpARM64CMP, types.TypeFlags)
 23086  			v1 := b.NewValue0(v_0.Pos, OpARM64MUL, x.Type)
 23087  			v1.AddArg2(x, y)
 23088  			v0.AddArg2(a, v1)
 23089  			b.resetWithControl(BlockARM64GEnoov, v0)
 23090  			return true
 23091  		}
 23092  		// match: (GE (CMPWconst [0] z:(MADDW a x y)) yes no)
 23093  		// cond: z.Uses==1
 23094  		// result: (GEnoov (CMNW a (MULW <x.Type> x y)) yes no)
 23095  		for b.Controls[0].Op == OpARM64CMPWconst {
 23096  			v_0 := b.Controls[0]
 23097  			if auxIntToInt32(v_0.AuxInt) != 0 {
 23098  				break
 23099  			}
 23100  			z := v_0.Args[0]
 23101  			if z.Op != OpARM64MADDW {
 23102  				break
 23103  			}
 23104  			y := z.Args[2]
 23105  			a := z.Args[0]
 23106  			x := z.Args[1]
 23107  			if !(z.Uses == 1) {
 23108  				break
 23109  			}
 23110  			v0 := b.NewValue0(v_0.Pos, OpARM64CMNW, types.TypeFlags)
 23111  			v1 := b.NewValue0(v_0.Pos, OpARM64MULW, x.Type)
 23112  			v1.AddArg2(x, y)
 23113  			v0.AddArg2(a, v1)
 23114  			b.resetWithControl(BlockARM64GEnoov, v0)
 23115  			return true
 23116  		}
 23117  		// match: (GE (CMPWconst [0] z:(MSUBW a x y)) yes no)
 23118  		// cond: z.Uses==1
 23119  		// result: (GEnoov (CMPW a (MULW <x.Type> x y)) yes no)
 23120  		for b.Controls[0].Op == OpARM64CMPWconst {
 23121  			v_0 := b.Controls[0]
 23122  			if auxIntToInt32(v_0.AuxInt) != 0 {
 23123  				break
 23124  			}
 23125  			z := v_0.Args[0]
 23126  			if z.Op != OpARM64MSUBW {
 23127  				break
 23128  			}
 23129  			y := z.Args[2]
 23130  			a := z.Args[0]
 23131  			x := z.Args[1]
 23132  			if !(z.Uses == 1) {
 23133  				break
 23134  			}
 23135  			v0 := b.NewValue0(v_0.Pos, OpARM64CMPW, types.TypeFlags)
 23136  			v1 := b.NewValue0(v_0.Pos, OpARM64MULW, x.Type)
 23137  			v1.AddArg2(x, y)
 23138  			v0.AddArg2(a, v1)
 23139  			b.resetWithControl(BlockARM64GEnoov, v0)
 23140  			return true
 23141  		}
 23142  		// match: (GE (CMPWconst [0] x) yes no)
 23143  		// result: (TBZ [31] x yes no)
 23144  		for b.Controls[0].Op == OpARM64CMPWconst {
 23145  			v_0 := b.Controls[0]
 23146  			if auxIntToInt32(v_0.AuxInt) != 0 {
 23147  				break
 23148  			}
 23149  			x := v_0.Args[0]
 23150  			b.resetWithControl(BlockARM64TBZ, x)
 23151  			b.AuxInt = int64ToAuxInt(31)
 23152  			return true
 23153  		}
 23154  		// match: (GE (CMPconst [0] x) yes no)
 23155  		// result: (TBZ [63] x yes no)
 23156  		for b.Controls[0].Op == OpARM64CMPconst {
 23157  			v_0 := b.Controls[0]
 23158  			if auxIntToInt64(v_0.AuxInt) != 0 {
 23159  				break
 23160  			}
 23161  			x := v_0.Args[0]
 23162  			b.resetWithControl(BlockARM64TBZ, x)
 23163  			b.AuxInt = int64ToAuxInt(63)
 23164  			return true
 23165  		}
 23166  		// match: (GE (FlagConstant [fc]) yes no)
 23167  		// cond: fc.ge()
 23168  		// result: (First yes no)
 23169  		for b.Controls[0].Op == OpARM64FlagConstant {
 23170  			v_0 := b.Controls[0]
 23171  			fc := auxIntToFlagConstant(v_0.AuxInt)
 23172  			if !(fc.ge()) {
 23173  				break
 23174  			}
 23175  			b.Reset(BlockFirst)
 23176  			return true
 23177  		}
 23178  		// match: (GE (FlagConstant [fc]) yes no)
 23179  		// cond: !fc.ge()
 23180  		// result: (First no yes)
 23181  		for b.Controls[0].Op == OpARM64FlagConstant {
 23182  			v_0 := b.Controls[0]
 23183  			fc := auxIntToFlagConstant(v_0.AuxInt)
 23184  			if !(!fc.ge()) {
 23185  				break
 23186  			}
 23187  			b.Reset(BlockFirst)
 23188  			b.swapSuccessors()
 23189  			return true
 23190  		}
 23191  		// match: (GE (InvertFlags cmp) yes no)
 23192  		// result: (LE cmp yes no)
 23193  		for b.Controls[0].Op == OpARM64InvertFlags {
 23194  			v_0 := b.Controls[0]
 23195  			cmp := v_0.Args[0]
 23196  			b.resetWithControl(BlockARM64LE, cmp)
 23197  			return true
 23198  		}
 23199  	case BlockARM64GEnoov:
 23200  		// match: (GEnoov (FlagConstant [fc]) yes no)
 23201  		// cond: fc.geNoov()
 23202  		// result: (First yes no)
 23203  		for b.Controls[0].Op == OpARM64FlagConstant {
 23204  			v_0 := b.Controls[0]
 23205  			fc := auxIntToFlagConstant(v_0.AuxInt)
 23206  			if !(fc.geNoov()) {
 23207  				break
 23208  			}
 23209  			b.Reset(BlockFirst)
 23210  			return true
 23211  		}
 23212  		// match: (GEnoov (FlagConstant [fc]) yes no)
 23213  		// cond: !fc.geNoov()
 23214  		// result: (First no yes)
 23215  		for b.Controls[0].Op == OpARM64FlagConstant {
 23216  			v_0 := b.Controls[0]
 23217  			fc := auxIntToFlagConstant(v_0.AuxInt)
 23218  			if !(!fc.geNoov()) {
 23219  				break
 23220  			}
 23221  			b.Reset(BlockFirst)
 23222  			b.swapSuccessors()
 23223  			return true
 23224  		}
 23225  		// match: (GEnoov (InvertFlags cmp) yes no)
 23226  		// result: (LEnoov cmp yes no)
 23227  		for b.Controls[0].Op == OpARM64InvertFlags {
 23228  			v_0 := b.Controls[0]
 23229  			cmp := v_0.Args[0]
 23230  			b.resetWithControl(BlockARM64LEnoov, cmp)
 23231  			return true
 23232  		}
 23233  	case BlockARM64GT:
 23234  		// match: (GT (CMPconst [0] z:(AND x y)) yes no)
 23235  		// cond: z.Uses == 1
 23236  		// result: (GT (TST x y) yes no)
 23237  		for b.Controls[0].Op == OpARM64CMPconst {
 23238  			v_0 := b.Controls[0]
 23239  			if auxIntToInt64(v_0.AuxInt) != 0 {
 23240  				break
 23241  			}
 23242  			z := v_0.Args[0]
 23243  			if z.Op != OpARM64AND {
 23244  				break
 23245  			}
 23246  			_ = z.Args[1]
 23247  			z_0 := z.Args[0]
 23248  			z_1 := z.Args[1]
 23249  			for _i0 := 0; _i0 <= 1; _i0, z_0, z_1 = _i0+1, z_1, z_0 {
 23250  				x := z_0
 23251  				y := z_1
 23252  				if !(z.Uses == 1) {
 23253  					continue
 23254  				}
 23255  				v0 := b.NewValue0(v_0.Pos, OpARM64TST, types.TypeFlags)
 23256  				v0.AddArg2(x, y)
 23257  				b.resetWithControl(BlockARM64GT, v0)
 23258  				return true
 23259  			}
 23260  			break
 23261  		}
 23262  		// match: (GT (CMPconst [0] x:(ANDconst [c] y)) yes no)
 23263  		// cond: x.Uses == 1
 23264  		// result: (GT (TSTconst [c] y) yes no)
 23265  		for b.Controls[0].Op == OpARM64CMPconst {
 23266  			v_0 := b.Controls[0]
 23267  			if auxIntToInt64(v_0.AuxInt) != 0 {
 23268  				break
 23269  			}
 23270  			x := v_0.Args[0]
 23271  			if x.Op != OpARM64ANDconst {
 23272  				break
 23273  			}
 23274  			c := auxIntToInt64(x.AuxInt)
 23275  			y := x.Args[0]
 23276  			if !(x.Uses == 1) {
 23277  				break
 23278  			}
 23279  			v0 := b.NewValue0(v_0.Pos, OpARM64TSTconst, types.TypeFlags)
 23280  			v0.AuxInt = int64ToAuxInt(c)
 23281  			v0.AddArg(y)
 23282  			b.resetWithControl(BlockARM64GT, v0)
 23283  			return true
 23284  		}
 23285  		// match: (GT (CMPWconst [0] z:(AND x y)) yes no)
 23286  		// cond: z.Uses == 1
 23287  		// result: (GT (TSTW x y) yes no)
 23288  		for b.Controls[0].Op == OpARM64CMPWconst {
 23289  			v_0 := b.Controls[0]
 23290  			if auxIntToInt32(v_0.AuxInt) != 0 {
 23291  				break
 23292  			}
 23293  			z := v_0.Args[0]
 23294  			if z.Op != OpARM64AND {
 23295  				break
 23296  			}
 23297  			_ = z.Args[1]
 23298  			z_0 := z.Args[0]
 23299  			z_1 := z.Args[1]
 23300  			for _i0 := 0; _i0 <= 1; _i0, z_0, z_1 = _i0+1, z_1, z_0 {
 23301  				x := z_0
 23302  				y := z_1
 23303  				if !(z.Uses == 1) {
 23304  					continue
 23305  				}
 23306  				v0 := b.NewValue0(v_0.Pos, OpARM64TSTW, types.TypeFlags)
 23307  				v0.AddArg2(x, y)
 23308  				b.resetWithControl(BlockARM64GT, v0)
 23309  				return true
 23310  			}
 23311  			break
 23312  		}
 23313  		// match: (GT (CMPWconst [0] x:(ANDconst [c] y)) yes no)
 23314  		// cond: x.Uses == 1
 23315  		// result: (GT (TSTWconst [int32(c)] y) yes no)
 23316  		for b.Controls[0].Op == OpARM64CMPWconst {
 23317  			v_0 := b.Controls[0]
 23318  			if auxIntToInt32(v_0.AuxInt) != 0 {
 23319  				break
 23320  			}
 23321  			x := v_0.Args[0]
 23322  			if x.Op != OpARM64ANDconst {
 23323  				break
 23324  			}
 23325  			c := auxIntToInt64(x.AuxInt)
 23326  			y := x.Args[0]
 23327  			if !(x.Uses == 1) {
 23328  				break
 23329  			}
 23330  			v0 := b.NewValue0(v_0.Pos, OpARM64TSTWconst, types.TypeFlags)
 23331  			v0.AuxInt = int32ToAuxInt(int32(c))
 23332  			v0.AddArg(y)
 23333  			b.resetWithControl(BlockARM64GT, v0)
 23334  			return true
 23335  		}
 23336  		// match: (GT (CMPconst [0] x:(ADDconst [c] y)) yes no)
 23337  		// cond: x.Uses == 1
 23338  		// result: (GTnoov (CMNconst [c] y) yes no)
 23339  		for b.Controls[0].Op == OpARM64CMPconst {
 23340  			v_0 := b.Controls[0]
 23341  			if auxIntToInt64(v_0.AuxInt) != 0 {
 23342  				break
 23343  			}
 23344  			x := v_0.Args[0]
 23345  			if x.Op != OpARM64ADDconst {
 23346  				break
 23347  			}
 23348  			c := auxIntToInt64(x.AuxInt)
 23349  			y := x.Args[0]
 23350  			if !(x.Uses == 1) {
 23351  				break
 23352  			}
 23353  			v0 := b.NewValue0(v_0.Pos, OpARM64CMNconst, types.TypeFlags)
 23354  			v0.AuxInt = int64ToAuxInt(c)
 23355  			v0.AddArg(y)
 23356  			b.resetWithControl(BlockARM64GTnoov, v0)
 23357  			return true
 23358  		}
 23359  		// match: (GT (CMPWconst [0] x:(ADDconst [c] y)) yes no)
 23360  		// cond: x.Uses == 1
 23361  		// result: (GTnoov (CMNWconst [int32(c)] y) yes no)
 23362  		for b.Controls[0].Op == OpARM64CMPWconst {
 23363  			v_0 := b.Controls[0]
 23364  			if auxIntToInt32(v_0.AuxInt) != 0 {
 23365  				break
 23366  			}
 23367  			x := v_0.Args[0]
 23368  			if x.Op != OpARM64ADDconst {
 23369  				break
 23370  			}
 23371  			c := auxIntToInt64(x.AuxInt)
 23372  			y := x.Args[0]
 23373  			if !(x.Uses == 1) {
 23374  				break
 23375  			}
 23376  			v0 := b.NewValue0(v_0.Pos, OpARM64CMNWconst, types.TypeFlags)
 23377  			v0.AuxInt = int32ToAuxInt(int32(c))
 23378  			v0.AddArg(y)
 23379  			b.resetWithControl(BlockARM64GTnoov, v0)
 23380  			return true
 23381  		}
 23382  		// match: (GT (CMPconst [0] z:(ADD x y)) yes no)
 23383  		// cond: z.Uses == 1
 23384  		// result: (GTnoov (CMN x y) yes no)
 23385  		for b.Controls[0].Op == OpARM64CMPconst {
 23386  			v_0 := b.Controls[0]
 23387  			if auxIntToInt64(v_0.AuxInt) != 0 {
 23388  				break
 23389  			}
 23390  			z := v_0.Args[0]
 23391  			if z.Op != OpARM64ADD {
 23392  				break
 23393  			}
 23394  			_ = z.Args[1]
 23395  			z_0 := z.Args[0]
 23396  			z_1 := z.Args[1]
 23397  			for _i0 := 0; _i0 <= 1; _i0, z_0, z_1 = _i0+1, z_1, z_0 {
 23398  				x := z_0
 23399  				y := z_1
 23400  				if !(z.Uses == 1) {
 23401  					continue
 23402  				}
 23403  				v0 := b.NewValue0(v_0.Pos, OpARM64CMN, types.TypeFlags)
 23404  				v0.AddArg2(x, y)
 23405  				b.resetWithControl(BlockARM64GTnoov, v0)
 23406  				return true
 23407  			}
 23408  			break
 23409  		}
 23410  		// match: (GT (CMPWconst [0] z:(ADD x y)) yes no)
 23411  		// cond: z.Uses == 1
 23412  		// result: (GTnoov (CMNW x y) yes no)
 23413  		for b.Controls[0].Op == OpARM64CMPWconst {
 23414  			v_0 := b.Controls[0]
 23415  			if auxIntToInt32(v_0.AuxInt) != 0 {
 23416  				break
 23417  			}
 23418  			z := v_0.Args[0]
 23419  			if z.Op != OpARM64ADD {
 23420  				break
 23421  			}
 23422  			_ = z.Args[1]
 23423  			z_0 := z.Args[0]
 23424  			z_1 := z.Args[1]
 23425  			for _i0 := 0; _i0 <= 1; _i0, z_0, z_1 = _i0+1, z_1, z_0 {
 23426  				x := z_0
 23427  				y := z_1
 23428  				if !(z.Uses == 1) {
 23429  					continue
 23430  				}
 23431  				v0 := b.NewValue0(v_0.Pos, OpARM64CMNW, types.TypeFlags)
 23432  				v0.AddArg2(x, y)
 23433  				b.resetWithControl(BlockARM64GTnoov, v0)
 23434  				return true
 23435  			}
 23436  			break
 23437  		}
 23438  		// match: (GT (CMPconst [0] z:(MADD a x y)) yes no)
 23439  		// cond: z.Uses==1
 23440  		// result: (GTnoov (CMN a (MUL <x.Type> x y)) yes no)
 23441  		for b.Controls[0].Op == OpARM64CMPconst {
 23442  			v_0 := b.Controls[0]
 23443  			if auxIntToInt64(v_0.AuxInt) != 0 {
 23444  				break
 23445  			}
 23446  			z := v_0.Args[0]
 23447  			if z.Op != OpARM64MADD {
 23448  				break
 23449  			}
 23450  			y := z.Args[2]
 23451  			a := z.Args[0]
 23452  			x := z.Args[1]
 23453  			if !(z.Uses == 1) {
 23454  				break
 23455  			}
 23456  			v0 := b.NewValue0(v_0.Pos, OpARM64CMN, types.TypeFlags)
 23457  			v1 := b.NewValue0(v_0.Pos, OpARM64MUL, x.Type)
 23458  			v1.AddArg2(x, y)
 23459  			v0.AddArg2(a, v1)
 23460  			b.resetWithControl(BlockARM64GTnoov, v0)
 23461  			return true
 23462  		}
 23463  		// match: (GT (CMPconst [0] z:(MSUB a x y)) yes no)
 23464  		// cond: z.Uses==1
 23465  		// result: (GTnoov (CMP a (MUL <x.Type> x y)) yes no)
 23466  		for b.Controls[0].Op == OpARM64CMPconst {
 23467  			v_0 := b.Controls[0]
 23468  			if auxIntToInt64(v_0.AuxInt) != 0 {
 23469  				break
 23470  			}
 23471  			z := v_0.Args[0]
 23472  			if z.Op != OpARM64MSUB {
 23473  				break
 23474  			}
 23475  			y := z.Args[2]
 23476  			a := z.Args[0]
 23477  			x := z.Args[1]
 23478  			if !(z.Uses == 1) {
 23479  				break
 23480  			}
 23481  			v0 := b.NewValue0(v_0.Pos, OpARM64CMP, types.TypeFlags)
 23482  			v1 := b.NewValue0(v_0.Pos, OpARM64MUL, x.Type)
 23483  			v1.AddArg2(x, y)
 23484  			v0.AddArg2(a, v1)
 23485  			b.resetWithControl(BlockARM64GTnoov, v0)
 23486  			return true
 23487  		}
 23488  		// match: (GT (CMPWconst [0] z:(MADDW a x y)) yes no)
 23489  		// cond: z.Uses==1
 23490  		// result: (GTnoov (CMNW a (MULW <x.Type> x y)) yes no)
 23491  		for b.Controls[0].Op == OpARM64CMPWconst {
 23492  			v_0 := b.Controls[0]
 23493  			if auxIntToInt32(v_0.AuxInt) != 0 {
 23494  				break
 23495  			}
 23496  			z := v_0.Args[0]
 23497  			if z.Op != OpARM64MADDW {
 23498  				break
 23499  			}
 23500  			y := z.Args[2]
 23501  			a := z.Args[0]
 23502  			x := z.Args[1]
 23503  			if !(z.Uses == 1) {
 23504  				break
 23505  			}
 23506  			v0 := b.NewValue0(v_0.Pos, OpARM64CMNW, types.TypeFlags)
 23507  			v1 := b.NewValue0(v_0.Pos, OpARM64MULW, x.Type)
 23508  			v1.AddArg2(x, y)
 23509  			v0.AddArg2(a, v1)
 23510  			b.resetWithControl(BlockARM64GTnoov, v0)
 23511  			return true
 23512  		}
 23513  		// match: (GT (CMPWconst [0] z:(MSUBW a x y)) yes no)
 23514  		// cond: z.Uses==1
 23515  		// result: (GTnoov (CMPW a (MULW <x.Type> x y)) yes no)
 23516  		for b.Controls[0].Op == OpARM64CMPWconst {
 23517  			v_0 := b.Controls[0]
 23518  			if auxIntToInt32(v_0.AuxInt) != 0 {
 23519  				break
 23520  			}
 23521  			z := v_0.Args[0]
 23522  			if z.Op != OpARM64MSUBW {
 23523  				break
 23524  			}
 23525  			y := z.Args[2]
 23526  			a := z.Args[0]
 23527  			x := z.Args[1]
 23528  			if !(z.Uses == 1) {
 23529  				break
 23530  			}
 23531  			v0 := b.NewValue0(v_0.Pos, OpARM64CMPW, types.TypeFlags)
 23532  			v1 := b.NewValue0(v_0.Pos, OpARM64MULW, x.Type)
 23533  			v1.AddArg2(x, y)
 23534  			v0.AddArg2(a, v1)
 23535  			b.resetWithControl(BlockARM64GTnoov, v0)
 23536  			return true
 23537  		}
 23538  		// match: (GT (FlagConstant [fc]) yes no)
 23539  		// cond: fc.gt()
 23540  		// result: (First yes no)
 23541  		for b.Controls[0].Op == OpARM64FlagConstant {
 23542  			v_0 := b.Controls[0]
 23543  			fc := auxIntToFlagConstant(v_0.AuxInt)
 23544  			if !(fc.gt()) {
 23545  				break
 23546  			}
 23547  			b.Reset(BlockFirst)
 23548  			return true
 23549  		}
 23550  		// match: (GT (FlagConstant [fc]) yes no)
 23551  		// cond: !fc.gt()
 23552  		// result: (First no yes)
 23553  		for b.Controls[0].Op == OpARM64FlagConstant {
 23554  			v_0 := b.Controls[0]
 23555  			fc := auxIntToFlagConstant(v_0.AuxInt)
 23556  			if !(!fc.gt()) {
 23557  				break
 23558  			}
 23559  			b.Reset(BlockFirst)
 23560  			b.swapSuccessors()
 23561  			return true
 23562  		}
 23563  		// match: (GT (InvertFlags cmp) yes no)
 23564  		// result: (LT cmp yes no)
 23565  		for b.Controls[0].Op == OpARM64InvertFlags {
 23566  			v_0 := b.Controls[0]
 23567  			cmp := v_0.Args[0]
 23568  			b.resetWithControl(BlockARM64LT, cmp)
 23569  			return true
 23570  		}
 23571  	case BlockARM64GTnoov:
 23572  		// match: (GTnoov (FlagConstant [fc]) yes no)
 23573  		// cond: fc.gtNoov()
 23574  		// result: (First yes no)
 23575  		for b.Controls[0].Op == OpARM64FlagConstant {
 23576  			v_0 := b.Controls[0]
 23577  			fc := auxIntToFlagConstant(v_0.AuxInt)
 23578  			if !(fc.gtNoov()) {
 23579  				break
 23580  			}
 23581  			b.Reset(BlockFirst)
 23582  			return true
 23583  		}
 23584  		// match: (GTnoov (FlagConstant [fc]) yes no)
 23585  		// cond: !fc.gtNoov()
 23586  		// result: (First no yes)
 23587  		for b.Controls[0].Op == OpARM64FlagConstant {
 23588  			v_0 := b.Controls[0]
 23589  			fc := auxIntToFlagConstant(v_0.AuxInt)
 23590  			if !(!fc.gtNoov()) {
 23591  				break
 23592  			}
 23593  			b.Reset(BlockFirst)
 23594  			b.swapSuccessors()
 23595  			return true
 23596  		}
 23597  		// match: (GTnoov (InvertFlags cmp) yes no)
 23598  		// result: (LTnoov cmp yes no)
 23599  		for b.Controls[0].Op == OpARM64InvertFlags {
 23600  			v_0 := b.Controls[0]
 23601  			cmp := v_0.Args[0]
 23602  			b.resetWithControl(BlockARM64LTnoov, cmp)
 23603  			return true
 23604  		}
 23605  	case BlockIf:
 23606  		// match: (If (Equal cc) yes no)
 23607  		// result: (EQ cc yes no)
 23608  		for b.Controls[0].Op == OpARM64Equal {
 23609  			v_0 := b.Controls[0]
 23610  			cc := v_0.Args[0]
 23611  			b.resetWithControl(BlockARM64EQ, cc)
 23612  			return true
 23613  		}
 23614  		// match: (If (NotEqual cc) yes no)
 23615  		// result: (NE cc yes no)
 23616  		for b.Controls[0].Op == OpARM64NotEqual {
 23617  			v_0 := b.Controls[0]
 23618  			cc := v_0.Args[0]
 23619  			b.resetWithControl(BlockARM64NE, cc)
 23620  			return true
 23621  		}
 23622  		// match: (If (LessThan cc) yes no)
 23623  		// result: (LT cc yes no)
 23624  		for b.Controls[0].Op == OpARM64LessThan {
 23625  			v_0 := b.Controls[0]
 23626  			cc := v_0.Args[0]
 23627  			b.resetWithControl(BlockARM64LT, cc)
 23628  			return true
 23629  		}
 23630  		// match: (If (LessThanU cc) yes no)
 23631  		// result: (ULT cc yes no)
 23632  		for b.Controls[0].Op == OpARM64LessThanU {
 23633  			v_0 := b.Controls[0]
 23634  			cc := v_0.Args[0]
 23635  			b.resetWithControl(BlockARM64ULT, cc)
 23636  			return true
 23637  		}
 23638  		// match: (If (LessEqual cc) yes no)
 23639  		// result: (LE cc yes no)
 23640  		for b.Controls[0].Op == OpARM64LessEqual {
 23641  			v_0 := b.Controls[0]
 23642  			cc := v_0.Args[0]
 23643  			b.resetWithControl(BlockARM64LE, cc)
 23644  			return true
 23645  		}
 23646  		// match: (If (LessEqualU cc) yes no)
 23647  		// result: (ULE cc yes no)
 23648  		for b.Controls[0].Op == OpARM64LessEqualU {
 23649  			v_0 := b.Controls[0]
 23650  			cc := v_0.Args[0]
 23651  			b.resetWithControl(BlockARM64ULE, cc)
 23652  			return true
 23653  		}
 23654  		// match: (If (GreaterThan cc) yes no)
 23655  		// result: (GT cc yes no)
 23656  		for b.Controls[0].Op == OpARM64GreaterThan {
 23657  			v_0 := b.Controls[0]
 23658  			cc := v_0.Args[0]
 23659  			b.resetWithControl(BlockARM64GT, cc)
 23660  			return true
 23661  		}
 23662  		// match: (If (GreaterThanU cc) yes no)
 23663  		// result: (UGT cc yes no)
 23664  		for b.Controls[0].Op == OpARM64GreaterThanU {
 23665  			v_0 := b.Controls[0]
 23666  			cc := v_0.Args[0]
 23667  			b.resetWithControl(BlockARM64UGT, cc)
 23668  			return true
 23669  		}
 23670  		// match: (If (GreaterEqual cc) yes no)
 23671  		// result: (GE cc yes no)
 23672  		for b.Controls[0].Op == OpARM64GreaterEqual {
 23673  			v_0 := b.Controls[0]
 23674  			cc := v_0.Args[0]
 23675  			b.resetWithControl(BlockARM64GE, cc)
 23676  			return true
 23677  		}
 23678  		// match: (If (GreaterEqualU cc) yes no)
 23679  		// result: (UGE cc yes no)
 23680  		for b.Controls[0].Op == OpARM64GreaterEqualU {
 23681  			v_0 := b.Controls[0]
 23682  			cc := v_0.Args[0]
 23683  			b.resetWithControl(BlockARM64UGE, cc)
 23684  			return true
 23685  		}
 23686  		// match: (If (LessThanF cc) yes no)
 23687  		// result: (FLT cc yes no)
 23688  		for b.Controls[0].Op == OpARM64LessThanF {
 23689  			v_0 := b.Controls[0]
 23690  			cc := v_0.Args[0]
 23691  			b.resetWithControl(BlockARM64FLT, cc)
 23692  			return true
 23693  		}
 23694  		// match: (If (LessEqualF cc) yes no)
 23695  		// result: (FLE cc yes no)
 23696  		for b.Controls[0].Op == OpARM64LessEqualF {
 23697  			v_0 := b.Controls[0]
 23698  			cc := v_0.Args[0]
 23699  			b.resetWithControl(BlockARM64FLE, cc)
 23700  			return true
 23701  		}
 23702  		// match: (If (GreaterThanF cc) yes no)
 23703  		// result: (FGT cc yes no)
 23704  		for b.Controls[0].Op == OpARM64GreaterThanF {
 23705  			v_0 := b.Controls[0]
 23706  			cc := v_0.Args[0]
 23707  			b.resetWithControl(BlockARM64FGT, cc)
 23708  			return true
 23709  		}
 23710  		// match: (If (GreaterEqualF cc) yes no)
 23711  		// result: (FGE cc yes no)
 23712  		for b.Controls[0].Op == OpARM64GreaterEqualF {
 23713  			v_0 := b.Controls[0]
 23714  			cc := v_0.Args[0]
 23715  			b.resetWithControl(BlockARM64FGE, cc)
 23716  			return true
 23717  		}
 23718  		// match: (If cond yes no)
 23719  		// result: (TBNZ [0] cond yes no)
 23720  		for {
 23721  			cond := b.Controls[0]
 23722  			b.resetWithControl(BlockARM64TBNZ, cond)
 23723  			b.AuxInt = int64ToAuxInt(0)
 23724  			return true
 23725  		}
 23726  	case BlockJumpTable:
 23727  		// match: (JumpTable idx)
 23728  		// result: (JUMPTABLE {makeJumpTableSym(b)} idx (MOVDaddr <typ.Uintptr> {makeJumpTableSym(b)} (SB)))
 23729  		for {
 23730  			idx := b.Controls[0]
 23731  			v0 := b.NewValue0(b.Pos, OpARM64MOVDaddr, typ.Uintptr)
 23732  			v0.Aux = symToAux(makeJumpTableSym(b))
 23733  			v1 := b.NewValue0(b.Pos, OpSB, typ.Uintptr)
 23734  			v0.AddArg(v1)
 23735  			b.resetWithControl2(BlockARM64JUMPTABLE, idx, v0)
 23736  			b.Aux = symToAux(makeJumpTableSym(b))
 23737  			return true
 23738  		}
 23739  	case BlockARM64LE:
 23740  		// match: (LE (CMPconst [0] z:(AND x y)) yes no)
 23741  		// cond: z.Uses == 1
 23742  		// result: (LE (TST x y) yes no)
 23743  		for b.Controls[0].Op == OpARM64CMPconst {
 23744  			v_0 := b.Controls[0]
 23745  			if auxIntToInt64(v_0.AuxInt) != 0 {
 23746  				break
 23747  			}
 23748  			z := v_0.Args[0]
 23749  			if z.Op != OpARM64AND {
 23750  				break
 23751  			}
 23752  			_ = z.Args[1]
 23753  			z_0 := z.Args[0]
 23754  			z_1 := z.Args[1]
 23755  			for _i0 := 0; _i0 <= 1; _i0, z_0, z_1 = _i0+1, z_1, z_0 {
 23756  				x := z_0
 23757  				y := z_1
 23758  				if !(z.Uses == 1) {
 23759  					continue
 23760  				}
 23761  				v0 := b.NewValue0(v_0.Pos, OpARM64TST, types.TypeFlags)
 23762  				v0.AddArg2(x, y)
 23763  				b.resetWithControl(BlockARM64LE, v0)
 23764  				return true
 23765  			}
 23766  			break
 23767  		}
 23768  		// match: (LE (CMPconst [0] x:(ANDconst [c] y)) yes no)
 23769  		// cond: x.Uses == 1
 23770  		// result: (LE (TSTconst [c] y) yes no)
 23771  		for b.Controls[0].Op == OpARM64CMPconst {
 23772  			v_0 := b.Controls[0]
 23773  			if auxIntToInt64(v_0.AuxInt) != 0 {
 23774  				break
 23775  			}
 23776  			x := v_0.Args[0]
 23777  			if x.Op != OpARM64ANDconst {
 23778  				break
 23779  			}
 23780  			c := auxIntToInt64(x.AuxInt)
 23781  			y := x.Args[0]
 23782  			if !(x.Uses == 1) {
 23783  				break
 23784  			}
 23785  			v0 := b.NewValue0(v_0.Pos, OpARM64TSTconst, types.TypeFlags)
 23786  			v0.AuxInt = int64ToAuxInt(c)
 23787  			v0.AddArg(y)
 23788  			b.resetWithControl(BlockARM64LE, v0)
 23789  			return true
 23790  		}
 23791  		// match: (LE (CMPWconst [0] z:(AND x y)) yes no)
 23792  		// cond: z.Uses == 1
 23793  		// result: (LE (TSTW x y) yes no)
 23794  		for b.Controls[0].Op == OpARM64CMPWconst {
 23795  			v_0 := b.Controls[0]
 23796  			if auxIntToInt32(v_0.AuxInt) != 0 {
 23797  				break
 23798  			}
 23799  			z := v_0.Args[0]
 23800  			if z.Op != OpARM64AND {
 23801  				break
 23802  			}
 23803  			_ = z.Args[1]
 23804  			z_0 := z.Args[0]
 23805  			z_1 := z.Args[1]
 23806  			for _i0 := 0; _i0 <= 1; _i0, z_0, z_1 = _i0+1, z_1, z_0 {
 23807  				x := z_0
 23808  				y := z_1
 23809  				if !(z.Uses == 1) {
 23810  					continue
 23811  				}
 23812  				v0 := b.NewValue0(v_0.Pos, OpARM64TSTW, types.TypeFlags)
 23813  				v0.AddArg2(x, y)
 23814  				b.resetWithControl(BlockARM64LE, v0)
 23815  				return true
 23816  			}
 23817  			break
 23818  		}
 23819  		// match: (LE (CMPWconst [0] x:(ANDconst [c] y)) yes no)
 23820  		// cond: x.Uses == 1
 23821  		// result: (LE (TSTWconst [int32(c)] y) yes no)
 23822  		for b.Controls[0].Op == OpARM64CMPWconst {
 23823  			v_0 := b.Controls[0]
 23824  			if auxIntToInt32(v_0.AuxInt) != 0 {
 23825  				break
 23826  			}
 23827  			x := v_0.Args[0]
 23828  			if x.Op != OpARM64ANDconst {
 23829  				break
 23830  			}
 23831  			c := auxIntToInt64(x.AuxInt)
 23832  			y := x.Args[0]
 23833  			if !(x.Uses == 1) {
 23834  				break
 23835  			}
 23836  			v0 := b.NewValue0(v_0.Pos, OpARM64TSTWconst, types.TypeFlags)
 23837  			v0.AuxInt = int32ToAuxInt(int32(c))
 23838  			v0.AddArg(y)
 23839  			b.resetWithControl(BlockARM64LE, v0)
 23840  			return true
 23841  		}
 23842  		// match: (LE (CMPconst [0] x:(ADDconst [c] y)) yes no)
 23843  		// cond: x.Uses == 1
 23844  		// result: (LEnoov (CMNconst [c] y) yes no)
 23845  		for b.Controls[0].Op == OpARM64CMPconst {
 23846  			v_0 := b.Controls[0]
 23847  			if auxIntToInt64(v_0.AuxInt) != 0 {
 23848  				break
 23849  			}
 23850  			x := v_0.Args[0]
 23851  			if x.Op != OpARM64ADDconst {
 23852  				break
 23853  			}
 23854  			c := auxIntToInt64(x.AuxInt)
 23855  			y := x.Args[0]
 23856  			if !(x.Uses == 1) {
 23857  				break
 23858  			}
 23859  			v0 := b.NewValue0(v_0.Pos, OpARM64CMNconst, types.TypeFlags)
 23860  			v0.AuxInt = int64ToAuxInt(c)
 23861  			v0.AddArg(y)
 23862  			b.resetWithControl(BlockARM64LEnoov, v0)
 23863  			return true
 23864  		}
 23865  		// match: (LE (CMPWconst [0] x:(ADDconst [c] y)) yes no)
 23866  		// cond: x.Uses == 1
 23867  		// result: (LEnoov (CMNWconst [int32(c)] y) yes no)
 23868  		for b.Controls[0].Op == OpARM64CMPWconst {
 23869  			v_0 := b.Controls[0]
 23870  			if auxIntToInt32(v_0.AuxInt) != 0 {
 23871  				break
 23872  			}
 23873  			x := v_0.Args[0]
 23874  			if x.Op != OpARM64ADDconst {
 23875  				break
 23876  			}
 23877  			c := auxIntToInt64(x.AuxInt)
 23878  			y := x.Args[0]
 23879  			if !(x.Uses == 1) {
 23880  				break
 23881  			}
 23882  			v0 := b.NewValue0(v_0.Pos, OpARM64CMNWconst, types.TypeFlags)
 23883  			v0.AuxInt = int32ToAuxInt(int32(c))
 23884  			v0.AddArg(y)
 23885  			b.resetWithControl(BlockARM64LEnoov, v0)
 23886  			return true
 23887  		}
 23888  		// match: (LE (CMPconst [0] z:(ADD x y)) yes no)
 23889  		// cond: z.Uses == 1
 23890  		// result: (LEnoov (CMN x y) yes no)
 23891  		for b.Controls[0].Op == OpARM64CMPconst {
 23892  			v_0 := b.Controls[0]
 23893  			if auxIntToInt64(v_0.AuxInt) != 0 {
 23894  				break
 23895  			}
 23896  			z := v_0.Args[0]
 23897  			if z.Op != OpARM64ADD {
 23898  				break
 23899  			}
 23900  			_ = z.Args[1]
 23901  			z_0 := z.Args[0]
 23902  			z_1 := z.Args[1]
 23903  			for _i0 := 0; _i0 <= 1; _i0, z_0, z_1 = _i0+1, z_1, z_0 {
 23904  				x := z_0
 23905  				y := z_1
 23906  				if !(z.Uses == 1) {
 23907  					continue
 23908  				}
 23909  				v0 := b.NewValue0(v_0.Pos, OpARM64CMN, types.TypeFlags)
 23910  				v0.AddArg2(x, y)
 23911  				b.resetWithControl(BlockARM64LEnoov, v0)
 23912  				return true
 23913  			}
 23914  			break
 23915  		}
 23916  		// match: (LE (CMPWconst [0] z:(ADD x y)) yes no)
 23917  		// cond: z.Uses == 1
 23918  		// result: (LEnoov (CMNW x y) yes no)
 23919  		for b.Controls[0].Op == OpARM64CMPWconst {
 23920  			v_0 := b.Controls[0]
 23921  			if auxIntToInt32(v_0.AuxInt) != 0 {
 23922  				break
 23923  			}
 23924  			z := v_0.Args[0]
 23925  			if z.Op != OpARM64ADD {
 23926  				break
 23927  			}
 23928  			_ = z.Args[1]
 23929  			z_0 := z.Args[0]
 23930  			z_1 := z.Args[1]
 23931  			for _i0 := 0; _i0 <= 1; _i0, z_0, z_1 = _i0+1, z_1, z_0 {
 23932  				x := z_0
 23933  				y := z_1
 23934  				if !(z.Uses == 1) {
 23935  					continue
 23936  				}
 23937  				v0 := b.NewValue0(v_0.Pos, OpARM64CMNW, types.TypeFlags)
 23938  				v0.AddArg2(x, y)
 23939  				b.resetWithControl(BlockARM64LEnoov, v0)
 23940  				return true
 23941  			}
 23942  			break
 23943  		}
 23944  		// match: (LE (CMPconst [0] z:(MADD a x y)) yes no)
 23945  		// cond: z.Uses==1
 23946  		// result: (LEnoov (CMN a (MUL <x.Type> x y)) yes no)
 23947  		for b.Controls[0].Op == OpARM64CMPconst {
 23948  			v_0 := b.Controls[0]
 23949  			if auxIntToInt64(v_0.AuxInt) != 0 {
 23950  				break
 23951  			}
 23952  			z := v_0.Args[0]
 23953  			if z.Op != OpARM64MADD {
 23954  				break
 23955  			}
 23956  			y := z.Args[2]
 23957  			a := z.Args[0]
 23958  			x := z.Args[1]
 23959  			if !(z.Uses == 1) {
 23960  				break
 23961  			}
 23962  			v0 := b.NewValue0(v_0.Pos, OpARM64CMN, types.TypeFlags)
 23963  			v1 := b.NewValue0(v_0.Pos, OpARM64MUL, x.Type)
 23964  			v1.AddArg2(x, y)
 23965  			v0.AddArg2(a, v1)
 23966  			b.resetWithControl(BlockARM64LEnoov, v0)
 23967  			return true
 23968  		}
 23969  		// match: (LE (CMPconst [0] z:(MSUB a x y)) yes no)
 23970  		// cond: z.Uses==1
 23971  		// result: (LEnoov (CMP a (MUL <x.Type> x y)) yes no)
 23972  		for b.Controls[0].Op == OpARM64CMPconst {
 23973  			v_0 := b.Controls[0]
 23974  			if auxIntToInt64(v_0.AuxInt) != 0 {
 23975  				break
 23976  			}
 23977  			z := v_0.Args[0]
 23978  			if z.Op != OpARM64MSUB {
 23979  				break
 23980  			}
 23981  			y := z.Args[2]
 23982  			a := z.Args[0]
 23983  			x := z.Args[1]
 23984  			if !(z.Uses == 1) {
 23985  				break
 23986  			}
 23987  			v0 := b.NewValue0(v_0.Pos, OpARM64CMP, types.TypeFlags)
 23988  			v1 := b.NewValue0(v_0.Pos, OpARM64MUL, x.Type)
 23989  			v1.AddArg2(x, y)
 23990  			v0.AddArg2(a, v1)
 23991  			b.resetWithControl(BlockARM64LEnoov, v0)
 23992  			return true
 23993  		}
 23994  		// match: (LE (CMPWconst [0] z:(MADDW a x y)) yes no)
 23995  		// cond: z.Uses==1
 23996  		// result: (LEnoov (CMNW a (MULW <x.Type> x y)) yes no)
 23997  		for b.Controls[0].Op == OpARM64CMPWconst {
 23998  			v_0 := b.Controls[0]
 23999  			if auxIntToInt32(v_0.AuxInt) != 0 {
 24000  				break
 24001  			}
 24002  			z := v_0.Args[0]
 24003  			if z.Op != OpARM64MADDW {
 24004  				break
 24005  			}
 24006  			y := z.Args[2]
 24007  			a := z.Args[0]
 24008  			x := z.Args[1]
 24009  			if !(z.Uses == 1) {
 24010  				break
 24011  			}
 24012  			v0 := b.NewValue0(v_0.Pos, OpARM64CMNW, types.TypeFlags)
 24013  			v1 := b.NewValue0(v_0.Pos, OpARM64MULW, x.Type)
 24014  			v1.AddArg2(x, y)
 24015  			v0.AddArg2(a, v1)
 24016  			b.resetWithControl(BlockARM64LEnoov, v0)
 24017  			return true
 24018  		}
 24019  		// match: (LE (CMPWconst [0] z:(MSUBW a x y)) yes no)
 24020  		// cond: z.Uses==1
 24021  		// result: (LEnoov (CMPW a (MULW <x.Type> x y)) yes no)
 24022  		for b.Controls[0].Op == OpARM64CMPWconst {
 24023  			v_0 := b.Controls[0]
 24024  			if auxIntToInt32(v_0.AuxInt) != 0 {
 24025  				break
 24026  			}
 24027  			z := v_0.Args[0]
 24028  			if z.Op != OpARM64MSUBW {
 24029  				break
 24030  			}
 24031  			y := z.Args[2]
 24032  			a := z.Args[0]
 24033  			x := z.Args[1]
 24034  			if !(z.Uses == 1) {
 24035  				break
 24036  			}
 24037  			v0 := b.NewValue0(v_0.Pos, OpARM64CMPW, types.TypeFlags)
 24038  			v1 := b.NewValue0(v_0.Pos, OpARM64MULW, x.Type)
 24039  			v1.AddArg2(x, y)
 24040  			v0.AddArg2(a, v1)
 24041  			b.resetWithControl(BlockARM64LEnoov, v0)
 24042  			return true
 24043  		}
 24044  		// match: (LE (FlagConstant [fc]) yes no)
 24045  		// cond: fc.le()
 24046  		// result: (First yes no)
 24047  		for b.Controls[0].Op == OpARM64FlagConstant {
 24048  			v_0 := b.Controls[0]
 24049  			fc := auxIntToFlagConstant(v_0.AuxInt)
 24050  			if !(fc.le()) {
 24051  				break
 24052  			}
 24053  			b.Reset(BlockFirst)
 24054  			return true
 24055  		}
 24056  		// match: (LE (FlagConstant [fc]) yes no)
 24057  		// cond: !fc.le()
 24058  		// result: (First no yes)
 24059  		for b.Controls[0].Op == OpARM64FlagConstant {
 24060  			v_0 := b.Controls[0]
 24061  			fc := auxIntToFlagConstant(v_0.AuxInt)
 24062  			if !(!fc.le()) {
 24063  				break
 24064  			}
 24065  			b.Reset(BlockFirst)
 24066  			b.swapSuccessors()
 24067  			return true
 24068  		}
 24069  		// match: (LE (InvertFlags cmp) yes no)
 24070  		// result: (GE cmp yes no)
 24071  		for b.Controls[0].Op == OpARM64InvertFlags {
 24072  			v_0 := b.Controls[0]
 24073  			cmp := v_0.Args[0]
 24074  			b.resetWithControl(BlockARM64GE, cmp)
 24075  			return true
 24076  		}
 24077  	case BlockARM64LEnoov:
 24078  		// match: (LEnoov (FlagConstant [fc]) yes no)
 24079  		// cond: fc.leNoov()
 24080  		// result: (First yes no)
 24081  		for b.Controls[0].Op == OpARM64FlagConstant {
 24082  			v_0 := b.Controls[0]
 24083  			fc := auxIntToFlagConstant(v_0.AuxInt)
 24084  			if !(fc.leNoov()) {
 24085  				break
 24086  			}
 24087  			b.Reset(BlockFirst)
 24088  			return true
 24089  		}
 24090  		// match: (LEnoov (FlagConstant [fc]) yes no)
 24091  		// cond: !fc.leNoov()
 24092  		// result: (First no yes)
 24093  		for b.Controls[0].Op == OpARM64FlagConstant {
 24094  			v_0 := b.Controls[0]
 24095  			fc := auxIntToFlagConstant(v_0.AuxInt)
 24096  			if !(!fc.leNoov()) {
 24097  				break
 24098  			}
 24099  			b.Reset(BlockFirst)
 24100  			b.swapSuccessors()
 24101  			return true
 24102  		}
 24103  		// match: (LEnoov (InvertFlags cmp) yes no)
 24104  		// result: (GEnoov cmp yes no)
 24105  		for b.Controls[0].Op == OpARM64InvertFlags {
 24106  			v_0 := b.Controls[0]
 24107  			cmp := v_0.Args[0]
 24108  			b.resetWithControl(BlockARM64GEnoov, cmp)
 24109  			return true
 24110  		}
 24111  	case BlockARM64LT:
 24112  		// match: (LT (CMPconst [0] z:(AND x y)) yes no)
 24113  		// cond: z.Uses == 1
 24114  		// result: (LT (TST x y) yes no)
 24115  		for b.Controls[0].Op == OpARM64CMPconst {
 24116  			v_0 := b.Controls[0]
 24117  			if auxIntToInt64(v_0.AuxInt) != 0 {
 24118  				break
 24119  			}
 24120  			z := v_0.Args[0]
 24121  			if z.Op != OpARM64AND {
 24122  				break
 24123  			}
 24124  			_ = z.Args[1]
 24125  			z_0 := z.Args[0]
 24126  			z_1 := z.Args[1]
 24127  			for _i0 := 0; _i0 <= 1; _i0, z_0, z_1 = _i0+1, z_1, z_0 {
 24128  				x := z_0
 24129  				y := z_1
 24130  				if !(z.Uses == 1) {
 24131  					continue
 24132  				}
 24133  				v0 := b.NewValue0(v_0.Pos, OpARM64TST, types.TypeFlags)
 24134  				v0.AddArg2(x, y)
 24135  				b.resetWithControl(BlockARM64LT, v0)
 24136  				return true
 24137  			}
 24138  			break
 24139  		}
 24140  		// match: (LT (CMPconst [0] x:(ANDconst [c] y)) yes no)
 24141  		// cond: x.Uses == 1
 24142  		// result: (LT (TSTconst [c] y) yes no)
 24143  		for b.Controls[0].Op == OpARM64CMPconst {
 24144  			v_0 := b.Controls[0]
 24145  			if auxIntToInt64(v_0.AuxInt) != 0 {
 24146  				break
 24147  			}
 24148  			x := v_0.Args[0]
 24149  			if x.Op != OpARM64ANDconst {
 24150  				break
 24151  			}
 24152  			c := auxIntToInt64(x.AuxInt)
 24153  			y := x.Args[0]
 24154  			if !(x.Uses == 1) {
 24155  				break
 24156  			}
 24157  			v0 := b.NewValue0(v_0.Pos, OpARM64TSTconst, types.TypeFlags)
 24158  			v0.AuxInt = int64ToAuxInt(c)
 24159  			v0.AddArg(y)
 24160  			b.resetWithControl(BlockARM64LT, v0)
 24161  			return true
 24162  		}
 24163  		// match: (LT (CMPWconst [0] z:(AND x y)) yes no)
 24164  		// cond: z.Uses == 1
 24165  		// result: (LT (TSTW x y) yes no)
 24166  		for b.Controls[0].Op == OpARM64CMPWconst {
 24167  			v_0 := b.Controls[0]
 24168  			if auxIntToInt32(v_0.AuxInt) != 0 {
 24169  				break
 24170  			}
 24171  			z := v_0.Args[0]
 24172  			if z.Op != OpARM64AND {
 24173  				break
 24174  			}
 24175  			_ = z.Args[1]
 24176  			z_0 := z.Args[0]
 24177  			z_1 := z.Args[1]
 24178  			for _i0 := 0; _i0 <= 1; _i0, z_0, z_1 = _i0+1, z_1, z_0 {
 24179  				x := z_0
 24180  				y := z_1
 24181  				if !(z.Uses == 1) {
 24182  					continue
 24183  				}
 24184  				v0 := b.NewValue0(v_0.Pos, OpARM64TSTW, types.TypeFlags)
 24185  				v0.AddArg2(x, y)
 24186  				b.resetWithControl(BlockARM64LT, v0)
 24187  				return true
 24188  			}
 24189  			break
 24190  		}
 24191  		// match: (LT (CMPWconst [0] x:(ANDconst [c] y)) yes no)
 24192  		// cond: x.Uses == 1
 24193  		// result: (LT (TSTWconst [int32(c)] y) yes no)
 24194  		for b.Controls[0].Op == OpARM64CMPWconst {
 24195  			v_0 := b.Controls[0]
 24196  			if auxIntToInt32(v_0.AuxInt) != 0 {
 24197  				break
 24198  			}
 24199  			x := v_0.Args[0]
 24200  			if x.Op != OpARM64ANDconst {
 24201  				break
 24202  			}
 24203  			c := auxIntToInt64(x.AuxInt)
 24204  			y := x.Args[0]
 24205  			if !(x.Uses == 1) {
 24206  				break
 24207  			}
 24208  			v0 := b.NewValue0(v_0.Pos, OpARM64TSTWconst, types.TypeFlags)
 24209  			v0.AuxInt = int32ToAuxInt(int32(c))
 24210  			v0.AddArg(y)
 24211  			b.resetWithControl(BlockARM64LT, v0)
 24212  			return true
 24213  		}
 24214  		// match: (LT (CMPconst [0] x:(ADDconst [c] y)) yes no)
 24215  		// cond: x.Uses == 1
 24216  		// result: (LTnoov (CMNconst [c] y) yes no)
 24217  		for b.Controls[0].Op == OpARM64CMPconst {
 24218  			v_0 := b.Controls[0]
 24219  			if auxIntToInt64(v_0.AuxInt) != 0 {
 24220  				break
 24221  			}
 24222  			x := v_0.Args[0]
 24223  			if x.Op != OpARM64ADDconst {
 24224  				break
 24225  			}
 24226  			c := auxIntToInt64(x.AuxInt)
 24227  			y := x.Args[0]
 24228  			if !(x.Uses == 1) {
 24229  				break
 24230  			}
 24231  			v0 := b.NewValue0(v_0.Pos, OpARM64CMNconst, types.TypeFlags)
 24232  			v0.AuxInt = int64ToAuxInt(c)
 24233  			v0.AddArg(y)
 24234  			b.resetWithControl(BlockARM64LTnoov, v0)
 24235  			return true
 24236  		}
 24237  		// match: (LT (CMPWconst [0] x:(ADDconst [c] y)) yes no)
 24238  		// cond: x.Uses == 1
 24239  		// result: (LTnoov (CMNWconst [int32(c)] y) yes no)
 24240  		for b.Controls[0].Op == OpARM64CMPWconst {
 24241  			v_0 := b.Controls[0]
 24242  			if auxIntToInt32(v_0.AuxInt) != 0 {
 24243  				break
 24244  			}
 24245  			x := v_0.Args[0]
 24246  			if x.Op != OpARM64ADDconst {
 24247  				break
 24248  			}
 24249  			c := auxIntToInt64(x.AuxInt)
 24250  			y := x.Args[0]
 24251  			if !(x.Uses == 1) {
 24252  				break
 24253  			}
 24254  			v0 := b.NewValue0(v_0.Pos, OpARM64CMNWconst, types.TypeFlags)
 24255  			v0.AuxInt = int32ToAuxInt(int32(c))
 24256  			v0.AddArg(y)
 24257  			b.resetWithControl(BlockARM64LTnoov, v0)
 24258  			return true
 24259  		}
 24260  		// match: (LT (CMPconst [0] z:(ADD x y)) yes no)
 24261  		// cond: z.Uses == 1
 24262  		// result: (LTnoov (CMN x y) yes no)
 24263  		for b.Controls[0].Op == OpARM64CMPconst {
 24264  			v_0 := b.Controls[0]
 24265  			if auxIntToInt64(v_0.AuxInt) != 0 {
 24266  				break
 24267  			}
 24268  			z := v_0.Args[0]
 24269  			if z.Op != OpARM64ADD {
 24270  				break
 24271  			}
 24272  			_ = z.Args[1]
 24273  			z_0 := z.Args[0]
 24274  			z_1 := z.Args[1]
 24275  			for _i0 := 0; _i0 <= 1; _i0, z_0, z_1 = _i0+1, z_1, z_0 {
 24276  				x := z_0
 24277  				y := z_1
 24278  				if !(z.Uses == 1) {
 24279  					continue
 24280  				}
 24281  				v0 := b.NewValue0(v_0.Pos, OpARM64CMN, types.TypeFlags)
 24282  				v0.AddArg2(x, y)
 24283  				b.resetWithControl(BlockARM64LTnoov, v0)
 24284  				return true
 24285  			}
 24286  			break
 24287  		}
 24288  		// match: (LT (CMPWconst [0] z:(ADD x y)) yes no)
 24289  		// cond: z.Uses == 1
 24290  		// result: (LTnoov (CMNW x y) yes no)
 24291  		for b.Controls[0].Op == OpARM64CMPWconst {
 24292  			v_0 := b.Controls[0]
 24293  			if auxIntToInt32(v_0.AuxInt) != 0 {
 24294  				break
 24295  			}
 24296  			z := v_0.Args[0]
 24297  			if z.Op != OpARM64ADD {
 24298  				break
 24299  			}
 24300  			_ = z.Args[1]
 24301  			z_0 := z.Args[0]
 24302  			z_1 := z.Args[1]
 24303  			for _i0 := 0; _i0 <= 1; _i0, z_0, z_1 = _i0+1, z_1, z_0 {
 24304  				x := z_0
 24305  				y := z_1
 24306  				if !(z.Uses == 1) {
 24307  					continue
 24308  				}
 24309  				v0 := b.NewValue0(v_0.Pos, OpARM64CMNW, types.TypeFlags)
 24310  				v0.AddArg2(x, y)
 24311  				b.resetWithControl(BlockARM64LTnoov, v0)
 24312  				return true
 24313  			}
 24314  			break
 24315  		}
 24316  		// match: (LT (CMPconst [0] z:(MADD a x y)) yes no)
 24317  		// cond: z.Uses==1
 24318  		// result: (LTnoov (CMN a (MUL <x.Type> x y)) yes no)
 24319  		for b.Controls[0].Op == OpARM64CMPconst {
 24320  			v_0 := b.Controls[0]
 24321  			if auxIntToInt64(v_0.AuxInt) != 0 {
 24322  				break
 24323  			}
 24324  			z := v_0.Args[0]
 24325  			if z.Op != OpARM64MADD {
 24326  				break
 24327  			}
 24328  			y := z.Args[2]
 24329  			a := z.Args[0]
 24330  			x := z.Args[1]
 24331  			if !(z.Uses == 1) {
 24332  				break
 24333  			}
 24334  			v0 := b.NewValue0(v_0.Pos, OpARM64CMN, types.TypeFlags)
 24335  			v1 := b.NewValue0(v_0.Pos, OpARM64MUL, x.Type)
 24336  			v1.AddArg2(x, y)
 24337  			v0.AddArg2(a, v1)
 24338  			b.resetWithControl(BlockARM64LTnoov, v0)
 24339  			return true
 24340  		}
 24341  		// match: (LT (CMPconst [0] z:(MSUB a x y)) yes no)
 24342  		// cond: z.Uses==1
 24343  		// result: (LTnoov (CMP a (MUL <x.Type> x y)) yes no)
 24344  		for b.Controls[0].Op == OpARM64CMPconst {
 24345  			v_0 := b.Controls[0]
 24346  			if auxIntToInt64(v_0.AuxInt) != 0 {
 24347  				break
 24348  			}
 24349  			z := v_0.Args[0]
 24350  			if z.Op != OpARM64MSUB {
 24351  				break
 24352  			}
 24353  			y := z.Args[2]
 24354  			a := z.Args[0]
 24355  			x := z.Args[1]
 24356  			if !(z.Uses == 1) {
 24357  				break
 24358  			}
 24359  			v0 := b.NewValue0(v_0.Pos, OpARM64CMP, types.TypeFlags)
 24360  			v1 := b.NewValue0(v_0.Pos, OpARM64MUL, x.Type)
 24361  			v1.AddArg2(x, y)
 24362  			v0.AddArg2(a, v1)
 24363  			b.resetWithControl(BlockARM64LTnoov, v0)
 24364  			return true
 24365  		}
 24366  		// match: (LT (CMPWconst [0] z:(MADDW a x y)) yes no)
 24367  		// cond: z.Uses==1
 24368  		// result: (LTnoov (CMNW a (MULW <x.Type> x y)) yes no)
 24369  		for b.Controls[0].Op == OpARM64CMPWconst {
 24370  			v_0 := b.Controls[0]
 24371  			if auxIntToInt32(v_0.AuxInt) != 0 {
 24372  				break
 24373  			}
 24374  			z := v_0.Args[0]
 24375  			if z.Op != OpARM64MADDW {
 24376  				break
 24377  			}
 24378  			y := z.Args[2]
 24379  			a := z.Args[0]
 24380  			x := z.Args[1]
 24381  			if !(z.Uses == 1) {
 24382  				break
 24383  			}
 24384  			v0 := b.NewValue0(v_0.Pos, OpARM64CMNW, types.TypeFlags)
 24385  			v1 := b.NewValue0(v_0.Pos, OpARM64MULW, x.Type)
 24386  			v1.AddArg2(x, y)
 24387  			v0.AddArg2(a, v1)
 24388  			b.resetWithControl(BlockARM64LTnoov, v0)
 24389  			return true
 24390  		}
 24391  		// match: (LT (CMPWconst [0] z:(MSUBW a x y)) yes no)
 24392  		// cond: z.Uses==1
 24393  		// result: (LTnoov (CMPW a (MULW <x.Type> x y)) yes no)
 24394  		for b.Controls[0].Op == OpARM64CMPWconst {
 24395  			v_0 := b.Controls[0]
 24396  			if auxIntToInt32(v_0.AuxInt) != 0 {
 24397  				break
 24398  			}
 24399  			z := v_0.Args[0]
 24400  			if z.Op != OpARM64MSUBW {
 24401  				break
 24402  			}
 24403  			y := z.Args[2]
 24404  			a := z.Args[0]
 24405  			x := z.Args[1]
 24406  			if !(z.Uses == 1) {
 24407  				break
 24408  			}
 24409  			v0 := b.NewValue0(v_0.Pos, OpARM64CMPW, types.TypeFlags)
 24410  			v1 := b.NewValue0(v_0.Pos, OpARM64MULW, x.Type)
 24411  			v1.AddArg2(x, y)
 24412  			v0.AddArg2(a, v1)
 24413  			b.resetWithControl(BlockARM64LTnoov, v0)
 24414  			return true
 24415  		}
 24416  		// match: (LT (CMPWconst [0] x) yes no)
 24417  		// result: (TBNZ [31] x yes no)
 24418  		for b.Controls[0].Op == OpARM64CMPWconst {
 24419  			v_0 := b.Controls[0]
 24420  			if auxIntToInt32(v_0.AuxInt) != 0 {
 24421  				break
 24422  			}
 24423  			x := v_0.Args[0]
 24424  			b.resetWithControl(BlockARM64TBNZ, x)
 24425  			b.AuxInt = int64ToAuxInt(31)
 24426  			return true
 24427  		}
 24428  		// match: (LT (CMPconst [0] x) yes no)
 24429  		// result: (TBNZ [63] x yes no)
 24430  		for b.Controls[0].Op == OpARM64CMPconst {
 24431  			v_0 := b.Controls[0]
 24432  			if auxIntToInt64(v_0.AuxInt) != 0 {
 24433  				break
 24434  			}
 24435  			x := v_0.Args[0]
 24436  			b.resetWithControl(BlockARM64TBNZ, x)
 24437  			b.AuxInt = int64ToAuxInt(63)
 24438  			return true
 24439  		}
 24440  		// match: (LT (FlagConstant [fc]) yes no)
 24441  		// cond: fc.lt()
 24442  		// result: (First yes no)
 24443  		for b.Controls[0].Op == OpARM64FlagConstant {
 24444  			v_0 := b.Controls[0]
 24445  			fc := auxIntToFlagConstant(v_0.AuxInt)
 24446  			if !(fc.lt()) {
 24447  				break
 24448  			}
 24449  			b.Reset(BlockFirst)
 24450  			return true
 24451  		}
 24452  		// match: (LT (FlagConstant [fc]) yes no)
 24453  		// cond: !fc.lt()
 24454  		// result: (First no yes)
 24455  		for b.Controls[0].Op == OpARM64FlagConstant {
 24456  			v_0 := b.Controls[0]
 24457  			fc := auxIntToFlagConstant(v_0.AuxInt)
 24458  			if !(!fc.lt()) {
 24459  				break
 24460  			}
 24461  			b.Reset(BlockFirst)
 24462  			b.swapSuccessors()
 24463  			return true
 24464  		}
 24465  		// match: (LT (InvertFlags cmp) yes no)
 24466  		// result: (GT cmp yes no)
 24467  		for b.Controls[0].Op == OpARM64InvertFlags {
 24468  			v_0 := b.Controls[0]
 24469  			cmp := v_0.Args[0]
 24470  			b.resetWithControl(BlockARM64GT, cmp)
 24471  			return true
 24472  		}
 24473  	case BlockARM64LTnoov:
 24474  		// match: (LTnoov (FlagConstant [fc]) yes no)
 24475  		// cond: fc.ltNoov()
 24476  		// result: (First yes no)
 24477  		for b.Controls[0].Op == OpARM64FlagConstant {
 24478  			v_0 := b.Controls[0]
 24479  			fc := auxIntToFlagConstant(v_0.AuxInt)
 24480  			if !(fc.ltNoov()) {
 24481  				break
 24482  			}
 24483  			b.Reset(BlockFirst)
 24484  			return true
 24485  		}
 24486  		// match: (LTnoov (FlagConstant [fc]) yes no)
 24487  		// cond: !fc.ltNoov()
 24488  		// result: (First no yes)
 24489  		for b.Controls[0].Op == OpARM64FlagConstant {
 24490  			v_0 := b.Controls[0]
 24491  			fc := auxIntToFlagConstant(v_0.AuxInt)
 24492  			if !(!fc.ltNoov()) {
 24493  				break
 24494  			}
 24495  			b.Reset(BlockFirst)
 24496  			b.swapSuccessors()
 24497  			return true
 24498  		}
 24499  		// match: (LTnoov (InvertFlags cmp) yes no)
 24500  		// result: (GTnoov cmp yes no)
 24501  		for b.Controls[0].Op == OpARM64InvertFlags {
 24502  			v_0 := b.Controls[0]
 24503  			cmp := v_0.Args[0]
 24504  			b.resetWithControl(BlockARM64GTnoov, cmp)
 24505  			return true
 24506  		}
 24507  	case BlockARM64NE:
 24508  		// match: (NE (CMPconst [0] z:(AND x y)) yes no)
 24509  		// cond: z.Uses == 1
 24510  		// result: (NE (TST x y) yes no)
 24511  		for b.Controls[0].Op == OpARM64CMPconst {
 24512  			v_0 := b.Controls[0]
 24513  			if auxIntToInt64(v_0.AuxInt) != 0 {
 24514  				break
 24515  			}
 24516  			z := v_0.Args[0]
 24517  			if z.Op != OpARM64AND {
 24518  				break
 24519  			}
 24520  			_ = z.Args[1]
 24521  			z_0 := z.Args[0]
 24522  			z_1 := z.Args[1]
 24523  			for _i0 := 0; _i0 <= 1; _i0, z_0, z_1 = _i0+1, z_1, z_0 {
 24524  				x := z_0
 24525  				y := z_1
 24526  				if !(z.Uses == 1) {
 24527  					continue
 24528  				}
 24529  				v0 := b.NewValue0(v_0.Pos, OpARM64TST, types.TypeFlags)
 24530  				v0.AddArg2(x, y)
 24531  				b.resetWithControl(BlockARM64NE, v0)
 24532  				return true
 24533  			}
 24534  			break
 24535  		}
 24536  		// match: (NE (CMPconst [0] x:(ANDconst [c] y)) yes no)
 24537  		// cond: x.Uses == 1
 24538  		// result: (NE (TSTconst [c] y) yes no)
 24539  		for b.Controls[0].Op == OpARM64CMPconst {
 24540  			v_0 := b.Controls[0]
 24541  			if auxIntToInt64(v_0.AuxInt) != 0 {
 24542  				break
 24543  			}
 24544  			x := v_0.Args[0]
 24545  			if x.Op != OpARM64ANDconst {
 24546  				break
 24547  			}
 24548  			c := auxIntToInt64(x.AuxInt)
 24549  			y := x.Args[0]
 24550  			if !(x.Uses == 1) {
 24551  				break
 24552  			}
 24553  			v0 := b.NewValue0(v_0.Pos, OpARM64TSTconst, types.TypeFlags)
 24554  			v0.AuxInt = int64ToAuxInt(c)
 24555  			v0.AddArg(y)
 24556  			b.resetWithControl(BlockARM64NE, v0)
 24557  			return true
 24558  		}
 24559  		// match: (NE (CMPWconst [0] z:(AND x y)) yes no)
 24560  		// cond: z.Uses == 1
 24561  		// result: (NE (TSTW x y) yes no)
 24562  		for b.Controls[0].Op == OpARM64CMPWconst {
 24563  			v_0 := b.Controls[0]
 24564  			if auxIntToInt32(v_0.AuxInt) != 0 {
 24565  				break
 24566  			}
 24567  			z := v_0.Args[0]
 24568  			if z.Op != OpARM64AND {
 24569  				break
 24570  			}
 24571  			_ = z.Args[1]
 24572  			z_0 := z.Args[0]
 24573  			z_1 := z.Args[1]
 24574  			for _i0 := 0; _i0 <= 1; _i0, z_0, z_1 = _i0+1, z_1, z_0 {
 24575  				x := z_0
 24576  				y := z_1
 24577  				if !(z.Uses == 1) {
 24578  					continue
 24579  				}
 24580  				v0 := b.NewValue0(v_0.Pos, OpARM64TSTW, types.TypeFlags)
 24581  				v0.AddArg2(x, y)
 24582  				b.resetWithControl(BlockARM64NE, v0)
 24583  				return true
 24584  			}
 24585  			break
 24586  		}
 24587  		// match: (NE (CMPWconst [0] x:(ANDconst [c] y)) yes no)
 24588  		// cond: x.Uses == 1
 24589  		// result: (NE (TSTWconst [int32(c)] y) yes no)
 24590  		for b.Controls[0].Op == OpARM64CMPWconst {
 24591  			v_0 := b.Controls[0]
 24592  			if auxIntToInt32(v_0.AuxInt) != 0 {
 24593  				break
 24594  			}
 24595  			x := v_0.Args[0]
 24596  			if x.Op != OpARM64ANDconst {
 24597  				break
 24598  			}
 24599  			c := auxIntToInt64(x.AuxInt)
 24600  			y := x.Args[0]
 24601  			if !(x.Uses == 1) {
 24602  				break
 24603  			}
 24604  			v0 := b.NewValue0(v_0.Pos, OpARM64TSTWconst, types.TypeFlags)
 24605  			v0.AuxInt = int32ToAuxInt(int32(c))
 24606  			v0.AddArg(y)
 24607  			b.resetWithControl(BlockARM64NE, v0)
 24608  			return true
 24609  		}
 24610  		// match: (NE (CMPconst [0] x:(ADDconst [c] y)) yes no)
 24611  		// cond: x.Uses == 1
 24612  		// result: (NE (CMNconst [c] y) yes no)
 24613  		for b.Controls[0].Op == OpARM64CMPconst {
 24614  			v_0 := b.Controls[0]
 24615  			if auxIntToInt64(v_0.AuxInt) != 0 {
 24616  				break
 24617  			}
 24618  			x := v_0.Args[0]
 24619  			if x.Op != OpARM64ADDconst {
 24620  				break
 24621  			}
 24622  			c := auxIntToInt64(x.AuxInt)
 24623  			y := x.Args[0]
 24624  			if !(x.Uses == 1) {
 24625  				break
 24626  			}
 24627  			v0 := b.NewValue0(v_0.Pos, OpARM64CMNconst, types.TypeFlags)
 24628  			v0.AuxInt = int64ToAuxInt(c)
 24629  			v0.AddArg(y)
 24630  			b.resetWithControl(BlockARM64NE, v0)
 24631  			return true
 24632  		}
 24633  		// match: (NE (CMPWconst [0] x:(ADDconst [c] y)) yes no)
 24634  		// cond: x.Uses == 1
 24635  		// result: (NE (CMNWconst [int32(c)] y) yes no)
 24636  		for b.Controls[0].Op == OpARM64CMPWconst {
 24637  			v_0 := b.Controls[0]
 24638  			if auxIntToInt32(v_0.AuxInt) != 0 {
 24639  				break
 24640  			}
 24641  			x := v_0.Args[0]
 24642  			if x.Op != OpARM64ADDconst {
 24643  				break
 24644  			}
 24645  			c := auxIntToInt64(x.AuxInt)
 24646  			y := x.Args[0]
 24647  			if !(x.Uses == 1) {
 24648  				break
 24649  			}
 24650  			v0 := b.NewValue0(v_0.Pos, OpARM64CMNWconst, types.TypeFlags)
 24651  			v0.AuxInt = int32ToAuxInt(int32(c))
 24652  			v0.AddArg(y)
 24653  			b.resetWithControl(BlockARM64NE, v0)
 24654  			return true
 24655  		}
 24656  		// match: (NE (CMPconst [0] z:(ADD x y)) yes no)
 24657  		// cond: z.Uses == 1
 24658  		// result: (NE (CMN x y) yes no)
 24659  		for b.Controls[0].Op == OpARM64CMPconst {
 24660  			v_0 := b.Controls[0]
 24661  			if auxIntToInt64(v_0.AuxInt) != 0 {
 24662  				break
 24663  			}
 24664  			z := v_0.Args[0]
 24665  			if z.Op != OpARM64ADD {
 24666  				break
 24667  			}
 24668  			_ = z.Args[1]
 24669  			z_0 := z.Args[0]
 24670  			z_1 := z.Args[1]
 24671  			for _i0 := 0; _i0 <= 1; _i0, z_0, z_1 = _i0+1, z_1, z_0 {
 24672  				x := z_0
 24673  				y := z_1
 24674  				if !(z.Uses == 1) {
 24675  					continue
 24676  				}
 24677  				v0 := b.NewValue0(v_0.Pos, OpARM64CMN, types.TypeFlags)
 24678  				v0.AddArg2(x, y)
 24679  				b.resetWithControl(BlockARM64NE, v0)
 24680  				return true
 24681  			}
 24682  			break
 24683  		}
 24684  		// match: (NE (CMPWconst [0] z:(ADD x y)) yes no)
 24685  		// cond: z.Uses == 1
 24686  		// result: (NE (CMNW x y) yes no)
 24687  		for b.Controls[0].Op == OpARM64CMPWconst {
 24688  			v_0 := b.Controls[0]
 24689  			if auxIntToInt32(v_0.AuxInt) != 0 {
 24690  				break
 24691  			}
 24692  			z := v_0.Args[0]
 24693  			if z.Op != OpARM64ADD {
 24694  				break
 24695  			}
 24696  			_ = z.Args[1]
 24697  			z_0 := z.Args[0]
 24698  			z_1 := z.Args[1]
 24699  			for _i0 := 0; _i0 <= 1; _i0, z_0, z_1 = _i0+1, z_1, z_0 {
 24700  				x := z_0
 24701  				y := z_1
 24702  				if !(z.Uses == 1) {
 24703  					continue
 24704  				}
 24705  				v0 := b.NewValue0(v_0.Pos, OpARM64CMNW, types.TypeFlags)
 24706  				v0.AddArg2(x, y)
 24707  				b.resetWithControl(BlockARM64NE, v0)
 24708  				return true
 24709  			}
 24710  			break
 24711  		}
 24712  		// match: (NE (CMP x z:(NEG y)) yes no)
 24713  		// cond: z.Uses == 1
 24714  		// result: (NE (CMN x y) yes no)
 24715  		for b.Controls[0].Op == OpARM64CMP {
 24716  			v_0 := b.Controls[0]
 24717  			_ = v_0.Args[1]
 24718  			x := v_0.Args[0]
 24719  			z := v_0.Args[1]
 24720  			if z.Op != OpARM64NEG {
 24721  				break
 24722  			}
 24723  			y := z.Args[0]
 24724  			if !(z.Uses == 1) {
 24725  				break
 24726  			}
 24727  			v0 := b.NewValue0(v_0.Pos, OpARM64CMN, types.TypeFlags)
 24728  			v0.AddArg2(x, y)
 24729  			b.resetWithControl(BlockARM64NE, v0)
 24730  			return true
 24731  		}
 24732  		// match: (NE (CMPW x z:(NEG y)) yes no)
 24733  		// cond: z.Uses == 1
 24734  		// result: (NE (CMNW x y) yes no)
 24735  		for b.Controls[0].Op == OpARM64CMPW {
 24736  			v_0 := b.Controls[0]
 24737  			_ = v_0.Args[1]
 24738  			x := v_0.Args[0]
 24739  			z := v_0.Args[1]
 24740  			if z.Op != OpARM64NEG {
 24741  				break
 24742  			}
 24743  			y := z.Args[0]
 24744  			if !(z.Uses == 1) {
 24745  				break
 24746  			}
 24747  			v0 := b.NewValue0(v_0.Pos, OpARM64CMNW, types.TypeFlags)
 24748  			v0.AddArg2(x, y)
 24749  			b.resetWithControl(BlockARM64NE, v0)
 24750  			return true
 24751  		}
 24752  		// match: (NE (CMPconst [0] x) yes no)
 24753  		// result: (NZ x yes no)
 24754  		for b.Controls[0].Op == OpARM64CMPconst {
 24755  			v_0 := b.Controls[0]
 24756  			if auxIntToInt64(v_0.AuxInt) != 0 {
 24757  				break
 24758  			}
 24759  			x := v_0.Args[0]
 24760  			b.resetWithControl(BlockARM64NZ, x)
 24761  			return true
 24762  		}
 24763  		// match: (NE (CMPWconst [0] x) yes no)
 24764  		// result: (NZW x yes no)
 24765  		for b.Controls[0].Op == OpARM64CMPWconst {
 24766  			v_0 := b.Controls[0]
 24767  			if auxIntToInt32(v_0.AuxInt) != 0 {
 24768  				break
 24769  			}
 24770  			x := v_0.Args[0]
 24771  			b.resetWithControl(BlockARM64NZW, x)
 24772  			return true
 24773  		}
 24774  		// match: (NE (CMPconst [0] z:(MADD a x y)) yes no)
 24775  		// cond: z.Uses==1
 24776  		// result: (NE (CMN a (MUL <x.Type> x y)) yes no)
 24777  		for b.Controls[0].Op == OpARM64CMPconst {
 24778  			v_0 := b.Controls[0]
 24779  			if auxIntToInt64(v_0.AuxInt) != 0 {
 24780  				break
 24781  			}
 24782  			z := v_0.Args[0]
 24783  			if z.Op != OpARM64MADD {
 24784  				break
 24785  			}
 24786  			y := z.Args[2]
 24787  			a := z.Args[0]
 24788  			x := z.Args[1]
 24789  			if !(z.Uses == 1) {
 24790  				break
 24791  			}
 24792  			v0 := b.NewValue0(v_0.Pos, OpARM64CMN, types.TypeFlags)
 24793  			v1 := b.NewValue0(v_0.Pos, OpARM64MUL, x.Type)
 24794  			v1.AddArg2(x, y)
 24795  			v0.AddArg2(a, v1)
 24796  			b.resetWithControl(BlockARM64NE, v0)
 24797  			return true
 24798  		}
 24799  		// match: (NE (CMPconst [0] z:(MSUB a x y)) yes no)
 24800  		// cond: z.Uses==1
 24801  		// result: (NE (CMP a (MUL <x.Type> x y)) yes no)
 24802  		for b.Controls[0].Op == OpARM64CMPconst {
 24803  			v_0 := b.Controls[0]
 24804  			if auxIntToInt64(v_0.AuxInt) != 0 {
 24805  				break
 24806  			}
 24807  			z := v_0.Args[0]
 24808  			if z.Op != OpARM64MSUB {
 24809  				break
 24810  			}
 24811  			y := z.Args[2]
 24812  			a := z.Args[0]
 24813  			x := z.Args[1]
 24814  			if !(z.Uses == 1) {
 24815  				break
 24816  			}
 24817  			v0 := b.NewValue0(v_0.Pos, OpARM64CMP, types.TypeFlags)
 24818  			v1 := b.NewValue0(v_0.Pos, OpARM64MUL, x.Type)
 24819  			v1.AddArg2(x, y)
 24820  			v0.AddArg2(a, v1)
 24821  			b.resetWithControl(BlockARM64NE, v0)
 24822  			return true
 24823  		}
 24824  		// match: (NE (CMPWconst [0] z:(MADDW a x y)) yes no)
 24825  		// cond: z.Uses==1
 24826  		// result: (NE (CMNW a (MULW <x.Type> x y)) yes no)
 24827  		for b.Controls[0].Op == OpARM64CMPWconst {
 24828  			v_0 := b.Controls[0]
 24829  			if auxIntToInt32(v_0.AuxInt) != 0 {
 24830  				break
 24831  			}
 24832  			z := v_0.Args[0]
 24833  			if z.Op != OpARM64MADDW {
 24834  				break
 24835  			}
 24836  			y := z.Args[2]
 24837  			a := z.Args[0]
 24838  			x := z.Args[1]
 24839  			if !(z.Uses == 1) {
 24840  				break
 24841  			}
 24842  			v0 := b.NewValue0(v_0.Pos, OpARM64CMNW, types.TypeFlags)
 24843  			v1 := b.NewValue0(v_0.Pos, OpARM64MULW, x.Type)
 24844  			v1.AddArg2(x, y)
 24845  			v0.AddArg2(a, v1)
 24846  			b.resetWithControl(BlockARM64NE, v0)
 24847  			return true
 24848  		}
 24849  		// match: (NE (CMPWconst [0] z:(MSUBW a x y)) yes no)
 24850  		// cond: z.Uses==1
 24851  		// result: (NE (CMPW a (MULW <x.Type> x y)) yes no)
 24852  		for b.Controls[0].Op == OpARM64CMPWconst {
 24853  			v_0 := b.Controls[0]
 24854  			if auxIntToInt32(v_0.AuxInt) != 0 {
 24855  				break
 24856  			}
 24857  			z := v_0.Args[0]
 24858  			if z.Op != OpARM64MSUBW {
 24859  				break
 24860  			}
 24861  			y := z.Args[2]
 24862  			a := z.Args[0]
 24863  			x := z.Args[1]
 24864  			if !(z.Uses == 1) {
 24865  				break
 24866  			}
 24867  			v0 := b.NewValue0(v_0.Pos, OpARM64CMPW, types.TypeFlags)
 24868  			v1 := b.NewValue0(v_0.Pos, OpARM64MULW, x.Type)
 24869  			v1.AddArg2(x, y)
 24870  			v0.AddArg2(a, v1)
 24871  			b.resetWithControl(BlockARM64NE, v0)
 24872  			return true
 24873  		}
 24874  		// match: (NE (TSTconst [c] x) yes no)
 24875  		// cond: oneBit(c)
 24876  		// result: (TBNZ [int64(ntz64(c))] x yes no)
 24877  		for b.Controls[0].Op == OpARM64TSTconst {
 24878  			v_0 := b.Controls[0]
 24879  			c := auxIntToInt64(v_0.AuxInt)
 24880  			x := v_0.Args[0]
 24881  			if !(oneBit(c)) {
 24882  				break
 24883  			}
 24884  			b.resetWithControl(BlockARM64TBNZ, x)
 24885  			b.AuxInt = int64ToAuxInt(int64(ntz64(c)))
 24886  			return true
 24887  		}
 24888  		// match: (NE (TSTWconst [c] x) yes no)
 24889  		// cond: oneBit(int64(uint32(c)))
 24890  		// result: (TBNZ [int64(ntz64(int64(uint32(c))))] x yes no)
 24891  		for b.Controls[0].Op == OpARM64TSTWconst {
 24892  			v_0 := b.Controls[0]
 24893  			c := auxIntToInt32(v_0.AuxInt)
 24894  			x := v_0.Args[0]
 24895  			if !(oneBit(int64(uint32(c)))) {
 24896  				break
 24897  			}
 24898  			b.resetWithControl(BlockARM64TBNZ, x)
 24899  			b.AuxInt = int64ToAuxInt(int64(ntz64(int64(uint32(c)))))
 24900  			return true
 24901  		}
 24902  		// match: (NE (FlagConstant [fc]) yes no)
 24903  		// cond: fc.ne()
 24904  		// result: (First yes no)
 24905  		for b.Controls[0].Op == OpARM64FlagConstant {
 24906  			v_0 := b.Controls[0]
 24907  			fc := auxIntToFlagConstant(v_0.AuxInt)
 24908  			if !(fc.ne()) {
 24909  				break
 24910  			}
 24911  			b.Reset(BlockFirst)
 24912  			return true
 24913  		}
 24914  		// match: (NE (FlagConstant [fc]) yes no)
 24915  		// cond: !fc.ne()
 24916  		// result: (First no yes)
 24917  		for b.Controls[0].Op == OpARM64FlagConstant {
 24918  			v_0 := b.Controls[0]
 24919  			fc := auxIntToFlagConstant(v_0.AuxInt)
 24920  			if !(!fc.ne()) {
 24921  				break
 24922  			}
 24923  			b.Reset(BlockFirst)
 24924  			b.swapSuccessors()
 24925  			return true
 24926  		}
 24927  		// match: (NE (InvertFlags cmp) yes no)
 24928  		// result: (NE cmp yes no)
 24929  		for b.Controls[0].Op == OpARM64InvertFlags {
 24930  			v_0 := b.Controls[0]
 24931  			cmp := v_0.Args[0]
 24932  			b.resetWithControl(BlockARM64NE, cmp)
 24933  			return true
 24934  		}
 24935  	case BlockARM64NZ:
 24936  		// match: (NZ (Equal cc) yes no)
 24937  		// result: (EQ cc yes no)
 24938  		for b.Controls[0].Op == OpARM64Equal {
 24939  			v_0 := b.Controls[0]
 24940  			cc := v_0.Args[0]
 24941  			b.resetWithControl(BlockARM64EQ, cc)
 24942  			return true
 24943  		}
 24944  		// match: (NZ (NotEqual cc) yes no)
 24945  		// result: (NE cc yes no)
 24946  		for b.Controls[0].Op == OpARM64NotEqual {
 24947  			v_0 := b.Controls[0]
 24948  			cc := v_0.Args[0]
 24949  			b.resetWithControl(BlockARM64NE, cc)
 24950  			return true
 24951  		}
 24952  		// match: (NZ (LessThan cc) yes no)
 24953  		// result: (LT cc yes no)
 24954  		for b.Controls[0].Op == OpARM64LessThan {
 24955  			v_0 := b.Controls[0]
 24956  			cc := v_0.Args[0]
 24957  			b.resetWithControl(BlockARM64LT, cc)
 24958  			return true
 24959  		}
 24960  		// match: (NZ (LessThanU cc) yes no)
 24961  		// result: (ULT cc yes no)
 24962  		for b.Controls[0].Op == OpARM64LessThanU {
 24963  			v_0 := b.Controls[0]
 24964  			cc := v_0.Args[0]
 24965  			b.resetWithControl(BlockARM64ULT, cc)
 24966  			return true
 24967  		}
 24968  		// match: (NZ (LessEqual cc) yes no)
 24969  		// result: (LE cc yes no)
 24970  		for b.Controls[0].Op == OpARM64LessEqual {
 24971  			v_0 := b.Controls[0]
 24972  			cc := v_0.Args[0]
 24973  			b.resetWithControl(BlockARM64LE, cc)
 24974  			return true
 24975  		}
 24976  		// match: (NZ (LessEqualU cc) yes no)
 24977  		// result: (ULE cc yes no)
 24978  		for b.Controls[0].Op == OpARM64LessEqualU {
 24979  			v_0 := b.Controls[0]
 24980  			cc := v_0.Args[0]
 24981  			b.resetWithControl(BlockARM64ULE, cc)
 24982  			return true
 24983  		}
 24984  		// match: (NZ (GreaterThan cc) yes no)
 24985  		// result: (GT cc yes no)
 24986  		for b.Controls[0].Op == OpARM64GreaterThan {
 24987  			v_0 := b.Controls[0]
 24988  			cc := v_0.Args[0]
 24989  			b.resetWithControl(BlockARM64GT, cc)
 24990  			return true
 24991  		}
 24992  		// match: (NZ (GreaterThanU cc) yes no)
 24993  		// result: (UGT cc yes no)
 24994  		for b.Controls[0].Op == OpARM64GreaterThanU {
 24995  			v_0 := b.Controls[0]
 24996  			cc := v_0.Args[0]
 24997  			b.resetWithControl(BlockARM64UGT, cc)
 24998  			return true
 24999  		}
 25000  		// match: (NZ (GreaterEqual cc) yes no)
 25001  		// result: (GE cc yes no)
 25002  		for b.Controls[0].Op == OpARM64GreaterEqual {
 25003  			v_0 := b.Controls[0]
 25004  			cc := v_0.Args[0]
 25005  			b.resetWithControl(BlockARM64GE, cc)
 25006  			return true
 25007  		}
 25008  		// match: (NZ (GreaterEqualU cc) yes no)
 25009  		// result: (UGE cc yes no)
 25010  		for b.Controls[0].Op == OpARM64GreaterEqualU {
 25011  			v_0 := b.Controls[0]
 25012  			cc := v_0.Args[0]
 25013  			b.resetWithControl(BlockARM64UGE, cc)
 25014  			return true
 25015  		}
 25016  		// match: (NZ (LessThanF cc) yes no)
 25017  		// result: (FLT cc yes no)
 25018  		for b.Controls[0].Op == OpARM64LessThanF {
 25019  			v_0 := b.Controls[0]
 25020  			cc := v_0.Args[0]
 25021  			b.resetWithControl(BlockARM64FLT, cc)
 25022  			return true
 25023  		}
 25024  		// match: (NZ (LessEqualF cc) yes no)
 25025  		// result: (FLE cc yes no)
 25026  		for b.Controls[0].Op == OpARM64LessEqualF {
 25027  			v_0 := b.Controls[0]
 25028  			cc := v_0.Args[0]
 25029  			b.resetWithControl(BlockARM64FLE, cc)
 25030  			return true
 25031  		}
 25032  		// match: (NZ (GreaterThanF cc) yes no)
 25033  		// result: (FGT cc yes no)
 25034  		for b.Controls[0].Op == OpARM64GreaterThanF {
 25035  			v_0 := b.Controls[0]
 25036  			cc := v_0.Args[0]
 25037  			b.resetWithControl(BlockARM64FGT, cc)
 25038  			return true
 25039  		}
 25040  		// match: (NZ (GreaterEqualF cc) yes no)
 25041  		// result: (FGE cc yes no)
 25042  		for b.Controls[0].Op == OpARM64GreaterEqualF {
 25043  			v_0 := b.Controls[0]
 25044  			cc := v_0.Args[0]
 25045  			b.resetWithControl(BlockARM64FGE, cc)
 25046  			return true
 25047  		}
 25048  		// match: (NZ (ANDconst [c] x) yes no)
 25049  		// cond: oneBit(c)
 25050  		// result: (TBNZ [int64(ntz64(c))] x yes no)
 25051  		for b.Controls[0].Op == OpARM64ANDconst {
 25052  			v_0 := b.Controls[0]
 25053  			c := auxIntToInt64(v_0.AuxInt)
 25054  			x := v_0.Args[0]
 25055  			if !(oneBit(c)) {
 25056  				break
 25057  			}
 25058  			b.resetWithControl(BlockARM64TBNZ, x)
 25059  			b.AuxInt = int64ToAuxInt(int64(ntz64(c)))
 25060  			return true
 25061  		}
 25062  		// match: (NZ (MOVDconst [0]) yes no)
 25063  		// result: (First no yes)
 25064  		for b.Controls[0].Op == OpARM64MOVDconst {
 25065  			v_0 := b.Controls[0]
 25066  			if auxIntToInt64(v_0.AuxInt) != 0 {
 25067  				break
 25068  			}
 25069  			b.Reset(BlockFirst)
 25070  			b.swapSuccessors()
 25071  			return true
 25072  		}
 25073  		// match: (NZ (MOVDconst [c]) yes no)
 25074  		// cond: c != 0
 25075  		// result: (First yes no)
 25076  		for b.Controls[0].Op == OpARM64MOVDconst {
 25077  			v_0 := b.Controls[0]
 25078  			c := auxIntToInt64(v_0.AuxInt)
 25079  			if !(c != 0) {
 25080  				break
 25081  			}
 25082  			b.Reset(BlockFirst)
 25083  			return true
 25084  		}
 25085  	case BlockARM64NZW:
 25086  		// match: (NZW (ANDconst [c] x) yes no)
 25087  		// cond: oneBit(int64(uint32(c)))
 25088  		// result: (TBNZ [int64(ntz64(int64(uint32(c))))] x yes no)
 25089  		for b.Controls[0].Op == OpARM64ANDconst {
 25090  			v_0 := b.Controls[0]
 25091  			c := auxIntToInt64(v_0.AuxInt)
 25092  			x := v_0.Args[0]
 25093  			if !(oneBit(int64(uint32(c)))) {
 25094  				break
 25095  			}
 25096  			b.resetWithControl(BlockARM64TBNZ, x)
 25097  			b.AuxInt = int64ToAuxInt(int64(ntz64(int64(uint32(c)))))
 25098  			return true
 25099  		}
 25100  		// match: (NZW (MOVDconst [c]) yes no)
 25101  		// cond: int32(c) == 0
 25102  		// result: (First no yes)
 25103  		for b.Controls[0].Op == OpARM64MOVDconst {
 25104  			v_0 := b.Controls[0]
 25105  			c := auxIntToInt64(v_0.AuxInt)
 25106  			if !(int32(c) == 0) {
 25107  				break
 25108  			}
 25109  			b.Reset(BlockFirst)
 25110  			b.swapSuccessors()
 25111  			return true
 25112  		}
 25113  		// match: (NZW (MOVDconst [c]) yes no)
 25114  		// cond: int32(c) != 0
 25115  		// result: (First yes no)
 25116  		for b.Controls[0].Op == OpARM64MOVDconst {
 25117  			v_0 := b.Controls[0]
 25118  			c := auxIntToInt64(v_0.AuxInt)
 25119  			if !(int32(c) != 0) {
 25120  				break
 25121  			}
 25122  			b.Reset(BlockFirst)
 25123  			return true
 25124  		}
 25125  	case BlockARM64TBNZ:
 25126  		// match: (TBNZ [0] (Equal cc) yes no)
 25127  		// result: (EQ cc yes no)
 25128  		for b.Controls[0].Op == OpARM64Equal {
 25129  			v_0 := b.Controls[0]
 25130  			cc := v_0.Args[0]
 25131  			if auxIntToInt64(b.AuxInt) != 0 {
 25132  				break
 25133  			}
 25134  			b.resetWithControl(BlockARM64EQ, cc)
 25135  			return true
 25136  		}
 25137  		// match: (TBNZ [0] (NotEqual cc) yes no)
 25138  		// result: (NE cc yes no)
 25139  		for b.Controls[0].Op == OpARM64NotEqual {
 25140  			v_0 := b.Controls[0]
 25141  			cc := v_0.Args[0]
 25142  			if auxIntToInt64(b.AuxInt) != 0 {
 25143  				break
 25144  			}
 25145  			b.resetWithControl(BlockARM64NE, cc)
 25146  			return true
 25147  		}
 25148  		// match: (TBNZ [0] (LessThan cc) yes no)
 25149  		// result: (LT cc yes no)
 25150  		for b.Controls[0].Op == OpARM64LessThan {
 25151  			v_0 := b.Controls[0]
 25152  			cc := v_0.Args[0]
 25153  			if auxIntToInt64(b.AuxInt) != 0 {
 25154  				break
 25155  			}
 25156  			b.resetWithControl(BlockARM64LT, cc)
 25157  			return true
 25158  		}
 25159  		// match: (TBNZ [0] (LessThanU cc) yes no)
 25160  		// result: (ULT cc yes no)
 25161  		for b.Controls[0].Op == OpARM64LessThanU {
 25162  			v_0 := b.Controls[0]
 25163  			cc := v_0.Args[0]
 25164  			if auxIntToInt64(b.AuxInt) != 0 {
 25165  				break
 25166  			}
 25167  			b.resetWithControl(BlockARM64ULT, cc)
 25168  			return true
 25169  		}
 25170  		// match: (TBNZ [0] (LessEqual cc) yes no)
 25171  		// result: (LE cc yes no)
 25172  		for b.Controls[0].Op == OpARM64LessEqual {
 25173  			v_0 := b.Controls[0]
 25174  			cc := v_0.Args[0]
 25175  			if auxIntToInt64(b.AuxInt) != 0 {
 25176  				break
 25177  			}
 25178  			b.resetWithControl(BlockARM64LE, cc)
 25179  			return true
 25180  		}
 25181  		// match: (TBNZ [0] (LessEqualU cc) yes no)
 25182  		// result: (ULE cc yes no)
 25183  		for b.Controls[0].Op == OpARM64LessEqualU {
 25184  			v_0 := b.Controls[0]
 25185  			cc := v_0.Args[0]
 25186  			if auxIntToInt64(b.AuxInt) != 0 {
 25187  				break
 25188  			}
 25189  			b.resetWithControl(BlockARM64ULE, cc)
 25190  			return true
 25191  		}
 25192  		// match: (TBNZ [0] (GreaterThan cc) yes no)
 25193  		// result: (GT cc yes no)
 25194  		for b.Controls[0].Op == OpARM64GreaterThan {
 25195  			v_0 := b.Controls[0]
 25196  			cc := v_0.Args[0]
 25197  			if auxIntToInt64(b.AuxInt) != 0 {
 25198  				break
 25199  			}
 25200  			b.resetWithControl(BlockARM64GT, cc)
 25201  			return true
 25202  		}
 25203  		// match: (TBNZ [0] (GreaterThanU cc) yes no)
 25204  		// result: (UGT cc yes no)
 25205  		for b.Controls[0].Op == OpARM64GreaterThanU {
 25206  			v_0 := b.Controls[0]
 25207  			cc := v_0.Args[0]
 25208  			if auxIntToInt64(b.AuxInt) != 0 {
 25209  				break
 25210  			}
 25211  			b.resetWithControl(BlockARM64UGT, cc)
 25212  			return true
 25213  		}
 25214  		// match: (TBNZ [0] (GreaterEqual cc) yes no)
 25215  		// result: (GE cc yes no)
 25216  		for b.Controls[0].Op == OpARM64GreaterEqual {
 25217  			v_0 := b.Controls[0]
 25218  			cc := v_0.Args[0]
 25219  			if auxIntToInt64(b.AuxInt) != 0 {
 25220  				break
 25221  			}
 25222  			b.resetWithControl(BlockARM64GE, cc)
 25223  			return true
 25224  		}
 25225  		// match: (TBNZ [0] (GreaterEqualU cc) yes no)
 25226  		// result: (UGE cc yes no)
 25227  		for b.Controls[0].Op == OpARM64GreaterEqualU {
 25228  			v_0 := b.Controls[0]
 25229  			cc := v_0.Args[0]
 25230  			if auxIntToInt64(b.AuxInt) != 0 {
 25231  				break
 25232  			}
 25233  			b.resetWithControl(BlockARM64UGE, cc)
 25234  			return true
 25235  		}
 25236  		// match: (TBNZ [0] (LessThanF cc) yes no)
 25237  		// result: (FLT cc yes no)
 25238  		for b.Controls[0].Op == OpARM64LessThanF {
 25239  			v_0 := b.Controls[0]
 25240  			cc := v_0.Args[0]
 25241  			if auxIntToInt64(b.AuxInt) != 0 {
 25242  				break
 25243  			}
 25244  			b.resetWithControl(BlockARM64FLT, cc)
 25245  			return true
 25246  		}
 25247  		// match: (TBNZ [0] (LessEqualF cc) yes no)
 25248  		// result: (FLE cc yes no)
 25249  		for b.Controls[0].Op == OpARM64LessEqualF {
 25250  			v_0 := b.Controls[0]
 25251  			cc := v_0.Args[0]
 25252  			if auxIntToInt64(b.AuxInt) != 0 {
 25253  				break
 25254  			}
 25255  			b.resetWithControl(BlockARM64FLE, cc)
 25256  			return true
 25257  		}
 25258  		// match: (TBNZ [0] (GreaterThanF cc) yes no)
 25259  		// result: (FGT cc yes no)
 25260  		for b.Controls[0].Op == OpARM64GreaterThanF {
 25261  			v_0 := b.Controls[0]
 25262  			cc := v_0.Args[0]
 25263  			if auxIntToInt64(b.AuxInt) != 0 {
 25264  				break
 25265  			}
 25266  			b.resetWithControl(BlockARM64FGT, cc)
 25267  			return true
 25268  		}
 25269  		// match: (TBNZ [0] (GreaterEqualF cc) yes no)
 25270  		// result: (FGE cc yes no)
 25271  		for b.Controls[0].Op == OpARM64GreaterEqualF {
 25272  			v_0 := b.Controls[0]
 25273  			cc := v_0.Args[0]
 25274  			if auxIntToInt64(b.AuxInt) != 0 {
 25275  				break
 25276  			}
 25277  			b.resetWithControl(BlockARM64FGE, cc)
 25278  			return true
 25279  		}
 25280  	case BlockARM64UGE:
 25281  		// match: (UGE (FlagConstant [fc]) yes no)
 25282  		// cond: fc.uge()
 25283  		// result: (First yes no)
 25284  		for b.Controls[0].Op == OpARM64FlagConstant {
 25285  			v_0 := b.Controls[0]
 25286  			fc := auxIntToFlagConstant(v_0.AuxInt)
 25287  			if !(fc.uge()) {
 25288  				break
 25289  			}
 25290  			b.Reset(BlockFirst)
 25291  			return true
 25292  		}
 25293  		// match: (UGE (FlagConstant [fc]) yes no)
 25294  		// cond: !fc.uge()
 25295  		// result: (First no yes)
 25296  		for b.Controls[0].Op == OpARM64FlagConstant {
 25297  			v_0 := b.Controls[0]
 25298  			fc := auxIntToFlagConstant(v_0.AuxInt)
 25299  			if !(!fc.uge()) {
 25300  				break
 25301  			}
 25302  			b.Reset(BlockFirst)
 25303  			b.swapSuccessors()
 25304  			return true
 25305  		}
 25306  		// match: (UGE (InvertFlags cmp) yes no)
 25307  		// result: (ULE cmp yes no)
 25308  		for b.Controls[0].Op == OpARM64InvertFlags {
 25309  			v_0 := b.Controls[0]
 25310  			cmp := v_0.Args[0]
 25311  			b.resetWithControl(BlockARM64ULE, cmp)
 25312  			return true
 25313  		}
 25314  	case BlockARM64UGT:
 25315  		// match: (UGT (FlagConstant [fc]) yes no)
 25316  		// cond: fc.ugt()
 25317  		// result: (First yes no)
 25318  		for b.Controls[0].Op == OpARM64FlagConstant {
 25319  			v_0 := b.Controls[0]
 25320  			fc := auxIntToFlagConstant(v_0.AuxInt)
 25321  			if !(fc.ugt()) {
 25322  				break
 25323  			}
 25324  			b.Reset(BlockFirst)
 25325  			return true
 25326  		}
 25327  		// match: (UGT (FlagConstant [fc]) yes no)
 25328  		// cond: !fc.ugt()
 25329  		// result: (First no yes)
 25330  		for b.Controls[0].Op == OpARM64FlagConstant {
 25331  			v_0 := b.Controls[0]
 25332  			fc := auxIntToFlagConstant(v_0.AuxInt)
 25333  			if !(!fc.ugt()) {
 25334  				break
 25335  			}
 25336  			b.Reset(BlockFirst)
 25337  			b.swapSuccessors()
 25338  			return true
 25339  		}
 25340  		// match: (UGT (InvertFlags cmp) yes no)
 25341  		// result: (ULT cmp yes no)
 25342  		for b.Controls[0].Op == OpARM64InvertFlags {
 25343  			v_0 := b.Controls[0]
 25344  			cmp := v_0.Args[0]
 25345  			b.resetWithControl(BlockARM64ULT, cmp)
 25346  			return true
 25347  		}
 25348  	case BlockARM64ULE:
 25349  		// match: (ULE (FlagConstant [fc]) yes no)
 25350  		// cond: fc.ule()
 25351  		// result: (First yes no)
 25352  		for b.Controls[0].Op == OpARM64FlagConstant {
 25353  			v_0 := b.Controls[0]
 25354  			fc := auxIntToFlagConstant(v_0.AuxInt)
 25355  			if !(fc.ule()) {
 25356  				break
 25357  			}
 25358  			b.Reset(BlockFirst)
 25359  			return true
 25360  		}
 25361  		// match: (ULE (FlagConstant [fc]) yes no)
 25362  		// cond: !fc.ule()
 25363  		// result: (First no yes)
 25364  		for b.Controls[0].Op == OpARM64FlagConstant {
 25365  			v_0 := b.Controls[0]
 25366  			fc := auxIntToFlagConstant(v_0.AuxInt)
 25367  			if !(!fc.ule()) {
 25368  				break
 25369  			}
 25370  			b.Reset(BlockFirst)
 25371  			b.swapSuccessors()
 25372  			return true
 25373  		}
 25374  		// match: (ULE (InvertFlags cmp) yes no)
 25375  		// result: (UGE cmp yes no)
 25376  		for b.Controls[0].Op == OpARM64InvertFlags {
 25377  			v_0 := b.Controls[0]
 25378  			cmp := v_0.Args[0]
 25379  			b.resetWithControl(BlockARM64UGE, cmp)
 25380  			return true
 25381  		}
 25382  	case BlockARM64ULT:
 25383  		// match: (ULT (FlagConstant [fc]) yes no)
 25384  		// cond: fc.ult()
 25385  		// result: (First yes no)
 25386  		for b.Controls[0].Op == OpARM64FlagConstant {
 25387  			v_0 := b.Controls[0]
 25388  			fc := auxIntToFlagConstant(v_0.AuxInt)
 25389  			if !(fc.ult()) {
 25390  				break
 25391  			}
 25392  			b.Reset(BlockFirst)
 25393  			return true
 25394  		}
 25395  		// match: (ULT (FlagConstant [fc]) yes no)
 25396  		// cond: !fc.ult()
 25397  		// result: (First no yes)
 25398  		for b.Controls[0].Op == OpARM64FlagConstant {
 25399  			v_0 := b.Controls[0]
 25400  			fc := auxIntToFlagConstant(v_0.AuxInt)
 25401  			if !(!fc.ult()) {
 25402  				break
 25403  			}
 25404  			b.Reset(BlockFirst)
 25405  			b.swapSuccessors()
 25406  			return true
 25407  		}
 25408  		// match: (ULT (InvertFlags cmp) yes no)
 25409  		// result: (UGT cmp yes no)
 25410  		for b.Controls[0].Op == OpARM64InvertFlags {
 25411  			v_0 := b.Controls[0]
 25412  			cmp := v_0.Args[0]
 25413  			b.resetWithControl(BlockARM64UGT, cmp)
 25414  			return true
 25415  		}
 25416  	case BlockARM64Z:
 25417  		// match: (Z (ANDconst [c] x) yes no)
 25418  		// cond: oneBit(c)
 25419  		// result: (TBZ [int64(ntz64(c))] x yes no)
 25420  		for b.Controls[0].Op == OpARM64ANDconst {
 25421  			v_0 := b.Controls[0]
 25422  			c := auxIntToInt64(v_0.AuxInt)
 25423  			x := v_0.Args[0]
 25424  			if !(oneBit(c)) {
 25425  				break
 25426  			}
 25427  			b.resetWithControl(BlockARM64TBZ, x)
 25428  			b.AuxInt = int64ToAuxInt(int64(ntz64(c)))
 25429  			return true
 25430  		}
 25431  		// match: (Z (MOVDconst [0]) yes no)
 25432  		// result: (First yes no)
 25433  		for b.Controls[0].Op == OpARM64MOVDconst {
 25434  			v_0 := b.Controls[0]
 25435  			if auxIntToInt64(v_0.AuxInt) != 0 {
 25436  				break
 25437  			}
 25438  			b.Reset(BlockFirst)
 25439  			return true
 25440  		}
 25441  		// match: (Z (MOVDconst [c]) yes no)
 25442  		// cond: c != 0
 25443  		// result: (First no yes)
 25444  		for b.Controls[0].Op == OpARM64MOVDconst {
 25445  			v_0 := b.Controls[0]
 25446  			c := auxIntToInt64(v_0.AuxInt)
 25447  			if !(c != 0) {
 25448  				break
 25449  			}
 25450  			b.Reset(BlockFirst)
 25451  			b.swapSuccessors()
 25452  			return true
 25453  		}
 25454  	case BlockARM64ZW:
 25455  		// match: (ZW (ANDconst [c] x) yes no)
 25456  		// cond: oneBit(int64(uint32(c)))
 25457  		// result: (TBZ [int64(ntz64(int64(uint32(c))))] x yes no)
 25458  		for b.Controls[0].Op == OpARM64ANDconst {
 25459  			v_0 := b.Controls[0]
 25460  			c := auxIntToInt64(v_0.AuxInt)
 25461  			x := v_0.Args[0]
 25462  			if !(oneBit(int64(uint32(c)))) {
 25463  				break
 25464  			}
 25465  			b.resetWithControl(BlockARM64TBZ, x)
 25466  			b.AuxInt = int64ToAuxInt(int64(ntz64(int64(uint32(c)))))
 25467  			return true
 25468  		}
 25469  		// match: (ZW (MOVDconst [c]) yes no)
 25470  		// cond: int32(c) == 0
 25471  		// result: (First yes no)
 25472  		for b.Controls[0].Op == OpARM64MOVDconst {
 25473  			v_0 := b.Controls[0]
 25474  			c := auxIntToInt64(v_0.AuxInt)
 25475  			if !(int32(c) == 0) {
 25476  				break
 25477  			}
 25478  			b.Reset(BlockFirst)
 25479  			return true
 25480  		}
 25481  		// match: (ZW (MOVDconst [c]) yes no)
 25482  		// cond: int32(c) != 0
 25483  		// result: (First no yes)
 25484  		for b.Controls[0].Op == OpARM64MOVDconst {
 25485  			v_0 := b.Controls[0]
 25486  			c := auxIntToInt64(v_0.AuxInt)
 25487  			if !(int32(c) != 0) {
 25488  				break
 25489  			}
 25490  			b.Reset(BlockFirst)
 25491  			b.swapSuccessors()
 25492  			return true
 25493  		}
 25494  	}
 25495  	return false
 25496  }
 25497  

View as plain text